@h4ad/serverless-adapter 2.3.1 → 2.5.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 +22 -243
- package/lib/@types/binary-settings.d.ts +24 -6
- package/lib/@types/binary-settings.d.ts.map +1 -0
- package/lib/@types/binary-settings.js +1 -0
- package/lib/@types/binary-settings.js.map +1 -0
- package/lib/@types/headers.d.ts +16 -3
- package/lib/@types/headers.d.ts.map +1 -0
- package/lib/@types/headers.js +1 -0
- package/lib/@types/headers.js.map +1 -0
- package/lib/@types/helpers.d.ts +4 -0
- package/lib/@types/helpers.d.ts.map +1 -0
- package/lib/@types/helpers.js +1 -0
- package/lib/@types/helpers.js.map +1 -0
- package/lib/@types/huawei/huawei-api-gateway-event.d.ts +62 -0
- package/lib/@types/huawei/huawei-api-gateway-event.d.ts.map +1 -0
- package/lib/@types/huawei/huawei-api-gateway-event.js +2 -0
- package/lib/@types/huawei/huawei-api-gateway-event.js.map +1 -0
- package/lib/@types/huawei/huawei-api-gateway-response.d.ts +20 -0
- package/lib/@types/huawei/huawei-api-gateway-response.d.ts.map +1 -0
- package/lib/@types/huawei/huawei-api-gateway-response.js +2 -0
- package/lib/@types/huawei/huawei-api-gateway-response.js.map +1 -0
- package/lib/@types/huawei/huawei-context.d.ts +157 -0
- package/lib/@types/huawei/huawei-context.d.ts.map +1 -0
- package/lib/@types/huawei/huawei-context.js +1 -0
- package/lib/@types/huawei/huawei-context.js.map +1 -0
- package/lib/@types/huawei/index.d.ts +1 -0
- package/lib/@types/huawei/index.d.ts.map +1 -0
- package/lib/@types/huawei/index.js +6 -1
- package/lib/@types/huawei/index.js.map +1 -0
- package/lib/@types/index.d.ts +2 -1
- package/lib/@types/index.d.ts.map +1 -0
- package/lib/@types/index.js +7 -2
- package/lib/@types/index.js.map +1 -0
- package/lib/adapters/aws/alb.adapter.d.ts +18 -10
- package/lib/adapters/aws/alb.adapter.d.ts.map +1 -0
- package/lib/adapters/aws/alb.adapter.js +14 -9
- package/lib/adapters/aws/alb.adapter.js.map +1 -0
- package/lib/adapters/aws/api-gateway-v1.adapter.d.ts +20 -12
- package/lib/adapters/aws/api-gateway-v1.adapter.d.ts.map +1 -0
- package/lib/adapters/aws/api-gateway-v1.adapter.js +19 -14
- package/lib/adapters/aws/api-gateway-v1.adapter.js.map +1 -0
- package/lib/adapters/aws/api-gateway-v2.adapter.d.ts +19 -11
- package/lib/adapters/aws/api-gateway-v2.adapter.d.ts.map +1 -0
- package/lib/adapters/aws/api-gateway-v2.adapter.js +15 -10
- package/lib/adapters/aws/api-gateway-v2.adapter.js.map +1 -0
- package/lib/adapters/aws/dynamodb.adapter.d.ts +18 -10
- package/lib/adapters/aws/dynamodb.adapter.d.ts.map +1 -0
- package/lib/adapters/aws/dynamodb.adapter.js +13 -8
- package/lib/adapters/aws/dynamodb.adapter.js.map +1 -0
- package/lib/adapters/aws/event-bridge.adapter.d.ts +21 -10
- package/lib/adapters/aws/event-bridge.adapter.d.ts.map +1 -0
- package/lib/adapters/aws/event-bridge.adapter.js +13 -8
- package/lib/adapters/aws/event-bridge.adapter.js.map +1 -0
- package/lib/adapters/aws/index.d.ts +1 -0
- package/lib/adapters/aws/index.d.ts.map +1 -0
- package/lib/adapters/aws/index.js +6 -1
- package/lib/adapters/aws/index.js.map +1 -0
- package/lib/adapters/aws/lambda-edge.adapter.d.ts +76 -46
- package/lib/adapters/aws/lambda-edge.adapter.d.ts.map +1 -0
- package/lib/adapters/aws/lambda-edge.adapter.js +40 -24
- package/lib/adapters/aws/lambda-edge.adapter.js.map +1 -0
- package/lib/adapters/aws/sns.adapter.d.ts +18 -10
- package/lib/adapters/aws/sns.adapter.d.ts.map +1 -0
- package/lib/adapters/aws/sns.adapter.js +13 -8
- package/lib/adapters/aws/sns.adapter.js.map +1 -0
- package/lib/adapters/aws/sqs.adapter.d.ts +18 -10
- package/lib/adapters/aws/sqs.adapter.d.ts.map +1 -0
- package/lib/adapters/aws/sqs.adapter.js +13 -8
- package/lib/adapters/aws/sqs.adapter.js.map +1 -0
- package/lib/adapters/azure/http-trigger-v4.adapter.d.ts +81 -0
- package/lib/adapters/azure/http-trigger-v4.adapter.d.ts.map +1 -0
- package/lib/adapters/azure/http-trigger-v4.adapter.js +191 -0
- package/lib/adapters/azure/http-trigger-v4.adapter.js.map +1 -0
- package/lib/adapters/azure/index.d.ts +2 -0
- package/lib/adapters/azure/index.d.ts.map +1 -0
- package/lib/adapters/azure/index.js +18 -0
- package/lib/adapters/azure/index.js.map +1 -0
- package/lib/adapters/dummy/dummy.adapter.d.ts +9 -5
- package/lib/adapters/dummy/dummy.adapter.d.ts.map +1 -0
- package/lib/adapters/dummy/dummy.adapter.js +9 -5
- package/lib/adapters/dummy/dummy.adapter.js.map +1 -0
- package/lib/adapters/dummy/index.d.ts +1 -0
- package/lib/adapters/dummy/index.d.ts.map +1 -0
- package/lib/adapters/dummy/index.js +6 -1
- package/lib/adapters/dummy/index.js.map +1 -0
- package/lib/adapters/huawei/huawei-api-gateway.adapter.d.ts +19 -12
- package/lib/adapters/huawei/huawei-api-gateway.adapter.d.ts.map +1 -0
- package/lib/adapters/huawei/huawei-api-gateway.adapter.js +14 -9
- package/lib/adapters/huawei/huawei-api-gateway.adapter.js.map +1 -0
- package/lib/adapters/huawei/index.d.ts +1 -0
- package/lib/adapters/huawei/index.d.ts.map +1 -0
- package/lib/adapters/huawei/index.js +6 -1
- package/lib/adapters/huawei/index.js.map +1 -0
- package/lib/contracts/adapter.contract.d.ts +30 -30
- package/lib/contracts/adapter.contract.d.ts.map +1 -0
- package/lib/contracts/adapter.contract.js +2 -0
- package/lib/contracts/adapter.contract.js.map +1 -0
- package/lib/contracts/framework.contract.d.ts +7 -3
- package/lib/contracts/framework.contract.d.ts.map +1 -0
- package/lib/contracts/framework.contract.js +1 -0
- package/lib/contracts/framework.contract.js.map +1 -0
- package/lib/contracts/handler.contract.d.ts +7 -0
- package/lib/contracts/handler.contract.d.ts.map +1 -0
- package/lib/contracts/handler.contract.js +1 -0
- package/lib/contracts/handler.contract.js.map +1 -0
- package/lib/contracts/index.d.ts +1 -0
- package/lib/contracts/index.d.ts.map +1 -0
- package/lib/contracts/index.js +6 -1
- package/lib/contracts/index.js.map +1 -0
- package/lib/contracts/resolver.contract.d.ts +17 -4
- package/lib/contracts/resolver.contract.d.ts.map +1 -0
- package/lib/contracts/resolver.contract.js +1 -0
- package/lib/contracts/resolver.contract.js.map +1 -0
- package/lib/core/base-handler.d.ts +9 -5
- package/lib/core/base-handler.d.ts.map +1 -0
- package/lib/core/base-handler.js +9 -5
- package/lib/core/base-handler.js.map +1 -0
- package/lib/core/constants.d.ts +27 -0
- package/lib/core/constants.d.ts.map +1 -0
- package/lib/core/constants.js +21 -0
- package/lib/core/constants.js.map +1 -0
- package/lib/core/current-invoke.d.ts +17 -6
- package/lib/core/current-invoke.d.ts.map +1 -0
- package/lib/core/current-invoke.js +12 -4
- package/lib/core/current-invoke.js.map +1 -0
- package/lib/core/event-body.d.ts +9 -3
- package/lib/core/event-body.d.ts.map +1 -0
- package/lib/core/event-body.js +9 -3
- package/lib/core/event-body.js.map +1 -0
- package/lib/core/headers.d.ts +17 -6
- package/lib/core/headers.d.ts.map +1 -0
- package/lib/core/headers.js +17 -6
- package/lib/core/headers.js.map +1 -0
- package/lib/core/index.d.ts +1 -0
- package/lib/core/index.d.ts.map +1 -0
- package/lib/core/index.js +6 -1
- package/lib/core/index.js.map +1 -0
- package/lib/core/is-binary.d.ts +29 -11
- package/lib/core/is-binary.d.ts.map +1 -0
- package/lib/core/is-binary.js +29 -11
- package/lib/core/is-binary.js.map +1 -0
- package/lib/core/logger.d.ts +31 -5
- package/lib/core/logger.d.ts.map +1 -0
- package/lib/core/logger.js +29 -4
- package/lib/core/logger.js.map +1 -0
- package/lib/core/no-op.d.ts +4 -0
- package/lib/core/no-op.d.ts.map +1 -0
- package/lib/core/no-op.js +4 -0
- package/lib/core/no-op.js.map +1 -0
- package/lib/core/optional.d.ts +8 -3
- package/lib/core/optional.d.ts.map +1 -0
- package/lib/core/optional.js +8 -3
- package/lib/core/optional.js.map +1 -0
- package/lib/core/path.d.ts +14 -5
- package/lib/core/path.d.ts.map +1 -0
- package/lib/core/path.js +14 -5
- package/lib/core/path.js.map +1 -0
- package/lib/core/stream.d.ts +5 -1
- package/lib/core/stream.d.ts.map +1 -0
- package/lib/core/stream.js +6 -2
- package/lib/core/stream.js.map +1 -0
- package/lib/frameworks/express/express.framework.d.ts +5 -1
- package/lib/frameworks/express/express.framework.d.ts.map +1 -0
- package/lib/frameworks/express/express.framework.js +5 -1
- package/lib/frameworks/express/express.framework.js.map +1 -0
- package/lib/frameworks/express/index.d.ts +1 -0
- package/lib/frameworks/express/index.d.ts.map +1 -0
- package/lib/frameworks/express/index.js +6 -1
- package/lib/frameworks/express/index.js.map +1 -0
- package/lib/frameworks/fastify/fastify.framework.d.ts +5 -1
- package/lib/frameworks/fastify/fastify.framework.d.ts.map +1 -0
- package/lib/frameworks/fastify/fastify.framework.js +5 -1
- package/lib/frameworks/fastify/fastify.framework.js.map +1 -0
- package/lib/frameworks/fastify/index.d.ts +1 -0
- package/lib/frameworks/fastify/index.d.ts.map +1 -0
- package/lib/frameworks/fastify/index.js +6 -1
- package/lib/frameworks/fastify/index.js.map +1 -0
- package/lib/frameworks/hapi/hapi.framework.d.ts +5 -1
- package/lib/frameworks/hapi/hapi.framework.d.ts.map +1 -0
- package/lib/frameworks/hapi/hapi.framework.js +5 -1
- package/lib/frameworks/hapi/hapi.framework.js.map +1 -0
- package/lib/frameworks/hapi/index.d.ts +1 -0
- package/lib/frameworks/hapi/index.d.ts.map +1 -0
- package/lib/frameworks/hapi/index.js +6 -1
- package/lib/frameworks/hapi/index.js.map +1 -0
- package/lib/frameworks/koa/index.d.ts +1 -0
- package/lib/frameworks/koa/index.d.ts.map +1 -0
- package/lib/frameworks/koa/index.js +6 -1
- package/lib/frameworks/koa/index.js.map +1 -0
- package/lib/frameworks/koa/koa.framework.d.ts +5 -1
- package/lib/frameworks/koa/koa.framework.d.ts.map +1 -0
- package/lib/frameworks/koa/koa.framework.js +5 -1
- package/lib/frameworks/koa/koa.framework.js.map +1 -0
- package/lib/frameworks/lazy/index.d.ts +1 -0
- package/lib/frameworks/lazy/index.d.ts.map +1 -0
- package/lib/frameworks/lazy/index.js +6 -1
- package/lib/frameworks/lazy/index.js.map +1 -0
- package/lib/frameworks/lazy/lazy.framework.d.ts +7 -2
- package/lib/frameworks/lazy/lazy.framework.d.ts.map +1 -0
- package/lib/frameworks/lazy/lazy.framework.js +7 -2
- package/lib/frameworks/lazy/lazy.framework.js.map +1 -0
- package/lib/frameworks/trpc/index.d.ts +2 -0
- package/lib/frameworks/trpc/index.d.ts.map +1 -0
- package/lib/frameworks/trpc/index.js +18 -0
- package/lib/frameworks/trpc/index.js.map +1 -0
- package/lib/frameworks/trpc/trpc.framework.d.ts +152 -0
- package/lib/frameworks/trpc/trpc.framework.d.ts.map +1 -0
- package/lib/frameworks/trpc/trpc.framework.js +137 -0
- package/lib/frameworks/trpc/trpc.framework.js.map +1 -0
- package/lib/handlers/azure/azure.handler.d.ts +45 -0
- package/lib/handlers/azure/azure.handler.d.ts.map +1 -0
- package/lib/handlers/azure/azure.handler.js +63 -0
- package/lib/handlers/azure/azure.handler.js.map +1 -0
- package/lib/handlers/azure/index.d.ts +2 -0
- package/lib/handlers/azure/index.d.ts.map +1 -0
- package/lib/handlers/azure/index.js +18 -0
- package/lib/handlers/azure/index.js.map +1 -0
- package/lib/handlers/default/default.handler.d.ts +36 -32
- package/lib/handlers/default/default.handler.d.ts.map +1 -0
- package/lib/handlers/default/default.handler.js +48 -52
- package/lib/handlers/default/default.handler.js.map +1 -0
- package/lib/handlers/default/index.d.ts +1 -0
- package/lib/handlers/default/index.d.ts.map +1 -0
- package/lib/handlers/default/index.js +6 -1
- package/lib/handlers/default/index.js.map +1 -0
- package/lib/handlers/huawei/http-huawei.handler.d.ts +14 -4
- package/lib/handlers/huawei/http-huawei.handler.d.ts.map +1 -0
- package/lib/handlers/huawei/http-huawei.handler.js +15 -4
- package/lib/handlers/huawei/http-huawei.handler.js.map +1 -0
- package/lib/handlers/huawei/index.d.ts +1 -0
- package/lib/handlers/huawei/index.d.ts.map +1 -0
- package/lib/handlers/huawei/index.js +6 -1
- package/lib/handlers/huawei/index.js.map +1 -0
- package/lib/index.d.ts +1 -0
- package/lib/index.d.ts.map +1 -0
- package/lib/index.js +6 -1
- package/lib/index.js.map +1 -0
- package/lib/network/index.d.ts +1 -0
- package/lib/network/index.d.ts.map +1 -0
- package/lib/network/index.js +6 -1
- package/lib/network/index.js.map +1 -0
- package/lib/network/request.d.ts +28 -0
- package/lib/network/request.d.ts.map +1 -0
- package/lib/network/request.js +7 -0
- package/lib/network/request.js.map +1 -0
- package/lib/network/response.d.ts +18 -1
- package/lib/network/response.d.ts.map +1 -0
- package/lib/network/response.js +9 -1
- package/lib/network/response.js.map +1 -0
- package/lib/resolvers/aws-context/aws-context.resolver.d.ts +7 -9
- package/lib/resolvers/aws-context/aws-context.resolver.d.ts.map +1 -0
- package/lib/resolvers/aws-context/aws-context.resolver.js +7 -9
- package/lib/resolvers/aws-context/aws-context.resolver.js.map +1 -0
- package/lib/resolvers/aws-context/index.d.ts +1 -0
- package/lib/resolvers/aws-context/index.d.ts.map +1 -0
- package/lib/resolvers/aws-context/index.js +6 -1
- package/lib/resolvers/aws-context/index.js.map +1 -0
- package/lib/resolvers/callback/callback.resolver.d.ts +9 -2
- package/lib/resolvers/callback/callback.resolver.d.ts.map +1 -0
- package/lib/resolvers/callback/callback.resolver.js +6 -2
- package/lib/resolvers/callback/callback.resolver.js.map +1 -0
- package/lib/resolvers/callback/index.d.ts +1 -0
- package/lib/resolvers/callback/index.d.ts.map +1 -0
- package/lib/resolvers/callback/index.js +6 -1
- package/lib/resolvers/callback/index.js.map +1 -0
- package/lib/resolvers/dummy/dummy.resolver.d.ts +5 -1
- package/lib/resolvers/dummy/dummy.resolver.d.ts.map +1 -0
- package/lib/resolvers/dummy/dummy.resolver.js +5 -1
- package/lib/resolvers/dummy/dummy.resolver.js.map +1 -0
- package/lib/resolvers/dummy/index.d.ts +1 -0
- package/lib/resolvers/dummy/index.d.ts.map +1 -0
- package/lib/resolvers/dummy/index.js +6 -1
- package/lib/resolvers/dummy/index.js.map +1 -0
- package/lib/resolvers/promise/index.d.ts +1 -0
- package/lib/resolvers/promise/index.d.ts.map +1 -0
- package/lib/resolvers/promise/index.js +6 -1
- package/lib/resolvers/promise/index.js.map +1 -0
- package/lib/resolvers/promise/promise.resolver.d.ts +5 -1
- package/lib/resolvers/promise/promise.resolver.d.ts.map +1 -0
- package/lib/resolvers/promise/promise.resolver.js +5 -1
- package/lib/resolvers/promise/promise.resolver.js.map +1 -0
- package/lib/serverless-adapter.d.ts +17 -12
- package/lib/serverless-adapter.d.ts.map +1 -0
- package/lib/serverless-adapter.js +17 -12
- package/lib/serverless-adapter.js.map +1 -0
- package/package.json +32 -4
- package/lib/@types/proxy-params.d.ts +0 -8
- package/lib/@types/proxy-params.js +0 -2
|
@@ -3,18 +3,21 @@ import { AdapterContract, AdapterRequest, OnErrorProps } from '../../contracts';
|
|
|
3
3
|
import { IEmptyResponse } from '../../core';
|
|
4
4
|
/**
|
|
5
5
|
* The options to customize the {@link SQSAdapter}
|
|
6
|
+
*
|
|
7
|
+
* @breadcrumb Adapters / AWS / SQSAdapter
|
|
8
|
+
* @public
|
|
6
9
|
*/
|
|
7
10
|
export interface SQSAdapterOptions {
|
|
8
11
|
/**
|
|
9
12
|
* The path that will be used to create a request to be forwarded to the framework.
|
|
10
13
|
*
|
|
11
|
-
* @
|
|
14
|
+
* @defaultValue /sqs
|
|
12
15
|
*/
|
|
13
16
|
sqsForwardPath?: string;
|
|
14
17
|
/**
|
|
15
18
|
* The http method that will be used to create a request to be forwarded to the framework.
|
|
16
19
|
*
|
|
17
|
-
* @
|
|
20
|
+
* @defaultValue POST
|
|
18
21
|
*/
|
|
19
22
|
sqsForwardMethod?: string;
|
|
20
23
|
}
|
|
@@ -23,40 +26,45 @@ export interface SQSAdapterOptions {
|
|
|
23
26
|
*
|
|
24
27
|
* The option of `responseWithErrors` is ignored by this adapter and we always call `resolver.fail` with the error.
|
|
25
28
|
*
|
|
26
|
-
* {@link https://docs.aws.amazon.com/pt_br/lambda/latest/dg/with-sqs.html Event Reference}
|
|
29
|
+
* {@link https://docs.aws.amazon.com/pt_br/lambda/latest/dg/with-sqs.html | Event Reference}
|
|
27
30
|
*
|
|
28
|
-
* @example
|
|
31
|
+
* @example
|
|
32
|
+
* ```typescript
|
|
29
33
|
* const sqsForwardPath = '/your/route/sqs'; // default /sqs
|
|
30
34
|
* const sqsForwardMethod = 'POST'; // default POST
|
|
31
35
|
* const adapter = new SQSAdapter({ sqsForwardPath, sqsForwardMethod });
|
|
32
36
|
* ```
|
|
37
|
+
*
|
|
38
|
+
* @breadcrumb Adapters / AWS / SQSAdapter
|
|
39
|
+
* @public
|
|
33
40
|
*/
|
|
34
41
|
export declare class SQSAdapter implements AdapterContract<SQSEvent, Context, IEmptyResponse> {
|
|
35
42
|
protected readonly options?: SQSAdapterOptions | undefined;
|
|
36
43
|
/**
|
|
37
44
|
* Default constructor
|
|
38
45
|
*
|
|
39
|
-
* @param options The options to customize the {@link SQSAdapter}
|
|
46
|
+
* @param options - The options to customize the {@link SQSAdapter}
|
|
40
47
|
*/
|
|
41
48
|
constructor(options?: SQSAdapterOptions | undefined);
|
|
42
49
|
/**
|
|
43
|
-
* @inheritDoc
|
|
50
|
+
* {@inheritDoc}
|
|
44
51
|
*/
|
|
45
52
|
getAdapterName(): string;
|
|
46
53
|
/**
|
|
47
|
-
* @inheritDoc
|
|
54
|
+
* {@inheritDoc}
|
|
48
55
|
*/
|
|
49
56
|
canHandle(event: unknown): event is SQSEvent;
|
|
50
57
|
/**
|
|
51
|
-
* @inheritDoc
|
|
58
|
+
* {@inheritDoc}
|
|
52
59
|
*/
|
|
53
60
|
getRequest(event: SQSEvent): AdapterRequest;
|
|
54
61
|
/**
|
|
55
|
-
* @inheritDoc
|
|
62
|
+
* {@inheritDoc}
|
|
56
63
|
*/
|
|
57
64
|
getResponse(): IEmptyResponse;
|
|
58
65
|
/**
|
|
59
|
-
* @inheritDoc
|
|
66
|
+
* {@inheritDoc}
|
|
60
67
|
*/
|
|
61
68
|
onErrorWhileForwarding({ error, delegatedResolver, }: OnErrorProps<SQSEvent, IEmptyResponse>): void;
|
|
62
69
|
}
|
|
70
|
+
//# sourceMappingURL=sqs.adapter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sqs.adapter.d.ts","sourceRoot":"","sources":["../../../src/adapters/aws/sqs.adapter.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACpD,OAAO,EAAE,eAAe,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAChF,OAAO,EAEL,cAAc,EAGf,MAAM,YAAY,CAAC;AAIpB;;;;;GAKG;AACH,MAAM,WAAW,iBAAiB;IAChC;;;;OAIG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;IAExB;;;;OAIG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC3B;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,qBAAa,UACX,YAAW,eAAe,CAAC,QAAQ,EAAE,OAAO,EAAE,cAAc,CAAC;IASjD,SAAS,CAAC,QAAQ,CAAC,OAAO,CAAC;IALvC;;;;OAIG;gBAC4B,OAAO,CAAC,+BAAmB;IAM1D;;OAEG;IACI,cAAc,IAAI,MAAM;IAI/B;;OAEG;IACI,SAAS,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,QAAQ;IAUnD;;OAEG;IACI,UAAU,CAAC,KAAK,EAAE,QAAQ,GAAG,cAAc;IA0BlD;;OAEG;IACI,WAAW,IAAI,cAAc;IAIpC;;OAEG;IACI,sBAAsB,CAAC,EAC5B,KAAK,EACL,iBAAiB,GAClB,EAAE,YAAY,CAAC,QAAQ,EAAE,cAAc,CAAC,GAAG,IAAI;CAKjD"}
|
|
@@ -8,20 +8,24 @@ const core_1 = require("../../core");
|
|
|
8
8
|
*
|
|
9
9
|
* The option of `responseWithErrors` is ignored by this adapter and we always call `resolver.fail` with the error.
|
|
10
10
|
*
|
|
11
|
-
* {@link https://docs.aws.amazon.com/pt_br/lambda/latest/dg/with-sqs.html Event Reference}
|
|
11
|
+
* {@link https://docs.aws.amazon.com/pt_br/lambda/latest/dg/with-sqs.html | Event Reference}
|
|
12
12
|
*
|
|
13
|
-
* @example
|
|
13
|
+
* @example
|
|
14
|
+
* ```typescript
|
|
14
15
|
* const sqsForwardPath = '/your/route/sqs'; // default /sqs
|
|
15
16
|
* const sqsForwardMethod = 'POST'; // default POST
|
|
16
17
|
* const adapter = new SQSAdapter({ sqsForwardPath, sqsForwardMethod });
|
|
17
18
|
* ```
|
|
19
|
+
*
|
|
20
|
+
* @breadcrumb Adapters / AWS / SQSAdapter
|
|
21
|
+
* @public
|
|
18
22
|
*/
|
|
19
23
|
class SQSAdapter {
|
|
20
24
|
//#region Constructor
|
|
21
25
|
/**
|
|
22
26
|
* Default constructor
|
|
23
27
|
*
|
|
24
|
-
* @param options The options to customize the {@link SQSAdapter}
|
|
28
|
+
* @param options - The options to customize the {@link SQSAdapter}
|
|
25
29
|
*/
|
|
26
30
|
constructor(options) {
|
|
27
31
|
this.options = options;
|
|
@@ -29,13 +33,13 @@ class SQSAdapter {
|
|
|
29
33
|
//#endregion
|
|
30
34
|
//#region Public Methods
|
|
31
35
|
/**
|
|
32
|
-
* @inheritDoc
|
|
36
|
+
* {@inheritDoc}
|
|
33
37
|
*/
|
|
34
38
|
getAdapterName() {
|
|
35
39
|
return SQSAdapter.name;
|
|
36
40
|
}
|
|
37
41
|
/**
|
|
38
|
-
* @inheritDoc
|
|
42
|
+
* {@inheritDoc}
|
|
39
43
|
*/
|
|
40
44
|
canHandle(event) {
|
|
41
45
|
var _a;
|
|
@@ -46,7 +50,7 @@ class SQSAdapter {
|
|
|
46
50
|
return eventSource === 'aws:sqs';
|
|
47
51
|
}
|
|
48
52
|
/**
|
|
49
|
-
* @inheritDoc
|
|
53
|
+
* {@inheritDoc}
|
|
50
54
|
*/
|
|
51
55
|
getRequest(event) {
|
|
52
56
|
var _a, _b;
|
|
@@ -66,16 +70,17 @@ class SQSAdapter {
|
|
|
66
70
|
};
|
|
67
71
|
}
|
|
68
72
|
/**
|
|
69
|
-
* @inheritDoc
|
|
73
|
+
* {@inheritDoc}
|
|
70
74
|
*/
|
|
71
75
|
getResponse() {
|
|
72
76
|
return core_1.EmptyResponse;
|
|
73
77
|
}
|
|
74
78
|
/**
|
|
75
|
-
* @inheritDoc
|
|
79
|
+
* {@inheritDoc}
|
|
76
80
|
*/
|
|
77
81
|
onErrorWhileForwarding({ error, delegatedResolver, }) {
|
|
78
82
|
delegatedResolver.fail(error);
|
|
79
83
|
}
|
|
80
84
|
}
|
|
81
85
|
exports.SQSAdapter = SQSAdapter;
|
|
86
|
+
//# sourceMappingURL=sqs.adapter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sqs.adapter.js","sourceRoot":"","sources":["../../../src/adapters/aws/sqs.adapter.ts"],"names":[],"mappings":";AAAA,iBAAiB;;;AAIjB,qCAKoB;AA0BpB;;;;;;;;;;;;;;;;GAgBG;AACH,MAAa,UAAU;IAGrB,qBAAqB;IAErB;;;;OAIG;IACH,YAA+B,OAA2B;QAA3B,YAAO,GAAP,OAAO,CAAoB;IAAG,CAAC;IAE9D,YAAY;IAEZ,wBAAwB;IAExB;;OAEG;IACI,cAAc;QACnB,OAAO,UAAU,CAAC,IAAI,CAAC;IACzB,CAAC;IAED;;OAEG;IACI,SAAS,CAAC,KAAc;;QAC7B,MAAM,QAAQ,GAAG,KAA0B,CAAC;QAE5C,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,QAAQ,aAAR,QAAQ,uBAAR,QAAQ,CAAE,OAAO,CAAC;YAAE,OAAO,KAAK,CAAC;QAEpD,MAAM,WAAW,GAAG,MAAA,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC,0CAAE,WAAW,CAAC;QAErD,OAAO,WAAW,KAAK,SAAS,CAAC;IACnC,CAAC;IAED;;OAEG;IACI,UAAU,CAAC,KAAe;;QAC/B,MAAM,IAAI,GAAG,IAAA,4BAAqB,EAAC,MAAA,IAAI,CAAC,OAAO,0CAAE,cAAc,EAAE,MAAM,CAAC,CAAC;QACzE,MAAM,MAAM,GAAG,IAAA,4BAAqB,EAClC,MAAA,IAAI,CAAC,OAAO,0CAAE,gBAAgB,EAC9B,MAAM,CACP,CAAC;QAEF,MAAM,CAAC,IAAI,EAAE,aAAa,CAAC,GAAG,IAAA,2BAAoB,EAChD,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,EACrB,KAAK,CACN,CAAC;QAEF,MAAM,OAAO,GAAG;YACd,IAAI,EAAE,mBAAmB;YACzB,cAAc,EAAE,kBAAkB;YAClC,gBAAgB,EAAE,MAAM,CAAC,aAAa,CAAC;SACxC,CAAC;QAEF,OAAO;YACL,MAAM;YACN,OAAO;YACP,IAAI;YACJ,IAAI;SACL,CAAC;IACJ,CAAC;IAED;;OAEG;IACI,WAAW;QAChB,OAAO,oBAAa,CAAC;IACvB,CAAC;IAED;;OAEG;IACI,sBAAsB,CAAC,EAC5B,KAAK,EACL,iBAAiB,GACsB;QACvC,iBAAiB,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAChC,CAAC;CAGF;AAnFD,gCAmFC"}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import type { Context, Cookie, HttpRequest, HttpResponseSimple } from '@azure/functions';
|
|
2
|
+
import { BothValueHeaders } from '../../@types';
|
|
3
|
+
import { AdapterContract, AdapterRequest, GetResponseAdapterProps, OnErrorProps } from '../../contracts';
|
|
4
|
+
/**
|
|
5
|
+
* The options to customize the {@link HttpTriggerV4Adapter}
|
|
6
|
+
*
|
|
7
|
+
* @breadcrumb Adapters / Azure / HttpTriggerV4Adapter
|
|
8
|
+
* @public
|
|
9
|
+
*/
|
|
10
|
+
export interface HttpTriggerV4AdapterOptions {
|
|
11
|
+
/**
|
|
12
|
+
* Strip base path for custom domains
|
|
13
|
+
*
|
|
14
|
+
* @defaultValue ''
|
|
15
|
+
*/
|
|
16
|
+
stripBasePath?: string;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* The adapter to handle requests from Http Trigger on Azure Function V4.
|
|
20
|
+
*
|
|
21
|
+
* @example
|
|
22
|
+
* ```typescript
|
|
23
|
+
* const stripBasePath = '/any/custom/base/path'; // default ''
|
|
24
|
+
* const adapter = new HttpTriggerV4Adapter({ stripBasePath });
|
|
25
|
+
* ```
|
|
26
|
+
*
|
|
27
|
+
* @see {@link https://docs.microsoft.com/en-us/azure/azure-functions/functions-reference-node | Reference}
|
|
28
|
+
*
|
|
29
|
+
* @breadcrumb Adapters / Azure / HttpTriggerV4Adapter
|
|
30
|
+
* @public
|
|
31
|
+
*/
|
|
32
|
+
export declare class HttpTriggerV4Adapter implements AdapterContract<HttpRequest, Context, HttpResponseSimple> {
|
|
33
|
+
protected readonly options?: HttpTriggerV4AdapterOptions | undefined;
|
|
34
|
+
/**
|
|
35
|
+
* Default constructor
|
|
36
|
+
*
|
|
37
|
+
* @param options - The options to customize the {@link HttpTriggerV4Adapter}
|
|
38
|
+
*/
|
|
39
|
+
constructor(options?: HttpTriggerV4AdapterOptions | undefined);
|
|
40
|
+
/**
|
|
41
|
+
* {@inheritDoc}
|
|
42
|
+
*/
|
|
43
|
+
getAdapterName(): string;
|
|
44
|
+
/**
|
|
45
|
+
* {@inheritDoc}
|
|
46
|
+
*/
|
|
47
|
+
canHandle(event: unknown, context: unknown): boolean;
|
|
48
|
+
/**
|
|
49
|
+
* {@inheritDoc}
|
|
50
|
+
*/
|
|
51
|
+
getRequest(event: HttpRequest): AdapterRequest;
|
|
52
|
+
/**
|
|
53
|
+
* {@inheritDoc}
|
|
54
|
+
*/
|
|
55
|
+
getResponse({ body, isBase64Encoded, statusCode, headers: originalHeaders, }: GetResponseAdapterProps<HttpRequest>): HttpResponseSimple;
|
|
56
|
+
/**
|
|
57
|
+
* {@inheritDoc}
|
|
58
|
+
*/
|
|
59
|
+
onErrorWhileForwarding({ error, respondWithErrors, event, delegatedResolver, log, }: OnErrorProps<HttpRequest, HttpResponseSimple>): void;
|
|
60
|
+
/**
|
|
61
|
+
* Get path from event with query strings
|
|
62
|
+
*
|
|
63
|
+
* @param event - The event sent by serverless
|
|
64
|
+
*/
|
|
65
|
+
protected getPathFromEvent(event: HttpRequest): string;
|
|
66
|
+
/**
|
|
67
|
+
* Get the Azure Cookie list parsed from set-cookie header.
|
|
68
|
+
*
|
|
69
|
+
* @param headers - The headers object
|
|
70
|
+
*/
|
|
71
|
+
protected getAzureCookiesFromHeaders(headers: BothValueHeaders): Cookie[];
|
|
72
|
+
/**
|
|
73
|
+
* Parse the string cookie to the Azure Cookie Object.
|
|
74
|
+
* This code was written by {@link https://github.com/zachabney | @zachabney}
|
|
75
|
+
* on {@link https://github.com/zachabney/azure-aws-serverless-express/blob/241d2d5c4d5906e4817662cad6426ec2cbbf9ca7/src/index.js#L4-L49 | this library}.
|
|
76
|
+
*
|
|
77
|
+
* @param cookie - The cookie
|
|
78
|
+
*/
|
|
79
|
+
protected parseCookie(cookie: string): Cookie;
|
|
80
|
+
}
|
|
81
|
+
//# sourceMappingURL=http-trigger-v4.adapter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"http-trigger-v4.adapter.d.ts","sourceRoot":"","sources":["../../../src/adapters/azure/http-trigger-v4.adapter.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EACV,OAAO,EACP,MAAM,EACN,WAAW,EACX,kBAAkB,EACnB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAChD,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exports.HttpTriggerV4Adapter = void 0;
|
|
5
|
+
const url_1 = require("url");
|
|
6
|
+
const core_1 = require("../../core");
|
|
7
|
+
/**
|
|
8
|
+
* The adapter to handle requests from Http Trigger on Azure Function V4.
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* ```typescript
|
|
12
|
+
* const stripBasePath = '/any/custom/base/path'; // default ''
|
|
13
|
+
* const adapter = new HttpTriggerV4Adapter({ stripBasePath });
|
|
14
|
+
* ```
|
|
15
|
+
*
|
|
16
|
+
* @see {@link https://docs.microsoft.com/en-us/azure/azure-functions/functions-reference-node | Reference}
|
|
17
|
+
*
|
|
18
|
+
* @breadcrumb Adapters / Azure / HttpTriggerV4Adapter
|
|
19
|
+
* @public
|
|
20
|
+
*/
|
|
21
|
+
class HttpTriggerV4Adapter {
|
|
22
|
+
//#region Constructor
|
|
23
|
+
/**
|
|
24
|
+
* Default constructor
|
|
25
|
+
*
|
|
26
|
+
* @param options - The options to customize the {@link HttpTriggerV4Adapter}
|
|
27
|
+
*/
|
|
28
|
+
constructor(options) {
|
|
29
|
+
this.options = options;
|
|
30
|
+
}
|
|
31
|
+
//#endregion
|
|
32
|
+
//#region Public Methods
|
|
33
|
+
/**
|
|
34
|
+
* {@inheritDoc}
|
|
35
|
+
*/
|
|
36
|
+
getAdapterName() {
|
|
37
|
+
return HttpTriggerV4Adapter.name;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* {@inheritDoc}
|
|
41
|
+
*/
|
|
42
|
+
canHandle(event, context) {
|
|
43
|
+
const maybeEvent = event;
|
|
44
|
+
const maybeContext = context;
|
|
45
|
+
return !!(maybeEvent &&
|
|
46
|
+
maybeEvent.method &&
|
|
47
|
+
maybeEvent.headers &&
|
|
48
|
+
maybeEvent.url &&
|
|
49
|
+
maybeEvent.query &&
|
|
50
|
+
maybeContext &&
|
|
51
|
+
maybeContext.traceContext &&
|
|
52
|
+
maybeContext.bindingDefinitions &&
|
|
53
|
+
maybeContext.log &&
|
|
54
|
+
maybeContext.log.info &&
|
|
55
|
+
maybeContext.bindingData);
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* {@inheritDoc}
|
|
59
|
+
*/
|
|
60
|
+
getRequest(event) {
|
|
61
|
+
const path = this.getPathFromEvent(event);
|
|
62
|
+
const method = event.method;
|
|
63
|
+
const headers = (0, core_1.getFlattenedHeadersMap)(event.headers, ',', true);
|
|
64
|
+
let body;
|
|
65
|
+
if (event.body) {
|
|
66
|
+
const [bufferBody, contentLength] = (0, core_1.getEventBodyAsBuffer)(event.rawBody, false);
|
|
67
|
+
body = bufferBody;
|
|
68
|
+
headers['content-length'] = String(contentLength);
|
|
69
|
+
}
|
|
70
|
+
const remoteAddress = headers['x-forwarded-for'];
|
|
71
|
+
return {
|
|
72
|
+
method: method,
|
|
73
|
+
path,
|
|
74
|
+
headers,
|
|
75
|
+
remoteAddress,
|
|
76
|
+
body,
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* {@inheritDoc}
|
|
81
|
+
*/
|
|
82
|
+
getResponse({ body, isBase64Encoded, statusCode, headers: originalHeaders, }) {
|
|
83
|
+
const headers = (0, core_1.getFlattenedHeadersMap)(originalHeaders, ',', true);
|
|
84
|
+
const cookies = this.getAzureCookiesFromHeaders(originalHeaders);
|
|
85
|
+
if (headers['set-cookie'])
|
|
86
|
+
delete headers['set-cookie'];
|
|
87
|
+
return {
|
|
88
|
+
body,
|
|
89
|
+
statusCode,
|
|
90
|
+
headers,
|
|
91
|
+
// I tried to understand this property with
|
|
92
|
+
// https://docs.microsoft.com/en-us/aspnet/web-api/overview/formats-and-model-binding/content-negotiation
|
|
93
|
+
// but I don't know if it's worth implementing this guy as an option
|
|
94
|
+
// I found out when this guy is set to true and the framework sets content-type, azure returns 500
|
|
95
|
+
// So I'll leave it as is and hope no one has any problems.
|
|
96
|
+
enableContentNegotiation: false,
|
|
97
|
+
cookies,
|
|
98
|
+
};
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* {@inheritDoc}
|
|
102
|
+
*/
|
|
103
|
+
onErrorWhileForwarding({ error, respondWithErrors, event, delegatedResolver, log, }) {
|
|
104
|
+
const body = respondWithErrors ? error.stack : '';
|
|
105
|
+
const errorResponse = this.getResponse({
|
|
106
|
+
event,
|
|
107
|
+
statusCode: 500,
|
|
108
|
+
body: body || '',
|
|
109
|
+
headers: {},
|
|
110
|
+
isBase64Encoded: false,
|
|
111
|
+
log,
|
|
112
|
+
});
|
|
113
|
+
delegatedResolver.succeed(errorResponse);
|
|
114
|
+
}
|
|
115
|
+
//#endregion
|
|
116
|
+
//#region Protected Methods
|
|
117
|
+
/**
|
|
118
|
+
* Get path from event with query strings
|
|
119
|
+
*
|
|
120
|
+
* @param event - The event sent by serverless
|
|
121
|
+
*/
|
|
122
|
+
getPathFromEvent(event) {
|
|
123
|
+
var _a;
|
|
124
|
+
const stripBasePath = (0, core_1.getDefaultIfUndefined)((_a = this.options) === null || _a === void 0 ? void 0 : _a.stripBasePath, '');
|
|
125
|
+
const url = new url_1.URL(event.url);
|
|
126
|
+
const originalPath = url.pathname;
|
|
127
|
+
const replaceRegex = new RegExp(`^${stripBasePath}`);
|
|
128
|
+
const path = originalPath.replace(replaceRegex, '');
|
|
129
|
+
const queryParams = event.query;
|
|
130
|
+
return (0, core_1.getPathWithQueryStringParams)(path, queryParams);
|
|
131
|
+
}
|
|
132
|
+
/**
|
|
133
|
+
* Get the Azure Cookie list parsed from set-cookie header.
|
|
134
|
+
*
|
|
135
|
+
* @param headers - The headers object
|
|
136
|
+
*/
|
|
137
|
+
getAzureCookiesFromHeaders(headers) {
|
|
138
|
+
const setCookie = headers['set-cookie'];
|
|
139
|
+
const headerCookies = Array.isArray(setCookie)
|
|
140
|
+
? setCookie
|
|
141
|
+
: setCookie
|
|
142
|
+
? [setCookie]
|
|
143
|
+
: [];
|
|
144
|
+
return headerCookies.map(cookie => this.parseCookie(cookie));
|
|
145
|
+
}
|
|
146
|
+
/**
|
|
147
|
+
* Parse the string cookie to the Azure Cookie Object.
|
|
148
|
+
* This code was written by {@link https://github.com/zachabney | @zachabney}
|
|
149
|
+
* on {@link https://github.com/zachabney/azure-aws-serverless-express/blob/241d2d5c4d5906e4817662cad6426ec2cbbf9ca7/src/index.js#L4-L49 | this library}.
|
|
150
|
+
*
|
|
151
|
+
* @param cookie - The cookie
|
|
152
|
+
*/
|
|
153
|
+
parseCookie(cookie) {
|
|
154
|
+
return cookie.split(';').reduce((azureCookieObject, cookieProperty, index) => {
|
|
155
|
+
const [key, value] = cookieProperty.split('=');
|
|
156
|
+
const sanitizedKey = key.toLowerCase().trim();
|
|
157
|
+
const sanitizedValue = value && value.trim();
|
|
158
|
+
if (index === 0) {
|
|
159
|
+
azureCookieObject.name = sanitizedKey;
|
|
160
|
+
azureCookieObject.value = sanitizedValue;
|
|
161
|
+
return azureCookieObject;
|
|
162
|
+
}
|
|
163
|
+
switch (sanitizedKey) {
|
|
164
|
+
case 'domain':
|
|
165
|
+
azureCookieObject.domain = sanitizedValue;
|
|
166
|
+
break;
|
|
167
|
+
case 'path':
|
|
168
|
+
azureCookieObject.path = sanitizedValue;
|
|
169
|
+
break;
|
|
170
|
+
case 'expires':
|
|
171
|
+
azureCookieObject.expires = new Date(sanitizedValue);
|
|
172
|
+
break;
|
|
173
|
+
case 'secure':
|
|
174
|
+
azureCookieObject.secure = true;
|
|
175
|
+
break;
|
|
176
|
+
case 'httponly':
|
|
177
|
+
azureCookieObject.httpOnly = true;
|
|
178
|
+
break;
|
|
179
|
+
case 'samesite':
|
|
180
|
+
azureCookieObject.sameSite = sanitizedValue;
|
|
181
|
+
break;
|
|
182
|
+
case 'max-age':
|
|
183
|
+
azureCookieObject.maxAge = Number(sanitizedValue);
|
|
184
|
+
break;
|
|
185
|
+
}
|
|
186
|
+
return azureCookieObject;
|
|
187
|
+
}, { name: '', value: '' });
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
exports.HttpTriggerV4Adapter = HttpTriggerV4Adapter;
|
|
191
|
+
//# sourceMappingURL=http-trigger-v4.adapter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"http-trigger-v4.adapter.js","sourceRoot":"","sources":["../../../src/adapters/azure/http-trigger-v4.adapter.ts"],"names":[],"mappings":";AAAA,iBAAiB;;;AAEjB,6BAA0B;AAc1B,qCAKoB;AAmBpB;;;;;;;;;;;;;GAaG;AACH,MAAa,oBAAoB;IAG/B,qBAAqB;IAErB;;;;OAIG;IACH,YAA+B,OAAqC;QAArC,YAAO,GAAP,OAAO,CAA8B;IAAG,CAAC;IAExE,YAAY;IAEZ,wBAAwB;IAExB;;OAEG;IACI,cAAc;QACnB,OAAO,oBAAoB,CAAC,IAAI,CAAC;IACnC,CAAC;IAED;;OAEG;IACI,SAAS,CAAC,KAAc,EAAE,OAAgB;QAC/C,MAAM,UAAU,GAAG,KAAyC,CAAC;QAC7D,MAAM,YAAY,GAAG,OAAuC,CAAC;QAE7D,OAAO,CAAC,CAAC,CACP,UAAU;YACV,UAAU,CAAC,MAAM;YACjB,UAAU,CAAC,OAAO;YAClB,UAAU,CAAC,GAAG;YACd,UAAU,CAAC,KAAK;YAChB,YAAY;YACZ,YAAY,CAAC,YAAY;YACzB,YAAY,CAAC,kBAAkB;YAC/B,YAAY,CAAC,GAAG;YAChB,YAAY,CAAC,GAAG,CAAC,IAAI;YACrB,YAAY,CAAC,WAAW,CACzB,CAAC;IACJ,CAAC;IAED;;OAEG;IACI,UAAU,CAAC,KAAkB;QAClC,MAAM,IAAI,GAAG,IAAI,CAAC,gBAAgB,CAAC,KAAK,CAAC,CAAC;QAE1C,MAAM,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC;QAC5B,MAAM,OAAO,GAAG,IAAA,6BAAsB,EAAC,KAAK,CAAC,OAAO,EAAE,GAAG,EAAE,IAAI,CAAC,CAAC;QAEjE,IAAI,IAAwB,CAAC;QAE7B,IAAI,KAAK,CAAC,IAAI,EAA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../../../src/adapters/azure/index.ts"],"names":[],"mappings":"AAAA,cAAc,2BAA2B,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./http-trigger-v4.adapter"), exports);
|
|
18
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/adapters/azure/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,4DAA0C"}
|
|
@@ -2,26 +2,30 @@ import { AdapterContract, AdapterRequest, OnErrorProps } from '../../contracts';
|
|
|
2
2
|
import { IEmptyResponse } from '../../core';
|
|
3
3
|
/**
|
|
4
4
|
* The class that represents a dummy adapter that does nothing and can be used by the cloud that doesn't use adapters.
|
|
5
|
+
*
|
|
6
|
+
* @breadcrumb Adapters / DummyAdapter
|
|
7
|
+
* @public
|
|
5
8
|
*/
|
|
6
9
|
export declare class DummyAdapter implements AdapterContract<any, any, void> {
|
|
7
10
|
/**
|
|
8
|
-
* @inheritDoc
|
|
11
|
+
* {@inheritDoc}
|
|
9
12
|
*/
|
|
10
13
|
canHandle(): boolean;
|
|
11
14
|
/**
|
|
12
|
-
* @inheritDoc
|
|
15
|
+
* {@inheritDoc}
|
|
13
16
|
*/
|
|
14
17
|
getAdapterName(): string;
|
|
15
18
|
/**
|
|
16
|
-
* @inheritDoc
|
|
19
|
+
* {@inheritDoc}
|
|
17
20
|
*/
|
|
18
21
|
getRequest(): AdapterRequest;
|
|
19
22
|
/**
|
|
20
|
-
* @inheritDoc
|
|
23
|
+
* {@inheritDoc}
|
|
21
24
|
*/
|
|
22
25
|
getResponse(): IEmptyResponse;
|
|
23
26
|
/**
|
|
24
|
-
* @inheritDoc
|
|
27
|
+
* {@inheritDoc}
|
|
25
28
|
*/
|
|
26
29
|
onErrorWhileForwarding(props: OnErrorProps<any, void>): void;
|
|
27
30
|
}
|
|
31
|
+
//# sourceMappingURL=dummy.adapter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dummy.adapter.d.ts","sourceRoot":"","sources":["../../../src/adapters/dummy/dummy.adapter.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,eAAe,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAChF,OAAO,EAAiB,cAAc,EAAE,MAAM,YAAY,CAAC;AAI3D;;;;;GAKG;AACH,qBAAa,YAAa,YAAW,eAAe,CAAC,GAAG,EAAE,GAAG,EAAE,IAAI,CAAC;IAClE;;OAEG;IACI,SAAS,IAAI,OAAO;IAI3B;;OAEG;IACI,cAAc,IAAI,MAAM;IAI/B;;OAEG;IACI,UAAU,IAAI,cAAc;IASnC;;OAEG;IACI,WAAW,IAAI,cAAc;IAIpC;;OAEG;IACI,sBAAsB,CAAC,KAAK,EAAE,YAAY,CAAC,GAAG,EAAE,IAAI,CAAC,GAAG,IAAI;CAGpE"}
|
|
@@ -6,22 +6,25 @@ const core_1 = require("../../core");
|
|
|
6
6
|
//#endregion
|
|
7
7
|
/**
|
|
8
8
|
* The class that represents a dummy adapter that does nothing and can be used by the cloud that doesn't use adapters.
|
|
9
|
+
*
|
|
10
|
+
* @breadcrumb Adapters / DummyAdapter
|
|
11
|
+
* @public
|
|
9
12
|
*/
|
|
10
13
|
class DummyAdapter {
|
|
11
14
|
/**
|
|
12
|
-
* @inheritDoc
|
|
15
|
+
* {@inheritDoc}
|
|
13
16
|
*/
|
|
14
17
|
canHandle() {
|
|
15
18
|
return true;
|
|
16
19
|
}
|
|
17
20
|
/**
|
|
18
|
-
* @inheritDoc
|
|
21
|
+
* {@inheritDoc}
|
|
19
22
|
*/
|
|
20
23
|
getAdapterName() {
|
|
21
24
|
return DummyAdapter.name;
|
|
22
25
|
}
|
|
23
26
|
/**
|
|
24
|
-
* @inheritDoc
|
|
27
|
+
* {@inheritDoc}
|
|
25
28
|
*/
|
|
26
29
|
getRequest() {
|
|
27
30
|
return {
|
|
@@ -32,16 +35,17 @@ class DummyAdapter {
|
|
|
32
35
|
};
|
|
33
36
|
}
|
|
34
37
|
/**
|
|
35
|
-
* @inheritDoc
|
|
38
|
+
* {@inheritDoc}
|
|
36
39
|
*/
|
|
37
40
|
getResponse() {
|
|
38
41
|
return core_1.EmptyResponse;
|
|
39
42
|
}
|
|
40
43
|
/**
|
|
41
|
-
* @inheritDoc
|
|
44
|
+
* {@inheritDoc}
|
|
42
45
|
*/
|
|
43
46
|
onErrorWhileForwarding(props) {
|
|
44
47
|
props.delegatedResolver.succeed();
|
|
45
48
|
}
|
|
46
49
|
}
|
|
47
50
|
exports.DummyAdapter = DummyAdapter;
|
|
51
|
+
//# sourceMappingURL=dummy.adapter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dummy.adapter.js","sourceRoot":"","sources":["../../../src/adapters/dummy/dummy.adapter.ts"],"names":[],"mappings":";AAAA,iBAAiB;;;AAGjB,qCAA2D;AAE3D,YAAY;AAEZ;;;;;GAKG;AACH,MAAa,YAAY;IACvB;;OAEG;IACI,SAAS;QACd,OAAO,IAAI,CAAC;IACd,CAAC;IAED;;OAEG;IACI,cAAc;QACnB,OAAO,YAAY,CAAC,IAAI,CAAC;IAC3B,CAAC;IAED;;OAEG;IACI,UAAU;QACf,OAAO;YACL,MAAM,EAAE,MAAM;YACd,IAAI,EAAE,KAAK,CAAC;YACZ,IAAI,EAAE,QAAQ;YACd,OAAO,EAAE,EAAE;SACZ,CAAC;IACJ,CAAC;IAED;;OAEG;IACI,WAAW;QAChB,OAAO,oBAAa,CAAC;IACvB,CAAC;IAED;;OAEG;IACI,sBAAsB,CAAC,KAA8B;QAC1D,KAAK,CAAC,iBAAiB,CAAC,OAAO,EAAE,CAAC;IACpC,CAAC;CACF;AAxCD,oCAwCC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/adapters/dummy/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC"}
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
3
|
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
5
9
|
}) : (function(o, m, k, k2) {
|
|
6
10
|
if (k2 === undefined) k2 = k;
|
|
7
11
|
o[k2] = m[k];
|
|
@@ -11,3 +15,4 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
11
15
|
};
|
|
12
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
17
|
__exportStar(require("./dummy.adapter"), exports);
|
|
18
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/adapters/dummy/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,kDAAgC"}
|