From 8e373b3dca78de6ee2273c0a7cba42170c2f9076 Mon Sep 17 00:00:00 2001 From: philc Date: Thu, 17 Apr 2025 23:06:09 +0200 Subject: [PATCH] notification and package update --- apxtri/models/Wwws.js | 3 +++ apxtri/routes/notifications.js | 22 ++++------------------ package.json | 11 +++++++---- 3 files changed, 14 insertions(+), 22 deletions(-) diff --git a/apxtri/models/Wwws.js b/apxtri/models/Wwws.js index c68aae1..23b33eb 100644 --- a/apxtri/models/Wwws.js +++ b/apxtri/models/Wwws.js @@ -201,6 +201,9 @@ Wwws.getwco = (wconame, ctx) => { ]; // save the conf for update localdb when the web page request it fs.outputJSONSync(webconf, webpage, { spaces: 2 }); + // create a text file with component to watch for tailwind + + fs.outputFileSync(`../${ctx.tribe}/objects/wwws/${ctx.xapp}/src/static/css/watchtailwind.txt`,webpage.tailwindcsscontent.join("\n"),"utf-8"); return { status: 200, ref: "Wwws", diff --git a/apxtri/routes/notifications.js b/apxtri/routes/notifications.js index 3c9d25d..3111d25 100644 --- a/apxtri/routes/notifications.js +++ b/apxtri/routes/notifications.js @@ -9,21 +9,7 @@ const isAuthenticated = require("../middlewares/isAuthenticated"); const router = express.Router(); /** - * wait Sagar feedback for language and label description - * @ api {post} /api/notifications/backend - Notification Backend post - * @apiName notifBackend - * @apiDescription Send an api result {status,ref,msg,data} to get personnalize notification by header.xlang abd by data - * @apiGroup Notification - * - * @apiBody {integer} status an http status - * @apiBody {string} ref an existing model name - * @apiBody {string} msg a key word existing in referentiual - * */ - -router.post("/backend", (req, res) => {}); - -/** - * @api {get} adminapi/notifications/messages/:alias/:tribeId - Get message list for alias in tribe + * @api {get} /adminapi/notifications/messages/:alias/:tribeId - Get message list for alias in tribe * @apiName notiflist * @apiDescription Get list of notifications for an alias and a tribe * @apiGroup Notifications @@ -37,12 +23,12 @@ router.post("/backend", (req, res) => {}); * bouture **/ router.get("/messages/:alias/:tribeId", (req, res) => { - const getnot = Notification.get(req.params.alias, req.params.tribeId); + const getnot = Notifications.get(req.params.alias, req.params.tribeId); res.status(getalias.status).send(getalias); }); /** - * @api {POST} adminapi/notifications/sendmail/:tribe/:template - Send personnalize emails + * @api {POST} /adminapi/notifications/sendmail/:tribe/:template - Send personnalize emails * @apiName Sendmail * @apiDescription Send campain personnalized email by rendering a template store in {tribe}/template/{template}.js containing email key like html, subject, text, cc,.. as mustache templatewith blank test replaced by data.
It use a smtp in conf global or in adminapi/objects/tribes/itm/{tribe}.json that must have valid parameter emailcontact must be authorized by the smtp
* "emailcontact": "noreply@smatchit.io",
@@ -234,7 +220,7 @@ router.get("/stat/maillinglst/:tribe", checkHeaders, async (req, res) => { * {"status":200, "ref":"Contact", "msg":"success", "data":{"indexlist":[]}} * */ -router.post("/contactanonymous", checkHeaders, async (req, res) => { +router.post("/contactanonymous/:tribe", checkHeaders, async (req, res) => { const done = Actions[req.body.order] ? await Actions[req.body.order](req.body, req.session.header) : { status: 406, ref: "Actions", msg: "bodyerror", data: req.body }; diff --git a/package.json b/package.json index 53ca6b0..fc062e7 100755 --- a/package.json +++ b/package.json @@ -19,7 +19,8 @@ "publishtestwall": "scp -r /media/phil/usbfarm/apxtowns/dev-ants/tribes/$space phil@wall-ants://home/phil/apxtowns/testwall-ants/tribes/$space/..", "publishwall": "scp -r /media/phil/usbfarm/apxtowns/dev-ants/tribes/$space phil@wall-ants://home/phil/apxtowns/wall-ants/tribes/$space/..", "publishhouse": "scp -r /media/phil/usbfarm/apxtowns/dev-ants/tribes/$space phil@house-ants://home/phil/apxtowns/house-ants/tribes/$space/..", - "src:css": "tailwindcss --watch -c ../$tribe/objects/wwws/$webapp/tailwind.config.js -i ../$tribe/objects/wwws/$webapp/src/static/css/twdevstyle.css -o ../$tribe/objects/wwws/$webapp/src/static/css/twstyle.css", + "src":"echo '$tribe -- $webapp'", + "src:css": "npx @tailwindcss/cli -i ../$tribe/objects/wwws/$webapp/src/static/css/input.css -o ../$tribe/objects/wwws/$webapp/src/static/css/output.css --watch --config ../$tribe/objects/wwws/$webapp/tailwind.config.js", "dist:css": "node apxtri/models/Wwws.js $tribe $webapp dist && tailwindcss --minify -c ../$tribe/objects/wwws/$webapp/tailwind.config.js -i ../$tribe/objects/wwws/$webapp/src/static/css/twdevstyle.css -o ../$tribe/objects/wwws/$webapp/dist/static/css/twstyle.css" }, "commentscript": "cf wiki apxtri doc for details: yarn startpm2 -n teswallants, yarn pm2 stop testwallants, yarn pm2 delete testwallants, yarn pm2 logs --lines 200 testwall, yarn pm2 monit -n testwallants, yarn pm2 save tribe=tribeid yarn apidoc to build apidoc // space=adminapi/www/cdn/apidoc yarn publishtestwall ", @@ -54,13 +55,13 @@ }, "license": "MIT", "dependencies": { - "@tailwindcss/typography": "^0.5.15", + "@tailwindcss/typography": "^0.5.16", "apidoc": "^1.2.0", "async": "^3.2.0", "axios": "^1.7.8", "bcrypt": "^5.0.0", "cors": "^2.8.4", - "daisyui": "^5.0.9", + "daisyui": "^5.0.12", "dayjs": "^1.11.13", "dns-sync": "^0.2.1", "express": "^4.21.1", @@ -83,5 +84,7 @@ "tailwindcss": "^4.0.15", "uuid": "^11.0.2" }, - "devDependencies": {} + "devDependencies": { + "cross-env": "^7.0.3" + } }