Skip to content

Commit ac55fd4

Browse files
committed
fix zip
1 parent 8d40ab4 commit ac55fd4

File tree

5 files changed

+727
-817
lines changed

5 files changed

+727
-817
lines changed

lambda/index.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
import { Handler } from "aws-lambda";
2-
import axios from 'axios';
3-
import { Payload, Text } from "./types";
2+
import axios, { AxiosHeaders } from 'axios';
3+
import { Payload } from "./types";
44
import { error } from "console";
55

66
const handler: Handler = async (payload: Payload) => {
7-
const apiKey = process.env.API_Key;
7+
// const apiKey = process.env.API_Key;
88
const apiUrl = process.env.API_URL;
99
const { headers, data } = payload;
1010

@@ -15,7 +15,7 @@ const handler: Handler = async (payload: Payload) => {
1515
}
1616
// Make the HTTP request using Axios
1717
const response = await axios.post(apiUrl, data, {
18-
headers: headers,
18+
headers: headers as unknown as AxiosHeaders,
1919
});
2020

2121
if (response.status === 200) {

lambda/types.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { Context } from "aws-lambda";
2+
import { AxiosHeaders } from "axios";
23

34
export type Handler<TEvent = any, TResult = any> = (event: TEvent, context: Context) => Promise<TResult>;
45

package.json

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,19 +6,19 @@
66
"test:watch": "yarn test --watch --watch-extensions ts",
77
"build": "rm -rf ./dist && yarn tsc",
88
"postbuild": "cp package.json yarn.lock LICENSE README.md ./dist && cd dist && yarn install --production",
9-
"zip": "cd dist && mkdir -p ../out && zip -q -FSr ../out/lambda .",
9+
"zip": "cd dist && mkdir -p ../terraform && zip -q -FSr ../terraform/lambda .",
1010
"dist": "yarn build && yarn zip"
1111
},
1212
"devDependencies": {
13-
"@types/aws-lambda": "^8.10.64",
14-
"@types/mocha": "^7.0.2",
15-
"@types/node": "^14.11.2",
16-
"aws-sdk": "^2.785.0",
17-
"mocha": "^6.2.0",
18-
"prettier": "^2.1.2",
13+
"@types/aws-lambda": "^8.10.132",
14+
"@types/mocha": "^10.0.6",
15+
"@types/node": "^20.11.10",
16+
"aws-sdk": "^2.1545.0",
17+
"mocha": "^10.2.0",
18+
"prettier": "^3.2.4",
1919
"request": "^2.88.2",
20-
"ts-node": "^9.0.0",
21-
"typescript": "^4.0.3"
20+
"ts-node": "^10.9.2",
21+
"typescript": "^5.3.3"
2222
},
2323
"dependencies": {
2424
"axios": "^1.6.7"

terraform/lambda.zip

638 KB
Binary file not shown.

0 commit comments

Comments
 (0)