@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
|
@@ -0,0 +1,762 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.addScans = addScans;
|
|
7
|
+
exports.checkForValidation = checkForValidation;
|
|
8
|
+
exports.clearScanOutput = void 0;
|
|
9
|
+
exports.filterERCItems = filterERCItems;
|
|
10
|
+
exports.getBarCodeTypes = getBarCodeTypes;
|
|
11
|
+
exports.getErrorMessage = void 0;
|
|
12
|
+
exports.getEventType = getEventType;
|
|
13
|
+
exports.getMappingCount = getMappingCount;
|
|
14
|
+
exports.getScanData = getScanData;
|
|
15
|
+
exports.getScanETOutput = getScanETOutput;
|
|
16
|
+
exports.getScanMappedOutput = getScanMappedOutput;
|
|
17
|
+
exports.getScanMergedObjectID = getScanMergedObjectID;
|
|
18
|
+
exports.getScanMergedOutput = getScanMergedOutput;
|
|
19
|
+
exports.getScannedItemCount = getScannedItemCount;
|
|
20
|
+
exports.getScannedItems = getScannedItems;
|
|
21
|
+
exports.getShipmentData = getShipmentData;
|
|
22
|
+
exports.getTabCount = exports.getSplitIds = void 0;
|
|
23
|
+
exports.getUpdatedScanETOutput = getUpdatedScanETOutput;
|
|
24
|
+
exports.isETCompleted = isETCompleted;
|
|
25
|
+
exports.isReplacement = isReplacement;
|
|
26
|
+
exports.removeScan = removeScan;
|
|
27
|
+
exports.triggerScanEvent = triggerScanEvent;
|
|
28
|
+
exports.updatePendingSharedPreference = updatePendingSharedPreference;
|
|
29
|
+
exports.updateSharedPreference = updateSharedPreference;
|
|
30
|
+
var _expoBarcodeScanner = require("expo-barcode-scanner");
|
|
31
|
+
var _interfaces = require("./interfaces");
|
|
32
|
+
var _ScanSchema = require("./ScanSchema");
|
|
33
|
+
var jsonLogic = _interopRequireWildcard(require("json-logic-js"));
|
|
34
|
+
var _ExecTaskUtils = require("../../../utils/ExecTaskUtils");
|
|
35
|
+
var _ETConfig = require("../../../models/execTasks/ETConfig");
|
|
36
|
+
var _ApiUtils = require("../../../utils/ApiUtils");
|
|
37
|
+
var _Logger = _interopRequireWildcard(require("../../../utils/Logger"));
|
|
38
|
+
var _constants = require("../../../constants/constants");
|
|
39
|
+
var _storage = _interopRequireDefault(require("../../../utils/storage"));
|
|
40
|
+
var _constants2 = require("../../../manager/syncmanager/constants");
|
|
41
|
+
var _RouteParams = require("../../../ui/uiConfig/RouteParams");
|
|
42
|
+
var _EventDispatcher = _interopRequireDefault(require("../../../events/EventDispatcher"));
|
|
43
|
+
var _platformCoreosExecutionEngineSdk = require("@os1-platform/platform-coreos-execution-engine-sdk");
|
|
44
|
+
var _utils = require("../../../utils/utils");
|
|
45
|
+
var _constants3 = require("./constants");
|
|
46
|
+
var _DropDownUtils = require("./sub_components/DropDownUtils");
|
|
47
|
+
var _SnackBarCustom = require("../../../components/widgets/SnackBarCustom");
|
|
48
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
49
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
50
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
51
|
+
function getBarCodeTypes(input) {
|
|
52
|
+
const barCodeType = [];
|
|
53
|
+
const {
|
|
54
|
+
scannedInput: {
|
|
55
|
+
scanType
|
|
56
|
+
}
|
|
57
|
+
} = input;
|
|
58
|
+
scanType.forEach(type => {
|
|
59
|
+
switch (type) {
|
|
60
|
+
case _interfaces.ExpoBarcodeTypes.QRCODE:
|
|
61
|
+
barCodeType.push(_expoBarcodeScanner.BarCodeScanner.Constants.BarCodeType.qr);
|
|
62
|
+
break;
|
|
63
|
+
case _interfaces.ExpoBarcodeTypes.aztec:
|
|
64
|
+
barCodeType.push(_expoBarcodeScanner.BarCodeScanner.Constants.BarCodeType.aztec);
|
|
65
|
+
break;
|
|
66
|
+
case _interfaces.ExpoBarcodeTypes.codabar:
|
|
67
|
+
barCodeType.push(_expoBarcodeScanner.BarCodeScanner.Constants.BarCodeType.codabar);
|
|
68
|
+
break;
|
|
69
|
+
case _interfaces.ExpoBarcodeTypes.code128:
|
|
70
|
+
barCodeType.push(_expoBarcodeScanner.BarCodeScanner.Constants.BarCodeType.code128);
|
|
71
|
+
break;
|
|
72
|
+
case _interfaces.ExpoBarcodeTypes.code39:
|
|
73
|
+
barCodeType.push(_expoBarcodeScanner.BarCodeScanner.Constants.BarCodeType.code39);
|
|
74
|
+
break;
|
|
75
|
+
case _interfaces.ExpoBarcodeTypes.code93:
|
|
76
|
+
barCodeType.push(_expoBarcodeScanner.BarCodeScanner.Constants.BarCodeType.code93);
|
|
77
|
+
break;
|
|
78
|
+
case _interfaces.ExpoBarcodeTypes.datamatrix:
|
|
79
|
+
barCodeType.push(_expoBarcodeScanner.BarCodeScanner.Constants.BarCodeType.datamatrix);
|
|
80
|
+
break;
|
|
81
|
+
case _interfaces.ExpoBarcodeTypes.ean13:
|
|
82
|
+
barCodeType.push(_expoBarcodeScanner.BarCodeScanner.Constants.BarCodeType.ean13);
|
|
83
|
+
break;
|
|
84
|
+
case _interfaces.ExpoBarcodeTypes.ean8:
|
|
85
|
+
barCodeType.push(_expoBarcodeScanner.BarCodeScanner.Constants.BarCodeType.ean8);
|
|
86
|
+
break;
|
|
87
|
+
case _interfaces.ExpoBarcodeTypes.itf14:
|
|
88
|
+
barCodeType.push(_expoBarcodeScanner.BarCodeScanner.Constants.BarCodeType.itf14);
|
|
89
|
+
break;
|
|
90
|
+
case _interfaces.ExpoBarcodeTypes.pdf417:
|
|
91
|
+
barCodeType.push(_expoBarcodeScanner.BarCodeScanner.Constants.BarCodeType.pdf417);
|
|
92
|
+
break;
|
|
93
|
+
case _interfaces.ExpoBarcodeTypes.upc_e:
|
|
94
|
+
barCodeType.push(_expoBarcodeScanner.BarCodeScanner.Constants.BarCodeType.upc_e);
|
|
95
|
+
break;
|
|
96
|
+
default:
|
|
97
|
+
break;
|
|
98
|
+
}
|
|
99
|
+
});
|
|
100
|
+
return barCodeType;
|
|
101
|
+
}
|
|
102
|
+
async function checkForValidation(scannedInput, validation) {
|
|
103
|
+
// Scans Array
|
|
104
|
+
if (validation.selectedIndex === 0) {
|
|
105
|
+
return true;
|
|
106
|
+
}
|
|
107
|
+
// Validation Regex
|
|
108
|
+
else if (validation.selectedIndex === 1 && typeof validation.logic === 'string') {
|
|
109
|
+
const regex = new RegExp(validation.logic);
|
|
110
|
+
return regex.test(scannedInput);
|
|
111
|
+
}
|
|
112
|
+
// API
|
|
113
|
+
else if (validation.selectedIndex === 2 && typeof validation.logic === 'object') {
|
|
114
|
+
try {
|
|
115
|
+
//@ts-ignore
|
|
116
|
+
const api = validation.logic;
|
|
117
|
+
const apiData = {
|
|
118
|
+
errorJsonPath: '',
|
|
119
|
+
responseJsonPath: '',
|
|
120
|
+
uri: api.uri,
|
|
121
|
+
httpMethod: api.httpMethod,
|
|
122
|
+
timeout: api.timeout,
|
|
123
|
+
headers: api.headers
|
|
124
|
+
};
|
|
125
|
+
if (api.requestBody) {
|
|
126
|
+
const parsedRequestBody = (0, _ApiUtils.parseBody)(api.requestBody, scannedInput);
|
|
127
|
+
apiData.requestBody = parsedRequestBody;
|
|
128
|
+
}
|
|
129
|
+
if (api.pathParams) {
|
|
130
|
+
(0, _ApiUtils.parseKeyValue)(api.pathParams, scannedInput);
|
|
131
|
+
apiData.pathParams = api.pathParams;
|
|
132
|
+
}
|
|
133
|
+
if (api.queryParams) {
|
|
134
|
+
(0, _ApiUtils.parseKeyValue)(api.queryParams, scannedInput);
|
|
135
|
+
apiData.queryParams = api.queryParams;
|
|
136
|
+
}
|
|
137
|
+
const apiResponse = await (0, _ApiUtils.getApiResponse)(apiData);
|
|
138
|
+
return jsonLogic.apply(api.responseJsonLogic, apiResponse.data);
|
|
139
|
+
} catch (error) {
|
|
140
|
+
_Logger.default.getInstance().logEvent('~ checkForValidation', error.message, _Logger.LOG_TYPE.SDK_ERROR);
|
|
141
|
+
return false;
|
|
142
|
+
}
|
|
143
|
+
} else {
|
|
144
|
+
return false;
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
function getShipmentData(selectedIndex, scansMap) {
|
|
148
|
+
const pendingShipments = [];
|
|
149
|
+
const scannedShipments = [];
|
|
150
|
+
//@ts-ignore
|
|
151
|
+
for (let [key, value] of scansMap.entries()) {
|
|
152
|
+
/**
|
|
153
|
+
* If scanStatus is undefined then push the shipment to pending.
|
|
154
|
+
* If scanStatus is not undefined:
|
|
155
|
+
* Then if successfully scanned, move to scannedShipments array.
|
|
156
|
+
* Else do nothing.
|
|
157
|
+
*/
|
|
158
|
+
if ((value === null || value === void 0 ? void 0 : value.scanStatus) != undefined) {
|
|
159
|
+
if ((value === null || value === void 0 ? void 0 : value.scanStatus) === _interfaces.SCAN_STATUS.SCANNED) {
|
|
160
|
+
scannedShipments.push(key);
|
|
161
|
+
} else if ((value === null || value === void 0 ? void 0 : value.scanStatus) === _interfaces.SCAN_STATUS.FAILED) {
|
|
162
|
+
pendingShipments.push(key);
|
|
163
|
+
}
|
|
164
|
+
} else if (selectedIndex === 0) {
|
|
165
|
+
pendingShipments.push(key);
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
return [pendingShipments, scannedShipments];
|
|
169
|
+
}
|
|
170
|
+
function getScannedItemCount(scansMap) {
|
|
171
|
+
let scannedShipments = 0;
|
|
172
|
+
if (scansMap) {
|
|
173
|
+
for (let [, value] of scansMap.entries()) {
|
|
174
|
+
if (value.scanStatus === _interfaces.SCAN_STATUS.SCANNED) {
|
|
175
|
+
scannedShipments++;
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
return scannedShipments;
|
|
179
|
+
}
|
|
180
|
+
return scannedShipments;
|
|
181
|
+
}
|
|
182
|
+
function getMappingCount(scanOutput, wiMappingUpdate) {
|
|
183
|
+
const {
|
|
184
|
+
mwId: mergedObjectiveId
|
|
185
|
+
} = wiMappingUpdate.data;
|
|
186
|
+
if (scanOutput[mergedObjectiveId]) {
|
|
187
|
+
return scanOutput[mergedObjectiveId].count + 1;
|
|
188
|
+
} else {
|
|
189
|
+
return 1;
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
async function getUpdatedScanETOutput(scanOutput, wiMappingUpdate, success, eventCode, reasonCode, route, scannedData) {
|
|
193
|
+
const prefixedMergedObjectiveId = route.params[_RouteParams.RouteParams.ROOT_META_DATA].prefixedMergedObjectiveId;
|
|
194
|
+
const {
|
|
195
|
+
mwId: mergedObjectiveId,
|
|
196
|
+
previousMWID: previousMergedObjectiveId
|
|
197
|
+
} = wiMappingUpdate.data;
|
|
198
|
+
const output = await (0, _ExecTaskUtils.getBaseETResponse)(_ETConfig.EntityCode.SCAN, success, eventCode, reasonCode, [mergedObjectiveId], _ETConfig.ExecutionTaskID.SCAN);
|
|
199
|
+
const _scannedData = [{
|
|
200
|
+
groupId: scannedData.displayInfo.groupId,
|
|
201
|
+
jobId: scannedData.jobId,
|
|
202
|
+
shipmentFlow: scannedData.displayInfo.shipmentFlow,
|
|
203
|
+
scanValue: scannedData.scanId
|
|
204
|
+
}];
|
|
205
|
+
scannedData !== null && scannedData !== void 0 && scannedData.isScan ? triggerScanEvent('ON_SCAN', route, _scannedData, output) : null;
|
|
206
|
+
if (scanOutput[previousMergedObjectiveId]) {
|
|
207
|
+
scanOutput[previousMergedObjectiveId].count -= 1;
|
|
208
|
+
if (scanOutput[previousMergedObjectiveId].count === 0) {
|
|
209
|
+
delete scanOutput[previousMergedObjectiveId];
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
const count = getMappingCount(scanOutput, wiMappingUpdate);
|
|
213
|
+
if (!scanOutput[mergedObjectiveId]) {
|
|
214
|
+
scanOutput[mergedObjectiveId] = {
|
|
215
|
+
output,
|
|
216
|
+
count
|
|
217
|
+
};
|
|
218
|
+
} else {
|
|
219
|
+
scanOutput[mergedObjectiveId].count = count;
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
// SAVE IN SHARED PREFERENCE
|
|
223
|
+
let allScansOutput = (await getScanMappedOutput()) || {};
|
|
224
|
+
let storage = _storage.default.getInstance();
|
|
225
|
+
await storage.setSharedItem(_constants2.SHARED_PREFERENCE_SCAN_OUTPUT, JSON.stringify({
|
|
226
|
+
...allScansOutput,
|
|
227
|
+
[prefixedMergedObjectiveId]: scanOutput
|
|
228
|
+
}));
|
|
229
|
+
return scanOutput;
|
|
230
|
+
}
|
|
231
|
+
async function getScanETOutput(mergeScannedOutput, mergedObjectiveId, ercItems, defaultERC, deliverState, isPartial, count) {
|
|
232
|
+
switch (deliverState) {
|
|
233
|
+
case _ScanSchema.DeliverState.CANCELLED:
|
|
234
|
+
{
|
|
235
|
+
const output = await (0, _ExecTaskUtils.getBaseETResponse)(_ETConfig.EntityCode.SCAN, false, defaultERC.eventCode, defaultERC.reasonCode || '', mergedObjectiveId, _ETConfig.ExecutionTaskID.SCAN);
|
|
236
|
+
return {
|
|
237
|
+
[mergedObjectiveId[0]]: {
|
|
238
|
+
output,
|
|
239
|
+
count
|
|
240
|
+
}
|
|
241
|
+
};
|
|
242
|
+
}
|
|
243
|
+
case _ScanSchema.DeliverState.DELIVERE_LATER:
|
|
244
|
+
{
|
|
245
|
+
const output = await (0, _ExecTaskUtils.getBaseETResponse)(_ETConfig.EntityCode.SCAN, false, _constants.REASON_NOT_USED, '', mergedObjectiveId, _ETConfig.ExecutionTaskID.SCAN);
|
|
246
|
+
mergeScannedOutput['default'] = {
|
|
247
|
+
output,
|
|
248
|
+
count
|
|
249
|
+
};
|
|
250
|
+
return mergeScannedOutput;
|
|
251
|
+
}
|
|
252
|
+
case _ScanSchema.DeliverState.DELIVER_NOW:
|
|
253
|
+
{
|
|
254
|
+
if (isPartial) {
|
|
255
|
+
const output = await (0, _ExecTaskUtils.getBaseETResponse)(_ETConfig.EntityCode.SCAN, getEventType(ercItems, defaultERC.eventCode), defaultERC.eventCode, defaultERC.reasonCode || '', mergedObjectiveId, _ETConfig.ExecutionTaskID.SCAN);
|
|
256
|
+
mergeScannedOutput['default'] = {
|
|
257
|
+
output,
|
|
258
|
+
count
|
|
259
|
+
};
|
|
260
|
+
return mergeScannedOutput;
|
|
261
|
+
} else {
|
|
262
|
+
return mergeScannedOutput;
|
|
263
|
+
}
|
|
264
|
+
}
|
|
265
|
+
default:
|
|
266
|
+
{
|
|
267
|
+
return mergeScannedOutput;
|
|
268
|
+
}
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
function getScannedItems(scanValue) {
|
|
272
|
+
const items = [];
|
|
273
|
+
if (scanValue.scanStatus === _interfaces.SCAN_STATUS.SCANNED) items.push({
|
|
274
|
+
value: scanValue.value,
|
|
275
|
+
validated: scanValue.validated || false,
|
|
276
|
+
timestamp: scanValue.timestamp || Date.now()
|
|
277
|
+
});
|
|
278
|
+
return items;
|
|
279
|
+
}
|
|
280
|
+
function isETCompleted(validation, scansMap, scanMode, isMultiObjectiveEnable, scannedShipmentCount, singleModeCount, allowMultiObjectivePartial) {
|
|
281
|
+
if (scanMode === 'SINGLE' || isMultiObjectiveEnable) {
|
|
282
|
+
let _scannedShipmentCount = scannedShipmentCount || 0;
|
|
283
|
+
if (!scannedShipmentCount) {
|
|
284
|
+
const [, scannedShipments] = getShipmentData(validation.selectedIndex, scansMap);
|
|
285
|
+
_scannedShipmentCount = scannedShipments.length;
|
|
286
|
+
}
|
|
287
|
+
if (allowMultiObjectivePartial) {
|
|
288
|
+
return _scannedShipmentCount >= 1;
|
|
289
|
+
}
|
|
290
|
+
return singleModeCount === _scannedShipmentCount;
|
|
291
|
+
} else {
|
|
292
|
+
// Scans Array
|
|
293
|
+
if (validation.selectedIndex === 0) {
|
|
294
|
+
//@ts-ignore
|
|
295
|
+
const scans = validation.logic;
|
|
296
|
+
if (!scannedShipmentCount) {
|
|
297
|
+
const [, scannedShipments] = getShipmentData(validation.selectedIndex, scansMap);
|
|
298
|
+
return scans.length === scannedShipments.length;
|
|
299
|
+
}
|
|
300
|
+
return scans.length === scannedShipmentCount;
|
|
301
|
+
}
|
|
302
|
+
// Validation Regex
|
|
303
|
+
else if (validation.selectedIndex === 1 && typeof validation.logic === 'string' || validation.selectedIndex === 2 && typeof validation.logic === 'object') {
|
|
304
|
+
return true;
|
|
305
|
+
} else {
|
|
306
|
+
return false;
|
|
307
|
+
}
|
|
308
|
+
}
|
|
309
|
+
}
|
|
310
|
+
function isReplacement(scan, scansMap, selectedEventCode, selectedReason) {
|
|
311
|
+
var _scansMap$get, _scansMap$get2;
|
|
312
|
+
if (
|
|
313
|
+
//(selectedEventCode || selectedReason) &&
|
|
314
|
+
//scansMap.get(scan)?.eventCode &&
|
|
315
|
+
((_scansMap$get = scansMap.get(scan)) === null || _scansMap$get === void 0 ? void 0 : _scansMap$get.eventCode) !== (selectedEventCode === null || selectedEventCode === void 0 ? void 0 : selectedEventCode.code) ||
|
|
316
|
+
//scansMap.get(scan)?.reasonCode !== undefined &&
|
|
317
|
+
((_scansMap$get2 = scansMap.get(scan)) === null || _scansMap$get2 === void 0 ? void 0 : _scansMap$get2.reasonCode) !== (selectedReason === null || selectedReason === void 0 ? void 0 : selectedReason.code)) {
|
|
318
|
+
return true;
|
|
319
|
+
}
|
|
320
|
+
return false;
|
|
321
|
+
}
|
|
322
|
+
function getEventType(eventList, eventCode) {
|
|
323
|
+
const result = eventList.find(code => code.code === eventCode);
|
|
324
|
+
if (result) {
|
|
325
|
+
return Boolean(result.success);
|
|
326
|
+
} else {
|
|
327
|
+
return false;
|
|
328
|
+
}
|
|
329
|
+
}
|
|
330
|
+
async function getScanMappedOutput() {
|
|
331
|
+
let storage = _storage.default.getInstance();
|
|
332
|
+
const mergedScanOutput = await storage.getSharedItem(_constants2.SHARED_PREFERENCE_SCAN_OUTPUT);
|
|
333
|
+
if (mergedScanOutput) {
|
|
334
|
+
return JSON.parse(mergedScanOutput);
|
|
335
|
+
} else {
|
|
336
|
+
return {};
|
|
337
|
+
}
|
|
338
|
+
}
|
|
339
|
+
function triggerScanEvent(type, route, scannedData, etOutput) {
|
|
340
|
+
switch (type) {
|
|
341
|
+
case 'ON_SCAN':
|
|
342
|
+
{
|
|
343
|
+
const nextStates = route.params[_RouteParams.RouteParams.NEXT_STATES];
|
|
344
|
+
const eventOutputData = {
|
|
345
|
+
meta: (etOutput === null || etOutput === void 0 ? void 0 : etOutput.meta) || {},
|
|
346
|
+
etData: {
|
|
347
|
+
eventCode: (etOutput === null || etOutput === void 0 ? void 0 : etOutput.eventCode) || '',
|
|
348
|
+
reasonCode: (etOutput === null || etOutput === void 0 ? void 0 : etOutput.reasonCode) || '',
|
|
349
|
+
success: (etOutput === null || etOutput === void 0 ? void 0 : etOutput.success) || false,
|
|
350
|
+
endTime: Date.now(),
|
|
351
|
+
scannedData
|
|
352
|
+
},
|
|
353
|
+
taskId: nextStates.taskId,
|
|
354
|
+
timestamp: Date.now(),
|
|
355
|
+
customData: route.params[_RouteParams.RouteParams.ROOT_META_DATA].customEventsData
|
|
356
|
+
};
|
|
357
|
+
(0, _EventDispatcher.default)('ON_SCAN', nextStates.taskName, eventOutputData);
|
|
358
|
+
break;
|
|
359
|
+
}
|
|
360
|
+
case 'ON_SCAN_REMOVE':
|
|
361
|
+
{
|
|
362
|
+
const nextStates = route.params[_RouteParams.RouteParams.NEXT_STATES];
|
|
363
|
+
const eventOutputData = {
|
|
364
|
+
etData: {
|
|
365
|
+
scannedData
|
|
366
|
+
},
|
|
367
|
+
taskId: nextStates.taskId,
|
|
368
|
+
timestamp: Date.now(),
|
|
369
|
+
customData: route.params[_RouteParams.RouteParams.ROOT_META_DATA].customEventsData
|
|
370
|
+
};
|
|
371
|
+
(0, _EventDispatcher.default)('ON_SCAN_REMOVE', nextStates.taskName, eventOutputData);
|
|
372
|
+
break;
|
|
373
|
+
}
|
|
374
|
+
default:
|
|
375
|
+
break;
|
|
376
|
+
}
|
|
377
|
+
}
|
|
378
|
+
const fetchMergedObjectiveIdBasedOnStatus = async (activeTab, scanProps) => {
|
|
379
|
+
let prefixedMergedObjectiveId = scanProps.route.params[_RouteParams.RouteParams.ROOT_META_DATA].prefixedMergedObjectiveId;
|
|
380
|
+
let mergedObjectiveIds;
|
|
381
|
+
let filterIds = await getScanMergedObjectID();
|
|
382
|
+
if (filterIds) {
|
|
383
|
+
mergedObjectiveIds = filterIds[prefixedMergedObjectiveId] || [];
|
|
384
|
+
} else {
|
|
385
|
+
return [];
|
|
386
|
+
}
|
|
387
|
+
switch (activeTab) {
|
|
388
|
+
case _interfaces.SummaryPageTabs.ALL:
|
|
389
|
+
return [...mergedObjectiveIds['pending'], ...mergedObjectiveIds['success'], ...mergedObjectiveIds['failure']];
|
|
390
|
+
case _interfaces.SummaryPageTabs.PENDING:
|
|
391
|
+
return mergedObjectiveIds['pending'];
|
|
392
|
+
case _interfaces.SummaryPageTabs.DELIVERED:
|
|
393
|
+
return mergedObjectiveIds['success'];
|
|
394
|
+
case _interfaces.SummaryPageTabs.UNDELIVERED:
|
|
395
|
+
return mergedObjectiveIds['failure'];
|
|
396
|
+
default:
|
|
397
|
+
return [];
|
|
398
|
+
}
|
|
399
|
+
};
|
|
400
|
+
const fetchLabel = async (eventCode, reasonCode) => {
|
|
401
|
+
return await (0, _DropDownUtils.getDefaultERCLabel)({
|
|
402
|
+
eventCode,
|
|
403
|
+
reasonCode
|
|
404
|
+
});
|
|
405
|
+
};
|
|
406
|
+
const modifyDisplayScanData = async response => {
|
|
407
|
+
const {
|
|
408
|
+
data: scans
|
|
409
|
+
} = response;
|
|
410
|
+
const updatedScanData = await Promise.all(scans.map(async scan => {
|
|
411
|
+
var _scan$displayInfo, _scan$displayInfo2;
|
|
412
|
+
const {
|
|
413
|
+
eventCode,
|
|
414
|
+
reasonCode
|
|
415
|
+
} = await fetchLabel(scan.eventCode, scan.reasonCode);
|
|
416
|
+
return {
|
|
417
|
+
scanId: scan.scannableId,
|
|
418
|
+
clientName: ((_scan$displayInfo = scan.displayInfo) === null || _scan$displayInfo === void 0 ? void 0 : _scan$displayInfo.clientName) || '--',
|
|
419
|
+
orderId: ((_scan$displayInfo2 = scan.displayInfo) === null || _scan$displayInfo2 === void 0 ? void 0 : _scan$displayInfo2.orderId) || '--',
|
|
420
|
+
eventCode: eventCode || '--',
|
|
421
|
+
reasonCode: reasonCode || '--',
|
|
422
|
+
prefixedMergedObjectiveId: scan.originalMergedObjId,
|
|
423
|
+
lastStatus: scan.lastStatus
|
|
424
|
+
};
|
|
425
|
+
}));
|
|
426
|
+
return {
|
|
427
|
+
data: updatedScanData,
|
|
428
|
+
totalCount: response.totalCount
|
|
429
|
+
};
|
|
430
|
+
};
|
|
431
|
+
async function getScanData(activeTab, scanProps, limit, offset, scan) {
|
|
432
|
+
const taskName = scanProps.taskName || '';
|
|
433
|
+
const mergedObjectiveId = scanProps.mergedObjectiveId;
|
|
434
|
+
const mergedObjectiveIds = await fetchMergedObjectiveIdBasedOnStatus(activeTab, scanProps);
|
|
435
|
+
if (!mergedObjectiveIds || mergedObjectiveIds.length === 0) {
|
|
436
|
+
return {
|
|
437
|
+
data: [],
|
|
438
|
+
totalCount: 0
|
|
439
|
+
};
|
|
440
|
+
}
|
|
441
|
+
if (scan) {
|
|
442
|
+
const scans = await _platformCoreosExecutionEngineSdk.DispatchExecutor.filterWFIData(taskName, mergedObjectiveIds, limit, offset, scan);
|
|
443
|
+
return await modifyDisplayScanData(scans);
|
|
444
|
+
} else {
|
|
445
|
+
const scans = await _platformCoreosExecutionEngineSdk.DispatchExecutor.filterWFIData(taskName, mergedObjectiveIds, limit, offset);
|
|
446
|
+
return await modifyDisplayScanData(scans);
|
|
447
|
+
}
|
|
448
|
+
}
|
|
449
|
+
async function addScans(scan, scanProps, scanOutput, ercItems, eventCode, reasonCode) {
|
|
450
|
+
const prefixedMergedObjectiveId = scanProps.route.params[_RouteParams.RouteParams.ROOT_META_DATA].prefixedMergedObjectiveId;
|
|
451
|
+
const isErcSelector = scanProps.ercSelector ? true : false;
|
|
452
|
+
if ((0, _utils.isEmptyOrBlank)(scan)) {
|
|
453
|
+
return {
|
|
454
|
+
status: false,
|
|
455
|
+
message: _constants3.EMPTY_AWB,
|
|
456
|
+
type: _SnackBarCustom.SnackBarType.FAILURE
|
|
457
|
+
};
|
|
458
|
+
}
|
|
459
|
+
if (isErcSelector && (!eventCode || !eventCode.code)) {
|
|
460
|
+
return {
|
|
461
|
+
status: false,
|
|
462
|
+
type: _SnackBarCustom.SnackBarType.FAILURE,
|
|
463
|
+
message: _constants3.ER_MISSING.replace('<shipment_id>', scan)
|
|
464
|
+
};
|
|
465
|
+
}
|
|
466
|
+
let isValidated = await checkForValidation(scan, scanProps.validation);
|
|
467
|
+
if (isValidated) {
|
|
468
|
+
// NEW CODE
|
|
469
|
+
try {
|
|
470
|
+
const eventType = getEventType(ercItems || [], (eventCode === null || eventCode === void 0 ? void 0 : eventCode.code) || '');
|
|
471
|
+
const result = await _platformCoreosExecutionEngineSdk.DispatchExecutor.updateWIMapping(prefixedMergedObjectiveId, scan, {
|
|
472
|
+
ec: (eventCode === null || eventCode === void 0 ? void 0 : eventCode.code) || '',
|
|
473
|
+
rc: (reasonCode === null || reasonCode === void 0 ? void 0 : reasonCode.code) || ''
|
|
474
|
+
}, scanProps.scanToMerge || false);
|
|
475
|
+
if ('data' in result) {
|
|
476
|
+
const data = result.data;
|
|
477
|
+
const {
|
|
478
|
+
message: {
|
|
479
|
+
title,
|
|
480
|
+
subTitle
|
|
481
|
+
}
|
|
482
|
+
} = data;
|
|
483
|
+
|
|
484
|
+
// UPDATE SHARED PREFERENCE
|
|
485
|
+
updateSharedPreference(eventType, data.mwId, prefixedMergedObjectiveId);
|
|
486
|
+
const _scanOutput = await getUpdatedScanETOutput(scanOutput, result, eventType, (eventCode === null || eventCode === void 0 ? void 0 : eventCode.code) || '', (reasonCode === null || reasonCode === void 0 ? void 0 : reasonCode.code) || '', scanProps.route, {
|
|
487
|
+
jobId: data.jobId,
|
|
488
|
+
displayInfo: data.displayInfo,
|
|
489
|
+
isScan: true,
|
|
490
|
+
scanId: scan
|
|
491
|
+
});
|
|
492
|
+
return {
|
|
493
|
+
status: true,
|
|
494
|
+
type: subTitle ? _SnackBarCustom.SnackBarType.WARNING : _SnackBarCustom.SnackBarType.SUCCESS,
|
|
495
|
+
message: subTitle ? `#${scan}\n${title}\n${subTitle}` : `#${scan}\nShipment updated successfully!`,
|
|
496
|
+
data: {
|
|
497
|
+
output: _scanOutput,
|
|
498
|
+
shipmentCount: {
|
|
499
|
+
scannedCount: data.scanned,
|
|
500
|
+
totalCount: data.total
|
|
501
|
+
}
|
|
502
|
+
}
|
|
503
|
+
};
|
|
504
|
+
} else {
|
|
505
|
+
return {
|
|
506
|
+
status: false,
|
|
507
|
+
type: _SnackBarCustom.SnackBarType.FAILURE,
|
|
508
|
+
message: 'Error occurred while scanning'
|
|
509
|
+
};
|
|
510
|
+
}
|
|
511
|
+
} catch (error) {
|
|
512
|
+
if (scanProps.exitOnError) {
|
|
513
|
+
return {
|
|
514
|
+
status: false,
|
|
515
|
+
type: _SnackBarCustom.SnackBarType.FAILURE,
|
|
516
|
+
exit: true,
|
|
517
|
+
message: 'Error occurred while scanning'
|
|
518
|
+
};
|
|
519
|
+
|
|
520
|
+
// props.onSubmitET({
|
|
521
|
+
// ...(await getScanETOutput(
|
|
522
|
+
// mergedScanETOutput,
|
|
523
|
+
// props.mergedObjectiveId,
|
|
524
|
+
// eventCodeItems || [],
|
|
525
|
+
// props.defaultERC,
|
|
526
|
+
// false,
|
|
527
|
+
// true
|
|
528
|
+
// )),
|
|
529
|
+
// });
|
|
530
|
+
} else {
|
|
531
|
+
return {
|
|
532
|
+
status: false,
|
|
533
|
+
...getErrorMessage(scan, error)
|
|
534
|
+
};
|
|
535
|
+
}
|
|
536
|
+
}
|
|
537
|
+
} else {
|
|
538
|
+
if (scanProps.exitOnError) {
|
|
539
|
+
return {
|
|
540
|
+
status: false,
|
|
541
|
+
type: _SnackBarCustom.SnackBarType.FAILURE,
|
|
542
|
+
exit: true,
|
|
543
|
+
message: 'Error occurred while scanning'
|
|
544
|
+
};
|
|
545
|
+
} else {
|
|
546
|
+
return {
|
|
547
|
+
status: false,
|
|
548
|
+
message: _constants3.INVALID_SHIPMENT,
|
|
549
|
+
type: _SnackBarCustom.SnackBarType.FAILURE
|
|
550
|
+
};
|
|
551
|
+
}
|
|
552
|
+
}
|
|
553
|
+
}
|
|
554
|
+
async function removeScan(taskName, scans, route, scanOutput) {
|
|
555
|
+
const prefixedMergedObjectiveId = route.params[_RouteParams.RouteParams.ROOT_META_DATA].prefixedMergedObjectiveId;
|
|
556
|
+
const result = await _platformCoreosExecutionEngineSdk.DispatchExecutor.removeShipment(prefixedMergedObjectiveId, scans);
|
|
557
|
+
|
|
558
|
+
// Decrease count on remove
|
|
559
|
+
Object.keys(result).forEach(mergedObjectiveId => {
|
|
560
|
+
scanOutput[mergedObjectiveId].count -= result[mergedObjectiveId];
|
|
561
|
+
if (scanOutput[mergedObjectiveId].count === 0) {
|
|
562
|
+
delete scanOutput[mergedObjectiveId];
|
|
563
|
+
}
|
|
564
|
+
});
|
|
565
|
+
const allScansOutput = (await getScanMergedOutput()) || {};
|
|
566
|
+
|
|
567
|
+
// SAVE IN SHARED PREFERENCE
|
|
568
|
+
let storage = _storage.default.getInstance();
|
|
569
|
+
const mergedIdOutput = await getScanMergedObjectID();
|
|
570
|
+
if (mergedIdOutput) {
|
|
571
|
+
const _mergedIds = mergedIdOutput[prefixedMergedObjectiveId];
|
|
572
|
+
_mergedIds.pending.push(prefixedMergedObjectiveId);
|
|
573
|
+
await storage.setSharedItem(_constants2.SCAN_MERGED_OBJ_ID_OUTPUT, JSON.stringify({
|
|
574
|
+
...mergedIdOutput,
|
|
575
|
+
[prefixedMergedObjectiveId]: _mergedIds
|
|
576
|
+
}));
|
|
577
|
+
}
|
|
578
|
+
let outputAtPrefixedId = allScansOutput[prefixedMergedObjectiveId] || {};
|
|
579
|
+
await storage.setSharedItem(_constants2.SHARED_PREFERENCE_SCAN_OUTPUT, JSON.stringify({
|
|
580
|
+
...allScansOutput,
|
|
581
|
+
[prefixedMergedObjectiveId]: {
|
|
582
|
+
...outputAtPrefixedId,
|
|
583
|
+
scanOutput
|
|
584
|
+
}
|
|
585
|
+
}));
|
|
586
|
+
|
|
587
|
+
// TRIGGER REMOVE SCAN EVENT
|
|
588
|
+
const scannedData = scans.map(scan => ({
|
|
589
|
+
scanValue: scan
|
|
590
|
+
}));
|
|
591
|
+
triggerScanEvent('ON_SCAN_REMOVE', route, scannedData);
|
|
592
|
+
}
|
|
593
|
+
async function updateSharedPreference(eventType, mergedObjectiveId, prefixedMergedObjectiveId) {
|
|
594
|
+
let storage = _storage.default.getInstance();
|
|
595
|
+
const mergedIdOutput = await getScanMergedObjectID();
|
|
596
|
+
if (mergedIdOutput) {
|
|
597
|
+
const _mergedIds = mergedIdOutput[prefixedMergedObjectiveId];
|
|
598
|
+
if (eventType) {
|
|
599
|
+
_mergedIds.success.push(mergedObjectiveId);
|
|
600
|
+
} else {
|
|
601
|
+
_mergedIds.failure.push(mergedObjectiveId);
|
|
602
|
+
}
|
|
603
|
+
await storage.setSharedItem(_constants2.SCAN_MERGED_OBJ_ID_OUTPUT, JSON.stringify({
|
|
604
|
+
...mergedIdOutput,
|
|
605
|
+
[prefixedMergedObjectiveId]: _mergedIds
|
|
606
|
+
}));
|
|
607
|
+
}
|
|
608
|
+
}
|
|
609
|
+
async function updatePendingSharedPreference(eventType, prefixedMergedObjectiveId) {
|
|
610
|
+
let storage = _storage.default.getInstance();
|
|
611
|
+
const mergedIdOutput = await getScanMergedObjectID();
|
|
612
|
+
if (mergedIdOutput) {
|
|
613
|
+
const _mergedIds = mergedIdOutput[prefixedMergedObjectiveId];
|
|
614
|
+
if (_mergedIds) {
|
|
615
|
+
if (eventType) {
|
|
616
|
+
_mergedIds.success.push(prefixedMergedObjectiveId);
|
|
617
|
+
_mergedIds.pending = [];
|
|
618
|
+
} else {
|
|
619
|
+
_mergedIds.failure.push(prefixedMergedObjectiveId);
|
|
620
|
+
_mergedIds.pending = [];
|
|
621
|
+
}
|
|
622
|
+
await storage.setSharedItem(_constants2.SCAN_MERGED_OBJ_ID_OUTPUT, JSON.stringify({
|
|
623
|
+
...mergedIdOutput,
|
|
624
|
+
[prefixedMergedObjectiveId]: _mergedIds
|
|
625
|
+
}));
|
|
626
|
+
}
|
|
627
|
+
}
|
|
628
|
+
}
|
|
629
|
+
const getTabCount = async scanProps => {
|
|
630
|
+
let prefixedMergedObjectiveId = scanProps.route.params[_RouteParams.RouteParams.ROOT_META_DATA].prefixedMergedObjectiveId;
|
|
631
|
+
const mergedIdOutput = await getScanMergedObjectID();
|
|
632
|
+
const defaultResult = {
|
|
633
|
+
[_interfaces.SummaryPageTabs.ALL]: 0,
|
|
634
|
+
[_interfaces.SummaryPageTabs.PENDING]: 0,
|
|
635
|
+
[_interfaces.SummaryPageTabs.DELIVERED]: 0,
|
|
636
|
+
[_interfaces.SummaryPageTabs.UNDELIVERED]: 0
|
|
637
|
+
};
|
|
638
|
+
const input = {};
|
|
639
|
+
if (mergedIdOutput) {
|
|
640
|
+
const _mergedIds = mergedIdOutput[prefixedMergedObjectiveId];
|
|
641
|
+
if (_mergedIds) {
|
|
642
|
+
const success = _mergedIds.success;
|
|
643
|
+
const failure = _mergedIds.failure;
|
|
644
|
+
const pending = _mergedIds.pending;
|
|
645
|
+
input[_interfaces.SummaryPageTabs.ALL] = [...success, ...failure, ...pending];
|
|
646
|
+
if (pending.length > 0) input[_interfaces.SummaryPageTabs.PENDING] = pending;
|
|
647
|
+
if (success.length > 0) input[_interfaces.SummaryPageTabs.DELIVERED] = success;
|
|
648
|
+
if (failure.length > 0) input[_interfaces.SummaryPageTabs.UNDELIVERED] = failure;
|
|
649
|
+
const result = await _platformCoreosExecutionEngineSdk.DispatchExecutor.getWFICountByMWIIds(input);
|
|
650
|
+
return {
|
|
651
|
+
...defaultResult,
|
|
652
|
+
...result
|
|
653
|
+
};
|
|
654
|
+
} else {
|
|
655
|
+
return defaultResult;
|
|
656
|
+
}
|
|
657
|
+
} else {
|
|
658
|
+
return defaultResult;
|
|
659
|
+
}
|
|
660
|
+
};
|
|
661
|
+
exports.getTabCount = getTabCount;
|
|
662
|
+
const clearScanOutput = async prefixedMergedObjectiveId => {
|
|
663
|
+
let storage = _storage.default.getInstance();
|
|
664
|
+
const promises = [];
|
|
665
|
+
|
|
666
|
+
// Clear Scan Record
|
|
667
|
+
const scanRecord = (await getScanMergedObjectID()) || {};
|
|
668
|
+
if (scanRecord) {
|
|
669
|
+
delete scanRecord[prefixedMergedObjectiveId];
|
|
670
|
+
promises.push(storage.setSharedItem(_constants2.SCAN_MERGED_OBJ_ID_OUTPUT, JSON.stringify(scanRecord)));
|
|
671
|
+
}
|
|
672
|
+
|
|
673
|
+
// Clear Scan Output
|
|
674
|
+
const scanOutputs = (await getScanMappedOutput()) || {};
|
|
675
|
+
if (scanOutputs) {
|
|
676
|
+
delete scanOutputs[prefixedMergedObjectiveId];
|
|
677
|
+
promises.push(storage.setSharedItem(_constants2.SHARED_PREFERENCE_SCAN_OUTPUT, JSON.stringify(scanOutputs)));
|
|
678
|
+
}
|
|
679
|
+
return Promise.all(promises);
|
|
680
|
+
};
|
|
681
|
+
exports.clearScanOutput = clearScanOutput;
|
|
682
|
+
async function getScanMergedObjectID() {
|
|
683
|
+
let storage = _storage.default.getInstance();
|
|
684
|
+
const mergedIdOutput = await storage.getSharedItem(_constants2.SCAN_MERGED_OBJ_ID_OUTPUT);
|
|
685
|
+
if (mergedIdOutput) {
|
|
686
|
+
return JSON.parse(mergedIdOutput);
|
|
687
|
+
} else {
|
|
688
|
+
return null;
|
|
689
|
+
}
|
|
690
|
+
}
|
|
691
|
+
async function getScanMergedOutput() {
|
|
692
|
+
let storage = _storage.default.getInstance();
|
|
693
|
+
const mergedIdOutput = await storage.getSharedItem(_constants2.SHARED_PREFERENCE_SCAN_OUTPUT);
|
|
694
|
+
if (mergedIdOutput) {
|
|
695
|
+
return JSON.parse(mergedIdOutput);
|
|
696
|
+
} else {
|
|
697
|
+
return null;
|
|
698
|
+
}
|
|
699
|
+
}
|
|
700
|
+
const getErrorMessage = (scan, error) => {
|
|
701
|
+
switch (error.errorCode) {
|
|
702
|
+
case _platformCoreosExecutionEngineSdk.WIErrorCodes.ScannableIdAlreadyCompleted:
|
|
703
|
+
return {
|
|
704
|
+
type: _SnackBarCustom.SnackBarType.FAILURE,
|
|
705
|
+
message: `#${scan}\n${_platformCoreosExecutionEngineSdk.ErrorCodeMessages[_platformCoreosExecutionEngineSdk.WIErrorCodes.ScannableIdAlreadyCompleted]}`
|
|
706
|
+
};
|
|
707
|
+
case _platformCoreosExecutionEngineSdk.WIErrorCodes.ScannableIdNotInDispatch:
|
|
708
|
+
return {
|
|
709
|
+
type: _SnackBarCustom.SnackBarType.FAILURE,
|
|
710
|
+
message: `#${scan}\n${_platformCoreosExecutionEngineSdk.ErrorCodeMessages[_platformCoreosExecutionEngineSdk.WIErrorCodes.ScannableIdNotInDispatch]}`
|
|
711
|
+
};
|
|
712
|
+
case _platformCoreosExecutionEngineSdk.WIErrorCodes.ScannableIdNotReady:
|
|
713
|
+
return {
|
|
714
|
+
type: _SnackBarCustom.SnackBarType.FAILURE,
|
|
715
|
+
message: `#${scan}\n${_platformCoreosExecutionEngineSdk.ErrorCodeMessages[_platformCoreosExecutionEngineSdk.WIErrorCodes.ScannableIdNotReady]}`
|
|
716
|
+
};
|
|
717
|
+
case _platformCoreosExecutionEngineSdk.WIErrorCodes.DifferentGroupUpdateNotAllowed:
|
|
718
|
+
return {
|
|
719
|
+
type: _SnackBarCustom.SnackBarType.FAILURE,
|
|
720
|
+
message: `#${scan}\n${_platformCoreosExecutionEngineSdk.ErrorCodeMessages[_platformCoreosExecutionEngineSdk.WIErrorCodes.DifferentGroupUpdateNotAllowed]}`
|
|
721
|
+
};
|
|
722
|
+
case _platformCoreosExecutionEngineSdk.WIErrorCodes.ObjectiveAndJobWFMismatch:
|
|
723
|
+
return {
|
|
724
|
+
type: _SnackBarCustom.SnackBarType.FAILURE,
|
|
725
|
+
message: `#${scan}\n${_platformCoreosExecutionEngineSdk.ErrorCodeMessages[_platformCoreosExecutionEngineSdk.WIErrorCodes.ObjectiveAndJobWFMismatch]}`
|
|
726
|
+
};
|
|
727
|
+
case _platformCoreosExecutionEngineSdk.WIErrorCodes.ScannableIdAlreadyUpdated:
|
|
728
|
+
return {
|
|
729
|
+
type: _SnackBarCustom.SnackBarType.WARNING,
|
|
730
|
+
message: `#${scan}\n${_platformCoreosExecutionEngineSdk.ErrorCodeMessages[_platformCoreosExecutionEngineSdk.WIErrorCodes.ScannableIdAlreadyUpdated]}`
|
|
731
|
+
};
|
|
732
|
+
case _platformCoreosExecutionEngineSdk.WIErrorCodes.JobAlreadyCompleted:
|
|
733
|
+
return {
|
|
734
|
+
type: _SnackBarCustom.SnackBarType.WARNING,
|
|
735
|
+
message: `#${scan}\n${_platformCoreosExecutionEngineSdk.ErrorCodeMessages[_platformCoreosExecutionEngineSdk.WIErrorCodes.JobAlreadyCompleted]}`
|
|
736
|
+
};
|
|
737
|
+
case _platformCoreosExecutionEngineSdk.WIErrorCodes.ScannableIdPartOfAnotherMO:
|
|
738
|
+
return {
|
|
739
|
+
type: _SnackBarCustom.SnackBarType.WARNING,
|
|
740
|
+
message: `#${scan}\n${_platformCoreosExecutionEngineSdk.ErrorCodeMessages[_platformCoreosExecutionEngineSdk.WIErrorCodes.ScannableIdPartOfAnotherMO]}`
|
|
741
|
+
};
|
|
742
|
+
default:
|
|
743
|
+
return {
|
|
744
|
+
type: _SnackBarCustom.SnackBarType.FAILURE,
|
|
745
|
+
message: 'Error occurred while scanning'
|
|
746
|
+
};
|
|
747
|
+
}
|
|
748
|
+
};
|
|
749
|
+
exports.getErrorMessage = getErrorMessage;
|
|
750
|
+
const getSplitIds = scanOutput => {
|
|
751
|
+
const splitMergedObjectiveIds = Object.keys(scanOutput).filter(mergedObjectiveID => {
|
|
752
|
+
const scan = scanOutput[mergedObjectiveID];
|
|
753
|
+
if (scan.count > 0) return true;
|
|
754
|
+
return false;
|
|
755
|
+
}).map(mergedObjectiveIds => mergedObjectiveIds);
|
|
756
|
+
return splitMergedObjectiveIds;
|
|
757
|
+
};
|
|
758
|
+
exports.getSplitIds = getSplitIds;
|
|
759
|
+
function filterERCItems(eventCodeItems, type) {
|
|
760
|
+
return eventCodeItems.filter(erc => Boolean(erc.success) === (type === 'SUCCESS' ? true : false));
|
|
761
|
+
}
|
|
762
|
+
//# sourceMappingURL=utils.js.map
|