@magic-xpa/engine 4.1100.0-dev4110.25 → 4.1100.0-dev4110.250

Sign up to get free protection for your applications and to get access to all the features.
Files changed (521) hide show
  1. package/{esm2020 → esm2022}/index.mjs +188 -188
  2. package/{esm2020 → esm2022}/magic-xpa-engine.mjs +1 -1
  3. package/esm2022/src/AccessHelper.mjs +15 -0
  4. package/esm2022/src/ClientManager.mjs +416 -0
  5. package/esm2022/src/CommandsProcessorBase.mjs +56 -0
  6. package/esm2022/src/CommandsProcessorManager.mjs +26 -0
  7. package/esm2022/src/CommandsTable.mjs +162 -0
  8. package/esm2022/src/ConstInterface.mjs +517 -0
  9. package/{esm2020 → esm2022}/src/CurrentClientVersion.mjs +2 -2
  10. package/esm2022/src/FlowMonitorInterface.mjs +16 -0
  11. package/esm2022/src/GUIManager.mjs +62 -0
  12. package/esm2022/src/GlobalCommandsManager.mjs +34 -0
  13. package/esm2022/src/GuiEventsProcessor.mjs +156 -0
  14. package/{esm2020 → esm2022}/src/ICommandsTable.mjs +1 -1
  15. package/esm2022/src/ServerConfig.mjs +122 -0
  16. package/{esm2020 → esm2022}/src/bridge/IGuiEvent.mjs +19 -19
  17. package/esm2022/src/bridge/MagicBridge.mjs +41 -0
  18. package/esm2022/src/commands/ClientOriginatedCommandTaskTag.mjs +12 -0
  19. package/{esm2020 → esm2022}/src/commands/ClientToServer/AddUserLocateDataViewCommand.mjs +8 -8
  20. package/{esm2020 → esm2022}/src/commands/ClientToServer/AddUserRangeDataviewCommand.mjs +9 -9
  21. package/{esm2020 → esm2022}/src/commands/ClientToServer/AddUserSortDataViewCommand.mjs +9 -9
  22. package/esm2022/src/commands/ClientToServer/BrowserEscEventCommand.mjs +26 -0
  23. package/{esm2020 → esm2022}/src/commands/ClientToServer/ClientOriginatedCommand.mjs +14 -14
  24. package/esm2022/src/commands/ClientToServer/ClientOriginatedCommandSerializer.mjs +60 -0
  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/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 +880 -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 +107 -0
  90. package/esm2022/src/data/XMLBasedDcValuesBuilder.mjs +74 -0
  91. package/{esm2020 → esm2022}/src/enums.mjs +23 -23
  92. package/esm2022/src/env/EnvVariablesTable.mjs +340 -0
  93. package/esm2022/src/env/Environment.mjs +487 -0
  94. package/{esm2020 → esm2022}/src/env/ILanguageData.mjs +1 -1
  95. package/esm2022/src/env/LanguageData.mjs +227 -0
  96. package/esm2022/src/env/MirrorString.mjs +65 -0
  97. package/esm2022/src/event/ActionManager.mjs +91 -0
  98. package/esm2022/src/event/Event.mjs +1333 -0
  99. package/esm2022/src/event/EventHandler.mjs +766 -0
  100. package/esm2022/src/event/EventHandlerPosition.mjs +204 -0
  101. package/esm2022/src/event/EventsManager.mjs +2988 -0
  102. package/{esm2020 → esm2022}/src/event/IEventsManager.mjs +6 -6
  103. package/esm2022/src/event/RunTimeEvent.mjs +399 -0
  104. package/{esm2020 → esm2022}/src/event/RunTimeEventBase.mjs +3 -3
  105. package/esm2022/src/event/UserEventsTable.mjs +47 -0
  106. package/esm2022/src/exp/ExpTable.mjs +57 -0
  107. package/esm2022/src/exp/Expression.mjs +200 -0
  108. package/esm2022/src/exp/ExpressionDict.mjs +727 -0
  109. package/esm2022/src/exp/ExpressionEvaluator.mjs +4206 -0
  110. package/esm2022/src/exp/ExpressionLocalJpn.mjs +314 -0
  111. package/esm2022/src/exp/GlobalParamsTable.mjs +85 -0
  112. package/esm2022/src/exp/YesNoExp.mjs +36 -0
  113. package/esm2022/src/gui/CreatedFormVector.mjs +23 -0
  114. package/esm2022/src/gui/FormsTable.mjs +66 -0
  115. package/esm2022/src/gui/MgControl.mjs +363 -0
  116. package/esm2022/src/gui/MgForm.mjs +1224 -0
  117. package/esm2022/src/http/HttpManager.mjs +97 -0
  118. package/esm2022/src/http/client/HttpClientAsync.mjs +68 -0
  119. package/esm2022/src/http/client/HttpClientBase.mjs +132 -0
  120. package/esm2022/src/http/client/HttpClientEvents.mjs +39 -0
  121. package/esm2022/src/http/client/HttpClientSync.mjs +42 -0
  122. package/esm2022/src/http/client/HttpUtility.mjs +84 -0
  123. package/{esm2020 → esm2022}/src/http/client/ICommunicationsFailureHandler.mjs +1 -1
  124. package/esm2022/src/remote/AddUserLocateRemoteDataViewCommand.mjs +18 -0
  125. package/esm2022/src/remote/AddUserRangeRemoteDataViewCommand.mjs +18 -0
  126. package/esm2022/src/remote/AddUserSortRemoteDataViewCommand.mjs +18 -0
  127. package/esm2022/src/remote/RemoteCommandsProcessor.mjs +883 -0
  128. package/esm2022/src/remote/RemoteControlItemsRefreshCommand.mjs +25 -0
  129. package/esm2022/src/remote/RemoteDataViewCommandBase.mjs +24 -0
  130. package/esm2022/src/remote/RemoteDataViewCommandFactory.mjs +61 -0
  131. package/{esm2020 → esm2022}/src/remote/RemoteDataViewCommandUpdateNonModifiable.mjs +15 -15
  132. package/{esm2020 → esm2022}/src/remote/RemoteDataviewManager.mjs +17 -17
  133. package/{esm2020 → esm2022}/src/remote/RemoteInitDataViewCommand.mjs +10 -10
  134. package/esm2022/src/remote/ResetUserLocateRemoteDataviewCommand.mjs +17 -0
  135. package/{esm2020 → esm2022}/src/remote/ResetUserRangeRemoteDataviewCommand.mjs +12 -12
  136. package/esm2022/src/remote/ResetUserSortRemoteDataviewCommand.mjs +16 -0
  137. package/esm2022/src/remote/ServerError.mjs +40 -0
  138. package/esm2022/src/remote/SetTransactionStateRemoteDataViewCommand.mjs +20 -0
  139. package/esm2022/src/rt/Argument.mjs +265 -0
  140. package/esm2022/src/rt/ArgumentsList.mjs +103 -0
  141. package/esm2022/src/rt/Boundary.mjs +152 -0
  142. package/esm2022/src/rt/CompMainPrgTable.mjs +63 -0
  143. package/{esm2020 → esm2022}/src/rt/DataviewHeaderBase.mjs +98 -96
  144. package/{esm2020 → esm2022}/src/rt/DataviewHeaderFactory.mjs +6 -6
  145. package/esm2022/src/rt/DataviewHeaders.mjs +53 -0
  146. package/esm2022/src/rt/DataviewHeadersSaxHandler.mjs +38 -0
  147. package/esm2022/src/rt/ExecutionStack.mjs +94 -0
  148. package/{esm2020 → esm2022}/src/rt/ExecutionStackEntry.mjs +17 -17
  149. package/esm2022/src/rt/HandlersTable.mjs +96 -0
  150. package/{esm2020 → esm2022}/src/rt/IDataSourceViewDefinition.mjs +1 -1
  151. package/{esm2020 → esm2022}/src/rt/IDataviewHeader.mjs +1 -1
  152. package/{esm2020 → esm2022}/src/rt/IResultValue.mjs +1 -1
  153. package/esm2022/src/rt/LastFocusedManager.mjs +65 -0
  154. package/esm2022/src/rt/Operation.mjs +735 -0
  155. package/esm2022/src/rt/OperationTable.mjs +67 -0
  156. package/esm2022/src/rt/Recompute.mjs +355 -0
  157. package/esm2022/src/rt/RecomputeTable.mjs +63 -0
  158. package/esm2022/src/rt/RemoteDataviewHeader.mjs +108 -0
  159. package/esm2022/src/rt/ResultValue.mjs +10 -0
  160. package/esm2022/src/rt/TableCache.mjs +177 -0
  161. package/esm2022/src/rt/TableCacheManager.mjs +67 -0
  162. package/esm2022/src/rt/Transaction.mjs +53 -0
  163. package/esm2022/src/security/UserDetails.mjs +71 -0
  164. package/{esm2020 → esm2022}/src/tasks/IMGDataCollection.mjs +1 -1
  165. package/esm2022/src/tasks/MGData.mjs +552 -0
  166. package/esm2022/src/tasks/MGDataCollection.mjs +252 -0
  167. package/esm2022/src/tasks/RCTimer.mjs +63 -0
  168. package/esm2022/src/tasks/RemoteTaskService.mjs +45 -0
  169. package/esm2022/src/tasks/Task.mjs +2499 -0
  170. package/esm2022/src/tasks/TaskBase.mjs +83 -0
  171. package/esm2022/src/tasks/TaskServiceBase.mjs +25 -0
  172. package/esm2022/src/tasks/TasksTable.mjs +80 -0
  173. package/esm2022/src/tasks/sort/Sort.mjs +5 -0
  174. package/esm2022/src/tasks/sort/SortCollection.mjs +67 -0
  175. package/esm2022/src/util/ConstUtils.mjs +14 -0
  176. package/esm2022/src/util/FlowMonitorQueue.mjs +451 -0
  177. package/esm2022/src/util/HeapSort.mjs +70 -0
  178. package/{esm2020 → esm2022}/src/util/IMirrorXML.mjs +1 -1
  179. package/{esm2020 → esm2022}/src/util/IServerConfig.mjs +1 -1
  180. package/{esm2020 → esm2022}/src/util/MgBlockingQueue.mjs +1 -1
  181. package/esm2022/src/util/MgPriorityBlockingQueue.mjs +74 -0
  182. package/esm2022/src/util/MgPriorityQueue.mjs +66 -0
  183. package/{esm2020 → esm2022}/src/util/ParamParseResult.mjs +7 -7
  184. package/esm2022/src/util/PrmMap.mjs +152 -0
  185. package/esm2022/src/util/ReturnResult.mjs +46 -0
  186. package/esm2022/src/util/ReturnResultBase.mjs +18 -0
  187. package/esm2022/src/util/Scrambler.mjs +89 -0
  188. package/esm2022/src/util/UniqueIDUtils.mjs +13 -0
  189. package/esm2022/src/util/cookie.service.mjs +92 -0
  190. package/{fesm2020 → fesm2022}/magic-xpa-engine.mjs +29883 -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/CommandsProcessorManager.mjs +0 -26
  385. package/esm2020/src/CommandsTable.mjs +0 -162
  386. package/esm2020/src/ConstInterface.mjs +0 -516
  387. package/esm2020/src/FlowMonitorInterface.mjs +0 -16
  388. package/esm2020/src/GUIManager.mjs +0 -62
  389. package/esm2020/src/GlobalCommandsManager.mjs +0 -34
  390. package/esm2020/src/GuiEventsProcessor.mjs +0 -154
  391. package/esm2020/src/ServerConfig.mjs +0 -117
  392. package/esm2020/src/bridge/MagicBridge.mjs +0 -41
  393. package/esm2020/src/commands/ClientOriginatedCommandTaskTag.mjs +0 -11
  394. package/esm2020/src/commands/ClientToServer/BrowserEscEventCommand.mjs +0 -23
  395. package/esm2020/src/commands/ClientToServer/ClientOriginatedCommandSerializer.mjs +0 -60
  396. package/esm2020/src/commands/ClientToServer/ColumnSortEventCommand.mjs +0 -26
  397. package/esm2020/src/commands/ClientToServer/CommandFactory.mjs +0 -260
  398. package/esm2020/src/commands/ClientToServer/CommandSerializationHelper.mjs +0 -69
  399. package/esm2020/src/commands/ClientToServer/ComputeEventCommand.mjs +0 -23
  400. package/esm2020/src/commands/ClientToServer/DataViewOutputCommand.mjs +0 -13
  401. package/esm2020/src/commands/ClientToServer/EvaluateCommand.mjs +0 -36
  402. package/esm2020/src/commands/ClientToServer/ExecOperCommand.mjs +0 -67
  403. package/esm2020/src/commands/ClientToServer/FetchDataControlValuesEventCommand.mjs +0 -22
  404. package/esm2020/src/commands/ClientToServer/IndexChangeEventCommand.mjs +0 -21
  405. package/esm2020/src/commands/ClientToServer/IniputForceWriteCommand.mjs +0 -23
  406. package/esm2020/src/commands/ClientToServer/RecomputeCommand.mjs +0 -27
  407. package/esm2020/src/commands/ClientToServer/RefreshEventCommand.mjs +0 -27
  408. package/esm2020/src/commands/ClientToServer/RefreshScreenEventCommand.mjs +0 -24
  409. package/esm2020/src/commands/ClientToServer/RollbackEventCommand.mjs +0 -39
  410. package/esm2020/src/commands/ClientToServer/SelectProgramCommand.mjs +0 -15
  411. package/esm2020/src/commands/ClientToServer/SubformOpenEventCommand.mjs +0 -21
  412. package/esm2020/src/commands/ClientToServer/SubformRefreshEventCommand.mjs +0 -24
  413. package/esm2020/src/commands/ClientToServer/TransactionCommand.mjs +0 -28
  414. package/esm2020/src/commands/ClientToServer/WriteMessageToServerLogCommand.mjs +0 -18
  415. package/esm2020/src/commands/DataViewCommandBase.mjs +0 -10
  416. package/esm2020/src/commands/IClientTargetedCommand.mjs +0 -9
  417. package/esm2020/src/commands/ServerToClient/AbortCommand.mjs +0 -65
  418. package/esm2020/src/commands/ServerToClient/AddRangeCommand.mjs +0 -62
  419. package/esm2020/src/commands/ServerToClient/AddSortCommand.mjs +0 -33
  420. package/esm2020/src/commands/ServerToClient/ClientRefreshCommand.mjs +0 -25
  421. package/esm2020/src/commands/ServerToClient/ClientTargetedCommandBase.mjs +0 -27
  422. package/esm2020/src/commands/ServerToClient/EnhancedVerifyCommand.mjs +0 -45
  423. package/esm2020/src/commands/ServerToClient/OpenURLCommand.mjs +0 -221
  424. package/esm2020/src/commands/ServerToClient/ResultCommand.mjs +0 -37
  425. package/esm2020/src/commands/ServerToClient/VerifyCommand.mjs +0 -83
  426. package/esm2020/src/commands/ServerToClient/XMLBasedCommandBuilder.mjs +0 -132
  427. package/esm2020/src/communications/InteractiveCommunicationsFailureHandler.mjs +0 -17
  428. package/esm2020/src/data/DataView.mjs +0 -1610
  429. package/esm2020/src/data/DataviewManager.mjs +0 -28
  430. package/esm2020/src/data/DataviewManagerBase.mjs +0 -15
  431. package/esm2020/src/data/DvCache.mjs +0 -67
  432. package/esm2020/src/data/Field.mjs +0 -646
  433. package/esm2020/src/data/FieldBase.mjs +0 -18
  434. package/esm2020/src/data/FieldsTable.mjs +0 -103
  435. package/esm2020/src/data/Key.mjs +0 -88
  436. package/esm2020/src/data/Record.mjs +0 -846
  437. package/esm2020/src/data/RecordsTable.mjs +0 -267
  438. package/esm2020/src/data/TaskTransactionManager.mjs +0 -103
  439. package/esm2020/src/data/XMLBasedDcValuesBuilder.mjs +0 -74
  440. package/esm2020/src/env/EnvVariablesTable.mjs +0 -340
  441. package/esm2020/src/env/Environment.mjs +0 -489
  442. package/esm2020/src/env/LanguageData.mjs +0 -226
  443. package/esm2020/src/env/MirrorString.mjs +0 -65
  444. package/esm2020/src/event/ActionManager.mjs +0 -91
  445. package/esm2020/src/event/Event.mjs +0 -1333
  446. package/esm2020/src/event/EventHandler.mjs +0 -766
  447. package/esm2020/src/event/EventHandlerPosition.mjs +0 -204
  448. package/esm2020/src/event/EventsManager.mjs +0 -2975
  449. package/esm2020/src/event/RunTimeEvent.mjs +0 -392
  450. package/esm2020/src/event/UserEventsTable.mjs +0 -47
  451. package/esm2020/src/exp/ExpTable.mjs +0 -59
  452. package/esm2020/src/exp/Expression.mjs +0 -200
  453. package/esm2020/src/exp/ExpressionDict.mjs +0 -727
  454. package/esm2020/src/exp/ExpressionEvaluator.mjs +0 -4212
  455. package/esm2020/src/exp/ExpressionLocalJpn.mjs +0 -314
  456. package/esm2020/src/exp/GlobalParamsTable.mjs +0 -85
  457. package/esm2020/src/exp/YesNoExp.mjs +0 -36
  458. package/esm2020/src/gui/CreatedFormVector.mjs +0 -23
  459. package/esm2020/src/gui/FormsTable.mjs +0 -66
  460. package/esm2020/src/gui/MgControl.mjs +0 -353
  461. package/esm2020/src/gui/MgForm.mjs +0 -1181
  462. package/esm2020/src/http/HttpManager.mjs +0 -97
  463. package/esm2020/src/http/client/HttpClientAsync.mjs +0 -67
  464. package/esm2020/src/http/client/HttpClientBase.mjs +0 -132
  465. package/esm2020/src/http/client/HttpClientEvents.mjs +0 -39
  466. package/esm2020/src/http/client/HttpClientSync.mjs +0 -42
  467. package/esm2020/src/http/client/HttpUtility.mjs +0 -84
  468. package/esm2020/src/remote/AddUserLocateRemoteDataViewCommand.mjs +0 -18
  469. package/esm2020/src/remote/AddUserRangeRemoteDataViewCommand.mjs +0 -18
  470. package/esm2020/src/remote/AddUserSortRemoteDataViewCommand.mjs +0 -18
  471. package/esm2020/src/remote/RemoteCommandsProcessor.mjs +0 -880
  472. package/esm2020/src/remote/RemoteControlItemsRefreshCommand.mjs +0 -25
  473. package/esm2020/src/remote/RemoteDataViewCommandBase.mjs +0 -24
  474. package/esm2020/src/remote/RemoteDataViewCommandFactory.mjs +0 -61
  475. package/esm2020/src/remote/ResetUserLocateRemoteDataviewCommand.mjs +0 -17
  476. package/esm2020/src/remote/ResetUserSortRemoteDataviewCommand.mjs +0 -16
  477. package/esm2020/src/remote/ServerError.mjs +0 -40
  478. package/esm2020/src/remote/SetTransactionStateRemoteDataViewCommand.mjs +0 -20
  479. package/esm2020/src/rt/Argument.mjs +0 -265
  480. package/esm2020/src/rt/ArgumentsList.mjs +0 -103
  481. package/esm2020/src/rt/Boundary.mjs +0 -152
  482. package/esm2020/src/rt/CompMainPrgTable.mjs +0 -65
  483. package/esm2020/src/rt/DataviewHeaders.mjs +0 -53
  484. package/esm2020/src/rt/DataviewHeadersSaxHandler.mjs +0 -38
  485. package/esm2020/src/rt/ExecutionStack.mjs +0 -94
  486. package/esm2020/src/rt/HandlersTable.mjs +0 -96
  487. package/esm2020/src/rt/LastFocusedManager.mjs +0 -67
  488. package/esm2020/src/rt/Operation.mjs +0 -735
  489. package/esm2020/src/rt/OperationTable.mjs +0 -67
  490. package/esm2020/src/rt/Recompute.mjs +0 -355
  491. package/esm2020/src/rt/RecomputeTable.mjs +0 -63
  492. package/esm2020/src/rt/RemoteDataviewHeader.mjs +0 -108
  493. package/esm2020/src/rt/ResultValue.mjs +0 -12
  494. package/esm2020/src/rt/TableCache.mjs +0 -177
  495. package/esm2020/src/rt/TableCacheManager.mjs +0 -67
  496. package/esm2020/src/rt/Transaction.mjs +0 -53
  497. package/esm2020/src/security/UserDetails.mjs +0 -71
  498. package/esm2020/src/tasks/MGData.mjs +0 -552
  499. package/esm2020/src/tasks/MGDataCollection.mjs +0 -252
  500. package/esm2020/src/tasks/RCTimer.mjs +0 -63
  501. package/esm2020/src/tasks/RemoteTaskService.mjs +0 -45
  502. package/esm2020/src/tasks/Task.mjs +0 -2495
  503. package/esm2020/src/tasks/TaskBase.mjs +0 -87
  504. package/esm2020/src/tasks/TaskServiceBase.mjs +0 -25
  505. package/esm2020/src/tasks/TasksTable.mjs +0 -80
  506. package/esm2020/src/tasks/sort/Sort.mjs +0 -7
  507. package/esm2020/src/tasks/sort/SortCollection.mjs +0 -67
  508. package/esm2020/src/util/ConstUtils.mjs +0 -14
  509. package/esm2020/src/util/FlowMonitorQueue.mjs +0 -453
  510. package/esm2020/src/util/HeapSort.mjs +0 -70
  511. package/esm2020/src/util/MgPriorityBlockingQueue.mjs +0 -74
  512. package/esm2020/src/util/MgPriorityQueue.mjs +0 -66
  513. package/esm2020/src/util/PrmMap.mjs +0 -151
  514. package/esm2020/src/util/ReturnResult.mjs +0 -46
  515. package/esm2020/src/util/ReturnResultBase.mjs +0 -18
  516. package/esm2020/src/util/Scrambler.mjs +0 -89
  517. package/esm2020/src/util/UniqueIDUtils.mjs +0 -12
  518. package/esm2020/src/util/cookie.service.mjs +0 -92
  519. package/fesm2015/magic-xpa-engine.mjs +0 -30835
  520. package/fesm2015/magic-xpa-engine.mjs.map +0 -1
  521. package/fesm2020/magic-xpa-engine.mjs.map +0 -1
@@ -0,0 +1,265 @@
1
+ import { ApplicationException, NNumber } from '@magic-xpa/mscorelib';
2
+ import { Logger, StorageAttribute, StorageAttributeCheck } from '@magic-xpa/utils';
3
+ import { BlobType, ExpVal, FieldDef } from '@magic-xpa/gui';
4
+ import { ConstInterface } from '../ConstInterface';
5
+ import { FieldBase } from '../data/FieldBase';
6
+ export class Argument {
7
+ _exp = null;
8
+ _fld = null;
9
+ _skip = false;
10
+ _type = '\0';
11
+ _val = null;
12
+ _valueAttr = StorageAttribute.NONE;
13
+ _valueIsNull = false;
14
+ constructor(fieldOrExpValOrSrcArg) {
15
+ if (arguments.length === 0) {
16
+ this.constructor_0();
17
+ return;
18
+ }
19
+ if (arguments.length === 1 && (fieldOrExpValOrSrcArg === null || fieldOrExpValOrSrcArg instanceof FieldBase)) {
20
+ this.constructor_1(fieldOrExpValOrSrcArg);
21
+ return;
22
+ }
23
+ if (arguments.length === 1 && (fieldOrExpValOrSrcArg === null || fieldOrExpValOrSrcArg instanceof ExpVal)) {
24
+ this.constructor_2(fieldOrExpValOrSrcArg);
25
+ return;
26
+ }
27
+ this.constructor_3(fieldOrExpValOrSrcArg);
28
+ }
29
+ constructor_0() {
30
+ this._type = '\0';
31
+ this._fld = null;
32
+ this._exp = null;
33
+ this._skip = false;
34
+ }
35
+ constructor_1(field) {
36
+ this._fld = field;
37
+ this._type = ConstInterface.ARG_TYPE_FIELD;
38
+ this._exp = null;
39
+ this._skip = false;
40
+ }
41
+ constructor_2(expVal) {
42
+ this._type = ConstInterface.ARG_TYPE_VALUE;
43
+ this._fld = null;
44
+ this._exp = null;
45
+ this._skip = false;
46
+ if (expVal.IsNull)
47
+ this._val = null;
48
+ else
49
+ this._val = expVal.ToMgVal();
50
+ this._valueIsNull = (this._val === null);
51
+ this._valueAttr = expVal.Attr;
52
+ }
53
+ constructor_3(srcArg) {
54
+ this._type = ConstInterface.ARG_TYPE_VALUE;
55
+ switch (srcArg._type) {
56
+ case ConstInterface.ARG_TYPE_FIELD:
57
+ this._valueAttr = srcArg._fld.getType();
58
+ break;
59
+ case ConstInterface.ARG_TYPE_EXP:
60
+ break;
61
+ case ConstInterface.ARG_TYPE_SKIP:
62
+ this._skip = true;
63
+ break;
64
+ default:
65
+ throw new ApplicationException("in Argument.Argument(): illegal source Argument type!");
66
+ }
67
+ }
68
+ async Initialize(srcArg) {
69
+ switch (srcArg._type) {
70
+ case ConstInterface.ARG_TYPE_FIELD:
71
+ this._val = srcArg._fld.getValue(true);
72
+ this._valueIsNull = srcArg._fld.isNull();
73
+ break;
74
+ case ConstInterface.ARG_TYPE_EXP:
75
+ let retVal = await srcArg._exp.evaluateWithResLength(255);
76
+ this._val = retVal.mgVal;
77
+ this._valueAttr = retVal.type;
78
+ this._valueIsNull = (this._val == null);
79
+ if (this._valueIsNull)
80
+ this._val = Argument.getEmptyValue((retVal.type === StorageAttribute.BLOB ||
81
+ retVal.type === StorageAttribute.BLOB_VECTOR));
82
+ break;
83
+ }
84
+ }
85
+ fillData(arg, srcTask) {
86
+ this._type = arg[0];
87
+ let argElements = arg.substr(2);
88
+ switch (this._type) {
89
+ case ConstInterface.ARG_TYPE_FIELD:
90
+ {
91
+ let fieldId = argElements.split(',');
92
+ let parent = NNumber.Parse(fieldId[0]);
93
+ let fldIdx = NNumber.Parse(fieldId[1]);
94
+ this._fld = srcTask.getFieldDef(parent, fldIdx);
95
+ }
96
+ break;
97
+ case ConstInterface.ARG_TYPE_EXP:
98
+ let expNum = NNumber.Parse(argElements);
99
+ this._exp = srcTask.getExpById(expNum);
100
+ break;
101
+ case ConstInterface.ARG_TYPE_SKIP:
102
+ this._skip = true;
103
+ break;
104
+ default:
105
+ Logger.Instance.WriteExceptionToLogWithMsg("in Argument.FillData() illegal type: " + arg);
106
+ break;
107
+ }
108
+ }
109
+ buildXML(message) {
110
+ switch (this._type) {
111
+ case ConstInterface.ARG_TYPE_FIELD:
112
+ message.Append("F:" + this._fld.getTask().getTaskTag() + "," + this._fld.getId());
113
+ break;
114
+ case ConstInterface.ARG_TYPE_EXP:
115
+ message.Append("E:" + this._exp.getId());
116
+ break;
117
+ case ConstInterface.ARG_TYPE_SKIP:
118
+ message.Append("X:0");
119
+ break;
120
+ default:
121
+ Logger.Instance.WriteExceptionToLogWithMsg("in Argument.buildXML() illegal type: " + this._type);
122
+ break;
123
+ }
124
+ }
125
+ getType() {
126
+ return this._type;
127
+ }
128
+ getField() {
129
+ if (this._type === ConstInterface.ARG_TYPE_FIELD)
130
+ return this._fld;
131
+ return null;
132
+ }
133
+ getExp() {
134
+ if (this._type === ConstInterface.ARG_TYPE_EXP)
135
+ return this._exp;
136
+ return null;
137
+ }
138
+ async setValueToField(destFld) {
139
+ let val;
140
+ let isNull;
141
+ switch (this._type) {
142
+ case ConstInterface.ARG_TYPE_FIELD:
143
+ val = this._fld.getValue(true);
144
+ val = Argument.convertArgs(val, this._fld.getType(), destFld.getType());
145
+ isNull = this._fld.isNull() || val == null;
146
+ break;
147
+ case ConstInterface.ARG_TYPE_EXP:
148
+ val = await this._exp.evaluateWithResultTypeAndLength(destFld.getType(), destFld.getSize());
149
+ isNull = (val == null);
150
+ if (isNull)
151
+ val = Argument.getEmptyValue((destFld.getType() === StorageAttribute.BLOB ||
152
+ destFld.getType() === StorageAttribute.BLOB_VECTOR));
153
+ break;
154
+ case ConstInterface.ARG_TYPE_VALUE:
155
+ val = Argument.convertArgs(this._val, this._valueAttr, destFld.getType());
156
+ isNull = this._valueIsNull || val == null;
157
+ break;
158
+ default:
159
+ return;
160
+ }
161
+ destFld.takeValFromRec();
162
+ await destFld.setValueAndStartRecompute(val, isNull, destFld.getTask().DataViewWasRetrieved, false, true);
163
+ }
164
+ static convertArgs(value, srcAttr, expectedType) {
165
+ let invalidArg = false;
166
+ switch (expectedType) {
167
+ case StorageAttribute.ALPHA:
168
+ case StorageAttribute.UNICODE:
169
+ if (srcAttr === StorageAttribute.BLOB) {
170
+ if (BlobType.isValidBlob(value))
171
+ value = BlobType.getString(value);
172
+ }
173
+ else if (!StorageAttributeCheck.IsTypeAlphaOrUnicode(srcAttr))
174
+ invalidArg = true;
175
+ break;
176
+ case StorageAttribute.NUMERIC:
177
+ case StorageAttribute.DATE:
178
+ case StorageAttribute.TIME:
179
+ if (!StorageAttributeCheck.isTypeNumeric(srcAttr))
180
+ invalidArg = true;
181
+ break;
182
+ case StorageAttribute.BLOB:
183
+ if (StorageAttributeCheck.IsTypeAlphaOrUnicode(srcAttr)) {
184
+ let contentType = srcAttr === StorageAttribute.ALPHA
185
+ ? BlobType.CONTENT_TYPE_ANSI
186
+ : BlobType.CONTENT_TYPE_UNICODE;
187
+ value = BlobType.createFromString(value, contentType);
188
+ }
189
+ else if (!StorageAttributeCheck.isTypeBlob(srcAttr))
190
+ invalidArg = true;
191
+ break;
192
+ }
193
+ if (invalidArg)
194
+ value = FieldDef.getMagicDefaultValue(expectedType);
195
+ return value;
196
+ }
197
+ async getValue(expType, expSize) {
198
+ switch (this._type) {
199
+ case ConstInterface.ARG_TYPE_EXP:
200
+ this._val = await this._exp.evaluateWithResultTypeAndLength(expType, expSize);
201
+ if (this._val == null)
202
+ this._val = Argument.getEmptyValue(expType === StorageAttribute.BLOB
203
+ || expType === StorageAttribute.BLOB_VECTOR);
204
+ break;
205
+ case ConstInterface.ARG_TYPE_FIELD:
206
+ this._val = this._fld.getValue(true);
207
+ break;
208
+ case ConstInterface.ARG_TYPE_VALUE:
209
+ break;
210
+ default:
211
+ return null;
212
+ }
213
+ return this._val;
214
+ }
215
+ skipArg() {
216
+ return this._skip;
217
+ }
218
+ fillDataByParams(paramValueAttr, paramValue, paramNull) {
219
+ this._valueAttr = paramValueAttr;
220
+ this._val = paramValue;
221
+ this._valueIsNull = paramNull;
222
+ if (this._valueAttr === StorageAttribute.SKIP) {
223
+ this._type = ConstInterface.ARG_TYPE_SKIP;
224
+ this._skip = true;
225
+ }
226
+ else {
227
+ this._type = ConstInterface.ARG_TYPE_VALUE;
228
+ }
229
+ }
230
+ static getEmptyValue(isBlob) {
231
+ return isBlob ? (BlobType.getEmptyBlobPrefix('\0') + ";") : "";
232
+ }
233
+ FillFromString(argStr) {
234
+ this._type = ConstInterface.ARG_TYPE_VALUE;
235
+ let argType = null;
236
+ if (argStr.length > 2)
237
+ argType = argStr.substr(0, 2);
238
+ switch (argType) {
239
+ case ConstInterface.REQ_ARG_ALPHA:
240
+ this._valueAttr = StorageAttribute.ALPHA;
241
+ break;
242
+ case ConstInterface.REQ_ARG_UNICODE:
243
+ this._valueAttr = StorageAttribute.UNICODE;
244
+ break;
245
+ case ConstInterface.REQ_ARG_NUMERIC:
246
+ this._valueAttr = StorageAttribute.NUMERIC;
247
+ break;
248
+ case ConstInterface.REQ_ARG_DOUBLE:
249
+ this._valueAttr = StorageAttribute.NUMERIC;
250
+ break;
251
+ case ConstInterface.REQ_ARG_LOGICAL:
252
+ this._valueAttr = StorageAttribute.BOOLEAN;
253
+ break;
254
+ case ConstInterface.REQ_ARG_NULL:
255
+ this._valueAttr = StorageAttribute.NONE;
256
+ break;
257
+ default:
258
+ this._valueAttr = StorageAttribute.ALPHA;
259
+ this._val = argStr;
260
+ return;
261
+ }
262
+ this._val = argStr.substr(2);
263
+ }
264
+ }
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dDpcclxuICAgICAgICAvLyBpZiBzdG9yYWdlIHR5cGUgaXMgbm90IGRlZmluZWQsIGFzc3VtZSBhbHBoYSBzdHJpbmcgYW5kIHRoZSBlbnRpcmUgc3RyaW5nIGlzIHRoZSB2YWx1ZVxyXG4gICAgICAgIHRoaXMuX3ZhbHVlQXR0ciA9IFN0b3JhZ2VBdHRyaWJ1dGUuQUxQSEE7XHJcbiAgICAgICAgdGhpcy5fdmFsID0gYXJnU3RyO1xyXG4gICAgICAgIHJldHVybjtcclxuICAgIH1cclxuICAgIC8vIHRoZSBjYXNlIHRoZSBzdHJpbmcgaXMgdG9vIHNob3J0IHdhcyBkZWFsdCB3aXRoIGVhcmxpZXIgLSBpdCB3aWxsIGdldCB0byB0aGUgZGVmYXVsdCBjYXNlIGluIHRoZSBzd2l0Y2hcclxuICAgIC8vIGFuZCByZXR1cm4gZnJvbSB0aGVyZVxyXG4gICAgdGhpcy5fdmFsID0gYXJnU3RyLnN1YnN0cigyKTtcclxuICB9XHJcblxyXG5cclxufVxyXG4iXX0=
@@ -0,0 +1,103 @@
1
+ import { List } from '@magic-xpa/mscorelib';
2
+ import { Argument } from './Argument';
3
+ import { StrUtil } from '@magic-xpa/utils';
4
+ export class ArgumentsList {
5
+ _list = null;
6
+ RefreshOnString = null;
7
+ constructor(srcArgsOrExp_paramsOrArgument) {
8
+ if (arguments.length === 0) {
9
+ this.constructor_0();
10
+ return;
11
+ }
12
+ if (arguments.length === 1 && (srcArgsOrExp_paramsOrArgument === null || srcArgsOrExp_paramsOrArgument instanceof Array)) {
13
+ this.constructor_2(srcArgsOrExp_paramsOrArgument);
14
+ return;
15
+ }
16
+ this.constructor_3(srcArgsOrExp_paramsOrArgument);
17
+ }
18
+ constructor_0() {
19
+ }
20
+ async Initialize(srcArgs) {
21
+ this.constructor_0();
22
+ if (srcArgs === null)
23
+ this._list = null;
24
+ else {
25
+ this._list = new List();
26
+ for (let i = 0; i < srcArgs.getSize(); i = i + 1) {
27
+ let arg = new Argument(srcArgs.getArg(i));
28
+ await arg.Initialize(srcArgs.getArg(i));
29
+ this._list.push(arg);
30
+ }
31
+ }
32
+ }
33
+ constructor_2(Exp_params) {
34
+ this.constructor_0();
35
+ let argCnt = Exp_params.length;
36
+ if (argCnt === 0)
37
+ this._list = null;
38
+ else {
39
+ this._list = new List();
40
+ for (let i = 0; i < argCnt; i = i + 1) {
41
+ this._list.push(new Argument(Exp_params[i]));
42
+ }
43
+ }
44
+ }
45
+ constructor_3(argument) {
46
+ this.Add(argument);
47
+ }
48
+ fillList(valueStr, srcTask) {
49
+ let tok = StrUtil.tokenize(valueStr, "$");
50
+ let size = tok.length;
51
+ this._list = new List();
52
+ for (let i = 0; i < size; i = i + 1) {
53
+ let argument = new Argument();
54
+ argument.fillData(tok[i], srcTask);
55
+ this._list.push(argument);
56
+ }
57
+ }
58
+ buildListFromParams(size, attrs, vals, nulls) {
59
+ this._list = new List();
60
+ for (let i = 0; i < size; i = i + 1) {
61
+ let argument = new Argument();
62
+ argument.fillDataByParams(attrs.charAt(i), vals[i], nulls.charAt(i) !== '0');
63
+ this._list.push(argument);
64
+ }
65
+ }
66
+ buildXML(message) {
67
+ for (let i = 0; i < this._list.length; i = i + 1) {
68
+ if (i > 0)
69
+ message.Append('$');
70
+ this._list.get_Item(i).buildXML(message);
71
+ }
72
+ }
73
+ getSize() {
74
+ return (this._list === null) ? 0 : this._list.length;
75
+ }
76
+ getArg(idx) {
77
+ if (idx < 0 || idx >= this._list.length)
78
+ return null;
79
+ return this._list.get_Item(idx);
80
+ }
81
+ async getArgValue(idx, expType, expSize) {
82
+ let arg = this.getArg(idx);
83
+ if (arg === null)
84
+ return null;
85
+ return await arg.getValue(expType, expSize);
86
+ }
87
+ FillListFromString(argsString) {
88
+ let pattern = new RegExp("(?<!\\\\),");
89
+ let array = argsString.split(pattern);
90
+ this._list = new List();
91
+ for (let i = 0; i < array.length; i = i + 1) {
92
+ let argument = new Argument();
93
+ argument.FillFromString(array[i]);
94
+ this._list.push(argument);
95
+ }
96
+ }
97
+ Add(argument) {
98
+ if (this._list === null)
99
+ this._list = new List();
100
+ this._list.push(argument);
101
+ }
102
+ }
103
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiQXJndW1lbnRzTGlzdC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uLy4uL3Byb2plY3RzL2VuZ2luZS9zcmMvcnQvQXJndW1lbnRzTGlzdC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFDQSxPQUFPLEVBQUUsSUFBSSxFQUFpQixNQUFNLHNCQUFzQixDQUFDO0FBQzNELE9BQU8sRUFBRSxRQUFRLEVBQUUsTUFBTSxZQUFZLENBQUM7QUFHdEMsT0FBTyxFQUFvQixPQUFPLEVBQUUsTUFBTSxrQkFBa0IsQ0FBQztBQUU3RCxNQUFNLE9BQU8sYUFBYTtJQUNoQixLQUFLLEdBQW1CLElBQUksQ0FBQztJQUlyQyxlQUFlLEdBQVcsSUFBSSxDQUFDO0lBSy9CLFlBQVksNkJBQW1DO1FBQzdDLElBQUksU0FBUyxDQUFDLE1BQU0sS0FBSyxDQUFDLEVBQUUsQ0FBQztZQUMzQixJQUFJLENBQUMsYUFBYSxFQUFFLENBQUM7WUFDckIsT0FBTztRQUNULENBQUM7UUFDRCxJQUFJLFNBQVMsQ0FBQyxNQUFNLEtBQUssQ0FBQyxJQUFJLENBQUMsNkJBQTZCLEtBQUssSUFBSSxJQUFJLDZCQUE2QixZQUFZLEtBQUssQ0FBQyxFQUFFLENBQUM7WUFDekgsSUFBSSxDQUFDLGFBQWEsQ0FBQyw2QkFBNkIsQ0FBQyxDQUFDO1lBQ2xELE9BQU87UUFDVCxDQUFDO1FBQ0QsSUFBSSxDQUFDLGFBQWEsQ0FBQyw2QkFBNkIsQ0FBQyxDQUFDO0lBQ3BELENBQUM7SUFLTyxhQUFhO0lBQ3JCLENBQUM7SUFL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vc3VtbWFyeT5cclxuICAvLy8gPHBhcmFtIG5hbWU9XCJhcmd1bWVudFwiPjwvcGFyYW0+XHJcbiAgQWRkKGFyZ3VtZW50OiBBcmd1bWVudCk6IHZvaWQge1xyXG4gICAgaWYgKHRoaXMuX2xpc3QgPT09IG51bGwpXHJcbiAgICAgIHRoaXMuX2xpc3QgPSBuZXcgTGlzdDxBcmd1bWVudD4oKTtcclxuICAgIHRoaXMuX2xpc3QucHVzaChhcmd1bWVudCk7XHJcbiAgfVxyXG59XHJcbiJdfQ==
@@ -0,0 +1,152 @@
1
+ import { ExpressionEvaluator, NullValueException } from "../exp/ExpressionEvaluator";
2
+ import { DisplayConvertor, ExpVal } from "@magic-xpa/gui";
3
+ import { StorageAttribute, StrUtil } from "@magic-xpa/utils";
4
+ import { Char, NString } from "@magic-xpa/mscorelib";
5
+ export class Boundary {
6
+ _cacheTableFldId = 0;
7
+ _max = null;
8
+ _min = null;
9
+ _retType = StorageAttribute.NONE;
10
+ _size = 0;
11
+ _maxExpVal = null;
12
+ _minExpVal = null;
13
+ DiscardMin = false;
14
+ DiscardMax = false;
15
+ MaxEqualsMin = false;
16
+ constructor(task, minIdx, maxIdx, returnType, size, cacheTableId) {
17
+ if (arguments.length === 5)
18
+ this.constructor_0(task, minIdx, maxIdx, returnType, size);
19
+ else
20
+ this.constructor_1(task, minIdx, maxIdx, returnType, size, cacheTableId);
21
+ }
22
+ constructor_0(task, minIdx, maxIdx, returnType, size) {
23
+ this.constructor_1(task, minIdx, maxIdx, returnType, size, -1);
24
+ }
25
+ constructor_1(task, minIdx, maxIdx, returnType, size, cacheTableId) {
26
+ this._retType = returnType;
27
+ this._size = size;
28
+ this._cacheTableFldId = cacheTableId;
29
+ if (minIdx !== -1)
30
+ this._min = task.getExpById(minIdx);
31
+ if (maxIdx !== -1)
32
+ this._max = task.getExpById(maxIdx);
33
+ }
34
+ hasMinExp() {
35
+ return this._min !== null;
36
+ }
37
+ hasMaxExp() {
38
+ return this._max !== null;
39
+ }
40
+ getExpType() {
41
+ return this._retType;
42
+ }
43
+ getCacheTableFldId() {
44
+ return this._cacheTableFldId;
45
+ }
46
+ async compute(padValueWithMinMaxCharacters) {
47
+ if (this.hasMinExp()) {
48
+ let minVal = await this._min.evaluateWithResultTypeAndLength(this.getExpType(), this._size);
49
+ if (minVal !== null) {
50
+ minVal = NString.TrimEnd(minVal, new Array(0));
51
+ }
52
+ this._minExpVal = new ExpVal(this.getExpType(), minVal === null, minVal);
53
+ this.MaxEqualsMin = this.IsMaxEqualsMin();
54
+ if (!this._minExpVal.IsNull && (this._minExpVal.Attr === StorageAttribute.ALPHA || this._minExpVal.Attr === StorageAttribute.UNICODE)) {
55
+ if (padValueWithMinMaxCharacters) {
56
+ this._minExpVal.StrVal = DisplayConvertor.StringValueToMgValue(this._minExpVal.StrVal, this._minExpVal.Attr, Char.MinValue, this._size).toString();
57
+ this.MaxEqualsMin = false;
58
+ }
59
+ this._minExpVal.StrVal = StrUtil.SearchAndReplaceWildChars(this._minExpVal.StrVal, this._size, Char.MinValue);
60
+ }
61
+ this.DiscardMin = await this._min.DiscardCndRangeResult();
62
+ }
63
+ if (this.hasMaxExp()) {
64
+ let maxVal = await this._max.evaluateWithResultTypeAndLength(this.getExpType(), this._size);
65
+ this._maxExpVal = new ExpVal(this.getExpType(), maxVal === null, maxVal);
66
+ if (!this._maxExpVal.IsNull && (this._maxExpVal.Attr === StorageAttribute.ALPHA || this._maxExpVal.Attr === StorageAttribute.UNICODE)) {
67
+ if (padValueWithMinMaxCharacters) {
68
+ this._maxExpVal.StrVal = DisplayConvertor.StringValueToMgValue(this._maxExpVal.StrVal, this._maxExpVal.Attr, Char.MaxValue, this._size);
69
+ }
70
+ this._maxExpVal.StrVal = StrUtil.SearchAndReplaceWildChars(this._maxExpVal.StrVal, this._size, Char.MaxValue);
71
+ }
72
+ this.DiscardMax = await this._max.DiscardCndRangeResult();
73
+ }
74
+ }
75
+ checkRange(val, IsNull) {
76
+ let res = true;
77
+ let cmpVal = new ExpVal(this.getExpType(), IsNull, val);
78
+ if (cmpVal.IsNull && ((this.hasMinExp() && this._minExpVal.IsNull) || (this.hasMaxExp() && this._maxExpVal.IsNull))) {
79
+ res = true;
80
+ }
81
+ else {
82
+ if (this.hasMinExp()) {
83
+ if (!this._minExpVal.IsNull && !cmpVal.IsNull) {
84
+ try {
85
+ if (ExpressionEvaluator.val_cmp_any(cmpVal, this._minExpVal) < 0)
86
+ res = false;
87
+ }
88
+ catch (exception) {
89
+ if (exception instanceof NullValueException) {
90
+ res = false;
91
+ }
92
+ else
93
+ throw exception;
94
+ }
95
+ }
96
+ else {
97
+ if (cmpVal.IsNull !== this._minExpVal.IsNull)
98
+ res = false;
99
+ }
100
+ }
101
+ if (this.hasMaxExp() && res) {
102
+ if (!this._maxExpVal.IsNull && !cmpVal.IsNull) {
103
+ try {
104
+ if (ExpressionEvaluator.val_cmp_any(cmpVal, this._maxExpVal) > 0)
105
+ res = false;
106
+ }
107
+ catch (exception) {
108
+ if (exception instanceof NullValueException)
109
+ res = false;
110
+ else
111
+ throw exception;
112
+ }
113
+ }
114
+ else if (cmpVal.IsNull !== this._maxExpVal.IsNull)
115
+ res = false;
116
+ }
117
+ }
118
+ return res;
119
+ }
120
+ IsMaxEqualsMin() {
121
+ let result = false;
122
+ if (this.hasMaxExp() && this.hasMinExp()) {
123
+ if (this._min.getId() === this._max.getId()) {
124
+ if (this._retType === StorageAttribute.ALPHA || this._retType === StorageAttribute.UNICODE)
125
+ result = !this.WildCharExist();
126
+ else
127
+ result = true;
128
+ }
129
+ }
130
+ return result;
131
+ }
132
+ WildCharExist() {
133
+ let wildChars = ["*", "?"];
134
+ let result = false;
135
+ if (!this._minExpVal.IsNull) {
136
+ let stringValue = this._minExpVal.StrVal;
137
+ for (let i = 0; i < wildChars.length; i = i + 1) {
138
+ if (stringValue.endsWith(wildChars[i])) {
139
+ result = true;
140
+ break;
141
+ }
142
+ }
143
+ }
144
+ return result;
145
+ }
146
+ toString() {
147
+ return NString.Format("{{Boundary: {0}-{1}, {2}, {3}}}", [
148
+ this._max, this._max, this._retType, this._size
149
+ ]);
150
+ }
151
+ }
152
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiQm91bmRhcnkuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi9wcm9qZWN0cy9lbmdpbmUvc3JjL3J0L0JvdW5kYXJ5LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFBQyxtQkFBbUIsRUFBRSxrQkFBa0IsRUFBQyxNQUFNLDRCQUE0QixDQUFDO0FBQ25GLE9BQU8sRUFBQyxnQkFBZ0IsRUFBRSxNQUFNLEVBQUMsTUFBTSxnQkFBZ0IsQ0FBQztBQUN4RCxPQUFPLEVBQUMsZ0JBQWdCLEVBQUUsT0FBTyxFQUFDLE1BQU0sa0JBQWtCLENBQUM7QUFHM0QsT0FBTyxFQUFDLElBQUksRUFBRSxPQUFPLEVBQUMsTUFBTSxzQkFBc0IsQ0FBQztBQUtuRCxNQUFNLE9BQU8sUUFBUTtJQUNYLGdCQUFnQixHQUFXLENBQUMsQ0FBQztJQUM3QixJQUFJLEdBQWUsSUFBSSxDQUFDO0lBQ3hCLElBQUksR0FBZSxJQUFJLENBQUM7SUFDeEIsUUFBUSxHQUFxQixnQkFBZ0IsQ0FBQyxJQUFJLENBQUM7SUFDbkQsS0FBSyxHQUFXLENBQUMsQ0FBQztJQUNsQixVQUFVLEdBQVcsSUFBSSxDQUFDO0lBQzFCLFVBQVUsR0FBVyxJQUFJLENBQUM7SUFFbEMsVUFBVSxHQUFZLEtBQUssQ0FBQztJQUM1QixVQUFVLEdBQVksS0FBSyxDQUFDO0lBQzVCLFlBQVksR0FBWSxLQUFLLENBQUM7SUFLOUIsWUFBWSxJQUFVLEVBQUUsTUFBYyxFQUFFLE1BQWMsRUFBRSxVQUE0QixFQUFFLElBQVksR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