@aws-sdk/middleware-sdk-sqs 3.972.22 → 3.972.23
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
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
var utilUtf8 = require('@smithy/util-utf8');
|
|
3
|
+
var client = require('@smithy/core/client');
|
|
4
|
+
var serde = require('@smithy/core/serde');
|
|
6
5
|
|
|
7
6
|
const resolveQueueUrlConfig = (config) => {
|
|
8
7
|
return Object.assign(config, {
|
|
@@ -15,7 +14,7 @@ function queueUrlMiddleware({ useQueueUrlAsEndpoint, endpoint }) {
|
|
|
15
14
|
const { input } = args;
|
|
16
15
|
const resolvedEndpoint = context.endpointV2;
|
|
17
16
|
if (!endpoint && input.QueueUrl && resolvedEndpoint && useQueueUrlAsEndpoint) {
|
|
18
|
-
const logger = context.logger instanceof
|
|
17
|
+
const logger = context.logger instanceof client.NoOpLogger || !context.logger?.warn ? console : context.logger;
|
|
19
18
|
try {
|
|
20
19
|
const queueUrl = new URL(input.QueueUrl);
|
|
21
20
|
const queueUrlOrigin = new URL(queueUrl.origin);
|
|
@@ -60,8 +59,8 @@ function receiveMessageMiddleware(options) {
|
|
|
60
59
|
for (const message of output.Messages) {
|
|
61
60
|
const md5 = message.MD5OfBody;
|
|
62
61
|
const hash = new options.md5();
|
|
63
|
-
hash.update(
|
|
64
|
-
if (md5 !==
|
|
62
|
+
hash.update(serde.toUint8Array(message.Body || ""));
|
|
63
|
+
if (md5 !== serde.toHex(await hash.digest())) {
|
|
65
64
|
messageIds.push(message.MessageId);
|
|
66
65
|
}
|
|
67
66
|
}
|
|
@@ -91,8 +90,8 @@ const sendMessageMiddleware = (options) => (next) => async (args) => {
|
|
|
91
90
|
}
|
|
92
91
|
const output = resp.output;
|
|
93
92
|
const hash = new options.md5();
|
|
94
|
-
hash.update(
|
|
95
|
-
if (output.MD5OfMessageBody !==
|
|
93
|
+
hash.update(serde.toUint8Array(args.input.MessageBody || ""));
|
|
94
|
+
if (output.MD5OfMessageBody !== serde.toHex(await hash.digest())) {
|
|
96
95
|
throw new Error("InvalidChecksumError");
|
|
97
96
|
}
|
|
98
97
|
return resp;
|
|
@@ -128,8 +127,8 @@ const sendMessageBatchMiddleware = (options) => (next) => async (args) => {
|
|
|
128
127
|
if (entries[entry.Id]) {
|
|
129
128
|
const md5 = entries[entry.Id].MD5OfMessageBody;
|
|
130
129
|
const hash = new options.md5();
|
|
131
|
-
hash.update(
|
|
132
|
-
if (md5 !==
|
|
130
|
+
hash.update(serde.toUint8Array(entry.MessageBody || ""));
|
|
131
|
+
if (md5 !== serde.toHex(await hash.digest())) {
|
|
133
132
|
messageIds.push(entries[entry.Id].MessageId);
|
|
134
133
|
}
|
|
135
134
|
}
|
package/dist-es/queue-url.js
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { toHex } from "@smithy/
|
|
2
|
-
import { toUint8Array } from "@smithy/util-utf8";
|
|
1
|
+
import { toHex, toUint8Array } from "@smithy/core/serde";
|
|
3
2
|
export function receiveMessageMiddleware(options) {
|
|
4
3
|
return (next) => async (args) => {
|
|
5
4
|
const resp = await next({ ...args });
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { toHex } from "@smithy/
|
|
2
|
-
import { toUint8Array } from "@smithy/util-utf8";
|
|
1
|
+
import { toHex, toUint8Array } from "@smithy/core/serde";
|
|
3
2
|
export const sendMessageBatchMiddleware = (options) => (next) => async (args) => {
|
|
4
3
|
const resp = await next({ ...args });
|
|
5
4
|
if (options.md5 === false) {
|
package/dist-es/send-message.js
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { toHex } from "@smithy/
|
|
2
|
-
import { toUint8Array } from "@smithy/util-utf8";
|
|
1
|
+
import { toHex, toUint8Array } from "@smithy/core/serde";
|
|
3
2
|
export const sendMessageMiddleware = (options) => (next) => async (args) => {
|
|
4
3
|
const resp = await next({ ...args });
|
|
5
4
|
if (options.md5 === false) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aws-sdk/middleware-sdk-sqs",
|
|
3
|
-
"version": "3.972.
|
|
3
|
+
"version": "3.972.23",
|
|
4
4
|
"scripts": {
|
|
5
5
|
"build": "concurrently 'yarn:build:types' 'yarn:build:es' && yarn build:cjs",
|
|
6
6
|
"build:cjs": "node ../../scripts/compilation/inline middleware-sdk-sqs",
|
|
@@ -25,10 +25,8 @@
|
|
|
25
25
|
"license": "Apache-2.0",
|
|
26
26
|
"dependencies": {
|
|
27
27
|
"@aws-sdk/types": "^3.973.8",
|
|
28
|
-
"@smithy/
|
|
28
|
+
"@smithy/core": "^3.24.1",
|
|
29
29
|
"@smithy/types": "^4.14.1",
|
|
30
|
-
"@smithy/util-hex-encoding": "^4.2.2",
|
|
31
|
-
"@smithy/util-utf8": "^4.2.2",
|
|
32
30
|
"tslib": "^2.6.2"
|
|
33
31
|
},
|
|
34
32
|
"engines": {
|