@os1-platform/dispatch-mobile 1.0.8 → 2.0.0
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 +310 -74
- package/android/.gradle/7.0.2/fileChanges/last-build.bin +0 -0
- package/android/.gradle/7.0.2/fileHashes/fileHashes.lock +0 -0
- package/android/.gradle/7.0.2/gc.properties +0 -0
- package/android/.gradle/7.2/dependencies-accessors/dependencies-accessors.lock +0 -0
- package/android/.gradle/7.2/dependencies-accessors/gc.properties +0 -0
- package/android/.gradle/7.2/executionHistory/executionHistory.bin +0 -0
- package/android/.gradle/7.2/executionHistory/executionHistory.lock +0 -0
- package/android/.gradle/7.2/fileChanges/last-build.bin +0 -0
- package/android/.gradle/7.2/fileHashes/fileHashes.bin +0 -0
- package/android/.gradle/7.2/fileHashes/fileHashes.lock +0 -0
- package/android/.gradle/7.2/fileHashes/resourceHashesCache.bin +0 -0
- package/android/.gradle/7.2/gc.properties +0 -0
- package/android/.gradle/buildOutputCleanup/buildOutputCleanup.lock +0 -0
- package/android/.gradle/buildOutputCleanup/cache.properties +2 -0
- package/android/.gradle/buildOutputCleanup/outputFiles.bin +0 -0
- package/android/.gradle/checksums/checksums.lock +0 -0
- package/android/.gradle/checksums/md5-checksums.bin +0 -0
- package/android/.gradle/checksums/sha1-checksums.bin +0 -0
- package/android/.gradle/vcs-1/gc.properties +0 -0
- package/android/.idea/compiler.xml +6 -0
- package/android/.idea/gradle.xml +18 -0
- package/android/.idea/jarRepositories.xml +35 -0
- package/android/.idea/kotlinc.xml +6 -0
- package/android/.idea/misc.xml +9 -0
- package/android/.idea/vcs.xml +6 -0
- package/android/gradle.properties +1 -1
- package/android/local.properties +8 -0
- package/android/src/main/AndroidManifest.xml +0 -1
- package/android/src/main/java/com/dispatchsdk/DispatchSdkPackage.kt +3 -1
- package/android/src/main/java/com/dispatchsdk/sharedPref/SharedPreferenceModule.kt +166 -0
- package/lib/commonjs/@types/assets/index.d.js +2 -0
- package/lib/commonjs/@types/assets/index.d.js.map +1 -0
- package/lib/commonjs/components/dispatch/DispatchExecNavigator.js +50 -43
- package/lib/commonjs/components/dispatch/DispatchExecNavigator.js.map +1 -1
- package/lib/commonjs/components/executiontasks/ExecutionTasksIndex.js +10 -48
- 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 +66 -18
- package/lib/commonjs/components/executiontasks/captureInput/CaptureText.js.map +1 -1
- package/lib/commonjs/components/executiontasks/captureInput/utils.js +13 -0
- package/lib/commonjs/components/executiontasks/captureInput/utils.js.map +1 -0
- 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/DeliverETInput.js.map +1 -1
- package/lib/commonjs/components/executiontasks/deliver/SLDeliverET.js +212 -95
- package/lib/commonjs/components/executiontasks/deliver/SLDeliverET.js.map +1 -1
- package/lib/commonjs/components/executiontasks/display/DisplayModalET.js +16 -25
- package/lib/commonjs/components/executiontasks/display/DisplayModalET.js.map +1 -1
- package/lib/commonjs/components/executiontasks/doodle/SignatureET.js +65 -29
- 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 +74 -30
- package/lib/commonjs/components/executiontasks/dropCash/SLDropCash.js.map +1 -1
- package/lib/commonjs/components/executiontasks/forms/FormGenerator.js +139 -50
- 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 +2 -17
- 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 +5 -14
- package/lib/commonjs/components/executiontasks/httpRequest/HttpEtUtils.js.map +1 -1
- package/lib/commonjs/components/executiontasks/httpRequest/HttpRequestET.js +3 -15
- 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 +11 -36
- package/lib/commonjs/components/executiontasks/imageCapture/CaptureUtils.js.map +1 -1
- package/lib/commonjs/components/executiontasks/imageCapture/ImageCapture.js +73 -48
- 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 +76 -29
- 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 +138 -32
- package/lib/commonjs/components/executiontasks/pickup/SLPickupET.js.map +1 -1
- package/lib/commonjs/components/executiontasks/scan/ScanET.js +741 -0
- package/lib/commonjs/components/executiontasks/scan/ScanET.js.map +1 -0
- package/lib/commonjs/components/executiontasks/scan/ScanSchema.js +19 -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 +43 -0
- package/lib/commonjs/components/executiontasks/scan/interfaces.js.map +1 -0
- package/lib/commonjs/components/executiontasks/scan/modalConstant.js +104 -0
- package/lib/commonjs/components/executiontasks/scan/modalConstant.js.map +1 -0
- package/lib/commonjs/components/executiontasks/{scanner → scan/sub_components}/CScanner.js +9 -29
- package/lib/commonjs/components/executiontasks/scan/sub_components/CScanner.js.map +1 -0
- package/lib/commonjs/components/executiontasks/scan/sub_components/DropDownUtils.js +109 -0
- package/lib/commonjs/components/executiontasks/scan/sub_components/DropDownUtils.js.map +1 -0
- package/lib/commonjs/components/executiontasks/{scanner/returns/ReasonDropDown.js → scan/sub_components/ERDropDown.js} +72 -55
- package/lib/commonjs/components/executiontasks/scan/sub_components/ERDropDown.js.map +1 -0
- package/lib/commonjs/components/executiontasks/scan/sub_components/SummaryPage.js +1099 -0
- package/lib/commonjs/components/executiontasks/scan/sub_components/SummaryPage.js.map +1 -0
- package/lib/commonjs/components/executiontasks/scan/utils.js +762 -0
- package/lib/commonjs/components/executiontasks/scan/utils.js.map +1 -0
- package/lib/commonjs/components/executiontasks/validateOTP/ValidateOTPET.js +333 -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 +63 -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/executiontasks/verifyOtp/VerifyOtpSchema.js.map +1 -1
- package/lib/commonjs/components/utils/index.js +14 -0
- package/lib/commonjs/components/utils/index.js.map +1 -0
- 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/Card.js +88 -0
- package/lib/commonjs/components/widgets/Card.js.map +1 -0
- package/lib/commonjs/components/widgets/GoBackModal.js +48 -0
- package/lib/commonjs/components/widgets/GoBackModal.js.map +1 -0
- package/lib/commonjs/components/widgets/IconButton.js +34 -0
- package/lib/commonjs/components/widgets/IconButton.js.map +1 -0
- package/lib/commonjs/components/widgets/ModalWidget.js +99 -0
- package/lib/commonjs/components/widgets/ModalWidget.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/SearchBar.js +74 -0
- package/lib/commonjs/components/widgets/SearchBar.js.map +1 -0
- package/lib/commonjs/components/widgets/SnackBarCustom.js +48 -40
- 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/TabsComponent.js +64 -0
- package/lib/commonjs/components/widgets/TabsComponent.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 +17 -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 +23 -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 +15 -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 +40 -35
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/manager/dispatch/DispatchStateContainer.js +328 -272
- 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 +23 -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 +23 -37
- 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/sdk/callbacksHandler.js +26 -0
- package/lib/commonjs/manager/sdk/callbacksHandler.js.map +1 -0
- package/lib/commonjs/manager/syncmanager/AppSyncManager.js +26 -46
- package/lib/commonjs/manager/syncmanager/AppSyncManager.js.map +1 -1
- package/lib/commonjs/manager/syncmanager/DBConfig.js +48 -9
- 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/constants.js +17 -0
- package/lib/commonjs/manager/syncmanager/constants.js.map +1 -0
- 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 +11 -36
- package/lib/commonjs/manager/syncmanager/document/DocumentHttpClient.js.map +1 -1
- package/lib/commonjs/manager/syncmanager/document/DocumentManager.js +8 -26
- package/lib/commonjs/manager/syncmanager/document/DocumentManager.js.map +1 -1
- package/lib/commonjs/manager/syncmanager/document/DocumentSyncManager.js +19 -58
- package/lib/commonjs/manager/syncmanager/document/DocumentSyncManager.js.map +1 -1
- package/lib/commonjs/manager/syncmanager/events/ETEventsManager.js +414 -29
- package/lib/commonjs/manager/syncmanager/events/ETEventsManager.js.map +1 -1
- package/lib/commonjs/manager/syncmanager/events/EventsSyncManager.js +208 -103
- package/lib/commonjs/manager/syncmanager/events/EventsSyncManager.js.map +1 -1
- package/lib/commonjs/manager/syncmanager/events/SyncHttpClient.js +157 -36
- 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 +4 -0
- 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 +10 -8
- package/lib/commonjs/styles/SdkColors.js.map +1 -1
- package/lib/commonjs/styles/executionTasks/CommonStyles.js +58 -25
- package/lib/commonjs/styles/executionTasks/CommonStyles.js.map +1 -1
- package/lib/commonjs/ui/screens/CancellationScreen.js +67 -27
- package/lib/commonjs/ui/screens/CancellationScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/CaptureInputScreen.js +15 -16
- package/lib/commonjs/ui/screens/CaptureInputScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/CompleteObjectiveScreen.js +11 -23
- package/lib/commonjs/ui/screens/CompleteObjectiveScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/DeliverScreen.js +30 -17
- package/lib/commonjs/ui/screens/DeliverScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/DisplayScreen.js +17 -13
- package/lib/commonjs/ui/screens/DisplayScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/DoodleScreen.js +17 -20
- package/lib/commonjs/ui/screens/DoodleScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/DropCashScreen.js +43 -31
- package/lib/commonjs/ui/screens/DropCashScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/ETScreensIndex.js +10 -19
- package/lib/commonjs/ui/screens/ETScreensIndex.js.map +1 -1
- package/lib/commonjs/ui/screens/FormsScreen.js +105 -17
- package/lib/commonjs/ui/screens/FormsScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/GeofenceScreen.js +16 -14
- package/lib/commonjs/ui/screens/GeofenceScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/HttpRequestScreen.js +14 -11
- package/lib/commonjs/ui/screens/HttpRequestScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/ImageCaptureScreen.js +38 -17
- package/lib/commonjs/ui/screens/ImageCaptureScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/PaymentScreen.js +28 -29
- package/lib/commonjs/ui/screens/PaymentScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/PickupScreen.js +41 -19
- package/lib/commonjs/ui/screens/PickupScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/ScanScreen.js +121 -0
- package/lib/commonjs/ui/screens/ScanScreen.js.map +1 -0
- package/lib/commonjs/ui/screens/StartWorkFlowScreen.js +64 -38
- package/lib/commonjs/ui/screens/StartWorkFlowScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/ValidateOTPScreen.js +55 -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 +24 -1
- package/lib/commonjs/ui/uiConfig/RouteParams.js.map +1 -1
- package/lib/commonjs/utils/ApiUtils.js +129 -0
- package/lib/commonjs/utils/ApiUtils.js.map +1 -0
- package/lib/commonjs/utils/ExecTaskUtils.js +111 -41
- 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 +61 -43
- package/lib/commonjs/utils/SyncManagerUtils.js.map +1 -1
- package/lib/commonjs/utils/fcm/FCM.js +59 -11
- package/lib/commonjs/utils/fcm/FCM.js.map +1 -1
- package/lib/commonjs/utils/fcm/FcmUtils.js +82 -21
- 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/useModal.js +53 -0
- package/lib/commonjs/utils/hooks/useModal.js.map +1 -0
- 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 +87 -31
- 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/@types/assets/index.d.js +2 -0
- package/lib/module/@types/assets/index.d.js.map +1 -0
- package/lib/module/components/dispatch/DispatchExecNavigator.js +50 -32
- package/lib/module/components/dispatch/DispatchExecNavigator.js.map +1 -1
- package/lib/module/components/executiontasks/ExecutionTasksIndex.js +3 -5
- 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 +68 -10
- package/lib/module/components/executiontasks/captureInput/CaptureText.js.map +1 -1
- package/lib/module/components/executiontasks/captureInput/utils.js +7 -0
- package/lib/module/components/executiontasks/captureInput/utils.js.map +1 -0
- 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/DeliverETInput.js.map +1 -1
- package/lib/module/components/executiontasks/deliver/SLDeliverET.js +214 -86
- package/lib/module/components/executiontasks/deliver/SLDeliverET.js.map +1 -1
- package/lib/module/components/executiontasks/display/DisplayModalET.js +16 -15
- package/lib/module/components/executiontasks/display/DisplayModalET.js.map +1 -1
- package/lib/module/components/executiontasks/doodle/SignatureET.js +68 -15
- 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 +75 -20
- package/lib/module/components/executiontasks/dropCash/SLDropCash.js.map +1 -1
- package/lib/module/components/executiontasks/forms/FormGenerator.js +142 -37
- 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 +2 -6
- 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 +6 -4
- package/lib/module/components/executiontasks/httpRequest/HttpEtUtils.js.map +1 -1
- package/lib/module/components/executiontasks/httpRequest/HttpRequestET.js +3 -6
- 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 +11 -11
- 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 +77 -18
- package/lib/module/components/executiontasks/payments/completePayment/CompletePaymentET.js.map +1 -1
- package/lib/module/components/executiontasks/payments/init/InitPaymentET.js +64 -11
- package/lib/module/components/executiontasks/payments/init/InitPaymentET.js.map +1 -1
- package/lib/module/components/executiontasks/payments/processPayment/ProcessPaymentET.js +72 -11
- 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 +141 -25
- package/lib/module/components/executiontasks/pickup/SLPickupET.js.map +1 -1
- package/lib/module/components/executiontasks/scan/ScanET.js +732 -0
- package/lib/module/components/executiontasks/scan/ScanET.js.map +1 -0
- package/lib/module/components/executiontasks/scan/ScanSchema.js +17 -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 +33 -0
- package/lib/module/components/executiontasks/scan/interfaces.js.map +1 -0
- package/lib/module/components/executiontasks/scan/modalConstant.js +94 -0
- package/lib/module/components/executiontasks/scan/modalConstant.js.map +1 -0
- package/lib/module/components/executiontasks/{scanner → scan/sub_components}/CScanner.js +9 -16
- package/lib/module/components/executiontasks/scan/sub_components/CScanner.js.map +1 -0
- package/lib/module/components/executiontasks/scan/sub_components/DropDownUtils.js +101 -0
- package/lib/module/components/executiontasks/scan/sub_components/DropDownUtils.js.map +1 -0
- package/lib/module/components/executiontasks/scan/sub_components/ERDropDown.js +107 -0
- package/lib/module/components/executiontasks/scan/sub_components/ERDropDown.js.map +1 -0
- package/lib/module/components/executiontasks/scan/sub_components/SummaryPage.js +1092 -0
- package/lib/module/components/executiontasks/scan/sub_components/SummaryPage.js.map +1 -0
- package/lib/module/components/executiontasks/scan/utils.js +726 -0
- package/lib/module/components/executiontasks/scan/utils.js.map +1 -0
- package/lib/module/components/executiontasks/validateOTP/ValidateOTPET.js +324 -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 +53 -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 +5 -9
- package/lib/module/components/executiontasks/verifyOtp/VerifyOtpET.js.map +1 -1
- package/lib/module/components/executiontasks/verifyOtp/VerifyOtpSchema.js.map +1 -1
- package/lib/module/components/utils/index.js +8 -0
- package/lib/module/components/utils/index.js.map +1 -0
- 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/Card.js +80 -0
- package/lib/module/components/widgets/Card.js.map +1 -0
- package/lib/module/components/widgets/GoBackModal.js +40 -0
- package/lib/module/components/widgets/GoBackModal.js.map +1 -0
- package/lib/module/components/widgets/IconButton.js +26 -0
- package/lib/module/components/widgets/IconButton.js.map +1 -0
- package/lib/module/components/widgets/ModalWidget.js +92 -0
- package/lib/module/components/widgets/ModalWidget.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/SearchBar.js +66 -0
- package/lib/module/components/widgets/SearchBar.js.map +1 -0
- package/lib/module/components/widgets/SnackBarCustom.js +46 -20
- 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/TabsComponent.js +55 -0
- package/lib/module/components/widgets/TabsComponent.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 +9 -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 +16 -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 +8 -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 +9 -5
- package/lib/module/index.js.map +1 -1
- package/lib/module/manager/dispatch/DispatchStateContainer.js +334 -247
- 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 +22 -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 +23 -15
- 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/sdk/callbacksHandler.js +19 -0
- package/lib/module/manager/sdk/callbacksHandler.js.map +1 -0
- package/lib/module/manager/syncmanager/AppSyncManager.js +26 -26
- package/lib/module/manager/syncmanager/AppSyncManager.js.map +1 -1
- package/lib/module/manager/syncmanager/DBConfig.js +41 -7
- 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/constants.js +6 -0
- package/lib/module/manager/syncmanager/constants.js.map +1 -0
- 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 +11 -24
- package/lib/module/manager/syncmanager/document/DocumentHttpClient.js.map +1 -1
- package/lib/module/manager/syncmanager/document/DocumentManager.js +8 -20
- package/lib/module/manager/syncmanager/document/DocumentManager.js.map +1 -1
- package/lib/module/manager/syncmanager/document/DocumentSyncManager.js +19 -41
- package/lib/module/manager/syncmanager/document/DocumentSyncManager.js.map +1 -1
- package/lib/module/manager/syncmanager/events/ETEventsManager.js +415 -22
- package/lib/module/manager/syncmanager/events/ETEventsManager.js.map +1 -1
- package/lib/module/manager/syncmanager/events/EventsSyncManager.js +209 -82
- package/lib/module/manager/syncmanager/events/EventsSyncManager.js.map +1 -1
- package/lib/module/manager/syncmanager/events/SyncHttpClient.js +152 -24
- 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 +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 +9 -7
- package/lib/module/styles/SdkColors.js.map +1 -1
- package/lib/module/styles/executionTasks/CommonStyles.js +57 -14
- package/lib/module/styles/executionTasks/CommonStyles.js.map +1 -1
- package/lib/module/ui/screens/CancellationScreen.js +68 -15
- package/lib/module/ui/screens/CancellationScreen.js.map +1 -1
- package/lib/module/ui/screens/CaptureInputScreen.js +17 -6
- package/lib/module/ui/screens/CaptureInputScreen.js.map +1 -1
- package/lib/module/ui/screens/CompleteObjectiveScreen.js +12 -8
- package/lib/module/ui/screens/CompleteObjectiveScreen.js.map +1 -1
- package/lib/module/ui/screens/DeliverScreen.js +32 -7
- package/lib/module/ui/screens/DeliverScreen.js.map +1 -1
- package/lib/module/ui/screens/DisplayScreen.js +16 -6
- package/lib/module/ui/screens/DisplayScreen.js.map +1 -1
- package/lib/module/ui/screens/DoodleScreen.js +19 -9
- package/lib/module/ui/screens/DoodleScreen.js.map +1 -1
- package/lib/module/ui/screens/DropCashScreen.js +45 -19
- package/lib/module/ui/screens/DropCashScreen.js.map +1 -1
- package/lib/module/ui/screens/ETScreensIndex.js +3 -2
- package/lib/module/ui/screens/ETScreensIndex.js.map +1 -1
- package/lib/module/ui/screens/FormsScreen.js +104 -9
- package/lib/module/ui/screens/FormsScreen.js.map +1 -1
- package/lib/module/ui/screens/GeofenceScreen.js +15 -6
- package/lib/module/ui/screens/GeofenceScreen.js.map +1 -1
- package/lib/module/ui/screens/HttpRequestScreen.js +15 -5
- package/lib/module/ui/screens/HttpRequestScreen.js.map +1 -1
- package/lib/module/ui/screens/ImageCaptureScreen.js +37 -9
- package/lib/module/ui/screens/ImageCaptureScreen.js.map +1 -1
- package/lib/module/ui/screens/PaymentScreen.js +30 -17
- package/lib/module/ui/screens/PaymentScreen.js.map +1 -1
- package/lib/module/ui/screens/PickupScreen.js +40 -12
- package/lib/module/ui/screens/PickupScreen.js.map +1 -1
- package/lib/module/ui/screens/ScanScreen.js +111 -0
- package/lib/module/ui/screens/ScanScreen.js.map +1 -0
- package/lib/module/ui/screens/StartWorkFlowScreen.js +64 -16
- package/lib/module/ui/screens/StartWorkFlowScreen.js.map +1 -1
- package/lib/module/ui/screens/ValidateOTPScreen.js +45 -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 +23 -1
- package/lib/module/ui/uiConfig/RouteParams.js.map +1 -1
- package/lib/module/utils/ApiUtils.js +116 -0
- package/lib/module/utils/ApiUtils.js.map +1 -0
- package/lib/module/utils/ExecTaskUtils.js +110 -31
- 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 +62 -14
- package/lib/module/utils/SyncManagerUtils.js.map +1 -1
- package/lib/module/utils/fcm/FCM.js +63 -3
- package/lib/module/utils/fcm/FCM.js.map +1 -1
- package/lib/module/utils/fcm/FcmUtils.js +86 -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/useModal.js +43 -0
- package/lib/module/utils/hooks/useModal.js.map +1 -0
- 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 +86 -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/dispatch/DispatchExecNavigator.d.ts +2 -2
- package/lib/typescript/components/executiontasks/CompletedWFSchema.d.ts +2 -2
- package/lib/typescript/components/executiontasks/ExecutionTasksIndex.d.ts +6 -7
- package/lib/typescript/components/executiontasks/cancellation/CancelET.d.ts +2 -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/captureInput/CaptureText.d.ts +2 -2
- package/lib/typescript/components/executiontasks/captureInput/utils.d.ts +1 -0
- package/lib/typescript/components/executiontasks/deliver/DeliverET.d.ts +2 -2
- package/lib/typescript/components/executiontasks/deliver/DeliverETInput.d.ts +8 -7
- package/lib/typescript/components/executiontasks/deliver/SLDeliverET.d.ts +3 -3
- package/lib/typescript/components/executiontasks/display/DisplayModalET.d.ts +2 -2
- package/lib/typescript/components/executiontasks/display/DisplaySchema.d.ts +5 -5
- package/lib/typescript/components/executiontasks/doodle/SignatureET.d.ts +2 -2
- package/lib/typescript/components/executiontasks/doodle/SignatureSchema.d.ts +7 -7
- package/lib/typescript/components/executiontasks/dropCash/DropCashET.d.ts +2 -2
- package/lib/typescript/components/executiontasks/dropCash/DropCashSchema.d.ts +2 -2
- package/lib/typescript/components/executiontasks/dropCash/SLDropCash.d.ts +2 -2
- package/lib/typescript/components/executiontasks/forms/FormGenerator.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 +3 -3
- package/lib/typescript/components/executiontasks/forms/widgets/DropdownWidget.d.ts +9 -0
- package/lib/typescript/components/executiontasks/forms/widgets/QRBarcodeScannerWidget.d.ts +2 -2
- package/lib/typescript/components/executiontasks/forms/widgets/TimeRangeSelector.d.ts +2 -2
- package/lib/typescript/components/executiontasks/httpRequest/HttpEtUtils.d.ts +1 -1
- package/lib/typescript/components/executiontasks/httpRequest/HttpRequestET.d.ts +2 -2
- package/lib/typescript/components/executiontasks/httpRequest/HttpRequestETSchema.d.ts +6 -6
- package/lib/typescript/components/executiontasks/imageCapture/CaptureSchema.d.ts +17 -11
- package/lib/typescript/components/executiontasks/imageCapture/ImageCapture.d.ts +2 -2
- package/lib/typescript/components/executiontasks/payments/completePayment/CompletePaymentET.d.ts +2 -2
- package/lib/typescript/components/executiontasks/payments/completePayment/CompletePaymentSchema.d.ts +2 -2
- package/lib/typescript/components/executiontasks/payments/init/InitPaymentET.d.ts +2 -2
- package/lib/typescript/components/executiontasks/payments/init/InitPaymentSchema.d.ts +3 -3
- package/lib/typescript/components/executiontasks/payments/processPayment/ProcessPaymentET.d.ts +2 -2
- 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/pickup/PickupET.d.ts +2 -2
- package/lib/typescript/components/executiontasks/pickup/SLPickupET.d.ts +3 -3
- package/lib/typescript/components/executiontasks/scan/ScanET.d.ts +16 -0
- package/lib/typescript/components/executiontasks/scan/ScanSchema.d.ts +86 -0
- package/lib/typescript/components/executiontasks/scan/constants.d.ts +6 -0
- package/lib/typescript/components/executiontasks/scan/interfaces.d.ts +94 -0
- package/lib/typescript/components/executiontasks/scan/modalConstant.d.ts +37 -0
- package/lib/typescript/components/executiontasks/{scanner → scan/sub_components}/CScanner.d.ts +1 -1
- 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/SummaryPage.d.ts +21 -0
- package/lib/typescript/components/executiontasks/scan/utils.d.ts +37 -0
- 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/verifyLocation/VerifyLocationET.d.ts +2 -2
- package/lib/typescript/components/executiontasks/verifyOtp/VerifyOtpET.d.ts +2 -2
- package/lib/typescript/components/executiontasks/verifyOtp/VerifyOtpSchema.d.ts +6 -6
- package/lib/typescript/components/utils/index.d.ts +2 -0
- package/lib/typescript/components/widgets/CancelOrderDialog.d.ts +2 -2
- package/lib/typescript/components/widgets/Card.d.ts +17 -0
- package/lib/typescript/components/widgets/GoBackModal.d.ts +9 -0
- package/lib/typescript/components/widgets/IconButton.d.ts +9 -0
- package/lib/typescript/components/widgets/ModalWidget.d.ts +30 -0
- package/lib/typescript/components/widgets/ProgressDialog.d.ts +2 -2
- package/lib/typescript/components/widgets/SearchBar.d.ts +10 -0
- package/lib/typescript/components/widgets/SnackBarCustom.d.ts +10 -5
- package/lib/typescript/components/widgets/SplitTextInput.d.ts +12 -0
- package/lib/typescript/components/widgets/TabsComponent.d.ts +15 -0
- package/lib/typescript/constants/apiConstants.d.ts +7 -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 +3 -0
- package/lib/typescript/events/EventListener.d.ts +5 -0
- package/lib/typescript/events/constants.d.ts +7 -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 +12 -9
- package/lib/typescript/manager/dispatch/DispatchStateContainer.d.ts +38 -17
- 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 +0 -0
- package/lib/typescript/manager/sdk/DispatchSdkCache.d.ts +1 -0
- package/lib/typescript/manager/sdk/callbacksHandler.d.ts +13 -0
- package/lib/typescript/manager/syncmanager/AppSyncManager.d.ts +3 -1
- package/lib/typescript/manager/syncmanager/DBConfig.d.ts +80 -4
- package/lib/typescript/manager/syncmanager/constants.d.ts +5 -0
- package/lib/typescript/manager/syncmanager/database.d.ts +5 -0
- package/lib/typescript/manager/syncmanager/document/DocumentManager.d.ts +1 -1
- package/lib/typescript/manager/syncmanager/document/DocumentSyncManager.d.ts +1 -1
- package/lib/typescript/manager/syncmanager/document/models.d.ts +1 -1
- package/lib/typescript/manager/syncmanager/events/ETEventsManager.d.ts +15 -2
- package/lib/typescript/manager/syncmanager/events/EventsSyncManager.d.ts +4 -2
- package/lib/typescript/manager/syncmanager/events/SyncHttpClient.d.ts +6 -3
- package/lib/typescript/models/DispatchModels.d.ts +59 -5
- 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 +44 -20
- package/lib/typescript/models/execTasks/ETConfig.d.ts +8 -4
- package/lib/typescript/models/sdk.d.ts +12 -0
- package/lib/typescript/native/signature/SignatureCapture.d.ts +2 -2
- package/lib/typescript/network/NetworkUtils.d.ts +1 -5
- package/lib/typescript/styles/SdkColors.d.ts +2 -0
- package/lib/typescript/styles/executionTasks/CommonStyles.d.ts +50 -5
- package/lib/typescript/ui/screens/CancellationScreen.d.ts +2 -2
- package/lib/typescript/ui/screens/CaptureInputScreen.d.ts +2 -2
- package/lib/typescript/ui/screens/CompleteObjectiveScreen.d.ts +2 -2
- package/lib/typescript/ui/screens/DeliverScreen.d.ts +2 -2
- package/lib/typescript/ui/screens/DisplayScreen.d.ts +2 -2
- package/lib/typescript/ui/screens/DoodleScreen.d.ts +2 -2
- package/lib/typescript/ui/screens/DropCashScreen.d.ts +2 -2
- package/lib/typescript/ui/screens/ETScreensIndex.d.ts +3 -2
- package/lib/typescript/ui/screens/FormsScreen.d.ts +2 -2
- package/lib/typescript/ui/screens/GeofenceScreen.d.ts +2 -2
- package/lib/typescript/ui/screens/HttpRequestScreen.d.ts +1 -1
- package/lib/typescript/ui/screens/ImageCaptureScreen.d.ts +2 -2
- package/lib/typescript/ui/screens/PaymentScreen.d.ts +2 -2
- package/lib/typescript/ui/screens/PickupScreen.d.ts +2 -2
- package/lib/typescript/ui/screens/ScanScreen.d.ts +3 -0
- package/lib/typescript/ui/screens/StartWorkFlowScreen.d.ts +2 -2
- package/lib/typescript/ui/screens/ValidateOTPScreen.d.ts +3 -0
- package/lib/typescript/ui/screens/WithBaseDispatchScreen.d.ts +2 -2
- package/lib/typescript/ui/uiConfig/RouteParams.d.ts +14 -0
- package/lib/typescript/utils/ApiUtils.d.ts +61 -0
- package/lib/typescript/utils/ExecTaskUtils.d.ts +10 -4
- package/lib/typescript/utils/NetworkUtil.d.ts +1 -1
- package/lib/typescript/utils/SyncManagerUtils.d.ts +4 -3
- package/lib/typescript/utils/hooks/useModal.d.ts +6 -0
- package/lib/typescript/utils/hooks/useTimer.d.ts +5 -0
- package/lib/typescript/utils/storage.d.ts +32 -0
- package/package.json +26 -26
- package/tsconfig.json +9 -9
- package/file_unzip.js +0 -5
- package/lib/commonjs/components/executiontasks/doodle/DoodleUtils.js +0 -28
- package/lib/commonjs/components/executiontasks/doodle/DoodleUtils.js.map +0 -1
- package/lib/commonjs/components/executiontasks/scanner/CScanner.js.map +0 -1
- package/lib/commonjs/components/executiontasks/scanner/ScannerSchema.js +0 -32
- package/lib/commonjs/components/executiontasks/scanner/ScannerSchema.js.map +0 -1
- package/lib/commonjs/components/executiontasks/scanner/ScannerUtils.js +0 -193
- package/lib/commonjs/components/executiontasks/scanner/ScannerUtils.js.map +0 -1
- package/lib/commonjs/components/executiontasks/scanner/returns/DropDownSelector.js +0 -20
- package/lib/commonjs/components/executiontasks/scanner/returns/DropDownSelector.js.map +0 -1
- package/lib/commonjs/components/executiontasks/scanner/returns/DropDownUtils.js +0 -49
- package/lib/commonjs/components/executiontasks/scanner/returns/DropDownUtils.js.map +0 -1
- package/lib/commonjs/components/executiontasks/scanner/returns/RTReasonSelection.js +0 -107
- package/lib/commonjs/components/executiontasks/scanner/returns/RTReasonSelection.js.map +0 -1
- package/lib/commonjs/components/executiontasks/scanner/returns/RTScan.js +0 -317
- package/lib/commonjs/components/executiontasks/scanner/returns/RTScan.js.map +0 -1
- package/lib/commonjs/components/executiontasks/scanner/returns/ReasonDropDown.js.map +0 -1
- package/lib/commonjs/components/executiontasks/scanner/returns/ScanList.js +0 -276
- package/lib/commonjs/components/executiontasks/scanner/returns/ScanList.js.map +0 -1
- package/lib/commonjs/ui/screens/RTScanScreen.js +0 -118
- package/lib/commonjs/ui/screens/RTScanScreen.js.map +0 -1
- package/lib/module/components/executiontasks/doodle/DoodleUtils.js +0 -19
- package/lib/module/components/executiontasks/doodle/DoodleUtils.js.map +0 -1
- package/lib/module/components/executiontasks/scanner/CScanner.js.map +0 -1
- package/lib/module/components/executiontasks/scanner/ScannerSchema.js +0 -24
- package/lib/module/components/executiontasks/scanner/ScannerSchema.js.map +0 -1
- package/lib/module/components/executiontasks/scanner/ScannerUtils.js +0 -158
- package/lib/module/components/executiontasks/scanner/ScannerUtils.js.map +0 -1
- package/lib/module/components/executiontasks/scanner/returns/DropDownSelector.js +0 -9
- package/lib/module/components/executiontasks/scanner/returns/DropDownSelector.js.map +0 -1
- package/lib/module/components/executiontasks/scanner/returns/DropDownUtils.js +0 -38
- package/lib/module/components/executiontasks/scanner/returns/DropDownUtils.js.map +0 -1
- package/lib/module/components/executiontasks/scanner/returns/RTReasonSelection.js +0 -86
- package/lib/module/components/executiontasks/scanner/returns/RTReasonSelection.js.map +0 -1
- package/lib/module/components/executiontasks/scanner/returns/RTScan.js +0 -287
- package/lib/module/components/executiontasks/scanner/returns/RTScan.js.map +0 -1
- package/lib/module/components/executiontasks/scanner/returns/ReasonDropDown.js +0 -80
- package/lib/module/components/executiontasks/scanner/returns/ReasonDropDown.js.map +0 -1
- package/lib/module/components/executiontasks/scanner/returns/ScanList.js +0 -253
- package/lib/module/components/executiontasks/scanner/returns/ScanList.js.map +0 -1
- package/lib/module/ui/screens/RTScanScreen.js +0 -93
- package/lib/module/ui/screens/RTScanScreen.js.map +0 -1
- package/lib/typescript/components/executiontasks/doodle/DoodleUtils.d.ts +0 -3
- package/lib/typescript/components/executiontasks/scanner/ScannerSchema.d.ts +0 -75
- package/lib/typescript/components/executiontasks/scanner/ScannerUtils.d.ts +0 -15
- package/lib/typescript/components/executiontasks/scanner/returns/DropDownSelector.d.ts +0 -3
- package/lib/typescript/components/executiontasks/scanner/returns/DropDownUtils.d.ts +0 -3
- package/lib/typescript/components/executiontasks/scanner/returns/RTReasonSelection.d.ts +0 -7
- package/lib/typescript/components/executiontasks/scanner/returns/RTScan.d.ts +0 -4
- package/lib/typescript/components/executiontasks/scanner/returns/ReasonDropDown.d.ts +0 -14
- package/lib/typescript/components/executiontasks/scanner/returns/ScanList.d.ts +0 -17
- package/lib/typescript/ui/screens/RTScanScreen.d.ts +0 -3
- package/mobile-execution-lib-0.6.4.tgz +0 -0
|
@@ -1,10 +1,10 @@
|
|
|
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
|
-
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
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 } from '../../utils/SyncManagerUtils';
|
|
5
|
+
import { DispatchExecutor as dispatchExecutor } from '@os1-platform/platform-coreos-execution-engine-sdk';
|
|
6
6
|
import { showToast } from '../../components/widgets/Toaster';
|
|
7
|
-
import {
|
|
7
|
+
import { CustomScreens, ExecutionTaskID } from '../../models/execTasks/ETConfig';
|
|
8
8
|
import EventsSyncManager from '../syncmanager/events/EventsSyncManager';
|
|
9
9
|
import Logger, { LOG_TYPE } from '../../utils/Logger';
|
|
10
10
|
import DispatchSdkCache from '../sdk/DispatchSdkCache';
|
|
@@ -15,24 +15,30 @@ import BaseErrorCodes from '../../errors/ErrorCodes';
|
|
|
15
15
|
import ErrorCodes, { InvalidArgumentsError } from '../../errors/ErrorCodes';
|
|
16
16
|
import { RouteParams } from '../../ui/uiConfig/RouteParams';
|
|
17
17
|
import { debounce } from 'lodash';
|
|
18
|
+
import dispatchEvent from '../../events/EventDispatcher';
|
|
19
|
+
import EventCodeContainer from '../dispatchCodes/EventCodeContainer';
|
|
20
|
+
import { GO_BACK_EVENT_CODE, REASON_NOT_USED } from '../../constants/constants';
|
|
21
|
+
import AppSyncManager from '../syncmanager/AppSyncManager';
|
|
22
|
+
import { DispatchExecutor } from '@os1-platform/platform-coreos-execution-engine-sdk';
|
|
23
|
+
|
|
24
|
+
// NEW CODE
|
|
25
|
+
import { BULK_DATA_LIMIT, LAST_SYNCED_EVENT_ID, SCAN_MERGED_OBJ_ID_OUTPUT, SHARED_PREFERENCE_DISPATCH_ID, SHARED_PREFERENCE_SCAN_OUTPUT } from '../syncmanager/constants';
|
|
26
|
+
import Storage from '../../utils/storage';
|
|
27
|
+
import { clearScanOutput, getScanMergedObjectID } from '../../components/executiontasks/scan/utils';
|
|
18
28
|
export default class DispatchStateContainer {
|
|
19
29
|
constructor() {
|
|
20
|
-
_defineProperty(this, "
|
|
21
|
-
|
|
30
|
+
_defineProperty(this, "cacheKeys", DispatchSdkCache.KEYS);
|
|
31
|
+
_defineProperty(this, "cache", DispatchSdkCache.getInstance());
|
|
22
32
|
_defineProperty(this, "successRoute", null);
|
|
23
|
-
|
|
24
33
|
_defineProperty(this, "failureRoute", null);
|
|
25
|
-
|
|
26
34
|
_defineProperty(this, "_stateKeys", []);
|
|
27
|
-
|
|
28
35
|
_defineProperty(this, "_jobObjectives", null);
|
|
29
|
-
|
|
30
36
|
_defineProperty(this, "_mappedStates", new Map());
|
|
31
|
-
|
|
32
|
-
_defineProperty(this, "saveAndProceedToNextET", debounce(async (baseETProps, etOutput,
|
|
37
|
+
_defineProperty(this, "_mappedStatesData", new Map());
|
|
38
|
+
_defineProperty(this, "saveAndProceedToNextET", debounce(async (baseETProps, etOutput, states, navigation, isLastTask, isMergedObjectiveBasedOutput) => {
|
|
33
39
|
try {
|
|
34
|
-
await this.sendETOutput(etOutput,
|
|
35
|
-
await this.moveToNextET(baseETProps,
|
|
40
|
+
await this.sendETOutput(etOutput, states, isMergedObjectiveBasedOutput);
|
|
41
|
+
await this.moveToNextET(etOutput, baseETProps, states, navigation, isLastTask);
|
|
36
42
|
} catch (error) {
|
|
37
43
|
Logger.getInstance().logEvent('saveAndProceed', error.message, LOG_TYPE.SDK_ERROR);
|
|
38
44
|
baseETProps.showProgress(false);
|
|
@@ -40,194 +46,218 @@ export default class DispatchStateContainer {
|
|
|
40
46
|
}
|
|
41
47
|
}, 800));
|
|
42
48
|
}
|
|
43
|
-
|
|
44
49
|
get stateKeys() {
|
|
45
50
|
return this._stateKeys;
|
|
46
51
|
}
|
|
47
|
-
|
|
48
52
|
set stateKeys(value) {
|
|
49
53
|
this._stateKeys = value;
|
|
50
54
|
}
|
|
51
|
-
|
|
52
55
|
get mappedStates() {
|
|
53
56
|
return this._mappedStates;
|
|
54
57
|
}
|
|
55
|
-
|
|
56
58
|
set mappedStates(value) {
|
|
57
59
|
this._mappedStates = value;
|
|
58
60
|
}
|
|
59
|
-
|
|
60
61
|
/**
|
|
61
62
|
* Call this function when dispatch data is fetched successfully in client app
|
|
62
63
|
* @param dispatchID
|
|
63
64
|
* @param jobs
|
|
64
|
-
* @param
|
|
65
|
+
* @param dispatchWorkflows
|
|
65
66
|
* @param maxTaskReattempt
|
|
66
67
|
*/
|
|
67
|
-
async initDispatchExecutor(dispatchID, jobs,
|
|
68
|
-
if (!dispatchID || !jobs || jobs.length < 1) {
|
|
68
|
+
async initDispatchExecutor(dispatchID, jobs, dispatchWorkflows, maxTaskReattempt) {
|
|
69
|
+
if (!dispatchID || !jobs || jobs.length < 1 || !dispatchWorkflows || Object.keys(dispatchWorkflows).length < 1) {
|
|
69
70
|
Logger.getInstance().logEvent('initDispatchExecutor', InvalidArgumentsError, LOG_TYPE.SDK_WARNING);
|
|
70
71
|
throw new BaseError(BaseErrorCodes.InvalidArgumentError, InvalidArgumentsError);
|
|
71
72
|
}
|
|
72
|
-
|
|
73
|
-
let storage = Storage.getInstance();
|
|
74
73
|
await clearCache(dispatchID);
|
|
75
74
|
await DispatchSdkCache.getInstance().setKeyInCache(DispatchSdkCache.KEYS.DISPATCH_ID, dispatchID);
|
|
76
75
|
await createFmsFolder(dispatchID);
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
76
|
+
|
|
77
|
+
// NEW CODE
|
|
78
|
+
let storage = Storage.getInstance();
|
|
79
|
+
const sharedPreferenceDispatchId = await storage.getSharedItem(SHARED_PREFERENCE_DISPATCH_ID);
|
|
80
|
+
if (sharedPreferenceDispatchId) {
|
|
81
|
+
if (sharedPreferenceDispatchId !== dispatchID) {
|
|
82
|
+
await Promise.all([storage.setSharedItem(SHARED_PREFERENCE_DISPATCH_ID, dispatchID), storage.setSharedItem(LAST_SYNCED_EVENT_ID, '0')]);
|
|
83
|
+
}
|
|
84
|
+
} else {
|
|
85
|
+
await Promise.all([storage.setSharedItem(SHARED_PREFERENCE_DISPATCH_ID, dispatchID), storage.setSharedItem(LAST_SYNCED_EVENT_ID, '0')]);
|
|
86
|
+
}
|
|
87
|
+
await dispatchExecutor.start(dispatchID, jobs, dispatchWorkflows, {
|
|
88
|
+
maxTaskReattempt,
|
|
89
|
+
eventSyncBatchSize: BULK_DATA_LIMIT
|
|
89
90
|
});
|
|
90
91
|
}
|
|
91
92
|
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
93
|
+
// NEW CODE
|
|
94
|
+
/**
|
|
95
|
+
*
|
|
96
|
+
* @param mergedObjectiveId
|
|
97
|
+
* @returns IExecutionTaskQueryResponse {
|
|
98
|
+
* mergedObjectiveId: string;
|
|
99
|
+
* taskName: string;
|
|
100
|
+
* taskId: string;
|
|
101
|
+
* input: any;
|
|
102
|
+
* }
|
|
103
|
+
*/
|
|
104
|
+
|
|
105
|
+
async queryNextET(mergedObjectiveId, statusFilter) {
|
|
106
|
+
if (!mergedObjectiveId) {
|
|
107
|
+
Logger.getInstance().logEvent('queryNextET', 'CONSTRAINTS FAILED', LOG_TYPE.SDK_ERROR);
|
|
95
108
|
throw new BaseError(ErrorCodes.MERGING_ERROR, 'CONSTRAINTS FAILED');
|
|
96
109
|
}
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
}), LOG_TYPE.SDK_ERROR);
|
|
110
|
+
return await dispatchExecutor.getNextTask(mergedObjectiveId[0], statusFilter);
|
|
111
|
+
}
|
|
112
|
+
async updateScanETOutputSharedPreference(etOutput, prefixedMergedObjectiveId, prefixKey) {
|
|
113
|
+
etOutput.mergedObjectiveIds = prefixedMergedObjectiveId;
|
|
114
|
+
let storage = Storage.getInstance();
|
|
115
|
+
const output = await storage.getSharedItem(SHARED_PREFERENCE_SCAN_OUTPUT);
|
|
116
|
+
if (output) {
|
|
117
|
+
const scanETOutput = JSON.parse(output);
|
|
118
|
+
let _scanETOutput = {};
|
|
119
|
+
if (scanETOutput[prefixKey]) {
|
|
120
|
+
_scanETOutput = scanETOutput[prefixKey];
|
|
109
121
|
}
|
|
122
|
+
prefixedMergedObjectiveId.forEach(mergedId => {
|
|
123
|
+
_scanETOutput[mergedId] = etOutput;
|
|
124
|
+
});
|
|
110
125
|
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
126
|
+
// SAVE IN SHARED PREFERENCE
|
|
127
|
+
await storage.setSharedItem(SHARED_PREFERENCE_SCAN_OUTPUT, JSON.stringify({
|
|
128
|
+
...scanETOutput,
|
|
129
|
+
[prefixKey]: _scanETOutput
|
|
130
|
+
}));
|
|
131
|
+
} else {
|
|
132
|
+
const scanETOutput = {};
|
|
133
|
+
prefixedMergedObjectiveId.forEach(mergedId => {
|
|
134
|
+
scanETOutput[mergedId] = etOutput;
|
|
135
|
+
});
|
|
136
|
+
// SAVE IN SHARED PREFERENCE
|
|
137
|
+
await storage.setSharedItem(SHARED_PREFERENCE_SCAN_OUTPUT, JSON.stringify({
|
|
138
|
+
[prefixKey]: scanETOutput
|
|
139
|
+
}));
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
async updatePendingSharedPreference(eventType, prefixedMergedObjectiveId, prefixKey) {
|
|
143
|
+
let storage = Storage.getInstance();
|
|
144
|
+
const mergedIdOutput = await storage.getSharedItem(SCAN_MERGED_OBJ_ID_OUTPUT);
|
|
145
|
+
if (mergedIdOutput) {
|
|
146
|
+
const mergedIds = JSON.parse(mergedIdOutput);
|
|
147
|
+
const _mergedIds = mergedIds[prefixKey];
|
|
148
|
+
if (_mergedIds) {
|
|
149
|
+
if (eventType) {
|
|
150
|
+
_mergedIds.success.push(...prefixedMergedObjectiveId);
|
|
151
|
+
_mergedIds.pending = [];
|
|
120
152
|
} else {
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
this._mappedStates.set(nState.taskId, [{
|
|
124
|
-
nextState: nState,
|
|
125
|
-
objRef: o.objectiveId,
|
|
126
|
-
jobId: o.jobId
|
|
127
|
-
}]);
|
|
153
|
+
_mergedIds.failure.push(...prefixedMergedObjectiveId);
|
|
154
|
+
_mergedIds.pending = [];
|
|
128
155
|
}
|
|
156
|
+
await storage.setSharedItem(SCAN_MERGED_OBJ_ID_OUTPUT, JSON.stringify({
|
|
157
|
+
...mergedIds,
|
|
158
|
+
[prefixKey]: _mergedIds
|
|
159
|
+
}));
|
|
129
160
|
}
|
|
130
161
|
}
|
|
131
|
-
|
|
132
|
-
const taskID = this._stateKeys.pop();
|
|
133
|
-
|
|
134
|
-
if (taskID) {
|
|
135
|
-
const nextStates = this._mappedStates.get(taskID);
|
|
136
|
-
|
|
137
|
-
this._mappedStates.delete(taskID);
|
|
138
|
-
|
|
139
|
-
return nextStates ?? [];
|
|
140
|
-
} else return null;
|
|
141
162
|
}
|
|
142
163
|
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
164
|
+
// NEW CODE
|
|
165
|
+
async sendETOutput(etOutput, states, isMergedObjectiveBasedOutput) {
|
|
166
|
+
const mergedObjectiveIds = states[RouteParams.NEXT_STATES].mergedObjectiveIds;
|
|
167
|
+
const taskName = states[RouteParams.NEXT_STATES].taskName;
|
|
168
|
+
const taskID = states[RouteParams.NEXT_STATES].taskId;
|
|
169
|
+
const input = states[RouteParams.NEXT_STATES].input;
|
|
170
|
+
let lockTaskResponse = true;
|
|
171
|
+
if (isMergedObjectiveBasedOutput) {
|
|
172
|
+
// NEW CODE
|
|
173
|
+
const output = etOutput;
|
|
174
|
+
let promises = [];
|
|
175
|
+
const prefixKey = this.findPrefixKey(mergedObjectiveIds, etOutput, states);
|
|
176
|
+
let defaultConfig = {
|
|
177
|
+
index: -1,
|
|
178
|
+
success: false,
|
|
179
|
+
output: {}
|
|
180
|
+
};
|
|
181
|
+
let mergedIds = {
|
|
182
|
+
success: [],
|
|
183
|
+
failure: [],
|
|
184
|
+
pending: [prefixKey]
|
|
185
|
+
};
|
|
186
|
+
const filterIds = await getScanMergedObjectID();
|
|
187
|
+
if (filterIds) {
|
|
188
|
+
mergedIds = filterIds[prefixKey];
|
|
189
|
+
}
|
|
190
|
+
Object.keys(etOutput).forEach(mergedObjectiveId => {
|
|
191
|
+
const _output = output[mergedObjectiveId].output;
|
|
192
|
+
// PREFIX_KEY
|
|
193
|
+
if (mergedObjectiveId === 'default') {
|
|
194
|
+
const defaultOutput = output['default'].output;
|
|
195
|
+
// DELIVER AT DIFF LOCATION
|
|
196
|
+
if (defaultOutput.eventCode === REASON_NOT_USED) {
|
|
197
|
+
// DO NOT SEND OUTPUT WHEN DELIVER AT DIFF LOCATION
|
|
198
|
+
defaultOutput.eventCode = '';
|
|
199
|
+
defaultOutput.reasonCode = '';
|
|
200
|
+
lockTaskResponse = false;
|
|
201
|
+
} else {
|
|
202
|
+
defaultConfig = {
|
|
203
|
+
index: promises.length,
|
|
204
|
+
success: defaultOutput.success,
|
|
205
|
+
output: output['default']
|
|
206
|
+
};
|
|
207
|
+
promises.push(dispatchExecutor.saveTaskOutput(mergedIds.pending, taskName, taskID, {
|
|
208
|
+
input,
|
|
209
|
+
output: defaultOutput
|
|
210
|
+
}, {
|
|
211
|
+
ec: defaultOutput.eventCode,
|
|
212
|
+
rc: defaultOutput.reasonCode || ''
|
|
213
|
+
}));
|
|
214
|
+
}
|
|
215
|
+
} else {
|
|
216
|
+
promises.push(dispatchExecutor.saveTaskOutput([mergedObjectiveId], taskName, taskID, {
|
|
217
|
+
input,
|
|
218
|
+
output: _output
|
|
219
|
+
}));
|
|
220
|
+
}
|
|
148
221
|
});
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
showToast('ENGINE NOT READY! Please Try again after some time');
|
|
155
|
-
} else if (error instanceof ObjectiveNotFoundError) {
|
|
156
|
-
showToast('NO SUCH OBJECTIVE FOUND');
|
|
157
|
-
} else if (error instanceof ObjectiveNotReadyError) {
|
|
158
|
-
showToast('OBJECTIVE NOT READY');
|
|
159
|
-
} else if (error instanceof ObjectiveJobAlreadyCompletedError) {
|
|
160
|
-
showToast('OBJECTIVE CANNOT BE ATTEMPTED');
|
|
161
|
-
} else if (error instanceof JobStatusInvalidError || error instanceof JobNotFoundError || error instanceof EmptyJobError || error instanceof ETIdInvalidError) {
|
|
162
|
-
showToast('INVALID JOB');
|
|
222
|
+
const response = await Promise.all(promises);
|
|
223
|
+
if (defaultConfig.index !== -1) {
|
|
224
|
+
// UPDATE PENDING IN SHARED PREFERENCE MERGED_SCAN_OUTPUT
|
|
225
|
+
this.updatePendingSharedPreference(defaultConfig.success, response[defaultConfig.index], prefixKey);
|
|
226
|
+
this.updateScanETOutputSharedPreference(defaultConfig.output, response[defaultConfig.index], prefixKey);
|
|
163
227
|
}
|
|
164
|
-
|
|
165
|
-
|
|
228
|
+
} else {
|
|
229
|
+
await dispatchExecutor.saveTaskOutput(mergedObjectiveIds, taskName, taskID, {
|
|
230
|
+
input,
|
|
231
|
+
output: etOutput
|
|
232
|
+
});
|
|
166
233
|
}
|
|
167
234
|
}
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
return
|
|
171
|
-
}
|
|
172
|
-
|
|
173
|
-
async sendETOutput(etOutput, etState) {
|
|
174
|
-
if (!etState || etState.length === 0) {
|
|
175
|
-
Logger.getInstance().logEvent('sendETOutput', 'CONSTRAINTS FAILED', LOG_TYPE.SDK_ERROR);
|
|
176
|
-
return;
|
|
177
|
-
}
|
|
178
|
-
|
|
179
|
-
const promises = [];
|
|
180
|
-
etState.forEach(objItem => {
|
|
181
|
-
if (objItem.nextState.taskId === ExecutionTaskID.DELIVER_CASH) {
|
|
182
|
-
var _objItem$nextState$da, _objItem$nextState$da2;
|
|
183
|
-
|
|
184
|
-
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
|
-
}
|
|
186
|
-
|
|
187
|
-
objItem.nextState.data.output = { ...etOutput
|
|
188
|
-
};
|
|
189
|
-
promises.push(this.dispatchExecutor.lockObjectiveState(objItem.objRef, objItem.jobId, objItem.nextState));
|
|
190
|
-
});
|
|
191
|
-
await Promise.all(promises);
|
|
235
|
+
findPrefixKey(mergedObjectiveIds, scanOutput, routeParams) {
|
|
236
|
+
const prefixedMergedObjectiveId = routeParams[RouteParams.ROOT_META_DATA].prefixedMergedObjectiveId;
|
|
237
|
+
return prefixedMergedObjectiveId;
|
|
192
238
|
}
|
|
193
|
-
|
|
194
|
-
async saveETOutput(jobId, objRef, etState) {
|
|
195
|
-
await this.dispatchExecutor.lockObjectiveState(objRef, jobId, etState);
|
|
196
|
-
}
|
|
197
|
-
|
|
198
239
|
static getInstance() {
|
|
199
240
|
if (!DispatchStateContainer.instance) {
|
|
200
241
|
DispatchStateContainer.instance = new DispatchStateContainer();
|
|
201
242
|
}
|
|
202
|
-
|
|
203
243
|
return DispatchStateContainer.instance;
|
|
204
244
|
}
|
|
205
|
-
|
|
206
|
-
fetchObjectiveState(objRef, jobID) {
|
|
207
|
-
return this.dispatchExecutor.queryObjectiveStatus(objRef, jobID);
|
|
208
|
-
}
|
|
209
|
-
|
|
210
245
|
setSuccessRoute(route) {
|
|
211
246
|
this.successRoute = route;
|
|
212
247
|
}
|
|
213
|
-
|
|
214
248
|
getSuccessRoute() {
|
|
215
249
|
return this.successRoute;
|
|
216
250
|
}
|
|
217
|
-
|
|
218
251
|
setFailureRoute(route) {
|
|
219
252
|
this.failureRoute = route;
|
|
220
253
|
}
|
|
221
|
-
|
|
222
254
|
getFailureRoute() {
|
|
223
255
|
return this.failureRoute;
|
|
224
256
|
}
|
|
225
|
-
|
|
226
257
|
async getObjectiveSummary(jobObjective) {
|
|
227
258
|
try {
|
|
228
259
|
let response = [];
|
|
229
260
|
let summaryData = await EventsSyncManager.getInstance().getObjectiveSummary(jobObjective.jobId + jobObjective.objectiveId);
|
|
230
|
-
|
|
231
261
|
if (summaryData) {
|
|
232
262
|
for (const k in summaryData) {
|
|
233
263
|
if (k === 'inputs') continue;else {
|
|
@@ -240,7 +270,6 @@ export default class DispatchStateContainer {
|
|
|
240
270
|
});
|
|
241
271
|
}
|
|
242
272
|
}
|
|
243
|
-
|
|
244
273
|
return response;
|
|
245
274
|
} else return response;
|
|
246
275
|
} catch (error) {
|
|
@@ -248,51 +277,99 @@ export default class DispatchStateContainer {
|
|
|
248
277
|
return [];
|
|
249
278
|
}
|
|
250
279
|
}
|
|
251
|
-
|
|
252
|
-
async navigateToNextTask(navigation, route, etOutput, etSuccess, entityCode, eTaskID, baseETProps, isLastTask) {
|
|
280
|
+
async navigateToNextTask(navigation, route, etOutput, etSuccess, entityCode, eTaskID, baseETProps, isLastTask, isMergeObjectiveBasedOutput) {
|
|
253
281
|
try {
|
|
254
282
|
baseETProps.showProgress(true);
|
|
283
|
+
const mergedObjectiveIds = route.params[RouteParams.NEXT_STATES].mergedObjectiveIds;
|
|
255
284
|
const reasonsContainer = ReasonCodeContainer.getInstance();
|
|
256
|
-
|
|
257
|
-
if (
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
285
|
+
const eventsContainer = EventCodeContainer.getInstance();
|
|
286
|
+
if (isMergeObjectiveBasedOutput) {
|
|
287
|
+
await this.saveAndProceed(baseETProps, etOutput, route.params, navigation, isLastTask, isMergeObjectiveBasedOutput);
|
|
288
|
+
} else {
|
|
289
|
+
const _eventCode = etOutput.eventCode;
|
|
290
|
+
if (etSuccess) {
|
|
291
|
+
if (!_eventCode) {
|
|
292
|
+
const _successApplicable = route.params[RouteParams.NEXT_STATES].input.applicableReasons.success;
|
|
293
|
+
const successEventCodes = await eventsContainer.getEventCodes(_successApplicable);
|
|
265
294
|
let rParams;
|
|
266
|
-
rParams = {
|
|
295
|
+
rParams = {
|
|
296
|
+
...route.params
|
|
267
297
|
};
|
|
268
298
|
rParams[RouteParams.ET_SUCCESS] = true;
|
|
269
299
|
rParams[RouteParams.ET_SUCCESS_RESPONSE] = etOutput;
|
|
270
300
|
rParams[RouteParams.CURRENT_ET_NAME] = eTaskID;
|
|
271
|
-
rParams[RouteParams.REASONS] = successCodes;
|
|
272
301
|
rParams[RouteParams.IS_LAST_ET] = isLastTask;
|
|
302
|
+
rParams[RouteParams.EVENT_CODES] = successEventCodes;
|
|
303
|
+
rParams[RouteParams.APPLICABLE_CODES] = _successApplicable;
|
|
304
|
+
rParams[RouteParams.IS_MERGED_OBJ_BASED_OUTPUT] = isMergeObjectiveBasedOutput;
|
|
305
|
+
rParams[RouteParams.ROOT_META_DATA] = route.params[RouteParams.ROOT_META_DATA];
|
|
306
|
+
rParams[RouteParams.CANCEL_EVENT] = '';
|
|
273
307
|
navigation.replace(CustomScreens.REMARK_SCREEN, rParams);
|
|
308
|
+
} else {
|
|
309
|
+
const successCodes = await reasonsContainer.getReasonCodes(route.params[RouteParams.NEXT_STATES].input.applicableReasons.success ? route.params[RouteParams.NEXT_STATES].input.applicableReasons.success : route.params[RouteParams.NEXT_STATES].input.applicableReasons, _eventCode);
|
|
310
|
+
if (successCodes && successCodes.length > 0) {
|
|
311
|
+
if (successCodes.length === 1) {
|
|
312
|
+
if (isMergeObjectiveBasedOutput) etOutput.baseResponse.reasonCode = successCodes[0].reasonCode;else etOutput.reasonCode = successCodes[0].reasonCode;
|
|
313
|
+
await this.saveAndProceed(baseETProps, etOutput, route.params, navigation, isLastTask, isMergeObjectiveBasedOutput);
|
|
314
|
+
} else {
|
|
315
|
+
let rParams;
|
|
316
|
+
rParams = {
|
|
317
|
+
...route.params
|
|
318
|
+
};
|
|
319
|
+
rParams[RouteParams.ET_SUCCESS] = true;
|
|
320
|
+
rParams[RouteParams.ET_SUCCESS_RESPONSE] = etOutput;
|
|
321
|
+
rParams[RouteParams.CURRENT_ET_NAME] = eTaskID;
|
|
322
|
+
rParams[RouteParams.REASONS] = successCodes;
|
|
323
|
+
rParams[RouteParams.IS_LAST_ET] = isLastTask;
|
|
324
|
+
rParams[RouteParams.ROOT_META_DATA] = route.params[RouteParams.ROOT_META_DATA];
|
|
325
|
+
rParams[RouteParams.CANCEL_EVENT] = _eventCode;
|
|
326
|
+
navigation.replace(CustomScreens.REMARK_SCREEN, rParams);
|
|
327
|
+
}
|
|
328
|
+
} else {
|
|
329
|
+
await this.saveAndProceed(baseETProps, etOutput, route.params, navigation, isLastTask, isMergeObjectiveBasedOutput);
|
|
330
|
+
}
|
|
274
331
|
}
|
|
275
332
|
} else {
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
if (failureCodes && failureCodes.length > 0) {
|
|
282
|
-
if (failureCodes.length === 1) {
|
|
283
|
-
await this.saveAndProceed(baseETProps, await getBaseETResponse(entityCode, false, BaseEventCodes.ENTITY_FAILURE, failureCodes[0].reasonCode), route.params[RouteParams.NEXT_STATES], navigation, isLastTask);
|
|
284
|
-
} else {
|
|
333
|
+
let failureCodes = [];
|
|
334
|
+
if (!_eventCode) {
|
|
335
|
+
const _failureApplicable = route.params[RouteParams.NEXT_STATES].input.applicableReasons.failure;
|
|
336
|
+
const failureEventCodes = await eventsContainer.getEventCodes(_failureApplicable);
|
|
285
337
|
let rParams;
|
|
286
|
-
rParams = {
|
|
338
|
+
rParams = {
|
|
339
|
+
...route.params
|
|
287
340
|
};
|
|
288
341
|
rParams[RouteParams.ET_SUCCESS] = false;
|
|
342
|
+
// rParams[RouteParams.ET_SUCCESS_RESPONSE] = etOutput;
|
|
289
343
|
rParams[RouteParams.CURRENT_ET_NAME] = eTaskID;
|
|
290
|
-
rParams[RouteParams.REASONS] = failureCodes;
|
|
291
344
|
rParams[RouteParams.IS_LAST_ET] = isLastTask;
|
|
345
|
+
rParams[RouteParams.EVENT_CODES] = failureEventCodes;
|
|
346
|
+
rParams[RouteParams.APPLICABLE_CODES] = _failureApplicable;
|
|
347
|
+
rParams[RouteParams.ROOT_META_DATA] = route.params[RouteParams.ROOT_META_DATA];
|
|
348
|
+
rParams[RouteParams.CANCEL_EVENT] = '';
|
|
292
349
|
navigation.replace(CustomScreens.REMARK_SCREEN, rParams);
|
|
350
|
+
} else {
|
|
351
|
+
if (_eventCode === GO_BACK_EVENT_CODE) failureCodes = [];else failureCodes = await reasonsContainer.getReasonCodes(route.params[RouteParams.NEXT_STATES].input.applicableReasons.failure ? route.params[RouteParams.NEXT_STATES].input.applicableReasons.failure : route.params[RouteParams.NEXT_STATES].input.applicableReasons, _eventCode);
|
|
352
|
+
if (failureCodes && failureCodes.length > 0) {
|
|
353
|
+
if (isMergeObjectiveBasedOutput) etOutput.baseResponse.reasonCode = failureCodes[0].reasonCode;
|
|
354
|
+
if (failureCodes.length === 1) {
|
|
355
|
+
await this.saveAndProceed(baseETProps, isMergeObjectiveBasedOutput ? etOutput : await getBaseETResponse(entityCode, false, _eventCode, failureCodes[0].reasonCode, mergedObjectiveIds, eTaskID), route.params, navigation, isLastTask, isMergeObjectiveBasedOutput);
|
|
356
|
+
} else {
|
|
357
|
+
let rParams;
|
|
358
|
+
rParams = {
|
|
359
|
+
...route.params
|
|
360
|
+
};
|
|
361
|
+
rParams[RouteParams.ET_SUCCESS] = false;
|
|
362
|
+
rParams[RouteParams.CURRENT_ET_NAME] = eTaskID;
|
|
363
|
+
rParams[RouteParams.REASONS] = failureCodes;
|
|
364
|
+
rParams[RouteParams.IS_LAST_ET] = isLastTask;
|
|
365
|
+
rParams[RouteParams.ROOT_META_DATA] = route.params[RouteParams.ROOT_META_DATA];
|
|
366
|
+
rParams[RouteParams.CANCEL_EVENT] = _eventCode;
|
|
367
|
+
navigation.replace(CustomScreens.REMARK_SCREEN, rParams);
|
|
368
|
+
}
|
|
369
|
+
} else {
|
|
370
|
+
await this.saveAndProceed(baseETProps, isMergeObjectiveBasedOutput ? etOutput : await getBaseETResponse(entityCode, false, _eventCode, '', mergedObjectiveIds, eTaskID), route.params, navigation, isLastTask, isMergeObjectiveBasedOutput);
|
|
371
|
+
}
|
|
293
372
|
}
|
|
294
|
-
} else {
|
|
295
|
-
await this.saveAndProceed(baseETProps, await getBaseETResponse(entityCode, false, BaseEventCodes.ENTITY_FAILURE, ''), route.params[RouteParams.NEXT_STATES], navigation, isLastTask);
|
|
296
373
|
}
|
|
297
374
|
}
|
|
298
375
|
} catch (error) {
|
|
@@ -300,106 +377,116 @@ export default class DispatchStateContainer {
|
|
|
300
377
|
Logger.getInstance().logEvent('navigateToNextTask', error.message, LOG_TYPE.SDK_ERROR);
|
|
301
378
|
}
|
|
302
379
|
}
|
|
303
|
-
|
|
304
|
-
getJobObjectiveList(nextStates) {
|
|
305
|
-
const result = [];
|
|
306
|
-
nextStates.forEach(s => {
|
|
307
|
-
result.push({
|
|
308
|
-
jobId: s.jobId,
|
|
309
|
-
objectiveId: s.objRef
|
|
310
|
-
});
|
|
311
|
-
});
|
|
312
|
-
return result;
|
|
313
|
-
}
|
|
314
|
-
|
|
315
|
-
async moveToNextET(baseETProps, etStates, navigation, isLastTask) {
|
|
380
|
+
async moveToNextET(etOutput, baseETProps, states, navigation, isLastTask) {
|
|
316
381
|
try {
|
|
382
|
+
let etStates = states.next_states;
|
|
317
383
|
baseETProps.showProgress(true);
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
if (this._stateKeys.length !== 0) {
|
|
384
|
+
if (isLastTask && etStates && Object.keys(etStates).length > 0) {
|
|
385
|
+
if (this._mappedStates.size && this._stateKeys.length) {
|
|
321
386
|
const st = this._stateKeys.pop();
|
|
322
|
-
|
|
323
387
|
if (st) {
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
let nextStateList = this._mappedStates.get(st);
|
|
327
|
-
|
|
388
|
+
let rParams = {};
|
|
389
|
+
const _stData = this._mappedStates.get(st);
|
|
328
390
|
this._mappedStates.delete(st);
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
navigation.replace(nextStateList[0].nextState.taskId, rParams);
|
|
391
|
+
if (_stData) {
|
|
392
|
+
rParams[RouteParams.NEXT_STATES] = _stData;
|
|
393
|
+
rParams[RouteParams.ROOT_META_DATA] = states.rootMetaData;
|
|
394
|
+
navigation.replace(_stData.taskId, rParams);
|
|
334
395
|
}
|
|
335
|
-
|
|
336
|
-
return;
|
|
337
396
|
}
|
|
338
|
-
}
|
|
339
|
-
|
|
340
|
-
let nextState = etStates[0];
|
|
341
|
-
let completeJobsSummary = [];
|
|
342
|
-
let objSummary = await this.getObjectiveSummary({
|
|
343
|
-
jobId: etStates[0].jobId,
|
|
344
|
-
objectiveId: etStates[0].objRef
|
|
345
|
-
});
|
|
346
|
-
completeJobsSummary.push({
|
|
347
|
-
jobId: etStates[0].jobId,
|
|
348
|
-
objectiveRef: etStates[0].objRef,
|
|
349
|
-
jobObjectiveSummary: objSummary
|
|
350
|
-
});
|
|
351
|
-
|
|
352
|
-
for (let i = 1; i < etStates.length; i++) {
|
|
353
|
-
let obs = await this.getObjectiveSummary({
|
|
354
|
-
jobId: etStates[i].jobId,
|
|
355
|
-
objectiveId: etStates[i].objRef
|
|
356
|
-
});
|
|
357
|
-
completeJobsSummary.push({
|
|
358
|
-
jobId: etStates[i].jobId,
|
|
359
|
-
objectiveRef: etStates[i].objRef,
|
|
360
|
-
jobObjectiveSummary: obs
|
|
361
|
-
});
|
|
362
|
-
}
|
|
363
|
-
|
|
364
|
-
baseETProps.showProgress(false);
|
|
365
|
-
|
|
366
|
-
if (nextState.nextState.taskId === ExecutionTaskID.COMPLETED_SUCCESS) {
|
|
367
|
-
navigation.replace(this.getSuccessRoute(), {
|
|
368
|
-
summary: objSummary,
|
|
369
|
-
completeSummary: completeJobsSummary,
|
|
370
|
-
objList: this.getJobObjectiveList(etStates),
|
|
371
|
-
objSuccess: true
|
|
372
|
-
});
|
|
373
397
|
} else {
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
398
|
+
baseETProps.showProgress(false);
|
|
399
|
+
// TODO: Remove this later
|
|
400
|
+
this.cache.clearKeys([this.cacheKeys.CURRENT_WORKING_TASK_ID]);
|
|
401
|
+
AppSyncManager.getInstance().isForceStartEnabled = true;
|
|
402
|
+
AppSyncManager.getInstance().isSyncActive = false;
|
|
403
|
+
AppSyncManager.getInstance().startSDKSyncManager();
|
|
404
|
+
let objSummary = {
|
|
405
|
+
success: [],
|
|
406
|
+
failure: []
|
|
407
|
+
};
|
|
408
|
+
for (let [_key, _value] of this._mappedStatesData) {
|
|
409
|
+
const _objKey = _key === ExecutionTaskID.COMPLETED_SUCCESS ? 'success' : 'failure';
|
|
410
|
+
const lastERCData = await DispatchExecutor.getlastERC(_value.mergedObjectiveIds);
|
|
411
|
+
for (const _lastER of lastERCData) {
|
|
412
|
+
var _objSummary$_objKey;
|
|
413
|
+
const reason = await ReasonCodeContainer.getInstance().getReasonByCode(_lastER.lastReasonCode);
|
|
414
|
+
(_objSummary$_objKey = objSummary[_objKey]) === null || _objSummary$_objKey === void 0 ? void 0 : _objSummary$_objKey.push({
|
|
415
|
+
entityCode: _lastER.lastEntityCode,
|
|
416
|
+
eventCode: _lastER.lastEventCode,
|
|
417
|
+
reasonCode: _lastER.lastReasonCode,
|
|
418
|
+
reasonCodeDesc: reason === null || reason === void 0 ? void 0 : reason.description
|
|
419
|
+
});
|
|
420
|
+
}
|
|
421
|
+
}
|
|
422
|
+
if (this._mappedStatesData.get(ExecutionTaskID.COMPLETED_SUCCESS)) {
|
|
423
|
+
this._mappedStatesData.clear();
|
|
424
|
+
this._mappedStates.clear();
|
|
425
|
+
this._stateKeys = [];
|
|
426
|
+
clearScanOutput(states.rootMetaData.prefixedMergedObjectiveId);
|
|
427
|
+
navigation.replace(this.getSuccessRoute(), {
|
|
428
|
+
summary: objSummary,
|
|
429
|
+
objSuccess: true
|
|
430
|
+
});
|
|
431
|
+
} else {
|
|
432
|
+
this._mappedStatesData.clear();
|
|
433
|
+
this._mappedStates.clear();
|
|
434
|
+
this._stateKeys = [];
|
|
435
|
+
clearScanOutput(states.rootMetaData.prefixedMergedObjectiveId);
|
|
436
|
+
navigation.replace(this.getFailureRoute(), {
|
|
437
|
+
summary: objSummary,
|
|
438
|
+
objSuccess: false
|
|
439
|
+
});
|
|
440
|
+
}
|
|
380
441
|
}
|
|
381
442
|
} else {
|
|
382
|
-
let
|
|
443
|
+
let rParams = {};
|
|
444
|
+
let nextStateDataArray = await this.queryNextET(states.next_states.mergedObjectiveIds, states.rootMetaData.statusFilter);
|
|
445
|
+
const storeTerminalData = nextStateDataArray.every(_state => _state.taskId === ExecutionTaskID.COMPLETED_SUCCESS || _state.taskId === ExecutionTaskID.COMPLETED_FAILURE);
|
|
446
|
+
if (storeTerminalData) {
|
|
447
|
+
if (nextStateDataArray.length === 2) {
|
|
448
|
+
// Array in case of last states containing c-s and c-f
|
|
449
|
+
this._mappedStates.set(nextStateDataArray[1].taskId, nextStateDataArray[1]);
|
|
450
|
+
this._stateKeys.push(nextStateDataArray[1].taskId);
|
|
451
|
+
}
|
|
452
|
+
nextStateDataArray.forEach(data => {
|
|
453
|
+
if (data.taskId === ExecutionTaskID.COMPLETED_SUCCESS || data.taskId === ExecutionTaskID.COMPLETED_FAILURE) this._mappedStatesData.set(data.taskId, data);
|
|
454
|
+
});
|
|
455
|
+
}
|
|
456
|
+
const nextStateData = nextStateDataArray[0];
|
|
383
457
|
baseETProps.showProgress(false);
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
458
|
+
if (nextStateData != null && Object.keys(nextStateData).length > 0) {
|
|
459
|
+
rParams[RouteParams.NEXT_STATES] = nextStateData;
|
|
460
|
+
rParams[RouteParams.ROOT_META_DATA] = states.rootMetaData;
|
|
461
|
+
|
|
462
|
+
/**
|
|
463
|
+
* Send END/BACK custom event
|
|
464
|
+
*/
|
|
465
|
+
if (!isLastTask) {
|
|
466
|
+
var _etOutput$baseRespons;
|
|
467
|
+
const eventOutputData = {
|
|
468
|
+
meta: (etOutput === null || etOutput === 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) || {},
|
|
469
|
+
etData: etOutput,
|
|
470
|
+
taskId: etStates.taskId,
|
|
471
|
+
nextTaskId: '',
|
|
472
|
+
timestamp: Date.now(),
|
|
473
|
+
customData: rParams[RouteParams.ROOT_META_DATA].customEventsData
|
|
474
|
+
};
|
|
475
|
+
eventOutputData.nextTaskId = nextStateData.taskId;
|
|
476
|
+
eventOutputData.etData.eventCode !== GO_BACK_EVENT_CODE ? dispatchEvent('END', etStates.taskName, eventOutputData) : dispatchEvent('BACK', etStates.taskName, eventOutputData);
|
|
477
|
+
}
|
|
389
478
|
}
|
|
479
|
+
navigation.replace(nextStateData.taskId, rParams);
|
|
390
480
|
}
|
|
391
481
|
} catch (error) {
|
|
392
482
|
baseETProps.showProgress(false);
|
|
393
483
|
Logger.getInstance().logEvent('moveToNextET', error.message, LOG_TYPE.SDK_ERROR);
|
|
394
484
|
}
|
|
395
485
|
}
|
|
396
|
-
|
|
397
|
-
async saveAndProceed(baseETProps, etOutput, etStates, navigation, isLastTask) {
|
|
486
|
+
async saveAndProceed(baseETProps, etOutput, states, navigation, isLastTask, isMergedObjectiveBasedOutput) {
|
|
398
487
|
baseETProps.showProgress(true);
|
|
399
|
-
await this.saveAndProceedToNextET(baseETProps, etOutput,
|
|
488
|
+
await this.saveAndProceedToNextET(baseETProps, etOutput, states, navigation, isLastTask, isMergedObjectiveBasedOutput);
|
|
400
489
|
}
|
|
401
|
-
|
|
402
490
|
}
|
|
403
|
-
|
|
404
491
|
_defineProperty(DispatchStateContainer, "instance", void 0);
|
|
405
492
|
//# sourceMappingURL=DispatchStateContainer.js.map
|