File tree Expand file tree Collapse file tree 5 files changed +727
-817
lines changed Expand file tree Collapse file tree 5 files changed +727
-817
lines changed Original file line number Diff line number Diff line change 1
1
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" ;
4
4
import { error } from "console" ;
5
5
6
6
const handler : Handler = async ( payload : Payload ) => {
7
- const apiKey = process . env . API_Key ;
7
+ // const apiKey = process.env.API_Key;
8
8
const apiUrl = process . env . API_URL ;
9
9
const { headers, data } = payload ;
10
10
@@ -15,7 +15,7 @@ const handler: Handler = async (payload: Payload) => {
15
15
}
16
16
// Make the HTTP request using Axios
17
17
const response = await axios . post ( apiUrl , data , {
18
- headers : headers ,
18
+ headers : headers as unknown as AxiosHeaders ,
19
19
} ) ;
20
20
21
21
if ( response . status === 200 ) {
Original file line number Diff line number Diff line change 1
1
import { Context } from "aws-lambda" ;
2
+ import { AxiosHeaders } from "axios" ;
2
3
3
4
export type Handler < TEvent = any , TResult = any > = ( event : TEvent , context : Context ) => Promise < TResult > ;
4
5
Original file line number Diff line number Diff line change 6
6
"test:watch" : " yarn test --watch --watch-extensions ts" ,
7
7
"build" : " rm -rf ./dist && yarn tsc" ,
8
8
"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 ." ,
10
10
"dist" : " yarn build && yarn zip"
11
11
},
12
12
"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 " ,
19
19
"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"
22
22
},
23
23
"dependencies" : {
24
24
"axios" : " ^1.6.7"
You can’t perform that action at this time.
0 commit comments