@aws-sdk/client-cloudhsm 3.525.0 → 3.529.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.
- package/dist-cjs/index.js +23 -63
- package/dist-es/protocols/Aws_json1_1.js +1 -40
- package/package.json +4 -4
package/dist-cjs/index.js
CHANGED
|
@@ -208,6 +208,7 @@ var import_middleware_serde = require("@smithy/middleware-serde");
|
|
|
208
208
|
var import_types = require("@smithy/types");
|
|
209
209
|
|
|
210
210
|
// src/protocols/Aws_json1_1.ts
|
|
211
|
+
var import_core2 = require("@aws-sdk/core");
|
|
211
212
|
|
|
212
213
|
|
|
213
214
|
|
|
@@ -427,7 +428,7 @@ var de_AddTagsToResourceCommand = /* @__PURE__ */ __name(async (output, context)
|
|
|
427
428
|
if (output.statusCode >= 300) {
|
|
428
429
|
return de_CommandError(output, context);
|
|
429
430
|
}
|
|
430
|
-
const data = await
|
|
431
|
+
const data = await (0, import_core2.parseJsonBody)(output.body, context);
|
|
431
432
|
let contents = {};
|
|
432
433
|
contents = (0, import_smithy_client._json)(data);
|
|
433
434
|
const response = {
|
|
@@ -440,7 +441,7 @@ var de_CreateHapgCommand = /* @__PURE__ */ __name(async (output, context) => {
|
|
|
440
441
|
if (output.statusCode >= 300) {
|
|
441
442
|
return de_CommandError(output, context);
|
|
442
443
|
}
|
|
443
|
-
const data = await
|
|
444
|
+
const data = await (0, import_core2.parseJsonBody)(output.body, context);
|
|
444
445
|
let contents = {};
|
|
445
446
|
contents = (0, import_smithy_client._json)(data);
|
|
446
447
|
const response = {
|
|
@@ -453,7 +454,7 @@ var de_CreateHsmCommand = /* @__PURE__ */ __name(async (output, context) => {
|
|
|
453
454
|
if (output.statusCode >= 300) {
|
|
454
455
|
return de_CommandError(output, context);
|
|
455
456
|
}
|
|
456
|
-
const data = await
|
|
457
|
+
const data = await (0, import_core2.parseJsonBody)(output.body, context);
|
|
457
458
|
let contents = {};
|
|
458
459
|
contents = (0, import_smithy_client._json)(data);
|
|
459
460
|
const response = {
|
|
@@ -466,7 +467,7 @@ var de_CreateLunaClientCommand = /* @__PURE__ */ __name(async (output, context)
|
|
|
466
467
|
if (output.statusCode >= 300) {
|
|
467
468
|
return de_CommandError(output, context);
|
|
468
469
|
}
|
|
469
|
-
const data = await
|
|
470
|
+
const data = await (0, import_core2.parseJsonBody)(output.body, context);
|
|
470
471
|
let contents = {};
|
|
471
472
|
contents = (0, import_smithy_client._json)(data);
|
|
472
473
|
const response = {
|
|
@@ -479,7 +480,7 @@ var de_DeleteHapgCommand = /* @__PURE__ */ __name(async (output, context) => {
|
|
|
479
480
|
if (output.statusCode >= 300) {
|
|
480
481
|
return de_CommandError(output, context);
|
|
481
482
|
}
|
|
482
|
-
const data = await
|
|
483
|
+
const data = await (0, import_core2.parseJsonBody)(output.body, context);
|
|
483
484
|
let contents = {};
|
|
484
485
|
contents = (0, import_smithy_client._json)(data);
|
|
485
486
|
const response = {
|
|
@@ -492,7 +493,7 @@ var de_DeleteHsmCommand = /* @__PURE__ */ __name(async (output, context) => {
|
|
|
492
493
|
if (output.statusCode >= 300) {
|
|
493
494
|
return de_CommandError(output, context);
|
|
494
495
|
}
|
|
495
|
-
const data = await
|
|
496
|
+
const data = await (0, import_core2.parseJsonBody)(output.body, context);
|
|
496
497
|
let contents = {};
|
|
497
498
|
contents = (0, import_smithy_client._json)(data);
|
|
498
499
|
const response = {
|
|
@@ -505,7 +506,7 @@ var de_DeleteLunaClientCommand = /* @__PURE__ */ __name(async (output, context)
|
|
|
505
506
|
if (output.statusCode >= 300) {
|
|
506
507
|
return de_CommandError(output, context);
|
|
507
508
|
}
|
|
508
|
-
const data = await
|
|
509
|
+
const data = await (0, import_core2.parseJsonBody)(output.body, context);
|
|
509
510
|
let contents = {};
|
|
510
511
|
contents = (0, import_smithy_client._json)(data);
|
|
511
512
|
const response = {
|
|
@@ -518,7 +519,7 @@ var de_DescribeHapgCommand = /* @__PURE__ */ __name(async (output, context) => {
|
|
|
518
519
|
if (output.statusCode >= 300) {
|
|
519
520
|
return de_CommandError(output, context);
|
|
520
521
|
}
|
|
521
|
-
const data = await
|
|
522
|
+
const data = await (0, import_core2.parseJsonBody)(output.body, context);
|
|
522
523
|
let contents = {};
|
|
523
524
|
contents = (0, import_smithy_client._json)(data);
|
|
524
525
|
const response = {
|
|
@@ -531,7 +532,7 @@ var de_DescribeHsmCommand = /* @__PURE__ */ __name(async (output, context) => {
|
|
|
531
532
|
if (output.statusCode >= 300) {
|
|
532
533
|
return de_CommandError(output, context);
|
|
533
534
|
}
|
|
534
|
-
const data = await
|
|
535
|
+
const data = await (0, import_core2.parseJsonBody)(output.body, context);
|
|
535
536
|
let contents = {};
|
|
536
537
|
contents = (0, import_smithy_client._json)(data);
|
|
537
538
|
const response = {
|
|
@@ -544,7 +545,7 @@ var de_DescribeLunaClientCommand = /* @__PURE__ */ __name(async (output, context
|
|
|
544
545
|
if (output.statusCode >= 300) {
|
|
545
546
|
return de_CommandError(output, context);
|
|
546
547
|
}
|
|
547
|
-
const data = await
|
|
548
|
+
const data = await (0, import_core2.parseJsonBody)(output.body, context);
|
|
548
549
|
let contents = {};
|
|
549
550
|
contents = (0, import_smithy_client._json)(data);
|
|
550
551
|
const response = {
|
|
@@ -557,7 +558,7 @@ var de_GetConfigCommand = /* @__PURE__ */ __name(async (output, context) => {
|
|
|
557
558
|
if (output.statusCode >= 300) {
|
|
558
559
|
return de_CommandError(output, context);
|
|
559
560
|
}
|
|
560
|
-
const data = await
|
|
561
|
+
const data = await (0, import_core2.parseJsonBody)(output.body, context);
|
|
561
562
|
let contents = {};
|
|
562
563
|
contents = (0, import_smithy_client._json)(data);
|
|
563
564
|
const response = {
|
|
@@ -570,7 +571,7 @@ var de_ListAvailableZonesCommand = /* @__PURE__ */ __name(async (output, context
|
|
|
570
571
|
if (output.statusCode >= 300) {
|
|
571
572
|
return de_CommandError(output, context);
|
|
572
573
|
}
|
|
573
|
-
const data = await
|
|
574
|
+
const data = await (0, import_core2.parseJsonBody)(output.body, context);
|
|
574
575
|
let contents = {};
|
|
575
576
|
contents = (0, import_smithy_client._json)(data);
|
|
576
577
|
const response = {
|
|
@@ -583,7 +584,7 @@ var de_ListHapgsCommand = /* @__PURE__ */ __name(async (output, context) => {
|
|
|
583
584
|
if (output.statusCode >= 300) {
|
|
584
585
|
return de_CommandError(output, context);
|
|
585
586
|
}
|
|
586
|
-
const data = await
|
|
587
|
+
const data = await (0, import_core2.parseJsonBody)(output.body, context);
|
|
587
588
|
let contents = {};
|
|
588
589
|
contents = (0, import_smithy_client._json)(data);
|
|
589
590
|
const response = {
|
|
@@ -596,7 +597,7 @@ var de_ListHsmsCommand = /* @__PURE__ */ __name(async (output, context) => {
|
|
|
596
597
|
if (output.statusCode >= 300) {
|
|
597
598
|
return de_CommandError(output, context);
|
|
598
599
|
}
|
|
599
|
-
const data = await
|
|
600
|
+
const data = await (0, import_core2.parseJsonBody)(output.body, context);
|
|
600
601
|
let contents = {};
|
|
601
602
|
contents = (0, import_smithy_client._json)(data);
|
|
602
603
|
const response = {
|
|
@@ -609,7 +610,7 @@ var de_ListLunaClientsCommand = /* @__PURE__ */ __name(async (output, context) =
|
|
|
609
610
|
if (output.statusCode >= 300) {
|
|
610
611
|
return de_CommandError(output, context);
|
|
611
612
|
}
|
|
612
|
-
const data = await
|
|
613
|
+
const data = await (0, import_core2.parseJsonBody)(output.body, context);
|
|
613
614
|
let contents = {};
|
|
614
615
|
contents = (0, import_smithy_client._json)(data);
|
|
615
616
|
const response = {
|
|
@@ -622,7 +623,7 @@ var de_ListTagsForResourceCommand = /* @__PURE__ */ __name(async (output, contex
|
|
|
622
623
|
if (output.statusCode >= 300) {
|
|
623
624
|
return de_CommandError(output, context);
|
|
624
625
|
}
|
|
625
|
-
const data = await
|
|
626
|
+
const data = await (0, import_core2.parseJsonBody)(output.body, context);
|
|
626
627
|
let contents = {};
|
|
627
628
|
contents = (0, import_smithy_client._json)(data);
|
|
628
629
|
const response = {
|
|
@@ -635,7 +636,7 @@ var de_ModifyHapgCommand = /* @__PURE__ */ __name(async (output, context) => {
|
|
|
635
636
|
if (output.statusCode >= 300) {
|
|
636
637
|
return de_CommandError(output, context);
|
|
637
638
|
}
|
|
638
|
-
const data = await
|
|
639
|
+
const data = await (0, import_core2.parseJsonBody)(output.body, context);
|
|
639
640
|
let contents = {};
|
|
640
641
|
contents = (0, import_smithy_client._json)(data);
|
|
641
642
|
const response = {
|
|
@@ -648,7 +649,7 @@ var de_ModifyHsmCommand = /* @__PURE__ */ __name(async (output, context) => {
|
|
|
648
649
|
if (output.statusCode >= 300) {
|
|
649
650
|
return de_CommandError(output, context);
|
|
650
651
|
}
|
|
651
|
-
const data = await
|
|
652
|
+
const data = await (0, import_core2.parseJsonBody)(output.body, context);
|
|
652
653
|
let contents = {};
|
|
653
654
|
contents = (0, import_smithy_client._json)(data);
|
|
654
655
|
const response = {
|
|
@@ -661,7 +662,7 @@ var de_ModifyLunaClientCommand = /* @__PURE__ */ __name(async (output, context)
|
|
|
661
662
|
if (output.statusCode >= 300) {
|
|
662
663
|
return de_CommandError(output, context);
|
|
663
664
|
}
|
|
664
|
-
const data = await
|
|
665
|
+
const data = await (0, import_core2.parseJsonBody)(output.body, context);
|
|
665
666
|
let contents = {};
|
|
666
667
|
contents = (0, import_smithy_client._json)(data);
|
|
667
668
|
const response = {
|
|
@@ -674,7 +675,7 @@ var de_RemoveTagsFromResourceCommand = /* @__PURE__ */ __name(async (output, con
|
|
|
674
675
|
if (output.statusCode >= 300) {
|
|
675
676
|
return de_CommandError(output, context);
|
|
676
677
|
}
|
|
677
|
-
const data = await
|
|
678
|
+
const data = await (0, import_core2.parseJsonBody)(output.body, context);
|
|
678
679
|
let contents = {};
|
|
679
680
|
contents = (0, import_smithy_client._json)(data);
|
|
680
681
|
const response = {
|
|
@@ -686,9 +687,9 @@ var de_RemoveTagsFromResourceCommand = /* @__PURE__ */ __name(async (output, con
|
|
|
686
687
|
var de_CommandError = /* @__PURE__ */ __name(async (output, context) => {
|
|
687
688
|
const parsedOutput = {
|
|
688
689
|
...output,
|
|
689
|
-
body: await
|
|
690
|
+
body: await (0, import_core2.parseJsonErrorBody)(output.body, context)
|
|
690
691
|
};
|
|
691
|
-
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
692
|
+
const errorCode = (0, import_core2.loadRestJsonErrorCode)(output, parsedOutput.body);
|
|
692
693
|
switch (errorCode) {
|
|
693
694
|
case "CloudHsmInternalException":
|
|
694
695
|
case "com.amazonaws.cloudhsm#CloudHsmInternalException":
|
|
@@ -741,7 +742,6 @@ var deserializeMetadata = /* @__PURE__ */ __name((output) => ({
|
|
|
741
742
|
extendedRequestId: output.headers["x-amz-id-2"],
|
|
742
743
|
cfId: output.headers["x-amz-cf-id"]
|
|
743
744
|
}), "deserializeMetadata");
|
|
744
|
-
var collectBodyString = /* @__PURE__ */ __name((streamBody, context) => (0, import_smithy_client.collectBody)(streamBody, context).then((body) => context.utf8Encoder(body)), "collectBodyString");
|
|
745
745
|
var throwDefaultError = (0, import_smithy_client.withBaseException)(CloudHSMServiceException);
|
|
746
746
|
var buildHttpRpcRequest = /* @__PURE__ */ __name(async (context, headers, path, resolvedHostname, body) => {
|
|
747
747
|
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
@@ -768,46 +768,6 @@ function sharedHeaders(operation) {
|
|
|
768
768
|
};
|
|
769
769
|
}
|
|
770
770
|
__name(sharedHeaders, "sharedHeaders");
|
|
771
|
-
var parseBody = /* @__PURE__ */ __name((streamBody, context) => collectBodyString(streamBody, context).then((encoded) => {
|
|
772
|
-
if (encoded.length) {
|
|
773
|
-
return JSON.parse(encoded);
|
|
774
|
-
}
|
|
775
|
-
return {};
|
|
776
|
-
}), "parseBody");
|
|
777
|
-
var parseErrorBody = /* @__PURE__ */ __name(async (errorBody, context) => {
|
|
778
|
-
const value = await parseBody(errorBody, context);
|
|
779
|
-
value.message = value.message ?? value.Message;
|
|
780
|
-
return value;
|
|
781
|
-
}, "parseErrorBody");
|
|
782
|
-
var loadRestJsonErrorCode = /* @__PURE__ */ __name((output, data) => {
|
|
783
|
-
const findKey = /* @__PURE__ */ __name((object, key) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase()), "findKey");
|
|
784
|
-
const sanitizeErrorCode = /* @__PURE__ */ __name((rawValue) => {
|
|
785
|
-
let cleanValue = rawValue;
|
|
786
|
-
if (typeof cleanValue === "number") {
|
|
787
|
-
cleanValue = cleanValue.toString();
|
|
788
|
-
}
|
|
789
|
-
if (cleanValue.indexOf(",") >= 0) {
|
|
790
|
-
cleanValue = cleanValue.split(",")[0];
|
|
791
|
-
}
|
|
792
|
-
if (cleanValue.indexOf(":") >= 0) {
|
|
793
|
-
cleanValue = cleanValue.split(":")[0];
|
|
794
|
-
}
|
|
795
|
-
if (cleanValue.indexOf("#") >= 0) {
|
|
796
|
-
cleanValue = cleanValue.split("#")[1];
|
|
797
|
-
}
|
|
798
|
-
return cleanValue;
|
|
799
|
-
}, "sanitizeErrorCode");
|
|
800
|
-
const headerKey = findKey(output.headers, "x-amzn-errortype");
|
|
801
|
-
if (headerKey !== void 0) {
|
|
802
|
-
return sanitizeErrorCode(output.headers[headerKey]);
|
|
803
|
-
}
|
|
804
|
-
if (data.code !== void 0) {
|
|
805
|
-
return sanitizeErrorCode(data.code);
|
|
806
|
-
}
|
|
807
|
-
if (data["__type"] !== void 0) {
|
|
808
|
-
return sanitizeErrorCode(data["__type"]);
|
|
809
|
-
}
|
|
810
|
-
}, "loadRestJsonErrorCode");
|
|
811
771
|
|
|
812
772
|
// src/commands/AddTagsToResourceCommand.ts
|
|
813
773
|
var _AddTagsToResourceCommand = class _AddTagsToResourceCommand extends import_smithy_client.Command.classBuilder().ep({
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { loadRestJsonErrorCode, parseJsonBody as parseBody, parseJsonErrorBody as parseErrorBody } from "@aws-sdk/core";
|
|
1
2
|
import { HttpRequest as __HttpRequest } from "@smithy/protocol-http";
|
|
2
3
|
import { _json, collectBody, decorateServiceException as __decorateServiceException, withBaseException, } from "@smithy/smithy-client";
|
|
3
4
|
import { CloudHSMServiceException as __BaseException } from "../models/CloudHSMServiceException";
|
|
@@ -466,43 +467,3 @@ function sharedHeaders(operation) {
|
|
|
466
467
|
"x-amz-target": `CloudHsmFrontendService.${operation}`,
|
|
467
468
|
};
|
|
468
469
|
}
|
|
469
|
-
const parseBody = (streamBody, context) => collectBodyString(streamBody, context).then((encoded) => {
|
|
470
|
-
if (encoded.length) {
|
|
471
|
-
return JSON.parse(encoded);
|
|
472
|
-
}
|
|
473
|
-
return {};
|
|
474
|
-
});
|
|
475
|
-
const parseErrorBody = async (errorBody, context) => {
|
|
476
|
-
const value = await parseBody(errorBody, context);
|
|
477
|
-
value.message = value.message ?? value.Message;
|
|
478
|
-
return value;
|
|
479
|
-
};
|
|
480
|
-
const loadRestJsonErrorCode = (output, data) => {
|
|
481
|
-
const findKey = (object, key) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase());
|
|
482
|
-
const sanitizeErrorCode = (rawValue) => {
|
|
483
|
-
let cleanValue = rawValue;
|
|
484
|
-
if (typeof cleanValue === "number") {
|
|
485
|
-
cleanValue = cleanValue.toString();
|
|
486
|
-
}
|
|
487
|
-
if (cleanValue.indexOf(",") >= 0) {
|
|
488
|
-
cleanValue = cleanValue.split(",")[0];
|
|
489
|
-
}
|
|
490
|
-
if (cleanValue.indexOf(":") >= 0) {
|
|
491
|
-
cleanValue = cleanValue.split(":")[0];
|
|
492
|
-
}
|
|
493
|
-
if (cleanValue.indexOf("#") >= 0) {
|
|
494
|
-
cleanValue = cleanValue.split("#")[1];
|
|
495
|
-
}
|
|
496
|
-
return cleanValue;
|
|
497
|
-
};
|
|
498
|
-
const headerKey = findKey(output.headers, "x-amzn-errortype");
|
|
499
|
-
if (headerKey !== undefined) {
|
|
500
|
-
return sanitizeErrorCode(output.headers[headerKey]);
|
|
501
|
-
}
|
|
502
|
-
if (data.code !== undefined) {
|
|
503
|
-
return sanitizeErrorCode(data.code);
|
|
504
|
-
}
|
|
505
|
-
if (data["__type"] !== undefined) {
|
|
506
|
-
return sanitizeErrorCode(data["__type"]);
|
|
507
|
-
}
|
|
508
|
-
};
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aws-sdk/client-cloudhsm",
|
|
3
3
|
"description": "AWS SDK for JavaScript Cloudhsm Client for Node.js, Browser and React Native",
|
|
4
|
-
"version": "3.
|
|
4
|
+
"version": "3.529.0",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"build": "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'",
|
|
7
7
|
"build:cjs": "node ../../scripts/compilation/inline client-cloudhsm",
|
|
@@ -20,9 +20,9 @@
|
|
|
20
20
|
"dependencies": {
|
|
21
21
|
"@aws-crypto/sha256-browser": "3.0.0",
|
|
22
22
|
"@aws-crypto/sha256-js": "3.0.0",
|
|
23
|
-
"@aws-sdk/client-sts": "3.
|
|
24
|
-
"@aws-sdk/core": "3.
|
|
25
|
-
"@aws-sdk/credential-provider-node": "3.
|
|
23
|
+
"@aws-sdk/client-sts": "3.529.0",
|
|
24
|
+
"@aws-sdk/core": "3.529.0",
|
|
25
|
+
"@aws-sdk/credential-provider-node": "3.529.0",
|
|
26
26
|
"@aws-sdk/middleware-host-header": "3.523.0",
|
|
27
27
|
"@aws-sdk/middleware-logger": "3.523.0",
|
|
28
28
|
"@aws-sdk/middleware-recursion-detection": "3.523.0",
|