aws-delivlib
Version:
A fabulous library for defining continuous pipelines for building, testing and releasing code libraries.
38 lines (37 loc) • 1.54 kB
TypeScript
/// <reference types="node" />
/// <reference types="node" />
import { RRule } from 'rrule';
/**
* A calendar event describing a "blocked" time window.
*/
export interface CalendarEvent {
/** The description of the event */
summary: string;
/** The time at which the block starts */
start: Date;
/** The time at which the block ends */
end: Date;
/** The time at which the event was last modified. */
dtstamp?: Date;
/** The type of a calendar event */
type: 'VEVENT' | string;
/** Parameters to the event, if any. */
params?: any[];
/** The type of the boundaries for the event */
datetype: 'date-time';
/** A recurrence rule for the event. */
rrule?: RRule;
}
/**
* Evaluates whether a deployment pipeline should have promotions suspended due to the imminent start of a blocked
* time window.
*
* @param ical is an iCal document that describes "blocked" time windows (there needs to be an event only for times
* during which promotions should not happen).
* @param now is the reference time considered when assessing the need to block or not.
* @param advanceMarginSec how many seconds from `now` should be free of any "blocked" time window for the pipeline to
* not be blocked (defaults to 1 hour).
*
* @returns the events that represent the blocked time, or `undefined` if `now` is not "blocked".
*/
export declare function shouldBlockPipeline(icalData: string | Buffer, now?: Date, advanceMarginSec?: number): CalendarEvent | undefined;