-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp.js
More file actions
33 lines (26 loc) · 1015 Bytes
/
app.js
File metadata and controls
33 lines (26 loc) · 1015 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
// Copyright 2021, Tomas Dabašinskas and the Ukko contributors
// SPDX-License-Identifier: MIT
import { GmailApp, InboxThread, GmailMessage, Logger } from './modules/google-apps-script.js'
import { runUkko } from './modules/ukko.js'
// Setup data
const headers1 = {
From: 'Announce list <announce-list@example.com>',
'List-Id': 'Announce List <announce-list.example.com>'
}
const headers2 = {
From: 'email@subdomain.example.com',
'List-Id': 'Planet List <planet-list.example.com>'
}
const message1 = new GmailMessage(headers1)
const message2 = new GmailMessage(headers2)
const inboxThread1 = new InboxThread([message1])
const inboxThread2 = new InboxThread([message1, message2])
const gmailApp = new GmailApp([inboxThread1, inboxThread2])
const logger = new Logger()
export { gmailApp as GmailApp, logger as Logger }
// run when executed directly: node app.js
// skip when imported by test runner (mocha, etc.)
const entryArg = process.argv[1] || ''
if (entryArg.endsWith('app.js')) {
runUkko()
}