UNPKG

2.21 kBTypeScriptView Raw
1import { AwsCloudWatchEvent } from './types';
2/**
3 * Determine if Cloudwatch event is a Step Function event
4 *
5 * @param {AwsCloudWatchEvent} event - A Cloudwatch event
6 * @returns {boolean} True if event is a Step Function event
7 */
8export declare const isSfExecutionEvent: (event: AwsCloudWatchEvent) => boolean;
9/**
10 * Determine if Step Function is in a terminal state.
11 *
12 * @param {string} status - A Step Function execution status from a Cloudwatch event
13 * @returns {boolean} True if Step Function is in terminal state.
14 */
15export declare const isTerminalSfStatus: (status: string) => boolean;
16/**
17 * Determine if Step Function is in a failed state.
18 *
19 * @param {Object} status - A Step Function execution status from a Cloudwatch event
20 * @returns {boolean} True if Step Function is in failed state.
21 */
22export declare const isFailedSfStatus: (status: string) => boolean;
23/**
24 * Get Step Function status from Cloudwatch event.
25 *
26 * @param {AwsCloudWatchEvent} event - A Cloudwatch event
27 * @returns {string|undefined} Step Function execution status
28 */
29export declare const getSfEventStatus: (event: AwsCloudWatchEvent) => string | undefined;
30/**
31 * Get the Step Function output message from a Cloudwatch Event
32 *
33 * @param {AwsCloudWatchEvent} event - A Cloudwatch event
34 * @param {string} field - Field to pull from 'detail', i.e. 'input' or 'output'
35 * @param {string} [defaultValue] - A default value for the message, if none exists
36 * @returns {string|undefined} Output message from Step Function
37 */
38export declare const getSfEventDetailValue: (event: AwsCloudWatchEvent, field: 'input' | 'output', defaultValue?: string | undefined) => string | undefined;
39/**
40 * Get the Step Function output message from a Cloudwatch Event
41 *
42 * @param {Object} event - A Cloudwatch event
43 * @param {string} messageSource - 'input' or 'output' from Step Function
44 * @param {string} defaultValue - defaultValue to fetch if no event message object is found
45 * @returns {unknown} Message object from Step Function
46 */
47export declare const getSfEventMessageObject: (event: AwsCloudWatchEvent, messageSource: 'input' | 'output', defaultValue: string) => unknown;
48//# sourceMappingURL=cloudwatch-event.d.ts.map
\No newline at end of file