@spytecgps/lambda-utils 0.0.10 → 0.9.1

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/types.d.ts CHANGED
@@ -4,8 +4,9 @@ import { APIGatewayProxyEventBase } from 'aws-lambda/trigger/api-gateway-proxy';
4
4
  export interface SpytecAuthorizedResources {
5
5
  devices: string[];
6
6
  }
7
+ export declare type AuthClass = 'user' | 'client' | 'system';
7
8
  export interface SpytecAuthContext {
8
- type: 'user' | 'client';
9
+ type: AuthClass;
9
10
  userId?: string;
10
11
  clientId: number;
11
12
  resources: SpytecAuthorizedResources;
@@ -1,10 +1,11 @@
1
1
  import * as Joi from 'joi';
2
- import { SpytecAuthContext } from '../types';
2
+ import { AuthClass, SpytecAuthContext } from '../types';
3
3
  import { APIGatewayEventRequestContextWithAuthorizer } from 'aws-lambda/common/api-gateway';
4
4
  interface GetAuthorizerValidatorParams {
5
5
  scope?: string;
6
+ type?: AuthClass;
6
7
  }
7
- export declare const getAuthorizerValidator: ({ scope }?: GetAuthorizerValidatorParams) => Joi.ObjectSchema<SpytecAuthContext>;
8
+ export declare const getAuthorizerValidator: ({ scope, type }?: GetAuthorizerValidatorParams) => Joi.ObjectSchema<SpytecAuthContext>;
8
9
  /**
9
10
  * @deprecated
10
11
  */
@@ -0,0 +1,4 @@
1
+ import { APIGatewayProxyResult } from 'aws-lambda';
2
+ import { WrapperArgs } from '../types';
3
+ declare const apiGatewayEventWrapper: <E, R>({ event, schema, handler, }: WrapperArgs<E, R>) => Promise<APIGatewayProxyResult>;
4
+ export default apiGatewayEventWrapper;
@@ -1,3 +1,3 @@
1
- import apiGwWrapper from './apiGwWrapper';
2
- export { apiGwWrapper };
1
+ import apiGatewayEventWrapper from './apiGatewayEventWrapper';
2
+ export { apiGatewayEventWrapper };
3
3
  export * from './response';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@spytecgps/lambda-utils",
3
- "version": "0.0.10",
3
+ "version": "0.9.1",
4
4
  "description": "Lambda Utils",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",