|
1 | | -import { APIGatewayProxyEvent, APIGatewayProxyResult, Context } from 'aws-lambda'; |
| 1 | +import { APIGatewayProxyEvent, APIGatewayProxyResult } from 'aws-lambda'; |
2 | 2 | import { ExampleService } from '../business/example-service'; |
3 | 3 |
|
| 4 | +interface Context { |
| 5 | + clientContext: ClientContext |
| 6 | +}; |
| 7 | + |
| 8 | +interface ClientContext { |
| 9 | + gc_client_id: string |
| 10 | + gc_client_secret: string |
| 11 | + gc_aws_region: string |
| 12 | +}; |
| 13 | + |
4 | 14 | export const handler = async ( |
5 | 15 | event: APIGatewayProxyEvent, |
6 | 16 | context: Context |
@@ -57,18 +67,11 @@ if (require.main === module) { |
57 | 67 | }; |
58 | 68 |
|
59 | 69 | const fakeContext: Context = { |
60 | | - callbackWaitsForEmptyEventLoop: false, |
61 | | - functionName: 'test-function', |
62 | | - functionVersion: '1', |
63 | | - invokedFunctionArn: 'arn:aws:lambda:us-east-1:123456789012:function:test-function', |
64 | | - memoryLimitInMB: '128', |
65 | | - awsRequestId: 'test-request-id', |
66 | | - logGroupName: '/aws/lambda/test-function', |
67 | | - logStreamName: '2023/01/01/[$LATEST]test-stream', |
68 | | - getRemainingTimeInMillis: () => 30000, |
69 | | - done: () => {}, |
70 | | - fail: () => {}, |
71 | | - succeed: () => {} |
| 70 | + clientContext: { |
| 71 | + gc_client_id: 'asjkfhjdshdkjgf', |
| 72 | + gc_client_secret: 'dalksdljfsakj', |
| 73 | + gc_aws_region: 'us-east-1' |
| 74 | + } |
72 | 75 | }; |
73 | 76 |
|
74 | 77 | handler(fakeEvent, fakeContext) |
|
0 commit comments