UNPKG

@scaffoldly/serverless-util

Version:
89 lines 2.28 kB
import express from 'express'; export declare type ExpressRequest = express.Request; export declare type ExpressResponse = express.Response; export declare type HttpRequestBase = { method: string; headers: Record<string, string>; path: string; hostname: string; body?: any; }; export declare type HttpRequest = HttpRequestBase & express.Request; export interface ErrorResponseTracking { method: string; path: string; version: string; } export interface ErrorResponse { message: string; traceId: string; tracking: ErrorResponseTracking; context?: { [key: string]: unknown; }; } export declare type CleansedObject = { [key: string]: string | number | boolean; }; export declare type BaseJwtPayload = { iss: string; sub: string; aud: string; exp: number; nbf?: number; iat: number; jti: string; }; export declare type HttpRequestWithUser = HttpRequest & { user: BaseJwtPayload; }; export declare type TypedDynamoDBStreamRecord<T> = { Keys?: { [key: string]: any; }; New?: T; Old?: T; }; export declare type TypedDynamoDBRecord<T> = { dynamodb: TypedDynamoDBStreamRecord<T>; eventID: string; eventName: 'INSERT' | 'MODIFY' | 'REMOVE'; eventSourceARN: string; awsRegion: string; tableName: string; }; export declare type TypedDynamoDBStreamEvent<T> = { Records: TypedDynamoDBRecord<T>[]; }; export declare type TypedSNSMessageAttribute = { Type: string; Value: string; }; export declare type TypedSNSMessageAttributes = { [name: string]: TypedSNSMessageAttribute; }; export declare type TypedSNSMessage<T> = { SignatureVersion: string; Timestamp: string; Signature: string; SigningCertUrl: string; MessageId: string; Message: string; MessageAttributes: TypedSNSMessageAttributes; Type: string; UnsubscribeUrl: string; TopicArn: string; Subject: string; Object: T; TopicName: string; }; export declare type TypedSNSEventRecord<T> = { EventVersion: string; EventSubscriptionArn: string; EventSource: string; Sns: TypedSNSMessage<T>; }; export declare type TypedSNSEvent<T> = { Records: TypedSNSEventRecord<T>[]; }; //# sourceMappingURL=interfaces.d.ts.map