@beesolve/sqs-handler 0.1.4 → 0.1.6

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/index.js +5 -5
  2. package/package.json +2 -2
package/dist/index.js CHANGED
@@ -15,12 +15,9 @@ function createSqsHandlers(props) {
15
15
  args: v.array(v.any())
16
16
  })), body);
17
17
  if (!result.success)
18
- throw new Error(`Wrong message format: ${JSON.stringify(v.flatten(result.issues), null, 2)}`);
18
+ throw new Error(`Wrong message format: ${prettyPrint(v.flatten(result.issues))}`);
19
19
  const { fn, args } = result.output;
20
- console.info({
21
- function: fn,
22
- arguments: args
23
- });
20
+ console.info(prettyPrint({ function: fn, arguments: args }));
24
21
  await props.functions[fn]?.(...args.map((args2) => decodeFromStringifiable(args2)));
25
22
  } catch (error) {
26
23
  console.error(error);
@@ -54,6 +51,9 @@ function createSqsHandlers(props) {
54
51
  }), {});
55
52
  return [handler, functions];
56
53
  }
54
+ function prettyPrint(value) {
55
+ return JSON.stringify(value, null, 2);
56
+ }
57
57
  export {
58
58
  createSqsHandlers
59
59
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@beesolve/sqs-handler",
3
3
  "description": "",
4
- "version": "0.1.4",
4
+ "version": "0.1.6",
5
5
  "type": "module",
6
6
  "files": [
7
7
  "dist"
@@ -45,7 +45,7 @@
45
45
  "constructs": "^10.4.5",
46
46
  "@aws-sdk/client-sqs": "^3.978.0",
47
47
  "valibot": "^1.2.0",
48
- "@beesolve/helpers": "0.1.1",
48
+ "@beesolve/helpers": "0.1.3",
49
49
  "@beesolve/cdk-email-alarms": "0.1.1",
50
50
  "@beesolve/cdk-constructs": "0.1.1"
51
51
  },