@adobe/spacecat-shared-utils 1.15.10 → 1.16.1
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/CHANGELOG.md +15 -0
- package/package.json +3 -3
- package/src/sqs.js +6 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,18 @@
|
|
|
1
|
+
# [@adobe/spacecat-shared-utils-v1.16.1](https://github.com/adobe/spacecat-shared/compare/@adobe/spacecat-shared-utils-v1.16.0...@adobe/spacecat-shared-utils-v1.16.1) (2024-06-27)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* **deps:** update external fixes ([#274](https://github.com/adobe/spacecat-shared/issues/274)) ([6bed341](https://github.com/adobe/spacecat-shared/commit/6bed3412af558946575f9f6be6d313ff0511db40))
|
|
7
|
+
* sqs adapter records access ([#275](https://github.com/adobe/spacecat-shared/issues/275)) ([856e247](https://github.com/adobe/spacecat-shared/commit/856e247a8ef764ed1bfe649c1e51eb2d86d9ecc1)), closes [#181](https://github.com/adobe/spacecat-shared/issues/181)
|
|
8
|
+
|
|
9
|
+
# [@adobe/spacecat-shared-utils-v1.16.0](https://github.com/adobe/spacecat-shared/compare/@adobe/spacecat-shared-utils-v1.15.10...@adobe/spacecat-shared-utils-v1.16.0) (2024-06-20)
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
### Features
|
|
13
|
+
|
|
14
|
+
* **audit-configs:** ess audits disabled by default ([#271](https://github.com/adobe/spacecat-shared/issues/271)) ([de6f83d](https://github.com/adobe/spacecat-shared/commit/de6f83db75135820b236d55d7d2b477f29ca5e43))
|
|
15
|
+
|
|
1
16
|
# [@adobe/spacecat-shared-utils-v1.15.10](https://github.com/adobe/spacecat-shared/compare/@adobe/spacecat-shared-utils-v1.15.9...@adobe/spacecat-shared-utils-v1.15.10) (2024-06-18)
|
|
2
17
|
|
|
3
18
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@adobe/spacecat-shared-utils",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.16.1",
|
|
4
4
|
"description": "Shared modules of the Spacecat Services - utils",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "src/index.js",
|
|
@@ -41,8 +41,8 @@
|
|
|
41
41
|
},
|
|
42
42
|
"dependencies": {
|
|
43
43
|
"@adobe/fetch": "4.1.8",
|
|
44
|
-
"@aws-sdk/client-s3": "3.
|
|
45
|
-
"@aws-sdk/client-sqs": "3.
|
|
44
|
+
"@aws-sdk/client-s3": "3.600.0",
|
|
45
|
+
"@aws-sdk/client-sqs": "3.600.0",
|
|
46
46
|
"@json2csv/plainjs": "7.0.6"
|
|
47
47
|
}
|
|
48
48
|
}
|
package/src/sqs.js
CHANGED
|
@@ -72,9 +72,13 @@ export function sqsEventAdapter(fn) {
|
|
|
72
72
|
try {
|
|
73
73
|
// currently not publishing batch messages
|
|
74
74
|
const records = context.invocation?.event?.Records;
|
|
75
|
-
|
|
75
|
+
if (!Array.isArray(records) || records.length === 0) {
|
|
76
|
+
throw new Error('No records found');
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
log.info(`Received ${records.length} records. ID of the first message in the batch: ${records[0]?.messageId}`);
|
|
76
80
|
message = JSON.parse(records[0]?.body);
|
|
77
|
-
log.info(`Received message with id: ${
|
|
81
|
+
log.info(`Received message with id: ${records[0]?.messageId}`);
|
|
78
82
|
} catch (e) {
|
|
79
83
|
log.error('Function was not invoked properly, message body is not a valid JSON', e);
|
|
80
84
|
return new Response('', {
|