@aligent/cdk-prerender-proxy 0.2.5-experimental5 → 0.2.6

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 (203) hide show
  1. package/index.d.ts +1 -1
  2. package/index.js +1 -1
  3. package/lib/error-response-construct.js +5 -5
  4. package/lib/handlers/cache-control.ts +22 -3
  5. package/lib/handlers/error-response.ts +61 -3
  6. package/lib/handlers/node_modules/.package-lock.json +55 -0
  7. package/lib/handlers/node_modules/@types/aws-lambda/LICENSE +21 -0
  8. package/lib/handlers/node_modules/@types/aws-lambda/README.md +16 -0
  9. package/lib/handlers/node_modules/@types/aws-lambda/common/api-gateway.d.ts +79 -0
  10. package/lib/handlers/node_modules/@types/aws-lambda/common/cloudfront.d.ts +79 -0
  11. package/lib/handlers/node_modules/@types/aws-lambda/handler.d.ts +171 -0
  12. package/lib/handlers/node_modules/@types/aws-lambda/index.d.ts +85 -0
  13. package/lib/handlers/node_modules/@types/aws-lambda/package.json +210 -0
  14. package/lib/handlers/node_modules/@types/aws-lambda/trigger/alb.d.ts +48 -0
  15. package/lib/handlers/node_modules/@types/aws-lambda/trigger/api-gateway-authorizer.d.ts +174 -0
  16. package/lib/handlers/node_modules/@types/aws-lambda/trigger/api-gateway-proxy.d.ts +187 -0
  17. package/lib/handlers/node_modules/@types/aws-lambda/trigger/appsync-resolver.d.ts +51 -0
  18. package/lib/handlers/node_modules/@types/aws-lambda/trigger/cloudformation-custom-resource.d.ts +68 -0
  19. package/lib/handlers/node_modules/@types/aws-lambda/trigger/cloudfront-request.d.ts +20 -0
  20. package/lib/handlers/node_modules/@types/aws-lambda/trigger/cloudfront-response.d.ts +21 -0
  21. package/lib/handlers/node_modules/@types/aws-lambda/trigger/cloudwatch-events.d.ts +8 -0
  22. package/lib/handlers/node_modules/@types/aws-lambda/trigger/cloudwatch-logs.d.ts +37 -0
  23. package/lib/handlers/node_modules/@types/aws-lambda/trigger/codebuild-cloudwatch-state.d.ts +104 -0
  24. package/lib/handlers/node_modules/@types/aws-lambda/trigger/codepipeline-cloudwatch-action.d.ts +31 -0
  25. package/lib/handlers/node_modules/@types/aws-lambda/trigger/codepipeline-cloudwatch-pipeline.d.ts +32 -0
  26. package/lib/handlers/node_modules/@types/aws-lambda/trigger/codepipeline-cloudwatch-stage.d.ts +23 -0
  27. package/lib/handlers/node_modules/@types/aws-lambda/trigger/codepipeline-cloudwatch.d.ts +11 -0
  28. package/lib/handlers/node_modules/@types/aws-lambda/trigger/codepipeline.d.ts +55 -0
  29. package/lib/handlers/node_modules/@types/aws-lambda/trigger/cognito-user-pool-trigger/_common.d.ts +41 -0
  30. package/lib/handlers/node_modules/@types/aws-lambda/trigger/cognito-user-pool-trigger/create-auth-challenge.d.ts +22 -0
  31. package/lib/handlers/node_modules/@types/aws-lambda/trigger/cognito-user-pool-trigger/custom-email-sender.d.ts +86 -0
  32. package/lib/handlers/node_modules/@types/aws-lambda/trigger/cognito-user-pool-trigger/custom-message.d.ts +44 -0
  33. package/lib/handlers/node_modules/@types/aws-lambda/trigger/cognito-user-pool-trigger/define-auth-challenge.d.ts +21 -0
  34. package/lib/handlers/node_modules/@types/aws-lambda/trigger/cognito-user-pool-trigger/index.d.ts +119 -0
  35. package/lib/handlers/node_modules/@types/aws-lambda/trigger/cognito-user-pool-trigger/post-authentication.d.ts +15 -0
  36. package/lib/handlers/node_modules/@types/aws-lambda/trigger/cognito-user-pool-trigger/post-confirmation.d.ts +22 -0
  37. package/lib/handlers/node_modules/@types/aws-lambda/trigger/cognito-user-pool-trigger/pre-authentication.d.ts +15 -0
  38. package/lib/handlers/node_modules/@types/aws-lambda/trigger/cognito-user-pool-trigger/pre-signup.d.ts +31 -0
  39. package/lib/handlers/node_modules/@types/aws-lambda/trigger/cognito-user-pool-trigger/pre-token-generation.d.ts +45 -0
  40. package/lib/handlers/node_modules/@types/aws-lambda/trigger/cognito-user-pool-trigger/user-migration.d.ts +39 -0
  41. package/lib/handlers/node_modules/@types/aws-lambda/trigger/cognito-user-pool-trigger/verify-auth-challenge-response.d.ts +20 -0
  42. package/lib/handlers/node_modules/@types/aws-lambda/trigger/connect-contact-flow.d.ts +65 -0
  43. package/lib/handlers/node_modules/@types/aws-lambda/trigger/dynamodb-stream.d.ts +45 -0
  44. package/lib/handlers/node_modules/@types/aws-lambda/trigger/eventbridge.d.ts +18 -0
  45. package/lib/handlers/node_modules/@types/aws-lambda/trigger/iot.d.ts +28 -0
  46. package/lib/handlers/node_modules/@types/aws-lambda/trigger/kinesis-firehose-transformation.d.ts +45 -0
  47. package/lib/handlers/node_modules/@types/aws-lambda/trigger/kinesis-stream.d.ts +28 -0
  48. package/lib/handlers/node_modules/@types/aws-lambda/trigger/lex.d.ts +116 -0
  49. package/lib/handlers/node_modules/@types/aws-lambda/trigger/msk.d.ts +21 -0
  50. package/lib/handlers/node_modules/@types/aws-lambda/trigger/s3-batch.d.ts +41 -0
  51. package/lib/handlers/node_modules/@types/aws-lambda/trigger/s3.d.ts +60 -0
  52. package/lib/handlers/node_modules/@types/aws-lambda/trigger/ses.d.ts +103 -0
  53. package/lib/handlers/node_modules/@types/aws-lambda/trigger/sns.d.ts +38 -0
  54. package/lib/handlers/node_modules/@types/aws-lambda/trigger/sqs.d.ts +46 -0
  55. package/lib/handlers/node_modules/@types/node/LICENSE +21 -0
  56. package/lib/handlers/node_modules/@types/node/README.md +16 -0
  57. package/lib/handlers/node_modules/@types/node/assert/strict.d.ts +4 -0
  58. package/lib/handlers/node_modules/@types/node/assert.d.ts +124 -0
  59. package/lib/handlers/node_modules/@types/node/async_hooks.d.ts +226 -0
  60. package/lib/handlers/node_modules/@types/node/base.d.ts +19 -0
  61. package/lib/handlers/node_modules/@types/node/buffer.d.ts +84 -0
  62. package/lib/handlers/node_modules/@types/node/child_process.d.ts +526 -0
  63. package/lib/handlers/node_modules/@types/node/cluster.d.ts +262 -0
  64. package/lib/handlers/node_modules/@types/node/console.d.ts +133 -0
  65. package/lib/handlers/node_modules/@types/node/constants.d.ts +13 -0
  66. package/lib/handlers/node_modules/@types/node/crypto.d.ts +1580 -0
  67. package/lib/handlers/node_modules/@types/node/dgram.d.ts +141 -0
  68. package/lib/handlers/node_modules/@types/node/diagnostic_channel.d.ts +34 -0
  69. package/lib/handlers/node_modules/@types/node/dns/promises.d.ts +97 -0
  70. package/lib/handlers/node_modules/@types/node/dns.d.ts +322 -0
  71. package/lib/handlers/node_modules/@types/node/domain.d.ts +24 -0
  72. package/lib/handlers/node_modules/@types/node/events.d.ts +93 -0
  73. package/lib/handlers/node_modules/@types/node/fs/promises.d.ts +592 -0
  74. package/lib/handlers/node_modules/@types/node/fs.d.ts +2239 -0
  75. package/lib/handlers/node_modules/@types/node/globals.d.ts +655 -0
  76. package/lib/handlers/node_modules/@types/node/globals.global.d.ts +1 -0
  77. package/lib/handlers/node_modules/@types/node/http.d.ts +434 -0
  78. package/lib/handlers/node_modules/@types/node/http2.d.ts +976 -0
  79. package/lib/handlers/node_modules/@types/node/https.d.ts +36 -0
  80. package/lib/handlers/node_modules/@types/node/index.d.ts +58 -0
  81. package/lib/handlers/node_modules/@types/node/inspector.d.ts +3041 -0
  82. package/lib/handlers/node_modules/@types/node/module.d.ts +52 -0
  83. package/lib/handlers/node_modules/@types/node/net.d.ts +326 -0
  84. package/lib/handlers/node_modules/@types/node/os.d.ts +239 -0
  85. package/lib/handlers/node_modules/@types/node/package.json +232 -0
  86. package/lib/handlers/node_modules/@types/node/path.d.ts +163 -0
  87. package/lib/handlers/node_modules/@types/node/perf_hooks.d.ts +310 -0
  88. package/lib/handlers/node_modules/@types/node/process.d.ts +461 -0
  89. package/lib/handlers/node_modules/@types/node/punycode.d.ts +75 -0
  90. package/lib/handlers/node_modules/@types/node/querystring.d.ts +28 -0
  91. package/lib/handlers/node_modules/@types/node/readline.d.ts +192 -0
  92. package/lib/handlers/node_modules/@types/node/repl.d.ts +395 -0
  93. package/lib/handlers/node_modules/@types/node/stream/promises.d.ts +67 -0
  94. package/lib/handlers/node_modules/@types/node/stream.d.ts +471 -0
  95. package/lib/handlers/node_modules/@types/node/string_decoder.d.ts +7 -0
  96. package/lib/handlers/node_modules/@types/node/timers/promises.d.ts +21 -0
  97. package/lib/handlers/node_modules/@types/node/timers.d.ts +27 -0
  98. package/lib/handlers/node_modules/@types/node/tls.d.ts +793 -0
  99. package/lib/handlers/node_modules/@types/node/trace_events.d.ts +61 -0
  100. package/lib/handlers/node_modules/@types/node/ts3.6/assert.d.ts +98 -0
  101. package/lib/handlers/node_modules/@types/node/ts3.6/base.d.ts +68 -0
  102. package/lib/handlers/node_modules/@types/node/ts3.6/index.d.ts +7 -0
  103. package/lib/handlers/node_modules/@types/node/tty.d.ts +66 -0
  104. package/lib/handlers/node_modules/@types/node/url.d.ts +116 -0
  105. package/lib/handlers/node_modules/@types/node/util/types.d.ts +53 -0
  106. package/lib/handlers/node_modules/@types/node/util.d.ts +156 -0
  107. package/lib/handlers/node_modules/@types/node/v8.d.ts +198 -0
  108. package/lib/handlers/node_modules/@types/node/vm.d.ts +152 -0
  109. package/lib/handlers/node_modules/@types/node/wasi.d.ts +86 -0
  110. package/lib/handlers/node_modules/@types/node/worker_threads.d.ts +282 -0
  111. package/lib/handlers/node_modules/@types/node/zlib.d.ts +361 -0
  112. package/lib/handlers/node_modules/axios/CHANGELOG.md +685 -0
  113. package/lib/handlers/node_modules/axios/LICENSE +19 -0
  114. package/lib/handlers/node_modules/axios/README.md +800 -0
  115. package/lib/handlers/node_modules/axios/UPGRADE_GUIDE.md +162 -0
  116. package/lib/handlers/node_modules/axios/dist/axios.js +1756 -0
  117. package/lib/handlers/node_modules/axios/dist/axios.map +1 -0
  118. package/lib/handlers/node_modules/axios/dist/axios.min.js +3 -0
  119. package/lib/handlers/node_modules/axios/dist/axios.min.map +1 -0
  120. package/lib/handlers/node_modules/axios/index.d.ts +161 -0
  121. package/lib/handlers/node_modules/axios/index.js +1 -0
  122. package/lib/handlers/node_modules/axios/lib/adapters/README.md +37 -0
  123. package/lib/handlers/node_modules/axios/lib/adapters/http.js +303 -0
  124. package/lib/handlers/node_modules/axios/lib/adapters/xhr.js +179 -0
  125. package/lib/handlers/node_modules/axios/lib/axios.js +56 -0
  126. package/lib/handlers/node_modules/axios/lib/cancel/Cancel.js +19 -0
  127. package/lib/handlers/node_modules/axios/lib/cancel/CancelToken.js +57 -0
  128. package/lib/handlers/node_modules/axios/lib/cancel/isCancel.js +5 -0
  129. package/lib/handlers/node_modules/axios/lib/core/Axios.js +95 -0
  130. package/lib/handlers/node_modules/axios/lib/core/InterceptorManager.js +52 -0
  131. package/lib/handlers/node_modules/axios/lib/core/README.md +7 -0
  132. package/lib/handlers/node_modules/axios/lib/core/buildFullPath.js +20 -0
  133. package/lib/handlers/node_modules/axios/lib/core/createError.js +18 -0
  134. package/lib/handlers/node_modules/axios/lib/core/dispatchRequest.js +79 -0
  135. package/lib/handlers/node_modules/axios/lib/core/enhanceError.js +42 -0
  136. package/lib/handlers/node_modules/axios/lib/core/mergeConfig.js +87 -0
  137. package/lib/handlers/node_modules/axios/lib/core/settle.js +25 -0
  138. package/lib/handlers/node_modules/axios/lib/core/transformData.js +20 -0
  139. package/lib/handlers/node_modules/axios/lib/defaults.js +98 -0
  140. package/lib/handlers/node_modules/axios/lib/helpers/README.md +7 -0
  141. package/lib/handlers/node_modules/axios/lib/helpers/bind.js +11 -0
  142. package/lib/handlers/node_modules/axios/lib/helpers/buildURL.js +70 -0
  143. package/lib/handlers/node_modules/axios/lib/helpers/combineURLs.js +14 -0
  144. package/lib/handlers/node_modules/axios/lib/helpers/cookies.js +53 -0
  145. package/lib/handlers/node_modules/axios/lib/helpers/deprecatedMethod.js +24 -0
  146. package/lib/handlers/node_modules/axios/lib/helpers/isAbsoluteURL.js +14 -0
  147. package/lib/handlers/node_modules/axios/lib/helpers/isAxiosError.js +11 -0
  148. package/lib/handlers/node_modules/axios/lib/helpers/isURLSameOrigin.js +68 -0
  149. package/lib/handlers/node_modules/axios/lib/helpers/normalizeHeaderName.js +12 -0
  150. package/lib/handlers/node_modules/axios/lib/helpers/parseHeaders.js +53 -0
  151. package/lib/handlers/node_modules/axios/lib/helpers/spread.js +27 -0
  152. package/lib/handlers/node_modules/axios/lib/utils.js +351 -0
  153. package/lib/handlers/node_modules/axios/package.json +86 -0
  154. package/lib/handlers/node_modules/buffer-from/LICENSE +21 -0
  155. package/lib/handlers/node_modules/buffer-from/index.js +69 -0
  156. package/lib/handlers/node_modules/buffer-from/package.json +19 -0
  157. package/lib/handlers/node_modules/buffer-from/readme.md +69 -0
  158. package/lib/handlers/node_modules/follow-redirects/LICENSE +18 -0
  159. package/lib/handlers/node_modules/follow-redirects/README.md +148 -0
  160. package/lib/handlers/node_modules/follow-redirects/debug.js +14 -0
  161. package/lib/handlers/node_modules/follow-redirects/http.js +1 -0
  162. package/lib/handlers/node_modules/follow-redirects/https.js +1 -0
  163. package/lib/handlers/node_modules/follow-redirects/index.js +531 -0
  164. package/lib/handlers/node_modules/follow-redirects/package.json +59 -0
  165. package/lib/handlers/node_modules/source-map/CHANGELOG.md +301 -0
  166. package/lib/handlers/node_modules/source-map/LICENSE +28 -0
  167. package/lib/handlers/node_modules/source-map/README.md +742 -0
  168. package/lib/handlers/node_modules/source-map/dist/source-map.debug.js +3234 -0
  169. package/lib/handlers/node_modules/source-map/dist/source-map.js +3233 -0
  170. package/lib/handlers/node_modules/source-map/dist/source-map.min.js +2 -0
  171. package/lib/handlers/node_modules/source-map/dist/source-map.min.js.map +1 -0
  172. package/lib/handlers/node_modules/source-map/lib/array-set.js +121 -0
  173. package/lib/handlers/node_modules/source-map/lib/base64-vlq.js +140 -0
  174. package/lib/handlers/node_modules/source-map/lib/base64.js +67 -0
  175. package/lib/handlers/node_modules/source-map/lib/binary-search.js +111 -0
  176. package/lib/handlers/node_modules/source-map/lib/mapping-list.js +79 -0
  177. package/lib/handlers/node_modules/source-map/lib/quick-sort.js +114 -0
  178. package/lib/handlers/node_modules/source-map/lib/source-map-consumer.js +1145 -0
  179. package/lib/handlers/node_modules/source-map/lib/source-map-generator.js +425 -0
  180. package/lib/handlers/node_modules/source-map/lib/source-node.js +413 -0
  181. package/lib/handlers/node_modules/source-map/lib/util.js +488 -0
  182. package/lib/handlers/node_modules/source-map/package.json +73 -0
  183. package/lib/handlers/node_modules/source-map/source-map.d.ts +98 -0
  184. package/lib/handlers/node_modules/source-map/source-map.js +8 -0
  185. package/lib/handlers/node_modules/source-map-support/LICENSE.md +21 -0
  186. package/lib/handlers/node_modules/source-map-support/README.md +284 -0
  187. package/lib/handlers/node_modules/source-map-support/browser-source-map-support.js +114 -0
  188. package/lib/handlers/node_modules/source-map-support/package.json +31 -0
  189. package/lib/handlers/node_modules/source-map-support/register.js +1 -0
  190. package/lib/handlers/node_modules/source-map-support/source-map-support.js +604 -0
  191. package/lib/handlers/package-lock.json +40 -1257
  192. package/lib/handlers/package.json +3 -7
  193. package/lib/handlers/prerender-check.ts +32 -3
  194. package/lib/handlers/prerender.ts +50 -3
  195. package/lib/handlers/tsconfig.json +3 -2
  196. package/lib/prerender-cf-cache-control-construct.d.ts +1 -1
  197. package/lib/prerender-cf-cache-control-construct.js +6 -6
  198. package/lib/prerender-check-construct.js +4 -4
  199. package/lib/prerender-construct.js +7 -7
  200. package/lib/prerender-lambda-construct.d.ts +4 -4
  201. package/lib/prerender-lambda-construct.js +5 -5
  202. package/package.json +4 -6
  203. package/tsconfig.json +1 -1
@@ -0,0 +1,187 @@
1
+ import {
2
+ APIGatewayEventDefaultAuthorizerContext,
3
+ APIGatewayEventRequestContextWithAuthorizer,
4
+ } from "../common/api-gateway";
5
+ import { Callback, Handler } from "../handler";
6
+
7
+ /**
8
+ * Works with Lambda Proxy Integration for Rest API or HTTP API integration Payload Format version 1.0
9
+ * @see - https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-develop-integrations-lambda.html
10
+ */
11
+ export type APIGatewayProxyHandler = Handler<APIGatewayProxyEvent, APIGatewayProxyResult>;
12
+ /**
13
+ * Works with Lambda Proxy Integration for Rest API or HTTP API integration Payload Format version 1.0
14
+ * @see - https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-develop-integrations-lambda.html
15
+ */
16
+ export type APIGatewayProxyCallback = Callback<APIGatewayProxyResult>;
17
+
18
+ /**
19
+ * Works with HTTP API integration Payload Format version 2.0
20
+ * @see - https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-develop-integrations-lambda.html
21
+ */
22
+ export type APIGatewayProxyHandlerV2<T = never> = Handler<APIGatewayProxyEventV2, APIGatewayProxyResultV2<T>>;
23
+ /**
24
+ * Works with HTTP API integration Payload Format version 2.0
25
+ * @see - https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-develop-integrations-lambda.html
26
+ */
27
+ export type APIGatewayProxyCallbackV2 = Callback<APIGatewayProxyResultV2>;
28
+
29
+ /**
30
+ * Works with Lambda Proxy Integration for Rest API or HTTP API integration Payload Format version 1.0
31
+ * @see - https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-develop-integrations-lambda.html
32
+ */
33
+ export type APIGatewayProxyEvent = APIGatewayProxyEventBase<APIGatewayEventDefaultAuthorizerContext>;
34
+
35
+ export type APIGatewayProxyWithLambdaAuthorizerHandler<TAuthorizerContext> =
36
+ Handler<APIGatewayProxyWithLambdaAuthorizerEvent<TAuthorizerContext>, APIGatewayProxyResult>;
37
+
38
+ export type APIGatewayProxyWithCognitoAuthorizerHandler =
39
+ Handler<APIGatewayProxyWithCognitoAuthorizerEvent, APIGatewayProxyResult>;
40
+
41
+ export type APIGatewayProxyWithLambdaAuthorizerEvent<TAuthorizerContext> =
42
+ APIGatewayProxyEventBase<APIGatewayEventLambdaAuthorizerContext<TAuthorizerContext>>;
43
+
44
+ export type APIGatewayProxyWithLambdaAuthorizerEventRequestContext<TAuthorizerContext> =
45
+ APIGatewayEventRequestContextWithAuthorizer<APIGatewayEventLambdaAuthorizerContext<TAuthorizerContext>>;
46
+
47
+ // API Gateway proxy integration mangles the context from a custom authorizer,
48
+ // converting all number or boolean properties to string, and adding some extra properties.
49
+ export type APIGatewayEventLambdaAuthorizerContext<TAuthorizerContext> = {
50
+ [P in keyof TAuthorizerContext]: TAuthorizerContext[P] extends null ? null : string;
51
+ } & {
52
+ principalId: string;
53
+ integrationLatency: number;
54
+ };
55
+
56
+ export type APIGatewayProxyWithCognitoAuthorizerEvent = APIGatewayProxyEventBase<APIGatewayProxyCognitoAuthorizer>;
57
+
58
+ // All claims are coerced into strings.
59
+ export interface APIGatewayProxyCognitoAuthorizer {
60
+ claims: {
61
+ [name: string]: string;
62
+ };
63
+ }
64
+
65
+ export interface APIGatewayProxyEventHeaders {
66
+ [name: string]: string | undefined;
67
+ }
68
+
69
+ export interface APIGatewayProxyEventMultiValueHeaders {
70
+ [name: string]: string[] | undefined;
71
+ }
72
+
73
+ export interface APIGatewayProxyEventPathParameters {
74
+ [name: string]: string | undefined;
75
+ }
76
+
77
+ export interface APIGatewayProxyEventQueryStringParameters {
78
+ [name: string]: string | undefined;
79
+ }
80
+
81
+ export interface APIGatewayProxyEventMultiValueQueryStringParameters {
82
+ [name: string]: string[] | undefined;
83
+ }
84
+
85
+ export interface APIGatewayProxyEventStageVariables {
86
+ [name: string]: string | undefined;
87
+ }
88
+
89
+ export interface APIGatewayProxyEventBase<TAuthorizerContext> {
90
+ body: string | null;
91
+ headers: APIGatewayProxyEventHeaders;
92
+ multiValueHeaders: APIGatewayProxyEventMultiValueHeaders;
93
+ httpMethod: string;
94
+ isBase64Encoded: boolean;
95
+ path: string;
96
+ pathParameters: APIGatewayProxyEventPathParameters | null;
97
+ queryStringParameters: APIGatewayProxyEventQueryStringParameters | null;
98
+ multiValueQueryStringParameters: APIGatewayProxyEventMultiValueQueryStringParameters | null;
99
+ stageVariables: APIGatewayProxyEventStageVariables | null;
100
+ requestContext: APIGatewayEventRequestContextWithAuthorizer<TAuthorizerContext>;
101
+ resource: string;
102
+ }
103
+
104
+ /**
105
+ * Works with Lambda Proxy Integration for Rest API or HTTP API integration Payload Format version 1.0
106
+ * @see - https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-develop-integrations-lambda.html
107
+ */
108
+ export interface APIGatewayProxyResult {
109
+ statusCode: number;
110
+ headers?: {
111
+ [header: string]: boolean | number | string;
112
+ };
113
+ multiValueHeaders?: {
114
+ [header: string]: Array<boolean | number | string>;
115
+ };
116
+ body: string;
117
+ isBase64Encoded?: boolean;
118
+ }
119
+
120
+ /**
121
+ * Works with HTTP API integration Payload Format version 2.0
122
+ * @see - https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-develop-integrations-lambda.html
123
+ */
124
+ export interface APIGatewayProxyEventV2 {
125
+ version: string;
126
+ routeKey: string;
127
+ rawPath: string;
128
+ rawQueryString: string;
129
+ cookies?: string[];
130
+ headers: APIGatewayProxyEventHeaders;
131
+ queryStringParameters?: APIGatewayProxyEventQueryStringParameters;
132
+ requestContext: {
133
+ accountId: string;
134
+ apiId: string;
135
+ authorizer?: {
136
+ jwt: {
137
+ claims: { [name: string]: string | number | boolean | string[] };
138
+ scopes: string[];
139
+ };
140
+ };
141
+ domainName: string;
142
+ domainPrefix: string;
143
+ http: {
144
+ method: string;
145
+ path: string;
146
+ protocol: string;
147
+ sourceIp: string;
148
+ userAgent: string;
149
+ };
150
+ requestId: string;
151
+ routeKey: string;
152
+ stage: string;
153
+ time: string;
154
+ timeEpoch: number;
155
+ };
156
+ body?: string;
157
+ pathParameters?: APIGatewayProxyEventPathParameters;
158
+ isBase64Encoded: boolean;
159
+ stageVariables?: APIGatewayProxyEventStageVariables;
160
+ }
161
+
162
+ /**
163
+ * Works with HTTP API integration Payload Format version 2.0
164
+ * @see - https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-develop-integrations-lambda.html
165
+ */
166
+ export type APIGatewayProxyResultV2<T = never> = APIGatewayProxyStructuredResultV2 | string | T;
167
+
168
+ /**
169
+ * Interface for structured response with `statusCode` and`headers`
170
+ * Works with HTTP API integration Payload Format version 2.0
171
+ * @see - https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-develop-integrations-lambda.html
172
+ */
173
+ export interface APIGatewayProxyStructuredResultV2 {
174
+ statusCode?: number;
175
+ headers?: {
176
+ [header: string]: boolean | number | string;
177
+ };
178
+ body?: string;
179
+ isBase64Encoded?: boolean;
180
+ cookies?: string[];
181
+ }
182
+
183
+ // Legacy names
184
+ export type ProxyHandler = APIGatewayProxyHandler;
185
+ export type ProxyCallback = APIGatewayProxyCallback;
186
+ export type APIGatewayEvent = APIGatewayProxyEvent;
187
+ export type ProxyResult = APIGatewayProxyResult;
@@ -0,0 +1,51 @@
1
+ import { Handler } from '../handler';
2
+
3
+ export type AppSyncResolverHandler<T, V> = Handler<AppSyncResolverEvent<T>, V | V[]>;
4
+
5
+ export interface AppSyncResolverEventHeaders {
6
+ [name: string]: string | undefined;
7
+ }
8
+
9
+ /**
10
+ * See https://docs.aws.amazon.com/appsync/latest/devguide/resolver-context-reference.html
11
+ *
12
+ * @param T type of the arguments
13
+ */
14
+ export interface AppSyncResolverEvent<T> {
15
+ arguments: T;
16
+ identity?: AppSyncIdentityIAM | AppSyncIdentityCognito;
17
+ source: { [key: string]: any } | null;
18
+ request: {
19
+ headers: AppSyncResolverEventHeaders;
20
+ };
21
+ info: {
22
+ selectionSetList: string[];
23
+ selectionSetGraphQL: string;
24
+ parentTypeName: string;
25
+ fieldName: string;
26
+ variables: { [key: string]: any };
27
+ };
28
+ prev: { result: { [key: string]: any } } | null;
29
+ stash: { [key: string]: any };
30
+ }
31
+
32
+ export interface AppSyncIdentityIAM {
33
+ accountId: string;
34
+ cognitoIdentityPoolId: string;
35
+ cognitoIdentityId: string;
36
+ sourceIp: string[];
37
+ username: string;
38
+ userArn: string;
39
+ cognitoIdentityAuthType: string;
40
+ cognitoIdentityAuthProvider: string;
41
+ }
42
+
43
+ export interface AppSyncIdentityCognito {
44
+ sub: string;
45
+ issuer: string;
46
+ username: string;
47
+ claims: any;
48
+ sourceIp: string[];
49
+ defaultAuthStrategy: string;
50
+ groups: string[] | null;
51
+ }
@@ -0,0 +1,68 @@
1
+ import { Handler } from "../handler";
2
+
3
+ // Note, responses are *not* lambda results, they are sent to the event ResponseURL.
4
+ export type CloudFormationCustomResourceHandler = Handler<CloudFormationCustomResourceEvent, void>;
5
+
6
+ export type CloudFormationCustomResourceEvent =
7
+ | CloudFormationCustomResourceCreateEvent
8
+ | CloudFormationCustomResourceUpdateEvent
9
+ | CloudFormationCustomResourceDeleteEvent;
10
+
11
+ export type CloudFormationCustomResourceResponse =
12
+ | CloudFormationCustomResourceSuccessResponse
13
+ | CloudFormationCustomResourceFailedResponse;
14
+
15
+ /**
16
+ * CloudFormation Custom Resource event and response
17
+ * http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/crpg-ref.html
18
+ */
19
+ export interface CloudFormationCustomResourceEventCommon {
20
+ ServiceToken: string;
21
+ ResponseURL: string;
22
+ StackId: string;
23
+ RequestId: string;
24
+ LogicalResourceId: string;
25
+ ResourceType: string;
26
+ ResourceProperties: {
27
+ ServiceToken: string;
28
+ [Key: string]: any;
29
+ };
30
+ }
31
+
32
+ export interface CloudFormationCustomResourceCreateEvent extends CloudFormationCustomResourceEventCommon {
33
+ RequestType: 'Create';
34
+ }
35
+
36
+ export interface CloudFormationCustomResourceUpdateEvent extends CloudFormationCustomResourceEventCommon {
37
+ RequestType: 'Update';
38
+ PhysicalResourceId: string;
39
+ OldResourceProperties: {
40
+ [Key: string]: any;
41
+ };
42
+ }
43
+
44
+ export interface CloudFormationCustomResourceDeleteEvent extends CloudFormationCustomResourceEventCommon {
45
+ RequestType: 'Delete';
46
+ PhysicalResourceId: string;
47
+ }
48
+
49
+ export interface CloudFormationCustomResourceResponseCommon {
50
+ PhysicalResourceId: string;
51
+ StackId: string;
52
+ RequestId: string;
53
+ LogicalResourceId: string;
54
+ Data?: {
55
+ [Key: string]: any;
56
+ };
57
+ NoEcho?: boolean;
58
+ }
59
+
60
+ export interface CloudFormationCustomResourceSuccessResponse extends CloudFormationCustomResourceResponseCommon {
61
+ Status: 'SUCCESS';
62
+ Reason?: string;
63
+ }
64
+
65
+ export interface CloudFormationCustomResourceFailedResponse extends CloudFormationCustomResourceResponseCommon {
66
+ Status: 'FAILED';
67
+ Reason: string;
68
+ }
@@ -0,0 +1,20 @@
1
+ import { CloudFrontEvent, CloudFrontRequest, CloudFrontResultResponse } from "../common/cloudfront";
2
+ import { Handler, Callback } from "../handler";
3
+
4
+ export type CloudFrontRequestHandler = Handler<CloudFrontRequestEvent, CloudFrontRequestResult>;
5
+ export type CloudFrontRequestCallback = Callback<CloudFrontRequestResult>;
6
+
7
+ /**
8
+ * CloudFront viewer request or origin request event
9
+ *
10
+ * https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/lambda-event-structure.html#lambda-event-structure-request
11
+ */
12
+ export interface CloudFrontRequestEvent {
13
+ Records: Array<{
14
+ cf: CloudFrontEvent & {
15
+ request: CloudFrontRequest;
16
+ };
17
+ }>;
18
+ }
19
+
20
+ export type CloudFrontRequestResult = undefined | null | CloudFrontResultResponse | CloudFrontRequest;
@@ -0,0 +1,21 @@
1
+ import { CloudFrontEvent, CloudFrontRequest, CloudFrontResponse, CloudFrontResultResponse } from "../common/cloudfront";
2
+ import { Callback, Handler } from "../handler";
3
+
4
+ export type CloudFrontResponseHandler = Handler<CloudFrontResponseEvent, CloudFrontResponseResult>;
5
+ export type CloudFrontResponseCallback = Callback<CloudFrontResponseResult>;
6
+
7
+ /**
8
+ * CloudFront viewer response or origin response event
9
+ *
10
+ * https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/lambda-event-structure.html#lambda-event-structure-response
11
+ */
12
+ export interface CloudFrontResponseEvent {
13
+ Records: Array<{
14
+ cf: CloudFrontEvent & {
15
+ readonly request: Pick<CloudFrontRequest, Exclude<keyof CloudFrontRequest, 'body'>>;
16
+ response: CloudFrontResponse;
17
+ };
18
+ }>;
19
+ }
20
+
21
+ export type CloudFrontResponseResult = undefined | null | CloudFrontResultResponse;
@@ -0,0 +1,8 @@
1
+ import { EventBridgeHandler, EventBridgeEvent } from '../trigger/eventbridge';
2
+
3
+ export type ScheduledHandler<TDetail = any> = EventBridgeHandler<'Scheduled Event', TDetail, void>;
4
+
5
+ /**
6
+ * https://docs.aws.amazon.com/lambda/latest/dg/with-scheduled-events.html
7
+ */
8
+ export interface ScheduledEvent<TDetail = any> extends EventBridgeEvent<'Scheduled Event', TDetail> {}
@@ -0,0 +1,37 @@
1
+ import { Handler } from "../handler";
2
+
3
+ export type CloudWatchLogsHandler = Handler<CloudWatchLogsEvent, void>;
4
+
5
+ /**
6
+ * See http://docs.aws.amazon.com/lambda/latest/dg/eventsources.html#eventsources-cloudwatch-logs
7
+ */
8
+ export interface CloudWatchLogsEvent {
9
+ awslogs: CloudWatchLogsEventData;
10
+ }
11
+
12
+ export interface CloudWatchLogsEventData {
13
+ data: string;
14
+ }
15
+
16
+ export interface CloudWatchLogsDecodedData {
17
+ owner: string;
18
+ logGroup: string;
19
+ logStream: string;
20
+ subscriptionFilters: string[];
21
+ messageType: string;
22
+ logEvents: CloudWatchLogsLogEvent[];
23
+ }
24
+
25
+ export interface CloudWatchLogsLogEventExtractedFields {
26
+ [name: string]: string | undefined;
27
+ }
28
+
29
+ /**
30
+ * See http://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/SubscriptionFilters.html#LambdaFunctionExample
31
+ */
32
+ export interface CloudWatchLogsLogEvent {
33
+ id: string;
34
+ timestamp: number;
35
+ message: string;
36
+ extractedFields?: CloudWatchLogsLogEventExtractedFields;
37
+ }
@@ -0,0 +1,104 @@
1
+ import { EventBridgeEvent, EventBridgeHandler } from './eventbridge';
2
+
3
+ export type CodeBuildCloudWatchStateHandler = EventBridgeHandler<'CodeBuild Build State Change', CodeBuildStateEventDetail, void>;
4
+
5
+ export type CodeBuildStateType = 'IN_PROGRESS' | 'SUCCEEDED' | 'FAILED' | 'STOPPED';
6
+ export type CodeBuildPhaseType =
7
+ | 'COMPLETED'
8
+ | 'FINALIZING'
9
+ | 'UPLOAD_ARTIFACTS'
10
+ | 'POST_BUILD'
11
+ | 'BUILD'
12
+ | 'PRE_BUILD'
13
+ | 'INSTALL'
14
+ | 'QUEUED'
15
+ | 'DOWNLOAD_SOURCE'
16
+ | 'PROVISIONING'
17
+ | 'SUBMITTED';
18
+ export type CodeBuildPhaseStatusType =
19
+ | 'TIMED_OUT'
20
+ | 'STOPPED'
21
+ | 'FAILED'
22
+ | 'SUCCEEDED'
23
+ | 'FAULT'
24
+ | 'CLIENT_ERROR';
25
+ export type CodeBuildCacheType = 'NO_CACHE' | 'LOCAL' | 'S3';
26
+ export type CodeBuildSourceLocationType =
27
+ | 'CODECOMMIT'
28
+ | 'CODEPIPELINE'
29
+ | 'GITHUB'
30
+ | 'GITHUB_ENTERPRISE'
31
+ | 'BITBUCKET'
32
+ | 'S3'
33
+ | 'NO_SOURCE';
34
+ export type CodeBuildEnvironmentType =
35
+ | 'LINUX_CONTAINER'
36
+ | 'LINUX_GPU_CONTAINER'
37
+ | 'WINDOWS_CONTAINER'
38
+ | 'ARM_CONTAINER';
39
+ export type CodeBuildEnvironmentPullCredentialsType = 'CODEBUILD' | 'SERVICE_ROLE';
40
+ export type CodeBuildEnvironmentComputeType =
41
+ | 'BUILD_GENERAL1_SMALL'
42
+ | 'BUILD_GENERAL1_MEDIUM'
43
+ | 'BUILD_GENERAL1_LARGE'
44
+ | 'BUILD_GENERAL1_2XLARGE';
45
+ export type CodeBuildEnvironmentVariableType = 'PARAMETER_STORE' | 'PLAINTEXT' | 'SECRETS_MANAGER';
46
+
47
+ export interface CodeBuildStateEventDetail {
48
+ 'build-status': CodeBuildStateType;
49
+ 'project-name': string;
50
+ 'build-id': string;
51
+ 'current-phase': CodeBuildPhaseType;
52
+ 'current-phase-context': string;
53
+ version: string;
54
+ 'additional-information': {
55
+ cache: {
56
+ type: CodeBuildCacheType;
57
+ };
58
+ 'build-number': number;
59
+ 'timeout-in-minutes': number;
60
+ 'build-complete': boolean;
61
+ initiator: string;
62
+ 'build-start-time': string;
63
+ source: {
64
+ buildspec: string;
65
+ location: string;
66
+ type: CodeBuildSourceLocationType;
67
+ };
68
+ 'source-version': string;
69
+ artifact: {
70
+ location: string;
71
+ };
72
+ environment: {
73
+ image: string;
74
+ 'privileged-mode': boolean;
75
+ 'image-pull-credentials-type'?: CodeBuildEnvironmentPullCredentialsType;
76
+ 'compute-type': CodeBuildEnvironmentComputeType;
77
+ type: CodeBuildEnvironmentType;
78
+ 'environment-variables': Array<{
79
+ name: string;
80
+ type?: CodeBuildEnvironmentVariableType;
81
+ value: string;
82
+ }>;
83
+ };
84
+ 'project-file-system-locations': [];
85
+ logs: {
86
+ 'group-name': string;
87
+ 'stream-name': string;
88
+ 'deep-link': string;
89
+ };
90
+ phases: Array<{
91
+ 'phase-context'?: string[]; // Not available for COMPLETED phase-type
92
+ 'start-time': string;
93
+ 'end-time'?: string; // Not available for COMPLETED phase-type
94
+ 'duration-in-seconds'?: number; // Not available for COMPLETED phase-type
95
+ 'phase-type': CodeBuildPhaseType;
96
+ 'phase-status'?: CodeBuildPhaseStatusType; // Not available for COMPLETED phase-type
97
+ }>;
98
+ 'queued-timeout-in-minutes': number;
99
+ };
100
+ }
101
+
102
+ export interface CodeBuildCloudWatchStateEvent extends EventBridgeEvent<'CodeBuild Build State Change', CodeBuildStateEventDetail> {
103
+ source: 'aws.codebuild';
104
+ }
@@ -0,0 +1,31 @@
1
+ import { Handler } from "../handler";
2
+
3
+ export type CodePipelineCloudWatchActionHandler = Handler<CodePipelineCloudWatchActionEvent, void>;
4
+
5
+ export type CodePipelineActionCategory = 'Approval' | 'Build' | 'Deploy' | 'Invoke' | 'Source' | 'Test';
6
+ export type CodePipelineActionState = 'STARTED' | 'SUCCEEDED' | 'FAILED' | 'CANCELED';
7
+
8
+ export interface CodePipelineCloudWatchActionEvent {
9
+ version: string;
10
+ id: string;
11
+ 'detail-type': 'CodePipeline Action Execution State Change';
12
+ source: 'aws.codepipeline';
13
+ account: string;
14
+ time: string;
15
+ region: string;
16
+ resources: string[];
17
+ detail: {
18
+ pipeline: string;
19
+ version: number;
20
+ 'execution-id': string;
21
+ stage: string;
22
+ action: string;
23
+ state: CodePipelineActionState;
24
+ type: {
25
+ owner: 'AWS' | 'Custom' | 'ThirdParty';
26
+ category: CodePipelineActionCategory;
27
+ provider: string;
28
+ version: number;
29
+ };
30
+ };
31
+ }
@@ -0,0 +1,32 @@
1
+ import { Handler } from "../handler";
2
+
3
+ export type CodePipelineCloudWatchPipelineHandler = Handler<CodePipelineCloudWatchPipelineEvent, void>;
4
+
5
+ export type CodePipelineState = 'STARTED' | 'SUCCEEDED' | 'RESUMED' | 'FAILED' | 'CANCELED' | 'SUPERSEDED';
6
+
7
+ /**
8
+ * CodePipeline CloudWatch Events
9
+ * https://docs.aws.amazon.com/codepipeline/latest/userguide/detect-state-changes-cloudwatch-events.html
10
+ *
11
+ * The above CodePipelineEvent is when a lambda is invoked by a CodePipeline.
12
+ * These events are when you subscribe to CodePipeline events in CloudWatch.
13
+ *
14
+ * Their documentation says that detail.version is a string, but it is actually an integer
15
+ */
16
+
17
+ export interface CodePipelineCloudWatchPipelineEvent {
18
+ version: string;
19
+ id: string;
20
+ 'detail-type': 'CodePipeline Pipeline Execution State Change';
21
+ source: 'aws.codepipeline';
22
+ account: string;
23
+ time: string;
24
+ region: string;
25
+ resources: string[];
26
+ detail: {
27
+ pipeline: string;
28
+ version: number;
29
+ state: CodePipelineState;
30
+ 'execution-id': string;
31
+ };
32
+ }
@@ -0,0 +1,23 @@
1
+ import { Handler } from "../handler";
2
+
3
+ export type CodePipelineCloudWatchStageHandler = Handler<CodePipelineCloudWatchStageEvent, void>;
4
+
5
+ export type CodePipelineStageState = 'STARTED' | 'SUCCEEDED' | 'RESUMED' | 'FAILED' | 'CANCELED';
6
+
7
+ export interface CodePipelineCloudWatchStageEvent {
8
+ version: string;
9
+ id: string;
10
+ 'detail-type': 'CodePipeline Stage Execution State Change';
11
+ source: 'aws.codepipeline';
12
+ account: string;
13
+ time: string;
14
+ region: string;
15
+ resources: string[];
16
+ detail: {
17
+ pipeline: string;
18
+ version: number;
19
+ 'execution-id': string;
20
+ stage: string;
21
+ state: CodePipelineStageState;
22
+ };
23
+ }
@@ -0,0 +1,11 @@
1
+ import { Handler } from "../handler";
2
+ import { CodePipelineCloudWatchActionEvent } from "./codepipeline-cloudwatch-action";
3
+ import { CodePipelineCloudWatchPipelineEvent } from "./codepipeline-cloudwatch-pipeline";
4
+ import { CodePipelineCloudWatchStageEvent } from "./codepipeline-cloudwatch-stage";
5
+
6
+ export type CodePipelineCloudWatchHandler = Handler<CodePipelineCloudWatchEvent, void>;
7
+
8
+ export type CodePipelineCloudWatchEvent =
9
+ | CodePipelineCloudWatchPipelineEvent
10
+ | CodePipelineCloudWatchStageEvent
11
+ | CodePipelineCloudWatchActionEvent;
@@ -0,0 +1,55 @@
1
+ import { Handler } from "../handler";
2
+
3
+ export type CodePipelineHandler = Handler<CodePipelineEvent, void>;
4
+
5
+ /**
6
+ * CodePipeline events
7
+ * https://docs.aws.amazon.com/codepipeline/latest/userguide/actions-invoke-lambda-function.html
8
+ */
9
+ export interface S3ArtifactLocation {
10
+ bucketName: string;
11
+ objectKey: string;
12
+ }
13
+ export interface S3ArtifactStore {
14
+ type: 'S3';
15
+ s3Location: S3ArtifactLocation;
16
+ }
17
+
18
+ export type ArtifactLocation = S3ArtifactStore;
19
+
20
+ export interface Artifact {
21
+ name: string;
22
+ revision: string | null;
23
+ location: ArtifactLocation;
24
+ }
25
+
26
+ export interface Credentials {
27
+ accessKeyId: string;
28
+ secretAccessKey: string;
29
+ sessionToken?: string;
30
+ }
31
+
32
+ export interface EncryptionKey {
33
+ type: string;
34
+ id: string;
35
+ }
36
+
37
+ export interface CodePipelineEvent {
38
+ 'CodePipeline.job': {
39
+ id: string;
40
+ accountId: string;
41
+ data: {
42
+ actionConfiguration: {
43
+ configuration: {
44
+ FunctionName: string;
45
+ UserParameters: string;
46
+ };
47
+ };
48
+ inputArtifacts: Artifact[];
49
+ outputArtifacts: Artifact[];
50
+ artifactCredentials: Credentials;
51
+ encryptionKey?: EncryptionKey & { type: 'KMS' };
52
+ continuationToken?: string;
53
+ };
54
+ };
55
+ }