@spytecgps/lambda-utils 0.9.13 → 0.9.15

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.
Files changed (2) hide show
  1. package/dist/types.d.ts +5 -2
  2. package/package.json +2 -2
package/dist/types.d.ts CHANGED
@@ -1,7 +1,8 @@
1
- import { APIGatewayEventRequestContext, APIGatewayProxyEvent, APIGatewayProxyWithLambdaAuthorizerEvent, SQSEvent, SQSRecord, Context } from 'aws-lambda';
1
+ import { APIGatewayEventRequestContext, APIGatewayProxyEvent, APIGatewayProxyWithLambdaAuthorizerEvent, SQSEvent, SQSRecord, Context, APIGatewayProxyWithCognitoAuthorizerEvent } from 'aws-lambda';
2
2
  import { ObjectSchema } from 'joi';
3
3
  import { APIGatewayProxyEventBase } from 'aws-lambda/trigger/api-gateway-proxy';
4
4
  import * as Joi from 'joi';
5
+ import { Callback } from 'aws-lambda/handler';
5
6
  export interface SpytecAuthorizedResources {
6
7
  devices: string[];
7
8
  }
@@ -16,11 +17,13 @@ export interface SpytecAuthContext {
16
17
  }
17
18
  export declare type BaseAPIGatewayEvent = Omit<APIGatewayProxyEventBase<SpytecAuthContext>, 'pathParameters' | 'queryStringParameters' | 'body'>;
18
19
  export interface WrapperArgs<E, R> {
19
- event: APIGatewayProxyWithLambdaAuthorizerEvent<SpytecAuthContext> | APIGatewayProxyEvent;
20
+ event: APIGatewayProxyEvent;
20
21
  context?: APIGatewayEventRequestContext;
21
22
  schema?: ObjectSchema<E>;
22
23
  handler: Handler<E, R>;
23
24
  }
25
+ export declare type UserAPIHandler<TEvent = APIGatewayProxyWithLambdaAuthorizerEvent<SpytecAuthContext>, TResult = any> = (event: TEvent, context: APIGatewayEventRequestContext, callback: Callback<TResult>) => void | Promise<TResult>;
26
+ export declare type ServerAPIHandler<TResult = any> = (event: APIGatewayProxyWithCognitoAuthorizerEvent, context: APIGatewayEventRequestContext, callback: Callback<TResult>) => void | Promise<TResult>;
24
27
  export declare type Handler<E, R> = (event: E) => Promise<HandlerResponse<R>>;
25
28
  export interface HandlerResponse<R> {
26
29
  statusCode?: number;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@spytecgps/lambda-utils",
3
- "version": "0.9.13",
3
+ "version": "0.9.15",
4
4
  "description": "Lambda Utils",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
@@ -28,7 +28,7 @@
28
28
  "dependencies": {
29
29
  "joi": "^17.4.0",
30
30
  "qs": "^6.10.1",
31
- "@spytecgps/sdk": "0.5.29"
31
+ "@spytecgps/sdk": "0.5.34"
32
32
  },
33
33
  "devDependencies": {
34
34
  "@types/aws-lambda": "^8.10.76",