@aesop-fables/triginta 0.8.0 → 0.8.2
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/lib/http/HttpLambda.d.ts
CHANGED
|
@@ -4,8 +4,8 @@ import { IHttpEndpoint, IHttpEventHandler } from './IHttpEndpoint';
|
|
|
4
4
|
import { IConfiguredRoute } from './IConfiguredRoute';
|
|
5
5
|
export declare type NonNoisyEvent = Omit<APIGatewayProxyEventV2, 'requestContext'>;
|
|
6
6
|
export interface BootstrappedHttpLambdaContext {
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
createHttpEventHandler<Output>(newable: Newable<IHttpEventHandler<Output>>): Handler<APIGatewayProxyEventV2, APIGatewayProxyStructuredResultV2>;
|
|
8
|
+
createHttpHandler<Input, Output>(newable: Newable<IHttpEndpoint<Input, Output>>): Handler<APIGatewayProxyEventV2, APIGatewayProxyStructuredResultV2>;
|
|
9
9
|
}
|
|
10
10
|
export interface IHttpLambdaFactory {
|
|
11
11
|
createHandler<Input, Output>(newable: Newable<IHttpEndpoint<Input, Output> | IHttpEventHandler<Output>>): Handler<APIGatewayProxyEventV2, APIGatewayProxyStructuredResultV2>;
|
|
@@ -26,7 +26,4 @@ export declare class HttpLambdaFactory implements IHttpLambdaFactory {
|
|
|
26
26
|
createHandler<Input, Output>(newable: Newable<IHttpEndpoint<Input, Output> | IHttpEventHandler<Output>>): Handler<APIGatewayProxyEventV2, APIGatewayProxyStructuredResultV2>;
|
|
27
27
|
}
|
|
28
28
|
export declare const useTrigintaHttp: import("@aesop-fables/containr").IServiceModule;
|
|
29
|
-
export declare function createBootstrappedHttpLambdaContext(container: IServiceContainer):
|
|
30
|
-
createHttpEventLambda<Output>(newable: Newable<IHttpEventHandler<Output>>): Handler<APIGatewayProxyEventV2, APIGatewayProxyStructuredResultV2>;
|
|
31
|
-
createHttpLambda<Input, Output_1>(newable: Newable<IHttpEndpoint<Input, Output_1> | IHttpEventHandler<Output_1>>): Handler<APIGatewayProxyEventV2, APIGatewayProxyStructuredResultV2>;
|
|
32
|
-
};
|
|
29
|
+
export declare function createBootstrappedHttpLambdaContext(container: IServiceContainer): BootstrappedHttpLambdaContext;
|
package/lib/http/HttpLambda.js
CHANGED
|
@@ -140,12 +140,12 @@ function validateContainer(container) {
|
|
|
140
140
|
}
|
|
141
141
|
function createBootstrappedHttpLambdaContext(container) {
|
|
142
142
|
return {
|
|
143
|
-
|
|
143
|
+
createHttpEventHandler(newable) {
|
|
144
144
|
validateContainer(container);
|
|
145
145
|
const factory = container.get(HttpLambdaServices_1.HttpLambdaServices.HttpLambdaFactory);
|
|
146
146
|
return factory.createEventHandler(newable);
|
|
147
147
|
},
|
|
148
|
-
|
|
148
|
+
createHttpHandler(newable) {
|
|
149
149
|
validateContainer(container);
|
|
150
150
|
const factory = container.get(HttpLambdaServices_1.HttpLambdaServices.HttpLambdaFactory);
|
|
151
151
|
return factory.createHandler(newable);
|
|
@@ -23,13 +23,13 @@ class ValidationContext {
|
|
|
23
23
|
}
|
|
24
24
|
isEmpty() {
|
|
25
25
|
const value = this.value();
|
|
26
|
-
if (typeof value === 'undefined' ||
|
|
26
|
+
if (typeof value === 'undefined' || value === null) {
|
|
27
27
|
return true;
|
|
28
28
|
}
|
|
29
29
|
if (typeof value === 'string') {
|
|
30
30
|
return value.length === 0 || value.trim().length === 0;
|
|
31
31
|
}
|
|
32
|
-
return
|
|
32
|
+
return false;
|
|
33
33
|
}
|
|
34
34
|
}
|
|
35
35
|
exports.ValidationContext = ValidationContext;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aesop-fables/triginta",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.2",
|
|
4
4
|
"description": "A lightweight framework that wraps the basic infrastructure usages of AWS Lambda (SQS, Kinesis, etc.).",
|
|
5
5
|
"type": "commonjs",
|
|
6
6
|
"exports": {
|
|
@@ -52,7 +52,7 @@
|
|
|
52
52
|
"lib/**/*"
|
|
53
53
|
],
|
|
54
54
|
"peerDependencies": {
|
|
55
|
-
"@aesop-fables/containr": "0.
|
|
55
|
+
"@aesop-fables/containr": "0.3.x",
|
|
56
56
|
"@middy/core": "4.x",
|
|
57
57
|
"@middy/http-error-handler": "4.x",
|
|
58
58
|
"@middy/http-json-body-parser": "4.x",
|