@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,51 @@
1
+ import { format } from 'node:util';
2
+ import chalk from 'chalk';
3
+ import { shouldLog } from './log-level.js';
4
+ export class TextLogger {
5
+ namespace;
6
+ level;
7
+ constructor(name, level = 'warn') {
8
+ this.namespace = name;
9
+ this.level = level;
10
+ }
11
+ trace(formatter, ...args) {
12
+ if (shouldLog('trace', this.level)) {
13
+ console.error(`${chalk.grey(`TRACE`)} [${this.now()}] [${this.namespace}]: ${format(formatter, ...args)}`);
14
+ }
15
+ }
16
+ warn(formatter, ...args) {
17
+ if (shouldLog('warn', this.level)) {
18
+ console.error(`${chalk.yellow(`WARN`)} [${this.now()}] [${this.namespace}]: ${format(formatter, ...args)}`);
19
+ }
20
+ }
21
+ debug(formatter, ...args) {
22
+ if (shouldLog('debug', this.level)) {
23
+ console.error(`${chalk.blue(`DEBUG`)} [${this.now()}] [${this.namespace}]: ${format(formatter, ...args)}`);
24
+ }
25
+ }
26
+ info(formatter, ...args) {
27
+ if (shouldLog('info', this.level)) {
28
+ console.error(`${chalk.green(`INFO`)} [${this.now()}] [${this.namespace}]: ${format(formatter, ...args)}`);
29
+ }
30
+ }
31
+ error(formatter, ...args) {
32
+ if (shouldLog('error', this.level)) {
33
+ console.error(`${chalk.red(`ERROR`)} [${this.now()}] [${this.namespace}]: ${format(formatter, ...args)}`);
34
+ }
35
+ }
36
+ out(output) {
37
+ if (this.level === 'silent') {
38
+ return;
39
+ }
40
+ if (typeof output !== 'undefined') {
41
+ console.log(output);
42
+ }
43
+ }
44
+ child(name) {
45
+ return new TextLogger(name, this.level);
46
+ }
47
+ now() {
48
+ return new Date().toISOString().replace(/\.\d{3}Z$/, 'Z');
49
+ }
50
+ }
51
+ //# sourceMappingURL=text.logger.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"text.logger.js","sourceRoot":"","sources":["../../src/logger/text.logger.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAEnC,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAG3C,MAAM,OAAO,UAAU;IACZ,SAAS,CAAS;IAClB,KAAK,CAAW;IAEzB,YAAY,IAAY,EAAE,QAAkB,MAAM;QAChD,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC;QACtB,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;IAC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AM,MAAM,CACnE,SAAS,EACT,GAAG,IAAI,CACR,EAAE,CACJ,CAAC;QACJ,CAAC;IACH,CAAC;IACD,KAAK,CAAC,SAAkB,EAAE,GAAG,IAAe;QAC1C,IAAI,SAAS,CAAC,OAAO,EAAE,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC;YACnC,OAAO,CAAC,KAAK,CACX,GAAG,KAAK,CAAC,GAAG,CAAC,OAAO,CAAC,KAAK,IAAI,CAAC,GAAG,EAAE,MAAM,IAAI,CAAC,SAAS,MAAM,MAAM,CAClE,SAAS,EACT,GAAG,IAAI,CACR,EAAE,CACJ,CAAC;QACJ,CAAC;IACH,CAAC;IACD,GAAG,CAAC,MAAe;QACjB,IAAI,IAAI,CAAC,KAAK,KAAK,QAAQ,EAAE,CAAC;YAC5B,OAAO;QACT,CAAC;QAED,IAAI,OAAO,MAAM,KAAK,WAAW,EAAE,CAAC;YAClC,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;QACtB,CAAC;IACH,CAAC;IACD,KAAK,CAAC,IAAY;QAChB,OAAO,IAAI,UAAU,CAAC,IAAI,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC;IAC1C,CAAC;IAEO,GAAG;QACT,OAAO,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC,OAAO,CAAC,WAAW,EAAE,GAAG,CAAC,CAAC;IAC5D,CAAC;CACF"}
@@ -0,0 +1,16 @@
1
+ import type { ThymianReport } from './events/report.event.js';
2
+ /**
3
+ * Supported sort modes for reshaping reports before presentation.
4
+ */
5
+ export type ReportSortMode = 'rule' | 'endpoint' | 'severity';
6
+ /**
7
+ * Reshape reports according to the selected sort mode.
8
+ *
9
+ * - `rule`: Group by rule name, each section heading is the rule name
10
+ * - `endpoint`: Group by endpoint/location heading (closest to natural insertion order)
11
+ * - `severity`: Group by severity level in order error → warn → hint → info
12
+ *
13
+ * When no sort mode is specified or reports are empty, returns the original reports unchanged.
14
+ */
15
+ export declare function sortReports(reports: ThymianReport[], mode: ReportSortMode | undefined): ThymianReport[];
16
+ //# sourceMappingURL=report-sorter.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"report-sorter.d.ts","sourceRoot":"","sources":["../src/report-sorter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,aAAa,EAId,MAAM,0BAA0B,CAAC;AAElC;;GAEG;AACH,MAAM,MAAM,cAAc,GAAG,MAAM,GAAG,UAAU,GAAG,UAAU,CAAC;AAyN9D;;;;;;;;GAQG;AACH,wBAAgB,WAAW,CACzB,OAAO,EAAE,aAAa,EAAE,EACxB,IAAI,EAAE,cAAc,GAAG,SAAS,GAC/B,aAAa,EAAE,CAajB"}
@@ -0,0 +1,193 @@
1
+ /**
2
+ * Severity sort order: error → warn → hint → info.
3
+ */
4
+ const severityOrder = {
5
+ error: 0,
6
+ warn: 1,
7
+ hint: 2,
8
+ info: 3,
9
+ };
10
+ /**
11
+ * Human-friendly labels for severity-grouped section headings.
12
+ * Used by `sortBySeverity` to produce readable headings like "Errors (3)".
13
+ */
14
+ const severityLabel = {
15
+ error: 'Errors',
16
+ warn: 'Warnings',
17
+ hint: 'Hints',
18
+ info: 'Info',
19
+ };
20
+ /**
21
+ * Flatten all items from all reports into a single attributed list.
22
+ */
23
+ function flattenReports(reports) {
24
+ const items = [];
25
+ for (const report of reports) {
26
+ for (const section of report.sections ?? []) {
27
+ for (const item of section.items) {
28
+ items.push({
29
+ item,
30
+ sectionHeading: section.heading,
31
+ source: report.source,
32
+ });
33
+ }
34
+ }
35
+ }
36
+ return items;
37
+ }
38
+ /**
39
+ * Build a combined message from the original reports.
40
+ */
41
+ function combineMessages(reports) {
42
+ const messages = reports.map((r) => r.message).filter(Boolean);
43
+ return messages.join(' ');
44
+ }
45
+ /**
46
+ * Build a combined source from the original reports.
47
+ */
48
+ function combineSources(reports) {
49
+ const sources = [...new Set(reports.map((r) => r.source))];
50
+ return sources.join(', ');
51
+ }
52
+ /**
53
+ * Create a shallow copy of an item with the message replaced by the original
54
+ * section heading (endpoint / location context).
55
+ *
56
+ * When items are regrouped by rule or severity the original section heading
57
+ * that carried the endpoint context (e.g. "GET /users → 200 OK") is no
58
+ * longer visible. Replacing the message with the heading makes the endpoint
59
+ * the primary information shown under each rule / severity group.
60
+ */
61
+ function withEndpointAsMessage(item, sectionHeading) {
62
+ return {
63
+ ...item,
64
+ message: sectionHeading,
65
+ };
66
+ }
67
+ /**
68
+ * Sort by rule name (default): flatten all items, group by `ruleName`,
69
+ * each section heading is the rule name with affected endpoints listed as items.
70
+ */
71
+ function sortByRule(reports) {
72
+ const items = flattenReports(reports);
73
+ const groups = new Map();
74
+ for (const { item, sectionHeading } of items) {
75
+ const key = item.ruleName ?? '(no rule)';
76
+ let group = groups.get(key);
77
+ if (!group) {
78
+ group = { items: [] };
79
+ groups.set(key, group);
80
+ }
81
+ group.items.push(withEndpointAsMessage(item, sectionHeading));
82
+ }
83
+ const sections = [];
84
+ for (const [ruleName, group] of groups) {
85
+ sections.push({
86
+ heading: ruleName,
87
+ items: group.items,
88
+ });
89
+ }
90
+ return [
91
+ {
92
+ source: combineSources(reports),
93
+ message: combineMessages(reports),
94
+ sections,
95
+ },
96
+ ];
97
+ }
98
+ /**
99
+ * Sort by endpoint: group by section heading (location/endpoint).
100
+ * This is closest to the current insertion-order rendering.
101
+ */
102
+ function sortByEndpoint(reports) {
103
+ const items = flattenReports(reports);
104
+ const groups = new Map();
105
+ // Preserve original section locations from the reports
106
+ const sectionLocations = new Map();
107
+ for (const report of reports) {
108
+ for (const section of report.sections ?? []) {
109
+ if (section.location && !sectionLocations.has(section.heading)) {
110
+ sectionLocations.set(section.heading, section.location);
111
+ }
112
+ }
113
+ }
114
+ for (const { item, sectionHeading } of items) {
115
+ let group = groups.get(sectionHeading);
116
+ if (!group) {
117
+ group = { items: [], location: sectionLocations.get(sectionHeading) };
118
+ groups.set(sectionHeading, group);
119
+ }
120
+ group.items.push(item);
121
+ }
122
+ const sections = [];
123
+ for (const [heading, group] of groups) {
124
+ sections.push({
125
+ heading,
126
+ items: group.items,
127
+ location: group.location,
128
+ });
129
+ }
130
+ return [
131
+ {
132
+ source: combineSources(reports),
133
+ message: combineMessages(reports),
134
+ sections,
135
+ },
136
+ ];
137
+ }
138
+ /**
139
+ * Sort by severity: flatten all items, group by severity level
140
+ * in order error → warn → hint → info.
141
+ */
142
+ function sortBySeverity(reports) {
143
+ const items = flattenReports(reports);
144
+ const groups = new Map();
145
+ for (const { item, sectionHeading } of items) {
146
+ let group = groups.get(item.severity);
147
+ if (!group) {
148
+ group = [];
149
+ groups.set(item.severity, group);
150
+ }
151
+ group.push(withEndpointAsMessage(item, sectionHeading));
152
+ }
153
+ // Sort groups by severity order
154
+ const sortedEntries = [...groups.entries()].sort(([a], [b]) => severityOrder[a] - severityOrder[b]);
155
+ const sections = [];
156
+ for (const [severity, groupItems] of sortedEntries) {
157
+ const label = severityLabel[severity];
158
+ sections.push({
159
+ heading: `${label} (${groupItems.length})`,
160
+ items: groupItems,
161
+ });
162
+ }
163
+ return [
164
+ {
165
+ source: combineSources(reports),
166
+ message: combineMessages(reports),
167
+ sections,
168
+ },
169
+ ];
170
+ }
171
+ /**
172
+ * Reshape reports according to the selected sort mode.
173
+ *
174
+ * - `rule`: Group by rule name, each section heading is the rule name
175
+ * - `endpoint`: Group by endpoint/location heading (closest to natural insertion order)
176
+ * - `severity`: Group by severity level in order error → warn → hint → info
177
+ *
178
+ * When no sort mode is specified or reports are empty, returns the original reports unchanged.
179
+ */
180
+ export function sortReports(reports, mode) {
181
+ if (!mode || reports.length === 0) {
182
+ return reports;
183
+ }
184
+ switch (mode) {
185
+ case 'rule':
186
+ return sortByRule(reports);
187
+ case 'endpoint':
188
+ return sortByEndpoint(reports);
189
+ case 'severity':
190
+ return sortBySeverity(reports);
191
+ }
192
+ }
193
+ //# sourceMappingURL=report-sorter.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"report-sorter.js","sourceRoot":"","sources":["../src/report-sorter.ts"],"names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MAAM,EAAE,cAAc,CAAC,OAAO,CAAC;YAC/B,OAAO,EAAE,eAAe,CAAC,OAAO,CAAC;YACjC,QAAQ;SACT;KACF,CAAC;AACJ,CAAC;AAED;;;;;;;;GAQG;AACH,MAAM,UAAU,WAAW,CACzB,OAAwB,EACxB,IAAgC;IAEhC,IAAI,CAAC,IAAI,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAClC,OAAO,OAAO,CAAC;IACjB,CAAC;IAED,QAAQ,IAAI,EAAE,CAAC;QACb,KAAK,MAAM;YACT,OAAO,UAAU,CAAC,OAAO,CAAC,CAAC;QAC7B,KAAK,UAAU;YACb,OAAO,cAAc,CAAC,OAAO,CAAC,CAAC;QACjC,KAAK,UAAU;YACb,OAAO,cAAc,CAAC,OAAO,CAAC,CAAC;IACnC,CAAC;AACH,CAAC"}
@@ -0,0 +1,2 @@
1
+ export { validate } from '../ajv.js';
2
+ //# sourceMappingURL=ajv-validate.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ajv-validate.d.ts","sourceRoot":"","sources":["../../src/rules/ajv-validate.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC"}
@@ -0,0 +1,4 @@
1
+ // Internal re-export of the AJV validate function for use within the rules module.
2
+ // This avoids importing from the subpath export '@thymian/core/ajv' within the same package.
3
+ export { validate } from '../ajv.js';
4
+ //# sourceMappingURL=ajv-validate.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ajv-validate.js","sourceRoot":"","sources":["../../src/rules/ajv-validate.ts"],"names":[],"mappings":"AAAA,mFAAmF;AACnF,6FAA6F;AAC7F,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC"}
@@ -0,0 +1,3 @@
1
+ import type { CapturedTrace } from './traffic.js';
2
+ export declare function capturedTraceToString(trace: CapturedTrace): string;
3
+ //# sourceMappingURL=captured-trace-to-string.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"captured-trace-to-string.d.ts","sourceRoot":"","sources":["../../src/rules/captured-trace-to-string.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,aAAa,EAAuB,MAAM,cAAc,CAAC;AAEvE,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,aAAa,GAAG,MAAM,CAmClE"}
@@ -0,0 +1,27 @@
1
+ import { httpRequestToLabel, httpResponseToLabel, httpTransactionToLabel, } from '../utils.js';
2
+ export function capturedTraceToString(trace) {
3
+ const firstTransaction = trace[0];
4
+ // This check prevents lastTransaction from being equal to firstTransaction when the array has only one element.
5
+ const lastTransaction = trace[trace.length - 1] === trace[0] ? undefined : trace[trace.length - 1];
6
+ // length === 1
7
+ if (!lastTransaction && !!firstTransaction) {
8
+ return httpTransactionToLabel(firstTransaction.request.data, firstTransaction.response.data);
9
+ }
10
+ // Handle empty trace case.
11
+ if (!firstTransaction || !lastTransaction) {
12
+ return '';
13
+ }
14
+ const formatReq = (t) => httpRequestToLabel(t.request.data);
15
+ const formatRes = (t) => httpResponseToLabel(t.response.data);
16
+ if (trace.length === 2) {
17
+ const requests = trace.map(formatReq);
18
+ const responses = trace.map(formatRes).reverse();
19
+ return [...requests, ...responses].join(' -> ');
20
+ }
21
+ const firstReq = formatReq(firstTransaction);
22
+ const lastReq = formatReq(lastTransaction);
23
+ const lastRes = formatRes(lastTransaction);
24
+ const firstRes = formatRes(firstTransaction);
25
+ return `${firstReq} -> ${lastReq} -> ...${trace.length - 2}x more -> ${lastRes} -> ${firstRes}`;
26
+ }
27
+ //# sourceMappingURL=captured-trace-to-string.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"captured-trace-to-string.js","sourceRoot":"","sources":["../../src/rules/captured-trace-to-string.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,kBAAkB,EAClB,mBAAmB,EACnB,sBAAsB,GACvB,MAAM,aAAa,CAAC;AAGrB,MAAM,UAAU,qBAAqB,CAAC,KAAoB;IACxD,MAAM,gBAAgB,G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SAAS,CAAC,eAAe,CAAC,CAAC;IAC3C,MAAM,QAAQ,GAAG,SAAS,CAAC,gBAAgB,CAAC,CAAC;IAC7C,OAAO,GAAG,QAAQ,OAAO,OAAO,UAAU,KAAK,CAAC,MAAM,GAAG,CAAC,aAAa,OAAO,OAAO,QAAQ,EAAE,CAAC;AAClG,CAAC"}
@@ -0,0 +1,8 @@
1
+ import type { ThymianHttpRequest, ThymianHttpResponse } from '../format/index.js';
2
+ import type { HttpRequest, HttpResponse } from '../http.js';
3
+ import type { CommonHttpRequest, CommonHttpResponse } from './contexts.js';
4
+ export declare function thymianToCommonHttpRequest(node: ThymianHttpRequest, _id: string): CommonHttpRequest;
5
+ export declare function thymianToCommonHttpResponse(node: ThymianHttpResponse, _id: string): CommonHttpResponse;
6
+ export declare function httpRequestToCommonHttpRequest(request: HttpRequest, _id?: string): CommonHttpRequest;
7
+ export declare function httpResponseToCommonHttpResponse(response: HttpResponse, _id?: string): CommonHttpResponse;
8
+ //# sourceMappingURL=common-http-converters.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"common-http-converters.d.ts","sourceRoot":"","sources":["../../src/rules/common-http-converters.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,kBAAkB,EAClB,mBAAmB,EACpB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,KAAK,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAE5D,OAAO,KAAK,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AAE3E,wBAAgB,0BAA0B,CACxC,IAAI,EAAE,kBAAkB,EACxB,GAAG,EAAE,MAAM,GACV,iBAAiB,CAanB;AAED,wBAAgB,2BAA2B,CACzC,IAAI,EAAE,mBAAmB,EACzB,GAAG,EAAE,MAAM,GACV,kBAAkB,CAUpB;AAgBD,wBAAgB,8BAA8B,CAC5C,OAAO,EAAE,WAAW,EACpB,GAAG,CAAC,EAAE,MAAM,GACX,iBAAiB,CAenB;AAED,wBAAgB,gCAAgC,CAC9C,QAAQ,EAAE,YAAY,EACtB,GAAG,CAAC,EAAE,MAAM,GACX,kBAAkB,CAUpB"}
@@ -0,0 +1,58 @@
1
+ import { getHeader } from '../utils.js';
2
+ export function thymianToCommonHttpRequest(node, _id) {
3
+ void _id;
4
+ return {
5
+ origin: `${node.protocol}://${node.host}:${node.port}`,
6
+ path: node.path,
7
+ method: node.method,
8
+ headers: Object.keys(node.headers),
9
+ queryParameters: Object.keys(node.queryParameters),
10
+ cookies: Object.keys(node.cookies),
11
+ mediaType: node.mediaType,
12
+ body: node.bodyRequired ?? false,
13
+ };
14
+ }
15
+ export function thymianToCommonHttpResponse(node, _id) {
16
+ void _id;
17
+ return {
18
+ body: !!node.schema,
19
+ headers: Object.keys(node.headers),
20
+ mediaType: node.mediaType,
21
+ statusCode: node.statusCode,
22
+ trailers: [],
23
+ };
24
+ }
25
+ function extractMediaType(req) {
26
+ if (!req.headers) {
27
+ return '';
28
+ }
29
+ const ct = getHeader(req.headers, 'content-type');
30
+ if (Array.isArray(ct)) {
31
+ throw new Error('Content-type is a single valued field.');
32
+ }
33
+ return ct ?? '';
34
+ }
35
+ export function httpRequestToCommonHttpRequest(request, _id) {
36
+ void _id;
37
+ return {
38
+ origin: request.origin,
39
+ path: request.path,
40
+ method: request.method,
41
+ headers: Object.keys(request.headers ?? {}),
42
+ queryParameters: Array.from(new URLSearchParams(request.path.split('?')[1] ?? '').keys()),
43
+ cookies: [],
44
+ mediaType: extractMediaType(request),
45
+ body: !!request.body,
46
+ };
47
+ }
48
+ export function httpResponseToCommonHttpResponse(response, _id) {
49
+ void _id;
50
+ return {
51
+ body: !!response.body,
52
+ headers: Object.keys(response.headers),
53
+ mediaType: getHeader(response.headers, 'content-type')?.at(0) ?? '',
54
+ statusCode: response.statusCode,
55
+ trailers: Object.keys(response.trailers),
56
+ };
57
+ }
58
+ //# sourceMappingURL=common-http-converters.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"common-http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http-request.node.js';
3
+ import type { ThymianHttpResponse } from '../format/nodes/http-response.node.js';
4
+ import type { ThymianFormat } from '../format/thymian-format.js';
5
+ import type { HttpRequest, HttpResponse } from '../http.js';
6
+ import type { HttpFilterExpression } from '../http-filter.js';
7
+ import type { HttpTestResult } from '../http-testing/http-test/http-test.js';
8
+ import type { HttpTestContextLocals } from '../http-testing/http-test/http-test-context.js';
9
+ import type { HttpTestPipeline } from '../http-testing/http-test/http-test-pipeline.js';
10
+ import type { PartialBy } from '../utils.js';
11
+ import type { RuleFnResult, RuleViolation, RuleViolationLocation } from './rule-violation.js';
12
+ import type { CapturedTrace, CapturedTransaction } from './traffic.js';
13
+ export type CommonHttpRequest = {
14
+ origin: string;
15
+ path: string;
16
+ method: string;
17
+ headers: string[];
18
+ queryParameters: string[];
19
+ cookies: string[];
20
+ mediaType: string;
21
+ body: boolean;
22
+ };
23
+ export type CommonHttpResponse = {
24
+ statusCode: number;
25
+ mediaType: string;
26
+ headers: string[];
27
+ body: boolean;
28
+ trailers: string[];
29
+ };
30
+ export type ValidationFn<Args extends unknown[], R = Omit<RuleViolation, 'location' | 'rule' | 'severity'> | boolean | undefined> = (...args: Args) => R;
31
+ export interface ApiContext {
32
+ readonly format: ThymianFormat;
33
+ readonly report: ReportFn;
34
+ reportViolation(violation: RuleViolation): void;
35
+ validateCommonHttpTransactions(filter: HttpFilterExpression, validationFn?: ValidationFn<[
36
+ CommonHttpRequest,
37
+ CommonHttpResponse,
38
+ RuleViolationLocation
39
+ ]> | HttpFilterExpression): Promise<RuleFnResult> | RuleFnResult;
40
+ validateGroupedCommonHttpTransactions(filter: HttpFilterExpression, groupBy: HttpFilterExpression, validationFn: ValidationFn<[
41
+ string,
42
+ [
43
+ CommonHttpRequest,
44
+ CommonHttpResponse,
45
+ RuleViolationLocation
46
+ ][]
47
+ ], RuleViolation | undefined>): Promise<RuleFnResult> | RuleFnResult;
48
+ }
49
+ export interface LiveApiContext extends ApiContext {
50
+ validateHttpTransactions(filter: HttpFilterExpression, validation?: ValidationFn<[HttpRequest, HttpResponse, RuleViolationLocation]> | HttpFilterExpression): Promise<RuleFnResult> | RuleFnResult;
51
+ }
52
+ export interface LintContext extends ApiContext {
53
+ validateHttpTransactions(filterFn: (req: ThymianHttpRequest, res: ThymianHttpResponse, responses: ThymianHttpResponse[]) => boolean, validationFn?: (req: ThymianHttpRequest, res: ThymianHttpResponse, responses: ThymianHttpResponse[]) => PartialBy<RuleViolation, 'location'> | boolean): Promise<RuleFnResult> | RuleFnResult;
54
+ }
55
+ export interface TestContext extends LiveApiContext {
56
+ httpTest(pipeline: HttpTestPipeline<HttpTestContextLocals>): Promise<RuleFnResult> | RuleFnResult;
57
+ runHttpTest(pipeline: HttpTestPipeline<HttpTestContextLocals>): Promise<HttpTestResult>;
58
+ }
59
+ export interface AnalyzeContext extends LiveApiContext {
60
+ validateCapturedHttpTransactions(filter: HttpFilterExpression, validate: ValidationFn<[CapturedTransaction, string]>): Promise<RuleFnResult> | RuleFnResult;
61
+ validateCapturedHttpTraces(validate: ValidationFn<[CapturedTrace, string]>): Promise<RuleFnResult> | RuleFnResult;
62
+ }
63
+ //# sourceMappingURL=contexts.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"contexts.d.ts","sourceRoot":"","sources":["../../src/rules/contexts.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AAC1D,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,sCAAsC,CAAC;AAC/E,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,uCAAuC,CAAC;AACjF,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AACjE,OAAO,KAAK,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAC5D,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AAC9D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,wCA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,EAAE,gBAAgB,CAAC,qBAAqB,CAAC,GAChD,OAAO,CAAC,cAAc,CAAC,CAAC;CAC5B;AAED,MAAM,WAAW,cAAe,SAAQ,cAAc;IACpD,gCAAgC,CAC9B,MAAM,EAAE,oBAAoB,EAC5B,QAAQ,EAAE,YAAY,CAAC,CAAC,mBAAmB,EAAE,MAAM,CAAC,CAAC,GACpD,OAAO,CAAC,YAAY,CAAC,GAAG,YAAY,CAAC;IACxC,0BAA0B,CACxB,QAAQ,EAAE,YAAY,CAAC,CAAC,aAAa,EAAE,MAAM,CAAC,CAAC,GAC9C,OAAO,CAAC,YAAY,CAAC,GAAG,YAAY,CAAC;CACzC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=contexts.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"contexts.js","sourceRoot":"","sources":["../../src/rules/contexts.ts"],"names":[],"mappings":""}
@@ -0,0 +1,16 @@
1
+ export * from './captured-trace-to-string.js';
2
+ export * from './common-http-converters.js';
3
+ export * from './contexts.js';
4
+ export * from './rule.js';
5
+ export * from './rule-builder.js';
6
+ export * from './rule-configuration.js';
7
+ export * from './rule-filter.js';
8
+ export * from './rule-fn.js';
9
+ export * from './rule-loader.js';
10
+ export * from './rule-meta.js';
11
+ export * from './rule-runner.js';
12
+ export * from './rule-set.js';
13
+ export * from './rule-severity.js';
14
+ export * from './rule-violation.js';
15
+ export * from './traffic.js';
16
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/rules/index.ts"],"names":[],"mappings":"AAAA,cAAc,+BAA+B,CAAC;AAC9C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,eAAe,CAAC;AAC9B,cAAc,WAAW,CAAC;AAC1B,cAAc,mBAAmB,CAAC;AAClC,cAAc,yBAAyB,CAAC;AACxC,cAAc,kBAAkB,CAAC;AACjC,cAAc,cAAc,CAAC;AAC7B,cAAc,kBAAkB,CAAC;AACjC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,kBAAkB,CAAC;AACjC,cAAc,eAAe,CAAC;AAC9B,cAAc,oBAAoB,CAAC;AACnC,cAAc,qBAAqB,CAAC;AACpC,cAAc,cAAc,CAAC"}
@@ -0,0 +1,16 @@
1
+ export * from './captured-trace-to-string.js';
2
+ export * from './common-http-converters.js';
3
+ export * from './contexts.js';
4
+ export * from './rule.js';
5
+ export * from './rule-builder.js';
6
+ export * from './rule-configuration.js';
7
+ export * from './rule-filter.js';
8
+ export * from './rule-fn.js';
9
+ export * from './rule-loader.js';
10
+ export * from './rule-meta.js';
11
+ export * from './rule-runner.js';
12
+ export * from './rule-set.js';
13
+ export * from './rule-severity.js';
14
+ export * from './rule-violation.js';
15
+ export * from './traffic.js';
16
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/rules/index.ts"],"names":[],"mappings":"AAAA,cAAc,+BAA+B,CAAC;AAC9C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,eAAe,CAAC;AAC9B,cAAc,WAAW,CAAC;AAC1B,cAAc,mBAAmB,CAAC;AAClC,cAAc,yBAAyB,CAAC;AACxC,cAAc,kBAAkB,CAAC;AACjC,cAAc,cAAc,CAAC;AAC7B,cAAc,kBAAkB,CAAC;AACjC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,kBAAkB,CAAC;AACjC,cAAc,eAAe,CAAC;AAC9B,cAAc,oBAAoB,CAAC;AACnC,cAAc,qBAAqB,CAAC;AACpC,cAAc,cAAc,CAAC"}
@@ -0,0 +1,34 @@
1
+ import type { JSONSchemaType } from 'ajv';
2
+ import type { AnalyzeContext, ApiContext, LintContext, LiveApiContext, TestContext } from './contexts.js';
3
+ import type { Rule } from './rule.js';
4
+ import type { RuleFn } from './rule-fn.js';
5
+ import type { HttpParticipantRole, RuleType } from './rule-meta.js';
6
+ import { type RuleSeverity } from './rule-severity.js';
7
+ type ApiContextType<RuleTypes extends [RuleType, ...RuleType[]]> = RuleTypes[number] extends 'static' ? LintContext : RuleTypes[number] extends 'analytics' ? AnalyzeContext : RuleTypes[number] extends 'test' ? TestContext : RuleTypes[number] extends 'analytics' | 'test' ? LiveApiContext : ApiContext;
8
+ interface DefineRuleSeverity {
9
+ severity(severity: RuleSeverity): DefineRuleType;
10
+ }
11
+ interface DefineRuleType {
12
+ type<Types extends [RuleType, ...RuleType[]]>(...types: Types): DefineOptionalRuleMetaProperties<Types>;
13
+ }
14
+ interface Done<Options extends Record<PropertyKey, unknown>> {
15
+ done(): Rule<Options>;
16
+ }
17
+ interface DefineRules<RuleTypes extends [RuleType, ...RuleType[]], Options extends Record<PropertyKey, unknown>> extends Done<Options> {
18
+ rule(fn: RuleTypes extends ['informational'] ? never : RuleFn<ApiContextType<RuleTypes>, Options>): DefineRules<RuleTypes, Options>;
19
+ overrideAnalyticsRule(ffn: RuleTypes extends ['informational'] ? never : RuleFn<AnalyzeContext, Options>): DefineRules<RuleTypes, Options>;
20
+ overrideStaticRule(fn: RuleTypes extends ['informational'] ? never : RuleFn<LintContext, Options>): DefineRules<RuleTypes, Options>;
21
+ overrideTest(fn: RuleTypes extends ['informational'] ? never : RuleFn<TestContext, Options>): DefineRules<RuleTypes, Options>;
22
+ }
23
+ interface DefineOptionalRuleMetaProperties<RuleTypes extends [RuleType, ...RuleType[]], Options extends Record<PropertyKey, unknown> = Record<PropertyKey, unknown>> extends DefineRules<RuleTypes, Options> {
24
+ appliesTo(...participants: [HttpParticipantRole, ...HttpParticipantRole[]]): this;
25
+ description(description: string): DefineOptionalRuleMetaProperties<RuleTypes, Options>;
26
+ summary(summary: string): DefineOptionalRuleMetaProperties<RuleTypes, Options>;
27
+ url(url: string): this;
28
+ tags(...tags: string[]): DefineOptionalRuleMetaProperties<RuleTypes, Options>;
29
+ explanation(explanation: string): DefineOptionalRuleMetaProperties<RuleTypes, Options>;
30
+ options<Options extends Record<PropertyKey, unknown>>(schema: JSONSchemaType<Options>): DefineOptionalRuleMetaProperties<RuleTypes, Options>;
31
+ }
32
+ export declare function httpRule(name: string): DefineRuleSeverity;
33
+ export {};
34
+ //# sourceMappingURL=rule-builder.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rule-builder.d.ts","sourceRoot":"","sources":["../../src/rules/rule-builder.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,KAAK,CAAC;AAE1C,OAAO,KAAK,EACV,cAAc,EACd,UAAU,EACV,WAAW,EACX,cAAc,EACd,WAAW,EACZ,MAAM,eAAe,CAAC;AACvB,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACtC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAC3C,OAAO,KAAK,EAAE,mBAAmB,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AACpE,OAAO,EAAuB,KAAK,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAE5E,KAAK,cAAc,CAAC,SAAS,SAAS,CAAC,QAAQ,EAAE,GAAG,QAAQ,EAAE,CAAC,IAC7D,SAAS,CAAC,MAAM,CAAC,SAAS,QAAQ,GAC9B,WAAW,GACX,SAAS,CAAC,MAAM,CAAC,SAAS,WAAW,GACnC,cAAc,GACd,SAAS,CAAC,MAAM,CAAC,SAAS,MAAM,GAC9B,WAAW,GACX,SAAS,CAAC,MAAM,CAAC,SAAS,WAAW,GAAG,MAAM,GAC5C,cAAc,GACd,UAAU,CAAC;AASvB,UAAU,kBAAkB;IAC1B,QAAQ,CAAC,QAAQ,EAAE,YAAY,GAAG,cAAc,CAAC;CAClD;AAED,UAAU,cAAc;IACtB,IAAI,CAAC,KAAK,SAAS,CAAC,QAAQ,EAAE,GAAG,QAAQ,EAAE,CAAC,EAC1C,GAAG,KAAK,EAAE,KAAK,GACd,gCAAgC,CAAC,KAAK,CAAC,CAAC;CAC5C;AAED,UAAU,IAAI,CAAC,OAAO,SAAS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