@adobe/spacecat-shared-utils 1.38.0 → 1.38.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 +7 -0
- package/package.json +1 -1
- package/src/sqs.js +7 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
# [@adobe/spacecat-shared-utils-v1.38.1](https://github.com/adobe/spacecat-shared/compare/@adobe/spacecat-shared-utils-v1.38.0...@adobe/spacecat-shared-utils-v1.38.1) (2025-05-15)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* local development friendly aws clients and sqs wrapper ([#739](https://github.com/adobe/spacecat-shared/issues/739)) ([fada9c6](https://github.com/adobe/spacecat-shared/commit/fada9c6fc0508ba6acf46a4416593427b67306dd))
|
|
7
|
+
|
|
1
8
|
# [@adobe/spacecat-shared-utils-v1.38.0](https://github.com/adobe/spacecat-shared/compare/@adobe/spacecat-shared-utils-v1.37.4...@adobe/spacecat-shared-utils-v1.38.0) (2025-05-14)
|
|
2
9
|
|
|
3
10
|
|
package/package.json
CHANGED
package/src/sqs.js
CHANGED
|
@@ -15,6 +15,7 @@ import { SendMessageCommand, SQSClient } from '@aws-sdk/client-sqs';
|
|
|
15
15
|
import { instrumentAWSClient } from './xray.js';
|
|
16
16
|
|
|
17
17
|
import { hasText, isNonEmptyArray } from './functions.js';
|
|
18
|
+
import { isAWSLambda } from './runtimes.js';
|
|
18
19
|
|
|
19
20
|
function badRequest(message) {
|
|
20
21
|
return new Response('', {
|
|
@@ -103,6 +104,12 @@ export function sqsEventAdapter(fn) {
|
|
|
103
104
|
const { log } = context;
|
|
104
105
|
let message;
|
|
105
106
|
|
|
107
|
+
// if not in aws lambda, invoke the function with json body as message
|
|
108
|
+
if (!isAWSLambda()) {
|
|
109
|
+
message = await req.json();
|
|
110
|
+
return fn(message, context);
|
|
111
|
+
}
|
|
112
|
+
|
|
106
113
|
// currently not processing batch messages
|
|
107
114
|
const records = context.invocation?.event?.Records;
|
|
108
115
|
|