Skip to content

Commit

Permalink
Merge branch 'master' into imc_profile_api
Browse files Browse the repository at this point in the history
  • Loading branch information
iamigo committed Aug 1, 2017
2 parents b56d08a + 71d339f commit a855365
Show file tree
Hide file tree
Showing 8 changed files with 1,010 additions and 0 deletions.
102 changes: 102 additions & 0 deletions api/v1/controllers/botActions.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
/**
* Copyright (c) 2017, salesforce.com, inc.
* All rights reserved.
* Licensed under the BSD 3-Clause license.
* For full license text, see LICENSE.txt file in the repo root or
* https://opensource.org/licenses/BSD-3-Clause
*/

/**
* api/v1/controllers/botActions.js
*/
'use strict';

const helper = require('../helpers/nouns/botActions');
const doDelete = require('../helpers/verbs/doDelete');
const doFind = require('../helpers/verbs/doFind');
const doGet = require('../helpers/verbs/doGet');
const doPatch = require('../helpers/verbs/doPatch');
const doPost = require('../helpers/verbs/doPost');
const doPut = require('../helpers/verbs/doPut');

module.exports = {

/**
* DELETE /botActions/{key}
*
* Deletes the botAction and sends it back in the response.
*
* @param {IncomingMessage} req - The request object
* @param {ServerResponse} res - The response object
* @param {Function} next - The next middleware function in the stack
*/
deleteBotActions(req, res, next) {
doDelete(req, res, next, helper);
},

/**
* GET /botActions
*
* Finds zero or more botActions and sends them back in the response.
*
* @param {IncomingMessage} req - The request object
* @param {ServerResponse} res - The response object
* @param {Function} next - The next middleware function in the stack
*/
findBotActions(req, res, next) {
doFind(req, res, next, helper);
},

/**
* GET /botActions/{key}
*
* Retrieves the botAction and sends it back in the response.
*
* @param {IncomingMessage} req - The request object
* @param {ServerResponse} res - The response object
* @param {Function} next - The next middleware function in the stack
*/
getBotAction(req, res, next) {
doGet(req, res, next, helper);
},

/**
* PATCH /botActions/{key}
*
* Update the specified botAction
*
* @param {IncomingMessage} req - The request object
* @param {ServerResponse} res - The response object
* @param {Function} next - The next middleware function in the stack
*/
patchBotAction(req, res, next) {
doPatch(req, res, next, helper);
},

/**
* POST /botActions
*
* Creates a new botAction and sends it back in the response.
*
* @param {IncomingMessage} req - The request object
* @param {ServerResponse} res - The response object
* @param {Function} next - The next middleware function in the stack
*/
postBotActions(req, res, next) {
doPost(req, res, next, helper);
},

/**
* PUT /botActions/{key}
*
* Overrides the botAction with that ID
*
* @param {IncomingMessage} req - The request object
* @param {ServerResponse} res - The response object
* @param {Function} next - The next middleware function in the stack
*/
putBotActions(req, res, next) {
doPut(req, res, next, helper);
},

}; // exports
27 changes: 27 additions & 0 deletions api/v1/helpers/nouns/botActions.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
/**
* Copyright (c) 2017, salesforce.com, inc.
* All rights reserved.
* Licensed under the BSD 3-Clause license.
* For full license text, see LICENSE.txt file in the repo root or
* https://opensource.org/licenses/BSD-3-Clause
*/

/**
* api/v1/helpers/nouns/botActions.js
*/

const BotActions = require('../../../../db/index').BotAction;

const m = 'BotActions';

module.exports = {
apiLinks: {
DELETE: `Delete ${m}`,
GET: `Retrieve ${m}`,
PATCH: `Update selected attributes of ${m}`,
POST: `Create a new ${m}`,
},
baseUrl: '/v1/botActions',
model: BotActions,
modelName: 'botActions',
}; // exports

0 comments on commit a855365

Please sign in to comment.