Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Promise return type for proxy function #332

Merged
merged 1 commit into from
Jan 11, 2021

Conversation

lightningspirit
Copy link
Contributor

@lightningspirit lightningspirit commented Jan 11, 2021

Compiling this project in TypeScript 4.1.2 gave the following error:

error TS2314: Generic type 'Promise<T>' requires 1 type argument(s).
declare function proxy(proxyParams: ProxyParams): Promise

This commit tries to fix this error without being explicit with the return type.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

Compiling this project in TypeScript gave the following error:
```
error TS2314: Generic type 'Promise<T>' requires 1 type argument(s).
declare function proxy(proxyParams: ProxyParams): Promise
```
This commit tries to fix this error without being explicit with the return type.
Copy link
Collaborator

@brettstack brettstack left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@brettstack brettstack merged commit 5b23f3c into CodeGenieApp:mainline Jan 11, 2021
@brettstack
Copy link
Collaborator

Released in RC 6

github-actions bot pushed a commit that referenced this pull request Feb 1, 2021
# [4.0.0](v3.3.5...v4.0.0) (2021-02-01)

### Bug Fixes

* **audit:** npm audit fix ([66b03e5](66b03e5))
* add body parsing for lambda edge event source ([116949d](116949d))
* add Promise return type for proxy function ([#332](#332)) ([5b23f3c](5b23f3c))
* change logging to include a log key ([542d473](542d473))
* clean up sockets on EADDRINUSE server close ([e768599](e768599))
* dependabot alerts ([df60394](df60394))
* fix API Gateway V2 header response ([90bad18](90bad18)), closes [#352](#352)
* fix getRequestValuesFromEvent headers ([f915e94](f915e94))
* fix Lambda@Edge event source ([95b0aa6](95b0aa6))
* fix Lambda@Edge headers and body ([aabd9d3](aabd9d3))
* fix remoteAddress undefined on ALB event source ([a092233](a092233))
* log actual headers in SERVERLESS_EXPRESS:FORWARD_RESPONSE:EVENT_SOURCE_RESPONSE_PARAMS ([72f2ef5](72f2ef5))
* make optional the property `binarySettings` of `ConfigureParams` in typings ([b08ee87](b08ee87))
* remove commitlint from travis ([7b12e56](7b12e56))
* remove Node.js 4 support ([713ad14](713ad14))
* remove Node.js 4 support ([e01c9af](e01c9af))
* remove winston dependency and add basic logger ([5bd6c2c](5bd6c2c))
* transform lambda edge response headers to lower case ([922fec0](922fec0))
* transform request header keys to lower case ([daa656b](daa656b))
* update dependencies ([e705bc6](e705bc6))
* update dependencies ([075e15b](075e15b))
* update dependencies ([39c55eb](39c55eb))

### Features

* add additional event mapping logic ([e5909b5](e5909b5))
* add custom mapping example ([fe99c85](fe99c85))
* add HTTP API (APIGW-V2) event source ([60cb8e1](60cb8e1))
* add lambda edge support and example ([230c9c5](230c9c5))
* add logger ([e35a348](e35a348))
* add multiValueHeader and multiValueQueryStringParameters ([7199aa5](7199aa5))
* add respondWithErrors config ([53cf974](53cf974))
* add stripBasePath for custom domain names ([3a5c7ed](3a5c7ed))
* auto-detect binary response and add binarySettings ([64a99dc](64a99dc))
* call Express directly instead of via a proxy server running on a local socket ([a468c72](a468c72))
* lay groundwork for different event sources ([2db86f2](2db86f2))
* refactor and expose a new interface ([7de5d45](7de5d45))
* remove middleware and expose getCurrentLambdaInvoke method ([b56c13b](b56c13b))
* use multiValueHeaders for requests and responses ([c5ce62f](c5ce62f))
* use promise resolution by default ([a9c01a3](a9c01a3))

### BREAKING CHANGES

* The new interface is backwards incompatible and includes new and simpler ways of configuring and using the package.
@github-actions
Copy link

github-actions bot commented Feb 1, 2021

🎉 This PR is included in version 4.0.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

OneDev0411 added a commit to OneDev0411/serverless-express that referenced this pull request Mar 16, 2023
# [4.0.0](CodeGenieApp/serverless-express@v3.3.5...v4.0.0) (2021-02-01)

### Bug Fixes

* **audit:** npm audit fix ([66b03e5](CodeGenieApp/serverless-express@66b03e5))
* add body parsing for lambda edge event source ([116949d](CodeGenieApp/serverless-express@116949d))
* add Promise return type for proxy function ([#332](CodeGenieApp/serverless-express#332)) ([5b23f3c](CodeGenieApp/serverless-express@5b23f3c))
* change logging to include a log key ([542d473](CodeGenieApp/serverless-express@542d473))
* clean up sockets on EADDRINUSE server close ([e768599](CodeGenieApp/serverless-express@e768599))
* dependabot alerts ([df60394](CodeGenieApp/serverless-express@df60394))
* fix API Gateway V2 header response ([90bad18](CodeGenieApp/serverless-express@90bad18)), closes [#352](CodeGenieApp/serverless-express#352)
* fix getRequestValuesFromEvent headers ([f915e94](CodeGenieApp/serverless-express@f915e94))
* fix Lambda@Edge event source ([95b0aa6](CodeGenieApp/serverless-express@95b0aa6))
* fix Lambda@Edge headers and body ([aabd9d3](CodeGenieApp/serverless-express@aabd9d3))
* fix remoteAddress undefined on ALB event source ([a092233](CodeGenieApp/serverless-express@a092233))
* log actual headers in SERVERLESS_EXPRESS:FORWARD_RESPONSE:EVENT_SOURCE_RESPONSE_PARAMS ([72f2ef5](CodeGenieApp/serverless-express@72f2ef5))
* make optional the property `binarySettings` of `ConfigureParams` in typings ([b08ee87](CodeGenieApp/serverless-express@b08ee87))
* remove commitlint from travis ([7b12e56](CodeGenieApp/serverless-express@7b12e56))
* remove Node.js 4 support ([713ad14](CodeGenieApp/serverless-express@713ad14))
* remove Node.js 4 support ([e01c9af](CodeGenieApp/serverless-express@e01c9af))
* remove winston dependency and add basic logger ([5bd6c2c](CodeGenieApp/serverless-express@5bd6c2c))
* transform lambda edge response headers to lower case ([922fec0](CodeGenieApp/serverless-express@922fec0))
* transform request header keys to lower case ([daa656b](CodeGenieApp/serverless-express@daa656b))
* update dependencies ([e705bc6](CodeGenieApp/serverless-express@e705bc6))
* update dependencies ([075e15b](CodeGenieApp/serverless-express@075e15b))
* update dependencies ([39c55eb](CodeGenieApp/serverless-express@39c55eb))

### Features

* add additional event mapping logic ([e5909b5](CodeGenieApp/serverless-express@e5909b5))
* add custom mapping example ([fe99c85](CodeGenieApp/serverless-express@fe99c85))
* add HTTP API (APIGW-V2) event source ([60cb8e1](CodeGenieApp/serverless-express@60cb8e1))
* add lambda edge support and example ([230c9c5](CodeGenieApp/serverless-express@230c9c5))
* add logger ([e35a348](CodeGenieApp/serverless-express@e35a348))
* add multiValueHeader and multiValueQueryStringParameters ([7199aa5](CodeGenieApp/serverless-express@7199aa5))
* add respondWithErrors config ([53cf974](CodeGenieApp/serverless-express@53cf974))
* add stripBasePath for custom domain names ([3a5c7ed](CodeGenieApp/serverless-express@3a5c7ed))
* auto-detect binary response and add binarySettings ([64a99dc](CodeGenieApp/serverless-express@64a99dc))
* call Express directly instead of via a proxy server running on a local socket ([a468c72](CodeGenieApp/serverless-express@a468c72))
* lay groundwork for different event sources ([2db86f2](CodeGenieApp/serverless-express@2db86f2))
* refactor and expose a new interface ([7de5d45](CodeGenieApp/serverless-express@7de5d45))
* remove middleware and expose getCurrentLambdaInvoke method ([b56c13b](CodeGenieApp/serverless-express@b56c13b))
* use multiValueHeaders for requests and responses ([c5ce62f](CodeGenieApp/serverless-express@c5ce62f))
* use promise resolution by default ([a9c01a3](CodeGenieApp/serverless-express@a9c01a3))

### BREAKING CHANGES

* The new interface is backwards incompatible and includes new and simpler ways of configuring and using the package.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants