checkly 5.3.1 → 5.4.0-prerelease-6249ef2

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 (443) hide show
  1. package/dist/auth/index.js +125 -132
  2. package/dist/auth/index.js.map +1 -1
  3. package/dist/commands/authCommand.js +1 -1
  4. package/dist/commands/authCommand.js.map +1 -1
  5. package/dist/commands/baseCommand.d.ts +2 -0
  6. package/dist/commands/baseCommand.js +7 -9
  7. package/dist/commands/baseCommand.js.map +1 -1
  8. package/dist/commands/deploy.js +55 -57
  9. package/dist/commands/deploy.js.map +1 -1
  10. package/dist/commands/destroy.js +15 -16
  11. package/dist/commands/destroy.js.map +1 -1
  12. package/dist/commands/env/add.js +28 -29
  13. package/dist/commands/env/add.js.map +1 -1
  14. package/dist/commands/env/ls.js +2 -2
  15. package/dist/commands/env/ls.js.map +1 -1
  16. package/dist/commands/env/pull.js +17 -17
  17. package/dist/commands/env/pull.js.map +1 -1
  18. package/dist/commands/env/rm.js +17 -18
  19. package/dist/commands/env/rm.js.map +1 -1
  20. package/dist/commands/env/update.js +29 -30
  21. package/dist/commands/env/update.js.map +1 -1
  22. package/dist/commands/help.js +2 -2
  23. package/dist/commands/help.js.map +1 -1
  24. package/dist/commands/import/apply.d.ts +14 -0
  25. package/dist/commands/import/apply.js +157 -0
  26. package/dist/commands/import/apply.js.map +1 -0
  27. package/dist/commands/import/cancel.d.ts +11 -0
  28. package/dist/commands/import/cancel.js +119 -0
  29. package/dist/commands/import/cancel.js.map +1 -0
  30. package/dist/commands/import/commit.d.ts +14 -0
  31. package/dist/commands/import/commit.js +141 -0
  32. package/dist/commands/import/commit.js.map +1 -0
  33. package/dist/commands/import/plan.d.ts +20 -0
  34. package/dist/commands/import/plan.js +1237 -0
  35. package/dist/commands/import/plan.js.map +1 -0
  36. package/dist/commands/login.js +38 -48
  37. package/dist/commands/login.js.map +1 -1
  38. package/dist/commands/logout.js +9 -9
  39. package/dist/commands/logout.js.map +1 -1
  40. package/dist/commands/runtimes.js +2 -2
  41. package/dist/commands/runtimes.js.map +1 -1
  42. package/dist/commands/switch.js +9 -9
  43. package/dist/commands/switch.js.map +1 -1
  44. package/dist/commands/sync-playwright.js +7 -7
  45. package/dist/commands/sync-playwright.js.map +1 -1
  46. package/dist/commands/test.js +107 -111
  47. package/dist/commands/test.js.map +1 -1
  48. package/dist/commands/trigger.js +74 -78
  49. package/dist/commands/trigger.js.map +1 -1
  50. package/dist/commands/whoami.js +2 -2
  51. package/dist/commands/whoami.js.map +1 -1
  52. package/dist/constructs/alert-channel-codegen.d.ts +35 -0
  53. package/dist/constructs/alert-channel-codegen.js +98 -0
  54. package/dist/constructs/alert-channel-codegen.js.map +1 -0
  55. package/dist/constructs/alert-channel-subscription-codegen.d.ts +11 -0
  56. package/dist/constructs/alert-channel-subscription-codegen.js +23 -0
  57. package/dist/constructs/alert-channel-subscription-codegen.js.map +1 -0
  58. package/dist/constructs/alert-channel-subscription.js +5 -1
  59. package/dist/constructs/alert-channel-subscription.js.map +1 -1
  60. package/dist/constructs/alert-channel.d.ts +17 -3
  61. package/dist/constructs/alert-channel.js +15 -4
  62. package/dist/constructs/alert-channel.js.map +1 -1
  63. package/dist/constructs/alert-escalation-policy-codegen.d.ts +4 -0
  64. package/dist/constructs/alert-escalation-policy-codegen.js +59 -0
  65. package/dist/constructs/alert-escalation-policy-codegen.js.map +1 -0
  66. package/dist/constructs/alert-escalation-policy.js +8 -9
  67. package/dist/constructs/alert-escalation-policy.js.map +1 -1
  68. package/dist/constructs/api-check-codegen.d.ts +21 -0
  69. package/dist/constructs/api-check-codegen.js +163 -0
  70. package/dist/constructs/api-check-codegen.js.map +1 -0
  71. package/dist/constructs/api-check.js +9 -0
  72. package/dist/constructs/api-check.js.map +1 -1
  73. package/dist/constructs/browser-check-codegen.d.ts +14 -0
  74. package/dist/constructs/browser-check-codegen.js +48 -0
  75. package/dist/constructs/browser-check-codegen.js.map +1 -0
  76. package/dist/constructs/browser-check.js +12 -6
  77. package/dist/constructs/browser-check.js.map +1 -1
  78. package/dist/constructs/check-codegen.d.ts +42 -0
  79. package/dist/constructs/check-codegen.js +208 -0
  80. package/dist/constructs/check-codegen.js.map +1 -0
  81. package/dist/constructs/check-group-codegen.d.ts +45 -0
  82. package/dist/constructs/check-group-codegen.js +266 -0
  83. package/dist/constructs/check-group-codegen.js.map +1 -0
  84. package/dist/constructs/check-group.d.ts +21 -8
  85. package/dist/constructs/check-group.js +65 -15
  86. package/dist/constructs/check-group.js.map +1 -1
  87. package/dist/constructs/check.d.ts +8 -8
  88. package/dist/constructs/check.js +31 -14
  89. package/dist/constructs/check.js.map +1 -1
  90. package/dist/constructs/construct-codegen.d.ts +39 -0
  91. package/dist/constructs/construct-codegen.js +100 -0
  92. package/dist/constructs/construct-codegen.js.map +1 -0
  93. package/dist/constructs/construct.js +5 -1
  94. package/dist/constructs/construct.js.map +1 -1
  95. package/dist/constructs/dashboard-codegen.d.ts +29 -0
  96. package/dist/constructs/dashboard-codegen.js +108 -0
  97. package/dist/constructs/dashboard-codegen.js.map +1 -0
  98. package/dist/constructs/dashboard.js +23 -1
  99. package/dist/constructs/dashboard.js.map +1 -1
  100. package/dist/constructs/email-alert-channel-codegen.d.ts +13 -0
  101. package/dist/constructs/email-alert-channel-codegen.js +38 -0
  102. package/dist/constructs/email-alert-channel-codegen.js.map +1 -0
  103. package/dist/constructs/email-alert-channel.js +1 -0
  104. package/dist/constructs/email-alert-channel.js.map +1 -1
  105. package/dist/constructs/frequency-codegen.d.ts +4 -0
  106. package/dist/constructs/frequency-codegen.js +49 -0
  107. package/dist/constructs/frequency-codegen.js.map +1 -0
  108. package/dist/constructs/frequency.js +17 -15
  109. package/dist/constructs/frequency.js.map +1 -1
  110. package/dist/constructs/heartbeat-check-codegen.d.ts +11 -0
  111. package/dist/constructs/heartbeat-check-codegen.js +33 -0
  112. package/dist/constructs/heartbeat-check-codegen.js.map +1 -0
  113. package/dist/constructs/heartbeat-check.js +1 -0
  114. package/dist/constructs/heartbeat-check.js.map +1 -1
  115. package/dist/constructs/incidentio-alert-channel-codegen.d.ts +13 -0
  116. package/dist/constructs/incidentio-alert-channel-codegen.js +89 -0
  117. package/dist/constructs/incidentio-alert-channel-codegen.js.map +1 -0
  118. package/dist/constructs/incidentio-alert-channel.d.ts +6 -0
  119. package/dist/constructs/incidentio-alert-channel.js +17 -16
  120. package/dist/constructs/incidentio-alert-channel.js.map +1 -1
  121. package/dist/constructs/internal/assertion-codegen.d.ts +4 -0
  122. package/dist/constructs/internal/assertion-codegen.js +141 -0
  123. package/dist/constructs/internal/assertion-codegen.js.map +1 -0
  124. package/dist/constructs/internal/assertion.js +7 -4
  125. package/dist/constructs/internal/assertion.js.map +1 -1
  126. package/dist/constructs/internal/codegen/codegen.d.ts +9 -0
  127. package/dist/constructs/internal/codegen/codegen.js +14 -0
  128. package/dist/constructs/internal/codegen/codegen.js.map +1 -0
  129. package/dist/constructs/internal/codegen/context.d.ts +62 -0
  130. package/dist/constructs/internal/codegen/context.js +445 -0
  131. package/dist/constructs/internal/codegen/context.js.map +1 -0
  132. package/dist/constructs/internal/codegen/index.d.ts +4 -0
  133. package/dist/constructs/internal/codegen/index.js +13 -0
  134. package/dist/constructs/internal/codegen/index.js.map +1 -0
  135. package/dist/constructs/internal/codegen/safety.d.ts +2 -0
  136. package/dist/constructs/internal/codegen/safety.js +7 -0
  137. package/dist/constructs/internal/codegen/safety.js.map +1 -0
  138. package/dist/constructs/internal/codegen/snippet.d.ts +12 -0
  139. package/dist/constructs/internal/codegen/snippet.js +48 -0
  140. package/dist/constructs/internal/codegen/snippet.js.map +1 -0
  141. package/dist/constructs/key-value-pair-codegen.d.ts +4 -0
  142. package/dist/constructs/key-value-pair-codegen.js +39 -0
  143. package/dist/constructs/key-value-pair-codegen.js.map +1 -0
  144. package/dist/constructs/maintenance-window-codegen.d.ts +14 -0
  145. package/dist/constructs/maintenance-window-codegen.js +57 -0
  146. package/dist/constructs/maintenance-window-codegen.js.map +1 -0
  147. package/dist/constructs/maintenance-window.js +8 -1
  148. package/dist/constructs/maintenance-window.js.map +1 -1
  149. package/dist/constructs/msteams-alert-channel-codegen.d.ts +13 -0
  150. package/dist/constructs/msteams-alert-channel-codegen.js +75 -0
  151. package/dist/constructs/msteams-alert-channel-codegen.js.map +1 -0
  152. package/dist/constructs/msteams-alert-channel.d.ts +6 -0
  153. package/dist/constructs/msteams-alert-channel.js +14 -13
  154. package/dist/constructs/msteams-alert-channel.js.map +1 -1
  155. package/dist/constructs/multi-step-check-codegen.d.ts +13 -0
  156. package/dist/constructs/multi-step-check-codegen.js +39 -0
  157. package/dist/constructs/multi-step-check-codegen.js.map +1 -0
  158. package/dist/constructs/multi-step-check.js +8 -8
  159. package/dist/constructs/multi-step-check.js.map +1 -1
  160. package/dist/constructs/opsgenie-alert-channel-codegen.d.ts +16 -0
  161. package/dist/constructs/opsgenie-alert-channel-codegen.js +41 -0
  162. package/dist/constructs/opsgenie-alert-channel-codegen.js.map +1 -0
  163. package/dist/constructs/opsgenie-alert-channel.js +4 -0
  164. package/dist/constructs/opsgenie-alert-channel.js.map +1 -1
  165. package/dist/constructs/pagerduty-alert-channel-codegen.d.ts +15 -0
  166. package/dist/constructs/pagerduty-alert-channel-codegen.js +53 -0
  167. package/dist/constructs/pagerduty-alert-channel-codegen.js.map +1 -0
  168. package/dist/constructs/pagerduty-alert-channel.js +3 -0
  169. package/dist/constructs/pagerduty-alert-channel.js.map +1 -1
  170. package/dist/constructs/phone-call-alert-channel-codegen.d.ts +14 -0
  171. package/dist/constructs/phone-call-alert-channel-codegen.js +46 -0
  172. package/dist/constructs/phone-call-alert-channel-codegen.js.map +1 -0
  173. package/dist/constructs/phone-call-alert-channel.js +2 -0
  174. package/dist/constructs/phone-call-alert-channel.js.map +1 -1
  175. package/dist/constructs/playwright-config-codegen.d.ts +4 -0
  176. package/dist/constructs/playwright-config-codegen.js +9 -0
  177. package/dist/constructs/playwright-config-codegen.js.map +1 -0
  178. package/dist/constructs/private-location-check-assignment-codegen.d.ts +10 -0
  179. package/dist/constructs/private-location-check-assignment-codegen.js +18 -0
  180. package/dist/constructs/private-location-check-assignment-codegen.js.map +1 -0
  181. package/dist/constructs/private-location-check-assignment.js +3 -1
  182. package/dist/constructs/private-location-check-assignment.js.map +1 -1
  183. package/dist/constructs/private-location-codegen.d.ts +15 -0
  184. package/dist/constructs/private-location-codegen.js +51 -0
  185. package/dist/constructs/private-location-codegen.js.map +1 -0
  186. package/dist/constructs/private-location-group-assignment-codegen.d.ts +10 -0
  187. package/dist/constructs/private-location-group-assignment-codegen.js +18 -0
  188. package/dist/constructs/private-location-group-assignment-codegen.js.map +1 -0
  189. package/dist/constructs/private-location-group-assignment.js +3 -1
  190. package/dist/constructs/private-location-group-assignment.js.map +1 -1
  191. package/dist/constructs/private-location.d.ts +8 -4
  192. package/dist/constructs/private-location.js +14 -4
  193. package/dist/constructs/private-location.js.map +1 -1
  194. package/dist/constructs/project.d.ts +10 -0
  195. package/dist/constructs/project.js +74 -18
  196. package/dist/constructs/project.js.map +1 -1
  197. package/dist/constructs/ref-codegen.d.ts +3 -0
  198. package/dist/constructs/ref-codegen.js +15 -0
  199. package/dist/constructs/ref-codegen.js.map +1 -0
  200. package/dist/constructs/ref.js +1 -0
  201. package/dist/constructs/ref.js.map +1 -1
  202. package/dist/constructs/retry-strategy-codegen.d.ts +4 -0
  203. package/dist/constructs/retry-strategy-codegen.js +69 -0
  204. package/dist/constructs/retry-strategy-codegen.js.map +1 -0
  205. package/dist/constructs/retry-strategy.js +8 -9
  206. package/dist/constructs/retry-strategy.js.map +1 -1
  207. package/dist/constructs/slack-alert-channel-codegen.d.ts +14 -0
  208. package/dist/constructs/slack-alert-channel-codegen.js +46 -0
  209. package/dist/constructs/slack-alert-channel-codegen.js.map +1 -0
  210. package/dist/constructs/slack-alert-channel.js +2 -0
  211. package/dist/constructs/slack-alert-channel.js.map +1 -1
  212. package/dist/constructs/sms-alert-channel-codegen.d.ts +14 -0
  213. package/dist/constructs/sms-alert-channel-codegen.js +46 -0
  214. package/dist/constructs/sms-alert-channel-codegen.js.map +1 -0
  215. package/dist/constructs/sms-alert-channel.js +2 -0
  216. package/dist/constructs/sms-alert-channel.js.map +1 -1
  217. package/dist/constructs/status-page-codegen.d.ts +23 -0
  218. package/dist/constructs/status-page-codegen.js +71 -0
  219. package/dist/constructs/status-page-codegen.js.map +1 -0
  220. package/dist/constructs/status-page-service-codegen.d.ts +12 -0
  221. package/dist/constructs/status-page-service-codegen.js +44 -0
  222. package/dist/constructs/status-page-service-codegen.js.map +1 -0
  223. package/dist/constructs/status-page-service.d.ts +10 -0
  224. package/dist/constructs/status-page-service.js +21 -2
  225. package/dist/constructs/status-page-service.js.map +1 -1
  226. package/dist/constructs/status-page.js +15 -9
  227. package/dist/constructs/status-page.js.map +1 -1
  228. package/dist/constructs/tcp-check-codegen.d.ts +15 -0
  229. package/dist/constructs/tcp-check-codegen.js +69 -0
  230. package/dist/constructs/tcp-check-codegen.js.map +1 -0
  231. package/dist/constructs/tcp-check.js +3 -0
  232. package/dist/constructs/tcp-check.js.map +1 -1
  233. package/dist/constructs/telegram-alert-channel-codegen.d.ts +13 -0
  234. package/dist/constructs/telegram-alert-channel-codegen.js +105 -0
  235. package/dist/constructs/telegram-alert-channel-codegen.js.map +1 -0
  236. package/dist/constructs/telegram-alert-channel.d.ts +6 -0
  237. package/dist/constructs/telegram-alert-channel.js +8 -4
  238. package/dist/constructs/telegram-alert-channel.js.map +1 -1
  239. package/dist/constructs/webhook-alert-channel-codegen.d.ts +34 -0
  240. package/dist/constructs/webhook-alert-channel-codegen.js +152 -0
  241. package/dist/constructs/webhook-alert-channel-codegen.js.map +1 -0
  242. package/dist/constructs/webhook-alert-channel.js +8 -0
  243. package/dist/constructs/webhook-alert-channel.js.map +1 -1
  244. package/dist/help/help-extension.js +1 -2
  245. package/dist/help/help-extension.js.map +1 -1
  246. package/dist/helpers/command-style.d.ts +18 -0
  247. package/dist/helpers/command-style.js +87 -0
  248. package/dist/helpers/command-style.js.map +1 -0
  249. package/dist/helpers/wrap.d.ts +6 -0
  250. package/dist/helpers/wrap.js +53 -0
  251. package/dist/helpers/wrap.js.map +1 -0
  252. package/dist/loader/index.d.ts +6 -0
  253. package/dist/loader/index.js +21 -0
  254. package/dist/loader/index.js.map +1 -0
  255. package/dist/loader/jiti.d.ts +27 -0
  256. package/dist/loader/jiti.js +63 -0
  257. package/dist/loader/jiti.js.map +1 -0
  258. package/dist/loader/loader.d.ts +29 -0
  259. package/dist/loader/loader.js +32 -0
  260. package/dist/loader/loader.js.map +1 -0
  261. package/dist/loader/match.d.ts +15 -0
  262. package/dist/loader/match.js +47 -0
  263. package/dist/loader/match.js.map +1 -0
  264. package/dist/loader/mixed.d.ts +7 -0
  265. package/dist/loader/mixed.js +39 -0
  266. package/dist/loader/mixed.js.map +1 -0
  267. package/dist/loader/native.d.ts +10 -0
  268. package/dist/loader/native.js +36 -0
  269. package/dist/loader/native.js.map +1 -0
  270. package/dist/loader/ts-node.d.ts +25 -0
  271. package/dist/loader/ts-node.js +85 -0
  272. package/dist/loader/ts-node.js.map +1 -0
  273. package/dist/playwright/playwright-config-loader.d.ts +1 -1
  274. package/dist/playwright/playwright-config-loader.js +7 -4
  275. package/dist/playwright/playwright-config-loader.js.map +1 -1
  276. package/dist/playwright/playwright-config-template.js +1 -0
  277. package/dist/playwright/playwright-config-template.js.map +1 -1
  278. package/dist/reporters/abstract-list.js +10 -6
  279. package/dist/reporters/abstract-list.js.map +1 -1
  280. package/dist/reporters/github.js +13 -6
  281. package/dist/reporters/github.js.map +1 -1
  282. package/dist/reporters/json.js +7 -4
  283. package/dist/reporters/json.js.map +1 -1
  284. package/dist/reporters/list.js +4 -6
  285. package/dist/reporters/list.js.map +1 -1
  286. package/dist/reporters/util.js +15 -20
  287. package/dist/reporters/util.js.map +1 -1
  288. package/dist/rest/accounts.js +1 -0
  289. package/dist/rest/accounts.js.map +1 -1
  290. package/dist/rest/api.js +3 -5
  291. package/dist/rest/api.js.map +1 -1
  292. package/dist/rest/assets.js +1 -0
  293. package/dist/rest/assets.js.map +1 -1
  294. package/dist/rest/checkly-storage.js +1 -0
  295. package/dist/rest/checkly-storage.js.map +1 -1
  296. package/dist/rest/environment-variables.js +1 -0
  297. package/dist/rest/environment-variables.js.map +1 -1
  298. package/dist/rest/heartbeat-checks.js +1 -0
  299. package/dist/rest/heartbeat-checks.js.map +1 -1
  300. package/dist/rest/locations.js +1 -0
  301. package/dist/rest/locations.js.map +1 -1
  302. package/dist/rest/private-locations.js +1 -0
  303. package/dist/rest/private-locations.js.map +1 -1
  304. package/dist/rest/projects.d.ts +69 -1
  305. package/dist/rest/projects.js +76 -4
  306. package/dist/rest/projects.js.map +1 -1
  307. package/dist/rest/runtimes.js +1 -0
  308. package/dist/rest/runtimes.js.map +1 -1
  309. package/dist/rest/test-sessions.js +1 -0
  310. package/dist/rest/test-sessions.js.map +1 -1
  311. package/dist/rest/users.js +1 -0
  312. package/dist/rest/users.js.map +1 -1
  313. package/dist/services/abstract-check-runner.js +10 -0
  314. package/dist/services/abstract-check-runner.js.map +1 -1
  315. package/dist/services/check-parser/collector.js +6 -4
  316. package/dist/services/check-parser/collector.js.map +1 -1
  317. package/dist/services/check-parser/errors.js +4 -0
  318. package/dist/services/check-parser/errors.js.map +1 -1
  319. package/dist/services/check-parser/package-files/extension.js +2 -0
  320. package/dist/services/check-parser/package-files/extension.js.map +1 -1
  321. package/dist/services/check-parser/package-files/jsconfig-json-file.js +5 -22
  322. package/dist/services/check-parser/package-files/jsconfig-json-file.js.map +1 -1
  323. package/dist/services/check-parser/package-files/json-source-file.d.ts +1 -1
  324. package/dist/services/check-parser/package-files/json-source-file.js +5 -17
  325. package/dist/services/check-parser/package-files/json-source-file.js.map +1 -1
  326. package/dist/services/check-parser/package-files/loader.js +2 -1
  327. package/dist/services/check-parser/package-files/loader.js.map +1 -1
  328. package/dist/services/check-parser/package-files/lookup.js +3 -17
  329. package/dist/services/check-parser/package-files/lookup.js.map +1 -1
  330. package/dist/services/check-parser/package-files/package-json-file.d.ts +14 -1
  331. package/dist/services/check-parser/package-files/package-json-file.js +87 -19
  332. package/dist/services/check-parser/package-files/package-json-file.js.map +1 -1
  333. package/dist/services/check-parser/package-files/package-manager.d.ts +91 -0
  334. package/dist/services/check-parser/package-files/package-manager.js +321 -0
  335. package/dist/services/check-parser/package-files/package-manager.js.map +1 -0
  336. package/dist/services/check-parser/package-files/paths.js +39 -0
  337. package/dist/services/check-parser/package-files/paths.js.map +1 -1
  338. package/dist/services/check-parser/package-files/resolver.d.ts +6 -3
  339. package/dist/services/check-parser/package-files/resolver.js +58 -50
  340. package/dist/services/check-parser/package-files/resolver.js.map +1 -1
  341. package/dist/services/check-parser/package-files/source-file.d.ts +1 -1
  342. package/dist/services/check-parser/package-files/source-file.js +8 -17
  343. package/dist/services/check-parser/package-files/source-file.js.map +1 -1
  344. package/dist/services/check-parser/package-files/tsconfig-json-file.js +16 -27
  345. package/dist/services/check-parser/package-files/tsconfig-json-file.js.map +1 -1
  346. package/dist/services/check-parser/parser.js +18 -11
  347. package/dist/services/check-parser/parser.js.map +1 -1
  348. package/dist/services/checkly-config-codegen.d.ts +4 -0
  349. package/dist/services/checkly-config-codegen.js +196 -0
  350. package/dist/services/checkly-config-codegen.js.map +1 -0
  351. package/dist/services/checkly-config-loader.d.ts +6 -2
  352. package/dist/services/checkly-config-loader.js +27 -12
  353. package/dist/services/checkly-config-loader.js.map +1 -1
  354. package/dist/services/config.js +5 -6
  355. package/dist/services/config.js.map +1 -1
  356. package/dist/services/project-parser.js +5 -12
  357. package/dist/services/project-parser.js.map +1 -1
  358. package/dist/services/snapshot-service.js +2 -2
  359. package/dist/services/snapshot-service.js.map +1 -1
  360. package/dist/services/test-filters.js +1 -1
  361. package/dist/services/test-filters.js.map +1 -1
  362. package/dist/services/test-runner.js +12 -5
  363. package/dist/services/test-runner.js.map +1 -1
  364. package/dist/services/trigger-runner.js +12 -5
  365. package/dist/services/trigger-runner.js.map +1 -1
  366. package/dist/services/util.d.ts +0 -1
  367. package/dist/services/util.js +12 -107
  368. package/dist/services/util.js.map +1 -1
  369. package/dist/sourcegen/args.d.ts +7 -0
  370. package/dist/sourcegen/args.js +26 -0
  371. package/dist/sourcegen/args.js.map +1 -0
  372. package/dist/sourcegen/argsbuilder.d.ts +22 -0
  373. package/dist/sourcegen/argsbuilder.js +111 -0
  374. package/dist/sourcegen/argsbuilder.js.map +1 -0
  375. package/dist/sourcegen/array.d.ts +8 -0
  376. package/dist/sourcegen/array.js +32 -0
  377. package/dist/sourcegen/array.js.map +1 -0
  378. package/dist/sourcegen/arraybuilder.d.ts +21 -0
  379. package/dist/sourcegen/arraybuilder.js +109 -0
  380. package/dist/sourcegen/arraybuilder.js.map +1 -0
  381. package/dist/sourcegen/boolean.d.ts +7 -0
  382. package/dist/sourcegen/boolean.js +22 -0
  383. package/dist/sourcegen/boolean.js.map +1 -0
  384. package/dist/sourcegen/case.d.ts +9 -0
  385. package/dist/sourcegen/case.js +107 -0
  386. package/dist/sourcegen/case.js.map +1 -0
  387. package/dist/sourcegen/comment.d.ts +32 -0
  388. package/dist/sourcegen/comment.js +124 -0
  389. package/dist/sourcegen/comment.js.map +1 -0
  390. package/dist/sourcegen/decl.d.ts +43 -0
  391. package/dist/sourcegen/decl.js +95 -0
  392. package/dist/sourcegen/decl.js.map +1 -0
  393. package/dist/sourcegen/declbuilder.d.ts +14 -0
  394. package/dist/sourcegen/declbuilder.js +39 -0
  395. package/dist/sourcegen/declbuilder.js.map +1 -0
  396. package/dist/sourcegen/expr.d.ts +39 -0
  397. package/dist/sourcegen/expr.js +86 -0
  398. package/dist/sourcegen/expr.js.map +1 -0
  399. package/dist/sourcegen/exprbuilder.d.ts +13 -0
  400. package/dist/sourcegen/exprbuilder.js +54 -0
  401. package/dist/sourcegen/exprbuilder.js.map +1 -0
  402. package/dist/sourcegen/identifier.d.ts +12 -0
  403. package/dist/sourcegen/identifier.js +27 -0
  404. package/dist/sourcegen/identifier.js.map +1 -0
  405. package/dist/sourcegen/index.d.ts +22 -0
  406. package/dist/sourcegen/index.js +76 -0
  407. package/dist/sourcegen/index.js.map +1 -0
  408. package/dist/sourcegen/null.d.ts +5 -0
  409. package/dist/sourcegen/null.js +11 -0
  410. package/dist/sourcegen/null.js.map +1 -0
  411. package/dist/sourcegen/number.d.ts +7 -0
  412. package/dist/sourcegen/number.js +22 -0
  413. package/dist/sourcegen/number.js.map +1 -0
  414. package/dist/sourcegen/object.d.ts +28 -0
  415. package/dist/sourcegen/object.js +88 -0
  416. package/dist/sourcegen/object.js.map +1 -0
  417. package/dist/sourcegen/objectbuilder.d.ts +25 -0
  418. package/dist/sourcegen/objectbuilder.js +127 -0
  419. package/dist/sourcegen/objectbuilder.js.map +1 -0
  420. package/dist/sourcegen/output.d.ts +14 -0
  421. package/dist/sourcegen/output.js +85 -0
  422. package/dist/sourcegen/output.js.map +1 -0
  423. package/dist/sourcegen/program.d.ts +55 -0
  424. package/dist/sourcegen/program.js +284 -0
  425. package/dist/sourcegen/program.js.map +1 -0
  426. package/dist/sourcegen/string.d.ts +8 -0
  427. package/dist/sourcegen/string.js +28 -0
  428. package/dist/sourcegen/string.js.map +1 -0
  429. package/dist/sourcegen/undefined.d.ts +5 -0
  430. package/dist/sourcegen/undefined.js +11 -0
  431. package/dist/sourcegen/undefined.js.map +1 -0
  432. package/dist/sourcegen/unknown.d.ts +2 -0
  433. package/dist/sourcegen/unknown.js +40 -0
  434. package/dist/sourcegen/unknown.js.map +1 -0
  435. package/dist/sourcegen/value.d.ts +4 -0
  436. package/dist/sourcegen/value.js +7 -0
  437. package/dist/sourcegen/value.js.map +1 -0
  438. package/dist/tsconfig.tsbuildinfo +1 -1
  439. package/dist/util/index.d.ts +9 -0
  440. package/dist/util/index.js +27 -0
  441. package/dist/util/index.js.map +1 -0
  442. package/oclif.manifest.json +173 -1
  443. package/package.json +14 -37
@@ -0,0 +1,69 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.TcpCheckCodegen = exports.valueForTcpAssertion = void 0;
4
+ const codegen_1 = require("./internal/codegen");
5
+ const sourcegen_1 = require("../sourcegen");
6
+ const check_codegen_1 = require("./check-codegen");
7
+ const assertion_codegen_1 = require("./internal/assertion-codegen");
8
+ function valueForTcpAssertion(genfile, assertion) {
9
+ genfile.namedImport('TcpAssertionBuilder', 'checkly/constructs');
10
+ switch (assertion.source) {
11
+ case 'RESPONSE_DATA':
12
+ return (0, assertion_codegen_1.valueForGeneralAssertion)('TcpAssertionBuilder', 'responseData', assertion);
13
+ case 'RESPONSE_TIME':
14
+ return (0, assertion_codegen_1.valueForNumericAssertion)('TcpAssertionBuilder', 'responseTime', assertion);
15
+ default:
16
+ throw new Error(`Unsupported TCP assertion source ${assertion.source}`);
17
+ }
18
+ }
19
+ exports.valueForTcpAssertion = valueForTcpAssertion;
20
+ const construct = 'TcpCheck';
21
+ class TcpCheckCodegen extends codegen_1.Codegen {
22
+ describe(resource) {
23
+ return `TCP Check: ${resource.name}`;
24
+ }
25
+ gencode(logicalId, resource, context) {
26
+ const filePath = context.filePath('resources/tcp-checks', resource.name, {
27
+ tags: resource.tags,
28
+ unique: true,
29
+ });
30
+ const file = this.program.generatedConstructFile(filePath.fullPath);
31
+ file.namedImport(construct, 'checkly/constructs');
32
+ file.section((0, sourcegen_1.expr)((0, sourcegen_1.ident)(construct), builder => {
33
+ builder.new(builder => {
34
+ builder.string(logicalId);
35
+ builder.object(builder => {
36
+ builder.object('request', builder => {
37
+ builder.string('hostname', resource.request.hostname);
38
+ builder.number('port', resource.request.port);
39
+ if (resource.request.ipFamily) {
40
+ builder.string('ipFamily', resource.request.ipFamily);
41
+ }
42
+ if (resource.request.data) {
43
+ builder.string('data', resource.request.data);
44
+ }
45
+ if (resource.request.assertions) {
46
+ const assertions = resource.request.assertions;
47
+ if (assertions.length > 0) {
48
+ builder.array('assertions', builder => {
49
+ for (const assertion of assertions) {
50
+ builder.value(valueForTcpAssertion(file, assertion));
51
+ }
52
+ });
53
+ }
54
+ }
55
+ });
56
+ if (resource.degradedResponseTime !== undefined) {
57
+ builder.number('degradedResponseTime', resource.degradedResponseTime);
58
+ }
59
+ if (resource.maxResponseTime !== undefined) {
60
+ builder.number('maxResponseTime', resource.maxResponseTime);
61
+ }
62
+ (0, check_codegen_1.buildCheckProps)(this.program, file, builder, resource, context);
63
+ });
64
+ });
65
+ }));
66
+ }
67
+ }
68
+ exports.TcpCheckCodegen = TcpCheckCodegen;
69
+ //# sourceMappingURL=tcp-check-codegen.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tcp-check-codegen.js","sourceRoot":"","sources":["../../src/constructs/tcp-check-codegen.ts"],"names":[],"mappings":";;;AAAA,gDAAqD;AACrD,4CAAgE;AAChE,mDAAgE;AAChE,oEAAiG;AAUjG,SAAgB,oBAAoB,CAAE,OAAsB,EAAE,SAAuB;IACnF,OAAO,CAAC,WAAW,CAAC,qBAAqB,EAAE,oBAAoB,CAAC,CAAA;IAEhE,QAAQ,SAAS,CAAC,MAAM,EAAE,CAAC;QACzB,KAAK,eAAe;YAClB,OAAO,IAAA,4CAAwB,EAAC,qBAAqB,EAAE,cAAc,EAAE,SAAS,CAAC,CAAA;QACnF,KAAK,eAAe;YAClB,OAAO,IAAA,4CAAwB,EAAC,qBAAqB,EAAE,cAAc,EAAE,SAAS,CAAC,CAAA;QACnF;YACE,MAAM,IAAI,KAAK,CAAC,oCAAoC,SAAS,CAAC,MAAM,EAAE,CAAC,CAAA;IAC3E,CAAC;AACH,CAAC;AAXD,oDAWC;AAED,MAAM,SAAS,GAAG,UAAU,CAAA;AAE5B,MAAa,eAAgB,SAAQ,iBAAyB;IAC5D,QAAQ,CAAE,QAA0B;QAClC,OAAO,cAAc,QAAQ,CAAC,IAAI,EAAE,CAAA;IACtC,CAAC;IAED,OAAO,CAAE,SAAiB,EAAE,QAA0B,EAAE,OAAgB;QACtE,MAAM,QAAQ,GAAG,OAAO,CAAC,QAAQ,CAAC,sBA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GAAG,CAAC,EAAE,CAAC;gCAC1B,OAAO,CAAC,KAAK,CAAC,YAAY,EAAE,OAAO,CAAC,EAAE;oCACpC,KAAK,MAAM,SAAS,IAAI,UAAU,EAAE,CAAC;wCACnC,OAAO,CAAC,KAAK,CAAC,oBAAoB,CAAC,IAAI,EAAE,SAAS,CAAC,CAAC,CAAA;oCACtD,CAAC;gCACH,CAAC,CAAC,CAAA;4BACJ,CAAC;wBACH,CAAC;oBACH,CAAC,CAAC,CAAA;oBAEF,IAAI,QAAQ,CAAC,oBAAoB,KAAK,SAAS,EAAE,CAAC;wBAChD,OAAO,CAAC,MAAM,CAAC,sBAAsB,EAAE,QAAQ,CAAC,oBAAoB,CAAC,CAAA;oBACvE,CAAC;oBAED,IAAI,QAAQ,CAAC,eAAe,KAAK,SAAS,EAAE,CAAC;wBAC3C,OAAO,CAAC,MAAM,CAAC,iBAAiB,EAAE,QAAQ,CAAC,eAAe,CAAC,CAAA;oBAC7D,CAAC;oBAED,IAAA,+BAAe,EAAC,IAAI,CAAC,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,CAAC,CAAA;gBACjE,CAAC,CAAC,CAAA;YACJ,CAAC,CAAC,CAAA;QACJ,CAAC,CAAC,CAAC,CAAA;IACL,CAAC;CACF;AAxDD,0CAwDC"}
@@ -21,6 +21,9 @@ exports.TcpAssertionBuilder = TcpAssertionBuilder;
21
21
  * This class make use of the TCP Checks endpoints.
22
22
  */
23
23
  class TcpCheck extends check_1.Check {
24
+ request;
25
+ degradedResponseTime;
26
+ maxResponseTime;
24
27
  /**
25
28
  * Constructs the TCP Check instance
26
29
  *
@@ -1 +1 @@
1
- {"version":3,"file":"tcp-check.js","sourceRoot":"","sources":["../../src/constructs/tcp-check.ts"],"names":[],"mappings":";;;AAAA,mCAA2C;AAE3C,uCAAmC;AACnC,oDAAmH;AAMnH,MAAa,mBAAmB;IAC9B,MAAM,CAAC,YAAY,CAAE,QAAiB;QACpC,OAAO,IA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QC;AA6CD;;;;;;GAMG;AACH,MAAa,QAAS,SAAQ,aAAK;IACjC,OAAO,CAAY;IACnB,oBAAoB,CAAS;IAC7B,eAAe,CAAS;IAExB;;;;;;;OAOG;IAEH,YAAa,SAAiB,EAAE,KAAoB;QAClD,KAAK,CAAC,SAAS,EAAE,KAAK,CAAC,CAAA;QAEvB,IAAI,CAAC,OAAO,GAAG,KAAK,CAAC,OAAO,CAAA;QAC5B,IAAI,CAAC,oBAAoB,GAAG,KAAK,CAAC,oBAAoB,CAAA;QACtD,IAAI,CAAC,eAAe,GAAG,KAAK,CAAC,eAAe,CAAA;QAE5C,iBAAO,CAAC,iBAAiB,CAAC,IAAI,CAAC,CAAA;QAC/B,IAAI,CAAC,gBAAgB,EAAE,CAAA;QACvB,IAAI,CAAC,kCAAkC,EAAE,CAAA;IAC3C,CAAC;IAED,UAAU;QACR,OAAO;YACL,GAAG,KAAK,CAAC,UAAU,EAAE;YACrB,SAAS,EAAE,KAAK;YAChB,OAAO,EAAE,IAAI,CAAC,OAAO;YACrB,oBAAoB,EAAE,IAAI,CAAC,oBAAoB;YAC/C,eAAe,EAAE,IAAI,CAAC,eAAe;SACtC,CAAA;IACH,CAAC;CACF;AAnCD,4BAmCC"}
@@ -0,0 +1,13 @@
1
+ import { Codegen, Context } from './internal/codegen';
2
+ import { WebhookAlertChannelResource, WebhookAlertChannelResourceConfig } from './webhook-alert-channel-codegen';
3
+ export interface TelegramAlertChannelResource extends WebhookAlertChannelResource {
4
+ config: WebhookAlertChannelResourceConfig & {
5
+ webhookType: 'WEBHOOK_TELEGRAM';
6
+ };
7
+ }
8
+ export declare class TelegramAlertChannelCodegen extends Codegen<TelegramAlertChannelResource> {
9
+ validateSafety(resource: TelegramAlertChannelResource): void;
10
+ describe(resource: TelegramAlertChannelResource): string;
11
+ prepare(logicalId: string, resource: TelegramAlertChannelResource, context: Context): void;
12
+ gencode(logicalId: string, resource: TelegramAlertChannelResource, context: Context): void;
13
+ }
@@ -0,0 +1,105 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.TelegramAlertChannelCodegen = void 0;
7
+ const node_querystring_1 = __importDefault(require("node:querystring"));
8
+ const codegen_1 = require("./internal/codegen");
9
+ const sourcegen_1 = require("../sourcegen");
10
+ const alert_channel_codegen_1 = require("./alert-channel-codegen");
11
+ const telegram_alert_channel_1 = require("./telegram-alert-channel");
12
+ function apiKeyFromUrl(url) {
13
+ const match = /https:\/\/api.telegram.org\/bot([^/]+)\/sendMessage/.exec(url);
14
+ if (match) {
15
+ return match[1];
16
+ }
17
+ }
18
+ function parseTemplate(template) {
19
+ const values = node_querystring_1.default.parse(template);
20
+ const singleValue = (key) => {
21
+ const value = values[key];
22
+ if (Array.isArray(value)) {
23
+ return value[0];
24
+ }
25
+ return value;
26
+ };
27
+ return {
28
+ chatId: singleValue('chat_id'),
29
+ text: singleValue('text'),
30
+ };
31
+ }
32
+ const construct = 'TelegramAlertChannel';
33
+ class TelegramAlertChannelCodegen extends codegen_1.Codegen {
34
+ validateSafety(resource) {
35
+ const { config } = resource;
36
+ if (config.method !== 'POST') {
37
+ throw new codegen_1.ImportSafetyViolation(`Unsupported value for property 'method' (expected 'POST')`);
38
+ }
39
+ if (config.headers !== undefined && config.headers.length !== 0) {
40
+ throw new codegen_1.ImportSafetyViolation(`Unsupported value for property 'headers' (expected no value or an empty array)`);
41
+ }
42
+ if (config.queryParameters !== undefined && config.queryParameters.length !== 0) {
43
+ throw new codegen_1.ImportSafetyViolation(`Unsupported value for property 'queryParameters' (expected no value or an empty array)`);
44
+ }
45
+ if (config.webhookSecret) {
46
+ throw new codegen_1.ImportSafetyViolation(`Unsupported value for property 'webhookSecret' (expected no value)`);
47
+ }
48
+ }
49
+ describe(resource) {
50
+ this.validateSafety(resource);
51
+ return `Telegram Alert Channel: ${resource.config.name}`;
52
+ }
53
+ prepare(logicalId, resource, context) {
54
+ this.validateSafety(resource);
55
+ const { name } = resource.config;
56
+ const filename = context.filePath('resources/alert-channels/telegram', name, {
57
+ unique: true,
58
+ });
59
+ context.registerAlertChannel(resource.id, `${name} telegram`, this.program.generatedConstructFile(filename.fullPath));
60
+ }
61
+ gencode(logicalId, resource, context) {
62
+ this.validateSafety(resource);
63
+ const { id, file } = context.lookupAlertChannel(resource.id);
64
+ file.namedImport(construct, 'checkly/constructs');
65
+ const { config } = resource;
66
+ file.section((0, sourcegen_1.decl)(id, builder => {
67
+ builder.variable((0, sourcegen_1.expr)((0, sourcegen_1.ident)(construct), builder => {
68
+ builder.new(builder => {
69
+ builder.string(logicalId);
70
+ builder.object(builder => {
71
+ builder.string('name', config.name);
72
+ const apiKey = apiKeyFromUrl(config.url);
73
+ if (apiKey) {
74
+ builder.string('apiKey', apiKey);
75
+ }
76
+ else {
77
+ throw new Error(`Failed to extract Telegram API Key from webhook template: ${config.template}`);
78
+ }
79
+ if (config.template) {
80
+ const { chatId, text } = parseTemplate(config.template);
81
+ if (chatId) {
82
+ builder.string('chatId', chatId);
83
+ }
84
+ else {
85
+ throw new Error(`Failed to extract Telegram Chat ID from webhook template: ${config.template}`);
86
+ }
87
+ if (text) {
88
+ if (text !== telegram_alert_channel_1.TelegramAlertChannel.DEFAULT_PAYLOAD) {
89
+ builder.string('payload', text);
90
+ }
91
+ }
92
+ else {
93
+ throw new Error(`Failed to extract Telegram payload from webhook template: ${config.template}`);
94
+ }
95
+ }
96
+ (0, alert_channel_codegen_1.buildAlertChannelProps)(builder, resource);
97
+ });
98
+ });
99
+ }));
100
+ builder.export();
101
+ }));
102
+ }
103
+ }
104
+ exports.TelegramAlertChannelCodegen = TelegramAlertChannelCodegen;
105
+ //# sourceMappingURL=telegram-alert-channel-codegen.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"telegram-alert-channel-codegen.js","sourceRoot":"","sources":["../../src/constructs/telegram-alert-channel-codegen.ts"],"names":[],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,CAAA;4BACjG,CAAC;wBACH,CAAC;wBAED,IAAA,8CAAsB,EAAC,OAAO,EAAE,QAAQ,CAAC,CAAA;oBAC3C,CAAC,CAAC,CAAA;gBACJ,CAAC,CAAC,CAAA;YACJ,CAAC,CAAC,CAAC,CAAA;YAEH,OAAO,CAAC,MAAM,EAAE,CAAA;QAClB,CAAC,CAAC,CAAC,CAAA;IACL,CAAC;CACF;AA3FD,kEA2FC"}
@@ -15,6 +15,11 @@ export interface TelegramAlertChannelProps extends AlertChannelProps {
15
15
  * {@link https://www.checklyhq.com/docs/integrations/telegram/}
16
16
  */
17
17
  apiKey: string;
18
+ /**
19
+ * An optional custom payload. If not given,
20
+ * `TelegramAlertChannel.DEFAULT_PAYLOAD` will be used.
21
+ */
22
+ payload?: string;
18
23
  }
19
24
  /**
20
25
  * Creates a Telegram Alert Channel
@@ -24,6 +29,7 @@ export interface TelegramAlertChannelProps extends AlertChannelProps {
24
29
  * This class make use of the Alert Channel endpoints.
25
30
  */
26
31
  export declare class TelegramAlertChannel extends WebhookAlertChannel {
32
+ static DEFAULT_PAYLOAD: string;
27
33
  /**
28
34
  * Constructs the Telegram Alert Channel instance
29
35
  *
@@ -10,6 +10,10 @@ const webhook_alert_channel_1 = require("./webhook-alert-channel");
10
10
  * This class make use of the Alert Channel endpoints.
11
11
  */
12
12
  class TelegramAlertChannel extends webhook_alert_channel_1.WebhookAlertChannel {
13
+ static DEFAULT_PAYLOAD = `<b>{{ALERT_TITLE}}</b> at {{STARTED_AT}} in {{RUN_LOCATION}} ({{RESPONSE_TIME}}ms)
14
+ Tags: {{#each TAGS}} <i><b>{{this}}</b></i> {{#unless @last}},{{/unless}} {{/each}}
15
+ <a href="{{RESULT_LINK}}">View check result</a>
16
+ `;
13
17
  /**
14
18
  * Constructs the Telegram Alert Channel instance
15
19
  *
@@ -23,10 +27,10 @@ class TelegramAlertChannel extends webhook_alert_channel_1.WebhookAlertChannel {
23
27
  super(logicalId, props);
24
28
  this.webhookType = 'WEBHOOK_TELEGRAM';
25
29
  this.method = 'POST';
26
- this.template = `chat_id=${props.chatId}&parse_mode=HTML&text=<b>{{ALERT_TITLE}}</b> at {{STARTED_AT}} in {{RUN_LOCATION}} ({{RESPONSE_TIME}}ms)
27
- Tags: {{#each TAGS}} <i><b>{{this}}</b></i> {{#unless @last}},{{/unless}} {{/each}}
28
- <a href="{{RESULT_LINK}}">View check result</a>
29
- `;
30
+ const payload = props.payload ?? TelegramAlertChannel.DEFAULT_PAYLOAD;
31
+ // For historical reasons the payload is not escaped even though it
32
+ // should be.
33
+ this.template = `chat_id=${props.chatId}&parse_mode=HTML&text=${payload}`;
30
34
  this.url = `https://api.telegram.org/bot${props.apiKey}/sendMessage`;
31
35
  }
32
36
  synthesize() {
@@ -1 +1 @@
1
- {"version":3,"file":"telegram-alert-channel.js","sourceRoot":"","sources":["../../src/constructs/telegram-alert-channel.ts"],"names":[],"mappings":";;;AAAA,mEAA6D;AAoB7D;;;;;;GAMG;AACH,MAAa,oBAAqB,SAAQ,2CAAmB;IAC3D;;;;;;;QAOI;IACJ,YAAa,SAAiB,EAAE,KAAgC;QAC9D,aAAa;QACb,KAAK,CAAC,SAAS,EAAE,KAAK,CAAC,CAAA;QACvB,IAAI,CAAC,WAAW,GAAG,kBAAkB,CAAA;QACrC,IAAI,CAAC,MAAM,GAAG,MAAM,CAAA;QACpB,IAAI,CAAC,QAAQ,GAAG,WAAW,KAAK,CAAC,MAAM;;;CAG1C,CAAA;QACG,IAAI,CAAC,GAAG,GAAG,+BAA+B,KAAK,CAAC,MAAM,cAAc,CAAA;IACtE,CAAC;IAED,UAAU;QACR,OAAO;YACL,GAAG,KAAK,CAAC,UAAU,EAAE;YACrB,IAAI,EAAE,SAAS;YACf,MAAM,EAAE;gBACN,IAAI,EAAE,IAAI,CAAC,IAAI;gBACf,WAAW,EAAE,IAAI,CAAC,WAAW;gBAC7B,GAAG,EAAE,IAAI,CAAC,GAAG;gBACb,QAAQ,EAAE,IAAI,CAAC,QAAQ;gBACvB,MAAM,EAAE,IAAI,CAAC,MAAM;gBACnB,OAAO,EAAE,IAAI,CAAC,OAAO;gBACrB,eAAe,EAAE,IAAI,CAAC,eAAe;gBACrC,aAAa,EAAE,IAAI,CAAC,aAAa;aAClC;SACF,CAAA;IACH,CAAC;CACF;AArCD,oDAqCC"}
1
+ {"version":3,"file":"telegram-alert-channel.js","sourceRoot":"","sources":["../../src/constructs/telegram-alert-channel.ts"],"names":[],"mappings":";;;AAAA,mEAA6D;AAyB7D;;;;;;GAMG;AACH,MAAa,oBAAqB,SAAQ,2CAAmB;IAC3D,MAAM,CAAC,eAAe,GAAG;;;CAG1B,CAAA;IAEC;;;;;;;QAOI;IACJ,YAAa,SAAiB,EAAE,KAAgC;QAC9D,aAAa;QACb,KAAK,CAAC,SAAS,EAAE,KAAK,CAAC,CAAA;QACvB,IAAI,CAAC,WAAW,GAAG,kBAAkB,CAAA;QACrC,IAAI,CAAC,MAAM,GAAG,MAAM,CAAA;QACpB,MAAM,OAAO,GAAG,KAAK,CAAC,OAAO,IAAI,oBAAoB,CAAC,eAAe,CAAA;QACrE,mEAAmE;QACnE,aAAa;QACb,IAAI,CAAC,QAAQ,GAAG,WAAW,KAAK,CAAC,MAAM,yBAAyB,OAAO,EAAE,CAAA;QACzE,IAAI,CAAC,GAAG,GAAG,+BAA+B,KAAK,CAAC,MAAM,cAAc,CAAA;IACtE,CAAC;IAED,UAAU;QACR,OAAO;YACL,GAAG,KAAK,CAAC,UAAU,EAAE;YACrB,IAAI,EAAE,SAAS;YACf,MAAM,EAAE;gBACN,IAAI,EAAE,IAAI,CAAC,IAAI;gBACf,WAAW,EAAE,IAAI,CAAC,WAAW;gBAC7B,GAAG,EAAE,IAAI,CAAC,GAAG;gBACb,QAAQ,EAAE,IAAI,CAAC,QAAQ;gBACvB,MAAM,EAAE,IAAI,CAAC,MAAM;gBACnB,OAAO,EAAE,IAAI,CAAC,OAAO;gBACrB,eAAe,EAAE,IAAI,CAAC,eAAe;gBACrC,aAAa,EAAE,IAAI,CAAC,aAAa;aAClC;SACF,CAAA;IACH,CAAC;;AAzCH,oDA0CC"}
@@ -0,0 +1,34 @@
1
+ import { GeneratedFile, ObjectValueBuilder, Program } from '../sourcegen';
2
+ import { AlertChannelResource } from './alert-channel-codegen';
3
+ import { HttpHeader } from './http-header';
4
+ import { QueryParam } from './query-param';
5
+ import { IncidentioAlertChannelCodegen } from './incidentio-alert-channel-codegen';
6
+ import { MSTeamsAlertChannelCodegen } from './msteams-alert-channel-codegen';
7
+ import { TelegramAlertChannelCodegen } from './telegram-alert-channel-codegen';
8
+ import { Codegen, Context } from './internal/codegen';
9
+ export type WebhookType = 'WEBHOOK_INCIDENTIO' | 'WEBHOOK_TELEGRAM' | 'WEBHOOK_MSTEAMS';
10
+ export interface WebhookAlertChannelResourceConfig {
11
+ name: string;
12
+ webhookType?: WebhookType;
13
+ url: string;
14
+ template?: string;
15
+ method?: string;
16
+ headers?: HttpHeader[];
17
+ queryParameters?: QueryParam[];
18
+ webhookSecret?: string | null;
19
+ }
20
+ export interface WebhookAlertChannelResource extends AlertChannelResource {
21
+ type: 'WEBHOOK';
22
+ config: WebhookAlertChannelResourceConfig;
23
+ }
24
+ export declare function buildWebhookAlertChannelConfig(program: Program, genfile: GeneratedFile, context: Context, builder: ObjectValueBuilder, config: WebhookAlertChannelResourceConfig): void;
25
+ export declare class WebhookAlertChannelCodegen extends Codegen<WebhookAlertChannelResource> {
26
+ incidentioCodegen: IncidentioAlertChannelCodegen;
27
+ msteamsCodegen: MSTeamsAlertChannelCodegen;
28
+ telegramCodegen: TelegramAlertChannelCodegen;
29
+ codegensByWebhookType: Record<WebhookType, Codegen<any>>;
30
+ constructor(program: Program);
31
+ describe(resource: WebhookAlertChannelResource): string;
32
+ prepare(logicalId: string, resource: WebhookAlertChannelResource, context: Context): void;
33
+ gencode(logicalId: string, resource: WebhookAlertChannelResource, context: Context): void;
34
+ }
@@ -0,0 +1,152 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.WebhookAlertChannelCodegen = exports.buildWebhookAlertChannelConfig = void 0;
4
+ const sourcegen_1 = require("../sourcegen");
5
+ const alert_channel_codegen_1 = require("./alert-channel-codegen");
6
+ const key_value_pair_codegen_1 = require("./key-value-pair-codegen");
7
+ const incidentio_alert_channel_codegen_1 = require("./incidentio-alert-channel-codegen");
8
+ const msteams_alert_channel_codegen_1 = require("./msteams-alert-channel-codegen");
9
+ const telegram_alert_channel_codegen_1 = require("./telegram-alert-channel-codegen");
10
+ const codegen_1 = require("./internal/codegen");
11
+ function buildWebhookAlertChannelConfig(program, genfile, context, builder, config) {
12
+ builder.string('name', config.name);
13
+ if (config.webhookType) {
14
+ builder.string('webhookType', config.webhookType);
15
+ }
16
+ builder.string('url', config.url);
17
+ if (config.template) {
18
+ builder.string('template', config.template);
19
+ }
20
+ if (config.method) {
21
+ builder.string('method', config.method);
22
+ }
23
+ if (config.headers) {
24
+ const headers = config.headers;
25
+ if (headers.length > 0) {
26
+ builder.array('headers', builder => {
27
+ for (const header of headers) {
28
+ builder.value((0, key_value_pair_codegen_1.valueForKeyValuePair)(program, genfile, context, header));
29
+ }
30
+ });
31
+ }
32
+ }
33
+ if (config.queryParameters) {
34
+ const queryParameters = config.queryParameters;
35
+ if (queryParameters.length > 0) {
36
+ builder.array('queryParameters', builder => {
37
+ for (const param of queryParameters) {
38
+ builder.value((0, key_value_pair_codegen_1.valueForKeyValuePair)(program, genfile, context, param));
39
+ }
40
+ });
41
+ }
42
+ }
43
+ if (config.webhookSecret) {
44
+ builder.string('webhookSecret', config.webhookSecret);
45
+ }
46
+ }
47
+ exports.buildWebhookAlertChannelConfig = buildWebhookAlertChannelConfig;
48
+ const construct = 'WebhookAlertChannel';
49
+ class WebhookAlertChannelCodegen extends codegen_1.Codegen {
50
+ incidentioCodegen;
51
+ msteamsCodegen;
52
+ telegramCodegen;
53
+ codegensByWebhookType;
54
+ constructor(program) {
55
+ super(program);
56
+ this.incidentioCodegen = new incidentio_alert_channel_codegen_1.IncidentioAlertChannelCodegen(program);
57
+ this.msteamsCodegen = new msteams_alert_channel_codegen_1.MSTeamsAlertChannelCodegen(program);
58
+ this.telegramCodegen = new telegram_alert_channel_codegen_1.TelegramAlertChannelCodegen(program);
59
+ this.codegensByWebhookType = {
60
+ WEBHOOK_INCIDENTIO: this.incidentioCodegen,
61
+ WEBHOOK_MSTEAMS: this.msteamsCodegen,
62
+ WEBHOOK_TELEGRAM: this.telegramCodegen,
63
+ };
64
+ }
65
+ describe(resource) {
66
+ try {
67
+ const { webhookType } = resource.config;
68
+ if (webhookType) {
69
+ const codegen = this.codegensByWebhookType[webhookType];
70
+ if (codegen) {
71
+ return codegen.describe(resource);
72
+ }
73
+ }
74
+ }
75
+ catch (err) {
76
+ if (err instanceof codegen_1.ImportSafetyViolation) {
77
+ // The webhook contains unsupported data for its claimed type.
78
+ // Fall back to the standard webhook alert channel which can handle
79
+ // all subtypes.
80
+ }
81
+ else {
82
+ throw err;
83
+ }
84
+ }
85
+ return `Webhook Alert Channel: ${resource.config.name}`;
86
+ }
87
+ prepare(logicalId, resource, context) {
88
+ try {
89
+ const { webhookType } = resource.config;
90
+ if (webhookType) {
91
+ const codegen = this.codegensByWebhookType[webhookType];
92
+ if (codegen) {
93
+ codegen.prepare(logicalId, resource, context);
94
+ return;
95
+ }
96
+ }
97
+ }
98
+ catch (err) {
99
+ if (err instanceof codegen_1.ImportSafetyViolation) {
100
+ // The webhook contains unsupported data for its claimed type.
101
+ // Fall back to the standard webhook alert channel which can handle
102
+ // all subtypes.
103
+ }
104
+ else {
105
+ throw err;
106
+ }
107
+ }
108
+ const { name } = resource.config;
109
+ const filename = context.filePath('resources/alert-channels/webhook', name, {
110
+ unique: true,
111
+ });
112
+ context.registerAlertChannel(resource.id, `${name} webhook`, this.program.generatedConstructFile(filename.fullPath));
113
+ }
114
+ gencode(logicalId, resource, context) {
115
+ try {
116
+ const { webhookType } = resource.config;
117
+ if (webhookType) {
118
+ const codegen = this.codegensByWebhookType[webhookType];
119
+ if (codegen) {
120
+ codegen.gencode(logicalId, resource, context);
121
+ return;
122
+ }
123
+ }
124
+ }
125
+ catch (err) {
126
+ if (err instanceof codegen_1.ImportSafetyViolation) {
127
+ // The webhook contains unsupported data for its claimed type.
128
+ // Fall back to the standard webhook alert channel which can handle
129
+ // all subtypes.
130
+ }
131
+ else {
132
+ throw err;
133
+ }
134
+ }
135
+ const { id, file } = context.lookupAlertChannel(resource.id);
136
+ file.namedImport(construct, 'checkly/constructs');
137
+ file.section((0, sourcegen_1.decl)(id, builder => {
138
+ builder.variable((0, sourcegen_1.expr)((0, sourcegen_1.ident)(construct), builder => {
139
+ builder.new(builder => {
140
+ builder.string(logicalId);
141
+ builder.object(builder => {
142
+ buildWebhookAlertChannelConfig(this.program, file, context, builder, resource.config);
143
+ (0, alert_channel_codegen_1.buildAlertChannelProps)(builder, resource);
144
+ });
145
+ });
146
+ }));
147
+ builder.export();
148
+ }));
149
+ }
150
+ }
151
+ exports.WebhookAlertChannelCodegen = WebhookAlertChannelCodegen;
152
+ //# sourceMappingURL=webhook-alert-channel-codegen.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"webhook-alert-channel-codegen.js","sourceRoot":"","sources":["../../src/constructs/webhook-alert-channel-codegen.ts"],"names":[],"mappings":";;;AAAA,4CAA4F;AAC5F,mEAAsF;AAEtF,qEAA+D;AAG/D,yFAAkF;AAClF,mFAA4E;AAC5E,qFAA8E;AAC9E,gDAA4E;AAuB5E,SAAgB,8BAA8B,CAC5C,OAAgB,EAChB,OAAsB,EACtB,OAAgB,EAChB,OAA2B,EAC3B,MAAyC;IAEzC,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,IAAI,CAAC,CAAA;IAEnC,IAAI,MAAM,CAAC,WAAW,EAAE,CAAC;QACvB,OAAO,CAAC,MAAM,CAAC,aAAa,EAAE,MAAM,CAAC,WAAW,CAAC,CAAA;IACnD,CAAC;IAED,OAAO,CA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el endpoints.
12
12
  */
13
13
  class WebhookAlertChannel extends alert_channel_1.AlertChannel {
14
+ name;
15
+ webhookType;
16
+ url;
17
+ template;
18
+ method;
19
+ headers;
20
+ queryParameters;
21
+ webhookSecret;
14
22
  /**
15
23
  * Constructs the Webhook Alert Channel instance
16
24
  *
@@ -1 +1 @@
1
- {"version":3,"file":"webhook-alert-channel.js","sourceRoot":"","sources":["../../src/constructs/webhook-alert-channel.ts"],"names":[],"mappings":";;;AAAA,mDAAiE;AAIjE,uCAAmC;AAuCnC;;;;;;GAMG;AACH,MAAa,mBAAoB,SAAQ,4BAAY;IASnD;;;;;;;OAOG;IACH,YAAa,SAAiB,EAAE,KAA+B;QAC7D,KAAK,CAAC,SAAS,EAAE,KAAK,CAAC,CAAA;QACvB,IAAI,CAAC,IAAI,GAAG,KAAK,CAAC,IAAI,CAAA;QACtB,IAAI,CAAC,WAAW,GAAG,KAAK,CAAC,WAAW,CAAA;QACpC,IAAI,CAAC,GAAG,GAAG,KAAK,CAAC,GAAG,CAAA;QACpB,IAAI,CAAC,QAAQ,GAAG,KAAK,CAAC,QAAQ,CAAA;QAC9B,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC,MAAM,CAAA;QAC1B,IAAI,CAAC,OAAO,GAAG,KAAK,CAAC,OAAO,CAAA;QAC5B,IAAI,CAAC,eAAe,GAAG,KAAK,CAAC,eAAe,CAAA;QAC5C,IAAI,CAAC,aAAa,GAAG,KAAK,CAAC,aAAa,CAAA;QACxC,iBAAO,CAAC,iBAAiB,CAAC,IAAI,CAAC,CAAA;IACjC,CAAC;IAED,UAAU;QACR,OAAO;YACL,GAAG,KAAK,CAAC,UAAU,EAAE;YACrB,IAAI,EAAE,SAAS;YACf,MAAM,EAAE;gBACN,IAAI,EAAE,IAAI,CAAC,IAAI;gBACf,WAAW,EAAE,IAAI,CAAC,WAAW;gBAC7B,GAAG,EAAE,IAAI,CAAC,GAAG;gBACb,QAAQ,EAAE,IAAI,CAAC,QAAQ;gBACvB,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AAE,IAAI,CAAC,IAAI;gBACf,WAAW,EAAE,IAAI,CAAC,WAAW;gBAC7B,GAAG,EAAE,IAAI,CAAC,GAAG;gBACb,QAAQ,EAAE,IAAI,CAAC,QAAQ;gBACvB,MAAM,EAAE,IAAI,CAAC,MAAM;gBACnB,OAAO,EAAE,IAAI,CAAC,OAAO;gBACrB,eAAe,EAAE,IAAI,CAAC,eAAe;gBACrC,aAAa,EAAE,IAAI,CAAC,aAAa;aAClC;SACF,CAAA;IACH,CAAC;CACF;AA9CD,kDA8CC"}
@@ -31,8 +31,7 @@ class ChecklyHelpClass extends core_1.Help {
31
31
  this.section('ADDITIONAL COMMANDS', reder(formatCommandsWithTopics(additionalCommands)));
32
32
  }
33
33
  showRootHelp() {
34
- var _a, _b;
35
- const state = (_b = (_a = this.config.pjson) === null || _a === void 0 ? void 0 : _a.oclif) === null || _b === void 0 ? void 0 : _b.state;
34
+ const state = this.config.pjson?.oclif?.state;
36
35
  if (state) {
37
36
  this.log(state === 'deprecated'
38
37
  ? `${this.config.bin} is deprecated`
@@ -1 +1 @@
1
- {"version":3,"file":"help-extension.js","sourceRoot":"","sources":["../../src/help/help-extension.ts"],"names":[],"mappings":";;;;;AAAA,sCAA2C;AAC3C,0DAAiC;AAGjC,MAAqB,gBAAiB,SAAQ,WAAI;IACtC,iBAAiB,CAAE,QAAiC,EAC5D,MAAoB;QACpB,IAAI,QAAQ,CAAC,MAAM,KAAK,CAAC;YAAE,OAAO,EAAE,CAAA;QAEpC,MAAM,YAAY,GAAG,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,WAAW,CAAC,CAAA;QACxD,MAAM,kBAAkB,GAAG,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,WAAW,CAAC,CAAA;QAE/D,MAAM,2BAA2B,GAAG,CAAC,QAAiC,EAAE,EAAE,CACxE,QAAQ;YACN,8DAA8D;aAC7D,MAAM,CAAC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B,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,CAAA;QAEZ,IAAI,IAAI,CAAC,cAAc,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YACnC,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,iBAAiB,CAAC,IAAI,CAAC,cAAc,EAAE,IAAI,CAAC,YAAY,CAAC,CAAC,CAAA;YACxE,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,CAAA;QACd,CAAC;QAED,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,uBAAuB,EAC7C;;;KAGC,CAAC,CAAC,CAAA;QAEH,MAAM,cAAc,GAAG,kBAAQ,CAAC,MAAM,CAAC,CAAC,WAAW,EAAE,OAAO,EAAE,EAAE;YAC9D,OAAO,WAAW,GAAG,GAAG,OAAO,CAAC,WAAW,OAAO,IAAI,CAAC,MAAM,CAAC,IAAI,GAAG,OAAO,CAAC,OAAO,CAAC,MAAM,CAAA;QAC7F,CAAC,EAAE,EAAE,CAAC,CAAA;QAEN,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,UAAU,EAAE,cAAc,CAAC,CAAC,CAAA;QAClD,OAAO,OAAO,CAAC,OAAO,EAAE,CAAA;IAC1B,CAAC;CACF;AAjED,mCAiEC"}
@@ -0,0 +1,18 @@
1
+ import { BaseCommand } from '../commands/baseCommand';
2
+ export declare class CommandStyle {
3
+ private c;
4
+ constructor(command: BaseCommand);
5
+ actionStart(message: string): void;
6
+ actionSuccess(): void;
7
+ actionFailure(): void;
8
+ comment(message: string): void;
9
+ longSuccess(title: string, message: string): void;
10
+ shortSuccess(message: string): void;
11
+ longInfo(title: string, message: string): void;
12
+ shortInfo(message: string): void;
13
+ longWarning(title: string, message: string): void;
14
+ shortWarning(message: string): void;
15
+ longError(title: string, message: string): void;
16
+ shortError(message: string): void;
17
+ fatal(message: string): void;
18
+ }
@@ -0,0 +1,87 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.CommandStyle = void 0;
7
+ const chalk_1 = __importDefault(require("chalk"));
8
+ const core_1 = require("@oclif/core");
9
+ const wrap_1 = require("./wrap");
10
+ const log_symbols_1 = __importDefault(require("log-symbols"));
11
+ const wrapOptions = {
12
+ prefix: ' ',
13
+ length: 78,
14
+ };
15
+ class CommandStyle {
16
+ c;
17
+ constructor(command) {
18
+ this.c = command;
19
+ }
20
+ actionStart(message) {
21
+ if (this.c.fancy) {
22
+ core_1.ux.action.start(message, undefined, { stdout: true });
23
+ }
24
+ }
25
+ actionSuccess() {
26
+ if (this.c.fancy) {
27
+ core_1.ux.action.stop(`✅`);
28
+ this.c.log();
29
+ }
30
+ }
31
+ actionFailure() {
32
+ if (this.c.fancy) {
33
+ core_1.ux.action.stop(`❌`);
34
+ this.c.log();
35
+ }
36
+ }
37
+ comment(message) {
38
+ this.c.log(chalk_1.default.cyan((0, wrap_1.wrap)(message, { ...wrapOptions, prefix: '// ' })));
39
+ this.c.log();
40
+ }
41
+ longSuccess(title, message) {
42
+ this.c.log(`${log_symbols_1.default.success} ${title}`);
43
+ this.c.log();
44
+ this.c.log((0, wrap_1.wrap)(message, wrapOptions));
45
+ this.c.log();
46
+ }
47
+ shortSuccess(message) {
48
+ this.c.log(`${log_symbols_1.default.success} ${message}`);
49
+ this.c.log();
50
+ }
51
+ longInfo(title, message) {
52
+ this.c.log(`${log_symbols_1.default.info} ${title}`);
53
+ this.c.log();
54
+ this.c.log((0, wrap_1.wrap)(message, wrapOptions));
55
+ this.c.log();
56
+ }
57
+ shortInfo(message) {
58
+ this.c.log(`${log_symbols_1.default.info} ${message}`);
59
+ this.c.log();
60
+ }
61
+ longWarning(title, message) {
62
+ this.c.log(`${log_symbols_1.default.warning} ${title}`);
63
+ this.c.log();
64
+ this.c.log(chalk_1.default.yellow((0, wrap_1.wrap)(message, wrapOptions)));
65
+ this.c.log();
66
+ }
67
+ shortWarning(message) {
68
+ this.c.log(`${log_symbols_1.default.warning} ${chalk_1.default.yellow(message)}`);
69
+ this.c.log();
70
+ }
71
+ longError(title, message) {
72
+ this.c.log(`${log_symbols_1.default.error} ${title}`);
73
+ this.c.log();
74
+ this.c.log(chalk_1.default.red((0, wrap_1.wrap)(message, wrapOptions)));
75
+ this.c.log();
76
+ }
77
+ shortError(message) {
78
+ this.c.log(`${log_symbols_1.default.error} ${chalk_1.default.red(message)}`);
79
+ this.c.log();
80
+ }
81
+ fatal(message) {
82
+ this.c.log(chalk_1.default.red(message));
83
+ this.c.log();
84
+ }
85
+ }
86
+ exports.CommandStyle = CommandStyle;
87
+ //# sourceMappingURL=command-style.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"command-style.js","sourceRoot":"","sources":["../../src/helpers/command-style.ts"],"names":[],"mappings":";;;;;;AAAA,kDAAyB;AACzB,sCAAgC;AAGhC,iCAA6B;AAC7B,8DAAoC;AAEpC,MAAM,WAAW,GAAG;IAClB,MAAM,EAAE,IAAI;IACZ,MAAM,EAAE,EAAE;CACX,CAAA;AAED,MAAa,YAAY;IACf,CAAC,CAAa;IAEtB,YAAa,OAAoB;QAC/B,IAAI,CAAC,CAAC,GAAG,OAAO,CAAA;IAClB,CAAC;IAED,WAAW,CAAE,OAAe;QAC1B,IAAI,IAAI,CAAC,CAAC,CAAC,KAAK,EAAE,CAAC;YACjB,SAAE,CAAC,MAAM,CAAC,KAAK,CAAC,OAAO,EAAE,SAAS,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,CAAA;QACvD,CAAC;IACH,CAAC;IAED,aAAa;QACX,IAAI,IAAI,CAAC,CAAC,CAAC,KAAK,EAAE,CAAC;YACjB,SAAE,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;YACnB,IAAI,CAAC,CAAC,CAAC,GAAG,EAAE,CAAA;QACd,CAAC;IACH,CAAC;IAED,aAAa;QACX,I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