1
0
Fork 0
mirror of synced 2024-07-03 05:20:32 +12:00
budibase/packages/server/src/api/routes/workflow.js

21 lines
1,002 B
JavaScript
Raw Normal View History

2020-05-21 04:02:46 +12:00
const Router = require("@koa/router")
const controller = require("../controllers/workflow")
2020-05-28 04:23:01 +12:00
const authorized = require("../../middleware/authorized")
2020-06-02 08:26:32 +12:00
const { BUILDER } = require("../../utilities/accessLevels")
2020-05-21 04:02:46 +12:00
const router = Router()
router
.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-19 03:59:31 +12:00
.get("/api/workflows", authorized(BUILDER), controller.fetch)
2020-06-02 08:26:32 +12:00
.get("/api/workflows/:id", authorized(BUILDER), controller.find)
.get("/api/workflows/:id/:action", authorized(BUILDER), controller.fetchActionScript)
2020-06-19 03:59:31 +12:00
.put("/api/workflows", authorized(BUILDER), controller.update)
.post("/api/workflows", authorized(BUILDER), controller.create)
.post("/api/workflows/trigger", controller.trigger)
2020-06-19 03:59:31 +12:00
.delete("/api/workflows/:id/:rev", authorized(BUILDER), controller.destroy)
2020-05-21 04:02:46 +12:00
module.exports = router