diff --git a/config/routes.js b/config/routes.js index 275bf31..edbe353 100644 --- a/config/routes.js +++ b/config/routes.js @@ -50,353 +50,112 @@ module.exports.routes = { // job 'GET /jobs': { controller: 'JobController', - action: 'find', - swagger: { - summary: 'List all Jobs', - description: 'List all Jobs' - } + action: 'find' }, 'POST /jobs': { controller: 'JobController', - action: 'create', - swagger: { - summary: 'Create a Job', - description: 'Create a Job', - schema: { - $ref: "#/definitions/job" - } - } + action: 'create' }, 'DELETE /jobs/:id': { controller: 'JobController', - action: 'destroy', - swagger: { - summary: 'Delete a Job', - description: 'Delete a Job' - } + action: 'destroy' }, 'GET /jobs/:id': { controller: 'JobController', - action: 'findOne', - swagger: { - summary: 'Get a Job', - description: 'Get a Job' - } + action: 'findOne' }, 'PUT /jobs/:id': { controller: 'JobController', - action: 'update', - swagger: { - summary: 'Update a Job', - description: 'Update a Job' - } + action: 'update' }, 'DELETE /jobs/:parentid/assets/:id': { controller: 'AssetController', - action: 'destroy', - swagger: { - summary: 'Delete an Asset', - description: 'Delete an Asset which belongs to a specific job', - tags: [ - 'Asset' - ] - } + action: 'destroy' }, 'GET /jobs/:parentid/assets/:id': { controller: 'AssetController', - action: 'findOne', - swagger: { - summary: 'Get an Asset', - description: 'Get an Asset which belongs to a specific job', - tags: [ - 'Asset' - ], - responses: { - 200: { - description: "The requested resource", - schema: { - $ref: "#/definitions/asset" - } - } - } - } + action: 'findOne' }, 'PUT /jobs/:parentid/assets/:id': { controller: 'AssetController', - action: 'update', - swagger: { - summary: 'Update an Asset', - description: 'Update an Asset which belongs to a specific job', - tags: [ - 'Asset' - ], - parameters: [ - { - name: 'id', - in: 'path', - required: true, - type: 'string' - }, - { - name: 'parentid', - in: 'path', - required: true, - type: 'string' - } - ] - } + action: 'update' }, 'GET /jobs/:parentid/assets': { controller: 'AssetController', - action: 'find', - swagger: { - summary: 'List all Assets', - description: 'List all Assets which belongs to a specific job', - tags: [ - 'Asset' - ], - responses: { - 200: { - description: "The requested resource", - schema: { - $ref: "#/definitions/asset" - } - } - } - } + action: 'find' }, 'POST /jobs/:parentid/assets/uploadfile': { controller: 'AssetController', - action: 'uploadFile', - swagger: { - summary: 'Upload an asset file and create an asset', - description: 'Upload an asset file and create an asset', - parameters: [ - { - "name": "parentid", - "in": "path", - "required": true, - "type": "string" - }, - { - "name": "sourceLanguage", - "in": "formData", - "type": "string" - }, - { - "name": "encoding", - "in": "formData", - "type": "string" - }, - { - "name": "asset", - "in": "formData", - "description": "The Asset file", - "required": true, - "type": "file" - }, - ], - responses: { - '200': { - schema: { - "$ref": "#/definitions/asset", - } - } - } - } + action: 'uploadFile' }, 'GET /jobs/:parentid/assets/:id/downloadfile': { controller: 'AssetController', - action: 'downloadFile', - swagger: { - summary: 'Download an asset file', - description: 'Download an asset file', - tags: [ - 'Asset' - ], - responses: { - 200: { - description: "The asset file", - schema: { - type: "file" - } - } - } - } + action: 'downloadFile' }, - // task - 'POST /tasks': { - controller: 'TaskController', - action: 'create', - swagger: { - summary: 'Create a Task', - description: `Creates a Task which will belong to a specific job.`, - tags: [ - 'Task' - ] - } - }, - 'GET /tasks': { - controller: 'TaskController', - action: 'find', - swagger: { - summary: 'List all Tasks', - description: 'List all Tasks' - } - }, - 'GET /tasks/:id': { - controller: 'TaskController', - action: 'findOne', - swagger: { - summary: 'Get a Task', - description: 'Gets a Task which belongs to a specific job', - tags: [ - 'Task' - ] - } - }, - 'PUT /tasks/:id': { - controller: 'TaskController', - action: 'update', - swagger: { - summary: 'Update a Task', - description: 'Updates a Task which belongs to a specific job', - tags: [ - 'Task' - ] - } - }, - 'DELETE /tasks/:id': { - controller: 'TaskController', - action: 'destroy', - swagger: { - summary: 'Delete a Task', - description: 'Deletes a Task which belongs to a specific job', - tags: [ - 'Task' - ] - } - }, - 'POST /tasks/:id/uploaddeliverable': { - controller: 'TaskController', - action: 'uploadFile', - swagger: { - summary: 'Upload deliverable file', - description: 'Upload deliverable file', - tags: [ - 'Task' - ], - parameters: [ - { - "name": "parentid", - "in": "path", - "required": true, - "type": "string" - }, - { - "name": "id", - "in": "path", - "required": true, - "type": "string" - }, - { - "name": "deliverable", - "in": "formData", - "description": "The deliverable file", - "required": true, - "type": "file" - }, - ], - responses: { - '200': { - schema: { - "$ref": "#/definitions/task", - } - } - } - } - }, - 'GET /tasks/:id/downloaddeliverable': { - controller: 'TaskController', - action: 'downloadFile', - swagger: { - summary: 'Download deliverable file', - description: 'Download deliverable file', - produces: [ - 'application/json' - ], - tags: [ - 'Task' - ], - responses: { - 200: { - description: "The deliverable file", - schema: { - type: "file" - } - } - } - } - }, + // task + 'POST /tasks': { + controller: 'TaskController', + action: 'create' + }, + 'GET /tasks': { + controller: 'TaskController', + action: 'find' + }, + 'GET /tasks/:id': { + controller: 'TaskController', + action: 'findOne' + }, + 'PUT /tasks/:id': { + controller: 'TaskController', + action: 'update' + }, + 'DELETE /tasks/:id': { + controller: 'TaskController', + action: 'destroy' + }, + 'POST /tasks/:id/uploaddeliverable': { + controller: 'TaskController', + action: 'uploadFile' + }, + 'GET /tasks/:id/downloaddeliverable': { + controller: 'TaskController', + action: 'downloadFile' + }, - // asset - 'GET /assets': { - controller: 'AssetController', - action: 'find', - swagger: { - summary: 'List all Assets', - description: 'List all Assets' - } - }, + // asset + 'GET /assets': { + controller: 'AssetController', + action: 'find' + }, - // webhook - 'GET /webhooks': { - controller: 'WebhookController', - action: 'find', - swagger: { - summary: 'List all Webhooks', - description: 'List all Webhooks' - } - }, - 'POST /webhooks': { - controller: 'WebhookController', - action: 'create', - swagger: { - summary: 'Create a Webhook', - description: 'Create a Webhook' - } - }, + // webhook + 'GET /webhooks': { + controller: 'WebhookController', + action: 'find' + }, + 'POST /webhooks': { + controller: 'WebhookController', + action: 'create' + }, - 'DELETE /webhooks/:id': { - controller: 'WebhookController', - action: 'destroy', - swagger: { - summary: 'Delete a Webhook', - description: 'Delete a Webhook' - } - }, - 'GET /webhooks/:id': { - controller: 'WebhookController', - action: 'findOne', - swagger: { - summary: 'Get a Webhook', - description: 'Get a Webhook' - } - }, - 'PUT /webhooks/:id': { - controller: 'WebhookController', - action: 'update', - swagger: { - summary: 'Update a Webhook', - description: 'Update a Webhook' - } - } + 'DELETE /webhooks/:id': { + controller: 'WebhookController', + action: 'destroy' + }, + 'GET /webhooks/:id': { + controller: 'WebhookController', + action: 'findOne' + }, + 'PUT /webhooks/:id': { + controller: 'WebhookController', + action: 'update' + } };