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
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"multi-step-check.js","sourceRoot":"","sources":["../../src/constructs/multi-step-check.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"multi-step-check.js","sourceRoot":"","sources":["../../src/constructs/multi-step-check.ts"],"names":[],"mappings":";;;;;;AAAA,gEAAiC;AAEjC,mCAA2C;AAC3C,u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iB,CAAC,MAAM,CAAC,UAAU,CAAC,QAAQ,CAAC;YACjE,YAAY,EAAE,IAAI;SACnB,CAAA;IACH,CAAC;IAED,aAAa;QACX,OAAO,IAAI,CAAC,eAAe,CAAA;IAC7B,CAAC;IAED,KAAK,CAAC,MAAM;QACV,OAAO,IAAI,8CAAoB,CAAC,IAAI,EAAE,MAAM,CAAC,KAAK,IAAI,EAAE;YACtD,IAAI,IAAA,wBAAY,EAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC;gBAC5B,MAAM,MAAM,GAAG,MAAM,cAAc,CAAC,MAAM,CACxC,IAAI,CAAC,sBAAsB,CAAC,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,EACjD,IAAI,CAAC,SAAS,CACf,CAAA;gBACD,IAAI,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC;oBACnB,MAAM,IAAI,KAAK,CAAC,sDAAsD,CAAC,CAAA;gBACzE,CAAC;gBACD,OAAO,MAAM,CAAA;YACf,CAAC;YAED,MAAM,MAAM,GAAG,IAAI,CAAC,IAAI,CAAC,OAAO,CAAA;YAChC,OAAO;gBACL,MAAM;aACP,CAAA;QACH,CAAC,CAAC,EAAE,CAAC,CAAA;IACP,CAAC;IAED,UAAU;QACR,OAAO;YACL,GAAG,KAAK,CAAC,UAAU,EAAE;YACrB,SAAS,EAAE,mBAAU,CAAC,UAAU;YAChC,gBAAgB,EAAE,IAAI,CAAC,gBAAgB;SACxC,CAAA;IACH,CAAC;CACF;AA5ID,wCA4IC"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { Bundle } from './construct';
|
|
2
|
+
import { PlaywrightCheck } from './playwright-check';
|
|
3
|
+
import { Ref } from './ref';
|
|
4
|
+
export interface PlaywrightCheckBundleProps {
|
|
5
|
+
groupId?: Ref;
|
|
6
|
+
codeBundlePath?: string;
|
|
7
|
+
browsers?: string[];
|
|
8
|
+
cacheHash?: string;
|
|
9
|
+
}
|
|
10
|
+
export declare class PlaywrightCheckBundle implements Bundle {
|
|
11
|
+
playwrightCheck: PlaywrightCheck;
|
|
12
|
+
groupId?: Ref;
|
|
13
|
+
codeBundlePath?: string;
|
|
14
|
+
browsers?: string[];
|
|
15
|
+
cacheHash?: string;
|
|
16
|
+
constructor(playwrightCheck: PlaywrightCheck, props: PlaywrightCheckBundleProps);
|
|
17
|
+
synthesize(): {
|
|
18
|
+
groupId: Ref | undefined;
|
|
19
|
+
codeBundlePath: string | undefined;
|
|
20
|
+
browsers: string[] | undefined;
|
|
21
|
+
cacheHash: string | undefined;
|
|
22
|
+
checkType: string;
|
|
23
|
+
testCommand: string;
|
|
24
|
+
installCommand: string | undefined;
|
|
25
|
+
name: string;
|
|
26
|
+
activated: boolean | undefined;
|
|
27
|
+
muted: boolean | undefined;
|
|
28
|
+
shouldFail: boolean | undefined;
|
|
29
|
+
runtimeId: string | undefined;
|
|
30
|
+
locations: (keyof import("..").Region)[] | undefined;
|
|
31
|
+
privateLocations: undefined;
|
|
32
|
+
tags: string[] | undefined;
|
|
33
|
+
frequency: number | undefined;
|
|
34
|
+
frequencyOffset: number | undefined;
|
|
35
|
+
environmentVariables: import("./key-value-pair").default[] | undefined;
|
|
36
|
+
retryStrategy: import("./retry-strategy").RetryStrategy | null | undefined;
|
|
37
|
+
doubleCheck: boolean | undefined;
|
|
38
|
+
alertSettings: import("./alert-escalation-policy").AlertEscalation | undefined;
|
|
39
|
+
useGlobalAlertSettings: boolean | undefined;
|
|
40
|
+
runParallel: boolean | undefined;
|
|
41
|
+
triggerIncident: {
|
|
42
|
+
serviceId: Ref;
|
|
43
|
+
severity: "MINOR" | "MEDIUM" | "MAJOR" | "CRITICAL";
|
|
44
|
+
name: string;
|
|
45
|
+
description: string;
|
|
46
|
+
notifySubscribers: boolean;
|
|
47
|
+
} | undefined;
|
|
48
|
+
};
|
|
49
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PlaywrightCheckBundle = void 0;
|
|
4
|
+
class PlaywrightCheckBundle {
|
|
5
|
+
playwrightCheck;
|
|
6
|
+
groupId;
|
|
7
|
+
codeBundlePath;
|
|
8
|
+
browsers;
|
|
9
|
+
cacheHash;
|
|
10
|
+
constructor(playwrightCheck, props) {
|
|
11
|
+
this.playwrightCheck = playwrightCheck;
|
|
12
|
+
this.groupId = props.groupId;
|
|
13
|
+
this.codeBundlePath = props.codeBundlePath;
|
|
14
|
+
this.browsers = props.browsers;
|
|
15
|
+
this.cacheHash = props.cacheHash;
|
|
16
|
+
}
|
|
17
|
+
synthesize() {
|
|
18
|
+
return {
|
|
19
|
+
...this.playwrightCheck.synthesize(),
|
|
20
|
+
groupId: this.groupId,
|
|
21
|
+
codeBundlePath: this.codeBundlePath,
|
|
22
|
+
browsers: this.browsers,
|
|
23
|
+
cacheHash: this.cacheHash,
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
exports.PlaywrightCheckBundle = PlaywrightCheckBundle;
|
|
28
|
+
//# sourceMappingURL=playwright-check-bundle.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"playwright-check-bundle.js","sourceRoot":"","sources":["../../src/constructs/playwright-check-bundle.ts"],"names":[],"mappings":";;;AAWA,MAAa,qBAAqB;IAChC,eAAe,CAAiB;IAChC,OAAO,CAAM;IACb,cAAc,CAAS;IACvB,QAAQ,CAAW;IACnB,SAAS,CAAS;IAElB,YAAa,eAAgC,EAAE,KAAiC;QAC9E,IAAI,CAAC,eAAe,GAAG,eAAe,CAAA;QACtC,IAAI,CAAC,OAAO,GAAG,KAAK,CAAC,OAAO,CAAA;QAC5B,IAAI,CAAC,cAAc,GAAG,KAAK,CAAC,cAAc,CAAA;QAC1C,IAAI,CAAC,QAAQ,GAAG,KAAK,CAAC,QAAQ,CAAA;QAC9B,IAAI,CAAC,SAAS,GAAG,KAAK,CAAC,SAAS,CAAA;IAClC,CAAC;IAED,UAAU;QACR,OAAO;YACL,GAAG,IAAI,CAAC,eAAe,CAAC,UAAU,EAAE;YACpC,OAAO,EAAE,IAAI,CAAC,OAAO;YACrB,cAAc,EAAE,IAAI,CAAC,cAAc;YACnC,QAAQ,EAAE,IAAI,CAAC,QAAQ;YACvB,SAAS,EAAE,IAAI,CAAC,SAAS;SAC1B,CAAA;IACH,CAAC;CACF;AAxBD,sDAwBC"}
|
|
@@ -1,33 +1,29 @@
|
|
|
1
1
|
import type { AxiosResponse } from 'axios';
|
|
2
2
|
import { Check, CheckProps } from './check';
|
|
3
|
+
import { Diagnostics } from './diagnostics';
|
|
4
|
+
import { PlaywrightCheckBundle } from './playwright-check-bundle';
|
|
5
|
+
import { Ref } from './ref';
|
|
3
6
|
export interface PlaywrightCheckProps extends CheckProps {
|
|
4
7
|
playwrightConfigPath: string;
|
|
5
|
-
codeBundlePath?: string;
|
|
6
8
|
installCommand?: string;
|
|
7
9
|
testCommand?: string;
|
|
8
10
|
pwProjects?: string | string[];
|
|
9
11
|
pwTags?: string | string[];
|
|
10
|
-
browsers?: string[];
|
|
11
12
|
include?: string | string[];
|
|
12
13
|
groupName?: string;
|
|
13
|
-
logicalId: string;
|
|
14
|
-
cacheHash?: string;
|
|
15
14
|
}
|
|
16
15
|
export declare class PlaywrightCheck extends Check {
|
|
16
|
+
#private;
|
|
17
17
|
installCommand?: string;
|
|
18
18
|
testCommand: string;
|
|
19
19
|
playwrightConfigPath: string;
|
|
20
20
|
pwProjects: string[];
|
|
21
21
|
pwTags: string[];
|
|
22
|
-
codeBundlePath?: string;
|
|
23
|
-
browsers?: string[];
|
|
24
22
|
include: string[];
|
|
25
23
|
groupName?: string;
|
|
26
|
-
name: string;
|
|
27
|
-
cacheHash?: string;
|
|
28
24
|
constructor(logicalId: string, props: PlaywrightCheckProps);
|
|
29
|
-
|
|
30
|
-
getSourceFile(): string;
|
|
25
|
+
validate(diagnostics: Diagnostics): Promise<void>;
|
|
26
|
+
getSourceFile(): string | undefined;
|
|
31
27
|
static buildTestCommand(testCommand: string, playwrightConfigPath: string, playwrightProject?: string[], playwrightTag?: string[]): string;
|
|
32
28
|
static bundleProject(playwrightConfigPath: string, include: string[]): Promise<{
|
|
33
29
|
key: any;
|
|
@@ -36,13 +32,11 @@ export declare class PlaywrightCheck extends Check {
|
|
|
36
32
|
cacheHash: string;
|
|
37
33
|
}>;
|
|
38
34
|
static uploadPlaywrightProject(dir: string): Promise<AxiosResponse>;
|
|
35
|
+
bundle(): Promise<PlaywrightCheckBundle>;
|
|
39
36
|
synthesize(): {
|
|
40
37
|
checkType: string;
|
|
41
|
-
codeBundlePath: string | undefined;
|
|
42
38
|
testCommand: string;
|
|
43
39
|
installCommand: string | undefined;
|
|
44
|
-
browsers: string[] | undefined;
|
|
45
|
-
cacheHash: string | undefined;
|
|
46
40
|
name: string;
|
|
47
41
|
activated: boolean | undefined;
|
|
48
42
|
muted: boolean | undefined;
|
|
@@ -53,7 +47,7 @@ export declare class PlaywrightCheck extends Check {
|
|
|
53
47
|
tags: string[] | undefined;
|
|
54
48
|
frequency: number | undefined;
|
|
55
49
|
frequencyOffset: number | undefined;
|
|
56
|
-
groupId:
|
|
50
|
+
groupId: Ref | undefined;
|
|
57
51
|
environmentVariables: import("./key-value-pair").default[] | undefined;
|
|
58
52
|
retryStrategy: import("./retry-strategy").RetryStrategy | null | undefined;
|
|
59
53
|
doubleCheck: boolean | undefined;
|
|
@@ -61,7 +55,7 @@ export declare class PlaywrightCheck extends Check {
|
|
|
61
55
|
useGlobalAlertSettings: boolean | undefined;
|
|
62
56
|
runParallel: boolean | undefined;
|
|
63
57
|
triggerIncident: {
|
|
64
|
-
serviceId:
|
|
58
|
+
serviceId: Ref;
|
|
65
59
|
severity: "MINOR" | "MEDIUM" | "MAJOR" | "CRITICAL";
|
|
66
60
|
name: string;
|
|
67
61
|
description: string;
|
|
@@ -4,32 +4,25 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.PlaywrightCheck = void 0;
|
|
7
|
-
const
|
|
7
|
+
const node_fs_1 = require("node:fs");
|
|
8
|
+
const promises_1 = __importDefault(require("node:fs/promises"));
|
|
8
9
|
const check_1 = require("./check");
|
|
9
10
|
const project_1 = require("./project");
|
|
10
11
|
const util_1 = require("../services/util");
|
|
11
12
|
const api_1 = require("../rest/api");
|
|
12
|
-
const
|
|
13
|
+
const construct_diagnostics_1 = require("./construct-diagnostics");
|
|
14
|
+
const playwright_check_bundle_1 = require("./playwright-check-bundle");
|
|
13
15
|
class PlaywrightCheck extends check_1.Check {
|
|
14
16
|
installCommand;
|
|
15
17
|
testCommand;
|
|
16
18
|
playwrightConfigPath;
|
|
17
19
|
pwProjects;
|
|
18
20
|
pwTags;
|
|
19
|
-
codeBundlePath;
|
|
20
|
-
browsers;
|
|
21
21
|
include;
|
|
22
22
|
groupName;
|
|
23
|
-
name;
|
|
24
|
-
cacheHash;
|
|
25
23
|
constructor(logicalId, props) {
|
|
26
24
|
super(logicalId, props);
|
|
27
|
-
this.logicalId = logicalId;
|
|
28
|
-
this.name = props.name;
|
|
29
|
-
this.cacheHash = props.cacheHash;
|
|
30
|
-
this.codeBundlePath = props.codeBundlePath;
|
|
31
25
|
this.installCommand = props.installCommand;
|
|
32
|
-
this.browsers = props.browsers;
|
|
33
26
|
this.pwProjects = props.pwProjects
|
|
34
27
|
? (Array.isArray(props.pwProjects) ? props.pwProjects : [props.pwProjects])
|
|
35
28
|
: [];
|
|
@@ -40,34 +33,32 @@ class PlaywrightCheck extends check_1.Check {
|
|
|
40
33
|
? (Array.isArray(props.include) ? props.include : [props.include])
|
|
41
34
|
: [];
|
|
42
35
|
this.testCommand = props.testCommand ?? 'npx playwright test';
|
|
43
|
-
if (!fs_1.default.existsSync(props.playwrightConfigPath)) {
|
|
44
|
-
throw new validator_error_1.ValidationError(`Playwright config doesnt exist ${props.playwrightConfigPath}`);
|
|
45
|
-
}
|
|
46
36
|
this.groupName = props.groupName;
|
|
47
37
|
this.playwrightConfigPath = props.playwrightConfigPath;
|
|
48
|
-
this.applyGroup(this.groupName);
|
|
49
38
|
project_1.Session.registerConstruct(this);
|
|
50
39
|
this.addSubscriptions();
|
|
51
40
|
this.addPrivateLocationCheckAssignments();
|
|
52
41
|
}
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
}
|
|
57
|
-
const checkGroups = project_1.Session.project?.data?.['check-group'];
|
|
58
|
-
if (!checkGroups) {
|
|
59
|
-
return;
|
|
42
|
+
async validate(diagnostics) {
|
|
43
|
+
try {
|
|
44
|
+
await promises_1.default.access(this.playwrightConfigPath, promises_1.default.constants.R_OK);
|
|
60
45
|
}
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
this.groupId = group.ref();
|
|
46
|
+
catch (err) {
|
|
47
|
+
diagnostics.add(new construct_diagnostics_1.InvalidPropertyValueDiagnostic('playwrightConfigPath', new Error(`Playwright config "${this.playwrightConfigPath}" does not exist: ${err.message}`, { cause: err })));
|
|
64
48
|
}
|
|
65
|
-
|
|
66
|
-
|
|
49
|
+
if (this.groupName) {
|
|
50
|
+
const checkGroup = this.#findGroupByName(this.groupName);
|
|
51
|
+
if (!checkGroup) {
|
|
52
|
+
diagnostics.add(new construct_diagnostics_1.InvalidPropertyValueDiagnostic('groupName', new Error(`No such group "${this.groupName}".`)));
|
|
53
|
+
}
|
|
67
54
|
}
|
|
68
55
|
}
|
|
56
|
+
#findGroupByName(groupName) {
|
|
57
|
+
return Object.values(project_1.Session.project?.data?.['check-group'] ?? {})
|
|
58
|
+
.find(group => group.name === groupName);
|
|
59
|
+
}
|
|
69
60
|
getSourceFile() {
|
|
70
|
-
return this.__checkFilePath
|
|
61
|
+
return this.__checkFilePath;
|
|
71
62
|
}
|
|
72
63
|
static buildTestCommand(testCommand, playwrightConfigPath, playwrightProject, playwrightTag) {
|
|
73
64
|
const quotedPath = `"${playwrightConfigPath}"`;
|
|
@@ -88,23 +79,36 @@ class PlaywrightCheck extends check_1.Check {
|
|
|
88
79
|
}
|
|
89
80
|
}
|
|
90
81
|
static async uploadPlaywrightProject(dir) {
|
|
91
|
-
const { size } = await
|
|
92
|
-
const stream =
|
|
82
|
+
const { size } = await promises_1.default.stat(dir);
|
|
83
|
+
const stream = (0, node_fs_1.createReadStream)(dir);
|
|
93
84
|
stream.on('error', (err) => {
|
|
94
85
|
throw new Error(`Failed to read Playwright project file: ${err.message}`);
|
|
95
86
|
});
|
|
96
87
|
return api_1.checklyStorage.uploadCodeBundle(stream, size);
|
|
97
88
|
}
|
|
89
|
+
async bundle() {
|
|
90
|
+
let groupId;
|
|
91
|
+
if (this.groupName) {
|
|
92
|
+
const checkGroup = this.#findGroupByName(this.groupName);
|
|
93
|
+
if (checkGroup) {
|
|
94
|
+
groupId = checkGroup.ref();
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
const { key: codeBundlePath, browsers, cacheHash, } = await PlaywrightCheck.bundleProject(this.playwrightConfigPath, this.include ?? []);
|
|
98
|
+
return new playwright_check_bundle_1.PlaywrightCheckBundle(this, {
|
|
99
|
+
groupId,
|
|
100
|
+
codeBundlePath,
|
|
101
|
+
browsers,
|
|
102
|
+
cacheHash,
|
|
103
|
+
});
|
|
104
|
+
}
|
|
98
105
|
synthesize() {
|
|
99
106
|
const testCommand = PlaywrightCheck.buildTestCommand(this.testCommand, this.playwrightConfigPath, this.pwProjects, this.pwTags);
|
|
100
107
|
return {
|
|
101
108
|
...super.synthesize(),
|
|
102
109
|
checkType: 'PLAYWRIGHT',
|
|
103
|
-
codeBundlePath: this.codeBundlePath,
|
|
104
110
|
testCommand,
|
|
105
111
|
installCommand: this.installCommand,
|
|
106
|
-
browsers: this.browsers,
|
|
107
|
-
cacheHash: this.cacheHash,
|
|
108
112
|
};
|
|
109
113
|
}
|
|
110
114
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"playwright-check.js","sourceRoot":"","sources":["../../src/constructs/playwright-check.ts"],"names":[],"mappings":";;;;;;AAAA,
|
|
1
|
+
{"version":3,"file":"playwright-check.js","sourceRoot":"","sources":["../../src/constructs/playwright-check.ts"],"names":[],"mappings":";;;;;;AAAA,qCAA0C;AAC1C,gEAAiC;AAGjC,mCAA2C;AAC3C,uCAAmC;AACnC,2CAEyB;AACzB,qCAA4C;AAE5C,mEAAwE;AACxE,uEAAiE;AAajE,MAAa,eAAgB,SAAQ,aAAK;IACxC,cAAc,CAAS;IACvB,WAAW,CAAQ;IACnB,oBAAoB,CAAQ;IAC5B,UAAU,CAAU;IACpB,MAAM,CAAU;IAChB,OAAO,CAAU;IACjB,SAAS,CAAS;IAElB,YAAa,SAAiB,EAAE,KAA2B;QACzD,KAAK,CAAC,SAAS,EAAE,KAAK,CAAC,CAAA;QACvB,IAAI,CAAC,cAAc,GAAG,KAAK,CAAC,cAAc,CAAA;QAC1C,IAAI,CAAC,UAAU,GAAG,KAAK,CAAC,UAAU;YAChC,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC;YAC3E,CAAC,CAAC,EAAE,CAAA;QACN,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC,MAAM;YACxB,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;YAC/D,CAAC,CAAC,EAAE,CAAA;QACN,IAAI,CAAC,OAAO,GAAG,KAAK,CAAC,OAAO;YAC1B,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC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IAAI,CAAC,oBAAoB,EACzB,IAAI,CAAC,UAAU,EACf,IAAI,CAAC,MAAM,CACZ,CAAA;QACD,OAAO;YACL,GAAG,KAAK,CAAC,UAAU,EAAE;YACrB,SAAS,EAAE,YAAY;YACvB,WAAW;YACX,cAAc,EAAE,IAAI,CAAC,cAAc;SACpC,CAAA;IACH,CAAC;CACF;AAhID,0CAgIC"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Construct } from './construct';
|
|
2
|
+
import { Diagnostics } from './diagnostics';
|
|
2
3
|
export type PrivateLocationIcon = 'alert' | 'arrow-down' | 'arrow-left' | 'arrow-right' | 'arrow-small-down' | 'arrow-small-left' | 'arrow-small-right' | 'arrow-small-up' | 'arrow-up' | 'beaker' | 'bell' | 'bold' | 'book' | 'bookmark' | 'briefcase' | 'broadcast' | 'browser' | 'bug' | 'calendar' | 'check' | 'checklist' | 'chevron-down' | 'chevron-left' | 'chevron-right' | 'chevron-up' | 'circle-slash' | 'circuit-board' | 'clippy' | 'clock' | 'cloud-download' | 'cloud-upload' | 'code' | 'comment' | 'comment-discussion' | 'credit-card' | 'dash' | 'dashboard' | 'database' | 'desktop-download' | 'device-camera' | 'device-camera-video' | 'device-desktop' | 'device-mobile' | 'diff' | 'diff-added' | 'diff-ignored' | 'diff-modified' | 'diff-removed' | 'diff-renamed' | 'ellipses' | 'ellipsis' | 'eye' | 'file' | 'file-binary' | 'file-code' | 'file-directory' | 'file-media' | 'file-pdf' | 'file-submodule' | 'file-symlink-directory' | 'file-symlink-file' | 'file-text' | 'file-zip' | 'flame' | 'fold' | 'gear' | 'gift' | 'gist' | 'gist-secret' | 'git-branch' | 'git-commit' | 'git-compare' | 'git-merge' | 'git-pull-request' | 'globe' | 'grabber' | 'graph' | 'heart' | 'history' | 'home' | 'horizontal-rule' | 'hubot' | 'inbox' | 'info' | 'issue-closed' | 'issue-opened' | 'issue-reopened' | 'italic' | 'jersey' | 'key' | 'keyboard' | 'law' | 'light-bulb' | 'link' | 'link-external' | 'list-ordered' | 'list-unordered' | 'location' | 'lock' | 'mail' | 'mail-read' | 'mail-reply' | 'markdown' | 'mark-github' | 'megaphone' | 'mention' | 'milestone' | 'mirror' | 'mortar-board' | 'mute' | 'no-newline' | 'octoface' | 'organization' | 'package' | 'paintcan' | 'pencil' | 'person' | 'pin' | 'plug' | 'plus' | 'plus-small' | 'primitive-dot' | 'primitive-square' | 'pulse' | 'question' | 'quote' | 'radio-tower' | 'reply' | 'repo' | 'repo-clone' | 'repo-force-push' | 'repo-forked' | 'repo-pull' | 'repo-push' | 'rocket' | 'rss' | 'ruby' | 'search' | 'server' | 'settings' | 'shield' | 'sign-in' | 'sign-out' | 'smiley' | 'squirrel' | 'star' | 'stop' | 'sync' | 'tag' | 'tasklist' | 'telescope' | 'terminal' | 'text-size' | 'three-bars' | 'thumbsdown' | 'thumbsup' | 'tools' | 'trashcan' | 'triangle-down' | 'triangle-left' | 'triangle-right' | 'triangle-up' | 'unfold' | 'unmute' | 'unverified' | 'verified' | 'versions' | 'watch' | 'x' | 'zap' | (string & Record<never, never>);
|
|
3
4
|
export interface PrivateLocationProps {
|
|
4
5
|
/**
|
|
@@ -49,6 +50,7 @@ export declare class PrivateLocation extends Construct {
|
|
|
49
50
|
* @param props private location configuration properties
|
|
50
51
|
*/
|
|
51
52
|
constructor(logicalId: string, props: PrivateLocationProps);
|
|
53
|
+
validate(diagnostics: Diagnostics): Promise<void>;
|
|
52
54
|
static fromId(id: string): PrivateLocationRef;
|
|
53
55
|
allowInChecklyConfig(): boolean;
|
|
54
56
|
synthesize(): any | null;
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.PrivateLocation = exports.PrivateLocationRef = void 0;
|
|
4
4
|
const construct_1 = require("./construct");
|
|
5
|
+
const construct_diagnostics_1 = require("./construct-diagnostics");
|
|
5
6
|
const project_1 = require("./project");
|
|
6
|
-
const validator_error_1 = require("./validator-error");
|
|
7
7
|
/**
|
|
8
8
|
* Creates a reference to an existing Private Location.
|
|
9
9
|
*
|
|
@@ -19,6 +19,7 @@ class PrivateLocationRef extends construct_1.Construct {
|
|
|
19
19
|
}
|
|
20
20
|
}
|
|
21
21
|
exports.PrivateLocationRef = PrivateLocationRef;
|
|
22
|
+
const RE_SLUG = /^((?!((us(-gov)?|ap|ca|cn|eu|sa|af|me)-(central|(north|south)?(east|west)?)-\d+))[a-zA-Z0-9-]{1,30})$/;
|
|
22
23
|
/**
|
|
23
24
|
* Creates a Private Location
|
|
24
25
|
*
|
|
@@ -46,12 +47,13 @@ class PrivateLocation extends construct_1.Construct {
|
|
|
46
47
|
this.slugName = props.slugName;
|
|
47
48
|
this.icon = props.icon;
|
|
48
49
|
this.proxyUrl = props.proxyUrl;
|
|
49
|
-
if (!/^((?!((us(-gov)?|ap|ca|cn|eu|sa|af|me)-(central|(north|south)?(east|west)?)-\d+))[a-zA-Z0-9-]{1,30})$/
|
|
50
|
-
.test(this.slugName)) {
|
|
51
|
-
throw new validator_error_1.ValidationError(`The "slugName" must differ from all AWS locations. (slugName='${this.slugName}')`);
|
|
52
|
-
}
|
|
53
50
|
project_1.Session.registerConstruct(this);
|
|
54
51
|
}
|
|
52
|
+
async validate(diagnostics) {
|
|
53
|
+
if (!RE_SLUG.test(this.slugName)) {
|
|
54
|
+
diagnostics.add(new construct_diagnostics_1.InvalidPropertyValueDiagnostic('slugName', new Error(`Value must not equal any AWS location.`)));
|
|
55
|
+
}
|
|
56
|
+
}
|
|
55
57
|
static fromId(id) {
|
|
56
58
|
return new PrivateLocationRef(`private-location-${id}`, id);
|
|
57
59
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"private-location.js","sourceRoot":"","sources":["../../src/constructs/private-location.ts"],"names":[],"mappings":";;;AAAA,2CAAuC;AACvC,
|
|
1
|
+
{"version":3,"file":"private-location.js","sourceRoot":"","sources":["../../src/constructs/private-location.ts"],"names":[],"mappings":";;;AAAA,2CAA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AO,IAAI,kBAAkB,CAAC,oBAAoB,EAAE,EAAE,EAAE,EAAE,CAAC,CAAA;IAC7D,CAAC;IAED,oBAAoB;QAClB,OAAO,IAAI,CAAA;IACb,CAAC;IAED,UAAU;QACR,OAAO;YACL,IAAI,EAAE,IAAI,CAAC,IAAI;YACf,QAAQ,EAAE,IAAI,CAAC,QAAQ;YACvB,IAAI,EAAE,IAAI,CAAC,IAAI;YACf,QAAQ,EAAE,IAAI,CAAC,QAAQ;SACxB,CAAA;IACH,CAAC;;AAhDH,0CAiDC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { Bundle } from './construct';
|
|
2
|
+
import { Project, Resources } from './project';
|
|
3
|
+
export type ResourceDataBundle<T> = {
|
|
4
|
+
construct: T;
|
|
5
|
+
bundle: Bundle;
|
|
6
|
+
};
|
|
7
|
+
export type ProjectDataBundle = {
|
|
8
|
+
[x in keyof Resources]: Record<string, ResourceDataBundle<Resources[x]>>;
|
|
9
|
+
};
|
|
10
|
+
export declare class ProjectBundle implements Bundle {
|
|
11
|
+
project: Project;
|
|
12
|
+
data: ProjectDataBundle;
|
|
13
|
+
constructor(project: Project, data: ProjectDataBundle);
|
|
14
|
+
private synthesizeRecord;
|
|
15
|
+
synthesize(): {
|
|
16
|
+
resources: {
|
|
17
|
+
logicalId: string;
|
|
18
|
+
type: string;
|
|
19
|
+
physicalId: string | number | undefined;
|
|
20
|
+
member: boolean;
|
|
21
|
+
payload: any;
|
|
22
|
+
}[];
|
|
23
|
+
project: {
|
|
24
|
+
logicalId: string;
|
|
25
|
+
name: string;
|
|
26
|
+
repoUrl: string | undefined;
|
|
27
|
+
};
|
|
28
|
+
sharedFiles: import("./project").SharedFile[];
|
|
29
|
+
};
|
|
30
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ProjectBundle = void 0;
|
|
4
|
+
class ProjectBundle {
|
|
5
|
+
project;
|
|
6
|
+
data;
|
|
7
|
+
constructor(project, data) {
|
|
8
|
+
this.project = project;
|
|
9
|
+
this.data = data;
|
|
10
|
+
}
|
|
11
|
+
synthesizeRecord(record) {
|
|
12
|
+
return Object.entries(record)
|
|
13
|
+
.map(([key, { construct, bundle }]) => ({
|
|
14
|
+
logicalId: key,
|
|
15
|
+
type: construct.type,
|
|
16
|
+
physicalId: construct.physicalId,
|
|
17
|
+
member: construct.member,
|
|
18
|
+
payload: bundle.synthesize(),
|
|
19
|
+
}));
|
|
20
|
+
}
|
|
21
|
+
synthesize() {
|
|
22
|
+
return {
|
|
23
|
+
...this.project.synthesize(),
|
|
24
|
+
resources: [
|
|
25
|
+
// The order in which resources are defined here is important. If
|
|
26
|
+
// resource A may include references to resource B, it should occur
|
|
27
|
+
// later than resource B.
|
|
28
|
+
...this.synthesizeRecord(this.data['status-page-service']),
|
|
29
|
+
...this.synthesizeRecord(this.data['status-page']),
|
|
30
|
+
...this.synthesizeRecord(this.data['check-group']),
|
|
31
|
+
...this.synthesizeRecord(this.data.check),
|
|
32
|
+
...this.synthesizeRecord(this.data['alert-channel']),
|
|
33
|
+
...this.synthesizeRecord(this.data['alert-channel-subscription']),
|
|
34
|
+
...this.synthesizeRecord(this.data['maintenance-window']),
|
|
35
|
+
...this.synthesizeRecord(this.data['private-location']),
|
|
36
|
+
...this.synthesizeRecord(this.data['private-location-check-assignment']),
|
|
37
|
+
...this.synthesizeRecord(this.data['private-location-group-assignment']),
|
|
38
|
+
...this.synthesizeRecord(this.data.dashboard),
|
|
39
|
+
],
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
exports.ProjectBundle = ProjectBundle;
|
|
44
|
+
//# sourceMappingURL=project-bundle.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"project-bundle.js","sourceRoot":"","sources":["../../src/constructs/project-bundle.ts"],"names":[],"mappings":";;;AAYA,MAAa,aAAa;IACxB,OAA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AC,oBAAoB,CAAC,CAAC;gBACzD,GAAG,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,IAAI,CAAC,kBAAkB,CAAC,CAAC;gBACvD,GAAG,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,IAAI,CAAC,mCAAmC,CAAC,CAAC;gBACxE,GAAG,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,IAAI,CAAC,mCAAmC,CAAC,CAAC;gBACxE,GAAG,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC;aAC9C;SACF,CAAA;IACH,CAAC;CACF;AAzCD,sCAyCC"}
|
|
@@ -3,9 +3,10 @@ import { Parser } from '../services/check-parser/parser';
|
|
|
3
3
|
import { Construct } from './construct';
|
|
4
4
|
import type { Runtime } from '../rest/runtimes';
|
|
5
5
|
import { Check, AlertChannelSubscription, AlertChannel, CheckGroup, MaintenanceWindow, Dashboard, PrivateLocation, PrivateLocationCheckAssignment, PrivateLocationGroupAssignment, StatusPage, StatusPageService } from './';
|
|
6
|
-
import { ResourceSync } from '../rest/projects';
|
|
7
6
|
import { PrivateLocationApi } from '../rest/private-locations';
|
|
8
7
|
import { FileLoader } from '../loader';
|
|
8
|
+
import { Diagnostics } from './diagnostics';
|
|
9
|
+
import { ProjectBundle } from './project-bundle';
|
|
9
10
|
export interface ProjectProps {
|
|
10
11
|
/**
|
|
11
12
|
* Friendly name for your project.
|
|
@@ -16,23 +17,27 @@ export interface ProjectProps {
|
|
|
16
17
|
*/
|
|
17
18
|
repoUrl?: string;
|
|
18
19
|
}
|
|
19
|
-
export
|
|
20
|
-
check:
|
|
21
|
-
'check-group':
|
|
22
|
-
'alert-channel':
|
|
23
|
-
'alert-channel-subscription':
|
|
24
|
-
'maintenance-window':
|
|
25
|
-
'private-location':
|
|
26
|
-
'private-location-check-assignment':
|
|
27
|
-
'private-location-group-assignment':
|
|
28
|
-
dashboard:
|
|
29
|
-
'status-page':
|
|
30
|
-
'status-page-service':
|
|
31
|
-
}
|
|
20
|
+
export type Resources = {
|
|
21
|
+
check: Check;
|
|
22
|
+
'check-group': CheckGroup;
|
|
23
|
+
'alert-channel': AlertChannel;
|
|
24
|
+
'alert-channel-subscription': AlertChannelSubscription;
|
|
25
|
+
'maintenance-window': MaintenanceWindow;
|
|
26
|
+
'private-location': PrivateLocation;
|
|
27
|
+
'private-location-check-assignment': PrivateLocationCheckAssignment;
|
|
28
|
+
'private-location-group-assignment': PrivateLocationGroupAssignment;
|
|
29
|
+
dashboard: Dashboard;
|
|
30
|
+
'status-page': StatusPage;
|
|
31
|
+
'status-page-service': StatusPageService;
|
|
32
|
+
};
|
|
33
|
+
export type ProjectData = {
|
|
34
|
+
[x in keyof Resources]: Record<string, Resources[x]>;
|
|
35
|
+
};
|
|
32
36
|
export declare class Project extends Construct {
|
|
33
37
|
name: string;
|
|
34
38
|
repoUrl?: string;
|
|
35
39
|
logicalId: string;
|
|
40
|
+
testOnlyAllowed: boolean;
|
|
36
41
|
data: ProjectData;
|
|
37
42
|
static readonly __checklyType = "project";
|
|
38
43
|
/**
|
|
@@ -42,14 +47,20 @@ export declare class Project extends Construct {
|
|
|
42
47
|
* @param props project configuration properties
|
|
43
48
|
*/
|
|
44
49
|
constructor(logicalId: string, props: ProjectProps);
|
|
50
|
+
validate(diagnostics: Diagnostics): Promise<void>;
|
|
51
|
+
allowTestOnly(enabled: boolean): void;
|
|
45
52
|
addResource(type: string, logicalId: string, resource: Construct): void;
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
53
|
+
bundle(): Promise<ProjectBundle>;
|
|
54
|
+
synthesize(): {
|
|
55
|
+
project: {
|
|
56
|
+
logicalId: string;
|
|
57
|
+
name: string;
|
|
58
|
+
repoUrl: string | undefined;
|
|
59
|
+
};
|
|
60
|
+
sharedFiles: SharedFile[];
|
|
49
61
|
};
|
|
50
62
|
getTestOnlyConstructs(): Construct[];
|
|
51
63
|
getHeartbeatLogicalIds(): string[];
|
|
52
|
-
private synthesizeRecord;
|
|
53
64
|
}
|
|
54
65
|
export interface ConstructExport {
|
|
55
66
|
type: string;
|
|
@@ -57,11 +68,18 @@ export interface ConstructExport {
|
|
|
57
68
|
filePath: string;
|
|
58
69
|
exportName: string;
|
|
59
70
|
}
|
|
71
|
+
export type CheckFilter = (check: Check) => boolean;
|
|
72
|
+
export interface SharedFile {
|
|
73
|
+
path: string;
|
|
74
|
+
content: string;
|
|
75
|
+
}
|
|
76
|
+
export type SharedFileRef = number;
|
|
60
77
|
export declare class Session {
|
|
61
78
|
static loader: FileLoader;
|
|
62
79
|
static project?: Project;
|
|
63
80
|
static basePath?: string;
|
|
64
81
|
static checkDefaults?: CheckConfigDefaults;
|
|
82
|
+
static checkFilter?: CheckFilter;
|
|
65
83
|
static browserCheckDefaults?: CheckConfigDefaults;
|
|
66
84
|
static multiStepCheckDefaults?: CheckConfigDefaults;
|
|
67
85
|
static checkFilePath?: string;
|
|
@@ -80,4 +98,9 @@ export declare class Session {
|
|
|
80
98
|
static getPrivateLocations(): Promise<PrivateLocationApi[]>;
|
|
81
99
|
static getRuntime(runtimeId?: string): Runtime | undefined;
|
|
82
100
|
static getParser(runtime: Runtime): Parser;
|
|
101
|
+
static relativePosixPath(filePath: string): string;
|
|
102
|
+
static sharedFileRefs: Map<string, number>;
|
|
103
|
+
static sharedFiles: SharedFile[];
|
|
104
|
+
static registerSharedFile(file: SharedFile): SharedFileRef;
|
|
105
|
+
static resetSharedFiles(): void;
|
|
83
106
|
}
|