@aws-sdk/middleware-sdk-sqs 3.972.30 → 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.
Files changed (2) hide show
  1. package/dist-cjs/index.js +9 -11
  2. package/package.json +5 -5
package/dist-cjs/index.js CHANGED
@@ -1,7 +1,5 @@
1
- 'use strict';
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 client.NoOpLogger || !context.logger?.warn ? console : context.logger;
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(serde.toUint8Array(message.Body || ""));
63
- if (md5 !== serde.toHex(await hash.digest())) {
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(serde.toUint8Array(args.input.MessageBody || ""));
94
- if (output.MD5OfMessageBody !== serde.toHex(await hash.digest())) {
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(serde.toUint8Array(entry.MessageBody || ""));
131
- if (md5 !== serde.toHex(await hash.digest())) {
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,14 +1,14 @@
1
1
  {
2
2
  "name": "@aws-sdk/middleware-sdk-sqs",
3
- "version": "3.972.30",
3
+ "version": "3.972.31",
4
4
  "scripts": {
5
5
  "build": "concurrently 'yarn:build:types' 'yarn:build:es' && yarn build:cjs",
6
6
  "build:cjs": "node ../../scripts/compilation/inline",
7
- "build:es": "tsc -p tsconfig.es.json",
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 tsconfig.cjs.tsbuildinfo tsconfig.es.tsbuildinfo tsconfig.types.tsbuildinfo",
11
+ "clean": "premove dist-cjs dist-es dist-types",
12
12
  "test": "yarn g:vitest run",
13
13
  "test:watch": "yarn g:vitest watch",
14
14
  "test:integration": "yarn g:vitest run -c vitest.config.integ.mts",
@@ -24,7 +24,7 @@
24
24
  },
25
25
  "license": "Apache-2.0",
26
26
  "dependencies": {
27
- "@aws-sdk/types": "^3.973.12",
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"