Added CSV export of subscribers
Fixed some bugs in subscriptions Updated some packages to avoid warnings about vulnerabilities Completed RSS feed campaigns
This commit is contained in:
parent
8683f8c91e
commit
bf69e633c4
47 changed files with 5255 additions and 9651 deletions
|
@ -19,6 +19,10 @@ router.postAsync('/campaigns-others-by-list-table/:campaignId/:listIds', passpor
|
|||
return res.json(await campaigns.listOthersWhoseListsAreIncludedDTAjax(req.context, castToInteger(req.params.campaignId), req.params.listIds.split(';').map(x => castToInteger(x)), req.body));
|
||||
});
|
||||
|
||||
router.postAsync('/campaigns-children/:campaignId', passport.loggedIn, async (req, res) => {
|
||||
return res.json(await campaigns.listChildrenDTAjax(req.context, castToInteger(req.params.campaignId), req.body));
|
||||
});
|
||||
|
||||
router.postAsync('/campaigns-test-users-table/:campaignId', passport.loggedIn, async (req, res) => {
|
||||
return res.json(await campaigns.listTestUsersDTAjax(req.context, castToInteger(req.params.campaignId), req.body));
|
||||
});
|
||||
|
@ -82,4 +86,13 @@ router.postAsync('/campaign-reset/:campaignId', passport.loggedIn, passport.csrf
|
|||
return res.json(await campaigns.reset(req.context, castToInteger(req.params.campaignId)));
|
||||
});
|
||||
|
||||
router.postAsync('/campaign-enable/:campaignId', passport.loggedIn, passport.csrfProtection, async (req, res) => {
|
||||
return res.json(await campaigns.enable(req.context, castToInteger(req.params.campaignId), null));
|
||||
});
|
||||
|
||||
router.postAsync('/campaign-disable/:campaignId', passport.loggedIn, passport.csrfProtection, async (req, res) => {
|
||||
return res.json(await campaigns.disable(req.context, castToInteger(req.params.campaignId), null));
|
||||
});
|
||||
|
||||
|
||||
module.exports = router;
|
|
@ -10,7 +10,7 @@ const contextHelpers = require('../../lib/context-helpers');
|
|||
|
||||
const router = require('../../lib/router-async').create();
|
||||
const {castToInteger} = require('../../lib/helpers');
|
||||
|
||||
const fs = require('fs-extra');
|
||||
|
||||
router.getAsync('/reports/:reportId', passport.loggedIn, async (req, res) => {
|
||||
const report = await reports.getByIdWithTemplate(req.context, castToInteger(req.params.reportId));
|
||||
|
@ -44,7 +44,7 @@ router.postAsync('/report-start/:id', passport.loggedIn, passport.csrfProtection
|
|||
|
||||
await shares.enforceEntityPermission(req.context, 'report', id, 'execute');
|
||||
|
||||
const report = await reports.getByIdWithTemplate(contextHelpers.getAdminContext(), id);
|
||||
const report = await reports.getByIdWithTemplate(contextHelpers.getAdminContext(), id, false);
|
||||
await shares.enforceEntityPermission(req.context, 'reportTemplate', report.report_template, 'execute');
|
||||
|
||||
await reportProcessor.start(id);
|
||||
|
@ -56,7 +56,7 @@ router.postAsync('/report-stop/:id', async (req, res) => {
|
|||
|
||||
await shares.enforceEntityPermission(req.context, 'report', id, 'execute');
|
||||
|
||||
const report = await reports.getByIdWithTemplate(contextHelpers.getAdminContext(), id);
|
||||
const report = await reports.getByIdWithTemplate(contextHelpers.getAdminContext(), id, false);
|
||||
await shares.enforceEntityPermission(req.context, 'reportTemplate', report.report_template, 'execute');
|
||||
|
||||
await reportProcessor.stop(id);
|
||||
|
@ -68,8 +68,14 @@ router.getAsync('/report-content/:id', async (req, res) => {
|
|||
|
||||
await shares.enforceEntityPermission(req.context, 'report', id, 'viewContent');
|
||||
|
||||
const report = await reports.getByIdWithTemplate(contextHelpers.getAdminContext(), id);
|
||||
res.sendFile(reportHelpers.getReportContentFile(report));
|
||||
const report = await reports.getByIdWithTemplate(contextHelpers.getAdminContext(), id, false);
|
||||
const file = reportHelpers.getReportContentFile(report);
|
||||
|
||||
if (await fs.pathExists(file)) {
|
||||
res.sendFile(file);
|
||||
} else {
|
||||
res.send('');
|
||||
}
|
||||
});
|
||||
|
||||
router.getAsync('/report-output/:id', async (req, res) => {
|
||||
|
@ -77,8 +83,14 @@ router.getAsync('/report-output/:id', async (req, res) => {
|
|||
|
||||
await shares.enforceEntityPermission(req.context, 'report', id, 'viewOutput');
|
||||
|
||||
const report = await reports.getByIdWithTemplate(contextHelpers.getAdminContext(), id);
|
||||
res.sendFile(reportHelpers.getReportOutputFile(report));
|
||||
const report = await reports.getByIdWithTemplate(contextHelpers.getAdminContext(), id, false);
|
||||
const file = reportHelpers.getReportOutputFile(report);
|
||||
|
||||
if (await fs.pathExists(file)) {
|
||||
res.sendFile(file);
|
||||
} else {
|
||||
res.send('');
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue