Skip to content

Commit e5ea83f

Browse files
committed
feat(event-handler): API Event handler for AWS Lambda - API Gateway Events
1 parent cd46f5a commit e5ea83f

25 files changed

+2488
-1
lines changed

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@
1414
"docs/snippets",
1515
"layers",
1616
"examples/cdk",
17-
"examples/sam"
17+
"examples/sam",
18+
"packages/event-handler"
1819
],
1920
"scripts": {
2021
"init-environment": "husky install",

packages/event-handler/CHANGELOG.md

Whitespace-only changes.
Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
@aws-lambda-powertools/commons
2+
0.0.2 <https://github.com/aws-powertools/powertools-lambda-typescript>
3+
license: MIT*
4+
authors: Amazon Web Services <https://aws.amazon.com>
5+
6+
******************************
7+
8+
@types/aws-lambda
9+
8.10.87 <https://github.com/DefinitelyTyped/DefinitelyTyped>
10+
MIT License
11+
12+
Copyright (c) Microsoft Corporation.
13+
14+
Permission is hereby granted, free of charge, to any person obtaining a copy
15+
of this software and associated documentation files (the "Software"), to deal
16+
in the Software without restriction, including without limitation the rights
17+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
18+
copies of the Software, and to permit persons to whom the Software is
19+
furnished to do so, subject to the following conditions:
20+
21+
The above copyright notice and this permission notice shall be included in all
22+
copies or substantial portions of the Software.
23+
24+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
25+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
26+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
27+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
28+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
29+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
30+
SOFTWARE
31+
32+
33+
******************************
34+
35+
lodash
36+
4.17.21 <https://github.com/lodash/lodash>
37+
Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
38+
39+
Based on Underscore.js, copyright Jeremy Ashkenas,
40+
DocumentCloud and Investigative Reporters & Editors <http://underscorejs.org/>
41+
42+
This software consists of voluntary contributions made by many
43+
individuals. For exact contribution history, see the revision history
44+
available at https://github.com/lodash/lodash
45+
46+
The following license applies to all parts of this software except as
47+
documented below:
48+
49+
====
50+
51+
Permission is hereby granted, free of charge, to any person obtaining
52+
a copy of this software and associated documentation files (the
53+
"Software"), to deal in the Software without restriction, including
54+
without limitation the rights to use, copy, modify, merge, publish,
55+
distribute, sublicense, and/or sell copies of the Software, and to
56+
permit persons to whom the Software is furnished to do so, subject to
57+
the following conditions:
58+
59+
The above copyright notice and this permission notice shall be
60+
included in all copies or substantial portions of the Software.
61+
62+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
63+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
64+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
65+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
66+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
67+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
68+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
69+
70+
====
71+
72+
Copyright and related rights for sample code are waived via CC0. Sample
73+
code is defined as all source code displayed within the prose of the
74+
documentation.
75+
76+
CC0: http://creativecommons.org/publicdomain/zero/1.0/
77+
78+
====
79+
80+
Files located in the node_modules and vendor directories are externally
81+
maintained libraries used by this software which have their own
82+
licenses; we recommend you read them, as their terms may differ from the
83+
terms above.

packages/event-handler/jest.config.js

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
module.exports = {
2+
displayName: {
3+
name: 'Powertools for AWS Lambda (TypeScript) utility: EVENT-HANDLER',
4+
color: 'yellow',
5+
},
6+
runner: 'groups',
7+
preset: 'ts-jest',
8+
transform: {
9+
'^.+\\.ts?$': 'ts-jest',
10+
},
11+
moduleFileExtensions: ['js', 'ts'],
12+
collectCoverageFrom: ['**/src/**/*.ts', '!**/node_modules/**'],
13+
testMatch: ['**/?(*.)+(spec|test).ts'],
14+
roots: ['<rootDir>/src', '<rootDir>/tests'],
15+
testPathIgnorePatterns: ['/node_modules/'],
16+
testEnvironment: 'node',
17+
coveragePathIgnorePatterns: ['/node_modules/', '/types/'],
18+
coverageThreshold: {
19+
global: {
20+
statements: 100,
21+
branches: 100,
22+
functions: 100,
23+
lines: 100,
24+
},
25+
},
26+
coverageReporters: ['json-summary', 'text', 'lcov'],
27+
setupFiles: [],
28+
};

packages/event-handler/package.json

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
{
2+
"name": "@aws-lambda-powertools/event-handler",
3+
"version": "0.0.1",
4+
"description": "Minimalistic event handler & http router for the Powertools for AWS Lambda (TypeScript) library.",
5+
"author": {
6+
"name": "Amazon Web Services",
7+
"url": "https://aws.amazon.com"
8+
},
9+
"publishConfig": {
10+
"access": "public"
11+
},
12+
"scripts": {
13+
"test": "npm run test:unit",
14+
"test:unit": "jest --group=unit --detectOpenHandles --coverage --verbose",
15+
"test:e2e:nodejs14x": "echo 'Not Implemented'",
16+
"test:e2e:nodejs16x": "echo 'Not Implemented'",
17+
"test:e2e:nodejs18x": "echo 'Not Implemented'",
18+
"test:e2e": "echo 'Not Implemented'",
19+
"watch": "jest --watch",
20+
"build": "tsc --build --force",
21+
"lint": "eslint --ext .ts,.js --no-error-on-unmatched-pattern .",
22+
"lint-fix": "eslint --fix --ext .ts,.js --no-error-on-unmatched-pattern .",
23+
"prebuild": "rimraf ./lib",
24+
"prepack": "node ../../.github/scripts/release_patch_package_json.js ."
25+
},
26+
"lint-staged": {
27+
"*.{js,ts}": "npm run lint-fix"
28+
},
29+
"homepage": "https://github.com/aws-powertools/powertools-lambda-typescript/tree/main/packages/event-handler#readme",
30+
"license": "MIT-0",
31+
"main": "./lib/index.js",
32+
"types": "./lib/index.d.ts",
33+
"files": [
34+
"lib"
35+
],
36+
"repository": {
37+
"type": "git",
38+
"url": "git+https://github.com/aws-powertools/powertools-lambda-typescript.git"
39+
},
40+
"bugs": {
41+
"url": "https://github.com/aws-powertools/powertools-lambda-typescript/issues"
42+
},
43+
"devDependencies": {
44+
"@types/aws-lambda": "^8.10.111"
45+
},
46+
"keywords": [
47+
"aws",
48+
"lambda",
49+
"powertools",
50+
"event-handler",
51+
"http-router",
52+
"serverless",
53+
"nodejs"
54+
]
55+
}

0 commit comments

Comments
 (0)