effect 4.1.3 → 4.1.5
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/THIRD_PARTY_NOTICES.md +88 -0
- package/ai-docs/package.json +2 -2
- package/dist/Arbitrary.d.ts +44 -2
- package/dist/Arbitrary.d.ts.map +1 -1
- package/dist/Arbitrary.js +9 -1
- package/dist/Arbitrary.js.map +1 -1
- package/dist/BigInt.d.ts +200 -1
- package/dist/BigInt.d.ts.map +1 -1
- package/dist/BigInt.js +105 -9
- package/dist/BigInt.js.map +1 -1
- package/dist/Cache.d.ts.map +1 -1
- package/dist/Cache.js +4 -2
- package/dist/Cache.js.map +1 -1
- package/dist/Cause.d.ts +3 -3
- package/dist/Cause.js +1 -1
- package/dist/Chunk.d.ts +5 -0
- package/dist/Chunk.d.ts.map +1 -1
- package/dist/Chunk.js +7 -2
- package/dist/Chunk.js.map +1 -1
- package/dist/Clock.d.ts +5 -2
- package/dist/Clock.d.ts.map +1 -1
- package/dist/Clock.js +2 -1
- package/dist/Clock.js.map +1 -1
- package/dist/Codegen.d.ts +295 -0
- package/dist/Codegen.d.ts.map +1 -0
- package/dist/Codegen.js +521 -0
- package/dist/Codegen.js.map +1 -0
- package/dist/Config.d.ts +31 -2
- package/dist/Config.d.ts.map +1 -1
- package/dist/Config.js +12 -1
- package/dist/Config.js.map +1 -1
- package/dist/ConfigProvider.d.ts +11 -1
- package/dist/ConfigProvider.d.ts.map +1 -1
- package/dist/ConfigProvider.js +17 -6
- package/dist/ConfigProvider.js.map +1 -1
- package/dist/Effect.d.ts +869 -109
- package/dist/Effect.d.ts.map +1 -1
- package/dist/Effect.js +400 -47
- package/dist/Effect.js.map +1 -1
- package/dist/Equivalence.d.ts +11 -9
- package/dist/Equivalence.d.ts.map +1 -1
- package/dist/Equivalence.js +15 -12
- package/dist/Equivalence.js.map +1 -1
- package/dist/Fiber.d.ts +58 -8
- package/dist/Fiber.d.ts.map +1 -1
- package/dist/Fiber.js +28 -4
- package/dist/Fiber.js.map +1 -1
- package/dist/FiberHandle.d.ts +81 -10
- package/dist/FiberHandle.d.ts.map +1 -1
- package/dist/FiberHandle.js +40 -8
- package/dist/FiberHandle.js.map +1 -1
- package/dist/FiberMap.d.ts +80 -10
- package/dist/FiberMap.d.ts.map +1 -1
- package/dist/FiberMap.js +37 -6
- package/dist/FiberMap.js.map +1 -1
- package/dist/FiberSet.d.ts +93 -8
- package/dist/FiberSet.d.ts.map +1 -1
- package/dist/FiberSet.js +46 -4
- package/dist/FiberSet.js.map +1 -1
- package/dist/Formatter.d.ts +2 -0
- package/dist/Formatter.d.ts.map +1 -1
- package/dist/Formatter.js +2 -0
- package/dist/Formatter.js.map +1 -1
- package/dist/LayerMap.d.ts +12 -3
- package/dist/LayerMap.d.ts.map +1 -1
- package/dist/LayerMap.js +12 -2
- package/dist/LayerMap.js.map +1 -1
- package/dist/LayerRef.d.ts +2 -2
- package/dist/Match.d.ts +12 -0
- package/dist/Match.d.ts.map +1 -1
- package/dist/Match.js +16 -0
- package/dist/Match.js.map +1 -1
- package/dist/Metric.js +1 -1
- package/dist/Metric.js.map +1 -1
- package/dist/Option.d.ts +4 -1
- package/dist/Option.d.ts.map +1 -1
- package/dist/Option.js +6 -2
- package/dist/Option.js.map +1 -1
- package/dist/Order.d.ts +7 -5
- package/dist/Order.d.ts.map +1 -1
- package/dist/Order.js +7 -2
- package/dist/Order.js.map +1 -1
- package/dist/Pool.d.ts +4 -3
- package/dist/Pool.d.ts.map +1 -1
- package/dist/Pool.js +21 -18
- package/dist/Pool.js.map +1 -1
- package/dist/Predicate.d.ts +4 -1
- package/dist/Predicate.d.ts.map +1 -1
- package/dist/Predicate.js +5 -1
- package/dist/Predicate.js.map +1 -1
- package/dist/Queue.d.ts +69 -22
- package/dist/Queue.d.ts.map +1 -1
- package/dist/Queue.js +40 -18
- package/dist/Queue.js.map +1 -1
- package/dist/Rational.d.ts +179 -0
- package/dist/Rational.d.ts.map +1 -1
- package/dist/Rational.js +63 -0
- package/dist/Rational.js.map +1 -1
- package/dist/Request.d.ts +20 -0
- package/dist/Request.d.ts.map +1 -1
- package/dist/Request.js +20 -0
- package/dist/Request.js.map +1 -1
- package/dist/Result.d.ts +3 -1
- package/dist/Result.d.ts.map +1 -1
- package/dist/Result.js +5 -2
- package/dist/Result.js.map +1 -1
- package/dist/Schema.d.ts +49 -19
- package/dist/Schema.d.ts.map +1 -1
- package/dist/Schema.js +44 -27
- package/dist/Schema.js.map +1 -1
- package/dist/SchemaAST.d.ts.map +1 -1
- package/dist/SchemaAST.js +11 -4
- package/dist/SchemaAST.js.map +1 -1
- package/dist/SchemaGetter.d.ts +5 -6
- package/dist/SchemaGetter.d.ts.map +1 -1
- package/dist/SchemaGetter.js +14 -10
- package/dist/SchemaGetter.js.map +1 -1
- package/dist/SchemaRepresentation.d.ts +36 -67
- package/dist/SchemaRepresentation.d.ts.map +1 -1
- package/dist/SchemaRepresentation.js +5 -30
- package/dist/SchemaRepresentation.js.map +1 -1
- package/dist/SchemaTransformation.d.ts +11 -10
- package/dist/SchemaTransformation.d.ts.map +1 -1
- package/dist/SchemaTransformation.js +12 -11
- package/dist/SchemaTransformation.js.map +1 -1
- package/dist/Scope.d.ts +12 -6
- package/dist/Scope.d.ts.map +1 -1
- package/dist/Scope.js +12 -6
- package/dist/Scope.js.map +1 -1
- package/dist/ScopedCache.d.ts.map +1 -1
- package/dist/ScopedCache.js +2 -1
- package/dist/ScopedCache.js.map +1 -1
- package/dist/Semaphore.d.ts.map +1 -1
- package/dist/Semaphore.js +18 -4
- package/dist/Semaphore.js.map +1 -1
- package/dist/Stream.d.ts.map +1 -1
- package/dist/Stream.js +55 -14
- package/dist/Stream.js.map +1 -1
- package/dist/String.d.ts +57 -3
- package/dist/String.d.ts.map +1 -1
- package/dist/String.js +62 -4
- package/dist/String.js.map +1 -1
- package/dist/Struct.d.ts +135 -1
- package/dist/Struct.d.ts.map +1 -1
- package/dist/Struct.js +64 -5
- package/dist/Struct.js.map +1 -1
- package/dist/TextDiff.d.ts +105 -0
- package/dist/TextDiff.d.ts.map +1 -1
- package/dist/TextDiff.js +137 -24
- package/dist/TextDiff.js.map +1 -1
- package/dist/TxPriorityQueue.js +2 -2
- package/dist/TxPriorityQueue.js.map +1 -1
- package/dist/ai/Chat.d.ts +1 -1
- package/dist/ai/Chat.d.ts.map +1 -1
- package/dist/ai/Chat.js.map +1 -1
- package/dist/ai/LanguageModel.d.ts +23 -4
- package/dist/ai/LanguageModel.d.ts.map +1 -1
- package/dist/ai/LanguageModel.js +9 -5
- package/dist/ai/LanguageModel.js.map +1 -1
- package/dist/ai/McpClient.d.ts +0 -5
- package/dist/ai/McpClient.d.ts.map +1 -1
- package/dist/ai/McpClient.js +1 -11
- package/dist/ai/McpClient.js.map +1 -1
- package/dist/ai/McpSchema.d.ts +128 -128
- package/dist/ai/McpSchema.d.ts.map +1 -1
- package/dist/ai/McpServer.d.ts +48 -5
- package/dist/ai/McpServer.d.ts.map +1 -1
- package/dist/ai/McpServer.js +136 -19
- package/dist/ai/McpServer.js.map +1 -1
- package/dist/ai/Tool.d.ts +3 -2
- package/dist/ai/Tool.d.ts.map +1 -1
- package/dist/ai/Tool.js +3 -2
- package/dist/ai/Tool.js.map +1 -1
- package/dist/ai/Toolkit.d.ts.map +1 -1
- package/dist/ai/Toolkit.js +5 -1
- package/dist/ai/Toolkit.js.map +1 -1
- package/dist/ai/WorkloadIdentity.d.ts +111 -0
- package/dist/ai/WorkloadIdentity.d.ts.map +1 -0
- package/dist/ai/WorkloadIdentity.js +227 -0
- package/dist/ai/WorkloadIdentity.js.map +1 -0
- package/dist/ai/index.d.ts +5 -0
- package/dist/ai/index.d.ts.map +1 -1
- package/dist/ai/index.js +5 -0
- package/dist/ai/index.js.map +1 -1
- package/dist/ai/internal/mcpProtocol/v2024_11_05.js +3 -1
- package/dist/ai/internal/mcpProtocol/v2024_11_05.js.map +1 -1
- package/dist/ai/internal/mcpProtocol/v2025_03_26.js +3 -1
- package/dist/ai/internal/mcpProtocol/v2025_03_26.js.map +1 -1
- package/dist/ai/internal/mcpProtocol/v2025_06_18.js +3 -1
- package/dist/ai/internal/mcpProtocol/v2025_06_18.js.map +1 -1
- package/dist/ai/internal/mcpProtocol/v2025_11_25.js +3 -1
- package/dist/ai/internal/mcpProtocol/v2025_11_25.js.map +1 -1
- package/dist/ai/internal/mcpRuntime.js +2 -4
- package/dist/ai/internal/mcpRuntime.js.map +1 -1
- package/dist/ai/internal/mcpSkills.js +80 -2
- package/dist/ai/internal/mcpSkills.js.map +1 -1
- package/dist/ai/internal/structured-output.js +5 -1
- package/dist/ai/internal/structured-output.js.map +1 -1
- package/dist/chat/Chat.d.ts +90 -0
- package/dist/chat/Chat.d.ts.map +1 -0
- package/dist/chat/Chat.js +127 -0
- package/dist/chat/Chat.js.map +1 -0
- package/dist/chat/ChatAdapter.d.ts +386 -0
- package/dist/chat/ChatAdapter.d.ts.map +1 -0
- package/dist/chat/ChatAdapter.js +110 -0
- package/dist/chat/ChatAdapter.js.map +1 -0
- package/dist/chat/ChatError.d.ts +500 -0
- package/dist/chat/ChatError.d.ts.map +1 -0
- package/dist/chat/ChatError.js +521 -0
- package/dist/chat/ChatError.js.map +1 -0
- package/dist/chat/ChatEvent.d.ts +321 -0
- package/dist/chat/ChatEvent.d.ts.map +1 -0
- package/dist/chat/ChatEvent.js +163 -0
- package/dist/chat/ChatEvent.js.map +1 -0
- package/dist/chat/ChatHandler.d.ts +81 -0
- package/dist/chat/ChatHandler.d.ts.map +1 -0
- package/dist/chat/ChatHandler.js +85 -0
- package/dist/chat/ChatHandler.js.map +1 -0
- package/dist/chat/ChatInteraction.d.ts +1519 -0
- package/dist/chat/ChatInteraction.d.ts.map +1 -0
- package/dist/chat/ChatInteraction.js +1052 -0
- package/dist/chat/ChatInteraction.js.map +1 -0
- package/dist/chat/ChatMarkdown.d.ts +280 -0
- package/dist/chat/ChatMarkdown.d.ts.map +1 -0
- package/dist/chat/ChatMarkdown.js +1172 -0
- package/dist/chat/ChatMarkdown.js.map +1 -0
- package/dist/chat/ChatMessage.d.ts +224 -0
- package/dist/chat/ChatMessage.d.ts.map +1 -0
- package/dist/chat/ChatMessage.js +172 -0
- package/dist/chat/ChatMessage.js.map +1 -0
- package/dist/chat/ChatTest.d.ts +407 -0
- package/dist/chat/ChatTest.d.ts.map +1 -0
- package/dist/chat/ChatTest.js +2145 -0
- package/dist/chat/ChatTest.js.map +1 -0
- package/dist/chat/ChatThread.d.ts +92 -0
- package/dist/chat/ChatThread.d.ts.map +1 -0
- package/dist/chat/ChatThread.js +116 -0
- package/dist/chat/ChatThread.js.map +1 -0
- package/dist/chat/ChatUi.d.ts +362 -0
- package/dist/chat/ChatUi.d.ts.map +1 -0
- package/dist/chat/ChatUi.js +209 -0
- package/dist/chat/ChatUi.js.map +1 -0
- package/dist/chat/index.d.ts +60 -0
- package/dist/chat/index.d.ts.map +1 -0
- package/dist/chat/index.js +61 -0
- package/dist/chat/index.js.map +1 -0
- package/dist/chat/internal/retries.d.ts +2 -0
- package/dist/chat/internal/retries.d.ts.map +1 -0
- package/dist/chat/internal/retries.js +7 -0
- package/dist/chat/internal/retries.js.map +1 -0
- package/dist/cli/CliOutput.d.ts.map +1 -1
- package/dist/cli/CliOutput.js +6 -7
- package/dist/cli/CliOutput.js.map +1 -1
- package/dist/cli/Command.d.ts +20 -2
- package/dist/cli/Command.d.ts.map +1 -1
- package/dist/cli/Command.js +7 -1
- package/dist/cli/Command.js.map +1 -1
- package/dist/cli/Prompt.d.ts +5 -6
- package/dist/cli/Prompt.d.ts.map +1 -1
- package/dist/cli/Prompt.js +9 -4
- package/dist/cli/Prompt.js.map +1 -1
- package/dist/cli/internal/command.d.ts +1 -1
- package/dist/cli/internal/command.d.ts.map +1 -1
- package/dist/cli/internal/config.d.ts +1 -1
- package/dist/cli/internal/config.d.ts.map +1 -1
- package/dist/cli/internal/config.js +3 -3
- package/dist/cli/internal/config.js.map +1 -1
- package/dist/cli/internal/lexer.js +13 -0
- package/dist/cli/internal/lexer.js.map +1 -1
- package/dist/cli/internal/parser.js +23 -16
- package/dist/cli/internal/parser.js.map +1 -1
- package/dist/cli/internal/wizard.d.ts.map +1 -1
- package/dist/cli/internal/wizard.js +4 -0
- package/dist/cli/internal/wizard.js.map +1 -1
- package/dist/cluster/ClusterCron.d.ts +21 -1
- package/dist/cluster/ClusterCron.d.ts.map +1 -1
- package/dist/cluster/ClusterCron.js +24 -6
- package/dist/cluster/ClusterCron.js.map +1 -1
- package/dist/cluster/ClusterWorkflowEngine.d.ts.map +1 -1
- package/dist/cluster/ClusterWorkflowEngine.js +30 -22
- package/dist/cluster/ClusterWorkflowEngine.js.map +1 -1
- package/dist/cluster/Sharding.d.ts.map +1 -1
- package/dist/cluster/Sharding.js +15 -3
- package/dist/cluster/Sharding.js.map +1 -1
- package/dist/cluster/ShardingConfig.d.ts +6 -0
- package/dist/cluster/ShardingConfig.d.ts.map +1 -1
- package/dist/cluster/ShardingConfig.js.map +1 -1
- package/dist/cluster/SqlMessageStorage.d.ts.map +1 -1
- package/dist/cluster/SqlMessageStorage.js +13 -15
- package/dist/cluster/SqlMessageStorage.js.map +1 -1
- package/dist/cluster/SqlRunnerStorage.d.ts.map +1 -1
- package/dist/cluster/SqlRunnerStorage.js +18 -8
- package/dist/cluster/SqlRunnerStorage.js.map +1 -1
- package/dist/cluster/internal/entityManager.js +12 -8
- package/dist/cluster/internal/entityManager.js.map +1 -1
- package/dist/cluster/internal/entityReaper.js +1 -1
- package/dist/cluster/internal/entityReaper.js.map +1 -1
- package/dist/crypto/Kdf.d.ts +2 -1
- package/dist/crypto/Kdf.d.ts.map +1 -1
- package/dist/crypto/Kdf.js +2 -1
- package/dist/crypto/Kdf.js.map +1 -1
- package/dist/crypto/Password.d.ts +162 -0
- package/dist/crypto/Password.d.ts.map +1 -0
- package/dist/crypto/Password.js +217 -0
- package/dist/crypto/Password.js.map +1 -0
- package/dist/crypto/index.d.ts +5 -0
- package/dist/crypto/index.d.ts.map +1 -1
- package/dist/crypto/index.js +5 -0
- package/dist/crypto/index.js.map +1 -1
- package/dist/encoding/Base64.d.ts +63 -0
- package/dist/encoding/Base64.d.ts.map +1 -1
- package/dist/encoding/Base64.js +77 -0
- package/dist/encoding/Base64.js.map +1 -1
- package/dist/encoding/Base64Url.d.ts +1 -0
- package/dist/encoding/Base64Url.d.ts.map +1 -1
- package/dist/encoding/Base64Url.js +1 -0
- package/dist/encoding/Base64Url.js.map +1 -1
- package/dist/encoding/Csv.d.ts.map +1 -1
- package/dist/encoding/Csv.js +44 -16
- package/dist/encoding/Csv.js.map +1 -1
- package/dist/encoding/Hex.d.ts +5 -0
- package/dist/encoding/Hex.d.ts.map +1 -1
- package/dist/encoding/Hex.js +5 -0
- package/dist/encoding/Hex.js.map +1 -1
- package/dist/encoding/SchemaBinary.d.ts.map +1 -1
- package/dist/encoding/SchemaBinary.js +13 -124
- package/dist/encoding/SchemaBinary.js.map +1 -1
- package/dist/encoding/Sse.d.ts +1 -0
- package/dist/encoding/Sse.d.ts.map +1 -1
- package/dist/encoding/Sse.js +7 -5
- package/dist/encoding/Sse.js.map +1 -1
- package/dist/encoding/Xml.d.ts +117 -11
- package/dist/encoding/Xml.d.ts.map +1 -1
- package/dist/encoding/Xml.js +332 -42
- package/dist/encoding/Xml.js.map +1 -1
- package/dist/eventlog/EventJournal.d.ts.map +1 -1
- package/dist/eventlog/EventJournal.js +3 -8
- package/dist/eventlog/EventJournal.js.map +1 -1
- package/dist/eventlog/SqlEventLogServerEncrypted.js +6 -8
- package/dist/eventlog/SqlEventLogServerEncrypted.js.map +1 -1
- package/dist/http/FindMyWay/internal/router.js +163 -116
- package/dist/http/FindMyWay/internal/router.js.map +1 -1
- package/dist/http/FindMyWay.d.ts +99 -0
- package/dist/http/FindMyWay.d.ts.map +1 -1
- package/dist/http/FindMyWay.js +39 -0
- package/dist/http/FindMyWay.js.map +1 -1
- package/dist/http/HttpClient.d.ts.map +1 -1
- package/dist/http/HttpClient.js +1 -1
- package/dist/http/HttpClient.js.map +1 -1
- package/dist/http/HttpMiddleware.d.ts.map +1 -1
- package/dist/http/HttpMiddleware.js +18 -9
- package/dist/http/HttpMiddleware.js.map +1 -1
- package/dist/http/HttpRouter.d.ts +49 -1
- package/dist/http/HttpRouter.d.ts.map +1 -1
- package/dist/http/HttpRouter.js +70 -20
- package/dist/http/HttpRouter.js.map +1 -1
- package/dist/http/HttpServerResponse.d.ts.map +1 -1
- package/dist/http/HttpServerResponse.js +24 -58
- package/dist/http/HttpServerResponse.js.map +1 -1
- package/dist/http/Mime.d.ts.map +1 -1
- package/dist/http/Mime.js +3 -2
- package/dist/http/Mime.js.map +1 -1
- package/dist/http/internal/compression.d.ts.map +1 -1
- package/dist/http/internal/compression.js +2 -2
- package/dist/http/internal/compression.js.map +1 -1
- package/dist/http/internal/mediaType.d.ts.map +1 -0
- package/dist/{http-api → http}/internal/mediaType.js +4 -0
- package/dist/{http-api → http}/internal/mediaType.js.map +1 -1
- package/dist/http/internal/redactedPath.d.ts +2 -0
- package/dist/http/internal/redactedPath.d.ts.map +1 -0
- package/dist/http/internal/redactedPath.js +138 -0
- package/dist/http/internal/redactedPath.js.map +1 -0
- package/dist/http/internal/requestState.js +16 -0
- package/dist/http/internal/requestState.js.map +1 -1
- package/dist/http-api/HttpApi.d.ts +58 -0
- package/dist/http-api/HttpApi.d.ts.map +1 -1
- package/dist/http-api/HttpApi.js +80 -0
- 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 +12 -3
- package/dist/http-api/HttpApiBuilder.js.map +1 -1
- package/dist/http-api/HttpApiClient.d.ts +1 -1
- package/dist/http-api/HttpApiClient.d.ts.map +1 -1
- package/dist/http-api/HttpApiClient.js +11 -7
- package/dist/http-api/HttpApiClient.js.map +1 -1
- package/dist/http-api/HttpApiEndpoint.d.ts.map +1 -1
- package/dist/http-api/HttpApiEndpoint.js +1 -1
- package/dist/http-api/HttpApiEndpoint.js.map +1 -1
- package/dist/http-api/HttpApiScalar.d.ts +4 -0
- package/dist/http-api/HttpApiScalar.d.ts.map +1 -1
- package/dist/http-api/HttpApiScalar.js +10 -1
- package/dist/http-api/HttpApiScalar.js.map +1 -1
- package/dist/http-api/HttpApiSchema.d.ts +66 -0
- package/dist/http-api/HttpApiSchema.d.ts.map +1 -1
- package/dist/http-api/HttpApiSchema.js +67 -2
- package/dist/http-api/HttpApiSchema.js.map +1 -1
- package/dist/http-api/OpenApi.d.ts +2 -0
- package/dist/http-api/OpenApi.d.ts.map +1 -1
- package/dist/http-api/internal/httpApiScalar.js +5 -2
- package/dist/http-api/internal/httpApiScalar.js.map +1 -1
- package/dist/index.d.ts +5 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5 -0
- package/dist/index.js.map +1 -1
- package/dist/internal/arbitrary/model.js +0 -5
- package/dist/internal/arbitrary/model.js.map +1 -1
- package/dist/internal/arbitrary/regexp.js +2 -1
- package/dist/internal/arbitrary/regexp.js.map +1 -1
- package/dist/internal/arbitrary/runner.d.ts.map +1 -1
- package/dist/internal/arbitrary/runner.js +21 -16
- package/dist/internal/arbitrary/runner.js.map +1 -1
- package/dist/internal/arbitrary/schema.js +140 -23
- package/dist/internal/arbitrary/schema.js.map +1 -1
- package/dist/internal/codegen.d.ts +2 -0
- package/dist/internal/codegen.d.ts.map +1 -0
- package/dist/internal/codegen.js +59 -0
- package/dist/internal/codegen.js.map +1 -0
- package/dist/internal/core.js +3 -3
- package/dist/internal/core.js.map +1 -1
- package/dist/internal/dateTime.js +26 -12
- package/dist/internal/dateTime.js.map +1 -1
- package/dist/internal/effect.js +21 -7
- package/dist/internal/effect.js.map +1 -1
- package/dist/internal/hashMap.js +7 -7
- package/dist/internal/hashMap.js.map +1 -1
- package/dist/internal/matcher.js +2 -1
- package/dist/internal/matcher.js.map +1 -1
- package/dist/internal/record.js +18 -4
- package/dist/internal/record.js.map +1 -1
- package/dist/internal/result.js +1 -1
- package/dist/internal/result.js.map +1 -1
- package/dist/internal/schema/codeExpression.d.ts +4 -0
- package/dist/internal/schema/codeExpression.d.ts.map +1 -0
- package/dist/internal/schema/codeExpression.js +179 -0
- package/dist/internal/schema/codeExpression.js.map +1 -0
- package/dist/internal/schema/codeImports.d.ts +8 -0
- package/dist/internal/schema/codeImports.d.ts.map +1 -0
- package/dist/internal/schema/codeImports.js +135 -0
- package/dist/internal/schema/codeImports.js.map +1 -0
- package/dist/internal/schema/codeTokens.d.ts +8 -0
- package/dist/internal/schema/codeTokens.d.ts.map +1 -0
- package/dist/internal/schema/codeTokens.js +17 -0
- package/dist/internal/schema/codeTokens.js.map +1 -0
- package/dist/internal/schema/fromJsonSchemaDocument.js +141 -35
- package/dist/internal/schema/fromJsonSchemaDocument.js.map +1 -1
- package/dist/internal/schema/passthrough.d.ts +2 -0
- package/dist/internal/schema/passthrough.d.ts.map +1 -0
- package/dist/internal/schema/passthrough.js +8 -0
- package/dist/internal/schema/passthrough.js.map +1 -0
- package/dist/internal/schema/schemaCodegen.d.ts +2 -0
- package/dist/internal/schema/schemaCodegen.d.ts.map +1 -0
- package/dist/internal/schema/schemaCodegen.js +377 -0
- package/dist/internal/schema/schemaCodegen.js.map +1 -0
- package/dist/internal/schema/toJsonSchemaDocument.js +11 -4
- package/dist/internal/schema/toJsonSchemaDocument.js.map +1 -1
- package/dist/internal/trie.js +51 -64
- package/dist/internal/trie.js.map +1 -1
- package/dist/internal/utf8.d.ts +2 -0
- package/dist/internal/utf8.d.ts.map +1 -0
- package/dist/internal/utf8.js +151 -0
- package/dist/internal/utf8.js.map +1 -0
- package/dist/internal/version.js +1 -1
- package/dist/jose/Jwks.d.ts +13 -0
- package/dist/jose/Jwks.d.ts.map +1 -1
- package/dist/jose/Jwks.js +10 -2
- package/dist/jose/Jwks.js.map +1 -1
- package/dist/observability/OtlpExporter.d.ts.map +1 -1
- package/dist/observability/OtlpExporter.js +12 -10
- package/dist/observability/OtlpExporter.js.map +1 -1
- package/dist/observability/OtlpLogger.d.ts.map +1 -1
- package/dist/observability/OtlpLogger.js +5 -3
- package/dist/observability/OtlpLogger.js.map +1 -1
- package/dist/observability/internal/otlpProtobuf.d.ts +4 -2
- package/dist/observability/internal/otlpProtobuf.d.ts.map +1 -1
- package/dist/observability/internal/otlpProtobuf.js +238 -156
- package/dist/observability/internal/otlpProtobuf.js.map +1 -1
- package/dist/persistence/PersistedQueue.d.ts.map +1 -1
- package/dist/persistence/PersistedQueue.js +20 -3
- package/dist/persistence/PersistedQueue.js.map +1 -1
- package/dist/protobuf/ProtobufDescriptor.d.ts +377 -0
- package/dist/protobuf/ProtobufDescriptor.d.ts.map +1 -0
- package/dist/protobuf/ProtobufDescriptor.js +135 -0
- package/dist/protobuf/ProtobufDescriptor.js.map +1 -0
- package/dist/protobuf/ProtobufDescriptorProto.d.ts +2083 -0
- package/dist/protobuf/ProtobufDescriptorProto.d.ts.map +1 -0
- package/dist/protobuf/ProtobufDescriptorProto.js +2674 -0
- package/dist/protobuf/ProtobufDescriptorProto.js.map +1 -0
- package/dist/protobuf/ProtobufMessage.d.ts +183 -0
- package/dist/protobuf/ProtobufMessage.d.ts.map +1 -0
- package/dist/protobuf/ProtobufMessage.js +232 -0
- package/dist/protobuf/ProtobufMessage.js.map +1 -0
- package/dist/protobuf/ProtobufReader.d.ts +350 -0
- package/dist/protobuf/ProtobufReader.d.ts.map +1 -0
- package/dist/protobuf/ProtobufReader.js +698 -0
- package/dist/protobuf/ProtobufReader.js.map +1 -0
- package/dist/protobuf/ProtobufWriter.d.ts +224 -0
- package/dist/protobuf/ProtobufWriter.d.ts.map +1 -0
- package/dist/protobuf/ProtobufWriter.js +483 -0
- package/dist/protobuf/ProtobufWriter.js.map +1 -0
- package/dist/protobuf/index.d.ts +30 -0
- package/dist/protobuf/index.d.ts.map +1 -0
- package/dist/protobuf/index.js +31 -0
- package/dist/protobuf/index.js.map +1 -0
- package/dist/protobuf/internal/binary.d.ts +2 -0
- package/dist/protobuf/internal/binary.d.ts.map +1 -0
- package/dist/protobuf/internal/binary.js +966 -0
- package/dist/protobuf/internal/binary.js.map +1 -0
- package/dist/protobuf/internal/resolve.d.ts +2 -0
- package/dist/protobuf/internal/resolve.d.ts.map +1 -0
- package/dist/protobuf/internal/resolve.js +463 -0
- package/dist/protobuf/internal/resolve.js.map +1 -0
- package/dist/protobuf/internal/wireType.d.ts +2 -0
- package/dist/protobuf/internal/wireType.d.ts.map +1 -0
- package/dist/protobuf/internal/wireType.js +10 -0
- package/dist/protobuf/internal/wireType.js.map +1 -0
- package/dist/reactivity/AsyncResult.d.ts +3 -0
- package/dist/reactivity/AsyncResult.d.ts.map +1 -1
- package/dist/reactivity/AsyncResult.js +4 -1
- package/dist/reactivity/AsyncResult.js.map +1 -1
- package/dist/reactivity/Atom.d.ts +10 -4
- package/dist/reactivity/Atom.d.ts.map +1 -1
- package/dist/reactivity/Atom.js +38 -13
- package/dist/reactivity/Atom.js.map +1 -1
- package/dist/reactivity/AtomHttpApi.d.ts +5 -0
- package/dist/reactivity/AtomHttpApi.d.ts.map +1 -1
- package/dist/reactivity/AtomHttpApi.js +5 -1
- package/dist/reactivity/AtomHttpApi.js.map +1 -1
- package/dist/reactivity/AtomRegistry.js +13 -0
- package/dist/reactivity/AtomRegistry.js.map +1 -1
- package/dist/reactivity/AtomRpc.d.ts +5 -0
- package/dist/reactivity/AtomRpc.d.ts.map +1 -1
- package/dist/reactivity/AtomRpc.js +6 -1
- package/dist/reactivity/AtomRpc.js.map +1 -1
- package/dist/rpc/Rpc.d.ts +25 -0
- package/dist/rpc/Rpc.d.ts.map +1 -1
- package/dist/rpc/Rpc.js +18 -0
- package/dist/rpc/Rpc.js.map +1 -1
- package/dist/rpc/RpcClient.d.ts.map +1 -1
- package/dist/rpc/RpcClient.js +38 -21
- package/dist/rpc/RpcClient.js.map +1 -1
- package/dist/rpc/RpcGroup.d.ts +5 -0
- package/dist/rpc/RpcGroup.d.ts.map +1 -1
- package/dist/rpc/RpcGroup.js.map +1 -1
- package/dist/rpc/RpcMiddleware.d.ts +9 -0
- package/dist/rpc/RpcMiddleware.d.ts.map +1 -1
- package/dist/rpc/RpcMiddleware.js.map +1 -1
- package/dist/rpc/RpcSerialization.d.ts +7 -1
- package/dist/rpc/RpcSerialization.d.ts.map +1 -1
- package/dist/rpc/RpcSerialization.js +22 -5
- package/dist/rpc/RpcSerialization.js.map +1 -1
- package/dist/rpc/RpcServer.d.ts.map +1 -1
- package/dist/rpc/RpcServer.js +33 -18
- package/dist/rpc/RpcServer.js.map +1 -1
- package/dist/schema/SchemaCompiler/runtime.js +2 -1
- package/dist/schema/SchemaCompiler/runtime.js.map +1 -1
- package/dist/schema/VariantSchema.d.ts +10 -2
- package/dist/schema/VariantSchema.d.ts.map +1 -1
- package/dist/schema/VariantSchema.js +7 -1
- package/dist/schema/VariantSchema.js.map +1 -1
- package/dist/socket/Socket.d.ts +24 -10
- package/dist/socket/Socket.d.ts.map +1 -1
- package/dist/socket/Socket.js +52 -17
- package/dist/socket/Socket.js.map +1 -1
- package/dist/sql/Migrator.d.ts +3 -0
- package/dist/sql/Migrator.d.ts.map +1 -1
- package/dist/sql/Migrator.js +10 -1
- package/dist/sql/Migrator.js.map +1 -1
- package/dist/sql/SqlModel.d.ts.map +1 -1
- package/dist/sql/SqlModel.js +1 -0
- package/dist/sql/SqlModel.js.map +1 -1
- package/dist/testing/TestClock.js +3 -1
- package/dist/testing/TestClock.js.map +1 -1
- package/dist/testing/TestConsole.d.ts +96 -0
- package/dist/testing/TestConsole.d.ts.map +1 -1
- package/dist/testing/TestConsole.js +78 -6
- package/dist/testing/TestConsole.js.map +1 -1
- package/dist/testing/TestSchema.d.ts +5 -1
- package/dist/testing/TestSchema.d.ts.map +1 -1
- package/dist/testing/TestSchema.js +7 -2
- package/dist/testing/TestSchema.js.map +1 -1
- package/dist/workers/SharedMemory.d.ts +115 -0
- package/dist/workers/SharedMemory.d.ts.map +1 -0
- package/dist/workers/SharedMemory.js +149 -0
- package/dist/workers/SharedMemory.js.map +1 -0
- package/dist/workers/Transferable.d.ts.map +1 -1
- package/dist/workers/Transferable.js +1 -4
- package/dist/workers/Transferable.js.map +1 -1
- package/dist/workers/index.d.ts +5 -0
- package/dist/workers/index.d.ts.map +1 -1
- package/dist/workers/index.js +5 -0
- package/dist/workers/index.js.map +1 -1
- package/dist/workflow/WorkflowEngine.d.ts.map +1 -1
- package/dist/workflow/WorkflowEngine.js +3 -1
- package/dist/workflow/WorkflowEngine.js.map +1 -1
- package/package.json +7 -4
- package/src/Arbitrary.ts +60 -3
- package/src/BigInt.ts +247 -9
- package/src/Cache.ts +4 -2
- package/src/Cause.ts +3 -3
- package/src/Chunk.ts +7 -3
- package/src/Clock.ts +5 -2
- package/src/Codegen.ts +741 -0
- package/src/Config.ts +35 -4
- package/src/ConfigProvider.ts +24 -7
- package/src/Effect.ts +871 -109
- package/src/Equivalence.ts +16 -13
- package/src/Fiber.ts +58 -8
- package/src/FiberHandle.ts +86 -12
- package/src/FiberMap.ts +83 -10
- package/src/FiberSet.ts +96 -8
- package/src/Formatter.ts +2 -0
- package/src/LayerMap.ts +14 -4
- package/src/LayerRef.ts +2 -2
- package/src/Match.ts +16 -0
- package/src/Metric.ts +1 -1
- package/src/Option.ts +9 -5
- package/src/Order.ts +9 -4
- package/src/Pool.ts +22 -17
- package/src/Predicate.ts +7 -3
- package/src/Queue.ts +84 -31
- package/src/Rational.ts +198 -0
- package/src/Request.ts +20 -0
- package/src/Result.ts +9 -6
- package/src/Schema.ts +69 -32
- package/src/SchemaAST.ts +15 -4
- package/src/SchemaGetter.ts +17 -10
- package/src/SchemaRepresentation.ts +37 -77
- package/src/SchemaTransformation.ts +12 -11
- package/src/Scope.ts +12 -6
- package/src/ScopedCache.ts +2 -1
- package/src/Semaphore.ts +18 -4
- package/src/Stream.ts +66 -20
- package/src/String.ts +83 -6
- package/src/Struct.ts +138 -5
- package/src/TextDiff.ts +186 -30
- package/src/TxPriorityQueue.ts +2 -2
- package/src/ai/Chat.ts +9 -3
- package/src/ai/LanguageModel.ts +72 -15
- package/src/ai/McpClient.ts +1 -11
- package/src/ai/McpServer.ts +146 -25
- package/src/ai/Tool.ts +3 -2
- package/src/ai/Toolkit.ts +3 -1
- package/src/ai/WorkloadIdentity.ts +318 -0
- package/src/ai/index.ts +6 -0
- package/src/ai/internal/mcpProtocol/v2024_11_05.ts +3 -1
- package/src/ai/internal/mcpProtocol/v2025_03_26.ts +3 -1
- package/src/ai/internal/mcpProtocol/v2025_06_18.ts +3 -1
- package/src/ai/internal/mcpProtocol/v2025_11_25.ts +3 -1
- package/src/ai/internal/mcpRuntime.ts +2 -6
- package/src/ai/internal/mcpSkills.ts +70 -2
- package/src/ai/internal/structured-output.ts +6 -1
- package/src/chat/Chat.ts +164 -0
- package/src/chat/ChatAdapter.ts +444 -0
- package/src/chat/ChatError.ts +684 -0
- package/src/chat/ChatEvent.ts +221 -0
- package/src/chat/ChatHandler.ts +102 -0
- package/src/chat/ChatInteraction.ts +1979 -0
- package/src/chat/ChatMarkdown.ts +1406 -0
- package/src/chat/ChatMessage.ts +213 -0
- package/src/chat/ChatTest.ts +2606 -0
- package/src/chat/ChatThread.ts +132 -0
- package/src/chat/ChatUi.ts +320 -0
- package/src/chat/index.ts +72 -0
- package/src/chat/internal/retries.ts +7 -0
- package/src/cli/CliOutput.ts +4 -5
- package/src/cli/Command.ts +25 -3
- package/src/cli/Prompt.ts +15 -9
- package/src/cli/internal/config.ts +8 -8
- package/src/cli/internal/lexer.ts +14 -0
- package/src/cli/internal/parser.ts +28 -20
- package/src/cli/internal/wizard.ts +4 -0
- package/src/cluster/ClusterCron.ts +33 -10
- package/src/cluster/ClusterWorkflowEngine.ts +42 -23
- package/src/cluster/Sharding.ts +17 -3
- package/src/cluster/ShardingConfig.ts +3 -0
- package/src/cluster/SqlMessageStorage.ts +16 -20
- package/src/cluster/SqlRunnerStorage.ts +21 -8
- package/src/cluster/internal/entityManager.ts +19 -10
- package/src/cluster/internal/entityReaper.ts +1 -1
- package/src/crypto/Kdf.ts +2 -1
- package/src/crypto/Password.ts +258 -0
- package/src/crypto/index.ts +6 -0
- package/src/encoding/Base64.ts +79 -0
- package/src/encoding/Base64Url.ts +1 -0
- package/src/encoding/Csv.ts +47 -20
- package/src/encoding/Hex.ts +5 -0
- package/src/encoding/SchemaBinary.ts +13 -79
- package/src/encoding/Sse.ts +7 -5
- package/src/encoding/Xml.ts +394 -47
- package/src/eventlog/EventJournal.ts +3 -8
- package/src/eventlog/SqlEventLogServerEncrypted.ts +9 -9
- package/src/http/FindMyWay/internal/router.ts +181 -129
- package/src/http/FindMyWay.ts +106 -0
- package/src/http/HttpClient.ts +2 -1
- package/src/http/HttpMiddleware.ts +34 -10
- package/src/http/HttpRouter.ts +84 -20
- package/src/http/HttpServerResponse.ts +33 -61
- package/src/http/Mime.ts +3 -2
- package/src/http/internal/compression.ts +2 -2
- package/src/{http-api → http}/internal/mediaType.ts +4 -0
- package/src/http/internal/redactedPath.ts +144 -0
- package/src/http/internal/requestState.ts +22 -0
- package/src/http-api/HttpApi.ts +103 -0
- package/src/http-api/HttpApiBuilder.ts +14 -3
- package/src/http-api/HttpApiClient.ts +23 -8
- package/src/http-api/HttpApiEndpoint.ts +1 -1
- package/src/http-api/HttpApiScalar.ts +9 -1
- package/src/http-api/HttpApiSchema.ts +69 -3
- package/src/http-api/OpenApi.ts +2 -0
- package/src/http-api/internal/httpApiScalar.ts +5 -1
- package/src/index.ts +6 -0
- package/src/internal/arbitrary/model.ts +3 -9
- package/src/internal/arbitrary/regexp.ts +3 -1
- package/src/internal/arbitrary/runner.ts +28 -14
- package/src/internal/arbitrary/schema.ts +140 -35
- package/src/internal/codegen.ts +53 -0
- package/src/internal/core.ts +3 -3
- package/src/internal/dateTime.ts +30 -13
- package/src/internal/effect.ts +25 -9
- package/src/internal/hashMap.ts +8 -7
- package/src/internal/matcher.ts +2 -1
- package/src/internal/record.ts +19 -4
- package/src/internal/result.ts +1 -1
- package/src/internal/schema/codeExpression.ts +179 -0
- package/src/internal/schema/codeImports.ts +142 -0
- package/src/internal/schema/codeTokens.ts +39 -0
- package/src/internal/schema/fromJsonSchemaDocument.ts +154 -34
- package/src/internal/schema/passthrough.ts +8 -0
- package/src/internal/schema/schemaCodegen.ts +543 -0
- package/src/internal/schema/toJsonSchemaDocument.ts +13 -4
- package/src/internal/trie.ts +46 -60
- package/src/internal/utf8.ts +106 -0
- package/src/internal/version.ts +1 -1
- package/src/jose/Jwks.ts +23 -4
- package/src/observability/OtlpExporter.ts +12 -10
- package/src/observability/OtlpLogger.ts +5 -3
- package/src/observability/internal/otlpProtobuf.ts +386 -457
- package/src/persistence/PersistedQueue.ts +21 -4
- package/src/protobuf/ProtobufDescriptor.ts +503 -0
- package/src/protobuf/ProtobufDescriptorProto.ts +3611 -0
- package/src/protobuf/ProtobufMessage.ts +277 -0
- package/src/protobuf/ProtobufReader.ts +756 -0
- package/src/protobuf/ProtobufWriter.ts +530 -0
- package/src/protobuf/index.ts +36 -0
- package/src/protobuf/internal/binary.ts +1215 -0
- package/src/protobuf/internal/resolve.ts +533 -0
- package/src/protobuf/internal/wireType.ts +9 -0
- package/src/reactivity/AsyncResult.ts +6 -1
- package/src/reactivity/Atom.ts +55 -16
- package/src/reactivity/AtomHttpApi.ts +10 -1
- package/src/reactivity/AtomRegistry.ts +16 -0
- package/src/reactivity/AtomRpc.ts +11 -1
- package/src/rpc/Rpc.ts +31 -0
- package/src/rpc/RpcClient.ts +30 -21
- package/src/rpc/RpcGroup.ts +5 -0
- package/src/rpc/RpcMiddleware.ts +9 -0
- package/src/rpc/RpcSerialization.ts +26 -6
- package/src/rpc/RpcServer.ts +33 -20
- package/src/schema/SchemaCompiler/runtime.ts +2 -3
- package/src/schema/VariantSchema.ts +12 -4
- package/src/socket/Socket.ts +67 -20
- package/src/sql/Migrator.ts +8 -1
- package/src/sql/SqlModel.ts +4 -0
- package/src/testing/TestClock.ts +1 -1
- package/src/testing/TestConsole.ts +119 -9
- package/src/testing/TestSchema.ts +8 -3
- package/src/workers/SharedMemory.ts +227 -0
- package/src/workers/Transferable.ts +1 -5
- package/src/workers/index.ts +6 -0
- package/src/workflow/WorkflowEngine.ts +3 -1
- package/dist/http-api/internal/mediaType.d.ts.map +0 -1
- package/dist/internal/schema/toCodeDocument.d.ts +0 -2
- package/dist/internal/schema/toCodeDocument.d.ts.map +0 -1
- package/dist/internal/schema/toCodeDocument.js +0 -444
- package/dist/internal/schema/toCodeDocument.js.map +0 -1
- package/dist/observability/internal/protobuf.d.ts +0 -2
- package/dist/observability/internal/protobuf.d.ts.map +0 -1
- package/dist/observability/internal/protobuf.js +0 -169
- package/dist/observability/internal/protobuf.js.map +0 -1
- package/src/internal/schema/toCodeDocument.ts +0 -570
- package/src/observability/internal/protobuf.ts +0 -225
- /package/dist/{http-api → http}/internal/mediaType.d.ts +0 -0
|
@@ -1,14 +1,33 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* OTLP Protobuf encoding for traces, metrics, and logs.
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
4
|
+
* Writes the messages of https://github.com/open-telemetry/opentelemetry-proto
|
|
5
|
+
* with a `ProtobufWriter`. Each `write*` function writes the fields of one
|
|
6
|
+
* message and returns the writer, so nested messages chain:
|
|
7
|
+
* `writeStatus(w.tag(15, LEN).fork(), status).join()`.
|
|
6
8
|
*/
|
|
7
|
-
import * as
|
|
9
|
+
import * as Hex from "../../encoding/Hex.js";
|
|
10
|
+
import * as ProtobufWriter from "../../protobuf/ProtobufWriter.js";
|
|
11
|
+
import * as Result from "../../Result.js";
|
|
12
|
+
const VARINT = ProtobufWriter.WireType.Varint;
|
|
13
|
+
const I64 = ProtobufWriter.WireType.I64;
|
|
14
|
+
const LEN = ProtobufWriter.WireType.Len;
|
|
15
|
+
const I32 = ProtobufWriter.WireType.I32;
|
|
16
|
+
// The bytes of a hex id. An id that is not valid hex is parsed pair by pair
|
|
17
|
+
// with `parseInt`, and a trailing odd character is ignored.
|
|
18
|
+
const hexBytes = hex => {
|
|
19
|
+
const decoded = Hex.decode(hex);
|
|
20
|
+
if (Result.isSuccess(decoded)) return decoded.success;
|
|
21
|
+
const bytes = new Uint8Array(hex.length >>> 1);
|
|
22
|
+
for (let i = 0; i < bytes.length; i++) {
|
|
23
|
+
bytes[i] = parseInt(hex.slice(i * 2, i * 2 + 2), 16);
|
|
24
|
+
}
|
|
25
|
+
return bytes;
|
|
26
|
+
};
|
|
27
|
+
// A log record id is a hex string or the bytes themselves.
|
|
28
|
+
const idBytes = id => typeof id === "string" ? hexBytes(id) : id;
|
|
8
29
|
// Common types (opentelemetry.proto.common.v1)
|
|
9
30
|
/**
|
|
10
|
-
* Encodes an AnyValue message.
|
|
11
|
-
*
|
|
12
31
|
* message AnyValue {
|
|
13
32
|
* oneof value {
|
|
14
33
|
* string string_value = 1;
|
|
@@ -20,116 +39,110 @@ import * as Proto from "./protobuf.js";
|
|
|
20
39
|
* bytes bytes_value = 7;
|
|
21
40
|
* }
|
|
22
41
|
* }
|
|
23
|
-
*
|
|
24
|
-
* @internal
|
|
25
42
|
*/
|
|
26
|
-
|
|
43
|
+
const writeAnyValue = (w, value) => {
|
|
27
44
|
if (value.stringValue !== undefined && value.stringValue !== null) {
|
|
28
|
-
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
if (value.
|
|
34
|
-
|
|
45
|
+
w.tag(1, LEN).string(value.stringValue);
|
|
46
|
+
} else if (value.boolValue !== undefined && value.boolValue !== null) {
|
|
47
|
+
w.tag(2, VARINT).bool(value.boolValue);
|
|
48
|
+
} else if (value.intValue !== undefined && value.intValue !== null) {
|
|
49
|
+
w.tag(3, VARINT).int64(value.intValue);
|
|
50
|
+
} else if (value.doubleValue !== undefined && value.doubleValue !== null) {
|
|
51
|
+
w.tag(4, I64).double(value.doubleValue);
|
|
52
|
+
} else if (value.arrayValue !== undefined) {
|
|
53
|
+
writeArrayValue(w.tag(5, LEN).fork(), value.arrayValue).join();
|
|
54
|
+
} else if (value.kvlistValue !== undefined) {
|
|
55
|
+
writeKeyValueList(w.tag(6, LEN).fork(), value.kvlistValue).join();
|
|
56
|
+
} else if (value.bytesValue !== undefined) {
|
|
57
|
+
w.tag(7, LEN).bytes(value.bytesValue);
|
|
35
58
|
}
|
|
36
|
-
|
|
37
|
-
return Proto.doubleField(4, value.doubleValue);
|
|
38
|
-
}
|
|
39
|
-
if (value.arrayValue !== undefined) {
|
|
40
|
-
return Proto.messageField(5, encodeArrayValue(value.arrayValue));
|
|
41
|
-
}
|
|
42
|
-
if (value.kvlistValue !== undefined) {
|
|
43
|
-
return Proto.messageField(6, encodeKeyValueList(value.kvlistValue));
|
|
44
|
-
}
|
|
45
|
-
if (value.bytesValue !== undefined) {
|
|
46
|
-
return Proto.lengthDelimitedField(7, value.bytesValue);
|
|
47
|
-
}
|
|
48
|
-
return new Uint8Array(0);
|
|
59
|
+
return w;
|
|
49
60
|
};
|
|
50
61
|
/**
|
|
51
|
-
* Encodes an ArrayValue message.
|
|
52
|
-
*
|
|
53
62
|
* message ArrayValue {
|
|
54
63
|
* repeated AnyValue values = 1;
|
|
55
64
|
* }
|
|
56
|
-
*
|
|
57
|
-
* @internal
|
|
58
65
|
*/
|
|
59
|
-
|
|
66
|
+
const writeArrayValue = (w, value) => {
|
|
67
|
+
for (const item of value.values) writeAnyValue(w.tag(1, LEN).fork(), item).join();
|
|
68
|
+
return w;
|
|
69
|
+
};
|
|
60
70
|
/**
|
|
61
|
-
* Encodes a KeyValueList message.
|
|
62
|
-
*
|
|
63
71
|
* message KeyValueList {
|
|
64
72
|
* repeated KeyValue values = 1;
|
|
65
73
|
* }
|
|
66
|
-
*
|
|
67
|
-
* @internal
|
|
68
74
|
*/
|
|
69
|
-
|
|
75
|
+
const writeKeyValueList = (w, value) => {
|
|
76
|
+
for (const item of value.values) writeKeyValue(w.tag(1, LEN).fork(), item).join();
|
|
77
|
+
return w;
|
|
78
|
+
};
|
|
70
79
|
/**
|
|
71
|
-
* Encodes a KeyValue message.
|
|
72
|
-
*
|
|
73
80
|
* message KeyValue {
|
|
74
81
|
* string key = 1;
|
|
75
82
|
* AnyValue value = 2;
|
|
76
83
|
* }
|
|
77
|
-
*
|
|
78
|
-
* @internal
|
|
79
84
|
*/
|
|
80
|
-
|
|
85
|
+
const writeKeyValue = (w, kv) => {
|
|
86
|
+
w.tag(1, LEN).string(kv.key);
|
|
87
|
+
writeAnyValue(w.tag(2, LEN).fork(), kv.value).join();
|
|
88
|
+
return w;
|
|
89
|
+
};
|
|
81
90
|
/**
|
|
82
|
-
* Encodes an InstrumentationScope message.
|
|
83
|
-
*
|
|
84
91
|
* message InstrumentationScope {
|
|
85
92
|
* string name = 1;
|
|
86
93
|
* string version = 2;
|
|
87
94
|
* repeated KeyValue attributes = 3;
|
|
88
95
|
* uint32 dropped_attributes_count = 4;
|
|
89
96
|
* }
|
|
90
|
-
*
|
|
91
|
-
* @internal
|
|
92
97
|
*/
|
|
93
|
-
|
|
98
|
+
const writeInstrumentationScope = (w, scope) => {
|
|
99
|
+
w.tag(1, LEN).string(scope.name);
|
|
100
|
+
if (scope.version) w.tag(2, LEN).string(scope.version);
|
|
101
|
+
if (scope.attributes) {
|
|
102
|
+
for (const item of scope.attributes) writeKeyValue(w.tag(3, LEN).fork(), item).join();
|
|
103
|
+
}
|
|
104
|
+
if (scope.droppedAttributesCount) w.tag(4, VARINT).uint32(scope.droppedAttributesCount);
|
|
105
|
+
return w;
|
|
106
|
+
};
|
|
94
107
|
// Resource types (opentelemetry.proto.resource.v1)
|
|
95
108
|
/**
|
|
96
|
-
* Encodes a Resource message.
|
|
97
|
-
*
|
|
98
109
|
* message Resource {
|
|
99
110
|
* repeated KeyValue attributes = 1;
|
|
100
111
|
* uint32 dropped_attributes_count = 2;
|
|
101
112
|
* }
|
|
102
|
-
*
|
|
103
|
-
* @internal
|
|
104
113
|
*/
|
|
105
|
-
|
|
114
|
+
const writeResource = (w, resource) => {
|
|
115
|
+
for (const item of resource.attributes) writeKeyValue(w.tag(1, LEN).fork(), item).join();
|
|
116
|
+
if (resource.droppedAttributesCount > 0) w.tag(2, VARINT).uint32(resource.droppedAttributesCount);
|
|
117
|
+
return w;
|
|
118
|
+
};
|
|
106
119
|
/**
|
|
107
|
-
* Encodes a Status message.
|
|
108
|
-
*
|
|
109
120
|
* message Status {
|
|
110
121
|
* string message = 2;
|
|
111
122
|
* StatusCode code = 3;
|
|
112
123
|
* }
|
|
113
|
-
*
|
|
114
|
-
* @internal
|
|
115
124
|
*/
|
|
116
|
-
|
|
125
|
+
const writeStatus = (w, status) => {
|
|
126
|
+
if (status.message) w.tag(2, LEN).string(status.message);
|
|
127
|
+
w.tag(3, VARINT).int32(status.code);
|
|
128
|
+
return w;
|
|
129
|
+
};
|
|
117
130
|
/**
|
|
118
|
-
* Encodes an Event message.
|
|
119
|
-
*
|
|
120
131
|
* message Event {
|
|
121
132
|
* fixed64 time_unix_nano = 1;
|
|
122
133
|
* string name = 2;
|
|
123
134
|
* repeated KeyValue attributes = 3;
|
|
124
135
|
* uint32 dropped_attributes_count = 4;
|
|
125
136
|
* }
|
|
126
|
-
*
|
|
127
|
-
* @internal
|
|
128
137
|
*/
|
|
129
|
-
|
|
138
|
+
const writeEvent = (w, event) => {
|
|
139
|
+
w.tag(1, I64).fixed64(event.timeUnixNano);
|
|
140
|
+
w.tag(2, LEN).string(event.name);
|
|
141
|
+
for (const item of event.attributes) writeKeyValue(w.tag(3, LEN).fork(), item).join();
|
|
142
|
+
if (event.droppedAttributesCount > 0) w.tag(4, VARINT).uint32(event.droppedAttributesCount);
|
|
143
|
+
return w;
|
|
144
|
+
};
|
|
130
145
|
/**
|
|
131
|
-
* Encodes a Link message.
|
|
132
|
-
*
|
|
133
146
|
* message Link {
|
|
134
147
|
* bytes trace_id = 1;
|
|
135
148
|
* bytes span_id = 2;
|
|
@@ -138,13 +151,17 @@ export const encodeEvent = event => Proto.concat(Proto.fixed64Field(1, BigInt(ev
|
|
|
138
151
|
* uint32 dropped_attributes_count = 5;
|
|
139
152
|
* fixed32 flags = 6;
|
|
140
153
|
* }
|
|
141
|
-
*
|
|
142
|
-
* @internal
|
|
143
154
|
*/
|
|
144
|
-
|
|
155
|
+
const writeLink = (w, link) => {
|
|
156
|
+
w.tag(1, LEN).bytes(hexBytes(link.traceId));
|
|
157
|
+
w.tag(2, LEN).bytes(hexBytes(link.spanId));
|
|
158
|
+
if (link.traceState) w.tag(3, LEN).string(link.traceState);
|
|
159
|
+
for (const item of link.attributes) writeKeyValue(w.tag(4, LEN).fork(), item).join();
|
|
160
|
+
if (link.droppedAttributesCount > 0) w.tag(5, VARINT).uint32(link.droppedAttributesCount);
|
|
161
|
+
if (link.flags !== undefined) w.tag(6, I32).fixed32(link.flags);
|
|
162
|
+
return w;
|
|
163
|
+
};
|
|
145
164
|
/**
|
|
146
|
-
* Encodes a Span message.
|
|
147
|
-
*
|
|
148
165
|
* message Span {
|
|
149
166
|
* bytes trace_id = 1;
|
|
150
167
|
* bytes span_id = 2;
|
|
@@ -163,34 +180,52 @@ export const encodeLink = link => Proto.concat(Proto.bytesFieldFromHex(1, link.t
|
|
|
163
180
|
* Status status = 15;
|
|
164
181
|
* fixed32 flags = 16;
|
|
165
182
|
* }
|
|
166
|
-
*
|
|
167
|
-
* @internal
|
|
168
183
|
*/
|
|
169
|
-
|
|
184
|
+
const writeSpan = (w, span) => {
|
|
185
|
+
w.tag(1, LEN).bytes(hexBytes(span.traceId));
|
|
186
|
+
w.tag(2, LEN).bytes(hexBytes(span.spanId));
|
|
187
|
+
if (span.traceState) w.tag(3, LEN).string(span.traceState);
|
|
188
|
+
if (span.parentSpanId !== undefined) w.tag(4, LEN).bytes(hexBytes(span.parentSpanId));
|
|
189
|
+
w.tag(5, LEN).string(span.name);
|
|
190
|
+
w.tag(6, VARINT).int32(span.kind);
|
|
191
|
+
w.tag(7, I64).fixed64(span.startTimeUnixNano);
|
|
192
|
+
w.tag(8, I64).fixed64(span.endTimeUnixNano);
|
|
193
|
+
for (const item of span.attributes) writeKeyValue(w.tag(9, LEN).fork(), item).join();
|
|
194
|
+
if (span.droppedAttributesCount > 0) w.tag(10, VARINT).uint32(span.droppedAttributesCount);
|
|
195
|
+
for (const item of span.events) writeEvent(w.tag(11, LEN).fork(), item).join();
|
|
196
|
+
if (span.droppedEventsCount > 0) w.tag(12, VARINT).uint32(span.droppedEventsCount);
|
|
197
|
+
for (const item of span.links) writeLink(w.tag(13, LEN).fork(), item).join();
|
|
198
|
+
if (span.droppedLinksCount > 0) w.tag(14, VARINT).uint32(span.droppedLinksCount);
|
|
199
|
+
writeStatus(w.tag(15, LEN).fork(), span.status).join();
|
|
200
|
+
if (span.flags !== undefined) w.tag(16, I32).fixed32(span.flags);
|
|
201
|
+
return w;
|
|
202
|
+
};
|
|
170
203
|
/**
|
|
171
|
-
* Encodes a ScopeSpans message.
|
|
172
|
-
*
|
|
173
204
|
* message ScopeSpans {
|
|
174
205
|
* InstrumentationScope scope = 1;
|
|
175
206
|
* repeated Span spans = 2;
|
|
176
207
|
* string schema_url = 3;
|
|
177
208
|
* }
|
|
178
|
-
*
|
|
179
|
-
* @internal
|
|
180
209
|
*/
|
|
181
|
-
|
|
210
|
+
const writeScopeSpans = (w, scopeSpans) => {
|
|
211
|
+
writeInstrumentationScope(w.tag(1, LEN).fork(), scopeSpans.scope).join();
|
|
212
|
+
for (const item of scopeSpans.spans) writeSpan(w.tag(2, LEN).fork(), item).join();
|
|
213
|
+
if (scopeSpans.schemaUrl) w.tag(3, LEN).string(scopeSpans.schemaUrl);
|
|
214
|
+
return w;
|
|
215
|
+
};
|
|
182
216
|
/**
|
|
183
|
-
* Encodes a ResourceSpans message.
|
|
184
|
-
*
|
|
185
217
|
* message ResourceSpans {
|
|
186
218
|
* Resource resource = 1;
|
|
187
219
|
* repeated ScopeSpans scope_spans = 2;
|
|
188
220
|
* string schema_url = 3;
|
|
189
221
|
* }
|
|
190
|
-
*
|
|
191
|
-
* @internal
|
|
192
222
|
*/
|
|
193
|
-
|
|
223
|
+
const writeResourceSpans = (w, resourceSpans) => {
|
|
224
|
+
writeResource(w.tag(1, LEN).fork(), resourceSpans.resource).join();
|
|
225
|
+
for (const item of resourceSpans.scopeSpans) writeScopeSpans(w.tag(2, LEN).fork(), item).join();
|
|
226
|
+
if (resourceSpans.schemaUrl) w.tag(3, LEN).string(resourceSpans.schemaUrl);
|
|
227
|
+
return w;
|
|
228
|
+
};
|
|
194
229
|
/**
|
|
195
230
|
* Encodes a TracesData message (top-level export request).
|
|
196
231
|
*
|
|
@@ -200,10 +235,12 @@ export const encodeResourceSpans = resourceSpans => Proto.concat(Proto.messageFi
|
|
|
200
235
|
*
|
|
201
236
|
* @internal
|
|
202
237
|
*/
|
|
203
|
-
export const encodeTracesData = tracesData =>
|
|
238
|
+
export const encodeTracesData = tracesData => {
|
|
239
|
+
const w = ProtobufWriter.make();
|
|
240
|
+
for (const item of tracesData.resourceSpans) writeResourceSpans(w.tag(1, LEN).fork(), item).join();
|
|
241
|
+
return w.finish();
|
|
242
|
+
};
|
|
204
243
|
/**
|
|
205
|
-
* Encodes a NumberDataPoint message.
|
|
206
|
-
*
|
|
207
244
|
* message NumberDataPoint {
|
|
208
245
|
* repeated KeyValue attributes = 7;
|
|
209
246
|
* fixed64 start_time_unix_nano = 2;
|
|
@@ -215,13 +252,17 @@ export const encodeTracesData = tracesData => Proto.repeatedField(1, tracesData.
|
|
|
215
252
|
* repeated Exemplar exemplars = 5;
|
|
216
253
|
* uint32 flags = 8;
|
|
217
254
|
* }
|
|
218
|
-
*
|
|
219
|
-
* @internal
|
|
220
255
|
*/
|
|
221
|
-
|
|
256
|
+
const writeNumberDataPoint = (w, point) => {
|
|
257
|
+
if (point.startTimeUnixNano !== undefined) w.tag(2, I64).fixed64(point.startTimeUnixNano);
|
|
258
|
+
w.tag(3, I64).fixed64(point.timeUnixNano);
|
|
259
|
+
if (point.asDouble !== undefined) w.tag(4, I64).double(point.asDouble);
|
|
260
|
+
if (point.asInt !== undefined) w.tag(6, I64).fixed64(point.asInt);
|
|
261
|
+
for (const item of point.attributes) writeKeyValue(w.tag(7, LEN).fork(), item).join();
|
|
262
|
+
if (point.flags !== undefined) w.tag(8, VARINT).uint32(point.flags);
|
|
263
|
+
return w;
|
|
264
|
+
};
|
|
222
265
|
/**
|
|
223
|
-
* Encodes a HistogramDataPoint message.
|
|
224
|
-
*
|
|
225
266
|
* message HistogramDataPoint {
|
|
226
267
|
* repeated KeyValue attributes = 9;
|
|
227
268
|
* fixed64 start_time_unix_nano = 2;
|
|
@@ -234,52 +275,60 @@ export const encodeNumberDataPoint = point => Proto.concat(Proto.optionalFixed64
|
|
|
234
275
|
* optional double max = 12;
|
|
235
276
|
* uint32 flags = 10;
|
|
236
277
|
* }
|
|
237
|
-
*
|
|
238
|
-
* @internal
|
|
239
278
|
*/
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
279
|
+
const writeHistogramDataPoint = (w, point) => {
|
|
280
|
+
if (point.startTimeUnixNano !== undefined) w.tag(2, I64).fixed64(point.startTimeUnixNano);
|
|
281
|
+
w.tag(3, I64).fixed64(point.timeUnixNano);
|
|
282
|
+
w.tag(4, I64).fixed64(point.count);
|
|
283
|
+
if (point.sum !== undefined) w.tag(5, I64).double(point.sum);
|
|
284
|
+
// Bucket counts and bounds are written unpacked, one field per value
|
|
285
|
+
for (let i = 0; i < point.bucketCounts.length; i++) w.tag(6, I64).fixed64(point.bucketCounts[i]);
|
|
286
|
+
for (let i = 0; i < point.explicitBounds.length; i++) w.tag(7, I64).double(point.explicitBounds[i]);
|
|
287
|
+
for (const item of point.attributes) writeKeyValue(w.tag(9, LEN).fork(), item).join();
|
|
288
|
+
if (point.flags !== undefined) w.tag(10, VARINT).uint32(point.flags);
|
|
289
|
+
if (point.min !== undefined) w.tag(11, I64).double(point.min);
|
|
290
|
+
if (point.max !== undefined) w.tag(12, I64).double(point.max);
|
|
291
|
+
return w;
|
|
246
292
|
};
|
|
247
293
|
/**
|
|
248
|
-
* Encodes a Gauge message.
|
|
249
|
-
*
|
|
250
294
|
* message Gauge {
|
|
251
295
|
* repeated NumberDataPoint data_points = 1;
|
|
252
296
|
* }
|
|
253
|
-
*
|
|
254
|
-
* @internal
|
|
255
297
|
*/
|
|
256
|
-
|
|
298
|
+
const writeGauge = (w, gauge) => {
|
|
299
|
+
for (const item of gauge.dataPoints) writeNumberDataPoint(w.tag(1, LEN).fork(), item).join();
|
|
300
|
+
return w;
|
|
301
|
+
};
|
|
257
302
|
/**
|
|
258
|
-
* Encodes a Sum message.
|
|
259
|
-
*
|
|
260
303
|
* message Sum {
|
|
261
304
|
* repeated NumberDataPoint data_points = 1;
|
|
262
305
|
* AggregationTemporality aggregation_temporality = 2;
|
|
263
306
|
* bool is_monotonic = 3;
|
|
264
307
|
* }
|
|
265
|
-
*
|
|
266
|
-
* @internal
|
|
267
308
|
*/
|
|
268
|
-
|
|
309
|
+
const writeSum = (w, sum) => {
|
|
310
|
+
for (const item of sum.dataPoints) writeNumberDataPoint(w.tag(1, LEN).fork(), item).join();
|
|
311
|
+
w.tag(2, VARINT).int32(sum.aggregationTemporality);
|
|
312
|
+
w.tag(3, VARINT).bool(sum.isMonotonic);
|
|
313
|
+
return w;
|
|
314
|
+
};
|
|
269
315
|
/**
|
|
270
|
-
* Encodes a Histogram message.
|
|
271
|
-
*
|
|
272
316
|
* message Histogram {
|
|
273
317
|
* repeated HistogramDataPoint data_points = 1;
|
|
274
318
|
* AggregationTemporality aggregation_temporality = 2;
|
|
275
319
|
* }
|
|
276
|
-
*
|
|
277
|
-
* @internal
|
|
278
320
|
*/
|
|
279
|
-
|
|
321
|
+
const writeHistogram = (w, histogram) => {
|
|
322
|
+
for (const item of histogram.dataPoints) writeHistogramDataPoint(w.tag(1, LEN).fork(), item).join();
|
|
323
|
+
w.tag(2, VARINT).int32(histogram.aggregationTemporality);
|
|
324
|
+
return w;
|
|
325
|
+
};
|
|
326
|
+
const writeValueAtQuantile = (w, q) => {
|
|
327
|
+
w.tag(1, I64).double(q.quantile);
|
|
328
|
+
w.tag(2, I64).double(q.value);
|
|
329
|
+
return w;
|
|
330
|
+
};
|
|
280
331
|
/**
|
|
281
|
-
* Encodes a SummaryDataPoint message.
|
|
282
|
-
*
|
|
283
332
|
* message SummaryDataPoint {
|
|
284
333
|
* repeated KeyValue attributes = 7;
|
|
285
334
|
* fixed64 start_time_unix_nano = 2;
|
|
@@ -294,23 +343,27 @@ export const encodeHistogram = histogram => Proto.concat(Proto.repeatedField(1,
|
|
|
294
343
|
* double quantile = 1;
|
|
295
344
|
* double value = 2;
|
|
296
345
|
* }
|
|
297
|
-
*
|
|
298
|
-
* @internal
|
|
299
346
|
*/
|
|
300
|
-
|
|
347
|
+
const writeSummaryDataPoint = (w, point) => {
|
|
348
|
+
if (point.startTimeUnixNano !== undefined) w.tag(2, I64).fixed64(point.startTimeUnixNano);
|
|
349
|
+
w.tag(3, I64).fixed64(point.timeUnixNano);
|
|
350
|
+
w.tag(4, I64).fixed64(point.count);
|
|
351
|
+
w.tag(5, I64).double(point.sum);
|
|
352
|
+
for (const item of point.quantileValues) writeValueAtQuantile(w.tag(6, LEN).fork(), item).join();
|
|
353
|
+
for (const item of point.attributes) writeKeyValue(w.tag(7, LEN).fork(), item).join();
|
|
354
|
+
if (point.flags !== undefined) w.tag(8, VARINT).uint32(point.flags);
|
|
355
|
+
return w;
|
|
356
|
+
};
|
|
301
357
|
/**
|
|
302
|
-
* Encodes a Summary message.
|
|
303
|
-
*
|
|
304
358
|
* message Summary {
|
|
305
359
|
* repeated SummaryDataPoint data_points = 1;
|
|
306
360
|
* }
|
|
307
|
-
*
|
|
308
|
-
* @internal
|
|
309
361
|
*/
|
|
310
|
-
|
|
362
|
+
const writeSummary = (w, summary) => {
|
|
363
|
+
for (const item of summary.dataPoints) writeSummaryDataPoint(w.tag(1, LEN).fork(), item).join();
|
|
364
|
+
return w;
|
|
365
|
+
};
|
|
311
366
|
/**
|
|
312
|
-
* Encodes a Metric message.
|
|
313
|
-
*
|
|
314
367
|
* message Metric {
|
|
315
368
|
* string name = 1;
|
|
316
369
|
* string description = 2;
|
|
@@ -323,34 +376,43 @@ export const encodeSummary = summary => Proto.repeatedField(1, summary.dataPoint
|
|
|
323
376
|
* Summary summary = 11;
|
|
324
377
|
* }
|
|
325
378
|
* }
|
|
326
|
-
*
|
|
327
|
-
* @internal
|
|
328
379
|
*/
|
|
329
|
-
|
|
380
|
+
const writeMetric = (w, metric) => {
|
|
381
|
+
w.tag(1, LEN).string(metric.name);
|
|
382
|
+
if (metric.description) w.tag(2, LEN).string(metric.description);
|
|
383
|
+
if (metric.unit) w.tag(3, LEN).string(metric.unit);
|
|
384
|
+
if (metric.gauge !== undefined) writeGauge(w.tag(5, LEN).fork(), metric.gauge).join();
|
|
385
|
+
if (metric.sum !== undefined) writeSum(w.tag(7, LEN).fork(), metric.sum).join();
|
|
386
|
+
if (metric.histogram !== undefined) writeHistogram(w.tag(9, LEN).fork(), metric.histogram).join();
|
|
387
|
+
if (metric.summary !== undefined) writeSummary(w.tag(11, LEN).fork(), metric.summary).join();
|
|
388
|
+
return w;
|
|
389
|
+
};
|
|
330
390
|
/**
|
|
331
|
-
* Encodes a ScopeMetrics message.
|
|
332
|
-
*
|
|
333
391
|
* message ScopeMetrics {
|
|
334
392
|
* InstrumentationScope scope = 1;
|
|
335
393
|
* repeated Metric metrics = 2;
|
|
336
394
|
* string schema_url = 3;
|
|
337
395
|
* }
|
|
338
|
-
*
|
|
339
|
-
* @internal
|
|
340
396
|
*/
|
|
341
|
-
|
|
397
|
+
const writeScopeMetrics = (w, scopeMetrics) => {
|
|
398
|
+
writeInstrumentationScope(w.tag(1, LEN).fork(), scopeMetrics.scope).join();
|
|
399
|
+
for (const item of scopeMetrics.metrics) writeMetric(w.tag(2, LEN).fork(), item).join();
|
|
400
|
+
if (scopeMetrics.schemaUrl) w.tag(3, LEN).string(scopeMetrics.schemaUrl);
|
|
401
|
+
return w;
|
|
402
|
+
};
|
|
342
403
|
/**
|
|
343
|
-
* Encodes a ResourceMetrics message.
|
|
344
|
-
*
|
|
345
404
|
* message ResourceMetrics {
|
|
346
405
|
* Resource resource = 1;
|
|
347
406
|
* repeated ScopeMetrics scope_metrics = 2;
|
|
348
407
|
* string schema_url = 3;
|
|
349
408
|
* }
|
|
350
|
-
*
|
|
351
|
-
* @internal
|
|
352
409
|
*/
|
|
353
|
-
|
|
410
|
+
const writeResourceMetrics = (w, resourceMetrics) => {
|
|
411
|
+
writeResource(w.tag(1, LEN).fork(), resourceMetrics.resource).join();
|
|
412
|
+
for (const item of resourceMetrics.scopeMetrics) writeScopeMetrics(w.tag(2, LEN).fork(), item).join();
|
|
413
|
+
if (resourceMetrics.schemaUrl) w.tag(3, LEN).string(resourceMetrics.schemaUrl);
|
|
414
|
+
return w;
|
|
415
|
+
};
|
|
354
416
|
/**
|
|
355
417
|
* Encodes a MetricsData message (top-level export request).
|
|
356
418
|
*
|
|
@@ -360,10 +422,12 @@ export const encodeResourceMetrics = resourceMetrics => Proto.concat(Proto.messa
|
|
|
360
422
|
*
|
|
361
423
|
* @internal
|
|
362
424
|
*/
|
|
363
|
-
export const encodeMetricsData = metricsData =>
|
|
425
|
+
export const encodeMetricsData = metricsData => {
|
|
426
|
+
const w = ProtobufWriter.make();
|
|
427
|
+
for (const item of metricsData.resourceMetrics) writeResourceMetrics(w.tag(1, LEN).fork(), item).join();
|
|
428
|
+
return w.finish();
|
|
429
|
+
};
|
|
364
430
|
/**
|
|
365
|
-
* Encodes a LogRecord message.
|
|
366
|
-
*
|
|
367
431
|
* message LogRecord {
|
|
368
432
|
* fixed64 time_unix_nano = 1;
|
|
369
433
|
* fixed64 observed_time_unix_nano = 11;
|
|
@@ -376,34 +440,48 @@ export const encodeMetricsData = metricsData => Proto.repeatedField(1, metricsDa
|
|
|
376
440
|
* bytes trace_id = 9;
|
|
377
441
|
* bytes span_id = 10;
|
|
378
442
|
* }
|
|
379
|
-
*
|
|
380
|
-
* @internal
|
|
381
443
|
*/
|
|
382
|
-
|
|
444
|
+
const writeLogRecord = (w, record) => {
|
|
445
|
+
w.tag(1, I64).fixed64(record.timeUnixNano);
|
|
446
|
+
if (record.severityNumber !== undefined) w.tag(2, VARINT).int32(record.severityNumber);
|
|
447
|
+
if (record.severityText) w.tag(3, LEN).string(record.severityText);
|
|
448
|
+
if (record.body !== undefined) writeAnyValue(w.tag(5, LEN).fork(), record.body).join();
|
|
449
|
+
for (const item of record.attributes) writeKeyValue(w.tag(6, LEN).fork(), item).join();
|
|
450
|
+
if (record.droppedAttributesCount !== undefined && record.droppedAttributesCount > 0) {
|
|
451
|
+
w.tag(7, VARINT).uint32(record.droppedAttributesCount);
|
|
452
|
+
}
|
|
453
|
+
if (record.flags !== undefined) w.tag(8, I32).fixed32(record.flags);
|
|
454
|
+
if (record.traceId) w.tag(9, LEN).bytes(idBytes(record.traceId));
|
|
455
|
+
if (record.spanId) w.tag(10, LEN).bytes(idBytes(record.spanId));
|
|
456
|
+
if (record.observedTimeUnixNano !== undefined) w.tag(11, I64).fixed64(record.observedTimeUnixNano);
|
|
457
|
+
return w;
|
|
458
|
+
};
|
|
383
459
|
/**
|
|
384
|
-
* Encodes a ScopeLogs message.
|
|
385
|
-
*
|
|
386
460
|
* message ScopeLogs {
|
|
387
461
|
* InstrumentationScope scope = 1;
|
|
388
462
|
* repeated LogRecord log_records = 2;
|
|
389
463
|
* string schema_url = 3;
|
|
390
464
|
* }
|
|
391
|
-
*
|
|
392
|
-
* @internal
|
|
393
465
|
*/
|
|
394
|
-
|
|
466
|
+
const writeScopeLogs = (w, scopeLogs) => {
|
|
467
|
+
writeInstrumentationScope(w.tag(1, LEN).fork(), scopeLogs.scope).join();
|
|
468
|
+
for (const item of scopeLogs.logRecords) writeLogRecord(w.tag(2, LEN).fork(), item).join();
|
|
469
|
+
if (scopeLogs.schemaUrl) w.tag(3, LEN).string(scopeLogs.schemaUrl);
|
|
470
|
+
return w;
|
|
471
|
+
};
|
|
395
472
|
/**
|
|
396
|
-
* Encodes a ResourceLogs message.
|
|
397
|
-
*
|
|
398
473
|
* message ResourceLogs {
|
|
399
474
|
* Resource resource = 1;
|
|
400
475
|
* repeated ScopeLogs scope_logs = 2;
|
|
401
476
|
* string schema_url = 3;
|
|
402
477
|
* }
|
|
403
|
-
*
|
|
404
|
-
* @internal
|
|
405
478
|
*/
|
|
406
|
-
|
|
479
|
+
const writeResourceLogs = (w, resourceLogs) => {
|
|
480
|
+
writeResource(w.tag(1, LEN).fork(), resourceLogs.resource).join();
|
|
481
|
+
for (const item of resourceLogs.scopeLogs) writeScopeLogs(w.tag(2, LEN).fork(), item).join();
|
|
482
|
+
if (resourceLogs.schemaUrl) w.tag(3, LEN).string(resourceLogs.schemaUrl);
|
|
483
|
+
return w;
|
|
484
|
+
};
|
|
407
485
|
/**
|
|
408
486
|
* Encodes a LogsData message (top-level export request).
|
|
409
487
|
*
|
|
@@ -413,5 +491,9 @@ export const encodeResourceLogs = resourceLogs => Proto.concat(Proto.messageFiel
|
|
|
413
491
|
*
|
|
414
492
|
* @internal
|
|
415
493
|
*/
|
|
416
|
-
export const encodeLogsData = logsData =>
|
|
494
|
+
export const encodeLogsData = logsData => {
|
|
495
|
+
const w = ProtobufWriter.make();
|
|
496
|
+
for (const item of logsData.resourceLogs) writeResourceLogs(w.tag(1, LEN).fork(), item).join();
|
|
497
|
+
return w.finish();
|
|
498
|
+
};
|
|
417
499
|
//# sourceMappingURL=otlpProtobuf.js.map
|