@h4ad/serverless-adapter 3.2.0 → 4.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +565 -7
- package/lib/@types/binary-settings.d.ts +0 -41
- package/lib/@types/binary-settings.d.ts.map +0 -1
- package/lib/@types/binary-settings.js +0 -2
- package/lib/@types/binary-settings.js.map +0 -1
- package/lib/@types/digital-ocean/digital-ocean-http-event.d.ts +0 -37
- package/lib/@types/digital-ocean/digital-ocean-http-event.d.ts.map +0 -1
- package/lib/@types/digital-ocean/digital-ocean-http-event.js +0 -2
- package/lib/@types/digital-ocean/digital-ocean-http-event.js.map +0 -1
- package/lib/@types/digital-ocean/digital-ocean-http-response.d.ts +0 -22
- package/lib/@types/digital-ocean/digital-ocean-http-response.d.ts.map +0 -1
- package/lib/@types/digital-ocean/digital-ocean-http-response.js +0 -2
- package/lib/@types/digital-ocean/digital-ocean-http-response.js.map +0 -1
- package/lib/@types/digital-ocean/index.d.ts +0 -2
- package/lib/@types/digital-ocean/index.d.ts.map +0 -1
- package/lib/@types/digital-ocean/index.js +0 -2
- package/lib/@types/digital-ocean/index.js.map +0 -1
- package/lib/@types/headers.d.ts +0 -37
- package/lib/@types/headers.d.ts.map +0 -1
- package/lib/@types/headers.js +0 -2
- package/lib/@types/headers.js.map +0 -1
- package/lib/@types/helpers.d.ts +0 -10
- package/lib/@types/helpers.d.ts.map +0 -1
- package/lib/@types/helpers.js +0 -2
- package/lib/@types/helpers.js.map +0 -1
- package/lib/@types/huawei/huawei-api-gateway-event.d.ts +0 -81
- package/lib/@types/huawei/huawei-api-gateway-event.d.ts.map +0 -1
- package/lib/@types/huawei/huawei-api-gateway-event.js +0 -2
- package/lib/@types/huawei/huawei-api-gateway-event.js.map +0 -1
- package/lib/@types/huawei/huawei-api-gateway-response.d.ts +0 -27
- package/lib/@types/huawei/huawei-api-gateway-response.d.ts.map +0 -1
- package/lib/@types/huawei/huawei-api-gateway-response.js +0 -2
- package/lib/@types/huawei/huawei-api-gateway-response.js.map +0 -1
- package/lib/@types/huawei/huawei-context.d.ts +0 -188
- package/lib/@types/huawei/huawei-context.d.ts.map +0 -1
- package/lib/@types/huawei/huawei-context.js +0 -2
- package/lib/@types/huawei/huawei-context.js.map +0 -1
- package/lib/@types/huawei/index.d.ts +0 -4
- package/lib/@types/huawei/index.d.ts.map +0 -1
- package/lib/@types/huawei/index.js +0 -2
- package/lib/@types/huawei/index.js.map +0 -1
- package/lib/@types/index.d.ts +0 -4
- package/lib/@types/index.d.ts.map +0 -1
- package/lib/@types/index.js +0 -2
- package/lib/@types/index.js.map +0 -1
- package/lib/adapters/apollo-server/apollo-server-mutation.adapter.d.ts +0 -56
- package/lib/adapters/apollo-server/apollo-server-mutation.adapter.d.ts.map +0 -1
- package/lib/adapters/apollo-server/apollo-server-mutation.adapter.js +0 -2
- package/lib/adapters/apollo-server/apollo-server-mutation.adapter.js.map +0 -1
- package/lib/adapters/apollo-server/index.d.ts +0 -2
- package/lib/adapters/apollo-server/index.d.ts.map +0 -1
- package/lib/adapters/apollo-server/index.js +0 -2
- package/lib/adapters/apollo-server/index.js.map +0 -1
- package/lib/adapters/aws/alb.adapter.d.ts +0 -71
- package/lib/adapters/aws/alb.adapter.d.ts.map +0 -1
- package/lib/adapters/aws/alb.adapter.js +0 -2
- package/lib/adapters/aws/alb.adapter.js.map +0 -1
- package/lib/adapters/aws/api-gateway-v1.adapter.d.ts +0 -76
- package/lib/adapters/aws/api-gateway-v1.adapter.d.ts.map +0 -1
- package/lib/adapters/aws/api-gateway-v1.adapter.js +0 -2
- package/lib/adapters/aws/api-gateway-v1.adapter.js.map +0 -1
- package/lib/adapters/aws/api-gateway-v2.adapter.d.ts +0 -75
- package/lib/adapters/aws/api-gateway-v2.adapter.d.ts.map +0 -1
- package/lib/adapters/aws/api-gateway-v2.adapter.js +0 -2
- package/lib/adapters/aws/api-gateway-v2.adapter.js.map +0 -1
- package/lib/adapters/aws/base/aws-simple-adapter.d.ts +0 -83
- package/lib/adapters/aws/base/aws-simple-adapter.d.ts.map +0 -1
- package/lib/adapters/aws/base/aws-simple-adapter.js +0 -2
- package/lib/adapters/aws/base/aws-simple-adapter.js.map +0 -1
- package/lib/adapters/aws/base/index.d.ts +0 -2
- package/lib/adapters/aws/base/index.d.ts.map +0 -1
- package/lib/adapters/aws/base/index.js +0 -2
- package/lib/adapters/aws/base/index.js.map +0 -1
- package/lib/adapters/aws/dynamodb.adapter.d.ts +0 -56
- package/lib/adapters/aws/dynamodb.adapter.d.ts.map +0 -1
- package/lib/adapters/aws/dynamodb.adapter.js +0 -2
- package/lib/adapters/aws/dynamodb.adapter.js.map +0 -1
- package/lib/adapters/aws/event-bridge.adapter.d.ts +0 -63
- package/lib/adapters/aws/event-bridge.adapter.d.ts.map +0 -1
- package/lib/adapters/aws/event-bridge.adapter.js +0 -2
- package/lib/adapters/aws/event-bridge.adapter.js.map +0 -1
- package/lib/adapters/aws/index.d.ts +0 -12
- package/lib/adapters/aws/index.d.ts.map +0 -1
- package/lib/adapters/aws/index.js +0 -2
- package/lib/adapters/aws/index.js.map +0 -1
- package/lib/adapters/aws/lambda-edge.adapter.d.ts +0 -209
- package/lib/adapters/aws/lambda-edge.adapter.d.ts.map +0 -1
- package/lib/adapters/aws/lambda-edge.adapter.js +0 -2
- package/lib/adapters/aws/lambda-edge.adapter.js.map +0 -1
- package/lib/adapters/aws/request-lambda-edge.adapter.d.ts +0 -131
- package/lib/adapters/aws/request-lambda-edge.adapter.d.ts.map +0 -1
- package/lib/adapters/aws/request-lambda-edge.adapter.js +0 -2
- package/lib/adapters/aws/request-lambda-edge.adapter.js.map +0 -1
- package/lib/adapters/aws/s3.adapter.d.ts +0 -56
- package/lib/adapters/aws/s3.adapter.d.ts.map +0 -1
- package/lib/adapters/aws/s3.adapter.js +0 -2
- package/lib/adapters/aws/s3.adapter.js.map +0 -1
- package/lib/adapters/aws/sns.adapter.d.ts +0 -56
- package/lib/adapters/aws/sns.adapter.d.ts.map +0 -1
- package/lib/adapters/aws/sns.adapter.js +0 -2
- package/lib/adapters/aws/sns.adapter.js.map +0 -1
- package/lib/adapters/aws/sqs.adapter.d.ts +0 -56
- package/lib/adapters/aws/sqs.adapter.d.ts.map +0 -1
- package/lib/adapters/aws/sqs.adapter.js +0 -2
- package/lib/adapters/aws/sqs.adapter.js.map +0 -1
- package/lib/adapters/azure/http-trigger-v4.adapter.d.ts +0 -81
- package/lib/adapters/azure/http-trigger-v4.adapter.d.ts.map +0 -1
- package/lib/adapters/azure/http-trigger-v4.adapter.js +0 -2
- package/lib/adapters/azure/http-trigger-v4.adapter.js.map +0 -1
- package/lib/adapters/azure/index.d.ts +0 -2
- package/lib/adapters/azure/index.d.ts.map +0 -1
- package/lib/adapters/azure/index.js +0 -2
- package/lib/adapters/azure/index.js.map +0 -1
- package/lib/adapters/digital-ocean/http-function.adapter.d.ts +0 -65
- package/lib/adapters/digital-ocean/http-function.adapter.d.ts.map +0 -1
- package/lib/adapters/digital-ocean/http-function.adapter.js +0 -2
- package/lib/adapters/digital-ocean/http-function.adapter.js.map +0 -1
- package/lib/adapters/digital-ocean/index.d.ts +0 -2
- package/lib/adapters/digital-ocean/index.d.ts.map +0 -1
- package/lib/adapters/digital-ocean/index.js +0 -2
- package/lib/adapters/digital-ocean/index.js.map +0 -1
- package/lib/adapters/dummy/dummy.adapter.d.ts +0 -31
- package/lib/adapters/dummy/dummy.adapter.d.ts.map +0 -1
- package/lib/adapters/dummy/dummy.adapter.js +0 -2
- package/lib/adapters/dummy/dummy.adapter.js.map +0 -1
- package/lib/adapters/dummy/index.d.ts +0 -2
- package/lib/adapters/dummy/index.d.ts.map +0 -1
- package/lib/adapters/dummy/index.js +0 -2
- package/lib/adapters/dummy/index.js.map +0 -1
- package/lib/adapters/huawei/huawei-api-gateway.adapter.d.ts +0 -66
- package/lib/adapters/huawei/huawei-api-gateway.adapter.d.ts.map +0 -1
- package/lib/adapters/huawei/huawei-api-gateway.adapter.js +0 -2
- package/lib/adapters/huawei/huawei-api-gateway.adapter.js.map +0 -1
- package/lib/adapters/huawei/index.d.ts +0 -2
- package/lib/adapters/huawei/index.d.ts.map +0 -1
- package/lib/adapters/huawei/index.js +0 -2
- package/lib/adapters/huawei/index.js.map +0 -1
- package/lib/contracts/adapter.contract.d.ts +0 -152
- package/lib/contracts/adapter.contract.d.ts.map +0 -1
- package/lib/contracts/adapter.contract.js +0 -2
- package/lib/contracts/adapter.contract.js.map +0 -1
- package/lib/contracts/framework.contract.d.ts +0 -19
- package/lib/contracts/framework.contract.d.ts.map +0 -1
- package/lib/contracts/framework.contract.js +0 -2
- package/lib/contracts/framework.contract.js.map +0 -1
- package/lib/contracts/handler.contract.d.ts +0 -25
- package/lib/contracts/handler.contract.d.ts.map +0 -1
- package/lib/contracts/handler.contract.js +0 -2
- package/lib/contracts/handler.contract.js.map +0 -1
- package/lib/contracts/index.d.ts +0 -5
- package/lib/contracts/index.d.ts.map +0 -1
- package/lib/contracts/index.js +0 -2
- package/lib/contracts/index.js.map +0 -1
- package/lib/contracts/resolver.contract.d.ts +0 -83
- package/lib/contracts/resolver.contract.d.ts.map +0 -1
- package/lib/contracts/resolver.contract.js +0 -2
- package/lib/contracts/resolver.contract.js.map +0 -1
- package/lib/core/base-handler.d.ts +0 -32
- package/lib/core/base-handler.d.ts.map +0 -1
- package/lib/core/base-handler.js +0 -2
- package/lib/core/base-handler.js.map +0 -1
- package/lib/core/constants.d.ts +0 -31
- package/lib/core/constants.d.ts.map +0 -1
- package/lib/core/constants.js +0 -2
- package/lib/core/constants.js.map +0 -1
- package/lib/core/current-invoke.d.ts +0 -48
- package/lib/core/current-invoke.d.ts.map +0 -1
- package/lib/core/current-invoke.js +0 -2
- package/lib/core/current-invoke.js.map +0 -1
- package/lib/core/event-body.d.ts +0 -22
- package/lib/core/event-body.d.ts.map +0 -1
- package/lib/core/event-body.js +0 -2
- package/lib/core/event-body.js.map +0 -1
- package/lib/core/headers.d.ts +0 -73
- package/lib/core/headers.d.ts.map +0 -1
- package/lib/core/headers.js +0 -3
- package/lib/core/headers.js.map +0 -1
- package/lib/core/index.d.ts +0 -12
- package/lib/core/index.d.ts.map +0 -1
- package/lib/core/index.js +0 -2
- package/lib/core/index.js.map +0 -1
- package/lib/core/is-binary.d.ts +0 -73
- package/lib/core/is-binary.d.ts.map +0 -1
- package/lib/core/is-binary.js +0 -2
- package/lib/core/is-binary.js.map +0 -1
- package/lib/core/logger.d.ts +0 -64
- package/lib/core/logger.d.ts.map +0 -1
- package/lib/core/logger.js +0 -2
- package/lib/core/logger.js.map +0 -1
- package/lib/core/no-op.d.ts +0 -8
- package/lib/core/no-op.d.ts.map +0 -1
- package/lib/core/no-op.js +0 -2
- package/lib/core/no-op.js.map +0 -1
- package/lib/core/optional.d.ts +0 -22
- package/lib/core/optional.d.ts.map +0 -1
- package/lib/core/optional.js +0 -2
- package/lib/core/optional.js.map +0 -1
- package/lib/core/path.d.ts +0 -53
- package/lib/core/path.d.ts.map +0 -1
- package/lib/core/path.js +0 -2
- package/lib/core/path.js.map +0 -1
- package/lib/core/stream.d.ts +0 -21
- package/lib/core/stream.d.ts.map +0 -1
- package/lib/core/stream.js +0 -2
- package/lib/core/stream.js.map +0 -1
- package/lib/frameworks/apollo-server/apollo-server.framework.d.ts +0 -69
- package/lib/frameworks/apollo-server/apollo-server.framework.d.ts.map +0 -1
- package/lib/frameworks/apollo-server/apollo-server.framework.js +0 -2
- package/lib/frameworks/apollo-server/apollo-server.framework.js.map +0 -1
- package/lib/frameworks/apollo-server/index.d.ts +0 -2
- package/lib/frameworks/apollo-server/index.d.ts.map +0 -1
- package/lib/frameworks/apollo-server/index.js +0 -2
- package/lib/frameworks/apollo-server/index.js.map +0 -1
- package/lib/frameworks/body-parser/base-body-parser.framework.d.ts +0 -69
- package/lib/frameworks/body-parser/base-body-parser.framework.d.ts.map +0 -1
- package/lib/frameworks/body-parser/base-body-parser.framework.js +0 -2
- package/lib/frameworks/body-parser/base-body-parser.framework.js.map +0 -1
- package/lib/frameworks/body-parser/index.d.ts +0 -6
- package/lib/frameworks/body-parser/index.d.ts.map +0 -1
- package/lib/frameworks/body-parser/index.js +0 -2
- package/lib/frameworks/body-parser/index.js.map +0 -1
- package/lib/frameworks/body-parser/json-body-parser.framework.d.ts +0 -26
- package/lib/frameworks/body-parser/json-body-parser.framework.d.ts.map +0 -1
- package/lib/frameworks/body-parser/json-body-parser.framework.js +0 -2
- package/lib/frameworks/body-parser/json-body-parser.framework.js.map +0 -1
- package/lib/frameworks/body-parser/raw-body-parser.framework.d.ts +0 -26
- package/lib/frameworks/body-parser/raw-body-parser.framework.d.ts.map +0 -1
- package/lib/frameworks/body-parser/raw-body-parser.framework.js +0 -2
- package/lib/frameworks/body-parser/raw-body-parser.framework.js.map +0 -1
- package/lib/frameworks/body-parser/text-body-parser.framework.d.ts +0 -26
- package/lib/frameworks/body-parser/text-body-parser.framework.d.ts.map +0 -1
- package/lib/frameworks/body-parser/text-body-parser.framework.js +0 -2
- package/lib/frameworks/body-parser/text-body-parser.framework.js.map +0 -1
- package/lib/frameworks/body-parser/urlencoded-body-parser.framework.d.ts +0 -26
- package/lib/frameworks/body-parser/urlencoded-body-parser.framework.d.ts.map +0 -1
- package/lib/frameworks/body-parser/urlencoded-body-parser.framework.js +0 -2
- package/lib/frameworks/body-parser/urlencoded-body-parser.framework.js.map +0 -1
- package/lib/frameworks/cors/cors.framework.d.ts +0 -78
- package/lib/frameworks/cors/cors.framework.d.ts.map +0 -1
- package/lib/frameworks/cors/cors.framework.js +0 -3
- package/lib/frameworks/cors/cors.framework.js.map +0 -1
- package/lib/frameworks/cors/index.d.ts +0 -2
- package/lib/frameworks/cors/index.d.ts.map +0 -1
- package/lib/frameworks/cors/index.js +0 -2
- package/lib/frameworks/cors/index.js.map +0 -1
- package/lib/frameworks/deepkit/http-deepkit.framework.d.ts +0 -18
- package/lib/frameworks/deepkit/http-deepkit.framework.d.ts.map +0 -1
- package/lib/frameworks/deepkit/http-deepkit.framework.js +0 -2
- package/lib/frameworks/deepkit/http-deepkit.framework.js.map +0 -1
- package/lib/frameworks/deepkit/index.d.ts +0 -2
- package/lib/frameworks/deepkit/index.d.ts.map +0 -1
- package/lib/frameworks/deepkit/index.js +0 -2
- package/lib/frameworks/deepkit/index.js.map +0 -1
- package/lib/frameworks/express/express.framework.d.ts +0 -17
- package/lib/frameworks/express/express.framework.d.ts.map +0 -1
- package/lib/frameworks/express/express.framework.js +0 -2
- package/lib/frameworks/express/express.framework.js.map +0 -1
- package/lib/frameworks/express/index.d.ts +0 -2
- package/lib/frameworks/express/index.d.ts.map +0 -1
- package/lib/frameworks/express/index.js +0 -2
- package/lib/frameworks/express/index.js.map +0 -1
- package/lib/frameworks/fastify/fastify.framework.d.ts +0 -17
- package/lib/frameworks/fastify/fastify.framework.d.ts.map +0 -1
- package/lib/frameworks/fastify/fastify.framework.js +0 -2
- package/lib/frameworks/fastify/fastify.framework.js.map +0 -1
- package/lib/frameworks/fastify/helpers/no-op-content-parser.d.ts +0 -14
- package/lib/frameworks/fastify/helpers/no-op-content-parser.d.ts.map +0 -1
- package/lib/frameworks/fastify/helpers/no-op-content-parser.js +0 -2
- package/lib/frameworks/fastify/helpers/no-op-content-parser.js.map +0 -1
- package/lib/frameworks/fastify/index.d.ts +0 -2
- package/lib/frameworks/fastify/index.d.ts.map +0 -1
- package/lib/frameworks/fastify/index.js +0 -2
- package/lib/frameworks/fastify/index.js.map +0 -1
- package/lib/frameworks/hapi/hapi.framework.d.ts +0 -17
- package/lib/frameworks/hapi/hapi.framework.d.ts.map +0 -1
- package/lib/frameworks/hapi/hapi.framework.js +0 -2
- package/lib/frameworks/hapi/hapi.framework.js.map +0 -1
- package/lib/frameworks/hapi/index.d.ts +0 -2
- package/lib/frameworks/hapi/index.d.ts.map +0 -1
- package/lib/frameworks/hapi/index.js +0 -2
- package/lib/frameworks/hapi/index.js.map +0 -1
- package/lib/frameworks/koa/index.d.ts +0 -2
- package/lib/frameworks/koa/index.d.ts.map +0 -1
- package/lib/frameworks/koa/index.js +0 -2
- package/lib/frameworks/koa/index.js.map +0 -1
- package/lib/frameworks/koa/koa.framework.d.ts +0 -17
- package/lib/frameworks/koa/koa.framework.d.ts.map +0 -1
- package/lib/frameworks/koa/koa.framework.js +0 -2
- package/lib/frameworks/koa/koa.framework.js.map +0 -1
- package/lib/frameworks/lazy/index.d.ts +0 -2
- package/lib/frameworks/lazy/index.d.ts.map +0 -1
- package/lib/frameworks/lazy/index.js +0 -2
- package/lib/frameworks/lazy/index.js.map +0 -1
- package/lib/frameworks/lazy/lazy.framework.d.ts +0 -56
- package/lib/frameworks/lazy/lazy.framework.d.ts.map +0 -1
- package/lib/frameworks/lazy/lazy.framework.js +0 -2
- package/lib/frameworks/lazy/lazy.framework.js.map +0 -1
- package/lib/frameworks/trpc/index.d.ts +0 -2
- package/lib/frameworks/trpc/index.d.ts.map +0 -1
- package/lib/frameworks/trpc/index.js +0 -2
- package/lib/frameworks/trpc/index.js.map +0 -1
- package/lib/frameworks/trpc/trpc.framework.d.ts +0 -153
- package/lib/frameworks/trpc/trpc.framework.d.ts.map +0 -1
- package/lib/frameworks/trpc/trpc.framework.js +0 -2
- package/lib/frameworks/trpc/trpc.framework.js.map +0 -1
- package/lib/handlers/aws/aws-stream.handler.d.ts +0 -89
- package/lib/handlers/aws/aws-stream.handler.d.ts.map +0 -1
- package/lib/handlers/aws/aws-stream.handler.js +0 -2
- package/lib/handlers/aws/aws-stream.handler.js.map +0 -1
- package/lib/handlers/aws/index.d.ts +0 -2
- package/lib/handlers/aws/index.d.ts.map +0 -1
- package/lib/handlers/aws/index.js +0 -2
- package/lib/handlers/aws/index.js.map +0 -1
- package/lib/handlers/azure/azure.handler.d.ts +0 -45
- package/lib/handlers/azure/azure.handler.d.ts.map +0 -1
- package/lib/handlers/azure/azure.handler.js +0 -2
- package/lib/handlers/azure/azure.handler.js.map +0 -1
- package/lib/handlers/azure/index.d.ts +0 -2
- package/lib/handlers/azure/index.d.ts.map +0 -1
- package/lib/handlers/azure/index.js +0 -2
- package/lib/handlers/azure/index.js.map +0 -1
- package/lib/handlers/base/index.d.ts +0 -2
- package/lib/handlers/base/index.d.ts.map +0 -1
- package/lib/handlers/base/index.js +0 -2
- package/lib/handlers/base/index.js.map +0 -1
- package/lib/handlers/base/raw-request.d.ts +0 -31
- package/lib/handlers/base/raw-request.d.ts.map +0 -1
- package/lib/handlers/base/raw-request.js +0 -2
- package/lib/handlers/base/raw-request.js.map +0 -1
- package/lib/handlers/default/default.handler.d.ts +0 -88
- package/lib/handlers/default/default.handler.d.ts.map +0 -1
- package/lib/handlers/default/default.handler.js +0 -2
- package/lib/handlers/default/default.handler.js.map +0 -1
- package/lib/handlers/default/index.d.ts +0 -2
- package/lib/handlers/default/index.d.ts.map +0 -1
- package/lib/handlers/default/index.js +0 -2
- package/lib/handlers/default/index.js.map +0 -1
- package/lib/handlers/digital-ocean/digital-ocean.handler.d.ts +0 -17
- package/lib/handlers/digital-ocean/digital-ocean.handler.d.ts.map +0 -1
- package/lib/handlers/digital-ocean/digital-ocean.handler.js +0 -2
- package/lib/handlers/digital-ocean/digital-ocean.handler.js.map +0 -1
- package/lib/handlers/digital-ocean/index.d.ts +0 -2
- package/lib/handlers/digital-ocean/index.d.ts.map +0 -1
- package/lib/handlers/digital-ocean/index.js +0 -2
- package/lib/handlers/digital-ocean/index.js.map +0 -1
- package/lib/handlers/firebase/http-firebase-v2.handler.d.ts +0 -27
- package/lib/handlers/firebase/http-firebase-v2.handler.d.ts.map +0 -1
- package/lib/handlers/firebase/http-firebase-v2.handler.js +0 -2
- package/lib/handlers/firebase/http-firebase-v2.handler.js.map +0 -1
- package/lib/handlers/firebase/http-firebase.handler.d.ts +0 -19
- package/lib/handlers/firebase/http-firebase.handler.d.ts.map +0 -1
- package/lib/handlers/firebase/http-firebase.handler.js +0 -2
- package/lib/handlers/firebase/http-firebase.handler.js.map +0 -1
- package/lib/handlers/firebase/index.d.ts +0 -3
- package/lib/handlers/firebase/index.d.ts.map +0 -1
- package/lib/handlers/firebase/index.js +0 -2
- package/lib/handlers/firebase/index.js.map +0 -1
- package/lib/handlers/gcp/gcp.handler.d.ts +0 -26
- package/lib/handlers/gcp/gcp.handler.d.ts.map +0 -1
- package/lib/handlers/gcp/gcp.handler.js +0 -2
- package/lib/handlers/gcp/gcp.handler.js.map +0 -1
- package/lib/handlers/gcp/index.d.ts +0 -2
- package/lib/handlers/gcp/index.d.ts.map +0 -1
- package/lib/handlers/gcp/index.js +0 -2
- package/lib/handlers/gcp/index.js.map +0 -1
- package/lib/handlers/huawei/http-huawei.handler.d.ts +0 -59
- package/lib/handlers/huawei/http-huawei.handler.d.ts.map +0 -1
- package/lib/handlers/huawei/http-huawei.handler.js +0 -2
- package/lib/handlers/huawei/http-huawei.handler.js.map +0 -1
- package/lib/handlers/huawei/index.d.ts +0 -2
- package/lib/handlers/huawei/index.d.ts.map +0 -1
- package/lib/handlers/huawei/index.js +0 -2
- package/lib/handlers/huawei/index.js.map +0 -1
- package/lib/index.d.ts +0 -6
- package/lib/index.d.ts.map +0 -1
- package/lib/index.doc.js +0 -2
- package/lib/index.doc.js.map +0 -1
- package/lib/index.js +0 -2
- package/lib/index.js.map +0 -1
- package/lib/network/index.d.ts +0 -5
- package/lib/network/index.d.ts.map +0 -1
- package/lib/network/index.js +0 -2
- package/lib/network/index.js.map +0 -1
- package/lib/network/request.d.ts +0 -44
- package/lib/network/request.d.ts.map +0 -1
- package/lib/network/request.js +0 -2
- package/lib/network/request.js.map +0 -1
- package/lib/network/response-stream.d.ts +0 -41
- package/lib/network/response-stream.d.ts.map +0 -1
- package/lib/network/response-stream.js +0 -7
- package/lib/network/response-stream.js.map +0 -1
- package/lib/network/response.d.ts +0 -48
- package/lib/network/response.d.ts.map +0 -1
- package/lib/network/response.js +0 -4
- package/lib/network/response.js.map +0 -1
- package/lib/network/utils.d.ts +0 -9
- package/lib/network/utils.d.ts.map +0 -1
- package/lib/network/utils.js +0 -2
- package/lib/network/utils.js.map +0 -1
- package/lib/resolvers/aws-context/aws-context.resolver.d.ts +0 -19
- package/lib/resolvers/aws-context/aws-context.resolver.d.ts.map +0 -1
- package/lib/resolvers/aws-context/aws-context.resolver.js +0 -2
- package/lib/resolvers/aws-context/aws-context.resolver.js.map +0 -1
- package/lib/resolvers/aws-context/index.d.ts +0 -2
- package/lib/resolvers/aws-context/index.d.ts.map +0 -1
- package/lib/resolvers/aws-context/index.js +0 -2
- package/lib/resolvers/aws-context/index.js.map +0 -1
- package/lib/resolvers/callback/callback.resolver.d.ts +0 -23
- package/lib/resolvers/callback/callback.resolver.d.ts.map +0 -1
- package/lib/resolvers/callback/callback.resolver.js +0 -2
- package/lib/resolvers/callback/callback.resolver.js.map +0 -1
- package/lib/resolvers/callback/index.d.ts +0 -2
- package/lib/resolvers/callback/index.d.ts.map +0 -1
- package/lib/resolvers/callback/index.js +0 -2
- package/lib/resolvers/callback/index.js.map +0 -1
- package/lib/resolvers/dummy/dummy.resolver.d.ts +0 -14
- package/lib/resolvers/dummy/dummy.resolver.d.ts.map +0 -1
- package/lib/resolvers/dummy/dummy.resolver.js +0 -2
- package/lib/resolvers/dummy/dummy.resolver.js.map +0 -1
- package/lib/resolvers/dummy/index.d.ts +0 -2
- package/lib/resolvers/dummy/index.d.ts.map +0 -1
- package/lib/resolvers/dummy/index.js +0 -2
- package/lib/resolvers/dummy/index.js.map +0 -1
- package/lib/resolvers/promise/index.d.ts +0 -2
- package/lib/resolvers/promise/index.d.ts.map +0 -1
- package/lib/resolvers/promise/index.js +0 -2
- package/lib/resolvers/promise/index.js.map +0 -1
- package/lib/resolvers/promise/promise.resolver.d.ts +0 -14
- package/lib/resolvers/promise/promise.resolver.d.ts.map +0 -1
- package/lib/resolvers/promise/promise.resolver.js +0 -2
- package/lib/resolvers/promise/promise.resolver.js.map +0 -1
- package/lib/serverless-adapter.d.ts +0 -119
- package/lib/serverless-adapter.d.ts.map +0 -1
- package/lib/serverless-adapter.js +0 -2
- package/lib/serverless-adapter.js.map +0 -1
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import type { Context } from '@azure/functions';
|
|
2
|
-
import { BinarySettings } from '../../@types';
|
|
3
|
-
import { AdapterContract, FrameworkContract, ResolverContract, ServerlessHandler } from '../../contracts';
|
|
4
|
-
import { ILogger } from '../../core';
|
|
5
|
-
import { DefaultHandler } from '../default';
|
|
6
|
-
/**
|
|
7
|
-
* The options to customize {@link AzureHandler}
|
|
8
|
-
*
|
|
9
|
-
* @breadcrumb Handlers / AzureHandler
|
|
10
|
-
* @public
|
|
11
|
-
*/
|
|
12
|
-
export interface AzureHandlerOptions {
|
|
13
|
-
/**
|
|
14
|
-
* Indicates to use the context log instead console.log when logger is internal (created by the library)
|
|
15
|
-
*
|
|
16
|
-
* @defaultValue true
|
|
17
|
-
*/
|
|
18
|
-
useContextLogWhenInternalLogger: boolean;
|
|
19
|
-
}
|
|
20
|
-
/**
|
|
21
|
-
* The class that implements a serverless handler for Azure Function.
|
|
22
|
-
*
|
|
23
|
-
* When you don't specify a custom logger, the {@link Context} logger is used instead.
|
|
24
|
-
*
|
|
25
|
-
* @breadcrumb Handlers / AzureHandler
|
|
26
|
-
* @public
|
|
27
|
-
*/
|
|
28
|
-
export declare class AzureHandler<TApp, TEvent, TCallback, TResponse, TReturn> extends DefaultHandler<TApp, TEvent, Context, TCallback, TResponse, TReturn> {
|
|
29
|
-
protected readonly options?: AzureHandlerOptions | undefined;
|
|
30
|
-
/**
|
|
31
|
-
* Default Constructor
|
|
32
|
-
*/
|
|
33
|
-
constructor(options?: AzureHandlerOptions | undefined);
|
|
34
|
-
/**
|
|
35
|
-
* {@inheritDoc}
|
|
36
|
-
*/
|
|
37
|
-
getHandler(app: TApp, framework: FrameworkContract<TApp>, adapters: AdapterContract<TEvent, Context, TResponse>[], resolverFactory: ResolverContract<TEvent, Context, TCallback, TResponse, TReturn>, binarySettings: BinarySettings, respondWithErrors: boolean, log: ILogger): ServerlessHandler<TReturn>;
|
|
38
|
-
/**
|
|
39
|
-
* Get the {@link ILogger} instance from logger of the context
|
|
40
|
-
*
|
|
41
|
-
* @param context - The Azure Context
|
|
42
|
-
*/
|
|
43
|
-
protected createLoggerFromContext(context: Context): ILogger;
|
|
44
|
-
}
|
|
45
|
-
//# sourceMappingURL=azure.handler.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"azure.handler.d.ts","sourceRoot":"","sources":["../../../src/handlers/azure/azure.handler.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAChD,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAC9C,OAAO,EACL,eAAe,EACf,iBAAiB,EACjB,gBAAgB,EAChB,iBAAiB,EAClB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,OAAO,EAA2C,MAAM,YAAY,CAAC;AAC9E,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAI5C;;;;;GAKG;AACH,MAAM,WAAW,mBAAmB;IAClC;;;;OAIG;IACH,+BAA+B,EAAE,OAAO,CAAC;CAC1C;AAED;;;;;;;GAOG;AACH,qBAAa,YAAY,CACvB,IAAI,EACJ,MAAM,EACN,SAAS,EACT,SAAS,EACT,OAAO,CACP,SAAQ,cAAc,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,OAAO,CAAC;IAMhE,SAAS,CAAC,QAAQ,CAAC,OAAO,CAAC;IAHvC;;OAEG;gBAC4B,OAAO,CAAC,iCAAqB;IAQ5D;;OAEG;IACI,UAAU,CACf,GAAG,EAAE,IAAI,EACT,SAAS,EAAE,iBAAiB,CAAC,IAAI,CAAC,EAClC,QAAQ,EAAE,eAAe,CAAC,MAAM,EAAE,OAAO,EAAE,SAAS,CAAC,EAAE,EACvD,eAAe,EAAE,gBAAgB,CAC/B,MAAM,EACN,OAAO,EACP,SAAS,EACT,SAAS,EACT,OAAO,CACR,EACD,cAAc,EAAE,cAAc,EAC9B,iBAAiB,EAAE,OAAO,EAC1B,GAAG,EAAE,OAAO,GACX,iBAAiB,CAAC,OAAO,CAAC;IAkC7B;;;;OAIG;IACH,SAAS,CAAC,uBAAuB,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO;CAW7D"}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use strict";var __defProp=Object.defineProperty,__getOwnPropDesc=Object.getOwnPropertyDescriptor,__getOwnPropNames=Object.getOwnPropertyNames,__hasOwnProp=Object.prototype.hasOwnProperty,__export=(target,all)=>{for(var name in all)__defProp(target,name,{get:all[name],enumerable:!0})},__copyProps=(to,from,except,desc)=>{if(from&&typeof from=="object"||typeof from=="function")for(let key of __getOwnPropNames(from))!__hasOwnProp.call(to,key)&&key!==except&&__defProp(to,key,{get:()=>from[key],enumerable:!(desc=__getOwnPropDesc(from,key))||desc.enumerable});return to},__toCommonJS=mod=>__copyProps(__defProp({},"__esModule",{value:!0}),mod),azure_handler_exports={};__export(azure_handler_exports,{AzureHandler:()=>AzureHandler});module.exports=__toCommonJS(azure_handler_exports);var import_core=require("../../core"),import_default=require("../default");class AzureHandler extends import_default.DefaultHandler{constructor(options){super(),this.options=options}getHandler(app,framework,adapters,resolverFactory,binarySettings,respondWithErrors,log){return(context,event)=>{var _a;const useContextLogWhenInternalLogger=(0,import_core.getDefaultIfUndefined)((_a=this.options)==null?void 0:_a.useContextLogWhenInternalLogger,!0);(0,import_core.isInternalLogger)(log)&&useContextLogWhenInternalLogger&&(log=this.createLoggerFromContext(context));const defaultHandler=super.getHandler(app,framework,adapters,resolverFactory,binarySettings,respondWithErrors,log);return delete context.done,delete context.res,defaultHandler(event,context,void 0)}}createLoggerFromContext(context){return{error:context.log.error,debug:context.log.verbose,verbose:context.log.verbose,info:context.log.info,warn:context.log.warn}}}
|
|
2
|
-
//# sourceMappingURL=azure.handler.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"azure.handler.js","sources":["../../../src/handlers/azure/azure.handler.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/unbound-method */\n//#region Imports\n\nimport type { Context } from '@azure/functions';\nimport { BinarySettings } from '../../@types';\nimport {\n AdapterContract,\n FrameworkContract,\n ResolverContract,\n ServerlessHandler,\n} from '../../contracts';\nimport { ILogger, getDefaultIfUndefined, isInternalLogger } from '../../core';\nimport { DefaultHandler } from '../default';\n\n//#endregion\n\n/**\n * The options to customize {@link AzureHandler}\n *\n * @breadcrumb Handlers / AzureHandler\n * @public\n */\nexport interface AzureHandlerOptions {\n /**\n * Indicates to use the context log instead console.log when logger is internal (created by the library)\n *\n * @defaultValue true\n */\n useContextLogWhenInternalLogger: boolean;\n}\n\n/**\n * The class that implements a serverless handler for Azure Function.\n *\n * When you don't specify a custom logger, the {@link Context} logger is used instead.\n *\n * @breadcrumb Handlers / AzureHandler\n * @public\n */\nexport class AzureHandler<\n TApp,\n TEvent,\n TCallback,\n TResponse,\n TReturn,\n> extends DefaultHandler<TApp, TEvent, Context, TCallback, TResponse, TReturn> {\n //#region Constructor\n\n /**\n * Default Constructor\n */\n constructor(protected readonly options?: AzureHandlerOptions) {\n super();\n }\n\n //#endregion\n\n //#region Public Methods\n\n /**\n * {@inheritDoc}\n */\n public getHandler(\n app: TApp,\n framework: FrameworkContract<TApp>,\n adapters: AdapterContract<TEvent, Context, TResponse>[],\n resolverFactory: ResolverContract<\n TEvent,\n Context,\n TCallback,\n TResponse,\n TReturn\n >,\n binarySettings: BinarySettings,\n respondWithErrors: boolean,\n log: ILogger,\n ): ServerlessHandler<TReturn> {\n return (context: Context, event: TEvent) => {\n const useContextLogWhenInternalLogger = getDefaultIfUndefined(\n this.options?.useContextLogWhenInternalLogger,\n true,\n );\n\n if (isInternalLogger(log) && useContextLogWhenInternalLogger)\n log = this.createLoggerFromContext(context);\n\n const defaultHandler = super.getHandler(\n app,\n framework,\n adapters,\n resolverFactory,\n binarySettings,\n respondWithErrors,\n log,\n );\n\n // remove this from context\n // because user can mess it-up the things\n // @ts-ignore\n delete context.done;\n delete context.res;\n\n return defaultHandler(event, context, undefined);\n };\n }\n\n //#endregion\n\n //#region Protected Methods\n\n /**\n * Get the {@link ILogger} instance from logger of the context\n *\n * @param context - The Azure Context\n */\n protected createLoggerFromContext(context: Context): ILogger {\n return {\n error: context.log.error,\n debug: context.log.verbose,\n verbose: context.log.verbose,\n info: context.log.info,\n warn: context.log.warn,\n };\n }\n\n //#endregion\n}\n"],"names":[],"mappings":"ooBAAA,sBAAA,CAAA,EAAA,SAAA,sBAAA,CAAA,aAAA,IAAA,YAAA,CAAA,EAAA,OAAA,QAAA,aAAA,qBAAA,EAWA,IAAiE,YAAA,QAAA,YAAA,EAClC,eAAA,QAAA,YAAA,EA2BxB,MAAM,qBAMH,eAAqE,cAAA,CAM7E,YAA+B,QAA+B,CACtD,QADuB,KAAA,QAAA,OAE/B,CASO,WACL,IACA,UACA,SACA,gBAOA,eACA,kBACA,IAC4B,CACrB,MAAA,CAAC,QAAkB,QAAkB,QAC1C,MAAM,mCAAkC,YAAA,wBACtC,QAAK,UAAL,eAAc,gCACd,EAAA,KAGE,YAAA,kBAAiB,GAAG,GAAK,kCACrB,IAAA,KAAK,wBAAwB,OAAO,GAE5C,MAAM,eAAiB,MAAM,WAC3B,IACA,UACA,SACA,gBACA,eACA,kBACA,GAAA,EAMF,cAAO,QAAQ,KACf,OAAO,QAAQ,IAER,eAAe,MAAO,QAAS,MAAS,CAAA,CAEnD,CAWU,wBAAwB,QAA2B,CACpD,MAAA,CACL,MAAO,QAAQ,IAAI,MACnB,MAAO,QAAQ,IAAI,QACnB,QAAS,QAAQ,IAAI,QACrB,KAAM,QAAQ,IAAI,KAClB,KAAM,QAAQ,IAAI,IAAA,CAEtB,CAGF"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/handlers/azure/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC"}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use strict";var __defProp=Object.defineProperty,__getOwnPropDesc=Object.getOwnPropertyDescriptor,__getOwnPropNames=Object.getOwnPropertyNames,__hasOwnProp=Object.prototype.hasOwnProperty,__copyProps=(to,from,except,desc)=>{if(from&&typeof from=="object"||typeof from=="function")for(let key of __getOwnPropNames(from))!__hasOwnProp.call(to,key)&&key!==except&&__defProp(to,key,{get:()=>from[key],enumerable:!(desc=__getOwnPropDesc(from,key))||desc.enumerable});return to},__reExport=(target,mod,secondTarget)=>(__copyProps(target,mod,"default"),secondTarget&&__copyProps(secondTarget,mod,"default")),__toCommonJS=mod=>__copyProps(__defProp({},"__esModule",{value:!0}),mod),azure_exports={};module.exports=__toCommonJS(azure_exports);__reExport(azure_exports,require("./azure.handler"),module.exports);
|
|
2
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../src/handlers/azure/index.ts"],"sourcesContent":["export * from './azure.handler';\n"],"names":[],"mappings":"kqBAAA,cAAA,CAAA,EAAA,OAAA,QAAA,aAAA,aAAA,EAAA,WAAA,cAAc,QAAd,iBAAA,EAAA,OAAA,OAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/handlers/base/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC"}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use strict";var __defProp=Object.defineProperty,__getOwnPropDesc=Object.getOwnPropertyDescriptor,__getOwnPropNames=Object.getOwnPropertyNames,__hasOwnProp=Object.prototype.hasOwnProperty,__copyProps=(to,from,except,desc)=>{if(from&&typeof from=="object"||typeof from=="function")for(let key of __getOwnPropNames(from))!__hasOwnProp.call(to,key)&&key!==except&&__defProp(to,key,{get:()=>from[key],enumerable:!(desc=__getOwnPropDesc(from,key))||desc.enumerable});return to},__reExport=(target,mod,secondTarget)=>(__copyProps(target,mod,"default"),secondTarget&&__copyProps(secondTarget,mod,"default")),__toCommonJS=mod=>__copyProps(__defProp({},"__esModule",{value:!0}),mod),base_exports={};module.exports=__toCommonJS(base_exports);__reExport(base_exports,require("./raw-request"),module.exports);
|
|
2
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../src/handlers/base/index.ts"],"sourcesContent":["export * from './raw-request';\n"],"names":[],"mappings":"kqBAAA,aAAA,CAAA,EAAA,OAAA,QAAA,aAAA,YAAA,EAAA,WAAA,aAAc,QAAd,eAAA,EAAA,OAAA,OAAA"}
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
|
-
import { IncomingMessage, ServerResponse } from 'http';
|
|
3
|
-
import { FrameworkContract } from '../../contracts/index';
|
|
4
|
-
import { ServerlessRequest } from '../../network/index';
|
|
5
|
-
/**
|
|
6
|
-
* The class that expose some methods to be used to get raw request from Express HTTP Request
|
|
7
|
-
*
|
|
8
|
-
* @breadcrumb Handlers / Base / RawRequest
|
|
9
|
-
* @public
|
|
10
|
-
*/
|
|
11
|
-
export declare abstract class RawRequest<TApp> {
|
|
12
|
-
/**
|
|
13
|
-
* The callback to when receive some request from external source
|
|
14
|
-
*
|
|
15
|
-
* @param app - The instance of the app
|
|
16
|
-
* @param framework - The framework for the app
|
|
17
|
-
*/
|
|
18
|
-
protected onRequestCallback(app: TApp, framework: FrameworkContract<TApp>): (req: IncomingMessage, res: ServerResponse) => void | Promise<void>;
|
|
19
|
-
/**
|
|
20
|
-
* Not sure why they think using Express instance with prebuilt middlewares was a good idea, but Firebase/GCP
|
|
21
|
-
* decides to use `Express` and `body-parser` by default, so you don't get a raw request, instead, you get a modified version by
|
|
22
|
-
* Express and also with the body parsed by `body-parser`.
|
|
23
|
-
* If you use NestJS or Express it's awesome, but for the rest of the frameworks it's terrible!
|
|
24
|
-
* That's why I have this method, just to try and create a raw request to be used and passed to the frameworks so they can handle the request
|
|
25
|
-
* as if they received the request from the native http module.
|
|
26
|
-
*
|
|
27
|
-
* @param request - The Express request
|
|
28
|
-
*/
|
|
29
|
-
protected getRequestFromExpressRequest(request: IncomingMessage): ServerlessRequest;
|
|
30
|
-
}
|
|
31
|
-
//# sourceMappingURL=raw-request.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"raw-request.d.ts","sourceRoot":"","sources":["../../../src/handlers/base/raw-request.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,MAAM,CAAC;AACvD,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAC1D,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAKxD;;;;;GAKG;AACH,8BAAsB,UAAU,CAAC,IAAI;IAGnC;;;;;OAKG;IACH,SAAS,CAAC,iBAAiB,CACzB,GAAG,EAAE,IAAI,EACT,SAAS,EAAE,iBAAiB,CAAC,IAAI,CAAC,GACjC,CAAC,GAAG,EAAE,eAAe,EAAE,GAAG,EAAE,cAAc,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC;IAQtE;;;;;;;;;OASG;IACH,SAAS,CAAC,4BAA4B,CACpC,OAAO,EAAE,eAAe,GACvB,iBAAiB;CAmCrB"}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use strict";var __defProp=Object.defineProperty,__getOwnPropDesc=Object.getOwnPropertyDescriptor,__getOwnPropNames=Object.getOwnPropertyNames,__hasOwnProp=Object.prototype.hasOwnProperty,__export=(target,all)=>{for(var name in all)__defProp(target,name,{get:all[name],enumerable:!0})},__copyProps=(to,from,except,desc)=>{if(from&&typeof from=="object"||typeof from=="function")for(let key of __getOwnPropNames(from))!__hasOwnProp.call(to,key)&&key!==except&&__defProp(to,key,{get:()=>from[key],enumerable:!(desc=__getOwnPropDesc(from,key))||desc.enumerable});return to},__toCommonJS=mod=>__copyProps(__defProp({},"__esModule",{value:!0}),mod),raw_request_exports={};__export(raw_request_exports,{RawRequest:()=>RawRequest});module.exports=__toCommonJS(raw_request_exports);var import_network=require("../../network/index"),import_core=require("../../core/index");class RawRequest{onRequestCallback(app,framework){return(request,response)=>{const customRequest=this.getRequestFromExpressRequest(request);return framework.sendRequest(app,customRequest,response)}}getRequestFromExpressRequest(request){const expressRequestParsed=request,headers=(0,import_core.getFlattenedHeadersMap)(request.headers,",",!0),remoteAddress=headers["x-forwarded-for"];let body;if(expressRequestParsed.body&&typeof expressRequestParsed.body=="object"){const jsonContent=JSON.stringify(expressRequestParsed.body),[bufferBody,contentLength]=(0,import_core.getEventBodyAsBuffer)(jsonContent,!1);body=bufferBody,headers["content-length"]=String(contentLength)}return new import_network.ServerlessRequest({method:request.method,url:request.url,body,headers,remoteAddress})}}
|
|
2
|
-
//# sourceMappingURL=raw-request.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"raw-request.js","sources":["../../../src/handlers/base/raw-request.ts"],"sourcesContent":["//#region Imports\n\nimport { IncomingMessage, ServerResponse } from 'http';\nimport { FrameworkContract } from '../../contracts/index';\nimport { ServerlessRequest } from '../../network/index';\nimport { getEventBodyAsBuffer, getFlattenedHeadersMap } from '../../core/index';\n\n//#endregion\n\n/**\n * The class that expose some methods to be used to get raw request from Express HTTP Request\n *\n * @breadcrumb Handlers / Base / RawRequest\n * @public\n */\nexport abstract class RawRequest<TApp> {\n //#region Protected Methods\n\n /**\n * The callback to when receive some request from external source\n *\n * @param app - The instance of the app\n * @param framework - The framework for the app\n */\n protected onRequestCallback(\n app: TApp,\n framework: FrameworkContract<TApp>,\n ): (req: IncomingMessage, res: ServerResponse) => void | Promise<void> {\n return (request: IncomingMessage, response: ServerResponse) => {\n const customRequest = this.getRequestFromExpressRequest(request);\n\n return framework.sendRequest(app, customRequest, response);\n };\n }\n\n /**\n * Not sure why they think using Express instance with prebuilt middlewares was a good idea, but Firebase/GCP\n * decides to use `Express` and `body-parser` by default, so you don't get a raw request, instead, you get a modified version by\n * Express and also with the body parsed by `body-parser`.\n * If you use NestJS or Express it's awesome, but for the rest of the frameworks it's terrible!\n * That's why I have this method, just to try and create a raw request to be used and passed to the frameworks so they can handle the request\n * as if they received the request from the native http module.\n *\n * @param request - The Express request\n */\n protected getRequestFromExpressRequest(\n request: IncomingMessage,\n ): ServerlessRequest {\n const expressRequestParsed = request as unknown as {\n body: object | Buffer;\n };\n\n const headers = getFlattenedHeadersMap(request.headers, ',', true);\n const remoteAddress = headers['x-forwarded-for'];\n\n let body: Buffer | undefined;\n\n if (\n expressRequestParsed.body &&\n typeof expressRequestParsed.body === 'object'\n ) {\n const jsonContent = JSON.stringify(expressRequestParsed.body);\n\n const [bufferBody, contentLength] = getEventBodyAsBuffer(\n jsonContent,\n false,\n );\n\n body = bufferBody;\n headers['content-length'] = String(contentLength);\n }\n\n return new ServerlessRequest({\n method: request.method!,\n url: request.url!,\n body,\n headers,\n remoteAddress,\n });\n }\n\n //#endregion\n}\n"],"names":[],"mappings":"ooBAAA,oBAAA,CAAA,EAAA,SAAA,oBAAA,CAAA,WAAA,IAAA,UAAA,CAAA,EAAA,OAAA,QAAA,aAAA,mBAAA,EAIA,IAAkC,eAAA,QAAA,qBAAA,EAC2B,YAAA,QAAA,kBAAA,EAUtD,MAAe,UAAiB,CAS3B,kBACR,IACA,UACqE,CAC9D,MAAA,CAAC,QAA0B,WAA6B,CACvD,MAAA,cAAgB,KAAK,6BAA6B,OAAO,EAE/D,OAAO,UAAU,YAAY,IAAK,cAAe,QAAQ,CAAA,CAE7D,CAYU,6BACR,QACmB,CACnB,MAAM,qBAAuB,QAIvB,WAAU,YAAA,wBAAuB,QAAQ,QAAS,IAAK,EAAI,EAC3D,cAAgB,QAAQ,iBAAiB,EAE3C,IAAA,KAEJ,GACE,qBAAqB,MACrB,OAAO,qBAAqB,MAAS,SACrC,CACA,MAAM,YAAc,KAAK,UAAU,qBAAqB,IAAI,EAEtD,CAAC,WAAY,aAAa,KAAI,YAAA,sBAClC,YACA,EAAA,EAGK,KAAA,WACC,QAAA,gBAAgB,EAAI,OAAO,aAAa,CAClD,CAEA,OAAO,IAAI,eAAkB,kBAAA,CAC3B,OAAQ,QAAQ,OAChB,IAAK,QAAQ,IACb,KACA,QACA,aAAA,CACD,CACH,CAGF"}
|
|
@@ -1,88 +0,0 @@
|
|
|
1
|
-
import { BinarySettings, SingleValueHeaders } from '../../@types';
|
|
2
|
-
import { AdapterContract, AdapterRequest, FrameworkContract, ResolverContract, ServerlessHandler } from '../../contracts';
|
|
3
|
-
import { BaseHandler, ILogger } from '../../core';
|
|
4
|
-
import { ServerlessResponse } from '../../network';
|
|
5
|
-
/**
|
|
6
|
-
* The class that implements a default serverless handler consisting of a function with event, context and callback parameters respectively
|
|
7
|
-
*
|
|
8
|
-
* @breadcrumb Handlers / DefaultHandler
|
|
9
|
-
* @public
|
|
10
|
-
*/
|
|
11
|
-
export declare class DefaultHandler<TApp, TEvent, TContext, TCallback, TResponse, TReturn> extends BaseHandler<TApp, TEvent, TContext, TCallback, TResponse, TReturn> {
|
|
12
|
-
/**
|
|
13
|
-
* {@inheritDoc}
|
|
14
|
-
*/
|
|
15
|
-
getHandler(app: TApp, framework: FrameworkContract<TApp>, adapters: AdapterContract<TEvent, TContext, TResponse>[], resolverFactory: ResolverContract<TEvent, TContext, TCallback, TResponse, TReturn>, binarySettings: BinarySettings, respondWithErrors: boolean, log: ILogger): ServerlessHandler<TReturn>;
|
|
16
|
-
/**
|
|
17
|
-
* The hook executed on receive a request, before the request is being processed
|
|
18
|
-
*
|
|
19
|
-
* @param log - The instance of logger
|
|
20
|
-
* @param event - The event sent by serverless
|
|
21
|
-
* @param context - The context sent by serverless
|
|
22
|
-
* @param binarySettings - The binary settings
|
|
23
|
-
* @param respondWithErrors - Indicates whether the error stack should be included in the response or not
|
|
24
|
-
*/
|
|
25
|
-
protected onReceiveRequest(log: ILogger, event: TEvent, context: TContext, binarySettings: BinarySettings, respondWithErrors: boolean): void;
|
|
26
|
-
/**
|
|
27
|
-
* The hook executed after resolve the adapter that will be used to handle the request and response
|
|
28
|
-
*
|
|
29
|
-
* @param log - The instance of logger
|
|
30
|
-
* @param adapter - The adapter resolved
|
|
31
|
-
*/
|
|
32
|
-
protected onResolveAdapter(log: ILogger, adapter: AdapterContract<TEvent, TContext, TResponse>): void;
|
|
33
|
-
/**
|
|
34
|
-
* The hook executed after resolves the request values that will be sent to the framework
|
|
35
|
-
*
|
|
36
|
-
* @param log - The instance of logger
|
|
37
|
-
* @param requestValues - The request values returned by the adapter
|
|
38
|
-
*/
|
|
39
|
-
protected onResolveRequestValues(log: ILogger, requestValues: AdapterRequest): void;
|
|
40
|
-
/**
|
|
41
|
-
* The hook executed after handling the response sent by the framework
|
|
42
|
-
*
|
|
43
|
-
* @param log - The instance of logger
|
|
44
|
-
* @param response - The response sent by the framework
|
|
45
|
-
*/
|
|
46
|
-
protected onResolveForwardedResponseToFramework(log: ILogger, response: ServerlessResponse): void;
|
|
47
|
-
/**
|
|
48
|
-
* The hook executed before sending response to the serverless
|
|
49
|
-
*
|
|
50
|
-
* @param log - The instance of logger
|
|
51
|
-
* @param statusCode - The status code of the response
|
|
52
|
-
* @param body - The body of the response
|
|
53
|
-
* @param headers - The headers of the response
|
|
54
|
-
* @param isBase64Encoded - Indicates whether the response was encoded as binary or not
|
|
55
|
-
*/
|
|
56
|
-
protected onForwardResponse(log: ILogger, statusCode: number, body: string, headers: SingleValueHeaders, isBase64Encoded: boolean): void;
|
|
57
|
-
/**
|
|
58
|
-
* The hook executed before sending response to the serverless with response from adapter
|
|
59
|
-
*
|
|
60
|
-
* @param log - The instance of logger
|
|
61
|
-
* @param successResponse - The success response resolved by the adapter
|
|
62
|
-
* @param body - The body of the response sent by the framework
|
|
63
|
-
*/
|
|
64
|
-
protected onForwardResponseAdapterResponse(log: ILogger, successResponse: TResponse, body: string): void;
|
|
65
|
-
/**
|
|
66
|
-
* The function to forward the event to the framework
|
|
67
|
-
*
|
|
68
|
-
* @param app - The instance of the app (express, hapi, etc...)
|
|
69
|
-
* @param framework - The framework that will process requests
|
|
70
|
-
* @param event - The event sent by serverless
|
|
71
|
-
* @param context - The context sent by serverless
|
|
72
|
-
* @param adapter - The adapter resolved to this event
|
|
73
|
-
* @param log - The instance of logger
|
|
74
|
-
* @param binarySettings - The binary settings
|
|
75
|
-
*/
|
|
76
|
-
protected forwardRequestToFramework(app: TApp, framework: FrameworkContract<TApp>, event: TEvent, context: TContext, adapter: AdapterContract<TEvent, TContext, TResponse>, binarySettings: BinarySettings, log: ILogger): Promise<TResponse>;
|
|
77
|
-
/**
|
|
78
|
-
* The function to forward the response back to the serverless
|
|
79
|
-
*
|
|
80
|
-
* @param event - The event sent by serverless
|
|
81
|
-
* @param response - The response of the framework
|
|
82
|
-
* @param adapter - The adapter resolved to this event
|
|
83
|
-
* @param binarySettings - The binary settings
|
|
84
|
-
* @param log - The instance of logger
|
|
85
|
-
*/
|
|
86
|
-
protected forwardResponse(event: TEvent, response: ServerlessResponse, adapter: AdapterContract<TEvent, TContext, TResponse>, binarySettings: BinarySettings, log: ILogger): TResponse;
|
|
87
|
-
}
|
|
88
|
-
//# sourceMappingURL=default.handler.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"default.handler.d.ts","sourceRoot":"","sources":["../../../src/handlers/default/default.handler.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,cAAc,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAClE,OAAO,EACL,eAAe,EACf,cAAc,EACd,iBAAiB,EACjB,gBAAgB,EAChB,iBAAiB,EAClB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EACL,WAAW,EACX,OAAO,EAIR,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AAInD;;;;;GAKG;AACH,qBAAa,cAAc,CACzB,IAAI,EACJ,MAAM,EACN,QAAQ,EACR,SAAS,EACT,SAAS,EACT,OAAO,CACP,SAAQ,WAAW,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,SAAS,EAAE,SAAS,EAAE,OAAO,CAAC;IAG1E;;OAEG;IACI,UAAU,CACf,GAAG,EAAE,IAAI,EACT,SAAS,EAAE,iBAAiB,CAAC,IAAI,CAAC,EAClC,QAAQ,EAAE,eAAe,CAAC,MAAM,EAAE,QAAQ,EAAE,SAAS,CAAC,EAAE,EACxD,eAAe,EAAE,gBAAgB,CAC/B,MAAM,EACN,QAAQ,EACR,SAAS,EACT,SAAS,EACT,OAAO,CACR,EACD,cAAc,EAAE,cAAc,EAC9B,iBAAiB,EAAE,OAAO,EAC1B,GAAG,EAAE,OAAO,GACX,iBAAiB,CAAC,OAAO,CAAC;IAgD7B;;;;;;;;OAQG;IACH,SAAS,CAAC,gBAAgB,CACxB,GAAG,EAAE,OAAO,EACZ,KAAK,EAAE,MAAM,EACb,OAAO,EAAE,QAAQ,EACjB,cAAc,EAAE,cAAc,EAC9B,iBAAiB,EAAE,OAAO,GACzB,IAAI;IASP;;;;;OAKG;IACH,SAAS,CAAC,gBAAgB,CACxB,GAAG,EAAE,OAAO,EACZ,OAAO,EAAE,eAAe,CAAC,MAAM,EAAE,QAAQ,EAAE,SAAS,CAAC,GACpD,IAAI;IAOP;;;;;OAKG;IACH,SAAS,CAAC,sBAAsB,CAC9B,GAAG,EAAE,OAAO,EACZ,aAAa,EAAE,cAAc,GAC5B,IAAI;IAYP;;;;;OAKG;IACH,SAAS,CAAC,qCAAqC,CAC7C,GAAG,EAAE,OAAO,EACZ,QAAQ,EAAE,kBAAkB,GAC3B,IAAI;IASP;;;;;;;;OAQG;IACH,SAAS,CAAC,iBAAiB,CACzB,GAAG,EAAE,OAAO,EACZ,UAAU,EAAE,MAAM,EAClB,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,kBAAkB,EAC3B,eAAe,EAAE,OAAO;IAa1B;;;;;;OAMG;IACH,SAAS,CAAC,gCAAgC,CACxC,GAAG,EAAE,OAAO,EACZ,eAAe,EAAE,SAAS,EAC1B,IAAI,EAAE,MAAM;IAed;;;;;;;;;;OAUG;cACa,yBAAyB,CACvC,GAAG,EAAE,IAAI,EACT,SAAS,EAAE,iBAAiB,CAAC,IAAI,CAAC,EAClC,KAAK,EAAE,MAAM,EACb,OAAO,EAAE,QAAQ,EACjB,OAAO,EAAE,eAAe,CAAC,MAAM,EAAE,QAAQ,EAAE,SAAS,CAAC,EACrD,cAAc,EAAE,cAAc,EAC9B,GAAG,EAAE,OAAO,GACX,OAAO,CAAC,SAAS,CAAC;IAiBrB;;;;;;;;OAQG;IACH,SAAS,CAAC,eAAe,CACvB,KAAK,EAAE,MAAM,EACb,QAAQ,EAAE,kBAAkB,EAC5B,OAAO,EAAE,eAAe,CAAC,MAAM,EAAE,QAAQ,EAAE,SAAS,CAAC,EACrD,cAAc,EAAE,cAAc,EAC9B,GAAG,EAAE,OAAO,GACX,SAAS;CA0Bb"}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use strict";var __create=Object.create,__defProp=Object.defineProperty,__getOwnPropDesc=Object.getOwnPropertyDescriptor,__getOwnPropNames=Object.getOwnPropertyNames,__getProtoOf=Object.getPrototypeOf,__hasOwnProp=Object.prototype.hasOwnProperty,__export=(target,all)=>{for(var name in all)__defProp(target,name,{get:all[name],enumerable:!0})},__copyProps=(to,from,except,desc)=>{if(from&&typeof from=="object"||typeof from=="function")for(let key of __getOwnPropNames(from))!__hasOwnProp.call(to,key)&&key!==except&&__defProp(to,key,{get:()=>from[key],enumerable:!(desc=__getOwnPropDesc(from,key))||desc.enumerable});return to},__toESM=(mod,isNodeMode,target)=>(target=mod!=null?__create(__getProtoOf(mod)):{},__copyProps(isNodeMode||!mod||!mod.__esModule?__defProp(target,"default",{value:mod,enumerable:!0}):target,mod)),__toCommonJS=mod=>__copyProps(__defProp({},"__esModule",{value:!0}),mod),default_handler_exports={};__export(default_handler_exports,{DefaultHandler:()=>DefaultHandler});module.exports=__toCommonJS(default_handler_exports);var import_util=__toESM(require("util")),import_core=require("../../core"),import_network=require("../../network");class DefaultHandler extends import_core.BaseHandler{getHandler(app,framework,adapters,resolverFactory,binarySettings,respondWithErrors,log){return(event,context,callback)=>{this.onReceiveRequest(log,event,context,binarySettings,respondWithErrors);const adapter=this.getAdapterByEventAndContext(event,context,adapters,log);return this.onResolveAdapter(log,adapter),(0,import_core.setCurrentInvoke)({event,context}),resolverFactory.createResolver({event,context,callback,log,respondWithErrors,adapter}).run(()=>this.forwardRequestToFramework(app,framework,event,context,adapter,binarySettings,log))}}onReceiveRequest(log,event,context,binarySettings,respondWithErrors){log.debug("SERVERLESS_ADAPTER:PROXY",()=>({event:import_util.default.inspect(event,{depth:null}),context:import_util.default.inspect(context,{depth:null}),binarySettings,respondWithErrors}))}onResolveAdapter(log,adapter){log.debug("SERVERLESS_ADAPTER:RESOLVED_ADAPTER_NAME: ",adapter.getAdapterName())}onResolveRequestValues(log,requestValues){log.debug("SERVERLESS_ADAPTER:FORWARD_REQUEST_TO_FRAMEWORK:REQUEST_VALUES",()=>{var _a;return{requestValues:{...requestValues,body:(_a=requestValues.body)==null?void 0:_a.toString()}}})}onResolveForwardedResponseToFramework(log,response){log.debug("SERVERLESS_ADAPTER:FORWARD_REQUEST_TO_FRAMEWORK:RESPONSE",()=>({response}))}onForwardResponse(log,statusCode,body,headers,isBase64Encoded){log.debug("SERVERLESS_ADAPTER:FORWARD_RESPONSE:EVENT_SOURCE_RESPONSE_PARAMS",()=>({statusCode,body,headers,isBase64Encoded}))}onForwardResponseAdapterResponse(log,successResponse,body){log.debug("SERVERLESS_ADAPTER:FORWARD_RESPONSE:EVENT_SOURCE_RESPONSE",()=>({successResponse:import_util.default.inspect(successResponse,{depth:null}),body}))}async forwardRequestToFramework(app,framework,event,context,adapter,binarySettings,log){const requestValues=adapter.getRequest(event,context,log);this.onResolveRequestValues(log,requestValues);const[request,response]=this.getServerlessRequestResponseFromAdapterRequest(requestValues);return framework.sendRequest(app,request,response),await(0,import_core.waitForStreamComplete)(response),this.onResolveForwardedResponseToFramework(log,response),this.forwardResponse(event,response,adapter,binarySettings,log)}forwardResponse(event,response,adapter,binarySettings,log){const statusCode=response.statusCode,headers=import_network.ServerlessResponse.headers(response),isBase64Encoded=(0,import_core.isBinary)(headers,binarySettings),encoding=isBase64Encoded?"base64":"utf8",body=import_network.ServerlessResponse.body(response).toString(encoding),logBody=isBase64Encoded?"[BASE64_ENCODED]":body;this.onForwardResponse(log,statusCode,logBody,headers,isBase64Encoded);const successResponse=adapter.getResponse({event,statusCode,body,headers,isBase64Encoded,response,log});return this.onForwardResponseAdapterResponse(log,successResponse,logBody),successResponse}}
|
|
2
|
-
//# sourceMappingURL=default.handler.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"default.handler.js","sources":["../../../src/handlers/default/default.handler.ts"],"sourcesContent":["//#region Imports\n\nimport util from 'util';\nimport { BinarySettings, SingleValueHeaders } from '../../@types';\nimport {\n AdapterContract,\n AdapterRequest,\n FrameworkContract,\n ResolverContract,\n ServerlessHandler,\n} from '../../contracts';\nimport {\n BaseHandler,\n ILogger,\n isBinary,\n setCurrentInvoke,\n waitForStreamComplete,\n} from '../../core';\nimport { ServerlessResponse } from '../../network';\n\n//#endregion\n\n/**\n * The class that implements a default serverless handler consisting of a function with event, context and callback parameters respectively\n *\n * @breadcrumb Handlers / DefaultHandler\n * @public\n */\nexport class DefaultHandler<\n TApp,\n TEvent,\n TContext,\n TCallback,\n TResponse,\n TReturn,\n> extends BaseHandler<TApp, TEvent, TContext, TCallback, TResponse, TReturn> {\n //#region Public Methods\n\n /**\n * {@inheritDoc}\n */\n public getHandler(\n app: TApp,\n framework: FrameworkContract<TApp>,\n adapters: AdapterContract<TEvent, TContext, TResponse>[],\n resolverFactory: ResolverContract<\n TEvent,\n TContext,\n TCallback,\n TResponse,\n TReturn\n >,\n binarySettings: BinarySettings,\n respondWithErrors: boolean,\n log: ILogger,\n ): ServerlessHandler<TReturn> {\n return (event: TEvent, context: TContext, callback?: TCallback) => {\n this.onReceiveRequest(\n log,\n event,\n context,\n binarySettings,\n respondWithErrors,\n );\n\n const adapter = this.getAdapterByEventAndContext(\n event,\n context,\n adapters,\n log,\n );\n\n this.onResolveAdapter(log, adapter);\n\n setCurrentInvoke({ event, context });\n\n const resolver = resolverFactory.createResolver({\n event,\n context,\n callback,\n log,\n respondWithErrors,\n adapter,\n });\n\n return resolver.run(() =>\n this.forwardRequestToFramework(\n app,\n framework,\n event,\n context,\n adapter,\n binarySettings,\n log,\n ),\n );\n };\n }\n\n //#endregion\n\n //#region Hooks\n\n /**\n * The hook executed on receive a request, before the request is being processed\n *\n * @param log - The instance of logger\n * @param event - The event sent by serverless\n * @param context - The context sent by serverless\n * @param binarySettings - The binary settings\n * @param respondWithErrors - Indicates whether the error stack should be included in the response or not\n */\n protected onReceiveRequest(\n log: ILogger,\n event: TEvent,\n context: TContext,\n binarySettings: BinarySettings,\n respondWithErrors: boolean,\n ): void {\n log.debug('SERVERLESS_ADAPTER:PROXY', () => ({\n event: util.inspect(event, { depth: null }),\n context: util.inspect(context, { depth: null }),\n binarySettings,\n respondWithErrors,\n }));\n }\n\n /**\n * The hook executed after resolve the adapter that will be used to handle the request and response\n *\n * @param log - The instance of logger\n * @param adapter - The adapter resolved\n */\n protected onResolveAdapter(\n log: ILogger,\n adapter: AdapterContract<TEvent, TContext, TResponse>,\n ): void {\n log.debug(\n 'SERVERLESS_ADAPTER:RESOLVED_ADAPTER_NAME: ',\n adapter.getAdapterName(),\n );\n }\n\n /**\n * The hook executed after resolves the request values that will be sent to the framework\n *\n * @param log - The instance of logger\n * @param requestValues - The request values returned by the adapter\n */\n protected onResolveRequestValues(\n log: ILogger,\n requestValues: AdapterRequest,\n ): void {\n log.debug(\n 'SERVERLESS_ADAPTER:FORWARD_REQUEST_TO_FRAMEWORK:REQUEST_VALUES',\n () => ({\n requestValues: {\n ...requestValues,\n body: requestValues.body?.toString(),\n },\n }),\n );\n }\n\n /**\n * The hook executed after handling the response sent by the framework\n *\n * @param log - The instance of logger\n * @param response - The response sent by the framework\n */\n protected onResolveForwardedResponseToFramework(\n log: ILogger,\n response: ServerlessResponse,\n ): void {\n log.debug(\n 'SERVERLESS_ADAPTER:FORWARD_REQUEST_TO_FRAMEWORK:RESPONSE',\n () => ({\n response,\n }),\n );\n }\n\n /**\n * The hook executed before sending response to the serverless\n *\n * @param log - The instance of logger\n * @param statusCode - The status code of the response\n * @param body - The body of the response\n * @param headers - The headers of the response\n * @param isBase64Encoded - Indicates whether the response was encoded as binary or not\n */\n protected onForwardResponse(\n log: ILogger,\n statusCode: number,\n body: string,\n headers: SingleValueHeaders,\n isBase64Encoded: boolean,\n ) {\n log.debug(\n 'SERVERLESS_ADAPTER:FORWARD_RESPONSE:EVENT_SOURCE_RESPONSE_PARAMS',\n () => ({\n statusCode,\n body,\n headers,\n isBase64Encoded,\n }),\n );\n }\n\n /**\n * The hook executed before sending response to the serverless with response from adapter\n *\n * @param log - The instance of logger\n * @param successResponse - The success response resolved by the adapter\n * @param body - The body of the response sent by the framework\n */\n protected onForwardResponseAdapterResponse(\n log: ILogger,\n successResponse: TResponse,\n body: string,\n ) {\n log.debug(\n 'SERVERLESS_ADAPTER:FORWARD_RESPONSE:EVENT_SOURCE_RESPONSE',\n () => ({\n successResponse: util.inspect(successResponse, { depth: null }),\n body,\n }),\n );\n }\n\n //#endregion\n\n //#region Protected Methods\n\n /**\n * The function to forward the event to the framework\n *\n * @param app - The instance of the app (express, hapi, etc...)\n * @param framework - The framework that will process requests\n * @param event - The event sent by serverless\n * @param context - The context sent by serverless\n * @param adapter - The adapter resolved to this event\n * @param log - The instance of logger\n * @param binarySettings - The binary settings\n */\n protected async forwardRequestToFramework(\n app: TApp,\n framework: FrameworkContract<TApp>,\n event: TEvent,\n context: TContext,\n adapter: AdapterContract<TEvent, TContext, TResponse>,\n binarySettings: BinarySettings,\n log: ILogger,\n ): Promise<TResponse> {\n const requestValues = adapter.getRequest(event, context, log);\n\n this.onResolveRequestValues(log, requestValues);\n\n const [request, response] =\n this.getServerlessRequestResponseFromAdapterRequest(requestValues);\n\n framework.sendRequest(app, request, response);\n\n await waitForStreamComplete(response);\n\n this.onResolveForwardedResponseToFramework(log, response);\n\n return this.forwardResponse(event, response, adapter, binarySettings, log);\n }\n\n /**\n * The function to forward the response back to the serverless\n *\n * @param event - The event sent by serverless\n * @param response - The response of the framework\n * @param adapter - The adapter resolved to this event\n * @param binarySettings - The binary settings\n * @param log - The instance of logger\n */\n protected forwardResponse(\n event: TEvent,\n response: ServerlessResponse,\n adapter: AdapterContract<TEvent, TContext, TResponse>,\n binarySettings: BinarySettings,\n log: ILogger,\n ): TResponse {\n const statusCode = response.statusCode;\n const headers = ServerlessResponse.headers(response);\n const isBase64Encoded = isBinary(headers, binarySettings);\n const encoding = isBase64Encoded ? 'base64' : 'utf8';\n const body = ServerlessResponse.body(response).toString(encoding);\n const logBody = isBase64Encoded ? '[BASE64_ENCODED]' : body;\n\n this.onForwardResponse(log, statusCode, logBody, headers, isBase64Encoded);\n\n const successResponse = adapter.getResponse({\n event,\n statusCode,\n body,\n headers,\n isBase64Encoded,\n response,\n log,\n });\n\n this.onForwardResponseAdapterResponse(log, successResponse, logBody);\n\n return successResponse;\n }\n\n //#endregion\n}\n"],"names":["util"],"mappings":"i4BAAA,wBAAA,CAAA,EAAA,SAAA,wBAAA,CAAA,eAAA,IAAA,cAAA,CAAA,EAAA,OAAA,QAAA,aAAA,uBAAA,EAEA,IAAiB,YAAA,QAAA,QAAA,MAAA,CAAA,EAeV,YAAA,QAAA,YAAA,EAC4B,eAAA,QAAA,eAAA,EAU5B,MAAM,uBAOH,YAAmE,WAAA,CAMpE,WACL,IACA,UACA,SACA,gBAOA,eACA,kBACA,IAC4B,CACrB,MAAA,CAAC,MAAe,QAAmB,WAAyB,CAC5D,KAAA,iBACH,IACA,MACA,QACA,eACA,iBAAA,EAGF,MAAM,QAAU,KAAK,4BACnB,MACA,QACA,SACA,GAAA,EAGG,YAAA,iBAAiB,IAAK,OAAO,KAEjB,YAAA,kBAAA,CAAE,MAAO,OAAS,CAAA,EAElB,gBAAgB,eAAe,CAC9C,MACA,QACA,SACA,IACA,kBACA,OAAA,CACD,EAEe,IAAI,IAClB,KAAK,0BACH,IACA,UACA,MACA,QACA,QACA,eACA,GACF,CAAA,CACF,CAEJ,CAeU,iBACR,IACA,MACA,QACA,eACA,kBACM,CACF,IAAA,MAAM,2BAA4B,KAAO,CAC3C,MAAO,YAAAA,QAAK,QAAQ,MAAO,CAAE,MAAO,KAAM,EAC1C,QAAS,YAAAA,QAAK,QAAQ,QAAS,CAAE,MAAO,KAAM,EAC9C,eACA,iBACA,EAAA,CACJ,CAQU,iBACR,IACA,QACM,CACF,IAAA,MACF,6CACA,QAAQ,eAAe,CAAA,CAE3B,CAQU,uBACR,IACA,cACM,CACF,IAAA,MACF,iEACA,IAAO,QAAA,OACL,cAAe,CACb,GAAG,cACH,MAAM,iBAAc,OAAd,eAAoB,UAC5B,CAAA,EACF,CAEJ,CAQU,sCACR,IACA,SACM,CACF,IAAA,MACF,2DACA,KAAO,CACL,QAAA,EACF,CAEJ,CAWU,kBACR,IACA,WACA,KACA,QACA,gBACA,CACI,IAAA,MACF,mEACA,KAAO,CACL,WACA,KACA,QACA,eAAA,EACF,CAEJ,CASU,iCACR,IACA,gBACA,KACA,CACI,IAAA,MACF,4DACA,KAAO,CACL,gBAAiB,YAAAA,QAAK,QAAQ,gBAAiB,CAAE,MAAO,KAAM,EAC9D,IAAA,EACF,CAEJ,CAiBA,MAAgB,0BACd,IACA,UACA,MACA,QACA,QACA,eACA,IACoB,CACpB,MAAM,cAAgB,QAAQ,WAAW,MAAO,QAAS,GAAG,EAEvD,KAAA,uBAAuB,IAAK,aAAa,EAE9C,KAAM,CAAC,QAAS,QAAQ,EACtB,KAAK,+CAA+C,aAAa,EAEzD,iBAAA,YAAY,IAAK,QAAS,QAAQ,EAE5C,QAAM,mCAAsB,QAAQ,EAE/B,KAAA,sCAAsC,IAAK,QAAQ,EAEjD,KAAK,gBAAgB,MAAO,SAAU,QAAS,eAAgB,GAAG,CAC3E,CAWU,gBACR,MACA,SACA,QACA,eACA,IACW,CACX,MAAM,WAAa,SAAS,WACtB,QAAU,eAAmB,mBAAA,QAAQ,QAAQ,EAC7C,mBAAkB,YAAS,UAAA,QAAS,cAAc,EAClD,SAAW,gBAAkB,SAAW,OACxC,KAAO,eAAmB,mBAAA,KAAK,QAAQ,EAAE,SAAS,QAAQ,EAC1D,QAAU,gBAAkB,mBAAqB,KAEvD,KAAK,kBAAkB,IAAK,WAAY,QAAS,QAAS,eAAe,EAEnE,MAAA,gBAAkB,QAAQ,YAAY,CAC1C,MACA,WACA,KACA,QACA,gBACA,SACA,GAAA,CACD,EAEI,YAAA,iCAAiC,IAAK,gBAAiB,OAAO,EAE5D,eACT,CAGF"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/handlers/default/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC"}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use strict";var __defProp=Object.defineProperty,__getOwnPropDesc=Object.getOwnPropertyDescriptor,__getOwnPropNames=Object.getOwnPropertyNames,__hasOwnProp=Object.prototype.hasOwnProperty,__copyProps=(to,from,except,desc)=>{if(from&&typeof from=="object"||typeof from=="function")for(let key of __getOwnPropNames(from))!__hasOwnProp.call(to,key)&&key!==except&&__defProp(to,key,{get:()=>from[key],enumerable:!(desc=__getOwnPropDesc(from,key))||desc.enumerable});return to},__reExport=(target,mod,secondTarget)=>(__copyProps(target,mod,"default"),secondTarget&&__copyProps(secondTarget,mod,"default")),__toCommonJS=mod=>__copyProps(__defProp({},"__esModule",{value:!0}),mod),default_exports={};module.exports=__toCommonJS(default_exports);__reExport(default_exports,require("./default.handler"),module.exports);
|
|
2
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../src/handlers/default/index.ts"],"sourcesContent":["export * from './default.handler';\n"],"names":[],"mappings":"kqBAAA,gBAAA,CAAA,EAAA,OAAA,QAAA,aAAA,eAAA,EAAA,WAAA,gBAAc,QAAd,mBAAA,EAAA,OAAA,OAAA"}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { BinarySettings } from '../../@types';
|
|
2
|
-
import { AdapterContract, FrameworkContract, ResolverContract, ServerlessHandler } from '../../contracts';
|
|
3
|
-
import { ILogger } from '../../core';
|
|
4
|
-
import { DefaultHandler } from '../default';
|
|
5
|
-
/**
|
|
6
|
-
* The class that implements a serverless handler for Digital Ocean Functions.
|
|
7
|
-
*
|
|
8
|
-
* @breadcrumb Handlers / DigitalOceanHandler
|
|
9
|
-
* @public
|
|
10
|
-
*/
|
|
11
|
-
export declare class DigitalOceanHandler<TApp, TEvent, TResponse, TReturn> extends DefaultHandler<TApp, TEvent, void, void, TResponse, TReturn> {
|
|
12
|
-
/**
|
|
13
|
-
* {@inheritDoc}
|
|
14
|
-
*/
|
|
15
|
-
getHandler(app: TApp, framework: FrameworkContract<TApp>, adapters: AdapterContract<TEvent, void, TResponse>[], resolverFactory: ResolverContract<TEvent, void, void, TResponse, TReturn>, binarySettings: BinarySettings, respondWithErrors: boolean, log: ILogger): ServerlessHandler<TReturn>;
|
|
16
|
-
}
|
|
17
|
-
//# sourceMappingURL=digital-ocean.handler.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"digital-ocean.handler.d.ts","sourceRoot":"","sources":["../../../src/handlers/digital-ocean/digital-ocean.handler.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAE9C,OAAO,EACL,eAAe,EACf,iBAAiB,EACjB,gBAAgB,EAChB,iBAAiB,EAClB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AACrC,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAI5C;;;;;GAKG;AACH,qBAAa,mBAAmB,CAC9B,IAAI,EACJ,MAAM,EACN,SAAS,EACT,OAAO,CACP,SAAQ,cAAc,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,SAAS,EAAE,OAAO,CAAC;IACpE;;OAEG;IACI,UAAU,CACf,GAAG,EAAE,IAAI,EACT,SAAS,EAAE,iBAAiB,CAAC,IAAI,CAAC,EAClC,QAAQ,EAAE,eAAe,CAAC,MAAM,EAAE,IAAI,EAAE,SAAS,CAAC,EAAE,EACpD,eAAe,EAAE,gBAAgB,CAAC,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,SAAS,EAAE,OAAO,CAAC,EACzE,cAAc,EAAE,cAAc,EAC9B,iBAAiB,EAAE,OAAO,EAC1B,GAAG,EAAE,OAAO,GACX,iBAAiB,CAAC,OAAO,CAAC;CAc9B"}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use strict";var __defProp=Object.defineProperty,__getOwnPropDesc=Object.getOwnPropertyDescriptor,__getOwnPropNames=Object.getOwnPropertyNames,__hasOwnProp=Object.prototype.hasOwnProperty,__export=(target,all)=>{for(var name in all)__defProp(target,name,{get:all[name],enumerable:!0})},__copyProps=(to,from,except,desc)=>{if(from&&typeof from=="object"||typeof from=="function")for(let key of __getOwnPropNames(from))!__hasOwnProp.call(to,key)&&key!==except&&__defProp(to,key,{get:()=>from[key],enumerable:!(desc=__getOwnPropDesc(from,key))||desc.enumerable});return to},__toCommonJS=mod=>__copyProps(__defProp({},"__esModule",{value:!0}),mod),digital_ocean_handler_exports={};__export(digital_ocean_handler_exports,{DigitalOceanHandler:()=>DigitalOceanHandler});module.exports=__toCommonJS(digital_ocean_handler_exports);var import_default=require("../default");class DigitalOceanHandler extends import_default.DefaultHandler{getHandler(app,framework,adapters,resolverFactory,binarySettings,respondWithErrors,log){const defaultHandler=super.getHandler(app,framework,adapters,resolverFactory,binarySettings,respondWithErrors,log);return event=>defaultHandler(event,void 0,void 0)}}
|
|
2
|
-
//# sourceMappingURL=digital-ocean.handler.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"digital-ocean.handler.js","sources":["../../../src/handlers/digital-ocean/digital-ocean.handler.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/unbound-method */\n//#region Imports\n\nimport { BinarySettings } from '../../@types';\nimport { DigitalOceanHttpEvent } from '../../@types/digital-ocean';\nimport {\n AdapterContract,\n FrameworkContract,\n ResolverContract,\n ServerlessHandler,\n} from '../../contracts';\nimport { ILogger } from '../../core';\nimport { DefaultHandler } from '../default';\n\n//#endregion\n\n/**\n * The class that implements a serverless handler for Digital Ocean Functions.\n *\n * @breadcrumb Handlers / DigitalOceanHandler\n * @public\n */\nexport class DigitalOceanHandler<\n TApp,\n TEvent,\n TResponse,\n TReturn,\n> extends DefaultHandler<TApp, TEvent, void, void, TResponse, TReturn> {\n /**\n * {@inheritDoc}\n */\n public getHandler(\n app: TApp,\n framework: FrameworkContract<TApp>,\n adapters: AdapterContract<TEvent, void, TResponse>[],\n resolverFactory: ResolverContract<TEvent, void, void, TResponse, TReturn>,\n binarySettings: BinarySettings,\n respondWithErrors: boolean,\n log: ILogger,\n ): ServerlessHandler<TReturn> {\n const defaultHandler = super.getHandler(\n app,\n framework,\n adapters,\n resolverFactory,\n binarySettings,\n respondWithErrors,\n log,\n );\n\n return (event: DigitalOceanHttpEvent) =>\n defaultHandler(event, undefined, undefined);\n }\n}\n"],"names":[],"mappings":"ooBAAA,8BAAA,CAAA,EAAA,SAAA,8BAAA,CAAA,oBAAA,IAAA,mBAAA,CAAA,EAAA,OAAA,QAAA,aAAA,6BAAA,EAYA,IAA+B,eAAA,QAAA,YAAA,EAUxB,MAAM,4BAKH,eAA6D,cAAA,CAI9D,WACL,IACA,UACA,SACA,gBACA,eACA,kBACA,IAC4B,CAC5B,MAAM,eAAiB,MAAM,WAC3B,IACA,UACA,SACA,gBACA,eACA,kBACA,GAAA,EAGF,OAAQ,OACN,eAAe,MAAO,OAAW,MAAS,CAC9C,CACF"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/handlers/digital-ocean/index.ts"],"names":[],"mappings":"AAAA,cAAc,yBAAyB,CAAC"}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use strict";var __defProp=Object.defineProperty,__getOwnPropDesc=Object.getOwnPropertyDescriptor,__getOwnPropNames=Object.getOwnPropertyNames,__hasOwnProp=Object.prototype.hasOwnProperty,__copyProps=(to,from,except,desc)=>{if(from&&typeof from=="object"||typeof from=="function")for(let key of __getOwnPropNames(from))!__hasOwnProp.call(to,key)&&key!==except&&__defProp(to,key,{get:()=>from[key],enumerable:!(desc=__getOwnPropDesc(from,key))||desc.enumerable});return to},__reExport=(target,mod,secondTarget)=>(__copyProps(target,mod,"default"),secondTarget&&__copyProps(secondTarget,mod,"default")),__toCommonJS=mod=>__copyProps(__defProp({},"__esModule",{value:!0}),mod),digital_ocean_exports={};module.exports=__toCommonJS(digital_ocean_exports);__reExport(digital_ocean_exports,require("./digital-ocean.handler"),module.exports);
|
|
2
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../src/handlers/digital-ocean/index.ts"],"sourcesContent":["export * from './digital-ocean.handler';\n"],"names":[],"mappings":"kqBAAA,sBAAA,CAAA,EAAA,OAAA,QAAA,aAAA,qBAAA,EAAA,WAAA,sBAAc,QAAd,yBAAA,EAAA,OAAA,OAAA"}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { https } from 'firebase-functions/v2';
|
|
2
|
-
import { FrameworkContract, HandlerContract } from '../../contracts';
|
|
3
|
-
import { RawRequest } from '../base';
|
|
4
|
-
/**
|
|
5
|
-
* The class that implements a handler for Firebase Https Events
|
|
6
|
-
*
|
|
7
|
-
* @remarks Read more about Https Events {@link https://firebase.google.com/docs/functions/http-events | here}
|
|
8
|
-
*
|
|
9
|
-
* @breadcrumb Handlers / HttpFirebaseHandler
|
|
10
|
-
* @public
|
|
11
|
-
*/
|
|
12
|
-
export declare class HttpFirebaseV2Handler<TApp> extends RawRequest<TApp> implements HandlerContract<TApp, never, never, never, void, void | Promise<void>> {
|
|
13
|
-
protected readonly options?: https.HttpsOptions | undefined;
|
|
14
|
-
/**
|
|
15
|
-
* Construtor padrão
|
|
16
|
-
*/
|
|
17
|
-
constructor(options?: https.HttpsOptions | undefined);
|
|
18
|
-
/**
|
|
19
|
-
* {@inheritDoc}
|
|
20
|
-
*/
|
|
21
|
-
getHandler(app: TApp, framework: FrameworkContract<TApp>): ReturnType<HttpFirebaseV2Handler<TApp>['onRequestCallback']>;
|
|
22
|
-
/**
|
|
23
|
-
* Wrapper method around onRequest for better testability
|
|
24
|
-
*/
|
|
25
|
-
protected onRequestWithOptions(options: https.HttpsOptions, callback: ReturnType<HttpFirebaseV2Handler<TApp>['onRequestCallback']>): ReturnType<HttpFirebaseV2Handler<TApp>['onRequestCallback']>;
|
|
26
|
-
}
|
|
27
|
-
//# sourceMappingURL=http-firebase-v2.handler.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"http-firebase-v2.handler.d.ts","sourceRoot":"","sources":["../../../src/handlers/firebase/http-firebase-v2.handler.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAC9C,OAAO,EAAE,iBAAiB,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AACrE,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAIrC;;;;;;;GAOG;AACH,qBAAa,qBAAqB,CAAC,IAAI,CACrC,SAAQ,UAAU,CAAC,IAAI,CACvB,YACE,eAAe,CAAC,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAO5D,SAAS,CAAC,QAAQ,CAAC,OAAO,CAAC;IAHvC;;OAEG;gBAC4B,OAAO,CAAC,gCAAoB;IAQ3D;;OAEG;IACI,UAAU,CACf,GAAG,EAAE,IAAI,EACT,SAAS,EAAE,iBAAiB,CAAC,IAAI,CAAC,GACjC,UAAU,CAAC,qBAAqB,CAAC,IAAI,CAAC,CAAC,mBAAmB,CAAC,CAAC;IAe/D;;OAEG;IACH,SAAS,CAAC,oBAAoB,CAC5B,OAAO,EAAE,KAAK,CAAC,YAAY,EAC3B,QAAQ,EAAE,UAAU,CAAC,qBAAqB,CAAC,IAAI,CAAC,CAAC,mBAAmB,CAAC,CAAC,GACrE,UAAU,CAAC,qBAAqB,CAAC,IAAI,CAAC,CAAC,mBAAmB,CAAC,CAAC;CAKhE"}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use strict";var __defProp=Object.defineProperty,__getOwnPropDesc=Object.getOwnPropertyDescriptor,__getOwnPropNames=Object.getOwnPropertyNames,__hasOwnProp=Object.prototype.hasOwnProperty,__export=(target,all)=>{for(var name in all)__defProp(target,name,{get:all[name],enumerable:!0})},__copyProps=(to,from,except,desc)=>{if(from&&typeof from=="object"||typeof from=="function")for(let key of __getOwnPropNames(from))!__hasOwnProp.call(to,key)&&key!==except&&__defProp(to,key,{get:()=>from[key],enumerable:!(desc=__getOwnPropDesc(from,key))||desc.enumerable});return to},__toCommonJS=mod=>__copyProps(__defProp({},"__esModule",{value:!0}),mod),http_firebase_v2_handler_exports={};__export(http_firebase_v2_handler_exports,{HttpFirebaseV2Handler:()=>HttpFirebaseV2Handler});module.exports=__toCommonJS(http_firebase_v2_handler_exports);var import_v2=require("firebase-functions/v2"),import_base=require("../base");class HttpFirebaseV2Handler extends import_base.RawRequest{constructor(options){super(),this.options=options}getHandler(app,framework){return this.options?this.onRequestWithOptions(this.options,this.onRequestCallback(app,framework)):import_v2.https.onRequest(this.onRequestCallback(app,framework))}onRequestWithOptions(options,callback){return import_v2.https.onRequest(options,callback)}}
|
|
2
|
-
//# sourceMappingURL=http-firebase-v2.handler.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"http-firebase-v2.handler.js","sources":["../../../src/handlers/firebase/http-firebase-v2.handler.ts"],"sourcesContent":["//#region Imports\n\n// eslint-disable-next-line import/no-unresolved\nimport { https } from 'firebase-functions/v2';\nimport { FrameworkContract, HandlerContract } from '../../contracts';\nimport { RawRequest } from '../base';\n\n//#endregion\n\n/**\n * The class that implements a handler for Firebase Https Events\n *\n * @remarks Read more about Https Events {@link https://firebase.google.com/docs/functions/http-events | here}\n *\n * @breadcrumb Handlers / HttpFirebaseHandler\n * @public\n */\nexport class HttpFirebaseV2Handler<TApp>\n extends RawRequest<TApp>\n implements\n HandlerContract<TApp, never, never, never, void, void | Promise<void>>\n{\n //#region Constructor\n\n /**\n * Construtor padrão\n */\n constructor(protected readonly options?: https.HttpsOptions) {\n super();\n }\n\n //#endregion\n\n //#region Public Methods\n\n /**\n * {@inheritDoc}\n */\n public getHandler(\n app: TApp,\n framework: FrameworkContract<TApp>,\n ): ReturnType<HttpFirebaseV2Handler<TApp>['onRequestCallback']> {\n if (this.options) {\n return this.onRequestWithOptions(\n this.options,\n this.onRequestCallback(app, framework),\n );\n }\n\n return https.onRequest(this.onRequestCallback(app, framework));\n }\n\n //#endregion\n\n //#region Protected Method\n\n /**\n * Wrapper method around onRequest for better testability\n */\n protected onRequestWithOptions(\n options: https.HttpsOptions,\n callback: ReturnType<HttpFirebaseV2Handler<TApp>['onRequestCallback']>,\n ): ReturnType<HttpFirebaseV2Handler<TApp>['onRequestCallback']> {\n return https.onRequest(options, callback);\n }\n\n //#endregion\n}\n"],"names":[],"mappings":"ooBAAA,iCAAA,CAAA,EAAA,SAAA,iCAAA,CAAA,sBAAA,IAAA,qBAAA,CAAA,EAAA,OAAA,QAAA,aAAA,gCAAA,EAGA,IAAsB,UAAA,QAAA,uBAAA,EAEK,YAAA,QAAA,SAAA,EAYpB,MAAM,8BACH,YAGV,UAAA,CAME,YAA+B,QAA8B,CACrD,QADuB,KAAA,QAAA,OAE/B,CASO,WACL,IACA,UAC8D,CAC9D,OAAI,KAAK,QACA,KAAK,qBACV,KAAK,QACL,KAAK,kBAAkB,IAAK,SAAS,CAAA,EAIlC,gBAAM,UAAU,KAAK,kBAAkB,IAAK,SAAS,CAAC,CAC/D,CASU,qBACR,QACA,SAC8D,CACvD,OAAA,UAAA,MAAM,UAAU,QAAS,QAAQ,CAC1C,CAGF"}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
|
-
import { IncomingMessage, ServerResponse } from 'http';
|
|
3
|
-
import { FrameworkContract, HandlerContract } from '../../contracts';
|
|
4
|
-
import { RawRequest } from '../base';
|
|
5
|
-
/**
|
|
6
|
-
* The class that implements a handler for Firebase Https Events
|
|
7
|
-
*
|
|
8
|
-
* @remarks Read more about Https Events {@link https://firebase.google.com/docs/functions/http-events | here}
|
|
9
|
-
*
|
|
10
|
-
* @breadcrumb Handlers / HttpFirebaseHandler
|
|
11
|
-
* @public
|
|
12
|
-
*/
|
|
13
|
-
export declare class HttpFirebaseHandler<TApp> extends RawRequest<TApp> implements HandlerContract<TApp, never, never, never, void, void | Promise<void>> {
|
|
14
|
-
/**
|
|
15
|
-
* {@inheritDoc}
|
|
16
|
-
*/
|
|
17
|
-
getHandler(app: TApp, framework: FrameworkContract<TApp>): (req: IncomingMessage, res: ServerResponse) => void | Promise<void>;
|
|
18
|
-
}
|
|
19
|
-
//# sourceMappingURL=http-firebase.handler.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"http-firebase.handler.d.ts","sourceRoot":"","sources":["../../../src/handlers/firebase/http-firebase.handler.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,MAAM,CAAC;AAGvD,OAAO,EAAE,iBAAiB,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AACrE,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAGrC;;;;;;;GAOG;AACH,qBAAa,mBAAmB,CAAC,IAAI,CACnC,SAAQ,UAAU,CAAC,IAAI,CACvB,YACE,eAAe,CAAC,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAIxE;;OAEG;IACI,UAAU,CACf,GAAG,EAAE,IAAI,EACT,SAAS,EAAE,iBAAiB,CAAC,IAAI,CAAC,GACjC,CAAC,GAAG,EAAE,eAAe,EAAE,GAAG,EAAE,cAAc,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC;CAKvE"}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use strict";var __defProp=Object.defineProperty,__getOwnPropDesc=Object.getOwnPropertyDescriptor,__getOwnPropNames=Object.getOwnPropertyNames,__hasOwnProp=Object.prototype.hasOwnProperty,__export=(target,all)=>{for(var name in all)__defProp(target,name,{get:all[name],enumerable:!0})},__copyProps=(to,from,except,desc)=>{if(from&&typeof from=="object"||typeof from=="function")for(let key of __getOwnPropNames(from))!__hasOwnProp.call(to,key)&&key!==except&&__defProp(to,key,{get:()=>from[key],enumerable:!(desc=__getOwnPropDesc(from,key))||desc.enumerable});return to},__toCommonJS=mod=>__copyProps(__defProp({},"__esModule",{value:!0}),mod),http_firebase_handler_exports={};__export(http_firebase_handler_exports,{HttpFirebaseHandler:()=>HttpFirebaseHandler});module.exports=__toCommonJS(http_firebase_handler_exports);var import_v1=require("firebase-functions/v1"),import_base=require("../base");class HttpFirebaseHandler extends import_base.RawRequest{getHandler(app,framework){return import_v1.https.onRequest(this.onRequestCallback(app,framework))}}
|
|
2
|
-
//# sourceMappingURL=http-firebase.handler.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"http-firebase.handler.js","sources":["../../../src/handlers/firebase/http-firebase.handler.ts"],"sourcesContent":["//#region Imports\n\nimport { IncomingMessage, ServerResponse } from 'http';\n// eslint-disable-next-line import/no-unresolved\nimport { https } from 'firebase-functions/v1';\nimport { FrameworkContract, HandlerContract } from '../../contracts';\nimport { RawRequest } from '../base';\n\n//#endregion\n/**\n * The class that implements a handler for Firebase Https Events\n *\n * @remarks Read more about Https Events {@link https://firebase.google.com/docs/functions/http-events | here}\n *\n * @breadcrumb Handlers / HttpFirebaseHandler\n * @public\n */\nexport class HttpFirebaseHandler<TApp>\n extends RawRequest<TApp>\n implements\n HandlerContract<TApp, never, never, never, void, void | Promise<void>>\n{\n //#region Public Methods\n\n /**\n * {@inheritDoc}\n */\n public getHandler(\n app: TApp,\n framework: FrameworkContract<TApp>,\n ): (req: IncomingMessage, res: ServerResponse) => void | Promise<void> {\n return https.onRequest(this.onRequestCallback(app, framework));\n }\n\n //#endregion\n}\n"],"names":[],"mappings":"ooBAAA,8BAAA,CAAA,EAAA,SAAA,8BAAA,CAAA,oBAAA,IAAA,mBAAA,CAAA,EAAA,OAAA,QAAA,aAAA,6BAAA,EAIA,IAAsB,UAAA,QAAA,uBAAA,EAEK,YAAA,QAAA,SAAA,EAWpB,MAAM,4BACH,YAGV,UAAA,CAMS,WACL,IACA,UACqE,CACrE,OAAO,gBAAM,UAAU,KAAK,kBAAkB,IAAK,SAAS,CAAC,CAC/D,CAGF"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/handlers/firebase/index.ts"],"names":[],"mappings":"AAAA,cAAc,yBAAyB,CAAC;AACxC,cAAc,4BAA4B,CAAC"}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use strict";var __defProp=Object.defineProperty,__getOwnPropDesc=Object.getOwnPropertyDescriptor,__getOwnPropNames=Object.getOwnPropertyNames,__hasOwnProp=Object.prototype.hasOwnProperty,__copyProps=(to,from,except,desc)=>{if(from&&typeof from=="object"||typeof from=="function")for(let key of __getOwnPropNames(from))!__hasOwnProp.call(to,key)&&key!==except&&__defProp(to,key,{get:()=>from[key],enumerable:!(desc=__getOwnPropDesc(from,key))||desc.enumerable});return to},__reExport=(target,mod,secondTarget)=>(__copyProps(target,mod,"default"),secondTarget&&__copyProps(secondTarget,mod,"default")),__toCommonJS=mod=>__copyProps(__defProp({},"__esModule",{value:!0}),mod),firebase_exports={};module.exports=__toCommonJS(firebase_exports);__reExport(firebase_exports,require("./http-firebase.handler"),module.exports);__reExport(firebase_exports,require("./http-firebase-v2.handler"),module.exports);
|
|
2
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../src/handlers/firebase/index.ts"],"sourcesContent":["export * from './http-firebase.handler';\nexport * from './http-firebase-v2.handler';\n"],"names":[],"mappings":"kqBAAA,iBAAA,CAAA,EAAA,OAAA,QAAA,aAAA,gBAAA,EAAA,WAAA,iBAAc,QAAd,yBAAA,EAAA,OAAA,OAAA,EACA,WAAA,iBAAc,QADd,4BAAA,EAAA,OAAA,OAAA"}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
|
-
import { IncomingMessage, ServerResponse } from 'http';
|
|
3
|
-
import { FrameworkContract, HandlerContract } from '../../contracts';
|
|
4
|
-
import { RawRequest } from '../base';
|
|
5
|
-
/**
|
|
6
|
-
* The class that implements a handler for GCP Http Functions
|
|
7
|
-
*
|
|
8
|
-
* @remarks Read more about Http Cloud Function {@link https://cloud.google.com/functions/docs/create-deploy-http-nodejs | here}
|
|
9
|
-
*
|
|
10
|
-
* @breadcrumb Handlers / GCPHandler
|
|
11
|
-
* @public
|
|
12
|
-
*/
|
|
13
|
-
export declare class GCPHandler<TApp> extends RawRequest<TApp> implements HandlerContract<TApp, never, never, never, void, void | Promise<void>> {
|
|
14
|
-
protected readonly name: string;
|
|
15
|
-
/**
|
|
16
|
-
* Default Constructor
|
|
17
|
-
*
|
|
18
|
-
* @param name - The name of this function, should be the during deploy.
|
|
19
|
-
*/
|
|
20
|
-
constructor(name: string);
|
|
21
|
-
/**
|
|
22
|
-
* {@inheritDoc}
|
|
23
|
-
*/
|
|
24
|
-
getHandler(app: TApp, framework: FrameworkContract<TApp>): (req: IncomingMessage, res: ServerResponse) => void | Promise<void>;
|
|
25
|
-
}
|
|
26
|
-
//# sourceMappingURL=gcp.handler.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"gcp.handler.d.ts","sourceRoot":"","sources":["../../../src/handlers/gcp/gcp.handler.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,MAAM,CAAC;AAEvD,OAAO,EAAE,iBAAiB,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AACrE,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAIrC;;;;;;;GAOG;AACH,qBAAa,UAAU,CAAC,IAAI,CAC1B,SAAQ,UAAU,CAAC,IAAI,CACvB,YACE,eAAe,CAAC,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAS5D,SAAS,CAAC,QAAQ,CAAC,IAAI,EAAE,MAAM;IAL3C;;;;OAIG;gBAC4B,IAAI,EAAE,MAAM;IAQ3C;;OAEG;IACI,UAAU,CACf,GAAG,EAAE,IAAI,EACT,SAAS,EAAE,iBAAiB,CAAC,IAAI,CAAC,GACjC,CAAC,GAAG,EAAE,eAAe,EAAE,GAAG,EAAE,cAAc,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC;CASvE"}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use strict";var __defProp=Object.defineProperty,__getOwnPropDesc=Object.getOwnPropertyDescriptor,__getOwnPropNames=Object.getOwnPropertyNames,__hasOwnProp=Object.prototype.hasOwnProperty,__export=(target,all)=>{for(var name in all)__defProp(target,name,{get:all[name],enumerable:!0})},__copyProps=(to,from,except,desc)=>{if(from&&typeof from=="object"||typeof from=="function")for(let key of __getOwnPropNames(from))!__hasOwnProp.call(to,key)&&key!==except&&__defProp(to,key,{get:()=>from[key],enumerable:!(desc=__getOwnPropDesc(from,key))||desc.enumerable});return to},__toCommonJS=mod=>__copyProps(__defProp({},"__esModule",{value:!0}),mod),gcp_handler_exports={};__export(gcp_handler_exports,{GCPHandler:()=>GCPHandler});module.exports=__toCommonJS(gcp_handler_exports);var import_functions_framework=require("@google-cloud/functions-framework"),import_base=require("../base");class GCPHandler extends import_base.RawRequest{constructor(name){super(),this.name=name}getHandler(app,framework){const callback=this.onRequestCallback(app,framework);return(0,import_functions_framework.http)(this.name,callback),callback}}
|
|
2
|
-
//# sourceMappingURL=gcp.handler.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"gcp.handler.js","sources":["../../../src/handlers/gcp/gcp.handler.ts"],"sourcesContent":["//#region Imports\n\nimport { IncomingMessage, ServerResponse } from 'http';\nimport { http } from '@google-cloud/functions-framework';\nimport { FrameworkContract, HandlerContract } from '../../contracts';\nimport { RawRequest } from '../base';\n\n//#endregion\n\n/**\n * The class that implements a handler for GCP Http Functions\n *\n * @remarks Read more about Http Cloud Function {@link https://cloud.google.com/functions/docs/create-deploy-http-nodejs | here}\n *\n * @breadcrumb Handlers / GCPHandler\n * @public\n */\nexport class GCPHandler<TApp>\n extends RawRequest<TApp>\n implements\n HandlerContract<TApp, never, never, never, void, void | Promise<void>>\n{\n //#region Constructor\n\n /**\n * Default Constructor\n *\n * @param name - The name of this function, should be the during deploy.\n */\n constructor(protected readonly name: string) {\n super();\n }\n\n //#endregion\n\n //#region Public Methods\n\n /**\n * {@inheritDoc}\n */\n public getHandler(\n app: TApp,\n framework: FrameworkContract<TApp>,\n ): (req: IncomingMessage, res: ServerResponse) => void | Promise<void> {\n const callback = this.onRequestCallback(app, framework);\n\n http(this.name, callback);\n\n return callback;\n }\n\n //#endregion\n}\n"],"names":[],"mappings":"ooBAAA,oBAAA,CAAA,EAAA,SAAA,oBAAA,CAAA,WAAA,IAAA,UAAA,CAAA,EAAA,OAAA,QAAA,aAAA,mBAAA,EAGA,IAAqB,2BAAA,QAAA,mCAAA,EAEM,YAAA,QAAA,SAAA,EAYpB,MAAM,mBACH,YAGV,UAAA,CAQE,YAA+B,KAAc,CACrC,QADuB,KAAA,KAAA,IAE/B,CASO,WACL,IACA,UACqE,CACrE,MAAM,SAAW,KAAK,kBAAkB,IAAK,SAAS,EAEjD,SAAA,2BAAA,MAAA,KAAK,KAAM,QAAQ,EAEjB,QACT,CAGF"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/handlers/gcp/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC"}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use strict";var __defProp=Object.defineProperty,__getOwnPropDesc=Object.getOwnPropertyDescriptor,__getOwnPropNames=Object.getOwnPropertyNames,__hasOwnProp=Object.prototype.hasOwnProperty,__copyProps=(to,from,except,desc)=>{if(from&&typeof from=="object"||typeof from=="function")for(let key of __getOwnPropNames(from))!__hasOwnProp.call(to,key)&&key!==except&&__defProp(to,key,{get:()=>from[key],enumerable:!(desc=__getOwnPropDesc(from,key))||desc.enumerable});return to},__reExport=(target,mod,secondTarget)=>(__copyProps(target,mod,"default"),secondTarget&&__copyProps(secondTarget,mod,"default")),__toCommonJS=mod=>__copyProps(__defProp({},"__esModule",{value:!0}),mod),gcp_exports={};module.exports=__toCommonJS(gcp_exports);__reExport(gcp_exports,require("./gcp.handler"),module.exports);
|
|
2
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../src/handlers/gcp/index.ts"],"sourcesContent":["export * from './gcp.handler';\n"],"names":[],"mappings":"kqBAAA,YAAA,CAAA,EAAA,OAAA,QAAA,aAAA,WAAA,EAAA,WAAA,YAAc,QAAd,eAAA,EAAA,OAAA,OAAA"}
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
|
-
import * as http from 'http';
|
|
3
|
-
import { RequestListener } from 'http';
|
|
4
|
-
import { BinarySettings } from '../../@types';
|
|
5
|
-
import { AdapterContract, FrameworkContract, HandlerContract, ResolverContract, ServerlessHandler } from '../../contracts';
|
|
6
|
-
import { ILogger } from '../../core';
|
|
7
|
-
/**
|
|
8
|
-
* The default port that huawei will proxy the request to your framework
|
|
9
|
-
*
|
|
10
|
-
* {@link https://support.huaweicloud.com/intl/en-us/ae-ad-1-usermanual-functiongraph/functiongraph_01_1442.html#functiongraph_01_1442__li194597302096 | Reference}
|
|
11
|
-
*
|
|
12
|
-
* @breadcrumb Handlers / HttpHuaweiHandler
|
|
13
|
-
* @public
|
|
14
|
-
*/
|
|
15
|
-
export declare const DEFAULT_HUAWEI_LISTEN_PORT: number;
|
|
16
|
-
/**
|
|
17
|
-
* The options to customize {@link HttpHuaweiHandler}
|
|
18
|
-
*
|
|
19
|
-
* @breadcrumb Handlers / HttpHuaweiHandler
|
|
20
|
-
* @public
|
|
21
|
-
*/
|
|
22
|
-
export type HttpHuaweiHandlerOptions = {
|
|
23
|
-
/**
|
|
24
|
-
* @defaultValue {@link DEFAULT_HUAWEI_LISTEN_PORT}
|
|
25
|
-
*/
|
|
26
|
-
port?: number;
|
|
27
|
-
/**
|
|
28
|
-
* The factory to create a http server to use to listen huawei requests
|
|
29
|
-
*/
|
|
30
|
-
httpServerFactory?: (requestListener: RequestListener) => http.Server;
|
|
31
|
-
};
|
|
32
|
-
/**
|
|
33
|
-
* The class that implements a huawei serverless handler with http function that exposes a http server in specific port.
|
|
34
|
-
*
|
|
35
|
-
* In this Handler, you don't need to specific resolver and adapter, so you can use DummyAdapter and DummyResolver instead.
|
|
36
|
-
*
|
|
37
|
-
* @see https://support.huaweicloud.com/intl/en-us/ae-ad-1-usermanual-functiongraph/functiongraph_01_1442.html#functiongraph_01_1442__li194597302096
|
|
38
|
-
*
|
|
39
|
-
* @breadcrumb Handlers / HttpHuaweiHandler
|
|
40
|
-
* @public
|
|
41
|
-
*/
|
|
42
|
-
export declare class HttpHuaweiHandler<TApp> implements HandlerContract<TApp, void, void, void, void, Promise<void>> {
|
|
43
|
-
protected readonly options?: HttpHuaweiHandlerOptions | undefined;
|
|
44
|
-
/**
|
|
45
|
-
* Construtor padrão
|
|
46
|
-
*/
|
|
47
|
-
constructor(options?: HttpHuaweiHandlerOptions | undefined);
|
|
48
|
-
/**
|
|
49
|
-
* {@inheritDoc}
|
|
50
|
-
*/
|
|
51
|
-
getHandler(app: TApp, framework: FrameworkContract<TApp>, _: AdapterContract<void, void, void>[], __: ResolverContract<void, void, void, void, void>, binarySettings: BinarySettings, respondWithErrors: boolean, log: ILogger): ServerlessHandler<Promise<void>>;
|
|
52
|
-
/**
|
|
53
|
-
* The method that creates the instance of http server
|
|
54
|
-
*
|
|
55
|
-
* @param requestListener - O método que lidará com as requisições recebidas
|
|
56
|
-
*/
|
|
57
|
-
protected createHttpServer(requestListener: RequestListener): http.Server;
|
|
58
|
-
}
|
|
59
|
-
//# sourceMappingURL=http-huawei.handler.d.ts.map
|