@h4ad/serverless-adapter 2.16.0 → 3.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 +7 -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.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.js +2 -7
- package/lib/@types/digital-ocean/digital-ocean-http-response.js.map +1 -1
- package/lib/@types/digital-ocean/index.js +2 -18
- package/lib/@types/digital-ocean/index.js.map +1 -1
- package/lib/@types/headers.js +2 -11
- package/lib/@types/headers.js.map +1 -1
- package/lib/@types/helpers.js +2 -6
- package/lib/@types/helpers.js.map +1 -1
- 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.js +2 -7
- package/lib/@types/huawei/huawei-api-gateway-response.js.map +1 -1
- package/lib/@types/huawei/huawei-context.js +2 -36
- package/lib/@types/huawei/huawei-context.js.map +1 -1
- package/lib/@types/huawei/index.js +2 -20
- package/lib/@types/huawei/index.js.map +1 -1
- package/lib/@types/index.js +2 -20
- package/lib/@types/index.js.map +1 -1
- 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.js +2 -18
- package/lib/adapters/apollo-server/index.js.map +1 -1
- 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.js +2 -140
- package/lib/adapters/aws/api-gateway-v1.adapter.js.map +1 -1
- package/lib/adapters/aws/api-gateway-v2.adapter.js +2 -133
- package/lib/adapters/aws/api-gateway-v2.adapter.js.map +1 -1
- 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.js +2 -18
- package/lib/adapters/aws/base/index.js.map +1 -1
- 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.js +2 -75
- package/lib/adapters/aws/event-bridge.adapter.js.map +1 -1
- package/lib/adapters/aws/index.js +2 -27
- package/lib/adapters/aws/index.js.map +1 -1
- 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/s3.adapter.js +2 -63
- package/lib/adapters/aws/s3.adapter.js.map +1 -1
- 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.js +2 -64
- package/lib/adapters/aws/sqs.adapter.js.map +1 -1
- 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.js +2 -18
- package/lib/adapters/azure/index.js.map +1 -1
- 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.js +2 -18
- package/lib/adapters/digital-ocean/index.js.map +1 -1
- package/lib/adapters/dummy/dummy.adapter.js +2 -54
- package/lib/adapters/dummy/dummy.adapter.js.map +1 -1
- 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.js +2 -126
- package/lib/adapters/huawei/huawei-api-gateway.adapter.js.map +1 -1
- package/lib/adapters/huawei/index.js +2 -18
- package/lib/adapters/huawei/index.js.map +1 -1
- package/lib/contracts/adapter.contract.js +2 -18
- package/lib/contracts/adapter.contract.js.map +1 -1
- package/lib/contracts/framework.contract.js +2 -7
- package/lib/contracts/framework.contract.js.map +1 -1
- package/lib/contracts/handler.contract.js +2 -13
- package/lib/contracts/handler.contract.js.map +1 -1
- package/lib/contracts/index.js +2 -21
- package/lib/contracts/index.js.map +1 -1
- package/lib/contracts/resolver.contract.js +2 -15
- package/lib/contracts/resolver.contract.js.map +1 -1
- package/lib/core/base-handler.js +2 -67
- package/lib/core/base-handler.js.map +1 -1
- package/lib/core/constants.js +2 -33
- package/lib/core/constants.js.map +1 -1
- package/lib/core/current-invoke.js +2 -46
- package/lib/core/current-invoke.js.map +1 -1
- package/lib/core/event-body.js +2 -31
- package/lib/core/event-body.js.map +1 -1
- package/lib/core/headers.js +3 -67
- package/lib/core/headers.js.map +1 -1
- package/lib/core/index.js +2 -28
- package/lib/core/index.js.map +1 -1
- package/lib/core/is-binary.js +2 -118
- package/lib/core/is-binary.js.map +1 -1
- package/lib/core/logger.js +2 -115
- package/lib/core/logger.js.map +1 -1
- package/lib/core/no-op.js +2 -12
- package/lib/core/no-op.js.map +1 -1
- package/lib/core/optional.js +2 -31
- package/lib/core/optional.js.map +1 -1
- package/lib/core/path.js +2 -68
- package/lib/core/path.js.map +1 -1
- package/lib/core/stream.js +2 -63
- package/lib/core/stream.js.map +1 -1
- 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.js +2 -18
- package/lib/frameworks/apollo-server/index.js.map +1 -1
- 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.js +2 -22
- package/lib/frameworks/body-parser/index.js.map +1 -1
- 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.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.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.js +2 -29
- package/lib/frameworks/body-parser/urlencoded-body-parser.framework.js.map +1 -1
- package/lib/frameworks/cors/cors.framework.js +3 -145
- package/lib/frameworks/cors/cors.framework.js.map +1 -1
- package/lib/frameworks/cors/index.js +2 -18
- package/lib/frameworks/cors/index.js.map +1 -1
- 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.js +2 -18
- package/lib/frameworks/deepkit/index.js.map +1 -1
- package/lib/frameworks/express/express.framework.js +2 -22
- package/lib/frameworks/express/express.framework.js.map +1 -1
- package/lib/frameworks/express/index.js +2 -18
- package/lib/frameworks/express/index.js.map +1 -1
- 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.js +2 -27
- package/lib/frameworks/fastify/helpers/no-op-content-parser.js.map +1 -1
- package/lib/frameworks/fastify/index.js +2 -18
- package/lib/frameworks/fastify/index.js.map +1 -1
- package/lib/frameworks/hapi/hapi.framework.js +2 -23
- package/lib/frameworks/hapi/hapi.framework.js.map +1 -1
- package/lib/frameworks/hapi/index.js +2 -18
- package/lib/frameworks/hapi/index.js.map +1 -1
- package/lib/frameworks/koa/index.js +2 -18
- package/lib/frameworks/koa/index.js.map +1 -1
- package/lib/frameworks/koa/koa.framework.js +2 -22
- package/lib/frameworks/koa/koa.framework.js.map +1 -1
- package/lib/frameworks/lazy/index.js +2 -18
- package/lib/frameworks/lazy/index.js.map +1 -1
- package/lib/frameworks/lazy/lazy.framework.js +2 -82
- package/lib/frameworks/lazy/lazy.framework.js.map +1 -1
- package/lib/frameworks/trpc/index.js +2 -18
- package/lib/frameworks/trpc/index.js.map +1 -1
- package/lib/frameworks/trpc/trpc.framework.js +2 -152
- package/lib/frameworks/trpc/trpc.framework.js.map +1 -1
- package/lib/handlers/aws/aws-stream.handler.js +2 -0
- package/lib/handlers/aws/aws-stream.handler.js.map +1 -0
- package/lib/handlers/aws/index.js +2 -0
- package/lib/handlers/aws/index.js.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.js +2 -18
- package/lib/handlers/azure/index.js.map +1 -1
- package/lib/handlers/base/index.js +2 -18
- package/lib/handlers/base/index.js.map +1 -1
- 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.js +2 -191
- package/lib/handlers/default/default.handler.js.map +1 -1
- 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.js +2 -34
- package/lib/handlers/digital-ocean/digital-ocean.handler.js.map +1 -1
- 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.js +2 -50
- package/lib/handlers/firebase/http-firebase-v2.handler.js.map +1 -1
- 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.js +2 -19
- package/lib/handlers/firebase/index.js.map +1 -1
- package/lib/handlers/gcp/gcp.handler.js +2 -40
- package/lib/handlers/gcp/gcp.handler.js.map +1 -1
- package/lib/handlers/gcp/index.js +2 -18
- package/lib/handlers/gcp/index.js.map +1 -1
- 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.js +2 -18
- package/lib/handlers/huawei/index.js.map +1 -1
- 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.js +2 -19
- package/lib/network/index.js.map +1 -1
- package/lib/network/request.js +2 -46
- package/lib/network/request.js.map +1 -1
- package/lib/network/response-stream.js +7 -0
- package/lib/network/response-stream.js.map +1 -0
- package/lib/network/response.js +4 -137
- package/lib/network/response.js.map +1 -1
- package/lib/network/utils.js +2 -0
- package/lib/network/utils.js.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.js +2 -18
- package/lib/resolvers/aws-context/index.js.map +1 -1
- package/lib/resolvers/callback/callback.resolver.js +2 -53
- package/lib/resolvers/callback/callback.resolver.js.map +1 -1
- package/lib/resolvers/callback/index.js +2 -18
- package/lib/resolvers/callback/index.js.map +1 -1
- package/lib/resolvers/dummy/dummy.resolver.js +2 -24
- package/lib/resolvers/dummy/dummy.resolver.js.map +1 -1
- package/lib/resolvers/dummy/index.js +2 -18
- package/lib/resolvers/dummy/index.js.map +1 -1
- package/lib/resolvers/promise/index.js +2 -18
- package/lib/resolvers/promise/index.js.map +1 -1
- package/lib/resolvers/promise/promise.resolver.js +2 -48
- package/lib/resolvers/promise/promise.resolver.js.map +1 -1
- package/lib/serverless-adapter.js +2 -176
- package/lib/serverless-adapter.js.map +1 -1
- package/package.json +61 -79
- package/lib/@types/binary-settings.d.ts +0 -43
- package/lib/@types/digital-ocean/digital-ocean-http-event.d.ts +0 -37
- package/lib/@types/digital-ocean/digital-ocean-http-response.d.ts +0 -22
- package/lib/@types/digital-ocean/index.d.ts +0 -1
- package/lib/@types/headers.d.ts +0 -39
- package/lib/@types/helpers.d.ts +0 -10
- package/lib/@types/huawei/huawei-api-gateway-event.d.ts +0 -84
- package/lib/@types/huawei/huawei-api-gateway-response.d.ts +0 -27
- package/lib/@types/huawei/huawei-context.d.ts +0 -203
- package/lib/@types/huawei/index.d.ts +0 -3
- package/lib/@types/index.d.ts +0 -3
- package/lib/adapters/apollo-server/apollo-server-mutation.adapter.d.ts +0 -56
- package/lib/adapters/apollo-server/index.d.ts +0 -1
- package/lib/adapters/aws/alb.adapter.d.ts +0 -66
- package/lib/adapters/aws/api-gateway-v1.adapter.d.ts +0 -71
- package/lib/adapters/aws/api-gateway-v2.adapter.d.ts +0 -69
- package/lib/adapters/aws/base/aws-simple-adapter.d.ts +0 -85
- package/lib/adapters/aws/base/index.d.ts +0 -1
- package/lib/adapters/aws/dynamodb.adapter.d.ts +0 -56
- package/lib/adapters/aws/event-bridge.adapter.d.ts +0 -64
- package/lib/adapters/aws/index.d.ts +0 -10
- package/lib/adapters/aws/lambda-edge.adapter.d.ts +0 -213
- package/lib/adapters/aws/s3.adapter.d.ts +0 -56
- package/lib/adapters/aws/sns.adapter.d.ts +0 -56
- package/lib/adapters/aws/sqs.adapter.d.ts +0 -56
- package/lib/adapters/azure/http-trigger-v4.adapter.d.ts +0 -81
- package/lib/adapters/azure/index.d.ts +0 -1
- package/lib/adapters/digital-ocean/http-function.adapter.d.ts +0 -65
- package/lib/adapters/digital-ocean/index.d.ts +0 -1
- package/lib/adapters/dummy/dummy.adapter.d.ts +0 -30
- package/lib/adapters/dummy/index.d.ts +0 -1
- package/lib/adapters/huawei/huawei-api-gateway.adapter.d.ts +0 -66
- package/lib/adapters/huawei/index.d.ts +0 -1
- package/lib/contracts/adapter.contract.d.ts +0 -155
- package/lib/contracts/framework.contract.d.ts +0 -19
- package/lib/contracts/handler.contract.d.ts +0 -26
- package/lib/contracts/index.d.ts +0 -4
- package/lib/contracts/resolver.contract.d.ts +0 -86
- package/lib/core/base-handler.d.ts +0 -31
- package/lib/core/constants.d.ts +0 -31
- package/lib/core/current-invoke.d.ts +0 -48
- package/lib/core/event-body.d.ts +0 -21
- package/lib/core/headers.d.ts +0 -37
- package/lib/core/index.d.ts +0 -11
- package/lib/core/is-binary.d.ts +0 -72
- package/lib/core/logger.d.ts +0 -67
- package/lib/core/no-op.d.ts +0 -7
- package/lib/core/optional.d.ts +0 -21
- package/lib/core/path.d.ts +0 -36
- package/lib/core/stream.d.ts +0 -20
- package/lib/frameworks/apollo-server/apollo-server.framework.d.ts +0 -71
- package/lib/frameworks/apollo-server/index.d.ts +0 -1
- package/lib/frameworks/body-parser/base-body-parser.framework.d.ts +0 -69
- package/lib/frameworks/body-parser/index.d.ts +0 -5
- package/lib/frameworks/body-parser/json-body-parser.framework.d.ts +0 -26
- package/lib/frameworks/body-parser/raw-body-parser.framework.d.ts +0 -26
- package/lib/frameworks/body-parser/text-body-parser.framework.d.ts +0 -26
- package/lib/frameworks/body-parser/urlencoded-body-parser.framework.d.ts +0 -26
- package/lib/frameworks/cors/cors.framework.d.ts +0 -78
- package/lib/frameworks/cors/index.d.ts +0 -1
- package/lib/frameworks/deepkit/http-deepkit.framework.d.ts +0 -17
- package/lib/frameworks/deepkit/index.d.ts +0 -1
- package/lib/frameworks/express/express.framework.d.ts +0 -16
- package/lib/frameworks/express/index.d.ts +0 -1
- package/lib/frameworks/fastify/fastify.framework.d.ts +0 -16
- package/lib/frameworks/fastify/helpers/no-op-content-parser.d.ts +0 -13
- package/lib/frameworks/fastify/index.d.ts +0 -1
- package/lib/frameworks/hapi/hapi.framework.d.ts +0 -16
- package/lib/frameworks/hapi/index.d.ts +0 -1
- package/lib/frameworks/koa/index.d.ts +0 -1
- package/lib/frameworks/koa/koa.framework.d.ts +0 -16
- package/lib/frameworks/lazy/index.d.ts +0 -1
- package/lib/frameworks/lazy/lazy.framework.d.ts +0 -55
- package/lib/frameworks/trpc/index.d.ts +0 -1
- package/lib/frameworks/trpc/trpc.framework.d.ts +0 -154
- package/lib/handlers/azure/azure.handler.d.ts +0 -45
- package/lib/handlers/azure/index.d.ts +0 -1
- package/lib/handlers/base/index.d.ts +0 -1
- package/lib/handlers/base/raw-request.d.ts +0 -30
- package/lib/handlers/default/default.handler.d.ts +0 -87
- package/lib/handlers/default/index.d.ts +0 -1
- package/lib/handlers/digital-ocean/digital-ocean.handler.d.ts +0 -16
- package/lib/handlers/digital-ocean/index.d.ts +0 -1
- package/lib/handlers/firebase/http-firebase-v2.handler.d.ts +0 -26
- package/lib/handlers/firebase/http-firebase.handler.d.ts +0 -18
- package/lib/handlers/firebase/index.d.ts +0 -2
- package/lib/handlers/gcp/gcp.handler.d.ts +0 -25
- package/lib/handlers/gcp/index.d.ts +0 -1
- package/lib/handlers/huawei/http-huawei.handler.d.ts +0 -59
- package/lib/handlers/huawei/index.d.ts +0 -1
- package/lib/index.d.ts +0 -5
- package/lib/network/index.d.ts +0 -2
- package/lib/network/request.d.ts +0 -44
- package/lib/network/response.d.ts +0 -48
- package/lib/resolvers/aws-context/aws-context.resolver.d.ts +0 -18
- package/lib/resolvers/aws-context/index.d.ts +0 -1
- package/lib/resolvers/callback/callback.resolver.d.ts +0 -23
- package/lib/resolvers/callback/index.d.ts +0 -1
- package/lib/resolvers/dummy/dummy.resolver.d.ts +0 -13
- package/lib/resolvers/dummy/index.d.ts +0 -1
- package/lib/resolvers/promise/index.d.ts +0 -1
- package/lib/resolvers/promise/promise.resolver.d.ts +0 -13
- package/lib/serverless-adapter.d.ts +0 -118
|
@@ -1,84 +0,0 @@
|
|
|
1
|
-
import { BothValueHeaders } from '../index';
|
|
2
|
-
/**
|
|
3
|
-
* The interface that represents the Api Gateway Event of Huawei when integrate with Function Graph of Event Type.
|
|
4
|
-
* See more in {@link https://support.huaweicloud.com/intl/en-us/devg-functiongraph/functiongraph_02_0102.html#functiongraph_02_0102__li5178638110137 | Reference}.
|
|
5
|
-
*
|
|
6
|
-
* @public
|
|
7
|
-
* @breadcrumb Types / Huawei / HuaweiApiGatewayEvent
|
|
8
|
-
*/
|
|
9
|
-
export interface HuaweiApiGatewayEvent {
|
|
10
|
-
/**
|
|
11
|
-
* The body value with the content of this event serialized in JSON
|
|
12
|
-
*/
|
|
13
|
-
body: string;
|
|
14
|
-
/**
|
|
15
|
-
* The headers of the request which this event represents
|
|
16
|
-
*/
|
|
17
|
-
headers: BothValueHeaders;
|
|
18
|
-
/**
|
|
19
|
-
* The HTTP Method of the request which this event represents
|
|
20
|
-
*/
|
|
21
|
-
httpMethod: string;
|
|
22
|
-
/**
|
|
23
|
-
* Tells if the body is base64 encoded
|
|
24
|
-
*/
|
|
25
|
-
isBase64Encoded: boolean;
|
|
26
|
-
/**
|
|
27
|
-
* The path of the request which this event represents
|
|
28
|
-
*/
|
|
29
|
-
path: string;
|
|
30
|
-
/**
|
|
31
|
-
* The path parameters of the request which this event represents
|
|
32
|
-
*/
|
|
33
|
-
pathParameters: HuaweiRequestPathParameters;
|
|
34
|
-
/**
|
|
35
|
-
* The query strings of the request which this event represents
|
|
36
|
-
*/
|
|
37
|
-
queryStringParameters: HuaweiRequestQueryStringParameters;
|
|
38
|
-
/**
|
|
39
|
-
* The request context with information about the stage, api and requestId
|
|
40
|
-
*/
|
|
41
|
-
requestContext: HuaweiRequestContext;
|
|
42
|
-
/**
|
|
43
|
-
* It can have more properties that I could not discover yet
|
|
44
|
-
*/
|
|
45
|
-
[key: string]: any;
|
|
46
|
-
}
|
|
47
|
-
/**
|
|
48
|
-
* The path parameters of the request, usually is the name of the wildcard you create in FunctionGraph, such as /\{proxy\}.
|
|
49
|
-
*
|
|
50
|
-
* @public
|
|
51
|
-
* @breadcrumb Types / Huawei / HuaweiApiGatewayEvent
|
|
52
|
-
*/
|
|
53
|
-
export declare type HuaweiRequestPathParameters = Record<string, string>;
|
|
54
|
-
/**
|
|
55
|
-
* The query strings of the request
|
|
56
|
-
*
|
|
57
|
-
* @public
|
|
58
|
-
* @breadcrumb Types / Huawei / HuaweiApiGatewayEvent
|
|
59
|
-
*/
|
|
60
|
-
export declare type HuaweiRequestQueryStringParameters = Record<string, string | string[]>;
|
|
61
|
-
/**
|
|
62
|
-
* The interface that represents the values you can get inside request context.
|
|
63
|
-
*
|
|
64
|
-
* @public
|
|
65
|
-
* @breadcrumb Types / Huawei / HuaweiApiGatewayEvent
|
|
66
|
-
*/
|
|
67
|
-
export interface HuaweiRequestContext {
|
|
68
|
-
/**
|
|
69
|
-
* The ID of your API inside Api Gateway
|
|
70
|
-
*/
|
|
71
|
-
apiId: string;
|
|
72
|
-
/**
|
|
73
|
-
* The ID of this request
|
|
74
|
-
*/
|
|
75
|
-
requestId: string;
|
|
76
|
-
/**
|
|
77
|
-
* The name of the stage running this Function Graph
|
|
78
|
-
*/
|
|
79
|
-
stage: string;
|
|
80
|
-
}
|
|
81
|
-
export declare type __ΩHuaweiApiGatewayEvent = any[];
|
|
82
|
-
export declare type __ΩHuaweiRequestPathParameters = any[];
|
|
83
|
-
export declare type __ΩHuaweiRequestQueryStringParameters = any[];
|
|
84
|
-
export declare type __ΩHuaweiRequestContext = any[];
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { MultiValueHeaders } from '../headers';
|
|
2
|
-
/**
|
|
3
|
-
* The interface that represents the Api Gateway Response of Huawei when integrate with Function Graph of Event Type.
|
|
4
|
-
* See more in {@link https://support.huaweicloud.com/intl/en-us/devg-functiongraph/functiongraph_02_0102.html#functiongraph_02_0102__li5178638110137 | Reference}.
|
|
5
|
-
*
|
|
6
|
-
* @public
|
|
7
|
-
* @breadcrumb Types / Huawei / HuaweiApiGatewayResponse
|
|
8
|
-
*/
|
|
9
|
-
export interface HuaweiApiGatewayResponse {
|
|
10
|
-
/**
|
|
11
|
-
* Tells if the body was encoded as base64
|
|
12
|
-
*/
|
|
13
|
-
isBase64Encoded: boolean;
|
|
14
|
-
/**
|
|
15
|
-
* The HTTP Status code of this response
|
|
16
|
-
*/
|
|
17
|
-
statusCode: number;
|
|
18
|
-
/**
|
|
19
|
-
* The headers sent with this response
|
|
20
|
-
*/
|
|
21
|
-
headers: MultiValueHeaders;
|
|
22
|
-
/**
|
|
23
|
-
* The body value with the content of this response serialized in JSON
|
|
24
|
-
*/
|
|
25
|
-
body: string;
|
|
26
|
-
}
|
|
27
|
-
export declare type __ΩHuaweiApiGatewayResponse = any[];
|
|
@@ -1,203 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* The return value of {@link HuaweiContext} getRequestID
|
|
3
|
-
*
|
|
4
|
-
* @public
|
|
5
|
-
* @breadcrumb Types / Huawei / HuaweiContext
|
|
6
|
-
*/
|
|
7
|
-
export declare type GetRequestIDSecondsReturn = string;
|
|
8
|
-
/**
|
|
9
|
-
* The return value of {@link HuaweiContext} getRemainingTimeInMilliSeconds
|
|
10
|
-
*
|
|
11
|
-
* @public
|
|
12
|
-
* @breadcrumb Types / Huawei / HuaweiContext
|
|
13
|
-
*/
|
|
14
|
-
export declare type GetRemainingTimeInMilliSecondsReturn = number;
|
|
15
|
-
/**
|
|
16
|
-
* The return value of {@link HuaweiContext} getAccessKey
|
|
17
|
-
*
|
|
18
|
-
* @public
|
|
19
|
-
* @breadcrumb Types / Huawei / HuaweiContext
|
|
20
|
-
*/
|
|
21
|
-
export declare type GetAccessKeyReturn = string;
|
|
22
|
-
/**
|
|
23
|
-
* The return value of {@link HuaweiContext} getSecretKey
|
|
24
|
-
*
|
|
25
|
-
* @public
|
|
26
|
-
* @breadcrumb Types / Huawei / HuaweiContext
|
|
27
|
-
*/
|
|
28
|
-
export declare type GetSecretKeyReturn = string;
|
|
29
|
-
/**
|
|
30
|
-
* The parameters of the method {@link HuaweiContext} getUserData
|
|
31
|
-
*
|
|
32
|
-
* @public
|
|
33
|
-
* @breadcrumb Types / Huawei / HuaweiContext
|
|
34
|
-
*/
|
|
35
|
-
export declare type GetUserDataKeyParameter = string;
|
|
36
|
-
/**
|
|
37
|
-
* The return value of {@link HuaweiContext} getUserData
|
|
38
|
-
*
|
|
39
|
-
* @public
|
|
40
|
-
* @breadcrumb Types / Huawei / HuaweiContext
|
|
41
|
-
*/
|
|
42
|
-
export declare type GetUserDataReturn = any;
|
|
43
|
-
/**
|
|
44
|
-
* The return value of {@link HuaweiContext} getFunctionName
|
|
45
|
-
*
|
|
46
|
-
* @public
|
|
47
|
-
* @breadcrumb Types / Huawei / HuaweiContext
|
|
48
|
-
*/
|
|
49
|
-
export declare type GetFunctionNameReturn = string;
|
|
50
|
-
/**
|
|
51
|
-
* The return value of {@link HuaweiContext} getRunningTimeInSeconds
|
|
52
|
-
*
|
|
53
|
-
* @public
|
|
54
|
-
* @breadcrumb Types / Huawei / HuaweiContext
|
|
55
|
-
*/
|
|
56
|
-
export declare type GetRunningTimeInSecondsReturn = number;
|
|
57
|
-
/**
|
|
58
|
-
* The return value of {@link HuaweiContext} getVersion
|
|
59
|
-
*
|
|
60
|
-
* @public
|
|
61
|
-
* @breadcrumb Types / Huawei / HuaweiContext
|
|
62
|
-
*/
|
|
63
|
-
export declare type GetVersionReturn = string;
|
|
64
|
-
/**
|
|
65
|
-
* The return value of {@link HuaweiContext} getMemorySize
|
|
66
|
-
*
|
|
67
|
-
* @public
|
|
68
|
-
* @breadcrumb Types / Huawei / HuaweiContext
|
|
69
|
-
*/
|
|
70
|
-
export declare type GetMemorySizeReturn = number;
|
|
71
|
-
/**
|
|
72
|
-
* The return value of {@link HuaweiContext} getCPUNumber
|
|
73
|
-
*
|
|
74
|
-
* @public
|
|
75
|
-
* @breadcrumb Types / Huawei / HuaweiContext
|
|
76
|
-
*/
|
|
77
|
-
export declare type GetCPUNumberReturn = number;
|
|
78
|
-
/**
|
|
79
|
-
* The return value of {@link HuaweiContext} getProjectID
|
|
80
|
-
*
|
|
81
|
-
* @public
|
|
82
|
-
* @breadcrumb Types / Huawei / HuaweiContext
|
|
83
|
-
*/
|
|
84
|
-
export declare type GetProjectIdReturn = number;
|
|
85
|
-
/**
|
|
86
|
-
* The return value of {@link HuaweiContext} getPackage
|
|
87
|
-
*
|
|
88
|
-
* @public
|
|
89
|
-
* @breadcrumb Types / Huawei / HuaweiContext
|
|
90
|
-
*/
|
|
91
|
-
export declare type GetPackageReturn = string;
|
|
92
|
-
/**
|
|
93
|
-
* The return value of {@link HuaweiContext} getToken
|
|
94
|
-
*
|
|
95
|
-
* @public
|
|
96
|
-
* @breadcrumb Types / Huawei / HuaweiContext
|
|
97
|
-
*/
|
|
98
|
-
export declare type GetTokenReturn = string;
|
|
99
|
-
/**
|
|
100
|
-
* The return value of {@link HuaweiContext} getLogger
|
|
101
|
-
*
|
|
102
|
-
* Is the instance of logger that can be used to send logs to
|
|
103
|
-
*
|
|
104
|
-
* @public
|
|
105
|
-
* @breadcrumb Types / Huawei / HuaweiContext
|
|
106
|
-
*/
|
|
107
|
-
export declare type GetLoggerReturn = {
|
|
108
|
-
info(message: string): void;
|
|
109
|
-
};
|
|
110
|
-
/**
|
|
111
|
-
* The interface that represents methods sent by huawei to get information about the function graph.
|
|
112
|
-
* See more in {@link https://support.huaweicloud.com/intl/en-us/devg-functiongraph/functiongraph_02_0410.html#section1 | Context Methods}
|
|
113
|
-
*
|
|
114
|
-
* @public
|
|
115
|
-
* @breadcrumb Types / Huawei / HuaweiContext
|
|
116
|
-
*/
|
|
117
|
-
export interface HuaweiContext {
|
|
118
|
-
/**
|
|
119
|
-
* Obtains a request ID.
|
|
120
|
-
*/
|
|
121
|
-
getRequestID(): GetRequestIDSecondsReturn;
|
|
122
|
-
/**
|
|
123
|
-
* Obtains the remaining running time of a function.
|
|
124
|
-
*/
|
|
125
|
-
getRemainingTimeInMilliSeconds(): GetRemainingTimeInMilliSecondsReturn;
|
|
126
|
-
/**
|
|
127
|
-
* Obtains the AK (valid for 24 hours) of an agency. If you use this method, you need to configure an agency for the function.
|
|
128
|
-
*/
|
|
129
|
-
getAccessKey(): GetAccessKeyReturn;
|
|
130
|
-
/**
|
|
131
|
-
* Obtains the SK (valid for 24 hours) of an agency. If you use this method, you need to configure an agency for the function.
|
|
132
|
-
*/
|
|
133
|
-
getSecretKey(): GetSecretKeyReturn;
|
|
134
|
-
/**
|
|
135
|
-
* Uses keys to obtain the values passed by environment variables.
|
|
136
|
-
*
|
|
137
|
-
* @param key - The key to get environment variables values
|
|
138
|
-
*/
|
|
139
|
-
getUserData(key: GetUserDataKeyParameter): GetUserDataReturn;
|
|
140
|
-
/**
|
|
141
|
-
* Obtains the name of a function.
|
|
142
|
-
*/
|
|
143
|
-
getFunctionName(): GetFunctionNameReturn;
|
|
144
|
-
/**
|
|
145
|
-
* Obtains the timeout of a function.
|
|
146
|
-
*/
|
|
147
|
-
getRunningTimeInSeconds(): GetRunningTimeInSecondsReturn;
|
|
148
|
-
/**
|
|
149
|
-
* Obtains the version of a function.
|
|
150
|
-
*/
|
|
151
|
-
getVersion(): GetVersionReturn;
|
|
152
|
-
/**
|
|
153
|
-
* Obtains the allocated memory.
|
|
154
|
-
*/
|
|
155
|
-
getMemorySize(): GetMemorySizeReturn;
|
|
156
|
-
/**
|
|
157
|
-
* Number of CPU millicores used by the function (1 core = 1000 millicores).
|
|
158
|
-
*
|
|
159
|
-
* The value of this field is proportional to that of MemorySize. By default, 100 CPU millicores are required for 128 MB memory. The number of CPU millicores is calculated as follows: Memory/128 x 100 + 200 (basic CPU millicores).
|
|
160
|
-
*/
|
|
161
|
-
getCPUNumber(): GetCPUNumberReturn;
|
|
162
|
-
/**
|
|
163
|
-
* Obtains a project ID.
|
|
164
|
-
*/
|
|
165
|
-
getProjectID(): GetProjectIdReturn;
|
|
166
|
-
/**
|
|
167
|
-
* Obtains a function group, that is, an app.
|
|
168
|
-
*/
|
|
169
|
-
getPackage(): GetPackageReturn;
|
|
170
|
-
/**
|
|
171
|
-
* Obtains the token (valid for 24 hours) of an agency. If you use this method, you need to configure an agency for the function.
|
|
172
|
-
*/
|
|
173
|
-
getToken(): GetTokenReturn;
|
|
174
|
-
/**
|
|
175
|
-
* Obtains the logger method provided by the context and returns a log output class. Logs are output in the format of Time-Request ID-Content by using the info method.
|
|
176
|
-
*
|
|
177
|
-
* For example, use the info method to output logs:
|
|
178
|
-
*
|
|
179
|
-
* @example
|
|
180
|
-
* ```typescript
|
|
181
|
-
* logg = context.getLogger()
|
|
182
|
-
*
|
|
183
|
-
* logg.info("hello")
|
|
184
|
-
* ```
|
|
185
|
-
*/
|
|
186
|
-
getLogger(): GetLoggerReturn;
|
|
187
|
-
}
|
|
188
|
-
export declare type __ΩGetRequestIDSecondsReturn = any[];
|
|
189
|
-
export declare type __ΩGetRemainingTimeInMilliSecondsReturn = any[];
|
|
190
|
-
export declare type __ΩGetAccessKeyReturn = any[];
|
|
191
|
-
export declare type __ΩGetSecretKeyReturn = any[];
|
|
192
|
-
export declare type __ΩGetUserDataKeyParameter = any[];
|
|
193
|
-
export declare type __ΩGetUserDataReturn = any[];
|
|
194
|
-
export declare type __ΩGetFunctionNameReturn = any[];
|
|
195
|
-
export declare type __ΩGetRunningTimeInSecondsReturn = any[];
|
|
196
|
-
export declare type __ΩGetVersionReturn = any[];
|
|
197
|
-
export declare type __ΩGetMemorySizeReturn = any[];
|
|
198
|
-
export declare type __ΩGetCPUNumberReturn = any[];
|
|
199
|
-
export declare type __ΩGetProjectIdReturn = any[];
|
|
200
|
-
export declare type __ΩGetPackageReturn = any[];
|
|
201
|
-
export declare type __ΩGetTokenReturn = any[];
|
|
202
|
-
export declare type __ΩGetLoggerReturn = any[];
|
|
203
|
-
export declare type __ΩHuaweiContext = any[];
|
package/lib/@types/index.d.ts
DELETED
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
import { AdapterContract, AdapterRequest, GetResponseAdapterProps, OnErrorProps } from '../../contracts';
|
|
2
|
-
import { ILogger } from '../../core';
|
|
3
|
-
/**
|
|
4
|
-
* The options for {@link ApolloServerMutationAdapter}
|
|
5
|
-
*
|
|
6
|
-
* @breadcrumb Adapters / Apollo Server / ApolloServerMutationAdapter
|
|
7
|
-
* @public
|
|
8
|
-
*/
|
|
9
|
-
export declare type ApolloServerMutationAdapterOptions = {
|
|
10
|
-
/**
|
|
11
|
-
* Specify the name of mutation that will be called when an event was received
|
|
12
|
-
*/
|
|
13
|
-
mutationName: string;
|
|
14
|
-
/**
|
|
15
|
-
* Specify the mutation result schema.
|
|
16
|
-
* Use this to customize the behavior when you need to return a specific object to be handled by the Adapter, like SQS with Batch Mode.
|
|
17
|
-
*
|
|
18
|
-
* @defaultValue `{ __typename }`
|
|
19
|
-
*/
|
|
20
|
-
mutationResultQuery?: string;
|
|
21
|
-
};
|
|
22
|
-
/**
|
|
23
|
-
* The adapter that wraps another adapter to force a transformation of the event data as a mutation to Apollo Server be able to handle.
|
|
24
|
-
*
|
|
25
|
-
* @breadcrumb Adapters / Apollo Server / ApolloServerMutationAdapter
|
|
26
|
-
* @public
|
|
27
|
-
*/
|
|
28
|
-
export declare class ApolloServerMutationAdapter<TEvent, TContext, TResponse, TBaseAdapter extends AdapterContract<TEvent, TContext, TResponse>> implements AdapterContract<TEvent, TContext, TResponse> {
|
|
29
|
-
protected readonly baseAdapter: TBaseAdapter;
|
|
30
|
-
protected readonly options: ApolloServerMutationAdapterOptions;
|
|
31
|
-
/**
|
|
32
|
-
* The default constructor
|
|
33
|
-
*/
|
|
34
|
-
constructor(baseAdapter: TBaseAdapter, options: ApolloServerMutationAdapterOptions);
|
|
35
|
-
/**
|
|
36
|
-
* {@inheritDoc}
|
|
37
|
-
*/
|
|
38
|
-
canHandle(event: unknown, context: TContext, log: ILogger): boolean;
|
|
39
|
-
/**
|
|
40
|
-
* {@inheritDoc}
|
|
41
|
-
*/
|
|
42
|
-
getAdapterName(): string;
|
|
43
|
-
/**
|
|
44
|
-
* {@inheritDoc}
|
|
45
|
-
*/
|
|
46
|
-
getRequest(event: TEvent, context: TContext, log: ILogger): AdapterRequest;
|
|
47
|
-
/**
|
|
48
|
-
* {@inheritDoc}
|
|
49
|
-
*/
|
|
50
|
-
getResponse(props: GetResponseAdapterProps<TEvent>): TResponse;
|
|
51
|
-
/**
|
|
52
|
-
* {@inheritDoc}
|
|
53
|
-
*/
|
|
54
|
-
onErrorWhileForwarding(props: OnErrorProps<TEvent, TResponse>): void;
|
|
55
|
-
}
|
|
56
|
-
export declare type __ΩApolloServerMutationAdapterOptions = any[];
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './apollo-server-mutation.adapter';
|
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
import type { ALBEvent, ALBResult, Context } from 'aws-lambda';
|
|
2
|
-
import { AdapterContract, AdapterRequest, GetResponseAdapterProps, OnErrorProps } from '../../contracts';
|
|
3
|
-
/**
|
|
4
|
-
* The options to customize the {@link AlbAdapter}
|
|
5
|
-
*
|
|
6
|
-
* @breadcrumb Adapters / AWS / AlbAdapter
|
|
7
|
-
* @public
|
|
8
|
-
*/
|
|
9
|
-
export interface AlbAdapterOptions {
|
|
10
|
-
/**
|
|
11
|
-
* Strip base path for custom domains
|
|
12
|
-
*
|
|
13
|
-
* @defaultValue ''
|
|
14
|
-
*/
|
|
15
|
-
stripBasePath?: string;
|
|
16
|
-
}
|
|
17
|
-
/**
|
|
18
|
-
* The adapter to handle requests from AWS ALB
|
|
19
|
-
*
|
|
20
|
-
* @example
|
|
21
|
-
* ```typescript
|
|
22
|
-
* const stripBasePath = '/any/custom/base/path'; // default ''
|
|
23
|
-
* const adapter = new AlbAdapter({ stripBasePath });
|
|
24
|
-
* ```
|
|
25
|
-
*
|
|
26
|
-
* {@link https://docs.aws.amazon.com/lambda/latest/dg/services-alb.html | Event Reference}
|
|
27
|
-
*
|
|
28
|
-
* @breadcrumb Adapters / AWS / AlbAdapter
|
|
29
|
-
* @public
|
|
30
|
-
*/
|
|
31
|
-
export declare class AlbAdapter implements AdapterContract<ALBEvent, Context, ALBResult> {
|
|
32
|
-
protected readonly options?: AlbAdapterOptions | undefined;
|
|
33
|
-
/**
|
|
34
|
-
* Default constructor
|
|
35
|
-
*
|
|
36
|
-
* @param options - The options to customize the {@link AlbAdapter}
|
|
37
|
-
*/
|
|
38
|
-
constructor(options?: AlbAdapterOptions | undefined);
|
|
39
|
-
/**
|
|
40
|
-
* {@inheritDoc}
|
|
41
|
-
*/
|
|
42
|
-
getAdapterName(): string;
|
|
43
|
-
/**
|
|
44
|
-
* {@inheritDoc}
|
|
45
|
-
*/
|
|
46
|
-
canHandle(event: unknown): event is ALBEvent;
|
|
47
|
-
/**
|
|
48
|
-
* {@inheritDoc}
|
|
49
|
-
*/
|
|
50
|
-
getRequest(event: ALBEvent): AdapterRequest;
|
|
51
|
-
/**
|
|
52
|
-
* {@inheritDoc}
|
|
53
|
-
*/
|
|
54
|
-
getResponse({ event, headers: responseHeaders, body, isBase64Encoded, statusCode, }: GetResponseAdapterProps<ALBEvent>): ALBResult;
|
|
55
|
-
/**
|
|
56
|
-
* {@inheritDoc}
|
|
57
|
-
*/
|
|
58
|
-
onErrorWhileForwarding({ error, delegatedResolver, respondWithErrors, event, log, }: OnErrorProps<ALBEvent, ALBResult>): void;
|
|
59
|
-
/**
|
|
60
|
-
* Get path from event with query strings
|
|
61
|
-
*
|
|
62
|
-
* @param event - The event sent by serverless
|
|
63
|
-
*/
|
|
64
|
-
protected getPathFromEvent(event: ALBEvent): string;
|
|
65
|
-
}
|
|
66
|
-
export declare type __ΩAlbAdapterOptions = any[];
|
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
import type { APIGatewayProxyResult, Context } from 'aws-lambda';
|
|
2
|
-
import type { APIGatewayProxyEvent } from 'aws-lambda/trigger/api-gateway-proxy';
|
|
3
|
-
import { AdapterContract, AdapterRequest, GetResponseAdapterProps, OnErrorProps } from '../../contracts';
|
|
4
|
-
/**
|
|
5
|
-
* The options to customize the {@link ApiGatewayV1Adapter}
|
|
6
|
-
*
|
|
7
|
-
* @breadcrumb Adapters / AWS / ApiGatewayV1Adapter
|
|
8
|
-
* @public
|
|
9
|
-
*/
|
|
10
|
-
export interface ApiGatewayV1Options {
|
|
11
|
-
/**
|
|
12
|
-
* Strip base path for custom domains
|
|
13
|
-
*
|
|
14
|
-
* @defaultValue ''
|
|
15
|
-
*/
|
|
16
|
-
stripBasePath?: string;
|
|
17
|
-
}
|
|
18
|
-
/**
|
|
19
|
-
* The adapter to handle requests from AWS Api Gateway V1
|
|
20
|
-
*
|
|
21
|
-
* As per {@link https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-known-issues.html | know issues}, we throw an exception when you send the `transfer-encoding=chunked`, currently, API Gateway doesn't support chunked transfer.
|
|
22
|
-
*
|
|
23
|
-
* @remarks This adapter is not fully compatible with \@vendia/serverless-express, on \@vendia they filter `transfer-encoding=chunked` but we throw an exception.
|
|
24
|
-
*
|
|
25
|
-
* @example
|
|
26
|
-
* ```typescript
|
|
27
|
-
* const stripBasePath = '/any/custom/base/path'; // default ''
|
|
28
|
-
* const adapter = new ApiGatewayV1Adapter({ stripBasePath });
|
|
29
|
-
* ```
|
|
30
|
-
*
|
|
31
|
-
* {@link https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-develop-integrations-lambda.html | Event Reference}
|
|
32
|
-
*
|
|
33
|
-
* @breadcrumb Adapters / AWS / ApiGatewayV1Adapter
|
|
34
|
-
* @public
|
|
35
|
-
*/
|
|
36
|
-
export declare class ApiGatewayV1Adapter implements AdapterContract<APIGatewayProxyEvent, Context, APIGatewayProxyResult> {
|
|
37
|
-
protected readonly options?: ApiGatewayV1Options | undefined;
|
|
38
|
-
/**
|
|
39
|
-
* Default constructor
|
|
40
|
-
*
|
|
41
|
-
* @param options - The options to customize the {@link ApiGatewayV1Adapter}
|
|
42
|
-
*/
|
|
43
|
-
constructor(options?: ApiGatewayV1Options | undefined);
|
|
44
|
-
/**
|
|
45
|
-
* {@inheritDoc}
|
|
46
|
-
*/
|
|
47
|
-
getAdapterName(): string;
|
|
48
|
-
/**
|
|
49
|
-
* {@inheritDoc}
|
|
50
|
-
*/
|
|
51
|
-
canHandle(event: unknown): event is APIGatewayProxyEvent;
|
|
52
|
-
/**
|
|
53
|
-
* {@inheritDoc}
|
|
54
|
-
*/
|
|
55
|
-
getRequest(event: APIGatewayProxyEvent): AdapterRequest;
|
|
56
|
-
/**
|
|
57
|
-
* {@inheritDoc}
|
|
58
|
-
*/
|
|
59
|
-
getResponse({ headers: responseHeaders, body, isBase64Encoded, statusCode, response, }: GetResponseAdapterProps<APIGatewayProxyEvent>): APIGatewayProxyResult;
|
|
60
|
-
/**
|
|
61
|
-
* {@inheritDoc}
|
|
62
|
-
*/
|
|
63
|
-
onErrorWhileForwarding({ error, delegatedResolver, respondWithErrors, event, log, }: OnErrorProps<APIGatewayProxyEvent, APIGatewayProxyResult>): void;
|
|
64
|
-
/**
|
|
65
|
-
* Get path from event with query strings
|
|
66
|
-
*
|
|
67
|
-
* @param event - The event sent by serverless
|
|
68
|
-
*/
|
|
69
|
-
protected getPathFromEvent(event: APIGatewayProxyEvent): string;
|
|
70
|
-
}
|
|
71
|
-
export declare type __ΩApiGatewayV1Options = any[];
|
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
import type { APIGatewayProxyEventV2, Context } from 'aws-lambda';
|
|
2
|
-
import type { APIGatewayProxyStructuredResultV2 } from 'aws-lambda/trigger/api-gateway-proxy';
|
|
3
|
-
import { AdapterContract, AdapterRequest, GetResponseAdapterProps, OnErrorProps } from '../../contracts';
|
|
4
|
-
/**
|
|
5
|
-
* The options to customize the {@link ApiGatewayV2Adapter}
|
|
6
|
-
*
|
|
7
|
-
* @breadcrumb Adapters / AWS / ApiGatewayV2Adapter
|
|
8
|
-
* @public
|
|
9
|
-
*/
|
|
10
|
-
export interface ApiGatewayV2Options {
|
|
11
|
-
/**
|
|
12
|
-
* Strip base path for custom domains
|
|
13
|
-
*
|
|
14
|
-
* @defaultValue ''
|
|
15
|
-
*/
|
|
16
|
-
stripBasePath?: string;
|
|
17
|
-
}
|
|
18
|
-
/**
|
|
19
|
-
* The adapter to handle requests from AWS Api Gateway V2
|
|
20
|
-
*
|
|
21
|
-
* As per {@link https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-known-issues.html | know issues}, we throw an exception when you send the `transfer-encoding=chunked`, currently, API Gateway doesn't support chunked transfer.
|
|
22
|
-
*
|
|
23
|
-
* @example
|
|
24
|
-
* ```typescript
|
|
25
|
-
* const stripBasePath = '/any/custom/base/path'; // default ''
|
|
26
|
-
* const adapter = new ApiGatewayV2Adapter({ stripBasePath });
|
|
27
|
-
* ```
|
|
28
|
-
*
|
|
29
|
-
* {@link https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-develop-integrations-lambda.html | Event Reference}
|
|
30
|
-
*
|
|
31
|
-
* @breadcrumb Adapters / AWS / ApiGatewayV2Adapter
|
|
32
|
-
* @public
|
|
33
|
-
*/
|
|
34
|
-
export declare class ApiGatewayV2Adapter implements AdapterContract<APIGatewayProxyEventV2, Context, APIGatewayProxyStructuredResultV2> {
|
|
35
|
-
protected readonly options?: ApiGatewayV2Options | undefined;
|
|
36
|
-
/**
|
|
37
|
-
* Default constructor
|
|
38
|
-
*
|
|
39
|
-
* @param options - The options to customize the {@link ApiGatewayV2Adapter}
|
|
40
|
-
*/
|
|
41
|
-
constructor(options?: ApiGatewayV2Options | undefined);
|
|
42
|
-
/**
|
|
43
|
-
* {@inheritDoc}
|
|
44
|
-
*/
|
|
45
|
-
getAdapterName(): string;
|
|
46
|
-
/**
|
|
47
|
-
* {@inheritDoc}
|
|
48
|
-
*/
|
|
49
|
-
canHandle(event: unknown): event is APIGatewayProxyEventV2;
|
|
50
|
-
/**
|
|
51
|
-
* {@inheritDoc}
|
|
52
|
-
*/
|
|
53
|
-
getRequest(event: APIGatewayProxyEventV2): AdapterRequest;
|
|
54
|
-
/**
|
|
55
|
-
* {@inheritDoc}
|
|
56
|
-
*/
|
|
57
|
-
getResponse({ headers: responseHeaders, body, isBase64Encoded, statusCode, response, }: GetResponseAdapterProps<APIGatewayProxyEventV2>): APIGatewayProxyStructuredResultV2;
|
|
58
|
-
/**
|
|
59
|
-
* {@inheritDoc}
|
|
60
|
-
*/
|
|
61
|
-
onErrorWhileForwarding({ error, delegatedResolver, respondWithErrors, event, log, }: OnErrorProps<APIGatewayProxyEventV2, APIGatewayProxyStructuredResultV2>): void;
|
|
62
|
-
/**
|
|
63
|
-
* Get path from event with query strings
|
|
64
|
-
*
|
|
65
|
-
* @param event - The event sent by serverless
|
|
66
|
-
*/
|
|
67
|
-
protected getPathFromEvent(event: APIGatewayProxyEventV2): string;
|
|
68
|
-
}
|
|
69
|
-
export declare type __ΩApiGatewayV2Options = any[];
|
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
import type { Context, SQSBatchItemFailure } from 'aws-lambda';
|
|
2
|
-
import { AdapterContract, AdapterRequest, GetResponseAdapterProps, OnErrorProps } from '../../../contracts/index';
|
|
3
|
-
import { IEmptyResponse } from '../../../core/index';
|
|
4
|
-
/**
|
|
5
|
-
* The options to customize the {@link AwsSimpleAdapter}
|
|
6
|
-
*
|
|
7
|
-
* @breadcrumb Adapters / AWS / AWS Simple Adapter
|
|
8
|
-
* @public
|
|
9
|
-
*/
|
|
10
|
-
export interface AWSSimpleAdapterOptions {
|
|
11
|
-
/**
|
|
12
|
-
* The path that will be used to create a request to be forwarded to the framework.
|
|
13
|
-
*/
|
|
14
|
-
forwardPath: string;
|
|
15
|
-
/**
|
|
16
|
-
* The http method that will be used to create a request to be forwarded to the framework.
|
|
17
|
-
*/
|
|
18
|
-
forwardMethod: string;
|
|
19
|
-
/**
|
|
20
|
-
* The AWS Service host that will be injected inside headers to developer being able to validate if request originate from the library.
|
|
21
|
-
*/
|
|
22
|
-
host: string;
|
|
23
|
-
/**
|
|
24
|
-
* Tells if this adapter should support batch item failures.
|
|
25
|
-
*/
|
|
26
|
-
batch?: true | false;
|
|
27
|
-
}
|
|
28
|
-
/**
|
|
29
|
-
* The batch item failure response expected from the API server
|
|
30
|
-
*
|
|
31
|
-
* @breadcrumb Adapters / AWS / AWS Simple Adapter
|
|
32
|
-
* @public
|
|
33
|
-
*/
|
|
34
|
-
export declare type BatchItemFailureResponse = SQSBatchItemFailure;
|
|
35
|
-
/**
|
|
36
|
-
* The possible options of response for {@link AwsSimpleAdapter}
|
|
37
|
-
*
|
|
38
|
-
* @breadcrumb Adapters / AWS / AWS Simple Adapter
|
|
39
|
-
* @public
|
|
40
|
-
*/
|
|
41
|
-
export declare type AWSSimpleAdapterResponseType = BatchItemFailureResponse | IEmptyResponse;
|
|
42
|
-
/**
|
|
43
|
-
* The abstract adapter to use to implement other simple AWS adapters
|
|
44
|
-
*
|
|
45
|
-
* @breadcrumb Adapters / AWS / AWS Simple Adapter
|
|
46
|
-
* @public
|
|
47
|
-
*/
|
|
48
|
-
export declare abstract class AwsSimpleAdapter<TEvent> implements AdapterContract<TEvent, Context, AWSSimpleAdapterResponseType> {
|
|
49
|
-
protected readonly options: AWSSimpleAdapterOptions;
|
|
50
|
-
/**
|
|
51
|
-
* Default constructor
|
|
52
|
-
*
|
|
53
|
-
* @param options - The options to customize the {@link AwsSimpleAdapter}
|
|
54
|
-
*/
|
|
55
|
-
constructor(options: AWSSimpleAdapterOptions);
|
|
56
|
-
/**
|
|
57
|
-
* {@inheritDoc}
|
|
58
|
-
*/
|
|
59
|
-
getAdapterName(): string;
|
|
60
|
-
/**
|
|
61
|
-
* {@inheritDoc}
|
|
62
|
-
*/
|
|
63
|
-
canHandle(event: unknown): event is TEvent;
|
|
64
|
-
/**
|
|
65
|
-
* {@inheritDoc}
|
|
66
|
-
*/
|
|
67
|
-
getRequest(event: TEvent): AdapterRequest;
|
|
68
|
-
/**
|
|
69
|
-
* {@inheritDoc}
|
|
70
|
-
*/
|
|
71
|
-
getResponse({ body, headers, isBase64Encoded, event, statusCode, }: GetResponseAdapterProps<TEvent>): AWSSimpleAdapterResponseType;
|
|
72
|
-
/**
|
|
73
|
-
* {@inheritDoc}
|
|
74
|
-
*/
|
|
75
|
-
onErrorWhileForwarding({ error, delegatedResolver, }: OnErrorProps<TEvent, AWSSimpleAdapterResponseType>): void;
|
|
76
|
-
/**
|
|
77
|
-
* Check if the status code is invalid
|
|
78
|
-
*
|
|
79
|
-
* @param statusCode - The status code
|
|
80
|
-
*/
|
|
81
|
-
protected hasInvalidStatusCode(statusCode: number): boolean;
|
|
82
|
-
}
|
|
83
|
-
export declare type __ΩAWSSimpleAdapterOptions = any[];
|
|
84
|
-
export declare type __ΩBatchItemFailureResponse = any[];
|
|
85
|
-
export declare type __ΩAWSSimpleAdapterResponseType = any[];
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './aws-simple-adapter';
|