@magic-xpa/engine 4.1100.0-dev4110.26 → 4.1100.0-dev4110.260

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