checkly 8.14.1 → 8.15.0
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/ai-context/context.d.ts +18 -0
- package/dist/ai-context/context.js +89 -0
- package/dist/ai-context/context.js.map +1 -1
- package/dist/ai-context/skills-command/references/configure-grpc-monitors.md +37 -0
- package/dist/ai-context/skills-command/references/configure-playwright-checks.md +5 -5
- package/dist/ai-context/skills-command/references/configure-ssl-monitors.md +39 -0
- package/dist/ai-context/skills-command/references/configure-traceroute-monitors.md +36 -0
- package/dist/ai-context/skills-command/references/configure.md +9 -0
- package/dist/commands/checks/stats.js +1 -0
- package/dist/commands/checks/stats.js.map +1 -1
- package/dist/commands/deploy.js +25 -16
- package/dist/commands/deploy.js.map +1 -1
- package/dist/constants.d.ts +4 -1
- package/dist/constants.js +3 -0
- package/dist/constants.js.map +1 -1
- package/dist/constructs/api-assertion-codegen.js +2 -2
- package/dist/constructs/api-assertion-codegen.js.map +1 -1
- package/dist/constructs/api-assertion.d.ts +3 -3
- package/dist/constructs/check-codegen.d.ts +6 -0
- package/dist/constructs/check-codegen.js +24 -0
- package/dist/constructs/check-codegen.js.map +1 -1
- package/dist/constructs/dns-assertion-codegen.js +2 -2
- package/dist/constructs/dns-assertion-codegen.js.map +1 -1
- package/dist/constructs/dns-assertion.d.ts +3 -3
- package/dist/constructs/dns-request.d.ts +2 -2
- package/dist/constructs/grpc-assertion-codegen.d.ts +3 -0
- package/dist/constructs/grpc-assertion-codegen.js +33 -0
- package/dist/constructs/grpc-assertion-codegen.js.map +1 -0
- package/dist/constructs/grpc-assertion-validation.d.ts +13 -0
- package/dist/constructs/grpc-assertion-validation.js +53 -0
- package/dist/constructs/grpc-assertion-validation.js.map +1 -0
- package/dist/constructs/grpc-assertion.d.ts +61 -0
- package/dist/constructs/grpc-assertion.js +71 -0
- package/dist/constructs/grpc-assertion.js.map +1 -0
- package/dist/constructs/grpc-monitor-codegen.d.ts +13 -0
- package/dist/constructs/grpc-monitor-codegen.js +34 -0
- package/dist/constructs/grpc-monitor-codegen.js.map +1 -0
- package/dist/constructs/grpc-monitor.d.ts +83 -0
- package/dist/constructs/grpc-monitor.js +56 -0
- package/dist/constructs/grpc-monitor.js.map +1 -0
- package/dist/constructs/grpc-request-codegen.d.ts +4 -0
- package/dist/constructs/grpc-request-codegen.js +68 -0
- package/dist/constructs/grpc-request-codegen.js.map +1 -0
- package/dist/constructs/grpc-request.d.ts +137 -0
- package/dist/constructs/grpc-request.js +2 -0
- package/dist/constructs/grpc-request.js.map +1 -0
- package/dist/constructs/icmp-assertion-codegen.js +2 -2
- package/dist/constructs/icmp-assertion-codegen.js.map +1 -1
- package/dist/constructs/icmp-assertion.d.ts +1 -1
- package/dist/constructs/icmp-request.d.ts +2 -2
- package/dist/constructs/index.d.ts +9 -0
- package/dist/constructs/index.js +9 -0
- package/dist/constructs/index.js.map +1 -1
- package/dist/constructs/internal/assertion-codegen.d.ts +11 -0
- package/dist/constructs/internal/assertion-codegen.js +39 -0
- package/dist/constructs/internal/assertion-codegen.js.map +1 -1
- package/dist/constructs/internal/assertion-validation.d.ts +3 -0
- package/dist/constructs/internal/assertion-validation.js +17 -0
- package/dist/constructs/internal/assertion-validation.js.map +1 -0
- package/dist/constructs/internal/assertion.d.ts +17 -11
- package/dist/constructs/internal/assertion.js +39 -38
- package/dist/constructs/internal/assertion.js.map +1 -1
- package/dist/constructs/internal/common-diagnostics.d.ts +1 -0
- package/dist/constructs/internal/common-diagnostics.js +14 -0
- package/dist/constructs/internal/common-diagnostics.js.map +1 -1
- package/dist/constructs/ssl-assertion-codegen.d.ts +3 -0
- package/dist/constructs/ssl-assertion-codegen.js +36 -0
- package/dist/constructs/ssl-assertion-codegen.js.map +1 -0
- package/dist/constructs/ssl-assertion-validation.d.ts +13 -0
- package/dist/constructs/ssl-assertion-validation.js +49 -0
- package/dist/constructs/ssl-assertion-validation.js.map +1 -0
- package/dist/constructs/ssl-assertion.d.ts +197 -0
- package/dist/constructs/ssl-assertion.js +267 -0
- package/dist/constructs/ssl-assertion.js.map +1 -0
- package/dist/constructs/ssl-monitor-codegen.d.ts +36 -0
- package/dist/constructs/ssl-monitor-codegen.js +51 -0
- package/dist/constructs/ssl-monitor-codegen.js.map +1 -0
- package/dist/constructs/ssl-monitor.d.ts +89 -0
- package/dist/constructs/ssl-monitor.js +73 -0
- package/dist/constructs/ssl-monitor.js.map +1 -0
- package/dist/constructs/ssl-request-codegen.d.ts +4 -0
- package/dist/constructs/ssl-request-codegen.js +48 -0
- package/dist/constructs/ssl-request-codegen.js.map +1 -0
- package/dist/constructs/ssl-request.d.ts +143 -0
- package/dist/constructs/ssl-request.js +2 -0
- package/dist/constructs/ssl-request.js.map +1 -0
- package/dist/constructs/tcp-monitor-codegen.js +2 -2
- package/dist/constructs/tcp-monitor-codegen.js.map +1 -1
- package/dist/constructs/tcp-monitor.d.ts +1 -1
- package/dist/constructs/traceroute-assertion-codegen.d.ts +3 -0
- package/dist/constructs/traceroute-assertion-codegen.js +17 -0
- package/dist/constructs/traceroute-assertion-codegen.js.map +1 -0
- package/dist/constructs/traceroute-assertion-validation.d.ts +11 -0
- package/dist/constructs/traceroute-assertion-validation.js +77 -0
- package/dist/constructs/traceroute-assertion-validation.js.map +1 -0
- package/dist/constructs/traceroute-assertion.d.ts +67 -0
- package/dist/constructs/traceroute-assertion.js +96 -0
- package/dist/constructs/traceroute-assertion.js.map +1 -0
- package/dist/constructs/traceroute-monitor-codegen.d.ts +13 -0
- package/dist/constructs/traceroute-monitor-codegen.js +34 -0
- package/dist/constructs/traceroute-monitor-codegen.js.map +1 -0
- package/dist/constructs/traceroute-monitor.d.ts +83 -0
- package/dist/constructs/traceroute-monitor.js +54 -0
- package/dist/constructs/traceroute-monitor.js.map +1 -0
- package/dist/constructs/traceroute-request-codegen.d.ts +4 -0
- package/dist/constructs/traceroute-request-codegen.js +41 -0
- package/dist/constructs/traceroute-request-codegen.js.map +1 -0
- package/dist/constructs/traceroute-request.d.ts +81 -0
- package/dist/constructs/traceroute-request.js +2 -0
- package/dist/constructs/traceroute-request.js.map +1 -0
- package/dist/constructs/url-assertion-codegen.js +2 -2
- package/dist/constructs/url-assertion-codegen.js.map +1 -1
- package/dist/formatters/assertion-line.d.ts +27 -0
- package/dist/formatters/assertion-line.js +126 -0
- package/dist/formatters/assertion-line.js.map +1 -0
- package/dist/formatters/batch-stats.js +20 -1
- package/dist/formatters/batch-stats.js.map +1 -1
- package/dist/formatters/check-result-detail.js +604 -1
- package/dist/formatters/check-result-detail.js.map +1 -1
- package/dist/helpers/cli-mode.d.ts +2 -2
- package/dist/helpers/cli-mode.js +103 -11
- package/dist/helpers/cli-mode.js.map +1 -1
- package/dist/reporters/json.d.ts +1 -0
- package/dist/reporters/json.js +58 -0
- package/dist/reporters/json.js.map +1 -1
- package/dist/reporters/util.js +192 -89
- package/dist/reporters/util.js.map +1 -1
- package/dist/rest/analytics.js +6 -0
- package/dist/rest/analytics.js.map +1 -1
- package/dist/rest/batch-analytics.d.ts +1 -0
- package/dist/rest/batch-analytics.js.map +1 -1
- package/dist/rest/check-results.d.ts +75 -1
- package/dist/rest/check-results.js.map +1 -1
- package/dist/rest/projects.d.ts +1 -1
- package/dist/services/check-parser/bundler.d.ts +6 -0
- package/dist/services/check-parser/bundler.js +8 -0
- package/dist/services/check-parser/bundler.js.map +1 -1
- package/dist/services/check-parser/cache-hash.d.ts +24 -2
- package/dist/services/check-parser/cache-hash.js +45 -3
- package/dist/services/check-parser/cache-hash.js.map +1 -1
- package/dist/services/check-parser/package-files/resolver.d.ts +6 -1
- package/dist/services/check-parser/package-files/resolver.js +19 -0
- package/dist/services/check-parser/package-files/resolver.js.map +1 -1
- package/dist/services/util.d.ts +4 -0
- package/dist/services/util.js +4 -0
- package/dist/services/util.js.map +1 -1
- package/oclif.manifest.json +9 -3
- package/package.json +1 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"traceroute-assertion-validation.js","sourceRoot":"","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|
2
|
+
type TracerouteAssertionSource = 'RESPONSE_TIME' | 'HOP_COUNT' | 'PACKET_LOSS';
|
|
3
|
+
export type TracerouteAssertion = CoreAssertion<TracerouteAssertionSource>;
|
|
4
|
+
export type TracerouteResponseTimeProperty = 'avg' | 'min' | 'max' | 'stdDev';
|
|
5
|
+
/** Response time for a statistical property — accepts the full numeric operator set. */
|
|
6
|
+
declare class ResponseTimeAssertionBuilder {
|
|
7
|
+
private property;
|
|
8
|
+
constructor(property: TracerouteResponseTimeProperty);
|
|
9
|
+
equals(target: number): TracerouteAssertion;
|
|
10
|
+
notEquals(target: number): TracerouteAssertion;
|
|
11
|
+
lessThan(target: number): TracerouteAssertion;
|
|
12
|
+
greaterThan(target: number): TracerouteAssertion;
|
|
13
|
+
}
|
|
14
|
+
/** Number of network hops — accepts EQUALS / LESS_THAN / GREATER_THAN (not NOT_EQUALS). */
|
|
15
|
+
declare class HopCountAssertionBuilder {
|
|
16
|
+
equals(target: number): TracerouteAssertion;
|
|
17
|
+
lessThan(target: number): TracerouteAssertion;
|
|
18
|
+
greaterThan(target: number): TracerouteAssertion;
|
|
19
|
+
}
|
|
20
|
+
/** Packet loss percentage (0-100) — accepts EQUALS / LESS_THAN / GREATER_THAN (not NOT_EQUALS). */
|
|
21
|
+
declare class PacketLossAssertionBuilder {
|
|
22
|
+
equals(target: number): TracerouteAssertion;
|
|
23
|
+
lessThan(target: number): TracerouteAssertion;
|
|
24
|
+
greaterThan(target: number): TracerouteAssertion;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Builder class for creating traceroute monitor assertions.
|
|
28
|
+
* Provides methods to create assertions for traceroute probe responses.
|
|
29
|
+
*
|
|
30
|
+
* @example
|
|
31
|
+
* ```typescript
|
|
32
|
+
* // Response time assertions
|
|
33
|
+
* TracerouteAssertionBuilder.responseTime().lessThan(1000)
|
|
34
|
+
* TracerouteAssertionBuilder.responseTime('avg').lessThan(1000)
|
|
35
|
+
* TracerouteAssertionBuilder.responseTime('max').lessThan(2000)
|
|
36
|
+
* TracerouteAssertionBuilder.responseTime('stdDev').lessThan(50)
|
|
37
|
+
*
|
|
38
|
+
* // Hop count assertions
|
|
39
|
+
* TracerouteAssertionBuilder.hopCount().lessThan(20)
|
|
40
|
+
*
|
|
41
|
+
* // Packet loss assertions (percentage, 0-100)
|
|
42
|
+
* TracerouteAssertionBuilder.packetLoss().lessThan(10)
|
|
43
|
+
* ```
|
|
44
|
+
*/
|
|
45
|
+
export declare class TracerouteAssertionBuilder {
|
|
46
|
+
/**
|
|
47
|
+
* Creates an assertion builder for traceroute response time metrics.
|
|
48
|
+
* @param property The response time property to assert against. Defaults to `avg`.
|
|
49
|
+
* - `avg`: Average round-trip time in milliseconds
|
|
50
|
+
* - `min`: Minimum round-trip time in milliseconds
|
|
51
|
+
* - `max`: Maximum round-trip time in milliseconds
|
|
52
|
+
* - `stdDev`: Standard deviation of round-trip times
|
|
53
|
+
* @returns A numeric assertion builder for the specified response time metric.
|
|
54
|
+
*/
|
|
55
|
+
static responseTime(property?: TracerouteResponseTimeProperty): ResponseTimeAssertionBuilder;
|
|
56
|
+
/**
|
|
57
|
+
* Creates an assertion builder for the number of network hops.
|
|
58
|
+
* @returns A numeric assertion builder for the hop count.
|
|
59
|
+
*/
|
|
60
|
+
static hopCount(): HopCountAssertionBuilder;
|
|
61
|
+
/**
|
|
62
|
+
* Creates an assertion builder for the percentage of packet loss (0-100).
|
|
63
|
+
* @returns A numeric assertion builder for packet loss.
|
|
64
|
+
*/
|
|
65
|
+
static packetLoss(): PacketLossAssertionBuilder;
|
|
66
|
+
}
|
|
67
|
+
export {};
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import { toAssertion } from './internal/assertion.js';
|
|
2
|
+
// One builder class per source, each exposing only the operators the backend accepts
|
|
3
|
+
// for that source. The classes are stateless — the source (and, for response time, the
|
|
4
|
+
// statistical property) is baked into each `toAssertion` call — and are not exported:
|
|
5
|
+
// they are reachable only through `TracerouteAssertionBuilder`.
|
|
6
|
+
/** Response time for a statistical property — accepts the full numeric operator set. */
|
|
7
|
+
class ResponseTimeAssertionBuilder {
|
|
8
|
+
property;
|
|
9
|
+
constructor(property) {
|
|
10
|
+
this.property = property;
|
|
11
|
+
}
|
|
12
|
+
equals(target) {
|
|
13
|
+
return toAssertion('RESPONSE_TIME', 'EQUALS', target, this.property);
|
|
14
|
+
}
|
|
15
|
+
notEquals(target) {
|
|
16
|
+
return toAssertion('RESPONSE_TIME', 'NOT_EQUALS', target, this.property);
|
|
17
|
+
}
|
|
18
|
+
lessThan(target) {
|
|
19
|
+
return toAssertion('RESPONSE_TIME', 'LESS_THAN', target, this.property);
|
|
20
|
+
}
|
|
21
|
+
greaterThan(target) {
|
|
22
|
+
return toAssertion('RESPONSE_TIME', 'GREATER_THAN', target, this.property);
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
/** Number of network hops — accepts EQUALS / LESS_THAN / GREATER_THAN (not NOT_EQUALS). */
|
|
26
|
+
class HopCountAssertionBuilder {
|
|
27
|
+
equals(target) {
|
|
28
|
+
return toAssertion('HOP_COUNT', 'EQUALS', target);
|
|
29
|
+
}
|
|
30
|
+
lessThan(target) {
|
|
31
|
+
return toAssertion('HOP_COUNT', 'LESS_THAN', target);
|
|
32
|
+
}
|
|
33
|
+
greaterThan(target) {
|
|
34
|
+
return toAssertion('HOP_COUNT', 'GREATER_THAN', target);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
/** Packet loss percentage (0-100) — accepts EQUALS / LESS_THAN / GREATER_THAN (not NOT_EQUALS). */
|
|
38
|
+
class PacketLossAssertionBuilder {
|
|
39
|
+
equals(target) {
|
|
40
|
+
return toAssertion('PACKET_LOSS', 'EQUALS', target);
|
|
41
|
+
}
|
|
42
|
+
lessThan(target) {
|
|
43
|
+
return toAssertion('PACKET_LOSS', 'LESS_THAN', target);
|
|
44
|
+
}
|
|
45
|
+
greaterThan(target) {
|
|
46
|
+
return toAssertion('PACKET_LOSS', 'GREATER_THAN', target);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Builder class for creating traceroute monitor assertions.
|
|
51
|
+
* Provides methods to create assertions for traceroute probe responses.
|
|
52
|
+
*
|
|
53
|
+
* @example
|
|
54
|
+
* ```typescript
|
|
55
|
+
* // Response time assertions
|
|
56
|
+
* TracerouteAssertionBuilder.responseTime().lessThan(1000)
|
|
57
|
+
* TracerouteAssertionBuilder.responseTime('avg').lessThan(1000)
|
|
58
|
+
* TracerouteAssertionBuilder.responseTime('max').lessThan(2000)
|
|
59
|
+
* TracerouteAssertionBuilder.responseTime('stdDev').lessThan(50)
|
|
60
|
+
*
|
|
61
|
+
* // Hop count assertions
|
|
62
|
+
* TracerouteAssertionBuilder.hopCount().lessThan(20)
|
|
63
|
+
*
|
|
64
|
+
* // Packet loss assertions (percentage, 0-100)
|
|
65
|
+
* TracerouteAssertionBuilder.packetLoss().lessThan(10)
|
|
66
|
+
* ```
|
|
67
|
+
*/
|
|
68
|
+
export class TracerouteAssertionBuilder {
|
|
69
|
+
/**
|
|
70
|
+
* Creates an assertion builder for traceroute response time metrics.
|
|
71
|
+
* @param property The response time property to assert against. Defaults to `avg`.
|
|
72
|
+
* - `avg`: Average round-trip time in milliseconds
|
|
73
|
+
* - `min`: Minimum round-trip time in milliseconds
|
|
74
|
+
* - `max`: Maximum round-trip time in milliseconds
|
|
75
|
+
* - `stdDev`: Standard deviation of round-trip times
|
|
76
|
+
* @returns A numeric assertion builder for the specified response time metric.
|
|
77
|
+
*/
|
|
78
|
+
static responseTime(property = 'avg') {
|
|
79
|
+
return new ResponseTimeAssertionBuilder(property);
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* Creates an assertion builder for the number of network hops.
|
|
83
|
+
* @returns A numeric assertion builder for the hop count.
|
|
84
|
+
*/
|
|
85
|
+
static hopCount() {
|
|
86
|
+
return new HopCountAssertionBuilder();
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* Creates an assertion builder for the percentage of packet loss (0-100).
|
|
90
|
+
* @returns A numeric assertion builder for packet loss.
|
|
91
|
+
*/
|
|
92
|
+
static packetLoss() {
|
|
93
|
+
return new PacketLossAssertionBuilder();
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
//# sourceMappingURL=traceroute-assertion.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"traceroute-assertion.js","sourceRoot":"","sources":["../../src/constructs/traceroute-assertion.ts"],"names":[],"mappings":"AAAA,OAAO,EAA8B,WAAW,EAAE,MAAM,yBAAyB,CAAA;AAWjF,qFAAqF;AACrF,uFAAuF;AACvF,sFAAsF;AACtF,gEAAgE;AAEhE,wFAAwF;AACxF,MAAM,4BAA4B;IACX;IAArB,YAAqB,QAAwC;QAAxC,aAAQ,GAAR,QAAQ,CAAgC;IAAG,CAAC;IACjE,MAAM,CAAE,MAAc;QACpB,OAAO,WAAW,CAAC,eAAe,EAAE,QAAQ,EAAE,MAAM,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAA;IACtE,CAAC;IAED,SAAS,CAAE,MAAc;QACvB,OAAO,WAAW,CAAC,eAAe,EAAE,YAAY,EAAE,MAAM,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAA;IAC1E,CAAC;IAED,QAAQ,CAAE,MAAc;QACtB,OAAO,WAAW,CAAC,eAAe,EAAE,WAAW,EAAE,MAAM,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAA;IACzE,CAAC;IAED,WAAW,CAAE,MAAc;QACzB,OAAO,WAAW,CAAC,eAAe,EAAE,cAAc,EAAE,MAAM,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAA;IAC5E,CAAC;CACF;AAED,2FAA2F;AAC3F,MAAM,wBAAwB;IAC5B,MAAM,CAAE,MAAc;QACpB,OAAO,WAAW,CAAC,WAAW,EAAE,QAAQ,EAAE,MAAM,CAAC,CAAA;IACnD,CAAC;IAED,QAAQ,CAAE,MAAc;QACtB,OAAO,WAAW,CAAC,WAAW,EAAE,WAAW,EAAE,MAAM,CAAC,CAAA;IACtD,CAAC;IAED,WAAW,CAAE,MAAc;QACzB,OAAO,WAAW,CAAC,WAAW,EAAE,cAAc,EAAE,MAAM,CAAC,CAAA;IACzD,CAAC;CACF;AAED,mGAAmG;AACnG,MAAM,0BAA0B;IAC9B,MAAM,CAAE,MAAc;QACpB,OAAO,WAAW,CAAC,aAAa,EAAE,QAAQ,EAAE,MAAM,CAAC,CAAA;IACrD,CAAC;IAED,QAAQ,CAAE,MAAc;QACtB,OAAO,WAAW,CAAC,aAAa,EAAE,WAAW,EAAE,MAAM,CAAC,CAAA;IACxD,CAAC;IAED,WAAW,CAAE,MAAc;QACzB,OAAO,WAAW,CAAC,aAAa,EAAE,cAAc,EAAE,MAAM,CAAC,CAAA;IAC3D,CAAC;CACF;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,OAAO,0BAA0B;IACrC;;;;;;;;OAQG;IACH,MAAM,CAAC,YAAY,CAAE,WAA2C,KAAK;QACnE,OAAO,IAAI,4BAA4B,CAAC,QAAQ,CAAC,CAAA;IACnD,CAAC;IAED;;;OAGG;IACH,MAAM,CAAC,QAAQ;QACb,OAAO,IAAI,wBAAwB,EAAE,CAAA;IACvC,CAAC;IAED;;;OAGG;IACH,MAAM,CAAC,UAAU;QACf,OAAO,IAAI,0BAA0B,EAAE,CAAA;IACzC,CAAC;CACF"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Codegen, Context } from './internal/codegen/index.js';
|
|
2
|
+
import { MonitorResource } from './monitor-codegen.js';
|
|
3
|
+
import { TracerouteRequest } from './traceroute-request.js';
|
|
4
|
+
export interface TracerouteMonitorResource extends MonitorResource {
|
|
5
|
+
checkType: 'TRACEROUTE';
|
|
6
|
+
request: TracerouteRequest;
|
|
7
|
+
degradedResponseTime?: number;
|
|
8
|
+
maxResponseTime?: number;
|
|
9
|
+
}
|
|
10
|
+
export declare class TracerouteMonitorCodegen extends Codegen<TracerouteMonitorResource> {
|
|
11
|
+
describe(resource: TracerouteMonitorResource): string;
|
|
12
|
+
gencode(logicalId: string, resource: TracerouteMonitorResource, context: Context): void;
|
|
13
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { Codegen } from './internal/codegen/index.js';
|
|
2
|
+
import { expr, ident } from '../sourcegen/index.js';
|
|
3
|
+
import { buildMonitorProps } from './monitor-codegen.js';
|
|
4
|
+
import { valueForTracerouteRequest } from './traceroute-request-codegen.js';
|
|
5
|
+
const construct = 'TracerouteMonitor';
|
|
6
|
+
export class TracerouteMonitorCodegen extends Codegen {
|
|
7
|
+
describe(resource) {
|
|
8
|
+
return `Traceroute Monitor: ${resource.name}`;
|
|
9
|
+
}
|
|
10
|
+
gencode(logicalId, resource, context) {
|
|
11
|
+
const filePath = context.filePath('resources/traceroute-monitors', resource.name, {
|
|
12
|
+
tags: resource.tags,
|
|
13
|
+
unique: true,
|
|
14
|
+
});
|
|
15
|
+
const file = this.program.generatedConstructFile(filePath.fullPath);
|
|
16
|
+
file.namedImport(construct, 'checkly/constructs');
|
|
17
|
+
file.section(expr(ident(construct), builder => {
|
|
18
|
+
builder.new(builder => {
|
|
19
|
+
builder.string(logicalId);
|
|
20
|
+
builder.object(builder => {
|
|
21
|
+
if (resource.degradedResponseTime !== undefined) {
|
|
22
|
+
builder.number('degradedResponseTime', resource.degradedResponseTime);
|
|
23
|
+
}
|
|
24
|
+
if (resource.maxResponseTime !== undefined) {
|
|
25
|
+
builder.number('maxResponseTime', resource.maxResponseTime);
|
|
26
|
+
}
|
|
27
|
+
buildMonitorProps(this.program, file, builder, resource, context);
|
|
28
|
+
builder.value('request', valueForTracerouteRequest(this.program, file, context, resource.request));
|
|
29
|
+
});
|
|
30
|
+
});
|
|
31
|
+
}));
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
//# sourceMappingURL=traceroute-monitor-codegen.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{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AC,CAAA;oBACvE,CAAC;oBAED,IAAI,QAAQ,CAAC,eAAe,KAAK,SAAS,EAAE,CAAC;wBAC3C,OAAO,CAAC,MAAM,CAAC,iBAAiB,EAAE,QAAQ,CAAC,eAAe,CAAC,CAAA;oBAC7D,CAAC;oBAED,iBAAiB,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,CAAC,CAAA;oBAEjE,OAAO,CAAC,KAAK,CAAC,SAAS,EAAE,yBAAyB,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAA;gBACpG,CAAC,CAAC,CAAA;YACJ,CAAC,CAAC,CAAA;QACJ,CAAC,CAAC,CAAC,CAAA;IACL,CAAC;CACF"}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import { Monitor, MonitorProps } from './monitor.js';
|
|
2
|
+
import { Diagnostics } from './diagnostics.js';
|
|
3
|
+
import { TracerouteRequest } from './traceroute-request.js';
|
|
4
|
+
export interface TracerouteMonitorProps extends MonitorProps {
|
|
5
|
+
/**
|
|
6
|
+
* Determines the request that the monitor is going to run.
|
|
7
|
+
*/
|
|
8
|
+
request: TracerouteRequest;
|
|
9
|
+
/**
|
|
10
|
+
* The response time in milliseconds where the monitor should be considered
|
|
11
|
+
* degraded.
|
|
12
|
+
*
|
|
13
|
+
* @defaultValue 10000
|
|
14
|
+
* @minimum 0
|
|
15
|
+
* @maximum 30000
|
|
16
|
+
* @example
|
|
17
|
+
* ```typescript
|
|
18
|
+
* degradedResponseTime: 5000 // Alert when the traceroute takes longer than 5 seconds
|
|
19
|
+
* ```
|
|
20
|
+
*/
|
|
21
|
+
degradedResponseTime?: number;
|
|
22
|
+
/**
|
|
23
|
+
* The response time in milliseconds where the monitor should be considered
|
|
24
|
+
* failing.
|
|
25
|
+
*
|
|
26
|
+
* @defaultValue 20000
|
|
27
|
+
* @minimum 0
|
|
28
|
+
* @maximum 30000
|
|
29
|
+
* @example
|
|
30
|
+
* ```typescript
|
|
31
|
+
* maxResponseTime: 20000 // Fail if the traceroute takes longer than 20 seconds
|
|
32
|
+
* ```
|
|
33
|
+
*/
|
|
34
|
+
maxResponseTime?: number;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Creates a Traceroute Monitor
|
|
38
|
+
*/
|
|
39
|
+
export declare class TracerouteMonitor extends Monitor {
|
|
40
|
+
request: TracerouteRequest;
|
|
41
|
+
degradedResponseTime?: number;
|
|
42
|
+
maxResponseTime?: number;
|
|
43
|
+
/**
|
|
44
|
+
* Constructs the Traceroute Monitor instance
|
|
45
|
+
*
|
|
46
|
+
* @param logicalId unique project-scoped resource name identification
|
|
47
|
+
* @param props configuration properties
|
|
48
|
+
*
|
|
49
|
+
* {@link https://www.checklyhq.com/docs/constructs/traceroute-monitor/ Read more in the docs}
|
|
50
|
+
*/
|
|
51
|
+
constructor(logicalId: string, props: TracerouteMonitorProps);
|
|
52
|
+
describe(): string;
|
|
53
|
+
validate(diagnostics: Diagnostics): Promise<void>;
|
|
54
|
+
synthesize(): {
|
|
55
|
+
checkType: string;
|
|
56
|
+
request: TracerouteRequest;
|
|
57
|
+
degradedResponseTime: number | undefined;
|
|
58
|
+
maxResponseTime: number | undefined;
|
|
59
|
+
doubleCheck: boolean;
|
|
60
|
+
activated: boolean | undefined;
|
|
61
|
+
muted: boolean | undefined;
|
|
62
|
+
shouldFail: boolean | undefined;
|
|
63
|
+
locations: (keyof import("../index.js").Region)[] | undefined;
|
|
64
|
+
privateLocations: undefined;
|
|
65
|
+
tags: string[] | undefined;
|
|
66
|
+
frequency: number | undefined;
|
|
67
|
+
frequencyOffset: number | undefined;
|
|
68
|
+
groupId: import("./ref.js").Ref | null;
|
|
69
|
+
retryStrategy: import("./retry-strategy.js").LinearRetryStrategy | import("./retry-strategy.js").ExponentialRetryStrategy | import("./retry-strategy.js").FixedRetryStrategy | import("./retry-strategy.js").SingleRetryRetryStrategy | null | undefined;
|
|
70
|
+
alertSettings: import("./alert-escalation-policy.js").AlertEscalation | undefined;
|
|
71
|
+
useGlobalAlertSettings: boolean | undefined;
|
|
72
|
+
runParallel: boolean | undefined;
|
|
73
|
+
triggerIncident: {
|
|
74
|
+
serviceId: import("./ref.js").Ref;
|
|
75
|
+
severity: "MINOR" | "MEDIUM" | "MAJOR" | "CRITICAL";
|
|
76
|
+
name: string;
|
|
77
|
+
description: string;
|
|
78
|
+
notifySubscribers: boolean;
|
|
79
|
+
} | undefined;
|
|
80
|
+
description?: string | undefined;
|
|
81
|
+
name: string;
|
|
82
|
+
};
|
|
83
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { Monitor } from './monitor.js';
|
|
2
|
+
import { Session } from './session.js';
|
|
3
|
+
import { validateResponseTimes } from './internal/common-diagnostics.js';
|
|
4
|
+
import { validateTracerouteAssertion } from './traceroute-assertion-validation.js';
|
|
5
|
+
/**
|
|
6
|
+
* Creates a Traceroute Monitor
|
|
7
|
+
*/
|
|
8
|
+
export class TracerouteMonitor extends Monitor {
|
|
9
|
+
request;
|
|
10
|
+
degradedResponseTime;
|
|
11
|
+
maxResponseTime;
|
|
12
|
+
/**
|
|
13
|
+
* Constructs the Traceroute Monitor instance
|
|
14
|
+
*
|
|
15
|
+
* @param logicalId unique project-scoped resource name identification
|
|
16
|
+
* @param props configuration properties
|
|
17
|
+
*
|
|
18
|
+
* {@link https://www.checklyhq.com/docs/constructs/traceroute-monitor/ Read more in the docs}
|
|
19
|
+
*/
|
|
20
|
+
constructor(logicalId, props) {
|
|
21
|
+
super(logicalId, props);
|
|
22
|
+
this.request = props.request;
|
|
23
|
+
this.degradedResponseTime = props.degradedResponseTime;
|
|
24
|
+
this.maxResponseTime = props.maxResponseTime;
|
|
25
|
+
Session.registerConstruct(this);
|
|
26
|
+
this.addSubscriptions();
|
|
27
|
+
this.addPrivateLocationCheckAssignments();
|
|
28
|
+
}
|
|
29
|
+
describe() {
|
|
30
|
+
return `TracerouteMonitor:${this.logicalId}`;
|
|
31
|
+
}
|
|
32
|
+
async validate(diagnostics) {
|
|
33
|
+
await super.validate(diagnostics);
|
|
34
|
+
await validateResponseTimes(diagnostics, this, {
|
|
35
|
+
degradedResponseTime: 30_000,
|
|
36
|
+
maxResponseTime: 30_000,
|
|
37
|
+
// Backend default applied when maxResponseTime is omitted.
|
|
38
|
+
defaultMaxResponseTime: 20_000,
|
|
39
|
+
});
|
|
40
|
+
for (const [index, assertion] of (this.request.assertions ?? []).entries()) {
|
|
41
|
+
validateTracerouteAssertion(diagnostics, assertion, index);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
synthesize() {
|
|
45
|
+
return {
|
|
46
|
+
...super.synthesize(),
|
|
47
|
+
checkType: 'TRACEROUTE',
|
|
48
|
+
request: this.request,
|
|
49
|
+
degradedResponseTime: this.degradedResponseTime,
|
|
50
|
+
maxResponseTime: this.maxResponseTime,
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
//# sourceMappingURL=traceroute-monitor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"traceroute-monitor.js","sourceRoot":"","sources":["../../src/constructs/traceroute-monitor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAgB,MAAM,cAAc,CAAA;AACpD,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AAEtC,OAAO,EAAE,qBAAqB,EAAE,MAAM,kCAAkC,CAAA;AACxE,OAAO,EAAE,2BAA2B,EAAE,MAAM,sCAAsC,CAAA;AAsClF;;GAEG;AACH,MAAM,OAAO,iBAAkB,SAAQ,OAAO;IAC5C,OAAO,CAAmB;IAC1B,oBAAoB,CAAS;IAC7B,eAAe,CAAS;IAExB;;;;;;;OAOG;IAEH,YAAa,SAAiB,EAAE,KAA6B;QAC3D,KAAK,CAAC,SAAS,EAAE,KAAK,CAAC,CAAA;QAEvB,IAAI,CAAC,OAAO,GAAG,KAAK,CAAC,OAAO,CAAA;QAC5B,IAAI,CAAC,oBAAoB,GAAG,KAAK,CAAC,oBAAoB,CAAA;QACtD,IAAI,CAAC,eAAe,GAAG,KAAK,CAAC,eAAe,CAAA;QAE5C,OAAO,CAAC,iBAAiB,CAAC,IAAI,CAAC,CAAA;QAC/B,IAAI,CAAC,gBAAgB,EAAE,CAAA;QACvB,IAAI,CAAC,kCAAkC,EAAE,CAAA;IAC3C,CAAC;IAED,QAAQ;QACN,OAAO,qBAAqB,IAAI,CAAC,SAAS,EAAE,CAAA;IAC9C,CAAC;IAED,KAAK,CAAC,QAAQ,CAAE,WAAwB;QACtC,MAAM,KAAK,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAA;QAEjC,MAAM,qBAAqB,CAAC,WAAW,EAAE,IAAI,EAAE;YAC7C,oBAAoB,EAAE,MAAM;YAC5B,eAAe,EAAE,MAAM;YACvB,2DAA2D;YAC3D,sBAAsB,EAAE,MAAM;SAC/B,CAAC,CAAA;QAEF,KAAK,MAAM,CAAC,KAAK,EAAE,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,UAAU,IAAI,EAAE,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC;YAC3E,2BAA2B,CAAC,WAAW,EAAE,SAAS,EAAE,KAAK,CAAC,CAAA;QAC5D,CAAC;IACH,CAAC;IAED,UAAU;QACR,OAAO;YACL,GAAG,KAAK,CAAC,UAAU,EAAE;YACrB,SAAS,EAAE,YAAY;YACvB,OAAO,EAAE,IAAI,CAAC,OAAO;YACrB,oBAAoB,EAAE,IAAI,CAAC,oBAAoB;YAC/C,eAAe,EAAE,IAAI,CAAC,eAAe;SACtC,CAAA;IACH,CAAC;CACF"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { GeneratedFile, Program, Value } from '../sourcegen/index.js';
|
|
2
|
+
import { TracerouteRequest } from './traceroute-request.js';
|
|
3
|
+
import { Context } from './internal/codegen/index.js';
|
|
4
|
+
export declare function valueForTracerouteRequest(program: Program, genfile: GeneratedFile, context: Context, request: TracerouteRequest): Value;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { object } from '../sourcegen/index.js';
|
|
2
|
+
import { valueForTracerouteAssertion } from './traceroute-assertion-codegen.js';
|
|
3
|
+
export function valueForTracerouteRequest(program, genfile, context, request) {
|
|
4
|
+
return object(builder => {
|
|
5
|
+
builder.string('url', request.url);
|
|
6
|
+
if (request.protocol && request.protocol !== 'TCP') {
|
|
7
|
+
builder.string('protocol', request.protocol);
|
|
8
|
+
}
|
|
9
|
+
// `port` is not sent for ICMP probes (the backend strips it), so only emit
|
|
10
|
+
// it for the protocols that use it.
|
|
11
|
+
if (request.port !== undefined && request.protocol !== 'ICMP') {
|
|
12
|
+
builder.number('port', request.port);
|
|
13
|
+
}
|
|
14
|
+
if (request.ipFamily && request.ipFamily !== 'IPv4') {
|
|
15
|
+
builder.string('ipFamily', request.ipFamily);
|
|
16
|
+
}
|
|
17
|
+
if (request.maxHops !== undefined) {
|
|
18
|
+
builder.number('maxHops', request.maxHops);
|
|
19
|
+
}
|
|
20
|
+
if (request.maxUnknownHops !== undefined) {
|
|
21
|
+
builder.number('maxUnknownHops', request.maxUnknownHops);
|
|
22
|
+
}
|
|
23
|
+
if (request.ptrLookup !== undefined) {
|
|
24
|
+
builder.boolean('ptrLookup', request.ptrLookup);
|
|
25
|
+
}
|
|
26
|
+
if (request.timeout !== undefined) {
|
|
27
|
+
builder.number('timeout', request.timeout);
|
|
28
|
+
}
|
|
29
|
+
if (request.assertions) {
|
|
30
|
+
const assertions = request.assertions;
|
|
31
|
+
if (assertions.length > 0) {
|
|
32
|
+
builder.array('assertions', builder => {
|
|
33
|
+
for (const assertion of assertions) {
|
|
34
|
+
builder.value(valueForTracerouteAssertion(genfile, assertion));
|
|
35
|
+
}
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
//# sourceMappingURL=traceroute-request-codegen.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"traceroute-request-codegen.js","sourceRoot":"","sources":["../../src/constructs/traceroute-request-codegen.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiB,MAAM,EAAkB,MAAM,uBAAuB,CAAA;AAC7E,OAAO,EAAE,2BAA2B,EAAE,MAAM,mCAAmC,CAAA;AAI/E,MAAM,UAAU,yBAAyB,CACvC,OAAgB,EAChB,OAAsB,EACtB,OAAgB,EAChB,OAA0B;IAE1B,OAAO,MAAM,CAAC,OAAO,CAAC,EAAE;QACtB,OAAO,CAAC,MAAM,CAAC,KAAK,EAAE,OAAO,CAAC,GAAG,CAAC,CAAA;QAElC,IAAI,OAAO,CAAC,QAAQ,IAAI,OAAO,CAAC,QAAQ,KAAK,KAAK,EAAE,CAAC;YACnD,OAAO,CAAC,MAAM,CAAC,UAAU,EAAE,OAAO,CAAC,QAAQ,CAAC,CAAA;QAC9C,CAAC;QAED,2EAA2E;QAC3E,oCAAoC;QACpC,IAAI,OAAO,CAAC,IAAI,KAAK,SAAS,IAAI,OAAO,CAAC,QAAQ,KAAK,MAAM,EAAE,CAAC;YAC9D,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,IAAI,CAAC,CAAA;QACtC,CAAC;QAED,IAAI,OAAO,CAAC,QAAQ,IAAI,OAAO,CAAC,QAAQ,KAAK,MAAM,EAAE,CAAC;YACpD,OAAO,CAAC,MAAM,CAAC,UAAU,EAAE,OAAO,CAAC,QAAQ,CAAC,CAAA;QAC9C,CAAC;QAED,IAAI,OAAO,CAAC,OAAO,KAAK,SAAS,EAAE,CAAC;YAClC,OAAO,CAAC,MAAM,CAAC,SAAS,EAAE,OAAO,CAAC,OAAO,CAAC,CAAA;QAC5C,CAAC;QAED,IAAI,OAAO,CAAC,cAAc,KAAK,SAAS,EAAE,CAAC;YACzC,OAAO,CAAC,MAAM,CAAC,gBAAgB,EAAE,OAAO,CAAC,cAAc,CAAC,CAAA;QAC1D,CAAC;QAED,IAAI,OAAO,CAAC,SAAS,KAAK,SAAS,EAAE,CAAC;YACpC,OAAO,CAAC,OAAO,CAAC,WAAW,EAAE,OAAO,CAAC,SAAS,CAAC,CAAA;QACjD,CAAC;QAED,IAAI,OAAO,CAAC,OAAO,KAAK,SAAS,EAAE,CAAC;YAClC,OAAO,CAAC,MAAM,CAAC,SAAS,EAAE,OAAO,CAAC,OAAO,CAAC,CAAA;QAC5C,CAAC;QAED,IAAI,OAAO,CAAC,UAAU,EAAE,CAAC;YACvB,MAAM,UAAU,GAAG,OAAO,CAAC,UAAU,CAAA;YACrC,IAAI,UAAU,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;gBAC1B,OAAO,CAAC,KAAK,CAAC,YAAY,EAAE,OAAO,CAAC,EAAE;oBACpC,KAAK,MAAM,SAAS,IAAI,UAAU,EAAE,CAAC;wBACnC,OAAO,CAAC,KAAK,CAAC,2BAA2B,CAAC,OAAO,EAAE,SAAS,CAAC,CAAC,CAAA;oBAChE,CAAC;gBACH,CAAC,CAAC,CAAA;YACJ,CAAC;QACH,CAAC;IACH,CAAC,CAAC,CAAA;AACJ,CAAC"}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { TracerouteAssertion } from './traceroute-assertion.js';
|
|
2
|
+
import { IPFamily } from './ip.js';
|
|
3
|
+
/**
|
|
4
|
+
* The traceroute probe protocol.
|
|
5
|
+
*
|
|
6
|
+
* - `TCP` sends SYN probes (default).
|
|
7
|
+
* - `UDP` sends datagrams to a high port.
|
|
8
|
+
* - `ICMP` sends Echo Requests.
|
|
9
|
+
* - `SCTP` sends INIT chunks.
|
|
10
|
+
*/
|
|
11
|
+
export type TracerouteProtocol = 'TCP' | 'UDP' | 'ICMP' | 'SCTP';
|
|
12
|
+
/**
|
|
13
|
+
* Configuration for traceroute requests.
|
|
14
|
+
* Defines the probe parameters and validation rules.
|
|
15
|
+
*/
|
|
16
|
+
export interface TracerouteRequest {
|
|
17
|
+
/**
|
|
18
|
+
* The host to trace the network path to. Do not include a scheme or a port in
|
|
19
|
+
* this value.
|
|
20
|
+
*
|
|
21
|
+
* @example "example.com"
|
|
22
|
+
*/
|
|
23
|
+
url: string;
|
|
24
|
+
/**
|
|
25
|
+
* The probe protocol.
|
|
26
|
+
*
|
|
27
|
+
* @defaultValue "TCP"
|
|
28
|
+
*/
|
|
29
|
+
protocol?: TracerouteProtocol;
|
|
30
|
+
/**
|
|
31
|
+
* The destination port for TCP/UDP/SCTP probes. Ignored (and not sent) when
|
|
32
|
+
* `protocol` is `ICMP`.
|
|
33
|
+
*
|
|
34
|
+
* @minimum 1
|
|
35
|
+
* @maximum 65535
|
|
36
|
+
* @defaultValue 443
|
|
37
|
+
*/
|
|
38
|
+
port?: number;
|
|
39
|
+
/**
|
|
40
|
+
* The IP family to use when executing the traceroute.
|
|
41
|
+
*
|
|
42
|
+
* @defaultValue "IPv4"
|
|
43
|
+
*/
|
|
44
|
+
ipFamily?: IPFamily;
|
|
45
|
+
/**
|
|
46
|
+
* The maximum number of network hops to probe before stopping.
|
|
47
|
+
*
|
|
48
|
+
* @minimum 1
|
|
49
|
+
* @maximum 64
|
|
50
|
+
* @defaultValue 30
|
|
51
|
+
*/
|
|
52
|
+
maxHops?: number;
|
|
53
|
+
/**
|
|
54
|
+
* The maximum number of consecutive unresponsive hops to tolerate before
|
|
55
|
+
* stopping the trace.
|
|
56
|
+
*
|
|
57
|
+
* @minimum 1
|
|
58
|
+
* @maximum 30
|
|
59
|
+
* @defaultValue 15
|
|
60
|
+
*/
|
|
61
|
+
maxUnknownHops?: number;
|
|
62
|
+
/**
|
|
63
|
+
* Whether to perform reverse-DNS (PTR) lookups on each hop's IP address.
|
|
64
|
+
*
|
|
65
|
+
* @defaultValue true
|
|
66
|
+
*/
|
|
67
|
+
ptrLookup?: boolean;
|
|
68
|
+
/**
|
|
69
|
+
* The number of seconds to wait for the traceroute to complete before timing
|
|
70
|
+
* out.
|
|
71
|
+
*
|
|
72
|
+
* @minimum 1
|
|
73
|
+
* @maximum 30
|
|
74
|
+
* @defaultValue 10
|
|
75
|
+
*/
|
|
76
|
+
timeout?: number;
|
|
77
|
+
/**
|
|
78
|
+
* Assertions to validate the traceroute response.
|
|
79
|
+
*/
|
|
80
|
+
assertions?: Array<TracerouteAssertion>;
|
|
81
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"traceroute-request.js","sourceRoot":"","sources":["../../src/constructs/traceroute-request.ts"],"names":[],"mappings":""}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { valueForNumericAssertion } from './internal/assertion-codegen.js';
|
|
1
|
+
import { unsupportedAssertionSource, valueForNumericAssertion } from './internal/assertion-codegen.js';
|
|
2
2
|
export function valueForUrlAssertion(genfile, assertion) {
|
|
3
3
|
genfile.namedImport('UrlAssertionBuilder', 'checkly/constructs');
|
|
4
4
|
switch (assertion.source) {
|
|
5
5
|
case 'STATUS_CODE':
|
|
6
6
|
return valueForNumericAssertion('UrlAssertionBuilder', 'statusCode', assertion);
|
|
7
7
|
default:
|
|
8
|
-
|
|
8
|
+
return unsupportedAssertionSource(assertion.source, 'URL');
|
|
9
9
|
}
|
|
10
10
|
}
|
|
11
11
|
//# sourceMappingURL=url-assertion-codegen.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"url-assertion-codegen.js","sourceRoot":"","sources":["../../src/constructs/url-assertion-codegen.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,wBAAwB,EAAE,MAAM,iCAAiC,CAAA;
|
|
1
|
+
{"version":3,"file":"url-assertion-codegen.js","sourceRoot":"","sources":["../../src/constructs/url-assertion-codegen.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,0BAA0B,EAAE,wBAAwB,EAAE,MAAM,iCAAiC,CAAA;AAEtG,MAAM,UAAU,oBAAoB,CAAE,OAAsB,EAAE,SAAuB;IACnF,OAAO,CAAC,WAAW,CAAC,qBAAqB,EAAE,oBAAoB,CAAC,CAAA;IAEhE,QAAQ,SAAS,CAAC,MAAM,EAAE,CAAC;QACzB,KAAK,aAAa;YAChB,OAAO,wBAAwB,CAAC,qBAAqB,EAAE,YAAY,EAAE,SAAS,CAAC,CAAA;QACjF;YACE,OAAO,0BAA0B,CAAC,SAAS,CAAC,MAAM,EAAE,KAAK,CAAC,CAAA;IAC9D,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
export type TruncateOptions = {
|
|
2
|
+
chars?: number;
|
|
3
|
+
lines?: number;
|
|
4
|
+
ending?: string;
|
|
5
|
+
};
|
|
6
|
+
export declare function truncate(val: any, opts: TruncateOptions): {
|
|
7
|
+
truncated: boolean;
|
|
8
|
+
result: string;
|
|
9
|
+
lines: number;
|
|
10
|
+
};
|
|
11
|
+
export type AssertionLike = {
|
|
12
|
+
source?: string;
|
|
13
|
+
property?: string | null;
|
|
14
|
+
comparison?: string;
|
|
15
|
+
target?: unknown;
|
|
16
|
+
regex?: string | null;
|
|
17
|
+
error?: string | null;
|
|
18
|
+
actual?: unknown;
|
|
19
|
+
};
|
|
20
|
+
export type FormatAssertionLineOptions = {
|
|
21
|
+
truncate?: TruncateOptions;
|
|
22
|
+
};
|
|
23
|
+
export declare const assertionSymbols: {
|
|
24
|
+
readonly success: "✔";
|
|
25
|
+
readonly error: "✖";
|
|
26
|
+
};
|
|
27
|
+
export declare function formatAssertionLine(assertion: AssertionLike, options?: FormatAssertionLineOptions): string;
|