@aws-sdk/middleware-sdk-sqs 3.972.29 → 3.972.31
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 +9 -11
- package/package.json +7 -7
package/dist-cjs/index.js
CHANGED
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
var client = require('@smithy/core/client');
|
|
4
|
-
var serde = require('@smithy/core/serde');
|
|
1
|
+
const { NoOpLogger } = require("@smithy/core/client");
|
|
2
|
+
const { toUint8Array, toHex } = require("@smithy/core/serde");
|
|
5
3
|
|
|
6
4
|
const resolveQueueUrlConfig = (config) => {
|
|
7
5
|
return Object.assign(config, {
|
|
@@ -14,7 +12,7 @@ function queueUrlMiddleware({ useQueueUrlAsEndpoint, endpoint }) {
|
|
|
14
12
|
const { input } = args;
|
|
15
13
|
const resolvedEndpoint = context.endpointV2;
|
|
16
14
|
if (!endpoint && input.QueueUrl && resolvedEndpoint && useQueueUrlAsEndpoint) {
|
|
17
|
-
const logger = context.logger instanceof
|
|
15
|
+
const logger = context.logger instanceof NoOpLogger || !context.logger?.warn ? console : context.logger;
|
|
18
16
|
try {
|
|
19
17
|
const queueUrl = new URL(input.QueueUrl);
|
|
20
18
|
const queueUrlOrigin = new URL(queueUrl.origin);
|
|
@@ -59,8 +57,8 @@ function receiveMessageMiddleware(options) {
|
|
|
59
57
|
for (const message of output.Messages) {
|
|
60
58
|
const md5 = message.MD5OfBody;
|
|
61
59
|
const hash = new options.md5();
|
|
62
|
-
hash.update(
|
|
63
|
-
if (md5 !==
|
|
60
|
+
hash.update(toUint8Array(message.Body || ""));
|
|
61
|
+
if (md5 !== toHex(await hash.digest())) {
|
|
64
62
|
messageIds.push(message.MessageId);
|
|
65
63
|
}
|
|
66
64
|
}
|
|
@@ -90,8 +88,8 @@ const sendMessageMiddleware = (options) => (next) => async (args) => {
|
|
|
90
88
|
}
|
|
91
89
|
const output = resp.output;
|
|
92
90
|
const hash = new options.md5();
|
|
93
|
-
hash.update(
|
|
94
|
-
if (output.MD5OfMessageBody !==
|
|
91
|
+
hash.update(toUint8Array(args.input.MessageBody || ""));
|
|
92
|
+
if (output.MD5OfMessageBody !== toHex(await hash.digest())) {
|
|
95
93
|
throw new Error("InvalidChecksumError");
|
|
96
94
|
}
|
|
97
95
|
return resp;
|
|
@@ -127,8 +125,8 @@ const sendMessageBatchMiddleware = (options) => (next) => async (args) => {
|
|
|
127
125
|
if (entries[entry.Id]) {
|
|
128
126
|
const md5 = entries[entry.Id].MD5OfMessageBody;
|
|
129
127
|
const hash = new options.md5();
|
|
130
|
-
hash.update(
|
|
131
|
-
if (md5 !==
|
|
128
|
+
hash.update(toUint8Array(entry.MessageBody || ""));
|
|
129
|
+
if (md5 !== toHex(await hash.digest())) {
|
|
132
130
|
messageIds.push(entries[entry.Id].MessageId);
|
|
133
131
|
}
|
|
134
132
|
}
|
package/package.json
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aws-sdk/middleware-sdk-sqs",
|
|
3
|
-
"version": "3.972.
|
|
3
|
+
"version": "3.972.31",
|
|
4
4
|
"scripts": {
|
|
5
5
|
"build": "concurrently 'yarn:build:types' 'yarn:build:es' && yarn build:cjs",
|
|
6
|
-
"build:cjs": "node ../../scripts/compilation/inline
|
|
7
|
-
"build:es": "tsc -p tsconfig.es.json",
|
|
6
|
+
"build:cjs": "node ../../scripts/compilation/inline",
|
|
7
|
+
"build:es": "premove dist-es && tsc -p tsconfig.es.json",
|
|
8
8
|
"build:include:deps": "yarn g:turbo run build -F=\"$npm_package_name\"",
|
|
9
|
-
"build:types": "tsc -p tsconfig.types.json",
|
|
9
|
+
"build:types": "premove dist-types && tsc -p tsconfig.types.json",
|
|
10
10
|
"build:types:downlevel": "downlevel-dts dist-types dist-types/ts3.4",
|
|
11
|
-
"clean": "premove dist-cjs dist-es dist-types
|
|
11
|
+
"clean": "premove dist-cjs dist-es dist-types",
|
|
12
12
|
"test": "yarn g:vitest run",
|
|
13
|
-
"test:integration": "yarn g:vitest run -c vitest.config.integ.mts",
|
|
14
13
|
"test:watch": "yarn g:vitest watch",
|
|
14
|
+
"test:integration": "yarn g:vitest run -c vitest.config.integ.mts",
|
|
15
15
|
"test:integration:watch": "yarn g:vitest watch -c vitest.config.integ.mts"
|
|
16
16
|
},
|
|
17
17
|
"main": "./dist-cjs/index.js",
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
},
|
|
25
25
|
"license": "Apache-2.0",
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"@aws-sdk/types": "^3.973.
|
|
27
|
+
"@aws-sdk/types": "^3.973.13",
|
|
28
28
|
"@smithy/core": "^3.24.6",
|
|
29
29
|
"@smithy/types": "^4.14.3",
|
|
30
30
|
"tslib": "^2.6.2"
|