@magic-xpa/engine 4.1100.0-dev4110.23 → 4.1100.0-dev4110.236

Sign up to get free protection for your applications and to get access to all the features.
Files changed (516) hide show
  1. package/{esm2020 → esm2022}/index.mjs +188 -188
  2. package/{esm2020 → esm2022}/magic-xpa-engine.mjs +1 -1
  3. package/esm2022/src/AccessHelper.mjs +15 -0
  4. package/esm2022/src/ClientManager.mjs +416 -0
  5. package/esm2022/src/CommandsProcessorBase.mjs +56 -0
  6. package/esm2022/src/CommandsProcessorManager.mjs +26 -0
  7. package/esm2022/src/CommandsTable.mjs +162 -0
  8. package/esm2022/src/ConstInterface.mjs +517 -0
  9. package/{esm2020 → esm2022}/src/CurrentClientVersion.mjs +2 -2
  10. package/esm2022/src/FlowMonitorInterface.mjs +16 -0
  11. package/esm2022/src/GUIManager.mjs +62 -0
  12. package/esm2022/src/GlobalCommandsManager.mjs +34 -0
  13. package/esm2022/src/GuiEventsProcessor.mjs +156 -0
  14. package/{esm2020 → esm2022}/src/ICommandsTable.mjs +1 -1
  15. package/esm2022/src/ServerConfig.mjs +122 -0
  16. package/{esm2020 → esm2022}/src/bridge/IGuiEvent.mjs +19 -19
  17. package/esm2022/src/bridge/MagicBridge.mjs +41 -0
  18. package/esm2022/src/commands/ClientOriginatedCommandTaskTag.mjs +12 -0
  19. package/{esm2020 → esm2022}/src/commands/ClientToServer/AddUserLocateDataViewCommand.mjs +8 -8
  20. package/{esm2020 → esm2022}/src/commands/ClientToServer/AddUserRangeDataviewCommand.mjs +9 -9
  21. package/{esm2020 → esm2022}/src/commands/ClientToServer/AddUserSortDataViewCommand.mjs +9 -9
  22. package/{esm2020 → esm2022}/src/commands/ClientToServer/BrowserEscEventCommand.mjs +23 -23
  23. package/{esm2020 → esm2022}/src/commands/ClientToServer/ClientOriginatedCommand.mjs +14 -14
  24. package/esm2022/src/commands/ClientToServer/ClientOriginatedCommandSerializer.mjs +60 -0
  25. package/{esm2020 → esm2022}/src/commands/ClientToServer/ColumnSortEventCommand.mjs +26 -26
  26. package/esm2022/src/commands/ClientToServer/CommandFactory.mjs +260 -0
  27. package/esm2022/src/commands/ClientToServer/CommandSerializationHelper.mjs +67 -0
  28. package/{esm2020 → esm2022}/src/commands/ClientToServer/ComputeEventCommand.mjs +23 -23
  29. package/{esm2020 → esm2022}/src/commands/ClientToServer/ContextTerminationEventCommand.mjs +20 -20
  30. package/{esm2020 → esm2022}/src/commands/ClientToServer/ContextTimeoutResetCommand.mjs +19 -19
  31. package/{esm2020 → esm2022}/src/commands/ClientToServer/ControlItemsRefreshCommand.mjs +8 -8
  32. package/esm2022/src/commands/ClientToServer/DataViewOutputCommand.mjs +13 -0
  33. package/{esm2020 → esm2022}/src/commands/ClientToServer/DataviewCommand.mjs +44 -44
  34. package/esm2022/src/commands/ClientToServer/EvaluateCommand.mjs +37 -0
  35. package/esm2022/src/commands/ClientToServer/EventCommand.mjs +40 -0
  36. package/esm2022/src/commands/ClientToServer/ExecOperCommand.mjs +67 -0
  37. package/esm2022/src/commands/ClientToServer/FetchDataControlValuesEventCommand.mjs +22 -0
  38. package/{esm2020 → esm2022}/src/commands/ClientToServer/GlobalParamsQueryCommand.mjs +10 -10
  39. package/{esm2020 → esm2022}/src/commands/ClientToServer/ICommandTaskTag.mjs +1 -1
  40. package/{esm2020 → esm2022}/src/commands/ClientToServer/IndexChangeEventCommand.mjs +21 -21
  41. package/esm2022/src/commands/ClientToServer/IniputForceWriteCommand.mjs +23 -0
  42. package/{esm2020 → esm2022}/src/commands/ClientToServer/NonReversibleExitEventCommand.mjs +23 -23
  43. package/{esm2020 → esm2022}/src/commands/ClientToServer/QueryCommand.mjs +20 -20
  44. package/esm2022/src/commands/ClientToServer/RecomputeCommand.mjs +27 -0
  45. package/esm2022/src/commands/ClientToServer/RefreshEventCommand.mjs +27 -0
  46. package/esm2022/src/commands/ClientToServer/RefreshScreenEventCommand.mjs +24 -0
  47. package/esm2022/src/commands/ClientToServer/RollbackEventCommand.mjs +40 -0
  48. package/{esm2020 → esm2022}/src/commands/ClientToServer/SelectProgramCommand.mjs +14 -14
  49. package/{esm2020 → esm2022}/src/commands/ClientToServer/SetTransactionStateDataviewCommand.mjs +9 -9
  50. package/{esm2020 → esm2022}/src/commands/ClientToServer/SubformOpenEventCommand.mjs +21 -21
  51. package/esm2022/src/commands/ClientToServer/SubformRefreshEventCommand.mjs +24 -0
  52. package/esm2022/src/commands/ClientToServer/TransactionCommand.mjs +30 -0
  53. package/{esm2020 → esm2022}/src/commands/ClientToServer/UnloadCommand.mjs +14 -14
  54. package/esm2022/src/commands/ClientToServer/WriteMessageToServerLogCommand.mjs +18 -0
  55. package/esm2022/src/commands/DataViewCommandBase.mjs +8 -0
  56. package/{esm2020 → esm2022}/src/commands/IClientCommand.mjs +1 -1
  57. package/esm2022/src/commands/IClientTargetedCommand.mjs +13 -0
  58. package/{esm2020 → esm2022}/src/commands/IClientToServerCommandInfo.mjs +1 -1
  59. package/esm2022/src/commands/ServerToClient/AbortCommand.mjs +65 -0
  60. package/{esm2020 → esm2022}/src/commands/ServerToClient/AddLocateCommand.mjs +21 -21
  61. package/esm2022/src/commands/ServerToClient/AddRangeCommand.mjs +62 -0
  62. package/esm2022/src/commands/ServerToClient/AddSortCommand.mjs +33 -0
  63. package/esm2022/src/commands/ServerToClient/ClientRefreshCommand.mjs +25 -0
  64. package/esm2022/src/commands/ServerToClient/ClientTargetedCommandBase.mjs +24 -0
  65. package/esm2022/src/commands/ServerToClient/EnhancedVerifyCommand.mjs +45 -0
  66. package/esm2022/src/commands/ServerToClient/OpenURLCommand.mjs +221 -0
  67. package/{esm2020 → esm2022}/src/commands/ServerToClient/ResetLocateCommand.mjs +14 -14
  68. package/{esm2020 → esm2022}/src/commands/ServerToClient/ResetRangeCommand.mjs +14 -14
  69. package/{esm2020 → esm2022}/src/commands/ServerToClient/ResetSortCommand.mjs +14 -14
  70. package/esm2022/src/commands/ServerToClient/ResultCommand.mjs +37 -0
  71. package/esm2022/src/commands/ServerToClient/VerifyCommand.mjs +83 -0
  72. package/esm2022/src/commands/ServerToClient/XMLBasedCommandBuilder.mjs +132 -0
  73. package/{esm2020 → esm2022}/src/communications/IConnectionStateManager.mjs +1 -1
  74. package/esm2022/src/communications/InteractiveCommunicationsFailureHandler.mjs +15 -0
  75. package/{esm2020 → esm2022}/src/data/DataSourceIdKey.mjs +2 -2
  76. package/esm2022/src/data/DataView.mjs +1613 -0
  77. package/{esm2020 → esm2022}/src/data/DataViewBase.mjs +3 -3
  78. package/esm2022/src/data/DataviewManager.mjs +28 -0
  79. package/esm2022/src/data/DataviewManagerBase.mjs +15 -0
  80. package/esm2022/src/data/DvCache.mjs +67 -0
  81. package/esm2022/src/data/Field.mjs +646 -0
  82. package/esm2022/src/data/FieldBase.mjs +15 -0
  83. package/esm2022/src/data/FieldsTable.mjs +103 -0
  84. package/{esm2020 → esm2022}/src/data/IRecordsTable.mjs +1 -1
  85. package/esm2022/src/data/Key.mjs +88 -0
  86. package/esm2022/src/data/Record.mjs +866 -0
  87. package/{esm2020 → esm2022}/src/data/RecordOutOfDataViewException.mjs +15 -15
  88. package/esm2022/src/data/RecordsTable.mjs +267 -0
  89. package/esm2022/src/data/TaskTransactionManager.mjs +103 -0
  90. package/esm2022/src/data/XMLBasedDcValuesBuilder.mjs +74 -0
  91. package/{esm2020 → esm2022}/src/enums.mjs +23 -23
  92. package/esm2022/src/env/EnvVariablesTable.mjs +340 -0
  93. package/esm2022/src/env/Environment.mjs +487 -0
  94. package/{esm2020 → esm2022}/src/env/ILanguageData.mjs +1 -1
  95. package/esm2022/src/env/LanguageData.mjs +227 -0
  96. package/esm2022/src/env/MirrorString.mjs +65 -0
  97. package/esm2022/src/event/ActionManager.mjs +91 -0
  98. package/esm2022/src/event/Event.mjs +1333 -0
  99. package/esm2022/src/event/EventHandler.mjs +766 -0
  100. package/esm2022/src/event/EventHandlerPosition.mjs +204 -0
  101. package/esm2022/src/event/EventsManager.mjs +2988 -0
  102. package/{esm2020 → esm2022}/src/event/IEventsManager.mjs +6 -6
  103. package/esm2022/src/event/RunTimeEvent.mjs +399 -0
  104. package/{esm2020 → esm2022}/src/event/RunTimeEventBase.mjs +3 -3
  105. package/esm2022/src/event/UserEventsTable.mjs +47 -0
  106. package/esm2022/src/exp/ExpTable.mjs +57 -0
  107. package/esm2022/src/exp/Expression.mjs +200 -0
  108. package/esm2022/src/exp/ExpressionDict.mjs +727 -0
  109. package/esm2022/src/exp/ExpressionEvaluator.mjs +4206 -0
  110. package/esm2022/src/exp/ExpressionLocalJpn.mjs +314 -0
  111. package/esm2022/src/exp/GlobalParamsTable.mjs +85 -0
  112. package/esm2022/src/exp/YesNoExp.mjs +36 -0
  113. package/esm2022/src/gui/CreatedFormVector.mjs +23 -0
  114. package/esm2022/src/gui/FormsTable.mjs +66 -0
  115. package/esm2022/src/gui/MgControl.mjs +363 -0
  116. package/esm2022/src/gui/MgForm.mjs +1224 -0
  117. package/esm2022/src/http/HttpManager.mjs +97 -0
  118. package/esm2022/src/http/client/HttpClientAsync.mjs +68 -0
  119. package/esm2022/src/http/client/HttpClientBase.mjs +132 -0
  120. package/esm2022/src/http/client/HttpClientEvents.mjs +39 -0
  121. package/esm2022/src/http/client/HttpClientSync.mjs +42 -0
  122. package/esm2022/src/http/client/HttpUtility.mjs +84 -0
  123. package/{esm2020 → esm2022}/src/http/client/ICommunicationsFailureHandler.mjs +1 -1
  124. package/esm2022/src/remote/AddUserLocateRemoteDataViewCommand.mjs +18 -0
  125. package/esm2022/src/remote/AddUserRangeRemoteDataViewCommand.mjs +18 -0
  126. package/esm2022/src/remote/AddUserSortRemoteDataViewCommand.mjs +18 -0
  127. package/esm2022/src/remote/RemoteCommandsProcessor.mjs +880 -0
  128. package/esm2022/src/remote/RemoteControlItemsRefreshCommand.mjs +25 -0
  129. package/esm2022/src/remote/RemoteDataViewCommandBase.mjs +24 -0
  130. package/esm2022/src/remote/RemoteDataViewCommandFactory.mjs +61 -0
  131. package/{esm2020 → esm2022}/src/remote/RemoteDataViewCommandUpdateNonModifiable.mjs +15 -15
  132. package/{esm2020 → esm2022}/src/remote/RemoteDataviewManager.mjs +17 -17
  133. package/{esm2020 → esm2022}/src/remote/RemoteInitDataViewCommand.mjs +10 -10
  134. package/esm2022/src/remote/ResetUserLocateRemoteDataviewCommand.mjs +17 -0
  135. package/{esm2020 → esm2022}/src/remote/ResetUserRangeRemoteDataviewCommand.mjs +12 -12
  136. package/esm2022/src/remote/ResetUserSortRemoteDataviewCommand.mjs +16 -0
  137. package/esm2022/src/remote/ServerError.mjs +40 -0
  138. package/esm2022/src/remote/SetTransactionStateRemoteDataViewCommand.mjs +20 -0
  139. package/esm2022/src/rt/Argument.mjs +265 -0
  140. package/esm2022/src/rt/ArgumentsList.mjs +103 -0
  141. package/esm2022/src/rt/Boundary.mjs +152 -0
  142. package/esm2022/src/rt/CompMainPrgTable.mjs +63 -0
  143. package/{esm2020 → esm2022}/src/rt/DataviewHeaderBase.mjs +98 -96
  144. package/{esm2020 → esm2022}/src/rt/DataviewHeaderFactory.mjs +6 -6
  145. package/esm2022/src/rt/DataviewHeaders.mjs +53 -0
  146. package/esm2022/src/rt/DataviewHeadersSaxHandler.mjs +38 -0
  147. package/esm2022/src/rt/ExecutionStack.mjs +94 -0
  148. package/{esm2020 → esm2022}/src/rt/ExecutionStackEntry.mjs +17 -17
  149. package/esm2022/src/rt/HandlersTable.mjs +96 -0
  150. package/{esm2020 → esm2022}/src/rt/IDataSourceViewDefinition.mjs +1 -1
  151. package/{esm2020 → esm2022}/src/rt/IDataviewHeader.mjs +1 -1
  152. package/{esm2020 → esm2022}/src/rt/IResultValue.mjs +1 -1
  153. package/esm2022/src/rt/LastFocusedManager.mjs +65 -0
  154. package/esm2022/src/rt/Operation.mjs +735 -0
  155. package/esm2022/src/rt/OperationTable.mjs +67 -0
  156. package/esm2022/src/rt/Recompute.mjs +355 -0
  157. package/esm2022/src/rt/RecomputeTable.mjs +63 -0
  158. package/esm2022/src/rt/RemoteDataviewHeader.mjs +108 -0
  159. package/esm2022/src/rt/ResultValue.mjs +10 -0
  160. package/esm2022/src/rt/TableCache.mjs +177 -0
  161. package/esm2022/src/rt/TableCacheManager.mjs +67 -0
  162. package/esm2022/src/rt/Transaction.mjs +53 -0
  163. package/esm2022/src/security/UserDetails.mjs +71 -0
  164. package/{esm2020 → esm2022}/src/tasks/IMGDataCollection.mjs +1 -1
  165. package/esm2022/src/tasks/MGData.mjs +552 -0
  166. package/esm2022/src/tasks/MGDataCollection.mjs +252 -0
  167. package/esm2022/src/tasks/RCTimer.mjs +63 -0
  168. package/esm2022/src/tasks/RemoteTaskService.mjs +45 -0
  169. package/esm2022/src/tasks/Task.mjs +2499 -0
  170. package/esm2022/src/tasks/TaskBase.mjs +83 -0
  171. package/esm2022/src/tasks/TaskServiceBase.mjs +25 -0
  172. package/esm2022/src/tasks/TasksTable.mjs +80 -0
  173. package/esm2022/src/tasks/sort/Sort.mjs +5 -0
  174. package/esm2022/src/tasks/sort/SortCollection.mjs +67 -0
  175. package/esm2022/src/util/ConstUtils.mjs +14 -0
  176. package/esm2022/src/util/FlowMonitorQueue.mjs +451 -0
  177. package/esm2022/src/util/HeapSort.mjs +70 -0
  178. package/{esm2020 → esm2022}/src/util/IMirrorXML.mjs +1 -1
  179. package/{esm2020 → esm2022}/src/util/IServerConfig.mjs +1 -1
  180. package/{esm2020 → esm2022}/src/util/MgBlockingQueue.mjs +1 -1
  181. package/esm2022/src/util/MgPriorityBlockingQueue.mjs +74 -0
  182. package/esm2022/src/util/MgPriorityQueue.mjs +66 -0
  183. package/{esm2020 → esm2022}/src/util/ParamParseResult.mjs +7 -7
  184. package/esm2022/src/util/PrmMap.mjs +152 -0
  185. package/esm2022/src/util/ReturnResult.mjs +46 -0
  186. package/esm2022/src/util/ReturnResultBase.mjs +18 -0
  187. package/esm2022/src/util/Scrambler.mjs +89 -0
  188. package/esm2022/src/util/UniqueIDUtils.mjs +13 -0
  189. package/esm2022/src/util/cookie.service.mjs +92 -0
  190. package/{fesm2020 → fesm2022}/magic-xpa-engine.mjs +29797 -29693
  191. package/fesm2022/magic-xpa-engine.mjs.map +1 -0
  192. package/index.d.ts +187 -187
  193. package/package.json +8 -14
  194. package/src/AccessHelper.d.ts +20 -20
  195. package/src/ClientManager.d.ts +35 -32
  196. package/src/CommandsProcessorBase.d.ts +23 -23
  197. package/src/CommandsProcessorManager.d.ts +6 -6
  198. package/src/CommandsTable.d.ts +22 -22
  199. package/src/ConstInterface.d.ts +516 -515
  200. package/src/CurrentClientVersion.d.ts +1 -1
  201. package/src/FlowMonitorInterface.d.ts +15 -15
  202. package/src/GUIManager.d.ts +17 -17
  203. package/src/GlobalCommandsManager.d.ts +17 -17
  204. package/src/GuiEventsProcessor.d.ts +24 -24
  205. package/src/ICommandsTable.d.ts +9 -9
  206. package/src/ServerConfig.d.ts +35 -34
  207. package/src/bridge/IGuiEvent.d.ts +19 -19
  208. package/src/bridge/MagicBridge.d.ts +16 -16
  209. package/src/commands/ClientOriginatedCommandTaskTag.d.ts +8 -8
  210. package/src/commands/ClientToServer/AddUserLocateDataViewCommand.d.ts +4 -4
  211. package/src/commands/ClientToServer/AddUserRangeDataviewCommand.d.ts +6 -6
  212. package/src/commands/ClientToServer/AddUserSortDataViewCommand.d.ts +6 -6
  213. package/src/commands/ClientToServer/BrowserEscEventCommand.d.ts +8 -8
  214. package/src/commands/ClientToServer/ClientOriginatedCommand.d.ts +8 -8
  215. package/src/commands/ClientToServer/ClientOriginatedCommandSerializer.d.ts +6 -6
  216. package/src/commands/ClientToServer/ColumnSortEventCommand.d.ts +10 -10
  217. package/src/commands/ClientToServer/CommandFactory.d.ts +64 -64
  218. package/src/commands/ClientToServer/CommandSerializationHelper.d.ts +20 -20
  219. package/src/commands/ClientToServer/ComputeEventCommand.d.ts +8 -8
  220. package/src/commands/ClientToServer/ContextTerminationEventCommand.d.ts +7 -7
  221. package/src/commands/ClientToServer/ContextTimeoutResetCommand.d.ts +7 -7
  222. package/src/commands/ClientToServer/ControlItemsRefreshCommand.d.ts +6 -6
  223. package/src/commands/ClientToServer/DataViewOutputCommand.d.ts +9 -9
  224. package/src/commands/ClientToServer/DataviewCommand.d.ts +32 -32
  225. package/src/commands/ClientToServer/EvaluateCommand.d.ts +15 -15
  226. package/src/commands/ClientToServer/EventCommand.d.ts +15 -15
  227. package/src/commands/ClientToServer/ExecOperCommand.d.ts +23 -23
  228. package/src/commands/ClientToServer/FetchDataControlValuesEventCommand.d.ts +8 -8
  229. package/src/commands/ClientToServer/GlobalParamsQueryCommand.d.ts +5 -5
  230. package/src/commands/ClientToServer/ICommandTaskTag.d.ts +3 -3
  231. package/src/commands/ClientToServer/IndexChangeEventCommand.d.ts +8 -8
  232. package/src/commands/ClientToServer/IniputForceWriteCommand.d.ts +10 -10
  233. package/src/commands/ClientToServer/NonReversibleExitEventCommand.d.ts +8 -8
  234. package/src/commands/ClientToServer/QueryCommand.d.ts +8 -8
  235. package/src/commands/ClientToServer/RecomputeCommand.d.ts +11 -11
  236. package/src/commands/ClientToServer/RefreshEventCommand.d.ts +12 -12
  237. package/src/commands/ClientToServer/RefreshScreenEventCommand.d.ts +10 -10
  238. package/src/commands/ClientToServer/RollbackEventCommand.d.ts +14 -14
  239. package/src/commands/ClientToServer/SelectProgramCommand.d.ts +6 -6
  240. package/src/commands/ClientToServer/SetTransactionStateDataviewCommand.d.ts +5 -5
  241. package/src/commands/ClientToServer/SubformOpenEventCommand.d.ts +8 -8
  242. package/src/commands/ClientToServer/SubformRefreshEventCommand.d.ts +9 -9
  243. package/src/commands/ClientToServer/TransactionCommand.d.ts +12 -12
  244. package/src/commands/ClientToServer/UnloadCommand.d.ts +7 -7
  245. package/src/commands/ClientToServer/WriteMessageToServerLogCommand.d.ts +6 -6
  246. package/src/commands/DataViewCommandBase.d.ts +6 -6
  247. package/src/commands/IClientCommand.d.ts +2 -2
  248. package/src/commands/IClientTargetedCommand.d.ts +12 -12
  249. package/src/commands/IClientToServerCommandInfo.d.ts +3 -3
  250. package/src/commands/ServerToClient/AbortCommand.d.ts +11 -11
  251. package/src/commands/ServerToClient/AddLocateCommand.d.ts +6 -6
  252. package/src/commands/ServerToClient/AddRangeCommand.d.ts +10 -10
  253. package/src/commands/ServerToClient/AddSortCommand.d.ts +9 -9
  254. package/src/commands/ServerToClient/ClientRefreshCommand.d.ts +7 -7
  255. package/src/commands/ServerToClient/ClientTargetedCommandBase.d.ts +12 -12
  256. package/src/commands/ServerToClient/EnhancedVerifyCommand.d.ts +13 -13
  257. package/src/commands/ServerToClient/OpenURLCommand.d.ts +21 -21
  258. package/src/commands/ServerToClient/ResetLocateCommand.d.ts +6 -6
  259. package/src/commands/ServerToClient/ResetRangeCommand.d.ts +6 -6
  260. package/src/commands/ServerToClient/ResetSortCommand.d.ts +6 -6
  261. package/src/commands/ServerToClient/ResultCommand.d.ts +10 -10
  262. package/src/commands/ServerToClient/VerifyCommand.d.ts +17 -17
  263. package/src/commands/ServerToClient/XMLBasedCommandBuilder.d.ts +11 -11
  264. package/src/communications/IConnectionStateManager.d.ts +4 -4
  265. package/src/communications/InteractiveCommunicationsFailureHandler.d.ts +6 -6
  266. package/src/data/DataSourceIdKey.d.ts +2 -2
  267. package/src/data/DataView.d.ts +162 -162
  268. package/src/data/DataViewBase.d.ts +12 -12
  269. package/src/data/DataviewManager.d.ts +14 -14
  270. package/src/data/DataviewManagerBase.d.ts +11 -11
  271. package/src/data/DvCache.d.ts +15 -15
  272. package/src/data/Field.d.ts +103 -103
  273. package/src/data/FieldBase.d.ts +23 -23
  274. package/src/data/FieldsTable.d.ts +27 -27
  275. package/src/data/IRecordsTable.d.ts +7 -7
  276. package/src/data/Key.d.ts +15 -15
  277. package/src/data/Record.d.ts +156 -156
  278. package/src/data/RecordOutOfDataViewException.d.ts +10 -10
  279. package/src/data/RecordsTable.d.ts +38 -38
  280. package/src/data/TaskTransactionManager.d.ts +17 -17
  281. package/src/data/XMLBasedDcValuesBuilder.d.ts +11 -11
  282. package/src/enums.d.ts +21 -21
  283. package/src/env/EnvVariablesTable.d.ts +17 -17
  284. package/src/env/Environment.d.ts +118 -118
  285. package/src/env/ILanguageData.d.ts +3 -3
  286. package/src/env/LanguageData.d.ts +20 -20
  287. package/src/env/MirrorString.d.ts +15 -15
  288. package/src/event/ActionManager.d.ts +14 -14
  289. package/src/event/Event.d.ts +79 -79
  290. package/src/event/EventHandler.d.ts +66 -66
  291. package/src/event/EventHandlerPosition.d.ts +25 -25
  292. package/src/event/EventsManager.d.ts +205 -204
  293. package/src/event/IEventsManager.d.ts +77 -77
  294. package/src/event/RunTimeEvent.d.ts +126 -123
  295. package/src/event/RunTimeEventBase.d.ts +5 -5
  296. package/src/event/UserEventsTable.d.ts +11 -11
  297. package/src/exp/ExpTable.d.ts +11 -11
  298. package/src/exp/Expression.d.ts +37 -37
  299. package/src/exp/ExpressionDict.d.ts +12 -12
  300. package/src/exp/ExpressionEvaluator.d.ts +198 -198
  301. package/src/exp/ExpressionLocalJpn.d.ts +18 -18
  302. package/src/exp/GlobalParamsTable.d.ts +19 -19
  303. package/src/exp/YesNoExp.d.ts +9 -9
  304. package/src/gui/CreatedFormVector.d.ts +10 -10
  305. package/src/gui/FormsTable.d.ts +15 -15
  306. package/src/gui/MgControl.d.ts +60 -60
  307. package/src/gui/MgForm.d.ts +96 -93
  308. package/src/http/HttpManager.d.ts +25 -25
  309. package/src/http/client/HttpClientAsync.d.ts +16 -16
  310. package/src/http/client/HttpClientBase.d.ts +30 -30
  311. package/src/http/client/HttpClientEvents.d.ts +18 -18
  312. package/src/http/client/HttpClientSync.d.ts +17 -17
  313. package/src/http/client/HttpUtility.d.ts +10 -10
  314. package/src/http/client/ICommunicationsFailureHandler.d.ts +5 -5
  315. package/src/remote/AddUserLocateRemoteDataViewCommand.d.ts +8 -8
  316. package/src/remote/AddUserRangeRemoteDataViewCommand.d.ts +8 -8
  317. package/src/remote/AddUserSortRemoteDataViewCommand.d.ts +8 -8
  318. package/src/remote/RemoteCommandsProcessor.d.ts +51 -51
  319. package/src/remote/RemoteControlItemsRefreshCommand.d.ts +8 -8
  320. package/src/remote/RemoteDataViewCommandBase.d.ts +10 -10
  321. package/src/remote/RemoteDataViewCommandFactory.d.ts +6 -6
  322. package/src/remote/RemoteDataViewCommandUpdateNonModifiable.d.ts +8 -8
  323. package/src/remote/RemoteDataviewManager.d.ts +9 -9
  324. package/src/remote/RemoteInitDataViewCommand.d.ts +7 -7
  325. package/src/remote/ResetUserLocateRemoteDataviewCommand.d.ts +7 -7
  326. package/src/remote/ResetUserRangeRemoteDataviewCommand.d.ts +7 -7
  327. package/src/remote/ResetUserSortRemoteDataviewCommand.d.ts +7 -7
  328. package/src/remote/ServerError.d.ts +16 -16
  329. package/src/remote/SetTransactionStateRemoteDataViewCommand.d.ts +8 -8
  330. package/src/rt/Argument.d.ts +36 -36
  331. package/src/rt/ArgumentsList.d.ts +24 -24
  332. package/src/rt/Boundary.d.ts +27 -27
  333. package/src/rt/CompMainPrgTable.d.ts +10 -10
  334. package/src/rt/DataviewHeaderBase.d.ts +34 -34
  335. package/src/rt/DataviewHeaderFactory.d.ts +5 -5
  336. package/src/rt/DataviewHeaders.d.ts +12 -12
  337. package/src/rt/DataviewHeadersSaxHandler.d.ts +10 -10
  338. package/src/rt/ExecutionStack.d.ts +22 -22
  339. package/src/rt/ExecutionStackEntry.d.ts +7 -7
  340. package/src/rt/HandlersTable.d.ts +19 -19
  341. package/src/rt/IDataSourceViewDefinition.d.ts +6 -6
  342. package/src/rt/IDataviewHeader.d.ts +10 -10
  343. package/src/rt/IResultValue.d.ts +4 -4
  344. package/src/rt/LastFocusedManager.d.ts +23 -23
  345. package/src/rt/Operation.d.ts +97 -97
  346. package/src/rt/OperationTable.d.ts +15 -15
  347. package/src/rt/Recompute.d.ts +41 -41
  348. package/src/rt/RecomputeTable.d.ts +9 -9
  349. package/src/rt/RemoteDataviewHeader.d.ts +14 -14
  350. package/src/rt/ResultValue.d.ts +7 -7
  351. package/src/rt/TableCache.d.ts +29 -29
  352. package/src/rt/TableCacheManager.d.ts +10 -10
  353. package/src/rt/Transaction.d.ts +23 -23
  354. package/src/security/UserDetails.d.ts +16 -16
  355. package/src/tasks/IMGDataCollection.d.ts +26 -26
  356. package/src/tasks/MGData.d.ts +63 -63
  357. package/src/tasks/MGDataCollection.d.ts +42 -42
  358. package/src/tasks/RCTimer.d.ts +13 -13
  359. package/src/tasks/RemoteTaskService.d.ts +16 -16
  360. package/src/tasks/Task.d.ts +312 -312
  361. package/src/tasks/TaskBase.d.ts +123 -123
  362. package/src/tasks/TaskServiceBase.d.ts +16 -16
  363. package/src/tasks/TasksTable.d.ts +21 -21
  364. package/src/tasks/sort/Sort.d.ts +4 -4
  365. package/src/tasks/sort/SortCollection.d.ts +11 -11
  366. package/src/util/ConstUtils.d.ts +3 -3
  367. package/src/util/FlowMonitorQueue.d.ts +70 -70
  368. package/src/util/HeapSort.d.ts +6 -6
  369. package/src/util/IMirrorXML.d.ts +6 -6
  370. package/src/util/IServerConfig.d.ts +11 -11
  371. package/src/util/MgBlockingQueue.d.ts +5 -5
  372. package/src/util/MgPriorityBlockingQueue.d.ts +17 -17
  373. package/src/util/MgPriorityQueue.d.ts +13 -13
  374. package/src/util/ParamParseResult.d.ts +6 -6
  375. package/src/util/PrmMap.d.ts +28 -28
  376. package/src/util/ReturnResult.d.ts +18 -18
  377. package/src/util/ReturnResultBase.d.ts +11 -11
  378. package/src/util/Scrambler.d.ts +10 -10
  379. package/src/util/UniqueIDUtils.d.ts +4 -4
  380. package/src/util/cookie.service.d.ts +8 -8
  381. package/esm2020/src/AccessHelper.mjs +0 -9
  382. package/esm2020/src/ClientManager.mjs +0 -399
  383. package/esm2020/src/CommandsProcessorBase.mjs +0 -58
  384. package/esm2020/src/CommandsProcessorManager.mjs +0 -26
  385. package/esm2020/src/CommandsTable.mjs +0 -162
  386. package/esm2020/src/ConstInterface.mjs +0 -516
  387. package/esm2020/src/FlowMonitorInterface.mjs +0 -16
  388. package/esm2020/src/GUIManager.mjs +0 -62
  389. package/esm2020/src/GlobalCommandsManager.mjs +0 -34
  390. package/esm2020/src/GuiEventsProcessor.mjs +0 -154
  391. package/esm2020/src/ServerConfig.mjs +0 -117
  392. package/esm2020/src/bridge/MagicBridge.mjs +0 -41
  393. package/esm2020/src/commands/ClientOriginatedCommandTaskTag.mjs +0 -11
  394. package/esm2020/src/commands/ClientToServer/ClientOriginatedCommandSerializer.mjs +0 -60
  395. package/esm2020/src/commands/ClientToServer/CommandFactory.mjs +0 -260
  396. package/esm2020/src/commands/ClientToServer/CommandSerializationHelper.mjs +0 -69
  397. package/esm2020/src/commands/ClientToServer/DataViewOutputCommand.mjs +0 -13
  398. package/esm2020/src/commands/ClientToServer/EvaluateCommand.mjs +0 -36
  399. package/esm2020/src/commands/ClientToServer/EventCommand.mjs +0 -40
  400. package/esm2020/src/commands/ClientToServer/ExecOperCommand.mjs +0 -67
  401. package/esm2020/src/commands/ClientToServer/FetchDataControlValuesEventCommand.mjs +0 -22
  402. package/esm2020/src/commands/ClientToServer/IniputForceWriteCommand.mjs +0 -23
  403. package/esm2020/src/commands/ClientToServer/RecomputeCommand.mjs +0 -27
  404. package/esm2020/src/commands/ClientToServer/RefreshEventCommand.mjs +0 -27
  405. package/esm2020/src/commands/ClientToServer/RefreshScreenEventCommand.mjs +0 -24
  406. package/esm2020/src/commands/ClientToServer/RollbackEventCommand.mjs +0 -39
  407. package/esm2020/src/commands/ClientToServer/SubformRefreshEventCommand.mjs +0 -24
  408. package/esm2020/src/commands/ClientToServer/TransactionCommand.mjs +0 -28
  409. package/esm2020/src/commands/ClientToServer/WriteMessageToServerLogCommand.mjs +0 -18
  410. package/esm2020/src/commands/DataViewCommandBase.mjs +0 -10
  411. package/esm2020/src/commands/IClientTargetedCommand.mjs +0 -9
  412. package/esm2020/src/commands/ServerToClient/AbortCommand.mjs +0 -65
  413. package/esm2020/src/commands/ServerToClient/AddRangeCommand.mjs +0 -62
  414. package/esm2020/src/commands/ServerToClient/AddSortCommand.mjs +0 -33
  415. package/esm2020/src/commands/ServerToClient/ClientRefreshCommand.mjs +0 -25
  416. package/esm2020/src/commands/ServerToClient/ClientTargetedCommandBase.mjs +0 -27
  417. package/esm2020/src/commands/ServerToClient/EnhancedVerifyCommand.mjs +0 -45
  418. package/esm2020/src/commands/ServerToClient/OpenURLCommand.mjs +0 -221
  419. package/esm2020/src/commands/ServerToClient/ResultCommand.mjs +0 -37
  420. package/esm2020/src/commands/ServerToClient/VerifyCommand.mjs +0 -83
  421. package/esm2020/src/commands/ServerToClient/XMLBasedCommandBuilder.mjs +0 -132
  422. package/esm2020/src/communications/InteractiveCommunicationsFailureHandler.mjs +0 -17
  423. package/esm2020/src/data/DataView.mjs +0 -1610
  424. package/esm2020/src/data/DataviewManager.mjs +0 -28
  425. package/esm2020/src/data/DataviewManagerBase.mjs +0 -15
  426. package/esm2020/src/data/DvCache.mjs +0 -67
  427. package/esm2020/src/data/Field.mjs +0 -646
  428. package/esm2020/src/data/FieldBase.mjs +0 -18
  429. package/esm2020/src/data/FieldsTable.mjs +0 -103
  430. package/esm2020/src/data/Key.mjs +0 -88
  431. package/esm2020/src/data/Record.mjs +0 -846
  432. package/esm2020/src/data/RecordsTable.mjs +0 -267
  433. package/esm2020/src/data/TaskTransactionManager.mjs +0 -103
  434. package/esm2020/src/data/XMLBasedDcValuesBuilder.mjs +0 -74
  435. package/esm2020/src/env/EnvVariablesTable.mjs +0 -340
  436. package/esm2020/src/env/Environment.mjs +0 -489
  437. package/esm2020/src/env/LanguageData.mjs +0 -226
  438. package/esm2020/src/env/MirrorString.mjs +0 -65
  439. package/esm2020/src/event/ActionManager.mjs +0 -91
  440. package/esm2020/src/event/Event.mjs +0 -1333
  441. package/esm2020/src/event/EventHandler.mjs +0 -766
  442. package/esm2020/src/event/EventHandlerPosition.mjs +0 -204
  443. package/esm2020/src/event/EventsManager.mjs +0 -2975
  444. package/esm2020/src/event/RunTimeEvent.mjs +0 -392
  445. package/esm2020/src/event/UserEventsTable.mjs +0 -47
  446. package/esm2020/src/exp/ExpTable.mjs +0 -59
  447. package/esm2020/src/exp/Expression.mjs +0 -200
  448. package/esm2020/src/exp/ExpressionDict.mjs +0 -727
  449. package/esm2020/src/exp/ExpressionEvaluator.mjs +0 -4212
  450. package/esm2020/src/exp/ExpressionLocalJpn.mjs +0 -314
  451. package/esm2020/src/exp/GlobalParamsTable.mjs +0 -85
  452. package/esm2020/src/exp/YesNoExp.mjs +0 -36
  453. package/esm2020/src/gui/CreatedFormVector.mjs +0 -23
  454. package/esm2020/src/gui/FormsTable.mjs +0 -66
  455. package/esm2020/src/gui/MgControl.mjs +0 -353
  456. package/esm2020/src/gui/MgForm.mjs +0 -1181
  457. package/esm2020/src/http/HttpManager.mjs +0 -97
  458. package/esm2020/src/http/client/HttpClientAsync.mjs +0 -67
  459. package/esm2020/src/http/client/HttpClientBase.mjs +0 -132
  460. package/esm2020/src/http/client/HttpClientEvents.mjs +0 -39
  461. package/esm2020/src/http/client/HttpClientSync.mjs +0 -42
  462. package/esm2020/src/http/client/HttpUtility.mjs +0 -84
  463. package/esm2020/src/remote/AddUserLocateRemoteDataViewCommand.mjs +0 -18
  464. package/esm2020/src/remote/AddUserRangeRemoteDataViewCommand.mjs +0 -18
  465. package/esm2020/src/remote/AddUserSortRemoteDataViewCommand.mjs +0 -18
  466. package/esm2020/src/remote/RemoteCommandsProcessor.mjs +0 -880
  467. package/esm2020/src/remote/RemoteControlItemsRefreshCommand.mjs +0 -25
  468. package/esm2020/src/remote/RemoteDataViewCommandBase.mjs +0 -24
  469. package/esm2020/src/remote/RemoteDataViewCommandFactory.mjs +0 -61
  470. package/esm2020/src/remote/ResetUserLocateRemoteDataviewCommand.mjs +0 -17
  471. package/esm2020/src/remote/ResetUserSortRemoteDataviewCommand.mjs +0 -16
  472. package/esm2020/src/remote/ServerError.mjs +0 -40
  473. package/esm2020/src/remote/SetTransactionStateRemoteDataViewCommand.mjs +0 -20
  474. package/esm2020/src/rt/Argument.mjs +0 -265
  475. package/esm2020/src/rt/ArgumentsList.mjs +0 -103
  476. package/esm2020/src/rt/Boundary.mjs +0 -152
  477. package/esm2020/src/rt/CompMainPrgTable.mjs +0 -65
  478. package/esm2020/src/rt/DataviewHeaders.mjs +0 -53
  479. package/esm2020/src/rt/DataviewHeadersSaxHandler.mjs +0 -38
  480. package/esm2020/src/rt/ExecutionStack.mjs +0 -94
  481. package/esm2020/src/rt/HandlersTable.mjs +0 -96
  482. package/esm2020/src/rt/LastFocusedManager.mjs +0 -67
  483. package/esm2020/src/rt/Operation.mjs +0 -735
  484. package/esm2020/src/rt/OperationTable.mjs +0 -67
  485. package/esm2020/src/rt/Recompute.mjs +0 -355
  486. package/esm2020/src/rt/RecomputeTable.mjs +0 -63
  487. package/esm2020/src/rt/RemoteDataviewHeader.mjs +0 -108
  488. package/esm2020/src/rt/ResultValue.mjs +0 -12
  489. package/esm2020/src/rt/TableCache.mjs +0 -177
  490. package/esm2020/src/rt/TableCacheManager.mjs +0 -67
  491. package/esm2020/src/rt/Transaction.mjs +0 -53
  492. package/esm2020/src/security/UserDetails.mjs +0 -71
  493. package/esm2020/src/tasks/MGData.mjs +0 -552
  494. package/esm2020/src/tasks/MGDataCollection.mjs +0 -252
  495. package/esm2020/src/tasks/RCTimer.mjs +0 -63
  496. package/esm2020/src/tasks/RemoteTaskService.mjs +0 -45
  497. package/esm2020/src/tasks/Task.mjs +0 -2495
  498. package/esm2020/src/tasks/TaskBase.mjs +0 -87
  499. package/esm2020/src/tasks/TaskServiceBase.mjs +0 -25
  500. package/esm2020/src/tasks/TasksTable.mjs +0 -80
  501. package/esm2020/src/tasks/sort/Sort.mjs +0 -7
  502. package/esm2020/src/tasks/sort/SortCollection.mjs +0 -67
  503. package/esm2020/src/util/ConstUtils.mjs +0 -14
  504. package/esm2020/src/util/FlowMonitorQueue.mjs +0 -453
  505. package/esm2020/src/util/HeapSort.mjs +0 -70
  506. package/esm2020/src/util/MgPriorityBlockingQueue.mjs +0 -74
  507. package/esm2020/src/util/MgPriorityQueue.mjs +0 -66
  508. package/esm2020/src/util/PrmMap.mjs +0 -151
  509. package/esm2020/src/util/ReturnResult.mjs +0 -46
  510. package/esm2020/src/util/ReturnResultBase.mjs +0 -18
  511. package/esm2020/src/util/Scrambler.mjs +0 -89
  512. package/esm2020/src/util/UniqueIDUtils.mjs +0 -12
  513. package/esm2020/src/util/cookie.service.mjs +0 -92
  514. package/fesm2015/magic-xpa-engine.mjs +0 -30835
  515. package/fesm2015/magic-xpa-engine.mjs.map +0 -1
  516. package/fesm2020/magic-xpa-engine.mjs.map +0 -1
@@ -0,0 +1,26 @@
1
+ import { Logger, StrUtil } from "@magic-xpa/utils";
2
+ import { RemoteCommandsProcessor } from "./remote/RemoteCommandsProcessor";
3
+ import { HttpManager } from "./http/HttpManager";
4
+ import { InteractiveCommunicationsFailureHandler } from "./communications/InteractiveCommunicationsFailureHandler";
5
+ export class CommandsProcessorManager {
6
+ static GetCommandsProcessor() {
7
+ return RemoteCommandsProcessor.GetInstance();
8
+ }
9
+ static async GetContent(requestedURL, useCache) {
10
+ let ret = await (CommandsProcessorManager.GetCommandsProcessor().GetContent(requestedURL, useCache));
11
+ return ret;
12
+ }
13
+ static async StartSession() {
14
+ let succeeded = false;
15
+ try {
16
+ HttpManager.GetInstance().SetCommunicationsFailureHandler(new InteractiveCommunicationsFailureHandler());
17
+ succeeded = await RemoteCommandsProcessor.GetInstance().StartSession();
18
+ }
19
+ catch (ex) {
20
+ Logger.Instance.WriteServerToLog("Failed connecting to the server: " + StrUtil.getConsoleErorString(ex.Message));
21
+ throw ex;
22
+ }
23
+ return succeeded;
24
+ }
25
+ }
26
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiQ29tbWFuZHNQcm9jZXNzb3JNYW5hZ2VyLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vcHJvamVjdHMvZW5naW5lL3NyYy9Db21tYW5kc1Byb2Nlc3Nvck1hbmFnZXIudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkF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yXG4gICAgICAvLyBhY2Nlc3MgdGhlIFNlcnZlclxyXG4gICAgICBzdWNjZWVkZWQgPSBhd2FpdCBSZW1vdGVDb21tYW5kc1Byb2Nlc3Nvci5HZXRJbnN0YW5jZSgpLlN0YXJ0U2Vzc2lvbigpO1xyXG4gICAgfVxyXG4gICAgY2F0Y2ggKGV4KSB7XHJcbiAgICAgIExvZ2dlci5JbnN0YW5jZS5Xcml0ZVNlcnZlclRvTG9nKFwiRmFpbGVkIGNvbm5lY3RpbmcgdG8gdGhlIHNlcnZlcjogXCIgKyBTdHJVdGlsLmdldENvbnNvbGVFcm9yU3RyaW5nKGV4Lk1lc3NhZ2UpKTtcclxuICAgICAgdGhyb3cgZXg7XHJcbiAgICB9XHJcblxyXG4gICAgcmV0dXJuIHN1Y2NlZWRlZDtcclxuICB9XHJcbn1cclxuIl19
@@ -0,0 +1,162 @@
1
+ import { IClientTargetedCommand } from './commands/IClientTargetedCommand';
2
+ import { XMLBasedCommandBuilder } from './commands/ServerToClient/XMLBasedCommandBuilder';
3
+ import { ResultCommand } from './commands/ServerToClient/ResultCommand';
4
+ import { AbortCommand } from './commands/ServerToClient/AbortCommand';
5
+ import { List } from '@magic-xpa/mscorelib';
6
+ import { VerifyCommand } from './commands/ServerToClient/VerifyCommand';
7
+ import { ConstInterface } from './ConstInterface';
8
+ import { ClientOriginatedCommandSerializer } from './commands/ClientToServer/ClientOriginatedCommandSerializer';
9
+ import { GlobalCommandsManager } from './GlobalCommandsManager';
10
+ import { AccessHelper } from './AccessHelper';
11
+ export class CommandsTable {
12
+ _cmds = null;
13
+ _iterationIdx = 0;
14
+ constructor() {
15
+ this._cmds = new List();
16
+ }
17
+ static createCommandsTable() {
18
+ return new CommandsTable();
19
+ }
20
+ fillData(parser) {
21
+ while (this.initInnerObjects(parser.getNextTag(), parser)) {
22
+ }
23
+ }
24
+ initInnerObjects(foundTagName, parser) {
25
+ if (foundTagName == null)
26
+ return false;
27
+ if (foundTagName === ConstInterface.MG_TAG_COMMAND) {
28
+ let cmd = new XMLBasedCommandBuilder().fillData(parser);
29
+ this._cmds.push(cmd);
30
+ }
31
+ else
32
+ return false;
33
+ return true;
34
+ }
35
+ async Execute(res) {
36
+ let currFrame = GlobalCommandsManager.Instance.getCmdFrame();
37
+ GlobalCommandsManager.Instance.add1toCmdFrame();
38
+ let firstBlocking = -1;
39
+ let i, j;
40
+ let cmd;
41
+ for (i = 0; i < this.getSize(); i = i + 1) {
42
+ cmd = this.getCmd(i);
43
+ if (cmd.IsBlocking && firstBlocking === -1)
44
+ firstBlocking = i;
45
+ else if (cmd instanceof ResultCommand && firstBlocking !== -1) {
46
+ this._cmds.Insert(firstBlocking, cmd);
47
+ this._cmds.RemoveAt(i + 1);
48
+ }
49
+ }
50
+ for (i = 0; i < this.getSize(); i = i + 1) {
51
+ cmd = this.getCmd(i);
52
+ cmd.Frame = currFrame;
53
+ if (cmd.IsBlocking) {
54
+ for (j = i + 1; j < this.getSize(); j = j + 1)
55
+ GlobalCommandsManager.Instance.addUnframedCmd(this.getCmd(j));
56
+ this._cmds.SetSize(i + 1);
57
+ break;
58
+ }
59
+ }
60
+ while (this.getSize() > 0) {
61
+ const tmpCmd = this.extractCmd(currFrame);
62
+ if (tmpCmd instanceof IClientTargetedCommand)
63
+ cmd = tmpCmd;
64
+ if (cmd != null) {
65
+ if (cmd.ShouldExecute) {
66
+ await cmd.Execute(res);
67
+ }
68
+ else {
69
+ GlobalCommandsManager.Instance.addCommandsExecutedAfterTaskStarted(cmd);
70
+ }
71
+ }
72
+ else
73
+ break;
74
+ }
75
+ }
76
+ extractCmd(frame) {
77
+ let size = this.getSize();
78
+ let cmd = null;
79
+ let verifyCmd = null;
80
+ let verifyIndex;
81
+ let verifyTask = null;
82
+ let abortTask = null;
83
+ let startIterationIdx;
84
+ let tid;
85
+ if (size === 0)
86
+ return null;
87
+ if (this._iterationIdx >= size)
88
+ this._iterationIdx = 0;
89
+ startIterationIdx = this._iterationIdx;
90
+ for (; this._iterationIdx < size; this._iterationIdx++) {
91
+ cmd = ((this.getCmd(this._iterationIdx) instanceof AbortCommand) ? this.getCmd(this._iterationIdx) : null);
92
+ if (cmd != null && !cmd.TaskTag.startsWith('-') && cmd.Frame === frame) {
93
+ for (verifyIndex = 0; verifyIndex < this._iterationIdx; verifyIndex++) {
94
+ verifyCmd = ((this.getCmd(verifyIndex) instanceof VerifyCommand) ? this.getCmd(verifyIndex) : null);
95
+ if (verifyCmd != null && verifyCmd.Frame === frame) {
96
+ verifyTask = AccessHelper.mgDataTable.GetTaskByID(verifyCmd.TaskTag);
97
+ abortTask = AccessHelper.mgDataTable.GetTaskByID(cmd.TaskTag);
98
+ if (verifyTask != null && verifyTask.isDescendentOf(abortTask)) {
99
+ this._cmds.RemoveAt(verifyIndex);
100
+ this._iterationIdx--;
101
+ return verifyCmd;
102
+ }
103
+ }
104
+ }
105
+ this._cmds.RemoveAt(this._iterationIdx);
106
+ size = this.getSize();
107
+ for (startIterationIdx = 0; startIterationIdx < size; startIterationIdx++) {
108
+ tid = this.getCmd(startIterationIdx).TaskTag;
109
+ if (tid != null && tid.substr(1) === cmd.TaskTag) {
110
+ this._cmds.RemoveAt(startIterationIdx);
111
+ break;
112
+ }
113
+ }
114
+ return cmd;
115
+ }
116
+ }
117
+ for (verifyIndex = 0; verifyIndex < size; verifyIndex++) {
118
+ verifyCmd = ((this.getCmd(verifyIndex) instanceof VerifyCommand) ? this.getCmd(verifyIndex) : null);
119
+ if (verifyCmd != null && verifyCmd.Frame === frame &&
120
+ AccessHelper.mgDataTable.GetTaskByID(verifyCmd.TaskTag) != null) {
121
+ this._cmds.RemoveAt(verifyIndex);
122
+ return verifyCmd;
123
+ }
124
+ }
125
+ for (this._iterationIdx = 0; this._iterationIdx < size; this._iterationIdx++) {
126
+ cmd = this.getCmd(this._iterationIdx);
127
+ if (cmd.Frame === frame) {
128
+ this._cmds.RemoveAt(this._iterationIdx);
129
+ return cmd;
130
+ }
131
+ }
132
+ return null;
133
+ }
134
+ getCmd(idx) {
135
+ return this._cmds.get_Item(idx);
136
+ }
137
+ buildXML(message) {
138
+ for (let i = 0; i < this._cmds.length; i = i + 1) {
139
+ let cmd = this._cmds.get_Item(i);
140
+ message.Append(ClientOriginatedCommandSerializer.Serialize(cmd, AccessHelper.mgDataTable.getCurrMGData()));
141
+ }
142
+ this.clear();
143
+ }
144
+ Add(cmd) {
145
+ this._cmds.push(cmd);
146
+ }
147
+ Clear() {
148
+ this._cmds.Clear();
149
+ }
150
+ ExtractCommand(commandIndex) {
151
+ let command = this.getCmd(commandIndex);
152
+ this._cmds.RemoveAt(commandIndex);
153
+ return command;
154
+ }
155
+ clear() {
156
+ this._cmds.Clear();
157
+ }
158
+ getSize() {
159
+ return this._cmds.length;
160
+ }
161
+ }
162
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiQ29tbWFuZHNUYWJsZS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uL3Byb2plY3RzL2VuZ2luZS9zcmMvQ29tbWFuZHNUYWJsZS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFDQSxPQUFPLEVBQUMsc0JBQXNCLEVBQUMsTUFBTSxtQ0FBbUMsQ0FBQztBQUN6RSxPQUFPLEVBQUMsc0JBQXNCLEVBQUMsTUFBTSxrREFBa0QsQ0FBQztBQUV4RixPQUFPLEVBQUMsYUFBYSxFQUFDLE1BQU0seUNBQXlDLENBQUM7QUFFdEUsT0FBTyxFQUFDLFlBQVksRUFBQyxNQUFNLHdDQUF3QyxDQUFDO0FBQ3BFLE9BQU8sRUFBZ0IsSUFBSSxFQUFDLE1BQU0sc0JBQXNCLENBQUM7QUFDekQsT0FBTyxFQUFDLGFBQWEsRUFBQyxNQUFNLHlDQUF5QyxDQUFDO0FBRXRFLE9BQU8sRUFBQyxjQUFjLEVBQUMsTUFBTSxrQkFBa0IsQ0FBQztBQUVoRCxPQUFPLE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