@goldstack/template-lambda-api 0.4.40 → 0.4.43
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/dist/src/templateLambdaApi.d.ts +0 -1
- package/dist/src/templateLambdaApi.d.ts.map +1 -1
- package/dist/src/templateLambdaApi.js +0 -66
- package/dist/src/templateLambdaApi.js.map +1 -1
- package/package.json +9 -28
- package/bin/template +0 -12
- package/bin/template.ts +0 -6
- package/dist/src/generateLambdaConfig.d.ts +0 -5
- package/dist/src/generateLambdaConfig.d.ts.map +0 -1
- package/dist/src/generateLambdaConfig.js +0 -28
- package/dist/src/generateLambdaConfig.js.map +0 -1
- package/dist/src/generateLambdaConfig.spec.d.ts +0 -2
- package/dist/src/generateLambdaConfig.spec.d.ts.map +0 -1
- package/dist/src/generateLambdaConfig.spec.js +0 -72
- package/dist/src/generateLambdaConfig.spec.js.map +0 -1
- package/dist/src/templateLambdaApiBuild.d.ts +0 -5
- package/dist/src/templateLambdaApiBuild.d.ts.map +0 -1
- package/dist/src/templateLambdaApiBuild.js +0 -42
- package/dist/src/templateLambdaApiBuild.js.map +0 -1
- package/dist/src/templateLambdaApiBuild.spec.d.ts +0 -2
- package/dist/src/templateLambdaApiBuild.spec.d.ts.map +0 -1
- package/dist/src/templateLambdaApiBuild.spec.js +0 -44
- package/dist/src/templateLambdaApiBuild.spec.js.map +0 -1
- package/dist/src/templateLambdaApiDeploy.d.ts +0 -10
- package/dist/src/templateLambdaApiDeploy.d.ts.map +0 -1
- package/dist/src/templateLambdaApiDeploy.js +0 -39
- package/dist/src/templateLambdaApiDeploy.js.map +0 -1
- package/dist/src/templateLambdaConsts.d.ts +0 -2
- package/dist/src/templateLambdaConsts.d.ts.map +0 -1
- package/dist/src/templateLambdaConsts.js +0 -5
- package/dist/src/templateLambdaConsts.js.map +0 -1
- package/dist/tsconfig.tsbuildinfo +0 -1
- package/jest.config.js +0 -12
- package/schemas/deployment-configuration.schema.json +0 -74
- package/schemas/deployment.schema.json +0 -176
- package/schemas/package-configuration.schema.json +0 -16
- package/schemas/package.schema.json +0 -244
- package/scripts/buildTestLambdas.ts +0 -20
- package/scripts/generateSchemas.ts +0 -3
- package/src/generateLambdaConfig.spec.ts +0 -97
- package/src/generateLambdaConfig.ts +0 -37
- package/src/templateLambdaApi.ts +0 -83
- package/src/templateLambdaApiBuild.spec.ts +0 -41
- package/src/templateLambdaApiBuild.ts +0 -52
- package/src/templateLambdaApiDeploy.ts +0 -56
- package/src/templateLambdaConsts.ts +0 -1
- package/src/types/LambdaApiPackage.ts +0 -90
- package/testData/build-test/customBuild.esbuild.config.json +0 -5
- package/testData/build-test/customBuild.ts +0 -10
- package/testData/build-test/index.ts +0 -12
- package/testData/routes-test/$default.ts +0 -0
- package/testData/routes-test/folder/nested.ts +0 -0
- package/testData/routes-test/folder/{pathparam}.ts +0 -0
- package/testData/routes-test/health/$index.ts +0 -0
- package/testData/routes-test/index.ts +0 -0
- package/testData/routes-test/resource/{path}/object.ts +0 -0
- package/testData/routes-test/resource.ts +0 -0
- package/tsconfig.generate.json +0 -12
- package/tsconfig.json +0 -64
|
@@ -1,90 +0,0 @@
|
|
|
1
|
-
import { AWSDeployment } from '@goldstack/infra-aws';
|
|
2
|
-
import { TerraformDeployment } from '@goldstack/utils-terraform';
|
|
3
|
-
import { Deployment, DeploymentConfiguration } from '@goldstack/infra';
|
|
4
|
-
import { Package, Configuration } from '@goldstack/utils-package';
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* The prefix to be used for names of the generated lambdas for the API endpoints.
|
|
8
|
-
*
|
|
9
|
-
* @title Lambda Name Prefix
|
|
10
|
-
* @pattern ^[A-Za-z0-9-_]*$
|
|
11
|
-
*/
|
|
12
|
-
type LambdaNamePrefix = string;
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* The domain name that the API should be deployed to (e.g. api.mysite.com)
|
|
16
|
-
*
|
|
17
|
-
* @title API Domain
|
|
18
|
-
* @pattern ^[^\s]*
|
|
19
|
-
*/
|
|
20
|
-
export type APIDomain = string;
|
|
21
|
-
|
|
22
|
-
/**
|
|
23
|
-
* The domain name of the Route 53 hosted zone that the domain for this API should be added to.
|
|
24
|
-
*
|
|
25
|
-
* @title Hosted Zone Domain
|
|
26
|
-
* @pattern ^[^\s]*
|
|
27
|
-
*/
|
|
28
|
-
export type HostedZoneDomain = string;
|
|
29
|
-
|
|
30
|
-
/**
|
|
31
|
-
* Optional URL for an UI that should be allowed to access this server.
|
|
32
|
-
*
|
|
33
|
-
* @title CORS Header
|
|
34
|
-
* @pattern ^[^\s]*
|
|
35
|
-
*/
|
|
36
|
-
export type CorsHeader = string;
|
|
37
|
-
|
|
38
|
-
export interface LambdaRouteConfig {
|
|
39
|
-
function_name: string;
|
|
40
|
-
route: string;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
export type LambdaRoutesConfig = {
|
|
44
|
-
[key: string]: LambdaRouteConfig;
|
|
45
|
-
};
|
|
46
|
-
|
|
47
|
-
export interface ThisDeploymentConfiguration extends DeploymentConfiguration {
|
|
48
|
-
lambdaNamePrefix?: LambdaNamePrefix;
|
|
49
|
-
apiDomain: APIDomain;
|
|
50
|
-
hostedZoneDomain: HostedZoneDomain;
|
|
51
|
-
cors?: CorsHeader;
|
|
52
|
-
lambdas: LambdaRoutesConfig;
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
export interface ThisDeployment
|
|
56
|
-
extends Deployment,
|
|
57
|
-
AWSDeployment,
|
|
58
|
-
TerraformDeployment {
|
|
59
|
-
configuration: ThisDeploymentConfiguration;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
/**
|
|
63
|
-
* Places where the lambda should be deployed to.
|
|
64
|
-
*
|
|
65
|
-
* @title Deployments
|
|
66
|
-
*/
|
|
67
|
-
export type LambdaApiDeployments = ThisDeployment[];
|
|
68
|
-
|
|
69
|
-
/**
|
|
70
|
-
* Configures this lambda.
|
|
71
|
-
*
|
|
72
|
-
* @title Lambda Configuration
|
|
73
|
-
*
|
|
74
|
-
*/
|
|
75
|
-
export type ThisPackageConfiguration = Configuration;
|
|
76
|
-
|
|
77
|
-
/**
|
|
78
|
-
* A deployment for a lambda API.
|
|
79
|
-
*
|
|
80
|
-
* @title Lambda API Package
|
|
81
|
-
*/
|
|
82
|
-
export interface ThisPackage extends Package {
|
|
83
|
-
configuration: ThisPackageConfiguration;
|
|
84
|
-
deployments: LambdaApiDeployments;
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
export { ThisDeploymentConfiguration as LambdaApiDeploymentConfiguration };
|
|
88
|
-
export { ThisDeployment as LambdaApiDeployment };
|
|
89
|
-
export { ThisPackageConfiguration as LambdaApiConfiguration };
|
|
90
|
-
export { ThisPackage as LambdaApiPackage };
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { Handler, APIGatewayProxyEventV2 } from 'aws-lambda';
|
|
2
|
-
|
|
3
|
-
type ProxyHandler = Handler<APIGatewayProxyEventV2, any>;
|
|
4
|
-
|
|
5
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
6
|
-
export const handler: ProxyHandler = async (event, context) => {
|
|
7
|
-
return {
|
|
8
|
-
message: 'Hi',
|
|
9
|
-
};
|
|
10
|
-
};
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { Handler, APIGatewayProxyEventV2 } from 'aws-lambda';
|
|
2
|
-
|
|
3
|
-
type ProxyHandler = Handler<APIGatewayProxyEventV2, any>;
|
|
4
|
-
|
|
5
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
6
|
-
export const handler: ProxyHandler = async (event, context) => {
|
|
7
|
-
const message = event.queryStringParameters?.message || 'no message';
|
|
8
|
-
|
|
9
|
-
return {
|
|
10
|
-
message: `${message}`,
|
|
11
|
-
};
|
|
12
|
-
};
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/tsconfig.generate.json
DELETED
package/tsconfig.json
DELETED
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"extends": "../../tsconfig.base.json",
|
|
3
|
-
"include": [
|
|
4
|
-
"./src/**/*",
|
|
5
|
-
"./src/**/*.json"
|
|
6
|
-
],
|
|
7
|
-
"compilerOptions": {
|
|
8
|
-
"outDir": "dist",
|
|
9
|
-
"baseUrl": "."
|
|
10
|
-
},
|
|
11
|
-
"references": [
|
|
12
|
-
{
|
|
13
|
-
"path": "../infra"
|
|
14
|
-
},
|
|
15
|
-
{
|
|
16
|
-
"path": "../infra-aws"
|
|
17
|
-
},
|
|
18
|
-
{
|
|
19
|
-
"path": "../utils-aws-lambda"
|
|
20
|
-
},
|
|
21
|
-
{
|
|
22
|
-
"path": "../utils-cli"
|
|
23
|
-
},
|
|
24
|
-
{
|
|
25
|
-
"path": "../utils-config"
|
|
26
|
-
},
|
|
27
|
-
{
|
|
28
|
-
"path": "../utils-docker"
|
|
29
|
-
},
|
|
30
|
-
{
|
|
31
|
-
"path": "../utils-log"
|
|
32
|
-
},
|
|
33
|
-
{
|
|
34
|
-
"path": "../utils-package"
|
|
35
|
-
},
|
|
36
|
-
{
|
|
37
|
-
"path": "../utils-package-config"
|
|
38
|
-
},
|
|
39
|
-
{
|
|
40
|
-
"path": "../utils-s3-deployment"
|
|
41
|
-
},
|
|
42
|
-
{
|
|
43
|
-
"path": "../utils-sh"
|
|
44
|
-
},
|
|
45
|
-
{
|
|
46
|
-
"path": "../utils-template"
|
|
47
|
-
},
|
|
48
|
-
{
|
|
49
|
-
"path": "../utils-terraform"
|
|
50
|
-
},
|
|
51
|
-
{
|
|
52
|
-
"path": "../utils-terraform-aws"
|
|
53
|
-
},
|
|
54
|
-
{
|
|
55
|
-
"path": "../../../docs/packages/utils-docs-cli"
|
|
56
|
-
},
|
|
57
|
-
{
|
|
58
|
-
"path": "../utils-git"
|
|
59
|
-
},
|
|
60
|
-
{
|
|
61
|
-
"path": "../utils-package-config-generate"
|
|
62
|
-
}
|
|
63
|
-
]
|
|
64
|
-
}
|