effect 4.1.4 → 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 +19 -64
- package/dist/SchemaRepresentation.d.ts.map +1 -1
- package/dist/SchemaRepresentation.js +1 -28
- 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/LanguageModel.d.ts.map +1 -1
- package/dist/ai/LanguageModel.js +1 -1
- package/dist/ai/LanguageModel.js.map +1 -1
- package/dist/ai/McpSchema.d.ts +88 -88
- package/dist/ai/McpSchema.d.ts.map +1 -1
- package/dist/ai/McpServer.d.ts +47 -2
- package/dist/ai/McpServer.d.ts.map +1 -1
- package/dist/ai/McpServer.js +135 -16
- 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/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 +4 -0
- 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/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 +15 -8
- 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 +1 -0
- package/dist/http/internal/requestState.js.map +1 -1
- package/dist/http-api/HttpApi.d.ts +13 -2
- package/dist/http-api/HttpApi.d.ts.map +1 -1
- package/dist/http-api/HttpApi.js +16 -2
- 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 +3 -2
- package/dist/http-api/HttpApiBuilder.js.map +1 -1
- package/dist/http-api/HttpApiClient.d.ts.map +1 -1
- package/dist/http-api/HttpApiClient.js +6 -6
- 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.map +1 -1
- package/dist/http-api/HttpApiSchema.js +1 -1
- 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/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/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 +19 -74
- 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/LanguageModel.ts +2 -1
- package/src/ai/McpServer.ts +145 -22
- package/src/ai/Tool.ts +3 -2
- package/src/ai/Toolkit.ts +3 -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 +20 -2
- package/src/cli/Prompt.ts +15 -9
- package/src/cli/internal/config.ts +8 -8
- 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 +22 -9
- 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 +2 -0
- package/src/http-api/HttpApi.ts +25 -2
- package/src/http-api/HttpApiBuilder.ts +5 -2
- package/src/http-api/HttpApiClient.ts +10 -6
- package/src/http-api/HttpApiEndpoint.ts +1 -1
- package/src/http-api/HttpApiScalar.ts +9 -1
- package/src/http-api/HttpApiSchema.ts +1 -1
- 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/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/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 -447
- 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 -578
- package/src/observability/internal/protobuf.ts +0 -225
- /package/dist/{http-api → http}/internal/mediaType.d.ts +0 -0
|
@@ -1,447 +0,0 @@
|
|
|
1
|
-
import * as Arr from "../../Array.js";
|
|
2
|
-
import { format, formatPropertyKey } from "../../Formatter.js";
|
|
3
|
-
import { errorWithPath } from "../errors.js";
|
|
4
|
-
import * as InternalRecord from "../record.js";
|
|
5
|
-
import * as InternalAnnotations from "./annotations.js";
|
|
6
|
-
/** @internal */
|
|
7
|
-
export function makeCode(runtime, Type) {
|
|
8
|
-
return {
|
|
9
|
-
runtime,
|
|
10
|
-
Type
|
|
11
|
-
};
|
|
12
|
-
}
|
|
13
|
-
function formatObjectLiteralKey(key, formatted = formatPropertyKey(key)) {
|
|
14
|
-
return key === "__proto__" ? `[${formatted}]` : formatted;
|
|
15
|
-
}
|
|
16
|
-
function renderEmittableAnnotation(input) {
|
|
17
|
-
if (input === null || typeof input === "string" || typeof input === "boolean" || typeof input === "number" || typeof input === "bigint") return format(input);
|
|
18
|
-
if (typeof input === "symbol") {
|
|
19
|
-
const key = globalThis.Symbol.keyFor(input);
|
|
20
|
-
return key === undefined ? undefined : `globalThis.Symbol.for(${format(key)})`;
|
|
21
|
-
}
|
|
22
|
-
if (typeof input !== "object") return undefined;
|
|
23
|
-
if (Array.isArray(input)) {
|
|
24
|
-
const values = [];
|
|
25
|
-
for (const value of input) {
|
|
26
|
-
const rendered = renderEmittableAnnotation(value);
|
|
27
|
-
if (rendered === undefined) return undefined;
|
|
28
|
-
values.push(rendered);
|
|
29
|
-
}
|
|
30
|
-
return `[${values.join(", ")}]`;
|
|
31
|
-
}
|
|
32
|
-
const prototype = Object.getPrototypeOf(input);
|
|
33
|
-
// Plain objects from other realms also have a prototype whose prototype is null.
|
|
34
|
-
if (prototype !== null && prototype !== Object.prototype && Object.getPrototypeOf(prototype) !== null) return undefined;
|
|
35
|
-
const entries = [];
|
|
36
|
-
for (const [key, value] of Object.entries(input)) {
|
|
37
|
-
const rendered = renderEmittableAnnotation(value);
|
|
38
|
-
if (rendered === undefined) return undefined;
|
|
39
|
-
entries.push(`${formatObjectLiteralKey(key)}: ${rendered}`);
|
|
40
|
-
}
|
|
41
|
-
return entries.length === 0 ? "{}" : `{ ${entries.join(", ")} }`;
|
|
42
|
-
}
|
|
43
|
-
// Leading checks that turn a bare `Schema.Number` into a built-in schema.
|
|
44
|
-
const canonicalNumberChecks = {
|
|
45
|
-
[`Schema.isFinite().annotate({ "expected": "a finite number" })`]: "Schema.Finite",
|
|
46
|
-
["Schema.isInt()"]: "Schema.Int",
|
|
47
|
-
[`Schema.isInt().annotate({ "expected": "an integer" })`]: "Schema.Int"
|
|
48
|
-
};
|
|
49
|
-
function renderAnnotations(annotations) {
|
|
50
|
-
if (annotations === undefined) return undefined;
|
|
51
|
-
const entries = [];
|
|
52
|
-
for (const [key, value] of Object.entries(annotations)) {
|
|
53
|
-
if (InternalAnnotations.annotationExcludedKeys.has(key)) continue;
|
|
54
|
-
const rendered = renderEmittableAnnotation(value);
|
|
55
|
-
if (rendered !== undefined) entries.push(`${formatObjectLiteralKey(key)}: ${rendered}`);
|
|
56
|
-
}
|
|
57
|
-
return entries.length === 0 ? undefined : `{ ${entries.join(", ")} }`;
|
|
58
|
-
}
|
|
59
|
-
/** @internal */
|
|
60
|
-
export function sanitizeJavaScriptIdentifier(input) {
|
|
61
|
-
if (input.length === 0) return "_";
|
|
62
|
-
const out = input.replace(/[^A-Za-z0-9_$]/gu, "_");
|
|
63
|
-
const first = out[0];
|
|
64
|
-
return first >= "a" && first <= "z" ? first.toUpperCase() + out.slice(1) : first >= "0" && first <= "9" ? `_${out}` : out;
|
|
65
|
-
}
|
|
66
|
-
function isSimpleLiveLiteral(representation) {
|
|
67
|
-
return representation._tag === "Literal" && representation.checks.length === 0 && representation.annotations === undefined;
|
|
68
|
-
}
|
|
69
|
-
/** @internal */
|
|
70
|
-
export function topologicalSort(references) {
|
|
71
|
-
const identifiers = Object.keys(references);
|
|
72
|
-
const identifierSet = new Set(identifiers);
|
|
73
|
-
function collectRefs(root) {
|
|
74
|
-
const refs = new Set();
|
|
75
|
-
const visited = new WeakSet();
|
|
76
|
-
const stack = [root];
|
|
77
|
-
function pushRepresentationSchemas(representation) {
|
|
78
|
-
if (representation?.schemas !== undefined) stack.push(...representation.schemas);
|
|
79
|
-
}
|
|
80
|
-
function pushChecks(checks) {
|
|
81
|
-
for (const check of checks) {
|
|
82
|
-
pushRepresentationSchemas(check.representation);
|
|
83
|
-
if (check._tag === "FilterGroup") pushChecks(check.checks);
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
while (stack.length > 0) {
|
|
87
|
-
const representation = stack.pop();
|
|
88
|
-
if (visited.has(representation)) continue;
|
|
89
|
-
visited.add(representation);
|
|
90
|
-
if (representation._tag === "Reference") {
|
|
91
|
-
if (identifierSet.has(representation.$ref)) refs.add(representation.$ref);
|
|
92
|
-
continue;
|
|
93
|
-
}
|
|
94
|
-
pushChecks(representation.checks);
|
|
95
|
-
switch (representation._tag) {
|
|
96
|
-
case "Declaration":
|
|
97
|
-
pushRepresentationSchemas(representation.representation);
|
|
98
|
-
stack.push(...representation.typeParameters);
|
|
99
|
-
break;
|
|
100
|
-
case "Suspend":
|
|
101
|
-
stack.push(representation.thunk);
|
|
102
|
-
break;
|
|
103
|
-
case "TemplateLiteral":
|
|
104
|
-
stack.push(...representation.parts);
|
|
105
|
-
break;
|
|
106
|
-
case "Arrays":
|
|
107
|
-
for (const element of representation.elements) stack.push(element.type);
|
|
108
|
-
stack.push(...representation.rest);
|
|
109
|
-
break;
|
|
110
|
-
case "Objects":
|
|
111
|
-
for (const property of representation.propertySignatures) stack.push(property.type);
|
|
112
|
-
for (const signature of representation.indexSignatures) {
|
|
113
|
-
stack.push(signature.parameter, signature.type);
|
|
114
|
-
}
|
|
115
|
-
break;
|
|
116
|
-
case "Union":
|
|
117
|
-
stack.push(...representation.types);
|
|
118
|
-
break;
|
|
119
|
-
}
|
|
120
|
-
}
|
|
121
|
-
return refs;
|
|
122
|
-
}
|
|
123
|
-
const dependencies = new Map(identifiers.map(identifier => [identifier, collectRefs(references[identifier])]));
|
|
124
|
-
const recursive = new Set();
|
|
125
|
-
const state = new Map();
|
|
126
|
-
const stack = [];
|
|
127
|
-
function visit(identifier) {
|
|
128
|
-
const current = state.get(identifier) ?? 0;
|
|
129
|
-
if (current === 1) {
|
|
130
|
-
const start = stack.indexOf(identifier);
|
|
131
|
-
for (let index = start; index < stack.length; index++) recursive.add(stack[index]);
|
|
132
|
-
return;
|
|
133
|
-
}
|
|
134
|
-
if (current === 2) return;
|
|
135
|
-
state.set(identifier, 1);
|
|
136
|
-
stack.push(identifier);
|
|
137
|
-
for (const dependency of dependencies.get(identifier)) visit(dependency);
|
|
138
|
-
stack.pop();
|
|
139
|
-
state.set(identifier, 2);
|
|
140
|
-
}
|
|
141
|
-
for (const identifier of identifiers) visit(identifier);
|
|
142
|
-
const inDegree = new Map();
|
|
143
|
-
const dependents = new Map();
|
|
144
|
-
for (const identifier of identifiers) {
|
|
145
|
-
if (!recursive.has(identifier)) {
|
|
146
|
-
inDegree.set(identifier, 0);
|
|
147
|
-
dependents.set(identifier, new Set());
|
|
148
|
-
}
|
|
149
|
-
}
|
|
150
|
-
for (const [identifier, internalDependencies] of dependencies) {
|
|
151
|
-
if (recursive.has(identifier)) continue;
|
|
152
|
-
for (const dependency of internalDependencies) {
|
|
153
|
-
if (recursive.has(dependency)) continue;
|
|
154
|
-
inDegree.set(identifier, inDegree.get(identifier) + 1);
|
|
155
|
-
dependents.get(dependency).add(identifier);
|
|
156
|
-
}
|
|
157
|
-
}
|
|
158
|
-
const queue = [];
|
|
159
|
-
for (const [identifier, degree] of inDegree) {
|
|
160
|
-
if (degree === 0) queue.push(identifier);
|
|
161
|
-
}
|
|
162
|
-
const nonRecursives = [];
|
|
163
|
-
for (let index = 0; index < queue.length; index++) {
|
|
164
|
-
const $ref = queue[index];
|
|
165
|
-
nonRecursives.push({
|
|
166
|
-
$ref,
|
|
167
|
-
representation: references[$ref]
|
|
168
|
-
});
|
|
169
|
-
for (const dependent of dependents.get($ref)) {
|
|
170
|
-
const degree = inDegree.get(dependent) - 1;
|
|
171
|
-
inDegree.set(dependent, degree);
|
|
172
|
-
if (degree === 0) queue.push(dependent);
|
|
173
|
-
}
|
|
174
|
-
}
|
|
175
|
-
const recursives = {};
|
|
176
|
-
for (const identifier of recursive) InternalRecord.assignProperty(recursives, identifier, references[identifier]);
|
|
177
|
-
return {
|
|
178
|
-
nonRecursives,
|
|
179
|
-
recursives
|
|
180
|
-
};
|
|
181
|
-
}
|
|
182
|
-
/** @internal */
|
|
183
|
-
export function toCodeDocument(document) {
|
|
184
|
-
const artifacts = [];
|
|
185
|
-
const sorted = topologicalSort(document.references);
|
|
186
|
-
const sanitizedReferences = new Map();
|
|
187
|
-
const uniqueIdentifiers = new Set(["Schema"]);
|
|
188
|
-
let compilingRecursiveDefinition = false;
|
|
189
|
-
let explicitSuspendDepth = 0;
|
|
190
|
-
for (const {
|
|
191
|
-
$ref
|
|
192
|
-
} of sorted.nonRecursives) ensureUniqueIdentifier($ref);
|
|
193
|
-
for (const $ref of Object.keys(sorted.recursives)) ensureUniqueIdentifier($ref);
|
|
194
|
-
const nonRecursives = sorted.nonRecursives.map(({
|
|
195
|
-
$ref,
|
|
196
|
-
representation
|
|
197
|
-
}) => ({
|
|
198
|
-
$ref: ensureUniqueIdentifier($ref),
|
|
199
|
-
code: recur(representation, ["references", $ref])
|
|
200
|
-
}));
|
|
201
|
-
const recursives = {};
|
|
202
|
-
for (const [$ref, representation] of Object.entries(sorted.recursives)) {
|
|
203
|
-
compilingRecursiveDefinition = true;
|
|
204
|
-
InternalRecord.assignProperty(recursives, ensureUniqueIdentifier($ref), recur(representation, ["references", $ref]));
|
|
205
|
-
compilingRecursiveDefinition = false;
|
|
206
|
-
}
|
|
207
|
-
const codes = document.representations.map((representation, index) => recur(representation, ["representations", index]));
|
|
208
|
-
return {
|
|
209
|
-
codes,
|
|
210
|
-
references: {
|
|
211
|
-
nonRecursives,
|
|
212
|
-
recursives
|
|
213
|
-
},
|
|
214
|
-
artifacts
|
|
215
|
-
};
|
|
216
|
-
function ensureUniqueIdentifier(original) {
|
|
217
|
-
const existing = sanitizedReferences.get(original);
|
|
218
|
-
if (existing !== undefined) return existing;
|
|
219
|
-
const candidate = freshIdentifier(original);
|
|
220
|
-
sanitizedReferences.set(original, candidate);
|
|
221
|
-
return candidate;
|
|
222
|
-
}
|
|
223
|
-
function freshIdentifier(seed) {
|
|
224
|
-
const sanitized = sanitizeJavaScriptIdentifier(seed);
|
|
225
|
-
let candidate = sanitized;
|
|
226
|
-
let suffix = 0;
|
|
227
|
-
while (uniqueIdentifiers.has(candidate)) candidate = `${sanitized}${++suffix}`;
|
|
228
|
-
uniqueIdentifiers.add(candidate);
|
|
229
|
-
return candidate;
|
|
230
|
-
}
|
|
231
|
-
function addImport(importDeclaration) {
|
|
232
|
-
if (!artifacts.some(artifact => artifact._tag === "Import" && artifact.importDeclaration === importDeclaration)) {
|
|
233
|
-
artifacts.push({
|
|
234
|
-
_tag: "Import",
|
|
235
|
-
importDeclaration
|
|
236
|
-
});
|
|
237
|
-
}
|
|
238
|
-
}
|
|
239
|
-
function addSymbol(symbol) {
|
|
240
|
-
const identifier = freshIdentifier("_symbol");
|
|
241
|
-
const key = globalThis.Symbol.keyFor(symbol);
|
|
242
|
-
const description = symbol.description;
|
|
243
|
-
artifacts.push({
|
|
244
|
-
_tag: "Symbol",
|
|
245
|
-
identifier,
|
|
246
|
-
code: makeCode(key === undefined ? `globalThis.Symbol(${description === undefined ? "" : format(description)})` : `globalThis.Symbol.for(${format(key)})`, `typeof ${identifier}`)
|
|
247
|
-
});
|
|
248
|
-
return identifier;
|
|
249
|
-
}
|
|
250
|
-
function annotationSchemas(representation, path) {
|
|
251
|
-
return representation?.schemas?.map((schema, index) => recur(schema, [...path, "schemas", index])) ?? [];
|
|
252
|
-
}
|
|
253
|
-
function runtimeAnnotate(annotations, method = "annotate") {
|
|
254
|
-
const rendered = renderAnnotations(annotations);
|
|
255
|
-
return rendered === undefined ? "" : `.${method}(${rendered})`;
|
|
256
|
-
}
|
|
257
|
-
function unionOptionsRuntime(options) {
|
|
258
|
-
if (!Object.hasOwn(options, "mode")) return "{}";
|
|
259
|
-
return `{ mode: ${options.mode === undefined ? "undefined" : format(options.mode)} }`;
|
|
260
|
-
}
|
|
261
|
-
function compileCheck(check, path) {
|
|
262
|
-
const callback = check.annotations?.toCode;
|
|
263
|
-
let runtime;
|
|
264
|
-
if (callback !== undefined) {
|
|
265
|
-
const schemas = annotationSchemas(check.representation, [...path, "representation"]);
|
|
266
|
-
const output = callback({
|
|
267
|
-
schemas
|
|
268
|
-
});
|
|
269
|
-
for (const importDeclaration of output.importDeclarations ?? []) addImport(importDeclaration);
|
|
270
|
-
runtime = output.runtime;
|
|
271
|
-
} else if (check._tag === "Filter") {
|
|
272
|
-
throw errorWithPath("Missing toCode callback", [...path, "annotations", "toCode"]);
|
|
273
|
-
} else {
|
|
274
|
-
runtime = `Schema.makeFilterGroup([${check.checks.map((child, index) => compileCheck(child, [...path, "checks", index])).join(", ")}])`;
|
|
275
|
-
}
|
|
276
|
-
runtime += runtimeAnnotate(check.annotations);
|
|
277
|
-
if (check._tag === "Filter" && check.aborted) runtime += ".abort()";
|
|
278
|
-
return runtime;
|
|
279
|
-
}
|
|
280
|
-
function applyNode(base, representation, path) {
|
|
281
|
-
let runtime = base.runtime + runtimeAnnotate(representation.annotations);
|
|
282
|
-
for (let index = 0; index < representation.checks.length; index++) {
|
|
283
|
-
const check = representation.checks[index];
|
|
284
|
-
const compiledCheck = compileCheck(check, [...path, "checks", index]);
|
|
285
|
-
// Only collapse a bare number's leading canonical check.
|
|
286
|
-
runtime = runtime === "Schema.Number" && Object.hasOwn(canonicalNumberChecks, compiledCheck) ? canonicalNumberChecks[compiledCheck] : `${runtime}.check(${compiledCheck})`;
|
|
287
|
-
}
|
|
288
|
-
return makeCode(runtime, base.Type);
|
|
289
|
-
}
|
|
290
|
-
function recur(representation, path) {
|
|
291
|
-
if (representation._tag === "Reference") {
|
|
292
|
-
if (!Object.hasOwn(document.references, representation.$ref)) {
|
|
293
|
-
throw errorWithPath(`Invalid reference ${representation.$ref}`, [...path, "$ref"]);
|
|
294
|
-
}
|
|
295
|
-
const identifier = ensureUniqueIdentifier(representation.$ref);
|
|
296
|
-
if (compilingRecursiveDefinition && explicitSuspendDepth === 0 && Object.hasOwn(sorted.recursives, representation.$ref)) {
|
|
297
|
-
return makeCode(`Schema.suspend((): Schema.Codec<${identifier}> => ${identifier})`, identifier);
|
|
298
|
-
}
|
|
299
|
-
return makeCode(identifier, identifier);
|
|
300
|
-
}
|
|
301
|
-
return applyNode(on(representation, path), representation, path);
|
|
302
|
-
}
|
|
303
|
-
function on(representation, path) {
|
|
304
|
-
switch (representation._tag) {
|
|
305
|
-
case "Declaration":
|
|
306
|
-
{
|
|
307
|
-
const callback = representation.annotations?.toCode;
|
|
308
|
-
if (callback === undefined) {
|
|
309
|
-
throw errorWithPath("Missing toCode callback", [...path, "annotations", "toCode"]);
|
|
310
|
-
}
|
|
311
|
-
const typeParameters = representation.typeParameters.map((typeParameter, index) => recur(typeParameter, [...path, "typeParameters", index]));
|
|
312
|
-
const output = callback({
|
|
313
|
-
typeParameters
|
|
314
|
-
});
|
|
315
|
-
for (const importDeclaration of output.importDeclarations ?? []) addImport(importDeclaration);
|
|
316
|
-
return makeCode(output.runtime, output.Type);
|
|
317
|
-
}
|
|
318
|
-
case "Suspend":
|
|
319
|
-
{
|
|
320
|
-
explicitSuspendDepth++;
|
|
321
|
-
const thunk = recur(representation.thunk, [...path, "thunk"]);
|
|
322
|
-
explicitSuspendDepth--;
|
|
323
|
-
return makeCode(`Schema.suspend((): Schema.Codec<${thunk.Type}> => ${thunk.runtime})`, thunk.Type);
|
|
324
|
-
}
|
|
325
|
-
case "Null":
|
|
326
|
-
return makeCode("Schema.Null", "null");
|
|
327
|
-
case "Undefined":
|
|
328
|
-
return makeCode("Schema.Undefined", "undefined");
|
|
329
|
-
case "Void":
|
|
330
|
-
return makeCode("Schema.Void", "void");
|
|
331
|
-
case "Never":
|
|
332
|
-
return makeCode("Schema.Never", "never");
|
|
333
|
-
case "Unknown":
|
|
334
|
-
return makeCode("Schema.Unknown", "unknown");
|
|
335
|
-
case "Any":
|
|
336
|
-
return makeCode("Schema.Any", "any");
|
|
337
|
-
case "String":
|
|
338
|
-
return makeCode("Schema.String", "string");
|
|
339
|
-
case "Number":
|
|
340
|
-
return makeCode("Schema.Number", "number");
|
|
341
|
-
case "Boolean":
|
|
342
|
-
return makeCode("Schema.Boolean", "boolean");
|
|
343
|
-
case "BigInt":
|
|
344
|
-
return makeCode("Schema.BigInt", "bigint");
|
|
345
|
-
case "Symbol":
|
|
346
|
-
return makeCode("Schema.Symbol", "symbol");
|
|
347
|
-
case "Literal":
|
|
348
|
-
{
|
|
349
|
-
const literal = format(representation.literal);
|
|
350
|
-
return makeCode(`Schema.Literal(${literal})`, literal);
|
|
351
|
-
}
|
|
352
|
-
case "UniqueSymbol":
|
|
353
|
-
{
|
|
354
|
-
const identifier = addSymbol(representation.symbol);
|
|
355
|
-
return makeCode(`Schema.UniqueSymbol(${identifier})`, `typeof ${identifier}`);
|
|
356
|
-
}
|
|
357
|
-
case "ObjectKeyword":
|
|
358
|
-
return makeCode("Schema.ObjectKeyword", "object");
|
|
359
|
-
case "Enum":
|
|
360
|
-
{
|
|
361
|
-
const identifier = freshIdentifier("_Enum");
|
|
362
|
-
artifacts.push({
|
|
363
|
-
_tag: "Enum",
|
|
364
|
-
identifier,
|
|
365
|
-
code: makeCode(`enum ${identifier} { ${representation.enums.map(([name, value]) => `${format(name)} = ${format(value)}`).join(", ")} }`, `typeof ${identifier}`)
|
|
366
|
-
});
|
|
367
|
-
return makeCode(`Schema.Enum(${identifier})`, identifier);
|
|
368
|
-
}
|
|
369
|
-
case "TemplateLiteral":
|
|
370
|
-
{
|
|
371
|
-
const parts = representation.parts.map((part, index) => recur(part, [...path, "parts", index]));
|
|
372
|
-
const Type = `\`${parts.map(part => `\${${part.Type}}`).join("")}\``;
|
|
373
|
-
return makeCode(`Schema.TemplateLiteral([${parts.map(part => part.runtime).join(", ")}])`, Type);
|
|
374
|
-
}
|
|
375
|
-
case "Arrays":
|
|
376
|
-
{
|
|
377
|
-
const elements = representation.elements.map((element, index) => {
|
|
378
|
-
const type = recur(element.type, [...path, "elements", index, "type"]);
|
|
379
|
-
return makeCode(`${element.isOptional ? "Schema.optionalKey(" : ""}${type.runtime}${element.isOptional ? ")" : ""}${runtimeAnnotate(element.annotations, "annotateKey")}`, element.isOptional ? `(${type.Type})?` : type.Type);
|
|
380
|
-
});
|
|
381
|
-
const rest = representation.rest.map((item, index) => recur(item, [...path, "rest", index]));
|
|
382
|
-
let code;
|
|
383
|
-
if (Arr.isArrayNonEmpty(rest)) {
|
|
384
|
-
const item = rest[0];
|
|
385
|
-
if (elements.length === 0 && rest.length === 1) {
|
|
386
|
-
code = makeCode(`Schema.Array(${item.runtime})`, `ReadonlyArray<${item.Type}>`);
|
|
387
|
-
} else {
|
|
388
|
-
const post = rest.slice(1);
|
|
389
|
-
code = makeCode(`Schema.TupleWithRest(Schema.Tuple([${elements.map(element => element.runtime).join(", ")}]), [${rest.map(item => item.runtime).join(", ")}])`, `readonly [${elements.map(element => element.Type).join(", ")}, ...Array<${item.Type}>${post.length > 0 ? `, ${post.map(item => item.Type).join(", ")}` : ""}]`);
|
|
390
|
-
}
|
|
391
|
-
} else {
|
|
392
|
-
code = makeCode(`Schema.Tuple([${elements.map(element => element.runtime).join(", ")}])`, `readonly [${elements.map(element => element.Type).join(", ")}]`);
|
|
393
|
-
}
|
|
394
|
-
return code;
|
|
395
|
-
}
|
|
396
|
-
case "Objects":
|
|
397
|
-
{
|
|
398
|
-
const properties = representation.propertySignatures.map((property, index) => {
|
|
399
|
-
const isSymbol = typeof property.name === "symbol";
|
|
400
|
-
const name = isSymbol ? `[${addSymbol(property.name)}]` : formatPropertyKey(property.name);
|
|
401
|
-
const type = recur(property.type, [...path, "propertySignatures", index, "type"]);
|
|
402
|
-
let runtime = type.runtime;
|
|
403
|
-
if (property.isMutable) runtime = `Schema.mutableKey(${runtime})`;
|
|
404
|
-
if (property.isOptional) runtime = `Schema.optionalKey(${runtime})`;
|
|
405
|
-
runtime += runtimeAnnotate(property.annotations, "annotateKey");
|
|
406
|
-
const runtimeName = formatObjectLiteralKey(property.name, name);
|
|
407
|
-
const typeName = `${property.isMutable ? "" : "readonly "}${name}${property.isOptional ? "?" : ""}`;
|
|
408
|
-
return {
|
|
409
|
-
code: makeCode(`${runtimeName}: ${runtime}`, `${typeName}: ${type.Type}`)
|
|
410
|
-
};
|
|
411
|
-
});
|
|
412
|
-
const indexSignatures = representation.indexSignatures.map((signature, index) => ({
|
|
413
|
-
parameter: recur(signature.parameter, [...path, "indexSignatures", index, "parameter"]),
|
|
414
|
-
type: recur(signature.type, [...path, "indexSignatures", index, "type"])
|
|
415
|
-
}));
|
|
416
|
-
const propertyRuntimes = properties.map(property => property.code.runtime).join(", ");
|
|
417
|
-
const propertyTypes = properties.map(property => property.code.Type).join(", ");
|
|
418
|
-
let code;
|
|
419
|
-
if (indexSignatures.length === 0) {
|
|
420
|
-
code = makeCode(`Schema.Struct({ ${propertyRuntimes} })`, `{ ${propertyTypes} }`);
|
|
421
|
-
} else if (properties.length === 0 && indexSignatures.length === 1) {
|
|
422
|
-
const signature = indexSignatures[0];
|
|
423
|
-
code = makeCode(`Schema.Record(${signature.parameter.runtime}, ${signature.type.runtime})`, `{ readonly [x: ${signature.parameter.Type}]: ${signature.type.Type} }`);
|
|
424
|
-
} else {
|
|
425
|
-
const indexRuntimes = indexSignatures.map(signature => `Schema.Record(${signature.parameter.runtime}, ${signature.type.runtime})`).join(", ");
|
|
426
|
-
const indexTypes = indexSignatures.map(signature => `readonly [x: ${signature.parameter.Type}]: ${signature.type.Type}`);
|
|
427
|
-
code = properties.length === 0 ? makeCode(`Schema.StructWithRest(Schema.Struct({ ${propertyRuntimes} }), [${indexRuntimes}])`, `{ ${indexTypes.join(", ")} }`) : makeCode(`Schema.StructWithRest(Schema.Struct({ ${propertyRuntimes} }), [${indexRuntimes}])`, [`{ ${propertyTypes} }`, ...indexTypes.map(indexType => `{ ${indexType} }`)].join(" & "));
|
|
428
|
-
}
|
|
429
|
-
return code;
|
|
430
|
-
}
|
|
431
|
-
case "Union":
|
|
432
|
-
{
|
|
433
|
-
if (representation.options === undefined && representation.types.length === 0) {
|
|
434
|
-
return makeCode("Schema.Never", "never");
|
|
435
|
-
}
|
|
436
|
-
if (representation.options === undefined && representation.types.every(isSimpleLiveLiteral)) {
|
|
437
|
-
const literals = representation.types.map(literal => format(literal.literal));
|
|
438
|
-
return literals.length === 1 ? makeCode(`Schema.Literal(${literals[0]})`, literals[0]) : makeCode(`Schema.Literals([${literals.join(", ")}])`, literals.join(" | "));
|
|
439
|
-
}
|
|
440
|
-
const types = representation.types.map((type, index) => recur(type, [...path, "types", index]));
|
|
441
|
-
const options = representation.options === undefined ? "" : `, ${unionOptionsRuntime(representation.options)}`;
|
|
442
|
-
return makeCode(`Schema.Union([${types.map(type => type.runtime).join(", ")}]${options})`, types.length === 0 ? "never" : types.map(type => type.Type).join(" | "));
|
|
443
|
-
}
|
|
444
|
-
}
|
|
445
|
-
}
|
|
446
|
-
}
|
|
447
|
-
//# sourceMappingURL=toCodeDocument.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"toCodeDocument.js","names":[],"sources":["../../../src/internal/schema/toCodeDocument.ts"],"sourcesContent":[null],"mappings":"AAAA,OAAO,KAAK,GAAG,MAAM,gBAAgB;AACrC,SAAS,MAAM,EAAE,iBAAiB,QAAQ,oBAAoB;AAG9D,SAAS,aAAa,QAAQ,cAAc;AAC5C,OAAO,KAAK,cAAc,MAAM,cAAc;AAC9C,OAAO,KAAK,mBAAmB,MAAM,kBAAkB;AAOvD;AACA,OAAM,SAAU,QAAQ,CAAC,OAAe,EAAE,IAAY;EACpD,OAAO;IAAE,OAAO;IAAE;EAAI,CAAE;AAC1B;AAEA,SAAS,sBAAsB,CAAC,GAAgB,EAAE,SAAS,GAAG,iBAAiB,CAAC,GAAG,CAAC;EAClF,OAAO,GAAG,KAAK,WAAW,GAAG,IAAI,SAAS,GAAG,GAAG,SAAS;AAC3D;AAEA,SAAS,yBAAyB,CAAC,K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IAAI,IAAK,IAAI,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,OAAO,GAAG,EAC3E,KAAK,CAAC,MAAM,KAAK,CAAC,GAAG,OAAO,GAAG,KAAK,CAAC,GAAG,CAAE,IAAI,IAAK,IAAI,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAC1E;QACH;IACF;EACF;AACF","ignoreList":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"protobuf.d.ts","sourceRoot":"","sources":["../../../src/observability/internal/protobuf.ts"],"names":[],"mappings":""}
|
|
@@ -1,169 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Low-level protobuf wire format encoding utilities.
|
|
3
|
-
*
|
|
4
|
-
* Protobuf wire types:
|
|
5
|
-
* - 0: Varint (int32, int64, uint32, uint64, sint32, sint64, bool, enum)
|
|
6
|
-
* - 1: 64-bit (fixed64, sfixed64, double)
|
|
7
|
-
* - 2: Length-delimited (string, bytes, embedded messages, packed repeated fields)
|
|
8
|
-
* - 5: 32-bit (fixed32, sfixed32, float)
|
|
9
|
-
*/
|
|
10
|
-
import * as Bytes from "../../Bytes.js";
|
|
11
|
-
const WireType = {
|
|
12
|
-
Varint: 0,
|
|
13
|
-
Fixed64: 1,
|
|
14
|
-
LengthDelimited: 2,
|
|
15
|
-
Fixed32: 5
|
|
16
|
-
};
|
|
17
|
-
/**
|
|
18
|
-
* Encodes a field tag (field number + wire type)
|
|
19
|
-
*/
|
|
20
|
-
const encodeTag = (fieldNumber, wireType) => fieldNumber << 3 | wireType;
|
|
21
|
-
/**
|
|
22
|
-
* Encodes a varint (variable-length integer)
|
|
23
|
-
*
|
|
24
|
-
* @internal
|
|
25
|
-
*/
|
|
26
|
-
export const encodeVarint = value => {
|
|
27
|
-
const bytes = [];
|
|
28
|
-
let n = typeof value === "bigint" ? value : BigInt(value);
|
|
29
|
-
if (n < BigInt(0)) {
|
|
30
|
-
n = BigInt.asUintN(64, n);
|
|
31
|
-
}
|
|
32
|
-
while (n > BigInt(127)) {
|
|
33
|
-
bytes.push(Number(n & BigInt(127)) | 0x80);
|
|
34
|
-
n >>= BigInt(7);
|
|
35
|
-
}
|
|
36
|
-
bytes.push(Number(n));
|
|
37
|
-
return new Uint8Array(bytes);
|
|
38
|
-
};
|
|
39
|
-
/**
|
|
40
|
-
* Encodes a 64-bit fixed value (little-endian)
|
|
41
|
-
*
|
|
42
|
-
* @internal
|
|
43
|
-
*/
|
|
44
|
-
export const encodeFixed64 = value => {
|
|
45
|
-
const bytes = new Uint8Array(8);
|
|
46
|
-
const view = new DataView(bytes.buffer);
|
|
47
|
-
view.setBigUint64(0, value, true);
|
|
48
|
-
return bytes;
|
|
49
|
-
};
|
|
50
|
-
/**
|
|
51
|
-
* Encodes a 32-bit fixed value (little-endian)
|
|
52
|
-
*
|
|
53
|
-
* @internal
|
|
54
|
-
*/
|
|
55
|
-
export const encodeFixed32 = value => {
|
|
56
|
-
const bytes = new Uint8Array(4);
|
|
57
|
-
const view = new DataView(bytes.buffer);
|
|
58
|
-
view.setUint32(0, value, true);
|
|
59
|
-
return bytes;
|
|
60
|
-
};
|
|
61
|
-
/**
|
|
62
|
-
* Encodes a double (64-bit float, little-endian)
|
|
63
|
-
*
|
|
64
|
-
* @internal
|
|
65
|
-
*/
|
|
66
|
-
export const encodeDouble = value => {
|
|
67
|
-
const bytes = new Uint8Array(8);
|
|
68
|
-
const view = new DataView(bytes.buffer);
|
|
69
|
-
view.setFloat64(0, value, true);
|
|
70
|
-
return bytes;
|
|
71
|
-
};
|
|
72
|
-
/**
|
|
73
|
-
* Encodes a string to UTF-8 bytes
|
|
74
|
-
*
|
|
75
|
-
* @internal
|
|
76
|
-
*/
|
|
77
|
-
export const encodeString = value => new TextEncoder().encode(value);
|
|
78
|
-
/**
|
|
79
|
-
* Encodes bytes as a hex string to Uint8Array
|
|
80
|
-
*
|
|
81
|
-
* @internal
|
|
82
|
-
*/
|
|
83
|
-
export const encodeHexBytes = hex => {
|
|
84
|
-
const bytes = new Uint8Array(hex.length / 2);
|
|
85
|
-
for (let i = 0; i < hex.length; i += 2) {
|
|
86
|
-
bytes[i / 2] = parseInt(hex.slice(i, i + 2), 16);
|
|
87
|
-
}
|
|
88
|
-
return bytes;
|
|
89
|
-
};
|
|
90
|
-
/**
|
|
91
|
-
* Concatenates multiple Uint8Arrays
|
|
92
|
-
*
|
|
93
|
-
* @internal
|
|
94
|
-
*/
|
|
95
|
-
export const concat = (...arrays) => Bytes.concat(arrays);
|
|
96
|
-
// Field encoders
|
|
97
|
-
/**
|
|
98
|
-
* Encodes a varint field
|
|
99
|
-
*
|
|
100
|
-
* @internal
|
|
101
|
-
*/
|
|
102
|
-
export const varintField = (fieldNumber, value) => concat(encodeVarint(encodeTag(fieldNumber, WireType.Varint)), encodeVarint(value));
|
|
103
|
-
/**
|
|
104
|
-
* Encodes a bool field
|
|
105
|
-
*
|
|
106
|
-
* @internal
|
|
107
|
-
*/
|
|
108
|
-
export const boolField = (fieldNumber, value) => varintField(fieldNumber, value ? 1 : 0);
|
|
109
|
-
/**
|
|
110
|
-
* Encodes a fixed64 field
|
|
111
|
-
*
|
|
112
|
-
* @internal
|
|
113
|
-
*/
|
|
114
|
-
export const fixed64Field = (fieldNumber, value) => concat(encodeVarint(encodeTag(fieldNumber, WireType.Fixed64)), encodeFixed64(value));
|
|
115
|
-
/**
|
|
116
|
-
* Encodes a fixed32 field
|
|
117
|
-
*
|
|
118
|
-
* @internal
|
|
119
|
-
*/
|
|
120
|
-
export const fixed32Field = (fieldNumber, value) => concat(encodeVarint(encodeTag(fieldNumber, WireType.Fixed32)), encodeFixed32(value));
|
|
121
|
-
/**
|
|
122
|
-
* Encodes a double field
|
|
123
|
-
*
|
|
124
|
-
* @internal
|
|
125
|
-
*/
|
|
126
|
-
export const doubleField = (fieldNumber, value) => concat(encodeVarint(encodeTag(fieldNumber, WireType.Fixed64)), encodeDouble(value));
|
|
127
|
-
/**
|
|
128
|
-
* Encodes a length-delimited field (bytes, string, embedded message)
|
|
129
|
-
*
|
|
130
|
-
* @internal
|
|
131
|
-
*/
|
|
132
|
-
export const lengthDelimitedField = (fieldNumber, value) => concat(encodeVarint(encodeTag(fieldNumber, WireType.LengthDelimited)), encodeVarint(value.length), value);
|
|
133
|
-
/**
|
|
134
|
-
* Encodes a string field
|
|
135
|
-
*
|
|
136
|
-
* @internal
|
|
137
|
-
*/
|
|
138
|
-
export const stringField = (fieldNumber, value) => lengthDelimitedField(fieldNumber, encodeString(value));
|
|
139
|
-
/**
|
|
140
|
-
* Encodes a bytes field from hex string
|
|
141
|
-
*
|
|
142
|
-
* @internal
|
|
143
|
-
*/
|
|
144
|
-
export const bytesFieldFromHex = (fieldNumber, hex) => lengthDelimitedField(fieldNumber, encodeHexBytes(hex));
|
|
145
|
-
/**
|
|
146
|
-
* Encodes an embedded message field
|
|
147
|
-
*
|
|
148
|
-
* @internal
|
|
149
|
-
*/
|
|
150
|
-
export const messageField = (fieldNumber, message) => lengthDelimitedField(fieldNumber, message);
|
|
151
|
-
/**
|
|
152
|
-
* Encodes repeated fields
|
|
153
|
-
*
|
|
154
|
-
* @internal
|
|
155
|
-
*/
|
|
156
|
-
export const repeatedField = (fieldNumber, values, encode) => concat(...values.map(v => messageField(fieldNumber, encode(v))));
|
|
157
|
-
/**
|
|
158
|
-
* Helper to conditionally encode a string field if non-empty
|
|
159
|
-
*
|
|
160
|
-
* @internal
|
|
161
|
-
*/
|
|
162
|
-
export const optionalStringField = (fieldNumber, value) => value !== undefined && value !== "" ? stringField(fieldNumber, value) : new Uint8Array(0);
|
|
163
|
-
/**
|
|
164
|
-
* Encodes a fixed64 field if the value is defined
|
|
165
|
-
*
|
|
166
|
-
* @internal
|
|
167
|
-
*/
|
|
168
|
-
export const optionalFixed64Field = (fieldNumber, value) => value !== undefined ? fixed64Field(fieldNumber, BigInt(value)) : new Uint8Array(0);
|
|
169
|
-
//# sourceMappingURL=protobuf.js.map
|
|
@@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