@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,93 @@
1
+ import { getHeader, objHasKeyIgnoreCase, } from '../../index.js';
2
+ import { ajv } from './ajv.js';
3
+ export const commonRequestHeaders = [
4
+ 'accept',
5
+ 'accept-charset',
6
+ 'accept-encoding',
7
+ 'accept-language',
8
+ 'authorization',
9
+ 'cache-control',
10
+ 'connection',
11
+ 'content-length',
12
+ 'content-type',
13
+ 'cookie',
14
+ 'host',
15
+ 'origin',
16
+ 'referer',
17
+ 'user-agent',
18
+ 'te',
19
+ 'upgrade',
20
+ 'via',
21
+ 'x-forwarded-for',
22
+ 'x-forwarded-host',
23
+ 'x-forwarded-proto',
24
+ 'x-request-id',
25
+ 'x-correlation-id',
26
+ ];
27
+ const commonRequestHeadersSet = new Set(commonRequestHeaders);
28
+ export function checkForMissingRequestHeaders(headers, request) {
29
+ return Object.entries(request.headers).reduce((acc, [name, header]) => {
30
+ const value = getHeader(headers, name);
31
+ if (!value && header.required) {
32
+ acc.push({
33
+ type: 'assertion-failure',
34
+ message: `Header "${name}" is required but not included in the request.`,
35
+ });
36
+ }
37
+ return acc;
38
+ }, []);
39
+ }
40
+ export function checkForAdditionalRequestHeaders(headers, request) {
41
+ const failures = Object.keys(headers)
42
+ .filter((headerName) => !objHasKeyIgnoreCase(request.headers, headerName) &&
43
+ !commonRequestHeadersSet.has(headerName.toLowerCase()))
44
+ .map((headerName) => ({
45
+ type: 'assertion-failure',
46
+ message: `Request contains header "${headerName}" that is not included in the description format.`,
47
+ }));
48
+ return failures.length > 0
49
+ ? failures
50
+ : [
51
+ {
52
+ type: 'assertion-success',
53
+ message: `Request does not contain additional headers that are not included in the description format.`,
54
+ },
55
+ ];
56
+ }
57
+ export function validateExistingRequestHeader(headers, request) {
58
+ return Object.entries(headers)
59
+ .filter(([name]) => Object.hasOwn(request.headers, name))
60
+ .map(([name, value]) => {
61
+ if (request.headers[name]?.schema) {
62
+ const validate = ajv.compile(request.headers[name]?.schema);
63
+ validate(value);
64
+ if (validate.errors) {
65
+ return {
66
+ type: 'assertion-failure',
67
+ message: `Invalid value for request header ${name}: ${validate.errors.map((err) => err.message).join(', ')}.`,
68
+ timestamp: Date.now(),
69
+ };
70
+ }
71
+ else {
72
+ return {
73
+ type: 'assertion-success',
74
+ message: `Valid request header ${name}.`,
75
+ timestamp: Date.now(),
76
+ };
77
+ }
78
+ }
79
+ return {
80
+ type: 'info',
81
+ message: `No schema provided for request header ${name}.`,
82
+ timestamp: Date.now(),
83
+ };
84
+ });
85
+ }
86
+ export function validateRequestHeaders(headers, request) {
87
+ return [
88
+ ...checkForMissingRequestHeaders(headers, request),
89
+ ...checkForAdditionalRequestHeaders(headers, request),
90
+ ...validateExistingRequestHeader(headers, request),
91
+ ];
92
+ }
93
+ //# sourceMappingURL=validate-request-headers.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"validate-request-headers.js","sourceRoot":"","sources":["../../../src/http-testing/validate/validate-request-headers.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EACT,mBAAmB,GAEpB,MAAM,gBAAgB,CAAC;AAExB,OAAO,EAAE,GAAG,EAAE,MAAM,UAAU,CAAC;AAE/B,MAAM,CAAC,MAAM,oBAAoB,GAAG;IAClC,QAAQ;IACR,gBAAgB;IAChB,iBAAiB;IACjB,iBAAiB;IACjB,eAAe;IACf,eAAe;IACf,YAAY;IACZ,gBAAgB;IAChB,cAAc;IACd,QAAQ;IACR,MAAM;IACN,QAAQ;IACR,SAAS;IACT,YAAY;IACZ,IAAI;IACJ,SAAS;IACT,KAAK;IACL,iBAAiB;IACjB,kBAAkB;IAClB,mBAAmB;IACnB,cAAc;IACd,kBAAkB;CACV,CAAC;AAEX,MAAM,uBAAuB,GAAG,IAAI,GAAG,CAAS,oBAAoB,CAAC,CAAC;AAEtE,MAAM,UAAU,6BAA6B,CAC3C,OAAsD,EACtD,OAA2B;IAE3B,OAAO,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,CAAC,IAAI,EAAE,MAAM,CAAC,EAAE,EAAE;QACpE,MAAM,KAAK,GAAG,SAAS,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;QAEvC,IAAI,CAAC,KAAK,IAAI,MAAM,CAAC,QAAQ,EAAE,CAAC;YAC9B,GAAG,CAAC,IAAI,CAAC;gBACP,IAAI,EAAE,mBAAmB;gBACzB,OAAO,EAAE,WA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,CAAC,CAAC;YAEhB,IAAI,QAAQ,CAAC,MAAM,EAAE,CAAC;gBACpB,OAAO;oBACL,IAAI,EAAE,mBAAmB;oBACzB,OAAO,EAAE,oCAAoC,IAAI,KAAK,QAAQ,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG;oBAC7G,SAAS,EAAE,IAAI,CAAC,GAAG,EAAE;iBACtB,CAAC;YACJ,CAAC;iBAAM,CAAC;gBACN,OAAO;oBACL,IAAI,EAAE,mBAAmB;oBACzB,OAAO,EAAE,wBAAwB,IAAI,GAAG;oBACxC,SAAS,EAAE,IAAI,CAAC,GAAG,EAAE;iBACtB,CAAC;YACJ,CAAC;QACH,CAAC;QAED,OAAO;YACL,IAAI,EAAE,MAAM;YACZ,OAAO,EAAE,yCAAyC,IAAI,GAAG;YACzD,SAAS,EAAE,IAAI,CAAC,GAAG,EAAE;SACtB,CAAC;IACJ,CAAC,CAAC,CAAC;AACP,CAAC;AAED,MAAM,UAAU,sBAAsB,CACpC,OAAsD,EACtD,OAA2B;IAE3B,OAAO;QACL,GAAG,6BAA6B,CAAC,OAAO,EAAE,OAAO,CAAC;QAClD,GAAG,gCAAgC,CAAC,OAAO,EAAE,OAAO,CAAC;QACrD,GAAG,6BAA6B,CAAC,OAAO,EAAE,OAAO,CAAC;KACnD,CAAC;AACJ,CAAC"}
@@ -0,0 +1,6 @@
1
+ import type { ThymianHttpRequest } from '../../index.js';
2
+ import type { HttpTestCaseResult } from '../http-test/index.js';
3
+ export declare function checkForMissingPathParameters(pathParams: Record<string, string>, request: ThymianHttpRequest): HttpTestCaseResult[];
4
+ export declare function validateExistingPathParameter(pathParams: Record<string, string>, request: ThymianHttpRequest): HttpTestCaseResult[];
5
+ export declare function validateRequestPathParameters(actualPath: string, request: ThymianHttpRequest): HttpTestCaseResult[];
6
+ //# sourceMappingURL=validate-request-path-parameters.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"validate-request-path-parameters.d.ts","sourceRoot":"","sources":["../../../src/http-testing/validate/validate-request-path-parameters.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AACzD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAqBhE,wBAAgB,6BAA6B,CAC3C,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EAClC,OAAO,EAAE,kBAAkB,GAC1B,kBAAkB,EAAE,CAWtB;AAED,wBAAgB,6BAA6B,CAC3C,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EAClC,OAAO,EAAE,kBAAkB,GAC1B,kBAAkB,EAAE,CA8BtB;AAED,wBAAgB,6BAA6B,CAC3C,UAAU,EAAE,MAAM,EAClB,OAAO,EAAE,kBAAkB,GAC1B,kBAAkB,EAAE,CAiBtB"}
@@ -0,0 +1,69 @@
1
+ import { match } from 'path-to-regexp';
2
+ import { ajv } from './ajv.js';
3
+ function extractPathParameters(actualPath, templatePath) {
4
+ const pathWithoutQuery = actualPath.split('?')[0] ?? actualPath;
5
+ const normalizedTemplate = templatePath.replaceAll(/{([^}]+)}/gi, ':$1');
6
+ const matchFn = match(normalizedTemplate);
7
+ const result = matchFn(pathWithoutQuery);
8
+ if (!result) {
9
+ return undefined;
10
+ }
11
+ return Object.fromEntries(Object.entries(result.params).map(([key, value]) => [key, String(value)]));
12
+ }
13
+ export function checkForMissingPathParameters(pathParams, request) {
14
+ return Object.entries(request.pathParameters).reduce((acc, [name, param]) => {
15
+ if (!(name in pathParams) && param.required) {
16
+ acc.push({
17
+ type: 'assertion-failure',
18
+ message: `Path parameter "${name}" is required but not included in the request path.`,
19
+ });
20
+ }
21
+ return acc;
22
+ }, []);
23
+ }
24
+ export function validateExistingPathParameter(pathParams, request) {
25
+ return Object.entries(pathParams)
26
+ .filter(([name]) => Object.hasOwn(request.pathParameters, name))
27
+ .map(([name, value]) => {
28
+ if (request.pathParameters[name]?.schema) {
29
+ const validate = ajv.compile(request.pathParameters[name]?.schema);
30
+ validate(value);
31
+ if (validate.errors) {
32
+ return {
33
+ type: 'assertion-failure',
34
+ message: `Invalid value for path parameter "${name}": ${validate.errors.map((err) => err.message).join(', ')}.`,
35
+ timestamp: Date.now(),
36
+ };
37
+ }
38
+ else {
39
+ return {
40
+ type: 'assertion-success',
41
+ message: `Valid path parameter "${name}".`,
42
+ timestamp: Date.now(),
43
+ };
44
+ }
45
+ }
46
+ return {
47
+ type: 'info',
48
+ message: `No schema provided for path parameter "${name}".`,
49
+ timestamp: Date.now(),
50
+ };
51
+ });
52
+ }
53
+ export function validateRequestPathParameters(actualPath, request) {
54
+ const pathParams = extractPathParameters(actualPath, request.path);
55
+ if (!pathParams) {
56
+ return [
57
+ {
58
+ type: 'assertion-failure',
59
+ message: `Request path "${actualPath}" does not match the template path "${request.path}".`,
60
+ timestamp: Date.now(),
61
+ },
62
+ ];
63
+ }
64
+ return [
65
+ ...checkForMissingPathParameters(pathParams, request),
66
+ ...validateExistingPathParameter(pathParams, request),
67
+ ];
68
+ }
69
+ //# sourceMappingURL=validate-request-path-parameters.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"validate-request-path-parameters.js","sourceRoot":"","sources":["../../../src/http-testing/validate/validate-request-path-parameters.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;AAIvC,OAAO,EAAE,GAAG,EAAE,MAAM,UAAU,CAAC;AAE/B,SAAS,qBAAqB,CAC5B,UAAkB,EAClB,YAAoB;IAEpB,MAAM,gBAAgB,GAAG,UAAU,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,UAAU,CAAC;IAChE,MAAM,kBAAkB,GAAG,YAAY,CAAC,UAAU,CAAC,aAAa,EAAE,KAAK,CAAC,CAAC;IACzE,MAAM,OAA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AO,CAAC;QACrD,GAAG,6BAA6B,CAAC,UAAU,EAAE,OAAO,CAAC;KACtD,CAAC;AACJ,CAAC"}
@@ -0,0 +1,7 @@
1
+ import type { ThymianHttpRequest } from '../../index.js';
2
+ import type { HttpTestCaseResult } from '../http-test/index.js';
3
+ export declare function checkForMissingQueryParameters(queryParams: Record<string, string | string[]>, request: ThymianHttpRequest): HttpTestCaseResult[];
4
+ export declare function checkForAdditionalQueryParameters(queryParams: Record<string, string | string[]>, request: ThymianHttpRequest): HttpTestCaseResult[];
5
+ export declare function validateExistingQueryParameter(queryParams: Record<string, string | string[]>, request: ThymianHttpRequest): HttpTestCaseResult[];
6
+ export declare function validateRequestQueryParameters(path: string, request: ThymianHttpRequest): HttpTestCaseResult[];
7
+ //# sourceMappingURL=validate-request-query-parameters.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"validate-request-query-parameters.d.ts","sourceRoot":"","sources":["../../../src/http-testing/validate/validate-request-query-parameters.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AACzD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAqChE,wBAAgB,8BAA8B,CAC5C,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC,EAC9C,OAAO,EAAE,kBAAkB,GAC1B,kBAAkB,EAAE,CActB;AAED,wBAAgB,iCAAiC,CAC/C,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC,EAC9C,OAAO,EAAE,kBAAkB,GAC1B,kBAAkB,EAAE,CAgBtB;AAED,wBAAgB,8BAA8B,CAC5C,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC,EAC9C,OAAO,EAAE,kBAAkB,GAC1B,kBAAkB,EAAE,CA8BtB;AAED,wBAAgB,8BAA8B,CAC5C,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,kBAAkB,GAC1B,kBAAkB,EAAE,CAStB"}
@@ -0,0 +1,91 @@
1
+ import { ajv } from './ajv.js';
2
+ function parseQueryString(queryString) {
3
+ const params = {};
4
+ if (!queryString) {
5
+ return {};
6
+ }
7
+ for (const part of queryString.split('&')) {
8
+ const [key, value] = part.split('=');
9
+ if (!key) {
10
+ continue;
11
+ }
12
+ const decodedKey = decodeURIComponent(key);
13
+ const decodedValue = value ? decodeURIComponent(value) : '';
14
+ if (params[decodedKey]) {
15
+ params[decodedKey].push(decodedValue);
16
+ }
17
+ else {
18
+ params[decodedKey] = [decodedValue];
19
+ }
20
+ }
21
+ return Object.fromEntries(Object.entries(params).map(([key, values]) => [
22
+ key,
23
+ values.length === 1 ? values[0] : values,
24
+ ]));
25
+ }
26
+ export function checkForMissingQueryParameters(queryParams, request) {
27
+ return Object.entries(request.queryParameters).reduce((acc, [name, param]) => {
28
+ if (!(name in queryParams) && param.required) {
29
+ acc.push({
30
+ type: 'assertion-failure',
31
+ message: `Query parameter "${name}" is required but not included in the request.`,
32
+ });
33
+ }
34
+ return acc;
35
+ }, []);
36
+ }
37
+ export function checkForAdditionalQueryParameters(queryParams, request) {
38
+ const failures = Object.keys(queryParams)
39
+ .filter((name) => !Object.hasOwn(request.queryParameters, name))
40
+ .map((name) => ({
41
+ type: 'assertion-failure',
42
+ message: `Request contains query parameter "${name}" that is not included in the description format.`,
43
+ }));
44
+ return failures.length > 0
45
+ ? failures
46
+ : [
47
+ {
48
+ type: 'assertion-success',
49
+ message: `Request does not contain additional query parameters that are not included in the description format.`,
50
+ },
51
+ ];
52
+ }
53
+ export function validateExistingQueryParameter(queryParams, request) {
54
+ return Object.entries(queryParams)
55
+ .filter(([name]) => Object.hasOwn(request.queryParameters, name))
56
+ .map(([name, value]) => {
57
+ if (request.queryParameters[name]?.schema) {
58
+ const validate = ajv.compile(request.queryParameters[name]?.schema);
59
+ validate(value);
60
+ if (validate.errors) {
61
+ return {
62
+ type: 'assertion-failure',
63
+ message: `Invalid value for query parameter "${name}": ${validate.errors.map((err) => err.message).join(', ')}.`,
64
+ timestamp: Date.now(),
65
+ };
66
+ }
67
+ else {
68
+ return {
69
+ type: 'assertion-success',
70
+ message: `Valid query parameter "${name}".`,
71
+ timestamp: Date.now(),
72
+ };
73
+ }
74
+ }
75
+ return {
76
+ type: 'info',
77
+ message: `No schema provided for query parameter "${name}".`,
78
+ timestamp: Date.now(),
79
+ };
80
+ });
81
+ }
82
+ export function validateRequestQueryParameters(path, request) {
83
+ const queryString = path.includes('?') ? (path.split('?')[1] ?? '') : '';
84
+ const queryParams = parseQueryString(queryString);
85
+ return [
86
+ ...checkForMissingQueryParameters(queryParams, request),
87
+ ...checkForAdditionalQueryParameters(queryParams, request),
88
+ ...validateExistingQueryParameter(queryParams, request),
89
+ ];
90
+ }
91
+ //# sourceMappingURL=validate-request-query-parameters.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"validate-request-query-parameters.js","sourceRoot":"","sources":["../../../src/http-testing/validate/validate-request-query-parameters.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,GAAG,EAAE,MAAM,UAAU,CAAC;AAE/B,SAAS,gBAAgB,CACvB,WAAmB;IAEnB,MAAM,MAAM,GAA6B,EAAE,CAAC;IAE5C,IAAI,CAAC,WAAW,EAAE,CAAC;QACjB,OAAO,EAAE,CAAC;IACZ,CAAC;IAED,KAAK,MAAM,IAAI,IAAI,WAAW,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE,CAAC;QAC1C,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QAErC,IAAI,CAAC,GAAG,EAAE,CAAC;YACT,SAAS;QACX,CAAC;QAED,MAAM,UAAU,GAAG,kBAAkB,CAAC,GAAG,CAAC,CAAC;QAC3C,MAAM,YAAY,GAAG,KAAK,CAAC,CAAC,CAAC,kBAAkB,CAAC,KAAK,CAAC,C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AAmB;oBACzB,OAAO,EAAE,0BAA0B,IAAI,IAAI;oBAC3C,SAAS,EAAE,IAAI,CAAC,GAAG,EAAE;iBACtB,CAAC;YACJ,CAAC;QACH,CAAC;QAED,OAAO;YACL,IAAI,EAAE,MAAM;YACZ,OAAO,EAAE,2CAA2C,IAAI,IAAI;YAC5D,SAAS,EAAE,IAAI,CAAC,GAAG,EAAE;SACtB,CAAC;IACJ,CAAC,CAAC,CAAC;AACP,CAAC;AAED,MAAM,UAAU,8BAA8B,CAC5C,IAAY,EACZ,OAA2B;IAE3B,MAAM,WAAW,GAAG,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;IACzE,MAAM,WAAW,GAAG,gBAAgB,CAAC,WAAW,CAAC,CAAC;IAElD,OAAO;QACL,GAAG,8BAA8B,CAAC,WAAW,EAAE,OAAO,CAAC;QACvD,GAAG,iCAAiC,CAAC,WAAW,EAAE,OAAO,CAAC;QAC1D,GAAG,8BAA8B,CAAC,WAAW,EAAE,OAAO,CAAC;KACxD,CAAC;AACJ,CAAC"}
@@ -0,0 +1,7 @@
1
+ import type { HttpResponse, ThymianHttpResponse } from '../../index.js';
2
+ import type { HttpTestCaseResult } from '../http-test/index.js';
3
+ export declare function validateResponse(response: ThymianHttpResponse, actualResponse: HttpResponse, availableResponses: ThymianHttpResponse[]): {
4
+ valid: boolean;
5
+ results: HttpTestCaseResult[];
6
+ };
7
+ //# sourceMappingURL=validate-response.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"validate-response.d.ts","sourceRoot":"","sources":["../../../src/http-testing/validate/validate-response.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AACxE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAKhE,wBAAgB,gBAAgB,CAC9B,QAAQ,EAAE,mBAAmB,EAC7B,cAAc,EAAE,YAAY,EAC5B,kBAAkB,EAAE,mBAAmB,EAAE,GACxC;IAAE,KAAK,EAAE,OAAO,CAAC;IAAC,OAAO,EAAE,kBAAkB,EAAE,CAAA;CAAE,CAenD"}
@@ -0,0 +1,15 @@
1
+ import { validateBodyForResponse } from './validate-body.js';
2
+ import { validateHeaders } from './validate-headers.js';
3
+ import { validateStatusCode } from './validate-status-code.js';
4
+ export function validateResponse(response, actualResponse, availableResponses) {
5
+ const results = [
6
+ validateStatusCode(response.statusCode, actualResponse.statusCode, availableResponses.map(({ statusCode }) => statusCode)),
7
+ ...validateBodyForResponse(actualResponse.body, response),
8
+ ...validateHeaders(actualResponse.headers, response),
9
+ ];
10
+ return {
11
+ results,
12
+ valid: !results.some((r) => r.type === 'assertion-failure'),
13
+ };
14
+ }
15
+ //# sourceMappingURL=validate-response.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"validate-response.js","sourceRoot":"","sources":["../../../src/http-testing/validate/validate-response.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,uBAAuB,EAAE,MAAM,oBAAoB,CAAC;AAC7D,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAE/D,MAAM,UAAU,gBAAgB,CAC9B,QAA6B,EAC7B,cAA4B,EAC5B,kBAAyC;IAEzC,MAAM,OAAO,GAAG;QACd,kBAAkB,CAChB,QAAQ,CAAC,UAAU,EACnB,cAAc,CAAC,UAAU,EACzB,kBAAkB,CAAC,GAAG,CAAC,CAAC,EAAE,UAAU,EAAE,EAAE,EAAE,CAAC,UAAU,CAAC,CACvD;QACD,GAAG,uBAAuB,CAAC,cAAc,CAAC,IAAI,EAAE,QAAQ,CAAC;QACzD,GAAG,eAAe,CAAC,cAAc,CAAC,OAAO,EAAE,QAAQ,CAAC;KACrD,CAAC;IAEF,OAAO;QACL,OAAO;QACP,KAAK,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,mBAAmB,CAAC;KAC5D,CAAC;AACJ,CAAC"}
@@ -0,0 +1,3 @@
1
+ import type { HttpTestCaseResult } from '../http-test/index.js';
2
+ export declare function validateStatusCode(statusCode: number, actualStatusCode: number, availableStatusCodes: number[]): HttpTestCaseResult;
3
+ //# sourceMappingURL=validate-status-code.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"validate-status-code.d.ts","sourceRoot":"","sources":["../../../src/http-testing/validate/validate-status-code.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAEhE,wBAAgB,kBAAkB,CAChC,UAAU,EAAE,MAAM,EAClB,gBAAgB,EAAE,MAAM,EACxB,oBAAoB,EAAE,MAAM,EAAE,GAC7B,kBAAkB,CAuBpB"}
@@ -0,0 +1,25 @@
1
+ export function validateStatusCode(statusCode, actualStatusCode, availableStatusCodes) {
2
+ if (statusCode !== actualStatusCode) {
3
+ if (!availableStatusCodes.includes(statusCode)) {
4
+ return {
5
+ type: 'assertion-failure',
6
+ message: `Expected status code ${statusCode}, but received ${actualStatusCode}, which is not included in the documented status codes: ${availableStatusCodes.join(', ')}.`,
7
+ expected: statusCode,
8
+ actual: actualStatusCode,
9
+ };
10
+ }
11
+ return {
12
+ type: 'assertion-failure',
13
+ message: `Expected status code ${statusCode}, but received ${actualStatusCode}.`,
14
+ expected: statusCode,
15
+ actual: actualStatusCode,
16
+ };
17
+ }
18
+ else {
19
+ return {
20
+ type: 'assertion-success',
21
+ message: `Expected and received status code ${statusCode}.`,
22
+ };
23
+ }
24
+ }
25
+ //# sourceMappingURL=validate-status-code.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"validate-status-code.js","sourceRoot":"","sources":["../../../src/http-testing/validate/validate-status-code.ts"],"names":[],"mappings":"AAEA,MAAM,UAAU,kBAAkB,CAChC,UAAkB,EAClB,gBAAwB,EACxB,oBAA8B;IAE9B,IAAI,UAAU,KAAK,gBAAgB,EAAE,CAAC;QACpC,IAAI,CAAC,oBAAoB,CAAC,QAAQ,CAAC,UAAU,CAAC,EAAE,CAAC;YAC/C,OAAO;gBACL,IAAI,EAAE,mBAAmB;gBACzB,OAAO,EAAE,wBAAwB,UAAU,kBAAkB,gBAAgB,2DAA2D,oBAAoB,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG;gBAC1K,QAAQ,EAAE,UAAU;gBACpB,MAAM,EAAE,gBAAgB;aACzB,CAAC;QACJ,CAAC;QAED,OAAO;YACL,IAAI,EAAE,mBAAmB;YACzB,OAAO,EAAE,wBAAwB,UAAU,kBAAkB,gBAAgB,GAAG;YAChF,QAAQ,EAAE,UAAU;YACpB,MAAM,EAAE,gBAAgB;SACzB,CAAC;IACJ,CAAC;SAAM,CAAC;QACN,OAAO;YACL,IAAI,EAAE,mBAAmB;YACzB,OAAO,EAAE,qCAAqC,UAAU,GAAG;SAC5D,CAAC;IACJ,CAAC;AACH,CAAC"}
package/dist/http.d.ts ADDED
@@ -0,0 +1,29 @@
1
+ export type HttpRequest = {
2
+ origin: string;
3
+ path: string;
4
+ method: string;
5
+ bodyEncoding?: string;
6
+ body?: string;
7
+ headers?: Record<string, string | string[] | undefined>;
8
+ };
9
+ export type HttpRequestTemplate = {
10
+ origin: string;
11
+ path: string;
12
+ pathParameters: Record<string, unknown>;
13
+ method: string;
14
+ query: Record<string, unknown>;
15
+ authorize: boolean;
16
+ bodyEncoding?: string;
17
+ body?: unknown;
18
+ headers: Record<string, unknown>;
19
+ cookies: Record<string, unknown>;
20
+ };
21
+ export type HttpResponse = {
22
+ statusCode: number;
23
+ headers: Record<string, string | string[] | undefined>;
24
+ body?: string;
25
+ bodyEncoding?: string;
26
+ trailers: Record<string, string>;
27
+ duration: number;
28
+ };
29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 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=http.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"http.js","sourceRoot":"","sources":["../src/http.ts"],"names":[],"mappings":""}
@@ -0,0 +1,25 @@
1
+ export * from './actions/index.js';
2
+ export * from './ajv.js';
3
+ export * as chalk from './chalk.js';
4
+ export * from './constants.js';
5
+ export * from './emitter/index.js';
6
+ export * from './emitter/thymian-emitter.js';
7
+ export * from './events/index.js';
8
+ export * from './format/index.js';
9
+ export * from './http.js';
10
+ export * from './http-filter.js';
11
+ export * from './http-filter-visitor.js';
12
+ export { httpStatusCodeRanges, isHttpStatusCodeRange, } from './http-status-codes/http-status-code-ranges.js';
13
+ export * from './http-status-codes/index.js';
14
+ export * from './http-testing/index.js';
15
+ export * from './logger/log-level.js';
16
+ export * from './logger/logger.js';
17
+ export * from './logger/noop.logger.js';
18
+ export * from './logger/text.logger.js';
19
+ export * from './report-sorter.js';
20
+ export * from './rules/index.js';
21
+ export * from './thymian.error.js';
22
+ export * from './thymian.js';
23
+ export * from './thymian-plugin.js';
24
+ export * from './utils.js';
25
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC;AACnC,cAAc,UAAU,CAAC;AACzB,OAAO,KAAK,KAAK,MAAM,YAAY,CAAC;AACpC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,oBAAoB,CAAC;AACnC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,mBAAmB,CAAC;AAClC,cAAc,mBAAmB,CAAC;AAClC,cAAc,WAAW,CAAC;AAC1B,cAAc,kBAAkB,CAAC;AACjC,cAAc,0BAA0B,CAAC;AACzC,OAAO,EACL,oBAAoB,EACpB,qBAAqB,GACtB,MAAM,gDAAgD,CAAC;AACxD,cAAc,8BAA8B,CAAC;AAC7C,cAAc,yBAAyB,CAAC;AACxC,cAAc,uBAAuB,CAAC;AACtC,cAAc,oBAAoB,CAAC;AACnC,cAAc,yBAAyB,CAAC;AACxC,cAAc,yBAAyB,CAAC;AACxC,cAAc,oBAAoB,CAAC;AACnC,cAAc,kBAAkB,CAAC;AACjC,cAAc,oBAAoB,CAAC;AACnC,cAAc,cAAc,CAAC;AAC7B,cAAc,qBAAqB,CAAC;AACpC,cAAc,YAAY,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1,25 @@
1
+ export * from './actions/index.js';
2
+ export * from './ajv.js';
3
+ export * as chalk from './chalk.js';
4
+ export * from './constants.js';
5
+ export * from './emitter/index.js';
6
+ export * from './emitter/thymian-emitter.js';
7
+ export * from './events/index.js';
8
+ export * from './format/index.js';
9
+ export * from './http.js';
10
+ export * from './http-filter.js';
11
+ export * from './http-filter-visitor.js';
12
+ export { httpStatusCodeRanges, isHttpStatusCodeRange, } from './http-status-codes/http-status-code-ranges.js';
13
+ export * from './http-status-codes/index.js';
14
+ export * from './http-testing/index.js';
15
+ export * from './logger/log-level.js';
16
+ export * from './logger/logger.js';
17
+ export * from './logger/noop.logger.js';
18
+ export * from './logger/text.logger.js';
19
+ export * from './report-sorter.js';
20
+ export * from './rules/index.js';
21
+ export * from './thymian.error.js';
22
+ export * from './thymian.js';
23
+ export * from './thymian-plugin.js';
24
+ export * from './utils.js';
25
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC;AACnC,cAAc,UAAU,CAAC;AACzB,OAAO,KAAK,KAAK,MAAM,YAAY,CAAC;AACpC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,oBAAoB,CAAC;AACnC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,mBAAmB,CAAC;AAClC,cAAc,mBAAmB,CAAC;AAClC,cAAc,WAAW,CAAC;AAC1B,cAAc,kBAAkB,CAAC;AACjC,cAAc,0BAA0B,CAAC;AACzC,OAAO,EACL,oBAAoB,EACpB,qBAAqB,GACtB,MAAM,gDAAgD,CAAC;AACxD,cAAc,8BAA8B,CAAC;AAC7C,cAAc,yBAAyB,CAAC;AACxC,cAAc,uBAAuB,CAAC;AACtC,cAAc,oBAAoB,CAAC;AACnC,cAAc,yBAAyB,CAAC;AACxC,cAAc,yBAAyB,CAAC;AACxC,cAAc,oBAAoB,CAAC;AACnC,cAAc,kBAAkB,CAAC;AACjC,cAAc,oBAAoB,CAAC;AACnC,cAAc,cAAc,CAAC;AAC7B,cAAc,qBAAqB,CAAC;AACpC,cAAc,YAAY,CAAC"}
@@ -0,0 +1,5 @@
1
+ export declare const logLevels: readonly ["trace", "debug", "info", "warn", "error", "silent"];
2
+ export type LogLevel = (typeof logLevels)[number];
3
+ export declare function isLogLevel(value: unknown): value is LogLevel;
4
+ export declare function shouldLog(messageLevel: LogLevel, configuredLevel: LogLevel): boolean;
5
+ //# sourceMappingURL=log-level.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"log-level.d.ts","sourceRoot":"","sources":["../../src/logger/log-level.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,SAAS,gEAOZ,CAAC;AAEX,MAAM,MAAM,QAAQ,GAAG,CAAC,OAAO,SAAS,CAAC,CAAC,MAAM,CAAC,CAAC;AAWlD,wBAAgB,UAAU,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,QAAQ,CAK5D;AAED,wBAAgB,SAAS,CACvB,YAAY,EAAE,QAAQ,EACtB,eAAe,EAAE,QAAQ,GACxB,OAAO,CAET"}
@@ -0,0 +1,24 @@
1
+ export const logLevels = [
2
+ 'trace',
3
+ 'debug',
4
+ 'info',
5
+ 'warn',
6
+ 'error',
7
+ 'silent',
8
+ ];
9
+ const logLevelValues = {
10
+ trace: 0,
11
+ debug: 1,
12
+ info: 2,
13
+ warn: 3,
14
+ error: 4,
15
+ silent: 5,
16
+ };
17
+ export function isLogLevel(value) {
18
+ return (typeof value === 'string' &&
19
+ logLevels.includes(value));
20
+ }
21
+ export function shouldLog(messageLevel, configuredLevel) {
22
+ return logLevelValues[messageLevel] >= logLevelValues[configuredLevel];
23
+ }
24
+ //# sourceMappingURL=log-level.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"log-level.js","sourceRoot":"","sources":["../../src/logger/log-level.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,SAAS,GAAG;IACvB,OAAO;IACP,OAAO;IACP,MAAM;IACN,MAAM;IACN,OAAO;IACP,QAAQ;CACA,CAAC;AAIX,MAAM,cAAc,GAA6B;IAC/C,KAAK,EAAE,CAAC;IACR,KAAK,EAAE,CAAC;IACR,IAAI,EAAE,CAAC;IACP,IAAI,EAAE,CAAC;IACP,KAAK,EAAE,CAAC;IACR,MAAM,EAAE,CAAC;CACV,CAAC;AAEF,MAAM,UAAU,UAAU,CAAC,KAAc;IACvC,OAAO,CACL,OAAO,KAAK,KAAK,QAAQ;QACxB,SAA+B,CAAC,QAAQ,CAAC,KAAK,CAAC,CACjD,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,SAAS,CACvB,YAAsB,EACtB,eAAyB;IAEzB,OAAO,cAAc,CAAC,YAAY,CAAC,IAAI,cAAc,CAAC,eAAe,CAAC,CAAC;AACzE,CAAC"}
@@ -0,0 +1,13 @@
1
+ import type { LogLevel } from './log-level.js';
2
+ export interface Logger {
3
+ namespace: string;
4
+ level: LogLevel;
5
+ debug(formatter: unknown, ...args: unknown[]): void;
6
+ info(formatter: unknown, ...args: unknown[]): void;
7
+ error(formatter: unknown, ...args: unknown[]): void;
8
+ trace(formatter: unknown, ...args: unknown[]): void;
9
+ warn(formatter: unknown, ...args: unknown[]): void;
10
+ out(output: unknown): void;
11
+ child(name: string): Logger;
12
+ }
13
+ //# sourceMappingURL=logger.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../../src/logger/logger.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAE/C,MAAM,WAAW,MAAM;IACrB,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,QAAQ,CAAC;IAChB,KAAK,CAAC,SAAS,EAAE,OAAO,EAAE,GAAG,IAAI,EAAE,OAAO,EAAE,GAAG,IAAI,CAAC;IACpD,IAAI,CAAC,SAAS,EAAE,OAAO,EAAE,GAAG,IAAI,EAAE,OAAO,EAAE,GAAG,IAAI,CAAC;IACnD,KAAK,CAAC,SAAS,EAAE,OAAO,EAAE,GAAG,IAAI,EAAE,OAAO,EAAE,GAAG,IAAI,CAAC;IACpD,KAAK,CAAC,SAAS,EAAE,OAAO,EAAE,GAAG,IAAI,EAAE,OAAO,EAAE,GAAG,IAAI,CAAC;IACpD,IAAI,CAAC,SAAS,EAAE,OAAO,EAAE,GAAG,IAAI,EAAE,OAAO,EAAE,GAAG,IAAI,CAAC;IACnD,GAAG,CAAC,MAAM,EAAE,OAAO,GAAG,IAAI,CAAC;IAC3B,KAAK,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAAC;CAC7B"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=logger.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"logger.js","sourceRoot":"","sources":["../../src/logger/logger.ts"],"names":[],"mappings":""}
@@ -0,0 +1,15 @@
1
+ import type { LogLevel } from './log-level.js';
2
+ import type { Logger } from './logger.js';
3
+ export declare class NoopLogger implements Logger {
4
+ readonly namespace: string;
5
+ level: LogLevel;
6
+ constructor(name?: string);
7
+ trace(): void;
8
+ warn(): void;
9
+ debug(): void;
10
+ info(): void;
11
+ error(): void;
12
+ out(): void;
13
+ child(): Logger;
14
+ }
15
+ //# sourceMappingURL=noop.logger.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"noop.logger.d.ts","sourceRoot":"","sources":["../../src/logger/noop.logger.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC/C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAE1C,qBAAa,UAAW,YAAW,MAAM;IACvC,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,KAAK,EAAE,QAAQ,CAAY;gBAEf,IAAI,SAAK;IAIrB,KAAK,IAAI,IAAI;IACb,IAAI,IAAI,IAAI;IACZ,KAAK,IAAI,IAAI;IACb,IAAI,IAAI,IAAI;IACZ,KAAK,IAAI,IAAI;IACb,GAAG,IAAI,IAAI;IACX,KAAK,IAAI,MAAM;CAGhB"}
@@ -0,0 +1,18 @@
1
+ /* eslint @typescript-eslint/no-empty-function: 0 */
2
+ export class NoopLogger {
3
+ namespace;
4
+ level = 'silent';
5
+ constructor(name = '') {
6
+ this.namespace = name;
7
+ }
8
+ trace() { }
9
+ warn() { }
10
+ debug() { }
11
+ info() { }
12
+ error() { }
13
+ out() { }
14
+ child() {
15
+ return this;
16
+ }
17
+ }
18
+ //# sourceMappingURL=noop.logger.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"noop.logger.js","sourceRoot":"","sources":["../../src/logger/noop.logger.ts"],"names":[],"mappings":"AAAA,oDAAoD;AAKpD,MAAM,OAAO,UAAU;IACZ,SAAS,CAAS;IAC3B,KAAK,GAAa,QAAQ,CAAC;IAE3B,YAAY,IAAI,GAAG,EAAE;QACnB,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC;IACxB,CAAC;IAED,KAAK,KAAU,CAAC;IAChB,IAAI,KAAU,CAAC;IACf,KAAK,KAAU,CAAC;IAChB,IAAI,KAAU,CAAC;IACf,KAAK,KAAU,CAAC;IAChB,GAAG,KAAU,CAAC;IACd,KAAK;QACH,OAAO,IAAI,CAAC;IACd,CAAC;CACF"}
@@ -0,0 +1,16 @@
1
+ import type { LogLevel } from './log-level.js';
2
+ import type { Logger } from './logger.js';
3
+ export declare class TextLogger implements Logger {
4
+ readonly namespace: string;
5
+ readonly level: LogLevel;
6
+ constructor(name: string, level?: LogLevel);
7
+ trace(formatter: unknown, ...args: unknown[]): void;
8
+ warn(formatter: unknown, ...args: unknown[]): void;
9
+ debug(formatter: unknown, ...args: unknown[]): void;
10
+ info(formatter: unknown, ...args: unknown[]): void;
11
+ error(formatter: unknown, ...args: unknown[]): void;
12
+ out(output: unknown): void;
13
+ child(name: string): Logger;
14
+ private now;
15
+ }
16
+ //# sourceMappingURL=text.logger.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"text.logger.d.ts","sourceRoot":"","sources":["../../src/logger/text.logger.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAE/C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAE1C,qBAAa,UAAW,YAAW,MAAM;IACvC,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,KAAK,EAAE,QAAQ,CAAC;gBAEb,IAAI,EAAE,MAAM,EAAE,KAAK,GAAE,QAAiB;IAKlD,KAAK,CAAC,SAAS,EAAE,OAAO,EAAE,GAAG,IAAI,EAAE,OAAO,EAAE,GAAG,IAAI;IAUnD,IAAI,CAAC,SAAS,EAAE,OAAO,EAAE,GAAG,IAAI,EAAE,OAAO,EAAE,GAAG,IAAI;IAWlD,KAAK,CAAC,SAAS,EAAE,OAAO,EAAE,GAAG,IAAI,EAAE,OAAO,EAAE,GAAG,IAAI;IAUnD,IAAI,CAAC,SAAS,EAAE,OAAO,EAAE,GAAG,IAAI,EAAE,OAAO,EAAE,GAAG,IAAI;IAUlD,KAAK,CAAC,SAAS,EAAE,OAAO,EAAE,GAAG,IAAI,EAAE,OAAO,EAAE,GAAG,IAAI;IAUnD,GAAG,CAAC,MAAM,EAAE,OAAO,GAAG,IAAI;IAS1B,KAAK,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM;IAI3B,OAAO,CAAC,GAAG;CAGZ"}