@aligent/cdk-prerender-proxy 0.2.9-alpha → 2.0.2-alpha

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 (209) hide show
  1. package/index.ts +29 -0
  2. package/lib/error-response-construct.ts +54 -0
  3. package/lib/handlers/cache-control.ts +1 -4
  4. package/lib/handlers/error-response.ts +0 -1
  5. package/lib/handlers/prerender.ts +2 -2
  6. package/lib/prerender-cf-cache-control-construct.ts +58 -0
  7. package/lib/prerender-check-construct.ts +43 -0
  8. package/lib/prerender-construct.ts +55 -0
  9. package/lib/prerender-lambda-construct.ts +48 -0
  10. package/package.json +17 -26
  11. package/index.d.ts +0 -6
  12. package/lib/error-response-construct.d.ts +0 -9
  13. package/lib/error-response-construct.js +0 -32
  14. package/lib/handlers/node_modules/.package-lock.json +0 -55
  15. package/lib/handlers/node_modules/@types/aws-lambda/LICENSE +0 -21
  16. package/lib/handlers/node_modules/@types/aws-lambda/README.md +0 -16
  17. package/lib/handlers/node_modules/@types/aws-lambda/common/api-gateway.d.ts +0 -79
  18. package/lib/handlers/node_modules/@types/aws-lambda/common/cloudfront.d.ts +0 -79
  19. package/lib/handlers/node_modules/@types/aws-lambda/handler.d.ts +0 -171
  20. package/lib/handlers/node_modules/@types/aws-lambda/index.d.ts +0 -85
  21. package/lib/handlers/node_modules/@types/aws-lambda/package.json +0 -210
  22. package/lib/handlers/node_modules/@types/aws-lambda/trigger/alb.d.ts +0 -48
  23. package/lib/handlers/node_modules/@types/aws-lambda/trigger/api-gateway-authorizer.d.ts +0 -174
  24. package/lib/handlers/node_modules/@types/aws-lambda/trigger/api-gateway-proxy.d.ts +0 -187
  25. package/lib/handlers/node_modules/@types/aws-lambda/trigger/appsync-resolver.d.ts +0 -51
  26. package/lib/handlers/node_modules/@types/aws-lambda/trigger/cloudformation-custom-resource.d.ts +0 -68
  27. package/lib/handlers/node_modules/@types/aws-lambda/trigger/cloudfront-request.d.ts +0 -20
  28. package/lib/handlers/node_modules/@types/aws-lambda/trigger/cloudfront-response.d.ts +0 -21
  29. package/lib/handlers/node_modules/@types/aws-lambda/trigger/cloudwatch-events.d.ts +0 -8
  30. package/lib/handlers/node_modules/@types/aws-lambda/trigger/cloudwatch-logs.d.ts +0 -37
  31. package/lib/handlers/node_modules/@types/aws-lambda/trigger/codebuild-cloudwatch-state.d.ts +0 -104
  32. package/lib/handlers/node_modules/@types/aws-lambda/trigger/codepipeline-cloudwatch-action.d.ts +0 -31
  33. package/lib/handlers/node_modules/@types/aws-lambda/trigger/codepipeline-cloudwatch-pipeline.d.ts +0 -32
  34. package/lib/handlers/node_modules/@types/aws-lambda/trigger/codepipeline-cloudwatch-stage.d.ts +0 -23
  35. package/lib/handlers/node_modules/@types/aws-lambda/trigger/codepipeline-cloudwatch.d.ts +0 -11
  36. package/lib/handlers/node_modules/@types/aws-lambda/trigger/codepipeline.d.ts +0 -55
  37. package/lib/handlers/node_modules/@types/aws-lambda/trigger/cognito-user-pool-trigger/_common.d.ts +0 -41
  38. package/lib/handlers/node_modules/@types/aws-lambda/trigger/cognito-user-pool-trigger/create-auth-challenge.d.ts +0 -22
  39. package/lib/handlers/node_modules/@types/aws-lambda/trigger/cognito-user-pool-trigger/custom-email-sender.d.ts +0 -86
  40. package/lib/handlers/node_modules/@types/aws-lambda/trigger/cognito-user-pool-trigger/custom-message.d.ts +0 -44
  41. package/lib/handlers/node_modules/@types/aws-lambda/trigger/cognito-user-pool-trigger/define-auth-challenge.d.ts +0 -21
  42. package/lib/handlers/node_modules/@types/aws-lambda/trigger/cognito-user-pool-trigger/index.d.ts +0 -119
  43. package/lib/handlers/node_modules/@types/aws-lambda/trigger/cognito-user-pool-trigger/post-authentication.d.ts +0 -15
  44. package/lib/handlers/node_modules/@types/aws-lambda/trigger/cognito-user-pool-trigger/post-confirmation.d.ts +0 -22
  45. package/lib/handlers/node_modules/@types/aws-lambda/trigger/cognito-user-pool-trigger/pre-authentication.d.ts +0 -15
  46. package/lib/handlers/node_modules/@types/aws-lambda/trigger/cognito-user-pool-trigger/pre-signup.d.ts +0 -31
  47. package/lib/handlers/node_modules/@types/aws-lambda/trigger/cognito-user-pool-trigger/pre-token-generation.d.ts +0 -45
  48. package/lib/handlers/node_modules/@types/aws-lambda/trigger/cognito-user-pool-trigger/user-migration.d.ts +0 -39
  49. package/lib/handlers/node_modules/@types/aws-lambda/trigger/cognito-user-pool-trigger/verify-auth-challenge-response.d.ts +0 -20
  50. package/lib/handlers/node_modules/@types/aws-lambda/trigger/connect-contact-flow.d.ts +0 -65
  51. package/lib/handlers/node_modules/@types/aws-lambda/trigger/dynamodb-stream.d.ts +0 -45
  52. package/lib/handlers/node_modules/@types/aws-lambda/trigger/eventbridge.d.ts +0 -18
  53. package/lib/handlers/node_modules/@types/aws-lambda/trigger/iot.d.ts +0 -28
  54. package/lib/handlers/node_modules/@types/aws-lambda/trigger/kinesis-firehose-transformation.d.ts +0 -45
  55. package/lib/handlers/node_modules/@types/aws-lambda/trigger/kinesis-stream.d.ts +0 -28
  56. package/lib/handlers/node_modules/@types/aws-lambda/trigger/lex.d.ts +0 -116
  57. package/lib/handlers/node_modules/@types/aws-lambda/trigger/msk.d.ts +0 -21
  58. package/lib/handlers/node_modules/@types/aws-lambda/trigger/s3-batch.d.ts +0 -41
  59. package/lib/handlers/node_modules/@types/aws-lambda/trigger/s3.d.ts +0 -60
  60. package/lib/handlers/node_modules/@types/aws-lambda/trigger/ses.d.ts +0 -103
  61. package/lib/handlers/node_modules/@types/aws-lambda/trigger/sns.d.ts +0 -38
  62. package/lib/handlers/node_modules/@types/aws-lambda/trigger/sqs.d.ts +0 -46
  63. package/lib/handlers/node_modules/@types/node/LICENSE +0 -21
  64. package/lib/handlers/node_modules/@types/node/README.md +0 -16
  65. package/lib/handlers/node_modules/@types/node/assert/strict.d.ts +0 -4
  66. package/lib/handlers/node_modules/@types/node/assert.d.ts +0 -124
  67. package/lib/handlers/node_modules/@types/node/async_hooks.d.ts +0 -226
  68. package/lib/handlers/node_modules/@types/node/base.d.ts +0 -19
  69. package/lib/handlers/node_modules/@types/node/buffer.d.ts +0 -84
  70. package/lib/handlers/node_modules/@types/node/child_process.d.ts +0 -526
  71. package/lib/handlers/node_modules/@types/node/cluster.d.ts +0 -262
  72. package/lib/handlers/node_modules/@types/node/console.d.ts +0 -133
  73. package/lib/handlers/node_modules/@types/node/constants.d.ts +0 -13
  74. package/lib/handlers/node_modules/@types/node/crypto.d.ts +0 -1580
  75. package/lib/handlers/node_modules/@types/node/dgram.d.ts +0 -141
  76. package/lib/handlers/node_modules/@types/node/diagnostic_channel.d.ts +0 -34
  77. package/lib/handlers/node_modules/@types/node/dns/promises.d.ts +0 -97
  78. package/lib/handlers/node_modules/@types/node/dns.d.ts +0 -322
  79. package/lib/handlers/node_modules/@types/node/domain.d.ts +0 -24
  80. package/lib/handlers/node_modules/@types/node/events.d.ts +0 -93
  81. package/lib/handlers/node_modules/@types/node/fs/promises.d.ts +0 -592
  82. package/lib/handlers/node_modules/@types/node/fs.d.ts +0 -2239
  83. package/lib/handlers/node_modules/@types/node/globals.d.ts +0 -655
  84. package/lib/handlers/node_modules/@types/node/globals.global.d.ts +0 -1
  85. package/lib/handlers/node_modules/@types/node/http.d.ts +0 -434
  86. package/lib/handlers/node_modules/@types/node/http2.d.ts +0 -976
  87. package/lib/handlers/node_modules/@types/node/https.d.ts +0 -36
  88. package/lib/handlers/node_modules/@types/node/index.d.ts +0 -58
  89. package/lib/handlers/node_modules/@types/node/inspector.d.ts +0 -3041
  90. package/lib/handlers/node_modules/@types/node/module.d.ts +0 -52
  91. package/lib/handlers/node_modules/@types/node/net.d.ts +0 -326
  92. package/lib/handlers/node_modules/@types/node/os.d.ts +0 -239
  93. package/lib/handlers/node_modules/@types/node/package.json +0 -232
  94. package/lib/handlers/node_modules/@types/node/path.d.ts +0 -163
  95. package/lib/handlers/node_modules/@types/node/perf_hooks.d.ts +0 -310
  96. package/lib/handlers/node_modules/@types/node/process.d.ts +0 -461
  97. package/lib/handlers/node_modules/@types/node/punycode.d.ts +0 -75
  98. package/lib/handlers/node_modules/@types/node/querystring.d.ts +0 -28
  99. package/lib/handlers/node_modules/@types/node/readline.d.ts +0 -192
  100. package/lib/handlers/node_modules/@types/node/repl.d.ts +0 -395
  101. package/lib/handlers/node_modules/@types/node/stream/promises.d.ts +0 -67
  102. package/lib/handlers/node_modules/@types/node/stream.d.ts +0 -471
  103. package/lib/handlers/node_modules/@types/node/string_decoder.d.ts +0 -7
  104. package/lib/handlers/node_modules/@types/node/timers/promises.d.ts +0 -21
  105. package/lib/handlers/node_modules/@types/node/timers.d.ts +0 -27
  106. package/lib/handlers/node_modules/@types/node/tls.d.ts +0 -793
  107. package/lib/handlers/node_modules/@types/node/trace_events.d.ts +0 -61
  108. package/lib/handlers/node_modules/@types/node/ts3.6/assert.d.ts +0 -98
  109. package/lib/handlers/node_modules/@types/node/ts3.6/base.d.ts +0 -68
  110. package/lib/handlers/node_modules/@types/node/ts3.6/index.d.ts +0 -7
  111. package/lib/handlers/node_modules/@types/node/tty.d.ts +0 -66
  112. package/lib/handlers/node_modules/@types/node/url.d.ts +0 -116
  113. package/lib/handlers/node_modules/@types/node/util/types.d.ts +0 -53
  114. package/lib/handlers/node_modules/@types/node/util.d.ts +0 -156
  115. package/lib/handlers/node_modules/@types/node/v8.d.ts +0 -198
  116. package/lib/handlers/node_modules/@types/node/vm.d.ts +0 -152
  117. package/lib/handlers/node_modules/@types/node/wasi.d.ts +0 -86
  118. package/lib/handlers/node_modules/@types/node/worker_threads.d.ts +0 -282
  119. package/lib/handlers/node_modules/@types/node/zlib.d.ts +0 -361
  120. package/lib/handlers/node_modules/axios/CHANGELOG.md +0 -685
  121. package/lib/handlers/node_modules/axios/LICENSE +0 -19
  122. package/lib/handlers/node_modules/axios/README.md +0 -800
  123. package/lib/handlers/node_modules/axios/UPGRADE_GUIDE.md +0 -162
  124. package/lib/handlers/node_modules/axios/dist/axios.js +0 -1756
  125. package/lib/handlers/node_modules/axios/dist/axios.map +0 -1
  126. package/lib/handlers/node_modules/axios/dist/axios.min.js +0 -3
  127. package/lib/handlers/node_modules/axios/dist/axios.min.map +0 -1
  128. package/lib/handlers/node_modules/axios/index.d.ts +0 -161
  129. package/lib/handlers/node_modules/axios/index.js +0 -1
  130. package/lib/handlers/node_modules/axios/lib/adapters/README.md +0 -37
  131. package/lib/handlers/node_modules/axios/lib/adapters/http.js +0 -303
  132. package/lib/handlers/node_modules/axios/lib/adapters/xhr.js +0 -179
  133. package/lib/handlers/node_modules/axios/lib/axios.js +0 -56
  134. package/lib/handlers/node_modules/axios/lib/cancel/Cancel.js +0 -19
  135. package/lib/handlers/node_modules/axios/lib/cancel/CancelToken.js +0 -57
  136. package/lib/handlers/node_modules/axios/lib/cancel/isCancel.js +0 -5
  137. package/lib/handlers/node_modules/axios/lib/core/Axios.js +0 -95
  138. package/lib/handlers/node_modules/axios/lib/core/InterceptorManager.js +0 -52
  139. package/lib/handlers/node_modules/axios/lib/core/README.md +0 -7
  140. package/lib/handlers/node_modules/axios/lib/core/buildFullPath.js +0 -20
  141. package/lib/handlers/node_modules/axios/lib/core/createError.js +0 -18
  142. package/lib/handlers/node_modules/axios/lib/core/dispatchRequest.js +0 -79
  143. package/lib/handlers/node_modules/axios/lib/core/enhanceError.js +0 -42
  144. package/lib/handlers/node_modules/axios/lib/core/mergeConfig.js +0 -87
  145. package/lib/handlers/node_modules/axios/lib/core/settle.js +0 -25
  146. package/lib/handlers/node_modules/axios/lib/core/transformData.js +0 -20
  147. package/lib/handlers/node_modules/axios/lib/defaults.js +0 -98
  148. package/lib/handlers/node_modules/axios/lib/helpers/README.md +0 -7
  149. package/lib/handlers/node_modules/axios/lib/helpers/bind.js +0 -11
  150. package/lib/handlers/node_modules/axios/lib/helpers/buildURL.js +0 -70
  151. package/lib/handlers/node_modules/axios/lib/helpers/combineURLs.js +0 -14
  152. package/lib/handlers/node_modules/axios/lib/helpers/cookies.js +0 -53
  153. package/lib/handlers/node_modules/axios/lib/helpers/deprecatedMethod.js +0 -24
  154. package/lib/handlers/node_modules/axios/lib/helpers/isAbsoluteURL.js +0 -14
  155. package/lib/handlers/node_modules/axios/lib/helpers/isAxiosError.js +0 -11
  156. package/lib/handlers/node_modules/axios/lib/helpers/isURLSameOrigin.js +0 -68
  157. package/lib/handlers/node_modules/axios/lib/helpers/normalizeHeaderName.js +0 -12
  158. package/lib/handlers/node_modules/axios/lib/helpers/parseHeaders.js +0 -53
  159. package/lib/handlers/node_modules/axios/lib/helpers/spread.js +0 -27
  160. package/lib/handlers/node_modules/axios/lib/utils.js +0 -351
  161. package/lib/handlers/node_modules/axios/package.json +0 -86
  162. package/lib/handlers/node_modules/buffer-from/LICENSE +0 -21
  163. package/lib/handlers/node_modules/buffer-from/index.js +0 -69
  164. package/lib/handlers/node_modules/buffer-from/package.json +0 -19
  165. package/lib/handlers/node_modules/buffer-from/readme.md +0 -69
  166. package/lib/handlers/node_modules/follow-redirects/LICENSE +0 -18
  167. package/lib/handlers/node_modules/follow-redirects/README.md +0 -148
  168. package/lib/handlers/node_modules/follow-redirects/debug.js +0 -14
  169. package/lib/handlers/node_modules/follow-redirects/http.js +0 -1
  170. package/lib/handlers/node_modules/follow-redirects/https.js +0 -1
  171. package/lib/handlers/node_modules/follow-redirects/index.js +0 -531
  172. package/lib/handlers/node_modules/follow-redirects/package.json +0 -59
  173. package/lib/handlers/node_modules/source-map/CHANGELOG.md +0 -301
  174. package/lib/handlers/node_modules/source-map/LICENSE +0 -28
  175. package/lib/handlers/node_modules/source-map/README.md +0 -742
  176. package/lib/handlers/node_modules/source-map/dist/source-map.debug.js +0 -3234
  177. package/lib/handlers/node_modules/source-map/dist/source-map.js +0 -3233
  178. package/lib/handlers/node_modules/source-map/dist/source-map.min.js +0 -2
  179. package/lib/handlers/node_modules/source-map/dist/source-map.min.js.map +0 -1
  180. package/lib/handlers/node_modules/source-map/lib/array-set.js +0 -121
  181. package/lib/handlers/node_modules/source-map/lib/base64-vlq.js +0 -140
  182. package/lib/handlers/node_modules/source-map/lib/base64.js +0 -67
  183. package/lib/handlers/node_modules/source-map/lib/binary-search.js +0 -111
  184. package/lib/handlers/node_modules/source-map/lib/mapping-list.js +0 -79
  185. package/lib/handlers/node_modules/source-map/lib/quick-sort.js +0 -114
  186. package/lib/handlers/node_modules/source-map/lib/source-map-consumer.js +0 -1145
  187. package/lib/handlers/node_modules/source-map/lib/source-map-generator.js +0 -425
  188. package/lib/handlers/node_modules/source-map/lib/source-node.js +0 -413
  189. package/lib/handlers/node_modules/source-map/lib/util.js +0 -488
  190. package/lib/handlers/node_modules/source-map/package.json +0 -73
  191. package/lib/handlers/node_modules/source-map/source-map.d.ts +0 -98
  192. package/lib/handlers/node_modules/source-map/source-map.js +0 -8
  193. package/lib/handlers/node_modules/source-map-support/LICENSE.md +0 -21
  194. package/lib/handlers/node_modules/source-map-support/README.md +0 -284
  195. package/lib/handlers/node_modules/source-map-support/browser-source-map-support.js +0 -114
  196. package/lib/handlers/node_modules/source-map-support/package.json +0 -31
  197. package/lib/handlers/node_modules/source-map-support/register.js +0 -1
  198. package/lib/handlers/node_modules/source-map-support/source-map-support.js +0 -604
  199. package/lib/handlers/package-lock.json +0 -108
  200. package/lib/handlers/package.json +0 -13
  201. package/lib/handlers/tsconfig.json +0 -22
  202. package/lib/prerender-cf-cache-control-construct.d.ts +0 -10
  203. package/lib/prerender-cf-cache-control-construct.js +0 -33
  204. package/lib/prerender-check-construct.d.ts +0 -6
  205. package/lib/prerender-check-construct.js +0 -25
  206. package/lib/prerender-construct.d.ts +0 -11
  207. package/lib/prerender-construct.js +0 -34
  208. package/lib/prerender-lambda-construct.d.ts +0 -17
  209. package/lib/prerender-lambda-construct.js +0 -19
@@ -1,174 +0,0 @@
1
- import {
2
- APIGatewayAuthorizerResultContext,
3
- APIGatewayEventDefaultAuthorizerContext,
4
- APIGatewayEventRequestContextWithAuthorizer,
5
- } from "../common/api-gateway";
6
- import { Callback, Handler } from "../handler";
7
-
8
- export type APIGatewayAuthorizerHandler = Handler<APIGatewayAuthorizerEvent, APIGatewayAuthorizerResult>;
9
- export type APIGatewayAuthorizerWithContextHandler<TAuthorizerContext extends APIGatewayAuthorizerResultContext> =
10
- Handler<APIGatewayAuthorizerEvent, APIGatewayAuthorizerWithContextResult<TAuthorizerContext>>;
11
-
12
- export type APIGatewayAuthorizerCallback = Callback<APIGatewayAuthorizerResult>;
13
- export type APIGatewayAuthorizerWithContextCallback<TAuthorizerContext extends APIGatewayAuthorizerResultContext> =
14
- Callback<APIGatewayAuthorizerWithContextResult<TAuthorizerContext>>;
15
-
16
- export type APIGatewayTokenAuthorizerHandler =
17
- Handler<APIGatewayTokenAuthorizerEvent, APIGatewayAuthorizerResult>;
18
- export type APIGatewayTokenAuthorizerWithContextHandler<TAuthorizerContext extends APIGatewayAuthorizerResultContext> =
19
- Handler<APIGatewayTokenAuthorizerEvent, APIGatewayAuthorizerWithContextResult<TAuthorizerContext>>;
20
-
21
- export type APIGatewayRequestAuthorizerHandler =
22
- Handler<APIGatewayRequestAuthorizerEvent, APIGatewayAuthorizerResult>;
23
- export type APIGatewayRequestAuthorizerWithContextHandler<TAuthorizerContext extends APIGatewayAuthorizerResultContext> =
24
- Handler<APIGatewayRequestAuthorizerEvent, APIGatewayAuthorizerWithContextResult<TAuthorizerContext>>;
25
-
26
- export type APIGatewayAuthorizerEvent = APIGatewayTokenAuthorizerEvent | APIGatewayRequestAuthorizerEvent;
27
-
28
- export interface APIGatewayTokenAuthorizerEvent {
29
- type: "TOKEN";
30
- methodArn: string;
31
- authorizationToken: string;
32
- }
33
-
34
- export interface APIGatewayRequestAuthorizerEventHeaders {
35
- [name: string]: string | undefined;
36
- }
37
-
38
- export interface APIGatewayRequestAuthorizerEventMultiValueHeaders {
39
- [name: string]: string[] | undefined;
40
- }
41
-
42
- export interface APIGatewayRequestAuthorizerEventPathParameters {
43
- [name: string]: string | undefined;
44
- }
45
-
46
- export interface APIGatewayRequestAuthorizerEventQueryStringParameters {
47
- [name: string]: string | undefined;
48
- }
49
-
50
- export interface APIGatewayRequestAuthorizerEventMultiValueQueryStringParameters {
51
- [name: string]: string[] | undefined;
52
- }
53
-
54
- export interface APIGatewayRequestAuthorizerEventStageVariables {
55
- [name: string]: string | undefined;
56
- }
57
-
58
- // Note, when invoked by the tester in the AWS web console, the map values can be null,
59
- // but they will be empty objects in the real object.
60
- // Worse, it will include "body" and "isBase64Encoded" properties, unlike the real call!
61
- // See https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-lambda-authorizer-input.html for the
62
- // formal definition.
63
- export interface APIGatewayRequestAuthorizerEvent {
64
- type: "REQUEST";
65
- methodArn: string;
66
- resource: string;
67
- path: string;
68
- httpMethod: string;
69
- headers: APIGatewayRequestAuthorizerEventHeaders | null;
70
- multiValueHeaders: APIGatewayRequestAuthorizerEventMultiValueHeaders | null;
71
- pathParameters: APIGatewayRequestAuthorizerEventPathParameters | null;
72
- queryStringParameters: APIGatewayRequestAuthorizerEventQueryStringParameters | null;
73
- multiValueQueryStringParameters: APIGatewayRequestAuthorizerEventMultiValueQueryStringParameters | null;
74
- stageVariables: APIGatewayRequestAuthorizerEventStageVariables | null;
75
- requestContext: APIGatewayEventRequestContextWithAuthorizer<undefined>;
76
- }
77
-
78
- export interface APIGatewayAuthorizerResult {
79
- principalId: string;
80
- policyDocument: PolicyDocument;
81
- context?: APIGatewayAuthorizerResultContext | null;
82
- usageIdentifierKey?: string | null;
83
- }
84
-
85
- // Separate type so the context property is required, without pulling complex type magic.
86
- export interface APIGatewayAuthorizerWithContextResult<TAuthorizerContext extends APIGatewayAuthorizerResultContext> {
87
- principalId: string;
88
- policyDocument: PolicyDocument;
89
- context: TAuthorizerContext;
90
- usageIdentifierKey?: string | null;
91
- }
92
-
93
- // Legacy event / names
94
-
95
- /** @deprecated Use APIGatewayAuthorizerHandler or a subtype */
96
- export type CustomAuthorizerHandler = Handler<CustomAuthorizerEvent, APIGatewayAuthorizerResult>;
97
-
98
- // This one is actually fine.
99
- export type CustomAuthorizerCallback = APIGatewayAuthorizerCallback;
100
-
101
- /** @deprecated Use APIGatewayAuthorizerEvent or a subtype */
102
- export interface CustomAuthorizerEvent {
103
- type: string;
104
- methodArn: string;
105
- authorizationToken?: string;
106
- resource?: string;
107
- path?: string;
108
- httpMethod?: string;
109
- headers?: { [name: string]: string };
110
- multiValueHeaders?: { [name: string]: string[] };
111
- pathParameters?: { [name: string]: string } | null;
112
- queryStringParameters?: { [name: string]: string } | null;
113
- multiValueQueryStringParameters?: { [name: string]: string[] } | null;
114
- stageVariables?: { [name: string]: string };
115
- requestContext?: APIGatewayEventRequestContextWithAuthorizer<APIGatewayEventDefaultAuthorizerContext>;
116
- domainName?: string;
117
- apiId?: string;
118
- }
119
-
120
- export type CustomAuthorizerResult = APIGatewayAuthorizerResult;
121
- export type AuthResponse = APIGatewayAuthorizerResult;
122
- export type AuthResponseContext = APIGatewayAuthorizerResultContext;
123
-
124
- /**
125
- * API Gateway CustomAuthorizer AuthResponse.PolicyDocument.
126
- * https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-lambda-authorizer-output.html
127
- * https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_elements.html#Condition
128
- */
129
- export interface PolicyDocument {
130
- Version: string;
131
- Id?: string;
132
- Statement: Statement[];
133
- }
134
-
135
- /**
136
- * API Gateway CustomAuthorizer AuthResponse.PolicyDocument.Condition.
137
- * https://docs.aws.amazon.com/apigateway/latest/developerguide/apigateway-control-access-policy-language-overview.html
138
- * https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_elements_condition.html
139
- */
140
- export interface ConditionBlock {
141
- [condition: string]: Condition | Condition[];
142
- }
143
-
144
- export interface Condition {
145
- [key: string]: string | string[];
146
- }
147
-
148
- /**
149
- * API Gateway CustomAuthorizer AuthResponse.PolicyDocument.Statement.
150
- * https://docs.aws.amazon.com/apigateway/latest/developerguide/apigateway-control-access-policy-language-overview.html
151
- * https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_elements.html
152
- */
153
- export type Statement = BaseStatement & StatementAction & (StatementResource | StatementPrincipal);
154
-
155
- export interface BaseStatement {
156
- Effect: string;
157
- Sid?: string;
158
- Condition?: ConditionBlock;
159
- }
160
-
161
- export type PrincipalValue = { [key: string]: string | string[] } | string | string[];
162
- export interface MaybeStatementPrincipal {
163
- Principal?: PrincipalValue;
164
- NotPrincipal?: PrincipalValue;
165
- }
166
- export interface MaybeStatementResource {
167
- Resource?: string | string[];
168
- NotResource?: string | string[];
169
- }
170
- export type StatementAction = { Action: string | string[] } | { NotAction: string | string[] };
171
- export type StatementResource = MaybeStatementPrincipal &
172
- ({ Resource: string | string[] } | { NotResource: string | string[] });
173
- export type StatementPrincipal = MaybeStatementResource &
174
- ({ Principal: PrincipalValue } | { NotPrincipal: PrincipalValue });
@@ -1,187 +0,0 @@
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;
@@ -1,51 +0,0 @@
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
- }
@@ -1,68 +0,0 @@
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
- }
@@ -1,20 +0,0 @@
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;
@@ -1,21 +0,0 @@
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;
@@ -1,8 +0,0 @@
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> {}
@@ -1,37 +0,0 @@
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
- }
@@ -1,104 +0,0 @@
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
- }