@aligent/cdk-prerender-proxy 0.2.5-experimental1 → 0.2.5-experimental2

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.
Files changed (201) hide show
  1. package/lib/error-response-construct.d.ts +0 -1
  2. package/lib/error-response-construct.js +4 -5
  3. package/lib/handlers/cache-control.ts +21 -0
  4. package/lib/handlers/error-response.ts +51 -0
  5. package/lib/handlers/node_modules/.package-lock.json +55 -0
  6. package/lib/handlers/node_modules/@types/aws-lambda/LICENSE +21 -0
  7. package/lib/handlers/node_modules/@types/aws-lambda/README.md +16 -0
  8. package/lib/handlers/node_modules/@types/aws-lambda/common/api-gateway.d.ts +79 -0
  9. package/lib/handlers/node_modules/@types/aws-lambda/common/cloudfront.d.ts +79 -0
  10. package/lib/handlers/node_modules/@types/aws-lambda/handler.d.ts +171 -0
  11. package/lib/handlers/node_modules/@types/aws-lambda/index.d.ts +85 -0
  12. package/lib/handlers/node_modules/@types/aws-lambda/package.json +210 -0
  13. package/lib/handlers/node_modules/@types/aws-lambda/trigger/alb.d.ts +48 -0
  14. package/lib/handlers/node_modules/@types/aws-lambda/trigger/api-gateway-authorizer.d.ts +174 -0
  15. package/lib/handlers/node_modules/@types/aws-lambda/trigger/api-gateway-proxy.d.ts +187 -0
  16. package/lib/handlers/node_modules/@types/aws-lambda/trigger/appsync-resolver.d.ts +51 -0
  17. package/lib/handlers/node_modules/@types/aws-lambda/trigger/cloudformation-custom-resource.d.ts +68 -0
  18. package/lib/handlers/node_modules/@types/aws-lambda/trigger/cloudfront-request.d.ts +20 -0
  19. package/lib/handlers/node_modules/@types/aws-lambda/trigger/cloudfront-response.d.ts +21 -0
  20. package/lib/handlers/node_modules/@types/aws-lambda/trigger/cloudwatch-events.d.ts +8 -0
  21. package/lib/handlers/node_modules/@types/aws-lambda/trigger/cloudwatch-logs.d.ts +37 -0
  22. package/lib/handlers/node_modules/@types/aws-lambda/trigger/codebuild-cloudwatch-state.d.ts +104 -0
  23. package/lib/handlers/node_modules/@types/aws-lambda/trigger/codepipeline-cloudwatch-action.d.ts +31 -0
  24. package/lib/handlers/node_modules/@types/aws-lambda/trigger/codepipeline-cloudwatch-pipeline.d.ts +32 -0
  25. package/lib/handlers/node_modules/@types/aws-lambda/trigger/codepipeline-cloudwatch-stage.d.ts +23 -0
  26. package/lib/handlers/node_modules/@types/aws-lambda/trigger/codepipeline-cloudwatch.d.ts +11 -0
  27. package/lib/handlers/node_modules/@types/aws-lambda/trigger/codepipeline.d.ts +55 -0
  28. package/lib/handlers/node_modules/@types/aws-lambda/trigger/cognito-user-pool-trigger/_common.d.ts +41 -0
  29. package/lib/handlers/node_modules/@types/aws-lambda/trigger/cognito-user-pool-trigger/create-auth-challenge.d.ts +22 -0
  30. package/lib/handlers/node_modules/@types/aws-lambda/trigger/cognito-user-pool-trigger/custom-email-sender.d.ts +86 -0
  31. package/lib/handlers/node_modules/@types/aws-lambda/trigger/cognito-user-pool-trigger/custom-message.d.ts +44 -0
  32. package/lib/handlers/node_modules/@types/aws-lambda/trigger/cognito-user-pool-trigger/define-auth-challenge.d.ts +21 -0
  33. package/lib/handlers/node_modules/@types/aws-lambda/trigger/cognito-user-pool-trigger/index.d.ts +119 -0
  34. package/lib/handlers/node_modules/@types/aws-lambda/trigger/cognito-user-pool-trigger/post-authentication.d.ts +15 -0
  35. package/lib/handlers/node_modules/@types/aws-lambda/trigger/cognito-user-pool-trigger/post-confirmation.d.ts +22 -0
  36. package/lib/handlers/node_modules/@types/aws-lambda/trigger/cognito-user-pool-trigger/pre-authentication.d.ts +15 -0
  37. package/lib/handlers/node_modules/@types/aws-lambda/trigger/cognito-user-pool-trigger/pre-signup.d.ts +31 -0
  38. package/lib/handlers/node_modules/@types/aws-lambda/trigger/cognito-user-pool-trigger/pre-token-generation.d.ts +45 -0
  39. package/lib/handlers/node_modules/@types/aws-lambda/trigger/cognito-user-pool-trigger/user-migration.d.ts +39 -0
  40. package/lib/handlers/node_modules/@types/aws-lambda/trigger/cognito-user-pool-trigger/verify-auth-challenge-response.d.ts +20 -0
  41. package/lib/handlers/node_modules/@types/aws-lambda/trigger/connect-contact-flow.d.ts +65 -0
  42. package/lib/handlers/node_modules/@types/aws-lambda/trigger/dynamodb-stream.d.ts +45 -0
  43. package/lib/handlers/node_modules/@types/aws-lambda/trigger/eventbridge.d.ts +18 -0
  44. package/lib/handlers/node_modules/@types/aws-lambda/trigger/iot.d.ts +28 -0
  45. package/lib/handlers/node_modules/@types/aws-lambda/trigger/kinesis-firehose-transformation.d.ts +45 -0
  46. package/lib/handlers/node_modules/@types/aws-lambda/trigger/kinesis-stream.d.ts +28 -0
  47. package/lib/handlers/node_modules/@types/aws-lambda/trigger/lex.d.ts +116 -0
  48. package/lib/handlers/node_modules/@types/aws-lambda/trigger/msk.d.ts +21 -0
  49. package/lib/handlers/node_modules/@types/aws-lambda/trigger/s3-batch.d.ts +41 -0
  50. package/lib/handlers/node_modules/@types/aws-lambda/trigger/s3.d.ts +60 -0
  51. package/lib/handlers/node_modules/@types/aws-lambda/trigger/ses.d.ts +103 -0
  52. package/lib/handlers/node_modules/@types/aws-lambda/trigger/sns.d.ts +38 -0
  53. package/lib/handlers/node_modules/@types/aws-lambda/trigger/sqs.d.ts +46 -0
  54. package/lib/handlers/node_modules/@types/node/LICENSE +21 -0
  55. package/lib/handlers/node_modules/@types/node/README.md +16 -0
  56. package/lib/handlers/node_modules/@types/node/assert/strict.d.ts +4 -0
  57. package/lib/handlers/node_modules/@types/node/assert.d.ts +124 -0
  58. package/lib/handlers/node_modules/@types/node/async_hooks.d.ts +226 -0
  59. package/lib/handlers/node_modules/@types/node/base.d.ts +19 -0
  60. package/lib/handlers/node_modules/@types/node/buffer.d.ts +84 -0
  61. package/lib/handlers/node_modules/@types/node/child_process.d.ts +526 -0
  62. package/lib/handlers/node_modules/@types/node/cluster.d.ts +262 -0
  63. package/lib/handlers/node_modules/@types/node/console.d.ts +133 -0
  64. package/lib/handlers/node_modules/@types/node/constants.d.ts +13 -0
  65. package/lib/handlers/node_modules/@types/node/crypto.d.ts +1580 -0
  66. package/lib/handlers/node_modules/@types/node/dgram.d.ts +141 -0
  67. package/lib/handlers/node_modules/@types/node/diagnostic_channel.d.ts +34 -0
  68. package/lib/handlers/node_modules/@types/node/dns/promises.d.ts +97 -0
  69. package/lib/handlers/node_modules/@types/node/dns.d.ts +322 -0
  70. package/lib/handlers/node_modules/@types/node/domain.d.ts +24 -0
  71. package/lib/handlers/node_modules/@types/node/events.d.ts +93 -0
  72. package/lib/handlers/node_modules/@types/node/fs/promises.d.ts +592 -0
  73. package/lib/handlers/node_modules/@types/node/fs.d.ts +2239 -0
  74. package/lib/handlers/node_modules/@types/node/globals.d.ts +655 -0
  75. package/lib/handlers/node_modules/@types/node/globals.global.d.ts +1 -0
  76. package/lib/handlers/node_modules/@types/node/http.d.ts +434 -0
  77. package/lib/handlers/node_modules/@types/node/http2.d.ts +976 -0
  78. package/lib/handlers/node_modules/@types/node/https.d.ts +36 -0
  79. package/lib/handlers/node_modules/@types/node/index.d.ts +58 -0
  80. package/lib/handlers/node_modules/@types/node/inspector.d.ts +3041 -0
  81. package/lib/handlers/node_modules/@types/node/module.d.ts +52 -0
  82. package/lib/handlers/node_modules/@types/node/net.d.ts +326 -0
  83. package/lib/handlers/node_modules/@types/node/os.d.ts +239 -0
  84. package/lib/handlers/node_modules/@types/node/package.json +232 -0
  85. package/lib/handlers/node_modules/@types/node/path.d.ts +163 -0
  86. package/lib/handlers/node_modules/@types/node/perf_hooks.d.ts +310 -0
  87. package/lib/handlers/node_modules/@types/node/process.d.ts +461 -0
  88. package/lib/handlers/node_modules/@types/node/punycode.d.ts +75 -0
  89. package/lib/handlers/node_modules/@types/node/querystring.d.ts +28 -0
  90. package/lib/handlers/node_modules/@types/node/readline.d.ts +192 -0
  91. package/lib/handlers/node_modules/@types/node/repl.d.ts +395 -0
  92. package/lib/handlers/node_modules/@types/node/stream/promises.d.ts +67 -0
  93. package/lib/handlers/node_modules/@types/node/stream.d.ts +471 -0
  94. package/lib/handlers/node_modules/@types/node/string_decoder.d.ts +7 -0
  95. package/lib/handlers/node_modules/@types/node/timers/promises.d.ts +21 -0
  96. package/lib/handlers/node_modules/@types/node/timers.d.ts +27 -0
  97. package/lib/handlers/node_modules/@types/node/tls.d.ts +793 -0
  98. package/lib/handlers/node_modules/@types/node/trace_events.d.ts +61 -0
  99. package/lib/handlers/node_modules/@types/node/ts3.6/assert.d.ts +98 -0
  100. package/lib/handlers/node_modules/@types/node/ts3.6/base.d.ts +68 -0
  101. package/lib/handlers/node_modules/@types/node/ts3.6/index.d.ts +7 -0
  102. package/lib/handlers/node_modules/@types/node/tty.d.ts +66 -0
  103. package/lib/handlers/node_modules/@types/node/url.d.ts +116 -0
  104. package/lib/handlers/node_modules/@types/node/util/types.d.ts +53 -0
  105. package/lib/handlers/node_modules/@types/node/util.d.ts +156 -0
  106. package/lib/handlers/node_modules/@types/node/v8.d.ts +198 -0
  107. package/lib/handlers/node_modules/@types/node/vm.d.ts +152 -0
  108. package/lib/handlers/node_modules/@types/node/wasi.d.ts +86 -0
  109. package/lib/handlers/node_modules/@types/node/worker_threads.d.ts +282 -0
  110. package/lib/handlers/node_modules/@types/node/zlib.d.ts +361 -0
  111. package/lib/handlers/node_modules/axios/CHANGELOG.md +685 -0
  112. package/lib/handlers/node_modules/axios/LICENSE +19 -0
  113. package/lib/handlers/node_modules/axios/README.md +800 -0
  114. package/lib/handlers/node_modules/axios/UPGRADE_GUIDE.md +162 -0
  115. package/lib/handlers/node_modules/axios/dist/axios.js +1756 -0
  116. package/lib/handlers/node_modules/axios/dist/axios.map +1 -0
  117. package/lib/handlers/node_modules/axios/dist/axios.min.js +3 -0
  118. package/lib/handlers/node_modules/axios/dist/axios.min.map +1 -0
  119. package/lib/handlers/node_modules/axios/index.d.ts +161 -0
  120. package/lib/handlers/node_modules/axios/index.js +1 -0
  121. package/lib/handlers/node_modules/axios/lib/adapters/README.md +37 -0
  122. package/lib/handlers/node_modules/axios/lib/adapters/http.js +303 -0
  123. package/lib/handlers/node_modules/axios/lib/adapters/xhr.js +179 -0
  124. package/lib/handlers/node_modules/axios/lib/axios.js +56 -0
  125. package/lib/handlers/node_modules/axios/lib/cancel/Cancel.js +19 -0
  126. package/lib/handlers/node_modules/axios/lib/cancel/CancelToken.js +57 -0
  127. package/lib/handlers/node_modules/axios/lib/cancel/isCancel.js +5 -0
  128. package/lib/handlers/node_modules/axios/lib/core/Axios.js +95 -0
  129. package/lib/handlers/node_modules/axios/lib/core/InterceptorManager.js +52 -0
  130. package/lib/handlers/node_modules/axios/lib/core/README.md +7 -0
  131. package/lib/handlers/node_modules/axios/lib/core/buildFullPath.js +20 -0
  132. package/lib/handlers/node_modules/axios/lib/core/createError.js +18 -0
  133. package/lib/handlers/node_modules/axios/lib/core/dispatchRequest.js +79 -0
  134. package/lib/handlers/node_modules/axios/lib/core/enhanceError.js +42 -0
  135. package/lib/handlers/node_modules/axios/lib/core/mergeConfig.js +87 -0
  136. package/lib/handlers/node_modules/axios/lib/core/settle.js +25 -0
  137. package/lib/handlers/node_modules/axios/lib/core/transformData.js +20 -0
  138. package/lib/handlers/node_modules/axios/lib/defaults.js +98 -0
  139. package/lib/handlers/node_modules/axios/lib/helpers/README.md +7 -0
  140. package/lib/handlers/node_modules/axios/lib/helpers/bind.js +11 -0
  141. package/lib/handlers/node_modules/axios/lib/helpers/buildURL.js +70 -0
  142. package/lib/handlers/node_modules/axios/lib/helpers/combineURLs.js +14 -0
  143. package/lib/handlers/node_modules/axios/lib/helpers/cookies.js +53 -0
  144. package/lib/handlers/node_modules/axios/lib/helpers/deprecatedMethod.js +24 -0
  145. package/lib/handlers/node_modules/axios/lib/helpers/isAbsoluteURL.js +14 -0
  146. package/lib/handlers/node_modules/axios/lib/helpers/isAxiosError.js +11 -0
  147. package/lib/handlers/node_modules/axios/lib/helpers/isURLSameOrigin.js +68 -0
  148. package/lib/handlers/node_modules/axios/lib/helpers/normalizeHeaderName.js +12 -0
  149. package/lib/handlers/node_modules/axios/lib/helpers/parseHeaders.js +53 -0
  150. package/lib/handlers/node_modules/axios/lib/helpers/spread.js +27 -0
  151. package/lib/handlers/node_modules/axios/lib/utils.js +351 -0
  152. package/lib/handlers/node_modules/axios/package.json +86 -0
  153. package/lib/handlers/node_modules/buffer-from/LICENSE +21 -0
  154. package/lib/handlers/node_modules/buffer-from/index.js +69 -0
  155. package/lib/handlers/node_modules/buffer-from/package.json +19 -0
  156. package/lib/handlers/node_modules/buffer-from/readme.md +69 -0
  157. package/lib/handlers/node_modules/follow-redirects/LICENSE +18 -0
  158. package/lib/handlers/node_modules/follow-redirects/README.md +148 -0
  159. package/lib/handlers/node_modules/follow-redirects/debug.js +14 -0
  160. package/lib/handlers/node_modules/follow-redirects/http.js +1 -0
  161. package/lib/handlers/node_modules/follow-redirects/https.js +1 -0
  162. package/lib/handlers/node_modules/follow-redirects/index.js +531 -0
  163. package/lib/handlers/node_modules/follow-redirects/package.json +59 -0
  164. package/lib/handlers/node_modules/source-map/CHANGELOG.md +301 -0
  165. package/lib/handlers/node_modules/source-map/LICENSE +28 -0
  166. package/lib/handlers/node_modules/source-map/README.md +742 -0
  167. package/lib/handlers/node_modules/source-map/dist/source-map.debug.js +3234 -0
  168. package/lib/handlers/node_modules/source-map/dist/source-map.js +3233 -0
  169. package/lib/handlers/node_modules/source-map/dist/source-map.min.js +2 -0
  170. package/lib/handlers/node_modules/source-map/dist/source-map.min.js.map +1 -0
  171. package/lib/handlers/node_modules/source-map/lib/array-set.js +121 -0
  172. package/lib/handlers/node_modules/source-map/lib/base64-vlq.js +140 -0
  173. package/lib/handlers/node_modules/source-map/lib/base64.js +67 -0
  174. package/lib/handlers/node_modules/source-map/lib/binary-search.js +111 -0
  175. package/lib/handlers/node_modules/source-map/lib/mapping-list.js +79 -0
  176. package/lib/handlers/node_modules/source-map/lib/quick-sort.js +114 -0
  177. package/lib/handlers/node_modules/source-map/lib/source-map-consumer.js +1145 -0
  178. package/lib/handlers/node_modules/source-map/lib/source-map-generator.js +425 -0
  179. package/lib/handlers/node_modules/source-map/lib/source-node.js +413 -0
  180. package/lib/handlers/node_modules/source-map/lib/util.js +488 -0
  181. package/lib/handlers/node_modules/source-map/package.json +73 -0
  182. package/lib/handlers/node_modules/source-map/source-map.d.ts +98 -0
  183. package/lib/handlers/node_modules/source-map/source-map.js +8 -0
  184. package/lib/handlers/node_modules/source-map-support/LICENSE.md +21 -0
  185. package/lib/handlers/node_modules/source-map-support/README.md +284 -0
  186. package/lib/handlers/node_modules/source-map-support/browser-source-map-support.js +114 -0
  187. package/lib/handlers/node_modules/source-map-support/package.json +31 -0
  188. package/lib/handlers/node_modules/source-map-support/register.js +1 -0
  189. package/lib/handlers/node_modules/source-map-support/source-map-support.js +604 -0
  190. package/lib/handlers/package-lock.json +108 -0
  191. package/lib/handlers/package.json +13 -0
  192. package/lib/handlers/prerender-check.ts +27 -0
  193. package/lib/handlers/prerender.ts +43 -0
  194. package/lib/handlers/tsconfig.json +24 -0
  195. package/lib/prerender-cf-cache-control-construct.d.ts +0 -1
  196. package/lib/prerender-cf-cache-control-construct.js +4 -5
  197. package/lib/prerender-check-construct.d.ts +0 -1
  198. package/lib/prerender-check-construct.js +4 -5
  199. package/lib/prerender-construct.d.ts +0 -1
  200. package/lib/prerender-construct.js +4 -5
  201. package/package.json +3 -3
@@ -1,6 +1,5 @@
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";
4
3
  export interface ErrorResponseFunctionOptions {
5
4
  pathPrefix?: string;
6
5
  }
@@ -5,18 +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");
9
8
  class ErrorResponseFunction extends core_1.Construct {
10
9
  constructor(scope, id, options) {
11
10
  var _a;
12
11
  super(scope, id);
13
12
  this.edgeFunction = new aws_cloudfront_1.experimental.EdgeFunction(this, 'ErrorResponseFunction', {
14
13
  code: bundling_1.Bundling.bundle({
15
- entry: `${__dirname}/node_modules/@aligent/cdk-lambda-at-edge-handlers/lib/error-response.js`,
14
+ entry: `${__dirname}/handlers/error-response.ts`,
16
15
  runtime: aws_lambda_1.Runtime.NODEJS_14_X,
17
16
  sourceMap: true,
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`,
17
+ projectRoot: `${__dirname}/handlers/`,
18
+ depsLockFilePath: `${__dirname}/handlers/package-lock.json`,
20
19
  // Define options replace values at build time so we can use environment variables to test locally
21
20
  // and replace during build/deploy with static values. This gets around the lambda@edge limitation
22
21
  // of no environment variables at runtime.
@@ -30,4 +29,4 @@ class ErrorResponseFunction extends core_1.Construct {
30
29
  }
31
30
  }
32
31
  exports.ErrorResponseFunction = ErrorResponseFunction;
33
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZXJyb3ItcmVzcG9uc2UtY29uc3RydWN0LmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiZXJyb3ItcmVzcG9uc2UtY29uc3RydWN0LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7OztBQUFBLHdDQUEwQztBQUMxQyxzRUFBbUU7QUFDbkUsb0RBQThDO0FBQzlDLDREQUF1RDtBQUV2RCxnREFBNkM7QUFNN0MsTUFBYSxxQkFBc0IsU0FBUSxnQkFBUztJQUdoRCxZQUFZLEtBQWdCLEVBQUUsRUFBVSxFQUFFLE9BQXFDOztRQUMzRSxLQUFLLENBQUMsS0FBSyxFQUFFLEVBQUUsQ0FBQyxDQUFDO1FBRWp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W1iZGEtYXQtZWRnZS1oYW5kbGVycy9gLFxuICAgICAgICAgICAgICAgIGRlcHNMb2NrRmlsZVBhdGg6IGAke19fZGlybmFtZX0vbm9kZV9tb2R1bGVzL0BhbGlnZW50L2Nkay1sYW1iZGEtYXQtZWRnZS1oYW5kbGVycy9wYWNrYWdlLWxvY2suanNvbmAsXG4gICAgICAgICAgICAgICAgLy8gRGVmaW5lIG9wdGlvbnMgcmVwbGFjZSB2YWx1ZXMgYXQgYnVpbGQgdGltZSBzbyB3ZSBjYW4gdXNlIGVudmlyb25tZW50IHZhcmlhYmxlcyB0byB0ZXN0IGxvY2FsbHlcbiAgICAgICAgICAgICAgICAvLyBhbmQgcmVwbGFjZSBkdXJpbmcgYnVpbGQvZGVwbG95IHdpdGggc3RhdGljIHZhbHVlcy4gVGhpcyBnZXRzIGFyb3VuZCB0aGUgbGFtYmRhQGVkZ2UgbGltaXRhdGlvblxuICAgICAgICAgICAgICAgIC8vIG9mIG5vIGVudmlyb25tZW50IHZhcmlhYmxlcyBhdCBydW50aW1lLlxuICAgICAgICAgICAgICAgIGRlZmluZToge1xuICAgICAgICAgICAgICAgICAgJ3Byb2Nlc3MuZW52LlBBVEhfUFJFRklYJzogSlNPTi5zdHJpbmdpZnkob3B0aW9ucy5wYXRoUHJlZml4ID8/ICcnKSxcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgIH0gYXMgYW55KSxcbiAgICAgICAgICAgICAgcnVudGltZTogUnVudGltZS5OT0RFSlNfMTRfWCxcbiAgICAgICAgICAgICAgaGFuZGxlcjogJ2luZGV4LmhhbmRsZXInLFxuICAgICAgICAgICAgfVxuICAgICAgICAgICk7XG4gICAgfVxufVxuIl19
32
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZXJyb3ItcmVzcG9uc2UtY29uc3RydWN0LmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiZXJyb3ItcmVzcG9uc2UtY29uc3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U18xNF9YLFxuICAgICAgICAgICAgICAgIHNvdXJjZU1hcDogdHJ1ZSxcbiAgICAgICAgICAgICAgICBwcm9qZWN0Um9vdDogYCR7X19kaXJuYW1lfS9oYW5kbGVycy9gLFxuICAgICAgICAgICAgICAgIGRlcHNMb2NrRmlsZVBhdGg6IGAke19fZGlybmFtZX0vaGFuZGxlcnMvcGFja2FnZS1sb2NrLmpzb25gLFxuICAgICAgICAgICAgICAgIC8vIERlZmluZSBvcHRpb25zIHJlcGxhY2UgdmFsdWVzIGF0IGJ1aWxkIHRpbWUgc28gd2UgY2FuIHVzZSBlbnZpcm9ubWVudCB2YXJpYWJsZXMgdG8gdGVzdCBsb2NhbGx5XG4gICAgICAgICAgICAgICAgLy8gYW5kIHJlcGxhY2UgZHVyaW5nIGJ1aWxkL2RlcGxveSB3aXRoIHN0YXRpYyB2YWx1ZXMuIFRoaXMgZ2V0cyBhcm91bmQgdGhlIGxhbWJkYUBlZGdlIGxpbWl0YXRpb25cbiAgICAgICAgICAgICAgICAvLyBvZiBubyBlbnZpcm9ubWVudCB2YXJpYWJsZXMgYXQgcnVudGltZS5cbiAgICAgICAgICAgICAgICBkZWZpbmU6IHtcbiAgICAgICAgICAgICAgICAgICdwcm9jZXNzLmVudi5QQVRIX1BSRUZJWCc6IEpTT04uc3RyaW5naWZ5KG9wdGlvbnMucGF0aFByZWZpeCA/PyAnJyksXG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICB9IGFzIGFueSksXG4gICAgICAgICAgICAgIHJ1bnRpbWU6IFJ1bnRpbWUuTk9ERUpTXzE0X1gsXG4gICAgICAgICAgICAgIGhhbmRsZXI6ICdpbmRleC5oYW5kbGVyJyxcbiAgICAgICAgICAgIH1cbiAgICAgICAgICApO1xuICAgIH1cbn1cbiJdfQ==
@@ -0,0 +1,21 @@
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
+ }
@@ -0,0 +1,51 @@
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
+ }
@@ -0,0 +1,55 @@
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
+ }
@@ -0,0 +1,21 @@
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
@@ -0,0 +1,16 @@
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).
@@ -0,0 +1,79 @@
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
+ }
@@ -0,0 +1,79 @@
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
+ }
@@ -0,0 +1,171 @@
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;
@@ -0,0 +1,85 @@
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;