mirror of
https://github.com/brettstack/civ6-play-by-cloud-turn-notifier.git
synced 2026-02-19 11:55:11 -05:00
42 lines
1.0 KiB
JavaScript
42 lines
1.0 KiB
JavaScript
import { webhookHandler } from '../functions/webhook/lambda'
|
|
|
|
const {
|
|
GAME_ID,
|
|
} = process.env
|
|
|
|
const EVENT = {
|
|
Records: [{
|
|
messageId: '059f36b4-87a3-44ab-83d2-661975830a7d',
|
|
receiptHandle: 'AQEBwJnKyrHigUMZj6rYigCgxlaS3SLy0a...',
|
|
body: JSON.stringify({
|
|
value1: 'Game Name',
|
|
value2: 'Brett',
|
|
value3: Math.round(Math.random(1, 100) * 100).toString(),
|
|
}),
|
|
attributes: {
|
|
ApproximateReceiveCount: '1',
|
|
SentTimestamp: '1545082649183',
|
|
SenderId: 'AIDAIENQZJOLO23YVJ4VO',
|
|
ApproximateFirstReceiveTimestamp: '1545082649185',
|
|
},
|
|
messageAttributes: {
|
|
gameId: {
|
|
stringValue: GAME_ID,
|
|
stringListValues: [],
|
|
binaryListValues: [],
|
|
dataType: 'String',
|
|
},
|
|
},
|
|
md5OfBody: '098f6bcd4621d373cade4e832627b4f6',
|
|
eventSource: 'aws:sqs',
|
|
eventSourceARN: 'arn:aws:sqs:us-east-2:123456789012:my-queue',
|
|
awsRegion: 'us-west-2',
|
|
}],
|
|
}
|
|
async function run() {
|
|
const r = await webhookHandler(EVENT)
|
|
console.log(r)
|
|
}
|
|
|
|
run()
|