checkly 0.0.0-canary.7166ed8

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.
Files changed (1096) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +117 -0
  3. package/assets/runtimes/snapshots/20260130/runtimes.json +349 -0
  4. package/bin/run +8 -0
  5. package/bin/run.cmd +3 -0
  6. package/constructs.d.ts +1 -0
  7. package/constructs.js +2 -0
  8. package/dist/ai-context/checkly.rules.md +916 -0
  9. package/dist/ai-context/context.d.ts +150 -0
  10. package/dist/ai-context/context.js +263 -0
  11. package/dist/ai-context/context.js.map +1 -0
  12. package/dist/ai-context/onboarding-boilerplate/__checks__/api.check.ts +22 -0
  13. package/dist/ai-context/onboarding-boilerplate/__checks__/heartbeat.check.ts +16 -0
  14. package/dist/ai-context/onboarding-boilerplate/__checks__/homepage.spec.ts +12 -0
  15. package/dist/ai-context/onboarding-boilerplate/__checks__/url.check.ts +18 -0
  16. package/dist/ai-context/onboarding-boilerplate/checkly-config-template.ts +50 -0
  17. package/dist/ai-context/onboarding-prompts/base.md +1 -0
  18. package/dist/ai-context/onboarding-prompts/playwright.md +1 -0
  19. package/dist/ai-context/public-skills/checkly/README.md +43 -0
  20. package/dist/ai-context/public-skills/checkly/SKILL.md +112 -0
  21. package/dist/ai-context/skills-command/references/communicate-incidents.md +79 -0
  22. package/dist/ai-context/skills-command/references/communicate.md +33 -0
  23. package/dist/ai-context/skills-command/references/configure-agentic-checks.md +65 -0
  24. package/dist/ai-context/skills-command/references/configure-alert-channels.md +54 -0
  25. package/dist/ai-context/skills-command/references/configure-api-checks.md +73 -0
  26. package/dist/ai-context/skills-command/references/configure-browser-checks.md +36 -0
  27. package/dist/ai-context/skills-command/references/configure-check-groups.md +16 -0
  28. package/dist/ai-context/skills-command/references/configure-dns-monitors.md +39 -0
  29. package/dist/ai-context/skills-command/references/configure-environment.md +92 -0
  30. package/dist/ai-context/skills-command/references/configure-heartbeat-monitors.md +28 -0
  31. package/dist/ai-context/skills-command/references/configure-icmp-monitors.md +42 -0
  32. package/dist/ai-context/skills-command/references/configure-multistep-checks.md +34 -0
  33. package/dist/ai-context/skills-command/references/configure-playwright-checks.md +70 -0
  34. package/dist/ai-context/skills-command/references/configure-supporting-constructs.md +120 -0
  35. package/dist/ai-context/skills-command/references/configure-tcp-monitors.md +41 -0
  36. package/dist/ai-context/skills-command/references/configure-url-monitors.md +40 -0
  37. package/dist/ai-context/skills-command/references/configure.md +152 -0
  38. package/dist/ai-context/skills-command/references/initialize.md +134 -0
  39. package/dist/ai-context/skills-command/references/investigate-checks.md +156 -0
  40. package/dist/ai-context/skills-command/references/investigate-test-sessions.md +165 -0
  41. package/dist/ai-context/skills-command/references/investigate.md +15 -0
  42. package/dist/ai-context/skills-command/references/manage-account-members.md +82 -0
  43. package/dist/ai-context/skills-command/references/manage-plan.md +49 -0
  44. package/dist/ai-context/skills-command/references/manage.md +53 -0
  45. package/dist/auth/index.d.ts +15 -0
  46. package/dist/auth/index.js +226 -0
  47. package/dist/auth/index.js.map +1 -0
  48. package/dist/commands/account/plan.d.ts +18 -0
  49. package/dist/commands/account/plan.js +113 -0
  50. package/dist/commands/account/plan.js.map +1 -0
  51. package/dist/commands/alert-channels/get.d.ts +14 -0
  52. package/dist/commands/alert-channels/get.js +50 -0
  53. package/dist/commands/alert-channels/get.js.map +1 -0
  54. package/dist/commands/alert-channels/list.d.ts +13 -0
  55. package/dist/commands/alert-channels/list.js +64 -0
  56. package/dist/commands/alert-channels/list.js.map +1 -0
  57. package/dist/commands/alert-channels/logs.d.ts +19 -0
  58. package/dist/commands/alert-channels/logs.js +91 -0
  59. package/dist/commands/alert-channels/logs.js.map +1 -0
  60. package/dist/commands/api.d.ts +23 -0
  61. package/dist/commands/api.js +205 -0
  62. package/dist/commands/api.js.map +1 -0
  63. package/dist/commands/assets/download.d.ts +19 -0
  64. package/dist/commands/assets/download.js +170 -0
  65. package/dist/commands/assets/download.js.map +1 -0
  66. package/dist/commands/assets/list.d.ts +17 -0
  67. package/dist/commands/assets/list.js +107 -0
  68. package/dist/commands/assets/list.js.map +1 -0
  69. package/dist/commands/authCommand.d.ts +14 -0
  70. package/dist/commands/authCommand.js +49 -0
  71. package/dist/commands/authCommand.js.map +1 -0
  72. package/dist/commands/baseCommand.d.ts +23 -0
  73. package/dist/commands/baseCommand.js +93 -0
  74. package/dist/commands/baseCommand.js.map +1 -0
  75. package/dist/commands/checks/delete.d.ts +15 -0
  76. package/dist/commands/checks/delete.js +65 -0
  77. package/dist/commands/checks/delete.js.map +1 -0
  78. package/dist/commands/checks/get.d.ts +30 -0
  79. package/dist/commands/checks/get.js +361 -0
  80. package/dist/commands/checks/get.js.map +1 -0
  81. package/dist/commands/checks/list.d.ts +18 -0
  82. package/dist/commands/checks/list.js +124 -0
  83. package/dist/commands/checks/list.js.map +1 -0
  84. package/dist/commands/checks/stats.d.ts +22 -0
  85. package/dist/commands/checks/stats.js +181 -0
  86. package/dist/commands/checks/stats.js.map +1 -0
  87. package/dist/commands/debug/parse-file.d.ts +13 -0
  88. package/dist/commands/debug/parse-file.js +74 -0
  89. package/dist/commands/debug/parse-file.js.map +1 -0
  90. package/dist/commands/debug/parse-playwright-config.d.ts +9 -0
  91. package/dist/commands/debug/parse-playwright-config.js +27 -0
  92. package/dist/commands/debug/parse-playwright-config.js.map +1 -0
  93. package/dist/commands/debug/parse-project.d.ts +43 -0
  94. package/dist/commands/debug/parse-project.js +187 -0
  95. package/dist/commands/debug/parse-project.js.map +1 -0
  96. package/dist/commands/deploy.d.ts +20 -0
  97. package/dist/commands/deploy.js +341 -0
  98. package/dist/commands/deploy.js.map +1 -0
  99. package/dist/commands/destroy.d.ts +12 -0
  100. package/dist/commands/destroy.js +76 -0
  101. package/dist/commands/destroy.js.map +1 -0
  102. package/dist/commands/env/add.d.ts +14 -0
  103. package/dist/commands/env/add.js +54 -0
  104. package/dist/commands/env/add.js.map +1 -0
  105. package/dist/commands/env/ls.d.ts +8 -0
  106. package/dist/commands/env/ls.js +20 -0
  107. package/dist/commands/env/ls.js.map +1 -0
  108. package/dist/commands/env/pull.d.ts +14 -0
  109. package/dist/commands/env/pull.js +72 -0
  110. package/dist/commands/env/pull.js.map +1 -0
  111. package/dist/commands/env/rm.d.ts +13 -0
  112. package/dist/commands/env/rm.js +46 -0
  113. package/dist/commands/env/rm.js.map +1 -0
  114. package/dist/commands/env/update.d.ts +15 -0
  115. package/dist/commands/env/update.js +55 -0
  116. package/dist/commands/env/update.js.map +1 -0
  117. package/dist/commands/help.d.ts +6 -0
  118. package/dist/commands/help.js +11 -0
  119. package/dist/commands/help.js.map +1 -0
  120. package/dist/commands/import/apply.d.ts +14 -0
  121. package/dist/commands/import/apply.js +125 -0
  122. package/dist/commands/import/apply.js.map +1 -0
  123. package/dist/commands/import/cancel.d.ts +12 -0
  124. package/dist/commands/import/cancel.js +91 -0
  125. package/dist/commands/import/cancel.js.map +1 -0
  126. package/dist/commands/import/commit.d.ts +14 -0
  127. package/dist/commands/import/commit.js +109 -0
  128. package/dist/commands/import/commit.js.map +1 -0
  129. package/dist/commands/import/plan.d.ts +23 -0
  130. package/dist/commands/import/plan.js +1273 -0
  131. package/dist/commands/import/plan.js.map +1 -0
  132. package/dist/commands/incidents/create.d.ts +17 -0
  133. package/dist/commands/incidents/create.js +102 -0
  134. package/dist/commands/incidents/create.js.map +1 -0
  135. package/dist/commands/incidents/list.d.ts +14 -0
  136. package/dist/commands/incidents/list.js +80 -0
  137. package/dist/commands/incidents/list.js.map +1 -0
  138. package/dist/commands/incidents/resolve.d.ts +16 -0
  139. package/dist/commands/incidents/resolve.js +78 -0
  140. package/dist/commands/incidents/resolve.js.map +1 -0
  141. package/dist/commands/incidents/update.d.ts +18 -0
  142. package/dist/commands/incidents/update.js +105 -0
  143. package/dist/commands/incidents/update.js.map +1 -0
  144. package/dist/commands/init.d.ts +23 -0
  145. package/dist/commands/init.js +273 -0
  146. package/dist/commands/init.js.map +1 -0
  147. package/dist/commands/login.d.ts +14 -0
  148. package/dist/commands/login.js +96 -0
  149. package/dist/commands/login.js.map +1 -0
  150. package/dist/commands/logout.d.ts +10 -0
  151. package/dist/commands/logout.js +38 -0
  152. package/dist/commands/logout.js.map +1 -0
  153. package/dist/commands/members/delete.d.ts +18 -0
  154. package/dist/commands/members/delete.js +73 -0
  155. package/dist/commands/members/delete.js.map +1 -0
  156. package/dist/commands/members/update.d.ts +21 -0
  157. package/dist/commands/members/update.js +104 -0
  158. package/dist/commands/members/update.js.map +1 -0
  159. package/dist/commands/members.d.ts +23 -0
  160. package/dist/commands/members.js +136 -0
  161. package/dist/commands/members.js.map +1 -0
  162. package/dist/commands/pw-test.d.ts +34 -0
  163. package/dist/commands/pw-test.js +378 -0
  164. package/dist/commands/pw-test.js.map +1 -0
  165. package/dist/commands/rca/get.d.ts +15 -0
  166. package/dist/commands/rca/get.js +69 -0
  167. package/dist/commands/rca/get.js.map +1 -0
  168. package/dist/commands/rca/run.d.ts +16 -0
  169. package/dist/commands/rca/run.js +113 -0
  170. package/dist/commands/rca/run.js.map +1 -0
  171. package/dist/commands/rules.d.ts +10 -0
  172. package/dist/commands/rules.js +127 -0
  173. package/dist/commands/rules.js.map +1 -0
  174. package/dist/commands/runtimes.d.ts +8 -0
  175. package/dist/commands/runtimes.js +25 -0
  176. package/dist/commands/runtimes.js.map +1 -0
  177. package/dist/commands/skills/index.d.ts +12 -0
  178. package/dist/commands/skills/index.js +108 -0
  179. package/dist/commands/skills/index.js.map +1 -0
  180. package/dist/commands/skills/install.d.ts +23 -0
  181. package/dist/commands/skills/install.js +203 -0
  182. package/dist/commands/skills/install.js.map +1 -0
  183. package/dist/commands/status-pages/get.d.ts +14 -0
  184. package/dist/commands/status-pages/get.js +48 -0
  185. package/dist/commands/status-pages/get.js.map +1 -0
  186. package/dist/commands/status-pages/list.d.ts +14 -0
  187. package/dist/commands/status-pages/list.js +82 -0
  188. package/dist/commands/status-pages/list.js.map +1 -0
  189. package/dist/commands/switch.d.ts +10 -0
  190. package/dist/commands/switch.js +53 -0
  191. package/dist/commands/switch.js.map +1 -0
  192. package/dist/commands/sync-playwright.d.ts +8 -0
  193. package/dist/commands/sync-playwright.js +53 -0
  194. package/dist/commands/sync-playwright.js.map +1 -0
  195. package/dist/commands/test-sessions/get.d.ts +21 -0
  196. package/dist/commands/test-sessions/get.js +121 -0
  197. package/dist/commands/test-sessions/get.js.map +1 -0
  198. package/dist/commands/test-sessions/list.d.ts +22 -0
  199. package/dist/commands/test-sessions/list.js +190 -0
  200. package/dist/commands/test-sessions/list.js.map +1 -0
  201. package/dist/commands/test.d.ts +37 -0
  202. package/dist/commands/test.js +390 -0
  203. package/dist/commands/test.js.map +1 -0
  204. package/dist/commands/trigger.d.ts +40 -0
  205. package/dist/commands/trigger.js +241 -0
  206. package/dist/commands/trigger.js.map +1 -0
  207. package/dist/commands/validate.d.ts +13 -0
  208. package/dist/commands/validate.js +81 -0
  209. package/dist/commands/validate.js.map +1 -0
  210. package/dist/commands/whoami.d.ts +8 -0
  211. package/dist/commands/whoami.js +22 -0
  212. package/dist/commands/whoami.js.map +1 -0
  213. package/dist/config.d.ts +31 -0
  214. package/dist/config.js +4 -0
  215. package/dist/config.js.map +1 -0
  216. package/dist/constants.d.ts +16 -0
  217. package/dist/constants.js +25 -0
  218. package/dist/constants.js.map +1 -0
  219. package/dist/constructs/agentic-check-codegen.d.ts +22 -0
  220. package/dist/constructs/agentic-check-codegen.js +58 -0
  221. package/dist/constructs/agentic-check-codegen.js.map +1 -0
  222. package/dist/constructs/agentic-check.d.ts +130 -0
  223. package/dist/constructs/agentic-check.js +100 -0
  224. package/dist/constructs/agentic-check.js.map +1 -0
  225. package/dist/constructs/alert-channel-codegen.d.ts +37 -0
  226. package/dist/constructs/alert-channel-codegen.js +96 -0
  227. package/dist/constructs/alert-channel-codegen.js.map +1 -0
  228. package/dist/constructs/alert-channel-subscription-codegen.d.ts +11 -0
  229. package/dist/constructs/alert-channel-subscription-codegen.js +20 -0
  230. package/dist/constructs/alert-channel-subscription-codegen.js.map +1 -0
  231. package/dist/constructs/alert-channel-subscription.d.ts +46 -0
  232. package/dist/constructs/alert-channel-subscription.js +45 -0
  233. package/dist/constructs/alert-channel-subscription.js.map +1 -0
  234. package/dist/constructs/alert-channel.d.ts +130 -0
  235. package/dist/constructs/alert-channel.js +103 -0
  236. package/dist/constructs/alert-channel.js.map +1 -0
  237. package/dist/constructs/alert-escalation-policy-codegen.d.ts +4 -0
  238. package/dist/constructs/alert-escalation-policy-codegen.js +55 -0
  239. package/dist/constructs/alert-escalation-policy-codegen.js.map +1 -0
  240. package/dist/constructs/alert-escalation-policy.d.ts +114 -0
  241. package/dist/constructs/alert-escalation-policy.js +62 -0
  242. package/dist/constructs/alert-escalation-policy.js.map +1 -0
  243. package/dist/constructs/api-assertion-codegen.d.ts +3 -0
  244. package/dist/constructs/api-assertion-codegen.js +19 -0
  245. package/dist/constructs/api-assertion-codegen.js.map +1 -0
  246. package/dist/constructs/api-assertion.d.ts +74 -0
  247. package/dist/constructs/api-assertion.js +81 -0
  248. package/dist/constructs/api-assertion.js.map +1 -0
  249. package/dist/constructs/api-check-bundle.d.ts +58 -0
  250. package/dist/constructs/api-check-bundle.js +30 -0
  251. package/dist/constructs/api-check-bundle.js.map +1 -0
  252. package/dist/constructs/api-check-codegen.d.ts +19 -0
  253. package/dist/constructs/api-check-codegen.js +83 -0
  254. package/dist/constructs/api-check-codegen.js.map +1 -0
  255. package/dist/constructs/api-check.d.ts +193 -0
  256. package/dist/constructs/api-check.js +219 -0
  257. package/dist/constructs/api-check.js.map +1 -0
  258. package/dist/constructs/api-request-codegen.d.ts +4 -0
  259. package/dist/constructs/api-request-codegen.js +64 -0
  260. package/dist/constructs/api-request-codegen.js.map +1 -0
  261. package/dist/constructs/api-request.d.ts +67 -0
  262. package/dist/constructs/api-request.js +2 -0
  263. package/dist/constructs/api-request.js.map +1 -0
  264. package/dist/constructs/browser-check-bundle.d.ts +59 -0
  265. package/dist/constructs/browser-check-bundle.js +27 -0
  266. package/dist/constructs/browser-check-bundle.js.map +1 -0
  267. package/dist/constructs/browser-check-codegen.d.ts +14 -0
  268. package/dist/constructs/browser-check-codegen.js +44 -0
  269. package/dist/constructs/browser-check-codegen.js.map +1 -0
  270. package/dist/constructs/browser-check.d.ts +129 -0
  271. package/dist/constructs/browser-check.js +169 -0
  272. package/dist/constructs/browser-check.js.map +1 -0
  273. package/dist/constructs/check-codegen.d.ts +74 -0
  274. package/dist/constructs/check-codegen.js +251 -0
  275. package/dist/constructs/check-codegen.js.map +1 -0
  276. package/dist/constructs/check-config.d.ts +2 -0
  277. package/dist/constructs/check-config.js +17 -0
  278. package/dist/constructs/check-config.js.map +1 -0
  279. package/dist/constructs/check-group-codegen.d.ts +46 -0
  280. package/dist/constructs/check-group-codegen.js +268 -0
  281. package/dist/constructs/check-group-codegen.js.map +1 -0
  282. package/dist/constructs/check-group-ref.d.ts +20 -0
  283. package/dist/constructs/check-group-ref.js +46 -0
  284. package/dist/constructs/check-group-ref.js.map +1 -0
  285. package/dist/constructs/check-group-v1.d.ts +304 -0
  286. package/dist/constructs/check-group-v1.js +254 -0
  287. package/dist/constructs/check-group-v1.js.map +1 -0
  288. package/dist/constructs/check-group-v2.d.ts +120 -0
  289. package/dist/constructs/check-group-v2.js +68 -0
  290. package/dist/constructs/check-group-v2.js.map +1 -0
  291. package/dist/constructs/check-group.d.ts +4 -0
  292. package/dist/constructs/check-group.js +5 -0
  293. package/dist/constructs/check-group.js.map +1 -0
  294. package/dist/constructs/check.d.ts +336 -0
  295. package/dist/constructs/check.js +234 -0
  296. package/dist/constructs/check.js.map +1 -0
  297. package/dist/constructs/construct-codegen.d.ts +39 -0
  298. package/dist/constructs/construct-codegen.js +95 -0
  299. package/dist/constructs/construct-codegen.js.map +1 -0
  300. package/dist/constructs/construct-diagnostics.d.ts +53 -0
  301. package/dist/constructs/construct-diagnostics.js +156 -0
  302. package/dist/constructs/construct-diagnostics.js.map +1 -0
  303. package/dist/constructs/construct.d.ts +142 -0
  304. package/dist/constructs/construct.js +120 -0
  305. package/dist/constructs/construct.js.map +1 -0
  306. package/dist/constructs/dashboard-bundle.d.ts +11 -0
  307. package/dist/constructs/dashboard-bundle.js +15 -0
  308. package/dist/constructs/dashboard-bundle.js.map +1 -0
  309. package/dist/constructs/dashboard-codegen.d.ts +29 -0
  310. package/dist/constructs/dashboard-codegen.js +104 -0
  311. package/dist/constructs/dashboard-codegen.js.map +1 -0
  312. package/dist/constructs/dashboard.d.ts +226 -0
  313. package/dist/constructs/dashboard.js +140 -0
  314. package/dist/constructs/dashboard.js.map +1 -0
  315. package/dist/constructs/diagnostics.d.ts +59 -0
  316. package/dist/constructs/diagnostics.js +71 -0
  317. package/dist/constructs/diagnostics.js.map +1 -0
  318. package/dist/constructs/dns-assertion-codegen.d.ts +3 -0
  319. package/dist/constructs/dns-assertion-codegen.js +26 -0
  320. package/dist/constructs/dns-assertion-codegen.js.map +1 -0
  321. package/dist/constructs/dns-assertion.d.ts +45 -0
  322. package/dist/constructs/dns-assertion.js +51 -0
  323. package/dist/constructs/dns-assertion.js.map +1 -0
  324. package/dist/constructs/dns-monitor-codegen.d.ts +13 -0
  325. package/dist/constructs/dns-monitor-codegen.js +34 -0
  326. package/dist/constructs/dns-monitor-codegen.js.map +1 -0
  327. package/dist/constructs/dns-monitor.d.ts +87 -0
  328. package/dist/constructs/dns-monitor.js +55 -0
  329. package/dist/constructs/dns-monitor.js.map +1 -0
  330. package/dist/constructs/dns-request-codegen.d.ts +4 -0
  331. package/dist/constructs/dns-request-codegen.js +28 -0
  332. package/dist/constructs/dns-request-codegen.js.map +1 -0
  333. package/dist/constructs/dns-request.d.ts +53 -0
  334. package/dist/constructs/dns-request.js +2 -0
  335. package/dist/constructs/dns-request.js.map +1 -0
  336. package/dist/constructs/email-alert-channel-codegen.d.ts +13 -0
  337. package/dist/constructs/email-alert-channel-codegen.js +34 -0
  338. package/dist/constructs/email-alert-channel-codegen.js.map +1 -0
  339. package/dist/constructs/email-alert-channel.d.ts +27 -0
  340. package/dist/constructs/email-alert-channel.js +37 -0
  341. package/dist/constructs/email-alert-channel.js.map +1 -0
  342. package/dist/constructs/engine.d.ts +40 -0
  343. package/dist/constructs/engine.js +23 -0
  344. package/dist/constructs/engine.js.map +1 -0
  345. package/dist/constructs/environment-variable.d.ts +21 -0
  346. package/dist/constructs/environment-variable.js +2 -0
  347. package/dist/constructs/environment-variable.js.map +1 -0
  348. package/dist/constructs/frequency-codegen.d.ts +8 -0
  349. package/dist/constructs/frequency-codegen.js +51 -0
  350. package/dist/constructs/frequency-codegen.js.map +1 -0
  351. package/dist/constructs/frequency.d.ts +62 -0
  352. package/dist/constructs/frequency.js +66 -0
  353. package/dist/constructs/frequency.js.map +1 -0
  354. package/dist/constructs/heartbeat-monitor-codegen.d.ts +11 -0
  355. package/dist/constructs/heartbeat-monitor-codegen.js +29 -0
  356. package/dist/constructs/heartbeat-monitor-codegen.js.map +1 -0
  357. package/dist/constructs/heartbeat-monitor.d.ts +40 -0
  358. package/dist/constructs/heartbeat-monitor.js +56 -0
  359. package/dist/constructs/heartbeat-monitor.js.map +1 -0
  360. package/dist/constructs/http-header.d.ts +18 -0
  361. package/dist/constructs/http-header.js +2 -0
  362. package/dist/constructs/http-header.js.map +1 -0
  363. package/dist/constructs/http-request.d.ts +2 -0
  364. package/dist/constructs/http-request.js +2 -0
  365. package/dist/constructs/http-request.js.map +1 -0
  366. package/dist/constructs/icmp-assertion-codegen.d.ts +3 -0
  367. package/dist/constructs/icmp-assertion-codegen.js +18 -0
  368. package/dist/constructs/icmp-assertion-codegen.js.map +1 -0
  369. package/dist/constructs/icmp-assertion.d.ts +56 -0
  370. package/dist/constructs/icmp-assertion.js +57 -0
  371. package/dist/constructs/icmp-assertion.js.map +1 -0
  372. package/dist/constructs/icmp-monitor-codegen.d.ts +13 -0
  373. package/dist/constructs/icmp-monitor-codegen.js +34 -0
  374. package/dist/constructs/icmp-monitor-codegen.js.map +1 -0
  375. package/dist/constructs/icmp-monitor.d.ts +83 -0
  376. package/dist/constructs/icmp-monitor.js +43 -0
  377. package/dist/constructs/icmp-monitor.js.map +1 -0
  378. package/dist/constructs/icmp-request-codegen.d.ts +4 -0
  379. package/dist/constructs/icmp-request-codegen.js +24 -0
  380. package/dist/constructs/icmp-request-codegen.js.map +1 -0
  381. package/dist/constructs/icmp-request.d.ts +37 -0
  382. package/dist/constructs/icmp-request.js +2 -0
  383. package/dist/constructs/icmp-request.js.map +1 -0
  384. package/dist/constructs/incident.d.ts +15 -0
  385. package/dist/constructs/incident.js +2 -0
  386. package/dist/constructs/incident.js.map +1 -0
  387. package/dist/constructs/incidentio-alert-channel-codegen.d.ts +13 -0
  388. package/dist/constructs/incidentio-alert-channel-codegen.js +85 -0
  389. package/dist/constructs/incidentio-alert-channel-codegen.js.map +1 -0
  390. package/dist/constructs/incidentio-alert-channel.d.ts +44 -0
  391. package/dist/constructs/incidentio-alert-channel.js +67 -0
  392. package/dist/constructs/incidentio-alert-channel.js.map +1 -0
  393. package/dist/constructs/index.d.ts +54 -0
  394. package/dist/constructs/index.js +55 -0
  395. package/dist/constructs/index.js.map +1 -0
  396. package/dist/constructs/internal/assertion-codegen.d.ts +11 -0
  397. package/dist/constructs/internal/assertion-codegen.js +144 -0
  398. package/dist/constructs/internal/assertion-codegen.js.map +1 -0
  399. package/dist/constructs/internal/assertion.d.ts +40 -0
  400. package/dist/constructs/internal/assertion.js +93 -0
  401. package/dist/constructs/internal/assertion.js.map +1 -0
  402. package/dist/constructs/internal/codegen/codegen.d.ts +9 -0
  403. package/dist/constructs/internal/codegen/codegen.js +16 -0
  404. package/dist/constructs/internal/codegen/codegen.js.map +1 -0
  405. package/dist/constructs/internal/codegen/context.d.ts +62 -0
  406. package/dist/constructs/internal/codegen/context.js +413 -0
  407. package/dist/constructs/internal/codegen/context.js.map +1 -0
  408. package/dist/constructs/internal/codegen/index.d.ts +4 -0
  409. package/dist/constructs/internal/codegen/index.js +5 -0
  410. package/dist/constructs/internal/codegen/index.js.map +1 -0
  411. package/dist/constructs/internal/codegen/safety.d.ts +2 -0
  412. package/dist/constructs/internal/codegen/safety.js +3 -0
  413. package/dist/constructs/internal/codegen/safety.js.map +1 -0
  414. package/dist/constructs/internal/codegen/snippet.d.ts +12 -0
  415. package/dist/constructs/internal/codegen/snippet.js +39 -0
  416. package/dist/constructs/internal/codegen/snippet.js.map +1 -0
  417. package/dist/constructs/internal/common-diagnostics.d.ts +21 -0
  418. package/dist/constructs/internal/common-diagnostics.js +84 -0
  419. package/dist/constructs/internal/common-diagnostics.js.map +1 -0
  420. package/dist/constructs/internal/sanitize.d.ts +15 -0
  421. package/dist/constructs/internal/sanitize.js +36 -0
  422. package/dist/constructs/internal/sanitize.js.map +1 -0
  423. package/dist/constructs/ip.d.ts +2 -0
  424. package/dist/constructs/ip.js +2 -0
  425. package/dist/constructs/ip.js.map +1 -0
  426. package/dist/constructs/key-value-pair-codegen.d.ts +4 -0
  427. package/dist/constructs/key-value-pair-codegen.js +35 -0
  428. package/dist/constructs/key-value-pair-codegen.js.map +1 -0
  429. package/dist/constructs/key-value-pair.d.ts +41 -0
  430. package/dist/constructs/key-value-pair.js +2 -0
  431. package/dist/constructs/key-value-pair.js.map +1 -0
  432. package/dist/constructs/maintenance-window-codegen.d.ts +14 -0
  433. package/dist/constructs/maintenance-window-codegen.js +53 -0
  434. package/dist/constructs/maintenance-window-codegen.js.map +1 -0
  435. package/dist/constructs/maintenance-window.d.ts +62 -0
  436. package/dist/constructs/maintenance-window.js +53 -0
  437. package/dist/constructs/maintenance-window.js.map +1 -0
  438. package/dist/constructs/monitor-codegen.d.ts +1 -0
  439. package/dist/constructs/monitor-codegen.js +2 -0
  440. package/dist/constructs/monitor-codegen.js.map +1 -0
  441. package/dist/constructs/monitor.d.ts +127 -0
  442. package/dist/constructs/monitor.js +17 -0
  443. package/dist/constructs/monitor.js.map +1 -0
  444. package/dist/constructs/msteams-alert-channel-codegen.d.ts +13 -0
  445. package/dist/constructs/msteams-alert-channel-codegen.js +71 -0
  446. package/dist/constructs/msteams-alert-channel-codegen.js.map +1 -0
  447. package/dist/constructs/msteams-alert-channel.d.ts +39 -0
  448. package/dist/constructs/msteams-alert-channel.js +162 -0
  449. package/dist/constructs/msteams-alert-channel.js.map +1 -0
  450. package/dist/constructs/multi-step-check-bundle.d.ts +47 -0
  451. package/dist/constructs/multi-step-check-bundle.js +21 -0
  452. package/dist/constructs/multi-step-check-bundle.js.map +1 -0
  453. package/dist/constructs/multi-step-check-codegen.d.ts +13 -0
  454. package/dist/constructs/multi-step-check-codegen.js +35 -0
  455. package/dist/constructs/multi-step-check-codegen.js.map +1 -0
  456. package/dist/constructs/multi-step-check.d.ts +75 -0
  457. package/dist/constructs/multi-step-check.js +121 -0
  458. package/dist/constructs/multi-step-check.js.map +1 -0
  459. package/dist/constructs/opsgenie-alert-channel-codegen.d.ts +16 -0
  460. package/dist/constructs/opsgenie-alert-channel-codegen.js +37 -0
  461. package/dist/constructs/opsgenie-alert-channel-codegen.js.map +1 -0
  462. package/dist/constructs/opsgenie-alert-channel.d.ts +46 -0
  463. package/dist/constructs/opsgenie-alert-channel.js +47 -0
  464. package/dist/constructs/opsgenie-alert-channel.js.map +1 -0
  465. package/dist/constructs/pagerduty-alert-channel-codegen.d.ts +15 -0
  466. package/dist/constructs/pagerduty-alert-channel-codegen.js +49 -0
  467. package/dist/constructs/pagerduty-alert-channel-codegen.js.map +1 -0
  468. package/dist/constructs/pagerduty-alert-channel.d.ts +40 -0
  469. package/dist/constructs/pagerduty-alert-channel.js +44 -0
  470. package/dist/constructs/pagerduty-alert-channel.js.map +1 -0
  471. package/dist/constructs/phone-call-alert-channel-codegen.d.ts +14 -0
  472. package/dist/constructs/phone-call-alert-channel-codegen.js +42 -0
  473. package/dist/constructs/phone-call-alert-channel-codegen.js.map +1 -0
  474. package/dist/constructs/phone-call-alert-channel.d.ts +34 -0
  475. package/dist/constructs/phone-call-alert-channel.js +42 -0
  476. package/dist/constructs/phone-call-alert-channel.js.map +1 -0
  477. package/dist/constructs/playwright-check-bundle.d.ts +63 -0
  478. package/dist/constructs/playwright-check-bundle.js +36 -0
  479. package/dist/constructs/playwright-check-bundle.js.map +1 -0
  480. package/dist/constructs/playwright-check.d.ts +193 -0
  481. package/dist/constructs/playwright-check.js +328 -0
  482. package/dist/constructs/playwright-check.js.map +1 -0
  483. package/dist/constructs/playwright-config-codegen.d.ts +4 -0
  484. package/dist/constructs/playwright-config-codegen.js +5 -0
  485. package/dist/constructs/playwright-config-codegen.js.map +1 -0
  486. package/dist/constructs/playwright-config.d.ts +52 -0
  487. package/dist/constructs/playwright-config.js +2 -0
  488. package/dist/constructs/playwright-config.js.map +1 -0
  489. package/dist/constructs/private-location-check-assignment-codegen.d.ts +10 -0
  490. package/dist/constructs/private-location-check-assignment-codegen.js +15 -0
  491. package/dist/constructs/private-location-check-assignment-codegen.js.map +1 -0
  492. package/dist/constructs/private-location-check-assignment.d.ts +30 -0
  493. package/dist/constructs/private-location-check-assignment.js +36 -0
  494. package/dist/constructs/private-location-check-assignment.js.map +1 -0
  495. package/dist/constructs/private-location-codegen.d.ts +15 -0
  496. package/dist/constructs/private-location-codegen.js +46 -0
  497. package/dist/constructs/private-location-codegen.js.map +1 -0
  498. package/dist/constructs/private-location-group-assignment-codegen.d.ts +10 -0
  499. package/dist/constructs/private-location-group-assignment-codegen.js +15 -0
  500. package/dist/constructs/private-location-group-assignment-codegen.js.map +1 -0
  501. package/dist/constructs/private-location-group-assignment.d.ts +31 -0
  502. package/dist/constructs/private-location-group-assignment.js +39 -0
  503. package/dist/constructs/private-location-group-assignment.js.map +1 -0
  504. package/dist/constructs/private-location.d.ts +66 -0
  505. package/dist/constructs/private-location.js +88 -0
  506. package/dist/constructs/private-location.js.map +1 -0
  507. package/dist/constructs/project-bundle.d.ts +30 -0
  508. package/dist/constructs/project-bundle.js +40 -0
  509. package/dist/constructs/project-bundle.js.map +1 -0
  510. package/dist/constructs/project.d.ts +61 -0
  511. package/dist/constructs/project.js +127 -0
  512. package/dist/constructs/project.js.map +1 -0
  513. package/dist/constructs/query-param.d.ts +18 -0
  514. package/dist/constructs/query-param.js +2 -0
  515. package/dist/constructs/query-param.js.map +1 -0
  516. package/dist/constructs/ref-codegen.d.ts +3 -0
  517. package/dist/constructs/ref-codegen.js +11 -0
  518. package/dist/constructs/ref-codegen.js.map +1 -0
  519. package/dist/constructs/ref.d.ts +49 -0
  520. package/dist/constructs/ref.js +54 -0
  521. package/dist/constructs/ref.js.map +1 -0
  522. package/dist/constructs/retry-strategy-codegen.d.ts +4 -0
  523. package/dist/constructs/retry-strategy-codegen.js +104 -0
  524. package/dist/constructs/retry-strategy-codegen.js.map +1 -0
  525. package/dist/constructs/retry-strategy.d.ts +196 -0
  526. package/dist/constructs/retry-strategy.js +110 -0
  527. package/dist/constructs/retry-strategy.js.map +1 -0
  528. package/dist/constructs/session.d.ts +67 -0
  529. package/dist/constructs/session.js +197 -0
  530. package/dist/constructs/session.js.map +1 -0
  531. package/dist/constructs/slack-alert-channel-codegen.d.ts +14 -0
  532. package/dist/constructs/slack-alert-channel-codegen.js +42 -0
  533. package/dist/constructs/slack-alert-channel-codegen.js.map +1 -0
  534. package/dist/constructs/slack-alert-channel.d.ts +27 -0
  535. package/dist/constructs/slack-alert-channel.js +41 -0
  536. package/dist/constructs/slack-alert-channel.js.map +1 -0
  537. package/dist/constructs/slack-app-alert-channel-codegen.d.ts +13 -0
  538. package/dist/constructs/slack-app-alert-channel-codegen.js +39 -0
  539. package/dist/constructs/slack-app-alert-channel-codegen.js.map +1 -0
  540. package/dist/constructs/slack-app-alert-channel.d.ts +31 -0
  541. package/dist/constructs/slack-app-alert-channel.js +38 -0
  542. package/dist/constructs/slack-app-alert-channel.js.map +1 -0
  543. package/dist/constructs/sms-alert-channel-codegen.d.ts +14 -0
  544. package/dist/constructs/sms-alert-channel-codegen.js +42 -0
  545. package/dist/constructs/sms-alert-channel-codegen.js.map +1 -0
  546. package/dist/constructs/sms-alert-channel.d.ts +33 -0
  547. package/dist/constructs/sms-alert-channel.js +41 -0
  548. package/dist/constructs/sms-alert-channel.js.map +1 -0
  549. package/dist/constructs/status-page-codegen.d.ts +23 -0
  550. package/dist/constructs/status-page-codegen.js +67 -0
  551. package/dist/constructs/status-page-codegen.js.map +1 -0
  552. package/dist/constructs/status-page-service-codegen.d.ts +12 -0
  553. package/dist/constructs/status-page-service-codegen.js +39 -0
  554. package/dist/constructs/status-page-service-codegen.js.map +1 -0
  555. package/dist/constructs/status-page-service.d.ts +43 -0
  556. package/dist/constructs/status-page-service.js +61 -0
  557. package/dist/constructs/status-page-service.js.map +1 -0
  558. package/dist/constructs/status-page.d.ts +72 -0
  559. package/dist/constructs/status-page.js +58 -0
  560. package/dist/constructs/status-page.js.map +1 -0
  561. package/dist/constructs/tcp-monitor-codegen.d.ts +15 -0
  562. package/dist/constructs/tcp-monitor-codegen.js +64 -0
  563. package/dist/constructs/tcp-monitor-codegen.js.map +1 -0
  564. package/dist/constructs/tcp-monitor.d.ts +155 -0
  565. package/dist/constructs/tcp-monitor.js +83 -0
  566. package/dist/constructs/tcp-monitor.js.map +1 -0
  567. package/dist/constructs/telegram-alert-channel-codegen.d.ts +13 -0
  568. package/dist/constructs/telegram-alert-channel-codegen.js +98 -0
  569. package/dist/constructs/telegram-alert-channel-codegen.js.map +1 -0
  570. package/dist/constructs/telegram-alert-channel.d.ts +44 -0
  571. package/dist/constructs/telegram-alert-channel.js +60 -0
  572. package/dist/constructs/telegram-alert-channel.js.map +1 -0
  573. package/dist/constructs/url-assertion-codegen.d.ts +3 -0
  574. package/dist/constructs/url-assertion-codegen.js +11 -0
  575. package/dist/constructs/url-assertion-codegen.js.map +1 -0
  576. package/dist/constructs/url-assertion.d.ts +60 -0
  577. package/dist/constructs/url-assertion.js +52 -0
  578. package/dist/constructs/url-assertion.js.map +1 -0
  579. package/dist/constructs/url-monitor-codegen.d.ts +13 -0
  580. package/dist/constructs/url-monitor-codegen.js +34 -0
  581. package/dist/constructs/url-monitor-codegen.js.map +1 -0
  582. package/dist/constructs/url-monitor.d.ts +151 -0
  583. package/dist/constructs/url-monitor.js +109 -0
  584. package/dist/constructs/url-monitor.js.map +1 -0
  585. package/dist/constructs/url-request-codegen.d.ts +4 -0
  586. package/dist/constructs/url-request-codegen.js +27 -0
  587. package/dist/constructs/url-request-codegen.js.map +1 -0
  588. package/dist/constructs/url-request.d.ts +65 -0
  589. package/dist/constructs/url-request.js +2 -0
  590. package/dist/constructs/url-request.js.map +1 -0
  591. package/dist/constructs/validator-error.d.ts +2 -0
  592. package/dist/constructs/validator-error.js +3 -0
  593. package/dist/constructs/validator-error.js.map +1 -0
  594. package/dist/constructs/webhook-alert-channel-codegen.d.ts +34 -0
  595. package/dist/constructs/webhook-alert-channel-codegen.js +147 -0
  596. package/dist/constructs/webhook-alert-channel-codegen.js.map +1 -0
  597. package/dist/constructs/webhook-alert-channel.d.ts +68 -0
  598. package/dist/constructs/webhook-alert-channel.js +59 -0
  599. package/dist/constructs/webhook-alert-channel.js.map +1 -0
  600. package/dist/formatters/account-members.d.ts +8 -0
  601. package/dist/formatters/account-members.js +115 -0
  602. package/dist/formatters/account-members.js.map +1 -0
  603. package/dist/formatters/account-plan.d.ts +16 -0
  604. package/dist/formatters/account-plan.js +320 -0
  605. package/dist/formatters/account-plan.js.map +1 -0
  606. package/dist/formatters/alert-channels.d.ts +15 -0
  607. package/dist/formatters/alert-channels.js +257 -0
  608. package/dist/formatters/alert-channels.js.map +1 -0
  609. package/dist/formatters/analytics.d.ts +8 -0
  610. package/dist/formatters/analytics.js +223 -0
  611. package/dist/formatters/analytics.js.map +1 -0
  612. package/dist/formatters/assets.d.ts +22 -0
  613. package/dist/formatters/assets.js +280 -0
  614. package/dist/formatters/assets.js.map +1 -0
  615. package/dist/formatters/batch-stats.d.ts +8 -0
  616. package/dist/formatters/batch-stats.js +184 -0
  617. package/dist/formatters/batch-stats.js.map +1 -0
  618. package/dist/formatters/check-result-detail.d.ts +12 -0
  619. package/dist/formatters/check-result-detail.js +651 -0
  620. package/dist/formatters/check-result-detail.js.map +1 -0
  621. package/dist/formatters/checks.d.ts +29 -0
  622. package/dist/formatters/checks.js +336 -0
  623. package/dist/formatters/checks.js.map +1 -0
  624. package/dist/formatters/incidents.d.ts +7 -0
  625. package/dist/formatters/incidents.js +172 -0
  626. package/dist/formatters/incidents.js.map +1 -0
  627. package/dist/formatters/rca.d.ts +42 -0
  628. package/dist/formatters/rca.js +156 -0
  629. package/dist/formatters/rca.js.map +1 -0
  630. package/dist/formatters/render.d.ts +47 -0
  631. package/dist/formatters/render.js +261 -0
  632. package/dist/formatters/render.js.map +1 -0
  633. package/dist/formatters/status-pages.d.ts +7 -0
  634. package/dist/formatters/status-pages.js +236 -0
  635. package/dist/formatters/status-pages.js.map +1 -0
  636. package/dist/formatters/test-sessions.d.ts +18 -0
  637. package/dist/formatters/test-sessions.js +341 -0
  638. package/dist/formatters/test-sessions.js.map +1 -0
  639. package/dist/help/examples.d.ts +6 -0
  640. package/dist/help/examples.js +20 -0
  641. package/dist/help/examples.js.map +1 -0
  642. package/dist/help/help-extension.d.ts +6 -0
  643. package/dist/help/help-extension.js +91 -0
  644. package/dist/help/help-extension.js.map +1 -0
  645. package/dist/help/skills.d.ts +7 -0
  646. package/dist/help/skills.js +20 -0
  647. package/dist/help/skills.js.map +1 -0
  648. package/dist/helpers/account-member-target.d.ts +14 -0
  649. package/dist/helpers/account-member-target.js +37 -0
  650. package/dist/helpers/account-member-target.js.map +1 -0
  651. package/dist/helpers/api-fields.d.ts +4 -0
  652. package/dist/helpers/api-fields.js +24 -0
  653. package/dist/helpers/api-fields.js.map +1 -0
  654. package/dist/helpers/cli-mode.d.ts +4 -0
  655. package/dist/helpers/cli-mode.js +62 -0
  656. package/dist/helpers/cli-mode.js.map +1 -0
  657. package/dist/helpers/command-preview.d.ts +24 -0
  658. package/dist/helpers/command-preview.js +50 -0
  659. package/dist/helpers/command-preview.js.map +1 -0
  660. package/dist/helpers/command-style.d.ts +21 -0
  661. package/dist/helpers/command-style.js +108 -0
  662. package/dist/helpers/command-style.js.map +1 -0
  663. package/dist/helpers/constants.d.ts +1 -0
  664. package/dist/helpers/constants.js +2 -0
  665. package/dist/helpers/constants.js.map +1 -0
  666. package/dist/helpers/content-range.d.ts +1 -0
  667. package/dist/helpers/content-range.js +7 -0
  668. package/dist/helpers/content-range.js.map +1 -0
  669. package/dist/helpers/flags.d.ts +11 -0
  670. package/dist/helpers/flags.js +45 -0
  671. package/dist/helpers/flags.js.map +1 -0
  672. package/dist/helpers/incidents.d.ts +15 -0
  673. package/dist/helpers/incidents.js +50 -0
  674. package/dist/helpers/incidents.js.map +1 -0
  675. package/dist/helpers/number.d.ts +3 -0
  676. package/dist/helpers/number.js +20 -0
  677. package/dist/helpers/number.js.map +1 -0
  678. package/dist/helpers/onboarding/boilerplate.d.ts +15 -0
  679. package/dist/helpers/onboarding/boilerplate.js +166 -0
  680. package/dist/helpers/onboarding/boilerplate.js.map +1 -0
  681. package/dist/helpers/onboarding/clipboard.d.ts +1 -0
  682. package/dist/helpers/onboarding/clipboard.js +28 -0
  683. package/dist/helpers/onboarding/clipboard.js.map +1 -0
  684. package/dist/helpers/onboarding/detect-project.d.ts +10 -0
  685. package/dist/helpers/onboarding/detect-project.js +31 -0
  686. package/dist/helpers/onboarding/detect-project.js.map +1 -0
  687. package/dist/helpers/onboarding/index.d.ts +7 -0
  688. package/dist/helpers/onboarding/index.js +8 -0
  689. package/dist/helpers/onboarding/index.js.map +1 -0
  690. package/dist/helpers/onboarding/messages.d.ts +5 -0
  691. package/dist/helpers/onboarding/messages.js +141 -0
  692. package/dist/helpers/onboarding/messages.js.map +1 -0
  693. package/dist/helpers/onboarding/prompt-display.d.ts +1 -0
  694. package/dist/helpers/onboarding/prompt-display.js +76 -0
  695. package/dist/helpers/onboarding/prompt-display.js.map +1 -0
  696. package/dist/helpers/onboarding/prompts-helpers.d.ts +2 -0
  697. package/dist/helpers/onboarding/prompts-helpers.js +11 -0
  698. package/dist/helpers/onboarding/prompts-helpers.js.map +1 -0
  699. package/dist/helpers/onboarding/skill-install.d.ts +10 -0
  700. package/dist/helpers/onboarding/skill-install.js +85 -0
  701. package/dist/helpers/onboarding/skill-install.js.map +1 -0
  702. package/dist/helpers/onboarding/template-prompt.d.ts +2 -0
  703. package/dist/helpers/onboarding/template-prompt.js +14 -0
  704. package/dist/helpers/onboarding/template-prompt.js.map +1 -0
  705. package/dist/helpers/recast-acorn-parser.d.ts +2 -0
  706. package/dist/helpers/recast-acorn-parser.js +22 -0
  707. package/dist/helpers/recast-acorn-parser.js.map +1 -0
  708. package/dist/helpers/result-assets.d.ts +54 -0
  709. package/dist/helpers/result-assets.js +305 -0
  710. package/dist/helpers/result-assets.js.map +1 -0
  711. package/dist/helpers/test-helper.d.ts +17 -0
  712. package/dist/helpers/test-helper.js +75 -0
  713. package/dist/helpers/test-helper.js.map +1 -0
  714. package/dist/helpers/wrap.d.ts +6 -0
  715. package/dist/helpers/wrap.js +49 -0
  716. package/dist/helpers/wrap.js.map +1 -0
  717. package/dist/helpers/write-config-helpers.d.ts +5 -0
  718. package/dist/helpers/write-config-helpers.js +55 -0
  719. package/dist/helpers/write-config-helpers.js.map +1 -0
  720. package/dist/hooks/command-not-found.d.ts +3 -0
  721. package/dist/hooks/command-not-found.js +22 -0
  722. package/dist/hooks/command-not-found.js.map +1 -0
  723. package/dist/hooks/parse-error.d.ts +3 -0
  724. package/dist/hooks/parse-error.js +15 -0
  725. package/dist/hooks/parse-error.js.map +1 -0
  726. package/dist/index.d.ts +3 -0
  727. package/dist/index.js +3 -0
  728. package/dist/index.js.map +1 -0
  729. package/dist/loader/config.d.ts +3 -0
  730. package/dist/loader/config.js +8 -0
  731. package/dist/loader/config.js.map +1 -0
  732. package/dist/loader/index.d.ts +5 -0
  733. package/dist/loader/index.js +6 -0
  734. package/dist/loader/index.js.map +1 -0
  735. package/dist/loader/jiti.d.ts +28 -0
  736. package/dist/loader/jiti.js +76 -0
  737. package/dist/loader/jiti.js.map +1 -0
  738. package/dist/loader/loader.d.ts +43 -0
  739. package/dist/loader/loader.js +37 -0
  740. package/dist/loader/loader.js.map +1 -0
  741. package/dist/loader/match.d.ts +15 -0
  742. package/dist/loader/match.js +43 -0
  743. package/dist/loader/match.js.map +1 -0
  744. package/dist/loader/mixed.d.ts +7 -0
  745. package/dist/loader/mixed.js +36 -0
  746. package/dist/loader/mixed.js.map +1 -0
  747. package/dist/loader/native.d.ts +10 -0
  748. package/dist/loader/native.js +30 -0
  749. package/dist/loader/native.js.map +1 -0
  750. package/dist/messages/common-messages.d.ts +5 -0
  751. package/dist/messages/common-messages.js +7 -0
  752. package/dist/messages/common-messages.js.map +1 -0
  753. package/dist/playwright/playwright-config-loader.d.ts +1 -0
  754. package/dist/playwright/playwright-config-loader.js +26 -0
  755. package/dist/playwright/playwright-config-loader.js.map +1 -0
  756. package/dist/playwright/playwright-config-template.d.ts +8 -0
  757. package/dist/playwright/playwright-config-template.js +53 -0
  758. package/dist/playwright/playwright-config-template.js.map +1 -0
  759. package/dist/reporters/abstract-list.d.ts +57 -0
  760. package/dist/reporters/abstract-list.js +283 -0
  761. package/dist/reporters/abstract-list.js.map +1 -0
  762. package/dist/reporters/ci.d.ts +12 -0
  763. package/dist/reporters/ci.js +28 -0
  764. package/dist/reporters/ci.js.map +1 -0
  765. package/dist/reporters/dot.d.ts +10 -0
  766. package/dist/reporters/dot.js +26 -0
  767. package/dist/reporters/dot.js.map +1 -0
  768. package/dist/reporters/github.d.ts +32 -0
  769. package/dist/reporters/github.js +93 -0
  770. package/dist/reporters/github.js.map +1 -0
  771. package/dist/reporters/json.d.ts +26 -0
  772. package/dist/reporters/json.js +74 -0
  773. package/dist/reporters/json.js.map +1 -0
  774. package/dist/reporters/list.d.ts +15 -0
  775. package/dist/reporters/list.js +81 -0
  776. package/dist/reporters/list.js.map +1 -0
  777. package/dist/reporters/reporter.d.ts +25 -0
  778. package/dist/reporters/reporter.js +22 -0
  779. package/dist/reporters/reporter.js.map +1 -0
  780. package/dist/reporters/util.d.ts +20 -0
  781. package/dist/reporters/util.js +596 -0
  782. package/dist/reporters/util.js.map +1 -0
  783. package/dist/rest/account-members.d.ts +56 -0
  784. package/dist/rest/account-members.js +18 -0
  785. package/dist/rest/account-members.js.map +1 -0
  786. package/dist/rest/accounts.d.ts +20 -0
  787. package/dist/rest/accounts.js +14 -0
  788. package/dist/rest/accounts.js.map +1 -0
  789. package/dist/rest/alert-channels.d.ts +52 -0
  790. package/dist/rest/alert-channels.js +23 -0
  791. package/dist/rest/alert-channels.js.map +1 -0
  792. package/dist/rest/alert-notifications.d.ts +39 -0
  793. package/dist/rest/alert-notifications.js +19 -0
  794. package/dist/rest/alert-notifications.js.map +1 -0
  795. package/dist/rest/analytics.d.ts +41 -0
  796. package/dist/rest/analytics.js +60 -0
  797. package/dist/rest/analytics.js.map +1 -0
  798. package/dist/rest/api.d.ts +67 -0
  799. package/dist/rest/api.js +121 -0
  800. package/dist/rest/api.js.map +1 -0
  801. package/dist/rest/asset-manifests.d.ts +30 -0
  802. package/dist/rest/asset-manifests.js +29 -0
  803. package/dist/rest/asset-manifests.js.map +1 -0
  804. package/dist/rest/assets.d.ts +64 -0
  805. package/dist/rest/assets.js +90 -0
  806. package/dist/rest/assets.js.map +1 -0
  807. package/dist/rest/batch-analytics.d.ts +25 -0
  808. package/dist/rest/batch-analytics.js +14 -0
  809. package/dist/rest/batch-analytics.js.map +1 -0
  810. package/dist/rest/cancel.d.ts +14 -0
  811. package/dist/rest/cancel.js +28 -0
  812. package/dist/rest/cancel.js.map +1 -0
  813. package/dist/rest/check-groups.d.ts +16 -0
  814. package/dist/rest/check-groups.js +11 -0
  815. package/dist/rest/check-groups.js.map +1 -0
  816. package/dist/rest/check-results.d.ts +183 -0
  817. package/dist/rest/check-results.js +14 -0
  818. package/dist/rest/check-results.js.map +1 -0
  819. package/dist/rest/check-statuses.d.ts +23 -0
  820. package/dist/rest/check-statuses.js +20 -0
  821. package/dist/rest/check-statuses.js.map +1 -0
  822. package/dist/rest/checkly-storage.d.ts +14 -0
  823. package/dist/rest/checkly-storage.js +17 -0
  824. package/dist/rest/checkly-storage.js.map +1 -0
  825. package/dist/rest/checks.d.ts +48 -0
  826. package/dist/rest/checks.js +43 -0
  827. package/dist/rest/checks.js.map +1 -0
  828. package/dist/rest/entitlements.d.ts +47 -0
  829. package/dist/rest/entitlements.js +11 -0
  830. package/dist/rest/entitlements.js.map +1 -0
  831. package/dist/rest/environment-variables.d.ts +43 -0
  832. package/dist/rest/environment-variables.js +91 -0
  833. package/dist/rest/environment-variables.js.map +1 -0
  834. package/dist/rest/error-groups.d.ts +49 -0
  835. package/dist/rest/error-groups.js +14 -0
  836. package/dist/rest/error-groups.js.map +1 -0
  837. package/dist/rest/errors.d.ts +84 -0
  838. package/dist/rest/errors.js +216 -0
  839. package/dist/rest/errors.js.map +1 -0
  840. package/dist/rest/heartbeat-checks.d.ts +11 -0
  841. package/dist/rest/heartbeat-checks.js +16 -0
  842. package/dist/rest/heartbeat-checks.js.map +1 -0
  843. package/dist/rest/incidents.d.ts +60 -0
  844. package/dist/rest/incidents.js +28 -0
  845. package/dist/rest/incidents.js.map +1 -0
  846. package/dist/rest/locations.d.ts +11 -0
  847. package/dist/rest/locations.js +11 -0
  848. package/dist/rest/locations.js.map +1 -0
  849. package/dist/rest/private-locations.d.ts +10 -0
  850. package/dist/rest/private-locations.js +10 -0
  851. package/dist/rest/private-locations.js.map +1 -0
  852. package/dist/rest/projects.d.ts +161 -0
  853. package/dist/rest/projects.js +205 -0
  854. package/dist/rest/projects.js.map +1 -0
  855. package/dist/rest/rca.d.ts +14 -0
  856. package/dist/rest/rca.js +28 -0
  857. package/dist/rest/rca.js.map +1 -0
  858. package/dist/rest/runtimes.d.ts +9 -0
  859. package/dist/rest/runtimes.js +16 -0
  860. package/dist/rest/runtimes.js.map +1 -0
  861. package/dist/rest/status-pages.d.ts +40 -0
  862. package/dist/rest/status-pages.js +16 -0
  863. package/dist/rest/status-pages.js.map +1 -0
  864. package/dist/rest/test-session-error-groups.d.ts +18 -0
  865. package/dist/rest/test-session-error-groups.js +11 -0
  866. package/dist/rest/test-session-error-groups.js.map +1 -0
  867. package/dist/rest/test-sessions.d.ts +167 -0
  868. package/dist/rest/test-sessions.js +76 -0
  869. package/dist/rest/test-sessions.js.map +1 -0
  870. package/dist/rest/users.d.ts +12 -0
  871. package/dist/rest/users.js +11 -0
  872. package/dist/rest/users.js.map +1 -0
  873. package/dist/rest/util.d.ts +3 -0
  874. package/dist/rest/util.js +10 -0
  875. package/dist/rest/util.js.map +1 -0
  876. package/dist/runtimes/index.d.ts +2 -0
  877. package/dist/runtimes/index.js +2 -0
  878. package/dist/runtimes/index.js.map +1 -0
  879. package/dist/runtimes/runtime.d.ts +8 -0
  880. package/dist/runtimes/runtime.js +2 -0
  881. package/dist/runtimes/runtime.js.map +1 -0
  882. package/dist/runtimes/snapshot.d.ts +2 -0
  883. package/dist/runtimes/snapshot.js +11 -0
  884. package/dist/runtimes/snapshot.js.map +1 -0
  885. package/dist/services/abstract-check-runner.d.ts +63 -0
  886. package/dist/services/abstract-check-runner.js +289 -0
  887. package/dist/services/abstract-check-runner.js.map +1 -0
  888. package/dist/services/check-parser/bundler.d.ts +58 -0
  889. package/dist/services/check-parser/bundler.js +219 -0
  890. package/dist/services/check-parser/bundler.js.map +1 -0
  891. package/dist/services/check-parser/cache-hash.d.ts +79 -0
  892. package/dist/services/check-parser/cache-hash.js +179 -0
  893. package/dist/services/check-parser/cache-hash.js.map +1 -0
  894. package/dist/services/check-parser/collector.d.ts +33 -0
  895. package/dist/services/check-parser/collector.js +46 -0
  896. package/dist/services/check-parser/collector.js.map +1 -0
  897. package/dist/services/check-parser/errors.d.ts +8 -0
  898. package/dist/services/check-parser/errors.js +46 -0
  899. package/dist/services/check-parser/errors.js.map +1 -0
  900. package/dist/services/check-parser/faux-package.d.ts +4 -0
  901. package/dist/services/check-parser/faux-package.js +16 -0
  902. package/dist/services/check-parser/faux-package.js.map +1 -0
  903. package/dist/services/check-parser/package-files/extension.d.ts +38 -0
  904. package/dist/services/check-parser/package-files/extension.js +66 -0
  905. package/dist/services/check-parser/package-files/extension.js.map +1 -0
  906. package/dist/services/check-parser/package-files/jsconfig-json-file.d.ts +17 -0
  907. package/dist/services/check-parser/package-files/jsconfig-json-file.js +23 -0
  908. package/dist/services/check-parser/package-files/jsconfig-json-file.js.map +1 -0
  909. package/dist/services/check-parser/package-files/json-source-file.d.ts +11 -0
  910. package/dist/services/check-parser/package-files/json-source-file.js +32 -0
  911. package/dist/services/check-parser/package-files/json-source-file.js.map +1 -0
  912. package/dist/services/check-parser/package-files/json-text-source-file-parser.d.ts +7 -0
  913. package/dist/services/check-parser/package-files/json-text-source-file-parser.js +47 -0
  914. package/dist/services/check-parser/package-files/json-text-source-file-parser.js.map +1 -0
  915. package/dist/services/check-parser/package-files/json-text-source-file.d.ts +7 -0
  916. package/dist/services/check-parser/package-files/json-text-source-file.js +18 -0
  917. package/dist/services/check-parser/package-files/json-text-source-file.js.map +1 -0
  918. package/dist/services/check-parser/package-files/loader.d.ts +7 -0
  919. package/dist/services/check-parser/package-files/loader.js +24 -0
  920. package/dist/services/check-parser/package-files/loader.js.map +1 -0
  921. package/dist/services/check-parser/package-files/lockfile-package-version.d.ts +85 -0
  922. package/dist/services/check-parser/package-files/lockfile-package-version.js +317 -0
  923. package/dist/services/check-parser/package-files/lockfile-package-version.js.map +1 -0
  924. package/dist/services/check-parser/package-files/lookup.d.ts +12 -0
  925. package/dist/services/check-parser/package-files/lookup.js +52 -0
  926. package/dist/services/check-parser/package-files/lookup.js.map +1 -0
  927. package/dist/services/check-parser/package-files/package-json-file.d.ts +59 -0
  928. package/dist/services/check-parser/package-files/package-json-file.js +248 -0
  929. package/dist/services/check-parser/package-files/package-json-file.js.map +1 -0
  930. package/dist/services/check-parser/package-files/package-manager.d.ts +222 -0
  931. package/dist/services/check-parser/package-files/package-manager.js +785 -0
  932. package/dist/services/check-parser/package-files/package-manager.js.map +1 -0
  933. package/dist/services/check-parser/package-files/paths.d.ts +98 -0
  934. package/dist/services/check-parser/package-files/paths.js +234 -0
  935. package/dist/services/check-parser/package-files/paths.js.map +1 -0
  936. package/dist/services/check-parser/package-files/resolver.d.ts +124 -0
  937. package/dist/services/check-parser/package-files/resolver.js +468 -0
  938. package/dist/services/check-parser/package-files/resolver.js.map +1 -0
  939. package/dist/services/check-parser/package-files/result.d.ts +38 -0
  940. package/dist/services/check-parser/package-files/result.js +53 -0
  941. package/dist/services/check-parser/package-files/result.js.map +1 -0
  942. package/dist/services/check-parser/package-files/source-file-parser.d.ts +10 -0
  943. package/dist/services/check-parser/package-files/source-file-parser.js +13 -0
  944. package/dist/services/check-parser/package-files/source-file-parser.js.map +1 -0
  945. package/dist/services/check-parser/package-files/source-file.d.ts +15 -0
  946. package/dist/services/check-parser/package-files/source-file.js +38 -0
  947. package/dist/services/check-parser/package-files/source-file.js.map +1 -0
  948. package/dist/services/check-parser/package-files/tsconfig-json-file.d.ts +66 -0
  949. package/dist/services/check-parser/package-files/tsconfig-json-file.js +81 -0
  950. package/dist/services/check-parser/package-files/tsconfig-json-file.js.map +1 -0
  951. package/dist/services/check-parser/package-files/walk.d.ts +8 -0
  952. package/dist/services/check-parser/package-files/walk.js +35 -0
  953. package/dist/services/check-parser/package-files/walk.js.map +1 -0
  954. package/dist/services/check-parser/package-files/workspace.d.ts +60 -0
  955. package/dist/services/check-parser/package-files/workspace.js +103 -0
  956. package/dist/services/check-parser/package-files/workspace.js.map +1 -0
  957. package/dist/services/check-parser/parser.d.ts +67 -0
  958. package/dist/services/check-parser/parser.js +491 -0
  959. package/dist/services/check-parser/parser.js.map +1 -0
  960. package/dist/services/check-parser/playwright-config-expander.d.ts +7 -0
  961. package/dist/services/check-parser/playwright-config-expander.js +96 -0
  962. package/dist/services/check-parser/playwright-config-expander.js.map +1 -0
  963. package/dist/services/checkly-config-codegen.d.ts +4 -0
  964. package/dist/services/checkly-config-codegen.js +189 -0
  965. package/dist/services/checkly-config-codegen.js.map +1 -0
  966. package/dist/services/checkly-config-loader.d.ts +97 -0
  967. package/dist/services/checkly-config-loader.js +113 -0
  968. package/dist/services/checkly-config-loader.js.map +1 -0
  969. package/dist/services/config.d.ts +28 -0
  970. package/dist/services/config.js +93 -0
  971. package/dist/services/config.js.map +1 -0
  972. package/dist/services/engine-detector.d.ts +6 -0
  973. package/dist/services/engine-detector.js +141 -0
  974. package/dist/services/engine-detector.js.map +1 -0
  975. package/dist/services/engine-resolver.d.ts +6 -0
  976. package/dist/services/engine-resolver.js +47 -0
  977. package/dist/services/engine-resolver.js.map +1 -0
  978. package/dist/services/engine-rules-loader.d.ts +21 -0
  979. package/dist/services/engine-rules-loader.js +44 -0
  980. package/dist/services/engine-rules-loader.js.map +1 -0
  981. package/dist/services/load-dotenv.d.ts +1 -0
  982. package/dist/services/load-dotenv.js +44 -0
  983. package/dist/services/load-dotenv.js.map +1 -0
  984. package/dist/services/playwright-config.d.ts +27 -0
  985. package/dist/services/playwright-config.js +139 -0
  986. package/dist/services/playwright-config.js.map +1 -0
  987. package/dist/services/playwright-project-bundler.d.ts +47 -0
  988. package/dist/services/playwright-project-bundler.js +380 -0
  989. package/dist/services/playwright-project-bundler.js.map +1 -0
  990. package/dist/services/project-parser.d.ts +30 -0
  991. package/dist/services/project-parser.js +291 -0
  992. package/dist/services/project-parser.js.map +1 -0
  993. package/dist/services/proxy.d.ts +2 -0
  994. package/dist/services/proxy.js +36 -0
  995. package/dist/services/proxy.js.map +1 -0
  996. package/dist/services/shell.d.ts +2 -0
  997. package/dist/services/shell.js +15 -0
  998. package/dist/services/shell.js.map +1 -0
  999. package/dist/services/snapshot-service.d.ts +13 -0
  1000. package/dist/services/snapshot-service.js +56 -0
  1001. package/dist/services/snapshot-service.js.map +1 -0
  1002. package/dist/services/socket-client.d.ts +4 -0
  1003. package/dist/services/socket-client.js +58 -0
  1004. package/dist/services/socket-client.js.map +1 -0
  1005. package/dist/services/test-filters.d.ts +3 -0
  1006. package/dist/services/test-filters.js +21 -0
  1007. package/dist/services/test-filters.js.map +1 -0
  1008. package/dist/services/test-runner.d.ts +28 -0
  1009. package/dist/services/test-runner.js +82 -0
  1010. package/dist/services/test-runner.js.map +1 -0
  1011. package/dist/services/trigger-runner.d.ts +29 -0
  1012. package/dist/services/trigger-runner.js +49 -0
  1013. package/dist/services/trigger-runner.js.map +1 -0
  1014. package/dist/services/util.d.ts +34 -0
  1015. package/dist/services/util.js +167 -0
  1016. package/dist/services/util.js.map +1 -0
  1017. package/dist/sourcegen/args.d.ts +7 -0
  1018. package/dist/sourcegen/args.js +22 -0
  1019. package/dist/sourcegen/args.js.map +1 -0
  1020. package/dist/sourcegen/argsbuilder.d.ts +22 -0
  1021. package/dist/sourcegen/argsbuilder.js +106 -0
  1022. package/dist/sourcegen/argsbuilder.js.map +1 -0
  1023. package/dist/sourcegen/array.d.ts +8 -0
  1024. package/dist/sourcegen/array.js +28 -0
  1025. package/dist/sourcegen/array.js.map +1 -0
  1026. package/dist/sourcegen/arraybuilder.d.ts +21 -0
  1027. package/dist/sourcegen/arraybuilder.js +104 -0
  1028. package/dist/sourcegen/arraybuilder.js.map +1 -0
  1029. package/dist/sourcegen/boolean.d.ts +7 -0
  1030. package/dist/sourcegen/boolean.js +18 -0
  1031. package/dist/sourcegen/boolean.js.map +1 -0
  1032. package/dist/sourcegen/case.d.ts +9 -0
  1033. package/dist/sourcegen/case.js +96 -0
  1034. package/dist/sourcegen/case.js.map +1 -0
  1035. package/dist/sourcegen/comment.d.ts +32 -0
  1036. package/dist/sourcegen/comment.js +113 -0
  1037. package/dist/sourcegen/comment.js.map +1 -0
  1038. package/dist/sourcegen/decl.d.ts +43 -0
  1039. package/dist/sourcegen/decl.js +86 -0
  1040. package/dist/sourcegen/decl.js.map +1 -0
  1041. package/dist/sourcegen/declbuilder.d.ts +14 -0
  1042. package/dist/sourcegen/declbuilder.js +34 -0
  1043. package/dist/sourcegen/declbuilder.js.map +1 -0
  1044. package/dist/sourcegen/expr.d.ts +39 -0
  1045. package/dist/sourcegen/expr.js +77 -0
  1046. package/dist/sourcegen/expr.js.map +1 -0
  1047. package/dist/sourcegen/exprbuilder.d.ts +13 -0
  1048. package/dist/sourcegen/exprbuilder.js +49 -0
  1049. package/dist/sourcegen/exprbuilder.js.map +1 -0
  1050. package/dist/sourcegen/identifier.d.ts +12 -0
  1051. package/dist/sourcegen/identifier.js +22 -0
  1052. package/dist/sourcegen/identifier.js.map +1 -0
  1053. package/dist/sourcegen/index.d.ts +22 -0
  1054. package/dist/sourcegen/index.js +23 -0
  1055. package/dist/sourcegen/index.js.map +1 -0
  1056. package/dist/sourcegen/null.d.ts +5 -0
  1057. package/dist/sourcegen/null.js +7 -0
  1058. package/dist/sourcegen/null.js.map +1 -0
  1059. package/dist/sourcegen/number.d.ts +7 -0
  1060. package/dist/sourcegen/number.js +18 -0
  1061. package/dist/sourcegen/number.js.map +1 -0
  1062. package/dist/sourcegen/object.d.ts +28 -0
  1063. package/dist/sourcegen/object.js +80 -0
  1064. package/dist/sourcegen/object.js.map +1 -0
  1065. package/dist/sourcegen/objectbuilder.d.ts +25 -0
  1066. package/dist/sourcegen/objectbuilder.js +122 -0
  1067. package/dist/sourcegen/objectbuilder.js.map +1 -0
  1068. package/dist/sourcegen/output.d.ts +14 -0
  1069. package/dist/sourcegen/output.js +81 -0
  1070. package/dist/sourcegen/output.js.map +1 -0
  1071. package/dist/sourcegen/program.d.ts +53 -0
  1072. package/dist/sourcegen/program.js +254 -0
  1073. package/dist/sourcegen/program.js.map +1 -0
  1074. package/dist/sourcegen/string.d.ts +8 -0
  1075. package/dist/sourcegen/string.js +23 -0
  1076. package/dist/sourcegen/string.js.map +1 -0
  1077. package/dist/sourcegen/undefined.d.ts +5 -0
  1078. package/dist/sourcegen/undefined.js +7 -0
  1079. package/dist/sourcegen/undefined.js.map +1 -0
  1080. package/dist/sourcegen/unknown.d.ts +2 -0
  1081. package/dist/sourcegen/unknown.js +36 -0
  1082. package/dist/sourcegen/unknown.js.map +1 -0
  1083. package/dist/sourcegen/value.d.ts +4 -0
  1084. package/dist/sourcegen/value.js +3 -0
  1085. package/dist/sourcegen/value.js.map +1 -0
  1086. package/dist/testing/fixture-sandbox.d.ts +41 -0
  1087. package/dist/testing/fixture-sandbox.js +122 -0
  1088. package/dist/testing/fixture-sandbox.js.map +1 -0
  1089. package/dist/testing/global-setup.d.ts +2 -0
  1090. package/dist/testing/global-setup.js +14 -0
  1091. package/dist/testing/global-setup.js.map +1 -0
  1092. package/dist/util/index.d.ts +9 -0
  1093. package/dist/util/index.js +23 -0
  1094. package/dist/util/index.js.map +1 -0
  1095. package/oclif.manifest.json +3702 -0
  1096. package/package.json +166 -0
@@ -0,0 +1,1273 @@
1
+ import fs from 'node:fs/promises';
2
+ import path from 'node:path';
3
+ import { setTimeout } from 'node:timers/promises';
4
+ import { Args, Flags } from '@oclif/core';
5
+ import prompts from 'prompts';
6
+ import chalk from 'chalk';
7
+ import logSymbols from 'log-symbols';
8
+ import { validate as validateUuid } from 'uuid';
9
+ import { execa } from 'execa';
10
+ import { LOGICAL_ID_PATTERN } from '../../constants.js';
11
+ import * as api from '../../rest/api.js';
12
+ import { AuthCommand } from '../authCommand.js';
13
+ import commonMessages from '../../messages/common-messages.js';
14
+ import { splitConfigFilePath } from '../../services/util.js';
15
+ import { ConfigNotFoundError, loadChecklyConfig } from '../../services/checkly-config-loader.js';
16
+ import { ProjectNotFoundError, NoImportableResourcesFoundError } from '../../rest/projects.js';
17
+ import { cased, docComment, Program } from '../../sourcegen/index.js';
18
+ import { ConstructCodegen, sortResources } from '../../constructs/construct-codegen.js';
19
+ import { Context } from '../../constructs/internal/codegen/index.js';
20
+ import { isSnippet, isSafeSnippetFilename, } from '../../constructs/internal/codegen/snippet.js';
21
+ import { ExitError } from '@oclif/core/errors';
22
+ import { confirmCommit, performCommitAction } from './commit.js';
23
+ import { confirmApply, performApplyAction } from './apply.js';
24
+ import { generateChecklyConfig } from '../../services/checkly-config-codegen.js';
25
+ import { PackageJsonFile } from '../../services/check-parser/package-files/package-json-file.js';
26
+ import { detectNearestPackageJson, detectPackageManager, knownPackageManagers } from '../../services/check-parser/package-files/package-manager.js';
27
+ import { parseProject } from '../../services/project-parser.js';
28
+ import { Session } from '../../constructs/session.js';
29
+ import { Diagnostics } from '../../constructs/index.js';
30
+ export default class ImportPlanCommand extends AuthCommand {
31
+ static hidden = false;
32
+ static readOnly = true;
33
+ static idempotent = true;
34
+ static description = `\
35
+ Import existing resources from your Checkly account to your project.
36
+
37
+ By default, all resources that can be imported will be imported. However, you
38
+ may fine-tune the process by including or excluding any combination of
39
+ resources.
40
+
41
+ The import process consists of three steps:
42
+
43
+ 1. Creating a plan, which generates the appropriate code for your resources
44
+ 2. Applying the plan, which links your resources to the generated code
45
+ 3. Committing the plan, which finalizes the import session
46
+
47
+ CREATING A PLAN
48
+
49
+ Creating a plan carries no risk as no concrete links to your Checkly resources
50
+ are made at this point. However, if you accidentally deploy the generated code
51
+ before applying the plan, you will end up with duplicate resources and will
52
+ not be able to complete the import session without first deleting the
53
+ duplicates.
54
+
55
+ For the curious, you may also preview the generated code with the '--preview'
56
+ option. No plan will be created, allowing you to leisurely inspect the
57
+ generated code. However keep in mind that you will need to create a plan to
58
+ actually import any resources, at which point the code will be generated
59
+ again.
60
+
61
+ You may cancel any plan you've created without affecting any of the
62
+ underlying resources.
63
+
64
+ APPLYING A PLAN
65
+
66
+ Applying a plan links your existing resources to the generated code. You
67
+ should carefully review the generated code to make sure that it contains the
68
+ resources you expect before applying a plan. After a plan has been applied,
69
+ any deployments of those resources will irreversibly modify the underlying
70
+ Checkly resources. However, as a fail safe against concurrent use, any
71
+ deployments not including the imported resources will not delete the
72
+ underlying resources (or the links to the resources). This means that there
73
+ is no need to block deployments while working on an import session.
74
+
75
+ Even after you've applied a plan, you may still cancel it, which will unlink
76
+ the underlying resources from your project once more. However, keep in mind
77
+ that any changes to the resources that you've already deployed cannot be
78
+ undone.
79
+
80
+ COMMITTING A PLAN
81
+
82
+ Finally, committing a plan removes all fail safes and permanently links the
83
+ imported resources to your project. Any resources you remove from your code
84
+ will result in the underlying resources also getting irrevocably deleted on
85
+ the next deploy. You should only commit your plan once you are sure that all
86
+ future deployments include the imported resources.`;
87
+ static flags = {
88
+ 'config': Flags.string({
89
+ char: 'c',
90
+ description: commonMessages.configFile,
91
+ }),
92
+ 'root': Flags.string({
93
+ description: 'The root folder in which to write generated code files.',
94
+ default: '__checks__',
95
+ }),
96
+ 'preview': Flags.boolean({
97
+ description: 'Preview generated code without creating an actual import plan.',
98
+ default: false,
99
+ }),
100
+ 'debug-import-plan': Flags.boolean({
101
+ description: 'Output the import plan to a file.',
102
+ default: false,
103
+ hidden: true,
104
+ }),
105
+ 'debug-import-plan-input-file': Flags.string({
106
+ description: 'A file to load an import plan from.',
107
+ hidden: true,
108
+ }),
109
+ 'debug-import-plan-output-file': Flags.string({
110
+ description: 'The file to output the import plan to.',
111
+ default: './debug-import-plan.json',
112
+ hidden: true,
113
+ }),
114
+ };
115
+ static args = {
116
+ resource: Args.string({
117
+ name: 'resource',
118
+ required: false,
119
+ description: 'A specific resource to import.',
120
+ }),
121
+ };
122
+ static strict = false;
123
+ static hiddenAliases = [
124
+ 'import',
125
+ ];
126
+ async run() {
127
+ const { flags, argv } = await this.parse(ImportPlanCommand);
128
+ const { config: configFilename, root: rootDirectory, 'debug-import-plan': debugImportPlan, 'debug-import-plan-input-file': debugImportPlanInputFile, 'debug-import-plan-output-file': debugImportPlanOutputFile, preview, } = flags;
129
+ const filters = argv.map(value => {
130
+ return parseFilter(value);
131
+ });
132
+ const createProgram = () => {
133
+ return new Program({
134
+ rootDirectory,
135
+ constructFileSuffix: '.check',
136
+ constructHeaders: preview ? [previewComment()] : undefined,
137
+ specFileSuffix: '.spec',
138
+ language: 'typescript',
139
+ });
140
+ };
141
+ const friendExports = {
142
+ 'alert-channel': new Map(),
143
+ 'check-group': new Map(),
144
+ 'private-location': new Map(),
145
+ 'status-page-service': new Map(),
146
+ };
147
+ if (debugImportPlanInputFile) {
148
+ const plan = await (async () => {
149
+ this.style.actionStart('Loading debug import plan');
150
+ try {
151
+ const input = await fs.readFile(debugImportPlanInputFile, {
152
+ encoding: 'utf8',
153
+ });
154
+ const plan = JSON.parse(input);
155
+ this.style.actionSuccess();
156
+ return plan;
157
+ }
158
+ catch (err) {
159
+ this.style.actionFailure();
160
+ throw err;
161
+ }
162
+ })();
163
+ this.style.shortSuccess(`Successfully loaded debug import plan from "${debugImportPlanInputFile}".`);
164
+ const program = createProgram();
165
+ const codegen = new ConstructCodegen(program);
166
+ const { failures } = this.#generateCode(plan, program, codegen, friendExports);
167
+ if (failures.length) {
168
+ this.#outputFailures(failures, codegen);
169
+ this.style.shortError(`Unable to continue due to failed resources.`);
170
+ this.exit(1);
171
+ }
172
+ this.style.actionStart('Writing files');
173
+ try {
174
+ await program.realize();
175
+ this.style.actionSuccess();
176
+ }
177
+ catch (err) {
178
+ this.style.actionFailure();
179
+ throw err;
180
+ }
181
+ this.style.longSuccess(`Debug import plan has been created!`, `You can find the generated code under the following directory:`
182
+ + `\n\n`
183
+ + ` ${chalk.green(rootDirectory)}`);
184
+ return;
185
+ }
186
+ this.style.shortInfo(`You are about to import resources from your Checkly account.`);
187
+ this.style.comment(`Please make sure to commit any unsaved changes to avoid having any `
188
+ + `local changes get overwritten by generated code.`);
189
+ const { configDirectory, configFilenames } = splitConfigFilePath(configFilename);
190
+ const checklyConfig = await this.#loadConfig(configDirectory, configFilenames)
191
+ ?? await this.#interactiveCreateConfig(configDirectory);
192
+ await this.#initializeProject(checklyConfig);
193
+ const constructExports = await this.#findExportedResources(configDirectory, checklyConfig, rootDirectory);
194
+ const friends = [];
195
+ for (const constructExport of constructExports) {
196
+ const { type, logicalId } = constructExport;
197
+ const friendExport = friendExports[type];
198
+ if (friendExport === undefined) {
199
+ continue;
200
+ }
201
+ friendExport.set(logicalId, constructExport);
202
+ friends.push({
203
+ type,
204
+ logicalId,
205
+ });
206
+ }
207
+ const { logicalId, } = checklyConfig;
208
+ if (!preview) {
209
+ const { data: existingPlans } = await api.projects.findImportPlans(logicalId, {
210
+ onlyUncommitted: true,
211
+ });
212
+ if (existingPlans.length !== 0) {
213
+ await this.#handleExistingPlans(existingPlans);
214
+ }
215
+ }
216
+ // These are needed for the interactive filter creation for now. Ideally
217
+ // we'd remove these.
218
+ const program = createProgram();
219
+ const codegen = new ConstructCodegen(program);
220
+ // If the user provided no filter, ask interactively.
221
+ if (filters.length === 0) {
222
+ filters.push(...await this.#interactiveFilter(logicalId, codegen));
223
+ }
224
+ // Inject the default filter.
225
+ //
226
+ // By default all resource will be included, unless the user has specified
227
+ // an inclusive filter by themselves, in which case the default filter
228
+ // excludes all resources.
229
+ filters.unshift({
230
+ type: filters.some(({ type }) => type === 'include') ? 'exclude' : 'include',
231
+ });
232
+ while (true) {
233
+ // Recreate program on every attempt as otherwise resources from earlier
234
+ // runs will persist.
235
+ const program = createProgram();
236
+ const codegen = new ConstructCodegen(program);
237
+ const plan = await this.#createImportPlan(logicalId, {
238
+ preview,
239
+ filters,
240
+ friends,
241
+ });
242
+ if (!plan) {
243
+ return;
244
+ }
245
+ if (debugImportPlan) {
246
+ const output = JSON.stringify(plan, null, 2);
247
+ await fs.writeFile(debugImportPlanOutputFile, output, 'utf8');
248
+ this.style.shortSuccess(`Successfully wrote debug import plan to "${debugImportPlanOutputFile}".`);
249
+ return;
250
+ }
251
+ try {
252
+ const { failures } = this.#generateCode(plan, program, codegen, friendExports);
253
+ if (failures.length) {
254
+ const excludeFailed = this.#outputFailures(failures, codegen);
255
+ // Proactively exclude failed resources. If the user wants to
256
+ // retry they'll already be in the filter list, and otherwise the
257
+ // filters will simply not get used.
258
+ filters.push(...excludeFailed);
259
+ const retry = await this.#confirmRetryWithoutFailed();
260
+ if (!retry) {
261
+ this.cancelAndExit();
262
+ }
263
+ // When previewing, there is no plan to cancel.
264
+ if (preview) {
265
+ continue;
266
+ }
267
+ this.style.comment(`The current plan will be cancelled so that a new plan can be created.`);
268
+ this.style.actionStart('Cancelling current plan');
269
+ try {
270
+ await api.projects.cancelImportPlan(plan.id);
271
+ this.style.actionSuccess();
272
+ }
273
+ catch (err) {
274
+ this.style.actionFailure();
275
+ throw err;
276
+ }
277
+ this.style.comment(`A new plan will be created without the failed resources.`);
278
+ continue;
279
+ }
280
+ this.style.actionStart('Writing files');
281
+ try {
282
+ await program.realize();
283
+ this.style.actionSuccess();
284
+ }
285
+ catch (err) {
286
+ this.style.actionFailure();
287
+ throw err;
288
+ }
289
+ this.log(`${logSymbols.success} ${chalk.bold('Your import plan has been created!')}`);
290
+ this.log();
291
+ this.log(` You can find the generated code under the following directory:`);
292
+ this.log();
293
+ this.log(` ${chalk.green(rootDirectory)}`);
294
+ this.log();
295
+ this.log(`\
296
+ The imported resources have not been linked to your project yet. Please
297
+ make sure to inspect the generated code. Should you find anything you do
298
+ not like, you can cancel the import plan and no harm will be done.
299
+
300
+ ${logSymbols.warning} \
301
+ ${chalk.yellow('If you deploy now, you will end up with duplicate resources!')}
302
+
303
+ Once you have inspected the code, the next step will be to apply the plan,
304
+ which links the generated code to the underlying resources, making them
305
+ modifiable. At this point you may still cancel the plan, though any changes
306
+ you've already deployed cannot be undone.
307
+
308
+ ${logSymbols.info} \
309
+ ${chalk.cyan('For safety, resources are not deletable until the plan has been committed.')}
310
+
311
+ The final step will be to commit your plan, at which point the underlying
312
+ resources will be fully managed by the Checkly CLI in the exact same
313
+ manner as any other CLI-native resource.
314
+ `);
315
+ const apply = await confirmApply.call(this);
316
+ if (!apply) {
317
+ return;
318
+ }
319
+ await performApplyAction.call(this, plan);
320
+ const commit = await confirmCommit.call(this);
321
+ if (!commit) {
322
+ return;
323
+ }
324
+ await performCommitAction.call(this, plan);
325
+ return;
326
+ }
327
+ catch (err) {
328
+ if (err instanceof ExitError) {
329
+ throw err;
330
+ }
331
+ try {
332
+ const output = JSON.stringify(plan, null, 2);
333
+ await fs.writeFile(debugImportPlanOutputFile, output, 'utf8');
334
+ this.log(`${logSymbols.warning} Please contact Checkly support at support@checklyhq.com and attach the newly created "${debugImportPlanOutputFile}" file.`);
335
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
336
+ }
337
+ catch (err) {
338
+ this.log(`${logSymbols.warning} Please contact Checkly support at support@checklyhq.com.`);
339
+ }
340
+ throw err;
341
+ }
342
+ }
343
+ }
344
+ #outputFailures(failures, codegen) {
345
+ const filters = [];
346
+ this.log(`${logSymbols.error} ${chalk.red('The following resources could not be imported:')}`);
347
+ this.log();
348
+ for (const { resource, cause } of failures) {
349
+ const spec = `${resource.type}:${resource.physicalId}`;
350
+ const desc = (() => {
351
+ try {
352
+ return codegen.describe(resource);
353
+ }
354
+ catch {
355
+ return resource.type;
356
+ }
357
+ })();
358
+ this.log(` ${desc} (${chalk.gray(spec)})`);
359
+ this.log();
360
+ this.log(` ${chalk.red(cause.toString())}`);
361
+ this.log();
362
+ filters.push({
363
+ type: 'exclude',
364
+ resource: {
365
+ type: resource.type,
366
+ physicalId: resource.physicalId,
367
+ },
368
+ });
369
+ }
370
+ return filters;
371
+ }
372
+ #outputConfigSection(options) {
373
+ const { title, step: [step, totalSteps], description } = options;
374
+ this.log(` ${title} ${chalk.grey(`(step ${step}/${totalSteps})`)}`);
375
+ this.log();
376
+ this.style.comment(description);
377
+ }
378
+ async #askProjectName(step) {
379
+ this.#outputConfigSection({
380
+ title: `Let's give your project a name`,
381
+ description: `You'll be able to change the name later if you like.`,
382
+ step,
383
+ });
384
+ while (true) {
385
+ const { projectName } = await prompts({
386
+ name: 'projectName',
387
+ type: 'text',
388
+ message: 'What should we call your project?',
389
+ });
390
+ this.log();
391
+ if (projectName === undefined) {
392
+ this.cancelAndExit();
393
+ }
394
+ if (projectName.trim() !== '') {
395
+ return projectName;
396
+ }
397
+ this.style.comment(`Sorry, but a project name is absolutely required. `
398
+ + `You can also press ESC to cancel and exit.`);
399
+ }
400
+ }
401
+ async #askLogicalId(suggested, step) {
402
+ this.#outputConfigSection({
403
+ title: `Set up a unique project identifier`,
404
+ description: `The identifier given here uniquely identifies your `
405
+ + `project among any other Checkly projects you may have. You will `
406
+ + `not be able to change the identifier later without recreating the `
407
+ + `project. Please choose a value you'll be comfortable with `
408
+ + `long term.`,
409
+ step,
410
+ });
411
+ while (true) {
412
+ const { logicalId } = await prompts({
413
+ name: 'logicalId',
414
+ type: 'text',
415
+ message: 'How would you like your project to be identified?',
416
+ initial: suggested,
417
+ validate: input => {
418
+ if (!LOGICAL_ID_PATTERN.test(input)) {
419
+ return `Please only use ASCII letters, numbers, and the `
420
+ + `symbols _, -, /, #, and .`;
421
+ }
422
+ return true;
423
+ },
424
+ });
425
+ this.log();
426
+ if (logicalId === undefined) {
427
+ this.cancelAndExit();
428
+ }
429
+ if (logicalId.trim() !== '') {
430
+ return logicalId;
431
+ }
432
+ this.style.comment(`Sorry, but a project identifier is absolutely required. `
433
+ + `You can also press ESC to cancel and exit.`);
434
+ }
435
+ }
436
+ async #interactiveCreateConfig(configDirectory) {
437
+ this.style.shortWarning(`Unable to find an existing Checkly configuration file.`);
438
+ this.style.comment(`Setting up Checkly for the first time? No worries, we'll walk you `
439
+ + `through the process.`);
440
+ const choices = [{
441
+ title: `Yes, I want to start a new project for the imported resources`,
442
+ value: 'init',
443
+ description: `We'll walk you through a minimal setup`,
444
+ }, {
445
+ title: `No, I intended to import resources into an existing project`,
446
+ value: 'mistake',
447
+ description: 'Exit and verify your configuration.',
448
+ }, {
449
+ title: 'No, I want to cancel and exit',
450
+ value: 'exit',
451
+ description: 'No changes will be made.',
452
+ }];
453
+ const { action } = await prompts({
454
+ name: 'action',
455
+ type: 'select',
456
+ message: 'Set up a new Checkly project?',
457
+ choices,
458
+ });
459
+ this.log();
460
+ switch (action) {
461
+ case 'init': {
462
+ const projectName = await this.#askProjectName([1, 2]);
463
+ const suggestedLogicalId = cased(projectName, 'kebab-case');
464
+ const logicalId = await this.#askLogicalId(suggestedLogicalId, [2, 2]);
465
+ try {
466
+ this.style.actionStart('Creating project');
467
+ await api.projects.create({
468
+ name: projectName,
469
+ logicalId,
470
+ });
471
+ this.style.actionSuccess();
472
+ }
473
+ catch (err) {
474
+ this.style.actionFailure();
475
+ throw err;
476
+ }
477
+ const program = new Program({
478
+ rootDirectory: configDirectory,
479
+ constructFileSuffix: '.check',
480
+ specFileSuffix: '.spec',
481
+ language: 'typescript',
482
+ });
483
+ const context = new Context();
484
+ const config = {
485
+ projectName,
486
+ logicalId,
487
+ checks: {
488
+ tags: ['mac'],
489
+ checkMatch: '**/__checks__/**/*.check.ts',
490
+ },
491
+ };
492
+ try {
493
+ this.style.actionStart('Creating Checkly configuration');
494
+ // TODO: Make this less ugly.
495
+ generateChecklyConfig(program, context, config, 'checkly.config.ts');
496
+ this.style.actionSuccess();
497
+ }
498
+ catch (err) {
499
+ this.style.actionFailure();
500
+ throw err;
501
+ }
502
+ let askInstall = false;
503
+ let packageJson;
504
+ try {
505
+ this.style.actionStart('Configuring package.json for Checkly');
506
+ // TODO: Make this less ugly.
507
+ packageJson = await (async () => {
508
+ const file = await this.#loadPackageJson();
509
+ if (file !== undefined) {
510
+ this.style.shortSuccess(`Found existing package.json`);
511
+ return file;
512
+ }
513
+ else {
514
+ this.style.shortSuccess(`Creating a new minimal package.json`);
515
+ return this.#createPackageJson(logicalId);
516
+ }
517
+ })();
518
+ const ownPackageJson = await this.loadPackageJsonOfSelf();
519
+ const updated = packageJson.upsertDevDependencies({
520
+ checkly: `^${ownPackageJson?.version ?? '6'}`,
521
+ });
522
+ if (updated) {
523
+ this.style.shortSuccess(`Successfully added Checkly devDependencies`);
524
+ program.staticSupportFile(packageJson.meta.filePath, packageJson.toJSON());
525
+ askInstall = true;
526
+ }
527
+ else {
528
+ this.style.shortSuccess(`Checkly devDependencies are already up to date`);
529
+ }
530
+ this.style.actionSuccess();
531
+ }
532
+ catch (err) {
533
+ this.style.actionFailure();
534
+ throw err;
535
+ }
536
+ try {
537
+ this.style.actionStart('Writing project files');
538
+ await program.realize();
539
+ this.style.actionSuccess();
540
+ }
541
+ catch (err) {
542
+ this.style.actionFailure();
543
+ throw err;
544
+ }
545
+ if (askInstall && packageJson !== undefined) {
546
+ await this.#interactiveNpmInstall(packageJson.meta.dirname);
547
+ }
548
+ return config;
549
+ }
550
+ case 'mistake':
551
+ this.style.fatal(`Please verify your configuration and try again.`);
552
+ this.cancelAndExit();
553
+ break;
554
+ case 'exit':
555
+ // falls through
556
+ default: {
557
+ this.cancelAndExit();
558
+ }
559
+ }
560
+ }
561
+ async #loadPackageJson() {
562
+ try {
563
+ return await detectNearestPackageJson(process.cwd());
564
+ }
565
+ catch {
566
+ return;
567
+ }
568
+ }
569
+ #createPackageJson(logicalId) {
570
+ return PackageJsonFile.make(PackageJsonFile.FILENAME, {
571
+ name: logicalId,
572
+ version: '1.0.0',
573
+ private: true,
574
+ });
575
+ }
576
+ async #interactiveNpmInstall(dirPath, forcePackageManager) {
577
+ const packageManager = forcePackageManager ?? await (async () => {
578
+ try {
579
+ this.style.actionStart(`Detecting package manager`);
580
+ const packageManager = await detectPackageManager(dirPath);
581
+ this.style.actionSuccess();
582
+ this.style.comment(`It looks like your package manager is ${packageManager.name}.`);
583
+ return packageManager;
584
+ }
585
+ catch (err) {
586
+ this.style.actionFailure();
587
+ throw err;
588
+ }
589
+ })();
590
+ const { unsafeDisplayCommand, executable, args } = packageManager.installCommand();
591
+ const choices = [{
592
+ title: `Yes, please run \`${unsafeDisplayCommand}\` for me`,
593
+ value: 'install',
594
+ }, {
595
+ title: `I want to use a different package manager`,
596
+ value: 'other-manager',
597
+ }, {
598
+ title: 'I will do it later myself',
599
+ value: 'later',
600
+ }];
601
+ const { action } = await prompts({
602
+ type: 'select',
603
+ name: 'action',
604
+ message: 'Would you like to install dependencies now? (recommended)',
605
+ choices,
606
+ });
607
+ this.log();
608
+ switch (action) {
609
+ case 'install': {
610
+ this.style.comment(`Ok, now running \`${unsafeDisplayCommand}\`.`);
611
+ try {
612
+ await execa(executable, args, {
613
+ cwd: dirPath,
614
+ stdout: ['inherit'],
615
+ stderr: ['inherit'],
616
+ stdin: ['inherit'],
617
+ });
618
+ this.log();
619
+ this.style.comment(`Successfully installed dependencies.`);
620
+ }
621
+ catch (err) {
622
+ if (err instanceof Error) {
623
+ this.style.longError(`Failed to install dependencies`, err.message); // TODO :
624
+ }
625
+ this.style.comment(`Uh oh. Looks like that didn't quite work as expected.`
626
+ + `\n\n`
627
+ + `You can still continue the import process and install `
628
+ + `dependencies later by yourself.`);
629
+ const { action } = await prompts({
630
+ type: 'confirm',
631
+ name: 'action',
632
+ message: 'Continue the import process?',
633
+ });
634
+ this.log();
635
+ if (action) {
636
+ this.style.comment(`Great, let's proceed to the next step.`);
637
+ await setTimeout(200);
638
+ }
639
+ else {
640
+ this.cancelAndExit();
641
+ }
642
+ }
643
+ break;
644
+ }
645
+ case 'other-manager': {
646
+ const packageManagersByName = Object.fromEntries(knownPackageManagers.map(packageManager => {
647
+ return [packageManager.name, packageManager];
648
+ }));
649
+ const choices = knownPackageManagers.map(packageManager => ({
650
+ title: packageManager.name,
651
+ value: packageManager.name,
652
+ }));
653
+ choices.push({
654
+ title: 'None of the above',
655
+ value: 'other',
656
+ });
657
+ const { action } = await prompts({
658
+ type: 'select',
659
+ name: 'action',
660
+ message: 'Which package manager would you like to use?',
661
+ choices,
662
+ });
663
+ this.log();
664
+ if (action === undefined) {
665
+ this.cancelAndExit();
666
+ }
667
+ if (action === 'other') {
668
+ this.style.comment(`Alright. If possible, let us know which package manager you `
669
+ + `use and we may be able to support it in the future.`
670
+ + `\n\n`
671
+ + `You can still continue the import process and install `
672
+ + `dependencies later by yourself.`);
673
+ const { action } = await prompts({
674
+ type: 'confirm',
675
+ name: 'action',
676
+ message: 'Continue the import process?',
677
+ });
678
+ this.log();
679
+ if (action) {
680
+ this.style.comment(`Great, let's proceed to the next step.`);
681
+ await setTimeout(200);
682
+ break;
683
+ }
684
+ else {
685
+ this.cancelAndExit();
686
+ }
687
+ }
688
+ const packageManager = packageManagersByName[action];
689
+ if (packageManager === undefined) {
690
+ throw new Error(`Somehow, you selected an option that does not exist.`);
691
+ }
692
+ return this.#interactiveNpmInstall(dirPath, packageManager);
693
+ }
694
+ case 'later': {
695
+ this.style.comment(`Ok, but make sure to perform the appropriate actions to install `
696
+ + `dependencies once you've completed the setup.`
697
+ + `\n\n`
698
+ + `If you do not, the Checkly CLI will not function as intended.`);
699
+ await setTimeout(200);
700
+ break;
701
+ }
702
+ default: {
703
+ this.cancelAndExit();
704
+ }
705
+ }
706
+ }
707
+ async #loadConfig(configDirectory, configFilenames) {
708
+ try {
709
+ const { config: checklyConfig, } = await loadChecklyConfig(configDirectory, configFilenames);
710
+ return checklyConfig;
711
+ }
712
+ catch (err) {
713
+ if (err instanceof ConfigNotFoundError) {
714
+ return;
715
+ }
716
+ throw err;
717
+ }
718
+ }
719
+ async #validateProject(project) {
720
+ this.style.actionStart('Validating project resources');
721
+ const diagnostics = new Diagnostics();
722
+ await project.validate(diagnostics);
723
+ for (const diag of diagnostics.observations) {
724
+ if (diag.isFatal()) {
725
+ this.style.longError(diag.title, diag.message);
726
+ }
727
+ else if (!diag.isBenign()) {
728
+ this.style.longWarning(diag.title, diag.message);
729
+ }
730
+ else {
731
+ this.style.longInfo(diag.title, diag.message);
732
+ }
733
+ }
734
+ if (diagnostics.isFatal()) {
735
+ this.style.actionFailure();
736
+ this.style.shortError(`Unable to continue due to unresolved validation errors.`);
737
+ this.exit(1);
738
+ }
739
+ this.style.actionSuccess();
740
+ }
741
+ async #findExportedResources(configDirectory, checklyConfig, rootDirectory) {
742
+ this.style.actionStart('Parsing your project');
743
+ let project;
744
+ try {
745
+ const account = this.account;
746
+ const availableRuntimes = await api.runtimes.getAll();
747
+ project = await parseProject({
748
+ directory: configDirectory,
749
+ projectLogicalId: checklyConfig.logicalId,
750
+ projectName: checklyConfig.projectName,
751
+ repoUrl: checklyConfig.repoUrl,
752
+ checkMatch: checklyConfig.checks?.checkMatch,
753
+ browserCheckMatch: checklyConfig.checks?.browserChecks?.testMatch,
754
+ multiStepCheckMatch: checklyConfig.checks?.multiStepChecks?.testMatch,
755
+ ignoreDirectoriesMatch: checklyConfig.checks?.ignoreDirectoriesMatch,
756
+ checkDefaults: checklyConfig.checks,
757
+ browserCheckDefaults: checklyConfig.checks?.browserChecks,
758
+ availableRuntimes: availableRuntimes.reduce((acc, runtime) => {
759
+ acc[runtime.name] = runtime;
760
+ return acc;
761
+ }, {}),
762
+ defaultRuntimeId: account.runtimeId,
763
+ verifyRuntimeDependencies: false,
764
+ });
765
+ this.style.actionSuccess();
766
+ }
767
+ catch (err) {
768
+ this.style.actionFailure();
769
+ throw err;
770
+ }
771
+ await this.#validateProject(project);
772
+ this.style.actionStart('Searching for exported resources');
773
+ const constructExports = Session.constructExports;
774
+ this.style.actionSuccess();
775
+ switch (constructExports.length) {
776
+ case 0: {
777
+ this.style.comment(`Did not find any exported resources.`);
778
+ break;
779
+ }
780
+ case 1: {
781
+ this.style.comment(`Found 1 exported resource.`);
782
+ break;
783
+ }
784
+ default: {
785
+ this.style.comment(`Found ${constructExports.length} exported resources.`);
786
+ break;
787
+ }
788
+ }
789
+ // Paths need to be relative to the root directory or our generated
790
+ // imports won't work correctly.
791
+ for (const constructExport of constructExports) {
792
+ constructExport.filePath = path.relative(rootDirectory, constructExport.filePath);
793
+ }
794
+ return constructExports;
795
+ }
796
+ async #confirmRetryWithoutFailed() {
797
+ const { action } = await prompts({
798
+ name: 'action',
799
+ type: 'confirm',
800
+ message: 'Would you like to try again without the failed resources?',
801
+ });
802
+ this.log();
803
+ return action ?? false;
804
+ }
805
+ async #createImportPlan(logicalId, options) {
806
+ this.style.actionStart('Creating a new plan');
807
+ try {
808
+ const { data } = await api.projects.createImportPlan(logicalId, options);
809
+ this.style.actionSuccess();
810
+ return data;
811
+ }
812
+ catch (err) {
813
+ this.style.actionFailure();
814
+ if (err instanceof NoImportableResourcesFoundError) {
815
+ this.style.fatal(err.message);
816
+ return;
817
+ }
818
+ if (err instanceof ProjectNotFoundError) {
819
+ this.style.fatal(err.message);
820
+ return;
821
+ }
822
+ throw err;
823
+ }
824
+ }
825
+ async #interactiveFilter(logicalId, codegen) {
826
+ const choices = [{
827
+ title: `I want to import everything in one go`,
828
+ value: 'all',
829
+ }, {
830
+ title: `Let me choose resources manually`,
831
+ value: 'choose',
832
+ description: 'You will be presented with options.',
833
+ }, {
834
+ title: 'Cancel and exit',
835
+ value: 'exit',
836
+ description: 'No changes will be made.',
837
+ }];
838
+ const { action } = await prompts({
839
+ name: 'action',
840
+ type: 'select',
841
+ message: 'Which resources would you like to import?',
842
+ choices,
843
+ });
844
+ this.log();
845
+ switch (action) {
846
+ case 'all':
847
+ return [];
848
+ case 'choose': {
849
+ const choices = await (async () => {
850
+ this.style.actionStart('Fetching available resources');
851
+ try {
852
+ const { data } = await api.projects.createImportPlan(logicalId, {
853
+ preview: true,
854
+ filters: [{
855
+ type: 'include',
856
+ }],
857
+ });
858
+ this.style.actionSuccess();
859
+ return (data.changes?.resources ?? []).flatMap(resource => {
860
+ if (!isFilterable(resource.type)) {
861
+ return [];
862
+ }
863
+ try {
864
+ return [{
865
+ title: codegen.describe(resource),
866
+ value: `${resource.type}:${resource.physicalId}`,
867
+ description: `${resource.type}:${resource.physicalId}`,
868
+ }];
869
+ }
870
+ catch {
871
+ return [];
872
+ }
873
+ });
874
+ }
875
+ catch (err) {
876
+ this.style.actionFailure();
877
+ if (err instanceof NoImportableResourcesFoundError) {
878
+ return [];
879
+ }
880
+ throw err;
881
+ }
882
+ })();
883
+ choices.sort((a, b) => {
884
+ return a.title.localeCompare(b.title);
885
+ });
886
+ const { resources } = await prompts({
887
+ name: 'resources',
888
+ type: 'autocompleteMultiselect',
889
+ message: 'Please select the resources you would like to import',
890
+ choices,
891
+ hint: ' - Space to select. Return to submit.',
892
+ instructions: false,
893
+ });
894
+ this.log();
895
+ if (resources === undefined) {
896
+ this.cancelAndExit();
897
+ }
898
+ if (resources.length === 0) {
899
+ this.style.fatal(`You did not choose any resources.`);
900
+ this.cancelAndExit();
901
+ }
902
+ return resources.map(parseFilter);
903
+ }
904
+ case 'exit':
905
+ // falls through
906
+ default: {
907
+ this.cancelAndExit();
908
+ }
909
+ }
910
+ }
911
+ #generateCode(plan, program, codegen, friendExports) {
912
+ this.style.actionStart('Generating Checkly constructs for imported resources');
913
+ try {
914
+ const context = new Context();
915
+ const failures = new Map();
916
+ if (plan.changes) {
917
+ const { resources, friends, auxiliary } = plan.changes;
918
+ if (friends) {
919
+ for (const resource of friends) {
920
+ try {
921
+ if (friendExports[resource.type] === undefined) {
922
+ throw new Error(`Unable to process unsupported friend resource type '${resource.type}'.`);
923
+ }
924
+ const friendExport = friendExports[resource.type].get(resource.logicalId);
925
+ if (friendExport === undefined) {
926
+ throw new Error(`Received friend resource '${resource.logicalId}' that was not requested for.`);
927
+ }
928
+ switch (resource.type) {
929
+ case 'alert-channel':
930
+ context.registerFriendAlertChannel(resource.physicalId, friendExport);
931
+ break;
932
+ case 'check-group':
933
+ context.registerFriendCheckGroup(resource.physicalId, friendExport);
934
+ break;
935
+ case 'private-location':
936
+ context.registerFriendPrivateLocation(resource.physicalId, friendExport);
937
+ break;
938
+ case 'status-page-service':
939
+ context.registerFriendStatusPageService(resource.physicalId, friendExport);
940
+ break;
941
+ }
942
+ }
943
+ catch (cause) {
944
+ throw new Error(`Failed to process friend resource '${resource.type}:${resource.physicalId}' (${resource.logicalId}): ${cause}`, { cause });
945
+ }
946
+ }
947
+ }
948
+ if (auxiliary) {
949
+ const globalSnippetFiles = new Set();
950
+ for (const resource of auxiliary) {
951
+ try {
952
+ switch (resource.type) {
953
+ case 'snippet': {
954
+ const snippet = resource.payload;
955
+ if (!isSnippet(snippet)) {
956
+ throw new Error(`Invalid auxiliary snippet`);
957
+ }
958
+ const snippetFilePath = context.filePath('snippets', snippet.name, {
959
+ unique: false,
960
+ contentKey: `snippet::${snippet.id}`,
961
+ case: isSafeSnippetFilename(snippet.name) ? 'identity' : 'kebab-case',
962
+ });
963
+ const snippetFile = program.staticSupportFile(snippetFilePath.fullPath, snippet.script);
964
+ globalSnippetFiles.add(snippetFile);
965
+ context.registerAuxiliarySnippetFile(snippet.id, snippetFile);
966
+ break;
967
+ }
968
+ default:
969
+ throw new Error(`Unable to process unsupported auxiliary resource type '${resource.type}'.`);
970
+ }
971
+ }
972
+ catch (cause) {
973
+ throw new Error(`Failed to process auxiliary resource '${resource.type}:${resource.physicalId}': ${cause}`, { cause });
974
+ }
975
+ }
976
+ // Due to questionable historical design choices, snippets may
977
+ // reference other snippets in two ways:
978
+ //
979
+ // 1. From the same folder (i.e. `require('./other-snippet')`) if
980
+ // the requiring snippet is NOT the main entrypoint, but has
981
+ // itself been required by another snippet or script.
982
+ // 2. From the magic './snippets' folder using
983
+ // `require('./snippets/other-snippet')` irrespective of whether
984
+ // the requiring snippet is the main entrypoint or not (works in
985
+ // either case).
986
+ //
987
+ // To emulate this functionality with a proper file structure, we
988
+ // need to check if any global snippets are using the second method,
989
+ // and create appropriate aliases in the beatifully named
990
+ // './snippets/snippets/' folder so that the paths can resolve
991
+ // without modification.
992
+ for (const globalSnippetFile of globalSnippetFiles) {
993
+ const content = globalSnippetFile.content.toString();
994
+ const snippetFiles = context.findScriptSnippetFiles(content);
995
+ for (const snippetFile of snippetFiles) {
996
+ const localSnippetFile = program.generatedSupportFile(`snippets/snippets/${snippetFile.basename}`);
997
+ localSnippetFile.header(docComment(`This file has been generated to help resolve cross-snippet imports.\n`
998
+ + `\n`
999
+ + `We recommend rewriting your imports to not reference this file, after which\n`
1000
+ + `you may remove it.`));
1001
+ localSnippetFile.plainImport(localSnippetFile.relativePath(snippetFile));
1002
+ }
1003
+ }
1004
+ }
1005
+ sortResources(resources);
1006
+ for (const resource of resources) {
1007
+ try {
1008
+ codegen.prepare(resource.logicalId, resource, context);
1009
+ }
1010
+ catch (cause) {
1011
+ if (!(cause instanceof Error)) {
1012
+ throw cause;
1013
+ }
1014
+ failures.set(resource.logicalId, {
1015
+ resource,
1016
+ cause,
1017
+ });
1018
+ }
1019
+ }
1020
+ for (const resource of resources) {
1021
+ if (failures.has(resource.logicalId)) {
1022
+ continue;
1023
+ }
1024
+ try {
1025
+ codegen.gencode(resource.logicalId, resource, context);
1026
+ }
1027
+ catch (cause) {
1028
+ if (!(cause instanceof Error)) {
1029
+ throw cause;
1030
+ }
1031
+ failures.set(resource.logicalId, {
1032
+ resource,
1033
+ cause,
1034
+ });
1035
+ }
1036
+ }
1037
+ }
1038
+ if (failures.size === 0) {
1039
+ this.style.actionSuccess();
1040
+ }
1041
+ else {
1042
+ this.style.actionFailure();
1043
+ }
1044
+ return {
1045
+ failures: [...failures.values()],
1046
+ };
1047
+ }
1048
+ catch (err) {
1049
+ this.style.actionFailure();
1050
+ throw err;
1051
+ }
1052
+ }
1053
+ async #initializeProject(config) {
1054
+ const { logicalId, projectName, repoUrl, } = config;
1055
+ this.style.actionStart('Checking project status');
1056
+ try {
1057
+ await api.projects.get(logicalId);
1058
+ this.style.actionSuccess();
1059
+ // The project has already been initialized, not need to do anything.
1060
+ return;
1061
+ }
1062
+ catch (err) {
1063
+ this.style.actionFailure();
1064
+ if (!(err instanceof ProjectNotFoundError)) {
1065
+ throw err;
1066
+ }
1067
+ // The project does not exist yet and we must create (initialize) it.
1068
+ }
1069
+ const choices = [{
1070
+ title: `Yes, I want to start a new project with the imported resources`,
1071
+ value: 'init',
1072
+ }, {
1073
+ title: `No, I intended to import resources into an existing project`,
1074
+ value: 'mistake',
1075
+ description: 'Exit and verify your configuration.',
1076
+ }, {
1077
+ title: 'No, I want to cancel and exit',
1078
+ value: 'exit',
1079
+ description: 'No changes will be made.',
1080
+ }];
1081
+ const { action } = await prompts({
1082
+ name: 'action',
1083
+ type: 'select',
1084
+ message: 'Your project has not been initialized yet. Initialize now?',
1085
+ choices,
1086
+ });
1087
+ this.log();
1088
+ switch (action) {
1089
+ case 'init': {
1090
+ try {
1091
+ this.style.actionStart('Initializing project');
1092
+ await api.projects.create({
1093
+ name: projectName,
1094
+ logicalId,
1095
+ repoUrl,
1096
+ });
1097
+ this.style.actionSuccess();
1098
+ }
1099
+ catch (err) {
1100
+ this.style.actionFailure();
1101
+ throw err;
1102
+ }
1103
+ break;
1104
+ }
1105
+ case 'mistake':
1106
+ this.style.fatal(`Please verify your configuration and try again.`);
1107
+ this.cancelAndExit();
1108
+ break;
1109
+ case 'exit':
1110
+ // falls through
1111
+ default: {
1112
+ this.cancelAndExit();
1113
+ }
1114
+ }
1115
+ }
1116
+ async #handleExistingPlans(plans) {
1117
+ const choices = [{
1118
+ title: 'I want to exit and rethink',
1119
+ value: 'exit',
1120
+ description: 'No changes will be made.',
1121
+ }, {
1122
+ title: 'I want to see some basic details about the existing plans first',
1123
+ value: 'show',
1124
+ }, {
1125
+ title: 'I want to cancel all existing plans and create a new plan',
1126
+ value: 'cancel-proceed',
1127
+ }, {
1128
+ title: 'I want to create a new plan regardless',
1129
+ value: 'new',
1130
+ }];
1131
+ while (true) {
1132
+ const { action } = await prompts({
1133
+ name: 'action',
1134
+ type: 'select',
1135
+ message: `Found ${plans.length} existing uncommitted plan(s). How do you want to proceed?`,
1136
+ choices,
1137
+ });
1138
+ this.log();
1139
+ switch (action) {
1140
+ case 'show': {
1141
+ this.log();
1142
+ for (const plan of plans) {
1143
+ this.log(`Plan ${plan.id}:`);
1144
+ this.log(` Created at: ${new Date(plan.createdAt)}`);
1145
+ this.log(` Applied?: ${plan.appliedAt ? 'yes' : 'no'}`);
1146
+ if (plan.appliedAt) {
1147
+ this.log(` Applied at: ${new Date(plan.appliedAt)}`);
1148
+ }
1149
+ this.log();
1150
+ }
1151
+ const { action } = await prompts({
1152
+ name: 'action',
1153
+ type: 'select',
1154
+ message: 'Do you want to exit or retry?',
1155
+ choices: [{
1156
+ title: 'Exit',
1157
+ value: 'exit',
1158
+ description: 'No changes will be made.',
1159
+ }, {
1160
+ title: 'Return to previous options',
1161
+ value: 'return',
1162
+ }],
1163
+ });
1164
+ this.log();
1165
+ if (action === 'exit') {
1166
+ this.cancelAndExit();
1167
+ }
1168
+ continue;
1169
+ }
1170
+ case 'cancel-proceed': {
1171
+ this.style.actionStart('Cancelling existing plans');
1172
+ try {
1173
+ for (const plan of plans) {
1174
+ await api.projects.cancelImportPlan(plan.id);
1175
+ this.style.shortSuccess(`Cancelled plan ${plan.id}`);
1176
+ }
1177
+ this.style.actionSuccess();
1178
+ }
1179
+ catch (err) {
1180
+ this.style.actionFailure();
1181
+ throw err;
1182
+ }
1183
+ return;
1184
+ }
1185
+ case 'new': {
1186
+ return;
1187
+ }
1188
+ case 'exit':
1189
+ // falls through
1190
+ default: {
1191
+ this.cancelAndExit();
1192
+ }
1193
+ }
1194
+ }
1195
+ }
1196
+ cancelAndExit() {
1197
+ this.log('Exiting without making any changes.');
1198
+ this.exit(0);
1199
+ }
1200
+ }
1201
+ function previewComment() {
1202
+ return docComment('This Checkly construct file has been generated for preview purposes only.'
1203
+ + '\n\n'
1204
+ + 'Deploying this file will create duplicate resources.');
1205
+ }
1206
+ class InvalidResourceIdentifierError extends Error {
1207
+ }
1208
+ function parseFilter(spec) {
1209
+ const filter = {
1210
+ type: 'include',
1211
+ };
1212
+ if (spec.startsWith('!')) {
1213
+ filter.type = 'exclude';
1214
+ spec = spec.slice(1);
1215
+ }
1216
+ const [type, physicalId] = spec.split(':', 2);
1217
+ const parseId = importables[type];
1218
+ if (parseId === undefined) {
1219
+ throw new Error(`Invalid resource specifier '${spec}': Unsupported resource type '${type}'`);
1220
+ }
1221
+ try {
1222
+ filter.resource = {
1223
+ type,
1224
+ physicalId: parseId(physicalId),
1225
+ };
1226
+ }
1227
+ catch (err) {
1228
+ if (err instanceof InvalidResourceIdentifierError) {
1229
+ throw new Error(`Invalid resource specifier '${spec}': ${err.message}`, { cause: err });
1230
+ }
1231
+ throw err;
1232
+ }
1233
+ return filter;
1234
+ }
1235
+ function integerPhysicalId(value) {
1236
+ if (value === undefined) {
1237
+ return;
1238
+ }
1239
+ if (value === '' || value === '*') {
1240
+ return;
1241
+ }
1242
+ const numberValue = parseInt(value, 10);
1243
+ if (Number.isNaN(numberValue)) {
1244
+ throw new InvalidResourceIdentifierError(`Resource identifier '${value}' must be a valid integer`);
1245
+ }
1246
+ return numberValue;
1247
+ }
1248
+ function uuidPhysicalId(value) {
1249
+ if (value === undefined) {
1250
+ return;
1251
+ }
1252
+ if (value === '' || value === '*') {
1253
+ return;
1254
+ }
1255
+ if (!validateUuid(value)) {
1256
+ throw new InvalidResourceIdentifierError(`Resource identifier '${value}' must be a valid UUID`);
1257
+ }
1258
+ return value;
1259
+ }
1260
+ const importables = {
1261
+ 'alert-channel': integerPhysicalId,
1262
+ 'check-group': integerPhysicalId,
1263
+ 'check': uuidPhysicalId,
1264
+ 'dashboard': integerPhysicalId,
1265
+ 'maintenance-window': integerPhysicalId,
1266
+ 'private-location': uuidPhysicalId,
1267
+ 'status-page-service': uuidPhysicalId,
1268
+ 'status-page': uuidPhysicalId,
1269
+ };
1270
+ function isFilterable(type) {
1271
+ return importables[type] !== undefined;
1272
+ }
1273
+ //# sourceMappingURL=plan.js.map