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,39 @@
1
+ import path from 'node:path';
2
+ /** What the frame filter needs to know about a call site. */
3
+ export interface Frame {
4
+ fileName?: string | null;
5
+ isConstructor: boolean;
6
+ }
7
+ export interface DeclaringFileOptions {
8
+ /** The directory holding the CLI's own code. */
9
+ ownRoot: string;
10
+ /**
11
+ * The number of classes from `Construct` down to the class being
12
+ * instantiated; each one contributes a constructor frame at the top of
13
+ * the stack.
14
+ */
15
+ constructorChainLength: number;
16
+ /**
17
+ * For tests only, so Windows frames can be exercised on other platforms.
18
+ */
19
+ platformPath?: path.PlatformPath;
20
+ }
21
+ /**
22
+ * Picks the declaring file out of a list of stack frames, innermost first.
23
+ * See the module description for the rules.
24
+ */
25
+ export declare function declaringFileFromFrames(frames: Frame[], { ownRoot, constructorChainLength, platformPath }: DeclaringFileOptions): string | undefined;
26
+ /**
27
+ * The user file that declares the construct whose constructor is running, or
28
+ * `undefined` when no user code is on the stack (the CLI or a test runner
29
+ * created the construct) or the runtime does not expose structured stack
30
+ * frames.
31
+ *
32
+ * `Error.prepareStackTrace` is replaced for the duration of a single
33
+ * synchronous `new Error()` so V8 hands over call sites instead of a
34
+ * formatted string, then restored; only file names and the constructor flag
35
+ * are read, which no source map changes.
36
+ *
37
+ * @param constructorChainLength see {@link DeclaringFileOptions}
38
+ */
39
+ export declare function captureDeclaringFile(constructorChainLength: number): string | undefined;
@@ -0,0 +1,139 @@
1
+ import path from 'node:path';
2
+ import { fileURLToPath } from 'node:url';
3
+ /**
4
+ * Finds the user file that declares a construct by looking at the call
5
+ * stack of the construct's constructor.
6
+ *
7
+ * The project parser loads check files one at a time, but a module a check
8
+ * file imports is evaluated once, during its first importer's load, and then
9
+ * served from the module cache. A construct declared in such a module (a
10
+ * shared alerts file, a group definition no check glob matches) therefore
11
+ * cannot be attributed by "the file being loaded right now": that would name
12
+ * whichever importer happened to load first. The call stack does not have
13
+ * this problem: the frame right below the constructor chain is the code that
14
+ * ran `new SomeCheck(...)`, wherever it lives.
15
+ *
16
+ * Frames are considered from the innermost outwards:
17
+ * - the constructor chain of the construct's own class hierarchy is skipped
18
+ * (one frame per class from `Construct` down to the class being
19
+ * instantiated, subclasses in the user's code included), so the file that
20
+ * ran `new` counts rather than the file declaring a subclass;
21
+ * - frames without a file, `node:` internals and eval'd code are skipped;
22
+ * - frames inside the CLI's own code (`dist/` in the published package,
23
+ * `src/` when run from source) are skipped, so the parser and helpers such
24
+ * as a group's `testMatch` expansion never count either;
25
+ * - the first remaining frame is the answer, unless it sits under a
26
+ * `node_modules` directory: then no user code created the construct (the
27
+ * CLI created it itself and the next frame out is the command runner, or a
28
+ * test runner did), and the caller falls back to the parser's current file.
29
+ *
30
+ * Both jiti (TypeScript check files) and Node's own ESM loader report the
31
+ * original file, as a plain path or a `file://` URL. A module the loader
32
+ * resolved itself is reported at its physical location (symlinks resolved);
33
+ * the file the loader was asked to load keeps the path it was given, which is
34
+ * why the project parser hands it physical paths.
35
+ *
36
+ * Accepted limitations: a construct created inside a helper function or a
37
+ * wrapper class in the user's code is attributed to the helper's file; a
38
+ * construct library installed under `node_modules` (rather than linked from
39
+ * workspace source) falls back to the parser's current file; and V8 emits a
40
+ * single frame for a run of two or more consecutive subclasses without an
41
+ * explicit constructor, so behind such a run one more frame is skipped than
42
+ * the chain has classes, which only matters when that frame is a wrapper
43
+ * class's constructor.
44
+ */
45
+ /**
46
+ * The directory holding the CLI's own code: `dist/` in the published package,
47
+ * `src/` when running from source. Frames under it belong to the CLI, not to
48
+ * the user's project.
49
+ */
50
+ const OWN_ROOT = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '..', '..');
51
+ /**
52
+ * Frames to capture. The CLI's own constructor chain is at most five frames
53
+ * deep (`CheckGroupV1` creating a `BrowserCheck` for a `testMatch` entry);
54
+ * the rest is headroom for subclasses and helper functions in the user's
55
+ * code.
56
+ */
57
+ const STACK_DEPTH = 32;
58
+ const NODE_MODULES_SEGMENT = /[\\/]node_modules[\\/]/;
59
+ function isInside(root, file, platformPath) {
60
+ const relative = platformPath.relative(root, file);
61
+ const escapes = relative === '..' || relative.startsWith(`..${platformPath.sep}`);
62
+ return !escapes && !platformPath.isAbsolute(relative);
63
+ }
64
+ /**
65
+ * Picks the declaring file out of a list of stack frames, innermost first.
66
+ * See the module description for the rules.
67
+ */
68
+ export function declaringFileFromFrames(frames, { ownRoot, constructorChainLength, platformPath = path }) {
69
+ // The chain is skipped by count, not by looking for constructor frames:
70
+ // a wrapper class in the user's code that creates a construct in its own
71
+ // constructor is a helper, and its frame must count. The flag only guards
72
+ // against a chain shorter than expected.
73
+ let skipped = 0;
74
+ for (const { fileName, isConstructor } of frames) {
75
+ if (skipped < constructorChainLength && isConstructor) {
76
+ skipped++;
77
+ continue;
78
+ }
79
+ if (!fileName || fileName.startsWith('node:')) {
80
+ continue;
81
+ }
82
+ let file;
83
+ if (fileName.startsWith('file:')) {
84
+ try {
85
+ file = fileURLToPath(fileName, { windows: platformPath === path.win32 });
86
+ }
87
+ catch {
88
+ continue;
89
+ }
90
+ }
91
+ else if (platformPath.isAbsolute(fileName)) {
92
+ file = fileName;
93
+ }
94
+ else {
95
+ // `<anonymous>`, `eval at ...` and similar.
96
+ continue;
97
+ }
98
+ if (isInside(ownRoot, file, platformPath)) {
99
+ continue;
100
+ }
101
+ return NODE_MODULES_SEGMENT.test(file) ? undefined : file;
102
+ }
103
+ return undefined;
104
+ }
105
+ /**
106
+ * The user file that declares the construct whose constructor is running, or
107
+ * `undefined` when no user code is on the stack (the CLI or a test runner
108
+ * created the construct) or the runtime does not expose structured stack
109
+ * frames.
110
+ *
111
+ * `Error.prepareStackTrace` is replaced for the duration of a single
112
+ * synchronous `new Error()` so V8 hands over call sites instead of a
113
+ * formatted string, then restored; only file names and the constructor flag
114
+ * are read, which no source map changes.
115
+ *
116
+ * @param constructorChainLength see {@link DeclaringFileOptions}
117
+ */
118
+ export function captureDeclaringFile(constructorChainLength) {
119
+ const { prepareStackTrace, stackTraceLimit } = Error;
120
+ let callSites;
121
+ try {
122
+ Error.prepareStackTrace = (_error, sites) => sites;
123
+ Error.stackTraceLimit = STACK_DEPTH;
124
+ callSites = new Error().stack;
125
+ }
126
+ finally {
127
+ Error.prepareStackTrace = prepareStackTrace;
128
+ Error.stackTraceLimit = stackTraceLimit;
129
+ }
130
+ if (!Array.isArray(callSites)) {
131
+ return undefined;
132
+ }
133
+ const frames = callSites.map(site => ({
134
+ fileName: site.getFileName(),
135
+ isConstructor: site.isConstructor(),
136
+ }));
137
+ return declaringFileFromFrames(frames, { ownRoot: OWN_ROOT, constructorChainLength });
138
+ }
139
+ //# sourceMappingURL=declaring-file.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"declaring-file.js","sourceRoot":"","sources":["../../../src/constructs/internal/declaring-file.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,WAAW,CAAA;AAC5B,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAA;AAExC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyCG;AAEH;;;;GAIG;AACH,MAAM,QAAQ,GAAG,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,EAAE,IAAI,CAAC,CAAA;AAEvF;;;;;GAKG;AACH,MAAM,WAAW,GAAG,EAAE,CAAA;AAEtB,MAAM,oBAAoB,GAAG,wBAAwB,CAAA;AAuBrD,SAAS,QAAQ,CAAE,IAAY,EAAE,IAAY,EAAE,YAA+B;IAC5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,OAAO,EAAE,IAAI,EAAE,YAAY,CAAC,EAAE,CAAC;YAC1C,SAAQ;QACV,CAAC;QACD,OAAO,oBAAoB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,CAAA;IAC3D,CAAC;IACD,OAAO,SAAS,CAAA;AAClB,CAAC;AAED;;;;;;;;;;;;GAYG;AACH,MAAM,UAAU,oBAAoB,CAAE,sBAA8B;IAClE,MAAM,EAAE,iBAAiB,EAAE,eAAe,EAAE,GAAG,KAAK,CAAA;IACpD,IAAI,SAAkB,CAAA;IACtB,IAAI,CAAC;QACH,KAAK,CAAC,iBAAiB,GAAG,CAAC,MAAM,EAAE,KAAK,EAAE,EAAE,CAAC,KAAK,CAAA;QAClD,KAAK,CAAC,eAAe,GAAG,WAAW,CAAA;QACnC,SAAS,GAAG,IAAI,KAAK,EAAE,CAAC,KAAK,CAAA;IAC/B,CAAC;YAAS,CAAC;QACT,KAAK,CAAC,iBAAiB,GAAG,iBAAiB,CAAA;QAC3C,KAAK,CAAC,eAAe,GAAG,eAAe,CAAA;IACzC,CAAC;IACD,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,SAAS,CAAC,EAAE,CAAC;QAC9B,OAAO,SAAS,CAAA;IAClB,CAAC;IACD,MAAM,MAAM,GAAI,SAA+B,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QAC3D,QAAQ,EAAE,IAAI,CAAC,WAAW,EAAE;QAC5B,aAAa,EAAE,IAAI,CAAC,aAAa,EAAE;KACpC,CAAC,CAAC,CAAA;IACH,OAAO,uBAAuB,CAAC,MAAM,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE,sBAAsB,EAAE,CAAC,CAAA;AACvF,CAAC"}
@@ -0,0 +1,13 @@
1
+ /**
2
+ * The values `RetryStrategyBuilder` fills in for an option left unset. They
3
+ * live apart from the builder so the retry strategy codegen can compare a
4
+ * stored strategy against them (an option equal to its default is left out
5
+ * of generated code, since the builder puts it back) without exporting
6
+ * anything new from the constructs' public surface.
7
+ */
8
+ export declare const RETRY_STRATEGY_DEFAULTS: {
9
+ readonly baseBackoffSeconds: 60;
10
+ readonly maxRetries: 2;
11
+ readonly maxDurationSeconds: number;
12
+ readonly sameRegion: true;
13
+ };
@@ -0,0 +1,14 @@
1
+ /**
2
+ * The values `RetryStrategyBuilder` fills in for an option left unset. They
3
+ * live apart from the builder so the retry strategy codegen can compare a
4
+ * stored strategy against them (an option equal to its default is left out
5
+ * of generated code, since the builder puts it back) without exporting
6
+ * anything new from the constructs' public surface.
7
+ */
8
+ export const RETRY_STRATEGY_DEFAULTS = {
9
+ baseBackoffSeconds: 60,
10
+ maxRetries: 2,
11
+ maxDurationSeconds: 60 * 10,
12
+ sameRegion: true,
13
+ };
14
+ //# sourceMappingURL=retry-strategy-defaults.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"retry-strategy-defaults.js","sourceRoot":"","sources":["../../../src/constructs/internal/retry-strategy-defaults.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAG;IACrC,kBAAkB,EAAE,EAAE;IACtB,UAAU,EAAE,CAAC;IACb,kBAAkB,EAAE,EAAE,GAAG,EAAE;IAC3B,UAAU,EAAE,IAAI;CACR,CAAA"}
@@ -1,4 +1,9 @@
1
1
  import { GeneratedFile, Program, Value } from '../sourcegen/index.js';
2
2
  import { Context } from './internal/codegen/index.js';
3
3
  import KeyValuePair from './key-value-pair.js';
4
- export declare function valueForKeyValuePair(program: Program, genfile: GeneratedFile, context: Context, kv: KeyValuePair): Value;
4
+ /**
5
+ * @param path The dotted path of the list the pair belongs to
6
+ * (`environmentVariables`, `request.headers`), under which the code being
7
+ * rendered may spell out this pair's flags as `<path>[<key>].locked`.
8
+ */
9
+ export declare function valueForKeyValuePair(program: Program, genfile: GeneratedFile, context: Context, kv: KeyValuePair, path: string): Value;
@@ -1,14 +1,35 @@
1
1
  import { decl, expr, ident, object } from '../sourcegen/index.js';
2
- export function valueForKeyValuePair(program, genfile, context, kv) {
2
+ import { MASKED_VALUE } from './internal/codegen/index.js';
3
+ /**
4
+ * @param path The dotted path of the list the pair belongs to
5
+ * (`environmentVariables`, `request.headers`), under which the code being
6
+ * rendered may spell out this pair's flags as `<path>[<key>].locked`.
7
+ */
8
+ export function valueForKeyValuePair(program, genfile, context, kv, path) {
9
+ const spelledOut = (flag) => context.spelledOut(`${path}[${kv.key}].${flag}`);
3
10
  return object(builder => {
4
11
  builder.string('key', kv.key);
5
12
  if (kv.secret !== true) {
6
13
  builder.string('value', kv.value);
7
14
  }
8
- if (kv.locked === true) {
15
+ else if (context.maskedValues !== undefined) {
16
+ // A preview prints a secret only as a value it masked itself; anything
17
+ // else, whatever it looks like, prints as the plain mask.
18
+ const value = kv.value;
19
+ builder.string('value', context.isMasked(value) ? value : MASKED_VALUE);
20
+ }
21
+ // Both flags default to false; a flag the code spells out is kept
22
+ // whatever its value. A pair without a value for it writes nothing.
23
+ if (kv.locked === true || (kv.locked === false && spelledOut('locked'))) {
9
24
  builder.boolean('locked', kv.locked);
10
25
  }
11
- if (kv.secret === true) {
26
+ if (kv.secret === true && context.maskedValues !== undefined) {
27
+ builder.boolean('secret', true);
28
+ }
29
+ else if (kv.secret === false && spelledOut('secret')) {
30
+ builder.boolean('secret', false);
31
+ }
32
+ else if (kv.secret === true) {
12
33
  const secretVariable = ident(kv.key, {
13
34
  format: 'SCREAMING_SNAKE_CASE',
14
35
  });
@@ -1 +1 @@
1
- {"version":3,"file":"key-value-pair-codegen.js","sourceRoot":"","sources":["../../src/constructs/key-value-pair-codegen.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,IAAI,EAAiB,KAAK,EAAE,MAAM,EAAkB,MAAM,uBAAuB,CAAA;AAIhG,MAAM,UAAU,oBAAoB,CAClC,OAAgB,EAChB,OAAsB,EACtB,OAAgB,EAChB,EAAgB;IAEhB,OAAO,MAAM,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AAC,CAAA;oBACJ,CAAC,CAAC,CAAC,CAAA;oBAEH,OAAO,CAAC,MAAM,EAAE,CAAA;gBAClB,CAAC,CAAC,CAAC,CAAA;YACL,CAAC;YAED,OAAO,CAAC,WAAW,CAAC,cAAc,CAAC,KAAK,EAAE,SAAS,EAAE;gBACnD,cAAc,EAAE,IAAI;aACrB,CAAC,CAAA;YAEF,OAAO,CAAC,KAAK,CAAC,OAAO,EAAE,cAAc,CAAC,CAAA;YAEtC,OAAO,CAAC,OAAO,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAA;QACjC,CAAC;IACH,CAAC,CAAC,CAAA;AACJ,CAAC"}
@@ -1,4 +1,7 @@
1
1
  import { Codegen, Context } from './internal/codegen/index.js';
2
+ import { Value } from '../sourcegen/index.js';
3
+ /** The expression for a timestamp the API reports as an ISO string: `new Date('<iso>')`. */
4
+ export declare function valueForDate(iso: string): Value;
2
5
  export interface MaintenanceWindowResource {
3
6
  name: string;
4
7
  tags: Array<string>;
@@ -7,6 +10,10 @@ export interface MaintenanceWindowResource {
7
10
  repeatInterval?: number | null;
8
11
  repeatUnit?: string;
9
12
  repeatEndsAt?: string;
13
+ timezone?: string | null;
14
+ pauseAllChecks?: boolean;
15
+ silenceAlertsTags?: Array<string>;
16
+ silenceAllAlerts?: boolean;
10
17
  }
11
18
  export declare class MaintenanceWindowCodegen extends Codegen<MaintenanceWindowResource> {
12
19
  describe(resource: MaintenanceWindowResource): string;
@@ -1,5 +1,13 @@
1
1
  import { Codegen } from './internal/codegen/index.js';
2
2
  import { expr, ident } from '../sourcegen/index.js';
3
+ /** The expression for a timestamp the API reports as an ISO string: `new Date('<iso>')`. */
4
+ export function valueForDate(iso) {
5
+ return expr(ident('Date'), builder => {
6
+ builder.new(builder => {
7
+ builder.string(iso);
8
+ });
9
+ });
10
+ }
3
11
  const construct = 'MaintenanceWindow';
4
12
  export class MaintenanceWindowCodegen extends Codegen {
5
13
  describe(resource) {
@@ -16,21 +24,15 @@ export class MaintenanceWindowCodegen extends Codegen {
16
24
  builder.string(logicalId);
17
25
  builder.object(builder => {
18
26
  builder.string('name', resource.name);
19
- builder.array('tags', builder => {
20
- for (const tag of resource.tags) {
21
- builder.string(tag);
22
- }
23
- });
24
- builder.expr('startsAt', ident('Date'), builder => {
25
- builder.new(builder => {
26
- builder.string(resource.startsAt);
27
+ if (resource.tags?.length) {
28
+ builder.array('tags', builder => {
29
+ for (const tag of resource.tags) {
30
+ builder.string(tag);
31
+ }
27
32
  });
28
- });
29
- builder.expr('endsAt', ident('Date'), builder => {
30
- builder.new(builder => {
31
- builder.string(resource.endsAt);
32
- });
33
- });
33
+ }
34
+ builder.value('startsAt', valueForDate(resource.startsAt));
35
+ builder.value('endsAt', valueForDate(resource.endsAt));
34
36
  if (resource.repeatInterval !== undefined && resource.repeatInterval !== null) {
35
37
  builder.number('repeatInterval', resource.repeatInterval);
36
38
  }
@@ -38,13 +40,28 @@ export class MaintenanceWindowCodegen extends Codegen {
38
40
  builder.string('repeatUnit', resource.repeatUnit);
39
41
  }
40
42
  if (resource.repeatEndsAt) {
41
- const repeatEndsAt = resource.repeatEndsAt;
42
- builder.expr('repeatEndsAt', ident('Date'), builder => {
43
- builder.new(builder => {
44
- builder.string(repeatEndsAt);
45
- });
43
+ builder.value('repeatEndsAt', valueForDate(resource.repeatEndsAt));
44
+ }
45
+ // UTC is what an omitted timezone means, so it is left out like the other defaults.
46
+ if (resource.timezone && resource.timezone !== 'UTC') {
47
+ builder.string('timezone', resource.timezone);
48
+ }
49
+ // The default value for pauseAllChecks is false, only include if true.
50
+ if (resource.pauseAllChecks !== undefined && resource.pauseAllChecks) {
51
+ builder.boolean('pauseAllChecks', resource.pauseAllChecks);
52
+ }
53
+ if (resource.silenceAlertsTags?.length) {
54
+ const silenceAlertsTags = resource.silenceAlertsTags;
55
+ builder.array('silenceAlertsTags', builder => {
56
+ for (const tag of silenceAlertsTags) {
57
+ builder.string(tag);
58
+ }
46
59
  });
47
60
  }
61
+ // The default value for silenceAllAlerts is false, only include if true.
62
+ if (resource.silenceAllAlerts !== undefined && resource.silenceAllAlerts) {
63
+ builder.boolean('silenceAllAlerts', resource.silenceAllAlerts);
64
+ }
48
65
  });
49
66
  });
50
67
  }));
@@ -1 +1 @@
1
- {"version":3,"file":"maintenance-window-codegen.js","sourceRoot":"","sources":["../../src/constructs/maintenance-window-codegen.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAW,MAAM,6BAA6B,CAAA;AAC9D,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAA;AAYnD,MAAM,SAAS,GAAG,mBAAmB,CAAA;AAErC,MAAM,OAAO,wBAAyB,SAAQ,OAAkC;IAC9E,QAAQ,CAAE,QAAmC;QAC3C,OAAO,uBAAuB,QAAQ,CAAC,IAAI,EAAE,CAAA;IAC/C,CAAC;IAED,OAAO,CAAE,SAAiB,EAAE,QAAmC,EAAE,OAAgB;QAC/E,MAAM,QAAQ,GAAG,OAAO,CAAC,QAAQ,CAAC,+BAA+B,EAAE,QAAQ,CAAC,IAAI,EAAE;YAChF,MAAM,EAAE,IAAI;SACb,CAAC,CAAA;QAEF,MAAM,IAAI,GAAG,IAAI,CAAC,OAAO,CAAC,sBAAsB,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAA;QAEnE,IAAI,CAAC,WAAW,CAAC,SAAS,EAAE,oBAAoB,CAAC,CAAA;QAEjD,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,EAAE,OAAO,CAAC,EAAE;YAC5C,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,EAAE;gBACpB,OAAO,CAAC,MAAM,CAAC,SAAS,CAAC,CAAA;gBACzB,OAAO,CAAC,MAAM,CAAC,OAAO,CAAC,EAAE;oBACvB,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,QAAQ,CAAC,IAAI,CAAC,CAAA;oBAErC,OAAO,CAAC,KAAK,CAAC,MAAM,EAAE,O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C;oBAED,oFAAoF;oBACpF,IAAI,QAAQ,CAAC,QAAQ,IAAI,QAAQ,CAAC,QAAQ,KAAK,KAAK,EAAE,CAAC;wBACrD,OAAO,CAAC,MAAM,CAAC,UAAU,EAAE,QAAQ,CAAC,QAAQ,CAAC,CAAA;oBAC/C,CAAC;oBAED,uEAAuE;oBACvE,IAAI,QAAQ,CAAC,cAAc,KAAK,SAAS,IAAI,QAAQ,CAAC,cAAc,EAAE,CAAC;wBACrE,OAAO,CAAC,OAAO,CAAC,gBAAgB,EAAE,QAAQ,CAAC,cAAc,CAAC,CAAA;oBAC5D,CAAC;oBAED,IAAI,QAAQ,CAAC,iBAAiB,EAAE,MAAM,EAAE,CAAC;wBACvC,MAAM,iBAAiB,GAAG,QAAQ,CAAC,iBAAiB,CAAA;wBACpD,OAAO,CAAC,KAAK,CAAC,mBAAmB,EAAE,OAAO,CAAC,EAAE;4BAC3C,KAAK,MAAM,GAAG,IAAI,iBAAiB,EAAE,CAAC;gCACpC,OAAO,CAAC,MAAM,CAAC,GAAG,CAAC,CAAA;4BACrB,CAAC;wBACH,CAAC,CAAC,CAAA;oBACJ,CAAC;oBAED,yEAAyE;oBACzE,IAAI,QAAQ,CAAC,gBAAgB,KAAK,SAAS,IAAI,QAAQ,CAAC,gBAAgB,EAAE,CAAC;wBACzE,OAAO,CAAC,OAAO,CAAC,kBAAkB,EAAE,QAAQ,CAAC,gBAAgB,CAAC,CAAA;oBAChE,CAAC;gBACH,CAAC,CAAC,CAAA;YACJ,CAAC,CAAC,CAAA;QACJ,CAAC,CAAC,CAAC,CAAA;IACL,CAAC;CACF"}
@@ -1,4 +1,6 @@
1
1
  import { Construct } from './construct.js';
2
+ import { Diagnostics } from './diagnostics.js';
3
+ import { TimeZone } from './time-zone.js';
2
4
  export type MaintenanceWindowRepeatUnit = 'DAY' | 'WEEK' | 'MONTH';
3
5
  export interface MaintenanceWindowProps {
4
6
  /**
@@ -6,9 +8,10 @@ export interface MaintenanceWindowProps {
6
8
  */
7
9
  name: string;
8
10
  /**
9
- * A list of one or more tags that filter which checks are affected by the maintenance window.
11
+ * Tags that select which checks are paused during the maintenance window.
12
+ * A window must set at least one of `tags`, `pauseAllChecks`, `silenceAlertsTags` or `silenceAllAlerts`.
10
13
  */
11
- tags: Array<string>;
14
+ tags?: Array<string>;
12
15
  /**
13
16
  * The start date and time of the maintenance window in ISO 8601 format, "YYYY-MM-DDTHH:mm:ss.sssZ" as returned by
14
17
  * `new Date()`
@@ -31,6 +34,30 @@ export interface MaintenanceWindowProps {
31
34
  * The end date and time when the maintenance window should stop repeating.
32
35
  */
33
36
  repeatEndsAt?: Date;
37
+ /**
38
+ * The named IANA time zone used to schedule recurring occurrences, e.g. `'America/New_York'`.
39
+ * Occurrences keep the same local time across daylight-saving changes.
40
+ *
41
+ * `startsAt` and `endsAt` remain absolute instants; the time zone does not reinterpret them.
42
+ * UTC offsets such as `'+05:00'` or `'Etc/GMT+5'` are not accepted. When omitted, the window is
43
+ * scheduled in UTC, and removing a previously set time zone resets the window to UTC on the next
44
+ * deploy. The time zone cannot be changed while a maintenance is active.
45
+ */
46
+ timezone?: TimeZone;
47
+ /**
48
+ * When true, checks are paused for every check in the account, regardless of `tags`.
49
+ */
50
+ pauseAllChecks?: boolean;
51
+ /**
52
+ * A list of tags that filter which checks have their alerts silenced. Ignored when
53
+ * `silenceAllAlerts` is true.
54
+ */
55
+ silenceAlertsTags?: Array<string>;
56
+ /**
57
+ * When true, alerts are silenced for every check in the account, overriding
58
+ * `silenceAlertsTags`.
59
+ */
60
+ silenceAllAlerts?: boolean;
34
61
  }
35
62
  /**
36
63
  * Creates a Maintenance Window
@@ -41,12 +68,16 @@ export interface MaintenanceWindowProps {
41
68
  */
42
69
  export declare class MaintenanceWindow extends Construct {
43
70
  name: string;
44
- tags: Array<string>;
71
+ tags?: Array<string>;
45
72
  startsAt: Date;
46
73
  endsAt: Date;
47
74
  repeatInterval?: number;
48
75
  repeatUnit?: MaintenanceWindowRepeatUnit;
49
76
  repeatEndsAt?: Date;
77
+ timezone?: TimeZone;
78
+ pauseAllChecks?: boolean;
79
+ silenceAlertsTags?: Array<string>;
80
+ silenceAllAlerts?: boolean;
50
81
  static readonly __checklyType = "maintenance-window";
51
82
  /**
52
83
  * Constructs the Maintenance Window instance
@@ -58,5 +89,6 @@ export declare class MaintenanceWindow extends Construct {
58
89
  */
59
90
  constructor(logicalId: string, props: MaintenanceWindowProps);
60
91
  describe(): string;
92
+ validate(diagnostics: Diagnostics): Promise<void>;
61
93
  synthesize(): any | null;
62
94
  }
@@ -1,5 +1,8 @@
1
1
  import { Construct } from './construct.js';
2
+ import { InvalidPropertyValueDiagnostic } from './construct-diagnostics.js';
3
+ import { WarningDiagnostic } from './diagnostics.js';
2
4
  import { Session } from './session.js';
5
+ import { isValidTimeZone } from './time-zone.js';
3
6
  /**
4
7
  * Creates a Maintenance Window
5
8
  *
@@ -15,6 +18,10 @@ export class MaintenanceWindow extends Construct {
15
18
  repeatInterval;
16
19
  repeatUnit;
17
20
  repeatEndsAt;
21
+ timezone;
22
+ pauseAllChecks;
23
+ silenceAlertsTags;
24
+ silenceAllAlerts;
18
25
  static __checklyType = 'maintenance-window';
19
26
  /**
20
27
  * Constructs the Maintenance Window instance
@@ -33,11 +40,32 @@ export class MaintenanceWindow extends Construct {
33
40
  this.repeatInterval = props.repeatInterval;
34
41
  this.repeatUnit = props.repeatUnit;
35
42
  this.repeatEndsAt = props.repeatEndsAt;
43
+ this.timezone = props.timezone;
44
+ this.pauseAllChecks = props.pauseAllChecks;
45
+ this.silenceAlertsTags = props.silenceAlertsTags;
46
+ this.silenceAllAlerts = props.silenceAllAlerts;
36
47
  Session.registerConstruct(this);
37
48
  }
38
49
  describe() {
39
50
  return `MaintenanceWindow:${this.logicalId}`;
40
51
  }
52
+ async validate(diagnostics) {
53
+ await super.validate(diagnostics);
54
+ if (this.timezone !== undefined && !isValidTimeZone(this.timezone)) {
55
+ diagnostics.add(new InvalidPropertyValueDiagnostic('timezone', new Error(`"timezone" must be a named IANA time zone such as "America/New_York", got "${this.timezone}".`
56
+ + ` UTC offsets such as "+05:00" or "Etc/GMT+5" are not supported.`)));
57
+ }
58
+ const pausesChecks = this.pauseAllChecks || !!this.tags?.length;
59
+ const silencesAlerts = this.silenceAllAlerts || !!this.silenceAlertsTags?.length;
60
+ if (!pausesChecks && !silencesAlerts) {
61
+ diagnostics.add(new WarningDiagnostic({
62
+ title: 'Maintenance window affects no checks',
63
+ message: `Maintenance window "${this.logicalId}" neither pauses checks nor silences alerts. `
64
+ + `Set "tags" or "pauseAllChecks" to pause checks, or "silenceAlertsTags" or "silenceAllAlerts" `
65
+ + `to silence alerts.`,
66
+ }));
67
+ }
68
+ }
41
69
  synthesize() {
42
70
  return {
43
71
  name: this.name,
@@ -46,7 +74,13 @@ export class MaintenanceWindow extends Construct {
46
74
  endsAt: this.endsAt,
47
75
  repeatInterval: this.repeatInterval,
48
76
  repeatUnit: this.repeatUnit,
49
- repeatEndsAt: this.repeatEndsAt,
77
+ // An omitted end date keeps the stored one on update, so null is sent to clear it.
78
+ repeatEndsAt: this.repeatEndsAt ?? null,
79
+ // An omitted timezone keeps the stored value on update, so null is sent to reset it to UTC.
80
+ timezone: this.timezone ?? null,
81
+ pauseAllChecks: this.pauseAllChecks,
82
+ silenceAlertsTags: this.silenceAlertsTags,
83
+ silenceAllAlerts: this.silenceAllAlerts,
50
84
  };
51
85
  }
52
86
  }
@@ -1 +1 @@
1
- {"version":3,"file":"maintenance-window.js","sourceRoot":"","sources":["../../src/constructs/maintenance-window.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAC1C,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AAqCtC;;;;;;GAMG;AACH,MAAM,OAAO,iBAAkB,SAAQ,SAAS;IAC9C,IAAI,CAAQ;IACZ,IAAI,CAAe;IACnB,QAAQ,CAAM;IACd,MAAM,CAAM;IACZ,cAAc,CAAS;IACvB,U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AAI,CAAC,QAAQ,IAAI,IAAI;YAC/B,cAAc,EAAE,IAAI,CAAC,cAAc;YACnC,iBAAiB,EAAE,IAAI,CAAC,iBAAiB;YACzC,gBAAgB,EAAE,IAAI,CAAC,gBAAgB;SACxC,CAAA;IACH,CAAC"}
@@ -14,7 +14,7 @@ import { Diagnostics } from './diagnostics.js';
14
14
  * Retry strategies supported by monitors.
15
15
  */
16
16
  export type MonitorRetryStrategy = LinearRetryStrategy | ExponentialRetryStrategy | FixedRetryStrategy | SingleRetryRetryStrategy | NoRetriesRetryStrategy;
17
- export interface MonitorProps extends Omit<CheckProps, 'doubleCheck'> {
17
+ export interface MonitorProps extends CheckProps {
18
18
  /**
19
19
  * The name of the monitor.
20
20
  */
@@ -6,7 +6,7 @@ export interface MSTeamsAlertChannelResource extends WebhookAlertChannelResource
6
6
  };
7
7
  }
8
8
  export declare class MSTeamsAlertChannelCodegen extends Codegen<MSTeamsAlertChannelResource> {
9
- validateSafety(resource: MSTeamsAlertChannelResource): void;
9
+ validateSafety(resource: MSTeamsAlertChannelResource, context?: Context): void;
10
10
  describe(resource: MSTeamsAlertChannelResource): string;
11
11
  prepare(logicalId: string, resource: MSTeamsAlertChannelResource, context: Context): void;
12
12
  gencode(logicalId: string, resource: MSTeamsAlertChannelResource, context: Context): void;
@@ -4,7 +4,7 @@ import { buildAlertChannelProps } from './alert-channel-codegen.js';
4
4
  import { MSTeamsAlertChannel } from './msteams-alert-channel.js';
5
5
  const construct = 'MSTeamsAlertChannel';
6
6
  export class MSTeamsAlertChannelCodegen extends Codegen {
7
- validateSafety(resource) {
7
+ validateSafety(resource, context) {
8
8
  const { config } = resource;
9
9
  if (config.method !== 'POST') {
10
10
  throw new ImportSafetyViolation(`Unsupported value for property 'method' (expected 'POST')`);
@@ -15,7 +15,9 @@ export class MSTeamsAlertChannelCodegen extends Codegen {
15
15
  if (config.queryParameters !== undefined && config.queryParameters.length !== 0) {
16
16
  throw new ImportSafetyViolation(`Unsupported value for property 'queryParameters' (expected no value or an empty array)`);
17
17
  }
18
- if (config.webhookSecret) {
18
+ // The preview masks this field even when it is null, so a masked value
19
+ // says nothing about whether a secret is set.
20
+ if (config.webhookSecret && !context?.isMasked(config.webhookSecret)) {
19
21
  throw new ImportSafetyViolation(`Unsupported value for property 'webhookSecret' (expected no value)`);
20
22
  }
21
23
  }
@@ -24,7 +26,7 @@ export class MSTeamsAlertChannelCodegen extends Codegen {
24
26
  return `Microsoft Teams Alert Channel: ${resource.config.name}`;
25
27
  }
26
28
  prepare(logicalId, resource, context) {
27
- this.validateSafety(resource);
29
+ this.validateSafety(resource, context);
28
30
  const { name } = resource.config;
29
31
  const filename = context.filePath('resources/alert-channels/ms-teams', name, {
30
32
  unique: true,
@@ -32,22 +34,10 @@ export class MSTeamsAlertChannelCodegen extends Codegen {
32
34
  context.registerAlertChannel(resource.id, `${name} teams`, this.program.generatedConstructFile(filename.fullPath));
33
35
  }
34
36
  gencode(logicalId, resource, context) {
35
- this.validateSafety(resource);
37
+ this.validateSafety(resource, context);
36
38
  const { id, file } = context.lookupAlertChannel(resource.id);
37
39
  file.namedImport(construct, 'checkly/constructs');
38
40
  const { config } = resource;
39
- if (config.method !== 'POST') {
40
- throw new ImportSafetyViolation(`Unsupported value for property 'method' (expected 'POST')`);
41
- }
42
- if (config.headers !== undefined && config.headers.length !== 0) {
43
- throw new ImportSafetyViolation(`Unsupported value for property 'headers' (expected no value or an empty array)`);
44
- }
45
- if (config.queryParameters !== undefined && config.queryParameters.length !== 0) {
46
- throw new ImportSafetyViolation(`Unsupported value for property 'queryParameters' (expected no value or an empty array)`);
47
- }
48
- if (config.webhookSecret) {
49
- throw new ImportSafetyViolation(`Unsupported value for property 'webhookSecret' (expected no value)`);
50
- }
51
41
  file.section(decl(id, builder => {
52
42
  builder.variable(expr(ident(construct), builder => {
53
43
  builder.new(builder => {
@@ -56,11 +46,11 @@ export class MSTeamsAlertChannelCodegen extends Codegen {
56
46
  builder.string('name', config.name);
57
47
  builder.string('url', config.url);
58
48
  if (config.template) {
59
- if (config.template !== MSTeamsAlertChannel.DEFAULT_PAYLOAD) {
49
+ if (config.template !== MSTeamsAlertChannel.DEFAULT_PAYLOAD || context.spelledOut('payload')) {
60
50
  builder.string('payload', config.template);
61
51
  }
62
52
  }
63
- buildAlertChannelProps(builder, resource);
53
+ buildAlertChannelProps(builder, resource, context);
64
54
  });
65
55
  });
66
56
  }));