@aws-sdk/client-iotdeviceadvisor 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 +13 -53
- package/dist-es/protocols/Aws_restJson1.js +1 -40
- package/package.json +4 -4
package/dist-cjs/index.js
CHANGED
|
@@ -207,6 +207,7 @@ var import_middleware_serde = require("@smithy/middleware-serde");
|
|
|
207
207
|
var import_types = require("@smithy/types");
|
|
208
208
|
|
|
209
209
|
// src/protocols/Aws_restJson1.ts
|
|
210
|
+
var import_core2 = require("@aws-sdk/core");
|
|
210
211
|
|
|
211
212
|
|
|
212
213
|
|
|
@@ -530,7 +531,7 @@ var de_CreateSuiteDefinitionCommand = /* @__PURE__ */ __name(async (output, cont
|
|
|
530
531
|
const contents = (0, import_smithy_client.map)({
|
|
531
532
|
$metadata: deserializeMetadata(output)
|
|
532
533
|
});
|
|
533
|
-
const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await
|
|
534
|
+
const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await (0, import_core2.parseJsonBody)(output.body, context)), "body");
|
|
534
535
|
const doc = (0, import_smithy_client.take)(data, {
|
|
535
536
|
createdAt: (_) => (0, import_smithy_client.expectNonNull)((0, import_smithy_client.parseEpochTimestamp)((0, import_smithy_client.expectNumber)(_))),
|
|
536
537
|
suiteDefinitionArn: import_smithy_client.expectString,
|
|
@@ -557,7 +558,7 @@ var de_GetEndpointCommand = /* @__PURE__ */ __name(async (output, context) => {
|
|
|
557
558
|
const contents = (0, import_smithy_client.map)({
|
|
558
559
|
$metadata: deserializeMetadata(output)
|
|
559
560
|
});
|
|
560
|
-
const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await
|
|
561
|
+
const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await (0, import_core2.parseJsonBody)(output.body, context)), "body");
|
|
561
562
|
const doc = (0, import_smithy_client.take)(data, {
|
|
562
563
|
endpoint: import_smithy_client.expectString
|
|
563
564
|
});
|
|
@@ -571,7 +572,7 @@ var de_GetSuiteDefinitionCommand = /* @__PURE__ */ __name(async (output, context
|
|
|
571
572
|
const contents = (0, import_smithy_client.map)({
|
|
572
573
|
$metadata: deserializeMetadata(output)
|
|
573
574
|
});
|
|
574
|
-
const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await
|
|
575
|
+
const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await (0, import_core2.parseJsonBody)(output.body, context)), "body");
|
|
575
576
|
const doc = (0, import_smithy_client.take)(data, {
|
|
576
577
|
createdAt: (_) => (0, import_smithy_client.expectNonNull)((0, import_smithy_client.parseEpochTimestamp)((0, import_smithy_client.expectNumber)(_))),
|
|
577
578
|
lastModifiedAt: (_) => (0, import_smithy_client.expectNonNull)((0, import_smithy_client.parseEpochTimestamp)((0, import_smithy_client.expectNumber)(_))),
|
|
@@ -592,7 +593,7 @@ var de_GetSuiteRunCommand = /* @__PURE__ */ __name(async (output, context) => {
|
|
|
592
593
|
const contents = (0, import_smithy_client.map)({
|
|
593
594
|
$metadata: deserializeMetadata(output)
|
|
594
595
|
});
|
|
595
|
-
const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await
|
|
596
|
+
const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await (0, import_core2.parseJsonBody)(output.body, context)), "body");
|
|
596
597
|
const doc = (0, import_smithy_client.take)(data, {
|
|
597
598
|
endTime: (_) => (0, import_smithy_client.expectNonNull)((0, import_smithy_client.parseEpochTimestamp)((0, import_smithy_client.expectNumber)(_))),
|
|
598
599
|
errorReason: import_smithy_client.expectString,
|
|
@@ -616,7 +617,7 @@ var de_GetSuiteRunReportCommand = /* @__PURE__ */ __name(async (output, context)
|
|
|
616
617
|
const contents = (0, import_smithy_client.map)({
|
|
617
618
|
$metadata: deserializeMetadata(output)
|
|
618
619
|
});
|
|
619
|
-
const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await
|
|
620
|
+
const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await (0, import_core2.parseJsonBody)(output.body, context)), "body");
|
|
620
621
|
const doc = (0, import_smithy_client.take)(data, {
|
|
621
622
|
qualificationReportDownloadUrl: import_smithy_client.expectString
|
|
622
623
|
});
|
|
@@ -630,7 +631,7 @@ var de_ListSuiteDefinitionsCommand = /* @__PURE__ */ __name(async (output, conte
|
|
|
630
631
|
const contents = (0, import_smithy_client.map)({
|
|
631
632
|
$metadata: deserializeMetadata(output)
|
|
632
633
|
});
|
|
633
|
-
const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await
|
|
634
|
+
const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await (0, import_core2.parseJsonBody)(output.body, context)), "body");
|
|
634
635
|
const doc = (0, import_smithy_client.take)(data, {
|
|
635
636
|
nextToken: import_smithy_client.expectString,
|
|
636
637
|
suiteDefinitionInformationList: (_) => de_SuiteDefinitionInformationList(_, context)
|
|
@@ -645,7 +646,7 @@ var de_ListSuiteRunsCommand = /* @__PURE__ */ __name(async (output, context) =>
|
|
|
645
646
|
const contents = (0, import_smithy_client.map)({
|
|
646
647
|
$metadata: deserializeMetadata(output)
|
|
647
648
|
});
|
|
648
|
-
const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await
|
|
649
|
+
const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await (0, import_core2.parseJsonBody)(output.body, context)), "body");
|
|
649
650
|
const doc = (0, import_smithy_client.take)(data, {
|
|
650
651
|
nextToken: import_smithy_client.expectString,
|
|
651
652
|
suiteRunsList: (_) => de_SuiteRunsList(_, context)
|
|
@@ -660,7 +661,7 @@ var de_ListTagsForResourceCommand = /* @__PURE__ */ __name(async (output, contex
|
|
|
660
661
|
const contents = (0, import_smithy_client.map)({
|
|
661
662
|
$metadata: deserializeMetadata(output)
|
|
662
663
|
});
|
|
663
|
-
const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await
|
|
664
|
+
const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await (0, import_core2.parseJsonBody)(output.body, context)), "body");
|
|
664
665
|
const doc = (0, import_smithy_client.take)(data, {
|
|
665
666
|
tags: import_smithy_client._json
|
|
666
667
|
});
|
|
@@ -674,7 +675,7 @@ var de_StartSuiteRunCommand = /* @__PURE__ */ __name(async (output, context) =>
|
|
|
674
675
|
const contents = (0, import_smithy_client.map)({
|
|
675
676
|
$metadata: deserializeMetadata(output)
|
|
676
677
|
});
|
|
677
|
-
const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await
|
|
678
|
+
const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await (0, import_core2.parseJsonBody)(output.body, context)), "body");
|
|
678
679
|
const doc = (0, import_smithy_client.take)(data, {
|
|
679
680
|
createdAt: (_) => (0, import_smithy_client.expectNonNull)((0, import_smithy_client.parseEpochTimestamp)((0, import_smithy_client.expectNumber)(_))),
|
|
680
681
|
endpoint: import_smithy_client.expectString,
|
|
@@ -721,7 +722,7 @@ var de_UpdateSuiteDefinitionCommand = /* @__PURE__ */ __name(async (output, cont
|
|
|
721
722
|
const contents = (0, import_smithy_client.map)({
|
|
722
723
|
$metadata: deserializeMetadata(output)
|
|
723
724
|
});
|
|
724
|
-
const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await
|
|
725
|
+
const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await (0, import_core2.parseJsonBody)(output.body, context)), "body");
|
|
725
726
|
const doc = (0, import_smithy_client.take)(data, {
|
|
726
727
|
createdAt: (_) => (0, import_smithy_client.expectNonNull)((0, import_smithy_client.parseEpochTimestamp)((0, import_smithy_client.expectNumber)(_))),
|
|
727
728
|
lastUpdatedAt: (_) => (0, import_smithy_client.expectNonNull)((0, import_smithy_client.parseEpochTimestamp)((0, import_smithy_client.expectNumber)(_))),
|
|
@@ -736,9 +737,9 @@ var de_UpdateSuiteDefinitionCommand = /* @__PURE__ */ __name(async (output, cont
|
|
|
736
737
|
var de_CommandError = /* @__PURE__ */ __name(async (output, context) => {
|
|
737
738
|
const parsedOutput = {
|
|
738
739
|
...output,
|
|
739
|
-
body: await
|
|
740
|
+
body: await (0, import_core2.parseJsonErrorBody)(output.body, context)
|
|
740
741
|
};
|
|
741
|
-
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
742
|
+
const errorCode = (0, import_core2.loadRestJsonErrorCode)(output, parsedOutput.body);
|
|
742
743
|
switch (errorCode) {
|
|
743
744
|
case "InternalServerException":
|
|
744
745
|
case "com.amazonaws.iotdeviceadvisor#InternalServerException":
|
|
@@ -895,7 +896,6 @@ var deserializeMetadata = /* @__PURE__ */ __name((output) => ({
|
|
|
895
896
|
extendedRequestId: output.headers["x-amz-id-2"],
|
|
896
897
|
cfId: output.headers["x-amz-cf-id"]
|
|
897
898
|
}), "deserializeMetadata");
|
|
898
|
-
var collectBodyString = /* @__PURE__ */ __name((streamBody, context) => (0, import_smithy_client.collectBody)(streamBody, context).then((body) => context.utf8Encoder(body)), "collectBodyString");
|
|
899
899
|
var _aM = "authenticationMethod";
|
|
900
900
|
var _cA = "certificateArn";
|
|
901
901
|
var _dRA = "deviceRoleArn";
|
|
@@ -905,46 +905,6 @@ var _sDI = "suiteDefinitionId";
|
|
|
905
905
|
var _sDV = "suiteDefinitionVersion";
|
|
906
906
|
var _tA = "thingArn";
|
|
907
907
|
var _tK = "tagKeys";
|
|
908
|
-
var parseBody = /* @__PURE__ */ __name((streamBody, context) => collectBodyString(streamBody, context).then((encoded) => {
|
|
909
|
-
if (encoded.length) {
|
|
910
|
-
return JSON.parse(encoded);
|
|
911
|
-
}
|
|
912
|
-
return {};
|
|
913
|
-
}), "parseBody");
|
|
914
|
-
var parseErrorBody = /* @__PURE__ */ __name(async (errorBody, context) => {
|
|
915
|
-
const value = await parseBody(errorBody, context);
|
|
916
|
-
value.message = value.message ?? value.Message;
|
|
917
|
-
return value;
|
|
918
|
-
}, "parseErrorBody");
|
|
919
|
-
var loadRestJsonErrorCode = /* @__PURE__ */ __name((output, data) => {
|
|
920
|
-
const findKey = /* @__PURE__ */ __name((object, key) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase()), "findKey");
|
|
921
|
-
const sanitizeErrorCode = /* @__PURE__ */ __name((rawValue) => {
|
|
922
|
-
let cleanValue = rawValue;
|
|
923
|
-
if (typeof cleanValue === "number") {
|
|
924
|
-
cleanValue = cleanValue.toString();
|
|
925
|
-
}
|
|
926
|
-
if (cleanValue.indexOf(",") >= 0) {
|
|
927
|
-
cleanValue = cleanValue.split(",")[0];
|
|
928
|
-
}
|
|
929
|
-
if (cleanValue.indexOf(":") >= 0) {
|
|
930
|
-
cleanValue = cleanValue.split(":")[0];
|
|
931
|
-
}
|
|
932
|
-
if (cleanValue.indexOf("#") >= 0) {
|
|
933
|
-
cleanValue = cleanValue.split("#")[1];
|
|
934
|
-
}
|
|
935
|
-
return cleanValue;
|
|
936
|
-
}, "sanitizeErrorCode");
|
|
937
|
-
const headerKey = findKey(output.headers, "x-amzn-errortype");
|
|
938
|
-
if (headerKey !== void 0) {
|
|
939
|
-
return sanitizeErrorCode(output.headers[headerKey]);
|
|
940
|
-
}
|
|
941
|
-
if (data.code !== void 0) {
|
|
942
|
-
return sanitizeErrorCode(data.code);
|
|
943
|
-
}
|
|
944
|
-
if (data["__type"] !== void 0) {
|
|
945
|
-
return sanitizeErrorCode(data["__type"]);
|
|
946
|
-
}
|
|
947
|
-
}, "loadRestJsonErrorCode");
|
|
948
908
|
|
|
949
909
|
// src/commands/CreateSuiteDefinitionCommand.ts
|
|
950
910
|
var _CreateSuiteDefinitionCommand = class _CreateSuiteDefinitionCommand 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 { requestBuilder as rb } from "@smithy/core";
|
|
2
3
|
import { _json, collectBody, decorateServiceException as __decorateServiceException, expectBoolean as __expectBoolean, expectInt32 as __expectInt32, expectNonNull as __expectNonNull, expectNumber as __expectNumber, expectObject as __expectObject, expectString as __expectString, map, parseEpochTimestamp as __parseEpochTimestamp, take, withBaseException, } from "@smithy/smithy-client";
|
|
3
4
|
import { IotDeviceAdvisorServiceException as __BaseException } from "../models/IotDeviceAdvisorServiceException";
|
|
@@ -570,43 +571,3 @@ const _sDI = "suiteDefinitionId";
|
|
|
570
571
|
const _sDV = "suiteDefinitionVersion";
|
|
571
572
|
const _tA = "thingArn";
|
|
572
573
|
const _tK = "tagKeys";
|
|
573
|
-
const parseBody = (streamBody, context) => collectBodyString(streamBody, context).then((encoded) => {
|
|
574
|
-
if (encoded.length) {
|
|
575
|
-
return JSON.parse(encoded);
|
|
576
|
-
}
|
|
577
|
-
return {};
|
|
578
|
-
});
|
|
579
|
-
const parseErrorBody = async (errorBody, context) => {
|
|
580
|
-
const value = await parseBody(errorBody, context);
|
|
581
|
-
value.message = value.message ?? value.Message;
|
|
582
|
-
return value;
|
|
583
|
-
};
|
|
584
|
-
const loadRestJsonErrorCode = (output, data) => {
|
|
585
|
-
const findKey = (object, key) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase());
|
|
586
|
-
const sanitizeErrorCode = (rawValue) => {
|
|
587
|
-
let cleanValue = rawValue;
|
|
588
|
-
if (typeof cleanValue === "number") {
|
|
589
|
-
cleanValue = cleanValue.toString();
|
|
590
|
-
}
|
|
591
|
-
if (cleanValue.indexOf(",") >= 0) {
|
|
592
|
-
cleanValue = cleanValue.split(",")[0];
|
|
593
|
-
}
|
|
594
|
-
if (cleanValue.indexOf(":") >= 0) {
|
|
595
|
-
cleanValue = cleanValue.split(":")[0];
|
|
596
|
-
}
|
|
597
|
-
if (cleanValue.indexOf("#") >= 0) {
|
|
598
|
-
cleanValue = cleanValue.split("#")[1];
|
|
599
|
-
}
|
|
600
|
-
return cleanValue;
|
|
601
|
-
};
|
|
602
|
-
const headerKey = findKey(output.headers, "x-amzn-errortype");
|
|
603
|
-
if (headerKey !== undefined) {
|
|
604
|
-
return sanitizeErrorCode(output.headers[headerKey]);
|
|
605
|
-
}
|
|
606
|
-
if (data.code !== undefined) {
|
|
607
|
-
return sanitizeErrorCode(data.code);
|
|
608
|
-
}
|
|
609
|
-
if (data["__type"] !== undefined) {
|
|
610
|
-
return sanitizeErrorCode(data["__type"]);
|
|
611
|
-
}
|
|
612
|
-
};
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aws-sdk/client-iotdeviceadvisor",
|
|
3
3
|
"description": "AWS SDK for JavaScript Iotdeviceadvisor 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-iotdeviceadvisor",
|
|
@@ -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",
|