@magic-xpa/engine 4.1100.0-dev4110.19 → 4.1100.0-dev4110.191

Sign up to get free protection for your applications and to get access to all the features.
Files changed (515) hide show
  1. package/{esm2020 → esm2022}/index.mjs +188 -188
  2. package/{esm2020 → esm2022}/magic-xpa-engine.mjs +1 -1
  3. package/esm2022/src/AccessHelper.mjs +15 -0
  4. package/esm2022/src/ClientManager.mjs +399 -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 +516 -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 +154 -0
  14. package/{esm2020 → esm2022}/src/ICommandsTable.mjs +1 -1
  15. package/esm2022/src/ServerConfig.mjs +118 -0
  16. package/{esm2020 → esm2022}/src/bridge/IGuiEvent.mjs +19 -19
  17. package/{esm2020 → esm2022}/src/bridge/MagicBridge.mjs +40 -40
  18. package/esm2022/src/commands/ClientOriginatedCommandTaskTag.mjs +12 -0
  19. package/{esm2020 → esm2022}/src/commands/ClientToServer/AddUserLocateDataViewCommand.mjs +8 -8
  20. package/{esm2020 → esm2022}/src/commands/ClientToServer/AddUserRangeDataviewCommand.mjs +9 -9
  21. package/{esm2020 → esm2022}/src/commands/ClientToServer/AddUserSortDataViewCommand.mjs +9 -9
  22. package/{esm2020 → esm2022}/src/commands/ClientToServer/BrowserEscEventCommand.mjs +23 -23
  23. package/{esm2020 → esm2022}/src/commands/ClientToServer/ClientOriginatedCommand.mjs +14 -14
  24. package/esm2022/src/commands/ClientToServer/ClientOriginatedCommandSerializer.mjs +60 -0
  25. package/{esm2020 → esm2022}/src/commands/ClientToServer/ColumnSortEventCommand.mjs +26 -26
  26. package/esm2022/src/commands/ClientToServer/CommandFactory.mjs +260 -0
  27. package/esm2022/src/commands/ClientToServer/CommandSerializationHelper.mjs +67 -0
  28. package/{esm2020 → esm2022}/src/commands/ClientToServer/ComputeEventCommand.mjs +23 -23
  29. package/{esm2020 → esm2022}/src/commands/ClientToServer/ContextTerminationEventCommand.mjs +20 -20
  30. package/{esm2020 → esm2022}/src/commands/ClientToServer/ContextTimeoutResetCommand.mjs +19 -19
  31. package/{esm2020 → esm2022}/src/commands/ClientToServer/ControlItemsRefreshCommand.mjs +8 -8
  32. package/esm2022/src/commands/ClientToServer/DataViewOutputCommand.mjs +13 -0
  33. package/{esm2020 → esm2022}/src/commands/ClientToServer/DataviewCommand.mjs +44 -44
  34. package/esm2022/src/commands/ClientToServer/EvaluateCommand.mjs +37 -0
  35. package/esm2022/src/commands/ClientToServer/EventCommand.mjs +40 -0
  36. package/esm2022/src/commands/ClientToServer/ExecOperCommand.mjs +67 -0
  37. package/esm2022/src/commands/ClientToServer/FetchDataControlValuesEventCommand.mjs +22 -0
  38. package/{esm2020 → esm2022}/src/commands/ClientToServer/GlobalParamsQueryCommand.mjs +10 -10
  39. package/{esm2020 → esm2022}/src/commands/ClientToServer/ICommandTaskTag.mjs +1 -1
  40. package/{esm2020 → esm2022}/src/commands/ClientToServer/IndexChangeEventCommand.mjs +21 -21
  41. package/esm2022/src/commands/ClientToServer/IniputForceWriteCommand.mjs +23 -0
  42. package/{esm2020 → esm2022}/src/commands/ClientToServer/NonReversibleExitEventCommand.mjs +23 -23
  43. package/{esm2020 → esm2022}/src/commands/ClientToServer/QueryCommand.mjs +20 -20
  44. package/esm2022/src/commands/ClientToServer/RecomputeCommand.mjs +27 -0
  45. package/esm2022/src/commands/ClientToServer/RefreshEventCommand.mjs +27 -0
  46. package/esm2022/src/commands/ClientToServer/RefreshScreenEventCommand.mjs +24 -0
  47. package/esm2022/src/commands/ClientToServer/RollbackEventCommand.mjs +40 -0
  48. package/{esm2020 → esm2022}/src/commands/ClientToServer/SelectProgramCommand.mjs +14 -14
  49. package/{esm2020 → esm2022}/src/commands/ClientToServer/SetTransactionStateDataviewCommand.mjs +9 -9
  50. package/{esm2020 → esm2022}/src/commands/ClientToServer/SubformOpenEventCommand.mjs +21 -21
  51. package/esm2022/src/commands/ClientToServer/SubformRefreshEventCommand.mjs +24 -0
  52. package/esm2022/src/commands/ClientToServer/TransactionCommand.mjs +30 -0
  53. package/{esm2020 → esm2022}/src/commands/ClientToServer/UnloadCommand.mjs +14 -14
  54. package/esm2022/src/commands/ClientToServer/WriteMessageToServerLogCommand.mjs +18 -0
  55. package/esm2022/src/commands/DataViewCommandBase.mjs +8 -0
  56. package/{esm2020 → esm2022}/src/commands/IClientCommand.mjs +1 -1
  57. package/esm2022/src/commands/IClientTargetedCommand.mjs +13 -0
  58. package/{esm2020 → esm2022}/src/commands/IClientToServerCommandInfo.mjs +1 -1
  59. package/esm2022/src/commands/ServerToClient/AbortCommand.mjs +65 -0
  60. package/{esm2020 → esm2022}/src/commands/ServerToClient/AddLocateCommand.mjs +21 -21
  61. package/esm2022/src/commands/ServerToClient/AddRangeCommand.mjs +62 -0
  62. package/esm2022/src/commands/ServerToClient/AddSortCommand.mjs +33 -0
  63. package/esm2022/src/commands/ServerToClient/ClientRefreshCommand.mjs +25 -0
  64. package/esm2022/src/commands/ServerToClient/ClientTargetedCommandBase.mjs +24 -0
  65. package/esm2022/src/commands/ServerToClient/EnhancedVerifyCommand.mjs +45 -0
  66. package/esm2022/src/commands/ServerToClient/OpenURLCommand.mjs +221 -0
  67. package/{esm2020 → esm2022}/src/commands/ServerToClient/ResetLocateCommand.mjs +14 -14
  68. package/{esm2020 → esm2022}/src/commands/ServerToClient/ResetRangeCommand.mjs +14 -14
  69. package/{esm2020 → esm2022}/src/commands/ServerToClient/ResetSortCommand.mjs +14 -14
  70. package/esm2022/src/commands/ServerToClient/ResultCommand.mjs +37 -0
  71. package/esm2022/src/commands/ServerToClient/VerifyCommand.mjs +83 -0
  72. package/esm2022/src/commands/ServerToClient/XMLBasedCommandBuilder.mjs +132 -0
  73. package/{esm2020 → esm2022}/src/communications/IConnectionStateManager.mjs +1 -1
  74. package/esm2022/src/communications/InteractiveCommunicationsFailureHandler.mjs +15 -0
  75. package/{esm2020 → esm2022}/src/data/DataSourceIdKey.mjs +2 -2
  76. package/esm2022/src/data/DataView.mjs +1613 -0
  77. package/{esm2020 → esm2022}/src/data/DataViewBase.mjs +3 -3
  78. package/esm2022/src/data/DataviewManager.mjs +28 -0
  79. package/esm2022/src/data/DataviewManagerBase.mjs +15 -0
  80. package/esm2022/src/data/DvCache.mjs +67 -0
  81. package/esm2022/src/data/Field.mjs +646 -0
  82. package/esm2022/src/data/FieldBase.mjs +15 -0
  83. package/esm2022/src/data/FieldsTable.mjs +103 -0
  84. package/{esm2020 → esm2022}/src/data/IRecordsTable.mjs +1 -1
  85. package/esm2022/src/data/Key.mjs +88 -0
  86. package/esm2022/src/data/Record.mjs +866 -0
  87. package/{esm2020 → esm2022}/src/data/RecordOutOfDataViewException.mjs +15 -15
  88. package/esm2022/src/data/RecordsTable.mjs +267 -0
  89. package/esm2022/src/data/TaskTransactionManager.mjs +103 -0
  90. package/esm2022/src/data/XMLBasedDcValuesBuilder.mjs +74 -0
  91. package/{esm2020 → esm2022}/src/enums.mjs +23 -23
  92. package/esm2022/src/env/EnvVariablesTable.mjs +340 -0
  93. package/esm2022/src/env/Environment.mjs +487 -0
  94. package/{esm2020 → esm2022}/src/env/ILanguageData.mjs +1 -1
  95. package/esm2022/src/env/LanguageData.mjs +226 -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 +2975 -0
  102. package/{esm2020 → esm2022}/src/event/IEventsManager.mjs +6 -6
  103. package/esm2022/src/event/RunTimeEvent.mjs +392 -0
  104. package/{esm2020 → esm2022}/src/event/RunTimeEventBase.mjs +3 -3
  105. package/esm2022/src/event/UserEventsTable.mjs +47 -0
  106. package/esm2022/src/exp/ExpTable.mjs +57 -0
  107. package/esm2022/src/exp/Expression.mjs +200 -0
  108. package/esm2022/src/exp/ExpressionDict.mjs +727 -0
  109. package/esm2022/src/exp/ExpressionEvaluator.mjs +4206 -0
  110. package/esm2022/src/exp/ExpressionLocalJpn.mjs +314 -0
  111. package/esm2022/src/exp/GlobalParamsTable.mjs +85 -0
  112. package/esm2022/src/exp/YesNoExp.mjs +36 -0
  113. package/esm2022/src/gui/CreatedFormVector.mjs +23 -0
  114. package/esm2022/src/gui/FormsTable.mjs +66 -0
  115. package/esm2022/src/gui/MgControl.mjs +363 -0
  116. package/esm2022/src/gui/MgForm.mjs +1181 -0
  117. package/esm2022/src/http/HttpManager.mjs +97 -0
  118. package/esm2022/src/http/client/HttpClientAsync.mjs +68 -0
  119. package/esm2022/src/http/client/HttpClientBase.mjs +132 -0
  120. package/esm2022/src/http/client/HttpClientEvents.mjs +39 -0
  121. package/esm2022/src/http/client/HttpClientSync.mjs +42 -0
  122. package/esm2022/src/http/client/HttpUtility.mjs +84 -0
  123. package/{esm2020 → esm2022}/src/http/client/ICommunicationsFailureHandler.mjs +1 -1
  124. package/esm2022/src/remote/AddUserLocateRemoteDataViewCommand.mjs +18 -0
  125. package/esm2022/src/remote/AddUserRangeRemoteDataViewCommand.mjs +18 -0
  126. package/esm2022/src/remote/AddUserSortRemoteDataViewCommand.mjs +18 -0
  127. package/esm2022/src/remote/RemoteCommandsProcessor.mjs +882 -0
  128. package/esm2022/src/remote/RemoteControlItemsRefreshCommand.mjs +25 -0
  129. package/esm2022/src/remote/RemoteDataViewCommandBase.mjs +24 -0
  130. package/esm2022/src/remote/RemoteDataViewCommandFactory.mjs +61 -0
  131. package/{esm2020 → esm2022}/src/remote/RemoteDataViewCommandUpdateNonModifiable.mjs +15 -15
  132. package/{esm2020 → esm2022}/src/remote/RemoteDataviewManager.mjs +17 -17
  133. package/{esm2020 → esm2022}/src/remote/RemoteInitDataViewCommand.mjs +10 -10
  134. package/esm2022/src/remote/ResetUserLocateRemoteDataviewCommand.mjs +17 -0
  135. package/{esm2020 → esm2022}/src/remote/ResetUserRangeRemoteDataviewCommand.mjs +12 -12
  136. package/esm2022/src/remote/ResetUserSortRemoteDataviewCommand.mjs +16 -0
  137. package/esm2022/src/remote/ServerError.mjs +40 -0
  138. package/esm2022/src/remote/SetTransactionStateRemoteDataViewCommand.mjs +20 -0
  139. package/esm2022/src/rt/Argument.mjs +265 -0
  140. package/esm2022/src/rt/ArgumentsList.mjs +103 -0
  141. package/esm2022/src/rt/Boundary.mjs +152 -0
  142. package/esm2022/src/rt/CompMainPrgTable.mjs +63 -0
  143. package/{esm2020 → esm2022}/src/rt/DataviewHeaderBase.mjs +98 -96
  144. package/{esm2020 → esm2022}/src/rt/DataviewHeaderFactory.mjs +6 -6
  145. package/esm2022/src/rt/DataviewHeaders.mjs +53 -0
  146. package/esm2022/src/rt/DataviewHeadersSaxHandler.mjs +38 -0
  147. package/esm2022/src/rt/ExecutionStack.mjs +94 -0
  148. package/{esm2020 → esm2022}/src/rt/ExecutionStackEntry.mjs +17 -17
  149. package/esm2022/src/rt/HandlersTable.mjs +96 -0
  150. package/{esm2020 → esm2022}/src/rt/IDataSourceViewDefinition.mjs +1 -1
  151. package/{esm2020 → esm2022}/src/rt/IDataviewHeader.mjs +1 -1
  152. package/{esm2020 → esm2022}/src/rt/IResultValue.mjs +1 -1
  153. package/esm2022/src/rt/LastFocusedManager.mjs +65 -0
  154. package/esm2022/src/rt/Operation.mjs +735 -0
  155. package/esm2022/src/rt/OperationTable.mjs +67 -0
  156. package/esm2022/src/rt/Recompute.mjs +355 -0
  157. package/esm2022/src/rt/RecomputeTable.mjs +63 -0
  158. package/esm2022/src/rt/RemoteDataviewHeader.mjs +108 -0
  159. package/esm2022/src/rt/ResultValue.mjs +10 -0
  160. package/esm2022/src/rt/TableCache.mjs +177 -0
  161. package/esm2022/src/rt/TableCacheManager.mjs +67 -0
  162. package/esm2022/src/rt/Transaction.mjs +53 -0
  163. package/esm2022/src/security/UserDetails.mjs +71 -0
  164. package/{esm2020 → esm2022}/src/tasks/IMGDataCollection.mjs +1 -1
  165. package/esm2022/src/tasks/MGData.mjs +552 -0
  166. package/esm2022/src/tasks/MGDataCollection.mjs +252 -0
  167. package/esm2022/src/tasks/RCTimer.mjs +63 -0
  168. package/esm2022/src/tasks/RemoteTaskService.mjs +45 -0
  169. package/esm2022/src/tasks/Task.mjs +2497 -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 +29713 -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 +32 -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 +515 -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 +34 -34
  207. package/src/bridge/IGuiEvent.d.ts +19 -19
  208. package/src/bridge/MagicBridge.d.ts +16 -16
  209. package/src/commands/ClientOriginatedCommandTaskTag.d.ts +8 -8
  210. package/src/commands/ClientToServer/AddUserLocateDataViewCommand.d.ts +4 -4
  211. package/src/commands/ClientToServer/AddUserRangeDataviewCommand.d.ts +6 -6
  212. package/src/commands/ClientToServer/AddUserSortDataViewCommand.d.ts +6 -6
  213. package/src/commands/ClientToServer/BrowserEscEventCommand.d.ts +8 -8
  214. package/src/commands/ClientToServer/ClientOriginatedCommand.d.ts +8 -8
  215. package/src/commands/ClientToServer/ClientOriginatedCommandSerializer.d.ts +6 -6
  216. package/src/commands/ClientToServer/ColumnSortEventCommand.d.ts +10 -10
  217. package/src/commands/ClientToServer/CommandFactory.d.ts +64 -64
  218. package/src/commands/ClientToServer/CommandSerializationHelper.d.ts +20 -20
  219. package/src/commands/ClientToServer/ComputeEventCommand.d.ts +8 -8
  220. package/src/commands/ClientToServer/ContextTerminationEventCommand.d.ts +7 -7
  221. package/src/commands/ClientToServer/ContextTimeoutResetCommand.d.ts +7 -7
  222. package/src/commands/ClientToServer/ControlItemsRefreshCommand.d.ts +6 -6
  223. package/src/commands/ClientToServer/DataViewOutputCommand.d.ts +9 -9
  224. package/src/commands/ClientToServer/DataviewCommand.d.ts +32 -32
  225. package/src/commands/ClientToServer/EvaluateCommand.d.ts +15 -15
  226. package/src/commands/ClientToServer/EventCommand.d.ts +15 -15
  227. package/src/commands/ClientToServer/ExecOperCommand.d.ts +23 -23
  228. package/src/commands/ClientToServer/FetchDataControlValuesEventCommand.d.ts +8 -8
  229. package/src/commands/ClientToServer/GlobalParamsQueryCommand.d.ts +5 -5
  230. package/src/commands/ClientToServer/ICommandTaskTag.d.ts +3 -3
  231. package/src/commands/ClientToServer/IndexChangeEventCommand.d.ts +8 -8
  232. package/src/commands/ClientToServer/IniputForceWriteCommand.d.ts +10 -10
  233. package/src/commands/ClientToServer/NonReversibleExitEventCommand.d.ts +8 -8
  234. package/src/commands/ClientToServer/QueryCommand.d.ts +8 -8
  235. package/src/commands/ClientToServer/RecomputeCommand.d.ts +11 -11
  236. package/src/commands/ClientToServer/RefreshEventCommand.d.ts +12 -12
  237. package/src/commands/ClientToServer/RefreshScreenEventCommand.d.ts +10 -10
  238. package/src/commands/ClientToServer/RollbackEventCommand.d.ts +14 -14
  239. package/src/commands/ClientToServer/SelectProgramCommand.d.ts +6 -6
  240. package/src/commands/ClientToServer/SetTransactionStateDataviewCommand.d.ts +5 -5
  241. package/src/commands/ClientToServer/SubformOpenEventCommand.d.ts +8 -8
  242. package/src/commands/ClientToServer/SubformRefreshEventCommand.d.ts +9 -9
  243. package/src/commands/ClientToServer/TransactionCommand.d.ts +12 -12
  244. package/src/commands/ClientToServer/UnloadCommand.d.ts +7 -7
  245. package/src/commands/ClientToServer/WriteMessageToServerLogCommand.d.ts +6 -6
  246. package/src/commands/DataViewCommandBase.d.ts +6 -6
  247. package/src/commands/IClientCommand.d.ts +2 -2
  248. package/src/commands/IClientTargetedCommand.d.ts +12 -12
  249. package/src/commands/IClientToServerCommandInfo.d.ts +3 -3
  250. package/src/commands/ServerToClient/AbortCommand.d.ts +11 -11
  251. package/src/commands/ServerToClient/AddLocateCommand.d.ts +6 -6
  252. package/src/commands/ServerToClient/AddRangeCommand.d.ts +10 -10
  253. package/src/commands/ServerToClient/AddSortCommand.d.ts +9 -9
  254. package/src/commands/ServerToClient/ClientRefreshCommand.d.ts +7 -7
  255. package/src/commands/ServerToClient/ClientTargetedCommandBase.d.ts +12 -12
  256. package/src/commands/ServerToClient/EnhancedVerifyCommand.d.ts +13 -13
  257. package/src/commands/ServerToClient/OpenURLCommand.d.ts +21 -21
  258. package/src/commands/ServerToClient/ResetLocateCommand.d.ts +6 -6
  259. package/src/commands/ServerToClient/ResetRangeCommand.d.ts +6 -6
  260. package/src/commands/ServerToClient/ResetSortCommand.d.ts +6 -6
  261. package/src/commands/ServerToClient/ResultCommand.d.ts +10 -10
  262. package/src/commands/ServerToClient/VerifyCommand.d.ts +17 -17
  263. package/src/commands/ServerToClient/XMLBasedCommandBuilder.d.ts +11 -11
  264. package/src/communications/IConnectionStateManager.d.ts +4 -4
  265. package/src/communications/InteractiveCommunicationsFailureHandler.d.ts +6 -6
  266. package/src/data/DataSourceIdKey.d.ts +2 -2
  267. package/src/data/DataView.d.ts +162 -162
  268. package/src/data/DataViewBase.d.ts +12 -12
  269. package/src/data/DataviewManager.d.ts +14 -14
  270. package/src/data/DataviewManagerBase.d.ts +11 -11
  271. package/src/data/DvCache.d.ts +15 -15
  272. package/src/data/Field.d.ts +103 -103
  273. package/src/data/FieldBase.d.ts +23 -23
  274. package/src/data/FieldsTable.d.ts +27 -27
  275. package/src/data/IRecordsTable.d.ts +7 -7
  276. package/src/data/Key.d.ts +15 -15
  277. package/src/data/Record.d.ts +156 -156
  278. package/src/data/RecordOutOfDataViewException.d.ts +10 -10
  279. package/src/data/RecordsTable.d.ts +38 -38
  280. package/src/data/TaskTransactionManager.d.ts +17 -17
  281. package/src/data/XMLBasedDcValuesBuilder.d.ts +11 -11
  282. package/src/enums.d.ts +21 -21
  283. package/src/env/EnvVariablesTable.d.ts +17 -17
  284. package/src/env/Environment.d.ts +118 -118
  285. package/src/env/ILanguageData.d.ts +3 -3
  286. package/src/env/LanguageData.d.ts +20 -20
  287. package/src/env/MirrorString.d.ts +15 -15
  288. package/src/event/ActionManager.d.ts +14 -14
  289. package/src/event/Event.d.ts +79 -79
  290. package/src/event/EventHandler.d.ts +66 -66
  291. package/src/event/EventHandlerPosition.d.ts +25 -25
  292. package/src/event/EventsManager.d.ts +204 -204
  293. package/src/event/IEventsManager.d.ts +77 -77
  294. package/src/event/RunTimeEvent.d.ts +123 -123
  295. package/src/event/RunTimeEventBase.d.ts +5 -5
  296. package/src/event/UserEventsTable.d.ts +11 -11
  297. package/src/exp/ExpTable.d.ts +11 -11
  298. package/src/exp/Expression.d.ts +37 -37
  299. package/src/exp/ExpressionDict.d.ts +12 -12
  300. package/src/exp/ExpressionEvaluator.d.ts +198 -198
  301. package/src/exp/ExpressionLocalJpn.d.ts +18 -18
  302. package/src/exp/GlobalParamsTable.d.ts +19 -19
  303. package/src/exp/YesNoExp.d.ts +9 -9
  304. package/src/gui/CreatedFormVector.d.ts +10 -10
  305. package/src/gui/FormsTable.d.ts +15 -15
  306. package/src/gui/MgControl.d.ts +60 -60
  307. package/src/gui/MgForm.d.ts +93 -93
  308. package/src/http/HttpManager.d.ts +25 -25
  309. package/src/http/client/HttpClientAsync.d.ts +16 -16
  310. package/src/http/client/HttpClientBase.d.ts +30 -30
  311. package/src/http/client/HttpClientEvents.d.ts +18 -18
  312. package/src/http/client/HttpClientSync.d.ts +17 -17
  313. package/src/http/client/HttpUtility.d.ts +10 -10
  314. package/src/http/client/ICommunicationsFailureHandler.d.ts +5 -5
  315. package/src/remote/AddUserLocateRemoteDataViewCommand.d.ts +8 -8
  316. package/src/remote/AddUserRangeRemoteDataViewCommand.d.ts +8 -8
  317. package/src/remote/AddUserSortRemoteDataViewCommand.d.ts +8 -8
  318. package/src/remote/RemoteCommandsProcessor.d.ts +51 -51
  319. package/src/remote/RemoteControlItemsRefreshCommand.d.ts +8 -8
  320. package/src/remote/RemoteDataViewCommandBase.d.ts +10 -10
  321. package/src/remote/RemoteDataViewCommandFactory.d.ts +6 -6
  322. package/src/remote/RemoteDataViewCommandUpdateNonModifiable.d.ts +8 -8
  323. package/src/remote/RemoteDataviewManager.d.ts +9 -9
  324. package/src/remote/RemoteInitDataViewCommand.d.ts +7 -7
  325. package/src/remote/ResetUserLocateRemoteDataviewCommand.d.ts +7 -7
  326. package/src/remote/ResetUserRangeRemoteDataviewCommand.d.ts +7 -7
  327. package/src/remote/ResetUserSortRemoteDataviewCommand.d.ts +7 -7
  328. package/src/remote/ServerError.d.ts +16 -16
  329. package/src/remote/SetTransactionStateRemoteDataViewCommand.d.ts +8 -8
  330. package/src/rt/Argument.d.ts +36 -36
  331. package/src/rt/ArgumentsList.d.ts +24 -24
  332. package/src/rt/Boundary.d.ts +27 -27
  333. package/src/rt/CompMainPrgTable.d.ts +10 -10
  334. package/src/rt/DataviewHeaderBase.d.ts +34 -34
  335. package/src/rt/DataviewHeaderFactory.d.ts +5 -5
  336. package/src/rt/DataviewHeaders.d.ts +12 -12
  337. package/src/rt/DataviewHeadersSaxHandler.d.ts +10 -10
  338. package/src/rt/ExecutionStack.d.ts +22 -22
  339. package/src/rt/ExecutionStackEntry.d.ts +7 -7
  340. package/src/rt/HandlersTable.d.ts +19 -19
  341. package/src/rt/IDataSourceViewDefinition.d.ts +6 -6
  342. package/src/rt/IDataviewHeader.d.ts +10 -10
  343. package/src/rt/IResultValue.d.ts +4 -4
  344. package/src/rt/LastFocusedManager.d.ts +23 -23
  345. package/src/rt/Operation.d.ts +97 -97
  346. package/src/rt/OperationTable.d.ts +15 -15
  347. package/src/rt/Recompute.d.ts +41 -41
  348. package/src/rt/RecomputeTable.d.ts +9 -9
  349. package/src/rt/RemoteDataviewHeader.d.ts +14 -14
  350. package/src/rt/ResultValue.d.ts +7 -7
  351. package/src/rt/TableCache.d.ts +29 -29
  352. package/src/rt/TableCacheManager.d.ts +10 -10
  353. package/src/rt/Transaction.d.ts +23 -23
  354. package/src/security/UserDetails.d.ts +16 -16
  355. package/src/tasks/IMGDataCollection.d.ts +26 -26
  356. package/src/tasks/MGData.d.ts +63 -63
  357. package/src/tasks/MGDataCollection.d.ts +42 -42
  358. package/src/tasks/RCTimer.d.ts +13 -13
  359. package/src/tasks/RemoteTaskService.d.ts +16 -16
  360. package/src/tasks/Task.d.ts +312 -312
  361. package/src/tasks/TaskBase.d.ts +123 -123
  362. package/src/tasks/TaskServiceBase.d.ts +16 -16
  363. package/src/tasks/TasksTable.d.ts +21 -21
  364. package/src/tasks/sort/Sort.d.ts +4 -4
  365. package/src/tasks/sort/SortCollection.d.ts +11 -11
  366. package/src/util/ConstUtils.d.ts +3 -3
  367. package/src/util/FlowMonitorQueue.d.ts +70 -70
  368. package/src/util/HeapSort.d.ts +6 -6
  369. package/src/util/IMirrorXML.d.ts +6 -6
  370. package/src/util/IServerConfig.d.ts +11 -11
  371. package/src/util/MgBlockingQueue.d.ts +5 -5
  372. package/src/util/MgPriorityBlockingQueue.d.ts +17 -17
  373. package/src/util/MgPriorityQueue.d.ts +13 -13
  374. package/src/util/ParamParseResult.d.ts +6 -6
  375. package/src/util/PrmMap.d.ts +28 -28
  376. package/src/util/ReturnResult.d.ts +18 -18
  377. package/src/util/ReturnResultBase.d.ts +11 -11
  378. package/src/util/Scrambler.d.ts +10 -10
  379. package/src/util/UniqueIDUtils.d.ts +4 -4
  380. package/src/util/cookie.service.d.ts +8 -8
  381. package/esm2020/src/AccessHelper.mjs +0 -9
  382. package/esm2020/src/ClientManager.mjs +0 -399
  383. package/esm2020/src/CommandsProcessorBase.mjs +0 -58
  384. package/esm2020/src/CommandsProcessorManager.mjs +0 -26
  385. package/esm2020/src/CommandsTable.mjs +0 -162
  386. package/esm2020/src/ConstInterface.mjs +0 -516
  387. package/esm2020/src/FlowMonitorInterface.mjs +0 -16
  388. package/esm2020/src/GUIManager.mjs +0 -62
  389. package/esm2020/src/GlobalCommandsManager.mjs +0 -34
  390. package/esm2020/src/GuiEventsProcessor.mjs +0 -154
  391. package/esm2020/src/ServerConfig.mjs +0 -117
  392. package/esm2020/src/commands/ClientOriginatedCommandTaskTag.mjs +0 -11
  393. package/esm2020/src/commands/ClientToServer/ClientOriginatedCommandSerializer.mjs +0 -60
  394. package/esm2020/src/commands/ClientToServer/CommandFactory.mjs +0 -260
  395. package/esm2020/src/commands/ClientToServer/CommandSerializationHelper.mjs +0 -69
  396. package/esm2020/src/commands/ClientToServer/DataViewOutputCommand.mjs +0 -13
  397. package/esm2020/src/commands/ClientToServer/EvaluateCommand.mjs +0 -36
  398. package/esm2020/src/commands/ClientToServer/EventCommand.mjs +0 -40
  399. package/esm2020/src/commands/ClientToServer/ExecOperCommand.mjs +0 -67
  400. package/esm2020/src/commands/ClientToServer/FetchDataControlValuesEventCommand.mjs +0 -22
  401. package/esm2020/src/commands/ClientToServer/IniputForceWriteCommand.mjs +0 -23
  402. package/esm2020/src/commands/ClientToServer/RecomputeCommand.mjs +0 -27
  403. package/esm2020/src/commands/ClientToServer/RefreshEventCommand.mjs +0 -27
  404. package/esm2020/src/commands/ClientToServer/RefreshScreenEventCommand.mjs +0 -24
  405. package/esm2020/src/commands/ClientToServer/RollbackEventCommand.mjs +0 -39
  406. package/esm2020/src/commands/ClientToServer/SubformRefreshEventCommand.mjs +0 -24
  407. package/esm2020/src/commands/ClientToServer/TransactionCommand.mjs +0 -28
  408. package/esm2020/src/commands/ClientToServer/WriteMessageToServerLogCommand.mjs +0 -18
  409. package/esm2020/src/commands/DataViewCommandBase.mjs +0 -10
  410. package/esm2020/src/commands/IClientTargetedCommand.mjs +0 -9
  411. package/esm2020/src/commands/ServerToClient/AbortCommand.mjs +0 -65
  412. package/esm2020/src/commands/ServerToClient/AddRangeCommand.mjs +0 -62
  413. package/esm2020/src/commands/ServerToClient/AddSortCommand.mjs +0 -33
  414. package/esm2020/src/commands/ServerToClient/ClientRefreshCommand.mjs +0 -25
  415. package/esm2020/src/commands/ServerToClient/ClientTargetedCommandBase.mjs +0 -27
  416. package/esm2020/src/commands/ServerToClient/EnhancedVerifyCommand.mjs +0 -45
  417. package/esm2020/src/commands/ServerToClient/OpenURLCommand.mjs +0 -221
  418. package/esm2020/src/commands/ServerToClient/ResultCommand.mjs +0 -37
  419. package/esm2020/src/commands/ServerToClient/VerifyCommand.mjs +0 -83
  420. package/esm2020/src/commands/ServerToClient/XMLBasedCommandBuilder.mjs +0 -132
  421. package/esm2020/src/communications/InteractiveCommunicationsFailureHandler.mjs +0 -17
  422. package/esm2020/src/data/DataView.mjs +0 -1610
  423. package/esm2020/src/data/DataviewManager.mjs +0 -28
  424. package/esm2020/src/data/DataviewManagerBase.mjs +0 -15
  425. package/esm2020/src/data/DvCache.mjs +0 -67
  426. package/esm2020/src/data/Field.mjs +0 -646
  427. package/esm2020/src/data/FieldBase.mjs +0 -18
  428. package/esm2020/src/data/FieldsTable.mjs +0 -103
  429. package/esm2020/src/data/Key.mjs +0 -88
  430. package/esm2020/src/data/Record.mjs +0 -846
  431. package/esm2020/src/data/RecordsTable.mjs +0 -267
  432. package/esm2020/src/data/TaskTransactionManager.mjs +0 -103
  433. package/esm2020/src/data/XMLBasedDcValuesBuilder.mjs +0 -74
  434. package/esm2020/src/env/EnvVariablesTable.mjs +0 -340
  435. package/esm2020/src/env/Environment.mjs +0 -489
  436. package/esm2020/src/env/LanguageData.mjs +0 -226
  437. package/esm2020/src/env/MirrorString.mjs +0 -65
  438. package/esm2020/src/event/ActionManager.mjs +0 -91
  439. package/esm2020/src/event/Event.mjs +0 -1333
  440. package/esm2020/src/event/EventHandler.mjs +0 -766
  441. package/esm2020/src/event/EventHandlerPosition.mjs +0 -204
  442. package/esm2020/src/event/EventsManager.mjs +0 -2975
  443. package/esm2020/src/event/RunTimeEvent.mjs +0 -392
  444. package/esm2020/src/event/UserEventsTable.mjs +0 -47
  445. package/esm2020/src/exp/ExpTable.mjs +0 -59
  446. package/esm2020/src/exp/Expression.mjs +0 -200
  447. package/esm2020/src/exp/ExpressionDict.mjs +0 -727
  448. package/esm2020/src/exp/ExpressionEvaluator.mjs +0 -4212
  449. package/esm2020/src/exp/ExpressionLocalJpn.mjs +0 -314
  450. package/esm2020/src/exp/GlobalParamsTable.mjs +0 -85
  451. package/esm2020/src/exp/YesNoExp.mjs +0 -36
  452. package/esm2020/src/gui/CreatedFormVector.mjs +0 -23
  453. package/esm2020/src/gui/FormsTable.mjs +0 -66
  454. package/esm2020/src/gui/MgControl.mjs +0 -353
  455. package/esm2020/src/gui/MgForm.mjs +0 -1181
  456. package/esm2020/src/http/HttpManager.mjs +0 -97
  457. package/esm2020/src/http/client/HttpClientAsync.mjs +0 -67
  458. package/esm2020/src/http/client/HttpClientBase.mjs +0 -132
  459. package/esm2020/src/http/client/HttpClientEvents.mjs +0 -39
  460. package/esm2020/src/http/client/HttpClientSync.mjs +0 -42
  461. package/esm2020/src/http/client/HttpUtility.mjs +0 -84
  462. package/esm2020/src/remote/AddUserLocateRemoteDataViewCommand.mjs +0 -18
  463. package/esm2020/src/remote/AddUserRangeRemoteDataViewCommand.mjs +0 -18
  464. package/esm2020/src/remote/AddUserSortRemoteDataViewCommand.mjs +0 -18
  465. package/esm2020/src/remote/RemoteCommandsProcessor.mjs +0 -880
  466. package/esm2020/src/remote/RemoteControlItemsRefreshCommand.mjs +0 -25
  467. package/esm2020/src/remote/RemoteDataViewCommandBase.mjs +0 -24
  468. package/esm2020/src/remote/RemoteDataViewCommandFactory.mjs +0 -61
  469. package/esm2020/src/remote/ResetUserLocateRemoteDataviewCommand.mjs +0 -17
  470. package/esm2020/src/remote/ResetUserSortRemoteDataviewCommand.mjs +0 -16
  471. package/esm2020/src/remote/ServerError.mjs +0 -40
  472. package/esm2020/src/remote/SetTransactionStateRemoteDataViewCommand.mjs +0 -20
  473. package/esm2020/src/rt/Argument.mjs +0 -265
  474. package/esm2020/src/rt/ArgumentsList.mjs +0 -103
  475. package/esm2020/src/rt/Boundary.mjs +0 -152
  476. package/esm2020/src/rt/CompMainPrgTable.mjs +0 -65
  477. package/esm2020/src/rt/DataviewHeaders.mjs +0 -53
  478. package/esm2020/src/rt/DataviewHeadersSaxHandler.mjs +0 -38
  479. package/esm2020/src/rt/ExecutionStack.mjs +0 -94
  480. package/esm2020/src/rt/HandlersTable.mjs +0 -96
  481. package/esm2020/src/rt/LastFocusedManager.mjs +0 -67
  482. package/esm2020/src/rt/Operation.mjs +0 -735
  483. package/esm2020/src/rt/OperationTable.mjs +0 -67
  484. package/esm2020/src/rt/Recompute.mjs +0 -355
  485. package/esm2020/src/rt/RecomputeTable.mjs +0 -63
  486. package/esm2020/src/rt/RemoteDataviewHeader.mjs +0 -108
  487. package/esm2020/src/rt/ResultValue.mjs +0 -12
  488. package/esm2020/src/rt/TableCache.mjs +0 -177
  489. package/esm2020/src/rt/TableCacheManager.mjs +0 -67
  490. package/esm2020/src/rt/Transaction.mjs +0 -53
  491. package/esm2020/src/security/UserDetails.mjs +0 -71
  492. package/esm2020/src/tasks/MGData.mjs +0 -552
  493. package/esm2020/src/tasks/MGDataCollection.mjs +0 -252
  494. package/esm2020/src/tasks/RCTimer.mjs +0 -63
  495. package/esm2020/src/tasks/RemoteTaskService.mjs +0 -45
  496. package/esm2020/src/tasks/Task.mjs +0 -2495
  497. package/esm2020/src/tasks/TaskBase.mjs +0 -87
  498. package/esm2020/src/tasks/TaskServiceBase.mjs +0 -25
  499. package/esm2020/src/tasks/TasksTable.mjs +0 -80
  500. package/esm2020/src/tasks/sort/Sort.mjs +0 -7
  501. package/esm2020/src/tasks/sort/SortCollection.mjs +0 -67
  502. package/esm2020/src/util/ConstUtils.mjs +0 -14
  503. package/esm2020/src/util/FlowMonitorQueue.mjs +0 -453
  504. package/esm2020/src/util/HeapSort.mjs +0 -70
  505. package/esm2020/src/util/MgPriorityBlockingQueue.mjs +0 -74
  506. package/esm2020/src/util/MgPriorityQueue.mjs +0 -66
  507. package/esm2020/src/util/PrmMap.mjs +0 -151
  508. package/esm2020/src/util/ReturnResult.mjs +0 -46
  509. package/esm2020/src/util/ReturnResultBase.mjs +0 -18
  510. package/esm2020/src/util/Scrambler.mjs +0 -89
  511. package/esm2020/src/util/UniqueIDUtils.mjs +0 -12
  512. package/esm2020/src/util/cookie.service.mjs +0 -92
  513. package/fesm2015/magic-xpa-engine.mjs +0 -30835
  514. package/fesm2015/magic-xpa-engine.mjs.map +0 -1
  515. package/fesm2020/magic-xpa-engine.mjs.map +0 -1
@@ -0,0 +1,97 @@
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
+ static _instance = null;
9
+ static DEFAULT_HTTP_COMMUNICATION_TIMEOUT = 5 * 1000;
10
+ static DEFAULT_OFFLINE_HTTP_COMMUNICATION_TIMEOUT = 2 * 1000;
11
+ _httpCommunicationTimeoutMS = HttpManager.DEFAULT_HTTP_COMMUNICATION_TIMEOUT;
12
+ _httpClientAsync = null;
13
+ getHttpClient() {
14
+ if (this.IsAbortingMagicEngine)
15
+ return new HttpClientSync();
16
+ return this._httpClientAsync;
17
+ }
18
+ set HttpCommunicationTimeoutMS(value) {
19
+ this._httpCommunicationTimeoutMS = value;
20
+ }
21
+ static _nativeHttpClient = null;
22
+ static setNativeHttpClient(httpClient) {
23
+ HttpManager._nativeHttpClient = httpClient;
24
+ }
25
+ static GetInstance() {
26
+ if (HttpManager._instance === null) {
27
+ HttpManager._instance = new HttpManager();
28
+ }
29
+ return HttpManager._instance;
30
+ }
31
+ _isAbortingMagicEngine = false;
32
+ get IsAbortingMagicEngine() { return this._isAbortingMagicEngine; }
33
+ set IsAbortingMagicEngine(isAbortingMagicEngine) { this._isAbortingMagicEngine = isAbortingMagicEngine; }
34
+ constructor() {
35
+ this._httpClientAsync = new HttpClientAsync(HttpManager._nativeHttpClient);
36
+ this.RegisterBasicDelegates();
37
+ }
38
+ RegisterBasicDelegates() {
39
+ HttpClientEvents.GetHttpCommunicationTimeout_Event = this.GetHttpCommunicationTimeoutMS.bind(this);
40
+ }
41
+ GetHttpCommunicationTimeoutMS() {
42
+ return this._httpCommunicationTimeoutMS;
43
+ }
44
+ SetCommunicationsFailureHandler(handler) {
45
+ this.getHttpClient().CommunicationsFailureHandler = handler;
46
+ }
47
+ async GetContent(requestedURL, requestContent, useCache, isError) {
48
+ let response;
49
+ Debug.Assert(this.getHttpClient() != null);
50
+ try {
51
+ Logger.Instance.WriteServerToLog("*************************************************************************************************");
52
+ isError.value = false;
53
+ Logger.Instance.WriteServerToLog(requestedURL);
54
+ HttpManager.LogAccessToServer("", requestContent);
55
+ response = await this.getHttpClient().GetContent(requestedURL, requestContent, useCache);
56
+ Debug.Assert(response !== null);
57
+ let errorResponse = HttpManager.CheckAndGetErrorResponse(response);
58
+ if (errorResponse !== null) {
59
+ response = errorResponse;
60
+ isError.value = true;
61
+ }
62
+ return response;
63
+ }
64
+ catch (ex) {
65
+ let url = new URL(requestedURL);
66
+ throw new ApplicationException(ex.Message + "\n" + url.origin + url.pathname, ex);
67
+ }
68
+ finally {
69
+ }
70
+ }
71
+ static CheckAndGetErrorResponse(httpResponse) {
72
+ let errorResponse = null;
73
+ if (httpResponse.startsWith(ConstInterface.V24_RIA_ERROR_PREFIX))
74
+ errorResponse = httpResponse.substr(ConstInterface.V24_RIA_ERROR_PREFIX.length);
75
+ return errorResponse;
76
+ }
77
+ static LogAccessToServer(msg, requestContent) {
78
+ if (Logger.Instance.ShouldLogServerRelatedMessages()) {
79
+ if (!NString.IsNullOrEmpty(msg)) {
80
+ msg = msg + "; accessing server ...";
81
+ }
82
+ if (requestContent === null) {
83
+ if (!NString.IsNullOrEmpty(msg)) {
84
+ Logger.Instance.WriteServerToLog(msg);
85
+ }
86
+ }
87
+ else {
88
+ if (!NString.IsNullOrEmpty(msg)) {
89
+ msg = msg + " ";
90
+ }
91
+ msg = msg + "uploading " + requestContent.length + " bytes";
92
+ Logger.Instance.WriteServerToLog(msg);
93
+ }
94
+ }
95
+ }
96
+ }
97
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiSHR0cE1hbmFnZXIuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi9wcm9qZWN0cy9lbmdpbmUvc3JjL2h0dHAvSHR0cE1hbmFnZXIudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUFDLG9CQUFvQixFQUFFLEtBQUssRUFBRSxPQUFPLEVBQVcsTUFBTSxzQkFBc0IsQ0FBQztBQUNwRixPQUFPLEVBQUMsTUFBTSxFQUFDLE1BQU0sa0JBQWtCLENBQUM7QUFFeEMsT0FBTyxFQUFDLGNBQWMsRUFBQyxNQUFNLG1CQUFtQixDQUFDO0FBRWpELE9BQU8sRUFBQyxnQkFBZ0IsRUFBQyxNQUFNLDJCQUEyQixDQUFDO0FBRTNELE9BQU8sRUFBQyxjQUFjLEVBQUMsTUFBTSx5QkFBeUIsQ0FBQztBQUN2RCxPQUFPLEVBQUMsZUFBZSxFQUFDLE1BQU0sMEJBQTBCLENBQUM7QUFFekQsTUFBTSxPQUFPLFdBQVc7SUFDZCxNQUFNLENBQUMsU0FBUyxHQUFnQixJQUFJLENBQUM7SUFFN0MsTUFBTSxDQUFVLGtDQUFrQyxHQUFXLENBQUMsR0FBRyxJQUFJLENBQUM7SUFDdEUsTUFBTSxDQUFVLDBDQUEwQyxHQUFXLENBQUMsR0FBRyxJQUFJLENBQUM7SUFFdEUsMkJBQTJCLEdBQVcsV0FBVyxDQUFDLGtDQUFrQyxDQUFDO0lBQ3JGLGdCQUFnQixHQUFvQixJQUFJLENBQUM7SUFFekMsYUFBYTtRQUduQixJQUFHLElBQUksQ0FBQyxxQkFBcUI7WUFDM0IsT0FBTy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XRpdmUgcmVxdWVzdGVkVVJMIGRvZXNuJ3Qgd29yayBoZXJlLlxyXG4gICAgICBsZXQgdXJsOiBVUkwgPSBuZXcgVVJMKHJlcXVlc3RlZFVSTCk7XHJcbiAgICAgIHRocm93IG5ldyBBcHBsaWNhdGlvbkV4Y2VwdGlvbihleC5NZXNzYWdlICsgXCJcXG5cIiArIHVybC5vcmlnaW4gKyB1cmwucGF0aG5hbWUsIGV4KTtcclxuICAgIH1cclxuICAgIGZpbmFsbHkge1xyXG4gICAgICAvLyBUT0RPOiBJbXBsZW1lbnQgaW4gV2ViQ2xpZW50LlxyXG4gICAgICAvLyBIb3cgZG8gd2Uga25vdyBpZiB0aGUgY29udGVudHMgd2VyZSByZXR1cm5lZCBmb3JtIGJyb3dzZXIgY2FjaGU/XHJcbiAgICAgIC8vIGxldCBlbGFwc2VkVGltZTogbnVtYmVyID0gTWlzYy5nZXRTeXN0ZW1NaWxsaXNlY29uZHMoKSAtIHN0YXJ0VGltZTtcclxuXHJcbiAgICAgIC8vIExvZ2dlci5JbnN0YW5jZS5Xcml0ZVNlcnZlclRvTG9nKFxyXG4gICAgICAvLyAgICAgICAgICAgICAgIHN0cmluZy5Gb3JtYXQoXHJcbiAgICAgIC8vICAgICAgICAgICAgICAgICAgXCJDb21wbGV0ZWQgezB9OiB7MTpOMH0gbXMsIGFjY3VtdWxhdGVkOiB7MjpOMH0gbXMgKHNlcnZlcjogezM6TjB9KSwgezR9ezV9ezZ9KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKipcIixcclxuICAgICAgLy8gICAgICAgICAgICAgICAgICAoY2FjaGluZ1N0cmF0ZWd5LkZvdW5kSW5DYWNoZVxyXG4gICAgICAvLyAgICAgICAgICAgICAgICAgICAgICA/IFwiXCJcclxuICAgICAgLy8gICAgICAgICAgICAgICAgICAgICAgOiBOU3RyaW5nLkZvcm1hdChcIiN7MDpOMH1cIiwgU3RhdGlzdGljcy5HZXRSZXF1ZXN0c0NudCgpKVxyXG4gICAgICAvLyAgICAgICAgICAgICAgICAgICksXHJcbiAgICAgIC8vICAgICAgICAgICAgICAgICAgZWxhcHNlZFRpbWUsXHJcbiAgICAgIC8vICAgICAgICAgICAgICAgICAgU3RhdGlzdGljcy5HZXRBY2N1bXVsYXRlZEV4dGVybmFsVGltZSgpLCBTdGF0aXN0aWNzLkdldEFjY3VtdWxhdGVkU2VydmVyVGltZSgpLFxyXG4gICAgICAvLyAgICAgICAgICAgICAgICAgIChjYWNoaW5nU3RyYXRlZ3kuRm91bmRJbkNhY2hlXHJcbiAgICAgIC8vICAgICAgICAgICAgICAgICAgICAgID8gXCJcIlxyXG4gICAgICAvLyAgICAgICAgICAgICAgICAgICAgICA6IChyZXNwb25zZSAhPSBudWxsXHJcbiAgICAgIC8vICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gTlN0cmluZy5Gb3JtYXQoXCJ7MDpOMH0gYnl0ZXMgZG93bmxvYWRlZFwiLCByZXNwb25zZS5sZW5ndGgpXHJcbiAgICAgIC8vICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogXCJOdWxsIHJlc3BvbnNlIVwiKVxyXG4gICAgICAvLyAgICAgICAgICAgICAgICAgICksXHJcbiAgICAgIC8vICAgICAgICAgICAgICAgICAgT1NFbnZpcm9ubWVudC5Fb2xTZXEsIE9TRW52aXJvbm1lbnQuVGFiU2VxKVxyXG4gICAgICAvLyAgICAgICAgICAgICAgICk7XHJcbiAgICB9XHJcbiAgfVxyXG5cclxuICAvLy8gPHN1bW1hcnk+Q2hlY2sgaWYgYW4gSFRUUCByZXNwb25zZSBpcyBhbiBlcnJvciByZXNwb25zZS5cclxuICAvLy8gPHBhcmFtIG5hbWU9XCJodHRwUmVzcG9uc2VcIj5yZXNwb25zZSByZXR1cm5lZCB0byBhbiBIVFRQIHJlcXVlc3QuPC9wYXJhbT5cclxuICAvLy8gPHJld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RDb250ZW50ID09PSBudWxsKSB7XHJcbiAgICAgICAgaWYgKCFOU3RyaW5nLklzTnVsbE9yRW1wdHkobXNnKSkge1xyXG4gICAgICAgICAgTG9nZ2VyLkluc3RhbmNlLldyaXRlU2VydmVyVG9Mb2cobXNnKTtcclxuICAgICAgICB9XHJcbiAgICAgIH1cclxuICAgICAgZWxzZSB7XHJcbiAgICAgICAgaWYgKCFOU3RyaW5nLklzTnVsbE9yRW1wdHkobXNnKSkge1xyXG4gICAgICAgICAgbXNnID0gbXNnICsgXCIgXCI7XHJcbiAgICAgICAgfVxyXG5cclxuICAgICAgICBtc2cgPSBtc2cgKyBcInVwbG9hZGluZyBcIiArIHJlcXVlc3RDb250ZW50Lmxlbmd0aCArIFwiIGJ5dGVzXCI7XHJcbiAgICAgICAgTG9nZ2VyLkluc3RhbmNlLldyaXRlU2VydmVyVG9Mb2cobXNnKTtcclxuICAgICAgfVxyXG4gICAgfVxyXG4gIH1cclxufVxyXG4iXX0=
@@ -0,0 +1,68 @@
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
+ httpClient;
8
+ constructor(httpClient) {
9
+ super();
10
+ this.httpClient = httpClient;
11
+ }
12
+ prepareRequest() {
13
+ }
14
+ addHeaders(urlString, useCache, httpHeaders, clientID) {
15
+ if (!urlString.startsWith("/"))
16
+ httpHeaders = httpHeaders.append("MgxpaRIAglobalUniqueSessionID", clientID);
17
+ if (!useCache)
18
+ httpHeaders = httpHeaders.append("Cache-Control", 'no-cache');
19
+ return httpHeaders;
20
+ }
21
+ async sendRequestToServer(httpMethod, urlString, httpHeaders, requestContent, contentFromServer) {
22
+ let httpResponse = await this.httpClient.request(RequestMethod[httpMethod], urlString, { headers: httpHeaders, responseType: "text", observe: "response", body: requestContent }).toPromise();
23
+ contentFromServer.value = httpResponse.body;
24
+ return httpResponse;
25
+ }
26
+ logResponse(httpResponse, clientID, urlString, contentFromServer, timeBeforeRequest) {
27
+ let statusCode = httpResponse['status'];
28
+ let responseTime = Misc.getSystemMilliseconds() - timeBeforeRequest;
29
+ if (Logger.Instance.LogLevel === Logger_LogLevels.Basic)
30
+ 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);
31
+ }
32
+ handleHttpErrorException(ex, urlString) {
33
+ if (ex instanceof HttpErrorResponse) {
34
+ let statusCode = ex['status'];
35
+ if (statusCode === 404 || statusCode === 403)
36
+ throw new WebException(new Error("bad URL: " + urlString + " - StatusCode = " + statusCode));
37
+ }
38
+ }
39
+ async shouldRetry(httpCommunicationTimeoutMS, urlString, communicationsFailureHandler, ex, startTimeRef) {
40
+ let currentDelayMS = Math.floor(httpCommunicationTimeoutMS / 10);
41
+ let httpElapsedTimeMS = Misc.getSystemMilliseconds() - startTimeRef.value + currentDelayMS;
42
+ if (httpElapsedTimeMS <= httpCommunicationTimeoutMS) {
43
+ await Thread.Sleep(currentDelayMS);
44
+ Logger.Instance.WriteWarningToLogWithMsg(NString.Format("Retrying {0} : elapsed time {1:N0}ms out of {2:N0}ms", urlString, httpElapsedTimeMS, httpCommunicationTimeoutMS));
45
+ return true;
46
+ }
47
+ Logger.Instance.WriteWarningToLogWithMsg(NString.Format("{0} : http timeout {1:N0}ms expired", urlString, httpCommunicationTimeoutMS));
48
+ if (communicationsFailureHandler != null) {
49
+ communicationsFailureHandler.CommunicationFailed(urlString, ex);
50
+ if (communicationsFailureHandler.ShouldRetryLastRequest) {
51
+ Logger.Instance.WriteServerToLog(NString.Format("Retrying {0}, confirmed by user ...", urlString));
52
+ startTimeRef.value = Misc.getSystemMilliseconds();
53
+ return true;
54
+ }
55
+ }
56
+ return false;
57
+ }
58
+ logAndThrowException(ex) {
59
+ Logger.Instance.WriteWarningToLogWithMsg("Re-throwing ...");
60
+ Logger.Instance.WriteWarningToLog(ex);
61
+ throw new WebException(ex);
62
+ }
63
+ logExecutionAttempts(executionAttempts) {
64
+ if (executionAttempts > 1)
65
+ Logger.Instance.WriteServerToLog(NString.Format("Succeeded after {0} attempts ...", executionAttempts));
66
+ }
67
+ }
68
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiSHR0cENsaWVudEFzeW5jLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vLi4vLi4vcHJvamVjdHMvZW5naW5lL3NyYy9odHRwL2NsaWVudC9IdHRwQ2xpZW50QXN5bmMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUFhLGlCQUFpQixFQUE0QixNQUFNLHNCQUFzQixDQUFDO0FBQzlGLE9BQU8sRUFBQyxPQUFPLEVBQVksTUFBTSxFQUFFLFlBQVksRUFBQyxNQUFNLHNCQUFzQixDQUFDO0FBQzdFLE9BQU8sRUFBQyxjQUFjLEVBQUUsYUFBYSxFQUFDLE1BQU0sa0JBQWtCLENBQUM7QUFDL0QsT0FBTyxFQUFDLE1BQU0sRUFBRSxnQkFBZ0IsRUFBRSx1QkFBdUIsRUFBRSxJQUFJLEVBQUMsTUFBTSxrQkFBa0IsQ0FBQztBQUN6RixPQUFPLEVBQUMsZ0JBQWdCLEVBQUMsTUFBTSxvQkFBb0IsQ0FBQztBQUlwRCxNQUFNLE9BQU8sZUFBZ0IsU0FBUSxjQUFjO0lBQzdCO0lBQXBCLFlBQW9CLFVBQXNCO1FBQ3hDLEtBQUssRUFBRSxDQUFDO1FBRFUsZUFBVSxH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Zm9yZVJlcXVlc3Q7XHJcbiAgICBpZiAoTG9nZ2VyLkluc3RhbmNlLkxvZ0xldmVsID09PSBMb2dnZXJfTG9nTGV2ZWxzLkJhc2ljKVxyXG4gICAgICBMb2dnZXIuSW5zdGFuY2UuV3JpdGVCYXNpY1RvTG9nKExvZ2dlcl9NZXNzYWdlRGlyZWN0aW9uLk1lc3NhZ2VFbnRlcmluZyxcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBIdHRwQ2xpZW50RXZlbnRzLkdldFJ1bnRpbWVDdHhJRCgpLFxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEh0dHBDbGllbnRFdmVudHMuR2V0U2Vzc2lvbkNvdW50ZXIoKSxcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjbGllbnRJRCxcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBIdHRwQ2xpZW50RXZlbnRzLlNob3VsZERpc3BsYXlHZW5lcmljRXJyb3IoKSA/IFwiLVwiIDogbmV3IFVSTCh1cmxTdHJpbmcpLmhvc3QsXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVzcG9uc2VUaW1lLFxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0YXR1c0NvZGUudG9TdHJpbmcoKSxcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBKU09OLnN0cmluZ2lmeShodHRwUmVzcG9uc2UuaGVhZGVycyksXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29udGVudEZyb21TZXJ2ZXIudmFsdWUubGVuZ3RoKTtcclxuICB9XHJcblxyXG4gIGhhbmRsZUh0dHBFcnJvckV4Y2VwdGlvbihleDogYW55LCB1cmxTdHJpbmc6IHN0cmluZykge1xyXG4gICAgaWYgKGV4IGluc3RhbmNlb2YgSHR0cEVycm9yUmVzcG9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b2dBbmRUaHJvd0V4Y2VwdGlvbihleClcclxuICB7XHJcbiAgICBMb2dnZXIuSW5zdGFuY2UuV3JpdGVXYXJuaW5nVG9Mb2dXaXRoTXNnKFwiUmUtdGhyb3dpbmcgLi4uXCIpO1xyXG4gICAgTG9nZ2VyLkluc3RhbmNlLldyaXRlV2FybmluZ1RvTG9nKGV4KTtcclxuICAgIHRocm93IG5ldyBXZWJFeGNlcHRpb24oZXgpO1xyXG4gIH1cclxuXHJcbiAgbG9nRXhlY3V0aW9uQXR0ZW1wdHMoZXhlY3V0aW9uQXR0ZW1wdHM6IG51bWJlcilcclxuICB7XHJcbiAgICBpZiAoZXhlY3V0aW9uQXR0ZW1wdHMgPiAxKVxyXG4gICAgICBMb2dnZXIuSW5zdGFuY2UuV3JpdGVTZXJ2ZXJUb0xvZyhOU3RyaW5nLkZvcm1hdChcIlN1Y2NlZWRlZCBhZnRlciB7MH0gYXR0ZW1wdHMgLi4uXCIsIGV4ZWN1dGlvbkF0dGVtcHRzKSk7XHJcbiAgfVxyXG59XHJcbiJdfQ==
@@ -0,0 +1,132 @@
1
+ import { NString, RefParam, StringBuilder, isNullOrUndefined } from "@magic-xpa/mscorelib";
2
+ import { Logger, Logger_LogLevels, Logger_MessageDirection, Misc } from "@magic-xpa/utils";
3
+ import { HttpClientEvents } from "./HttpClientEvents";
4
+ import { HttpHeaders } from "@angular/common/http";
5
+ export var RequestMethod;
6
+ (function (RequestMethod) {
7
+ RequestMethod[RequestMethod["Get"] = 0] = "Get";
8
+ RequestMethod[RequestMethod["Post"] = 1] = "Post";
9
+ RequestMethod[RequestMethod["Put"] = 2] = "Put";
10
+ RequestMethod[RequestMethod["Delete"] = 3] = "Delete";
11
+ RequestMethod[RequestMethod["Options"] = 4] = "Options";
12
+ RequestMethod[RequestMethod["Head"] = 5] = "Head";
13
+ RequestMethod[RequestMethod["Patch"] = 6] = "Patch";
14
+ })(RequestMethod || (RequestMethod = {}));
15
+ export class HttpClientBase {
16
+ _HTTPMaxURLLength = 2048;
17
+ CommunicationsFailureHandler = null;
18
+ constructor() {
19
+ this.CommunicationsFailureHandler = null;
20
+ }
21
+ DecideOnRequestMethod(requestContent, requestURL) {
22
+ let method = RequestMethod.Get;
23
+ if (requestContent === null) {
24
+ method = RequestMethod.Get;
25
+ }
26
+ else {
27
+ if (requestURL.value.length + 1 + requestContent.length <= this._HTTPMaxURLLength) {
28
+ requestURL.value = requestURL.value + "?" + requestContent;
29
+ method = RequestMethod.Get;
30
+ }
31
+ else {
32
+ method = RequestMethod.Post;
33
+ }
34
+ }
35
+ return method;
36
+ }
37
+ async GetContent(requestURL, requestContent, useCache) {
38
+ let contentFromServer = new RefParam(null);
39
+ let requestUrlRef = new RefParam(requestURL);
40
+ let httpMethod = this.DecideOnRequestMethod(requestContent, requestUrlRef);
41
+ requestURL = requestUrlRef.value;
42
+ try {
43
+ let response = await this.ExecuteHttpRequest(requestURL, requestContent, useCache, httpMethod, contentFromServer);
44
+ if (response != null) {
45
+ Logger.Instance.WriteServerToLog("Incoming Headers : " + HttpClientBase.HeadersToString(response.headers, true));
46
+ let nextSessionCounterString = response.headers.get("MgxpaNextSessionCounter".toLowerCase());
47
+ if (!isNullOrUndefined(nextSessionCounterString)) {
48
+ HttpClientEvents.CheckAndSetSessionCounter(+nextSessionCounterString);
49
+ }
50
+ }
51
+ }
52
+ catch (ex) {
53
+ Logger.Instance.WriteWarningToLog(ex);
54
+ throw ex;
55
+ }
56
+ return contentFromServer.value;
57
+ }
58
+ async ExecuteHttpRequest(urlString, requestContent, useCache, httpMethod, contentFromServer) {
59
+ let httpResponse = null;
60
+ this.prepareRequest();
61
+ let httpCommunicationTimeoutMS = HttpClientEvents.GetHttpCommunicationTimeout();
62
+ let clientID = HttpClientEvents.GetGlobalUniqueSessionID();
63
+ let executionAttempts = 0;
64
+ let startTime = Misc.getSystemMilliseconds();
65
+ while (true) {
66
+ executionAttempts++;
67
+ try {
68
+ let httpHeaders = new HttpHeaders();
69
+ httpHeaders = this.addHeaders(urlString, useCache, httpHeaders, clientID);
70
+ Logger.Instance.WriteServerToLog(NString.Format("Request Timeout set to {0} ms", httpCommunicationTimeoutMS));
71
+ if (Logger.Instance.LogLevel === Logger_LogLevels.Basic) {
72
+ let contentLength = 0;
73
+ if (httpMethod === RequestMethod.Get) {
74
+ let parts = urlString.split('?');
75
+ if (parts.length === 2)
76
+ contentLength = parts[1].length;
77
+ }
78
+ else
79
+ contentLength = requestContent.length;
80
+ Logger.Instance.WriteBasicToLog(Logger_MessageDirection.MessageLeaving, HttpClientEvents.GetRuntimeCtxID(), HttpClientEvents.GetSessionCounter(), clientID, HttpClientEvents.ShouldDisplayGenericError() ? "-" : new URL(urlString).host, 0, '-', JSON.stringify(httpHeaders), contentLength);
81
+ }
82
+ let timeBeforeRequest = Misc.getSystemMilliseconds();
83
+ Logger.Instance.WriteServerToLog(NString.Format("Accessing (method: '{0}'): '{1}'", httpMethod, urlString));
84
+ Logger.Instance.WriteServerToLog("Outgoing Headers : " + HttpClientBase.HeadersToString(httpHeaders, false));
85
+ if (httpMethod === RequestMethod.Post) {
86
+ }
87
+ let requestTime = Misc.getSystemMilliseconds();
88
+ this.LogRequestInfo(!isNullOrUndefined(requestContent) ? requestContent.length : 0, requestTime, false);
89
+ httpResponse = await this.sendRequestToServer(httpMethod, urlString, httpHeaders, requestContent, contentFromServer);
90
+ this.logResponse(httpResponse, clientID, urlString, contentFromServer, timeBeforeRequest);
91
+ this.LogRequestInfo(!isNullOrUndefined(requestContent) ? requestContent.length : 0, Misc.getSystemMilliseconds() - requestTime, true);
92
+ break;
93
+ }
94
+ catch (ex) {
95
+ if (Logger.Instance.LogLevel === Logger_LogLevels.Basic)
96
+ Logger.Instance.WriteBasicErrorToLog();
97
+ else
98
+ Logger.Instance.WriteWarningToLog(ex);
99
+ this.handleHttpErrorException(ex, urlString);
100
+ let startTimeRef = new RefParam(startTime);
101
+ if (this.shouldRetry(httpCommunicationTimeoutMS, urlString, this.CommunicationsFailureHandler, ex, startTimeRef)) {
102
+ startTime = startTimeRef.value;
103
+ continue;
104
+ }
105
+ this.logAndThrowException(ex);
106
+ }
107
+ }
108
+ this.logExecutionAttempts(executionAttempts);
109
+ return httpResponse;
110
+ }
111
+ LogRequestInfo(contentLength, roundTrip, isLoggingResponse) {
112
+ if (Logger.Instance.LogLevel == Logger_LogLevels.RequestInfo) {
113
+ HttpClientEvents.ComputeAndLogRequestInfo(contentLength, roundTrip, isLoggingResponse);
114
+ }
115
+ }
116
+ static HeadersToString(headers, bFilter) {
117
+ let headersStr = new StringBuilder();
118
+ let headerKeys = headers.keys();
119
+ for (let key in headerKeys) {
120
+ if (!bFilter || headerKeys[key].startsWith("Mg"))
121
+ headersStr.Append(NString.Format("{0}:{1} ", headerKeys[key], headers.get(headerKeys[key])));
122
+ }
123
+ return headersStr;
124
+ }
125
+ async sendRequestToServer(httpMethod, urlString, httpHeaders, requestContent, contentFromServer) {
126
+ return Promise.resolve();
127
+ }
128
+ async shouldRetry(httpCommunicationTimeoutMS, urlString, communicationsFailureHandler, ex, startTimeRef) {
129
+ return Promise.resolve(false);
130
+ }
131
+ }
132
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiSHR0cENsaWVudEJhc2UuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi8uLi9wcm9qZWN0cy9lbmdpbmUvc3JjL2h0dHAvY2xpZW50L0h0dHBDbGllbnRCYXNlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFBQyxPQUFPLEVBQUUsUUFBUSxFQUFFLGFBQWEsRUFBRSxpQkFBaUIsRUFBQyxNQUFNLHNCQUFzQixDQUFDO0FBQ3pGLE9BQU8sRUFBQyxNQUFNLEVBQUUsZ0JBQWdCLEVBQUUsdUJBQXVCLEVBQUUsSUFBSSxFQUFDLE1BQU0sa0JBQWtCLENBQUM7QUFFekYsT0FBTyxFQ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XNpYykge1xyXG4gICAgICAgICAgbGV0IGNvbnRlbnRMZW5ndGg6IG51bWJlciA9IDA7XHJcbiAgICAgICAgICBpZiAoaHR0cE1ldGhvZCA9PT0gUmVxdWVzdE1ldGhvZC5HZXQpIHtcclxuICAgICAgICAgICAgbGV0IHBhcnRzOiBzdHJpbmdbXSA9IHVybFN0cmluZy5zcGxpdCgnPycpO1xyXG5cclxuICAgICAgICAgICAgaWYgKHBhcnRzLmxlbmd0aCA9PT0gMilcclxuICAgICAgICAgICAgICBjb250ZW50TGVuZ3RoID0gcGFydHNbMV0ubGVuZ3RoO1xyXG4gICAgICAgICAgfVxyXG4gICAgICAgICAgZWxzZSAvLyAoaHR0cFJlcXVlc3QubWV0aG9kID09PSBSZXF1ZXN0TWV0aG9kLlBvc3QpXHJcbiAgICAgICAgICAgIGNvbnRlbnRMZW5ndGggPSByZXF1ZXN0Q29udGVudC5sZW5ndGg7XHJcblxyXG4gICAgICAgICAgTG9nZ2VyLkluc3RhbmNlLldyaXRlQmFzaWNUb0xvZyhMb2dnZXJfTWVzc2FnZURpcmVjdGlvbi5NZXNzYWdlTGVhdmluZyxcclxuICAgICAgICAgICAgSHR0cENsaWVudEV2ZW50cy5HZXRSdW50aW1lQ3R4SUQoKSxcclxuICAgICAgICAgICAgSHR0cENsaWVudEV2ZW50cy5HZXRTZXNzaW9uQ291bnRlcigpLFxyXG4gICAgICAgICAgICBjbGllbnRJRCxcclxuICAgICAgICAgICAgSHR0cENsaWVudEV2ZW50cy5TaG91bGREaXNwbGF5R2VuZXJpY0Vycm9yKCkgPyBcIi1cIiA6IG5ldyBVUkwodXJsU3RyaW5nKS5ob3N0LFxyXG4gICAgICAgICAgICAwLFxyXG4gICAgICAgICAgICAnLScsXHJcbiAgICAgICAgICAgIEpTT04uc3RyaW5naWZ5KGh0dHBIZWFkZXJzKSxcclxuICAgICAgICAgICAgY29udGVudExlbmd0aCk7XHJcbiAgICAgICAgfVxyXG5cclxuICAgICAgICBsZXQgdGltZUJlZm9yZVJlcXVlc3Q6IG51bWJlciA9IE1pc2MuZ2V0U3lzdGVtTWlsbGlzZWNvbmRzKCk7XHJcbiAgICAgICAgTG9nZ2VyLkluc3RhbmNlLldyaXRlU2VydmVyVG9Mb2coTlN0cmluZy5Gb3JtYXQoXCJBY2Nlc3NpbmcgKG1ldGhvZDogJ3swfScpOiAnezF9J1wiLCBodHRwTWV0aG9kLCB1cmxTdHJpbmcpKTtcclxuXHJcbiAgICAgICAgTG9nZ2VyLkluc3RhbmNlLldyaXRlU2VydmVyVG9Mb2coXCJPdXRnb2luZyBIZWFkZXJzIDogXCIgKyBIdHRwQ2xpZW50QmFzZS5IZWFkZXJzVG9TdHJpbmcoaHR0cEhlYWRlcnMsIGZhbHNlKSk7XHJcblxyXG4gICAgICAgIGlmIChodHRwTWV0aG9kID09PSBSZXF1ZXN0TWV0aG9kLlBvc3QpIHtcclxuICAgICAgICAgIC8vIFRPRE86IEhhbmRsZSBFeHBlY3QxMDBDb250aW51ZS5cclxuICAgICAgICAgIC8vIGh0dHBXZWJSZXF1ZXN0LlNlcnZpY2VQb2ludC5FeHBlY3QxMDBDb250aW51ZSA9IHRoaXMuR2V0SFRUUEV4cGVjdDEwMENvbnRpbnVlKCk7XHJcbiAgICAgICAgICAvLyB0aGlzLldyaXRlQ29udGVudFRvUmVxdWVzdChyZXF1ZXN0Q29udGVudCwgaHR0cFdlYlJlcXVlc3QpO1xyXG4gICAgICAgIH1cclxuXHJcbiAgICAgICAgLy8gPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PVxyXG4gICAgICAgIC8vIHNlbmQgdGhlIHJlcXVlc3QgJiBnZXQgdGhlIHJlc3BvbnNlOlxyXG4gICAgICAgIC8vID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09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IdHRwRXJyb3JFeGNlcHRpb24oZXg6IGFueSwgdXJsU3RyaW5nOiBzdHJpbmcpO1xyXG4gIGFzeW5jIHNob3VsZFJldHJ5KGh0dHBDb21tdW5pY2F0aW9uVGltZW91dE1TOiBudW1iZXIsIHVybFN0cmluZzogc3RyaW5nLCBjb21tdW5pY2F0aW9uc0ZhaWx1cmVIYW5kbGVyOiBJQ29tbXVuaWNhdGlvbnNGYWlsdXJlSGFuZGxlciwgZXg6IGFueSwgc3RhcnRUaW1lUmVmOiBSZWZQYXJhbTxudW1iZXI+KTogUHJvbWlzZTxib29sZWFuPntcclxuICAgIHJldHVybiBQcm9taXNlLnJlc29sdmUoZmFsc2UpO1xyXG4gIH1cclxuICBhYnN0cmFjdCBsb2dBbmRUaHJvd0V4Y2VwdGlvbihleDogYW55KTtcclxuICBhYnN0cmFjdCBsb2dFeGVjdXRpb25BdHRlbXB0cyhleGVjdXRpb25BdHRlbXB0czogbnVtYmVyKTtcclxufVxyXG4iXX0=
@@ -0,0 +1,39 @@
1
+ export class HttpClientEvents {
2
+ static GetHttpCommunicationTimeout_Event = null;
3
+ static GetExecutionProperty_Event = null;
4
+ static GetGlobalUniqueSessionID_Event = null;
5
+ static ShouldDisplayGenericError_Event = null;
6
+ static GetRuntimeCtxID_Event = null;
7
+ static GetSessionCounter_Event = null;
8
+ static CheckAndSetSessionCounter_Event = null;
9
+ static ComputeAndLogRequestInfo_Event = null;
10
+ static GetHttpCommunicationTimeout() {
11
+ return (HttpClientEvents.GetHttpCommunicationTimeout_Event !== null) ? HttpClientEvents.GetHttpCommunicationTimeout_Event() : 5000;
12
+ }
13
+ static GetExecutionProperty(propertyName) {
14
+ return (HttpClientEvents.GetExecutionProperty_Event !== null) ? HttpClientEvents.GetExecutionProperty_Event(propertyName) : null;
15
+ }
16
+ static GetGlobalUniqueSessionID() {
17
+ return (HttpClientEvents.GetGlobalUniqueSessionID_Event !== null) ? HttpClientEvents.GetGlobalUniqueSessionID_Event() : null;
18
+ }
19
+ static ShouldDisplayGenericError() {
20
+ return HttpClientEvents.ShouldDisplayGenericError_Event === null || HttpClientEvents.ShouldDisplayGenericError_Event();
21
+ }
22
+ static GetRuntimeCtxID() {
23
+ return (HttpClientEvents.GetRuntimeCtxID_Event !== null) ? HttpClientEvents.GetRuntimeCtxID_Event() : "";
24
+ }
25
+ static GetSessionCounter() {
26
+ return (HttpClientEvents.GetSessionCounter_Event !== null) ? HttpClientEvents.GetSessionCounter_Event() : 0;
27
+ }
28
+ static CheckAndSetSessionCounter(value) {
29
+ let flag = HttpClientEvents.CheckAndSetSessionCounter_Event !== null;
30
+ if (flag) {
31
+ HttpClientEvents.CheckAndSetSessionCounter_Event(value);
32
+ }
33
+ }
34
+ static ComputeAndLogRequestInfo(contentLength, roundTrip, isLoggingResponse) {
35
+ if (HttpClientEvents.ComputeAndLogRequestInfo_Event !== null)
36
+ HttpClientEvents.ComputeAndLogRequestInfo_Event(contentLength, roundTrip, isLoggingResponse);
37
+ }
38
+ }
39
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiSHR0cENsaWVudEV2ZW50cy5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uLy4uLy4uL3Byb2plY3RzL2VuZ2luZS9zcmMvaHR0cC9jbGllbnQvSHR0cENsaWVudEV2ZW50cy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxNQUFNLE9BQU8sZ0JBQWdCO0lBQzNCLE1BQU0sQ0FBQyxpQ0FBaUMsR0FBaUIsSUFBSSxDQUFDO0lBQzlELE1BQU0sQ0FBQywwQkFBMEIsR0FBcUMsSUFBSSxDQUFDO0lBQzNFLE1BQU0sQ0FBQyw4QkFBOEIsR0FBaUIsSUFBSSxDQUFDO0lBQzNELE1BQU0sQ0FBQywrQkFBK0IsR0FBa0IsSUFBSSxDQUFDO0lBQzdELE1BQU0sQ0FBQyxxQkFBcUIsR0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iAgICBsZXQgZmxhZzogYm9vbGVhbiA9IEh0dHBDbGllbnRFdmVudHMuQ2hlY2tBbmRTZXRTZXNzaW9uQ291bnRlcl9FdmVudCAhPT0gbnVsbDtcclxuICAgIGlmIChmbGFnKSB7XHJcbiAgICAgIEh0dHBDbGllbnRFdmVudHMuQ2hlY2tBbmRTZXRTZXNzaW9uQ291bnRlcl9FdmVudCh2YWx1ZSk7XHJcbiAgICB9XHJcbiAgfVxyXG5cclxuICBzdGF0aWMgQ29tcHV0ZUFuZExvZ1JlcXVlc3RJbmZvKGNvbnRlbnRMZW5ndGg6IG51bWJlciwgcm91bmRUcmlwOiBudW1iZXIsIGlzTG9nZ2luZ1Jlc3BvbnNlOiBib29sZWFuKTogdm9pZCB7XHJcbiAgICBpZiAoSHR0cENsaWVudEV2ZW50cy5Db21wdXRlQW5kTG9nUmVxdWVzdEluZm9fRXZlbnQgIT09IG51bGwpXHJcbiAgICAgIEh0dHBDbGllbnRFdmVudHMuQ29tcHV0ZUFuZExvZ1JlcXVlc3RJbmZvX0V2ZW50KGNvbnRlbnRMZW5ndGgsIHJvdW5kVHJpcCwgaXNMb2dnaW5nUmVzcG9uc2UpO1xyXG4gIH1cclxufVxyXG4iXX0=
@@ -0,0 +1,42 @@
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
+ httpRequest = null;
7
+ headers = new Headers();
8
+ constructor() {
9
+ super();
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,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiSHR0cENsaWVudFN5bmMuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi8uLi9wcm9qZWN0cy9lbmdpbmUvc3JjL2h0dHAvY2xpZW50L0h0dHBDbGllbnRTeW5jLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUNBLE9BQU8sRUFBQyxPQUFPLEVBQVcsTUFBTSxzQkFBc0IsQ0FBQztBQUN2RCxPQUFPLEVBQUMsY0FBYyxFQUFnQixNQUFNLGtCQUFrQixDQUFDO0FBQy9ELE9BQU8sRUFBQyxNQUFNLEVBQUUsZ0JBQWdCLEVBQUUsdUJBQXVCLEVBQUUsSUFBSSxFQUFDLE1BQU0sa0JBQWt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wUmVzcG9uc2U6IEh0dHBSZXNwb25zZTxzdHJpbmc+LCBjbGllbnRJRDogc3RyaW5nLCB1cmxTdHJpbmc6IHN0cmluZywgY29udGVudEZyb21TZXJ2ZXI6IFJlZlBhcmFtPGFueT4sIHRpbWVCZWZvcmVSZXF1ZXN0OiBudW1iZXIpXHJcbiAge1xyXG4gICAgbGV0IHJlc3BvbnNlVGltZTogbnVtYmVyID0gTWlzYy5nZXRTeXN0ZW1NaWxsaXNlY29uZHMoKSAtIHRpbWVCZWZvcmVSZXF1ZXN0O1xyXG5cclxuICAgIGlmIChMb2dnZXIuSW5zdGFuY2UuTG9nTGV2ZWwgPT09IExvZ2dlcl9Mb2dMZXZlbHMuQmFzaWMpXHJcbiAgICAgIExvZ2dlci5JbnN0YW5jZS5Xcml0ZUJhc2ljVG9Mb2coTG9nZ2VyX01lc3NhZ2VEaXJlY3Rpb24uTWVzc2FnZUVudGVyaW5nLFxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEh0dHBDbGllbnRFdmVudHMuR2V0UnVudGltZUN0eElEKCksXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgSHR0cENsaWVudEV2ZW50cy5HZXRTZXNzaW9uQ291bnRlcigpLFxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNsaWVudElELFxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEh0dHBDbGllbnRFdmVudHMuU2hvdWxkRGlzcGxheUdlbmVyaWNFcnJvcigpID8gXCItXCIgOiBuZXcgVVJMKHVybFN0cmluZykuaG9zdCxcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXNwb25zZVRpbWUsXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGhpcy5odHRwUmVxdWVzdC5zdGF0dXMudG9TdHJpbmcoKSxcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBKU09OLnN0cmluZ2lmeSh0aGlzLmh0dHBSZXF1ZXN0LmdldEFsbFJlc3BvbnNlSGVhZGVycygpKSxcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb250ZW50RnJvbVNlcnZlci52YWx1ZS5sZW5ndGgpO1xyXG4gIH1cclxuXHJcbiAgaGFuZGxlSHR0cEVycm9yRXhjZXB0aW9uKGV4OiBhbnksIHVybFN0cmluZzogc3RyaW5nKVxyXG4gIHtcclxuICAgIC8vIE5vIGV4Y2VwdGlvbiBoYW5kbGluZyBmb3IgbGFzdCByZXF1ZXN0IGFuZCBoZW5jZSBqdXN0IHRocm93IHRoZSBleGNlcHRpb25cclxuICAgIHRocm93IGV4O1xyXG4gIH1cclxuXHJcbiAgYXN5bmMgc2hvdWxkUmV0cnkoaHR0cENvbW11bmljYXRpb25UaW1lb3V0TVM6IG51bWJlciwgdXJsU3RyaW5nOiBzdHJpbmcsIGNvbW11bmljYXRpb25zRmFpbHVyZUhhbmRsZXI6IElDb21tdW5pY2F0aW9uc0ZhaWx1cmVIYW5kbGVyLCBleDogYW55LCBzdGFydFRpbWVSZWY6IFJlZlBhcmFtPG51bWJlcj4pOiBQcm9taXNlPGJvb2xlYW4+XHJcbiAge1xyXG4gICAgLy8gTm8gcmV0cnkgc3VwcG9ydGVkIG9uIGxhc3QgcmVxdWVzdFxyXG4gICAgcmV0dXJuIFByb21pc2UucmVzb2x2ZShmYWxzZSk7XHJcbiAgfVxyXG5cclxuICBsb2dBbmRUaHJvd0V4Y2VwdGlvbihleClcclxuICB7XHJcbiAgICAvLyBOLkEuXHJcbiAgfVxyXG5cclxuICBsb2dFeGVjdXRpb25BdHRlbXB0cyhleGVjdXRpb25BdHRlbXB0czogbnVtYmVyKVxyXG4gIHtcclxuICAgIC8vIE4uQS5cclxuICB9XHJcbn1cclxuIl19
@@ -0,0 +1,84 @@
1
+ import { Encoding, NString } from "@magic-xpa/mscorelib";
2
+ import { Logger } from "@magic-xpa/utils";
3
+ export class HttpUtility {
4
+ static EncodingEnabled = true;
5
+ static ASCIIGetString(bytes) {
6
+ return Encoding.ASCII.GetString(bytes, 0, bytes.length);
7
+ }
8
+ static IntToHexCharCode(n) {
9
+ if (n <= 9)
10
+ return n + 0x30;
11
+ return (n - 10) + 0X61;
12
+ }
13
+ static IsSafe(ch) {
14
+ if ((ch >= 'a' && ch <= 'z') ||
15
+ (ch >= 'A' && ch <= 'Z') ||
16
+ (ch >= '0' && ch <= '9'))
17
+ return true;
18
+ switch (ch) {
19
+ case '\'':
20
+ case '(':
21
+ case ')':
22
+ case '*':
23
+ case '-':
24
+ case '.':
25
+ case '_':
26
+ case '!':
27
+ return true;
28
+ }
29
+ return false;
30
+ }
31
+ static UrlEncode(str, e) {
32
+ let encodedStr = null;
33
+ if (str !== null) {
34
+ encodedStr = HttpUtility.ASCIIGetString(HttpUtility.UrlEncodeToBytes(str, e));
35
+ Logger.Instance.WriteServerMessagesToLog(NString.Format("\n String: {0} \n UrlEncoded by: {1} \n To: {2}", str, e, encodedStr));
36
+ }
37
+ return encodedStr;
38
+ }
39
+ static UrlEncodeToBytes(str, e) {
40
+ if (str === null) {
41
+ return null;
42
+ }
43
+ let bytes = e.GetBytes(str);
44
+ return HttpUtility.UrlEncodeBytesToBytesInternal(bytes, 0, bytes.length);
45
+ }
46
+ static UrlEncodeBytesToBytesInternal(bytes, offset, count) {
47
+ if (!HttpUtility.EncodingEnabled) {
48
+ return bytes;
49
+ }
50
+ let num = 0;
51
+ let num2 = 0;
52
+ for (let i = 0; i < count; i++) {
53
+ let ch = String.fromCharCode(bytes[offset + i]);
54
+ if (ch === ' ') {
55
+ num = num++;
56
+ }
57
+ else if (!HttpUtility.IsSafe(ch)) {
58
+ num2 = num2 + 1;
59
+ }
60
+ }
61
+ if (num === 0 && num2 === 0) {
62
+ return bytes;
63
+ }
64
+ let buffer = new Uint8Array(count + num2 * 2);
65
+ let num4 = 0;
66
+ for (let j = 0; j < count; j++) {
67
+ let num6 = bytes[offset + j];
68
+ let ch = String.fromCharCode(num6);
69
+ if (HttpUtility.IsSafe(ch)) {
70
+ buffer[num4++] = num6;
71
+ }
72
+ else if (ch === ' ') {
73
+ buffer[num4++] = 0X2b;
74
+ }
75
+ else {
76
+ buffer[num4++] = 0X25;
77
+ buffer[num4++] = HttpUtility.IntToHexCharCode(num6 >> 4 & 15);
78
+ buffer[num4++] = HttpUtility.IntToHexCharCode(num6 & 15);
79
+ }
80
+ }
81
+ return buffer;
82
+ }
83
+ }
84
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiSHR0cFV0aWxpdHkuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi8uLi9wcm9qZWN0cy9lbmdpbmUvc3JjL2h0dHAvY2xpZW50L0h0dHBVdGlsaXR5LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFBQyxRQUFRLEVBQUUsT0FBTyxFQUFDLE1BQU0sc0JBQXNCLENBQUM7QUFDdkQsT0FBTyxFQUFDLE1BQU0sRUFBQyxNQUFNLGtCQUFrQixDQUFDO0FBS3hDLE1BQU0sT0FBTyxXQUFXO0lBQ3RCLE1BQU0sQ0FBQyxlQUFlLEdBQVksSUFBSSxDQUFDO0lBTS9CLE1BQU0sQ0FBQyxjQUFjLENBQUMsS0FBaUI7UUFDN0MsT0FBTyxRQUFRLENBQUMsS0FBSyxDQUFDLFNBQVMsQ0FBQyxLQUFLLEVBQUUsQ0FBQyxFQUFFLEtBQUssQ0FBQyxNQUFNLENBQUMsQ0FBQztJQUMxRCxDQUFDO0lBRU8sTUFBTSxDQUFDLGdCQUFnQixDQUFDLENBQVM7UUFDdkMsSUFBSSxDQUFDLElBQUksQ0FBQztZQUNSLE9BQU8sQ0FBQyxHQUFHLElBQUksQ0FBQztRQUVsQixPQUFPLENBQUMsQ0FBQyxHQUFHLEVBQU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ICAgICAgIGJ1ZmZlcltudW00KytdID0gMFgyNTtcclxuICAgICAgICBidWZmZXJbbnVtNCsrXSA9IEh0dHBVdGlsaXR5LkludFRvSGV4Q2hhckNvZGUobnVtNiA+PiA0ICYgMTUpO1xyXG4gICAgICAgIGJ1ZmZlcltudW00KytdID0gSHR0cFV0aWxpdHkuSW50VG9IZXhDaGFyQ29kZShudW02ICYgMTUpO1xyXG4gICAgICB9XHJcbiAgICB9XHJcblxyXG4gICAgcmV0dXJuIGJ1ZmZlcjtcclxuICB9XHJcbn1cclxuIl19
@@ -1,2 +1,2 @@
1
- export {};
1
+ export {};
2
2
  //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiSUNvbW11bmljYXRpb25zRmFpbHVyZUhhbmRsZXIuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi8uLi9wcm9qZWN0cy9lbmdpbmUvc3JjL2h0dHAvY2xpZW50L0lDb21tdW5pY2F0aW9uc0ZhaWx1cmVIYW5kbGVyLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiIiLCJzb3VyY2VzQ29udGVudCI6WyJcclxuZXhwb3J0IGludGVyZmFjZSBJQ29tbXVuaWNhdGlvbnNGYWlsdXJlSGFuZGxlciB7XHJcbiAgLy8vIDxzdW1tYXJ5PlxyXG4gIC8vLyBHZXRzIGEgdmFsdWUgZGV0ZXJtaW5pbmcgd2hldGhlciB0aGUgY2FsbGVyIHNob3VsZCByZXRyeSBleGVjdXRpbmcgdGhlXHJcbiAgLy8vIGNvbW11bmljYXRpb25zIHJlcXVlc3QsIHdoaWNoIHdhcyBzZW50IHdoZW4gdGhlIGZhaWx1cmUgb2NjdXJyZWQuXHJcbiAgLy8vIDwvc3VtbWFyeT5cclxuICBTaG91bGRSZXRyeUxhc3RSZXF1ZXN0OiBib29sZWFuO1xyXG5cclxuICAvLy8gPHN1bW1hcnk+XHJcbiAgLy8vI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