checkly 9.5.0 → 10.0.0-rc.1

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 (372) hide show
  1. package/dist/ai-context/context.js +1 -0
  2. package/dist/ai-context/context.js.map +1 -1
  3. package/dist/ai-context/onboarding-boilerplate/checkly-config-template.ts +2 -0
  4. package/dist/ai-context/public-skills/checkly/SKILL.md +18 -5
  5. package/dist/ai-context/skills-command/references/communicate.md +6 -3
  6. package/dist/ai-context/skills-command/references/configure-api-checks.md +1 -9
  7. package/dist/ai-context/skills-command/references/configure-browser-checks.md +1 -8
  8. package/dist/ai-context/skills-command/references/configure-check-groups.md +1 -0
  9. package/dist/ai-context/skills-command/references/configure-dns-monitors.md +1 -9
  10. package/dist/ai-context/skills-command/references/configure-grpc-monitors.md +24 -0
  11. package/dist/ai-context/skills-command/references/configure-heartbeat-monitors.md +1 -9
  12. package/dist/ai-context/skills-command/references/configure-icmp-monitors.md +1 -9
  13. package/dist/ai-context/skills-command/references/configure-multistep-checks.md +1 -9
  14. package/dist/ai-context/skills-command/references/configure-playwright-checks.md +1 -1
  15. package/dist/ai-context/skills-command/references/configure-supporting-constructs.md +6 -2
  16. package/dist/ai-context/skills-command/references/configure-tcp-monitors.md +1 -10
  17. package/dist/ai-context/skills-command/references/configure-url-monitors.md +1 -10
  18. package/dist/ai-context/skills-command/references/configure.md +16 -5
  19. package/dist/ai-context/skills-command/references/initialize.md +11 -3
  20. package/dist/ai-context/skills-command/references/investigate-checks.md +1 -1
  21. package/dist/auth/api-key.d.ts +24 -0
  22. package/dist/auth/api-key.js +104 -0
  23. package/dist/auth/api-key.js.map +1 -0
  24. package/dist/auth/device-flow.d.ts +57 -0
  25. package/dist/auth/device-flow.js +221 -0
  26. package/dist/auth/device-flow.js.map +1 -0
  27. package/dist/auth/index.d.ts +6 -6
  28. package/dist/auth/index.js +64 -64
  29. package/dist/auth/index.js.map +1 -1
  30. package/dist/commands/api.js +43 -10
  31. package/dist/commands/api.js.map +1 -1
  32. package/dist/commands/authCommand.d.ts +2 -0
  33. package/dist/commands/authCommand.js +77 -7
  34. package/dist/commands/authCommand.js.map +1 -1
  35. package/dist/commands/debug/parse-project.d.ts +1 -0
  36. package/dist/commands/debug/parse-project.js +5 -2
  37. package/dist/commands/debug/parse-project.js.map +1 -1
  38. package/dist/commands/deploy.d.ts +7 -1
  39. package/dist/commands/deploy.js +627 -271
  40. package/dist/commands/deploy.js.map +1 -1
  41. package/dist/commands/import/plan.js +18 -4
  42. package/dist/commands/import/plan.js.map +1 -1
  43. package/dist/commands/init.js +29 -13
  44. package/dist/commands/init.js.map +1 -1
  45. package/dist/commands/login.d.ts +18 -2
  46. package/dist/commands/login.js +681 -48
  47. package/dist/commands/login.js.map +1 -1
  48. package/dist/commands/logout.js +7 -1
  49. package/dist/commands/logout.js.map +1 -1
  50. package/dist/commands/pw-test.js +3 -2
  51. package/dist/commands/pw-test.js.map +1 -1
  52. package/dist/commands/switch.js +23 -10
  53. package/dist/commands/switch.js.map +1 -1
  54. package/dist/commands/test.js +16 -17
  55. package/dist/commands/test.js.map +1 -1
  56. package/dist/commands/trigger.js +4 -3
  57. package/dist/commands/trigger.js.map +1 -1
  58. package/dist/commands/validate.js +1 -0
  59. package/dist/commands/validate.js.map +1 -1
  60. package/dist/constants.d.ts +1 -2
  61. package/dist/constants.js +0 -1
  62. package/dist/constants.js.map +1 -1
  63. package/dist/constructs/alert-channel-codegen.d.ts +6 -1
  64. package/dist/constructs/alert-channel-codegen.js +12 -6
  65. package/dist/constructs/alert-channel-codegen.js.map +1 -1
  66. package/dist/constructs/alert-escalation-policy-codegen.d.ts +7 -0
  67. package/dist/constructs/alert-escalation-policy-codegen.js +25 -8
  68. package/dist/constructs/alert-escalation-policy-codegen.js.map +1 -1
  69. package/dist/constructs/api-assertion.d.ts +0 -2
  70. package/dist/constructs/api-assertion.js +0 -4
  71. package/dist/constructs/api-assertion.js.map +1 -1
  72. package/dist/constructs/api-check-codegen.js +1 -1
  73. package/dist/constructs/api-check-codegen.js.map +1 -1
  74. package/dist/constructs/api-check.d.ts +4 -22
  75. package/dist/constructs/api-check.js +15 -17
  76. package/dist/constructs/api-check.js.map +1 -1
  77. package/dist/constructs/api-request-codegen.js +10 -8
  78. package/dist/constructs/api-request-codegen.js.map +1 -1
  79. package/dist/constructs/browser-check-bundle.d.ts +19 -13
  80. package/dist/constructs/browser-check-bundle.js +5 -1
  81. package/dist/constructs/browser-check-bundle.js.map +1 -1
  82. package/dist/constructs/browser-check.d.ts +1 -4
  83. package/dist/constructs/browser-check.js +1 -1
  84. package/dist/constructs/browser-check.js.map +1 -1
  85. package/dist/constructs/check-codegen.d.ts +39 -14
  86. package/dist/constructs/check-codegen.js +101 -23
  87. package/dist/constructs/check-codegen.js.map +1 -1
  88. package/dist/constructs/check-group-codegen.js +23 -9
  89. package/dist/constructs/check-group-codegen.js.map +1 -1
  90. package/dist/constructs/check-group-v1.d.ts +19 -14
  91. package/dist/constructs/check-group-v1.js +39 -14
  92. package/dist/constructs/check-group-v1.js.map +1 -1
  93. package/dist/constructs/check-group-v2.d.ts +0 -20
  94. package/dist/constructs/check-group-v2.js +0 -4
  95. package/dist/constructs/check-group-v2.js.map +1 -1
  96. package/dist/constructs/check.d.ts +45 -32
  97. package/dist/constructs/check.js +78 -17
  98. package/dist/constructs/check.js.map +1 -1
  99. package/dist/constructs/construct-codegen.d.ts +1 -2
  100. package/dist/constructs/construct-diagnostics.d.ts +3 -0
  101. package/dist/constructs/construct-diagnostics.js +11 -0
  102. package/dist/constructs/construct-diagnostics.js.map +1 -1
  103. package/dist/constructs/construct.d.ts +25 -4
  104. package/dist/constructs/construct.js +41 -5
  105. package/dist/constructs/construct.js.map +1 -1
  106. package/dist/constructs/dns-request-codegen.js +1 -1
  107. package/dist/constructs/dns-request-codegen.js.map +1 -1
  108. package/dist/constructs/email-alert-channel-codegen.js +1 -1
  109. package/dist/constructs/email-alert-channel-codegen.js.map +1 -1
  110. package/dist/constructs/frequency-codegen.js +10 -2
  111. package/dist/constructs/frequency-codegen.js.map +1 -1
  112. package/dist/constructs/frequency.d.ts +8 -3
  113. package/dist/constructs/frequency.js +7 -2
  114. package/dist/constructs/frequency.js.map +1 -1
  115. package/dist/constructs/grpc-monitor.js +19 -0
  116. package/dist/constructs/grpc-monitor.js.map +1 -1
  117. package/dist/constructs/grpc-request-codegen.js +13 -4
  118. package/dist/constructs/grpc-request-codegen.js.map +1 -1
  119. package/dist/constructs/grpc-request.d.ts +23 -0
  120. package/dist/constructs/heartbeat-monitor.d.ts +2 -1
  121. package/dist/constructs/heartbeat-monitor.js +2 -2
  122. package/dist/constructs/heartbeat-monitor.js.map +1 -1
  123. package/dist/constructs/icmp-request-codegen.js +1 -1
  124. package/dist/constructs/icmp-request-codegen.js.map +1 -1
  125. package/dist/constructs/incidentio-alert-channel-codegen.d.ts +1 -1
  126. package/dist/constructs/incidentio-alert-channel-codegen.js +14 -8
  127. package/dist/constructs/incidentio-alert-channel-codegen.js.map +1 -1
  128. package/dist/constructs/index.d.ts +1 -1
  129. package/dist/constructs/index.js +1 -1
  130. package/dist/constructs/index.js.map +1 -1
  131. package/dist/constructs/internal/assertion-validation.js +1 -2
  132. package/dist/constructs/internal/assertion-validation.js.map +1 -1
  133. package/dist/constructs/internal/codegen/context.d.ts +73 -6
  134. package/dist/constructs/internal/codegen/context.js +78 -6
  135. package/dist/constructs/internal/codegen/context.js.map +1 -1
  136. package/dist/constructs/internal/codegen/index.d.ts +3 -1
  137. package/dist/constructs/internal/codegen/index.js +2 -1
  138. package/dist/constructs/internal/codegen/index.js.map +1 -1
  139. package/dist/constructs/internal/codegen/render.d.ts +68 -0
  140. package/dist/constructs/internal/codegen/render.js +75 -0
  141. package/dist/constructs/internal/codegen/render.js.map +1 -0
  142. package/dist/constructs/internal/common-diagnostics.d.ts +1 -2
  143. package/dist/constructs/internal/common-diagnostics.js +6 -14
  144. package/dist/constructs/internal/common-diagnostics.js.map +1 -1
  145. package/dist/constructs/internal/declaring-file.d.ts +39 -0
  146. package/dist/constructs/internal/declaring-file.js +139 -0
  147. package/dist/constructs/internal/declaring-file.js.map +1 -0
  148. package/dist/constructs/internal/retry-strategy-defaults.d.ts +13 -0
  149. package/dist/constructs/internal/retry-strategy-defaults.js +14 -0
  150. package/dist/constructs/internal/retry-strategy-defaults.js.map +1 -0
  151. package/dist/constructs/key-value-pair-codegen.d.ts +6 -1
  152. package/dist/constructs/key-value-pair-codegen.js +24 -3
  153. package/dist/constructs/key-value-pair-codegen.js.map +1 -1
  154. package/dist/constructs/maintenance-window-codegen.d.ts +7 -0
  155. package/dist/constructs/maintenance-window-codegen.js +36 -19
  156. package/dist/constructs/maintenance-window-codegen.js.map +1 -1
  157. package/dist/constructs/maintenance-window.d.ts +35 -3
  158. package/dist/constructs/maintenance-window.js +35 -1
  159. package/dist/constructs/maintenance-window.js.map +1 -1
  160. package/dist/constructs/monitor.d.ts +1 -1
  161. package/dist/constructs/msteams-alert-channel-codegen.d.ts +1 -1
  162. package/dist/constructs/msteams-alert-channel-codegen.js +8 -18
  163. package/dist/constructs/msteams-alert-channel-codegen.js.map +1 -1
  164. package/dist/constructs/opsgenie-alert-channel-codegen.js +1 -1
  165. package/dist/constructs/opsgenie-alert-channel-codegen.js.map +1 -1
  166. package/dist/constructs/pagerduty-alert-channel-codegen.js +1 -1
  167. package/dist/constructs/pagerduty-alert-channel-codegen.js.map +1 -1
  168. package/dist/constructs/phone-call-alert-channel-codegen.js +1 -1
  169. package/dist/constructs/phone-call-alert-channel-codegen.js.map +1 -1
  170. package/dist/constructs/playwright-check-bundle.d.ts +7 -1
  171. package/dist/constructs/playwright-check-bundle.js +3 -0
  172. package/dist/constructs/playwright-check-bundle.js.map +1 -1
  173. package/dist/constructs/playwright-check-codegen.d.ts +85 -0
  174. package/dist/constructs/playwright-check-codegen.js +212 -0
  175. package/dist/constructs/playwright-check-codegen.js.map +1 -0
  176. package/dist/constructs/playwright-check.d.ts +14 -24
  177. package/dist/constructs/playwright-check.js +16 -52
  178. package/dist/constructs/playwright-check.js.map +1 -1
  179. package/dist/constructs/retry-strategy-codegen.d.ts +7 -1
  180. package/dist/constructs/retry-strategy-codegen.js +41 -32
  181. package/dist/constructs/retry-strategy-codegen.js.map +1 -1
  182. package/dist/constructs/retry-strategy.d.ts +0 -4
  183. package/dist/constructs/retry-strategy.js +5 -8
  184. package/dist/constructs/retry-strategy.js.map +1 -1
  185. package/dist/constructs/session.d.ts +26 -1
  186. package/dist/constructs/session.js +33 -2
  187. package/dist/constructs/session.js.map +1 -1
  188. package/dist/constructs/slack-alert-channel-codegen.js +1 -1
  189. package/dist/constructs/slack-alert-channel-codegen.js.map +1 -1
  190. package/dist/constructs/slack-app-alert-channel-codegen.js +1 -1
  191. package/dist/constructs/slack-app-alert-channel-codegen.js.map +1 -1
  192. package/dist/constructs/sms-alert-channel-codegen.js +1 -1
  193. package/dist/constructs/sms-alert-channel-codegen.js.map +1 -1
  194. package/dist/constructs/ssl-request-codegen.js +4 -3
  195. package/dist/constructs/ssl-request-codegen.js.map +1 -1
  196. package/dist/constructs/status-page-v3-automation-rule-codegen.js +5 -4
  197. package/dist/constructs/status-page-v3-automation-rule-codegen.js.map +1 -1
  198. package/dist/constructs/status-page-v3-codegen.js +3 -2
  199. package/dist/constructs/status-page-v3-codegen.js.map +1 -1
  200. package/dist/constructs/status-page-v3-component-codegen.js +8 -7
  201. package/dist/constructs/status-page-v3-component-codegen.js.map +1 -1
  202. package/dist/constructs/tcp-monitor-codegen.js +3 -2
  203. package/dist/constructs/tcp-monitor-codegen.js.map +1 -1
  204. package/dist/constructs/tcp-monitor.d.ts +4 -3
  205. package/dist/constructs/tcp-monitor.js +3 -2
  206. package/dist/constructs/tcp-monitor.js.map +1 -1
  207. package/dist/constructs/telegram-alert-channel-codegen.d.ts +1 -1
  208. package/dist/constructs/telegram-alert-channel-codegen.js +14 -8
  209. package/dist/constructs/telegram-alert-channel-codegen.js.map +1 -1
  210. package/dist/constructs/time-zone.d.ts +24 -0
  211. package/dist/constructs/time-zone.js +455 -0
  212. package/dist/constructs/time-zone.js.map +1 -0
  213. package/dist/constructs/traceroute-request-codegen.js +2 -2
  214. package/dist/constructs/traceroute-request-codegen.js.map +1 -1
  215. package/dist/constructs/url-monitor-codegen.js +1 -1
  216. package/dist/constructs/url-monitor-codegen.js.map +1 -1
  217. package/dist/constructs/url-monitor.d.ts +3 -2
  218. package/dist/constructs/url-monitor.js +3 -0
  219. package/dist/constructs/url-monitor.js.map +1 -1
  220. package/dist/constructs/url-request-codegen.js +4 -3
  221. package/dist/constructs/url-request-codegen.js.map +1 -1
  222. package/dist/constructs/webhook-alert-channel-codegen.js +3 -3
  223. package/dist/constructs/webhook-alert-channel-codegen.js.map +1 -1
  224. package/dist/formatters/check-result-detail.js +0 -185
  225. package/dist/formatters/check-result-detail.js.map +1 -1
  226. package/dist/helpers/activate-account.d.ts +14 -0
  227. package/dist/helpers/activate-account.js +25 -0
  228. package/dist/helpers/activate-account.js.map +1 -0
  229. package/dist/helpers/cli-mode.d.ts +18 -0
  230. package/dist/helpers/cli-mode.js +41 -2
  231. package/dist/helpers/cli-mode.js.map +1 -1
  232. package/dist/helpers/command-preview.d.ts +44 -0
  233. package/dist/helpers/command-preview.js +29 -9
  234. package/dist/helpers/command-preview.js.map +1 -1
  235. package/dist/helpers/flags.d.ts +10 -0
  236. package/dist/helpers/flags.js +17 -0
  237. package/dist/helpers/flags.js.map +1 -1
  238. package/dist/helpers/onboarding/boilerplate.js +13 -1
  239. package/dist/helpers/onboarding/boilerplate.js.map +1 -1
  240. package/dist/helpers/onboarding/index.d.ts +1 -1
  241. package/dist/helpers/onboarding/index.js +1 -1
  242. package/dist/helpers/onboarding/index.js.map +1 -1
  243. package/dist/helpers/onboarding/messages.d.ts +6 -0
  244. package/dist/helpers/onboarding/messages.js +14 -0
  245. package/dist/helpers/onboarding/messages.js.map +1 -1
  246. package/dist/helpers/onboarding/skill-install.js +2 -2
  247. package/dist/helpers/onboarding/skill-install.js.map +1 -1
  248. package/dist/helpers/wrap.js +1 -1
  249. package/dist/helpers/wrap.js.map +1 -1
  250. package/dist/reporters/abstract-list.js +11 -2
  251. package/dist/reporters/abstract-list.js.map +1 -1
  252. package/dist/reporters/github.js +3 -2
  253. package/dist/reporters/github.js.map +1 -1
  254. package/dist/reporters/util.d.ts +1 -0
  255. package/dist/reporters/util.js +5 -58
  256. package/dist/reporters/util.js.map +1 -1
  257. package/dist/rest/analytics.js +0 -4
  258. package/dist/rest/analytics.js.map +1 -1
  259. package/dist/rest/api.d.ts +8 -1
  260. package/dist/rest/api.js +21 -3
  261. package/dist/rest/api.js.map +1 -1
  262. package/dist/rest/check-results.d.ts +1 -50
  263. package/dist/rest/check-results.js.map +1 -1
  264. package/dist/rest/checkly-storage.d.ts +6 -1
  265. package/dist/rest/checkly-storage.js +13 -2
  266. package/dist/rest/checkly-storage.js.map +1 -1
  267. package/dist/rest/errors.d.ts +13 -0
  268. package/dist/rest/errors.js +5 -1
  269. package/dist/rest/errors.js.map +1 -1
  270. package/dist/rest/projects.d.ts +254 -4
  271. package/dist/rest/projects.js +184 -12
  272. package/dist/rest/projects.js.map +1 -1
  273. package/dist/services/abstract-check-runner.d.ts +11 -0
  274. package/dist/services/abstract-check-runner.js +98 -46
  275. package/dist/services/abstract-check-runner.js.map +1 -1
  276. package/dist/services/check-parser/bundler.d.ts +26 -0
  277. package/dist/services/check-parser/bundler.js +81 -7
  278. package/dist/services/check-parser/bundler.js.map +1 -1
  279. package/dist/services/check-parser/cache-hash.d.ts +1 -4
  280. package/dist/services/check-parser/cache-hash.js.map +1 -1
  281. package/dist/services/checkly-config-codegen.js +1 -4
  282. package/dist/services/checkly-config-codegen.js.map +1 -1
  283. package/dist/services/checkly-config-loader.d.ts +7 -33
  284. package/dist/services/checkly-config-loader.js +50 -47
  285. package/dist/services/checkly-config-loader.js.map +1 -1
  286. package/dist/services/config.d.ts +2 -0
  287. package/dist/services/config.js +14 -0
  288. package/dist/services/config.js.map +1 -1
  289. package/dist/services/content-hash.d.ts +14 -0
  290. package/dist/services/content-hash.js +22 -0
  291. package/dist/services/content-hash.js.map +1 -0
  292. package/dist/services/deploy-diff/diff-lines.d.ts +38 -0
  293. package/dist/services/deploy-diff/diff-lines.js +191 -0
  294. package/dist/services/deploy-diff/diff-lines.js.map +1 -0
  295. package/dist/services/deploy-diff/import-shape.d.ts +171 -0
  296. package/dist/services/deploy-diff/import-shape.js +633 -0
  297. package/dist/services/deploy-diff/import-shape.js.map +1 -0
  298. package/dist/services/deploy-diff/legacy-payload.d.ts +22 -0
  299. package/dist/services/deploy-diff/legacy-payload.js +51 -0
  300. package/dist/services/deploy-diff/legacy-payload.js.map +1 -0
  301. package/dist/services/deploy-diff/plan-summary.d.ts +37 -0
  302. package/dist/services/deploy-diff/plan-summary.js +154 -0
  303. package/dist/services/deploy-diff/plan-summary.js.map +1 -0
  304. package/dist/services/deploy-diff/preview-output.d.ts +61 -0
  305. package/dist/services/deploy-diff/preview-output.js +394 -0
  306. package/dist/services/deploy-diff/preview-output.js.map +1 -0
  307. package/dist/services/deploy-diff/render.d.ts +53 -0
  308. package/dist/services/deploy-diff/render.js +317 -0
  309. package/dist/services/deploy-diff/render.js.map +1 -0
  310. package/dist/services/deploy-diff/shape-changes.d.ts +2 -0
  311. package/dist/services/deploy-diff/shape-changes.js +35 -0
  312. package/dist/services/deploy-diff/shape-changes.js.map +1 -0
  313. package/dist/services/deploy-diff/source-index.d.ts +18 -0
  314. package/dist/services/deploy-diff/source-index.js +48 -0
  315. package/dist/services/deploy-diff/source-index.js.map +1 -0
  316. package/dist/services/deploy-diff/variable-names.d.ts +30 -0
  317. package/dist/services/deploy-diff/variable-names.js +64 -0
  318. package/dist/services/deploy-diff/variable-names.js.map +1 -0
  319. package/dist/services/project-parser.d.ts +5 -0
  320. package/dist/services/project-parser.js +25 -13
  321. package/dist/services/project-parser.js.map +1 -1
  322. package/dist/services/snapshot-service.d.ts +25 -8
  323. package/dist/services/snapshot-service.js +46 -4
  324. package/dist/services/snapshot-service.js.map +1 -1
  325. package/dist/services/test-filters.d.ts +18 -0
  326. package/dist/services/test-filters.js +10 -0
  327. package/dist/services/test-filters.js.map +1 -1
  328. package/dist/services/test-runner.js +7 -3
  329. package/dist/services/test-runner.js.map +1 -1
  330. package/dist/services/test-session-cancel.js +1 -1
  331. package/dist/services/test-session-cancel.js.map +1 -1
  332. package/dist/services/util.d.ts +17 -2
  333. package/dist/services/util.js +118 -11
  334. package/dist/services/util.js.map +1 -1
  335. package/dist/services/write-back/apply-edits.d.ts +29 -0
  336. package/dist/services/write-back/apply-edits.js +255 -0
  337. package/dist/services/write-back/apply-edits.js.map +1 -0
  338. package/dist/services/write-back/helper-edit.d.ts +135 -0
  339. package/dist/services/write-back/helper-edit.js +343 -0
  340. package/dist/services/write-back/helper-edit.js.map +1 -0
  341. package/dist/services/write-back/imports.d.ts +30 -0
  342. package/dist/services/write-back/imports.js +82 -0
  343. package/dist/services/write-back/imports.js.map +1 -0
  344. package/dist/services/write-back/literal-edit.d.ts +183 -0
  345. package/dist/services/write-back/literal-edit.js +359 -0
  346. package/dist/services/write-back/literal-edit.js.map +1 -0
  347. package/dist/services/write-back/output.d.ts +26 -0
  348. package/dist/services/write-back/output.js +110 -0
  349. package/dist/services/write-back/output.js.map +1 -0
  350. package/dist/services/write-back/plan.d.ts +173 -0
  351. package/dist/services/write-back/plan.js +968 -0
  352. package/dist/services/write-back/plan.js.map +1 -0
  353. package/dist/services/write-back/source-file.d.ts +118 -0
  354. package/dist/services/write-back/source-file.js +432 -0
  355. package/dist/services/write-back/source-file.js.map +1 -0
  356. package/dist/sourcegen/index.d.ts +1 -1
  357. package/dist/sourcegen/index.js +1 -1
  358. package/dist/sourcegen/index.js.map +1 -1
  359. package/dist/sourcegen/program.d.ts +19 -1
  360. package/dist/sourcegen/program.js +32 -7
  361. package/dist/sourcegen/program.js.map +1 -1
  362. package/oclif.manifest.json +676 -635
  363. package/package.json +13 -13
  364. package/dist/commands/rules.d.ts +0 -9
  365. package/dist/commands/rules.js +0 -13
  366. package/dist/commands/rules.js.map +0 -1
  367. package/dist/constructs/agentic-check-codegen.d.ts +0 -22
  368. package/dist/constructs/agentic-check-codegen.js +0 -59
  369. package/dist/constructs/agentic-check-codegen.js.map +0 -1
  370. package/dist/constructs/agentic-check.d.ts +0 -237
  371. package/dist/constructs/agentic-check.js +0 -100
  372. package/dist/constructs/agentic-check.js.map +0 -1
@@ -0,0 +1,110 @@
1
+ import path from 'node:path';
2
+ import chalk from 'chalk';
3
+ import { padColumn, visWidth } from '../../formatters/render.js';
4
+ import { diffLines } from '../deploy-diff/diff-lines.js';
5
+ import { pathToPosix } from '../util.js';
6
+ import { pointerSegments } from '../deploy-diff/import-shape.js';
7
+ import { MARKER, PRETTY_RESOURCE_TYPES, styled } from '../deploy-diff/preview-output.js';
8
+ const counted = (count, one, many) => `${count} ${count === 1 ? one : many}`;
9
+ const sameResource = (a, b) => a.type === b.type && a.logicalId === b.logicalId;
10
+ /** The header line of a resource: marker, class, logical id, and the file when it is known. */
11
+ function header(marker, { type, logicalId }, file, project) {
12
+ const construct = project.data[type]?.[logicalId];
13
+ const name = construct?.constructor.name ?? PRETTY_RESOURCE_TYPES[type] ?? type;
14
+ // With forward slashes on every platform, as the plan names the file.
15
+ return `${marker} ${chalk.bold(name)} ${chalk.bold(logicalId)}`
16
+ + (file !== undefined ? ` ${chalk.dim(pathToPosix(file))}` : '');
17
+ }
18
+ /** A property's old and new source on one line, for a construct whose source cannot be shown as a diff. */
19
+ function propertyLine({ property, previous, rendered }) {
20
+ const oneLine = (text) => text.replace(/\s*\r?\n\s*/g, ' ');
21
+ return ` ${property}: ${previous === undefined ? 'not set' : oneLine(previous)} → ${oneLine(rendered)}`;
22
+ }
23
+ /**
24
+ * The block for the code that was updated: per construct, the diff of its
25
+ * source, then what a diff cannot say (a property that replaced an edit the
26
+ * code had made too, a helper the file now imports).
27
+ */
28
+ export function formatWriteBackUpdated({ writeBack, project }) {
29
+ const { applied, constructs, files, imports } = writeBack;
30
+ const output = [
31
+ `${chalk.bold('Updated your code')} ${chalk.dim('·')} `
32
+ + `${counted(applied.length, 'property', 'properties')} in ${counted(files.length, 'file', 'files')}`,
33
+ '',
34
+ ];
35
+ constructs.forEach((construct, index) => {
36
+ const lines = applied.filter(line => line.file === construct.file && sameResource(line, construct));
37
+ output.push(header(MARKER.update, construct, construct.file, project));
38
+ const diff = diffLines(construct.before, construct.after);
39
+ if (diff === undefined || diff.length === 0) {
40
+ // Too long to diff, which a construct's own source never is in
41
+ // practice: the properties are listed with their values instead.
42
+ output.push(...lines.map(propertyLine));
43
+ }
44
+ else {
45
+ // A diff opens with a hunk boundary, which is shown as the gap between
46
+ // two hunks, so the first one is left out.
47
+ output.push(...diff.slice(1).map(line => ` ${styled(line)}`.trimEnd()));
48
+ }
49
+ for (const line of lines.filter(line => line.replacesLocalEdit)) {
50
+ output.push(` ${styled({ kind: 'note', text: `${line.property}: replaced a local edit` })}`);
51
+ }
52
+ // The import belongs to the file, so it is said once, under the last
53
+ // construct of that file.
54
+ const lastOfFile = !constructs.slice(index + 1).some(other => other.file === construct.file);
55
+ const imported = imports.find(entry => entry.file === construct.file);
56
+ if (lastOfFile && imported !== undefined) {
57
+ output.push(` ${styled({ kind: 'note', text: `imported ${imported.names.join(', ')} from 'checkly/constructs'` })}`);
58
+ }
59
+ output.push('');
60
+ });
61
+ return output.join('\n');
62
+ }
63
+ /**
64
+ * A skipped property as the reader's code names it. A change refused before
65
+ * it was matched to a construct property is known by the path Checkly reports
66
+ * (`/runParallel`), which is shown dotted like the others.
67
+ */
68
+ function propertyName(property) {
69
+ if (!property.startsWith('/')) {
70
+ return property;
71
+ }
72
+ try {
73
+ return pointerSegments(property).join('.');
74
+ }
75
+ catch {
76
+ return property;
77
+ }
78
+ }
79
+ /**
80
+ * The block for what was not written: per resource, each property with the
81
+ * reason, or the reason alone when it is about the whole resource.
82
+ */
83
+ export function formatWriteBackSkipped({ writeBack, project, cwd }) {
84
+ const groups = [];
85
+ for (const skip of writeBack.skipped) {
86
+ const group = groups.find(candidate => sameResource(candidate.resource, skip));
87
+ if (group === undefined) {
88
+ groups.push({ resource: skip, skips: [skip] });
89
+ }
90
+ else {
91
+ group.skips.push(skip);
92
+ }
93
+ }
94
+ const output = [`${chalk.bold('Not updated')} ${chalk.dim('·')} edit these by hand`, ''];
95
+ for (const { resource, skips } of groups) {
96
+ const declaredIn = project.data[resource.type]?.[resource.logicalId]?.checkFileAbsolutePath;
97
+ const file = declaredIn === undefined ? undefined : path.relative(cwd, declaredIn);
98
+ output.push(header(MARKER.warn, resource, file, project));
99
+ const rows = skips.map(({ property, reason }) => ({ property: property === undefined ? undefined : propertyName(property), reason }));
100
+ const width = Math.max(0, ...rows.map(row => visWidth(row.property ?? '')));
101
+ for (const { property, reason } of rows) {
102
+ output.push(property === undefined
103
+ ? ` ${reason}`
104
+ : ` ${padColumn(property, width)} ${chalk.dim(reason)}`);
105
+ }
106
+ output.push('');
107
+ }
108
+ return output.join('\n');
109
+ }
110
+ //# sourceMappingURL=output.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"output.js","sourceRoot":"","sources":["../../../src/services/write-back/output.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,WAAW,CAAA;AAE5B,OAAO,KAAK,MAAM,OAAO,CAAA;AAGzB,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAA;AAChE,OAAO,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAA;AACxD,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAA;AACxC,OAAO,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAA;AAChE,OAAO,EAAE,MAAM,EAAE,qBAAqB,EAAE,MAAM,EAAE,MAAM,kCAAkC,CAAA;AAkBxF,MAAM,OAAO,GAAG,CAAC,KAAa,EAAE,GAAW,EAAE,IAAY,EAAU,EAAE,CAAC,GAAG,KAAK,IAAI,KAAK,KAAK,CAAC,CA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QAClF,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,OAAO,CAAC,CAAC,CAAA;QACzD,MAAM,IAAI,GAAG,KAAK,CAAC,GAAG,CAAC,CAAC,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,CAC9C,CAAC,EAAE,QAAQ,EAAE,QAAQ,KAAK,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,YAAY,CAAC,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC,CAAA;QACtF,MAAM,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,GAAG,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC,QAAQ,CAAC,GAAG,CAAC,QAAQ,IAAI,EAAE,CAAC,CAAC,CAAC,CAAA;QAC3E,KAAK,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,IAAI,IAAI,EAAE,CAAC;YACxC,MAAM,CAAC,IAAI,CAAC,QAAQ,KAAK,SAAS;gBAChC,CAAC,CAAC,OAAO,MAAM,EAAE;gBACjB,CAAC,CAAC,OAAO,SAAS,CAAC,QAAQ,EAAE,KAAK,CAAC,KAAK,KAAK,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC,CAAA;QAChE,CAAC;QACD,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,CAAA;IACjB,CAAC;IACD,OAAO,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;AAC1B,CAAC"}
@@ -0,0 +1,173 @@
1
+ import type { Construct } from '../../constructs/construct.js';
2
+ import type { Project } from '../../constructs/project.js';
3
+ import type { DiffEntry } from '../../rest/projects.js';
4
+ import type { AssertionBuilderName } from './helper-edit.js';
5
+ /**
6
+ * Turns the remote changes of a deploy plan into edits of the construct
7
+ * source files, and applies them: checks, groups, alert channels, private
8
+ * locations, dashboards, maintenance windows and status pages with their
9
+ * services, components and automation rules.
10
+ *
11
+ * A remote change is a property that moved in the Checkly account since the
12
+ * last deploy (`origin: 'remote'`, or `'both'` when the code moved too). The
13
+ * value written is the account's current one, read from the entry's `before`
14
+ * — the deployed resource in the import format, which a full-detail preview
15
+ * carries — at the path the change names. The change list decides *which*
16
+ * paths are written; `before` supplies the values, because a change can
17
+ * carry a hash where `before` carries the text, and a set element change
18
+ * names one element where the code holds the whole list.
19
+ *
20
+ * Only what can be written without guessing is written. A property has to
21
+ * be one this module knows the construct's spelling of (the table below): a
22
+ * literal of the same shape, or a helper expression — `Frequency.EVERY_*`,
23
+ * `RetryStrategyBuilder`, `AlertEscalationBuilder`, an assertion builder —
24
+ * that `helper-edit.ts` renders from the value the way `checkly import`
25
+ * would; a value Checkly withholds — a credential the redaction table
26
+ * blanks, a masked secret, a hash — is never written; and when the change's
27
+ * own report of the current value disagrees with `before`, neither is
28
+ * trusted. Everything refused is listed with its reason.
29
+ */
30
+ export interface WriteBackOptions {
31
+ diff: readonly DiffEntry[];
32
+ project: Project;
33
+ /** The directory file names are shown relative to. */
34
+ cwd: string;
35
+ }
36
+ export interface WriteBackLine {
37
+ /** The edited file, relative to `cwd`. */
38
+ file: string;
39
+ type: string;
40
+ logicalId: string;
41
+ /** The construct property, dotted. */
42
+ property: string;
43
+ /** The source text replaced, or undefined when the property was added. */
44
+ previous?: string;
45
+ /** The source text written. */
46
+ rendered: string;
47
+ /** Whether the code had moved too (`origin: 'both'`), so a local edit is being replaced. */
48
+ replacesLocalEdit: boolean;
49
+ }
50
+ /** A remote change that was not written, or a resource none could be written for. */
51
+ export interface WriteBackSkip {
52
+ type: string;
53
+ logicalId: string;
54
+ /** The property or path the reason is about; none when it is about the whole resource. */
55
+ property?: string;
56
+ reason: string;
57
+ }
58
+ /**
59
+ * The source of one edited construct, from the line its options open on to
60
+ * the line they close on, before its edits and after them: what a reader
61
+ * needs to see the edits in place.
62
+ */
63
+ export interface WriteBackConstruct {
64
+ /** The edited file, relative to `cwd`. */
65
+ file: string;
66
+ type: string;
67
+ logicalId: string;
68
+ before: string;
69
+ after: string;
70
+ }
71
+ export interface WriteBackPlan {
72
+ /** Each file's new text, with the text it was planned from. */
73
+ files: {
74
+ path: string;
75
+ text: string;
76
+ original: string;
77
+ }[];
78
+ applied: WriteBackLine[];
79
+ /** One entry per construct `applied` has lines for, in the order they were edited. */
80
+ constructs: WriteBackConstruct[];
81
+ skipped: WriteBackSkip[];
82
+ /** The helper classes added to each edited file's `checkly/constructs` import. */
83
+ imports: {
84
+ file: string;
85
+ names: string[];
86
+ }[];
87
+ }
88
+ /** How an import-format path maps onto a construct property. */
89
+ export interface Rule {
90
+ /** Segments of the import-format pointer. */
91
+ pointer: string[];
92
+ /** The construct property path the pointer maps to. */
93
+ target: string[];
94
+ /** A list the API reports per element rather than whole; the code holds the whole list. */
95
+ set?: boolean;
96
+ /** Properties that only mean something together are written together or not at all. */
97
+ group?: string;
98
+ /** The helper the construct spells the property with; the value is written as its expression. */
99
+ helper?: {
100
+ kind: 'frequency' | 'retryStrategy' | 'date';
101
+ } | {
102
+ kind: 'alertEscalation';
103
+ policy: AlertPolicyHolder;
104
+ } | {
105
+ kind: 'assertions';
106
+ builder: AssertionBuilderName;
107
+ };
108
+ /** Further pointers whose `before` values the expression needs (`frequencyOffset` beside `frequency`). */
109
+ reads?: string[][];
110
+ /** Sibling keys of the property that make the edit wrong (`doubleCheck` beside `retryStrategy`). */
111
+ unless?: string[];
112
+ /**
113
+ * A rule that routes the changes at its pointer onto another rule's
114
+ * target (the one whose `target` it shares) rather than anchoring a
115
+ * candidate of its own: `/frequencyOffset` belongs to `frequency`,
116
+ * `/useGlobalAlertSettings` to `alertEscalationPolicy`, and a code-origin
117
+ * `/doubleCheck` marks `retryStrategy` as locally changed.
118
+ */
119
+ companion?: true;
120
+ /** For a companion, the reason its changes are refused given the deployed resource, if they are. */
121
+ refuse?: (before: unknown) => string | undefined;
122
+ }
123
+ /**
124
+ * Who holds the alert policy: a check or a v1 group spells "the global
125
+ * policy" by having none, which nothing is ever removed from the code for;
126
+ * a v2 group has the word `'global'` for it, and a group of either version
127
+ * can also have no policy of its own while its checks keep theirs.
128
+ */
129
+ type AlertPolicyHolder = 'check' | 'group' | 'group-v2';
130
+ /**
131
+ * The properties this module writes, per construct class: the ones whose
132
+ * import-format spelling and construct spelling are both literals with the
133
+ * same shape, and the ones the construct spells with a helper this module
134
+ * can render (`frequency`, `retryStrategy`, `alertEscalationPolicy`, the
135
+ * `assertions` of a request), and the SSL request whose wire keys map onto
136
+ * the construct's (`SSL_REQUEST_RULES`). A rule may likewise map a wire
137
+ * pointer onto a prop spelled or nested differently in the construct (an
138
+ * alert channel's `config/<key>` onto its flat prop, a component's
139
+ * `configuration/<key>`, `coolDownWindowMinutes` onto `coolDownMinutes`),
140
+ * and a `refusing` rule names the reason for a leaf the construct fixes or
141
+ * derives. Anything else — references, scripts, a request key the
142
+ * construct does not take — is left to the user.
143
+ *
144
+ * Keyed by the exact class, not by `instanceof`: a class this table does not
145
+ * name gets nothing rather than a base class's rules, so a construct that
146
+ * omits one of them (`PlaywrightCheck` takes no `retryStrategy`, as its
147
+ * codegen's omitted props say) can never be handed it. The spec checks that every
148
+ * construct class `checkly/constructs` exports is listed here or excluded
149
+ * on purpose, and that the omitted props are absent.
150
+ */
151
+ /** A construct class, as a map key. */
152
+ export type ConstructClass = abstract new (...args: any[]) => Construct;
153
+ export declare const RULES_BY_CLASS: ReadonlyMap<ConstructClass, readonly Rule[]>;
154
+ /** The top-level props keys each class's rules write, as the build-time assertion above knows them; the spec holds `RULES_BY_CLASS` to it. */
155
+ export declare const WRITTEN_BY_CLASS: ReadonlyMap<ConstructClass, readonly string[]>;
156
+ /**
157
+ * Whether the plan holds at least one change the planner would try to
158
+ * write: a remote change on a construct of a known class, at a path the
159
+ * class's table covers. Cheap enough to decide whether to offer the
160
+ * write-back at all, without reading any file.
161
+ */
162
+ export declare function hasWritableChanges(diff: readonly DiffEntry[], project: Project): boolean;
163
+ export declare function planWriteBack({ diff, project, cwd }: WriteBackOptions): Promise<WriteBackPlan>;
164
+ /**
165
+ * Writes every planned file through a temporary file in the same directory,
166
+ * flushed to disk and then renamed over the target, so an interrupted write
167
+ * leaves the old file or the new one rather than a torn one. The target is
168
+ * the file itself, not a symlink to it, and it keeps its mode.
169
+ *
170
+ * @throws Error naming the files already rewritten when a later one fails.
171
+ */
172
+ export declare function applyWriteBack(plan: Pick<WriteBackPlan, 'files'>): Promise<void>;
173
+ export {};