@os1-platform/dispatch-mobile 1.0.7 → 1.3.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +90 -26
- package/android/.gradle/6.8/fileChanges/last-build.bin +0 -0
- package/android/.gradle/6.8/fileHashes/fileHashes.lock +0 -0
- package/android/.gradle/6.8/gc.properties +0 -0
- package/android/.gradle/buildOutputCleanup/buildOutputCleanup.lock +0 -0
- package/android/.gradle/buildOutputCleanup/cache.properties +2 -0
- package/android/.gradle/checksums/checksums.lock +0 -0
- package/android/.gradle/configuration-cache/gc.properties +0 -0
- package/android/.gradle/vcs-1/gc.properties +0 -0
- package/android/.idea/gradle.xml +13 -0
- package/android/.idea/misc.xml +4 -0
- package/android/.idea/vcs.xml +6 -0
- package/android/.idea/workspace.xml +131 -0
- package/android/gradle.properties +1 -1
- package/android/local.properties +8 -0
- package/android/src/main/AndroidManifest.xml +0 -1
- package/lib/commonjs/components/dispatch/DispatchExecNavigator.js +46 -39
- package/lib/commonjs/components/dispatch/DispatchExecNavigator.js.map +1 -1
- package/lib/commonjs/components/executiontasks/ExecutionTasksIndex.js +14 -24
- package/lib/commonjs/components/executiontasks/ExecutionTasksIndex.js.map +1 -1
- package/lib/commonjs/components/executiontasks/cancellation/CancelET.js +142 -23
- package/lib/commonjs/components/executiontasks/cancellation/CancelET.js.map +1 -1
- package/lib/commonjs/components/executiontasks/cancellation/CancellationSchema.js.map +1 -1
- package/lib/commonjs/components/executiontasks/captureInput/CaptureText.js +64 -16
- package/lib/commonjs/components/executiontasks/captureInput/CaptureText.js.map +1 -1
- package/lib/commonjs/components/executiontasks/deliver/DeliverET.js +6 -16
- package/lib/commonjs/components/executiontasks/deliver/DeliverET.js.map +1 -1
- package/lib/commonjs/components/executiontasks/deliver/SLDeliverET.js +68 -26
- package/lib/commonjs/components/executiontasks/deliver/SLDeliverET.js.map +1 -1
- package/lib/commonjs/components/executiontasks/display/DisplayModalET.js +4 -13
- package/lib/commonjs/components/executiontasks/display/DisplayModalET.js.map +1 -1
- package/lib/commonjs/components/executiontasks/doodle/DoodleUtils.js +0 -2
- package/lib/commonjs/components/executiontasks/doodle/DoodleUtils.js.map +1 -1
- package/lib/commonjs/components/executiontasks/doodle/SignatureET.js +61 -28
- package/lib/commonjs/components/executiontasks/doodle/SignatureET.js.map +1 -1
- package/lib/commonjs/components/executiontasks/dropCash/DropCashET.js +5 -19
- package/lib/commonjs/components/executiontasks/dropCash/DropCashET.js.map +1 -1
- package/lib/commonjs/components/executiontasks/dropCash/SLDropCash.js +62 -18
- package/lib/commonjs/components/executiontasks/dropCash/SLDropCash.js.map +1 -1
- package/lib/commonjs/components/executiontasks/forms/FormGenerator.js +112 -28
- package/lib/commonjs/components/executiontasks/forms/FormGenerator.js.map +1 -1
- package/lib/commonjs/components/executiontasks/forms/widgets/DateTimeWidget.js +3 -26
- package/lib/commonjs/components/executiontasks/forms/widgets/DateTimeWidget.js.map +1 -1
- package/lib/commonjs/components/executiontasks/forms/widgets/DropdownWidget.js +49 -0
- package/lib/commonjs/components/executiontasks/forms/widgets/DropdownWidget.js.map +1 -0
- package/lib/commonjs/components/executiontasks/forms/widgets/QRBarcodeScannerWidget.js +1 -16
- package/lib/commonjs/components/executiontasks/forms/widgets/QRBarcodeScannerWidget.js.map +1 -1
- package/lib/commonjs/components/executiontasks/forms/widgets/TimeRangeSelector.js +0 -10
- package/lib/commonjs/components/executiontasks/forms/widgets/TimeRangeSelector.js.map +1 -1
- package/lib/commonjs/components/executiontasks/httpRequest/HttpEtUtils.js +4 -13
- package/lib/commonjs/components/executiontasks/httpRequest/HttpEtUtils.js.map +1 -1
- package/lib/commonjs/components/executiontasks/httpRequest/HttpRequestET.js +0 -12
- package/lib/commonjs/components/executiontasks/httpRequest/HttpRequestET.js.map +1 -1
- package/lib/commonjs/components/executiontasks/imageCapture/CaptureSchema.js.map +1 -1
- package/lib/commonjs/components/executiontasks/imageCapture/CaptureUtils.js +7 -35
- package/lib/commonjs/components/executiontasks/imageCapture/CaptureUtils.js.map +1 -1
- package/lib/commonjs/components/executiontasks/imageCapture/ImageCapture.js +74 -49
- package/lib/commonjs/components/executiontasks/imageCapture/ImageCapture.js.map +1 -1
- package/lib/commonjs/components/executiontasks/payments/PaymentStyles.js +0 -4
- package/lib/commonjs/components/executiontasks/payments/PaymentStyles.js.map +1 -1
- package/lib/commonjs/components/executiontasks/payments/PaymentUtils.js +0 -2
- package/lib/commonjs/components/executiontasks/payments/PaymentUtils.js.map +1 -1
- package/lib/commonjs/components/executiontasks/payments/completePayment/CompletePaymentET.js +64 -17
- package/lib/commonjs/components/executiontasks/payments/completePayment/CompletePaymentET.js.map +1 -1
- package/lib/commonjs/components/executiontasks/payments/init/InitPaymentET.js +63 -24
- package/lib/commonjs/components/executiontasks/payments/init/InitPaymentET.js.map +1 -1
- package/lib/commonjs/components/executiontasks/payments/processPayment/ProcessPaymentET.js +71 -22
- package/lib/commonjs/components/executiontasks/payments/processPayment/ProcessPaymentET.js.map +1 -1
- package/lib/commonjs/components/executiontasks/pickup/PickupET.js +5 -15
- package/lib/commonjs/components/executiontasks/pickup/PickupET.js.map +1 -1
- package/lib/commonjs/components/executiontasks/pickup/SLPickupET.js +60 -19
- package/lib/commonjs/components/executiontasks/pickup/SLPickupET.js.map +1 -1
- package/lib/commonjs/components/executiontasks/scan/ScanET.js +843 -0
- package/lib/commonjs/components/executiontasks/scan/ScanET.js.map +1 -0
- package/lib/commonjs/components/executiontasks/scan/ScanSchema.js +6 -0
- package/lib/commonjs/components/executiontasks/scan/ScanSchema.js.map +1 -0
- package/lib/commonjs/components/executiontasks/scan/constants.js +19 -0
- package/lib/commonjs/components/executiontasks/scan/constants.js.map +1 -0
- package/lib/commonjs/components/executiontasks/scan/interfaces.js +29 -0
- package/lib/commonjs/components/executiontasks/scan/interfaces.js.map +1 -0
- package/lib/commonjs/components/executiontasks/scan/sub_components/CScanner.js +103 -0
- package/lib/commonjs/components/executiontasks/scan/sub_components/CScanner.js.map +1 -0
- package/lib/commonjs/components/executiontasks/scan/sub_components/DropDownUtils.js +74 -0
- package/lib/commonjs/components/executiontasks/scan/sub_components/DropDownUtils.js.map +1 -0
- package/lib/commonjs/components/executiontasks/scan/sub_components/ERDropDown.js +115 -0
- package/lib/commonjs/components/executiontasks/scan/sub_components/ERDropDown.js.map +1 -0
- package/lib/commonjs/components/executiontasks/scan/sub_components/ScanList.js +134 -0
- package/lib/commonjs/components/executiontasks/scan/sub_components/ScanList.js.map +1 -0
- package/lib/commonjs/components/executiontasks/scan/utils.js +373 -0
- package/lib/commonjs/components/executiontasks/scan/utils.js.map +1 -0
- package/lib/commonjs/components/executiontasks/scanner/CScanner.js +3 -21
- package/lib/commonjs/components/executiontasks/scanner/CScanner.js.map +1 -1
- package/lib/commonjs/components/executiontasks/scanner/ScannerSchema.js +4 -9
- package/lib/commonjs/components/executiontasks/scanner/ScannerSchema.js.map +1 -1
- package/lib/commonjs/components/executiontasks/scanner/ScannerUtils.js +7 -36
- package/lib/commonjs/components/executiontasks/scanner/ScannerUtils.js.map +1 -1
- package/lib/commonjs/components/executiontasks/scanner/returns/DropDownSelector.js +0 -5
- package/lib/commonjs/components/executiontasks/scanner/returns/DropDownSelector.js.map +1 -1
- package/lib/commonjs/components/executiontasks/scanner/returns/DropDownUtils.js +0 -9
- package/lib/commonjs/components/executiontasks/scanner/returns/DropDownUtils.js.map +1 -1
- package/lib/commonjs/components/executiontasks/scanner/returns/RTReasonSelection.js +0 -14
- package/lib/commonjs/components/executiontasks/scanner/returns/RTReasonSelection.js.map +1 -1
- package/lib/commonjs/components/executiontasks/scanner/returns/RTScan.js +1 -40
- package/lib/commonjs/components/executiontasks/scanner/returns/RTScan.js.map +1 -1
- package/lib/commonjs/components/executiontasks/scanner/returns/ReasonDropDown.js +0 -17
- package/lib/commonjs/components/executiontasks/scanner/returns/ReasonDropDown.js.map +1 -1
- package/lib/commonjs/components/executiontasks/scanner/returns/ScanList.js +0 -28
- package/lib/commonjs/components/executiontasks/scanner/returns/ScanList.js.map +1 -1
- package/lib/commonjs/components/executiontasks/validateOTP/ValidateOTPET.js +334 -0
- package/lib/commonjs/components/executiontasks/validateOTP/ValidateOTPET.js.map +1 -0
- package/lib/commonjs/components/executiontasks/validateOTP/ValidateOTPSchema.js +14 -0
- package/lib/commonjs/components/executiontasks/validateOTP/ValidateOTPSchema.js.map +1 -0
- package/lib/commonjs/components/executiontasks/validateOTP/constants.js +37 -0
- package/lib/commonjs/components/executiontasks/validateOTP/constants.js.map +1 -0
- package/lib/commonjs/components/executiontasks/validateOTP/sub-components/OTPInput.js +59 -0
- package/lib/commonjs/components/executiontasks/validateOTP/sub-components/OTPInput.js.map +1 -0
- package/lib/commonjs/components/executiontasks/validateOTP/utils.js +147 -0
- package/lib/commonjs/components/executiontasks/validateOTP/utils.js.map +1 -0
- package/lib/commonjs/components/executiontasks/verifyLocation/GeofenceUtils.js +0 -13
- package/lib/commonjs/components/executiontasks/verifyLocation/GeofenceUtils.js.map +1 -1
- package/lib/commonjs/components/executiontasks/verifyLocation/VerifyLocationET.js +4 -17
- package/lib/commonjs/components/executiontasks/verifyLocation/VerifyLocationET.js.map +1 -1
- package/lib/commonjs/components/executiontasks/verifyOtp/VerifyOtpET.js +3 -18
- package/lib/commonjs/components/executiontasks/verifyOtp/VerifyOtpET.js.map +1 -1
- package/lib/commonjs/components/widgets/AlertDisplay.js +0 -5
- package/lib/commonjs/components/widgets/AlertDisplay.js.map +1 -1
- package/lib/commonjs/components/widgets/CancelOrderDialog.js +0 -12
- package/lib/commonjs/components/widgets/CancelOrderDialog.js.map +1 -1
- package/lib/commonjs/components/widgets/IconButton.js +34 -0
- package/lib/commonjs/components/widgets/IconButton.js.map +1 -0
- package/lib/commonjs/components/widgets/ProgressDialog.js +0 -7
- package/lib/commonjs/components/widgets/ProgressDialog.js.map +1 -1
- package/lib/commonjs/components/widgets/SnackBarCustom.js +38 -38
- package/lib/commonjs/components/widgets/SnackBarCustom.js.map +1 -1
- package/lib/commonjs/components/widgets/SplitTextInput.js +93 -0
- package/lib/commonjs/components/widgets/SplitTextInput.js.map +1 -0
- package/lib/commonjs/components/widgets/Toaster.js +0 -2
- package/lib/commonjs/components/widgets/Toaster.js.map +1 -1
- package/lib/commonjs/config/DispatchSDKConfig.js +4 -5
- package/lib/commonjs/config/DispatchSDKConfig.js.map +1 -1
- package/lib/commonjs/constants/apiConstants.js +15 -0
- package/lib/commonjs/constants/apiConstants.js.map +1 -0
- package/lib/commonjs/constants/constants.js +7 -3
- package/lib/commonjs/constants/constants.js.map +1 -1
- package/lib/commonjs/constants/statuscode.js +3 -5
- package/lib/commonjs/constants/statuscode.js.map +1 -1
- package/lib/commonjs/errors/BaseError.js +3 -8
- package/lib/commonjs/errors/BaseError.js.map +1 -1
- package/lib/commonjs/errors/ErrorCodes.js +7 -6
- package/lib/commonjs/errors/ErrorCodes.js.map +1 -1
- package/lib/commonjs/events/EventDispatcher.js +27 -0
- package/lib/commonjs/events/EventDispatcher.js.map +1 -0
- package/lib/commonjs/events/EventListener.js +20 -0
- package/lib/commonjs/events/EventListener.js.map +1 -0
- package/lib/commonjs/events/constants.js +13 -0
- package/lib/commonjs/events/constants.js.map +1 -0
- package/lib/commonjs/events/index.js +11 -0
- package/lib/commonjs/events/index.js.map +1 -0
- package/lib/commonjs/events/interface.js +2 -0
- package/lib/commonjs/events/interface.js.map +1 -0
- package/lib/commonjs/index.js +9 -23
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/manager/dispatch/DispatchStateContainer.js +527 -177
- package/lib/commonjs/manager/dispatch/DispatchStateContainer.js.map +1 -1
- package/lib/commonjs/manager/dispatchCodes/EventCodeContainer.js +55 -4
- package/lib/commonjs/manager/dispatchCodes/EventCodeContainer.js.map +1 -1
- package/lib/commonjs/manager/dispatchCodes/EventCodeRepo.js +70 -0
- package/lib/commonjs/manager/dispatchCodes/EventCodeRepo.js.map +1 -0
- package/lib/commonjs/manager/dispatchCodes/ReasonCodeContainer.js +3 -29
- package/lib/commonjs/manager/dispatchCodes/ReasonCodeContainer.js.map +1 -1
- package/lib/commonjs/manager/dispatchCodes/ReasonCodeRepo.js +6 -20
- package/lib/commonjs/manager/dispatchCodes/ReasonCodeRepo.js.map +1 -1
- package/lib/commonjs/manager/jobRemoval/JobRemovalManager.js +27 -0
- package/lib/commonjs/manager/jobRemoval/JobRemovalManager.js.map +1 -0
- package/lib/commonjs/manager/location/LocationManager.js +3 -20
- package/lib/commonjs/manager/location/LocationManager.js.map +1 -1
- package/lib/commonjs/manager/sdk/DispatchSDKManager.js +8 -36
- package/lib/commonjs/manager/sdk/DispatchSDKManager.js.map +1 -1
- package/lib/commonjs/manager/sdk/DispatchSdkCache.js +6 -17
- package/lib/commonjs/manager/sdk/DispatchSdkCache.js.map +1 -1
- package/lib/commonjs/manager/syncmanager/AppSyncManager.js +12 -46
- package/lib/commonjs/manager/syncmanager/AppSyncManager.js.map +1 -1
- package/lib/commonjs/manager/syncmanager/DBConfig.js +13 -7
- package/lib/commonjs/manager/syncmanager/DBConfig.js.map +1 -1
- package/lib/commonjs/manager/syncmanager/NativeSyncManager.js +0 -2
- package/lib/commonjs/manager/syncmanager/NativeSyncManager.js.map +1 -1
- package/lib/commonjs/manager/syncmanager/database.js +28 -12
- package/lib/commonjs/manager/syncmanager/database.js.map +1 -1
- package/lib/commonjs/manager/syncmanager/document/DocumentHttpClient.js +0 -19
- package/lib/commonjs/manager/syncmanager/document/DocumentHttpClient.js.map +1 -1
- package/lib/commonjs/manager/syncmanager/document/DocumentManager.js +3 -20
- package/lib/commonjs/manager/syncmanager/document/DocumentManager.js.map +1 -1
- package/lib/commonjs/manager/syncmanager/document/DocumentSyncManager.js +3 -52
- package/lib/commonjs/manager/syncmanager/document/DocumentSyncManager.js.map +1 -1
- package/lib/commonjs/manager/syncmanager/events/ETEventsManager.js +59 -25
- package/lib/commonjs/manager/syncmanager/events/ETEventsManager.js.map +1 -1
- package/lib/commonjs/manager/syncmanager/events/EventsSyncManager.js +77 -90
- package/lib/commonjs/manager/syncmanager/events/EventsSyncManager.js.map +1 -1
- package/lib/commonjs/manager/syncmanager/events/SyncHttpClient.js +27 -19
- package/lib/commonjs/manager/syncmanager/events/SyncHttpClient.js.map +1 -1
- package/lib/commonjs/models/DispatchModels.js +4 -5
- package/lib/commonjs/models/DispatchModels.js.map +1 -1
- package/lib/commonjs/models/ReasonCodes.js.map +1 -1
- package/lib/commonjs/models/execTasks/ETBaseModels.js.map +1 -1
- package/lib/commonjs/models/execTasks/ETConfig.js +28 -35
- package/lib/commonjs/models/execTasks/ETConfig.js.map +1 -1
- package/lib/commonjs/models/sdk.js +4 -5
- package/lib/commonjs/models/sdk.js.map +1 -1
- package/lib/commonjs/native/signature/SignatureCapture.js +3 -24
- package/lib/commonjs/native/signature/SignatureCapture.js.map +1 -1
- package/lib/commonjs/network/GraphQLClient.js +7 -35
- package/lib/commonjs/network/GraphQLClient.js.map +1 -1
- package/lib/commonjs/network/NetworkClient.js +2 -13
- package/lib/commonjs/network/NetworkClient.js.map +1 -1
- package/lib/commonjs/network/NetworkUtils.js +10 -8
- package/lib/commonjs/network/NetworkUtils.js.map +1 -1
- package/lib/commonjs/network/Queries.js +0 -2
- package/lib/commonjs/network/Queries.js.map +1 -1
- package/lib/commonjs/network/client.js +6 -21
- package/lib/commonjs/network/client.js.map +1 -1
- package/lib/commonjs/res/strings.js.map +1 -1
- package/lib/commonjs/resources/Login.js +4 -15
- package/lib/commonjs/resources/Login.js.map +1 -1
- package/lib/commonjs/resources/network.js +3 -8
- package/lib/commonjs/resources/network.js.map +1 -1
- package/lib/commonjs/styles/SdkColors.js +7 -7
- package/lib/commonjs/styles/SdkColors.js.map +1 -1
- package/lib/commonjs/styles/executionTasks/CommonStyles.js +42 -18
- package/lib/commonjs/styles/executionTasks/CommonStyles.js.map +1 -1
- package/lib/commonjs/ui/screens/CancellationScreen.js +36 -27
- package/lib/commonjs/ui/screens/CancellationScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/CaptureInputScreen.js +6 -15
- package/lib/commonjs/ui/screens/CaptureInputScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/CompleteObjectiveScreen.js +0 -19
- package/lib/commonjs/ui/screens/CompleteObjectiveScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/DeliverScreen.js +6 -15
- package/lib/commonjs/ui/screens/DeliverScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/DisplayScreen.js +7 -12
- package/lib/commonjs/ui/screens/DisplayScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/DoodleScreen.js +6 -16
- package/lib/commonjs/ui/screens/DoodleScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/DropCashScreen.js +6 -18
- package/lib/commonjs/ui/screens/DropCashScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/ETScreensIndex.js +14 -16
- package/lib/commonjs/ui/screens/ETScreensIndex.js.map +1 -1
- package/lib/commonjs/ui/screens/FormsScreen.js +36 -15
- package/lib/commonjs/ui/screens/FormsScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/GeofenceScreen.js +7 -13
- package/lib/commonjs/ui/screens/GeofenceScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/HttpRequestScreen.js +5 -10
- package/lib/commonjs/ui/screens/HttpRequestScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/ImageCaptureScreen.js +27 -14
- package/lib/commonjs/ui/screens/ImageCaptureScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/PaymentScreen.js +11 -23
- package/lib/commonjs/ui/screens/PaymentScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/PickupScreen.js +9 -13
- package/lib/commonjs/ui/screens/PickupScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/RTScanScreen.js +8 -27
- package/lib/commonjs/ui/screens/RTScanScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/ScanScreen.js +268 -0
- package/lib/commonjs/ui/screens/ScanScreen.js.map +1 -0
- package/lib/commonjs/ui/screens/StartWorkFlowScreen.js +21 -30
- package/lib/commonjs/ui/screens/StartWorkFlowScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/ValidateOTPScreen.js +49 -0
- package/lib/commonjs/ui/screens/ValidateOTPScreen.js.map +1 -0
- package/lib/commonjs/ui/screens/WithBaseDispatchScreen.js +0 -10
- package/lib/commonjs/ui/screens/WithBaseDispatchScreen.js.map +1 -1
- package/lib/commonjs/ui/uiConfig/RouteParams.js +9 -1
- package/lib/commonjs/ui/uiConfig/RouteParams.js.map +1 -1
- package/lib/commonjs/utils/ApiUtils.js +115 -0
- package/lib/commonjs/utils/ApiUtils.js.map +1 -0
- package/lib/commonjs/utils/ExecTaskUtils.js +93 -31
- package/lib/commonjs/utils/ExecTaskUtils.js.map +1 -1
- package/lib/commonjs/utils/Logger.js +10 -29
- package/lib/commonjs/utils/Logger.js.map +1 -1
- package/lib/commonjs/utils/NetworkUtil.js +3 -19
- package/lib/commonjs/utils/NetworkUtil.js.map +1 -1
- package/lib/commonjs/utils/SdkUtils.js +2 -31
- package/lib/commonjs/utils/SdkUtils.js.map +1 -1
- package/lib/commonjs/utils/SyncManagerUtils.js +25 -40
- package/lib/commonjs/utils/SyncManagerUtils.js.map +1 -1
- package/lib/commonjs/utils/fcm/FCM.js +35 -16
- package/lib/commonjs/utils/fcm/FCM.js.map +1 -1
- package/lib/commonjs/utils/fcm/FcmUtils.js +50 -25
- package/lib/commonjs/utils/fcm/FcmUtils.js.map +1 -1
- package/lib/commonjs/utils/helper.js +0 -5
- package/lib/commonjs/utils/helper.js.map +1 -1
- package/lib/commonjs/utils/hooks/useTimer.js +44 -0
- package/lib/commonjs/utils/hooks/useTimer.js.map +1 -0
- package/lib/commonjs/utils/loginHelper.js +6 -18
- package/lib/commonjs/utils/loginHelper.js.map +1 -1
- package/lib/commonjs/utils/storage.js +53 -32
- package/lib/commonjs/utils/storage.js.map +1 -1
- package/lib/commonjs/utils/utils.js +8 -11
- package/lib/commonjs/utils/utils.js.map +1 -1
- package/lib/module/components/dispatch/DispatchExecNavigator.js +46 -28
- package/lib/module/components/dispatch/DispatchExecNavigator.js.map +1 -1
- package/lib/module/components/executiontasks/ExecutionTasksIndex.js +3 -1
- package/lib/module/components/executiontasks/ExecutionTasksIndex.js.map +1 -1
- package/lib/module/components/executiontasks/cancellation/CancelET.js +145 -19
- package/lib/module/components/executiontasks/cancellation/CancelET.js.map +1 -1
- package/lib/module/components/executiontasks/cancellation/CancellationSchema.js.map +1 -1
- package/lib/module/components/executiontasks/captureInput/CaptureText.js +66 -9
- package/lib/module/components/executiontasks/captureInput/CaptureText.js.map +1 -1
- package/lib/module/components/executiontasks/deliver/DeliverET.js +6 -7
- package/lib/module/components/executiontasks/deliver/DeliverET.js.map +1 -1
- package/lib/module/components/executiontasks/deliver/SLDeliverET.js +69 -16
- package/lib/module/components/executiontasks/deliver/SLDeliverET.js.map +1 -1
- package/lib/module/components/executiontasks/display/DisplayModalET.js +4 -3
- package/lib/module/components/executiontasks/display/DisplayModalET.js.map +1 -1
- package/lib/module/components/executiontasks/doodle/DoodleUtils.js.map +1 -1
- package/lib/module/components/executiontasks/doodle/SignatureET.js +64 -14
- package/lib/module/components/executiontasks/doodle/SignatureET.js.map +1 -1
- package/lib/module/components/executiontasks/dropCash/DropCashET.js +5 -6
- package/lib/module/components/executiontasks/dropCash/DropCashET.js.map +1 -1
- package/lib/module/components/executiontasks/dropCash/SLDropCash.js +62 -8
- package/lib/module/components/executiontasks/dropCash/SLDropCash.js.map +1 -1
- package/lib/module/components/executiontasks/forms/FormGenerator.js +114 -14
- package/lib/module/components/executiontasks/forms/FormGenerator.js.map +1 -1
- package/lib/module/components/executiontasks/forms/widgets/DateTimeWidget.js +3 -15
- package/lib/module/components/executiontasks/forms/widgets/DateTimeWidget.js.map +1 -1
- package/lib/module/components/executiontasks/forms/widgets/DropdownWidget.js +39 -0
- package/lib/module/components/executiontasks/forms/widgets/DropdownWidget.js.map +1 -0
- package/lib/module/components/executiontasks/forms/widgets/QRBarcodeScannerWidget.js +1 -5
- package/lib/module/components/executiontasks/forms/widgets/QRBarcodeScannerWidget.js.map +1 -1
- package/lib/module/components/executiontasks/forms/widgets/TimeRangeSelector.js +0 -3
- package/lib/module/components/executiontasks/forms/widgets/TimeRangeSelector.js.map +1 -1
- package/lib/module/components/executiontasks/httpRequest/HttpEtUtils.js +4 -2
- package/lib/module/components/executiontasks/httpRequest/HttpEtUtils.js.map +1 -1
- package/lib/module/components/executiontasks/httpRequest/HttpRequestET.js +0 -3
- package/lib/module/components/executiontasks/httpRequest/HttpRequestET.js.map +1 -1
- package/lib/module/components/executiontasks/imageCapture/CaptureSchema.js.map +1 -1
- package/lib/module/components/executiontasks/imageCapture/CaptureUtils.js +7 -10
- package/lib/module/components/executiontasks/imageCapture/CaptureUtils.js.map +1 -1
- package/lib/module/components/executiontasks/imageCapture/ImageCapture.js +75 -35
- package/lib/module/components/executiontasks/imageCapture/ImageCapture.js.map +1 -1
- package/lib/module/components/executiontasks/payments/PaymentStyles.js.map +1 -1
- package/lib/module/components/executiontasks/payments/PaymentUtils.js.map +1 -1
- package/lib/module/components/executiontasks/payments/completePayment/CompletePaymentET.js +64 -6
- package/lib/module/components/executiontasks/payments/completePayment/CompletePaymentET.js.map +1 -1
- package/lib/module/components/executiontasks/payments/init/InitPaymentET.js +63 -11
- package/lib/module/components/executiontasks/payments/init/InitPaymentET.js.map +1 -1
- package/lib/module/components/executiontasks/payments/processPayment/ProcessPaymentET.js +71 -10
- package/lib/module/components/executiontasks/payments/processPayment/ProcessPaymentET.js.map +1 -1
- package/lib/module/components/executiontasks/pickup/PickupET.js +5 -6
- package/lib/module/components/executiontasks/pickup/PickupET.js.map +1 -1
- package/lib/module/components/executiontasks/pickup/SLPickupET.js +61 -10
- package/lib/module/components/executiontasks/pickup/SLPickupET.js.map +1 -1
- package/lib/module/components/executiontasks/scan/ScanET.js +833 -0
- package/lib/module/components/executiontasks/scan/ScanET.js.map +1 -0
- package/lib/module/components/executiontasks/scan/ScanSchema.js +2 -0
- package/lib/module/components/executiontasks/scan/ScanSchema.js.map +1 -0
- package/lib/module/components/executiontasks/scan/constants.js +7 -0
- package/lib/module/components/executiontasks/scan/constants.js.map +1 -0
- package/lib/module/components/executiontasks/scan/interfaces.js +21 -0
- package/lib/module/components/executiontasks/scan/interfaces.js.map +1 -0
- package/lib/module/components/executiontasks/scan/sub_components/CScanner.js +94 -0
- package/lib/module/components/executiontasks/scan/sub_components/CScanner.js.map +1 -0
- package/lib/module/components/executiontasks/scan/sub_components/DropDownUtils.js +66 -0
- package/lib/module/components/executiontasks/scan/sub_components/DropDownUtils.js.map +1 -0
- package/lib/module/components/executiontasks/scan/sub_components/ERDropDown.js +105 -0
- package/lib/module/components/executiontasks/scan/sub_components/ERDropDown.js.map +1 -0
- package/lib/module/components/executiontasks/scan/sub_components/ScanList.js +124 -0
- package/lib/module/components/executiontasks/scan/sub_components/ScanList.js.map +1 -0
- package/lib/module/components/executiontasks/scan/utils.js +358 -0
- package/lib/module/components/executiontasks/scan/utils.js.map +1 -0
- package/lib/module/components/executiontasks/scanner/CScanner.js +3 -8
- package/lib/module/components/executiontasks/scanner/CScanner.js.map +1 -1
- package/lib/module/components/executiontasks/scanner/ScannerSchema.js +3 -3
- package/lib/module/components/executiontasks/scanner/ScannerSchema.js.map +1 -1
- package/lib/module/components/executiontasks/scanner/ScannerUtils.js +6 -18
- package/lib/module/components/executiontasks/scanner/ScannerUtils.js.map +1 -1
- package/lib/module/components/executiontasks/scanner/returns/DropDownSelector.js +0 -2
- package/lib/module/components/executiontasks/scanner/returns/DropDownSelector.js.map +1 -1
- package/lib/module/components/executiontasks/scanner/returns/DropDownUtils.js +0 -5
- package/lib/module/components/executiontasks/scanner/returns/DropDownUtils.js.map +1 -1
- package/lib/module/components/executiontasks/scanner/returns/RTReasonSelection.js +0 -3
- package/lib/module/components/executiontasks/scanner/returns/RTReasonSelection.js.map +1 -1
- package/lib/module/components/executiontasks/scanner/returns/RTScan.js +1 -19
- package/lib/module/components/executiontasks/scanner/returns/RTScan.js.map +1 -1
- package/lib/module/components/executiontasks/scanner/returns/ReasonDropDown.js +0 -7
- package/lib/module/components/executiontasks/scanner/returns/ReasonDropDown.js.map +1 -1
- package/lib/module/components/executiontasks/scanner/returns/ScanList.js +0 -15
- package/lib/module/components/executiontasks/scanner/returns/ScanList.js.map +1 -1
- package/lib/module/components/executiontasks/validateOTP/ValidateOTPET.js +325 -0
- package/lib/module/components/executiontasks/validateOTP/ValidateOTPET.js.map +1 -0
- package/lib/module/components/executiontasks/validateOTP/ValidateOTPSchema.js +8 -0
- package/lib/module/components/executiontasks/validateOTP/ValidateOTPSchema.js.map +1 -0
- package/lib/module/components/executiontasks/validateOTP/constants.js +25 -0
- package/lib/module/components/executiontasks/validateOTP/constants.js.map +1 -0
- package/lib/module/components/executiontasks/validateOTP/sub-components/OTPInput.js +49 -0
- package/lib/module/components/executiontasks/validateOTP/sub-components/OTPInput.js.map +1 -0
- package/lib/module/components/executiontasks/validateOTP/utils.js +133 -0
- package/lib/module/components/executiontasks/validateOTP/utils.js.map +1 -0
- package/lib/module/components/executiontasks/verifyLocation/GeofenceUtils.js +0 -6
- package/lib/module/components/executiontasks/verifyLocation/GeofenceUtils.js.map +1 -1
- package/lib/module/components/executiontasks/verifyLocation/VerifyLocationET.js +4 -3
- package/lib/module/components/executiontasks/verifyLocation/VerifyLocationET.js.map +1 -1
- package/lib/module/components/executiontasks/verifyOtp/VerifyOtpET.js +4 -8
- package/lib/module/components/executiontasks/verifyOtp/VerifyOtpET.js.map +1 -1
- package/lib/module/components/widgets/AlertDisplay.js.map +1 -1
- package/lib/module/components/widgets/CancelOrderDialog.js +0 -2
- package/lib/module/components/widgets/CancelOrderDialog.js.map +1 -1
- package/lib/module/components/widgets/IconButton.js +26 -0
- package/lib/module/components/widgets/IconButton.js.map +1 -0
- package/lib/module/components/widgets/ProgressDialog.js +0 -2
- package/lib/module/components/widgets/ProgressDialog.js.map +1 -1
- package/lib/module/components/widgets/SnackBarCustom.js +36 -18
- package/lib/module/components/widgets/SnackBarCustom.js.map +1 -1
- package/lib/module/components/widgets/SplitTextInput.js +84 -0
- package/lib/module/components/widgets/SplitTextInput.js.map +1 -0
- package/lib/module/components/widgets/Toaster.js.map +1 -1
- package/lib/module/config/DispatchSDKConfig.js +3 -4
- package/lib/module/config/DispatchSDKConfig.js.map +1 -1
- package/lib/module/constants/apiConstants.js +7 -0
- package/lib/module/constants/apiConstants.js.map +1 -0
- package/lib/module/constants/constants.js +4 -2
- package/lib/module/constants/constants.js.map +1 -1
- package/lib/module/constants/statuscode.js +3 -5
- package/lib/module/constants/statuscode.js.map +1 -1
- package/lib/module/errors/BaseError.js +3 -6
- package/lib/module/errors/BaseError.js.map +1 -1
- package/lib/module/errors/ErrorCodes.js +5 -5
- package/lib/module/errors/ErrorCodes.js.map +1 -1
- package/lib/module/events/EventDispatcher.js +19 -0
- package/lib/module/events/EventDispatcher.js.map +1 -0
- package/lib/module/events/EventListener.js +13 -0
- package/lib/module/events/EventListener.js.map +1 -0
- package/lib/module/events/constants.js +6 -0
- package/lib/module/events/constants.js.map +1 -0
- package/lib/module/events/index.js +3 -0
- package/lib/module/events/index.js.map +1 -0
- package/lib/module/events/interface.js +2 -0
- package/lib/module/events/interface.js.map +1 -0
- package/lib/module/index.js +4 -3
- package/lib/module/index.js.map +1 -1
- package/lib/module/manager/dispatch/DispatchStateContainer.js +529 -151
- package/lib/module/manager/dispatch/DispatchStateContainer.js.map +1 -1
- package/lib/module/manager/dispatchCodes/EventCodeContainer.js +52 -2
- package/lib/module/manager/dispatchCodes/EventCodeContainer.js.map +1 -1
- package/lib/module/manager/dispatchCodes/EventCodeRepo.js +61 -0
- package/lib/module/manager/dispatchCodes/EventCodeRepo.js.map +1 -0
- package/lib/module/manager/dispatchCodes/ReasonCodeContainer.js +3 -16
- package/lib/module/manager/dispatchCodes/ReasonCodeContainer.js.map +1 -1
- package/lib/module/manager/dispatchCodes/ReasonCodeRepo.js +6 -14
- package/lib/module/manager/dispatchCodes/ReasonCodeRepo.js.map +1 -1
- package/lib/module/manager/jobRemoval/JobRemovalManager.js +20 -0
- package/lib/module/manager/jobRemoval/JobRemovalManager.js.map +1 -0
- package/lib/module/manager/location/LocationManager.js +3 -14
- package/lib/module/manager/location/LocationManager.js.map +1 -1
- package/lib/module/manager/sdk/DispatchSDKManager.js +8 -14
- package/lib/module/manager/sdk/DispatchSDKManager.js.map +1 -1
- package/lib/module/manager/sdk/DispatchSdkCache.js +6 -13
- package/lib/module/manager/sdk/DispatchSdkCache.js.map +1 -1
- package/lib/module/manager/syncmanager/AppSyncManager.js +12 -26
- package/lib/module/manager/syncmanager/AppSyncManager.js.map +1 -1
- package/lib/module/manager/syncmanager/DBConfig.js +9 -5
- package/lib/module/manager/syncmanager/DBConfig.js.map +1 -1
- package/lib/module/manager/syncmanager/NativeSyncManager.js.map +1 -1
- package/lib/module/manager/syncmanager/database.js +27 -3
- package/lib/module/manager/syncmanager/database.js.map +1 -1
- package/lib/module/manager/syncmanager/document/DocumentHttpClient.js +0 -7
- package/lib/module/manager/syncmanager/document/DocumentHttpClient.js.map +1 -1
- package/lib/module/manager/syncmanager/document/DocumentManager.js +3 -14
- package/lib/module/manager/syncmanager/document/DocumentManager.js.map +1 -1
- package/lib/module/manager/syncmanager/document/DocumentSyncManager.js +3 -35
- package/lib/module/manager/syncmanager/document/DocumentSyncManager.js.map +1 -1
- package/lib/module/manager/syncmanager/events/ETEventsManager.js +59 -18
- package/lib/module/manager/syncmanager/events/ETEventsManager.js.map +1 -1
- package/lib/module/manager/syncmanager/events/EventsSyncManager.js +77 -68
- package/lib/module/manager/syncmanager/events/EventsSyncManager.js.map +1 -1
- package/lib/module/manager/syncmanager/events/SyncHttpClient.js +26 -11
- package/lib/module/manager/syncmanager/events/SyncHttpClient.js.map +1 -1
- package/lib/module/models/DispatchModels.js +3 -4
- package/lib/module/models/DispatchModels.js.map +1 -1
- package/lib/module/models/ReasonCodes.js.map +1 -1
- package/lib/module/models/execTasks/ETBaseModels.js.map +1 -1
- package/lib/module/models/execTasks/ETConfig.js +22 -29
- package/lib/module/models/execTasks/ETConfig.js.map +1 -1
- package/lib/module/models/sdk.js +3 -4
- package/lib/module/models/sdk.js.map +1 -1
- package/lib/module/native/signature/SignatureCapture.js +3 -18
- package/lib/module/native/signature/SignatureCapture.js.map +1 -1
- package/lib/module/network/GraphQLClient.js +6 -26
- package/lib/module/network/GraphQLClient.js.map +1 -1
- package/lib/module/network/NetworkClient.js +2 -6
- package/lib/module/network/NetworkClient.js.map +1 -1
- package/lib/module/network/NetworkUtils.js +10 -3
- package/lib/module/network/NetworkUtils.js.map +1 -1
- package/lib/module/network/Queries.js.map +1 -1
- package/lib/module/network/client.js +7 -17
- package/lib/module/network/client.js.map +1 -1
- package/lib/module/res/strings.js.map +1 -1
- package/lib/module/resources/Login.js +4 -13
- package/lib/module/resources/Login.js.map +1 -1
- package/lib/module/resources/network.js +3 -6
- package/lib/module/resources/network.js.map +1 -1
- package/lib/module/styles/SdkColors.js +6 -6
- package/lib/module/styles/SdkColors.js.map +1 -1
- package/lib/module/styles/executionTasks/CommonStyles.js +41 -7
- package/lib/module/styles/executionTasks/CommonStyles.js.map +1 -1
- package/lib/module/ui/screens/CancellationScreen.js +36 -14
- package/lib/module/ui/screens/CancellationScreen.js.map +1 -1
- package/lib/module/ui/screens/CaptureInputScreen.js +7 -4
- package/lib/module/ui/screens/CaptureInputScreen.js.map +1 -1
- package/lib/module/ui/screens/CompleteObjectiveScreen.js +0 -3
- package/lib/module/ui/screens/CompleteObjectiveScreen.js.map +1 -1
- package/lib/module/ui/screens/DeliverScreen.js +7 -4
- package/lib/module/ui/screens/DeliverScreen.js.map +1 -1
- package/lib/module/ui/screens/DisplayScreen.js +5 -4
- package/lib/module/ui/screens/DisplayScreen.js.map +1 -1
- package/lib/module/ui/screens/DoodleScreen.js +7 -4
- package/lib/module/ui/screens/DoodleScreen.js.map +1 -1
- package/lib/module/ui/screens/DropCashScreen.js +7 -7
- package/lib/module/ui/screens/DropCashScreen.js.map +1 -1
- package/lib/module/ui/screens/ETScreensIndex.js +3 -1
- package/lib/module/ui/screens/ETScreensIndex.js.map +1 -1
- package/lib/module/ui/screens/FormsScreen.js +34 -6
- package/lib/module/ui/screens/FormsScreen.js.map +1 -1
- package/lib/module/ui/screens/GeofenceScreen.js +5 -4
- package/lib/module/ui/screens/GeofenceScreen.js.map +1 -1
- package/lib/module/ui/screens/HttpRequestScreen.js +5 -3
- package/lib/module/ui/screens/HttpRequestScreen.js.map +1 -1
- package/lib/module/ui/screens/ImageCaptureScreen.js +25 -5
- package/lib/module/ui/screens/ImageCaptureScreen.js.map +1 -1
- package/lib/module/ui/screens/PaymentScreen.js +12 -10
- package/lib/module/ui/screens/PaymentScreen.js.map +1 -1
- package/lib/module/ui/screens/PickupScreen.js +7 -5
- package/lib/module/ui/screens/PickupScreen.js.map +1 -1
- package/lib/module/ui/screens/RTScanScreen.js +9 -13
- package/lib/module/ui/screens/RTScanScreen.js.map +1 -1
- package/lib/module/ui/screens/ScanScreen.js +259 -0
- package/lib/module/ui/screens/ScanScreen.js.map +1 -0
- package/lib/module/ui/screens/StartWorkFlowScreen.js +22 -9
- package/lib/module/ui/screens/StartWorkFlowScreen.js.map +1 -1
- package/lib/module/ui/screens/ValidateOTPScreen.js +39 -0
- package/lib/module/ui/screens/ValidateOTPScreen.js.map +1 -0
- package/lib/module/ui/screens/WithBaseDispatchScreen.js +0 -3
- package/lib/module/ui/screens/WithBaseDispatchScreen.js.map +1 -1
- package/lib/module/ui/uiConfig/RouteParams.js +9 -1
- package/lib/module/ui/uiConfig/RouteParams.js.map +1 -1
- package/lib/module/utils/ApiUtils.js +101 -0
- package/lib/module/utils/ApiUtils.js.map +1 -0
- package/lib/module/utils/ExecTaskUtils.js +92 -21
- package/lib/module/utils/ExecTaskUtils.js.map +1 -1
- package/lib/module/utils/Logger.js +9 -21
- package/lib/module/utils/Logger.js.map +1 -1
- package/lib/module/utils/NetworkUtil.js +3 -15
- package/lib/module/utils/NetworkUtil.js.map +1 -1
- package/lib/module/utils/SdkUtils.js +2 -15
- package/lib/module/utils/SdkUtils.js.map +1 -1
- package/lib/module/utils/SyncManagerUtils.js +25 -10
- package/lib/module/utils/SyncManagerUtils.js.map +1 -1
- package/lib/module/utils/fcm/FCM.js +35 -4
- package/lib/module/utils/fcm/FCM.js.map +1 -1
- package/lib/module/utils/fcm/FcmUtils.js +50 -7
- package/lib/module/utils/fcm/FcmUtils.js.map +1 -1
- package/lib/module/utils/helper.js +0 -3
- package/lib/module/utils/helper.js.map +1 -1
- package/lib/module/utils/hooks/useTimer.js +37 -0
- package/lib/module/utils/hooks/useTimer.js.map +1 -0
- package/lib/module/utils/loginHelper.js +6 -16
- package/lib/module/utils/loginHelper.js.map +1 -1
- package/lib/module/utils/storage.js +51 -29
- package/lib/module/utils/storage.js.map +1 -1
- package/lib/module/utils/utils.js +8 -6
- package/lib/module/utils/utils.js.map +1 -1
- package/lib/typescript/components/executiontasks/CompletedWFSchema.d.ts +2 -2
- package/lib/typescript/components/executiontasks/ExecutionTasksIndex.d.ts +6 -2
- package/lib/typescript/components/executiontasks/cancellation/CancellationSchema.d.ts +10 -5
- package/lib/typescript/components/executiontasks/captureInput/CaptureInputSchema.d.ts +7 -7
- package/lib/typescript/components/executiontasks/deliver/DeliverETInput.d.ts +7 -7
- package/lib/typescript/components/executiontasks/display/DisplaySchema.d.ts +5 -5
- package/lib/typescript/components/executiontasks/doodle/SignatureSchema.d.ts +7 -7
- package/lib/typescript/components/executiontasks/dropCash/DropCashSchema.d.ts +2 -2
- package/lib/typescript/components/executiontasks/forms/FormSchema.d.ts +2 -2
- package/lib/typescript/components/executiontasks/forms/widgets/DateTimeWidget.d.ts +1 -1
- package/lib/typescript/components/executiontasks/forms/widgets/DropdownWidget.d.ts +9 -0
- package/lib/typescript/components/executiontasks/httpRequest/HttpRequestETSchema.d.ts +6 -6
- package/lib/typescript/components/executiontasks/imageCapture/CaptureSchema.d.ts +16 -11
- package/lib/typescript/components/executiontasks/payments/completePayment/CompletePaymentSchema.d.ts +2 -2
- package/lib/typescript/components/executiontasks/payments/init/InitPaymentSchema.d.ts +3 -3
- package/lib/typescript/components/executiontasks/payments/processPayment/ProcessPaymentSchema.d.ts +2 -2
- package/lib/typescript/components/executiontasks/pickup/PickpSchema.d.ts +3 -3
- package/lib/typescript/components/executiontasks/scan/ScanET.d.ts +16 -0
- package/lib/typescript/components/executiontasks/scan/ScanSchema.d.ts +70 -0
- package/lib/typescript/components/executiontasks/scan/constants.d.ts +6 -0
- package/lib/typescript/components/executiontasks/scan/interfaces.d.ts +41 -0
- package/lib/typescript/components/executiontasks/scan/sub_components/CScanner.d.ts +7 -0
- package/lib/typescript/components/executiontasks/scan/sub_components/DropDownUtils.d.ts +7 -0
- package/lib/typescript/components/executiontasks/scan/sub_components/ERDropDown.d.ts +17 -0
- package/lib/typescript/components/executiontasks/scan/sub_components/ScanList.d.ts +8 -0
- package/lib/typescript/components/executiontasks/scan/utils.d.ts +21 -0
- package/lib/typescript/components/executiontasks/scanner/ScannerSchema.d.ts +6 -6
- package/lib/typescript/components/executiontasks/scanner/returns/DropDownUtils.d.ts +1 -2
- package/lib/typescript/components/executiontasks/scanner/returns/RTReasonSelection.d.ts +1 -1
- package/lib/typescript/components/executiontasks/scanner/returns/ScanList.d.ts +1 -1
- package/lib/typescript/components/executiontasks/validateOTP/ValidateOTPET.d.ts +4 -0
- package/lib/typescript/components/executiontasks/validateOTP/ValidateOTPSchema.d.ts +54 -0
- package/lib/typescript/components/executiontasks/validateOTP/constants.d.ts +10 -0
- package/lib/typescript/components/executiontasks/validateOTP/sub-components/OTPInput.d.ts +12 -0
- package/lib/typescript/components/executiontasks/validateOTP/utils.d.ts +7 -0
- package/lib/typescript/components/executiontasks/verifyInput/VerifyInputSchema.d.ts +8 -8
- package/lib/typescript/components/executiontasks/verifyLocation/VerifyLocSchema.d.ts +9 -9
- package/lib/typescript/components/executiontasks/verifyOtp/VerifyOtpSchema.d.ts +3 -3
- package/lib/typescript/components/widgets/IconButton.d.ts +9 -0
- package/lib/typescript/components/widgets/SnackBarCustom.d.ts +9 -5
- package/lib/typescript/components/widgets/SplitTextInput.d.ts +12 -0
- package/lib/typescript/constants/apiConstants.d.ts +6 -0
- package/lib/typescript/constants/constants.d.ts +4 -2
- package/lib/typescript/errors/ErrorCodes.d.ts +3 -1
- package/lib/typescript/events/EventDispatcher.d.ts +5 -0
- package/lib/typescript/events/EventListener.d.ts +5 -0
- package/lib/typescript/events/constants.d.ts +5 -0
- package/lib/typescript/events/index.d.ts +2 -0
- package/lib/typescript/events/interface.d.ts +1 -0
- package/lib/typescript/index.d.ts +5 -4
- package/lib/typescript/manager/dispatch/DispatchStateContainer.d.ts +21 -8
- package/lib/typescript/manager/dispatchCodes/EventCodeContainer.d.ts +12 -1
- package/lib/typescript/manager/dispatchCodes/EventCodeRepo.d.ts +13 -0
- package/lib/typescript/manager/jobRemoval/JobRemovalManager.d.ts +6 -0
- package/lib/typescript/manager/sdk/DispatchSdkCache.d.ts +2 -0
- package/lib/typescript/manager/syncmanager/AppSyncManager.d.ts +1 -0
- package/lib/typescript/manager/syncmanager/DBConfig.d.ts +22 -2
- package/lib/typescript/manager/syncmanager/database.d.ts +5 -0
- package/lib/typescript/manager/syncmanager/document/models.d.ts +1 -1
- package/lib/typescript/manager/syncmanager/events/ETEventsManager.d.ts +5 -1
- package/lib/typescript/manager/syncmanager/events/EventsSyncManager.d.ts +5 -1
- package/lib/typescript/manager/syncmanager/events/SyncHttpClient.d.ts +3 -1
- package/lib/typescript/models/DispatchModels.d.ts +56 -1
- package/lib/typescript/models/ReasonCodes.d.ts +5 -0
- package/lib/typescript/models/auth.d.ts +1 -1
- package/lib/typescript/models/execTasks/ETBaseModels.d.ts +27 -8
- package/lib/typescript/models/execTasks/ETConfig.d.ts +8 -4
- package/lib/typescript/models/sdk.d.ts +5 -0
- package/lib/typescript/native/signature/SignatureCapture.d.ts +1 -1
- package/lib/typescript/network/NetworkUtils.d.ts +1 -5
- package/lib/typescript/styles/SdkColors.d.ts +1 -0
- package/lib/typescript/styles/executionTasks/CommonStyles.d.ts +36 -0
- package/lib/typescript/ui/screens/ETScreensIndex.d.ts +3 -1
- package/lib/typescript/ui/screens/ScanScreen.d.ts +3 -0
- package/lib/typescript/ui/screens/ValidateOTPScreen.d.ts +3 -0
- package/lib/typescript/ui/uiConfig/RouteParams.d.ts +8 -0
- package/lib/typescript/utils/ApiUtils.d.ts +61 -0
- package/lib/typescript/utils/ExecTaskUtils.d.ts +7 -2
- package/lib/typescript/utils/NetworkUtil.d.ts +1 -1
- package/lib/typescript/utils/SyncManagerUtils.d.ts +3 -1
- package/lib/typescript/utils/hooks/useTimer.d.ts +5 -0
- package/lib/typescript/utils/storage.d.ts +17 -0
- package/package.json +23 -24
- package/tsconfig.json +9 -8
- package/file_unzip.js +0 -5
- package/mobile-execution-lib-0.6.4.tgz +0 -0
|
@@ -4,86 +4,69 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
-
|
|
8
7
|
var _SyncManagerUtils = require("../../utils/SyncManagerUtils");
|
|
9
|
-
|
|
10
8
|
var _storage = _interopRequireDefault(require("../../utils/storage"));
|
|
11
|
-
|
|
12
|
-
var _mobileExecutionLib = require("mobile-execution-lib");
|
|
13
|
-
|
|
9
|
+
var _mobileExecutionLib = require("@os1-platform/mobile-execution-lib");
|
|
14
10
|
var _Toaster = require("../../components/widgets/Toaster");
|
|
15
|
-
|
|
16
11
|
var _ETConfig = require("../../models/execTasks/ETConfig");
|
|
17
|
-
|
|
18
12
|
var _EventsSyncManager = _interopRequireDefault(require("../syncmanager/events/EventsSyncManager"));
|
|
19
|
-
|
|
20
13
|
var _Logger = _interopRequireWildcard(require("../../utils/Logger"));
|
|
21
|
-
|
|
22
14
|
var _DispatchSdkCache = _interopRequireDefault(require("../sdk/DispatchSdkCache"));
|
|
23
|
-
|
|
24
15
|
var _BaseError = require("../../errors/BaseError");
|
|
25
|
-
|
|
26
16
|
var _ExecTaskUtils = require("../../utils/ExecTaskUtils");
|
|
27
|
-
|
|
28
17
|
var _ReasonCodeContainer = _interopRequireDefault(require("../dispatchCodes/ReasonCodeContainer"));
|
|
29
|
-
|
|
30
18
|
var _ErrorCodes = _interopRequireWildcard(require("../../errors/ErrorCodes"));
|
|
31
|
-
|
|
32
19
|
var _RouteParams = require("../../ui/uiConfig/RouteParams");
|
|
33
|
-
|
|
34
20
|
var _lodash = require("lodash");
|
|
35
|
-
|
|
21
|
+
var _EventDispatcher = _interopRequireDefault(require("../../events/EventDispatcher"));
|
|
22
|
+
var _EventCodeContainer = _interopRequireDefault(require("../dispatchCodes/EventCodeContainer"));
|
|
23
|
+
var _constants = require("../../constants/constants");
|
|
24
|
+
var _AppSyncManager = _interopRequireDefault(require("../syncmanager/AppSyncManager"));
|
|
36
25
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
37
|
-
|
|
38
26
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
39
|
-
|
|
40
27
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
41
|
-
|
|
42
|
-
function
|
|
43
|
-
|
|
28
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
29
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
|
30
|
+
function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
44
31
|
class DispatchStateContainer {
|
|
45
32
|
constructor() {
|
|
33
|
+
_defineProperty(this, "cacheKeys", _DispatchSdkCache.default.KEYS);
|
|
34
|
+
_defineProperty(this, "cache", _DispatchSdkCache.default.getInstance());
|
|
46
35
|
_defineProperty(this, "dispatchExecutor", new _mobileExecutionLib.ExecutionEngine());
|
|
47
|
-
|
|
48
36
|
_defineProperty(this, "successRoute", null);
|
|
49
|
-
|
|
50
37
|
_defineProperty(this, "failureRoute", null);
|
|
51
|
-
|
|
52
38
|
_defineProperty(this, "_stateKeys", []);
|
|
53
|
-
|
|
54
39
|
_defineProperty(this, "_jobObjectives", null);
|
|
55
|
-
|
|
56
40
|
_defineProperty(this, "_mappedStates", new Map());
|
|
57
|
-
|
|
58
|
-
_defineProperty(this, "saveAndProceedToNextET", (0, _lodash.debounce)(async (baseETProps, etOutput, etStates, navigation, isLastTask) => {
|
|
41
|
+
_defineProperty(this, "saveAndProceedToNextET", (0, _lodash.debounce)(async (baseETProps, etOutput, states, navigation, isLastTask, isJobBasedOutput) => {
|
|
59
42
|
try {
|
|
60
|
-
|
|
61
|
-
|
|
43
|
+
// console.log('saveAndProceedToNextET start: ', new Date().getTime());
|
|
44
|
+
// console.log('sendETOutput start: ', new Date().getTime());
|
|
45
|
+
await this.sendETOutput(etOutput, states, isJobBasedOutput);
|
|
46
|
+
// console.log('sendETOutput end: ', new Date().getTime());
|
|
47
|
+
// console.log('moveToNextET start: ', new Date().getTime());
|
|
48
|
+
await this.moveToNextET(etOutput, baseETProps, states, navigation, isLastTask);
|
|
49
|
+
// console.log('moveToNextET end: ', new Date().getTime());
|
|
50
|
+
// console.log('saveAndProceedToNextET end: ', new Date().getTime());
|
|
62
51
|
} catch (error) {
|
|
63
52
|
_Logger.default.getInstance().logEvent('saveAndProceed', error.message, _Logger.LOG_TYPE.SDK_ERROR);
|
|
64
|
-
|
|
65
53
|
baseETProps.showProgress(false);
|
|
66
54
|
(0, _Toaster.showToast)(error.message);
|
|
67
55
|
}
|
|
68
56
|
}, 800));
|
|
69
57
|
}
|
|
70
|
-
|
|
71
58
|
get stateKeys() {
|
|
72
59
|
return this._stateKeys;
|
|
73
60
|
}
|
|
74
|
-
|
|
75
61
|
set stateKeys(value) {
|
|
76
62
|
this._stateKeys = value;
|
|
77
63
|
}
|
|
78
|
-
|
|
79
64
|
get mappedStates() {
|
|
80
65
|
return this._mappedStates;
|
|
81
66
|
}
|
|
82
|
-
|
|
83
67
|
set mappedStates(value) {
|
|
84
68
|
this._mappedStates = value;
|
|
85
69
|
}
|
|
86
|
-
|
|
87
70
|
/**
|
|
88
71
|
* Call this function when dispatch data is fetched successfully in client app
|
|
89
72
|
* @param dispatchID
|
|
@@ -94,21 +77,23 @@ class DispatchStateContainer {
|
|
|
94
77
|
async initDispatchExecutor(dispatchID, jobs, logging, maxTaskReattempt) {
|
|
95
78
|
if (!dispatchID || !jobs || jobs.length < 1) {
|
|
96
79
|
_Logger.default.getInstance().logEvent('initDispatchExecutor', _ErrorCodes.InvalidArgumentsError, _Logger.LOG_TYPE.SDK_WARNING);
|
|
97
|
-
|
|
98
80
|
throw new _BaseError.BaseError(_ErrorCodes.default.InvalidArgumentError, _ErrorCodes.InvalidArgumentsError);
|
|
99
81
|
}
|
|
100
|
-
|
|
101
82
|
let storage = _storage.default.getInstance();
|
|
102
|
-
|
|
103
83
|
await (0, _SyncManagerUtils.clearCache)(dispatchID);
|
|
104
84
|
await _DispatchSdkCache.default.getInstance().setKeyInCache(_DispatchSdkCache.default.KEYS.DISPATCH_ID, dispatchID);
|
|
105
85
|
await (0, _SyncManagerUtils.createFmsFolder)(dispatchID);
|
|
106
86
|
await this.dispatchExecutor.init(dispatchID, jobs, {
|
|
107
|
-
storeDbItemCallback: storage.setObject,
|
|
108
|
-
readDbItemCallback: storage.getObject,
|
|
87
|
+
// storeDbItemCallback: storage.setObject,
|
|
88
|
+
// readDbItemCallback: storage.getObject,
|
|
89
|
+
storeMultipleDbItemCallback: storage.setMultiObject,
|
|
90
|
+
readMultipleDbItemCallback: storage.getMultiObject,
|
|
91
|
+
// storeDbItemCallback: storage.setMultiObject, // NEW CODE
|
|
92
|
+
// readDbItemCallback: storage.getMultiObject, // NEW CODE
|
|
109
93
|
deleteDbItemsCallback: storage.deleteMultiple,
|
|
110
94
|
getDbKeysCallback: storage.getAllKeys,
|
|
111
|
-
eventSyncCallback:
|
|
95
|
+
// eventSyncCallback: pushEventForSync,
|
|
96
|
+
eventBulkSyncCallback: _SyncManagerUtils.pushBulkEventForSync
|
|
112
97
|
}, {
|
|
113
98
|
startTaskName: _ETConfig.FinalETName.START_WORKFLOW,
|
|
114
99
|
successTaskName: _ETConfig.FinalETName.COMPLETED_SUCCESS,
|
|
@@ -118,147 +103,319 @@ class DispatchStateContainer {
|
|
|
118
103
|
});
|
|
119
104
|
}
|
|
120
105
|
|
|
106
|
+
// async getStates(o: any) {
|
|
107
|
+
// let nState: state | null = null;
|
|
108
|
+
// try {
|
|
109
|
+
// // console.log('queryObjective: start ', new Date().getTime());
|
|
110
|
+
// // promises.push(this.queryObjective(o.objectiveId, o.jobId));
|
|
111
|
+
// // nState = await this.queryObjective(o.objectiveId, o.jobId);
|
|
112
|
+
// // console.log('queryObjective: end ', new Date().getTime());
|
|
113
|
+
// } catch (error: any) {
|
|
114
|
+
// Logger.getInstance().logEvent(
|
|
115
|
+
// 'bulkQueryNextET',
|
|
116
|
+
// JSON.stringify({
|
|
117
|
+
// error: error.message,
|
|
118
|
+
// jobId: o.jobId,
|
|
119
|
+
// objRef: o.objectiveId,
|
|
120
|
+
// groupId: o.groupId,
|
|
121
|
+
// additionalData: o.additionalData,
|
|
122
|
+
// }),
|
|
123
|
+
// LOG_TYPE.SDK_ERROR
|
|
124
|
+
// );
|
|
125
|
+
// }
|
|
126
|
+
// if (nState) {
|
|
127
|
+
// if (this._mappedStates.has(nState.taskId)) {
|
|
128
|
+
// let val = this._mappedStates.get(nState.taskId);
|
|
129
|
+
// val?.push({
|
|
130
|
+
// nextState: nState,
|
|
131
|
+
// objRef: o.objectiveId,
|
|
132
|
+
// jobId: o.jobId,
|
|
133
|
+
// groupId: o.groupId,
|
|
134
|
+
// additionalData: o.additionalData,
|
|
135
|
+
// });
|
|
136
|
+
// } else {
|
|
137
|
+
// this._stateKeys.push(nState.taskId);
|
|
138
|
+
// this._mappedStates.set(nState.taskId, [
|
|
139
|
+
// {
|
|
140
|
+
// nextState: nState,
|
|
141
|
+
// objRef: o.objectiveId,
|
|
142
|
+
// jobId: o.jobId,
|
|
143
|
+
// groupId: o.groupId,
|
|
144
|
+
// additionalData: o.additionalData,
|
|
145
|
+
// },
|
|
146
|
+
// ]);
|
|
147
|
+
// }
|
|
148
|
+
// }
|
|
149
|
+
// }
|
|
150
|
+
|
|
121
151
|
async bulkQueryNextET(jobObjectiveList) {
|
|
122
152
|
if (!jobObjectiveList || jobObjectiveList.length === 0) {
|
|
123
153
|
_Logger.default.getInstance().logEvent('bulkQueryNextET', 'CONSTRAINTS FAILED', _Logger.LOG_TYPE.SDK_ERROR);
|
|
124
|
-
|
|
125
154
|
throw new _BaseError.BaseError(_ErrorCodes.default.MERGING_ERROR, 'CONSTRAINTS FAILED');
|
|
126
155
|
}
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
|
|
156
|
+
const _jobObjectiveList = jobObjectiveList.map(o => ({
|
|
157
|
+
objectiveRef: o.objectiveId,
|
|
158
|
+
jobId: o.jobId
|
|
159
|
+
}));
|
|
160
|
+
let nStateArray = [];
|
|
161
|
+
try {
|
|
162
|
+
// @ts-ignore
|
|
163
|
+
nStateArray = await this.bulkQueryObjectives(_jobObjectiveList);
|
|
164
|
+
} catch (error) {
|
|
165
|
+
_Logger.default.getInstance().logEvent('bulkQueryNextET', JSON.stringify({
|
|
166
|
+
error: error.message,
|
|
167
|
+
data: jobObjectiveList.map(_job => _job.jobId)
|
|
168
|
+
}), _Logger.LOG_TYPE.SDK_ERROR);
|
|
169
|
+
}
|
|
170
|
+
if (nStateArray && nStateArray.length) {
|
|
171
|
+
nStateArray.forEach((nState, i) => {
|
|
172
|
+
const o = jobObjectiveList[i];
|
|
142
173
|
if (this._mappedStates.has(nState.taskId)) {
|
|
143
|
-
|
|
144
|
-
|
|
174
|
+
let val = this._mappedStates.get(nState.taskId);
|
|
145
175
|
val === null || val === void 0 ? void 0 : val.push({
|
|
146
176
|
nextState: nState,
|
|
147
177
|
objRef: o.objectiveId,
|
|
148
|
-
jobId: o.jobId
|
|
178
|
+
jobId: o.jobId,
|
|
179
|
+
groupId: o.groupId,
|
|
180
|
+
additionalData: o.additionalData
|
|
149
181
|
});
|
|
150
182
|
} else {
|
|
151
183
|
this._stateKeys.push(nState.taskId);
|
|
152
|
-
|
|
153
184
|
this._mappedStates.set(nState.taskId, [{
|
|
154
185
|
nextState: nState,
|
|
155
186
|
objRef: o.objectiveId,
|
|
156
|
-
jobId: o.jobId
|
|
187
|
+
jobId: o.jobId,
|
|
188
|
+
groupId: o.groupId,
|
|
189
|
+
additionalData: o.additionalData
|
|
157
190
|
}]);
|
|
158
191
|
}
|
|
159
|
-
}
|
|
192
|
+
});
|
|
160
193
|
}
|
|
161
194
|
|
|
162
|
-
|
|
163
|
-
|
|
195
|
+
// OLD CODE
|
|
196
|
+
// console.log('bulkQueryNextET: start ', new Date().getTime());
|
|
197
|
+
// const promises: any[] = [];
|
|
198
|
+
// for (const o of jobObjectiveList) {
|
|
199
|
+
// promises.push(this.getStates(o));
|
|
200
|
+
// }
|
|
201
|
+
// OLD CODE END
|
|
202
|
+
// await Promise.all(promises);
|
|
203
|
+
|
|
204
|
+
// console.log('bulkQueryNextET: end ', new Date().getTime());
|
|
205
|
+
let taskID;
|
|
206
|
+
const currentWorkingTaskId = await this.cache.getKeyFromCache(this.cacheKeys.CURRENT_WORKING_TASK_ID);
|
|
207
|
+
if (currentWorkingTaskId) {
|
|
208
|
+
taskID = currentWorkingTaskId;
|
|
209
|
+
const taskIndx = this._stateKeys.indexOf(taskID);
|
|
210
|
+
if (taskIndx >= 0) {
|
|
211
|
+
this._stateKeys.splice(taskIndx, 1);
|
|
212
|
+
} else taskID = this._stateKeys.pop();
|
|
213
|
+
} else taskID = this._stateKeys.pop();
|
|
164
214
|
if (taskID) {
|
|
165
215
|
const nextStates = this._mappedStates.get(taskID);
|
|
166
|
-
|
|
167
216
|
this._mappedStates.delete(taskID);
|
|
168
217
|
|
|
218
|
+
/* console.log(
|
|
219
|
+
'🚀 ~ file: DispatchStateContainer.tsx:250 ~ DispatchStateContainer ~ nextStates:',
|
|
220
|
+
JSON.stringify(nextStates),
|
|
221
|
+
this._mappedStates
|
|
222
|
+
); */
|
|
169
223
|
return nextStates ?? [];
|
|
170
224
|
} else return null;
|
|
171
225
|
}
|
|
172
226
|
|
|
173
|
-
async queryNextTask(
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
227
|
+
// public async queryNextTask(
|
|
228
|
+
// jobObjectiveList: JobObjectiveType[]
|
|
229
|
+
// ): Promise<PromiseSettledResult<state>[]> {
|
|
230
|
+
// try {
|
|
231
|
+
// const promises: any[] = [];
|
|
232
|
+
// const _jobObjectiveList = jobObjectiveList.map((jobObjective)=>({objectiveRef:jobObjective.objectiveId,jobId:jobObjective.jobId}))
|
|
233
|
+
|
|
234
|
+
// return await this.queryObjectives(_jobObjectiveList)
|
|
235
|
+
// // jobObjectiveList.forEach((jobObjective) => {
|
|
236
|
+
// // promises.push(
|
|
237
|
+
// // this.queryObjective(jobObjective.objectiveId, jobObjective.jobId)
|
|
238
|
+
// // );
|
|
239
|
+
// // });
|
|
240
|
+
// // return await Promise.all(promises);
|
|
241
|
+
// } catch (error: any) {
|
|
242
|
+
// if (error instanceof QuerySucceededObjectiveError) {
|
|
243
|
+
// showToast('OBJECTIVE IS ALREADY COMPLETED');
|
|
244
|
+
// } else if (error instanceof EngineNotReadyError) {
|
|
245
|
+
// showToast('ENGINE NOT READY! Please Try again after some time');
|
|
246
|
+
// } else if (error instanceof ObjectiveNotFoundError) {
|
|
247
|
+
// showToast('NO SUCH OBJECTIVE FOUND');
|
|
248
|
+
// } else if (error instanceof ObjectiveNotReadyError) {
|
|
249
|
+
// showToast('OBJECTIVE NOT READY');
|
|
250
|
+
// } else if (error instanceof ObjectiveJobAlreadyCompletedError) {
|
|
251
|
+
// showToast('OBJECTIVE CANNOT BE ATTEMPTED');
|
|
252
|
+
// } else if (
|
|
253
|
+
// error instanceof JobStatusInvalidError ||
|
|
254
|
+
// error instanceof JobNotFoundError ||
|
|
255
|
+
// error instanceof EmptyJobError ||
|
|
256
|
+
// error instanceof ETIdInvalidError
|
|
257
|
+
// ) {
|
|
258
|
+
// showToast('INVALID JOB');
|
|
259
|
+
// }
|
|
260
|
+
// return null;
|
|
261
|
+
// }
|
|
262
|
+
// }
|
|
263
|
+
|
|
264
|
+
// NEW CODE
|
|
265
|
+
async bulkLockObjectiveStates(lockInput) {
|
|
266
|
+
return await this.dispatchExecutor.lockBulkObjectiveState(lockInput);
|
|
197
267
|
}
|
|
198
268
|
|
|
199
|
-
|
|
200
|
-
|
|
269
|
+
// NEW CODE
|
|
270
|
+
async bulkQueryObjectives(queryInput) {
|
|
271
|
+
return await this.dispatchExecutor.queryBulkObjectiveState(queryInput);
|
|
201
272
|
}
|
|
202
273
|
|
|
203
|
-
async
|
|
274
|
+
// public async queryObjective(objRef: string, jobID: string) {
|
|
275
|
+
// return await this.dispatchExecutor.queryObjectiveState(objRef, jobID);
|
|
276
|
+
// }
|
|
277
|
+
|
|
278
|
+
async sendPendingETOutput(etOutputData, states, isJobBasedOutput) {
|
|
279
|
+
const etOutput = JSON.parse(JSON.stringify(etOutputData));
|
|
280
|
+
const etState = states.pending_states;
|
|
204
281
|
if (!etState || etState.length === 0) {
|
|
205
282
|
_Logger.default.getInstance().logEvent('sendETOutput', 'CONSTRAINTS FAILED', _Logger.LOG_TYPE.SDK_ERROR);
|
|
206
|
-
|
|
207
283
|
return;
|
|
208
284
|
}
|
|
209
|
-
|
|
210
|
-
const
|
|
211
|
-
etState.forEach(objItem => {
|
|
285
|
+
// const promises: any[] = [];
|
|
286
|
+
const _objectiveState = [];
|
|
287
|
+
etState.forEach((objItem, index) => {
|
|
212
288
|
if (objItem.nextState.taskId === _ETConfig.ExecutionTaskID.DELIVER_CASH) {
|
|
213
289
|
var _objItem$nextState$da, _objItem$nextState$da2;
|
|
214
|
-
|
|
215
290
|
etOutput.amount = (_objItem$nextState$da = objItem.nextState.data) === null || _objItem$nextState$da === void 0 ? void 0 : (_objItem$nextState$da2 = _objItem$nextState$da.input) === null || _objItem$nextState$da2 === void 0 ? void 0 : _objItem$nextState$da2.expectedAmount;
|
|
216
291
|
}
|
|
292
|
+
if (isJobBasedOutput) {
|
|
293
|
+
var _etOutput$pendingEtDa;
|
|
294
|
+
let baseResponse = etOutput === null || etOutput === void 0 ? void 0 : etOutput.baseResponse;
|
|
295
|
+
if ((_etOutput$pendingEtDa = etOutput.pendingEtData[objItem.jobId]) !== null && _etOutput$pendingEtDa !== void 0 && _etOutput$pendingEtDa.baseResponse) {
|
|
296
|
+
var _etOutput$pendingEtDa2, _etOutput$pendingEtDa3;
|
|
297
|
+
baseResponse = etOutput.pendingEtData[objItem.jobId].baseResponse;
|
|
298
|
+
((_etOutput$pendingEtDa2 = etOutput.pendingEtData[objItem.jobId]) === null || _etOutput$pendingEtDa2 === void 0 ? void 0 : _etOutput$pendingEtDa2.baseResponse) && ((_etOutput$pendingEtDa3 = etOutput.pendingEtData[objItem.jobId]) === null || _etOutput$pendingEtDa3 === void 0 ? true : delete _etOutput$pendingEtDa3.baseResponse);
|
|
299
|
+
}
|
|
300
|
+
const computedOutput = {
|
|
301
|
+
...baseResponse,
|
|
302
|
+
...(Object.keys(etOutput === null || etOutput === void 0 ? void 0 : etOutput['pendingEtData']).length ? etOutput.pendingEtData[objItem.jobId] || {} : {})
|
|
303
|
+
};
|
|
304
|
+
objItem.nextState.data.output = {
|
|
305
|
+
...computedOutput
|
|
306
|
+
};
|
|
307
|
+
etState[index].nextState.data.output = {
|
|
308
|
+
...computedOutput
|
|
309
|
+
};
|
|
310
|
+
} else objItem.nextState.data.output = {
|
|
311
|
+
...etOutput
|
|
312
|
+
};
|
|
217
313
|
|
|
218
|
-
|
|
314
|
+
/* promises.push(
|
|
315
|
+
this.dispatchExecutor.storePendingState(
|
|
316
|
+
objItem.objRef,
|
|
317
|
+
objItem.jobId,
|
|
318
|
+
objItem.nextState
|
|
319
|
+
)
|
|
320
|
+
); */
|
|
321
|
+
_objectiveState.push({
|
|
322
|
+
// objectiveRef: objItem.objRef,
|
|
323
|
+
jobId: objItem.jobId,
|
|
324
|
+
_state: objItem.nextState
|
|
325
|
+
});
|
|
326
|
+
});
|
|
327
|
+
// await Promise.all(promises);
|
|
328
|
+
await this.dispatchExecutor.storeBulkPendingState(_objectiveState);
|
|
329
|
+
}
|
|
330
|
+
async sendETOutput(etOutput, states, isJobBasedOutput) {
|
|
331
|
+
let isPendingState = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
|
|
332
|
+
const etState = !isPendingState ? states.next_states : states.pending_states;
|
|
333
|
+
if (!etState || etState.length === 0) {
|
|
334
|
+
_Logger.default.getInstance().logEvent('sendETOutput', 'CONSTRAINTS FAILED', _Logger.LOG_TYPE.SDK_ERROR);
|
|
335
|
+
return;
|
|
336
|
+
}
|
|
337
|
+
// const promises: any[] = [];
|
|
338
|
+
const _objectiveState = [];
|
|
339
|
+
const _etDataVar = isPendingState ? 'pendingEtData' : 'etData';
|
|
340
|
+
etState.forEach((objItem, index) => {
|
|
341
|
+
if (objItem.nextState.taskId === _ETConfig.ExecutionTaskID.DELIVER_CASH) {
|
|
342
|
+
var _objItem$nextState$da3, _objItem$nextState$da4;
|
|
343
|
+
etOutput.amount = (_objItem$nextState$da3 = objItem.nextState.data) === null || _objItem$nextState$da3 === void 0 ? void 0 : (_objItem$nextState$da4 = _objItem$nextState$da3.input) === null || _objItem$nextState$da4 === void 0 ? void 0 : _objItem$nextState$da4.expectedAmount;
|
|
344
|
+
}
|
|
345
|
+
if (isJobBasedOutput) {
|
|
346
|
+
var _etOutput$_etDataVar$;
|
|
347
|
+
let baseResponse = etOutput === null || etOutput === void 0 ? void 0 : etOutput.baseResponse;
|
|
348
|
+
if ((_etOutput$_etDataVar$ = etOutput[_etDataVar][objItem.jobId]) !== null && _etOutput$_etDataVar$ !== void 0 && _etOutput$_etDataVar$.baseResponse) {
|
|
349
|
+
var _etOutput$_etDataVar$2, _etOutput$_etDataVar$3;
|
|
350
|
+
baseResponse = etOutput[_etDataVar][objItem.jobId].baseResponse;
|
|
351
|
+
((_etOutput$_etDataVar$2 = etOutput[_etDataVar][objItem.jobId]) === null || _etOutput$_etDataVar$2 === void 0 ? void 0 : _etOutput$_etDataVar$2.baseResponse) && ((_etOutput$_etDataVar$3 = etOutput[_etDataVar][objItem.jobId]) === null || _etOutput$_etDataVar$3 === void 0 ? true : delete _etOutput$_etDataVar$3.baseResponse);
|
|
352
|
+
}
|
|
353
|
+
const computedOutput = {
|
|
354
|
+
...baseResponse,
|
|
355
|
+
...(Object.keys(etOutput === null || etOutput === void 0 ? void 0 : etOutput[_etDataVar]).length ? etOutput[_etDataVar][objItem.jobId] || {} : {})
|
|
356
|
+
};
|
|
357
|
+
objItem.nextState.data.output = {
|
|
358
|
+
...computedOutput
|
|
359
|
+
};
|
|
360
|
+
etState[index].nextState.data.output = {
|
|
361
|
+
...computedOutput
|
|
362
|
+
};
|
|
363
|
+
} else objItem.nextState.data.output = {
|
|
364
|
+
...etOutput
|
|
219
365
|
};
|
|
220
|
-
|
|
366
|
+
|
|
367
|
+
// NEW CODE
|
|
368
|
+
_objectiveState.push({
|
|
369
|
+
objectiveRef: objItem.objRef,
|
|
370
|
+
jobId: objItem.jobId,
|
|
371
|
+
state: objItem.nextState
|
|
372
|
+
});
|
|
373
|
+
|
|
374
|
+
// OLD CODE
|
|
375
|
+
// promises.push(
|
|
376
|
+
// this.dispatchExecutor.lockObjectiveState(
|
|
377
|
+
// objItem.objRef,
|
|
378
|
+
// objItem.jobId,
|
|
379
|
+
// objItem.nextState
|
|
380
|
+
// )
|
|
381
|
+
// );
|
|
221
382
|
});
|
|
222
|
-
|
|
383
|
+
// OLD CODE
|
|
384
|
+
// await Promise.all(promises);
|
|
385
|
+
// console.log('_objectiveState: ', JSON.stringify(_objectiveState));
|
|
386
|
+
|
|
387
|
+
await this.bulkLockObjectiveStates(_objectiveState);
|
|
223
388
|
}
|
|
224
389
|
|
|
390
|
+
// ONLY USED IN RTScanScreen which is not used, needs cleanup
|
|
225
391
|
async saveETOutput(jobId, objRef, etState) {
|
|
226
|
-
await this.dispatchExecutor.lockObjectiveState(objRef, jobId, etState);
|
|
392
|
+
// await this.dispatchExecutor.lockObjectiveState(objRef, jobId, etState);
|
|
227
393
|
}
|
|
228
|
-
|
|
229
394
|
static getInstance() {
|
|
230
395
|
if (!DispatchStateContainer.instance) {
|
|
231
396
|
DispatchStateContainer.instance = new DispatchStateContainer();
|
|
232
397
|
}
|
|
233
|
-
|
|
234
398
|
return DispatchStateContainer.instance;
|
|
235
399
|
}
|
|
236
|
-
|
|
237
400
|
fetchObjectiveState(objRef, jobID) {
|
|
238
401
|
return this.dispatchExecutor.queryObjectiveStatus(objRef, jobID);
|
|
239
402
|
}
|
|
240
|
-
|
|
241
403
|
setSuccessRoute(route) {
|
|
242
404
|
this.successRoute = route;
|
|
243
405
|
}
|
|
244
|
-
|
|
245
406
|
getSuccessRoute() {
|
|
246
407
|
return this.successRoute;
|
|
247
408
|
}
|
|
248
|
-
|
|
249
409
|
setFailureRoute(route) {
|
|
250
410
|
this.failureRoute = route;
|
|
251
411
|
}
|
|
252
|
-
|
|
253
412
|
getFailureRoute() {
|
|
254
413
|
return this.failureRoute;
|
|
255
414
|
}
|
|
256
|
-
|
|
257
415
|
async getObjectiveSummary(jobObjective) {
|
|
258
416
|
try {
|
|
259
417
|
let response = [];
|
|
260
418
|
let summaryData = await _EventsSyncManager.default.getInstance().getObjectiveSummary(jobObjective.jobId + jobObjective.objectiveId);
|
|
261
|
-
|
|
262
419
|
if (summaryData) {
|
|
263
420
|
for (const k in summaryData) {
|
|
264
421
|
if (k === 'inputs') continue;else {
|
|
@@ -271,106 +428,272 @@ class DispatchStateContainer {
|
|
|
271
428
|
});
|
|
272
429
|
}
|
|
273
430
|
}
|
|
274
|
-
|
|
275
431
|
return response;
|
|
276
432
|
} else return response;
|
|
277
433
|
} catch (error) {
|
|
278
434
|
_Logger.default.getInstance().logEvent('getObjectiveSummary', error.message, _Logger.LOG_TYPE.SDK_ERROR);
|
|
279
|
-
|
|
280
435
|
return [];
|
|
281
436
|
}
|
|
282
437
|
}
|
|
283
|
-
|
|
284
|
-
async navigateToNextTask(navigation, route, etOutput, etSuccess, entityCode, eTaskID, baseETProps, isLastTask) {
|
|
438
|
+
async navigateToNextTask(navigation, route, etOutput, etSuccess, entityCode, eTaskID, baseETProps, isLastTask, isJobBasedOutput) {
|
|
285
439
|
try {
|
|
286
440
|
baseETProps.showProgress(true);
|
|
287
|
-
|
|
288
441
|
const reasonsContainer = _ReasonCodeContainer.default.getInstance();
|
|
289
|
-
|
|
442
|
+
const eventsContainer = _EventCodeContainer.default.getInstance();
|
|
443
|
+
const _eventCode = isJobBasedOutput ? etOutput.baseResponse.eventCode : etOutput.eventCode;
|
|
444
|
+
const _isReasonNotToBeUsed = isJobBasedOutput ? etOutput.baseResponse.reasonCode === _constants.REASON_NOT_USED : etOutput.reasonCode === _constants.REASON_NOT_USED;
|
|
445
|
+
if (_isReasonNotToBeUsed) {
|
|
446
|
+
isJobBasedOutput ? etOutput.baseResponse.reasonCode = '' : etOutput.reasonCode = '';
|
|
447
|
+
}
|
|
448
|
+
if (isLastTask) {
|
|
449
|
+
if (route.params[_RouteParams.RouteParams.PENDING_STATES] && route.params[_RouteParams.RouteParams.PENDING_STATES].length) {
|
|
450
|
+
var _states$0$nextState$d, _states$0$nextState$d2, _failureCodes$;
|
|
451
|
+
//Updated the states of pending states to completed end-state ET
|
|
452
|
+
await this.sendETOutput(route.params[_RouteParams.RouteParams.PENDING_STATES_OUTPUT], route.params, true, true);
|
|
453
|
+
|
|
454
|
+
/**
|
|
455
|
+
* Here we'll get the states data for end et
|
|
456
|
+
*/
|
|
457
|
+
const _states = await this.bulkQueryNextET(this.getJobObjectiveList(route.params[_RouteParams.RouteParams.PENDING_STATES]));
|
|
458
|
+
const failureCodes = await reasonsContainer.getReasonCodes((_states$0$nextState$d = _states[0].nextState.data.input) !== null && _states$0$nextState$d !== void 0 && _states$0$nextState$d.applicableReasons.success ? _states[0].nextState.data.input.applicableReasons.success : (_states$0$nextState$d2 = _states[0].nextState.data.input) === null || _states$0$nextState$d2 === void 0 ? void 0 : _states$0$nextState$d2.applicableReasons, _ETConfig.BaseEventCodes.ENTITY_SUCCESS);
|
|
459
|
+
let _etOutput = JSON.parse(JSON.stringify(etOutput));
|
|
460
|
+
_etOutput.entityCode = _ETConfig.EntityCode.COMPLETED_FAILURE;
|
|
461
|
+
_etOutput.success = true;
|
|
462
|
+
_etOutput.eventCode = _ETConfig.BaseEventCodes.ENTITY_SUCCESS;
|
|
463
|
+
_etOutput.reasonCode = ((_failureCodes$ = failureCodes[0]) === null || _failureCodes$ === void 0 ? void 0 : _failureCodes$.reasonCode) || '';
|
|
464
|
+
|
|
465
|
+
/**
|
|
466
|
+
* Update end et state
|
|
467
|
+
*/
|
|
468
|
+
await this.sendETOutput(_etOutput, {
|
|
469
|
+
next_states: _states
|
|
470
|
+
});
|
|
471
|
+
route.params[_RouteParams.RouteParams.PENDING_STATES] = _states;
|
|
472
|
+
}
|
|
473
|
+
}
|
|
290
474
|
if (etSuccess) {
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
475
|
+
if (!_eventCode) {
|
|
476
|
+
const _successApplicable = route.params[_RouteParams.RouteParams.NEXT_STATES][0].nextState.data.input.applicableReasons.success;
|
|
477
|
+
const successEventCodes = await eventsContainer.getEventCodes(_successApplicable);
|
|
478
|
+
let rParams;
|
|
479
|
+
rParams = {
|
|
480
|
+
...route.params
|
|
481
|
+
};
|
|
482
|
+
rParams[_RouteParams.RouteParams.ET_SUCCESS] = true;
|
|
483
|
+
rParams[_RouteParams.RouteParams.ET_SUCCESS_RESPONSE] = etOutput;
|
|
484
|
+
rParams[_RouteParams.RouteParams.CURRENT_ET_NAME] = eTaskID;
|
|
485
|
+
rParams[_RouteParams.RouteParams.IS_LAST_ET] = isLastTask;
|
|
486
|
+
rParams[_RouteParams.RouteParams.EVENT_CODES] = successEventCodes;
|
|
487
|
+
rParams[_RouteParams.RouteParams.APPLICABLE_CODES] = _successApplicable;
|
|
488
|
+
rParams[_RouteParams.RouteParams.IS_JOB_BASED_OUTPUT] = isJobBasedOutput;
|
|
489
|
+
rParams[_RouteParams.RouteParams.ROOT_META_DATA] = route.params[_RouteParams.RouteParams.ROOT_META_DATA];
|
|
490
|
+
rParams[_RouteParams.RouteParams.COMPLETED_STATES] = route.params[_RouteParams.RouteParams.COMPLETED_STATES];
|
|
491
|
+
rParams[_RouteParams.RouteParams.PENDING_STATES_OUTPUT] = route.params[_RouteParams.RouteParams.PENDING_STATES_OUTPUT];
|
|
492
|
+
rParams[_RouteParams.RouteParams.CANCEL_EVENT] = '';
|
|
493
|
+
navigation.replace(_ETConfig.CustomScreens.REMARK_SCREEN, rParams);
|
|
494
|
+
} else {
|
|
495
|
+
const successCodes = await reasonsContainer.getReasonCodes(route.params[_RouteParams.RouteParams.NEXT_STATES][0].nextState.data.input.applicableReasons.success ? route.params[_RouteParams.RouteParams.NEXT_STATES][0].nextState.data.input.applicableReasons.success : route.params[_RouteParams.RouteParams.NEXT_STATES][0].nextState.data.input.applicableReasons, _eventCode);
|
|
496
|
+
if (successCodes && successCodes.length > 0) {
|
|
497
|
+
if (successCodes.length === 1 || _isReasonNotToBeUsed) {
|
|
498
|
+
if (isJobBasedOutput) etOutput.baseResponse.reasonCode = successCodes[0].reasonCode;else etOutput.reasonCode = successCodes[0].reasonCode;
|
|
499
|
+
await this.saveAndProceed(baseETProps, etOutput, route.params, navigation, isLastTask, isJobBasedOutput);
|
|
500
|
+
} else {
|
|
501
|
+
let rParams;
|
|
502
|
+
rParams = {
|
|
503
|
+
...route.params
|
|
504
|
+
};
|
|
505
|
+
rParams[_RouteParams.RouteParams.ET_SUCCESS] = true;
|
|
506
|
+
rParams[_RouteParams.RouteParams.ET_SUCCESS_RESPONSE] = etOutput;
|
|
507
|
+
rParams[_RouteParams.RouteParams.CURRENT_ET_NAME] = eTaskID;
|
|
508
|
+
rParams[_RouteParams.RouteParams.REASONS] = successCodes;
|
|
509
|
+
rParams[_RouteParams.RouteParams.IS_LAST_ET] = isLastTask;
|
|
510
|
+
rParams[_RouteParams.RouteParams.ROOT_META_DATA] = route.params[_RouteParams.RouteParams.ROOT_META_DATA];
|
|
511
|
+
rParams[_RouteParams.RouteParams.COMPLETED_STATES] = route.params[_RouteParams.RouteParams.COMPLETED_STATES];
|
|
512
|
+
rParams[_RouteParams.RouteParams.PENDING_STATES_OUTPUT] = route.params[_RouteParams.RouteParams.PENDING_STATES_OUTPUT];
|
|
513
|
+
rParams[_RouteParams.RouteParams.CANCEL_EVENT] = _eventCode;
|
|
514
|
+
navigation.replace(_ETConfig.CustomScreens.REMARK_SCREEN, rParams);
|
|
515
|
+
}
|
|
297
516
|
} else {
|
|
298
|
-
|
|
299
|
-
rParams = { ...route.params
|
|
300
|
-
};
|
|
301
|
-
rParams[_RouteParams.RouteParams.ET_SUCCESS] = true;
|
|
302
|
-
rParams[_RouteParams.RouteParams.ET_SUCCESS_RESPONSE] = etOutput;
|
|
303
|
-
rParams[_RouteParams.RouteParams.CURRENT_ET_NAME] = eTaskID;
|
|
304
|
-
rParams[_RouteParams.RouteParams.REASONS] = successCodes;
|
|
305
|
-
rParams[_RouteParams.RouteParams.IS_LAST_ET] = isLastTask;
|
|
306
|
-
navigation.replace(_ETConfig.CustomScreens.REMARK_SCREEN, rParams);
|
|
517
|
+
await this.saveAndProceed(baseETProps, etOutput, route.params, navigation, isLastTask, isJobBasedOutput);
|
|
307
518
|
}
|
|
308
|
-
} else {
|
|
309
|
-
await this.saveAndProceed(baseETProps, etOutput, route.params[_RouteParams.RouteParams.NEXT_STATES], navigation, isLastTask);
|
|
310
519
|
}
|
|
311
520
|
} else {
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
521
|
+
let failureCodes = [];
|
|
522
|
+
if (!_eventCode) {
|
|
523
|
+
const _failureApplicable = route.params[_RouteParams.RouteParams.NEXT_STATES][0].nextState.data.input.applicableReasons.failure;
|
|
524
|
+
const failureEventCodes = await eventsContainer.getEventCodes(_failureApplicable);
|
|
525
|
+
let rParams;
|
|
526
|
+
rParams = {
|
|
527
|
+
...route.params
|
|
528
|
+
};
|
|
529
|
+
rParams[_RouteParams.RouteParams.ET_SUCCESS] = false;
|
|
530
|
+
// rParams[RouteParams.ET_SUCCESS_RESPONSE] = etOutput;
|
|
531
|
+
rParams[_RouteParams.RouteParams.CURRENT_ET_NAME] = eTaskID;
|
|
532
|
+
rParams[_RouteParams.RouteParams.IS_LAST_ET] = isLastTask;
|
|
533
|
+
rParams[_RouteParams.RouteParams.EVENT_CODES] = failureEventCodes;
|
|
534
|
+
rParams[_RouteParams.RouteParams.APPLICABLE_CODES] = _failureApplicable;
|
|
535
|
+
rParams[_RouteParams.RouteParams.ROOT_META_DATA] = route.params[_RouteParams.RouteParams.ROOT_META_DATA];
|
|
536
|
+
rParams[_RouteParams.RouteParams.COMPLETED_STATES] = route.params[_RouteParams.RouteParams.COMPLETED_STATES];
|
|
537
|
+
rParams[_RouteParams.RouteParams.PENDING_STATES_OUTPUT] = route.params[_RouteParams.RouteParams.PENDING_STATES_OUTPUT];
|
|
538
|
+
rParams[_RouteParams.RouteParams.CANCEL_EVENT] = '';
|
|
539
|
+
navigation.replace(_ETConfig.CustomScreens.REMARK_SCREEN, rParams);
|
|
540
|
+
} else {
|
|
541
|
+
if (_eventCode === _constants.GO_BACK_EVENT_CODE) failureCodes = [];else failureCodes = await reasonsContainer.getReasonCodes(route.params[_RouteParams.RouteParams.NEXT_STATES][0].nextState.data.input.applicableReasons.failure ? route.params[_RouteParams.RouteParams.NEXT_STATES][0].nextState.data.input.applicableReasons.failure : route.params[_RouteParams.RouteParams.NEXT_STATES][0].nextState.data.input.applicableReasons, _eventCode);
|
|
542
|
+
if (failureCodes && failureCodes.length > 0) {
|
|
543
|
+
if (isJobBasedOutput) etOutput.baseResponse.reasonCode = failureCodes[0].reasonCode;
|
|
544
|
+
if (failureCodes.length === 1 || _isReasonNotToBeUsed) {
|
|
545
|
+
await this.saveAndProceed(baseETProps, isJobBasedOutput ? etOutput : await (0, _ExecTaskUtils.getBaseETResponse)(entityCode, false, _eventCode, failureCodes[0].reasonCode), route.params, navigation, isLastTask, isJobBasedOutput);
|
|
546
|
+
} else {
|
|
547
|
+
let rParams;
|
|
548
|
+
rParams = {
|
|
549
|
+
...route.params
|
|
550
|
+
};
|
|
551
|
+
rParams[_RouteParams.RouteParams.ET_SUCCESS] = false;
|
|
552
|
+
rParams[_RouteParams.RouteParams.CURRENT_ET_NAME] = eTaskID;
|
|
553
|
+
rParams[_RouteParams.RouteParams.REASONS] = failureCodes;
|
|
554
|
+
rParams[_RouteParams.RouteParams.IS_LAST_ET] = isLastTask;
|
|
555
|
+
rParams[_RouteParams.RouteParams.ROOT_META_DATA] = route.params[_RouteParams.RouteParams.ROOT_META_DATA];
|
|
556
|
+
rParams[_RouteParams.RouteParams.COMPLETED_STATES] = route.params[_RouteParams.RouteParams.COMPLETED_STATES];
|
|
557
|
+
rParams[_RouteParams.RouteParams.PENDING_STATES_OUTPUT] = route.params[_RouteParams.RouteParams.PENDING_STATES_OUTPUT];
|
|
558
|
+
rParams[_RouteParams.RouteParams.CANCEL_EVENT] = _eventCode;
|
|
559
|
+
navigation.replace(_ETConfig.CustomScreens.REMARK_SCREEN, rParams);
|
|
560
|
+
}
|
|
317
561
|
} else {
|
|
318
|
-
|
|
319
|
-
rParams = { ...route.params
|
|
320
|
-
};
|
|
321
|
-
rParams[_RouteParams.RouteParams.ET_SUCCESS] = false;
|
|
322
|
-
rParams[_RouteParams.RouteParams.CURRENT_ET_NAME] = eTaskID;
|
|
323
|
-
rParams[_RouteParams.RouteParams.REASONS] = failureCodes;
|
|
324
|
-
rParams[_RouteParams.RouteParams.IS_LAST_ET] = isLastTask;
|
|
325
|
-
navigation.replace(_ETConfig.CustomScreens.REMARK_SCREEN, rParams);
|
|
562
|
+
await this.saveAndProceed(baseETProps, isJobBasedOutput ? etOutput : await (0, _ExecTaskUtils.getBaseETResponse)(entityCode, false, _eventCode, ''), route.params, navigation, isLastTask, isJobBasedOutput);
|
|
326
563
|
}
|
|
327
|
-
} else {
|
|
328
|
-
await this.saveAndProceed(baseETProps, await (0, _ExecTaskUtils.getBaseETResponse)(entityCode, false, _ETConfig.BaseEventCodes.ENTITY_FAILURE, ''), route.params[_RouteParams.RouteParams.NEXT_STATES], navigation, isLastTask);
|
|
329
564
|
}
|
|
330
565
|
}
|
|
331
566
|
} catch (error) {
|
|
332
567
|
baseETProps.showProgress(false);
|
|
333
|
-
|
|
334
568
|
_Logger.default.getInstance().logEvent('navigateToNextTask', error.message, _Logger.LOG_TYPE.SDK_ERROR);
|
|
335
569
|
}
|
|
336
570
|
}
|
|
337
|
-
|
|
338
571
|
getJobObjectiveList(nextStates) {
|
|
339
572
|
const result = [];
|
|
340
573
|
nextStates.forEach(s => {
|
|
341
574
|
result.push({
|
|
342
575
|
jobId: s.jobId,
|
|
343
|
-
objectiveId: s.objRef
|
|
576
|
+
objectiveId: s.objRef,
|
|
577
|
+
groupId: s.groupId,
|
|
578
|
+
additionalData: s.additionalData
|
|
344
579
|
});
|
|
345
580
|
});
|
|
346
581
|
return result;
|
|
347
582
|
}
|
|
348
|
-
|
|
349
|
-
async moveToNextET(baseETProps, etStates, navigation, isLastTask) {
|
|
583
|
+
async moveToNextET(etOutput, baseETProps, states, navigation, isLastTask) {
|
|
350
584
|
try {
|
|
585
|
+
let etStates = states.next_states;
|
|
351
586
|
baseETProps.showProgress(true);
|
|
352
|
-
|
|
353
587
|
if (isLastTask && etStates && etStates.length > 0) {
|
|
354
588
|
if (this._stateKeys.length !== 0) {
|
|
355
589
|
const st = this._stateKeys.pop();
|
|
356
|
-
|
|
357
590
|
if (st) {
|
|
358
591
|
baseETProps.showProgress(false);
|
|
359
|
-
|
|
360
592
|
let nextStateList = this._mappedStates.get(st);
|
|
361
|
-
|
|
362
593
|
this._mappedStates.delete(st);
|
|
363
|
-
|
|
594
|
+
const taskMeta = JSON.parse(nextStateList && nextStateList[0].nextState.data.taskMeta || '{}');
|
|
595
|
+
let isFailureFlow = Object.keys(taskMeta).length ? taskMeta.allowFailureFlow !== undefined ? taskMeta.allowFailureFlow : true : true;
|
|
364
596
|
if (nextStateList != null && nextStateList.length > 0) {
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
597
|
+
if (!isFailureFlow) {
|
|
598
|
+
const promises = [];
|
|
599
|
+
const _objectiveState = [];
|
|
600
|
+
const _taskOutput = [];
|
|
601
|
+
/*for (let index = 0; index < nextStateList.length; index++) {
|
|
602
|
+
const objItem = nextStateList[index];
|
|
603
|
+
|
|
604
|
+
//OLD CODE
|
|
605
|
+
const prevOutput =
|
|
606
|
+
await this.dispatchExecutor.getTaskOutputByInstanceId(
|
|
607
|
+
objItem.nextState.name,
|
|
608
|
+
objItem.nextState.workflowInstanceId
|
|
609
|
+
);
|
|
610
|
+
objItem.nextState.data.output = { ...prevOutput }; */
|
|
611
|
+
//Updated the states of pending states to completed end-state ET
|
|
612
|
+
|
|
613
|
+
// NEW CODE
|
|
614
|
+
/* _objectiveState.push({
|
|
615
|
+
objectiveRef: objItem.objRef,
|
|
616
|
+
jobId: objItem.jobId,
|
|
617
|
+
state: objItem.nextState,
|
|
618
|
+
}); */
|
|
619
|
+
|
|
620
|
+
// OLD CODE
|
|
621
|
+
// promises.push(
|
|
622
|
+
// this.dispatchExecutor.lockObjectiveState(
|
|
623
|
+
// objItem.objRef,
|
|
624
|
+
// objItem.jobId,
|
|
625
|
+
// objItem.nextState
|
|
626
|
+
// )
|
|
627
|
+
// );
|
|
628
|
+
// }
|
|
629
|
+
// OLD CODE
|
|
630
|
+
// await Promise.all(promises);
|
|
631
|
+
|
|
632
|
+
// NEW CODE
|
|
633
|
+
nextStateList.forEach(objItem => {
|
|
634
|
+
// const objItem = nextStateList[index];
|
|
635
|
+
_taskOutput.push({
|
|
636
|
+
taskName: objItem.nextState.name,
|
|
637
|
+
jobId: objItem.jobId,
|
|
638
|
+
objectiveRef: objItem.objRef
|
|
639
|
+
});
|
|
640
|
+
});
|
|
641
|
+
const prevOutput = await this.dispatchExecutor.getBulkTaskOutput(_taskOutput);
|
|
642
|
+
nextStateList.forEach((objItem, index) => {
|
|
643
|
+
objItem.nextState.data.output = {
|
|
644
|
+
...prevOutput[index]
|
|
645
|
+
};
|
|
646
|
+
_objectiveState.push({
|
|
647
|
+
objectiveRef: objItem.objRef,
|
|
648
|
+
jobId: objItem.jobId,
|
|
649
|
+
state: objItem.nextState
|
|
650
|
+
});
|
|
651
|
+
});
|
|
652
|
+
await this.bulkLockObjectiveStates(_objectiveState);
|
|
653
|
+
|
|
654
|
+
/**
|
|
655
|
+
* Here we'll get the states data for end et
|
|
656
|
+
*/
|
|
657
|
+
const _states = await this.bulkQueryNextET(this.getJobObjectiveList(nextStateList));
|
|
658
|
+
if (_states[0].nextState.taskId === _ETConfig.ExecutionTaskID.COMPLETED_FAILURE) {
|
|
659
|
+
var _states$0$nextState$d3, _states$0$nextState$d4, _failureCodes$2;
|
|
660
|
+
const failureCodes = await _ReasonCodeContainer.default.getInstance().getReasonCodes((_states$0$nextState$d3 = _states[0].nextState.data.input) !== null && _states$0$nextState$d3 !== void 0 && _states$0$nextState$d3.applicableReasons.success ? _states[0].nextState.data.input.applicableReasons.success : (_states$0$nextState$d4 = _states[0].nextState.data.input) === null || _states$0$nextState$d4 === void 0 ? void 0 : _states$0$nextState$d4.applicableReasons, _ETConfig.BaseEventCodes.ENTITY_SUCCESS);
|
|
661
|
+
let _etOutput = JSON.parse(JSON.stringify(etOutput));
|
|
662
|
+
_etOutput.entityCode = _ETConfig.EntityCode.COMPLETED_FAILURE;
|
|
663
|
+
_etOutput.success = true;
|
|
664
|
+
_etOutput.eventCode = _ETConfig.BaseEventCodes.ENTITY_SUCCESS;
|
|
665
|
+
_etOutput.reasonCode = ((_failureCodes$2 = failureCodes[0]) === null || _failureCodes$2 === void 0 ? void 0 : _failureCodes$2.reasonCode) || '';
|
|
666
|
+
|
|
667
|
+
/**
|
|
668
|
+
* Update end et state
|
|
669
|
+
*/
|
|
670
|
+
await this.sendETOutput(_etOutput, {
|
|
671
|
+
next_states: _states
|
|
672
|
+
});
|
|
673
|
+
states.pending_states = [...(states.pending_states || []), ..._states];
|
|
674
|
+
} else {
|
|
675
|
+
let rParams = {};
|
|
676
|
+
rParams[_RouteParams.RouteParams.NEXT_STATES] = _states;
|
|
677
|
+
rParams[_RouteParams.RouteParams.PENDING_STATES] = [...(states.pending_states || [])];
|
|
678
|
+
rParams[_RouteParams.RouteParams.COMPLETED_STATES] = [...(states.completed_states || []), ...etStates];
|
|
679
|
+
rParams[_RouteParams.RouteParams.PENDING_STATES_OUTPUT] = states.pending_states_output;
|
|
680
|
+
rParams[_RouteParams.RouteParams.ROOT_META_DATA] = states.rootMetaData;
|
|
681
|
+
navigation.replace(_states[0].nextState.taskId, rParams);
|
|
682
|
+
}
|
|
683
|
+
} else {
|
|
684
|
+
let rParams = {};
|
|
685
|
+
rParams[_RouteParams.RouteParams.NEXT_STATES] = nextStateList;
|
|
686
|
+
rParams[_RouteParams.RouteParams.PENDING_STATES] = [...(states.pending_states || [])];
|
|
687
|
+
rParams[_RouteParams.RouteParams.COMPLETED_STATES] = [...(states.completed_states || []), ...etStates];
|
|
688
|
+
rParams[_RouteParams.RouteParams.PENDING_STATES_OUTPUT] = states.pending_states_output;
|
|
689
|
+
rParams[_RouteParams.RouteParams.ROOT_META_DATA] = states.rootMetaData;
|
|
690
|
+
navigation.replace(nextStateList[0].nextState.taskId, rParams);
|
|
691
|
+
}
|
|
368
692
|
}
|
|
369
|
-
|
|
370
|
-
return;
|
|
693
|
+
if (isFailureFlow) return;
|
|
371
694
|
}
|
|
372
695
|
}
|
|
373
|
-
|
|
696
|
+
etStates = [...etStates, ...(states.pending_states || []), ...(states.completed_states || [])];
|
|
374
697
|
let nextState = etStates[0];
|
|
375
698
|
let completeJobsSummary = [];
|
|
376
699
|
let objSummary = await this.getObjectiveSummary({
|
|
@@ -382,7 +705,6 @@ class DispatchStateContainer {
|
|
|
382
705
|
objectiveRef: etStates[0].objRef,
|
|
383
706
|
jobObjectiveSummary: objSummary
|
|
384
707
|
});
|
|
385
|
-
|
|
386
708
|
for (let i = 1; i < etStates.length; i++) {
|
|
387
709
|
let obs = await this.getObjectiveSummary({
|
|
388
710
|
jobId: etStates[i].jobId,
|
|
@@ -394,9 +716,11 @@ class DispatchStateContainer {
|
|
|
394
716
|
jobObjectiveSummary: obs
|
|
395
717
|
});
|
|
396
718
|
}
|
|
397
|
-
|
|
398
719
|
baseETProps.showProgress(false);
|
|
399
|
-
|
|
720
|
+
this.cache.clearKeys([this.cacheKeys.CURRENT_WORKING_TASK_ID]);
|
|
721
|
+
_AppSyncManager.default.getInstance().isForceStartEnabled = true;
|
|
722
|
+
_AppSyncManager.default.getInstance().isSyncActive = false;
|
|
723
|
+
_AppSyncManager.default.getInstance().startSDKSyncManager();
|
|
400
724
|
if (nextState.nextState.taskId === _ETConfig.ExecutionTaskID.COMPLETED_SUCCESS) {
|
|
401
725
|
navigation.replace(this.getSuccessRoute(), {
|
|
402
726
|
summary: objSummary,
|
|
@@ -415,28 +739,54 @@ class DispatchStateContainer {
|
|
|
415
739
|
} else {
|
|
416
740
|
let nextStateList = await this.bulkQueryNextET(this.getJobObjectiveList(etStates));
|
|
417
741
|
baseETProps.showProgress(false);
|
|
418
|
-
|
|
419
742
|
if (nextStateList != null && nextStateList.length > 0) {
|
|
420
743
|
let rParams = {};
|
|
421
744
|
rParams[_RouteParams.RouteParams.NEXT_STATES] = nextStateList;
|
|
745
|
+
rParams[_RouteParams.RouteParams.PENDING_STATES] = [...(states.pending_states || [])];
|
|
746
|
+
rParams[_RouteParams.RouteParams.COMPLETED_STATES] = states.completed_states;
|
|
747
|
+
rParams[_RouteParams.RouteParams.ROOT_META_DATA] = states.rootMetaData;
|
|
748
|
+
rParams[_RouteParams.RouteParams.PENDING_STATES_OUTPUT] = states.pending_states_output;
|
|
749
|
+
|
|
750
|
+
/**
|
|
751
|
+
* For custom end event
|
|
752
|
+
* Add pending state(failed and unscanned) objectives only for scan et
|
|
753
|
+
*/
|
|
754
|
+
const _nextStates = etStates[0].nextState.taskId === _ETConfig.ExecutionTaskID.SCAN ? [...etStates, ...(states.pending_states || [])] : etStates;
|
|
755
|
+
if (!isLastTask) {
|
|
756
|
+
var _etStates$0$nextState, _etOutput$baseRespons;
|
|
757
|
+
const eventOutputData = {
|
|
758
|
+
meta: ((_etStates$0$nextState = etStates[0].nextState.data.output) === null || _etStates$0$nextState === void 0 ? void 0 : _etStates$0$nextState.meta) || (etOutput === null || etOutput === void 0 ? void 0 : (_etOutput$baseRespons = etOutput.baseResponse) === null || _etOutput$baseRespons === void 0 ? void 0 : _etOutput$baseRespons.meta) || (etOutput === null || etOutput === void 0 ? void 0 : etOutput.meta) || {},
|
|
759
|
+
etData: {},
|
|
760
|
+
taskId: etStates[0].nextState.taskId,
|
|
761
|
+
nextTaskId: '',
|
|
762
|
+
timestamp: Date.now()
|
|
763
|
+
};
|
|
764
|
+
etStates[0].groupId ? eventOutputData['groupId'] = etStates[0].groupId : null;
|
|
765
|
+
_nextStates.forEach(objItem => {
|
|
766
|
+
var _objItem$nextState$da5, _eventOutputData$etDa, _eventOutputData$etDa2, _eventOutputData$etDa3;
|
|
767
|
+
eventOutputData.etData[objItem.jobId] = {
|
|
768
|
+
...(((_objItem$nextState$da5 = objItem.nextState.data) === null || _objItem$nextState$da5 === void 0 ? void 0 : _objItem$nextState$da5.output) || {}),
|
|
769
|
+
workflowInstanceId: objItem.nextState.workflowInstanceId,
|
|
770
|
+
additionalData: (objItem === null || objItem === void 0 ? void 0 : objItem.additionalData) || {}
|
|
771
|
+
};
|
|
772
|
+
(((_eventOutputData$etDa = eventOutputData.etData[objItem.jobId]) === null || _eventOutputData$etDa === void 0 ? void 0 : _eventOutputData$etDa.meta) || ((_eventOutputData$etDa2 = eventOutputData.etData[objItem.jobId]) === null || _eventOutputData$etDa2 === void 0 ? void 0 : _eventOutputData$etDa2.meta) === null) && ((_eventOutputData$etDa3 = eventOutputData.etData[objItem.jobId]) === null || _eventOutputData$etDa3 === void 0 ? true : delete _eventOutputData$etDa3.meta);
|
|
773
|
+
});
|
|
774
|
+
eventOutputData.nextTaskId = nextStateList[0].nextState.taskId;
|
|
775
|
+
eventOutputData.etData[Object.keys(eventOutputData.etData)[0]].eventCode !== _constants.GO_BACK_EVENT_CODE ? (0, _EventDispatcher.default)('END', etStates[0].nextState.name, eventOutputData) : (0, _EventDispatcher.default)('BACK', etStates[0].nextState.name, eventOutputData);
|
|
776
|
+
}
|
|
422
777
|
navigation.replace(nextStateList[0].nextState.taskId, rParams);
|
|
423
778
|
}
|
|
424
779
|
}
|
|
425
780
|
} catch (error) {
|
|
426
781
|
baseETProps.showProgress(false);
|
|
427
|
-
|
|
428
782
|
_Logger.default.getInstance().logEvent('moveToNextET', error.message, _Logger.LOG_TYPE.SDK_ERROR);
|
|
429
783
|
}
|
|
430
784
|
}
|
|
431
|
-
|
|
432
|
-
async saveAndProceed(baseETProps, etOutput, etStates, navigation, isLastTask) {
|
|
785
|
+
async saveAndProceed(baseETProps, etOutput, states, navigation, isLastTask, isJobBasedOutput) {
|
|
433
786
|
baseETProps.showProgress(true);
|
|
434
|
-
await this.saveAndProceedToNextET(baseETProps, etOutput,
|
|
787
|
+
await this.saveAndProceedToNextET(baseETProps, etOutput, states, navigation, isLastTask, isJobBasedOutput);
|
|
435
788
|
}
|
|
436
|
-
|
|
437
789
|
}
|
|
438
|
-
|
|
439
790
|
exports.default = DispatchStateContainer;
|
|
440
|
-
|
|
441
791
|
_defineProperty(DispatchStateContainer, "instance", void 0);
|
|
442
792
|
//# sourceMappingURL=DispatchStateContainer.js.map
|