This repository was archived by the owner on Mar 22, 2023. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathrequests.ts
64 lines (61 loc) · 1.43 KB
/
requests.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
import { InterfaceRequest } from '../../src/types'
export const mockContext: AWSLambda.Context = {
awsRequestId: 'foobar',
callbackWaitsForEmptyEventLoop: true,
done: () => undefined,
fail: () => undefined,
functionName: 'foobar',
functionVersion: 'foobar',
getRemainingTimeInMillis: () => 0,
invokedFunctionArn: 'foobar',
logGroupName: 'foobar',
logStreamName: 'foobar',
memoryLimitInMB: 128,
succeed: () => undefined,
}
export const mockRequestContext: AWSLambda.APIGatewayEventRequestContext = {
accountId: 'foobar',
apiId: 'foobar',
httpMethod: 'GET',
identity: {
accessKey: null,
accountId: null,
apiKey: null,
apiKeyId: null,
caller: null,
cognitoAuthenticationProvider: null,
cognitoAuthenticationType: null,
cognitoIdentityId: null,
cognitoIdentityPoolId: null,
sourceIp: 'foobar',
user: null,
userAgent: 'foobar',
userArn: null,
},
path: '/',
requestId: 'foobar',
requestTimeEpoch: 0,
resourceId: 'foobar',
resourcePath: 'foobar',
stage: 'foobar',
}
export const get: InterfaceRequest = {
body: 'foobar',
context: mockContext,
cookies: {},
headers: {},
httpMethod: 'GET',
isBase64Encoded: false,
meta: {},
method: 'GET',
path: '/',
pathParameters: {},
provider: 'aws',
query: {},
queryStringParameters: {},
requestContext: mockRequestContext,
resource: 'foobar',
source: 'aws',
stageVariables: {},
timestamp: Date.now(),
}