@spytecgps/lambda-utils 0.0.3 → 0.0.6
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/dist/index.d.ts +4 -3
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/types.d.ts +1 -2
- package/dist/validation/custom.d.ts +3 -0
- package/dist/validation/index.d.ts +3 -0
- package/dist/wrappers/apiGwWrapper.d.ts +4 -0
- package/dist/wrappers/index.d.ts +3 -0
- package/dist/wrappers/response.d.ts +8 -0
- package/package.json +4 -2
package/dist/types.d.ts
CHANGED
|
@@ -9,7 +9,7 @@ export interface SpytecAuthContext {
|
|
|
9
9
|
clientId: number;
|
|
10
10
|
resources: SpytecAuthorizedResources;
|
|
11
11
|
}
|
|
12
|
-
declare type BaseEvent = APIGatewayProxyWithLambdaAuthorizerEvent<SpytecAuthContext>;
|
|
12
|
+
export declare type BaseEvent = APIGatewayProxyWithLambdaAuthorizerEvent<SpytecAuthContext>;
|
|
13
13
|
export interface WrapperArgs<E, R> {
|
|
14
14
|
event: BaseEvent;
|
|
15
15
|
schema?: ObjectSchema<E>;
|
|
@@ -24,4 +24,3 @@ export interface HandlerResponse<R> {
|
|
|
24
24
|
message?: string;
|
|
25
25
|
data?: R;
|
|
26
26
|
}
|
|
27
|
-
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { APIGatewayProxyResult } from 'aws-lambda';
|
|
2
|
+
import { HandlerResponse } from '../types';
|
|
3
|
+
export declare const buildResponseBody: <T>(statusCode: number, message: string, data?: T) => {
|
|
4
|
+
success: boolean;
|
|
5
|
+
message: string;
|
|
6
|
+
result: T;
|
|
7
|
+
};
|
|
8
|
+
export declare const buildProxyResult: <R>({ statusCode, message, data, headers, }: HandlerResponse<R>) => APIGatewayProxyResult;
|
package/package.json
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@spytecgps/lambda-utils",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.6",
|
|
4
4
|
"description": "Lambda Utils",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
7
7
|
"scripts": {
|
|
8
8
|
"version": "npm run format && git add -A src",
|
|
9
|
+
"preversion": "npm test",
|
|
9
10
|
"postversion": "git push && git push --tags",
|
|
10
11
|
"prepublishOnly": "npm test && npm run lint",
|
|
11
12
|
"prepare": "npm run build",
|
|
@@ -27,7 +28,8 @@
|
|
|
27
28
|
},
|
|
28
29
|
"homepage": "https://github.com/spytecgps/lambda-utils#readme",
|
|
29
30
|
"dependencies": {
|
|
30
|
-
"joi": "^17.4.0"
|
|
31
|
+
"joi": "^17.4.0",
|
|
32
|
+
"qs": "^6.10.1"
|
|
31
33
|
},
|
|
32
34
|
"devDependencies": {
|
|
33
35
|
"@types/aws-lambda": "^8.10.76",
|