Tonne of debugging - getting ready for the production builds
This commit is contained in:
3
api/dist/modules/influence/email-queue/email-queue.routes.d.ts
vendored
Normal file
3
api/dist/modules/influence/email-queue/email-queue.routes.d.ts
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
declare const router: import("express-serve-static-core").Router;
|
||||
export { router as emailQueueRouter };
|
||||
//# sourceMappingURL=email-queue.routes.d.ts.map
|
||||
1
api/dist/modules/influence/email-queue/email-queue.routes.d.ts.map
vendored
Normal file
1
api/dist/modules/influence/email-queue/email-queue.routes.d.ts.map
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"email-queue.routes.d.ts","sourceRoot":"","sources":["../../../../src/modules/influence/email-queue/email-queue.routes.ts"],"names":[],"mappings":"AAQA,QAAA,MAAM,MAAM,4CAAW,CAAC;AAwDxB,OAAO,EAAE,MAAM,IAAI,gBAAgB,EAAE,CAAC"}
|
||||
54
api/dist/modules/influence/email-queue/email-queue.routes.js
vendored
Normal file
54
api/dist/modules/influence/email-queue/email-queue.routes.js
vendored
Normal file
@@ -0,0 +1,54 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.emailQueueRouter = void 0;
|
||||
const express_1 = require("express");
|
||||
const client_1 = require("@prisma/client");
|
||||
const auth_middleware_1 = require("../../../middleware/auth.middleware");
|
||||
const rbac_middleware_1 = require("../../../middleware/rbac.middleware");
|
||||
const email_queue_service_1 = require("../../../services/email-queue.service");
|
||||
const ADMIN_ROLES = [client_1.UserRole.SUPER_ADMIN, client_1.UserRole.INFLUENCE_ADMIN, client_1.UserRole.MAP_ADMIN];
|
||||
const router = (0, express_1.Router)();
|
||||
exports.emailQueueRouter = router;
|
||||
router.use(auth_middleware_1.authenticate);
|
||||
router.use((0, rbac_middleware_1.requireRole)(...ADMIN_ROLES));
|
||||
// GET /api/email-queue/stats
|
||||
router.get('/stats', async (_req, res, next) => {
|
||||
try {
|
||||
const stats = await email_queue_service_1.emailQueueService.getStats();
|
||||
res.json(stats);
|
||||
}
|
||||
catch (err) {
|
||||
next(err);
|
||||
}
|
||||
});
|
||||
// POST /api/email-queue/pause
|
||||
router.post('/pause', async (_req, res, next) => {
|
||||
try {
|
||||
await email_queue_service_1.emailQueueService.pause();
|
||||
res.json({ message: 'Queue paused' });
|
||||
}
|
||||
catch (err) {
|
||||
next(err);
|
||||
}
|
||||
});
|
||||
// POST /api/email-queue/resume
|
||||
router.post('/resume', async (_req, res, next) => {
|
||||
try {
|
||||
await email_queue_service_1.emailQueueService.resume();
|
||||
res.json({ message: 'Queue resumed' });
|
||||
}
|
||||
catch (err) {
|
||||
next(err);
|
||||
}
|
||||
});
|
||||
// POST /api/email-queue/clean
|
||||
router.post('/clean', async (_req, res, next) => {
|
||||
try {
|
||||
const cleaned = await email_queue_service_1.emailQueueService.clean();
|
||||
res.json({ message: `Cleaned ${cleaned} completed jobs`, cleaned });
|
||||
}
|
||||
catch (err) {
|
||||
next(err);
|
||||
}
|
||||
});
|
||||
//# sourceMappingURL=email-queue.routes.js.map
|
||||
1
api/dist/modules/influence/email-queue/email-queue.routes.js.map
vendored
Normal file
1
api/dist/modules/influence/email-queue/email-queue.routes.js.map
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"email-queue.routes.js","sourceRoot":"","sources":["../../../../src/modules/influence/email-queue/email-queue.routes.ts"],"names":[],"mappings":";;;AAAA,qCAAkE;AAClE,2CAA0C;AAC1C,yEAAmE;AACnE,yEAAkE;AAClE,+EAA0E;AAE1E,MAAM,WAAW,GAAe,CAAC,iBAAQ,CAAC,WAAW,EAAE,iBAAQ,CAAC,eAAe,EAAE,iBAAQ,CAAC,SAAS,CAAC,CAAC;AAErG,MAAM,MAAM,GAAG,IAAA,gBAAM,GAAE,CAAC;AAwDL,kCAAgB;AAvDnC,MAAM,CAAC,GAAG,CAAC,8BAAY,CAAC,CAAC;AACzB,MAAM,CAAC,GAAG,CAAC,IAAA,6BAAW,EAAC,GAAG,WAAW,CAAC,CAA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