Skip to content

Commit 64f68ab

Browse files
committed
feat: send notifications with lambda
1 parent 9342edd commit 64f68ab

14 files changed

+2370
-242
lines changed

dashboard/send-notification.mjs

+8-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { exec } from 'child_process';
22
import { config } from 'dotenv-flow';
3-
import { promisify } from 'node:util';
3+
import { inspect, promisify } from 'node:util';
44
import 'zx/globals';
55

66
config();
@@ -16,6 +16,8 @@ console.log('Sending notification...', {
1616
messageBody,
1717
});
1818

19+
console.log(process.env.USER_POOL_ID);
20+
1921
const listUsers = `aws cognito-idp list-users --user-pool-id ${process.env.USER_POOL_ID} --filter "email=\\"${userEmail}\\""`;
2022

2123
const users = JSON.parse((await execute(listUsers)).stdout);
@@ -43,4 +45,8 @@ const sendPushNotification = `aws pinpoint send-users-messages --cli-input-json
4345
sendRequest
4446
)}'`;
4547

46-
console.log(JSON.parse((await execute(sendPushNotification)).stdout));
48+
console.log(
49+
inspect(JSON.parse((await execute(sendPushNotification)).stdout), {
50+
depth: null,
51+
})
52+
);

0 commit comments

Comments
 (0)