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

@serverless/aws-api-gateway

Package Overview
Dependencies
Maintainers
5
Versions
23
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@serverless/aws-api-gateway - npm Package Compare versions

Comparing version 1.2.0 to 2.0.0

5

package.json
{
"name": "@serverless/aws-api-gateway",
"version": "1.2.0",
"version": "2.0.0",
"main": "./serverless.js",

@@ -16,3 +16,4 @@ "publishConfig": {

"@serverless/core": "^1.0.0",
"aws-sdk": "^2.0.0"
"aws-sdk": "^2.0.0",
"p-retry": "^4.1.0"
},

@@ -19,0 +20,0 @@ "devDependencies": {

@@ -17,3 +17,4 @@ const AWS = require('aws-sdk')

removeResources,
removeOutdatedEndpoints
removeOutdatedEndpoints,
retry
} = require('./utils')

@@ -111,3 +112,3 @@

await createDeployment({ apig, apiId, stage })
await retry(() => createDeployment({ apig, apiId, stage }))

@@ -114,0 +115,0 @@ config.url = `https://${apiId}.execute-api.${region}.amazonaws.com/${stage}`

22

utils.js

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

const pRetry = require('p-retry')
const { utils } = require('@serverless/core')
const retry = (fn, opts = {}) => {
return pRetry(fn, {
retries: 5,
minTimeout: 1000,
factor: 2,
onFailedAttempt: (error) => {
if (error.code !== 'TooManyRequestsException') {
throw error
}
},
...opts
})
}
const apiExists = async ({ apig, apiId }) => {

@@ -52,3 +67,3 @@ try {

const endpointExists = async ({ apig, apiId, endpoint }) => {
const resourceId = await getPathId({ apig, apiId, endpoint })
const resourceId = await retry(() => getPathId({ apig, apiId, endpoint }))

@@ -66,3 +81,3 @@ if (!resourceId) {

try {
await apig.getMethod(params).promise()
await retry(() => apig.getMethod(params).promise())
return true

@@ -550,3 +565,4 @@ } catch (e) {

removeApi,
removeOutdatedEndpoints
removeOutdatedEndpoints,
retry
}
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