UNPKG

1.4 kBTypeScriptView Raw
1interface CrontabSchedule {
2 type: 'crontab';
3 value: string;
4}
5interface IntervalSchedule {
6 type: 'interval';
7 value: number;
8 unit: 'year' | 'month' | 'week' | 'day' | 'hour' | 'minute';
9}
10declare type MonitorSchedule = CrontabSchedule | IntervalSchedule;
11export interface SerializedCheckIn {
12 check_in_id: string;
13 monitor_slug: string;
14 status: 'in_progress' | 'ok' | 'error';
15 duration?: number;
16 release?: string;
17 environment?: string;
18 monitor_config?: {
19 schedule: MonitorSchedule;
20 checkin_margin?: number;
21 max_runtime?: number;
22 timezone?: string;
23 };
24}
25interface InProgressCheckIn {
26 monitorSlug: SerializedCheckIn['monitor_slug'];
27 status: 'in_progress';
28}
29export interface FinishedCheckIn {
30 monitorSlug: SerializedCheckIn['monitor_slug'];
31 status: 'ok' | 'error';
32 checkInId: SerializedCheckIn['check_in_id'];
33 duration?: SerializedCheckIn['duration'];
34}
35export declare type CheckIn = InProgressCheckIn | FinishedCheckIn;
36declare type SerializedMonitorConfig = NonNullable<SerializedCheckIn['monitor_config']>;
37export interface MonitorConfig {
38 schedule: MonitorSchedule;
39 checkinMargin?: SerializedMonitorConfig['checkin_margin'];
40 maxRuntime?: SerializedMonitorConfig['max_runtime'];
41 timezone?: SerializedMonitorConfig['timezone'];
42}
43export {};
44//# sourceMappingURL=checkin.d.ts.map
\No newline at end of file