UNPKG

@aws-lambda-powertools/batch

Version:

The batch processing package for the Powertools for AWS Lambda (TypeScript) library.

36 lines (35 loc) 996 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.DATA_CLASS_MAPPING = exports.DEFAULT_RESPONSE = exports.SchemaVendor = exports.EventType = void 0; /** * Enum of supported event types for the utility */ const EventType = { SQS: 'SQS', KinesisDataStreams: 'KinesisDataStreams', DynamoDBStreams: 'DynamoDBStreams', }; exports.EventType = EventType; /** * Enum of supported schema vendors for the utility */ const SchemaVendor = { Zod: 'zod', }; exports.SchemaVendor = SchemaVendor; /** * Default response for the partial batch processor */ const DEFAULT_RESPONSE = { batchItemFailures: [], }; exports.DEFAULT_RESPONSE = DEFAULT_RESPONSE; /** * Mapping of event types to their respective data classes */ const DATA_CLASS_MAPPING = { [EventType.SQS]: (record) => record, [EventType.KinesisDataStreams]: (record) => record, [EventType.DynamoDBStreams]: (record) => record, }; exports.DATA_CLASS_MAPPING = DATA_CLASS_MAPPING;