@magic-xpa/engine 4.1100.0-dev4110.23 → 4.1100.0-dev4110.236
Sign up to get free protection for your applications and to get access to all the features.
- package/{esm2020 → esm2022}/index.mjs +188 -188
- package/{esm2020 → esm2022}/magic-xpa-engine.mjs +1 -1
- package/esm2022/src/AccessHelper.mjs +15 -0
- package/esm2022/src/ClientManager.mjs +416 -0
- package/esm2022/src/CommandsProcessorBase.mjs +56 -0
- package/esm2022/src/CommandsProcessorManager.mjs +26 -0
- package/esm2022/src/CommandsTable.mjs +162 -0
- package/esm2022/src/ConstInterface.mjs +517 -0
- package/{esm2020 → esm2022}/src/CurrentClientVersion.mjs +2 -2
- package/esm2022/src/FlowMonitorInterface.mjs +16 -0
- package/esm2022/src/GUIManager.mjs +62 -0
- package/esm2022/src/GlobalCommandsManager.mjs +34 -0
- package/esm2022/src/GuiEventsProcessor.mjs +156 -0
- package/{esm2020 → esm2022}/src/ICommandsTable.mjs +1 -1
- package/esm2022/src/ServerConfig.mjs +122 -0
- package/{esm2020 → esm2022}/src/bridge/IGuiEvent.mjs +19 -19
- package/esm2022/src/bridge/MagicBridge.mjs +41 -0
- package/esm2022/src/commands/ClientOriginatedCommandTaskTag.mjs +12 -0
- package/{esm2020 → esm2022}/src/commands/ClientToServer/AddUserLocateDataViewCommand.mjs +8 -8
- package/{esm2020 → esm2022}/src/commands/ClientToServer/AddUserRangeDataviewCommand.mjs +9 -9
- package/{esm2020 → esm2022}/src/commands/ClientToServer/AddUserSortDataViewCommand.mjs +9 -9
- package/{esm2020 → esm2022}/src/commands/ClientToServer/BrowserEscEventCommand.mjs +23 -23
- package/{esm2020 → esm2022}/src/commands/ClientToServer/ClientOriginatedCommand.mjs +14 -14
- package/esm2022/src/commands/ClientToServer/ClientOriginatedCommandSerializer.mjs +60 -0
- package/{esm2020 → esm2022}/src/commands/ClientToServer/ColumnSortEventCommand.mjs +26 -26
- package/esm2022/src/commands/ClientToServer/CommandFactory.mjs +260 -0
- package/esm2022/src/commands/ClientToServer/CommandSerializationHelper.mjs +67 -0
- package/{esm2020 → esm2022}/src/commands/ClientToServer/ComputeEventCommand.mjs +23 -23
- package/{esm2020 → esm2022}/src/commands/ClientToServer/ContextTerminationEventCommand.mjs +20 -20
- package/{esm2020 → esm2022}/src/commands/ClientToServer/ContextTimeoutResetCommand.mjs +19 -19
- package/{esm2020 → esm2022}/src/commands/ClientToServer/ControlItemsRefreshCommand.mjs +8 -8
- package/esm2022/src/commands/ClientToServer/DataViewOutputCommand.mjs +13 -0
- package/{esm2020 → esm2022}/src/commands/ClientToServer/DataviewCommand.mjs +44 -44
- package/esm2022/src/commands/ClientToServer/EvaluateCommand.mjs +37 -0
- package/esm2022/src/commands/ClientToServer/EventCommand.mjs +40 -0
- package/esm2022/src/commands/ClientToServer/ExecOperCommand.mjs +67 -0
- package/esm2022/src/commands/ClientToServer/FetchDataControlValuesEventCommand.mjs +22 -0
- package/{esm2020 → esm2022}/src/commands/ClientToServer/GlobalParamsQueryCommand.mjs +10 -10
- package/{esm2020 → esm2022}/src/commands/ClientToServer/ICommandTaskTag.mjs +1 -1
- package/{esm2020 → esm2022}/src/commands/ClientToServer/IndexChangeEventCommand.mjs +21 -21
- package/esm2022/src/commands/ClientToServer/IniputForceWriteCommand.mjs +23 -0
- package/{esm2020 → esm2022}/src/commands/ClientToServer/NonReversibleExitEventCommand.mjs +23 -23
- package/{esm2020 → esm2022}/src/commands/ClientToServer/QueryCommand.mjs +20 -20
- package/esm2022/src/commands/ClientToServer/RecomputeCommand.mjs +27 -0
- package/esm2022/src/commands/ClientToServer/RefreshEventCommand.mjs +27 -0
- package/esm2022/src/commands/ClientToServer/RefreshScreenEventCommand.mjs +24 -0
- package/esm2022/src/commands/ClientToServer/RollbackEventCommand.mjs +40 -0
- package/{esm2020 → esm2022}/src/commands/ClientToServer/SelectProgramCommand.mjs +14 -14
- package/{esm2020 → esm2022}/src/commands/ClientToServer/SetTransactionStateDataviewCommand.mjs +9 -9
- package/{esm2020 → esm2022}/src/commands/ClientToServer/SubformOpenEventCommand.mjs +21 -21
- package/esm2022/src/commands/ClientToServer/SubformRefreshEventCommand.mjs +24 -0
- package/esm2022/src/commands/ClientToServer/TransactionCommand.mjs +30 -0
- package/{esm2020 → esm2022}/src/commands/ClientToServer/UnloadCommand.mjs +14 -14
- package/esm2022/src/commands/ClientToServer/WriteMessageToServerLogCommand.mjs +18 -0
- package/esm2022/src/commands/DataViewCommandBase.mjs +8 -0
- package/{esm2020 → esm2022}/src/commands/IClientCommand.mjs +1 -1
- package/esm2022/src/commands/IClientTargetedCommand.mjs +13 -0
- package/{esm2020 → esm2022}/src/commands/IClientToServerCommandInfo.mjs +1 -1
- package/esm2022/src/commands/ServerToClient/AbortCommand.mjs +65 -0
- package/{esm2020 → esm2022}/src/commands/ServerToClient/AddLocateCommand.mjs +21 -21
- package/esm2022/src/commands/ServerToClient/AddRangeCommand.mjs +62 -0
- package/esm2022/src/commands/ServerToClient/AddSortCommand.mjs +33 -0
- package/esm2022/src/commands/ServerToClient/ClientRefreshCommand.mjs +25 -0
- package/esm2022/src/commands/ServerToClient/ClientTargetedCommandBase.mjs +24 -0
- package/esm2022/src/commands/ServerToClient/EnhancedVerifyCommand.mjs +45 -0
- package/esm2022/src/commands/ServerToClient/OpenURLCommand.mjs +221 -0
- package/{esm2020 → esm2022}/src/commands/ServerToClient/ResetLocateCommand.mjs +14 -14
- package/{esm2020 → esm2022}/src/commands/ServerToClient/ResetRangeCommand.mjs +14 -14
- package/{esm2020 → esm2022}/src/commands/ServerToClient/ResetSortCommand.mjs +14 -14
- package/esm2022/src/commands/ServerToClient/ResultCommand.mjs +37 -0
- package/esm2022/src/commands/ServerToClient/VerifyCommand.mjs +83 -0
- package/esm2022/src/commands/ServerToClient/XMLBasedCommandBuilder.mjs +132 -0
- package/{esm2020 → esm2022}/src/communications/IConnectionStateManager.mjs +1 -1
- package/esm2022/src/communications/InteractiveCommunicationsFailureHandler.mjs +15 -0
- package/{esm2020 → esm2022}/src/data/DataSourceIdKey.mjs +2 -2
- package/esm2022/src/data/DataView.mjs +1613 -0
- package/{esm2020 → esm2022}/src/data/DataViewBase.mjs +3 -3
- package/esm2022/src/data/DataviewManager.mjs +28 -0
- package/esm2022/src/data/DataviewManagerBase.mjs +15 -0
- package/esm2022/src/data/DvCache.mjs +67 -0
- package/esm2022/src/data/Field.mjs +646 -0
- package/esm2022/src/data/FieldBase.mjs +15 -0
- package/esm2022/src/data/FieldsTable.mjs +103 -0
- package/{esm2020 → esm2022}/src/data/IRecordsTable.mjs +1 -1
- package/esm2022/src/data/Key.mjs +88 -0
- package/esm2022/src/data/Record.mjs +866 -0
- package/{esm2020 → esm2022}/src/data/RecordOutOfDataViewException.mjs +15 -15
- package/esm2022/src/data/RecordsTable.mjs +267 -0
- package/esm2022/src/data/TaskTransactionManager.mjs +103 -0
- package/esm2022/src/data/XMLBasedDcValuesBuilder.mjs +74 -0
- package/{esm2020 → esm2022}/src/enums.mjs +23 -23
- package/esm2022/src/env/EnvVariablesTable.mjs +340 -0
- package/esm2022/src/env/Environment.mjs +487 -0
- package/{esm2020 → esm2022}/src/env/ILanguageData.mjs +1 -1
- package/esm2022/src/env/LanguageData.mjs +227 -0
- package/esm2022/src/env/MirrorString.mjs +65 -0
- package/esm2022/src/event/ActionManager.mjs +91 -0
- package/esm2022/src/event/Event.mjs +1333 -0
- package/esm2022/src/event/EventHandler.mjs +766 -0
- package/esm2022/src/event/EventHandlerPosition.mjs +204 -0
- package/esm2022/src/event/EventsManager.mjs +2988 -0
- package/{esm2020 → esm2022}/src/event/IEventsManager.mjs +6 -6
- package/esm2022/src/event/RunTimeEvent.mjs +399 -0
- package/{esm2020 → esm2022}/src/event/RunTimeEventBase.mjs +3 -3
- package/esm2022/src/event/UserEventsTable.mjs +47 -0
- package/esm2022/src/exp/ExpTable.mjs +57 -0
- package/esm2022/src/exp/Expression.mjs +200 -0
- package/esm2022/src/exp/ExpressionDict.mjs +727 -0
- package/esm2022/src/exp/ExpressionEvaluator.mjs +4206 -0
- package/esm2022/src/exp/ExpressionLocalJpn.mjs +314 -0
- package/esm2022/src/exp/GlobalParamsTable.mjs +85 -0
- package/esm2022/src/exp/YesNoExp.mjs +36 -0
- package/esm2022/src/gui/CreatedFormVector.mjs +23 -0
- package/esm2022/src/gui/FormsTable.mjs +66 -0
- package/esm2022/src/gui/MgControl.mjs +363 -0
- package/esm2022/src/gui/MgForm.mjs +1224 -0
- package/esm2022/src/http/HttpManager.mjs +97 -0
- package/esm2022/src/http/client/HttpClientAsync.mjs +68 -0
- package/esm2022/src/http/client/HttpClientBase.mjs +132 -0
- package/esm2022/src/http/client/HttpClientEvents.mjs +39 -0
- package/esm2022/src/http/client/HttpClientSync.mjs +42 -0
- package/esm2022/src/http/client/HttpUtility.mjs +84 -0
- package/{esm2020 → esm2022}/src/http/client/ICommunicationsFailureHandler.mjs +1 -1
- package/esm2022/src/remote/AddUserLocateRemoteDataViewCommand.mjs +18 -0
- package/esm2022/src/remote/AddUserRangeRemoteDataViewCommand.mjs +18 -0
- package/esm2022/src/remote/AddUserSortRemoteDataViewCommand.mjs +18 -0
- package/esm2022/src/remote/RemoteCommandsProcessor.mjs +880 -0
- package/esm2022/src/remote/RemoteControlItemsRefreshCommand.mjs +25 -0
- package/esm2022/src/remote/RemoteDataViewCommandBase.mjs +24 -0
- package/esm2022/src/remote/RemoteDataViewCommandFactory.mjs +61 -0
- package/{esm2020 → esm2022}/src/remote/RemoteDataViewCommandUpdateNonModifiable.mjs +15 -15
- package/{esm2020 → esm2022}/src/remote/RemoteDataviewManager.mjs +17 -17
- package/{esm2020 → esm2022}/src/remote/RemoteInitDataViewCommand.mjs +10 -10
- package/esm2022/src/remote/ResetUserLocateRemoteDataviewCommand.mjs +17 -0
- package/{esm2020 → esm2022}/src/remote/ResetUserRangeRemoteDataviewCommand.mjs +12 -12
- package/esm2022/src/remote/ResetUserSortRemoteDataviewCommand.mjs +16 -0
- package/esm2022/src/remote/ServerError.mjs +40 -0
- package/esm2022/src/remote/SetTransactionStateRemoteDataViewCommand.mjs +20 -0
- package/esm2022/src/rt/Argument.mjs +265 -0
- package/esm2022/src/rt/ArgumentsList.mjs +103 -0
- package/esm2022/src/rt/Boundary.mjs +152 -0
- package/esm2022/src/rt/CompMainPrgTable.mjs +63 -0
- package/{esm2020 → esm2022}/src/rt/DataviewHeaderBase.mjs +98 -96
- package/{esm2020 → esm2022}/src/rt/DataviewHeaderFactory.mjs +6 -6
- package/esm2022/src/rt/DataviewHeaders.mjs +53 -0
- package/esm2022/src/rt/DataviewHeadersSaxHandler.mjs +38 -0
- package/esm2022/src/rt/ExecutionStack.mjs +94 -0
- package/{esm2020 → esm2022}/src/rt/ExecutionStackEntry.mjs +17 -17
- package/esm2022/src/rt/HandlersTable.mjs +96 -0
- package/{esm2020 → esm2022}/src/rt/IDataSourceViewDefinition.mjs +1 -1
- package/{esm2020 → esm2022}/src/rt/IDataviewHeader.mjs +1 -1
- package/{esm2020 → esm2022}/src/rt/IResultValue.mjs +1 -1
- package/esm2022/src/rt/LastFocusedManager.mjs +65 -0
- package/esm2022/src/rt/Operation.mjs +735 -0
- package/esm2022/src/rt/OperationTable.mjs +67 -0
- package/esm2022/src/rt/Recompute.mjs +355 -0
- package/esm2022/src/rt/RecomputeTable.mjs +63 -0
- package/esm2022/src/rt/RemoteDataviewHeader.mjs +108 -0
- package/esm2022/src/rt/ResultValue.mjs +10 -0
- package/esm2022/src/rt/TableCache.mjs +177 -0
- package/esm2022/src/rt/TableCacheManager.mjs +67 -0
- package/esm2022/src/rt/Transaction.mjs +53 -0
- package/esm2022/src/security/UserDetails.mjs +71 -0
- package/{esm2020 → esm2022}/src/tasks/IMGDataCollection.mjs +1 -1
- package/esm2022/src/tasks/MGData.mjs +552 -0
- package/esm2022/src/tasks/MGDataCollection.mjs +252 -0
- package/esm2022/src/tasks/RCTimer.mjs +63 -0
- package/esm2022/src/tasks/RemoteTaskService.mjs +45 -0
- package/esm2022/src/tasks/Task.mjs +2499 -0
- package/esm2022/src/tasks/TaskBase.mjs +83 -0
- package/esm2022/src/tasks/TaskServiceBase.mjs +25 -0
- package/esm2022/src/tasks/TasksTable.mjs +80 -0
- package/esm2022/src/tasks/sort/Sort.mjs +5 -0
- package/esm2022/src/tasks/sort/SortCollection.mjs +67 -0
- package/esm2022/src/util/ConstUtils.mjs +14 -0
- package/esm2022/src/util/FlowMonitorQueue.mjs +451 -0
- package/esm2022/src/util/HeapSort.mjs +70 -0
- package/{esm2020 → esm2022}/src/util/IMirrorXML.mjs +1 -1
- package/{esm2020 → esm2022}/src/util/IServerConfig.mjs +1 -1
- package/{esm2020 → esm2022}/src/util/MgBlockingQueue.mjs +1 -1
- package/esm2022/src/util/MgPriorityBlockingQueue.mjs +74 -0
- package/esm2022/src/util/MgPriorityQueue.mjs +66 -0
- package/{esm2020 → esm2022}/src/util/ParamParseResult.mjs +7 -7
- package/esm2022/src/util/PrmMap.mjs +152 -0
- package/esm2022/src/util/ReturnResult.mjs +46 -0
- package/esm2022/src/util/ReturnResultBase.mjs +18 -0
- package/esm2022/src/util/Scrambler.mjs +89 -0
- package/esm2022/src/util/UniqueIDUtils.mjs +13 -0
- package/esm2022/src/util/cookie.service.mjs +92 -0
- package/{fesm2020 → fesm2022}/magic-xpa-engine.mjs +29797 -29693
- package/fesm2022/magic-xpa-engine.mjs.map +1 -0
- package/index.d.ts +187 -187
- package/package.json +8 -14
- package/src/AccessHelper.d.ts +20 -20
- package/src/ClientManager.d.ts +35 -32
- package/src/CommandsProcessorBase.d.ts +23 -23
- package/src/CommandsProcessorManager.d.ts +6 -6
- package/src/CommandsTable.d.ts +22 -22
- package/src/ConstInterface.d.ts +516 -515
- package/src/CurrentClientVersion.d.ts +1 -1
- package/src/FlowMonitorInterface.d.ts +15 -15
- package/src/GUIManager.d.ts +17 -17
- package/src/GlobalCommandsManager.d.ts +17 -17
- package/src/GuiEventsProcessor.d.ts +24 -24
- package/src/ICommandsTable.d.ts +9 -9
- package/src/ServerConfig.d.ts +35 -34
- package/src/bridge/IGuiEvent.d.ts +19 -19
- package/src/bridge/MagicBridge.d.ts +16 -16
- package/src/commands/ClientOriginatedCommandTaskTag.d.ts +8 -8
- package/src/commands/ClientToServer/AddUserLocateDataViewCommand.d.ts +4 -4
- package/src/commands/ClientToServer/AddUserRangeDataviewCommand.d.ts +6 -6
- package/src/commands/ClientToServer/AddUserSortDataViewCommand.d.ts +6 -6
- package/src/commands/ClientToServer/BrowserEscEventCommand.d.ts +8 -8
- package/src/commands/ClientToServer/ClientOriginatedCommand.d.ts +8 -8
- package/src/commands/ClientToServer/ClientOriginatedCommandSerializer.d.ts +6 -6
- package/src/commands/ClientToServer/ColumnSortEventCommand.d.ts +10 -10
- package/src/commands/ClientToServer/CommandFactory.d.ts +64 -64
- package/src/commands/ClientToServer/CommandSerializationHelper.d.ts +20 -20
- package/src/commands/ClientToServer/ComputeEventCommand.d.ts +8 -8
- package/src/commands/ClientToServer/ContextTerminationEventCommand.d.ts +7 -7
- package/src/commands/ClientToServer/ContextTimeoutResetCommand.d.ts +7 -7
- package/src/commands/ClientToServer/ControlItemsRefreshCommand.d.ts +6 -6
- package/src/commands/ClientToServer/DataViewOutputCommand.d.ts +9 -9
- package/src/commands/ClientToServer/DataviewCommand.d.ts +32 -32
- package/src/commands/ClientToServer/EvaluateCommand.d.ts +15 -15
- package/src/commands/ClientToServer/EventCommand.d.ts +15 -15
- package/src/commands/ClientToServer/ExecOperCommand.d.ts +23 -23
- package/src/commands/ClientToServer/FetchDataControlValuesEventCommand.d.ts +8 -8
- package/src/commands/ClientToServer/GlobalParamsQueryCommand.d.ts +5 -5
- package/src/commands/ClientToServer/ICommandTaskTag.d.ts +3 -3
- package/src/commands/ClientToServer/IndexChangeEventCommand.d.ts +8 -8
- package/src/commands/ClientToServer/IniputForceWriteCommand.d.ts +10 -10
- package/src/commands/ClientToServer/NonReversibleExitEventCommand.d.ts +8 -8
- package/src/commands/ClientToServer/QueryCommand.d.ts +8 -8
- package/src/commands/ClientToServer/RecomputeCommand.d.ts +11 -11
- package/src/commands/ClientToServer/RefreshEventCommand.d.ts +12 -12
- package/src/commands/ClientToServer/RefreshScreenEventCommand.d.ts +10 -10
- package/src/commands/ClientToServer/RollbackEventCommand.d.ts +14 -14
- package/src/commands/ClientToServer/SelectProgramCommand.d.ts +6 -6
- package/src/commands/ClientToServer/SetTransactionStateDataviewCommand.d.ts +5 -5
- package/src/commands/ClientToServer/SubformOpenEventCommand.d.ts +8 -8
- package/src/commands/ClientToServer/SubformRefreshEventCommand.d.ts +9 -9
- package/src/commands/ClientToServer/TransactionCommand.d.ts +12 -12
- package/src/commands/ClientToServer/UnloadCommand.d.ts +7 -7
- package/src/commands/ClientToServer/WriteMessageToServerLogCommand.d.ts +6 -6
- package/src/commands/DataViewCommandBase.d.ts +6 -6
- package/src/commands/IClientCommand.d.ts +2 -2
- package/src/commands/IClientTargetedCommand.d.ts +12 -12
- package/src/commands/IClientToServerCommandInfo.d.ts +3 -3
- package/src/commands/ServerToClient/AbortCommand.d.ts +11 -11
- package/src/commands/ServerToClient/AddLocateCommand.d.ts +6 -6
- package/src/commands/ServerToClient/AddRangeCommand.d.ts +10 -10
- package/src/commands/ServerToClient/AddSortCommand.d.ts +9 -9
- package/src/commands/ServerToClient/ClientRefreshCommand.d.ts +7 -7
- package/src/commands/ServerToClient/ClientTargetedCommandBase.d.ts +12 -12
- package/src/commands/ServerToClient/EnhancedVerifyCommand.d.ts +13 -13
- package/src/commands/ServerToClient/OpenURLCommand.d.ts +21 -21
- package/src/commands/ServerToClient/ResetLocateCommand.d.ts +6 -6
- package/src/commands/ServerToClient/ResetRangeCommand.d.ts +6 -6
- package/src/commands/ServerToClient/ResetSortCommand.d.ts +6 -6
- package/src/commands/ServerToClient/ResultCommand.d.ts +10 -10
- package/src/commands/ServerToClient/VerifyCommand.d.ts +17 -17
- package/src/commands/ServerToClient/XMLBasedCommandBuilder.d.ts +11 -11
- package/src/communications/IConnectionStateManager.d.ts +4 -4
- package/src/communications/InteractiveCommunicationsFailureHandler.d.ts +6 -6
- package/src/data/DataSourceIdKey.d.ts +2 -2
- package/src/data/DataView.d.ts +162 -162
- package/src/data/DataViewBase.d.ts +12 -12
- package/src/data/DataviewManager.d.ts +14 -14
- package/src/data/DataviewManagerBase.d.ts +11 -11
- package/src/data/DvCache.d.ts +15 -15
- package/src/data/Field.d.ts +103 -103
- package/src/data/FieldBase.d.ts +23 -23
- package/src/data/FieldsTable.d.ts +27 -27
- package/src/data/IRecordsTable.d.ts +7 -7
- package/src/data/Key.d.ts +15 -15
- package/src/data/Record.d.ts +156 -156
- package/src/data/RecordOutOfDataViewException.d.ts +10 -10
- package/src/data/RecordsTable.d.ts +38 -38
- package/src/data/TaskTransactionManager.d.ts +17 -17
- package/src/data/XMLBasedDcValuesBuilder.d.ts +11 -11
- package/src/enums.d.ts +21 -21
- package/src/env/EnvVariablesTable.d.ts +17 -17
- package/src/env/Environment.d.ts +118 -118
- package/src/env/ILanguageData.d.ts +3 -3
- package/src/env/LanguageData.d.ts +20 -20
- package/src/env/MirrorString.d.ts +15 -15
- package/src/event/ActionManager.d.ts +14 -14
- package/src/event/Event.d.ts +79 -79
- package/src/event/EventHandler.d.ts +66 -66
- package/src/event/EventHandlerPosition.d.ts +25 -25
- package/src/event/EventsManager.d.ts +205 -204
- package/src/event/IEventsManager.d.ts +77 -77
- package/src/event/RunTimeEvent.d.ts +126 -123
- package/src/event/RunTimeEventBase.d.ts +5 -5
- package/src/event/UserEventsTable.d.ts +11 -11
- package/src/exp/ExpTable.d.ts +11 -11
- package/src/exp/Expression.d.ts +37 -37
- package/src/exp/ExpressionDict.d.ts +12 -12
- package/src/exp/ExpressionEvaluator.d.ts +198 -198
- package/src/exp/ExpressionLocalJpn.d.ts +18 -18
- package/src/exp/GlobalParamsTable.d.ts +19 -19
- package/src/exp/YesNoExp.d.ts +9 -9
- package/src/gui/CreatedFormVector.d.ts +10 -10
- package/src/gui/FormsTable.d.ts +15 -15
- package/src/gui/MgControl.d.ts +60 -60
- package/src/gui/MgForm.d.ts +96 -93
- package/src/http/HttpManager.d.ts +25 -25
- package/src/http/client/HttpClientAsync.d.ts +16 -16
- package/src/http/client/HttpClientBase.d.ts +30 -30
- package/src/http/client/HttpClientEvents.d.ts +18 -18
- package/src/http/client/HttpClientSync.d.ts +17 -17
- package/src/http/client/HttpUtility.d.ts +10 -10
- package/src/http/client/ICommunicationsFailureHandler.d.ts +5 -5
- package/src/remote/AddUserLocateRemoteDataViewCommand.d.ts +8 -8
- package/src/remote/AddUserRangeRemoteDataViewCommand.d.ts +8 -8
- package/src/remote/AddUserSortRemoteDataViewCommand.d.ts +8 -8
- package/src/remote/RemoteCommandsProcessor.d.ts +51 -51
- package/src/remote/RemoteControlItemsRefreshCommand.d.ts +8 -8
- package/src/remote/RemoteDataViewCommandBase.d.ts +10 -10
- package/src/remote/RemoteDataViewCommandFactory.d.ts +6 -6
- package/src/remote/RemoteDataViewCommandUpdateNonModifiable.d.ts +8 -8
- package/src/remote/RemoteDataviewManager.d.ts +9 -9
- package/src/remote/RemoteInitDataViewCommand.d.ts +7 -7
- package/src/remote/ResetUserLocateRemoteDataviewCommand.d.ts +7 -7
- package/src/remote/ResetUserRangeRemoteDataviewCommand.d.ts +7 -7
- package/src/remote/ResetUserSortRemoteDataviewCommand.d.ts +7 -7
- package/src/remote/ServerError.d.ts +16 -16
- package/src/remote/SetTransactionStateRemoteDataViewCommand.d.ts +8 -8
- package/src/rt/Argument.d.ts +36 -36
- package/src/rt/ArgumentsList.d.ts +24 -24
- package/src/rt/Boundary.d.ts +27 -27
- package/src/rt/CompMainPrgTable.d.ts +10 -10
- package/src/rt/DataviewHeaderBase.d.ts +34 -34
- package/src/rt/DataviewHeaderFactory.d.ts +5 -5
- package/src/rt/DataviewHeaders.d.ts +12 -12
- package/src/rt/DataviewHeadersSaxHandler.d.ts +10 -10
- package/src/rt/ExecutionStack.d.ts +22 -22
- package/src/rt/ExecutionStackEntry.d.ts +7 -7
- package/src/rt/HandlersTable.d.ts +19 -19
- package/src/rt/IDataSourceViewDefinition.d.ts +6 -6
- package/src/rt/IDataviewHeader.d.ts +10 -10
- package/src/rt/IResultValue.d.ts +4 -4
- package/src/rt/LastFocusedManager.d.ts +23 -23
- package/src/rt/Operation.d.ts +97 -97
- package/src/rt/OperationTable.d.ts +15 -15
- package/src/rt/Recompute.d.ts +41 -41
- package/src/rt/RecomputeTable.d.ts +9 -9
- package/src/rt/RemoteDataviewHeader.d.ts +14 -14
- package/src/rt/ResultValue.d.ts +7 -7
- package/src/rt/TableCache.d.ts +29 -29
- package/src/rt/TableCacheManager.d.ts +10 -10
- package/src/rt/Transaction.d.ts +23 -23
- package/src/security/UserDetails.d.ts +16 -16
- package/src/tasks/IMGDataCollection.d.ts +26 -26
- package/src/tasks/MGData.d.ts +63 -63
- package/src/tasks/MGDataCollection.d.ts +42 -42
- package/src/tasks/RCTimer.d.ts +13 -13
- package/src/tasks/RemoteTaskService.d.ts +16 -16
- package/src/tasks/Task.d.ts +312 -312
- package/src/tasks/TaskBase.d.ts +123 -123
- package/src/tasks/TaskServiceBase.d.ts +16 -16
- package/src/tasks/TasksTable.d.ts +21 -21
- package/src/tasks/sort/Sort.d.ts +4 -4
- package/src/tasks/sort/SortCollection.d.ts +11 -11
- package/src/util/ConstUtils.d.ts +3 -3
- package/src/util/FlowMonitorQueue.d.ts +70 -70
- package/src/util/HeapSort.d.ts +6 -6
- package/src/util/IMirrorXML.d.ts +6 -6
- package/src/util/IServerConfig.d.ts +11 -11
- package/src/util/MgBlockingQueue.d.ts +5 -5
- package/src/util/MgPriorityBlockingQueue.d.ts +17 -17
- package/src/util/MgPriorityQueue.d.ts +13 -13
- package/src/util/ParamParseResult.d.ts +6 -6
- package/src/util/PrmMap.d.ts +28 -28
- package/src/util/ReturnResult.d.ts +18 -18
- package/src/util/ReturnResultBase.d.ts +11 -11
- package/src/util/Scrambler.d.ts +10 -10
- package/src/util/UniqueIDUtils.d.ts +4 -4
- package/src/util/cookie.service.d.ts +8 -8
- package/esm2020/src/AccessHelper.mjs +0 -9
- package/esm2020/src/ClientManager.mjs +0 -399
- package/esm2020/src/CommandsProcessorBase.mjs +0 -58
- package/esm2020/src/CommandsProcessorManager.mjs +0 -26
- package/esm2020/src/CommandsTable.mjs +0 -162
- package/esm2020/src/ConstInterface.mjs +0 -516
- package/esm2020/src/FlowMonitorInterface.mjs +0 -16
- package/esm2020/src/GUIManager.mjs +0 -62
- package/esm2020/src/GlobalCommandsManager.mjs +0 -34
- package/esm2020/src/GuiEventsProcessor.mjs +0 -154
- package/esm2020/src/ServerConfig.mjs +0 -117
- package/esm2020/src/bridge/MagicBridge.mjs +0 -41
- package/esm2020/src/commands/ClientOriginatedCommandTaskTag.mjs +0 -11
- package/esm2020/src/commands/ClientToServer/ClientOriginatedCommandSerializer.mjs +0 -60
- package/esm2020/src/commands/ClientToServer/CommandFactory.mjs +0 -260
- package/esm2020/src/commands/ClientToServer/CommandSerializationHelper.mjs +0 -69
- package/esm2020/src/commands/ClientToServer/DataViewOutputCommand.mjs +0 -13
- package/esm2020/src/commands/ClientToServer/EvaluateCommand.mjs +0 -36
- package/esm2020/src/commands/ClientToServer/EventCommand.mjs +0 -40
- package/esm2020/src/commands/ClientToServer/ExecOperCommand.mjs +0 -67
- package/esm2020/src/commands/ClientToServer/FetchDataControlValuesEventCommand.mjs +0 -22
- package/esm2020/src/commands/ClientToServer/IniputForceWriteCommand.mjs +0 -23
- package/esm2020/src/commands/ClientToServer/RecomputeCommand.mjs +0 -27
- package/esm2020/src/commands/ClientToServer/RefreshEventCommand.mjs +0 -27
- package/esm2020/src/commands/ClientToServer/RefreshScreenEventCommand.mjs +0 -24
- package/esm2020/src/commands/ClientToServer/RollbackEventCommand.mjs +0 -39
- package/esm2020/src/commands/ClientToServer/SubformRefreshEventCommand.mjs +0 -24
- package/esm2020/src/commands/ClientToServer/TransactionCommand.mjs +0 -28
- package/esm2020/src/commands/ClientToServer/WriteMessageToServerLogCommand.mjs +0 -18
- package/esm2020/src/commands/DataViewCommandBase.mjs +0 -10
- package/esm2020/src/commands/IClientTargetedCommand.mjs +0 -9
- package/esm2020/src/commands/ServerToClient/AbortCommand.mjs +0 -65
- package/esm2020/src/commands/ServerToClient/AddRangeCommand.mjs +0 -62
- package/esm2020/src/commands/ServerToClient/AddSortCommand.mjs +0 -33
- package/esm2020/src/commands/ServerToClient/ClientRefreshCommand.mjs +0 -25
- package/esm2020/src/commands/ServerToClient/ClientTargetedCommandBase.mjs +0 -27
- package/esm2020/src/commands/ServerToClient/EnhancedVerifyCommand.mjs +0 -45
- package/esm2020/src/commands/ServerToClient/OpenURLCommand.mjs +0 -221
- package/esm2020/src/commands/ServerToClient/ResultCommand.mjs +0 -37
- package/esm2020/src/commands/ServerToClient/VerifyCommand.mjs +0 -83
- package/esm2020/src/commands/ServerToClient/XMLBasedCommandBuilder.mjs +0 -132
- package/esm2020/src/communications/InteractiveCommunicationsFailureHandler.mjs +0 -17
- package/esm2020/src/data/DataView.mjs +0 -1610
- package/esm2020/src/data/DataviewManager.mjs +0 -28
- package/esm2020/src/data/DataviewManagerBase.mjs +0 -15
- package/esm2020/src/data/DvCache.mjs +0 -67
- package/esm2020/src/data/Field.mjs +0 -646
- package/esm2020/src/data/FieldBase.mjs +0 -18
- package/esm2020/src/data/FieldsTable.mjs +0 -103
- package/esm2020/src/data/Key.mjs +0 -88
- package/esm2020/src/data/Record.mjs +0 -846
- package/esm2020/src/data/RecordsTable.mjs +0 -267
- package/esm2020/src/data/TaskTransactionManager.mjs +0 -103
- package/esm2020/src/data/XMLBasedDcValuesBuilder.mjs +0 -74
- package/esm2020/src/env/EnvVariablesTable.mjs +0 -340
- package/esm2020/src/env/Environment.mjs +0 -489
- package/esm2020/src/env/LanguageData.mjs +0 -226
- package/esm2020/src/env/MirrorString.mjs +0 -65
- package/esm2020/src/event/ActionManager.mjs +0 -91
- package/esm2020/src/event/Event.mjs +0 -1333
- package/esm2020/src/event/EventHandler.mjs +0 -766
- package/esm2020/src/event/EventHandlerPosition.mjs +0 -204
- package/esm2020/src/event/EventsManager.mjs +0 -2975
- package/esm2020/src/event/RunTimeEvent.mjs +0 -392
- package/esm2020/src/event/UserEventsTable.mjs +0 -47
- package/esm2020/src/exp/ExpTable.mjs +0 -59
- package/esm2020/src/exp/Expression.mjs +0 -200
- package/esm2020/src/exp/ExpressionDict.mjs +0 -727
- package/esm2020/src/exp/ExpressionEvaluator.mjs +0 -4212
- package/esm2020/src/exp/ExpressionLocalJpn.mjs +0 -314
- package/esm2020/src/exp/GlobalParamsTable.mjs +0 -85
- package/esm2020/src/exp/YesNoExp.mjs +0 -36
- package/esm2020/src/gui/CreatedFormVector.mjs +0 -23
- package/esm2020/src/gui/FormsTable.mjs +0 -66
- package/esm2020/src/gui/MgControl.mjs +0 -353
- package/esm2020/src/gui/MgForm.mjs +0 -1181
- package/esm2020/src/http/HttpManager.mjs +0 -97
- package/esm2020/src/http/client/HttpClientAsync.mjs +0 -67
- package/esm2020/src/http/client/HttpClientBase.mjs +0 -132
- package/esm2020/src/http/client/HttpClientEvents.mjs +0 -39
- package/esm2020/src/http/client/HttpClientSync.mjs +0 -42
- package/esm2020/src/http/client/HttpUtility.mjs +0 -84
- package/esm2020/src/remote/AddUserLocateRemoteDataViewCommand.mjs +0 -18
- package/esm2020/src/remote/AddUserRangeRemoteDataViewCommand.mjs +0 -18
- package/esm2020/src/remote/AddUserSortRemoteDataViewCommand.mjs +0 -18
- package/esm2020/src/remote/RemoteCommandsProcessor.mjs +0 -880
- package/esm2020/src/remote/RemoteControlItemsRefreshCommand.mjs +0 -25
- package/esm2020/src/remote/RemoteDataViewCommandBase.mjs +0 -24
- package/esm2020/src/remote/RemoteDataViewCommandFactory.mjs +0 -61
- package/esm2020/src/remote/ResetUserLocateRemoteDataviewCommand.mjs +0 -17
- package/esm2020/src/remote/ResetUserSortRemoteDataviewCommand.mjs +0 -16
- package/esm2020/src/remote/ServerError.mjs +0 -40
- package/esm2020/src/remote/SetTransactionStateRemoteDataViewCommand.mjs +0 -20
- package/esm2020/src/rt/Argument.mjs +0 -265
- package/esm2020/src/rt/ArgumentsList.mjs +0 -103
- package/esm2020/src/rt/Boundary.mjs +0 -152
- package/esm2020/src/rt/CompMainPrgTable.mjs +0 -65
- package/esm2020/src/rt/DataviewHeaders.mjs +0 -53
- package/esm2020/src/rt/DataviewHeadersSaxHandler.mjs +0 -38
- package/esm2020/src/rt/ExecutionStack.mjs +0 -94
- package/esm2020/src/rt/HandlersTable.mjs +0 -96
- package/esm2020/src/rt/LastFocusedManager.mjs +0 -67
- package/esm2020/src/rt/Operation.mjs +0 -735
- package/esm2020/src/rt/OperationTable.mjs +0 -67
- package/esm2020/src/rt/Recompute.mjs +0 -355
- package/esm2020/src/rt/RecomputeTable.mjs +0 -63
- package/esm2020/src/rt/RemoteDataviewHeader.mjs +0 -108
- package/esm2020/src/rt/ResultValue.mjs +0 -12
- package/esm2020/src/rt/TableCache.mjs +0 -177
- package/esm2020/src/rt/TableCacheManager.mjs +0 -67
- package/esm2020/src/rt/Transaction.mjs +0 -53
- package/esm2020/src/security/UserDetails.mjs +0 -71
- package/esm2020/src/tasks/MGData.mjs +0 -552
- package/esm2020/src/tasks/MGDataCollection.mjs +0 -252
- package/esm2020/src/tasks/RCTimer.mjs +0 -63
- package/esm2020/src/tasks/RemoteTaskService.mjs +0 -45
- package/esm2020/src/tasks/Task.mjs +0 -2495
- package/esm2020/src/tasks/TaskBase.mjs +0 -87
- package/esm2020/src/tasks/TaskServiceBase.mjs +0 -25
- package/esm2020/src/tasks/TasksTable.mjs +0 -80
- package/esm2020/src/tasks/sort/Sort.mjs +0 -7
- package/esm2020/src/tasks/sort/SortCollection.mjs +0 -67
- package/esm2020/src/util/ConstUtils.mjs +0 -14
- package/esm2020/src/util/FlowMonitorQueue.mjs +0 -453
- package/esm2020/src/util/HeapSort.mjs +0 -70
- package/esm2020/src/util/MgPriorityBlockingQueue.mjs +0 -74
- package/esm2020/src/util/MgPriorityQueue.mjs +0 -66
- package/esm2020/src/util/PrmMap.mjs +0 -151
- package/esm2020/src/util/ReturnResult.mjs +0 -46
- package/esm2020/src/util/ReturnResultBase.mjs +0 -18
- package/esm2020/src/util/Scrambler.mjs +0 -89
- package/esm2020/src/util/UniqueIDUtils.mjs +0 -12
- package/esm2020/src/util/cookie.service.mjs +0 -92
- package/fesm2015/magic-xpa-engine.mjs +0 -30835
- package/fesm2015/magic-xpa-engine.mjs.map +0 -1
- 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,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiSHR0cE1hbmFnZXIuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi9wcm9qZWN0cy9lbmdpbmUvc3JjL2h0dHAvSHR0cE1hbmFnZXIudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUFDLG9CQUFvQixFQUFFLEtBQUssRUFBRSxPQUFPLEVBQVcsTUFBTSxzQkFBc0IsQ0FBQztBQUNwRixPQUFPLEVBQUMsTUFBTSxFQUFDLE1BQU0sa0JBQWtCLENBQUM7QUFFeEMsT0FBTyxFQUFDLGNBQWMsRUFBQyxNQUFNLG1CQUFtQixDQUFDO0FBRWpELE9BQU8sRUFBQyxnQkFBZ0IsRUFBQyxNQUFNLDJCQUEyQixDQUFDO0FBRTNELE9BQU8sRUFBQyxjQUFjLEVBQUMsTUFBTSx5QkF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KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKlwiLFxyXG4gICAgICAvLyAgICAgICAgICAgICAgICAgIChjYWNoaW5nU3RyYXRlZ3kuRm91bmRJbkNhY2hlXHJcbiAgICAgIC8vICAgICAgICAgICAgICAgICAgICAgID8gXCJcIlxyXG4gICAgICAvLyAgICAgICAgICAgICAgICAgICAgICA6IE5TdHJpbmcuRm9ybWF0KFwiI3swOk4wfVwiLCBTdGF0aXN0aWNzLkdldFJlcXVlc3RzQ250KCkpXHJcbiAgICAgIC8vICAgICAgICAgICAgICAgICAgKSxcclxuICAgICAgLy8gICAgICAgICAgICAgICAgICBlbGFwc2VkVGltZSxcclxuICAgICAgLy8gICAgICAgICAgICAgICAgICBTdGF0aXN0aWNzLkdldEFjY3VtdWxhdGVkRXh0ZXJuYWxUaW1lKCksIFN0YXRpc3RpY3MuR2V0QWNjdW11bGF0ZWRTZXJ2ZXJUaW1lKCksXHJcbiAgICAgIC8vICAgICAgICAgICAgICAgICAgKGNhY2hpbmdTdHJhdGVneS5Gb3VuZEluQ2FjaGVcclxuICAgICAgLy8gICAgICAgICAgICAgICAgICAgICAgPyBcIlwiXHJcbiAgICAgIC8vICAgICAgICAgICAgICAgICAgICAgIDogKHJlc3BvbnNlICE9IG51bGxcclxuICAgICAgLy8gICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBOU3RyaW5nLkZvcm1hdChcInswOk4wfSBieXRlcyBkb3dubG9hZGVkXCIsIHJlc3BvbnNlLmxlbmd0aClcclxuICAgICAgLy8gICAgICAgICAgICAgICAgICAgICAgICAgICAgOiBcIk51bGwgcmVzcG9uc2UhXCIpXHJcbiAgICAgIC8vICAgICAgICAgICAgICAgICAgKSxcclxuICAgICAgLy8gICAgICAgICAgICAgICAgICBPU0Vudmlyb25tZW50LkVvbFNlcSwgT1NFbnZpcm9ubWVudC5UYWJTZXEpXHJcbiAgICAgIC8vICAgICAgICAgICAgICAgKTtcclxuICAgIH1ccl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Mb2dnZXIuSW5zdGFuY2UuU2hvdWxkTG9nU2VydmVyUmVsYXRlZE1lc3NhZ2VzKCkpIHtcclxuICAgICAgaWYgKCFOU3RyaW5nLklzTnVsbE9yRW1wdHkobXNnKSkge1xyXG4gICAgICAgIG1zZyA9IG1zZyArIFwiOyBhY2Nlc3Npbmcgc2VydmVyIC4uLlwiO1xyXG4gICAgICB9XHJcblxyXG4gICAgICBpZiAocmVxdWVzdENvbnRlbnQgPT09IG51bGwpIHtcclxuICAgICAgICBpZiAoIU5TdHJpbmcuSXNOdWxsT3JFbXB0eShtc2cpKSB7XHJcbiAgICAgICAgICBMb2dnZXIuSW5zdGFuY2UuV3JpdGVTZXJ2ZXJUb0xvZyhtc2cpO1xyXG4gICAgICAgIH1cclxuICAgICAgfVxyXG4gICAgICBlbHNlIHtcclxuICAgICAgICBpZiAoIU5TdHJpbmcuSXNOdWxsT3JFbXB0eShtc2cpKSB7XHJcbiAgICAgICAgICBtc2cgPSBtc2cgKyBcIiBcIjtcclxuICAgICAgICB9XHJcblxyXG4gICAgICAgIG1zZyA9IG1zZyArIFwidXBsb2FkaW5nIFwiICsgcmVxdWVzdENvbnRlbnQubGVuZ3RoICsgXCIgYnl0ZXNcIjtcclxuICAgICAgICBMb2dnZXIuSW5zdGFuY2UuV3JpdGVTZXJ2ZXJUb0xvZyhtc2cpO1xyXG4gICAgICB9XHJcbiAgICB9XHJcbiAgfVxyXG59XHJcbiJdfQ==
|
@@ -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,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiSHR0cENsaWVudEFzeW5jLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vLi4vLi4vcHJvamVjdHMvZW5naW5lL3NyYy9odHRwL2NsaWVudC9IdHRwQ2xpZW50QXN5bmMudHMiXSwibmFtZXMiOltdLCJtYX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vbnNlLmJvZHkgYXMgYW55O1xyXG5cclxuICAgIHJldHVybiBodHRwUmVzcG9uc2U7XHJcbiAgfVxyXG5cclxuICBsb2dSZXNwb25zZShodHRwUmVzcG9uc2U6IEh0dHBSZXNwb25zZTxzdHJpbmc+LCBjbGllbnRJRDogc3RyaW5nLCB1cmxTdHJpbmc6IHN0cmluZywgY29udGVudEZyb21TZXJ2ZXI6IFJlZlBhcmFtPGFueT4sIHRpbWVCZWZvcmVSZXF1ZXN0OiBudW1iZXIpXHJcbiAge1xyXG4gICAgbGV0IHN0YXR1c0NvZGUgPSBodHRwUmVzcG9uc2VbJ3N0YXR1cyddO1xyXG5cclxuICAgIGxldCByZXNwb25zZVRpbWU6IG51bWJlciA9IE1pc2MuZ2V0U3lzdGVtTWlsbGlzZWNvbmRzKCkgLSB0aW1lQmVmb3JlUmVxdWVzdDtcclxuICAgIGlmIChMb2dnZXIuSW5zdGFuY2UuTG9nTGV2ZWwgPT09IExvZ2dlcl9Mb2dMZXZlbHMuQmFzaWMpXHJcbiAgICAgIExvZ2dlci5JbnN0YW5jZS5Xcml0ZUJhc2ljVG9Mb2coTG9nZ2VyX01lc3NhZ2VEaXJlY3Rpb24uTWVzc2FnZUVudGVyaW5nLFxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEh0dHBDbGllbnRFdmVudHMuR2V0UnVudGltZUN0eElEKCksXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgSHR0cENsaWVudEV2ZW50cy5HZXRTZXNzaW9uQ291bnRlcigpLFxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNsaWVudElELFxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEh0dHBDbGllbnRFdmVudHMuU2hvdWxkRGlzcGxheUdlbmVyaWNFcnJvcigpID8gXCItXCIgOiBuZXcgVVJMKHVybFN0cmluZykuaG9zdCxcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXNwb25zZVRpbWUsXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RhdHVzQ29kZS50b1N0cmluZygpLFxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEpTT04uc3RyaW5naWZ5KGh0dHBSZXNwb25zZS5oZWFkZXJzKSxcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb250ZW50RnJvbVNlcnZlci52YWx1ZS5sZW5ndGgpO1xyXG4gIH1cclxuXHJcbiAgaGFuZGxlSHR0cEVycm9yRXhjZXB0aW9uKGV4OiBhbnksIHVybFN0cmluZzogc3RyaW5nKSB7XHJcbiAgICBpZiAoZXggaW5zdGFuY2VvZiBIdHRwRXJyb3JSZXNwb25zZSlcclxuICAgIHtcclxuICAgICAgbGV0IHN0YXR1c0NvZGUgPSBleFsnc3RhdHVzJ107XHJcbiAgICAgIGlmIChzdGF0dXNDb2RlID09PSA0MDQgfHwgc3RhdHVzQ29kZSA9PT0gNDAzKVxyXG4gICAgICAgIHRocm93IG5ldyBXZWJFeGNlcHRpb24obmV3IEVycm9yKFwiYmFkIFVSTDogXCIgKyB1cmxTdHJpbmcgKyBcIiAtIFN0YXR1c0NvZGUgPSBcIiArIHN0YXR1c0NvZGUpKTtcclxuICAgIH1cclxuICB9XHJcblxyXG4gIGFzeW5jIHNob3VsZFJldHJ5KGh0dHBDb21tdW5pY2F0aW9uVGltZW91dE1TOiBudW1iZXIsIHVybFN0cmluZzogc3RyaW5nLCBjb21tdW5pY2F0aW9uc0ZhaWx1cmVIYW5kbGVyOiBJQ29tbXVuaWNhdGlvbnNGYWlsdXJlSGFuZGxlciwgZXg6IGFueSwgc3RhcnRUaW1lUmVmOiBSZWZQYXJhbTxudW1iZXI+KTogUHJvbWlzZTxib29sZWFuPlxyXG4gIHtcclxuICAgIC8vIGRlbGF5IHRoZSB0b3RhbCBodHRwIHRpbWVvdXQgLyAxM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WYgKGNvbW11bmljYXRpb25zRmFpbHVyZUhhbmRsZXIuU2hvdWxkUmV0cnlMYXN0UmVxdWVzdClcclxuICAgICAge1xyXG4gICAgICAgIExvZ2dlci5JbnN0YW5jZS5Xcml0ZVNlcnZlclRvTG9nKE5TdHJpbmcuRm9ybWF0KFwiUmV0cnlpbmcgezB9LCBjb25maXJtZWQgYnkgdXNlciAuLi5cIiwgdXJsU3RyaW5nKSk7XHJcbiAgICAgICAgc3RhcnRUaW1lUmVmLnZhbHVlID0gTWlzYy5nZXRTeXN0ZW1NaWxsaXNlY29uZHMoKTtcclxuICAgICAgICByZXR1cm4gdHJ1ZTtcclxuICAgICAgfVxyXG4gICAgfVxyXG5cclxuICAgIHJldHVybiBmYWxzZTtcclxuICB9XHJcblxyXG4gIGxvZ0FuZFRocm93RXhjZXB0aW9uKGV4KVxyXG4gIHtcclxuICAgIExvZ2dlci5JbnN0YW5jZS5Xcml0ZVdhcm5pbmdUb0xvZ1dpdGhNc2coXCJSZS10aHJvd2luZyAuLi5cIik7XHJcbiAgICBMb2dnZXIuSW5zdGFuY2UuV3JpdGVXYXJuaW5nVG9Mb2coZXgpO1xyXG4gICAgdGhyb3cgbmV3IFdlYkV4Y2VwdGlvbihleCk7XHJcbiAgfVxyXG5cclxuICBsb2dFeGVjdXRpb25BdHRlbXB0cyhleGVjdXRpb25BdHRlbXB0czogbnVtYmVyKVxyXG4gIHtcclxuICAgIGlmIChleGVjdXRpb25BdHRlbXB0cyA+IDEpXHJcbiAgICAgIExvZ2dlci5JbnN0YW5jZS5Xcml0ZVNlcnZlclRvTG9nKE5TdHJpbmcuRm9ybWF0KFwiU3VjY2VlZGVkIGFmdGVyIHswfSBhdHRlbXB0cyAuLi5cIiwgZXhlY3V0aW9uQXR0ZW1wdHMpKTtcclxuICB9XHJcbn1cclxuIl19
|
@@ -1,132 +0,0 @@
|
|
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
|
-
constructor() {
|
17
|
-
this._HTTPMaxURLLength = 2048;
|
18
|
-
this.CommunicationsFailureHandler = null;
|
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,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiSHR0cENsaWVudEJhc2UuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi8uLi9wcm9qZWN0cy9lbmdpbmUvc3JjL2h0dHAvY2xpZW50L0h0dHBDbGllbnRCYXNlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFBQyxPQUFPLEVBQUUsUUFBUSxFQUFFLGFBQWEsRUFBRSxpQkFBaUIsRUFBQyxNQUFNLHNCQUFzQixDQUFDO0FBQ3pGLE9BQU8sRUFBQyxNQUFNLEVBQUUsZ0JBQWdCLEVBQUUsdUJBQXVCLEVBQUUsSUFBSSxFQUFDLE1BQU0sa0JBQWtCLENBQUM7QUFFekYsT0FBTyxFQUFDLGdCQUFnQixFQUFDLE1BQU0sb0JBQW9CLENBQUM7QUFDcEQsT0FBTyxFQUFDLFdBQVcsRUFBZSxNQUFNLHNCQUFzQixDQUFDO0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udEJhc2UuSGVhZGVyc1RvU3RyaW5nKGh0dHBIZWFkZXJzLCBmYWxzZSkpO1xyXG5cclxuICAgICAgICBpZiAoaHR0cE1ldGhvZCA9PT0gUmVxdWVzdE1ldGhvZC5Qb3N0KSB7XHJcbiAgICAgICAgICAvLyBUT0RPOiBIYW5kbGUgRXhwZWN0MTAwQ29udGludWUuXHJcbiAgICAgICAgICAvLyBodHRwV2ViUmVxdWVzdC5TZXJ2aWNlUG9pbnQuRXhwZWN0MTAwQ29udGludWUgPSB0aGlzLkdldEhUVFBFeHBlY3QxMDBDb250aW51ZSgpO1xyXG4gICAgICAgICAgLy8gdGhpcy5Xcml0ZUNvbnRlbnRUb1JlcXVlc3QocmVxdWVzdENvbnRlbnQsIGh0dHBXZWJSZXF1ZXN0KTtcclxuICAgICAgICB9XHJcblxyXG4gICAgICAgIC8vID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT1cclxuICAgICAgICAvLyBzZW5kIHRoZSByZXF1ZXN0ICYgZ2V0IHRoZSByZXNwb25zZTpcclxuICAgICAgICAvLyA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09XHJcbiAgICAgICAgLy8gVE9ETyA6IEhhbmRsZSBlcnJvcnNcclxuICAgICAgICAvLyBUT0RPOiBIYW5kbGUgdGltZW91dFxyXG5cclxuICAgICAgICBsZXQgcmVxdWVzdFRpbWU6bnVtYmVyID0gTWlzYy5nZXRTeXN0ZW1NaWxsaXNlY29uZHMoKTtcclxuXHJcbiAgICAgICAgdGhpcy5Mb2dSZXF1ZXN0SW5mbyghaXNOdWxsT3JVbmRlZmluZWQocmVxdWVzdENvbnRlbnQpID8gcmVxdWVzdENvbnRlbnQubGV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lKTtcclxuICB9XHJcbiAgYWJzdHJhY3QgbG9nQW5kVGhyb3dFeGNlcHRpb24oZXg6IGFueSk7XHJcbiAgYWJzdHJhY3QgbG9nRXhlY3V0aW9uQXR0ZW1wdHMoZXhlY3V0aW9uQXR0ZW1wdHM6IG51bWJlcik7XHJcbn1cclxuIl19
|
@@ -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,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiSHR0cENsaWVudEV2ZW50cy5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uLy4uLy4uL3Byb2plY3RzL2VuZ2luZS9zcmMvaHR0cC9jbGllbnQvSHR0cENsaWVudEV2ZW50cy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxNQUFNLE9BQU8sZ0JBQWdCO0lBVTNCLE1BQU0sQ0FBQywyQkFBMkI7UUFDaEMsT0FBTyxDQUFDLGdCQUFnQixDQUFDLGlDQUFpQyxLQUFLLElBQUksQ0FBQyxDQUFDLENBQUMsQ0FBQyxnQkFBZ0IsQ0FBQyxpQ0FBaUMsRUFBRSxDQUFDLENBQUMsQ0FBQyxJQUFJLENBQUM7SUFDckksQ0FBQztJQUVELE1BQU0sQ0FBQyxvQkFBb0IsQ0FBQyxZQUFvQjtRQUM5QyxPQUFPLENBQUMsZ0JBQWdCLENBQUMsMEJBQTBCLEtBQUssSUFBSSxDQUFDLENBQUMsQ0FBQyxDQUFDLGdCQUFnQixDQUFDLDBCQUEwQixDQUFDLFlBQVksQ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GljIENvbXB1dGVBbmRMb2dSZXF1ZXN0SW5mbyhjb250ZW50TGVuZ3RoOiBudW1iZXIsIHJvdW5kVHJpcDogbnVtYmVyLCBpc0xvZ2dpbmdSZXNwb25zZTogYm9vbGVhbik6IHZvaWQge1xyXG4gICAgaWYgKEh0dHBDbGllbnRFdmVudHMuQ29tcHV0ZUFuZExvZ1JlcXVlc3RJbmZvX0V2ZW50ICE9PSBudWxsKVxyXG4gICAgICBIdHRwQ2xpZW50RXZlbnRzLkNvbXB1dGVBbmRMb2dSZXF1ZXN0SW5mb19FdmVudChjb250ZW50TGVuZ3RoLCByb3VuZFRyaXAsIGlzTG9nZ2luZ1Jlc3BvbnNlKTtcclxuICB9XHJcbn1cclxuIl19
|
@@ -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,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiSHR0cENsaWVudFN5bmMuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi8uLi9wcm9qZWN0cy9lbmdpbmUvc3JjL2h0dHAvY2xpZW50L0h0dHBDbGllbnRTeW5jLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUNBLE9BQU8sRUFBQyxPQUFPLEVBQVcsTUFBTSxzQkFBc0IsQ0FBQztBQUN2RCxPQUFPLEVBQUMsY0FBYyxFQUFnQixNQUFNLGtCQUFrQixDQUFDO0FBQy9ELE9BQU8sRUFBQyxNQUFNLEVBQUUsZ0JBQWdCLEVBQUUsdUJBQXVCLEVBQUUsSUFBSSxFQUFDLE1BQU0sa0JBQWtCLENBQUM7QUFDekYsT0FBTyxFQUFDLGdCQUFnQixFQUFDLE1BQU0sb0JBQW9CLENBQUM7QUFJcEQsTUFB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RyaW5nLCBjb250ZW50RnJvbVNlcnZlcjogUmVmUGFyYW08YW55PiwgdGltZUJlZm9yZVJlcXVlc3Q6IG51bWJlcilcclxuICB7XHJcbiAgICBsZXQgcmVzcG9uc2VUaW1lOiBudW1iZXIgPSBNaXNjLmdldFN5c3RlbU1pbGxpc2Vjb25kcygpIC0gdGltZUJlZm9yZVJlcXVlc3Q7XHJcblxyXG4gICAgaWYgKExvZ2dlci5JbnN0YW5jZS5Mb2dMZXZlbCA9PT0gTG9nZ2VyX0xvZ0xldmVscy5CYXNpYylcclxuICAgICAgTG9nZ2VyLkluc3RhbmNlLldyaXRlQmFzaWNUb0xvZyhMb2dnZXJfTWVzc2FnZURpcmVjdGlvbi5NZXNzYWdlRW50ZXJpbmcsXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgSHR0cENsaWVudEV2ZW50cy5HZXRSdW50aW1lQ3R4SUQoKSxcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBIdHRwQ2xpZW50RXZlbnRzLkdldFNlc3Npb25Db3VudGVyKCksXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2xpZW50SUQsXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgSHR0cENsaWVudEV2ZW50cy5TaG91bGREaXNwbGF5R2VuZXJpY0Vycm9yKCkgPyBcIi1cIiA6IG5ldyBVUkwodXJsU3RyaW5nKS5ob3N0LFxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlc3BvbnNlVGltZSxcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aGlzLmh0dHBSZXF1ZXN0LnN0YXR1cy50b1N0cmluZygpLFxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEpTT04uc3RyaW5naWZ5KHRoaXMuaHR0cFJlcXVlc3QuZ2V0QWxsUmVzcG9uc2VIZWFkZXJzKCkpLFxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnRlbnRGcm9tU2VydmVyLnZhbHVlLmxlbmd0aCk7XHJcbiAgfVxyXG5cclxuICBoYW5kbGVIdHRwRXJyb3JFeGNlcHRpb24oZXg6IGFueSwgdXJsU3RyaW5nOiBzdHJpbmcpXHJcbiAge1xyXG4gICAgLy8gTm8gZXhjZXB0aW9uIGhhbmRsaW5nIGZvciBsYXN0IHJlcXVlc3QgYW5kIGhlbmNlIGp1c3QgdGhyb3cgdGhlIGV4Y2VwdGlvblxyXG4gICAgdGhyb3cgZXg7XHJcbiAgfVxyXG5cclxuICBhc3luYyBzaG91bGRSZXRyeShodHRwQ29tbXVuaWNhdGlvblRpbWVvdXRNUzogbnVtYmVyLCB1cmxTdHJpbmc6IHN0cmluZywgY29tbXVuaWNhdGlvbnNGYWlsdXJlSGFuZGxlcjogSUNvbW11bmljYXRpb25zRmFpbHVyZUhhbmRsZXIsIGV4OiBhbnksIHN0YXJ0VGltZVJlZjogUmVmUGFyYW08bnVtYmVyPik6IFByb21pc2U8Ym9vbGVhbj5cclxuICB7XHJcbiAgICAvLyBObyByZXRyeSBzdXBwb3J0ZWQgb24gbGFzdCByZXF1ZXN0XHJcbiAgICByZXR1cm4gUHJvbWlzZS5yZXNvbHZlKGZhbHNlKTtcclxuICB9XHJcblxyXG4gIGxvZ0FuZFRocm93RXhjZXB0aW9uKGV4KVxyXG4gIHtcclxuICAgIC8vIE4uQS5cclxuICB9XHJcblxyXG4gIGxvZ0V4ZWN1dGlvbkF0dGVtcHRzKGV4ZWN1dGlvbkF0dGVtcHRzOiBudW1iZXIpXHJcbiAge1xyXG4gICAgLy8gTi5BLlxyXG4gIH1cclxufVxyXG4iXX0=
|
@@ -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;
|
81
|
-
}
|
82
|
-
}
|
83
|
-
HttpUtility.EncodingEnabled = true;
|
84
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiSHR0cFV0aWxpdHkuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi8uLi9wcm9qZWN0cy9lbmdpbmUvc3JjL2h0dHAvY2xpZW50L0h0dHBVdGlsaXR5LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFBQyxRQUFRLEVBQUUsT0FBTyxFQUFDLE1BQU0sc0JBQXNCLENBQUM7QUFDdkQsT0FBTyxFQUFDLE1BQU0sRUFBQyxNQUFNLGtCQUFrQixDQUFDO0FBS3hDLE1BQU0sT0FBTyxXQUFXO0lBT2QsTUFBTSxDQUFDLGNBQWMsQ0FBQyxLQUFpQjtRQUM3QyxPQUFPLFFBQVEsQ0FBQyxLQUFLLENBQUMs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lsaXR5LkVuY29kaW5nRW5hYmxlZCkge1xyXG4gICAgICByZXR1cm4gYnl0ZXM7XHJcbiAgICB9XHJcblxyXG4gICAgbGV0IG51bTogbnVtYmVyID0gMDtcclxuICAgIGxldCBudW0yOiBudW1iZXIgPSAwO1xyXG4gICAgZm9yIChsZXQgaTogbnVtYmVyID0gMDsgaSA8IGNvdW50OyBpKyspIHtcclxuICAgICAgbGV0IGNoOiBzdHJpbmcgPSBTdHJpbmcuZnJvbUNoYXJDb2RlKGJ5dGVzW29mZnNldCArIGldKTtcclxuICAgICAgaWYgKGNoID09PSAnICcpIHtcclxuICAgICAgICBudW0gPSBudW0rKztcclxuICAgICAgfVxyXG4gICAgICBlbHNlIGlmICghSHR0cFV0aWxpdHkuSXNTYWZlKGNoKSkge1xyXG4gICAgICAgIG51bTIgPSBudW0yICsgMTtcclxuICAgICAgfVxyXG4gICAgfVxyXG4gICAgaWYgKG51bSA9PT0gMCAmJiBudW0yID09PSAwKSB7XHJcbiAgICAgIHJldHVybiBieXRlcztcclxuICAgIH1cclxuXHJcbiAgICBsZXQgYnVmZmVyOiBVaW50OEFycmF5ID0gbmV3IFVpbnQ4QXJyYXkoY291bnQgKyBudW0yICogMik7XHJcbiAgICBsZXQgbnVtNDogbnVtYmVyID0gMDtcclxuICAgIGZvciAobGV0IGo6IG51bWJlciA9IDA7IGogPCBjb3VudDsgaisrKSB7XHJcbiAgICAgIGxldCBudW02OiBudW1iZXIgPSBieXRlc1tvZmZzZXQgKyBqXTtcclxuICAgICAgLy8gVE9ETzogQ29uc2lkZXIgc2VuZGluZyBudW1iZXIgaW5zdGVhZCBvZiBjcmVhdGluZyBhIG5ldyBzdHJpbmcgZm9yIGVhY2ggYnl0ZS5cclxuICAgICAgbGV0IGNoOiBzdHJpbmcgPSBTdHJpbmcuZnJvbUNoYXJDb2RlKG51bTYpO1xyXG4gICAgICBpZiAoSHR0cFV0aWxpdHkuSXNTYWZlKGNoKSkge1xyXG4gICAgICAgIGJ1ZmZlcltudW00KytdID0gbnVtNjtcclxuICAgICAgfVxyXG4gICAgICBlbHNlIGlmIChjaCA9PT0gJyAnKSB7XHJcbiAgICAgICAgICBidWZmZXJbbnVtNCsrXSA9IDBYMmI7XHJcbiAgICAgIH1cclxuICAgICAgZWxzZSB7XHJcbiAgICAgICAgYnVmZmVyW251bTQrK10gPSAwWDI1O1xyXG4gICAgICAgIGJ1ZmZlcltudW00KytdID0gSHR0cFV0aWxpdHkuSW50VG9IZXhDaGFyQ29kZShudW02ID4+IDQgJiAxNSk7XHJcbiAgICAgICAgYnVmZmVyW251bTQrK10gPSBIdHRwVXRpbGl0eS5JbnRUb0hleENoYXJDb2RlKG51bTYgJiAxNSk7XHJcbiAgICAgIH1cclxuICAgIH1cclxuXHJcbiAgICByZXR1cm4gYnVmZmVyO1xyXG4gIH1cclxufVxyXG4iXX0=
|
@@ -1,18 +0,0 @@
|
|
1
|
-
import { RemoteDataViewCommandBase } from "./RemoteDataViewCommandBase";
|
2
|
-
import { List } from "@magic-xpa/mscorelib";
|
3
|
-
import { ReturnResult } from "../util/ReturnResult";
|
4
|
-
export class AddUserLocateRemoteDataViewCommand extends RemoteDataViewCommandBase {
|
5
|
-
constructor(command) {
|
6
|
-
super(command);
|
7
|
-
this.userRange = null;
|
8
|
-
this.userRange = command.Range;
|
9
|
-
}
|
10
|
-
async Execute() {
|
11
|
-
if (this.Task.UserLocs === null) {
|
12
|
-
this.Task.UserLocs = new List();
|
13
|
-
}
|
14
|
-
this.Task.UserLocs.push(this.userRange);
|
15
|
-
return new ReturnResult();
|
16
|
-
}
|
17
|
-
}
|
18
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiQWRkVXNlckxvY2F0ZVJlbW90ZURhdGFWaWV3Q29tbWFuZC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uLy4uL3Byb2plY3RzL2VuZ2luZS9zcmMvcmVtb3Rl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