@aligent/cdk-prerender-proxy 0.2.7 → 2.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +1 -1
- package/index.ts +29 -0
- package/lib/error-response-construct.ts +54 -0
- package/lib/handlers/cache-control.ts +1 -4
- package/lib/handlers/error-response.ts +0 -1
- package/lib/handlers/prerender.ts +2 -3
- package/lib/prerender-cf-cache-control-construct.ts +58 -0
- package/lib/prerender-check-construct.ts +43 -0
- package/lib/prerender-construct.ts +55 -0
- package/lib/prerender-lambda-construct.ts +48 -0
- package/package.json +17 -26
- package/index.d.ts +0 -6
- package/lib/error-response-construct.d.ts +0 -9
- package/lib/error-response-construct.js +0 -32
- package/lib/handlers/node_modules/.package-lock.json +0 -55
- package/lib/handlers/node_modules/@types/aws-lambda/LICENSE +0 -21
- package/lib/handlers/node_modules/@types/aws-lambda/README.md +0 -16
- package/lib/handlers/node_modules/@types/aws-lambda/common/api-gateway.d.ts +0 -79
- package/lib/handlers/node_modules/@types/aws-lambda/common/cloudfront.d.ts +0 -79
- package/lib/handlers/node_modules/@types/aws-lambda/handler.d.ts +0 -171
- package/lib/handlers/node_modules/@types/aws-lambda/index.d.ts +0 -85
- package/lib/handlers/node_modules/@types/aws-lambda/package.json +0 -210
- package/lib/handlers/node_modules/@types/aws-lambda/trigger/alb.d.ts +0 -48
- package/lib/handlers/node_modules/@types/aws-lambda/trigger/api-gateway-authorizer.d.ts +0 -174
- package/lib/handlers/node_modules/@types/aws-lambda/trigger/api-gateway-proxy.d.ts +0 -187
- package/lib/handlers/node_modules/@types/aws-lambda/trigger/appsync-resolver.d.ts +0 -51
- package/lib/handlers/node_modules/@types/aws-lambda/trigger/cloudformation-custom-resource.d.ts +0 -68
- package/lib/handlers/node_modules/@types/aws-lambda/trigger/cloudfront-request.d.ts +0 -20
- package/lib/handlers/node_modules/@types/aws-lambda/trigger/cloudfront-response.d.ts +0 -21
- package/lib/handlers/node_modules/@types/aws-lambda/trigger/cloudwatch-events.d.ts +0 -8
- package/lib/handlers/node_modules/@types/aws-lambda/trigger/cloudwatch-logs.d.ts +0 -37
- package/lib/handlers/node_modules/@types/aws-lambda/trigger/codebuild-cloudwatch-state.d.ts +0 -104
- package/lib/handlers/node_modules/@types/aws-lambda/trigger/codepipeline-cloudwatch-action.d.ts +0 -31
- package/lib/handlers/node_modules/@types/aws-lambda/trigger/codepipeline-cloudwatch-pipeline.d.ts +0 -32
- package/lib/handlers/node_modules/@types/aws-lambda/trigger/codepipeline-cloudwatch-stage.d.ts +0 -23
- package/lib/handlers/node_modules/@types/aws-lambda/trigger/codepipeline-cloudwatch.d.ts +0 -11
- package/lib/handlers/node_modules/@types/aws-lambda/trigger/codepipeline.d.ts +0 -55
- package/lib/handlers/node_modules/@types/aws-lambda/trigger/cognito-user-pool-trigger/_common.d.ts +0 -41
- package/lib/handlers/node_modules/@types/aws-lambda/trigger/cognito-user-pool-trigger/create-auth-challenge.d.ts +0 -22
- package/lib/handlers/node_modules/@types/aws-lambda/trigger/cognito-user-pool-trigger/custom-email-sender.d.ts +0 -86
- package/lib/handlers/node_modules/@types/aws-lambda/trigger/cognito-user-pool-trigger/custom-message.d.ts +0 -44
- package/lib/handlers/node_modules/@types/aws-lambda/trigger/cognito-user-pool-trigger/define-auth-challenge.d.ts +0 -21
- package/lib/handlers/node_modules/@types/aws-lambda/trigger/cognito-user-pool-trigger/index.d.ts +0 -119
- package/lib/handlers/node_modules/@types/aws-lambda/trigger/cognito-user-pool-trigger/post-authentication.d.ts +0 -15
- package/lib/handlers/node_modules/@types/aws-lambda/trigger/cognito-user-pool-trigger/post-confirmation.d.ts +0 -22
- package/lib/handlers/node_modules/@types/aws-lambda/trigger/cognito-user-pool-trigger/pre-authentication.d.ts +0 -15
- package/lib/handlers/node_modules/@types/aws-lambda/trigger/cognito-user-pool-trigger/pre-signup.d.ts +0 -31
- package/lib/handlers/node_modules/@types/aws-lambda/trigger/cognito-user-pool-trigger/pre-token-generation.d.ts +0 -45
- package/lib/handlers/node_modules/@types/aws-lambda/trigger/cognito-user-pool-trigger/user-migration.d.ts +0 -39
- package/lib/handlers/node_modules/@types/aws-lambda/trigger/cognito-user-pool-trigger/verify-auth-challenge-response.d.ts +0 -20
- package/lib/handlers/node_modules/@types/aws-lambda/trigger/connect-contact-flow.d.ts +0 -65
- package/lib/handlers/node_modules/@types/aws-lambda/trigger/dynamodb-stream.d.ts +0 -45
- package/lib/handlers/node_modules/@types/aws-lambda/trigger/eventbridge.d.ts +0 -18
- package/lib/handlers/node_modules/@types/aws-lambda/trigger/iot.d.ts +0 -28
- package/lib/handlers/node_modules/@types/aws-lambda/trigger/kinesis-firehose-transformation.d.ts +0 -45
- package/lib/handlers/node_modules/@types/aws-lambda/trigger/kinesis-stream.d.ts +0 -28
- package/lib/handlers/node_modules/@types/aws-lambda/trigger/lex.d.ts +0 -116
- package/lib/handlers/node_modules/@types/aws-lambda/trigger/msk.d.ts +0 -21
- package/lib/handlers/node_modules/@types/aws-lambda/trigger/s3-batch.d.ts +0 -41
- package/lib/handlers/node_modules/@types/aws-lambda/trigger/s3.d.ts +0 -60
- package/lib/handlers/node_modules/@types/aws-lambda/trigger/ses.d.ts +0 -103
- package/lib/handlers/node_modules/@types/aws-lambda/trigger/sns.d.ts +0 -38
- package/lib/handlers/node_modules/@types/aws-lambda/trigger/sqs.d.ts +0 -46
- package/lib/handlers/node_modules/@types/node/LICENSE +0 -21
- package/lib/handlers/node_modules/@types/node/README.md +0 -16
- package/lib/handlers/node_modules/@types/node/assert/strict.d.ts +0 -4
- package/lib/handlers/node_modules/@types/node/assert.d.ts +0 -124
- package/lib/handlers/node_modules/@types/node/async_hooks.d.ts +0 -226
- package/lib/handlers/node_modules/@types/node/base.d.ts +0 -19
- package/lib/handlers/node_modules/@types/node/buffer.d.ts +0 -84
- package/lib/handlers/node_modules/@types/node/child_process.d.ts +0 -526
- package/lib/handlers/node_modules/@types/node/cluster.d.ts +0 -262
- package/lib/handlers/node_modules/@types/node/console.d.ts +0 -133
- package/lib/handlers/node_modules/@types/node/constants.d.ts +0 -13
- package/lib/handlers/node_modules/@types/node/crypto.d.ts +0 -1580
- package/lib/handlers/node_modules/@types/node/dgram.d.ts +0 -141
- package/lib/handlers/node_modules/@types/node/diagnostic_channel.d.ts +0 -34
- package/lib/handlers/node_modules/@types/node/dns/promises.d.ts +0 -97
- package/lib/handlers/node_modules/@types/node/dns.d.ts +0 -322
- package/lib/handlers/node_modules/@types/node/domain.d.ts +0 -24
- package/lib/handlers/node_modules/@types/node/events.d.ts +0 -93
- package/lib/handlers/node_modules/@types/node/fs/promises.d.ts +0 -592
- package/lib/handlers/node_modules/@types/node/fs.d.ts +0 -2239
- package/lib/handlers/node_modules/@types/node/globals.d.ts +0 -655
- package/lib/handlers/node_modules/@types/node/globals.global.d.ts +0 -1
- package/lib/handlers/node_modules/@types/node/http.d.ts +0 -434
- package/lib/handlers/node_modules/@types/node/http2.d.ts +0 -976
- package/lib/handlers/node_modules/@types/node/https.d.ts +0 -36
- package/lib/handlers/node_modules/@types/node/index.d.ts +0 -58
- package/lib/handlers/node_modules/@types/node/inspector.d.ts +0 -3041
- package/lib/handlers/node_modules/@types/node/module.d.ts +0 -52
- package/lib/handlers/node_modules/@types/node/net.d.ts +0 -326
- package/lib/handlers/node_modules/@types/node/os.d.ts +0 -239
- package/lib/handlers/node_modules/@types/node/package.json +0 -232
- package/lib/handlers/node_modules/@types/node/path.d.ts +0 -163
- package/lib/handlers/node_modules/@types/node/perf_hooks.d.ts +0 -310
- package/lib/handlers/node_modules/@types/node/process.d.ts +0 -461
- package/lib/handlers/node_modules/@types/node/punycode.d.ts +0 -75
- package/lib/handlers/node_modules/@types/node/querystring.d.ts +0 -28
- package/lib/handlers/node_modules/@types/node/readline.d.ts +0 -192
- package/lib/handlers/node_modules/@types/node/repl.d.ts +0 -395
- package/lib/handlers/node_modules/@types/node/stream/promises.d.ts +0 -67
- package/lib/handlers/node_modules/@types/node/stream.d.ts +0 -471
- package/lib/handlers/node_modules/@types/node/string_decoder.d.ts +0 -7
- package/lib/handlers/node_modules/@types/node/timers/promises.d.ts +0 -21
- package/lib/handlers/node_modules/@types/node/timers.d.ts +0 -27
- package/lib/handlers/node_modules/@types/node/tls.d.ts +0 -793
- package/lib/handlers/node_modules/@types/node/trace_events.d.ts +0 -61
- package/lib/handlers/node_modules/@types/node/ts3.6/assert.d.ts +0 -98
- package/lib/handlers/node_modules/@types/node/ts3.6/base.d.ts +0 -68
- package/lib/handlers/node_modules/@types/node/ts3.6/index.d.ts +0 -7
- package/lib/handlers/node_modules/@types/node/tty.d.ts +0 -66
- package/lib/handlers/node_modules/@types/node/url.d.ts +0 -116
- package/lib/handlers/node_modules/@types/node/util/types.d.ts +0 -53
- package/lib/handlers/node_modules/@types/node/util.d.ts +0 -156
- package/lib/handlers/node_modules/@types/node/v8.d.ts +0 -198
- package/lib/handlers/node_modules/@types/node/vm.d.ts +0 -152
- package/lib/handlers/node_modules/@types/node/wasi.d.ts +0 -86
- package/lib/handlers/node_modules/@types/node/worker_threads.d.ts +0 -282
- package/lib/handlers/node_modules/@types/node/zlib.d.ts +0 -361
- package/lib/handlers/node_modules/axios/CHANGELOG.md +0 -685
- package/lib/handlers/node_modules/axios/LICENSE +0 -19
- package/lib/handlers/node_modules/axios/README.md +0 -800
- package/lib/handlers/node_modules/axios/UPGRADE_GUIDE.md +0 -162
- package/lib/handlers/node_modules/axios/dist/axios.js +0 -1756
- package/lib/handlers/node_modules/axios/dist/axios.map +0 -1
- package/lib/handlers/node_modules/axios/dist/axios.min.js +0 -3
- package/lib/handlers/node_modules/axios/dist/axios.min.map +0 -1
- package/lib/handlers/node_modules/axios/index.d.ts +0 -161
- package/lib/handlers/node_modules/axios/index.js +0 -1
- package/lib/handlers/node_modules/axios/lib/adapters/README.md +0 -37
- package/lib/handlers/node_modules/axios/lib/adapters/http.js +0 -303
- package/lib/handlers/node_modules/axios/lib/adapters/xhr.js +0 -179
- package/lib/handlers/node_modules/axios/lib/axios.js +0 -56
- package/lib/handlers/node_modules/axios/lib/cancel/Cancel.js +0 -19
- package/lib/handlers/node_modules/axios/lib/cancel/CancelToken.js +0 -57
- package/lib/handlers/node_modules/axios/lib/cancel/isCancel.js +0 -5
- package/lib/handlers/node_modules/axios/lib/core/Axios.js +0 -95
- package/lib/handlers/node_modules/axios/lib/core/InterceptorManager.js +0 -52
- package/lib/handlers/node_modules/axios/lib/core/README.md +0 -7
- package/lib/handlers/node_modules/axios/lib/core/buildFullPath.js +0 -20
- package/lib/handlers/node_modules/axios/lib/core/createError.js +0 -18
- package/lib/handlers/node_modules/axios/lib/core/dispatchRequest.js +0 -79
- package/lib/handlers/node_modules/axios/lib/core/enhanceError.js +0 -42
- package/lib/handlers/node_modules/axios/lib/core/mergeConfig.js +0 -87
- package/lib/handlers/node_modules/axios/lib/core/settle.js +0 -25
- package/lib/handlers/node_modules/axios/lib/core/transformData.js +0 -20
- package/lib/handlers/node_modules/axios/lib/defaults.js +0 -98
- package/lib/handlers/node_modules/axios/lib/helpers/README.md +0 -7
- package/lib/handlers/node_modules/axios/lib/helpers/bind.js +0 -11
- package/lib/handlers/node_modules/axios/lib/helpers/buildURL.js +0 -70
- package/lib/handlers/node_modules/axios/lib/helpers/combineURLs.js +0 -14
- package/lib/handlers/node_modules/axios/lib/helpers/cookies.js +0 -53
- package/lib/handlers/node_modules/axios/lib/helpers/deprecatedMethod.js +0 -24
- package/lib/handlers/node_modules/axios/lib/helpers/isAbsoluteURL.js +0 -14
- package/lib/handlers/node_modules/axios/lib/helpers/isAxiosError.js +0 -11
- package/lib/handlers/node_modules/axios/lib/helpers/isURLSameOrigin.js +0 -68
- package/lib/handlers/node_modules/axios/lib/helpers/normalizeHeaderName.js +0 -12
- package/lib/handlers/node_modules/axios/lib/helpers/parseHeaders.js +0 -53
- package/lib/handlers/node_modules/axios/lib/helpers/spread.js +0 -27
- package/lib/handlers/node_modules/axios/lib/utils.js +0 -351
- package/lib/handlers/node_modules/axios/package.json +0 -86
- package/lib/handlers/node_modules/buffer-from/LICENSE +0 -21
- package/lib/handlers/node_modules/buffer-from/index.js +0 -69
- package/lib/handlers/node_modules/buffer-from/package.json +0 -19
- package/lib/handlers/node_modules/buffer-from/readme.md +0 -69
- package/lib/handlers/node_modules/follow-redirects/LICENSE +0 -18
- package/lib/handlers/node_modules/follow-redirects/README.md +0 -148
- package/lib/handlers/node_modules/follow-redirects/debug.js +0 -14
- package/lib/handlers/node_modules/follow-redirects/http.js +0 -1
- package/lib/handlers/node_modules/follow-redirects/https.js +0 -1
- package/lib/handlers/node_modules/follow-redirects/index.js +0 -531
- package/lib/handlers/node_modules/follow-redirects/package.json +0 -59
- package/lib/handlers/node_modules/source-map/CHANGELOG.md +0 -301
- package/lib/handlers/node_modules/source-map/LICENSE +0 -28
- package/lib/handlers/node_modules/source-map/README.md +0 -742
- package/lib/handlers/node_modules/source-map/dist/source-map.debug.js +0 -3234
- package/lib/handlers/node_modules/source-map/dist/source-map.js +0 -3233
- package/lib/handlers/node_modules/source-map/dist/source-map.min.js +0 -2
- package/lib/handlers/node_modules/source-map/dist/source-map.min.js.map +0 -1
- package/lib/handlers/node_modules/source-map/lib/array-set.js +0 -121
- package/lib/handlers/node_modules/source-map/lib/base64-vlq.js +0 -140
- package/lib/handlers/node_modules/source-map/lib/base64.js +0 -67
- package/lib/handlers/node_modules/source-map/lib/binary-search.js +0 -111
- package/lib/handlers/node_modules/source-map/lib/mapping-list.js +0 -79
- package/lib/handlers/node_modules/source-map/lib/quick-sort.js +0 -114
- package/lib/handlers/node_modules/source-map/lib/source-map-consumer.js +0 -1145
- package/lib/handlers/node_modules/source-map/lib/source-map-generator.js +0 -425
- package/lib/handlers/node_modules/source-map/lib/source-node.js +0 -413
- package/lib/handlers/node_modules/source-map/lib/util.js +0 -488
- package/lib/handlers/node_modules/source-map/package.json +0 -73
- package/lib/handlers/node_modules/source-map/source-map.d.ts +0 -98
- package/lib/handlers/node_modules/source-map/source-map.js +0 -8
- package/lib/handlers/node_modules/source-map-support/LICENSE.md +0 -21
- package/lib/handlers/node_modules/source-map-support/README.md +0 -284
- package/lib/handlers/node_modules/source-map-support/browser-source-map-support.js +0 -114
- package/lib/handlers/node_modules/source-map-support/package.json +0 -31
- package/lib/handlers/node_modules/source-map-support/register.js +0 -1
- package/lib/handlers/node_modules/source-map-support/source-map-support.js +0 -604
- package/lib/handlers/package-lock.json +0 -108
- package/lib/handlers/package.json +0 -13
- package/lib/handlers/tsconfig.json +0 -22
- package/lib/prerender-cf-cache-control-construct.d.ts +0 -10
- package/lib/prerender-cf-cache-control-construct.js +0 -33
- package/lib/prerender-check-construct.d.ts +0 -6
- package/lib/prerender-check-construct.js +0 -25
- package/lib/prerender-construct.d.ts +0 -11
- package/lib/prerender-construct.js +0 -34
- package/lib/prerender-lambda-construct.d.ts +0 -17
- package/lib/prerender-lambda-construct.js +0 -19
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* CloudFront events
|
|
3
|
-
* http://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/lambda-event-structure.html
|
|
4
|
-
* Bear in mind that the "example" event structure in the page above includes
|
|
5
|
-
* both an S3 and a Custom origin, which is not strictly allowed. Only one
|
|
6
|
-
* of these per event may be present.
|
|
7
|
-
*/
|
|
8
|
-
export interface CloudFrontHeaders {
|
|
9
|
-
[name: string]: Array<{
|
|
10
|
-
key?: string;
|
|
11
|
-
value: string;
|
|
12
|
-
}>;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
export type CloudFrontOrigin =
|
|
16
|
-
| { s3: CloudFrontS3Origin; custom?: never }
|
|
17
|
-
| { custom: CloudFrontCustomOrigin; s3?: never };
|
|
18
|
-
|
|
19
|
-
export interface CloudFrontCustomOrigin {
|
|
20
|
-
customHeaders: CloudFrontHeaders;
|
|
21
|
-
domainName: string;
|
|
22
|
-
keepaliveTimeout: number;
|
|
23
|
-
path: string;
|
|
24
|
-
port: number;
|
|
25
|
-
protocol: 'http' | 'https';
|
|
26
|
-
readTimeout: number;
|
|
27
|
-
sslProtocols: string[];
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
export interface CloudFrontS3Origin {
|
|
31
|
-
authMethod: 'origin-access-identity' | 'none';
|
|
32
|
-
customHeaders: CloudFrontHeaders;
|
|
33
|
-
domainName: string;
|
|
34
|
-
path: string;
|
|
35
|
-
region: string;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
export interface CloudFrontResponse {
|
|
39
|
-
status: string;
|
|
40
|
-
statusDescription: string;
|
|
41
|
-
headers: CloudFrontHeaders;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
export interface CloudFrontRequest {
|
|
45
|
-
body?: {
|
|
46
|
-
action: 'read-only' | 'replace';
|
|
47
|
-
data: string;
|
|
48
|
-
encoding: 'base64' | 'text';
|
|
49
|
-
readonly inputTruncated: boolean;
|
|
50
|
-
};
|
|
51
|
-
readonly clientIp: string;
|
|
52
|
-
readonly method: string;
|
|
53
|
-
uri: string;
|
|
54
|
-
querystring: string;
|
|
55
|
-
headers: CloudFrontHeaders;
|
|
56
|
-
origin?: CloudFrontOrigin;
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
export interface CloudFrontEvent {
|
|
60
|
-
config: {
|
|
61
|
-
readonly distributionDomainName: string;
|
|
62
|
-
readonly distributionId: string;
|
|
63
|
-
readonly eventType: 'origin-request' | 'origin-response' | 'viewer-request' | 'viewer-response';
|
|
64
|
-
readonly requestId: string;
|
|
65
|
-
};
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
/**
|
|
69
|
-
* Generated HTTP response in viewer request event or origin request event
|
|
70
|
-
*
|
|
71
|
-
* https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/lambda-generating-http-responses-in-requests.html#lambda-generating-http-responses-object
|
|
72
|
-
*/
|
|
73
|
-
export interface CloudFrontResultResponse {
|
|
74
|
-
status: string;
|
|
75
|
-
statusDescription?: string;
|
|
76
|
-
headers?: CloudFrontHeaders;
|
|
77
|
-
bodyEncoding?: 'text' | 'base64';
|
|
78
|
-
body?: string;
|
|
79
|
-
}
|
|
@@ -1,171 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* The interface that AWS Lambda will invoke your handler with.
|
|
3
|
-
* There are more specialized types for many cases where AWS services
|
|
4
|
-
* invoke your lambda, but you can directly use this type for when you are invoking
|
|
5
|
-
* your lambda directly.
|
|
6
|
-
*
|
|
7
|
-
* See tme {@link http://docs.aws.amazon.com/lambda/latest/dg/nodejs-prog-model-handler.html AWS documentation}
|
|
8
|
-
* for more information about the runtime behavior, and the
|
|
9
|
-
* {@link https://aws.amazon.com/blogs/compute/node-js-8-10-runtime-now-available-in-aws-lambda/ AWS Blog post}
|
|
10
|
-
* introducing the async handler behavior in the 8.10 runtime.
|
|
11
|
-
*
|
|
12
|
-
* @example <caption>Defining a custom handler type</caption>
|
|
13
|
-
* import { Handler } from 'aws-lambda'
|
|
14
|
-
*
|
|
15
|
-
* interface NameEvent {
|
|
16
|
-
* fullName: string
|
|
17
|
-
* }
|
|
18
|
-
* interface NameResult {
|
|
19
|
-
* firstName: string
|
|
20
|
-
* middleNames: string
|
|
21
|
-
* lastName: string
|
|
22
|
-
* }
|
|
23
|
-
* type PersonHandler = Handler<NameEvent, NameResult>
|
|
24
|
-
*
|
|
25
|
-
* export const handler: PersonHandler = async (event) => {
|
|
26
|
-
* const names = event.fullName.split(' ')
|
|
27
|
-
* const firstName = names.shift()
|
|
28
|
-
* const lastName = names.pop()
|
|
29
|
-
* return { firstName, middleNames: names, lastName }
|
|
30
|
-
* }
|
|
31
|
-
*
|
|
32
|
-
* @example <caption>Logs the contents of the event object and returns the location of the logs</caption>
|
|
33
|
-
* import { Handler } from 'aws-lambda'
|
|
34
|
-
*
|
|
35
|
-
* export const handler: Handler = async (event, context) => {
|
|
36
|
-
* console.log("EVENT: \n" + JSON.stringify(event, null, 2))
|
|
37
|
-
* return context.logStreamName
|
|
38
|
-
* }
|
|
39
|
-
*
|
|
40
|
-
* @example <caption>AWS SDK with Async Function and Promises</caption>
|
|
41
|
-
* import { Handler } from 'aws-lambda'
|
|
42
|
-
* import AWS from 'aws-sdk'
|
|
43
|
-
*
|
|
44
|
-
* const s3 = new AWS.S3()
|
|
45
|
-
*
|
|
46
|
-
* export const handler: Handler = async (event) => {
|
|
47
|
-
* const response = await s3.listBuckets().promise()
|
|
48
|
-
* return response?.Buckets.map((bucket) => bucket.Name)
|
|
49
|
-
* }
|
|
50
|
-
*
|
|
51
|
-
* @example <caption>HTTP Request with Callback</caption>
|
|
52
|
-
* import { Handler } from 'aws-lambda'
|
|
53
|
-
* import https from 'https'
|
|
54
|
-
*
|
|
55
|
-
* let url = "https://docs.aws.amazon.com/lambda/latest/dg/welcome.html"
|
|
56
|
-
*
|
|
57
|
-
* export const handler: Handler<void, number> = (event, context, callback) => {
|
|
58
|
-
* https.get(url, (res) => {
|
|
59
|
-
* callback(null, res.statusCode)
|
|
60
|
-
* }).on('error', (e) => {
|
|
61
|
-
* callback(Error(e))
|
|
62
|
-
* })
|
|
63
|
-
* }
|
|
64
|
-
*
|
|
65
|
-
* @param event
|
|
66
|
-
* Parsed JSON data in the lambda request payload. For an AWS service triggered
|
|
67
|
-
* lambda this should be in the format of a type ending in Event, for example the
|
|
68
|
-
* S3Handler receives an event of type S3Event.
|
|
69
|
-
* @param context
|
|
70
|
-
* Runtime contextual information of the current invocation, for example the caller
|
|
71
|
-
* identity, available memory and time remaining, legacy completion callbacks, and
|
|
72
|
-
* a mutable property controlling when the lambda execution completes.
|
|
73
|
-
* @param callback
|
|
74
|
-
* NodeJS-style completion callback that the AWS Lambda runtime will provide that can
|
|
75
|
-
* be used to provide the lambda result payload value, or any execution error. Can
|
|
76
|
-
* instead return a promise that resolves with the result payload value or rejects
|
|
77
|
-
* with the execution error.
|
|
78
|
-
* @return
|
|
79
|
-
* A promise that resolves with the lambda result payload value, or rejects with the
|
|
80
|
-
* execution error. Note that if you implement your handler as an async function,
|
|
81
|
-
* you will automatically return a promise that will resolve with a returned value,
|
|
82
|
-
* or reject with a thrown value.
|
|
83
|
-
*/
|
|
84
|
-
export type Handler<TEvent = any, TResult = any> = (
|
|
85
|
-
event: TEvent,
|
|
86
|
-
context: Context,
|
|
87
|
-
callback: Callback<TResult>,
|
|
88
|
-
) => void | Promise<TResult>;
|
|
89
|
-
|
|
90
|
-
/**
|
|
91
|
-
* {@link Handler} context parameter.
|
|
92
|
-
* See {@link https://docs.aws.amazon.com/lambda/latest/dg/nodejs-prog-model-context.html AWS documentation}.
|
|
93
|
-
*/
|
|
94
|
-
export interface Context {
|
|
95
|
-
callbackWaitsForEmptyEventLoop: boolean;
|
|
96
|
-
functionName: string;
|
|
97
|
-
functionVersion: string;
|
|
98
|
-
invokedFunctionArn: string;
|
|
99
|
-
memoryLimitInMB: string;
|
|
100
|
-
awsRequestId: string;
|
|
101
|
-
logGroupName: string;
|
|
102
|
-
logStreamName: string;
|
|
103
|
-
identity?: CognitoIdentity;
|
|
104
|
-
clientContext?: ClientContext;
|
|
105
|
-
|
|
106
|
-
getRemainingTimeInMillis(): number;
|
|
107
|
-
|
|
108
|
-
// Functions for compatibility with earlier Node.js Runtime v0.10.42
|
|
109
|
-
// No longer documented, so they are deprecated, but they still work
|
|
110
|
-
// as of the 12.x runtime, so they are not removed from the types.
|
|
111
|
-
|
|
112
|
-
/** @deprecated Use handler callback or promise result */
|
|
113
|
-
done(error?: Error, result?: any): void;
|
|
114
|
-
/** @deprecated Use handler callback with first argument or reject a promise result */
|
|
115
|
-
fail(error: Error | string): void;
|
|
116
|
-
/** @deprecated Use handler callback with second argument or resolve a promise result */
|
|
117
|
-
succeed(messageOrObject: any): void;
|
|
118
|
-
// Unclear what behavior this is supposed to have, I couldn't find any still extant reference,
|
|
119
|
-
// and it behaves like the above, ignoring the object parameter.
|
|
120
|
-
/** @deprecated Use handler callback or promise result */
|
|
121
|
-
succeed(message: string, object: any): void;
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
export interface CognitoIdentity {
|
|
125
|
-
cognitoIdentityId: string;
|
|
126
|
-
cognitoIdentityPoolId: string;
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
export interface ClientContext {
|
|
130
|
-
client: ClientContextClient;
|
|
131
|
-
Custom?: any;
|
|
132
|
-
env: ClientContextEnv;
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
export interface ClientContextClient {
|
|
136
|
-
installationId: string;
|
|
137
|
-
appTitle: string;
|
|
138
|
-
appVersionName: string;
|
|
139
|
-
appVersionCode: string;
|
|
140
|
-
appPackageName: string;
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
export interface ClientContextEnv {
|
|
144
|
-
platformVersion: string;
|
|
145
|
-
platform: string;
|
|
146
|
-
make: string;
|
|
147
|
-
model: string;
|
|
148
|
-
locale: string;
|
|
149
|
-
}
|
|
150
|
-
|
|
151
|
-
/**
|
|
152
|
-
* NodeJS-style callback parameter for the {@link Handler} type.
|
|
153
|
-
* Can be used instead of returning a promise, see the
|
|
154
|
-
* {@link https://docs.aws.amazon.com/lambda/latest/dg/nodejs-prog-model-handler.html AWS documentation}
|
|
155
|
-
* for the handler programming model.
|
|
156
|
-
*
|
|
157
|
-
* @param error
|
|
158
|
-
* Parameter to use to provide the error payload for a failed lambda execution.
|
|
159
|
-
* See {@link https://docs.aws.amazon.com/lambda/latest/dg/nodejs-prog-mode-exceptions.html AWS documentation}
|
|
160
|
-
* for error handling.
|
|
161
|
-
* If an Error instance is passed, the error payload uses the `name` property as the `errorType`,
|
|
162
|
-
* the `message` property as the `errorMessage`, and parses the `stack` property string into
|
|
163
|
-
* the `trace` array.
|
|
164
|
-
* For other values, the `errorType` is `typeof value`, the `errorMessage` is `String(value)`, and
|
|
165
|
-
* `trace` is an empty array.
|
|
166
|
-
*
|
|
167
|
-
* @param result
|
|
168
|
-
* Parameter to use to provide the result payload for a successful lambda execution.
|
|
169
|
-
* Pass `null` or `undefined` for the `error` parameter to use this parameter.
|
|
170
|
-
*/
|
|
171
|
-
export type Callback<TResult = any> = (error?: Error | string | null, result?: TResult) => void;
|
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
// Type definitions for AWS Lambda 8.10
|
|
2
|
-
// Project: http://docs.aws.amazon.com/lambda
|
|
3
|
-
// Definitions by: James Darbyshire <https://github.com/darbio>
|
|
4
|
-
// Michael Skarum <https://github.com/skarum>
|
|
5
|
-
// Stef Heyenrath <https://github.com/StefH>
|
|
6
|
-
// Rich Buggy <https://github.com/buggy>
|
|
7
|
-
// Yoriki Yamaguchi <https://github.com/y13i>
|
|
8
|
-
// wwwy3y3 <https://github.com/wwwy3y3>
|
|
9
|
-
// Ishaan Malhi <https://github.com/OrthoDex>
|
|
10
|
-
// Michael Marner <https://github.com/MichaelMarner>
|
|
11
|
-
// Daniel Cottone <https://github.com/daniel-cottone>
|
|
12
|
-
// Kostya Misura <https://github.com/kostya-misura>
|
|
13
|
-
// Markus Tacker <https://github.com/coderbyheart>
|
|
14
|
-
// Palmi Valgeirsson <https://github.com/palmithor>
|
|
15
|
-
// Danilo Raisi <https://github.com/daniloraisi>
|
|
16
|
-
// Simon Buchan <https://github.com/simonbuchan>
|
|
17
|
-
// David Hayden <https://github.com/Haydabase>
|
|
18
|
-
// Chris Redekop <https://github.com/repl-chris>
|
|
19
|
-
// Aneil Mallavarapu <https://github.com/aneilbaboo>
|
|
20
|
-
// Jeremy Nagel <https://github.com/jeznag>
|
|
21
|
-
// Louis Larry <https://github.com/louislarry>
|
|
22
|
-
// Daniel Papukchiev <https://github.com/dpapukchiev>
|
|
23
|
-
// Oliver Hookins <https://github.com/ohookins>
|
|
24
|
-
// Trevor Leach <https://github.com/trevor-leach>
|
|
25
|
-
// James Gregory <https://github.com/jagregory>
|
|
26
|
-
// Erik Dalén <https://github.com/dalen>
|
|
27
|
-
// Loïk Gaonac'h <https://github.com/loikg>
|
|
28
|
-
// Roberto Zen <https://github.com/skyzenr>
|
|
29
|
-
// Grzegorz Redlicki <https://github.com/redlickigrzegorz>
|
|
30
|
-
// Juan Carbonel <https://github.com/juancarbonel>
|
|
31
|
-
// Peter McIntyre <https://github.com/pwmcintyre>
|
|
32
|
-
// Alex Bolenok <https://github.com/alex-bolenok-centralreach>
|
|
33
|
-
// Marian Zange <https://github.com/marianzange>
|
|
34
|
-
// Alexander Pepper <https://github.com/apepper>
|
|
35
|
-
// Alessandro Palumbo <https://github.com/apalumbo>
|
|
36
|
-
// Sachin Shekhar <https://github.com/SachinShekhar>
|
|
37
|
-
// Ivan Martos <https://github.com/ivanmartos>
|
|
38
|
-
// Zach Anthony <https://github.com/zach-anthony>
|
|
39
|
-
// Peter Savnik <https://github.com/savnik>
|
|
40
|
-
// Sven Milewski <https://github.com/svenmilewski>
|
|
41
|
-
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
|
42
|
-
// TypeScript Version: 3.0
|
|
43
|
-
|
|
44
|
-
export * from "./handler";
|
|
45
|
-
export * from "./common/api-gateway";
|
|
46
|
-
export * from "./common/cloudfront";
|
|
47
|
-
export * from "./trigger/alb";
|
|
48
|
-
// TODO: export * from "./trigger/alexa";
|
|
49
|
-
export * from "./trigger/api-gateway-authorizer";
|
|
50
|
-
export * from "./trigger/api-gateway-proxy";
|
|
51
|
-
export * from "./trigger/appsync-resolver";
|
|
52
|
-
// CloudTrail section just describes using S3 to trigger on cloudtrail changes.
|
|
53
|
-
export * from "./trigger/cloudformation-custom-resource";
|
|
54
|
-
export * from "./trigger/cloudfront-request";
|
|
55
|
-
export * from "./trigger/cloudfront-response";
|
|
56
|
-
export * from "./trigger/cloudwatch-events";
|
|
57
|
-
export * from "./trigger/cloudwatch-logs";
|
|
58
|
-
// TODO: export * from "./trigger/codecommit";
|
|
59
|
-
export * from "./trigger/codebuild-cloudwatch-state";
|
|
60
|
-
export * from "./trigger/codepipeline";
|
|
61
|
-
export * from "./trigger/codepipeline-cloudwatch";
|
|
62
|
-
export * from "./trigger/codepipeline-cloudwatch-action";
|
|
63
|
-
export * from "./trigger/codepipeline-cloudwatch-pipeline";
|
|
64
|
-
export * from "./trigger/codepipeline-cloudwatch-stage";
|
|
65
|
-
// TODO: export * from "./trigger/cognito-sync";
|
|
66
|
-
export * from "./trigger/cognito-user-pool-trigger/";
|
|
67
|
-
export * from "./trigger/connect-contact-flow";
|
|
68
|
-
// TODO: export * from "./trigger/config";
|
|
69
|
-
export * from "./trigger/dynamodb-stream";
|
|
70
|
-
export * from "./trigger/eventbridge";
|
|
71
|
-
// ElastiCache section just describes using lambdas in an ElastiCache context (VPC issues, etc.)
|
|
72
|
-
// EC2 events are delivered using cloudwatch events...
|
|
73
|
-
export * from "./trigger/iot";
|
|
74
|
-
export * from "./trigger/kinesis-firehose-transformation";
|
|
75
|
-
export * from "./trigger/kinesis-stream";
|
|
76
|
-
export * from "./trigger/lex";
|
|
77
|
-
// RDS events are delivered using SNS events...
|
|
78
|
-
export * from "./trigger/s3";
|
|
79
|
-
export * from "./trigger/s3-batch";
|
|
80
|
-
export * from "./trigger/ses";
|
|
81
|
-
export * from "./trigger/sns";
|
|
82
|
-
export * from "./trigger/sqs";
|
|
83
|
-
export * from './trigger/msk';
|
|
84
|
-
|
|
85
|
-
export as namespace AWSLambda;
|
|
@@ -1,210 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@types/aws-lambda",
|
|
3
|
-
"version": "8.10.77",
|
|
4
|
-
"description": "TypeScript definitions for AWS Lambda",
|
|
5
|
-
"homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/aws-lambda",
|
|
6
|
-
"license": "MIT",
|
|
7
|
-
"contributors": [
|
|
8
|
-
{
|
|
9
|
-
"name": "James Darbyshire",
|
|
10
|
-
"url": "https://github.com/darbio",
|
|
11
|
-
"githubUsername": "darbio"
|
|
12
|
-
},
|
|
13
|
-
{
|
|
14
|
-
"name": "Michael Skarum",
|
|
15
|
-
"url": "https://github.com/skarum",
|
|
16
|
-
"githubUsername": "skarum"
|
|
17
|
-
},
|
|
18
|
-
{
|
|
19
|
-
"name": "Stef Heyenrath",
|
|
20
|
-
"url": "https://github.com/StefH",
|
|
21
|
-
"githubUsername": "StefH"
|
|
22
|
-
},
|
|
23
|
-
{
|
|
24
|
-
"name": "Rich Buggy",
|
|
25
|
-
"url": "https://github.com/buggy",
|
|
26
|
-
"githubUsername": "buggy"
|
|
27
|
-
},
|
|
28
|
-
{
|
|
29
|
-
"name": "Yoriki Yamaguchi",
|
|
30
|
-
"url": "https://github.com/y13i",
|
|
31
|
-
"githubUsername": "y13i"
|
|
32
|
-
},
|
|
33
|
-
{
|
|
34
|
-
"name": "wwwy3y3",
|
|
35
|
-
"url": "https://github.com/wwwy3y3",
|
|
36
|
-
"githubUsername": "wwwy3y3"
|
|
37
|
-
},
|
|
38
|
-
{
|
|
39
|
-
"name": "Ishaan Malhi",
|
|
40
|
-
"url": "https://github.com/OrthoDex",
|
|
41
|
-
"githubUsername": "OrthoDex"
|
|
42
|
-
},
|
|
43
|
-
{
|
|
44
|
-
"name": "Michael Marner",
|
|
45
|
-
"url": "https://github.com/MichaelMarner",
|
|
46
|
-
"githubUsername": "MichaelMarner"
|
|
47
|
-
},
|
|
48
|
-
{
|
|
49
|
-
"name": "Daniel Cottone",
|
|
50
|
-
"url": "https://github.com/daniel-cottone",
|
|
51
|
-
"githubUsername": "daniel-cottone"
|
|
52
|
-
},
|
|
53
|
-
{
|
|
54
|
-
"name": "Kostya Misura",
|
|
55
|
-
"url": "https://github.com/kostya-misura",
|
|
56
|
-
"githubUsername": "kostya-misura"
|
|
57
|
-
},
|
|
58
|
-
{
|
|
59
|
-
"name": "Markus Tacker",
|
|
60
|
-
"url": "https://github.com/coderbyheart",
|
|
61
|
-
"githubUsername": "coderbyheart"
|
|
62
|
-
},
|
|
63
|
-
{
|
|
64
|
-
"name": "Palmi Valgeirsson",
|
|
65
|
-
"url": "https://github.com/palmithor",
|
|
66
|
-
"githubUsername": "palmithor"
|
|
67
|
-
},
|
|
68
|
-
{
|
|
69
|
-
"name": "Danilo Raisi",
|
|
70
|
-
"url": "https://github.com/daniloraisi",
|
|
71
|
-
"githubUsername": "daniloraisi"
|
|
72
|
-
},
|
|
73
|
-
{
|
|
74
|
-
"name": "Simon Buchan",
|
|
75
|
-
"url": "https://github.com/simonbuchan",
|
|
76
|
-
"githubUsername": "simonbuchan"
|
|
77
|
-
},
|
|
78
|
-
{
|
|
79
|
-
"name": "David Hayden",
|
|
80
|
-
"url": "https://github.com/Haydabase",
|
|
81
|
-
"githubUsername": "Haydabase"
|
|
82
|
-
},
|
|
83
|
-
{
|
|
84
|
-
"name": "Chris Redekop",
|
|
85
|
-
"url": "https://github.com/repl-chris",
|
|
86
|
-
"githubUsername": "repl-chris"
|
|
87
|
-
},
|
|
88
|
-
{
|
|
89
|
-
"name": "Aneil Mallavarapu",
|
|
90
|
-
"url": "https://github.com/aneilbaboo",
|
|
91
|
-
"githubUsername": "aneilbaboo"
|
|
92
|
-
},
|
|
93
|
-
{
|
|
94
|
-
"name": "Jeremy Nagel",
|
|
95
|
-
"url": "https://github.com/jeznag",
|
|
96
|
-
"githubUsername": "jeznag"
|
|
97
|
-
},
|
|
98
|
-
{
|
|
99
|
-
"name": "Louis Larry",
|
|
100
|
-
"url": "https://github.com/louislarry",
|
|
101
|
-
"githubUsername": "louislarry"
|
|
102
|
-
},
|
|
103
|
-
{
|
|
104
|
-
"name": "Daniel Papukchiev",
|
|
105
|
-
"url": "https://github.com/dpapukchiev",
|
|
106
|
-
"githubUsername": "dpapukchiev"
|
|
107
|
-
},
|
|
108
|
-
{
|
|
109
|
-
"name": "Oliver Hookins",
|
|
110
|
-
"url": "https://github.com/ohookins",
|
|
111
|
-
"githubUsername": "ohookins"
|
|
112
|
-
},
|
|
113
|
-
{
|
|
114
|
-
"name": "Trevor Leach",
|
|
115
|
-
"url": "https://github.com/trevor-leach",
|
|
116
|
-
"githubUsername": "trevor-leach"
|
|
117
|
-
},
|
|
118
|
-
{
|
|
119
|
-
"name": "James Gregory",
|
|
120
|
-
"url": "https://github.com/jagregory",
|
|
121
|
-
"githubUsername": "jagregory"
|
|
122
|
-
},
|
|
123
|
-
{
|
|
124
|
-
"name": "Erik Dalén",
|
|
125
|
-
"url": "https://github.com/dalen",
|
|
126
|
-
"githubUsername": "dalen"
|
|
127
|
-
},
|
|
128
|
-
{
|
|
129
|
-
"name": "Loïk Gaonac'h",
|
|
130
|
-
"url": "https://github.com/loikg",
|
|
131
|
-
"githubUsername": "loikg"
|
|
132
|
-
},
|
|
133
|
-
{
|
|
134
|
-
"name": "Roberto Zen",
|
|
135
|
-
"url": "https://github.com/skyzenr",
|
|
136
|
-
"githubUsername": "skyzenr"
|
|
137
|
-
},
|
|
138
|
-
{
|
|
139
|
-
"name": "Grzegorz Redlicki",
|
|
140
|
-
"url": "https://github.com/redlickigrzegorz",
|
|
141
|
-
"githubUsername": "redlickigrzegorz"
|
|
142
|
-
},
|
|
143
|
-
{
|
|
144
|
-
"name": "Juan Carbonel",
|
|
145
|
-
"url": "https://github.com/juancarbonel",
|
|
146
|
-
"githubUsername": "juancarbonel"
|
|
147
|
-
},
|
|
148
|
-
{
|
|
149
|
-
"name": "Peter McIntyre",
|
|
150
|
-
"url": "https://github.com/pwmcintyre",
|
|
151
|
-
"githubUsername": "pwmcintyre"
|
|
152
|
-
},
|
|
153
|
-
{
|
|
154
|
-
"name": "Alex Bolenok",
|
|
155
|
-
"url": "https://github.com/alex-bolenok-centralreach",
|
|
156
|
-
"githubUsername": "alex-bolenok-centralreach"
|
|
157
|
-
},
|
|
158
|
-
{
|
|
159
|
-
"name": "Marian Zange",
|
|
160
|
-
"url": "https://github.com/marianzange",
|
|
161
|
-
"githubUsername": "marianzange"
|
|
162
|
-
},
|
|
163
|
-
{
|
|
164
|
-
"name": "Alexander Pepper",
|
|
165
|
-
"url": "https://github.com/apepper",
|
|
166
|
-
"githubUsername": "apepper"
|
|
167
|
-
},
|
|
168
|
-
{
|
|
169
|
-
"name": "Alessandro Palumbo",
|
|
170
|
-
"url": "https://github.com/apalumbo",
|
|
171
|
-
"githubUsername": "apalumbo"
|
|
172
|
-
},
|
|
173
|
-
{
|
|
174
|
-
"name": "Sachin Shekhar",
|
|
175
|
-
"url": "https://github.com/SachinShekhar",
|
|
176
|
-
"githubUsername": "SachinShekhar"
|
|
177
|
-
},
|
|
178
|
-
{
|
|
179
|
-
"name": "Ivan Martos",
|
|
180
|
-
"url": "https://github.com/ivanmartos",
|
|
181
|
-
"githubUsername": "ivanmartos"
|
|
182
|
-
},
|
|
183
|
-
{
|
|
184
|
-
"name": "Zach Anthony",
|
|
185
|
-
"url": "https://github.com/zach-anthony",
|
|
186
|
-
"githubUsername": "zach-anthony"
|
|
187
|
-
},
|
|
188
|
-
{
|
|
189
|
-
"name": "Peter Savnik",
|
|
190
|
-
"url": "https://github.com/savnik",
|
|
191
|
-
"githubUsername": "savnik"
|
|
192
|
-
},
|
|
193
|
-
{
|
|
194
|
-
"name": "Sven Milewski",
|
|
195
|
-
"url": "https://github.com/svenmilewski",
|
|
196
|
-
"githubUsername": "svenmilewski"
|
|
197
|
-
}
|
|
198
|
-
],
|
|
199
|
-
"main": "",
|
|
200
|
-
"types": "index.d.ts",
|
|
201
|
-
"repository": {
|
|
202
|
-
"type": "git",
|
|
203
|
-
"url": "https://github.com/DefinitelyTyped/DefinitelyTyped.git",
|
|
204
|
-
"directory": "types/aws-lambda"
|
|
205
|
-
},
|
|
206
|
-
"scripts": {},
|
|
207
|
-
"dependencies": {},
|
|
208
|
-
"typesPublisherContentHash": "dda862cf7c7babf5a7e052c561524a23b70c7e44511c5e26d2ce7b527e304ac5",
|
|
209
|
-
"typeScriptVersion": "3.6"
|
|
210
|
-
}
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
import { Handler, Callback } from "../handler";
|
|
2
|
-
|
|
3
|
-
export type ALBHandler = Handler<ALBEvent, ALBResult>;
|
|
4
|
-
export type ALBCallback = Callback<ALBResult>;
|
|
5
|
-
|
|
6
|
-
// https://docs.aws.amazon.com/elasticloadbalancing/latest/application/lambda-functions.html
|
|
7
|
-
export interface ALBEventRequestContext {
|
|
8
|
-
elb: {
|
|
9
|
-
targetGroupArn: string;
|
|
10
|
-
};
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
export interface ALBEventQueryStringParameters {
|
|
14
|
-
[name: string]: string | undefined;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
export interface ALBEventHeaders {
|
|
18
|
-
[name: string]: string | undefined;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
export interface ALBEventMultiValueHeaders {
|
|
22
|
-
[name: string]: string[] | undefined;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
export interface ALBEventMultiValueQueryStringParameters {
|
|
26
|
-
[name: string]: string[] | undefined;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
export interface ALBEvent {
|
|
30
|
-
requestContext: ALBEventRequestContext;
|
|
31
|
-
httpMethod: string;
|
|
32
|
-
path: string;
|
|
33
|
-
queryStringParameters?: ALBEventQueryStringParameters; // URL encoded
|
|
34
|
-
headers?: ALBEventHeaders;
|
|
35
|
-
multiValueQueryStringParameters?: ALBEventMultiValueQueryStringParameters; // URL encoded
|
|
36
|
-
multiValueHeaders?: ALBEventMultiValueHeaders;
|
|
37
|
-
body: string | null;
|
|
38
|
-
isBase64Encoded: boolean;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
export interface ALBResult {
|
|
42
|
-
statusCode: number;
|
|
43
|
-
statusDescription?: string;
|
|
44
|
-
headers?: { [header: string]: boolean | number | string };
|
|
45
|
-
multiValueHeaders?: { [header: string]: Array<boolean | number | string> };
|
|
46
|
-
body?: string;
|
|
47
|
-
isBase64Encoded?: boolean;
|
|
48
|
-
}
|