@goldstack/template-lambda-api 0.4.3 → 0.4.7

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.3",
3
+ "version": "0.4.7",
4
4
  "description": "Companion for project templates for deploying Lambdas as a REST API",
5
5
  "keywords": [
6
6
  "goldstack",
@@ -46,19 +46,19 @@
46
46
  },
47
47
  "dependencies": {
48
48
  "@goldstack/infra": "0.3.24",
49
- "@goldstack/infra-aws": "0.3.29",
50
- "@goldstack/utils-aws-lambda": "0.1.6",
49
+ "@goldstack/infra-aws": "0.3.31",
50
+ "@goldstack/utils-aws-lambda": "0.1.10",
51
51
  "@goldstack/utils-cli": "0.2.8",
52
52
  "@goldstack/utils-config": "0.3.23",
53
- "@goldstack/utils-docker": "0.3.25",
53
+ "@goldstack/utils-docker": "0.3.27",
54
54
  "@goldstack/utils-log": "0.2.9",
55
- "@goldstack/utils-package": "0.3.24",
56
- "@goldstack/utils-package-config": "0.3.24",
57
- "@goldstack/utils-s3-deployment": "0.3.36",
55
+ "@goldstack/utils-package": "0.3.26",
56
+ "@goldstack/utils-package-config": "0.3.26",
57
+ "@goldstack/utils-s3-deployment": "0.3.40",
58
58
  "@goldstack/utils-sh": "0.4.22",
59
59
  "@goldstack/utils-template": "0.3.24",
60
- "@goldstack/utils-terraform": "0.3.37",
61
- "@goldstack/utils-terraform-aws": "0.3.37",
60
+ "@goldstack/utils-terraform": "0.3.42",
61
+ "@goldstack/utils-terraform-aws": "0.3.41",
62
62
  "@yarnpkg/esbuild-plugin-pnp": "^2.0.0-rc.1",
63
63
  "archiver": "^5.0.0",
64
64
  "esbuild": "^0.14.5",
@@ -59,10 +59,14 @@
59
59
  "properties": {
60
60
  "function_name": {
61
61
  "type": "string"
62
+ },
63
+ "route": {
64
+ "type": "string"
62
65
  }
63
66
  },
64
67
  "required": [
65
- "function_name"
68
+ "function_name",
69
+ "route"
66
70
  ],
67
71
  "additionalProperties": false
68
72
  }
@@ -94,10 +94,14 @@
94
94
  "properties": {
95
95
  "function_name": {
96
96
  "type": "string"
97
+ },
98
+ "route": {
99
+ "type": "string"
97
100
  }
98
101
  },
99
102
  "required": [
100
- "function_name"
103
+ "function_name",
104
+ "route"
101
105
  ],
102
106
  "additionalProperties": false
103
107
  },
@@ -162,10 +162,14 @@
162
162
  "properties": {
163
163
  "function_name": {
164
164
  "type": "string"
165
+ },
166
+ "route": {
167
+ "type": "string"
165
168
  }
166
169
  },
167
170
  "required": [
168
- "function_name"
171
+ "function_name",
172
+ "route"
169
173
  ],
170
174
  "additionalProperties": false
171
175
  },
@@ -23,7 +23,7 @@ describe('Generate Lambda config', () => {
23
23
  const routesConfig = readLambdaConfig('./testData');
24
24
  const config = generateLambdaConfig(dummyDeployment, routesConfig);
25
25
  test('Should render config for Terraform', () => {
26
- assert(config['$default'].function_name);
26
+ assert(config['default'].function_name);
27
27
  assert(
28
28
  config['ANY /folder/nested'].function_name.indexOf(
29
29
  dummyDeployment.configuration.lambdaNamePrefix || 'fail'
@@ -11,8 +11,12 @@ export const generateLambdaConfig = (
11
11
  deployment: LambdaApiDeployment,
12
12
  config: LambdaConfig[]
13
13
  ): LambdaRoutesConfig => {
14
- return config.reduce((last, curr, index) => {
15
- last[`${curr.route}${index}`] = {
14
+ return config.reduce((last, curr) => {
15
+ let id = curr.route;
16
+ if (id === '$default') {
17
+ id = 'default';
18
+ }
19
+ last[`${id}`] = {
16
20
  function_name: generateFunctionName(
17
21
  deployment.configuration.lambdaNamePrefix,
18
22
  curr