From 2550992ca39de600abe9099073374e784fc9feac Mon Sep 17 00:00:00 2001 From: evandrouzeda <49155191+evandrouzeda@users.noreply.github.com> Date: Wed, 21 Sep 2022 16:35:07 -0300 Subject: [PATCH 1/3] adding typescript definition --- index.d.ts | 1 + 1 file changed, 1 insertion(+) create mode 100644 index.d.ts diff --git a/index.d.ts b/index.d.ts new file mode 100644 index 0000000..2fd54a0 --- /dev/null +++ b/index.d.ts @@ -0,0 +1 @@ +export default function alexaVerifierMiddleware (req: any, res: any, next: any): any From 6e16feec192830c687395d90e9b5ef5f3635c249 Mon Sep 17 00:00:00 2001 From: evandrouzeda <49155191+evandrouzeda@users.noreply.github.com> Date: Wed, 21 Sep 2022 16:35:49 -0300 Subject: [PATCH 2/3] adding typescript definition --- package.json | 1 + 1 file changed, 1 insertion(+) diff --git a/package.json b/package.json index 1f090a0..a274871 100644 --- a/package.json +++ b/package.json @@ -3,6 +3,7 @@ "version": "2.0.1", "description": "An expressjs middleware that verifies HTTP requests sent to an Alexa skill are sent from Amazon.", "type": "module", + "types": "index.d.ts", "main": "index.js", "scripts": { "test": "tap ./test" From 08e639d14c91413415cb41b222902b41867b2f34 Mon Sep 17 00:00:00 2001 From: evandrouzeda <49155191+evandrouzeda@users.noreply.github.com> Date: Mon, 26 Sep 2022 09:50:18 -0300 Subject: [PATCH 3/3] adding more expecifications --- index.d.ts | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/index.d.ts b/index.d.ts index 2fd54a0..871518d 100644 --- a/index.d.ts +++ b/index.d.ts @@ -1 +1,8 @@ -export default function alexaVerifierMiddleware (req: any, res: any, next: any): any +import {Request, Response, NextFunction} from "express" +/** + * This function lookup for requests that include a signaturecertchainurl HTTP in header, parse out the entire body as a text string, and set a flag on the request object so others don't try to parse the body again. + * {@link https://github.com/alexa-js/alexa-verifier-middleware See the Documentation} + */ +declare function alexaVerifierMiddleware (req: Request, res: Response, next: NextFunction): NextFunction + +export = alexaVerifierMiddleware