From 4591e0283c30a0fe4f1c3a17428ad17232432daf Mon Sep 17 00:00:00 2001 From: Daniel Nalborczyk Date: Sun, 22 Sep 2019 21:23:55 -0400 Subject: [PATCH] Rename api-gateway folder to http --- __tests__/old-unit/LambdaProxyIntegrationEventTest.js | 2 +- __tests__/old-unit/authCanExecuteResourceTest.js | 2 +- __tests__/old-unit/authFunctionNameExtractorTest.js | 2 +- __tests__/old-unit/authMatchPolicyResourceTest.js | 2 +- __tests__/old-unit/velocityContextTest.js | 2 +- rollup.config.js | 2 +- src/ServerlessOffline.js | 4 +--- src/events/{api-gateway => http}/ApiGateway.js | 0 src/events/{api-gateway => http}/Endpoint.js | 0 src/events/{api-gateway => http}/HttpServer.js | 0 src/events/{api-gateway => http}/OfflineEndpoint.js | 0 src/events/{api-gateway => http}/authCanExecuteResource.js | 0 src/events/{api-gateway => http}/authFunctionNameExtractor.js | 0 src/events/{api-gateway => http}/authMatchPolicyResource.js | 0 src/events/{api-gateway => http}/createAuthScheme.js | 0 src/events/{api-gateway => http}/http-routes/index.js | 0 .../http-routes/invoke/InvokeController.js | 0 src/events/{api-gateway => http}/http-routes/invoke/index.js | 0 .../{api-gateway => http}/http-routes/invoke/invokeRoute.js | 0 src/events/{api-gateway => http}/index.js | 0 src/events/{api-gateway => http}/javaHelpers.js | 0 .../lambda-events/LambdaIntegrationEvent.js | 0 .../lambda-events/LambdaProxyIntegrationEvent.js | 0 .../{api-gateway => http}/lambda-events/VelocityContext.js | 0 src/events/{api-gateway => http}/lambda-events/index.js | 0 .../lambda-events/renderVelocityTemplateObject.js | 0 src/events/{api-gateway => http}/parseResources.js | 0 .../{api-gateway => http}/templates/offline-default.req.vm | 0 .../{api-gateway => http}/templates/offline-default.res.vm | 0 29 files changed, 7 insertions(+), 9 deletions(-) rename src/events/{api-gateway => http}/ApiGateway.js (100%) rename src/events/{api-gateway => http}/Endpoint.js (100%) rename src/events/{api-gateway => http}/HttpServer.js (100%) rename src/events/{api-gateway => http}/OfflineEndpoint.js (100%) rename src/events/{api-gateway => http}/authCanExecuteResource.js (100%) rename src/events/{api-gateway => http}/authFunctionNameExtractor.js (100%) rename src/events/{api-gateway => http}/authMatchPolicyResource.js (100%) rename src/events/{api-gateway => http}/createAuthScheme.js (100%) rename src/events/{api-gateway => http}/http-routes/index.js (100%) rename src/events/{api-gateway => http}/http-routes/invoke/InvokeController.js (100%) rename src/events/{api-gateway => http}/http-routes/invoke/index.js (100%) rename src/events/{api-gateway => http}/http-routes/invoke/invokeRoute.js (100%) rename src/events/{api-gateway => http}/index.js (100%) rename src/events/{api-gateway => http}/javaHelpers.js (100%) rename src/events/{api-gateway => http}/lambda-events/LambdaIntegrationEvent.js (100%) rename src/events/{api-gateway => http}/lambda-events/LambdaProxyIntegrationEvent.js (100%) rename src/events/{api-gateway => http}/lambda-events/VelocityContext.js (100%) rename src/events/{api-gateway => http}/lambda-events/index.js (100%) rename src/events/{api-gateway => http}/lambda-events/renderVelocityTemplateObject.js (100%) rename src/events/{api-gateway => http}/parseResources.js (100%) rename src/events/{api-gateway => http}/templates/offline-default.req.vm (100%) rename src/events/{api-gateway => http}/templates/offline-default.res.vm (100%) diff --git a/__tests__/old-unit/LambdaProxyIntegrationEventTest.js b/__tests__/old-unit/LambdaProxyIntegrationEventTest.js index 1ff54150f..07f094c93 100644 --- a/__tests__/old-unit/LambdaProxyIntegrationEventTest.js +++ b/__tests__/old-unit/LambdaProxyIntegrationEventTest.js @@ -1,5 +1,5 @@ import RequestBuilder from './support/RequestBuilder.js' -import LambdaProxyIntegrationEvent from '../../src/events/api-gateway/lambda-events/LambdaProxyIntegrationEvent.js' +import LambdaProxyIntegrationEvent from '../../src/events/http/lambda-events/LambdaProxyIntegrationEvent.js' const { isArray } = Array const { keys } = Object diff --git a/__tests__/old-unit/authCanExecuteResourceTest.js b/__tests__/old-unit/authCanExecuteResourceTest.js index 8346b199f..824c9bd98 100644 --- a/__tests__/old-unit/authCanExecuteResourceTest.js +++ b/__tests__/old-unit/authCanExecuteResourceTest.js @@ -1,4 +1,4 @@ -import authCanExecuteResource from '../../src/events/api-gateway/authCanExecuteResource.js' +import authCanExecuteResource from '../../src/events/http/authCanExecuteResource.js' describe('authCanExecuteResource', () => { describe('when the policy has one Statement in an array', () => { diff --git a/__tests__/old-unit/authFunctionNameExtractorTest.js b/__tests__/old-unit/authFunctionNameExtractorTest.js index 057b2295f..f1621cd90 100644 --- a/__tests__/old-unit/authFunctionNameExtractorTest.js +++ b/__tests__/old-unit/authFunctionNameExtractorTest.js @@ -1,4 +1,4 @@ -import authFunctionNameExtractor from '../../src/events/api-gateway/authFunctionNameExtractor.js' +import authFunctionNameExtractor from '../../src/events/http/authFunctionNameExtractor.js' describe('authFunctionNameExtractor', () => { const dummyLogging = (arrayStore) => (message) => { diff --git a/__tests__/old-unit/authMatchPolicyResourceTest.js b/__tests__/old-unit/authMatchPolicyResourceTest.js index 11747fd2e..128ba09c4 100644 --- a/__tests__/old-unit/authMatchPolicyResourceTest.js +++ b/__tests__/old-unit/authMatchPolicyResourceTest.js @@ -1,4 +1,4 @@ -import authMatchPolicyResource from '../../src/events/api-gateway/authMatchPolicyResource.js' +import authMatchPolicyResource from '../../src/events/http/authMatchPolicyResource.js' describe('authMatchPolicyResource', () => { describe('when resource has no wildcards', () => { diff --git a/__tests__/old-unit/velocityContextTest.js b/__tests__/old-unit/velocityContextTest.js index ff0584710..da50781a9 100644 --- a/__tests__/old-unit/velocityContextTest.js +++ b/__tests__/old-unit/velocityContextTest.js @@ -1,4 +1,4 @@ -import VelocityContext from '../../src/events/api-gateway/lambda-events/VelocityContext.js' +import VelocityContext from '../../src/events/http/lambda-events/VelocityContext.js' describe('#urlDecode', () => { test('should decode url query parameters', () => { diff --git a/rollup.config.js b/rollup.config.js index 418156a1d..b0be103e8 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -63,7 +63,7 @@ export default [ rollupPluginCopy({ targets: [ { - src: 'src/events/api-gateway/templates/*.vm', + src: 'src/events/http/templates/*.vm', dest: 'dist/templates', }, { src: 'src/lambda/handler-runner/*.{py,rb}', dest: 'dist' }, diff --git a/src/ServerlessOffline.js b/src/ServerlessOffline.js index e4f209ac5..3a5be2427 100644 --- a/src/ServerlessOffline.js +++ b/src/ServerlessOffline.js @@ -125,9 +125,7 @@ export default class ServerlessOffline { } async _createApiGateway() { - const { default: ApiGateway } = await import( - './events/api-gateway/index.js' - ) + const { default: ApiGateway } = await import('./events/http/index.js') this._apiGateway = new ApiGateway( this._service, diff --git a/src/events/api-gateway/ApiGateway.js b/src/events/http/ApiGateway.js similarity index 100% rename from src/events/api-gateway/ApiGateway.js rename to src/events/http/ApiGateway.js diff --git a/src/events/api-gateway/Endpoint.js b/src/events/http/Endpoint.js similarity index 100% rename from src/events/api-gateway/Endpoint.js rename to src/events/http/Endpoint.js diff --git a/src/events/api-gateway/HttpServer.js b/src/events/http/HttpServer.js similarity index 100% rename from src/events/api-gateway/HttpServer.js rename to src/events/http/HttpServer.js diff --git a/src/events/api-gateway/OfflineEndpoint.js b/src/events/http/OfflineEndpoint.js similarity index 100% rename from src/events/api-gateway/OfflineEndpoint.js rename to src/events/http/OfflineEndpoint.js diff --git a/src/events/api-gateway/authCanExecuteResource.js b/src/events/http/authCanExecuteResource.js similarity index 100% rename from src/events/api-gateway/authCanExecuteResource.js rename to src/events/http/authCanExecuteResource.js diff --git a/src/events/api-gateway/authFunctionNameExtractor.js b/src/events/http/authFunctionNameExtractor.js similarity index 100% rename from src/events/api-gateway/authFunctionNameExtractor.js rename to src/events/http/authFunctionNameExtractor.js diff --git a/src/events/api-gateway/authMatchPolicyResource.js b/src/events/http/authMatchPolicyResource.js similarity index 100% rename from src/events/api-gateway/authMatchPolicyResource.js rename to src/events/http/authMatchPolicyResource.js diff --git a/src/events/api-gateway/createAuthScheme.js b/src/events/http/createAuthScheme.js similarity index 100% rename from src/events/api-gateway/createAuthScheme.js rename to src/events/http/createAuthScheme.js diff --git a/src/events/api-gateway/http-routes/index.js b/src/events/http/http-routes/index.js similarity index 100% rename from src/events/api-gateway/http-routes/index.js rename to src/events/http/http-routes/index.js diff --git a/src/events/api-gateway/http-routes/invoke/InvokeController.js b/src/events/http/http-routes/invoke/InvokeController.js similarity index 100% rename from src/events/api-gateway/http-routes/invoke/InvokeController.js rename to src/events/http/http-routes/invoke/InvokeController.js diff --git a/src/events/api-gateway/http-routes/invoke/index.js b/src/events/http/http-routes/invoke/index.js similarity index 100% rename from src/events/api-gateway/http-routes/invoke/index.js rename to src/events/http/http-routes/invoke/index.js diff --git a/src/events/api-gateway/http-routes/invoke/invokeRoute.js b/src/events/http/http-routes/invoke/invokeRoute.js similarity index 100% rename from src/events/api-gateway/http-routes/invoke/invokeRoute.js rename to src/events/http/http-routes/invoke/invokeRoute.js diff --git a/src/events/api-gateway/index.js b/src/events/http/index.js similarity index 100% rename from src/events/api-gateway/index.js rename to src/events/http/index.js diff --git a/src/events/api-gateway/javaHelpers.js b/src/events/http/javaHelpers.js similarity index 100% rename from src/events/api-gateway/javaHelpers.js rename to src/events/http/javaHelpers.js diff --git a/src/events/api-gateway/lambda-events/LambdaIntegrationEvent.js b/src/events/http/lambda-events/LambdaIntegrationEvent.js similarity index 100% rename from src/events/api-gateway/lambda-events/LambdaIntegrationEvent.js rename to src/events/http/lambda-events/LambdaIntegrationEvent.js diff --git a/src/events/api-gateway/lambda-events/LambdaProxyIntegrationEvent.js b/src/events/http/lambda-events/LambdaProxyIntegrationEvent.js similarity index 100% rename from src/events/api-gateway/lambda-events/LambdaProxyIntegrationEvent.js rename to src/events/http/lambda-events/LambdaProxyIntegrationEvent.js diff --git a/src/events/api-gateway/lambda-events/VelocityContext.js b/src/events/http/lambda-events/VelocityContext.js similarity index 100% rename from src/events/api-gateway/lambda-events/VelocityContext.js rename to src/events/http/lambda-events/VelocityContext.js diff --git a/src/events/api-gateway/lambda-events/index.js b/src/events/http/lambda-events/index.js similarity index 100% rename from src/events/api-gateway/lambda-events/index.js rename to src/events/http/lambda-events/index.js diff --git a/src/events/api-gateway/lambda-events/renderVelocityTemplateObject.js b/src/events/http/lambda-events/renderVelocityTemplateObject.js similarity index 100% rename from src/events/api-gateway/lambda-events/renderVelocityTemplateObject.js rename to src/events/http/lambda-events/renderVelocityTemplateObject.js diff --git a/src/events/api-gateway/parseResources.js b/src/events/http/parseResources.js similarity index 100% rename from src/events/api-gateway/parseResources.js rename to src/events/http/parseResources.js diff --git a/src/events/api-gateway/templates/offline-default.req.vm b/src/events/http/templates/offline-default.req.vm similarity index 100% rename from src/events/api-gateway/templates/offline-default.req.vm rename to src/events/http/templates/offline-default.req.vm diff --git a/src/events/api-gateway/templates/offline-default.res.vm b/src/events/http/templates/offline-default.res.vm similarity index 100% rename from src/events/api-gateway/templates/offline-default.res.vm rename to src/events/http/templates/offline-default.res.vm