lambda-serverless-api
Advanced tools
Comparing version 11.0.4 to 11.0.5
import assert from 'assert'; | ||
import Joi from 'joi-strict'; | ||
import { get } from 'stack-trace'; | ||
import * as apiGateway from './api-gateway.js'; | ||
@@ -55,5 +56,12 @@ import { VERSION_REGEX } from '../resources/format.js'; | ||
const trace = get(); | ||
const caller = [ | ||
trace[1].getFileName().split('?')[0], | ||
trace[1].getLineNumber(), | ||
trace[1].getColumnNumber() | ||
].join(':'); | ||
router.register(request.route, handlerFn); | ||
(() => { | ||
const resp = module.afterRegister({ request }); | ||
const resp = module.afterRegister({ request, caller }); | ||
assert(resp === null, 'Plugin should not return from afterRegister()'); | ||
@@ -60,0 +68,0 @@ })(); |
@@ -25,3 +25,3 @@ import get from 'lodash.get'; | ||
afterRegister({ request }) { | ||
afterRegister({ request, caller }) { | ||
const { params } = request; | ||
@@ -39,3 +39,3 @@ | ||
const routeSignature = request.route.split(/[\s/]/g).map((e) => e.replace(/^{.*?}$/, ':param')); | ||
this.routeSignatures.forEach((signature) => { | ||
this.routeSignatures.forEach(([signature, caller_]) => { | ||
if (routeSignature.length !== signature.length) { | ||
@@ -49,5 +49,8 @@ return; | ||
} | ||
throw new Error(`Path collision: ${request.route}`); | ||
if (caller_ === caller) { | ||
return; | ||
} | ||
throw new Error(`Path collision: ${request.route}\n${caller_} vs ${caller}`); | ||
}); | ||
this.routeSignatures.push(routeSignature); | ||
this.routeSignatures.push([routeSignature, caller]); | ||
} | ||
@@ -54,0 +57,0 @@ |
@@ -17,3 +17,3 @@ { | ||
"devDependencies": { | ||
"@aws-sdk/client-s3": "^3.387.0", | ||
"@aws-sdk/client-s3": "^3.388.0", | ||
"@babel/core": "7.22.10", | ||
@@ -23,3 +23,3 @@ "@babel/eslint-parser": "7.22.10", | ||
"@blackflux/eslint-plugin-rules": "3.0.1", | ||
"@blackflux/robo-config-plugin": "9.1.11", | ||
"@blackflux/robo-config-plugin": "9.1.13", | ||
"aws-sdk-wrap": "13.0.9", | ||
@@ -35,3 +35,3 @@ "c8": "8.0.1", | ||
"js-gardener": "5.0.2", | ||
"lambda-tdd": "6.3.6", | ||
"lambda-tdd": "6.3.7", | ||
"minimist": "1.2.8", | ||
@@ -44,3 +44,3 @@ "moment-timezone": "0.5.43", | ||
}, | ||
"version": "11.0.4", | ||
"version": "11.0.5", | ||
"scripts": { | ||
@@ -100,2 +100,3 @@ "clean": "rm -rf lib", | ||
"smart-fs": "4.0.1", | ||
"stack-trace": "1.0.0-pre2", | ||
"swagger-parser": "10.0.3", | ||
@@ -102,0 +103,0 @@ "turf-polygon": "1.0.3" |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
101475
2980
19
+ Addedstack-trace@1.0.0-pre2
+ Addedstack-trace@1.0.0-pre2(transitive)