emailengine-app 2.83.2 → 2.84.1
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.
- package/.release-please-manifest.json +1 -1
- package/CHANGELOG.md +27 -0
- package/README.md +1 -1
- package/SECURITY.md +126 -47
- package/data/google-crawlers.json +1 -1
- package/lib/api-routes/outbox-routes.js +132 -9
- package/lib/api-routes/permission-map.js +11 -1
- package/lib/consts.js +0 -4
- package/lib/email-client/imap/idle-settings.js +44 -0
- package/lib/email-client/imap/mailbox.js +19 -7
- package/lib/email-client/imap-client.js +3 -21
- package/lib/enum-descriptions.js +7 -0
- package/lib/export.js +2 -6
- package/lib/field-usage.js +4 -0
- package/lib/handlebars-helpers.js +4 -0
- package/lib/outbox.js +338 -10
- package/lib/queue-browser/definitions.js +132 -0
- package/lib/queue-browser/format.js +387 -0
- package/lib/queue-browser/index.js +568 -0
- package/lib/queue-job-actions.js +75 -0
- package/lib/queue-retention.js +53 -1
- package/lib/routes-ui.js +5 -0
- package/lib/schemas.js +42 -2
- package/lib/security-headers.js +2 -24
- package/lib/token-permission-view.js +1 -1
- package/lib/ui-routes/account-routes.js +6 -0
- package/lib/ui-routes/imap-idle-field.js +42 -0
- package/lib/ui-routes/queue-routes.js +371 -0
- package/lib/utils/status-error.js +21 -0
- package/package.json +15 -17
- package/prepare-bundle-deps.sh +1 -1
- package/sbom.json +1 -1
- package/server.js +59 -24
- package/static/css/flyonui.css +1 -1
- package/static/css/src/app.tailwind.css +2 -0
- package/static/js/queues.js +117 -0
- package/static/licenses.html +122 -246
- package/translations/messages.pot +57 -42
- package/views/accounts/account.hbs +31 -0
- package/views/accounts/edit.hbs +2 -0
- package/views/config/service.hbs +1 -2
- package/views/dashboard.hbs +2 -2
- package/views/partials/queue_cell_account.hbs +20 -0
- package/views/partials/queue_cell_failure.hbs +6 -0
- package/views/partials/queue_clean_items.hbs +9 -0
- package/views/partials/queue_clean_modal.hbs +9 -0
- package/views/partials/queue_entry_actions.hbs +41 -0
- package/views/partials/queue_job_actions.hbs +15 -0
- package/views/partials/queue_pause_controls.hbs +18 -0
- package/views/partials/queue_retention_note.hbs +49 -0
- package/views/partials/queue_rows_export.hbs +58 -0
- package/views/partials/queue_rows_notify.hbs +73 -0
- package/views/partials/queue_rows_submit.hbs +70 -0
- package/views/partials/side_menu.hbs +1 -1
- package/views/partials/ui/tooltip.hbs +5 -3
- package/views/queues/index.hbs +104 -0
- package/views/queues/job.hbs +224 -0
- package/views/queues/queue.hbs +93 -0
- package/views/webhooks/webhook.hbs +3 -0
- package/workers/api.js +0 -4
- package/workers/submit.js +19 -5
- package/workers/webhooks.js +13 -0
- package/lib/api-routes/bull-board-routes.js +0 -56
|
@@ -0,0 +1,371 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
// Admin UI routes for the queue browser: the overview of the BullMQ queues, one page per queue
|
|
4
|
+
// with its jobs by state, a page per job, and the actions on them. The model is lib/queue-browser;
|
|
5
|
+
// these routes only validate what a URL names, render, and turn the outcomes into flash messages.
|
|
6
|
+
//
|
|
7
|
+
// This is the "Queues" entry in the side menu. It replaced the bundled bull-board UI, which was
|
|
8
|
+
// mounted at /admin/bull-board; that path and its deep links redirect here.
|
|
9
|
+
|
|
10
|
+
const Joi = require('joi');
|
|
11
|
+
const Boom = require('@hapi/boom');
|
|
12
|
+
|
|
13
|
+
const { buildPagingView } = require('./route-helpers');
|
|
14
|
+
const queueBrowser = require('../queue-browser');
|
|
15
|
+
const { QUEUE_NAMES, STATE_NAMES, DEFAULT_STATE, SCAN_LIMIT } = require('../queue-browser/definitions');
|
|
16
|
+
const { DEFAULT_PAGE_SIZE } = require('../consts');
|
|
17
|
+
|
|
18
|
+
const QUEUE_PARAM = Joi.string()
|
|
19
|
+
.valid(...QUEUE_NAMES)
|
|
20
|
+
.required()
|
|
21
|
+
.description('Queue name');
|
|
22
|
+
const JOB_PARAM = Joi.string().max(256).required().description('Job ID');
|
|
23
|
+
|
|
24
|
+
// Where an action returns to: only a page of this browser, so a posted value cannot send the
|
|
25
|
+
// browser anywhere else. The actions are posted from a filtered or paged list and from a
|
|
26
|
+
// detail page alike, which is why they carry a return target where other admin actions
|
|
27
|
+
// redirect to a fixed page.
|
|
28
|
+
const NEXT_PARAM = Joi.string()
|
|
29
|
+
.empty('')
|
|
30
|
+
.max(2048)
|
|
31
|
+
.pattern(/^\/admin\/queues(?:[/?]|$)/)
|
|
32
|
+
.description('Page to return to');
|
|
33
|
+
|
|
34
|
+
const VALIDATE_OPTIONS = {
|
|
35
|
+
stripUnknown: true,
|
|
36
|
+
abortEarly: false,
|
|
37
|
+
convert: true
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
// A request this browser cannot make sense of lands on the overview
|
|
41
|
+
async function redirectToOverview(request, h /*, err*/) {
|
|
42
|
+
return h.redirect('/admin/queues').takeover();
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* The URL of a queue listing, from its parameters. Only values that differ from the defaults
|
|
47
|
+
* are written, so the tab links and the pagination stay short.
|
|
48
|
+
*/
|
|
49
|
+
function listUrl(queueName, params) {
|
|
50
|
+
const url = new URL(`/admin/queues/${queueName}`, 'http://localhost');
|
|
51
|
+
if (params.state && params.state !== DEFAULT_STATE) {
|
|
52
|
+
url.searchParams.set('state', params.state);
|
|
53
|
+
}
|
|
54
|
+
for (const key of ['query', 'account', 'route']) {
|
|
55
|
+
if (params[key]) {
|
|
56
|
+
url.searchParams.set(key, params[key]);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
if (params.page && params.page > 1) {
|
|
60
|
+
url.searchParams.set('page', params.page);
|
|
61
|
+
}
|
|
62
|
+
if (params.pageSize && params.pageSize !== DEFAULT_PAGE_SIZE) {
|
|
63
|
+
url.searchParams.set('pageSize', params.pageSize);
|
|
64
|
+
}
|
|
65
|
+
return url.pathname + url.search;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* Turns a browser error into a flash message, so a refused action lands the reader back where
|
|
70
|
+
* they were with the reason, and anything unexpected is logged as such.
|
|
71
|
+
*/
|
|
72
|
+
async function flashFailure(request, err, fallback) {
|
|
73
|
+
if (err && err.statusCode && err.statusCode < 500) {
|
|
74
|
+
await request.flash({ type: 'warning', message: err.message });
|
|
75
|
+
} else {
|
|
76
|
+
request.logger.error({ msg: fallback, err, queue: request.params.queue, job: request.params.jobId });
|
|
77
|
+
await request.flash({ type: 'danger', message: `${fallback}. Try again.` });
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
* A POST route that runs an action on a queue (or one of its jobs), flashes the outcome and
|
|
83
|
+
* returns to the page it was posted from.
|
|
84
|
+
*
|
|
85
|
+
* @param {Object} options
|
|
86
|
+
* @param {string} options.path - Route path, with the {queue} and optionally {jobId} params
|
|
87
|
+
* @param {Object} [options.payload] - Extra payload fields, beyond `next`
|
|
88
|
+
* @param {Function} options.run - `(queueDef, request) => outcome` ({ type, message, next }); `next`, when set,
|
|
89
|
+
* replaces the posted return target
|
|
90
|
+
* @param {string} options.fallback - What to say when the action throws something unexpected
|
|
91
|
+
*/
|
|
92
|
+
function actionRoute({ path, payload, run, fallback }) {
|
|
93
|
+
return {
|
|
94
|
+
method: 'POST',
|
|
95
|
+
path,
|
|
96
|
+
async handler(request, h) {
|
|
97
|
+
const queueDef = queueBrowser.QUEUES_BY_NAME.get(request.params.queue);
|
|
98
|
+
let next;
|
|
99
|
+
try {
|
|
100
|
+
const outcome = await run(queueDef, request);
|
|
101
|
+
next = outcome.next;
|
|
102
|
+
await request.flash({ type: outcome.type, message: outcome.message });
|
|
103
|
+
} catch (err) {
|
|
104
|
+
await flashFailure(request, err, fallback);
|
|
105
|
+
}
|
|
106
|
+
return h.redirect(next || request.payload.next || `/admin/queues/${queueDef.name}`);
|
|
107
|
+
},
|
|
108
|
+
options: {
|
|
109
|
+
validate: {
|
|
110
|
+
options: VALIDATE_OPTIONS,
|
|
111
|
+
failAction: redirectToOverview,
|
|
112
|
+
params: Joi.object(Object.assign({ queue: QUEUE_PARAM }, path.includes('{jobId}') ? { jobId: JOB_PARAM } : {})),
|
|
113
|
+
payload: Joi.object(Object.assign({ next: NEXT_PARAM }, payload || {}))
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
};
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
function init(args) {
|
|
120
|
+
const { server } = args;
|
|
121
|
+
|
|
122
|
+
server.route({
|
|
123
|
+
method: 'GET',
|
|
124
|
+
path: '/admin/queues',
|
|
125
|
+
async handler(request, h) {
|
|
126
|
+
const model = await queueBrowser.overview();
|
|
127
|
+
|
|
128
|
+
return h.view('queues/index', Object.assign({ pageTitle: 'Queues', menuQueues: true }, model), { layout: 'app' });
|
|
129
|
+
}
|
|
130
|
+
});
|
|
131
|
+
|
|
132
|
+
// What the pages poll for live counts. A literal segment, so it is routed ahead of the
|
|
133
|
+
// /{queue} page below; no queue is called "counts".
|
|
134
|
+
server.route({
|
|
135
|
+
method: 'GET',
|
|
136
|
+
path: '/admin/queues/counts',
|
|
137
|
+
async handler() {
|
|
138
|
+
return { queues: await queueBrowser.allCounts() };
|
|
139
|
+
}
|
|
140
|
+
});
|
|
141
|
+
|
|
142
|
+
server.route({
|
|
143
|
+
method: 'GET',
|
|
144
|
+
path: '/admin/queues/{queue}',
|
|
145
|
+
async handler(request, h) {
|
|
146
|
+
const queueDef = queueBrowser.QUEUES_BY_NAME.get(request.params.queue);
|
|
147
|
+
const { state, query, account, route } = request.query;
|
|
148
|
+
|
|
149
|
+
// What is kept and where that is set, for the Failed and Completed tabs (the note partial
|
|
150
|
+
// renders nothing on the others)
|
|
151
|
+
const [status, retention] = await Promise.all([queueBrowser.queueCounts(queueDef), queueBrowser.retention()]);
|
|
152
|
+
const listing = await queueBrowser.listJobs({
|
|
153
|
+
queue: queueDef,
|
|
154
|
+
state,
|
|
155
|
+
stateTotal: status.counts[state],
|
|
156
|
+
page: request.query.page - 1,
|
|
157
|
+
pageSize: request.query.pageSize,
|
|
158
|
+
query,
|
|
159
|
+
account,
|
|
160
|
+
route,
|
|
161
|
+
logger: request.logger
|
|
162
|
+
});
|
|
163
|
+
|
|
164
|
+
const filterParams = { query, account, route };
|
|
165
|
+
const currentUrl = listUrl(queueDef.name, Object.assign({ state, page: request.query.page, pageSize: request.query.pageSize }, filterParams));
|
|
166
|
+
|
|
167
|
+
const states = queueBrowser.STATES.map(stateInfo =>
|
|
168
|
+
Object.assign({}, stateInfo, {
|
|
169
|
+
count: status.counts[stateInfo.name],
|
|
170
|
+
active: stateInfo.name === state,
|
|
171
|
+
url: listUrl(queueDef.name, Object.assign({ state: stateInfo.name }, filterParams))
|
|
172
|
+
})
|
|
173
|
+
);
|
|
174
|
+
|
|
175
|
+
// The one sentence that names the active filter, with the way out of it
|
|
176
|
+
let filterLabel = null;
|
|
177
|
+
if (account) {
|
|
178
|
+
filterLabel = `Entries for account "${account}"`;
|
|
179
|
+
} else if (route) {
|
|
180
|
+
const routed = listing.entries.find(entry => entry.routeName);
|
|
181
|
+
filterLabel = `Deliveries through webhook route "${routed ? routed.routeName : route}"`;
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
return h.view(
|
|
185
|
+
'queues/queue',
|
|
186
|
+
Object.assign(
|
|
187
|
+
{
|
|
188
|
+
pageTitle: `Queues - ${queueDef.label}`,
|
|
189
|
+
menuQueues: true,
|
|
190
|
+
|
|
191
|
+
queue: Object.assign({}, queueDef, status, { concurrency: queueBrowser.concurrencyInfo(queueDef) }),
|
|
192
|
+
states,
|
|
193
|
+
state: queueBrowser.STATES_BY_NAME.get(state),
|
|
194
|
+
listing,
|
|
195
|
+
scanLimit: SCAN_LIMIT,
|
|
196
|
+
retention,
|
|
197
|
+
failedContent: { limits: queueBrowser.failedContentLimits() },
|
|
198
|
+
|
|
199
|
+
filter: Object.assign({ active: listing.filtered, label: filterLabel }, filterParams),
|
|
200
|
+
clearHref: listUrl(queueDef.name, { state }),
|
|
201
|
+
currentUrl
|
|
202
|
+
},
|
|
203
|
+
buildPagingView(listUrl(queueDef.name, Object.assign({ state }, filterParams)), listing, request.query)
|
|
204
|
+
),
|
|
205
|
+
{ layout: 'app' }
|
|
206
|
+
);
|
|
207
|
+
},
|
|
208
|
+
options: {
|
|
209
|
+
validate: {
|
|
210
|
+
options: VALIDATE_OPTIONS,
|
|
211
|
+
failAction: redirectToOverview,
|
|
212
|
+
|
|
213
|
+
params: Joi.object({
|
|
214
|
+
queue: QUEUE_PARAM
|
|
215
|
+
}),
|
|
216
|
+
|
|
217
|
+
query: Joi.object({
|
|
218
|
+
state: Joi.string()
|
|
219
|
+
.valid(...STATE_NAMES)
|
|
220
|
+
.default(DEFAULT_STATE),
|
|
221
|
+
page: Joi.number().integer().min(1).max(1000000).default(1),
|
|
222
|
+
pageSize: Joi.number().integer().min(1).max(250).default(DEFAULT_PAGE_SIZE),
|
|
223
|
+
query: Joi.string().empty('').trim().max(256),
|
|
224
|
+
account: Joi.string().empty('').trim().max(256),
|
|
225
|
+
route: Joi.string().empty('').trim().max(512)
|
|
226
|
+
})
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
});
|
|
230
|
+
|
|
231
|
+
server.route({
|
|
232
|
+
method: 'GET',
|
|
233
|
+
path: '/admin/queues/{queue}/jobs/{jobId}',
|
|
234
|
+
async handler(request, h) {
|
|
235
|
+
const queueDef = queueBrowser.QUEUES_BY_NAME.get(request.params.queue);
|
|
236
|
+
|
|
237
|
+
const found = await queueBrowser.getJob({ queue: queueDef, jobId: request.params.jobId, logger: request.logger });
|
|
238
|
+
if (!found) {
|
|
239
|
+
throw Boom.notFound(`There is no such ${queueDef.noun} in the queue. It may have finished and been removed.`);
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
const { entry, raw } = found;
|
|
243
|
+
|
|
244
|
+
return h.view(
|
|
245
|
+
'queues/job',
|
|
246
|
+
{
|
|
247
|
+
pageTitle: `Queues - ${queueDef.label} - ${entry.title}`,
|
|
248
|
+
menuQueues: true,
|
|
249
|
+
|
|
250
|
+
queue: queueDef,
|
|
251
|
+
entry,
|
|
252
|
+
raw,
|
|
253
|
+
listHref: listUrl(queueDef.name, { state: entry.state }),
|
|
254
|
+
// the actions on this page return to it
|
|
255
|
+
currentUrl: entry.url
|
|
256
|
+
},
|
|
257
|
+
{ layout: 'app' }
|
|
258
|
+
);
|
|
259
|
+
},
|
|
260
|
+
options: {
|
|
261
|
+
validate: {
|
|
262
|
+
options: VALIDATE_OPTIONS,
|
|
263
|
+
failAction: redirectToOverview,
|
|
264
|
+
|
|
265
|
+
params: Joi.object({
|
|
266
|
+
queue: QUEUE_PARAM,
|
|
267
|
+
jobId: JOB_PARAM
|
|
268
|
+
})
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
});
|
|
272
|
+
|
|
273
|
+
for (const paused of [true, false]) {
|
|
274
|
+
server.route(
|
|
275
|
+
actionRoute({
|
|
276
|
+
path: `/admin/queues/{queue}/${paused ? 'pause' : 'resume'}`,
|
|
277
|
+
fallback: `Could not ${paused ? 'pause' : 'resume'} the queue`,
|
|
278
|
+
run: async (queueDef, request) => {
|
|
279
|
+
const isPaused = await queueBrowser.setPaused(queueDef, paused);
|
|
280
|
+
request.logger.info({ msg: isPaused ? 'Queue paused' : 'Queue resumed', queue: queueDef.name, remoteAddress: request.app.ip });
|
|
281
|
+
return {
|
|
282
|
+
type: 'info',
|
|
283
|
+
message: isPaused
|
|
284
|
+
? `${queueDef.title} paused. Workers finish what they are running and take nothing new until it is resumed.`
|
|
285
|
+
: `${queueDef.title} resumed.`
|
|
286
|
+
};
|
|
287
|
+
}
|
|
288
|
+
})
|
|
289
|
+
);
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
server.route(
|
|
293
|
+
actionRoute({
|
|
294
|
+
path: '/admin/queues/{queue}/clean',
|
|
295
|
+
payload: { state: Joi.string().valid('completed', 'failed').required() },
|
|
296
|
+
fallback: 'Could not clean the queue',
|
|
297
|
+
run: async (queueDef, request) => {
|
|
298
|
+
const { state } = request.payload;
|
|
299
|
+
const removed = await queueBrowser.cleanQueue({ queue: queueDef, state, logger: request.logger });
|
|
300
|
+
return {
|
|
301
|
+
type: 'info',
|
|
302
|
+
message: removed
|
|
303
|
+
? `Removed ${removed} ${state} ${removed === 1 ? queueDef.noun : queueDef.nounPlural}.`
|
|
304
|
+
: `There were no ${state} ${queueDef.nounPlural} to remove.`
|
|
305
|
+
};
|
|
306
|
+
}
|
|
307
|
+
})
|
|
308
|
+
);
|
|
309
|
+
|
|
310
|
+
// The per-job actions. A job that is gone by the time the action lands is reported, not
|
|
311
|
+
// treated as an error: the queue moves on its own, and "it finished meanwhile" is the
|
|
312
|
+
// usual reason.
|
|
313
|
+
const JOB_ACTION_DONE = {
|
|
314
|
+
remove: queueDef => `Removed the ${queueDef.noun} from the queue.`,
|
|
315
|
+
retry: queueDef => `The ${queueDef.noun} is queued for a new attempt, with a full set of retries.`,
|
|
316
|
+
promote: queueDef => `The ${queueDef.noun} runs at the next opportunity instead of waiting for its time.`
|
|
317
|
+
};
|
|
318
|
+
|
|
319
|
+
for (const [action, done] of Object.entries(JOB_ACTION_DONE)) {
|
|
320
|
+
server.route(
|
|
321
|
+
actionRoute({
|
|
322
|
+
path: `/admin/queues/{queue}/jobs/{jobId}/${action}`,
|
|
323
|
+
fallback: `Could not ${action} the entry`,
|
|
324
|
+
run: async (queueDef, request) => {
|
|
325
|
+
const { jobId } = request.params;
|
|
326
|
+
// An action posted from the entry's own page can leave no page to return to, so
|
|
327
|
+
// the state is read first: a removal then lands on the list of the state the
|
|
328
|
+
// entry was in. A refused one (a worker holds the entry) keeps the page, where
|
|
329
|
+
// the warning says to try again.
|
|
330
|
+
const fromEntryPage = request.payload.next === queueBrowser.entryUrl(queueDef.name, jobId);
|
|
331
|
+
const toList = fromEntryPage ? { next: listUrl(queueDef.name, { state: await queueBrowser.jobState(queueDef, jobId) }) } : {};
|
|
332
|
+
|
|
333
|
+
const result = await queueBrowser.runJobAction(action, { queue: queueDef, jobId, logger: request.logger });
|
|
334
|
+
if (result && result.locked) {
|
|
335
|
+
return {
|
|
336
|
+
type: 'warning',
|
|
337
|
+
message: `A worker is processing this ${queueDef.noun} right now, so it was not removed. Try again once the attempt is over.`
|
|
338
|
+
};
|
|
339
|
+
}
|
|
340
|
+
if (!result || result.removed === false) {
|
|
341
|
+
return Object.assign({ type: 'warning', message: `This ${queueDef.noun} is no longer in the queue.` }, toList);
|
|
342
|
+
}
|
|
343
|
+
return Object.assign({ type: 'info', message: done(queueDef) }, action === 'remove' ? toList : {});
|
|
344
|
+
}
|
|
345
|
+
})
|
|
346
|
+
);
|
|
347
|
+
}
|
|
348
|
+
|
|
349
|
+
// Compatibility for the retired bull-board page: its own URL and the queue deep links
|
|
350
|
+
// written against it (the docs, the dashboard of older releases, bookmarks) land on the
|
|
351
|
+
// matching page here.
|
|
352
|
+
server.route({
|
|
353
|
+
method: 'GET',
|
|
354
|
+
path: '/admin/bull-board',
|
|
355
|
+
handler(request, h) {
|
|
356
|
+
return h.redirect('/admin/queues');
|
|
357
|
+
}
|
|
358
|
+
});
|
|
359
|
+
|
|
360
|
+
server.route({
|
|
361
|
+
method: 'GET',
|
|
362
|
+
path: '/admin/bull-board/{path*}',
|
|
363
|
+
handler(request, h) {
|
|
364
|
+
const path = decodeURIComponent(request.params.path || '');
|
|
365
|
+
const queueName = QUEUE_NAMES.find(name => path.includes(name));
|
|
366
|
+
return h.redirect(queueName ? `/admin/queues/${queueName}` : '/admin/queues');
|
|
367
|
+
}
|
|
368
|
+
});
|
|
369
|
+
}
|
|
370
|
+
|
|
371
|
+
module.exports = init;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* An error that carries the HTTP status and the machine-readable code a refusal is reported
|
|
5
|
+
* with: the API's handleError() reads both off any thrown error, and the admin routes turn the
|
|
6
|
+
* status into a flash message. One factory so every module refusing an operation shapes it the
|
|
7
|
+
* same way.
|
|
8
|
+
*
|
|
9
|
+
* @param {string} message - Error message
|
|
10
|
+
* @param {string} code - Machine-readable code, e.g. NotFailed
|
|
11
|
+
* @param {number} statusCode - HTTP status to answer with
|
|
12
|
+
* @returns {Error}
|
|
13
|
+
*/
|
|
14
|
+
function statusError(message, code, statusCode) {
|
|
15
|
+
const err = new Error(message);
|
|
16
|
+
err.code = code;
|
|
17
|
+
err.statusCode = statusCode;
|
|
18
|
+
return err;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
module.exports = { statusError };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "emailengine-app",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.84.1",
|
|
4
4
|
"private": false,
|
|
5
5
|
"productTitle": "EmailEngine",
|
|
6
6
|
"description": "Email Sync Engine",
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
"swagger": "./getswagger.sh",
|
|
23
23
|
"build:css": "tailwindcss -i static/css/src/app.tailwind.css -o static/css/flyonui.css --minify",
|
|
24
24
|
"build:icon": "node scripts/build-icon.js",
|
|
25
|
-
"build-source": "rm -rf node_modules && npm install && rm -rf node_modules && npm ci --omit=dev && ./prepare-bundle-deps.sh && ./update-info.sh",
|
|
25
|
+
"build-source": "rm -rf node_modules && npm install && rm -rf node_modules && npm ci --omit=dev --omit=optional && ./prepare-bundle-deps.sh && ./update-info.sh",
|
|
26
26
|
"build-dist": "pkg --compress Brotli package.json && npm install && node winconf.js",
|
|
27
27
|
"build-dist-fast": "pkg --debug package.json && npm install && node winconf.js",
|
|
28
28
|
"licenses": "node list-generate.js",
|
|
@@ -51,8 +51,6 @@
|
|
|
51
51
|
},
|
|
52
52
|
"homepage": "https://emailengine.app/",
|
|
53
53
|
"dependencies": {
|
|
54
|
-
"@bull-board/api": "9.10.4",
|
|
55
|
-
"@bull-board/hapi": "9.10.4",
|
|
56
54
|
"@hapi/accept": "6.0.3",
|
|
57
55
|
"@hapi/bell": "13.2.0",
|
|
58
56
|
"@hapi/boom": "10.0.1",
|
|
@@ -64,19 +62,19 @@
|
|
|
64
62
|
"@msgpack/msgpack": "3.1.3",
|
|
65
63
|
"@postalsys/bounce-classifier": "3.0.1",
|
|
66
64
|
"@postalsys/certs": "1.4.4",
|
|
67
|
-
"@postalsys/email-ai-tools": "2.2.
|
|
68
|
-
"@postalsys/email-content": "0.1.
|
|
69
|
-
"@postalsys/email-text-tools": "2.4.
|
|
65
|
+
"@postalsys/email-ai-tools": "2.2.2",
|
|
66
|
+
"@postalsys/email-content": "0.1.12",
|
|
67
|
+
"@postalsys/email-text-tools": "2.4.19",
|
|
70
68
|
"@postalsys/gettext": "4.1.1",
|
|
71
69
|
"@postalsys/joi-messages": "1.3.1",
|
|
72
70
|
"@postalsys/templates": "2.0.4",
|
|
73
71
|
"@sentry/node-core": "10.76.2",
|
|
74
72
|
"@simplewebauthn/server": "14.0.3",
|
|
75
|
-
"@zone-eu/mailsplit": "5.4.
|
|
76
|
-
"@zone-eu/wild-config": "1.7.
|
|
77
|
-
"bullmq": "6.3.
|
|
73
|
+
"@zone-eu/mailsplit": "5.4.21",
|
|
74
|
+
"@zone-eu/wild-config": "1.7.8",
|
|
75
|
+
"bullmq": "6.3.15",
|
|
78
76
|
"compare-versions": "6.1.1",
|
|
79
|
-
"dotenv": "18.0.
|
|
77
|
+
"dotenv": "18.0.8",
|
|
80
78
|
"encoding-japanese": "2.4.0",
|
|
81
79
|
"exponential-backoff": "3.1.3",
|
|
82
80
|
"fast-xml-parser": "5.11.2",
|
|
@@ -87,27 +85,27 @@
|
|
|
87
85
|
"html-to-text": "10.0.1",
|
|
88
86
|
"ical.js": "2.2.1",
|
|
89
87
|
"iconv-lite": "0.7.3",
|
|
90
|
-
"imapflow": "2.4.
|
|
88
|
+
"imapflow": "2.4.3",
|
|
91
89
|
"ioredfour": "1.4.4",
|
|
92
90
|
"ioredis": "6.0.0",
|
|
93
91
|
"ipaddr.js": "2.5.0",
|
|
94
92
|
"joi": "18.2.9",
|
|
95
|
-
"libbase64": "1.3.
|
|
96
|
-
"libmime": "5.4.
|
|
93
|
+
"libbase64": "1.3.3",
|
|
94
|
+
"libmime": "5.4.8",
|
|
97
95
|
"libqp": "2.1.2",
|
|
98
|
-
"mailparser": "3.9.
|
|
96
|
+
"mailparser": "3.9.39",
|
|
99
97
|
"marked": "15.0.12",
|
|
100
98
|
"minimist": "1.2.8",
|
|
101
99
|
"murmurhash": "2.0.1",
|
|
102
100
|
"nanoid": "3.3.20",
|
|
103
|
-
"nodemailer": "10.1.
|
|
101
|
+
"nodemailer": "10.1.1",
|
|
104
102
|
"pino": "10.3.1",
|
|
105
103
|
"prom-client": "15.1.3",
|
|
106
104
|
"psl": "1.15.0",
|
|
107
105
|
"pubface": "1.1.18",
|
|
108
106
|
"punycode.js": "2.3.1",
|
|
109
107
|
"qrcode-generator": "2.0.4",
|
|
110
|
-
"smtp-server": "3.19.
|
|
108
|
+
"smtp-server": "3.19.22",
|
|
111
109
|
"socks": "2.8.10",
|
|
112
110
|
"timezones-list": "3.1.0",
|
|
113
111
|
"undici": "7.30.0"
|
package/prepare-bundle-deps.sh
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
# of our own files happened to pull the package in - which points at the wrong place
|
|
9
9
|
# entirely. Fixed upstream in neither pkg 6.21 nor 6.22.
|
|
10
10
|
#
|
|
11
|
-
# Run from npm run build-source, after `npm ci --omit=dev` has produced the tree that
|
|
11
|
+
# Run from npm run build-source, after `npm ci --omit=dev --omit=optional` has produced the tree that
|
|
12
12
|
# actually gets bundled.
|
|
13
13
|
|
|
14
14
|
set -e
|