@api-client/core 0.18.12 → 0.18.13

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 (259) hide show
  1. package/build/src/browser.d.ts +0 -3
  2. package/build/src/browser.d.ts.map +1 -1
  3. package/build/src/browser.js +0 -3
  4. package/build/src/browser.js.map +1 -1
  5. package/build/src/index.d.ts +2 -5
  6. package/build/src/index.d.ts.map +1 -1
  7. package/build/src/index.js +2 -5
  8. package/build/src/index.js.map +1 -1
  9. package/build/src/lib/logging/DefaultLogger.d.ts +14 -0
  10. package/build/src/lib/logging/DefaultLogger.d.ts.map +1 -1
  11. package/build/src/lib/logging/DefaultLogger.js +27 -0
  12. package/build/src/lib/logging/DefaultLogger.js.map +1 -1
  13. package/build/src/lib/logging/index.d.ts +4 -0
  14. package/build/src/lib/logging/index.d.ts.map +1 -0
  15. package/build/src/lib/logging/index.js +10 -0
  16. package/build/src/lib/logging/index.js.map +1 -0
  17. package/build/src/models/ClientCertificate.d.ts +1 -1
  18. package/build/src/models/ClientCertificate.js.map +1 -1
  19. package/build/src/models/RequestConfig.d.ts +1 -1
  20. package/build/src/models/RequestConfig.js.map +1 -1
  21. package/build/src/models/SerializableError.d.ts +1 -1
  22. package/build/src/models/SerializableError.d.ts.map +1 -1
  23. package/build/src/models/SerializableError.js.map +1 -1
  24. package/build/src/proxy/RequestProxy.d.ts.map +1 -1
  25. package/build/src/proxy/RequestProxy.js +2 -2
  26. package/build/src/proxy/RequestProxy.js.map +1 -1
  27. package/build/src/runtime/http-engine/CoreEngine.d.ts +218 -139
  28. package/build/src/runtime/http-engine/CoreEngine.d.ts.map +1 -1
  29. package/build/src/runtime/http-engine/CoreEngine.js +716 -870
  30. package/build/src/runtime/http-engine/CoreEngine.js.map +1 -1
  31. package/build/src/runtime/http-engine/PayloadSupport.d.ts.map +1 -1
  32. package/build/src/runtime/http-engine/PayloadSupport.js +2 -1
  33. package/build/src/runtime/http-engine/PayloadSupport.js.map +1 -1
  34. package/build/src/runtime/http-engine/auth/AuthManager.d.ts +73 -0
  35. package/build/src/runtime/http-engine/auth/AuthManager.d.ts.map +1 -0
  36. package/build/src/runtime/http-engine/auth/AuthManager.js +186 -0
  37. package/build/src/runtime/http-engine/auth/AuthManager.js.map +1 -0
  38. package/build/src/runtime/http-engine/auth/index.d.ts +2 -0
  39. package/build/src/runtime/http-engine/auth/index.d.ts.map +1 -0
  40. package/build/src/runtime/http-engine/auth/index.js +2 -0
  41. package/build/src/runtime/http-engine/auth/index.js.map +1 -0
  42. package/build/src/runtime/http-engine/certificates/CertificateManager.d.ts +11 -0
  43. package/build/src/runtime/http-engine/certificates/CertificateManager.d.ts.map +1 -0
  44. package/build/src/runtime/http-engine/certificates/CertificateManager.js +76 -0
  45. package/build/src/runtime/http-engine/certificates/CertificateManager.js.map +1 -0
  46. package/build/src/runtime/http-engine/certificates/index.d.ts +2 -0
  47. package/build/src/runtime/http-engine/certificates/index.d.ts.map +1 -0
  48. package/build/src/runtime/http-engine/certificates/index.js +2 -0
  49. package/build/src/runtime/http-engine/certificates/index.js.map +1 -0
  50. package/build/src/runtime/http-engine/compression/CompressionManager.d.ts +25 -0
  51. package/build/src/runtime/http-engine/compression/CompressionManager.d.ts.map +1 -0
  52. package/build/src/runtime/http-engine/compression/CompressionManager.js +89 -0
  53. package/build/src/runtime/http-engine/compression/CompressionManager.js.map +1 -0
  54. package/build/src/runtime/http-engine/compression/index.d.ts +2 -0
  55. package/build/src/runtime/http-engine/compression/index.d.ts.map +1 -0
  56. package/build/src/runtime/http-engine/compression/index.js +2 -0
  57. package/build/src/runtime/http-engine/compression/index.js.map +1 -0
  58. package/build/src/runtime/http-engine/connections/ConnectionManager.d.ts +57 -0
  59. package/build/src/runtime/http-engine/connections/ConnectionManager.d.ts.map +1 -0
  60. package/build/src/runtime/http-engine/connections/ConnectionManager.js +78 -0
  61. package/build/src/runtime/http-engine/connections/ConnectionManager.js.map +1 -0
  62. package/build/src/runtime/http-engine/connections/DigestAuthHandler.d.ts +70 -0
  63. package/build/src/runtime/http-engine/connections/DigestAuthHandler.d.ts.map +1 -0
  64. package/build/src/runtime/http-engine/connections/DigestAuthHandler.js +184 -0
  65. package/build/src/runtime/http-engine/connections/DigestAuthHandler.js.map +1 -0
  66. package/build/src/runtime/http-engine/connections/DirectConnection.d.ts +22 -0
  67. package/build/src/runtime/http-engine/connections/DirectConnection.d.ts.map +1 -0
  68. package/build/src/runtime/http-engine/connections/DirectConnection.js +105 -0
  69. package/build/src/runtime/http-engine/connections/DirectConnection.js.map +1 -0
  70. package/build/src/runtime/http-engine/connections/ProxyAuthHandler.d.ts +60 -0
  71. package/build/src/runtime/http-engine/connections/ProxyAuthHandler.d.ts.map +1 -0
  72. package/build/src/runtime/http-engine/connections/ProxyAuthHandler.js +138 -0
  73. package/build/src/runtime/http-engine/connections/ProxyAuthHandler.js.map +1 -0
  74. package/build/src/runtime/http-engine/connections/ProxyConnection.d.ts +14 -0
  75. package/build/src/runtime/http-engine/connections/ProxyConnection.d.ts.map +1 -0
  76. package/build/src/runtime/http-engine/connections/ProxyConnection.js +47 -0
  77. package/build/src/runtime/http-engine/connections/ProxyConnection.js.map +1 -0
  78. package/build/src/runtime/http-engine/connections/TunnelConnection.d.ts +13 -0
  79. package/build/src/runtime/http-engine/connections/TunnelConnection.d.ts.map +1 -0
  80. package/build/src/runtime/http-engine/connections/TunnelConnection.js +175 -0
  81. package/build/src/runtime/http-engine/connections/TunnelConnection.js.map +1 -0
  82. package/build/src/runtime/http-engine/connections/index.d.ts +7 -0
  83. package/build/src/runtime/http-engine/connections/index.d.ts.map +1 -0
  84. package/build/src/runtime/http-engine/connections/index.js +7 -0
  85. package/build/src/runtime/http-engine/connections/index.js.map +1 -0
  86. package/build/src/runtime/http-engine/constants.d.ts +69 -0
  87. package/build/src/runtime/http-engine/constants.d.ts.map +1 -0
  88. package/build/src/runtime/http-engine/constants.js +90 -0
  89. package/build/src/runtime/http-engine/constants.js.map +1 -0
  90. package/build/src/runtime/http-engine/cookies/CookieProcessor.d.ts +5 -0
  91. package/build/src/runtime/http-engine/cookies/CookieProcessor.d.ts.map +1 -0
  92. package/build/src/runtime/http-engine/cookies/CookieProcessor.js +20 -0
  93. package/build/src/runtime/http-engine/cookies/CookieProcessor.js.map +1 -0
  94. package/build/src/runtime/http-engine/cookies/index.d.ts +2 -0
  95. package/build/src/runtime/http-engine/cookies/index.d.ts.map +1 -0
  96. package/build/src/runtime/http-engine/cookies/index.js +2 -0
  97. package/build/src/runtime/http-engine/cookies/index.js.map +1 -0
  98. package/build/src/runtime/http-engine/errors/HttpEngineErrors.d.ts +156 -0
  99. package/build/src/runtime/http-engine/errors/HttpEngineErrors.d.ts.map +1 -0
  100. package/build/src/runtime/http-engine/errors/HttpEngineErrors.js +227 -0
  101. package/build/src/runtime/http-engine/errors/HttpEngineErrors.js.map +1 -0
  102. package/build/src/runtime/http-engine/errors/index.d.ts +2 -0
  103. package/build/src/runtime/http-engine/errors/index.d.ts.map +1 -0
  104. package/build/src/runtime/http-engine/errors/index.js +2 -0
  105. package/build/src/runtime/http-engine/errors/index.js.map +1 -0
  106. package/build/src/runtime/http-engine/message/MessageBuilder.d.ts +66 -0
  107. package/build/src/runtime/http-engine/message/MessageBuilder.d.ts.map +1 -0
  108. package/build/src/runtime/http-engine/message/MessageBuilder.js +161 -0
  109. package/build/src/runtime/http-engine/message/MessageBuilder.js.map +1 -0
  110. package/build/src/runtime/http-engine/message/MessageProcessor.d.ts +27 -0
  111. package/build/src/runtime/http-engine/message/MessageProcessor.d.ts.map +1 -0
  112. package/build/src/runtime/http-engine/message/MessageProcessor.js +51 -0
  113. package/build/src/runtime/http-engine/message/MessageProcessor.js.map +1 -0
  114. package/build/src/runtime/http-engine/message/index.d.ts +3 -0
  115. package/build/src/runtime/http-engine/message/index.d.ts.map +1 -0
  116. package/build/src/runtime/http-engine/message/index.js +3 -0
  117. package/build/src/runtime/http-engine/message/index.js.map +1 -0
  118. package/build/src/runtime/http-engine/ntlm/NtlmAuth.d.ts +2 -8
  119. package/build/src/runtime/http-engine/ntlm/NtlmAuth.d.ts.map +1 -1
  120. package/build/src/runtime/http-engine/ntlm/NtlmAuth.js +11 -5
  121. package/build/src/runtime/http-engine/ntlm/NtlmAuth.js.map +1 -1
  122. package/build/src/runtime/http-engine/ntlm/NtlmMessage.js +6 -6
  123. package/build/src/runtime/http-engine/ntlm/NtlmMessage.js.map +1 -1
  124. package/build/src/runtime/http-engine/parsers/BodyParser.d.ts +39 -0
  125. package/build/src/runtime/http-engine/parsers/BodyParser.d.ts.map +1 -0
  126. package/build/src/runtime/http-engine/parsers/BodyParser.js +145 -0
  127. package/build/src/runtime/http-engine/parsers/BodyParser.js.map +1 -0
  128. package/build/src/runtime/http-engine/parsers/HeadersParser.d.ts +29 -0
  129. package/build/src/runtime/http-engine/parsers/HeadersParser.d.ts.map +1 -0
  130. package/build/src/runtime/http-engine/parsers/HeadersParser.js +88 -0
  131. package/build/src/runtime/http-engine/parsers/HeadersParser.js.map +1 -0
  132. package/build/src/runtime/http-engine/parsers/HttpResponseParser.d.ts +91 -0
  133. package/build/src/runtime/http-engine/parsers/HttpResponseParser.d.ts.map +1 -0
  134. package/build/src/runtime/http-engine/parsers/HttpResponseParser.js +236 -0
  135. package/build/src/runtime/http-engine/parsers/HttpResponseParser.js.map +1 -0
  136. package/build/src/runtime/http-engine/parsers/StatusParser.d.ts +20 -0
  137. package/build/src/runtime/http-engine/parsers/StatusParser.d.ts.map +1 -0
  138. package/build/src/runtime/http-engine/parsers/StatusParser.js +51 -0
  139. package/build/src/runtime/http-engine/parsers/StatusParser.js.map +1 -0
  140. package/build/src/runtime/http-engine/parsers/index.d.ts +5 -0
  141. package/build/src/runtime/http-engine/parsers/index.d.ts.map +1 -0
  142. package/build/src/runtime/http-engine/parsers/index.js +5 -0
  143. package/build/src/runtime/http-engine/parsers/index.js.map +1 -0
  144. package/build/src/runtime/http-engine/response/ResponseProcessor.d.ts +22 -0
  145. package/build/src/runtime/http-engine/response/ResponseProcessor.d.ts.map +1 -0
  146. package/build/src/runtime/http-engine/response/ResponseProcessor.js +25 -0
  147. package/build/src/runtime/http-engine/response/ResponseProcessor.js.map +1 -0
  148. package/build/src/runtime/http-engine/response/index.d.ts +2 -0
  149. package/build/src/runtime/http-engine/response/index.d.ts.map +1 -0
  150. package/build/src/runtime/http-engine/response/index.js +2 -0
  151. package/build/src/runtime/http-engine/response/index.js.map +1 -0
  152. package/build/src/runtime/http-engine/statistics/StatisticsProcessor.d.ts +7 -0
  153. package/build/src/runtime/http-engine/statistics/StatisticsProcessor.d.ts.map +1 -0
  154. package/build/src/runtime/http-engine/statistics/StatisticsProcessor.js +40 -0
  155. package/build/src/runtime/http-engine/statistics/StatisticsProcessor.js.map +1 -0
  156. package/build/src/runtime/http-engine/statistics/index.d.ts +2 -0
  157. package/build/src/runtime/http-engine/statistics/index.d.ts.map +1 -0
  158. package/build/src/runtime/http-engine/statistics/index.js +2 -0
  159. package/build/src/runtime/http-engine/statistics/index.js.map +1 -0
  160. package/build/src/runtime/http-engine/url/UrlProcessor.d.ts +24 -0
  161. package/build/src/runtime/http-engine/url/UrlProcessor.d.ts.map +1 -0
  162. package/build/src/runtime/http-engine/url/UrlProcessor.js +50 -0
  163. package/build/src/runtime/http-engine/url/UrlProcessor.js.map +1 -0
  164. package/build/src/runtime/http-engine/url/index.d.ts +2 -0
  165. package/build/src/runtime/http-engine/url/index.d.ts.map +1 -0
  166. package/build/src/runtime/http-engine/url/index.js +2 -0
  167. package/build/src/runtime/http-engine/url/index.js.map +1 -0
  168. package/build/src/runtime/http-runner/HttpRequestRunner.d.ts +3 -3
  169. package/build/src/runtime/http-runner/HttpRequestRunner.d.ts.map +1 -1
  170. package/build/src/runtime/http-runner/HttpRequestRunner.js.map +1 -1
  171. package/build/src/runtime/node/InteropInterfaces.d.ts +3 -3
  172. package/build/src/runtime/node/InteropInterfaces.d.ts.map +1 -1
  173. package/build/src/runtime/node/InteropInterfaces.js.map +1 -1
  174. package/build/src/runtime/node/ProjectRequestRunner.d.ts +2 -2
  175. package/build/src/runtime/node/ProjectRequestRunner.d.ts.map +1 -1
  176. package/build/src/runtime/node/ProjectRequestRunner.js.map +1 -1
  177. package/build/src/runtime/node/ProjectRunner.d.ts.map +1 -1
  178. package/build/src/runtime/node/ProjectRunner.js +2 -2
  179. package/build/src/runtime/node/ProjectRunner.js.map +1 -1
  180. package/build/tsconfig.tsbuildinfo +1 -1
  181. package/data/models/example-generator-api.json +6 -6
  182. package/package.json +2 -2
  183. package/src/lib/logging/DefaultLogger.ts +32 -0
  184. package/src/models/ClientCertificate.ts +1 -1
  185. package/src/models/RequestConfig.ts +1 -1
  186. package/src/models/SerializableError.ts +1 -1
  187. package/src/proxy/RequestProxy.ts +2 -2
  188. package/src/runtime/http-engine/CoreEngine.ts +858 -893
  189. package/src/runtime/http-engine/PayloadSupport.ts +2 -1
  190. package/src/runtime/http-engine/auth/AuthManager.ts +242 -0
  191. package/src/runtime/http-engine/certificates/CertificateManager.ts +74 -0
  192. package/src/runtime/http-engine/compression/CompressionManager.ts +99 -0
  193. package/src/runtime/http-engine/connections/ConnectionManager.ts +123 -0
  194. package/src/runtime/http-engine/connections/DigestAuthHandler.ts +238 -0
  195. package/src/runtime/http-engine/connections/DirectConnection.ts +134 -0
  196. package/src/runtime/http-engine/connections/ProxyAuthHandler.ts +179 -0
  197. package/src/runtime/http-engine/connections/ProxyConnection.ts +55 -0
  198. package/src/runtime/http-engine/connections/TunnelConnection.ts +192 -0
  199. package/src/runtime/http-engine/constants.ts +103 -0
  200. package/src/runtime/http-engine/cookies/CookieProcessor.ts +25 -0
  201. package/src/runtime/http-engine/errors/HttpEngineErrors.ts +319 -0
  202. package/src/runtime/http-engine/message/MessageBuilder.ts +201 -0
  203. package/src/runtime/http-engine/message/MessageProcessor.ts +73 -0
  204. package/src/runtime/http-engine/ntlm/NtlmAuth.ts +16 -13
  205. package/src/runtime/http-engine/ntlm/NtlmMessage.ts +6 -6
  206. package/src/runtime/http-engine/parsers/BodyParser.ts +171 -0
  207. package/src/runtime/http-engine/parsers/HeadersParser.ts +103 -0
  208. package/src/runtime/http-engine/parsers/HttpResponseParser.ts +280 -0
  209. package/src/runtime/http-engine/parsers/StatusParser.ts +69 -0
  210. package/src/runtime/http-engine/response/ResponseProcessor.ts +46 -0
  211. package/src/runtime/http-engine/statistics/StatisticsProcessor.ts +52 -0
  212. package/src/runtime/http-engine/url/UrlProcessor.ts +55 -0
  213. package/src/runtime/http-runner/HttpRequestRunner.ts +3 -3
  214. package/src/runtime/node/InteropInterfaces.ts +3 -3
  215. package/src/runtime/node/ProjectRequestRunner.ts +2 -2
  216. package/src/runtime/node/ProjectRunner.ts +2 -2
  217. package/tests/servers/ProxyServer.ts +32 -19
  218. package/tests/servers/express-routes/ApiEndpoint.ts +24 -0
  219. package/tests/servers/express-routes/BasicAuthRoute.ts +36 -0
  220. package/tests/servers/express-routes/BearerAuthRoute.ts +35 -0
  221. package/tests/servers/express-routes/NTLMRoute.ts +2 -3
  222. package/tests/servers/express-routes/PostApi.ts +15 -2
  223. package/tests/servers/express-routes/RedirectsApi.ts +12 -1
  224. package/tests/servers/express-routes/ResponsesApi.ts +1 -1
  225. package/tests/servers/express-routes/StreamApi.ts +19 -0
  226. package/tests/servers/oauth2mock/ServerMock.js +1 -1
  227. package/tests/unit/runtime/http-engine/HttpResponseParser.spec.ts +337 -0
  228. package/tests/unit/runtime/http-engine/abort.spec.ts +4 -5
  229. package/tests/unit/runtime/http-engine/auth.spec.ts +7 -58
  230. package/tests/unit/runtime/http-engine/certificates/CertificateManager.spec.ts +482 -0
  231. package/tests/unit/runtime/http-engine/certificates.spec.ts +2 -2
  232. package/tests/unit/runtime/http-engine/compression/CompressionManager.spec.ts +498 -0
  233. package/tests/unit/runtime/http-engine/compression.spec.ts +3 -72
  234. package/tests/unit/runtime/http-engine/connections/ConnectionManager.spec.ts +379 -0
  235. package/tests/unit/runtime/http-engine/connections/DigestAuthHandler.spec.ts +164 -0
  236. package/tests/unit/runtime/http-engine/core_engine.spec.ts +561 -0
  237. package/tests/unit/runtime/http-engine/engine_statuses.spec.ts +2 -2
  238. package/tests/unit/runtime/http-engine/events.spec.ts +2 -2
  239. package/tests/unit/runtime/http-engine/headers.spec.ts +2 -88
  240. package/tests/unit/runtime/http-engine/hosts.spec.ts +2 -2
  241. package/tests/unit/runtime/http-engine/http-get.spec.ts +2 -2
  242. package/tests/unit/runtime/http-engine/http-post.spec.ts +2 -2
  243. package/tests/unit/runtime/http-engine/logger.spec.ts +0 -8
  244. package/tests/unit/runtime/http-engine/message.spec.ts +2 -194
  245. package/tests/unit/runtime/http-engine/params.spec.ts +4 -4
  246. package/tests/unit/runtime/http-engine/proxy.spec.ts +15 -14
  247. package/tests/unit/runtime/http-engine/redirects.spec.ts +2 -2
  248. package/tests/unit/runtime/http-engine/responses.spec.ts +170 -277
  249. package/tests/unit/runtime/http-engine/timeout.spec.ts +3 -3
  250. package/tests/unit/runtime/http-engine/timings.spec.ts +2 -2
  251. package/tests/unit/runtime/proxy/HttpProjectProxy.spec.ts +25 -28
  252. package/tests/unit/runtime/runners/project_runner.spec.ts +2 -2
  253. package/tests/unit/runtime/runners/request_runner.spec.ts +2 -2
  254. package/build/src/runtime/http-engine/HttpEngine.d.ts +0 -311
  255. package/build/src/runtime/http-engine/HttpEngine.d.ts.map +0 -1
  256. package/build/src/runtime/http-engine/HttpEngine.js +0 -802
  257. package/build/src/runtime/http-engine/HttpEngine.js.map +0 -1
  258. package/src/runtime/http-engine/HttpEngine.ts +0 -952
  259. package/tests/unit/runtime/http-engine/connecting.spec.ts +0 -140
@@ -0,0 +1 @@
1
+ {"version":3,"file":"StatisticsProcessor.d.ts","sourceRoot":"","sources":["../../../../../src/runtime/http-engine/statistics/StatisticsProcessor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,gCAAgC,CAAA;AAC5D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAA;AAEpD;;GAEG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,YAAY,GAAG,WAAW,CA6C7D"}
@@ -0,0 +1,40 @@
1
+ import { RequestTime } from '../../../models/RequestTime.js';
2
+ /**
3
+ * Creates HAR 1.2 timings object from stats.
4
+ */
5
+ export function computeStats(stats) {
6
+ const { sentTime, messageStart, connectionTime = 0, lookupTime = 0, connectedTime, secureStartTime, secureConnectedTime, lastReceivedTime, firstReceiveTime, receivingTime, } = stats;
7
+ // in case the `send` event was not handled we use the `messageStart` as this is set when the request is created.
8
+ const adjustedSentTime = sentTime || messageStart;
9
+ // when there was no body we check when the end time.
10
+ const adjustedLastReceivedTime = lastReceivedTime || receivingTime;
11
+ const adjustedLookupTime = lookupTime || messageStart;
12
+ let send = adjustedSentTime && messageStart ? adjustedSentTime - messageStart : -1;
13
+ if (send < 0) {
14
+ send = 0;
15
+ }
16
+ const dns = lookupTime ? lookupTime - connectionTime : -1;
17
+ const connect = connectedTime && adjustedLookupTime ? connectedTime - adjustedLookupTime : -1;
18
+ let receive = adjustedLastReceivedTime && firstReceiveTime ? adjustedLastReceivedTime - firstReceiveTime : -1;
19
+ if (receive < 0) {
20
+ receive = 0;
21
+ }
22
+ let wait = firstReceiveTime && adjustedSentTime ? firstReceiveTime - adjustedSentTime : -1;
23
+ if (wait < 0) {
24
+ wait = 0;
25
+ }
26
+ let ssl = -1;
27
+ if (typeof secureStartTime === 'number' && typeof secureConnectedTime === 'number') {
28
+ ssl = secureConnectedTime - secureStartTime;
29
+ }
30
+ const result = new RequestTime();
31
+ result.blocked = 0;
32
+ result.connect = connect;
33
+ result.receive = receive;
34
+ result.send = send;
35
+ result.wait = wait;
36
+ result.dns = dns;
37
+ result.ssl = ssl;
38
+ return result;
39
+ }
40
+ //# sourceMappingURL=StatisticsProcessor.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"StatisticsProcessor.js","sourceRoot":"","sources":["../../../../../src/runtime/http-engine/statistics/StatisticsProcessor.ts"],"names":[],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1F,IAAI,IAAI,GAAG,CAAC,EAAE,CAAC;QACb,IAAI,GAAG,CAAC,CAAA;IACV,CAAC;IACD,IAAI,GAAG,GAAG,CAAC,CAAC,CAAA;IACZ,IAAI,OAAO,eAAe,KAAK,QAAQ,IAAI,OAAO,mBAAmB,KAAK,QAAQ,EAAE,CAAC;QACnF,GAAG,GAAG,mBAAmB,GAAG,eAAe,CAAA;IAC7C,CAAC;IACD,MAAM,MAAM,GAAG,IAAI,WAAW,EAAE,CAAA;IAChC,MAAM,CAAC,OAAO,GAAG,CAAC,CAAA;IAClB,MAAM,CAAC,OAAO,GAAG,OAAO,CAAA;IACxB,MAAM,CAAC,OAAO,GAAG,OAAO,CAAA;IACxB,MAAM,CAAC,IAAI,GAAG,IAAI,CAAA;IAClB,MAAM,CAAC,IAAI,GAAG,IAAI,CAAA;IAClB,MAAM,CAAC,GAAG,GAAG,GAAG,CAAA;IAChB,MAAM,CAAC,GAAG,GAAG,GAAG,CAAA;IAChB,OAAO,MAAM,CAAA;AACf,CAAC","sourcesContent":["import { RequestTime } from '../../../models/RequestTime.js'\nimport type { RequestStats } from '../CoreEngine.js'\n\n/**\n * Creates HAR 1.2 timings object from stats.\n */\nexport function computeStats(stats: RequestStats): RequestTime {\n const {\n sentTime,\n messageStart,\n connectionTime = 0,\n lookupTime = 0,\n connectedTime,\n secureStartTime,\n secureConnectedTime,\n lastReceivedTime,\n firstReceiveTime,\n receivingTime,\n } = stats\n // in case the `send` event was not handled we use the `messageStart` as this is set when the request is created.\n const adjustedSentTime = sentTime || messageStart\n // when there was no body we check when the end time.\n const adjustedLastReceivedTime = lastReceivedTime || receivingTime\n const adjustedLookupTime = lookupTime || messageStart\n let send = adjustedSentTime && messageStart ? adjustedSentTime - messageStart : -1\n if (send < 0) {\n send = 0\n }\n const dns = lookupTime ? lookupTime - connectionTime : -1\n const connect = connectedTime && adjustedLookupTime ? connectedTime - adjustedLookupTime : -1\n let receive = adjustedLastReceivedTime && firstReceiveTime ? adjustedLastReceivedTime - firstReceiveTime : -1\n if (receive < 0) {\n receive = 0\n }\n let wait = firstReceiveTime && adjustedSentTime ? firstReceiveTime - adjustedSentTime : -1\n if (wait < 0) {\n wait = 0\n }\n let ssl = -1\n if (typeof secureStartTime === 'number' && typeof secureConnectedTime === 'number') {\n ssl = secureConnectedTime - secureStartTime\n }\n const result = new RequestTime()\n result.blocked = 0\n result.connect = connect\n result.receive = receive\n result.send = send\n result.wait = wait\n result.dns = dns\n result.ssl = ssl\n return result\n}\n"]}
@@ -0,0 +1,2 @@
1
+ export { computeStats } from './StatisticsProcessor.js';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/runtime/http-engine/statistics/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAA"}
@@ -0,0 +1,2 @@
1
+ export { computeStats } from './StatisticsProcessor.js';
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/runtime/http-engine/statistics/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAA","sourcesContent":["export { computeStats } from './StatisticsProcessor.js'\n"]}
@@ -0,0 +1,24 @@
1
+ import { URL } from 'url';
2
+ import { IRequestBaseConfig } from '../../../models/RequestConfig.js';
3
+ export interface UrlProcessorOptions {
4
+ hosts?: IRequestBaseConfig['hosts'];
5
+ }
6
+ /**
7
+ * Updates the `uri` property from current request URL
8
+ */
9
+ export declare function readUrl(value: string, options?: UrlProcessorOptions): URL;
10
+ /**
11
+ * Get host header for the request
12
+ */
13
+ export declare function getHostHeader(url: string, options?: UrlProcessorOptions): string | undefined;
14
+ /**
15
+ * Get redirect location
16
+ */
17
+ export declare function getRedirectLocation(location: string, currentUrl: string): string;
18
+ /**
19
+ * Check if redirect is a loop
20
+ */
21
+ export declare function isRedirectLoop(location: string, redirects: {
22
+ url: string;
23
+ }[]): boolean;
24
+ //# sourceMappingURL=UrlProcessor.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"UrlProcessor.d.ts","sourceRoot":"","sources":["../../../../../src/runtime/http-engine/url/UrlProcessor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAA;AAEzB,OAAO,EAAE,kBAAkB,EAAE,MAAM,kCAAkC,CAAA;AAErE,MAAM,WAAW,mBAAmB;IAClC,KAAK,CAAC,EAAE,kBAAkB,CAAC,OAAO,CAAC,CAAA;CACpC;AAED;;GAEG;AACH,wBAAgB,OAAO,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,GAAE,mBAAwB,GAAG,GAAG,CAS7E;AAED;;GAEG;AACH,wBAAgB,aAAa,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,GAAE,mBAAwB,GAAG,MAAM,GAAG,SAAS,CAUhG;AAED;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,QAAQ,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,MAAM,CAOhF;AAED;;GAEG;AACH,wBAAgB,cAAc,CAAC,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAE;IAAE,GAAG,EAAE,MAAM,CAAA;CAAE,EAAE,GAAG,OAAO,CAEtF"}
@@ -0,0 +1,50 @@
1
+ import { URL } from 'url';
2
+ import { HostRule } from '../../../models/HostRule.js';
3
+ /**
4
+ * Updates the `uri` property from current request URL
5
+ */
6
+ export function readUrl(value, options = {}) {
7
+ const { hosts = [] } = options;
8
+ const instances = hosts.map((i) => new HostRule(i));
9
+ value = HostRule.applyHosts(value, instances);
10
+ try {
11
+ return new URL(value);
12
+ }
13
+ catch {
14
+ throw new Error(`Unable to parse the URL: ${value}`);
15
+ }
16
+ }
17
+ /**
18
+ * Get host header for the request
19
+ */
20
+ export function getHostHeader(url, options = {}) {
21
+ const { hosts = [] } = options;
22
+ const instances = hosts.map((i) => new HostRule(i));
23
+ const processedUrl = HostRule.applyHosts(url, instances);
24
+ try {
25
+ const parsed = new URL(processedUrl);
26
+ return parsed.host;
27
+ }
28
+ catch {
29
+ return undefined;
30
+ }
31
+ }
32
+ /**
33
+ * Get redirect location
34
+ */
35
+ export function getRedirectLocation(location, currentUrl) {
36
+ try {
37
+ const url = new URL(location, currentUrl);
38
+ return url.toString();
39
+ }
40
+ catch {
41
+ return location;
42
+ }
43
+ }
44
+ /**
45
+ * Check if redirect is a loop
46
+ */
47
+ export function isRedirectLoop(location, redirects) {
48
+ return redirects.some((redirect) => redirect.url === location);
49
+ }
50
+ //# sourceMappingURL=UrlProcessor.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"UrlProcessor.js","sourceRoot":"","sources":["../../../../../src/runtime/http-engine/url/UrlProcessor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAA;AACzB,OAAO,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAA;AAOtD;;GAEG;AACH,MAAM,UAAU,OAAO,CAAC,KAAa,EAAE,UAA+B,EAAE;IACtE,MAAM,EAAE,KAAK,GAAG,EAAE,EAAE,GAAG,OAAO,CAAA;IAC9B,MAAM,SAAS,GAAG,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,IAAI,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAA;IACnD,KAAK,GAAG,QAAQ,CAAC,UAAU,CAAC,KAAK,EAAE,SAAS,CAAC,CAAA;IAC7C,IAAI,CAAC;QACH,OAAO,IAAI,GAAG,CAAC,KAAK,CAAC,CAAA;IACvB,CAAC;IAAC,MAAM,CAAC;QACP,MAAM,IAAI,KAAK,CAAC,4BAA4B,KAAK,EAAE,CAAC,CAAA;IACtD,CAAC;AACH,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,aAAa,CAAC,GAAW,EAAE,UAA+B,EAAE;IAC1E,MAAM,EAAE,KAAK,GAAG,EAAE,EAAE,GAAG,OAAO,CAAA;IAC9B,MAAM,SAAS,GAAG,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,IAAI,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAA;IACnD,MAAM,YAAY,GAAG,QAAQ,CAAC,UAAU,CAAC,GAAG,EAAE,SAAS,CAAC,CAAA;IACxD,IAAI,CAAC;QACH,MAAM,MAAM,GAAG,IAAI,GAAG,CAAC,YAAY,CAAC,CAAA;QACpC,OAAO,MAAM,CAAC,IAAI,CAAA;IACpB,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,SAAS,CAAA;IAClB,CAAC;AACH,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,mBAAmB,CAAC,QAAgB,EAAE,UAAkB;IACtE,IAAI,CAAC;QACH,MAAM,GAAG,GAAG,IAAI,GAAG,CAAC,QAAQ,EAAE,UAAU,CAAC,CAAA;QACzC,OAAO,GAAG,CAAC,QAAQ,EAAE,CAAA;IACvB,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,QAAQ,CAAA;IACjB,CAAC;AACH,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,cAAc,CAAC,QAAgB,EAAE,SAA4B;IAC3E,OAAO,SAAS,CAAC,IAAI,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,QAAQ,CAAC,GAAG,KAAK,QAAQ,CAAC,CAAA;AAChE,CAAC","sourcesContent":["import { URL } from 'url'\nimport { HostRule } from '../../../models/HostRule.js'\nimport { IRequestBaseConfig } from '../../../models/RequestConfig.js'\n\nexport interface UrlProcessorOptions {\n hosts?: IRequestBaseConfig['hosts']\n}\n\n/**\n * Updates the `uri` property from current request URL\n */\nexport function readUrl(value: string, options: UrlProcessorOptions = {}): URL {\n const { hosts = [] } = options\n const instances = hosts.map((i) => new HostRule(i))\n value = HostRule.applyHosts(value, instances)\n try {\n return new URL(value)\n } catch {\n throw new Error(`Unable to parse the URL: ${value}`)\n }\n}\n\n/**\n * Get host header for the request\n */\nexport function getHostHeader(url: string, options: UrlProcessorOptions = {}): string | undefined {\n const { hosts = [] } = options\n const instances = hosts.map((i) => new HostRule(i))\n const processedUrl = HostRule.applyHosts(url, instances)\n try {\n const parsed = new URL(processedUrl)\n return parsed.host\n } catch {\n return undefined\n }\n}\n\n/**\n * Get redirect location\n */\nexport function getRedirectLocation(location: string, currentUrl: string): string {\n try {\n const url = new URL(location, currentUrl)\n return url.toString()\n } catch {\n return location\n }\n}\n\n/**\n * Check if redirect is a loop\n */\nexport function isRedirectLoop(location: string, redirects: { url: string }[]): boolean {\n return redirects.some((redirect) => redirect.url === location)\n}\n"]}
@@ -0,0 +1,2 @@
1
+ export { readUrl, getHostHeader, getRedirectLocation, isRedirectLoop, type UrlProcessorOptions, } from './UrlProcessor.js';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/runtime/http-engine/url/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,OAAO,EACP,aAAa,EACb,mBAAmB,EACnB,cAAc,EACd,KAAK,mBAAmB,GACzB,MAAM,mBAAmB,CAAA"}
@@ -0,0 +1,2 @@
1
+ export { readUrl, getHostHeader, getRedirectLocation, isRedirectLoop, } from './UrlProcessor.js';
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/runtime/http-engine/url/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,OAAO,EACP,aAAa,EACb,mBAAmB,EACnB,cAAc,GAEf,MAAM,mBAAmB,CAAA","sourcesContent":["export {\n readUrl,\n getHostHeader,\n getRedirectLocation,\n isRedirectLoop,\n type UrlProcessorOptions,\n} from './UrlProcessor.js'\n"]}
@@ -1,3 +1,4 @@
1
+ import { Logger, type ILogObj } from 'tslog';
1
2
  import { IRequest } from '../../models/Request.js';
2
3
  import { IHttpRequest } from '../../models/HttpRequest.js';
3
4
  import { IRequestConfig } from '../../models/RequestConfig.js';
@@ -6,8 +7,7 @@ import { IRequestLog } from '../../models/RequestLog.js';
6
7
  import { VariablesProcessor } from '../variables/VariablesProcessor.js';
7
8
  import { IHttpFlow } from '../../models/http-flows/HttpFlows.js';
8
9
  import { AssertionResult, IHttpAssertion } from '../../models/http-flows/HttpAssertion.js';
9
- import { HttpEngineOptions } from '../http-engine/HttpEngine.js';
10
- import { Logger } from '../../lib/logging/Logger.js';
10
+ import type { HttpEngineOptions } from '../http-engine/CoreEngine.js';
11
11
  import { CookieJar } from '../../cookies/CookieJar.js';
12
12
  import { ISentRequest } from '../../models/SentRequest.js';
13
13
  import { IResponse } from '../../models/Response.js';
@@ -52,7 +52,7 @@ export declare class HttpRequestRunner {
52
52
  * The variables processor instance.
53
53
  */
54
54
  variablesProcessor: VariablesProcessor;
55
- logger?: Logger;
55
+ logger?: Logger<ILogObj>;
56
56
  /**
57
57
  * The abort signal to set on this request.
58
58
  * Aborts the request when the signal fires.
@@ -1 +1 @@
1
- {"version":3,"file":"HttpRequestRunner.d.ts","sourceRoot":"","sources":["../../../../src/runtime/http-runner/HttpRequestRunner.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAA;AAClD,OAAO,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAA;AAC1D,OAAO,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAA;AAC9D,OAAO,EAAE,qBAAqB,EAAE,MAAM,sCAAsC,CAAA;AAC5E,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAA;AACxD,OAAO,EAAE,kBAAkB,EAAE,MAAM,oCAAoC,CAAA;AACvE,OAAO,EAAE,SAAS,EAAE,MAAM,sCAAsC,CAAA;AAChE,OAAO,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,0CAA0C,CAAA;AAC1F,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAA;AAEhE,O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QACnB,CAAC;QACD,OAAO,MAAM,CAAA;IACf,CAAC;CACF","sourcesContent":["import { IRequest } from '../../models/Request.js'\nimport { IHttpRequest } from '../../models/HttpRequest.js'\nimport { IRequestConfig } from '../../models/RequestConfig.js'\nimport { IRequestAuthorization } from '../../models/RequestAuthorization.js'\nimport { IRequestLog } from '../../models/RequestLog.js'\nimport { VariablesProcessor } from '../variables/VariablesProcessor.js'\nimport { IHttpFlow } from '../../models/http-flows/HttpFlows.js'\nimport { AssertionResult, IHttpAssertion } from '../../models/http-flows/HttpAssertion.js'\nimport { HttpEngineOptions } from '../http-engine/HttpEngine.js'\nimport { CoreEngine } from '../http-engine/CoreEngine.js'\nimport { Logger } from '../../lib/logging/Logger.js'\nimport { CookieJar } from '../../cookies/CookieJar.js'\nimport { SecurityProcessor } from '../../authorization/lib/SecurityProcessor.js'\nimport { RequestCookiesProcessor } from './RequestCookiesProcessor.js'\nimport { HttpFlowRunner } from './HttpFlowRunner.js'\nimport { ISentRequest } from '../../models/SentRequest.js'\nimport { IResponse } from '../../models/Response.js'\nimport { IErrorResponse } from '../../models/ErrorResponse.js'\nimport { HttpCertificate } from '../../models/ClientCertificate.js'\nimport { HttpAssertionRunner } from './HttpAssertionRunner.js'\n\n/**\n * A class that takes a single HttpRequest definition and executes it.\n *\n * This class does the following (in order):\n *\n * - applies variables\n * - applies authorization configuration\n * - applies cookies\n * - runs request actions\n * - transports the request\n * - processes response and redirect cookies\n * - runs response actions\n * - reports the request log\n */\nexport class HttpRequestRunner {\n /**\n * Request processing configuration.\n */\n config?: IRequestConfig\n\n /**\n * Request authorization configuration\n */\n authorization?: IRequestAuthorization[]\n\n /**\n * Actions to be performed when the request is executed.\n */\n flows?: IHttpFlow[]\n\n /**\n * The cumulative list of all variables to be applied to the request and other properties.\n * The variables must be already processed for variables in values (evaluated).\n *\n * These variables are passed by reference. Changes made anywhere to the variables will result\n * with updating this list.\n */\n variables?: Record<string, string>\n\n /**\n * The variables processor instance.\n */\n variablesProcessor = new VariablesProcessor()\n\n logger?: Logger\n\n /**\n * The abort signal to set on this request.\n * Aborts the request when the signal fires.\n * @type {(AbortSignal | undefined)}\n */\n signal?: AbortSignal\n\n /**\n * An instance of a cookie jar (store) to put/read cookies.\n */\n cookies?: CookieJar\n\n /**\n * Certificates to send with the request.\n */\n certificates?: HttpCertificate[]\n\n assertions?: IHttpAssertion[]\n\n /**\n * Creates an instance from the IRequest object with setting the corresponding variables.\n * @param request The request object to use.\n */\n static fromRequest(request: IRequest): HttpRequestRunner {\n const instance = new HttpRequestRunner()\n instance.flows = request.flows\n instance.authorization = request.authorization\n instance.config = request.config\n instance.assertions = request.assertions\n return instance\n }\n\n /**\n * Runs the request and all tasks around the HTTp request execution like gathering\n * environment information, running actions, and HTTP modules.\n *\n * @param request The request object to execute.\n * @returns The execution log.\n */\n async run(request: IHttpRequest): Promise<IRequestLog> {\n const requestCopy = await this.processRequest(request)\n const result = await this.executeRequest(requestCopy)\n await this.processResponse(result)\n return result\n }\n\n /**\n * @returns the configuration processed by the variables processor.\n */\n async readConfig(): Promise<IRequestConfig | undefined> {\n const { config, variables, variablesProcessor } = this\n if (!config) {\n return undefined\n }\n if (!variables) {\n return config\n }\n return variablesProcessor.evaluateVariablesWithContext(config, variables)\n }\n\n /**\n * @returns the authorization data processed by the variables processor.\n */\n async readAuthorization(): Promise<IRequestAuthorization[] | undefined> {\n const { variables, authorization, variablesProcessor } = this\n if (!Array.isArray(authorization) || !authorization.length) {\n return undefined\n }\n if (!variables) {\n return authorization\n }\n\n const ps = authorization\n .filter((i) => i.enabled !== false)\n .map(async (item) => {\n const copy = await variablesProcessor.evaluateVariablesWithContext(item, variables)\n if (copy.config) {\n copy.config = await variablesProcessor.evaluateVariablesWithContext(copy.config, variables)\n }\n return copy\n })\n const result = await Promise.all(ps)\n return result\n }\n\n /**\n * Prepares the request object before making the HTTP request\n * and runs actions and modules.\n *\n * @param request The request to execute.\n * @returns the copy of the request object.\n */\n async processRequest(request: IHttpRequest): Promise<IHttpRequest> {\n let copy = await this.applyVariables(request)\n copy = await this.applyAuthorization(copy)\n copy = await this.applyCookies(copy)\n await this.runRequestFlows(copy)\n return copy\n }\n\n /**\n * Runs the request through the variables processor.\n * @returns A copy of the passed request with possibly changed values.\n */\n async applyVariables(request: IHttpRequest): Promise<IHttpRequest> {\n const { variables, variablesProcessor } = this\n let copy: IHttpRequest = { ...request }\n if (variables) {\n copy.url = this.prepareRequestUrl(copy.url, variables)\n copy = await variablesProcessor.evaluateVariablesWithContext(copy, variables)\n }\n return copy\n }\n\n async applyAuthorization(request: IHttpRequest): Promise<IHttpRequest> {\n const auth = await this.readAuthorization()\n SecurityProcessor.applyAuthorization(request, auth)\n return request\n }\n\n async applyCookies(request: IHttpRequest): Promise<IHttpRequest> {\n const { cookies } = this\n if (!cookies || !this.sessionCookies) {\n return request\n }\n const list = await cookies.listCookies(request.url)\n RequestCookiesProcessor.request(request, list)\n return request\n }\n\n /**\n * Executes the request actions and modules.\n */\n async runRequestFlows(request: IHttpRequest): Promise<void> {\n const flows = await this.readFlows('request')\n const runner = new HttpFlowRunner()\n runner.cookies = this.cookies\n runner.variables = this.variables\n await runner.request(request, flows)\n }\n\n /**\n * Executes the request actions and modules.\n */\n async runResponseFlows(request: ISentRequest, response: IResponse | IErrorResponse): Promise<void> {\n const flows = await this.readFlows('response')\n const runner = new HttpFlowRunner()\n runner.cookies = this.cookies\n runner.variables = this.variables\n await runner.response(request, response, flows)\n }\n\n /**\n * Reads and evaluates action flows.\n *\n * @param trigger The trigger name to read the flows for.\n */\n protected async readFlows(trigger: 'request' | 'response'): Promise<IHttpFlow[]> {\n const result: IHttpFlow[] = []\n const { flows, variables = {}, variablesProcessor } = this\n if (!Array.isArray(flows) || !flows.length) {\n return result\n }\n for (const flow of flows) {\n if (flow.trigger !== trigger) {\n continue\n }\n if (!Array.isArray(flow.actions) || !flow.actions.length) {\n continue\n }\n const copy = { ...flow } as IHttpFlow\n if (copy.condition) {\n copy.condition = await variablesProcessor.evaluateVariablesWithContext(copy.condition, variables)\n }\n const actions = copy.actions.map(async (action) => {\n const actionCopy = { ...action }\n if (Array.isArray(actionCopy.steps) && actionCopy.steps.length) {\n const stepsPromises = actionCopy.steps.map((step) =>\n variablesProcessor.evaluateVariablesWithContext(step, variables)\n )\n actionCopy.steps = await Promise.all(stepsPromises)\n }\n return actionCopy\n })\n copy.actions = await Promise.all(actions)\n result.push(copy)\n }\n return result\n }\n\n /**\n * Prepares the HTTP engine configuration and executes the request,\n * @param request The request to execute.\n * @returns The execution log.\n */\n async executeRequest(request: IHttpRequest): Promise<IRequestLog> {\n const opts = await this.prepareEngineConfig()\n const engine = new CoreEngine(request, opts)\n return engine.send()\n }\n\n /**\n * Creates a configuration options for the HTTP engine.\n */\n async prepareEngineConfig(): Promise<HttpEngineOptions> {\n const { logger, signal } = this\n const auth = await this.readAuthorization()\n const config = await this.readConfig()\n const cert = SecurityProcessor.readCertificate(auth)\n const opts: HttpEngineOptions = {}\n if (cert) {\n opts.certificates = [cert]\n }\n if (this.certificates) {\n if (!opts.certificates) {\n opts.certificates = []\n }\n opts.certificates = opts.certificates.concat(this.certificates)\n }\n if (Array.isArray(auth)) {\n opts.authorization = auth\n }\n if (logger) {\n opts.logger = logger\n }\n if (signal) {\n opts.signal = signal\n }\n if (!config || config.enabled === false) {\n return opts\n }\n if (typeof config.timeout === 'number') {\n opts.timeout = config.timeout\n }\n if (typeof config.sentMessageLimit === 'number') {\n opts.sentMessageLimit = config.sentMessageLimit\n }\n if (typeof config.followRedirects === 'boolean') {\n opts.followRedirects = config.followRedirects\n }\n if (typeof config.defaultHeaders === 'boolean') {\n opts.defaultHeaders = config.defaultHeaders\n }\n if (typeof config.validateCertificates === 'boolean') {\n opts.validateCertificates = config.validateCertificates\n }\n if (config.defaultUserAgent) {\n opts.defaultUserAgent = config.defaultUserAgent\n }\n if (config.defaultAccept) {\n opts.defaultAccept = config.defaultAccept\n }\n if (config.proxy) {\n opts.proxy = config.proxy\n }\n if (config.proxyUsername) {\n opts.proxyUsername = config.proxyUsername\n }\n if (config.proxyPassword) {\n opts.proxyPassword = config.proxyPassword\n }\n if (Array.isArray(config.hosts)) {\n opts.hosts = config.hosts\n }\n return opts\n }\n\n async processResponse(log: IRequestLog): Promise<void> {\n const { request, response } = log\n if (!request || !response) {\n return\n }\n if (this.cookies && this.sessionCookies) {\n const cookies = RequestCookiesProcessor.response(log)\n if (cookies) {\n const ps = Object.keys(cookies).map((url) => {\n const items = cookies[url]\n this.cookies?.setCookies(url, items)\n })\n await Promise.allSettled(ps)\n }\n }\n await this.runResponseFlows(request, response)\n const assertions = await this.runAssertions(request, response)\n if (assertions) {\n log.assertions = assertions\n }\n }\n\n get sessionCookies(): boolean {\n const { config } = this\n if (!config) {\n return true\n }\n if (config.enabled === false) {\n return true\n }\n return !config.ignoreSessionCookies\n }\n\n /**\n * When defined it applies the serve's base URI to relative URLs.\n * @param currentUrl The URL to process.\n */\n prepareRequestUrl(currentUrl: string, variables: Record<string, string>): string {\n const { baseUri } = variables\n if (!baseUri) {\n return currentUrl\n }\n if (currentUrl.startsWith('http:') || currentUrl.startsWith('https:')) {\n return currentUrl\n }\n if (currentUrl.startsWith('/')) {\n return `${baseUri}${currentUrl}`\n }\n return `${baseUri}/${currentUrl}`\n }\n\n /**\n * Prepares and runs assertions on the response.\n * It changes the response object by setting the assertions result.\n */\n async runAssertions(\n request: ISentRequest,\n response: IResponse | IErrorResponse\n ): Promise<AssertionResult[] | undefined> {\n const assertions = await this.readAssertions()\n if (!assertions.length) {\n return\n }\n const factory = new HttpAssertionRunner()\n return factory.run(request, response, assertions)\n }\n\n /**\n * @returns Prepared (evaluated with variables) assertions. Only not disabled assertions are returned.\n */\n protected async readAssertions(): Promise<IHttpAssertion[]> {\n const { assertions, variablesProcessor, variables = {} } = this\n if (!Array.isArray(assertions) || !assertions.length) {\n return []\n }\n const result: IHttpAssertion[] = []\n for (const assertion of assertions) {\n if (assertion.enabled === false) {\n continue\n }\n if (!Array.isArray(assertion.steps) || !assertion.steps.length) {\n continue\n }\n const copy = { ...assertion } as IHttpAssertion\n const stepsPromises = copy.steps.map(async (step) => {\n return variablesProcessor.evaluateVariablesWithContext(step, variables)\n })\n copy.steps = await Promise.all(stepsPromises)\n result.push(copy)\n }\n return result\n }\n}\n"]}
1
+ {"version":3,"file":"HttpRequestRunner.js","sourceRoot":"","sources":["../../../../src/runtime/http-runner/HttpRequestRunner.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,kBAAkB,EAAE,MAAM,oCAAoC,CAAA;AAIvE,OAAO,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAA;AAEzD,OAAO,EAAE,iBAAiB,EAAE,MAAM,8CAA8C,CAAA;AAChF,OAAO,EAAE,uBAAuB,EAAE,MAAM,8BAA8B,CAAA;AACtE,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAA;AAKpD,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAA;AAE9D;;;;;;;;;;;;;GAaG;AACH,MAAM,OAAO,iBAAiB;IAC5B;;OAEG;IACH,MAAM,CAAiB;IAEvB;;OAEG;IACH,aAAa,CAA0B;IAEvC;;OAEG;IACH,KAAK,CAAc;IAEnB;;;;;;OAMG;IACH,SAAS,CAAyB;IAElC;;OAEG;IACH,kBAAkB,GAAG,IAAI,kBAAkB,EAAE,CAAA;IAE7C,MAAM,CAAkB;IAExB;;;;OAIG;IACH,MAAM,CAAc;IAEpB;;OAEG;IACH,OAAO,CAAY;IAEnB;;OAEG;IACH,YAAY,CAAoB;IAEhC,UAAU,CAAmB;IAE7B;;;OAGG;IACH,MAAM,CAAC,WAAW,CAAC,OAAiB;QAClC,MAAM,QAAQ,GAAG,IAAI,iBAAiB,EAAE,CAAA;QACxC,QAAQ,CAAC,KAAK,GAAG,OAAO,CAAC,KAAK,CAAA;QAC9B,QAAQ,CAAC,aAAa,GAAG,OAAO,CAAC,aAAa,CAAA;QAC9C,QAAQ,CAAC,MAAM,GAAG,OAAO,CAA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AO,CAAC,GAAG,CAAC,OAAO,EAAE,QAAQ,EAAE,UAAU,CAAC,CAAA;IACnD,CAAC;IAED;;OAEG;IACO,KAAK,CAAC,cAAc;QAC5B,MAAM,EAAE,UAAU,EAAE,kBAAkB,EAAE,SAAS,GAAG,EAAE,EAAE,GAAG,IAAI,CAAA;QAC/D,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,UAAU,CAAC,IAAI,CAAC,UAAU,CAAC,MAAM,EAAE,CAAC;YACrD,OAAO,EAAE,CAAA;QACX,CAAC;QACD,MAAM,MAAM,GAAqB,EAAE,CAAA;QACnC,KAAK,MAAM,SAAS,IAAI,UAAU,EAAE,CAAC;YACnC,IAAI,SAAS,CAAC,OAAO,KAAK,KAAK,EAAE,CAAC;gBAChC,SAAQ;YACV,CAAC;YACD,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,SAAS,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,MAAM,EAAE,CAAC;gBAC/D,SAAQ;YACV,CAAC;YACD,MAAM,IAAI,GAAG,EAAE,GAAG,SAAS,EAAoB,CAAA;YAC/C,MAAM,aAAa,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,KAAK,EAAE,IAAI,EAAE,EAAE;gBAClD,OAAO,kBAAkB,CAAC,4BAA4B,CAAC,IAAI,EAAE,SAAS,CAAC,CAAA;YACzE,CAAC,CAAC,CAAA;YACF,IAAI,CAAC,KAAK,GAAG,MAAM,OAAO,CAAC,GAAG,CAAC,aAAa,CAAC,CAAA;YAC7C,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;QACnB,CAAC;QACD,OAAO,MAAM,CAAA;IACf,CAAC;CACF","sourcesContent":["import { Logger, type ILogObj } from 'tslog'\nimport { IRequest } from '../../models/Request.js'\nimport { IHttpRequest } from '../../models/HttpRequest.js'\nimport { IRequestConfig } from '../../models/RequestConfig.js'\nimport { IRequestAuthorization } from '../../models/RequestAuthorization.js'\nimport { IRequestLog } from '../../models/RequestLog.js'\nimport { VariablesProcessor } from '../variables/VariablesProcessor.js'\nimport { IHttpFlow } from '../../models/http-flows/HttpFlows.js'\nimport { AssertionResult, IHttpAssertion } from '../../models/http-flows/HttpAssertion.js'\nimport type { HttpEngineOptions } from '../http-engine/CoreEngine.js'\nimport { CoreEngine } from '../http-engine/CoreEngine.js'\nimport { CookieJar } from '../../cookies/CookieJar.js'\nimport { SecurityProcessor } from '../../authorization/lib/SecurityProcessor.js'\nimport { RequestCookiesProcessor } from './RequestCookiesProcessor.js'\nimport { HttpFlowRunner } from './HttpFlowRunner.js'\nimport { ISentRequest } from '../../models/SentRequest.js'\nimport { IResponse } from '../../models/Response.js'\nimport { IErrorResponse } from '../../models/ErrorResponse.js'\nimport { HttpCertificate } from '../../models/ClientCertificate.js'\nimport { HttpAssertionRunner } from './HttpAssertionRunner.js'\n\n/**\n * A class that takes a single HttpRequest definition and executes it.\n *\n * This class does the following (in order):\n *\n * - applies variables\n * - applies authorization configuration\n * - applies cookies\n * - runs request actions\n * - transports the request\n * - processes response and redirect cookies\n * - runs response actions\n * - reports the request log\n */\nexport class HttpRequestRunner {\n /**\n * Request processing configuration.\n */\n config?: IRequestConfig\n\n /**\n * Request authorization configuration\n */\n authorization?: IRequestAuthorization[]\n\n /**\n * Actions to be performed when the request is executed.\n */\n flows?: IHttpFlow[]\n\n /**\n * The cumulative list of all variables to be applied to the request and other properties.\n * The variables must be already processed for variables in values (evaluated).\n *\n * These variables are passed by reference. Changes made anywhere to the variables will result\n * with updating this list.\n */\n variables?: Record<string, string>\n\n /**\n * The variables processor instance.\n */\n variablesProcessor = new VariablesProcessor()\n\n logger?: Logger<ILogObj>\n\n /**\n * The abort signal to set on this request.\n * Aborts the request when the signal fires.\n * @type {(AbortSignal | undefined)}\n */\n signal?: AbortSignal\n\n /**\n * An instance of a cookie jar (store) to put/read cookies.\n */\n cookies?: CookieJar\n\n /**\n * Certificates to send with the request.\n */\n certificates?: HttpCertificate[]\n\n assertions?: IHttpAssertion[]\n\n /**\n * Creates an instance from the IRequest object with setting the corresponding variables.\n * @param request The request object to use.\n */\n static fromRequest(request: IRequest): HttpRequestRunner {\n const instance = new HttpRequestRunner()\n instance.flows = request.flows\n instance.authorization = request.authorization\n instance.config = request.config\n instance.assertions = request.assertions\n return instance\n }\n\n /**\n * Runs the request and all tasks around the HTTp request execution like gathering\n * environment information, running actions, and HTTP modules.\n *\n * @param request The request object to execute.\n * @returns The execution log.\n */\n async run(request: IHttpRequest): Promise<IRequestLog> {\n const requestCopy = await this.processRequest(request)\n const result = await this.executeRequest(requestCopy)\n await this.processResponse(result)\n return result\n }\n\n /**\n * @returns the configuration processed by the variables processor.\n */\n async readConfig(): Promise<IRequestConfig | undefined> {\n const { config, variables, variablesProcessor } = this\n if (!config) {\n return undefined\n }\n if (!variables) {\n return config\n }\n return variablesProcessor.evaluateVariablesWithContext(config, variables)\n }\n\n /**\n * @returns the authorization data processed by the variables processor.\n */\n async readAuthorization(): Promise<IRequestAuthorization[] | undefined> {\n const { variables, authorization, variablesProcessor } = this\n if (!Array.isArray(authorization) || !authorization.length) {\n return undefined\n }\n if (!variables) {\n return authorization\n }\n\n const ps = authorization\n .filter((i) => i.enabled !== false)\n .map(async (item) => {\n const copy = await variablesProcessor.evaluateVariablesWithContext(item, variables)\n if (copy.config) {\n copy.config = await variablesProcessor.evaluateVariablesWithContext(copy.config, variables)\n }\n return copy\n })\n const result = await Promise.all(ps)\n return result\n }\n\n /**\n * Prepares the request object before making the HTTP request\n * and runs actions and modules.\n *\n * @param request The request to execute.\n * @returns the copy of the request object.\n */\n async processRequest(request: IHttpRequest): Promise<IHttpRequest> {\n let copy = await this.applyVariables(request)\n copy = await this.applyAuthorization(copy)\n copy = await this.applyCookies(copy)\n await this.runRequestFlows(copy)\n return copy\n }\n\n /**\n * Runs the request through the variables processor.\n * @returns A copy of the passed request with possibly changed values.\n */\n async applyVariables(request: IHttpRequest): Promise<IHttpRequest> {\n const { variables, variablesProcessor } = this\n let copy: IHttpRequest = { ...request }\n if (variables) {\n copy.url = this.prepareRequestUrl(copy.url, variables)\n copy = await variablesProcessor.evaluateVariablesWithContext(copy, variables)\n }\n return copy\n }\n\n async applyAuthorization(request: IHttpRequest): Promise<IHttpRequest> {\n const auth = await this.readAuthorization()\n SecurityProcessor.applyAuthorization(request, auth)\n return request\n }\n\n async applyCookies(request: IHttpRequest): Promise<IHttpRequest> {\n const { cookies } = this\n if (!cookies || !this.sessionCookies) {\n return request\n }\n const list = await cookies.listCookies(request.url)\n RequestCookiesProcessor.request(request, list)\n return request\n }\n\n /**\n * Executes the request actions and modules.\n */\n async runRequestFlows(request: IHttpRequest): Promise<void> {\n const flows = await this.readFlows('request')\n const runner = new HttpFlowRunner()\n runner.cookies = this.cookies\n runner.variables = this.variables\n await runner.request(request, flows)\n }\n\n /**\n * Executes the request actions and modules.\n */\n async runResponseFlows(request: ISentRequest, response: IResponse | IErrorResponse): Promise<void> {\n const flows = await this.readFlows('response')\n const runner = new HttpFlowRunner()\n runner.cookies = this.cookies\n runner.variables = this.variables\n await runner.response(request, response, flows)\n }\n\n /**\n * Reads and evaluates action flows.\n *\n * @param trigger The trigger name to read the flows for.\n */\n protected async readFlows(trigger: 'request' | 'response'): Promise<IHttpFlow[]> {\n const result: IHttpFlow[] = []\n const { flows, variables = {}, variablesProcessor } = this\n if (!Array.isArray(flows) || !flows.length) {\n return result\n }\n for (const flow of flows) {\n if (flow.trigger !== trigger) {\n continue\n }\n if (!Array.isArray(flow.actions) || !flow.actions.length) {\n continue\n }\n const copy = { ...flow } as IHttpFlow\n if (copy.condition) {\n copy.condition = await variablesProcessor.evaluateVariablesWithContext(copy.condition, variables)\n }\n const actions = copy.actions.map(async (action) => {\n const actionCopy = { ...action }\n if (Array.isArray(actionCopy.steps) && actionCopy.steps.length) {\n const stepsPromises = actionCopy.steps.map((step) =>\n variablesProcessor.evaluateVariablesWithContext(step, variables)\n )\n actionCopy.steps = await Promise.all(stepsPromises)\n }\n return actionCopy\n })\n copy.actions = await Promise.all(actions)\n result.push(copy)\n }\n return result\n }\n\n /**\n * Prepares the HTTP engine configuration and executes the request,\n * @param request The request to execute.\n * @returns The execution log.\n */\n async executeRequest(request: IHttpRequest): Promise<IRequestLog> {\n const opts = await this.prepareEngineConfig()\n const engine = new CoreEngine(request, opts)\n return engine.send()\n }\n\n /**\n * Creates a configuration options for the HTTP engine.\n */\n async prepareEngineConfig(): Promise<HttpEngineOptions> {\n const { logger, signal } = this\n const auth = await this.readAuthorization()\n const config = await this.readConfig()\n const cert = SecurityProcessor.readCertificate(auth)\n const opts: HttpEngineOptions = {}\n if (cert) {\n opts.certificates = [cert]\n }\n if (this.certificates) {\n if (!opts.certificates) {\n opts.certificates = []\n }\n opts.certificates = opts.certificates.concat(this.certificates)\n }\n if (Array.isArray(auth)) {\n opts.authorization = auth\n }\n if (logger) {\n opts.logger = logger\n }\n if (signal) {\n opts.signal = signal\n }\n if (!config || config.enabled === false) {\n return opts\n }\n if (typeof config.timeout === 'number') {\n opts.timeout = config.timeout\n }\n if (typeof config.sentMessageLimit === 'number') {\n opts.sentMessageLimit = config.sentMessageLimit\n }\n if (typeof config.followRedirects === 'boolean') {\n opts.followRedirects = config.followRedirects\n }\n if (typeof config.defaultHeaders === 'boolean') {\n opts.defaultHeaders = config.defaultHeaders\n }\n if (typeof config.validateCertificates === 'boolean') {\n opts.validateCertificates = config.validateCertificates\n }\n if (config.defaultUserAgent) {\n opts.defaultUserAgent = config.defaultUserAgent\n }\n if (config.defaultAccept) {\n opts.defaultAccept = config.defaultAccept\n }\n if (config.proxy) {\n opts.proxy = config.proxy\n }\n if (config.proxyUsername) {\n opts.proxyUsername = config.proxyUsername\n }\n if (config.proxyPassword) {\n opts.proxyPassword = config.proxyPassword\n }\n if (Array.isArray(config.hosts)) {\n opts.hosts = config.hosts\n }\n return opts\n }\n\n async processResponse(log: IRequestLog): Promise<void> {\n const { request, response } = log\n if (!request || !response) {\n return\n }\n if (this.cookies && this.sessionCookies) {\n const cookies = RequestCookiesProcessor.response(log)\n if (cookies) {\n const ps = Object.keys(cookies).map((url) => {\n const items = cookies[url]\n this.cookies?.setCookies(url, items)\n })\n await Promise.allSettled(ps)\n }\n }\n await this.runResponseFlows(request, response)\n const assertions = await this.runAssertions(request, response)\n if (assertions) {\n log.assertions = assertions\n }\n }\n\n get sessionCookies(): boolean {\n const { config } = this\n if (!config) {\n return true\n }\n if (config.enabled === false) {\n return true\n }\n return !config.ignoreSessionCookies\n }\n\n /**\n * When defined it applies the serve's base URI to relative URLs.\n * @param currentUrl The URL to process.\n */\n prepareRequestUrl(currentUrl: string, variables: Record<string, string>): string {\n const { baseUri } = variables\n if (!baseUri) {\n return currentUrl\n }\n if (currentUrl.startsWith('http:') || currentUrl.startsWith('https:')) {\n return currentUrl\n }\n if (currentUrl.startsWith('/')) {\n return `${baseUri}${currentUrl}`\n }\n return `${baseUri}/${currentUrl}`\n }\n\n /**\n * Prepares and runs assertions on the response.\n * It changes the response object by setting the assertions result.\n */\n async runAssertions(\n request: ISentRequest,\n response: IResponse | IErrorResponse\n ): Promise<AssertionResult[] | undefined> {\n const assertions = await this.readAssertions()\n if (!assertions.length) {\n return\n }\n const factory = new HttpAssertionRunner()\n return factory.run(request, response, assertions)\n }\n\n /**\n * @returns Prepared (evaluated with variables) assertions. Only not disabled assertions are returned.\n */\n protected async readAssertions(): Promise<IHttpAssertion[]> {\n const { assertions, variablesProcessor, variables = {} } = this\n if (!Array.isArray(assertions) || !assertions.length) {\n return []\n }\n const result: IHttpAssertion[] = []\n for (const assertion of assertions) {\n if (assertion.enabled === false) {\n continue\n }\n if (!Array.isArray(assertion.steps) || !assertion.steps.length) {\n continue\n }\n const copy = { ...assertion } as IHttpAssertion\n const stepsPromises = copy.steps.map(async (step) => {\n return variablesProcessor.evaluateVariablesWithContext(step, variables)\n })\n copy.steps = await Promise.all(stepsPromises)\n result.push(copy)\n }\n return result\n }\n}\n"]}
@@ -1,6 +1,6 @@
1
1
  import { IProjectRequestIterator, IHttpProject } from '../../models/HttpProject.js';
2
+ import { type Logger, type ILogObj } from 'tslog';
2
3
  import { Environment } from '../../models/Environment.js';
3
- import { Logger } from '../../lib/logging/Logger.js';
4
4
  import { IRequestLog } from '../../models/RequestLog.js';
5
5
  import { CookieJar } from '../../cookies/CookieJar.js';
6
6
  export interface IRequestRunnerOptions {
@@ -18,7 +18,7 @@ export interface IRequestRunnerOptions {
18
18
  /**
19
19
  * Overrides the default logger (console).
20
20
  */
21
- logger?: Logger;
21
+ logger?: Logger<ILogObj>;
22
22
  /**
23
23
  * An instance of a cookie jar (store) to put/read cookies.
24
24
  */
@@ -115,7 +115,7 @@ export interface IProjectRunnerOptions {
115
115
  * The logger to use with the request factory.
116
116
  * When not set it uses the dummy logger (no output).
117
117
  */
118
- logger?: Logger;
118
+ logger?: Logger<ILogObj>;
119
119
  /**
120
120
  * When true it copies all system variables to the execution environment.
121
121
  * When an array of strings, only takes system variables that are listed in the array.
@@ -1 +1 @@
1
- {"version":3,"file":"InteropInterfaces.d.ts","sourceRoot":"","sources":["../../../../src/runtime/node/InteropInterfaces.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,uBAAuB,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAA;AACnF,OAAO,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAA;AACzD,OAAO,EAAE,MAAM,EAAE,MAAM,6BAA6B,CAAA;AACpD,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAA;AACxD,OAAO,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAA;AAEtD,MAAM,WAAW,qBAAqB;IACpC;;OAEG;IACH,WAAW,CAAC,EAAE,WAAW,CAAA;IACzB;;;;;OAKG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IAClC;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAA;IACf;;OAEG;IACH,OAAO,CAAC,EAAE,SAAS,CAAA;CACpB;AAED,MA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IAEpB;;OAEG;IACH,OAAO,CAAC,EAAE,SAAS,CAAA;CACpB"}
1
+ {"version":3,"file":"InteropInterfaces.d.ts","sourceRoot":"","sources":["../../../../src/runtime/node/InteropInterfaces.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,uBAAuB,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAA;AACnF,OAAO,EAAE,KAAK,MAAM,EAAE,KAAK,OAAO,EAAE,MAAM,OAAO,CAAA;AACjD,OAAO,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAA;AACzD,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAA;AACxD,OAAO,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAA;AAEtD,MAAM,WAAW,qBAAqB;IACpC;;OAEG;IACH,WAAW,CAAC,EAAE,WAAW,CAAA;IACzB;;;;;OAKG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IAClC;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC,OAAO,CAAC,CAAA;IACxB;;OAEG;IACH,OAAO,CAAC,EAAE,SAAS,CAAA;CACpB;AAED,MAAM,WAAW,wBAAyB,SAAQ,uBAAuB;CAAG;AAE5E,MAAM,WAAW,uBAAuB;IACtC;;;OAGG;IACH,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IACjC;;OAEG;IACH,KAAK,EAAE,UAAU,EAAE,CAAA;CACpB;AAED,MAAM,WAAW,UAAU;IACzB;;OAEG;IACH,GAAG,EAAE,MAAM,CAAA;IACX;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAA;IACf;;;OAGG;IACH,KAAK,CAAC,EAAE,OAAO,CAAA;IACf;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB;;;OAGG;IACH,GAAG,CAAC,EAAE,WAAW,CAAA;CAClB;AAED,MAAM,WAAW,6BAA8B,SAAQ,qBAAqB;CAAG;AAE/E,MAAM,WAAW,6BAA8B,SAAQ,qBAAqB;IAC1E,OAAO,EAAE,YAAY,CAAA;CACtB;AAED,MAAM,WAAW,qBAAqB;IACpC;;;;;OAKG;IACH,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAA;IACf;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,EAAE,CAAA;IAClB;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB;;;OAGG;IACH,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB;;;;;;OAMG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB;;;OAGG;IACH,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,EAAE,CAAA;IACjB;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC,OAAO,CAAC,CAAA;IACxB;;;;;OAKG;IACH,SAAS,CAAC,EAAE,OAAO,GAAG,MAAM,EAAE,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IAEvD;;;OAGG;IACH,MAAM,CAAC,EAAE,WAAW,CAAA;IAEpB;;OAEG;IACH,OAAO,CAAC,EAAE,SAAS,CAAA;CACpB"}
@@ -1 +1 @@
1
- {"version":3,"file":"InteropInterfaces.js","sourceRoot":"","sources":["../../../../src/runtime/node/InteropInterfaces.ts"],"names":[],"mappings":"","sourcesContent":["/* eslint-disable @typescript-eslint/no-empty-object-type */\nimport { IProjectRequestIterator, IHttpProject } from '../../models/HttpProject.js'\nimport { Environment } from '../../models/Environment.js'\nimport { Logger } from '../../lib/logging/Logger.js'\nimport { IRequestLog } from '../../models/RequestLog.js'\nimport { CookieJar } from '../../cookies/CookieJar.js'\n\nexport interface IRequestRunnerOptions {\n /**\n * When provided it overrides any project / folder defined environment.\n */\n environment?: Environment\n /**\n * Additional variables to pass to the selected environment.\n * This can be use to pass system variables, when needed.\n *\n * To use system variables tou can use `init.variables = process.env`;\n */\n variables?: Record<string, string>\n /**\n * Overrides the default logger (console).\n */\n logger?: Logger\n /**\n * An instance of a cookie jar (store) to put/read cookies.\n */\n cookies?: CookieJar\n}\n\nexport interface IRequestRunnerRunOptions extends IProjectRequestIterator {}\n\nexport interface IProjectExecutionResult {\n /**\n * The variables evaluated during the run.\n * These variables have values set by requests' HTTP flows.\n */\n variables: Record<string, string>\n /**\n * The executed items.\n */\n items: IRunResult[]\n}\n\nexport interface IRunResult {\n /**\n * The key of the request from the HttpProject that was executed.\n */\n key: string\n /**\n * The key of parent folder of the executed request.\n */\n parent?: string\n /**\n * Set when a fatal error occurred so the request couldn't be executed.\n * This is not the same as error reported during a request. The log's response can still be IResponseError.\n */\n error?: boolean\n /**\n * The error message. Always set when the `error` is `true`.\n */\n errorMessage?: string\n /**\n * The request log.\n * Always set when the `error` is `false`.\n */\n log?: IRequestLog\n}\n\nexport interface IProjectParallelRunnerOptions extends IProjectRunnerOptions {}\n\nexport interface IProjectParallelWorkerOptions extends IProjectRunnerOptions {\n project: IHttpProject\n}\n\nexport interface IProjectRunnerOptions {\n /**\n * The environment to use.\n * This can be a name or the key of the environment located under the parent or root.\n * It can also be a path to the environment definition. If the file exists it is used. Otherwise it tried to\n * find the environment in the project.\n */\n environment?: string\n /**\n * The parent folder to execute.\n */\n parent?: string\n /**\n * The names or the keys of requests to execute.\n * This can be used to limit the number of requests.\n */\n request?: string[]\n /**\n * The number of times the execution should be repeated.\n * Default to 1.\n */\n iterations?: number\n /**\n * The number of milliseconds to wait between each iteration.\n * Default to the next frame (vary from 1 to tens of milliseconds).\n */\n iterationDelay?: number\n /**\n * When set it performs parallel execution for each iteration.\n * The number of executions at the same time depends on the number of processor cores\n * available on the current machine. The maximum of the parallel execution\n * is the number of available cores. When the `iterations` number is higher\n * then the \"rest\" is added to the iterations per each core.\n */\n parallel?: boolean\n /**\n * When set it includes requests in the current folder and sub-folder according to the order\n * defined in the folder.\n */\n recursive?: boolean\n /**\n * The opposite of the `requests`. The list of names or keys of requests or folders to ignore.\n * Note, ignore is tested before the `requests`.\n */\n ignore?: string[]\n /**\n * The logger to use with the request factory.\n * When not set it uses the dummy logger (no output).\n */\n logger?: Logger\n /**\n * When true it copies all system variables to the execution environment.\n * When an array of strings, only takes system variables that are listed in the array.\n * When a map, it uses this map as a list of variables.\n * When not set it does not read system variables.\n */\n variables?: boolean | string[] | Record<string, string>\n\n /**\n * Optional signal from an `AbortController`.\n * It aborts the execution when the ``abort` event is dispatched.\n */\n signal?: AbortSignal\n\n /**\n * An instance of a cookie jar (store) to put/read cookies.\n */\n cookies?: CookieJar\n}\n"]}
1
+ {"version":3,"file":"InteropInterfaces.js","sourceRoot":"","sources":["../../../../src/runtime/node/InteropInterfaces.ts"],"names":[],"mappings":"","sourcesContent":["/* eslint-disable @typescript-eslint/no-empty-object-type */\nimport { IProjectRequestIterator, IHttpProject } from '../../models/HttpProject.js'\nimport { type Logger, type ILogObj } from 'tslog'\nimport { Environment } from '../../models/Environment.js'\nimport { IRequestLog } from '../../models/RequestLog.js'\nimport { CookieJar } from '../../cookies/CookieJar.js'\n\nexport interface IRequestRunnerOptions {\n /**\n * When provided it overrides any project / folder defined environment.\n */\n environment?: Environment\n /**\n * Additional variables to pass to the selected environment.\n * This can be use to pass system variables, when needed.\n *\n * To use system variables tou can use `init.variables = process.env`;\n */\n variables?: Record<string, string>\n /**\n * Overrides the default logger (console).\n */\n logger?: Logger<ILogObj>\n /**\n * An instance of a cookie jar (store) to put/read cookies.\n */\n cookies?: CookieJar\n}\n\nexport interface IRequestRunnerRunOptions extends IProjectRequestIterator {}\n\nexport interface IProjectExecutionResult {\n /**\n * The variables evaluated during the run.\n * These variables have values set by requests' HTTP flows.\n */\n variables: Record<string, string>\n /**\n * The executed items.\n */\n items: IRunResult[]\n}\n\nexport interface IRunResult {\n /**\n * The key of the request from the HttpProject that was executed.\n */\n key: string\n /**\n * The key of parent folder of the executed request.\n */\n parent?: string\n /**\n * Set when a fatal error occurred so the request couldn't be executed.\n * This is not the same as error reported during a request. The log's response can still be IResponseError.\n */\n error?: boolean\n /**\n * The error message. Always set when the `error` is `true`.\n */\n errorMessage?: string\n /**\n * The request log.\n * Always set when the `error` is `false`.\n */\n log?: IRequestLog\n}\n\nexport interface IProjectParallelRunnerOptions extends IProjectRunnerOptions {}\n\nexport interface IProjectParallelWorkerOptions extends IProjectRunnerOptions {\n project: IHttpProject\n}\n\nexport interface IProjectRunnerOptions {\n /**\n * The environment to use.\n * This can be a name or the key of the environment located under the parent or root.\n * It can also be a path to the environment definition. If the file exists it is used. Otherwise it tried to\n * find the environment in the project.\n */\n environment?: string\n /**\n * The parent folder to execute.\n */\n parent?: string\n /**\n * The names or the keys of requests to execute.\n * This can be used to limit the number of requests.\n */\n request?: string[]\n /**\n * The number of times the execution should be repeated.\n * Default to 1.\n */\n iterations?: number\n /**\n * The number of milliseconds to wait between each iteration.\n * Default to the next frame (vary from 1 to tens of milliseconds).\n */\n iterationDelay?: number\n /**\n * When set it performs parallel execution for each iteration.\n * The number of executions at the same time depends on the number of processor cores\n * available on the current machine. The maximum of the parallel execution\n * is the number of available cores. When the `iterations` number is higher\n * then the \"rest\" is added to the iterations per each core.\n */\n parallel?: boolean\n /**\n * When set it includes requests in the current folder and sub-folder according to the order\n * defined in the folder.\n */\n recursive?: boolean\n /**\n * The opposite of the `requests`. The list of names or keys of requests or folders to ignore.\n * Note, ignore is tested before the `requests`.\n */\n ignore?: string[]\n /**\n * The logger to use with the request factory.\n * When not set it uses the dummy logger (no output).\n */\n logger?: Logger<ILogObj>\n /**\n * When true it copies all system variables to the execution environment.\n * When an array of strings, only takes system variables that are listed in the array.\n * When a map, it uses this map as a list of variables.\n * When not set it does not read system variables.\n */\n variables?: boolean | string[] | Record<string, string>\n\n /**\n * Optional signal from an `AbortController`.\n * It aborts the execution when the ``abort` event is dispatched.\n */\n signal?: AbortSignal\n\n /**\n * An instance of a cookie jar (store) to put/read cookies.\n */\n cookies?: CookieJar\n}\n"]}
@@ -1,6 +1,6 @@
1
1
  import { EventEmitter } from 'events';
2
2
  import { Environment } from '../../models/Environment.js';
3
- import { Logger } from '../../lib/logging/Logger.js';
3
+ import { type Logger, type ILogObj } from '../../lib/logging/index.js';
4
4
  import { IRequestLog } from '../../models/RequestLog.js';
5
5
  import { ProjectFolder } from '../../models/ProjectFolder.js';
6
6
  import { ProjectRequest } from '../../models/ProjectRequest.js';
@@ -45,7 +45,7 @@ export interface ProjectRequestRunner {
45
45
  * Requests are executed in order defined in the folder.
46
46
  */
47
47
  export declare class ProjectRequestRunner extends EventEmitter {
48
- logger?: Logger;
48
+ logger?: Logger<ILogObj>;
49
49
  project: HttpProject;
50
50
  /**
51
51
  * An instance of a cookie jar (store) to put/read cookies.
@@ -1 +1 @@
1
- {"version":3,"file":"ProjectRequestRunner.d.ts","sourceRoot":"","sources":["../../../../src/runtime/node/ProjectRequestRunner.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAA;AACrC,OAAO,EAAE,WAAW,EAA2B,MAAM,6BAA6B,CAAA;AAClF,OAAO,EAAE,MAAM,EAAE,MAAM,6BAA6B,CAAA;AACpD,OAAO,EAAE,WAAW,EAAc,MAAM,4BAA4B,CAAA;AAEpE,OAAO,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAA;AAC7D,OAAO,EAAE,cAAc,EAA8B,MAAM,gCAAgC,CAAA;AAC3F,OAAO,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAA;AAC1D,OAAO,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAA;AAGzD,OAAO,EAAE,kBAAkB,EAAE,MAAM,oCAAoC,CAAA;AACvE,OAAO,EACL,uBAAuB,EACvB,qBAAqB,EACrB,wBAAwB,EACxB,UAAU,EACX,MAAM,wBAAwB,CAAA;AAC/B,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAA;AAElC,OAAO,EAAE,SAAS,EAAE,MAAM,4BAA4B,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* eslint-disable @typescript-eslint/no-unsafe-declaration-merging */\nimport { EventEmitter } from 'events'\nimport { Environment, Kind as EnvironmentKind } from '../../models/Environment.js'\nimport { Logger } from '../../lib/logging/Logger.js'\nimport { IRequestLog, RequestLog } from '../../models/RequestLog.js'\nimport { Property } from '../../models/Property.js'\nimport { ProjectFolder } from '../../models/ProjectFolder.js'\nimport { ProjectRequest, Kind as ProjectRequestKind } from '../../models/ProjectRequest.js'\nimport { IHttpRequest } from '../../models/HttpRequest.js'\nimport { HttpProject } from '../../models/HttpProject.js'\nimport { SentRequest } from '../../models/SentRequest.js'\nimport { ErrorResponse } from '../../models/ErrorResponse.js'\nimport { VariablesProcessor } from '../variables/VariablesProcessor.js'\nimport {\n IProjectExecutionResult,\n IRequestRunnerOptions,\n IRequestRunnerRunOptions,\n IRunResult,\n} from './InteropInterfaces.js'\nimport { State } from './enums.js'\nimport { HttpRequestRunner } from '../http-runner/HttpRequestRunner.js'\nimport { CookieJar } from '../../cookies/CookieJar.js'\nimport { ProjectItem } from '../../models/ProjectItem.js'\nimport { ProjectFolderKind } from '../../models/kinds.js'\n\nexport interface ProjectRequestRunner {\n /**\n * The request object is prepared and about to be sent to the HTTP engine\n */\n on(event: 'request', listener: (key: string, request: IHttpRequest) => void): this\n /**\n * The response is ready.\n */\n on(event: 'response', listener: (key: string, log: IRequestLog) => void): this\n /**\n * There was a general error during the request\n */\n on(event: 'error', listener: (key: string, log: IRequestLog, message: string) => void): this\n /**\n * The request object is prepared and about to be sent to the HTTP engine\n */\n once(event: 'request', listener: (key: string, request: IHttpRequest) => void): this\n /**\n * The response is ready.\n */\n once(event: 'response', listener: (key: string, log: IRequestLog) => void): this\n /**\n * There was a general error during the request\n */\n once(event: 'error', listener: (key: string, log: IRequestLog, message: string) => void): this\n}\n\n/**\n * Runs requests in a project.\n * Developers can run the entire project with the `recursive` flag set. They can also\n * set the starting point with the `parent` options.\n *\n * Requests are executed in order defined in the folder.\n */\nexport class ProjectRequestRunner extends EventEmitter {\n logger?: Logger\n project: HttpProject\n /**\n * An instance of a cookie jar (store) to put/read cookies.\n */\n cookies?: CookieJar\n\n protected masterEnvironment?: Environment\n protected extraVariables?: Record<string, string>\n\n /**\n * The variables processor instance.\n */\n protected variablesProcessor = new VariablesProcessor()\n\n protected _state: State = State.Idle\n\n get state(): State {\n return this._state\n }\n\n constructor(project: HttpProject, opts: IRequestRunnerOptions = {}) {\n super()\n this.project = project\n this.logger = opts.logger\n this.masterEnvironment = opts.environment\n this.extraVariables = opts.variables\n this.cookies = opts.cookies\n }\n\n /**\n * Runs the request from the project root or a specified folder.\n * @param options Run options.\n * @returns A promise with the run result.\n */\n async run(options: IRequestRunnerRunOptions = {}): Promise<IProjectExecutionResult> {\n const { project } = this\n const root = options.parent ? project.findFolder(options.parent) : project\n if (!root) {\n throw new Error(`The parent folder not found: ${options.parent}.`)\n }\n const variables = await this.getVariables(root)\n const executed: IRunResult[] = []\n for await (const result of this.runIterator(options, variables)) {\n executed.push(result)\n }\n return {\n items: executed,\n variables,\n }\n }\n\n /**\n * Creates an async iterator that allows to iterate over execution results.\n * The result is yielded after the request is executed.\n *\n * @param options The iterator configuration.\n */\n protected async *runIterator(\n options: IRequestRunnerRunOptions = {},\n variables?: Record<string, string>\n ): AsyncGenerator<IRunResult> {\n const { project } = this\n const root = options.parent ? project.findFolder(options.parent) : project\n if (!root) {\n throw new Error(`The parent folder not found: ${options.parent}.`)\n }\n\n this._state = State.Running as State\n const envVariables = variables || (await this.getVariables(root))\n const { items } = root\n const it = this._runIterator(items, envVariables, options)\n for await (const request of it) {\n yield request\n }\n }\n\n protected async *_runIterator(\n items: ProjectItem[],\n variables: Record<string, string>,\n options: IRequestRunnerRunOptions\n ): AsyncGenerator<IRunResult> {\n for (const item of items) {\n const current = item.getItem()\n if (!current) {\n continue\n }\n if (current.kind === ProjectRequestKind) {\n if (Array.isArray(options.ignore) && options.ignore.includes(current.key)) {\n continue\n }\n if (\n Array.isArray(options.requests) &&\n !options.requests.includes(current.key) &&\n !options.requests.includes(current.info.name || '')\n ) {\n continue\n }\n const info = await this._runItem(current as ProjectRequest, variables)\n yield info\n } else if (current.kind === ProjectFolderKind) {\n if (!options.recursive) {\n continue\n }\n const parent = current as ProjectFolder\n // make a copy so the variables executed in the encapsulated environment\n // won't leak out to the current environment.\n let encapsulated = false\n // we restore the `baseUri` after exiting the folder.\n const currentBaseUri = variables.baseUri\n const { items: parentItems } = parent\n const envItem = (parentItems as ProjectItem[]).find((i) => i.kind === EnvironmentKind)\n let parentVariables: Record<string, string> = {}\n let childVariables = variables\n if (envItem) {\n const parentEnv = envItem.getItem() as Environment | undefined\n if (parentEnv) {\n encapsulated = parentEnv.encapsulated\n parentVariables = await this.applyVariables([parentEnv])\n if (encapsulated) {\n childVariables = parentVariables\n } else {\n childVariables = { ...childVariables, ...parentVariables }\n }\n }\n }\n\n const it = this._runIterator(parentItems, childVariables, options)\n for await (const request of it) {\n yield request\n }\n if (!encapsulated) {\n // now we set the variables set on children to the main variables object, except for these\n // declared on the child environments, so these won't leak to other folders.\n // However, variables set by a request in a folder always is propagated to the main environment.\n const ignore: string[] = Object.keys(parentVariables)\n Object.keys(childVariables).forEach((key) => {\n if (!ignore.includes(key)) {\n variables[key] = childVariables[key]\n }\n })\n }\n variables.baseUri = currentBaseUri\n }\n }\n }\n\n /**\n * Aborts the current run.\n * The promise returned by the `run()` method will reject if not yet resolved.\n */\n abort(): void {\n this._state = State.Aborted\n }\n\n /**\n * Allows to iterate over project requests recursively and execute each request\n * in order. The generator yields the `RunResult` for the request.\n *\n * Example:\n *\n * ```javascript\n * const runner = new ProjectRequestRunner(...);\n * for await (let runResult of runner) {\n * console.log(runResult);\n * }\n * ```\n */\n async *[Symbol.asyncIterator](): AsyncGenerator<IRunResult> {\n for await (const result of this.runIterator({ recursive: true })) {\n yield result\n }\n }\n\n private async _runItem(request: ProjectRequest, variables: Record<string, string>): Promise<IRunResult> {\n if (this._state === State.Aborted) {\n throw new Error(`The execution has been aborted.`)\n }\n const info = await this.execute(request, variables)\n const folder = request.getParent()\n if (folder && folder !== this.project) {\n info.parent = folder.key\n }\n return info\n }\n\n protected async execute(request: ProjectRequest, variables: Record<string, string>): Promise<IRunResult> {\n const config = request.getConfig()\n const factory = new HttpRequestRunner()\n factory.variables = variables\n const auth = request.readAuthorization()\n if (auth.length) {\n factory.authorization = auth.map((i) => i.toJSON())\n }\n if (request.flows) {\n factory.flows = request.flows\n }\n if (request.assertions) {\n factory.assertions = request.assertions\n }\n if (request.clientCertificate) {\n factory.certificates = [request.clientCertificate.toJSON()]\n }\n if (config.enabled !== false) {\n factory.config = config.toJSON()\n }\n if (this.logger) {\n factory.logger = this.logger\n }\n if (this.cookies) {\n factory.cookies = this.cookies\n }\n const info: IRunResult = {\n key: request.key,\n }\n let url: string | undefined\n const typedProject = request as ProjectRequest\n if (typeof typedProject.readUrl === 'function') {\n url = typedProject.readUrl({ variables })\n }\n const requestData = request.expects.toJSON()\n\n try {\n // Below replaces the single call to the `run()` function of the factory to\n // report via the events a request object that has evaluated with the Jexl library.\n requestData.url = url || factory.prepareRequestUrl(requestData.url, variables)\n const requestCopy = await factory.applyVariables(requestData)\n await factory.applyAuthorization(requestCopy)\n await factory.applyCookies(requestCopy)\n this.emit('request', request.key, { ...requestCopy })\n await factory.runRequestFlows(requestCopy)\n const result = await factory.executeRequest(requestCopy)\n result.requestId = request.key\n await factory.processResponse(result)\n request.setLog(result)\n info.log = result\n this.emit('response', request.key, { ...result })\n } catch (e) {\n const cause = e as Error\n info.error = true\n info.errorMessage = cause.message\n const sent = new SentRequest({ ...requestData, startTime: 0, endTime: 0 })\n const response = ErrorResponse.fromError(info.errorMessage)\n const log = RequestLog.fromRequestResponse(sent.toJSON(), response.toJSON()).toJSON()\n this.emit('error', request.key, log, info.errorMessage)\n }\n return info\n }\n\n protected async getVariables(parent: HttpProject | ProjectFolder): Promise<Record<string, string>> {\n if (this.masterEnvironment) {\n return this.applyVariables([this.masterEnvironment])\n }\n return this.createEnvironment(parent)\n }\n\n protected async createEnvironment(parent: HttpProject | ProjectFolder): Promise<Record<string, string>> {\n const envs = await this.readEnvironments(parent)\n return this.applyVariables(envs)\n }\n\n /**\n * Reads the list of the environments to apply to this runtime.\n */\n protected async readEnvironments(parent: HttpProject | ProjectFolder): Promise<Environment[]> {\n const folderKey = parent.kind === ProjectFolderKind ? (parent as ProjectFolder).key : undefined\n return this.project.readEnvironments({ parent: folderKey })\n }\n\n /**\n * Reads the variables and the base URI from the passed environments.\n */\n protected async applyVariables(environments: Environment[]): Promise<Record<string, string>> {\n let baseUri = ''\n const variables: Property[] = []\n environments.forEach((environment) => {\n const { server, variables: envVariables } = environment\n if (server) {\n baseUri = server.readUri()\n }\n if (envVariables.length) {\n envVariables.forEach((item) => {\n const defined = variables.findIndex((i) => i.name === item.name)\n if (defined >= 0) {\n variables[defined] = item\n } else {\n variables.push(item)\n }\n })\n }\n })\n const { extraVariables } = this\n const ctx = VariablesProcessor.createContextFromProperties(variables)\n if (extraVariables) {\n Object.keys(extraVariables).forEach((key) => {\n ctx[key] = extraVariables[key]\n })\n }\n // the `baseUri` is reserved and always set to the environment's `baseUri`.\n ctx.baseUri = baseUri || ''\n return this.variablesProcessor.buildContext(ctx)\n }\n}\n"]}
1
+ {"version":3,"file":"ProjectRequestRunner.js","sourceRoot":"","sources":["../../../../src/runtime/node/ProjectRequestRunner.ts"],"names":[],"mappings":"AAAA,iCAAiC;AACjC,qEAAqE;AACrE,OAAO,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAA;AACrC,OAAO,EAAe,IAAI,IAAI,eAAe,EAAE,MAAM,6BAA6B,CAAA;AAElF,OAAO,EAAe,UAAU,EAAE,MAAM,4BAA4B,CAAA;AAGpE,OAAO,EAAkB,IAAI,IAAI,kBAAkB,EAAE,MAAM,gCAAgC,CAAA;AAG3F,OAAO,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAA;AACzD,OAAO,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAA;AAC7D,OA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C,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE;oBAC5B,MAAM,OAAO,GAAG,SAAS,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,IAAI,CAAC,IAAI,CAAC,CAAA;oBAChE,IAAI,OAAO,IAAI,CAAC,EAAE,CAAC;wBACjB,SAAS,CAAC,OAAO,CAAC,GAAG,IAAI,CAAA;oBAC3B,CAAC;yBAAM,CAAC;wBACN,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;oBACtB,CAAC;gBACH,CAAC,CAAC,CAAA;YACJ,CAAC;QACH,CAAC,CAAC,CAAA;QACF,MAAM,EAAE,cAAc,EAAE,GAAG,IAAI,CAAA;QAC/B,MAAM,GAAG,GAAG,kBAAkB,CAAC,2BAA2B,CAAC,SAAS,CAAC,CAAA;QACrE,IAAI,cAAc,EAAE,CAAC;YACnB,MAAM,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC,OAAO,CAAC,CAAC,GAAG,EAAE,EAAE;gBAC1C,GAAG,CAAC,GAAG,CAAC,GAAG,cAAc,CAAC,GAAG,CAAC,CAAA;YAChC,CAAC,CAAC,CAAA;QACJ,CAAC;QACD,2EAA2E;QAC3E,GAAG,CAAC,OAAO,GAAG,OAAO,IAAI,EAAE,CAAA;QAC3B,OAAO,IAAI,CAAC,kBAAkB,CAAC,YAAY,CAAC,GAAG,CAAC,CAAA;IAClD,CAAC;CACF","sourcesContent":["/* eslint-disable no-redeclare */\n/* eslint-disable @typescript-eslint/no-unsafe-declaration-merging */\nimport { EventEmitter } from 'events'\nimport { Environment, Kind as EnvironmentKind } from '../../models/Environment.js'\nimport { type Logger, type ILogObj } from '../../lib/logging/index.js'\nimport { IRequestLog, RequestLog } from '../../models/RequestLog.js'\nimport { Property } from '../../models/Property.js'\nimport { ProjectFolder } from '../../models/ProjectFolder.js'\nimport { ProjectRequest, Kind as ProjectRequestKind } from '../../models/ProjectRequest.js'\nimport { IHttpRequest } from '../../models/HttpRequest.js'\nimport { HttpProject } from '../../models/HttpProject.js'\nimport { SentRequest } from '../../models/SentRequest.js'\nimport { ErrorResponse } from '../../models/ErrorResponse.js'\nimport { VariablesProcessor } from '../variables/VariablesProcessor.js'\nimport {\n IProjectExecutionResult,\n IRequestRunnerOptions,\n IRequestRunnerRunOptions,\n IRunResult,\n} from './InteropInterfaces.js'\nimport { State } from './enums.js'\nimport { HttpRequestRunner } from '../http-runner/HttpRequestRunner.js'\nimport { CookieJar } from '../../cookies/CookieJar.js'\nimport { ProjectItem } from '../../models/ProjectItem.js'\nimport { ProjectFolderKind } from '../../models/kinds.js'\n\nexport interface ProjectRequestRunner {\n /**\n * The request object is prepared and about to be sent to the HTTP engine\n */\n on(event: 'request', listener: (key: string, request: IHttpRequest) => void): this\n /**\n * The response is ready.\n */\n on(event: 'response', listener: (key: string, log: IRequestLog) => void): this\n /**\n * There was a general error during the request\n */\n on(event: 'error', listener: (key: string, log: IRequestLog, message: string) => void): this\n /**\n * The request object is prepared and about to be sent to the HTTP engine\n */\n once(event: 'request', listener: (key: string, request: IHttpRequest) => void): this\n /**\n * The response is ready.\n */\n once(event: 'response', listener: (key: string, log: IRequestLog) => void): this\n /**\n * There was a general error during the request\n */\n once(event: 'error', listener: (key: string, log: IRequestLog, message: string) => void): this\n}\n\n/**\n * Runs requests in a project.\n * Developers can run the entire project with the `recursive` flag set. They can also\n * set the starting point with the `parent` options.\n *\n * Requests are executed in order defined in the folder.\n */\nexport class ProjectRequestRunner extends EventEmitter {\n logger?: Logger<ILogObj>\n project: HttpProject\n /**\n * An instance of a cookie jar (store) to put/read cookies.\n */\n cookies?: CookieJar\n\n protected masterEnvironment?: Environment\n protected extraVariables?: Record<string, string>\n\n /**\n * The variables processor instance.\n */\n protected variablesProcessor = new VariablesProcessor()\n\n protected _state: State = State.Idle\n\n get state(): State {\n return this._state\n }\n\n constructor(project: HttpProject, opts: IRequestRunnerOptions = {}) {\n super()\n this.project = project\n this.logger = opts.logger\n this.masterEnvironment = opts.environment\n this.extraVariables = opts.variables\n this.cookies = opts.cookies\n }\n\n /**\n * Runs the request from the project root or a specified folder.\n * @param options Run options.\n * @returns A promise with the run result.\n */\n async run(options: IRequestRunnerRunOptions = {}): Promise<IProjectExecutionResult> {\n const { project } = this\n const root = options.parent ? project.findFolder(options.parent) : project\n if (!root) {\n throw new Error(`The parent folder not found: ${options.parent}.`)\n }\n const variables = await this.getVariables(root)\n const executed: IRunResult[] = []\n for await (const result of this.runIterator(options, variables)) {\n executed.push(result)\n }\n return {\n items: executed,\n variables,\n }\n }\n\n /**\n * Creates an async iterator that allows to iterate over execution results.\n * The result is yielded after the request is executed.\n *\n * @param options The iterator configuration.\n */\n protected async *runIterator(\n options: IRequestRunnerRunOptions = {},\n variables?: Record<string, string>\n ): AsyncGenerator<IRunResult> {\n const { project } = this\n const root = options.parent ? project.findFolder(options.parent) : project\n if (!root) {\n throw new Error(`The parent folder not found: ${options.parent}.`)\n }\n\n this._state = State.Running as State\n const envVariables = variables || (await this.getVariables(root))\n const { items } = root\n const it = this._runIterator(items, envVariables, options)\n for await (const request of it) {\n yield request\n }\n }\n\n protected async *_runIterator(\n items: ProjectItem[],\n variables: Record<string, string>,\n options: IRequestRunnerRunOptions\n ): AsyncGenerator<IRunResult> {\n for (const item of items) {\n const current = item.getItem()\n if (!current) {\n continue\n }\n if (current.kind === ProjectRequestKind) {\n if (Array.isArray(options.ignore) && options.ignore.includes(current.key)) {\n continue\n }\n if (\n Array.isArray(options.requests) &&\n !options.requests.includes(current.key) &&\n !options.requests.includes(current.info.name || '')\n ) {\n continue\n }\n const info = await this._runItem(current as ProjectRequest, variables)\n yield info\n } else if (current.kind === ProjectFolderKind) {\n if (!options.recursive) {\n continue\n }\n const parent = current as ProjectFolder\n // make a copy so the variables executed in the encapsulated environment\n // won't leak out to the current environment.\n let encapsulated = false\n // we restore the `baseUri` after exiting the folder.\n const currentBaseUri = variables.baseUri\n const { items: parentItems } = parent\n const envItem = (parentItems as ProjectItem[]).find((i) => i.kind === EnvironmentKind)\n let parentVariables: Record<string, string> = {}\n let childVariables = variables\n if (envItem) {\n const parentEnv = envItem.getItem() as Environment | undefined\n if (parentEnv) {\n encapsulated = parentEnv.encapsulated\n parentVariables = await this.applyVariables([parentEnv])\n if (encapsulated) {\n childVariables = parentVariables\n } else {\n childVariables = { ...childVariables, ...parentVariables }\n }\n }\n }\n\n const it = this._runIterator(parentItems, childVariables, options)\n for await (const request of it) {\n yield request\n }\n if (!encapsulated) {\n // now we set the variables set on children to the main variables object, except for these\n // declared on the child environments, so these won't leak to other folders.\n // However, variables set by a request in a folder always is propagated to the main environment.\n const ignore: string[] = Object.keys(parentVariables)\n Object.keys(childVariables).forEach((key) => {\n if (!ignore.includes(key)) {\n variables[key] = childVariables[key]\n }\n })\n }\n variables.baseUri = currentBaseUri\n }\n }\n }\n\n /**\n * Aborts the current run.\n * The promise returned by the `run()` method will reject if not yet resolved.\n */\n abort(): void {\n this._state = State.Aborted\n }\n\n /**\n * Allows to iterate over project requests recursively and execute each request\n * in order. The generator yields the `RunResult` for the request.\n *\n * Example:\n *\n * ```javascript\n * const runner = new ProjectRequestRunner(...);\n * for await (let runResult of runner) {\n * console.log(runResult);\n * }\n * ```\n */\n async *[Symbol.asyncIterator](): AsyncGenerator<IRunResult> {\n for await (const result of this.runIterator({ recursive: true })) {\n yield result\n }\n }\n\n private async _runItem(request: ProjectRequest, variables: Record<string, string>): Promise<IRunResult> {\n if (this._state === State.Aborted) {\n throw new Error(`The execution has been aborted.`)\n }\n const info = await this.execute(request, variables)\n const folder = request.getParent()\n if (folder && folder !== this.project) {\n info.parent = folder.key\n }\n return info\n }\n\n protected async execute(request: ProjectRequest, variables: Record<string, string>): Promise<IRunResult> {\n const config = request.getConfig()\n const factory = new HttpRequestRunner()\n factory.variables = variables\n const auth = request.readAuthorization()\n if (auth.length) {\n factory.authorization = auth.map((i) => i.toJSON())\n }\n if (request.flows) {\n factory.flows = request.flows\n }\n if (request.assertions) {\n factory.assertions = request.assertions\n }\n if (request.clientCertificate) {\n factory.certificates = [request.clientCertificate.toJSON()]\n }\n if (config.enabled !== false) {\n factory.config = config.toJSON()\n }\n if (this.logger) {\n factory.logger = this.logger\n }\n if (this.cookies) {\n factory.cookies = this.cookies\n }\n const info: IRunResult = {\n key: request.key,\n }\n let url: string | undefined\n const typedProject = request as ProjectRequest\n if (typeof typedProject.readUrl === 'function') {\n url = typedProject.readUrl({ variables })\n }\n const requestData = request.expects.toJSON()\n\n try {\n // Below replaces the single call to the `run()` function of the factory to\n // report via the events a request object that has evaluated with the Jexl library.\n requestData.url = url || factory.prepareRequestUrl(requestData.url, variables)\n const requestCopy = await factory.applyVariables(requestData)\n await factory.applyAuthorization(requestCopy)\n await factory.applyCookies(requestCopy)\n this.emit('request', request.key, { ...requestCopy })\n await factory.runRequestFlows(requestCopy)\n const result = await factory.executeRequest(requestCopy)\n result.requestId = request.key\n await factory.processResponse(result)\n request.setLog(result)\n info.log = result\n this.emit('response', request.key, { ...result })\n } catch (e) {\n const cause = e as Error\n info.error = true\n info.errorMessage = cause.message\n const sent = new SentRequest({ ...requestData, startTime: 0, endTime: 0 })\n const response = ErrorResponse.fromError(info.errorMessage)\n const log = RequestLog.fromRequestResponse(sent.toJSON(), response.toJSON()).toJSON()\n this.emit('error', request.key, log, info.errorMessage)\n }\n return info\n }\n\n protected async getVariables(parent: HttpProject | ProjectFolder): Promise<Record<string, string>> {\n if (this.masterEnvironment) {\n return this.applyVariables([this.masterEnvironment])\n }\n return this.createEnvironment(parent)\n }\n\n protected async createEnvironment(parent: HttpProject | ProjectFolder): Promise<Record<string, string>> {\n const envs = await this.readEnvironments(parent)\n return this.applyVariables(envs)\n }\n\n /**\n * Reads the list of the environments to apply to this runtime.\n */\n protected async readEnvironments(parent: HttpProject | ProjectFolder): Promise<Environment[]> {\n const folderKey = parent.kind === ProjectFolderKind ? (parent as ProjectFolder).key : undefined\n return this.project.readEnvironments({ parent: folderKey })\n }\n\n /**\n * Reads the variables and the base URI from the passed environments.\n */\n protected async applyVariables(environments: Environment[]): Promise<Record<string, string>> {\n let baseUri = ''\n const variables: Property[] = []\n environments.forEach((environment) => {\n const { server, variables: envVariables } = environment\n if (server) {\n baseUri = server.readUri()\n }\n if (envVariables.length) {\n envVariables.forEach((item) => {\n const defined = variables.findIndex((i) => i.name === item.name)\n if (defined >= 0) {\n variables[defined] = item\n } else {\n variables.push(item)\n }\n })\n }\n })\n const { extraVariables } = this\n const ctx = VariablesProcessor.createContextFromProperties(variables)\n if (extraVariables) {\n Object.keys(extraVariables).forEach((key) => {\n ctx[key] = extraVariables[key]\n })\n }\n // the `baseUri` is reserved and always set to the environment's `baseUri`.\n ctx.baseUri = baseUri || ''\n return this.variablesProcessor.buildContext(ctx)\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"ProjectRunner.d.ts","sourceRoot":"","sources":["../../../../src/runtime/node/ProjectRunner.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAA;AACzD,OAAO,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAA;AAC7D,OAAO,EAAE,WAAW,EAAgB,MAAM,6BAA6B,CAAA;AAEvE,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAA;AACxD,OAAO,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAA;AAC1D,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAA;AAChE,OAAO,EAAE,0BAA0B,EAAE,oBAAoB,EAAE,MAAM,kCAAkC,CAAA;AAEnG,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AAC5C,OAAO,EAAE,qBAAqB,EAAE,qBAAqB,EAAE,MAAM,wBAAwB,CAAA;AACrF,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAA;AAElC,KAAK,aAAa,GAAG,WAAW,GAAG,aAAa,CAAA;AAEhD,MAAM,WAAW,aAAa;IAC5B;;OAEG;IACH,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;IAStE;;;;;;;;OAQG;cACa,cAAc,IAAI,OAAO,CAAC,WAAW,GAAG,SAAS,CAAC;cAsBlD,uBAAuB,IAAI,OAAO,CAAC,qBAAqB,CAAC;IAsBzE;;OAEG;cACa,gBAAgB,IAAI,OAAO,CAAC,IAAI,CAAC;IA0CjD;;OAEG;IACH,SAAS,CAAC,eAAe,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,EAAE,YAAY,GAAG,IAAI;IAMnE;;OAEG;IACH,SAAS,CAAC,gBAAgB,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,WAAW,GAAG,IAAI;IAO/D;;OAEG;IACH,SAAS,CAAC,aAAa,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,GAAG,IAAI;IAO7E;;OAEG;IACH,SAAS,CAAC,gBAAgB,IAAI,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC;IAmBpD,OAAO,CAAC,oBAAoB;CAa7B"}
@@ -3,11 +3,11 @@
3
3
  /* eslint-disable @typescript-eslint/no-unsafe-declaration-merging */
4
4
  import { SerializableError } from '../../models/SerializableError.js';
5
5
  import { Environment } from '../../models/Environment.js';
6
- import { DummyLogger } from '../../lib/logging/DummyLogger.js';
7
6
  import { ProjectRequestRunner } from './ProjectRequestRunner.js';
8
7
  import { pathExists, readJson } from '../../lib/fs/Fs.js';
9
8
  import { BaseRunner } from './BaseRunner.js';
10
9
  import { State } from './enums.js';
10
+ import { createLogger } from '../../lib/logging/index.js';
11
11
  /**
12
12
  * A class to be extended to run an entire API Project for the given configuration options.
13
13
  *
@@ -188,7 +188,7 @@ export class ProjectRunner extends BaseRunner {
188
188
  result.logger = options.logger;
189
189
  }
190
190
  else {
191
- result.logger = new DummyLogger();
191
+ result.logger = createLogger();
192
192
  }
193
193
  if (options.cookies) {
194
194
  result.cookies = options.cookies;