@cumulus/common
Version:
Common utilities used across tasks
31 lines • 978 B
TypeScript
export declare type SnsNotification = {
Message: string;
};
export declare type AwsLambdaSnsMessageEventRecord = {
Sns: SnsNotification;
};
/**
* Determine if event is an SNS event
*
* @param {Object} event - A Cloudwatch event object
* @returns {boolean} - True if event is an SNS event
*/
export declare const isSnsEvent: (event: {
EventSource?: string;
}) => boolean;
/**
* Get message from SNS event.
*
* @param {var} event - SNS event
* @param {any} [defaultValue] - Default value to use for message, if none exists.
* @returns {any} - Message from SNS event
*/
export declare const getSnsEventMessage: (event: AwsLambdaSnsMessageEventRecord, defaultValue?: string) => string;
/**
* Get message object from SNS event.
*
* @param {Object} event - SNS event
* @returns {Object} - Message object from SNS event
*/
export declare const getSnsEventMessageObject: (event: AwsLambdaSnsMessageEventRecord) => any;
//# sourceMappingURL=sns-event.d.ts.map