@aligent/cdk-prerender-proxy 0.2.4 → 0.2.5-experimental1
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/lib/error-response-construct.d.ts +1 -0
- package/lib/error-response-construct.js +5 -4
- package/lib/prerender-cf-cache-control-construct.d.ts +1 -0
- package/lib/prerender-cf-cache-control-construct.js +5 -4
- package/lib/prerender-check-construct.d.ts +1 -0
- package/lib/prerender-check-construct.js +5 -4
- package/lib/prerender-construct.d.ts +1 -0
- package/lib/prerender-construct.js +5 -4
- package/package.json +3 -3
- package/lib/handlers/cache-control.ts +0 -21
- package/lib/handlers/error-response.ts +0 -51
- 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/prerender-check.ts +0 -27
- package/lib/handlers/prerender.ts +0 -43
- package/lib/handlers/tsconfig.json +0 -24
|
@@ -5,17 +5,18 @@ const core_1 = require("@aws-cdk/core");
|
|
|
5
5
|
const bundling_1 = require("@aws-cdk/aws-lambda-nodejs/lib/bundling");
|
|
6
6
|
const aws_lambda_1 = require("@aws-cdk/aws-lambda");
|
|
7
7
|
const aws_cloudfront_1 = require("@aws-cdk/aws-cloudfront");
|
|
8
|
+
require("@aligent/cdk-lambda-at-edge-handlers");
|
|
8
9
|
class ErrorResponseFunction extends core_1.Construct {
|
|
9
10
|
constructor(scope, id, options) {
|
|
10
11
|
var _a;
|
|
11
12
|
super(scope, id);
|
|
12
13
|
this.edgeFunction = new aws_cloudfront_1.experimental.EdgeFunction(this, 'ErrorResponseFunction', {
|
|
13
14
|
code: bundling_1.Bundling.bundle({
|
|
14
|
-
entry: `${__dirname}/handlers/error-response.
|
|
15
|
+
entry: `${__dirname}/node_modules/@aligent/cdk-lambda-at-edge-handlers/lib/error-response.js`,
|
|
15
16
|
runtime: aws_lambda_1.Runtime.NODEJS_14_X,
|
|
16
17
|
sourceMap: true,
|
|
17
|
-
projectRoot: `${__dirname}/handlers/`,
|
|
18
|
-
depsLockFilePath: `${__dirname}/handlers/package-lock.json`,
|
|
18
|
+
projectRoot: `${__dirname}/node_modules/@aligent/cdk-lambda-at-edge-handlers/`,
|
|
19
|
+
depsLockFilePath: `${__dirname}/node_modules/@aligent/cdk-lambda-at-edge-handlers/package-lock.json`,
|
|
19
20
|
// Define options replace values at build time so we can use environment variables to test locally
|
|
20
21
|
// and replace during build/deploy with static values. This gets around the lambda@edge limitation
|
|
21
22
|
// of no environment variables at runtime.
|
|
@@ -29,4 +30,4 @@ class ErrorResponseFunction extends core_1.Construct {
|
|
|
29
30
|
}
|
|
30
31
|
}
|
|
31
32
|
exports.ErrorResponseFunction = ErrorResponseFunction;
|
|
32
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
33
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZXJyb3ItcmVzcG9uc2UtY29uc3RydWN0LmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiZXJyb3ItcmVzcG9uc2UtY29uc3RydWN0LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7OztBQUFBLHdDQUEwQztBQUMxQyxzRUFBbUU7QUFDbkUsb0RBQThDO0FBQzlDLDREQUF1RDtBQUV2RCxnREFBNkM7QUFNN0MsTUFBYSxxQkFBc0IsU0FBUSxnQkFBUztJQUdoRCxZQUFZLEtBQWdCLEVBQUUsRUFBVSxFQUFFLE9BQXFDOztRQUMzRSxLQUFLLENBQUMsS0FBSyxFQUFFLEVBQUUsQ0FBQyxDQUFDO1FBRWpCLElBQUksQ0FBQyxZQUFZLEdBQUcsSUFBSSw2QkFBWSxDQUFDLFlBQVksQ0FDN0MsSUFBSSxFQUNKLHVCQUF1QixFQUN2QjtZQUNFLElBQUksRUFBRSxtQkFBUSxDQUFDLE1BQU0sQ0FBQztnQkFDcEIsS0FBSyxFQUFFLEdBQUcsU0FBUywwRUFBMEU7Z0JBQzdGLE9BQU8sRUFBRSxvQkFBTyxDQUFDLFdBQVc7Z0JBQzVCLFNBQVMsRUFBRSxJQUFJO2dCQUNmLFdBQVcsRUFBRSxHQUFHLFNBQVMscURBQXFEO2dCQUM5RSxnQkFBZ0IsRUFBRSxHQUFHLFNBQVMsc0VBQXNFO2dCQUNwRyxrR0FBa0c7Z0JBQ2xHLGtHQUFrRztnQkFDbEcsMEN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dGljIHZhbHVlcy4gVGhpcyBnZXRzIGFyb3VuZCB0aGUgbGFtYmRhQGVkZ2UgbGltaXRhdGlvblxuICAgICAgICAgICAgICAgIC8vIG9mIG5vIGVudmlyb25tZW50IHZhcmlhYmxlcyBhdCBydW50aW1lLlxuICAgICAgICAgICAgICAgIGRlZmluZToge1xuICAgICAgICAgICAgICAgICAgJ3Byb2Nlc3MuZW52LlBBVEhfUFJFRklYJzogSlNPTi5zdHJpbmdpZnkob3B0aW9ucy5wYXRoUHJlZml4ID8/ICcnKSxcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgIH0gYXMgYW55KSxcbiAgICAgICAgICAgICAgcnVudGltZTogUnVudGltZS5OT0RFSlNfMTRfWCxcbiAgICAgICAgICAgICAgaGFuZGxlcjogJ2luZGV4LmhhbmRsZXInLFxuICAgICAgICAgICAgfVxuICAgICAgICAgICk7XG4gICAgfVxufVxuIl19
|
|
@@ -5,17 +5,18 @@ const core_1 = require("@aws-cdk/core");
|
|
|
5
5
|
const bundling_1 = require("@aws-cdk/aws-lambda-nodejs/lib/bundling");
|
|
6
6
|
const aws_lambda_1 = require("@aws-cdk/aws-lambda");
|
|
7
7
|
const aws_cloudfront_1 = require("@aws-cdk/aws-cloudfront");
|
|
8
|
+
require("@aligent/cdk-lambda-at-edge-handlers");
|
|
8
9
|
class CloudFrontCacheControl extends core_1.Construct {
|
|
9
10
|
constructor(scope, id, options) {
|
|
10
11
|
var _a, _b;
|
|
11
12
|
super(scope, id);
|
|
12
13
|
this.edgeFunction = new aws_cloudfront_1.experimental.EdgeFunction(this, 'PrerenderCloudFrontCacheControl', {
|
|
13
14
|
code: bundling_1.Bundling.bundle({
|
|
14
|
-
entry: `${__dirname}/handlers/cache-control.
|
|
15
|
+
entry: `${__dirname}/node_modules/@aligent/cdk-lambda-at-edge-handlers/lib/cache-control.js`,
|
|
15
16
|
runtime: aws_lambda_1.Runtime.NODEJS_14_X,
|
|
16
17
|
sourceMap: true,
|
|
17
|
-
projectRoot: `${__dirname}/handlers/`,
|
|
18
|
-
depsLockFilePath: `${__dirname}/handlers/package-lock.json`,
|
|
18
|
+
projectRoot: `${__dirname}/node_modules/@aligent/cdk-lambda-at-edge-handlers/`,
|
|
19
|
+
depsLockFilePath: `${__dirname}/node_modules/@aligent/cdk-lambda-at-edge-handlers/package-lock.json`,
|
|
19
20
|
// Define options replace values at build time so we can use environment variables to test locally
|
|
20
21
|
// and replace during build/deploy with static values. This gets around the lambda@edge limitation
|
|
21
22
|
// of no environment variables at runtime.
|
|
@@ -30,4 +31,4 @@ class CloudFrontCacheControl extends core_1.Construct {
|
|
|
30
31
|
}
|
|
31
32
|
}
|
|
32
33
|
exports.CloudFrontCacheControl = CloudFrontCacheControl;
|
|
33
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
34
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicHJlcmVuZGVyLWNmLWNhY2hlLWNvbnRyb2wtY29uc3RydWN0LmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsicHJlcmVuZGVyLWNmLWNhY2hlLWNvbnRyb2wtY29uc3RydWN0LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7OztBQUFBLHdDQUEwQztBQUMxQyxzRUFBbUU7QUFDbkUsb0RBQThDO0FBQzlDLDREQUF1RDtBQUV2RCxnREFBNkM7QUFPN0MsTUFBYSxzQkFBdUIsU0FBUSxnQkFBUztJQUdqRCxZQUFZLEtBQWdCLEVBQUUsRUFBVSxFQUFFLE9BQXVDOztRQUM3RSxLQUFLLENBQUMsS0FBSyxFQUFFLEVBQUUsQ0FBQyxDQUFDO1FBRWpCLElBQUksQ0FBQyxZQUFZLEdBQUcsSUFBSSw2QkFBWSxDQUFDLFlBQVksQ0FDN0MsSUFBSSxFQUNKLGlDQUFpQyxFQUNqQztZQUNFLElBQUksRUFBRSxtQkFBUSxDQUFDLE1BQU0sQ0FBQztnQkFDcEIsS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gICAgICAgICAgICBoYW5kbGVyOiAnaW5kZXguaGFuZGxlcicsXG4gICAgICAgICAgICB9XG4gICAgICAgICk7XG4gICAgfVxufVxuIl19
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Construct } from "@aws-cdk/core";
|
|
2
2
|
import { EdgeFunction } from "@aws-cdk/aws-cloudfront/lib/experimental";
|
|
3
|
+
import "@aligent/cdk-lambda-at-edge-handlers";
|
|
3
4
|
export declare class PrerenderCheckFunction extends Construct {
|
|
4
5
|
readonly edgeFunction: EdgeFunction;
|
|
5
6
|
constructor(scope: Construct, id: string);
|
|
@@ -5,16 +5,17 @@ const core_1 = require("@aws-cdk/core");
|
|
|
5
5
|
const bundling_1 = require("@aws-cdk/aws-lambda-nodejs/lib/bundling");
|
|
6
6
|
const aws_lambda_1 = require("@aws-cdk/aws-lambda");
|
|
7
7
|
const aws_cloudfront_1 = require("@aws-cdk/aws-cloudfront");
|
|
8
|
+
require("@aligent/cdk-lambda-at-edge-handlers");
|
|
8
9
|
class PrerenderCheckFunction extends core_1.Construct {
|
|
9
10
|
constructor(scope, id) {
|
|
10
11
|
super(scope, id);
|
|
11
12
|
this.edgeFunction = new aws_cloudfront_1.experimental.EdgeFunction(this, 'PrerenderCheckFunction', {
|
|
12
13
|
code: bundling_1.Bundling.bundle({
|
|
13
|
-
entry: `${__dirname}/handlers/prerender-check.
|
|
14
|
+
entry: `${__dirname}/node_modules/@aligent/cdk-lambda-at-edge-handlers/lib/prerender-check.js`,
|
|
14
15
|
runtime: aws_lambda_1.Runtime.NODEJS_14_X,
|
|
15
16
|
sourceMap: true,
|
|
16
|
-
projectRoot: `${__dirname}/handlers/`,
|
|
17
|
-
depsLockFilePath: `${__dirname}/handlers/package-lock.json`
|
|
17
|
+
projectRoot: `${__dirname}/node_modules/@aligent/cdk-lambda-at-edge-handlers/`,
|
|
18
|
+
depsLockFilePath: `${__dirname}/node_modules/@aligent/cdk-lambda-at-edge-handlers/package-lock.json`
|
|
18
19
|
}),
|
|
19
20
|
runtime: aws_lambda_1.Runtime.NODEJS_14_X,
|
|
20
21
|
handler: 'index.handler',
|
|
@@ -22,4 +23,4 @@ class PrerenderCheckFunction extends core_1.Construct {
|
|
|
22
23
|
}
|
|
23
24
|
}
|
|
24
25
|
exports.PrerenderCheckFunction = PrerenderCheckFunction;
|
|
25
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
26
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicHJlcmVuZGVyLWNoZWNrLWNvbnN0cnVjdC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbInByZXJlbmRlci1jaGVjay1jb25zdHJ1Y3QudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7O0FBQUEsd0NBQTBDO0FBQzFDLHNFQUFtRTtBQUNuRSxvREFBOEM7QUFDOUMsNERBQXVEO0FBRXZELGdEQUE2QztBQUU3QyxNQUFhLHNCQUF1QixTQUFRLGdCQUFTO0lBR2pELFlBQVksS0FBZ0IsRUFBRSxFQUFVO1FBQ3RDLEtBQUssQ0FBQyxLQUFLLEVBQUUsRUFBRSxDQUFDLENBQUM7UUFDakIsSUFBSSxDQUFDLFlBQVksR0FBRyxJQUFJLDZCQUFZLENBQUMsWUFBWSxDQUMvQyxJQUFJLEVBQ0osd0JBQXdCLEVBQ3hCO1lBQ0UsSUFBSSxFQUFFLG1CQUFRLENBQUMsTUFBTSxDQUFDO2dCQUNwQixLQUFLLEVBQUUsR0FBRyxTQUFTLDJFQUEyRTtnQkFDOUYsT0FBTyxFQUFFLG9CQUFPLENBQUMsV0FBVztnQkFDNUIsU0FBUyxFQUFFLElBQUk7Z0JBQ2YsV0FBVyxFQUFFLEdBQUcsU0FBUyxxREFBcUQ7Z0JBQzlFLGdCQUFnQixFQUFFLEdBQUcsU0FBUyxzRUFBc0U7YUFDOUYsQ0FBQztZQUNULE9BQU8sRUFBRSxvQkFBTyxDQUFDLFdBQV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ZHVsZXMvQGFsaWdlbnQvY2RrLWxhbWJkYS1hdC1lZGdlLWhhbmRsZXJzL2xpYi9wcmVyZW5kZXItY2hlY2suanNgLFxuICAgICAgICAgICAgcnVudGltZTogUnVudGltZS5OT0RFSlNfMTRfWCxcbiAgICAgICAgICAgIHNvdXJjZU1hcDogdHJ1ZSxcbiAgICAgICAgICAgIHByb2plY3RSb290OiBgJHtfX2Rpcm5hbWV9L25vZGVfbW9kdWxlcy9AYWxpZ2VudC9jZGstbGFtYmRhLWF0LWVkZ2UtaGFuZGxlcnMvYCxcbiAgICAgICAgICAgIGRlcHNMb2NrRmlsZVBhdGg6IGAke19fZGlybmFtZX0vbm9kZV9tb2R1bGVzL0BhbGlnZW50L2Nkay1sYW1iZGEtYXQtZWRnZS1oYW5kbGVycy9wYWNrYWdlLWxvY2suanNvbmBcbiAgICAgICAgICB9IGFzIGFueSksXG4gICAgICAgICAgcnVudGltZTogUnVudGltZS5OT0RFSlNfMTRfWCxcbiAgICAgICAgICBoYW5kbGVyOiAnaW5kZXguaGFuZGxlcicsXG4gICAgICAgIH1cbiAgICAgICk7XG4gICAgfVxufVxuIl19
|
|
@@ -5,17 +5,18 @@ const core_1 = require("@aws-cdk/core");
|
|
|
5
5
|
const bundling_1 = require("@aws-cdk/aws-lambda-nodejs/lib/bundling");
|
|
6
6
|
const aws_lambda_1 = require("@aws-cdk/aws-lambda");
|
|
7
7
|
const aws_cloudfront_1 = require("@aws-cdk/aws-cloudfront");
|
|
8
|
+
require("@aligent/cdk-lambda-at-edge-handlers");
|
|
8
9
|
class PrerenderFunction extends core_1.Construct {
|
|
9
10
|
constructor(scope, id, options) {
|
|
10
11
|
var _a, _b;
|
|
11
12
|
super(scope, id);
|
|
12
13
|
this.edgeFunction = new aws_cloudfront_1.experimental.EdgeFunction(this, 'PrerenderFunction', {
|
|
13
14
|
code: bundling_1.Bundling.bundle({
|
|
14
|
-
entry: `${__dirname}/handlers/prerender.
|
|
15
|
+
entry: `${__dirname}/node_modules/@aligent/cdk-lambda-at-edge-handlers/lib/prerender.js`,
|
|
15
16
|
runtime: aws_lambda_1.Runtime.NODEJS_14_X,
|
|
16
17
|
sourceMap: true,
|
|
17
|
-
projectRoot: `${__dirname}/handlers/`,
|
|
18
|
-
depsLockFilePath: `${__dirname}/handlers/package-lock.json`,
|
|
18
|
+
projectRoot: `${__dirname}/node_modules/@aligent/cdk-lambda-at-edge-handlers/`,
|
|
19
|
+
depsLockFilePath: `${__dirname}/node_modules/@aligent/cdk-lambda-at-edge-handlers/package-lock.json`,
|
|
19
20
|
// Define options replace values at build time so we can use environment variables to test locally
|
|
20
21
|
// and replace during build/deploy with static values. This gets around the lambda@edge limitation
|
|
21
22
|
// of no environment variables at runtime.
|
|
@@ -31,4 +32,4 @@ class PrerenderFunction extends core_1.Construct {
|
|
|
31
32
|
}
|
|
32
33
|
}
|
|
33
34
|
exports.PrerenderFunction = PrerenderFunction;
|
|
34
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
35
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicHJlcmVuZGVyLWNvbnN0cnVjdC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbInByZXJlbmRlci1jb25zdHJ1Y3QudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7O0FBQUEsd0NBQTBDO0FBQzFDLHNFQUFtRTtBQUNuRSxvREFBOEM7QUFDOUMsNERBQXVEO0FBRXZELGdEQUE2QztBQVE3QyxNQUFhLGlCQUFrQixTQUFRLGdCQUFTO0lBRzVDLFlBQVksS0FBZ0IsRUFBRSxFQUFVLEVBQUUsT0FBaUM7O1FBQ3ZFLEtBQUssQ0FBQyxLQUFLLEVBQUUsRUFBRSxDQUFDLENBQUM7UUFFakIsSUFBSSxDQUFDLFlBQVksR0FBRyxJQUFJLDZCQUFZLENBQUMsWUFBWSxDQUM3QyxJQUFJLEVBQ0osbUJBQW1CLEVBQ25CO1lBQ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JsID8/ICdzZXJ2aWNlLnByZXJlbmRlci5pbycpLFxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgfSBhcyBhbnkpLFxuICAgICAgICAgICAgICBydW50aW1lOiBSdW50aW1lLk5PREVKU18xNF9YLFxuICAgICAgICAgICAgICBoYW5kbGVyOiAnaW5kZXguaGFuZGxlcicsXG4gICAgICAgICAgICB9XG4gICAgICAgICAgKTtcbiAgICB9XG59XG4iXX0=
|
package/package.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aligent/cdk-prerender-proxy",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.5-experimental1",
|
|
4
4
|
"description": "A Cloudfront Lambda@Edge stack for integrating with prerender.io",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
7
|
-
"build": "tsc
|
|
8
|
-
"prepublish": "tsc
|
|
7
|
+
"build": "tsc",
|
|
8
|
+
"prepublish": "tsc"
|
|
9
9
|
},
|
|
10
10
|
"repository": {
|
|
11
11
|
"type": "git",
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import 'source-map-support/register';
|
|
2
|
-
import { CloudFrontResponseEvent, CloudFrontResponse } from 'aws-lambda';
|
|
3
|
-
/*
|
|
4
|
-
Prerender cache control function
|
|
5
|
-
Consider associate this function as *origin response* function
|
|
6
|
-
*/
|
|
7
|
-
export const handler = async (event: CloudFrontResponseEvent): Promise<CloudFrontResponse> => {
|
|
8
|
-
const cacheKey = process.env.PRERENDER_CACHE_KEY || 'x-prerender-requestid';
|
|
9
|
-
const cacheMaxAge = process.env.PRERENDER_CACHE_MAX_AGE || '0';
|
|
10
|
-
let response = event.Records[0].cf.response;
|
|
11
|
-
|
|
12
|
-
if (response.headers[`${cacheKey}`]) {
|
|
13
|
-
response.headers['Cache-Control'] = [
|
|
14
|
-
{
|
|
15
|
-
key: 'Cache-Control',
|
|
16
|
-
value: `max-age=${cacheMaxAge}`
|
|
17
|
-
}
|
|
18
|
-
]
|
|
19
|
-
}
|
|
20
|
-
return response;
|
|
21
|
-
}
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
import 'source-map-support/register';
|
|
2
|
-
import { CloudFrontRequest, CloudFrontResponseEvent, CloudFrontResponse } from 'aws-lambda';
|
|
3
|
-
import axios from "axios";
|
|
4
|
-
import { URL } from 'url';
|
|
5
|
-
import * as https from 'https';
|
|
6
|
-
|
|
7
|
-
const FRONTEND_HOST = process.env.FRONTEND_HOST;
|
|
8
|
-
const PATH_PREFIX = process.env.PATH_PREFIX;
|
|
9
|
-
|
|
10
|
-
// Create axios client outside of lambda function for re-use between calls
|
|
11
|
-
const instance = axios.create({
|
|
12
|
-
timeout: 1000,
|
|
13
|
-
// Don't follow redirects
|
|
14
|
-
maxRedirects: 0,
|
|
15
|
-
// Only valid response codes are 200
|
|
16
|
-
validateStatus: function (status) {
|
|
17
|
-
return status == 200;
|
|
18
|
-
},
|
|
19
|
-
// keep connection alive so we don't constantly do SSL negotiation
|
|
20
|
-
httpsAgent: new https.Agent({ keepAlive: true }),
|
|
21
|
-
});
|
|
22
|
-
|
|
23
|
-
export const handler = (event: CloudFrontResponseEvent): Promise<CloudFrontResponse|CloudFrontRequest> => {
|
|
24
|
-
let response = event.Records[0].cf.response;
|
|
25
|
-
let request = event.Records[0].cf.request;
|
|
26
|
-
|
|
27
|
-
if (response.status != '200' &&
|
|
28
|
-
! request.headers['x-request-prerender'] &&
|
|
29
|
-
request.uri != `${PATH_PREFIX}/index.html`) {
|
|
30
|
-
|
|
31
|
-
// Fetch default page and return body
|
|
32
|
-
return instance.get(`https://${FRONTEND_HOST}${PATH_PREFIX}/index.html`).then((res) => {
|
|
33
|
-
response.body = res.data;
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
response.headers['content-type'] = [{
|
|
37
|
-
key: 'Content-Type',
|
|
38
|
-
value: 'text/html'
|
|
39
|
-
}];
|
|
40
|
-
|
|
41
|
-
// Remove content-length if set as this may be the value from the origin.
|
|
42
|
-
delete response.headers['content-length']
|
|
43
|
-
|
|
44
|
-
return response;
|
|
45
|
-
}).catch((err) => {
|
|
46
|
-
return response
|
|
47
|
-
});
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
return Promise.resolve(response);
|
|
51
|
-
}
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "handlers",
|
|
3
|
-
"lockfileVersion": 2,
|
|
4
|
-
"requires": true,
|
|
5
|
-
"packages": {
|
|
6
|
-
"node_modules/@types/aws-lambda": {
|
|
7
|
-
"version": "8.10.77",
|
|
8
|
-
"resolved": "https://registry.npmjs.org/@types/aws-lambda/-/aws-lambda-8.10.77.tgz",
|
|
9
|
-
"integrity": "sha512-n0EMFJU/7u3KvHrR83l/zrKOVURXl5pUJPNED/Bzjah89QKCHwCiKCBoVUXRwTGRfCYGIDdinJaAlKDHZdp/Ng=="
|
|
10
|
-
},
|
|
11
|
-
"node_modules/@types/node": {
|
|
12
|
-
"version": "15.12.4",
|
|
13
|
-
"resolved": "https://registry.npmjs.org/@types/node/-/node-15.12.4.tgz",
|
|
14
|
-
"integrity": "sha512-zrNj1+yqYF4WskCMOHwN+w9iuD12+dGm0rQ35HLl9/Ouuq52cEtd0CH9qMgrdNmi5ejC1/V7vKEXYubB+65DkA=="
|
|
15
|
-
},
|
|
16
|
-
"node_modules/axios": {
|
|
17
|
-
"version": "0.21.1",
|
|
18
|
-
"resolved": "https://registry.npmjs.org/axios/-/axios-0.21.1.tgz",
|
|
19
|
-
"integrity": "sha512-dKQiRHxGD9PPRIUNIWvZhPTPpl1rf/OxTYKsqKUDjBwYylTvV7SjSHJb9ratfyzM6wCdLCOYLzs73qpg5c4iGA==",
|
|
20
|
-
"dependencies": {
|
|
21
|
-
"follow-redirects": "^1.10.0"
|
|
22
|
-
}
|
|
23
|
-
},
|
|
24
|
-
"node_modules/buffer-from": {
|
|
25
|
-
"version": "1.1.1",
|
|
26
|
-
"resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.1.tgz",
|
|
27
|
-
"integrity": "sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A=="
|
|
28
|
-
},
|
|
29
|
-
"node_modules/follow-redirects": {
|
|
30
|
-
"version": "1.14.1",
|
|
31
|
-
"resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.14.1.tgz",
|
|
32
|
-
"integrity": "sha512-HWqDgT7ZEkqRzBvc2s64vSZ/hfOceEol3ac/7tKwzuvEyWx3/4UegXh5oBOIotkGsObyk3xznnSRVADBgWSQVg==",
|
|
33
|
-
"engines": {
|
|
34
|
-
"node": ">=4.0"
|
|
35
|
-
}
|
|
36
|
-
},
|
|
37
|
-
"node_modules/source-map": {
|
|
38
|
-
"version": "0.6.1",
|
|
39
|
-
"resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz",
|
|
40
|
-
"integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==",
|
|
41
|
-
"engines": {
|
|
42
|
-
"node": ">=0.10.0"
|
|
43
|
-
}
|
|
44
|
-
},
|
|
45
|
-
"node_modules/source-map-support": {
|
|
46
|
-
"version": "0.5.19",
|
|
47
|
-
"resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.19.tgz",
|
|
48
|
-
"integrity": "sha512-Wonm7zOCIJzBGQdB+thsPar0kYuCIzYvxZwlBa87yi/Mdjv7Tip2cyVbLj5o0cFPN4EVkuTwb3GDDyUx2DGnGw==",
|
|
49
|
-
"dependencies": {
|
|
50
|
-
"buffer-from": "^1.0.0",
|
|
51
|
-
"source-map": "^0.6.0"
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) Microsoft Corporation.
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
# Installation
|
|
2
|
-
> `npm install --save @types/aws-lambda`
|
|
3
|
-
|
|
4
|
-
# Summary
|
|
5
|
-
This package contains type definitions for AWS Lambda (http://docs.aws.amazon.com/lambda).
|
|
6
|
-
|
|
7
|
-
# Details
|
|
8
|
-
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/aws-lambda.
|
|
9
|
-
|
|
10
|
-
### Additional Details
|
|
11
|
-
* Last updated: Fri, 04 Jun 2021 13:01:30 GMT
|
|
12
|
-
* Dependencies: none
|
|
13
|
-
* Global values: `AWSLambda`
|
|
14
|
-
|
|
15
|
-
# Credits
|
|
16
|
-
These definitions were written by [James Darbyshire](https://github.com/darbio), [Michael Skarum](https://github.com/skarum), [Stef Heyenrath](https://github.com/StefH), [Rich Buggy](https://github.com/buggy), [Yoriki Yamaguchi](https://github.com/y13i), [wwwy3y3](https://github.com/wwwy3y3), [Ishaan Malhi](https://github.com/OrthoDex), [Michael Marner](https://github.com/MichaelMarner), [Daniel Cottone](https://github.com/daniel-cottone), [Kostya Misura](https://github.com/kostya-misura), [Markus Tacker](https://github.com/coderbyheart), [Palmi Valgeirsson](https://github.com/palmithor), [Danilo Raisi](https://github.com/daniloraisi), [Simon Buchan](https://github.com/simonbuchan), [David Hayden](https://github.com/Haydabase), [Chris Redekop](https://github.com/repl-chris), [Aneil Mallavarapu](https://github.com/aneilbaboo), [Jeremy Nagel](https://github.com/jeznag), [Louis Larry](https://github.com/louislarry), [Daniel Papukchiev](https://github.com/dpapukchiev), [Oliver Hookins](https://github.com/ohookins), [Trevor Leach](https://github.com/trevor-leach), [James Gregory](https://github.com/jagregory), [Erik Dalén](https://github.com/dalen), [Loïk Gaonac'h](https://github.com/loikg), [Roberto Zen](https://github.com/skyzenr), [Grzegorz Redlicki](https://github.com/redlickigrzegorz), [Juan Carbonel](https://github.com/juancarbonel), [Peter McIntyre](https://github.com/pwmcintyre), [Alex Bolenok](https://github.com/alex-bolenok-centralreach), [Marian Zange](https://github.com/marianzange), [Alexander Pepper](https://github.com/apepper), [Alessandro Palumbo](https://github.com/apalumbo), [Sachin Shekhar](https://github.com/SachinShekhar), [Ivan Martos](https://github.com/ivanmartos), [Zach Anthony](https://github.com/zach-anthony), [Peter Savnik](https://github.com/savnik), and [Sven Milewski](https://github.com/svenmilewski).
|
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
// Types shared between trigger/api-gateway-authorizer.d.ts and api-gateway-proxy.d.ts
|
|
2
|
-
|
|
3
|
-
// Poorly documented, but API Gateway will just fail internally if
|
|
4
|
-
// the context type does not match this.
|
|
5
|
-
// Note that although non-string types will be accepted, they will be
|
|
6
|
-
// coerced to strings on the other side.
|
|
7
|
-
export interface APIGatewayAuthorizerResultContext {
|
|
8
|
-
[name: string]: string | number | boolean | null | undefined;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
// Default authorizer type, prefer using a specific type with the "...WithAuthorizer..." variant types.
|
|
12
|
-
// Note that this doesn't have to be a context from a custom lambda outhorizer, AWS also has a cognito
|
|
13
|
-
// authorizer type and could add more, so the property won't always be a string.
|
|
14
|
-
export type APIGatewayEventDefaultAuthorizerContext = undefined | null | {
|
|
15
|
-
[name: string]: any;
|
|
16
|
-
};
|
|
17
|
-
|
|
18
|
-
export type APIGatewayEventRequestContext =
|
|
19
|
-
APIGatewayEventRequestContextWithAuthorizer<APIGatewayEventDefaultAuthorizerContext>;
|
|
20
|
-
|
|
21
|
-
// The requestContext property of both request authorizer and proxy integration events.
|
|
22
|
-
export interface APIGatewayEventRequestContextWithAuthorizer<TAuthorizerContext> {
|
|
23
|
-
accountId: string;
|
|
24
|
-
apiId: string;
|
|
25
|
-
// This one is a bit confusing: it is not actually present in authorizer calls
|
|
26
|
-
// and proxy calls without an authorizer. We model this by allowing undefined in the type,
|
|
27
|
-
// since it ends up the same and avoids breaking users that are testing the property.
|
|
28
|
-
// This lets us allow parameterizing the authorizer for proxy events that know what authorizer
|
|
29
|
-
// context values they have.
|
|
30
|
-
authorizer: TAuthorizerContext;
|
|
31
|
-
connectedAt?: number;
|
|
32
|
-
connectionId?: string;
|
|
33
|
-
domainName?: string;
|
|
34
|
-
domainPrefix?: string;
|
|
35
|
-
eventType?: string;
|
|
36
|
-
extendedRequestId?: string;
|
|
37
|
-
protocol: string;
|
|
38
|
-
httpMethod: string;
|
|
39
|
-
identity: APIGatewayEventIdentity;
|
|
40
|
-
messageDirection?: string;
|
|
41
|
-
messageId?: string | null;
|
|
42
|
-
path: string;
|
|
43
|
-
stage: string;
|
|
44
|
-
requestId: string;
|
|
45
|
-
requestTime?: string;
|
|
46
|
-
requestTimeEpoch: number;
|
|
47
|
-
resourceId: string;
|
|
48
|
-
resourcePath: string;
|
|
49
|
-
routeKey?: string;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
export interface APIGatewayEventClientCertificate {
|
|
53
|
-
clientCertPem: string;
|
|
54
|
-
serialNumber: string;
|
|
55
|
-
subjectDN: string;
|
|
56
|
-
issuerDN: string;
|
|
57
|
-
validity: {
|
|
58
|
-
notAfter: string;
|
|
59
|
-
notBefore: string;
|
|
60
|
-
};
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
export interface APIGatewayEventIdentity {
|
|
64
|
-
accessKey: string | null;
|
|
65
|
-
accountId: string | null;
|
|
66
|
-
apiKey: string | null;
|
|
67
|
-
apiKeyId: string | null;
|
|
68
|
-
caller: string | null;
|
|
69
|
-
clientCert: APIGatewayEventClientCertificate | null;
|
|
70
|
-
cognitoAuthenticationProvider: string | null;
|
|
71
|
-
cognitoAuthenticationType: string | null;
|
|
72
|
-
cognitoIdentityId: string | null;
|
|
73
|
-
cognitoIdentityPoolId: string | null;
|
|
74
|
-
principalOrgId: string | null;
|
|
75
|
-
sourceIp: string;
|
|
76
|
-
user: string | null;
|
|
77
|
-
userAgent: string | null;
|
|
78
|
-
userArn: string | null;
|
|
79
|
-
}
|
|
@@ -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
|
-
}
|