
Security News
High Salaries No Longer Enough to Attract Top Cybersecurity Talent
A survey of 500 cybersecurity pros reveals high pay isn't enough—lack of growth and flexibility is driving attrition and risking organizational security.
@everestate/serverless-router-dynamics
Advanced tools
Serverless Router plugin to handle Microsoft Dynamics Webhooks
Serverless Router plugin to handle Microsoft Dynamics Webhooks
npm install @everestate/serverless-router @everestate/serverless-router-dynamics --save
const Router = require('@everestate/serverless-router');
const Dynamics = require('@everestate/serverless-router-dynamics');
const leadService = require('../services/userService');
function dispatch(event) {
const router = new Router([Dynamics]);
router.dynamics
.create('lead', ({ id, entity }) => {
console.log(`Lead "${id} is created"`);
return leadService.create(id, entity); // returns promise
})
.update('lead', ({ id, entity }) => {
console.log(`Lead "${id} is updated"`);
return leadService.update(id, entity); // returns promise
})
.delete('lead', ({ id }) => {
console.log(`Lead "${id} is deleted"`);
return leadService.delete(id); // returns promise
})
.assign('lead', ({ id, entity }) => {
console.log(`New agent assigned to lead with "id: ${id}"`);
return leadService.assign(id, entity); // returns promise
});
router.mismatch(() => {
const {
'x-ms-dynamics-request-name': requestName,
'x-ms-dynamics-entity-name': entityName,
} = event.headers;
return Promise.reject(new Error(`Unknown route: ${requestName} ${entityName}`));
});
return router.dispatch(event);
}
function myLambdaHandler(event, context, callback) {
return dispatch(event)
.then(result =>
callback(null, { statusCode: result.code, body: JSON.stringify({ payload: result.payload }) }))
.catch(error =>
callback(null, { statusCode: '500', body: JSON.stringify({ message: error.message }) }));
}
By default serveless-router
will throw error
on route mismatch.
It's possible to define custom behaviour on mismatch.
FAQs
Serverless Router plugin to handle Microsoft Dynamics Webhooks
We found that @everestate/serverless-router-dynamics demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 3 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
A survey of 500 cybersecurity pros reveals high pay isn't enough—lack of growth and flexibility is driving attrition and risking organizational security.
Product
Socket, the leader in open source security, is now available on Google Cloud Marketplace for simplified procurement and enhanced protection against supply chain attacks.
Security News
Corepack will be phased out from future Node.js releases following a TSC vote.