@code-yeongyu/senpi 2026.8.20-2 → 2026.8.20

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.
Files changed (505) hide show
  1. package/CHANGELOG.md +0 -16
  2. package/node_modules/@aws-sdk/client-bedrock-runtime/dist-cjs/index.js +13 -38
  3. package/node_modules/@aws-sdk/client-bedrock-runtime/dist-es/index.js +1 -1
  4. package/node_modules/@aws-sdk/client-bedrock-runtime/dist-es/schemas/schemas_0.js +12 -34
  5. package/node_modules/@aws-sdk/client-bedrock-runtime/dist-types/commands/ConverseCommand.d.ts +0 -29
  6. package/node_modules/@aws-sdk/client-bedrock-runtime/dist-types/commands/ConverseStreamCommand.d.ts +0 -15
  7. package/node_modules/@aws-sdk/client-bedrock-runtime/dist-types/commands/CountTokensCommand.d.ts +0 -14
  8. package/node_modules/@aws-sdk/client-bedrock-runtime/dist-types/index.d.ts +1 -1
  9. package/node_modules/@aws-sdk/client-bedrock-runtime/dist-types/models/models_0.d.ts +1 -119
  10. package/node_modules/@aws-sdk/client-bedrock-runtime/dist-types/runtimeConfig.browser.d.ts +46 -46
  11. package/node_modules/@aws-sdk/client-bedrock-runtime/dist-types/runtimeConfig.d.ts +36 -36
  12. package/node_modules/@aws-sdk/client-bedrock-runtime/dist-types/runtimeConfig.native.d.ts +48 -48
  13. package/node_modules/@aws-sdk/client-bedrock-runtime/dist-types/runtimeConfig.shared.d.ts +2 -2
  14. package/node_modules/@aws-sdk/client-bedrock-runtime/dist-types/schemas/schemas_0.d.ts +0 -3
  15. package/node_modules/@aws-sdk/client-bedrock-runtime/dist-types/ts3.4/index.d.ts +1 -1
  16. package/node_modules/@aws-sdk/client-bedrock-runtime/dist-types/ts3.4/models/models_0.d.ts +0 -76
  17. package/node_modules/@aws-sdk/client-bedrock-runtime/dist-types/ts3.4/runtimeConfig.browser.d.ts +72 -70
  18. package/node_modules/@aws-sdk/client-bedrock-runtime/dist-types/ts3.4/runtimeConfig.d.ts +68 -68
  19. package/node_modules/@aws-sdk/client-bedrock-runtime/dist-types/ts3.4/runtimeConfig.native.d.ts +88 -86
  20. package/node_modules/@aws-sdk/client-bedrock-runtime/dist-types/ts3.4/runtimeConfig.shared.d.ts +3 -3
  21. package/node_modules/@aws-sdk/client-bedrock-runtime/dist-types/ts3.4/schemas/schemas_0.d.ts +0 -3
  22. package/node_modules/@aws-sdk/client-bedrock-runtime/package.json +14 -14
  23. package/node_modules/@aws-sdk/core/dist-cjs/submodules/protocols/index.js +426 -1343
  24. package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/index.js +5 -8
  25. package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/AwsJsonRpcProtocol.js +2 -2
  26. package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/AwsRestJsonProtocol.js +3 -3
  27. package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/{codec-v1/JsonCodec.js → JsonCodec.js} +1 -1
  28. package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/{codec-v1/JsonShapeDeserializer.js → JsonShapeDeserializer.js} +6 -6
  29. package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/{codec-v1/JsonShapeSerializer.js → JsonShapeSerializer.js} +5 -8
  30. package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/{codec-v2/JsonShapeDeserializer2.js → experimental/BufferJsonShapeDeserializer.js} +18 -38
  31. package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/{codec-v2/JsonShapeSerializer2.js → experimental/ByteJsonShapeSerializer.js} +71 -107
  32. package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/jsonReviver.js +9 -93
  33. package/node_modules/@aws-sdk/core/dist-types/submodules/client/util-endpoints/lib/aws/partitions.d.ts +54 -54
  34. package/node_modules/@aws-sdk/core/dist-types/submodules/client/util-user-agent-browser/defaultUserAgent.d.ts +1 -1
  35. package/node_modules/@aws-sdk/core/dist-types/submodules/client/util-user-agent-browser/defaultUserAgent.native.d.ts +1 -1
  36. package/node_modules/@aws-sdk/core/dist-types/submodules/client/util-user-agent-node/defaultUserAgent.d.ts +1 -1
  37. package/node_modules/@aws-sdk/core/dist-types/submodules/protocols/index.d.ts +6 -9
  38. package/node_modules/@aws-sdk/core/dist-types/submodules/protocols/json/AwsJson1_0Protocol.d.ts +2 -3
  39. package/node_modules/@aws-sdk/core/dist-types/submodules/protocols/json/AwsJson1_1Protocol.d.ts +2 -3
  40. package/node_modules/@aws-sdk/core/dist-types/submodules/protocols/json/AwsJsonRpcProtocol.d.ts +3 -4
  41. package/node_modules/@aws-sdk/core/dist-types/submodules/protocols/json/AwsRestJsonProtocol.d.ts +3 -5
  42. package/node_modules/@aws-sdk/core/dist-types/submodules/protocols/json/{codec-v1/JsonCodec.d.ts → JsonCodec.d.ts} +8 -4
  43. package/node_modules/@aws-sdk/core/dist-types/submodules/protocols/json/{codec-v1/JsonShapeDeserializer.d.ts → JsonShapeDeserializer.d.ts} +2 -3
  44. package/node_modules/@aws-sdk/core/dist-types/submodules/protocols/json/{codec-v1/JsonShapeSerializer.d.ts → JsonShapeSerializer.d.ts} +2 -3
  45. package/node_modules/@aws-sdk/core/dist-types/submodules/protocols/json/{codec-v2/JsonShapeDeserializer2.d.ts → experimental/BufferJsonShapeDeserializer.d.ts} +3 -4
  46. package/node_modules/@aws-sdk/core/dist-types/submodules/protocols/json/{codec-v2/JsonShapeSerializer2.d.ts → experimental/ByteJsonShapeSerializer.d.ts} +16 -19
  47. package/node_modules/@aws-sdk/core/dist-types/ts3.4/api-extractor-type-index.d.ts +7 -4
  48. package/node_modules/@aws-sdk/core/dist-types/ts3.4/index.d.ts +21 -61
  49. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/account-id-endpoint/AccountIdEndpointModeConfigResolver.d.ts +27 -13
  50. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/account-id-endpoint/AccountIdEndpointModeConstants.d.ts +16 -4
  51. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/account-id-endpoint/NodeAccountIdEndpointModeConfigOptions.d.ts +14 -5
  52. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/account-id-endpoint/index.d.ts +5 -16
  53. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/emitWarningIfUnsupportedVersion.d.ts +11 -4
  54. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/index.browser.d.ts +47 -107
  55. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/index.d.ts +39 -112
  56. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/index.native.d.ts +48 -107
  57. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/longPollMiddleware.d.ts +14 -13
  58. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/middleware-host-header/hostHeaderMiddleware.d.ts +35 -25
  59. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/middleware-logger/loggerMiddleware.d.ts +4 -14
  60. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/middleware-recursion-detection/configuration.d.ts +6 -2
  61. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/middleware-recursion-detection/getRecursionDetectionPlugin.browser.d.ts +5 -2
  62. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/middleware-recursion-detection/getRecursionDetectionPlugin.d.ts +5 -2
  63. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/middleware-recursion-detection/recursionDetectionMiddleware.browser.d.ts +6 -2
  64. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/middleware-recursion-detection/recursionDetectionMiddleware.d.ts +10 -2
  65. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/middleware-recursion-detection/recursionDetectionMiddleware.native.d.ts +6 -2
  66. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/middleware-user-agent/check-features.d.ts +20 -16
  67. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/middleware-user-agent/configurations.d.ts +44 -21
  68. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/middleware-user-agent/constants.d.ts +7 -7
  69. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/middleware-user-agent/encode-features.d.ts +5 -2
  70. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/middleware-user-agent/user-agent-middleware.d.ts +18 -18
  71. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/region-config-resolver/awsRegionConfig.d.ts +11 -8
  72. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/region-config-resolver/extensions.d.ts +16 -14
  73. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/region-config-resolver/stsRegionDefaultResolver.browser.d.ts +4 -1
  74. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/region-config-resolver/stsRegionDefaultResolver.d.ts +14 -7
  75. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/region-config-resolver/stsRegionDefaultResolver.native.d.ts +4 -1
  76. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/setCredentialFeature.d.ts +7 -6
  77. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/setFeature.d.ts +12 -6
  78. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/setTokenFeature.d.ts +7 -6
  79. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/util-endpoints/aws.d.ts +2 -2
  80. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/util-endpoints/lib/aws/isVirtualHostableS3Bucket.d.ts +5 -4
  81. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/util-endpoints/lib/aws/parseArn.d.ts +7 -2
  82. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/util-endpoints/lib/aws/partition.d.ts +38 -28
  83. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/util-endpoints/lib/aws/partitions.d.ts +638 -647
  84. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/util-endpoints/lib/isIpAddress.d.ts +1 -1
  85. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/util-endpoints/resolveDefaultAwsRegionalEndpointsConfig.d.ts +56 -29
  86. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/util-endpoints/resolveEndpoint.d.ts +1 -1
  87. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/util-endpoints/types/EndpointError.d.ts +1 -1
  88. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/util-endpoints/types/EndpointRuleObject.d.ts +1 -6
  89. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/util-endpoints/types/ErrorRuleObject.d.ts +1 -1
  90. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/util-endpoints/types/RuleSetObject.d.ts +1 -1
  91. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/util-endpoints/types/TreeRuleObject.d.ts +1 -1
  92. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/util-endpoints/types/shared.d.ts +1 -12
  93. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/util-user-agent-browser/configurations.d.ts +7 -4
  94. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/util-user-agent-browser/createUserAgentStringParsingProvider.d.ts +14 -7
  95. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/util-user-agent-browser/defaultUserAgent.browser.d.ts +2 -7
  96. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/util-user-agent-browser/defaultUserAgent.d.ts +27 -15
  97. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/util-user-agent-browser/defaultUserAgent.native.d.ts +18 -10
  98. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/util-user-agent-node/crt-availability.d.ts +8 -3
  99. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/util-user-agent-node/defaultUserAgent.d.ts +28 -14
  100. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/util-user-agent-node/getRuntimeUserAgentPair.d.ts +6 -2
  101. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/util-user-agent-node/is-crt-available.d.ts +5 -2
  102. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/util-user-agent-node/nodeAppIdConfigOptions.d.ts +13 -4
  103. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/httpAuthSchemes/aws_sdk/AwsSdkSigV4ASigner.d.ts +10 -9
  104. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/httpAuthSchemes/aws_sdk/AwsSdkSigV4Signer.d.ts +44 -39
  105. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/httpAuthSchemes/aws_sdk/NODE_AUTH_SCHEME_PREFERENCE_OPTIONS.d.ts +5 -2
  106. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/httpAuthSchemes/aws_sdk/clock-skew-defaults.browser.d.ts +6 -1
  107. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/httpAuthSchemes/aws_sdk/clock-skew-defaults.d.ts +7 -1
  108. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/httpAuthSchemes/aws_sdk/clock-skew-node-config.d.ts +13 -4
  109. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/httpAuthSchemes/aws_sdk/index.d.ts +7 -23
  110. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/httpAuthSchemes/aws_sdk/resolveAwsSdkSigV4AConfig.d.ts +38 -13
  111. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/httpAuthSchemes/aws_sdk/resolveAwsSdkSigV4Config.d.ts +133 -57
  112. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/httpAuthSchemes/index.browser.d.ts +11 -32
  113. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/httpAuthSchemes/index.d.ts +9 -32
  114. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/httpAuthSchemes/utils/getArrayForCommaSeparatedString.d.ts +8 -1
  115. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/httpAuthSchemes/utils/getBearerTokenEnvKey.d.ts +6 -1
  116. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/httpAuthSchemes/utils/getDateHeader.d.ts +8 -2
  117. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/httpAuthSchemes/utils/getSkewCorrectedDate.d.ts +8 -1
  118. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/httpAuthSchemes/utils/getUpdatedSystemClockOffset.d.ts +26 -6
  119. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/httpAuthSchemes/utils/index.d.ts +4 -4
  120. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/httpAuthSchemes/utils/isClockSkewed.d.ts +9 -1
  121. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/ConfigurableSerdeContext.d.ts +8 -5
  122. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/ProtocolLib.d.ts +74 -40
  123. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/UnionSerde.d.ts +24 -9
  124. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/cbor/AwsSmithyRpcV2CborProtocol.d.ts +25 -36
  125. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/coercing-serializers.d.ts +18 -3
  126. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/common.d.ts +2 -5
  127. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/index.d.ts +22 -30
  128. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/json/AwsJson1_0Protocol.d.ts +22 -22
  129. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/json/AwsJson1_1Protocol.d.ts +22 -22
  130. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/json/AwsJsonRpcProtocol.d.ts +29 -50
  131. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/json/AwsRestJsonProtocol.d.ts +36 -52
  132. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/json/JsonCodec.d.ts +19 -0
  133. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/json/JsonShapeDeserializer.d.ts +13 -0
  134. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/json/JsonShapeSerializer.d.ts +28 -0
  135. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/json/awsExpectUnion.d.ts +7 -1
  136. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/json/detectBufferParsing.d.ts +1 -1
  137. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/json/experimental/BufferJsonShapeDeserializer.d.ts +29 -0
  138. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/json/experimental/ByteJsonShapeSerializer.d.ts +57 -0
  139. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/json/jsonReplacer.d.ts +21 -7
  140. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/json/jsonReviver.d.ts +15 -7
  141. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/json/needsReviver.d.ts +11 -2
  142. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/json/parseJsonBody.d.ts +22 -14
  143. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/query/AwsEc2QueryProtocol.d.ts +27 -18
  144. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/query/AwsQueryProtocol.d.ts +49 -57
  145. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/query/QuerySerializerSettings.d.ts +13 -7
  146. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/query/QueryShapeSerializer.d.ts +16 -21
  147. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/writeKey.d.ts +4 -1
  148. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/xml/AwsRestXmlProtocol.d.ts +31 -47
  149. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/xml/XmlCodec.d.ts +14 -17
  150. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/xml/XmlShapeDeserializer.d.ts +20 -15
  151. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/xml/XmlShapeSerializer.d.ts +21 -21
  152. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/xml/parseXmlBody.d.ts +13 -4
  153. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/xml/simpleFormatXml.d.ts +6 -1
  154. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/util/index.d.ts +3 -3
  155. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/util/util-arn-parser/arn.d.ts +32 -14
  156. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/util/util-format-url/format-url.d.ts +2 -4
  157. package/node_modules/@aws-sdk/core/package.json +6 -6
  158. package/node_modules/@aws-sdk/credential-provider-env/package.json +5 -5
  159. package/node_modules/@aws-sdk/credential-provider-http/node_modules/@smithy/node-http-handler/LICENSE +201 -0
  160. package/node_modules/@aws-sdk/credential-provider-http/node_modules/@smithy/node-http-handler/README.md +9 -0
  161. package/node_modules/@aws-sdk/credential-provider-http/node_modules/@smithy/node-http-handler/dist-cjs/index.js +840 -0
  162. package/node_modules/@aws-sdk/credential-provider-http/node_modules/@smithy/node-http-handler/dist-es/build-abort-error.js +19 -0
  163. package/node_modules/@aws-sdk/credential-provider-http/node_modules/@smithy/node-http-handler/dist-es/constants.js +1 -0
  164. package/node_modules/@aws-sdk/credential-provider-http/node_modules/@smithy/node-http-handler/dist-es/get-transformed-headers.js +9 -0
  165. package/node_modules/@aws-sdk/credential-provider-http/node_modules/@smithy/node-http-handler/dist-es/http2/ClientHttp2SessionRef.js +50 -0
  166. package/node_modules/@aws-sdk/credential-provider-http/node_modules/@smithy/node-http-handler/dist-es/index.js +3 -0
  167. package/node_modules/@aws-sdk/credential-provider-http/node_modules/@smithy/node-http-handler/dist-es/node-http-handler.js +241 -0
  168. package/node_modules/@aws-sdk/credential-provider-http/node_modules/@smithy/node-http-handler/dist-es/node-http2-connection-manager.js +136 -0
  169. package/node_modules/@aws-sdk/credential-provider-http/node_modules/@smithy/node-http-handler/dist-es/node-http2-connection-pool.js +46 -0
  170. package/node_modules/@aws-sdk/credential-provider-http/node_modules/@smithy/node-http-handler/dist-es/node-http2-handler.js +173 -0
  171. package/node_modules/@aws-sdk/credential-provider-http/node_modules/@smithy/node-http-handler/dist-es/node-http2.js +2 -0
  172. package/node_modules/@aws-sdk/credential-provider-http/node_modules/@smithy/node-http-handler/dist-es/node-https.js +2 -0
  173. package/node_modules/@aws-sdk/credential-provider-http/node_modules/@smithy/node-http-handler/dist-es/set-connection-timeout.js +36 -0
  174. package/node_modules/@aws-sdk/credential-provider-http/node_modules/@smithy/node-http-handler/dist-es/set-request-timeout.js +21 -0
  175. package/node_modules/@aws-sdk/credential-provider-http/node_modules/@smithy/node-http-handler/dist-es/set-socket-keep-alive.js +22 -0
  176. package/node_modules/@aws-sdk/credential-provider-http/node_modules/@smithy/node-http-handler/dist-es/set-socket-timeout.js +23 -0
  177. package/node_modules/@aws-sdk/credential-provider-http/node_modules/@smithy/node-http-handler/dist-es/timing.js +4 -0
  178. package/node_modules/@aws-sdk/credential-provider-http/node_modules/@smithy/node-http-handler/dist-es/write-request-body.js +63 -0
  179. package/node_modules/@aws-sdk/credential-provider-http/node_modules/@smithy/node-http-handler/dist-types/build-abort-error.d.ts +10 -0
  180. package/node_modules/@aws-sdk/credential-provider-http/node_modules/@smithy/node-http-handler/dist-types/constants.d.ts +5 -0
  181. package/node_modules/@aws-sdk/credential-provider-http/node_modules/@smithy/node-http-handler/dist-types/get-transformed-headers.d.ts +4 -0
  182. package/node_modules/@aws-sdk/credential-provider-http/node_modules/@smithy/node-http-handler/dist-types/http2/ClientHttp2SessionRef.d.ts +46 -0
  183. package/node_modules/@aws-sdk/credential-provider-http/node_modules/@smithy/node-http-handler/dist-types/index.d.ts +3 -0
  184. package/node_modules/@aws-sdk/credential-provider-http/node_modules/@smithy/node-http-handler/dist-types/node-http-handler.d.ts +47 -0
  185. package/node_modules/@aws-sdk/credential-provider-http/node_modules/@smithy/node-http-handler/dist-types/node-http2-connection-manager.d.ts +46 -0
  186. package/node_modules/@aws-sdk/credential-provider-http/node_modules/@smithy/node-http-handler/dist-types/node-http2-connection-pool.d.ts +36 -0
  187. package/node_modules/@aws-sdk/credential-provider-http/node_modules/@smithy/node-http-handler/dist-types/node-http2-handler.d.ts +76 -0
  188. package/node_modules/@aws-sdk/credential-provider-http/node_modules/@smithy/node-http-handler/dist-types/node-http2.d.ts +2 -0
  189. package/node_modules/@aws-sdk/credential-provider-http/node_modules/@smithy/node-http-handler/dist-types/node-https.d.ts +2 -0
  190. package/node_modules/@aws-sdk/credential-provider-http/node_modules/@smithy/node-http-handler/dist-types/set-connection-timeout.d.ts +2 -0
  191. package/node_modules/@aws-sdk/credential-provider-http/node_modules/@smithy/node-http-handler/dist-types/set-request-timeout.d.ts +6 -0
  192. package/node_modules/@aws-sdk/credential-provider-http/node_modules/@smithy/node-http-handler/dist-types/set-socket-keep-alive.d.ts +6 -0
  193. package/node_modules/@aws-sdk/credential-provider-http/node_modules/@smithy/node-http-handler/dist-types/set-socket-timeout.d.ts +2 -0
  194. package/node_modules/@aws-sdk/credential-provider-http/node_modules/@smithy/node-http-handler/dist-types/timing.d.ts +9 -0
  195. package/node_modules/@aws-sdk/credential-provider-http/node_modules/@smithy/node-http-handler/dist-types/ts3.4/build-abort-error.d.ts +10 -0
  196. package/node_modules/@aws-sdk/credential-provider-http/node_modules/@smithy/node-http-handler/dist-types/ts3.4/constants.d.ts +5 -0
  197. package/node_modules/@aws-sdk/credential-provider-http/node_modules/@smithy/node-http-handler/dist-types/ts3.4/get-transformed-headers.d.ts +4 -0
  198. package/node_modules/@aws-sdk/credential-provider-http/node_modules/@smithy/node-http-handler/dist-types/ts3.4/http2/ClientHttp2SessionRef.d.ts +46 -0
  199. package/node_modules/@aws-sdk/credential-provider-http/node_modules/@smithy/node-http-handler/dist-types/ts3.4/index.d.ts +3 -0
  200. package/node_modules/@aws-sdk/credential-provider-http/node_modules/@smithy/node-http-handler/dist-types/ts3.4/node-http-handler.d.ts +47 -0
  201. package/node_modules/@aws-sdk/credential-provider-http/node_modules/@smithy/node-http-handler/dist-types/ts3.4/node-http2-connection-manager.d.ts +46 -0
  202. package/node_modules/@aws-sdk/credential-provider-http/node_modules/@smithy/node-http-handler/dist-types/ts3.4/node-http2-connection-pool.d.ts +36 -0
  203. package/node_modules/@aws-sdk/credential-provider-http/node_modules/@smithy/node-http-handler/dist-types/ts3.4/node-http2-handler.d.ts +76 -0
  204. package/node_modules/@aws-sdk/credential-provider-http/node_modules/@smithy/node-http-handler/dist-types/ts3.4/node-http2.d.ts +2 -0
  205. package/node_modules/@aws-sdk/credential-provider-http/node_modules/@smithy/node-http-handler/dist-types/ts3.4/node-https.d.ts +2 -0
  206. package/node_modules/@aws-sdk/credential-provider-http/node_modules/@smithy/node-http-handler/dist-types/ts3.4/set-connection-timeout.d.ts +2 -0
  207. package/node_modules/@aws-sdk/credential-provider-http/node_modules/@smithy/node-http-handler/dist-types/ts3.4/set-request-timeout.d.ts +6 -0
  208. package/node_modules/@aws-sdk/credential-provider-http/node_modules/@smithy/node-http-handler/dist-types/ts3.4/set-socket-keep-alive.d.ts +6 -0
  209. package/node_modules/@aws-sdk/credential-provider-http/node_modules/@smithy/node-http-handler/dist-types/ts3.4/set-socket-timeout.d.ts +2 -0
  210. package/node_modules/@aws-sdk/credential-provider-http/node_modules/@smithy/node-http-handler/dist-types/ts3.4/timing.d.ts +9 -0
  211. package/node_modules/@aws-sdk/credential-provider-http/node_modules/@smithy/node-http-handler/dist-types/ts3.4/write-request-body.d.ts +12 -0
  212. package/node_modules/@aws-sdk/credential-provider-http/node_modules/@smithy/node-http-handler/dist-types/write-request-body.d.ts +12 -0
  213. package/node_modules/@aws-sdk/credential-provider-http/node_modules/@smithy/node-http-handler/package.json +64 -0
  214. package/node_modules/@aws-sdk/credential-provider-http/package.json +7 -7
  215. package/node_modules/@aws-sdk/credential-provider-ini/package.json +13 -13
  216. package/node_modules/@aws-sdk/credential-provider-login/dist-cjs/index.js +28 -35
  217. package/node_modules/@aws-sdk/credential-provider-login/dist-es/LoginCredentialsFetcher.js +28 -35
  218. package/node_modules/@aws-sdk/credential-provider-login/dist-types/LoginCredentialsFetcher.d.ts +0 -1
  219. package/node_modules/@aws-sdk/credential-provider-login/dist-types/ts3.4/LoginCredentialsFetcher.d.ts +0 -1
  220. package/node_modules/@aws-sdk/credential-provider-login/package.json +6 -6
  221. package/node_modules/@aws-sdk/credential-provider-node/package.json +11 -11
  222. package/node_modules/@aws-sdk/credential-provider-process/package.json +5 -5
  223. package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/package.json +6 -6
  224. package/node_modules/@aws-sdk/credential-provider-sso/package.json +7 -7
  225. package/node_modules/@aws-sdk/credential-provider-web-identity/package.json +6 -6
  226. package/node_modules/@aws-sdk/eventstream-handler-node/package.json +4 -4
  227. package/node_modules/@aws-sdk/middleware-eventstream/package.json +4 -4
  228. package/node_modules/@aws-sdk/middleware-websocket/package.json +7 -7
  229. package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/cognito-identity/index.js +1 -1
  230. package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/signin/index.js +1 -1
  231. package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sso/index.js +1 -1
  232. package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sso-oidc/index.js +1 -1
  233. package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sts/index.js +1 -1
  234. package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/cognito-identity/runtimeConfig.browser.d.ts +42 -42
  235. package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/cognito-identity/runtimeConfig.d.ts +42 -42
  236. package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/cognito-identity/runtimeConfig.native.d.ts +41 -41
  237. package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/cognito-identity/runtimeConfig.shared.d.ts +2 -2
  238. package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/signin/runtimeConfig.browser.d.ts +43 -43
  239. package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/signin/runtimeConfig.d.ts +43 -43
  240. package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/signin/runtimeConfig.native.d.ts +42 -42
  241. package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/signin/runtimeConfig.shared.d.ts +2 -2
  242. package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/sso/runtimeConfig.browser.d.ts +42 -42
  243. package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/sso/runtimeConfig.d.ts +42 -42
  244. package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/sso/runtimeConfig.native.d.ts +41 -41
  245. package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/sso/runtimeConfig.shared.d.ts +2 -2
  246. package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/sso-oidc/runtimeConfig.browser.d.ts +42 -42
  247. package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/sso-oidc/runtimeConfig.d.ts +42 -42
  248. package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/sso-oidc/runtimeConfig.native.d.ts +41 -41
  249. package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/sso-oidc/runtimeConfig.shared.d.ts +2 -2
  250. package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/sts/runtimeConfig.browser.d.ts +44 -44
  251. package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/sts/runtimeConfig.d.ts +35 -35
  252. package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/sts/runtimeConfig.native.d.ts +43 -43
  253. package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/sts/runtimeConfig.shared.d.ts +2 -2
  254. package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/cognito-identity/runtimeConfig.browser.d.ts +66 -64
  255. package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/cognito-identity/runtimeConfig.d.ts +65 -65
  256. package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/cognito-identity/runtimeConfig.native.d.ts +70 -68
  257. package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/cognito-identity/runtimeConfig.shared.d.ts +3 -3
  258. package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/signin/runtimeConfig.browser.d.ts +69 -67
  259. package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/signin/runtimeConfig.d.ts +66 -66
  260. package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/signin/runtimeConfig.native.d.ts +73 -71
  261. package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/signin/runtimeConfig.shared.d.ts +3 -3
  262. package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/sso/runtimeConfig.browser.d.ts +66 -64
  263. package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/sso/runtimeConfig.d.ts +65 -65
  264. package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/sso/runtimeConfig.native.d.ts +70 -68
  265. package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/sso/runtimeConfig.shared.d.ts +3 -3
  266. package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/sso-oidc/runtimeConfig.browser.d.ts +66 -64
  267. package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/sso-oidc/runtimeConfig.d.ts +65 -65
  268. package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/sso-oidc/runtimeConfig.native.d.ts +70 -68
  269. package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/sso-oidc/runtimeConfig.shared.d.ts +3 -3
  270. package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/sts/runtimeConfig.browser.d.ts +70 -68
  271. package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/sts/runtimeConfig.d.ts +68 -68
  272. package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/sts/runtimeConfig.native.d.ts +74 -72
  273. package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/sts/runtimeConfig.shared.d.ts +3 -3
  274. package/node_modules/@aws-sdk/nested-clients/node_modules/@smithy/node-http-handler/LICENSE +201 -0
  275. package/node_modules/@aws-sdk/nested-clients/node_modules/@smithy/node-http-handler/README.md +9 -0
  276. package/node_modules/@aws-sdk/nested-clients/node_modules/@smithy/node-http-handler/dist-cjs/index.js +840 -0
  277. package/node_modules/@aws-sdk/nested-clients/node_modules/@smithy/node-http-handler/dist-es/build-abort-error.js +19 -0
  278. package/node_modules/@aws-sdk/nested-clients/node_modules/@smithy/node-http-handler/dist-es/constants.js +1 -0
  279. package/node_modules/@aws-sdk/nested-clients/node_modules/@smithy/node-http-handler/dist-es/get-transformed-headers.js +9 -0
  280. package/node_modules/@aws-sdk/nested-clients/node_modules/@smithy/node-http-handler/dist-es/http2/ClientHttp2SessionRef.js +50 -0
  281. package/node_modules/@aws-sdk/nested-clients/node_modules/@smithy/node-http-handler/dist-es/index.js +3 -0
  282. package/node_modules/@aws-sdk/nested-clients/node_modules/@smithy/node-http-handler/dist-es/node-http-handler.js +241 -0
  283. package/node_modules/@aws-sdk/nested-clients/node_modules/@smithy/node-http-handler/dist-es/node-http2-connection-manager.js +136 -0
  284. package/node_modules/@aws-sdk/nested-clients/node_modules/@smithy/node-http-handler/dist-es/node-http2-connection-pool.js +46 -0
  285. package/node_modules/@aws-sdk/nested-clients/node_modules/@smithy/node-http-handler/dist-es/node-http2-handler.js +173 -0
  286. package/node_modules/@aws-sdk/nested-clients/node_modules/@smithy/node-http-handler/dist-es/node-http2.js +2 -0
  287. package/node_modules/@aws-sdk/nested-clients/node_modules/@smithy/node-http-handler/dist-es/node-https.js +2 -0
  288. package/node_modules/@aws-sdk/nested-clients/node_modules/@smithy/node-http-handler/dist-es/set-connection-timeout.js +36 -0
  289. package/node_modules/@aws-sdk/nested-clients/node_modules/@smithy/node-http-handler/dist-es/set-request-timeout.js +21 -0
  290. package/node_modules/@aws-sdk/nested-clients/node_modules/@smithy/node-http-handler/dist-es/set-socket-keep-alive.js +22 -0
  291. package/node_modules/@aws-sdk/nested-clients/node_modules/@smithy/node-http-handler/dist-es/set-socket-timeout.js +23 -0
  292. package/node_modules/@aws-sdk/nested-clients/node_modules/@smithy/node-http-handler/dist-es/timing.js +4 -0
  293. package/node_modules/@aws-sdk/nested-clients/node_modules/@smithy/node-http-handler/dist-es/write-request-body.js +63 -0
  294. package/node_modules/@aws-sdk/nested-clients/node_modules/@smithy/node-http-handler/dist-types/build-abort-error.d.ts +10 -0
  295. package/node_modules/@aws-sdk/nested-clients/node_modules/@smithy/node-http-handler/dist-types/constants.d.ts +5 -0
  296. package/node_modules/@aws-sdk/nested-clients/node_modules/@smithy/node-http-handler/dist-types/get-transformed-headers.d.ts +4 -0
  297. package/node_modules/@aws-sdk/nested-clients/node_modules/@smithy/node-http-handler/dist-types/http2/ClientHttp2SessionRef.d.ts +46 -0
  298. package/node_modules/@aws-sdk/nested-clients/node_modules/@smithy/node-http-handler/dist-types/index.d.ts +3 -0
  299. package/node_modules/@aws-sdk/nested-clients/node_modules/@smithy/node-http-handler/dist-types/node-http-handler.d.ts +47 -0
  300. package/node_modules/@aws-sdk/nested-clients/node_modules/@smithy/node-http-handler/dist-types/node-http2-connection-manager.d.ts +46 -0
  301. package/node_modules/@aws-sdk/nested-clients/node_modules/@smithy/node-http-handler/dist-types/node-http2-connection-pool.d.ts +36 -0
  302. package/node_modules/@aws-sdk/nested-clients/node_modules/@smithy/node-http-handler/dist-types/node-http2-handler.d.ts +76 -0
  303. package/node_modules/@aws-sdk/nested-clients/node_modules/@smithy/node-http-handler/dist-types/node-http2.d.ts +2 -0
  304. package/node_modules/@aws-sdk/nested-clients/node_modules/@smithy/node-http-handler/dist-types/node-https.d.ts +2 -0
  305. package/node_modules/@aws-sdk/nested-clients/node_modules/@smithy/node-http-handler/dist-types/set-connection-timeout.d.ts +2 -0
  306. package/node_modules/@aws-sdk/nested-clients/node_modules/@smithy/node-http-handler/dist-types/set-request-timeout.d.ts +6 -0
  307. package/node_modules/@aws-sdk/nested-clients/node_modules/@smithy/node-http-handler/dist-types/set-socket-keep-alive.d.ts +6 -0
  308. package/node_modules/@aws-sdk/nested-clients/node_modules/@smithy/node-http-handler/dist-types/set-socket-timeout.d.ts +2 -0
  309. package/node_modules/@aws-sdk/nested-clients/node_modules/@smithy/node-http-handler/dist-types/timing.d.ts +9 -0
  310. package/node_modules/@aws-sdk/nested-clients/node_modules/@smithy/node-http-handler/dist-types/ts3.4/build-abort-error.d.ts +10 -0
  311. package/node_modules/@aws-sdk/nested-clients/node_modules/@smithy/node-http-handler/dist-types/ts3.4/constants.d.ts +5 -0
  312. package/node_modules/@aws-sdk/nested-clients/node_modules/@smithy/node-http-handler/dist-types/ts3.4/get-transformed-headers.d.ts +4 -0
  313. package/node_modules/@aws-sdk/nested-clients/node_modules/@smithy/node-http-handler/dist-types/ts3.4/http2/ClientHttp2SessionRef.d.ts +46 -0
  314. package/node_modules/@aws-sdk/nested-clients/node_modules/@smithy/node-http-handler/dist-types/ts3.4/index.d.ts +3 -0
  315. package/node_modules/@aws-sdk/nested-clients/node_modules/@smithy/node-http-handler/dist-types/ts3.4/node-http-handler.d.ts +47 -0
  316. package/node_modules/@aws-sdk/nested-clients/node_modules/@smithy/node-http-handler/dist-types/ts3.4/node-http2-connection-manager.d.ts +46 -0
  317. package/node_modules/@aws-sdk/nested-clients/node_modules/@smithy/node-http-handler/dist-types/ts3.4/node-http2-connection-pool.d.ts +36 -0
  318. package/node_modules/@aws-sdk/nested-clients/node_modules/@smithy/node-http-handler/dist-types/ts3.4/node-http2-handler.d.ts +76 -0
  319. package/node_modules/@aws-sdk/nested-clients/node_modules/@smithy/node-http-handler/dist-types/ts3.4/node-http2.d.ts +2 -0
  320. package/node_modules/@aws-sdk/nested-clients/node_modules/@smithy/node-http-handler/dist-types/ts3.4/node-https.d.ts +2 -0
  321. package/node_modules/@aws-sdk/nested-clients/node_modules/@smithy/node-http-handler/dist-types/ts3.4/set-connection-timeout.d.ts +2 -0
  322. package/node_modules/@aws-sdk/nested-clients/node_modules/@smithy/node-http-handler/dist-types/ts3.4/set-request-timeout.d.ts +6 -0
  323. package/node_modules/@aws-sdk/nested-clients/node_modules/@smithy/node-http-handler/dist-types/ts3.4/set-socket-keep-alive.d.ts +6 -0
  324. package/node_modules/@aws-sdk/nested-clients/node_modules/@smithy/node-http-handler/dist-types/ts3.4/set-socket-timeout.d.ts +2 -0
  325. package/node_modules/@aws-sdk/nested-clients/node_modules/@smithy/node-http-handler/dist-types/ts3.4/timing.d.ts +9 -0
  326. package/node_modules/@aws-sdk/nested-clients/node_modules/@smithy/node-http-handler/dist-types/ts3.4/write-request-body.d.ts +12 -0
  327. package/node_modules/@aws-sdk/nested-clients/node_modules/@smithy/node-http-handler/dist-types/write-request-body.d.ts +12 -0
  328. package/node_modules/@aws-sdk/nested-clients/node_modules/@smithy/node-http-handler/package.json +64 -0
  329. package/node_modules/@aws-sdk/nested-clients/package.json +8 -8
  330. package/node_modules/@aws-sdk/signature-v4-multi-region/package.json +4 -4
  331. package/node_modules/@aws-sdk/token-providers/package.json +6 -6
  332. package/node_modules/@aws-sdk/types/package.json +2 -2
  333. package/node_modules/@aws-sdk/xml-builder/package.json +2 -2
  334. package/node_modules/@bufbuild/protobuf/README.md +15 -12
  335. package/node_modules/@bufbuild/protobuf/dist/commonjs/create.js +162 -199
  336. package/node_modules/@bufbuild/protobuf/dist/commonjs/from-binary.js +153 -321
  337. package/node_modules/@bufbuild/protobuf/dist/commonjs/from-json.js +303 -601
  338. package/node_modules/@bufbuild/protobuf/dist/commonjs/reflect/reflect-check.d.ts +1 -27
  339. package/node_modules/@bufbuild/protobuf/dist/commonjs/reflect/reflect-check.js +56 -80
  340. package/node_modules/@bufbuild/protobuf/dist/commonjs/reflect/reflect.js +80 -3
  341. package/node_modules/@bufbuild/protobuf/dist/commonjs/registry.js +3 -12
  342. package/node_modules/@bufbuild/protobuf/dist/commonjs/to-binary.d.ts +0 -4
  343. package/node_modules/@bufbuild/protobuf/dist/commonjs/to-binary.js +127 -365
  344. package/node_modules/@bufbuild/protobuf/dist/commonjs/to-json.js +159 -393
  345. package/node_modules/@bufbuild/protobuf/dist/commonjs/wire/base64-encoding.d.ts +1 -3
  346. package/node_modules/@bufbuild/protobuf/dist/commonjs/wire/base64-encoding.js +8 -40
  347. package/node_modules/@bufbuild/protobuf/dist/commonjs/wire/binary-encoding.d.ts +19 -37
  348. package/node_modules/@bufbuild/protobuf/dist/commonjs/wire/binary-encoding.js +85 -281
  349. package/node_modules/@bufbuild/protobuf/dist/commonjs/wire/index.d.ts +1 -1
  350. package/node_modules/@bufbuild/protobuf/dist/commonjs/wire/index.js +1 -4
  351. package/node_modules/@bufbuild/protobuf/dist/commonjs/wire/text-encoding.d.ts +2 -19
  352. package/node_modules/@bufbuild/protobuf/dist/commonjs/wire/text-encoding.js +13 -47
  353. package/node_modules/@bufbuild/protobuf/dist/commonjs/wire/varint.d.ts +4 -4
  354. package/node_modules/@bufbuild/protobuf/dist/commonjs/wire/varint.js +23 -35
  355. package/node_modules/@bufbuild/protobuf/dist/commonjs/wkt/wrappers.js +12 -12
  356. package/node_modules/@bufbuild/protobuf/dist/esm/create.js +162 -199
  357. package/node_modules/@bufbuild/protobuf/dist/esm/from-binary.js +153 -321
  358. package/node_modules/@bufbuild/protobuf/dist/esm/from-json.js +304 -602
  359. package/node_modules/@bufbuild/protobuf/dist/esm/reflect/reflect-check.d.ts +1 -27
  360. package/node_modules/@bufbuild/protobuf/dist/esm/reflect/reflect-check.js +57 -79
  361. package/node_modules/@bufbuild/protobuf/dist/esm/reflect/reflect.js +78 -1
  362. package/node_modules/@bufbuild/protobuf/dist/esm/registry.js +3 -12
  363. package/node_modules/@bufbuild/protobuf/dist/esm/to-binary.d.ts +0 -4
  364. package/node_modules/@bufbuild/protobuf/dist/esm/to-binary.js +127 -365
  365. package/node_modules/@bufbuild/protobuf/dist/esm/to-json.js +159 -393
  366. package/node_modules/@bufbuild/protobuf/dist/esm/wire/base64-encoding.d.ts +1 -3
  367. package/node_modules/@bufbuild/protobuf/dist/esm/wire/base64-encoding.js +8 -40
  368. package/node_modules/@bufbuild/protobuf/dist/esm/wire/binary-encoding.d.ts +19 -37
  369. package/node_modules/@bufbuild/protobuf/dist/esm/wire/binary-encoding.js +87 -283
  370. package/node_modules/@bufbuild/protobuf/dist/esm/wire/index.d.ts +1 -1
  371. package/node_modules/@bufbuild/protobuf/dist/esm/wire/index.js +1 -1
  372. package/node_modules/@bufbuild/protobuf/dist/esm/wire/text-encoding.d.ts +2 -19
  373. package/node_modules/@bufbuild/protobuf/dist/esm/wire/text-encoding.js +13 -46
  374. package/node_modules/@bufbuild/protobuf/dist/esm/wire/varint.d.ts +4 -4
  375. package/node_modules/@bufbuild/protobuf/dist/esm/wire/varint.js +23 -35
  376. package/node_modules/@bufbuild/protobuf/dist/esm/wkt/wrappers.js +12 -12
  377. package/node_modules/@bufbuild/protobuf/package.json +2 -2
  378. package/node_modules/@code-yeongyu/senpi-codemode/CHANGELOG.md +0 -12
  379. package/node_modules/@code-yeongyu/senpi-codemode/package.json +4 -4
  380. package/node_modules/@earendil-works/pi-agent-core/package.json +6 -6
  381. package/node_modules/@earendil-works/pi-ai/dist/providers/data/.manifest.json +1 -1
  382. package/node_modules/@earendil-works/pi-ai/dist/providers/data/openrouter.json +1 -1
  383. package/node_modules/@earendil-works/pi-ai/package.json +8 -8
  384. package/node_modules/@earendil-works/pi-pty/package.json +2 -2
  385. package/node_modules/@earendil-works/pi-telemetry/package.json +2 -2
  386. package/node_modules/@earendil-works/pi-tui/package.json +1 -1
  387. package/node_modules/@smithy/core/dist-cjs/submodules/cbor/index.js +337 -1560
  388. package/node_modules/@smithy/core/dist-cjs/submodules/event-streams/index.browser.js +23 -23
  389. package/node_modules/@smithy/core/dist-cjs/submodules/event-streams/index.js +23 -23
  390. package/node_modules/@smithy/core/dist-cjs/submodules/protocols/index.js +13 -17
  391. package/node_modules/@smithy/core/dist-cjs/submodules/schema/index.js +10 -0
  392. package/node_modules/@smithy/core/dist-es/submodules/cbor/CborCodec.js +205 -4
  393. package/node_modules/@smithy/core/dist-es/submodules/cbor/SmithyRpcV2CborProtocol.js +2 -1
  394. package/node_modules/@smithy/core/dist-es/submodules/cbor/cbor-encode.js +1 -1
  395. package/node_modules/@smithy/core/dist-es/submodules/cbor/index.js +1 -5
  396. package/node_modules/@smithy/core/dist-es/submodules/event-streams/EventStreamSerde.js +4 -4
  397. package/node_modules/@smithy/core/dist-es/submodules/event-streams/eventstream-codec/HeaderMarshaller.js +19 -19
  398. package/node_modules/@smithy/core/dist-es/submodules/protocols/RpcProtocol.js +4 -3
  399. package/node_modules/@smithy/core/dist-es/submodules/protocols/middleware-content-length/contentLengthMiddleware.js +4 -6
  400. package/node_modules/@smithy/core/dist-es/submodules/protocols/protocol-http/extensions/httpExtensionConfiguration.js +5 -8
  401. package/node_modules/@smithy/core/dist-es/submodules/schema/schemas/ListSchema.js +2 -0
  402. package/node_modules/@smithy/core/dist-es/submodules/schema/schemas/MapSchema.js +2 -0
  403. package/node_modules/@smithy/core/dist-es/submodules/schema/schemas/OperationSchema.js +2 -0
  404. package/node_modules/@smithy/core/dist-es/submodules/schema/schemas/SimpleSchema.js +2 -0
  405. package/node_modules/@smithy/core/dist-es/submodules/schema/schemas/StructureSchema.js +2 -0
  406. package/node_modules/@smithy/core/dist-types/submodules/cbor/CborCodec.d.ts +27 -5
  407. package/node_modules/@smithy/core/dist-types/submodules/cbor/SmithyRpcV2CborProtocol.d.ts +2 -2
  408. package/node_modules/@smithy/core/dist-types/submodules/cbor/index.d.ts +1 -5
  409. package/node_modules/@smithy/core/dist-types/submodules/client/smithy-client/extensions/defaultExtensionConfiguration.d.ts +7 -1
  410. package/node_modules/@smithy/core/dist-types/submodules/config/config-resolver/regionConfig/checkRegion.d.ts +1 -2
  411. package/node_modules/@smithy/core/dist-types/submodules/endpoints/util-endpoints/utils/evaluateCondition.d.ts +1 -1
  412. package/node_modules/@smithy/core/dist-types/submodules/endpoints/util-endpoints/utils/evaluateConditions.d.ts +1 -1
  413. package/node_modules/@smithy/core/dist-types/submodules/endpoints/util-endpoints/utils/evaluateExpression.d.ts +2 -2
  414. package/node_modules/@smithy/core/dist-types/submodules/endpoints/util-endpoints/utils/evaluateRules.d.ts +2 -2
  415. package/node_modules/@smithy/core/dist-types/submodules/endpoints/util-endpoints/utils/getEndpointProperties.d.ts +2 -2
  416. package/node_modules/@smithy/core/dist-types/submodules/endpoints/util-endpoints/utils/getReferenceValue.d.ts +2 -2
  417. package/node_modules/@smithy/core/dist-types/submodules/event-streams/EventStreamSerde.d.ts +2 -14
  418. package/node_modules/@smithy/core/dist-types/submodules/protocols/protocol-http/extensions/httpExtensionConfiguration.d.ts +2 -7
  419. package/node_modules/@smithy/core/dist-types/submodules/retry/util-retry/retries-2026-config.d.ts +2 -2
  420. package/node_modules/@smithy/core/dist-types/submodules/schema/TypeRegistry.d.ts +1 -1
  421. package/node_modules/@smithy/core/dist-types/submodules/serde/parse-utils.d.ts +5 -5
  422. package/node_modules/@smithy/core/dist-types/ts3.4/submodules/cbor/CborCodec.d.ts +27 -5
  423. package/node_modules/@smithy/core/dist-types/ts3.4/submodules/cbor/SmithyRpcV2CborProtocol.d.ts +2 -2
  424. package/node_modules/@smithy/core/dist-types/ts3.4/submodules/cbor/index.d.ts +1 -5
  425. package/node_modules/@smithy/core/dist-types/ts3.4/submodules/client/smithy-client/extensions/defaultExtensionConfiguration.d.ts +7 -1
  426. package/node_modules/@smithy/core/dist-types/ts3.4/submodules/config/config-resolver/regionConfig/checkRegion.d.ts +1 -2
  427. package/node_modules/@smithy/core/dist-types/ts3.4/submodules/endpoints/util-endpoints/utils/evaluateCondition.d.ts +1 -1
  428. package/node_modules/@smithy/core/dist-types/ts3.4/submodules/endpoints/util-endpoints/utils/evaluateConditions.d.ts +1 -1
  429. package/node_modules/@smithy/core/dist-types/ts3.4/submodules/endpoints/util-endpoints/utils/evaluateExpression.d.ts +2 -2
  430. package/node_modules/@smithy/core/dist-types/ts3.4/submodules/endpoints/util-endpoints/utils/evaluateRules.d.ts +2 -2
  431. package/node_modules/@smithy/core/dist-types/ts3.4/submodules/endpoints/util-endpoints/utils/getEndpointProperties.d.ts +2 -2
  432. package/node_modules/@smithy/core/dist-types/ts3.4/submodules/endpoints/util-endpoints/utils/getReferenceValue.d.ts +2 -2
  433. package/node_modules/@smithy/core/dist-types/ts3.4/submodules/event-streams/EventStreamSerde.d.ts +2 -14
  434. package/node_modules/@smithy/core/dist-types/ts3.4/submodules/protocols/protocol-http/extensions/httpExtensionConfiguration.d.ts +2 -7
  435. package/node_modules/@smithy/core/dist-types/ts3.4/submodules/retry/util-retry/retries-2026-config.d.ts +2 -2
  436. package/node_modules/@smithy/core/dist-types/ts3.4/submodules/schema/TypeRegistry.d.ts +1 -1
  437. package/node_modules/@smithy/core/dist-types/ts3.4/submodules/serde/parse-utils.d.ts +5 -5
  438. package/node_modules/@smithy/core/package.json +11 -4
  439. package/node_modules/@smithy/credential-provider-imds/package.json +12 -4
  440. package/node_modules/@smithy/fetch-http-handler/package.json +13 -5
  441. package/node_modules/@smithy/node-http-handler/dist-cjs/index.js +2 -9
  442. package/node_modules/@smithy/node-http-handler/dist-es/node-http-handler.js +2 -9
  443. package/node_modules/@smithy/node-http-handler/dist-types/node-http2-handler.d.ts +1 -1
  444. package/node_modules/@smithy/node-http-handler/dist-types/ts3.4/node-http2-handler.d.ts +1 -1
  445. package/node_modules/@smithy/node-http-handler/package.json +13 -5
  446. package/node_modules/@smithy/signature-v4/dist-cjs/index.js +9 -9
  447. package/node_modules/@smithy/signature-v4/dist-es/HeaderFormatter.js +9 -9
  448. package/node_modules/@smithy/signature-v4/package.json +12 -4
  449. package/node_modules/@smithy/types/dist-types/schema/sentinels.d.ts +14 -14
  450. package/node_modules/@smithy/types/package.json +39 -29
  451. package/node_modules/@types/node/README.md +1 -1
  452. package/node_modules/@types/node/child_process.d.ts +1 -0
  453. package/node_modules/@types/node/crypto.d.ts +7 -7
  454. package/node_modules/@types/node/dns/promises.d.ts +5 -5
  455. package/node_modules/@types/node/dns.d.ts +5 -5
  456. package/node_modules/@types/node/fs.d.ts +0 -7
  457. package/node_modules/@types/node/http.d.ts +0 -30
  458. package/node_modules/@types/node/http2.d.ts +4 -4
  459. package/node_modules/@types/node/os.d.ts +30 -30
  460. package/node_modules/@types/node/package.json +2 -2
  461. package/node_modules/@types/node/perf_hooks.d.ts +1 -2
  462. package/node_modules/@types/node/process.d.ts +43 -42
  463. package/node_modules/@types/node/quic.d.ts +84 -1049
  464. package/node_modules/@types/node/sqlite.d.ts +1 -14
  465. package/node_modules/@types/node/stream/iter.d.ts +2 -3
  466. package/node_modules/@types/node/test.d.ts +0 -61
  467. package/node_modules/@types/node/v8.d.ts +23 -20
  468. package/package.json +36 -36
  469. package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/JsonSettings.js +0 -1
  470. package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/codec-v1/JsonSettings.js +0 -1
  471. package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/codec-v2/JsonBytesStringAdapter.js +0 -103
  472. package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/codec-v2/JsonCodec2.js +0 -20
  473. package/node_modules/@aws-sdk/core/dist-types/submodules/protocols/json/JsonSettings.d.ts +0 -7
  474. package/node_modules/@aws-sdk/core/dist-types/submodules/protocols/json/codec-v1/JsonSettings.d.ts +0 -7
  475. package/node_modules/@aws-sdk/core/dist-types/submodules/protocols/json/codec-v2/JsonBytesStringAdapter.d.ts +0 -51
  476. package/node_modules/@aws-sdk/core/dist-types/submodules/protocols/json/codec-v2/JsonCodec2.d.ts +0 -13
  477. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/json/JsonSettings.d.ts +0 -4
  478. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/json/codec-v1/JsonCodec.d.ts +0 -11
  479. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/json/codec-v1/JsonSettings.d.ts +0 -4
  480. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/json/codec-v1/JsonShapeDeserializer.d.ts +0 -13
  481. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/json/codec-v1/JsonShapeSerializer.d.ts +0 -18
  482. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/json/codec-v2/JsonBytesStringAdapter.d.ts +0 -27
  483. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/json/codec-v2/JsonCodec2.d.ts +0 -9
  484. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/json/codec-v2/JsonShapeDeserializer2.d.ts +0 -15
  485. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/json/codec-v2/JsonShapeSerializer2.d.ts +0 -39
  486. package/node_modules/@bufbuild/protobuf/dist/commonjs/reflect/message.d.ts +0 -49
  487. package/node_modules/@bufbuild/protobuf/dist/commonjs/reflect/message.js +0 -157
  488. package/node_modules/@bufbuild/protobuf/dist/commonjs/wkt/json.d.ts +0 -28
  489. package/node_modules/@bufbuild/protobuf/dist/commonjs/wkt/json.js +0 -44
  490. package/node_modules/@bufbuild/protobuf/dist/esm/reflect/message.d.ts +0 -49
  491. package/node_modules/@bufbuild/protobuf/dist/esm/reflect/message.js +0 -152
  492. package/node_modules/@bufbuild/protobuf/dist/esm/wkt/json.d.ts +0 -28
  493. package/node_modules/@bufbuild/protobuf/dist/esm/wkt/json.js +0 -41
  494. package/node_modules/@smithy/core/dist-es/submodules/cbor/codec-v1/CborShapeDeserializer.js +0 -113
  495. package/node_modules/@smithy/core/dist-es/submodules/cbor/codec-v1/CborShapeSerializer.js +0 -103
  496. package/node_modules/@smithy/core/dist-es/submodules/cbor/codec-v2/CborShapeDeserializer2.js +0 -621
  497. package/node_modules/@smithy/core/dist-es/submodules/cbor/codec-v2/CborShapeSerializer2.js +0 -602
  498. package/node_modules/@smithy/core/dist-types/submodules/cbor/codec-v1/CborShapeDeserializer.d.ts +0 -13
  499. package/node_modules/@smithy/core/dist-types/submodules/cbor/codec-v1/CborShapeSerializer.d.ts +0 -15
  500. package/node_modules/@smithy/core/dist-types/submodules/cbor/codec-v2/CborShapeDeserializer2.d.ts +0 -18
  501. package/node_modules/@smithy/core/dist-types/submodules/cbor/codec-v2/CborShapeSerializer2.d.ts +0 -35
  502. package/node_modules/@smithy/core/dist-types/ts3.4/submodules/cbor/codec-v1/CborShapeDeserializer.d.ts +0 -13
  503. package/node_modules/@smithy/core/dist-types/ts3.4/submodules/cbor/codec-v1/CborShapeSerializer.d.ts +0 -15
  504. package/node_modules/@smithy/core/dist-types/ts3.4/submodules/cbor/codec-v2/CborShapeDeserializer2.d.ts +0 -18
  505. package/node_modules/@smithy/core/dist-types/ts3.4/submodules/cbor/codec-v2/CborShapeSerializer2.d.ts +0 -35
@@ -14,18 +14,13 @@
14
14
  import { ScalarType, } from "./descriptors.js";
15
15
  import { protoInt64 } from "./proto-int64.js";
16
16
  import { create } from "./create.js";
17
+ import { reflect } from "./reflect/reflect.js";
17
18
  import { FieldError, isFieldError } from "./reflect/error.js";
18
- import { formatVal, reasonSingular, checkScalarValue, } from "./reflect/reflect-check.js";
19
+ import { formatVal } from "./reflect/reflect-check.js";
19
20
  import { protoSnakeCase } from "./reflect/names.js";
20
- import { scalarZeroValue } from "./reflect/scalar.js";
21
- import { unsafeLocal } from "./reflect/unsafe.js";
22
- import { localMessageMapper } from "./reflect/message.js";
23
21
  import { base64Decode } from "./wire/base64-encoding.js";
24
22
  import { hasCustomJsonRepresentation, isWrapperDesc, anyPack, ListValueSchema, NullValue, StructSchema, ValueSchema, } from "./wkt/index.js";
25
23
  import { createExtensionContainer, setExtension } from "./extensions.js";
26
- import { durationSecondsMax, durationSecondsMin, timestampMsMax, timestampMsMin, } from "./wkt/json.js";
27
- // bootstrap-inject google.protobuf.FeatureSet.FieldPresence.IMPLICIT: const $name = $number;
28
- const IMPLICIT = 2;
29
24
  function makeReadContext(options) {
30
25
  return Object.assign(Object.assign({ ignoreUnknownFields: false, recursionLimit: 100 }, options), { depth: 0 });
31
26
  }
@@ -59,9 +54,20 @@ export function mergeFromJsonString(schema, target, json, options) {
59
54
  * duplicate-key checking.
60
55
  */
61
56
  export function fromJson(schema, json, options) {
62
- const message = create(schema);
63
- readMessage(schema, message, json, options);
64
- return message;
57
+ const msg = reflect(schema);
58
+ try {
59
+ readMessage(msg, json, makeReadContext(options));
60
+ }
61
+ catch (e) {
62
+ if (isFieldError(e)) {
63
+ // @ts-expect-error we use the ES2022 error CTOR option "cause" for better stack traces
64
+ throw new Error(`cannot decode ${e.field()} from JSON: ${e.message}`, {
65
+ cause: e,
66
+ });
67
+ }
68
+ throw e;
69
+ }
70
+ return msg.message;
65
71
  }
66
72
  /**
67
73
  * Parse a message from a JSON value, merging fields into the target.
@@ -76,20 +82,8 @@ export function fromJson(schema, json, options) {
76
82
  * for strict checking.
77
83
  */
78
84
  export function mergeFromJson(schema, target, json, options) {
79
- if (target.$typeName !== schema.typeName &&
80
- schema.fields.length > 0) {
81
- throw new FieldError(schema.fields[0], `cannot use ${schema.fields[0]} with message ${target.$typeName}`, "ForeignFieldError");
82
- }
83
- readMessage(schema, target, json, options);
84
- return target;
85
- }
86
- /**
87
- * Run the compiled decoder for the message, wrapping FieldErrors with the
88
- * standard error message.
89
- */
90
- function readMessage(schema, message, json, options) {
91
85
  try {
92
- compiledReader(schema)(message, json, makeReadContext(options));
86
+ readMessage(reflect(schema, target), json, makeReadContext(options));
93
87
  }
94
88
  catch (e) {
95
89
  if (isFieldError(e)) {
@@ -100,14 +94,13 @@ function readMessage(schema, message, json, options) {
100
94
  }
101
95
  throw e;
102
96
  }
97
+ return target;
103
98
  }
104
99
  /**
105
100
  * Parses an enum value from JSON.
106
101
  */
107
102
  export function enumFromJson(descEnum, json) {
108
- // With ignoreUnknownFields false, the converter never returns the token
109
- // for ignored unknown enum values.
110
- return compileEnumConverter(descEnum)(json, false);
103
+ return readEnum(descEnum, json, false);
111
104
  }
112
105
  /**
113
106
  * Is the given value a JSON enum value?
@@ -115,646 +108,315 @@ export function enumFromJson(descEnum, json) {
115
108
  export function isEnumJson(descEnum, value) {
116
109
  return undefined !== descEnum.values.find((v) => v.name === value);
117
110
  }
118
- const compiledReaders = new WeakMap();
119
- /**
120
- * Return the compiled decoder for a message, compiling it on first use.
121
- */
122
- function compiledReader(desc) {
123
- let compiled = compiledReaders.get(desc);
124
- if (compiled === undefined) {
125
- compiled = compileMessage(desc);
111
+ const messageJsonFields = new WeakMap();
112
+ function getJsonField(desc, jsonKey) {
113
+ var _a;
114
+ if (!messageJsonFields.has(desc)) {
115
+ const jsonNames = new Map();
116
+ for (const field of desc.fields) {
117
+ jsonNames.set(field.name, field).set(field.jsonName, field);
118
+ }
119
+ messageJsonFields.set(desc, jsonNames);
126
120
  }
127
- return compiled;
121
+ return (_a = messageJsonFields.get(desc)) === null || _a === void 0 ? void 0 : _a.get(jsonKey);
128
122
  }
129
- function compileMessage(desc) {
130
- const descString = String(desc);
131
- const readWkt = compileWkt(desc);
132
- if (readWkt !== undefined) {
133
- // All message decoders count against the recursion limit, including
134
- // well-known types with a custom JSON representation.
135
- const compiled = (message, json, ctx) => {
136
- if (++ctx.depth > ctx.recursionLimit) {
137
- throw new Error(`cannot decode ${descString} from JSON: maximum recursion depth of ${ctx.recursionLimit} reached`);
138
- }
139
- readWkt(message, json, ctx);
140
- ctx.depth--;
141
- };
142
- compiledReaders.set(desc, compiled);
143
- return compiled;
123
+ function readMessage(msg, json, ctx) {
124
+ var _a;
125
+ if (++ctx.depth > ctx.recursionLimit) {
126
+ throw new Error(`cannot decode ${msg.desc} from JSON: maximum recursion depth of ${ctx.recursionLimit} reached`);
144
127
  }
145
- const typeName = desc.typeName;
146
- // Fields are looked up by their proto name and their JSON name.
147
- const fieldsByJsonKey = new Map();
148
- const compiled = (message, json, ctx) => {
149
- var _a;
150
- if (++ctx.depth > ctx.recursionLimit) {
151
- throw new Error(`cannot decode ${descString} from JSON: maximum recursion depth of ${ctx.recursionLimit} reached`);
152
- }
153
- if (json == null || Array.isArray(json) || typeof json != "object") {
154
- throw new Error(`cannot decode ${descString} from JSON: ${formatVal(json)}`);
155
- }
156
- const oneofSeen = new Map();
157
- const fieldSeen = new Set();
158
- const jsonKeys = Object.keys(json);
159
- for (let i = 0; i < jsonKeys.length; i++) {
160
- const jsonKey = jsonKeys[i];
161
- const jsonValue = json[jsonKey];
162
- const entry = fieldsByJsonKey.get(jsonKey);
163
- if (entry !== undefined) {
164
- const field = entry.field;
165
- if (fieldSeen.has(field)) {
166
- // The same field may be set by its proto name and its JSON name, or by
167
- // a duplicate or unicode-escaped key that JSON.parse already collapsed.
168
- // Checked before the null-skip below so that a null entry still counts.
169
- throw new FieldError(field, "set multiple times");
170
- }
171
- fieldSeen.add(field);
172
- if (entry.oneofScalarNullSkip && jsonValue === null) {
173
- continue;
174
- }
175
- if (entry.oneof) {
176
- const seen = oneofSeen.get(entry.oneof);
177
- if (seen !== undefined) {
178
- throw new FieldError(entry.oneof, `oneof set multiple times by ${seen.name} and ${field.name}`);
179
- }
180
- oneofSeen.set(entry.oneof, field);
181
- }
182
- entry.read(message, jsonValue, ctx);
128
+ if (tryWktFromJson(msg, json, ctx)) {
129
+ ctx.depth--;
130
+ return;
131
+ }
132
+ if (json == null || Array.isArray(json) || typeof json != "object") {
133
+ throw new Error(`cannot decode ${msg.desc} from JSON: ${formatVal(json)}`);
134
+ }
135
+ const oneofSeen = new Map();
136
+ const fieldSeen = new Set();
137
+ for (const [jsonKey, jsonValue] of Object.entries(json)) {
138
+ const field = getJsonField(msg.desc, jsonKey);
139
+ if (field) {
140
+ if (fieldSeen.has(field)) {
141
+ // The same field may be set by its proto name and its JSON name, or by
142
+ // a duplicate or unicode-escaped key that JSON.parse already collapsed.
143
+ // Checked before the null-skip below so that a null entry still counts.
144
+ throw new FieldError(field, "set multiple times");
183
145
  }
184
- else {
185
- const extension = jsonKey.startsWith("[") && jsonKey.endsWith("]")
186
- ? (_a = ctx.registry) === null || _a === void 0 ? void 0 : _a.getExtension(jsonKey.substring(1, jsonKey.length - 1))
187
- : undefined;
188
- if ((extension === null || extension === void 0 ? void 0 : extension.extendee.typeName) == typeName) {
189
- const [container, field, get] = createExtensionContainer(extension);
190
- compileFieldReader(field)(container[unsafeLocal], jsonValue, ctx);
191
- setExtension(message, extension, get());
192
- }
193
- if (extension === undefined && !ctx.ignoreUnknownFields) {
194
- throw new Error(`cannot decode ${descString} from JSON: key "${jsonKey}" is unknown`);
146
+ fieldSeen.add(field);
147
+ if (field.oneof && jsonValue === null && field.fieldKind == "scalar") {
148
+ // see conformance test Required.Proto3.JsonInput.OneofFieldNull{First,Second}
149
+ continue;
150
+ }
151
+ if (field.oneof) {
152
+ const seen = oneofSeen.get(field.oneof);
153
+ if (seen !== undefined) {
154
+ throw new FieldError(field.oneof, `oneof set multiple times by ${seen.name} and ${field.name}`);
195
155
  }
156
+ oneofSeen.set(field.oneof, field);
196
157
  }
158
+ readField(msg, field, jsonValue, ctx);
197
159
  }
198
- ctx.depth--;
199
- };
200
- // Register before compiling fields, so that recursive message types
201
- // resolve to this instance instead of compiling endlessly.
202
- compiledReaders.set(desc, compiled);
203
- for (const field of desc.fields) {
204
- const entry = {
205
- read: compileFieldReader(field),
206
- field,
207
- oneof: field.oneof,
208
- oneofScalarNullSkip: field.oneof !== undefined && field.fieldKind == "scalar",
209
- };
210
- fieldsByJsonKey.set(field.name, entry).set(field.jsonName, entry);
211
- }
212
- return compiled;
213
- }
214
- /**
215
- * Compile a decoder for a well-known type with a custom JSON representation,
216
- * or return undefined for other messages. The recursion limit is enforced by
217
- * the caller.
218
- */
219
- function compileWkt(desc) {
220
- if (!desc.typeName.startsWith("google.protobuf.")) {
221
- return undefined;
222
- }
223
- switch (desc.typeName) {
224
- case "google.protobuf.Any":
225
- return (message, json, ctx) => anyFromJson(message, json, ctx);
226
- case "google.protobuf.Timestamp":
227
- return (message, json) => timestampFromJson(message, json);
228
- case "google.protobuf.Duration":
229
- return (message, json) => durationFromJson(message, json);
230
- case "google.protobuf.FieldMask":
231
- return (message, json) => fieldMaskFromJson(message, json);
232
- case "google.protobuf.Struct":
233
- return (message, json, ctx) => structFromJson(message, json, ctx);
234
- case "google.protobuf.Value":
235
- return (message, json, ctx) => valueFromJson(message, json, ctx);
236
- case "google.protobuf.ListValue":
237
- return (message, json, ctx) => listValueFromJson(message, json, ctx);
238
- default:
239
- if (isWrapperDesc(desc)) {
240
- const valueField = desc.fields[0];
241
- const localName = valueField.localName;
242
- const scalar = valueField.scalar;
243
- const longAsString = valueField.longAsString;
244
- const readScalar = compileScalarConverter(valueField);
245
- return (message, json) => {
246
- if (json === null) {
247
- message[localName] = scalarZeroValue(scalar, longAsString);
248
- }
249
- else {
250
- message[localName] = readScalar(json);
251
- }
252
- };
160
+ else {
161
+ let extension = undefined;
162
+ if (jsonKey.startsWith("[") &&
163
+ jsonKey.endsWith("]") &&
164
+ // biome-ignore lint/suspicious/noAssignInExpressions: no
165
+ (extension = (_a = ctx.registry) === null || _a === void 0 ? void 0 : _a.getExtension(jsonKey.substring(1, jsonKey.length - 1))) &&
166
+ extension.extendee.typeName === msg.desc.typeName) {
167
+ const [container, field, get] = createExtensionContainer(extension);
168
+ readField(container, field, jsonValue, ctx);
169
+ setExtension(msg.message, extension, get());
253
170
  }
254
- return undefined;
171
+ if (!extension && !ctx.ignoreUnknownFields) {
172
+ throw new Error(`cannot decode ${msg.desc} from JSON: key "${jsonKey}" is unknown`);
173
+ }
174
+ }
255
175
  }
176
+ ctx.depth--;
256
177
  }
257
- function compileFieldReader(field) {
178
+ function readField(msg, field, json, ctx) {
258
179
  switch (field.fieldKind) {
259
180
  case "scalar":
260
- return compileScalarFieldReader(field);
181
+ readScalarField(msg, field, json);
182
+ break;
261
183
  case "enum":
262
- return compileEnumFieldReader(field);
184
+ readEnumField(msg, field, json, ctx);
185
+ break;
263
186
  case "message":
264
- return compileMessageFieldReader(field);
187
+ readMessageField(msg, field, json, ctx);
188
+ break;
265
189
  case "list":
266
- return compileListFieldReader(field);
190
+ readListField(msg.get(field), json, ctx);
191
+ break;
267
192
  case "map":
268
- return compileMapFieldReader(field);
193
+ readMapField(msg.get(field), json, ctx);
194
+ break;
269
195
  }
270
196
  }
271
- function compileScalarFieldReader(field) {
272
- const readScalar = compileScalarConverter(field);
273
- const localName = field.localName;
274
- if (field.oneof) {
275
- // JSON null for a oneof scalar member is skipped by the message decoder.
276
- const oneofLocalName = field.oneof.localName;
277
- return (message, json) => {
278
- message[oneofLocalName] = {
279
- case: localName,
280
- value: readScalar(json),
281
- };
282
- };
197
+ function readListOrMapItem(field, json, ctx) {
198
+ if (field.scalar && json !== null) {
199
+ return scalarFromJson(field, json);
283
200
  }
284
- const clear = compileClear(field);
285
- return (message, json) => {
286
- if (json === null) {
287
- clear(message);
288
- }
289
- else {
290
- message[localName] = readScalar(json);
291
- }
292
- };
293
- }
294
- /**
295
- * Compile a function that resets the field to unset, mirroring the clear
296
- * operation of the reflect API for fields that are not part of a oneof.
297
- */
298
- function compileClear(field) {
299
- const localName = field.localName;
300
- if (field.presence != IMPLICIT) {
301
- // Fields with explicit presence have properties on the prototype chain
302
- // for default / zero values (except for proto3). By deleting their own
303
- // property, the field is reset.
304
- return (message) => {
305
- delete message[localName];
306
- };
201
+ if (field.message && !isResetSentinelNullValue(field, json)) {
202
+ const msgValue = reflect(field.message);
203
+ readMessage(msgValue, json, ctx);
204
+ return msgValue;
307
205
  }
308
- if (field.fieldKind == "enum") {
309
- const zero = field.enum.values[0].number;
310
- return (message) => {
311
- message[localName] = zero;
312
- };
206
+ if (field.enum && !isResetSentinelNullValue(field, json)) {
207
+ return readEnum(field.enum, json, ctx.ignoreUnknownFields);
313
208
  }
314
- const scalar = field.scalar;
315
- const longAsString = field.longAsString;
316
- return (message) => {
317
- message[localName] = scalarZeroValue(scalar, longAsString);
318
- };
209
+ throw new FieldError(field, `${field.fieldKind === "list" ? "list item" : "map value"} must not be null`);
319
210
  }
320
- function compileEnumFieldReader(field) {
321
- const readEnumValue = compileEnumConverter(field.enum);
322
- const checkEnum = compileEnumCheck(field.enum);
323
- const localName = field.localName;
324
- // Fields with enum google.protobuf.NullValue permit a Protobuf-serializable
325
- // null; for all other enums, JSON null resets the field.
326
- const nullResets = field.enum.typeName != "google.protobuf.NullValue";
327
- if (field.oneof) {
328
- const oneofLocalName = field.oneof.localName;
329
- return (message, json, ctx) => {
330
- if (json === null && nullResets) {
331
- const oneof = message[oneofLocalName];
332
- if (oneof.case === localName) {
333
- message[oneofLocalName] = { case: undefined };
334
- }
335
- return;
336
- }
337
- const value = readEnumValue(json, ctx.ignoreUnknownFields);
338
- if (value === tokenIgnoredUnknownEnum) {
339
- return;
340
- }
341
- const check = checkEnum(value);
342
- if (check !== true) {
343
- throw new FieldError(field, reasonSingular(field, value, check));
344
- }
345
- message[oneofLocalName] = { case: localName, value };
346
- };
211
+ function readMapField(map, json, ctx) {
212
+ if (json === null) {
213
+ return;
347
214
  }
348
- const clear = compileClear(field);
349
- return (message, json, ctx) => {
350
- if (json === null && nullResets) {
351
- clear(message);
352
- return;
353
- }
354
- const value = readEnumValue(json, ctx.ignoreUnknownFields);
355
- if (value === tokenIgnoredUnknownEnum) {
356
- return;
215
+ const field = map.field();
216
+ if (typeof json != "object" || Array.isArray(json)) {
217
+ throw new FieldError(field, "expected object, got " + formatVal(json));
218
+ }
219
+ const seen = new Set();
220
+ for (const [jsonMapKey, jsonMapValue] of Object.entries(json)) {
221
+ const key = mapKeyFromJson(field.mapKey, jsonMapKey);
222
+ if (seen.has(key)) {
223
+ throw new FieldError(field, `duplicate map key "${jsonMapKey}"`);
357
224
  }
358
- const check = checkEnum(value);
359
- if (check !== true) {
360
- throw new FieldError(field, reasonSingular(field, value, check));
225
+ seen.add(key);
226
+ const value = readListOrMapItem(field, jsonMapValue, ctx);
227
+ if (value !== tokenIgnoredUnknownEnum) {
228
+ map.set(key, value);
361
229
  }
362
- message[localName] = value;
363
- };
230
+ }
364
231
  }
365
- function compileMessageFieldReader(field) {
366
- const localName = field.localName;
367
- const { toMessage, toLocal } = localMessageMapper(field);
368
- const readChild = compiledReader(field.message);
369
- // Fields with message google.protobuf.Value permit a Protobuf-serializable
370
- // null; for all other messages, JSON null resets the field.
371
- const nullResets = field.message.typeName != "google.protobuf.Value";
372
- if (field.oneof) {
373
- const oneofLocalName = field.oneof.localName;
374
- return (message, json, ctx) => {
375
- const oneof = message[oneofLocalName];
376
- if (json === null && nullResets) {
377
- if (oneof.case === localName) {
378
- message[oneofLocalName] = { case: undefined };
379
- }
380
- return;
381
- }
382
- const child = toMessage(oneof.case === localName ? oneof.value : undefined);
383
- readChild(child, json, ctx);
384
- message[oneofLocalName] = { case: localName, value: toLocal(child) };
385
- };
232
+ function readListField(list, json, ctx) {
233
+ if (json === null) {
234
+ return;
386
235
  }
387
- return (message, json, ctx) => {
388
- if (json === null && nullResets) {
389
- delete message[localName];
390
- return;
236
+ const field = list.field();
237
+ if (!Array.isArray(json)) {
238
+ throw new FieldError(field, "expected Array, got " + formatVal(json));
239
+ }
240
+ for (const jsonItem of json) {
241
+ const value = readListOrMapItem(field, jsonItem, ctx);
242
+ if (value !== tokenIgnoredUnknownEnum) {
243
+ list.add(value);
391
244
  }
392
- const child = toMessage(message[localName]);
393
- readChild(child, json, ctx);
394
- message[localName] = toLocal(child);
395
- };
245
+ }
396
246
  }
397
- function compileListFieldReader(field) {
398
- const localName = field.localName;
399
- const readItem = compileListItemReader(field);
400
- return (message, json, ctx) => {
401
- if (json === null) {
402
- return;
403
- }
404
- if (!Array.isArray(json)) {
405
- throw new FieldError(field, "expected Array, got " + formatVal(json));
406
- }
407
- const items = message[localName];
408
- for (let i = 0; i < json.length; i++) {
409
- const value = readItem(json[i], ctx, items.length);
410
- if (value !== tokenIgnoredUnknownEnum) {
411
- items.push(value);
412
- }
413
- }
414
- };
247
+ function readMessageField(msg, field, json, ctx) {
248
+ if (isResetSentinelNullValue(field, json)) {
249
+ msg.clear(field);
250
+ return;
251
+ }
252
+ const msgValue = msg.isSet(field) ? msg.get(field) : reflect(field.message);
253
+ readMessage(msgValue, json, ctx);
254
+ msg.set(field, msgValue);
415
255
  }
416
- /**
417
- * Compile a decoder for a list item. The index is only used in errors, and
418
- * accounts for previously merged items.
419
- */
420
- function compileListItemReader(field) {
421
- switch (field.listKind) {
422
- case "scalar": {
423
- const parseScalar = compileScalarParse(field);
424
- const checkValue = checkScalarValue(field.scalar);
425
- const toLocal = compileScalarToLocal(field);
426
- return (json, ctx, index) => {
427
- if (json === null) {
428
- throw new FieldError(field, "list item must not be null");
429
- }
430
- const value = parseScalar(json);
431
- const check = checkValue(value);
432
- if (check !== true) {
433
- throw new FieldError(field, `list item #${index + 1}: ${reasonSingular(field, value, check)}`);
434
- }
435
- return toLocal(value);
436
- };
437
- }
438
- case "enum": {
439
- const readEnumValue = compileEnumConverter(field.enum);
440
- const checkEnum = compileEnumCheck(field.enum);
441
- const nullResets = field.enum.typeName != "google.protobuf.NullValue";
442
- return (json, ctx, index) => {
443
- if (json === null && nullResets) {
444
- throw new FieldError(field, "list item must not be null");
445
- }
446
- const value = readEnumValue(json, ctx.ignoreUnknownFields);
447
- if (value === tokenIgnoredUnknownEnum) {
448
- return value;
449
- }
450
- const check = checkEnum(value);
451
- if (check !== true) {
452
- throw new FieldError(field, `list item #${index + 1}: ${reasonSingular(field, value, check)}`);
453
- }
454
- return value;
455
- };
456
- }
457
- case "message": {
458
- const { toMessage, toLocal } = localMessageMapper(field);
459
- const readChild = compiledReader(field.message);
460
- const nullResets = field.message.typeName != "google.protobuf.Value";
461
- return (json, ctx) => {
462
- if (json === null && nullResets) {
463
- throw new FieldError(field, "list item must not be null");
464
- }
465
- const child = toMessage(undefined);
466
- readChild(child, json, ctx);
467
- return toLocal(child);
468
- };
469
- }
256
+ function readEnumField(msg, field, json, ctx) {
257
+ if (isResetSentinelNullValue(field, json)) {
258
+ msg.clear(field);
259
+ return;
260
+ }
261
+ const enumValue = readEnum(field.enum, json, ctx.ignoreUnknownFields);
262
+ if (enumValue !== tokenIgnoredUnknownEnum) {
263
+ msg.set(field, enumValue);
470
264
  }
471
265
  }
472
- function compileMapFieldReader(field) {
473
- const localName = field.localName;
474
- const mapKey = field.mapKey;
475
- const parseMapKey = compileMapKeyParse(mapKey);
476
- const checkMapKey = checkScalarValue(mapKey);
477
- let parseValue;
478
- // Additional validation for scalar and enum values, matching the checks
479
- // of the reflect API. Message values need no validation.
480
- let checkValue;
481
- let toLocalValue = (value) => value;
482
- // Fields with google.protobuf.Value or google.protobuf.NullValue values
483
- // permit a Protobuf-serializable null.
484
- let nullResets = true;
485
- switch (field.mapKind) {
486
- case "scalar": {
487
- parseValue = compileScalarParse(field);
488
- checkValue = checkScalarValue(field.scalar);
489
- toLocalValue = compileScalarToLocal(field);
490
- break;
491
- }
492
- case "enum": {
493
- const readEnumValue = compileEnumConverter(field.enum);
494
- parseValue = (json, ctx) => readEnumValue(json, ctx.ignoreUnknownFields);
495
- checkValue = compileEnumCheck(field.enum);
496
- nullResets = field.enum.typeName != "google.protobuf.NullValue";
497
- break;
498
- }
499
- case "message": {
500
- const { toMessage, toLocal } = localMessageMapper(field);
501
- const readChild = compiledReader(field.message);
502
- nullResets = field.message.typeName != "google.protobuf.Value";
503
- parseValue = (json, ctx) => {
504
- const child = toMessage(undefined);
505
- readChild(child, json, ctx);
506
- return toLocal(child);
507
- };
508
- break;
509
- }
266
+ function readScalarField(msg, field, json) {
267
+ if (json === null) {
268
+ msg.clear(field);
269
+ }
270
+ else {
271
+ msg.set(field, scalarFromJson(field, json));
510
272
  }
511
- return (message, json, ctx) => {
512
- if (json === null) {
513
- return;
514
- }
515
- if (typeof json != "object" || Array.isArray(json)) {
516
- throw new FieldError(field, "expected object, got " + formatVal(json));
517
- }
518
- const record = message[localName];
519
- const seen = new Set();
520
- const jsonMapKeys = Object.keys(json);
521
- for (let i = 0; i < jsonMapKeys.length; i++) {
522
- const jsonMapKey = jsonMapKeys[i];
523
- const jsonMapValue = json[jsonMapKey];
524
- const key = parseMapKey(jsonMapKey);
525
- if (seen.has(key)) {
526
- throw new FieldError(field, `duplicate map key "${jsonMapKey}"`);
527
- }
528
- seen.add(key);
529
- if (jsonMapValue === null && nullResets) {
530
- throw new FieldError(field, "map value must not be null");
531
- }
532
- const value = parseValue(jsonMapValue, ctx);
533
- if (value === tokenIgnoredUnknownEnum) {
534
- continue;
535
- }
536
- const checkKey = checkMapKey(key);
537
- if (checkKey !== true) {
538
- throw new FieldError(field, `invalid map key: ${reasonSingular({ scalar: mapKey }, key, checkKey)}`);
539
- }
540
- if (checkValue !== undefined) {
541
- const check = checkValue(value);
542
- if (check !== true) {
543
- throw new FieldError(field, `map entry ${formatVal(key)}: ${reasonSingular(field, value, check)}`);
544
- }
545
- }
546
- // Object property keys are always strings or symbols. Assigning with a
547
- // boolean, number, or bigint key implicitly converts it to a string.
548
- record[key] = toLocalValue(value);
549
- }
550
- };
551
273
  }
552
- const tokenIgnoredUnknownEnum = Symbol();
553
274
  /**
554
- * Compile a converter from a JSON value to an enum value. JSON null returns
555
- * the enum's first value. With ignoreUnknownFields false, unknown string
556
- * values raise an error; with true, they return tokenIgnoredUnknownEnum.
557
- * The value is not checked against the enum's values, see compileEnumCheck.
275
+ * Indicates whether a value is a sentinel for reseting a field.
276
+ *
277
+ * For this to be true, the value must be a JSON null and the field must not
278
+ * permit a present, Protobuf-serializable null.
279
+ *
280
+ * Only message google.protobuf.Value and enum google.protobuf.NullValue fields
281
+ * permit Protobuf-serializable nulls.
282
+ *
283
+ * Note that field-resetting sentinel nulls are not permitted in lists and maps.
558
284
  */
559
- function compileEnumConverter(desc) {
560
- const zero = desc.values[0].number;
561
- const values = desc.values;
562
- return (json, ignoreUnknownFields) => {
563
- if (json === null) {
564
- return zero;
565
- }
566
- switch (typeof json) {
567
- case "number":
568
- if (Number.isInteger(json)) {
569
- return json;
570
- }
571
- break;
572
- case "string": {
573
- const value = values.find((ev) => ev.name === json);
574
- if (value !== undefined) {
575
- return value.number;
576
- }
577
- if (ignoreUnknownFields) {
578
- return tokenIgnoredUnknownEnum;
579
- }
580
- break;
581
- }
582
- }
583
- throw new Error(`cannot decode ${desc} from JSON: ${formatVal(json)}`);
584
- };
285
+ function isResetSentinelNullValue(field, json) {
286
+ var _a, _b;
287
+ return (json === null &&
288
+ ((_a = field.message) === null || _a === void 0 ? void 0 : _a.typeName) != "google.protobuf.Value" &&
289
+ ((_b = field.enum) === null || _b === void 0 ? void 0 : _b.typeName) != "google.protobuf.NullValue");
585
290
  }
586
- /**
587
- * Compile the check that the reflect API performs for enum values: open
588
- * enums accept any int32 value, closed enums accept only declared values.
589
- */
590
- function compileEnumCheck(desc) {
591
- if (desc.open) {
592
- return checkScalarValue(ScalarType.INT32);
291
+ const tokenIgnoredUnknownEnum = Symbol();
292
+ function readEnum(desc, json, ignoreUnknownFields) {
293
+ if (json === null) {
294
+ return desc.values[0].number;
593
295
  }
594
- const values = desc.values;
595
- return (value) => values.some((v) => v.number === value);
596
- }
597
- /**
598
- * Compile a converter from a JSON value to the local representation of a
599
- * scalar, fusing JSON parsing, the validation of the reflect API, and the
600
- * conversion to the local 64-bit integer representation.
601
- */
602
- function compileScalarConverter(field) {
603
- const parseScalar = compileScalarParse(field);
604
- const checkValue = checkScalarValue(field.scalar);
605
- const toLocal = compileScalarToLocal(field);
606
- return (json) => {
607
- const value = parseScalar(json);
608
- const check = checkValue(value);
609
- if (check !== true) {
610
- throw new FieldError(field, reasonSingular(field, value, check));
611
- }
612
- return toLocal(value);
613
- };
296
+ switch (typeof json) {
297
+ case "number":
298
+ if (Number.isInteger(json)) {
299
+ return json;
300
+ }
301
+ break;
302
+ case "string":
303
+ const value = desc.values.find((ev) => ev.name === json);
304
+ if (value !== undefined) {
305
+ return value.number;
306
+ }
307
+ if (ignoreUnknownFields) {
308
+ return tokenIgnoredUnknownEnum;
309
+ }
310
+ break;
311
+ }
312
+ throw new Error(`cannot decode ${desc} from JSON: ${formatVal(json)}`);
614
313
  }
615
314
  /**
616
- * Compile the JSON-specific parsing step for a scalar value: the special
617
- * string values of float and double, string-encoded numbers, and base64
618
- * bytes. Returns the input unchanged if the JSON value cannot be converted;
619
- * the validation step raises an error for it.
315
+ * Try to parse a JSON value to a scalar value for the reflect API.
316
+ *
317
+ * Returns the input if the JSON value cannot be converted. Raises a FieldError
318
+ * if conversion would be ambiguous.
620
319
  */
621
- function compileScalarParse(field) {
320
+ function scalarFromJson(field, json) {
321
+ // int64, sfixed64, sint64, fixed64, uint64: Reflect supports string and number.
322
+ // string, bool: Supported by reflect.
622
323
  switch (field.scalar) {
623
324
  // float, double: JSON value will be a number or one of the special string values "NaN", "Infinity", and "-Infinity".
624
325
  // Either numbers or strings are accepted. Exponent notation is also accepted.
625
326
  case ScalarType.DOUBLE:
626
327
  case ScalarType.FLOAT:
627
- return (json) => {
628
- if (json === "NaN")
629
- return NaN;
630
- if (json === "Infinity")
631
- return Number.POSITIVE_INFINITY;
632
- if (json === "-Infinity")
633
- return Number.NEGATIVE_INFINITY;
634
- if (typeof json == "number") {
635
- if (Number.isNaN(json)) {
636
- // NaN must be encoded with string constants
637
- throw new FieldError(field, "unexpected NaN number");
638
- }
639
- if (!Number.isFinite(json)) {
640
- // Infinity must be encoded with string constants
641
- throw new FieldError(field, "unexpected infinite number");
642
- }
643
- return json;
328
+ if (json === "NaN")
329
+ return NaN;
330
+ if (json === "Infinity")
331
+ return Number.POSITIVE_INFINITY;
332
+ if (json === "-Infinity")
333
+ return Number.NEGATIVE_INFINITY;
334
+ if (typeof json == "number") {
335
+ if (Number.isNaN(json)) {
336
+ // NaN must be encoded with string constants
337
+ throw new FieldError(field, "unexpected NaN number");
644
338
  }
645
- if (typeof json == "string") {
646
- if (json === "") {
647
- // empty string is not a number
648
- return json;
649
- }
650
- if (json.trim().length !== json.length) {
651
- // extra whitespace
652
- return json;
653
- }
654
- const float = Number(json);
655
- if (!Number.isFinite(float)) {
656
- // Infinity and NaN must be encoded with string constants
657
- return json;
658
- }
659
- return float;
339
+ if (!Number.isFinite(json)) {
340
+ // Infinity must be encoded with string constants
341
+ throw new FieldError(field, "unexpected infinite number");
660
342
  }
661
- return json;
662
- };
343
+ break;
344
+ }
345
+ if (typeof json == "string") {
346
+ if (json === "") {
347
+ // empty string is not a number
348
+ break;
349
+ }
350
+ if (json.trim().length !== json.length) {
351
+ // extra whitespace
352
+ break;
353
+ }
354
+ const float = Number(json);
355
+ if (!Number.isFinite(float)) {
356
+ // Infinity and NaN must be encoded with string constants
357
+ break;
358
+ }
359
+ return float;
360
+ }
361
+ break;
663
362
  // int32, fixed32, uint32: JSON value will be a decimal number. Either numbers or strings are accepted.
664
363
  case ScalarType.INT32:
665
364
  case ScalarType.FIXED32:
666
365
  case ScalarType.SFIXED32:
667
366
  case ScalarType.SINT32:
668
367
  case ScalarType.UINT32:
669
- return int32FromJson;
368
+ return int32FromJson(json);
670
369
  // bytes: JSON value will be the data encoded as a string using standard base64 encoding with paddings.
671
370
  // Either standard or URL-safe base64 encoding with/without paddings are accepted.
672
371
  case ScalarType.BYTES:
673
- return (json) => {
674
- if (typeof json == "string") {
675
- if (json === "") {
676
- return new Uint8Array(0);
677
- }
678
- try {
679
- return base64Decode(json);
680
- }
681
- catch (e) {
682
- const message = e instanceof Error ? e.message : String(e);
683
- throw new FieldError(field, message);
684
- }
372
+ if (typeof json == "string") {
373
+ if (json === "") {
374
+ return new Uint8Array(0);
375
+ }
376
+ try {
377
+ return base64Decode(json);
378
+ }
379
+ catch (e) {
380
+ const message = e instanceof Error ? e.message : String(e);
381
+ throw new FieldError(field, message);
685
382
  }
686
- return json;
687
- };
688
- // int64, sfixed64, sint64, fixed64, uint64: The validation step accepts
689
- // string and number. string, bool: no conversion.
690
- default:
691
- return (json) => json;
692
- }
693
- }
694
- /**
695
- * Compile the conversion of a validated scalar value to its local
696
- * representation: 64-bit integers become bigint, or string with the
697
- * longAsString option.
698
- */
699
- function compileScalarToLocal(field) {
700
- const longAsString = field.fieldKind !== "map" && field.longAsString;
701
- switch (field.scalar) {
702
- case ScalarType.INT64:
703
- case ScalarType.SFIXED64:
704
- case ScalarType.SINT64:
705
- if (longAsString) {
706
- return (value) => String(value);
707
- }
708
- return (value) => typeof value == "string" || typeof value == "number"
709
- ? protoInt64.parse(value)
710
- : value;
711
- case ScalarType.FIXED64:
712
- case ScalarType.UINT64:
713
- if (longAsString) {
714
- return (value) => String(value);
715
383
  }
716
- return (value) => typeof value == "string" || typeof value == "number"
717
- ? protoInt64.uParse(value)
718
- : value;
719
- default:
720
- return (value) => value;
384
+ break;
721
385
  }
386
+ return json;
722
387
  }
723
388
  /**
724
- * Return a parser from a JSON value to a map key for the given key type.
725
- * Canonicalizes 64-bit integers given as string, so that "01" and "1" are
726
- * one key, and duplicates can raise an error.
727
- * The parser returns the input if the JSON value cannot be converted.
389
+ * Try to parse a JSON value to a map key for the reflect API.
390
+ * Canonicalizes 64-bit integers given as string, so that "01 and "1" are one
391
+ * key, and duplicates can raise an error.
392
+ * Returns the input if the JSON value cannot be converted.
728
393
  */
729
- function compileMapKeyParse(type) {
394
+ function mapKeyFromJson(type, jsonString) {
730
395
  switch (type) {
731
396
  case ScalarType.BOOL:
732
- return (jsonString) => {
733
- switch (jsonString) {
734
- case "true":
735
- return true;
736
- case "false":
737
- return false;
738
- }
739
- return jsonString;
740
- };
397
+ switch (jsonString) {
398
+ case "true":
399
+ return true;
400
+ case "false":
401
+ return false;
402
+ }
403
+ return jsonString;
741
404
  case ScalarType.INT32:
742
405
  case ScalarType.FIXED32:
743
406
  case ScalarType.UINT32:
744
407
  case ScalarType.SFIXED32:
745
408
  case ScalarType.SINT32:
746
- return int32FromJson;
409
+ return int32FromJson(jsonString);
747
410
  case ScalarType.INT64:
748
411
  case ScalarType.SINT64:
749
412
  case ScalarType.SFIXED64:
750
413
  case ScalarType.UINT64:
751
414
  case ScalarType.FIXED64:
752
- return (jsonString) => /^-?0+$/.test(jsonString)
415
+ return /^-?0+$/.test(jsonString)
753
416
  ? "0"
754
417
  : jsonString.replace(/^(-?)0+(?=\d)/, "$1");
755
418
  default:
756
- // ScalarType.STRING
757
- return (jsonString) => jsonString;
419
+ return jsonString;
758
420
  }
759
421
  }
760
422
  /**
@@ -874,6 +536,46 @@ function checkDuplicateKeys(jsonString, typeName) {
874
536
  }
875
537
  }
876
538
  }
539
+ function tryWktFromJson(msg, jsonValue, ctx) {
540
+ if (!msg.desc.typeName.startsWith("google.protobuf.")) {
541
+ return false;
542
+ }
543
+ switch (msg.desc.typeName) {
544
+ case "google.protobuf.Any":
545
+ anyFromJson(msg.message, jsonValue, ctx);
546
+ return true;
547
+ case "google.protobuf.Timestamp":
548
+ timestampFromJson(msg.message, jsonValue);
549
+ return true;
550
+ case "google.protobuf.Duration":
551
+ durationFromJson(msg.message, jsonValue);
552
+ return true;
553
+ case "google.protobuf.FieldMask":
554
+ fieldMaskFromJson(msg.message, jsonValue);
555
+ return true;
556
+ case "google.protobuf.Struct":
557
+ structFromJson(msg.message, jsonValue, ctx);
558
+ return true;
559
+ case "google.protobuf.Value":
560
+ valueFromJson(msg.message, jsonValue, ctx);
561
+ return true;
562
+ case "google.protobuf.ListValue":
563
+ listValueFromJson(msg.message, jsonValue, ctx);
564
+ return true;
565
+ default:
566
+ if (isWrapperDesc(msg.desc)) {
567
+ const valueField = msg.desc.fields[0];
568
+ if (jsonValue === null) {
569
+ msg.clear(valueField);
570
+ }
571
+ else {
572
+ msg.set(valueField, scalarFromJson(valueField, jsonValue));
573
+ }
574
+ return true;
575
+ }
576
+ return false;
577
+ }
578
+ }
877
579
  function anyFromJson(any, json, ctx) {
878
580
  var _a;
879
581
  if (json === null || Array.isArray(json) || typeof json != "object") {
@@ -896,18 +598,19 @@ function anyFromJson(any, json, ctx) {
896
598
  if (!desc) {
897
599
  throw new Error(`cannot decode message ${any.$typeName} from JSON: ${typeUrl} is not in the type registry`);
898
600
  }
899
- const message = create(desc);
601
+ const msg = reflect(desc);
900
602
  if (hasCustomJsonRepresentation(desc) &&
901
603
  Object.prototype.hasOwnProperty.call(json, "value")) {
902
- compiledReader(desc)(message, json.value, ctx);
604
+ const value = json.value;
605
+ readMessage(msg, value, ctx);
903
606
  }
904
607
  else {
905
608
  const copy = Object.assign({}, json);
906
609
  // biome-ignore lint/performance/noDelete: <explanation>
907
610
  delete copy["@type"];
908
- compiledReader(desc)(message, copy, ctx);
611
+ readMessage(msg, copy, ctx);
909
612
  }
910
- anyPack(desc, message, any);
613
+ anyPack(msg.desc, msg.message, any);
911
614
  }
912
615
  function timestampFromJson(timestamp, json) {
913
616
  if (typeof json !== "string") {
@@ -923,7 +626,8 @@ function timestampFromJson(timestamp, json) {
923
626
  if (Number.isNaN(ms)) {
924
627
  throw new Error(`cannot decode message ${timestamp.$typeName} from JSON: invalid RFC 3339 string`);
925
628
  }
926
- if (ms < timestampMsMin || ms > timestampMsMax) {
629
+ if (ms < Date.parse("0001-01-01T00:00:00Z") ||
630
+ ms > Date.parse("9999-12-31T23:59:59Z")) {
927
631
  throw new Error(`cannot decode message ${timestamp.$typeName} from JSON: must be from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59Z inclusive`);
928
632
  }
929
633
  timestamp.seconds = protoInt64.parse(ms / 1000);
@@ -943,7 +647,7 @@ function durationFromJson(duration, json) {
943
647
  throw new Error(`cannot decode message ${duration.$typeName} from JSON: ${formatVal(json)}`);
944
648
  }
945
649
  const longSeconds = Number(match[1]);
946
- if (longSeconds > durationSecondsMax || longSeconds < durationSecondsMin) {
650
+ if (longSeconds > 315576000000 || longSeconds < -315576000000) {
947
651
  throw new Error(`cannot decode message ${duration.$typeName} from JSON: ${formatVal(json)}`);
948
652
  }
949
653
  duration.seconds = protoInt64.parse(longSeconds);
@@ -974,12 +678,10 @@ function structFromJson(struct, json, ctx) {
974
678
  if (typeof json != "object" || json == null || Array.isArray(json)) {
975
679
  throw new Error(`cannot decode message ${struct.$typeName} from JSON ${formatVal(json)}`);
976
680
  }
977
- const keys = Object.keys(json);
978
- for (let i = 0; i < keys.length; i++) {
979
- const key = keys[i];
980
- const parsedValue = create(ValueSchema);
981
- valueFromJson(parsedValue, json[key], ctx);
982
- struct.fields[key] = parsedValue;
681
+ for (const [k, v] of Object.entries(json)) {
682
+ const parsedV = create(ValueSchema);
683
+ valueFromJson(parsedV, v, ctx);
684
+ struct.fields[k] = parsedV;
983
685
  }
984
686
  }
985
687
  function valueFromJson(value, json, ctx) {
@@ -1021,9 +723,9 @@ function listValueFromJson(listValue, json, ctx) {
1021
723
  if (!Array.isArray(json)) {
1022
724
  throw new Error(`cannot decode message ${listValue.$typeName} from JSON ${formatVal(json)}`);
1023
725
  }
1024
- for (let i = 0; i < json.length; i++) {
726
+ for (const e of json) {
1025
727
  const value = create(ValueSchema);
1026
- valueFromJson(value, json[i], ctx);
728
+ valueFromJson(value, e, ctx);
1027
729
  listValue.values.push(value);
1028
730
  }
1029
731
  }