@aws-sdk/middleware-sdk-sqs 3.489.0 → 3.496.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.
@@ -1,2 +1 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ module.exports = require("./index.js");
package/dist-cjs/index.js CHANGED
@@ -1,6 +1,151 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const tslib_1 = require("tslib");
4
- tslib_1.__exportStar(require("./receive-message"), exports);
5
- tslib_1.__exportStar(require("./send-message"), exports);
6
- tslib_1.__exportStar(require("./send-message-batch"), exports);
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // src/index.ts
21
+ var src_exports = {};
22
+ __export(src_exports, {
23
+ getReceiveMessagePlugin: () => getReceiveMessagePlugin,
24
+ getSendMessageBatchPlugin: () => getSendMessageBatchPlugin,
25
+ getSendMessagePlugin: () => getSendMessagePlugin,
26
+ receiveMessageMiddleware: () => receiveMessageMiddleware,
27
+ receiveMessageMiddlewareOptions: () => receiveMessageMiddlewareOptions,
28
+ sendMessageBatchMiddleware: () => sendMessageBatchMiddleware,
29
+ sendMessageBatchMiddlewareOptions: () => sendMessageBatchMiddlewareOptions,
30
+ sendMessageMiddleware: () => sendMessageMiddleware,
31
+ sendMessageMiddlewareOptions: () => sendMessageMiddlewareOptions
32
+ });
33
+ module.exports = __toCommonJS(src_exports);
34
+
35
+ // src/receive-message.ts
36
+ var import_util_hex_encoding = require("@smithy/util-hex-encoding");
37
+ var import_util_utf8 = require("@smithy/util-utf8");
38
+ function receiveMessageMiddleware(options) {
39
+ return (next) => async (args) => {
40
+ const resp = await next({ ...args });
41
+ const output = resp.output;
42
+ const messageIds = [];
43
+ if (output.Messages !== void 0) {
44
+ for (const message of output.Messages) {
45
+ const md5 = message.MD5OfBody;
46
+ const hash = new options.md5();
47
+ hash.update((0, import_util_utf8.toUint8Array)(message.Body || ""));
48
+ if (md5 !== (0, import_util_hex_encoding.toHex)(await hash.digest())) {
49
+ messageIds.push(message.MessageId);
50
+ }
51
+ }
52
+ }
53
+ if (messageIds.length > 0) {
54
+ throw new Error("Invalid MD5 checksum on messages: " + messageIds.join(", "));
55
+ }
56
+ return resp;
57
+ };
58
+ }
59
+ __name(receiveMessageMiddleware, "receiveMessageMiddleware");
60
+ var receiveMessageMiddlewareOptions = {
61
+ step: "initialize",
62
+ tags: ["VALIDATE_BODY_MD5"],
63
+ name: "receiveMessageMiddleware",
64
+ override: true
65
+ };
66
+ var getReceiveMessagePlugin = /* @__PURE__ */ __name((config) => ({
67
+ applyToStack: (clientStack) => {
68
+ clientStack.add(receiveMessageMiddleware(config), receiveMessageMiddlewareOptions);
69
+ }
70
+ }), "getReceiveMessagePlugin");
71
+
72
+ // src/send-message.ts
73
+
74
+ var import_util_utf82 = require("@smithy/util-utf8");
75
+ var sendMessageMiddleware = /* @__PURE__ */ __name((options) => (next) => async (args) => {
76
+ const resp = await next({ ...args });
77
+ const output = resp.output;
78
+ const hash = new options.md5();
79
+ hash.update((0, import_util_utf82.toUint8Array)(args.input.MessageBody || ""));
80
+ if (output.MD5OfMessageBody !== (0, import_util_hex_encoding.toHex)(await hash.digest())) {
81
+ throw new Error("InvalidChecksumError");
82
+ }
83
+ return resp;
84
+ }, "sendMessageMiddleware");
85
+ var sendMessageMiddlewareOptions = {
86
+ step: "initialize",
87
+ tags: ["VALIDATE_BODY_MD5"],
88
+ name: "sendMessageMiddleware",
89
+ override: true
90
+ };
91
+ var getSendMessagePlugin = /* @__PURE__ */ __name((config) => ({
92
+ applyToStack: (clientStack) => {
93
+ clientStack.add(sendMessageMiddleware(config), sendMessageMiddlewareOptions);
94
+ }
95
+ }), "getSendMessagePlugin");
96
+
97
+ // src/send-message-batch.ts
98
+
99
+ var import_util_utf83 = require("@smithy/util-utf8");
100
+ var sendMessageBatchMiddleware = /* @__PURE__ */ __name((options) => (next) => async (args) => {
101
+ const resp = await next({ ...args });
102
+ const output = resp.output;
103
+ const messageIds = [];
104
+ const entries = {};
105
+ if (output.Successful !== void 0) {
106
+ for (const entry of output.Successful) {
107
+ if (entry.Id !== void 0) {
108
+ entries[entry.Id] = entry;
109
+ }
110
+ }
111
+ }
112
+ for (const entry of args.input.Entries) {
113
+ if (entries[entry.Id]) {
114
+ const md5 = entries[entry.Id].MD5OfMessageBody;
115
+ const hash = new options.md5();
116
+ hash.update((0, import_util_utf83.toUint8Array)(entry.MessageBody || ""));
117
+ if (md5 !== (0, import_util_hex_encoding.toHex)(await hash.digest())) {
118
+ messageIds.push(entries[entry.Id].MessageId);
119
+ }
120
+ }
121
+ }
122
+ if (messageIds.length > 0) {
123
+ throw new Error("Invalid MD5 checksum on messages: " + messageIds.join(", "));
124
+ }
125
+ return resp;
126
+ }, "sendMessageBatchMiddleware");
127
+ var sendMessageBatchMiddlewareOptions = {
128
+ step: "initialize",
129
+ tags: ["VALIDATE_BODY_MD5"],
130
+ name: "sendMessageBatchMiddleware",
131
+ override: true
132
+ };
133
+ var getSendMessageBatchPlugin = /* @__PURE__ */ __name((config) => ({
134
+ applyToStack: (clientStack) => {
135
+ clientStack.add(sendMessageBatchMiddleware(config), sendMessageBatchMiddlewareOptions);
136
+ }
137
+ }), "getSendMessageBatchPlugin");
138
+ // Annotate the CommonJS export names for ESM import in node:
139
+
140
+ 0 && (module.exports = {
141
+ getReceiveMessagePlugin,
142
+ getSendMessageBatchPlugin,
143
+ getSendMessagePlugin,
144
+ receiveMessageMiddleware,
145
+ receiveMessageMiddlewareOptions,
146
+ sendMessageBatchMiddleware,
147
+ sendMessageBatchMiddlewareOptions,
148
+ sendMessageMiddleware,
149
+ sendMessageMiddlewareOptions
150
+ });
151
+
@@ -1,39 +1 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getReceiveMessagePlugin = exports.receiveMessageMiddlewareOptions = exports.receiveMessageMiddleware = void 0;
4
- const util_hex_encoding_1 = require("@smithy/util-hex-encoding");
5
- const util_utf8_1 = require("@smithy/util-utf8");
6
- function receiveMessageMiddleware(options) {
7
- return (next) => async (args) => {
8
- const resp = await next({ ...args });
9
- const output = resp.output;
10
- const messageIds = [];
11
- if (output.Messages !== undefined) {
12
- for (const message of output.Messages) {
13
- const md5 = message.MD5OfBody;
14
- const hash = new options.md5();
15
- hash.update((0, util_utf8_1.toUint8Array)(message.Body || ""));
16
- if (md5 !== (0, util_hex_encoding_1.toHex)(await hash.digest())) {
17
- messageIds.push(message.MessageId);
18
- }
19
- }
20
- }
21
- if (messageIds.length > 0) {
22
- throw new Error("Invalid MD5 checksum on messages: " + messageIds.join(", "));
23
- }
24
- return resp;
25
- };
26
- }
27
- exports.receiveMessageMiddleware = receiveMessageMiddleware;
28
- exports.receiveMessageMiddlewareOptions = {
29
- step: "initialize",
30
- tags: ["VALIDATE_BODY_MD5"],
31
- name: "receiveMessageMiddleware",
32
- override: true,
33
- };
34
- const getReceiveMessagePlugin = (config) => ({
35
- applyToStack: (clientStack) => {
36
- clientStack.add(receiveMessageMiddleware(config), exports.receiveMessageMiddlewareOptions);
37
- },
38
- });
39
- exports.getReceiveMessagePlugin = getReceiveMessagePlugin;
1
+ module.exports = require("./index.js");
@@ -1,45 +1 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getSendMessageBatchPlugin = exports.sendMessageBatchMiddlewareOptions = exports.sendMessageBatchMiddleware = void 0;
4
- const util_hex_encoding_1 = require("@smithy/util-hex-encoding");
5
- const util_utf8_1 = require("@smithy/util-utf8");
6
- const sendMessageBatchMiddleware = (options) => (next) => async (args) => {
7
- const resp = await next({ ...args });
8
- const output = resp.output;
9
- const messageIds = [];
10
- const entries = {};
11
- if (output.Successful !== undefined) {
12
- for (const entry of output.Successful) {
13
- if (entry.Id !== undefined) {
14
- entries[entry.Id] = entry;
15
- }
16
- }
17
- }
18
- for (const entry of args.input.Entries) {
19
- if (entries[entry.Id]) {
20
- const md5 = entries[entry.Id].MD5OfMessageBody;
21
- const hash = new options.md5();
22
- hash.update((0, util_utf8_1.toUint8Array)(entry.MessageBody || ""));
23
- if (md5 !== (0, util_hex_encoding_1.toHex)(await hash.digest())) {
24
- messageIds.push(entries[entry.Id].MessageId);
25
- }
26
- }
27
- }
28
- if (messageIds.length > 0) {
29
- throw new Error("Invalid MD5 checksum on messages: " + messageIds.join(", "));
30
- }
31
- return resp;
32
- };
33
- exports.sendMessageBatchMiddleware = sendMessageBatchMiddleware;
34
- exports.sendMessageBatchMiddlewareOptions = {
35
- step: "initialize",
36
- tags: ["VALIDATE_BODY_MD5"],
37
- name: "sendMessageBatchMiddleware",
38
- override: true,
39
- };
40
- const getSendMessageBatchPlugin = (config) => ({
41
- applyToStack: (clientStack) => {
42
- clientStack.add((0, exports.sendMessageBatchMiddleware)(config), exports.sendMessageBatchMiddlewareOptions);
43
- },
44
- });
45
- exports.getSendMessageBatchPlugin = getSendMessageBatchPlugin;
1
+ module.exports = require("./index.js");
@@ -1,28 +1 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getSendMessagePlugin = exports.sendMessageMiddlewareOptions = exports.sendMessageMiddleware = void 0;
4
- const util_hex_encoding_1 = require("@smithy/util-hex-encoding");
5
- const util_utf8_1 = require("@smithy/util-utf8");
6
- const sendMessageMiddleware = (options) => (next) => async (args) => {
7
- const resp = await next({ ...args });
8
- const output = resp.output;
9
- const hash = new options.md5();
10
- hash.update((0, util_utf8_1.toUint8Array)(args.input.MessageBody || ""));
11
- if (output.MD5OfMessageBody !== (0, util_hex_encoding_1.toHex)(await hash.digest())) {
12
- throw new Error("InvalidChecksumError");
13
- }
14
- return resp;
15
- };
16
- exports.sendMessageMiddleware = sendMessageMiddleware;
17
- exports.sendMessageMiddlewareOptions = {
18
- step: "initialize",
19
- tags: ["VALIDATE_BODY_MD5"],
20
- name: "sendMessageMiddleware",
21
- override: true,
22
- };
23
- const getSendMessagePlugin = (config) => ({
24
- applyToStack: (clientStack) => {
25
- clientStack.add((0, exports.sendMessageMiddleware)(config), exports.sendMessageMiddlewareOptions);
26
- },
27
- });
28
- exports.getSendMessagePlugin = getSendMessagePlugin;
1
+ module.exports = require("./index.js");
package/package.json CHANGED
@@ -1,9 +1,9 @@
1
1
  {
2
2
  "name": "@aws-sdk/middleware-sdk-sqs",
3
- "version": "3.489.0",
3
+ "version": "3.496.0",
4
4
  "scripts": {
5
5
  "build": "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'",
6
- "build:cjs": "tsc -p tsconfig.cjs.json",
6
+ "build:cjs": "node ../../scripts/compilation/inline middleware-sdk-sqs",
7
7
  "build:es": "tsc -p tsconfig.es.json",
8
8
  "build:include:deps": "lerna run --scope $npm_package_name --include-dependencies build",
9
9
  "build:types": "tsc -p tsconfig.types.json",
@@ -21,10 +21,10 @@
21
21
  },
22
22
  "license": "Apache-2.0",
23
23
  "dependencies": {
24
- "@aws-sdk/types": "3.489.0",
25
- "@smithy/types": "^2.8.0",
26
- "@smithy/util-hex-encoding": "^2.0.0",
27
- "@smithy/util-utf8": "^2.0.2",
24
+ "@aws-sdk/types": "3.496.0",
25
+ "@smithy/types": "^2.9.1",
26
+ "@smithy/util-hex-encoding": "^2.1.1",
27
+ "@smithy/util-utf8": "^2.1.1",
28
28
  "tslib": "^2.5.0"
29
29
  },
30
30
  "engines": {