@goldstack/template-lambda-api 0.4.2 → 0.4.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@goldstack/template-lambda-api",
3
- "version": "0.4.2",
3
+ "version": "0.4.3",
4
4
  "description": "Companion for project templates for deploying Lambdas as a REST API",
5
5
  "keywords": [
6
6
  "goldstack",
@@ -2,7 +2,6 @@ import {
2
2
  LambdaConfig,
3
3
  generateFunctionName,
4
4
  } from '@goldstack/utils-aws-lambda';
5
- import { boolean } from 'yargs';
6
5
  import {
7
6
  LambdaRoutesConfig,
8
7
  LambdaApiDeployment,
@@ -12,12 +11,13 @@ export const generateLambdaConfig = (
12
11
  deployment: LambdaApiDeployment,
13
12
  config: LambdaConfig[]
14
13
  ): LambdaRoutesConfig => {
15
- return config.reduce((last, curr) => {
16
- last[curr.route] = {
14
+ return config.reduce((last, curr, index) => {
15
+ last[`${curr.route}${index}`] = {
17
16
  function_name: generateFunctionName(
18
17
  deployment.configuration.lambdaNamePrefix,
19
18
  curr
20
19
  ),
20
+ route: curr.route,
21
21
  };
22
22
  return last;
23
23
  }, {});
@@ -58,8 +58,6 @@ export const run = async (args: string[]): Promise<void> => {
58
58
  validateDeployment(e.configuration.lambdas);
59
59
  return e;
60
60
  });
61
- console.log('API CONFIG');
62
- console.log(JSON.stringify(config, null, 2));
63
61
  writePackageConfig(config);
64
62
 
65
63
  const command = argv._[0];
@@ -37,6 +37,7 @@ export type CorsHeader = string;
37
37
 
38
38
  export interface LambdaRouteConfig {
39
39
  function_name: string;
40
+ route: string;
40
41
  }
41
42
 
42
43
  export type LambdaRoutesConfig = {