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,85 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Output = void 0;
4
+ class OutputBuffer {
5
+ #chunks = [];
6
+ append(data) {
7
+ this.#chunks.push(data);
8
+ }
9
+ finalize() {
10
+ return this.#chunks.join('');
11
+ }
12
+ }
13
+ class OutputLine {
14
+ #level;
15
+ #chunks = [];
16
+ constructor(level) {
17
+ this.#level = level;
18
+ }
19
+ get level() {
20
+ return this.#level;
21
+ }
22
+ isEmpty() {
23
+ return this.#chunks.length === 0;
24
+ }
25
+ append(value) {
26
+ this.#chunks.push(value);
27
+ }
28
+ collect(buf) {
29
+ buf.append(' '.repeat(this.#level));
30
+ buf.append(this.#chunks.join(''));
31
+ buf.append('\n');
32
+ }
33
+ }
34
+ class Output {
35
+ #level = 0;
36
+ #lines = [];
37
+ #currentLine;
38
+ constructor(level = 0) {
39
+ this.#level = level;
40
+ this.#currentLine = new OutputLine(this.#level);
41
+ this.#lines.push(this.#currentLine);
42
+ }
43
+ increaseIndent() {
44
+ this.#level += 1;
45
+ }
46
+ decreaseIndent() {
47
+ this.#level -= 1;
48
+ }
49
+ endLine(options) {
50
+ if (options?.collapse && this.#currentLine.isEmpty()) {
51
+ return;
52
+ }
53
+ this.#currentLine = new OutputLine(this.#level);
54
+ this.#lines.push(this.#currentLine);
55
+ }
56
+ append(value) {
57
+ this.#currentLine.append(value);
58
+ }
59
+ significantWhitespace() {
60
+ this.append(' ');
61
+ }
62
+ cosmeticWhitespace() {
63
+ this.append(' ');
64
+ }
65
+ finalize() {
66
+ // Remove trailing empty lines.
67
+ for (;;) {
68
+ const line = this.#lines.pop();
69
+ if (line === undefined) {
70
+ break;
71
+ }
72
+ if (!line.isEmpty()) {
73
+ this.#lines.push(line);
74
+ break;
75
+ }
76
+ }
77
+ const buf = new OutputBuffer();
78
+ for (const line of this.#lines) {
79
+ line.collect(buf);
80
+ }
81
+ return buf.finalize();
82
+ }
83
+ }
84
+ exports.Output = Output;
85
+ //# sourceMappingURL=output.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"output.js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,EAAE,CAAA;IACvB,CAAC;CACF;AA9DD,wBA8DC"}
@@ -0,0 +1,55 @@
1
+ /// <reference types="node" />
2
+ /// <reference types="node" />
3
+ import { Comment } from './comment';
4
+ import { Output } from './output';
5
+ import { Value } from './value';
6
+ import { Declaration } from './decl';
7
+ type Content = Comment | Declaration | Value;
8
+ type Header = Comment;
9
+ export interface ProgramOptions {
10
+ rootDirectory: string;
11
+ constructFileSuffix: string;
12
+ constructHeaders?: Header[];
13
+ specFileSuffix: string;
14
+ language: 'typescript' | 'javascript';
15
+ }
16
+ export declare class Program {
17
+ #private;
18
+ constructor(options: ProgramOptions);
19
+ get paths(): string[];
20
+ generatedConstructFile(path: string): GeneratedFile;
21
+ generatedSupportFile(path: string): GeneratedFile;
22
+ staticSpecFile(path: string, content: string | Buffer): StaticAuxiliaryFile;
23
+ staticStyleFile(path: string, content: string | Buffer): StaticAuxiliaryFile;
24
+ staticSupportFile(path: string, content: string | Buffer): StaticAuxiliaryFile;
25
+ realize(): Promise<void>;
26
+ }
27
+ export declare abstract class ProgramFile {
28
+ readonly path: string;
29
+ constructor(path: string);
30
+ get dirname(): string;
31
+ get basename(): string;
32
+ relativePath(to: ProgramFile): string;
33
+ }
34
+ export interface ImportOptions {
35
+ relativeTo?: string;
36
+ relativeToSelf?: boolean;
37
+ alias?: string;
38
+ }
39
+ export interface NamedImport {
40
+ identifier: string;
41
+ alias?: string;
42
+ }
43
+ export declare class GeneratedFile extends ProgramFile {
44
+ #private;
45
+ namedImport(identifier: string, from: string, options?: ImportOptions): void;
46
+ plainImport(from: string, options?: ImportOptions): void;
47
+ header(header: Header): void;
48
+ section(content: Content): void;
49
+ render(output: Output): void;
50
+ }
51
+ export declare class StaticAuxiliaryFile extends ProgramFile {
52
+ readonly content: string | Buffer;
53
+ constructor(path: string, content: string | Buffer);
54
+ }
55
+ export {};
@@ -0,0 +1,284 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
25
+ Object.defineProperty(exports, "__esModule", { value: true });
26
+ exports.StaticAuxiliaryFile = exports.GeneratedFile = exports.ProgramFile = exports.Program = void 0;
27
+ const promises_1 = require("node:fs/promises");
28
+ const node_path_1 = __importStar(require("node:path"));
29
+ const output_1 = require("./output");
30
+ class Program {
31
+ #options;
32
+ #ext;
33
+ #generatedFiles = new Map();
34
+ #staticAuxiliaryFiles = new Map();
35
+ constructor(options) {
36
+ this.#options = {
37
+ ...options,
38
+ };
39
+ switch (options.language) {
40
+ case 'typescript':
41
+ this.#ext = '.ts';
42
+ break;
43
+ case 'javascript':
44
+ this.#ext = '.js';
45
+ break;
46
+ default:
47
+ throw new Error(`Unknown value '${options.language}' for \`ProgramOptions.language\``);
48
+ }
49
+ }
50
+ get paths() {
51
+ const paths = [];
52
+ for (const file of this.#generatedFiles.values()) {
53
+ paths.push(node_path_1.default.join(this.#options.rootDirectory, file.path));
54
+ }
55
+ for (const file of this.#staticAuxiliaryFiles.values()) {
56
+ paths.push(node_path_1.default.join(this.#options.rootDirectory, file.path));
57
+ }
58
+ paths.sort();
59
+ return paths;
60
+ }
61
+ generatedConstructFile(path) {
62
+ if (this.#shouldModifyPath(path)) {
63
+ path += this.#options.constructFileSuffix;
64
+ path += this.#ext;
65
+ }
66
+ let file = this.#generatedFiles.get(path);
67
+ if (file === undefined) {
68
+ file = new GeneratedFile(path);
69
+ for (const header of this.#options.constructHeaders ?? []) {
70
+ file.header(header);
71
+ }
72
+ this.#generatedFiles.set(path, file);
73
+ }
74
+ return file;
75
+ }
76
+ generatedSupportFile(path) {
77
+ if (this.#shouldModifyPath(path)) {
78
+ path += this.#ext;
79
+ }
80
+ let file = this.#generatedFiles.get(path);
81
+ if (file === undefined) {
82
+ file = new GeneratedFile(path);
83
+ this.#generatedFiles.set(path, file);
84
+ }
85
+ return file;
86
+ }
87
+ staticSpecFile(path, content) {
88
+ if (this.#shouldModifyPath(path)) {
89
+ path += this.#options.specFileSuffix;
90
+ path += this.#ext;
91
+ }
92
+ const file = new StaticAuxiliaryFile(path, content);
93
+ this.#staticAuxiliaryFiles.set(path, file);
94
+ return file;
95
+ }
96
+ staticStyleFile(path, content) {
97
+ if (this.#shouldModifyPath(path)) {
98
+ path += '.css';
99
+ }
100
+ const file = new StaticAuxiliaryFile(path, content);
101
+ this.#staticAuxiliaryFiles.set(path, file);
102
+ return file;
103
+ }
104
+ staticSupportFile(path, content) {
105
+ if (this.#shouldModifyPath(path)) {
106
+ path += this.#ext;
107
+ }
108
+ const file = new StaticAuxiliaryFile(path, content);
109
+ this.#staticAuxiliaryFiles.set(path, file);
110
+ return file;
111
+ }
112
+ #shouldModifyPath(path) {
113
+ // Don't add extensions if it looks like we already have some.
114
+ return (0, node_path_1.extname)(path) === '';
115
+ }
116
+ async realize() {
117
+ for (const file of this.#generatedFiles.values()) {
118
+ const fullFilePath = node_path_1.default.resolve(this.#options.rootDirectory, file.path);
119
+ const { dir: fileDir } = node_path_1.default.parse(fullFilePath);
120
+ if (fileDir !== '') {
121
+ await (0, promises_1.mkdir)(fileDir, {
122
+ recursive: true,
123
+ });
124
+ }
125
+ const output = new output_1.Output();
126
+ try {
127
+ file.render(output);
128
+ }
129
+ catch (cause) {
130
+ throw new Error(`Failed to render output file '${fullFilePath}': ${cause}`, { cause });
131
+ }
132
+ await (0, promises_1.writeFile)(fullFilePath, output.finalize());
133
+ }
134
+ for (const file of this.#staticAuxiliaryFiles.values()) {
135
+ const fullFilePath = node_path_1.default.resolve(this.#options.rootDirectory, file.path);
136
+ const { dir: fileDir } = node_path_1.default.parse(fullFilePath);
137
+ if (fileDir !== '') {
138
+ await (0, promises_1.mkdir)(fileDir, {
139
+ recursive: true,
140
+ });
141
+ }
142
+ await (0, promises_1.writeFile)(fullFilePath, file.content);
143
+ }
144
+ }
145
+ }
146
+ exports.Program = Program;
147
+ class ProgramFile {
148
+ path;
149
+ constructor(path) {
150
+ this.path = path;
151
+ }
152
+ get dirname() {
153
+ return node_path_1.default.dirname(this.path);
154
+ }
155
+ get basename() {
156
+ return node_path_1.default.basename(this.path);
157
+ }
158
+ relativePath(to) {
159
+ let relpath = node_path_1.default.relative(this.dirname, to.path);
160
+ if (!relpath.startsWith('.')) {
161
+ relpath = `./${relpath}`;
162
+ }
163
+ return posixPath(relpath);
164
+ }
165
+ }
166
+ exports.ProgramFile = ProgramFile;
167
+ function posixPath(path) {
168
+ return path.replace(/\\/g, '/');
169
+ }
170
+ function sortNamedImports(imports) {
171
+ return Array.from(imports).sort((a, b) => {
172
+ const valueA = [a.identifier, a.alias].join(', ');
173
+ const valueB = [b.identifier, b.alias].join(', ');
174
+ return valueA.localeCompare(valueB);
175
+ });
176
+ }
177
+ class GeneratedFile extends ProgramFile {
178
+ #namedImports = new Map();
179
+ #plainImports = new Set();
180
+ #sections = [];
181
+ #headers = [];
182
+ namedImport(identifier, from, options) {
183
+ from = this.#processImportFrom(from, options);
184
+ const namedImports = this.#namedImports.get(from) ?? [];
185
+ for (const namedImport of namedImports) {
186
+ if (namedImport.identifier === identifier && namedImport.alias === options?.alias) {
187
+ // Already imported.
188
+ return;
189
+ }
190
+ }
191
+ namedImports.push({
192
+ identifier,
193
+ alias: options?.alias,
194
+ });
195
+ this.#namedImports.set(from, namedImports);
196
+ }
197
+ plainImport(from, options) {
198
+ from = this.#processImportFrom(from, options);
199
+ this.#plainImports.add(from);
200
+ }
201
+ #processImportFrom(from, options) {
202
+ let relativeTo = options?.relativeTo;
203
+ if (relativeTo === undefined && options?.relativeToSelf) {
204
+ relativeTo = node_path_1.default.dirname(this.path);
205
+ }
206
+ if (relativeTo !== undefined) {
207
+ from = node_path_1.default.relative(relativeTo, from);
208
+ if (!from.startsWith('.')) {
209
+ from = `./${from}`;
210
+ }
211
+ from = posixPath(from);
212
+ }
213
+ // Shouldn't have imports with .ts extensions.
214
+ if (from.endsWith('.ts') || from.endsWith('.js')) {
215
+ from = from.slice(0, -3);
216
+ }
217
+ return from;
218
+ }
219
+ header(header) {
220
+ this.#headers.push(header);
221
+ }
222
+ section(content) {
223
+ this.#sections.push(content);
224
+ }
225
+ render(output) {
226
+ for (const header of this.#headers) {
227
+ header.render(output);
228
+ output.endLine();
229
+ output.endLine();
230
+ }
231
+ if (this.#namedImports.size > 0) {
232
+ for (const [pkg, imports] of this.#namedImports.entries()) {
233
+ output.append('import');
234
+ output.cosmeticWhitespace();
235
+ output.append('{');
236
+ let first = true;
237
+ for (const { identifier, alias } of sortNamedImports(imports)) {
238
+ if (!first) {
239
+ output.append(',');
240
+ }
241
+ output.cosmeticWhitespace();
242
+ first = false;
243
+ output.append(identifier);
244
+ if (alias !== undefined) {
245
+ output.significantWhitespace();
246
+ output.append('as');
247
+ output.significantWhitespace();
248
+ output.append(alias);
249
+ }
250
+ }
251
+ output.cosmeticWhitespace();
252
+ output.append('}');
253
+ output.significantWhitespace();
254
+ output.append('from');
255
+ output.significantWhitespace();
256
+ output.append(`'${pkg}'`);
257
+ output.endLine();
258
+ }
259
+ }
260
+ if (this.#plainImports.size > 0) {
261
+ for (const pkg of this.#plainImports.values()) {
262
+ output.append('import');
263
+ output.significantWhitespace();
264
+ output.append(`'${pkg}'`);
265
+ output.endLine();
266
+ }
267
+ }
268
+ for (const section of this.#sections) {
269
+ output.endLine();
270
+ section.render(output);
271
+ output.endLine();
272
+ }
273
+ }
274
+ }
275
+ exports.GeneratedFile = GeneratedFile;
276
+ class StaticAuxiliaryFile extends ProgramFile {
277
+ content;
278
+ constructor(path, content) {
279
+ super(path);
280
+ this.content = content;
281
+ }
282
+ }
283
+ exports.StaticAuxiliaryFile = StaticAuxiliaryFile;
284
+ //# sourceMappingURL=program.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"program.js","sourceRoot":"","sources":["../../src/sourcegen/program.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+CAAmD;AACnD,uDAAyC;AAGzC,qCAAiC;AAgBjC,MAAa,OAAO;IAClB,QAAQ,CAAgB;IACxB,IAAI,CAAQ;IACZ,eAAe,GAAG,IAAI,GAAG,EAAyB,CAAA;IAClD,qBAAqB,GAAG,IAAI,GAAG,EAA+B,CAAA;IAE9D,YAAa,OAAuB;QAClC,IAAI,CAAC,QAAQ,GAAG;YACd,GAAG,OAAO;SACX,CAAA;QAED,QAAQ,OAAO,CAAC,QAAQ,EAAE,CAAC;YACzB,KAAK,YAAY;gBACf,IAAI,CAAC,IAAI,GAAG,KAAK,CAAA;gBACjB,MAAK;YACP,KAAK,YAAY;gBACf,IAAI,CAAC,IAAI,GAAG,KAAK,CAAA;gBACjB,MAAK;YACP;gBACE,MAAM,IAAI,KAAK,CAAC,kBAAkB,OAAO,CAAC,QAAQ,mCAAmC,CAAC,CAAA;QAC1F,CAAC;IACH,CAAC;IAED,IAAI,KAAK;QACP,MAAM,KAAK,GAAG,EAAE,CAAA;QAEhB,KAAK,MAAM,IAAI,IAAI,IAAI,CAAC,eAAe,CAAC,MAAM,EAAE,EAAE,CAAC;YACjD,KAAK,CAAC,IAAI,CAAC,mBAAI,CAAC,IAAI,CAAC,IAAI,CAAC,QAA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AE,CAAC;YAChC,KAAK,MAAM,GAAG,IAAI,IAAI,CAAC,aAAa,CAAC,MAAM,EAAE,EAAE,CAAC;gBAC9C,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAA;gBACvB,MAAM,CAAC,qBAAqB,EAAE,CAAA;gBAC9B,MAAM,CAAC,MAAM,CAAC,IAAI,GAAG,GAAG,CAAC,CAAA;gBACzB,MAAM,CAAC,OAAO,EAAE,CAAA;YAClB,CAAC;QACH,CAAC;QAED,KAAK,MAAM,OAAO,IAAI,IAAI,CAAC,SAAS,EAAE,CAAC;YACrC,MAAM,CAAC,OAAO,EAAE,CAAA;YAChB,OAAO,CAAC,MAAM,CAAC,MAAM,CAAC,CAAA;YACtB,MAAM,CAAC,OAAO,EAAE,CAAA;QAClB,CAAC;IACH,CAAC;CACF;AAlHD,sCAkHC;AAED,MAAa,mBAAoB,SAAQ,WAAW;IACzC,OAAO,CAAiB;IAEjC,YAAa,IAAY,EAAE,OAAwB;QACjD,KAAK,CAAC,IAAI,CAAC,CAAA;QAEX,IAAI,CAAC,OAAO,GAAG,OAAO,CAAA;IACxB,CAAC;CACF;AARD,kDAQC"}
@@ -0,0 +1,8 @@
1
+ import { Output } from './output';
2
+ import { Value } from './value';
3
+ export declare class StringValue extends Value {
4
+ value: string;
5
+ constructor(value: string);
6
+ render(output: Output): void;
7
+ }
8
+ export declare function quote(value: string): string;
@@ -0,0 +1,28 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.quote = exports.StringValue = void 0;
4
+ const node_util_1 = require("node:util");
5
+ const value_1 = require("./value");
6
+ class StringValue extends value_1.Value {
7
+ value;
8
+ constructor(value) {
9
+ super();
10
+ if (value === null) {
11
+ throw new Error('String value cannot be null');
12
+ }
13
+ if (value === undefined) {
14
+ throw new Error('String value cannot be undefined');
15
+ }
16
+ this.value = value;
17
+ }
18
+ render(output) {
19
+ output.append(quote(this.value));
20
+ }
21
+ }
22
+ exports.StringValue = StringValue;
23
+ function quote(value) {
24
+ // Not ideal but for now inspect() works.
25
+ return (0, node_util_1.inspect)(value);
26
+ }
27
+ exports.quote = quote;
28
+ //# sourceMappingURL=string.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"string.js","sourceRoot":"","sources":["../../src/sourcegen/string.ts"],"names":[],"mappings":";;;AAAA,yCAAmC;AAGnC,mCAA+B;AAE/B,MAAa,WAAY,SAAQ,aAAK;IACpC,KAAK,CAAQ;IAEb,YAAa,KAAa;QACxB,KAAK,EAAE,CAAA;QAEP,IAAI,KAAK,KAAK,IAAI,EAAE,CAAC;YACnB,MAAM,IAAI,KAAK,CAAC,6BAA6B,CAAC,CAAA;QAChD,CAAC;QAED,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;YACxB,MAAM,IAAI,KAAK,CAAC,kCAAkC,CAAC,CAAA;QACrD,CAAC;QAED,IAAI,CAAC,KAAK,GAAG,KAAK,CAAA;IACpB,CAAC;IAED,MAAM,CAAE,MAAc;QACpB,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAA;IAClC,CAAC;CACF;AApBD,kCAoBC;AAED,SAAgB,KAAK,CAAE,KAAa;IAClC,yCAAyC;IACzC,OAAO,IAAA,mBAAO,EAAC,KAAK,CAAC,CAAA;AACvB,CAAC;AAHD,sBAGC"}
@@ -0,0 +1,5 @@
1
+ import { Output } from './output';
2
+ import { Value } from './value';
3
+ export declare class UndefinedValue extends Value {
4
+ render(output: Output): void;
5
+ }
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.UndefinedValue = void 0;
4
+ const value_1 = require("./value");
5
+ class UndefinedValue extends value_1.Value {
6
+ render(output) {
7
+ output.append('undefined');
8
+ }
9
+ }
10
+ exports.UndefinedValue = UndefinedValue;
11
+ //# sourceMappingURL=undefined.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"undefined.js","sourceRoot":"","sources":["../../src/sourcegen/undefined.ts"],"names":[],"mappings":";;;AACA,mCAA+B;AAE/B,MAAa,cAAe,SAAQ,aAAK;IACvC,MAAM,CAAE,MAAc;QACpB,MAAM,CAAC,MAAM,CAAC,WAAW,CAAC,CAAA;IAC5B,CAAC;CACF;AAJD,wCAIC"}
@@ -0,0 +1,2 @@
1
+ import { Value } from './value';
2
+ export declare function unknown(value: any): Value;
@@ -0,0 +1,40 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.unknown = void 0;
4
+ const arraybuilder_1 = require("./arraybuilder");
5
+ const boolean_1 = require("./boolean");
6
+ const null_1 = require("./null");
7
+ const number_1 = require("./number");
8
+ const objectbuilder_1 = require("./objectbuilder");
9
+ const string_1 = require("./string");
10
+ const undefined_1 = require("./undefined");
11
+ function unknown(value) {
12
+ if (value === null) {
13
+ return new null_1.NullValue();
14
+ }
15
+ if (value === undefined) {
16
+ return new undefined_1.UndefinedValue();
17
+ }
18
+ switch (typeof value) {
19
+ case 'string':
20
+ return new string_1.StringValue(value);
21
+ case 'boolean':
22
+ return new boolean_1.BooleanValue(value);
23
+ case 'number':
24
+ return new number_1.NumberValue(value);
25
+ }
26
+ if (Array.isArray(value)) {
27
+ return (0, arraybuilder_1.array)(builder => {
28
+ for (const item of value) {
29
+ builder.value(unknown(item));
30
+ }
31
+ });
32
+ }
33
+ return (0, objectbuilder_1.object)(builder => {
34
+ for (const [key, val] of Object.entries(value)) {
35
+ builder.value(key, unknown(val));
36
+ }
37
+ });
38
+ }
39
+ exports.unknown = unknown;
40
+ //# sourceMappingURL=unknown.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"unknown.js","sourceRoot":"","sources":["../../src/sourcegen/unknown.ts"],"names":[],"mappings":";;;AAAA,iDAAsC;AACtC,uCAAwC;AACxC,iCAAkC;AAClC,qCAAsC;AACtC,mDAAwC;AACxC,qCAAsC;AACtC,2CAA4C;AAG5C,SAAgB,OAAO,CAAE,KAAU;IACjC,IAAI,KAAK,KAAK,IAAI,EAAE,CAAC;QACnB,OAAO,IAAI,gBAAS,EAAE,CAAA;IACxB,CAAC;IAED,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;QACxB,OAAO,IAAI,0BAAc,EAAE,CAAA;IAC7B,CAAC;IAED,QAAQ,OAAO,KAAK,EAAE,CAAC;QACrB,KAAK,QAAQ;YACX,OAAO,IAAI,oBAAW,CAAC,KAAK,CAAC,CAAA;QAC/B,KAAK,SAAS;YACZ,OAAO,IAAI,sBAAY,CAAC,KAAK,CAAC,CAAA;QAChC,KAAK,QAAQ;YACX,OAAO,IAAI,oBAAW,CAAC,KAAK,CAAC,CAAA;IACjC,CAAC;IAED,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;QACzB,OAAO,IAAA,oBAAK,EAAC,OAAO,CAAC,EAAE;YACrB,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;gBACzB,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAA;YAC9B,CAAC;QACH,CAAC,CAAC,CAAA;IACJ,CAAC;IAED,OAAO,IAAA,sBAAM,EAAC,OAAO,CAAC,EAAE;QACtB,KAAK,MAAM,CAAC,GAAG,EAAE,GAAG,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;YAC/C,OAAO,CAAC,KAAK,CAAC,GAAG,EAAE,OAAO,CAAC,GAAG,CAAC,CAAC,CAAA;QAClC,CAAC;IACH,CAAC,CAAC,CAAA;AACJ,CAAC;AA/BD,0BA+BC"}
@@ -0,0 +1,4 @@
1
+ import { Output } from './output';
2
+ export declare abstract class Value {
3
+ abstract render(output: Output): void;
4
+ }
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Value = void 0;
4
+ class Value {
5
+ }
6
+ exports.Value = Value;
7
+ //# sourceMappingURL=value.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"value.js","sourceRoot":"","sources":["../../src/sourcegen/value.ts"],"names":[],"mappings":";;;AAEA,MAAsB,KAAK;CAE1B;AAFD,sBAEC"}