@magic-xpa/engine 4.1100.0-dev4110.20 → 4.1100.0-dev4110.202

Sign up to get free protection for your applications and to get access to all the features.
Files changed (515) 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 +409 -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 +157 -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/{esm2020 → esm2022}/src/bridge/MagicBridge.mjs +40 -40
  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 +1181 -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 +882 -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 +2498 -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 +29750 -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 +34 -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 +93 -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/commands/ClientOriginatedCommandTaskTag.mjs +0 -11
  393. package/esm2020/src/commands/ClientToServer/ClientOriginatedCommandSerializer.mjs +0 -60
  394. package/esm2020/src/commands/ClientToServer/CommandFactory.mjs +0 -260
  395. package/esm2020/src/commands/ClientToServer/CommandSerializationHelper.mjs +0 -69
  396. package/esm2020/src/commands/ClientToServer/DataViewOutputCommand.mjs +0 -13
  397. package/esm2020/src/commands/ClientToServer/EvaluateCommand.mjs +0 -36
  398. package/esm2020/src/commands/ClientToServer/EventCommand.mjs +0 -40
  399. package/esm2020/src/commands/ClientToServer/ExecOperCommand.mjs +0 -67
  400. package/esm2020/src/commands/ClientToServer/FetchDataControlValuesEventCommand.mjs +0 -22
  401. package/esm2020/src/commands/ClientToServer/IniputForceWriteCommand.mjs +0 -23
  402. package/esm2020/src/commands/ClientToServer/RecomputeCommand.mjs +0 -27
  403. package/esm2020/src/commands/ClientToServer/RefreshEventCommand.mjs +0 -27
  404. package/esm2020/src/commands/ClientToServer/RefreshScreenEventCommand.mjs +0 -24
  405. package/esm2020/src/commands/ClientToServer/RollbackEventCommand.mjs +0 -39
  406. package/esm2020/src/commands/ClientToServer/SubformRefreshEventCommand.mjs +0 -24
  407. package/esm2020/src/commands/ClientToServer/TransactionCommand.mjs +0 -28
  408. package/esm2020/src/commands/ClientToServer/WriteMessageToServerLogCommand.mjs +0 -18
  409. package/esm2020/src/commands/DataViewCommandBase.mjs +0 -10
  410. package/esm2020/src/commands/IClientTargetedCommand.mjs +0 -9
  411. package/esm2020/src/commands/ServerToClient/AbortCommand.mjs +0 -65
  412. package/esm2020/src/commands/ServerToClient/AddRangeCommand.mjs +0 -62
  413. package/esm2020/src/commands/ServerToClient/AddSortCommand.mjs +0 -33
  414. package/esm2020/src/commands/ServerToClient/ClientRefreshCommand.mjs +0 -25
  415. package/esm2020/src/commands/ServerToClient/ClientTargetedCommandBase.mjs +0 -27
  416. package/esm2020/src/commands/ServerToClient/EnhancedVerifyCommand.mjs +0 -45
  417. package/esm2020/src/commands/ServerToClient/OpenURLCommand.mjs +0 -221
  418. package/esm2020/src/commands/ServerToClient/ResultCommand.mjs +0 -37
  419. package/esm2020/src/commands/ServerToClient/VerifyCommand.mjs +0 -83
  420. package/esm2020/src/commands/ServerToClient/XMLBasedCommandBuilder.mjs +0 -132
  421. package/esm2020/src/communications/InteractiveCommunicationsFailureHandler.mjs +0 -17
  422. package/esm2020/src/data/DataView.mjs +0 -1610
  423. package/esm2020/src/data/DataviewManager.mjs +0 -28
  424. package/esm2020/src/data/DataviewManagerBase.mjs +0 -15
  425. package/esm2020/src/data/DvCache.mjs +0 -67
  426. package/esm2020/src/data/Field.mjs +0 -646
  427. package/esm2020/src/data/FieldBase.mjs +0 -18
  428. package/esm2020/src/data/FieldsTable.mjs +0 -103
  429. package/esm2020/src/data/Key.mjs +0 -88
  430. package/esm2020/src/data/Record.mjs +0 -846
  431. package/esm2020/src/data/RecordsTable.mjs +0 -267
  432. package/esm2020/src/data/TaskTransactionManager.mjs +0 -103
  433. package/esm2020/src/data/XMLBasedDcValuesBuilder.mjs +0 -74
  434. package/esm2020/src/env/EnvVariablesTable.mjs +0 -340
  435. package/esm2020/src/env/Environment.mjs +0 -489
  436. package/esm2020/src/env/LanguageData.mjs +0 -226
  437. package/esm2020/src/env/MirrorString.mjs +0 -65
  438. package/esm2020/src/event/ActionManager.mjs +0 -91
  439. package/esm2020/src/event/Event.mjs +0 -1333
  440. package/esm2020/src/event/EventHandler.mjs +0 -766
  441. package/esm2020/src/event/EventHandlerPosition.mjs +0 -204
  442. package/esm2020/src/event/EventsManager.mjs +0 -2975
  443. package/esm2020/src/event/RunTimeEvent.mjs +0 -392
  444. package/esm2020/src/event/UserEventsTable.mjs +0 -47
  445. package/esm2020/src/exp/ExpTable.mjs +0 -59
  446. package/esm2020/src/exp/Expression.mjs +0 -200
  447. package/esm2020/src/exp/ExpressionDict.mjs +0 -727
  448. package/esm2020/src/exp/ExpressionEvaluator.mjs +0 -4212
  449. package/esm2020/src/exp/ExpressionLocalJpn.mjs +0 -314
  450. package/esm2020/src/exp/GlobalParamsTable.mjs +0 -85
  451. package/esm2020/src/exp/YesNoExp.mjs +0 -36
  452. package/esm2020/src/gui/CreatedFormVector.mjs +0 -23
  453. package/esm2020/src/gui/FormsTable.mjs +0 -66
  454. package/esm2020/src/gui/MgControl.mjs +0 -353
  455. package/esm2020/src/gui/MgForm.mjs +0 -1181
  456. package/esm2020/src/http/HttpManager.mjs +0 -97
  457. package/esm2020/src/http/client/HttpClientAsync.mjs +0 -67
  458. package/esm2020/src/http/client/HttpClientBase.mjs +0 -132
  459. package/esm2020/src/http/client/HttpClientEvents.mjs +0 -39
  460. package/esm2020/src/http/client/HttpClientSync.mjs +0 -42
  461. package/esm2020/src/http/client/HttpUtility.mjs +0 -84
  462. package/esm2020/src/remote/AddUserLocateRemoteDataViewCommand.mjs +0 -18
  463. package/esm2020/src/remote/AddUserRangeRemoteDataViewCommand.mjs +0 -18
  464. package/esm2020/src/remote/AddUserSortRemoteDataViewCommand.mjs +0 -18
  465. package/esm2020/src/remote/RemoteCommandsProcessor.mjs +0 -880
  466. package/esm2020/src/remote/RemoteControlItemsRefreshCommand.mjs +0 -25
  467. package/esm2020/src/remote/RemoteDataViewCommandBase.mjs +0 -24
  468. package/esm2020/src/remote/RemoteDataViewCommandFactory.mjs +0 -61
  469. package/esm2020/src/remote/ResetUserLocateRemoteDataviewCommand.mjs +0 -17
  470. package/esm2020/src/remote/ResetUserSortRemoteDataviewCommand.mjs +0 -16
  471. package/esm2020/src/remote/ServerError.mjs +0 -40
  472. package/esm2020/src/remote/SetTransactionStateRemoteDataViewCommand.mjs +0 -20
  473. package/esm2020/src/rt/Argument.mjs +0 -265
  474. package/esm2020/src/rt/ArgumentsList.mjs +0 -103
  475. package/esm2020/src/rt/Boundary.mjs +0 -152
  476. package/esm2020/src/rt/CompMainPrgTable.mjs +0 -65
  477. package/esm2020/src/rt/DataviewHeaders.mjs +0 -53
  478. package/esm2020/src/rt/DataviewHeadersSaxHandler.mjs +0 -38
  479. package/esm2020/src/rt/ExecutionStack.mjs +0 -94
  480. package/esm2020/src/rt/HandlersTable.mjs +0 -96
  481. package/esm2020/src/rt/LastFocusedManager.mjs +0 -67
  482. package/esm2020/src/rt/Operation.mjs +0 -735
  483. package/esm2020/src/rt/OperationTable.mjs +0 -67
  484. package/esm2020/src/rt/Recompute.mjs +0 -355
  485. package/esm2020/src/rt/RecomputeTable.mjs +0 -63
  486. package/esm2020/src/rt/RemoteDataviewHeader.mjs +0 -108
  487. package/esm2020/src/rt/ResultValue.mjs +0 -12
  488. package/esm2020/src/rt/TableCache.mjs +0 -177
  489. package/esm2020/src/rt/TableCacheManager.mjs +0 -67
  490. package/esm2020/src/rt/Transaction.mjs +0 -53
  491. package/esm2020/src/security/UserDetails.mjs +0 -71
  492. package/esm2020/src/tasks/MGData.mjs +0 -552
  493. package/esm2020/src/tasks/MGDataCollection.mjs +0 -252
  494. package/esm2020/src/tasks/RCTimer.mjs +0 -63
  495. package/esm2020/src/tasks/RemoteTaskService.mjs +0 -45
  496. package/esm2020/src/tasks/Task.mjs +0 -2495
  497. package/esm2020/src/tasks/TaskBase.mjs +0 -87
  498. package/esm2020/src/tasks/TaskServiceBase.mjs +0 -25
  499. package/esm2020/src/tasks/TasksTable.mjs +0 -80
  500. package/esm2020/src/tasks/sort/Sort.mjs +0 -7
  501. package/esm2020/src/tasks/sort/SortCollection.mjs +0 -67
  502. package/esm2020/src/util/ConstUtils.mjs +0 -14
  503. package/esm2020/src/util/FlowMonitorQueue.mjs +0 -453
  504. package/esm2020/src/util/HeapSort.mjs +0 -70
  505. package/esm2020/src/util/MgPriorityBlockingQueue.mjs +0 -74
  506. package/esm2020/src/util/MgPriorityQueue.mjs +0 -66
  507. package/esm2020/src/util/PrmMap.mjs +0 -151
  508. package/esm2020/src/util/ReturnResult.mjs +0 -46
  509. package/esm2020/src/util/ReturnResultBase.mjs +0 -18
  510. package/esm2020/src/util/Scrambler.mjs +0 -89
  511. package/esm2020/src/util/UniqueIDUtils.mjs +0 -12
  512. package/esm2020/src/util/cookie.service.mjs +0 -92
  513. package/fesm2015/magic-xpa-engine.mjs +0 -30835
  514. package/fesm2015/magic-xpa-engine.mjs.map +0 -1
  515. package/fesm2020/magic-xpa-engine.mjs.map +0 -1
@@ -0,0 +1,409 @@
1
+ import { ApplicationException, DateTime, NString, RefParam } from '@magic-xpa/mscorelib';
2
+ import { DateTimeUtils, InternalInterface, Logger, Misc, OSEnvironment, StorageAttribute, XMLConstants } from '@magic-xpa/utils';
3
+ import { Commands, CommandType, DisplayConvertor, Events, GuiDataCollection, GuiEnvironment, Manager, PIC, PropInterface, RuntimeContextBase, Styles } from '@magic-xpa/gui';
4
+ import { EventsManager } from './event/EventsManager';
5
+ import { GuiEventsProcessor } from './GuiEventsProcessor';
6
+ import { Environment } from './env/Environment';
7
+ import { LanguageData } from './env/LanguageData';
8
+ import { TasksTable } from './tasks/TasksTable';
9
+ import { Task } from './tasks/Task';
10
+ import { MGDataCollection } from './tasks/MGDataCollection';
11
+ import { UniqueIDUtils } from './util/UniqueIDUtils';
12
+ import { HttpManager } from './http/HttpManager';
13
+ import { CommandsTable } from './CommandsTable';
14
+ import { RemoteCommandsProcessor } from './remote/RemoteCommandsProcessor';
15
+ import { CommandsProcessorBase_SendingInstruction } from './CommandsProcessorBase';
16
+ import { CommandsProcessorManager } from './CommandsProcessorManager';
17
+ import { MGData } from './tasks/MGData';
18
+ import { ServerError } from './remote/ServerError';
19
+ import { HttpClientEvents } from './http/client/HttpClientEvents';
20
+ import { CommandFactory } from './commands/ClientToServer/CommandFactory';
21
+ import { CurrentClientVersion } from './CurrentClientVersion';
22
+ import { LastFocusedManager } from './rt/LastFocusedManager';
23
+ import { EnvParamsTable } from './env/EnvVariablesTable';
24
+ import { GlobalParams } from './exp/GlobalParamsTable';
25
+ import { OpenURLCommand } from './commands/ServerToClient/OpenURLCommand';
26
+ import { ServerConfig } from './ServerConfig';
27
+ import { AccessHelper } from './AccessHelper';
28
+ import { GUIManager } from "./GUIManager";
29
+ export class ClientManager {
30
+ static _instance = null;
31
+ _globalUniqueSessionId = null;
32
+ _buttonIsClicked = false;
33
+ static _executionPropertiesFileName = null;
34
+ static assetsURL = "./assets";
35
+ static get Instance() {
36
+ if (ClientManager._instance === null)
37
+ ClientManager._instance = new ClientManager();
38
+ return ClientManager._instance;
39
+ }
40
+ AddEvent(guiEvent) {
41
+ let task = MGDataCollection.Instance.GetTaskByID(guiEvent.TaskID);
42
+ let lineIdx = +guiEvent.Line;
43
+ let dvRowIdx = 0;
44
+ if (task != null) {
45
+ let control = null;
46
+ if (guiEvent.ControlName !== null)
47
+ control = task.getForm().GetCtrl(guiEvent.ControlName);
48
+ if (control != null) {
49
+ let dv = task.DataView;
50
+ if (control.IsTableChild) {
51
+ lineIdx -= dv.RecordsBeforeCurrentView;
52
+ }
53
+ switch (guiEvent.EventType) {
54
+ case "columnSort":
55
+ if (control.isColumnSortable()) {
56
+ Events.OnColumnClick(control, guiEvent.Line, guiEvent.ControlName);
57
+ }
58
+ break;
59
+ case "mousedown":
60
+ if (control.isButton()) {
61
+ this._buttonIsClicked = true;
62
+ }
63
+ else if (!control.isSubform())
64
+ Events.GetRuntimeContext(Manager.GetCurrentContextID()).LastClickedCtrlName = control.getName();
65
+ break;
66
+ case "click":
67
+ if (control.isButton() || (control.ConnectedControl && guiEvent.fromButton)) {
68
+ Events.OnSelection("", control, lineIdx, true);
69
+ Events.GetRuntimeContext(Manager.GetCurrentContextID()).LastClickedCtrlName = control.getName();
70
+ this._buttonIsClicked = false;
71
+ }
72
+ else {
73
+ Events.OnFocus(control, lineIdx, true, false);
74
+ let produceClick = control.isButton() || control.isTextControl() || control.isLabel() || control.isTabControl() || control.isTableControl() || control.isComboBox() || control.isImageControl();
75
+ Events.OnMouseDown(control.getForm(), control, null, true, lineIdx, false, produceClick);
76
+ }
77
+ break;
78
+ case "focus":
79
+ if (this._buttonIsClicked)
80
+ return;
81
+ Events.OnFocus(control, lineIdx, true, false);
82
+ break;
83
+ case "dblclick":
84
+ Events.OnDblClick(control, lineIdx);
85
+ break;
86
+ case "selectionchanged":
87
+ Events.OnSelection(guiEvent.Value, control, lineIdx, true);
88
+ break;
89
+ case "keydown":
90
+ Events.OnKeyDown(task.getForm(), control, guiEvent.modifiers, guiEvent.keyCode, 0, 0, '', false, '', true);
91
+ break;
92
+ case "setexternalvalue":
93
+ EventsManager.Instance.AddExternalValueEvent(control, guiEvent.externalValue, guiEvent.param);
94
+ break;
95
+ default:
96
+ break;
97
+ }
98
+ }
99
+ else {
100
+ switch (guiEvent.EventType) {
101
+ case "focusOnNonMagicControl":
102
+ control = LastFocusedManager.getLastFocusedControl();
103
+ if (control !== null) {
104
+ Events.OnFocusOnNonMagicControl(control);
105
+ }
106
+ break;
107
+ case "click":
108
+ if (guiEvent.ControlName === "magicRow") {
109
+ dvRowIdx = guiEvent.Line - task.DataView.RecordsBeforeCurrentView;
110
+ EventsManager.Instance.addGuiTriggeredEventWithTaskAndCodeAndLine(task, InternalInterface.MG_ACT_REC_PREFIX, dvRowIdx);
111
+ }
112
+ break;
113
+ case "navigateInTable":
114
+ if (guiEvent.ControlName === "magicRow")
115
+ this.handleNavigateInRowEvent(task, guiEvent.Value);
116
+ break;
117
+ case "close":
118
+ if (task.IsRoute())
119
+ EventsManager.Instance.AddRouterClosedEvent(task);
120
+ else
121
+ Events.CloseFormEvent(task.getForm());
122
+ break;
123
+ case "dispose":
124
+ MGDataCollection.Instance.deleteMGDataTree(task.getMgdID());
125
+ break;
126
+ case "resize":
127
+ Events.TableResizeEvent(task.getForm().getTableCtrl(), guiEvent.PageSize);
128
+ case "getRows":
129
+ dvRowIdx = lineIdx - task.DataView.RecordsBeforeCurrentView;
130
+ let lastFocusedVal = { guiMgControl: task.getForm().getTableCtrl(), Line: dvRowIdx, Val: "" };
131
+ Events.OnGetRowsData(task.getForm().getTableCtrl(), dvRowIdx, true, lastFocusedVal);
132
+ break;
133
+ case "RouterNavigate":
134
+ EventsManager.Instance.AddRouteEvent(task, InternalInterface.MG_ACT_WEBCLIENT_ROUTE, guiEvent.RouterPath, guiEvent.RouterOutletName, guiEvent.RouterParams);
135
+ break;
136
+ case "setexternalvalue":
137
+ Logger.Instance.WriteErrorToLog(NString.Format("Unable to find {0}: Trying to set value for a non-existing control.", guiEvent.ControlName));
138
+ break;
139
+ default:
140
+ break;
141
+ }
142
+ }
143
+ }
144
+ else
145
+ switch (guiEvent.EventType) {
146
+ case "confirmationClosed":
147
+ this.ConfirmationClosed(guiEvent.keyCode);
148
+ break;
149
+ }
150
+ }
151
+ handleNavigateInRowEvent(task, evt) {
152
+ let internalEvt = InternalInterface.MG_ACT_NONE;
153
+ evt = evt.toLowerCase();
154
+ switch (evt) {
155
+ case "begin-page":
156
+ internalEvt = InternalInterface.MG_ACT_TBL_BEGPAGE;
157
+ break;
158
+ case "previous-page":
159
+ internalEvt = InternalInterface.MG_ACT_TBL_PRVPAGE;
160
+ break;
161
+ case "end-page":
162
+ internalEvt = InternalInterface.MG_ACT_TBL_ENDPAGE;
163
+ break;
164
+ case "next-page":
165
+ internalEvt = InternalInterface.MG_ACT_TBL_NXTPAGE;
166
+ break;
167
+ case "previous-line":
168
+ internalEvt = InternalInterface.MG_ACT_TBL_PRVLINE;
169
+ break;
170
+ case "next-line":
171
+ internalEvt = InternalInterface.MG_ACT_TBL_NXTLINE;
172
+ break;
173
+ case "begin-table":
174
+ internalEvt = InternalInterface.MG_ACT_TBL_BEGTBL;
175
+ break;
176
+ case "end-table":
177
+ internalEvt = InternalInterface.MG_ACT_TBL_ENDTBL;
178
+ break;
179
+ }
180
+ if (internalEvt != InternalInterface.MG_ACT_NONE)
181
+ EventsManager.Instance.addGuiTriggeredEventWithTaskAndCode(task, internalEvt);
182
+ }
183
+ ConfirmationClosed(res) {
184
+ Commands.ResolvePromise(res);
185
+ }
186
+ async WorkThreadExecution() {
187
+ if (Logger.Instance.ShouldLog()) {
188
+ Logger.Instance.WriteToLog("", true);
189
+ Logger.Instance.WriteToLog("Started on " + DateTimeUtils.ToString(DateTime.Now, XMLConstants.ERROR_LOG_DATE_FORMAT, Logger.Instance), true);
190
+ this.WriteExecutionPropertiesToLog();
191
+ }
192
+ try {
193
+ if (await CommandsProcessorManager.StartSession()) {
194
+ let mgDataTab = MGDataCollection.Instance;
195
+ let startupMgData = mgDataTab.StartupMgData;
196
+ mgDataTab.currMgdID = startupMgData.GetId();
197
+ let nonInteractiveTask = null;
198
+ if (!startupMgData.IsAborting)
199
+ nonInteractiveTask = await Task.StartProgram(false, false);
200
+ if (nonInteractiveTask === null)
201
+ await EventsManager.Instance.EventsLoop(startupMgData);
202
+ else
203
+ await EventsManager.Instance.NonInteractiveEventsLoop(startupMgData, nonInteractiveTask);
204
+ EventsManager.Instance.setEndOfWork(true);
205
+ }
206
+ }
207
+ catch (ex) {
208
+ if (ex instanceof ApplicationException) {
209
+ let isNoResultError = false;
210
+ if (ex instanceof ServerError && ex.GetCode() === ServerError.INF_NO_RESULT)
211
+ isNoResultError = true;
212
+ if (!isNoResultError)
213
+ await EventsManager.Instance.ProcessAbortingError(ex);
214
+ EventsManager.Instance.setEndOfWork(true);
215
+ }
216
+ else
217
+ throw ex;
218
+ }
219
+ finally {
220
+ await EventsManager.Instance.CheckAndShowSpinner(false);
221
+ Commands.addGlobalCommand(CommandType.EXIT_MAGIC);
222
+ Commands.beginInvoke();
223
+ }
224
+ }
225
+ WriteExecutionPropertiesToLog() {
226
+ if (Logger.Instance.ShouldLogServerRelatedMessages()) {
227
+ Logger.Instance.WriteToLog("-----------------------------------------------------------------------------", true);
228
+ Logger.Instance.WriteToLog("Execution Properties:", true);
229
+ let propsString = JSON.stringify(ServerConfig.Instance);
230
+ Logger.Instance.WriteToLog(propsString, true);
231
+ Logger.Instance.WriteToLog("-----------------------------------------------------------------------------", true);
232
+ }
233
+ }
234
+ constructor() {
235
+ ClientManager._executionPropertiesFileName = localStorage.getItem("ServerConfigURL") ?? "./assets/server-config.json";
236
+ RuntimeContextBase.Instance.Init(RemoteCommandsProcessor.RC_NO_CONTEXT_ID);
237
+ LastFocusedManager.Instance.Init(MGDataCollection.Instance);
238
+ LastFocusedManager.Instance.LastActionTime = Misc.getSystemMilliseconds();
239
+ RemoteCommandsProcessor.ShouldScrambleAndUnscrambleMessages = true;
240
+ this._globalUniqueSessionId = UniqueIDUtils.GetUniqueMachineID() + "_";
241
+ this.RegisterDelegates();
242
+ }
243
+ InitGuiManager() {
244
+ Manager.EventsManager = EventsManager.Instance;
245
+ Manager.DefaultServerName = ServerConfig.Instance.getServer();
246
+ Manager.DefaultProtocol = ServerConfig.Instance.getProtocol();
247
+ GuiEnvironment.Environment = Environment.Instance;
248
+ GuiDataCollection.MGDataTable = MGDataCollection.Instance;
249
+ RuntimeContextBase.noContextId = RemoteCommandsProcessor.RC_NO_CONTEXT_ID;
250
+ }
251
+ InitCircularReferencesBypasses() {
252
+ TasksTable.createNewtask = Task.CreateTask;
253
+ OpenURLCommand.createNewCommandsTable = CommandsTable.createCommandsTable;
254
+ AccessHelper.eventsManager = EventsManager.Instance;
255
+ AccessHelper.mgDataTable = MGDataCollection.Instance;
256
+ AccessHelper.envParamsTable = EnvParamsTable.Instance;
257
+ AccessHelper.globalParams = GlobalParams.Instance;
258
+ AccessHelper.languageData = LanguageData.Instance;
259
+ AccessHelper.environment = Environment.Instance;
260
+ }
261
+ static Main(httpClient) {
262
+ ClientManager.StartExecution(httpClient);
263
+ Logger.Instance.Flush();
264
+ }
265
+ static async StopExecution() {
266
+ try {
267
+ HttpManager.GetInstance().IsAbortingMagicEngine = true;
268
+ MGDataCollection.Instance.StartupMgData.getFirstTask().ClosingFormUI = true;
269
+ await MGDataCollection.Instance.StartupMgData.getFirstTask().endTask(true, false, false);
270
+ }
271
+ catch (ex3) {
272
+ if (ex3 instanceof ApplicationException) {
273
+ Logger.Instance.WriteExceptionToLog(ex3);
274
+ }
275
+ else
276
+ throw ex3;
277
+ }
278
+ }
279
+ static async StartExecution(httpClient) {
280
+ HttpManager.setNativeHttpClient(httpClient);
281
+ let loaded = await ClientManager.Instance.LoadExecutionProps();
282
+ if (loaded) {
283
+ new GuiEventsProcessor();
284
+ ClientManager.Instance.InitGuiManager();
285
+ ClientManager.Instance.InitCircularReferencesBypasses();
286
+ let versionString = CurrentClientVersion === '0.0.0.0' ? "Development mode" : "Version : " + CurrentClientVersion;
287
+ console.log("Magic Web Client. " + versionString);
288
+ HttpManager.GetInstance().HttpCommunicationTimeoutMS = ServerConfig.Instance.GetFirstHttpRequestTimeout();
289
+ EventsManager.Instance.Init();
290
+ Logger.Instance.Initialize(RemoteCommandsProcessor.GetInstance().parseLogLevel(ServerConfig.Instance.getInternalLogLevel()), false);
291
+ let mgd = new MGData(new CommandsTable(), new CommandsTable(), 0, null, false);
292
+ await MGDataCollection.Instance.addMGData(mgd, 0, true);
293
+ await ClientManager.Instance.WorkThreadExecution();
294
+ if (Logger.Instance.ShouldLog()) {
295
+ Logger.Instance.WriteToLog(OSEnvironment.EolSeq + "Ended on " + DateTimeUtils.ToString(DateTime.Now, XMLConstants.ERROR_LOG_DATE_FORMAT, Logger.Instance) + OSEnvironment.EolSeq + OSEnvironment.EolSeq, false);
296
+ }
297
+ }
298
+ else {
299
+ await GUIManager.Instance.MessageBox("Error", "Failed to load server configuration file (" + this._executionPropertiesFileName + ")", Styles.MSGBOX_ICON_ERROR | Styles.MSGBOX_BUTTON_OK);
300
+ }
301
+ }
302
+ async LoadExecutionProps() {
303
+ let response = "";
304
+ let succeeded = true;
305
+ try {
306
+ let isError = new RefParam(false);
307
+ response = await HttpManager.GetInstance().GetContent(ClientManager._executionPropertiesFileName, null, false, isError);
308
+ ServerConfig.Instance.Init(JSON.parse(response));
309
+ let assetsURL = ServerConfig.Instance.getAssetsURL();
310
+ if (assetsURL !== null) {
311
+ ClientManager.assetsURL = assetsURL;
312
+ }
313
+ window.assetsURL = ClientManager.assetsURL;
314
+ }
315
+ catch (ex) {
316
+ succeeded = false;
317
+ }
318
+ return succeeded;
319
+ }
320
+ GetGlobalUniqueSessionID() {
321
+ return this._globalUniqueSessionId;
322
+ }
323
+ static GetControlPictureMask(taskId, controlName) {
324
+ let pic = null;
325
+ let task = MGDataCollection.Instance.GetTaskByID(taskId);
326
+ let control = null;
327
+ if (controlName !== null && task != null) {
328
+ control = task.getForm().GetCtrl(controlName);
329
+ pic = control.getPIC();
330
+ }
331
+ return pic;
332
+ }
333
+ static GetFormattedValue(taskId, controlName, value, rowId) {
334
+ let pic = null;
335
+ let task = MGDataCollection.Instance.GetTaskByID(taskId);
336
+ let control = null;
337
+ let newValue = value;
338
+ if (controlName !== null && task !== null)
339
+ control = task.getForm().GetCtrl(controlName);
340
+ if (control != null && control.DataType == StorageAttribute.NUMERIC) {
341
+ if (control.isRepeatable() && control.getProp(PropInterface.PROP_TYPE_FORMAT).isExpression()) {
342
+ let picval = control.getProp(PropInterface.PROP_TYPE_FORMAT).getPrevValue(+rowId);
343
+ pic = new PIC(picval, StorageAttribute.NUMERIC, control.getForm().getTask().getCompIdx());
344
+ }
345
+ else
346
+ pic = control.getPIC();
347
+ let dispValue = String(value);
348
+ let newPic = pic.getUnformattedNumericPic();
349
+ let num = DisplayConvertor.Instance.toNum(dispValue, newPic, 0);
350
+ newValue = DisplayConvertor.Instance.fromNum(num, pic);
351
+ }
352
+ return newValue;
353
+ }
354
+ static GetRangedValue(taskId, controlName, value) {
355
+ let task = MGDataCollection.Instance.GetTaskByID(taskId);
356
+ let control = null;
357
+ if (controlName !== null) {
358
+ control = task.getForm().GetCtrl(controlName);
359
+ return control.getRangedValue(value);
360
+ }
361
+ return null;
362
+ }
363
+ static ValidateControlValue(taskId, controlName, value) {
364
+ let task = MGDataCollection.Instance.GetTaskByID(taskId);
365
+ let control = null;
366
+ if (controlName !== null) {
367
+ control = task.getForm().GetCtrl(controlName);
368
+ return control.validate(value);
369
+ }
370
+ return null;
371
+ }
372
+ static GetFldRanges(taskId, controlName) {
373
+ let task = MGDataCollection.Instance.GetTaskByID(taskId);
374
+ let control = null;
375
+ if (controlName !== null) {
376
+ control = task.getForm().GetCtrl(controlName);
377
+ return control.getRanges();
378
+ }
379
+ return null;
380
+ }
381
+ static TransCacheExists() {
382
+ let clientTransCacheExists = AccessHelper.mgDataTable.getCurrMGData().clientTransactionCacheExists();
383
+ let serverTransactionCacheExists = AccessHelper.mgDataTable.getCurrMGData().serverTransactionCacheExists();
384
+ return clientTransCacheExists || serverTransactionCacheExists;
385
+ }
386
+ RegisterDelegates() {
387
+ HttpClientEvents.GetExecutionProperty_Event = ServerConfig.Instance.GetExecutionProperty.bind(ServerConfig.Instance);
388
+ HttpClientEvents.GetRuntimeCtxID_Event = this.GetRuntimeCtxID.bind(this);
389
+ HttpClientEvents.GetGlobalUniqueSessionID_Event = this.GetGlobalUniqueSessionID.bind(this);
390
+ HttpClientEvents.ShouldDisplayGenericError_Event = ServerConfig.Instance.ShouldDisplayGenericError.bind(ServerConfig.Instance);
391
+ }
392
+ GetRuntimeCtxID() {
393
+ return RuntimeContextBase.Instance.ContextID;
394
+ }
395
+ static TerminateContextUsingFetchAPI() {
396
+ if (RemoteCommandsProcessor.IsSessionReInitializing)
397
+ return;
398
+ HttpManager.GetInstance().IsAbortingMagicEngine = true;
399
+ MGDataCollection.Instance.getCurrMGData().CmdsToServer.Clear();
400
+ let contextTerminationEventCommand = CommandFactory.
401
+ CreateContextTerminationEventCommand(MGDataCollection.Instance.StartupMgData.getFirstTask().getTaskTag());
402
+ MGDataCollection.Instance.getCurrMGData().CmdsToServer.Add(contextTerminationEventCommand);
403
+ RemoteCommandsProcessor.GetInstance().Execute(CommandsProcessorBase_SendingInstruction.ONLY_COMMANDS);
404
+ }
405
+ static GetAssetsURL() {
406
+ return ClientManager.assetsURL;
407
+ }
408
+ }
409
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiQ2xpZW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nJlbnRDb250ZXh0SUQoKSkuTGFzdENsaWNrZWRDdHJsTmFtZSA9IGNvbnRyb2wuZ2V0TmFtZSgpO1xyXG4gICAgICAgICAgICBicmVhaztcclxuXHJcbiAgICAgICAgICBjYXNlIFwiY2xpY2tcIjpcclxuICAgICAgICAgICAgaWYgKGNvbnRyb2wuaXNCdXR0b24oKSB8fCAoY29udHJvbC5Db25uZWN0ZWRDb250cm9sICYmIGd1aUV2ZW50LmZyb21CdXR0b24pKXtcclxuICAgICAgICAgICAgICBFdmVudHMuT25TZWxlY3Rpb24oXCJcIiwgY29udHJvbCwgbGluZUlkeCwgdHJ1ZSk7XHJcbiAgICAgICAgICAgICAgRXZlbnRzLkdldFJ1bnRpbWVDb250ZXh0KE1hbmFnZXIuR2V0Q3VycmVudENvbnRleHRJRCgpKS5MYXN0Q2xpY2tlZEN0cmxOYW1lID0gY29udHJvbC5nZXROYW1lKCk7XHJcbiAgICAgICAgICAgICAgdGhpcy5fYnV0dG9uSXNDbGlja2VkID0gZmFsc2U7XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgLy8gc29ydGluZyBzaG91bGQgYmUgaGFuZGxlZCBvbmx5IG9uIGNvbHVtbiBjbGljayBhbmQgbm90IG9uIHJvd0RhdGFcclxuICAgICAgICAgICAgLy8gZWxzZSBpZiAoY29udHJvbC5UeXBlID09PSBNZ0NvbnRyb2xUeXBlLkNUUkxfVFlQRV9DT0xVTU4pIHtcclxuICAgICAgICAgICAgLy8gICBFdmVudHMuT25Db2x1bW5DbGljayhjb250cm9sLCBndWlFdmVudC5MaW5lLCBndWlFdmVudC5Db250cm9sTmFtZSk7XHJcbiAgICAgICAgICAgIC8vIH1cclxuICAgICAgICAgICAgZWxzZSB7XHJcbiAgICAgICAgICAgICAgRXZlbnRzLk9uRm9jdXMoY29udHJvbCwgbGluZUlkeCwgdHJ1ZSwgZmFsc2UpO1xyXG4gICAgICAgICAgICAgIGxldCBwcm9kdWNlQ2xpY2s6IGJvb2xl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XNlZE1hbmFnZXIuZ2V0TGFzdEZvY3VzZWRDb250cm9sKCksIDAsXHJcbiAgICAgICAgICAgIC8vICAgICAgICAgICAgICAgTGFzdEZvY3VzZWRNYW5hZ2VyLmdldExhc3RGb2N1c2VkQ29udHJvbCgpID09PSBudWxsID8gdHJ1ZSA6IGZhbHNlKTtcclxuICAgICAgICAgICAgLy8gICAgIHRoaXMuX2xhc3RGYWlsZWRGb2N1c2VkQ29udHJvbCA9IGNvbnRyb2w7XHJcbiAgICAgICAgICAgIC8vICAgICByZXR1cm47XHJcbiAgICAgICAgICAgIC8vICAgfVxyXG4gICAgICAgICAgICAvLyB9XHJcbiAgICAgICAgICAgIC8vXHJcbiAgICAgICAgICAgIC8vIHRoaXMuX2xhc3RGYWlsZWRGb2N1c2VkQ29udHJvbCA9IG51bGw7XHJcblxyXG4gICAgICAgICAgICBFdmVudHMuT25Gb2N1cyhjb250cm9sLCBsaW5lSWR4LCB0cnVlLCBmYWxzZSk7XHJcblxyXG4gICAgICAgICAgICBicmVhaztcclxuICAgICAgICAgIGNhc2UgXCJkYmxjbGlja1wiOlxyXG4gICAgICAgICAgICBFdmVudHMuT25EYmxDbGljayhjb250cm9sLCBsaW5lSWR4KTtcclxuICAgICAgICAgICAgYnJlYWs7XHJcblxyXG4gICAgICAgICAgY2FzZSBcInNlbGVjdGlvbmNoYW5nZWRcIjpcclxuICAgICAgICAgICAgRXZlbnRzLk9uU2VsZWN0aW9uKGd1aUV2ZW50LlZhbHVlLCBjb250cm9sLCBsaW5lSWR4LCB0cnVlKTtcclxuICAgICAgICAgICAgYnJlYWs7XHJcbiAgICAgICAgICBjYXNlIFwia2V5ZG93blwiOlxyXG4gICAgICAgICAgICBFdmVudHMuT25LZXlEb3duKCB0YXNrLmdldEZvcm0oKSwgY29udHJvbCwgZ3VpRXZlbnQubW9kaWZpZXJzLCBndWlFdmVudC5rZXlDb2RlLCAwLDAsICcnLGZhbHNlLCcnLHRydWUgKTtcclxuICAgICAgICAgICAgY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NvbnRleHRUZXJtaW5hdGlvbkV2ZW50Q29tbWFuZCk7XHJcblxyXG4gICAgLy8gcmVzcG9uc2UgbmVlZCBub3QgdG8gYmUgaGFuZGxlZCBhcyB0aGUgYnJvd3NlciB1bmxvYWQgY2Fubm90IGJlIHN0b3BwZWQsIHNvIG5vIG5lZWQgdG8gd2FpdFxyXG4gICAgUmVtb3RlQ29tbWFuZHNQcm9jZXNzb3IuR2V0SW5zdGFuY2UoKS5FeGVjdXRlKENvbW1hbmRzUHJvY2Vzc29yQmFzZV9TZW5kaW5nSW5zdHJ1Y3Rpb24uT05MWV9DT01NQU5EUyk7XHJcbiAgfVxyXG5cclxuICBwdWJsaWMgc3RhdGljIEdldEFzc2V0c1VSTCgpOiBzdHJpbmd7XHJcbiAgICByZXR1cm4gQ2xpZW50TWFuYWdlci5hc3NldHNVUkw7XHJcbiAgfVxyXG5cclxufVxyXG4iXX0=
@@ -0,0 +1,56 @@
1
+ import { XMLConstants } from '@magic-xpa/utils';
2
+ import { Scrambler } from './util/Scrambler';
3
+ import { isNullOrUndefined } from '@magic-xpa/mscorelib';
4
+ export var CommandsProcessorBase_SessionStage;
5
+ (function (CommandsProcessorBase_SessionStage) {
6
+ CommandsProcessorBase_SessionStage[CommandsProcessorBase_SessionStage["HANDSHAKE"] = 1] = "HANDSHAKE";
7
+ CommandsProcessorBase_SessionStage[CommandsProcessorBase_SessionStage["INITIAL"] = 2] = "INITIAL";
8
+ CommandsProcessorBase_SessionStage[CommandsProcessorBase_SessionStage["NORMAL"] = 3] = "NORMAL";
9
+ })(CommandsProcessorBase_SessionStage || (CommandsProcessorBase_SessionStage = {}));
10
+ export var CommandsProcessorBase_SendingInstruction;
11
+ (function (CommandsProcessorBase_SendingInstruction) {
12
+ CommandsProcessorBase_SendingInstruction[CommandsProcessorBase_SendingInstruction["NO_TASKS_OR_COMMANDS"] = 0] = "NO_TASKS_OR_COMMANDS";
13
+ CommandsProcessorBase_SendingInstruction[CommandsProcessorBase_SendingInstruction["ONLY_COMMANDS"] = 1] = "ONLY_COMMANDS";
14
+ CommandsProcessorBase_SendingInstruction[CommandsProcessorBase_SendingInstruction["TASKS_AND_COMMANDS"] = 2] = "TASKS_AND_COMMANDS";
15
+ })(CommandsProcessorBase_SendingInstruction || (CommandsProcessorBase_SendingInstruction = {}));
16
+ export class CommandsProcessorBase {
17
+ _sessionCounter = 0;
18
+ GetSessionCounter() {
19
+ return this._sessionCounter;
20
+ }
21
+ async StartSession() {
22
+ return Promise.resolve(true);
23
+ }
24
+ async Execute(sendingInstruction, sessionStage, res) {
25
+ if (isNullOrUndefined(sessionStage)) {
26
+ await this.Execute_0(sendingInstruction);
27
+ return;
28
+ }
29
+ await this.Execute_1(sendingInstruction, sessionStage, res);
30
+ }
31
+ async Execute_0(sendingInstruction) {
32
+ await this.Execute_1(sendingInstruction, CommandsProcessorBase_SessionStage.NORMAL, null);
33
+ }
34
+ async Execute_1(sendingInstruction, sessionStage, res) {
35
+ return Promise.resolve();
36
+ }
37
+ async GetContent(requestedURL, useCache) {
38
+ return Promise.resolve('');
39
+ }
40
+ static UnScramble(respBuf) {
41
+ let openTagLocation = respBuf.indexOf(XMLConstants.MG_TAG_OPEN);
42
+ let core;
43
+ if (openTagLocation !== -1) {
44
+ let start = openTagLocation + XMLConstants.MG_TAG_OPEN.length;
45
+ let openTag = respBuf.substr(0, start);
46
+ let finish = respBuf.lastIndexOf(XMLConstants.TAG_OPEN);
47
+ let closeTag = respBuf.substr(finish);
48
+ core = openTag + Scrambler.UnScramble(respBuf, start, finish - 1) + closeTag;
49
+ }
50
+ else {
51
+ core = Scrambler.UnScramble(respBuf, 0, respBuf.length - 1);
52
+ }
53
+ return core;
54
+ }
55
+ }
56
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiQ29tbWFuZHNQcm9jZXNzb3JCYXNlLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vcHJvam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JcbiAgICAgIGNvcmUgPSBvcGVuVGFnICsgU2NyYW1ibGVyLlVuU2NyYW1ibGUocmVzcEJ1Ziwgc3RhcnQsIGZpbmlzaCAtIDEpICsgY2xvc2VUYWc7XHJcbiAgICB9XHJcbiAgICBlbHNlIHtcclxuICAgICAgLy8gV2UgZ290IGEgc2NyYW1ibGVkIGVycm9yIG1lc3NhZ2UsIHRoZXJlIGlzIG5vIG9wZW4gdGFnXHJcbiAgICAgIGNvcmUgPSBTY3JhbWJsZXIuVW5TY3JhbWJsZShyZXNwQnVmLCAwLCByZXNwQnVmLmxlbmd0aCAtIDEpO1xyXG4gICAgfVxyXG4gICAgcmV0dXJuIGNvcmU7XHJcbiAgfVxyXG59XHJcbiJdfQ==
@@ -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,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiQ29tbWFuZHNQcm9jZXNzb3JNYW5hZ2VyLmpzIiwic291cmNlUm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