@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,97 +0,0 @@
1
- import { ApplicationException, Debug, NString } from "@magic-xpa/mscorelib";
2
- import { Logger } from "@magic-xpa/utils";
3
- import { ConstInterface } from "../ConstInterface";
4
- import { HttpClientEvents } from "./client/HttpClientEvents";
5
- import { HttpClientSync } from "./client/HttpClientSync";
6
- import { HttpClientAsync } from "./client/HttpClientAsync";
7
- export class HttpManager {
8
- getHttpClient() {
9
- if (this.IsAbortingMagicEngine)
10
- return new HttpClientSync();
11
- return this._httpClientAsync;
12
- }
13
- set HttpCommunicationTimeoutMS(value) {
14
- this._httpCommunicationTimeoutMS = value;
15
- }
16
- static setNativeHttpClient(httpClient) {
17
- HttpManager._nativeHttpClient = httpClient;
18
- }
19
- static GetInstance() {
20
- if (HttpManager._instance === null) {
21
- HttpManager._instance = new HttpManager();
22
- }
23
- return HttpManager._instance;
24
- }
25
- get IsAbortingMagicEngine() { return this._isAbortingMagicEngine; }
26
- set IsAbortingMagicEngine(isAbortingMagicEngine) { this._isAbortingMagicEngine = isAbortingMagicEngine; }
27
- constructor() {
28
- this._httpCommunicationTimeoutMS = HttpManager.DEFAULT_HTTP_COMMUNICATION_TIMEOUT;
29
- this._httpClientAsync = null;
30
- this._isAbortingMagicEngine = false;
31
- this._httpClientAsync = new HttpClientAsync(HttpManager._nativeHttpClient);
32
- this.RegisterBasicDelegates();
33
- }
34
- RegisterBasicDelegates() {
35
- HttpClientEvents.GetHttpCommunicationTimeout_Event = this.GetHttpCommunicationTimeoutMS.bind(this);
36
- }
37
- GetHttpCommunicationTimeoutMS() {
38
- return this._httpCommunicationTimeoutMS;
39
- }
40
- SetCommunicationsFailureHandler(handler) {
41
- this.getHttpClient().CommunicationsFailureHandler = handler;
42
- }
43
- async GetContent(requestedURL, requestContent, useCache, isError) {
44
- let response;
45
- Debug.Assert(this.getHttpClient() != null);
46
- try {
47
- Logger.Instance.WriteServerToLog("*************************************************************************************************");
48
- isError.value = false;
49
- Logger.Instance.WriteServerToLog(requestedURL);
50
- HttpManager.LogAccessToServer("", requestContent);
51
- response = await this.getHttpClient().GetContent(requestedURL, requestContent, useCache);
52
- Debug.Assert(response !== null);
53
- let errorResponse = HttpManager.CheckAndGetErrorResponse(response);
54
- if (errorResponse !== null) {
55
- response = errorResponse;
56
- isError.value = true;
57
- }
58
- return response;
59
- }
60
- catch (ex) {
61
- let url = new URL(requestedURL);
62
- throw new ApplicationException(ex.Message + "\n" + url.origin + url.pathname, ex);
63
- }
64
- finally {
65
- }
66
- }
67
- static CheckAndGetErrorResponse(httpResponse) {
68
- let errorResponse = null;
69
- if (httpResponse.startsWith(ConstInterface.V24_RIA_ERROR_PREFIX))
70
- errorResponse = httpResponse.substr(ConstInterface.V24_RIA_ERROR_PREFIX.length);
71
- return errorResponse;
72
- }
73
- static LogAccessToServer(msg, requestContent) {
74
- if (Logger.Instance.ShouldLogServerRelatedMessages()) {
75
- if (!NString.IsNullOrEmpty(msg)) {
76
- msg = msg + "; accessing server ...";
77
- }
78
- if (requestContent === null) {
79
- if (!NString.IsNullOrEmpty(msg)) {
80
- Logger.Instance.WriteServerToLog(msg);
81
- }
82
- }
83
- else {
84
- if (!NString.IsNullOrEmpty(msg)) {
85
- msg = msg + " ";
86
- }
87
- msg = msg + "uploading " + requestContent.length + " bytes";
88
- Logger.Instance.WriteServerToLog(msg);
89
- }
90
- }
91
- }
92
- }
93
- HttpManager._instance = null;
94
- HttpManager.DEFAULT_HTTP_COMMUNICATION_TIMEOUT = 5 * 1000;
95
- HttpManager.DEFAULT_OFFLINE_HTTP_COMMUNICATION_TIMEOUT = 2 * 1000;
96
- HttpManager._nativeHttpClient = null;
97
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiSHR0cE1hbmFnZXIuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi9wcm9qZWN0cy9lbmdpbmUvc3JjL2h0dHAvSHR0cE1hbmFnZXIudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUFDLG9CQUFvQixFQUFFLEtBQUssRUFBRSxPQUFPLEVBQVcsTUFBTSxzQkFBc0IsQ0FBQztBQUNwRixPQUFPLEVBQUMsTUFBTSxFQUFDLE1BQU0sa0JBQWtCLENBQUM7QUFFeEMsT0FBTyxFQUFDLGNBQWMsRUFBQyxNQUFNLG1CQUFtQixDQUFDO0FBRWpELE9BQU8sRUFBQyxnQkFBZ0IsRUFBQyxNQUFNLDJCQUEyQixDQUFDO0FBRTNELE9BQU8sRUFBQyxjQUFjLEVBQUMsTUFBTSx5QkFBeUIsQ0FBQztBQUN2RCxPQUFPLEVBQUMsZUFBZSxFQUFDLE1BQU0sMEJBQTBCLENBQUM7QUFFekQsTUFBTSxPQUFPLFdBQVc7SUFTZCxhQUFhO1FBR25CLElBQUcsSUFBS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ICB9XHJcblxyXG4gICAgICAgIHJldHVybiByZXNwb25zZTtcclxuICAgIH1cclxuICAgIGNhdGNoIChleCkge1xyXG4gICAgICAvLyBUT0RPOiByZWxhdGl2ZSByZXF1ZXN0ZWRVUkwgZG9lc24ndCB3b3JrIGhlcmUuXHJcbiAgICAgIGxldCB1cmw6IFVSTCA9IG5ldyBVUkwocmVxdWVzdGVkVVJMKTtcclxuICAgICAgdGhyb3cgbmV3IEFwcGxpY2F0aW9uRXhjZXB0aW9uKGV4Lk1lc3NhZ2UgKyBcIlxcblwiICsgdXJsLm9yaWdpbiArIHVybC5wYXRobmFtZSwgZXgpO1xyXG4gICAgfVxyXG4gICAgZmluYWxseSB7XHJcbiAgICAgIC8vIFRPRE86IEltcGxlbWVudCBpbiBXZWJDbGllbnQuXHJcbiAgICAgIC8vIEhvdyBkbyB3ZSBrbm93IGlmIHRoZSBjb250ZW50cyB3ZXJlIHJldHVybmVkIGZvcm0gYnJvd3NlciBjYWNoZT9cclxuICAgICAgLy8gbGV0IGVsYXBzZWRUaW1lOiBudW1iZXIgPSBNaXNjLmdldFN5c3RlbU1pbGxpc2Vjb25kcygpIC0gc3RhcnRUaW1lO1xyXG5cclxuICAgICAgLy8gTG9nZ2VyLkluc3RhbmNlLldyaXRlU2VydmVyVG9Mb2coXHJcbiAgICAgIC8vICAgICAgICAgICAgICAgc3RyaW5nLkZvcm1hdChcclxuICAgICAgLy8gICAgICAgICAgICAgICAgICBcIkNvbXBsZXRlZCB7MH06IHsxOk4wfSBtcywgYWNjdW11bGF0ZWQ6IHsyOk4wfSBtcyAoc2VydmVyOiB7MzpOMH0pLCB7NH17NX17Nn0qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKlwiLFxyXG4gICAgICAvLyAgICAgICAgICAgICAgICAgIChjYWNoaW5nU3RyYXRlZ3kuRm91bmRJbkNhY2hlXHJcbiAgICAgIC8vICAgICAgICAgICAgICAgICAgICAgID8gXCJcIlxyXG4gICAgICAvLyAgICAgICAgICAgICAgICAgICAgICA6IE5TdHJpbmcuRm9ybWF0KFwiI3swOk4wfVwiLCBTdGF0aXN0aWNzLkdldFJlcXVlc3RzQ250KCkpXHJcbiAgICAgIC8vICAgICAgICAgICAgICAgICAgKSxcclxuICAgICAgLy8gICAgICAgICAgICAgICAgICBlbGFwc2VkVGltZSxcclxuICAgICAgLy8gICAgICAgICAgICAgICAgICBTdGF0aXN0aWNzLkdldEFjY3VtdWxhdGVkRXh0ZXJuYWxUaW1lKCksIFN0YXRpc3RpY3MuR2V0QWNjdW11bGF0ZWRTZXJ2ZXJUaW1lKCksXHJcbiAgICAgIC8vICAgICAgICAgICAgICAgICAgKGNhY2hpbmdTdHJhdGVneS5Gb3VuZEluQ2FjaGVcclxuICAgICAgLy8gICAgICAgICAgICAgICAgICAgICAgPyBcIlwiXHJcbiAgICAgIC8vICAgICAgICAgICAgICAgICAgICAgIDogKHJlc3BvbnNlICE9IG51bGxcclxuICAgICAgLy8gICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBOU3RyaW5nLkZvcm1hdChcInswOk4wfSBieXRlcyBkb3dubG9hZGVkXCIsIHJlc3BvbnNlLmxlbmd0aClcclxuICAgICAgLy8gICAgICAgICAgICAgICAgICAgICAgICAgICAgOiBcIk51bGwgcmVzcG9uc2UhXCIpXHJcbiAgICAgIC8vICAgICAgICAgICAgICAgICAgKSxcclxuICAgICAgLy8gICAgICAgICAgICAgICAgICBPU0Vudmlyb25tZW50LkVvbFNlcSwgT1NFbnZpcm9ubWVudC5UYWJTZXEpXHJcbiAgICAgIC8vICAgICAgICAgICAgICAgKTtcclxuICAgIH1cclxuICB9XHJcblxyXG4gIC8vLyA8c3VtbWFyeT5DaGVjayBpZiBhbiBIVFRQIHJlc3BvbnNlIGlzIGFuIGVycm9yIHJlc3BvbnNlLlxyXG4gIC8vLyA8cGFyYW0gbmFtZT1c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gICAgICAgIG1zZyA9IG1zZyArIFwiOyBhY2Nlc3Npbmcgc2VydmVyIC4uLlwiO1xyXG4gICAgICB9XHJcblxyXG4gICAgICBpZiAocmVxdWVzdENvbnRlbnQgPT09IG51bGwpIHtcclxuICAgICAgICBpZiAoIU5TdHJpbmcuSXNOdWxsT3JFbXB0eShtc2cpKSB7XHJcbiAgICAgICAgICBMb2dnZXIuSW5zdGFuY2UuV3JpdGVTZXJ2ZXJUb0xvZyhtc2cpO1xyXG4gICAgICAgIH1cclxuICAgICAgfVxyXG4gICAgICBlbHNlIHtcclxuICAgICAgICBpZiAoIU5TdHJpbmcuSXNOdWxsT3JFbXB0eShtc2cpKSB7XHJcbiAgICAgICAgICBtc2cgPSBtc2cgKyBcIiBcIjtcclxuICAgICAgICB9XHJcblxyXG4gICAgICAgIG1zZyA9IG1zZyArIFwidXBsb2FkaW5nIFwiICsgcmVxdWVzdENvbnRlbnQubGVuZ3RoICsgXCIgYnl0ZXNcIjtcclxuICAgICAgICBMb2dnZXIuSW5zdGFuY2UuV3JpdGVTZXJ2ZXJUb0xvZyhtc2cpO1xyXG4gICAgICB9XHJcbiAgICB9XHJcbiAgfVxyXG59XHJcbiJdfQ==
@@ -1,67 +0,0 @@
1
- import { HttpErrorResponse } from "@angular/common/http";
2
- import { NString, Thread, WebException } from "@magic-xpa/mscorelib";
3
- import { HttpClientBase, RequestMethod } from "./HttpClientBase";
4
- import { Logger, Logger_LogLevels, Logger_MessageDirection, Misc } from "@magic-xpa/utils";
5
- import { HttpClientEvents } from "./HttpClientEvents";
6
- export class HttpClientAsync extends HttpClientBase {
7
- constructor(httpClient) {
8
- super();
9
- this.httpClient = httpClient;
10
- }
11
- prepareRequest() {
12
- }
13
- addHeaders(urlString, useCache, httpHeaders, clientID) {
14
- if (!urlString.startsWith("/"))
15
- httpHeaders = httpHeaders.append("MgxpaRIAglobalUniqueSessionID", clientID);
16
- if (!useCache)
17
- httpHeaders = httpHeaders.append("Cache-Control", 'no-cache');
18
- return httpHeaders;
19
- }
20
- async sendRequestToServer(httpMethod, urlString, httpHeaders, requestContent, contentFromServer) {
21
- let httpResponse = await this.httpClient.request(RequestMethod[httpMethod], urlString, { headers: httpHeaders, responseType: "text", observe: "response", body: requestContent }).toPromise();
22
- contentFromServer.value = httpResponse.body;
23
- return httpResponse;
24
- }
25
- logResponse(httpResponse, clientID, urlString, contentFromServer, timeBeforeRequest) {
26
- let statusCode = httpResponse['status'];
27
- let responseTime = Misc.getSystemMilliseconds() - timeBeforeRequest;
28
- if (Logger.Instance.LogLevel === Logger_LogLevels.Basic)
29
- Logger.Instance.WriteBasicToLog(Logger_MessageDirection.MessageEntering, HttpClientEvents.GetRuntimeCtxID(), HttpClientEvents.GetSessionCounter(), clientID, HttpClientEvents.ShouldDisplayGenericError() ? "-" : new URL(urlString).host, responseTime, statusCode.toString(), JSON.stringify(httpResponse.headers), contentFromServer.value.length);
30
- }
31
- handleHttpErrorException(ex, urlString) {
32
- if (ex instanceof HttpErrorResponse) {
33
- let statusCode = ex['status'];
34
- if (statusCode === 404 || statusCode === 403)
35
- throw new WebException(new Error("bad URL: " + urlString + " - StatusCode = " + statusCode));
36
- }
37
- }
38
- async shouldRetry(httpCommunicationTimeoutMS, urlString, communicationsFailureHandler, ex, startTimeRef) {
39
- let currentDelayMS = Math.floor(httpCommunicationTimeoutMS / 10);
40
- let httpElapsedTimeMS = Misc.getSystemMilliseconds() - startTimeRef.value + currentDelayMS;
41
- if (httpElapsedTimeMS <= httpCommunicationTimeoutMS) {
42
- await Thread.Sleep(currentDelayMS);
43
- Logger.Instance.WriteWarningToLogWithMsg(NString.Format("Retrying {0} : elapsed time {1:N0}ms out of {2:N0}ms", urlString, httpElapsedTimeMS, httpCommunicationTimeoutMS));
44
- return true;
45
- }
46
- Logger.Instance.WriteWarningToLogWithMsg(NString.Format("{0} : http timeout {1:N0}ms expired", urlString, httpCommunicationTimeoutMS));
47
- if (communicationsFailureHandler != null) {
48
- communicationsFailureHandler.CommunicationFailed(urlString, ex);
49
- if (communicationsFailureHandler.ShouldRetryLastRequest) {
50
- Logger.Instance.WriteServerToLog(NString.Format("Retrying {0}, confirmed by user ...", urlString));
51
- startTimeRef.value = Misc.getSystemMilliseconds();
52
- return true;
53
- }
54
- }
55
- return false;
56
- }
57
- logAndThrowException(ex) {
58
- Logger.Instance.WriteWarningToLogWithMsg("Re-throwing ...");
59
- Logger.Instance.WriteWarningToLog(ex);
60
- throw new WebException(ex);
61
- }
62
- logExecutionAttempts(executionAttempts) {
63
- if (executionAttempts > 1)
64
- Logger.Instance.WriteServerToLog(NString.Format("Succeeded after {0} attempts ...", executionAttempts));
65
- }
66
- }
67
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiSHR0cENsaWVudEFzeW5jLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vLi4vLi4vcHJvamVjdHMvZW5naW5lL3NyYy9odHRwL2NsaWVudC9IdHRwQ2xpZW50QXN5bmMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUFhLGlCQUFpQixFQUE0QixNQUFNLHNCQUFzQixDQUFDO0FBQzlGLE9BQU8sRUFBQyxPQUFPLEVBQVksTUFBTSxFQUFFLFlBQVksRUFBQyxNQUFNLHNCQUFzQixDQUFDO0FBQzdFLE9BQU8sRUFBQyxjQUFjLEVBQUUsYUFBYSxFQUFDLE1BQU0sa0JBQWtCLENBQUM7QUFDL0QsT0FBTyxFQUFDLE1BQU0sRUFBRSxnQkFBZ0IsRUFBRSx1QkFBdUIsRUFBRSxJQUFJLEVBQUMsTUFBTSxrQkFBa0IsQ0FBQztBQUN6RixPQUFPLEVBQUMsZ0JBQWdCLEVBQUMsTUFBTSxvQkFBb0IsQ0FBQztBQUlwRCxNQUFNLE9BQU8sZUFBZ0IsU0FBUSxjQUFjO0lBQ2pELFlBQW9CLFVBQXNCO1FBQ3hDLEtBQUss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uSW5zdGFuY2UuTG9nTGV2ZWwgPT09IExvZ2dlcl9Mb2dMZXZlbHMuQmFzaWMpXHJcbiAgICAgIExvZ2dlci5JbnN0YW5jZS5Xcml0ZUJhc2ljVG9Mb2coTG9nZ2VyX01lc3NhZ2VEaXJlY3Rpb24uTWVzc2FnZUVudGVyaW5nLFxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEh0dHBDbGllbnRFdmVudHMuR2V0UnVudGltZUN0eElEKCksXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgSHR0cENsaWVudEV2ZW50cy5HZXRTZXNzaW9uQ291bnRlcigpLFxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNsaWVudElELFxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEh0dHBDbGllbnRFdmVudHMuU2hvdWxkRGlzcGxheUdlbmVyaWNFcnJvcigpID8gXCItXCIgOiBuZXcgVVJMKHVybFN0cmluZykuaG9zdCxcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXNwb25zZVRpbWUsXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RhdHVzQ29kZS50b1N0cmluZygpLFxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEpTT04uc3RyaW5naWZ5KGh0dHBSZXNwb25zZS5oZWFkZXJzKSxcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb250ZW50RnJvbVNlcnZlci52YWx1ZS5sZW5ndGgpO1xyXG4gIH1cclxuXHJcbiAgaGFuZGxlSHR0cEVycm9yRXhjZXB0aW9uKGV4OiBhbnksIHVybFN0cmluZzogc3RyaW5nKSB7XHJcbiAgICBpZiAoZXggaW5zdGFuY2VvZiBIdHRwRXJyb3JSZXNwb25zZSlcclxuICAgIHtcclxuICAgICAgbGV0IHN0YXR1c0NvZGUgP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N0YW5jZS5Xcml0ZVdhcm5pbmdUb0xvZ1dpdGhNc2coXCJSZS10aHJvd2luZyAuLi5cIik7XHJcbiAgICBMb2dnZXIuSW5zdGFuY2UuV3JpdGVXYXJuaW5nVG9Mb2coZXgpO1xyXG4gICAgdGhyb3cgbmV3IFdlYkV4Y2VwdGlvbihleCk7XHJcbiAgfVxyXG5cclxuICBsb2dFeGVjdXRpb25BdHRlbXB0cyhleGVjdXRpb25BdHRlbXB0czogbnVtYmVyKVxyXG4gIHtcclxuICAgIGlmIChleGVjdXRpb25BdHRlbXB0cyA+IDEpXHJcbiAgICAgIExvZ2dlci5JbnN0YW5jZS5Xcml0ZVNlcnZlclRvTG9nKE5TdHJpbmcuRm9ybWF0KFwiU3VjY2VlZGVkIGFmdGVyIHswfSBhdHRlbXB0cyAuLi5cIiwgZXhlY3V0aW9uQXR0ZW1wdHMpKTtcclxuICB9XHJcbn1cclxuIl19
@@ -1,39 +0,0 @@
1
- export class HttpClientEvents {
2
- static GetHttpCommunicationTimeout() {
3
- return (HttpClientEvents.GetHttpCommunicationTimeout_Event !== null) ? HttpClientEvents.GetHttpCommunicationTimeout_Event() : 5000;
4
- }
5
- static GetExecutionProperty(propertyName) {
6
- return (HttpClientEvents.GetExecutionProperty_Event !== null) ? HttpClientEvents.GetExecutionProperty_Event(propertyName) : null;
7
- }
8
- static GetGlobalUniqueSessionID() {
9
- return (HttpClientEvents.GetGlobalUniqueSessionID_Event !== null) ? HttpClientEvents.GetGlobalUniqueSessionID_Event() : null;
10
- }
11
- static ShouldDisplayGenericError() {
12
- return HttpClientEvents.ShouldDisplayGenericError_Event === null || HttpClientEvents.ShouldDisplayGenericError_Event();
13
- }
14
- static GetRuntimeCtxID() {
15
- return (HttpClientEvents.GetRuntimeCtxID_Event !== null) ? HttpClientEvents.GetRuntimeCtxID_Event() : "";
16
- }
17
- static GetSessionCounter() {
18
- return (HttpClientEvents.GetSessionCounter_Event !== null) ? HttpClientEvents.GetSessionCounter_Event() : 0;
19
- }
20
- static CheckAndSetSessionCounter(value) {
21
- let flag = HttpClientEvents.CheckAndSetSessionCounter_Event !== null;
22
- if (flag) {
23
- HttpClientEvents.CheckAndSetSessionCounter_Event(value);
24
- }
25
- }
26
- static ComputeAndLogRequestInfo(contentLength, roundTrip, isLoggingResponse) {
27
- if (HttpClientEvents.ComputeAndLogRequestInfo_Event !== null)
28
- HttpClientEvents.ComputeAndLogRequestInfo_Event(contentLength, roundTrip, isLoggingResponse);
29
- }
30
- }
31
- HttpClientEvents.GetHttpCommunicationTimeout_Event = null;
32
- HttpClientEvents.GetExecutionProperty_Event = null;
33
- HttpClientEvents.GetGlobalUniqueSessionID_Event = null;
34
- HttpClientEvents.ShouldDisplayGenericError_Event = null;
35
- HttpClientEvents.GetRuntimeCtxID_Event = null;
36
- HttpClientEvents.GetSessionCounter_Event = null;
37
- HttpClientEvents.CheckAndSetSessionCounter_Event = null;
38
- HttpClientEvents.ComputeAndLogRequestInfo_Event = null;
39
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiSHR0cENsaWVudEV2ZW50cy5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uLy4uLy4uL3Byb2plY3RzL2VuZ2luZS9zcmMvaHR0cC9jbGllbnQvSHR0cENsaWVudEV2ZW50cy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxNQUFNLE9BQU8sZ0JBQWdCO0lBVTNCLE1BQU0sQ0FBQywyQkFBMkI7UUFDaEMsT0FBTyxDQUFDLGdCQUFnQixDQUFDLGlDQUFpQyxLQUFLLElBQUksQ0FBQyxDQUFDLENBQUMsQ0FBQyxnQkFBZ0IsQ0FBQyxpQ0FBaUMsRUFBRSxDQUFDLENBQUMsQ0FBQyxJQUFJLENBQUM7SUFDckksQ0FBQztJQUVELE1BQU0sQ0FBQyxvQkFBb0IsQ0FBQyxZQUFvQjtRQUM5QyxPQUFP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RwQ2xpZW50RXZlbnRzLkNoZWNrQW5kU2V0U2Vzc2lvbkNvdW50ZXJfRXZlbnQodmFsdWUpO1xyXG4gICAgfVxyXG4gIH1cclxuXHJcbiAgc3RhdGljIENvbXB1dGVBbmRMb2dSZXF1ZXN0SW5mbyhjb250ZW50TGVuZ3RoOiBudW1iZXIsIHJvdW5kVHJpcDogbnVtYmVyLCBpc0xvZ2dpbmdSZXNwb25zZTogYm9vbGVhbik6IHZvaWQge1xyXG4gICAgaWYgKEh0dHBDbGllbnRFdmVudHMuQ29tcHV0ZUFuZExvZ1JlcXVlc3RJbmZvX0V2ZW50ICE9PSBudWxsKVxyXG4gICAgICBIdHRwQ2xpZW50RXZlbnRzLkNvbXB1dGVBbmRMb2dSZXF1ZXN0SW5mb19FdmVudChjb250ZW50TGVuZ3RoLCByb3VuZFRyaXAsIGlzTG9nZ2luZ1Jlc3BvbnNlKTtcclxuICB9XHJcbn1cclxuIl19
@@ -1,42 +0,0 @@
1
- import { NString } from "@magic-xpa/mscorelib";
2
- import { HttpClientBase } from "./HttpClientBase";
3
- import { Logger, Logger_LogLevels, Logger_MessageDirection, Misc } from "@magic-xpa/utils";
4
- import { HttpClientEvents } from "./HttpClientEvents";
5
- export class HttpClientSync extends HttpClientBase {
6
- constructor() {
7
- super();
8
- this.httpRequest = null;
9
- this.headers = new Headers();
10
- }
11
- prepareRequest() {
12
- }
13
- addHeaders(urlString, useCache, httpHeaders, clientID) {
14
- if (!urlString.startsWith("/")) {
15
- this.headers.append("MgxpaRIAglobalUniqueSessionID", clientID);
16
- }
17
- if (!useCache) {
18
- this.headers.append("Cache-Control", "no-cache");
19
- }
20
- return httpHeaders;
21
- }
22
- async sendRequestToServer(httpMethod, urlString, httpHeaders, requestContent, contentFromServer) {
23
- await fetch(urlString, { method: 'POST', headers: this.headers, body: requestContent, keepalive: true });
24
- return NString.Empty;
25
- }
26
- logResponse(httpResponse, clientID, urlString, contentFromServer, timeBeforeRequest) {
27
- let responseTime = Misc.getSystemMilliseconds() - timeBeforeRequest;
28
- if (Logger.Instance.LogLevel === Logger_LogLevels.Basic)
29
- Logger.Instance.WriteBasicToLog(Logger_MessageDirection.MessageEntering, HttpClientEvents.GetRuntimeCtxID(), HttpClientEvents.GetSessionCounter(), clientID, HttpClientEvents.ShouldDisplayGenericError() ? "-" : new URL(urlString).host, responseTime, this.httpRequest.status.toString(), JSON.stringify(this.httpRequest.getAllResponseHeaders()), contentFromServer.value.length);
30
- }
31
- handleHttpErrorException(ex, urlString) {
32
- throw ex;
33
- }
34
- async shouldRetry(httpCommunicationTimeoutMS, urlString, communicationsFailureHandler, ex, startTimeRef) {
35
- return Promise.resolve(false);
36
- }
37
- logAndThrowException(ex) {
38
- }
39
- logExecutionAttempts(executionAttempts) {
40
- }
41
- }
42
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiSHR0cENsaWVudFN5bmMuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi8uLi9wcm9qZWN0cy9lbmdpbmUvc3JjL2h0dHAvY2xpZW50L0h0dHBDbGllbnRTeW5jLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUNBLE9BQU8sRUFBQyxPQUFPLEVBQVcsTUFBTSxzQkFBc0IsQ0FBQztBQUN2RCxPQUFPLEVBQUMsY0FBYyxFQUFnQixNQUFNLGtCQUFrQixDQUFDO0FBQy9ELE9BQU8sRUFBQyxNQUFNLEVBQUUsZ0JBQWdCLEVBQUUsdUJBQXVCLEVBQUUsSUFBSSxFQUFDLE1BQU0sa0JBQWtCLENBQUM7QUFDekYsT0FBTyxFQUFDLGdCQUFnQixFQUFDLE1BQU0sb0JBQW9CLENBQUM7QUFJcEQsTUFBTSxPQUFPLGNBQWUsU0FBUSxjQUFjO0lBS2hEO1FBRUUsS0FBSyxFQUFFLENBQUM7UUFMRixnQkFBVyxHQUFtQixJQUFJLENBQUM7UUFDbkMsW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mVzcG9uc2VUaW1lOiBudW1iZXIgPSBNaXNjLmdldFN5c3RlbU1pbGxpc2Vjb25kcygpIC0gdGltZUJlZm9yZVJlcXVlc3Q7XHJcblxyXG4gICAgaWYgKExvZ2dlci5JbnN0YW5jZS5Mb2dMZXZlbCA9PT0gTG9nZ2VyX0xvZ0xldmVscy5CYXNpYylcclxuICAgICAgTG9nZ2VyLkluc3RhbmNlLldyaXRlQmFzaWNUb0xvZyhMb2dnZXJfTWVzc2FnZURpcmVjdGlvbi5NZXNzYWdlRW50ZXJpbmcsXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgSHR0cENsaWVudEV2ZW50cy5HZXRSdW50aW1lQ3R4SUQoKSxcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBIdHRwQ2xpZW50RXZlbnRzLkdldFNlc3Npb25Db3VudGVyKCksXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2xpZW50SUQsXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgSHR0cENsaWVudEV2ZW50cy5TaG91bGREaXNwbGF5R2VuZXJpY0Vycm9yKCkgPyBcIi1cIiA6IG5ldyBVUkwodXJsU3RyaW5nKS5ob3N0LFxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlc3BvbnNlVGltZSxcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aGlzLmh0dHBSZXF1ZXN0LnN0YXR1cy50b1N0cmluZygpLFxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEpTT04uc3RyaW5naWZ5KHRoaXMuaHR0cFJlcXVlc3QuZ2V0QWxsUmVzcG9uc2VIZWFkZXJzKCkpLFxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnRlbnRGcm9tU2VydmVyLnZhbHVlLmxlbmd0aCk7XHJcbiAgfVxyXG5cclxuICBoYW5kbGVIdHRwRXJyb3JFeGNlcHRpb24oZXg6IGFueSwgdXJsU3RyaW5nOiBzdHJpbmcpXHJcbiAge1xyXG4gICAgLy8gTm8gZXhjZXB0aW9uIGhhbmRsaW5nIGZvciBsYXN0IHJlcXVlc3QgYW5kIGhlbmNlIGp1c3QgdGhyb3cgdGhlIGV4Y2VwdGlvblxyXG4gICAgdGhyb3cgZXg7XHJcbiAgfVxyXG5cclxuICBhc3luYyBzaG91bGRSZXRyeShodHRwQ29tbXVuaWNhdGlvblRpbWVvdXRNUzogbnVtYmVyLCB1cmxTdHJpbmc6IHN0cmluZywgY29tbXVuaWNhdGlvbnNGYWlsdXJlSGFuZGxlcjogSUNvbW11bmljYXRpb25zRmFpbHVyZUhhbmRsZXIsIGV4OiBhbnksIHN0YXJ0VGltZVJlZjogUmVmUGFyYW08bnVtYmVyPik6IFByb21pc2U8Ym9vbGVhbj5cclxuICB7XHJcbiAgICAvLyBObyByZXRyeSBzdXBwb3J0ZWQgb24gbGFzdCByZXF1ZXN0XHJcbiAgICByZXR1cm4gUHJvbWlzZS5yZXNvbHZlKGZhbHNlKTtcclxuICB9XHJcblxyXG4gIGxvZ0FuZFRocm93RXhjZXB0aW9uKGV4KVxyXG4gIHtcclxuICAgIC8vIE4uQS5cclxuICB9XHJcblxyXG4gIGxvZ0V4ZWN1dGlvbkF0dGVtcHRzKGV4ZWN1dGlvbkF0dGVtcHRzOiBudW1iZXIpXHJcbiAge1xyXG4gICAgLy8gTi5BLlxyXG4gIH1cclxufVxyXG4iXX0=
@@ -1,84 +0,0 @@
1
- import { Encoding, NString } from "@magic-xpa/mscorelib";
2
- import { Logger } from "@magic-xpa/utils";
3
- export class HttpUtility {
4
- static ASCIIGetString(bytes) {
5
- return Encoding.ASCII.GetString(bytes, 0, bytes.length);
6
- }
7
- static IntToHexCharCode(n) {
8
- if (n <= 9)
9
- return n + 0x30;
10
- return (n - 10) + 0X61;
11
- }
12
- static IsSafe(ch) {
13
- if ((ch >= 'a' && ch <= 'z') ||
14
- (ch >= 'A' && ch <= 'Z') ||
15
- (ch >= '0' && ch <= '9'))
16
- return true;
17
- switch (ch) {
18
- case '\'':
19
- case '(':
20
- case ')':
21
- case '*':
22
- case '-':
23
- case '.':
24
- case '_':
25
- case '!':
26
- return true;
27
- }
28
- return false;
29
- }
30
- static UrlEncode(str, e) {
31
- let encodedStr = null;
32
- if (str !== null) {
33
- encodedStr = HttpUtility.ASCIIGetString(HttpUtility.UrlEncodeToBytes(str, e));
34
- Logger.Instance.WriteServerMessagesToLog(NString.Format("\n String: {0} \n UrlEncoded by: {1} \n To: {2}", str, e, encodedStr));
35
- }
36
- return encodedStr;
37
- }
38
- static UrlEncodeToBytes(str, e) {
39
- if (str === null) {
40
- return null;
41
- }
42
- let bytes = e.GetBytes(str);
43
- return HttpUtility.UrlEncodeBytesToBytesInternal(bytes, 0, bytes.length);
44
- }
45
- static UrlEncodeBytesToBytesInternal(bytes, offset, count) {
46
- if (!HttpUtility.EncodingEnabled) {
47
- return bytes;
48
- }
49
- let num = 0;
50
- let num2 = 0;
51
- for (let i = 0; i < count; i++) {
52
- let ch = String.fromCharCode(bytes[offset + i]);
53
- if (ch === ' ') {
54
- num = num++;
55
- }
56
- else if (!HttpUtility.IsSafe(ch)) {
57
- num2 = num2 + 1;
58
- }
59
- }
60
- if (num === 0 && num2 === 0) {
61
- return bytes;
62
- }
63
- let buffer = new Uint8Array(count + num2 * 2);
64
- let num4 = 0;
65
- for (let j = 0; j < count; j++) {
66
- let num6 = bytes[offset + j];
67
- let ch = String.fromCharCode(num6);
68
- if (HttpUtility.IsSafe(ch)) {
69
- buffer[num4++] = num6;
70
- }
71
- else if (ch === ' ') {
72
- buffer[num4++] = 0X2b;
73
- }
74
- else {
75
- buffer[num4++] = 0X25;
76
- buffer[num4++] = HttpUtility.IntToHexCharCode(num6 >> 4 & 15);
77
- buffer[num4++] = HttpUtility.IntToHexCharCode(num6 & 15);
78
- }
79
- }
80
- return buffer;
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ztcclxuICAgIH1cclxuXHJcbiAgICBsZXQgYnVmZmVyOiBVaW50OEFycmF5ID0gbmV3IFVpbnQ4QXJyYXkoY291bnQgKyBudW0yICogMik7XHJcbiAgICBsZXQgbnVtNDogbnVtYmVyID0gMDtcclxuICAgIGZvciAobGV0IGo6IG51bWJlciA9IDA7IGogPCBjb3VudDsgaisrKSB7XHJcbiAgICAgIGxldCBudW02OiBudW1iZXIgPSBieXRlc1tvZmZzZXQgKyBqXTtcclxuICAgICAgLy8gVE9ETzogQ29uc2lkZXIgc2VuZGluZyBudW1iZXIgaW5zdGVhZCBvZiBjcmVhdGluZyBhIG5ldyBzdHJpbmcgZm9yIGVhY2ggYnl0ZS5cclxuICAgICAgbGV0IGNoOiBzdHJpbmcgPSBTdHJpbmcuZnJvbUNoYXJDb2RlKG51bTYpO1xyXG4gICAgICBpZiAoSHR0cFV0aWxpdHkuSXNTYWZlKGNoKSkge1xyXG4gICAgICAgIGJ1ZmZlcltudW00KytdID0gbnVtNjtcclxuICAgICAgfVxyXG4gICAgICBlbHNlIGlmIChjaCA9PT0gJyAnKSB7XHJcbiAgICAgICAgICBidWZmZXJbbnVtNCsrXSA9IDBYMmI7XHJcbiAgICAgIH1cclxuICAgICAgZWxzZSB7XHJcbiAgICAgICAgYnVmZmVyW251bTQrK10gPSAwWDI1O1xyXG4gICAgICAgIGJ1ZmZlcltudW00KytdID0gSHR0cFV0aWxpdHkuSW50VG9IZXhDaGFyQ29kZShudW02ID4+IDQgJiAxNSk7XHJcbiAgICAgICAgYnVmZmVyW251bTQrK10gPSBIdHRwVXRpbGl0eS5JbnRUb0hleENoYXJDb2RlKG51bTYgJiAxNSk7XHJcbiAgICAgIH1cclxuICAgIH1cclxuXHJcbiAgICByZXR1cm4gYnVmZmVyO1xyXG4gIH1cclxufVxyXG4iXX0=