@aws-sdk/client-kms 3.354.0 → 3.358.0

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.
@@ -450,7 +450,7 @@ const de_CreateAliasCommand = async (output, context) => {
450
450
  if (output.statusCode >= 300) {
451
451
  return de_CreateAliasCommandError(output, context);
452
452
  }
453
- await collectBody(output.body, context);
453
+ await (0, smithy_client_1.collectBody)(output.body, context);
454
454
  const response = {
455
455
  $metadata: deserializeMetadata(output),
456
456
  };
@@ -762,7 +762,7 @@ const de_DeleteAliasCommand = async (output, context) => {
762
762
  if (output.statusCode >= 300) {
763
763
  return de_DeleteAliasCommandError(output, context);
764
764
  }
765
- await collectBody(output.body, context);
765
+ await (0, smithy_client_1.collectBody)(output.body, context);
766
766
  const response = {
767
767
  $metadata: deserializeMetadata(output),
768
768
  };
@@ -843,7 +843,7 @@ const de_DeleteImportedKeyMaterialCommand = async (output, context) => {
843
843
  if (output.statusCode >= 300) {
844
844
  return de_DeleteImportedKeyMaterialCommandError(output, context);
845
845
  }
846
- await collectBody(output.body, context);
846
+ await (0, smithy_client_1.collectBody)(output.body, context);
847
847
  const response = {
848
848
  $metadata: deserializeMetadata(output),
849
849
  };
@@ -969,7 +969,7 @@ const de_DisableKeyCommand = async (output, context) => {
969
969
  if (output.statusCode >= 300) {
970
970
  return de_DisableKeyCommandError(output, context);
971
971
  }
972
- await collectBody(output.body, context);
972
+ await (0, smithy_client_1.collectBody)(output.body, context);
973
973
  const response = {
974
974
  $metadata: deserializeMetadata(output),
975
975
  };
@@ -1011,7 +1011,7 @@ const de_DisableKeyRotationCommand = async (output, context) => {
1011
1011
  if (output.statusCode >= 300) {
1012
1012
  return de_DisableKeyRotationCommandError(output, context);
1013
1013
  }
1014
- await collectBody(output.body, context);
1014
+ await (0, smithy_client_1.collectBody)(output.body, context);
1015
1015
  const response = {
1016
1016
  $metadata: deserializeMetadata(output),
1017
1017
  };
@@ -1098,7 +1098,7 @@ const de_EnableKeyCommand = async (output, context) => {
1098
1098
  if (output.statusCode >= 300) {
1099
1099
  return de_EnableKeyCommandError(output, context);
1100
1100
  }
1101
- await collectBody(output.body, context);
1101
+ await (0, smithy_client_1.collectBody)(output.body, context);
1102
1102
  const response = {
1103
1103
  $metadata: deserializeMetadata(output),
1104
1104
  };
@@ -1143,7 +1143,7 @@ const de_EnableKeyRotationCommand = async (output, context) => {
1143
1143
  if (output.statusCode >= 300) {
1144
1144
  return de_EnableKeyRotationCommandError(output, context);
1145
1145
  }
1146
- await collectBody(output.body, context);
1146
+ await (0, smithy_client_1.collectBody)(output.body, context);
1147
1147
  const response = {
1148
1148
  $metadata: deserializeMetadata(output),
1149
1149
  };
@@ -2091,7 +2091,7 @@ const de_PutKeyPolicyCommand = async (output, context) => {
2091
2091
  if (output.statusCode >= 300) {
2092
2092
  return de_PutKeyPolicyCommandError(output, context);
2093
2093
  }
2094
- await collectBody(output.body, context);
2094
+ await (0, smithy_client_1.collectBody)(output.body, context);
2095
2095
  const response = {
2096
2096
  $metadata: deserializeMetadata(output),
2097
2097
  };
@@ -2262,7 +2262,7 @@ const de_RetireGrantCommand = async (output, context) => {
2262
2262
  if (output.statusCode >= 300) {
2263
2263
  return de_RetireGrantCommandError(output, context);
2264
2264
  }
2265
- await collectBody(output.body, context);
2265
+ await (0, smithy_client_1.collectBody)(output.body, context);
2266
2266
  const response = {
2267
2267
  $metadata: deserializeMetadata(output),
2268
2268
  };
@@ -2310,7 +2310,7 @@ const de_RevokeGrantCommand = async (output, context) => {
2310
2310
  if (output.statusCode >= 300) {
2311
2311
  return de_RevokeGrantCommandError(output, context);
2312
2312
  }
2313
- await collectBody(output.body, context);
2313
+ await (0, smithy_client_1.collectBody)(output.body, context);
2314
2314
  const response = {
2315
2315
  $metadata: deserializeMetadata(output),
2316
2316
  };
@@ -2454,7 +2454,7 @@ const de_TagResourceCommand = async (output, context) => {
2454
2454
  if (output.statusCode >= 300) {
2455
2455
  return de_TagResourceCommandError(output, context);
2456
2456
  }
2457
- await collectBody(output.body, context);
2457
+ await (0, smithy_client_1.collectBody)(output.body, context);
2458
2458
  const response = {
2459
2459
  $metadata: deserializeMetadata(output),
2460
2460
  };
@@ -2499,7 +2499,7 @@ const de_UntagResourceCommand = async (output, context) => {
2499
2499
  if (output.statusCode >= 300) {
2500
2500
  return de_UntagResourceCommandError(output, context);
2501
2501
  }
2502
- await collectBody(output.body, context);
2502
+ await (0, smithy_client_1.collectBody)(output.body, context);
2503
2503
  const response = {
2504
2504
  $metadata: deserializeMetadata(output),
2505
2505
  };
@@ -2541,7 +2541,7 @@ const de_UpdateAliasCommand = async (output, context) => {
2541
2541
  if (output.statusCode >= 300) {
2542
2542
  return de_UpdateAliasCommandError(output, context);
2543
2543
  }
2544
- await collectBody(output.body, context);
2544
+ await (0, smithy_client_1.collectBody)(output.body, context);
2545
2545
  const response = {
2546
2546
  $metadata: deserializeMetadata(output),
2547
2547
  };
@@ -2664,7 +2664,7 @@ const de_UpdateKeyDescriptionCommand = async (output, context) => {
2664
2664
  if (output.statusCode >= 300) {
2665
2665
  return de_UpdateKeyDescriptionCommandError(output, context);
2666
2666
  }
2667
- await collectBody(output.body, context);
2667
+ await (0, smithy_client_1.collectBody)(output.body, context);
2668
2668
  const response = {
2669
2669
  $metadata: deserializeMetadata(output),
2670
2670
  };
@@ -2706,7 +2706,7 @@ const de_UpdatePrimaryRegionCommand = async (output, context) => {
2706
2706
  if (output.statusCode >= 300) {
2707
2707
  return de_UpdatePrimaryRegionCommandError(output, context);
2708
2708
  }
2709
- await collectBody(output.body, context);
2709
+ await (0, smithy_client_1.collectBody)(output.body, context);
2710
2710
  const response = {
2711
2711
  $metadata: deserializeMetadata(output),
2712
2712
  };
@@ -3614,13 +3614,7 @@ const deserializeMetadata = (output) => ({
3614
3614
  extendedRequestId: output.headers["x-amz-id-2"],
3615
3615
  cfId: output.headers["x-amz-cf-id"],
3616
3616
  });
3617
- const collectBody = (streamBody = new Uint8Array(), context) => {
3618
- if (streamBody instanceof Uint8Array) {
3619
- return Promise.resolve(streamBody);
3620
- }
3621
- return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array());
3622
- };
3623
- const collectBodyString = (streamBody, context) => collectBody(streamBody, context).then((body) => context.utf8Encoder(body));
3617
+ const collectBodyString = (streamBody, context) => (0, smithy_client_1.collectBody)(streamBody, context).then((body) => context.utf8Encoder(body));
3624
3618
  const throwDefaultError = (0, smithy_client_1.withBaseException)(KMSServiceException_1.KMSServiceException);
3625
3619
  const buildHttpRpcRequest = async (context, headers, path, resolvedHostname, body) => {
3626
3620
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
@@ -1,4 +1,4 @@
1
- import { _json, decorateServiceException as __decorateServiceException, expectBoolean as __expectBoolean, expectInt32 as __expectInt32, expectNonNull as __expectNonNull, expectNumber as __expectNumber, expectString as __expectString, parseEpochTimestamp as __parseEpochTimestamp, take, withBaseException, } from "@aws-sdk/smithy-client";
1
+ import { _json, collectBody, decorateServiceException as __decorateServiceException, expectBoolean as __expectBoolean, expectInt32 as __expectInt32, expectNonNull as __expectNonNull, expectNumber as __expectNumber, expectString as __expectString, parseEpochTimestamp as __parseEpochTimestamp, take, withBaseException, } from "@aws-sdk/smithy-client";
2
2
  import { HttpRequest as __HttpRequest } from "@smithy/protocol-http";
3
3
  import { KMSServiceException as __BaseException } from "../models/KMSServiceException";
4
4
  import { AlreadyExistsException, CloudHsmClusterInUseException, CloudHsmClusterInvalidConfigurationException, CloudHsmClusterNotActiveException, CloudHsmClusterNotFoundException, CloudHsmClusterNotRelatedException, CustomKeyStoreHasCMKsException, CustomKeyStoreInvalidStateException, CustomKeyStoreNameInUseException, CustomKeyStoreNotFoundException, DependencyTimeoutException, DisabledException, ExpiredImportTokenException, IncorrectKeyException, IncorrectKeyMaterialException, IncorrectTrustAnchorException, InvalidAliasNameException, InvalidArnException, InvalidCiphertextException, InvalidGrantIdException, InvalidGrantTokenException, InvalidImportTokenException, InvalidKeyUsageException, InvalidMarkerException, KeyUnavailableException, KMSInternalException, KMSInvalidMacException, KMSInvalidSignatureException, KMSInvalidStateException, LimitExceededException, MalformedPolicyDocumentException, NotFoundException, TagException, UnsupportedOperationException, XksKeyAlreadyInUseException, XksKeyInvalidConfigurationException, XksKeyNotFoundException, XksProxyIncorrectAuthenticationCredentialException, XksProxyInvalidConfigurationException, XksProxyInvalidResponseException, XksProxyUriEndpointInUseException, XksProxyUriInUseException, XksProxyUriUnreachableException, XksProxyVpcEndpointServiceInUseException, XksProxyVpcEndpointServiceInvalidConfigurationException, XksProxyVpcEndpointServiceNotFoundException, } from "../models/models_0";
@@ -3510,12 +3510,6 @@ const deserializeMetadata = (output) => ({
3510
3510
  extendedRequestId: output.headers["x-amz-id-2"],
3511
3511
  cfId: output.headers["x-amz-cf-id"],
3512
3512
  });
3513
- const collectBody = (streamBody = new Uint8Array(), context) => {
3514
- if (streamBody instanceof Uint8Array) {
3515
- return Promise.resolve(streamBody);
3516
- }
3517
- return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array());
3518
- };
3519
3513
  const collectBodyString = (streamBody, context) => collectBody(streamBody, context).then((body) => context.utf8Encoder(body));
3520
3514
  const throwDefaultError = withBaseException(__BaseException);
3521
3515
  const buildHttpRpcRequest = async (context, headers, path, resolvedHostname, body) => {
@@ -123,7 +123,7 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__
123
123
  */
124
124
  runtime?: string;
125
125
  /**
126
- * Disable dyanamically changing the endpoint of the client based on the hostPrefix
126
+ * Disable dynamically changing the endpoint of the client based on the hostPrefix
127
127
  * trait of an operation.
128
128
  */
129
129
  disableHostPrefix?: boolean;
@@ -568,7 +568,7 @@ export interface CreateKeyCommandOutput extends CreateKeyResponse, __MetadataBea
568
568
  *
569
569
  * @example To create a KMS key for imported key material
570
570
  * ```javascript
571
- * // This example creates a KMS key with no key material. When the operation is complete, you can import your own key material into the KMS key. To create this KMS key, set the Origin parameter to EXTERNAL.
571
+ * // This example creates a symmetric KMS key with no key material. When the operation is complete, you can import your own key material into the KMS key. To create this KMS key, set the Origin parameter to EXTERNAL.
572
572
  * const input = {
573
573
  * "Origin": "EXTERNAL"
574
574
  * };
@@ -165,27 +165,6 @@ export interface GetParametersForImportCommandOutput extends GetParametersForImp
165
165
  * @throws {@link KMSServiceException}
166
166
  * <p>Base exception class for all service exceptions from KMS service.</p>
167
167
  *
168
- * @example To retrieve the public key and import token for a KMS key
169
- * ```javascript
170
- * // The following example retrieves the public key and import token for the specified KMS key.
171
- * const input = {
172
- * "KeyId": "1234abcd-12ab-34cd-56ef-1234567890ab",
173
- * "WrappingAlgorithm": "RSAES_OAEP_SHA_1",
174
- * "WrappingKeySpec": "RSA_2048"
175
- * };
176
- * const command = new GetParametersForImportCommand(input);
177
- * const response = await client.send(command);
178
- * /* response ==
179
- * {
180
- * "ImportToken": "<binary data>",
181
- * "KeyId": "arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab",
182
- * "ParametersValidTo": "2016-12-01T14:52:17-08:00",
183
- * "PublicKey": "<binary data>"
184
- * }
185
- * *\/
186
- * // example id: to-retrieve-the-public-key-and-import-token-for-a-cmk-1480626483211
187
- * ```
188
- *
189
168
  * @example To download the public key and import token for a symmetric encryption KMS key
190
169
  * ```javascript
191
170
  * // The following example downloads a public key and import token to import symmetric encryption key material. It uses the default wrapping key spec and the RSAES_OAEP_SHA_256 wrapping algorithm.
@@ -223,20 +223,6 @@ export interface ImportKeyMaterialCommandOutput extends ImportKeyMaterialRespons
223
223
  * };
224
224
  * const command = new ImportKeyMaterialCommand(input);
225
225
  * await client.send(command);
226
- * // example id: to-import-key-material-into-a-cmk-1480630551969
227
- * ```
228
- *
229
- * @example To import key material into a KMS key
230
- * ```javascript
231
- * // The following example imports key material into the specified KMS key.
232
- * const input = {
233
- * "EncryptedKeyMaterial": "<binary data>",
234
- * "ExpirationModel": "KEY_MATERIAL_DOES_NOT_EXPIRE",
235
- * "ImportToken": "<binary data>",
236
- * "KeyId": "1234abcd-12ab-34cd-56ef-1234567890ab"
237
- * };
238
- * const command = new ImportKeyMaterialCommand(input);
239
- * await client.send(command);
240
226
  * // example id: to-import-key-material-into-a-kms-key-1
241
227
  * ```
242
228
  *
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@aws-sdk/client-kms",
3
3
  "description": "AWS SDK for JavaScript Kms Client for Node.js, Browser and React Native",
4
- "version": "3.354.0",
4
+ "version": "3.358.0",
5
5
  "scripts": {
6
6
  "build": "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'",
7
7
  "build:cjs": "tsc -p tsconfig.cjs.json",
@@ -21,36 +21,36 @@
21
21
  "dependencies": {
22
22
  "@aws-crypto/sha256-browser": "3.0.0",
23
23
  "@aws-crypto/sha256-js": "3.0.0",
24
- "@aws-sdk/client-sts": "3.354.0",
25
- "@aws-sdk/config-resolver": "3.354.0",
26
- "@aws-sdk/credential-provider-node": "3.354.0",
27
- "@aws-sdk/fetch-http-handler": "3.353.0",
28
- "@aws-sdk/hash-node": "3.347.0",
29
- "@aws-sdk/invalid-dependency": "3.347.0",
30
- "@aws-sdk/middleware-content-length": "3.347.0",
31
- "@aws-sdk/middleware-endpoint": "3.347.0",
32
- "@aws-sdk/middleware-host-header": "3.347.0",
33
- "@aws-sdk/middleware-logger": "3.347.0",
34
- "@aws-sdk/middleware-recursion-detection": "3.347.0",
35
- "@aws-sdk/middleware-retry": "3.354.0",
36
- "@aws-sdk/middleware-serde": "3.347.0",
37
- "@aws-sdk/middleware-signing": "3.354.0",
38
- "@aws-sdk/middleware-stack": "3.347.0",
39
- "@aws-sdk/middleware-user-agent": "3.352.0",
40
- "@aws-sdk/node-config-provider": "3.354.0",
41
- "@aws-sdk/node-http-handler": "3.350.0",
42
- "@aws-sdk/smithy-client": "3.347.0",
43
- "@aws-sdk/types": "3.347.0",
44
- "@aws-sdk/url-parser": "3.347.0",
24
+ "@aws-sdk/client-sts": "3.358.0",
25
+ "@aws-sdk/config-resolver": "3.357.0",
26
+ "@aws-sdk/credential-provider-node": "3.358.0",
27
+ "@aws-sdk/fetch-http-handler": "3.357.0",
28
+ "@aws-sdk/hash-node": "3.357.0",
29
+ "@aws-sdk/invalid-dependency": "3.357.0",
30
+ "@aws-sdk/middleware-content-length": "3.357.0",
31
+ "@aws-sdk/middleware-endpoint": "3.357.0",
32
+ "@aws-sdk/middleware-host-header": "3.357.0",
33
+ "@aws-sdk/middleware-logger": "3.357.0",
34
+ "@aws-sdk/middleware-recursion-detection": "3.357.0",
35
+ "@aws-sdk/middleware-retry": "3.357.0",
36
+ "@aws-sdk/middleware-serde": "3.357.0",
37
+ "@aws-sdk/middleware-signing": "3.357.0",
38
+ "@aws-sdk/middleware-stack": "3.357.0",
39
+ "@aws-sdk/middleware-user-agent": "3.357.0",
40
+ "@aws-sdk/node-config-provider": "3.357.0",
41
+ "@aws-sdk/node-http-handler": "3.357.0",
42
+ "@aws-sdk/smithy-client": "3.358.0",
43
+ "@aws-sdk/types": "3.357.0",
44
+ "@aws-sdk/url-parser": "3.357.0",
45
45
  "@aws-sdk/util-base64": "3.310.0",
46
46
  "@aws-sdk/util-body-length-browser": "3.310.0",
47
47
  "@aws-sdk/util-body-length-node": "3.310.0",
48
- "@aws-sdk/util-defaults-mode-browser": "3.353.0",
49
- "@aws-sdk/util-defaults-mode-node": "3.354.0",
50
- "@aws-sdk/util-endpoints": "3.352.0",
51
- "@aws-sdk/util-retry": "3.347.0",
52
- "@aws-sdk/util-user-agent-browser": "3.347.0",
53
- "@aws-sdk/util-user-agent-node": "3.354.0",
48
+ "@aws-sdk/util-defaults-mode-browser": "3.358.0",
49
+ "@aws-sdk/util-defaults-mode-node": "3.358.0",
50
+ "@aws-sdk/util-endpoints": "3.357.0",
51
+ "@aws-sdk/util-retry": "3.357.0",
52
+ "@aws-sdk/util-user-agent-browser": "3.357.0",
53
+ "@aws-sdk/util-user-agent-node": "3.357.0",
54
54
  "@aws-sdk/util-utf8": "3.310.0",
55
55
  "@smithy/protocol-http": "^1.0.1",
56
56
  "@smithy/types": "^1.0.0",