@n1k1t/mock-server 0.1.2 → 0.1.4

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 (282) hide show
  1. package/bin/index.ts +2 -0
  2. package/lib/bin/index.d.ts +1 -0
  3. package/lib/bin/index.js +1 -0
  4. package/lib/bin/index.js.map +1 -1
  5. package/lib/package.json +6 -4
  6. package/lib/src/client/helpers/expectations.d.ts +2 -3
  7. package/lib/src/client/helpers/expectations.d.ts.map +1 -1
  8. package/lib/src/client/helpers/expectations.js.map +1 -1
  9. package/lib/src/client/methods/expectations.create.method.js +1 -1
  10. package/lib/src/client/methods/expectations.create.method.js.map +1 -1
  11. package/lib/src/client/methods/expectations.update.method.js +1 -1
  12. package/lib/src/client/methods/expectations.update.method.js.map +1 -1
  13. package/lib/src/client/models/client.d.ts +1 -0
  14. package/lib/src/client/models/client.d.ts.map +1 -1
  15. package/lib/src/client/models/client.js.map +1 -1
  16. package/lib/src/client/models/client.spec.js +6 -1
  17. package/lib/src/client/models/client.spec.js.map +1 -1
  18. package/lib/src/client/types.d.ts +1 -0
  19. package/lib/src/client/types.d.ts.map +1 -1
  20. package/lib/src/config/index.d.ts +2 -9
  21. package/lib/src/config/index.d.ts.map +1 -1
  22. package/lib/src/config/index.js +2 -15
  23. package/lib/src/config/index.js.map +1 -1
  24. package/lib/src/config/model.d.ts +23 -0
  25. package/lib/src/config/model.d.ts.map +1 -0
  26. package/lib/src/config/model.js +39 -0
  27. package/lib/src/config/model.js.map +1 -0
  28. package/lib/src/expectations/__utils__/index.d.ts +1 -0
  29. package/lib/src/expectations/__utils__/index.d.ts.map +1 -1
  30. package/lib/src/expectations/__utils__/index.js.map +1 -1
  31. package/lib/src/expectations/models/expectation.d.ts +3 -5
  32. package/lib/src/expectations/models/expectation.d.ts.map +1 -1
  33. package/lib/src/expectations/models/expectation.js +0 -32
  34. package/lib/src/expectations/models/expectation.js.map +1 -1
  35. package/lib/src/expectations/models/operator.d.ts +3 -2
  36. package/lib/src/expectations/models/operator.d.ts.map +1 -1
  37. package/lib/src/expectations/models/operator.js +19 -5
  38. package/lib/src/expectations/models/operator.js.map +1 -1
  39. package/lib/src/expectations/models/storage.d.ts +1 -0
  40. package/lib/src/expectations/models/storage.d.ts.map +1 -1
  41. package/lib/src/expectations/models/storage.js.map +1 -1
  42. package/lib/src/expectations/operators/and.operator.d.ts +1 -0
  43. package/lib/src/expectations/operators/and.operator.d.ts.map +1 -1
  44. package/lib/src/expectations/operators/and.operator.js.map +1 -1
  45. package/lib/src/expectations/operators/exec.operator.d.ts +2 -1
  46. package/lib/src/expectations/operators/exec.operator.d.ts.map +1 -1
  47. package/lib/src/expectations/operators/exec.operator.js +3 -2
  48. package/lib/src/expectations/operators/exec.operator.js.map +1 -1
  49. package/lib/src/expectations/operators/has.operator.d.ts +2 -1
  50. package/lib/src/expectations/operators/has.operator.d.ts.map +1 -1
  51. package/lib/src/expectations/operators/has.operator.js +11 -8
  52. package/lib/src/expectations/operators/has.operator.js.map +1 -1
  53. package/lib/src/expectations/operators/if.operator.d.ts +1 -0
  54. package/lib/src/expectations/operators/if.operator.d.ts.map +1 -1
  55. package/lib/src/expectations/operators/if.operator.js.map +1 -1
  56. package/lib/src/expectations/operators/merge.operator.d.ts +1 -0
  57. package/lib/src/expectations/operators/merge.operator.d.ts.map +1 -1
  58. package/lib/src/expectations/operators/merge.operator.js +2 -2
  59. package/lib/src/expectations/operators/merge.operator.js.map +1 -1
  60. package/lib/src/expectations/operators/not.operator.d.ts +1 -0
  61. package/lib/src/expectations/operators/not.operator.d.ts.map +1 -1
  62. package/lib/src/expectations/operators/not.operator.js.map +1 -1
  63. package/lib/src/expectations/operators/or.operator.d.ts +1 -0
  64. package/lib/src/expectations/operators/or.operator.d.ts.map +1 -1
  65. package/lib/src/expectations/operators/or.operator.js.map +1 -1
  66. package/lib/src/expectations/operators/remove.operator.d.ts +1 -0
  67. package/lib/src/expectations/operators/remove.operator.d.ts.map +1 -1
  68. package/lib/src/expectations/operators/remove.operator.js +1 -1
  69. package/lib/src/expectations/operators/remove.operator.js.map +1 -1
  70. package/lib/src/expectations/operators/root.operator.d.ts +1 -0
  71. package/lib/src/expectations/operators/root.operator.d.ts.map +1 -1
  72. package/lib/src/expectations/operators/root.operator.js +4 -2
  73. package/lib/src/expectations/operators/root.operator.js.map +1 -1
  74. package/lib/src/expectations/operators/set.operator.d.ts +2 -1
  75. package/lib/src/expectations/operators/set.operator.d.ts.map +1 -1
  76. package/lib/src/expectations/operators/set.operator.js +7 -9
  77. package/lib/src/expectations/operators/set.operator.js.map +1 -1
  78. package/lib/src/expectations/operators/switch.operator.d.ts +2 -1
  79. package/lib/src/expectations/operators/switch.operator.d.ts.map +1 -1
  80. package/lib/src/expectations/operators/switch.operator.js +1 -1
  81. package/lib/src/expectations/operators/switch.operator.js.map +1 -1
  82. package/lib/src/expectations/types.d.ts +24 -14
  83. package/lib/src/expectations/types.d.ts.map +1 -1
  84. package/lib/src/expectations/types.js +4 -1
  85. package/lib/src/expectations/types.js.map +1 -1
  86. package/lib/src/expectations/utils.d.ts +8 -6
  87. package/lib/src/expectations/utils.d.ts.map +1 -1
  88. package/lib/src/expectations/utils.js +68 -37
  89. package/lib/src/expectations/utils.js.map +1 -1
  90. package/lib/src/index.d.ts +4 -1
  91. package/lib/src/index.d.ts.map +1 -1
  92. package/lib/src/index.js +9 -1
  93. package/lib/src/index.js.map +1 -1
  94. package/lib/src/logger/index.d.ts +23 -0
  95. package/lib/src/logger/index.d.ts.map +1 -0
  96. package/lib/src/logger/index.js +81 -0
  97. package/lib/src/logger/index.js.map +1 -0
  98. package/lib/src/logger/types.d.ts +4 -0
  99. package/lib/src/logger/types.d.ts.map +1 -0
  100. package/lib/src/{types.js.map → logger/types.js.map} +1 -1
  101. package/lib/src/logger/utils.d.ts +6 -0
  102. package/lib/src/logger/utils.d.ts.map +1 -0
  103. package/lib/src/logger/utils.js +24 -0
  104. package/lib/src/logger/utils.js.map +1 -0
  105. package/lib/src/meta/index.d.ts +5 -0
  106. package/lib/src/meta/index.d.ts.map +1 -0
  107. package/lib/src/meta/index.js +22 -0
  108. package/lib/src/meta/index.js.map +1 -0
  109. package/lib/src/meta/model.d.ts +13 -0
  110. package/lib/src/meta/model.d.ts.map +1 -0
  111. package/lib/src/meta/model.js +28 -0
  112. package/lib/src/meta/model.js.map +1 -0
  113. package/lib/src/meta/storage.d.ts +9 -0
  114. package/lib/src/meta/storage.d.ts.map +1 -0
  115. package/lib/src/meta/storage.js +21 -0
  116. package/lib/src/meta/storage.js.map +1 -0
  117. package/lib/src/process.js +3 -3
  118. package/lib/src/process.js.map +1 -1
  119. package/lib/src/server/endpoints/config.get.endpoint.d.ts +48 -6
  120. package/lib/src/server/endpoints/config.get.endpoint.d.ts.map +1 -1
  121. package/lib/src/server/endpoints/config.get.endpoint.js +5 -1
  122. package/lib/src/server/endpoints/config.get.endpoint.js.map +1 -1
  123. package/lib/src/server/endpoints/expectations.create.endpoint.d.ts +1 -1
  124. package/lib/src/server/endpoints/expectations.delete.endpoint.d.ts +1 -1
  125. package/lib/src/server/endpoints/expectations.get-list.endpoint.d.ts +1 -1
  126. package/lib/src/server/endpoints/expectations.update.endpoint.d.ts +1 -1
  127. package/lib/src/server/endpoints/history.get-list.endpoint.d.ts +4 -4
  128. package/lib/src/server/endpoints/ping.endpoint.d.ts +1 -1
  129. package/lib/src/server/history/storage.d.ts.map +1 -1
  130. package/lib/src/server/history/storage.js +2 -2
  131. package/lib/src/server/history/storage.js.map +1 -1
  132. package/lib/src/server/index.d.ts +0 -1
  133. package/lib/src/server/index.d.ts.map +1 -1
  134. package/lib/src/server/index.js +37 -14
  135. package/lib/src/server/index.js.map +1 -1
  136. package/lib/src/server/middlewares/delay.middleware.d.ts +26 -0
  137. package/lib/src/server/middlewares/delay.middleware.d.ts.map +1 -0
  138. package/lib/src/server/middlewares/delay.middleware.js +13 -0
  139. package/lib/src/server/middlewares/delay.middleware.js.map +1 -0
  140. package/lib/src/server/middlewares/destroy.midleware.d.ts +26 -0
  141. package/lib/src/server/middlewares/destroy.midleware.d.ts.map +1 -0
  142. package/lib/src/server/middlewares/destroy.midleware.js +17 -0
  143. package/lib/src/server/middlewares/destroy.midleware.js.map +1 -0
  144. package/lib/src/server/middlewares/forward.middleware.d.ts +26 -0
  145. package/lib/src/server/middlewares/forward.middleware.d.ts.map +1 -0
  146. package/lib/src/server/middlewares/{handle-expectation-forward.middleware.js → forward.middleware.js} +15 -14
  147. package/lib/src/server/middlewares/forward.middleware.js.map +1 -0
  148. package/lib/src/server/middlewares/{add-history.middleware.d.ts → history.middleware.d.ts} +15 -7
  149. package/lib/src/server/middlewares/history.middleware.d.ts.map +1 -0
  150. package/lib/src/server/middlewares/{add-history.middleware.js → history.middleware.js} +4 -4
  151. package/lib/src/server/middlewares/history.middleware.js.map +1 -0
  152. package/lib/src/server/middlewares/index.d.ts +7 -6
  153. package/lib/src/server/middlewares/index.d.ts.map +1 -1
  154. package/lib/src/server/middlewares/index.js +15 -13
  155. package/lib/src/server/middlewares/index.js.map +1 -1
  156. package/lib/src/server/middlewares/{resolve-public.middleware.d.ts → internal.middleware.d.ts} +15 -7
  157. package/lib/src/server/middlewares/internal.middleware.d.ts.map +1 -0
  158. package/lib/src/server/middlewares/{internal-route.middleware.js → internal.middleware.js} +7 -4
  159. package/lib/src/server/middlewares/internal.middleware.js.map +1 -0
  160. package/lib/src/server/middlewares/{handle-expectation-delay.middleware.d.ts → manipulate-expectation.middleware.d.ts} +15 -7
  161. package/lib/src/server/middlewares/manipulate-expectation.middleware.d.ts.map +1 -0
  162. package/lib/src/server/middlewares/manipulate-expectation.middleware.js +13 -0
  163. package/lib/src/server/middlewares/manipulate-expectation.middleware.js.map +1 -0
  164. package/lib/src/server/middlewares/match-expectation.middleware.d.ts +14 -6
  165. package/lib/src/server/middlewares/match-expectation.middleware.d.ts.map +1 -1
  166. package/lib/src/server/middlewares/match-expectation.middleware.js +7 -6
  167. package/lib/src/server/middlewares/match-expectation.middleware.js.map +1 -1
  168. package/lib/src/server/middlewares/{internal-route.middleware.d.ts → public.middleware.d.ts} +15 -7
  169. package/lib/src/server/middlewares/public.middleware.d.ts.map +1 -0
  170. package/lib/src/server/middlewares/public.middleware.js +38 -0
  171. package/lib/src/server/middlewares/public.middleware.js.map +1 -0
  172. package/lib/src/server/middlewares/reply.middleware.d.ts +17 -9
  173. package/lib/src/server/middlewares/reply.middleware.d.ts.map +1 -1
  174. package/lib/src/server/middlewares/reply.middleware.js +9 -10
  175. package/lib/src/server/middlewares/reply.middleware.js.map +1 -1
  176. package/lib/src/server/models/endpoint.d.ts +2 -1
  177. package/lib/src/server/models/endpoint.d.ts.map +1 -1
  178. package/lib/src/server/models/endpoint.js.map +1 -1
  179. package/lib/src/server/models/index.d.ts +2 -1
  180. package/lib/src/server/models/index.d.ts.map +1 -1
  181. package/lib/src/server/models/index.js +2 -1
  182. package/lib/src/server/models/index.js.map +1 -1
  183. package/lib/src/server/models/middleware.d.ts +14 -5
  184. package/lib/src/server/models/middleware.d.ts.map +1 -1
  185. package/lib/src/server/models/middleware.js +5 -11
  186. package/lib/src/server/models/middleware.js.map +1 -1
  187. package/lib/src/server/models/plugins.d.ts +29 -0
  188. package/lib/src/server/models/plugins.d.ts.map +1 -0
  189. package/lib/src/server/models/plugins.js +32 -0
  190. package/lib/src/server/models/plugins.js.map +1 -0
  191. package/lib/src/server/models/{reply-service → reply}/index.d.ts +3 -3
  192. package/lib/src/server/models/reply/index.d.ts.map +1 -0
  193. package/lib/src/server/models/{reply-service → reply}/index.js +4 -4
  194. package/lib/src/server/models/reply/index.js.map +1 -0
  195. package/lib/src/server/models/reply/types.d.ts.map +1 -0
  196. package/lib/src/server/models/reply/types.js.map +1 -0
  197. package/lib/src/server/models/request-context/http.d.ts +28 -12
  198. package/lib/src/server/models/request-context/http.d.ts.map +1 -1
  199. package/lib/src/server/models/request-context/http.js +47 -20
  200. package/lib/src/server/models/request-context/http.js.map +1 -1
  201. package/lib/src/server/models/request-context/model.d.ts +7 -2
  202. package/lib/src/server/models/request-context/model.d.ts.map +1 -1
  203. package/lib/src/server/models/request-context/model.js +5 -0
  204. package/lib/src/server/models/request-context/model.js.map +1 -1
  205. package/lib/src/server/models/request-context/types.d.ts +2 -0
  206. package/lib/src/server/models/request-context/types.d.ts.map +1 -1
  207. package/lib/src/server/models/request-context/utils.d.ts +4 -1
  208. package/lib/src/server/models/request-context/utils.d.ts.map +1 -1
  209. package/lib/src/server/models/request-context/utils.js +2 -2
  210. package/lib/src/server/models/request-context/utils.js.map +1 -1
  211. package/lib/src/server/models/request-context/ws.d.ts +4 -3
  212. package/lib/src/server/models/request-context/ws.d.ts.map +1 -1
  213. package/lib/src/server/models/request-context/ws.js +2 -2
  214. package/lib/src/server/models/request-context/ws.js.map +1 -1
  215. package/lib/src/server/models/server-context.d.ts +2 -9
  216. package/lib/src/server/models/server-context.d.ts.map +1 -1
  217. package/lib/src/server/models/server-context.js +2 -5
  218. package/lib/src/server/models/server-context.js.map +1 -1
  219. package/lib/src/server/router.d.ts +1 -0
  220. package/lib/src/server/router.d.ts.map +1 -1
  221. package/lib/src/server/router.js.map +1 -1
  222. package/lib/src/types/common.d.ts +73 -0
  223. package/lib/src/types/common.d.ts.map +1 -0
  224. package/lib/{types/common.global.js → src/types/common.js} +1 -1
  225. package/lib/src/types/common.js.map +1 -0
  226. package/lib/src/{types.d.ts → types/index.d.ts} +2 -1
  227. package/lib/src/types/index.d.ts.map +1 -0
  228. package/lib/{types/lib.js → src/types/index.js} +2 -4
  229. package/lib/src/types/index.js.map +1 -0
  230. package/lib/src/utils/common.d.ts +1 -0
  231. package/lib/src/utils/common.d.ts.map +1 -1
  232. package/lib/src/utils/common.js.map +1 -1
  233. package/lib/src/utils/validation.d.ts +1 -0
  234. package/lib/src/utils/validation.d.ts.map +1 -1
  235. package/lib/src/utils/validation.js.map +1 -1
  236. package/lib/tsconfig.tsbuildinfo +1 -1
  237. package/package.json +6 -4
  238. package/lib/src/server/middlewares/add-history.middleware.d.ts.map +0 -1
  239. package/lib/src/server/middlewares/add-history.middleware.js.map +0 -1
  240. package/lib/src/server/middlewares/destroy-request.midleware.d.ts +0 -18
  241. package/lib/src/server/middlewares/destroy-request.midleware.d.ts.map +0 -1
  242. package/lib/src/server/middlewares/destroy-request.midleware.js +0 -16
  243. package/lib/src/server/middlewares/destroy-request.midleware.js.map +0 -1
  244. package/lib/src/server/middlewares/handle-expectation-delay.middleware.d.ts.map +0 -1
  245. package/lib/src/server/middlewares/handle-expectation-delay.middleware.js +0 -17
  246. package/lib/src/server/middlewares/handle-expectation-delay.middleware.js.map +0 -1
  247. package/lib/src/server/middlewares/handle-expectation-forward.middleware.d.ts +0 -18
  248. package/lib/src/server/middlewares/handle-expectation-forward.middleware.d.ts.map +0 -1
  249. package/lib/src/server/middlewares/handle-expectation-forward.middleware.js.map +0 -1
  250. package/lib/src/server/middlewares/internal-route.middleware.d.ts.map +0 -1
  251. package/lib/src/server/middlewares/internal-route.middleware.js.map +0 -1
  252. package/lib/src/server/middlewares/resolve-public.middleware.d.ts.map +0 -1
  253. package/lib/src/server/middlewares/resolve-public.middleware.js +0 -37
  254. package/lib/src/server/middlewares/resolve-public.middleware.js.map +0 -1
  255. package/lib/src/server/models/reply-service/index.d.ts.map +0 -1
  256. package/lib/src/server/models/reply-service/index.js.map +0 -1
  257. package/lib/src/server/models/reply-service/types.d.ts.map +0 -1
  258. package/lib/src/server/models/reply-service/types.js.map +0 -1
  259. package/lib/src/server/proxy.d.ts +0 -9
  260. package/lib/src/server/proxy.d.ts.map +0 -1
  261. package/lib/src/server/proxy.js +0 -16
  262. package/lib/src/server/proxy.js.map +0 -1
  263. package/lib/src/types.d.ts.map +0 -1
  264. package/lib/task-processor.d.ts +0 -2
  265. package/lib/task-processor.d.ts.map +0 -1
  266. package/lib/task-processor.js +0 -75
  267. package/lib/task-processor.js.map +0 -1
  268. package/lib/test/index.d.ts +0 -2
  269. package/lib/test/index.d.ts.map +0 -1
  270. package/lib/test/index.js +0 -124
  271. package/lib/test/index.js.map +0 -1
  272. package/lib/types/common.global.d.ts +0 -76
  273. package/lib/types/common.global.d.ts.map +0 -1
  274. package/lib/types/common.global.js.map +0 -1
  275. package/lib/types/lib.d.ts +0 -4
  276. package/lib/types/lib.d.ts.map +0 -1
  277. package/lib/types/lib.js.map +0 -1
  278. package/types/common.global.ts +0 -131
  279. package/types/lib.ts +0 -3
  280. /package/lib/src/{server/models/reply-service → logger}/types.js +0 -0
  281. /package/lib/src/server/models/{reply-service → reply}/types.d.ts +0 -0
  282. /package/lib/src/{types.js → server/models/reply/types.js} +0 -0
@@ -0,0 +1,22 @@
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 __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ exports.metaStorage = void 0;
18
+ const storage_1 = require("./storage");
19
+ __exportStar(require("./storage"), exports);
20
+ __exportStar(require("./model"), exports);
21
+ exports.metaStorage = new storage_1.MetaStorage();
22
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/meta/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,uCAAwC;AAExC,4CAA0B;AAC1B,0CAAwB;AAEX,QAAA,WAAW,GAAG,IAAI,qBAAW,EAAE,CAAC"}
@@ -0,0 +1,13 @@
1
+ import type { PickWithType } from '../types';
2
+ export type TMetaContext = Partial<PickWithType<MetaContext, string | number | boolean>>;
3
+ export declare class MetaContext {
4
+ requestId: string;
5
+ operationId: string;
6
+ merge(context: TMetaContext): this & Partial<PickWithType<MetaContext, string | number | boolean>>;
7
+ pick<K extends keyof TMetaContext>(keys: K[]): Pick<this, K>;
8
+ static build(context?: Partial<Pick<MetaContext, 'operationId' | 'requestId'>>): MetaContext & {
9
+ requestId: string;
10
+ operationId: string;
11
+ } & Partial<Pick<MetaContext, "requestId" | "operationId">>;
12
+ }
13
+ //# sourceMappingURL=model.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"model.d.ts","sourceRoot":"","sources":["../../../src/meta/model.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAE7C,MAAM,MAAM,YAAY,GAAG,OAAO,CAAC,YAAY,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC,CAAC,CAAC;AAEzF,qBAAa,WAAW;IACf,SAAS,EAAE,MAAM,CAAa;IAC9B,WAAW,EAAE,MAAM,CAAa;IAEhC,KAAK,CAAC,OAAO,EAAE,YAAY;IAI3B,IAAI,CAAC,CAAC,SAAS,MAAM,YAAY,EAAE,IAAI,EAAE,CAAC,EAAE,GAAG,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC;IAInE,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC,IAAI,CAAC,WAAW,EAAE,aAAa,GAAG,WAAW,CAAC,CAAC;;;;CAS/E"}
@@ -0,0 +1,28 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.MetaContext = void 0;
7
+ const uuid_1 = require("uuid");
8
+ const lodash_1 = __importDefault(require("lodash"));
9
+ class MetaContext {
10
+ constructor() {
11
+ this.requestId = 'unknown';
12
+ this.operationId = 'unknown';
13
+ }
14
+ merge(context) {
15
+ return Object.assign(this, context);
16
+ }
17
+ pick(keys) {
18
+ return lodash_1.default.pick(this, keys);
19
+ }
20
+ static build(context) {
21
+ return Object.assign(new MetaContext(), lodash_1.default.defaults(context ?? {}, {
22
+ requestId: (0, uuid_1.v4)(),
23
+ operationId: (0, uuid_1.v4)(),
24
+ }));
25
+ }
26
+ }
27
+ exports.MetaContext = MetaContext;
28
+ //# sourceMappingURL=model.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"model.js","sourceRoot":"","sources":["../../../src/meta/model.ts"],"names":[],"mappings":";;;;;;AAAA,+BAAoC;AACpC,oDAAuB;AAMvB,MAAa,WAAW;IAAxB;QACS,cAAS,GAAW,SAAS,CAAC;QAC9B,gBAAW,GAAW,SAAS,CAAC;IAmBzC,CAAC;IAjBQ,KAAK,CAAC,OAAqB;QAChC,OAAO,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;IACtC,CAAC;IAEM,IAAI,CAA+B,IAAS;QACjD,OAAO,gBAAC,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;IAC5B,CAAC;IAED,MAAM,CAAC,KAAK,CAAC,OAAiE;QAC5E,OAAO,MAAM,CAAC,MAAM,CAClB,IAAI,WAAW,EAAE,EACjB,gBAAC,CAAC,QAAQ,CAAC,OAAO,IAAI,EAAE,EAAE;YACxB,SAAS,EAAE,IAAA,SAAM,GAAE;YACnB,WAAW,EAAE,IAAA,SAAM,GAAE;SACtB,CAAC,CACH,CAAC;IACJ,CAAC;CACF;AArBD,kCAqBC"}
@@ -0,0 +1,9 @@
1
+ import { MetaContext, TMetaContext } from './model';
2
+ import { TFunction } from '../types';
3
+ export declare class MetaStorage {
4
+ private storage;
5
+ provide(): MetaContext;
6
+ generate(payload?: TMetaContext): MetaContext;
7
+ wrap<T>(payload: TMetaContext | undefined, handler: TFunction<T>): T;
8
+ }
9
+ //# sourceMappingURL=storage.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"storage.d.ts","sourceRoot":"","sources":["../../../src/meta/storage.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACpD,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAErC,qBAAa,WAAW;IACtB,OAAO,CAAC,OAAO,CAAwC;IAEhD,OAAO;IAIP,QAAQ,CAAC,OAAO,GAAE,YAAiB;IAInC,IAAI,CAAC,CAAC,EAAE,OAAO,EAAE,YAAY,YAAK,EAAE,OAAO,EAAE,SAAS,CAAC,CAAC,CAAC;CAGjE"}
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.MetaStorage = void 0;
4
+ const async_hooks_1 = require("async_hooks");
5
+ const model_1 = require("./model");
6
+ class MetaStorage {
7
+ constructor() {
8
+ this.storage = new async_hooks_1.AsyncLocalStorage();
9
+ }
10
+ provide() {
11
+ return this.storage.getStore() ?? this.generate();
12
+ }
13
+ generate(payload = {}) {
14
+ return payload instanceof model_1.MetaContext ? payload : model_1.MetaContext.build(payload);
15
+ }
16
+ wrap(payload = {}, handler) {
17
+ return this.storage.run(this.generate(payload), handler);
18
+ }
19
+ }
20
+ exports.MetaStorage = MetaStorage;
21
+ //# sourceMappingURL=storage.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"storage.js","sourceRoot":"","sources":["../../../src/meta/storage.ts"],"names":[],"mappings":";;;AAAA,6CAAgD;AAEhD,mCAAoD;AAGpD,MAAa,WAAW;IAAxB;QACU,YAAO,GAAG,IAAI,+BAAiB,EAAe,CAAC;IAazD,CAAC;IAXQ,OAAO;QACZ,OAAO,IAAI,CAAC,OAAO,CAAC,QAAQ,EAAE,IAAI,IAAI,CAAC,QAAQ,EAAE,CAAC;IACpD,CAAC;IAEM,QAAQ,CAAC,UAAwB,EAAE;QACxC,OAAO,OAAO,YAAY,mBAAW,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,mBAAW,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;IAC/E,CAAC;IAEM,IAAI,CAAI,UAAwB,EAAE,EAAE,OAAqB;QAC9D,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC,CAAC;IAC3D,CAAC;CACF;AAdD,kCAcC"}
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  require("colors");
4
- process.env.NODE_TLS_REJECT_UNAUTHORIZED = '0';
5
- process.on('uncaughtException', (error) => console.error(error.stack));
6
- process.on('unhandledRejection', (reason) => console.error(reason));
4
+ // process.env.NODE_TLS_REJECT_UNAUTHORIZED = '0';
5
+ // process.on('uncaughtException', (error) => console.error(error.stack));
6
+ // process.on('unhandledRejection', (reason) => console.error(reason));
7
7
  //# sourceMappingURL=process.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"process.js","sourceRoot":"","sources":["../../src/process.ts"],"names":[],"mappings":";;AAAA,kBAAgB;AAEhB,OAAO,CAAC,GAAG,CAAC,4BAA4B,GAAG,GAAG,CAAC;AAE/C,OAAO,CAAC,EAAE,CAAC,mBAAmB,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC;AACvE,OAAO,CAAC,EAAE,CAAC,oBAAoB,EAAE,CAAC,MAAM,EAAE,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC"}
1
+ {"version":3,"file":"process.js","sourceRoot":"","sources":["../../src/process.ts"],"names":[],"mappings":";;AAAA,kBAAgB;AAEhB,kDAAkD;AAElD,0EAA0E;AAC1E,uEAAuE"}
@@ -1,8 +1,20 @@
1
1
  import { Endpoint } from '../models';
2
- export interface IGetConfigResponsePayload {
3
- historyRecordsLimit: number;
4
- }
5
- declare const _default: Endpoint<IGetConfigResponsePayload, {}> & {
2
+ declare const _default: Endpoint<{
3
+ statics: {
4
+ public: {
5
+ dir: string;
6
+ };
7
+ };
8
+ gui: {
9
+ route: string;
10
+ };
11
+ history: {
12
+ limit: number;
13
+ };
14
+ logger: {
15
+ level: import("../..").TLoggerLevel;
16
+ };
17
+ }, {}> & {
6
18
  http: {
7
19
  readonly method: "GET";
8
20
  readonly path: "/_mock/config";
@@ -12,8 +24,38 @@ declare const _default: Endpoint<IGetConfigResponsePayload, {}> & {
12
24
  readonly path: "config:get";
13
25
  };
14
26
  } & {
15
- handler: ({ reply, server }: (import("../models").HttpRequestContext<IGetConfigResponsePayload> | import("../models").WsRequestContext<IGetConfigResponsePayload>) & {
16
- incoming: OmitPartial<{
27
+ handler: ({ reply }: (import("../models").HttpRequestContext<{
28
+ statics: {
29
+ public: {
30
+ dir: string;
31
+ };
32
+ };
33
+ gui: {
34
+ route: string;
35
+ };
36
+ history: {
37
+ limit: number;
38
+ };
39
+ logger: {
40
+ level: import("../..").TLoggerLevel;
41
+ };
42
+ }> | import("../models").WsRequestContext<{
43
+ statics: {
44
+ public: {
45
+ dir: string;
46
+ };
47
+ };
48
+ gui: {
49
+ route: string;
50
+ };
51
+ history: {
52
+ limit: number;
53
+ };
54
+ logger: {
55
+ level: import("../..").TLoggerLevel;
56
+ };
57
+ }>) & {
58
+ incoming: import("../..").OmitPartial<{
17
59
  body: void | undefined;
18
60
  query: void | undefined;
19
61
  }>;
@@ -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,wBAMI"}
1
+ {"version":3,"file":"config.get.endpoint.d.ts","sourceRoot":"","sources":["../../../../src/server/endpoints/config.get.endpoint.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAErC,wBAIgE"}
@@ -1,9 +1,13 @@
1
1
  "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
2
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
+ const config_1 = __importDefault(require("../../config"));
3
7
  const models_1 = require("../models");
4
8
  exports.default = models_1.Endpoint
5
9
  .build()
6
10
  .bindToHttp({ method: 'GET', path: '/_mock/config' })
7
11
  .bindToWs({ path: 'config:get' })
8
- .assignHandler(async ({ reply, server }) => reply.ok({ historyRecordsLimit: server.config.server.historyRecordsLimit }));
12
+ .assignHandler(async ({ reply }) => reply.ok(config_1.default.storage));
9
13
  //# 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,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
+ {"version":3,"file":"config.get.endpoint.js","sourceRoot":"","sources":["../../../../src/server/endpoints/config.get.endpoint.ts"],"names":[],"mappings":";;;;;AAEA,0DAAkC;AAClC,sCAAqC;AAErC,kBAAe,iBAAQ;KACpB,KAAK,EAA4B;KACjC,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,EAAE,EAAE,CAAC,KAAK,CAAC,EAAE,CAAC,gBAAM,CAAC,OAAO,CAAC,CAAC,CAAC"}
@@ -9,7 +9,7 @@ declare const _default: Endpoint<Pick<Expectation<{}>, "name" | "type" | "schema
9
9
  };
10
10
  } & {
11
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<{
12
+ incoming: import("../..").OmitPartial<{
13
13
  body: TBuildExpectationConfiguration<any>;
14
14
  query: void | undefined;
15
15
  }>;
@@ -10,7 +10,7 @@ declare const _default: Endpoint<null, {
10
10
  };
11
11
  } & {
12
12
  handler: ({ reply, incoming, server }: (import("../models").HttpRequestContext<null> | import("../models").WsRequestContext<null>) & {
13
- incoming: OmitPartial<{
13
+ incoming: import("../..").OmitPartial<{
14
14
  body: void | {
15
15
  ids?: string[];
16
16
  };
@@ -11,7 +11,7 @@ declare const _default: Endpoint<Pick<Expectation<{}>, "name" | "type" | "schema
11
11
  };
12
12
  } & {
13
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<{
14
+ incoming: import("../..").OmitPartial<{
15
15
  body: void | undefined;
16
16
  query: void | undefined;
17
17
  }>;
@@ -16,7 +16,7 @@ declare const _default: Endpoint<Pick<Expectation<{}>, "name" | "type" | "schema
16
16
  };
17
17
  } & {
18
18
  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">>) & {
19
- incoming: OmitPartial<{
19
+ incoming: import("../..").OmitPartial<{
20
20
  body: {
21
21
  id: string;
22
22
  set: Partial<Omit<TBuildExpectationConfiguration<any>, "type">>;
@@ -1,6 +1,6 @@
1
1
  import { History } from '../history';
2
2
  import { Endpoint } from '../models';
3
- declare const _default: Endpoint<(Pick<History, "request" | "id" | "meta" | "forwaded" | "error"> & {
3
+ declare const _default: Endpoint<(Pick<History, "error" | "request" | "id" | "meta" | "forwaded"> & {
4
4
  expectation?: import("../../expectations").Expectation<any>["TPlain"];
5
5
  })[], {}> & {
6
6
  http: {
@@ -12,12 +12,12 @@ declare const _default: Endpoint<(Pick<History, "request" | "id" | "meta" | "for
12
12
  readonly path: "history:get";
13
13
  };
14
14
  } & {
15
- handler: ({ reply, server }: (import("../models").HttpRequestContext<(Pick<History, "request" | "id" | "meta" | "forwaded" | "error"> & {
15
+ handler: ({ reply, server }: (import("../models").HttpRequestContext<(Pick<History, "error" | "request" | "id" | "meta" | "forwaded"> & {
16
16
  expectation?: import("../../expectations").Expectation<any>["TPlain"];
17
- })[]> | import("../models").WsRequestContext<(Pick<History, "request" | "id" | "meta" | "forwaded" | "error"> & {
17
+ })[]> | import("../models").WsRequestContext<(Pick<History, "error" | "request" | "id" | "meta" | "forwaded"> & {
18
18
  expectation?: import("../../expectations").Expectation<any>["TPlain"];
19
19
  })[]>) & {
20
- incoming: OmitPartial<{
20
+ incoming: import("../..").OmitPartial<{
21
21
  body: void | undefined;
22
22
  query: void | undefined;
23
23
  }>;
@@ -10,7 +10,7 @@ declare const _default: Endpoint<"pong", {}> & {
10
10
  };
11
11
  } & {
12
12
  handler: ({ reply }: (import("../models").HttpRequestContext<"pong"> | import("../models").WsRequestContext<"pong">) & {
13
- incoming: OmitPartial<{
13
+ incoming: import("../..").OmitPartial<{
14
14
  body: void | undefined;
15
15
  query: void | undefined;
16
16
  }>;
@@ -1 +1 @@
1
- {"version":3,"file":"storage.d.ts","sourceRoot":"","sources":["../../../../src/server/history/storage.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAGlC,qBAAa,cAAe,SAAQ,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC;IACtD,OAAO,CAAC,QAAQ,CAAgB;IAEzB,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC,SAAS,CAAC,GAAG,OAAO;CAWtD"}
1
+ {"version":3,"file":"storage.d.ts","sourceRoot":"","sources":["../../../../src/server/history/storage.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAElC,qBAAa,cAAe,SAAQ,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC;IACtD,OAAO,CAAC,QAAQ,CAAgB;IAEzB,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC,SAAS,CAAC,GAAG,OAAO;CAWtD"}
@@ -4,8 +4,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.HistoryStorage = void 0;
7
- const model_1 = require("./model");
8
7
  const config_1 = __importDefault(require("../../config"));
8
+ const model_1 = require("./model");
9
9
  class HistoryStorage extends Map {
10
10
  constructor() {
11
11
  super(...arguments);
@@ -14,7 +14,7 @@ class HistoryStorage extends Map {
14
14
  register(request) {
15
15
  const historyRecord = model_1.History.build(request);
16
16
  this.set(historyRecord.id, historyRecord);
17
- if (this.idsStack.push(historyRecord.id) > config_1.default.server.historyRecordsLimit) {
17
+ if (this.idsStack.push(historyRecord.id) > config_1.default.get('history').limit) {
18
18
  this.delete(this.idsStack.shift());
19
19
  }
20
20
  return historyRecord;
@@ -1 +1 @@
1
- {"version":3,"file":"storage.js","sourceRoot":"","sources":["../../../../src/server/history/storage.ts"],"names":[],"mappings":";;;;;;AAAA,mCAAkC;AAClC,0DAAkC;AAElC,MAAa,cAAe,SAAQ,GAAoB;IAAxD;;QACU,aAAQ,GAAa,EAAE,CAAC;IAalC,CAAC;IAXQ,QAAQ,CAAC,OAA2B;QACzC,MAAM,aAAa,GAAG,eAAO,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;QAE7C,IAAI,CAAC,GAAG,CAAC,aAAa,CAAC,EAAE,EAAE,aAAa,CAAC,CAAC;QAE1C,IAAI,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,aAAa,CAAC,EAAE,CAAC,GAAG,gBAAM,CAAC,MAAM,CAAC,mBAAmB,EAAE,CAAC;YAC7E,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,KAAK,EAAG,CAAC,CAAC;QACtC,CAAC;QAED,OAAO,aAAa,CAAC;IACvB,CAAC;CACF;AAdD,wCAcC"}
1
+ {"version":3,"file":"storage.js","sourceRoot":"","sources":["../../../../src/server/history/storage.ts"],"names":[],"mappings":";;;;;;AAAA,0DAAkC;AAClC,mCAAkC;AAElC,MAAa,cAAe,SAAQ,GAAoB;IAAxD;;QACU,aAAQ,GAAa,EAAE,CAAC;IAalC,CAAC;IAXQ,QAAQ,CAAC,OAA2B;QACzC,MAAM,aAAa,GAAG,eAAO,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;QAE7C,IAAI,CAAC,GAAG,CAAC,aAAa,CAAC,EAAE,EAAE,aAAa,CAAC,CAAC;QAE1C,IAAI,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,aAAa,CAAC,EAAE,CAAC,GAAG,gBAAM,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC,KAAK,EAAE,CAAC;YACvE,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,KAAK,EAAG,CAAC,CAAC;QACtC,CAAC;QAED,OAAO,aAAa,CAAC;IACvB,CAAC;CACF;AAdD,wCAcC"}
@@ -1,5 +1,4 @@
1
1
  import { ServerContext } from './models';
2
- export * from './proxy';
3
2
  export declare class MockServer {
4
3
  options: {
5
4
  port: number;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/server/index.ts"],"names":[],"mappings":"AAIA,OAAO,EAAkC,aAAa,EAAoB,MAAM,UAAU,CAAC;AAK3F,cAAc,SAAS,CAAC;AAuBxB,qBAAa,UAAU;IAIF,OAAO,EAAE;QAC1B,IAAI,EAAE,MAAM,CAAC;QACb,IAAI,EAAE,MAAM,CAAC;KACd;IANM,SAAS,SAAsD;IAC/D,OAAO,gBAAyB;gBAEpB,OAAO,EAAE;QAC1B,IAAI,EAAE,MAAM,CAAC;QACb,IAAI,EAAE,MAAM,CAAC;KACd;IAED,IAAI,MAAM,8BAET;WAEY,KAAK,CAAC,OAAO,EAAE,UAAU,CAAC,SAAS,CAAC;CA+BlD"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/server/index.ts"],"names":[],"mappings":"AAIA,OAAO,EAAkC,aAAa,EAAoB,MAAM,UAAU,CAAC;AAoD3F,qBAAa,UAAU;IAIF,OAAO,EAAE;QAC1B,IAAI,EAAE,MAAM,CAAC;QACb,IAAI,EAAE,MAAM,CAAC;KACd;IANM,SAAS,SAAsD;IAC/D,OAAO,gBAAyB;gBAEpB,OAAO,EAAE;QAC1B,IAAI,EAAE,MAAM,CAAC;QACb,IAAI,EAAE,MAAM,CAAC;KACd;IAED,IAAI,MAAM,8BAET;WAEY,KAAK,CAAC,OAAO,EAAE,UAAU,CAAC,SAAS,CAAC;CA+BlD"}
@@ -22,9 +22,6 @@ var __importStar = (this && this.__importStar) || function (mod) {
22
22
  __setModuleDefault(result, mod);
23
23
  return result;
24
24
  };
25
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
26
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
27
- };
28
25
  var __importDefault = (this && this.__importDefault) || function (mod) {
29
26
  return (mod && mod.__esModule) ? mod : { "default": mod };
30
27
  };
@@ -34,21 +31,47 @@ const http_1 = require("http");
34
31
  const socket_io_1 = require("socket.io");
35
32
  const lodash_1 = __importDefault(require("lodash"));
36
33
  const models_1 = require("./models");
34
+ const meta_1 = require("../meta");
35
+ const logger_1 = require("../logger");
37
36
  const router_1 = require("./router");
38
37
  const middlewares = __importStar(require("./middlewares"));
39
- __exportStar(require("./proxy"), exports);
38
+ const logger = logger_1.Logger.build('Server');
40
39
  const middlewaresToUse = [
41
- middlewares.resolvePublicMiddleware,
42
- middlewares.handleInternalMiddleware,
40
+ middlewares.publicMiddleware,
41
+ middlewares.internalMiddleware,
43
42
  middlewares.matchExpectationMiddleware,
44
- middlewares.addHistoryMiddleware,
45
- middlewares.handleExpectationForwardMiddleware,
46
- middlewares.handleExpectationDelayMiddleware,
47
- middlewares.buildDestroyRequestMiddleware,
43
+ middlewares.manipulateExpectationMiddleware,
44
+ middlewares.historyMiddleware,
45
+ middlewares.delayMiddleware,
46
+ middlewares.destroyMiddleware,
47
+ middlewares.forwardMiddleware,
48
48
  middlewares.replyMiddleware,
49
49
  ];
50
- const handleHttpRequestWithMiddlewares = (context, position = 0) => middlewaresToUse[position]?.exec(context, (result) => handleHttpRequestWithMiddlewares(context.share(result ?? {}), ++position));
51
- const httpRequestListener = (context) => async (request, response) => handleHttpRequestWithMiddlewares(await models_1.HttpRequestContext.build(context, request, response));
50
+ const handleHttpRequest = async (context) => {
51
+ for (const middleware of middlewaresToUse) {
52
+ if (context.completed || context.response.closed) {
53
+ break;
54
+ }
55
+ if (!middleware.required.every((key) => key in context.shared)) {
56
+ logger.warn(`Middleware [${middleware.name}] has skiped`);
57
+ continue;
58
+ }
59
+ await middleware.exec(context).catch((error) => {
60
+ logger.error(`Got error while middleware [${middleware.name}] execution`, error?.stack ?? error);
61
+ context.complete();
62
+ });
63
+ }
64
+ };
65
+ const httpRequestListener = (server) => async (request, response) => {
66
+ const context = await models_1.HttpRequestContext.build(server, request, response);
67
+ logger.info('Incoming request', `[${context.incoming.method} ${context.incoming.path}]`);
68
+ await meta_1.metaStorage
69
+ .wrap(context.meta, () => handleHttpRequest(context))
70
+ .catch((error) => {
71
+ logger.error('Get error while handling incoming request', error?.stack ?? error);
72
+ response.end();
73
+ });
74
+ };
52
75
  class MockServer {
53
76
  constructor(options) {
54
77
  this.options = options;
@@ -68,8 +91,8 @@ class MockServer {
68
91
  })))));
69
92
  server.context.assignWsExchange(ws);
70
93
  await new Promise((resolve) => http.listen(options.port, options.host, () => {
71
- console.log(`Server has started on [${server.authority}]`);
72
- console.log(`GUI is available on [${server.authority}/_mock/gui]`);
94
+ logger.info(`Server has started on [${server.authority}]`);
95
+ logger.info(`GUI is available on [${server.authority}/_mock/gui]`);
73
96
  resolve();
74
97
  }));
75
98
  return server;
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/server/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+BAAqE;AACrE,yCAAmC;AACnC,oDAAuB;AAEvB,qCAA2F;AAC3F,qCAAkC;AAElC,2DAA6C;AAE7C,0CAAwB;AAExB,MAAM,gBAAgB,GAAwC;IAC5D,WAAW,CAAC,uBAAuB;IACnC,WAAW,CAAC,wBAAwB;IACpC,WAAW,CAAC,0BAA0B;IACtC,WAAW,CAAC,oBAAoB;IAChC,WAAW,CAAC,kCAAkC;IAC9C,WAAW,CAAC,gCAAgC;IAC5C,WAAW,CAAC,6BAA6B;IACzC,WAAW,CAAC,eAAe;CAC5B,CAAC;AAEF,MAAM,gCAAgC,GAAG,CAAC,OAA2B,EAAE,WAAmB,CAAC,EAAW,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gBAAC,CAAC,KAAK,CAAC,IAAI,CAAC;SACpB,CAAC,CACL,CAAC,CACH,CACF,CAAC;QAEF,MAAM,CAAC,OAAO,CAAC,gBAAgB,CAAC,EAAE,CAAC,CAAC;QAEpC,MAAM,IAAI,OAAO,CAAO,CAAC,OAAO,EAAE,EAAE,CAClC,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC,IAAI,EAAE,GAAG,EAAE;YAC3C,MAAM,CAAC,IAAI,CAAC,0BAA0B,MAAM,CAAC,SAAS,GAAG,CAAC,CAAC;YAC3D,MAAM,CAAC,IAAI,CAAC,wBAAwB,MAAM,CAAC,SAAS,aAAa,CAAC,CAAC;YAEnE,OAAO,EAAE,CAAC;QACZ,CAAC,CAAC,CACH,CAAC;QAEF,OAAO,MAAM,CAAC;IAChB,CAAC;CACF;AA5CD,gCA4CC"}
@@ -0,0 +1,26 @@
1
+ import { Middleware } from '../models';
2
+ declare const _default: Middleware<"manipulated", import("../models").HttpRequestContext<unknown> & {
3
+ shared: import("../..").SetRequiredKeys<{
4
+ state: Record<string, unknown>;
5
+ seed?: number;
6
+ expectation?: import("../../expectations").Expectation<Pick<import("../models").HttpRequestContext, "incoming" | "outgoing">>;
7
+ manipulated?: import("../../expectations").IExpectationOperatorContext;
8
+ forwarded?: Pick<import("../models").HttpRequestContext, "incoming" | "outgoing">;
9
+ history?: import("../history").History;
10
+ }, "manipulated">;
11
+ }> & {
12
+ handler: import("../..").TFunction<unknown, [import("../models").HttpRequestContext<unknown> & {
13
+ shared: import("../..").SetRequiredKeys<{
14
+ state: Record<string, unknown>;
15
+ seed?: number;
16
+ expectation?: import("../../expectations").Expectation<Pick<import("../models").HttpRequestContext, "incoming" | "outgoing">>;
17
+ manipulated?: import("../../expectations").IExpectationOperatorContext;
18
+ forwarded?: Pick<import("../models").HttpRequestContext, "incoming" | "outgoing">;
19
+ history?: import("../history").History;
20
+ }, "manipulated">;
21
+ }, {
22
+ logger: import("../..").Logger;
23
+ }]>;
24
+ };
25
+ export default _default;
26
+ //# sourceMappingURL=delay.middleware.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"delay.middleware.d.ts","sourceRoot":"","sources":["../../../../src/server/middlewares/delay.middleware.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;;;;;;;;;;;;;;;;;;;;;;;;AAGvC,wBAOK"}
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const models_1 = require("../models");
4
+ const utils_1 = require("../../utils");
5
+ exports.default = models_1.Middleware
6
+ .build(__filename, ['manipulated'])
7
+ .assignHandler(async (context, { logger }) => {
8
+ if (context.shared.manipulated.incoming.delay) {
9
+ logger.info(`Has delayed over [${context.shared.manipulated.incoming.delay}ms]`);
10
+ await (0, utils_1.wait)(context.shared.manipulated.incoming.delay);
11
+ }
12
+ });
13
+ //# sourceMappingURL=delay.middleware.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"delay.middleware.js","sourceRoot":"","sources":["../../../../src/server/middlewares/delay.middleware.ts"],"names":[],"mappings":";;AAEA,sCAAuC;AACvC,uCAAmC;AAEnC,kBAAe,mBAAU;KACtB,KAAK,CAAC,UAAU,EAAE,CAAC,aAAa,CAAC,CAAC;KAClC,aAAa,CAAC,KAAK,EAAE,OAAO,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE;IAC3C,IAAI,OAAO,CAAC,MAAM,CAAC,WAAW,CAAC,QAAQ,CAAC,KAAK,EAAE,CAAC;QAC9C,MAAM,CAAC,IAAI,CAAC,qBAAqB,OAAO,CAAC,MAAM,CAAC,WAAW,CAAC,QAAQ,CAAC,KAAK,KAAK,CAAC,CAAC;QACjF,MAAM,IAAA,YAAI,EAAC,OAAO,CAAC,MAAM,CAAC,WAAW,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;IACxD,CAAC;AACH,CAAC,CAAC,CAAC"}
@@ -0,0 +1,26 @@
1
+ import { Middleware } from '../models';
2
+ declare const _default: Middleware<"history" | "manipulated", import("../models").HttpRequestContext<unknown> & {
3
+ shared: import("../..").SetRequiredKeys<{
4
+ state: Record<string, unknown>;
5
+ seed?: number;
6
+ expectation?: import("../../expectations").Expectation<Pick<import("../models").HttpRequestContext, "incoming" | "outgoing">>;
7
+ manipulated?: import("../../expectations").IExpectationOperatorContext;
8
+ forwarded?: Pick<import("../models").HttpRequestContext, "incoming" | "outgoing">;
9
+ history?: import("../history").History;
10
+ }, "history" | "manipulated">;
11
+ }> & {
12
+ handler: import("../..").TFunction<unknown, [import("../models").HttpRequestContext<unknown> & {
13
+ shared: import("../..").SetRequiredKeys<{
14
+ state: Record<string, unknown>;
15
+ seed?: number;
16
+ expectation?: import("../../expectations").Expectation<Pick<import("../models").HttpRequestContext, "incoming" | "outgoing">>;
17
+ manipulated?: import("../../expectations").IExpectationOperatorContext;
18
+ forwarded?: Pick<import("../models").HttpRequestContext, "incoming" | "outgoing">;
19
+ history?: import("../history").History;
20
+ }, "history" | "manipulated">;
21
+ }, {
22
+ logger: import("../..").Logger;
23
+ }]>;
24
+ };
25
+ export default _default;
26
+ //# sourceMappingURL=destroy.midleware.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"destroy.midleware.d.ts","sourceRoot":"","sources":["../../../../src/server/middlewares/destroy.midleware.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;;;;;;;;;;;;;;;;;;;;;;;;AAEvC,wBAcK"}
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const models_1 = require("../models");
4
+ exports.default = models_1.Middleware
5
+ .build(__filename, ['manipulated', 'history'])
6
+ .assignHandler((context, { logger }) => {
7
+ if (context.shared.manipulated.incoming.error) {
8
+ context.shared.history
9
+ .assign({ error: { code: context.shared.manipulated.incoming.error, isManual: true } })
10
+ .changeState('finished');
11
+ context.server.exchange.ws.publish('history:updated', context.shared.history.toPlain());
12
+ logger.info(`Has destroyed using [${context.shared.manipulated.incoming.error}]`);
13
+ context.response.destroy(new Error(context.shared.manipulated.incoming.error));
14
+ context.complete();
15
+ }
16
+ });
17
+ //# sourceMappingURL=destroy.midleware.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"destroy.midleware.js","sourceRoot":"","sources":["../../../../src/server/middlewares/destroy.midleware.ts"],"names":[],"mappings":";;AACA,sCAAuC;AAEvC,kBAAe,mBAAU;KACtB,KAAK,CAAC,UAAU,EAAE,CAAC,aAAa,EAAE,SAAS,CAAC,CAAC;KAC7C,aAAa,CAAC,CAAC,OAAO,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE;IACrC,IAAI,OAAO,CAAC,MAAM,CAAC,WAAW,CAAC,QAAQ,CAAC,KAAK,EAAE,CAAC;QAC9C,OAAO,CAAC,MAAM,CAAC,OAAO;aACnB,MAAM,CAAC,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,OAAO,CAAC,MAAM,CAAC,WAAW,CAAC,QAAQ,CAAC,KAAK,EAAE,QAAQ,EAAE,IAAI,EAAE,EAAE,CAAC;aACtF,WAAW,CAAC,UAAU,CAAC,CAAC;QAE3B,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,EAAE,CAAC,OAAO,CAAC,iBAAiB,EAAE,OAAO,CAAC,MAAM,CAAC,OAAO,CAAC,OAAO,EAAE,CAAC,CAAC;QACxF,MAAM,CAAC,IAAI,CAAC,wBAAwB,OAAO,CAAC,MAAM,CAAC,WAAW,CAAC,QAAQ,CAAC,KAAK,GAAG,CAAC,CAAC;QAElF,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAC,IAAI,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,WAAW,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC;QAC/E,OAAO,CAAC,QAAQ,EAAE,CAAC;IACrB,CAAC;AACH,CAAC,CAAC,CAAC"}
@@ -0,0 +1,26 @@
1
+ import { Middleware } from '../models';
2
+ declare const _default: Middleware<"history" | "expectation" | "manipulated", import("../models").HttpRequestContext<unknown> & {
3
+ shared: import("../..").SetRequiredKeys<{
4
+ state: Record<string, unknown>;
5
+ seed?: number;
6
+ expectation?: import("../../expectations").Expectation<Pick<import("../models").HttpRequestContext, "incoming" | "outgoing">>;
7
+ manipulated?: import("../../expectations").IExpectationOperatorContext;
8
+ forwarded?: Pick<import("../models").HttpRequestContext, "incoming" | "outgoing">;
9
+ history?: import("../history").History;
10
+ }, "history" | "expectation" | "manipulated">;
11
+ }> & {
12
+ handler: import("../..").TFunction<unknown, [import("../models").HttpRequestContext<unknown> & {
13
+ shared: import("../..").SetRequiredKeys<{
14
+ state: Record<string, unknown>;
15
+ seed?: number;
16
+ expectation?: import("../../expectations").Expectation<Pick<import("../models").HttpRequestContext, "incoming" | "outgoing">>;
17
+ manipulated?: import("../../expectations").IExpectationOperatorContext;
18
+ forwarded?: Pick<import("../models").HttpRequestContext, "incoming" | "outgoing">;
19
+ history?: import("../history").History;
20
+ }, "history" | "expectation" | "manipulated">;
21
+ }, {
22
+ logger: import("../..").Logger;
23
+ }]>;
24
+ };
25
+ export default _default;
26
+ //# sourceMappingURL=forward.middleware.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"forward.middleware.d.ts","sourceRoot":"","sources":["../../../../src/server/middlewares/forward.middleware.ts"],"names":[],"mappings":"AAIA,OAAO,EAAsB,UAAU,EAAkC,MAAM,WAAW,CAAC;;;;;;;;;;;;;;;;;;;;;;;;AAE3F,wBAuFK"}