Ishaan Malhi
e3727a66d2
[@types/aws-lambda] Add SQS Event Source ( #27334 )
...
* feat: Add initial typings
* feat: Add tests for SQS Event Source
* fix: linting fixes
2018-07-20 17:31:00 -07:00
Richard Barker
bf6894a4e5
Fix test
2018-06-22 11:18:02 +10:00
Richard Barker
f9f78a7a9b
ClientContext field must be spelt 'custom' so that it is correctly serialized by Java Lambdas.
2018-06-22 11:05:58 +10:00
Jeremy Nagel
1a53ccde52
[BUGFIX] Lambda callbacks support string errors
...
As per https://docs.aws.amazon.com/apigateway/latest/developerguide/handle-errors-in-lambda-integration.html
2018-05-29 15:32:25 +10:00
Jonathan Jung
26d40427c1
[types/aws-lambda] adds a path attribute to the APIGatewayEventRequestContext
2018-05-21 14:59:14 -07:00
Nick Holloway
ff0c5eb0c0
Add encryption key to Code Pipeline event
2018-05-17 09:35:00 +01:00
Nick Holloway
e818117186
Add definition for AWS Lambda Code Pipeline event
2018-05-15 16:54:58 +01:00
Aneil Mallavarapu
07268c98de
Improve coverage of AWS Lambda Statement type ( #25304 )
...
* Improve coverage of AWS Lambda Statement type
Allow statements which have either a Principal or a Resource,
instead of requiring Resource.
This permits policies such as described in https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_elements_principal.html :
```
{
Effect: "Allow",
Principal: "*",
Action: "*"
}
```
and
```
{
Effect: "Allow",
Principal: { "Service": "lambda.amazonaws.com" },
Action: "sts:AssumeRole"
}
```
* Remove unnecessary additional type
* Add tests for valid/invalid combinations of Resource and Principal in Statement type
This addresses issues raised by @simonbuchanan here:
https://github.com/DefinitelyTyped/DefinitelyTyped/pull/25304\#pullrequestreview-115377094
2018-04-26 15:03:40 -07:00
Martin Donath
02ed6f6b49
Added missing field apiKeyId to API Gateway request context ( #25195 )
...
* Added missing field `apiKeyId` to API Gateway request context
`$context.identity.apiKeyId`: The API key ID associated with the key-enabled API request.
See the [AWS documentation](https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-mapping-template-reference.html ) and search for `apiKeyId`.
* Added missing tests for new apiKeyId field in aws-lambda typings
2018-04-24 16:06:22 -07:00
Aneil Mallavarapu
a5db46d192
Add missing elements to Policy Statement ( #24792 )
...
* Add: NotAction, NotResource, Principal, NotPrincipal
* Implement some of the conditional logic
- e.g., Action or NotAction is required
- however, mutual exclusivity is not implemented (hard to do in Typescript)
* Allow >1 statement per PolicyDocument
2018-04-12 12:11:30 -07:00
Simon Buchan
78350168c5
[aws-lambda] Rutime node8.10 support. ( #24823 )
...
Bump version to 8.10 to match current runtime, allow returning result promises in handlers.
2018-04-09 10:21:48 -07:00
repl-chris
3a1f68f9c1
Added AWSLambda.KinesisDataStream event type definitions (aws-lambda)
2018-04-05 16:45:08 -06:00
Andrea Ratto
eedb1097a8
Fix creation time attribute in StreamRecord of aws-lambda
2018-03-21 11:15:56 +01:00
David
c9749a4f65
[aws-lambda] Include CloudFrontRequest in CloudFrontRequestResult union type ( #23882 )
...
A request is a valid callback result type. See example: https://docs.aws.amazon.com/lambda/latest/dg/lambda-edge.html#lambda-edge-authoring-functions-example-ab-testing
2018-02-26 11:59:10 -08:00
Andy Hanson
45c9246c09
Remove esModuleInterop from tsconfigs (no longer mandatory)
2018-02-14 14:55:13 -08:00
Simon Buchan
50dafbd8e3
Add tests, fix some missed type name normalizations.
2018-02-08 12:39:00 +13:00
Simon Buchan
e43b209621
Fix tests for strictNullChecks: true
2018-02-08 11:59:17 +13:00
Simon Buchan
17e9857f8d
[aws-lambda] Add Handler and Callback types for each trigger.
...
No tests added for the new types yet, I'll get on that tomorrow.
Motivation
---
The connection between the trigger event and the result types can be
confusing sometimes - for example `CloudFormationCustomResourceResponse`
is *not* returned from the lambda, but instead should be sent to the
*Request `ResponseUrl`. This PR tries to help by providing pre-baked
`Handler` types for each of the triggers (that have types already).
There's also a few niggles with naming and the handler signature that
have been bothering me for a while.
Changes
---
This PR:
- Adds defaulted generic parameters to the existing `Handler` and
`Callback` types. This increases the minimum TS version to 2.3.
- Makes the `callback` parameter to `Handler`s "required" - this
probably originally was meant to represent the Node 0.10 runtime,
which did not pass a callback parameter, but that is no longer
selectable when creating or editing a Lambda and makes the normal,
recommended usage harder. In case anyone is confused, this doesn't
break any code: it is required to be provided when being called, your
handlers don't need to declare it. I'm not removing the legacy node 0.10
runtime methods `context.done()` etc., since they still work.
- In the spirit of #21874 , make the default result type for
`Handler`, `Callback` `any`, since the only requirement is
that it be `JSON.stringify()`able, and there are things like
`.toJSON()`, etc. so there is no meaningful type restriction
here.
- Revert the definition changes of #22588 , which changed the `Handler`
result types to `void | Promise<void>`, which is misleading: Lambda
will not accept or wait for a promise result (it by default waits
for the node event loop to empty). This is not a breaking change for
code that does return promises, since a `void` result type is
compatible with any result type, even with strict function types.
(Which is why the tests still pass.)
- Adds `FooHandler` and `FooCallback` types for all `FooEvent`s and
`FooResult`s, where possible - sometimes these don't match up.
- Renamed, with aliases to the old name, various types to align them: in
particular `ProxyResult` -> `APIGatewayProxyResult`.
- `CloudFrontResult` (not the same type as `CloudFrontResponse`!)
was missing for some reason.
2018-02-07 21:47:58 +13:00
Andy
bef4d2b27d
Enable "esModuleInterop" in all tsconfigs ( #23354 )
2018-02-05 11:01:56 -08:00
Markus Tacker
73518ca44a
fix(aws-lambda): AuthResponseContext children may be objects ( #23192 )
...
If used with a custom authorizer, there will be a claims object
with the parsed JSON web token.
See https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-mapping-template-reference.html
2018-01-30 11:04:01 -08:00
Andy
a0d0b93d94
aws-lambda: Lint ( #23167 )
2018-01-24 09:53:35 -08:00
Louis Roché
ee0a159fc2
add requestTimeEpoch to aws lambda types ( #22941 )
...
Add the missing requestTimeEpoch in the APIGatewayEventRequestContext interface.
$context.requestTimeEpoch is documented in https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-mapping-template-reference.html#context-variable-reference
2018-01-23 15:03:59 -08:00
Pálmi Þór Valgeirsson
286bf2a94d
aws-lambda : Add more Cognito triggerSources according to spec ( #22943 )
...
* aws-lambda : Add more triggerSources according to spec
* aws-lambda: Add my info in the Definitions by - list
* aws-lambda: Cognito triggerSources list failed npm test due to extra semi colon
2018-01-23 11:48:40 -08:00
Danilo Tenorio Raisi
8db0647a2d
Created ScheduledEvent on AWS Lambda Types ( #22974 )
...
* Created ScheduledEvent on AWS Lambda Types
* aws-lambda types
Fixed detail type on ScheduleEvent
* types/aws-lambda
Fixed header at index.d.ts
2018-01-23 11:06:53 -08:00
austinried
1f68776226
AttributeValue "N" should be string ( #22790 )
...
AttributeValue's "N" is a string, not a number: http://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_streams_AttributeValue.html
This causes an incompatibility between this AttributeValue and the one in the AWS SDK types, which makes it impossible to use something like AWS.DynamoDB.Converter.unmarshall() for items in records on a DynamoDBStreamEvent.
2018-01-09 15:23:33 -08:00
Tomas Polovincak
68f6a78112
aws-lambda: extend Handler return type to support Promises ( #22588 )
2018-01-03 13:29:06 -08:00
Jamie Starke
b2517cc5cf
Adds typing for CloudWatch Logs events ( #21239 )
2018-01-02 15:47:47 -08:00
Mine Starks
1dbdbd4afb
Merge pull request #21021 from MichaelMarner/aws-lambda-dynamo
...
Add aws-lambda DynamoDB stream event types
2017-12-13 14:50:43 -08:00
Markus Tacker
f9edea3047
[aws-lambda] add CloudFront request and response events
...
See http://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/lambda-event-structure.html
2017-12-05 20:14:03 +01:00
Kostya Misura
4f199da089
extends lambda callback signature to accept primitive types (boolean, number and string) as result
2017-11-30 22:45:01 +02:00
Daniel Rosenwasser
6a2ea9f633
Merge pull request #21276 from daniel-cottone/aws-lambda-add-authorizer-to-apigatewayevent
...
[aws-lambda] Adding property authorizer to APIGatewayEvent
2017-11-12 00:52:14 -08:00
Nathan Shively-Sanders
a364bb7a8c
Fix incorrect tuple usage and syntax
2017-11-09 13:55:03 -08:00
Daniel Cottone
13d1bcc4f5
adding property authorizer to APIGatewayEvent
2017-11-06 10:08:09 -06:00
Michael Marner
58f01b7172
Merge branch 'master' into aws-lambda-dynamo
2017-10-31 17:31:26 +10:30
Daniel Cottone
19ab2f184e
adding contact info
2017-10-27 14:58:35 -05:00
Daniel Cottone
5dbba088ed
updating custom authorizer event
2017-10-27 14:56:52 -05:00
Michael Marner
6fec1b5b8c
Format as per styleguide
2017-10-26 17:15:44 +10:30
Michael Marner
a320e3c801
Add name to authors
2017-10-26 17:12:24 +10:30
Michael Marner
8c6c695fbd
aws-lambda dynamo tests
2017-10-26 17:08:41 +10:30
Michael Marner
6a4db4bb55
Add missing parameters
2017-10-26 17:07:58 +10:30
Michael Marner
2a9cc5af4c
Add types for aws-lambda DynamoDB stream events
2017-10-26 16:55:26 +10:30
Andy
19f89399e4
Ensure every package has a tslint.json ( #21009 )
...
* Ensure every package has a tslint.json
* Fixes
2017-10-25 11:13:50 -07:00
Ishaan Malhi
e119988a71
Fixup aws lambda callback definitions. ( #20381 )
2017-10-09 14:41:41 -07:00
Andy
947a8fb761
Enable strictFunctionTypes ( #20373 )
2017-10-06 14:03:03 -07:00
Michael Bond
f3b3098452
aws-lambda: Add isBase64Encoded support to ProxyResult ( #18450 )
...
This is required when using Binary support in API Gateway.
See Also: "Output Format of a Lambda Function for Proxy Integration" https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-set-up-simple-proxy.html
2017-07-31 14:00:31 -07:00
william chang
6c49782ce4
[aws-lambda] S3CreateEvent.Records should be Array<S3Record> instead of Tuple
2017-07-18 15:55:50 +08:00
Nathan Shively-Sanders
8ecdaf82c2
Merge pull request #17144 from y13i/feat-aws-lambda-cloudformation-custom-resource
...
Add type definition for AWS Lambda CloudFormation custom resource event
2017-06-22 13:44:05 -07:00
Simon Ramsay
4ab4d5098f
removed nexus-uw from authors
...
i am unable to review these prs, so i am removing myself from the list of authors
2017-06-15 18:06:42 -04:00
Yoriki Yamaguchi
0b5e9d380a
add type definition for AWS CloudFormation custom resource
2017-06-13 12:10:19 +09:00
Simon Males
501ea7986b
Add definition for AWS Lambda Cognito User Pool event: request.usernameParameter ( #16998 )
...
* request.usernameParameter
* usernameParameter test
2017-06-06 17:18:42 -07:00