@api-client/core 0.6.29 → 0.7.0

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 (325) hide show
  1. package/build/browser.d.ts +6 -14
  2. package/build/browser.js +11 -16
  3. package/build/browser.js.map +1 -1
  4. package/build/index.d.ts +8 -20
  5. package/build/index.js +13 -25
  6. package/build/index.js.map +1 -1
  7. package/build/src/amf/ApiSchemaValues.d.ts +2 -0
  8. package/build/src/amf/ApiSchemaValues.js +29 -23
  9. package/build/src/amf/ApiSchemaValues.js.map +1 -1
  10. package/build/src/authorization/lib/Utils.d.ts +1 -1
  11. package/build/src/cookies/CookieJar.d.ts +23 -0
  12. package/build/src/cookies/CookieJar.js +3 -0
  13. package/build/src/cookies/CookieJar.js.map +1 -0
  14. package/build/src/cookies/CookieParser.d.ts +67 -0
  15. package/build/src/cookies/CookieParser.js +316 -0
  16. package/build/src/cookies/CookieParser.js.map +1 -0
  17. package/build/src/cookies/InMemoryCookieJar.d.ts +12 -0
  18. package/build/src/cookies/InMemoryCookieJar.js +68 -0
  19. package/build/src/cookies/InMemoryCookieJar.js.map +1 -0
  20. package/build/src/cookies/Punycode.d.ts +12 -0
  21. package/build/src/cookies/Punycode.js +124 -0
  22. package/build/src/cookies/Punycode.js.map +1 -0
  23. package/build/src/data/RequestDataExtractor.d.ts +8 -7
  24. package/build/src/data/RequestDataExtractor.js +8 -10
  25. package/build/src/data/RequestDataExtractor.js.map +1 -1
  26. package/build/src/events/CustomEvent.js +5 -0
  27. package/build/src/events/CustomEvent.js.map +1 -1
  28. package/build/src/events/EventTypes.d.ts +43 -43
  29. package/build/src/events/amf/AmfEventTypes.d.ts +4 -4
  30. package/build/src/events/authorization/AuthorizationEventTypes.d.ts +4 -4
  31. package/build/src/events/cookies/CookieEventTypes.d.ts +9 -9
  32. package/build/src/events/encryption/EncryptionEventTypes.d.ts +2 -2
  33. package/build/src/events/environment/EnvironmentEventTypes.d.ts +1 -1
  34. package/build/src/events/models/ModelEventTypes.d.ts +7 -7
  35. package/build/src/events/process/ProcessEventTypes.d.ts +3 -3
  36. package/build/src/events/reporting/ReportingEventTypes.d.ts +1 -1
  37. package/build/src/events/telemetry/TelemetryEventTypes.d.ts +6 -6
  38. package/build/src/events/transport/TransportEventTypes.d.ts +6 -6
  39. package/build/src/events/transport/TransportEvents.d.ts +2 -2
  40. package/build/src/mocking/ProjectMock.d.ts +3 -2
  41. package/build/src/mocking/ProjectMock.js +3 -3
  42. package/build/src/mocking/ProjectMock.js.map +1 -1
  43. package/build/src/mocking/lib/App.d.ts +36 -0
  44. package/build/src/mocking/lib/App.js +70 -0
  45. package/build/src/mocking/lib/App.js.map +1 -0
  46. package/build/src/models/{arc/ArcProject.d.ts → AppProject.d.ts} +296 -134
  47. package/build/src/models/{arc/ArcProject.js → AppProject.js} +436 -79
  48. package/build/src/models/AppProject.js.map +1 -0
  49. package/build/src/models/AppRequest.d.ts +69 -0
  50. package/build/src/models/AppRequest.js +150 -0
  51. package/build/src/models/AppRequest.js.map +1 -0
  52. package/build/src/models/ClientCertificate.d.ts +2 -2
  53. package/build/src/models/Environment.d.ts +8 -1
  54. package/build/src/models/Environment.js +21 -0
  55. package/build/src/models/Environment.js.map +1 -1
  56. package/build/src/models/HostRule.d.ts +2 -2
  57. package/build/src/models/HttpCookie.d.ts +63 -12
  58. package/build/src/models/HttpCookie.js +178 -44
  59. package/build/src/models/HttpCookie.js.map +1 -1
  60. package/build/src/models/HttpHistory.d.ts +8 -3
  61. package/build/src/models/HttpHistory.js +3 -3
  62. package/build/src/models/HttpHistory.js.map +1 -1
  63. package/build/src/models/HttpProject.d.ts +34 -1
  64. package/build/src/models/HttpProject.js +104 -8
  65. package/build/src/models/HttpProject.js.map +1 -1
  66. package/build/src/models/ProjectFolder.d.ts +2 -0
  67. package/build/src/models/ProjectFolder.js +14 -0
  68. package/build/src/models/ProjectFolder.js.map +1 -1
  69. package/build/src/models/ProjectItem.d.ts +2 -0
  70. package/build/src/models/ProjectItem.js +20 -0
  71. package/build/src/models/ProjectItem.js.map +1 -1
  72. package/build/src/models/ProjectParent.js.map +1 -1
  73. package/build/src/models/ProjectRequest.d.ts +3 -2
  74. package/build/src/models/ProjectRequest.js.map +1 -1
  75. package/build/src/models/Property.d.ts +2 -2
  76. package/build/src/models/Property.js +2 -2
  77. package/build/src/models/Property.js.map +1 -1
  78. package/build/src/models/Request.d.ts +16 -8
  79. package/build/src/models/Request.js +20 -15
  80. package/build/src/models/Request.js.map +1 -1
  81. package/build/src/models/RequestAuthorization.js.map +1 -1
  82. package/build/src/models/RequestUiMeta.d.ts +0 -14
  83. package/build/src/models/RequestUiMeta.js +1 -10
  84. package/build/src/models/RequestUiMeta.js.map +1 -1
  85. package/build/src/models/Server.d.ts +1 -2
  86. package/build/src/models/Server.js.map +1 -1
  87. package/build/src/models/http-actions/HttpActions.d.ts +256 -0
  88. package/build/src/models/http-actions/HttpActions.js +46 -0
  89. package/build/src/models/http-actions/HttpActions.js.map +1 -0
  90. package/build/src/models/http-actions/LegacyTranslator.d.ts +17 -0
  91. package/build/src/models/http-actions/LegacyTranslator.js +222 -0
  92. package/build/src/models/http-actions/LegacyTranslator.js.map +1 -0
  93. package/build/src/models/store/Backend.d.ts +136 -1
  94. package/build/src/models/store/File.d.ts +1 -1
  95. package/build/src/models/store/File.js +2 -0
  96. package/build/src/models/store/File.js.map +1 -1
  97. package/build/src/models/store/User.d.ts +3 -3
  98. package/build/src/runtime/http-engine/CoreEngine.d.ts +2 -0
  99. package/build/src/runtime/http-engine/CoreEngine.js +1 -0
  100. package/build/src/runtime/http-engine/CoreEngine.js.map +1 -1
  101. package/build/src/runtime/http-engine/HttpEngine.d.ts +13 -0
  102. package/build/src/runtime/http-engine/HttpEngine.js +39 -31
  103. package/build/src/runtime/http-engine/HttpEngine.js.map +1 -1
  104. package/build/src/runtime/{actions/ConditionRunner.d.ts → http-runner/ConditionCheck.d.ts} +2 -2
  105. package/build/src/runtime/{actions/ConditionRunner.js → http-runner/ConditionCheck.js} +2 -2
  106. package/build/src/runtime/http-runner/ConditionCheck.js.map +1 -0
  107. package/build/src/runtime/http-runner/HttpFlowRunner.d.ts +62 -0
  108. package/build/src/runtime/http-runner/HttpFlowRunner.js +217 -0
  109. package/build/src/runtime/http-runner/HttpFlowRunner.js.map +1 -0
  110. package/build/src/runtime/{node/RequestFactory.d.ts → http-runner/HttpRequestRunner.d.ts} +40 -54
  111. package/build/src/runtime/http-runner/HttpRequestRunner.js +316 -0
  112. package/build/src/runtime/http-runner/HttpRequestRunner.js.map +1 -0
  113. package/build/src/runtime/http-runner/HttpRuntimeEnvironment.d.ts +25 -0
  114. package/build/src/runtime/http-runner/HttpRuntimeEnvironment.js +2 -0
  115. package/build/src/runtime/http-runner/HttpRuntimeEnvironment.js.map +1 -0
  116. package/build/src/runtime/http-runner/RequestAuthorizationProcessor.d.ts +56 -0
  117. package/build/src/runtime/http-runner/RequestAuthorizationProcessor.js +143 -0
  118. package/build/src/runtime/http-runner/RequestAuthorizationProcessor.js.map +1 -0
  119. package/build/src/runtime/http-runner/RequestCookiesProcessor.d.ts +24 -0
  120. package/build/src/runtime/http-runner/RequestCookiesProcessor.js +65 -0
  121. package/build/src/runtime/http-runner/RequestCookiesProcessor.js.map +1 -0
  122. package/build/src/runtime/node/InteropInterfaces.d.ts +21 -6
  123. package/build/src/runtime/node/ProjectParallelRunner.js +3 -1
  124. package/build/src/runtime/node/ProjectParallelRunner.js.map +1 -1
  125. package/build/src/runtime/node/ProjectRequestRunner.d.ts +24 -10
  126. package/build/src/runtime/node/ProjectRequestRunner.js +116 -45
  127. package/build/src/runtime/node/ProjectRequestRunner.js.map +1 -1
  128. package/build/src/runtime/node/ProjectRunner.d.ts +5 -7
  129. package/build/src/runtime/node/ProjectRunner.js +30 -14
  130. package/build/src/runtime/node/ProjectRunner.js.map +1 -1
  131. package/build/src/runtime/node/ProjectRunnerWorker.js +3 -0
  132. package/build/src/runtime/node/ProjectRunnerWorker.js.map +1 -1
  133. package/build/src/runtime/reporters/Reporter.d.ts +5 -0
  134. package/build/src/runtime/reporters/Reporter.js.map +1 -1
  135. package/build/src/runtime/store/FilesSdk.js +4 -4
  136. package/build/src/runtime/store/FilesSdk.js.map +1 -1
  137. package/build/src/runtime/store/HistorySdk.js +1 -1
  138. package/build/src/runtime/store/HistorySdk.js.map +1 -1
  139. package/build/src/runtime/store/HttpClientSdk.d.ts +167 -0
  140. package/build/src/runtime/store/HttpClientSdk.js +624 -0
  141. package/build/src/runtime/store/HttpClientSdk.js.map +1 -0
  142. package/build/src/runtime/store/RouteBuilder.d.ts +17 -2
  143. package/build/src/runtime/store/RouteBuilder.js +60 -3
  144. package/build/src/runtime/store/RouteBuilder.js.map +1 -1
  145. package/build/src/runtime/store/Sdk.d.ts +5 -0
  146. package/build/src/runtime/store/Sdk.js +5 -0
  147. package/build/src/runtime/store/Sdk.js.map +1 -1
  148. package/build/src/runtime/store/SharedSdk.js +1 -1
  149. package/build/src/runtime/store/SharedSdk.js.map +1 -1
  150. package/build/src/runtime/store/UsersSdk.js +1 -1
  151. package/build/src/runtime/store/UsersSdk.js.map +1 -1
  152. package/package.json +2 -2
  153. package/src/amf/ApiSchemaValues.ts +41 -33
  154. package/src/cookies/CookieJar.ts +26 -0
  155. package/src/cookies/CookieParser.ts +327 -0
  156. package/src/cookies/InMemoryCookieJar.ts +70 -0
  157. package/src/cookies/Punycode.ts +133 -0
  158. package/src/data/RequestDataExtractor.ts +14 -15
  159. package/src/events/CustomEvent.ts +4 -0
  160. package/src/mocking/ProjectMock.ts +4 -3
  161. package/src/mocking/lib/App.ts +101 -0
  162. package/src/models/{arc/ArcProject.ts → AppProject.ts} +671 -225
  163. package/src/models/AppRequest.ts +176 -0
  164. package/src/models/ClientCertificate.ts +2 -2
  165. package/src/models/Environment.ts +24 -2
  166. package/src/models/HostRule.ts +2 -2
  167. package/src/models/HttpCookie.ts +210 -48
  168. package/src/models/HttpHistory.ts +12 -5
  169. package/src/models/HttpProject.ts +113 -10
  170. package/src/models/ProjectFolder.ts +16 -0
  171. package/src/models/ProjectItem.ts +18 -0
  172. package/src/models/ProjectParent.ts +4 -1
  173. package/src/models/ProjectRequest.ts +4 -3
  174. package/src/models/Property.ts +4 -4
  175. package/src/models/Request.ts +29 -19
  176. package/src/models/RequestAuthorization.ts +4 -4
  177. package/src/models/RequestUiMeta.ts +1 -21
  178. package/src/models/Server.ts +1 -2
  179. package/src/models/http-actions/HttpActions.ts +270 -0
  180. package/src/models/http-actions/LegacyTranslator.ts +223 -0
  181. package/src/models/store/Backend.ts +148 -2
  182. package/src/models/store/File.ts +3 -1
  183. package/src/models/store/User.ts +3 -3
  184. package/src/runtime/http-engine/CoreEngine.ts +3 -2
  185. package/src/runtime/http-engine/HttpEngine.ts +48 -30
  186. package/src/runtime/{actions/ConditionRunner.ts → http-runner/ConditionCheck.ts} +3 -3
  187. package/src/runtime/http-runner/HttpFlowRunner.ts +232 -0
  188. package/src/runtime/http-runner/HttpRequestRunner.ts +353 -0
  189. package/src/runtime/http-runner/HttpRuntimeEnvironment.ts +27 -0
  190. package/src/runtime/http-runner/RequestAuthorizationProcessor.ts +144 -0
  191. package/src/runtime/http-runner/RequestCookiesProcessor.ts +74 -0
  192. package/src/runtime/node/InteropInterfaces.ts +24 -6
  193. package/src/runtime/node/ProjectParallelRunner.ts +4 -2
  194. package/src/runtime/node/ProjectRequestRunner.ts +130 -60
  195. package/src/runtime/node/ProjectRunner.ts +37 -22
  196. package/src/runtime/node/ProjectRunnerWorker.ts +3 -0
  197. package/src/runtime/reporters/Reporter.ts +5 -0
  198. package/src/runtime/store/FilesSdk.ts +4 -4
  199. package/src/runtime/store/HistorySdk.ts +1 -1
  200. package/src/runtime/store/HttpClientSdk.ts +629 -0
  201. package/src/runtime/store/RouteBuilder.ts +75 -3
  202. package/src/runtime/store/Sdk.ts +6 -0
  203. package/src/runtime/store/SharedSdk.ts +1 -1
  204. package/src/runtime/store/UsersSdk.ts +1 -1
  205. package/build/src/lib/cookies/Cookie.d.ts +0 -123
  206. package/build/src/lib/cookies/Cookie.js +0 -257
  207. package/build/src/lib/cookies/Cookie.js.map +0 -1
  208. package/build/src/lib/cookies/Cookies.d.ts +0 -90
  209. package/build/src/lib/cookies/Cookies.js +0 -310
  210. package/build/src/lib/cookies/Cookies.js.map +0 -1
  211. package/build/src/lib/cookies/Utils.d.ts +0 -47
  212. package/build/src/lib/cookies/Utils.js +0 -163
  213. package/build/src/lib/cookies/Utils.js.map +0 -1
  214. package/build/src/mocking/lib/Arc.d.ts +0 -10
  215. package/build/src/mocking/lib/Arc.js +0 -31
  216. package/build/src/mocking/lib/Arc.js.map +0 -1
  217. package/build/src/models/RequestActions.d.ts +0 -65
  218. package/build/src/models/RequestActions.js +0 -114
  219. package/build/src/models/RequestActions.js.map +0 -1
  220. package/build/src/models/actions/Action.d.ts +0 -75
  221. package/build/src/models/actions/Action.js +0 -188
  222. package/build/src/models/actions/Action.js.map +0 -1
  223. package/build/src/models/actions/ActionView.d.ts +0 -15
  224. package/build/src/models/actions/ActionView.js +0 -33
  225. package/build/src/models/actions/ActionView.js.map +0 -1
  226. package/build/src/models/actions/Condition.d.ts +0 -81
  227. package/build/src/models/actions/Condition.js +0 -185
  228. package/build/src/models/actions/Condition.js.map +0 -1
  229. package/build/src/models/actions/ConditionView.d.ts +0 -17
  230. package/build/src/models/actions/ConditionView.js +0 -34
  231. package/build/src/models/actions/ConditionView.js.map +0 -1
  232. package/build/src/models/actions/Enums.d.ts +0 -26
  233. package/build/src/models/actions/Enums.js +0 -31
  234. package/build/src/models/actions/Enums.js.map +0 -1
  235. package/build/src/models/actions/RunnableAction.d.ts +0 -59
  236. package/build/src/models/actions/RunnableAction.js +0 -106
  237. package/build/src/models/actions/RunnableAction.js.map +0 -1
  238. package/build/src/models/actions/runnable/DeleteCookieAction.d.ts +0 -44
  239. package/build/src/models/actions/runnable/DeleteCookieAction.js +0 -92
  240. package/build/src/models/actions/runnable/DeleteCookieAction.js.map +0 -1
  241. package/build/src/models/actions/runnable/Runnable.d.ts +0 -8
  242. package/build/src/models/actions/runnable/Runnable.js +0 -4
  243. package/build/src/models/actions/runnable/Runnable.js.map +0 -1
  244. package/build/src/models/actions/runnable/SetCookieAction.d.ts +0 -87
  245. package/build/src/models/actions/runnable/SetCookieAction.js +0 -176
  246. package/build/src/models/actions/runnable/SetCookieAction.js.map +0 -1
  247. package/build/src/models/actions/runnable/SetVariableAction.d.ts +0 -31
  248. package/build/src/models/actions/runnable/SetVariableAction.js +0 -63
  249. package/build/src/models/actions/runnable/SetVariableAction.js.map +0 -1
  250. package/build/src/models/actions/runnable/index.d.ts +0 -7
  251. package/build/src/models/actions/runnable/index.js +0 -2
  252. package/build/src/models/actions/runnable/index.js.map +0 -1
  253. package/build/src/models/arc/ArcHttpRequest.d.ts +0 -39
  254. package/build/src/models/arc/ArcHttpRequest.js +0 -106
  255. package/build/src/models/arc/ArcHttpRequest.js.map +0 -1
  256. package/build/src/models/arc/ArcProject.js.map +0 -1
  257. package/build/src/runtime/actions/ActionRunner.d.ts +0 -17
  258. package/build/src/runtime/actions/ActionRunner.js +0 -74
  259. package/build/src/runtime/actions/ActionRunner.js.map +0 -1
  260. package/build/src/runtime/actions/ConditionRunner.js.map +0 -1
  261. package/build/src/runtime/actions/RunnableCondition.d.ts +0 -27
  262. package/build/src/runtime/actions/RunnableCondition.js +0 -50
  263. package/build/src/runtime/actions/RunnableCondition.js.map +0 -1
  264. package/build/src/runtime/actions/runnable/ActionRunnable.d.ts +0 -13
  265. package/build/src/runtime/actions/runnable/ActionRunnable.js +0 -13
  266. package/build/src/runtime/actions/runnable/ActionRunnable.js.map +0 -1
  267. package/build/src/runtime/actions/runnable/DeleteCookieRunnable.d.ts +0 -7
  268. package/build/src/runtime/actions/runnable/DeleteCookieRunnable.js +0 -36
  269. package/build/src/runtime/actions/runnable/DeleteCookieRunnable.js.map +0 -1
  270. package/build/src/runtime/actions/runnable/SetCookieRunnable.d.ts +0 -10
  271. package/build/src/runtime/actions/runnable/SetCookieRunnable.js +0 -89
  272. package/build/src/runtime/actions/runnable/SetCookieRunnable.js.map +0 -1
  273. package/build/src/runtime/actions/runnable/SetVariableRunnable.d.ts +0 -10
  274. package/build/src/runtime/actions/runnable/SetVariableRunnable.js +0 -49
  275. package/build/src/runtime/actions/runnable/SetVariableRunnable.js.map +0 -1
  276. package/build/src/runtime/modules/BasicAuthCache.d.ts +0 -39
  277. package/build/src/runtime/modules/BasicAuthCache.js +0 -122
  278. package/build/src/runtime/modules/BasicAuthCache.js.map +0 -1
  279. package/build/src/runtime/modules/ExecutionResponse.d.ts +0 -4
  280. package/build/src/runtime/modules/ExecutionResponse.js +0 -6
  281. package/build/src/runtime/modules/ExecutionResponse.js.map +0 -1
  282. package/build/src/runtime/modules/ModulesRegistry.d.ts +0 -93
  283. package/build/src/runtime/modules/ModulesRegistry.js +0 -69
  284. package/build/src/runtime/modules/ModulesRegistry.js.map +0 -1
  285. package/build/src/runtime/modules/RequestAuthorization.d.ts +0 -6
  286. package/build/src/runtime/modules/RequestAuthorization.js +0 -110
  287. package/build/src/runtime/modules/RequestAuthorization.js.map +0 -1
  288. package/build/src/runtime/modules/RequestCookies.d.ts +0 -17
  289. package/build/src/runtime/modules/RequestCookies.js +0 -134
  290. package/build/src/runtime/modules/RequestCookies.js.map +0 -1
  291. package/build/src/runtime/node/RequestFactory.js +0 -406
  292. package/build/src/runtime/node/RequestFactory.js.map +0 -1
  293. package/build/src/runtime/node/VariablesStore.d.ts +0 -9
  294. package/build/src/runtime/node/VariablesStore.js +0 -19
  295. package/build/src/runtime/node/VariablesStore.js.map +0 -1
  296. package/src/lib/cookies/Cookie.ts +0 -312
  297. package/src/lib/cookies/Cookies.ts +0 -326
  298. package/src/lib/cookies/Utils.ts +0 -168
  299. package/src/mocking/lib/Arc.ts +0 -34
  300. package/src/models/RequestActions.ts +0 -161
  301. package/src/models/actions/Action.ts +0 -213
  302. package/src/models/actions/ActionView.ts +0 -40
  303. package/src/models/actions/Condition.ts +0 -207
  304. package/src/models/actions/ConditionView.ts +0 -42
  305. package/src/models/actions/Enums.ts +0 -29
  306. package/src/models/actions/RunnableAction.ts +0 -144
  307. package/src/models/actions/runnable/DeleteCookieAction.ts +0 -113
  308. package/src/models/actions/runnable/Runnable.ts +0 -9
  309. package/src/models/actions/runnable/SetCookieAction.ts +0 -216
  310. package/src/models/actions/runnable/SetVariableAction.ts +0 -81
  311. package/src/models/arc/ArcHttpRequest.ts +0 -121
  312. package/src/models/arc/readme.md +0 -3
  313. package/src/runtime/actions/ActionRunner.ts +0 -83
  314. package/src/runtime/actions/RunnableCondition.ts +0 -56
  315. package/src/runtime/actions/runnable/ActionRunnable.ts +0 -19
  316. package/src/runtime/actions/runnable/DeleteCookieRunnable.ts +0 -39
  317. package/src/runtime/actions/runnable/SetCookieRunnable.ts +0 -92
  318. package/src/runtime/actions/runnable/SetVariableRunnable.ts +0 -53
  319. package/src/runtime/modules/BasicAuthCache.ts +0 -129
  320. package/src/runtime/modules/ExecutionResponse.ts +0 -4
  321. package/src/runtime/modules/ModulesRegistry.ts +0 -136
  322. package/src/runtime/modules/RequestAuthorization.ts +0 -106
  323. package/src/runtime/modules/RequestCookies.ts +0 -146
  324. package/src/runtime/node/RequestFactory.ts +0 -432
  325. package/src/runtime/node/VariablesStore.ts +0 -25
@@ -1,406 +0,0 @@
1
- import { VariablesProcessor } from '../variables/VariablesProcessor.js';
2
- import { Action } from '../../models/actions/Action.js';
3
- import { RunnableCondition } from '../actions/RunnableCondition.js';
4
- import { ActionRunner } from '../actions/ActionRunner.js';
5
- import { CoreEngine } from '../http-engine/CoreEngine.js';
6
- import { ModulesRegistry, RegistryPermission } from '../modules/ModulesRegistry.js';
7
- import { ExecutionResponse } from '../modules/ExecutionResponse.js';
8
- import { Events } from '../../events/Events.js';
9
- /**
10
- * The main class to make HTTP requests in the API Client.
11
- * This factory includes all logic components to perform the entire HTTP request lifecycle. This includes:
12
- *
13
- * - variables evaluation on the request object
14
- * - running request actions
15
- * - running request modules
16
- * - choosing the execution engine
17
- * - performing the request
18
- * - running response actions
19
- * - running response modules
20
- * - reporting the response
21
- *
22
- * This class may not be used when not necessary but the logic should take care of the items listed above.
23
- *
24
- * This class splits the `IRequest` object into it's components and use them when defined.
25
- * This way it is possible to use the factory only with the `IHttpRequest` interface.
26
- */
27
- export class RequestFactory {
28
- /**
29
- * The main events bus.
30
- * This target is used to dispatch the events on.
31
- * The runtime should handle the events and proxy them to the corresponding context store.
32
- */
33
- eventTarget;
34
- /**
35
- * Request processing configuration.
36
- */
37
- config;
38
- /**
39
- * Request authorization configuration
40
- */
41
- authorization;
42
- /**
43
- * Actions to be performed when the request is executed.
44
- */
45
- actions;
46
- /**
47
- * The list of certificates to use with the request.
48
- */
49
- certificates;
50
- /**
51
- * The cumulative list of all variables to be applied to the request and other properties.
52
- * The variables must be already processed for variables in values (evaluated).
53
- *
54
- * These variables are passed by reference. Changes made anywhere to the variables will result
55
- * with updating this list.
56
- */
57
- variables;
58
- /**
59
- * The variables processor instance.
60
- */
61
- variablesProcessor = new VariablesProcessor();
62
- logger;
63
- /**
64
- * The abort signal to set on this request.
65
- * Aborts the request when the signal fires.
66
- * @type {(AbortSignal | undefined)}
67
- */
68
- signal;
69
- /**
70
- * Creates an instance from the IRequest object with setting the corresponding variables.
71
- * @param eventTarget The main events bus.
72
- * This target is used to dispatch the events on.
73
- * The runtime should handle the events and proxy them to the corresponding context store.
74
- * @param request The request object to use.
75
- */
76
- static fromRequest(eventTarget, request) {
77
- const instance = new RequestFactory(eventTarget);
78
- instance.actions = request.actions;
79
- instance.authorization = request.authorization;
80
- if (request.clientCertificate) {
81
- instance.certificates = [request.clientCertificate];
82
- }
83
- instance.config = request.config;
84
- return instance;
85
- }
86
- /**
87
- * @param eventTarget The main events bus.
88
- * This target is used to dispatch the events on.
89
- * The runtime should handle the events and proxy them to the corresponding context store.
90
- */
91
- constructor(eventTarget) {
92
- this.eventTarget = eventTarget;
93
- }
94
- /**
95
- * Runs the request and all tasks around the HTTp request execution like gathering
96
- * environment information, running actions, and HTTP modules.
97
- *
98
- * @param request The request object to execute.
99
- * @returns The execution log.
100
- */
101
- async run(request) {
102
- const requestCopy = await this.processRequest(request);
103
- const result = await this.executeRequest(requestCopy);
104
- await this.processResponse(result);
105
- return result;
106
- }
107
- /**
108
- * @returns the configuration processed by the variables processor.
109
- */
110
- async readConfig() {
111
- const { config, variables, variablesProcessor } = this;
112
- if (!config) {
113
- return undefined;
114
- }
115
- if (!variables) {
116
- return config;
117
- }
118
- return variablesProcessor.evaluateVariablesWithContext(config, variables);
119
- }
120
- /**
121
- * @returns the authorization data processed by the variables processor.
122
- */
123
- async readAuthorization() {
124
- const { variables, authorization, variablesProcessor } = this;
125
- if (!Array.isArray(authorization) || !authorization.length) {
126
- return undefined;
127
- }
128
- if (!variables) {
129
- return authorization;
130
- }
131
- const ps = authorization.filter(i => i.enabled !== false).map(async (item) => {
132
- const copy = await variablesProcessor.evaluateVariablesWithContext(item, variables);
133
- if (copy.config) {
134
- copy.config = await variablesProcessor.evaluateVariablesWithContext(copy.config, variables);
135
- }
136
- return copy;
137
- });
138
- const result = await Promise.all(ps);
139
- return result;
140
- }
141
- /**
142
- * @returns the actions for the passed type processed by the variables processor.
143
- */
144
- async readActions(type) {
145
- const { variables, actions, variablesProcessor } = this;
146
- if (!actions) {
147
- return undefined;
148
- }
149
- const list = actions[type];
150
- if (!Array.isArray(list) || !list.length) {
151
- return undefined;
152
- }
153
- if (!variables) {
154
- return list;
155
- }
156
- const ps = list.filter(i => i.enabled !== false).map(async (item) => {
157
- const copy = await variablesProcessor.evaluateVariablesWithContext(item, variables);
158
- if (copy.condition) {
159
- copy.condition = await variablesProcessor.evaluateVariablesWithContext(copy.condition, variables);
160
- }
161
- if (Array.isArray(copy.actions) && copy.actions.length) {
162
- const actionsPs = copy.actions.map(async (action) => {
163
- const actionCopy = await variablesProcessor.evaluateVariablesWithContext(action, variables);
164
- if (actionCopy.config) {
165
- actionCopy.config = await variablesProcessor.evaluateVariablesWithContext(actionCopy.config, variables);
166
- }
167
- return actionCopy;
168
- });
169
- copy.actions = await Promise.all(actionsPs);
170
- }
171
- return copy;
172
- });
173
- const result = await Promise.all(ps);
174
- return result;
175
- }
176
- /**
177
- * Prepares the request object before making the HTTP request
178
- * and runs actions and modules.
179
- *
180
- * @param request The request to execute.
181
- * @returns the copy of the request object.
182
- */
183
- async processRequest(request) {
184
- const copy = await this.processRequestVariables(request);
185
- await this.processRequestLogic(copy);
186
- return copy;
187
- }
188
- /**
189
- * Runs the request through the variables processor.
190
- * @returns A copy of the passed request with possibly changed values.
191
- */
192
- async processRequestVariables(request) {
193
- const { variables, variablesProcessor } = this;
194
- let copy = { ...request };
195
- if (variables) {
196
- copy = await variablesProcessor.evaluateVariablesWithContext(copy, variables);
197
- }
198
- return copy;
199
- }
200
- /**
201
- * Executes the request actions and modules.
202
- */
203
- async processRequestLogic(request) {
204
- const actions = await this.readActions('request');
205
- if (Array.isArray(actions) && actions.length) {
206
- await this.processRequestActions(request, actions);
207
- }
208
- await this.processRequestModules(request);
209
- }
210
- /**
211
- * Runs each action one by one.
212
- * @param request The request object associated with actions
213
- * @param actions The list of actions to execute.
214
- */
215
- async processRequestActions(request, actions) {
216
- const runnables = actions.filter((item) => item.enabled !== false && !!item.actions && !!item.actions.length);
217
- if (!runnables.length) {
218
- return;
219
- }
220
- for (let i = 0, len = runnables.length; i < len; i++) {
221
- const runnable = new RunnableCondition(runnables[i]);
222
- const passed = await runnable.satisfied(request);
223
- if (!passed) {
224
- continue;
225
- }
226
- const execs = runnable.actions.filter(i => i.enabled !== false);
227
- execs.sort(Action.sortActions);
228
- for (let j = 0, eLen = execs.length; j < eLen; j++) {
229
- const action = execs[j];
230
- const runner = new ActionRunner(action, this.eventTarget);
231
- try {
232
- await runner.request(request);
233
- }
234
- catch (e) {
235
- if (action.failOnError) {
236
- throw e;
237
- }
238
- else {
239
- const err = e;
240
- console.error(`Unable to run a request action: ${action.name || 'unknown name'}: ${err.message}`);
241
- }
242
- }
243
- }
244
- }
245
- }
246
- async processRequestModules(request) {
247
- const modules = ModulesRegistry.get(ModulesRegistry.request);
248
- for (const [id, main] of modules) {
249
- const mod = main;
250
- const context = await this.buildExecutionContext(mod.permissions);
251
- let result;
252
- try {
253
- result = await mod.fn(request, context);
254
- }
255
- catch (e) {
256
- // eslint-disable-next-line no-console
257
- const err = e;
258
- console.warn(e);
259
- const message = `Request module ${id} reported error: ${err.message}`;
260
- throw new Error(message);
261
- }
262
- if (result === ExecutionResponse.ABORT) {
263
- return;
264
- }
265
- if (Array.isArray(context.certificates)) {
266
- if (!Array.isArray(this.certificates)) {
267
- this.certificates = [];
268
- }
269
- this.certificates.concat(context.certificates);
270
- }
271
- }
272
- }
273
- /**
274
- * Prepares the HTTP engine configuration and executes the request,
275
- * @param request The request to execute.
276
- * @returns The execution log.
277
- */
278
- async executeRequest(request) {
279
- const opts = await this.prepareEngineConfig();
280
- const engine = new CoreEngine(request, opts);
281
- return engine.send();
282
- }
283
- /**
284
- * Creates a configuration options for the HTTP engine.
285
- */
286
- async prepareEngineConfig() {
287
- const { certificates, logger, signal } = this;
288
- const auth = await this.readAuthorization();
289
- const config = await this.readConfig();
290
- const opts = {};
291
- if (Array.isArray(certificates) && certificates.length) {
292
- opts.certificates = certificates;
293
- }
294
- if (Array.isArray(auth)) {
295
- opts.authorization = auth;
296
- }
297
- if (logger) {
298
- opts.logger = logger;
299
- }
300
- if (signal) {
301
- opts.signal = signal;
302
- }
303
- if (!config || config.enabled === false) {
304
- return opts;
305
- }
306
- const exclude = ['kind', 'enabled', 'ignoreSessionCookies', 'variables'];
307
- Object.keys(config).forEach(key => {
308
- if (exclude.includes(key)) {
309
- return;
310
- }
311
- const value = config[key];
312
- opts[key] = value;
313
- });
314
- return opts;
315
- }
316
- async processResponse(log) {
317
- const { request, response } = log;
318
- if (!request || !response) {
319
- return;
320
- }
321
- await this.processResponseActions(log);
322
- await this.processResponseModules(log);
323
- }
324
- async processResponseActions(log) {
325
- const actions = await this.readActions('response');
326
- if (!Array.isArray(actions) || !actions.length) {
327
- return;
328
- }
329
- if (!log.request || !log.response) {
330
- return;
331
- }
332
- const runnables = actions.filter((item) => item.enabled !== false && !!item.actions && !!item.actions.length);
333
- if (!runnables.length) {
334
- return;
335
- }
336
- for (let i = 0, len = runnables.length; i < len; i++) {
337
- const runnable = new RunnableCondition(runnables[i]);
338
- const passed = await runnable.satisfied(log.request, log.response);
339
- if (!passed) {
340
- continue;
341
- }
342
- const execs = runnable.actions.filter(i => i.enabled !== false);
343
- execs.sort(Action.sortActions);
344
- for (let j = 0, eLen = execs.length; j < eLen; j++) {
345
- const action = execs[j];
346
- const runner = new ActionRunner(action, this.eventTarget);
347
- try {
348
- await runner.response(log);
349
- }
350
- catch (e) {
351
- if (action.failOnError) {
352
- throw e;
353
- }
354
- else {
355
- const err = e;
356
- console.error(`Unable to run a request action: ${action.name || 'unknown name'}: ${err.message}`);
357
- }
358
- }
359
- }
360
- }
361
- }
362
- async processResponseModules(log) {
363
- const modules = ModulesRegistry.get(ModulesRegistry.response);
364
- for (const [id, main] of modules) {
365
- const mod = main;
366
- const context = await this.buildExecutionContext(mod.permissions);
367
- let result;
368
- try {
369
- result = await mod.fn(log, context);
370
- }
371
- catch (e) {
372
- // eslint-disable-next-line no-console
373
- const err = e;
374
- console.warn(e);
375
- const message = `Response module ${id} reported error: ${err.message}`;
376
- throw new Error(message);
377
- }
378
- if (result === ExecutionResponse.ABORT) {
379
- return;
380
- }
381
- }
382
- }
383
- async buildExecutionContext(permissions) {
384
- const result = {
385
- eventsTarget: this.eventTarget,
386
- };
387
- const hasEnvironment = permissions.includes(RegistryPermission.environment);
388
- if (hasEnvironment) {
389
- result.variables = this.variables;
390
- }
391
- if (permissions.includes(RegistryPermission.events)) {
392
- result.Events = {
393
- Authorization: Events.Authorization,
394
- ClientCertificate: Events.Model.ClientCertificate,
395
- Cookie: Events.Cookie,
396
- Encryption: Events.Encryption,
397
- Process: Events.Process,
398
- Environment: Events.Environment,
399
- };
400
- }
401
- result.authorization = this.authorization;
402
- result.config = await this.readConfig();
403
- return result;
404
- }
405
- }
406
- //# sourceMappingURL=RequestFactory.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"RequestFactory.js","sourceRoot":"","sources":["../../../../src/runtime/node/RequestFactory.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,kBAAkB,EAAE,MAAM,oCAAoC,CAAC;AAExE,OAAO,EAAE,MAAM,EAAE,MAAM,gCAAgC,CAAC;AACxD,OAAO,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAC;AACpE,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAE1D,OAAO,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAC;AAC1D,OAAO,EAAE,eAAe,EAAuE,kBAAkB,EAAE,MAAM,+BAA+B,CAAC;AACzJ,OAAO,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAC;AACpE,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAGhD;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,OAAO,cAAc;IACzB;;;;OAIG;IACH,WAAW,CAAc;IACzB;;OAEG;IACH,MAAM,CAAkB;IACxB;;OAEG;IACH,aAAa,CAA2B;IACxC;;OAEG;IACH,OAAO,CAAmB;IAC1B;;OAEG;IACH,YAAY,CAAqB;IACjC;;;;;;OAMG;IACH,SAAS,CAA0B;IACnC;;OAEG;IACH,kBAAkB,GAAG,IAAI,kBAAkB,EAAE,CAAC;IAE9C,MAAM,CAAU;IAEhB;;;;OAIG;IACH,MAAM,CAAe;IAErB;;;;;;OAMG;IACH,MAAM,CAAC,WAAW,CAAC,WAAwB,EAAE,OAAiB;QAC5D,MAAM,QAAQ,GAAG,IAAI,cAAc,CAAC,WAAW,CAAC,CAAC;QACjD,QAAQ,CAAC,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC;QACnC,QAAQ,CAAC,aAAa,GAAG,OAAO,CAAC,aAA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AAG,IAAI,CAAC,SAAS,CAAC;SACnC;QACD,IAAI,WAAW,CAAC,QAAQ,CAAC,kBAAkB,CAAC,MAAM,CAAC,EAAE;YACnD,MAAM,CAAC,MAAM,GAAG;gBACd,aAAa,EAAE,MAAM,CAAC,aAAa;gBACnC,iBAAiB,EAAE,MAAM,CAAC,KAAK,CAAC,iBAAiB;gBACjD,MAAM,EAAE,MAAM,CAAC,MAAM;gBACrB,UAAU,EAAE,MAAM,CAAC,UAAU;gBAC7B,OAAO,EAAE,MAAM,CAAC,OAAO;gBACvB,WAAW,EAAE,MAAM,CAAC,WAAW;aAChC,CAAC;SACH;QACD,MAAM,CAAC,aAAa,GAAG,IAAI,CAAC,aAAa,CAAC;QAC1C,MAAM,CAAC,MAAM,GAAG,MAAM,IAAI,CAAC,UAAU,EAAE,CAAC;QACxC,OAAO,MAAM,CAAC;IAChB,CAAC;CACF"}
@@ -1,9 +0,0 @@
1
- import { HttpProject } from '../../models/HttpProject.js';
2
- import { ProjectFolder } from '../../models/ProjectFolder.js';
3
- export declare class VariablesStore {
4
- private static cache;
5
- static get(target: HttpProject | ProjectFolder): Record<string, string>;
6
- static set(target: HttpProject | ProjectFolder, variables: Record<string, string>): void;
7
- static has(target: HttpProject | ProjectFolder): boolean;
8
- static delete(target: HttpProject | ProjectFolder): void;
9
- }
@@ -1,19 +0,0 @@
1
- export class VariablesStore {
2
- static cache = new WeakMap();
3
- static get(target) {
4
- if (!this.cache.has(target)) {
5
- this.cache.set(target, {});
6
- }
7
- return this.cache.get(target);
8
- }
9
- static set(target, variables) {
10
- this.cache.set(target, variables);
11
- }
12
- static has(target) {
13
- return this.cache.has(target);
14
- }
15
- static delete(target) {
16
- this.cache.delete(target);
17
- }
18
- }
19
- //# sourceMappingURL=VariablesStore.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"VariablesStore.js","sourceRoot":"","sources":["../../../../src/runtime/node/VariablesStore.ts"],"names":[],"mappings":"AAGA,MAAM,OAAO,cAAc;IACjB,MAAM,CAAC,KAAK,GAAG,IAAI,OAAO,EAAuD,CAAC;IAE1F,MAAM,CAAC,GAAG,CAAC,MAAmC;QAC5C,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE;YAC3B,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;SAC5B;QACD,OAAO,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,MAAM,CAA2B,CAAC;IAC1D,CAAC;IAED,MAAM,CAAC,GAAG,CAAC,MAAmC,EAAE,SAAiC;QAC/E,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC;IACpC,CAAC;IAED,MAAM,CAAC,GAAG,CAAC,MAAmC;QAC5C,OAAO,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;IAChC,CAAC;IAED,MAAM,CAAC,MAAM,CAAC,MAAmC;QAC/C,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;IAC5B,CAAC"}