@cdklabs/cdk-ecs-codedeploy 0.0.436 → 0.0.438

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 (177) hide show
  1. package/.jsii +3 -3
  2. package/.jsii.tabl.json +1 -1
  3. package/lib/api-canary/index.js +1 -1
  4. package/lib/ecs-appspec/index.js +1 -1
  5. package/lib/ecs-deployment/index.js +1 -1
  6. package/lib/ecs-patterns/application-load-balanced-codedeployed-fargate-service.js +1 -1
  7. package/node_modules/@aws-sdk/client-codedeploy/package.json +34 -34
  8. package/node_modules/@aws-sdk/core/dist-cjs/index.js +69 -50
  9. package/node_modules/@aws-sdk/core/dist-cjs/submodules/client/index.js +17 -0
  10. package/node_modules/@aws-sdk/core/dist-cjs/submodules/protocols/index.js +52 -50
  11. package/node_modules/@aws-sdk/core/dist-es/submodules/client/index.js +1 -0
  12. package/node_modules/@aws-sdk/core/dist-es/submodules/client/longPollMiddleware.js +15 -0
  13. package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/ProtocolLib.js +11 -10
  14. package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/UnionSerde.js +4 -1
  15. package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/AwsJsonRpcProtocol.js +4 -5
  16. package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/AwsRestJsonProtocol.js +2 -1
  17. package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/JsonShapeSerializer.js +9 -7
  18. package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/parseJsonBody.js +17 -17
  19. package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/query/AwsQueryProtocol.js +3 -8
  20. package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/xml/AwsRestXmlProtocol.js +2 -1
  21. package/node_modules/@aws-sdk/core/dist-types/submodules/client/index.d.ts +1 -0
  22. package/node_modules/@aws-sdk/core/dist-types/submodules/client/longPollMiddleware.d.ts +14 -0
  23. package/node_modules/@aws-sdk/core/dist-types/submodules/protocols/json/JsonShapeSerializer.d.ts +2 -2
  24. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/index.d.ts +1 -0
  25. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/longPollMiddleware.d.ts +15 -0
  26. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/json/JsonShapeSerializer.d.ts +1 -1
  27. package/node_modules/@aws-sdk/core/package.json +11 -11
  28. package/node_modules/@aws-sdk/credential-provider-env/package.json +5 -5
  29. package/node_modules/@aws-sdk/credential-provider-http/package.json +10 -10
  30. package/node_modules/@aws-sdk/credential-provider-ini/package.json +14 -14
  31. package/node_modules/@aws-sdk/credential-provider-login/package.json +8 -8
  32. package/node_modules/@aws-sdk/credential-provider-node/package.json +12 -12
  33. package/node_modules/@aws-sdk/credential-provider-process/package.json +6 -6
  34. package/node_modules/@aws-sdk/credential-provider-sso/package.json +8 -8
  35. package/node_modules/@aws-sdk/credential-provider-web-identity/package.json +7 -7
  36. package/node_modules/@aws-sdk/middleware-host-header/package.json +4 -4
  37. package/node_modules/@aws-sdk/middleware-logger/package.json +3 -3
  38. package/node_modules/@aws-sdk/middleware-recursion-detection/package.json +4 -4
  39. package/node_modules/@aws-sdk/middleware-user-agent/package.json +8 -8
  40. package/node_modules/@aws-sdk/nested-clients/package.json +32 -32
  41. package/node_modules/@aws-sdk/region-config-resolver/package.json +5 -5
  42. package/node_modules/@aws-sdk/token-providers/package.json +7 -7
  43. package/node_modules/@aws-sdk/types/package.json +2 -2
  44. package/node_modules/@aws-sdk/util-endpoints/package.json +5 -5
  45. package/node_modules/@aws-sdk/util-user-agent-browser/package.json +3 -3
  46. package/node_modules/@aws-sdk/util-user-agent-node/package.json +5 -5
  47. package/node_modules/@aws-sdk/xml-builder/package.json +2 -2
  48. package/node_modules/@smithy/config-resolver/package.json +5 -5
  49. package/node_modules/@smithy/core/dist-cjs/index.js +2 -1
  50. package/node_modules/@smithy/core/dist-cjs/submodules/cbor/index.js +32 -14
  51. package/node_modules/@smithy/core/dist-cjs/submodules/endpoints/index.js +2 -2
  52. package/node_modules/@smithy/core/dist-cjs/submodules/event-streams/index.js +16 -8
  53. package/node_modules/@smithy/core/dist-cjs/submodules/protocols/index.js +17 -10
  54. package/node_modules/@smithy/core/dist-cjs/submodules/schema/index.js +6 -1
  55. package/node_modules/@smithy/core/dist-cjs/submodules/serde/index.js +6 -3
  56. package/node_modules/@smithy/core/dist-cjs/util-identity-and-auth/DefaultIdentityProviderConfig.js +2 -1
  57. package/node_modules/@smithy/core/dist-es/submodules/cbor/CborCodec.js +23 -11
  58. package/node_modules/@smithy/core/dist-es/submodules/cbor/parseCborBody.js +9 -3
  59. package/node_modules/@smithy/core/dist-es/submodules/endpoints/toEndpointV1.js +2 -2
  60. package/node_modules/@smithy/core/dist-es/submodules/event-streams/EventStreamSerde.js +16 -8
  61. package/node_modules/@smithy/core/dist-es/submodules/protocols/HttpBindingProtocol.js +9 -4
  62. package/node_modules/@smithy/core/dist-es/submodules/protocols/HttpProtocol.js +8 -6
  63. package/node_modules/@smithy/core/dist-es/submodules/schema/TypeRegistry.js +6 -1
  64. package/node_modules/@smithy/core/dist-es/submodules/serde/parse-utils.js +6 -3
  65. package/node_modules/@smithy/core/dist-es/util-identity-and-auth/DefaultIdentityProviderConfig.js +2 -1
  66. package/node_modules/@smithy/core/dist-types/submodules/schema/TypeRegistry.d.ts +1 -1
  67. package/node_modules/@smithy/core/package.json +7 -7
  68. package/node_modules/@smithy/credential-provider-imds/package.json +5 -5
  69. package/node_modules/@smithy/fetch-http-handler/package.json +5 -5
  70. package/node_modules/@smithy/hash-node/package.json +2 -2
  71. package/node_modules/@smithy/invalid-dependency/package.json +2 -2
  72. package/node_modules/@smithy/middleware-content-length/package.json +3 -3
  73. package/node_modules/@smithy/middleware-endpoint/package.json +8 -8
  74. package/node_modules/@smithy/middleware-retry/package.json +9 -9
  75. package/node_modules/@smithy/middleware-serde/package.json +4 -4
  76. package/node_modules/@smithy/middleware-stack/package.json +2 -2
  77. package/node_modules/@smithy/node-config-provider/package.json +4 -4
  78. package/node_modules/@smithy/node-http-handler/dist-cjs/index.js +191 -96
  79. package/node_modules/@smithy/node-http-handler/dist-es/http2/ClientHttp2SessionRef.js +45 -0
  80. package/node_modules/@smithy/node-http-handler/dist-es/node-http2-connection-manager.js +71 -35
  81. package/node_modules/@smithy/node-http-handler/dist-es/node-http2-connection-pool.js +32 -18
  82. package/node_modules/@smithy/node-http-handler/dist-es/node-http2-handler.js +44 -43
  83. package/node_modules/@smithy/node-http-handler/dist-types/http2/ClientHttp2SessionRef.d.ts +42 -0
  84. package/node_modules/@smithy/node-http-handler/dist-types/node-http2-connection-manager.d.ts +34 -14
  85. package/node_modules/@smithy/node-http-handler/dist-types/node-http2-connection-pool.d.ts +32 -8
  86. package/node_modules/@smithy/node-http-handler/dist-types/node-http2-handler.d.ts +14 -6
  87. package/node_modules/@smithy/node-http-handler/package.json +5 -5
  88. package/node_modules/@smithy/property-provider/package.json +2 -2
  89. package/node_modules/@smithy/protocol-http/package.json +2 -2
  90. package/node_modules/@smithy/querystring-builder/package.json +2 -2
  91. package/node_modules/@smithy/querystring-parser/package.json +2 -2
  92. package/node_modules/@smithy/service-error-classification/dist-cjs/index.js +5 -0
  93. package/node_modules/@smithy/service-error-classification/dist-es/index.js +4 -0
  94. package/node_modules/@smithy/service-error-classification/dist-types/index.d.ts +6 -0
  95. package/node_modules/@smithy/service-error-classification/package.json +2 -2
  96. package/node_modules/@smithy/shared-ini-file-loader/package.json +2 -2
  97. package/node_modules/@smithy/signature-v4/dist-cjs/index.js +11 -5
  98. package/node_modules/@smithy/signature-v4/dist-es/SignatureV4.js +11 -5
  99. package/node_modules/@smithy/signature-v4/dist-types/SignatureV4.d.ts +3 -3
  100. package/node_modules/@smithy/signature-v4/package.json +4 -4
  101. package/node_modules/@smithy/smithy-client/dist-cjs/index.js +8 -1
  102. package/node_modules/@smithy/smithy-client/dist-es/command.js +8 -1
  103. package/node_modules/@smithy/smithy-client/package.json +7 -7
  104. package/node_modules/@smithy/types/dist-types/connection/config.d.ts +5 -0
  105. package/node_modules/@smithy/types/dist-types/signature.d.ts +20 -3
  106. package/node_modules/@smithy/types/package.json +1 -1
  107. package/node_modules/@smithy/url-parser/package.json +3 -3
  108. package/node_modules/@smithy/util-defaults-mode-browser/package.json +4 -4
  109. package/node_modules/@smithy/util-defaults-mode-node/package.json +7 -7
  110. package/node_modules/@smithy/util-endpoints/dist-cjs/index.js +212 -111
  111. package/node_modules/@smithy/util-endpoints/dist-es/bdd/BinaryDecisionDiagram.js +15 -0
  112. package/node_modules/@smithy/util-endpoints/dist-es/decideEndpoint.js +42 -0
  113. package/node_modules/@smithy/util-endpoints/dist-es/index.js +2 -0
  114. package/node_modules/@smithy/util-endpoints/dist-es/lib/coalesce.js +8 -0
  115. package/node_modules/@smithy/util-endpoints/dist-es/lib/getAttr.js +2 -1
  116. package/node_modules/@smithy/util-endpoints/dist-es/lib/index.js +3 -0
  117. package/node_modules/@smithy/util-endpoints/dist-es/lib/ite.js +3 -0
  118. package/node_modules/@smithy/util-endpoints/dist-es/lib/split.js +13 -0
  119. package/node_modules/@smithy/util-endpoints/dist-es/lib/substring.js +1 -1
  120. package/node_modules/@smithy/util-endpoints/dist-es/resolveEndpoint.js +8 -13
  121. package/node_modules/@smithy/util-endpoints/dist-es/utils/endpointFunctions.js +4 -1
  122. package/node_modules/@smithy/util-endpoints/dist-es/utils/evaluateCondition.js +9 -7
  123. package/node_modules/@smithy/util-endpoints/dist-es/utils/evaluateConditions.js +12 -8
  124. package/node_modules/@smithy/util-endpoints/dist-es/utils/evaluateEndpointRule.js +14 -13
  125. package/node_modules/@smithy/util-endpoints/dist-es/utils/evaluateErrorRule.js +7 -4
  126. package/node_modules/@smithy/util-endpoints/dist-es/utils/evaluateExpression.js +22 -5
  127. package/node_modules/@smithy/util-endpoints/dist-es/utils/evaluateRules.js +4 -4
  128. package/node_modules/@smithy/util-endpoints/dist-es/utils/evaluateTemplate.js +3 -6
  129. package/node_modules/@smithy/util-endpoints/dist-es/utils/getEndpointHeaders.js +5 -5
  130. package/node_modules/@smithy/util-endpoints/dist-es/utils/getEndpointProperties.js +4 -4
  131. package/node_modules/@smithy/util-endpoints/dist-es/utils/getReferenceValue.js +1 -5
  132. package/node_modules/@smithy/util-endpoints/dist-types/bdd/BinaryDecisionDiagram.d.ts +22 -0
  133. package/node_modules/@smithy/util-endpoints/dist-types/decideEndpoint.d.ts +7 -0
  134. package/node_modules/@smithy/util-endpoints/dist-types/index.d.ts +2 -0
  135. package/node_modules/@smithy/util-endpoints/dist-types/lib/coalesce.d.ts +7 -0
  136. package/node_modules/@smithy/util-endpoints/dist-types/lib/index.d.ts +3 -0
  137. package/node_modules/@smithy/util-endpoints/dist-types/lib/ite.d.ts +6 -0
  138. package/node_modules/@smithy/util-endpoints/dist-types/lib/split.d.ts +11 -0
  139. package/node_modules/@smithy/util-endpoints/dist-types/types/shared.d.ts +3 -3
  140. package/node_modules/@smithy/util-endpoints/dist-types/utils/endpointFunctions.d.ts +2 -11
  141. package/node_modules/@smithy/util-endpoints/dist-types/utils/evaluateCondition.d.ts +6 -3
  142. package/node_modules/@smithy/util-endpoints/dist-types/utils/evaluateConditions.d.ts +3 -3
  143. package/node_modules/@smithy/util-endpoints/dist-types/utils/getEndpointHeaders.d.ts +1 -1
  144. package/node_modules/@smithy/util-endpoints/dist-types/utils/getEndpointProperties.d.ts +2 -2
  145. package/node_modules/@smithy/util-endpoints/dist-types/utils/getReferenceValue.d.ts +3 -1
  146. package/node_modules/@smithy/util-endpoints/package.json +3 -3
  147. package/node_modules/@smithy/util-middleware/package.json +2 -2
  148. package/node_modules/@smithy/util-retry/dist-cjs/index.js +6 -0
  149. package/node_modules/@smithy/util-retry/dist-es/AdaptiveRetryStrategy.js +3 -0
  150. package/node_modules/@smithy/util-retry/dist-es/StandardRetryStrategy.js +3 -0
  151. package/node_modules/@smithy/util-retry/dist-types/AdaptiveRetryStrategy.d.ts +5 -0
  152. package/node_modules/@smithy/util-retry/dist-types/StandardRetryStrategy.d.ts +5 -0
  153. package/node_modules/@smithy/util-retry/package.json +3 -3
  154. package/node_modules/@smithy/util-stream/package.json +4 -4
  155. package/node_modules/@smithy/util-waiter/package.json +3 -3
  156. package/node_modules/fast-xml-builder/package.json +1 -1
  157. package/node_modules/fast-xml-builder/src/fxb.js +6 -2
  158. package/node_modules/fast-xml-builder/src/orderedJs2Xml.js +16 -2
  159. package/node_modules/path-expression-matcher/README.md +214 -62
  160. package/node_modules/path-expression-matcher/lib/pem.cjs +1 -1
  161. package/node_modules/path-expression-matcher/lib/pem.d.cts +111 -0
  162. package/node_modules/path-expression-matcher/lib/pem.min.js +1 -1
  163. package/node_modules/path-expression-matcher/lib/pem.min.js.map +1 -1
  164. package/node_modules/path-expression-matcher/package.json +1 -1
  165. package/node_modules/path-expression-matcher/src/Expression.js +2 -2
  166. package/node_modules/path-expression-matcher/src/ExpressionSet.js +209 -0
  167. package/node_modules/path-expression-matcher/src/Matcher.js +235 -177
  168. package/node_modules/path-expression-matcher/src/index.d.ts +199 -194
  169. package/node_modules/path-expression-matcher/src/index.js +3 -2
  170. package/node_modules/strnum/package.json +1 -1
  171. package/package.json +6 -6
  172. package/node_modules/strnum/.github/SECURITY.md +0 -5
  173. package/node_modules/strnum/.vscode/launch.json +0 -25
  174. package/node_modules/strnum/algo.stflow +0 -84
  175. package/node_modules/strnum/tests/infinity_test.js +0 -18
  176. package/node_modules/strnum/tests/strnum_test.js +0 -175
  177. package/node_modules/strnum/tests/temp.js +0 -8
@@ -16,6 +16,22 @@ More information can be found at: https://a.co/c895JFp`);
16
16
  }
17
17
  };
18
18
 
19
+ const longPollMiddleware = () => (next, context) => async (args) => {
20
+ context.__retryLongPoll = true;
21
+ return next(args);
22
+ };
23
+ const longPollMiddlewareOptions = {
24
+ name: "longPollMiddleware",
25
+ tags: ["RETRY"],
26
+ step: "initialize",
27
+ override: true,
28
+ };
29
+ const getLongPollPlugin = (options) => ({
30
+ applyToStack: (clientStack) => {
31
+ clientStack.add(longPollMiddleware(), longPollMiddlewareOptions);
32
+ },
33
+ });
34
+
19
35
  function setCredentialFeature(credentials, feature, value) {
20
36
  if (!credentials.$source) {
21
37
  credentials.$source = {};
@@ -45,6 +61,7 @@ function setTokenFeature(token, feature, value) {
45
61
  }
46
62
 
47
63
  exports.emitWarningIfUnsupportedVersion = emitWarningIfUnsupportedVersion;
64
+ exports.getLongPollPlugin = getLongPollPlugin;
48
65
  exports.setCredentialFeature = setCredentialFeature;
49
66
  exports.setFeature = setFeature;
50
67
  exports.setTokenFeature = setTokenFeature;
@@ -96,12 +96,11 @@ class ProtocolLib {
96
96
  if (msg) {
97
97
  error.message = msg;
98
98
  }
99
- error.Error = {
100
- ...error.Error,
101
- Type: error.Error?.Type,
102
- Code: error.Error?.Code,
103
- Message: error.Error?.message ?? error.Error?.Message ?? msg,
104
- };
99
+ const errorObj = error.Error ?? {};
100
+ errorObj.Type = error.Error?.Type;
101
+ errorObj.Code = error.Error?.Code;
102
+ errorObj.Message = error.Error?.message ?? error.Error?.Message ?? msg;
103
+ error.Error = errorObj;
105
104
  const reqId = error.$metadata.requestId;
106
105
  if (reqId) {
107
106
  error.RequestId = reqId;
@@ -114,14 +113,16 @@ class ProtocolLib {
114
113
  const queryErrorHeader = response.headers?.["x-amzn-query-error"];
115
114
  if (output !== undefined && queryErrorHeader != null) {
116
115
  const [Code, Type] = queryErrorHeader.split(";");
117
- const entries = Object.entries(output);
116
+ const keys = Object.keys(output);
118
117
  const Error = {
119
118
  Code,
120
119
  Type,
121
120
  };
122
- Object.assign(output, Error);
123
- for (const [k, v] of entries) {
124
- Error[k === "message" ? "Message" : k] = v;
121
+ output.Code = Code;
122
+ output.Type = Type;
123
+ for (let i = 0; i < keys.length; i++) {
124
+ const k = keys[i];
125
+ Error[k === "message" ? "Message" : k] = output[k];
125
126
  }
126
127
  delete Error.__type;
127
128
  output.Error = Error;
@@ -260,7 +261,10 @@ class UnionSerde {
260
261
  constructor(from, to) {
261
262
  this.from = from;
262
263
  this.to = to;
263
- this.keys = new Set(Object.keys(this.from).filter((k) => k !== "__type"));
264
+ const keys = Object.keys(this.from);
265
+ const set = new Set(keys);
266
+ set.delete("__type");
267
+ this.keys = set;
264
268
  }
265
269
  mark(key) {
266
270
  this.keys.delete(key);
@@ -318,24 +322,24 @@ const parseJsonErrorBody = async (errorBody, context) => {
318
322
  value.message = value.message ?? value.Message;
319
323
  return value;
320
324
  };
325
+ const findKey = (object, key) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase());
326
+ const sanitizeErrorCode = (rawValue) => {
327
+ let cleanValue = rawValue;
328
+ if (typeof cleanValue === "number") {
329
+ cleanValue = cleanValue.toString();
330
+ }
331
+ if (cleanValue.indexOf(",") >= 0) {
332
+ cleanValue = cleanValue.split(",")[0];
333
+ }
334
+ if (cleanValue.indexOf(":") >= 0) {
335
+ cleanValue = cleanValue.split(":")[0];
336
+ }
337
+ if (cleanValue.indexOf("#") >= 0) {
338
+ cleanValue = cleanValue.split("#")[1];
339
+ }
340
+ return cleanValue;
341
+ };
321
342
  const loadRestJsonErrorCode = (output, data) => {
322
- const findKey = (object, key) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase());
323
- const sanitizeErrorCode = (rawValue) => {
324
- let cleanValue = rawValue;
325
- if (typeof cleanValue === "number") {
326
- cleanValue = cleanValue.toString();
327
- }
328
- if (cleanValue.indexOf(",") >= 0) {
329
- cleanValue = cleanValue.split(",")[0];
330
- }
331
- if (cleanValue.indexOf(":") >= 0) {
332
- cleanValue = cleanValue.split(":")[0];
333
- }
334
- if (cleanValue.indexOf("#") >= 0) {
335
- cleanValue = cleanValue.split("#")[1];
336
- }
337
- return cleanValue;
338
- };
339
343
  const headerKey = findKey(output.headers, "x-amzn-errortype");
340
344
  if (headerKey !== undefined) {
341
345
  return sanitizeErrorCode(output.headers[headerKey]);
@@ -552,12 +556,6 @@ class JsonShapeSerializer extends SerdeContextConfig {
552
556
  this.rootSchema = schema.NormalizedSchema.of(schema$1);
553
557
  this.buffer = this._write(this.rootSchema, value);
554
558
  }
555
- writeDiscriminatedDocument(schema$1, value) {
556
- this.write(schema$1, value);
557
- if (typeof this.buffer === "object") {
558
- this.buffer.__type = schema.NormalizedSchema.of(schema$1).getName(true);
559
- }
560
- }
561
559
  flush() {
562
560
  const { rootSchema, useReplacer } = this;
563
561
  this.rootSchema = undefined;
@@ -571,6 +569,12 @@ class JsonShapeSerializer extends SerdeContextConfig {
571
569
  }
572
570
  return this.buffer;
573
571
  }
572
+ writeDiscriminatedDocument(schema$1, value) {
573
+ this.write(schema$1, value);
574
+ if (typeof this.buffer === "object") {
575
+ this.buffer.__type = schema.NormalizedSchema.of(schema$1).getName(true);
576
+ }
577
+ }
574
578
  _write(schema$1, value, container) {
575
579
  const isObject = value !== null && typeof value === "object";
576
580
  const ns = schema.NormalizedSchema.of(schema$1);
@@ -583,6 +587,7 @@ class JsonShapeSerializer extends SerdeContextConfig {
583
587
  if (jsonName) {
584
588
  nameMap = {};
585
589
  }
590
+ let outCount = 0;
586
591
  for (const [memberName, memberSchema] of ns.structIterator()) {
587
592
  const serializableValue = this._write(memberSchema, record[memberName], ns);
588
593
  if (serializableValue !== undefined) {
@@ -592,9 +597,10 @@ class JsonShapeSerializer extends SerdeContextConfig {
592
597
  nameMap[memberName] = targetKey;
593
598
  }
594
599
  out[targetKey] = serializableValue;
600
+ outCount++;
595
601
  }
596
602
  }
597
- if (ns.isUnionSchema() && Object.keys(out).length === 0) {
603
+ if (ns.isUnionSchema() && outCount === 0) {
598
604
  const { $unknown } = record;
599
605
  if (Array.isArray($unknown)) {
600
606
  const [k, v] = $unknown;
@@ -760,10 +766,8 @@ class AwsJsonRpcProtocol extends protocols.RpcProtocol {
760
766
  if (!request.path.endsWith("/")) {
761
767
  request.path += "/";
762
768
  }
763
- Object.assign(request.headers, {
764
- "content-type": `application/x-amz-json-${this.getJsonRpcVersion()}`,
765
- "x-amz-target": `${this.serviceTarget}.${operationSchema.name}`,
766
- });
769
+ request.headers["content-type"] = `application/x-amz-json-${this.getJsonRpcVersion()}`;
770
+ request.headers["x-amz-target"] = `${this.serviceTarget}.${operationSchema.name}`;
767
771
  if (this.awsQueryCompatible) {
768
772
  request.headers["x-amzn-query-mode"] = "true";
769
773
  }
@@ -787,9 +791,10 @@ class AwsJsonRpcProtocol extends protocols.RpcProtocol {
787
791
  const ErrorCtor = this.compositeErrorRegistry.getErrorCtor(errorSchema) ?? Error;
788
792
  const exception = new ErrorCtor(message);
789
793
  const output = {};
794
+ const errorDeserializer = this.codec.createDeserializer();
790
795
  for (const [name, member] of ns.structIterator()) {
791
796
  if (dataObject[name] != null) {
792
- output[name] = this.codec.createDeserializer().readObject(member, dataObject[name]);
797
+ output[name] = errorDeserializer.readObject(member, dataObject[name]);
793
798
  }
794
799
  }
795
800
  if (this.awsQueryCompatible) {
@@ -910,9 +915,10 @@ class AwsRestJsonProtocol extends protocols.HttpBindingProtocol {
910
915
  const exception = new ErrorCtor(message);
911
916
  await this.deserializeHttpMessage(errorSchema, context, response, dataObject);
912
917
  const output = {};
918
+ const errorDeserializer = this.codec.createDeserializer();
913
919
  for (const [name, member] of ns.structIterator()) {
914
920
  const target = member.getMergedTraits().jsonName ?? name;
915
- output[name] = this.codec.createDeserializer().readObject(member, dataObject[target]);
921
+ output[name] = errorDeserializer.readObject(member, dataObject[target]);
916
922
  }
917
923
  throw this.mixin.decorateServiceException(Object.assign(exception, errorMetadata, {
918
924
  $fault: ns.getMergedTraits().error,
@@ -1303,9 +1309,7 @@ class AwsQueryProtocol extends protocols.RpcProtocol {
1303
1309
  if (!request.path.endsWith("/")) {
1304
1310
  request.path += "/";
1305
1311
  }
1306
- Object.assign(request.headers, {
1307
- "content-type": `application/x-www-form-urlencoded`,
1308
- });
1312
+ request.headers["content-type"] = "application/x-www-form-urlencoded";
1309
1313
  if (schema.deref(operationSchema.input) === "unit" || !request.body) {
1310
1314
  request.body = "";
1311
1315
  }
@@ -1338,11 +1342,8 @@ class AwsQueryProtocol extends protocols.RpcProtocol {
1338
1342
  if (bytes.byteLength > 0) {
1339
1343
  Object.assign(dataObject, await deserializer.read(ns, bytes, awsQueryResultKey));
1340
1344
  }
1341
- const output = {
1342
- $metadata: this.deserializeMetadata(response),
1343
- ...dataObject,
1344
- };
1345
- return output;
1345
+ dataObject.$metadata = this.deserializeMetadata(response);
1346
+ return dataObject;
1346
1347
  }
1347
1348
  useNestedResult() {
1348
1349
  return true;
@@ -1842,10 +1843,11 @@ class AwsRestXmlProtocol extends protocols.HttpBindingProtocol {
1842
1843
  const exception = new ErrorCtor(message);
1843
1844
  await this.deserializeHttpMessage(errorSchema, context, response, dataObject);
1844
1845
  const output = {};
1846
+ const errorDeserializer = this.codec.createDeserializer();
1845
1847
  for (const [name, member] of ns.structIterator()) {
1846
1848
  const target = member.getMergedTraits().xmlName ?? name;
1847
1849
  const value = dataObject.Error?.[target] ?? dataObject[target];
1848
- output[name] = this.codec.createDeserializer().readSchema(member, value);
1850
+ output[name] = errorDeserializer.readSchema(member, value);
1849
1851
  }
1850
1852
  throw this.mixin.decorateServiceException(Object.assign(exception, errorMetadata, {
1851
1853
  $fault: ns.getMergedTraits().error,
@@ -1,4 +1,5 @@
1
1
  export * from "./emitWarningIfUnsupportedVersion";
2
+ export { getLongPollPlugin } from "./longPollMiddleware";
2
3
  export * from "./setCredentialFeature";
3
4
  export * from "./setFeature";
4
5
  export * from "./setTokenFeature";
@@ -0,0 +1,15 @@
1
+ export const longPollMiddleware = () => (next, context) => async (args) => {
2
+ context.__retryLongPoll = true;
3
+ return next(args);
4
+ };
5
+ export const longPollMiddlewareOptions = {
6
+ name: "longPollMiddleware",
7
+ tags: ["RETRY"],
8
+ step: "initialize",
9
+ override: true,
10
+ };
11
+ export const getLongPollPlugin = (options) => ({
12
+ applyToStack: (clientStack) => {
13
+ clientStack.add(longPollMiddleware(), longPollMiddlewareOptions);
14
+ },
15
+ });
@@ -87,12 +87,11 @@ export class ProtocolLib {
87
87
  if (msg) {
88
88
  error.message = msg;
89
89
  }
90
- error.Error = {
91
- ...error.Error,
92
- Type: error.Error?.Type,
93
- Code: error.Error?.Code,
94
- Message: error.Error?.message ?? error.Error?.Message ?? msg,
95
- };
90
+ const errorObj = error.Error ?? {};
91
+ errorObj.Type = error.Error?.Type;
92
+ errorObj.Code = error.Error?.Code;
93
+ errorObj.Message = error.Error?.message ?? error.Error?.Message ?? msg;
94
+ error.Error = errorObj;
96
95
  const reqId = error.$metadata.requestId;
97
96
  if (reqId) {
98
97
  error.RequestId = reqId;
@@ -105,14 +104,16 @@ export class ProtocolLib {
105
104
  const queryErrorHeader = response.headers?.["x-amzn-query-error"];
106
105
  if (output !== undefined && queryErrorHeader != null) {
107
106
  const [Code, Type] = queryErrorHeader.split(";");
108
- const entries = Object.entries(output);
107
+ const keys = Object.keys(output);
109
108
  const Error = {
110
109
  Code,
111
110
  Type,
112
111
  };
113
- Object.assign(output, Error);
114
- for (const [k, v] of entries) {
115
- Error[k === "message" ? "Message" : k] = v;
112
+ output.Code = Code;
113
+ output.Type = Type;
114
+ for (let i = 0; i < keys.length; i++) {
115
+ const k = keys[i];
116
+ Error[k === "message" ? "Message" : k] = output[k];
116
117
  }
117
118
  delete Error.__type;
118
119
  output.Error = Error;
@@ -5,7 +5,10 @@ export class UnionSerde {
5
5
  constructor(from, to) {
6
6
  this.from = from;
7
7
  this.to = to;
8
- this.keys = new Set(Object.keys(this.from).filter((k) => k !== "__type"));
8
+ const keys = Object.keys(this.from);
9
+ const set = new Set(keys);
10
+ set.delete("__type");
11
+ this.keys = set;
9
12
  }
10
13
  mark(key) {
11
14
  this.keys.delete(key);
@@ -35,10 +35,8 @@ export class AwsJsonRpcProtocol extends RpcProtocol {
35
35
  if (!request.path.endsWith("/")) {
36
36
  request.path += "/";
37
37
  }
38
- Object.assign(request.headers, {
39
- "content-type": `application/x-amz-json-${this.getJsonRpcVersion()}`,
40
- "x-amz-target": `${this.serviceTarget}.${operationSchema.name}`,
41
- });
38
+ request.headers["content-type"] = `application/x-amz-json-${this.getJsonRpcVersion()}`;
39
+ request.headers["x-amz-target"] = `${this.serviceTarget}.${operationSchema.name}`;
42
40
  if (this.awsQueryCompatible) {
43
41
  request.headers["x-amzn-query-mode"] = "true";
44
42
  }
@@ -62,9 +60,10 @@ export class AwsJsonRpcProtocol extends RpcProtocol {
62
60
  const ErrorCtor = this.compositeErrorRegistry.getErrorCtor(errorSchema) ?? Error;
63
61
  const exception = new ErrorCtor(message);
64
62
  const output = {};
63
+ const errorDeserializer = this.codec.createDeserializer();
65
64
  for (const [name, member] of ns.structIterator()) {
66
65
  if (dataObject[name] != null) {
67
- output[name] = this.codec.createDeserializer().readObject(member, dataObject[name]);
66
+ output[name] = errorDeserializer.readObject(member, dataObject[name]);
68
67
  }
69
68
  }
70
69
  if (this.awsQueryCompatible) {
@@ -69,9 +69,10 @@ export class AwsRestJsonProtocol extends HttpBindingProtocol {
69
69
  const exception = new ErrorCtor(message);
70
70
  await this.deserializeHttpMessage(errorSchema, context, response, dataObject);
71
71
  const output = {};
72
+ const errorDeserializer = this.codec.createDeserializer();
72
73
  for (const [name, member] of ns.structIterator()) {
73
74
  const target = member.getMergedTraits().jsonName ?? name;
74
- output[name] = this.codec.createDeserializer().readObject(member, dataObject[target]);
75
+ output[name] = errorDeserializer.readObject(member, dataObject[target]);
75
76
  }
76
77
  throw this.mixin.decorateServiceException(Object.assign(exception, errorMetadata, {
77
78
  $fault: ns.getMergedTraits().error,
@@ -17,12 +17,6 @@ export class JsonShapeSerializer extends SerdeContextConfig {
17
17
  this.rootSchema = NormalizedSchema.of(schema);
18
18
  this.buffer = this._write(this.rootSchema, value);
19
19
  }
20
- writeDiscriminatedDocument(schema, value) {
21
- this.write(schema, value);
22
- if (typeof this.buffer === "object") {
23
- this.buffer.__type = NormalizedSchema.of(schema).getName(true);
24
- }
25
- }
26
20
  flush() {
27
21
  const { rootSchema, useReplacer } = this;
28
22
  this.rootSchema = undefined;
@@ -36,6 +30,12 @@ export class JsonShapeSerializer extends SerdeContextConfig {
36
30
  }
37
31
  return this.buffer;
38
32
  }
33
+ writeDiscriminatedDocument(schema, value) {
34
+ this.write(schema, value);
35
+ if (typeof this.buffer === "object") {
36
+ this.buffer.__type = NormalizedSchema.of(schema).getName(true);
37
+ }
38
+ }
39
39
  _write(schema, value, container) {
40
40
  const isObject = value !== null && typeof value === "object";
41
41
  const ns = NormalizedSchema.of(schema);
@@ -48,6 +48,7 @@ export class JsonShapeSerializer extends SerdeContextConfig {
48
48
  if (jsonName) {
49
49
  nameMap = {};
50
50
  }
51
+ let outCount = 0;
51
52
  for (const [memberName, memberSchema] of ns.structIterator()) {
52
53
  const serializableValue = this._write(memberSchema, record[memberName], ns);
53
54
  if (serializableValue !== undefined) {
@@ -57,9 +58,10 @@ export class JsonShapeSerializer extends SerdeContextConfig {
57
58
  nameMap[memberName] = targetKey;
58
59
  }
59
60
  out[targetKey] = serializableValue;
61
+ outCount++;
60
62
  }
61
63
  }
62
- if (ns.isUnionSchema() && Object.keys(out).length === 0) {
64
+ if (ns.isUnionSchema() && outCount === 0) {
63
65
  const { $unknown } = record;
64
66
  if (Array.isArray($unknown)) {
65
67
  const [k, v] = $unknown;
@@ -20,24 +20,24 @@ export const parseJsonErrorBody = async (errorBody, context) => {
20
20
  value.message = value.message ?? value.Message;
21
21
  return value;
22
22
  };
23
+ const findKey = (object, key) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase());
24
+ const sanitizeErrorCode = (rawValue) => {
25
+ let cleanValue = rawValue;
26
+ if (typeof cleanValue === "number") {
27
+ cleanValue = cleanValue.toString();
28
+ }
29
+ if (cleanValue.indexOf(",") >= 0) {
30
+ cleanValue = cleanValue.split(",")[0];
31
+ }
32
+ if (cleanValue.indexOf(":") >= 0) {
33
+ cleanValue = cleanValue.split(":")[0];
34
+ }
35
+ if (cleanValue.indexOf("#") >= 0) {
36
+ cleanValue = cleanValue.split("#")[1];
37
+ }
38
+ return cleanValue;
39
+ };
23
40
  export const loadRestJsonErrorCode = (output, data) => {
24
- const findKey = (object, key) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase());
25
- const sanitizeErrorCode = (rawValue) => {
26
- let cleanValue = rawValue;
27
- if (typeof cleanValue === "number") {
28
- cleanValue = cleanValue.toString();
29
- }
30
- if (cleanValue.indexOf(",") >= 0) {
31
- cleanValue = cleanValue.split(",")[0];
32
- }
33
- if (cleanValue.indexOf(":") >= 0) {
34
- cleanValue = cleanValue.split(":")[0];
35
- }
36
- if (cleanValue.indexOf("#") >= 0) {
37
- cleanValue = cleanValue.split("#")[1];
38
- }
39
- return cleanValue;
40
- };
41
41
  const headerKey = findKey(output.headers, "x-amzn-errortype");
42
42
  if (headerKey !== undefined) {
43
43
  return sanitizeErrorCode(output.headers[headerKey]);
@@ -42,9 +42,7 @@ export class AwsQueryProtocol extends RpcProtocol {
42
42
  if (!request.path.endsWith("/")) {
43
43
  request.path += "/";
44
44
  }
45
- Object.assign(request.headers, {
46
- "content-type": `application/x-www-form-urlencoded`,
47
- });
45
+ request.headers["content-type"] = "application/x-www-form-urlencoded";
48
46
  if (deref(operationSchema.input) === "unit" || !request.body) {
49
47
  request.body = "";
50
48
  }
@@ -77,11 +75,8 @@ export class AwsQueryProtocol extends RpcProtocol {
77
75
  if (bytes.byteLength > 0) {
78
76
  Object.assign(dataObject, await deserializer.read(ns, bytes, awsQueryResultKey));
79
77
  }
80
- const output = {
81
- $metadata: this.deserializeMetadata(response),
82
- ...dataObject,
83
- };
84
- return output;
78
+ dataObject.$metadata = this.deserializeMetadata(response);
79
+ return dataObject;
85
80
  }
86
81
  useNestedResult() {
87
82
  return true;
@@ -75,10 +75,11 @@ export class AwsRestXmlProtocol extends HttpBindingProtocol {
75
75
  const exception = new ErrorCtor(message);
76
76
  await this.deserializeHttpMessage(errorSchema, context, response, dataObject);
77
77
  const output = {};
78
+ const errorDeserializer = this.codec.createDeserializer();
78
79
  for (const [name, member] of ns.structIterator()) {
79
80
  const target = member.getMergedTraits().xmlName ?? name;
80
81
  const value = dataObject.Error?.[target] ?? dataObject[target];
81
- output[name] = this.codec.createDeserializer().readSchema(member, value);
82
+ output[name] = errorDeserializer.readSchema(member, value);
82
83
  }
83
84
  throw this.mixin.decorateServiceException(Object.assign(exception, errorMetadata, {
84
85
  $fault: ns.getMergedTraits().error,
@@ -1,4 +1,5 @@
1
1
  export * from "./emitWarningIfUnsupportedVersion";
2
+ export { getLongPollPlugin } from "./longPollMiddleware";
2
3
  export * from "./setCredentialFeature";
3
4
  export * from "./setFeature";
4
5
  export * from "./setTokenFeature";
@@ -0,0 +1,14 @@
1
+ import type { HandlerExecutionContext, InitializeHandler, InitializeHandlerOptions, MetadataBearer, Pluggable } from "@smithy/types";
2
+ /**
3
+ * This middleware is attached to operations designated as long-polling.
4
+ * @internal
5
+ */
6
+ export declare const longPollMiddleware: () => <Output extends MetadataBearer = MetadataBearer>(next: InitializeHandler<any, Output>, context: HandlerExecutionContext) => InitializeHandler<any, Output>;
7
+ /**
8
+ * @internal
9
+ */
10
+ export declare const longPollMiddlewareOptions: InitializeHandlerOptions;
11
+ /**
12
+ * @internal
13
+ */
14
+ export declare const getLongPollPlugin: (options: {}) => Pluggable<any, any>;
@@ -16,13 +16,13 @@ export declare class JsonShapeSerializer extends SerdeContextConfig implements S
16
16
  protected rootSchema: NormalizedSchema | undefined;
17
17
  constructor(settings: JsonSettings);
18
18
  write(schema: Schema, value: unknown): void;
19
+ flush(): string;
19
20
  /**
20
21
  * @internal
21
22
  */
22
23
  writeDiscriminatedDocument(schema: Schema, value: unknown): void;
23
- flush(): string;
24
24
  /**
25
- * Order if-statements by order of likelihood.
25
+ * Order if-statements by likelihood.
26
26
  */
27
27
  protected _write(schema: Schema, value: unknown, container?: NormalizedSchema): any;
28
28
  }
@@ -1,4 +1,5 @@
1
1
  export * from "./emitWarningIfUnsupportedVersion";
2
+ export { getLongPollPlugin } from "./longPollMiddleware";
2
3
  export * from "./setCredentialFeature";
3
4
  export * from "./setFeature";
4
5
  export * from "./setTokenFeature";
@@ -0,0 +1,15 @@
1
+ import {
2
+ HandlerExecutionContext,
3
+ InitializeHandler,
4
+ InitializeHandlerOptions,
5
+ MetadataBearer,
6
+ Pluggable,
7
+ } from "@smithy/types";
8
+ export declare const longPollMiddleware: () => <
9
+ Output extends MetadataBearer = MetadataBearer
10
+ >(
11
+ next: InitializeHandler<any, Output>,
12
+ context: HandlerExecutionContext
13
+ ) => InitializeHandler<any, Output>;
14
+ export declare const longPollMiddlewareOptions: InitializeHandlerOptions;
15
+ export declare const getLongPollPlugin: (options: {}) => Pluggable<any, any>;
@@ -12,8 +12,8 @@ export declare class JsonShapeSerializer
12
12
  protected rootSchema: NormalizedSchema | undefined;
13
13
  constructor(settings: JsonSettings);
14
14
  write(schema: Schema, value: unknown): void;
15
- writeDiscriminatedDocument(schema: Schema, value: unknown): void;
16
15
  flush(): string;
16
+ writeDiscriminatedDocument(schema: Schema, value: unknown): void;
17
17
  protected _write(
18
18
  schema: Schema,
19
19
  value: unknown,
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aws-sdk/core",
3
- "version": "3.973.26",
3
+ "version": "3.974.1",
4
4
  "description": "Core functions & classes shared by multiple AWS SDK clients.",
5
5
  "scripts": {
6
6
  "build": "yarn lint && concurrently 'yarn:build:types' 'yarn:build:es' && yarn build:cjs",
@@ -81,17 +81,17 @@
81
81
  },
82
82
  "license": "Apache-2.0",
83
83
  "dependencies": {
84
- "@aws-sdk/types": "^3.973.6",
85
- "@aws-sdk/xml-builder": "^3.972.16",
86
- "@smithy/core": "^3.23.13",
87
- "@smithy/node-config-provider": "^4.3.12",
88
- "@smithy/property-provider": "^4.2.12",
89
- "@smithy/protocol-http": "^5.3.12",
90
- "@smithy/signature-v4": "^5.3.12",
91
- "@smithy/smithy-client": "^4.12.8",
92
- "@smithy/types": "^4.13.1",
84
+ "@aws-sdk/types": "^3.973.8",
85
+ "@aws-sdk/xml-builder": "^3.972.18",
86
+ "@smithy/core": "^3.23.15",
87
+ "@smithy/node-config-provider": "^4.3.14",
88
+ "@smithy/property-provider": "^4.2.14",
89
+ "@smithy/protocol-http": "^5.3.14",
90
+ "@smithy/signature-v4": "^5.3.14",
91
+ "@smithy/smithy-client": "^4.12.11",
92
+ "@smithy/types": "^4.14.1",
93
93
  "@smithy/util-base64": "^4.3.2",
94
- "@smithy/util-middleware": "^4.2.12",
94
+ "@smithy/util-middleware": "^4.2.14",
95
95
  "@smithy/util-utf8": "^4.2.2",
96
96
  "tslib": "^2.6.2"
97
97
  },
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aws-sdk/credential-provider-env",
3
- "version": "3.972.24",
3
+ "version": "3.972.27",
4
4
  "description": "AWS credential provider that sources credentials from known environment variables",
5
5
  "main": "./dist-cjs/index.js",
6
6
  "module": "./dist-es/index.js",
@@ -26,10 +26,10 @@
26
26
  },
27
27
  "license": "Apache-2.0",
28
28
  "dependencies": {
29
- "@aws-sdk/core": "^3.973.26",
30
- "@aws-sdk/types": "^3.973.6",
31
- "@smithy/property-provider": "^4.2.12",
32
- "@smithy/types": "^4.13.1",
29
+ "@aws-sdk/core": "^3.974.1",
30
+ "@aws-sdk/types": "^3.973.8",
31
+ "@smithy/property-provider": "^4.2.14",
32
+ "@smithy/types": "^4.14.1",
33
33
  "tslib": "^2.6.2"
34
34
  },
35
35
  "devDependencies": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aws-sdk/credential-provider-http",
3
- "version": "3.972.26",
3
+ "version": "3.972.29",
4
4
  "description": "AWS credential provider for containers and HTTP sources",
5
5
  "main": "./dist-cjs/index.js",
6
6
  "module": "./dist-es/index.js",
@@ -28,15 +28,15 @@
28
28
  },
29
29
  "license": "Apache-2.0",
30
30
  "dependencies": {
31
- "@aws-sdk/core": "^3.973.26",
32
- "@aws-sdk/types": "^3.973.6",
33
- "@smithy/fetch-http-handler": "^5.3.15",
34
- "@smithy/node-http-handler": "^4.5.1",
35
- "@smithy/property-provider": "^4.2.12",
36
- "@smithy/protocol-http": "^5.3.12",
37
- "@smithy/smithy-client": "^4.12.8",
38
- "@smithy/types": "^4.13.1",
39
- "@smithy/util-stream": "^4.5.21",
31
+ "@aws-sdk/core": "^3.974.1",
32
+ "@aws-sdk/types": "^3.973.8",
33
+ "@smithy/fetch-http-handler": "^5.3.17",
34
+ "@smithy/node-http-handler": "^4.5.3",
35
+ "@smithy/property-provider": "^4.2.14",
36
+ "@smithy/protocol-http": "^5.3.14",
37
+ "@smithy/smithy-client": "^4.12.11",
38
+ "@smithy/types": "^4.14.1",
39
+ "@smithy/util-stream": "^4.5.23",
40
40
  "tslib": "^2.6.2"
41
41
  },
42
42
  "devDependencies": {