@cdklabs/cdk-ecs-codedeploy 0.0.460 → 0.0.462

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 (168) hide show
  1. package/.jsii +3 -3
  2. package/lib/api-canary/index.js +1 -1
  3. package/lib/ecs-appspec/index.js +1 -1
  4. package/lib/ecs-deployment/index.js +1 -1
  5. package/lib/ecs-patterns/application-load-balanced-codedeployed-fargate-service.js +1 -1
  6. package/node_modules/@aws-sdk/client-codedeploy/dist-cjs/index.js +49 -11
  7. package/node_modules/@aws-sdk/client-codedeploy/dist-es/models/enums.js +6 -0
  8. package/node_modules/@aws-sdk/client-codedeploy/dist-es/models/errors.js +13 -0
  9. package/node_modules/@aws-sdk/client-codedeploy/dist-es/schemas/schemas_0.js +27 -11
  10. package/node_modules/@aws-sdk/client-codedeploy/dist-types/CodeDeployClient.d.ts +2 -1
  11. package/node_modules/@aws-sdk/client-codedeploy/dist-types/commands/BatchGetDeploymentGroupsCommand.d.ts +5 -0
  12. package/node_modules/@aws-sdk/client-codedeploy/dist-types/commands/BatchGetDeploymentsCommand.d.ts +5 -0
  13. package/node_modules/@aws-sdk/client-codedeploy/dist-types/commands/CreateDeploymentCommand.d.ts +11 -0
  14. package/node_modules/@aws-sdk/client-codedeploy/dist-types/commands/CreateDeploymentGroupCommand.d.ts +11 -0
  15. package/node_modules/@aws-sdk/client-codedeploy/dist-types/commands/GetDeploymentCommand.d.ts +5 -0
  16. package/node_modules/@aws-sdk/client-codedeploy/dist-types/commands/GetDeploymentGroupCommand.d.ts +5 -0
  17. package/node_modules/@aws-sdk/client-codedeploy/dist-types/commands/UpdateDeploymentGroupCommand.d.ts +11 -0
  18. package/node_modules/@aws-sdk/client-codedeploy/dist-types/models/enums.d.ts +14 -0
  19. package/node_modules/@aws-sdk/client-codedeploy/dist-types/models/errors.d.ts +16 -0
  20. package/node_modules/@aws-sdk/client-codedeploy/dist-types/models/models_0.d.ts +64 -1
  21. package/node_modules/@aws-sdk/client-codedeploy/dist-types/schemas/schemas_0.d.ts +2 -0
  22. package/node_modules/@aws-sdk/client-codedeploy/dist-types/ts3.4/models/enums.d.ts +8 -0
  23. package/node_modules/@aws-sdk/client-codedeploy/dist-types/ts3.4/models/errors.d.ts +8 -0
  24. package/node_modules/@aws-sdk/client-codedeploy/dist-types/ts3.4/models/models_0.d.ts +9 -0
  25. package/node_modules/@aws-sdk/client-codedeploy/dist-types/ts3.4/schemas/schemas_0.d.ts +2 -0
  26. package/node_modules/@aws-sdk/client-codedeploy/package.json +5 -5
  27. package/node_modules/@aws-sdk/core/dist-cjs/submodules/httpAuthSchemes/index.js +12 -3
  28. package/node_modules/@aws-sdk/core/dist-cjs/submodules/protocols/index.js +94 -1589
  29. package/node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/aws_sdk/AwsSdkSigV4Signer.js +12 -3
  30. package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/index.js +1 -7
  31. package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/AwsJsonRpcProtocol.js +1 -3
  32. package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/AwsRestJsonProtocol.js +1 -3
  33. package/node_modules/@aws-sdk/core/dist-types/submodules/protocols/index.d.ts +2 -8
  34. package/node_modules/@aws-sdk/core/dist-types/submodules/protocols/json/AwsJson1_0Protocol.d.ts +1 -2
  35. package/node_modules/@aws-sdk/core/dist-types/submodules/protocols/json/AwsJson1_1Protocol.d.ts +1 -2
  36. package/node_modules/@aws-sdk/core/dist-types/submodules/protocols/json/AwsJsonRpcProtocol.d.ts +2 -3
  37. package/node_modules/@aws-sdk/core/dist-types/submodules/protocols/json/AwsRestJsonProtocol.d.ts +2 -3
  38. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/index.d.ts +10 -10
  39. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/json/AwsJson1_0Protocol.d.ts +1 -2
  40. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/json/AwsJson1_1Protocol.d.ts +1 -2
  41. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/json/AwsJsonRpcProtocol.d.ts +2 -3
  42. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/json/AwsRestJsonProtocol.d.ts +2 -3
  43. package/node_modules/@aws-sdk/core/package.json +3 -3
  44. package/node_modules/@aws-sdk/credential-provider-env/package.json +4 -4
  45. package/node_modules/@aws-sdk/credential-provider-http/package.json +4 -4
  46. package/node_modules/@aws-sdk/credential-provider-ini/package.json +11 -11
  47. package/node_modules/@aws-sdk/credential-provider-login/package.json +5 -5
  48. package/node_modules/@aws-sdk/credential-provider-node/package.json +9 -9
  49. package/node_modules/@aws-sdk/credential-provider-process/package.json +4 -4
  50. package/node_modules/@aws-sdk/credential-provider-sso/package.json +6 -6
  51. package/node_modules/@aws-sdk/credential-provider-web-identity/package.json +5 -5
  52. package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/cognito-identity/index.js +1 -1
  53. package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/signin/index.js +1 -1
  54. package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sso/index.js +1 -1
  55. package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sso-oidc/index.js +1 -1
  56. package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sts/index.js +1 -1
  57. package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/cognito-identity/CognitoIdentityClient.d.ts +2 -1
  58. package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/signin/SigninClient.d.ts +2 -1
  59. package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/sso/SSOClient.d.ts +2 -1
  60. package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/sso-oidc/SSOOIDCClient.d.ts +2 -1
  61. package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/sts/STSClient.d.ts +2 -1
  62. package/node_modules/@aws-sdk/nested-clients/package.json +5 -5
  63. package/node_modules/@aws-sdk/signature-v4-multi-region/package.json +2 -2
  64. package/node_modules/@aws-sdk/token-providers/dist-cjs/index.js +37 -19
  65. package/node_modules/@aws-sdk/token-providers/dist-es/fromSso.js +37 -19
  66. package/node_modules/@aws-sdk/token-providers/package.json +5 -5
  67. package/node_modules/@aws-sdk/types/dist-types/feature-ids.d.ts +3 -0
  68. package/node_modules/@aws-sdk/types/dist-types/ts3.4/feature-ids.d.ts +3 -0
  69. package/node_modules/@aws-sdk/types/package.json +1 -1
  70. package/node_modules/@smithy/core/dist-cjs/submodules/cbor/index.js +13 -37
  71. package/node_modules/@smithy/core/dist-cjs/submodules/client/index.js +15 -2
  72. package/node_modules/@smithy/core/dist-cjs/submodules/event-streams/index.browser.js +10 -0
  73. package/node_modules/@smithy/core/dist-cjs/submodules/event-streams/index.js +10 -0
  74. package/node_modules/@smithy/core/dist-cjs/submodules/protocols/index.js +1711 -4
  75. package/node_modules/@smithy/core/dist-es/submodules/cbor/SmithyRpcV2CborProtocol.js +12 -37
  76. package/node_modules/@smithy/core/dist-es/submodules/client/smithy-client/command.js +16 -2
  77. package/node_modules/@smithy/core/dist-es/submodules/event-streams/eventstream-codec/HeaderMarshaller.js +10 -0
  78. package/node_modules/@smithy/core/dist-es/submodules/protocols/AbstractRpcV2Protocol.js +35 -0
  79. package/node_modules/@smithy/core/dist-es/submodules/protocols/ConfigurableSerdeContext.js +6 -0
  80. package/node_modules/@smithy/core/dist-es/submodules/protocols/RpcProtocol.js +4 -1
  81. package/node_modules/@smithy/core/dist-es/submodules/protocols/UnionSerde.js +26 -0
  82. package/node_modules/@smithy/core/dist-es/submodules/protocols/common.js +3 -0
  83. package/node_modules/@smithy/core/dist-es/submodules/protocols/index.js +9 -0
  84. package/node_modules/@smithy/core/dist-es/submodules/protocols/json/SmithyRpcV2JsonProtocol.js +79 -0
  85. package/node_modules/{@aws-sdk → @smithy}/core/dist-es/submodules/protocols/json/codec-v1/JsonShapeDeserializer.js +8 -1
  86. package/node_modules/{@aws-sdk → @smithy}/core/dist-es/submodules/protocols/json/codec-v1/JsonShapeSerializer.js +8 -1
  87. package/node_modules/{@aws-sdk → @smithy}/core/dist-es/submodules/protocols/json/codec-v2/JsonShapeDeserializer2.js +13 -2
  88. package/node_modules/{@aws-sdk → @smithy}/core/dist-es/submodules/protocols/json/codec-v2/JsonShapeSerializer2.js +16 -6
  89. package/node_modules/{@aws-sdk → @smithy}/core/dist-es/submodules/protocols/json/parseJsonBody.js +16 -1
  90. package/node_modules/@smithy/core/dist-es/submodules/protocols/writeKey.js +3 -0
  91. package/node_modules/@smithy/core/dist-types/submodules/cbor/SmithyRpcV2CborProtocol.d.ts +5 -14
  92. package/node_modules/@smithy/core/dist-types/submodules/protocols/AbstractRpcV2Protocol.d.ts +45 -0
  93. package/node_modules/@smithy/core/dist-types/submodules/protocols/ConfigurableSerdeContext.d.ts +8 -0
  94. package/node_modules/@smithy/core/dist-types/submodules/protocols/RpcProtocol.d.ts +12 -0
  95. package/node_modules/@smithy/core/dist-types/submodules/protocols/UnionSerde.d.ts +24 -0
  96. package/node_modules/@smithy/core/dist-types/submodules/protocols/common.d.ts +2 -0
  97. package/node_modules/@smithy/core/dist-types/submodules/protocols/index.d.ts +10 -0
  98. package/node_modules/@smithy/core/dist-types/submodules/protocols/json/JsonSettings.d.ts +13 -0
  99. package/node_modules/@smithy/core/dist-types/submodules/protocols/json/SmithyRpcV2JsonProtocol.d.ts +19 -0
  100. package/node_modules/{@aws-sdk → @smithy}/core/dist-types/submodules/protocols/json/parseJsonBody.d.ts +16 -0
  101. package/node_modules/@smithy/core/dist-types/submodules/protocols/writeKey.d.ts +4 -0
  102. package/node_modules/@smithy/core/dist-types/ts3.4/submodules/cbor/SmithyRpcV2CborProtocol.d.ts +5 -14
  103. package/node_modules/@smithy/core/dist-types/ts3.4/submodules/protocols/AbstractRpcV2Protocol.d.ts +45 -0
  104. package/node_modules/@smithy/core/dist-types/ts3.4/submodules/protocols/ConfigurableSerdeContext.d.ts +8 -0
  105. package/node_modules/@smithy/core/dist-types/ts3.4/submodules/protocols/RpcProtocol.d.ts +12 -0
  106. package/node_modules/@smithy/core/dist-types/ts3.4/submodules/protocols/UnionSerde.d.ts +24 -0
  107. package/node_modules/@smithy/core/dist-types/ts3.4/submodules/protocols/common.d.ts +2 -0
  108. package/node_modules/@smithy/core/dist-types/ts3.4/submodules/protocols/index.d.ts +10 -0
  109. package/node_modules/@smithy/core/dist-types/ts3.4/submodules/protocols/json/JsonSettings.d.ts +13 -0
  110. package/node_modules/@smithy/core/dist-types/ts3.4/submodules/protocols/json/SmithyRpcV2JsonProtocol.d.ts +19 -0
  111. package/node_modules/{@aws-sdk → @smithy}/core/dist-types/ts3.4/submodules/protocols/json/codec-v1/JsonCodec.d.ts +15 -11
  112. package/node_modules/{@aws-sdk/core/dist-types/ts3.4/submodules/protocols/json → @smithy/core/dist-types/ts3.4/submodules/protocols/json/codec-v1}/JsonSettings.d.ts +7 -4
  113. package/node_modules/@smithy/core/dist-types/ts3.4/submodules/protocols/json/codec-v1/JsonShapeDeserializer.d.ts +14 -0
  114. package/node_modules/@smithy/core/dist-types/ts3.4/submodules/protocols/json/codec-v1/JsonShapeSerializer.d.ts +29 -0
  115. package/node_modules/@smithy/core/dist-types/ts3.4/submodules/protocols/json/codec-v2/JsonBytesStringAdapter.d.ts +51 -0
  116. package/node_modules/{@aws-sdk → @smithy}/core/dist-types/ts3.4/submodules/protocols/json/codec-v2/JsonCodec2.d.ts +13 -9
  117. package/node_modules/@smithy/core/dist-types/ts3.4/submodules/protocols/json/codec-v2/JsonShapeDeserializer2.d.ts +30 -0
  118. package/node_modules/@smithy/core/dist-types/ts3.4/submodules/protocols/json/codec-v2/JsonShapeSerializer2.d.ts +60 -0
  119. package/node_modules/{@aws-sdk → @smithy}/core/dist-types/ts3.4/submodules/protocols/json/detectBufferParsing.d.ts +1 -1
  120. package/node_modules/@smithy/core/dist-types/ts3.4/submodules/protocols/json/jsonReplacer.d.ts +21 -0
  121. package/node_modules/@smithy/core/dist-types/ts3.4/submodules/protocols/json/jsonReviver.d.ts +15 -0
  122. package/node_modules/@smithy/core/dist-types/ts3.4/submodules/protocols/json/needsReviver.d.ts +11 -0
  123. package/node_modules/@smithy/core/dist-types/ts3.4/submodules/protocols/json/parseJsonBody.d.ts +38 -0
  124. package/node_modules/@smithy/core/dist-types/ts3.4/submodules/protocols/writeKey.d.ts +4 -0
  125. package/node_modules/@smithy/core/package.json +2 -1
  126. package/node_modules/@smithy/node-http-handler/dist-cjs/index.js +48 -6
  127. package/node_modules/@smithy/node-http-handler/dist-es/node-http-handler.js +9 -1
  128. package/node_modules/@smithy/node-http-handler/dist-es/node-http2-handler.js +20 -2
  129. package/node_modules/@smithy/node-http-handler/dist-es/resolve-default-socket-timeout.js +4 -0
  130. package/node_modules/@smithy/node-http-handler/dist-es/set-socket-timeout.js +16 -3
  131. package/node_modules/@smithy/node-http-handler/dist-types/resolve-default-socket-timeout.d.ts +4 -0
  132. package/node_modules/@smithy/node-http-handler/dist-types/set-socket-timeout.d.ts +6 -1
  133. package/node_modules/@smithy/node-http-handler/dist-types/ts3.4/resolve-default-socket-timeout.d.ts +4 -0
  134. package/node_modules/@smithy/node-http-handler/dist-types/ts3.4/set-socket-timeout.d.ts +6 -1
  135. package/node_modules/@smithy/node-http-handler/package.json +3 -3
  136. package/package.json +2 -2
  137. package/node_modules/@aws-sdk/core/dist-types/submodules/protocols/json/codec-v1/JsonSettings.d.ts +0 -7
  138. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/json/codec-v1/JsonSettings.d.ts +0 -4
  139. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/json/codec-v1/JsonShapeDeserializer.d.ts +0 -13
  140. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/json/codec-v1/JsonShapeSerializer.d.ts +0 -18
  141. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/json/codec-v2/JsonBytesStringAdapter.d.ts +0 -27
  142. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/json/codec-v2/JsonShapeDeserializer2.d.ts +0 -15
  143. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/json/codec-v2/JsonShapeSerializer2.d.ts +0 -39
  144. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/json/jsonReplacer.d.ts +0 -7
  145. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/json/jsonReviver.d.ts +0 -7
  146. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/json/needsReviver.d.ts +0 -2
  147. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/json/parseJsonBody.d.ts +0 -14
  148. /package/node_modules/{@aws-sdk → @smithy}/core/dist-es/submodules/protocols/json/JsonSettings.js +0 -0
  149. /package/node_modules/{@aws-sdk → @smithy}/core/dist-es/submodules/protocols/json/codec-v1/JsonCodec.js +0 -0
  150. /package/node_modules/{@aws-sdk → @smithy}/core/dist-es/submodules/protocols/json/codec-v1/JsonSettings.js +0 -0
  151. /package/node_modules/{@aws-sdk → @smithy}/core/dist-es/submodules/protocols/json/codec-v2/JsonBytesStringAdapter.js +0 -0
  152. /package/node_modules/{@aws-sdk → @smithy}/core/dist-es/submodules/protocols/json/codec-v2/JsonCodec2.js +0 -0
  153. /package/node_modules/{@aws-sdk → @smithy}/core/dist-es/submodules/protocols/json/detectBufferParsing.js +0 -0
  154. /package/node_modules/{@aws-sdk → @smithy}/core/dist-es/submodules/protocols/json/jsonReplacer.js +0 -0
  155. /package/node_modules/{@aws-sdk → @smithy}/core/dist-es/submodules/protocols/json/jsonReviver.js +0 -0
  156. /package/node_modules/{@aws-sdk → @smithy}/core/dist-es/submodules/protocols/json/needsReviver.js +0 -0
  157. /package/node_modules/{@aws-sdk → @smithy}/core/dist-types/submodules/protocols/json/codec-v1/JsonCodec.d.ts +0 -0
  158. /package/node_modules/{@aws-sdk/core/dist-types/submodules/protocols/json → @smithy/core/dist-types/submodules/protocols/json/codec-v1}/JsonSettings.d.ts +0 -0
  159. /package/node_modules/{@aws-sdk → @smithy}/core/dist-types/submodules/protocols/json/codec-v1/JsonShapeDeserializer.d.ts +0 -0
  160. /package/node_modules/{@aws-sdk → @smithy}/core/dist-types/submodules/protocols/json/codec-v1/JsonShapeSerializer.d.ts +0 -0
  161. /package/node_modules/{@aws-sdk → @smithy}/core/dist-types/submodules/protocols/json/codec-v2/JsonBytesStringAdapter.d.ts +0 -0
  162. /package/node_modules/{@aws-sdk → @smithy}/core/dist-types/submodules/protocols/json/codec-v2/JsonCodec2.d.ts +0 -0
  163. /package/node_modules/{@aws-sdk → @smithy}/core/dist-types/submodules/protocols/json/codec-v2/JsonShapeDeserializer2.d.ts +0 -0
  164. /package/node_modules/{@aws-sdk → @smithy}/core/dist-types/submodules/protocols/json/codec-v2/JsonShapeSerializer2.d.ts +0 -0
  165. /package/node_modules/{@aws-sdk → @smithy}/core/dist-types/submodules/protocols/json/detectBufferParsing.d.ts +0 -0
  166. /package/node_modules/{@aws-sdk → @smithy}/core/dist-types/submodules/protocols/json/jsonReplacer.d.ts +0 -0
  167. /package/node_modules/{@aws-sdk → @smithy}/core/dist-types/submodules/protocols/json/jsonReviver.d.ts +0 -0
  168. /package/node_modules/{@aws-sdk → @smithy}/core/dist-types/submodules/protocols/json/needsReviver.d.ts +0 -0
@@ -13,4 +13,16 @@ export declare abstract class RpcProtocol extends HttpProtocol {
13
13
  protected compositeErrorRegistry: TypeRegistry;
14
14
  serializeRequest<Input extends object>(operationSchema: OperationSchema, _input: Input, context: HandlerExecutionContext & SerdeFunctions & EndpointBearer): Promise<IHttpRequest>;
15
15
  deserializeResponse<Output extends MetadataBearer>(operationSchema: OperationSchema, context: HandlerExecutionContext & SerdeFunctions, response: IHttpResponse): Promise<Output>;
16
+ /**
17
+ * Determines whether a response status code indicates an error response that
18
+ * should be routed to {@link handleError} rather than deserialized as output.
19
+ *
20
+ * The default treats any status code of 300 or greater as an error,
21
+ * preserving the historical behavior for RPC-over-HTTP protocols. Subclasses
22
+ * whose specification is stricter SHOULD override this.
23
+ *
24
+ * @param statusCode - the HTTP response status code.
25
+ * @returns true if the response should be handled as an error.
26
+ */
27
+ protected isErrorResponse(statusCode: number): boolean;
16
28
  }
@@ -0,0 +1,24 @@
1
+ /**
2
+ * Helper for identifying unknown union members during deserialization.
3
+ */
4
+ export declare class UnionSerde {
5
+ private from;
6
+ private to;
7
+ private keys;
8
+ constructor(from: any, to: any);
9
+ /**
10
+ * Marks the key as being a known member.
11
+ * @param key - to mark.
12
+ */
13
+ mark(key: string): void;
14
+ /**
15
+ * @returns whether only one key remains unmarked and nothing has been written,
16
+ * implying the object is a union.
17
+ */
18
+ hasUnknown(): boolean;
19
+ /**
20
+ * Writes the unknown key-value pair, if present, into the $unknown property
21
+ * of the union object.
22
+ */
23
+ writeUnknown(): void;
24
+ }
@@ -0,0 +1,2 @@
1
+ import type { SerdeFunctions } from "@smithy/types";
2
+ export declare const collectBodyString: (streamBody: any, context: SerdeFunctions) => Promise<string>;
@@ -3,6 +3,7 @@ export { extendedEncodeURIComponent } from "./extended-encode-uri-component";
3
3
  export { HttpBindingProtocol } from "./HttpBindingProtocol";
4
4
  export { HttpProtocol } from "./HttpProtocol";
5
5
  export { RpcProtocol } from "./RpcProtocol";
6
+ export { AbstractRpcV2Protocol } from "./AbstractRpcV2Protocol";
6
7
  export { RequestBuilder, requestBuilder } from "./requestBuilder";
7
8
  export { resolvedPath } from "./resolve-path";
8
9
  export { FromStringShapeDeserializer } from "./serde/FromStringShapeDeserializer";
@@ -25,3 +26,12 @@ export { escapeUriPath } from "./util-uri-escape/escape-uri-path";
25
26
  export { buildQueryString } from "./querystring-builder/buildQueryString";
26
27
  export { parseQueryString } from "@smithy/core/transport";
27
28
  export { parseUrl } from "@smithy/core/transport";
29
+ export { SmithyRpcV2JsonProtocol } from "./json/SmithyRpcV2JsonProtocol";
30
+ export { parseJsonBody, parseJsonErrorBody, loadJsonRpcErrorCode, loadRestJsonErrorCode, loadSmithyRpcV2JsonErrorCode, } from "./json/parseJsonBody";
31
+ export type { JsonSettings } from "./json/JsonSettings";
32
+ export { JsonCodec } from "./json/codec-v1/JsonCodec";
33
+ export { JsonShapeSerializer } from "./json/codec-v1/JsonShapeSerializer";
34
+ export { JsonShapeDeserializer } from "./json/codec-v1/JsonShapeDeserializer";
35
+ export { JsonCodec2 } from "./json/codec-v2/JsonCodec2";
36
+ export { JsonShapeSerializer2 } from "./json/codec-v2/JsonShapeSerializer2";
37
+ export { JsonShapeDeserializer2 } from "./json/codec-v2/JsonShapeDeserializer2";
@@ -0,0 +1,13 @@
1
+ import type { CodecSettings } from "@smithy/types";
2
+ /**
3
+ * @public
4
+ */
5
+ export type JsonSettings = CodecSettings & {
6
+ jsonName: boolean;
7
+ /**
8
+ * When true, bigInteger and bigDecimal values are serialized as JSON strings
9
+ * to preserve arbitrary precision (Smithy RPCv2 JSON behavior). When false or
10
+ * unset, they are serialized as unquoted JSON numbers (AWS JSON 1.0/1.1 behavior).
11
+ */
12
+ bigNumberAsString?: boolean;
13
+ };
@@ -0,0 +1,19 @@
1
+ import { AbstractRpcV2Protocol } from "../AbstractRpcV2Protocol";
2
+ import type { HandlerExecutionContext, HttpRequest as IHttpRequest, HttpResponse as IHttpResponse, OperationSchema, ResponseMetadata, SerdeFunctions, ShapeDeserializer, ShapeSerializer } from "@smithy/types";
3
+ import { JsonCodec2 } from "./codec-v2/JsonCodec2";
4
+ /**
5
+ * Client protocol for Smithy RPCv2 JSON.
6
+ *
7
+ * @public
8
+ */
9
+ export declare class SmithyRpcV2JsonProtocol extends AbstractRpcV2Protocol {
10
+ private codec;
11
+ protected serializer: ShapeSerializer<string | Uint8Array>;
12
+ protected deserializer: ShapeDeserializer<string | Uint8Array>;
13
+ getShapeId(): string;
14
+ getPayloadCodec(): JsonCodec2;
15
+ protected getSmithyProtocolHeaderValue(): string;
16
+ protected applyEmptyBody(request: IHttpRequest): void;
17
+ protected handleError(operationSchema: OperationSchema, context: HandlerExecutionContext & SerdeFunctions, response: IHttpResponse, dataObject: any, metadata: ResponseMetadata): Promise<never>;
18
+ protected getDefaultContentType(): string;
19
+ }
@@ -20,3 +20,19 @@ export declare const loadRestJsonErrorCode: (output: HttpResponse, data: any) =>
20
20
  * @internal
21
21
  */
22
22
  export declare const loadJsonRpcErrorCode: (output: HttpResponse, data: any, queryCompat?: boolean) => string | undefined;
23
+ /**
24
+ * Smithy RPCv2 JSON error identifier loader.
25
+ *
26
+ * Unlike {@link loadJsonRpcErrorCode} (used by AWS JSON 1.0/1.1 and restJson1),
27
+ * this preserves the ABSOLUTE shape id carried in `__type`. The RPCv2 JSON SEP
28
+ * requires `__type` to contain the fully-qualified shape id, and the protocol
29
+ * resolves errors by that absolute id to avoid ambiguous resolution when the
30
+ * same shape name exists in more than one namespace.
31
+ *
32
+ * It trims the Smithy-specific `,` fault/tag suffix and the `:` suffix, but does
33
+ * NOT strip the `#` namespace separator:
34
+ * "com.a.b#Error:Sender,tag" -> "com.a.b#Error"
35
+ *
36
+ * @internal
37
+ */
38
+ export declare const loadSmithyRpcV2JsonErrorCode: (output: HttpResponse, data: any) => string | undefined;
@@ -0,0 +1,4 @@
1
+ /**
2
+ * Makes __proto__ writable on a given object.
3
+ */
4
+ export declare function writeKey(obj: object | Record<string, unknown> | any): void;
@@ -1,28 +1,19 @@
1
- import { RpcProtocol } from "@smithy/core/protocols";
2
- import { TypeRegistry } from "@smithy/core/schema";
3
- import { EndpointBearer, HandlerExecutionContext, HttpRequest as IHttpRequest, HttpResponse as IHttpResponse, MetadataBearer, OperationSchema, ResponseMetadata, SerdeFunctions } from "@smithy/types";
1
+ import { AbstractRpcV2Protocol } from "@smithy/core/protocols";
2
+ import { HandlerExecutionContext, HttpRequest as IHttpRequest, HttpResponse as IHttpResponse, OperationSchema, ResponseMetadata, SerdeFunctions } from "@smithy/types";
4
3
  import { CborCodec } from "./CborCodec";
5
4
  /**
6
5
  * Client protocol for Smithy RPCv2 CBOR.
7
6
  *
8
7
  * @public
9
8
  */
10
- export declare class SmithyRpcV2CborProtocol extends RpcProtocol {
11
- /**
12
- * @override
13
- */
14
- protected compositeErrorRegistry: TypeRegistry;
9
+ export declare class SmithyRpcV2CborProtocol extends AbstractRpcV2Protocol {
15
10
  private codec;
16
11
  protected serializer: import(".").CborShapeSerializer2;
17
12
  protected deserializer: import(".").CborShapeDeserializer2;
18
- constructor({ defaultNamespace, errorTypeRegistries, }: {
19
- defaultNamespace: string;
20
- errorTypeRegistries?: TypeRegistry[];
21
- });
22
13
  getShapeId(): string;
23
14
  getPayloadCodec(): CborCodec;
24
- serializeRequest<Input extends object>(operationSchema: OperationSchema, input: Input, context: HandlerExecutionContext & SerdeFunctions & EndpointBearer): Promise<IHttpRequest>;
25
- deserializeResponse<Output extends MetadataBearer>(operationSchema: OperationSchema, context: HandlerExecutionContext & SerdeFunctions, response: IHttpResponse): Promise<Output>;
15
+ protected getSmithyProtocolHeaderValue(): string;
16
+ protected applyEmptyBody(request: IHttpRequest): void;
26
17
  protected handleError(operationSchema: OperationSchema, context: HandlerExecutionContext & SerdeFunctions, response: IHttpResponse, dataObject: any, metadata: ResponseMetadata): Promise<never>;
27
18
  protected getDefaultContentType(): string;
28
19
  }
@@ -0,0 +1,45 @@
1
+ import { EndpointBearer, HandlerExecutionContext, HttpRequest as IHttpRequest, OperationSchema, SerdeFunctions } from "@smithy/types";
2
+ import { TypeRegistry } from "@smithy/core/schema";
3
+ import { RpcProtocol } from "./RpcProtocol";
4
+ /**
5
+ * Shared abstract base for the Smithy RPC v2 client protocols (JSON and CBOR).
6
+ *
7
+ * Factors out the request-framing flow and response status handling that are
8
+ * identical across both RPC v2 protocols. Concrete protocols supply their
9
+ * codec, error handling, content type, shape id, and the two per-protocol
10
+ * request details via {@link getSmithyProtocolHeaderValue} and
11
+ * {@link applyEmptyBody}.
12
+ *
13
+ * @internal
14
+ */
15
+ export declare abstract class AbstractRpcV2Protocol extends RpcProtocol {
16
+ /**
17
+ * @override
18
+ */
19
+ protected compositeErrorRegistry: TypeRegistry;
20
+ constructor({ defaultNamespace, errorTypeRegistries, }: {
21
+ defaultNamespace: string;
22
+ errorTypeRegistries?: TypeRegistry[];
23
+ });
24
+ serializeRequest<Input extends object>(operationSchema: OperationSchema, input: Input, context: HandlerExecutionContext & SerdeFunctions & EndpointBearer): Promise<IHttpRequest>;
25
+ /**
26
+ * @override
27
+ *
28
+ * Per the Smithy RPC v2 specification, the only successful response status
29
+ * code is 200; any other status code MUST be handled as an error.
30
+ */
31
+ protected isErrorResponse(statusCode: number): boolean;
32
+ /**
33
+ * @returns the value of the `smithy-protocol` header for this protocol,
34
+ * e.g. `rpc-v2-json` or `rpc-v2-cbor`.
35
+ */
36
+ protected abstract getSmithyProtocolHeaderValue(): string;
37
+ /**
38
+ * Applies this protocol's representation of an empty request body when the
39
+ * operation has a non-unit input but produced no serialized body. Called
40
+ * only for non-unit inputs.
41
+ *
42
+ * @param request - the request being serialized, mutated in place.
43
+ */
44
+ protected abstract applyEmptyBody(request: IHttpRequest): void;
45
+ }
@@ -0,0 +1,8 @@
1
+ import { ConfigurableSerdeContext, SerdeFunctions } from "@smithy/types";
2
+ /**
3
+ * @internal
4
+ */
5
+ export declare class SerdeContextConfig implements ConfigurableSerdeContext {
6
+ protected serdeContext?: SerdeFunctions;
7
+ setSerdeContext(serdeContext: SerdeFunctions): void;
8
+ }
@@ -13,4 +13,16 @@ export declare abstract class RpcProtocol extends HttpProtocol {
13
13
  protected compositeErrorRegistry: TypeRegistry;
14
14
  serializeRequest<Input extends object>(operationSchema: OperationSchema, _input: Input, context: HandlerExecutionContext & SerdeFunctions & EndpointBearer): Promise<IHttpRequest>;
15
15
  deserializeResponse<Output extends MetadataBearer>(operationSchema: OperationSchema, context: HandlerExecutionContext & SerdeFunctions, response: IHttpResponse): Promise<Output>;
16
+ /**
17
+ * Determines whether a response status code indicates an error response that
18
+ * should be routed to {@link handleError} rather than deserialized as output.
19
+ *
20
+ * The default treats any status code of 300 or greater as an error,
21
+ * preserving the historical behavior for RPC-over-HTTP protocols. Subclasses
22
+ * whose specification is stricter SHOULD override this.
23
+ *
24
+ * @param statusCode - the HTTP response status code.
25
+ * @returns true if the response should be handled as an error.
26
+ */
27
+ protected isErrorResponse(statusCode: number): boolean;
16
28
  }
@@ -0,0 +1,24 @@
1
+ /**
2
+ * Helper for identifying unknown union members during deserialization.
3
+ */
4
+ export declare class UnionSerde {
5
+ private from;
6
+ private to;
7
+ private keys;
8
+ constructor(from: any, to: any);
9
+ /**
10
+ * Marks the key as being a known member.
11
+ * @param key - to mark.
12
+ */
13
+ mark(key: string): void;
14
+ /**
15
+ * @returns whether only one key remains unmarked and nothing has been written,
16
+ * implying the object is a union.
17
+ */
18
+ hasUnknown(): boolean;
19
+ /**
20
+ * Writes the unknown key-value pair, if present, into the $unknown property
21
+ * of the union object.
22
+ */
23
+ writeUnknown(): void;
24
+ }
@@ -0,0 +1,2 @@
1
+ import { SerdeFunctions } from "@smithy/types";
2
+ export declare const collectBodyString: (streamBody: any, context: SerdeFunctions) => Promise<string>;
@@ -3,6 +3,7 @@ export { extendedEncodeURIComponent } from "./extended-encode-uri-component";
3
3
  export { HttpBindingProtocol } from "./HttpBindingProtocol";
4
4
  export { HttpProtocol } from "./HttpProtocol";
5
5
  export { RpcProtocol } from "./RpcProtocol";
6
+ export { AbstractRpcV2Protocol } from "./AbstractRpcV2Protocol";
6
7
  export { RequestBuilder, requestBuilder } from "./requestBuilder";
7
8
  export { resolvedPath } from "./resolve-path";
8
9
  export { FromStringShapeDeserializer } from "./serde/FromStringShapeDeserializer";
@@ -25,3 +26,12 @@ export { escapeUriPath } from "./util-uri-escape/escape-uri-path";
25
26
  export { buildQueryString } from "./querystring-builder/buildQueryString";
26
27
  export { parseQueryString } from "@smithy/core/transport";
27
28
  export { parseUrl } from "@smithy/core/transport";
29
+ export { SmithyRpcV2JsonProtocol } from "./json/SmithyRpcV2JsonProtocol";
30
+ export { parseJsonBody, parseJsonErrorBody, loadJsonRpcErrorCode, loadRestJsonErrorCode, loadSmithyRpcV2JsonErrorCode, } from "./json/parseJsonBody";
31
+ export { JsonSettings } from "./json/JsonSettings";
32
+ export { JsonCodec } from "./json/codec-v1/JsonCodec";
33
+ export { JsonShapeSerializer } from "./json/codec-v1/JsonShapeSerializer";
34
+ export { JsonShapeDeserializer } from "./json/codec-v1/JsonShapeDeserializer";
35
+ export { JsonCodec2 } from "./json/codec-v2/JsonCodec2";
36
+ export { JsonShapeSerializer2 } from "./json/codec-v2/JsonShapeSerializer2";
37
+ export { JsonShapeDeserializer2 } from "./json/codec-v2/JsonShapeDeserializer2";
@@ -0,0 +1,13 @@
1
+ import { CodecSettings } from "@smithy/types";
2
+ /**
3
+ * @public
4
+ */
5
+ export type JsonSettings = CodecSettings & {
6
+ jsonName: boolean;
7
+ /**
8
+ * When true, bigInteger and bigDecimal values are serialized as JSON strings
9
+ * to preserve arbitrary precision (Smithy RPCv2 JSON behavior). When false or
10
+ * unset, they are serialized as unquoted JSON numbers (AWS JSON 1.0/1.1 behavior).
11
+ */
12
+ bigNumberAsString?: boolean;
13
+ };
@@ -0,0 +1,19 @@
1
+ import { AbstractRpcV2Protocol } from "../AbstractRpcV2Protocol";
2
+ import { HandlerExecutionContext, HttpRequest as IHttpRequest, HttpResponse as IHttpResponse, OperationSchema, ResponseMetadata, SerdeFunctions, ShapeDeserializer, ShapeSerializer } from "@smithy/types";
3
+ import { JsonCodec2 } from "./codec-v2/JsonCodec2";
4
+ /**
5
+ * Client protocol for Smithy RPCv2 JSON.
6
+ *
7
+ * @public
8
+ */
9
+ export declare class SmithyRpcV2JsonProtocol extends AbstractRpcV2Protocol {
10
+ private codec;
11
+ protected serializer: ShapeSerializer<string | Uint8Array>;
12
+ protected deserializer: ShapeDeserializer<string | Uint8Array>;
13
+ getShapeId(): string;
14
+ getPayloadCodec(): JsonCodec2;
15
+ protected getSmithyProtocolHeaderValue(): string;
16
+ protected applyEmptyBody(request: IHttpRequest): void;
17
+ protected handleError(operationSchema: OperationSchema, context: HandlerExecutionContext & SerdeFunctions, response: IHttpResponse, dataObject: any, metadata: ResponseMetadata): Promise<never>;
18
+ protected getDefaultContentType(): string;
19
+ }
@@ -1,11 +1,15 @@
1
- import { Codec } from "@smithy/types";
2
- import { SerdeContextConfig } from "../../ConfigurableSerdeContext";
3
- import { JsonShapeDeserializer } from "./JsonShapeDeserializer";
4
- import { JsonShapeSerializer } from "./JsonShapeSerializer";
5
- import { JsonSettings } from "./JsonSettings";
6
- export declare class JsonCodec extends SerdeContextConfig implements Codec<string, string> {
7
- readonly settings: JsonSettings;
8
- constructor(settings: JsonSettings);
9
- createSerializer(): JsonShapeSerializer;
10
- createDeserializer(): JsonShapeDeserializer;
11
- }
1
+ import { Codec } from "@smithy/types";
2
+ import { SerdeContextConfig } from "../../ConfigurableSerdeContext";
3
+ import { JsonShapeDeserializer } from "./JsonShapeDeserializer";
4
+ import { JsonShapeSerializer } from "./JsonShapeSerializer";
5
+ import { JsonSettings } from "./JsonSettings";
6
+ /**
7
+ * @deprecated use JsonCodec2.
8
+ * @public
9
+ */
10
+ export declare class JsonCodec extends SerdeContextConfig implements Codec<string, string> {
11
+ readonly settings: JsonSettings;
12
+ constructor(settings: JsonSettings);
13
+ createSerializer(): JsonShapeSerializer;
14
+ createDeserializer(): JsonShapeDeserializer;
15
+ }
@@ -1,4 +1,7 @@
1
- import { CodecSettings } from "@smithy/types";
2
- export type JsonSettings = CodecSettings & {
3
- jsonName: boolean;
4
- };
1
+ import { CodecSettings } from "@smithy/types";
2
+ /**
3
+ * @public
4
+ */
5
+ export type JsonSettings = CodecSettings & {
6
+ jsonName: boolean;
7
+ };
@@ -0,0 +1,14 @@
1
+ import { DocumentType, Schema, ShapeDeserializer } from "@smithy/types";
2
+ import { SerdeContextConfig } from "../../ConfigurableSerdeContext";
3
+ import { JsonSettings } from "./JsonSettings";
4
+ /**
5
+ * @deprecated prefer JsonShapeDeserializer in codec-v2.
6
+ * @public
7
+ */
8
+ export declare class JsonShapeDeserializer extends SerdeContextConfig implements ShapeDeserializer<string> {
9
+ readonly settings: JsonSettings;
10
+ constructor(settings: JsonSettings);
11
+ read(schema: Schema, data: string | Uint8Array | unknown): Promise<any>;
12
+ readObject(schema: Schema, data: DocumentType): any;
13
+ protected _read(schema: Schema, value: unknown): any;
14
+ }
@@ -0,0 +1,29 @@
1
+ import { NormalizedSchema } from "@smithy/core/schema";
2
+ import { Schema, ShapeSerializer } from "@smithy/types";
3
+ import { SerdeContextConfig } from "../../ConfigurableSerdeContext";
4
+ import { JsonSettings } from "./JsonSettings";
5
+ /**
6
+ * @deprecated prefer byte-targeting JsonShapeSerializer or its string adapter StringJsonShapeSerializer in codec-v2.
7
+ * @public
8
+ */
9
+ export declare class JsonShapeSerializer extends SerdeContextConfig implements ShapeSerializer<string> {
10
+ readonly settings: JsonSettings;
11
+ /**
12
+ * Write buffer. Reused per value serialization pass.
13
+ * In the initial implementation, this is not an incremental buffer.
14
+ */
15
+ protected buffer: any;
16
+ protected useReplacer: boolean;
17
+ protected rootSchema: NormalizedSchema | undefined;
18
+ constructor(settings: JsonSettings);
19
+ write(schema: Schema, value: unknown): void;
20
+ flush(): string;
21
+ /**
22
+ * @internal
23
+ */
24
+ writeDiscriminatedDocument(schema: Schema, value: unknown): void;
25
+ /**
26
+ * Order if-statements by likelihood.
27
+ */
28
+ protected _write(schema: Schema, value: unknown, container?: NormalizedSchema): any;
29
+ }
@@ -0,0 +1,51 @@
1
+ /**
2
+ * A Uint8Array subclass holding serialized JSON bytes that provides
3
+ * string method compatibility for customer middleware.
4
+ *
5
+ * Middleware historically observed `request.body` as a string for JSON
6
+ * protocol services. This class preserves that contract: string methods
7
+ * and coercion (template literals, `+` operator) lazily decode the bytes
8
+ * to a cached string. The HTTP transport layer still sees a Uint8Array
9
+ * and sends raw bytes without conversion.
10
+ *
11
+ * @internal
12
+ * @deprecated this adapter will be removed in a future version.
13
+ */
14
+ export declare class JsonBytesStringAdapter extends Uint8Array {
15
+ private string;
16
+ static allocUnsafe(bytes: number): JsonBytesStringAdapter;
17
+ /**
18
+ * Enables string coercion via template literals and `+` operator.
19
+ */
20
+ toString(): string;
21
+ /**
22
+ * Enables string coercion in comparison and arithmetic contexts.
23
+ * @returns a string. The signature is set to avoid incompatibility with extending Uint8Array.
24
+ */
25
+ valueOf(): any;
26
+ includes(searchString: string | number, position?: number): boolean;
27
+ indexOf(searchString: string | number, position?: number): number;
28
+ lastIndexOf(searchString: string | number, position?: number): number;
29
+ startsWith(searchString: string, position?: number): boolean;
30
+ endsWith(searchString: string, endPosition?: number): boolean;
31
+ match(regexp: string | RegExp): RegExpMatchArray | null;
32
+ replace(searchValue: string | RegExp, replaceValue: string): string;
33
+ search(regexp: string | RegExp): number;
34
+ split(separator: string | RegExp, limit?: number): string[];
35
+ substring(start: number, end?: number): string;
36
+ trim(): string;
37
+ trimStart(): string;
38
+ trimEnd(): string;
39
+ charAt(pos: number): string;
40
+ charCodeAt(index: number): number;
41
+ padStart(maxLength: number, fillString?: string): string;
42
+ padEnd(maxLength: number, fillString?: string): string;
43
+ repeat(count: number): string;
44
+ toUpperCase(): string;
45
+ toLowerCase(): string;
46
+ /**
47
+ * Decodes the bytes to a UTF-8 string on first access, then caches.
48
+ * Subsequent calls return the cached string with zero cost.
49
+ */
50
+ private s;
51
+ }
@@ -1,9 +1,13 @@
1
- import { $ShapeSerializer, $Codec, $ShapeDeserializer } from "@smithy/types";
2
- import { SerdeContextConfig } from "../../ConfigurableSerdeContext";
3
- import { JsonSettings } from "../JsonSettings";
4
- export declare class JsonCodec2 extends SerdeContextConfig implements $Codec<Uint8Array, string> {
5
- readonly settings: JsonSettings;
6
- constructor(settings: JsonSettings);
7
- createSerializer(): $ShapeSerializer<Uint8Array>;
8
- createDeserializer(): $ShapeDeserializer<string>;
9
- }
1
+ import { $ShapeSerializer, $Codec, $ShapeDeserializer } from "@smithy/types";
2
+ import { SerdeContextConfig } from "../../ConfigurableSerdeContext";
3
+ import { JsonSettings } from "../JsonSettings";
4
+ /**
5
+ * Codec grouping the v2 serializer and deserializer.
6
+ * @public
7
+ */
8
+ export declare class JsonCodec2 extends SerdeContextConfig implements $Codec<Uint8Array, string> {
9
+ readonly settings: JsonSettings;
10
+ constructor(settings: JsonSettings);
11
+ createSerializer(): $ShapeSerializer<Uint8Array>;
12
+ createDeserializer(): $ShapeDeserializer<string>;
13
+ }
@@ -0,0 +1,30 @@
1
+ import { DocumentType, Schema, ShapeDeserializer } from "@smithy/types";
2
+ import { SerdeContextConfig } from "../../ConfigurableSerdeContext";
3
+ import { JsonSettings } from "../JsonSettings";
4
+ /**
5
+ * Performance-optimized JSON deserializer.
6
+ *
7
+ * Skips UTF-8 decoding when the runtime supports JSON.parse(Buffer) (Node 22+).
8
+ *
9
+ * After JSON.parse, lists, maps, and document containers are mutated in place
10
+ * (element values are overwritten with their deserialized form) rather than
11
+ * copied into new arrays/objects. Structs allocate a fresh object because
12
+ * jsonName traits require key renaming, and building the output object
13
+ * incrementally lets V8 assign a stable hidden class rather than
14
+ * deoptimizing from repeated property deletion/addition on an existing shape.
15
+ *
16
+ * In-place mutation is safe here because the parsed tree is locally owned
17
+ * after JSON.parse with no external references, so rewriting values avoids
18
+ * redundant allocation and GC pressure.
19
+ *
20
+ * @public
21
+ */
22
+ export declare class JsonShapeDeserializer2 extends SerdeContextConfig implements ShapeDeserializer<string> {
23
+ readonly settings: JsonSettings;
24
+ constructor(settings: JsonSettings);
25
+ read(schema: Schema, data: string | Uint8Array | unknown): Promise<any>;
26
+ readObject(schema: Schema, data: DocumentType): any;
27
+ protected _read(schema: Schema, value: unknown): any;
28
+ private _readStruct;
29
+ private needsTransform;
30
+ }
@@ -0,0 +1,60 @@
1
+ import { NormalizedSchema } from "@smithy/core/schema";
2
+ import { Schema, ShapeSerializer } from "@smithy/types";
3
+ import { SerdeContextConfig } from "../../ConfigurableSerdeContext";
4
+ import { JsonSettings } from "../JsonSettings";
5
+ /**
6
+ * Single-pass JSON serializer that writes directly to a Uint8Array buffer.
7
+ * Fewer intermediate states as when compared to the initial multi-pass implementation.
8
+ *
9
+ * @public
10
+ */
11
+ export declare class JsonShapeSerializer2 extends SerdeContextConfig implements ShapeSerializer<Uint8Array> {
12
+ readonly settings: JsonSettings;
13
+ private json;
14
+ private i;
15
+ private rootSchema;
16
+ private rawValue;
17
+ private passthrough;
18
+ constructor(settings: JsonSettings);
19
+ write(schema: Schema, value: unknown): void;
20
+ /**
21
+ * @internal
22
+ */
23
+ writeDiscriminatedDocument(schema: Schema, value: unknown): void;
24
+ /**
25
+ * Returns the serialized JSON as a Uint8Array (UTF-8 bytes).
26
+ * This is the primary output — pass directly to request.body.
27
+ */
28
+ flush(): Uint8Array;
29
+ protected ensure(byteCount: number): void;
30
+ /**
31
+ * Write a raw ASCII string (no JSON escaping). Used for pre-validated content
32
+ * like numeric literals and pre-encoded base64.
33
+ */
34
+ protected writeAscii(s: string): void;
35
+ /**
36
+ * Write a quoted ASCII string with no escape checking.
37
+ * Used for struct member keys (jsonName or model names) which are
38
+ * guaranteed to be safe ASCII identifiers. No control chars, quotes,
39
+ * backslashes, or non-ASCII.
40
+ * Ensures extra room for surrounding structural chars (comma, colon).
41
+ */
42
+ protected writeAsciiQuoted(s: string): void;
43
+ /**
44
+ * Write a JSON-escaped string including the surrounding quotes.
45
+ * Fast-path for ASCII, falls back to TextEncoder for multi-byte.
46
+ */
47
+ protected writeJsonString(s: string): void;
48
+ protected writeUnicodeEscape(code: number): void;
49
+ protected static readonly B64: Uint8Array;
50
+ /**
51
+ * Write a Uint8Array as a quoted base64 string directly into the buffer.
52
+ * No intermediate JS string, no escape checking (base64 alphabet is safe ASCII).
53
+ */
54
+ protected writeBase64(data: Uint8Array): void;
55
+ protected writeValue(schema: Schema, value: unknown, container: NormalizedSchema | undefined): void;
56
+ protected writeStruct(ns: NormalizedSchema, value: Record<string, unknown>): void;
57
+ protected writeList(ns: NormalizedSchema, value: unknown[], isDocument?: boolean): void;
58
+ protected writeMap(ns: NormalizedSchema, value: Record<string, unknown>, isDocument?: boolean): void;
59
+ protected writeTimestamp(ns: NormalizedSchema, value: Date): void;
60
+ }
@@ -1 +1 @@
1
- export declare function detectBufferParsing(): boolean;
1
+ export declare function detectBufferParsing(): boolean;
@@ -0,0 +1,21 @@
1
+ /**
2
+ * Serializes BigInt and NumericValue to JSON-number.
3
+ * @internal
4
+ */
5
+ export declare class JsonReplacer {
6
+ /**
7
+ * Stores placeholder key to true serialized value lookup.
8
+ */
9
+ private readonly values;
10
+ private counter;
11
+ private stage;
12
+ /**
13
+ * Creates a jsonReplacer function that reserves big integer and big decimal values
14
+ * for later replacement.
15
+ */
16
+ createReplacer(): (key: string, value: unknown) => unknown;
17
+ /**
18
+ * Replaces placeholder keys with their true values.
19
+ */
20
+ replaceInJson(json: string): string;
21
+ }
@@ -0,0 +1,15 @@
1
+ /**
2
+ * @param key - JSON object key.
3
+ * @param value - parsed value.
4
+ * @param context - original JSON string for reference. Not available until Node.js 21 and unavailable in Safari as
5
+ * of April 2025.
6
+ *
7
+ * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/parse#browser_compatibility
8
+ *
9
+ * @internal
10
+ *
11
+ * @returns transformed value.
12
+ */
13
+ export declare function jsonReviver(key: string, value: any, context?: {
14
+ source?: string;
15
+ }): any;
@@ -0,0 +1,11 @@
1
+ import { Schema } from "@smithy/types";
2
+ /**
3
+ * Determines whether a schema tree contains BigInteger or BigDecimal members,
4
+ * which require a JSON.parse reviver to preserve numeric precision.
5
+ *
6
+ * The result is cached on the root static schema array (struct schemas) via a Symbol key,
7
+ * so subsequent calls for the same schema are O(1).
8
+ *
9
+ * @internal
10
+ */
11
+ export declare function needsReviver(schema: Schema): boolean;