EmCoTe - Email Compatibility Tester
Application based on Node.js framework and Nest.js framework. Captures submissions from users to get a visual display of a given email (html code) on different devices such as browsers, mobile devices, etc.
##
Маршрут: GET /job?filter
Возможен дополнительный запрос filter, например:
/job?from=2024-04-18T13:09:40&to=2024-10-20T00:00:00&theme=тест&page_size=20&page=1
т.е. найти первые 20 задач с темой "тест" за определённый период.
Если фильтр не указан, то вернуться первые 30 задач, отсортированные по времени от новых к старым.
{
"from": Date,
"to": Date,
"theme": string,
"page_size: number,
"page": number,
}
{
"totalCount": 43,
"documents": [
{
"_id": "5fa2d97d6a2710293a623414",
"task_status": "waiting",
"html": "<p>fsdfsd</p>",
"theme": "тест8",
"devices": {
"yandex": {
"status": "done",
"image_url":"https://emcdn.ru//emailscreenshots/screenshot_67d44cf3-63ca-447d-8388-031eb27d5ae1.png"
},
"mailru": {
"status": "waiting"
},
"android": {
"status": "failed"
},
"windows_outlook": {
"status": "waiting"
}
},
"theme_counter": 128,
"_created": "2024-05-07T17:50:36.489Z",
"_modified": "2024-05-07T17:50:36.489Z",
},
{...}
]
}
Маршрут: POST /jobs
body:
{
"html": "<p>привет</p>",
"theme": "приветствие",
"devices": ["yandex_chrome", "mailru_chrome", "gmail_android11", "outlook16_windows11", "gmail_chrome"]
}
где devices состоит из <почтовый клиент>_<устройство или браузер>
т.е. "yandex_chrome" - это почта яндекса в браузере chrome
"mailru_chrome" - почта mail.ru в браузере chrome
"gmail_chrome" - почта на gmail.com в браузере chrome
"gmail_android11" - приложение gmail на устройстве android
"outlook16_windows11" - почтовый клиент outlook 2016 на windows 11
На первом этапе задача фиксируется в БД со статусом "set".
data: {
"task_status": "set",
"html": "<p>привет</p>",
"theme": "приветствие",
"theme_counter": 129,
"devices": {
"yandex_chrome": { "status": "set" },
"mailru_chrome": { "status": "set" },
//. . .
}
},
{
"task_status":"waiting",
"html":"<p>привет</p>",
"theme":"приветствие",
"theme_counter": 129,
"devices":{
"yandex_chrome":{"status":"waiting"},
"mailru_chrome":{"status":"waiting"},
//. . .
},
"_created":"2024-04-25T13:38:04.943Z",
"_modified":"2024-04-25T13:38:04.943Z",
"_id":"6ec0783fd733cee35b43de1e"
}
{
"racs_id": "6ec0783fd733cee35b43de1e",
"task_status": "waiting",
"theme": "Привет!",
"theme_counter": 129,
"devices": {
"yandex_chrome": {
"status": "waiting"
},
"mailru_chrome": {
"status": "waiting"
},
"gmail_android11": {
"status": "waiting"
},
"outlook16_windows11": {
"status": "waiting"
},
"gmail_chrome": {
"status": "waiting"
}
}
}
{
"yandex_chrome": {
"status":"done",
"image_url":"https://emcdn.ru//emailscreenshots/screenshot_c9dd47ab-799f-4d8b-8c4d-19f193fdd163.png"
},
"mailru_chrome": {
"status":"waiting"
},
"gmail_android11": {
"status":"failed",
}
}
Маршрут: GET /job/{job_id}
Пример: /job/6ec0783fd733cee35b43de1e
{
"task_status":"progress",
"html":"<p>привет</p>",
"theme":"приветствие",
"theme_counter": 129,
"devices":{
"yandex_chrome": {
"status":"done",
"image_url":"https://emcdn.ru/emailscreenshots/screenshot_c9dd47ab-799f-4d8b-8c4d-19f193fdd163.png"
},
"mailru_chrome": {
"status":"waiting"
},
"gmail_android11": {
"status":"failed",
}
"windows_outlook":{
"status":"canceled",
}
},
"_created":"2024-04-25T13:38:04.943Z",
"_modified":"2024-04-25T13:38:04.943Z",
"_id":"6ec0783fd733cee35b43de1e"
}
Маршрут: DELETE /job/{job_id}
{deleted_count: 1}
Если не указывать ID, то будут удалены все задачи
Пример:
DELETE /job
{deleted_count: 120}
Данная опция заблокирована на данный момент
filter: {},
sort: { _created: -1 },
limit: 10,
filter: { _id: taskId },
$ npm install
# development
$ npm run start
# watch mode
$ npm run start:dev
# production mode
$ npm run start:prod
Nest is MIT licensed.
# Print a list of invalid files
$ npx prettier -l src/
# Fix all files
$ npx prettier -w src/
# change all EOLs from \r\n to \n
$ git config core.autocrlf false
$ git rm --cached -r .
$ git reset --hard