@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,185 +0,0 @@
1
- import { ActionTypeEnum, RequestDataSourceEnum, OperatorEnum } from './Enums.js';
2
- export const Kind = 'Core#Condition';
3
- export class Condition {
4
- kind = Kind;
5
- /**
6
- * The main data source. Either the request or the response object.
7
- * This is required when the `source` is not equal to `value. In this case it is ignored
8
- */
9
- type;
10
- /**
11
- * Source of the data.
12
- */
13
- source = RequestDataSourceEnum.url;
14
- /**
15
- * The path to the data.
16
- * For JSON value use https://jmespath.org/ syntax.
17
- * For XML use xpath.
18
- * For any other use a simple path to the data separated by dot (e.g. headers.content-type)
19
- */
20
- path;
21
- /**
22
- * Only used when the `source` is `value`. The data extraction always returns this value.
23
- */
24
- value;
25
- /**
26
- * The comparison operator.
27
- */
28
- operator;
29
- /**
30
- * Whether the condition always pass.
31
- * The condition is not really checked, values can be empty. The condition check always returns `true`.
32
- */
33
- alwaysPass;
34
- static defaultCondition(type = ActionTypeEnum.response) {
35
- const init = {
36
- kind: Kind,
37
- type,
38
- source: RequestDataSourceEnum.url,
39
- operator: OperatorEnum.equal,
40
- path: '',
41
- alwaysPass: false,
42
- };
43
- return new Condition(init);
44
- }
45
- static fromLegacy(runnable) {
46
- const { source, alwaysPass, operator, path, predictedValue, type, value } = runnable;
47
- const init = {
48
- kind: Kind,
49
- source: source,
50
- };
51
- if (typeof alwaysPass === 'boolean') {
52
- init.alwaysPass = alwaysPass;
53
- }
54
- if (typeof path === 'string') {
55
- init.path = path;
56
- }
57
- if (path === 'value') {
58
- init.value = String(value);
59
- }
60
- else {
61
- init.value = String(predictedValue);
62
- }
63
- if (operator) {
64
- switch (operator) {
65
- case 'contains':
66
- init.operator = OperatorEnum.contains;
67
- break;
68
- case 'equal':
69
- init.operator = OperatorEnum.equal;
70
- break;
71
- case 'greater-than':
72
- init.operator = OperatorEnum.greaterThan;
73
- break;
74
- case 'greater-than-equal':
75
- init.operator = OperatorEnum.greaterThanEqual;
76
- break;
77
- case 'less-than':
78
- init.operator = OperatorEnum.lessThan;
79
- break;
80
- case 'less-than-equal':
81
- init.operator = OperatorEnum.lessThanEqual;
82
- break;
83
- case 'not-equal':
84
- init.operator = OperatorEnum.notEqual;
85
- break;
86
- case 'regex':
87
- init.operator = OperatorEnum.regex;
88
- break;
89
- }
90
- }
91
- if (type) {
92
- switch (type) {
93
- case 'request':
94
- init.type = ActionTypeEnum.request;
95
- break;
96
- case 'response':
97
- init.type = ActionTypeEnum.response;
98
- break;
99
- }
100
- }
101
- return new Condition(init);
102
- }
103
- static alwaysPass(type = ActionTypeEnum.request) {
104
- const init = {
105
- kind: Kind,
106
- type,
107
- source: 'value',
108
- alwaysPass: true,
109
- };
110
- return new Condition(init);
111
- }
112
- constructor(input) {
113
- let init;
114
- if (typeof input === 'string') {
115
- init = JSON.parse(input);
116
- }
117
- else if (typeof input === 'object') {
118
- init = input;
119
- }
120
- else {
121
- init = {
122
- kind: Kind,
123
- source: RequestDataSourceEnum.url,
124
- };
125
- }
126
- this.new(init);
127
- }
128
- new(init) {
129
- const { source = RequestDataSourceEnum.url, alwaysPass, operator, path, type, value } = init;
130
- this.source = source;
131
- if (typeof alwaysPass === 'boolean') {
132
- this.alwaysPass = alwaysPass;
133
- }
134
- else {
135
- this.alwaysPass = undefined;
136
- }
137
- if (operator) {
138
- this.operator = operator;
139
- }
140
- else {
141
- this.operator = undefined;
142
- }
143
- if (typeof path === 'string') {
144
- this.path = path;
145
- }
146
- else {
147
- this.path = undefined;
148
- }
149
- if (type) {
150
- this.type = type;
151
- }
152
- else {
153
- this.type = undefined;
154
- }
155
- if (value) {
156
- this.value = value;
157
- }
158
- else {
159
- this.value = undefined;
160
- }
161
- }
162
- toJSON() {
163
- const result = {
164
- source: this.source,
165
- kind: Kind,
166
- };
167
- if (this.type) {
168
- result.type = this.type;
169
- }
170
- if (this.path) {
171
- result.path = this.path;
172
- }
173
- if (this.value) {
174
- result.value = this.value;
175
- }
176
- if (this.operator) {
177
- result.operator = this.operator;
178
- }
179
- if (typeof this.alwaysPass === 'boolean') {
180
- result.alwaysPass = this.alwaysPass;
181
- }
182
- return result;
183
- }
184
- }
185
- //# sourceMappingURL=Condition.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Condition.js","sourceRoot":"","sources":["../../../../src/models/actions/Condition.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,qBAAqB,EAA0B,YAAY,EAAE,MAAM,YAAY,CAAC;AAGzG,MAAM,CAAC,MAAM,IAAI,GAAG,gBAAgB,CAAC;AA4CrC,MAAM,OAAO,SAAS;IACpB,IAAI,GAAG,IAAI,CAAC;IACZ;;;OAGG;IACH,IAAI,CAAkB;IACtB;;OAEG;IACH,MAAM,GAA6D,qBAAqB,CA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ACzB,MAAM,EAAE,IAAI,CAAC,MAAM;YACnB,IAAI,EAAE,IAAI;SACX,CAAC;QACF,IAAI,IAAI,CAAC,IAAI,EAAE;YACb,MAAM,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC;SACzB;QACD,IAAI,IAAI,CAAC,IAAI,EAAE;YACb,MAAM,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC;SACzB;QACD,IAAI,IAAI,CAAC,KAAK,EAAE;YACd,MAAM,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC;SAC3B;QACD,IAAI,IAAI,CAAC,QAAQ,EAAE;YACjB,MAAM,CAAC,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC;SACjC;QACD,IAAI,OAAO,IAAI,CAAC,UAAU,KAAK,SAAS,EAAE;YACxC,MAAM,CAAC,UAAU,GAAG,IAAI,CAAC,UAAU,CAAC;SACrC;QACD,OAAO,MAAM,CAAC;IAChB,CAAC;CACF"}
@@ -1,17 +0,0 @@
1
- export interface IConditionView {
2
- /**
3
- * Whether the condition editor is rendered in the "full" view
4
- * instead of the summary.
5
- */
6
- opened?: boolean;
7
- }
8
- export declare class ConditionView {
9
- /**
10
- * Whether the condition editor is rendered in the "full" view
11
- * instead of the summary.
12
- */
13
- opened?: boolean;
14
- constructor(input?: string | IConditionView);
15
- new(init: IConditionView): void;
16
- toJSON(): IConditionView;
17
- }
@@ -1,34 +0,0 @@
1
- export class ConditionView {
2
- /**
3
- * Whether the condition editor is rendered in the "full" view
4
- * instead of the summary.
5
- */
6
- opened;
7
- constructor(input) {
8
- let init;
9
- if (typeof input === 'string') {
10
- init = JSON.parse(input);
11
- }
12
- else if (typeof input === 'object') {
13
- init = input;
14
- }
15
- else {
16
- init = {
17
- opened: false,
18
- };
19
- }
20
- this.new(init);
21
- }
22
- new(init) {
23
- const { opened = false } = init;
24
- this.opened = opened;
25
- }
26
- toJSON() {
27
- const result = {};
28
- if (typeof this.opened === 'boolean') {
29
- result.opened = this.opened;
30
- }
31
- return result;
32
- }
33
- }
34
- //# sourceMappingURL=ConditionView.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ConditionView.js","sourceRoot":"","sources":["../../../../src/models/actions/ConditionView.ts"],"names":[],"mappings":"AAQA,MAAM,OAAO,aAAa;IACxB;;;OAGG;IACH,MAAM,CAAW;IAEjB,YAAY,KAA6B;QACvC,IAAI,IAAoB,CAAC;QACzB,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,IAAoB;QACtB,MAAM,EAAE,MAAM,GAAC,KAAK,EAAE,GAAG,IAAI,CAAC;QAC9B,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACvB,CAAC;IAED,MAAM;QACJ,MAAM,MAAM,GAAmB,EAAE,CAAC;QAClC,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,26 +0,0 @@
1
- export declare enum ActionTypeEnum {
2
- request = "request",
3
- response = "response"
4
- }
5
- export declare enum OperatorEnum {
6
- equal = "equal",
7
- notEqual = "not-equal",
8
- greaterThan = "greater-than",
9
- greaterThanEqual = "greater-than-equal",
10
- lessThan = "less-than",
11
- lessThanEqual = "less-than-equal",
12
- contains = "contains",
13
- regex = "regex"
14
- }
15
- export declare enum RequestDataSourceEnum {
16
- url = "url",
17
- method = "method",
18
- headers = "headers",
19
- body = "body"
20
- }
21
- export declare enum ResponseDataSourceEnum {
22
- url = "url",
23
- status = "status",
24
- headers = "headers",
25
- body = "body"
26
- }
@@ -1,31 +0,0 @@
1
- export var ActionTypeEnum;
2
- (function (ActionTypeEnum) {
3
- ActionTypeEnum["request"] = "request";
4
- ActionTypeEnum["response"] = "response";
5
- })(ActionTypeEnum || (ActionTypeEnum = {}));
6
- export var OperatorEnum;
7
- (function (OperatorEnum) {
8
- OperatorEnum["equal"] = "equal";
9
- OperatorEnum["notEqual"] = "not-equal";
10
- OperatorEnum["greaterThan"] = "greater-than";
11
- OperatorEnum["greaterThanEqual"] = "greater-than-equal";
12
- OperatorEnum["lessThan"] = "less-than";
13
- OperatorEnum["lessThanEqual"] = "less-than-equal";
14
- OperatorEnum["contains"] = "contains";
15
- OperatorEnum["regex"] = "regex";
16
- })(OperatorEnum || (OperatorEnum = {}));
17
- export var RequestDataSourceEnum;
18
- (function (RequestDataSourceEnum) {
19
- RequestDataSourceEnum["url"] = "url";
20
- RequestDataSourceEnum["method"] = "method";
21
- RequestDataSourceEnum["headers"] = "headers";
22
- RequestDataSourceEnum["body"] = "body";
23
- })(RequestDataSourceEnum || (RequestDataSourceEnum = {}));
24
- export var ResponseDataSourceEnum;
25
- (function (ResponseDataSourceEnum) {
26
- ResponseDataSourceEnum["url"] = "url";
27
- ResponseDataSourceEnum["status"] = "status";
28
- ResponseDataSourceEnum["headers"] = "headers";
29
- ResponseDataSourceEnum["body"] = "body";
30
- })(ResponseDataSourceEnum || (ResponseDataSourceEnum = {}));
31
- //# sourceMappingURL=Enums.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Enums.js","sourceRoot":"","sources":["../../../../src/models/actions/Enums.ts"],"names":[],"mappings":"AAAA,MAAM,CAAN,IAAY,cAGX;AAHD,WAAY,cAAc;IACxB,qCAAmB,CAAA;IACnB,uCAAqB,CAAA;AACvB,CAAC,EAHW,cAAc,KAAd,cAAc,QAGzB;AAED,MAAM,CAAN,IAAY,YASX;AATD,WAAY,YAAY;IACtB,+BAAe,CAAA;IACf,sCAAsB,CAAA;IACtB,4CAA4B,CAAA;IAC5B,uDAAuC,CAAA;IACvC,sCAAsB,CAAA;IACtB,iDAAiC,CAAA;IACjC,qCAAqB,CAAA;IACrB,+BAAe,CAAA;AACjB,CAAC,EATW,YAAY,KAAZ,YAAY,QASvB;AAED,MAAM,CAAN,IAAY,qBAKX;AALD,WAAY,qBAAqB;IAC/B,oCAAW,CAAA;IACX,0CAAiB,CAAA;IACjB,4CAAmB,CAAA;IACnB,sCAAa,CAAA;AACf,CAAC,EALW,qBAAqB,KAArB,qBAAqB,QAKhC;AAED,MAAM,CAAN,IAAY,sBAKX;AALD,WAAY,sBAAsB;IAChC,qCAAW,CAAA;IACX,2CAAiB,CAAA;IACjB,6CAAmB,CAAA;IACnB,uCAAa,CAAA;AACf,CAAC,EALW,sBAAsB,KAAtB,sBAAsB,QAKjC"}
@@ -1,59 +0,0 @@
1
- import { ICondition, Condition } from './Condition.js';
2
- import { IAction, Action } from './Action.js';
3
- import { RunnableAction as LegacyRunnable } from '../legacy/actions/Actions.js';
4
- export declare const Kind = "Core#RunnableAction";
5
- /**
6
- * An interface representing a runnable set of action in a condition.
7
- * For the actions to be executed the condition first has to be met.
8
- * The condition can be configured to always pass by setting the `alwaysPass` property.
9
- */
10
- export interface IRunnableAction {
11
- kind?: typeof Kind;
12
- /**
13
- * The condition to be checked when executing the runnable,
14
- */
15
- condition: ICondition;
16
- /**
17
- * The list of actions to execute.
18
- */
19
- actions: IAction[];
20
- /**
21
- * Whether the entire runnable is enabled. This is checked before the condition is executed.
22
- * An action is enabled by default.
23
- */
24
- enabled?: boolean;
25
- }
26
- export declare class RunnableAction {
27
- kind: string;
28
- /**
29
- * The condition to be checked when executing the runnable,
30
- */
31
- condition: Condition;
32
- /**
33
- * The list of actions to execute.
34
- */
35
- actions: Action[];
36
- /**
37
- * Whether the entire runnable is enabled. This is checked before the condition is executed.
38
- */
39
- enabled?: boolean;
40
- static fromLegacy(runnable: LegacyRunnable): RunnableAction;
41
- constructor(input?: string | IRunnableAction);
42
- new(init: IRunnableAction): void;
43
- toJSON(): IRunnableAction;
44
- fromLegacy(runnable: LegacyRunnable): void;
45
- /**
46
- * Adds a new action to the list of runnable action.
47
- *
48
- * @param schema The schema of the action
49
- * @returns Created instance of the action.
50
- */
51
- addAction(schema: IAction): Action;
52
- /**
53
- * Adds a new action to the list of runnable action.
54
- *
55
- * @param schema The instance of the action
56
- * @returns The same instance of the action.
57
- */
58
- addAction(instance: Action): Action;
59
- }
@@ -1,106 +0,0 @@
1
- import { Condition } from './Condition.js';
2
- import { Action } from './Action.js';
3
- export const Kind = 'Core#RunnableAction';
4
- export class RunnableAction {
5
- kind = Kind;
6
- /**
7
- * The condition to be checked when executing the runnable,
8
- */
9
- condition = new Condition();
10
- /**
11
- * The list of actions to execute.
12
- */
13
- actions = [];
14
- /**
15
- * Whether the entire runnable is enabled. This is checked before the condition is executed.
16
- */
17
- enabled;
18
- static fromLegacy(runnable) {
19
- const result = new RunnableAction();
20
- result.fromLegacy(runnable);
21
- return result;
22
- }
23
- constructor(input) {
24
- let init;
25
- if (typeof input === 'string') {
26
- init = JSON.parse(input);
27
- }
28
- else if (typeof input === 'object') {
29
- init = input;
30
- }
31
- else {
32
- init = {
33
- kind: Kind,
34
- condition: new Condition().toJSON(),
35
- actions: [],
36
- enabled: true,
37
- };
38
- }
39
- if (init.kind === Kind) {
40
- this.new(init);
41
- }
42
- else {
43
- this.fromLegacy(init);
44
- }
45
- }
46
- new(init) {
47
- const { enabled, condition, actions } = init;
48
- this.enabled = enabled;
49
- if (condition) {
50
- this.condition = new Condition(condition);
51
- }
52
- else {
53
- this.condition = new Condition();
54
- }
55
- if (Array.isArray(actions)) {
56
- this.actions = actions.map(i => new Action(i));
57
- }
58
- else {
59
- this.actions = [];
60
- }
61
- }
62
- toJSON() {
63
- const result = {
64
- condition: this.condition.toJSON(),
65
- actions: this.actions.map(i => i.toJSON()),
66
- kind: Kind,
67
- };
68
- if (typeof this.enabled === 'boolean') {
69
- result.enabled = this.enabled;
70
- }
71
- return result;
72
- }
73
- fromLegacy(runnable) {
74
- const { actions, condition, enabled } = runnable;
75
- if (typeof enabled === 'boolean') {
76
- this.enabled = enabled;
77
- }
78
- if (condition) {
79
- this.condition = Condition.fromLegacy(condition);
80
- }
81
- else {
82
- this.condition = new Condition();
83
- }
84
- if (Array.isArray(actions) && actions.length) {
85
- this.actions = actions.map(i => Action.fromLegacy(i));
86
- }
87
- else {
88
- this.actions = [];
89
- }
90
- }
91
- addAction(value) {
92
- if (!Array.isArray(this.actions)) {
93
- this.actions = [];
94
- }
95
- let finalAction;
96
- if (value instanceof Action) {
97
- finalAction = value;
98
- }
99
- else {
100
- finalAction = new Action(value);
101
- }
102
- this.actions.push(finalAction);
103
- return finalAction;
104
- }
105
- }
106
- //# sourceMappingURL=RunnableAction.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"RunnableAction.js","sourceRoot":"","sources":["../../../../src/models/actions/RunnableAction.ts"],"names":[],"mappings":"AAAA,OAAO,EAAc,SAAS,EAAE,MAAM,gBAAgB,CAAC;AACvD,OAAO,EAAW,MAAM,EAAE,MAAM,aAAa,CAAC;AAG9C,MAAM,CAAC,MAAM,IAAI,GAAG,qBAAqB,CAAC;AAwB1C,MAAM,OAAO,cAAc;IACzB,IAAI,GAAG,IAAI,CAAC;IACZ;;OAEG;IACH,SAAS,GAAc,IAAI,SAAS,EAAE,CAAC;IACvC;;OAEG;IACH,OAAO,GAAa,EAAE,CAAC;IACvB;;OAEG;IACH,OAAO,CAAW;IAElB,MAAM,CAAC,UAAU,CAAC,QAAwB;QACxC,MAAM,MAAM,GAAG,IAAI,cAAc,EAAE,CAAC;QACpC,MAAM,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC;QAC5B,OAAO,MAAM,CAAC;IAChB,CAAC;IAED,YAAY,KAAgC;QAC1C,IAAI,IAAqB,CAAC;QAC1B,IAAI,OAAO,KAAK,KAAK,QAAQ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@@ -1,44 +0,0 @@
1
- import { DeleteCookieConfig } from '../../legacy/actions/Actions.js';
2
- import { Runnable, IRunnable } from './Runnable.js';
3
- export declare const Kind = "Core#DeleteCookieAction";
4
- export interface IDeleteCookieAction extends IRunnable {
5
- kind?: typeof Kind;
6
- /**
7
- * When set it uses request URL instead of defined URL in the action.
8
- */
9
- useRequestUrl?: boolean;
10
- /**
11
- * An URL associated with the cookie.
12
- * Only used when `useRequestUrl` is not `true`.
13
- * Either `url` or `useRequestUrl` must be set for the action to be considered valid.
14
- */
15
- url?: string;
16
- /**
17
- * Name of the cookie to remove.
18
- * When not set it removes all cookies.
19
- */
20
- name?: string;
21
- }
22
- export declare class DeleteCookieAction extends Runnable {
23
- kind: string;
24
- /**
25
- * When set it uses request URL instead of defined URL in the action.
26
- */
27
- useRequestUrl?: boolean;
28
- /**
29
- * An URL associated with the cookie.
30
- * Only used when `useRequestUrl` is not `true`.
31
- * Either `url` or `useRequestUrl` must be set for the action to be considered valid.
32
- */
33
- url?: string;
34
- /**
35
- * Name of the cookie to remove.
36
- * When not set it removes all cookies.
37
- */
38
- name?: string;
39
- isValid(): boolean;
40
- static fromLegacy(legacy: DeleteCookieConfig): DeleteCookieAction;
41
- constructor(input?: string | IDeleteCookieAction);
42
- new(init: IDeleteCookieAction): void;
43
- toJSON(): IDeleteCookieAction;
44
- }
@@ -1,92 +0,0 @@
1
- import { Runnable } from './Runnable.js';
2
- export const Kind = 'Core#DeleteCookieAction';
3
- export class DeleteCookieAction extends Runnable {
4
- kind = Kind;
5
- /**
6
- * When set it uses request URL instead of defined URL in the action.
7
- */
8
- useRequestUrl;
9
- /**
10
- * An URL associated with the cookie.
11
- * Only used when `useRequestUrl` is not `true`.
12
- * Either `url` or `useRequestUrl` must be set for the action to be considered valid.
13
- */
14
- url;
15
- /**
16
- * Name of the cookie to remove.
17
- * When not set it removes all cookies.
18
- */
19
- name;
20
- isValid() {
21
- return !!this.useRequestUrl || !!this.url;
22
- }
23
- static fromLegacy(legacy) {
24
- const init = {
25
- kind: Kind,
26
- name: legacy.name,
27
- };
28
- if (legacy.url) {
29
- init.url = legacy.url;
30
- }
31
- if (typeof legacy.useRequestUrl === 'boolean') {
32
- init.useRequestUrl = legacy.useRequestUrl;
33
- }
34
- if (legacy.removeAll) {
35
- delete init.name;
36
- }
37
- return new DeleteCookieAction(init);
38
- }
39
- constructor(input) {
40
- super();
41
- let init;
42
- if (typeof input === 'string') {
43
- init = JSON.parse(input);
44
- }
45
- else if (typeof input === 'object') {
46
- init = input;
47
- }
48
- else {
49
- init = {
50
- kind: Kind,
51
- };
52
- }
53
- this.new(init);
54
- }
55
- new(init) {
56
- const { useRequestUrl, url, name } = init;
57
- if (typeof useRequestUrl === 'boolean') {
58
- this.useRequestUrl = useRequestUrl;
59
- }
60
- else {
61
- this.useRequestUrl = undefined;
62
- }
63
- if (url) {
64
- this.url = url;
65
- }
66
- else {
67
- this.url = undefined;
68
- }
69
- if (name) {
70
- this.name = name;
71
- }
72
- else {
73
- this.name = undefined;
74
- }
75
- }
76
- toJSON() {
77
- const result = {
78
- kind: Kind,
79
- };
80
- if (this.url) {
81
- result.url = this.url;
82
- }
83
- if (this.name) {
84
- result.name = this.name;
85
- }
86
- if (typeof this.useRequestUrl === 'boolean') {
87
- result.useRequestUrl = this.useRequestUrl;
88
- }
89
- return result;
90
- }
91
- }
92
- //# sourceMappingURL=DeleteCookieAction.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"DeleteCookieAction.js","sourceRoot":"","sources":["../../../../../src/models/actions/runnable/DeleteCookieAction.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAa,MAAM,eAAe,CAAC;AAEpD,MAAM,CAAC,MAAM,IAAI,GAAG,yBAAyB,CAAC;AAqB9C,MAAM,OAAO,kBAAmB,SAAQ,QAAQ;IAC9C,IAAI,GAAG,IAAI,CAAC;IACZ;;OAEG;IACH,aAAa,CAAW;IACxB;;;;OAIG;IACH,GAAG,CAAU;IACb;;;OAGG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D,IAAI,GAAG,EAAE;YACP,IAAI,CAAC,GAAG,GAAG,GAAG,CAAC;SAChB;aAAM;YACL,IAAI,CAAC,GAAG,GAAG,SAAS,CAAC;SACtB;QACD,IAAI,IAAI,EAAE;YACR,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;SAClB;aAAM;YACL,IAAI,CAAC,IAAI,GAAG,SAAS,CAAC;SACvB;IACH,CAAC;IAED,MAAM;QACJ,MAAM,MAAM,GAAwB;YAClC,IAAI,EAAE,IAAI;SACX,CAAC;QACF,IAAI,IAAI,CAAC,GAAG,EAAE;YACZ,MAAM,CAAC,GAAG,GAAG,IAAI,CAAC,GAAG,CAAC;SACvB;QACD,IAAI,IAAI,CAAC,IAAI,EAAE;YACb,MAAM,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC;SACzB;QACD,IAAI,OAAO,IAAI,CAAC,aAAa,KAAK,SAAS,EAAE;YAC3C,MAAM,CAAC,aAAa,GAAG,IAAI,CAAC,aAAa,CAAC;SAC3C;QACD,OAAO,MAAM,CAAC;IAChB,CAAC;CACF"}
@@ -1,8 +0,0 @@
1
- export interface IRunnable {
2
- kind?: unknown;
3
- }
4
- export declare abstract class Runnable {
5
- kind: unknown;
6
- abstract isValid(): boolean;
7
- abstract toJSON(): unknown;
8
- }
@@ -1,4 +0,0 @@
1
- export class Runnable {
2
- kind;
3
- }
4
- //# sourceMappingURL=Runnable.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Runnable.js","sourceRoot":"","sources":["../../../../../src/models/actions/runnable/Runnable.ts"],"names":[],"mappings":"AAIA,MAAM,OAAgB,QAAQ;IAC5B,IAAI,CAAU;CAGf"}