@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,76 @@
1
+ import type { Constant, HttpFilterExpression, LogicalExpression, RequestFilterExpression, ResponseFilterExpression } from './http-filter.js';
2
+ export interface HttpFilterVisitor<TResult> {
3
+ visitMethod?(expr: Extract<RequestFilterExpression, {
4
+ type: 'method';
5
+ }>): TResult;
6
+ visitRequestHeader?(expr: Extract<RequestFilterExpression, {
7
+ type: 'requestHeader';
8
+ }>): TResult;
9
+ visitQueryParam?(expr: Extract<RequestFilterExpression, {
10
+ type: 'queryParam';
11
+ }>): TResult;
12
+ visitPath?(expr: Extract<RequestFilterExpression, {
13
+ type: 'path';
14
+ }>): TResult;
15
+ visitHasResponse?(expr: Extract<RequestFilterExpression, {
16
+ type: 'hasResponse';
17
+ }>): TResult;
18
+ visitIsAuthorized?(expr: Extract<RequestFilterExpression, {
19
+ type: 'isAuthorized';
20
+ }>): TResult;
21
+ visitOrigin?(expr: Extract<RequestFilterExpression, {
22
+ type: 'origin';
23
+ }>): TResult;
24
+ visitHasBody?(expr: Extract<RequestFilterExpression, {
25
+ type: 'hasBody';
26
+ }>): TResult;
27
+ visitPort?(expr: Extract<RequestFilterExpression, {
28
+ type: 'port';
29
+ }>): TResult;
30
+ visitRequestMediaType?(expr: Extract<RequestFilterExpression, {
31
+ type: 'requestMediaType';
32
+ }>): TResult;
33
+ visitUrl?(expr: Extract<RequestFilterExpression, {
34
+ type: 'url';
35
+ }>): TResult;
36
+ visitProtocol?(expr: Extract<RequestFilterExpression, {
37
+ type: 'protocol';
38
+ }>): TResult;
39
+ visitMatchesOrigin?(expr: Extract<RequestFilterExpression, {
40
+ type: 'matches-origin';
41
+ }>): TResult;
42
+ visitStatusCode?(expr: Extract<ResponseFilterExpression, {
43
+ type: 'statusCode';
44
+ }>): TResult;
45
+ visitHasResponseBody?(expr: Extract<ResponseFilterExpression, {
46
+ type: 'hasResponseBody';
47
+ }>): TResult;
48
+ visitResponseHeader?(expr: Extract<ResponseFilterExpression, {
49
+ type: 'responseHeader';
50
+ }>): TResult;
51
+ visitStatusCodeRange?(expr: Extract<ResponseFilterExpression, {
52
+ type: 'statusCodeRange';
53
+ }>): TResult;
54
+ visitResponseMediaType?(expr: Extract<ResponseFilterExpression, {
55
+ type: 'responseMediaType';
56
+ }>): TResult;
57
+ visitResponseTrailer?(expr: Extract<ResponseFilterExpression, {
58
+ type: 'responseTrailer';
59
+ }>): TResult;
60
+ visitAnd?(expr: Extract<LogicalExpression, {
61
+ type: 'and';
62
+ }>): TResult;
63
+ visitOr?(expr: Extract<LogicalExpression, {
64
+ type: 'or';
65
+ }>): TResult;
66
+ visitNot?(expr: Extract<LogicalExpression, {
67
+ type: 'not';
68
+ }>): TResult;
69
+ visitXor?(expr: Extract<LogicalExpression, {
70
+ type: 'xor';
71
+ }>): TResult;
72
+ visitConstant?(expr: Constant): TResult;
73
+ }
74
+ export declare function visitHttpFilter<TResult>(expr: HttpFilterExpression, visitor: HttpFilterVisitor<TResult>): TResult;
75
+ export declare function createFilterVisitor<T extends (...args: any[]) => boolean>(visitor: HttpFilterVisitor<T>): HttpFilterVisitor<T>;
76
+ //# sourceMappingURL=http-filter-visitor.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"http-filter-visitor.d.ts","sourceRoot":"","sources":["../src/http-filter-visitor.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,QAAQ,EACR,oBAAoB,EACpB,iBAAiB,EACjB,uBAAuB,EACvB,wBAAwB,EACzB,MAAM,kBAAkB,CAAC;AAE1B,MAAM,WAAW,iBAAiB,CAAC,OAAO;IAExC,WAAW,CAAC,CACV,IAAI,EAAE,OAAO,CAAC,uBAAuB,EAAE;QAAE,IAAI,EAAE,QAAQ,CAAA;KAAE,CAAC,GACzD,OAAO,CAAC;IACX,kBAAkB,CAAC,CACjB,IAAI,EAAE,OAAO,CAAC,uBAAuB,EAAE;QAAE,IAAI,EAAE,eAAe,CAAA;KAAE,CAAC,GAChE,OAAO,CAAC;IACX,eAAe,CAAC,CACd,IAAI,EAAE,OAAO,CAAC,uBAAuB,EAAE;QAAE,IAAI,EAAE,YAAY,CAAA;KAAE,CAAC,GAC7D,OAAO,CAAC;IACX,SAAS,CAAC,CAAC,IAAI,EAAE,OAAO,CAAC,uBAAuB,EAAE;QAAE,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC,GAAG,OAAO,CAAC;IAC9E,gBAAgB,CAAC,CACf,IAAI,EAAE,OAAO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AAE,iBAAiB,CAAC,OAAO,CAAC,GAClC,OAAO,CAoMT;AAED,wBAAgB,mBAAmB,CAAC,CAAC,SAAS,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,OAAO,EACvE,OAAO,EAAE,iBAAiB,CAAC,CAAC,CAAC,GAC5B,iBAAiB,CAAC,CAAC,CAAC,CAmCtB"}
@@ -0,0 +1,168 @@
1
+ export function visitHttpFilter(expr, visitor) {
2
+ switch (expr.kind) {
3
+ case 'request':
4
+ switch (expr.type) {
5
+ case 'method':
6
+ if (!visitor.visitMethod) {
7
+ throw new Error(`Visitor does not implement visitMethod for expression type: ${expr.type}`);
8
+ }
9
+ return visitor.visitMethod(expr);
10
+ case 'requestHeader':
11
+ if (!visitor.visitRequestHeader) {
12
+ throw new Error(`Visitor does not implement visitRequestHeader for expression type: ${expr.type}`);
13
+ }
14
+ return visitor.visitRequestHeader(expr);
15
+ case 'queryParam':
16
+ if (!visitor.visitQueryParam) {
17
+ throw new Error(`Visitor does not implement visitQueryParam for expression type: ${expr.type}`);
18
+ }
19
+ return visitor.visitQueryParam(expr);
20
+ case 'path':
21
+ if (!visitor.visitPath) {
22
+ throw new Error(`Visitor does not implement visitPath for expression type: ${expr.type}`);
23
+ }
24
+ return visitor.visitPath(expr);
25
+ case 'hasResponse':
26
+ if (!visitor.visitHasResponse) {
27
+ throw new Error(`Visitor does not implement visitHasResponse for expression type: ${expr.type}`);
28
+ }
29
+ return visitor.visitHasResponse(expr);
30
+ case 'isAuthorized':
31
+ if (!visitor.visitIsAuthorized) {
32
+ throw new Error(`Visitor does not implement visitIsAuthorized for expression type: ${expr.type}`);
33
+ }
34
+ return visitor.visitIsAuthorized(expr);
35
+ case 'origin':
36
+ if (!visitor.visitOrigin) {
37
+ throw new Error(`Visitor does not implement visitOrigin for expression type: ${expr.type}`);
38
+ }
39
+ return visitor.visitOrigin(expr);
40
+ case 'hasBody':
41
+ if (!visitor.visitHasBody) {
42
+ throw new Error(`Visitor does not implement visitHasBody for expression type: ${expr.type}`);
43
+ }
44
+ return visitor.visitHasBody(expr);
45
+ case 'port':
46
+ if (!visitor.visitPort) {
47
+ throw new Error(`Visitor does not implement visitPort for expression type: ${expr.type}`);
48
+ }
49
+ return visitor.visitPort(expr);
50
+ case 'requestMediaType':
51
+ if (!visitor.visitRequestMediaType) {
52
+ throw new Error(`Visitor does not implement visitRequestMediaType for expression type: ${expr.type}`);
53
+ }
54
+ return visitor.visitRequestMediaType(expr);
55
+ case 'url':
56
+ if (!visitor.visitUrl) {
57
+ throw new Error(`Visitor does not implement visitUrl for expression type: ${expr.type}`);
58
+ }
59
+ return visitor.visitUrl(expr);
60
+ case 'protocol':
61
+ if (!visitor.visitProtocol) {
62
+ throw new Error(`Visitor does not implement visitProtocol for expression type: ${expr.type}`);
63
+ }
64
+ return visitor.visitProtocol(expr);
65
+ case 'matches-origin':
66
+ if (!visitor.visitMatchesOrigin) {
67
+ throw new Error(`Visitor does not implement visitMatchesOrigin for expression type: ${expr.type}`);
68
+ }
69
+ return visitor.visitMatchesOrigin(expr);
70
+ default:
71
+ throw new Error(`Unknown request filter type: ${expr.type}`);
72
+ }
73
+ case 'response':
74
+ switch (expr.type) {
75
+ case 'statusCode':
76
+ if (!visitor.visitStatusCode) {
77
+ throw new Error(`Visitor does not implement visitStatusCode for expression type: ${expr.type}`);
78
+ }
79
+ return visitor.visitStatusCode(expr);
80
+ case 'hasResponseBody':
81
+ if (!visitor.visitHasResponseBody) {
82
+ throw new Error(`Visitor does not implement visitHasResponseBody for expression type: ${expr.type}`);
83
+ }
84
+ return visitor.visitHasResponseBody(expr);
85
+ case 'responseHeader':
86
+ if (!visitor.visitResponseHeader) {
87
+ throw new Error(`Visitor does not implement visitResponseHeader for expression type: ${expr.type}`);
88
+ }
89
+ return visitor.visitResponseHeader(expr);
90
+ case 'statusCodeRange':
91
+ if (!visitor.visitStatusCodeRange) {
92
+ throw new Error(`Visitor does not implement visitStatusCodeRange for expression type: ${expr.type}`);
93
+ }
94
+ return visitor.visitStatusCodeRange(expr);
95
+ case 'responseMediaType':
96
+ if (!visitor.visitResponseMediaType) {
97
+ throw new Error(`Visitor does not implement visitResponseMediaType for expression type: ${expr.type}`);
98
+ }
99
+ return visitor.visitResponseMediaType(expr);
100
+ case 'responseTrailer':
101
+ if (!visitor.visitResponseTrailer) {
102
+ throw new Error(`Visitor does not implement visitResponseTrailer for expression type: ${expr.type}`);
103
+ }
104
+ return visitor.visitResponseTrailer(expr);
105
+ default:
106
+ throw new Error(`Unknown response filter type: ${expr.type}`);
107
+ }
108
+ case 'logic':
109
+ switch (expr.type) {
110
+ case 'and':
111
+ if (!visitor.visitAnd) {
112
+ throw new Error(`Visitor does not implement visitAnd for expression type: ${expr.type}`);
113
+ }
114
+ return visitor.visitAnd(expr);
115
+ case 'or':
116
+ if (!visitor.visitOr) {
117
+ throw new Error(`Visitor does not implement visitOr for expression type: ${expr.type}`);
118
+ }
119
+ return visitor.visitOr(expr);
120
+ case 'not':
121
+ if (!visitor.visitNot) {
122
+ throw new Error(`Visitor does not implement visitNot for expression type: ${expr.type}`);
123
+ }
124
+ return visitor.visitNot(expr);
125
+ case 'xor':
126
+ if (!visitor.visitXor) {
127
+ throw new Error(`Visitor does not implement visitXor for expression type: ${expr.type}`);
128
+ }
129
+ return visitor.visitXor(expr);
130
+ case 'constant':
131
+ if (!visitor.visitConstant) {
132
+ throw new Error(`Visitor does not implement visitConstant for expression type: ${expr.type}`);
133
+ }
134
+ return visitor.visitConstant(expr);
135
+ default:
136
+ throw new Error(`Unknown logical expression type: ${expr.type}`);
137
+ }
138
+ default:
139
+ throw new Error(`Unknown expression kind: ${expr.kind}`);
140
+ }
141
+ }
142
+ export function createFilterVisitor(visitor) {
143
+ const extendedVisitor = {
144
+ visitAnd(expr) {
145
+ return ((...args) => expr.filters.every((filter) => visitHttpFilter(filter, extendedVisitor)(...args)));
146
+ },
147
+ visitOr(expr) {
148
+ return ((...args) => expr.filters.some((filter) => visitHttpFilter(filter, extendedVisitor)(...args)));
149
+ },
150
+ visitNot(expr) {
151
+ return ((...args) => !visitHttpFilter(expr.filter, extendedVisitor)(...args));
152
+ },
153
+ visitXor(expr) {
154
+ return ((...args) => {
155
+ const [first, second] = expr.filters;
156
+ const firstResult = visitHttpFilter(first, extendedVisitor)(...args);
157
+ const secondResult = visitHttpFilter(second, extendedVisitor)(...args);
158
+ return firstResult !== secondResult;
159
+ });
160
+ },
161
+ visitConstant(expr) {
162
+ return ((...args) => Boolean(expr.value));
163
+ },
164
+ ...visitor,
165
+ };
166
+ return extendedVisitor;
167
+ }
168
+ //# sourceMappingURL=http-filter-visitor.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"http-filter-visitor.js","sourceRoot":"","sources":["../src/http-filter-visitor.ts"],"names":[],"mappings":"AAwEA,MAAM,UAAU,eAAe,CAC7B,IAA0B,EAC1B,OAAmC;IAEnC,QAAQ,IAAI,CAAC,IAAI,EAAE,CAAC;QAClB,KAAK,SAAS;YACZ,QAAQ,IAAI,CAAC,IAAI,EAAE,CAAC;gBAClB,KAAK,QAAQ;oBACX,IAAI,CAAC,OAAO,CAAC,WAAW,EAAE,CAAC;wBACzB,MAAM,IAAI,KAAK,CACb,+DAA+D,IAAI,CAAC,IAAI,EAAE,CAC3E,CAAC;oBACJ,CAAC;oBACD,OAAO,OAAO,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;gBACnC,KAAK,eAAe;oBAClB,IAAI,CAAC,OAAO,CAAC,kBAAkB,EAAE,CAAC;wBAChC,MAAM,IAAI,KAAK,CACb,sEAAsE,IAAI,CAAC,IAAI,EAAE,CAClF,CAAC;oBACJ,CAAC;oBACD,OAAO,OAAO,CAAC,kBAAkB,CAAC,IAAI,CAAC,CAAC;gBAC1C,KAAK,YAAY;oBACf,IAAI,CAAC,OAAO,CAAC,eAAe,EAAE,CAAC;wBAC7B,MAAM,IAAI,KAAK,CACb,mEAAmE,IAAI,CAAC,IAAI,EAAE,CAC/E,CAAC;oBACJ,CAAC;o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V,CAAC;QACD,aAAa,CAAC,IAAI;YAChB,OAAO,CAAC,CAAC,GAAG,IAAe,EAAE,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAM,CAAC;QAC5D,CAAC;QACD,GAAG,OAAO;KACX,CAAC;IACF,OAAO,eAAe,CAAC;AACzB,CAAC"}
@@ -0,0 +1,140 @@
1
+ import * as http from 'node:http';
2
+ type OmitIndexSignature<T> = {
3
+ [K in keyof T as string extends K ? never : number extends K ? never : K]: T[K];
4
+ };
5
+ export type HttpHeader = keyof OmitIndexSignature<http.OutgoingHttpHeaders> | (string & Record<never, never>);
6
+ export type HttpMethod = 'DELETE' | 'GET' | 'HEAD' | 'PATCH' | 'POST' | 'PUT' | 'OPTIONS' | (string & {});
7
+ export type RequestFilterExpression = {
8
+ type: 'method';
9
+ kind: 'request';
10
+ method?: string;
11
+ } | {
12
+ type: 'requestHeader';
13
+ kind: 'request';
14
+ header?: string;
15
+ value?: unknown;
16
+ } | {
17
+ type: 'queryParam';
18
+ kind: 'request';
19
+ param?: string;
20
+ value?: unknown;
21
+ } | {
22
+ type: 'path';
23
+ kind: 'request';
24
+ path?: string;
25
+ } | {
26
+ type: 'hasResponse';
27
+ kind: 'request';
28
+ filter: HttpFilterExpression;
29
+ } | {
30
+ type: 'isAuthorized';
31
+ kind: 'request';
32
+ isAuthorized: boolean;
33
+ } | {
34
+ type: 'origin';
35
+ kind: 'request';
36
+ origin?: string;
37
+ } | {
38
+ type: 'hasBody';
39
+ kind: 'request';
40
+ hasBody?: boolean;
41
+ } | {
42
+ type: 'port';
43
+ kind: 'request';
44
+ port?: number;
45
+ } | {
46
+ type: 'requestMediaType';
47
+ kind: 'request';
48
+ mediaType?: string;
49
+ } | {
50
+ type: 'url';
51
+ kind: 'request';
52
+ url?: string;
53
+ } | {
54
+ type: 'protocol';
55
+ kind: 'request';
56
+ protocol?: string;
57
+ } | {
58
+ type: 'matches-origin';
59
+ kind: 'request';
60
+ origin?: string;
61
+ };
62
+ export type ResponseFilterExpression = {
63
+ type: 'statusCode';
64
+ kind: 'response';
65
+ code?: number;
66
+ } | {
67
+ type: 'hasResponseBody';
68
+ kind: 'response';
69
+ hasBody?: boolean;
70
+ } | {
71
+ type: 'responseHeader';
72
+ kind: 'response';
73
+ header?: string;
74
+ value?: unknown;
75
+ } | {
76
+ type: 'statusCodeRange';
77
+ kind: 'response';
78
+ start: number;
79
+ end: number;
80
+ } | {
81
+ type: 'responseMediaType';
82
+ kind: 'response';
83
+ mediaType?: string;
84
+ } | {
85
+ type: 'responseTrailer';
86
+ kind: 'response';
87
+ trailer?: string;
88
+ value?: unknown;
89
+ };
90
+ export type LogicalExpression = {
91
+ type: 'and';
92
+ kind: 'logic';
93
+ filters: HttpFilterExpression[];
94
+ } | {
95
+ type: 'or';
96
+ kind: 'logic';
97
+ filters: HttpFilterExpression[];
98
+ } | {
99
+ type: 'not';
100
+ kind: 'logic';
101
+ filter: HttpFilterExpression;
102
+ } | Constant | {
103
+ type: 'xor';
104
+ kind: 'logic';
105
+ filters: [HttpFilterExpression, HttpFilterExpression];
106
+ };
107
+ export type Constant = {
108
+ type: 'constant';
109
+ kind: 'logic';
110
+ value: unknown;
111
+ };
112
+ export type HttpFilterExpression = RequestFilterExpression | ResponseFilterExpression | LogicalExpression;
113
+ export declare const methods: (...methods: HttpMethod[]) => LogicalExpression;
114
+ export declare const method: (method?: HttpMethod) => RequestFilterExpression;
115
+ export declare const path: (path?: string) => RequestFilterExpression;
116
+ export declare const protocol: (protocol?: "http" | "https") => RequestFilterExpression;
117
+ export declare const responseHeader: (header?: HttpHeader, value?: unknown) => ResponseFilterExpression;
118
+ export declare const responseTrailer: (trailer?: string, value?: unknown) => ResponseFilterExpression;
119
+ export declare const requestHeader: (header: HttpHeader, value?: unknown) => RequestFilterExpression;
120
+ export declare const statusCode: (code?: number) => ResponseFilterExpression;
121
+ export declare const statusCodeRange: (start: number, end: number) => ResponseFilterExpression;
122
+ export declare const hasResponseBody: (hasBody?: boolean) => ResponseFilterExpression;
123
+ export declare const and: (...filters: HttpFilterExpression[]) => LogicalExpression;
124
+ export declare const or: (...filters: HttpFilterExpression[]) => LogicalExpression;
125
+ export declare const not: (filter: HttpFilterExpression) => LogicalExpression;
126
+ export declare const xor: (...filters: [HttpFilterExpression, HttpFilterExpression]) => LogicalExpression;
127
+ export declare const authorization: (isAuthorized?: boolean) => RequestFilterExpression;
128
+ export declare const responseWith: (filter: HttpFilterExpression) => RequestFilterExpression;
129
+ export declare const constant: (value?: unknown) => Constant;
130
+ export declare const origin: (origin?: string) => RequestFilterExpression;
131
+ export declare const hasRequestBody: (hasBody?: boolean) => RequestFilterExpression;
132
+ export declare const port: (port?: number) => RequestFilterExpression;
133
+ export declare const requestMediaType: (mediaType: string) => RequestFilterExpression;
134
+ export declare const responseMediaType: (mediaType: string) => ResponseFilterExpression;
135
+ export declare const queryParameter: (name?: string, value?: unknown) => RequestFilterExpression;
136
+ export declare const url: (url?: string) => RequestFilterExpression;
137
+ export declare const successfulStatusCode: () => ResponseFilterExpression;
138
+ export declare const matchesOrigin: (origin?: string) => RequestFilterExpression;
139
+ export {};
140
+ //# sourceMappingURL=http-filter.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"http-filter.d.ts","sourceRoot":"","sources":["../src/http-filter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAElC,KAAK,kBAAkB,CAAC,CAAC,IAAI;KAC1B,CAAC,IAAI,MAAM,CAAC,IAAI,MAAM,SAAS,CAAC,GAC7B,KAAK,GACL,MAAM,SAAS,CAAC,GACd,KAAK,GACL,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CACf,CAAC;AAEF,MAAM,MAAM,UAAU,GAClB,MAAM,kBAAkB,CAAC,IAAI,CAAC,mBAAmB,CAAC,GAClD,CAAC,MAAM,GAAG,MAAM,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC;AAEpC,MAAM,MAAM,UAAU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 import * as http from 'node:http';
2
+ export const methods = (...methods) => ({
3
+ type: 'or',
4
+ kind: 'logic',
5
+ filters: methods.map((method) => ({
6
+ type: 'method',
7
+ kind: 'request',
8
+ method,
9
+ })),
10
+ });
11
+ export const method = (method) => ({
12
+ type: 'method',
13
+ kind: 'request',
14
+ method,
15
+ });
16
+ export const path = (path) => ({
17
+ type: 'path',
18
+ kind: 'request',
19
+ path,
20
+ });
21
+ export const protocol = (protocol) => ({
22
+ type: 'protocol',
23
+ kind: 'request',
24
+ protocol,
25
+ });
26
+ export const responseHeader = (header, value) => ({
27
+ type: 'responseHeader',
28
+ kind: 'response',
29
+ header,
30
+ value,
31
+ });
32
+ export const responseTrailer = (trailer, value) => ({
33
+ type: 'responseTrailer',
34
+ kind: 'response',
35
+ trailer,
36
+ value,
37
+ });
38
+ export const requestHeader = (header, value) => ({
39
+ type: 'requestHeader',
40
+ kind: 'request',
41
+ header,
42
+ value,
43
+ });
44
+ export const statusCode = (code) => ({
45
+ type: 'statusCode',
46
+ code,
47
+ kind: 'response',
48
+ });
49
+ export const statusCodeRange = (start, end) => ({
50
+ kind: 'response',
51
+ type: 'statusCodeRange',
52
+ start,
53
+ end,
54
+ });
55
+ export const hasResponseBody = (hasBody = true) => ({
56
+ type: 'hasResponseBody',
57
+ kind: 'response',
58
+ hasBody,
59
+ });
60
+ export const and = (...filters) => ({
61
+ type: 'and',
62
+ kind: 'logic',
63
+ filters,
64
+ });
65
+ export const or = (...filters) => ({
66
+ type: 'or',
67
+ kind: 'logic',
68
+ filters,
69
+ });
70
+ export const not = (filter) => ({
71
+ type: 'not',
72
+ kind: 'logic',
73
+ filter,
74
+ });
75
+ export const xor = (...filters) => ({
76
+ type: 'xor',
77
+ kind: 'logic',
78
+ filters,
79
+ });
80
+ export const authorization = (isAuthorized = true) => ({
81
+ type: 'isAuthorized',
82
+ kind: 'request',
83
+ isAuthorized,
84
+ });
85
+ export const responseWith = (filter) => ({
86
+ type: 'hasResponse',
87
+ kind: 'request',
88
+ filter,
89
+ });
90
+ export const constant = (value) => ({
91
+ type: 'constant',
92
+ kind: 'logic',
93
+ value,
94
+ });
95
+ export const origin = (origin) => ({
96
+ type: 'origin',
97
+ kind: 'request',
98
+ origin,
99
+ });
100
+ export const hasRequestBody = (hasBody = true) => ({
101
+ type: 'hasBody',
102
+ kind: 'request',
103
+ hasBody,
104
+ });
105
+ export const port = (port) => ({
106
+ type: 'port',
107
+ kind: 'request',
108
+ port,
109
+ });
110
+ export const requestMediaType = (mediaType) => ({
111
+ type: 'requestMediaType',
112
+ kind: 'request',
113
+ mediaType,
114
+ });
115
+ export const responseMediaType = (mediaType) => ({
116
+ type: 'responseMediaType',
117
+ kind: 'response',
118
+ mediaType,
119
+ });
120
+ export const queryParameter = (name, value) => ({
121
+ type: 'queryParam',
122
+ kind: 'request',
123
+ param: name,
124
+ value,
125
+ });
126
+ export const url = (url) => ({
127
+ type: 'url',
128
+ kind: 'request',
129
+ url,
130
+ });
131
+ export const successfulStatusCode = () => statusCodeRange(200, 299);
132
+ export const matchesOrigin = (origin) => ({
133
+ type: 'matches-origin',
134
+ kind: 'request',
135
+ origin,
136
+ });
137
+ //# sourceMappingURL=http-filter.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"http-filter.js","sourceRoot":"","sources":["../src/http-filter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AA+ElC,MAAM,CAAC,MAAM,OAAO,GAAG,CAAC,GAAG,OAAqB,EAAqB,EAAE,CAAC,CAAC;IACvE,IAAI,EAAE,IAAI;IACV,IAAI,EAAE,OAAO;IACb,OAAO,EAAE,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;QAChC,IAAI,EAAE,QAAQ;QACd,IAAI,EAAE,SAAS;QACf,MAAM;KACP,CAAC,CAAC;CACJ,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,MAAM,GAAG,CAAC,MAAmB,EAA2B,EAAE,CA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E,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,MAAe,EAA2B,EAAE,CAAC,CAAC;IAC1E,IAAI,EAAE,gBAAgB;IACtB,IAAI,EAAE,SAAS;IACf,MAAM;CACP,CAAC,CAAC"}
@@ -0,0 +1,15 @@
1
+ export declare const informationalStatusCodeToPhrase: {
2
+ 100: "continue";
3
+ 101: "switching protocols";
4
+ 102: "processing";
5
+ 103: "early hints";
6
+ };
7
+ export declare const informationalPhraseToStatusCode: {
8
+ continue: 100;
9
+ "switching protocols": 101;
10
+ processing: 102;
11
+ 'early hints': 103;
12
+ };
13
+ export * from './informational.phrases.js';
14
+ export * from './informational.status-codes.js';
15
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/http-status-codes/1xx/index.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,+BAA+B;;;;;CAKoB,CAAC;AAEjE,eAAO,MAAM,+BAA+B;;;;;CAKoB,CAAC;AAEjE,cAAc,4BAA4B,CAAC;AAC3C,cAAc,iCAAiC,CAAC"}
@@ -0,0 +1,15 @@
1
+ export const informationalStatusCodeToPhrase = {
2
+ 100: 'continue',
3
+ 101: 'switching protocols',
4
+ 102: 'processing',
5
+ 103: 'early hints',
6
+ };
7
+ export const informationalPhraseToStatusCode = {
8
+ [informationalStatusCodeToPhrase[100]]: 100,
9
+ [informationalStatusCodeToPhrase[101]]: 101,
10
+ [informationalStatusCodeToPhrase[102]]: 102,
11
+ 'early hints': 103,
12
+ };
13
+ export * from './informational.phrases.js';
14
+ export * from './informational.status-codes.js';
15
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/http-status-codes/1xx/index.ts"],"names":[],"mappings":"AAGA,MAAM,CAAC,MAAM,+BAA+B,GAAG;IAC7C,GAAG,EAAE,UAAU;IACf,GAAG,EAAE,qBAAqB;IAC1B,GAAG,EAAE,YAAY;IACjB,GAAG,EAAE,aAAa;CAC4C,CAAC;AAEjE,MAAM,CAAC,MAAM,+BAA+B,GAAG;IAC7C,CAAC,+BAA+B,CAAC,GAAG,CAAC,CAAC,EAAE,GAAG;IAC3C,CAAC,+BAA+B,CAAC,GAAG,CAAC,CAAC,EAAE,GAAG;IAC3C,CAAC,+BAA+B,CAAC,GAAG,CAAC,CAAC,EAAE,GAAG;IAC3C,aAAa,EAAE,GAAG;CAC4C,CAAC;AAEjE,cAAc,4BAA4B,CAAC;AAC3C,cAAc,iCAAiC,CAAC"}
@@ -0,0 +1,4 @@
1
+ export declare const informationalPhrases: readonly ["continue", "switching protocols", "processing", "early hints"];
2
+ export type InformationalPhrase = (typeof informationalPhrases)[number];
3
+ export declare function isValidInformationalPhrase(phrase: string): phrase is InformationalPhrase;
4
+ //# sourceMappingURL=informational.phrases.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"informational.phrases.d.ts","sourceRoot":"","sources":["../../../src/http-status-codes/1xx/informational.phrases.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,oBAAoB,2EAKvB,CAAC;AAEX,MAAM,MAAM,mBAAmB,GAAG,CAAC,OAAO,oBAAoB,CAAC,CAAC,MAAM,CAAC,CAAC;AAExE,wBAAgB,0BAA0B,CACxC,MAAM,EAAE,MAAM,GACb,MAAM,IAAI,mBAAmB,CAE/B"}
@@ -0,0 +1,10 @@
1
+ export const informationalPhrases = [
2
+ 'continue',
3
+ 'switching protocols',
4
+ 'processing',
5
+ 'early hints',
6
+ ];
7
+ export function isValidInformationalPhrase(phrase) {
8
+ return informationalPhrases.includes(phrase);
9
+ }
10
+ //# sourceMappingURL=informational.phrases.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"informational.phrases.js","sourceRoot":"","sources":["../../../src/http-status-codes/1xx/informational.phrases.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,oBAAoB,GAAG;IAClC,UAAU;IACV,qBAAqB;IACrB,YAAY;IACZ,aAAa;CACL,CAAC;AAIX,MAAM,UAAU,0BAA0B,CACxC,MAAc;IAEd,OAAO,oBAAoB,CAAC,QAAQ,CAAC,MAA6B,CAAC,CAAC;AACtE,CAAC"}
@@ -0,0 +1,4 @@
1
+ export declare const informationalStatusCodes: readonly [100, 101, 102, 103];
2
+ export type InformationalStatusCode = (typeof informationalStatusCodes)[number];
3
+ export declare function isValidInformationalStatusCode(code: number): code is InformationalStatusCode;
4
+ //# sourceMappingURL=informational.status-codes.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"informational.status-codes.d.ts","sourceRoot":"","sources":["../../../src/http-status-codes/1xx/informational.status-codes.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,wBAAwB,+BAAgC,CAAC;AAEtE,MAAM,MAAM,uBAAuB,GAAG,CAAC,OAAO,wBAAwB,CAAC,CAAC,MAAM,CAAC,CAAC;AAEhF,wBAAgB,8BAA8B,CAC5C,IAAI,EAAE,MAAM,GACX,IAAI,IAAI,uBAAuB,CAEjC"}
@@ -0,0 +1,5 @@
1
+ export const informationalStatusCodes = [100, 101, 102, 103];
2
+ export function isValidInformationalStatusCode(code) {
3
+ return informationalStatusCodes.includes(code);
4
+ }
5
+ //# sourceMappingURL=informational.status-codes.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"informational.status-codes.js","sourceRoot":"","sources":["../../../src/http-status-codes/1xx/informational.status-codes.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,wBAAwB,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,CAAU,CAAC;AAItE,MAAM,UAAU,8BAA8B,CAC5C,IAAY;IAEZ,OAAO,wBAAwB,CAAC,QAAQ,CAAC,IAA+B,CAAC,CAAC;AAC5E,CAAC"}