diff --git a/README.md b/README.md index 667fa91..23befb6 100644 --- a/README.md +++ b/README.md @@ -72,3 +72,8 @@ const handler = async (event, responseStream, _context) => { module.exports.gzip = streamifyResponse(handler) ``` + +## Contributors +[AJ Stuyvenberg](https://github.com/astuyve) +[Luka Matic](https://github.com/maticluka999) +[Paulo Ricardo Xavier Giusti](https://github.com/prxg22) diff --git a/dist/index.d.ts b/dist/index.d.ts index 7060b04..5e4483f 100644 --- a/dist/index.d.ts +++ b/dist/index.d.ts @@ -1,4 +1,7 @@ +import { APIGatewayProxyEventV2, Callback, Context } from 'aws-lambda'; +import { ResponseStream } from './ResponseStream'; export declare function isInAWS(): boolean; -export declare function streamifyResponse(handler: Function): Function; +export type RequestHandler = (ev: APIGatewayProxyEventV2, streamResponse: ResponseStream, ctx?: Context, callback?: Callback) => any | Promise; +export declare function streamifyResponse(handler: RequestHandler): RequestHandler; export { ResponseStream } from './ResponseStream'; //# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/dist/index.d.ts.map b/dist/index.d.ts.map index a0244c8..db9e978 100644 --- a/dist/index.d.ts.map +++ b/dist/index.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAKA,wBAAgB,OAAO,IAAI,OAAO,CAOjC;AAED,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,QAAQ,GAAG,QAAQ,CAyB7D;AAUD,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAA"} \ No newline at end of file +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,sBAAsB,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,YAAY,CAAA;AACtE,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAA;AAEjD,wBAAgB,OAAO,IAAI,OAAO,CAOjC;AAED,MAAM,MAAM,cAAc,GAAG,CAC3B,EAAE,EAAE,sBAAsB,EAC1B,cAAc,EAAE,cAAc,EAC9B,GAAG,CAAC,EAAE,OAAO,EACb,QAAQ,CAAC,EAAE,QAAQ,KAChB,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC,CAAA;AAEvB,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,cAAc,GAAG,cAAc,CAyBzE;AAUD,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAA"} \ No newline at end of file diff --git a/dist/index.js.map b/dist/index.js.map index a44815d..c2f34d8 100644 --- a/dist/index.js.map +++ b/dist/index.js.map @@ -1 +1 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,YAAY,CAAA;;;AAGZ,qDAAiD;AAEjD,SAAgB,OAAO;IACrB,OAAO;IACL,aAAa;IACb,UAAU,CAAC,SAAS,KAAK,SAAS;QAClC,aAAa;QACb,SAAS,CAAC,iBAAiB,KAAK,SAAS,CAC1C,CAAA;AACH,CAAC;AAPD,0BAOC;AAED,SAAgB,iBAAiB,CAAC,OAAiB;IACjD,6BAA6B;IAC7B,IAAI,OAAO,EAAE,EAAE;QACb,aAAa;QACb,OAAO,SAAS,CAAC,iBAAiB,CAAC,OAAO,CAAC,CAAA;KAC5C;SAAM;QACL,OAAO,IAAI,KAAK,CAAC,OAAO,EAAE;YACxB,KAAK,EAAE,KAAK,WAAW,MAAM,EAAE,CAAC,EAAE,OAA4F;gBAC5H,MAAM,cAAc,GAAmB,SAAS,CAAC,OAAO,CAAC,CAAA;gBACzD,MAAM,MAAM,CAAC,GAAG,OAAO,CAAC,CAAA;gBACxB,qCACE,UAAU,EAAE,GAAG,EACf,OAAO,EAAE;wBACP,cAAc,EAAE,cAAc,CAAC,YAAY,IAAI,kBAAkB;qBAClE,IACE,CAAC,cAAc,CAAC,gBAAgB;oBACjC,CAAC,CAAC,EAAE,eAAe,EAAE,cAAc,CAAC,gBAAgB,EAAE;oBACtD,CAAC,CAAC,EAAE,CAAC,KACP,IAAI,EAAE,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AE;wBACP,cAAc,EAAE,cAAc,CAAC,YAAY,IAAI,kBAAkB;qBAClE,IACE,CAAC,cAAc,CAAC,gBAAgB;oBACjC,CAAC,CAAC,EAAE,eAAe,EAAE,cAAc,CAAC,gBAAgB,EAAE;oBACtD,CAAC,CAAC,EAAE,CAAC,KACP,IAAI,EAAE,cAAc,CAAC,gBAAgB;wBACnC,CAAC,CAAC,cAAc,CAAC,eAAe,EAAE,CAAC,QAAQ,CAAC,QAAQ,CAAC;wBACrD,CAAC,CAAC,cAAc,CAAC,eAAe,EAAE,CAAC,QAAQ,EAAE,IAChD;YACH,CAAC;SACF,CAAC,CAAA;KACH;AACH,CAAC;AAzBD,8CAyBC;AAED,SAAS,SAAS,CAAC,OAAc;IAC/B,IAAI,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,YAAY,+BAAc,CAAC,EAAE;QAC3C,MAAM,cAAc,GAAG,IAAI,+BAAc,EAAE,CAAA;QAC3C,OAAO,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,EAAE,cAAc,CAAC,CAAA;KACrC;IACD,OAAO,OAAO,CAAC,CAAC,CAAC,CAAA;AACnB,CAAC;AAED,mDAAiD;AAAxC,gHAAA,cAAc,OAAA"} \ No newline at end of file diff --git a/package.json b/package.json index 4b77499..dfee453 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "lambda-stream", - "version": "0.4.0", + "version": "0.5.0", "description": "awslambda.streamifyResponse, but locally and with typescript", "main": "dist/index.js", "types": "dist/index.d.ts",