@allthings/cloud-toolkit 2.3.0-dev.1 → 2.3.0-dev.11

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.
@@ -1,6 +1,6 @@
1
1
  import ClientError from './errors/clientError';
2
2
  import ServerError from './errors/serverError';
3
- import { Alagarr, HandlerFunction, IInterfaceAlagarrOptions, IInterfaceRequest, IInterfaceResponse } from './types';
4
- export { Alagarr, ClientError, HandlerFunction, IInterfaceAlagarrOptions, IInterfaceRequest, IInterfaceResponse, ServerError, };
3
+ import { Alagarr, HandlerFunction, IInterfaceAlagarrOptions, IInterfaceHeaders, IInterfaceQueryParameters, IInterfaceRequest, IInterfaceRequestV2, IInterfaceResponse } from './types';
4
+ export { Alagarr, ClientError, HandlerFunction, IInterfaceAlagarrOptions, IInterfaceHeaders, IInterfaceQueryParameters, IInterfaceRequest, IInterfaceRequestV2, IInterfaceResponse, ServerError, };
5
5
  declare const alagarr: (handler?: HandlerFunction, options?: IInterfaceAlagarrOptions) => Alagarr;
6
6
  export default alagarr;
@@ -1,4 +1,4 @@
1
- import * as AWSLambda from 'aws-lambda';
1
+ import { APIGatewayProxyEvent, APIGatewayProxyEventV2, Context } from 'aws-lambda';
2
2
  import { IInterfaceAlagarrOptions, IInterfaceRequest } from '../types';
3
- declare const _default: (event: AWSLambda.APIGatewayEvent, context: AWSLambda.Context, options?: IInterfaceAlagarrOptions) => Promise<IInterfaceRequest>;
3
+ declare const _default: (event: APIGatewayProxyEvent | APIGatewayProxyEventV2, context: Context, options?: IInterfaceAlagarrOptions) => Promise<IInterfaceRequest>;
4
4
  export default _default;
@@ -1,3 +1,3 @@
1
- import { IInterfaceRequest } from '../../types';
2
- declare const normalizeHeaders: ({ headers, ...request }: IInterfaceRequest) => IInterfaceRequest;
1
+ import { IInterfaceRequest, IInterfaceRequestV2 } from '../../types';
2
+ declare const normalizeHeaders: ({ headers, ...request }: IInterfaceRequest | IInterfaceRequestV2) => IInterfaceRequest | IInterfaceRequestV2;
3
3
  export default normalizeHeaders;
@@ -1,3 +1,3 @@
1
- import { IInterfaceRequest } from '../../types';
2
- declare const normalizeProgrammingModel: (request: IInterfaceRequest) => IInterfaceRequest;
1
+ import { IInterfaceRequest, IInterfaceRequestV2 } from '../../types';
2
+ declare const normalizeProgrammingModel: (request: IInterfaceRequest | IInterfaceRequestV2) => IInterfaceRequest | IInterfaceRequestV2;
3
3
  export default normalizeProgrammingModel;
@@ -1,6 +1,6 @@
1
- import AWSLambda from 'aws-lambda';
2
- export type Alagarr = (event: AWSLambda.APIGatewayEvent, context: AWSLambda.Context, callback: AWSLambda.Callback) => void;
3
- export type HandlerFunction = (request: any, response: any, context?: AWSLambda.Context) => string | object | void | Promise<string | object | void>;
1
+ import { APIGatewayEvent, APIGatewayProxyEventV2, Callback, Context } from 'aws-lambda';
2
+ export type Alagarr = (event: APIGatewayEvent | APIGatewayProxyEventV2, context: Context, callback: Callback) => void;
3
+ export type HandlerFunction = (request: any, response: any, context?: Context) => string | object | void | Promise<string | object | void>;
4
4
  export type Logger = (request: any, response: any) => boolean;
5
5
  export type ErrorHandler = (request: IInterfaceRequest, response: IInterfaceResponse, error: any) => void;
6
6
  export interface IInterfaceAlagarrOptions {
@@ -30,9 +30,9 @@ export interface IInterfaceHeaders {
30
30
  export interface IInterfaceQueryParameters {
31
31
  readonly [name: string]: string;
32
32
  }
33
- export interface IInterfaceRequest extends AWSLambda.APIGatewayEvent {
33
+ export interface IInterfaceRequest extends APIGatewayEvent {
34
34
  readonly body: any;
35
- readonly context: AWSLambda.Context;
35
+ readonly context: Context;
36
36
  readonly cookies: IInterfaceCookie;
37
37
  readonly headers: IInterfaceHeaders;
38
38
  readonly hostname?: string;
@@ -44,6 +44,19 @@ export interface IInterfaceRequest extends AWSLambda.APIGatewayEvent {
44
44
  readonly source: string;
45
45
  readonly timestamp: number;
46
46
  }
47
+ export interface IInterfaceRequestV2 extends APIGatewayProxyEventV2 {
48
+ readonly body: any;
49
+ readonly context: Context;
50
+ readonly headers: IInterfaceHeaders;
51
+ readonly hostname?: string;
52
+ readonly isBase64Encoded: boolean;
53
+ readonly meta: IIndexSignature;
54
+ readonly method: string;
55
+ readonly provider: string;
56
+ readonly query: IInterfaceQueryParameters;
57
+ readonly source: string;
58
+ readonly timestamp: number;
59
+ }
47
60
  export type RequestMiddleware = (request: IInterfaceRequest) => IInterfaceRequest;
48
61
  export interface IInterfaceResponseData {
49
62
  readonly body: string;
@@ -1,4 +1,4 @@
1
- export { Alagarr, default as alagarr, ClientError, HandlerFunction, IInterfaceAlagarrOptions, IInterfaceRequest, IInterfaceResponse, ServerError, } from './alagarr';
1
+ export { Alagarr, default as alagarr, ClientError, HandlerFunction, IInterfaceAlagarrOptions, IInterfaceHeaders, IInterfaceQueryParameters, IInterfaceRequest, IInterfaceResponse, ServerError, } from './alagarr';
2
2
  export { DEFAULT_PARAMETER_STORE_CLIENT_CONFIG, DEFAULT_SES_CLIENT_CONFIG, dynamodb, IDynamoDBConfig, IEmailAttachment, IEmailOptions, ILambda, IParameterStore, ISES, ISQS, IUnprocessedItems, lambda, parameterStore, ses, sqs, TBatchWriteItems, TDeleteItem, TDeleteQueueItem, TGetItem, TGetQueueItems, TGetQueueUrl, TGetSecret, TGetSecrets, TInvokeLambda, TPutItem, TQueryTable, TScanTable, TSendMail, TSendMessage, TUpdateItem, } from './aws';
3
3
  export { default as logger } from './logger/logger';
4
4
  export { Logger } from 'winston';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@allthings/cloud-toolkit",
3
- "version": "2.3.0-dev.1",
3
+ "version": "2.3.0-dev.11",
4
4
  "description": "",
5
5
  "author": "Allthings GmbH",
6
6
  "keywords": [