checkly 0.0.0-pr.1006.2fb1ffc
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/README.md +102 -0
- package/bin/run +5 -0
- package/bin/run.cmd +3 -0
- package/constructs.d.ts +1 -0
- package/constructs.js +2 -0
- package/dist/auth/index.d.ts +15 -0
- package/dist/auth/index.js +262 -0
- package/dist/auth/index.js.map +1 -0
- package/dist/commands/authCommand.d.ts +5 -0
- package/dist/commands/authCommand.js +37 -0
- package/dist/commands/authCommand.js.map +1 -0
- package/dist/commands/baseCommand.d.ts +13 -0
- package/dist/commands/baseCommand.js +48 -0
- package/dist/commands/baseCommand.js.map +1 -0
- package/dist/commands/deploy.d.ts +18 -0
- package/dist/commands/deploy.js +289 -0
- package/dist/commands/deploy.js.map +1 -0
- package/dist/commands/destroy.d.ts +10 -0
- package/dist/commands/destroy.js +84 -0
- package/dist/commands/destroy.js.map +1 -0
- package/dist/commands/env/add.d.ts +14 -0
- package/dist/commands/env/add.js +85 -0
- package/dist/commands/env/add.js.map +1 -0
- package/dist/commands/env/ls.d.ts +6 -0
- package/dist/commands/env/ls.js +44 -0
- package/dist/commands/env/ls.js.map +1 -0
- package/dist/commands/env/pull.d.ts +12 -0
- package/dist/commands/env/pull.js +99 -0
- package/dist/commands/env/pull.js.map +1 -0
- package/dist/commands/env/rm.d.ts +12 -0
- package/dist/commands/env/rm.js +82 -0
- package/dist/commands/env/rm.js.map +1 -0
- package/dist/commands/env/update.d.ts +14 -0
- package/dist/commands/env/update.js +88 -0
- package/dist/commands/env/update.js.map +1 -0
- package/dist/commands/help.d.ts +6 -0
- package/dist/commands/help.js +17 -0
- package/dist/commands/help.js.map +1 -0
- package/dist/commands/login.d.ts +13 -0
- package/dist/commands/login.js +134 -0
- package/dist/commands/login.js.map +1 -0
- package/dist/commands/logout.d.ts +9 -0
- package/dist/commands/logout.js +43 -0
- package/dist/commands/logout.js.map +1 -0
- package/dist/commands/runtimes.d.ts +6 -0
- package/dist/commands/runtimes.js +49 -0
- package/dist/commands/runtimes.js.map +1 -0
- package/dist/commands/switch.d.ts +9 -0
- package/dist/commands/switch.js +81 -0
- package/dist/commands/switch.js.map +1 -0
- package/dist/commands/sync-playwright.d.ts +10 -0
- package/dist/commands/sync-playwright.js +98 -0
- package/dist/commands/sync-playwright.js.map +1 -0
- package/dist/commands/test.d.ts +45 -0
- package/dist/commands/test.js +366 -0
- package/dist/commands/test.js.map +1 -0
- package/dist/commands/trigger.d.ts +37 -0
- package/dist/commands/trigger.js +242 -0
- package/dist/commands/trigger.js.map +1 -0
- package/dist/commands/whoami.d.ts +6 -0
- package/dist/commands/whoami.js +42 -0
- package/dist/commands/whoami.js.map +1 -0
- package/dist/config.d.ts +31 -0
- package/dist/config.js +8 -0
- package/dist/config.js.map +1 -0
- package/dist/constants.d.ts +7 -0
- package/dist/constants.js +10 -0
- package/dist/constants.js.map +1 -0
- package/dist/constructs/alert-channel-subscription.d.ts +44 -0
- package/dist/constructs/alert-channel-subscription.js +39 -0
- package/dist/constructs/alert-channel-subscription.js.map +1 -0
- package/dist/constructs/alert-channel.d.ts +53 -0
- package/dist/constructs/alert-channel.js +55 -0
- package/dist/constructs/alert-channel.js.map +1 -0
- package/dist/constructs/alert-escalation-policy.d.ts +34 -0
- package/dist/constructs/alert-escalation-policy.js +47 -0
- package/dist/constructs/alert-escalation-policy.js.map +1 -0
- package/dist/constructs/api-check.d.ts +187 -0
- package/dist/constructs/api-check.js +279 -0
- package/dist/constructs/api-check.js.map +1 -0
- package/dist/constructs/browser-check.d.ts +90 -0
- package/dist/constructs/browser-check.js +151 -0
- package/dist/constructs/browser-check.js.map +1 -0
- package/dist/constructs/check-group.d.ts +162 -0
- package/dist/constructs/check-group.js +208 -0
- package/dist/constructs/check-group.js.map +1 -0
- package/dist/constructs/check.d.ts +144 -0
- package/dist/constructs/check.js +133 -0
- package/dist/constructs/check.js.map +1 -0
- package/dist/constructs/construct.d.ts +17 -0
- package/dist/constructs/construct.js +22 -0
- package/dist/constructs/construct.js.map +1 -0
- package/dist/constructs/dashboard.d.ts +138 -0
- package/dist/constructs/dashboard.js +126 -0
- package/dist/constructs/dashboard.js.map +1 -0
- package/dist/constructs/email-alert-channel.d.ts +26 -0
- package/dist/constructs/email-alert-channel.js +37 -0
- package/dist/constructs/email-alert-channel.js.map +1 -0
- package/dist/constructs/environment-variable.d.ts +2 -0
- package/dist/constructs/environment-variable.js +3 -0
- package/dist/constructs/environment-variable.js.map +1 -0
- package/dist/constructs/frequency.d.ts +20 -0
- package/dist/constructs/frequency.js +26 -0
- package/dist/constructs/frequency.js.map +1 -0
- package/dist/constructs/heartbeat-check.d.ts +43 -0
- package/dist/constructs/heartbeat-check.js +61 -0
- package/dist/constructs/heartbeat-check.js.map +1 -0
- package/dist/constructs/http-header.d.ts +2 -0
- package/dist/constructs/http-header.js +3 -0
- package/dist/constructs/http-header.js.map +1 -0
- package/dist/constructs/index.d.ts +27 -0
- package/dist/constructs/index.js +44 -0
- package/dist/constructs/index.js.map +1 -0
- package/dist/constructs/key-value-pair.d.ts +6 -0
- package/dist/constructs/key-value-pair.js +3 -0
- package/dist/constructs/key-value-pair.js.map +1 -0
- package/dist/constructs/maintenance-window.d.ts +61 -0
- package/dist/constructs/maintenance-window.js +47 -0
- package/dist/constructs/maintenance-window.js.map +1 -0
- package/dist/constructs/multi-step-check.d.ts +65 -0
- package/dist/constructs/multi-step-check.js +153 -0
- package/dist/constructs/multi-step-check.js.map +1 -0
- package/dist/constructs/opsgenie-alert-channel.d.ts +45 -0
- package/dist/constructs/opsgenie-alert-channel.js +44 -0
- package/dist/constructs/opsgenie-alert-channel.js.map +1 -0
- package/dist/constructs/pagerduty-alert-channel.d.ts +39 -0
- package/dist/constructs/pagerduty-alert-channel.js +42 -0
- package/dist/constructs/pagerduty-alert-channel.js.map +1 -0
- package/dist/constructs/phone-call-alert-channel.d.ts +34 -0
- package/dist/constructs/phone-call-alert-channel.js +42 -0
- package/dist/constructs/phone-call-alert-channel.js.map +1 -0
- package/dist/constructs/playwright-config.d.ts +52 -0
- package/dist/constructs/playwright-config.js +3 -0
- package/dist/constructs/playwright-config.js.map +1 -0
- package/dist/constructs/private-location-check-assignment.d.ts +29 -0
- package/dist/constructs/private-location-check-assignment.js +35 -0
- package/dist/constructs/private-location-check-assignment.js.map +1 -0
- package/dist/constructs/private-location-group-assignment.d.ts +29 -0
- package/dist/constructs/private-location-group-assignment.js +35 -0
- package/dist/constructs/private-location-group-assignment.js.map +1 -0
- package/dist/constructs/private-location.d.ts +51 -0
- package/dist/constructs/private-location.js +61 -0
- package/dist/constructs/private-location.js.map +1 -0
- package/dist/constructs/project.d.ts +66 -0
- package/dist/constructs/project.js +155 -0
- package/dist/constructs/project.js.map +1 -0
- package/dist/constructs/query-param.d.ts +2 -0
- package/dist/constructs/query-param.js +3 -0
- package/dist/constructs/query-param.js.map +1 -0
- package/dist/constructs/ref.d.ts +5 -0
- package/dist/constructs/ref.js +13 -0
- package/dist/constructs/ref.js.map +1 -0
- package/dist/constructs/retry-strategy.d.ts +50 -0
- package/dist/constructs/retry-strategy.js +51 -0
- package/dist/constructs/retry-strategy.js.map +1 -0
- package/dist/constructs/slack-alert-channel.d.ts +26 -0
- package/dist/constructs/slack-alert-channel.js +40 -0
- package/dist/constructs/slack-alert-channel.js.map +1 -0
- package/dist/constructs/sms-alert-channel.d.ts +32 -0
- package/dist/constructs/sms-alert-channel.js +40 -0
- package/dist/constructs/sms-alert-channel.js.map +1 -0
- package/dist/constructs/validator-error.d.ts +2 -0
- package/dist/constructs/validator-error.js +7 -0
- package/dist/constructs/validator-error.js.map +1 -0
- package/dist/constructs/webhook-alert-channel.d.ts +67 -0
- package/dist/constructs/webhook-alert-channel.js +52 -0
- package/dist/constructs/webhook-alert-channel.js.map +1 -0
- package/dist/help/examples.d.ts +6 -0
- package/dist/help/examples.js +22 -0
- package/dist/help/examples.js.map +1 -0
- package/dist/help/help-extension.d.ts +7 -0
- package/dist/help/help-extension.js +59 -0
- package/dist/help/help-extension.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +30 -0
- package/dist/index.js.map +1 -0
- package/dist/messages/common-messages.d.ts +5 -0
- package/dist/messages/common-messages.js +9 -0
- package/dist/messages/common-messages.js.map +1 -0
- package/dist/playwright/playwright-config-loader.d.ts +1 -0
- package/dist/playwright/playwright-config-loader.js +26 -0
- package/dist/playwright/playwright-config-loader.js.map +1 -0
- package/dist/playwright/playwright-config-template.d.ts +8 -0
- package/dist/playwright/playwright-config-template.js +78 -0
- package/dist/playwright/playwright-config-template.js.map +1 -0
- package/dist/reporters/abstract-list.d.ts +41 -0
- package/dist/reporters/abstract-list.js +171 -0
- package/dist/reporters/abstract-list.js.map +1 -0
- package/dist/reporters/ci.d.ts +12 -0
- package/dist/reporters/ci.js +34 -0
- package/dist/reporters/ci.js.map +1 -0
- package/dist/reporters/dot.d.ts +10 -0
- package/dist/reporters/dot.js +29 -0
- package/dist/reporters/dot.js.map +1 -0
- package/dist/reporters/github.d.ts +32 -0
- package/dist/reporters/github.js +119 -0
- package/dist/reporters/github.js.map +1 -0
- package/dist/reporters/json.d.ts +26 -0
- package/dist/reporters/json.js +101 -0
- package/dist/reporters/json.js.map +1 -0
- package/dist/reporters/list.d.ts +15 -0
- package/dist/reporters/list.js +85 -0
- package/dist/reporters/list.js.map +1 -0
- package/dist/reporters/reporter.d.ts +16 -0
- package/dist/reporters/reporter.js +29 -0
- package/dist/reporters/reporter.js.map +1 -0
- package/dist/reporters/util.d.ts +18 -0
- package/dist/reporters/util.js +325 -0
- package/dist/reporters/util.js.map +1 -0
- package/dist/rest/accounts.d.ts +12 -0
- package/dist/rest/accounts.js +15 -0
- package/dist/rest/accounts.js.map +1 -0
- package/dist/rest/api.d.ts +33 -0
- package/dist/rest/api.js +98 -0
- package/dist/rest/api.js.map +1 -0
- package/dist/rest/assets.d.ts +13 -0
- package/dist/rest/assets.js +30 -0
- package/dist/rest/assets.js.map +1 -0
- package/dist/rest/checkly-storage.d.ts +12 -0
- package/dist/rest/checkly-storage.js +15 -0
- package/dist/rest/checkly-storage.js.map +1 -0
- package/dist/rest/environment-variables.d.ts +17 -0
- package/dist/rest/environment-variables.js +25 -0
- package/dist/rest/environment-variables.js.map +1 -0
- package/dist/rest/heartbeat-checks.d.ts +11 -0
- package/dist/rest/heartbeat-checks.js +17 -0
- package/dist/rest/heartbeat-checks.js.map +1 -0
- package/dist/rest/locations.d.ts +11 -0
- package/dist/rest/locations.js +12 -0
- package/dist/rest/locations.js.map +1 -0
- package/dist/rest/private-locations.d.ts +10 -0
- package/dist/rest/private-locations.js +12 -0
- package/dist/rest/private-locations.js.map +1 -0
- package/dist/rest/projects.d.ts +46 -0
- package/dist/rest/projects.js +25 -0
- package/dist/rest/projects.js.map +1 -0
- package/dist/rest/runtimes.d.ts +16 -0
- package/dist/rest/runtimes.js +15 -0
- package/dist/rest/runtimes.js.map +1 -0
- package/dist/rest/test-sessions.d.ts +59 -0
- package/dist/rest/test-sessions.js +24 -0
- package/dist/rest/test-sessions.js.map +1 -0
- package/dist/rest/users.d.ts +12 -0
- package/dist/rest/users.js +12 -0
- package/dist/rest/users.js.map +1 -0
- package/dist/rest/util.d.ts +4 -0
- package/dist/rest/util.js +17 -0
- package/dist/rest/util.js.map +1 -0
- package/dist/services/abstract-check-runner.d.ts +60 -0
- package/dist/services/abstract-check-runner.js +225 -0
- package/dist/services/abstract-check-runner.js.map +1 -0
- package/dist/services/check-parser/collector.d.ts +33 -0
- package/dist/services/check-parser/collector.js +48 -0
- package/dist/services/check-parser/collector.js.map +1 -0
- package/dist/services/check-parser/errors.d.ts +8 -0
- package/dist/services/check-parser/errors.js +45 -0
- package/dist/services/check-parser/errors.js.map +1 -0
- package/dist/services/check-parser/package-files/index.d.ts +1 -0
- package/dist/services/check-parser/package-files/index.js +6 -0
- package/dist/services/check-parser/package-files/index.js.map +1 -0
- package/dist/services/check-parser/package-files/jsconfig-json-file.d.ts +17 -0
- package/dist/services/check-parser/package-files/jsconfig-json-file.js +46 -0
- package/dist/services/check-parser/package-files/jsconfig-json-file.js.map +1 -0
- package/dist/services/check-parser/package-files/json-source-file.d.ts +10 -0
- package/dist/services/check-parser/package-files/json-source-file.js +38 -0
- package/dist/services/check-parser/package-files/json-source-file.js.map +1 -0
- package/dist/services/check-parser/package-files/loader.d.ts +7 -0
- package/dist/services/check-parser/package-files/loader.js +19 -0
- package/dist/services/check-parser/package-files/loader.js.map +1 -0
- package/dist/services/check-parser/package-files/package-json-file.d.ts +20 -0
- package/dist/services/check-parser/package-files/package-json-file.js +48 -0
- package/dist/services/check-parser/package-files/package-json-file.js.map +1 -0
- package/dist/services/check-parser/package-files/paths.d.ts +80 -0
- package/dist/services/check-parser/package-files/paths.js +177 -0
- package/dist/services/check-parser/package-files/paths.js.map +1 -0
- package/dist/services/check-parser/package-files/resolver.d.ts +70 -0
- package/dist/services/check-parser/package-files/resolver.js +290 -0
- package/dist/services/check-parser/package-files/resolver.js.map +1 -0
- package/dist/services/check-parser/package-files/source-file.d.ts +15 -0
- package/dist/services/check-parser/package-files/source-file.js +54 -0
- package/dist/services/check-parser/package-files/source-file.js.map +1 -0
- package/dist/services/check-parser/package-files/tsconfig-json-file.d.ts +68 -0
- package/dist/services/check-parser/package-files/tsconfig-json-file.js +127 -0
- package/dist/services/check-parser/package-files/tsconfig-json-file.js.map +1 -0
- package/dist/services/check-parser/parser.d.ts +32 -0
- package/dist/services/check-parser/parser.js +313 -0
- package/dist/services/check-parser/parser.js.map +1 -0
- package/dist/services/checkly-config-loader.d.ts +72 -0
- package/dist/services/checkly-config-loader.js +103 -0
- package/dist/services/checkly-config-loader.js.map +1 -0
- package/dist/services/config.d.ts +28 -0
- package/dist/services/config.js +99 -0
- package/dist/services/config.js.map +1 -0
- package/dist/services/project-parser.d.ts +21 -0
- package/dist/services/project-parser.js +192 -0
- package/dist/services/project-parser.js.map +1 -0
- package/dist/services/snapshot-service.d.ts +13 -0
- package/dist/services/snapshot-service.js +85 -0
- package/dist/services/snapshot-service.js.map +1 -0
- package/dist/services/socket-client.d.ts +4 -0
- package/dist/services/socket-client.js +88 -0
- package/dist/services/socket-client.js.map +1 -0
- package/dist/services/test-filters.d.ts +3 -0
- package/dist/services/test-filters.js +27 -0
- package/dist/services/test-filters.js.map +1 -0
- package/dist/services/test-runner.d.ts +24 -0
- package/dist/services/test-runner.js +91 -0
- package/dist/services/test-runner.js.map +1 -0
- package/dist/services/trigger-runner.d.ts +29 -0
- package/dist/services/trigger-runner.js +59 -0
- package/dist/services/trigger-runner.js.map +1 -0
- package/dist/services/util.d.ts +32 -0
- package/dist/services/util.js +244 -0
- package/dist/services/util.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/oclif.manifest.json +635 -0
- package/package.json +151 -0
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
declare enum AlertEscalationType {
|
|
2
|
+
RUN = "RUN_BASED",
|
|
3
|
+
TIME = "TIME_BASED"
|
|
4
|
+
}
|
|
5
|
+
export type Reminders = {
|
|
6
|
+
amount?: number;
|
|
7
|
+
interval?: number;
|
|
8
|
+
};
|
|
9
|
+
export type ParallelRunFailureThreshold = {
|
|
10
|
+
enabled?: boolean;
|
|
11
|
+
percentage?: number;
|
|
12
|
+
};
|
|
13
|
+
export interface AlertEscalation {
|
|
14
|
+
escalationType?: AlertEscalationType;
|
|
15
|
+
runBasedEscalation?: {
|
|
16
|
+
failedRunThreshold?: number;
|
|
17
|
+
};
|
|
18
|
+
timeBasedEscalation?: {
|
|
19
|
+
minutesFailingThreshold?: number;
|
|
20
|
+
};
|
|
21
|
+
reminders?: Reminders;
|
|
22
|
+
parallelRunFailureThreshold?: ParallelRunFailureThreshold;
|
|
23
|
+
}
|
|
24
|
+
export type AlertEscalationOptions = Pick<AlertEscalation, 'runBasedEscalation' | 'timeBasedEscalation' | 'reminders' | 'parallelRunFailureThreshold'>;
|
|
25
|
+
export declare class AlertEscalationBuilder {
|
|
26
|
+
private static DEFAULT_RUN_BASED_ESCALATION;
|
|
27
|
+
private static DEFAULT_TIME_BASED_ESCALATION;
|
|
28
|
+
private static DEFAULT_REMINDERS;
|
|
29
|
+
private static DEFAULT_PARALLEL_RUN_FAILURE_THRESHOLD;
|
|
30
|
+
static runBasedEscalation(failedRunThreshold: number, reminders?: Reminders, parallelRunFailureThreshold?: ParallelRunFailureThreshold): AlertEscalation;
|
|
31
|
+
static timeBasedEscalation(minutesFailingThreshold: number, reminders?: Reminders, parallelRunFailureThreshold?: ParallelRunFailureThreshold): AlertEscalation;
|
|
32
|
+
private static alertEscalation;
|
|
33
|
+
}
|
|
34
|
+
export {};
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AlertEscalationBuilder = void 0;
|
|
4
|
+
// eslint-disable-next-line no-restricted-syntax
|
|
5
|
+
var AlertEscalationType;
|
|
6
|
+
(function (AlertEscalationType) {
|
|
7
|
+
AlertEscalationType["RUN"] = "RUN_BASED";
|
|
8
|
+
AlertEscalationType["TIME"] = "TIME_BASED";
|
|
9
|
+
})(AlertEscalationType || (AlertEscalationType = {}));
|
|
10
|
+
class AlertEscalationBuilder {
|
|
11
|
+
static runBasedEscalation(failedRunThreshold, reminders, parallelRunFailureThreshold) {
|
|
12
|
+
const options = {
|
|
13
|
+
runBasedEscalation: {
|
|
14
|
+
failedRunThreshold,
|
|
15
|
+
},
|
|
16
|
+
reminders,
|
|
17
|
+
parallelRunFailureThreshold,
|
|
18
|
+
};
|
|
19
|
+
return this.alertEscalation(AlertEscalationType.RUN, options);
|
|
20
|
+
}
|
|
21
|
+
static timeBasedEscalation(minutesFailingThreshold, reminders, parallelRunFailureThreshold) {
|
|
22
|
+
const options = {
|
|
23
|
+
timeBasedEscalation: {
|
|
24
|
+
minutesFailingThreshold,
|
|
25
|
+
},
|
|
26
|
+
reminders,
|
|
27
|
+
parallelRunFailureThreshold,
|
|
28
|
+
};
|
|
29
|
+
return this.alertEscalation(AlertEscalationType.TIME, options);
|
|
30
|
+
}
|
|
31
|
+
static alertEscalation(escalationType, options) {
|
|
32
|
+
var _a, _b, _c, _d;
|
|
33
|
+
return {
|
|
34
|
+
escalationType,
|
|
35
|
+
runBasedEscalation: (_a = options.runBasedEscalation) !== null && _a !== void 0 ? _a : this.DEFAULT_RUN_BASED_ESCALATION,
|
|
36
|
+
timeBasedEscalation: (_b = options.timeBasedEscalation) !== null && _b !== void 0 ? _b : this.DEFAULT_TIME_BASED_ESCALATION,
|
|
37
|
+
reminders: (_c = options.reminders) !== null && _c !== void 0 ? _c : this.DEFAULT_REMINDERS,
|
|
38
|
+
parallelRunFailureThreshold: (_d = options.parallelRunFailureThreshold) !== null && _d !== void 0 ? _d : this.DEFAULT_PARALLEL_RUN_FAILURE_THRESHOLD,
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
exports.AlertEscalationBuilder = AlertEscalationBuilder;
|
|
43
|
+
AlertEscalationBuilder.DEFAULT_RUN_BASED_ESCALATION = { failedRunThreshold: 1 };
|
|
44
|
+
AlertEscalationBuilder.DEFAULT_TIME_BASED_ESCALATION = { minutesFailingThreshold: 5 };
|
|
45
|
+
AlertEscalationBuilder.DEFAULT_REMINDERS = { amount: 0, interval: 5 };
|
|
46
|
+
AlertEscalationBuilder.DEFAULT_PARALLEL_RUN_FAILURE_THRESHOLD = { enabled: false, percentage: 10 };
|
|
47
|
+
//# sourceMappingURL=alert-escalation-policy.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"alert-escalation-policy.js","sourceRoot":"","sources":["../../src/constructs/alert-escalation-policy.ts"],"names":[],"mappings":";;;AAAA,gDAAgD;AAChD,IAAK,mBAGJ;AAHD,WAAK,mBAAmB;IACtB,wCAAiB,CAAA;IACjB,0CAAmB,CAAA;AACrB,CAAC,EAHI,mBAAmB,KAAnB,mBAAmB,QAGvB;AA0BD,MAAa,sBAAsB;IAMjC,MAAM,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+1,187 @@
|
|
|
1
|
+
import { Check, CheckProps } from './check';
|
|
2
|
+
import { HttpHeader } from './http-header';
|
|
3
|
+
import { QueryParam } from './query-param';
|
|
4
|
+
import { Content, Entrypoint } from './construct';
|
|
5
|
+
declare enum AssertionSource {
|
|
6
|
+
STATUS_CODE = "STATUS_CODE",
|
|
7
|
+
JSON_BODY = "JSON_BODY",
|
|
8
|
+
HEADERS = "HEADERS",
|
|
9
|
+
TEXT_BODY = "TEXT_BODY",
|
|
10
|
+
RESPONSE_TIME = "RESPONSE_TIME"
|
|
11
|
+
}
|
|
12
|
+
export interface Assertion {
|
|
13
|
+
source: string;
|
|
14
|
+
property: string;
|
|
15
|
+
comparison: string;
|
|
16
|
+
target: string;
|
|
17
|
+
regex: string | null;
|
|
18
|
+
}
|
|
19
|
+
export declare class AssertionBuilder {
|
|
20
|
+
static statusCode(): NumericAssertionBuilder;
|
|
21
|
+
static jsonBody(property?: string): GeneralAssertionBuilder;
|
|
22
|
+
static headers(property?: string, regex?: string): GeneralAssertionBuilder;
|
|
23
|
+
static textBody(property?: string): GeneralAssertionBuilder;
|
|
24
|
+
/** @deprecated Use responseTime() instead */
|
|
25
|
+
static responseTme(): NumericAssertionBuilder;
|
|
26
|
+
static responseTime(): NumericAssertionBuilder;
|
|
27
|
+
}
|
|
28
|
+
declare class NumericAssertionBuilder {
|
|
29
|
+
source: AssertionSource;
|
|
30
|
+
constructor(source: AssertionSource);
|
|
31
|
+
equals(target: number): Assertion;
|
|
32
|
+
notEquals(target: number): Assertion;
|
|
33
|
+
lessThan(target: number): Assertion;
|
|
34
|
+
greaterThan(target: number): Assertion;
|
|
35
|
+
/** @private */
|
|
36
|
+
private _toAssertion;
|
|
37
|
+
}
|
|
38
|
+
declare class GeneralAssertionBuilder {
|
|
39
|
+
source: AssertionSource;
|
|
40
|
+
property?: string;
|
|
41
|
+
regex?: string;
|
|
42
|
+
constructor(source: AssertionSource, property?: string, regex?: string);
|
|
43
|
+
equals(target: string | number | boolean): Assertion;
|
|
44
|
+
notEquals(target: string | number | boolean): Assertion;
|
|
45
|
+
hasKey(target: string): Assertion;
|
|
46
|
+
notHasKey(target: string): Assertion;
|
|
47
|
+
hasValue(target: string | number | boolean): Assertion;
|
|
48
|
+
notHasValue(target: string | number | boolean): Assertion;
|
|
49
|
+
isEmpty(): Assertion;
|
|
50
|
+
notEmpty(): Assertion;
|
|
51
|
+
lessThan(target: string | number | boolean): Assertion;
|
|
52
|
+
greaterThan(target: string | number | boolean): Assertion;
|
|
53
|
+
contains(target: string): Assertion;
|
|
54
|
+
notContains(target: string): Assertion;
|
|
55
|
+
isNull(): Assertion;
|
|
56
|
+
isNotNull(): Assertion;
|
|
57
|
+
/** @private */
|
|
58
|
+
private _toAssertion;
|
|
59
|
+
}
|
|
60
|
+
export type BodyType = 'JSON' | 'FORM' | 'RAW' | 'GRAPHQL' | 'NONE';
|
|
61
|
+
export type HttpRequestMethod = 'get' | 'GET' | 'post' | 'POST' | 'put' | 'PUT' | 'patch' | 'PATCH' | 'head' | 'HEAD' | 'delete' | 'DELETE' | 'options' | 'OPTIONS';
|
|
62
|
+
export type IPFamily = 'IPv4' | 'IPv6';
|
|
63
|
+
export interface BasicAuth {
|
|
64
|
+
username: string;
|
|
65
|
+
password: string;
|
|
66
|
+
}
|
|
67
|
+
export type ApiCheckDefaultConfig = {
|
|
68
|
+
url?: string;
|
|
69
|
+
headers?: Array<HttpHeader>;
|
|
70
|
+
queryParameters?: Array<QueryParam>;
|
|
71
|
+
basicAuth?: BasicAuth;
|
|
72
|
+
};
|
|
73
|
+
export interface Request {
|
|
74
|
+
url: string;
|
|
75
|
+
method: HttpRequestMethod;
|
|
76
|
+
ipFamily?: IPFamily;
|
|
77
|
+
followRedirects?: boolean;
|
|
78
|
+
skipSSL?: boolean;
|
|
79
|
+
/**
|
|
80
|
+
* Check the main Checkly documentation on assertions for specific values like regular expressions
|
|
81
|
+
* and JSON path descriptors you can use in the "property" field.
|
|
82
|
+
*/
|
|
83
|
+
assertions?: Array<Assertion>;
|
|
84
|
+
body?: string;
|
|
85
|
+
bodyType?: BodyType;
|
|
86
|
+
headers?: Array<HttpHeader>;
|
|
87
|
+
queryParameters?: Array<QueryParam>;
|
|
88
|
+
basicAuth?: BasicAuth;
|
|
89
|
+
}
|
|
90
|
+
export interface ScriptDependency {
|
|
91
|
+
path: string;
|
|
92
|
+
content: string;
|
|
93
|
+
}
|
|
94
|
+
export interface ApiCheckProps extends CheckProps {
|
|
95
|
+
/**
|
|
96
|
+
* Determines the request that the check is going to run.
|
|
97
|
+
*/
|
|
98
|
+
request: Request;
|
|
99
|
+
/**
|
|
100
|
+
* A valid piece of Node.js code to run in the setup phase.
|
|
101
|
+
* @deprecated use the "setupScript" property instead
|
|
102
|
+
*/
|
|
103
|
+
localSetupScript?: string;
|
|
104
|
+
/**
|
|
105
|
+
* A valid piece of Node.js code to run in the setup phase.
|
|
106
|
+
*/
|
|
107
|
+
setupScript?: Content | Entrypoint;
|
|
108
|
+
/**
|
|
109
|
+
* A valid piece of Node.js code to run in the teardown phase.
|
|
110
|
+
* @deprecated use the "tearDownScript" property instead
|
|
111
|
+
*/
|
|
112
|
+
localTearDownScript?: string;
|
|
113
|
+
/**
|
|
114
|
+
* A valid piece of Node.js code to run in the teardown phase.
|
|
115
|
+
*/
|
|
116
|
+
tearDownScript?: Content | Entrypoint;
|
|
117
|
+
/**
|
|
118
|
+
* The response time in milliseconds where a check should be considered degraded.
|
|
119
|
+
*/
|
|
120
|
+
degradedResponseTime?: number;
|
|
121
|
+
/**
|
|
122
|
+
* The response time in milliseconds where a check should be considered failing.
|
|
123
|
+
*/
|
|
124
|
+
maxResponseTime?: number;
|
|
125
|
+
}
|
|
126
|
+
/**
|
|
127
|
+
* Creates an API Check
|
|
128
|
+
*
|
|
129
|
+
* @remarks
|
|
130
|
+
*
|
|
131
|
+
* This class make use of the API Checks endpoints.
|
|
132
|
+
*/
|
|
133
|
+
export declare class ApiCheck extends Check {
|
|
134
|
+
request: Request;
|
|
135
|
+
localSetupScript?: string;
|
|
136
|
+
localTearDownScript?: string;
|
|
137
|
+
degradedResponseTime?: number;
|
|
138
|
+
maxResponseTime?: number;
|
|
139
|
+
private readonly setupScriptDependencies?;
|
|
140
|
+
private readonly tearDownScriptDependencies?;
|
|
141
|
+
private readonly setupScriptPath?;
|
|
142
|
+
private readonly tearDownScriptPath?;
|
|
143
|
+
/**
|
|
144
|
+
* Constructs the API Check instance
|
|
145
|
+
*
|
|
146
|
+
* @param logicalId unique project-scoped resource name identification
|
|
147
|
+
* @param props check configuration properties
|
|
148
|
+
*
|
|
149
|
+
* {@link https://checklyhq.com/docs/cli/constructs-reference/#apicheck Read more in the docs}
|
|
150
|
+
*/
|
|
151
|
+
constructor(logicalId: string, props: ApiCheckProps);
|
|
152
|
+
static bundle(entrypoint: string, runtimeId: string): {
|
|
153
|
+
script: string;
|
|
154
|
+
scriptPath: string;
|
|
155
|
+
dependencies: ScriptDependency[];
|
|
156
|
+
};
|
|
157
|
+
synthesize(): {
|
|
158
|
+
checkType: string;
|
|
159
|
+
request: Request;
|
|
160
|
+
localSetupScript: string | undefined;
|
|
161
|
+
setupScriptPath: string | undefined;
|
|
162
|
+
setupScriptDependencies: ScriptDependency[] | undefined;
|
|
163
|
+
localTearDownScript: string | undefined;
|
|
164
|
+
tearDownScriptPath: string | undefined;
|
|
165
|
+
tearDownScriptDependencies: ScriptDependency[] | undefined;
|
|
166
|
+
degradedResponseTime: number | undefined;
|
|
167
|
+
maxResponseTime: number | undefined;
|
|
168
|
+
name: string;
|
|
169
|
+
activated: boolean | undefined;
|
|
170
|
+
muted: boolean | undefined;
|
|
171
|
+
shouldFail: boolean | undefined;
|
|
172
|
+
runtimeId: string | undefined;
|
|
173
|
+
locations: (keyof import("..").Region)[] | undefined;
|
|
174
|
+
privateLocations: undefined;
|
|
175
|
+
tags: string[] | undefined;
|
|
176
|
+
frequency: number | undefined;
|
|
177
|
+
frequencyOffset: number | undefined;
|
|
178
|
+
groupId: import("./ref").Ref | undefined;
|
|
179
|
+
environmentVariables: import("./key-value-pair").default[] | undefined;
|
|
180
|
+
retryStrategy: import("./retry-strategy").RetryStrategy | null | undefined;
|
|
181
|
+
doubleCheck: boolean | undefined;
|
|
182
|
+
alertSettings: import("./alert-escalation-policy").AlertEscalation | undefined;
|
|
183
|
+
useGlobalAlertSettings: boolean | undefined;
|
|
184
|
+
runParallel: boolean | undefined;
|
|
185
|
+
};
|
|
186
|
+
}
|
|
187
|
+
export {};
|
|
@@ -0,0 +1,279 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
exports.ApiCheck = exports.AssertionBuilder = void 0;
|
|
27
|
+
const path = __importStar(require("path"));
|
|
28
|
+
const check_1 = require("./check");
|
|
29
|
+
const project_1 = require("./project");
|
|
30
|
+
const parser_1 = require("../services/check-parser/parser");
|
|
31
|
+
const util_1 = require("../services/util");
|
|
32
|
+
const util_2 = require("../reporters/util");
|
|
33
|
+
// eslint-disable-next-line no-restricted-syntax
|
|
34
|
+
var AssertionSource;
|
|
35
|
+
(function (AssertionSource) {
|
|
36
|
+
AssertionSource["STATUS_CODE"] = "STATUS_CODE";
|
|
37
|
+
AssertionSource["JSON_BODY"] = "JSON_BODY";
|
|
38
|
+
AssertionSource["HEADERS"] = "HEADERS";
|
|
39
|
+
AssertionSource["TEXT_BODY"] = "TEXT_BODY";
|
|
40
|
+
AssertionSource["RESPONSE_TIME"] = "RESPONSE_TIME";
|
|
41
|
+
})(AssertionSource || (AssertionSource = {}));
|
|
42
|
+
// eslint-disable-next-line no-restricted-syntax
|
|
43
|
+
var AssertionComparison;
|
|
44
|
+
(function (AssertionComparison) {
|
|
45
|
+
AssertionComparison["EQUALS"] = "EQUALS";
|
|
46
|
+
AssertionComparison["NOT_EQUALS"] = "NOT_EQUALS";
|
|
47
|
+
AssertionComparison["HAS_KEY"] = "HAS_KEY";
|
|
48
|
+
AssertionComparison["NOT_HAS_KEY"] = "NOT_HAS_KEY";
|
|
49
|
+
AssertionComparison["HAS_VALUE"] = "HAS_VALUE";
|
|
50
|
+
AssertionComparison["NOT_HAS_VALUE"] = "NOT_HAS_VALUE";
|
|
51
|
+
AssertionComparison["IS_EMPTY"] = "IS_EMPTY";
|
|
52
|
+
AssertionComparison["NOT_EMPTY"] = "NOT_EMPTY";
|
|
53
|
+
AssertionComparison["GREATER_THAN"] = "GREATER_THAN";
|
|
54
|
+
AssertionComparison["LESS_THAN"] = "LESS_THAN";
|
|
55
|
+
AssertionComparison["CONTAINS"] = "CONTAINS";
|
|
56
|
+
AssertionComparison["NOT_CONTAINS"] = "NOT_CONTAINS";
|
|
57
|
+
AssertionComparison["IS_NULL"] = "IS_NULL";
|
|
58
|
+
AssertionComparison["NOT_NULL"] = "NOT_NULL";
|
|
59
|
+
})(AssertionComparison || (AssertionComparison = {}));
|
|
60
|
+
class AssertionBuilder {
|
|
61
|
+
static statusCode() {
|
|
62
|
+
return new NumericAssertionBuilder(AssertionSource.STATUS_CODE);
|
|
63
|
+
}
|
|
64
|
+
static jsonBody(property) {
|
|
65
|
+
return new GeneralAssertionBuilder(AssertionSource.JSON_BODY, property);
|
|
66
|
+
}
|
|
67
|
+
static headers(property, regex) {
|
|
68
|
+
return new GeneralAssertionBuilder(AssertionSource.HEADERS, property, regex);
|
|
69
|
+
}
|
|
70
|
+
static textBody(property) {
|
|
71
|
+
return new GeneralAssertionBuilder(AssertionSource.TEXT_BODY, property);
|
|
72
|
+
}
|
|
73
|
+
/** @deprecated Use responseTime() instead */
|
|
74
|
+
static responseTme() {
|
|
75
|
+
return new NumericAssertionBuilder(AssertionSource.RESPONSE_TIME);
|
|
76
|
+
}
|
|
77
|
+
static responseTime() {
|
|
78
|
+
return new NumericAssertionBuilder(AssertionSource.RESPONSE_TIME);
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
exports.AssertionBuilder = AssertionBuilder;
|
|
82
|
+
class NumericAssertionBuilder {
|
|
83
|
+
constructor(source) {
|
|
84
|
+
this.source = source;
|
|
85
|
+
}
|
|
86
|
+
equals(target) {
|
|
87
|
+
return this._toAssertion(AssertionComparison.EQUALS, target);
|
|
88
|
+
}
|
|
89
|
+
notEquals(target) {
|
|
90
|
+
return this._toAssertion(AssertionComparison.NOT_EQUALS, target);
|
|
91
|
+
}
|
|
92
|
+
lessThan(target) {
|
|
93
|
+
return this._toAssertion(AssertionComparison.LESS_THAN, target);
|
|
94
|
+
}
|
|
95
|
+
greaterThan(target) {
|
|
96
|
+
return this._toAssertion(AssertionComparison.GREATER_THAN, target);
|
|
97
|
+
}
|
|
98
|
+
/** @private */
|
|
99
|
+
_toAssertion(comparison, target) {
|
|
100
|
+
return { source: this.source, comparison, property: '', target: target.toString(), regex: null };
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
class GeneralAssertionBuilder {
|
|
104
|
+
constructor(source, property, regex) {
|
|
105
|
+
this.source = source;
|
|
106
|
+
this.property = property;
|
|
107
|
+
this.regex = regex;
|
|
108
|
+
}
|
|
109
|
+
equals(target) {
|
|
110
|
+
return this._toAssertion(AssertionComparison.EQUALS, target);
|
|
111
|
+
}
|
|
112
|
+
notEquals(target) {
|
|
113
|
+
return this._toAssertion(AssertionComparison.NOT_EQUALS, target);
|
|
114
|
+
}
|
|
115
|
+
hasKey(target) {
|
|
116
|
+
return this._toAssertion(AssertionComparison.HAS_KEY, target);
|
|
117
|
+
}
|
|
118
|
+
notHasKey(target) {
|
|
119
|
+
return this._toAssertion(AssertionComparison.NOT_HAS_KEY, target);
|
|
120
|
+
}
|
|
121
|
+
hasValue(target) {
|
|
122
|
+
return this._toAssertion(AssertionComparison.HAS_VALUE, target);
|
|
123
|
+
}
|
|
124
|
+
notHasValue(target) {
|
|
125
|
+
return this._toAssertion(AssertionComparison.NOT_HAS_VALUE, target);
|
|
126
|
+
}
|
|
127
|
+
isEmpty() {
|
|
128
|
+
return this._toAssertion(AssertionComparison.IS_EMPTY);
|
|
129
|
+
}
|
|
130
|
+
notEmpty() {
|
|
131
|
+
return this._toAssertion(AssertionComparison.NOT_EMPTY);
|
|
132
|
+
}
|
|
133
|
+
lessThan(target) {
|
|
134
|
+
return this._toAssertion(AssertionComparison.LESS_THAN, target);
|
|
135
|
+
}
|
|
136
|
+
greaterThan(target) {
|
|
137
|
+
return this._toAssertion(AssertionComparison.GREATER_THAN, target);
|
|
138
|
+
}
|
|
139
|
+
contains(target) {
|
|
140
|
+
return this._toAssertion(AssertionComparison.CONTAINS, target);
|
|
141
|
+
}
|
|
142
|
+
notContains(target) {
|
|
143
|
+
return this._toAssertion(AssertionComparison.NOT_CONTAINS, target);
|
|
144
|
+
}
|
|
145
|
+
isNull() {
|
|
146
|
+
return this._toAssertion(AssertionComparison.IS_NULL);
|
|
147
|
+
}
|
|
148
|
+
isNotNull() {
|
|
149
|
+
return this._toAssertion(AssertionComparison.NOT_NULL);
|
|
150
|
+
}
|
|
151
|
+
/** @private */
|
|
152
|
+
_toAssertion(comparison, target) {
|
|
153
|
+
var _a, _b, _c;
|
|
154
|
+
return {
|
|
155
|
+
source: this.source,
|
|
156
|
+
comparison,
|
|
157
|
+
property: (_a = this.property) !== null && _a !== void 0 ? _a : '',
|
|
158
|
+
target: (_b = target === null || target === void 0 ? void 0 : target.toString()) !== null && _b !== void 0 ? _b : '',
|
|
159
|
+
regex: (_c = this.regex) !== null && _c !== void 0 ? _c : null,
|
|
160
|
+
};
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
function _printWarning(path) {
|
|
164
|
+
(0, util_2.printDeprecationWarning)(`API check "${path}" is probably providing a setup ` +
|
|
165
|
+
'or tearDown script using the "localSetupScript" or "localTearDownScript" property. Please update your API checks to ' +
|
|
166
|
+
'reference any setup / tearDown using the "setupScript" and "tearDownScript" properties See the docs at ' +
|
|
167
|
+
'https://checklyhq.com/docs/cli/constructs-reference#apicheck');
|
|
168
|
+
}
|
|
169
|
+
/**
|
|
170
|
+
* Creates an API Check
|
|
171
|
+
*
|
|
172
|
+
* @remarks
|
|
173
|
+
*
|
|
174
|
+
* This class make use of the API Checks endpoints.
|
|
175
|
+
*/
|
|
176
|
+
class ApiCheck extends check_1.Check {
|
|
177
|
+
/**
|
|
178
|
+
* Constructs the API Check instance
|
|
179
|
+
*
|
|
180
|
+
* @param logicalId unique project-scoped resource name identification
|
|
181
|
+
* @param props check configuration properties
|
|
182
|
+
*
|
|
183
|
+
* {@link https://checklyhq.com/docs/cli/constructs-reference/#apicheck Read more in the docs}
|
|
184
|
+
*/
|
|
185
|
+
constructor(logicalId, props) {
|
|
186
|
+
super(logicalId, props);
|
|
187
|
+
if (props.setupScript) {
|
|
188
|
+
if ('entrypoint' in props.setupScript) {
|
|
189
|
+
const { script, scriptPath, dependencies } = ApiCheck.bundle(props.setupScript.entrypoint, this.runtimeId);
|
|
190
|
+
this.localSetupScript = script;
|
|
191
|
+
this.setupScriptPath = scriptPath;
|
|
192
|
+
this.setupScriptDependencies = dependencies;
|
|
193
|
+
}
|
|
194
|
+
else if ('content' in props.setupScript) {
|
|
195
|
+
this.localSetupScript = props.setupScript.content;
|
|
196
|
+
}
|
|
197
|
+
else {
|
|
198
|
+
throw new Error('Unrecognized type for the "setupScript" property. A "setupScript" should have either a "content" ' +
|
|
199
|
+
'or "entrypoint" property.');
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
if (props.localSetupScript) {
|
|
203
|
+
_printWarning(project_1.Session.checkFilePath);
|
|
204
|
+
this.localSetupScript = props.localSetupScript;
|
|
205
|
+
}
|
|
206
|
+
if (props.tearDownScript) {
|
|
207
|
+
if ('entrypoint' in props.tearDownScript) {
|
|
208
|
+
const { script, scriptPath, dependencies } = ApiCheck.bundle(props.tearDownScript.entrypoint, this.runtimeId);
|
|
209
|
+
this.localTearDownScript = script;
|
|
210
|
+
this.tearDownScriptPath = scriptPath;
|
|
211
|
+
this.tearDownScriptDependencies = dependencies;
|
|
212
|
+
}
|
|
213
|
+
else if ('content' in props.tearDownScript) {
|
|
214
|
+
this.localTearDownScript = props.tearDownScript.content;
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
if (props.localTearDownScript) {
|
|
218
|
+
_printWarning(project_1.Session.checkFilePath);
|
|
219
|
+
this.localTearDownScript = props.localTearDownScript;
|
|
220
|
+
}
|
|
221
|
+
this.request = props.request;
|
|
222
|
+
this.degradedResponseTime = props.degradedResponseTime;
|
|
223
|
+
this.maxResponseTime = props.maxResponseTime;
|
|
224
|
+
project_1.Session.registerConstruct(this);
|
|
225
|
+
this.addSubscriptions();
|
|
226
|
+
this.addPrivateLocationCheckAssignments();
|
|
227
|
+
}
|
|
228
|
+
static bundle(entrypoint, runtimeId) {
|
|
229
|
+
let absoluteEntrypoint = null;
|
|
230
|
+
if (path.isAbsolute(entrypoint)) {
|
|
231
|
+
absoluteEntrypoint = entrypoint;
|
|
232
|
+
}
|
|
233
|
+
else {
|
|
234
|
+
if (!project_1.Session.checkFileAbsolutePath) {
|
|
235
|
+
throw new Error('You cant use relative paths without the checkFileAbsolutePath in session');
|
|
236
|
+
}
|
|
237
|
+
absoluteEntrypoint = path.join(path.dirname(project_1.Session.checkFileAbsolutePath), entrypoint);
|
|
238
|
+
}
|
|
239
|
+
const runtime = project_1.Session.availableRuntimes[runtimeId];
|
|
240
|
+
if (!runtime) {
|
|
241
|
+
throw new Error(`${runtimeId} is not supported`);
|
|
242
|
+
}
|
|
243
|
+
const parser = new parser_1.Parser({
|
|
244
|
+
supportedNpmModules: Object.keys(runtime.dependencies),
|
|
245
|
+
checkUnsupportedModules: project_1.Session.verifyRuntimeDependencies,
|
|
246
|
+
});
|
|
247
|
+
const parsed = parser.parse(absoluteEntrypoint);
|
|
248
|
+
// Maybe we can get the parsed deps with the content immediately
|
|
249
|
+
const deps = [];
|
|
250
|
+
for (const { filePath, content } of parsed.dependencies) {
|
|
251
|
+
deps.push({
|
|
252
|
+
path: (0, util_1.pathToPosix)(path.relative(project_1.Session.basePath, filePath)),
|
|
253
|
+
content,
|
|
254
|
+
});
|
|
255
|
+
}
|
|
256
|
+
return {
|
|
257
|
+
script: parsed.entrypoint.content,
|
|
258
|
+
scriptPath: (0, util_1.pathToPosix)(path.relative(project_1.Session.basePath, parsed.entrypoint.filePath)),
|
|
259
|
+
dependencies: deps,
|
|
260
|
+
};
|
|
261
|
+
}
|
|
262
|
+
synthesize() {
|
|
263
|
+
return {
|
|
264
|
+
...super.synthesize(),
|
|
265
|
+
checkType: 'API',
|
|
266
|
+
request: this.request,
|
|
267
|
+
localSetupScript: this.localSetupScript,
|
|
268
|
+
setupScriptPath: this.setupScriptPath,
|
|
269
|
+
setupScriptDependencies: this.setupScriptDependencies,
|
|
270
|
+
localTearDownScript: this.localTearDownScript,
|
|
271
|
+
tearDownScriptPath: this.tearDownScriptPath,
|
|
272
|
+
tearDownScriptDependencies: this.tearDownScriptDependencies,
|
|
273
|
+
degradedResponseTime: this.degradedResponseTime,
|
|
274
|
+
maxResponseTime: this.maxResponseTime,
|
|
275
|
+
};
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
exports.ApiCheck = ApiCheck;
|
|
279
|
+
//# sourceMappingURL=api-check.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"api-check.js","sourceRoot":"","sources":["../../src/constructs/api-check.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,2CAA4B;AAC5B,mCAA2C;AAE3C,uCAAmC;AAEnC,4DAAwD;AACxD,2CAA8C;AAC9C,4CAA2D;AAG3D,gDAAgD;AAChD,IAAK,eAMJ;AAND,WAAK,eAAe;IAClB,8CAA2B,CAAA;IAC3B,0CAAuB,CAAA;IACvB,sCAAmB,CAAA;IACnB,0CAAuB,CAAA;IACvB,kDAA+B,CAAA;AACjC,CAAC,EANI,eAAe,KAAf,eAAe,QAMnB;AAED,gDAAgD;AAChD,IAAK,mBAeJ;AAfD,WAAK,mBAAmB;IACtB,wCAAiB,CAAA;IACjB,gDAAyB,CAAA;IACzB,0CAAmB,CAAA;IACnB,kDAA2B,CAAA;IAC3B,8CAAuB,CAAA;IACvB,sDAA+B,CAAA;IAC/B,4CAAqB,CAAA;IACrB,8CAAuB,CAAA;IACvB,oDAA6B,CAAA;IAC7B,8CAAuB,CAAA;IACvB,4CAAqB,CAAA;IACrB,oDAA6B,CAAA;IAC7B,0CAAmB,CAAA;IACnB,4CAAqB,CAAA;AACvB,CAAC,EAfI,mBAAmB,KAAnB,mBAAmB,QAevB;AAUD,MAAa,gBAAgB;IAC3B,MAAM,CAAC,UAAU;QACf,OAAO,IAAI,uBAAuB,CAAC,eAAe,CAAC,WAAW,CAAC,CAAA;IACjE,CAAC;IAED,MAAM,CAAC,QAAQ,CAAE,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oB,EAAE,IAAI,CAAC,oBAAoB;YAC/C,eAAe,EAAE,IAAI,CAAC,eAAe;SACtC,CAAA;IACH,CAAC;CACF;AAtHD,4BAsHC"}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import { Check, CheckProps } from './check';
|
|
2
|
+
import { Content, Entrypoint } from './construct';
|
|
3
|
+
import { Snapshot } from '../services/snapshot-service';
|
|
4
|
+
import { PlaywrightConfig } from './playwright-config';
|
|
5
|
+
export interface CheckDependency {
|
|
6
|
+
path: string;
|
|
7
|
+
content: string;
|
|
8
|
+
}
|
|
9
|
+
export interface BrowserCheckProps extends CheckProps {
|
|
10
|
+
/**
|
|
11
|
+
* A valid piece of Node.js javascript code describing a browser interaction
|
|
12
|
+
* with the Puppeteer or Playwright frameworks.
|
|
13
|
+
*/
|
|
14
|
+
code: Content | Entrypoint;
|
|
15
|
+
/**
|
|
16
|
+
* A valid fully qualified domain name (FQDN) to check for SSL certificate
|
|
17
|
+
* expiration. For example, 'app.checklyhq.com'.
|
|
18
|
+
*/
|
|
19
|
+
sslCheckDomain?: string;
|
|
20
|
+
/**
|
|
21
|
+
* A valid playwright config object, same format and keys as you would use on
|
|
22
|
+
* playwright.config.ts
|
|
23
|
+
*/
|
|
24
|
+
playwrightConfig?: PlaywrightConfig;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Creates a Browser Check
|
|
28
|
+
*
|
|
29
|
+
* @remarks
|
|
30
|
+
*
|
|
31
|
+
* This class make use of the Browser Checks endpoints.
|
|
32
|
+
*/
|
|
33
|
+
export declare class BrowserCheck extends Check {
|
|
34
|
+
script: string;
|
|
35
|
+
scriptPath?: string;
|
|
36
|
+
dependencies?: Array<CheckDependency>;
|
|
37
|
+
sslCheckDomain?: string;
|
|
38
|
+
rawSnapshots?: Array<{
|
|
39
|
+
absolutePath: string;
|
|
40
|
+
path: string;
|
|
41
|
+
}>;
|
|
42
|
+
snapshots?: Array<Snapshot>;
|
|
43
|
+
playwrightConfig?: PlaywrightConfig;
|
|
44
|
+
/**
|
|
45
|
+
* Constructs the Browser Check instance
|
|
46
|
+
*
|
|
47
|
+
* @param logicalId unique project-scoped resource name identification
|
|
48
|
+
* @param props check configuration properties
|
|
49
|
+
* {@link https://checklyhq.com/docs/cli/constructs-reference/#browsercheck Read more in the docs}
|
|
50
|
+
*/
|
|
51
|
+
constructor(logicalId: string, props: BrowserCheckProps);
|
|
52
|
+
private static applyDefaultBrowserCheckGroupConfig;
|
|
53
|
+
private static applyDefaultBrowserCheckConfig;
|
|
54
|
+
static bundle(entry: string, runtimeId: string): {
|
|
55
|
+
script: string;
|
|
56
|
+
scriptPath: string;
|
|
57
|
+
dependencies: CheckDependency[];
|
|
58
|
+
snapshots: {
|
|
59
|
+
absolutePath: string;
|
|
60
|
+
path: string;
|
|
61
|
+
}[];
|
|
62
|
+
};
|
|
63
|
+
getSourceFile(): string | undefined;
|
|
64
|
+
synthesize(): {
|
|
65
|
+
checkType: string;
|
|
66
|
+
script: string;
|
|
67
|
+
scriptPath: string | undefined;
|
|
68
|
+
dependencies: CheckDependency[] | undefined;
|
|
69
|
+
sslCheckDomain: string | null;
|
|
70
|
+
snapshots: Snapshot[] | undefined;
|
|
71
|
+
playwrightConfig: PlaywrightConfig | undefined;
|
|
72
|
+
name: string;
|
|
73
|
+
activated: boolean | undefined;
|
|
74
|
+
muted: boolean | undefined;
|
|
75
|
+
shouldFail: boolean | undefined;
|
|
76
|
+
runtimeId: string | undefined;
|
|
77
|
+
locations: (keyof import("..").Region)[] | undefined;
|
|
78
|
+
privateLocations: undefined;
|
|
79
|
+
tags: string[] | undefined;
|
|
80
|
+
frequency: number | undefined;
|
|
81
|
+
frequencyOffset: number | undefined;
|
|
82
|
+
groupId: import("./ref").Ref | undefined;
|
|
83
|
+
environmentVariables: import("./key-value-pair").default[] | undefined;
|
|
84
|
+
retryStrategy: import("./retry-strategy").RetryStrategy | null | undefined;
|
|
85
|
+
doubleCheck: boolean | undefined;
|
|
86
|
+
alertSettings: import("./alert-escalation-policy").AlertEscalation | undefined;
|
|
87
|
+
useGlobalAlertSettings: boolean | undefined;
|
|
88
|
+
runParallel: boolean | undefined;
|
|
89
|
+
};
|
|
90
|
+
}
|