@api-client/core 0.6.30 → 0.7.1

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 (324) 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/{arc/ArcHttpRequest.js → AppRequest.js} +53 -17
  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/AppSdk.d.ts +185 -0
  136. package/build/src/runtime/store/AppSdk.js +704 -0
  137. package/build/src/runtime/store/AppSdk.js.map +1 -0
  138. package/build/src/runtime/store/FilesSdk.js +4 -4
  139. package/build/src/runtime/store/FilesSdk.js.map +1 -1
  140. package/build/src/runtime/store/HistorySdk.js +2 -2
  141. package/build/src/runtime/store/HistorySdk.js.map +1 -1
  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/AppSdk.ts +709 -0
  199. package/src/runtime/store/FilesSdk.ts +4 -4
  200. package/src/runtime/store/HistorySdk.ts +2 -2
  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 -40
  254. package/build/src/models/arc/ArcHttpRequest.js.map +0 -1
  255. package/build/src/models/arc/ArcProject.js.map +0 -1
  256. package/build/src/runtime/actions/ActionRunner.d.ts +0 -17
  257. package/build/src/runtime/actions/ActionRunner.js +0 -74
  258. package/build/src/runtime/actions/ActionRunner.js.map +0 -1
  259. package/build/src/runtime/actions/ConditionRunner.js.map +0 -1
  260. package/build/src/runtime/actions/RunnableCondition.d.ts +0 -27
  261. package/build/src/runtime/actions/RunnableCondition.js +0 -50
  262. package/build/src/runtime/actions/RunnableCondition.js.map +0 -1
  263. package/build/src/runtime/actions/runnable/ActionRunnable.d.ts +0 -13
  264. package/build/src/runtime/actions/runnable/ActionRunnable.js +0 -13
  265. package/build/src/runtime/actions/runnable/ActionRunnable.js.map +0 -1
  266. package/build/src/runtime/actions/runnable/DeleteCookieRunnable.d.ts +0 -7
  267. package/build/src/runtime/actions/runnable/DeleteCookieRunnable.js +0 -36
  268. package/build/src/runtime/actions/runnable/DeleteCookieRunnable.js.map +0 -1
  269. package/build/src/runtime/actions/runnable/SetCookieRunnable.d.ts +0 -10
  270. package/build/src/runtime/actions/runnable/SetCookieRunnable.js +0 -89
  271. package/build/src/runtime/actions/runnable/SetCookieRunnable.js.map +0 -1
  272. package/build/src/runtime/actions/runnable/SetVariableRunnable.d.ts +0 -10
  273. package/build/src/runtime/actions/runnable/SetVariableRunnable.js +0 -49
  274. package/build/src/runtime/actions/runnable/SetVariableRunnable.js.map +0 -1
  275. package/build/src/runtime/modules/BasicAuthCache.d.ts +0 -39
  276. package/build/src/runtime/modules/BasicAuthCache.js +0 -122
  277. package/build/src/runtime/modules/BasicAuthCache.js.map +0 -1
  278. package/build/src/runtime/modules/ExecutionResponse.d.ts +0 -4
  279. package/build/src/runtime/modules/ExecutionResponse.js +0 -6
  280. package/build/src/runtime/modules/ExecutionResponse.js.map +0 -1
  281. package/build/src/runtime/modules/ModulesRegistry.d.ts +0 -93
  282. package/build/src/runtime/modules/ModulesRegistry.js +0 -69
  283. package/build/src/runtime/modules/ModulesRegistry.js.map +0 -1
  284. package/build/src/runtime/modules/RequestAuthorization.d.ts +0 -6
  285. package/build/src/runtime/modules/RequestAuthorization.js +0 -110
  286. package/build/src/runtime/modules/RequestAuthorization.js.map +0 -1
  287. package/build/src/runtime/modules/RequestCookies.d.ts +0 -17
  288. package/build/src/runtime/modules/RequestCookies.js +0 -134
  289. package/build/src/runtime/modules/RequestCookies.js.map +0 -1
  290. package/build/src/runtime/node/RequestFactory.js +0 -406
  291. package/build/src/runtime/node/RequestFactory.js.map +0 -1
  292. package/build/src/runtime/node/VariablesStore.d.ts +0 -9
  293. package/build/src/runtime/node/VariablesStore.js +0 -19
  294. package/build/src/runtime/node/VariablesStore.js.map +0 -1
  295. package/src/lib/cookies/Cookie.ts +0 -312
  296. package/src/lib/cookies/Cookies.ts +0 -326
  297. package/src/lib/cookies/Utils.ts +0 -168
  298. package/src/mocking/lib/Arc.ts +0 -34
  299. package/src/models/RequestActions.ts +0 -161
  300. package/src/models/actions/Action.ts +0 -213
  301. package/src/models/actions/ActionView.ts +0 -40
  302. package/src/models/actions/Condition.ts +0 -207
  303. package/src/models/actions/ConditionView.ts +0 -42
  304. package/src/models/actions/Enums.ts +0 -29
  305. package/src/models/actions/RunnableAction.ts +0 -144
  306. package/src/models/actions/runnable/DeleteCookieAction.ts +0 -113
  307. package/src/models/actions/runnable/Runnable.ts +0 -9
  308. package/src/models/actions/runnable/SetCookieAction.ts +0 -216
  309. package/src/models/actions/runnable/SetVariableAction.ts +0 -81
  310. package/src/models/arc/ArcHttpRequest.ts +0 -129
  311. package/src/models/arc/readme.md +0 -3
  312. package/src/runtime/actions/ActionRunner.ts +0 -83
  313. package/src/runtime/actions/RunnableCondition.ts +0 -56
  314. package/src/runtime/actions/runnable/ActionRunnable.ts +0 -19
  315. package/src/runtime/actions/runnable/DeleteCookieRunnable.ts +0 -39
  316. package/src/runtime/actions/runnable/SetCookieRunnable.ts +0 -92
  317. package/src/runtime/actions/runnable/SetVariableRunnable.ts +0 -53
  318. package/src/runtime/modules/BasicAuthCache.ts +0 -129
  319. package/src/runtime/modules/ExecutionResponse.ts +0 -4
  320. package/src/runtime/modules/ModulesRegistry.ts +0 -136
  321. package/src/runtime/modules/RequestAuthorization.ts +0 -106
  322. package/src/runtime/modules/RequestCookies.ts +0 -146
  323. package/src/runtime/node/RequestFactory.ts +0 -432
  324. package/src/runtime/node/VariablesStore.ts +0 -25
@@ -1,114 +0,0 @@
1
- import { RunnableAction, Kind as RunnableActionKind } from './actions/RunnableAction.js';
2
- export class RequestActions {
3
- /**
4
- * Actions to be executed before the request is sent to the transport library.
5
- */
6
- request;
7
- /**
8
- * Actions to be executed after the response is fully received but before it is reported back to the application.
9
- */
10
- response;
11
- static fromLegacy(action) {
12
- const { request, response } = action;
13
- const init = {};
14
- if (Array.isArray(request) && request.length) {
15
- init.request = request.map(i => RunnableAction.fromLegacy(i).toJSON());
16
- }
17
- if (Array.isArray(response) && response.length) {
18
- init.response = response.map(i => RunnableAction.fromLegacy(i).toJSON());
19
- }
20
- return new RequestActions(init);
21
- }
22
- static isLegacy(input) {
23
- const { request = [], response = [] } = input;
24
- if (!request.length && !response.length) {
25
- return false;
26
- }
27
- if (request[0]) {
28
- const r = request[0];
29
- if (r.kind === RunnableActionKind) {
30
- return false;
31
- }
32
- }
33
- if (response[0]) {
34
- const r = response[0];
35
- if (r.kind === RunnableActionKind) {
36
- return false;
37
- }
38
- }
39
- return true;
40
- }
41
- /**
42
- * @param input The request actions definition used to restore the state.
43
- */
44
- constructor(input) {
45
- let init;
46
- if (typeof input === 'string') {
47
- init = JSON.parse(input);
48
- }
49
- else if (typeof input === 'object') {
50
- init = input;
51
- }
52
- else {
53
- init = {};
54
- }
55
- this.new(init);
56
- }
57
- /**
58
- * Creates a new request actions clearing anything that is so far defined.
59
- */
60
- new(init) {
61
- const { request, response } = init;
62
- if (request) {
63
- this.request = request.map(i => new RunnableAction(i));
64
- }
65
- else {
66
- this.request = undefined;
67
- }
68
- if (response) {
69
- this.response = response.map(i => new RunnableAction(i));
70
- }
71
- else {
72
- this.response = undefined;
73
- }
74
- }
75
- toJSON() {
76
- const result = {};
77
- if (this.request) {
78
- result.request = this.request.map(i => i.toJSON());
79
- }
80
- if (this.response) {
81
- result.response = this.response.map(i => i.toJSON());
82
- }
83
- return result;
84
- }
85
- addRequestAction(action) {
86
- if (!Array.isArray(this.request)) {
87
- this.request = [];
88
- }
89
- let finalAction;
90
- if (action instanceof RunnableAction) {
91
- finalAction = action;
92
- }
93
- else {
94
- finalAction = new RunnableAction(action);
95
- }
96
- this.request.push(finalAction);
97
- return finalAction;
98
- }
99
- addResponseAction(action) {
100
- if (!Array.isArray(this.response)) {
101
- this.response = [];
102
- }
103
- let finalAction;
104
- if (action instanceof RunnableAction) {
105
- finalAction = action;
106
- }
107
- else {
108
- finalAction = new RunnableAction(action);
109
- }
110
- this.response.push(finalAction);
111
- return finalAction;
112
- }
113
- }
114
- //# sourceMappingURL=RequestActions.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"RequestActions.js","sourceRoot":"","sources":["../../../src/models/RequestActions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAmB,c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AE,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC;SACpD;QACD,IAAI,IAAI,CAAC,QAAQ,EAAE;YACjB,MAAM,CAAC,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC;SACtD;QACD,OAAO,MAAM,CAAC;IAChB,CAAC;IAmBD,gBAAgB,CAAC,MAAwC;QACvD,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE;YAChC,IAAI,CAAC,OAAO,GAAG,EAAE,CAAC;SACnB;QACD,IAAI,WAA2B,CAAC;QAChC,IAAI,MAAM,YAAY,cAAc,EAAE;YACpC,WAAW,GAAG,MAAM,CAAC;SACtB;aAAM;YACL,WAAW,GAAG,IAAI,cAAc,CAAC,MAAM,CAAC,CAAC;SAC1C;QACD,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;QAC/B,OAAO,WAAW,CAAC;IACrB,CAAC;IAmBD,iBAAiB,CAAC,MAAwC;QACxD,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE;YACjC,IAAI,CAAC,QAAQ,GAAG,EAAE,CAAC;SACpB;QACD,IAAI,WAA2B,CAAC;QAChC,IAAI,MAAM,YAAY,cAAc,EAAE;YACpC,WAAW,GAAG,MAAM,CAAC;SACtB;aAAM;YACL,WAAW,GAAG,IAAI,cAAc,CAAC,MAAM,CAAC,CAAC;SAC1C;QACD,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;QAChC,OAAO,WAAW,CAAC;IACrB,CAAC;CACF"}
@@ -1,75 +0,0 @@
1
- import { Runnable } from './runnable/Runnable.js';
2
- import { Action as LegacyAction } from '../legacy/actions/Actions.js';
3
- export declare const Kind = "Core#Action";
4
- /**
5
- * An interface representing a single action.
6
- */
7
- export interface IAction {
8
- kind?: typeof Kind;
9
- /**
10
- * Action name.
11
- */
12
- name?: string;
13
- /**
14
- * Whether the action is enabled.
15
- * An action is enabled by default.
16
- * @default true
17
- */
18
- enabled?: boolean;
19
- /**
20
- * Action priority. The higher number the higher priority of execution.
21
- */
22
- priority?: number;
23
- /**
24
- * The action configuration. The schema depends on the action type.
25
- */
26
- config?: unknown;
27
- /**
28
- * Whether or not the action is executed synchronously to request / response
29
- */
30
- sync?: boolean;
31
- /**
32
- * Whether or not the request should fail when the action fails.
33
- */
34
- failOnError?: boolean;
35
- }
36
- export declare class Action {
37
- kind: string;
38
- /**
39
- * Action name.
40
- */
41
- name?: string;
42
- /**
43
- * Whether the action is enabled.
44
- */
45
- enabled?: boolean;
46
- /**
47
- * Action priority. The higher number the higher priority of execution.
48
- */
49
- priority?: number;
50
- /**
51
- * Action configuration
52
- */
53
- config?: Runnable;
54
- /**
55
- * Whether or not the action is executed synchronously to request / response
56
- */
57
- sync?: boolean;
58
- /**
59
- * Whether or not the request should fail when the action fails.
60
- */
61
- failOnError?: boolean;
62
- static fromLegacy(item: LegacyAction): Action;
63
- /**
64
- * Creates a default configuration of an action
65
- */
66
- static defaultAction(): Action;
67
- constructor(input?: string | IAction);
68
- new(init: IAction): void;
69
- toJSON(): IAction;
70
- setConfig(config: unknown): void;
71
- /**
72
- * The sort function for actions to sort them for the execution order.
73
- */
74
- static sortActions(a: Action, b: Action): number;
75
- }
@@ -1,188 +0,0 @@
1
- import { Kind as DeleteCookieKind, DeleteCookieAction } from './runnable/DeleteCookieAction.js';
2
- import { Kind as SetCookieKind, SetCookieAction } from './runnable/SetCookieAction.js';
3
- import { Kind as SetVariableKind, SetVariableAction } from './runnable/SetVariableAction.js';
4
- export const Kind = 'Core#Action';
5
- export class Action {
6
- kind = Kind;
7
- /**
8
- * Action name.
9
- */
10
- name;
11
- /**
12
- * Whether the action is enabled.
13
- */
14
- enabled;
15
- /**
16
- * Action priority. The higher number the higher priority of execution.
17
- */
18
- priority;
19
- /**
20
- * Action configuration
21
- */
22
- config;
23
- /**
24
- * Whether or not the action is executed synchronously to request / response
25
- */
26
- sync;
27
- /**
28
- * Whether or not the request should fail when the action fails.
29
- */
30
- failOnError;
31
- static fromLegacy(item) {
32
- const { priority, config, enabled, failOnError, name, sync } = item;
33
- let newConfig;
34
- switch (name) {
35
- case 'set-cookie':
36
- newConfig = SetCookieAction.fromLegacy(config).toJSON();
37
- break;
38
- case 'set-variable':
39
- newConfig = SetVariableAction.fromLegacy(config);
40
- break;
41
- case 'delete-cookie':
42
- newConfig = DeleteCookieAction.fromLegacy(config);
43
- break;
44
- }
45
- const init = {
46
- kind: Kind,
47
- priority,
48
- };
49
- if (typeof enabled === 'boolean') {
50
- init.enabled = enabled;
51
- }
52
- if (typeof failOnError === 'boolean') {
53
- init.failOnError = failOnError;
54
- }
55
- if (typeof sync === 'boolean') {
56
- init.sync = sync;
57
- }
58
- if (typeof name === 'string') {
59
- init.name = name;
60
- }
61
- if (newConfig) {
62
- init.config = newConfig;
63
- }
64
- return new Action(init);
65
- }
66
- /**
67
- * Creates a default configuration of an action
68
- */
69
- static defaultAction() {
70
- const init = {
71
- name: 'New action',
72
- failOnError: false,
73
- priority: 0,
74
- sync: false,
75
- enabled: true,
76
- };
77
- return new Action(init);
78
- }
79
- constructor(input) {
80
- let init;
81
- if (typeof input === 'string') {
82
- init = JSON.parse(input);
83
- }
84
- else if (typeof input === 'object') {
85
- init = input;
86
- }
87
- else {
88
- init = {
89
- kind: Kind,
90
- };
91
- }
92
- this.new(init);
93
- }
94
- new(init) {
95
- const { name, enabled, priority, sync, failOnError, config } = init;
96
- this.kind = Kind;
97
- if (name) {
98
- this.name = name;
99
- }
100
- else {
101
- this.name = undefined;
102
- }
103
- if (typeof enabled === 'boolean') {
104
- this.enabled = enabled;
105
- }
106
- else {
107
- this.enabled = undefined;
108
- }
109
- if (typeof sync === 'boolean') {
110
- this.sync = sync;
111
- }
112
- else {
113
- this.sync = undefined;
114
- }
115
- if (typeof failOnError === 'boolean') {
116
- this.failOnError = failOnError;
117
- }
118
- else {
119
- this.failOnError = undefined;
120
- }
121
- if (typeof priority === 'number') {
122
- this.priority = priority;
123
- }
124
- else {
125
- this.priority = undefined;
126
- }
127
- if (config) {
128
- this.setConfig(config);
129
- }
130
- else {
131
- this.config = undefined;
132
- }
133
- }
134
- toJSON() {
135
- const result = {
136
- kind: Kind,
137
- };
138
- if (this.name) {
139
- result.name = this.name;
140
- }
141
- if (this.config) {
142
- result.config = this.config.toJSON();
143
- }
144
- if (typeof this.enabled === 'boolean') {
145
- result.enabled = this.enabled;
146
- }
147
- if (typeof this.sync === 'boolean') {
148
- result.sync = this.sync;
149
- }
150
- if (typeof this.failOnError === 'boolean') {
151
- result.failOnError = this.failOnError;
152
- }
153
- if (typeof this.priority === 'number') {
154
- result.priority = this.priority;
155
- }
156
- return result;
157
- }
158
- setConfig(config) {
159
- const { kind } = config;
160
- switch (kind) {
161
- case DeleteCookieKind:
162
- this.config = new DeleteCookieAction(config);
163
- break;
164
- case SetCookieKind:
165
- this.config = new SetCookieAction(config);
166
- break;
167
- case SetVariableKind:
168
- this.config = new SetVariableAction(config);
169
- break;
170
- default: throw new Error(`Unknown action config.`);
171
- }
172
- }
173
- /**
174
- * The sort function for actions to sort them for the execution order.
175
- */
176
- static sortActions(a, b) {
177
- const { priority: p1 = 0 } = a;
178
- const { priority: p2 = 0 } = b;
179
- if (p1 > p2) {
180
- return 1;
181
- }
182
- if (p2 > p1) {
183
- return -1;
184
- }
185
- return 0;
186
- }
187
- }
188
- //# sourceMappingURL=Action.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Action.js","sourceRoot":"","sources":["../../../../src/models/actions/Action.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,IAAI,IAAI,gBAAgB,EAAE,kBAAkB,EAAuB,MAAM,kCAAkC,CAAC;AACrH,OAAO,EAAE,IAAI,IAAI,aAAa,EAAE,eAAe,EAAoB,MAAM,+BAA+B,CAAC;AACzG,O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AAK,QAAQ,EAAE;YACrC,MAAM,CAAC,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC;SACjC;QACD,OAAO,MAAM,CAAC;IAChB,CAAC;IAED,SAAS,CAAC,MAAe;QACvB,MAAM,EAAE,IAAI,EAAE,GAAG,MAAmB,CAAC;QACrC,QAAQ,IAAI,EAAE;YACZ,KAAK,gBAAgB;gBAAE,IAAI,CAAC,MAAM,GAAG,IAAI,kBAAkB,CAAC,MAA6B,CAAC,CAAC;gBAAC,MAAM;YAClG,KAAK,aAAa;gBAAE,IAAI,CAAC,MAAM,GAAG,IAAI,eAAe,CAAC,MAA0B,CAAC,CAAC;gBAAC,MAAM;YACzF,KAAK,eAAe;gBAAE,IAAI,CAAC,MAAM,GAAG,IAAI,iBAAiB,CAAC,MAA4B,CAAC,CAAC;gBAAC,MAAM;YAC/F,OAAO,CAAC,CAAC,MAAM,IAAI,KAAK,CAAC,wBAAwB,CAAC,CAAA;SACnD;IACH,CAAC;IAED;;OAEG;IACH,MAAM,CAAC,WAAW,CAAC,CAAS,EAAE,CAAS;QACrC,MAAM,EAAE,QAAQ,EAAE,EAAE,GAAC,CAAC,EAAE,GAAG,CAAC,CAAC;QAC7B,MAAM,EAAE,QAAQ,EAAE,EAAE,GAAC,CAAC,EAAE,GAAG,CAAC,CAAC;QAC7B,IAAI,EAAE,GAAG,EAAE,EAAE;YACX,OAAO,CAAC,CAAC;SACV;QACD,IAAI,EAAE,GAAG,EAAE,EAAE;YACX,OAAO,CAAC,CAAC,CAAC;SACX;QACD,OAAO,CAAC,CAAC;IACX,CAAC;CACF"}
@@ -1,15 +0,0 @@
1
- export interface IActionView {
2
- /**
3
- * Whether the action is "opened" in the editor UI.
4
- */
5
- opened?: boolean;
6
- }
7
- export declare class ActionView {
8
- /**
9
- * Whether the action is "opened" in the editor UI.
10
- */
11
- opened?: boolean;
12
- constructor(input?: string | IActionView);
13
- new(init: IActionView): void;
14
- toJSON(): IActionView;
15
- }
@@ -1,33 +0,0 @@
1
- export class ActionView {
2
- /**
3
- * Whether the action is "opened" in the editor UI.
4
- */
5
- opened;
6
- constructor(input) {
7
- let init;
8
- if (typeof input === 'string') {
9
- init = JSON.parse(input);
10
- }
11
- else if (typeof input === 'object') {
12
- init = input;
13
- }
14
- else {
15
- init = {
16
- opened: false,
17
- };
18
- }
19
- this.new(init);
20
- }
21
- new(init) {
22
- const { opened = false } = init;
23
- this.opened = opened;
24
- }
25
- toJSON() {
26
- const result = {};
27
- if (typeof this.opened === 'boolean') {
28
- result.opened = this.opened;
29
- }
30
- return result;
31
- }
32
- }
33
- //# sourceMappingURL=ActionView.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ActionView.js","sourceRoot":"","sources":["../../../../src/models/actions/ActionView.ts"],"names":[],"mappings":"AAOA,MAAM,OAAO,UAAU;IACrB;;OAEG;IACH,MAAM,CAAW;IAEjB,YAAY,KAA0B;QACpC,IAAI,IAAiB,CAAC;QACtB,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE;YAC7B,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;SAC1B;aAAM,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE;YACpC,IAAI,GAAG,KAAK,CAAC;SACd;aAAM;YACL,IAAI,GAAG;gBACL,MAAM,EAAE,KAAK;aACd,CAAC;SACH;QACD,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;IACjB,CAAC;IAED,GAAG,CAAC,IAAiB;QACnB,MAAM,EAAE,MAAM,GAAC,KAAK,EAAE,GAAG,IAAI,CAAC;QAC9B,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACvB,CAAC;IAED,MAAM;QACJ,MAAM,MAAM,GAAgB,EAAE,CAAC;QAC/B,IAAI,OAAO,IAAI,CAAC,MAAM,KAAK,SAAS,EAAE;YACpC,MAAM,CAAC,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC;SAC7B;QACD,OAAO,MAAM,CAAC;IAChB,CAAC;CACF"}
@@ -1,81 +0,0 @@
1
- import { ActionTypeEnum, RequestDataSourceEnum, ResponseDataSourceEnum, OperatorEnum } from './Enums.js';
2
- import { Condition as LegacyCondition } from '../legacy/actions/Actions.js';
3
- export declare const Kind = "Core#Condition";
4
- /**
5
- * A base interface describing a configuration to extract data from a request or a response.
6
- */
7
- export interface IDataSource {
8
- /**
9
- * The main data source. Either the request or the response object.
10
- * This is required when the `source` is not equal to `value. In this case it is ignored
11
- */
12
- type?: ActionTypeEnum;
13
- /**
14
- * Source of the data.
15
- */
16
- source: RequestDataSourceEnum | ResponseDataSourceEnum | 'value';
17
- /**
18
- * The path to the data.
19
- * For JSON value use https://jmespath.org/ syntax.
20
- * For XML use xpath.
21
- * For any other use a simple path to the data separated by dot (e.g. headers.content-type)
22
- */
23
- path?: string;
24
- /**
25
- * Only used when the `source` is `value`. The data extraction always returns this value.
26
- */
27
- value?: string;
28
- }
29
- /**
30
- * Describes action's condition configuration.
31
- */
32
- export interface ICondition extends IDataSource {
33
- kind: typeof Kind;
34
- /**
35
- * The comparison operator.
36
- */
37
- operator?: OperatorEnum;
38
- /**
39
- * Whether the condition always pass.
40
- * The condition is not really checked, values can be empty. The condition check always returns `true`.
41
- */
42
- alwaysPass?: boolean;
43
- }
44
- export declare class Condition {
45
- kind: string;
46
- /**
47
- * The main data source. Either the request or the response object.
48
- * This is required when the `source` is not equal to `value. In this case it is ignored
49
- */
50
- type?: ActionTypeEnum;
51
- /**
52
- * Source of the data.
53
- */
54
- source: RequestDataSourceEnum | ResponseDataSourceEnum | 'value';
55
- /**
56
- * The path to the data.
57
- * For JSON value use https://jmespath.org/ syntax.
58
- * For XML use xpath.
59
- * For any other use a simple path to the data separated by dot (e.g. headers.content-type)
60
- */
61
- path?: string;
62
- /**
63
- * Only used when the `source` is `value`. The data extraction always returns this value.
64
- */
65
- value?: string;
66
- /**
67
- * The comparison operator.
68
- */
69
- operator?: OperatorEnum;
70
- /**
71
- * Whether the condition always pass.
72
- * The condition is not really checked, values can be empty. The condition check always returns `true`.
73
- */
74
- alwaysPass?: boolean;
75
- static defaultCondition(type?: ActionTypeEnum): Condition;
76
- static fromLegacy(runnable: LegacyCondition): Condition;
77
- static alwaysPass(type?: ActionTypeEnum): Condition;
78
- constructor(input?: string | ICondition);
79
- new(init: ICondition): void;
80
- toJSON(): ICondition;
81
- }