@ozdao/prometheus-framework 0.2.85 → 0.2.87

Sign up to get free protection for your applications and to get access to all the features.
Files changed (27) hide show
  1. package/package.json +1 -1
  2. package/src/modules/auth/routes/auth.routes.js +1 -14
  3. package/src/modules/auth/routes/twofa.routes.js +0 -9
  4. package/src/modules/community/routes/blog.routes.js +0 -13
  5. package/src/modules/community/routes/comments.routes.js +0 -9
  6. package/src/modules/community/routes/reactions.routes.js +0 -9
  7. package/src/modules/events/routes/events.routes.js +0 -13
  8. package/src/modules/events/routes/tickets.routes.js +0 -12
  9. package/src/modules/files/routes/files.routes.js +0 -13
  10. package/src/modules/gallery/routes/gallery.routes.js +0 -13
  11. package/src/modules/orders/routes/applications.routes.js +0 -13
  12. package/src/modules/orders/routes/backcalls.routes.js +0 -5
  13. package/src/modules/orders/routes/fastorders.routes.js +0 -4
  14. package/src/modules/orders/routes/testimonials.routes.js +0 -8
  15. package/src/modules/organizations/routes/departments.routes.js +1 -11
  16. package/src/modules/organizations/routes/invites.routes.js +0 -8
  17. package/src/modules/organizations/routes/memberships.routes.js +0 -9
  18. package/src/modules/organizations/routes/organizations.routes.js +0 -13
  19. package/src/modules/pages/routes/pages.routes.js +0 -5
  20. package/src/modules/products/routes/categories.routes.js +0 -9
  21. package/src/modules/products/routes/leftovers.routes.js +0 -5
  22. package/src/modules/products/routes/products.routes.js +0 -8
  23. package/src/modules/projects/routes/projects.routes.js +0 -8
  24. package/src/modules/reports/routes/reports.routes.js +0 -13
  25. package/src/modules/spots/routes/spots.routes.js +0 -9
  26. package/src/modules/users/routes/users.routes.js +0 -13
  27. package/src/modules/wallet/controllers/routes/payments.routes.js +0 -5
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ozdao/prometheus-framework",
3
- "version": "0.2.85",
3
+ "version": "0.2.87",
4
4
  "description": "Web3 Framework focused on user experience and ease of development.",
5
5
  "author": "OZ DAO <hello@ozdao.dev>",
6
6
  "license": "GPL-3.0-or-later",
@@ -1,4 +1,4 @@
1
- // Factories
1
+ // Factories
2
2
  const controllerFactory = require("../controllers/auth.controller");
3
3
  const controllerFactoryTwofa = require("../controllers/twofa.controller");
4
4
  // Middlewares
@@ -9,19 +9,6 @@ module.exports = function(app, db, origins) {
9
9
  const controllerTwofa = controllerFactoryTwofa(db);
10
10
 
11
11
  const { verifySignUp, verifyUser } = middlewareFactory(db);
12
-
13
- app.use(function(req, res, next) {
14
-
15
- const origin = req.headers.origin;
16
-
17
- if (origins.includes(origin)) {
18
- res.setHeader('Access-Control-Allow-Origin', origin);
19
- }
20
-
21
- res.header("Access-Control-Allow-Headers", "x-access-token, Origin, Content-Type, Accept");
22
-
23
- next();
24
- });
25
12
 
26
13
  app.post(
27
14
  "/api/auth/signup",
@@ -7,15 +7,6 @@ module.exports = function(app, db) {
7
7
  const controller = controllerFactory(db);
8
8
  const { verifySignUp, verifyUser } = middlewareFactory(db);
9
9
 
10
- app.use(function(req, res, next) {
11
- res.header(
12
- "Access-Control-Allow-Headers",
13
- "Access-Control-Allow-Origin",
14
- "x-access-token, Origin, Content-Type, Accept"
15
- );
16
- next();
17
- });
18
-
19
10
  app.post(
20
11
  "/api/twofa/sendcode",
21
12
  [
@@ -9,19 +9,6 @@ module.exports = function(app, db, origins) {
9
9
  const { authJwt } = middlewareFactoryGlobal(db);
10
10
  const { verifyBlogpost } = middlewareFactoryCommunity(db);
11
11
 
12
- app.use(function(req, res, next) {
13
-
14
- const origin = req.headers.origin;
15
-
16
- if (origins.includes(origin)) {
17
- res.setHeader('Access-Control-Allow-Origin', origin);
18
- }
19
-
20
- res.header("Access-Control-Allow-Headers", "x-access-token, Origin, Content-Type, Accept");
21
-
22
- next();
23
- });
24
-
25
12
  app.get(
26
13
  "/api/blog/read",
27
14
  controller.read
@@ -3,15 +3,6 @@ const controllerFactory = require("../controllers/comments.controller");
3
3
  module.exports = function(app, db) {
4
4
  const controller = controllerFactory(db);
5
5
 
6
- app.use(function(req, res, next) {
7
- res.header(
8
- "Access-Control-Allow-Headers",
9
- "Access-Control-Allow-Origin",
10
- "x-access-token, Origin, Content-Type, Accept"
11
- );
12
- next();
13
- });
14
-
15
6
  app.get(
16
7
  "/comments/read",
17
8
  controller.read
@@ -2,15 +2,6 @@ const controllerFactory = require("../controllers/reactions.controller");
2
2
 
3
3
  module.exports = function(app, db) {
4
4
  const controller = controllerFactory(db);
5
-
6
- app.use(function(req, res, next) {
7
- res.header(
8
- "Access-Control-Allow-Headers",
9
- "Access-Control-Allow-Origin",
10
- "x-access-token, Origin, Content-Type, Accept"
11
- );
12
- next();
13
- });
14
5
 
15
6
  app.get(
16
7
  "/api/reactions/read",
@@ -10,19 +10,6 @@ module.exports = function(app, db, origins) {
10
10
  const { authJwt } = middlewareFactoryGlobal(db);
11
11
  const { verifyEvent } = middlewareFactoryEvents(db);
12
12
 
13
- app.use(function(req, res, next) {
14
-
15
- const origin = req.headers.origin;
16
-
17
- if (origins.includes(origin)) {
18
- res.setHeader('Access-Control-Allow-Origin', origin);
19
- }
20
-
21
- res.header("Access-Control-Allow-Headers", "x-access-token, Origin, Content-Type, Accept");
22
-
23
- next();
24
- });
25
-
26
13
  app.get(
27
14
  "/api/events/read",
28
15
  controller.read
@@ -3,18 +3,6 @@ const controllerFactory = require("../controllers/tickets.controller");
3
3
  // Routes
4
4
  module.exports = function(app, db, origins, publicPath) {
5
5
  const controller = controllerFactory(db, publicPath);
6
-
7
- app.use(function(req, res, next) {
8
-
9
- const origin = req.headers.origin;
10
- if (origins.includes(origin)) {
11
- res.setHeader('Access-Control-Allow-Origin', origin);
12
- }
13
-
14
- res.header("Access-Control-Allow-Headers", "x-access-token, Origin, Content-Type, Accept");
15
-
16
- next();
17
- });
18
6
  // Read all tickets
19
7
  app.get(
20
8
  "/api/tickets",
@@ -10,19 +10,6 @@ module.exports = function(app, db, origins, publicPath) {
10
10
  const { authJwt } = middlewareFactoryGlobal(db);
11
11
  const { middlewareBusboy } = middlewareFactoryFiles(db, publicPath);
12
12
 
13
- app.use(function(req, res, next) {
14
-
15
- const origin = req.headers.origin;
16
-
17
- if (origins.includes(origin)) {
18
- res.setHeader('Access-Control-Allow-Origin', origin);
19
- }
20
-
21
- res.header("Access-Control-Allow-Headers", "x-access-token, Origin, Content-Type, Accept");
22
-
23
- next();
24
- });
25
-
26
13
  app.post(
27
14
  "/api/upload/image",
28
15
  [
@@ -8,19 +8,6 @@ module.exports = function(app, db, origins) {
8
8
 
9
9
  const { authJwt } = middlewareFactoryGlobal(db);
10
10
 
11
- app.use(function(req, res, next) {
12
-
13
- const origin = req.headers.origin;
14
-
15
- if (origins.includes(origin)) {
16
- res.setHeader('Access-Control-Allow-Origin', origin);
17
- }
18
-
19
- res.header("Access-Control-Allow-Headers", "x-access-token, Origin, Content-Type, Accept");
20
-
21
- next();
22
- });
23
-
24
11
  app.get(
25
12
  "/api/gallery",
26
13
  controller.read
@@ -7,19 +7,6 @@ module.exports = function(app, db, origins) {
7
7
 
8
8
  const { authJwt } = middlewareFactoryGlobal(db);
9
9
 
10
- app.use(function(req, res, next) {
11
-
12
- const origin = req.headers.origin;
13
-
14
- if (origins.includes(origin)) {
15
- res.setHeader('Access-Control-Allow-Origin', origin);
16
- }
17
-
18
- res.header("Access-Control-Allow-Headers", "x-access-token, Origin, Content-Type, Accept");
19
-
20
- next();
21
- });
22
-
23
10
  app.post(
24
11
  "/applications",
25
12
  controller.create
@@ -1,11 +1,6 @@
1
1
  const controller = require("../controllers/backcalls.controller");
2
2
 
3
3
  module.exports = function(app) {
4
- app.use(function(req, res, next) {
5
- res.header("Access-Control-Allow-Headers", "Access-Control-Allow-Origin: *", "x-access-token, Origin, Content-Type, Accept");
6
- next();
7
- });
8
-
9
4
  app.get(
10
5
  "/blog",
11
6
  controller.getBlogPosts
@@ -1,10 +1,6 @@
1
1
  const controller = require("../controllers/fastorders.controller");
2
2
 
3
3
  module.exports = function(app) {
4
- app.use(function(req, res, next) {
5
- res.header("Access-Control-Allow-Headers", "Access-Control-Allow-Origin: *", "x-access-token, Origin, Content-Type, Accept");
6
- next();
7
- });
8
4
 
9
5
 
10
6
  app.get(
@@ -3,14 +3,6 @@ const controller = require("../controllers/testimonials.controller");
3
3
  const { authJwt } = require("../middlewares");
4
4
 
5
5
  module.exports = function(app) {
6
- app.use(function(req, res, next) {
7
- res.header(
8
- "Access-Control-Allow-Headers",
9
- "Access-Control-Allow-Origin: *",
10
- "x-access-token, Origin, Content-Type, Accept"
11
- );
12
- next();
13
- });
14
6
 
15
7
  app.get(
16
8
  "/api/testimonials",
@@ -7,17 +7,7 @@ const accessMiddlewaresFactory = require('@pf/src/modules/middlewares/server/ver
7
7
  module.exports = function(app, db) {
8
8
  const controller = controllerFactory(db)
9
9
  const verifyAccesses = accessMiddlewaresFactory(db)
10
-
11
- app.use(function(req, res, next) {
12
- res.header(
13
- "Access-Control-Allow-Headers",
14
- "Access-Control-Allow-Origin",
15
- "x-access-token, Origin, Content-Type, Accept"
16
- )
17
-
18
- next()
19
- })
20
-
10
+
21
11
  // Get organization departments by _id
22
12
  app.get(
23
13
  "/api/departments/read",
@@ -7,14 +7,6 @@ module.exports = function(app, db) {
7
7
  const controller = controllerFactory(db);
8
8
  const { verifyInvites } = middlewareFactory(db);
9
9
 
10
- app.use(function(req, res, next) {
11
- res.header(
12
- "Access-Control-Allow-Headers",
13
- "Access-Control-Allow-Origin",
14
- "x-access-token, Origin, Content-Type, Accept"
15
- );
16
- next();
17
- });
18
10
  // Get one invite
19
11
  app.get(
20
12
  "/api/invites/get/:_id",
@@ -4,15 +4,6 @@ const controllerFactory = require("../controllers/memberships.controller");
4
4
  module.exports = function(app, db) {
5
5
  const controller = controllerFactory(db);
6
6
 
7
- app.use(function(req, res, next) {
8
- res.header(
9
- "Access-Control-Allow-Headers",
10
- "Access-Control-Allow-Origin",
11
- "x-access-token, Origin, Content-Type, Accept"
12
- );
13
- next();
14
- });
15
-
16
7
  app.get(
17
8
  "/api/memberships",
18
9
  controller.read
@@ -12,19 +12,6 @@ const controllerFactory = require("../controllers/organizations.controller");
12
12
  // Routes
13
13
  module.exports = function(app, db) {
14
14
  const controller = controllerFactory(db);
15
-
16
- app.use(function(req, res, next) {
17
- // res.header("Access-Control-Allow-Origin", clientUrl);
18
- // res.header("Access-Control-Allow-Credentials", "true");
19
- // res.header("Access-Control-Allow-Headers", "x-access-token, Origin, Content-Type, Accept");
20
- // next();
21
- res.header(
22
- "Access-Control-Allow-Headers",
23
- "Access-Control-Allow-Origin",
24
- "x-access-token, Origin, Content-Type, Accept"
25
- );
26
- next();
27
- });
28
15
 
29
16
  app.get("/api/organizations",
30
17
  controller.read
@@ -1,11 +1,6 @@
1
1
  const controller = require("../controllers/pages.controller");
2
2
 
3
3
  module.exports = function(app) {
4
- app.use(function(req, res, next) {
5
- res.header("Access-Control-Allow-Headers", "Access-Control-Allow-Origin: *", "x-access-token, Origin, Content-Type, Accept");
6
- next();
7
- });
8
-
9
4
  app.get(
10
5
  "/pages",
11
6
  controller.getAll
@@ -7,15 +7,6 @@ module.exports = function(app, db) {
7
7
  const controller = controllerFactory(db);
8
8
 
9
9
  const { verifyCategory } = middlewareFactory(db);
10
-
11
- app.use(function(req, res, next) {
12
- res.header(
13
- "Access-Control-Allow-Headers",
14
- "Access-Control-Allow-Origin",
15
- "x-access-token, Origin, Content-Type, Accept"
16
- );
17
- next();
18
- });
19
10
  // Get categorys
20
11
  app.get(
21
12
  "/categories",
@@ -2,11 +2,6 @@ const controllerFactory = require("../controllers/leftovers.controller");
2
2
 
3
3
  module.exports = function(app, db) {
4
4
  const controller = controllerFactory(db);
5
-
6
- app.use(function(req, res, next) {
7
- res.header("Access-Control-Allow-Headers", "Access-Control-Allow-Origin: *", "x-access-token, Origin, Content-Type, Accept");
8
- next();
9
- });
10
5
 
11
6
  app.get(
12
7
  "/leftovers",
@@ -3,14 +3,6 @@ const controllerFactory = require("../controllers/products.controller");
3
3
  module.exports = function(app, db, allowedOrigins) {
4
4
  const controller = controllerFactory(db);
5
5
 
6
- app.use(function(req, res, next) {
7
- res.header(
8
- "Access-Control-Allow-Headers",
9
- "Access-Control-Allow-Origin: *",
10
- "x-access-token, Origin, Content-Type, Accept"
11
- );
12
- next();
13
- });
14
6
  // (C) Create product
15
7
  app.post(
16
8
  "/api/products/create",
@@ -1,14 +1,6 @@
1
1
  const controller = require("../controllers/projects.controller");
2
2
 
3
3
  module.exports = function(app) {
4
- app.use(function(req, res, next) {
5
- res.header(
6
- "Access-Control-Allow-Headers",
7
- "Access-Control-Allow-Origin",
8
- "x-access-token, Origin, Content-Type, Accept"
9
- );
10
- next();
11
- });
12
4
  // Get project
13
5
  app.get(
14
6
  "/projects",
@@ -7,19 +7,6 @@ module.exports = function(app, db, origins) {
7
7
 
8
8
  const { authJwt } = middlewareFactoryGlobal(db);
9
9
 
10
- app.use(function(req, res, next) {
11
-
12
- const origin = req.headers.origin;
13
-
14
- if (origins.includes(origin)) {
15
- res.setHeader('Access-Control-Allow-Origin', origin);
16
- }
17
-
18
- res.header("Access-Control-Allow-Headers", "x-access-token, Origin, Content-Type, Accept");
19
-
20
- next();
21
- });
22
-
23
10
  app.get(
24
11
  "/reports",
25
12
  controller.read
@@ -4,15 +4,6 @@ const controllerFactory = require("../controllers/spots.controller");
4
4
  module.exports = function(app, db) {
5
5
  const controller = controllerFactory(db);
6
6
 
7
- app.use(function(req, res, next) {
8
- res.header(
9
- "Access-Control-Allow-Headers",
10
- "Access-Control-Allow-Origin",
11
- "x-access-token, Origin, Content-Type, Accept"
12
- );
13
- next();
14
- });
15
-
16
7
  // Get organization spots by _id
17
8
  app.get("/api/spots/:_id", controller.read);
18
9
 
@@ -3,19 +3,6 @@ const controllerFactory = require("../controllers/users.controller");
3
3
  // Routes
4
4
  module.exports = function(app, db, origins) {
5
5
  const controller = controllerFactory(db);
6
-
7
- app.use(function(req, res, next) {
8
-
9
- const origin = req.headers.origin;
10
- if (origins.includes(origin)) {
11
- res.setHeader('Access-Control-Allow-Origin', origin);
12
- }
13
-
14
- res.header("Access-Control-Allow-Headers", "x-access-token, Origin, Content-Type, Accept");
15
-
16
- next();
17
- });
18
-
19
6
  // Create a User
20
7
  app.post("/api/users", controller.create);
21
8
 
@@ -18,11 +18,6 @@ module.exports = function(app, db, origins, publicPath) {
18
18
 
19
19
  const { verifySignUp, verifyUser } = middlewareFactory(db);
20
20
 
21
- app.use(function(req, res, next) {
22
- res.header("Access-Control-Allow-Headers", "Access-Control-Allow-Origin: *", "x-access-token, Origin, Content-Type, Accept");
23
- next();
24
- });
25
-
26
21
 
27
22
  observer.subscribe('checkout.session.completed', async (paymentIntent) => {
28
23
  const event = await db.event.findOne({ _id: paymentIntent.metadata.product });