feat(notifications): migrated all from v1

This commit is contained in:
2025-04-01 16:18:48 -05:00
parent 0d06dae6de
commit 5c642805b1
24 changed files with 12381 additions and 8999 deletions

View File

@@ -0,0 +1,29 @@
// an external way to creating logs
import { createRoute, OpenAPIHono, z } from "@hono/zod-openapi";
import { responses } from "../../../globalUtils/routeDefs/responses.js";
import { getAllJobs } from "../utils/processNotifications.js";
const app = new OpenAPIHono({ strict: false });
app.openapi(
createRoute({
tags: ["server"],
summary: "Returns current active notifications.",
method: "get",
path: "/activenotifications",
//middleware: authMiddleware,
responses: responses(),
}),
async (c) => {
const jobs = getAllJobs();
return c.json({
success: true,
message:
jobs.length === 0
? "There are no active Notifications Currently."
: "Current Active notifications",
data: jobs,
});
}
);
export default app;

View File

@@ -0,0 +1,22 @@
// import {Router} from "express";
// import {tiExportRunning, runTiImport} from "../../notification/notification/tiFullFlow/tiImports.js";
// const router = Router();
// router.get("/tiTrigger", async (req, res): Promise<void> => {
// if (tiExportRunning) {
// res.status(200).json({
// success: false,
// message: "There is already a current sesion of the Export running please try again later.",
// });
// }
// // trigger the import
// runTiImport();
// res.status(200).json({
// success: true,
// message: "The Ti Export has been manually started and will continue to run in the background.",
// });
// });
// export default router;