@h4ad/serverless-adapter 2.17.0 → 3.1.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/README.md +7 -0
- package/lib/@types/binary-settings.d.ts +3 -5
- package/lib/@types/binary-settings.d.ts.map +1 -0
- package/lib/@types/binary-settings.js +2 -11
- package/lib/@types/binary-settings.js.map +1 -1
- package/lib/@types/digital-ocean/digital-ocean-http-event.d.ts +1 -1
- package/lib/@types/digital-ocean/digital-ocean-http-event.d.ts.map +1 -0
- package/lib/@types/digital-ocean/digital-ocean-http-event.js +2 -7
- package/lib/@types/digital-ocean/digital-ocean-http-event.js.map +1 -1
- package/lib/@types/digital-ocean/digital-ocean-http-response.d.ts +1 -1
- package/lib/@types/digital-ocean/digital-ocean-http-response.d.ts.map +1 -0
- package/lib/@types/digital-ocean/digital-ocean-http-response.js +2 -7
- package/lib/@types/digital-ocean/digital-ocean-http-response.js.map +1 -1
- package/lib/@types/digital-ocean/index.d.ts +1 -0
- package/lib/@types/digital-ocean/index.d.ts.map +1 -0
- package/lib/@types/digital-ocean/index.js +2 -18
- package/lib/@types/digital-ocean/index.js.map +1 -1
- package/lib/@types/headers.d.ts +4 -6
- package/lib/@types/headers.d.ts.map +1 -0
- package/lib/@types/headers.js +2 -11
- package/lib/@types/headers.js.map +1 -1
- package/lib/@types/helpers.d.ts +2 -2
- package/lib/@types/helpers.d.ts.map +1 -0
- package/lib/@types/helpers.js +2 -6
- package/lib/@types/helpers.js.map +1 -1
- package/lib/@types/huawei/huawei-api-gateway-event.d.ts +3 -6
- package/lib/@types/huawei/huawei-api-gateway-event.d.ts.map +1 -0
- package/lib/@types/huawei/huawei-api-gateway-event.js +2 -14
- package/lib/@types/huawei/huawei-api-gateway-event.js.map +1 -1
- package/lib/@types/huawei/huawei-api-gateway-response.d.ts +1 -1
- package/lib/@types/huawei/huawei-api-gateway-response.d.ts.map +1 -0
- package/lib/@types/huawei/huawei-api-gateway-response.js +2 -7
- package/lib/@types/huawei/huawei-api-gateway-response.js.map +1 -1
- package/lib/@types/huawei/huawei-context.d.ts +16 -31
- package/lib/@types/huawei/huawei-context.d.ts.map +1 -0
- package/lib/@types/huawei/huawei-context.js +2 -36
- package/lib/@types/huawei/huawei-context.js.map +1 -1
- package/lib/@types/huawei/index.d.ts +1 -0
- package/lib/@types/huawei/index.d.ts.map +1 -0
- package/lib/@types/huawei/index.js +2 -20
- package/lib/@types/huawei/index.js.map +1 -1
- package/lib/@types/index.d.ts +1 -0
- package/lib/@types/index.d.ts.map +1 -0
- package/lib/@types/index.js +2 -20
- package/lib/@types/index.js.map +1 -1
- package/lib/adapters/apollo-server/apollo-server-mutation.adapter.d.ts +2 -2
- package/lib/adapters/apollo-server/apollo-server-mutation.adapter.d.ts.map +1 -0
- package/lib/adapters/apollo-server/apollo-server-mutation.adapter.js +2 -86
- package/lib/adapters/apollo-server/apollo-server-mutation.adapter.js.map +1 -1
- package/lib/adapters/apollo-server/index.d.ts +1 -0
- package/lib/adapters/apollo-server/index.d.ts.map +1 -0
- package/lib/adapters/apollo-server/index.js +2 -18
- package/lib/adapters/apollo-server/index.js.map +1 -1
- package/lib/adapters/aws/alb.adapter.d.ts +6 -1
- package/lib/adapters/aws/alb.adapter.d.ts.map +1 -0
- package/lib/adapters/aws/alb.adapter.js +2 -129
- package/lib/adapters/aws/alb.adapter.js.map +1 -1
- package/lib/adapters/aws/api-gateway-v1.adapter.d.ts +6 -1
- package/lib/adapters/aws/api-gateway-v1.adapter.d.ts.map +1 -0
- package/lib/adapters/aws/api-gateway-v1.adapter.js +2 -140
- package/lib/adapters/aws/api-gateway-v1.adapter.js.map +1 -1
- package/lib/adapters/aws/api-gateway-v2.adapter.d.ts +6 -1
- package/lib/adapters/aws/api-gateway-v2.adapter.d.ts.map +1 -0
- package/lib/adapters/aws/api-gateway-v2.adapter.js +2 -134
- package/lib/adapters/aws/api-gateway-v2.adapter.js.map +1 -1
- package/lib/adapters/aws/base/aws-simple-adapter.d.ts +3 -5
- package/lib/adapters/aws/base/aws-simple-adapter.d.ts.map +1 -0
- package/lib/adapters/aws/base/aws-simple-adapter.js +2 -99
- package/lib/adapters/aws/base/aws-simple-adapter.js.map +1 -1
- package/lib/adapters/aws/base/index.d.ts +1 -0
- package/lib/adapters/aws/base/index.d.ts.map +1 -0
- package/lib/adapters/aws/base/index.js +2 -18
- package/lib/adapters/aws/base/index.js.map +1 -1
- package/lib/adapters/aws/dynamodb.adapter.d.ts +1 -1
- package/lib/adapters/aws/dynamodb.adapter.d.ts.map +1 -0
- package/lib/adapters/aws/dynamodb.adapter.js +2 -64
- package/lib/adapters/aws/dynamodb.adapter.js.map +1 -1
- package/lib/adapters/aws/event-bridge.adapter.d.ts +2 -3
- package/lib/adapters/aws/event-bridge.adapter.d.ts.map +1 -0
- package/lib/adapters/aws/event-bridge.adapter.js +2 -75
- package/lib/adapters/aws/event-bridge.adapter.js.map +1 -1
- package/lib/adapters/aws/index.d.ts +2 -0
- package/lib/adapters/aws/index.d.ts.map +1 -0
- package/lib/adapters/aws/index.js +2 -27
- package/lib/adapters/aws/index.js.map +1 -1
- package/lib/adapters/aws/lambda-edge.adapter.d.ts +5 -9
- package/lib/adapters/aws/lambda-edge.adapter.d.ts.map +1 -0
- package/lib/adapters/aws/lambda-edge.adapter.js +2 -284
- package/lib/adapters/aws/lambda-edge.adapter.js.map +1 -1
- package/lib/adapters/aws/request-lambda-edge.adapter.d.ts +131 -0
- package/lib/adapters/aws/request-lambda-edge.adapter.d.ts.map +1 -0
- package/lib/adapters/aws/request-lambda-edge.adapter.js +2 -0
- package/lib/adapters/aws/request-lambda-edge.adapter.js.map +1 -0
- package/lib/adapters/aws/s3.adapter.d.ts +2 -2
- package/lib/adapters/aws/s3.adapter.d.ts.map +1 -0
- package/lib/adapters/aws/s3.adapter.js +2 -63
- package/lib/adapters/aws/s3.adapter.js.map +1 -1
- package/lib/adapters/aws/sns.adapter.d.ts +2 -2
- package/lib/adapters/aws/sns.adapter.d.ts.map +1 -0
- package/lib/adapters/aws/sns.adapter.js +2 -63
- package/lib/adapters/aws/sns.adapter.js.map +1 -1
- package/lib/adapters/aws/sqs.adapter.d.ts +2 -2
- package/lib/adapters/aws/sqs.adapter.d.ts.map +1 -0
- package/lib/adapters/aws/sqs.adapter.js +2 -64
- package/lib/adapters/aws/sqs.adapter.js.map +1 -1
- package/lib/adapters/azure/http-trigger-v4.adapter.d.ts +1 -1
- package/lib/adapters/azure/http-trigger-v4.adapter.d.ts.map +1 -0
- package/lib/adapters/azure/http-trigger-v4.adapter.js +2 -202
- package/lib/adapters/azure/http-trigger-v4.adapter.js.map +1 -1
- package/lib/adapters/azure/index.d.ts +1 -0
- package/lib/adapters/azure/index.d.ts.map +1 -0
- package/lib/adapters/azure/index.js +2 -18
- package/lib/adapters/azure/index.js.map +1 -1
- package/lib/adapters/digital-ocean/http-function.adapter.d.ts +1 -1
- package/lib/adapters/digital-ocean/http-function.adapter.d.ts.map +1 -0
- package/lib/adapters/digital-ocean/http-function.adapter.js +2 -118
- package/lib/adapters/digital-ocean/http-function.adapter.js.map +1 -1
- package/lib/adapters/digital-ocean/index.d.ts +1 -0
- package/lib/adapters/digital-ocean/index.d.ts.map +1 -0
- package/lib/adapters/digital-ocean/index.js +2 -18
- package/lib/adapters/digital-ocean/index.js.map +1 -1
- package/lib/adapters/dummy/dummy.adapter.d.ts +1 -0
- package/lib/adapters/dummy/dummy.adapter.d.ts.map +1 -0
- package/lib/adapters/dummy/dummy.adapter.js +2 -54
- package/lib/adapters/dummy/dummy.adapter.js.map +1 -1
- package/lib/adapters/dummy/index.d.ts +1 -0
- package/lib/adapters/dummy/index.d.ts.map +1 -0
- package/lib/adapters/dummy/index.js +2 -18
- package/lib/adapters/dummy/index.js.map +1 -1
- package/lib/adapters/huawei/huawei-api-gateway.adapter.d.ts +1 -1
- package/lib/adapters/huawei/huawei-api-gateway.adapter.d.ts.map +1 -0
- package/lib/adapters/huawei/huawei-api-gateway.adapter.js +2 -126
- package/lib/adapters/huawei/huawei-api-gateway.adapter.js.map +1 -1
- package/lib/adapters/huawei/index.d.ts +1 -0
- package/lib/adapters/huawei/index.d.ts.map +1 -0
- package/lib/adapters/huawei/index.js +2 -18
- package/lib/adapters/huawei/index.js.map +1 -1
- package/lib/contracts/adapter.contract.d.ts +1 -4
- package/lib/contracts/adapter.contract.d.ts.map +1 -0
- package/lib/contracts/adapter.contract.js +2 -18
- package/lib/contracts/adapter.contract.js.map +1 -1
- package/lib/contracts/framework.contract.d.ts +1 -1
- package/lib/contracts/framework.contract.d.ts.map +1 -0
- package/lib/contracts/framework.contract.js +2 -7
- package/lib/contracts/framework.contract.js.map +1 -1
- package/lib/contracts/handler.contract.d.ts +2 -3
- package/lib/contracts/handler.contract.d.ts.map +1 -0
- package/lib/contracts/handler.contract.js +2 -13
- package/lib/contracts/handler.contract.js.map +1 -1
- package/lib/contracts/index.d.ts +1 -0
- package/lib/contracts/index.d.ts.map +1 -0
- package/lib/contracts/index.js +2 -21
- package/lib/contracts/index.js.map +1 -1
- package/lib/contracts/resolver.contract.d.ts +4 -7
- package/lib/contracts/resolver.contract.d.ts.map +1 -0
- package/lib/contracts/resolver.contract.js +2 -15
- package/lib/contracts/resolver.contract.js.map +1 -1
- package/lib/core/base-handler.d.ts +1 -0
- package/lib/core/base-handler.d.ts.map +1 -0
- package/lib/core/base-handler.js +2 -67
- package/lib/core/base-handler.js.map +1 -1
- package/lib/core/constants.d.ts +4 -4
- package/lib/core/constants.d.ts.map +1 -0
- package/lib/core/constants.js +2 -33
- package/lib/core/constants.js.map +1 -1
- package/lib/core/current-invoke.d.ts +2 -2
- package/lib/core/current-invoke.d.ts.map +1 -0
- package/lib/core/current-invoke.js +2 -46
- package/lib/core/current-invoke.js.map +1 -1
- package/lib/core/event-body.d.ts +1 -0
- package/lib/core/event-body.d.ts.map +1 -0
- package/lib/core/event-body.js +2 -31
- package/lib/core/event-body.js.map +1 -1
- package/lib/core/headers.d.ts +26 -0
- package/lib/core/headers.d.ts.map +1 -0
- package/lib/core/headers.js +3 -97
- package/lib/core/headers.js.map +1 -1
- package/lib/core/index.d.ts +1 -0
- package/lib/core/index.d.ts.map +1 -0
- package/lib/core/index.js +2 -28
- package/lib/core/index.js.map +1 -1
- package/lib/core/is-binary.d.ts +8 -7
- package/lib/core/is-binary.d.ts.map +1 -0
- package/lib/core/is-binary.js +2 -118
- package/lib/core/is-binary.js.map +1 -1
- package/lib/core/logger.d.ts +5 -8
- package/lib/core/logger.d.ts.map +1 -0
- package/lib/core/logger.js +2 -115
- package/lib/core/logger.js.map +1 -1
- package/lib/core/no-op.d.ts +1 -0
- package/lib/core/no-op.d.ts.map +1 -0
- package/lib/core/no-op.js +2 -12
- package/lib/core/no-op.js.map +1 -1
- package/lib/core/optional.d.ts +1 -0
- package/lib/core/optional.d.ts.map +1 -0
- package/lib/core/optional.js +2 -31
- package/lib/core/optional.js.map +1 -1
- package/lib/core/path.d.ts +17 -0
- package/lib/core/path.d.ts.map +1 -0
- package/lib/core/path.js +2 -68
- package/lib/core/path.js.map +1 -1
- package/lib/core/stream.d.ts +1 -0
- package/lib/core/stream.d.ts.map +1 -0
- package/lib/core/stream.js +2 -63
- package/lib/core/stream.js.map +1 -1
- package/lib/frameworks/apollo-server/apollo-server.framework.d.ts +2 -4
- package/lib/frameworks/apollo-server/apollo-server.framework.d.ts.map +1 -0
- package/lib/frameworks/apollo-server/apollo-server.framework.js +2 -87
- package/lib/frameworks/apollo-server/apollo-server.framework.js.map +1 -1
- package/lib/frameworks/apollo-server/index.d.ts +1 -0
- package/lib/frameworks/apollo-server/index.d.ts.map +1 -0
- package/lib/frameworks/apollo-server/index.js +2 -18
- package/lib/frameworks/apollo-server/index.js.map +1 -1
- package/lib/frameworks/body-parser/base-body-parser.framework.d.ts +2 -2
- package/lib/frameworks/body-parser/base-body-parser.framework.d.ts.map +1 -0
- package/lib/frameworks/body-parser/base-body-parser.framework.js +2 -66
- package/lib/frameworks/body-parser/base-body-parser.framework.js.map +1 -1
- package/lib/frameworks/body-parser/index.d.ts +1 -0
- package/lib/frameworks/body-parser/index.d.ts.map +1 -0
- package/lib/frameworks/body-parser/index.js +2 -22
- package/lib/frameworks/body-parser/index.js.map +1 -1
- package/lib/frameworks/body-parser/json-body-parser.framework.d.ts +2 -2
- package/lib/frameworks/body-parser/json-body-parser.framework.d.ts.map +1 -0
- package/lib/frameworks/body-parser/json-body-parser.framework.js +2 -29
- package/lib/frameworks/body-parser/json-body-parser.framework.js.map +1 -1
- package/lib/frameworks/body-parser/raw-body-parser.framework.d.ts +2 -2
- package/lib/frameworks/body-parser/raw-body-parser.framework.d.ts.map +1 -0
- package/lib/frameworks/body-parser/raw-body-parser.framework.js +2 -29
- package/lib/frameworks/body-parser/raw-body-parser.framework.js.map +1 -1
- package/lib/frameworks/body-parser/text-body-parser.framework.d.ts +2 -2
- package/lib/frameworks/body-parser/text-body-parser.framework.d.ts.map +1 -0
- package/lib/frameworks/body-parser/text-body-parser.framework.js +2 -29
- package/lib/frameworks/body-parser/text-body-parser.framework.js.map +1 -1
- package/lib/frameworks/body-parser/urlencoded-body-parser.framework.d.ts +2 -2
- package/lib/frameworks/body-parser/urlencoded-body-parser.framework.d.ts.map +1 -0
- package/lib/frameworks/body-parser/urlencoded-body-parser.framework.js +2 -29
- package/lib/frameworks/body-parser/urlencoded-body-parser.framework.js.map +1 -1
- package/lib/frameworks/cors/cors.framework.d.ts +2 -2
- package/lib/frameworks/cors/cors.framework.d.ts.map +1 -0
- package/lib/frameworks/cors/cors.framework.js +3 -145
- package/lib/frameworks/cors/cors.framework.js.map +1 -1
- package/lib/frameworks/cors/index.d.ts +1 -0
- package/lib/frameworks/cors/index.d.ts.map +1 -0
- package/lib/frameworks/cors/index.js +2 -18
- package/lib/frameworks/cors/index.js.map +1 -1
- package/lib/frameworks/deepkit/http-deepkit.framework.d.ts +1 -0
- package/lib/frameworks/deepkit/http-deepkit.framework.d.ts.map +1 -0
- package/lib/frameworks/deepkit/http-deepkit.framework.js +2 -33
- package/lib/frameworks/deepkit/http-deepkit.framework.js.map +1 -1
- package/lib/frameworks/deepkit/index.d.ts +1 -0
- package/lib/frameworks/deepkit/index.d.ts.map +1 -0
- package/lib/frameworks/deepkit/index.js +2 -18
- package/lib/frameworks/deepkit/index.js.map +1 -1
- package/lib/frameworks/express/express.framework.d.ts +1 -0
- package/lib/frameworks/express/express.framework.d.ts.map +1 -0
- package/lib/frameworks/express/express.framework.js +2 -22
- package/lib/frameworks/express/express.framework.js.map +1 -1
- package/lib/frameworks/express/index.d.ts +1 -0
- package/lib/frameworks/express/index.d.ts.map +1 -0
- package/lib/frameworks/express/index.js +2 -18
- package/lib/frameworks/express/index.js.map +1 -1
- package/lib/frameworks/fastify/fastify.framework.d.ts +1 -0
- package/lib/frameworks/fastify/fastify.framework.d.ts.map +1 -0
- package/lib/frameworks/fastify/fastify.framework.js +2 -23
- package/lib/frameworks/fastify/fastify.framework.js.map +1 -1
- package/lib/frameworks/fastify/helpers/no-op-content-parser.d.ts +1 -0
- package/lib/frameworks/fastify/helpers/no-op-content-parser.d.ts.map +1 -0
- package/lib/frameworks/fastify/helpers/no-op-content-parser.js +2 -27
- package/lib/frameworks/fastify/helpers/no-op-content-parser.js.map +1 -1
- package/lib/frameworks/fastify/index.d.ts +1 -0
- package/lib/frameworks/fastify/index.d.ts.map +1 -0
- package/lib/frameworks/fastify/index.js +2 -18
- package/lib/frameworks/fastify/index.js.map +1 -1
- package/lib/frameworks/hapi/hapi.framework.d.ts +2 -1
- package/lib/frameworks/hapi/hapi.framework.d.ts.map +1 -0
- package/lib/frameworks/hapi/hapi.framework.js +2 -23
- package/lib/frameworks/hapi/hapi.framework.js.map +1 -1
- package/lib/frameworks/hapi/index.d.ts +1 -0
- package/lib/frameworks/hapi/index.d.ts.map +1 -0
- package/lib/frameworks/hapi/index.js +2 -18
- package/lib/frameworks/hapi/index.js.map +1 -1
- package/lib/frameworks/koa/index.d.ts +1 -0
- package/lib/frameworks/koa/index.d.ts.map +1 -0
- package/lib/frameworks/koa/index.js +2 -18
- package/lib/frameworks/koa/index.js.map +1 -1
- package/lib/frameworks/koa/koa.framework.d.ts +1 -0
- package/lib/frameworks/koa/koa.framework.d.ts.map +1 -0
- package/lib/frameworks/koa/koa.framework.js +2 -22
- package/lib/frameworks/koa/koa.framework.js.map +1 -1
- package/lib/frameworks/lazy/index.d.ts +1 -0
- package/lib/frameworks/lazy/index.d.ts.map +1 -0
- package/lib/frameworks/lazy/index.js +2 -18
- package/lib/frameworks/lazy/index.js.map +1 -1
- package/lib/frameworks/lazy/lazy.framework.d.ts +1 -0
- package/lib/frameworks/lazy/lazy.framework.d.ts.map +1 -0
- package/lib/frameworks/lazy/lazy.framework.js +2 -82
- package/lib/frameworks/lazy/lazy.framework.js.map +1 -1
- package/lib/frameworks/trpc/index.d.ts +1 -0
- package/lib/frameworks/trpc/index.d.ts.map +1 -0
- package/lib/frameworks/trpc/index.js +2 -18
- package/lib/frameworks/trpc/index.js.map +1 -1
- package/lib/frameworks/trpc/trpc.framework.d.ts +5 -7
- package/lib/frameworks/trpc/trpc.framework.d.ts.map +1 -0
- package/lib/frameworks/trpc/trpc.framework.js +2 -153
- package/lib/frameworks/trpc/trpc.framework.js.map +1 -1
- package/lib/handlers/aws/aws-stream.handler.d.ts +12 -6
- package/lib/handlers/aws/aws-stream.handler.d.ts.map +1 -0
- package/lib/handlers/aws/aws-stream.handler.js +2 -169
- package/lib/handlers/aws/aws-stream.handler.js.map +1 -1
- package/lib/handlers/aws/index.d.ts +1 -0
- package/lib/handlers/aws/index.d.ts.map +1 -0
- package/lib/handlers/aws/index.js +2 -18
- package/lib/handlers/aws/index.js.map +1 -1
- package/lib/handlers/azure/azure.handler.d.ts +1 -1
- package/lib/handlers/azure/azure.handler.d.ts.map +1 -0
- package/lib/handlers/azure/azure.handler.js +2 -74
- package/lib/handlers/azure/azure.handler.js.map +1 -1
- package/lib/handlers/azure/index.d.ts +1 -0
- package/lib/handlers/azure/index.d.ts.map +1 -0
- package/lib/handlers/azure/index.js +2 -18
- package/lib/handlers/azure/index.js.map +1 -1
- package/lib/handlers/base/index.d.ts +1 -0
- package/lib/handlers/base/index.d.ts.map +1 -0
- package/lib/handlers/base/index.js +2 -18
- package/lib/handlers/base/index.js.map +1 -1
- package/lib/handlers/base/raw-request.d.ts +1 -0
- package/lib/handlers/base/raw-request.d.ts.map +1 -0
- package/lib/handlers/base/raw-request.js +2 -65
- package/lib/handlers/base/raw-request.js.map +1 -1
- package/lib/handlers/default/default.handler.d.ts +1 -0
- package/lib/handlers/default/default.handler.d.ts.map +1 -0
- package/lib/handlers/default/default.handler.js +2 -191
- package/lib/handlers/default/default.handler.js.map +1 -1
- package/lib/handlers/default/index.d.ts +1 -0
- package/lib/handlers/default/index.d.ts.map +1 -0
- package/lib/handlers/default/index.js +2 -18
- package/lib/handlers/default/index.js.map +1 -1
- package/lib/handlers/digital-ocean/digital-ocean.handler.d.ts +1 -0
- package/lib/handlers/digital-ocean/digital-ocean.handler.d.ts.map +1 -0
- package/lib/handlers/digital-ocean/digital-ocean.handler.js +2 -34
- package/lib/handlers/digital-ocean/digital-ocean.handler.js.map +1 -1
- package/lib/handlers/digital-ocean/index.d.ts +1 -0
- package/lib/handlers/digital-ocean/index.d.ts.map +1 -0
- package/lib/handlers/digital-ocean/index.js +2 -18
- package/lib/handlers/digital-ocean/index.js.map +1 -1
- package/lib/handlers/firebase/http-firebase-v2.handler.d.ts +1 -0
- package/lib/handlers/firebase/http-firebase-v2.handler.d.ts.map +1 -0
- package/lib/handlers/firebase/http-firebase-v2.handler.js +2 -50
- package/lib/handlers/firebase/http-firebase-v2.handler.js.map +1 -1
- package/lib/handlers/firebase/http-firebase.handler.d.ts +1 -0
- package/lib/handlers/firebase/http-firebase.handler.d.ts.map +1 -0
- package/lib/handlers/firebase/http-firebase.handler.js +2 -27
- package/lib/handlers/firebase/http-firebase.handler.js.map +1 -1
- package/lib/handlers/firebase/index.d.ts +1 -0
- package/lib/handlers/firebase/index.d.ts.map +1 -0
- package/lib/handlers/firebase/index.js +2 -19
- package/lib/handlers/firebase/index.js.map +1 -1
- package/lib/handlers/gcp/gcp.handler.d.ts +2 -1
- package/lib/handlers/gcp/gcp.handler.d.ts.map +1 -0
- package/lib/handlers/gcp/gcp.handler.js +2 -40
- package/lib/handlers/gcp/gcp.handler.js.map +1 -1
- package/lib/handlers/gcp/index.d.ts +1 -0
- package/lib/handlers/gcp/index.d.ts.map +1 -0
- package/lib/handlers/gcp/index.js +2 -18
- package/lib/handlers/gcp/index.js.map +1 -1
- package/lib/handlers/huawei/http-huawei.handler.d.ts +2 -2
- package/lib/handlers/huawei/http-huawei.handler.d.ts.map +1 -0
- package/lib/handlers/huawei/http-huawei.handler.js +2 -106
- package/lib/handlers/huawei/http-huawei.handler.js.map +1 -1
- package/lib/handlers/huawei/index.d.ts +1 -0
- package/lib/handlers/huawei/index.d.ts.map +1 -0
- package/lib/handlers/huawei/index.js +2 -18
- package/lib/handlers/huawei/index.js.map +1 -1
- package/lib/index.d.ts +1 -0
- package/lib/index.d.ts.map +1 -0
- package/lib/index.doc.js +2 -0
- package/lib/index.doc.js.map +1 -0
- package/lib/index.js +2 -22
- package/lib/index.js.map +1 -1
- package/lib/network/index.d.ts +1 -0
- package/lib/network/index.d.ts.map +1 -0
- package/lib/network/index.js +2 -21
- package/lib/network/index.js.map +1 -1
- package/lib/network/request.d.ts +1 -1
- package/lib/network/request.d.ts.map +1 -0
- package/lib/network/request.js +2 -46
- package/lib/network/request.js.map +1 -1
- package/lib/network/response-stream.d.ts +1 -1
- package/lib/network/response-stream.d.ts.map +1 -0
- package/lib/network/response-stream.js +7 -88
- package/lib/network/response-stream.js.map +1 -1
- package/lib/network/response.d.ts +1 -1
- package/lib/network/response.d.ts.map +1 -0
- package/lib/network/response.js +4 -127
- package/lib/network/response.js.map +1 -1
- package/lib/network/utils.d.ts +2 -0
- package/lib/network/utils.d.ts.map +1 -0
- package/lib/network/utils.js +2 -21
- package/lib/network/utils.js.map +1 -1
- package/lib/resolvers/aws-context/aws-context.resolver.d.ts +1 -0
- package/lib/resolvers/aws-context/aws-context.resolver.d.ts.map +1 -0
- package/lib/resolvers/aws-context/aws-context.resolver.js +2 -59
- package/lib/resolvers/aws-context/aws-context.resolver.js.map +1 -1
- package/lib/resolvers/aws-context/index.d.ts +1 -0
- package/lib/resolvers/aws-context/index.d.ts.map +1 -0
- package/lib/resolvers/aws-context/index.js +2 -18
- package/lib/resolvers/aws-context/index.js.map +1 -1
- package/lib/resolvers/callback/callback.resolver.d.ts +2 -2
- package/lib/resolvers/callback/callback.resolver.d.ts.map +1 -0
- package/lib/resolvers/callback/callback.resolver.js +2 -53
- package/lib/resolvers/callback/callback.resolver.js.map +1 -1
- package/lib/resolvers/callback/index.d.ts +1 -0
- package/lib/resolvers/callback/index.d.ts.map +1 -0
- package/lib/resolvers/callback/index.js +2 -18
- package/lib/resolvers/callback/index.js.map +1 -1
- package/lib/resolvers/dummy/dummy.resolver.d.ts +1 -0
- package/lib/resolvers/dummy/dummy.resolver.d.ts.map +1 -0
- package/lib/resolvers/dummy/dummy.resolver.js +2 -24
- package/lib/resolvers/dummy/dummy.resolver.js.map +1 -1
- package/lib/resolvers/dummy/index.d.ts +1 -0
- package/lib/resolvers/dummy/index.d.ts.map +1 -0
- package/lib/resolvers/dummy/index.js +2 -18
- package/lib/resolvers/dummy/index.js.map +1 -1
- package/lib/resolvers/promise/index.d.ts +1 -0
- package/lib/resolvers/promise/index.d.ts.map +1 -0
- package/lib/resolvers/promise/index.js +2 -18
- package/lib/resolvers/promise/index.js.map +1 -1
- package/lib/resolvers/promise/promise.resolver.d.ts +1 -0
- package/lib/resolvers/promise/promise.resolver.d.ts.map +1 -0
- package/lib/resolvers/promise/promise.resolver.js +2 -48
- package/lib/resolvers/promise/promise.resolver.js.map +1 -1
- package/lib/serverless-adapter.d.ts +1 -0
- package/lib/serverless-adapter.d.ts.map +1 -0
- package/lib/serverless-adapter.js +2 -176
- package/lib/serverless-adapter.js.map +1 -1
- package/package.json +60 -79
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/network/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC;AAC3B,cAAc,mBAAmB,CAAC;AAClC,cAAc,SAAS,CAAC"}
|
package/lib/network/index.js
CHANGED
|
@@ -1,21 +1,2 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./request"), exports);
|
|
18
|
-
__exportStar(require("./response"), exports);
|
|
19
|
-
__exportStar(require("./response-stream"), exports);
|
|
20
|
-
__exportStar(require("./utils"), exports);
|
|
21
|
-
//# sourceMappingURL=index.js.map
|
|
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),network_exports={};module.exports=__toCommonJS(network_exports);__reExport(network_exports,require("./request"),module.exports);__reExport(network_exports,require("./response"),module.exports);__reExport(network_exports,require("./response-stream"),module.exports);__reExport(network_exports,require("./utils"),module.exports);
|
|
2
|
+
//# sourceMappingURL=index.js.map
|
package/lib/network/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../src/network/index.ts"],"sourcesContent":["export * from './request';\nexport * from './response';\nexport * from './response-stream';\nexport * from './utils';\n"],"names":[],"mappings":"kqBAAA,gBAAA,CAAA,EAAA,OAAA,QAAA,aAAA,eAAA,EAAA,WAAA,gBAAc,QAAd,WAAA,EAAA,OAAA,OAAA,EACA,WAAA,gBAAc,QADd,YAAA,EAAA,OAAA,OAAA,EAEA,WAAA,gBAAc,QAFd,mBAAA,EAAA,OAAA,OAAA,EAGA,WAAA,gBAAc,QAHd,SAAA,EAAA,OAAA,OAAA"}
|
package/lib/network/request.d.ts
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"request.d.ts","sourceRoot":"","sources":["../../src/network/request.ts"],"names":[],"mappings":";;AACA,OAAO,EAAE,eAAe,EAAE,MAAM,MAAM,CAAC;AAEvC,OAAO,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAC;AAK/C;;;;;GAKG;AACH,MAAM,WAAW,sBAAsB;IACrC;;OAEG;IACH,MAAM,EAAE,MAAM,CAAC;IAEf;;OAEG;IACH,GAAG,EAAE,MAAM,CAAC;IAEZ;;OAEG;IACH,OAAO,EAAE,kBAAkB,CAAC;IAE5B;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,GAAG,UAAU,CAAC;IAE3B;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED;;;;;GAKG;AACH,qBAAa,iBAAkB,SAAQ,eAAe;gBACxC,EACV,MAAM,EACN,GAAG,EACH,OAAO,EACP,IAAI,EACJ,aAAa,GACd,EAAE,sBAAsB;IA4BzB,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,IAAI,CAAC,EAAE,MAAM,GAAG,UAAU,CAAC;CAC5B"}
|
package/lib/network/request.js
CHANGED
|
@@ -1,46 +1,2 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
exports.ServerlessRequest = exports.__ΩServerlessRequestProps = void 0;
|
|
4
|
-
const { __ΩSingleValueHeaders } = require('../@types');
|
|
5
|
-
// ATTRIBUTION: https://github.com/dougmoscrop/serverless-http
|
|
6
|
-
const http_1 = require("http");
|
|
7
|
-
const core_1 = require("../core");
|
|
8
|
-
const HTTPS_PORT = 443;
|
|
9
|
-
const __ΩServerlessRequestProps = ['method', 'url', () => __ΩSingleValueHeaders, 'headers', 'body', 'remoteAddress', 'P&4!&4"n#4$P!WJ4%8&4&8M'];
|
|
10
|
-
exports.__ΩServerlessRequestProps = __ΩServerlessRequestProps;
|
|
11
|
-
/**
|
|
12
|
-
* The class that represents an {@link http#IncomingMessage} created by the library to represent an actual request to the framework.
|
|
13
|
-
*
|
|
14
|
-
* @breadcrumb Network / ServerlessRequest
|
|
15
|
-
* @public
|
|
16
|
-
*/
|
|
17
|
-
class ServerlessRequest extends http_1.IncomingMessage {
|
|
18
|
-
constructor({ method, url, headers, body, remoteAddress, }) {
|
|
19
|
-
super({
|
|
20
|
-
encrypted: true,
|
|
21
|
-
readable: false,
|
|
22
|
-
remoteAddress,
|
|
23
|
-
address: () => ({ port: HTTPS_PORT }),
|
|
24
|
-
end: core_1.NO_OP,
|
|
25
|
-
destroy: core_1.NO_OP,
|
|
26
|
-
});
|
|
27
|
-
this.statusCode = 200;
|
|
28
|
-
this.statusMessage = 'OK';
|
|
29
|
-
this.complete = true;
|
|
30
|
-
this.httpVersion = '1.1';
|
|
31
|
-
this.httpVersionMajor = 1;
|
|
32
|
-
this.httpVersionMinor = 1;
|
|
33
|
-
this.method = method;
|
|
34
|
-
this.headers = headers;
|
|
35
|
-
this.body = body;
|
|
36
|
-
this.url = url;
|
|
37
|
-
this.ip = remoteAddress;
|
|
38
|
-
this._read = () => {
|
|
39
|
-
this.push(body);
|
|
40
|
-
this.push(null);
|
|
41
|
-
};
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
exports.ServerlessRequest = ServerlessRequest;
|
|
45
|
-
ServerlessRequest.__type = [() => http_1.IncomingMessage, () => __ΩServerlessRequestProps, 'param0', 'constructor', 'ip', 'body', 'P7!Pn"2#"0$&3%8P!WJ3&85'];
|
|
46
|
-
//# sourceMappingURL=request.js.map
|
|
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),request_exports={};__export(request_exports,{ServerlessRequest:()=>ServerlessRequest});module.exports=__toCommonJS(request_exports);var import_http=require("http"),import_core=require("../core");const HTTPS_PORT=443;class ServerlessRequest extends import_http.IncomingMessage{constructor({method,url,headers,body,remoteAddress}){super({encrypted:!0,readable:!1,remoteAddress,address:()=>({port:HTTPS_PORT}),end:import_core.NO_OP,destroy:import_core.NO_OP}),this.statusCode=200,this.statusMessage="OK",this.complete=!0,this.httpVersion="1.1",this.httpVersionMajor=1,this.httpVersionMinor=1,this.method=method,this.headers=headers,this.body=body,this.url=url,this.ip=remoteAddress,this._read=()=>{this.push(body),this.push(null)}}}
|
|
2
|
+
//# sourceMappingURL=request.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"request.js","
|
|
1
|
+
{"version":3,"file":"request.js","sources":["../../src/network/request.ts"],"sourcesContent":["// ATTRIBUTION: https://github.com/dougmoscrop/serverless-http\nimport { IncomingMessage } from 'http';\nimport { AddressInfo } from 'net';\nimport { SingleValueHeaders } from '../@types';\nimport { NO_OP } from '../core';\n\nconst HTTPS_PORT = 443;\n\n/**\n * The properties to create a {@link ServerlessRequest}\n *\n * @breadcrumb Network / ServerlessRequest\n * @public\n */\nexport interface ServerlessRequestProps {\n /**\n * The HTTP Method of the request\n */\n method: string;\n\n /**\n * The URL requested\n */\n url: string;\n\n /**\n * The headers from the event source\n */\n headers: SingleValueHeaders;\n\n /**\n * The body from the event source\n */\n body?: Buffer | Uint8Array;\n\n /**\n * The IP Address from caller\n */\n remoteAddress?: string;\n}\n\n/**\n * The class that represents an {@link http#IncomingMessage} created by the library to represent an actual request to the framework.\n *\n * @breadcrumb Network / ServerlessRequest\n * @public\n */\nexport class ServerlessRequest extends IncomingMessage {\n constructor({\n method,\n url,\n headers,\n body,\n remoteAddress,\n }: ServerlessRequestProps) {\n super({\n encrypted: true,\n readable: false,\n remoteAddress,\n address: () => ({ port: HTTPS_PORT } as AddressInfo),\n end: NO_OP,\n destroy: NO_OP,\n } as any);\n\n this.statusCode = 200;\n this.statusMessage = 'OK';\n this.complete = true;\n this.httpVersion = '1.1';\n this.httpVersionMajor = 1;\n this.httpVersionMinor = 1;\n this.method = method;\n this.headers = headers;\n this.body = body;\n this.url = url;\n this.ip = remoteAddress;\n\n this._read = () => {\n this.push(body);\n this.push(null);\n };\n }\n\n ip?: string;\n body?: Buffer | Uint8Array;\n}\n"],"names":[],"mappings":"ooBAAA,gBAAA,CAAA,EAAA,SAAA,gBAAA,CAAA,kBAAA,IAAA,iBAAA,CAAA,EAAA,OAAA,QAAA,aAAA,eAAA,EACA,IAAgC,YAAA,QAAA,MAAA,EAGV,YAAA,QAAA,SAAA,EAEtB,MAAM,WAAa,IAyCZ,MAAM,0BAA0B,YAAgB,eAAA,CACrD,YAAY,CACV,OACA,IACA,QACA,KACA,aAAA,EACyB,CACnB,MAAA,CACJ,UAAW,GACX,SAAU,GACV,cACA,QAAS,KAAO,CAAE,KAAM,aACxB,IAAK,YAAA,MACL,QAAS,YAAA,KAAA,CACH,EAER,KAAK,WAAa,IAClB,KAAK,cAAgB,KACrB,KAAK,SAAW,GAChB,KAAK,YAAc,MACnB,KAAK,iBAAmB,EACxB,KAAK,iBAAmB,EACxB,KAAK,OAAS,OACd,KAAK,QAAU,QACf,KAAK,KAAO,KACZ,KAAK,IAAM,IACX,KAAK,GAAK,cAEV,KAAK,MAAQ,IAAM,CACjB,KAAK,KAAK,IAAI,EACd,KAAK,KAAK,IAAI,CAAA,CAElB,CAIF"}
|
|
@@ -38,4 +38,4 @@ export interface ServerlessStreamResponseProps {
|
|
|
38
38
|
export declare class ServerlessStreamResponse extends ServerResponse {
|
|
39
39
|
constructor({ method, onReceiveHeaders, log, }: ServerlessStreamResponseProps);
|
|
40
40
|
}
|
|
41
|
-
|
|
41
|
+
//# sourceMappingURL=response-stream.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"response-stream.d.ts","sourceRoot":"","sources":["../../src/network/response-stream.ts"],"names":[],"mappings":";;AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,MAAM,CAAC;AAEtC,OAAO,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAC;AAClC,OAAO,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAC7C,OAAO,EAAE,OAAO,EAAuB,MAAM,SAAS,CAAC;AAOvD;;;;;GAKG;AACH,MAAM,WAAW,6BAA6B;IAC5C;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB;;;;;;OAMG;IACH,gBAAgB,EAAE,CAAC,UAAU,EAAE,MAAM,EAAE,OAAO,EAAE,gBAAgB,KAAK,QAAQ,CAAC;IAE9E;;OAEG;IACH,GAAG,EAAE,OAAO,CAAC;CACd;AAED;;;;;;GAMG;AACH,qBAAa,wBAAyB,SAAQ,cAAc;gBAC9C,EACV,MAAM,EACN,gBAAgB,EAChB,GAAG,GACJ,EAAE,6BAA6B;CA8EjC"}
|
|
@@ -1,88 +1,7 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
function
|
|
7
|
-
|
|
8
|
-
return fn;
|
|
9
|
-
}
|
|
10
|
-
const http_1 = require("http");
|
|
11
|
-
const core_1 = require("../core");
|
|
12
|
-
const utils_1 = require("./utils");
|
|
13
|
-
const endChunked = '0\r\n\r\n';
|
|
14
|
-
const headerEnd = '\r\n\r\n';
|
|
15
|
-
const endStatusSeparator = '\r\n';
|
|
16
|
-
const __ΩServerlessStreamResponseProps = ['method', 'statusCode', () => __ΩBothValueHeaders, 'headers', '', 'onReceiveHeaders', () => __ΩILogger, 'log', 'P&4!8P\'2"n#2$!/%4&n\'4(M'];
|
|
17
|
-
exports.__ΩServerlessStreamResponseProps = __ΩServerlessStreamResponseProps;
|
|
18
|
-
/**
|
|
19
|
-
* The class that represents a response instance used to send to the framework and wait until the framework finishes processing the request.
|
|
20
|
-
* This response is specially built to deal with transfer-encoding: chunked
|
|
21
|
-
*
|
|
22
|
-
* @breadcrumb Network / ServerlessStreamResponse
|
|
23
|
-
* @public
|
|
24
|
-
*/
|
|
25
|
-
class ServerlessStreamResponse extends http_1.ServerResponse {
|
|
26
|
-
constructor({ method, onReceiveHeaders, log, }) {
|
|
27
|
-
super({ method });
|
|
28
|
-
this.useChunkedEncodingByDefault = true;
|
|
29
|
-
this.chunkedEncoding = true;
|
|
30
|
-
let internalWritable = null;
|
|
31
|
-
let isFirstCall = true;
|
|
32
|
-
// this ignore is used because I need to ignore these write calls:
|
|
33
|
-
// https://github.com/nodejs/node/blob/main/lib/_http_outgoing.js#L934-L935
|
|
34
|
-
// https://github.com/nodejs/node/blob/main/lib/_http_outgoing.js#L937
|
|
35
|
-
let writesToIgnore = 0;
|
|
36
|
-
const socket = {
|
|
37
|
-
_writableState: {},
|
|
38
|
-
writable: true,
|
|
39
|
-
on: core_1.NO_OP,
|
|
40
|
-
removeListener: core_1.NO_OP,
|
|
41
|
-
destroy: core_1.NO_OP,
|
|
42
|
-
cork: core_1.NO_OP,
|
|
43
|
-
uncork: core_1.NO_OP,
|
|
44
|
-
write: __assignType((data, encoding, cb) => {
|
|
45
|
-
// very unlikely, I don't even know how to reproduce this, but exist on types
|
|
46
|
-
// istanbul ignore if
|
|
47
|
-
if (typeof encoding === 'function') {
|
|
48
|
-
cb = encoding;
|
|
49
|
-
encoding = null;
|
|
50
|
-
}
|
|
51
|
-
log.debug('SERVERLESS_ADAPTER:RESPONSE_STREAM:DATA', () => ({
|
|
52
|
-
data: Buffer.isBuffer(data) ? data.toString('utf8') : data,
|
|
53
|
-
encoding,
|
|
54
|
-
}));
|
|
55
|
-
if (!isFirstCall && internalWritable) {
|
|
56
|
-
if (data === endChunked) {
|
|
57
|
-
internalWritable.end(cb);
|
|
58
|
-
return true;
|
|
59
|
-
}
|
|
60
|
-
if (writesToIgnore > 0) {
|
|
61
|
-
writesToIgnore--;
|
|
62
|
-
return true;
|
|
63
|
-
}
|
|
64
|
-
internalWritable.write(data, cb);
|
|
65
|
-
writesToIgnore = 3;
|
|
66
|
-
}
|
|
67
|
-
else if (isFirstCall) {
|
|
68
|
-
isFirstCall = false;
|
|
69
|
-
const stringData = (0, utils_1.getString)(data);
|
|
70
|
-
const endStatusIndex = stringData.indexOf(endStatusSeparator);
|
|
71
|
-
const status = +stringData.slice(0, endStatusIndex).split(' ')[1];
|
|
72
|
-
const headerData = stringData.slice(endStatusIndex + 2, stringData.indexOf(headerEnd));
|
|
73
|
-
const headers = (0, core_1.parseHeaders)(headerData);
|
|
74
|
-
log.debug('SERVERLESS_ADAPTER:RESPONSE_STREAM:FRAMEWORK_HEADERS', {
|
|
75
|
-
headers,
|
|
76
|
-
});
|
|
77
|
-
writesToIgnore = 1;
|
|
78
|
-
internalWritable = onReceiveHeaders(status, headers);
|
|
79
|
-
}
|
|
80
|
-
return true;
|
|
81
|
-
}, ['data', '', 'encoding', 'cb', 'PPW&J2!P&,P$/"J2#8P$/"2$8"/"']),
|
|
82
|
-
};
|
|
83
|
-
this.assignSocket(socket);
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
exports.ServerlessStreamResponse = ServerlessStreamResponse;
|
|
87
|
-
ServerlessStreamResponse.__type = [() => http_1.ServerResponse, () => __ΩServerlessStreamResponseProps, 'param0', 'constructor', 'P7!Pn"2#"0$5'];
|
|
88
|
-
//# sourceMappingURL=response-stream.js.map
|
|
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),response_stream_exports={};__export(response_stream_exports,{ServerlessStreamResponse:()=>ServerlessStreamResponse});module.exports=__toCommonJS(response_stream_exports);var import_http=require("http"),import_core=require("../core"),import_utils=require("./utils");const endChunked=`0\r
|
|
2
|
+
\r
|
|
3
|
+
`,headerEnd=`\r
|
|
4
|
+
\r
|
|
5
|
+
`,endStatusSeparator=`\r
|
|
6
|
+
`;class ServerlessStreamResponse extends import_http.ServerResponse{constructor({method,onReceiveHeaders,log}){super({method}),this.useChunkedEncodingByDefault=!0,this.chunkedEncoding=!0;let internalWritable=null,isFirstCall=!0,writesToIgnore=0;const socket={_writableState:{},writable:!0,on:import_core.NO_OP,removeListener:import_core.NO_OP,destroy:import_core.NO_OP,cork:import_core.NO_OP,uncork:import_core.NO_OP,write:(data,encoding,cb)=>{if(typeof encoding=="function"&&(cb=encoding,encoding=null),log.debug("SERVERLESS_ADAPTER:RESPONSE_STREAM:DATA",()=>({data:Buffer.isBuffer(data)?data.toString("utf8"):data,encoding})),!isFirstCall&&internalWritable){if(data===endChunked)return internalWritable.end(cb),!0;if(writesToIgnore>0)return writesToIgnore--,!0;internalWritable.write(data,cb),writesToIgnore=3}else if(isFirstCall){isFirstCall=!1;const stringData=(0,import_utils.getString)(data),endStatusIndex=stringData.indexOf(endStatusSeparator),status=+stringData.slice(0,endStatusIndex).split(" ")[1],headerData=stringData.slice(endStatusIndex+2,stringData.indexOf(headerEnd)),headers=(0,import_core.parseHeaders)(headerData);log.debug("SERVERLESS_ADAPTER:RESPONSE_STREAM:FRAMEWORK_HEADERS",{headers}),writesToIgnore=1,internalWritable=onReceiveHeaders(status,headers)}return!0}};this.assignSocket(socket)}}
|
|
7
|
+
//# sourceMappingURL=response-stream.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"response-stream.js","
|
|
1
|
+
{"version":3,"file":"response-stream.js","sources":["../../src/network/response-stream.ts"],"sourcesContent":["import { ServerResponse } from 'http';\nimport { Socket } from 'net';\nimport { Writable } from 'stream';\nimport { BothValueHeaders } from '../@types';\nimport { ILogger, NO_OP, parseHeaders } from '../core';\nimport { getString } from './utils';\n\nconst endChunked = '0\\r\\n\\r\\n';\nconst headerEnd = '\\r\\n\\r\\n';\nconst endStatusSeparator = '\\r\\n';\n\n/**\n * The properties to create a {@link ServerlessStreamResponse}.\n *\n * @breadcrumb Network / ServerlessStreamResponse\n * @public\n */\nexport interface ServerlessStreamResponseProps {\n /**\n * The HTTP Method from request\n */\n method?: string;\n\n /**\n * The callback to receive the headers when they are written to the stream\n * You need to return a writable stream be able to continue writing the response\n *\n * @param statusCode - The status code of the response\n * @param headers - The headers of the response\n */\n onReceiveHeaders: (statusCode: number, headers: BothValueHeaders) => Writable;\n\n /**\n * Instance of the logger\n */\n log: ILogger;\n}\n\n/**\n * The class that represents a response instance used to send to the framework and wait until the framework finishes processing the request.\n * This response is specially built to deal with transfer-encoding: chunked\n *\n * @breadcrumb Network / ServerlessStreamResponse\n * @public\n */\nexport class ServerlessStreamResponse extends ServerResponse {\n constructor({\n method,\n onReceiveHeaders,\n log,\n }: ServerlessStreamResponseProps) {\n super({ method } as any);\n\n this.useChunkedEncodingByDefault = true;\n this.chunkedEncoding = true;\n\n let internalWritable: Writable | null = null;\n let isFirstCall = true;\n // this ignore is used because I need to ignore these write calls:\n // https://github.com/nodejs/node/blob/main/lib/_http_outgoing.js#L934-L935\n // https://github.com/nodejs/node/blob/main/lib/_http_outgoing.js#L937\n let writesToIgnore = 0;\n\n const socket: Partial<Socket> & { _writableState: any } = {\n _writableState: {},\n writable: true,\n on: NO_OP,\n removeListener: NO_OP,\n destroy: NO_OP,\n cork: NO_OP,\n uncork: NO_OP,\n write: (\n data: Uint8Array | string,\n encoding?: string | null | (() => void),\n cb?: () => void,\n ): any => {\n // very unlikely, I don't even know how to reproduce this, but exist on types\n // istanbul ignore if\n if (typeof encoding === 'function') {\n cb = encoding;\n encoding = null;\n }\n\n log.debug('SERVERLESS_ADAPTER:RESPONSE_STREAM:DATA', () => ({\n data: Buffer.isBuffer(data) ? data.toString('utf8') : data,\n encoding,\n }));\n\n if (!isFirstCall && internalWritable) {\n if (data === endChunked) {\n internalWritable.end(cb);\n\n return true;\n }\n\n if (writesToIgnore > 0) {\n writesToIgnore--;\n return true;\n }\n\n internalWritable.write(data, cb);\n writesToIgnore = 3;\n } else if (isFirstCall) {\n isFirstCall = false;\n\n const stringData = getString(data);\n const endStatusIndex = stringData.indexOf(endStatusSeparator);\n const status = +stringData.slice(0, endStatusIndex).split(' ')[1];\n\n const headerData = stringData.slice(\n endStatusIndex + 2,\n stringData.indexOf(headerEnd),\n );\n const headers = parseHeaders(headerData);\n log.debug('SERVERLESS_ADAPTER:RESPONSE_STREAM:FRAMEWORK_HEADERS', {\n headers,\n });\n\n writesToIgnore = 1;\n internalWritable = onReceiveHeaders(status, headers);\n }\n\n return true;\n },\n };\n\n this.assignSocket(socket as unknown as Socket);\n }\n}\n"],"names":[],"mappings":"ooBAAA,wBAAA,CAAA,EAAA,SAAA,wBAAA,CAAA,yBAAA,IAAA,wBAAA,CAAA,EAAA,OAAA,QAAA,aAAA,uBAAA,EAAA,IAA+B,YAAA,QAAA,MAAA,EAIc,YAAA,QAAA,SAAA,EACnB,aAAA,QAAA,SAAA,EAE1B,MAAM,WAAa;AAAA;AAAA,EACb,UAAY;AAAA;AAAA,EACZ,mBAAqB;AAAA,EAoCpB,MAAM,iCAAiC,YAAe,cAAA,CAC3D,YAAY,CACV,OACA,iBACA,GAAA,EACgC,CAC1B,MAAA,CAAE,OAAe,EAEvB,KAAK,4BAA8B,GACnC,KAAK,gBAAkB,GAEvB,IAAI,iBAAoC,KACpC,YAAc,GAId,eAAiB,EAErB,MAAM,OAAoD,CACxD,eAAgB,CAAC,EACjB,SAAU,GACV,GAAI,YAAA,MACJ,eAAgB,YAAA,MAChB,QAAS,YAAA,MACT,KAAM,YAAA,MACN,OAAQ,YAAA,MACR,MAAO,CACL,KACA,SACA,KACQ,CAaJ,GAVA,OAAO,UAAa,aACjB,GAAA,SACM,SAAA,MAGT,IAAA,MAAM,0CAA2C,KAAO,CAC1D,KAAM,OAAO,SAAS,IAAI,EAAI,KAAK,SAAS,MAAM,EAAI,KACtD,QACA,EAAA,EAEE,CAAC,aAAe,iBAAkB,CACpC,GAAI,OAAS,WACX,wBAAiB,IAAI,EAAE,EAEhB,GAGT,GAAI,eAAiB,EACnB,wBACO,GAGQ,iBAAA,MAAM,KAAM,EAAE,EACd,eAAA,UACR,YAAa,CACR,YAAA,GAER,MAAA,cAAa,wBAAU,IAAI,EAC3B,eAAiB,WAAW,QAAQ,kBAAkB,EACtD,OAAS,CAAC,WAAW,MAAM,EAAG,cAAc,EAAE,MAAM,GAAG,EAAE,CAAC,EAE1D,WAAa,WAAW,MAC5B,eAAiB,EACjB,WAAW,QAAQ,SAAS,CAAA,EAExB,WAAU,0BAAa,UAAU,EACvC,IAAI,MAAM,uDAAwD,CAChE,OAAA,CACD,EAEgB,eAAA,EACE,iBAAA,iBAAiB,OAAQ,OAAO,EAG9C,MAAA,EACT,CAAA,EAGF,KAAK,aAAa,MAA2B,CAC/C,CACF"}
|
|
@@ -45,4 +45,4 @@ export declare class ServerlessResponse extends ServerResponse {
|
|
|
45
45
|
protected callNativeWriteHead(statusCode: number, statusMessage?: string | any | any[], obj?: any | any[]): this;
|
|
46
46
|
}
|
|
47
47
|
export {};
|
|
48
|
-
|
|
48
|
+
//# sourceMappingURL=response.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"response.d.ts","sourceRoot":"","sources":["../../src/network/response.ts"],"names":[],"mappings":";;AACA,OAAO,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,MAAM,CAAC;AAOvD,QAAA,MAAM,IAAI,eAA0B,CAAC;AACrC,QAAA,MAAM,OAAO,eAA6B,CAAC;AAY3C;;;;;GAKG;AACH,MAAM,WAAW,uBAAuB;IACtC;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED;;;;;;GAMG;AACH,qBAAa,kBAAmB,SAAQ,cAAc;gBACxC,EAAE,MAAM,EAAE,EAAE,uBAAuB;IAiD/C,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;IAC5B,YAAY,CAAC,EAAE,OAAO,CAAC;IAEvB,CAAC,IAAI,CAAC,EAAE,GAAG,EAAE,CAAC;IACd,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;IAE5B,IAAI,OAAO,IAAI,MAAM,CAAC,GAAG,EAAE,GAAG,CAAC,CAE9B;IAED,MAAM,CAAC,IAAI,CAAC,GAAG,EAAE,eAAe;IAWhC,MAAM,CAAC,IAAI,CAAC,GAAG,EAAE,kBAAkB,GAAG,MAAM;IAI5C,MAAM,CAAC,OAAO,CAAC,GAAG,EAAE,kBAAkB;IAMtC,SAAS,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,MAAM,EAAE,GAAG,GAAG;IAKvE,SAAS,CACP,UAAU,EAAE,MAAM,EAClB,aAAa,CAAC,EAAE,MAAM,GAAG,GAAG,GAAG,GAAG,EAAE,EACpC,GAAG,CAAC,EAAE,GAAG,GAAG,GAAG,EAAE,GAChB,GAAG;IAuBN;;;;;;OAMG;IACH,SAAS,CAAC,mBAAmB,CAC3B,UAAU,EAAE,MAAM,EAClB,aAAa,CAAC,EAAE,MAAM,GAAG,GAAG,GAAG,GAAG,EAAE,EACpC,GAAG,CAAC,EAAE,GAAG,GAAG,GAAG,EAAE,GAChB,IAAI;CAGR"}
|
package/lib/network/response.js
CHANGED
|
@@ -1,127 +1,4 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
fn.__type = args;
|
|
6
|
-
return fn;
|
|
7
|
-
}
|
|
8
|
-
const __ΩRecord = ['K', 'T', 'l\'e#"Rb!b"Pde"!N#!'];
|
|
9
|
-
// ATTRIBUTION: https://github.com/dougmoscrop/serverless-http
|
|
10
|
-
const http_1 = require("http");
|
|
11
|
-
const core_1 = require("../core");
|
|
12
|
-
const utils_1 = require("./utils");
|
|
13
|
-
const headerEnd = '\r\n\r\n';
|
|
14
|
-
const BODY = Symbol('Response body');
|
|
15
|
-
const HEADERS = Symbol('Response headers');
|
|
16
|
-
function addData(stream, data) {
|
|
17
|
-
if (Buffer.isBuffer(data) ||
|
|
18
|
-
typeof data === 'string' ||
|
|
19
|
-
data instanceof Uint8Array)
|
|
20
|
-
stream[BODY].push(Buffer.from(data));
|
|
21
|
-
else
|
|
22
|
-
throw new Error(`response.write() of unexpected type: ${typeof data}`);
|
|
23
|
-
}
|
|
24
|
-
addData.__type = [() => ServerlessResponse, 'stream', 'data', 'addData', 'PP7!2"PW&J2#"/$'];
|
|
25
|
-
const __ΩServerlessResponseProps = ['method', 'P&4!8M'];
|
|
26
|
-
exports.__ΩServerlessResponseProps = __ΩServerlessResponseProps;
|
|
27
|
-
/**
|
|
28
|
-
* The class that represents a response instance used to send to the framework and wait until the framework finishes processing the request.
|
|
29
|
-
* Once it's happens, we use the properties from this response to built the response to the cloud.
|
|
30
|
-
*
|
|
31
|
-
* @breadcrumb Network / ServerlessResponse
|
|
32
|
-
* @public
|
|
33
|
-
*/
|
|
34
|
-
class ServerlessResponse extends http_1.ServerResponse {
|
|
35
|
-
constructor({ method }) {
|
|
36
|
-
super({ method });
|
|
37
|
-
this[BODY] = [];
|
|
38
|
-
this[HEADERS] = {};
|
|
39
|
-
this.useChunkedEncodingByDefault = false;
|
|
40
|
-
this.chunkedEncoding = false;
|
|
41
|
-
this._header = '';
|
|
42
|
-
const socket = {
|
|
43
|
-
_writableState: {},
|
|
44
|
-
writable: true,
|
|
45
|
-
on: core_1.NO_OP,
|
|
46
|
-
removeListener: core_1.NO_OP,
|
|
47
|
-
destroy: core_1.NO_OP,
|
|
48
|
-
cork: core_1.NO_OP,
|
|
49
|
-
uncork: core_1.NO_OP,
|
|
50
|
-
write: __assignType((data, encoding, cb) => {
|
|
51
|
-
if (typeof encoding === 'function') {
|
|
52
|
-
cb = encoding;
|
|
53
|
-
encoding = null;
|
|
54
|
-
}
|
|
55
|
-
if (this._header === '' || this._wroteHeader)
|
|
56
|
-
addData(this, data);
|
|
57
|
-
else {
|
|
58
|
-
const string = (0, utils_1.getString)(data);
|
|
59
|
-
const index = string.indexOf(headerEnd);
|
|
60
|
-
if (index !== -1) {
|
|
61
|
-
const remainder = string.slice(index + headerEnd.length);
|
|
62
|
-
if (remainder)
|
|
63
|
-
addData(this, remainder);
|
|
64
|
-
this._wroteHeader = true;
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
if (typeof cb === 'function')
|
|
68
|
-
cb();
|
|
69
|
-
}, ['data', '', 'encoding', 'cb', 'PPW&J2!P&,P$/"J2#8P$/"2$8"/"']),
|
|
70
|
-
};
|
|
71
|
-
this.assignSocket(socket);
|
|
72
|
-
}
|
|
73
|
-
get headers() {
|
|
74
|
-
return this[HEADERS];
|
|
75
|
-
}
|
|
76
|
-
static from(res) {
|
|
77
|
-
const response = new ServerlessResponse({ method: res.method });
|
|
78
|
-
response.statusCode = res.statusCode || 0;
|
|
79
|
-
response[HEADERS] = res.headers;
|
|
80
|
-
response[BODY] = res.body ? [Buffer.from(res.body)] : [];
|
|
81
|
-
response.end();
|
|
82
|
-
return response;
|
|
83
|
-
}
|
|
84
|
-
static body(res) {
|
|
85
|
-
return Buffer.concat(res[BODY]);
|
|
86
|
-
}
|
|
87
|
-
static headers(res) {
|
|
88
|
-
const headers = res.getHeaders();
|
|
89
|
-
return Object.assign(headers, res[HEADERS]);
|
|
90
|
-
}
|
|
91
|
-
setHeader(key, value) {
|
|
92
|
-
if (this._wroteHeader)
|
|
93
|
-
this[HEADERS][key] = value;
|
|
94
|
-
else
|
|
95
|
-
super.setHeader(key, value);
|
|
96
|
-
}
|
|
97
|
-
writeHead(statusCode, statusMessage, obj) {
|
|
98
|
-
const headersObjOrArray = typeof statusMessage === 'string' ? obj : statusMessage;
|
|
99
|
-
const arrayHeaders = Array.isArray(headersObjOrArray)
|
|
100
|
-
? headersObjOrArray
|
|
101
|
-
: [headersObjOrArray || {}];
|
|
102
|
-
for (const headers of arrayHeaders) {
|
|
103
|
-
for (const name in headers) {
|
|
104
|
-
this.setHeader(name, headers[name]);
|
|
105
|
-
if (!this._wroteHeader) {
|
|
106
|
-
// we only need to initiate super.headers once
|
|
107
|
-
// writeHead will add the other headers itself
|
|
108
|
-
break;
|
|
109
|
-
}
|
|
110
|
-
}
|
|
111
|
-
}
|
|
112
|
-
return this.callNativeWriteHead(statusCode, statusMessage, obj);
|
|
113
|
-
}
|
|
114
|
-
/**
|
|
115
|
-
* I use ignore here because in nodejs 12.x, statusMessage can be string | OutgoingHttpHeaders
|
|
116
|
-
* But in nodejs \>=14.x, statusMessage can also be OutgoingHttpHeaders[]
|
|
117
|
-
* I take care of these cases above, but here I can't handle it well, so I give up
|
|
118
|
-
* nodejs 12.x ref: https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/node/v12/http.d.ts#L229
|
|
119
|
-
* nodejs 14.x ref: https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/node/v14/http.d.ts#L263
|
|
120
|
-
*/
|
|
121
|
-
callNativeWriteHead(statusCode, statusMessage, obj) {
|
|
122
|
-
return super.writeHead(statusCode, statusMessage, obj);
|
|
123
|
-
}
|
|
124
|
-
}
|
|
125
|
-
exports.ServerlessResponse = ServerlessResponse;
|
|
126
|
-
ServerlessResponse.__type = [() => http_1.ServerResponse, () => __ΩServerlessResponseProps, 'param0', 'constructor', '_header', () => __ΩRecord, '_headers', '_wroteHeader', () => BODY, () => __ΩRecord, () => HEADERS, 'res', 'from', () => ServerlessResponse, 'body', 'key', 'value', 'setHeader', 'statusCode', 'statusMessage', 'obj', 'writeHead', 'callNativeWriteHead', 'P7!Pn"2#"0$&3%""o\'8)3(8"F3)""o*#3+!P!2,"0-sPP7.2,!0/sP&20P\'&&F9J21"02P\'23P&""FJ248P""FJ258"06P\'23P&""FJ248P""FJ258!07<5'];
|
|
127
|
-
//# sourceMappingURL=response.js.map
|
|
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),response_exports={};__export(response_exports,{ServerlessResponse:()=>ServerlessResponse});module.exports=__toCommonJS(response_exports);var import_http=require("http"),import_core=require("../core"),import_utils=require("./utils");const headerEnd=`\r
|
|
2
|
+
\r
|
|
3
|
+
`,BODY=Symbol("Response body"),HEADERS=Symbol("Response headers");function addData(stream,data){if(Buffer.isBuffer(data)||typeof data=="string"||data instanceof Uint8Array)stream[BODY].push(Buffer.from(data));else throw new Error(`response.write() of unexpected type: ${typeof data}`)}const _ServerlessResponse=class extends import_http.ServerResponse{constructor({method}){super({method}),this[BODY]=[],this[HEADERS]={},this.useChunkedEncodingByDefault=!1,this.chunkedEncoding=!1,this._header="";const socket={_writableState:{},writable:!0,on:import_core.NO_OP,removeListener:import_core.NO_OP,destroy:import_core.NO_OP,cork:import_core.NO_OP,uncork:import_core.NO_OP,write:(data,encoding,cb)=>{if(typeof encoding=="function"&&(cb=encoding,encoding=null),this._header===""||this._wroteHeader)addData(this,data);else{const string=(0,import_utils.getString)(data),index=string.indexOf(headerEnd);if(index!==-1){const remainder=string.slice(index+headerEnd.length);remainder&&addData(this,remainder),this._wroteHeader=!0}}typeof cb=="function"&&cb()}};this.assignSocket(socket)}get headers(){return this[HEADERS]}static from(res){const response=new _ServerlessResponse({method:res.method});return response.statusCode=res.statusCode||0,response[HEADERS]=res.headers,response[BODY]=res.body?[Buffer.from(res.body)]:[],response.end(),response}static body(res){return Buffer.concat(res[BODY])}static headers(res){const headers=res.getHeaders();return Object.assign(headers,res[HEADERS])}setHeader(key,value){this._wroteHeader?this[HEADERS][key]=value:super.setHeader(key,value)}writeHead(statusCode,statusMessage,obj){const headersObjOrArray=typeof statusMessage=="string"?obj:statusMessage,arrayHeaders=Array.isArray(headersObjOrArray)?headersObjOrArray:[headersObjOrArray||{}];for(const headers of arrayHeaders)for(const name in headers)if(this.setHeader(name,headers[name]),!this._wroteHeader)break;return this.callNativeWriteHead(statusCode,statusMessage,obj)}callNativeWriteHead(statusCode,statusMessage,obj){return super.writeHead(statusCode,statusMessage,obj)}};let ServerlessResponse=_ServerlessResponse;
|
|
4
|
+
//# sourceMappingURL=response.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"response.js","
|
|
1
|
+
{"version":3,"file":"response.js","sources":["../../src/network/response.ts"],"sourcesContent":["// ATTRIBUTION: https://github.com/dougmoscrop/serverless-http\nimport { IncomingMessage, ServerResponse } from 'http';\nimport { Socket } from 'net';\nimport { NO_OP } from '../core';\nimport { getString } from './utils';\n\nconst headerEnd = '\\r\\n\\r\\n';\n\nconst BODY = Symbol('Response body');\nconst HEADERS = Symbol('Response headers');\n\nfunction addData(stream: ServerlessResponse, data: Uint8Array | string) {\n if (\n Buffer.isBuffer(data) ||\n typeof data === 'string' ||\n data instanceof Uint8Array\n )\n stream[BODY].push(Buffer.from(data));\n else throw new Error(`response.write() of unexpected type: ${typeof data}`);\n}\n\n/**\n * The properties to create a {@link ServerlessResponse}.\n *\n * @breadcrumb Network / ServerlessResponse\n * @public\n */\nexport interface ServerlessResponseProps {\n /**\n * The HTTP Method from request\n */\n method?: string;\n}\n\n/**\n * The class that represents a response instance used to send to the framework and wait until the framework finishes processing the request.\n * Once it's happens, we use the properties from this response to built the response to the cloud.\n *\n * @breadcrumb Network / ServerlessResponse\n * @public\n */\nexport class ServerlessResponse extends ServerResponse {\n constructor({ method }: ServerlessResponseProps) {\n super({ method } as any);\n\n this[BODY] = [];\n this[HEADERS] = {};\n\n this.useChunkedEncodingByDefault = false;\n this.chunkedEncoding = false;\n this._header = '';\n\n const socket: Partial<Socket> & { _writableState: any } = {\n _writableState: {},\n writable: true,\n on: NO_OP,\n removeListener: NO_OP,\n destroy: NO_OP,\n cork: NO_OP,\n uncork: NO_OP,\n write: (\n data: Uint8Array | string,\n encoding?: string | null | (() => void),\n cb?: () => void,\n ): any => {\n if (typeof encoding === 'function') {\n cb = encoding;\n encoding = null;\n }\n\n if (this._header === '' || this._wroteHeader) addData(this, data);\n else {\n const string = getString(data);\n const index = string.indexOf(headerEnd);\n\n if (index !== -1) {\n const remainder = string.slice(index + headerEnd.length);\n\n if (remainder) addData(this, remainder);\n\n this._wroteHeader = true;\n }\n }\n\n if (typeof cb === 'function') cb();\n },\n };\n\n this.assignSocket(socket as unknown as Socket);\n }\n\n _header: string;\n _headers?: Record<any, any>;\n _wroteHeader?: boolean;\n\n [BODY]: any[];\n [HEADERS]: Record<any, any>;\n\n get headers(): Record<any, any> {\n return this[HEADERS];\n }\n\n static from(res: IncomingMessage) {\n const response = new ServerlessResponse({ method: res.method });\n\n response.statusCode = res.statusCode || 0;\n response[HEADERS] = res.headers;\n response[BODY] = (res as any).body ? [Buffer.from((res as any).body)] : [];\n response.end();\n\n return response;\n }\n\n static body(res: ServerlessResponse): Buffer {\n return Buffer.concat(res[BODY]);\n }\n\n static headers(res: ServerlessResponse) {\n const headers = res.getHeaders();\n\n return Object.assign(headers, res[HEADERS]);\n }\n\n setHeader(key: string, value: number | string | readonly string[]): any {\n if (this._wroteHeader) this[HEADERS][key] = value;\n else super.setHeader(key, value);\n }\n\n writeHead(\n statusCode: number,\n statusMessage?: string | any | any[],\n obj?: any | any[],\n ): any {\n const headersObjOrArray =\n typeof statusMessage === 'string' ? obj : statusMessage;\n\n const arrayHeaders = Array.isArray(headersObjOrArray)\n ? headersObjOrArray\n : [headersObjOrArray || {}];\n\n for (const headers of arrayHeaders) {\n for (const name in headers) {\n this.setHeader(name, headers[name]!);\n\n if (!this._wroteHeader) {\n // we only need to initiate super.headers once\n // writeHead will add the other headers itself\n break;\n }\n }\n }\n\n return this.callNativeWriteHead(statusCode, statusMessage, obj);\n }\n\n /**\n * I use ignore here because in nodejs 12.x, statusMessage can be string | OutgoingHttpHeaders\n * But in nodejs \\>=14.x, statusMessage can also be OutgoingHttpHeaders[]\n * I take care of these cases above, but here I can't handle it well, so I give up\n * nodejs 12.x ref: https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/node/v12/http.d.ts#L229\n * nodejs 14.x ref: https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/node/v14/http.d.ts#L263\n */\n protected callNativeWriteHead(\n statusCode: number,\n statusMessage?: string | any | any[],\n obj?: any | any[],\n ): this {\n return super.writeHead(statusCode, statusMessage, obj);\n }\n}\n"],"names":[],"mappings":"ooBAAA,iBAAA,CAAA,EAAA,SAAA,iBAAA,CAAA,mBAAA,IAAA,kBAAA,CAAA,EAAA,OAAA,QAAA,aAAA,gBAAA,EACA,IAAgD,YAAA,QAAA,MAAA,EAE1B,YAAA,QAAA,SAAA,EACI,aAAA,QAAA,SAAA,EAE1B,MAAM,UAAY;AAAA;AAAA,EAEZ,KAAO,OAAO,eAAe,EAC7B,QAAU,OAAO,kBAAkB,EAEzC,SAAS,QAAQ,OAA4B,KAA2B,CACtE,GACE,OAAO,SAAS,IAAI,GACpB,OAAO,MAAS,UAChB,gBAAgB,WAEhB,OAAO,IAAI,EAAE,KAAK,OAAO,KAAK,IAAI,CAAC,MAChC,OAAM,IAAI,MAAM,wCAAwC,OAAO,MAAM,CAC5E,CAsBO,MAAM,oBAAN,cAAiC,YAAe,cAAA,CACrD,YAAY,CAAE,QAAmC,CACzC,MAAA,CAAE,OAAe,EAElB,KAAA,IAAI,EAAI,GACR,KAAA,OAAO,EAAI,GAEhB,KAAK,4BAA8B,GACnC,KAAK,gBAAkB,GACvB,KAAK,QAAU,GAEf,MAAM,OAAoD,CACxD,eAAgB,CAAC,EACjB,SAAU,GACV,GAAI,YAAA,MACJ,eAAgB,YAAA,MAChB,QAAS,YAAA,MACT,KAAM,YAAA,MACN,OAAQ,YAAA,MACR,MAAO,CACL,KACA,SACA,KACQ,CAMJ,GALA,OAAO,UAAa,aACjB,GAAA,SACM,SAAA,MAGT,KAAK,UAAY,IAAM,KAAK,aAAc,QAAQ,KAAM,IAAI,MAC3D,CACG,MAAA,UAAS,wBAAU,IAAI,EACvB,MAAQ,OAAO,QAAQ,SAAS,EAEtC,GAAI,QAAU,GAAI,CAChB,MAAM,UAAY,OAAO,MAAM,MAAQ,UAAU,MAAM,EAEnD,WAAW,QAAQ,KAAM,SAAS,EAEtC,KAAK,aAAe,IAIpB,OAAO,IAAO,YAAe,IACnC,CAAA,EAGF,KAAK,aAAa,MAA2B,CAC/C,CASA,IAAI,SAA4B,CAC9B,OAAO,KAAK,OAAO,CACrB,CAEA,OAAO,KAAK,IAAsB,CAChC,MAAM,SAAW,IAAI,oBAAmB,CAAE,OAAQ,IAAI,OAAQ,EAErD,gBAAA,WAAa,IAAI,YAAc,EAC/B,SAAA,OAAO,EAAI,IAAI,QACf,SAAA,IAAI,EAAK,IAAY,KAAO,CAAC,OAAO,KAAM,IAAY,IAAI,CAAC,EAAI,CAAA,EACxE,SAAS,IAAI,EAEN,QACT,CAEA,OAAO,KAAK,IAAiC,CAC3C,OAAO,OAAO,OAAO,IAAI,IAAI,CAAC,CAChC,CAEA,OAAO,QAAQ,IAAyB,CAChC,MAAA,QAAU,IAAI,aAEpB,OAAO,OAAO,OAAO,QAAS,IAAI,OAAO,CAAC,CAC5C,CAEA,UAAU,IAAa,MAAiD,CAClE,KAAK,aAAmB,KAAA,OAAO,EAAE,GAAG,EAAI,MACjC,MAAA,UAAU,IAAK,KAAK,CACjC,CAEA,UACE,WACA,cACA,IACK,CACL,MAAM,kBACJ,OAAO,eAAkB,SAAW,IAAM,cAEtC,aAAe,MAAM,QAAQ,iBAAiB,EAChD,kBACA,CAAC,mBAAqB,CAAA,CAAE,EAE5B,UAAW,WAAW,aACpB,UAAW,QAAQ,QAGb,GAFJ,KAAK,UAAU,KAAM,QAAQ,IAAI,CAAE,EAE/B,CAAC,KAAK,aAGR,MAKN,OAAO,KAAK,oBAAoB,WAAY,cAAe,GAAG,CAChE,CASU,oBACR,WACA,cACA,IACM,CACN,OAAO,MAAM,UAAU,WAAY,cAAe,GAAG,CACvD,CACF,EAhIO,IAAM,mBAAN"}
|
package/lib/network/utils.d.ts
CHANGED
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
/**
|
|
3
3
|
* Get the data from a buffer, string, or Uint8Array
|
|
4
4
|
*
|
|
5
|
+
* @breadcrumb Network
|
|
5
6
|
* @param data - The data that was written inside the stream
|
|
6
7
|
*/
|
|
7
8
|
export declare function getString(data: Buffer | string | unknown): string;
|
|
9
|
+
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/network/utils.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;AACH,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,UAKxD"}
|
package/lib/network/utils.js
CHANGED
|
@@ -1,21 +1,2 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
exports.getString = void 0;
|
|
4
|
-
/**
|
|
5
|
-
* Get the data from a buffer, string, or Uint8Array
|
|
6
|
-
*
|
|
7
|
-
* @param data - The data that was written inside the stream
|
|
8
|
-
*/
|
|
9
|
-
function getString(data) {
|
|
10
|
-
if (Buffer.isBuffer(data))
|
|
11
|
-
return data.toString('utf8');
|
|
12
|
-
else if (typeof data === 'string')
|
|
13
|
-
return data;
|
|
14
|
-
else if (data instanceof Uint8Array)
|
|
15
|
-
return new TextDecoder().decode(data);
|
|
16
|
-
else
|
|
17
|
-
throw new Error(`response.write() of unexpected type: ${typeof data}`);
|
|
18
|
-
}
|
|
19
|
-
exports.getString = getString;
|
|
20
|
-
getString.__type = ['data', 'getString', 'PP!&#J2!"/"'];
|
|
21
|
-
//# sourceMappingURL=utils.js.map
|
|
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),utils_exports={};__export(utils_exports,{getString:()=>getString});module.exports=__toCommonJS(utils_exports);function getString(data){if(Buffer.isBuffer(data))return data.toString("utf8");if(typeof data=="string")return data;if(data instanceof Uint8Array)return new TextDecoder().decode(data);throw new Error(`response.write() of unexpected type: ${typeof data}`)}
|
|
2
|
+
//# sourceMappingURL=utils.js.map
|
package/lib/network/utils.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","
|
|
1
|
+
{"version":3,"file":"utils.js","sources":["../../src/network/utils.ts"],"sourcesContent":["/**\n * Get the data from a buffer, string, or Uint8Array\n *\n * @breadcrumb Network\n * @param data - The data that was written inside the stream\n */\nexport function getString(data: Buffer | string | unknown) {\n if (Buffer.isBuffer(data)) return data.toString('utf8');\n else if (typeof data === 'string') return data;\n else if (data instanceof Uint8Array) return new TextDecoder().decode(data);\n else throw new Error(`response.write() of unexpected type: ${typeof data}`);\n}\n"],"names":[],"mappings":"ooBAAA,cAAA,CAAA,EAAA,SAAA,cAAA,CAAA,UAAA,IAAA,SAAA,CAAA,EAAA,OAAA,QAAA,aAAA,aAAA,EAMO,SAAS,UAAU,KAAiC,CACrD,GAAA,OAAO,SAAS,IAAI,EAAU,OAAA,KAAK,SAAS,MAAM,EAAA,GAC7C,OAAO,MAAS,SAAiB,OAAA,KAAA,GACjC,gBAAgB,WAAY,OAAO,IAAI,YAAA,EAAc,OAAO,IAAI,EACpE,MAAM,IAAI,MAAM,wCAAwC,OAAO,MAAM,CAC5E"}
|
|
@@ -16,3 +16,4 @@ export declare class AwsContextResolver<TEvent, TCallback, TResponse> implements
|
|
|
16
16
|
*/
|
|
17
17
|
createResolver({ context, event, log, respondWithErrors, adapter, }: ResolverProps<any, Context, any, any>): Resolver<any, void>;
|
|
18
18
|
}
|
|
19
|
+
//# sourceMappingURL=aws-context.resolver.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"aws-context.resolver.d.ts","sourceRoot":"","sources":["../../../src/resolvers/aws-context/aws-context.resolver.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAC1C,OAAO,EAEL,QAAQ,EACR,gBAAgB,EAChB,aAAa,EACd,MAAM,iBAAiB,CAAC;AAIzB;;;;;;;;;GASG;AACH,qBAAa,kBAAkB,CAAC,MAAM,EAAE,SAAS,EAAE,SAAS,CAC1D,YAAW,gBAAgB,CAAC,MAAM,EAAE,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,IAAI,CAAC;IAExE;;OAEG;IACI,cAAc,CAAC,EACpB,OAAO,EACP,KAAK,EACL,GAAG,EACH,iBAAiB,EACjB,OAAO,GACR,EAAE,aAAa,CAAC,GAAG,EAAE,OAAO,EAAE,GAAG,EAAE,GAAG,CAAC,GAAG,QAAQ,CAAC,GAAG,EAAE,IAAI,CAAC;CA6C/D"}
|
|
@@ -1,59 +1,2 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
exports.AwsContextResolver = void 0;
|
|
4
|
-
const { __ΩResolverProps } = require('../../contracts');
|
|
5
|
-
const { __ΩResolver } = require('../../contracts');
|
|
6
|
-
function __assignType(fn, args) {
|
|
7
|
-
fn.__type = args;
|
|
8
|
-
return fn;
|
|
9
|
-
}
|
|
10
|
-
//#endregion
|
|
11
|
-
/**
|
|
12
|
-
* The class that implements the resolver by using the AWS Context object.
|
|
13
|
-
*
|
|
14
|
-
* @remarks To use this resolver, you MUST leave `{@link https://docs.aws.amazon.com/lambda/latest/dg/nodejs-context.html | callbackWaitsForEmptyEventLoop}` as true, otherwise, AWS will not wait for this resolver to resolve.
|
|
15
|
-
*
|
|
16
|
-
* @deprecated From the AWS Documentation, describing the functions used in this resolver: Functions for compatibility with earlier Node.js Runtime v0.10.42. No longer documented, so they are deprecated, but they still work as of the 12.x runtime, so they are not removed from the types.
|
|
17
|
-
*
|
|
18
|
-
* @breadcrumb Resolvers / AwsContextResolver
|
|
19
|
-
* @public
|
|
20
|
-
*/
|
|
21
|
-
class AwsContextResolver {
|
|
22
|
-
/**
|
|
23
|
-
* {@inheritDoc}
|
|
24
|
-
*/
|
|
25
|
-
createResolver({ context, event, log, respondWithErrors, adapter, }) {
|
|
26
|
-
if (!context) {
|
|
27
|
-
throw new Error('Could not figure out how to create the resolver because the "context" argument was not sent.');
|
|
28
|
-
}
|
|
29
|
-
if (!context.succeed) {
|
|
30
|
-
throw new Error('Could not figure out how to create the resolver because the "context" argument didn\'t have the "succeed" function.');
|
|
31
|
-
}
|
|
32
|
-
if (!context.fail) {
|
|
33
|
-
throw new Error('Could not figure out how to create the resolver because the "context" argument didn\'t have the "fail" function.');
|
|
34
|
-
}
|
|
35
|
-
const delegatedResolver = {
|
|
36
|
-
succeed: __assignType(response => context.succeed(response), ['response', '', 'P"2!"/"']),
|
|
37
|
-
fail: __assignType(error => context.fail(error), ['error', '', 'P"2!"/"']),
|
|
38
|
-
};
|
|
39
|
-
return {
|
|
40
|
-
run: __assignType(task => {
|
|
41
|
-
task()
|
|
42
|
-
.then(__assignType(response => delegatedResolver.succeed(response), ['response', '', 'P"2!"/"']))
|
|
43
|
-
.catch(__assignType(error => {
|
|
44
|
-
log.error('SERVERLESS_ADAPTER:RESPOND_TO_EVENT_SOURCE_WITH_ERROR', error);
|
|
45
|
-
adapter.onErrorWhileForwarding({
|
|
46
|
-
delegatedResolver,
|
|
47
|
-
error,
|
|
48
|
-
log,
|
|
49
|
-
event,
|
|
50
|
-
respondWithErrors,
|
|
51
|
-
});
|
|
52
|
-
}, ['error', '', 'P"2!"/"']));
|
|
53
|
-
}, ['task', '', 'P"2!"/"']),
|
|
54
|
-
};
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
exports.AwsContextResolver = AwsContextResolver;
|
|
58
|
-
AwsContextResolver.__type = ['TEvent', 'TCallback', 'TResponse', () => __ΩResolverProps, 'param0', () => __ΩResolver, 'createResolver', 'b!b"b#P""""o$%2%"$o�\'5e!!"e!"e!#$6&'];
|
|
59
|
-
//# sourceMappingURL=aws-context.resolver.js.map
|
|
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),aws_context_resolver_exports={};__export(aws_context_resolver_exports,{AwsContextResolver:()=>AwsContextResolver});module.exports=__toCommonJS(aws_context_resolver_exports);class AwsContextResolver{createResolver({context,event,log,respondWithErrors,adapter}){if(!context)throw new Error('Could not figure out how to create the resolver because the "context" argument was not sent.');if(!context.succeed)throw new Error(`Could not figure out how to create the resolver because the "context" argument didn't have the "succeed" function.`);if(!context.fail)throw new Error(`Could not figure out how to create the resolver because the "context" argument didn't have the "fail" function.`);const delegatedResolver={succeed:response=>context.succeed(response),fail:error=>context.fail(error)};return{run:task=>{task().then(response=>delegatedResolver.succeed(response)).catch(error=>{log.error("SERVERLESS_ADAPTER:RESPOND_TO_EVENT_SOURCE_WITH_ERROR",error),adapter.onErrorWhileForwarding({delegatedResolver,error,log,event,respondWithErrors})})}}}}
|
|
2
|
+
//# sourceMappingURL=aws-context.resolver.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"aws-context.resolver.js","
|
|
1
|
+
{"version":3,"file":"aws-context.resolver.js","sources":["../../../src/resolvers/aws-context/aws-context.resolver.ts"],"sourcesContent":["//#region Imports\n\nimport type { Context } from 'aws-lambda';\nimport {\n DelegatedResolver,\n Resolver,\n ResolverContract,\n ResolverProps,\n} from '../../contracts';\n\n//#endregion\n\n/**\n * The class that implements the resolver by using the AWS Context object.\n *\n * @remarks To use this resolver, you MUST leave `{@link https://docs.aws.amazon.com/lambda/latest/dg/nodejs-context.html | callbackWaitsForEmptyEventLoop}` as true, otherwise, AWS will not wait for this resolver to resolve.\n *\n * @deprecated From the AWS Documentation, describing the functions used in this resolver: Functions for compatibility with earlier Node.js Runtime v0.10.42. No longer documented, so they are deprecated, but they still work as of the 12.x runtime, so they are not removed from the types.\n *\n * @breadcrumb Resolvers / AwsContextResolver\n * @public\n */\nexport class AwsContextResolver<TEvent, TCallback, TResponse>\n implements ResolverContract<TEvent, Context, TCallback, TResponse, void>\n{\n /**\n * {@inheritDoc}\n */\n public createResolver({\n context,\n event,\n log,\n respondWithErrors,\n adapter,\n }: ResolverProps<any, Context, any, any>): Resolver<any, void> {\n if (!context) {\n throw new Error(\n 'Could not figure out how to create the resolver because the \"context\" argument was not sent.',\n );\n }\n\n if (!context.succeed) {\n throw new Error(\n 'Could not figure out how to create the resolver because the \"context\" argument didn\\'t have the \"succeed\" function.',\n );\n }\n\n if (!context.fail) {\n throw new Error(\n 'Could not figure out how to create the resolver because the \"context\" argument didn\\'t have the \"fail\" function.',\n );\n }\n\n const delegatedResolver: DelegatedResolver<any> = {\n succeed: response => context.succeed(response),\n fail: error => context.fail(error),\n };\n\n return {\n run: task => {\n task()\n .then(response => delegatedResolver.succeed(response))\n .catch(error => {\n log.error(\n 'SERVERLESS_ADAPTER:RESPOND_TO_EVENT_SOURCE_WITH_ERROR',\n error,\n );\n\n adapter.onErrorWhileForwarding({\n delegatedResolver,\n error,\n log,\n event,\n respondWithErrors,\n });\n });\n },\n };\n }\n}\n"],"names":[],"mappings":"ooBAAA,6BAAA,CAAA,EAAA,SAAA,6BAAA,CAAA,mBAAA,IAAA,kBAAA,CAAA,EAAA,OAAA,QAAA,aAAA,4BAAA,EAsBO,MAAM,kBAEb,CAIS,eAAe,CACpB,QACA,MACA,IACA,kBACA,OAAA,EAC6D,CAC7D,GAAI,CAAC,QACH,MAAM,IAAI,MACR,8FAAA,EAIA,GAAA,CAAC,QAAQ,QACX,MAAM,IAAI,MACR,oHAAA,EAIA,GAAA,CAAC,QAAQ,KACX,MAAM,IAAI,MACR,iHAAA,EAIJ,MAAM,kBAA4C,CAChD,QAAS,UAAY,QAAQ,QAAQ,QAAQ,EAC7C,KAAM,OAAS,QAAQ,KAAK,KAAK,CAAA,EAG5B,MAAA,CACL,IAAa,MAAA,CACN,OACF,KAAiB,UAAA,kBAAkB,QAAQ,QAAQ,CAAC,EACpD,MAAe,OAAA,CACV,IAAA,MACF,wDACA,KAAA,EAGF,QAAQ,uBAAuB,CAC7B,kBACA,MACA,IACA,MACA,iBAAA,CACD,CAAA,CACF,CACL,CAAA,CAEJ,CACF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/resolvers/aws-context/index.ts"],"names":[],"mappings":"AAAA,cAAc,wBAAwB,CAAC"}
|