UNPKG

@atomist/sdm

Version:

Atomist Software Delivery Machine SDK

30 lines 1.3 kB
import { Configuration } from "@atomist/automation-client/lib/configuration"; import { SdmGoalEvent } from "../../api/goal/SdmGoalEvent"; import { SdmGoalKey } from "../../api/goal/SdmGoalMessage"; export declare function mapKeyToGoal<T extends SdmGoalKey>(goals: T[]): (k: SdmGoalKey) => T; export declare function goalKeyEquals(a: SdmGoalKey, b: SdmGoalKey): boolean; export declare function goalKeyString(gk: SdmGoalKey): string; /** * Read and parse goal event data. If the goal event has no data, * return an empty object. Note: this purposely only works if the * data field is stringified JSON. * * @param sdmGoal * @return JSON parsed goal event data property */ export declare function goalData(sdmGoal: SdmGoalEvent): any; /** * Return a shallow merge the provided `data` and the goal event data * property, parsed as JSON. Properties in `data` take precedence * over those in the parsed goal event data object. * * @param data * @param sdmGoal * @return shallow merge of data and SDM goal event data property */ export declare function mergeGoalData(data: any, sdmGoal: SdmGoalEvent): any; /** * Return configured SDM goal timeout or default value, 10 minutes. */ export declare function sdmGoalTimeout(cfg?: Configuration): number; //# sourceMappingURL=sdmGoal.d.ts.map