@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
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
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; }
|
|
2
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
|
3
|
+
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); }
|
|
4
|
+
import { clearCache, createFmsFolder, pushBulkEventForSync } from '../../utils/SyncManagerUtils';
|
|
4
5
|
import Storage from '../../utils/storage';
|
|
5
|
-
import {
|
|
6
|
+
import { ExecutionEngine } from '@os1-platform/mobile-execution-lib';
|
|
6
7
|
import { showToast } from '../../components/widgets/Toaster';
|
|
7
|
-
import { BaseEventCodes, CustomScreens, ExecutionTaskID, FinalETName } from '../../models/execTasks/ETConfig';
|
|
8
|
+
import { BaseEventCodes, CustomScreens, EntityCode, ExecutionTaskID, FinalETName } from '../../models/execTasks/ETConfig';
|
|
8
9
|
import EventsSyncManager from '../syncmanager/events/EventsSyncManager';
|
|
9
10
|
import Logger, { LOG_TYPE } from '../../utils/Logger';
|
|
10
11
|
import DispatchSdkCache from '../sdk/DispatchSdkCache';
|
|
@@ -15,24 +16,30 @@ import BaseErrorCodes from '../../errors/ErrorCodes';
|
|
|
15
16
|
import ErrorCodes, { InvalidArgumentsError } from '../../errors/ErrorCodes';
|
|
16
17
|
import { RouteParams } from '../../ui/uiConfig/RouteParams';
|
|
17
18
|
import { debounce } from 'lodash';
|
|
19
|
+
import dispatchEvent from '../../events/EventDispatcher';
|
|
20
|
+
import EventCodeContainer from '../dispatchCodes/EventCodeContainer';
|
|
21
|
+
import { GO_BACK_EVENT_CODE, REASON_NOT_USED } from '../../constants/constants';
|
|
22
|
+
import AppSyncManager from '../syncmanager/AppSyncManager';
|
|
18
23
|
export default class DispatchStateContainer {
|
|
19
24
|
constructor() {
|
|
25
|
+
_defineProperty(this, "cacheKeys", DispatchSdkCache.KEYS);
|
|
26
|
+
_defineProperty(this, "cache", DispatchSdkCache.getInstance());
|
|
20
27
|
_defineProperty(this, "dispatchExecutor", new ExecutionEngine());
|
|
21
|
-
|
|
22
28
|
_defineProperty(this, "successRoute", null);
|
|
23
|
-
|
|
24
29
|
_defineProperty(this, "failureRoute", null);
|
|
25
|
-
|
|
26
30
|
_defineProperty(this, "_stateKeys", []);
|
|
27
|
-
|
|
28
31
|
_defineProperty(this, "_jobObjectives", null);
|
|
29
|
-
|
|
30
32
|
_defineProperty(this, "_mappedStates", new Map());
|
|
31
|
-
|
|
32
|
-
_defineProperty(this, "saveAndProceedToNextET", debounce(async (baseETProps, etOutput, etStates, navigation, isLastTask) => {
|
|
33
|
+
_defineProperty(this, "saveAndProceedToNextET", debounce(async (baseETProps, etOutput, states, navigation, isLastTask, isJobBasedOutput) => {
|
|
33
34
|
try {
|
|
34
|
-
|
|
35
|
-
|
|
35
|
+
// console.log('saveAndProceedToNextET start: ', new Date().getTime());
|
|
36
|
+
// console.log('sendETOutput start: ', new Date().getTime());
|
|
37
|
+
await this.sendETOutput(etOutput, states, isJobBasedOutput);
|
|
38
|
+
// console.log('sendETOutput end: ', new Date().getTime());
|
|
39
|
+
// console.log('moveToNextET start: ', new Date().getTime());
|
|
40
|
+
await this.moveToNextET(etOutput, baseETProps, states, navigation, isLastTask);
|
|
41
|
+
// console.log('moveToNextET end: ', new Date().getTime());
|
|
42
|
+
// console.log('saveAndProceedToNextET end: ', new Date().getTime());
|
|
36
43
|
} catch (error) {
|
|
37
44
|
Logger.getInstance().logEvent('saveAndProceed', error.message, LOG_TYPE.SDK_ERROR);
|
|
38
45
|
baseETProps.showProgress(false);
|
|
@@ -40,23 +47,18 @@ export default class DispatchStateContainer {
|
|
|
40
47
|
}
|
|
41
48
|
}, 800));
|
|
42
49
|
}
|
|
43
|
-
|
|
44
50
|
get stateKeys() {
|
|
45
51
|
return this._stateKeys;
|
|
46
52
|
}
|
|
47
|
-
|
|
48
53
|
set stateKeys(value) {
|
|
49
54
|
this._stateKeys = value;
|
|
50
55
|
}
|
|
51
|
-
|
|
52
56
|
get mappedStates() {
|
|
53
57
|
return this._mappedStates;
|
|
54
58
|
}
|
|
55
|
-
|
|
56
59
|
set mappedStates(value) {
|
|
57
60
|
this._mappedStates = value;
|
|
58
61
|
}
|
|
59
|
-
|
|
60
62
|
/**
|
|
61
63
|
* Call this function when dispatch data is fetched successfully in client app
|
|
62
64
|
* @param dispatchID
|
|
@@ -69,17 +71,21 @@ export default class DispatchStateContainer {
|
|
|
69
71
|
Logger.getInstance().logEvent('initDispatchExecutor', InvalidArgumentsError, LOG_TYPE.SDK_WARNING);
|
|
70
72
|
throw new BaseError(BaseErrorCodes.InvalidArgumentError, InvalidArgumentsError);
|
|
71
73
|
}
|
|
72
|
-
|
|
73
74
|
let storage = Storage.getInstance();
|
|
74
75
|
await clearCache(dispatchID);
|
|
75
76
|
await DispatchSdkCache.getInstance().setKeyInCache(DispatchSdkCache.KEYS.DISPATCH_ID, dispatchID);
|
|
76
77
|
await createFmsFolder(dispatchID);
|
|
77
78
|
await this.dispatchExecutor.init(dispatchID, jobs, {
|
|
78
|
-
storeDbItemCallback: storage.setObject,
|
|
79
|
-
readDbItemCallback: storage.getObject,
|
|
79
|
+
// storeDbItemCallback: storage.setObject,
|
|
80
|
+
// readDbItemCallback: storage.getObject,
|
|
81
|
+
storeMultipleDbItemCallback: storage.setMultiObject,
|
|
82
|
+
readMultipleDbItemCallback: storage.getMultiObject,
|
|
83
|
+
// storeDbItemCallback: storage.setMultiObject, // NEW CODE
|
|
84
|
+
// readDbItemCallback: storage.getMultiObject, // NEW CODE
|
|
80
85
|
deleteDbItemsCallback: storage.deleteMultiple,
|
|
81
86
|
getDbKeysCallback: storage.getAllKeys,
|
|
82
|
-
eventSyncCallback: pushEventForSync
|
|
87
|
+
// eventSyncCallback: pushEventForSync,
|
|
88
|
+
eventBulkSyncCallback: pushBulkEventForSync
|
|
83
89
|
}, {
|
|
84
90
|
startTaskName: FinalETName.START_WORKFLOW,
|
|
85
91
|
successTaskName: FinalETName.COMPLETED_SUCCESS,
|
|
@@ -89,145 +95,319 @@ export default class DispatchStateContainer {
|
|
|
89
95
|
});
|
|
90
96
|
}
|
|
91
97
|
|
|
98
|
+
// async getStates(o: any) {
|
|
99
|
+
// let nState: state | null = null;
|
|
100
|
+
// try {
|
|
101
|
+
// // console.log('queryObjective: start ', new Date().getTime());
|
|
102
|
+
// // promises.push(this.queryObjective(o.objectiveId, o.jobId));
|
|
103
|
+
// // nState = await this.queryObjective(o.objectiveId, o.jobId);
|
|
104
|
+
// // console.log('queryObjective: end ', new Date().getTime());
|
|
105
|
+
// } catch (error: any) {
|
|
106
|
+
// Logger.getInstance().logEvent(
|
|
107
|
+
// 'bulkQueryNextET',
|
|
108
|
+
// JSON.stringify({
|
|
109
|
+
// error: error.message,
|
|
110
|
+
// jobId: o.jobId,
|
|
111
|
+
// objRef: o.objectiveId,
|
|
112
|
+
// groupId: o.groupId,
|
|
113
|
+
// additionalData: o.additionalData,
|
|
114
|
+
// }),
|
|
115
|
+
// LOG_TYPE.SDK_ERROR
|
|
116
|
+
// );
|
|
117
|
+
// }
|
|
118
|
+
// if (nState) {
|
|
119
|
+
// if (this._mappedStates.has(nState.taskId)) {
|
|
120
|
+
// let val = this._mappedStates.get(nState.taskId);
|
|
121
|
+
// val?.push({
|
|
122
|
+
// nextState: nState,
|
|
123
|
+
// objRef: o.objectiveId,
|
|
124
|
+
// jobId: o.jobId,
|
|
125
|
+
// groupId: o.groupId,
|
|
126
|
+
// additionalData: o.additionalData,
|
|
127
|
+
// });
|
|
128
|
+
// } else {
|
|
129
|
+
// this._stateKeys.push(nState.taskId);
|
|
130
|
+
// this._mappedStates.set(nState.taskId, [
|
|
131
|
+
// {
|
|
132
|
+
// nextState: nState,
|
|
133
|
+
// objRef: o.objectiveId,
|
|
134
|
+
// jobId: o.jobId,
|
|
135
|
+
// groupId: o.groupId,
|
|
136
|
+
// additionalData: o.additionalData,
|
|
137
|
+
// },
|
|
138
|
+
// ]);
|
|
139
|
+
// }
|
|
140
|
+
// }
|
|
141
|
+
// }
|
|
142
|
+
|
|
92
143
|
async bulkQueryNextET(jobObjectiveList) {
|
|
93
144
|
if (!jobObjectiveList || jobObjectiveList.length === 0) {
|
|
94
145
|
Logger.getInstance().logEvent('bulkQueryNextET', 'CONSTRAINTS FAILED', LOG_TYPE.SDK_ERROR);
|
|
95
146
|
throw new BaseError(ErrorCodes.MERGING_ERROR, 'CONSTRAINTS FAILED');
|
|
96
147
|
}
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
|
|
148
|
+
const _jobObjectiveList = jobObjectiveList.map(o => ({
|
|
149
|
+
objectiveRef: o.objectiveId,
|
|
150
|
+
jobId: o.jobId
|
|
151
|
+
}));
|
|
152
|
+
let nStateArray = [];
|
|
153
|
+
try {
|
|
154
|
+
// @ts-ignore
|
|
155
|
+
nStateArray = await this.bulkQueryObjectives(_jobObjectiveList);
|
|
156
|
+
} catch (error) {
|
|
157
|
+
Logger.getInstance().logEvent('bulkQueryNextET', JSON.stringify({
|
|
158
|
+
error: error.message,
|
|
159
|
+
data: jobObjectiveList.map(_job => _job.jobId)
|
|
160
|
+
}), LOG_TYPE.SDK_ERROR);
|
|
161
|
+
}
|
|
162
|
+
if (nStateArray && nStateArray.length) {
|
|
163
|
+
nStateArray.forEach((nState, i) => {
|
|
164
|
+
const o = jobObjectiveList[i];
|
|
112
165
|
if (this._mappedStates.has(nState.taskId)) {
|
|
113
|
-
|
|
114
|
-
|
|
166
|
+
let val = this._mappedStates.get(nState.taskId);
|
|
115
167
|
val === null || val === void 0 ? void 0 : val.push({
|
|
116
168
|
nextState: nState,
|
|
117
169
|
objRef: o.objectiveId,
|
|
118
|
-
jobId: o.jobId
|
|
170
|
+
jobId: o.jobId,
|
|
171
|
+
groupId: o.groupId,
|
|
172
|
+
additionalData: o.additionalData
|
|
119
173
|
});
|
|
120
174
|
} else {
|
|
121
175
|
this._stateKeys.push(nState.taskId);
|
|
122
|
-
|
|
123
176
|
this._mappedStates.set(nState.taskId, [{
|
|
124
177
|
nextState: nState,
|
|
125
178
|
objRef: o.objectiveId,
|
|
126
|
-
jobId: o.jobId
|
|
179
|
+
jobId: o.jobId,
|
|
180
|
+
groupId: o.groupId,
|
|
181
|
+
additionalData: o.additionalData
|
|
127
182
|
}]);
|
|
128
183
|
}
|
|
129
|
-
}
|
|
184
|
+
});
|
|
130
185
|
}
|
|
131
186
|
|
|
132
|
-
|
|
133
|
-
|
|
187
|
+
// OLD CODE
|
|
188
|
+
// console.log('bulkQueryNextET: start ', new Date().getTime());
|
|
189
|
+
// const promises: any[] = [];
|
|
190
|
+
// for (const o of jobObjectiveList) {
|
|
191
|
+
// promises.push(this.getStates(o));
|
|
192
|
+
// }
|
|
193
|
+
// OLD CODE END
|
|
194
|
+
// await Promise.all(promises);
|
|
195
|
+
|
|
196
|
+
// console.log('bulkQueryNextET: end ', new Date().getTime());
|
|
197
|
+
let taskID;
|
|
198
|
+
const currentWorkingTaskId = await this.cache.getKeyFromCache(this.cacheKeys.CURRENT_WORKING_TASK_ID);
|
|
199
|
+
if (currentWorkingTaskId) {
|
|
200
|
+
taskID = currentWorkingTaskId;
|
|
201
|
+
const taskIndx = this._stateKeys.indexOf(taskID);
|
|
202
|
+
if (taskIndx >= 0) {
|
|
203
|
+
this._stateKeys.splice(taskIndx, 1);
|
|
204
|
+
} else taskID = this._stateKeys.pop();
|
|
205
|
+
} else taskID = this._stateKeys.pop();
|
|
134
206
|
if (taskID) {
|
|
135
207
|
const nextStates = this._mappedStates.get(taskID);
|
|
136
|
-
|
|
137
208
|
this._mappedStates.delete(taskID);
|
|
138
209
|
|
|
210
|
+
/* console.log(
|
|
211
|
+
'🚀 ~ file: DispatchStateContainer.tsx:250 ~ DispatchStateContainer ~ nextStates:',
|
|
212
|
+
JSON.stringify(nextStates),
|
|
213
|
+
this._mappedStates
|
|
214
|
+
); */
|
|
139
215
|
return nextStates ?? [];
|
|
140
216
|
} else return null;
|
|
141
217
|
}
|
|
142
218
|
|
|
143
|
-
async queryNextTask(
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
219
|
+
// public async queryNextTask(
|
|
220
|
+
// jobObjectiveList: JobObjectiveType[]
|
|
221
|
+
// ): Promise<PromiseSettledResult<state>[]> {
|
|
222
|
+
// try {
|
|
223
|
+
// const promises: any[] = [];
|
|
224
|
+
// const _jobObjectiveList = jobObjectiveList.map((jobObjective)=>({objectiveRef:jobObjective.objectiveId,jobId:jobObjective.jobId}))
|
|
225
|
+
|
|
226
|
+
// return await this.queryObjectives(_jobObjectiveList)
|
|
227
|
+
// // jobObjectiveList.forEach((jobObjective) => {
|
|
228
|
+
// // promises.push(
|
|
229
|
+
// // this.queryObjective(jobObjective.objectiveId, jobObjective.jobId)
|
|
230
|
+
// // );
|
|
231
|
+
// // });
|
|
232
|
+
// // return await Promise.all(promises);
|
|
233
|
+
// } catch (error: any) {
|
|
234
|
+
// if (error instanceof QuerySucceededObjectiveError) {
|
|
235
|
+
// showToast('OBJECTIVE IS ALREADY COMPLETED');
|
|
236
|
+
// } else if (error instanceof EngineNotReadyError) {
|
|
237
|
+
// showToast('ENGINE NOT READY! Please Try again after some time');
|
|
238
|
+
// } else if (error instanceof ObjectiveNotFoundError) {
|
|
239
|
+
// showToast('NO SUCH OBJECTIVE FOUND');
|
|
240
|
+
// } else if (error instanceof ObjectiveNotReadyError) {
|
|
241
|
+
// showToast('OBJECTIVE NOT READY');
|
|
242
|
+
// } else if (error instanceof ObjectiveJobAlreadyCompletedError) {
|
|
243
|
+
// showToast('OBJECTIVE CANNOT BE ATTEMPTED');
|
|
244
|
+
// } else if (
|
|
245
|
+
// error instanceof JobStatusInvalidError ||
|
|
246
|
+
// error instanceof JobNotFoundError ||
|
|
247
|
+
// error instanceof EmptyJobError ||
|
|
248
|
+
// error instanceof ETIdInvalidError
|
|
249
|
+
// ) {
|
|
250
|
+
// showToast('INVALID JOB');
|
|
251
|
+
// }
|
|
252
|
+
// return null;
|
|
253
|
+
// }
|
|
254
|
+
// }
|
|
255
|
+
|
|
256
|
+
// NEW CODE
|
|
257
|
+
async bulkLockObjectiveStates(lockInput) {
|
|
258
|
+
return await this.dispatchExecutor.lockBulkObjectiveState(lockInput);
|
|
167
259
|
}
|
|
168
260
|
|
|
169
|
-
|
|
170
|
-
|
|
261
|
+
// NEW CODE
|
|
262
|
+
async bulkQueryObjectives(queryInput) {
|
|
263
|
+
return await this.dispatchExecutor.queryBulkObjectiveState(queryInput);
|
|
171
264
|
}
|
|
172
265
|
|
|
173
|
-
async
|
|
266
|
+
// public async queryObjective(objRef: string, jobID: string) {
|
|
267
|
+
// return await this.dispatchExecutor.queryObjectiveState(objRef, jobID);
|
|
268
|
+
// }
|
|
269
|
+
|
|
270
|
+
async sendPendingETOutput(etOutputData, states, isJobBasedOutput) {
|
|
271
|
+
const etOutput = JSON.parse(JSON.stringify(etOutputData));
|
|
272
|
+
const etState = states.pending_states;
|
|
174
273
|
if (!etState || etState.length === 0) {
|
|
175
274
|
Logger.getInstance().logEvent('sendETOutput', 'CONSTRAINTS FAILED', LOG_TYPE.SDK_ERROR);
|
|
176
275
|
return;
|
|
177
276
|
}
|
|
178
|
-
|
|
179
|
-
const
|
|
180
|
-
etState.forEach(objItem => {
|
|
277
|
+
// const promises: any[] = [];
|
|
278
|
+
const _objectiveState = [];
|
|
279
|
+
etState.forEach((objItem, index) => {
|
|
181
280
|
if (objItem.nextState.taskId === ExecutionTaskID.DELIVER_CASH) {
|
|
182
281
|
var _objItem$nextState$da, _objItem$nextState$da2;
|
|
183
|
-
|
|
184
282
|
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;
|
|
185
283
|
}
|
|
284
|
+
if (isJobBasedOutput) {
|
|
285
|
+
var _etOutput$pendingEtDa;
|
|
286
|
+
let baseResponse = etOutput === null || etOutput === void 0 ? void 0 : etOutput.baseResponse;
|
|
287
|
+
if ((_etOutput$pendingEtDa = etOutput.pendingEtData[objItem.jobId]) !== null && _etOutput$pendingEtDa !== void 0 && _etOutput$pendingEtDa.baseResponse) {
|
|
288
|
+
var _etOutput$pendingEtDa2, _etOutput$pendingEtDa3;
|
|
289
|
+
baseResponse = etOutput.pendingEtData[objItem.jobId].baseResponse;
|
|
290
|
+
((_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);
|
|
291
|
+
}
|
|
292
|
+
const computedOutput = {
|
|
293
|
+
...baseResponse,
|
|
294
|
+
...(Object.keys(etOutput === null || etOutput === void 0 ? void 0 : etOutput['pendingEtData']).length ? etOutput.pendingEtData[objItem.jobId] || {} : {})
|
|
295
|
+
};
|
|
296
|
+
objItem.nextState.data.output = {
|
|
297
|
+
...computedOutput
|
|
298
|
+
};
|
|
299
|
+
etState[index].nextState.data.output = {
|
|
300
|
+
...computedOutput
|
|
301
|
+
};
|
|
302
|
+
} else objItem.nextState.data.output = {
|
|
303
|
+
...etOutput
|
|
304
|
+
};
|
|
186
305
|
|
|
187
|
-
|
|
306
|
+
/* promises.push(
|
|
307
|
+
this.dispatchExecutor.storePendingState(
|
|
308
|
+
objItem.objRef,
|
|
309
|
+
objItem.jobId,
|
|
310
|
+
objItem.nextState
|
|
311
|
+
)
|
|
312
|
+
); */
|
|
313
|
+
_objectiveState.push({
|
|
314
|
+
// objectiveRef: objItem.objRef,
|
|
315
|
+
jobId: objItem.jobId,
|
|
316
|
+
_state: objItem.nextState
|
|
317
|
+
});
|
|
318
|
+
});
|
|
319
|
+
// await Promise.all(promises);
|
|
320
|
+
await this.dispatchExecutor.storeBulkPendingState(_objectiveState);
|
|
321
|
+
}
|
|
322
|
+
async sendETOutput(etOutput, states, isJobBasedOutput) {
|
|
323
|
+
let isPendingState = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
|
|
324
|
+
const etState = !isPendingState ? states.next_states : states.pending_states;
|
|
325
|
+
if (!etState || etState.length === 0) {
|
|
326
|
+
Logger.getInstance().logEvent('sendETOutput', 'CONSTRAINTS FAILED', LOG_TYPE.SDK_ERROR);
|
|
327
|
+
return;
|
|
328
|
+
}
|
|
329
|
+
// const promises: any[] = [];
|
|
330
|
+
const _objectiveState = [];
|
|
331
|
+
const _etDataVar = isPendingState ? 'pendingEtData' : 'etData';
|
|
332
|
+
etState.forEach((objItem, index) => {
|
|
333
|
+
if (objItem.nextState.taskId === ExecutionTaskID.DELIVER_CASH) {
|
|
334
|
+
var _objItem$nextState$da3, _objItem$nextState$da4;
|
|
335
|
+
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;
|
|
336
|
+
}
|
|
337
|
+
if (isJobBasedOutput) {
|
|
338
|
+
var _etOutput$_etDataVar$;
|
|
339
|
+
let baseResponse = etOutput === null || etOutput === void 0 ? void 0 : etOutput.baseResponse;
|
|
340
|
+
if ((_etOutput$_etDataVar$ = etOutput[_etDataVar][objItem.jobId]) !== null && _etOutput$_etDataVar$ !== void 0 && _etOutput$_etDataVar$.baseResponse) {
|
|
341
|
+
var _etOutput$_etDataVar$2, _etOutput$_etDataVar$3;
|
|
342
|
+
baseResponse = etOutput[_etDataVar][objItem.jobId].baseResponse;
|
|
343
|
+
((_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);
|
|
344
|
+
}
|
|
345
|
+
const computedOutput = {
|
|
346
|
+
...baseResponse,
|
|
347
|
+
...(Object.keys(etOutput === null || etOutput === void 0 ? void 0 : etOutput[_etDataVar]).length ? etOutput[_etDataVar][objItem.jobId] || {} : {})
|
|
348
|
+
};
|
|
349
|
+
objItem.nextState.data.output = {
|
|
350
|
+
...computedOutput
|
|
351
|
+
};
|
|
352
|
+
etState[index].nextState.data.output = {
|
|
353
|
+
...computedOutput
|
|
354
|
+
};
|
|
355
|
+
} else objItem.nextState.data.output = {
|
|
356
|
+
...etOutput
|
|
188
357
|
};
|
|
189
|
-
|
|
358
|
+
|
|
359
|
+
// NEW CODE
|
|
360
|
+
_objectiveState.push({
|
|
361
|
+
objectiveRef: objItem.objRef,
|
|
362
|
+
jobId: objItem.jobId,
|
|
363
|
+
state: objItem.nextState
|
|
364
|
+
});
|
|
365
|
+
|
|
366
|
+
// OLD CODE
|
|
367
|
+
// promises.push(
|
|
368
|
+
// this.dispatchExecutor.lockObjectiveState(
|
|
369
|
+
// objItem.objRef,
|
|
370
|
+
// objItem.jobId,
|
|
371
|
+
// objItem.nextState
|
|
372
|
+
// )
|
|
373
|
+
// );
|
|
190
374
|
});
|
|
191
|
-
|
|
375
|
+
// OLD CODE
|
|
376
|
+
// await Promise.all(promises);
|
|
377
|
+
// console.log('_objectiveState: ', JSON.stringify(_objectiveState));
|
|
378
|
+
|
|
379
|
+
await this.bulkLockObjectiveStates(_objectiveState);
|
|
192
380
|
}
|
|
193
381
|
|
|
382
|
+
// ONLY USED IN RTScanScreen which is not used, needs cleanup
|
|
194
383
|
async saveETOutput(jobId, objRef, etState) {
|
|
195
|
-
await this.dispatchExecutor.lockObjectiveState(objRef, jobId, etState);
|
|
384
|
+
// await this.dispatchExecutor.lockObjectiveState(objRef, jobId, etState);
|
|
196
385
|
}
|
|
197
|
-
|
|
198
386
|
static getInstance() {
|
|
199
387
|
if (!DispatchStateContainer.instance) {
|
|
200
388
|
DispatchStateContainer.instance = new DispatchStateContainer();
|
|
201
389
|
}
|
|
202
|
-
|
|
203
390
|
return DispatchStateContainer.instance;
|
|
204
391
|
}
|
|
205
|
-
|
|
206
392
|
fetchObjectiveState(objRef, jobID) {
|
|
207
393
|
return this.dispatchExecutor.queryObjectiveStatus(objRef, jobID);
|
|
208
394
|
}
|
|
209
|
-
|
|
210
395
|
setSuccessRoute(route) {
|
|
211
396
|
this.successRoute = route;
|
|
212
397
|
}
|
|
213
|
-
|
|
214
398
|
getSuccessRoute() {
|
|
215
399
|
return this.successRoute;
|
|
216
400
|
}
|
|
217
|
-
|
|
218
401
|
setFailureRoute(route) {
|
|
219
402
|
this.failureRoute = route;
|
|
220
403
|
}
|
|
221
|
-
|
|
222
404
|
getFailureRoute() {
|
|
223
405
|
return this.failureRoute;
|
|
224
406
|
}
|
|
225
|
-
|
|
226
407
|
async getObjectiveSummary(jobObjective) {
|
|
227
408
|
try {
|
|
228
409
|
let response = [];
|
|
229
410
|
let summaryData = await EventsSyncManager.getInstance().getObjectiveSummary(jobObjective.jobId + jobObjective.objectiveId);
|
|
230
|
-
|
|
231
411
|
if (summaryData) {
|
|
232
412
|
for (const k in summaryData) {
|
|
233
413
|
if (k === 'inputs') continue;else {
|
|
@@ -240,7 +420,6 @@ export default class DispatchStateContainer {
|
|
|
240
420
|
});
|
|
241
421
|
}
|
|
242
422
|
}
|
|
243
|
-
|
|
244
423
|
return response;
|
|
245
424
|
} else return response;
|
|
246
425
|
} catch (error) {
|
|
@@ -248,51 +427,132 @@ export default class DispatchStateContainer {
|
|
|
248
427
|
return [];
|
|
249
428
|
}
|
|
250
429
|
}
|
|
251
|
-
|
|
252
|
-
async navigateToNextTask(navigation, route, etOutput, etSuccess, entityCode, eTaskID, baseETProps, isLastTask) {
|
|
430
|
+
async navigateToNextTask(navigation, route, etOutput, etSuccess, entityCode, eTaskID, baseETProps, isLastTask, isJobBasedOutput) {
|
|
253
431
|
try {
|
|
254
432
|
baseETProps.showProgress(true);
|
|
255
433
|
const reasonsContainer = ReasonCodeContainer.getInstance();
|
|
256
|
-
|
|
434
|
+
const eventsContainer = EventCodeContainer.getInstance();
|
|
435
|
+
const _eventCode = isJobBasedOutput ? etOutput.baseResponse.eventCode : etOutput.eventCode;
|
|
436
|
+
const _isReasonNotToBeUsed = isJobBasedOutput ? etOutput.baseResponse.reasonCode === REASON_NOT_USED : etOutput.reasonCode === REASON_NOT_USED;
|
|
437
|
+
if (_isReasonNotToBeUsed) {
|
|
438
|
+
isJobBasedOutput ? etOutput.baseResponse.reasonCode = '' : etOutput.reasonCode = '';
|
|
439
|
+
}
|
|
440
|
+
if (isLastTask) {
|
|
441
|
+
if (route.params[RouteParams.PENDING_STATES] && route.params[RouteParams.PENDING_STATES].length) {
|
|
442
|
+
var _states$0$nextState$d, _states$0$nextState$d2, _failureCodes$;
|
|
443
|
+
//Updated the states of pending states to completed end-state ET
|
|
444
|
+
await this.sendETOutput(route.params[RouteParams.PENDING_STATES_OUTPUT], route.params, true, true);
|
|
445
|
+
|
|
446
|
+
/**
|
|
447
|
+
* Here we'll get the states data for end et
|
|
448
|
+
*/
|
|
449
|
+
const _states = await this.bulkQueryNextET(this.getJobObjectiveList(route.params[RouteParams.PENDING_STATES]));
|
|
450
|
+
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, BaseEventCodes.ENTITY_SUCCESS);
|
|
451
|
+
let _etOutput = JSON.parse(JSON.stringify(etOutput));
|
|
452
|
+
_etOutput.entityCode = EntityCode.COMPLETED_FAILURE;
|
|
453
|
+
_etOutput.success = true;
|
|
454
|
+
_etOutput.eventCode = BaseEventCodes.ENTITY_SUCCESS;
|
|
455
|
+
_etOutput.reasonCode = ((_failureCodes$ = failureCodes[0]) === null || _failureCodes$ === void 0 ? void 0 : _failureCodes$.reasonCode) || '';
|
|
456
|
+
|
|
457
|
+
/**
|
|
458
|
+
* Update end et state
|
|
459
|
+
*/
|
|
460
|
+
await this.sendETOutput(_etOutput, {
|
|
461
|
+
next_states: _states
|
|
462
|
+
});
|
|
463
|
+
route.params[RouteParams.PENDING_STATES] = _states;
|
|
464
|
+
}
|
|
465
|
+
}
|
|
257
466
|
if (etSuccess) {
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
467
|
+
if (!_eventCode) {
|
|
468
|
+
const _successApplicable = route.params[RouteParams.NEXT_STATES][0].nextState.data.input.applicableReasons.success;
|
|
469
|
+
const successEventCodes = await eventsContainer.getEventCodes(_successApplicable);
|
|
470
|
+
let rParams;
|
|
471
|
+
rParams = {
|
|
472
|
+
...route.params
|
|
473
|
+
};
|
|
474
|
+
rParams[RouteParams.ET_SUCCESS] = true;
|
|
475
|
+
rParams[RouteParams.ET_SUCCESS_RESPONSE] = etOutput;
|
|
476
|
+
rParams[RouteParams.CURRENT_ET_NAME] = eTaskID;
|
|
477
|
+
rParams[RouteParams.IS_LAST_ET] = isLastTask;
|
|
478
|
+
rParams[RouteParams.EVENT_CODES] = successEventCodes;
|
|
479
|
+
rParams[RouteParams.APPLICABLE_CODES] = _successApplicable;
|
|
480
|
+
rParams[RouteParams.IS_JOB_BASED_OUTPUT] = isJobBasedOutput;
|
|
481
|
+
rParams[RouteParams.ROOT_META_DATA] = route.params[RouteParams.ROOT_META_DATA];
|
|
482
|
+
rParams[RouteParams.COMPLETED_STATES] = route.params[RouteParams.COMPLETED_STATES];
|
|
483
|
+
rParams[RouteParams.PENDING_STATES_OUTPUT] = route.params[RouteParams.PENDING_STATES_OUTPUT];
|
|
484
|
+
rParams[RouteParams.CANCEL_EVENT] = '';
|
|
485
|
+
navigation.replace(CustomScreens.REMARK_SCREEN, rParams);
|
|
486
|
+
} else {
|
|
487
|
+
const successCodes = await reasonsContainer.getReasonCodes(route.params[RouteParams.NEXT_STATES][0].nextState.data.input.applicableReasons.success ? route.params[RouteParams.NEXT_STATES][0].nextState.data.input.applicableReasons.success : route.params[RouteParams.NEXT_STATES][0].nextState.data.input.applicableReasons, _eventCode);
|
|
488
|
+
if (successCodes && successCodes.length > 0) {
|
|
489
|
+
if (successCodes.length === 1 || _isReasonNotToBeUsed) {
|
|
490
|
+
if (isJobBasedOutput) etOutput.baseResponse.reasonCode = successCodes[0].reasonCode;else etOutput.reasonCode = successCodes[0].reasonCode;
|
|
491
|
+
await this.saveAndProceed(baseETProps, etOutput, route.params, navigation, isLastTask, isJobBasedOutput);
|
|
492
|
+
} else {
|
|
493
|
+
let rParams;
|
|
494
|
+
rParams = {
|
|
495
|
+
...route.params
|
|
496
|
+
};
|
|
497
|
+
rParams[RouteParams.ET_SUCCESS] = true;
|
|
498
|
+
rParams[RouteParams.ET_SUCCESS_RESPONSE] = etOutput;
|
|
499
|
+
rParams[RouteParams.CURRENT_ET_NAME] = eTaskID;
|
|
500
|
+
rParams[RouteParams.REASONS] = successCodes;
|
|
501
|
+
rParams[RouteParams.IS_LAST_ET] = isLastTask;
|
|
502
|
+
rParams[RouteParams.ROOT_META_DATA] = route.params[RouteParams.ROOT_META_DATA];
|
|
503
|
+
rParams[RouteParams.COMPLETED_STATES] = route.params[RouteParams.COMPLETED_STATES];
|
|
504
|
+
rParams[RouteParams.PENDING_STATES_OUTPUT] = route.params[RouteParams.PENDING_STATES_OUTPUT];
|
|
505
|
+
rParams[RouteParams.CANCEL_EVENT] = _eventCode;
|
|
506
|
+
navigation.replace(CustomScreens.REMARK_SCREEN, rParams);
|
|
507
|
+
}
|
|
264
508
|
} else {
|
|
265
|
-
|
|
266
|
-
rParams = { ...route.params
|
|
267
|
-
};
|
|
268
|
-
rParams[RouteParams.ET_SUCCESS] = true;
|
|
269
|
-
rParams[RouteParams.ET_SUCCESS_RESPONSE] = etOutput;
|
|
270
|
-
rParams[RouteParams.CURRENT_ET_NAME] = eTaskID;
|
|
271
|
-
rParams[RouteParams.REASONS] = successCodes;
|
|
272
|
-
rParams[RouteParams.IS_LAST_ET] = isLastTask;
|
|
273
|
-
navigation.replace(CustomScreens.REMARK_SCREEN, rParams);
|
|
509
|
+
await this.saveAndProceed(baseETProps, etOutput, route.params, navigation, isLastTask, isJobBasedOutput);
|
|
274
510
|
}
|
|
275
|
-
} else {
|
|
276
|
-
await this.saveAndProceed(baseETProps, etOutput, route.params[RouteParams.NEXT_STATES], navigation, isLastTask);
|
|
277
511
|
}
|
|
278
512
|
} else {
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
513
|
+
let failureCodes = [];
|
|
514
|
+
if (!_eventCode) {
|
|
515
|
+
const _failureApplicable = route.params[RouteParams.NEXT_STATES][0].nextState.data.input.applicableReasons.failure;
|
|
516
|
+
const failureEventCodes = await eventsContainer.getEventCodes(_failureApplicable);
|
|
517
|
+
let rParams;
|
|
518
|
+
rParams = {
|
|
519
|
+
...route.params
|
|
520
|
+
};
|
|
521
|
+
rParams[RouteParams.ET_SUCCESS] = false;
|
|
522
|
+
// rParams[RouteParams.ET_SUCCESS_RESPONSE] = etOutput;
|
|
523
|
+
rParams[RouteParams.CURRENT_ET_NAME] = eTaskID;
|
|
524
|
+
rParams[RouteParams.IS_LAST_ET] = isLastTask;
|
|
525
|
+
rParams[RouteParams.EVENT_CODES] = failureEventCodes;
|
|
526
|
+
rParams[RouteParams.APPLICABLE_CODES] = _failureApplicable;
|
|
527
|
+
rParams[RouteParams.ROOT_META_DATA] = route.params[RouteParams.ROOT_META_DATA];
|
|
528
|
+
rParams[RouteParams.COMPLETED_STATES] = route.params[RouteParams.COMPLETED_STATES];
|
|
529
|
+
rParams[RouteParams.PENDING_STATES_OUTPUT] = route.params[RouteParams.PENDING_STATES_OUTPUT];
|
|
530
|
+
rParams[RouteParams.CANCEL_EVENT] = '';
|
|
531
|
+
navigation.replace(CustomScreens.REMARK_SCREEN, rParams);
|
|
532
|
+
} else {
|
|
533
|
+
if (_eventCode === GO_BACK_EVENT_CODE) failureCodes = [];else failureCodes = await reasonsContainer.getReasonCodes(route.params[RouteParams.NEXT_STATES][0].nextState.data.input.applicableReasons.failure ? route.params[RouteParams.NEXT_STATES][0].nextState.data.input.applicableReasons.failure : route.params[RouteParams.NEXT_STATES][0].nextState.data.input.applicableReasons, _eventCode);
|
|
534
|
+
if (failureCodes && failureCodes.length > 0) {
|
|
535
|
+
if (isJobBasedOutput) etOutput.baseResponse.reasonCode = failureCodes[0].reasonCode;
|
|
536
|
+
if (failureCodes.length === 1 || _isReasonNotToBeUsed) {
|
|
537
|
+
await this.saveAndProceed(baseETProps, isJobBasedOutput ? etOutput : await getBaseETResponse(entityCode, false, _eventCode, failureCodes[0].reasonCode), route.params, navigation, isLastTask, isJobBasedOutput);
|
|
538
|
+
} else {
|
|
539
|
+
let rParams;
|
|
540
|
+
rParams = {
|
|
541
|
+
...route.params
|
|
542
|
+
};
|
|
543
|
+
rParams[RouteParams.ET_SUCCESS] = false;
|
|
544
|
+
rParams[RouteParams.CURRENT_ET_NAME] = eTaskID;
|
|
545
|
+
rParams[RouteParams.REASONS] = failureCodes;
|
|
546
|
+
rParams[RouteParams.IS_LAST_ET] = isLastTask;
|
|
547
|
+
rParams[RouteParams.ROOT_META_DATA] = route.params[RouteParams.ROOT_META_DATA];
|
|
548
|
+
rParams[RouteParams.COMPLETED_STATES] = route.params[RouteParams.COMPLETED_STATES];
|
|
549
|
+
rParams[RouteParams.PENDING_STATES_OUTPUT] = route.params[RouteParams.PENDING_STATES_OUTPUT];
|
|
550
|
+
rParams[RouteParams.CANCEL_EVENT] = _eventCode;
|
|
551
|
+
navigation.replace(CustomScreens.REMARK_SCREEN, rParams);
|
|
552
|
+
}
|
|
284
553
|
} else {
|
|
285
|
-
|
|
286
|
-
rParams = { ...route.params
|
|
287
|
-
};
|
|
288
|
-
rParams[RouteParams.ET_SUCCESS] = false;
|
|
289
|
-
rParams[RouteParams.CURRENT_ET_NAME] = eTaskID;
|
|
290
|
-
rParams[RouteParams.REASONS] = failureCodes;
|
|
291
|
-
rParams[RouteParams.IS_LAST_ET] = isLastTask;
|
|
292
|
-
navigation.replace(CustomScreens.REMARK_SCREEN, rParams);
|
|
554
|
+
await this.saveAndProceed(baseETProps, isJobBasedOutput ? etOutput : await getBaseETResponse(entityCode, false, _eventCode, ''), route.params, navigation, isLastTask, isJobBasedOutput);
|
|
293
555
|
}
|
|
294
|
-
} else {
|
|
295
|
-
await this.saveAndProceed(baseETProps, await getBaseETResponse(entityCode, false, BaseEventCodes.ENTITY_FAILURE, ''), route.params[RouteParams.NEXT_STATES], navigation, isLastTask);
|
|
296
556
|
}
|
|
297
557
|
}
|
|
298
558
|
} catch (error) {
|
|
@@ -300,43 +560,132 @@ export default class DispatchStateContainer {
|
|
|
300
560
|
Logger.getInstance().logEvent('navigateToNextTask', error.message, LOG_TYPE.SDK_ERROR);
|
|
301
561
|
}
|
|
302
562
|
}
|
|
303
|
-
|
|
304
563
|
getJobObjectiveList(nextStates) {
|
|
305
564
|
const result = [];
|
|
306
565
|
nextStates.forEach(s => {
|
|
307
566
|
result.push({
|
|
308
567
|
jobId: s.jobId,
|
|
309
|
-
objectiveId: s.objRef
|
|
568
|
+
objectiveId: s.objRef,
|
|
569
|
+
groupId: s.groupId,
|
|
570
|
+
additionalData: s.additionalData
|
|
310
571
|
});
|
|
311
572
|
});
|
|
312
573
|
return result;
|
|
313
574
|
}
|
|
314
|
-
|
|
315
|
-
async moveToNextET(baseETProps, etStates, navigation, isLastTask) {
|
|
575
|
+
async moveToNextET(etOutput, baseETProps, states, navigation, isLastTask) {
|
|
316
576
|
try {
|
|
577
|
+
let etStates = states.next_states;
|
|
317
578
|
baseETProps.showProgress(true);
|
|
318
|
-
|
|
319
579
|
if (isLastTask && etStates && etStates.length > 0) {
|
|
320
580
|
if (this._stateKeys.length !== 0) {
|
|
321
581
|
const st = this._stateKeys.pop();
|
|
322
|
-
|
|
323
582
|
if (st) {
|
|
324
583
|
baseETProps.showProgress(false);
|
|
325
|
-
|
|
326
584
|
let nextStateList = this._mappedStates.get(st);
|
|
327
|
-
|
|
328
585
|
this._mappedStates.delete(st);
|
|
329
|
-
|
|
586
|
+
const taskMeta = JSON.parse(nextStateList && nextStateList[0].nextState.data.taskMeta || '{}');
|
|
587
|
+
let isFailureFlow = Object.keys(taskMeta).length ? taskMeta.allowFailureFlow !== undefined ? taskMeta.allowFailureFlow : true : true;
|
|
330
588
|
if (nextStateList != null && nextStateList.length > 0) {
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
589
|
+
if (!isFailureFlow) {
|
|
590
|
+
const promises = [];
|
|
591
|
+
const _objectiveState = [];
|
|
592
|
+
const _taskOutput = [];
|
|
593
|
+
/*for (let index = 0; index < nextStateList.length; index++) {
|
|
594
|
+
const objItem = nextStateList[index];
|
|
595
|
+
|
|
596
|
+
//OLD CODE
|
|
597
|
+
const prevOutput =
|
|
598
|
+
await this.dispatchExecutor.getTaskOutputByInstanceId(
|
|
599
|
+
objItem.nextState.name,
|
|
600
|
+
objItem.nextState.workflowInstanceId
|
|
601
|
+
);
|
|
602
|
+
objItem.nextState.data.output = { ...prevOutput }; */
|
|
603
|
+
//Updated the states of pending states to completed end-state ET
|
|
604
|
+
|
|
605
|
+
// NEW CODE
|
|
606
|
+
/* _objectiveState.push({
|
|
607
|
+
objectiveRef: objItem.objRef,
|
|
608
|
+
jobId: objItem.jobId,
|
|
609
|
+
state: objItem.nextState,
|
|
610
|
+
}); */
|
|
611
|
+
|
|
612
|
+
// OLD CODE
|
|
613
|
+
// promises.push(
|
|
614
|
+
// this.dispatchExecutor.lockObjectiveState(
|
|
615
|
+
// objItem.objRef,
|
|
616
|
+
// objItem.jobId,
|
|
617
|
+
// objItem.nextState
|
|
618
|
+
// )
|
|
619
|
+
// );
|
|
620
|
+
// }
|
|
621
|
+
// OLD CODE
|
|
622
|
+
// await Promise.all(promises);
|
|
623
|
+
|
|
624
|
+
// NEW CODE
|
|
625
|
+
nextStateList.forEach(objItem => {
|
|
626
|
+
// const objItem = nextStateList[index];
|
|
627
|
+
_taskOutput.push({
|
|
628
|
+
taskName: objItem.nextState.name,
|
|
629
|
+
jobId: objItem.jobId,
|
|
630
|
+
objectiveRef: objItem.objRef
|
|
631
|
+
});
|
|
632
|
+
});
|
|
633
|
+
const prevOutput = await this.dispatchExecutor.getBulkTaskOutput(_taskOutput);
|
|
634
|
+
nextStateList.forEach((objItem, index) => {
|
|
635
|
+
objItem.nextState.data.output = {
|
|
636
|
+
...prevOutput[index]
|
|
637
|
+
};
|
|
638
|
+
_objectiveState.push({
|
|
639
|
+
objectiveRef: objItem.objRef,
|
|
640
|
+
jobId: objItem.jobId,
|
|
641
|
+
state: objItem.nextState
|
|
642
|
+
});
|
|
643
|
+
});
|
|
644
|
+
await this.bulkLockObjectiveStates(_objectiveState);
|
|
645
|
+
|
|
646
|
+
/**
|
|
647
|
+
* Here we'll get the states data for end et
|
|
648
|
+
*/
|
|
649
|
+
const _states = await this.bulkQueryNextET(this.getJobObjectiveList(nextStateList));
|
|
650
|
+
if (_states[0].nextState.taskId === ExecutionTaskID.COMPLETED_FAILURE) {
|
|
651
|
+
var _states$0$nextState$d3, _states$0$nextState$d4, _failureCodes$2;
|
|
652
|
+
const failureCodes = await ReasonCodeContainer.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, BaseEventCodes.ENTITY_SUCCESS);
|
|
653
|
+
let _etOutput = JSON.parse(JSON.stringify(etOutput));
|
|
654
|
+
_etOutput.entityCode = EntityCode.COMPLETED_FAILURE;
|
|
655
|
+
_etOutput.success = true;
|
|
656
|
+
_etOutput.eventCode = BaseEventCodes.ENTITY_SUCCESS;
|
|
657
|
+
_etOutput.reasonCode = ((_failureCodes$2 = failureCodes[0]) === null || _failureCodes$2 === void 0 ? void 0 : _failureCodes$2.reasonCode) || '';
|
|
658
|
+
|
|
659
|
+
/**
|
|
660
|
+
* Update end et state
|
|
661
|
+
*/
|
|
662
|
+
await this.sendETOutput(_etOutput, {
|
|
663
|
+
next_states: _states
|
|
664
|
+
});
|
|
665
|
+
states.pending_states = [...(states.pending_states || []), ..._states];
|
|
666
|
+
} else {
|
|
667
|
+
let rParams = {};
|
|
668
|
+
rParams[RouteParams.NEXT_STATES] = _states;
|
|
669
|
+
rParams[RouteParams.PENDING_STATES] = [...(states.pending_states || [])];
|
|
670
|
+
rParams[RouteParams.COMPLETED_STATES] = [...(states.completed_states || []), ...etStates];
|
|
671
|
+
rParams[RouteParams.PENDING_STATES_OUTPUT] = states.pending_states_output;
|
|
672
|
+
rParams[RouteParams.ROOT_META_DATA] = states.rootMetaData;
|
|
673
|
+
navigation.replace(_states[0].nextState.taskId, rParams);
|
|
674
|
+
}
|
|
675
|
+
} else {
|
|
676
|
+
let rParams = {};
|
|
677
|
+
rParams[RouteParams.NEXT_STATES] = nextStateList;
|
|
678
|
+
rParams[RouteParams.PENDING_STATES] = [...(states.pending_states || [])];
|
|
679
|
+
rParams[RouteParams.COMPLETED_STATES] = [...(states.completed_states || []), ...etStates];
|
|
680
|
+
rParams[RouteParams.PENDING_STATES_OUTPUT] = states.pending_states_output;
|
|
681
|
+
rParams[RouteParams.ROOT_META_DATA] = states.rootMetaData;
|
|
682
|
+
navigation.replace(nextStateList[0].nextState.taskId, rParams);
|
|
683
|
+
}
|
|
334
684
|
}
|
|
335
|
-
|
|
336
|
-
return;
|
|
685
|
+
if (isFailureFlow) return;
|
|
337
686
|
}
|
|
338
687
|
}
|
|
339
|
-
|
|
688
|
+
etStates = [...etStates, ...(states.pending_states || []), ...(states.completed_states || [])];
|
|
340
689
|
let nextState = etStates[0];
|
|
341
690
|
let completeJobsSummary = [];
|
|
342
691
|
let objSummary = await this.getObjectiveSummary({
|
|
@@ -348,7 +697,6 @@ export default class DispatchStateContainer {
|
|
|
348
697
|
objectiveRef: etStates[0].objRef,
|
|
349
698
|
jobObjectiveSummary: objSummary
|
|
350
699
|
});
|
|
351
|
-
|
|
352
700
|
for (let i = 1; i < etStates.length; i++) {
|
|
353
701
|
let obs = await this.getObjectiveSummary({
|
|
354
702
|
jobId: etStates[i].jobId,
|
|
@@ -360,9 +708,11 @@ export default class DispatchStateContainer {
|
|
|
360
708
|
jobObjectiveSummary: obs
|
|
361
709
|
});
|
|
362
710
|
}
|
|
363
|
-
|
|
364
711
|
baseETProps.showProgress(false);
|
|
365
|
-
|
|
712
|
+
this.cache.clearKeys([this.cacheKeys.CURRENT_WORKING_TASK_ID]);
|
|
713
|
+
AppSyncManager.getInstance().isForceStartEnabled = true;
|
|
714
|
+
AppSyncManager.getInstance().isSyncActive = false;
|
|
715
|
+
AppSyncManager.getInstance().startSDKSyncManager();
|
|
366
716
|
if (nextState.nextState.taskId === ExecutionTaskID.COMPLETED_SUCCESS) {
|
|
367
717
|
navigation.replace(this.getSuccessRoute(), {
|
|
368
718
|
summary: objSummary,
|
|
@@ -381,10 +731,41 @@ export default class DispatchStateContainer {
|
|
|
381
731
|
} else {
|
|
382
732
|
let nextStateList = await this.bulkQueryNextET(this.getJobObjectiveList(etStates));
|
|
383
733
|
baseETProps.showProgress(false);
|
|
384
|
-
|
|
385
734
|
if (nextStateList != null && nextStateList.length > 0) {
|
|
386
735
|
let rParams = {};
|
|
387
736
|
rParams[RouteParams.NEXT_STATES] = nextStateList;
|
|
737
|
+
rParams[RouteParams.PENDING_STATES] = [...(states.pending_states || [])];
|
|
738
|
+
rParams[RouteParams.COMPLETED_STATES] = states.completed_states;
|
|
739
|
+
rParams[RouteParams.ROOT_META_DATA] = states.rootMetaData;
|
|
740
|
+
rParams[RouteParams.PENDING_STATES_OUTPUT] = states.pending_states_output;
|
|
741
|
+
|
|
742
|
+
/**
|
|
743
|
+
* For custom end event
|
|
744
|
+
* Add pending state(failed and unscanned) objectives only for scan et
|
|
745
|
+
*/
|
|
746
|
+
const _nextStates = etStates[0].nextState.taskId === ExecutionTaskID.SCAN ? [...etStates, ...(states.pending_states || [])] : etStates;
|
|
747
|
+
if (!isLastTask) {
|
|
748
|
+
var _etStates$0$nextState, _etOutput$baseRespons;
|
|
749
|
+
const eventOutputData = {
|
|
750
|
+
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) || {},
|
|
751
|
+
etData: {},
|
|
752
|
+
taskId: etStates[0].nextState.taskId,
|
|
753
|
+
nextTaskId: '',
|
|
754
|
+
timestamp: Date.now()
|
|
755
|
+
};
|
|
756
|
+
etStates[0].groupId ? eventOutputData['groupId'] = etStates[0].groupId : null;
|
|
757
|
+
_nextStates.forEach(objItem => {
|
|
758
|
+
var _objItem$nextState$da5, _eventOutputData$etDa, _eventOutputData$etDa2, _eventOutputData$etDa3;
|
|
759
|
+
eventOutputData.etData[objItem.jobId] = {
|
|
760
|
+
...(((_objItem$nextState$da5 = objItem.nextState.data) === null || _objItem$nextState$da5 === void 0 ? void 0 : _objItem$nextState$da5.output) || {}),
|
|
761
|
+
workflowInstanceId: objItem.nextState.workflowInstanceId,
|
|
762
|
+
additionalData: (objItem === null || objItem === void 0 ? void 0 : objItem.additionalData) || {}
|
|
763
|
+
};
|
|
764
|
+
(((_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);
|
|
765
|
+
});
|
|
766
|
+
eventOutputData.nextTaskId = nextStateList[0].nextState.taskId;
|
|
767
|
+
eventOutputData.etData[Object.keys(eventOutputData.etData)[0]].eventCode !== GO_BACK_EVENT_CODE ? dispatchEvent('END', etStates[0].nextState.name, eventOutputData) : dispatchEvent('BACK', etStates[0].nextState.name, eventOutputData);
|
|
768
|
+
}
|
|
388
769
|
navigation.replace(nextStateList[0].nextState.taskId, rParams);
|
|
389
770
|
}
|
|
390
771
|
}
|
|
@@ -393,13 +774,10 @@ export default class DispatchStateContainer {
|
|
|
393
774
|
Logger.getInstance().logEvent('moveToNextET', error.message, LOG_TYPE.SDK_ERROR);
|
|
394
775
|
}
|
|
395
776
|
}
|
|
396
|
-
|
|
397
|
-
async saveAndProceed(baseETProps, etOutput, etStates, navigation, isLastTask) {
|
|
777
|
+
async saveAndProceed(baseETProps, etOutput, states, navigation, isLastTask, isJobBasedOutput) {
|
|
398
778
|
baseETProps.showProgress(true);
|
|
399
|
-
await this.saveAndProceedToNextET(baseETProps, etOutput,
|
|
779
|
+
await this.saveAndProceedToNextET(baseETProps, etOutput, states, navigation, isLastTask, isJobBasedOutput);
|
|
400
780
|
}
|
|
401
|
-
|
|
402
781
|
}
|
|
403
|
-
|
|
404
782
|
_defineProperty(DispatchStateContainer, "instance", void 0);
|
|
405
783
|
//# sourceMappingURL=DispatchStateContainer.js.map
|