checkly 6.9.10 → 7.0.0-prerelease-1df465c
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/assets/runtimes/snapshots/20260130/runtimes.json +349 -0
- package/dist/{rules → ai-context}/checkly.rules.md +72 -34
- package/dist/ai-context/context.d.ts +6 -0
- package/dist/ai-context/context.js +137 -0
- package/dist/ai-context/context.js.map +1 -0
- package/dist/ai-context/skills/monitoring/README.md +44 -0
- package/dist/ai-context/skills/monitoring/SKILL.md +600 -0
- package/dist/auth/index.js +2 -2
- package/dist/auth/index.js.map +1 -1
- package/dist/commands/baseCommand.js +9 -5
- package/dist/commands/baseCommand.js.map +1 -1
- package/dist/commands/debug/parse-file.d.ts +13 -0
- package/dist/commands/debug/parse-file.js +79 -0
- package/dist/commands/debug/parse-file.js.map +1 -0
- package/dist/commands/debug/parse-playwright-config.d.ts +9 -0
- package/dist/commands/debug/parse-playwright-config.js +31 -0
- package/dist/commands/debug/parse-playwright-config.js.map +1 -0
- package/dist/commands/debug/parse-project.d.ts +41 -0
- package/dist/commands/debug/parse-project.js +109 -0
- package/dist/commands/debug/parse-project.js.map +1 -0
- package/dist/commands/deploy.js +41 -7
- package/dist/commands/deploy.js.map +1 -1
- package/dist/commands/import/plan.js +7 -6
- package/dist/commands/import/plan.js.map +1 -1
- package/dist/commands/pw-test.d.ts +3 -2
- package/dist/commands/pw-test.js +65 -17
- package/dist/commands/pw-test.js.map +1 -1
- package/dist/commands/rules.js +1 -1
- package/dist/commands/rules.js.map +1 -1
- package/dist/commands/runtimes.js +1 -1
- package/dist/commands/runtimes.js.map +1 -1
- package/dist/commands/sync-playwright.js +3 -2
- package/dist/commands/sync-playwright.js.map +1 -1
- package/dist/commands/test.js +42 -6
- package/dist/commands/test.js.map +1 -1
- package/dist/commands/validate.js +2 -2
- package/dist/commands/validate.js.map +1 -1
- package/dist/constructs/api-check.js +6 -0
- package/dist/constructs/api-check.js.map +1 -1
- package/dist/constructs/browser-check.d.ts +2 -1
- package/dist/constructs/browser-check.js +7 -3
- package/dist/constructs/browser-check.js.map +1 -1
- package/dist/constructs/check-config.d.ts +2 -3
- package/dist/constructs/check-config.js.map +1 -1
- package/dist/constructs/check-group-v1.js +1 -2
- package/dist/constructs/check-group-v1.js.map +1 -1
- package/dist/constructs/check.d.ts +2 -1
- package/dist/constructs/check.js.map +1 -1
- package/dist/constructs/construct-diagnostics.d.ts +3 -0
- package/dist/constructs/construct-diagnostics.js +14 -1
- package/dist/constructs/construct-diagnostics.js.map +1 -1
- package/dist/constructs/internal/codegen/snippet.js +2 -2
- package/dist/constructs/internal/codegen/snippet.js.map +1 -1
- package/dist/constructs/multi-step-check.d.ts +2 -1
- package/dist/constructs/multi-step-check.js.map +1 -1
- package/dist/constructs/playwright-check-bundle.d.ts +52 -6
- package/dist/constructs/playwright-check-bundle.js +51 -6
- package/dist/constructs/playwright-check-bundle.js.map +1 -1
- package/dist/constructs/playwright-check.d.ts +8 -13
- package/dist/constructs/playwright-check.js +102 -30
- package/dist/constructs/playwright-check.js.map +1 -1
- package/dist/constructs/project.d.ts +11 -1
- package/dist/constructs/project.js +34 -0
- package/dist/constructs/project.js.map +1 -1
- package/dist/helpers/recast-acorn-parser.d.ts +2 -0
- package/dist/helpers/recast-acorn-parser.js +49 -0
- package/dist/helpers/recast-acorn-parser.js.map +1 -0
- package/dist/loader/jiti.js +20 -3
- package/dist/loader/jiti.js.map +1 -1
- package/dist/loader/ts-node.js +10 -0
- package/dist/loader/ts-node.js.map +1 -1
- package/dist/reporters/abstract-list.d.ts +4 -1
- package/dist/reporters/abstract-list.js +4 -2
- package/dist/reporters/abstract-list.js.map +1 -1
- package/dist/reporters/reporter.d.ts +4 -1
- package/dist/reporters/reporter.js +7 -7
- package/dist/reporters/reporter.js.map +1 -1
- package/dist/rest/api.d.ts +1 -0
- package/dist/rest/api.js +27 -3
- package/dist/rest/api.js.map +1 -1
- package/dist/rest/runtimes.d.ts +3 -10
- package/dist/rest/runtimes.js +6 -4
- package/dist/rest/runtimes.js.map +1 -1
- package/dist/runtimes/index.d.ts +2 -0
- package/dist/runtimes/index.js +6 -0
- package/dist/runtimes/index.js.map +1 -0
- package/dist/runtimes/runtime.d.ts +8 -0
- package/dist/runtimes/runtime.js +3 -0
- package/dist/runtimes/runtime.js.map +1 -0
- package/dist/runtimes/snapshot.d.ts +2 -0
- package/dist/runtimes/snapshot.js +16 -0
- package/dist/runtimes/snapshot.js.map +1 -0
- package/dist/services/check-parser/errors.js +1 -0
- package/dist/services/check-parser/errors.js.map +1 -1
- package/dist/services/check-parser/faux-package.d.ts +3 -0
- package/dist/services/check-parser/faux-package.js +19 -0
- package/dist/services/check-parser/faux-package.js.map +1 -0
- package/dist/services/check-parser/package-files/extension.d.ts +3 -1
- package/dist/services/check-parser/package-files/extension.js +11 -2
- package/dist/services/check-parser/package-files/extension.js.map +1 -1
- package/dist/services/check-parser/package-files/json-source-file.d.ts +1 -0
- package/dist/services/check-parser/package-files/json-source-file.js +8 -0
- package/dist/services/check-parser/package-files/json-source-file.js.map +1 -1
- package/dist/services/check-parser/package-files/json-text-source-file-parser.js +2 -1
- package/dist/services/check-parser/package-files/json-text-source-file-parser.js.map +1 -1
- package/dist/services/check-parser/package-files/package-json-file.d.ts +14 -3
- package/dist/services/check-parser/package-files/package-json-file.js +59 -0
- package/dist/services/check-parser/package-files/package-json-file.js.map +1 -1
- package/dist/services/check-parser/package-files/package-manager.d.ts +48 -0
- package/dist/services/check-parser/package-files/package-manager.js +278 -19
- package/dist/services/check-parser/package-files/package-manager.js.map +1 -1
- package/dist/services/check-parser/package-files/paths.d.ts +6 -0
- package/dist/services/check-parser/package-files/paths.js +23 -1
- package/dist/services/check-parser/package-files/paths.js.map +1 -1
- package/dist/services/check-parser/package-files/resolver.d.ts +67 -11
- package/dist/services/check-parser/package-files/resolver.js +168 -23
- package/dist/services/check-parser/package-files/resolver.js.map +1 -1
- package/dist/services/check-parser/package-files/result.d.ts +38 -0
- package/dist/services/check-parser/package-files/result.js +58 -0
- package/dist/services/check-parser/package-files/result.js.map +1 -0
- package/dist/services/check-parser/package-files/workspace.d.ts +60 -0
- package/dist/services/check-parser/package-files/workspace.js +103 -0
- package/dist/services/check-parser/package-files/workspace.js.map +1 -0
- package/dist/services/check-parser/parser.d.ts +27 -6
- package/dist/services/check-parser/parser.js +130 -55
- package/dist/services/check-parser/parser.js.map +1 -1
- package/dist/services/checkly-config-loader.d.ts +4 -0
- package/dist/services/checkly-config-loader.js +26 -3
- package/dist/services/checkly-config-loader.js.map +1 -1
- package/dist/services/playwright-config.js +2 -2
- package/dist/services/playwright-config.js.map +1 -1
- package/dist/services/project-parser.d.ts +4 -1
- package/dist/services/project-parser.js +69 -2
- package/dist/services/project-parser.js.map +1 -1
- package/dist/services/proxy.d.ts +2 -0
- package/dist/services/proxy.js +40 -0
- package/dist/services/proxy.js.map +1 -0
- package/dist/services/shell.d.ts +2 -0
- package/dist/services/shell.js +20 -0
- package/dist/services/shell.js.map +1 -0
- package/dist/services/test-runner.js +1 -1
- package/dist/services/test-runner.js.map +1 -1
- package/dist/services/util.d.ts +2 -4
- package/dist/services/util.js +27 -88
- package/dist/services/util.js.map +1 -1
- package/dist/testing/fixture-sandbox.d.ts +54 -0
- package/dist/testing/fixture-sandbox.js +102 -0
- package/dist/testing/fixture-sandbox.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/oclif.manifest.json +179 -2
- package/package.json +9 -5
|
@@ -0,0 +1,600 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: monitoring
|
|
3
|
+
description: Create and manage monitoring checks using the Checkly CLI. Use when working with API checks, browser checks, URL monitors, Playwright checks, heartbeat monitors, alert channels, dashboards, or status pages.
|
|
4
|
+
allowed-tools: Bash(npx:checkly:*) Bash(npm:create:checkly@latest)
|
|
5
|
+
metadata:
|
|
6
|
+
author: checkly
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# Checkly Monitoring
|
|
10
|
+
|
|
11
|
+
- Refer to docs for Checkly CLI v6.0.0 and above.
|
|
12
|
+
- Check the Checkly CLI output to figure out into which folder the setup was generated.
|
|
13
|
+
- Use the [Checkly CLI reference documentation](https://www.checklyhq.com/docs/cli/overview/).
|
|
14
|
+
- Use the [Checkly construct reference documentation](https://www.checklyhq.com/docs/constructs/overview/).
|
|
15
|
+
- Import and / or require any constructs you need in your code, such as `ApiCheck`, `BrowserCheck`, or `PlaywrightCheck` from the `checkly/constructs` package.
|
|
16
|
+
- Always ground generated code and CLI commands against the official documentation and examples in this file.
|
|
17
|
+
|
|
18
|
+
## Installing the Checkly CLI
|
|
19
|
+
|
|
20
|
+
- ALWAYS use `npm create checkly@latest`.
|
|
21
|
+
- NEVER make up commands that do not exist.
|
|
22
|
+
|
|
23
|
+
## Project Structure
|
|
24
|
+
|
|
25
|
+
- `checkly.config.ts` - Mandatory global project and CLI configuration. We recommend using TypeScript.
|
|
26
|
+
- `*.check.ts|js` - TS / JS files that define the checks.
|
|
27
|
+
- `*.spec.ts|js` - TS / JS files that contain Playwright code for Browser and MultiStep checks.
|
|
28
|
+
- `src/__checks__` - Default directory where all your checks are stored. Use this directory if it already exists, otherwise create a new directory for your checks.
|
|
29
|
+
- `package.json` - Standard NPM project manifest.
|
|
30
|
+
|
|
31
|
+
Here is an example directory tree of what that would look like:
|
|
32
|
+
|
|
33
|
+
.
|
|
34
|
+
|-- checkly.config.ts
|
|
35
|
+
|-- package.json
|
|
36
|
+
`-- src
|
|
37
|
+
`-- __checks__
|
|
38
|
+
|-- alert-channels.ts
|
|
39
|
+
|-- api-check.check.ts
|
|
40
|
+
`-- homepage.spec.ts
|
|
41
|
+
|
|
42
|
+
The `checkly.config.ts` at the root of your project defines a range of defaults for all your checks.
|
|
43
|
+
|
|
44
|
+
**Reference:** https://www.checklyhq.com/docs/constructs/project/
|
|
45
|
+
|
|
46
|
+
```typescript
|
|
47
|
+
import { defineConfig } from 'checkly'
|
|
48
|
+
import { Frequency } from 'checkly/constructs'
|
|
49
|
+
|
|
50
|
+
export default defineConfig({
|
|
51
|
+
projectName: "Production Monitoring Suite",
|
|
52
|
+
logicalId: "prod-monitoring-2025",
|
|
53
|
+
repoUrl: "https://github.com/acme/monitoring",
|
|
54
|
+
checks: {
|
|
55
|
+
activated: true,
|
|
56
|
+
muted: false,
|
|
57
|
+
runtimeId: "2025.04",
|
|
58
|
+
frequency: Frequency.EVERY_10M,
|
|
59
|
+
locations: ["us-east-1", "eu-west-1", "ap-southeast-1"],
|
|
60
|
+
tags: ["production", "critical"],
|
|
61
|
+
checkMatch: "**/__checks__/*.check.ts",
|
|
62
|
+
ignoreDirectoriesMatch: ["node_modules/**", "dist/**"],
|
|
63
|
+
playwrightConfig: {
|
|
64
|
+
use: {
|
|
65
|
+
baseURL: "https://app.example.com",
|
|
66
|
+
},
|
|
67
|
+
},
|
|
68
|
+
browserChecks: {
|
|
69
|
+
frequency: Frequency.EVERY_30M,
|
|
70
|
+
testMatch: "**/__tests__/*.spec.ts",
|
|
71
|
+
},
|
|
72
|
+
},
|
|
73
|
+
cli: {
|
|
74
|
+
runLocation: "eu-west-1",
|
|
75
|
+
privateRunLocation: "private-dc1",
|
|
76
|
+
retries: 2,
|
|
77
|
+
},
|
|
78
|
+
})
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
## Check and Monitor Constructs
|
|
82
|
+
|
|
83
|
+
### API Check
|
|
84
|
+
|
|
85
|
+
- Import the `ApiCheck` construct from `checkly/constructs`.
|
|
86
|
+
- When adding `assertions`, always use `AssertionBuilder` class for API Checks.
|
|
87
|
+
- When referencing environment variables always use the handlebar syntax `{{MY_ENV_VAR}}`.
|
|
88
|
+
- When referencing secrets always use the handlebar syntax `{{MY_SECRET}}`.
|
|
89
|
+
- If endpoints require authentication ask the user which authentication method to use and then generate a setupScript to authenticate the given requests.
|
|
90
|
+
- Referenced `setupScript.ts` and `teardownScript.ts` for API checks must be plain ts files and not export anything.
|
|
91
|
+
- Check in the code if API endpoints require authentication.
|
|
92
|
+
|
|
93
|
+
**Reference:** https://www.checklyhq.com/docs/constructs/api-check/
|
|
94
|
+
|
|
95
|
+
```typescript
|
|
96
|
+
import { AlertEscalationBuilder, ApiCheck, Frequency, RetryStrategyBuilder } from 'checkly/constructs'
|
|
97
|
+
|
|
98
|
+
new ApiCheck('example-api-check', {
|
|
99
|
+
name: 'Example API Check',
|
|
100
|
+
request: {
|
|
101
|
+
url: 'https://api.example.com/v1/products',
|
|
102
|
+
method: 'GET',
|
|
103
|
+
ipFamily: 'IPv4',
|
|
104
|
+
},
|
|
105
|
+
setupScript: {
|
|
106
|
+
entrypoint: './setup-script.ts',
|
|
107
|
+
},
|
|
108
|
+
tearDownScript: {
|
|
109
|
+
entrypoint: './teardown-script.ts',
|
|
110
|
+
},
|
|
111
|
+
degradedResponseTime: 5000,
|
|
112
|
+
maxResponseTime: 20000,
|
|
113
|
+
activated: true,
|
|
114
|
+
muted: false,
|
|
115
|
+
shouldFail: false,
|
|
116
|
+
locations: [
|
|
117
|
+
'eu-central-1',
|
|
118
|
+
'eu-west-2',
|
|
119
|
+
],
|
|
120
|
+
frequency: Frequency.EVERY_5M,
|
|
121
|
+
alertEscalationPolicy: AlertEscalationBuilder.runBasedEscalation(1, {
|
|
122
|
+
amount: 0,
|
|
123
|
+
interval: 5,
|
|
124
|
+
}, {
|
|
125
|
+
enabled: false,
|
|
126
|
+
percentage: 10,
|
|
127
|
+
}),
|
|
128
|
+
retryStrategy: RetryStrategyBuilder.linearStrategy({
|
|
129
|
+
baseBackoffSeconds: 60,
|
|
130
|
+
maxRetries: 2,
|
|
131
|
+
maxDurationSeconds: 600,
|
|
132
|
+
sameRegion: true,
|
|
133
|
+
}),
|
|
134
|
+
runParallel: true,
|
|
135
|
+
})
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
#### Authentication Setup Scripts for API Checks
|
|
139
|
+
|
|
140
|
+
- Setup scripts should be flat scripts, no functions, no exports, they will be executed straight by Checkly.
|
|
141
|
+
- Use axios for making HTTP requests.
|
|
142
|
+
- Read the input credentials from env variables using `process.env`.
|
|
143
|
+
- Pass auth tokens to the request object using `request.headers['key'] = AUTH_TOKEN_VALUE`.
|
|
144
|
+
|
|
145
|
+
### Browser Check
|
|
146
|
+
|
|
147
|
+
- Import the `BrowserCheck` construct from `checkly/constructs`.
|
|
148
|
+
- Generate a separate `.spec.ts` file for the Playwright code referenced in the `BrowserCheck` construct.
|
|
149
|
+
- Use the `code.entrypoint` property to specify the path to your Playwright test file.
|
|
150
|
+
|
|
151
|
+
**Reference:** https://www.checklyhq.com/docs/constructs/browser-check/
|
|
152
|
+
|
|
153
|
+
```typescript
|
|
154
|
+
import { AlertEscalationBuilder, BrowserCheck, Frequency, RetryStrategyBuilder } from 'checkly/constructs'
|
|
155
|
+
|
|
156
|
+
new BrowserCheck('example-browser-check', {
|
|
157
|
+
name: 'Example Browser Check',
|
|
158
|
+
code: {
|
|
159
|
+
entrypoint: './example-browser-check.spec.ts',
|
|
160
|
+
},
|
|
161
|
+
activated: false,
|
|
162
|
+
muted: false,
|
|
163
|
+
shouldFail: false,
|
|
164
|
+
locations: [
|
|
165
|
+
'eu-central-1',
|
|
166
|
+
'eu-west-2',
|
|
167
|
+
],
|
|
168
|
+
frequency: Frequency.EVERY_10M,
|
|
169
|
+
alertEscalationPolicy: AlertEscalationBuilder.runBasedEscalation(1, {
|
|
170
|
+
amount: 0,
|
|
171
|
+
interval: 5,
|
|
172
|
+
}, {
|
|
173
|
+
enabled: false,
|
|
174
|
+
percentage: 10,
|
|
175
|
+
}),
|
|
176
|
+
retryStrategy: RetryStrategyBuilder.linearStrategy({
|
|
177
|
+
baseBackoffSeconds: 60,
|
|
178
|
+
maxRetries: 2,
|
|
179
|
+
maxDurationSeconds: 600,
|
|
180
|
+
sameRegion: true,
|
|
181
|
+
}),
|
|
182
|
+
runParallel: true,
|
|
183
|
+
})
|
|
184
|
+
```
|
|
185
|
+
|
|
186
|
+
### Playwright Check Suite
|
|
187
|
+
|
|
188
|
+
- Import the `PlaywrightCheck` construct from `checkly/constructs`.
|
|
189
|
+
- use `pwProjects` if your tasked to reuse a Playwright project.
|
|
190
|
+
|
|
191
|
+
**Reference:** https://www.checklyhq.com/docs/constructs/playwright-check/
|
|
192
|
+
|
|
193
|
+
```typescript
|
|
194
|
+
import { PlaywrightCheck } from "checkly/constructs"
|
|
195
|
+
|
|
196
|
+
const playwrightChecks = new PlaywrightCheck("multi-browser-check", {
|
|
197
|
+
name: "Multi-browser check suite",
|
|
198
|
+
playwrightConfigPath: "./playwright.config.ts",
|
|
199
|
+
// Playwright Check Suites support all browsers
|
|
200
|
+
// defined in your `playwright.config`
|
|
201
|
+
pwProjects: ["chromium", "firefox", "webkit"],
|
|
202
|
+
});
|
|
203
|
+
```
|
|
204
|
+
|
|
205
|
+
### MultiStep Check
|
|
206
|
+
|
|
207
|
+
- Import the `MultiStepCheck` construct from `checkly/constructs`.
|
|
208
|
+
- Generate a separate `.spec.ts` file for the Playwright code referenced in the `MultiStepCheck` construct.
|
|
209
|
+
- Use the `code.entrypoint` property to specify the path to your Playwright test file.
|
|
210
|
+
|
|
211
|
+
**Reference:** https://www.checklyhq.com/docs/constructs/multistep-check/
|
|
212
|
+
|
|
213
|
+
```typescript
|
|
214
|
+
import { AlertEscalationBuilder, Frequency, MultiStepCheck, RetryStrategyBuilder } from 'checkly/constructs'
|
|
215
|
+
|
|
216
|
+
new MultiStepCheck('example-multi-step-check', {
|
|
217
|
+
name: 'Example Multistep Check',
|
|
218
|
+
code: {
|
|
219
|
+
entrypoint: './example-multistep-check.spec.ts',
|
|
220
|
+
},
|
|
221
|
+
activated: true,
|
|
222
|
+
muted: false,
|
|
223
|
+
shouldFail: false,
|
|
224
|
+
locations: [
|
|
225
|
+
'eu-central-1',
|
|
226
|
+
'eu-west-2',
|
|
227
|
+
],
|
|
228
|
+
frequency: Frequency.EVERY_1H,
|
|
229
|
+
alertEscalationPolicy: AlertEscalationBuilder.runBasedEscalation(1, {
|
|
230
|
+
amount: 0,
|
|
231
|
+
interval: 5,
|
|
232
|
+
}, {
|
|
233
|
+
enabled: false,
|
|
234
|
+
percentage: 10,
|
|
235
|
+
}),
|
|
236
|
+
retryStrategy: RetryStrategyBuilder.noRetries(),
|
|
237
|
+
runParallel: true,
|
|
238
|
+
})
|
|
239
|
+
```
|
|
240
|
+
|
|
241
|
+
### TCP Monitor
|
|
242
|
+
|
|
243
|
+
- Import the `TcpMonitor` construct from `checkly/constructs`.
|
|
244
|
+
- When adding `assertions`, always use `TcpAssertionBuilder` class for TCP monitors.
|
|
245
|
+
|
|
246
|
+
**Reference:** https://www.checklyhq.com/docs/constructs/tcp-monitor/
|
|
247
|
+
|
|
248
|
+
```typescript
|
|
249
|
+
import { AlertEscalationBuilder, Frequency, RetryStrategyBuilder, TcpAssertionBuilder, TcpMonitor } from 'checkly/constructs'
|
|
250
|
+
|
|
251
|
+
new TcpMonitor('example-tcp-monitor', {
|
|
252
|
+
name: 'Example TCP Monitor',
|
|
253
|
+
request: {
|
|
254
|
+
hostname: 'tcp.example.com',
|
|
255
|
+
port: 4242,
|
|
256
|
+
ipFamily: 'IPv4',
|
|
257
|
+
assertions: [
|
|
258
|
+
TcpAssertionBuilder.responseTime().lessThan(200),
|
|
259
|
+
TcpAssertionBuilder.responseData().isEmpty(),
|
|
260
|
+
],
|
|
261
|
+
},
|
|
262
|
+
degradedResponseTime: 5000,
|
|
263
|
+
maxResponseTime: 5000,
|
|
264
|
+
activated: true,
|
|
265
|
+
muted: false,
|
|
266
|
+
shouldFail: false,
|
|
267
|
+
locations: [
|
|
268
|
+
'eu-central-1',
|
|
269
|
+
'eu-west-2',
|
|
270
|
+
],
|
|
271
|
+
frequency: Frequency.EVERY_1H,
|
|
272
|
+
alertEscalationPolicy: AlertEscalationBuilder.runBasedEscalation(1, {
|
|
273
|
+
amount: 0,
|
|
274
|
+
interval: 5,
|
|
275
|
+
}, {
|
|
276
|
+
enabled: false,
|
|
277
|
+
percentage: 10,
|
|
278
|
+
}),
|
|
279
|
+
retryStrategy: RetryStrategyBuilder.linearStrategy({
|
|
280
|
+
baseBackoffSeconds: 60,
|
|
281
|
+
maxRetries: 2,
|
|
282
|
+
maxDurationSeconds: 600,
|
|
283
|
+
sameRegion: true,
|
|
284
|
+
}),
|
|
285
|
+
runParallel: true,
|
|
286
|
+
})
|
|
287
|
+
```
|
|
288
|
+
|
|
289
|
+
### URL Monitor
|
|
290
|
+
|
|
291
|
+
- Import the `UrlMonitor` construct from `checkly/constructs`.
|
|
292
|
+
- When adding `assertions`, always use `UrlAssertionBuilder`.
|
|
293
|
+
|
|
294
|
+
**Reference:** https://www.checklyhq.com/docs/constructs/url-monitor/
|
|
295
|
+
|
|
296
|
+
```typescript
|
|
297
|
+
import { AlertEscalationBuilder, Frequency, RetryStrategyBuilder, UrlAssertionBuilder, UrlMonitor } from 'checkly/constructs'
|
|
298
|
+
|
|
299
|
+
new UrlMonitor('example-url-monitor', {
|
|
300
|
+
name: 'Example URL Monitor',
|
|
301
|
+
request: {
|
|
302
|
+
url: 'https://example.com',
|
|
303
|
+
ipFamily: 'IPv4',
|
|
304
|
+
assertions: [
|
|
305
|
+
UrlAssertionBuilder.statusCode().equals(200),
|
|
306
|
+
],
|
|
307
|
+
},
|
|
308
|
+
degradedResponseTime: 5000,
|
|
309
|
+
maxResponseTime: 20000,
|
|
310
|
+
activated: true,
|
|
311
|
+
muted: false,
|
|
312
|
+
shouldFail: false,
|
|
313
|
+
locations: [
|
|
314
|
+
'eu-central-1',
|
|
315
|
+
'eu-west-2',
|
|
316
|
+
],
|
|
317
|
+
frequency: Frequency.EVERY_5M,
|
|
318
|
+
alertEscalationPolicy: AlertEscalationBuilder.runBasedEscalation(1, {
|
|
319
|
+
amount: 0,
|
|
320
|
+
interval: 5,
|
|
321
|
+
}, {
|
|
322
|
+
enabled: false,
|
|
323
|
+
percentage: 10,
|
|
324
|
+
}),
|
|
325
|
+
retryStrategy: RetryStrategyBuilder.linearStrategy({
|
|
326
|
+
baseBackoffSeconds: 60,
|
|
327
|
+
maxRetries: 2,
|
|
328
|
+
maxDurationSeconds: 600,
|
|
329
|
+
sameRegion: true,
|
|
330
|
+
}),
|
|
331
|
+
runParallel: true,
|
|
332
|
+
})
|
|
333
|
+
```
|
|
334
|
+
|
|
335
|
+
### DNS Monitor
|
|
336
|
+
|
|
337
|
+
- Import the `DnsMonitor` construct from `checkly/constructs`.
|
|
338
|
+
- Reference [the docs for DNS monitors](https://www.checklyhq.com/docs/constructs/dns-monitor/) before generating any code.
|
|
339
|
+
- When adding `assertions`, always use `DnsAssertionBuilder` class.
|
|
340
|
+
|
|
341
|
+
**Reference:** https://www.checklyhq.com/docs/constructs/dns-monitor/
|
|
342
|
+
|
|
343
|
+
```typescript
|
|
344
|
+
import { AlertEscalationBuilder, DnsAssertionBuilder, DnsMonitor, Frequency, RetryStrategyBuilder } from 'checkly/constructs'
|
|
345
|
+
|
|
346
|
+
new DnsMonitor('example-dns-monitor', {
|
|
347
|
+
name: 'Example DNS Monitor',
|
|
348
|
+
request: {
|
|
349
|
+
recordType: 'AAAA',
|
|
350
|
+
query: 'welcome.checklyhq.com',
|
|
351
|
+
assertions: [
|
|
352
|
+
DnsAssertionBuilder.responseCode().equals('NOERROR'),
|
|
353
|
+
],
|
|
354
|
+
},
|
|
355
|
+
degradedResponseTime: 500,
|
|
356
|
+
maxResponseTime: 1000,
|
|
357
|
+
activated: true,
|
|
358
|
+
muted: false,
|
|
359
|
+
shouldFail: false,
|
|
360
|
+
locations: [
|
|
361
|
+
'eu-central-1',
|
|
362
|
+
'eu-north-1',
|
|
363
|
+
],
|
|
364
|
+
frequency: Frequency.EVERY_10M,
|
|
365
|
+
alertEscalationPolicy: AlertEscalationBuilder.runBasedEscalation(1, {
|
|
366
|
+
amount: 0,
|
|
367
|
+
interval: 5,
|
|
368
|
+
}, {
|
|
369
|
+
enabled: false,
|
|
370
|
+
percentage: 10,
|
|
371
|
+
}),
|
|
372
|
+
retryStrategy: RetryStrategyBuilder.noRetries(),
|
|
373
|
+
runParallel: false,
|
|
374
|
+
})
|
|
375
|
+
```
|
|
376
|
+
|
|
377
|
+
### Heartbeat Monitor
|
|
378
|
+
|
|
379
|
+
- Import the `HeartbeatMonitor` construct from `checkly/constructs`.
|
|
380
|
+
|
|
381
|
+
**Reference:** https://www.checklyhq.com/docs/constructs/heartbeat-monitor/
|
|
382
|
+
|
|
383
|
+
```typescript
|
|
384
|
+
import { AlertEscalationBuilder, Frequency, HeartbeatMonitor, RetryStrategyBuilder } from 'checkly/constructs'
|
|
385
|
+
|
|
386
|
+
new HeartbeatMonitor('example-heartbeat-monitor', {
|
|
387
|
+
name: 'Example Heartbeat Monitor',
|
|
388
|
+
period: 1,
|
|
389
|
+
periodUnit: 'hours',
|
|
390
|
+
grace: 30,
|
|
391
|
+
graceUnit: 'minutes',
|
|
392
|
+
activated: true,
|
|
393
|
+
muted: false,
|
|
394
|
+
shouldFail: false,
|
|
395
|
+
frequency: Frequency.EVERY_10S,
|
|
396
|
+
alertEscalationPolicy: AlertEscalationBuilder.runBasedEscalation(1, {
|
|
397
|
+
amount: 0,
|
|
398
|
+
interval: 5,
|
|
399
|
+
}, {
|
|
400
|
+
enabled: false,
|
|
401
|
+
percentage: 10,
|
|
402
|
+
}),
|
|
403
|
+
retryStrategy: RetryStrategyBuilder.linearStrategy({
|
|
404
|
+
baseBackoffSeconds: 60,
|
|
405
|
+
maxRetries: 2,
|
|
406
|
+
maxDurationSeconds: 600,
|
|
407
|
+
sameRegion: true,
|
|
408
|
+
}),
|
|
409
|
+
runParallel: true,
|
|
410
|
+
})
|
|
411
|
+
```
|
|
412
|
+
|
|
413
|
+
### Check Group
|
|
414
|
+
|
|
415
|
+
- Import the `CheckGroupV2` construct from `checkly/constructs`.
|
|
416
|
+
- Check Groups are used to group checks together for easier management and organization.
|
|
417
|
+
- Checks are added to Check Groups by referencing the group in the `group` property of a check.
|
|
418
|
+
|
|
419
|
+
**Reference:** https://www.checklyhq.com/docs/constructs/check-group/
|
|
420
|
+
|
|
421
|
+
```typescript
|
|
422
|
+
import { CheckGroupV2 } from 'checkly/constructs'
|
|
423
|
+
|
|
424
|
+
export const exampleGroup = new CheckGroupV2('example-group', {
|
|
425
|
+
name: 'Example Group',
|
|
426
|
+
})
|
|
427
|
+
```
|
|
428
|
+
|
|
429
|
+
## Alert Channel Constructs
|
|
430
|
+
|
|
431
|
+
- Alert channels are used to send notifications when checks and monitors fail or recover.
|
|
432
|
+
- Alert channels are added to checks, monitors, and check groups constructs by adding them to the `alertChannels` array property.
|
|
433
|
+
|
|
434
|
+
Here are some examples of how to create different types of alert channels. All alert are described in the [Checkly docs](https://www.checklyhq.com/docs/constructs/overview/).
|
|
435
|
+
|
|
436
|
+
### Email Alert Channel
|
|
437
|
+
|
|
438
|
+
**Reference:** https://www.checklyhq.com/docs/constructs/email-alert-channel/
|
|
439
|
+
|
|
440
|
+
```typescript
|
|
441
|
+
import { EmailAlertChannel } from 'checkly/constructs'
|
|
442
|
+
|
|
443
|
+
export const testEmailAlert = new EmailAlertChannel('example-email-alert-channel', {
|
|
444
|
+
address: 'test@example.com',
|
|
445
|
+
sslExpiry: true,
|
|
446
|
+
})
|
|
447
|
+
```
|
|
448
|
+
|
|
449
|
+
|
|
450
|
+
### Phone Call Alert Channel
|
|
451
|
+
|
|
452
|
+
**Reference:** https://www.checklyhq.com/docs/constructs/phone-call-alert-channel/
|
|
453
|
+
|
|
454
|
+
```typescript
|
|
455
|
+
import { PhoneCallAlertChannel } from 'checkly/constructs'
|
|
456
|
+
|
|
457
|
+
export const testUserPhoneCallAlert = new PhoneCallAlertChannel('example-call-alert-channel', {
|
|
458
|
+
name: 'Test User',
|
|
459
|
+
phoneNumber: '+311234567890',
|
|
460
|
+
})
|
|
461
|
+
```
|
|
462
|
+
|
|
463
|
+
|
|
464
|
+
### Slack Alert Channel
|
|
465
|
+
|
|
466
|
+
**Reference:** https://www.checklyhq.com/docs/constructs/slack-alert-channel/
|
|
467
|
+
|
|
468
|
+
```typescript
|
|
469
|
+
import { SlackAlertChannel } from 'checkly/constructs'
|
|
470
|
+
|
|
471
|
+
export const generalSlackAlert = new SlackAlertChannel('example-slack-alert-channel', {
|
|
472
|
+
url: 'https://hooks.slack.com/services/TK123456789123/12345/123456789',
|
|
473
|
+
channel: '#general',
|
|
474
|
+
})
|
|
475
|
+
```
|
|
476
|
+
|
|
477
|
+
|
|
478
|
+
## Supporting Constructs
|
|
479
|
+
|
|
480
|
+
### Status Page
|
|
481
|
+
|
|
482
|
+
- Import the `StatusPage` construct from `checkly/constructs`.
|
|
483
|
+
- Status pages are used to display the status of your services to your users.
|
|
484
|
+
- A Status Page consists of cards which include Status Page Services.
|
|
485
|
+
|
|
486
|
+
**Reference:** https://www.checklyhq.com/docs/constructs/status-page/
|
|
487
|
+
|
|
488
|
+
```typescript
|
|
489
|
+
import { StatusPage } from 'checkly/constructs'
|
|
490
|
+
import { exampleService } from './services/example-service.check'
|
|
491
|
+
|
|
492
|
+
new StatusPage('example-status-page', {
|
|
493
|
+
name: 'Example Status Page',
|
|
494
|
+
url: 'example-status-page',
|
|
495
|
+
cards: [
|
|
496
|
+
{
|
|
497
|
+
name: 'Example service',
|
|
498
|
+
services: [
|
|
499
|
+
exampleService,
|
|
500
|
+
],
|
|
501
|
+
},
|
|
502
|
+
],
|
|
503
|
+
customDomain: 'status.example.com',
|
|
504
|
+
defaultTheme: 'AUTO',
|
|
505
|
+
})
|
|
506
|
+
```
|
|
507
|
+
|
|
508
|
+
### Status Page Service
|
|
509
|
+
|
|
510
|
+
- Import the `StatusPageService` construct from `checkly/constructs`.
|
|
511
|
+
- Status Page Services are used to represent individual services on a Status Page.
|
|
512
|
+
|
|
513
|
+
**Reference:** https://www.checklyhq.com/docs/constructs/status-page-service/
|
|
514
|
+
|
|
515
|
+
```typescript
|
|
516
|
+
import { StatusPageService } from 'checkly/constructs'
|
|
517
|
+
|
|
518
|
+
export const exampleService = new StatusPageService('example-status-page-service', {
|
|
519
|
+
name: 'Example Service',
|
|
520
|
+
})
|
|
521
|
+
```
|
|
522
|
+
|
|
523
|
+
### Dashboard
|
|
524
|
+
|
|
525
|
+
- Import the `Dashboard` construct from `checkly/constructs`.
|
|
526
|
+
- Dashboards are used to display the results of your checks on screens external to Checkly.
|
|
527
|
+
|
|
528
|
+
**Reference:** https://www.checklyhq.com/docs/constructs/dashboard/
|
|
529
|
+
|
|
530
|
+
```typescript
|
|
531
|
+
import { Dashboard } from 'checkly/constructs'
|
|
532
|
+
|
|
533
|
+
new Dashboard('example-dashboard', {
|
|
534
|
+
tags: [
|
|
535
|
+
'app:webshop',
|
|
536
|
+
],
|
|
537
|
+
customUrl: 'example-dashboard',
|
|
538
|
+
customDomain: 'dash.example.com',
|
|
539
|
+
header: 'Example Dashboard',
|
|
540
|
+
description: 'Example dashboard',
|
|
541
|
+
width: 'FULL',
|
|
542
|
+
refreshRate: 60,
|
|
543
|
+
paginate: true,
|
|
544
|
+
paginationRate: 60,
|
|
545
|
+
checksPerPage: 15,
|
|
546
|
+
useTagsAndOperator: false,
|
|
547
|
+
hideTags: false,
|
|
548
|
+
enableIncidents: false,
|
|
549
|
+
expandChecks: false,
|
|
550
|
+
showHeader: true,
|
|
551
|
+
isPrivate: false,
|
|
552
|
+
showP95: true,
|
|
553
|
+
showP99: true,
|
|
554
|
+
})
|
|
555
|
+
```
|
|
556
|
+
|
|
557
|
+
### Maintenance Window
|
|
558
|
+
|
|
559
|
+
- Import the `MaintenanceWindow` construct from `checkly/constructs`.
|
|
560
|
+
- Maintenance windows are used to pause checks during maintenance periods so no alerts are sent.
|
|
561
|
+
- Checks are referenced by their tags in the `tags` property.
|
|
562
|
+
|
|
563
|
+
**Reference:** https://www.checklyhq.com/docs/constructs/maintenance-window/
|
|
564
|
+
|
|
565
|
+
```typescript
|
|
566
|
+
import { MaintenanceWindow } from 'checkly/constructs'
|
|
567
|
+
|
|
568
|
+
new MaintenanceWindow('example-maintenance-window', {
|
|
569
|
+
name: 'Example Maintenance Window',
|
|
570
|
+
tags: [
|
|
571
|
+
'app:webshop',
|
|
572
|
+
],
|
|
573
|
+
startsAt: new Date('2025-07-01T09:00:00.000Z'),
|
|
574
|
+
endsAt: new Date('2025-07-01T10:00:00.000Z'),
|
|
575
|
+
repeatInterval: 1,
|
|
576
|
+
repeatUnit: 'WEEK',
|
|
577
|
+
repeatEndsAt: new Date('2025-08-01T00:00:00.000Z'),
|
|
578
|
+
})
|
|
579
|
+
```
|
|
580
|
+
|
|
581
|
+
### Private Location
|
|
582
|
+
|
|
583
|
+
- Import the `PrivateLocation` construct from `checkly/constructs`.
|
|
584
|
+
- Private locations are used to run checks from your own infrastructure with the Checkly Agent, an OCI compatible container.
|
|
585
|
+
|
|
586
|
+
**Reference:** https://www.checklyhq.com/docs/constructs/private-location/
|
|
587
|
+
|
|
588
|
+
```typescript
|
|
589
|
+
import { PrivateLocation } from 'checkly/constructs'
|
|
590
|
+
|
|
591
|
+
export const examplePrivateLocation = new PrivateLocation('example-private-location', {
|
|
592
|
+
name: 'Example Private Location',
|
|
593
|
+
slugName: 'example-private-location',
|
|
594
|
+
icon: 'location',
|
|
595
|
+
})
|
|
596
|
+
```
|
|
597
|
+
|
|
598
|
+
## Testing and Debugging
|
|
599
|
+
|
|
600
|
+
- Test checks using `npx checkly test` command pass env variables using `-e` param, use `--record` to persist results and `--verbose` to be able to see all errors
|
package/dist/auth/index.js
CHANGED
|
@@ -33,7 +33,7 @@ const http = __importStar(require("http"));
|
|
|
33
33
|
const crypto = __importStar(require("crypto"));
|
|
34
34
|
const jwt_decode_1 = __importDefault(require("jwt-decode"));
|
|
35
35
|
const api_1 = require("../rest/api");
|
|
36
|
-
const
|
|
36
|
+
const proxy_1 = require("../services/proxy");
|
|
37
37
|
const fs = __importStar(require("fs"));
|
|
38
38
|
const path = __importStar(require("path"));
|
|
39
39
|
const AUTH0_CLIENT_ID = 'mBtwLFVm39GVZ1HpSRBSdRiLFucYxmMb';
|
|
@@ -241,7 +241,7 @@ class AuthContext {
|
|
|
241
241
|
get #axiosInstance() {
|
|
242
242
|
// Keep axios instance stateless
|
|
243
243
|
const { baseURL } = (0, api_1.getDefaults)();
|
|
244
|
-
const axiosConf = (0,
|
|
244
|
+
const axiosConf = (0, proxy_1.assignProxy)(baseURL, {
|
|
245
245
|
baseURL,
|
|
246
246
|
headers: {
|
|
247
247
|
Accept: 'application/json, text/plain, */*',
|
package/dist/auth/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/auth/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,kDAA8C;AAC9C,uCAAwB;AACxB,2CAA4B;AAC5B,+CAAgC;AAChC,4DAAkC;AAClC,qCAA2D;AAC3D,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/auth/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,kDAA8C;AAC9C,uCAAwB;AACxB,2CAA4B;AAC5B,+CAAgC;AAChC,4DAAkC;AAClC,qCAA2D;AAC3D,6CAA+C;AAC/C,uCAAwB;AACxB,2CAA4B;AAI5B,MAAM,eAAe,GAAG,kCAAkC,CAAA;AAC1D,MAAM,uBAAuB,GAAG,sCAAsC,CAAA;AACtE,MAAM,YAAY,GAAG,sBAAsB,CAAA;AAC3C,MAAM,kBAAkB,GAAG,uBAAuB,CAAA;AAElD,SAAgB,YAAY;IAC1B,MAAM,YAAY,GAAG,MAAM;SACxB,WAAW,CAAC,EAAE,CAAC;SACf,QAAQ,CAAC,QAAQ,CAAC;SAClB,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC;SACnB,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC;SACnB,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CAAA;IAErB,MAAM,aAAa,GAAG,MAAM;SACzB,UAAU,CAAC,QAAQ,CAAC;SACpB,MAAM,CAAC,YAAY,CAAC;SACpB,MAAM,CAAC,QAAQ,CA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A;YACb,CAAC;QACH,CAAC;QAED,MAAM,UAAU,GAAG,iBAAiB,EAAE,CAAC,QAAQ,EAAE,GAAG,CAAA;QAEpD,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,2BAA2B,UAAU,EAAE,CAAC,CAAA;QAExF,OAAO,IAAI,CAAA;IACb,CAAC;IAED,KAAK,CAAC,UAAU;QACd,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC,WAAW,CAAC,CAAA;QAE3D,OAAO,IAAI,CAAA;IACb,CAAC;IAED,KAAK,CAAC,aAAa;QACjB,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,SAAS,EAAE,EAAE,WAAW,EAAE,IAAI,CAAC,YAAY,EAAE,CAAC,CAAA;QAE9F,OAAO,IAAI,CAAA;IACb,CAAC;IAED,IAAI,cAAc;QAChB,gCAAgC;QAChC,MAAM,EAAE,OAAO,EAAE,GAAG,IAAA,iBAAc,GAAE,CAAA;QACpC,MAAM,SAAS,GAAG,IAAA,mBAAW,EAAC,OAAO,EAAE;YACrC,OAAO;YACP,OAAO,EAAE;gBACP,MAAM,EAAE,mCAAmC;gBAC3C,aAAa,EAAE,UAAU,IAAI,CAAC,YAAY,EAAE;aAC7C;SACF,CAAC,CAAA;QAEF,OAAO,eAAK,CAAC,MAAM,CAAC,SAAS,CAAC,CAAA;IAChC,CAAC;CACF;AA9ND,kCA8NC"}
|
|
@@ -9,7 +9,7 @@ const prompts_1 = __importDefault(require("prompts"));
|
|
|
9
9
|
const core_1 = require("@oclif/core");
|
|
10
10
|
const api_1 = require("../rest/api");
|
|
11
11
|
const command_style_1 = require("../helpers/command-style");
|
|
12
|
-
const
|
|
12
|
+
const package_manager_1 = require("../services/check-parser/package-files/package-manager");
|
|
13
13
|
class BaseCommand extends core_1.Command {
|
|
14
14
|
static coreCommand = false;
|
|
15
15
|
static hidden = true;
|
|
@@ -17,11 +17,15 @@ class BaseCommand extends core_1.Command {
|
|
|
17
17
|
style = new command_style_1.CommandStyle(this);
|
|
18
18
|
#packageJsonLoader;
|
|
19
19
|
async loadPackageJsonOfSelf() {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
20
|
+
try {
|
|
21
|
+
if (!this.#packageJsonLoader) {
|
|
22
|
+
this.#packageJsonLoader = (0, package_manager_1.detectNearestPackageJson)(__dirname);
|
|
23
|
+
}
|
|
24
|
+
return await this.#packageJsonLoader;
|
|
25
|
+
}
|
|
26
|
+
catch {
|
|
27
|
+
return;
|
|
23
28
|
}
|
|
24
|
-
return await this.#packageJsonLoader;
|
|
25
29
|
}
|
|
26
30
|
async checkEngineCompatibility() {
|
|
27
31
|
const nodeVersion = process.versions.node;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"baseCommand.js","sourceRoot":"","sources":["../../src/commands/baseCommand.ts"],"names":[],"mappings":";;;;;;AAAA,kDAAyB;AACzB,sDAA6B;AAC7B,sCAAqC;AACrC,qCAAiC;AACjC,4DAAuD;
|
|
1
|
+
{"version":3,"file":"baseCommand.js","sourceRoot":"","sources":["../../src/commands/baseCommand.ts"],"names":[],"mappings":";;;;;;AAAA,kDAAyB;AACzB,sDAA6B;AAC7B,sCAAqC;AACrC,qCAAiC;AACjC,4DAAuD;AAEvD,4FAAiG;AAMjG,MAAsB,WAAY,SAAQ,cAAO;IAC/C,MAAM,CAAC,WAAW,GAAG,KAAK,CAAA;IAC1B,MAAM,CAAC,MAAM,GAAG,IAAI,CAAA;IACpB,KAAK,GAAG,IAAI,CAAA;IACZ,KAAK,GAAG,IAAI,4BAAY,CAAC,IAAI,CAAC,CAAA;IAC9B,kBAAkB,CAAuC;IAEzD,KAAK,CAAC,qBAAqB;QACzB,IAAI,CAAC;YACH,IAAI,CAAC,IAAI,CAAC,kBAAkB,EAAE,CAAC;gBAC7B,IAAI,CAAC,kBAAkB,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