@n1k1t/mock-server 0.1.1 → 0.1.2

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 (350) hide show
  1. package/lib/package.json +3 -2
  2. package/lib/src/client/helpers/expectations.d.ts +91 -0
  3. package/lib/src/client/helpers/expectations.d.ts.map +1 -0
  4. package/lib/src/client/helpers/expectations.js +66 -0
  5. package/lib/src/client/helpers/expectations.js.map +1 -0
  6. package/lib/src/client/helpers/index.d.ts +2 -0
  7. package/lib/src/client/helpers/index.d.ts.map +1 -0
  8. package/lib/src/client/helpers/index.js +18 -0
  9. package/lib/src/client/helpers/index.js.map +1 -0
  10. package/lib/src/client/index.d.ts +1 -0
  11. package/lib/src/client/index.d.ts.map +1 -1
  12. package/lib/src/client/index.js +1 -0
  13. package/lib/src/client/index.js.map +1 -1
  14. package/lib/src/client/methods/expectations.create.method.d.ts +1 -3
  15. package/lib/src/client/methods/expectations.create.method.d.ts.map +1 -1
  16. package/lib/src/client/methods/expectations.create.method.js +2 -2
  17. package/lib/src/client/methods/expectations.create.method.js.map +1 -1
  18. package/lib/src/client/methods/expectations.update.method.d.ts +2 -2
  19. package/lib/src/client/methods/expectations.update.method.js +5 -5
  20. package/lib/src/client/methods/expectations.update.method.js.map +1 -1
  21. package/lib/src/client/methods/ping.method.d.ts +1 -1
  22. package/lib/src/client/methods/ping.method.js.map +1 -1
  23. package/lib/src/client/models/client.d.ts +40 -0
  24. package/lib/src/client/models/client.d.ts.map +1 -0
  25. package/lib/src/client/models/client.js +33 -0
  26. package/lib/src/client/models/client.js.map +1 -0
  27. package/lib/src/client/models/client.spec.d.ts +2 -0
  28. package/lib/src/client/models/client.spec.d.ts.map +1 -0
  29. package/lib/src/client/models/client.spec.js +219 -0
  30. package/lib/src/client/models/client.spec.js.map +1 -0
  31. package/lib/src/client/models/index.d.ts +1 -0
  32. package/lib/src/client/models/index.d.ts.map +1 -1
  33. package/lib/src/client/models/index.js +1 -0
  34. package/lib/src/client/models/index.js.map +1 -1
  35. package/lib/src/client/models/method.d.ts +4 -4
  36. package/lib/src/client/models/method.d.ts.map +1 -1
  37. package/lib/src/client/models/method.js.map +1 -1
  38. package/lib/src/client/onsite.d.ts +4 -3
  39. package/lib/src/client/onsite.d.ts.map +1 -1
  40. package/lib/src/client/onsite.js +8 -6
  41. package/lib/src/client/onsite.js.map +1 -1
  42. package/lib/src/client/remote.d.ts +4 -4
  43. package/lib/src/client/remote.d.ts.map +1 -1
  44. package/lib/src/client/remote.js +11 -10
  45. package/lib/src/client/remote.js.map +1 -1
  46. package/lib/src/client/types.d.ts +2 -0
  47. package/lib/src/client/types.d.ts.map +1 -1
  48. package/lib/src/client/utils.d.ts +2 -2
  49. package/lib/src/client/utils.d.ts.map +1 -1
  50. package/lib/src/client/utils.js +25 -12
  51. package/lib/src/client/utils.js.map +1 -1
  52. package/lib/src/expectations/__utils__/index.d.ts +2 -2
  53. package/lib/src/expectations/__utils__/index.d.ts.map +1 -1
  54. package/lib/src/expectations/__utils__/index.js +31 -23
  55. package/lib/src/expectations/__utils__/index.js.map +1 -1
  56. package/lib/src/expectations/index.d.ts +1 -2
  57. package/lib/src/expectations/index.d.ts.map +1 -1
  58. package/lib/src/expectations/index.js +1 -2
  59. package/lib/src/expectations/index.js.map +1 -1
  60. package/lib/src/expectations/models/expectation.d.ts +35 -0
  61. package/lib/src/expectations/models/expectation.d.ts.map +1 -0
  62. package/lib/src/expectations/models/expectation.js +113 -0
  63. package/lib/src/expectations/models/expectation.js.map +1 -0
  64. package/lib/src/expectations/models/index.d.ts +4 -0
  65. package/lib/src/expectations/models/index.d.ts.map +1 -0
  66. package/lib/src/expectations/models/index.js +20 -0
  67. package/lib/src/expectations/models/index.js.map +1 -0
  68. package/lib/src/expectations/models/operator.d.ts +20 -0
  69. package/lib/src/expectations/models/operator.d.ts.map +1 -0
  70. package/lib/src/expectations/models/operator.js +41 -0
  71. package/lib/src/expectations/models/operator.js.map +1 -0
  72. package/lib/src/expectations/models/storage.d.ts +15 -0
  73. package/lib/src/expectations/models/storage.d.ts.map +1 -0
  74. package/lib/src/expectations/{storage.js → models/storage.js} +4 -14
  75. package/lib/src/expectations/models/storage.js.map +1 -0
  76. package/lib/src/expectations/models/storage.spec.d.ts +2 -0
  77. package/lib/src/expectations/models/storage.spec.d.ts.map +1 -0
  78. package/lib/src/expectations/models/storage.spec.js +111 -0
  79. package/lib/src/expectations/models/storage.spec.js.map +1 -0
  80. package/lib/src/expectations/operators/and.operator.d.ts +7 -2
  81. package/lib/src/expectations/operators/and.operator.d.ts.map +1 -1
  82. package/lib/src/expectations/operators/and.operator.js +21 -2
  83. package/lib/src/expectations/operators/and.operator.js.map +1 -1
  84. package/lib/src/expectations/operators/and.operator.spec.js +57 -39
  85. package/lib/src/expectations/operators/and.operator.spec.js.map +1 -1
  86. package/lib/src/expectations/operators/exec.operator.d.ts +7 -2
  87. package/lib/src/expectations/operators/exec.operator.d.ts.map +1 -1
  88. package/lib/src/expectations/operators/exec.operator.js +13 -18
  89. package/lib/src/expectations/operators/exec.operator.js.map +1 -1
  90. package/lib/src/expectations/operators/exec.operator.spec.js +49 -18
  91. package/lib/src/expectations/operators/exec.operator.spec.js.map +1 -1
  92. package/lib/src/expectations/operators/has.operator.d.ts +27 -2
  93. package/lib/src/expectations/operators/has.operator.d.ts.map +1 -1
  94. package/lib/src/expectations/operators/has.operator.js +106 -70
  95. package/lib/src/expectations/operators/has.operator.js.map +1 -1
  96. package/lib/src/expectations/operators/has.operator.spec.js +422 -161
  97. package/lib/src/expectations/operators/has.operator.spec.js.map +1 -1
  98. package/lib/src/expectations/operators/if.operator.d.ts +15 -2
  99. package/lib/src/expectations/operators/if.operator.d.ts.map +1 -1
  100. package/lib/src/expectations/operators/if.operator.js +44 -10
  101. package/lib/src/expectations/operators/if.operator.js.map +1 -1
  102. package/lib/src/expectations/operators/if.operator.spec.js +89 -65
  103. package/lib/src/expectations/operators/if.operator.spec.js.map +1 -1
  104. package/lib/src/expectations/operators/index.d.ts +2 -0
  105. package/lib/src/expectations/operators/index.d.ts.map +1 -1
  106. package/lib/src/expectations/operators/index.js +5 -1
  107. package/lib/src/expectations/operators/index.js.map +1 -1
  108. package/lib/src/expectations/operators/merge.operator.d.ts +13 -2
  109. package/lib/src/expectations/operators/merge.operator.d.ts.map +1 -1
  110. package/lib/src/expectations/operators/merge.operator.js +23 -19
  111. package/lib/src/expectations/operators/merge.operator.js.map +1 -1
  112. package/lib/src/expectations/operators/merge.operator.spec.js +43 -33
  113. package/lib/src/expectations/operators/merge.operator.spec.js.map +1 -1
  114. package/lib/src/expectations/operators/not.operator.d.ts +7 -2
  115. package/lib/src/expectations/operators/not.operator.d.ts.map +1 -1
  116. package/lib/src/expectations/operators/not.operator.js +21 -2
  117. package/lib/src/expectations/operators/not.operator.js.map +1 -1
  118. package/lib/src/expectations/operators/not.operator.spec.js +28 -9
  119. package/lib/src/expectations/operators/not.operator.spec.js.map +1 -1
  120. package/lib/src/expectations/operators/or.operator.d.ts +7 -2
  121. package/lib/src/expectations/operators/or.operator.d.ts.map +1 -1
  122. package/lib/src/expectations/operators/or.operator.js +21 -6
  123. package/lib/src/expectations/operators/or.operator.js.map +1 -1
  124. package/lib/src/expectations/operators/or.operator.spec.js +58 -39
  125. package/lib/src/expectations/operators/or.operator.spec.js.map +1 -1
  126. package/lib/src/expectations/operators/remove.operator.d.ts +12 -2
  127. package/lib/src/expectations/operators/remove.operator.d.ts.map +1 -1
  128. package/lib/src/expectations/operators/remove.operator.js +22 -17
  129. package/lib/src/expectations/operators/remove.operator.js.map +1 -1
  130. package/lib/src/expectations/operators/remove.operator.spec.js +40 -28
  131. package/lib/src/expectations/operators/remove.operator.spec.js.map +1 -1
  132. package/lib/src/expectations/operators/root.operator.d.ts +8 -0
  133. package/lib/src/expectations/operators/root.operator.d.ts.map +1 -0
  134. package/lib/src/expectations/operators/root.operator.js +36 -0
  135. package/lib/src/expectations/operators/root.operator.js.map +1 -0
  136. package/lib/src/expectations/operators/set.operator.d.ts +20 -2
  137. package/lib/src/expectations/operators/set.operator.d.ts.map +1 -1
  138. package/lib/src/expectations/operators/set.operator.js +40 -23
  139. package/lib/src/expectations/operators/set.operator.js.map +1 -1
  140. package/lib/src/expectations/operators/set.operator.spec.js +87 -43
  141. package/lib/src/expectations/operators/set.operator.spec.js.map +1 -1
  142. package/lib/src/expectations/operators/switch.operator.d.ts +25 -0
  143. package/lib/src/expectations/operators/switch.operator.d.ts.map +1 -0
  144. package/lib/src/expectations/operators/switch.operator.js +68 -0
  145. package/lib/src/expectations/operators/switch.operator.js.map +1 -0
  146. package/lib/src/expectations/operators/switch.operator.spec.d.ts +2 -0
  147. package/lib/src/expectations/operators/switch.operator.spec.d.ts.map +1 -0
  148. package/lib/src/expectations/operators/switch.operator.spec.js +129 -0
  149. package/lib/src/expectations/operators/switch.operator.spec.js.map +1 -0
  150. package/lib/src/expectations/types.d.ts +55 -56
  151. package/lib/src/expectations/types.d.ts.map +1 -1
  152. package/lib/src/expectations/types.js +13 -2
  153. package/lib/src/expectations/types.js.map +1 -1
  154. package/lib/src/expectations/utils.d.ts +19 -7
  155. package/lib/src/expectations/utils.d.ts.map +1 -1
  156. package/lib/src/expectations/utils.js +77 -50
  157. package/lib/src/expectations/utils.js.map +1 -1
  158. package/lib/src/server/endpoints/config.get.endpoint.d.ts +8 -3
  159. package/lib/src/server/endpoints/config.get.endpoint.d.ts.map +1 -1
  160. package/lib/src/server/endpoints/config.get.endpoint.js +2 -4
  161. package/lib/src/server/endpoints/config.get.endpoint.js.map +1 -1
  162. package/lib/src/server/endpoints/expectations.create.endpoint.d.ts +9 -11
  163. package/lib/src/server/endpoints/expectations.create.endpoint.d.ts.map +1 -1
  164. package/lib/src/server/endpoints/expectations.create.endpoint.js +2 -3
  165. package/lib/src/server/endpoints/expectations.create.endpoint.js.map +1 -1
  166. package/lib/src/server/endpoints/expectations.delete.endpoint.d.ts +8 -5
  167. package/lib/src/server/endpoints/expectations.delete.endpoint.d.ts.map +1 -1
  168. package/lib/src/server/endpoints/expectations.delete.endpoint.js +2 -2
  169. package/lib/src/server/endpoints/expectations.delete.endpoint.js.map +1 -1
  170. package/lib/src/server/endpoints/expectations.get-list.endpoint.d.ts +8 -3
  171. package/lib/src/server/endpoints/expectations.get-list.endpoint.d.ts.map +1 -1
  172. package/lib/src/server/endpoints/expectations.get-list.endpoint.js +2 -2
  173. package/lib/src/server/endpoints/expectations.get-list.endpoint.js.map +1 -1
  174. package/lib/src/server/endpoints/expectations.update.endpoint.d.ts +13 -11
  175. package/lib/src/server/endpoints/expectations.update.endpoint.d.ts.map +1 -1
  176. package/lib/src/server/endpoints/expectations.update.endpoint.js +4 -6
  177. package/lib/src/server/endpoints/expectations.update.endpoint.js.map +1 -1
  178. package/lib/src/server/endpoints/history.get-list.endpoint.d.ts +27 -0
  179. package/lib/src/server/endpoints/history.get-list.endpoint.d.ts.map +1 -0
  180. package/lib/src/server/endpoints/history.get-list.endpoint.js +11 -0
  181. package/lib/src/server/endpoints/history.get-list.endpoint.js.map +1 -0
  182. package/lib/src/server/endpoints/index.d.ts +1 -1
  183. package/lib/src/server/endpoints/index.d.ts.map +1 -1
  184. package/lib/src/server/endpoints/index.js +3 -3
  185. package/lib/src/server/endpoints/index.js.map +1 -1
  186. package/lib/src/server/endpoints/ping.endpoint.d.ts +8 -3
  187. package/lib/src/server/endpoints/ping.endpoint.d.ts.map +1 -1
  188. package/lib/src/server/endpoints/ping.endpoint.js +1 -1
  189. package/lib/src/server/endpoints/ping.endpoint.js.map +1 -1
  190. package/lib/src/server/history/model.d.ts +16 -16
  191. package/lib/src/server/history/model.d.ts.map +1 -1
  192. package/lib/src/server/history/model.js +21 -6
  193. package/lib/src/server/history/model.js.map +1 -1
  194. package/lib/src/server/history/storage.d.ts +3 -4
  195. package/lib/src/server/history/storage.d.ts.map +1 -1
  196. package/lib/src/server/history/storage.js +2 -2
  197. package/lib/src/server/history/storage.js.map +1 -1
  198. package/lib/src/server/index.d.ts +10 -6
  199. package/lib/src/server/index.d.ts.map +1 -1
  200. package/lib/src/server/index.js +9 -18
  201. package/lib/src/server/index.js.map +1 -1
  202. package/lib/src/server/middlewares/add-history.middleware.d.ts +14 -4
  203. package/lib/src/server/middlewares/add-history.middleware.d.ts.map +1 -1
  204. package/lib/src/server/middlewares/add-history.middleware.js +5 -6
  205. package/lib/src/server/middlewares/add-history.middleware.js.map +1 -1
  206. package/lib/src/server/middlewares/destroy-request.midleware.d.ts +14 -4
  207. package/lib/src/server/middlewares/destroy-request.midleware.d.ts.map +1 -1
  208. package/lib/src/server/middlewares/destroy-request.midleware.js +4 -5
  209. package/lib/src/server/middlewares/destroy-request.midleware.js.map +1 -1
  210. package/lib/src/server/middlewares/handle-expectation-delay.middleware.d.ts +14 -4
  211. package/lib/src/server/middlewares/handle-expectation-delay.middleware.d.ts.map +1 -1
  212. package/lib/src/server/middlewares/handle-expectation-delay.middleware.js +1 -2
  213. package/lib/src/server/middlewares/handle-expectation-delay.middleware.js.map +1 -1
  214. package/lib/src/server/middlewares/handle-expectation-forward.middleware.d.ts +14 -4
  215. package/lib/src/server/middlewares/handle-expectation-forward.middleware.d.ts.map +1 -1
  216. package/lib/src/server/middlewares/handle-expectation-forward.middleware.js +31 -45
  217. package/lib/src/server/middlewares/handle-expectation-forward.middleware.js.map +1 -1
  218. package/lib/src/server/middlewares/index.d.ts +4 -4
  219. package/lib/src/server/middlewares/index.d.ts.map +1 -1
  220. package/lib/src/server/middlewares/index.js +9 -9
  221. package/lib/src/server/middlewares/index.js.map +1 -1
  222. package/lib/src/server/middlewares/internal-route.middleware.d.ts +14 -2
  223. package/lib/src/server/middlewares/internal-route.middleware.d.ts.map +1 -1
  224. package/lib/src/server/middlewares/internal-route.middleware.js +4 -3
  225. package/lib/src/server/middlewares/internal-route.middleware.js.map +1 -1
  226. package/lib/src/server/middlewares/match-expectation.middleware.d.ts +18 -0
  227. package/lib/src/server/middlewares/match-expectation.middleware.d.ts.map +1 -0
  228. package/lib/src/server/middlewares/match-expectation.middleware.js +20 -0
  229. package/lib/src/server/middlewares/match-expectation.middleware.js.map +1 -0
  230. package/lib/src/server/middlewares/reply.middleware.d.ts +15 -5
  231. package/lib/src/server/middlewares/reply.middleware.d.ts.map +1 -1
  232. package/lib/src/server/middlewares/reply.middleware.js +34 -25
  233. package/lib/src/server/middlewares/reply.middleware.js.map +1 -1
  234. package/lib/src/server/middlewares/resolve-public.middleware.d.ts +14 -2
  235. package/lib/src/server/middlewares/resolve-public.middleware.d.ts.map +1 -1
  236. package/lib/src/server/middlewares/resolve-public.middleware.js +11 -11
  237. package/lib/src/server/middlewares/resolve-public.middleware.js.map +1 -1
  238. package/lib/src/server/models/endpoint.d.ts +19 -13
  239. package/lib/src/server/models/endpoint.d.ts.map +1 -1
  240. package/lib/src/server/models/endpoint.js +2 -2
  241. package/lib/src/server/models/endpoint.js.map +1 -1
  242. package/lib/src/server/models/middleware.d.ts +18 -20
  243. package/lib/src/server/models/middleware.d.ts.map +1 -1
  244. package/lib/src/server/models/middleware.js +6 -10
  245. package/lib/src/server/models/middleware.js.map +1 -1
  246. package/lib/src/server/models/reply-service/index.d.ts +6 -6
  247. package/lib/src/server/models/reply-service/index.d.ts.map +1 -1
  248. package/lib/src/server/models/reply-service/index.js +24 -24
  249. package/lib/src/server/models/reply-service/index.js.map +1 -1
  250. package/lib/src/server/models/request-context/http.d.ts +42 -0
  251. package/lib/src/server/models/request-context/http.d.ts.map +1 -0
  252. package/lib/src/server/models/request-context/http.js +51 -0
  253. package/lib/src/server/models/request-context/http.js.map +1 -0
  254. package/lib/src/server/models/request-context/index.d.ts +4 -57
  255. package/lib/src/server/models/request-context/index.d.ts.map +1 -1
  256. package/lib/src/server/models/request-context/index.js +4 -57
  257. package/lib/src/server/models/request-context/index.js.map +1 -1
  258. package/lib/src/server/models/request-context/model.d.ts +13 -0
  259. package/lib/src/server/models/request-context/model.d.ts.map +1 -0
  260. package/lib/src/server/models/request-context/model.js +14 -0
  261. package/lib/src/server/models/request-context/model.js.map +1 -0
  262. package/lib/src/server/models/request-context/types.d.ts +14 -18
  263. package/lib/src/server/models/request-context/types.d.ts.map +1 -1
  264. package/lib/src/server/models/request-context/utils.d.ts +7 -3
  265. package/lib/src/server/models/request-context/utils.d.ts.map +1 -1
  266. package/lib/src/server/models/request-context/utils.js +48 -25
  267. package/lib/src/server/models/request-context/utils.js.map +1 -1
  268. package/lib/src/server/models/request-context/ws.d.ts +21 -0
  269. package/lib/src/server/models/request-context/ws.d.ts.map +1 -0
  270. package/lib/src/server/models/request-context/ws.js +22 -0
  271. package/lib/src/server/models/request-context/ws.js.map +1 -0
  272. package/lib/src/server/models/server-context.d.ts +4 -4
  273. package/lib/src/server/models/server-context.d.ts.map +1 -1
  274. package/lib/src/server/models/server-context.js +5 -5
  275. package/lib/src/server/models/server-context.js.map +1 -1
  276. package/lib/src/server/router.d.ts +4 -7
  277. package/lib/src/server/router.d.ts.map +1 -1
  278. package/lib/src/server/router.js +5 -12
  279. package/lib/src/server/router.js.map +1 -1
  280. package/lib/src/server/ws-exchange/index.d.ts +5 -0
  281. package/lib/src/server/ws-exchange/index.d.ts.map +1 -0
  282. package/lib/src/server/{web-socket-exchange → ws-exchange}/index.js +3 -3
  283. package/lib/src/server/ws-exchange/index.js.map +1 -0
  284. package/lib/src/server/ws-exchange/types.d.ts +12 -0
  285. package/lib/src/server/ws-exchange/types.d.ts.map +1 -0
  286. package/lib/src/server/ws-exchange/types.js.map +1 -0
  287. package/lib/src/types.d.ts +0 -1
  288. package/lib/src/types.d.ts.map +1 -1
  289. package/lib/src/utils/index.d.ts +1 -0
  290. package/lib/src/utils/index.d.ts.map +1 -1
  291. package/lib/src/utils/index.js +1 -0
  292. package/lib/src/utils/index.js.map +1 -1
  293. package/lib/src/utils/json.d.ts +1 -1
  294. package/lib/src/utils/json.d.ts.map +1 -1
  295. package/lib/src/utils/json.js +3 -3
  296. package/lib/src/utils/json.js.map +1 -1
  297. package/lib/src/utils/regexp.d.ts +2 -0
  298. package/lib/src/utils/regexp.d.ts.map +1 -0
  299. package/lib/src/utils/regexp.js +9 -0
  300. package/lib/src/utils/regexp.js.map +1 -0
  301. package/lib/test/index.js +105 -137
  302. package/lib/test/index.js.map +1 -1
  303. package/lib/tsconfig.tsbuildinfo +1 -1
  304. package/lib/types/common.global.d.ts +13 -6
  305. package/lib/types/common.global.d.ts.map +1 -1
  306. package/lib/types/lib.d.ts +1 -0
  307. package/lib/types/lib.d.ts.map +1 -1
  308. package/lib/types/lib.js +1 -0
  309. package/lib/types/lib.js.map +1 -1
  310. package/package.json +3 -2
  311. package/types/common.global.ts +21 -2
  312. package/types/lib.ts +1 -0
  313. package/lib/src/expectations/model.d.ts +0 -39
  314. package/lib/src/expectations/model.d.ts.map +0 -1
  315. package/lib/src/expectations/model.js +0 -90
  316. package/lib/src/expectations/model.js.map +0 -1
  317. package/lib/src/expectations/operators/utils.d.ts +0 -20
  318. package/lib/src/expectations/operators/utils.d.ts.map +0 -1
  319. package/lib/src/expectations/operators/utils.js +0 -67
  320. package/lib/src/expectations/operators/utils.js.map +0 -1
  321. package/lib/src/expectations/storage.d.ts +0 -19
  322. package/lib/src/expectations/storage.d.ts.map +0 -1
  323. package/lib/src/expectations/storage.js.map +0 -1
  324. package/lib/src/expectations/utils.spec.d.ts +0 -2
  325. package/lib/src/expectations/utils.spec.d.ts.map +0 -1
  326. package/lib/src/expectations/utils.spec.js +0 -59
  327. package/lib/src/expectations/utils.spec.js.map +0 -1
  328. package/lib/src/expectations/validation-schemas.d.ts +0 -14
  329. package/lib/src/expectations/validation-schemas.d.ts.map +0 -1
  330. package/lib/src/expectations/validation-schemas.js +0 -36
  331. package/lib/src/expectations/validation-schemas.js.map +0 -1
  332. package/lib/src/server/endpoints/history-records.get-list.endpoint.d.ts +0 -16
  333. package/lib/src/server/endpoints/history-records.get-list.endpoint.d.ts.map +0 -1
  334. package/lib/src/server/endpoints/history-records.get-list.endpoint.js +0 -9
  335. package/lib/src/server/endpoints/history-records.get-list.endpoint.js.map +0 -1
  336. package/lib/src/server/middlewares/validate-expectation-request.middleware.d.ts +0 -6
  337. package/lib/src/server/middlewares/validate-expectation-request.middleware.d.ts.map +0 -1
  338. package/lib/src/server/middlewares/validate-expectation-request.middleware.js +0 -20
  339. package/lib/src/server/middlewares/validate-expectation-request.middleware.js.map +0 -1
  340. package/lib/src/server/types.d.ts +0 -6
  341. package/lib/src/server/types.d.ts.map +0 -1
  342. package/lib/src/server/types.js.map +0 -1
  343. package/lib/src/server/web-socket-exchange/index.d.ts +0 -5
  344. package/lib/src/server/web-socket-exchange/index.d.ts.map +0 -1
  345. package/lib/src/server/web-socket-exchange/index.js.map +0 -1
  346. package/lib/src/server/web-socket-exchange/types.d.ts +0 -12
  347. package/lib/src/server/web-socket-exchange/types.d.ts.map +0 -1
  348. package/lib/src/server/web-socket-exchange/types.js +0 -3
  349. package/lib/src/server/web-socket-exchange/types.js.map +0 -1
  350. /package/lib/src/server/{types.js → ws-exchange/types.js} +0 -0
@@ -1,13 +1,24 @@
1
+ import type { AxiosProxyConfig } from 'axios';
1
2
  import type _ from 'lodash';
2
- import type { IRequestPlainContext, IResponsePlainContext } from '../server/models';
3
+ import type { HttpRequestContext } from '../server/models';
4
+ import type { TRequestProtocol } from '../types';
5
+ import type * as operators from './operators';
6
+ import type AndExpectationOperator from './operators/and.operator';
7
+ import type SetExpectationOperator from './operators/set.operator';
8
+ import type HasExpectationOperator from './operators/has.operator';
9
+ import type OrExpectationOperator from './operators/or.operator';
10
+ import type NotExpectationOperator from './operators/not.operator';
11
+ import type IfExpectationOperator from './operators/if.operator';
12
+ import type MergeExpectationOperator from './operators/merge.operator';
13
+ import type RemoveExpectationOperator from './operators/remove.operator';
14
+ import type ExecExpectationOperator from './operators/exec.operator';
15
+ import type SwitchExpectationOperator from './operators/switch.operator';
3
16
  export type TExpectationType = ConvertTupleToUnion<typeof LExpectationType>;
4
17
  export declare const LExpectationType: readonly ["HTTP"];
5
18
  export type TExpectationForwardProtocol = ConvertTupleToUnion<typeof LExpectationForwardProtocol>;
6
19
  export declare const LExpectationForwardProtocol: readonly ["HTTP", "HTTPS"];
7
20
  export type TExpectationDestroyType = ConvertTupleToUnion<typeof LExpectationDestroyType>;
8
21
  export declare const LExpectationDestroyType: readonly ["ECONNABORTED"];
9
- export type TExpectationOperatorLocation = ConvertTupleToUnion<typeof LExpectationOperatorLocation>;
10
- export declare const LExpectationOperatorLocation: readonly ["path", "method", "headers", "body", "query", "data", "statusCode"];
11
22
  export type TExpectationConditionalOperator = ConvertTupleToUnion<typeof LExpectationConditionalOperator>;
12
23
  export declare const LExpectationConditionalOperator: readonly ["$if", "$not", "$and", "$or", "$has"];
13
24
  export type TExpectationActionalOperator = ConvertTupleToUnion<typeof LExpectationActionalOperator>;
@@ -27,61 +38,49 @@ export interface IExpectationDelay {
27
38
  times?: number;
28
39
  }
29
40
  export type TExpectationContextLocation = 'request' | 'response';
30
- export type TExpectationContext<TLocation extends TExpectationContextLocation = TExpectationContextLocation> = {
31
- request: IRequestPlainContext;
32
- response: IRequestPlainContext & IResponsePlainContext;
33
- }[TLocation];
34
- export type TExpectationOperatorMode = 'validation' | 'manipulation';
35
- export type TExpectationOperatorHandlerParameters<K extends TExpectationOperator = TExpectationOperator> = [
36
- TExpectationOperatorMode,
37
- NonNullable<IExpectationSchema[K]>,
38
- TExpectationContext
39
- ];
40
- export type TExpectationOperatorHandler<K extends TExpectationOperator = TExpectationOperator> = TFunction<boolean, [
41
- ...TExpectationOperatorHandlerParameters<K>,
42
- {
43
- exploreNestedSchema: TFunction<boolean, TExpectationOperatorHandlerParameters>;
44
- }
45
- ]>;
46
- export type TExpectationOperator = TExpectationConditionalOperator | TExpectationActionalOperator;
47
- export type TExpectationTargetionalValidationOperator = keyof IExpectationTargetionalSchema;
48
- export type TExpectationTargetionalManipulationOperator = '$location' | '$path' | '$jsonPath' | '$value';
49
- export type TExpectationTargetionalOperator = TExpectationTargetionalValidationOperator | TExpectationTargetionalManipulationOperator;
50
- export interface IExpectationTargetionalSchema<TLocation extends TExpectationOperatorLocation = TExpectationOperatorLocation> {
51
- $location?: TLocation;
52
- $path?: string;
53
- $jsonPath?: string;
54
- $regExp?: RegExp;
55
- $regExpAnyOf?: RegExp[];
56
- $value?: unknown;
57
- $valueAnyOf?: unknown[];
58
- $minimatch?: string;
59
- $minimatchAnyOf?: string[];
41
+ export type TExpectationOperatorLocation = ConvertTupleToUnion<typeof LExpectationOperatorLocation>;
42
+ export declare const LExpectationOperatorLocation: readonly ["path", "method", "incoming.body", "incoming.bodyRaw", "incoming.query", "incoming.headers", "outgoing.status", "outgoing.headers", "outgoing.data", "outgoing.dataRaw"];
43
+ export type TExpectationOperators = Omit<typeof operators, 'root'>;
44
+ export interface IExpectationOperatorContext extends Pick<HttpRequestContext, 'incoming' | 'outgoing'> {
60
45
  }
61
- export interface IExpectationSchemaConfiguration {
62
- operator: TExpectationOperator;
63
- context: TExpectationContext;
64
- targetionalValidationOperator: TExpectationTargetionalValidationOperator;
65
- targetionalManipulationOperator: TExpectationTargetionalManipulationOperator;
66
- validationLocation: TExpectationOperatorLocation;
67
- manipulationLocation: TExpectationOperatorLocation;
46
+ type ConvertExpectationLocationToContextPath<TLocation extends TExpectationOperatorLocation> = TLocation extends 'path' | 'method' ? {
47
+ path: 'incoming.path';
48
+ method: 'incoming.method';
49
+ }[TLocation] : TLocation;
50
+ export type ExtractExpectationContextValueByLocation<TContext extends object, TLocation extends TExpectationOperatorLocation, T = ExtractObjectValueByPath<TContext, ConvertExpectationLocationToContextPath<TLocation>>, U = ExtractObjectValueByPath<IExpectationOperatorContext, ConvertExpectationLocationToContextPath<TLocation>>> = Exclude<T, never> extends never ? Exclude<U, never> extends never ? any : U : T;
51
+ export type ExtractExpectationContextValue<TContext extends PartialDeep<IExpectationOperatorContext>, TLocation extends TExpectationOperatorLocation, TPath extends string | void = void, T = ExtractExpectationContextValueByLocation<TContext, TLocation>, U = TPath extends string ? T extends object ? ExtractObjectValueByPath<T, TPath> : any : T> = Exclude<U, never> extends never ? any : U;
52
+ export type CompileExpectationOperatorValue<TContext extends PartialDeep<IExpectationOperatorContext>, TLocation extends TExpectationOperatorLocation, TProvided = void, T = ExtractExpectationContextValue<TContext, TLocation>> = Exclude<TProvided, void> extends never ? T : TProvided;
53
+ export type CompileExpectationOperatorValueWithPredicate<TContext extends PartialDeep<IExpectationOperatorContext>, TLocation extends TExpectationOperatorLocation, TProvided = void, T = CompileExpectationOperatorValue<TContext, TLocation, TProvided>> = T extends object ? (T | object) : T;
54
+ export interface IExpectationOperatorsSchema<TContext extends PartialDeep<IExpectationOperatorContext> = IExpectationOperatorContext, TLocation extends TExpectationOperatorLocation = TExpectationOperatorLocation, TValue = void> {
55
+ $and?: AndExpectationOperator<TContext, TLocation, TValue>['TSchema'];
56
+ $or?: OrExpectationOperator<TContext, TLocation, TValue>['TSchema'];
57
+ $not?: NotExpectationOperator<TContext, TLocation, TValue>['TSchema'];
58
+ $if?: IfExpectationOperator<TContext, TLocation, TValue>['TSchema'];
59
+ $switch?: SwitchExpectationOperator<TContext, TLocation, TValue, TLocation, TValue>['TSchema'];
60
+ $set?: SetExpectationOperator<TContext, TLocation, TValue>['TSchema'];
61
+ $has?: HasExpectationOperator<TContext, TLocation, TValue>['TSchema'];
62
+ $merge?: MergeExpectationOperator<TContext, TLocation, TValue>['TSchema'];
63
+ $remove?: RemoveExpectationOperator<TContext, TLocation>['TSchema'];
64
+ $exec?: ExecExpectationOperator<TContext>['TSchema'];
68
65
  }
69
- export interface IExpectationSchema<T extends IExpectationSchemaConfiguration = IExpectationSchemaConfiguration> {
70
- $has?: Pick<IExpectationTargetionalSchema<T['validationLocation']>, Extract<T['targetionalValidationOperator'], TExpectationTargetionalValidationOperator>>;
71
- $set?: Pick<IExpectationTargetionalSchema<T['manipulationLocation']>, Extract<T['targetionalManipulationOperator'], TExpectationTargetionalManipulationOperator>>;
72
- $remove?: Pick<IExpectationTargetionalSchema<T['manipulationLocation']>, Extract<T['targetionalManipulationOperator'], TExpectationTargetionalManipulationOperator>>;
73
- $merge?: Pick<IExpectationTargetionalSchema<T['manipulationLocation']>, Extract<T['targetionalManipulationOperator'], TExpectationTargetionalManipulationOperator>>;
74
- $if?: IExpectationSchema<T> & {
75
- $then?: Pick<IExpectationSchema<T>, T['operator']>;
76
- $else?: Pick<IExpectationSchema<T>, T['operator']>;
66
+ export interface IExpectationSchema<TContext extends PartialDeep<IExpectationOperatorContext> = {}> {
67
+ delay?: IExpectationDelay | IExpectationDelay[];
68
+ destroy?: 'ECONNABORTED';
69
+ request?: IExpectationOperatorsSchema<TContext, 'path' | 'method' | 'incoming.body' | 'incoming.bodyRaw' | 'incoming.query' | 'incoming.headers'>;
70
+ response?: IExpectationOperatorsSchema<TContext>;
71
+ forward?: {
72
+ url?: string;
73
+ baseUrl?: string;
74
+ timeout?: number;
75
+ proxy?: AxiosProxyConfig & {
76
+ protocol: TRequestProtocol;
77
+ };
77
78
  };
78
- $not?: Pick<IExpectationSchema<T>, T['operator']>;
79
- $and?: Pick<IExpectationSchema<T>, T['operator']>[];
80
- $or?: Pick<IExpectationSchema<T>, T['operator']>[];
81
- $exec?: string | TFunction<unknown, [{
82
- _: typeof _;
83
- context: T['context'];
84
- }]>;
85
79
  }
86
- export type BuildExpectaionSchema<TConfiguration extends Partial<IExpectationSchemaConfiguration>, U extends IExpectationSchemaConfiguration = IExpectationSchemaConfiguration & TConfiguration> = Pick<IExpectationSchema<U>, U['operator']>;
80
+ export interface IExpectationOperatorExecUtils<T extends PartialDeep<IExpectationOperatorContext>> {
81
+ context: IExpectationOperatorContext & T;
82
+ T: <T = any>(payload: unknown) => T;
83
+ _: typeof _;
84
+ }
85
+ export {};
87
86
  //# sourceMappingURL=types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/expectations/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAC5B,OAAO,KAAK,EAAE,oBAAoB,EAAE,qBAAqB,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CAAC;QACjB,KAAK,CAAC,EAAE,gBAAgB,GAAG;YACzB,QAAQ,EAAE,gBAAgB,CAAC;SAC5B,CAAC;KACH,CAAC;CACH;AAED,MAAM,WAAW,6BAA6B,CAAC,CAAC,SAAS,WAAW,CAAC,2BAA2B,CAAC;IAC/F,OAAO,EAAE,2BAA2B,GAAG,CAAC,CAAC;IAEzC,CAAC,EAAE,CAAC,CAAC,GAAG,GAAG,EAAE,OAAO,EAAE,OAAO,KAAK,CAAC,CAAC;IACpC,CAAC,EAAE,OAAO,CAAC,CAAC;CACb"}
@@ -1,15 +1,26 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.LExpectationAttachlessOperator = exports.LExpectationActionalOperator = exports.LExpectationConditionalOperator = exports.LExpectationOperatorLocation = exports.LExpectationDestroyType = exports.LExpectationForwardProtocol = exports.LExpectationType = void 0;
3
+ exports.LExpectationOperatorLocation = exports.LExpectationAttachlessOperator = exports.LExpectationActionalOperator = exports.LExpectationConditionalOperator = exports.LExpectationDestroyType = exports.LExpectationForwardProtocol = exports.LExpectationType = void 0;
4
4
  exports.LExpectationType = ['HTTP'];
5
5
  exports.LExpectationForwardProtocol = ['HTTP', 'HTTPS'];
6
6
  exports.LExpectationDestroyType = ['ECONNABORTED'];
7
- exports.LExpectationOperatorLocation = ['path', 'method', 'headers', 'body', 'query', 'data', 'statusCode'];
8
7
  exports.LExpectationConditionalOperator = ['$if', '$not', '$and', '$or', '$has'];
9
8
  exports.LExpectationActionalOperator = ['$set', '$remove', '$merge', '$exec'];
10
9
  exports.LExpectationAttachlessOperator = [...exports.LExpectationActionalOperator, '$has'];
11
10
  ;
12
11
  ;
12
+ exports.LExpectationOperatorLocation = [
13
+ 'path',
14
+ 'method',
15
+ 'incoming.body',
16
+ 'incoming.bodyRaw',
17
+ 'incoming.query',
18
+ 'incoming.headers',
19
+ 'outgoing.status',
20
+ 'outgoing.headers',
21
+ 'outgoing.data',
22
+ 'outgoing.dataRaw',
23
+ ];
13
24
  ;
14
25
  ;
15
26
  ;
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/expectations/types.ts"],"names":[],"mappings":";;;AAIa,QAAA,gBAAgB,GAAU,CAAC,MAAM,CAAC,CAAC;AAGnC,QAAA,2BAA2B,GAAU,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AAGvD,QAAA,uBAAuB,GAAU,CAAC,cAAc,CAAC,CAAC;AAGlD,QAAA,4BAA4B,GAAU,CAAC,MAAM,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,YAAY,CAAC,CAAC;AAG3G,QAAA,+BAA+B,GAAU,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,CAAC,CAAC;AAGhF,QAAA,4BAA4B,GAAU,CAAC,MAAM,EAAE,SAAS,EAAE,QAAQ,EAAE,OAAO,CAAC,CAAC;AAG7E,QAAA,8BAA8B,GAAU,CAAC,GAAG,oCAA4B,EAAE,MAAM,CAAC,CAAC;AAU9F,CAAC;AAKD,CAAC;AAsDD,CAAC;AAWD,CAAC;AAmCD,CAAC"}
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/expectations/types.ts"],"names":[],"mappings":";;;AAoBa,QAAA,gBAAgB,GAAU,CAAC,MAAM,CAAC,CAAC;AAGnC,QAAA,2BAA2B,GAAU,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AAGvD,QAAA,uBAAuB,GAAU,CAAC,cAAc,CAAC,CAAC;AAGlD,QAAA,+BAA+B,GAAU,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,CAAC,CAAC;AAGhF,QAAA,4BAA4B,GAAU,CAAC,MAAM,EAAE,SAAS,EAAE,QAAQ,EAAE,OAAO,CAAC,CAAC;AAG7E,QAAA,8BAA8B,GAAU,CAAC,GAAG,oCAA4B,EAAE,MAAM,CAAC,CAAC;AAU9F,CAAC;AAKD,CAAC;AAKW,QAAA,4BAA4B,GAAU;IACjD,MAAM;IACN,QAAQ;IACR,eAAe;IACf,kBAAkB;IAClB,gBAAgB;IAChB,kBAAkB;IAClB,iBAAiB;IACjB,kBAAkB;IAClB,eAAe;IACf,kBAAkB;CACnB,CAAA;AAGwG,CAAC;AAoDzG,CAAC;AAsBD,CAAC"}
@@ -1,12 +1,24 @@
1
- import { IExpectationSchema, TExpectationOperatorHandlerParameters, TExpectationOperator } from './types';
2
- export declare const exploreNestedExpectationSchema: TFunction<boolean, TExpectationOperatorHandlerParameters>;
3
- export declare const introspectExpectationSchema: <T extends object = IExpectationSchema<import("./types").IExpectationSchemaConfiguration> & {
4
- $then?: Pick<IExpectationSchema<import("./types").IExpectationSchemaConfiguration>, TExpectationOperator> | undefined;
5
- $else?: Pick<IExpectationSchema<import("./types").IExpectationSchemaConfiguration>, TExpectationOperator> | undefined;
6
- }, K extends keyof T = keyof T>(schema: T, handler: (key: K, schema: T) => unknown) => void;
7
- export declare const extractMetaAdditionalFromExpectationSchema: (schema: IExpectationSchema) => {
1
+ import { IExpectationSchema, IExpectationOperatorContext, IExpectationOperatorsSchema, TExpectationOperatorLocation } from './types';
2
+ type TBaseExtractedContext = {
3
+ parent: object;
4
+ key: string;
5
+ };
6
+ type TExtractedContext = (TBaseExtractedContext & {
7
+ value: object;
8
+ type: 'object';
9
+ }) | (TBaseExtractedContext & {
10
+ value: string;
11
+ type: 'string';
12
+ }) | (TBaseExtractedContext & {
13
+ value: number;
14
+ type: 'number';
15
+ });
16
+ export declare const extractContextByLocation: (location: TExpectationOperatorLocation, context: PartialDeep<IExpectationOperatorContext>) => TExtractedContext | null;
17
+ export declare const introspectExpectationOperatorsSchema: <T extends object = IExpectationSchema<{}>, K extends keyof T = keyof T>(schema: T, handler: (key: K, schema: T, path: string) => unknown, location?: string) => void;
18
+ export declare const extractMetaAdditionalFromExpectationSchema: (schema: IExpectationOperatorsSchema) => {
8
19
  requestPaths?: string[];
9
20
  requestMethods?: string[];
10
21
  responseStatuses?: number[];
11
22
  };
23
+ export {};
12
24
  //# sourceMappingURL=utils.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/expectations/utils.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,kBAAkB,EAElB,qCAAqC,EACrC,oBAAoB,EAKrB,MAAM,SAAS,CAAC;AAMjB,eAAO,MAAM,8BAA8B,EAAE,SAAS,CAAC,OAAO,EAAE,qCAAqC,CA2BlG,CAAA;AAEH,eAAO,MAAM,2BAA2B,GACtC,CAAC,SAAS,MAAM;;;GAChB,CAAC,SAAS,MAAM,CAAC,oBACT,CAAC,WAAW,CAAC,GAAG,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,KAAK,OAAO,KAAG,IAQtD,CAAA;AAED,eAAO,MAAM,0CAA0C,WAAY,kBAAkB;;;;CA+BpF,CAAA"}
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/expectations/utils.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,kBAAkB,EAIlB,2BAA2B,EAC3B,2BAA2B,EAC3B,4BAA4B,EAE7B,MAAM,SAAS,CAAC;AAEjB,KAAK,qBAAqB,GAAG;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAA;CAAE,CAAC;AAC7D,KAAK,iBAAiB,GAClB,CAAC,qBAAqB,GAAG;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,QAAQ,CAAA;CAAE,CAAC,GAC3D,CAAC,qBAAqB,GAAG;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,QAAQ,CAAA;CAAE,CAAC,GAC3D,CAAC,qBAAqB,GAAG;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,QAAQ,CAAA;CAAE,CAAC,CAAC;AAEhE,eAAO,MAAM,wBAAwB,aACzB,4BAA4B,WAC7B,WAAW,CAAC,2BAA2B,CAAC,KAChD,iBAAiB,GAAG,IA8EtB,CAAA;AAED,eAAO,MAAM,oCAAoC,GAAI,CAAC,SAAS,MAAM,2BAAuB,CAAC,SAAS,MAAM,CAAC,oBACnG,CAAC,WACA,CAAC,GAAG,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,KAAK,OAAO,aAC3C,MAAM,KACf,IAUF,CAAA;AAED,eAAO,MAAM,0CAA0C,WAAY,2BAA2B;;;;CA+B7F,CAAA"}
@@ -1,74 +1,101 @@
1
1
  "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
25
2
  var __importDefault = (this && this.__importDefault) || function (mod) {
26
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
27
4
  };
28
5
  Object.defineProperty(exports, "__esModule", { value: true });
29
- exports.extractMetaAdditionalFromExpectationSchema = exports.introspectExpectationSchema = exports.exploreNestedExpectationSchema = void 0;
6
+ exports.extractMetaAdditionalFromExpectationSchema = exports.introspectExpectationOperatorsSchema = exports.extractContextByLocation = void 0;
30
7
  const lodash_1 = __importDefault(require("lodash"));
31
8
  const types_1 = require("./types");
32
- const operators = __importStar(require("./operators"));
33
- const exploreNestedExpectationSchema = (mode, schema, context) => {
34
- switch (mode) {
35
- case 'validation': {
36
- if (Object.keys(schema).length === 0) {
37
- return true;
38
- }
39
- return Object.entries(schema).some(([operator, configuration]) => operators[operator](mode, configuration, context, {
40
- exploreNestedSchema: exports.exploreNestedExpectationSchema,
41
- }));
42
- }
43
- case 'manipulation': {
44
- Object.entries(schema).forEach(([operator, configuration]) => operators[operator](mode, configuration, context, {
45
- exploreNestedSchema: exports.exploreNestedExpectationSchema,
46
- }));
47
- return true;
48
- }
9
+ const extractContextByLocation = (location, context) => {
10
+ if (!lodash_1.default.has(context, location) && location !== 'method' && location !== 'path') {
11
+ return null;
12
+ }
13
+ switch (location) {
14
+ case 'path': return {
15
+ key: 'path',
16
+ type: 'string',
17
+ parent: context.incoming,
18
+ value: context.incoming.path,
19
+ };
20
+ case 'method': return {
21
+ key: 'method',
22
+ type: 'string',
23
+ parent: context.incoming,
24
+ value: context.incoming.method,
25
+ };
26
+ case 'incoming.body': return {
27
+ key: 'body',
28
+ type: 'object',
29
+ parent: context.incoming,
30
+ value: context.incoming.body,
31
+ };
32
+ case 'incoming.bodyRaw': return {
33
+ key: 'bodyRaw',
34
+ type: 'string',
35
+ parent: context.incoming,
36
+ value: context.incoming.bodyRaw,
37
+ };
38
+ case 'incoming.query': return {
39
+ key: 'query',
40
+ type: 'object',
41
+ parent: context.incoming,
42
+ value: context.incoming.query,
43
+ };
44
+ case 'incoming.headers': return {
45
+ key: 'headers',
46
+ type: 'object',
47
+ parent: context.incoming,
48
+ value: context.incoming.headers,
49
+ };
50
+ case 'outgoing.data': return {
51
+ key: 'data',
52
+ type: 'object',
53
+ parent: context.outgoing,
54
+ value: context.outgoing.data,
55
+ };
56
+ case 'outgoing.dataRaw': return {
57
+ key: 'dataRaw',
58
+ type: 'string',
59
+ parent: context.outgoing,
60
+ value: context.outgoing.dataRaw,
61
+ };
62
+ case 'outgoing.headers': return {
63
+ key: 'headers',
64
+ type: 'object',
65
+ parent: context.outgoing,
66
+ value: context.outgoing.headers,
67
+ };
68
+ case 'outgoing.status': return {
69
+ key: 'status',
70
+ type: 'number',
71
+ parent: context.outgoing,
72
+ value: context.outgoing.status,
73
+ };
74
+ default: return null;
49
75
  }
50
76
  };
51
- exports.exploreNestedExpectationSchema = exploreNestedExpectationSchema;
52
- const introspectExpectationSchema = (schema, handler) => {
77
+ exports.extractContextByLocation = extractContextByLocation;
78
+ const introspectExpectationOperatorsSchema = (schema, handler, location = '') => {
53
79
  Object.keys(schema).forEach((key) => {
54
- handler(key, schema);
80
+ const path = location ? `${location}.${String(key)}` : String(key);
81
+ handler(key, schema, path);
55
82
  if (lodash_1.default.isObject(schema[key]) && !types_1.LExpectationAttachlessOperator.includes(key)) {
56
- (0, exports.introspectExpectationSchema)(schema[key], handler);
83
+ (0, exports.introspectExpectationOperatorsSchema)(schema[key], handler, path);
57
84
  }
58
85
  });
59
86
  };
60
- exports.introspectExpectationSchema = introspectExpectationSchema;
87
+ exports.introspectExpectationOperatorsSchema = introspectExpectationOperatorsSchema;
61
88
  const extractMetaAdditionalFromExpectationSchema = (schema) => {
62
89
  const acc = {};
63
- (0, exports.introspectExpectationSchema)(schema, (key, segment) => {
64
- if (key === '$set' && segment[key]?.$location === 'statusCode') {
90
+ (0, exports.introspectExpectationOperatorsSchema)(schema, (key, segment) => {
91
+ if (key === '$set' && segment[key]?.$location === 'outgoing.status') {
65
92
  acc.responseStatuses = (acc.responseStatuses ?? []).concat([segment[key]?.$value].filter(Boolean));
66
93
  }
67
94
  if (key === '$has' && ['method', 'path'].includes(segment[key]?.$location ?? '')) {
68
95
  const valuePredicate = segment[key]?.$value
69
96
  ?? segment[key]?.$valueAnyOf
70
- ?? segment[key]?.$minimatch
71
- ?? segment[key]?.$minimatchAnyOf
97
+ ?? segment[key]?.$match
98
+ ?? segment[key]?.$matchAnyOf
72
99
  ?? segment[key]?.$regExp
73
100
  ?? segment[key]?.$regExpAnyOf
74
101
  ?? [];
@@ -1 +1 @@
1
- {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../src/expectations/utils.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,oDAAuB;AAEvB,mCASiB;AAEjB,uDAAyC;AAIlC,MAAM,8BAA8B,GACzC,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,EAAE;IACxB,QAAO,IAAI,EAAE,CAAC;QACZ,KAAK,YAAY,CAAC,CAAC,CAAC;YAClB,IAAI,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;gBACrC,OAAO,IAAI,CAAC;YACd,CAAC;YAED,OAAmC,MAAM,CAAC,OAAO,CAAC,MAAM,CAAE,CAAC,IAAI,CAC7D,CAAC,CAAC,QAAQ,EAAE,aAAa,CAAC,EAAE,EAAE,CACE,SAAS,CAAC,QAAQ,CAAE,CAAC,IAAI,EAAE,aAAa,EAAE,OAAO,EAAE;gBAC/E,mBAAmB,EAAE,sCAA8B;aACpD,CAAC,CACL,CAAC;QACJ,CAAC;QAED,KAAK,cAAc,CAAC,CAAC,CAAC;YACQ,MAAM,CAAC,OAAO,CAAC,MAAM,CAAE,CAAC,OAAO,CACzD,CAAC,CAAC,QAAQ,EAAE,aAAa,CAAC,EAAE,EAAE,CACE,SAAS,CAAC,QAAQ,CAAE,CAAC,IAAI,EAAE,aAAa,EAAE,OAAO,EAAE;gBAC/E,mBAAmB,EAAE,sCAA8B;aACpD,CAAC,CACL,CAAC;YAEF,OAAO,IAAI,CAAC;QACd,CAAC;IACH,CAAC;AACH,CAAC,CAAA;AA3BU,QAAA,8BAA8B,kCA2BxC;AAEI,MAAM,2BAA2B,GAAG,CAGzC,MAAS,EAAE,OAAuC,EAAQ,EAAE;IACtD,MAAM,CAAC,IAAI,CAAC,MAAM,CAAE,C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AAA,CAAC;gBACF,KAAK,MAAM,CAAC,CAAC,CAAC;oBACZ,GAAG,CAAC,YAAY,GAAG,CAAC,GAAG,CAAC,YAAY,IAAI,EAAE,CAAC,CAAC,MAAM,CAAC,gBAAC,CAAC,OAAO,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC;oBAC5F,MAAM;gBACR,CAAC;YACH,CAAC;QACH,CAAC;IACH,CAAC,CAAC,CAAC;IAEH,OAAO,GAAG,CAAC;AACb,CAAC,CAAA;AA/BY,QAAA,0CAA0C,8CA+BtD"}
@@ -2,17 +2,22 @@ import { Endpoint } from '../models';
2
2
  export interface IGetConfigResponsePayload {
3
3
  historyRecordsLimit: number;
4
4
  }
5
- declare const _default: Endpoint<IGetConfigResponsePayload, import("../models").IHttpRequestIncommingContext> & {
5
+ declare const _default: Endpoint<IGetConfigResponsePayload, {}> & {
6
6
  http: {
7
7
  readonly method: "GET";
8
8
  readonly path: "/_mock/config";
9
9
  };
10
10
  } & {
11
- webSocket: {
11
+ ws: {
12
12
  readonly path: "config:get";
13
13
  };
14
14
  } & {
15
- handler: ({ reply, config }: import("../models").RequestContext<import("../models").IHttpRequestIncommingContext, IGetConfigResponsePayload>) => Promise<void>;
15
+ handler: ({ reply, server }: (import("../models").HttpRequestContext<IGetConfigResponsePayload> | import("../models").WsRequestContext<IGetConfigResponsePayload>) & {
16
+ incoming: OmitPartial<{
17
+ body: void | undefined;
18
+ query: void | undefined;
19
+ }>;
20
+ }) => Promise<void>;
16
21
  };
17
22
  export default _default;
18
23
  //# sourceMappingURL=config.get.endpoint.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"config.get.endpoint.d.ts","sourceRoot":"","sources":["../../../../src/server/endpoints/config.get.endpoint.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAErC,MAAM,WAAW,yBAAyB;IACxC,mBAAmB,EAAE,MAAM,CAAC;CAC7B;;;;;;;;;;;;;AAED,wBAQI"}
1
+ {"version":3,"file":"config.get.endpoint.d.ts","sourceRoot":"","sources":["../../../../src/server/endpoints/config.get.endpoint.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAErC,MAAM,WAAW,yBAAyB;IACxC,mBAAmB,EAAE,MAAM,CAAC;CAC7B;;;;;;;;;;;;;;;;;;AAED,wBAMI"}
@@ -4,8 +4,6 @@ const models_1 = require("../models");
4
4
  exports.default = models_1.Endpoint
5
5
  .build()
6
6
  .bindToHttp({ method: 'GET', path: '/_mock/config' })
7
- .bindToWebSocket({ path: 'config:get' })
8
- .assignHandler(async ({ reply, config }) => reply.ok({
9
- historyRecordsLimit: config.server.historyRecordsLimit,
10
- }));
7
+ .bindToWs({ path: 'config:get' })
8
+ .assignHandler(async ({ reply, server }) => reply.ok({ historyRecordsLimit: server.config.server.historyRecordsLimit }));
11
9
  //# sourceMappingURL=config.get.endpoint.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"config.get.endpoint.js","sourceRoot":"","sources":["../../../../src/server/endpoints/config.get.endpoint.ts"],"names":[],"mappings":";;AACA,sCAAqC;AAMrC,kBAAe,iBAAQ;KACpB,KAAK,EAA6B;KAClC,UAAU,CAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,eAAe,EAAE,CAAC;KAC3D,eAAe,CAAQ,EAAE,IAAI,EAAE,YAAY,EAAE,CAAC;KAC9C,aAAa,CAAC,KAAK,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE,EAAE,CACzC,KAAK,CAAC,EAAE,CAAC;IACP,mBAAmB,EAAE,MAAM,CAAC,MAAM,CAAC,mBAAmB;CACvD,CAAC,CACH,CAAC"}
1
+ {"version":3,"file":"config.get.endpoint.js","sourceRoot":"","sources":["../../../../src/server/endpoints/config.get.endpoint.ts"],"names":[],"mappings":";;AACA,sCAAqC;AAMrC,kBAAe,iBAAQ;KACpB,KAAK,EAA6B;KAClC,UAAU,CAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,eAAe,EAAE,CAAC;KAC3D,QAAQ,CAAQ,EAAE,IAAI,EAAE,YAAY,EAAE,CAAC;KACvC,aAAa,CAAC,KAAK,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE,EAAE,CACzC,KAAK,CAAC,EAAE,CAAC,EAAE,mBAAmB,EAAE,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,mBAAmB,EAAE,CAAC,CAC5E,CAAC"}
@@ -1,21 +1,19 @@
1
- import { Expectation } from '../../expectations';
1
+ import { Expectation, TBuildExpectationConfiguration } from '../../expectations';
2
2
  import { Endpoint } from '../models';
3
- type TBody = Pick<Expectation, 'delay' | 'destroy' | 'forward' | 'request' | 'response'> & Partial<Pick<Expectation, 'name' | 'isEnabled' | 'type'>>;
4
- declare const _default: Endpoint<{
5
- id: string;
6
- }, {
7
- body: TBody;
3
+ declare const _default: Endpoint<Pick<Expectation<{}>, "name" | "type" | "schema" | "id" | "isEnabled" | "meta">, {
4
+ body: TBuildExpectationConfiguration<any>;
8
5
  }> & {
9
6
  http: {
10
7
  readonly method: "POST";
11
8
  readonly path: "/_mock/expectations";
12
9
  };
13
10
  } & {
14
- handler: ({ reply, body, client }: import("../models").RequestContext<{
15
- body: TBody;
16
- }, {
17
- id: string;
18
- }>) => Promise<void>;
11
+ handler: ({ reply, incoming, server }: (import("../models").HttpRequestContext<Pick<Expectation<{}>, "name" | "type" | "schema" | "id" | "isEnabled" | "meta">> | import("../models").WsRequestContext<Pick<Expectation<{}>, "name" | "type" | "schema" | "id" | "isEnabled" | "meta">>) & {
12
+ incoming: OmitPartial<{
13
+ body: TBuildExpectationConfiguration<any>;
14
+ query: void | undefined;
15
+ }>;
16
+ }) => Promise<void>;
19
17
  };
20
18
  export default _default;
21
19
  //# sourceMappingURL=expectations.create.endpoint.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"expectations.create.endpoint.d.ts","sourceRoot":"","sources":["../../../../src/server/endpoints/expectations.create.endpoint.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAErC,KAAK,KAAK,GACN,IAAI,CAAC,WAAW,EAAE,OAAO,GAAG,SAAS,GAAG,SAAS,GAAG,SAAS,GAAG,UAAU,CAAC,GAC3E,OAAO,CAAC,IAAI,CAAC,WAAW,EAAE,MAAM,GAAG,WAAW,GAAG,MAAM,CAAC,CAAC,CAAC;;QAG/C,MAAM;;UAAY,KAAK;;;;;;;;cAAL,KAAK;;YAAvB,MAAM;;;AADrB,wBAMK"}
1
+ {"version":3,"file":"expectations.create.endpoint.d.ts","sourceRoot":"","sources":["../../../../src/server/endpoints/expectations.create.endpoint.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,8BAA8B,EAAE,MAAM,oBAAoB,CAAC;AACjF,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;;UAGG,8BAA8B,CAAC,GAAG,CAAC;;;;;;;;;;;;;;AAD3E,wBAKK"}
@@ -4,8 +4,7 @@ const models_1 = require("../models");
4
4
  exports.default = models_1.Endpoint
5
5
  .build()
6
6
  .bindToHttp({ method: 'POST', path: '/_mock/expectations' })
7
- .assignHandler(async ({ reply, body, client }) => {
8
- const result = await client.createExpectation(body);
9
- reply.ok({ id: result.id });
7
+ .assignHandler(async ({ reply, incoming, server }) => {
8
+ reply.ok(await server.client.createExpectation(incoming.body));
10
9
  });
11
10
  //# sourceMappingURL=expectations.create.endpoint.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"expectations.create.endpoint.js","sourceRoot":"","sources":["../../../../src/server/endpoints/expectations.create.endpoint.ts"],"names":[],"mappings":";;AACA,sCAAqC;AAMrC,kBAAe,iBAAQ;KACpB,KAAK,EAAmC;KACxC,UAAU,CAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,qBAAqB,EAAE,CAAC;KAClE,aAAa,CAAC,KAAK,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE;IAC/C,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,iBAAiB,CAAC,IAAI,CAAC,CAAC;IACpD,KAAK,CAAC,EAAE,CAAC,EAAE,EAAE,EAAE,MAAM,CAAC,EAAE,EAAE,CAAC,CAAC;AAC9B,CAAC,CAAC,CAAC"}
1
+ {"version":3,"file":"expectations.create.endpoint.js","sourceRoot":"","sources":["../../../../src/server/endpoints/expectations.create.endpoint.ts"],"names":[],"mappings":";;AACA,sCAAqC;AAErC,kBAAe,iBAAQ;KACpB,KAAK,EAAwE;KAC7E,UAAU,CAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,qBAAqB,EAAE,CAAC;KAClE,aAAa,CAAC,KAAK,EAAE,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE;IACnD,KAAK,CAAC,EAAE,CAAC,MAAM,MAAM,CAAC,MAAM,CAAC,iBAAiB,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC;AACjE,CAAC,CAAC,CAAC"}
@@ -9,11 +9,14 @@ declare const _default: Endpoint<null, {
9
9
  readonly path: "/_mock/expectations";
10
10
  };
11
11
  } & {
12
- handler: ({ reply, body, client }: import("../models").RequestContext<{
13
- body: void | {
14
- ids?: string[];
15
- };
16
- }, null>) => Promise<void>;
12
+ handler: ({ reply, incoming, server }: (import("../models").HttpRequestContext<null> | import("../models").WsRequestContext<null>) & {
13
+ incoming: OmitPartial<{
14
+ body: void | {
15
+ ids?: string[];
16
+ };
17
+ query: void | undefined;
18
+ }>;
19
+ }) => Promise<void>;
17
20
  };
18
21
  export default _default;
19
22
  //# sourceMappingURL=expectations.delete.endpoint.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"expectations.delete.endpoint.d.ts","sourceRoot":"","sources":["../../../../src/server/endpoints/expectations.delete.endpoint.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;;UAGd,IAAI,GAAG;QAAE,GAAG,CAAC,EAAE,MAAM,EAAE,CAAA;KAAE;;;;;;;;cAAzB,IAAI,GAAG;YAAE,GAAG,CAAC,EAAE,MAAM,EAAE,CAAA;SAAE;;;AADhD,wBAMK"}
1
+ {"version":3,"file":"expectations.delete.endpoint.d.ts","sourceRoot":"","sources":["../../../../src/server/endpoints/expectations.delete.endpoint.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;;UAGd,IAAI,GAAG;QAAE,GAAG,CAAC,EAAE,MAAM,EAAE,CAAA;KAAE;;;;;;;;;;sBAAV,MAAM,EAAE;;;;;;AAD9C,wBAMK"}
@@ -4,8 +4,8 @@ const models_1 = require("../models");
4
4
  exports.default = models_1.Endpoint
5
5
  .build()
6
6
  .bindToHttp({ method: 'DELETE', path: '/_mock/expectations' })
7
- .assignHandler(async ({ reply, body, client }) => {
8
- await client.deleteExpectations(body);
7
+ .assignHandler(async ({ reply, incoming, server }) => {
8
+ await server.client.deleteExpectations(incoming.body);
9
9
  reply.ok(null);
10
10
  });
11
11
  //# sourceMappingURL=expectations.delete.endpoint.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"expectations.delete.endpoint.js","sourceRoot":"","sources":["../../../../src/server/endpoints/expectations.delete.endpoint.ts"],"names":[],"mappings":";;AAAA,sCAAqC;AAErC,kBAAe,iBAAQ;KACpB,KAAK,EAA6C;KAClD,UAAU,CAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,qBAAqB,EAAE,CAAC;KACpE,aAAa,CAAC,KAAK,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE;IAC/C,MAAM,MAAM,CAAC,kBAAkB,CAAC,IAAI,CAAC,CAAC;IACtC,KAAK,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC;AACjB,CAAC,CAAC,CAAC"}
1
+ {"version":3,"file":"expectations.delete.endpoint.js","sourceRoot":"","sources":["../../../../src/server/endpoints/expectations.delete.endpoint.ts"],"names":[],"mappings":";;AAAA,sCAAqC;AAErC,kBAAe,iBAAQ;KACpB,KAAK,EAA6C;KAClD,UAAU,CAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,qBAAqB,EAAE,CAAC;KACpE,aAAa,CAAC,KAAK,EAAE,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE;IACnD,MAAM,MAAM,CAAC,MAAM,CAAC,kBAAkB,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;IACtD,KAAK,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC;AACjB,CAAC,CAAC,CAAC"}
@@ -1,16 +1,21 @@
1
1
  import { Expectation } from '../../expectations';
2
2
  import { Endpoint } from '../models';
3
- declare const _default: Endpoint<Expectation[], import("../models").IHttpRequestIncommingContext> & {
3
+ declare const _default: Endpoint<Pick<Expectation<{}>, "name" | "type" | "schema" | "id" | "isEnabled" | "meta">[], {}> & {
4
4
  http: {
5
5
  readonly method: "GET";
6
6
  readonly path: "/_mock/expectations";
7
7
  };
8
8
  } & {
9
- webSocket: {
9
+ ws: {
10
10
  readonly path: "expectations:get";
11
11
  };
12
12
  } & {
13
- handler: ({ reply, storage }: import("../models").RequestContext<import("../models").IHttpRequestIncommingContext, Expectation[]>) => void;
13
+ handler: ({ reply, server }: (import("../models").HttpRequestContext<Pick<Expectation<{}>, "name" | "type" | "schema" | "id" | "isEnabled" | "meta">[]> | import("../models").WsRequestContext<Pick<Expectation<{}>, "name" | "type" | "schema" | "id" | "isEnabled" | "meta">[]>) & {
14
+ incoming: OmitPartial<{
15
+ body: void | undefined;
16
+ query: void | undefined;
17
+ }>;
18
+ }) => void;
14
19
  };
15
20
  export default _default;
16
21
  //# sourceMappingURL=expectations.get-list.endpoint.d.ts.map