@aws-sdk/client-rbin
Advanced tools
Comparing version 3.525.0 to 3.529.0
@@ -209,2 +209,3 @@ "use strict"; | ||
// src/protocols/Aws_restJson1.ts | ||
var import_core2 = require("@aws-sdk/core"); | ||
@@ -504,3 +505,3 @@ | ||
}); | ||
const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await parseBody(output.body, context)), "body"); | ||
const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await (0, import_core2.parseJsonBody)(output.body, context)), "body"); | ||
const doc = (0, import_smithy_client.take)(data, { | ||
@@ -538,3 +539,3 @@ Description: import_smithy_client.expectString, | ||
}); | ||
const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await parseBody(output.body, context)), "body"); | ||
const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await (0, import_core2.parseJsonBody)(output.body, context)), "body"); | ||
const doc = (0, import_smithy_client.take)(data, { | ||
@@ -562,3 +563,3 @@ Description: import_smithy_client.expectString, | ||
}); | ||
const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await parseBody(output.body, context)), "body"); | ||
const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await (0, import_core2.parseJsonBody)(output.body, context)), "body"); | ||
const doc = (0, import_smithy_client.take)(data, { | ||
@@ -578,3 +579,3 @@ NextToken: import_smithy_client.expectString, | ||
}); | ||
const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await parseBody(output.body, context)), "body"); | ||
const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await (0, import_core2.parseJsonBody)(output.body, context)), "body"); | ||
const doc = (0, import_smithy_client.take)(data, { | ||
@@ -593,3 +594,3 @@ Tags: import_smithy_client._json | ||
}); | ||
const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await parseBody(output.body, context)), "body"); | ||
const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await (0, import_core2.parseJsonBody)(output.body, context)), "body"); | ||
const doc = (0, import_smithy_client.take)(data, { | ||
@@ -626,3 +627,3 @@ Description: import_smithy_client.expectString, | ||
}); | ||
const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await parseBody(output.body, context)), "body"); | ||
const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await (0, import_core2.parseJsonBody)(output.body, context)), "body"); | ||
const doc = (0, import_smithy_client.take)(data, { | ||
@@ -660,3 +661,3 @@ Description: import_smithy_client.expectString, | ||
}); | ||
const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await parseBody(output.body, context)), "body"); | ||
const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await (0, import_core2.parseJsonBody)(output.body, context)), "body"); | ||
const doc = (0, import_smithy_client.take)(data, { | ||
@@ -679,5 +680,5 @@ Description: import_smithy_client.expectString, | ||
...output, | ||
body: await parseErrorBody(output.body, context) | ||
body: await (0, import_core2.parseJsonErrorBody)(output.body, context) | ||
}; | ||
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); | ||
const errorCode = (0, import_core2.loadRestJsonErrorCode)(output, parsedOutput.body); | ||
switch (errorCode) { | ||
@@ -784,45 +785,4 @@ case "InternalServerException": | ||
}), "deserializeMetadata"); | ||
var collectBodyString = /* @__PURE__ */ __name((streamBody, context) => (0, import_smithy_client.collectBody)(streamBody, context).then((body) => context.utf8Encoder(body)), "collectBodyString"); | ||
var _TK = "TagKeys"; | ||
var _tK = "tagKeys"; | ||
var parseBody = /* @__PURE__ */ __name((streamBody, context) => collectBodyString(streamBody, context).then((encoded) => { | ||
if (encoded.length) { | ||
return JSON.parse(encoded); | ||
} | ||
return {}; | ||
}), "parseBody"); | ||
var parseErrorBody = /* @__PURE__ */ __name(async (errorBody, context) => { | ||
const value = await parseBody(errorBody, context); | ||
value.message = value.message ?? value.Message; | ||
return value; | ||
}, "parseErrorBody"); | ||
var loadRestJsonErrorCode = /* @__PURE__ */ __name((output, data) => { | ||
const findKey = /* @__PURE__ */ __name((object, key) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase()), "findKey"); | ||
const sanitizeErrorCode = /* @__PURE__ */ __name((rawValue) => { | ||
let cleanValue = rawValue; | ||
if (typeof cleanValue === "number") { | ||
cleanValue = cleanValue.toString(); | ||
} | ||
if (cleanValue.indexOf(",") >= 0) { | ||
cleanValue = cleanValue.split(",")[0]; | ||
} | ||
if (cleanValue.indexOf(":") >= 0) { | ||
cleanValue = cleanValue.split(":")[0]; | ||
} | ||
if (cleanValue.indexOf("#") >= 0) { | ||
cleanValue = cleanValue.split("#")[1]; | ||
} | ||
return cleanValue; | ||
}, "sanitizeErrorCode"); | ||
const headerKey = findKey(output.headers, "x-amzn-errortype"); | ||
if (headerKey !== void 0) { | ||
return sanitizeErrorCode(output.headers[headerKey]); | ||
} | ||
if (data.code !== void 0) { | ||
return sanitizeErrorCode(data.code); | ||
} | ||
if (data["__type"] !== void 0) { | ||
return sanitizeErrorCode(data["__type"]); | ||
} | ||
}, "loadRestJsonErrorCode"); | ||
@@ -829,0 +789,0 @@ // src/commands/CreateRuleCommand.ts |
@@ -0,1 +1,2 @@ | ||
import { loadRestJsonErrorCode, parseJsonBody as parseBody, parseJsonErrorBody as parseErrorBody } from "@aws-sdk/core"; | ||
import { requestBuilder as rb } from "@smithy/core"; | ||
@@ -423,41 +424,1 @@ import { _json, collectBody, decorateServiceException as __decorateServiceException, expectNonNull as __expectNonNull, expectNumber as __expectNumber, expectObject as __expectObject, expectString as __expectString, map, parseEpochTimestamp as __parseEpochTimestamp, take, withBaseException, } from "@smithy/smithy-client"; | ||
const _tK = "tagKeys"; | ||
const parseBody = (streamBody, context) => collectBodyString(streamBody, context).then((encoded) => { | ||
if (encoded.length) { | ||
return JSON.parse(encoded); | ||
} | ||
return {}; | ||
}); | ||
const parseErrorBody = async (errorBody, context) => { | ||
const value = await parseBody(errorBody, context); | ||
value.message = value.message ?? value.Message; | ||
return value; | ||
}; | ||
const loadRestJsonErrorCode = (output, data) => { | ||
const findKey = (object, key) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase()); | ||
const sanitizeErrorCode = (rawValue) => { | ||
let cleanValue = rawValue; | ||
if (typeof cleanValue === "number") { | ||
cleanValue = cleanValue.toString(); | ||
} | ||
if (cleanValue.indexOf(",") >= 0) { | ||
cleanValue = cleanValue.split(",")[0]; | ||
} | ||
if (cleanValue.indexOf(":") >= 0) { | ||
cleanValue = cleanValue.split(":")[0]; | ||
} | ||
if (cleanValue.indexOf("#") >= 0) { | ||
cleanValue = cleanValue.split("#")[1]; | ||
} | ||
return cleanValue; | ||
}; | ||
const headerKey = findKey(output.headers, "x-amzn-errortype"); | ||
if (headerKey !== undefined) { | ||
return sanitizeErrorCode(output.headers[headerKey]); | ||
} | ||
if (data.code !== undefined) { | ||
return sanitizeErrorCode(data.code); | ||
} | ||
if (data["__type"] !== undefined) { | ||
return sanitizeErrorCode(data["__type"]); | ||
} | ||
}; |
{ | ||
"name": "@aws-sdk/client-rbin", | ||
"description": "AWS SDK for JavaScript Rbin Client for Node.js, Browser and React Native", | ||
"version": "3.525.0", | ||
"version": "3.529.0", | ||
"scripts": { | ||
@@ -23,5 +23,5 @@ "build": "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'", | ||
"@aws-crypto/sha256-js": "3.0.0", | ||
"@aws-sdk/client-sts": "3.525.0", | ||
"@aws-sdk/core": "3.525.0", | ||
"@aws-sdk/credential-provider-node": "3.525.0", | ||
"@aws-sdk/client-sts": "3.529.0", | ||
"@aws-sdk/core": "3.529.0", | ||
"@aws-sdk/credential-provider-node": "3.529.0", | ||
"@aws-sdk/middleware-host-header": "3.523.0", | ||
@@ -28,0 +28,0 @@ "@aws-sdk/middleware-logger": "3.523.0", |
282206
6328
+ Added@aws-sdk/client-sso@3.529.0(transitive)
+ Added@aws-sdk/client-sso-oidc@3.529.0(transitive)
+ Added@aws-sdk/client-sts@3.529.0(transitive)
+ Added@aws-sdk/core@3.529.0(transitive)
+ Added@aws-sdk/credential-provider-ini@3.529.0(transitive)
+ Added@aws-sdk/credential-provider-node@3.529.0(transitive)
+ Added@aws-sdk/credential-provider-sso@3.529.0(transitive)
+ Added@aws-sdk/credential-provider-web-identity@3.529.0(transitive)
+ Added@aws-sdk/token-providers@3.529.0(transitive)
- Removed@aws-sdk/client-sso@3.525.0(transitive)
- Removed@aws-sdk/client-sso-oidc@3.525.0(transitive)
- Removed@aws-sdk/client-sts@3.525.0(transitive)
- Removed@aws-sdk/core@3.525.0(transitive)
- Removed@aws-sdk/credential-provider-ini@3.525.0(transitive)
- Removed@aws-sdk/credential-provider-node@3.525.0(transitive)
- Removed@aws-sdk/credential-provider-sso@3.525.0(transitive)
- Removed@aws-sdk/credential-provider-web-identity@3.525.0(transitive)
- Removed@aws-sdk/token-providers@3.525.0(transitive)
- Removedfast-xml-parser@4.2.5(transitive)
- Removedstrnum@1.0.5(transitive)
Updated@aws-sdk/client-sts@3.529.0
Updated@aws-sdk/core@3.529.0