import { AlertChannel, AlertChannelRef } from './alert-channel'; import { EnvironmentVariable } from './environment-variable'; import { PrivateLocation, PrivateLocationRef } from './private-location'; import { ApiCheckDefaultConfig } from './api-check'; import type { Region } from '..'; import { type Frequency } from './frequency'; import { AlertEscalation } from './alert-escalation-policy'; import { Diagnostics } from './diagnostics'; import { CheckConfigDefaults } from '../services/checkly-config-loader'; import { CheckGroupRef } from './check-group-ref'; import { Construct } from './construct'; import { CheckRetryStrategy } from './check'; import { MonitorRetryStrategy } from './monitor'; type BrowserCheckConfig = CheckConfigDefaults & { /** * Glob pattern to include multiple files, i.e. all `.spec.ts` files */ testMatch: string | string[]; }; type MultiStepCheckConfig = CheckConfigDefaults & { /** * Glob pattern to include multiple files, i.e. all `.spec.ts` files */ testMatch: string | string[]; }; /** * Retry strategies supported by groups. */ export type GroupRetryStrategy = CheckRetryStrategy | MonitorRetryStrategy; export interface CheckGroupV1Props { /** * The name of the check group. */ name: string; /** * Determines whether the checks in the group are running or not. * * When `true` (default), all checks in the group that are activated will run. * * When `false`, no checks in the group will run, regardless of whether they * are activated or not. * * If not set, the default is `true`. */ activated?: boolean; /** * Determines if any notifications will be sent out when a check in this * group fails and/or recovers. * * When `false` (default), all checks in the group that are not muted will trigger * alerts. * * When `true`, all checks in the group act as if they are muted, regardless * of their own state, and will not trigger alerts. * * If not set, the default is `false`. */ muted?: boolean; /** * Setting this to "true" will trigger a retry when a check fails from * the failing region and another, randomly selected region before marking * the check as failed. * * If set, overrides the doubleCheck property of all checks in the group. * * If not set, the default is `true`. * * @deprecated Use {@link CheckGroupV1Props.retryStrategy} instead. */ doubleCheck?: boolean; /** * The runtime version, i.e. fixed set of runtime dependencies, used to * execute checks in this group. * * This value is only used as a fallback for checks that do not explicitly * choose a runtime. * * If not set, the ultimate fallback is the account default runtime. */ runtimeId?: string; /** * An array of one or more data center locations where to run the checks. * * If either {@link CheckGroupV1Props.locations} or * {@link CheckGroupV1Props.privateLocations} is set to a non-empty value, all * checks in the group will use those values instead of their own. */ locations?: (keyof Region)[]; /** * An array of one or more private locations where to run the checks. * * If either {@link CheckGroupV1Props.locations} or * {@link CheckGroupV1Props.privateLocations} is set to a non-empty value, all * checks in the group will use those values instead of their own. */ privateLocations?: (string | PrivateLocation | PrivateLocationRef)[]; /** * Tags for organizing and filtering checks. * * Checks in the group will behave as if they had the these tags set, though * they may not be visible. */ tags?: string[]; /** * Determines how many checks are invoked concurrently when triggering a * check group from CI/CD or through the API. */ concurrency?: number; /** * Optional fallback value for all checks belonging to the group. How often * the check should run in minutes. * * Note that this settings is stored at the check level and is not persisted * in the group. */ frequency?: number | Frequency; /** * When set, any environment variables defined here will be available to * all checks in the group. * * If a global environment variable with the same name exists, the group * environment variable will override it. * * If a check environment variable with the same name exists, it will * override the group environment variable. * * See https://www.checklyhq.com/docs/groups/variables/#variable-hierarchy * for more information. */ environmentVariables?: EnvironmentVariable[]; /** * List of alert channels to be alerted when checks in this group fail or * recover. */ alertChannels?: (AlertChannel | AlertChannelRef)[]; /** * This optional setting can be used to provide CLI-level defaults for * all browser checks in the group. * * Note that any settings defined here are stored at the check level and are * not persisted in the group. * * Currently only the following settings have an effect: * - {@link BrowserCheckConfig.frequency} */ browserChecks?: BrowserCheckConfig; /** * This optional setting can be used to provide CLI-level defaults for * all multi-step checks in the group. * * Note that any settings defined here are stored at the check level and are * not persisted in the group. * * Currently only the following settings have an effect: * - {@link MultiStepCheckConfig.frequency} */ multiStepChecks?: MultiStepCheckConfig; /** * If set, all checks in the group will use the group's alert escalation * policy. * * If not set, all checks in the group will use the global alert escalation * policy. */ alertEscalationPolicy?: AlertEscalation; /** * A valid piece of Node.js code to run in the setup phase of an API check * in this group. * * @deprecated Use the "ApiCheck.setupScript" property instead and use * common JS/TS code composition to add group specific setup routines. */ localSetupScript?: string; /** * A valid piece of Node.js code to run in the teardown phase of an API * check in this group. * * @deprecated use the "ApiCheck.tearDownScript" property instead and use * common JS/TS code composition to add group specific teardown routines. */ localTearDownScript?: string; /** * If set, the values provided here are merged with the values defined * in individual API checks. */ apiCheckDefaults?: ApiCheckDefaultConfig; /** * Sets a retry policy for the group. Use {@link RetryStrategyBuilder} to * create a retry policy. * * If set, all checks in the group use the group's retry strategy. * * If not set, retries are disabled for all checks in the group. */ retryStrategy?: GroupRetryStrategy; /** * Determines whether the checks in the group should run on all selected * locations in parallel or round-robin. * * When `true`, all checks in the group run in parallel regardless of their * individual setting. * * When `false`, all checks in the group run in round-robin regardless of * their individual setting. * * If not set, the default is `false`. * * See https://www.checklyhq.com/docs/monitoring/global-locations/ to learn * more about scheduling strategies. */ runParallel?: boolean; } /** * Creates a Check Group (v1). * * We strongly recommend upgrading to {@link CheckGroupV2} instead. * * The original CheckGroup v1 comes with implicit defaults that are not * intuitive and make it impossible to keep check-level behavior for * certain properties. * * The following properties will always use the group's values if set, or * implicit defaults if not set: * * - {@link CheckGroupV1Props.alertEscalationPolicy} * - {@link CheckGroupV1Props.retryStrategy} * - {@link CheckGroupV1Props.runParallel} * * Please check the documentation for the individual properties to see their * behavior. * * For more information regarding the update, please see: * https://feedback.checklyhq.com/changelog/checkly-groups-update-organize-checks-your-way * * @deprecated Use {@link CheckGroupV2} instead. */ export declare class CheckGroupV1 extends Construct { name: string; activated?: boolean; muted?: boolean; doubleCheck?: boolean; runtimeId?: string; locations: Array; privateLocations?: Array; tags?: Array; concurrency?: number; frequency?: number | Frequency; environmentVariables?: Array; alertChannels?: Array; localSetupScript?: string; localTearDownScript?: string; apiCheckDefaults: ApiCheckDefaultConfig; browserChecks?: BrowserCheckConfig; multiStepChecks?: MultiStepCheckConfig; retryStrategy?: GroupRetryStrategy; runParallel?: boolean; alertSettings?: AlertEscalation; useGlobalAlertSettings?: boolean; static readonly __checklyType = "check-group"; /** * Constructs the CheckGroup instance * * @param logicalId unique project-scoped resource name identification * @param props CheckGroup configuration properties * * {@link https://checklyhq.com/docs/cli/constructs-reference/#checkgroup Read more in the docs} */ constructor(logicalId: string, props: CheckGroupV1Props); describe(): string; protected onBeforeValidate(diagnostics: Diagnostics): Promise; protected validateDoubleCheck(diagnostics: Diagnostics): Promise; validate(diagnostics: Diagnostics): Promise; /** * @param id - The numeric ID of the existing check group */ static fromId(id: number): CheckGroupRef; private __addChecks; private __addSubscriptions; private __addPrivateLocationGroupAssignments; getCheckDefaults(): CheckConfigDefaults; getBrowserCheckDefaults(): CheckConfigDefaults; getMultiStepCheckDefaults(): CheckConfigDefaults; allowInChecklyConfig(): boolean; synthesize(): { name: string; activated: boolean | undefined; muted: boolean | undefined; tags: string[] | undefined; locations: (keyof Region)[]; runtimeId: string | undefined; privateLocations: undefined; concurrency: number | undefined; localSetupScript: string | undefined; localTearDownScript: string | undefined; apiCheckDefaults: ApiCheckDefaultConfig; environmentVariables: import("./key-value-pair").default[] | undefined; retryStrategy: import("./retry-strategy").LinearRetryStrategy | import("./retry-strategy").ExponentialRetryStrategy | import("./retry-strategy").FixedRetryStrategy | import("./retry-strategy").SingleRetryRetryStrategy | null | undefined; doubleCheck: boolean | undefined; runParallel: boolean | undefined; alertSettings: AlertEscalation | undefined; useGlobalAlertSettings: boolean | undefined; }; } export {};