checkly 5.6.0 → 6.0.0-prerelease-541d8e1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/commands/baseCommand.d.ts +1 -1
- package/dist/commands/baseCommand.js +3 -3
- package/dist/commands/baseCommand.js.map +1 -1
- package/dist/commands/deploy.js +37 -18
- package/dist/commands/deploy.js.map +1 -1
- package/dist/commands/import/plan.js +54 -27
- package/dist/commands/import/plan.js.map +1 -1
- package/dist/commands/test.js +84 -53
- package/dist/commands/test.js.map +1 -1
- package/dist/commands/trigger.d.ts +0 -1
- package/dist/commands/trigger.js +4 -6
- package/dist/commands/trigger.js.map +1 -1
- package/dist/constructs/api-check-bundle.d.ts +57 -0
- package/dist/constructs/api-check-bundle.js +34 -0
- package/dist/constructs/api-check-bundle.js.map +1 -0
- package/dist/constructs/api-check.d.ts +14 -20
- package/dist/constructs/api-check.js +86 -83
- package/dist/constructs/api-check.js.map +1 -1
- package/dist/constructs/browser-check-bundle.d.ts +58 -0
- package/dist/constructs/browser-check-bundle.js +31 -0
- package/dist/constructs/browser-check-bundle.js.map +1 -0
- package/dist/constructs/browser-check.d.ts +10 -22
- package/dist/constructs/browser-check.js +54 -67
- package/dist/constructs/browser-check.js.map +1 -1
- package/dist/constructs/check-group-codegen.d.ts +6 -5
- package/dist/constructs/check-group-codegen.js +14 -7
- package/dist/constructs/check-group-codegen.js.map +1 -1
- package/dist/constructs/check-group-ref.d.ts +14 -0
- package/dist/constructs/check-group-ref.js +37 -0
- package/dist/constructs/check-group-ref.js.map +1 -0
- package/dist/constructs/check-group-v1.d.ts +294 -0
- package/dist/constructs/check-group-v1.js +271 -0
- package/dist/constructs/check-group-v1.js.map +1 -0
- package/dist/constructs/check-group-v2.d.ts +120 -0
- package/dist/constructs/check-group-v2.js +87 -0
- package/dist/constructs/check-group-v2.js.map +1 -0
- package/dist/constructs/check-group.d.ts +4 -175
- package/dist/constructs/check-group.js +8 -246
- package/dist/constructs/check-group.js.map +1 -1
- package/dist/constructs/check.d.ts +2 -2
- package/dist/constructs/construct-diagnostics.d.ts +33 -0
- package/dist/constructs/construct-diagnostics.js +101 -0
- package/dist/constructs/construct-diagnostics.js.map +1 -0
- package/dist/constructs/construct.d.ts +35 -1
- package/dist/constructs/construct.js +48 -1
- package/dist/constructs/construct.js.map +1 -1
- package/dist/constructs/dashboard-bundle.d.ts +11 -0
- package/dist/constructs/dashboard-bundle.js +19 -0
- package/dist/constructs/dashboard-bundle.js.map +1 -0
- package/dist/constructs/dashboard.d.ts +26 -22
- package/dist/constructs/dashboard.js +39 -46
- package/dist/constructs/dashboard.js.map +1 -1
- package/dist/constructs/diagnostics.d.ts +36 -0
- package/dist/constructs/diagnostics.js +69 -0
- package/dist/constructs/diagnostics.js.map +1 -0
- package/dist/constructs/index.d.ts +1 -0
- package/dist/constructs/index.js +1 -0
- package/dist/constructs/index.js.map +1 -1
- package/dist/constructs/multi-step-check-bundle.d.ts +46 -0
- package/dist/constructs/multi-step-check-bundle.js +25 -0
- package/dist/constructs/multi-step-check-bundle.js.map +1 -0
- package/dist/constructs/multi-step-check.d.ts +9 -11
- package/dist/constructs/multi-step-check.js +50 -65
- package/dist/constructs/multi-step-check.js.map +1 -1
- package/dist/constructs/playwright-check-bundle.d.ts +49 -0
- package/dist/constructs/playwright-check-bundle.js +28 -0
- package/dist/constructs/playwright-check-bundle.js.map +1 -0
- package/dist/constructs/playwright-check.d.ts +9 -15
- package/dist/constructs/playwright-check.js +37 -33
- package/dist/constructs/playwright-check.js.map +1 -1
- package/dist/constructs/private-location.d.ts +2 -0
- package/dist/constructs/private-location.js +7 -5
- package/dist/constructs/private-location.js.map +1 -1
- package/dist/constructs/project-bundle.d.ts +30 -0
- package/dist/constructs/project-bundle.js +44 -0
- package/dist/constructs/project-bundle.js.map +1 -0
- package/dist/constructs/project.d.ts +41 -18
- package/dist/constructs/project.js +72 -31
- package/dist/constructs/project.js.map +1 -1
- package/dist/reporters/util.d.ts +0 -1
- package/dist/reporters/util.js +1 -5
- package/dist/reporters/util.js.map +1 -1
- package/dist/rest/projects.d.ts +2 -0
- package/dist/rest/projects.js.map +1 -1
- package/dist/rest/test-sessions.d.ts +2 -1
- package/dist/rest/test-sessions.js.map +1 -1
- package/dist/services/check-parser/package-files/json-source-file.js +2 -1
- package/dist/services/check-parser/package-files/json-source-file.js.map +1 -1
- package/dist/services/check-parser/package-files/loader.d.ts +2 -2
- package/dist/services/check-parser/package-files/loader.js +2 -2
- package/dist/services/check-parser/package-files/loader.js.map +1 -1
- package/dist/services/check-parser/package-files/resolver.d.ts +8 -8
- package/dist/services/check-parser/package-files/resolver.js +34 -32
- package/dist/services/check-parser/package-files/resolver.js.map +1 -1
- package/dist/services/check-parser/package-files/source-file.d.ts +1 -1
- package/dist/services/check-parser/package-files/source-file.js +5 -4
- package/dist/services/check-parser/package-files/source-file.js.map +1 -1
- package/dist/services/check-parser/parser.d.ts +3 -3
- package/dist/services/check-parser/parser.js +22 -23
- package/dist/services/check-parser/parser.js.map +1 -1
- package/dist/services/checkly-config-codegen.js +0 -3
- package/dist/services/checkly-config-codegen.js.map +1 -1
- package/dist/services/checkly-config-loader.d.ts +0 -1
- package/dist/services/checkly-config-loader.js.map +1 -1
- package/dist/services/project-parser.d.ts +4 -2
- package/dist/services/project-parser.js +109 -67
- package/dist/services/project-parser.js.map +1 -1
- package/dist/services/test-runner.d.ts +6 -4
- package/dist/services/test-runner.js +33 -22
- package/dist/services/test-runner.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/oclif.manifest.json +3 -3
- package/package.json +1 -1
|
@@ -0,0 +1,271 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.CheckGroupV1 = void 0;
|
|
7
|
+
const node_path_1 = __importDefault(require("node:path"));
|
|
8
|
+
const glob_1 = require("glob");
|
|
9
|
+
const construct_diagnostics_1 = require("./construct-diagnostics");
|
|
10
|
+
const constants_1 = __importDefault(require("../constants"));
|
|
11
|
+
const util_1 = require("../services/util");
|
|
12
|
+
const alert_channel_subscription_1 = require("./alert-channel-subscription");
|
|
13
|
+
const browser_check_1 = require("./browser-check");
|
|
14
|
+
const check_group_ref_1 = require("./check-group-ref");
|
|
15
|
+
const construct_1 = require("./construct");
|
|
16
|
+
const multi_step_check_1 = require("./multi-step-check");
|
|
17
|
+
const private_location_group_assignment_1 = require("./private-location-group-assignment");
|
|
18
|
+
const ref_1 = require("./ref");
|
|
19
|
+
const project_1 = require("./project");
|
|
20
|
+
const defaultApiCheckDefaults = {
|
|
21
|
+
headers: [],
|
|
22
|
+
queryParameters: [],
|
|
23
|
+
url: '',
|
|
24
|
+
basicAuth: {
|
|
25
|
+
username: '',
|
|
26
|
+
password: '',
|
|
27
|
+
},
|
|
28
|
+
};
|
|
29
|
+
/**
|
|
30
|
+
* Creates a Check Group (v1).
|
|
31
|
+
*
|
|
32
|
+
* We strongly recommend upgrading to {@link CheckGroupV2} instead.
|
|
33
|
+
*
|
|
34
|
+
* The original CheckGroup v1 comes with implicit defaults that are not
|
|
35
|
+
* intuitive and make it impossible to keep check-level behavior for
|
|
36
|
+
* certain properties.
|
|
37
|
+
*
|
|
38
|
+
* The following properties will always use the group's values if set, or
|
|
39
|
+
* implicit defaults if not set:
|
|
40
|
+
*
|
|
41
|
+
* - {@link CheckGroupV1Props.alertEscalationPolicy}
|
|
42
|
+
* - {@link CheckGroupV1Props.retryStrategy}
|
|
43
|
+
* - {@link CheckGroupV1Props.runParallel}
|
|
44
|
+
*
|
|
45
|
+
* Please check the documentation for the individual properties to see their
|
|
46
|
+
* behavior.
|
|
47
|
+
*
|
|
48
|
+
* For more information regarding the update, please see:
|
|
49
|
+
* https://feedback.checklyhq.com/changelog/checkly-groups-update-organize-checks-your-way
|
|
50
|
+
*
|
|
51
|
+
* @deprecated Use {@link CheckGroupV2} instead.
|
|
52
|
+
*/
|
|
53
|
+
class CheckGroupV1 extends construct_1.Construct {
|
|
54
|
+
name;
|
|
55
|
+
activated;
|
|
56
|
+
muted;
|
|
57
|
+
doubleCheck;
|
|
58
|
+
runtimeId;
|
|
59
|
+
locations;
|
|
60
|
+
privateLocations;
|
|
61
|
+
tags;
|
|
62
|
+
concurrency;
|
|
63
|
+
frequency;
|
|
64
|
+
environmentVariables;
|
|
65
|
+
alertChannels;
|
|
66
|
+
localSetupScript;
|
|
67
|
+
localTearDownScript;
|
|
68
|
+
apiCheckDefaults;
|
|
69
|
+
browserChecks;
|
|
70
|
+
multiStepChecks;
|
|
71
|
+
retryStrategy;
|
|
72
|
+
runParallel;
|
|
73
|
+
alertSettings;
|
|
74
|
+
useGlobalAlertSettings;
|
|
75
|
+
static __checklyType = 'check-group';
|
|
76
|
+
/**
|
|
77
|
+
* Constructs the CheckGroup instance
|
|
78
|
+
*
|
|
79
|
+
* @param logicalId unique project-scoped resource name identification
|
|
80
|
+
* @param props CheckGroup configuration properties
|
|
81
|
+
*
|
|
82
|
+
* {@link https://checklyhq.com/docs/cli/constructs-reference/#checkgroup Read more in the docs}
|
|
83
|
+
*/
|
|
84
|
+
constructor(logicalId, props) {
|
|
85
|
+
super(CheckGroupV1.__checklyType, logicalId);
|
|
86
|
+
this.name = props.name;
|
|
87
|
+
this.activated = props.activated;
|
|
88
|
+
this.muted = props.muted;
|
|
89
|
+
this.doubleCheck = props.doubleCheck;
|
|
90
|
+
this.tags = props.tags;
|
|
91
|
+
this.runtimeId = props.runtimeId;
|
|
92
|
+
this.locations = props.locations ?? [];
|
|
93
|
+
this.privateLocations = props.privateLocations;
|
|
94
|
+
this.concurrency = props.concurrency;
|
|
95
|
+
// `frequency` is not a CheckGroup resource property. Not present in synthesize()
|
|
96
|
+
this.frequency = props.frequency;
|
|
97
|
+
this.apiCheckDefaults = { ...defaultApiCheckDefaults, ...props.apiCheckDefaults };
|
|
98
|
+
this.alertSettings = props.alertEscalationPolicy;
|
|
99
|
+
this.useGlobalAlertSettings = !this.alertSettings;
|
|
100
|
+
this.environmentVariables = props.environmentVariables ?? [];
|
|
101
|
+
this.alertChannels = props.alertChannels ?? [];
|
|
102
|
+
this.localSetupScript = props.localSetupScript;
|
|
103
|
+
this.localTearDownScript = props.localTearDownScript;
|
|
104
|
+
this.retryStrategy = props.retryStrategy;
|
|
105
|
+
this.runParallel = props.runParallel;
|
|
106
|
+
// `browserChecks` is not a CheckGroup resource property. Not present in synthesize()
|
|
107
|
+
this.browserChecks = props.browserChecks;
|
|
108
|
+
const fileAbsolutePath = project_1.Session.checkFileAbsolutePath;
|
|
109
|
+
if (props.browserChecks?.testMatch) {
|
|
110
|
+
this.__addChecks(fileAbsolutePath, props.browserChecks.testMatch, constants_1.default.BROWSER);
|
|
111
|
+
}
|
|
112
|
+
this.multiStepChecks = props.multiStepChecks;
|
|
113
|
+
if (props.multiStepChecks?.testMatch) {
|
|
114
|
+
this.__addChecks(fileAbsolutePath, props.multiStepChecks.testMatch, constants_1.default.MULTI_STEP);
|
|
115
|
+
}
|
|
116
|
+
project_1.Session.registerConstruct(this);
|
|
117
|
+
this.__addSubscriptions();
|
|
118
|
+
this.__addPrivateLocationGroupAssignments();
|
|
119
|
+
}
|
|
120
|
+
async onBeforeValidate(diagnostics) {
|
|
121
|
+
diagnostics.add(new construct_diagnostics_1.DeprecatedConstructDiagnostic('CheckGroup', new Error(`Please update to CheckGroupV2 which has more intuitive behavior.` +
|
|
122
|
+
`\n\n` +
|
|
123
|
+
`For more information, please see:\n` +
|
|
124
|
+
` https://feedback.checklyhq.com/changelog/checkly-groups-update-organize-checks-your-way`)));
|
|
125
|
+
}
|
|
126
|
+
async validateDoubleCheck(diagnostics) {
|
|
127
|
+
if (this.doubleCheck !== undefined) {
|
|
128
|
+
if (this.retryStrategy) {
|
|
129
|
+
diagnostics.add(new construct_diagnostics_1.InvalidPropertyValueDiagnostic('doubleCheck', new Error('Cannot specify both "doubleCheck" and "retryStrategy".')));
|
|
130
|
+
}
|
|
131
|
+
if (this.doubleCheck) {
|
|
132
|
+
diagnostics.add(new construct_diagnostics_1.DeprecatedPropertyDiagnostic('doubleCheck', new Error(`To match the behavior of doubleCheck: true, please use the ` +
|
|
133
|
+
`following retryStrategy instead:` +
|
|
134
|
+
`\n\n` +
|
|
135
|
+
` RetryStrategyBuilder.fixedStrategy({\n` +
|
|
136
|
+
` maxRetries: 1,\n` +
|
|
137
|
+
` baseBackoffSeconds: 0,\n` +
|
|
138
|
+
` maxDurationSeconds: 600,\n` +
|
|
139
|
+
` sameRegion: false,\n` +
|
|
140
|
+
` })`)));
|
|
141
|
+
}
|
|
142
|
+
else {
|
|
143
|
+
diagnostics.add(new construct_diagnostics_1.DeprecatedPropertyDiagnostic('doubleCheck', new Error(`To match the behavior of doubleCheck: false, please use the ` +
|
|
144
|
+
`following retryStrategy instead:` +
|
|
145
|
+
`\n\n` +
|
|
146
|
+
` RetryStrategyBuilder.noRetries()`)));
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
async validate(diagnostics) {
|
|
151
|
+
await this.onBeforeValidate(diagnostics);
|
|
152
|
+
await this.validateDoubleCheck(diagnostics);
|
|
153
|
+
if (this.environmentVariables) {
|
|
154
|
+
this.environmentVariables.forEach(ev => {
|
|
155
|
+
// only empty string is checked because the KeyValuePair.value doesn't allow undefined or null.
|
|
156
|
+
if (ev.value === '') {
|
|
157
|
+
diagnostics.add(new construct_diagnostics_1.InvalidPropertyValueDiagnostic('environmentVariables', new Error(`Value must not be empty.`)));
|
|
158
|
+
}
|
|
159
|
+
});
|
|
160
|
+
}
|
|
161
|
+
if (this.localSetupScript) {
|
|
162
|
+
diagnostics.add(new construct_diagnostics_1.DeprecatedPropertyDiagnostic('localSetupScript', new Error(`Use the setupScript property directly in your ApiChecks instead.`)));
|
|
163
|
+
}
|
|
164
|
+
if (this.localTearDownScript) {
|
|
165
|
+
diagnostics.add(new construct_diagnostics_1.DeprecatedPropertyDiagnostic('localTearDownScript', new Error(`Use the tearDownScript property directly in your ApiChecks instead.`)));
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
static fromId(id) {
|
|
169
|
+
return new check_group_ref_1.CheckGroupRef(`check-group-${id}`, id);
|
|
170
|
+
}
|
|
171
|
+
__addChecks(fileAbsolutePath, testMatch, checkType) {
|
|
172
|
+
const parent = node_path_1.default.dirname(fileAbsolutePath);
|
|
173
|
+
const matched = glob_1.glob.sync(testMatch, { nodir: true, cwd: parent });
|
|
174
|
+
for (const match of matched) {
|
|
175
|
+
const filepath = node_path_1.default.join(parent, match);
|
|
176
|
+
const props = {
|
|
177
|
+
group: this,
|
|
178
|
+
name: match,
|
|
179
|
+
code: {
|
|
180
|
+
entrypoint: filepath,
|
|
181
|
+
},
|
|
182
|
+
// the browserChecks props inherited from the group are applied in BrowserCheck.constructor()
|
|
183
|
+
};
|
|
184
|
+
const checkLogicalId = (0, util_1.pathToPosix)(node_path_1.default.relative(project_1.Session.basePath, filepath));
|
|
185
|
+
if (checkType === constants_1.default.BROWSER) {
|
|
186
|
+
new browser_check_1.BrowserCheck(checkLogicalId, props);
|
|
187
|
+
}
|
|
188
|
+
else {
|
|
189
|
+
new multi_step_check_1.MultiStepCheck(checkLogicalId, props);
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
__addSubscriptions() {
|
|
194
|
+
if (!this.alertChannels) {
|
|
195
|
+
return;
|
|
196
|
+
}
|
|
197
|
+
for (const alertChannel of this.alertChannels) {
|
|
198
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
199
|
+
const subscription = new alert_channel_subscription_1.AlertChannelSubscription(`check-group-alert-channel-subscription#${this.logicalId}#${alertChannel.logicalId}`, {
|
|
200
|
+
alertChannelId: ref_1.Ref.from(alertChannel.logicalId),
|
|
201
|
+
groupId: ref_1.Ref.from(this.logicalId),
|
|
202
|
+
activated: true,
|
|
203
|
+
});
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
__addPrivateLocationGroupAssignments() {
|
|
207
|
+
if (!this.privateLocations) {
|
|
208
|
+
return;
|
|
209
|
+
}
|
|
210
|
+
for (const privateLocation of this.privateLocations) {
|
|
211
|
+
// slugName strings are processed in loadAllPrivateLocations()
|
|
212
|
+
if (typeof privateLocation === 'string') {
|
|
213
|
+
continue;
|
|
214
|
+
}
|
|
215
|
+
// use private location assignment for instances
|
|
216
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
217
|
+
const assignment = new private_location_group_assignment_1.PrivateLocationGroupAssignment(`private-location-group-assignment#${this.logicalId}#${privateLocation.logicalId}`, {
|
|
218
|
+
privateLocationId: ref_1.Ref.from(privateLocation.logicalId),
|
|
219
|
+
groupId: ref_1.Ref.from(this.logicalId),
|
|
220
|
+
});
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
getCheckDefaults() {
|
|
224
|
+
// TODO: investigate if make sense to add all other check's properties
|
|
225
|
+
return {
|
|
226
|
+
frequency: this.frequency,
|
|
227
|
+
};
|
|
228
|
+
}
|
|
229
|
+
getBrowserCheckDefaults() {
|
|
230
|
+
// TODO: investigate if make sense to add all other browser-check's properties
|
|
231
|
+
return {
|
|
232
|
+
frequency: this.browserChecks?.frequency,
|
|
233
|
+
};
|
|
234
|
+
}
|
|
235
|
+
getMultiStepCheckDefaults() {
|
|
236
|
+
return {
|
|
237
|
+
frequency: this.multiStepChecks?.frequency,
|
|
238
|
+
};
|
|
239
|
+
}
|
|
240
|
+
synthesize() {
|
|
241
|
+
return {
|
|
242
|
+
name: this.name,
|
|
243
|
+
activated: this.activated,
|
|
244
|
+
muted: this.muted,
|
|
245
|
+
tags: this.tags,
|
|
246
|
+
locations: this.locations,
|
|
247
|
+
runtimeId: this.runtimeId,
|
|
248
|
+
// private-location instances are assigned with loadAllPrivateLocations()
|
|
249
|
+
privateLocations: undefined,
|
|
250
|
+
concurrency: this.concurrency,
|
|
251
|
+
localSetupScript: this.localSetupScript,
|
|
252
|
+
localTearDownScript: this.localTearDownScript,
|
|
253
|
+
apiCheckDefaults: this.apiCheckDefaults,
|
|
254
|
+
environmentVariables: this.environmentVariables,
|
|
255
|
+
// The backend doesn't actually support the `NO_RETRIES` type, it uses `null` instead.
|
|
256
|
+
retryStrategy: this.retryStrategy?.type === 'NO_RETRIES'
|
|
257
|
+
? null
|
|
258
|
+
: this.retryStrategy,
|
|
259
|
+
// When `retryStrategy: NO_RETRIES` and `doubleCheck: undefined`, we want to let the user disable all retries.
|
|
260
|
+
// The backend has a Joi default of `doubleCheck: true`, though, so we need special handling for this case.
|
|
261
|
+
doubleCheck: this.doubleCheck === undefined && this.retryStrategy?.type === 'NO_RETRIES'
|
|
262
|
+
? false
|
|
263
|
+
: this.doubleCheck,
|
|
264
|
+
runParallel: this.runParallel,
|
|
265
|
+
alertSettings: this.alertSettings,
|
|
266
|
+
useGlobalAlertSettings: this.useGlobalAlertSettings,
|
|
267
|
+
};
|
|
268
|
+
}
|
|
269
|
+
}
|
|
270
|
+
exports.CheckGroupV1 = CheckGroupV1;
|
|
271
|
+
//# sourceMappingURL=check-group-v1.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"check-group-v1.js","sourceRoot":"","sources":["../../src/constructs/check-group-v1.ts"],"names":[],"mappings":";;;;;;AAAA,0DAA4B;AAE5B,+BAA2B;AAe3B,mEAAqI;AACrI,6DAAqC;AAErC,2CAA8C;AAC9C,6EAAuE;AACvE,mDAA8C;AAC9C,uDAAiD;AACjD,2CAAuC;AACvC,yDAAmD;AACnD,2FAAoF;AACpF,+BAA2B;AAC3B,uCAAmC;AAEnC,MAAM,uBAAuB,GAA0B;IACrD,OAAO,EAAE,EAAE;IACX,eAAe,EAAE,EAAE;IACnB,GAAG,EAAE,EAAE;IACP,SAAS,EAAE;QACT,QAAQ,EAAE,EAAE;QACZ,QAAQ,EAAE,EAAE;KACb;CACF,C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;gBACP,CAAC,CAAC,IAAI,CAAC,WAAW;YACpB,WAAW,EAAE,IAAI,CAAC,WAAW;YAC7B,aAAa,EAAE,IAAI,CAAC,aAAa;YACjC,sBAAsB,EAAE,IAAI,CAAC,sBAAsB;SACpD,CAAA;IACH,CAAC;;AA7QH,oCA8QC"}
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
import { PrivateLocation, PrivateLocationRef } from './private-location';
|
|
2
|
+
import type { Region } from '..';
|
|
3
|
+
import { type RetryStrategy } from './retry-strategy';
|
|
4
|
+
import { AlertEscalation } from './alert-escalation-policy';
|
|
5
|
+
import { Diagnostics } from './diagnostics';
|
|
6
|
+
import { CheckGroupV1, CheckGroupV1Props } from './check-group-v1';
|
|
7
|
+
export interface CheckGroupV2Props extends Omit<CheckGroupV1Props, 'alertEscalationPolicy'> {
|
|
8
|
+
/**
|
|
9
|
+
* This property is no longer supported; use {@link retryStrategy} instead.
|
|
10
|
+
*
|
|
11
|
+
* To match the behavior of `doubleCheck: true`, use:
|
|
12
|
+
*
|
|
13
|
+
* retryStrategy: RetryStrategyBuilder.fixedStrategy({
|
|
14
|
+
* maxRetries: 1,
|
|
15
|
+
* baseBackoffSeconds: 0,
|
|
16
|
+
* maxDurationSeconds: 600,
|
|
17
|
+
* sameRegion: false,
|
|
18
|
+
* })
|
|
19
|
+
*
|
|
20
|
+
* To match the behavior of `doubleCheck: false`, use:
|
|
21
|
+
*
|
|
22
|
+
* retryStrategy: RetryStrategyBuilder.noRetries()
|
|
23
|
+
*
|
|
24
|
+
* @deprecated Use {@link CheckGroupV2Props.retryStrategy} instead.
|
|
25
|
+
*/
|
|
26
|
+
doubleCheck?: boolean;
|
|
27
|
+
/**
|
|
28
|
+
* An array of one or more data center locations where to run the checks.
|
|
29
|
+
*
|
|
30
|
+
* If either {@link CheckGroupV2Props.locations} or
|
|
31
|
+
* {@link CheckGroupV2Props.privateLocations} is set to a non-empty value, all
|
|
32
|
+
* checks in the group will use those values instead of their own.
|
|
33
|
+
*/
|
|
34
|
+
locations?: (keyof Region)[];
|
|
35
|
+
/**
|
|
36
|
+
* An array of one or more private locations where to run the checks.
|
|
37
|
+
*
|
|
38
|
+
* If either {@link CheckGroupV2Props.locations} or
|
|
39
|
+
* {@link CheckGroupV2Props.privateLocations} is set to a non-empty value, all
|
|
40
|
+
* checks in the group will use those values instead of their own.
|
|
41
|
+
*/
|
|
42
|
+
privateLocations?: (string | PrivateLocation | PrivateLocationRef)[];
|
|
43
|
+
/**
|
|
44
|
+
* When {@link AlertEscalation}, all checks in the group will use the
|
|
45
|
+
* group's alert escalation policy. Use {@link AlertEscalationBuilder} to
|
|
46
|
+
* build a suitable policy.
|
|
47
|
+
*
|
|
48
|
+
* When `"global"`, all checks in the group will use the global alert
|
|
49
|
+
* escalation policy.
|
|
50
|
+
*
|
|
51
|
+
* If not set, individual check settings are used.
|
|
52
|
+
*/
|
|
53
|
+
alertEscalationPolicy?: AlertEscalation | 'global';
|
|
54
|
+
/**
|
|
55
|
+
* Sets a retry policy for the group. Use {@link RetryStrategyBuilder} to
|
|
56
|
+
* create a retry policy.
|
|
57
|
+
*
|
|
58
|
+
* If set, all checks in the group use the group's retry strategy.
|
|
59
|
+
*
|
|
60
|
+
* If not set, individual check settings are used.
|
|
61
|
+
*/
|
|
62
|
+
retryStrategy?: RetryStrategy;
|
|
63
|
+
/**
|
|
64
|
+
* Determines whether the checks in the group should run on all selected
|
|
65
|
+
* locations in parallel or round-robin.
|
|
66
|
+
*
|
|
67
|
+
* When `true`, all checks in the group run in parallel regardless of their
|
|
68
|
+
* individual setting.
|
|
69
|
+
*
|
|
70
|
+
* When `false`, all checks in the group run in round-robin regardless of
|
|
71
|
+
* their individual setting.
|
|
72
|
+
*
|
|
73
|
+
* If not set, individual check settings are used.
|
|
74
|
+
*
|
|
75
|
+
* See https://www.checklyhq.com/docs/monitoring/global-locations/ to learn
|
|
76
|
+
* more about scheduling strategies.
|
|
77
|
+
*/
|
|
78
|
+
runParallel?: boolean;
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* Creates a Check Group (v2).
|
|
82
|
+
*
|
|
83
|
+
* The following properties have changed since CheckGroupV1:
|
|
84
|
+
*
|
|
85
|
+
* - {@link CheckGroupV2Props.alertEscalationPolicy}
|
|
86
|
+
* - The implicit default for this property has been removed, allowing
|
|
87
|
+
* individual check settings to take effect.
|
|
88
|
+
* - Can be set to `"global"` to match the earlier default behavior.
|
|
89
|
+
* - {@link CheckGroupV2Props.retryStrategy}
|
|
90
|
+
* - The implicit default for this property has been removed, allowing
|
|
91
|
+
* individual check settings to take effect.
|
|
92
|
+
* - {@link CheckGroupV2Props.runParallel}
|
|
93
|
+
* - The implicit default for this property has been removed, allowing
|
|
94
|
+
* individual check settings to take effect.
|
|
95
|
+
*/
|
|
96
|
+
export declare class CheckGroupV2 extends CheckGroupV1 {
|
|
97
|
+
constructor(logicalId: string, props: CheckGroupV2Props);
|
|
98
|
+
onBeforeValidate(diagnostics: Diagnostics): Promise<void>;
|
|
99
|
+
protected validateDoubleCheck(diagnostics: Diagnostics): Promise<void>;
|
|
100
|
+
synthesize(): {
|
|
101
|
+
doubleCheck: undefined;
|
|
102
|
+
v: number;
|
|
103
|
+
name: string;
|
|
104
|
+
activated: boolean | undefined;
|
|
105
|
+
muted: boolean | undefined;
|
|
106
|
+
tags: string[] | undefined;
|
|
107
|
+
locations: (keyof Region)[];
|
|
108
|
+
runtimeId: string | undefined;
|
|
109
|
+
privateLocations: undefined;
|
|
110
|
+
concurrency: number | undefined;
|
|
111
|
+
localSetupScript: string | undefined;
|
|
112
|
+
localTearDownScript: string | undefined;
|
|
113
|
+
apiCheckDefaults: import("./api-check").ApiCheckDefaultConfig;
|
|
114
|
+
environmentVariables: import("./key-value-pair").default[] | undefined;
|
|
115
|
+
retryStrategy: RetryStrategy | null | undefined;
|
|
116
|
+
runParallel: boolean | undefined;
|
|
117
|
+
alertSettings: AlertEscalation | undefined;
|
|
118
|
+
useGlobalAlertSettings: boolean | undefined;
|
|
119
|
+
};
|
|
120
|
+
}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CheckGroupV2 = void 0;
|
|
4
|
+
const check_group_v1_1 = require("./check-group-v1");
|
|
5
|
+
const construct_diagnostics_1 = require("./construct-diagnostics");
|
|
6
|
+
/**
|
|
7
|
+
* Creates a Check Group (v2).
|
|
8
|
+
*
|
|
9
|
+
* The following properties have changed since CheckGroupV1:
|
|
10
|
+
*
|
|
11
|
+
* - {@link CheckGroupV2Props.alertEscalationPolicy}
|
|
12
|
+
* - The implicit default for this property has been removed, allowing
|
|
13
|
+
* individual check settings to take effect.
|
|
14
|
+
* - Can be set to `"global"` to match the earlier default behavior.
|
|
15
|
+
* - {@link CheckGroupV2Props.retryStrategy}
|
|
16
|
+
* - The implicit default for this property has been removed, allowing
|
|
17
|
+
* individual check settings to take effect.
|
|
18
|
+
* - {@link CheckGroupV2Props.runParallel}
|
|
19
|
+
* - The implicit default for this property has been removed, allowing
|
|
20
|
+
* individual check settings to take effect.
|
|
21
|
+
*/
|
|
22
|
+
class CheckGroupV2 extends check_group_v1_1.CheckGroupV1 {
|
|
23
|
+
constructor(logicalId, props) {
|
|
24
|
+
const { alertEscalationPolicy, useGlobalAlertSettings } = (() => {
|
|
25
|
+
const { alertEscalationPolicy } = props;
|
|
26
|
+
// Do we want to always use the global policy?
|
|
27
|
+
if (alertEscalationPolicy === 'global') {
|
|
28
|
+
return {
|
|
29
|
+
alertEscalationPolicy: undefined,
|
|
30
|
+
useGlobalAlertSettings: true,
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
// Do we want to let checks keep their own policies?
|
|
34
|
+
if (alertEscalationPolicy === undefined) {
|
|
35
|
+
return {
|
|
36
|
+
alertEscalationPolicy,
|
|
37
|
+
useGlobalAlertSettings: undefined,
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
// The group policy will always apply.
|
|
41
|
+
return {
|
|
42
|
+
alertEscalationPolicy,
|
|
43
|
+
useGlobalAlertSettings: false,
|
|
44
|
+
};
|
|
45
|
+
})();
|
|
46
|
+
super(logicalId, {
|
|
47
|
+
...props,
|
|
48
|
+
alertEscalationPolicy,
|
|
49
|
+
});
|
|
50
|
+
// Must override; the V1 constructor will not give us the desired behavior.
|
|
51
|
+
this.useGlobalAlertSettings = useGlobalAlertSettings;
|
|
52
|
+
}
|
|
53
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
54
|
+
async onBeforeValidate(diagnostics) {
|
|
55
|
+
// No-op
|
|
56
|
+
}
|
|
57
|
+
async validateDoubleCheck(diagnostics) {
|
|
58
|
+
if (this.doubleCheck !== undefined) {
|
|
59
|
+
if (this.doubleCheck) {
|
|
60
|
+
diagnostics.add(new construct_diagnostics_1.RemovedPropertyDiagnostic('doubleCheck', new Error(`To match the behavior of doubleCheck: true, please use the ` +
|
|
61
|
+
`following retryStrategy instead:` +
|
|
62
|
+
`\n\n` +
|
|
63
|
+
` RetryStrategyBuilder.fixedStrategy({\n` +
|
|
64
|
+
` maxRetries: 1,\n` +
|
|
65
|
+
` baseBackoffSeconds: 0,\n` +
|
|
66
|
+
` maxDurationSeconds: 600,\n` +
|
|
67
|
+
` sameRegion: false,\n` +
|
|
68
|
+
` })`)));
|
|
69
|
+
}
|
|
70
|
+
else {
|
|
71
|
+
diagnostics.add(new construct_diagnostics_1.RemovedPropertyDiagnostic('doubleCheck', new Error(`To match the behavior of doubleCheck: false, please use the ` +
|
|
72
|
+
`following retryStrategy instead:` +
|
|
73
|
+
`\n\n` +
|
|
74
|
+
` RetryStrategyBuilder.noRetries()`)));
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
synthesize() {
|
|
79
|
+
return {
|
|
80
|
+
...super.synthesize(),
|
|
81
|
+
doubleCheck: undefined,
|
|
82
|
+
v: 2,
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
exports.CheckGroupV2 = CheckGroupV2;
|
|
87
|
+
//# sourceMappingURL=check-group-v2.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"check-group-v2.js","sourceRoot":"","sources":["../../src/constructs/check-group-v2.ts"],"names":[],"mappings":";;;AAaA,qDAAkE;AAClE,mEAAmE;AAiFnE;;;;;;;;;;;;;;;GAeG;AACH,MAAa,YAAa,SAAQ,6BAAY;IAC5C,YAAa,SAAiB,EAAE,KAAwB;QACtD,MAAM,EAAE,qBAAqB,EAAE,sBAAsB,EAAE,GAAG,CAAC,GAAG,EAAE;YAC9D,MAAM,EAAE,qBAAqB,EAAE,GAAG,KAAK,CAAA;YAEvC,8CAA8C;YAC9C,IAAI,qBAAqB,KAAK,QAAQ,EAAE,CAAC;gBACvC,OAAO;oBACL,qBAAqB,EAAE,SAAS;oBAChC,sBAAsB,EAAE,IAAI;iBAC7B,CAAA;YACH,CAAC;YAED,oDAAoD;YACpD,IAAI,qBAAqB,KAAK,SAAS,EAAE,CAAC;gBACxC,OAAO;oBACL,qBAAqB;oBACrB,sBAAsB,EAAE,SAAS;iBAClC,CAAA;YACH,CAAC;YAED,sCAAsC;YACtC,OAAO;gBACL,qBAAqB;gBACrB,sBAAsB,EAAE,KAAK;aAC9B,CAAA;QACH,CAAC,CAAC,EAAE,CAAA;QAEJ,KAAK,CAAC,SAAS,EAAE;YACf,GAAG,KAAK;YACR,qBAAqB;SACtB,CAAC,CAAA;QAEF,2EAA2E;QAC3E,IAAI,CAAC,sBAAsB,GAAG,sBAAsB,CAAA;IACtD,CAAC;IAED,6DAA6D;IAC7D,KAAK,CAAC,gBAAgB,CAAE,WAAwB;QAC9C,QAAQ;IACV,CAAC;IAES,KAAK,CAAC,mBAAmB,CAAE,WAAwB;QAC3D,IAAI,IAAI,CAAC,WAAW,KAAK,SAAS,EAAE,CAAC;YACnC,IAAI,IAAI,CAAC,WAAW,EAAE,CAAC;gBACrB,WAAW,CAAC,GAAG,CAAC,IAAI,iDAAyB,CAC3C,aAAa,EACb,IAAI,KAAK,CACP,6DAA6D;oBAC7D,kCAAkC;oBAClC,MAAM;oBACN,0CAA0C;oBAC1C,sBAAsB;oBACtB,8BAA8B;oBAC9B,gCAAgC;oBAChC,0BAA0B;oBAC1B,MAAM,CACP,CACF,CAAC,CAAA;YACJ,CAAC;iBAAM,CAAC;gBACN,WAAW,CAAC,GAAG,CAAC,IAAI,iDAAyB,CAC3C,aAAa,EACb,IAAI,KAAK,CACP,8DAA8D;oBAC9D,kCAAkC;oBAClC,MAAM;oBACN,oCAAoC,CACrC,CACF,CAAC,CAAA;YACJ,CAAC;QACH,CAAC;IACH,CAAC;IAED,UAAU;QACR,OAAO;YACL,GAAG,KAAK,CAAC,UAAU,EAAE;YACrB,WAAW,EAAE,SAAS;YACtB,CAAC,EAAE,CAAC;SACL,CAAA;IACH,CAAC;CACF;AAhFD,oCAgFC"}
|
|
@@ -1,175 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
import { CheckConfigDefaults } from '../services/checkly-config-loader';
|
|
6
|
-
import { ApiCheckDefaultConfig } from './api-check';
|
|
7
|
-
import type { Region } from '..';
|
|
8
|
-
import { type Frequency } from './frequency';
|
|
9
|
-
import { type RetryStrategy } from './retry-strategy';
|
|
10
|
-
import { AlertEscalation } from './alert-escalation-policy';
|
|
11
|
-
type BrowserCheckConfig = CheckConfigDefaults & {
|
|
12
|
-
/**
|
|
13
|
-
* Glob pattern to include multiple files, i.e. all `.spec.ts` files
|
|
14
|
-
*/
|
|
15
|
-
testMatch: string | string[];
|
|
16
|
-
};
|
|
17
|
-
type MultiStepCheckConfig = CheckConfigDefaults & {
|
|
18
|
-
/**
|
|
19
|
-
* Glob pattern to include multiple files, i.e. all `.spec.ts` files
|
|
20
|
-
*/
|
|
21
|
-
testMatch: string | string[];
|
|
22
|
-
};
|
|
23
|
-
export interface CheckGroupProps {
|
|
24
|
-
/**
|
|
25
|
-
* The name of the check group.
|
|
26
|
-
*/
|
|
27
|
-
name: string;
|
|
28
|
-
/**
|
|
29
|
-
* Determines if the checks in the group are running or not.
|
|
30
|
-
*/
|
|
31
|
-
activated?: boolean;
|
|
32
|
-
/**
|
|
33
|
-
* Determines if any notifications will be sent out when a check in this group fails and/or recovers.
|
|
34
|
-
*/
|
|
35
|
-
muted?: boolean;
|
|
36
|
-
/**
|
|
37
|
-
* Setting this to "true" will trigger a retry when a check fails from the failing region and another,
|
|
38
|
-
* randomly selected region before marking the check as failed.
|
|
39
|
-
* @deprecated Use {@link CheckGroupProps.retryStrategy} instead.
|
|
40
|
-
*/
|
|
41
|
-
doubleCheck?: boolean;
|
|
42
|
-
/**
|
|
43
|
-
* The runtime version, i.e. fixed set of runtime dependencies, used to execute checks in this group.
|
|
44
|
-
*/
|
|
45
|
-
runtimeId?: string;
|
|
46
|
-
/**
|
|
47
|
-
* An array of one or more data center locations where to run the checks.
|
|
48
|
-
*/
|
|
49
|
-
locations?: Array<keyof Region>;
|
|
50
|
-
/**
|
|
51
|
-
* An array of one or more private locations where to run the checks.
|
|
52
|
-
*/
|
|
53
|
-
privateLocations?: Array<string | PrivateLocation | PrivateLocationRef>;
|
|
54
|
-
/**
|
|
55
|
-
* Tags for organizing and filtering checks.
|
|
56
|
-
*/
|
|
57
|
-
tags?: Array<string>;
|
|
58
|
-
/**
|
|
59
|
-
* Determines how many checks are invoked concurrently when triggering a check group from CI/CD or through the API.
|
|
60
|
-
*/
|
|
61
|
-
concurrency?: number;
|
|
62
|
-
/**
|
|
63
|
-
* Optional fallback value for checks belonging to the group. How often the check should run in minutes.
|
|
64
|
-
*/
|
|
65
|
-
frequency?: number | Frequency;
|
|
66
|
-
environmentVariables?: Array<EnvironmentVariable>;
|
|
67
|
-
/**
|
|
68
|
-
* List of alert channels to be alerted when checks in this group fail or recover.
|
|
69
|
-
*/
|
|
70
|
-
alertChannels?: Array<AlertChannel | AlertChannelRef>;
|
|
71
|
-
browserChecks?: BrowserCheckConfig;
|
|
72
|
-
multiStepChecks?: MultiStepCheckConfig;
|
|
73
|
-
alertEscalationPolicy?: AlertEscalation;
|
|
74
|
-
/**
|
|
75
|
-
* A valid piece of Node.js code to run in the setup phase of an API check in this group.
|
|
76
|
-
* @deprecated use the "ApiCheck.setupScript" property instead and use common JS/TS code
|
|
77
|
-
* composition to add group specific setup routines.
|
|
78
|
-
*/
|
|
79
|
-
localSetupScript?: string;
|
|
80
|
-
/**
|
|
81
|
-
* A valid piece of Node.js code to run in the teardown phase of an API check in this group.
|
|
82
|
-
* @deprecated use the "ApiCheck.tearDownScript" property instead and use common JS/TS code
|
|
83
|
-
* composition to add group specific teardown routines.
|
|
84
|
-
*/
|
|
85
|
-
localTearDownScript?: string;
|
|
86
|
-
apiCheckDefaults?: ApiCheckDefaultConfig;
|
|
87
|
-
/**
|
|
88
|
-
* Sets a retry policy for the group. Use RetryStrategyBuilder to create a retry policy.
|
|
89
|
-
*/
|
|
90
|
-
retryStrategy?: RetryStrategy;
|
|
91
|
-
/**
|
|
92
|
-
* Determines whether the checks in the group should run on all selected locations in parallel or round-robin.
|
|
93
|
-
* See https://www.checklyhq.com/docs/monitoring/global-locations/ to learn more about scheduling strategies.
|
|
94
|
-
*/
|
|
95
|
-
runParallel?: boolean;
|
|
96
|
-
}
|
|
97
|
-
/**
|
|
98
|
-
* Creates a reference to an existing Check Group.
|
|
99
|
-
*
|
|
100
|
-
* References link existing resources to a project without managing them.
|
|
101
|
-
*/
|
|
102
|
-
export declare class CheckGroupRef extends Construct {
|
|
103
|
-
constructor(logicalId: string, physicalId: string | number);
|
|
104
|
-
getCheckDefaults(): CheckConfigDefaults;
|
|
105
|
-
getBrowserCheckDefaults(): CheckConfigDefaults;
|
|
106
|
-
getMultiStepCheckDefaults(): CheckConfigDefaults;
|
|
107
|
-
synthesize(): null;
|
|
108
|
-
}
|
|
109
|
-
/**
|
|
110
|
-
* Creates a Check Group
|
|
111
|
-
*
|
|
112
|
-
* @remarks
|
|
113
|
-
*
|
|
114
|
-
* This class make use of the Check Groups endpoints.
|
|
115
|
-
*/
|
|
116
|
-
export declare class CheckGroup extends Construct {
|
|
117
|
-
name: string;
|
|
118
|
-
activated?: boolean;
|
|
119
|
-
muted?: boolean;
|
|
120
|
-
doubleCheck?: boolean;
|
|
121
|
-
runtimeId?: string;
|
|
122
|
-
locations: Array<keyof Region>;
|
|
123
|
-
privateLocations?: Array<string | PrivateLocation | PrivateLocationRef>;
|
|
124
|
-
tags?: Array<string>;
|
|
125
|
-
concurrency?: number;
|
|
126
|
-
frequency?: number | Frequency;
|
|
127
|
-
environmentVariables?: Array<EnvironmentVariable>;
|
|
128
|
-
alertChannels?: Array<AlertChannel | AlertChannelRef>;
|
|
129
|
-
localSetupScript?: string;
|
|
130
|
-
localTearDownScript?: string;
|
|
131
|
-
apiCheckDefaults: ApiCheckDefaultConfig;
|
|
132
|
-
browserChecks?: BrowserCheckConfig;
|
|
133
|
-
multiStepChecks?: MultiStepCheckConfig;
|
|
134
|
-
retryStrategy?: RetryStrategy;
|
|
135
|
-
runParallel?: boolean;
|
|
136
|
-
alertSettings?: AlertEscalation;
|
|
137
|
-
useGlobalAlertSettings?: boolean;
|
|
138
|
-
static readonly __checklyType = "check-group";
|
|
139
|
-
/**
|
|
140
|
-
* Constructs the CheckGroup instance
|
|
141
|
-
*
|
|
142
|
-
* @param logicalId unique project-scoped resource name identification
|
|
143
|
-
* @param props CheckGroup configuration properties
|
|
144
|
-
*
|
|
145
|
-
* {@link https://checklyhq.com/docs/cli/constructs-reference/#checkgroup Read more in the docs}
|
|
146
|
-
*/
|
|
147
|
-
constructor(logicalId: string, props: CheckGroupProps);
|
|
148
|
-
static fromId(id: number): CheckGroupRef;
|
|
149
|
-
private __addChecks;
|
|
150
|
-
private __addSubscriptions;
|
|
151
|
-
private __addPrivateLocationGroupAssignments;
|
|
152
|
-
getCheckDefaults(): CheckConfigDefaults;
|
|
153
|
-
getBrowserCheckDefaults(): CheckConfigDefaults;
|
|
154
|
-
getMultiStepCheckDefaults(): CheckConfigDefaults;
|
|
155
|
-
synthesize(): {
|
|
156
|
-
name: string;
|
|
157
|
-
activated: boolean | undefined;
|
|
158
|
-
muted: boolean | undefined;
|
|
159
|
-
tags: string[] | undefined;
|
|
160
|
-
locations: (keyof Region)[];
|
|
161
|
-
runtimeId: string | undefined;
|
|
162
|
-
privateLocations: undefined;
|
|
163
|
-
concurrency: number | undefined;
|
|
164
|
-
localSetupScript: string | undefined;
|
|
165
|
-
localTearDownScript: string | undefined;
|
|
166
|
-
apiCheckDefaults: ApiCheckDefaultConfig;
|
|
167
|
-
environmentVariables: import("./key-value-pair").default[] | undefined;
|
|
168
|
-
retryStrategy: RetryStrategy | null | undefined;
|
|
169
|
-
doubleCheck: boolean | undefined;
|
|
170
|
-
runParallel: boolean | undefined;
|
|
171
|
-
alertSettings: AlertEscalation | undefined;
|
|
172
|
-
useGlobalAlertSettings: boolean | undefined;
|
|
173
|
-
};
|
|
174
|
-
}
|
|
175
|
-
export {};
|
|
1
|
+
export * from './check-group-v1';
|
|
2
|
+
export * from './check-group-v2';
|
|
3
|
+
export * from './check-group-ref';
|
|
4
|
+
export { CheckGroupV1 as CheckGroup, CheckGroupV1Props as CheckGroupProps, } from './check-group-v1';
|