effect 4.0.6 → 4.0.7
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/Arbitrary.d.ts +10 -2
- package/dist/Arbitrary.d.ts.map +1 -1
- package/dist/Arbitrary.js +2 -1
- package/dist/Arbitrary.js.map +1 -1
- package/dist/Channel.d.ts.map +1 -1
- package/dist/Channel.js +21 -6
- package/dist/Channel.js.map +1 -1
- package/dist/Data.d.ts +54 -235
- package/dist/Data.d.ts.map +1 -1
- package/dist/Data.js.map +1 -1
- package/dist/Effect.d.ts +1 -1
- package/dist/Effect.js +1 -1
- package/dist/Equal.d.ts.map +1 -1
- package/dist/Equal.js +8 -1
- package/dist/Equal.js.map +1 -1
- package/dist/Exit.d.ts +3 -3
- package/dist/Exit.d.ts.map +1 -1
- package/dist/Exit.js.map +1 -1
- package/dist/Formatter.d.ts.map +1 -1
- package/dist/Formatter.js +27 -13
- package/dist/Formatter.js.map +1 -1
- package/dist/Hash.d.ts.map +1 -1
- package/dist/Hash.js +4 -1
- package/dist/Hash.js.map +1 -1
- package/dist/JsonPatch.js +4 -0
- package/dist/JsonPatch.js.map +1 -1
- package/dist/JsonSchema.d.ts.map +1 -1
- package/dist/JsonSchema.js +13 -40
- package/dist/JsonSchema.js.map +1 -1
- package/dist/Metric.d.ts +3 -3
- package/dist/MutableList.d.ts +5 -2
- package/dist/MutableList.d.ts.map +1 -1
- package/dist/MutableList.js +7 -5
- package/dist/MutableList.js.map +1 -1
- package/dist/MutableRef.d.ts.map +1 -1
- package/dist/MutableRef.js +7 -0
- package/dist/MutableRef.js.map +1 -1
- package/dist/PartitionedSemaphore.d.ts +2 -1
- package/dist/PartitionedSemaphore.d.ts.map +1 -1
- package/dist/PartitionedSemaphore.js +22 -12
- package/dist/PartitionedSemaphore.js.map +1 -1
- package/dist/Pool.d.ts.map +1 -1
- package/dist/Pool.js +77 -27
- package/dist/Pool.js.map +1 -1
- package/dist/PubSub.d.ts.map +1 -1
- package/dist/PubSub.js +5 -6
- package/dist/PubSub.js.map +1 -1
- package/dist/Ref.d.ts.map +1 -1
- package/dist/Ref.js +8 -0
- package/dist/Ref.js.map +1 -1
- package/dist/Schedule.js +1 -1
- package/dist/Schedule.js.map +1 -1
- package/dist/Schema.d.ts +24 -8
- package/dist/Schema.d.ts.map +1 -1
- package/dist/Schema.js +37 -28
- package/dist/Schema.js.map +1 -1
- package/dist/SchemaAST.d.ts +4 -2
- package/dist/SchemaAST.d.ts.map +1 -1
- package/dist/SchemaAST.js +14 -17
- package/dist/SchemaAST.js.map +1 -1
- package/dist/SchemaParser.d.ts.map +1 -1
- package/dist/SchemaParser.js +48 -22
- package/dist/SchemaParser.js.map +1 -1
- package/dist/SchemaRepresentation.d.ts +19 -10
- package/dist/SchemaRepresentation.d.ts.map +1 -1
- package/dist/SchemaRepresentation.js +23 -13
- package/dist/SchemaRepresentation.js.map +1 -1
- package/dist/SchemaTransformation.d.ts +4 -1
- package/dist/SchemaTransformation.d.ts.map +1 -1
- package/dist/SchemaTransformation.js +9 -2
- package/dist/SchemaTransformation.js.map +1 -1
- package/dist/Semaphore.d.ts.map +1 -1
- package/dist/Semaphore.js +54 -35
- package/dist/Semaphore.js.map +1 -1
- package/dist/Sink.d.ts.map +1 -1
- package/dist/Sink.js +7 -2
- package/dist/Sink.js.map +1 -1
- package/dist/Stream.d.ts.map +1 -1
- package/dist/Stream.js +22 -10
- package/dist/Stream.js.map +1 -1
- package/dist/String.d.ts +3 -0
- package/dist/String.d.ts.map +1 -1
- package/dist/String.js +3 -0
- package/dist/String.js.map +1 -1
- package/dist/Tracer.d.ts +11 -1
- package/dist/Tracer.d.ts.map +1 -1
- package/dist/Tracer.js +6 -1
- package/dist/Tracer.js.map +1 -1
- package/dist/ai/LanguageModel.d.ts.map +1 -1
- package/dist/ai/LanguageModel.js +9 -0
- package/dist/ai/LanguageModel.js.map +1 -1
- package/dist/ai/McpSchema.d.ts +110 -110
- package/dist/ai/McpSchema.d.ts.map +1 -1
- package/dist/ai/McpServer.d.ts.map +1 -1
- package/dist/ai/McpServer.js +21 -15
- package/dist/ai/McpServer.js.map +1 -1
- package/dist/ai/Prompt.d.ts +52 -0
- package/dist/ai/Prompt.d.ts.map +1 -1
- package/dist/ai/Prompt.js +38 -0
- package/dist/ai/Prompt.js.map +1 -1
- package/dist/ai/Response.d.ts +16 -3
- package/dist/ai/Response.d.ts.map +1 -1
- package/dist/ai/Response.js +4 -0
- package/dist/ai/Response.js.map +1 -1
- package/dist/ai/Tool.d.ts +24 -0
- package/dist/ai/Tool.d.ts.map +1 -1
- package/dist/ai/Tool.js +5 -2
- package/dist/ai/Tool.js.map +1 -1
- package/dist/ai/Toolkit.d.ts.map +1 -1
- package/dist/ai/Toolkit.js +8 -1
- package/dist/ai/Toolkit.js.map +1 -1
- package/dist/cli/Argument.d.ts +15 -0
- package/dist/cli/Argument.d.ts.map +1 -1
- package/dist/cli/Argument.js +5 -0
- package/dist/cli/Argument.js.map +1 -1
- package/dist/cli/CliError.d.ts +78 -0
- package/dist/cli/CliError.d.ts.map +1 -1
- package/dist/cli/CliError.js +65 -3
- package/dist/cli/CliError.js.map +1 -1
- package/dist/cli/CliOutput.d.ts +155 -6
- package/dist/cli/CliOutput.d.ts.map +1 -1
- package/dist/cli/CliOutput.js +62 -6
- package/dist/cli/CliOutput.js.map +1 -1
- package/dist/cli/Command.d.ts +24 -16
- package/dist/cli/Command.d.ts.map +1 -1
- package/dist/cli/Command.js +59 -29
- package/dist/cli/Command.js.map +1 -1
- package/dist/cli/Completions.d.ts +58 -0
- package/dist/cli/Completions.d.ts.map +1 -1
- package/dist/cli/Completions.js +49 -9
- package/dist/cli/Completions.js.map +1 -1
- package/dist/cli/Flag.d.ts +15 -0
- package/dist/cli/Flag.d.ts.map +1 -1
- package/dist/cli/Flag.js +5 -0
- package/dist/cli/Flag.js.map +1 -1
- package/dist/cli/GlobalFlag.d.ts.map +1 -1
- package/dist/cli/GlobalFlag.js +15 -7
- package/dist/cli/GlobalFlag.js.map +1 -1
- package/dist/cli/Param.d.ts +9 -0
- package/dist/cli/Param.d.ts.map +1 -1
- package/dist/cli/Param.js +21 -2
- package/dist/cli/Param.js.map +1 -1
- package/dist/cli/TerminalCapabilities.d.ts +3 -2
- package/dist/cli/TerminalCapabilities.d.ts.map +1 -1
- package/dist/cli/TerminalCapabilities.js +3 -1
- package/dist/cli/TerminalCapabilities.js.map +1 -1
- package/dist/cli/internal/completions/bash.js +73 -27
- package/dist/cli/internal/completions/bash.js.map +1 -1
- package/dist/cluster/ClusterWorkflowEngine.d.ts.map +1 -1
- package/dist/cluster/ClusterWorkflowEngine.js +45 -10
- package/dist/cluster/ClusterWorkflowEngine.js.map +1 -1
- package/dist/cluster/MessageStorage.d.ts +23 -45
- package/dist/cluster/MessageStorage.d.ts.map +1 -1
- package/dist/cluster/MessageStorage.js +6 -7
- package/dist/cluster/MessageStorage.js.map +1 -1
- package/dist/cluster/Sharding.d.ts.map +1 -1
- package/dist/cluster/Sharding.js +61 -21
- package/dist/cluster/Sharding.js.map +1 -1
- package/dist/cluster/ShardingConfig.d.ts +10 -0
- package/dist/cluster/ShardingConfig.d.ts.map +1 -1
- package/dist/cluster/ShardingConfig.js.map +1 -1
- package/dist/cluster/Snowflake.d.ts.map +1 -1
- package/dist/cluster/Snowflake.js +3 -7
- package/dist/cluster/Snowflake.js.map +1 -1
- package/dist/cluster/SqlRunnerStorage.d.ts.map +1 -1
- package/dist/cluster/SqlRunnerStorage.js +87 -39
- package/dist/cluster/SqlRunnerStorage.js.map +1 -1
- package/dist/cluster/internal/entityManager.js +54 -20
- package/dist/cluster/internal/entityManager.js.map +1 -1
- package/dist/devtools/DevToolsClient.d.ts.map +1 -1
- package/dist/devtools/DevToolsClient.js +2 -0
- package/dist/devtools/DevToolsClient.js.map +1 -1
- package/dist/encoding/Base64.js +36 -0
- package/dist/encoding/Base64.js.map +1 -1
- package/dist/encoding/Sse.d.ts.map +1 -1
- package/dist/encoding/Sse.js +3 -3
- package/dist/encoding/Sse.js.map +1 -1
- package/dist/encoding/Toml.d.ts.map +1 -1
- package/dist/encoding/Toml.js +21 -16
- package/dist/encoding/Toml.js.map +1 -1
- package/dist/eventlog/SqlEventJournal.d.ts.map +1 -1
- package/dist/eventlog/SqlEventJournal.js +47 -27
- package/dist/eventlog/SqlEventJournal.js.map +1 -1
- package/dist/eventlog/internal/conflicts.d.ts +0 -1
- package/dist/eventlog/internal/conflicts.d.ts.map +1 -1
- package/dist/eventlog/internal/conflicts.js +0 -3
- package/dist/eventlog/internal/conflicts.js.map +1 -1
- package/dist/http/Cookies.d.ts.map +1 -1
- package/dist/http/Cookies.js +10 -9
- package/dist/http/Cookies.js.map +1 -1
- package/dist/http/HttpClient.d.ts +423 -0
- package/dist/http/HttpClient.d.ts.map +1 -1
- package/dist/http/HttpClient.js +231 -7
- package/dist/http/HttpClient.js.map +1 -1
- package/dist/http/HttpClientError.d.ts +8 -1
- package/dist/http/HttpClientError.d.ts.map +1 -1
- package/dist/http/HttpClientError.js +37 -1
- package/dist/http/HttpClientError.js.map +1 -1
- package/dist/http/HttpClientRequest.d.ts.map +1 -1
- package/dist/http/HttpClientRequest.js +1 -1
- package/dist/http/HttpClientRequest.js.map +1 -1
- package/dist/http/HttpMiddleware.d.ts +1 -1
- package/dist/http/HttpMiddleware.d.ts.map +1 -1
- package/dist/http/HttpMiddleware.js +14 -16
- package/dist/http/HttpMiddleware.js.map +1 -1
- package/dist/http/HttpRouter.d.ts.map +1 -1
- package/dist/http/HttpRouter.js +2 -1
- package/dist/http/HttpRouter.js.map +1 -1
- package/dist/http/HttpServerError.js +2 -2
- package/dist/http/HttpServerError.js.map +1 -1
- package/dist/http/HttpServerRequest.d.ts +6 -1
- package/dist/http/HttpServerRequest.d.ts.map +1 -1
- package/dist/http/HttpServerRequest.js +73 -10
- package/dist/http/HttpServerRequest.js.map +1 -1
- package/dist/http/HttpStaticServer.d.ts.map +1 -1
- package/dist/http/HttpStaticServer.js +48 -21
- package/dist/http/HttpStaticServer.js.map +1 -1
- package/dist/http/MultipartParser/internal/contentType.js +3 -3
- package/dist/http/UrlParams.d.ts +3 -1
- package/dist/http/UrlParams.d.ts.map +1 -1
- package/dist/http/UrlParams.js +4 -2
- package/dist/http/UrlParams.js.map +1 -1
- package/dist/http/internal/compression.js +4 -5
- package/dist/http/internal/compression.js.map +1 -1
- package/dist/http/internal/decompression.js +3 -0
- package/dist/http/internal/decompression.js.map +1 -1
- package/dist/http/internal/httpBody.js +8 -1
- package/dist/http/internal/httpBody.js.map +1 -1
- package/dist/http/internal/urlParams.js +25 -0
- package/dist/http/internal/urlParams.js.map +1 -1
- package/dist/http-api/HttpApi.d.ts +3 -6
- package/dist/http-api/HttpApi.d.ts.map +1 -1
- package/dist/http-api/HttpApi.js +3 -6
- package/dist/http-api/HttpApi.js.map +1 -1
- package/dist/http-api/HttpApiBuilder.d.ts.map +1 -1
- package/dist/http-api/HttpApiBuilder.js +27 -11
- package/dist/http-api/HttpApiBuilder.js.map +1 -1
- package/dist/http-api/HttpApiClient.d.ts +77 -7
- package/dist/http-api/HttpApiClient.d.ts.map +1 -1
- package/dist/http-api/HttpApiClient.js +142 -44
- package/dist/http-api/HttpApiClient.js.map +1 -1
- package/dist/http-api/HttpApiEndpoint.d.ts +24 -7
- package/dist/http-api/HttpApiEndpoint.d.ts.map +1 -1
- package/dist/http-api/HttpApiEndpoint.js +109 -27
- package/dist/http-api/HttpApiEndpoint.js.map +1 -1
- package/dist/http-api/HttpApiSchema.d.ts +76 -29
- package/dist/http-api/HttpApiSchema.d.ts.map +1 -1
- package/dist/http-api/HttpApiSchema.js +70 -59
- package/dist/http-api/HttpApiSchema.js.map +1 -1
- package/dist/http-api/HttpApiTest.d.ts.map +1 -1
- package/dist/http-api/HttpApiTest.js +3 -2
- package/dist/http-api/HttpApiTest.js.map +1 -1
- package/dist/http-api/OpenApi.d.ts.map +1 -1
- package/dist/http-api/OpenApi.js +25 -16
- package/dist/http-api/OpenApi.js.map +1 -1
- package/dist/http-api/internal/toCodecHttpProperties.d.ts +2 -0
- package/dist/http-api/internal/toCodecHttpProperties.d.ts.map +1 -0
- package/dist/http-api/internal/toCodecHttpProperties.js +38 -0
- package/dist/http-api/internal/toCodecHttpProperties.js.map +1 -0
- package/dist/internal/arbitrary/runner.d.ts.map +1 -1
- package/dist/internal/arbitrary/runner.js +120 -44
- package/dist/internal/arbitrary/runner.js.map +1 -1
- package/dist/internal/core.js +2 -0
- package/dist/internal/core.js.map +1 -1
- package/dist/internal/effect.js +21 -13
- package/dist/internal/effect.js.map +1 -1
- package/dist/internal/equal.js +14 -0
- package/dist/internal/equal.js.map +1 -1
- package/dist/internal/jsonSchema.d.ts +2 -0
- package/dist/internal/jsonSchema.d.ts.map +1 -0
- package/dist/internal/jsonSchema.js +28 -0
- package/dist/internal/jsonSchema.js.map +1 -0
- package/dist/internal/matcher.js +1 -1
- package/dist/internal/matcher.js.map +1 -1
- package/dist/internal/schema/compilerRegistry.js +4 -1
- package/dist/internal/schema/compilerRegistry.js.map +1 -1
- package/dist/internal/schema/content.d.ts +2 -0
- package/dist/internal/schema/content.d.ts.map +1 -0
- package/dist/internal/schema/content.js +13 -0
- package/dist/internal/schema/content.js.map +1 -0
- package/dist/internal/schema/fromJsonSchemaDocument.js +173 -185
- package/dist/internal/schema/fromJsonSchemaDocument.js.map +1 -1
- package/dist/internal/schema/fromRepresentation.js +2 -1
- package/dist/internal/schema/fromRepresentation.js.map +1 -1
- package/dist/internal/schema/standardSchema.js +8 -2
- package/dist/internal/schema/standardSchema.js.map +1 -1
- package/dist/internal/schema/toCodeDocument.js +3 -3
- package/dist/internal/schema/toCodeDocument.js.map +1 -1
- package/dist/internal/schema/toCodec.js +21 -24
- package/dist/internal/schema/toCodec.js.map +1 -1
- package/dist/internal/schema/toJsonSchemaDocument.js +205 -140
- package/dist/internal/schema/toJsonSchemaDocument.js.map +1 -1
- package/dist/internal/schema/toRepresentation.js +107 -129
- package/dist/internal/schema/toRepresentation.js.map +1 -1
- package/dist/internal/sql.d.ts +2 -0
- package/dist/internal/sql.d.ts.map +1 -0
- package/dist/internal/sql.js +13 -0
- package/dist/internal/sql.js.map +1 -0
- package/dist/internal/version.js +1 -1
- package/dist/observability/OtlpProxy.d.ts +154 -0
- package/dist/observability/OtlpProxy.d.ts.map +1 -0
- package/dist/observability/OtlpProxy.js +235 -0
- package/dist/observability/OtlpProxy.js.map +1 -0
- package/dist/observability/OtlpTracer.d.ts.map +1 -1
- package/dist/observability/OtlpTracer.js +4 -0
- package/dist/observability/OtlpTracer.js.map +1 -1
- package/dist/observability/index.d.ts +5 -0
- package/dist/observability/index.d.ts.map +1 -1
- package/dist/observability/index.js +5 -0
- package/dist/observability/index.js.map +1 -1
- package/dist/persistence/CircuitBreaker.d.ts +897 -0
- package/dist/persistence/CircuitBreaker.d.ts.map +1 -0
- package/dist/persistence/CircuitBreaker.js +1165 -0
- package/dist/persistence/CircuitBreaker.js.map +1 -0
- package/dist/persistence/Redis.d.ts +78 -2
- package/dist/persistence/Redis.d.ts.map +1 -1
- package/dist/persistence/Redis.js +62 -7
- package/dist/persistence/Redis.js.map +1 -1
- package/dist/persistence/index.d.ts +5 -0
- package/dist/persistence/index.d.ts.map +1 -1
- package/dist/persistence/index.js +5 -0
- package/dist/persistence/index.js.map +1 -1
- package/dist/process/ChildProcess.d.ts +30 -4
- package/dist/process/ChildProcess.d.ts.map +1 -1
- package/dist/process/ChildProcess.js.map +1 -1
- package/dist/process/ChildProcessSpawner.d.ts +30 -0
- package/dist/process/ChildProcessSpawner.d.ts.map +1 -1
- package/dist/process/ChildProcessSpawner.js +5 -2
- package/dist/process/ChildProcessSpawner.js.map +1 -1
- package/dist/reactivity/AsyncResult.d.ts +1 -1
- package/dist/reactivity/AsyncResult.d.ts.map +1 -1
- package/dist/rpc/RpcClient.d.ts.map +1 -1
- package/dist/rpc/RpcClient.js +9 -8
- package/dist/rpc/RpcClient.js.map +1 -1
- package/dist/rpc/RpcSerialization.d.ts +14 -0
- package/dist/rpc/RpcSerialization.d.ts.map +1 -1
- package/dist/rpc/RpcSerialization.js +20 -8
- package/dist/rpc/RpcSerialization.js.map +1 -1
- package/dist/rpc/RpcServer.d.ts.map +1 -1
- package/dist/rpc/RpcServer.js +11 -1
- package/dist/rpc/RpcServer.js.map +1 -1
- package/dist/rpc/RpcTest.d.ts +1 -0
- package/dist/rpc/RpcTest.d.ts.map +1 -1
- package/dist/rpc/RpcTest.js +1 -0
- package/dist/rpc/RpcTest.js.map +1 -1
- package/dist/sql/Migrator.d.ts +2 -1
- package/dist/sql/Migrator.d.ts.map +1 -1
- package/dist/sql/Migrator.js +11 -8
- package/dist/sql/Migrator.js.map +1 -1
- package/dist/sql/SqlClient.d.ts +9 -4
- package/dist/sql/SqlClient.d.ts.map +1 -1
- package/dist/sql/SqlClient.js +8 -1
- package/dist/sql/SqlClient.js.map +1 -1
- package/dist/sql/SqlResolver.d.ts +4 -0
- package/dist/sql/SqlResolver.d.ts.map +1 -1
- package/dist/sql/SqlResolver.js +18 -4
- package/dist/sql/SqlResolver.js.map +1 -1
- package/dist/sql/Statement.d.ts +7 -0
- package/dist/sql/Statement.d.ts.map +1 -1
- package/dist/sql/Statement.js +21 -2
- package/dist/sql/Statement.js.map +1 -1
- package/dist/workflow/DurableDeferred.d.ts.map +1 -1
- package/dist/workflow/DurableDeferred.js +21 -2
- package/dist/workflow/DurableDeferred.js.map +1 -1
- package/package.json +1 -1
- package/src/Arbitrary.ts +10 -2
- package/src/Channel.ts +47 -18
- package/src/Data.ts +60 -265
- package/src/Effect.ts +1 -1
- package/src/Equal.ts +8 -1
- package/src/Exit.ts +3 -3
- package/src/Formatter.ts +28 -13
- package/src/Hash.ts +4 -1
- package/src/JsonPatch.ts +4 -0
- package/src/JsonSchema.ts +12 -40
- package/src/Metric.ts +3 -3
- package/src/MutableList.ts +7 -5
- package/src/MutableRef.ts +8 -1
- package/src/PartitionedSemaphore.ts +24 -13
- package/src/Pool.ts +109 -37
- package/src/PubSub.ts +5 -6
- package/src/Ref.ts +8 -0
- package/src/Schedule.ts +1 -1
- package/src/Schema.ts +48 -25
- package/src/SchemaAST.ts +20 -20
- package/src/SchemaParser.ts +51 -18
- package/src/SchemaRepresentation.ts +31 -34
- package/src/SchemaTransformation.ts +9 -2
- package/src/Semaphore.ts +67 -40
- package/src/Sink.ts +15 -2
- package/src/Stream.ts +33 -16
- package/src/String.ts +3 -0
- package/src/Tracer.ts +15 -1
- package/src/ai/LanguageModel.ts +9 -0
- package/src/ai/McpServer.ts +14 -13
- package/src/ai/Prompt.ts +65 -0
- package/src/ai/Response.ts +34 -9
- package/src/ai/Tool.ts +38 -2
- package/src/ai/Toolkit.ts +4 -1
- package/src/cli/Argument.ts +15 -0
- package/src/cli/CliError.ts +90 -3
- package/src/cli/CliOutput.ts +183 -6
- package/src/cli/Command.ts +53 -41
- package/src/cli/Completions.ts +51 -0
- package/src/cli/Flag.ts +15 -0
- package/src/cli/GlobalFlag.ts +6 -7
- package/src/cli/Param.ts +29 -6
- package/src/cli/TerminalCapabilities.ts +6 -3
- package/src/cli/internal/completions/bash.ts +79 -29
- package/src/cluster/ClusterWorkflowEngine.ts +46 -16
- package/src/cluster/MessageStorage.ts +19 -14
- package/src/cluster/Sharding.ts +83 -21
- package/src/cluster/ShardingConfig.ts +5 -0
- package/src/cluster/Snowflake.ts +3 -7
- package/src/cluster/SqlRunnerStorage.ts +110 -47
- package/src/cluster/internal/entityManager.ts +75 -22
- package/src/devtools/DevToolsClient.ts +2 -0
- package/src/encoding/Base64.ts +38 -0
- package/src/encoding/Sse.ts +4 -3
- package/src/encoding/Toml.ts +33 -16
- package/src/eventlog/SqlEventJournal.ts +68 -45
- package/src/eventlog/internal/conflicts.ts +0 -4
- package/src/http/Cookies.ts +10 -11
- package/src/http/HttpClient.ts +547 -7
- package/src/http/HttpClientError.ts +35 -1
- package/src/http/HttpClientRequest.ts +9 -1
- package/src/http/HttpMiddleware.ts +15 -18
- package/src/http/HttpRouter.ts +2 -1
- package/src/http/HttpServerError.ts +2 -2
- package/src/http/HttpServerRequest.ts +102 -16
- package/src/http/HttpStaticServer.ts +51 -22
- package/src/http/MultipartParser/internal/contentType.ts +3 -3
- package/src/http/UrlParams.ts +6 -1
- package/src/http/internal/compression.ts +4 -5
- package/src/http/internal/decompression.ts +6 -0
- package/src/http/internal/httpBody.ts +10 -2
- package/src/http/internal/urlParams.ts +29 -0
- package/src/http-api/HttpApi.ts +3 -6
- package/src/http-api/HttpApiBuilder.ts +45 -15
- package/src/http-api/HttpApiClient.ts +218 -72
- package/src/http-api/HttpApiEndpoint.ts +121 -30
- package/src/http-api/HttpApiSchema.ts +141 -48
- package/src/http-api/HttpApiTest.ts +3 -2
- package/src/http-api/OpenApi.ts +20 -17
- package/src/http-api/internal/toCodecHttpProperties.ts +56 -0
- package/src/internal/arbitrary/runner.ts +133 -36
- package/src/internal/core.ts +2 -0
- package/src/internal/effect.ts +24 -16
- package/src/internal/equal.ts +17 -0
- package/src/internal/jsonSchema.ts +27 -0
- package/src/internal/matcher.ts +1 -1
- package/src/internal/schema/compilerRegistry.ts +6 -1
- package/src/internal/schema/content.ts +18 -0
- package/src/internal/schema/fromJsonSchemaDocument.ts +228 -190
- package/src/internal/schema/fromRepresentation.ts +2 -1
- package/src/internal/schema/standardSchema.ts +2 -2
- package/src/internal/schema/toCodeDocument.ts +4 -4
- package/src/internal/schema/toCodec.ts +26 -22
- package/src/internal/schema/toJsonSchemaDocument.ts +189 -167
- package/src/internal/schema/toRepresentation.ts +122 -140
- package/src/internal/sql.ts +14 -0
- package/src/internal/version.ts +1 -1
- package/src/observability/OtlpProxy.ts +314 -0
- package/src/observability/OtlpTracer.ts +4 -0
- package/src/observability/index.ts +6 -0
- package/src/persistence/CircuitBreaker.ts +1678 -0
- package/src/persistence/Redis.ts +129 -8
- package/src/persistence/index.ts +6 -0
- package/src/process/ChildProcess.ts +30 -4
- package/src/process/ChildProcessSpawner.ts +41 -2
- package/src/reactivity/AsyncResult.ts +1 -1
- package/src/rpc/RpcClient.ts +13 -10
- package/src/rpc/RpcSerialization.ts +32 -9
- package/src/rpc/RpcServer.ts +16 -1
- package/src/rpc/RpcTest.ts +3 -0
- package/src/sql/Migrator.ts +12 -7
- package/src/sql/SqlClient.ts +11 -4
- package/src/sql/SqlResolver.ts +23 -9
- package/src/sql/Statement.ts +30 -2
- package/src/workflow/DurableDeferred.ts +23 -6
|
@@ -2,6 +2,7 @@ import * as Arr from "../../Array.js";
|
|
|
2
2
|
import * as SchemaAST from "../../SchemaAST.js";
|
|
3
3
|
import * as InternalRecord from "../record.js";
|
|
4
4
|
import * as InternalAnnotations from "./annotations.js";
|
|
5
|
+
import * as InternalContent from "./content.js";
|
|
5
6
|
const defaultReferencePolicy = ({
|
|
6
7
|
identifier
|
|
7
8
|
}) => identifier;
|
|
@@ -24,14 +25,12 @@ export function toRepresentation(ast, options) {
|
|
|
24
25
|
/** @internal */
|
|
25
26
|
export function toRepresentations(asts, options) {
|
|
26
27
|
const references = {};
|
|
27
|
-
const
|
|
28
|
-
const buildingReferences = new Set();
|
|
28
|
+
const usedReferences = new Set();
|
|
29
29
|
const candidates = new Map();
|
|
30
|
-
const visitingCandidates = new Set();
|
|
31
30
|
for (const ast of asts) visit(ast);
|
|
32
31
|
const referencePolicy = options?.referencePolicy ?? defaultReferencePolicy;
|
|
33
|
-
for (const
|
|
34
|
-
for (const candidate of
|
|
32
|
+
for (const variants of candidates.values()) {
|
|
33
|
+
for (const candidate of variants) {
|
|
35
34
|
const requestedReference = referencePolicy({
|
|
36
35
|
ast: candidate.ast,
|
|
37
36
|
occurrences: candidate.occurrences,
|
|
@@ -39,25 +38,24 @@ export function toRepresentations(asts, options) {
|
|
|
39
38
|
});
|
|
40
39
|
if (requestedReference !== undefined) {
|
|
41
40
|
const separator = requestedReference === candidate.identifier || !requestedReference.endsWith("_") ? "_" : "";
|
|
42
|
-
candidate.reference = getReference(requestedReference,
|
|
41
|
+
candidate.reference = getReference(requestedReference, separator);
|
|
43
42
|
} else if (candidate.isRecursive) {
|
|
44
|
-
candidate.reference = getReference(`${candidate.ast._tag}_`,
|
|
43
|
+
candidate.reference = getReference(`${candidate.ast._tag}_`, "");
|
|
45
44
|
}
|
|
46
45
|
}
|
|
47
46
|
}
|
|
48
|
-
const representations = Arr.map(asts,
|
|
47
|
+
const representations = Arr.map(asts, recur);
|
|
49
48
|
return {
|
|
50
49
|
representations,
|
|
51
50
|
references
|
|
52
51
|
};
|
|
53
|
-
function getReference(prefix,
|
|
52
|
+
function getReference(prefix, separator) {
|
|
54
53
|
let candidate = prefix;
|
|
55
54
|
let suffix = 0;
|
|
56
|
-
while (
|
|
57
|
-
if (referenceOwners.get(candidate) === owner) return candidate;
|
|
55
|
+
while (usedReferences.has(candidate)) {
|
|
58
56
|
candidate = `${prefix}${separator}${++suffix}`;
|
|
59
57
|
}
|
|
60
|
-
|
|
58
|
+
usedReferences.add(candidate);
|
|
61
59
|
return candidate;
|
|
62
60
|
}
|
|
63
61
|
function annotateReference(ast, candidate, reference) {
|
|
@@ -71,63 +69,64 @@ export function toRepresentations(asts, options) {
|
|
|
71
69
|
identifier: reference
|
|
72
70
|
});
|
|
73
71
|
}
|
|
74
|
-
function
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
72
|
+
function getCandidate(input, encodingLength = input.encoding?.length ?? 0) {
|
|
73
|
+
let ast = input;
|
|
74
|
+
let content;
|
|
75
|
+
while (ast.encoding !== undefined && encodingLength > 0) {
|
|
76
|
+
const last = ast.encoding[encodingLength - 1];
|
|
77
|
+
// Only retain content when this operation produces the final string.
|
|
78
|
+
if (last.to.encoding === undefined && last.to._tag === "String") {
|
|
79
|
+
const metadata = InternalContent.getContent(last.transformation.encode);
|
|
80
|
+
if (metadata !== undefined) {
|
|
81
|
+
content = {
|
|
82
|
+
mediaType: metadata.mediaType,
|
|
83
|
+
schema: metadata.preserveSchema ? getCandidate(ast, encodingLength - 1) : undefined
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
ast = last.to;
|
|
88
|
+
encodingLength = ast.encoding?.length ?? 0;
|
|
80
89
|
}
|
|
81
|
-
return {
|
|
82
|
-
_tag: "Reference",
|
|
83
|
-
$ref: reference
|
|
84
|
-
};
|
|
85
|
-
}
|
|
86
|
-
function getCandidate(input) {
|
|
87
|
-
const ast = SchemaAST.getLastEncoding(input);
|
|
88
90
|
const owner = SchemaAST.getContextOwner(ast);
|
|
89
91
|
let identifier = InternalAnnotations.resolveIdentifier(ast);
|
|
90
92
|
const fallback = identifier === undefined ? (ast !== input ? InternalAnnotations.resolveIdentifier(input) : undefined) ?? InternalAnnotations.resolveIdentifierFallback(ast) : undefined;
|
|
91
93
|
if (fallback !== undefined) identifier = `${fallback}Encoded`;
|
|
92
|
-
let
|
|
93
|
-
if (
|
|
94
|
-
|
|
95
|
-
candidates.set(owner,
|
|
94
|
+
let variants = candidates.get(owner);
|
|
95
|
+
if (variants === undefined) {
|
|
96
|
+
variants = [];
|
|
97
|
+
candidates.set(owner, variants);
|
|
96
98
|
}
|
|
97
|
-
let candidate =
|
|
99
|
+
let candidate = variants.find(candidate => candidate.identifier === identifier && candidate.content?.mediaType === content?.mediaType && candidate.content?.schema === content?.schema);
|
|
98
100
|
if (candidate === undefined) {
|
|
99
101
|
candidate = {
|
|
100
102
|
ast: owner,
|
|
101
103
|
identifier,
|
|
102
104
|
fallback,
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
reference: undefined
|
|
105
|
+
content,
|
|
106
|
+
occurrences: 0
|
|
106
107
|
};
|
|
107
|
-
|
|
108
|
+
variants.push(candidate);
|
|
108
109
|
}
|
|
109
110
|
return candidate;
|
|
110
111
|
}
|
|
111
112
|
function visit(input) {
|
|
112
|
-
|
|
113
|
+
visitCandidate(getCandidate(input));
|
|
114
|
+
return input;
|
|
115
|
+
}
|
|
116
|
+
function visitCandidate(candidate) {
|
|
113
117
|
const ast = candidate.ast;
|
|
114
118
|
candidate.occurrences++;
|
|
115
|
-
if (
|
|
119
|
+
if (candidate.visiting) {
|
|
116
120
|
candidate.isRecursive = true;
|
|
117
121
|
return;
|
|
118
122
|
}
|
|
119
123
|
if (candidate.occurrences > 1) return;
|
|
120
|
-
|
|
124
|
+
candidate.visiting = true;
|
|
125
|
+
if (candidate.content?.schema !== undefined) visitCandidate(candidate.content.schema);
|
|
121
126
|
visitChecks(ast.checks);
|
|
122
127
|
switch (ast._tag) {
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
case "Objects":
|
|
126
|
-
case "Union":
|
|
127
|
-
ast.recur(child => {
|
|
128
|
-
visit(child);
|
|
129
|
-
return child;
|
|
130
|
-
});
|
|
128
|
+
default:
|
|
129
|
+
if ("recur" in ast) ast.recur(visit);
|
|
131
130
|
break;
|
|
132
131
|
case "TemplateLiteral":
|
|
133
132
|
ast.parts.forEach(visit);
|
|
@@ -136,7 +135,7 @@ export function toRepresentations(asts, options) {
|
|
|
136
135
|
visit(ast.thunk());
|
|
137
136
|
break;
|
|
138
137
|
}
|
|
139
|
-
|
|
138
|
+
candidate.visiting = false;
|
|
140
139
|
}
|
|
141
140
|
function visitChecks(checks) {
|
|
142
141
|
checks?.forEach(check => {
|
|
@@ -145,73 +144,77 @@ export function toRepresentations(asts, options) {
|
|
|
145
144
|
});
|
|
146
145
|
}
|
|
147
146
|
function recur(input) {
|
|
148
|
-
|
|
147
|
+
return recurCandidate(getCandidate(input));
|
|
148
|
+
}
|
|
149
|
+
function recurCandidate(candidate) {
|
|
149
150
|
const ast = candidate.ast;
|
|
150
151
|
const reference = candidate.reference;
|
|
151
152
|
if (reference !== undefined) {
|
|
152
|
-
|
|
153
|
-
|
|
153
|
+
if (!candidate.emitted) {
|
|
154
|
+
candidate.emitted = true;
|
|
155
|
+
const annotated = candidate.identifier === undefined ? ast : annotateReference(ast, candidate, reference);
|
|
156
|
+
const representation = on(annotated, candidate.content);
|
|
157
|
+
InternalRecord.assignProperty(references, reference, representation);
|
|
158
|
+
}
|
|
159
|
+
return {
|
|
160
|
+
_tag: "Reference",
|
|
161
|
+
$ref: reference
|
|
162
|
+
};
|
|
154
163
|
}
|
|
155
|
-
return on(ast);
|
|
164
|
+
return on(ast, candidate.content);
|
|
156
165
|
}
|
|
157
|
-
function on(ast) {
|
|
158
|
-
const
|
|
166
|
+
function on(ast, content) {
|
|
167
|
+
const common = {
|
|
168
|
+
checks: ast.checks?.map(fromCheck) ?? [],
|
|
169
|
+
...(ast._tag === "Declaration" ? fromAnnotations(ast.annotations) : annotationsField(ast.annotations))
|
|
170
|
+
};
|
|
159
171
|
switch (ast._tag) {
|
|
160
172
|
case "Declaration":
|
|
161
173
|
return {
|
|
162
|
-
_tag:
|
|
163
|
-
typeParameters: ast.typeParameters.map(
|
|
164
|
-
|
|
165
|
-
...fromDeclarationAnnotations(ast.annotations)
|
|
174
|
+
_tag: ast._tag,
|
|
175
|
+
typeParameters: ast.typeParameters.map(recur),
|
|
176
|
+
...common
|
|
166
177
|
};
|
|
167
|
-
|
|
168
|
-
case "Undefined":
|
|
169
|
-
case "Void":
|
|
170
|
-
case "Never":
|
|
171
|
-
case "Unknown":
|
|
172
|
-
case "Any":
|
|
173
|
-
case "String":
|
|
174
|
-
case "Boolean":
|
|
175
|
-
case "Number":
|
|
176
|
-
case "BigInt":
|
|
177
|
-
case "Symbol":
|
|
178
|
-
case "ObjectKeyword":
|
|
178
|
+
default:
|
|
179
179
|
return {
|
|
180
180
|
_tag: ast._tag,
|
|
181
|
-
|
|
182
|
-
|
|
181
|
+
...(content === undefined ? undefined : {
|
|
182
|
+
content: {
|
|
183
|
+
mediaType: content.mediaType,
|
|
184
|
+
...(content.schema === undefined ? undefined : {
|
|
185
|
+
schema: recurCandidate(content.schema)
|
|
186
|
+
})
|
|
187
|
+
}
|
|
188
|
+
}),
|
|
189
|
+
...common
|
|
183
190
|
};
|
|
184
191
|
case "Literal":
|
|
185
192
|
return {
|
|
186
|
-
_tag:
|
|
193
|
+
_tag: ast._tag,
|
|
187
194
|
literal: ast.literal,
|
|
188
|
-
|
|
189
|
-
...annotationsField(ast.annotations)
|
|
195
|
+
...common
|
|
190
196
|
};
|
|
191
197
|
case "UniqueSymbol":
|
|
192
198
|
return {
|
|
193
|
-
_tag:
|
|
199
|
+
_tag: ast._tag,
|
|
194
200
|
symbol: ast.symbol,
|
|
195
|
-
|
|
196
|
-
...annotationsField(ast.annotations)
|
|
201
|
+
...common
|
|
197
202
|
};
|
|
198
203
|
case "Enum":
|
|
199
204
|
return {
|
|
200
|
-
_tag:
|
|
205
|
+
_tag: ast._tag,
|
|
201
206
|
enums: ast.enums,
|
|
202
|
-
|
|
203
|
-
...annotationsField(ast.annotations)
|
|
207
|
+
...common
|
|
204
208
|
};
|
|
205
209
|
case "TemplateLiteral":
|
|
206
210
|
return {
|
|
207
|
-
_tag:
|
|
208
|
-
parts: ast.parts.map(
|
|
209
|
-
|
|
210
|
-
...annotationsField(ast.annotations)
|
|
211
|
+
_tag: ast._tag,
|
|
212
|
+
parts: ast.parts.map(recur),
|
|
213
|
+
...common
|
|
211
214
|
};
|
|
212
215
|
case "Arrays":
|
|
213
216
|
return {
|
|
214
|
-
_tag:
|
|
217
|
+
_tag: ast._tag,
|
|
215
218
|
elements: ast.elements.map(element => {
|
|
216
219
|
const projected = SchemaAST.getLastEncoding(element);
|
|
217
220
|
const annotations = projected.context?.annotations;
|
|
@@ -221,13 +224,12 @@ export function toRepresentations(asts, options) {
|
|
|
221
224
|
...annotationsField(annotations)
|
|
222
225
|
};
|
|
223
226
|
}),
|
|
224
|
-
rest: ast.rest.map(
|
|
225
|
-
|
|
226
|
-
...annotationsField(ast.annotations)
|
|
227
|
+
rest: ast.rest.map(recur),
|
|
228
|
+
...common
|
|
227
229
|
};
|
|
228
230
|
case "Objects":
|
|
229
231
|
return {
|
|
230
|
-
_tag:
|
|
232
|
+
_tag: ast._tag,
|
|
231
233
|
propertySignatures: ast.propertySignatures.map(property => {
|
|
232
234
|
const projected = SchemaAST.getLastEncoding(property.type);
|
|
233
235
|
const annotations = projected.context?.annotations;
|
|
@@ -243,72 +245,48 @@ export function toRepresentations(asts, options) {
|
|
|
243
245
|
parameter: recur(index.parameter),
|
|
244
246
|
type: recur(index.type)
|
|
245
247
|
})),
|
|
246
|
-
|
|
247
|
-
...annotationsField(ast.annotations)
|
|
248
|
+
...common
|
|
248
249
|
};
|
|
249
250
|
case "Union":
|
|
250
251
|
return {
|
|
251
|
-
_tag:
|
|
252
|
-
types: ast.types.map(
|
|
252
|
+
_tag: ast._tag,
|
|
253
|
+
types: ast.types.map(recur),
|
|
253
254
|
...(ast.options === undefined ? {} : {
|
|
254
255
|
options: ast.options
|
|
255
256
|
}),
|
|
256
|
-
|
|
257
|
-
...annotationsField(ast.annotations)
|
|
257
|
+
...common
|
|
258
258
|
};
|
|
259
259
|
case "Suspend":
|
|
260
260
|
return {
|
|
261
|
-
_tag:
|
|
261
|
+
_tag: ast._tag,
|
|
262
|
+
...common,
|
|
262
263
|
checks: [],
|
|
263
|
-
thunk: recur(ast.thunk())
|
|
264
|
-
...annotationsField(ast.annotations)
|
|
264
|
+
thunk: recur(ast.thunk())
|
|
265
265
|
};
|
|
266
266
|
}
|
|
267
267
|
}
|
|
268
|
-
function fromChecks(checks) {
|
|
269
|
-
return checks?.map(fromCheck) ?? [];
|
|
270
|
-
}
|
|
271
268
|
function fromCheck(check) {
|
|
272
|
-
switch (check._tag) {
|
|
273
|
-
case "Filter":
|
|
274
|
-
return {
|
|
275
|
-
_tag: "Filter",
|
|
276
|
-
aborted: check.aborted,
|
|
277
|
-
...fromCheckAnnotations(check.annotations)
|
|
278
|
-
};
|
|
279
|
-
case "FilterGroup":
|
|
280
|
-
return {
|
|
281
|
-
_tag: "FilterGroup",
|
|
282
|
-
checks: Arr.map(check.checks, fromCheck),
|
|
283
|
-
...fromCheckAnnotations(check.annotations)
|
|
284
|
-
};
|
|
285
|
-
}
|
|
286
|
-
}
|
|
287
|
-
function fromDeclarationAnnotations(annotations) {
|
|
288
|
-
if (annotations === undefined) return undefined;
|
|
289
|
-
const {
|
|
290
|
-
representation,
|
|
291
|
-
...ordinary
|
|
292
|
-
} = annotations;
|
|
293
269
|
return {
|
|
294
|
-
...(
|
|
295
|
-
|
|
270
|
+
...(check._tag === "Filter" ? {
|
|
271
|
+
_tag: check._tag,
|
|
272
|
+
aborted: check.aborted
|
|
273
|
+
} : {
|
|
274
|
+
_tag: check._tag,
|
|
275
|
+
checks: Arr.map(check.checks, fromCheck)
|
|
296
276
|
}),
|
|
297
|
-
...(
|
|
298
|
-
annotations: ordinary
|
|
299
|
-
})
|
|
277
|
+
...fromAnnotations(check.annotations, true)
|
|
300
278
|
};
|
|
301
279
|
}
|
|
302
|
-
function
|
|
280
|
+
function fromAnnotations(annotations, projectSchemas = false) {
|
|
303
281
|
if (annotations === undefined) return undefined;
|
|
304
282
|
const {
|
|
305
283
|
representation,
|
|
306
284
|
...ordinary
|
|
307
285
|
} = annotations;
|
|
308
|
-
const projected =
|
|
286
|
+
const projected = projectSchemas && representation?.schemas !== undefined ? {
|
|
309
287
|
...representation,
|
|
310
288
|
schemas: representation.schemas.map(schema => recur(SchemaAST.toType(schema)))
|
|
311
|
-
};
|
|
289
|
+
} : representation;
|
|
312
290
|
return {
|
|
313
291
|
...(projected === undefined ? undefined : {
|
|
314
292
|
representation: projected
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toRepresentation.js","names":[],"sources":["../../../src/internal/schema/toRepresentation.ts"],"sourcesContent":[null],"mappings":"AAAA,OAAO,KAAK,GAAG,MAAM,gBAAgB;AAErC,OAAO,KAAK,SAAS,MAAM,oBAAoB;AAE/C,OAAO,KAAK,cAAc,MAAM,cAAc;AAC9C,OAAO,KAAK,mBAAmB,MAAM,kBAAkB;
|
|
1
|
+
{"version":3,"file":"toRepresentation.js","names":[],"sources":["../../../src/internal/schema/toRepresentation.ts"],"sourcesContent":[null],"mappings":"AAAA,OAAO,KAAK,GAAG,MAAM,gBAAgB;AAErC,OAAO,KAAK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AC;MACxE,IAAI,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,MAAM,KAAK,CAAC,GAAG,SAAS,GAAG;QAAE,WAAW,EAAE;MAAQ,CAAE;KAC/E;EACH;AACF","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sql.d.ts","sourceRoot":"","sources":["../../src/internal/sql.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import * as Context from "../Context.js";
|
|
2
|
+
/**
|
|
3
|
+
* The transaction service of the innermost transaction started with
|
|
4
|
+
* `SqlClient.makeWithTransaction`. `SqlResolver` reads it to find that
|
|
5
|
+
* transaction when the request's context has no `SqlClient` for it. Removing
|
|
6
|
+
* the service from a context also hides the transaction from this lookup.
|
|
7
|
+
*
|
|
8
|
+
* @internal
|
|
9
|
+
*/
|
|
10
|
+
export const CurrentTransactionService = /*#__PURE__*/Context.Reference("effect/sql/CurrentTransactionService", {
|
|
11
|
+
defaultValue: () => undefined
|
|
12
|
+
});
|
|
13
|
+
//# sourceMappingURL=sql.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sql.js","names":[],"sources":["../../src/internal/sql.ts"],"sourcesContent":[null],"mappings":"AAAA,OAAO,KAAK,OAAO,MAAM,eAAe;AAExC;;;;;;;;AAQA,OAAO,MAAM,yBAAyB,gBAAG,OAAO,CAAC,SAAS,CACxD,sCAAsC,EACtC;EAAE,YAAY,EAAE,MAAM;AAAS,CAAE,CAClC","ignoreList":[]}
|
package/dist/internal/version.js
CHANGED
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Proxies OTLP HTTP exports from browsers through an application's own HTTP
|
|
3
|
+
* server to an OpenTelemetry Collector or vendor endpoint.
|
|
4
|
+
*
|
|
5
|
+
* A browser exporting OTLP directly would need the vendor credentials in its
|
|
6
|
+
* bundle and a cross-origin collector. `OtlpProxy` mounts `POST /v1/traces`,
|
|
7
|
+
* `/v1/logs`, and `/v1/metrics` on an `HttpRouter`, adds the configured
|
|
8
|
+
* headers on the server, and forwards the payload unchanged. The browser can
|
|
9
|
+
* then use `Otlp.layer({ baseUrl: "/otlp" })` against its own origin.
|
|
10
|
+
*
|
|
11
|
+
* **Details**
|
|
12
|
+
*
|
|
13
|
+
* - The upstream URL comes only from configuration. The request path and query
|
|
14
|
+
* string never reach it.
|
|
15
|
+
* - Only `application/json` and `application/x-protobuf` bodies are accepted;
|
|
16
|
+
* other content types get `415`. Payloads are not decoded or validated.
|
|
17
|
+
* - Only `content-type` and `content-encoding` are forwarded from the client.
|
|
18
|
+
* Configured `headers` are applied last, so a client cannot override them.
|
|
19
|
+
* - Bodies are buffered up to `maxBodySize` and rejected with `413` beyond it.
|
|
20
|
+
* - Upstream requests send `accept-encoding: identity`, and the client's
|
|
21
|
+
* `accept-encoding` is never forwarded.
|
|
22
|
+
* - The upstream status and body are returned with only the `content-type` and
|
|
23
|
+
* `retry-after` headers, so client SDK back-off keeps working and upstream
|
|
24
|
+
* cookies are dropped. Transport failures return `502` and timeouts `504`.
|
|
25
|
+
* The proxy does not retry or batch.
|
|
26
|
+
*
|
|
27
|
+
* **Gotchas**
|
|
28
|
+
*
|
|
29
|
+
* - Anyone who can reach the routes can send telemetry with the configured
|
|
30
|
+
* credentials. Compose authentication, CORS, and rate limiting around the
|
|
31
|
+
* layer as the application requires.
|
|
32
|
+
* - The response body is returned as the `HttpClient` provides it, without a
|
|
33
|
+
* `content-encoding` header. Setting `accept-encoding` in `headers` can
|
|
34
|
+
* invalidate this, as can an upstream that compresses despite
|
|
35
|
+
* `accept-encoding: identity`: clients that do not decode responses, such as
|
|
36
|
+
* `NodeHttpClient.makeUndici`, then return compressed bytes.
|
|
37
|
+
* - Requests to the proxy routes are traced by the HTTP server like any other
|
|
38
|
+
* route. To suppress those spans, provide `HttpMiddleware.TracerDisabledWhen`
|
|
39
|
+
* with a predicate matching the routes, or use
|
|
40
|
+
* `HttpMiddleware.layerTracerDisabledForUrls`, which matches exact URLs, so
|
|
41
|
+
* list each route.
|
|
42
|
+
*
|
|
43
|
+
* @stability unstable
|
|
44
|
+
* @since 4.0.7
|
|
45
|
+
*/
|
|
46
|
+
import * as ByteSize from "../ByteSize.ts";
|
|
47
|
+
import * as Duration from "../Duration.ts";
|
|
48
|
+
import * as Effect from "../Effect.ts";
|
|
49
|
+
import * as Headers from "../http/Headers.ts";
|
|
50
|
+
import * as HttpClient from "../http/HttpClient.ts";
|
|
51
|
+
import * as HttpRouter from "../http/HttpRouter.ts";
|
|
52
|
+
import * as HttpServerRequest from "../http/HttpServerRequest.ts";
|
|
53
|
+
import * as HttpServerResponse from "../http/HttpServerResponse.ts";
|
|
54
|
+
import * as Layer from "../Layer.ts";
|
|
55
|
+
/**
|
|
56
|
+
* OTLP signal type served by the proxy.
|
|
57
|
+
*
|
|
58
|
+
* @stability unstable
|
|
59
|
+
* @category models
|
|
60
|
+
* @since 4.0.7
|
|
61
|
+
*/
|
|
62
|
+
export type Signal = "traces" | "logs" | "metrics";
|
|
63
|
+
/**
|
|
64
|
+
* Creates a record of request handlers, one for each OTLP signal, that forward
|
|
65
|
+
* to the configured upstream.
|
|
66
|
+
*
|
|
67
|
+
* **When to use**
|
|
68
|
+
*
|
|
69
|
+
* Use to mount the proxy on routes or a router other than the ones `layer`
|
|
70
|
+
* registers, such as an `HttpApi` endpoint.
|
|
71
|
+
*
|
|
72
|
+
* **Details**
|
|
73
|
+
*
|
|
74
|
+
* Each signal is sent to `urls[signal]` when set, otherwise to
|
|
75
|
+
* `/v1/<signal>` below `baseUrl`. `maxBodySize` defaults to the
|
|
76
|
+
* `HttpIncomingMessage.MaxBodySize` reference, then 10 MiB. `timeout` defaults
|
|
77
|
+
* to 10 seconds.
|
|
78
|
+
*
|
|
79
|
+
* @see {@link layer} for mounting the handlers on an `HttpRouter`.
|
|
80
|
+
* @stability unstable
|
|
81
|
+
* @category constructors
|
|
82
|
+
* @since 4.0.7
|
|
83
|
+
*/
|
|
84
|
+
export declare const make: (options: {
|
|
85
|
+
readonly baseUrl: string;
|
|
86
|
+
readonly urls?: Partial<Record<Signal, string>> | undefined;
|
|
87
|
+
readonly headers?: Headers.Input | undefined;
|
|
88
|
+
readonly maxBodySize?: ByteSize.Input | undefined;
|
|
89
|
+
readonly timeout?: Duration.Input | undefined;
|
|
90
|
+
}) => Effect.Effect<Record<Signal, Effect.Effect<HttpServerResponse.HttpServerResponse, never, HttpServerRequest.HttpServerRequest>>, never, HttpClient.HttpClient>;
|
|
91
|
+
/**
|
|
92
|
+
* Creates a layer that mounts the OTLP proxy routes on an `HttpRouter`.
|
|
93
|
+
*
|
|
94
|
+
* **Details**
|
|
95
|
+
*
|
|
96
|
+
* Registers `POST <prefix>/v1/<signal>` for each of `signals`, which defaults
|
|
97
|
+
* to traces, logs, and metrics. Without a `prefix` the routes are mounted at
|
|
98
|
+
* the router root.
|
|
99
|
+
*
|
|
100
|
+
* **Example** (Proxying browser telemetry to a vendor)
|
|
101
|
+
*
|
|
102
|
+
* ```ts import.meta.vitest
|
|
103
|
+
* import { Layer } from "effect"
|
|
104
|
+
* import { FetchHttpClient } from "effect/http"
|
|
105
|
+
* import { OtlpProxy } from "effect/observability"
|
|
106
|
+
*
|
|
107
|
+
* const OtlpProxyLayer = OtlpProxy.layer({
|
|
108
|
+
* baseUrl: "https://otlp.vendor.example",
|
|
109
|
+
* headers: { authorization: "Bearer server-side-key" },
|
|
110
|
+
* prefix: "/otlp"
|
|
111
|
+
* }).pipe(Layer.provide(FetchHttpClient.layer))
|
|
112
|
+
*
|
|
113
|
+
* Layer.isLayer(OtlpProxyLayer) // => true
|
|
114
|
+
* ```
|
|
115
|
+
*
|
|
116
|
+
* @see {@link layerFromConfig} for reading the upstream from OpenTelemetry environment variables.
|
|
117
|
+
* @stability unstable
|
|
118
|
+
* @category layers
|
|
119
|
+
* @since 4.0.7
|
|
120
|
+
*/
|
|
121
|
+
export declare const layer: (options: {
|
|
122
|
+
readonly baseUrl: string;
|
|
123
|
+
readonly urls?: Partial<Record<Signal, string>> | undefined;
|
|
124
|
+
readonly headers?: Headers.Input | undefined;
|
|
125
|
+
readonly maxBodySize?: ByteSize.Input | undefined;
|
|
126
|
+
readonly timeout?: Duration.Input | undefined;
|
|
127
|
+
readonly prefix?: string | undefined;
|
|
128
|
+
readonly signals?: ReadonlyArray<Signal> | undefined;
|
|
129
|
+
}) => Layer.Layer<never, never, HttpRouter.HttpRouter | HttpClient.HttpClient>;
|
|
130
|
+
/**
|
|
131
|
+
* Creates a layer that mounts the OTLP proxy routes using the upstream from
|
|
132
|
+
* OpenTelemetry environment configuration.
|
|
133
|
+
*
|
|
134
|
+
* **Details**
|
|
135
|
+
*
|
|
136
|
+
* Each signal is sent to `OTEL_EXPORTER_OTLP_<SIGNAL>_ENDPOINT`, falling back
|
|
137
|
+
* to `/v1/<signal>` below `OTEL_EXPORTER_OTLP_ENDPOINT`, with headers from
|
|
138
|
+
* `OTEL_EXPORTER_OTLP_<SIGNAL>_HEADERS` or `OTEL_EXPORTER_OTLP_HEADERS`. The
|
|
139
|
+
* `headers` option replaces the configured headers. Signals without an
|
|
140
|
+
* endpoint get no route.
|
|
141
|
+
*
|
|
142
|
+
* @see {@link layer} for configuring the upstream directly.
|
|
143
|
+
* @stability unstable
|
|
144
|
+
* @category layers
|
|
145
|
+
* @since 4.0.7
|
|
146
|
+
*/
|
|
147
|
+
export declare const layerFromConfig: (options?: {
|
|
148
|
+
readonly headers?: Headers.Input | undefined;
|
|
149
|
+
readonly maxBodySize?: ByteSize.Input | undefined;
|
|
150
|
+
readonly timeout?: Duration.Input | undefined;
|
|
151
|
+
readonly prefix?: string | undefined;
|
|
152
|
+
readonly signals?: ReadonlyArray<Signal> | undefined;
|
|
153
|
+
}) => Layer.Layer<never, never, HttpRouter.HttpRouter | HttpClient.HttpClient>;
|
|
154
|
+
//# sourceMappingURL=OtlpProxy.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version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