Commit Graph

124 Commits

Author SHA1 Message Date
Johannes Würbach
89a11295bc
🤖 Merge PR #47284 [aws-lambda] add ses event by @johanneswuerbach 2020-09-05 07:26:05 -04:00
करतोफ्फेलस्क्रिप्ट™
55e2c9837e
🤖 Merge PR #46142 [aws-lambda] add individual event types for all cognito triggers by @netroy 2020-08-11 23:15:37 -04:00
Alexander Patton
c1375f8e7e
🤖 Merge PR #46656 Update sqs.d.ts in aws-lambda to include support for FIFO SQS event by @alexander-patton
* Update sqs.d.ts

Additional SQSRecordAttributes to support FIFO SQS queue, see Example Amazon SQS message event (FIFO queue) here: https://docs.aws.amazon.com/lambda/latest/dg/with-sqs.html

* added test for sqs fifo
2020-08-10 17:34:24 -04:00
Donald Pipowitch
070f243047
Update ALBResult (#45936) 2020-07-10 08:43:44 -07:00
Zach Anthony
fd848fb675
feat(aws-lambda): add the amazon connect contact flow trigger (#45820)
* Added support for Amazon Connect Contact Flow Trigger to AWS Lambda

* Updated formatting of files
2020-07-06 14:10:10 -07:00
Ivan Martos
413fe846ec
aws-lambda Added CodeBuild CloudWatch state event (#45490)
* added type and handler for CodeBuild Cloudwatch State event

* added type and handler for CodeBuild Cloudwatch event

* added test for codebuild cloudwatch event

* extended definitions block

* added SECRETS_MANAGER as environment variable type

* removed handlers

* removed unnecessary general codebuild types

* CodeBuildCloudWatchStateEvent extends EventBridgeEvent and added CodeBuildCloudWatchStateHandler

* added general type strArrayOrUndefined for tests

* added tests for CodeBuildCloudWatchStateHandler
2020-06-24 07:31:44 -04:00
Thorsten Hoeger
3eff5b53d4
Allow more types for JWT claims in API Gateway request (#45320) 2020-06-12 14:09:18 -04:00
Vittorio Guerriero
8b9c70c6ee
🤖 Merge PR #45336 feat(aws-lambda): add generic type to cloud watch scheduled event by @uittorio
* feat(aws-lambda): add generic type to cloud watch scheduled event

* feat(aws-lambda): ensure detail are correct
2020-06-10 02:23:31 -07:00
Dominic Scheirlinck
8de51b2d06
🤖 Merge PR #45379 fix(aws-lambda): approximateArrivalTimestamp should be number by @dominics 2020-06-09 21:06:06 -07:00
Sachin Shekhar
2b8d29e426
🤖 Merge PR #45263 Tweaks to API Gateway proxy v2 definitions by @SachinShekhar
* [aws-lambda] tweaks to APIGatewayProxyEventV2 interface

* [aws-lambda] tweaks to response type of API Gateway v2

* [aws-lambda] tweaks to APIGatewayProxyResultV2<T>
2020-06-03 15:18:34 -07:00
Sachin Shekhar
cedfab2b23
🤖 Merge PR #45205 [aws-lambda] Add support for payload format v2 of API Gateway proxy by @SachinShekhar
* [aws-lambda] Add support for payload format version 2.0 of API Gateway proxy event

* [aws-lambda] minor fix

* [aws-lambda] prettier fix

* [aws-lambda] minor fixes to test
2020-06-01 18:39:05 -07:00
Orta
553e6ae6c2
Make it "Definitely Typed" and revise docs on Definition Owners (#44679)
* Improve the docs around definition owners

* More Def Owners readme changes

* More Definition Owners docs

* The great Definitely Typeding
2020-05-20 13:06:52 -07:00
Wesley Wigham
6970a8fffa
#no-publishing-comment No more tabs in json documents, trailing newlines for every document 2020-05-15 12:27:10 -07:00
apalumbo
d81ce06782
[aws-lambda] Added support for EventBridge triggers (#43546)
* [aws-lambda] Added support for EventBridge triggers

* Changed cloudwatch-events to use eventbridge types as AWS extended cloudwatch-events to create EventBridge

* Added multi type handler example to eventbrige test
2020-04-23 13:49:46 -04:00
daku10
c5e570e794
[aws-lambda] add userNotFound property (#43915) 2020-04-15 16:23:11 -07:00
daku10
b2a5c56a28
update aws-lambda type definition (#43881) 2020-04-14 20:32:14 -07:00
Nicolas Hodin
c72d502e2e
🤖 Merge PR #43696 Added requestId member on all CloudFrontEvent types by @nhodin
* Added requestId member on all CloudFrontEvent types

The requestId member is defined on all origin/viewer requests/responses, it is described here : https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/lambda-event-structure.html
There is one example for each request/response and they all have a cf.config.requestId.
Added new requests examples in tests in order to have all 4 types available

* Fix lint issue with consecutive empty lines

* Fix missing spaces
2020-04-08 11:00:36 -07:00
Bart Monhemius
b71c8267d3
[aws-lambda]: Fix definition of APIGatewayRequestAuthorizerEvent (#43539)
* [aws-lambda]: Fix APIGatewayRequestAuthorizerEvent definition

* [aws-lambda]: Update tests for updated APIGatewayRequestAuthorizerEvent definition
2020-04-01 09:41:34 -07:00
Simon Buchan
53c3baddff
[aws-lambda] New API Gateway Authorizer types, deprecating old… (#42420)
* [aws-lambda] Deprecate CustomAuthorizer*, new APIGateway*Authorizer*

Noticed this testing #42419.

When integrating a custom authorizer, you actually have two options,
creating a token or a request authorizer, which changes what payload
you will get. You nearly certainly know which you will be called with!

Just deprecating the old version as it's kinda broken in a way thats
hard to fix without breaking someone, but we want to guide devs to the
new version.

It is possible to fix the existing type by adding a bunch of
`foo?: never` fields to each alternative so existing accesses don't,
error but this makes things more complex, and confusing for the common
case.

Other ideas welcome!

* [aws-lambda] Add api-gateway authorizer parameters.

Fixes #34069, #42418

Ended up a bit messy, might be a bit much.

* [aws-lambda] Bump minimum typescript to 3.0

Required to fix failing $ExpectError in tests.
Surely nobody is still using pre-3.0?

* [aws-lambda] Enforcea API Gateway authorizer context narrowing

And implement the changes that API gateway does on the proxy request context for it.

Also rename TAuthorizer to TAuthorizerContext to be more clear that they should be the same type across both authorizer and proxy.

Some cleanups and fixes for names.
2020-03-02 09:50:45 -08:00
KozelAnatoliy
6208bf89ac
Enrich sqs event with x ray trace header (#42762) 2020-03-02 09:49:09 -08:00
Menno
d02a3f361d
fix: [@types/aws-lambda] add missing prop clientMetadata to Co… (#42707) 2020-02-28 10:45:25 -08:00
Gabriela Araujo Britto
e980ea529f
Update tslint configs (#42555)
* Update tslint configs

* Update npm-naming configs

* Fix some configs

#no-publishing-comment
2020-02-24 16:06:03 -08:00
Simon Buchan
1833099f50
[aws-lambda] Add protocol to APIGatewayRequestContext. (#42419)
Fixes #42049.

No decent docs from AWS for the actual proxy integration, on the
Lambda side or the API Gateway side, but there's an approximation on
the API Gateway docs for the VTL $context variable:

https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-mapping-template-reference.html#context-variable-reference

From experimentation, not all of the variables referenced above exist,
at least most of the time, but everything except the `protocol` that
was present in what I received already existed.
2020-02-21 11:42:57 -08:00
wengkhing
ecd6fb8f3c
[aws-lambda] Split APIGatewayEventIdentity type (#42448) 2020-02-19 11:00:55 -08:00
Simon Buchan
b9b6b0e9bd
[aws-lambda] Fixes a couple of typos I made noticed by @apepper (#42437)
See original PR #42080
2020-02-18 14:29:42 -08:00
Simon Buchan
186ed7ba26
[aws-lambda] Some docs, split up types and tests (#42080)
* [aws-lambda] Some docs, split up index.d.ts into multiple files.

Documents handler type and conventions for adding triggers more
explicitly. The same index.d.ts docs should explain the thinking for the
new layout convention.

No changes to the type tests in this first commit, to show that the tests
still passs, and because I think they deserve more attention (and I need
lunch right now).

Most event structures have little to no changes other than re-ordering or removing
inaccurately copy/pasted comments in a case or two.

Loses history, but github doesn't support rename history anyway, and
it's even more ugly to get git to track file splits even for local
usage. Apologies for the huge diff.

* [aws-lambda] Split tests to per-service files, add contributor README.md

Updates most of the files to a consistent style.
2020-02-14 09:18:39 -08:00
David Sommerich
2e3ed02258 aws-lambda: Make ALBResult.body optional (#41700) 2020-01-20 15:41:55 -05:00
Nathan Shively-Sanders
fbb3688b15
Make ExpectError locations same for TS 3.8 (#41431)
* Make ExpectError locations same for TS 3.8

Error locations changed for some object literals in TS 3.8. This breaks
tests that use ExpectError since the ExpectError needs to be closer to
the actual error.

To fix this, I merged a lot of multi-line object literals into one-line
literals.

* remove stray edit
2020-01-06 14:11:45 -08:00
Simon Buchan
03d285dfdc Revert "removes the wrong assumption that headers are alkways set (#40876)" (#40929)
This reverts commit 48addad317.
2019-12-13 10:56:09 +00:00
dnalborczyk
3b5914b4b9 [@types/aws-lambda] Fix Context.memoryLimitInMB type (#40895)
* Fix memoryLimitInMB type

* Fix aws-serverless-express tests
2019-12-13 10:51:08 +00:00
Viktor Hedefalk
48addad317 removes the wrong assumption that headers are alkways set (#40876) 2019-12-07 13:28:38 -08:00
Alexander Pepper
4728a425d9 [aws-lambda] Improved Lambda@Edge types (#40355)
* [aws-lambda] Extended CloudFrontRequestEvent with body

Source: https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/lambda-event-structure.html
This key is optional. See https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/lambda-include-body-access.html for details

* [aws-lambda] Reordered keys in CloudFrontRequestEvent and CloudFrontResponseEvent.

This is done so they match the order of https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/lambda-event-structure.html

* [aws-lambda] CloudFrontEvent keys are all readonly.

Source: https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/lambda-event-structure.html#lambda-event-structure-request

* [aws-lambda] CloudFrontRequest keys are now readonly.

Source: https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/lambda-event-structure.html#lambda-event-structure-request

* [aws-lambda] Added jsdoc comment for CloudFrontRequestEvent and CloudFrontResponseEvent.

* [aws-lambda] requestId is only available for viewer events

Source: https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/lambda-event-structure.html

* [aws-lambda] request data of CloudFrontResponseEvent is readonly.

> If the Lambda function modifies the request object, the changes are ignored.

Source: https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/lambda-event-structure.html#lambda-event-structure-response

* [aws-lambda] Added jsdoc comment for CloudFrontResultResponse

Also corrected link

* [aws-lambda] Added apepper as co-author

* [aws-lambda] TypeScript version is now 3.5 in order to user "Omit<>"

See https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-5.html#the-omit-helper-type

Also bumped TypeScript version in packages, that do depend on "aws-lambda".

* [aws-lambda] Use "older" Pick/Exclude instead of "newer" Omit

Omit<> is introduced in 3.5 and is "too new". Exclude<> instead is introduced in 2.8, which is "old enough".

* [aws-lambda] Downgraded TypeScript version to 2.8, so Exclude can be used.

Omit<> which is introduced in 3.5 is "too new". Using Exclude<> instead, that got introduced in 2.8 (see [1])

[1] https://www.typescriptlang.org/docs/handbook/release-notes/typescript-2-8.html#predefined-conditional-types
2019-11-15 11:07:23 -08:00
Marian Zange
2c10703d1a Add principalOrgId to APIGatewayEventRequestContext (#40241) 2019-11-08 14:53:32 -08:00
alex-bolenok-centralreach
0b907048f9 [aws-lambda] Support for 2.1 S3 event schema, fix versionId which can be omitted. (#39398)
* Prettierify

* Support for 2.1 S3 event schema

* Revert version typings and just extend the schema
2019-10-25 13:16:03 -07:00
Peter McIntyre
4f95415cb5 feat(aws-lambda) add S3BatchEvent (#38142)
* add S3BatchEvent

* rename S3BatchEventResponseResultCodes

* linting

* s3VersionId is nullable

* add types for S3BatchHandler

* linting

* refactor S3Batch type names to conform to standard

* linting

* linting
2019-09-24 14:23:29 -07:00
Florin Asăvoaie
1e47cb4c01 aws-lambda: Added NoEcho parameter for CloudFormation Custom Resource Response (#38519)
According to https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/crpg-ref-responses.html
2019-09-23 10:18:32 -07:00
Peter Juras
d142fa9f9d aws-lambda: Add "domainPrefix" to APIGatewayEventRequestContext (#37038) 2019-07-22 12:28:43 -07:00
Stefan Tertan
1dfeabc9c2 fix: [@types/aws-lambda] add missing props to CognitoUserPoolTriggerEvent (#36753) 2019-07-15 09:42:48 -07:00
Jon Simpkins
83857c2e0f fix: typo in CodePipeline docs (#36831) 2019-07-15 09:41:27 -07:00
Erik Dalén
b9eba8fc8e [aws-lambda] Add missing fields on CognitoUserPoolTriggerEvent (#36668)
See:
https://docs.aws.amazon.com/cognito/latest/developerguide/user-pool-lambda-pre-token-generation.html#cognito-user-pools-lambda-trigger-syntax-pre-token-generation

The linkParameter doesn't seem to be in the documentation, but it is there on the events.
2019-07-08 13:36:52 -07:00
juancarbonel
41dbba7ad3 Add PreSignUp_ExternalProvider as triggersource for aws-lambda (#35968) 2019-06-06 11:27:34 -07:00
Sterling Camden
462a890272 aws-lambda: uppercase custom in client context (#35562)
* uppercase custom in client context

per the aws docs

```clientContext – (mobile apps) Client context provided to the Lambda invoker by the client application.

client.installation_id

client.app_title

client.app_version_name

client.app_version_code

client.app_package_name

env.platform_version

env.platform

env.make

env.model

env.locale

Custom – Custom values set by the mobile application.```

We have been using the upper case value with no problems so i assume the docs are correct here.

* Update aws-lambda-tests.ts
2019-05-20 10:11:09 -07:00
Simon Garner
8eef7a8374 [aws-lambda] Keys should be optional inside CloudFrontHeaders (#35121)
* [aws-lambda] Keys should be optional inside CloudFrontHeaders

According to the AWS documentation, it is optional to specify a `key` for each header value, but the type declaration is currently requiring this to be specified unnecessarily.

https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/lambda-event-structure.html#lambda-event-structure-response

> - `key` (optional) is the case-sensitive name of the header as it appears in an HTTP request; for example, `accept` or `host`.
> - If you do not include the header key portion of the key-value pair, Lambda@Edge will automatically insert a header key using the header name that you provide. Regardless of how you've formatted the header name, the header key that is inserted automatically will be formatted with initial capitalization for each part, separated by hyphens (-).
>
>   For example, you can add a header like the following, without a header key: `'content-type': [{ value: 'text/html;charset=UTF-8' }]`. In this example, Lambda@Edge creates the following header key: `Content-Type`.

By making this property optional, one is able to write:

```ts
import { CloudFrontHeaders } from 'aws-lambda';

const headers: CloudFrontHeaders = {
  'content-type': [{ value: 'text/plain '}],
};
```

... instead of having to repeat the header name like:

```ts
import { CloudFrontHeaders } from 'aws-lambda';

const headers: CloudFrontHeaders = {
  'content-type': [{ key: 'content-type', value: 'text/plain '}],
};
```

* Update test

Setting a header without specifying the key should not raise a TypeScript compiler error.

* Revert "Update test"

This reverts commit 088653e362e6f0a152f54e9b5694bb778b072354.

* Add test for AWSLambda.CloudFrontHeaders with and without explicit keys
2019-05-02 10:29:11 -07:00
Simon Buchan
205d663096 Revert "aws-lambda Authorizer response context only allows booleans, numbers and strings (#33437)"
This reverts commit eed96d4372.
2019-04-04 12:02:59 +13:00
Nathan Shively-Sanders
37ea0ae6da
Add missed npm-naming exemptions (#34198)
Previously, I only replaced non-final dt-header exemptions. This commit
fixes that.
2019-03-25 11:11:36 -07:00
Grzegorz Redlicki
3eb866bd83 @types/aws-lambda: There are no types for the communication with Application Load Balancer (#33763)
* Add the additional types for the usage of Application Load Balancer

* Change the long name "Application Load Balancer" to shorter one "ALB"

* Add ALBCallback for the completeness of the communication with the ALB
2019-03-12 10:44:04 -07:00
Nathan Shively-Sanders
363f4d07e5
Merge pull request #33620 from therockstorm/master
Update SQSMessageAttribute in aws-lambda
2019-03-08 15:29:40 -08:00
Richard
eed96d4372 aws-lambda Authorizer response context only allows booleans, numbers and strings (#33437)
* Context only allows booleans, numbers and strings

* add richardcornelissen as contributor
2019-03-06 15:29:48 -08:00
Rocky Warren
57ee130627 Update SQSMessageAttribute in aws-lambda 2019-03-06 08:31:31 -06:00
Roberto Zen
fe9e68da29 fix: connectedAt field must be optional 2019-02-26 15:04:08 +01:00