Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

serverless-api-gateway-caching

Package Overview
Dependencies
Maintainers
1
Versions
80
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

serverless-api-gateway-caching - npm Package Compare versions

Comparing version 1.1.5 to 1.1.6

2

package.json
{
"name": "serverless-api-gateway-caching",
"version": "1.1.5",
"version": "1.1.6",
"description": "A plugin for the serverless framework which helps with configuring caching for API Gateway endpoints.",

@@ -5,0 +5,0 @@ "main": "src/apiGatewayCachingPlugin.js",

@@ -6,3 +6,3 @@ 'use strict';

const updateStageCacheSettings = require('./stageCache');
const { outputRestApiIdTo } = require('./restApiId');
const { restApiExists, outputRestApiIdTo } = require('./restApiId');

@@ -26,3 +26,3 @@ class ApiGatewayCachingPlugin {

updateCloudFormationTemplate() {
this.thereIsARestApi = this.restApiExists();
this.thereIsARestApi = restApiExists(this.serverless);
if (!this.thereIsARestApi) {

@@ -50,12 +50,4 @@ this.serverless.cli.log(`[serverless-api-gateway-caching] No Rest API found. Caching settings will not be updated.`);

}
restApiExists() {
let resource = this.serverless.service.provider.compiledCloudFormationTemplate.Resources['ApiGatewayRestApi'];
if (resource) {
return true;
}
return false;
}
}
module.exports = ApiGatewayCachingPlugin;

@@ -6,4 +6,20 @@ 'use strict';

const getConfiguredRestApiId = (serverless) => {
return get(serverless, 'service.provider.apiGateway.restApiId')
}
const restApiExists = (serverless) => {
const configuredRestApiId = getConfiguredRestApiId(serverless);
if (configuredRestApiId) {
return true;
}
const resource = serverless.service.provider.compiledCloudFormationTemplate.Resources['ApiGatewayRestApi'];
if (resource) {
return true;
}
return false;
}
const outputRestApiIdTo = (serverless) => {
const configuredRestApiId = get(serverless, 'service.provider.apiGateway.restApiId');
const configuredRestApiId = getConfiguredRestApiId(serverless);
const autoGeneratedRestApiId = { Ref: 'ApiGatewayRestApi' };

@@ -31,4 +47,5 @@

module.exports = {
restApiExists,
outputRestApiIdTo,
retrieveRestApiId
};
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