2020-05-07 11:53:34 +02:00
|
|
|
const Router = require("@koa/router")
|
|
|
|
const controller = require("../controllers/application")
|
2020-05-21 15:31:23 +02:00
|
|
|
const authorized = require("../../middleware/authorized")
|
2020-11-11 18:34:15 +01:00
|
|
|
const { BUILDER } = require("../../utilities/security/permissions")
|
2020-04-07 18:25:09 +02:00
|
|
|
|
2020-05-07 11:53:34 +02:00
|
|
|
const router = Router()
|
2020-04-07 18:25:09 +02:00
|
|
|
|
2020-04-08 12:18:30 +02:00
|
|
|
router
|
2020-11-18 19:24:12 +01:00
|
|
|
.get("/api/:appId/definition", controller.fetchAppDefinition)
|
2020-05-21 15:31:23 +02:00
|
|
|
.get("/api/applications", authorized(BUILDER), controller.fetch)
|
|
|
|
.get(
|
2020-10-29 11:28:27 +01:00
|
|
|
"/api/:appId/appPackage",
|
2020-05-21 15:31:23 +02:00
|
|
|
authorized(BUILDER),
|
|
|
|
controller.fetchAppPackage
|
|
|
|
)
|
2020-10-29 11:28:27 +01:00
|
|
|
.put("/api/:appId", authorized(BUILDER), controller.update)
|
2020-05-21 15:31:23 +02:00
|
|
|
.post("/api/applications", authorized(BUILDER), controller.create)
|
2020-10-29 11:28:27 +01:00
|
|
|
.delete("/api/:appId", authorized(BUILDER), controller.delete)
|
2020-04-07 18:25:09 +02:00
|
|
|
|
2020-05-07 11:53:34 +02:00
|
|
|
module.exports = router
|