@aws-sdk/client-iot 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 +174 -214
- package/dist-es/protocols/Aws_restJson1.js +1 -40
- package/package.json +4 -4
|
@@ -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, expectLong as __expectLong, expectNonNull as __expectNonNull, expectNumber as __expectNumber, expectObject as __expectObject, expectString as __expectString, limitedParseDouble as __limitedParseDouble, map, parseEpochTimestamp as __parseEpochTimestamp, serializeFloat as __serializeFloat, take, withBaseException, } from "@smithy/smithy-client";
|
|
3
4
|
import { v4 as generateIdempotencyToken } from "uuid";
|
|
@@ -8710,43 +8711,3 @@ const _xaip = "x-amzn-iot-principal";
|
|
|
8710
8711
|
const _xaip_ = "x-amzn-iot-policy";
|
|
8711
8712
|
const _xap = "x-amzn-principal";
|
|
8712
8713
|
const _xat = "x-amz-tagging";
|
|
8713
|
-
const parseBody = (streamBody, context) => collectBodyString(streamBody, context).then((encoded) => {
|
|
8714
|
-
if (encoded.length) {
|
|
8715
|
-
return JSON.parse(encoded);
|
|
8716
|
-
}
|
|
8717
|
-
return {};
|
|
8718
|
-
});
|
|
8719
|
-
const parseErrorBody = async (errorBody, context) => {
|
|
8720
|
-
const value = await parseBody(errorBody, context);
|
|
8721
|
-
value.message = value.message ?? value.Message;
|
|
8722
|
-
return value;
|
|
8723
|
-
};
|
|
8724
|
-
const loadRestJsonErrorCode = (output, data) => {
|
|
8725
|
-
const findKey = (object, key) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase());
|
|
8726
|
-
const sanitizeErrorCode = (rawValue) => {
|
|
8727
|
-
let cleanValue = rawValue;
|
|
8728
|
-
if (typeof cleanValue === "number") {
|
|
8729
|
-
cleanValue = cleanValue.toString();
|
|
8730
|
-
}
|
|
8731
|
-
if (cleanValue.indexOf(",") >= 0) {
|
|
8732
|
-
cleanValue = cleanValue.split(",")[0];
|
|
8733
|
-
}
|
|
8734
|
-
if (cleanValue.indexOf(":") >= 0) {
|
|
8735
|
-
cleanValue = cleanValue.split(":")[0];
|
|
8736
|
-
}
|
|
8737
|
-
if (cleanValue.indexOf("#") >= 0) {
|
|
8738
|
-
cleanValue = cleanValue.split("#")[1];
|
|
8739
|
-
}
|
|
8740
|
-
return cleanValue;
|
|
8741
|
-
};
|
|
8742
|
-
const headerKey = findKey(output.headers, "x-amzn-errortype");
|
|
8743
|
-
if (headerKey !== undefined) {
|
|
8744
|
-
return sanitizeErrorCode(output.headers[headerKey]);
|
|
8745
|
-
}
|
|
8746
|
-
if (data.code !== undefined) {
|
|
8747
|
-
return sanitizeErrorCode(data.code);
|
|
8748
|
-
}
|
|
8749
|
-
if (data["__type"] !== undefined) {
|
|
8750
|
-
return sanitizeErrorCode(data["__type"]);
|
|
8751
|
-
}
|
|
8752
|
-
};
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aws-sdk/client-iot",
|
|
3
3
|
"description": "AWS SDK for JavaScript Iot 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-iot",
|
|
@@ -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",
|