Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
required: ['result', 'message'],
properties: {
result: { type: 'string' },
message: { type: 'string' }
}
}
},
required: ['body']
}
}
/* Export inputSchema & outputSchema for automatic documentation */
exports.schema = schema
exports.handler = middy(businessLogic)
.use(httpHeaderNormalizer())
// parses the request body when it's a JSON and converts it to an object
.use(jsonBodyParser())
// validates the input
.use(validator({ inputSchema: schema.input }))
// handles common http errors and returns proper responses
.use(httpErrorHandler())
const handlerBuilder = (aws) => {
return middy(new ErrorsGetHandler(aws))
.use(httpHeaderNormalizer())
.use(checkApiKey())
.use(httpErrorHandler())
.use(bodyStringifier())
.use(cors());
};
const handler = handlerBuilder(aws);
const handlerBuilder = (aws) => {
return middy(new ErrorsListHandler(aws))
.use(httpHeaderNormalizer())
.use(checkApiKey())
.use(httpErrorHandler())
.use(bodyStringifier())
.use(cors());
};
const handler = handlerBuilder(aws);
const handlerBuilder = (aws) => {
return middy(new OccurrencesGetHandler(aws))
.use(httpHeaderNormalizer())
.use(checkApiKey())
.use(httpErrorHandler())
.use(bodyStringifier())
.use(cors());
};
const handler = handlerBuilder(aws);
const handlerBuilder = (aws) => {
return middy(new EncryptHandler(aws))
.use(httpHeaderNormalizer())
.use(checkApiKey())
.use(checkKmsConfig())
.use(httpErrorHandler())
.use(bodyStringifier())
.use(cors());
};
const handler = handlerBuilder(aws);
const handlerBuilder = (aws) => {
return middy(new OccurrencesListHandler(aws))
.use(httpHeaderNormalizer())
.use(checkApiKey())
.use(httpErrorHandler())
.use(bodyStringifier())
.use(cors());
};
const handler = handlerBuilder(aws);
const handlerBuilder = (aws) => {
return middy(new ProjectsListHandler(aws))
.use(httpHeaderNormalizer())
.use(checkApiKey())
.use(httpErrorHandler())
.use(bodyStringifier())
.use(cors());
};
const handler = handlerBuilder(aws);