@h4ad/serverless-adapter 3.1.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/README.md +0 -5
- package/package.json +610 -58
- 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
package/lib/core/event-body.js
DELETED
|
@@ -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),event_body_exports={};__export(event_body_exports,{getEventBodyAsBuffer:()=>getEventBodyAsBuffer});module.exports=__toCommonJS(event_body_exports);function getEventBodyAsBuffer(body,isBase64Encoded){const encoding=isBase64Encoded?"base64":"utf8",buffer=Buffer.from(body,encoding),contentLength=Buffer.byteLength(buffer,encoding);return[buffer,contentLength]}
|
|
2
|
-
//# sourceMappingURL=event-body.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"event-body.js","sources":["../../src/core/event-body.ts"],"sourcesContent":["/**\n * Get the event body as buffer from body string with content length\n *\n * @example\n * ```typescript\n * const body = '{}';\n * const [buffer, contentLength] = getEventBodyAsBuffer(body, false);\n * console.log(buffer);\n * // <Buffer 7b 7d>\n * console.log(contentLength);\n * // 2\n * ```\n *\n * @param body - The body string that can be encoded or not\n * @param isBase64Encoded - Tells if body string is encoded in base64\n *\n * @breadcrumb Core\n * @public\n */\nexport function getEventBodyAsBuffer(\n body: string,\n isBase64Encoded: boolean,\n): [body: Buffer, contentLength: number] {\n const encoding: BufferEncoding = isBase64Encoded ? 'base64' : 'utf8';\n\n const buffer = Buffer.from(body, encoding);\n const contentLength = Buffer.byteLength(buffer, encoding);\n\n return [buffer, contentLength];\n}\n"],"names":[],"mappings":"ooBAAA,mBAAA,CAAA,EAAA,SAAA,mBAAA,CAAA,qBAAA,IAAA,oBAAA,CAAA,EAAA,OAAA,QAAA,aAAA,kBAAA,EAmBO,SAAS,qBACd,KACA,gBACuC,CACjC,MAAA,SAA2B,gBAAkB,SAAW,OAExD,OAAS,OAAO,KAAK,KAAM,QAAQ,EACnC,cAAgB,OAAO,WAAW,OAAQ,QAAQ,EAEjD,MAAA,CAAC,OAAQ,aAAa,CAC/B"}
|
package/lib/core/headers.d.ts
DELETED
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
import { BothValueHeaders } from '../@types';
|
|
2
|
-
/**
|
|
3
|
-
* Transform a header map and make sure the value is not an array
|
|
4
|
-
*
|
|
5
|
-
* @example
|
|
6
|
-
* ```typescript
|
|
7
|
-
* const headers = { 'accept-encoding': 'gzip', 'accept-language': ['en-US', 'en;q=0.9'] };
|
|
8
|
-
* const flattenedHeaders = getFlattenedHeadersMap(headers, ',', true);
|
|
9
|
-
* console.log(flattenedHeaders);
|
|
10
|
-
* // { 'accept-encoding': 'gzip', 'accept-language': 'en-US,en;q=0.9' }
|
|
11
|
-
* ```
|
|
12
|
-
*
|
|
13
|
-
* @param headersMap - The initial headers
|
|
14
|
-
* @param separator - The separator used when we join the array of header's value
|
|
15
|
-
* @param lowerCaseKey - Should put all keys in lowercase
|
|
16
|
-
*
|
|
17
|
-
* @breadcrumb Core / Headers
|
|
18
|
-
* @public
|
|
19
|
-
*/
|
|
20
|
-
export declare function getFlattenedHeadersMap(headersMap: BothValueHeaders, separator?: string, lowerCaseKey?: boolean): Record<string, string>;
|
|
21
|
-
/**
|
|
22
|
-
* Transforms a header map into a multi-value map header.
|
|
23
|
-
*
|
|
24
|
-
* @example
|
|
25
|
-
* ```typescript
|
|
26
|
-
* const headers = { 'accept-encoding': 'gzip', 'connection': ['keep-alive'] };
|
|
27
|
-
* const multiValueHeaders = getMultiValueHeadersMap(headers);
|
|
28
|
-
* console.log(multiValueHeaders);
|
|
29
|
-
* // { 'accept-encoding': ['gzip'], 'connection': ['keep-alive'] }
|
|
30
|
-
* ```
|
|
31
|
-
*
|
|
32
|
-
* @param headersMap - The initial headers
|
|
33
|
-
*
|
|
34
|
-
* @breadcrumb Core / Headers
|
|
35
|
-
* @public
|
|
36
|
-
*/
|
|
37
|
-
export declare function getMultiValueHeadersMap(headersMap: BothValueHeaders): Record<string, string[]>;
|
|
38
|
-
/**
|
|
39
|
-
* The wrapper that holds the information about single value headers and cookies
|
|
40
|
-
*
|
|
41
|
-
* @breadcrumb Core / Headers
|
|
42
|
-
* @public
|
|
43
|
-
*/
|
|
44
|
-
export type FlattenedHeadersAndCookies = {
|
|
45
|
-
/**
|
|
46
|
-
* Just the single value headers
|
|
47
|
-
*/
|
|
48
|
-
headers: Record<string, string>;
|
|
49
|
-
/**
|
|
50
|
-
* The list of cookies
|
|
51
|
-
*/
|
|
52
|
-
cookies: string[];
|
|
53
|
-
};
|
|
54
|
-
/**
|
|
55
|
-
* Transforms a header map into a single value headers and cookies
|
|
56
|
-
*
|
|
57
|
-
* @param headersMap - The initial headers
|
|
58
|
-
*
|
|
59
|
-
* @breadcrumb Core / Headers
|
|
60
|
-
* @public
|
|
61
|
-
*/
|
|
62
|
-
export declare function getFlattenedHeadersMapAndCookies(headersMap: BothValueHeaders): FlattenedHeadersAndCookies;
|
|
63
|
-
/**
|
|
64
|
-
* Parse HTTP Raw Headers
|
|
65
|
-
* Attribution to {@link https://github.com/kesla/parse-headers/blob/master/parse-headers.js}
|
|
66
|
-
*
|
|
67
|
-
* @param headers - The raw headers
|
|
68
|
-
*
|
|
69
|
-
* @breadcrumb Core / Headers
|
|
70
|
-
* @public
|
|
71
|
-
*/
|
|
72
|
-
export declare function parseHeaders(headers: string): Record<string, string | string[]>;
|
|
73
|
-
//# sourceMappingURL=headers.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"headers.d.ts","sourceRoot":"","sources":["../../src/core/headers.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAI7C;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,sBAAsB,CACpC,UAAU,EAAE,gBAAgB,EAC5B,SAAS,GAAE,MAAY,EACvB,YAAY,GAAE,OAAe,GAC5B,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAUxB;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,uBAAuB,CACrC,UAAU,EAAE,gBAAgB,GAC3B,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAU1B;AAED;;;;;GAKG;AACH,MAAM,MAAM,0BAA0B,GAAG;IACvC;;OAEG;IACH,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAEhC;;OAEG;IACH,OAAO,EAAE,MAAM,EAAE,CAAC;CACnB,CAAC;AAEF;;;;;;;GAOG;AACH,wBAAgB,gCAAgC,CAC9C,UAAU,EAAE,gBAAgB,GAC3B,0BAA0B,CAuB5B;AAED;;;;;;;;GAQG;AACH,wBAAgB,YAAY,CAC1B,OAAO,EAAE,MAAM,GACd,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC,CAkBnC"}
|
package/lib/core/headers.js
DELETED
|
@@ -1,3 +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),headers_exports={};__export(headers_exports,{getFlattenedHeadersMap:()=>getFlattenedHeadersMap,getFlattenedHeadersMapAndCookies:()=>getFlattenedHeadersMapAndCookies,getMultiValueHeadersMap:()=>getMultiValueHeadersMap,parseHeaders:()=>parseHeaders});module.exports=__toCommonJS(headers_exports);function getFlattenedHeadersMap(headersMap,separator=",",lowerCaseKey=!1){return Object.keys(headersMap).reduce((acc,headerKey)=>{const newKey=lowerCaseKey?headerKey.toLowerCase():headerKey,headerValue=headersMap[headerKey];return Array.isArray(headerValue)?acc[newKey]=headerValue.join(separator):acc[newKey]=(headerValue??"")+"",acc},{})}function getMultiValueHeadersMap(headersMap){return Object.keys(headersMap).reduce((acc,headerKey)=>{const headerValue=headersMap[headerKey];return acc[headerKey.toLowerCase()]=Array.isArray(headerValue)?headerValue.map(String):[String(headerValue)],acc},{})}function getFlattenedHeadersMapAndCookies(headersMap){return Object.keys(headersMap).reduce((acc,headerKey)=>{const headerValue=headersMap[headerKey],lowerHeaderKey=headerKey.toLowerCase();return Array.isArray(headerValue)?lowerHeaderKey!=="set-cookie"?acc.headers[headerKey]=headerValue.join(","):acc.cookies.push(...headerValue):lowerHeaderKey==="set-cookie"&&headerValue!==void 0?acc.cookies.push(headerValue??""):acc.headers[headerKey]=String(headerValue??""),acc},{cookies:[],headers:{}})}function parseHeaders(headers){if(!headers)return{};const result={},headersArr=headers.trim().split(`
|
|
2
|
-
`);for(let i=0;i<headersArr.length;i++){const row=headersArr[i],index=row.indexOf(":"),key=row.slice(0,index).trim().toLowerCase(),value=row.slice(index+1).trim();typeof result[key]>"u"?result[key]=value:Array.isArray(result[key])?result[key].push(value):result[key]=[result[key],value]}return result}
|
|
3
|
-
//# sourceMappingURL=headers.js.map
|
package/lib/core/headers.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"headers.js","sources":["../../src/core/headers.ts"],"sourcesContent":["//#region Imports\n\nimport { BothValueHeaders } from '../@types';\n\n//#endregion\n\n/**\n * Transform a header map and make sure the value is not an array\n *\n * @example\n * ```typescript\n * const headers = { 'accept-encoding': 'gzip', 'accept-language': ['en-US', 'en;q=0.9'] };\n * const flattenedHeaders = getFlattenedHeadersMap(headers, ',', true);\n * console.log(flattenedHeaders);\n * // { 'accept-encoding': 'gzip', 'accept-language': 'en-US,en;q=0.9' }\n * ```\n *\n * @param headersMap - The initial headers\n * @param separator - The separator used when we join the array of header's value\n * @param lowerCaseKey - Should put all keys in lowercase\n *\n * @breadcrumb Core / Headers\n * @public\n */\nexport function getFlattenedHeadersMap(\n headersMap: BothValueHeaders,\n separator: string = ',',\n lowerCaseKey: boolean = false,\n): Record<string, string> {\n return Object.keys(headersMap).reduce((acc, headerKey) => {\n const newKey = lowerCaseKey ? headerKey.toLowerCase() : headerKey;\n const headerValue = headersMap[headerKey];\n\n if (Array.isArray(headerValue)) acc[newKey] = headerValue.join(separator);\n else acc[newKey] = (headerValue ?? '') + '';\n\n return acc;\n }, {});\n}\n\n/**\n * Transforms a header map into a multi-value map header.\n *\n * @example\n * ```typescript\n * const headers = { 'accept-encoding': 'gzip', 'connection': ['keep-alive'] };\n * const multiValueHeaders = getMultiValueHeadersMap(headers);\n * console.log(multiValueHeaders);\n * // { 'accept-encoding': ['gzip'], 'connection': ['keep-alive'] }\n * ```\n *\n * @param headersMap - The initial headers\n *\n * @breadcrumb Core / Headers\n * @public\n */\nexport function getMultiValueHeadersMap(\n headersMap: BothValueHeaders,\n): Record<string, string[]> {\n return Object.keys(headersMap).reduce((acc, headerKey) => {\n const headerValue = headersMap[headerKey];\n\n acc[headerKey.toLowerCase()] = Array.isArray(headerValue)\n ? headerValue.map(String)\n : [String(headerValue)];\n\n return acc;\n }, {});\n}\n\n/**\n * The wrapper that holds the information about single value headers and cookies\n *\n * @breadcrumb Core / Headers\n * @public\n */\nexport type FlattenedHeadersAndCookies = {\n /**\n * Just the single value headers\n */\n headers: Record<string, string>;\n\n /**\n * The list of cookies\n */\n cookies: string[];\n};\n\n/**\n * Transforms a header map into a single value headers and cookies\n *\n * @param headersMap - The initial headers\n *\n * @breadcrumb Core / Headers\n * @public\n */\nexport function getFlattenedHeadersMapAndCookies(\n headersMap: BothValueHeaders,\n): FlattenedHeadersAndCookies {\n return Object.keys(headersMap).reduce(\n (acc, headerKey) => {\n const headerValue = headersMap[headerKey];\n const lowerHeaderKey = headerKey.toLowerCase();\n\n if (Array.isArray(headerValue)) {\n if (lowerHeaderKey !== 'set-cookie')\n acc.headers[headerKey] = headerValue.join(',');\n else acc.cookies.push(...headerValue);\n } else {\n if (lowerHeaderKey === 'set-cookie' && headerValue !== undefined)\n acc.cookies.push(headerValue ?? '');\n else acc.headers[headerKey] = String(headerValue ?? '');\n }\n\n return acc;\n },\n {\n cookies: [],\n headers: {},\n } as FlattenedHeadersAndCookies,\n );\n}\n\n/**\n * Parse HTTP Raw Headers\n * Attribution to {@link https://github.com/kesla/parse-headers/blob/master/parse-headers.js}\n *\n * @param headers - The raw headers\n *\n * @breadcrumb Core / Headers\n * @public\n */\nexport function parseHeaders(\n headers: string,\n): Record<string, string | string[]> {\n if (!headers) return {};\n\n const result = {};\n const headersArr = headers.trim().split('\\n');\n\n for (let i = 0; i < headersArr.length; i++) {\n const row = headersArr[i];\n const index = row.indexOf(':');\n const key = row.slice(0, index).trim().toLowerCase();\n const value = row.slice(index + 1).trim();\n\n if (typeof result[key] === 'undefined') result[key] = value;\n else if (Array.isArray(result[key])) result[key].push(value);\n else result[key] = [result[key], value];\n }\n\n return result;\n}\n"],"names":[],"mappings":"ooBAAA,gBAAA,CAAA,EAAA,SAAA,gBAAA,CAAA,uBAAA,IAAA,uBAAA,iCAAA,IAAA,iCAAA,wBAAA,IAAA,wBAAA,aAAA,IAAA,YAAA,CAAA,EAAA,OAAA,QAAA,aAAA,eAAA,EAwBO,SAAS,uBACd,WACA,UAAoB,IACpB,aAAwB,GACA,CACxB,OAAO,OAAO,KAAK,UAAU,EAAE,OAAO,CAAC,IAAK,YAAc,CACxD,MAAM,OAAS,aAAe,UAAU,YAAA,EAAgB,UAClD,YAAc,WAAW,SAAS,EAEpC,OAAA,MAAM,QAAQ,WAAW,EAAG,IAAI,MAAM,EAAI,YAAY,KAAK,SAAS,EAC/D,IAAA,MAAM,GAAK,aAAe,IAAM,GAElC,GACT,EAAG,CAAE,CAAA,CACP,CAkBO,SAAS,wBACd,WAC0B,CAC1B,OAAO,OAAO,KAAK,UAAU,EAAE,OAAO,CAAC,IAAK,YAAc,CAClD,MAAA,YAAc,WAAW,SAAS,EAExC,WAAI,UAAU,YAAA,CAAa,EAAI,MAAM,QAAQ,WAAW,EACpD,YAAY,IAAI,MAAM,EACtB,CAAC,OAAO,WAAW,CAAC,EAEjB,GACT,EAAG,CAAE,CAAA,CACP,CA4BO,SAAS,iCACd,WAC4B,CACrB,OAAA,OAAO,KAAK,UAAU,EAAE,OAC7B,CAAC,IAAK,YAAc,CACZ,MAAA,YAAc,WAAW,SAAS,EAClC,eAAiB,UAAU,cAE7B,OAAA,MAAM,QAAQ,WAAW,EACvB,iBAAmB,aACrB,IAAI,QAAQ,SAAS,EAAI,YAAY,KAAK,GAAG,EACtC,IAAA,QAAQ,KAAK,GAAG,WAAW,EAEhC,iBAAmB,cAAgB,cAAgB,OACjD,IAAA,QAAQ,KAAK,aAAe,EAAE,EAC/B,IAAI,QAAQ,SAAS,EAAI,OAAO,aAAe,EAAE,EAGjD,GACT,EACA,CACE,QAAS,CAAC,EACV,QAAS,CAAC,CACZ,CAAA,CAEJ,CAWO,SAAS,aACd,QACmC,CACnC,GAAI,CAAC,QAAS,MAAO,GAErB,MAAM,OAAS,CAAA,EACT,WAAa,QAAQ,KAAK,EAAE,MAAM;AAAA,CAAI,EAE5C,QAAS,EAAI,EAAG,EAAI,WAAW,OAAQ,IAAK,CACpC,MAAA,IAAM,WAAW,CAAC,EAClB,MAAQ,IAAI,QAAQ,GAAG,EACvB,IAAM,IAAI,MAAM,EAAG,KAAK,EAAE,OAAO,cACjC,MAAQ,IAAI,MAAM,MAAQ,CAAC,EAAE,OAE/B,OAAO,OAAO,GAAG,EAAM,IAAa,OAAO,GAAG,EAAI,MAC7C,MAAM,QAAQ,OAAO,GAAG,CAAC,EAAU,OAAA,GAAG,EAAE,KAAK,KAAK,EACtD,OAAO,GAAG,EAAI,CAAC,OAAO,GAAG,EAAG,KAAK,EAGjC,OAAA,MACT"}
|
package/lib/core/index.d.ts
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
export * from './base-handler';
|
|
2
|
-
export * from './constants';
|
|
3
|
-
export * from './current-invoke';
|
|
4
|
-
export * from './event-body';
|
|
5
|
-
export * from './headers';
|
|
6
|
-
export * from './is-binary';
|
|
7
|
-
export * from './logger';
|
|
8
|
-
export * from './no-op';
|
|
9
|
-
export * from './optional';
|
|
10
|
-
export * from './path';
|
|
11
|
-
export * from './stream';
|
|
12
|
-
//# sourceMappingURL=index.d.ts.map
|
package/lib/core/index.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/core/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,aAAa,CAAC;AAC5B,cAAc,kBAAkB,CAAC;AACjC,cAAc,cAAc,CAAC;AAC7B,cAAc,WAAW,CAAC;AAC1B,cAAc,aAAa,CAAC;AAC5B,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,YAAY,CAAC;AAC3B,cAAc,QAAQ,CAAC;AACvB,cAAc,UAAU,CAAC"}
|
package/lib/core/index.js
DELETED
|
@@ -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),core_exports={};module.exports=__toCommonJS(core_exports);__reExport(core_exports,require("./base-handler"),module.exports);__reExport(core_exports,require("./constants"),module.exports);__reExport(core_exports,require("./current-invoke"),module.exports);__reExport(core_exports,require("./event-body"),module.exports);__reExport(core_exports,require("./headers"),module.exports);__reExport(core_exports,require("./is-binary"),module.exports);__reExport(core_exports,require("./logger"),module.exports);__reExport(core_exports,require("./no-op"),module.exports);__reExport(core_exports,require("./optional"),module.exports);__reExport(core_exports,require("./path"),module.exports);__reExport(core_exports,require("./stream"),module.exports);
|
|
2
|
-
//# sourceMappingURL=index.js.map
|
package/lib/core/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../src/core/index.ts"],"sourcesContent":["export * from './base-handler';\nexport * from './constants';\nexport * from './current-invoke';\nexport * from './event-body';\nexport * from './headers';\nexport * from './is-binary';\nexport * from './logger';\nexport * from './no-op';\nexport * from './optional';\nexport * from './path';\nexport * from './stream';\n"],"names":[],"mappings":"kqBAAA,aAAA,CAAA,EAAA,OAAA,QAAA,aAAA,YAAA,EAAA,WAAA,aAAc,QAAd,gBAAA,EAAA,OAAA,OAAA,EACA,WAAA,aAAc,QADd,aAAA,EAAA,OAAA,OAAA,EAEA,WAAA,aAAc,QAFd,kBAAA,EAAA,OAAA,OAAA,EAGA,WAAA,aAAc,QAHd,cAAA,EAAA,OAAA,OAAA,EAIA,WAAA,aAAc,QAJd,WAAA,EAAA,OAAA,OAAA,EAKA,WAAA,aAAc,QALd,aAAA,EAAA,OAAA,OAAA,EAMA,WAAA,aAAc,QANd,UAAA,EAAA,OAAA,OAAA,EAOA,WAAA,aAAc,QAPd,SAAA,EAAA,OAAA,OAAA,EAQA,WAAA,aAAc,QARd,YAAA,EAAA,OAAA,OAAA,EASA,WAAA,aAAc,QATd,QAAA,EAAA,OAAA,OAAA,EAUA,WAAA,aAAc,QAVd,UAAA,EAAA,OAAA,OAAA"}
|
package/lib/core/is-binary.d.ts
DELETED
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
import { BinarySettings, BothValueHeaders } from '../@types';
|
|
2
|
-
/**
|
|
3
|
-
* The function that determines by the content encoding whether the response should be treated as binary
|
|
4
|
-
*
|
|
5
|
-
* @example
|
|
6
|
-
* ```typescript
|
|
7
|
-
* const headers = { 'content-encoding': 'gzip' };
|
|
8
|
-
* const isBinary = isContentEncodingBinary(headers, ['gzip']);
|
|
9
|
-
* console.log(isBinary);
|
|
10
|
-
* // true
|
|
11
|
-
* ```
|
|
12
|
-
*
|
|
13
|
-
* @param headers - The headers of the response
|
|
14
|
-
* @param binaryEncodingTypes - The list of content encodings that will be treated as binary
|
|
15
|
-
*
|
|
16
|
-
* @breadcrumb Core / isBinary
|
|
17
|
-
* @public
|
|
18
|
-
*/
|
|
19
|
-
export declare function isContentEncodingBinary(headers: BothValueHeaders, binaryEncodingTypes: string[]): boolean;
|
|
20
|
-
/**
|
|
21
|
-
* The function that returns the content type of headers
|
|
22
|
-
*
|
|
23
|
-
* @example
|
|
24
|
-
* ```typescript
|
|
25
|
-
* const headers = { 'content-type': 'application/json' };
|
|
26
|
-
* const contentType = getContentType(headers);
|
|
27
|
-
* console.log(contentType);
|
|
28
|
-
* // application/json
|
|
29
|
-
* ```
|
|
30
|
-
*
|
|
31
|
-
* @param headers - The headers of the response
|
|
32
|
-
*
|
|
33
|
-
* @breadcrumb Core / isBinary
|
|
34
|
-
* @public
|
|
35
|
-
*/
|
|
36
|
-
export declare function getContentType(headers: BothValueHeaders): string;
|
|
37
|
-
/**
|
|
38
|
-
* The function that determines by the content type whether the response should be treated as binary
|
|
39
|
-
*
|
|
40
|
-
* @example
|
|
41
|
-
* ```typescript
|
|
42
|
-
* const headers = { 'content-type': 'image/png' };
|
|
43
|
-
* const isBinary = isContentTypeBinary(headers, new Map([['image/png', true]]));
|
|
44
|
-
* console.log(isBinary);
|
|
45
|
-
* // true
|
|
46
|
-
* ```
|
|
47
|
-
*
|
|
48
|
-
* @param headers - The headers of the response
|
|
49
|
-
* @param binaryContentTypes - The list of content types that will be treated as binary
|
|
50
|
-
*
|
|
51
|
-
* @breadcrumb Core / isBinary
|
|
52
|
-
* @public
|
|
53
|
-
*/
|
|
54
|
-
export declare function isContentTypeBinary(headers: BothValueHeaders, binaryContentTypes: string[]): boolean;
|
|
55
|
-
/**
|
|
56
|
-
* The function used to determine from the headers and the binary settings if a response should be encoded or not
|
|
57
|
-
*
|
|
58
|
-
* @example
|
|
59
|
-
* ```typescript
|
|
60
|
-
* const headers = { 'content-type': 'image/png', 'content-encoding': 'gzip' };
|
|
61
|
-
* const isContentBinary = isBinary(headers, { contentEncodings: ['gzip'], contentTypes: ['image/png'] });
|
|
62
|
-
* console.log(isContentBinary);
|
|
63
|
-
* // true
|
|
64
|
-
* ```
|
|
65
|
-
*
|
|
66
|
-
* @param headers - The headers of the response
|
|
67
|
-
* @param binarySettings - The settings for the validation
|
|
68
|
-
*
|
|
69
|
-
* @breadcrumb Core / isBinary
|
|
70
|
-
* @public
|
|
71
|
-
*/
|
|
72
|
-
export declare function isBinary(headers: BothValueHeaders, binarySettings: BinarySettings): boolean;
|
|
73
|
-
//# sourceMappingURL=is-binary.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"is-binary.d.ts","sourceRoot":"","sources":["../../src/core/is-binary.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAI7D;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,uBAAuB,CACrC,OAAO,EAAE,gBAAgB,EACzB,mBAAmB,EAAE,MAAM,EAAE,GAC5B,OAAO,CAWT;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,cAAc,CAAC,OAAO,EAAE,gBAAgB,GAAG,MAAM,CAchE;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,mBAAmB,CACjC,OAAO,EAAE,gBAAgB,EACzB,kBAAkB,EAAE,MAAM,EAAE,WAO7B;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,QAAQ,CACtB,OAAO,EAAE,gBAAgB,EACzB,cAAc,EAAE,cAAc,GAC7B,OAAO,CAWT"}
|
package/lib/core/is-binary.js
DELETED
|
@@ -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),is_binary_exports={};__export(is_binary_exports,{getContentType:()=>getContentType,isBinary:()=>isBinary,isContentEncodingBinary:()=>isContentEncodingBinary,isContentTypeBinary:()=>isContentTypeBinary});module.exports=__toCommonJS(is_binary_exports);function isContentEncodingBinary(headers,binaryEncodingTypes){let contentEncodings=headers["content-encoding"];return contentEncodings?(Array.isArray(contentEncodings)||(contentEncodings=contentEncodings.split(",")),contentEncodings.some(value=>binaryEncodingTypes.includes(value.trim()))):!1}function getContentType(headers){const contentTypeHeaderRaw=headers["content-type"],contentTypeHeader=Array.isArray(contentTypeHeaderRaw)?contentTypeHeaderRaw[0]||"":contentTypeHeaderRaw||"";if(!contentTypeHeaderRaw)return"";const contentTypeStart=contentTypeHeader.indexOf(";");return contentTypeStart===-1?contentTypeHeader:contentTypeHeader.slice(0,contentTypeStart)}function isContentTypeBinary(headers,binaryContentTypes){const contentType=getContentType(headers);return contentType?binaryContentTypes.includes(contentType.trim()):!1}function isBinary(headers,binarySettings){return"isBinary"in binarySettings?binarySettings.isBinary===!1?!1:binarySettings.isBinary(headers):isContentEncodingBinary(headers,binarySettings.contentEncodings)||isContentTypeBinary(headers,binarySettings.contentTypes)}
|
|
2
|
-
//# sourceMappingURL=is-binary.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"is-binary.js","sources":["../../src/core/is-binary.ts"],"sourcesContent":["// ATTRIBUTION: https://github.com/dougmoscrop/serverless-http\n\n//#region Imports\n\nimport { BinarySettings, BothValueHeaders } from '../@types';\n\n//#endregion\n\n/**\n * The function that determines by the content encoding whether the response should be treated as binary\n *\n * @example\n * ```typescript\n * const headers = { 'content-encoding': 'gzip' };\n * const isBinary = isContentEncodingBinary(headers, ['gzip']);\n * console.log(isBinary);\n * // true\n * ```\n *\n * @param headers - The headers of the response\n * @param binaryEncodingTypes - The list of content encodings that will be treated as binary\n *\n * @breadcrumb Core / isBinary\n * @public\n */\nexport function isContentEncodingBinary(\n headers: BothValueHeaders,\n binaryEncodingTypes: string[],\n): boolean {\n let contentEncodings = headers['content-encoding'];\n\n if (!contentEncodings) return false;\n\n if (!Array.isArray(contentEncodings))\n contentEncodings = contentEncodings.split(',');\n\n return contentEncodings.some(value =>\n binaryEncodingTypes.includes(value.trim()),\n );\n}\n\n/**\n * The function that returns the content type of headers\n *\n * @example\n * ```typescript\n * const headers = { 'content-type': 'application/json' };\n * const contentType = getContentType(headers);\n * console.log(contentType);\n * // application/json\n * ```\n *\n * @param headers - The headers of the response\n *\n * @breadcrumb Core / isBinary\n * @public\n */\nexport function getContentType(headers: BothValueHeaders): string {\n const contentTypeHeaderRaw = headers['content-type'];\n const contentTypeHeader = Array.isArray(contentTypeHeaderRaw)\n ? contentTypeHeaderRaw[0] || ''\n : contentTypeHeaderRaw || '';\n\n if (!contentTypeHeaderRaw) return '';\n\n // only compare mime type; ignore encoding part\n const contentTypeStart = contentTypeHeader.indexOf(';');\n\n if (contentTypeStart === -1) return contentTypeHeader;\n\n return contentTypeHeader.slice(0, contentTypeStart);\n}\n\n/**\n * The function that determines by the content type whether the response should be treated as binary\n *\n * @example\n * ```typescript\n * const headers = { 'content-type': 'image/png' };\n * const isBinary = isContentTypeBinary(headers, new Map([['image/png', true]]));\n * console.log(isBinary);\n * // true\n * ```\n *\n * @param headers - The headers of the response\n * @param binaryContentTypes - The list of content types that will be treated as binary\n *\n * @breadcrumb Core / isBinary\n * @public\n */\nexport function isContentTypeBinary(\n headers: BothValueHeaders,\n binaryContentTypes: string[],\n) {\n const contentType = getContentType(headers);\n\n if (!contentType) return false;\n\n return binaryContentTypes.includes(contentType.trim());\n}\n\n/**\n * The function used to determine from the headers and the binary settings if a response should be encoded or not\n *\n * @example\n * ```typescript\n * const headers = { 'content-type': 'image/png', 'content-encoding': 'gzip' };\n * const isContentBinary = isBinary(headers, { contentEncodings: ['gzip'], contentTypes: ['image/png'] });\n * console.log(isContentBinary);\n * // true\n * ```\n *\n * @param headers - The headers of the response\n * @param binarySettings - The settings for the validation\n *\n * @breadcrumb Core / isBinary\n * @public\n */\nexport function isBinary(\n headers: BothValueHeaders,\n binarySettings: BinarySettings,\n): boolean {\n if ('isBinary' in binarySettings) {\n if (binarySettings.isBinary === false) return false;\n\n return binarySettings.isBinary(headers);\n }\n\n return (\n isContentEncodingBinary(headers, binarySettings.contentEncodings) ||\n isContentTypeBinary(headers, binarySettings.contentTypes)\n );\n}\n"],"names":[],"mappings":"ooBAAA,kBAAA,CAAA,EAAA,SAAA,kBAAA,CAAA,eAAA,IAAA,eAAA,SAAA,IAAA,SAAA,wBAAA,IAAA,wBAAA,oBAAA,IAAA,mBAAA,CAAA,EAAA,OAAA,QAAA,aAAA,iBAAA,EAyBO,SAAS,wBACd,QACA,oBACS,CACL,IAAA,iBAAmB,QAAQ,kBAAkB,EAEjD,OAAK,kBAEA,MAAM,QAAQ,gBAAgB,IACd,iBAAA,iBAAiB,MAAM,GAAG,GAExC,iBAAiB,KACtB,OAAA,oBAAoB,SAAS,MAAM,MAAM,CAAA,GANb,EAQhC,CAkBO,SAAS,eAAe,QAAmC,CAC1D,MAAA,qBAAuB,QAAQ,cAAc,EAC7C,kBAAoB,MAAM,QAAQ,oBAAoB,EACxD,qBAAqB,CAAC,GAAK,GAC3B,sBAAwB,GAE5B,GAAI,CAAC,qBAA6B,MAAA,GAG5B,MAAA,iBAAmB,kBAAkB,QAAQ,GAAG,EAEtD,OAAI,mBAAqB,GAAW,kBAE7B,kBAAkB,MAAM,EAAG,gBAAgB,CACpD,CAmBO,SAAS,oBACd,QACA,mBACA,CACM,MAAA,YAAc,eAAe,OAAO,EAE1C,OAAK,YAEE,mBAAmB,SAAS,YAAY,KAAM,CAAA,EAF5B,EAG3B,CAmBO,SAAS,SACd,QACA,eACS,CACT,MAAI,aAAc,eACZ,eAAe,WAAa,GAAc,GAEvC,eAAe,SAAS,OAAO,EAItC,wBAAwB,QAAS,eAAe,gBAAgB,GAChE,oBAAoB,QAAS,eAAe,YAAY,CAE5D"}
|
package/lib/core/logger.d.ts
DELETED
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* The type representing the possible log levels to choose from.
|
|
3
|
-
*
|
|
4
|
-
* @breadcrumb Core / Logger
|
|
5
|
-
* @public
|
|
6
|
-
*/
|
|
7
|
-
export type LogLevels = 'debug' | 'verbose' | 'info' | 'warn' | 'error' | 'none';
|
|
8
|
-
/**
|
|
9
|
-
* The options to customize {@link ILogger}
|
|
10
|
-
*
|
|
11
|
-
* @breadcrumb Core / Logger
|
|
12
|
-
* @public
|
|
13
|
-
*/
|
|
14
|
-
export type LoggerOptions = {
|
|
15
|
-
/**
|
|
16
|
-
* Select the log level, {@link LogLevels | see more}.
|
|
17
|
-
*
|
|
18
|
-
* @defaultValue error
|
|
19
|
-
*/
|
|
20
|
-
level: LogLevels;
|
|
21
|
-
};
|
|
22
|
-
/**
|
|
23
|
-
* The log function used in any level.
|
|
24
|
-
*
|
|
25
|
-
* @breadcrumb Core / Logger
|
|
26
|
-
* @public
|
|
27
|
-
*/
|
|
28
|
-
export type LoggerFN = (message: any, ...additional: any[]) => void;
|
|
29
|
-
/**
|
|
30
|
-
* The interface representing the logger, you can provide a custom logger by implementing this interface.
|
|
31
|
-
*
|
|
32
|
-
* @breadcrumb Core / Logger
|
|
33
|
-
* @public
|
|
34
|
-
*/
|
|
35
|
-
export type ILogger = Record<Exclude<LogLevels, 'none'>, LoggerFN>;
|
|
36
|
-
/**
|
|
37
|
-
* The method used to create a simple logger instance to use in this library.
|
|
38
|
-
*
|
|
39
|
-
* @remarks Behind the scenes, this simple logger sends the message to the `console` methods.
|
|
40
|
-
*
|
|
41
|
-
* @example
|
|
42
|
-
* ```typescript
|
|
43
|
-
* const logger = createDefaultLogger();
|
|
44
|
-
*
|
|
45
|
-
* logger.error('An error happens.');
|
|
46
|
-
* // An error happens.
|
|
47
|
-
* ```
|
|
48
|
-
*
|
|
49
|
-
* @param level - Select the level of the log
|
|
50
|
-
*
|
|
51
|
-
* @breadcrumb Core / Logger
|
|
52
|
-
* @public
|
|
53
|
-
*/
|
|
54
|
-
export declare function createDefaultLogger({ level }?: LoggerOptions): ILogger;
|
|
55
|
-
/**
|
|
56
|
-
* The method used to chck if logger was created by this library, or it was defined by the user.
|
|
57
|
-
*
|
|
58
|
-
* @param logger - The instance of the logger to check
|
|
59
|
-
*
|
|
60
|
-
* @breadcrumb Core / Logger
|
|
61
|
-
* @public
|
|
62
|
-
*/
|
|
63
|
-
export declare function isInternalLogger(logger: ILogger): boolean;
|
|
64
|
-
//# sourceMappingURL=logger.d.ts.map
|
package/lib/core/logger.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../../src/core/logger.ts"],"names":[],"mappings":"AAEA;;;;;GAKG;AACH,MAAM,MAAM,SAAS,GACjB,OAAO,GACP,SAAS,GACT,MAAM,GACN,MAAM,GACN,OAAO,GACP,MAAM,CAAC;AAEX;;;;;GAKG;AACH,MAAM,MAAM,aAAa,GAAG;IAC1B;;;;OAIG;IACH,KAAK,EAAE,SAAS,CAAC;CAClB,CAAC;AAEF;;;;;GAKG;AACH,MAAM,MAAM,QAAQ,GAAG,CAAC,OAAO,EAAE,GAAG,EAAE,GAAG,UAAU,EAAE,GAAG,EAAE,KAAK,IAAI,CAAC;AAEpE;;;;;GAKG;AACH,MAAM,MAAM,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC,SAAS,EAAE,MAAM,CAAC,EAAE,QAAQ,CAAC,CAAC;AAmDnE;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,mBAAmB,CACjC,EAAE,KAAK,EAAE,GAAE,aAAkC,GAC5C,OAAO,CAkBT;AAED;;;;;;;GAOG;AACH,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,OAAO,GAAG,OAAO,CAEzD"}
|
package/lib/core/logger.js
DELETED
|
@@ -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),logger_exports={};__export(logger_exports,{createDefaultLogger:()=>createDefaultLogger,isInternalLogger:()=>isInternalLogger});module.exports=__toCommonJS(logger_exports);var import_no_op=require("./no-op");const InternalLoggerSymbol=Symbol("InternalLogger"),logLevels={debug:[["debug","debug"],["verbose","debug"],["info","info"],["error","error"],["warn","warn"]],verbose:[["verbose","debug"],["info","info"],["error","error"],["warn","warn"]],info:[["info","info"],["error","error"],["warn","warn"]],warn:[["warn","warn"],["error","error"]],error:[["error","error"]],none:[]},lazyPrint=value=>typeof value=="function"?value():value,print=fn=>(message,...additional)=>console[fn](message,...additional.map(lazyPrint));function createDefaultLogger({level}={level:"error"}){const levels=logLevels[level];if(!levels)throw new Error("Invalid log level");const logger={[InternalLoggerSymbol]:!0,error:import_no_op.NO_OP,debug:import_no_op.NO_OP,info:import_no_op.NO_OP,verbose:import_no_op.NO_OP,warn:import_no_op.NO_OP};for(const[level2,consoleMethod]of levels)logger[level2]=print(consoleMethod);return logger}function isInternalLogger(logger){return!!logger[InternalLoggerSymbol]}
|
|
2
|
-
//# sourceMappingURL=logger.js.map
|
package/lib/core/logger.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"logger.js","sources":["../../src/core/logger.ts"],"sourcesContent":["import { NO_OP } from './no-op';\n\n/**\n * The type representing the possible log levels to choose from.\n *\n * @breadcrumb Core / Logger\n * @public\n */\nexport type LogLevels =\n | 'debug'\n | 'verbose'\n | 'info'\n | 'warn'\n | 'error'\n | 'none';\n\n/**\n * The options to customize {@link ILogger}\n *\n * @breadcrumb Core / Logger\n * @public\n */\nexport type LoggerOptions = {\n /**\n * Select the log level, {@link LogLevels | see more}.\n *\n * @defaultValue error\n */\n level: LogLevels;\n};\n\n/**\n * The log function used in any level.\n *\n * @breadcrumb Core / Logger\n * @public\n */\nexport type LoggerFN = (message: any, ...additional: any[]) => void;\n\n/**\n * The interface representing the logger, you can provide a custom logger by implementing this interface.\n *\n * @breadcrumb Core / Logger\n * @public\n */\nexport type ILogger = Record<Exclude<LogLevels, 'none'>, LoggerFN>;\n\n/**\n * The symbol used to check against an ILogger instace to verify if that ILogger was created by this library\n *\n * @breadcrumb Core / Logger\n * @public\n */\nconst InternalLoggerSymbol = Symbol('InternalLogger');\n\nconst logLevels: Record<\n LogLevels,\n [level: LogLevels, consoleMethod: keyof Console][]\n> = {\n debug: [\n ['debug', 'debug'],\n ['verbose', 'debug'],\n ['info', 'info'],\n ['error', 'error'],\n ['warn', 'warn'],\n ],\n verbose: [\n ['verbose', 'debug'],\n ['info', 'info'],\n ['error', 'error'],\n ['warn', 'warn'],\n ],\n info: [\n ['info', 'info'],\n ['error', 'error'],\n ['warn', 'warn'],\n ],\n warn: [\n ['warn', 'warn'],\n ['error', 'error'],\n ],\n error: [['error', 'error']],\n none: [],\n};\n\nconst lazyPrint = value => {\n if (typeof value === 'function') return value();\n\n return value;\n};\n\nconst print =\n (fn: string) =>\n (message, ...additional) =>\n console[fn](message, ...additional.map(lazyPrint));\n\n/**\n * The method used to create a simple logger instance to use in this library.\n *\n * @remarks Behind the scenes, this simple logger sends the message to the `console` methods.\n *\n * @example\n * ```typescript\n * const logger = createDefaultLogger();\n *\n * logger.error('An error happens.');\n * // An error happens.\n * ```\n *\n * @param level - Select the level of the log\n *\n * @breadcrumb Core / Logger\n * @public\n */\nexport function createDefaultLogger(\n { level }: LoggerOptions = { level: 'error' },\n): ILogger {\n const levels = logLevels[level];\n\n if (!levels) throw new Error('Invalid log level');\n\n const logger = {\n [InternalLoggerSymbol]: true,\n error: NO_OP,\n debug: NO_OP,\n info: NO_OP,\n verbose: NO_OP,\n warn: NO_OP,\n } as ILogger;\n\n for (const [level, consoleMethod] of levels)\n logger[level] = print(consoleMethod);\n\n return logger;\n}\n\n/**\n * The method used to chck if logger was created by this library, or it was defined by the user.\n *\n * @param logger - The instance of the logger to check\n *\n * @breadcrumb Core / Logger\n * @public\n */\nexport function isInternalLogger(logger: ILogger): boolean {\n return !!logger[InternalLoggerSymbol];\n}\n"],"names":["level"],"mappings":"ooBAAA,eAAA,CAAA,EAAA,SAAA,eAAA,CAAA,oBAAA,IAAA,oBAAA,iBAAA,IAAA,gBAAA,CAAA,EAAA,OAAA,QAAA,aAAA,cAAA,EAAA,IAAsB,aAAA,QAAA,SAAA,EAqDtB,MAAM,qBAAuB,OAAO,gBAAgB,EAE9C,UAGF,CACF,MAAO,CACL,CAAC,QAAS,OAAO,EACjB,CAAC,UAAW,OAAO,EACnB,CAAC,OAAQ,MAAM,EACf,CAAC,QAAS,OAAO,EACjB,CAAC,OAAQ,MAAM,CACjB,EACA,QAAS,CACP,CAAC,UAAW,OAAO,EACnB,CAAC,OAAQ,MAAM,EACf,CAAC,QAAS,OAAO,EACjB,CAAC,OAAQ,MAAM,CACjB,EACA,KAAM,CACJ,CAAC,OAAQ,MAAM,EACf,CAAC,QAAS,OAAO,EACjB,CAAC,OAAQ,MAAM,CACjB,EACA,KAAM,CACJ,CAAC,OAAQ,MAAM,EACf,CAAC,QAAS,OAAO,CACnB,EACA,MAAO,CAAC,CAAC,QAAS,OAAO,CAAC,EAC1B,KAAM,CAAC,CACT,EAEM,UAAqB,OACrB,OAAO,OAAU,WAAmB,MAAM,EAEvC,MAGH,MACH,IACD,CAAC,WAAY,aACX,QAAQ,EAAE,EAAE,QAAS,GAAG,WAAW,IAAI,SAAS,CAAC,EAoB9C,SAAS,oBACd,CAAE,KAAA,EAAyB,CAAE,MAAO,SAC3B,CACH,MAAA,OAAS,UAAU,KAAK,EAE9B,GAAI,CAAC,OAAc,MAAA,IAAI,MAAM,mBAAmB,EAEhD,MAAM,OAAS,CACb,CAAC,oBAAoB,EAAG,GACxB,MAAO,aAAA,MACP,MAAO,aAAA,MACP,KAAM,aAAA,MACN,QAAS,aAAA,MACT,KAAM,aAAA,KAAA,EAGG,SAAA,CAACA,OAAO,aAAa,IAAK,OAC5BA,OAAAA,MAAK,EAAI,MAAM,aAAa,EAE9B,OAAA,MACT,CAUO,SAAS,iBAAiB,OAA0B,CAClD,MAAA,CAAC,CAAC,OAAO,oBAAoB,CACtC"}
|
package/lib/core/no-op.d.ts
DELETED
package/lib/core/no-op.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"no-op.d.ts","sourceRoot":"","sources":["../../src/core/no-op.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,eAAO,MAAM,KAAK,EAAE,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,GAAkB,CAAC"}
|
package/lib/core/no-op.js
DELETED
|
@@ -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),no_op_exports={};__export(no_op_exports,{NO_OP:()=>NO_OP});module.exports=__toCommonJS(no_op_exports);const NO_OP=()=>{};
|
|
2
|
-
//# sourceMappingURL=no-op.js.map
|
package/lib/core/no-op.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"no-op.js","sources":["../../src/core/no-op.ts"],"sourcesContent":["/**\n * No operation function is used when we need to pass a function, but we don't want to specify any behavior.\n *\n * @breadcrumb Core\n * @public\n */\nexport const NO_OP: (...args: any[]) => any = () => void 0;\n"],"names":[],"mappings":"ooBAAA,cAAA,CAAA,EAAA,SAAA,cAAA,CAAA,MAAA,IAAA,KAAA,CAAA,EAAA,OAAA,QAAA,aAAA,aAAA,EAMO,MAAM,MAAiC,IAAM"}
|
package/lib/core/optional.d.ts
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Return the defaultValue whether the value is undefined, otherwise, return the value.
|
|
3
|
-
*
|
|
4
|
-
* @example
|
|
5
|
-
* ```typescript
|
|
6
|
-
* const value1 = getDefaultIfUndefined(undefined, true);
|
|
7
|
-
* const value2 = getDefaultIfUndefined(false, true);
|
|
8
|
-
*
|
|
9
|
-
* console.log(value1);
|
|
10
|
-
* // true
|
|
11
|
-
* console.log(value2);
|
|
12
|
-
* // false
|
|
13
|
-
* ```
|
|
14
|
-
*
|
|
15
|
-
* @param value - The value to be checked
|
|
16
|
-
* @param defaultValue - The default value when value is undefined
|
|
17
|
-
*
|
|
18
|
-
* @breadcrumb Core
|
|
19
|
-
* @public
|
|
20
|
-
*/
|
|
21
|
-
export declare function getDefaultIfUndefined<T>(value: T | undefined, defaultValue: T): T;
|
|
22
|
-
//# sourceMappingURL=optional.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"optional.d.ts","sourceRoot":"","sources":["../../src/core/optional.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,qBAAqB,CAAC,CAAC,EACrC,KAAK,EAAE,CAAC,GAAG,SAAS,EACpB,YAAY,EAAE,CAAC,GACd,CAAC,CAIH"}
|
package/lib/core/optional.js
DELETED
|
@@ -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),optional_exports={};__export(optional_exports,{getDefaultIfUndefined:()=>getDefaultIfUndefined});module.exports=__toCommonJS(optional_exports);function getDefaultIfUndefined(value,defaultValue){return value===void 0?defaultValue:value}
|
|
2
|
-
//# sourceMappingURL=optional.js.map
|
package/lib/core/optional.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"optional.js","sources":["../../src/core/optional.ts"],"sourcesContent":["/**\n * Return the defaultValue whether the value is undefined, otherwise, return the value.\n *\n * @example\n * ```typescript\n * const value1 = getDefaultIfUndefined(undefined, true);\n * const value2 = getDefaultIfUndefined(false, true);\n *\n * console.log(value1);\n * // true\n * console.log(value2);\n * // false\n * ```\n *\n * @param value - The value to be checked\n * @param defaultValue - The default value when value is undefined\n *\n * @breadcrumb Core\n * @public\n */\nexport function getDefaultIfUndefined<T>(\n value: T | undefined,\n defaultValue: T,\n): T {\n if (value === undefined) return defaultValue;\n\n return value;\n}\n"],"names":[],"mappings":"ooBAAA,iBAAA,CAAA,EAAA,SAAA,iBAAA,CAAA,sBAAA,IAAA,qBAAA,CAAA,EAAA,OAAA,QAAA,aAAA,gBAAA,EAoBO,SAAS,sBACd,MACA,aACG,CACH,OAAI,QAAU,OAAkB,aAEzB,KACT"}
|
package/lib/core/path.d.ts
DELETED
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Transform the path and a map of query params to a string with formatted query params
|
|
3
|
-
*
|
|
4
|
-
* @example
|
|
5
|
-
* ```typescript
|
|
6
|
-
* const path = '/pets/search';
|
|
7
|
-
* const queryParams = { batata: undefined, petType: [ 'dog', 'fish' ] };
|
|
8
|
-
* const result = getPathWithQueryStringParams(path, queryParams);
|
|
9
|
-
* console.log(result);
|
|
10
|
-
* // /pets/search?batata=&petType=dog&petType=fish
|
|
11
|
-
* ```
|
|
12
|
-
*
|
|
13
|
-
* @param path - The path
|
|
14
|
-
* @param queryParams - The query params
|
|
15
|
-
*
|
|
16
|
-
* @breadcrumb Core / Path
|
|
17
|
-
* @public
|
|
18
|
-
*/
|
|
19
|
-
export declare function getPathWithQueryStringParams(path: string, queryParams: string | Record<string, string | string[] | undefined> | undefined | null): string;
|
|
20
|
-
/**
|
|
21
|
-
* Map query params to a string with formatted query params
|
|
22
|
-
*
|
|
23
|
-
* @example
|
|
24
|
-
* ```typescript
|
|
25
|
-
* const queryParams = { batata: undefined, petType: [ 'dog', 'fish' ] };
|
|
26
|
-
* const result = getQueryParamsStringFromRecord(queryParams);
|
|
27
|
-
* console.log(result);
|
|
28
|
-
* // batata=&petType=dog&petType=fish
|
|
29
|
-
* ```
|
|
30
|
-
*
|
|
31
|
-
* @param queryParamsRecord - The query params record
|
|
32
|
-
*
|
|
33
|
-
* @breadcrumb Core / Path
|
|
34
|
-
* @public
|
|
35
|
-
*/
|
|
36
|
-
export declare function getQueryParamsStringFromRecord(queryParamsRecord: Record<string, string | string[] | undefined> | undefined | null): string;
|
|
37
|
-
/**
|
|
38
|
-
* Type of the function to strip base path
|
|
39
|
-
*
|
|
40
|
-
* @breadcrumb Core / Path
|
|
41
|
-
* @public
|
|
42
|
-
*/
|
|
43
|
-
export type StripBasePathFn = (path: string) => string;
|
|
44
|
-
/**
|
|
45
|
-
* Get the strip base path function
|
|
46
|
-
*
|
|
47
|
-
* @param basePath - The base path
|
|
48
|
-
*
|
|
49
|
-
* @breadcrumb Core / Path
|
|
50
|
-
* @public
|
|
51
|
-
*/
|
|
52
|
-
export declare function buildStripBasePath(basePath: string | undefined): StripBasePathFn;
|
|
53
|
-
//# sourceMappingURL=path.d.ts.map
|
package/lib/core/path.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"path.d.ts","sourceRoot":"","sources":["../../src/core/path.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,4BAA4B,CAC1C,IAAI,EAAE,MAAM,EACZ,WAAW,EACP,MAAM,GACN,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,SAAS,CAAC,GAC7C,SAAS,GACT,IAAI,GACP,MAAM,CAUR;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,8BAA8B,CAC5C,iBAAiB,EACb,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,SAAS,CAAC,GAC7C,SAAS,GACT,IAAI,GACP,MAAM,CAkBR;AAED;;;;;GAKG;AACH,MAAM,MAAM,eAAe,GAAG,CAAC,IAAI,EAAE,MAAM,KAAK,MAAM,CAAC;AAIvD;;;;;;;GAOG;AACH,wBAAgB,kBAAkB,CAChC,QAAQ,EAAE,MAAM,GAAG,SAAS,GAC3B,eAAe,CAWjB"}
|
package/lib/core/path.js
DELETED
|
@@ -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),path_exports={};__export(path_exports,{buildStripBasePath:()=>buildStripBasePath,getPathWithQueryStringParams:()=>getPathWithQueryStringParams,getQueryParamsStringFromRecord:()=>getQueryParamsStringFromRecord});module.exports=__toCommonJS(path_exports);function getPathWithQueryStringParams(path,queryParams){if(String(queryParams||"").length===0)return path;if(typeof queryParams=="string")return`${path}?${queryParams}`;const queryParamsString=getQueryParamsStringFromRecord(queryParams);return queryParamsString?`${path}?${queryParamsString}`:path}function getQueryParamsStringFromRecord(queryParamsRecord){const searchParams=new URLSearchParams,multiValueHeadersEntries=Object.entries(queryParamsRecord||{});if(multiValueHeadersEntries.length===0)return"";for(const[key,value]of multiValueHeadersEntries){if(!Array.isArray(value)){searchParams.append(key,value||"");continue}for(const arrayValue of value)searchParams.append(key,arrayValue)}return searchParams.toString()}const NOOPBasePath=path=>path;function buildStripBasePath(basePath){if(!basePath)return NOOPBasePath;const length=basePath.length;return path=>path.startsWith(basePath)?path.slice(path.indexOf(basePath)+length,path.length)||"/":path}
|
|
2
|
-
//# sourceMappingURL=path.js.map
|
package/lib/core/path.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"path.js","sources":["../../src/core/path.ts"],"sourcesContent":["/**\n * Transform the path and a map of query params to a string with formatted query params\n *\n * @example\n * ```typescript\n * const path = '/pets/search';\n * const queryParams = { batata: undefined, petType: [ 'dog', 'fish' ] };\n * const result = getPathWithQueryStringParams(path, queryParams);\n * console.log(result);\n * // /pets/search?batata=&petType=dog&petType=fish\n * ```\n *\n * @param path - The path\n * @param queryParams - The query params\n *\n * @breadcrumb Core / Path\n * @public\n */\nexport function getPathWithQueryStringParams(\n path: string,\n queryParams:\n | string\n | Record<string, string | string[] | undefined>\n | undefined\n | null,\n): string {\n if (String(queryParams || '').length === 0) return path;\n\n if (typeof queryParams === 'string') return `${path}?${queryParams}`;\n\n const queryParamsString = getQueryParamsStringFromRecord(queryParams);\n\n if (!queryParamsString) return path;\n\n return `${path}?${queryParamsString}`;\n}\n\n/**\n * Map query params to a string with formatted query params\n *\n * @example\n * ```typescript\n * const queryParams = { batata: undefined, petType: [ 'dog', 'fish' ] };\n * const result = getQueryParamsStringFromRecord(queryParams);\n * console.log(result);\n * // batata=&petType=dog&petType=fish\n * ```\n *\n * @param queryParamsRecord - The query params record\n *\n * @breadcrumb Core / Path\n * @public\n */\nexport function getQueryParamsStringFromRecord(\n queryParamsRecord:\n | Record<string, string | string[] | undefined>\n | undefined\n | null,\n): string {\n const searchParams = new URLSearchParams();\n\n const multiValueHeadersEntries: [string, string | string[] | undefined][] =\n Object.entries(queryParamsRecord || {});\n\n if (multiValueHeadersEntries.length === 0) return '';\n\n for (const [key, value] of multiValueHeadersEntries) {\n if (!Array.isArray(value)) {\n searchParams.append(key, value || '');\n continue;\n }\n\n for (const arrayValue of value) searchParams.append(key, arrayValue);\n }\n\n return searchParams.toString();\n}\n\n/**\n * Type of the function to strip base path\n *\n * @breadcrumb Core / Path\n * @public\n */\nexport type StripBasePathFn = (path: string) => string;\n\nconst NOOPBasePath: StripBasePathFn = (path: string) => path;\n\n/**\n * Get the strip base path function\n *\n * @param basePath - The base path\n *\n * @breadcrumb Core / Path\n * @public\n */\nexport function buildStripBasePath(\n basePath: string | undefined,\n): StripBasePathFn {\n if (!basePath) return NOOPBasePath;\n\n const length = basePath.length;\n\n return (path: string) => {\n if (path.startsWith(basePath))\n return path.slice(path.indexOf(basePath) + length, path.length) || '/';\n\n return path;\n };\n}\n"],"names":[],"mappings":"ooBAAA,aAAA,CAAA,EAAA,SAAA,aAAA,CAAA,mBAAA,IAAA,mBAAA,6BAAA,IAAA,6BAAA,+BAAA,IAAA,8BAAA,CAAA,EAAA,OAAA,QAAA,aAAA,YAAA,EAkBO,SAAS,6BACd,KACA,YAKQ,CACR,GAAI,OAAO,aAAe,EAAE,EAAE,SAAW,EAAU,OAAA,KAEnD,GAAI,OAAO,aAAgB,SAAU,MAAO,GAAG,QAAQ,cAEjD,MAAA,kBAAoB,+BAA+B,WAAW,EAEpE,OAAK,kBAEE,GAAG,QAAQ,oBAFa,IAGjC,CAkBO,SAAS,+BACd,kBAIQ,CACF,MAAA,aAAe,IAAI,gBAEnB,yBACJ,OAAO,QAAQ,mBAAqB,CAAE,CAAA,EAExC,GAAI,yBAAyB,SAAW,EAAU,MAAA,GAElD,SAAW,CAAC,IAAK,KAAK,IAAK,yBAA0B,CACnD,GAAI,CAAC,MAAM,QAAQ,KAAK,EAAG,CACZ,aAAA,OAAO,IAAK,OAAS,EAAE,EACpC,SAGF,UAAW,cAAc,MAAoB,aAAA,OAAO,IAAK,UAAU,EAGrE,OAAO,aAAa,UACtB,CAUA,MAAM,aAAiC,MAAiB,KAUjD,SAAS,mBACd,SACiB,CACjB,GAAI,CAAC,SAAiB,OAAA,aAEtB,MAAM,OAAS,SAAS,OAExB,OAAQ,MACF,KAAK,WAAW,QAAQ,EACnB,KAAK,MAAM,KAAK,QAAQ,QAAQ,EAAI,OAAQ,KAAK,MAAM,GAAK,IAE9D,IAEX"}
|
package/lib/core/stream.d.ts
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
|
-
import { Readable, Writable } from 'stream';
|
|
3
|
-
/**
|
|
4
|
-
* Check if stream already ended
|
|
5
|
-
*
|
|
6
|
-
* @param stream - The stream
|
|
7
|
-
*
|
|
8
|
-
* @breadcrumb Core / Stream
|
|
9
|
-
* @public
|
|
10
|
-
*/
|
|
11
|
-
export declare function isStreamEnded(stream: Readable | Writable): boolean;
|
|
12
|
-
/**
|
|
13
|
-
* Wait asynchronous the stream to complete
|
|
14
|
-
*
|
|
15
|
-
* @param stream - The stream
|
|
16
|
-
*
|
|
17
|
-
* @breadcrumb Core / Stream
|
|
18
|
-
* @public
|
|
19
|
-
*/
|
|
20
|
-
export declare function waitForStreamComplete<TStream extends Readable | Writable>(stream: TStream): Promise<TStream>;
|
|
21
|
-
//# sourceMappingURL=stream.d.ts.map
|
package/lib/core/stream.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"stream.d.ts","sourceRoot":"","sources":["../../src/core/stream.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAC;AAI5C;;;;;;;GAOG;AACH,wBAAgB,aAAa,CAAC,MAAM,EAAE,QAAQ,GAAG,QAAQ,GAAG,OAAO,CAMlE;AAED;;;;;;;GAOG;AACH,wBAAgB,qBAAqB,CAAC,OAAO,SAAS,QAAQ,GAAG,QAAQ,EACvE,MAAM,EAAE,OAAO,GACd,OAAO,CAAC,OAAO,CAAC,CA2BlB"}
|
package/lib/core/stream.js
DELETED
|
@@ -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),stream_exports={};__export(stream_exports,{isStreamEnded:()=>isStreamEnded,waitForStreamComplete:()=>waitForStreamComplete});module.exports=__toCommonJS(stream_exports);function isStreamEnded(stream){return!!("readableEnded"in stream&&stream.readableEnded||"writableEnded"in stream&&stream.writableEnded)}function waitForStreamComplete(stream){return isStreamEnded(stream)?Promise.resolve(stream):new Promise((resolve,reject)=>{let isComplete=!1;function complete(err){isComplete||(isComplete=!0,stream.removeListener("error",complete),stream.removeListener("end",complete),stream.removeListener("finish",complete),err?reject(err):resolve(stream))}stream.once("error",complete),stream.once("end",complete),stream.once("finish",complete)})}
|
|
2
|
-
//# sourceMappingURL=stream.js.map
|
package/lib/core/stream.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"stream.js","sources":["../../src/core/stream.ts"],"sourcesContent":["//#region Imports\n\nimport { Readable, Writable } from 'stream';\n\n//#endregion\n\n/**\n * Check if stream already ended\n *\n * @param stream - The stream\n *\n * @breadcrumb Core / Stream\n * @public\n */\nexport function isStreamEnded(stream: Readable | Writable): boolean {\n if ('readableEnded' in stream && stream.readableEnded) return true;\n\n if ('writableEnded' in stream && stream.writableEnded) return true;\n\n return false;\n}\n\n/**\n * Wait asynchronous the stream to complete\n *\n * @param stream - The stream\n *\n * @breadcrumb Core / Stream\n * @public\n */\nexport function waitForStreamComplete<TStream extends Readable | Writable>(\n stream: TStream,\n): Promise<TStream> {\n if (isStreamEnded(stream)) return Promise.resolve(stream);\n\n return new Promise<TStream>((resolve, reject) => {\n // Reading the {@link https://github.com/nodejs/node/blob/v12.22.9/lib/events.js#L262 | emit source code},\n // it's almost impossible to complete being called twice because the emit function runs synchronously and removes the other listeners,\n // but I'll leave it at that because I didn't write that code, so I couldn't figure out what the author thought when he wrote this.\n let isComplete = false;\n\n function complete(err) {\n /* istanbul ignore next */\n if (isComplete) return;\n\n isComplete = true;\n\n stream.removeListener('error', complete);\n stream.removeListener('end', complete);\n stream.removeListener('finish', complete);\n\n if (err) reject(err);\n else resolve(stream);\n }\n\n stream.once('error', complete);\n stream.once('end', complete);\n stream.once('finish', complete);\n });\n}\n"],"names":[],"mappings":"ooBAAA,eAAA,CAAA,EAAA,SAAA,eAAA,CAAA,cAAA,IAAA,cAAA,sBAAA,IAAA,qBAAA,CAAA,EAAA,OAAA,QAAA,aAAA,cAAA,EAcO,SAAS,cAAc,OAAsC,CAG9D,MAFA,qBAAmB,QAAU,OAAO,eAEpC,kBAAmB,QAAU,OAAO,cAG1C,CAUO,SAAS,sBACd,OACkB,CAClB,OAAI,cAAc,MAAM,EAAU,QAAQ,QAAQ,MAAM,EAEjD,IAAI,QAAiB,CAAC,QAAS,SAAW,CAI/C,IAAI,WAAa,GAEjB,SAAS,SAAS,IAAK,CAEjB,aAES,WAAA,GAEN,OAAA,eAAe,QAAS,QAAQ,EAChC,OAAA,eAAe,MAAO,QAAQ,EAC9B,OAAA,eAAe,SAAU,QAAQ,EAEpC,IAAK,OAAO,GAAG,EACd,QAAQ,MAAM,EACrB,CAEO,OAAA,KAAK,QAAS,QAAQ,EACtB,OAAA,KAAK,MAAO,QAAQ,EACpB,OAAA,KAAK,SAAU,QAAQ,CAAA,CAC/B,CACH"}
|
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
|
-
import { IncomingMessage, ServerResponse } from 'http';
|
|
3
|
-
import { ApolloServer, BaseContext } from '@apollo/server';
|
|
4
|
-
import { FrameworkContract } from '../../contracts';
|
|
5
|
-
import { ServerlessRequest } from '../../network';
|
|
6
|
-
/**
|
|
7
|
-
* The default context of Apollo Server when you integrate and don't pass any context.
|
|
8
|
-
*
|
|
9
|
-
* @breadcrumb Frameworks / ApolloServerFramework
|
|
10
|
-
* @public
|
|
11
|
-
*/
|
|
12
|
-
export interface DefaultServerlessApolloServerContext extends BaseContext {
|
|
13
|
-
/**
|
|
14
|
-
* The request reference
|
|
15
|
-
*/
|
|
16
|
-
request: IncomingMessage;
|
|
17
|
-
/**
|
|
18
|
-
* The response reference
|
|
19
|
-
*/
|
|
20
|
-
response: ServerResponse;
|
|
21
|
-
}
|
|
22
|
-
/**
|
|
23
|
-
* The arguments used to create a Context inside {@link ApolloServerOptions}
|
|
24
|
-
*
|
|
25
|
-
* @breadcrumb Frameworks / ApolloServerFramework
|
|
26
|
-
* @public
|
|
27
|
-
*/
|
|
28
|
-
export type ApolloServerContextArguments = {
|
|
29
|
-
/**
|
|
30
|
-
* The request reference
|
|
31
|
-
*/
|
|
32
|
-
request: IncomingMessage;
|
|
33
|
-
/**
|
|
34
|
-
* The response reference
|
|
35
|
-
*/
|
|
36
|
-
response: ServerResponse;
|
|
37
|
-
};
|
|
38
|
-
/**
|
|
39
|
-
* The options to customize {@link ApolloServerFramework}
|
|
40
|
-
*
|
|
41
|
-
* @breadcrumb Frameworks / ApolloServerFramework
|
|
42
|
-
* @public
|
|
43
|
-
*/
|
|
44
|
-
export interface ApolloServerOptions<TContext extends BaseContext> {
|
|
45
|
-
/**
|
|
46
|
-
* Define a function to create the context of Apollo Server
|
|
47
|
-
*
|
|
48
|
-
* @param options - Default options passed by library
|
|
49
|
-
*/
|
|
50
|
-
context?: (options: ApolloServerContextArguments) => Promise<TContext>;
|
|
51
|
-
}
|
|
52
|
-
/**
|
|
53
|
-
* The framework that forwards requests to Apollo Server
|
|
54
|
-
*
|
|
55
|
-
* @breadcrumb Frameworks / ApolloServerFramework
|
|
56
|
-
* @public
|
|
57
|
-
*/
|
|
58
|
-
export declare class ApolloServerFramework<TContext extends BaseContext> implements FrameworkContract<ApolloServer<TContext>> {
|
|
59
|
-
protected readonly options?: ApolloServerOptions<TContext> | undefined;
|
|
60
|
-
/**
|
|
61
|
-
* Construtor padrão
|
|
62
|
-
*/
|
|
63
|
-
constructor(options?: ApolloServerOptions<TContext> | undefined);
|
|
64
|
-
/**
|
|
65
|
-
* {@inheritDoc}
|
|
66
|
-
*/
|
|
67
|
-
sendRequest(app: ApolloServer<TContext>, request: ServerlessRequest, response: ServerResponse): void;
|
|
68
|
-
}
|
|
69
|
-
//# sourceMappingURL=apollo-server.framework.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"apollo-server.framework.d.ts","sourceRoot":"","sources":["../../../src/frameworks/apollo-server/apollo-server.framework.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,MAAM,CAAC;AACvD,OAAO,EAAE,YAAY,EAAE,WAAW,EAAa,MAAM,gBAAgB,CAAC;AACtE,OAAO,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AACpD,OAAO,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAKlD;;;;;GAKG;AACH,MAAM,WAAW,oCAAqC,SAAQ,WAAW;IACvE;;OAEG;IACH,OAAO,EAAE,eAAe,CAAC;IACzB;;OAEG;IACH,QAAQ,EAAE,cAAc,CAAC;CAC1B;AAED;;;;;GAKG;AACH,MAAM,MAAM,4BAA4B,GAAG;IACzC;;OAEG;IACH,OAAO,EAAE,eAAe,CAAC;IACzB;;OAEG;IACH,QAAQ,EAAE,cAAc,CAAC;CAC1B,CAAC;AAEF;;;;;GAKG;AACH,MAAM,WAAW,mBAAmB,CAAC,QAAQ,SAAS,WAAW;IAC/D;;;;OAIG;IACH,OAAO,CAAC,EAAE,CAAC,OAAO,EAAE,4BAA4B,KAAK,OAAO,CAAC,QAAQ,CAAC,CAAC;CACxE;AAED;;;;;GAKG;AACH,qBAAa,qBAAqB,CAAC,QAAQ,SAAS,WAAW,CAC7D,YAAW,iBAAiB,CAAC,YAAY,CAAC,QAAQ,CAAC,CAAC;IAOxC,SAAS,CAAC,QAAQ,CAAC,OAAO,CAAC;IAHvC;;OAEG;gBAC4B,OAAO,CAAC,2CAA+B;IAItE;;OAEG;IACI,WAAW,CAChB,GAAG,EAAE,YAAY,CAAC,QAAQ,CAAC,EAC3B,OAAO,EAAE,iBAAiB,EAC1B,QAAQ,EAAE,cAAc,GACvB,IAAI;CA+DR"}
|
|
@@ -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),apollo_server_framework_exports={};__export(apollo_server_framework_exports,{ApolloServerFramework:()=>ApolloServerFramework});module.exports=__toCommonJS(apollo_server_framework_exports);var import_server=require("@apollo/server"),import_core=require("../../core");class ApolloServerFramework{constructor(options){this.options=options}sendRequest(app,request,response){var _a,_b;const headers=new import_server.HeaderMap;for(const[key,value]of Object.entries(request.headers))value!==void 0&&headers.set(key,Array.isArray(value)?value.join(", "):value.toString());const defaultContext=context2=>Promise.resolve(context2),context=()=>{var _a2;return(0,import_core.getDefaultIfUndefined)((_a2=this.options)==null?void 0:_a2.context,defaultContext)({request,response})},search=(_a=request.url)!=null&&_a.startsWith("http")?new URL(request.url).search??"":((_b=request.url)==null?void 0:_b.split("?")[1])||"";app.executeHTTPGraphQLRequest({httpGraphQLRequest:{method:request.method.toUpperCase(),headers,body:request.body,search},context}).then(async httpGraphQLResponse=>{for(const[key,value]of httpGraphQLResponse.headers)response.setHeader(key,value);if(response.statusCode=httpGraphQLResponse.status||200,httpGraphQLResponse.body.kind==="complete"){response.end(httpGraphQLResponse.body.string);return}for await(const chunk of httpGraphQLResponse.body.asyncIterator)response.write(chunk),typeof response.flush=="function"&&response.flush();response.end()})}}
|
|
2
|
-
//# sourceMappingURL=apollo-server.framework.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"apollo-server.framework.js","sources":["../../../src/frameworks/apollo-server/apollo-server.framework.ts"],"sourcesContent":["//#region\n\nimport { IncomingMessage, ServerResponse } from 'http';\nimport { ApolloServer, BaseContext, HeaderMap } from '@apollo/server';\nimport { FrameworkContract } from '../../contracts';\nimport { ServerlessRequest } from '../../network';\nimport { getDefaultIfUndefined } from '../../core';\n\n//#endregion\n\n/**\n * The default context of Apollo Server when you integrate and don't pass any context.\n *\n * @breadcrumb Frameworks / ApolloServerFramework\n * @public\n */\nexport interface DefaultServerlessApolloServerContext extends BaseContext {\n /**\n * The request reference\n */\n request: IncomingMessage;\n /**\n * The response reference\n */\n response: ServerResponse;\n}\n\n/**\n * The arguments used to create a Context inside {@link ApolloServerOptions}\n *\n * @breadcrumb Frameworks / ApolloServerFramework\n * @public\n */\nexport type ApolloServerContextArguments = {\n /**\n * The request reference\n */\n request: IncomingMessage;\n /**\n * The response reference\n */\n response: ServerResponse;\n};\n\n/**\n * The options to customize {@link ApolloServerFramework}\n *\n * @breadcrumb Frameworks / ApolloServerFramework\n * @public\n */\nexport interface ApolloServerOptions<TContext extends BaseContext> {\n /**\n * Define a function to create the context of Apollo Server\n *\n * @param options - Default options passed by library\n */\n context?: (options: ApolloServerContextArguments) => Promise<TContext>;\n}\n\n/**\n * The framework that forwards requests to Apollo Server\n *\n * @breadcrumb Frameworks / ApolloServerFramework\n * @public\n */\nexport class ApolloServerFramework<TContext extends BaseContext>\n implements FrameworkContract<ApolloServer<TContext>>\n{\n //#region Constructor\n\n /**\n * Construtor padrão\n */\n constructor(protected readonly options?: ApolloServerOptions<TContext>) {}\n\n //#endregion\n\n /**\n * {@inheritDoc}\n */\n public sendRequest(\n app: ApolloServer<TContext>,\n request: ServerlessRequest,\n response: ServerResponse,\n ): void {\n const headers = new HeaderMap();\n\n for (const [key, value] of Object.entries(request.headers)) {\n if (value === undefined) continue;\n\n headers.set(\n key,\n Array.isArray(value) ? value.join(', ') : value.toString(),\n );\n }\n\n const defaultContext: ApolloServerOptions<any>['context'] = context =>\n Promise.resolve(context);\n\n const context = () =>\n getDefaultIfUndefined(\n this.options?.context,\n defaultContext,\n )({ request, response });\n\n const search = request.url?.startsWith('http')\n ? new URL(request.url).search ?? ''\n : request.url?.split('?')[1] || '';\n\n // we don't need to handle catch because of https://www.apollographql.com/docs/apollo-server/integrations/building-integrations/#handle-errors\n app\n .executeHTTPGraphQLRequest({\n httpGraphQLRequest: {\n method: request.method!.toUpperCase(),\n headers,\n body: request.body,\n search,\n },\n context,\n })\n .then(async httpGraphQLResponse => {\n // this section was copy and pasted from https://github.com/apollographql/apollo-server/blob/main/packages/server/src/express4/index.ts#L95\n\n for (const [key, value] of httpGraphQLResponse.headers)\n response.setHeader(key, value);\n\n response.statusCode = httpGraphQLResponse.status || 200;\n\n if (httpGraphQLResponse.body.kind === 'complete') {\n response.end(httpGraphQLResponse.body.string);\n return;\n }\n\n for await (const chunk of httpGraphQLResponse.body.asyncIterator) {\n response.write(chunk);\n // Express/Node doesn't define a way of saying \"it's time to send this\n // data over the wire\"... but the popular `compression` middleware\n // (which implements `accept-encoding: gzip` and friends) does, by\n // monkey-patching a `flush` method onto the response. So we call it\n // if it's there.\n if (typeof (response as any).flush === 'function')\n (response as any).flush();\n }\n\n response.end();\n });\n }\n}\n"],"names":["context","_a"],"mappings":"ooBAAA,gCAAA,CAAA,EAAA,SAAA,gCAAA,CAAA,sBAAA,IAAA,qBAAA,CAAA,EAAA,OAAA,QAAA,aAAA,+BAAA,EAGA,IAAqD,cAAA,QAAA,gBAAA,EAGf,YAAA,QAAA,YAAA,EA2D/B,MAAM,qBAEb,CAME,YAA+B,QAAyC,CAAzC,KAAA,QAAA,OAA0C,CAOlE,YACL,IACA,QACA,SACM,WACA,MAAA,QAAU,IAAI,cAAU,UAEnB,SAAA,CAAC,IAAK,KAAK,IAAK,OAAO,QAAQ,QAAQ,OAAO,EACnD,QAAU,QAEN,QAAA,IACN,IACA,MAAM,QAAQ,KAAK,EAAI,MAAM,KAAK,IAAI,EAAI,MAAM,SAAS,CAAA,EAI7D,MAAM,eAAsDA,UAC1D,QAAQ,QAAQA,QAAO,EAEnB,QAAU,aACd,SAAA,YAAA,wBACEC,IAAA,KAAK,UAAL,YAAAA,IAAc,QACd,cAAA,EACA,CAAE,QAAS,QAAA,CAAU,GAEnB,QAAS,WAAQ,MAAR,SAAa,WAAW,QACnC,IAAI,IAAI,QAAQ,GAAG,EAAE,QAAU,KAC/B,WAAQ,MAAR,eAAa,MAAM,KAAK,KAAM,GAGlC,IACG,0BAA0B,CACzB,mBAAoB,CAClB,OAAQ,QAAQ,OAAQ,YAAY,EACpC,QACA,KAAM,QAAQ,KACd,MACF,EACA,OAAA,CACD,EACA,KAAK,MAAM,qBAAuB,CAGjC,SAAW,CAAC,IAAK,KAAK,IAAK,oBAAoB,QACpC,SAAA,UAAU,IAAK,KAAK,EAI3B,GAFK,SAAA,WAAa,oBAAoB,QAAU,IAEhD,oBAAoB,KAAK,OAAS,WAAY,CACvC,SAAA,IAAI,oBAAoB,KAAK,MAAM,EAC5C,OAGe,gBAAA,SAAS,oBAAoB,KAAK,cACjD,SAAS,MAAM,KAAK,EAMhB,OAAQ,SAAiB,OAAU,YACpC,SAAiB,MAAM,EAG5B,SAAS,IAAI,CAAA,CACd,CACL,CACF"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/frameworks/apollo-server/index.ts"],"names":[],"mappings":"AAAA,cAAc,2BAA2B,CAAC"}
|