checkly 9.5.0 → 10.0.0-prerelease-4f88d60

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 (575) hide show
  1. package/README.md +10 -0
  2. package/bin/launch.cjs +12 -0
  3. package/dist/ai-context/context.js +1 -0
  4. package/dist/ai-context/context.js.map +1 -1
  5. package/dist/ai-context/onboarding-boilerplate/checkly-config-template.ts +2 -2
  6. package/dist/ai-context/public-skills/checkly/SKILL.md +34 -5
  7. package/dist/ai-context/skills-command/references/communicate.md +8 -5
  8. package/dist/ai-context/skills-command/references/configure-api-checks.md +1 -9
  9. package/dist/ai-context/skills-command/references/configure-browser-checks.md +1 -8
  10. package/dist/ai-context/skills-command/references/configure-check-groups.md +1 -0
  11. package/dist/ai-context/skills-command/references/configure-dns-monitors.md +1 -9
  12. package/dist/ai-context/skills-command/references/configure-grpc-monitors.md +24 -0
  13. package/dist/ai-context/skills-command/references/configure-heartbeat-monitors.md +1 -9
  14. package/dist/ai-context/skills-command/references/configure-icmp-monitors.md +1 -9
  15. package/dist/ai-context/skills-command/references/configure-multistep-checks.md +1 -9
  16. package/dist/ai-context/skills-command/references/configure-playwright-checks.md +2 -2
  17. package/dist/ai-context/skills-command/references/configure-supporting-constructs.md +6 -2
  18. package/dist/ai-context/skills-command/references/configure-tcp-monitors.md +1 -10
  19. package/dist/ai-context/skills-command/references/configure-url-monitors.md +1 -10
  20. package/dist/ai-context/skills-command/references/configure.md +17 -5
  21. package/dist/ai-context/skills-command/references/initialize.md +11 -3
  22. package/dist/ai-context/skills-command/references/investigate-checks.md +1 -1
  23. package/dist/auth/api-key.d.ts +24 -0
  24. package/dist/auth/api-key.js +104 -0
  25. package/dist/auth/api-key.js.map +1 -0
  26. package/dist/auth/device-flow.d.ts +58 -0
  27. package/dist/auth/device-flow.js +228 -0
  28. package/dist/auth/device-flow.js.map +1 -0
  29. package/dist/auth/index.d.ts +6 -6
  30. package/dist/auth/index.js +64 -64
  31. package/dist/auth/index.js.map +1 -1
  32. package/dist/commands/account/plan.js +1 -1
  33. package/dist/commands/account/plan.js.map +1 -1
  34. package/dist/commands/account/usage/projections.d.ts +16 -0
  35. package/dist/commands/account/usage/projections.js +40 -0
  36. package/dist/commands/account/usage/projections.js.map +1 -0
  37. package/dist/commands/account/usage/series.d.ts +7 -3
  38. package/dist/commands/account/usage/series.js +30 -87
  39. package/dist/commands/account/usage/series.js.map +1 -1
  40. package/dist/commands/account/usage/summary.d.ts +4 -1
  41. package/dist/commands/account/usage/summary.js +19 -27
  42. package/dist/commands/account/usage/summary.js.map +1 -1
  43. package/dist/commands/account/usage/term.d.ts +15 -0
  44. package/dist/commands/account/usage/term.js +32 -0
  45. package/dist/commands/account/usage/term.js.map +1 -0
  46. package/dist/commands/account/usage/terms.d.ts +4 -0
  47. package/dist/commands/account/usage/terms.js +19 -27
  48. package/dist/commands/account/usage/terms.js.map +1 -1
  49. package/dist/commands/alert-channels/get.js +2 -1
  50. package/dist/commands/alert-channels/get.js.map +1 -1
  51. package/dist/commands/alert-channels/list.js +2 -1
  52. package/dist/commands/alert-channels/list.js.map +1 -1
  53. package/dist/commands/alert-channels/logs.js +2 -1
  54. package/dist/commands/alert-channels/logs.js.map +1 -1
  55. package/dist/commands/api.js +53 -10
  56. package/dist/commands/api.js.map +1 -1
  57. package/dist/commands/assets/download.js +11 -7
  58. package/dist/commands/assets/download.js.map +1 -1
  59. package/dist/commands/assets/list.js +2 -3
  60. package/dist/commands/assets/list.js.map +1 -1
  61. package/dist/commands/authCommand.d.ts +19 -0
  62. package/dist/commands/authCommand.js +118 -12
  63. package/dist/commands/authCommand.js.map +1 -1
  64. package/dist/commands/baseCommand.d.ts +12 -1
  65. package/dist/commands/baseCommand.js +24 -5
  66. package/dist/commands/baseCommand.js.map +1 -1
  67. package/dist/commands/checks/delete.js +1 -1
  68. package/dist/commands/checks/delete.js.map +1 -1
  69. package/dist/commands/checks/run.js +3 -1
  70. package/dist/commands/checks/run.js.map +1 -1
  71. package/dist/commands/debug/parse-project.d.ts +1 -0
  72. package/dist/commands/debug/parse-project.js +5 -2
  73. package/dist/commands/debug/parse-project.js.map +1 -1
  74. package/dist/commands/deploy.d.ts +8 -2
  75. package/dist/commands/deploy.js +735 -274
  76. package/dist/commands/deploy.js.map +1 -1
  77. package/dist/commands/destroy.js +3 -3
  78. package/dist/commands/destroy.js.map +1 -1
  79. package/dist/commands/env/add.js +2 -2
  80. package/dist/commands/env/add.js.map +1 -1
  81. package/dist/commands/env/ls.js +2 -1
  82. package/dist/commands/env/ls.js.map +1 -1
  83. package/dist/commands/env/pull.js +3 -3
  84. package/dist/commands/env/pull.js.map +1 -1
  85. package/dist/commands/env/update.js +2 -2
  86. package/dist/commands/env/update.js.map +1 -1
  87. package/dist/commands/import/apply.js +12 -10
  88. package/dist/commands/import/apply.js.map +1 -1
  89. package/dist/commands/import/cancel.js +4 -4
  90. package/dist/commands/import/cancel.js.map +1 -1
  91. package/dist/commands/import/commit.js +11 -9
  92. package/dist/commands/import/commit.js.map +1 -1
  93. package/dist/commands/import/plan.js +82 -62
  94. package/dist/commands/import/plan.js.map +1 -1
  95. package/dist/commands/init.d.ts +2 -0
  96. package/dist/commands/init.js +62 -41
  97. package/dist/commands/init.js.map +1 -1
  98. package/dist/commands/login.d.ts +38 -2
  99. package/dist/commands/login.js +848 -52
  100. package/dist/commands/login.js.map +1 -1
  101. package/dist/commands/logout.js +10 -4
  102. package/dist/commands/logout.js.map +1 -1
  103. package/dist/commands/pw-test.js +6 -3
  104. package/dist/commands/pw-test.js.map +1 -1
  105. package/dist/commands/rca/get.js +1 -1
  106. package/dist/commands/rca/get.js.map +1 -1
  107. package/dist/commands/rca/run.js +1 -1
  108. package/dist/commands/rca/run.js.map +1 -1
  109. package/dist/commands/skills/index.js +1 -1
  110. package/dist/commands/skills/index.js.map +1 -1
  111. package/dist/commands/skills/install.js +12 -12
  112. package/dist/commands/skills/install.js.map +1 -1
  113. package/dist/commands/switch.d.ts +10 -1
  114. package/dist/commands/switch.js +75 -13
  115. package/dist/commands/switch.js.map +1 -1
  116. package/dist/commands/sync-playwright.js +5 -10
  117. package/dist/commands/sync-playwright.js.map +1 -1
  118. package/dist/commands/test.d.ts +2 -0
  119. package/dist/commands/test.js +58 -29
  120. package/dist/commands/test.js.map +1 -1
  121. package/dist/commands/trigger.d.ts +1 -2
  122. package/dist/commands/trigger.js +27 -20
  123. package/dist/commands/trigger.js.map +1 -1
  124. package/dist/commands/validate.js +1 -0
  125. package/dist/commands/validate.js.map +1 -1
  126. package/dist/commands/whoami.d.ts +8 -0
  127. package/dist/commands/whoami.js +57 -6
  128. package/dist/commands/whoami.js.map +1 -1
  129. package/dist/constants.d.ts +3 -2
  130. package/dist/constants.js +8 -1
  131. package/dist/constants.js.map +1 -1
  132. package/dist/constructs/alert-channel-codegen.d.ts +6 -1
  133. package/dist/constructs/alert-channel-codegen.js +12 -6
  134. package/dist/constructs/alert-channel-codegen.js.map +1 -1
  135. package/dist/constructs/alert-channel-subscription.d.ts +1 -0
  136. package/dist/constructs/alert-channel-subscription.js +4 -0
  137. package/dist/constructs/alert-channel-subscription.js.map +1 -1
  138. package/dist/constructs/alert-channel.js +8 -5
  139. package/dist/constructs/alert-channel.js.map +1 -1
  140. package/dist/constructs/alert-escalation-policy-codegen.d.ts +7 -0
  141. package/dist/constructs/alert-escalation-policy-codegen.js +25 -8
  142. package/dist/constructs/alert-escalation-policy-codegen.js.map +1 -1
  143. package/dist/constructs/api-assertion.d.ts +0 -2
  144. package/dist/constructs/api-assertion.js +0 -4
  145. package/dist/constructs/api-assertion.js.map +1 -1
  146. package/dist/constructs/api-check-bundle.d.ts +4 -124
  147. package/dist/constructs/api-check-codegen.js +1 -1
  148. package/dist/constructs/api-check-codegen.js.map +1 -1
  149. package/dist/constructs/api-check.d.ts +8 -128
  150. package/dist/constructs/api-check.js +15 -17
  151. package/dist/constructs/api-check.js.map +1 -1
  152. package/dist/constructs/api-request-codegen.js +10 -8
  153. package/dist/constructs/api-request-codegen.js.map +1 -1
  154. package/dist/constructs/browser-check-bundle.d.ts +11 -125
  155. package/dist/constructs/browser-check-bundle.js +5 -1
  156. package/dist/constructs/browser-check-bundle.js.map +1 -1
  157. package/dist/constructs/browser-check.d.ts +5 -107
  158. package/dist/constructs/browser-check.js +1 -1
  159. package/dist/constructs/browser-check.js.map +1 -1
  160. package/dist/constructs/check-codegen.d.ts +46 -14
  161. package/dist/constructs/check-codegen.js +118 -34
  162. package/dist/constructs/check-codegen.js.map +1 -1
  163. package/dist/constructs/check-group-codegen.js +23 -9
  164. package/dist/constructs/check-group-codegen.js.map +1 -1
  165. package/dist/constructs/check-group-v1.d.ts +28 -16
  166. package/dist/constructs/check-group-v1.js +48 -17
  167. package/dist/constructs/check-group-v1.js.map +1 -1
  168. package/dist/constructs/check-group-v2.d.ts +2 -21
  169. package/dist/constructs/check-group-v2.js +4 -4
  170. package/dist/constructs/check-group-v2.js.map +1 -1
  171. package/dist/constructs/check.d.ts +68 -220
  172. package/dist/constructs/check.js +106 -37
  173. package/dist/constructs/check.js.map +1 -1
  174. package/dist/constructs/construct-codegen.d.ts +1 -2
  175. package/dist/constructs/construct-diagnostics.d.ts +3 -0
  176. package/dist/constructs/construct-diagnostics.js +11 -0
  177. package/dist/constructs/construct-diagnostics.js.map +1 -1
  178. package/dist/constructs/construct.d.ts +30 -4
  179. package/dist/constructs/construct.js +52 -6
  180. package/dist/constructs/construct.js.map +1 -1
  181. package/dist/constructs/dashboard.js +11 -7
  182. package/dist/constructs/dashboard.js.map +1 -1
  183. package/dist/constructs/dns-monitor.d.ts +4 -100
  184. package/dist/constructs/dns-request-codegen.js +1 -1
  185. package/dist/constructs/dns-request-codegen.js.map +1 -1
  186. package/dist/constructs/email-alert-channel-codegen.js +1 -1
  187. package/dist/constructs/email-alert-channel-codegen.js.map +1 -1
  188. package/dist/constructs/engine.d.ts +4 -2
  189. package/dist/constructs/engine.js +3 -1
  190. package/dist/constructs/engine.js.map +1 -1
  191. package/dist/constructs/frequency-codegen.js +10 -2
  192. package/dist/constructs/frequency-codegen.js.map +1 -1
  193. package/dist/constructs/frequency.d.ts +8 -3
  194. package/dist/constructs/frequency.js +7 -2
  195. package/dist/constructs/frequency.js.map +1 -1
  196. package/dist/constructs/grpc-monitor.d.ts +4 -100
  197. package/dist/constructs/grpc-monitor.js +19 -0
  198. package/dist/constructs/grpc-monitor.js.map +1 -1
  199. package/dist/constructs/grpc-request-codegen.js +13 -4
  200. package/dist/constructs/grpc-request-codegen.js.map +1 -1
  201. package/dist/constructs/grpc-request.d.ts +23 -0
  202. package/dist/constructs/heartbeat-monitor.d.ts +2 -1
  203. package/dist/constructs/heartbeat-monitor.js +2 -2
  204. package/dist/constructs/heartbeat-monitor.js.map +1 -1
  205. package/dist/constructs/icmp-monitor.d.ts +4 -100
  206. package/dist/constructs/icmp-request-codegen.js +1 -1
  207. package/dist/constructs/icmp-request-codegen.js.map +1 -1
  208. package/dist/constructs/incidentio-alert-channel-codegen.d.ts +1 -1
  209. package/dist/constructs/incidentio-alert-channel-codegen.js +14 -8
  210. package/dist/constructs/incidentio-alert-channel-codegen.js.map +1 -1
  211. package/dist/constructs/index.d.ts +1 -1
  212. package/dist/constructs/index.js +1 -1
  213. package/dist/constructs/index.js.map +1 -1
  214. package/dist/constructs/internal/assertion-validation.js +1 -2
  215. package/dist/constructs/internal/assertion-validation.js.map +1 -1
  216. package/dist/constructs/internal/codegen/context.d.ts +73 -6
  217. package/dist/constructs/internal/codegen/context.js +78 -6
  218. package/dist/constructs/internal/codegen/context.js.map +1 -1
  219. package/dist/constructs/internal/codegen/index.d.ts +3 -1
  220. package/dist/constructs/internal/codegen/index.js +2 -1
  221. package/dist/constructs/internal/codegen/index.js.map +1 -1
  222. package/dist/constructs/internal/codegen/render.d.ts +68 -0
  223. package/dist/constructs/internal/codegen/render.js +75 -0
  224. package/dist/constructs/internal/codegen/render.js.map +1 -0
  225. package/dist/constructs/internal/common-diagnostics.d.ts +1 -2
  226. package/dist/constructs/internal/common-diagnostics.js +7 -17
  227. package/dist/constructs/internal/common-diagnostics.js.map +1 -1
  228. package/dist/constructs/internal/declaring-file.d.ts +39 -0
  229. package/dist/constructs/internal/declaring-file.js +139 -0
  230. package/dist/constructs/internal/declaring-file.js.map +1 -0
  231. package/dist/constructs/internal/default-retry-strategy.d.ts +9 -0
  232. package/dist/constructs/internal/default-retry-strategy.js +13 -0
  233. package/dist/constructs/internal/default-retry-strategy.js.map +1 -0
  234. package/dist/constructs/internal/retry-strategy-defaults.d.ts +13 -0
  235. package/dist/constructs/internal/retry-strategy-defaults.js +14 -0
  236. package/dist/constructs/internal/retry-strategy-defaults.js.map +1 -0
  237. package/dist/constructs/key-value-pair-codegen.d.ts +6 -1
  238. package/dist/constructs/key-value-pair-codegen.js +24 -3
  239. package/dist/constructs/key-value-pair-codegen.js.map +1 -1
  240. package/dist/constructs/maintenance-window-codegen.d.ts +7 -0
  241. package/dist/constructs/maintenance-window-codegen.js +36 -19
  242. package/dist/constructs/maintenance-window-codegen.js.map +1 -1
  243. package/dist/constructs/maintenance-window.d.ts +37 -3
  244. package/dist/constructs/maintenance-window.js +34 -1
  245. package/dist/constructs/maintenance-window.js.map +1 -1
  246. package/dist/constructs/monitor.d.ts +6 -119
  247. package/dist/constructs/monitor.js +3 -5
  248. package/dist/constructs/monitor.js.map +1 -1
  249. package/dist/constructs/msteams-alert-channel-codegen.d.ts +1 -1
  250. package/dist/constructs/msteams-alert-channel-codegen.js +8 -18
  251. package/dist/constructs/msteams-alert-channel-codegen.js.map +1 -1
  252. package/dist/constructs/multi-step-check-bundle.d.ts +4 -109
  253. package/dist/constructs/multi-step-check.d.ts +4 -100
  254. package/dist/constructs/opsgenie-alert-channel-codegen.js +1 -1
  255. package/dist/constructs/opsgenie-alert-channel-codegen.js.map +1 -1
  256. package/dist/constructs/pagerduty-alert-channel-codegen.js +1 -1
  257. package/dist/constructs/pagerduty-alert-channel-codegen.js.map +1 -1
  258. package/dist/constructs/phone-call-alert-channel-codegen.js +1 -1
  259. package/dist/constructs/phone-call-alert-channel-codegen.js.map +1 -1
  260. package/dist/constructs/playwright-check-bundle.d.ts +10 -130
  261. package/dist/constructs/playwright-check-bundle.js +3 -3
  262. package/dist/constructs/playwright-check-bundle.js.map +1 -1
  263. package/dist/constructs/playwright-check-codegen.d.ts +85 -0
  264. package/dist/constructs/playwright-check-codegen.js +212 -0
  265. package/dist/constructs/playwright-check-codegen.js.map +1 -0
  266. package/dist/constructs/playwright-check.d.ts +14 -122
  267. package/dist/constructs/playwright-check.js +17 -51
  268. package/dist/constructs/playwright-check.js.map +1 -1
  269. package/dist/constructs/private-location-check-assignment.d.ts +1 -0
  270. package/dist/constructs/private-location-check-assignment.js +4 -0
  271. package/dist/constructs/private-location-check-assignment.js.map +1 -1
  272. package/dist/constructs/private-location-group-assignment.d.ts +1 -0
  273. package/dist/constructs/private-location-group-assignment.js +4 -0
  274. package/dist/constructs/private-location-group-assignment.js.map +1 -1
  275. package/dist/constructs/private-location.js +3 -1
  276. package/dist/constructs/private-location.js.map +1 -1
  277. package/dist/constructs/retry-strategy-codegen.d.ts +7 -1
  278. package/dist/constructs/retry-strategy-codegen.js +41 -32
  279. package/dist/constructs/retry-strategy-codegen.js.map +1 -1
  280. package/dist/constructs/retry-strategy.d.ts +0 -4
  281. package/dist/constructs/retry-strategy.js +5 -8
  282. package/dist/constructs/retry-strategy.js.map +1 -1
  283. package/dist/constructs/session.d.ts +38 -1
  284. package/dist/constructs/session.js +73 -3
  285. package/dist/constructs/session.js.map +1 -1
  286. package/dist/constructs/slack-alert-channel-codegen.js +1 -1
  287. package/dist/constructs/slack-alert-channel-codegen.js.map +1 -1
  288. package/dist/constructs/slack-app-alert-channel-codegen.js +1 -1
  289. package/dist/constructs/slack-app-alert-channel-codegen.js.map +1 -1
  290. package/dist/constructs/sms-alert-channel-codegen.js +1 -1
  291. package/dist/constructs/sms-alert-channel-codegen.js.map +1 -1
  292. package/dist/constructs/ssl-monitor.d.ts +4 -142
  293. package/dist/constructs/ssl-request-codegen.js +4 -3
  294. package/dist/constructs/ssl-request-codegen.js.map +1 -1
  295. package/dist/constructs/status-page-v3-automation-rule-codegen.js +5 -4
  296. package/dist/constructs/status-page-v3-automation-rule-codegen.js.map +1 -1
  297. package/dist/constructs/status-page-v3-codegen.js +3 -2
  298. package/dist/constructs/status-page-v3-codegen.js.map +1 -1
  299. package/dist/constructs/status-page-v3-component-codegen.js +8 -7
  300. package/dist/constructs/status-page-v3-component-codegen.js.map +1 -1
  301. package/dist/constructs/tcp-monitor-codegen.js +3 -2
  302. package/dist/constructs/tcp-monitor-codegen.js.map +1 -1
  303. package/dist/constructs/tcp-monitor.d.ts +8 -103
  304. package/dist/constructs/tcp-monitor.js +3 -2
  305. package/dist/constructs/tcp-monitor.js.map +1 -1
  306. package/dist/constructs/telegram-alert-channel-codegen.d.ts +1 -1
  307. package/dist/constructs/telegram-alert-channel-codegen.js +14 -8
  308. package/dist/constructs/telegram-alert-channel-codegen.js.map +1 -1
  309. package/dist/constructs/time-zone.d.ts +24 -0
  310. package/dist/constructs/time-zone.js +455 -0
  311. package/dist/constructs/time-zone.js.map +1 -0
  312. package/dist/constructs/traceroute-monitor.d.ts +4 -100
  313. package/dist/constructs/traceroute-request-codegen.js +2 -2
  314. package/dist/constructs/traceroute-request-codegen.js.map +1 -1
  315. package/dist/constructs/url-monitor-codegen.js +1 -1
  316. package/dist/constructs/url-monitor-codegen.js.map +1 -1
  317. package/dist/constructs/url-monitor.d.ts +7 -123
  318. package/dist/constructs/url-monitor.js +3 -0
  319. package/dist/constructs/url-monitor.js.map +1 -1
  320. package/dist/constructs/url-request-codegen.js +4 -3
  321. package/dist/constructs/url-request-codegen.js.map +1 -1
  322. package/dist/constructs/webhook-alert-channel-codegen.js +3 -3
  323. package/dist/constructs/webhook-alert-channel-codegen.js.map +1 -1
  324. package/dist/formatters/check-result-detail.js +0 -185
  325. package/dist/formatters/check-result-detail.js.map +1 -1
  326. package/dist/formatters/render.d.ts +2 -1
  327. package/dist/formatters/render.js +2 -2
  328. package/dist/formatters/render.js.map +1 -1
  329. package/dist/formatters/usage.d.ts +18 -12
  330. package/dist/formatters/usage.js +285 -245
  331. package/dist/formatters/usage.js.map +1 -1
  332. package/dist/help/help-extension.js +2 -1
  333. package/dist/help/help-extension.js.map +1 -1
  334. package/dist/helpers/accounts.d.ts +28 -0
  335. package/dist/helpers/accounts.js +50 -0
  336. package/dist/helpers/accounts.js.map +1 -0
  337. package/dist/helpers/activate-account.d.ts +13 -0
  338. package/dist/helpers/activate-account.js +24 -0
  339. package/dist/helpers/activate-account.js.map +1 -0
  340. package/dist/helpers/api-fields.js +3 -2
  341. package/dist/helpers/api-fields.js.map +1 -1
  342. package/dist/helpers/cli-mode.d.ts +24 -0
  343. package/dist/helpers/cli-mode.js +64 -8
  344. package/dist/helpers/cli-mode.js.map +1 -1
  345. package/dist/helpers/command-preview.d.ts +44 -0
  346. package/dist/helpers/command-preview.js +29 -9
  347. package/dist/helpers/command-preview.js.map +1 -1
  348. package/dist/helpers/command-style.d.ts +1 -0
  349. package/dist/helpers/command-style.js +51 -37
  350. package/dist/helpers/command-style.js.map +1 -1
  351. package/dist/helpers/flags.d.ts +10 -0
  352. package/dist/helpers/flags.js +18 -0
  353. package/dist/helpers/flags.js.map +1 -1
  354. package/dist/helpers/import-plan-selection.d.ts +1 -1
  355. package/dist/helpers/import-plan-selection.js +8 -20
  356. package/dist/helpers/import-plan-selection.js.map +1 -1
  357. package/dist/helpers/invalid-input-error.d.ts +15 -0
  358. package/dist/helpers/invalid-input-error.js +17 -0
  359. package/dist/helpers/invalid-input-error.js.map +1 -0
  360. package/dist/helpers/number.js +4 -3
  361. package/dist/helpers/number.js.map +1 -1
  362. package/dist/helpers/onboarding/boilerplate.js +15 -3
  363. package/dist/helpers/onboarding/boilerplate.js.map +1 -1
  364. package/dist/helpers/onboarding/index.d.ts +1 -1
  365. package/dist/helpers/onboarding/index.js +1 -1
  366. package/dist/helpers/onboarding/index.js.map +1 -1
  367. package/dist/helpers/onboarding/messages.d.ts +7 -0
  368. package/dist/helpers/onboarding/messages.js +14 -0
  369. package/dist/helpers/onboarding/messages.js.map +1 -1
  370. package/dist/helpers/onboarding/prompt-display.js +2 -2
  371. package/dist/helpers/onboarding/prompt-display.js.map +1 -1
  372. package/dist/helpers/onboarding/prompts-helpers.js +3 -1
  373. package/dist/helpers/onboarding/prompts-helpers.js.map +1 -1
  374. package/dist/helpers/onboarding/skill-install.js +4 -4
  375. package/dist/helpers/onboarding/skill-install.js.map +1 -1
  376. package/dist/helpers/prompts.d.ts +7 -0
  377. package/dist/helpers/prompts.js +10 -0
  378. package/dist/helpers/prompts.js.map +1 -0
  379. package/dist/helpers/result-assets.js +4 -3
  380. package/dist/helpers/result-assets.js.map +1 -1
  381. package/dist/helpers/test-helper.d.ts +14 -0
  382. package/dist/helpers/test-helper.js +33 -3
  383. package/dist/helpers/test-helper.js.map +1 -1
  384. package/dist/helpers/usage.d.ts +51 -14
  385. package/dist/helpers/usage.js +193 -53
  386. package/dist/helpers/usage.js.map +1 -1
  387. package/dist/helpers/wrap.js +1 -1
  388. package/dist/helpers/wrap.js.map +1 -1
  389. package/dist/messages/common-messages.d.ts +1 -0
  390. package/dist/messages/common-messages.js +4 -2
  391. package/dist/messages/common-messages.js.map +1 -1
  392. package/dist/reporters/abstract-list.d.ts +9 -2
  393. package/dist/reporters/abstract-list.js +105 -32
  394. package/dist/reporters/abstract-list.js.map +1 -1
  395. package/dist/reporters/ci.js +7 -4
  396. package/dist/reporters/ci.js.map +1 -1
  397. package/dist/reporters/dot.d.ts +1 -0
  398. package/dist/reporters/dot.js +19 -7
  399. package/dist/reporters/dot.js.map +1 -1
  400. package/dist/reporters/github.d.ts +2 -0
  401. package/dist/reporters/github.js +29 -4
  402. package/dist/reporters/github.js.map +1 -1
  403. package/dist/reporters/json.d.ts +2 -0
  404. package/dist/reporters/json.js +27 -4
  405. package/dist/reporters/json.js.map +1 -1
  406. package/dist/reporters/list.js +10 -8
  407. package/dist/reporters/list.js.map +1 -1
  408. package/dist/reporters/reporter.d.ts +1 -0
  409. package/dist/reporters/reporter.js.map +1 -1
  410. package/dist/reporters/util.d.ts +5 -2
  411. package/dist/reporters/util.js +25 -61
  412. package/dist/reporters/util.js.map +1 -1
  413. package/dist/rest/analytics.js +0 -4
  414. package/dist/rest/analytics.js.map +1 -1
  415. package/dist/rest/api.d.ts +10 -1
  416. package/dist/rest/api.js +44 -9
  417. package/dist/rest/api.js.map +1 -1
  418. package/dist/rest/check-results.d.ts +1 -50
  419. package/dist/rest/check-results.js.map +1 -1
  420. package/dist/rest/checkly-storage.d.ts +6 -1
  421. package/dist/rest/checkly-storage.js +13 -2
  422. package/dist/rest/checkly-storage.js.map +1 -1
  423. package/dist/rest/errors.d.ts +19 -0
  424. package/dist/rest/errors.js +20 -1
  425. package/dist/rest/errors.js.map +1 -1
  426. package/dist/rest/projects.d.ts +254 -4
  427. package/dist/rest/projects.js +208 -17
  428. package/dist/rest/projects.js.map +1 -1
  429. package/dist/rest/usage.d.ts +164 -73
  430. package/dist/rest/usage.js +21 -10
  431. package/dist/rest/usage.js.map +1 -1
  432. package/dist/services/abstract-check-runner.d.ts +34 -2
  433. package/dist/services/abstract-check-runner.js +183 -56
  434. package/dist/services/abstract-check-runner.js.map +1 -1
  435. package/dist/services/check-parser/bundler.d.ts +26 -0
  436. package/dist/services/check-parser/bundler.js +81 -7
  437. package/dist/services/check-parser/bundler.js.map +1 -1
  438. package/dist/services/check-parser/cache-hash.d.ts +1 -4
  439. package/dist/services/check-parser/cache-hash.js.map +1 -1
  440. package/dist/services/check-parser/package-files/json-text-source-file.d.ts +0 -2
  441. package/dist/services/check-parser/package-files/json-text-source-file.js +6 -6
  442. package/dist/services/check-parser/package-files/json-text-source-file.js.map +1 -1
  443. package/dist/services/check-parser/parser.d.ts +3 -2
  444. package/dist/services/check-parser/parser.js +31 -40
  445. package/dist/services/check-parser/parser.js.map +1 -1
  446. package/dist/services/checkly-config-codegen.js +4 -4
  447. package/dist/services/checkly-config-codegen.js.map +1 -1
  448. package/dist/services/checkly-config-loader.d.ts +18 -33
  449. package/dist/services/checkly-config-loader.js +50 -47
  450. package/dist/services/checkly-config-loader.js.map +1 -1
  451. package/dist/services/config.d.ts +42 -1
  452. package/dist/services/config.js +93 -9
  453. package/dist/services/config.js.map +1 -1
  454. package/dist/services/content-hash.d.ts +14 -0
  455. package/dist/services/content-hash.js +22 -0
  456. package/dist/services/content-hash.js.map +1 -0
  457. package/dist/services/deploy-diff/diff-lines.d.ts +52 -0
  458. package/dist/services/deploy-diff/diff-lines.js +327 -0
  459. package/dist/services/deploy-diff/diff-lines.js.map +1 -0
  460. package/dist/services/deploy-diff/double-check.d.ts +9 -0
  461. package/dist/services/deploy-diff/double-check.js +21 -0
  462. package/dist/services/deploy-diff/double-check.js.map +1 -0
  463. package/dist/services/deploy-diff/import-shape.d.ts +171 -0
  464. package/dist/services/deploy-diff/import-shape.js +633 -0
  465. package/dist/services/deploy-diff/import-shape.js.map +1 -0
  466. package/dist/services/deploy-diff/legacy-payload.d.ts +22 -0
  467. package/dist/services/deploy-diff/legacy-payload.js +51 -0
  468. package/dist/services/deploy-diff/legacy-payload.js.map +1 -0
  469. package/dist/services/deploy-diff/plan-summary.d.ts +81 -0
  470. package/dist/services/deploy-diff/plan-summary.js +262 -0
  471. package/dist/services/deploy-diff/plan-summary.js.map +1 -0
  472. package/dist/services/deploy-diff/preview-output.d.ts +63 -0
  473. package/dist/services/deploy-diff/preview-output.js +403 -0
  474. package/dist/services/deploy-diff/preview-output.js.map +1 -0
  475. package/dist/services/deploy-diff/render.d.ts +59 -0
  476. package/dist/services/deploy-diff/render.js +326 -0
  477. package/dist/services/deploy-diff/render.js.map +1 -0
  478. package/dist/services/deploy-diff/shape-changes.d.ts +2 -0
  479. package/dist/services/deploy-diff/shape-changes.js +48 -0
  480. package/dist/services/deploy-diff/shape-changes.js.map +1 -0
  481. package/dist/services/deploy-diff/source-index.d.ts +18 -0
  482. package/dist/services/deploy-diff/source-index.js +48 -0
  483. package/dist/services/deploy-diff/source-index.js.map +1 -0
  484. package/dist/services/deploy-diff/variable-names.d.ts +30 -0
  485. package/dist/services/deploy-diff/variable-names.js +64 -0
  486. package/dist/services/deploy-diff/variable-names.js.map +1 -0
  487. package/dist/services/engine-resolver.js +3 -0
  488. package/dist/services/engine-resolver.js.map +1 -1
  489. package/dist/services/engine-rules-loader.d.ts +6 -0
  490. package/dist/services/engine-rules-loader.js +12 -3
  491. package/dist/services/engine-rules-loader.js.map +1 -1
  492. package/dist/services/oxc-parser.d.ts +26 -0
  493. package/dist/services/oxc-parser.js +70 -0
  494. package/dist/services/oxc-parser.js.map +1 -0
  495. package/dist/services/project-cli.d.ts +75 -0
  496. package/dist/services/project-cli.js +302 -0
  497. package/dist/services/project-cli.js.map +1 -0
  498. package/dist/services/project-parser.d.ts +5 -0
  499. package/dist/services/project-parser.js +25 -13
  500. package/dist/services/project-parser.js.map +1 -1
  501. package/dist/services/skills.js +3 -3
  502. package/dist/services/skills.js.map +1 -1
  503. package/dist/services/snapshot-service.d.ts +25 -8
  504. package/dist/services/snapshot-service.js +46 -4
  505. package/dist/services/snapshot-service.js.map +1 -1
  506. package/dist/services/socket-client.js +1 -1
  507. package/dist/services/socket-client.js.map +1 -1
  508. package/dist/services/test-filters.d.ts +18 -0
  509. package/dist/services/test-filters.js +10 -0
  510. package/dist/services/test-filters.js.map +1 -1
  511. package/dist/services/test-runner.d.ts +1 -1
  512. package/dist/services/test-runner.js +10 -11
  513. package/dist/services/test-runner.js.map +1 -1
  514. package/dist/services/test-session-cancel.d.ts +5 -0
  515. package/dist/services/test-session-cancel.js +28 -3
  516. package/dist/services/test-session-cancel.js.map +1 -1
  517. package/dist/services/trigger-runner.d.ts +1 -1
  518. package/dist/services/trigger-runner.js +2 -2
  519. package/dist/services/trigger-runner.js.map +1 -1
  520. package/dist/services/two-installs.d.ts +39 -0
  521. package/dist/services/two-installs.js +155 -0
  522. package/dist/services/two-installs.js.map +1 -0
  523. package/dist/services/util.d.ts +17 -2
  524. package/dist/services/util.js +118 -11
  525. package/dist/services/util.js.map +1 -1
  526. package/dist/services/write-back/apply-edits.d.ts +29 -0
  527. package/dist/services/write-back/apply-edits.js +255 -0
  528. package/dist/services/write-back/apply-edits.js.map +1 -0
  529. package/dist/services/write-back/helper-edit.d.ts +135 -0
  530. package/dist/services/write-back/helper-edit.js +343 -0
  531. package/dist/services/write-back/helper-edit.js.map +1 -0
  532. package/dist/services/write-back/imports.d.ts +30 -0
  533. package/dist/services/write-back/imports.js +88 -0
  534. package/dist/services/write-back/imports.js.map +1 -0
  535. package/dist/services/write-back/literal-edit.d.ts +183 -0
  536. package/dist/services/write-back/literal-edit.js +359 -0
  537. package/dist/services/write-back/literal-edit.js.map +1 -0
  538. package/dist/services/write-back/output.d.ts +26 -0
  539. package/dist/services/write-back/output.js +110 -0
  540. package/dist/services/write-back/output.js.map +1 -0
  541. package/dist/services/write-back/plan.d.ts +180 -0
  542. package/dist/services/write-back/plan.js +1046 -0
  543. package/dist/services/write-back/plan.js.map +1 -0
  544. package/dist/services/write-back/source-file.d.ts +133 -0
  545. package/dist/services/write-back/source-file.js +460 -0
  546. package/dist/services/write-back/source-file.js.map +1 -0
  547. package/dist/sourcegen/index.d.ts +1 -1
  548. package/dist/sourcegen/index.js +1 -1
  549. package/dist/sourcegen/index.js.map +1 -1
  550. package/dist/sourcegen/program.d.ts +19 -1
  551. package/dist/sourcegen/program.js +32 -7
  552. package/dist/sourcegen/program.js.map +1 -1
  553. package/dist/testing/clear-git-env.d.ts +1 -0
  554. package/dist/testing/clear-git-env.js +25 -0
  555. package/dist/testing/clear-git-env.js.map +1 -0
  556. package/dist/testing/global-setup.d.ts +1 -0
  557. package/dist/testing/global-setup.js +3 -0
  558. package/dist/testing/global-setup.js.map +1 -1
  559. package/oclif.manifest.json +1113 -884
  560. package/package.json +21 -19
  561. package/dist/commands/rules.d.ts +0 -9
  562. package/dist/commands/rules.js +0 -13
  563. package/dist/commands/rules.js.map +0 -1
  564. package/dist/constructs/agentic-check-codegen.d.ts +0 -22
  565. package/dist/constructs/agentic-check-codegen.js +0 -59
  566. package/dist/constructs/agentic-check-codegen.js.map +0 -1
  567. package/dist/constructs/agentic-check.d.ts +0 -237
  568. package/dist/constructs/agentic-check.js +0 -100
  569. package/dist/constructs/agentic-check.js.map +0 -1
  570. package/dist/services/check-parser/package-files/json-text-source-file-parser.d.ts +0 -7
  571. package/dist/services/check-parser/package-files/json-text-source-file-parser.js +0 -47
  572. package/dist/services/check-parser/package-files/json-text-source-file-parser.js.map +0 -1
  573. package/dist/services/check-parser/package-files/source-file-parser.d.ts +0 -10
  574. package/dist/services/check-parser/package-files/source-file-parser.js +0 -13
  575. package/dist/services/check-parser/package-files/source-file-parser.js.map +0 -1
@@ -0,0 +1,326 @@
1
+ import { randomUUID } from 'node:crypto';
2
+ import { ConstructCodegen } from '../../constructs/construct-codegen.js';
3
+ import { Context, renderConstruct } from '../../constructs/internal/codegen/index.js';
4
+ import { Program } from '../../sourcegen/index.js';
5
+ import { blankRedacted, carriesMarker, fillUnchangedFromBefore, isMaskedMarker, markChanged, MASK, nodeAt, pointerSegments, UNRENDERED_KEYS, registerProject, registerUnderCodeName, relationResourcesForAfter, relationResourcesFromBefore, toImportResource, UnshapeableError, } from './import-shape.js';
6
+ import { isShapeChangePath } from './shape-changes.js';
7
+ import { diffLines } from './diff-lines.js';
8
+ const note = (text) => ({ kind: 'note', text });
9
+ /** The line with its text transformed, whichever kind it is. */
10
+ function mapText(line, fn) {
11
+ if (line.kind === 'nested') {
12
+ return { kind: 'nested', line: { ...line.line, text: fn(line.line.text) } };
13
+ }
14
+ return { ...line, text: fn(line.text) };
15
+ }
16
+ const textOf = (line) => line.kind === 'nested' ? line.line.text : line.text;
17
+ const INLINE_VALUE_CAP = 256;
18
+ /**
19
+ * Properties a codegen writes to a file of its own rather than into the
20
+ * construct — a browser or multi-step check's script to a spec file, an API
21
+ * check's setup and teardown scripts to support files, a dashboard's CSS to
22
+ * a style file — leaving an `entrypoint` path behind. A change to one is
23
+ * invisible in the construct diff and is shown as a text diff of its own,
24
+ * whether or not the constructs differ too.
25
+ */
26
+ const OUTSIDE_CONSTRUCT = {
27
+ check: new Set(['/script', '/localSetupScript', '/localTearDownScript']),
28
+ dashboard: new Set(['/customCSS']),
29
+ };
30
+ function isOutsideConstruct(type, path) {
31
+ return OUTSIDE_CONSTRUCT[type]?.has(path) ?? false;
32
+ }
33
+ /**
34
+ * Whether a redaction rule reaches the path a secret change names: the two
35
+ * agree segment for segment as far as the shorter goes, a rule's `*` standing
36
+ * for any one segment. A rule under the path blanks inside the list the
37
+ * change reports whole; a rule above it blanks the object that holds it.
38
+ */
39
+ function ruleReaches(rulePath, changePath) {
40
+ const rule = pointerSegments(rulePath);
41
+ const change = pointerSegments(changePath);
42
+ const shared = Math.min(rule.length, change.length);
43
+ for (let index = 0; index < shared; index += 1) {
44
+ if (rule[index] !== '*' && rule[index] !== change[index]) {
45
+ return false;
46
+ }
47
+ }
48
+ return true;
49
+ }
50
+ function isHash(value) {
51
+ return typeof value === 'object' && value !== null && !Array.isArray(value) && '$hash' in value;
52
+ }
53
+ /** A marker spelled the way the construct prints it. */
54
+ const spellMarker = (_key, member) => (isMaskedMarker(member) ? (member.$masked === 'changed' ? `${MASK} (changed)` : MASK) : member);
55
+ function inline(value) {
56
+ if (value === undefined) {
57
+ return '(absent)';
58
+ }
59
+ if (isHash(value)) {
60
+ return '(content)';
61
+ }
62
+ const text = JSON.stringify(value, spellMarker);
63
+ return text.length > INLINE_VALUE_CAP ? `${text.slice(0, INLINE_VALUE_CAP)}…` : text;
64
+ }
65
+ /** The value at an RFC 6901 pointer, or undefined when the path does not resolve. */
66
+ const valueAt = (root, pointer) => nodeAt(root, pointerSegments(pointer));
67
+ function originNote(change) {
68
+ switch (change.origin) {
69
+ case 'remote':
70
+ return ' (changed in Checkly, overwritten by this deploy)';
71
+ case 'both':
72
+ return ' (also changed in Checkly, overwritten by this deploy)';
73
+ case 'unmanaged':
74
+ return ' (not managed by this project)';
75
+ default:
76
+ return '';
77
+ }
78
+ }
79
+ /** One change as a line of the listing: path, values, and where it came from. */
80
+ function listChange(change) {
81
+ if (change.cause !== undefined) {
82
+ return `${change.path}: changed (${change.cause})${originNote(change)}`;
83
+ }
84
+ return `${change.path}: ${inline(change.before)} -> ${inline(change.after)}${originNote(change)}`;
85
+ }
86
+ function listing(changes, reason) {
87
+ const lines = reason === undefined ? [] : [{ kind: 'reason', text: `(${reason})` }];
88
+ for (const change of changes) {
89
+ lines.push(note(listChange(change)));
90
+ }
91
+ return lines;
92
+ }
93
+ /**
94
+ * The import codegen, with the rendered construct's own variable named as in
95
+ * the user's code, or else after its logical id, on both sides.
96
+ */
97
+ class SideCodegen extends ConstructCodegen {
98
+ variableNames;
99
+ constructor(program, variableNames) {
100
+ super(program);
101
+ this.variableNames = variableNames;
102
+ }
103
+ prepare(logicalId, resource, context) {
104
+ super.prepare(logicalId, resource, context);
105
+ registerUnderCodeName(context, resource, this.variableNames);
106
+ }
107
+ }
108
+ /** A side of the comparison rendered to source text, with its relations registered first. */
109
+ function renderSide(resource, relations, project, ids, maskedValues, variableNames, spelledOut) {
110
+ const program = new Program({
111
+ rootDirectory: '.',
112
+ constructFileSuffix: '.check',
113
+ specFileSuffix: '.spec',
114
+ language: 'typescript',
115
+ });
116
+ const context = new Context({ maskedValues, spelledOut });
117
+ const codegen = new SideCodegen(program, variableNames);
118
+ registerProject(context, program, project, ids, variableNames);
119
+ for (const relation of relations) {
120
+ codegen.prepare(relation.logicalId, relation, context);
121
+ }
122
+ return renderConstruct(codegen, resource.logicalId, resource, { context });
123
+ }
124
+ /**
125
+ * The text diff of a change whose values are content (a script, a body): the
126
+ * deployed text read from `before` at the same pointer, the local text from
127
+ * the local payload. Either side missing means the pointer is spelled
128
+ * differently in the two vocabularies, and only the fact is reported.
129
+ */
130
+ function contentDiff(change, before, local, maxLines) {
131
+ const deployed = valueAt(before, change.path);
132
+ const current = valueAt(local, change.path);
133
+ if (typeof deployed !== 'string' || typeof current !== 'string') {
134
+ return [note(`${change.path}: content changed${originNote(change)}`)];
135
+ }
136
+ const lines = diffLines(deployed, current, { maxLines });
137
+ if (lines === undefined) {
138
+ return [note(`${change.path}: content changed (too large to show)${originNote(change)}`)];
139
+ }
140
+ const nested = lines.map((line) => ({ kind: 'nested', line }));
141
+ return [note(`${change.path}:${originNote(change)}`), ...nested];
142
+ }
143
+ /**
144
+ * Whether every change the entry reports is named by a cause and none is a
145
+ * secret: such an entry is rendered as one `changed: <causes>` notice, with
146
+ * no diff, so it needs no deployed state, and the API sends it none.
147
+ */
148
+ export function changedByCauseAlone(entry) {
149
+ const changes = entry.changes ?? [];
150
+ return changes.length > 0 && changes.every(change => change.secret !== true && change.cause !== undefined);
151
+ }
152
+ export function renderResourceDiff(input) {
153
+ const { entry, local, localResources, diff, project, ids, ...options } = input;
154
+ const { pruneRelations, variableNames, spelledOut, maxLines } = options;
155
+ const lines = [];
156
+ const changes = entry.changes ?? [];
157
+ // A secret is shown inline, masked, with `(changed)` on the element the
158
+ // report marks; a secret change whose mark could not be placed (no
159
+ // markers reported, an element the payload does not hold, a position the
160
+ // rules blank to null) is named after the block instead, so a secret's
161
+ // movement is visible exactly once. The block is rendered for a secret
162
+ // change even when nothing else is reported, since the API reports the
163
+ // list holding a moved secret whole, plain siblings' edits included.
164
+ const shown = changes.filter(change => change.secret !== true);
165
+ const marked = new Set();
166
+ try {
167
+ lines.push(...renderShown(shown, marked, entry, local, localResources, diff, project, ids, { pruneRelations, variableNames, spelledOut, maxLines }));
168
+ }
169
+ catch (cause) {
170
+ // A payload this CLI cannot shape like an import resource, a codegen that
171
+ // does not cover the type, a script it cannot
172
+ // parse, a construct it refuses: the listing says what changed even when
173
+ // the rendering cannot.
174
+ const reason = cause instanceof UnshapeableError
175
+ ? cause.message
176
+ : `could not render this resource: ${cause instanceof Error ? cause.message : cause}`;
177
+ if (shown.length > 0) {
178
+ lines.push(...listing(shown, reason));
179
+ }
180
+ }
181
+ for (const change of changes) {
182
+ if (change.secret !== true) {
183
+ continue;
184
+ }
185
+ if (!marked.has(change)) {
186
+ lines.push(note(`secret changed: ${change.path}${originNote(change)}`));
187
+ }
188
+ else if (originNote(change) !== '') {
189
+ // The inline mark says which secret moved; the note says the deploy overwrites it.
190
+ lines.push(note(`${change.path}:${originNote(change)}`));
191
+ }
192
+ }
193
+ return lines;
194
+ }
195
+ /** The reported side a mark is read from: the local side follows the code's movement, the deployed side the backend's. */
196
+ function reportedFor(change, side) {
197
+ if (side === 'local') {
198
+ return change.origin === 'code' || change.origin === 'both' ? change.after : undefined;
199
+ }
200
+ return change.origin === 'both' ? change.remote?.after : change.origin === 'remote' ? change.after : undefined;
201
+ }
202
+ function renderShown(shown, marked, entry, local, localResources, diff, project, ids, options) {
203
+ const { pruneRelations, variableNames, spelledOut, maxLines } = options;
204
+ // A secret change withholds the list it is in whole, plain siblings' edits
205
+ // included, so the construct diff — both sides blanked — is the only place
206
+ // such an edit shows: an entry with a secret change is rendered even when
207
+ // nothing else is reported, and a cause alone does not stand in for it.
208
+ // Rendered only when a reported rule reaches every secret's path, though:
209
+ // the local side's blanks come from that table, and a gap in it must not
210
+ // print what the API withheld.
211
+ const secrets = (entry.changes ?? []).filter(change => change.secret === true);
212
+ const withSecrets = secrets.length > 0;
213
+ if (shown.length === 0 && !withSecrets) {
214
+ return [];
215
+ }
216
+ if (changedByCauseAlone(entry)) {
217
+ return [note(`changed: ${[...new Set(shown.map(change => change.cause))].join(', ')}`)];
218
+ }
219
+ // A change that is secret or carries a marker (a reorder of a list holding
220
+ // one) is rendered only when a reported rule reaches its path.
221
+ const guarded = (entry.changes ?? []).filter(change => change.secret === true
222
+ || carriesMarker(change.before) || carriesMarker(change.after) || carriesMarker(change.remote));
223
+ if (!guarded.every(change => (entry.redactions ?? []).some(rule => ruleReaches(rule.path, change.path)))) {
224
+ return listing(shown);
225
+ }
226
+ if (entry.before === undefined || local === undefined || local.payload === null || local.payload === undefined) {
227
+ return listing(shown);
228
+ }
229
+ const { type, logicalId } = entry;
230
+ // The deployed side is the import format already, straight from the API,
231
+ // less what neither side renders — dropped before the local side is filled
232
+ // from it, so the fill cannot copy it across.
233
+ const before = { ...entry.before };
234
+ for (const key of UNRENDERED_KEYS) {
235
+ delete before[key];
236
+ }
237
+ // Both sides masked by the same rules; the deployed side arrives blanked.
238
+ // A copy, since the marks are written in place and `entry.before` is
239
+ // read again for relations and text diffs.
240
+ const deployed = {
241
+ type: type,
242
+ logicalId,
243
+ payload: blankRedacted(structuredClone(before), entry.redactions),
244
+ };
245
+ // Shaped first, then filled with what the deploy leaves as it is, masked
246
+ // last: the rules are spelled in the import format's vocabulary, which is
247
+ // what the shaped payload is in.
248
+ const shaped = toImportResource(deployed.type, logicalId, local.payload, ids);
249
+ fillUnchangedFromBefore(shaped.payload, before, entry.changes ?? []);
250
+ const after = { ...shaped, payload: blankRedacted(shaped.payload, entry.redactions) };
251
+ // Then the marks: the element whose secret moved reads `(changed)` on the
252
+ // side that moved it, so the diff names the secret beside its key. Each
253
+ // change writes its own sentinel, unguessable by any value the account or
254
+ // the code could hold, so only a change whose sentinel reached the returned
255
+ // lines counts as marked; the sentinels read `(changed)` in the output.
256
+ // The codegen prints a secret only as one of these strings. The two labels
257
+ // end alike (`#<nonce>-<index>)`): a codegen that names a file or variable
258
+ // after the tail of a credential (an unnamed Slack or PagerDuty channel
259
+ // takes the last four characters of its URL or key) then derives the same
260
+ // name on both sides, and the diff stays free of a spurious rename.
261
+ const nonce = randomUUID();
262
+ const sentinels = new Map();
263
+ secrets.forEach((change, index) => {
264
+ const localLabel = `${MASK} (changed#${nonce}-${index})`;
265
+ const deployedLabel = `${MASK} (changed in Checkly#${nonce}-${index})`;
266
+ const onLocal = markChanged(after.payload, change.path, reportedFor(change, 'local'), localLabel);
267
+ const onDeployed = markChanged(deployed.payload, change.path, reportedFor(change, 'deployed'), deployedLabel);
268
+ if (onLocal || onDeployed) {
269
+ sentinels.set(change, { local: localLabel, deployed: deployedLabel });
270
+ }
271
+ });
272
+ const maskedValues = new Set([MASK, ...[...sentinels.values()].flatMap(pair => [pair.local, pair.deployed])]);
273
+ const showing = (lines) => {
274
+ for (const [change, pair] of sentinels) {
275
+ if (lines.some(line => textOf(line).includes(pair.local) || textOf(line).includes(pair.deployed))) {
276
+ marked.add(change);
277
+ }
278
+ }
279
+ const sentinel = new RegExp(` \\(changed( in Checkly)?#${nonce}-\\d+\\)`, 'g');
280
+ return lines.map(line => mapText(line, text => text.replace(sentinel, ' (changed$1)')));
281
+ };
282
+ const afterRelations = relationResourcesForAfter({ ids, local: localResources, entry, diff, pruneRelations });
283
+ const beforeRelations = relationResourcesFromBefore(type, entry.before);
284
+ const beforeText = renderSide(deployed, beforeRelations, project, ids, maskedValues, variableNames, spelledOut);
285
+ const afterText = renderSide(after, afterRelations, project, ids, maskedValues, variableNames, spelledOut);
286
+ const rendered = diffLines(beforeText, afterText, { maxLines, pairProperties: true });
287
+ if (rendered === undefined) {
288
+ return shown.length > 0 ? listing(shown, 'the construct diff is too large to show') : [];
289
+ }
290
+ if (rendered.length > 0) {
291
+ // The constructs differ. What they cannot show follows: a property kept
292
+ // in a file of its own as a text diff, and a change that is only a cause
293
+ // (a new code bundle, a dependency list) as a line.
294
+ const lines = [...rendered];
295
+ for (const change of shown) {
296
+ if (isOutsideConstruct(type, change.path)) {
297
+ lines.push(...contentDiff(change, entry.before, local.payload, maxLines));
298
+ }
299
+ else if (change.cause !== undefined) {
300
+ lines.push(note(listChange(change)));
301
+ }
302
+ }
303
+ return showing(lines);
304
+ }
305
+ // The renderings agree. When every change is a known shape change, that is
306
+ // the CLI upgrade spelling the same construct differently; the paths alone
307
+ // cannot tell an upgrade from a user editing the same property, so a real
308
+ // edit shows up as construct lines above and never gets here.
309
+ if (shown.length > 0 && shown.every(change => change.origin === 'code' && isShapeChangePath(change.path, type))) {
310
+ return [note('payload format changed (CLI upgrade)')];
311
+ }
312
+ // Otherwise what changed lives outside the construct (a script in its own
313
+ // file, a request body), or is a value the codegen elides.
314
+ const lines = [];
315
+ for (const change of shown) {
316
+ const hashed = isHash(change.before) || isHash(change.after) || isHash(change.remote?.after);
317
+ if (hashed || isOutsideConstruct(type, change.path)) {
318
+ lines.push(...contentDiff(change, entry.before, local.payload, maxLines));
319
+ }
320
+ else {
321
+ lines.push(note(listChange(change)));
322
+ }
323
+ }
324
+ return lines;
325
+ }
326
+ //# sourceMappingURL=render.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"render.js","sourceRoot":"","sources":["../../../src/services/deploy-diff/render.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AACxC,OAAO,EAAE,gBAAgB,EAAE,MAAM,uCAAuC,CAAA;AACxE,OAAO,EAAE,OAAO,EAAE,eAAe,EAAE,MAAM,4CAA4C,CAAA;AAGrF,OAAO,EAAE,OAAO,EAAE,MAAM,0BAA0B,CAAA;AAClD,OAAO,EACL,aAAa,EACb,aAAa,EACb,uBAAuB,EACvB,cAAc,EACd,WAAW,EACX,IAAI,EACJ,MAAM,EAEN,eAAe,EACf,eAAe,EACf,eAAe,EACf,qBAAqB,EACrB,yBAAyB,EACzB,2BAA2B,EAC3B,gBAAgB,EAChB,gBAAgB,GACjB,MAAM,mBAAmB,CAAA;AAE1B,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAA;AACtD,OAAO,EAAE,SAAS,EAAiB,MAAM,iBAAiB,CAAA;AAwB1D,MAAM,IAAI,GAAG,CAAC,IAAY,EAAgB,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,CAAA;AAErE,gEAAgE;AAChE,SAAS,OAAO,CAAE,IAAkB,EAAE,EAA4B;IAChE,IAAI,IAAI,CAAC,IAAI,KAAK,QAAQ,EAAE,CAAC;QAC3B,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,EAAE,GAAG,IAAI,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,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC;YACpD,KAAK,CAAC,IAAI,CAAC,GAAG,WAAW,CAAC,MAAM,EAAE,KAAK,CAAC,MAAM,EAAE,KAAK,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC,CAAA;QAC3E,CAAC;aAAM,CAAC;YACN,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC,CAAA;QACtC,CAAC;IACH,CAAC;IACD,OAAO,KAAK,CAAA;AACd,CAAC"}
@@ -0,0 +1,2 @@
1
+ /** Whether a reported change path is one of the known shape changes for the resource type, or lies under one. */
2
+ export declare function isShapeChangePath(path: string, type: string): boolean;
@@ -0,0 +1,48 @@
1
+ /**
2
+ * Leaf paths whose difference is a CLI upgrade changing how a payload is
3
+ * spelled, not a user editing a construct: private locations moving from an
4
+ * inline list to assignment resources, `doubleCheck` becoming a retry
5
+ * strategy, alert settings and parallel scheduling moving to the v2 group
6
+ * defaults. After such an upgrade every affected resource reports a
7
+ * code-origin change once and rewrites its snapshot; rather than render a
8
+ * property diff of two spellings of the same thing, the preview says so.
9
+ *
10
+ * An enumerated list, extended with each shape change. It carries no copy of
11
+ * any backend default: membership is by path alone, which is why the
12
+ * renderer consults it only once the two renderings agree — a user editing
13
+ * one of these properties differs in the construct, and prints as that.
14
+ *
15
+ * A path that is a shape change for one resource type may be an ordinary
16
+ * property of another (`/description` on a dashboard against a check), so
17
+ * the paths a type adds are listed under that type.
18
+ */
19
+ const SHAPE_CHANGE_PATHS = new Set([
20
+ '/privateLocations',
21
+ '/doubleCheck',
22
+ '/retryStrategy',
23
+ '/alertSettings',
24
+ '/useGlobalAlertSettings',
25
+ '/runParallel',
26
+ ]);
27
+ // Keys the construct used to leave out of the payload when unset and now
28
+ // sends with its default or cleared value, so that a deploy resets what the
29
+ // web app set. For a row that holds another value the API reports the first
30
+ // plan after the upgrade as a change made in Checkly (it knows the value the
31
+ // CLI sends for an unset property), which renders as a construct diff and is
32
+ // offered for write-back, so the list is not consulted for it. It is for the
33
+ // first plan of a resource the API compares with the deployed row alone (no
34
+ // snapshot), where such a difference still arrives as a code-origin change
35
+ // from an absent leaf. A private location's proxy URL is sensitive: the API
36
+ // reports its first null plainly only when the row holds no proxy, so a
37
+ // proxy the deploy clears still renders as a secret change.
38
+ const SHAPE_CHANGE_PATHS_BY_TYPE = new Map([
39
+ ['alert-channel', new Set(['/sendRecovery', '/sendFailure', '/sendDegraded', '/sslExpiry', '/sslExpiryThreshold'])],
40
+ ['private-location', new Set(['/proxyUrl'])],
41
+ ['dashboard', new Set(['/customUrl', '/customDomain', '/logo', '/favicon', '/link', '/header', '/description'])],
42
+ ]);
43
+ /** Whether a reported change path is one of the known shape changes for the resource type, or lies under one. */
44
+ export function isShapeChangePath(path, type) {
45
+ const known = [...SHAPE_CHANGE_PATHS, ...(SHAPE_CHANGE_PATHS_BY_TYPE.get(type) ?? [])];
46
+ return known.some(prefix => path === prefix || path.startsWith(`${prefix}/`));
47
+ }
48
+ //# sourceMappingURL=shape-changes.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"shape-changes.js","sourceRoot":"","sources":["../../../src/services/deploy-diff/shape-changes.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,kBAAkB,GAAwB,IAAI,GAAG,CAAC;IACtD,mBAAmB;IACnB,cAAc;IACd,gBAAgB;IAChB,gBAAgB;IAChB,yBAAyB;IACzB,cAAc;CACf,CAAC,CAAA;AAEF,yEAAyE;AACzE,4EAA4E;AAC5E,4EAA4E;AAC5E,6EAA6E;AAC7E,6EAA6E;AAC7E,6EAA6E;AAC7E,4EAA4E;AAC5E,2EAA2E;AAC3E,4EAA4E;AAC5E,wEAAwE;AACxE,4DAA4D;AAC5D,MAAM,0BAA0B,GAA6C,IAAI,GAAG,CAAC;IACnF,CAAC,eAAe,EAAE,IAAI,GAAG,CAAC,CAAC,eAAe,EAAE,cAAc,EAAE,eAAe,EAAE,YAAY,EAAE,qBAAqB,CAAC,CAAC,CAAC;IACnH,CAAC,kBAAkB,EAAE,IAAI,GAAG,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC;IAC5C,CAAC,WAAW,EAAE,IAAI,GAAG,CAAC,CAAC,YAAY,EAAE,eAAe,EAAE,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,SAAS,EAAE,cAAc,CAAC,CAAC,CAAC;CACjH,CAAC,CAAA;AAEF,iHAAiH;AACjH,MAAM,UAAU,iBAAiB,CAAE,IAAY,EAAE,IAAY;IAC3D,MAAM,KAAK,GAAG,CAAC,GAAG,kBAAkB,EAAE,GAAG,CAAC,0BAA0B,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC,CAAA;IACtF,OAAO,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,IAAI,KAAK,MAAM,IAAI,IAAI,CAAC,UAAU,CAAC,GAAG,MAAM,GAAG,CAAC,CAAC,CAAA;AAC/E,CAAC"}
@@ -0,0 +1,18 @@
1
+ import type { TSESTree } from '@typescript-eslint/types';
2
+ import type { Construct } from '../../constructs/construct.js';
3
+ import { type ParsedSource } from '../write-back/source-file.js';
4
+ /**
5
+ * The project's source files as the deploy plan reads them, each parsed
6
+ * once however many constructs it declares. Everything here is best effort:
7
+ * a file that cannot be read or parsed, or a construct whose declaration
8
+ * cannot be found in it, yields `undefined`, and the plan renders without
9
+ * what the source would have told it.
10
+ */
11
+ export declare class SourceIndex {
12
+ #private;
13
+ source(filePath: string): ParsedSource | undefined;
14
+ /** The options literal of the construct's `new <Class>('<logicalId>', { … })` in the file that declares it. */
15
+ options(construct: Construct): TSESTree.ObjectExpression | undefined;
16
+ /** The properties the construct's declaration spells out (`ContextOptions.spelledOut`), when it can be read. */
17
+ spelledOut(construct: Construct): ReadonlySet<string> | undefined;
18
+ }
@@ -0,0 +1,48 @@
1
+ import fs from 'node:fs';
2
+ import { exportedNamesOf, findConstructOptions, parseSource, spelledOutPaths, WriteBackSkipped, } from '../write-back/source-file.js';
3
+ /**
4
+ * The project's source files as the deploy plan reads them, each parsed
5
+ * once however many constructs it declares. Everything here is best effort:
6
+ * a file that cannot be read or parsed, or a construct whose declaration
7
+ * cannot be found in it, yields `undefined`, and the plan renders without
8
+ * what the source would have told it.
9
+ */
10
+ export class SourceIndex {
11
+ #sources = new Map();
12
+ source(filePath) {
13
+ if (!this.#sources.has(filePath)) {
14
+ let source;
15
+ try {
16
+ source = parseSource(filePath, fs.readFileSync(filePath, 'utf8'));
17
+ }
18
+ catch {
19
+ // A file that cannot be read or parsed tells nothing.
20
+ }
21
+ this.#sources.set(filePath, source);
22
+ }
23
+ return this.#sources.get(filePath);
24
+ }
25
+ /** The options literal of the construct's `new <Class>('<logicalId>', { … })` in the file that declares it. */
26
+ options(construct) {
27
+ const filePath = construct.checkFileAbsolutePath;
28
+ const source = filePath !== undefined ? this.source(filePath) : undefined;
29
+ if (source === undefined) {
30
+ return undefined;
31
+ }
32
+ try {
33
+ return findConstructOptions(source, construct.logicalId, exportedNamesOf(construct));
34
+ }
35
+ catch (err) {
36
+ if (err instanceof WriteBackSkipped) {
37
+ return undefined;
38
+ }
39
+ throw err;
40
+ }
41
+ }
42
+ /** The properties the construct's declaration spells out (`ContextOptions.spelledOut`), when it can be read. */
43
+ spelledOut(construct) {
44
+ const options = this.options(construct);
45
+ return options === undefined ? undefined : spelledOutPaths(options);
46
+ }
47
+ }
48
+ //# sourceMappingURL=source-index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"source-index.js","sourceRoot":"","sources":["../../../src/services/deploy-diff/source-index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,SAAS,CAAA;AAKxB,OAAO,EACL,eAAe,EACf,oBAAoB,EACpB,WAAW,EAEX,eAAe,EACf,gBAAgB,GACjB,MAAM,8BAA8B,CAAA;AAErC;;;;;;GAMG;AACH,MAAM,OAAO,WAAW;IACb,QAAQ,GAAG,IAAI,GAA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,CAAC,CAAC,CAAC,eAAe,CAAC,OAAO,CAAC,CAAA;IACrE,CAAC;CACF"}
@@ -0,0 +1,30 @@
1
+ import type { Project } from '../../constructs/project.js';
2
+ import { type ConstructExport } from '../../constructs/session.js';
3
+ import { SourceIndex } from './source-index.js';
4
+ /** The variable each construct goes by in the user's code, keyed like `PhysicalIds` (`idKey`). */
5
+ export type VariableNames = ReadonlyMap<string, string>;
6
+ /**
7
+ * The name each referenceable construct of the project (a group, an alert
8
+ * channel, a private location, a status page and its parts) has in the
9
+ * user's code, so a deploy preview refers to it the way the code does rather
10
+ * than by a name generated from its logical id.
11
+ *
12
+ * The name the file that creates the construct exports it by comes first: it
13
+ * is what another file imports the construct by, and it is known however the
14
+ * construct was made. A file that exports the construct by several names
15
+ * settles it with the one its declaration uses. Check files are the only
16
+ * files whose exports are seen, so for the rest (a construct declared in a
17
+ * shared module, or one that is not exported) the name is read from the
18
+ * declaration in the file that creates the construct. An export from some
19
+ * other check file, which passes the construct on under a name of its own,
20
+ * comes last. A construct with none of these is left out and keeps its
21
+ * generated name.
22
+ *
23
+ * The name is the one where the construct is made. A file that imports the
24
+ * construct under an alias, or reaches it through a namespace, still calls
25
+ * it something else. And two constructs that go by the same name in
26
+ * different files cannot both have it in one rendered construct: the second
27
+ * one registered gets a counter (`group`, `group2`), the same on both sides
28
+ * of a comparison.
29
+ */
30
+ export declare function constructVariableNames(project: Project, exports?: readonly ConstructExport[], sources?: SourceIndex): VariableNames;
@@ -0,0 +1,64 @@
1
+ import { Session } from '../../constructs/session.js';
2
+ import { exportedNamesOf, findConstructVariable, IDENTIFIER } from '../write-back/source-file.js';
3
+ import { idKey, REFERENCEABLE_TYPES } from './import-shape.js';
4
+ import { SourceIndex } from './source-index.js';
5
+ /**
6
+ * The name each referenceable construct of the project (a group, an alert
7
+ * channel, a private location, a status page and its parts) has in the
8
+ * user's code, so a deploy preview refers to it the way the code does rather
9
+ * than by a name generated from its logical id.
10
+ *
11
+ * The name the file that creates the construct exports it by comes first: it
12
+ * is what another file imports the construct by, and it is known however the
13
+ * construct was made. A file that exports the construct by several names
14
+ * settles it with the one its declaration uses. Check files are the only
15
+ * files whose exports are seen, so for the rest (a construct declared in a
16
+ * shared module, or one that is not exported) the name is read from the
17
+ * declaration in the file that creates the construct. An export from some
18
+ * other check file, which passes the construct on under a name of its own,
19
+ * comes last. A construct with none of these is left out and keeps its
20
+ * generated name.
21
+ *
22
+ * The name is the one where the construct is made. A file that imports the
23
+ * construct under an alias, or reaches it through a namespace, still calls
24
+ * it something else. And two constructs that go by the same name in
25
+ * different files cannot both have it in one rendered construct: the second
26
+ * one registered gets a counter (`group`, `group2`), the same on both sides
27
+ * of a comparison.
28
+ */
29
+ export function constructVariableNames(project, exports = Session.constructExports, sources = new SourceIndex()) {
30
+ const names = new Map();
31
+ for (const type of REFERENCEABLE_TYPES) {
32
+ for (const [logicalId, construct] of Object.entries(project.data[type])) {
33
+ // A reference construct (`fromId(...)`) is rendered as the reference it is.
34
+ if (construct.member === false) {
35
+ continue;
36
+ }
37
+ const declaredIn = construct.checkFileAbsolutePath;
38
+ const exported = exports
39
+ .filter(candidate => candidate.type === type && candidate.logicalId === logicalId
40
+ && candidate.exportName !== 'default' && IDENTIFIER.test(candidate.exportName));
41
+ const own = exported.filter(candidate => candidate.filePath === declaredIn).map(({ exportName }) => exportName);
42
+ const declared = () => {
43
+ const source = declaredIn !== undefined ? sources.source(declaredIn) : undefined;
44
+ return source && findConstructVariable(source, logicalId, exportedNamesOf(construct));
45
+ };
46
+ let name;
47
+ if (own.length === 1) {
48
+ name = own[0];
49
+ }
50
+ else if (own.length > 1) {
51
+ const variable = declared();
52
+ name = variable !== undefined && own.includes(variable) ? variable : own[0];
53
+ }
54
+ else {
55
+ name = declared() ?? exported[0]?.exportName;
56
+ }
57
+ if (name !== undefined) {
58
+ names.set(idKey(type, logicalId), name);
59
+ }
60
+ }
61
+ }
62
+ return names;
63
+ }
64
+ //# sourceMappingURL=variable-names.js.map
@@ -0,0 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CAAC,EAAE,UAAU,EAAE,EAAE,EAAE,CAAC,UAAU,CAAC,CAAA;YAC/G,MAAM,QAAQ,GAAG,GAAG,EAAE;gBACpB,MAAM,MAAM,GAAG,UAAU,KAAK,SAAS,CAAC,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,SAAS,CAAA;gBAChF,OAAO,MAAM,IAAI,qBAAqB,CAAC,MAAM,EAAE,SAAS,EAAE,eAAe,CAAC,SAAS,CAAC,CAAC,CAAA;YACvF,CAAC,CAAA;YACD,IAAI,IAAwB,CAAA;YAC5B,IAAI,GAAG,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;gBACrB,IAAI,GAAG,GAAG,CAAC,CAAC,CAAC,CAAA;YACf,CAAC;iBAAM,IAAI,GAAG,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;gBAC1B,MAAM,QAAQ,GAAG,QAAQ,EAAE,CAAA;gBAC3B,IAAI,GAAG,QAAQ,KAAK,SAAS,IAAI,GAAG,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAA;YAC7E,CAAC;iBAAM,CAAC;gBACN,IAAI,GAAG,QAAQ,EAAE,IAAI,QAAQ,CAAC,CAAC,CAAC,EAAE,UAAU,CAAA;YAC9C,CAAC;YACD,IAAI,IAAI,KAAK,SAAS,EAAE,CAAC;gBACvB,KAAK,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,EAAE,SAAS,CAAC,EAAE,IAAI,CAAC,CAAA;YACzC,CAAC;QACH,CAAC;IACH,CAAC;IACD,OAAO,KAAK,CAAA;AACd,CAAC"}
@@ -8,6 +8,9 @@ function resolveWithConfig(version, config) {
8
8
  if (seen.has(current))
9
9
  break;
10
10
  seen.add(current);
11
+ if (config.aliases?.includes(current)) {
12
+ return { version: current, notices, denied: false };
13
+ }
11
14
  const sv = semver.coerce(current);
12
15
  if (!sv) {
13
16
  return { version: config.default, notices, denied: false };
@@ -1 +1 @@
1
- {"version":3,"file":"engine-resolver.js","sourceRoot":"","sources":["../../src/services/engine-resolver.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,QAAQ,CAAA;AAC3B,OAAO,EAAE,eAAe,EAAE,eAAe,EAA4B,MAAM,0BAA0B,CAAA;AAQrG,SAAS,iBAAiB,CAAE,OAAe,EAAE,MAA2B;IACtE,MAAM,OAAO,GAAa,EAAE,CAAA;IAC5B,MAAM,IAAI,GAAG,IAAI,GAAG,EAAU,CAAA;IAC9B,IAAI,OAAO,GAAG,OAAO,CAAA;IAErB,OAAO,IAAI,EAAE,CAAC;QACZ,IAAI,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC;YAAE,MAAK;QAC5B,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,CAAA;QAEjB,MAAM,EAAE,GAAG,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,CAAA;QACjC,IAAI,CAAC,EAAE,EAAE,CAAC;YACR,OAAO,EAAE,OAAO,EAAE,MAAM,CAAC,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,CAAA;QAC5D,CAAC;QAED,IAAI,OAAO,GAAG,KAAK,CAAA;QACnB,KAAK,MAAM,IAAI,IAAI,MAAM,CAAC,KAAK,EAAE,CAAC;YAChC,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,EAAE,EAAE,IAAI,CAAC,MAAM,CAAC;gBAAE,SAAQ;YAChD,OAAO,GAAG,IAAI,CAAA;YAEd,IAAI,IAAI,CAAC,MAAM,EAAE,CAAC;gBAChB,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,UAAU,CAAC,WAAW,EAAE,OAAO,CAAC,CAAC,CAAA;YAC5D,CAAC;YAED,IAAI,IAAI,CAAC,MAAM,KAAK,MAAM,EAAE,CAAC;gBAC3B,OAAO,EAAE,OAAO,EAAE,EAAE,EAAE,OAAO,EA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AK,OAAO,EAAE,CAAC;gBACrC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,CAAA;YAClD,CAAC;YAED,OAAO,GAAG,IAAI,CAAA;YACd,MAAK;QACP,CAAC;QAED,IAAI,CAAC,OAAO,EAAE,CAAC;YACb,OAAO,EAAE,OAAO,EAAE,MAAM,CAAC,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,CAAA;QAC5D,CAAC;IACH,CAAC;IAED,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,CAAA;AACrD,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,oBAAoB,CAAE,OAAe,EAAE,UAAkB;IAC7E,MAAM,KAAK,GAAG,MAAM,eAAe,EAAE,CAAA;IACrC,MAAM,MAAM,GAAG,eAAe,CAAC,KAAK,EAAE,UAAU,CAAC,CAAA;IACjD,IAAI,CAAC,MAAM,EAAE,CAAC;QACZ,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,CAAA;IAChD,CAAC;IACD,OAAO,iBAAiB,CAAC,OAAO,EAAE,MAAM,CAAC,CAAA;AAC3C,CAAC"}
@@ -7,6 +7,12 @@ export interface EngineRule {
7
7
  }
8
8
  export interface EngineVersionConfig {
9
9
  default: string;
10
+ /**
11
+ * Version strings accepted exactly as written, before any semver coercion.
12
+ * Bun's `'1'` means "the newest 1.x available on the runner"; coerced, it
13
+ * would read as 1.0.0 and be remapped like an old version.
14
+ */
15
+ aliases?: string[];
10
16
  rules: EngineRule[];
11
17
  }
12
18
  interface EngineEntry {