@thymian/core 0.0.0-PLACEHOLDER

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 (642) hide show
  1. package/README.md +59 -0
  2. package/dist/actions/action.d.ts +5 -0
  3. package/dist/actions/action.d.ts.map +1 -0
  4. package/dist/actions/action.js +2 -0
  5. package/dist/actions/action.js.map +1 -0
  6. package/dist/actions/close.action.d.ts +3 -0
  7. package/dist/actions/close.action.d.ts.map +1 -0
  8. package/dist/actions/close.action.js +2 -0
  9. package/dist/actions/close.action.js.map +1 -0
  10. package/dist/actions/core-analyze.action.d.ts +11 -0
  11. package/dist/actions/core-analyze.action.d.ts.map +1 -0
  12. package/dist/actions/core-analyze.action.js +2 -0
  13. package/dist/actions/core-analyze.action.js.map +1 -0
  14. package/dist/actions/core-lint.action.d.ts +9 -0
  15. package/dist/actions/core-lint.action.d.ts.map +1 -0
  16. package/dist/actions/core-lint.action.js +2 -0
  17. package/dist/actions/core-lint.action.js.map +1 -0
  18. package/dist/actions/core-request-sample.action.d.ts +9 -0
  19. package/dist/actions/core-request-sample.action.d.ts.map +1 -0
  20. package/dist/actions/core-request-sample.action.js +2 -0
  21. package/dist/actions/core-request-sample.action.js.map +1 -0
  22. package/dist/actions/core-test.action.d.ts +10 -0
  23. package/dist/actions/core-test.action.d.ts.map +1 -0
  24. package/dist/actions/core-test.action.js +2 -0
  25. package/dist/actions/core-test.action.js.map +1 -0
  26. package/dist/actions/core-validation-input.d.ts +6 -0
  27. package/dist/actions/core-validation-input.d.ts.map +1 -0
  28. package/dist/actions/core-validation-input.js +2 -0
  29. package/dist/actions/core-validation-input.js.map +1 -0
  30. package/dist/actions/format-load.action.d.ts +16 -0
  31. package/dist/actions/format-load.action.d.ts.map +1 -0
  32. package/dist/actions/format-load.action.js +36 -0
  33. package/dist/actions/format-load.action.js.map +1 -0
  34. package/dist/actions/format.action.d.ts +4 -0
  35. package/dist/actions/format.action.d.ts.map +1 -0
  36. package/dist/actions/format.action.js +2 -0
  37. package/dist/actions/format.action.js.map +1 -0
  38. package/dist/actions/index.d.ts +39 -0
  39. package/dist/actions/index.d.ts.map +1 -0
  40. package/dist/actions/index.js +14 -0
  41. package/dist/actions/index.js.map +1 -0
  42. package/dist/actions/ready.action.d.ts +3 -0
  43. package/dist/actions/ready.action.d.ts.map +1 -0
  44. package/dist/actions/ready.action.js +2 -0
  45. package/dist/actions/ready.action.js.map +1 -0
  46. package/dist/actions/report-flush.action.d.ts +6 -0
  47. package/dist/actions/report-flush.action.d.ts.map +1 -0
  48. package/dist/actions/report-flush.action.js +2 -0
  49. package/dist/actions/report-flush.action.js.map +1 -0
  50. package/dist/actions/request-dispatch.action.d.ts +13 -0
  51. package/dist/actions/request-dispatch.action.d.ts.map +1 -0
  52. package/dist/actions/request-dispatch.action.js +45 -0
  53. package/dist/actions/request-dispatch.action.js.map +1 -0
  54. package/dist/actions/traffic-load.action.d.ts +16 -0
  55. package/dist/actions/traffic-load.action.d.ts.map +1 -0
  56. package/dist/actions/traffic-load.action.js +36 -0
  57. package/dist/actions/traffic-load.action.js.map +1 -0
  58. package/dist/actions/validation-result.d.ts +18 -0
  59. package/dist/actions/validation-result.d.ts.map +1 -0
  60. package/dist/actions/validation-result.js +81 -0
  61. package/dist/actions/validation-result.js.map +1 -0
  62. package/dist/ajv.d.ts +5 -0
  63. package/dist/ajv.d.ts.map +1 -0
  64. package/dist/ajv.js +9 -0
  65. package/dist/ajv.js.map +1 -0
  66. package/dist/chalk.d.ts +2 -0
  67. package/dist/chalk.d.ts.map +1 -0
  68. package/dist/chalk.js +2 -0
  69. package/dist/chalk.js.map +1 -0
  70. package/dist/constants.d.ts +5 -0
  71. package/dist/constants.d.ts.map +1 -0
  72. package/dist/constants.js +6 -0
  73. package/dist/constants.js.map +1 -0
  74. package/dist/core-plugin.d.ts +5 -0
  75. package/dist/core-plugin.d.ts.map +1 -0
  76. package/dist/core-plugin.js +62 -0
  77. package/dist/core-plugin.js.map +1 -0
  78. package/dist/emitter/action-event.d.ts +19 -0
  79. package/dist/emitter/action-event.d.ts.map +1 -0
  80. package/dist/emitter/action-event.js +2 -0
  81. package/dist/emitter/action-event.js.map +1 -0
  82. package/dist/emitter/error-event.d.ts +13 -0
  83. package/dist/emitter/error-event.d.ts.map +1 -0
  84. package/dist/emitter/error-event.js +2 -0
  85. package/dist/emitter/error-event.js.map +1 -0
  86. package/dist/emitter/events.d.ts +10 -0
  87. package/dist/emitter/events.d.ts.map +1 -0
  88. package/dist/emitter/events.js +2 -0
  89. package/dist/emitter/events.js.map +1 -0
  90. package/dist/emitter/index.d.ts +6 -0
  91. package/dist/emitter/index.d.ts.map +1 -0
  92. package/dist/emitter/index.js +6 -0
  93. package/dist/emitter/index.js.map +1 -0
  94. package/dist/emitter/thymian-emitter.d.ts +61 -0
  95. package/dist/emitter/thymian-emitter.d.ts.map +1 -0
  96. package/dist/emitter/thymian-emitter.js +371 -0
  97. package/dist/emitter/thymian-emitter.js.map +1 -0
  98. package/dist/emitter/utils.d.ts +8 -0
  99. package/dist/emitter/utils.d.ts.map +1 -0
  100. package/dist/emitter/utils.js +16 -0
  101. package/dist/emitter/utils.js.map +1 -0
  102. package/dist/events/error.event.d.ts +5 -0
  103. package/dist/events/error.event.d.ts.map +1 -0
  104. package/dist/events/error.event.js +49 -0
  105. package/dist/events/error.event.js.map +1 -0
  106. package/dist/events/exit.event.d.ts +14 -0
  107. package/dist/events/exit.event.d.ts.map +1 -0
  108. package/dist/events/exit.event.js +9 -0
  109. package/dist/events/exit.event.js.map +1 -0
  110. package/dist/events/index.d.ts +15 -0
  111. package/dist/events/index.d.ts.map +1 -0
  112. package/dist/events/index.js +4 -0
  113. package/dist/events/index.js.map +1 -0
  114. package/dist/events/register-plugin.event.d.ts +51 -0
  115. package/dist/events/register-plugin.event.d.ts.map +1 -0
  116. package/dist/events/register-plugin.event.js +29 -0
  117. package/dist/events/register-plugin.event.js.map +1 -0
  118. package/dist/events/report.event.d.ts +104 -0
  119. package/dist/events/report.event.d.ts.map +1 -0
  120. package/dist/events/report.event.js +109 -0
  121. package/dist/events/report.event.js.map +1 -0
  122. package/dist/format/circular-references.d.ts +3 -0
  123. package/dist/format/circular-references.d.ts.map +1 -0
  124. package/dist/format/circular-references.js +71 -0
  125. package/dist/format/circular-references.js.map +1 -0
  126. package/dist/format/edges/edge.d.ts +9 -0
  127. package/dist/format/edges/edge.d.ts.map +1 -0
  128. package/dist/format/edges/edge.js +2 -0
  129. package/dist/format/edges/edge.js.map +1 -0
  130. package/dist/format/edges/has-sample.edge.d.ts +5 -0
  131. package/dist/format/edges/has-sample.edge.d.ts.map +1 -0
  132. package/dist/format/edges/has-sample.edge.js +2 -0
  133. package/dist/format/edges/has-sample.edge.js.map +1 -0
  134. package/dist/format/edges/http-link.edge.d.ts +10 -0
  135. package/dist/format/edges/http-link.edge.d.ts.map +1 -0
  136. package/dist/format/edges/http-link.edge.js +2 -0
  137. package/dist/format/edges/http-link.edge.js.map +1 -0
  138. package/dist/format/edges/http-transaction.edge.d.ts +5 -0
  139. package/dist/format/edges/http-transaction.edge.d.ts.map +1 -0
  140. package/dist/format/edges/http-transaction.edge.js +2 -0
  141. package/dist/format/edges/http-transaction.edge.js.map +1 -0
  142. package/dist/format/edges/is-secured-with.edge.d.ts +5 -0
  143. package/dist/format/edges/is-secured-with.edge.d.ts.map +1 -0
  144. package/dist/format/edges/is-secured-with.edge.js +2 -0
  145. package/dist/format/edges/is-secured-with.edge.js.map +1 -0
  146. package/dist/format/edges/sample-http-transaction.edge.d.ts +5 -0
  147. package/dist/format/edges/sample-http-transaction.edge.d.ts.map +1 -0
  148. package/dist/format/edges/sample-http-transaction.edge.js +2 -0
  149. package/dist/format/edges/sample-http-transaction.edge.js.map +1 -0
  150. package/dist/format/format-location.d.ts +13 -0
  151. package/dist/format/format-location.d.ts.map +1 -0
  152. package/dist/format/format-location.js +2 -0
  153. package/dist/format/format-location.js.map +1 -0
  154. package/dist/format/http-filter-expression-to-transaction-filter.d.ts +5 -0
  155. package/dist/format/http-filter-expression-to-transaction-filter.d.ts.map +1 -0
  156. package/dist/format/http-filter-expression-to-transaction-filter.js +88 -0
  157. package/dist/format/http-filter-expression-to-transaction-filter.js.map +1 -0
  158. package/dist/format/index.d.ts +14 -0
  159. package/dist/format/index.d.ts.map +1 -0
  160. package/dist/format/index.js +14 -0
  161. package/dist/format/index.js.map +1 -0
  162. package/dist/format/nodes/http-request.node.d.ts +29 -0
  163. package/dist/format/nodes/http-request.node.d.ts.map +1 -0
  164. package/dist/format/nodes/http-request.node.js +2 -0
  165. package/dist/format/nodes/http-request.node.js.map +1 -0
  166. package/dist/format/nodes/http-response.node.d.ts +12 -0
  167. package/dist/format/nodes/http-response.node.d.ts.map +1 -0
  168. package/dist/format/nodes/http-response.node.js +2 -0
  169. package/dist/format/nodes/http-response.node.js.map +1 -0
  170. package/dist/format/nodes/node.d.ts +9 -0
  171. package/dist/format/nodes/node.d.ts.map +1 -0
  172. package/dist/format/nodes/node.js +2 -0
  173. package/dist/format/nodes/node.js.map +1 -0
  174. package/dist/format/nodes/sample-http-request.node.d.ts +7 -0
  175. package/dist/format/nodes/sample-http-request.node.d.ts.map +1 -0
  176. package/dist/format/nodes/sample-http-request.node.js +2 -0
  177. package/dist/format/nodes/sample-http-request.node.js.map +1 -0
  178. package/dist/format/nodes/sample-http-response.node.d.ts +7 -0
  179. package/dist/format/nodes/sample-http-response.node.d.ts.map +1 -0
  180. package/dist/format/nodes/sample-http-response.node.js +2 -0
  181. package/dist/format/nodes/sample-http-response.node.js.map +1 -0
  182. package/dist/format/nodes/security-scheme.node.d.ts +17 -0
  183. package/dist/format/nodes/security-scheme.node.d.ts.map +1 -0
  184. package/dist/format/nodes/security-scheme.node.js +2 -0
  185. package/dist/format/nodes/security-scheme.node.js.map +1 -0
  186. package/dist/format/parameter.d.ts +10 -0
  187. package/dist/format/parameter.d.ts.map +1 -0
  188. package/dist/format/parameter.js +2 -0
  189. package/dist/format/parameter.js.map +1 -0
  190. package/dist/format/serialization-style/cookie.serialization-style.d.ts +5 -0
  191. package/dist/format/serialization-style/cookie.serialization-style.d.ts.map +1 -0
  192. package/dist/format/serialization-style/cookie.serialization-style.js +7 -0
  193. package/dist/format/serialization-style/cookie.serialization-style.js.map +1 -0
  194. package/dist/format/serialization-style/header.serialization-style.d.ts +5 -0
  195. package/dist/format/serialization-style/header.serialization-style.d.ts.map +1 -0
  196. package/dist/format/serialization-style/header.serialization-style.js +7 -0
  197. package/dist/format/serialization-style/header.serialization-style.js.map +1 -0
  198. package/dist/format/serialization-style/index.d.ts +6 -0
  199. package/dist/format/serialization-style/index.d.ts.map +1 -0
  200. package/dist/format/serialization-style/index.js +6 -0
  201. package/dist/format/serialization-style/index.js.map +1 -0
  202. package/dist/format/serialization-style/path.serialization-style.d.ts +5 -0
  203. package/dist/format/serialization-style/path.serialization-style.d.ts.map +1 -0
  204. package/dist/format/serialization-style/path.serialization-style.js +7 -0
  205. package/dist/format/serialization-style/path.serialization-style.js.map +1 -0
  206. package/dist/format/serialization-style/query.serialization-style.d.ts +5 -0
  207. package/dist/format/serialization-style/query.serialization-style.d.ts.map +1 -0
  208. package/dist/format/serialization-style/query.serialization-style.js +7 -0
  209. package/dist/format/serialization-style/query.serialization-style.js.map +1 -0
  210. package/dist/format/serialization-style/serialization-style.d.ts +13 -0
  211. package/dist/format/serialization-style/serialization-style.d.ts.map +1 -0
  212. package/dist/format/serialization-style/serialization-style.js +25 -0
  213. package/dist/format/serialization-style/serialization-style.js.map +1 -0
  214. package/dist/format/thymian-format.d.ts +109 -0
  215. package/dist/format/thymian-format.d.ts.map +1 -0
  216. package/dist/format/thymian-format.js +437 -0
  217. package/dist/format/thymian-format.js.map +1 -0
  218. package/dist/format/thymian-schema.d.ts +56 -0
  219. package/dist/format/thymian-schema.d.ts.map +1 -0
  220. package/dist/format/thymian-schema.js +2 -0
  221. package/dist/format/thymian-schema.js.map +1 -0
  222. package/dist/format/utils.d.ts +12 -0
  223. package/dist/format/utils.d.ts.map +1 -0
  224. package/dist/format/utils.js +85 -0
  225. package/dist/format/utils.js.map +1 -0
  226. package/dist/http-filter-visitor.d.ts +76 -0
  227. package/dist/http-filter-visitor.d.ts.map +1 -0
  228. package/dist/http-filter-visitor.js +168 -0
  229. package/dist/http-filter-visitor.js.map +1 -0
  230. package/dist/http-filter.d.ts +140 -0
  231. package/dist/http-filter.d.ts.map +1 -0
  232. package/dist/http-filter.js +137 -0
  233. package/dist/http-filter.js.map +1 -0
  234. package/dist/http-status-codes/1xx/index.d.ts +15 -0
  235. package/dist/http-status-codes/1xx/index.d.ts.map +1 -0
  236. package/dist/http-status-codes/1xx/index.js +15 -0
  237. package/dist/http-status-codes/1xx/index.js.map +1 -0
  238. package/dist/http-status-codes/1xx/informational.phrases.d.ts +4 -0
  239. package/dist/http-status-codes/1xx/informational.phrases.d.ts.map +1 -0
  240. package/dist/http-status-codes/1xx/informational.phrases.js +10 -0
  241. package/dist/http-status-codes/1xx/informational.phrases.js.map +1 -0
  242. package/dist/http-status-codes/1xx/informational.status-codes.d.ts +4 -0
  243. package/dist/http-status-codes/1xx/informational.status-codes.d.ts.map +1 -0
  244. package/dist/http-status-codes/1xx/informational.status-codes.js +5 -0
  245. package/dist/http-status-codes/1xx/informational.status-codes.js.map +1 -0
  246. package/dist/http-status-codes/2xx/index.d.ts +25 -0
  247. package/dist/http-status-codes/2xx/index.d.ts.map +1 -0
  248. package/dist/http-status-codes/2xx/index.js +25 -0
  249. package/dist/http-status-codes/2xx/index.js.map +1 -0
  250. package/dist/http-status-codes/2xx/successful.phrases.d.ts +4 -0
  251. package/dist/http-status-codes/2xx/successful.phrases.d.ts.map +1 -0
  252. package/dist/http-status-codes/2xx/successful.phrases.js +15 -0
  253. package/dist/http-status-codes/2xx/successful.phrases.js.map +1 -0
  254. package/dist/http-status-codes/2xx/successful.status-codes.d.ts +4 -0
  255. package/dist/http-status-codes/2xx/successful.status-codes.d.ts.map +1 -0
  256. package/dist/http-status-codes/2xx/successful.status-codes.js +7 -0
  257. package/dist/http-status-codes/2xx/successful.status-codes.js.map +1 -0
  258. package/dist/http-status-codes/3xx/index.d.ts +21 -0
  259. package/dist/http-status-codes/3xx/index.d.ts.map +1 -0
  260. package/dist/http-status-codes/3xx/index.js +21 -0
  261. package/dist/http-status-codes/3xx/index.js.map +1 -0
  262. package/dist/http-status-codes/3xx/redirection.phrases.d.ts +4 -0
  263. package/dist/http-status-codes/3xx/redirection.phrases.d.ts.map +1 -0
  264. package/dist/http-status-codes/3xx/redirection.phrases.js +13 -0
  265. package/dist/http-status-codes/3xx/redirection.phrases.js.map +1 -0
  266. package/dist/http-status-codes/3xx/redirection.status-codes.d.ts +4 -0
  267. package/dist/http-status-codes/3xx/redirection.status-codes.d.ts.map +1 -0
  268. package/dist/http-status-codes/3xx/redirection.status-codes.js +7 -0
  269. package/dist/http-status-codes/3xx/redirection.status-codes.js.map +1 -0
  270. package/dist/http-status-codes/4xx/client-error.phrases.d.ts +4 -0
  271. package/dist/http-status-codes/4xx/client-error.phrases.d.ts.map +1 -0
  272. package/dist/http-status-codes/4xx/client-error.phrases.js +34 -0
  273. package/dist/http-status-codes/4xx/client-error.phrases.js.map +1 -0
  274. package/dist/http-status-codes/4xx/client-error.status-codes.d.ts +4 -0
  275. package/dist/http-status-codes/4xx/client-error.status-codes.d.ts.map +1 -0
  276. package/dist/http-status-codes/4xx/client-error.status-codes.js +8 -0
  277. package/dist/http-status-codes/4xx/client-error.status-codes.js.map +1 -0
  278. package/dist/http-status-codes/4xx/index.d.ts +63 -0
  279. package/dist/http-status-codes/4xx/index.d.ts.map +1 -0
  280. package/dist/http-status-codes/4xx/index.js +63 -0
  281. package/dist/http-status-codes/4xx/index.js.map +1 -0
  282. package/dist/http-status-codes/5xx/index.d.ts +29 -0
  283. package/dist/http-status-codes/5xx/index.d.ts.map +1 -0
  284. package/dist/http-status-codes/5xx/index.js +29 -0
  285. package/dist/http-status-codes/5xx/index.js.map +1 -0
  286. package/dist/http-status-codes/5xx/server-error.phrases.d.ts +4 -0
  287. package/dist/http-status-codes/5xx/server-error.phrases.d.ts.map +1 -0
  288. package/dist/http-status-codes/5xx/server-error.phrases.js +17 -0
  289. package/dist/http-status-codes/5xx/server-error.phrases.js.map +1 -0
  290. package/dist/http-status-codes/5xx/server-error.status-codes.d.ts +4 -0
  291. package/dist/http-status-codes/5xx/server-error.status-codes.d.ts.map +1 -0
  292. package/dist/http-status-codes/5xx/server-error.status-codes.js +7 -0
  293. package/dist/http-status-codes/5xx/server-error.status-codes.js.map +1 -0
  294. package/dist/http-status-codes/http-status-code-ranges.d.ts +11 -0
  295. package/dist/http-status-codes/http-status-code-ranges.d.ts.map +1 -0
  296. package/dist/http-status-codes/http-status-code-ranges.js +19 -0
  297. package/dist/http-status-codes/http-status-code-ranges.js.map +1 -0
  298. package/dist/http-status-codes/http-status-code.d.ts +8 -0
  299. package/dist/http-status-codes/http-status-code.d.ts.map +1 -0
  300. package/dist/http-status-codes/http-status-code.js +13 -0
  301. package/dist/http-status-codes/http-status-code.js.map +1 -0
  302. package/dist/http-status-codes/http-status-phrase.d.ts +8 -0
  303. package/dist/http-status-codes/http-status-phrase.d.ts.map +1 -0
  304. package/dist/http-status-codes/http-status-phrase.js +13 -0
  305. package/dist/http-status-codes/http-status-phrase.js.map +1 -0
  306. package/dist/http-status-codes/index.d.ts +10 -0
  307. package/dist/http-status-codes/index.d.ts.map +1 -0
  308. package/dist/http-status-codes/index.js +10 -0
  309. package/dist/http-status-codes/index.js.map +1 -0
  310. package/dist/http-status-codes/phrase-to-status-code.d.ts +62 -0
  311. package/dist/http-status-codes/phrase-to-status-code.d.ts.map +1 -0
  312. package/dist/http-status-codes/phrase-to-status-code.js +13 -0
  313. package/dist/http-status-codes/phrase-to-status-code.js.map +1 -0
  314. package/dist/http-status-codes/status-code-to-phrase.d.ts +62 -0
  315. package/dist/http-status-codes/status-code-to-phrase.d.ts.map +1 -0
  316. package/dist/http-status-codes/status-code-to-phrase.js +13 -0
  317. package/dist/http-status-codes/status-code-to-phrase.js.map +1 -0
  318. package/dist/http-status-codes/validate.d.ts +5 -0
  319. package/dist/http-status-codes/validate.d.ts.map +1 -0
  320. package/dist/http-status-codes/validate.js +28 -0
  321. package/dist/http-status-codes/validate.js.map +1 -0
  322. package/dist/http-testing/http-test/create-hook-runner.d.ts +21 -0
  323. package/dist/http-testing/http-test/create-hook-runner.d.ts.map +1 -0
  324. package/dist/http-testing/http-test/create-hook-runner.js +17 -0
  325. package/dist/http-testing/http-test/create-hook-runner.js.map +1 -0
  326. package/dist/http-testing/http-test/create-http-test-context.d.ts +3 -0
  327. package/dist/http-testing/http-test/create-http-test-context.d.ts.map +1 -0
  328. package/dist/http-testing/http-test/create-http-test-context.js +24 -0
  329. package/dist/http-testing/http-test/create-http-test-context.js.map +1 -0
  330. package/dist/http-testing/http-test/http-test-case-result.d.ts +46 -0
  331. package/dist/http-testing/http-test/http-test-case-result.d.ts.map +1 -0
  332. package/dist/http-testing/http-test/http-test-case-result.js +2 -0
  333. package/dist/http-testing/http-test/http-test-case-result.js.map +1 -0
  334. package/dist/http-testing/http-test/http-test-case.d.ts +36 -0
  335. package/dist/http-testing/http-test/http-test-case.d.ts.map +1 -0
  336. package/dist/http-testing/http-test/http-test-case.js +2 -0
  337. package/dist/http-testing/http-test/http-test-case.js.map +1 -0
  338. package/dist/http-testing/http-test/http-test-context.d.ts +20 -0
  339. package/dist/http-testing/http-test/http-test-context.d.ts.map +1 -0
  340. package/dist/http-testing/http-test/http-test-context.js +2 -0
  341. package/dist/http-testing/http-test/http-test-context.js.map +1 -0
  342. package/dist/http-testing/http-test/http-test-hooks.d.ts +26 -0
  343. package/dist/http-testing/http-test/http-test-hooks.d.ts.map +1 -0
  344. package/dist/http-testing/http-test/http-test-hooks.js +2 -0
  345. package/dist/http-testing/http-test/http-test-hooks.js.map +1 -0
  346. package/dist/http-testing/http-test/http-test-pipeline.d.ts +10 -0
  347. package/dist/http-testing/http-test/http-test-pipeline.d.ts.map +1 -0
  348. package/dist/http-testing/http-test/http-test-pipeline.js +2 -0
  349. package/dist/http-testing/http-test/http-test-pipeline.js.map +1 -0
  350. package/dist/http-testing/http-test/http-test.d.ts +11 -0
  351. package/dist/http-testing/http-test/http-test.d.ts.map +1 -0
  352. package/dist/http-testing/http-test/http-test.js +35 -0
  353. package/dist/http-testing/http-test/http-test.js.map +1 -0
  354. package/dist/http-testing/http-test/index.d.ts +10 -0
  355. package/dist/http-testing/http-test/index.d.ts.map +1 -0
  356. package/dist/http-testing/http-test/index.js +10 -0
  357. package/dist/http-testing/http-test/index.js.map +1 -0
  358. package/dist/http-testing/http-test/utils.d.ts +11 -0
  359. package/dist/http-testing/http-test/utils.d.ts.map +1 -0
  360. package/dist/http-testing/http-test/utils.js +16 -0
  361. package/dist/http-testing/http-test/utils.js.map +1 -0
  362. package/dist/http-testing/index.d.ts +7 -0
  363. package/dist/http-testing/index.d.ts.map +1 -0
  364. package/dist/http-testing/index.js +7 -0
  365. package/dist/http-testing/index.js.map +1 -0
  366. package/dist/http-testing/operators/expect-for-transaction.operator.d.ts +5 -0
  367. package/dist/http-testing/operators/expect-for-transaction.operator.d.ts.map +1 -0
  368. package/dist/http-testing/operators/expect-for-transaction.operator.js +39 -0
  369. package/dist/http-testing/operators/expect-for-transaction.operator.js.map +1 -0
  370. package/dist/http-testing/operators/expect-headers.operator.d.ts +4 -0
  371. package/dist/http-testing/operators/expect-headers.operator.d.ts.map +1 -0
  372. package/dist/http-testing/operators/expect-headers.operator.js +37 -0
  373. package/dist/http-testing/operators/expect-headers.operator.js.map +1 -0
  374. package/dist/http-testing/operators/expect-status-code.operator.d.ts +5 -0
  375. package/dist/http-testing/operators/expect-status-code.operator.d.ts.map +1 -0
  376. package/dist/http-testing/operators/expect-status-code.operator.js +55 -0
  377. package/dist/http-testing/operators/expect-status-code.operator.js.map +1 -0
  378. package/dist/http-testing/operators/expect.operator.d.ts +4 -0
  379. package/dist/http-testing/operators/expect.operator.d.ts.map +1 -0
  380. package/dist/http-testing/operators/expect.operator.js +31 -0
  381. package/dist/http-testing/operators/expect.operator.js.map +1 -0
  382. package/dist/http-testing/operators/fail.operator.d.ts +4 -0
  383. package/dist/http-testing/operators/fail.operator.d.ts.map +1 -0
  384. package/dist/http-testing/operators/fail.operator.js +8 -0
  385. package/dist/http-testing/operators/fail.operator.js.map +1 -0
  386. package/dist/http-testing/operators/filter-http-transactions.operator.d.ts +10 -0
  387. package/dist/http-testing/operators/filter-http-transactions.operator.d.ts.map +1 -0
  388. package/dist/http-testing/operators/filter-http-transactions.operator.js +18 -0
  389. package/dist/http-testing/operators/filter-http-transactions.operator.js.map +1 -0
  390. package/dist/http-testing/operators/generate-requests.operator.d.ts +10 -0
  391. package/dist/http-testing/operators/generate-requests.operator.d.ts.map +1 -0
  392. package/dist/http-testing/operators/generate-requests.operator.js +44 -0
  393. package/dist/http-testing/operators/generate-requests.operator.js.map +1 -0
  394. package/dist/http-testing/operators/index.d.ts +21 -0
  395. package/dist/http-testing/operators/index.d.ts.map +1 -0
  396. package/dist/http-testing/operators/index.js +21 -0
  397. package/dist/http-testing/operators/index.js.map +1 -0
  398. package/dist/http-testing/operators/map-to-grouped-test-case.operator.d.ts +7 -0
  399. package/dist/http-testing/operators/map-to-grouped-test-case.operator.d.ts.map +1 -0
  400. package/dist/http-testing/operators/map-to-grouped-test-case.operator.js +32 -0
  401. package/dist/http-testing/operators/map-to-grouped-test-case.operator.js.map +1 -0
  402. package/dist/http-testing/operators/map-to-test-case.operator.d.ts +7 -0
  403. package/dist/http-testing/operators/map-to-test-case.operator.d.ts.map +1 -0
  404. package/dist/http-testing/operators/map-to-test-case.operator.js +21 -0
  405. package/dist/http-testing/operators/map-to-test-case.operator.js.map +1 -0
  406. package/dist/http-testing/operators/override-headers.operator.d.ts +5 -0
  407. package/dist/http-testing/operators/override-headers.operator.d.ts.map +1 -0
  408. package/dist/http-testing/operators/override-headers.operator.js +18 -0
  409. package/dist/http-testing/operators/override-headers.operator.js.map +1 -0
  410. package/dist/http-testing/operators/override-with-previous.operator.d.ts +5 -0
  411. package/dist/http-testing/operators/override-with-previous.operator.d.ts.map +1 -0
  412. package/dist/http-testing/operators/override-with-previous.operator.js +23 -0
  413. package/dist/http-testing/operators/override-with-previous.operator.js.map +1 -0
  414. package/dist/http-testing/operators/replay-previous-step.operator.d.ts +5 -0
  415. package/dist/http-testing/operators/replay-previous-step.operator.d.ts.map +1 -0
  416. package/dist/http-testing/operators/replay-previous-step.operator.js +27 -0
  417. package/dist/http-testing/operators/replay-previous-step.operator.js.map +1 -0
  418. package/dist/http-testing/operators/reply-previous-but-expect-response.operator.d.ts +7 -0
  419. package/dist/http-testing/operators/reply-previous-but-expect-response.operator.d.ts.map +1 -0
  420. package/dist/http-testing/operators/reply-previous-but-expect-response.operator.js +61 -0
  421. package/dist/http-testing/operators/reply-previous-but-expect-response.operator.js.map +1 -0
  422. package/dist/http-testing/operators/requires-authorization.operator.d.ts +5 -0
  423. package/dist/http-testing/operators/requires-authorization.operator.d.ts.map +1 -0
  424. package/dist/http-testing/operators/requires-authorization.operator.js +9 -0
  425. package/dist/http-testing/operators/requires-authorization.operator.js.map +1 -0
  426. package/dist/http-testing/operators/run-requests.operator.d.ts +14 -0
  427. package/dist/http-testing/operators/run-requests.operator.d.ts.map +1 -0
  428. package/dist/http-testing/operators/run-requests.operator.js +139 -0
  429. package/dist/http-testing/operators/run-requests.operator.js.map +1 -0
  430. package/dist/http-testing/operators/single-step-for-transaction.operator.d.ts +5 -0
  431. package/dist/http-testing/operators/single-step-for-transaction.operator.d.ts.map +1 -0
  432. package/dist/http-testing/operators/single-step-for-transaction.operator.js +43 -0
  433. package/dist/http-testing/operators/single-step-for-transaction.operator.js.map +1 -0
  434. package/dist/http-testing/operators/skip.operator.d.ts +5 -0
  435. package/dist/http-testing/operators/skip.operator.d.ts.map +1 -0
  436. package/dist/http-testing/operators/skip.operator.js +11 -0
  437. package/dist/http-testing/operators/skip.operator.js.map +1 -0
  438. package/dist/http-testing/operators/step.operator.d.ts +5 -0
  439. package/dist/http-testing/operators/step.operator.d.ts.map +1 -0
  440. package/dist/http-testing/operators/step.operator.js +20 -0
  441. package/dist/http-testing/operators/step.operator.js.map +1 -0
  442. package/dist/http-testing/operators/utils.d.ts +10 -0
  443. package/dist/http-testing/operators/utils.d.ts.map +1 -0
  444. package/dist/http-testing/operators/utils.js +17 -0
  445. package/dist/http-testing/operators/utils.js.map +1 -0
  446. package/dist/http-testing/operators/validate-responses.operator.d.ts +4 -0
  447. package/dist/http-testing/operators/validate-responses.operator.d.ts.map +1 -0
  448. package/dist/http-testing/operators/validate-responses.operator.js +33 -0
  449. package/dist/http-testing/operators/validate-responses.operator.js.map +1 -0
  450. package/dist/http-testing/serialize-parameter.d.ts +6 -0
  451. package/dist/http-testing/serialize-parameter.d.ts.map +1 -0
  452. package/dist/http-testing/serialize-parameter.js +51 -0
  453. package/dist/http-testing/serialize-parameter.js.map +1 -0
  454. package/dist/http-testing/serialize-request.d.ts +7 -0
  455. package/dist/http-testing/serialize-request.d.ts.map +1 -0
  456. package/dist/http-testing/serialize-request.js +112 -0
  457. package/dist/http-testing/serialize-request.js.map +1 -0
  458. package/dist/http-testing/test-builder/builder-pipeline.d.ts +4 -0
  459. package/dist/http-testing/test-builder/builder-pipeline.d.ts.map +1 -0
  460. package/dist/http-testing/test-builder/builder-pipeline.js +2 -0
  461. package/dist/http-testing/test-builder/builder-pipeline.js.map +1 -0
  462. package/dist/http-testing/test-builder/compilers/http-filter-to-transaction-filter.d.ts +9 -0
  463. package/dist/http-testing/test-builder/compilers/http-filter-to-transaction-filter.d.ts.map +1 -0
  464. package/dist/http-testing/test-builder/compilers/http-filter-to-transaction-filter.js +114 -0
  465. package/dist/http-testing/test-builder/compilers/http-filter-to-transaction-filter.js.map +1 -0
  466. package/dist/http-testing/test-builder/compilers/response-scoped-to-response-checker.d.ts +4 -0
  467. package/dist/http-testing/test-builder/compilers/response-scoped-to-response-checker.d.ts.map +1 -0
  468. package/dist/http-testing/test-builder/compilers/response-scoped-to-response-checker.js +36 -0
  469. package/dist/http-testing/test-builder/compilers/response-scoped-to-response-checker.js.map +1 -0
  470. package/dist/http-testing/test-builder/compilers/response-scoped-to-transaction-validator.d.ts +4 -0
  471. package/dist/http-testing/test-builder/compilers/response-scoped-to-transaction-validator.d.ts.map +1 -0
  472. package/dist/http-testing/test-builder/compilers/response-scoped-to-transaction-validator.js +65 -0
  473. package/dist/http-testing/test-builder/compilers/response-scoped-to-transaction-validator.js.map +1 -0
  474. package/dist/http-testing/test-builder/extract-value-from-response.d.ts +4 -0
  475. package/dist/http-testing/test-builder/extract-value-from-response.d.ts.map +1 -0
  476. package/dist/http-testing/test-builder/extract-value-from-response.js +16 -0
  477. package/dist/http-testing/test-builder/extract-value-from-response.js.map +1 -0
  478. package/dist/http-testing/test-builder/override-request-template.d.ts +4 -0
  479. package/dist/http-testing/test-builder/override-request-template.d.ts.map +1 -0
  480. package/dist/http-testing/test-builder/override-request-template.js +33 -0
  481. package/dist/http-testing/test-builder/override-request-template.js.map +1 -0
  482. package/dist/http-testing/test-builder/reply-step-builder.d.ts +10 -0
  483. package/dist/http-testing/test-builder/reply-step-builder.d.ts.map +1 -0
  484. package/dist/http-testing/test-builder/reply-step-builder.js +39 -0
  485. package/dist/http-testing/test-builder/reply-step-builder.js.map +1 -0
  486. package/dist/http-testing/test-builder/single-step-test-builder.d.ts +42 -0
  487. package/dist/http-testing/test-builder/single-step-test-builder.d.ts.map +1 -0
  488. package/dist/http-testing/test-builder/single-step-test-builder.js +112 -0
  489. package/dist/http-testing/test-builder/single-step-test-builder.js.map +1 -0
  490. package/dist/http-testing/validate/ajv.d.ts +3 -0
  491. package/dist/http-testing/validate/ajv.d.ts.map +1 -0
  492. package/dist/http-testing/validate/ajv.js +7 -0
  493. package/dist/http-testing/validate/ajv.js.map +1 -0
  494. package/dist/http-testing/validate/index.d.ts +9 -0
  495. package/dist/http-testing/validate/index.d.ts.map +1 -0
  496. package/dist/http-testing/validate/index.js +9 -0
  497. package/dist/http-testing/validate/index.js.map +1 -0
  498. package/dist/http-testing/validate/validate-body.d.ts +5 -0
  499. package/dist/http-testing/validate/validate-body.d.ts.map +1 -0
  500. package/dist/http-testing/validate/validate-body.js +62 -0
  501. package/dist/http-testing/validate/validate-body.js.map +1 -0
  502. package/dist/http-testing/validate/validate-headers.d.ts +8 -0
  503. package/dist/http-testing/validate/validate-headers.d.ts.map +1 -0
  504. package/dist/http-testing/validate/validate-headers.js +101 -0
  505. package/dist/http-testing/validate/validate-headers.js.map +1 -0
  506. package/dist/http-testing/validate/validate-request-body.d.ts +5 -0
  507. package/dist/http-testing/validate/validate-request-body.d.ts.map +1 -0
  508. package/dist/http-testing/validate/validate-request-body.js +71 -0
  509. package/dist/http-testing/validate/validate-request-body.js.map +1 -0
  510. package/dist/http-testing/validate/validate-request-headers.d.ts +8 -0
  511. package/dist/http-testing/validate/validate-request-headers.d.ts.map +1 -0
  512. package/dist/http-testing/validate/validate-request-headers.js +93 -0
  513. package/dist/http-testing/validate/validate-request-headers.js.map +1 -0
  514. package/dist/http-testing/validate/validate-request-path-parameters.d.ts +6 -0
  515. package/dist/http-testing/validate/validate-request-path-parameters.d.ts.map +1 -0
  516. package/dist/http-testing/validate/validate-request-path-parameters.js +69 -0
  517. package/dist/http-testing/validate/validate-request-path-parameters.js.map +1 -0
  518. package/dist/http-testing/validate/validate-request-query-parameters.d.ts +7 -0
  519. package/dist/http-testing/validate/validate-request-query-parameters.d.ts.map +1 -0
  520. package/dist/http-testing/validate/validate-request-query-parameters.js +91 -0
  521. package/dist/http-testing/validate/validate-request-query-parameters.js.map +1 -0
  522. package/dist/http-testing/validate/validate-response.d.ts +7 -0
  523. package/dist/http-testing/validate/validate-response.d.ts.map +1 -0
  524. package/dist/http-testing/validate/validate-response.js +15 -0
  525. package/dist/http-testing/validate/validate-response.js.map +1 -0
  526. package/dist/http-testing/validate/validate-status-code.d.ts +3 -0
  527. package/dist/http-testing/validate/validate-status-code.d.ts.map +1 -0
  528. package/dist/http-testing/validate/validate-status-code.js +25 -0
  529. package/dist/http-testing/validate/validate-status-code.js.map +1 -0
  530. package/dist/http.d.ts +29 -0
  531. package/dist/http.d.ts.map +1 -0
  532. package/dist/http.js +2 -0
  533. package/dist/http.js.map +1 -0
  534. package/dist/index.d.ts +25 -0
  535. package/dist/index.d.ts.map +1 -0
  536. package/dist/index.js +25 -0
  537. package/dist/index.js.map +1 -0
  538. package/dist/logger/log-level.d.ts +5 -0
  539. package/dist/logger/log-level.d.ts.map +1 -0
  540. package/dist/logger/log-level.js +24 -0
  541. package/dist/logger/log-level.js.map +1 -0
  542. package/dist/logger/logger.d.ts +13 -0
  543. package/dist/logger/logger.d.ts.map +1 -0
  544. package/dist/logger/logger.js +2 -0
  545. package/dist/logger/logger.js.map +1 -0
  546. package/dist/logger/noop.logger.d.ts +15 -0
  547. package/dist/logger/noop.logger.d.ts.map +1 -0
  548. package/dist/logger/noop.logger.js +18 -0
  549. package/dist/logger/noop.logger.js.map +1 -0
  550. package/dist/logger/text.logger.d.ts +16 -0
  551. package/dist/logger/text.logger.d.ts.map +1 -0
  552. package/dist/logger/text.logger.js +51 -0
  553. package/dist/logger/text.logger.js.map +1 -0
  554. package/dist/report-sorter.d.ts +16 -0
  555. package/dist/report-sorter.d.ts.map +1 -0
  556. package/dist/report-sorter.js +193 -0
  557. package/dist/report-sorter.js.map +1 -0
  558. package/dist/rules/ajv-validate.d.ts +2 -0
  559. package/dist/rules/ajv-validate.d.ts.map +1 -0
  560. package/dist/rules/ajv-validate.js +4 -0
  561. package/dist/rules/ajv-validate.js.map +1 -0
  562. package/dist/rules/captured-trace-to-string.d.ts +3 -0
  563. package/dist/rules/captured-trace-to-string.d.ts.map +1 -0
  564. package/dist/rules/captured-trace-to-string.js +27 -0
  565. package/dist/rules/captured-trace-to-string.js.map +1 -0
  566. package/dist/rules/common-http-converters.d.ts +8 -0
  567. package/dist/rules/common-http-converters.d.ts.map +1 -0
  568. package/dist/rules/common-http-converters.js +58 -0
  569. package/dist/rules/common-http-converters.js.map +1 -0
  570. package/dist/rules/contexts.d.ts +63 -0
  571. package/dist/rules/contexts.d.ts.map +1 -0
  572. package/dist/rules/contexts.js +2 -0
  573. package/dist/rules/contexts.js.map +1 -0
  574. package/dist/rules/index.d.ts +16 -0
  575. package/dist/rules/index.d.ts.map +1 -0
  576. package/dist/rules/index.js +16 -0
  577. package/dist/rules/index.js.map +1 -0
  578. package/dist/rules/rule-builder.d.ts +34 -0
  579. package/dist/rules/rule-builder.d.ts.map +1 -0
  580. package/dist/rules/rule-builder.js +112 -0
  581. package/dist/rules/rule-builder.js.map +1 -0
  582. package/dist/rules/rule-configuration.d.ts +10 -0
  583. package/dist/rules/rule-configuration.d.ts.map +1 -0
  584. package/dist/rules/rule-configuration.js +2 -0
  585. package/dist/rules/rule-configuration.js.map +1 -0
  586. package/dist/rules/rule-filter.d.ts +9 -0
  587. package/dist/rules/rule-filter.d.ts.map +1 -0
  588. package/dist/rules/rule-filter.js +12 -0
  589. package/dist/rules/rule-filter.js.map +1 -0
  590. package/dist/rules/rule-fn.d.ts +7 -0
  591. package/dist/rules/rule-fn.d.ts.map +1 -0
  592. package/dist/rules/rule-fn.js +2 -0
  593. package/dist/rules/rule-fn.js.map +1 -0
  594. package/dist/rules/rule-loader.d.ts +8 -0
  595. package/dist/rules/rule-loader.d.ts.map +1 -0
  596. package/dist/rules/rule-loader.js +124 -0
  597. package/dist/rules/rule-loader.js.map +1 -0
  598. package/dist/rules/rule-meta.d.ts +20 -0
  599. package/dist/rules/rule-meta.d.ts.map +1 -0
  600. package/dist/rules/rule-meta.js +18 -0
  601. package/dist/rules/rule-meta.js.map +1 -0
  602. package/dist/rules/rule-runner.d.ts +30 -0
  603. package/dist/rules/rule-runner.d.ts.map +1 -0
  604. package/dist/rules/rule-runner.js +129 -0
  605. package/dist/rules/rule-runner.js.map +1 -0
  606. package/dist/rules/rule-set.d.ts +9 -0
  607. package/dist/rules/rule-set.d.ts.map +1 -0
  608. package/dist/rules/rule-set.js +2 -0
  609. package/dist/rules/rule-set.js.map +1 -0
  610. package/dist/rules/rule-severity.d.ts +10 -0
  611. package/dist/rules/rule-severity.d.ts.map +1 -0
  612. package/dist/rules/rule-severity.js +12 -0
  613. package/dist/rules/rule-severity.js.map +1 -0
  614. package/dist/rules/rule-violation.d.ts +22 -0
  615. package/dist/rules/rule-violation.d.ts.map +1 -0
  616. package/dist/rules/rule-violation.js +2 -0
  617. package/dist/rules/rule-violation.js.map +1 -0
  618. package/dist/rules/rule.d.ts +10 -0
  619. package/dist/rules/rule.d.ts.map +1 -0
  620. package/dist/rules/rule.js +2 -0
  621. package/dist/rules/rule.js.map +1 -0
  622. package/dist/rules/traffic.d.ts +25 -0
  623. package/dist/rules/traffic.d.ts.map +1 -0
  624. package/dist/rules/traffic.js +2 -0
  625. package/dist/rules/traffic.js.map +1 -0
  626. package/dist/thymian-plugin.d.ts +38 -0
  627. package/dist/thymian-plugin.d.ts.map +1 -0
  628. package/dist/thymian-plugin.js +24 -0
  629. package/dist/thymian-plugin.js.map +1 -0
  630. package/dist/thymian.d.ts +85 -0
  631. package/dist/thymian.d.ts.map +1 -0
  632. package/dist/thymian.error.d.ts +26 -0
  633. package/dist/thymian.error.d.ts.map +1 -0
  634. package/dist/thymian.error.js +34 -0
  635. package/dist/thymian.error.js.map +1 -0
  636. package/dist/thymian.js +322 -0
  637. package/dist/thymian.js.map +1 -0
  638. package/dist/utils.d.ts +40 -0
  639. package/dist/utils.d.ts.map +1 -0
  640. package/dist/utils.js +139 -0
  641. package/dist/utils.js.map +1 -0
  642. package/package.json +64 -0
@@ -0,0 +1,371 @@
1
+ import { randomUUID } from 'node:crypto';
2
+ import deepmerge from '@fastify/deepmerge';
3
+ import chalk from 'chalk';
4
+ import { debounceTime, filter, firstValueFrom, map, merge, race, startWith, Subject, take, takeUntil, timer, toArray, } from 'rxjs';
5
+ import { NoopLogger } from '../logger/noop.logger.js';
6
+ import { isThymianError, ThymianBaseError, } from '../thymian.error.js';
7
+ import { isActionEventWithName, isEventWithName, isResponseOf, } from './utils.js';
8
+ const dm = deepmerge({ all: true });
9
+ export class ThymianEmitter {
10
+ logger;
11
+ static #hasBeenInitialized = false;
12
+ options;
13
+ source;
14
+ #events = new Subject();
15
+ #responses;
16
+ #errors;
17
+ #listeners;
18
+ // TODO: this is a problem
19
+ #completed;
20
+ /**
21
+ * Multiplier for the hard timeout limit relative to the idle debounce time.
22
+ */
23
+ static MAX_WAIT_MULTIPLIER = 5;
24
+ constructor(logger = new NoopLogger(), state = ThymianEmitter.emptyEmitterState(), options = {}) {
25
+ this.logger = logger;
26
+ this.options = {
27
+ timeout: 1000,
28
+ traceEvents: false,
29
+ ...options,
30
+ };
31
+ this.source = state.source;
32
+ this.#responses = state.responses;
33
+ this.#events = state.events;
34
+ this.#errors = state.errors;
35
+ this.#listeners = state.listeners;
36
+ this.#completed = state.completed;
37
+ if (!ThymianEmitter.#hasBeenInitialized) {
38
+ this.#events.subscribe(this.logEvent('event'));
39
+ this.#responses.subscribe(this.logEvent('response event'));
40
+ ThymianEmitter.#hasBeenInitialized = true;
41
+ }
42
+ }
43
+ static emptyEmitterState(source = '') {
44
+ return {
45
+ source,
46
+ events: new Subject(),
47
+ responses: new Subject(),
48
+ errors: new Subject(),
49
+ listeners: new Map(),
50
+ completed: new Set(),
51
+ };
52
+ }
53
+ async shutdown(idleTimeMs = this.options.timeout) {
54
+ await Promise.all([
55
+ this.shutdownSubject(this.#events, idleTimeMs, 'events'),
56
+ this.shutdownSubject(this.#responses, idleTimeMs, 'responses'),
57
+ this.shutdownSubject(this.#errors, idleTimeMs, 'errors'),
58
+ ]);
59
+ }
60
+ async shutdownSubject(subject, waitFor, name = '', timeout = waitFor * ThymianEmitter.MAX_WAIT_MULTIPLIER) {
61
+ return new Promise((resolve) => {
62
+ race([
63
+ subject.pipe(startWith(null), debounceTime(waitFor), take(1), map(() => 'idle')),
64
+ timer(timeout).pipe(map(() => 'timeout')),
65
+ ]).subscribe((reason) => {
66
+ this.logger.debug(`Complete subject${name ? ' ' + name : name} due to ${reason}.`);
67
+ resolve();
68
+ });
69
+ });
70
+ }
71
+ completeSubjects() {
72
+ this.#events.complete();
73
+ this.#responses.complete();
74
+ this.#errors.complete();
75
+ }
76
+ on(name, handler) {
77
+ this.#events
78
+ .pipe(filter(isEventWithName(name)))
79
+ .subscribe(async (event) => {
80
+ try {
81
+ await handler(event.payload);
82
+ }
83
+ catch (e) {
84
+ if (e instanceof ThymianBaseError) {
85
+ this.#errors.next({
86
+ id: randomUUID(),
87
+ error: e,
88
+ name,
89
+ timestamp: Date.now(),
90
+ source: this.source,
91
+ correlationId: event.id,
92
+ });
93
+ }
94
+ else if (isThymianError(e)) {
95
+ const error = new ThymianBaseError(e.message, {
96
+ ...e.options,
97
+ name: e.name,
98
+ });
99
+ this.#errors.next({
100
+ error,
101
+ name,
102
+ timestamp: Date.now(),
103
+ source: this.source,
104
+ correlationId: event.id,
105
+ id: randomUUID(),
106
+ });
107
+ }
108
+ else {
109
+ this.#errors.next({
110
+ error: new ThymianBaseError(`Error while calling event handler for event "${event.name}" from "${event.source}".`, {
111
+ name: 'EventHandlerError',
112
+ ref: 'https://thymian.dev/references/errors/event-handler-error/',
113
+ cause: e,
114
+ }),
115
+ name,
116
+ timestamp: Date.now(),
117
+ source: this.source,
118
+ correlationId: event.id,
119
+ id: randomUUID(),
120
+ });
121
+ }
122
+ }
123
+ });
124
+ }
125
+ emit(name, payload) {
126
+ this.#events.next({
127
+ id: randomUUID(),
128
+ name,
129
+ payload,
130
+ timestamp: Date.now(),
131
+ source: this.source,
132
+ });
133
+ }
134
+ emitError(err, name = '') {
135
+ let error;
136
+ if (err instanceof ThymianBaseError) {
137
+ error = err;
138
+ }
139
+ else if (isThymianError(err)) {
140
+ error = new ThymianBaseError(err.message, {
141
+ ...err.options,
142
+ name: err.name,
143
+ });
144
+ }
145
+ else {
146
+ error = new ThymianBaseError(`Error while emitting error event from "${this.source}".`, {
147
+ cause: err,
148
+ });
149
+ }
150
+ this.#errors.next({
151
+ error,
152
+ id: randomUUID(),
153
+ name: name,
154
+ source: this.source,
155
+ timestamp: Date.now(),
156
+ });
157
+ }
158
+ onAction(name, handler) {
159
+ this.#listeners.set(name, (this.#listeners.get(name) ?? 0) + 1);
160
+ this.#events
161
+ .pipe(filter(isActionEventWithName(name)))
162
+ .subscribe(async (event) => {
163
+ const ctx = this.createActionContext(name, event.id);
164
+ try {
165
+ await handler(event.payload, ctx);
166
+ }
167
+ catch (e) {
168
+ if (e instanceof ThymianBaseError) {
169
+ this.#errors.next({
170
+ correlationId: event.id,
171
+ id: randomUUID(),
172
+ error: e,
173
+ name,
174
+ timestamp: Date.now(),
175
+ source: this.source,
176
+ });
177
+ }
178
+ else if (isThymianError(e)) {
179
+ const error = new ThymianBaseError(e.message, {
180
+ ...e.options,
181
+ name: e.name,
182
+ });
183
+ this.#errors.next({
184
+ error,
185
+ name,
186
+ correlationId: event.id,
187
+ timestamp: Date.now(),
188
+ source: this.source,
189
+ id: randomUUID(),
190
+ });
191
+ }
192
+ else {
193
+ this.#errors.next({
194
+ error: new ThymianBaseError(`Error while calling action handler for action "${event.name}" from "${event.source}".`, {
195
+ name: 'ActionHandlerError',
196
+ ref: 'https://thymian.dev/references/errors/action-handler-error/',
197
+ cause: e,
198
+ }),
199
+ name,
200
+ correlationId: event.id,
201
+ id: randomUUID(),
202
+ timestamp: Date.now(),
203
+ source: this.source,
204
+ });
205
+ }
206
+ }
207
+ });
208
+ }
209
+ async emitAction(...args) {
210
+ const [name, payload, options] = args;
211
+ const opts = {
212
+ timeout: this.options.timeout,
213
+ strategy: 'collect',
214
+ strict: true,
215
+ ...(options ?? {}),
216
+ };
217
+ if (!this.#listeners.has(name) && !name.startsWith('core.')) {
218
+ if (opts.strict) {
219
+ this.emitError(new ThymianBaseError(`No listener for action "${name}" registered.`, {
220
+ suggestions: [
221
+ 'Did you forget to call register handler via "onAction" for it?',
222
+ ],
223
+ name: 'NoHandlerRegisteredError',
224
+ }));
225
+ }
226
+ return undefined;
227
+ }
228
+ const start = performance.now();
229
+ const event = {
230
+ id: randomUUID(),
231
+ name,
232
+ payload,
233
+ timestamp: Date.now(),
234
+ source: this.source,
235
+ };
236
+ const numOfListeners = this.#listeners.get(name) ?? 0;
237
+ const takeNum = opts.strategy === 'first' ? 1 : numOfListeners;
238
+ const responsesAndErrors = merge(this.#responses.pipe(filter(isResponseOf(name, event.id))),
239
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
240
+ // @ts-expect-error
241
+ this.#errors.pipe(filter(isResponseOf(name, event.id)))).pipe(takeUntil(timer(opts.timeout)), take(takeNum), toArray());
242
+ const resultsPromise = firstValueFrom(responsesAndErrors);
243
+ // Yield execution to the event loop.
244
+ // This forces the event emission into the next microtask, ensuring that:
245
+ // 1. The 'resultsPromise' subscription is fully active.
246
+ // 2. The event emission does not run synchronously within the current stack frame.
247
+ await Promise.resolve();
248
+ this.#events.next(event);
249
+ const results = (await resultsPromise);
250
+ if (results.length === 0) {
251
+ this.logger.debug(`No response event received for action "${name}" within ${opts.timeout}ms.`);
252
+ }
253
+ const errors = results.filter((r) => Object.hasOwn(r, 'error'));
254
+ if (errors.length > 0 && typeof errors[0] !== 'undefined') {
255
+ this.logger.debug(`Received ${errors.length} error event${errors.length > 1 ? 's' : ''} from ${errors
256
+ .map((err) => `"${err.source}"`)
257
+ .join(', ')} while waiting for response event(s) for event "${name}".`);
258
+ const { error } = errors[0];
259
+ if (error instanceof ThymianBaseError) {
260
+ throw error;
261
+ }
262
+ else {
263
+ throw new ThymianBaseError(error.message, error.options);
264
+ }
265
+ }
266
+ if (opts.strategy !== 'first' && results.length !== numOfListeners) {
267
+ this.logger.warn(`Expected ${numOfListeners} response events for event "${name}" but got ${results.length}.`);
268
+ }
269
+ const payloads = results.map((msg) => msg.payload);
270
+ this.#completed.add(event.id);
271
+ const duration = performance.now() - start;
272
+ if (duration > opts.timeout) {
273
+ this.logger.warn(`Action "${name}" took ${duration}ms but timeout was set to ${opts.timeout}. Increase the timeout to avoid this warning.`);
274
+ }
275
+ this.logger.debug(`Action "${name}" was emitted and processed in ${performance.now() - start}ms.`);
276
+ switch (opts.strategy) {
277
+ case 'first':
278
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
279
+ // @ts-expect-error
280
+ return payloads[0];
281
+ case 'collect':
282
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
283
+ // @ts-expect-error
284
+ return payloads;
285
+ case 'deep-merge':
286
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
287
+ // @ts-expect-error
288
+ return dm(...payloads);
289
+ }
290
+ }
291
+ child(source) {
292
+ return new ThymianEmitter(this.logger.child(source), {
293
+ completed: this.#completed,
294
+ errors: this.#errors,
295
+ events: this.#events,
296
+ listeners: this.#listeners,
297
+ responses: this.#responses,
298
+ source,
299
+ }, {
300
+ ...this.options,
301
+ // we only have to listen to all events once
302
+ traceEvents: false,
303
+ });
304
+ }
305
+ createActionContext(name, correlationId) {
306
+ return {
307
+ error: (error) => {
308
+ if (error instanceof ThymianBaseError) {
309
+ this.#errors.next({
310
+ correlationId,
311
+ id: randomUUID(),
312
+ error: error,
313
+ name,
314
+ timestamp: Date.now(),
315
+ source: this.source,
316
+ });
317
+ }
318
+ else if (isThymianError(error)) {
319
+ const thymianError = new ThymianBaseError(error.message, {
320
+ ...error.options,
321
+ name: error.name,
322
+ });
323
+ this.#errors.next({
324
+ error: thymianError,
325
+ name,
326
+ correlationId,
327
+ id: randomUUID(),
328
+ timestamp: Date.now(),
329
+ source: this.source,
330
+ });
331
+ }
332
+ else {
333
+ this.#errors.next({
334
+ error: new ThymianBaseError(`Error while calling action handler for action "${name}".`, {
335
+ name: 'ActionHandlerError',
336
+ ref: 'https://thymian.dev/references/errors/action-handler-error/',
337
+ cause: error,
338
+ }),
339
+ name,
340
+ correlationId,
341
+ id: randomUUID(),
342
+ timestamp: Date.now(),
343
+ source: this.source,
344
+ });
345
+ }
346
+ },
347
+ reply: (payload) => {
348
+ this.#responses.next({
349
+ correlationId,
350
+ name,
351
+ payload,
352
+ timestamp: Date.now(),
353
+ source: this.source,
354
+ id: randomUUID(),
355
+ });
356
+ },
357
+ };
358
+ }
359
+ onError(fn) {
360
+ this.#errors.subscribe(fn);
361
+ }
362
+ logEvent(type) {
363
+ return (event) => {
364
+ this.logger.trace(`${chalk.bold(event.source)} with ${type} ${chalk.bold(event.name)} at ${new Date(event.timestamp)
365
+ .toISOString()
366
+ .replace('T', ' ')
367
+ .replace('Z', '')}`);
368
+ };
369
+ }
370
+ }
371
+ //# sourceMappingURL=thymian-emitter.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"thymian-emitter.js","sourceRoot":"","sources":["../../src/emitter/thymian-emitter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAEzC,OAAO,SAAS,MAAM,oBAAoB,CAAC;AAC3C,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EACL,YAAY,EACZ,MAAM,EACN,cAAc,EACd,GAAG,EACH,KAAK,EACL,IAAI,EACJ,SAAS,EACT,OAAO,EACP,IAAI,EACJ,SAAS,EACT,KAAK,EACL,OAAO,GACR,MAAM,MAAM,CAAC;AAKd,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AACtD,OAAO,EACL,cAAc,EACd,gBAAgB,GAEjB,MAAM,qBAAqB,CAAC;AAS7B,OAAO,EACL,qBAAqB,EACrB,eAAe,EACf,YAAY,GACb,MAAM,YAAY,CAAC;AAEpB,MAAM,EAAE,GAAG,SAAS,CAAC,EAAE,GAAG,EAAE,IAAI,EAAE,CAAC,CAAC;AAwDpC,MAAM,OAAO,cAAc;IA0BN;IAzBnB,MAAM,CAAC,mBAAmB,GAAG,KAAK,CAAC;IAElB,OAAO,CAAwB;IAEvC,MAAM,CAAS;IAEf,OAAO,GAAG,IAAI,OAAO,EAE3B,CAAC;IAEK,UAAU,CAAmD;IAE7D,OAAO,CAAwC;IAE/C,U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,CAAC,CAAC;gBACL,CAAC;YACH,CAAC;YACD,KAAK,EAAE,CAAC,OAAO,EAAE,EAAE;gBACjB,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC;oBACnB,aAAa;oBACb,IAAI;oBACJ,OAAO;oBACP,SAAS,EAAE,IAAI,CAAC,GAAG,EAAE;oBACrB,MAAM,EAAE,IAAI,CAAC,MAAM;oBACnB,EAAE,EAAE,UAAU,EAAE;iBACjB,CAAC,CAAC;YACL,CAAC;SACF,CAAC;IACJ,CAAC;IAED,OAAO,CAAC,EAAiD;QACvD,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,EAAE,CAAC,CAAC;IAC7B,CAAC;IAEO,QAAQ,CAAC,IAAgC;QAC/C,OAAO,CACL,KAIgC,EAChC,EAAE;YACF,IAAI,CAAC,MAAM,CAAC,KAAK,CACf,GAAG,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,SAAS,IAAI,IAAI,KAAK,CAAC,IAAI,CACpD,KAAK,CAAC,IAAI,CACX,OAAO,IAAI,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC;iBAC9B,WAAW,EAAE;iBACb,OAAO,CAAC,GAAG,EAAE,GAAG,CAAC;iBACjB,OAAO,CAAC,GAAG,EAAE,EAAE,CAAC,EAAE,CACtB,CAAC;QACJ,CAAC,CAAC;IACJ,CAAC"}
@@ -0,0 +1,8 @@
1
+ import type { ThymianActionName } from '../actions/index.js';
2
+ import type { ThymianEventName } from '../events/index.js';
3
+ import type { ThymianActionEvent, ThymianResponseEvent } from './action-event.js';
4
+ import type { ThymianEvent } from './events.js';
5
+ export declare function isEventWithName<Name extends ThymianEventName>(name: Name): (event: ThymianEvent<ThymianEventName> | ThymianActionEvent<ThymianActionName>) => event is ThymianEvent<Name>;
6
+ export declare function isActionEventWithName<Name extends ThymianActionName>(name: Name): (event: ThymianEvent<ThymianEventName> | ThymianActionEvent<ThymianActionName>) => event is ThymianActionEvent<Name>;
7
+ export declare function isResponseOf<Name extends ThymianActionName>(name: Name, cid: string): (event: ThymianResponseEvent<ThymianActionName>) => event is ThymianResponseEvent<Name>;
8
+ //# sourceMappingURL=utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/emitter/utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAC7D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAC3D,OAAO,KAAK,EACV,kBAAkB,EAClB,oBAAoB,EACrB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAEhD,wBAAgB,eAAe,CAAC,IAAI,SAAS,gBAAgB,EAC3D,IAAI,EAAE,IAAI,GACT,CACD,KAAK,EAAE,YAAY,CAAC,gBAAgB,CAAC,GAAG,kBAAkB,CAAC,iBAAiB,CAAC,KAC1E,KAAK,IAAI,YAAY,CAAC,IAAI,CAAC,CAQ/B;AAED,wBAAgB,qBAAqB,CAAC,IAAI,SAAS,iBAAiB,EAClE,IAAI,EAAE,IAAI,GACT,CACD,KAAK,EAAE,YAAY,CAAC,gBAAgB,CAAC,GAAG,kBAAkB,CAAC,iBAAiB,CAAC,KAC1E,KAAK,IAAI,kBAAkB,CAAC,IAAI,CAAC,CAQrC;AAED,wBAAgB,YAAY,CAAC,IAAI,SAAS,iBAAiB,EACzD,IAAI,EAAE,IAAI,EACV,GAAG,EAAE,MAAM,GACV,CACD,KAAK,EAAE,oBAAoB,CAAC,iBAAiB,CAAC,KAC3C,KAAK,IAAI,oBAAoB,CAAC,IAAI,CAAC,CAMvC"}
@@ -0,0 +1,16 @@
1
+ export function isEventWithName(name) {
2
+ return function (event) {
3
+ return event.name === name; // && !Object.hasOwn(event, 'correlationId'); TODO: is the correlationId needed?
4
+ };
5
+ }
6
+ export function isActionEventWithName(name) {
7
+ return function (event) {
8
+ return event.name === name;
9
+ };
10
+ }
11
+ export function isResponseOf(name, cid) {
12
+ return function (event) {
13
+ return event.name === name && event.correlationId === cid;
14
+ };
15
+ }
16
+ //# sourceMappingURL=utils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../src/emitter/utils.ts"],"names":[],"mappings":"AAQA,MAAM,UAAU,eAAe,CAC7B,IAAU;IAIV,OAAO,UACL,KAEyC;QAEzC,OAAO,KAAK,CAAC,IAAI,KAAK,IAAI,CAAC,CAAC,gFAAgF;IAC9G,CAAC,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,qBAAqB,CACnC,IAAU;IAIV,OAAO,UACL,KAEyC;QAEzC,OAAO,KAAK,CAAC,IAAI,KAAK,IAAI,CAAC;IAC7B,CAAC,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,YAAY,CAC1B,IAAU,EACV,GAAW;IAIX,OAAO,UACL,KAA8C;QAE9C,OAAO,KAAK,CAAC,IAAI,KAAK,IAAI,IAAI,KAAK,CAAC,aAAa,KAAK,GAAG,CAAC;IAC5D,CAAC,CAAC;AACJ,CAAC"}
@@ -0,0 +1,5 @@
1
+ import type { JSONSchemaType } from 'ajv/dist/2020.js';
2
+ import type { ThymianBaseError } from '../thymian.error.js';
3
+ export type ErrorEvent = ThymianBaseError;
4
+ export declare const errorEventSchema: JSONSchemaType<ThymianBaseError>;
5
+ //# sourceMappingURL=error.event.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"error.event.d.ts","sourceRoot":"","sources":["../../src/events/error.event.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAEvD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAE5D,MAAM,MAAM,UAAU,GAAG,gBAAgB,CAAC;AAE1C,eAAO,MAAM,gBAAgB,EAAE,cAAc,CAAC,gBAAgB,CA+C7D,CAAC"}
@@ -0,0 +1,49 @@
1
+ export const errorEventSchema = {
2
+ // TODO
3
+ anyOf: [],
4
+ oneOf: [],
5
+ type: 'object',
6
+ required: ['name', 'message', 'exitCode', 'options'],
7
+ properties: {
8
+ exitCode: { type: 'number' },
9
+ message: { type: 'string', nullable: false },
10
+ causingError: { type: 'object', required: [], nullable: true },
11
+ stack: { type: 'string', nullable: true },
12
+ name: { type: 'string', nullable: false },
13
+ cause: { type: 'object', nullable: true },
14
+ options: {
15
+ nullable: false,
16
+ type: 'object',
17
+ properties: {
18
+ exitCode: {
19
+ type: 'number',
20
+ nullable: true,
21
+ },
22
+ suggestions: {
23
+ type: 'array',
24
+ items: { type: 'string' },
25
+ nullable: true,
26
+ },
27
+ ref: {
28
+ type: 'string',
29
+ nullable: true,
30
+ },
31
+ code: {
32
+ type: 'string',
33
+ nullable: true,
34
+ },
35
+ name: {
36
+ type: 'string',
37
+ nullable: true,
38
+ },
39
+ severity: {
40
+ type: 'string',
41
+ enum: ['info', 'warn', 'error'],
42
+ nullable: false,
43
+ },
44
+ },
45
+ required: ['severity'],
46
+ },
47
+ },
48
+ };
49
+ //# sourceMappingURL=error.event.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"error.event.js","sourceRoot":"","sources":["../../src/events/error.event.ts"],"names":[],"mappings":"AAMA,MAAM,CAAC,MAAM,gBAAgB,GAAqC;IAChE,OAAO;IACP,KAAK,EAAE,EAAE;IACT,KAAK,EAAE,EAAE;IACT,IAAI,EAAE,QAAQ;IACd,QAAQ,EAAE,CAAC,MAAM,EAAE,SAAS,EAAE,UAAU,EAAE,SAAS,CAAC;IACpD,UAAU,EAAE;QACV,QAAQ,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;QAC5B,OAAO,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,KAAK,EAAE;QAC5C,YAAY,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE;QAC9D,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE;QACzC,IAAI,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,KAAK,EAAE;QACzC,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE;QACzC,OAAO,EAAE;YACP,QAAQ,EAAE,KAAK;YACf,IAAI,EAAE,QAAQ;YACd,UAAU,EAAE;gBACV,QAAQ,EAAE;oBACR,IAAI,EAAE,QAAQ;oBACd,QAAQ,EAAE,IAAI;iBACf;gBACD,WAAW,EAAE;oBACX,IAAI,EAAE,OAAO;oBACb,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;oBACzB,QAAQ,EAAE,IAAI;iBACf;gBACD,GAAG,EAAE;oBACH,IAAI,EAAE,QAAQ;oBACd,QAAQ,EAAE,IAAI;iBACf;gBACD,IAAI,EAAE;oBACJ,IAAI,EAAE,QAAQ;oBACd,QAAQ,EAAE,IAAI;iBACf;gBACD,IAAI,EAAE;oBACJ,IAAI,EAAE,QAAQ;oBACd,QAAQ,EAAE,IAAI;iBACf;gBACD,QAAQ,EAAE;oBACR,IAAI,EAAE,QAAQ;oBACd,IAAI,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC;oBAC/B,QAAQ,EAAE,KAAK;iBAChB;aACF;YACD,QAAQ,EAAE,CAAC,UAAU,CAAC;SACvB;KACF;CACF,CAAC"}
@@ -0,0 +1,14 @@
1
+ export type ExitEvent = {
2
+ code?: number;
3
+ };
4
+ export declare const ExitEventSchema: {
5
+ readonly type: "object";
6
+ readonly required: readonly ["code"];
7
+ readonly properties: {
8
+ readonly code: {
9
+ readonly type: "integer";
10
+ };
11
+ };
12
+ readonly additionalProperties: false;
13
+ };
14
+ //# sourceMappingURL=exit.event.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"exit.event.d.ts","sourceRoot":"","sources":["../../src/events/exit.event.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,SAAS,GAAG;IACtB,IAAI,CAAC,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,eAAO,MAAM,eAAe;;;;;;;;;CAOlB,CAAC"}
@@ -0,0 +1,9 @@
1
+ export const ExitEventSchema = {
2
+ type: 'object',
3
+ required: ['code'],
4
+ properties: {
5
+ code: { type: 'integer' },
6
+ },
7
+ additionalProperties: false,
8
+ };
9
+ //# sourceMappingURL=exit.event.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"exit.event.js","sourceRoot":"","sources":["../../src/events/exit.event.ts"],"names":[],"mappings":"AAIA,MAAM,CAAC,MAAM,eAAe,GAAG;IAC7B,IAAI,EAAE,QAAQ;IACd,QAAQ,EAAE,CAAC,MAAM,CAAC;IAClB,UAAU,EAAE;QACV,IAAI,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE;KAC1B;IACD,oBAAoB,EAAE,KAAK;CACnB,CAAC"}
@@ -0,0 +1,15 @@
1
+ import type { ThymianError } from '../thymian.error.js';
2
+ import type { ExitEvent } from './exit.event.js';
3
+ import type { RegisterPluginEvent } from './register-plugin.event.js';
4
+ import type { ReportEvent } from './report.event.js';
5
+ export interface ThymianEvents {
6
+ 'core.error': ThymianError;
7
+ 'core.register': RegisterPluginEvent;
8
+ 'core.report': ReportEvent;
9
+ 'core.exit': ExitEvent;
10
+ }
11
+ export type ThymianEventName = keyof ThymianEvents;
12
+ export * from './error.event.js';
13
+ export * from './register-plugin.event.js';
14
+ export * from './report.event.js';
15
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/events/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AACjD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AACtE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAErD,MAAM,WAAW,aAAa;IAC5B,YAAY,EAAE,YAAY,CAAC;IAC3B,eAAe,EAAE,mBAAmB,CAAC;IACrC,aAAa,EAAE,WAAW,CAAC;IAC3B,WAAW,EAAE,SAAS,CAAC;CACxB;AAED,MAAM,MAAM,gBAAgB,GAAG,MAAM,aAAa,CAAC;AAEnD,cAAc,kBAAkB,CAAC;AACjC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,mBAAmB,CAAC"}
@@ -0,0 +1,4 @@
1
+ export * from './error.event.js';
2
+ export * from './register-plugin.event.js';
3
+ export * from './report.event.js';
4
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/events/index.ts"],"names":[],"mappings":"AAcA,cAAc,kBAAkB,CAAC;AACjC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,mBAAmB,CAAC"}
@@ -0,0 +1,51 @@
1
+ import type { ThymianPluginEvents } from '../thymian-plugin.js';
2
+ export type RegisterPluginEvent = {
3
+ name: string;
4
+ options: unknown;
5
+ events: ThymianPluginEvents;
6
+ };
7
+ export declare const RegisterPluginEventSchema: {
8
+ readonly type: "object";
9
+ readonly required: readonly ["name", "options", "events", "hooks"];
10
+ readonly properties: {
11
+ readonly name: {
12
+ readonly type: "string";
13
+ };
14
+ readonly options: {};
15
+ readonly events: {
16
+ readonly type: "object";
17
+ readonly properties: {
18
+ readonly emits: {
19
+ readonly type: "object";
20
+ readonly additionalProperties: true;
21
+ };
22
+ readonly listens: {
23
+ readonly type: "array";
24
+ readonly items: {
25
+ readonly type: "string";
26
+ };
27
+ };
28
+ };
29
+ readonly additionalProperties: false;
30
+ };
31
+ readonly hooks: {
32
+ readonly type: "object";
33
+ readonly additionalProperties: {
34
+ readonly type: "object";
35
+ readonly properties: {
36
+ readonly input: {
37
+ readonly type: "object";
38
+ readonly additionalProperties: true;
39
+ };
40
+ readonly output: {
41
+ readonly type: "object";
42
+ readonly additionalProperties: true;
43
+ };
44
+ };
45
+ readonly additionalProperties: false;
46
+ };
47
+ };
48
+ };
49
+ readonly additionalProperties: false;
50
+ };
51
+ //# sourceMappingURL=register-plugin.event.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"register-plugin.event.d.ts","sourceRoot":"","sources":["../../src/events/register-plugin.event.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAEhE,MAAM,MAAM,mBAAmB,GAAG;IAChC,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,OAAO,CAAC;IACjB,MAAM,EAAE,mBAAmB,CAAC;CAC7B,CAAC;AAEF,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA2B5B,CAAC"}
@@ -0,0 +1,29 @@
1
+ export const RegisterPluginEventSchema = {
2
+ type: 'object',
3
+ required: ['name', 'options', 'events', 'hooks'],
4
+ properties: {
5
+ name: { type: 'string' },
6
+ options: {},
7
+ events: {
8
+ type: 'object',
9
+ properties: {
10
+ emits: { type: 'object', additionalProperties: true },
11
+ listens: { type: 'array', items: { type: 'string' } },
12
+ },
13
+ additionalProperties: false,
14
+ },
15
+ hooks: {
16
+ type: 'object',
17
+ additionalProperties: {
18
+ type: 'object',
19
+ properties: {
20
+ input: { type: 'object', additionalProperties: true },
21
+ output: { type: 'object', additionalProperties: true },
22
+ },
23
+ additionalProperties: false,
24
+ },
25
+ },
26
+ },
27
+ additionalProperties: false,
28
+ };
29
+ //# sourceMappingURL=register-plugin.event.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"register-plugin.event.js","sourceRoot":"","sources":["../../src/events/register-plugin.event.ts"],"names":[],"mappings":"AAQA,MAAM,CAAC,MAAM,yBAAyB,GAAG;IACvC,IAAI,EAAE,QAAQ;IACd,QAAQ,EAAE,CAAC,MAAM,EAAE,SAAS,EAAE,QAAQ,EAAE,OAAO,CAAC;IAChD,UAAU,EAAE;QACV,IAAI,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;QACxB,OAAO,EAAE,EAAE;QACX,MAAM,EAAE;YACN,IAAI,EAAE,QAAQ;YACd,UAAU,EAAE;gBACV,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,oBAAoB,EAAE,IAAI,EAAE;gBACrD,OAAO,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE;aACtD;YACD,oBAAoB,EAAE,KAAK;SAC5B;QACD,KAAK,EAAE;YACL,IAAI,EAAE,QAAQ;YACd,oBAAoB,EAAE;gBACpB,IAAI,EAAE,QAAQ;gBACd,UAAU,EAAE;oBACV,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,oBAAoB,EAAE,IAAI,EAAE;oBACrD,MAAM,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,oBAAoB,EAAE,IAAI,EAAE;iBACvD;gBACD,oBAAoB,EAAE,KAAK;aAC5B;SACF;KACF;IACD,oBAAoB,EAAE,KAAK;CACnB,CAAC"}