New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

claudia-api-builder

Package Overview
Dependencies
Maintainers
1
Versions
38
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

claudia-api-builder - npm Package Compare versions

Comparing version 1.3.1 to 1.4.0

ISSUE_TEMPLATE.md

2

package.json
{
"name": "claudia-api-builder",
"version": "1.3.1",
"version": "1.4.0",
"description": "Simplify AWS ApiGateway handling",

@@ -5,0 +5,0 @@ "license": "MIT",

@@ -1,3 +0,3 @@

/*global module */
module.exports = function ApiBuilder() {
/*global module, require */
module.exports = function ApiBuilder(components) {
'use strict';

@@ -10,2 +10,4 @@ var self = this,

customCorsHeaders,
unsupportedEventCallback,
prompter = (components && components.prompter) || require('../ask'),
isApiResponse = function (obj) {

@@ -88,2 +90,5 @@ return obj && (typeof obj === 'object') && (Object.getPrototypeOf(obj) === self.ApiResponse.prototype);

};
self.unsupportedEvent = function (callback) {
unsupportedEventCallback = callback;
};
self.router = function (event, context) {

@@ -117,3 +122,7 @@ var handler, result, path;

} else {
context.done('event must contain context.path and context.method');
if (unsupportedEventCallback) {
unsupportedEventCallback.apply(this, arguments);
} else {
context.done('event must contain context.path and context.method');
}
}

@@ -133,2 +142,32 @@ };

};
self.addPostDeployConfig = function (stageVarName, prompt, configOption) {
self.addPostDeployStep(stageVarName, function (options, lambdaDetails, utils) {
var configureDeployment = function (varValue) {
var result = {
restApiId: lambdaDetails.apiId,
stageName: lambdaDetails.alias,
variables: { }
};
result.variables[stageVarName] = varValue;
return result;
},
deployStageVar = function (deployment) {
return utils.apiGatewayPromise.createDeploymentPromise(deployment).then(function () {
return deployment.variables[stageVarName];
});
},
getVariable = function () {
if (typeof options[configOption] === 'string') {
return utils.Promise.resolve(options[configOption]);
} else {
return prompter(prompt, utils.Promise);
}
};
if (options[configOption]) {
return getVariable()
.then(configureDeployment)
.then(deployStageVar);
}
});
};
self.postDeploy = function (options, lambdaDetails, utils) {

@@ -135,0 +174,0 @@ var steps = Object.keys(postDeploySteps),

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc