From 36e5a60c14e87aceacf079e5b5925cf55d0199ab Mon Sep 17 00:00:00 2001 From: Leandro Menezes Date: Fri, 1 Mar 2024 15:18:52 -0300 Subject: [PATCH 1/5] cuz damn javascript --- src/.dockerignore | 7 + src/Dockerfile | 14 +- src/app.ts | 29 ++ src/build/app.js | 28 ++ src/build/controllers/ConfirmController.js | 34 ++ src/build/controllers/CssController.js | 51 +++ src/build/helpers/ConfigReader.js | 28 ++ src/build/index.js | 6 + src/{ => build}/models/ConfirmModel.js | 13 +- src/build/public/scripts/actions.js | 89 +++++ src/build/router.js | 11 + src/config.yml | 2 + src/controllers/ConfirmController.ts | 30 ++ src/controllers/CssController.ts | 55 +++ src/helpers/ConfigReader.ts | 32 ++ src/index.js | 105 ------ src/index.ts | 10 + src/models/ConfirmModel.ts | 20 ++ src/nodemon.json | 6 + src/package-lock.json | 375 ++++++++++++++++++++- src/package.json | 14 +- src/router.ts | 12 + src/tsconfig.json | 14 + 23 files changed, 861 insertions(+), 124 deletions(-) create mode 100644 src/.dockerignore create mode 100644 src/app.ts create mode 100644 src/build/app.js create mode 100644 src/build/controllers/ConfirmController.js create mode 100644 src/build/controllers/CssController.js create mode 100644 src/build/helpers/ConfigReader.js create mode 100644 src/build/index.js rename src/{ => build}/models/ConfirmModel.js (71%) create mode 100644 src/build/public/scripts/actions.js create mode 100644 src/build/router.js create mode 100644 src/controllers/ConfirmController.ts create mode 100644 src/controllers/CssController.ts create mode 100644 src/helpers/ConfigReader.ts delete mode 100644 src/index.js create mode 100644 src/index.ts create mode 100644 src/models/ConfirmModel.ts create mode 100644 src/nodemon.json create mode 100644 src/router.ts create mode 100644 src/tsconfig.json diff --git a/src/.dockerignore b/src/.dockerignore new file mode 100644 index 0000000..58a3de1 --- /dev/null +++ b/src/.dockerignore @@ -0,0 +1,7 @@ +dist +node_modules +README.md +docker-compose.yml +config.yml +views/**/ +views \ No newline at end of file diff --git a/src/Dockerfile b/src/Dockerfile index 1cb9397..88635c5 100644 --- a/src/Dockerfile +++ b/src/Dockerfile @@ -1,9 +1,17 @@ -FROM node:slim +FROM node:slim as builder +WORKDIR /app +COPY package.json ./ +COPY tsconfig.json ./ +COPY src ./src +RUN npm install +RUN npm run build +FROM node:slim as final WORKDIR /app -COPY . . -RUN npm install +COPY package.json ./ +RUN npm install --only=production +COPY --from=builder /app/build . CMD [ "node", "index.js" ] diff --git a/src/app.ts b/src/app.ts new file mode 100644 index 0000000..8802553 --- /dev/null +++ b/src/app.ts @@ -0,0 +1,29 @@ +import express from "express"; +import { router } from "./router"; +import mustacheExpress from "mustache-express"; +import favicon from 'serve-favicon'; + +export class App{ + public server: express.Application; + + constructor(){ + this.server = express(); + this.middleware(); + this.mustache(); + this.router(); + this.server.use(express.static('public')) + this.server.use(favicon(__dirname + '/public/images/favicon.ico')); + } + + private middleware(){ + this.server.use(express.json()); + } + + private mustache() { + this.server.engine("mustache", mustacheExpress()); + } + + private router(){ + this.server.use(router); + } +} \ No newline at end of file diff --git a/src/build/app.js b/src/build/app.js new file mode 100644 index 0000000..096c431 --- /dev/null +++ b/src/build/app.js @@ -0,0 +1,28 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.App = void 0; +var express_1 = __importDefault(require("express")); +var router_1 = require("./router"); +var mustache_express_1 = __importDefault(require("mustache-express")); +var App = /** @class */ (function () { + function App() { + this.server = (0, express_1.default)(); + this.middleware(); + this.mustache(); + this.router(); + } + App.prototype.middleware = function () { + this.server.use(express_1.default.json()); + }; + App.prototype.mustache = function () { + this.server.engine("mustache", (0, mustache_express_1.default)()); + }; + App.prototype.router = function () { + this.server.use(router_1.router); + }; + return App; +}()); +exports.App = App; diff --git a/src/build/controllers/ConfirmController.js b/src/build/controllers/ConfirmController.js new file mode 100644 index 0000000..1799b60 --- /dev/null +++ b/src/build/controllers/ConfirmController.js @@ -0,0 +1,34 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.confirmController = void 0; +var ConfigReader_1 = require("../helpers/ConfigReader"); +var url_1 = __importDefault(require("url")); +var mustache_1 = __importDefault(require("mustache")); +var ConfirmController = /** @class */ (function () { + function ConfirmController() { + } + ConfirmController.prototype.alias = function (req, res) { + var doc = ConfigReader_1.configReader.getDoc(); + var alias = doc.pages[req.params.alias]; + if (alias == undefined) { + res.status(404); + res.send('404 - Not found'); + return; + } + var url_parts = url_1.default.parse(req.url, false); + return res.render('confirm.mustache', { + link: alias, + query: url_parts.query, + yes: doc.strings.yes, + no: doc.strings.no, + title: mustache_1.default.render(doc.strings.window_title, { link: alias }), + open_link: mustache_1.default.render(doc.strings.open_link, { link: alias }), + theme: doc.config.theme + }); + }; + return ConfirmController; +}()); +exports.confirmController = new ConfirmController(); diff --git a/src/build/controllers/CssController.js b/src/build/controllers/CssController.js new file mode 100644 index 0000000..0ca48e2 --- /dev/null +++ b/src/build/controllers/CssController.js @@ -0,0 +1,51 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.cssController = void 0; +var ConfigReader_1 = require("../helpers/ConfigReader"); +var ConfirmModel_1 = require("../models/ConfirmModel"); +var CssController = /** @class */ (function () { + function CssController() { + } + CssController.prototype.variables = function (req, res) { + var doc = ConfigReader_1.configReader.getDoc(); + var confirmModel = new ConfirmModel_1.ConfirmModel(); + confirmModel.direction = doc.config.direction; + confirmModel.directionMobile = confirmModel.direction; + if (doc.config.theme != 'default') { + confirmModel.customThemeNo = doc.themes[doc.config.theme].default.no; + confirmModel.customThemeYes = doc.themes[doc.config.theme].default.yes; + confirmModel.customThemeActiveNo = doc.themes[doc.config.theme].active.no; + confirmModel.customThemeActiveYes = doc.themes[doc.config.theme].active.yes; + } + if (doc.config.direction == 'column') { + confirmModel.sizeW = '100'; + confirmModel.sizeH = '50'; + confirmModel.expandedH = '90'; + confirmModel.expandedW = '100'; + confirmModel.contractedH = '10'; + confirmModel.contractedW = '100'; + confirmModel.sizeWMobile = '100'; + confirmModel.sizeHMobile = '50'; + confirmModel.expandedHMobile = '90'; + confirmModel.expandedWMobile = '100'; + confirmModel.contractedHMobile = '10'; + confirmModel.contractedWMobile = '100'; + } + else if (doc.config.direction == 'dynamic') { + confirmModel.directionMobile = 'column'; + confirmModel.direction = 'row'; + confirmModel.sizeWMobile = '100'; + confirmModel.sizeHMobile = '50'; + confirmModel.expandedHMobile = '90'; + confirmModel.expandedWMobile = '100'; + confirmModel.contractedHMobile = '10'; + confirmModel.contractedWMobile = '100'; + } + return res.render('variables.mustache', { + doc: doc, + confirmModel: confirmModel + }); + }; + return CssController; +}()); +exports.cssController = new CssController(); diff --git a/src/build/helpers/ConfigReader.js b/src/build/helpers/ConfigReader.js new file mode 100644 index 0000000..32f6659 --- /dev/null +++ b/src/build/helpers/ConfigReader.js @@ -0,0 +1,28 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.configReader = void 0; +var yaml = require('js-yaml'); +var fs = require('fs'); +var ConfigReader = /** @class */ (function () { + function ConfigReader() { + this.lastReadTime = 0; + } + ConfigReader.prototype.readYmlFile = function () { + if (this.doc == null || this.lastReadTime == 0 || (new Date().getTime() - this.lastReadTime) > 1000) { + try { + this.doc = yaml.load(fs.readFileSync('./config.yml', 'utf8')); + return this.doc; + } + catch (e) { + console.log(e); + } + return {}; + } + }; + ConfigReader.prototype.getDoc = function () { + this.readYmlFile(); + return this.doc; + }; + return ConfigReader; +}()); +exports.configReader = new ConfigReader(); diff --git a/src/build/index.js b/src/build/index.js new file mode 100644 index 0000000..f270b4a --- /dev/null +++ b/src/build/index.js @@ -0,0 +1,6 @@ +"use strict"; +var App = require("./app").App; +new App().server.listen(3000); +// const favicon = require('serve-favicon'); +// app.use(express.static('public')) +// app.use(favicon(__dirname + '/public/images/favicon.ico')); diff --git a/src/models/ConfirmModel.js b/src/build/models/ConfirmModel.js similarity index 71% rename from src/models/ConfirmModel.js rename to src/build/models/ConfirmModel.js index 5cad426..be227c1 100644 --- a/src/models/ConfirmModel.js +++ b/src/build/models/ConfirmModel.js @@ -1,5 +1,8 @@ -class ConfirmModel { - constructor() { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ConfirmModel = void 0; +var ConfirmModel = /** @class */ (function () { + function ConfirmModel() { this.sizeW = '50'; this.sizeH = '100'; this.expandedW = '90'; @@ -19,6 +22,6 @@ class ConfirmModel { this.customThemeActiveYes = ''; this.customThemeActiveNo = ''; } -} - -module.exports = { ConfirmModel } \ No newline at end of file + return ConfirmModel; +}()); +exports.ConfirmModel = ConfirmModel; diff --git a/src/build/public/scripts/actions.js b/src/build/public/scripts/actions.js new file mode 100644 index 0000000..60a1292 --- /dev/null +++ b/src/build/public/scripts/actions.js @@ -0,0 +1,89 @@ +"use strict"; +function clicked(url) { + window.location = url; +} +function noClicked() { + if (document.body.classList.contains('dark')) { + window.location = 'https://blackscreen.app/'; + } + else { + window.location = 'about:blank'; + } +} +var yesDiv = document.getElementById('yesdiv'); +var noDiv = document.getElementById('nodiv'); +var lightToogle = document.getElementById('light-toogle'); +lightToogle.addEventListener("click", function () { + if (document.body.classList.contains('dark')) { + document.body.classList.remove('dark'); + document.body.classList.add('light'); + } + else if (document.body.classList.contains('light')) { + document.body.classList.remove('light'); + document.body.classList.add('dark'); + } + if (!document.body.classList.contains('forced')) { + document.body.classList.add('forced'); + } +}); +function registerEffect(ele, other, f) { + var mc = new Hammer(ele); + mc.on("hammer.input", function (ev) { + if (ev.eventType == 1) { + ele.classList.add('expanded'); + other.classList.add('contracted'); + } + else if (ev.deltaTime > 2000 && ev.eventType == 2) { + if (ev.pointers[0].clientX >= ele.getBoundingClientRect().left && ev.pointers[0].clientX <= ele.getBoundingClientRect().right && + ev.pointers[0].clientY >= ele.getBoundingClientRect().top && ev.pointers[0].clientY <= ele.getBoundingClientRect().bottom) { + mc.off("hammer.input"); + f(ele.getAttribute('data-url')); + } + } + else if (ev.eventType == 4) { + ele.classList.remove('expanded'); + other.classList.remove('contracted'); + if (ev.deltaTime > 2000 && + ev.pointers[0].clientX >= ele.getBoundingClientRect().left && ev.pointers[0].clientX <= ele.getBoundingClientRect().right && + ev.pointers[0].clientY >= ele.getBoundingClientRect().top && ev.pointers[0].clientY <= ele.getBoundingClientRect().bottom) { + f(ele.getAttribute('data-url')); + } + } + }); + mc.on("press", function (ev) { + }); +} +registerEffect(yesDiv, noDiv, clicked); +registerEffect(noDiv, yesDiv, noClicked); +if (window.screen.height > window.screen.width) { + document.body.classList.add('mobile'); +} +window.addEventListener('resize', function (event) { + if (document.body.scrollHeight < document.body.scrollWidth) { + document.body.classList.remove('mobile'); + } + else if (!document.body.classList.contains('mobile')) { + document.body.classList.add('mobile'); + } +}, true); +if (document.body.classList.contains('default')) { + if (window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches) { + document.body.classList.add('dark'); + } + else { + document.body.classList.add('light'); + } +} +window.matchMedia('(prefers-color-scheme: dark)').addEventListener('change', function (event) { + if (document.body.classList.contains('forced') || !document.body.classList.contains('default')) { + return; + } + var newColorScheme = event.matches ? "dark" : "light"; + if (!document.body.classList.contains('dark')) { + document.body.classList.add('dark'); + } + if (!document.body.classList.contains('light')) { + document.body.classList.add('light'); + } + document.body.classList.add(newColorScheme); +}); diff --git a/src/build/router.js b/src/build/router.js new file mode 100644 index 0000000..74b65b2 --- /dev/null +++ b/src/build/router.js @@ -0,0 +1,11 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.router = void 0; +var express_1 = require("express"); +var CssController_1 = require("./controllers/CssController"); +var ConfirmController_1 = require("./controllers/ConfirmController"); +var router = (0, express_1.Router)(); +exports.router = router; +//Routes +router.get("/css/variables.css", CssController_1.cssController.variables); +router.get("/:alias", ConfirmController_1.confirmController.alias); diff --git a/src/config.yml b/src/config.yml index 1a838c2..cfc02fc 100644 --- a/src/config.yml +++ b/src/config.yml @@ -1,5 +1,6 @@ pages: google: http://www.google.com.br +mode: auth # themes: light: default: @@ -25,6 +26,7 @@ themes: config: direction: dynamic theme: default + port: 8000 # theme: dracula strings: yes: SIM diff --git a/src/controllers/ConfirmController.ts b/src/controllers/ConfirmController.ts new file mode 100644 index 0000000..99eb11b --- /dev/null +++ b/src/controllers/ConfirmController.ts @@ -0,0 +1,30 @@ +import { Request, Response } from "express"; +import { configReader } from "../helpers/ConfigReader"; +import url from 'url'; +import Mustache from 'mustache'; + +class ConfirmController { + + public alias(req:Request, res:Response) { + let doc = configReader.getDoc(); + + var alias = doc.pages[req.params.alias]; + if(alias == undefined) { + res.status(404); + res.send('404 - Not found'); + return; + } + var url_parts = url.parse(req.url, false); + return res.render('confirm.mustache', { + link: alias, + query: url_parts.query, + yes: doc.strings.yes, + no: doc.strings.no, + title: Mustache.render(doc.strings.window_title, {link: alias}), + open_link: Mustache.render(doc.strings.open_link, {link: alias}), + theme: doc.config.theme + }) + } +} + +export const confirmController = new ConfirmController(); \ No newline at end of file diff --git a/src/controllers/CssController.ts b/src/controllers/CssController.ts new file mode 100644 index 0000000..8de0ca7 --- /dev/null +++ b/src/controllers/CssController.ts @@ -0,0 +1,55 @@ +import { Request, Response } from "express"; +import { configReader } from "../helpers/ConfigReader"; +import { ConfirmModel } from "../models/ConfirmModel"; + +class CssController { + + public variables(req:Request, res:Response) { + let doc = configReader.getDoc(); + + const confirmModel = new ConfirmModel(); + + confirmModel.direction = doc.config.direction; + confirmModel.directionMobile = confirmModel.direction; + + if(doc.config.theme != 'default') { + confirmModel.customThemeNo = doc.themes[doc.config.theme].default.no; + confirmModel.customThemeYes = doc.themes[doc.config.theme].default.yes; + confirmModel.customThemeActiveNo = doc.themes[doc.config.theme].active.no; + confirmModel.customThemeActiveYes = doc.themes[doc.config.theme].active.yes; + } + + if(doc.config.direction == 'column') { + confirmModel.sizeW = '100'; + confirmModel.sizeH = '50'; + confirmModel.expandedH = '90'; + confirmModel.expandedW = '100'; + confirmModel.contractedH = '10'; + confirmModel.contractedW = '100'; + confirmModel.sizeWMobile = '100'; + confirmModel.sizeHMobile = '50'; + confirmModel.expandedHMobile = '90'; + confirmModel.expandedWMobile = '100'; + confirmModel.contractedHMobile = '10'; + confirmModel.contractedWMobile = '100'; + } + else if(doc.config.direction == 'dynamic') { + confirmModel.directionMobile = 'column'; + confirmModel.direction = 'row'; + + confirmModel.sizeWMobile = '100'; + confirmModel.sizeHMobile = '50'; + confirmModel.expandedHMobile = '90'; + confirmModel.expandedWMobile = '100'; + confirmModel.contractedHMobile = '10'; + confirmModel.contractedWMobile = '100'; + } + + return res.render('variables.mustache', { + doc, + confirmModel + }); + } +} + +export const cssController = new CssController(); \ No newline at end of file diff --git a/src/helpers/ConfigReader.ts b/src/helpers/ConfigReader.ts new file mode 100644 index 0000000..ec91ca8 --- /dev/null +++ b/src/helpers/ConfigReader.ts @@ -0,0 +1,32 @@ +const yaml = require('js-yaml'); +const fs = require('fs'); + +class ConfigReader { + private doc: any; + private lastReadTime: number; + + constructor() { + this.lastReadTime = 0; + } + + readYmlFile() { + if(this.doc == null || this.lastReadTime == 0 || (new Date().getTime() - this.lastReadTime) > 1000) + { + try { + this.doc = yaml.load(fs.readFileSync('./config.yml', 'utf8')); + return this.doc; + } catch (e) { + console.log(e); + } + + return {}; + } + } + + getDoc() { + this.readYmlFile(); + return this.doc; + } +} + +export const configReader = new ConfigReader(); \ No newline at end of file diff --git a/src/index.js b/src/index.js deleted file mode 100644 index 4db8bc1..0000000 --- a/src/index.js +++ /dev/null @@ -1,105 +0,0 @@ -const express = require('express'); -const mustacheExpress = require('mustache-express'); -const yaml = require('js-yaml'); -const fs = require('fs'); -const url = require('url'); -const app = express(); -const Mustache = require('mustache'); -const favicon = require('serve-favicon'); -const { ConfirmModel } = require('./models/ConfirmModel'); - -app.use(express.static('public')) -app.use(favicon(__dirname + '/public/images/favicon.ico')); -app.engine('mustache', mustacheExpress()); - -var lastReadTime = 0; -var doc = null; - -const port = 8000; -app.listen(port, () => { - console.log('Listening on port ' + port); -}); - -app.get('/css/variables.css', (req, res) => { - readYmlFile(); - - const confirmModel = new ConfirmModel(); - - confirmModel.direction = doc.config.direction; - confirmModel.directionMobile = confirmModel.direction; - - if(doc.config.theme != 'default') { - confirmModel.customThemeNo = doc.themes[doc.config.theme].default.no; - confirmModel.customThemeYes = doc.themes[doc.config.theme].default.yes; - confirmModel.customThemeActiveNo = doc.themes[doc.config.theme].active.no; - confirmModel.customThemeActiveYes = doc.themes[doc.config.theme].active.yes; - } - - if(doc.config.direction == 'column') { - confirmModel.sizeW = '100'; - confirmModel.sizeH = '50'; - confirmModel.expandedH = '90'; - confirmModel.expandedW = '100'; - confirmModel.contractedH = '10'; - confirmModel.contractedW = '100'; - confirmModel.sizeWMobile = '100'; - confirmModel.sizeHMobile = '50'; - confirmModel.expandedHMobile = '90'; - confirmModel.expandedWMobile = '100'; - confirmModel.contractedHMobile = '10'; - confirmModel.contractedWMobile = '100'; - } - else if(doc.config.direction == 'dynamic') { - confirmModel.directionMobile = 'column'; - confirmModel.direction = 'row'; - - confirmModel.sizeWMobile = '100'; - confirmModel.sizeHMobile = '50'; - confirmModel.expandedHMobile = '90'; - confirmModel.expandedWMobile = '100'; - confirmModel.contractedHMobile = '10'; - confirmModel.contractedWMobile = '100'; - } - - return res.render('variables.mustache', { - doc, - confirmModel - }) -}); - -app.get('/:alias', (req, res) => { - readYmlFile(); - var alias = doc.pages[req.params.alias]; - - if(alias == undefined) { - res.status(404); - res.send('404 - Not found'); - return; - } - - var url_parts = url.parse(req.url, false); - - return res.render('confirm.mustache', { - link: alias, - query: url_parts.query, - yes: doc.strings.yes, - no: doc.strings.no, - title: Mustache.render(doc.strings.window_title, {link: alias}), - open_link: Mustache.render(doc.strings.open_link, {link: alias}), - theme: doc.config.theme - }) -}); - -function readYmlFile() { - if(doc == null || lastReadTime == 0 || (new Date() - lastReadTime) > 1000) - { - try { - doc = yaml.load(fs.readFileSync('./config.yml', 'utf8')); - return doc; - } catch (e) { - console.log(e); - } - - return {}; - } -} \ No newline at end of file diff --git a/src/index.ts b/src/index.ts new file mode 100644 index 0000000..4332376 --- /dev/null +++ b/src/index.ts @@ -0,0 +1,10 @@ +import { configReader } from "./helpers/ConfigReader"; + +const { App } = require("./app"); + +const doc = configReader.getDoc(); +new App().server.listen(doc.config.port); + +// const favicon = require('serve-favicon'); +// app.use(express.static('public')) +// app.use(favicon(__dirname + '/public/images/favicon.ico')); diff --git a/src/models/ConfirmModel.ts b/src/models/ConfirmModel.ts new file mode 100644 index 0000000..9215ab5 --- /dev/null +++ b/src/models/ConfirmModel.ts @@ -0,0 +1,20 @@ +export class ConfirmModel { + public sizeW: String = '50'; + public sizeH: String = '100'; + public expandedW: String = '90'; + public expandedH: String = '100'; + public contractedW: String = '10'; + public contractedH: String = '100'; + public directionMobile: String = ''; + public direction: String = ''; + public sizeWMobile: String = '50'; + public sizeHMobile: String = '100'; + public expandedWMobile: String = '90'; + public expandedHMobile: String = '100'; + public contractedWMobile: String = '10'; + public contractedHMobile: String = '100'; + public customThemeYes: String = ''; + public customThemeNo: String = ''; + public customThemeActiveYes: String = ''; + public customThemeActiveNo: String = ''; +} \ No newline at end of file diff --git a/src/nodemon.json b/src/nodemon.json new file mode 100644 index 0000000..576a814 --- /dev/null +++ b/src/nodemon.json @@ -0,0 +1,6 @@ +{ + "watch": ["./"], + "ext": ".ts,.js", + "ignore": [], + "exec": "ts-node index.ts" + } \ No newline at end of file diff --git a/src/package-lock.json b/src/package-lock.json index 9721ebf..fa5d126 100644 --- a/src/package-lock.json +++ b/src/package-lock.json @@ -11,15 +11,213 @@ "dependencies": { "express": "^4.18.2", "js-yaml": "^4.1.0", + "mustache": "^4.2.0", "mustache-express": "^1.3.2", - "nodemon": "^3.1.0", "serve-favicon": "^2.5.0" + }, + "devDependencies": { + "@types/express": "^4.17.21", + "@types/mustache": "^4.2.5", + "@types/mustache-express": "^1.2.5", + "@types/node": "^20.11.24", + "@types/serve-favicon": "^2.5.7", + "nodemon": "^3.1.0", + "ts-node": "^10.9.2" + } + }, + "node_modules/@cspotcode/source-map-support": { + "version": "0.8.1", + "resolved": "https://registry.npmjs.org/@cspotcode/source-map-support/-/source-map-support-0.8.1.tgz", + "integrity": "sha512-IchNf6dN4tHoMFIn/7OE8LWZ19Y6q/67Bmf6vnGREv8RSbBVb9LPJxEcnwrcwX6ixSvaiGoomAUvu4YSxXrVgw==", + "dev": true, + "dependencies": { + "@jridgewell/trace-mapping": "0.3.9" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/@jridgewell/resolve-uri": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.2.tgz", + "integrity": "sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==", + "dev": true, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@jridgewell/sourcemap-codec": { + "version": "1.4.15", + "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.15.tgz", + "integrity": "sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg==", + "dev": true + }, + "node_modules/@jridgewell/trace-mapping": { + "version": "0.3.9", + "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.9.tgz", + "integrity": "sha512-3Belt6tdc8bPgAtbcmdtNJlirVoTmEb5e2gC94PnkwEW9jI6CAHUeoG85tjWP5WquqfavoMtMwiG4P926ZKKuQ==", + "dev": true, + "dependencies": { + "@jridgewell/resolve-uri": "^3.0.3", + "@jridgewell/sourcemap-codec": "^1.4.10" + } + }, + "node_modules/@tsconfig/node10": { + "version": "1.0.9", + "resolved": "https://registry.npmjs.org/@tsconfig/node10/-/node10-1.0.9.tgz", + "integrity": "sha512-jNsYVVxU8v5g43Erja32laIDHXeoNvFEpX33OK4d6hljo3jDhCBDhx5dhCCTMWUojscpAagGiRkBKxpdl9fxqA==", + "dev": true + }, + "node_modules/@tsconfig/node12": { + "version": "1.0.11", + "resolved": "https://registry.npmjs.org/@tsconfig/node12/-/node12-1.0.11.tgz", + "integrity": "sha512-cqefuRsh12pWyGsIoBKJA9luFu3mRxCA+ORZvA4ktLSzIuCUtWVxGIuXigEwO5/ywWFMZ2QEGKWvkZG1zDMTag==", + "dev": true + }, + "node_modules/@tsconfig/node14": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/@tsconfig/node14/-/node14-1.0.3.tgz", + "integrity": "sha512-ysT8mhdixWK6Hw3i1V2AeRqZ5WfXg1G43mqoYlM2nc6388Fq5jcXyr5mRsqViLx/GJYdoL0bfXD8nmF+Zn/Iow==", + "dev": true + }, + "node_modules/@tsconfig/node16": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/@tsconfig/node16/-/node16-1.0.4.tgz", + "integrity": "sha512-vxhUy4J8lyeyinH7Azl1pdd43GJhZH/tP2weN8TntQblOY+A0XbT8DJk1/oCPuOOyg/Ja757rG0CgHcWC8OfMA==", + "dev": true + }, + "node_modules/@types/body-parser": { + "version": "1.19.5", + "resolved": "https://registry.npmjs.org/@types/body-parser/-/body-parser-1.19.5.tgz", + "integrity": "sha512-fB3Zu92ucau0iQ0JMCFQE7b/dv8Ot07NI3KaZIkIUNXq82k4eBAqUaneXfleGY9JWskeS9y+u0nXMyspcuQrCg==", + "dev": true, + "dependencies": { + "@types/connect": "*", + "@types/node": "*" + } + }, + "node_modules/@types/connect": { + "version": "3.4.38", + "resolved": "https://registry.npmjs.org/@types/connect/-/connect-3.4.38.tgz", + "integrity": "sha512-K6uROf1LD88uDQqJCktA4yzL1YYAK6NgfsI0v/mTgyPKWsX1CnJ0XPSDhViejru1GcRkLWb8RlzFYJRqGUbaug==", + "dev": true, + "dependencies": { + "@types/node": "*" + } + }, + "node_modules/@types/express": { + "version": "4.17.21", + "resolved": "https://registry.npmjs.org/@types/express/-/express-4.17.21.tgz", + "integrity": "sha512-ejlPM315qwLpaQlQDTjPdsUFSc6ZsP4AN6AlWnogPjQ7CVi7PYF3YVz+CY3jE2pwYf7E/7HlDAN0rV2GxTG0HQ==", + "dev": true, + "dependencies": { + "@types/body-parser": "*", + "@types/express-serve-static-core": "^4.17.33", + "@types/qs": "*", + "@types/serve-static": "*" + } + }, + "node_modules/@types/express-serve-static-core": { + "version": "4.17.43", + "resolved": "https://registry.npmjs.org/@types/express-serve-static-core/-/express-serve-static-core-4.17.43.tgz", + "integrity": "sha512-oaYtiBirUOPQGSWNGPWnzyAFJ0BP3cwvN4oWZQY+zUBwpVIGsKUkpBpSztp74drYcjavs7SKFZ4DX1V2QeN8rg==", + "dev": true, + "dependencies": { + "@types/node": "*", + "@types/qs": "*", + "@types/range-parser": "*", + "@types/send": "*" + } + }, + "node_modules/@types/http-errors": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/@types/http-errors/-/http-errors-2.0.4.tgz", + "integrity": "sha512-D0CFMMtydbJAegzOyHjtiKPLlvnm3iTZyZRSZoLq2mRhDdmLfIWOCYPfQJ4cu2erKghU++QvjcUjp/5h7hESpA==", + "dev": true + }, + "node_modules/@types/lru-cache": { + "version": "4.1.3", + "resolved": "https://registry.npmjs.org/@types/lru-cache/-/lru-cache-4.1.3.tgz", + "integrity": "sha512-QjCOmf5kYwekcsfEKhcEHMK8/SvgnneuSDXFERBuC/DPca2KJIO/gpChTsVb35BoWLBpEAJWz1GFVEArSdtKtw==", + "dev": true + }, + "node_modules/@types/mime": { + "version": "1.3.5", + "resolved": "https://registry.npmjs.org/@types/mime/-/mime-1.3.5.tgz", + "integrity": "sha512-/pyBZWSLD2n0dcHE3hq8s8ZvcETHtEuF+3E7XVt0Ig2nvsVQXdghHVcEkIWjy9A0wKfTn97a/PSDYohKIlnP/w==", + "dev": true + }, + "node_modules/@types/mustache": { + "version": "4.2.5", + "resolved": "https://registry.npmjs.org/@types/mustache/-/mustache-4.2.5.tgz", + "integrity": "sha512-PLwiVvTBg59tGFL/8VpcGvqOu3L4OuveNvPi0EYbWchRdEVP++yRUXJPFl+CApKEq13017/4Nf7aQ5lTtHUNsA==", + "dev": true + }, + "node_modules/@types/mustache-express": { + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/@types/mustache-express/-/mustache-express-1.2.5.tgz", + "integrity": "sha512-F1flbb8KyEoVxjWPMzPlSb3pXQfaZG43ZdzWYOOAWDWE6jll9+QSszS2a1EvgFkfRkmMn2GnoWOyUeWYuwCJkg==", + "dev": true, + "dependencies": { + "@types/lru-cache": "^4.1.3" + } + }, + "node_modules/@types/node": { + "version": "20.11.24", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.11.24.tgz", + "integrity": "sha512-Kza43ewS3xoLgCEpQrsT+xRo/EJej1y0kVYGiLFE1NEODXGzTfwiC6tXTLMQskn1X4/Rjlh0MQUvx9W+L9long==", + "dev": true, + "dependencies": { + "undici-types": "~5.26.4" + } + }, + "node_modules/@types/qs": { + "version": "6.9.12", + "resolved": "https://registry.npmjs.org/@types/qs/-/qs-6.9.12.tgz", + "integrity": "sha512-bZcOkJ6uWrL0Qb2NAWKa7TBU+mJHPzhx9jjLL1KHF+XpzEcR7EXHvjbHlGtR/IsP1vyPrehuS6XqkmaePy//mg==", + "dev": true + }, + "node_modules/@types/range-parser": { + "version": "1.2.7", + "resolved": "https://registry.npmjs.org/@types/range-parser/-/range-parser-1.2.7.tgz", + "integrity": "sha512-hKormJbkJqzQGhziax5PItDUTMAM9uE2XXQmM37dyd4hVM+5aVl7oVxMVUiVQn2oCQFN/LKCZdvSM0pFRqbSmQ==", + "dev": true + }, + "node_modules/@types/send": { + "version": "0.17.4", + "resolved": "https://registry.npmjs.org/@types/send/-/send-0.17.4.tgz", + "integrity": "sha512-x2EM6TJOybec7c52BX0ZspPodMsQUd5L6PRwOunVyVUhXiBSKf3AezDL8Dgvgt5o0UfKNfuA0eMLr2wLT4AiBA==", + "dev": true, + "dependencies": { + "@types/mime": "^1", + "@types/node": "*" + } + }, + "node_modules/@types/serve-favicon": { + "version": "2.5.7", + "resolved": "https://registry.npmjs.org/@types/serve-favicon/-/serve-favicon-2.5.7.tgz", + "integrity": "sha512-z9TNUQXdQ+W/OJMP1e3KOYUZ99qJS4+ZfFOIrPGImcayqKoyifbJSEFkVq1MCKBbqjMZpjPj3B5ilrQAR2+TOw==", + "dev": true, + "dependencies": { + "@types/express": "*" + } + }, + "node_modules/@types/serve-static": { + "version": "1.15.5", + "resolved": "https://registry.npmjs.org/@types/serve-static/-/serve-static-1.15.5.tgz", + "integrity": "sha512-PDRk21MnK70hja/YF8AHfC7yIsiQHn1rcXx7ijCFBX/k+XQJhQT/gw3xekXKJvx+5SXaMMS8oqQy09Mzvz2TuQ==", + "dev": true, + "dependencies": { + "@types/http-errors": "*", + "@types/mime": "*", + "@types/node": "*" } }, "node_modules/abbrev": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz", - "integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==" + "integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==", + "dev": true }, "node_modules/accepts": { "version": "1.3.8", @@ -33,10 +231,32 @@ "node": ">= 0.6" } }, + "node_modules/acorn": { + "version": "8.11.3", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.11.3.tgz", + "integrity": "sha512-Y9rRfJG5jcKOE0CLisYbojUjIrIEE7AGMzA/Sm4BslANhbS+cDMpgBdcPT91oJ7OuJ9hYJBx59RjbhxVnrF8Xg==", + "dev": true, + "bin": { + "acorn": "bin/acorn" + }, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/acorn-walk": { + "version": "8.3.2", + "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.3.2.tgz", + "integrity": "sha512-cjkyv4OtNCIeqhHrfS81QWXoCBPExR/J62oyEqepVw8WaQeSqpW2uhuLPh1m9eWhDuOo/jUXVTlifvesOWp/4A==", + "dev": true, + "engines": { + "node": ">=0.4.0" + } + }, "node_modules/anymatch": { "version": "3.1.3", "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.3.tgz", "integrity": "sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==", + "dev": true, "dependencies": { "normalize-path": "^3.0.0", "picomatch": "^2.0.4" @@ -45,6 +265,12 @@ "node": ">= 8" } }, + "node_modules/arg": { + "version": "4.1.3", + "resolved": "https://registry.npmjs.org/arg/-/arg-4.1.3.tgz", + "integrity": "sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA==", + "dev": true + }, "node_modules/argparse": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", @@ -63,12 +289,14 @@ "node_modules/balanced-match": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", - "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==" + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", + "dev": true }, "node_modules/binary-extensions": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.2.0.tgz", "integrity": "sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA==", + "dev": true, "engines": { "node": ">=8" } @@ -100,6 +328,7 @@ "version": "1.1.11", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, "dependencies": { "balanced-match": "^1.0.0", "concat-map": "0.0.1" @@ -109,6 +338,7 @@ "version": "3.0.2", "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", + "dev": true, "dependencies": { "fill-range": "^7.0.1" }, @@ -146,6 +376,7 @@ "version": "3.6.0", "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.6.0.tgz", "integrity": "sha512-7VT13fmjotKpGipCW9JEQAusEPE+Ei8nl6/g4FBAmIm0GOOLMua9NDDo/DWp0ZAxCr3cPq5ZpBqmPAQgDda2Pw==", + "dev": true, "dependencies": { "anymatch": "~3.1.2", "braces": "~3.0.2", @@ -168,7 +399,8 @@ "node_modules/concat-map": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", - "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==" + "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", + "dev": true }, "node_modules/content-disposition": { "version": "0.5.4", @@ -202,6 +434,12 @@ "resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.6.tgz", "integrity": "sha512-QADzlaHc8icV8I7vbaJXJwod9HWYp8uCqf1xa4OfNu1T7JVxQIrUgOWtHdNDtPiywmFbiS12VjotIXLrKM3orQ==" }, + "node_modules/create-require": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/create-require/-/create-require-1.1.1.tgz", + "integrity": "sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ==", + "dev": true + }, "node_modules/debug": { "version": "2.6.9", "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", @@ -243,6 +481,15 @@ "npm": "1.2.8000 || >= 1.4.16" } }, + "node_modules/diff": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/diff/-/diff-4.0.2.tgz", + "integrity": "sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==", + "dev": true, + "engines": { + "node": ">=0.3.1" + } + }, "node_modules/ee-first": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", @@ -333,6 +580,7 @@ "version": "7.0.1", "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", + "dev": true, "dependencies": { "to-regex-range": "^5.0.1" }, @@ -377,6 +625,7 @@ "version": "2.3.3", "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", + "dev": true, "hasInstallScript": true, "optional": true, "os": [ @@ -416,6 +665,7 @@ "version": "5.1.2", "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", + "dev": true, "dependencies": { "is-glob": "^4.0.1" }, @@ -438,6 +688,7 @@ "version": "3.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", + "dev": true, "engines": { "node": ">=4" } @@ -515,7 +766,8 @@ "node_modules/ignore-by-default": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/ignore-by-default/-/ignore-by-default-1.0.1.tgz", - "integrity": "sha512-Ius2VYcGNk7T90CppJqcIkS5ooHUZyIQK+ClZfMfMNFEF9VSE73Fq+906u/CWu92x4gzZMWOwfFYckPObzdEbA==" + "integrity": "sha512-Ius2VYcGNk7T90CppJqcIkS5ooHUZyIQK+ClZfMfMNFEF9VSE73Fq+906u/CWu92x4gzZMWOwfFYckPObzdEbA==", + "dev": true }, "node_modules/inherits": { "version": "2.0.4", @@ -534,6 +786,7 @@ "version": "2.1.0", "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz", "integrity": "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==", + "dev": true, "dependencies": { "binary-extensions": "^2.0.0" }, @@ -545,6 +798,7 @@ "version": "2.1.1", "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", + "dev": true, "engines": { "node": ">=0.10.0" } @@ -553,6 +807,7 @@ "version": "4.0.3", "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", + "dev": true, "dependencies": { "is-extglob": "^2.1.1" }, @@ -564,6 +819,7 @@ "version": "7.0.0", "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", + "dev": true, "engines": { "node": ">=0.12.0" } @@ -583,6 +839,7 @@ "version": "6.0.0", "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "dev": true, "dependencies": { "yallist": "^4.0.0" }, @@ -590,6 +847,12 @@ "node": ">=10" } }, + "node_modules/make-error": { + "version": "1.3.6", + "resolved": "https://registry.npmjs.org/make-error/-/make-error-1.3.6.tgz", + "integrity": "sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==", + "dev": true + }, "node_modules/media-typer": { "version": "0.3.0", "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz", @@ -645,6 +908,7 @@ "version": "3.1.2", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dev": true, "dependencies": { "brace-expansion": "^1.1.7" }, @@ -703,6 +967,7 @@ "version": "3.1.0", "resolved": "https://registry.npmjs.org/nodemon/-/nodemon-3.1.0.tgz", "integrity": "sha512-xqlktYlDMCepBJd43ZQhjWwMw2obW/JRvkrLxq5RCNcuDDX1DbcPT+qT1IlIIdf+DhnWs90JpTMe+Y5KxOchvA==", + "dev": true, "dependencies": { "chokidar": "^3.5.2", "debug": "^4", @@ -730,6 +995,7 @@ "version": "4.3.4", "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", + "dev": true, "dependencies": { "ms": "2.1.2" }, @@ -745,12 +1011,14 @@ "node_modules/nodemon/node_modules/ms": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "dev": true }, "node_modules/nopt": { "version": "1.0.10", "resolved": "https://registry.npmjs.org/nopt/-/nopt-1.0.10.tgz", "integrity": "sha512-NWmpvLSqUrgrAC9HCuxEvb+PSloHpqVu+FqcO4eeF2h5qYRhA7ev6KvelyQAKtegUbC6RypJnlEOhd8vloNKYg==", + "dev": true, "dependencies": { "abbrev": "1" }, @@ -765,6 +1033,7 @@ "version": "3.0.0", "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", + "dev": true, "engines": { "node": ">=0.10.0" } @@ -805,6 +1074,7 @@ "version": "2.3.1", "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", + "dev": true, "engines": { "node": ">=8.6" }, @@ -827,7 +1097,8 @@ "node_modules/pstree.remy": { "version": "1.1.8", "resolved": "https://registry.npmjs.org/pstree.remy/-/pstree.remy-1.1.8.tgz", - "integrity": "sha512-77DZwxQmxKnu3aR542U+X8FypNzbfJ+C5XQDk3uWjWxn6151aIMGthWYRXTqT1E5oJvg+ljaa2OJi+VfvCOQ8w==" + "integrity": "sha512-77DZwxQmxKnu3aR542U+X8FypNzbfJ+C5XQDk3uWjWxn6151aIMGthWYRXTqT1E5oJvg+ljaa2OJi+VfvCOQ8w==", + "dev": true }, "node_modules/qs": { "version": "6.11.0", @@ -869,6 +1140,7 @@ "version": "3.6.0", "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz", "integrity": "sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==", + "dev": true, "dependencies": { "picomatch": "^2.2.1" }, @@ -904,6 +1176,7 @@ "version": "7.6.0", "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.0.tgz", "integrity": "sha512-EnwXhrlwXMk9gKu5/flx5sv/an57AkRplG3hTK68W7FRDN+k+OWBj65M7719OkA82XLBxrcX0KSHj+X5COhOVg==", + "dev": true, "dependencies": { "lru-cache": "^6.0.0" }, @@ -1023,6 +1296,7 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/simple-update-notifier/-/simple-update-notifier-2.0.0.tgz", "integrity": "sha512-a2B9Y0KlNXl9u/vsW6sTIu9vGEpfKu2wRV6l1H3XEas/0gUIzGzBoP/IouTcUQbm9JWZLH3COxyn03TYlFax6w==", + "dev": true, "dependencies": { "semver": "^7.5.3" }, @@ -1042,6 +1316,7 @@ "version": "5.5.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, "dependencies": { "has-flag": "^3.0.0" }, @@ -1053,6 +1328,7 @@ "version": "5.0.1", "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", + "dev": true, "dependencies": { "is-number": "^7.0.0" }, @@ -1072,6 +1348,7 @@ "version": "3.1.0", "resolved": "https://registry.npmjs.org/touch/-/touch-3.1.0.tgz", "integrity": "sha512-WBx8Uy5TLtOSRtIq+M03/sKDrXCLHxwDcquSP2c43Le03/9serjQBIztjRz6FkJez9D/hleyAXTBGLwwZUw9lA==", + "dev": true, "dependencies": { "nopt": "~1.0.10" }, @@ -1079,6 +1356,49 @@ "nodetouch": "bin/nodetouch.js" } }, + "node_modules/ts-node": { + "version": "10.9.2", + "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-10.9.2.tgz", + "integrity": "sha512-f0FFpIdcHgn8zcPSbf1dRevwt047YMnaiJM3u2w2RewrB+fob/zePZcrOyQoLMMO7aBIddLcQIEK5dYjkLnGrQ==", + "dev": true, + "dependencies": { + "@cspotcode/source-map-support": "^0.8.0", + "@tsconfig/node10": "^1.0.7", + "@tsconfig/node12": "^1.0.7", + "@tsconfig/node14": "^1.0.0", + "@tsconfig/node16": "^1.0.2", + "acorn": "^8.4.1", + "acorn-walk": "^8.1.1", + "arg": "^4.1.0", + "create-require": "^1.1.0", + "diff": "^4.0.1", + "make-error": "^1.1.1", + "v8-compile-cache-lib": "^3.0.1", + "yn": "3.1.1" + }, + "bin": { + "ts-node": "dist/bin.js", + "ts-node-cwd": "dist/bin-cwd.js", + "ts-node-esm": "dist/bin-esm.js", + "ts-node-script": "dist/bin-script.js", + "ts-node-transpile-only": "dist/bin-transpile.js", + "ts-script": "dist/bin-script-deprecated.js" + }, + "peerDependencies": { + "@swc/core": ">=1.2.50", + "@swc/wasm": ">=1.2.50", + "@types/node": "*", + "typescript": ">=2.7" + }, + "peerDependenciesMeta": { + "@swc/core": { + "optional": true + }, + "@swc/wasm": { + "optional": true + } + } + }, "node_modules/type-is": { "version": "1.6.18", "resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.18.tgz", @@ -1091,10 +1411,31 @@ "node": ">= 0.6" } }, + "node_modules/typescript": { + "version": "5.3.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.3.3.tgz", + "integrity": "sha512-pXWcraxM0uxAS+tN0AG/BF2TyqmHO014Z070UsJ+pFvYuRSq8KH8DmWpnbXe0pEPDHXZV3FcAbJkijJ5oNEnWw==", + "dev": true, + "peer": true, + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=14.17" + } + }, "node_modules/undefsafe": { "version": "2.0.5", "resolved": "https://registry.npmjs.org/undefsafe/-/undefsafe-2.0.5.tgz", - "integrity": "sha512-WxONCrssBM8TSPRqN5EmsjVrsv4A8X12J4ArBiiayv3DyyG3ZlIg6yysuuSYdZsVz3TKcTg2fd//Ujd4CHV1iA==" + "integrity": "sha512-WxONCrssBM8TSPRqN5EmsjVrsv4A8X12J4ArBiiayv3DyyG3ZlIg6yysuuSYdZsVz3TKcTg2fd//Ujd4CHV1iA==", + "dev": true + }, + "node_modules/undici-types": { + "version": "5.26.5", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz", + "integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==", + "dev": true }, "node_modules/unpipe": { "version": "1.0.0", @@ -1112,6 +1453,12 @@ "node": ">= 0.4.0" } }, + "node_modules/v8-compile-cache-lib": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/v8-compile-cache-lib/-/v8-compile-cache-lib-3.0.1.tgz", + "integrity": "sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg==", + "dev": true + }, "node_modules/vary": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", @@ -1123,7 +1470,17 @@ "node_modules/yallist": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", - "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==" + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", + "dev": true + }, + "node_modules/yn": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/yn/-/yn-3.1.1.tgz", + "integrity": "sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q==", + "dev": true, + "engines": { + "node": ">=6" + } } } } diff --git a/src/package.json b/src/package.json index d3fb3d5..f065db3 100644 --- a/src/package.json +++ b/src/package.json @@ -4,15 +4,25 @@ "description": "Just an simple confirm page before calling a link", "main": "index.js", "scripts": { - "dev": "nodemon index.js" + "start:dev": "nodemon", + "build": "npx tsc" }, "author": "", "license": "ISC", "dependencies": { "express": "^4.18.2", "js-yaml": "^4.1.0", + "mustache": "^4.2.0", "mustache-express": "^1.3.2", - "nodemon": "^3.1.0", "serve-favicon": "^2.5.0" + }, + "devDependencies": { + "@types/express": "^4.17.21", + "@types/mustache": "^4.2.5", + "@types/mustache-express": "^1.2.5", + "@types/node": "^20.11.24", + "@types/serve-favicon": "^2.5.7", + "nodemon": "^3.1.0", + "ts-node": "^10.9.2" } } diff --git a/src/router.ts b/src/router.ts new file mode 100644 index 0000000..f864c71 --- /dev/null +++ b/src/router.ts @@ -0,0 +1,12 @@ +import { Router } from "express"; +import { cssController } from "./controllers/CssController"; +import { confirmController } from "./controllers/ConfirmController"; + + +const router: Router = Router() + +//Routes +router.get("/css/variables.css", cssController.variables); +router.get("/:alias", confirmController.alias); + +export { router }; \ No newline at end of file diff --git a/src/tsconfig.json b/src/tsconfig.json new file mode 100644 index 0000000..f141ef4 --- /dev/null +++ b/src/tsconfig.json @@ -0,0 +1,14 @@ +{ + "compilerOptions": { + "target": "es5", + "module": "commonjs", + "lib": ["es6"], + "allowJs": true, + "outDir": "build", + "rootDir": "./", + "strict": true, + "noImplicitAny": true, + "esModuleInterop": true, + "resolveJsonModule": true + } + } \ No newline at end of file From 128310504ac28d23e6d0c4a00d86f7a622e05be0 Mon Sep 17 00:00:00 2001 From: Leandro Menezes Date: Fri, 1 Mar 2024 15:29:59 -0300 Subject: [PATCH 2/5] adjusts --- src/config.yml | 1 - src/docker-compose.yml | 9 +++++++++ src/index.ts | 2 +- 3 files changed, 10 insertions(+), 2 deletions(-) create mode 100644 src/docker-compose.yml diff --git a/src/config.yml b/src/config.yml index cfc02fc..bb6c679 100644 --- a/src/config.yml +++ b/src/config.yml @@ -26,7 +26,6 @@ themes: config: direction: dynamic theme: default - port: 8000 # theme: dracula strings: yes: SIM diff --git a/src/docker-compose.yml b/src/docker-compose.yml new file mode 100644 index 0000000..036aacd --- /dev/null +++ b/src/docker-compose.yml @@ -0,0 +1,9 @@ +services: + confirm: + build: . + ports: + - 8446:8000 + restart: unless-stopped + volumes: + - ./config.yml:/app/config.yml + - ./views:/app/views \ No newline at end of file diff --git a/src/index.ts b/src/index.ts index 4332376..0b71dcb 100644 --- a/src/index.ts +++ b/src/index.ts @@ -3,7 +3,7 @@ import { configReader } from "./helpers/ConfigReader"; const { App } = require("./app"); const doc = configReader.getDoc(); -new App().server.listen(doc.config.port); +new App().server.listen(doc.config.port || 8000); // const favicon = require('serve-favicon'); // app.use(express.static('public')) From 4730988f900f98a6ec8ba21c02f7c3bbada99bcd Mon Sep 17 00:00:00 2001 From: Leandro Menezes Date: Fri, 1 Mar 2024 15:34:26 -0300 Subject: [PATCH 3/5] change place --- src/docker-compose.yml => docker-compose.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) rename src/docker-compose.yml => docker-compose.yml (50%) diff --git a/src/docker-compose.yml b/docker-compose.yml similarity index 50% rename from src/docker-compose.yml rename to docker-compose.yml index 036aacd..6733fe9 100644 --- a/src/docker-compose.yml +++ b/docker-compose.yml @@ -1,9 +1,9 @@ services: confirm: - build: . + build: ./src/. ports: - 8446:8000 restart: unless-stopped volumes: - - ./config.yml:/app/config.yml - - ./views:/app/views \ No newline at end of file + - ./src/config.yml:/app/config.yml + - ./src/views:/app/views \ No newline at end of file From 4c34aaa946c85d362852a7f5ad0b41a1ed4b1443 Mon Sep 17 00:00:00 2001 From: Leandro Menezes Date: Fri, 1 Mar 2024 15:35:50 -0300 Subject: [PATCH 4/5] adjusts --- src/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Dockerfile b/src/Dockerfile index 88635c5..d757e22 100644 --- a/src/Dockerfile +++ b/src/Dockerfile @@ -2,7 +2,7 @@ FROM node:slim as builder WORKDIR /app COPY package.json ./ COPY tsconfig.json ./ -COPY src ./src +COPY . . RUN npm install RUN npm run build From b3da3f48045a64cdd5cd44d1e931e323108e18b9 Mon Sep 17 00:00:00 2001 From: Leandro Menezes Date: Fri, 1 Mar 2024 15:37:01 -0300 Subject: [PATCH 5/5] adjusts --- src/Dockerfile | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Dockerfile b/src/Dockerfile index d757e22..e0295d2 100644 --- a/src/Dockerfile +++ b/src/Dockerfile @@ -12,6 +12,7 @@ WORKDIR /app COPY package.json ./ RUN npm install --only=production COPY --from=builder /app/build . +COPY --from=builder /app/public ./public/ CMD [ "node", "index.js" ]