mirror of https://github.com/Budibase/budibase.git
11 changed files with 650 additions and 68 deletions
@ -0,0 +1,7 @@ |
|||
exports.ApiKeyAuth = { |
|||
type: "apiKey", |
|||
in: "header", |
|||
name: "x-budibase-api-key", |
|||
description: |
|||
"Your individual API key, this will provide access based on the configured RBAC settings of your user.", |
|||
} |
|||
@ -1,8 +1,3 @@ |
|||
/* |
|||
* Contains pass through functions for all of the public API, make sure |
|||
* parameters are in correct format for the main controllers. |
|||
*/ |
|||
|
|||
exports.search = () => { |
|||
|
|||
} |
|||
@ -0,0 +1,19 @@ |
|||
exports.create = () => { |
|||
|
|||
} |
|||
|
|||
exports.getAllTables = () => { |
|||
|
|||
} |
|||
|
|||
exports.getSingleTable = () => { |
|||
|
|||
} |
|||
|
|||
exports.update = () => { |
|||
|
|||
} |
|||
|
|||
exports.delete = () => { |
|||
|
|||
} |
|||
@ -1,5 +1,117 @@ |
|||
const Router = require("@koa/router") |
|||
const controller = require("../../controllers/public/tables") |
|||
|
|||
const router = Router() |
|||
/** |
|||
* @openapi |
|||
* /tables: |
|||
* post: |
|||
* summary: Create a new table |
|||
* tags: |
|||
* - tables |
|||
* responses: |
|||
* 200: |
|||
* description: Returns the created table, including the ID which has been generated for it. |
|||
* content: |
|||
* application/json: |
|||
* schema: |
|||
* type: object |
|||
* examples: |
|||
* row: |
|||
* $ref: '#/components/examples/table' |
|||
*/ |
|||
router.post("/tables", controller.create) |
|||
|
|||
/** |
|||
* @openapi |
|||
* /tables/:tableId: |
|||
* put: |
|||
* summary: Update a single row within a specified table. |
|||
* tags: |
|||
* - tables |
|||
* parameters: |
|||
* - $ref: '#/components/parameters/tableId' |
|||
* - $ref: '#/components/parameters/rowId' |
|||
* responses: |
|||
* 200: |
|||
* description: Returns the created row, including the ID which has been generated for it. |
|||
* content: |
|||
* application/json: |
|||
* schema: |
|||
* type: object |
|||
* examples: |
|||
* row: |
|||
* $ref: '#/components/examples/row' |
|||
*/ |
|||
router.put("/tables/:tableId", controller.update) |
|||
|
|||
/** |
|||
* @openapi |
|||
* /tables: |
|||
* get: |
|||
* summary: Update a single row within a specified table. |
|||
* tags: |
|||
* - tables |
|||
* parameters: |
|||
* - $ref: '#/components/parameters/tableId' |
|||
* - $ref: '#/components/parameters/rowId' |
|||
* responses: |
|||
* 200: |
|||
* description: Returns the created row, including the ID which has been generated for it. |
|||
* content: |
|||
* application/json: |
|||
* schema: |
|||
* type: object |
|||
* examples: |
|||
* row: |
|||
* $ref: '#/components/examples/row' |
|||
*/ |
|||
router.get("/tables", controller.getAllTables) |
|||
|
|||
/** |
|||
* @openapi |
|||
* /tables/{tableId}/rows/{rowId}: |
|||
* put: |
|||
* summary: Update a single row within a specified table. |
|||
* tags: |
|||
* - rows |
|||
* parameters: |
|||
* - $ref: '#/components/parameters/tableId' |
|||
* - $ref: '#/components/parameters/rowId' |
|||
* responses: |
|||
* 200: |
|||
* description: Returns the created row, including the ID which has been generated for it. |
|||
* content: |
|||
* application/json: |
|||
* schema: |
|||
* type: object |
|||
* examples: |
|||
* row: |
|||
* $ref: '#/components/examples/row' |
|||
*/ |
|||
router.get("/tables/:tableId", controller.getSingleTable) |
|||
|
|||
/** |
|||
* @openapi |
|||
* /tables/{tableId}/rows/{rowId}: |
|||
* put: |
|||
* summary: Update a single row within a specified table. |
|||
* tags: |
|||
* - rows |
|||
* parameters: |
|||
* - $ref: '#/components/parameters/tableId' |
|||
* - $ref: '#/components/parameters/rowId' |
|||
* responses: |
|||
* 200: |
|||
* description: Returns the created row, including the ID which has been generated for it. |
|||
* content: |
|||
* application/json: |
|||
* schema: |
|||
* type: object |
|||
* examples: |
|||
* row: |
|||
* $ref: '#/components/examples/row' |
|||
*/ |
|||
router.delete("/tables/:tableId", controller.delete) |
|||
|
|||
module.exports = router |
|||
|
|||
Loading…
Reference in new issue