2020-05-20 18:02:46 +02:00
|
|
|
const Router = require("@koa/router")
|
|
|
|
const controller = require("../controllers/workflow")
|
2020-05-27 18:23:01 +02:00
|
|
|
const authorized = require("../../middleware/authorized")
|
2020-06-01 22:26:32 +02:00
|
|
|
const { BUILDER } = require("../../utilities/accessLevels")
|
2020-05-20 18:02:46 +02:00
|
|
|
|
|
|
|
const router = Router()
|
|
|
|
|
|
|
|
router
|
2020-09-10 12:06:13 +02:00
|
|
|
.get("/api/workflows/trigger/list", authorized(BUILDER), controller.getTriggerList)
|
|
|
|
.get("/api/workflows/action/list", authorized(BUILDER), controller.getActionList)
|
|
|
|
.get("/api/workflows/logic/list", authorized(BUILDER), controller.getLogicList)
|
2020-06-18 17:59:31 +02:00
|
|
|
.get("/api/workflows", authorized(BUILDER), controller.fetch)
|
2020-06-01 22:26:32 +02:00
|
|
|
.get("/api/workflows/:id", authorized(BUILDER), controller.find)
|
2020-06-18 17:59:31 +02:00
|
|
|
.put("/api/workflows", authorized(BUILDER), controller.update)
|
|
|
|
.post("/api/workflows", authorized(BUILDER), controller.create)
|
2020-09-10 16:00:21 +02:00
|
|
|
.post("/api/workflows/:id/trigger", controller.trigger)
|
2020-06-18 17:59:31 +02:00
|
|
|
.delete("/api/workflows/:id/:rev", authorized(BUILDER), controller.destroy)
|
2020-05-20 18:02:46 +02:00
|
|
|
|
|
|
|
module.exports = router
|