@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,5 +1,6 @@
|
|
|
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
|
-
|
|
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); }
|
|
3
4
|
import ETEventsManager from './ETEventsManager';
|
|
4
5
|
import SyncHttpClient from './SyncHttpClient';
|
|
5
6
|
import { isEmptyOrBlank } from '../../../utils/utils';
|
|
@@ -7,79 +8,70 @@ import { BaseError } from '../../../errors/BaseError';
|
|
|
7
8
|
import BaseErrorCodes, { InvalidArgumentsError, InvalidBaseURL, SyncManagerNotInitialized } from '../../../errors/ErrorCodes';
|
|
8
9
|
import NetworkUtil from '../../../utils/NetworkUtil';
|
|
9
10
|
import Logger, { LOG_TYPE } from '../../../utils/Logger';
|
|
10
|
-
import {
|
|
11
|
+
import { IDispatch } from '@os1-platform/platform-coreos-execution-engine-sdk';
|
|
12
|
+
const SyncType = IDispatch.SyncType;
|
|
11
13
|
import DispatchSdkCache from '../../sdk/DispatchSdkCache';
|
|
14
|
+
import Storage from '../../../utils/storage';
|
|
15
|
+
import { LAST_SYNCED_EVENT_ID } from '../constants';
|
|
12
16
|
const TAG = 'EventsSyncManager';
|
|
13
17
|
export default class EventsSyncManager {
|
|
14
18
|
get retries() {
|
|
15
19
|
return this._retries;
|
|
16
20
|
}
|
|
17
|
-
|
|
18
21
|
set retries(value) {
|
|
19
22
|
this._retries = value;
|
|
20
23
|
}
|
|
21
|
-
|
|
22
24
|
constructor() {
|
|
23
25
|
_defineProperty(this, "syncHttpClient", void 0);
|
|
24
|
-
|
|
25
26
|
_defineProperty(this, "inProgress", false);
|
|
26
|
-
|
|
27
27
|
_defineProperty(this, "cScanInProgress", false);
|
|
28
|
-
|
|
29
28
|
_defineProperty(this, "eventsManager", void 0);
|
|
30
|
-
|
|
31
29
|
_defineProperty(this, "maxRetryCount", 3);
|
|
32
|
-
|
|
33
30
|
_defineProperty(this, "_retries", 0);
|
|
34
31
|
}
|
|
35
|
-
|
|
36
32
|
initSyncManager(baseURL, retryCount) {
|
|
37
33
|
if (isEmptyOrBlank(baseURL)) throw new BaseError(BaseErrorCodes.InvalidBaseURL, InvalidBaseURL);
|
|
38
34
|
this.maxRetryCount = retryCount;
|
|
39
35
|
this.syncHttpClient = new SyncHttpClient(baseURL);
|
|
40
36
|
}
|
|
41
|
-
|
|
42
37
|
static getInstance() {
|
|
43
38
|
if (!EventsSyncManager.instance) {
|
|
44
39
|
EventsSyncManager.instance = new EventsSyncManager();
|
|
45
40
|
}
|
|
46
|
-
|
|
47
41
|
return EventsSyncManager.instance;
|
|
48
42
|
}
|
|
49
|
-
|
|
50
43
|
async startSync() {
|
|
51
44
|
if (!this.inProgress && this._retries < this.maxRetryCount) {
|
|
52
45
|
this.inProgress = true;
|
|
53
46
|
const hasNetwork = await NetworkUtil.isAvailableAsync();
|
|
54
|
-
|
|
55
47
|
try {
|
|
56
48
|
this.checkForInitialization();
|
|
57
|
-
|
|
58
49
|
if (!this.eventsManager) {
|
|
59
50
|
this.eventsManager = await ETEventsManager.getInstance();
|
|
60
51
|
}
|
|
61
|
-
|
|
62
52
|
if (hasNetwork) {
|
|
53
|
+
// NEW CODE
|
|
54
|
+
const lastSyncedEventId = await Storage.getInstance().getSharedItem(LAST_SYNCED_EVENT_ID);
|
|
63
55
|
const dspID = await DispatchSdkCache.getInstance().getKeyFromCache(DispatchSdkCache.KEYS.DISPATCH_ID);
|
|
64
|
-
const
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
this.startCustodyScans(custodyScans).then().catch();
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
let unsyncedData = await this.eventsManager.getWorkflowUpdateEvents(SyncType.WORKFLOW);
|
|
71
|
-
|
|
72
|
-
if ((unsyncedData === null || unsyncedData === void 0 ? void 0 : unsyncedData.length) > 0) {
|
|
73
|
-
await this.syncEventToServer(unsyncedData, SyncType.WORKFLOW);
|
|
56
|
+
const bulkEventRows = await this.eventsManager.getBulkRowsToSync(lastSyncedEventId, dspID ?? '');
|
|
57
|
+
if (bulkEventRows.length) {
|
|
58
|
+
await this.syncBulkEventToServer(bulkEventRows, lastSyncedEventId);
|
|
74
59
|
} else {
|
|
75
|
-
Logger.getInstance().logEvent('startSync', 'No
|
|
60
|
+
Logger.getInstance().logEvent('startSync', 'No data to sync in Events Manager', LOG_TYPE.SDK_INFO);
|
|
76
61
|
}
|
|
62
|
+
|
|
63
|
+
// OLD CODE
|
|
64
|
+
// const promises: any[] = [
|
|
65
|
+
// this.JobRemovalEvent(this.eventsManager),
|
|
66
|
+
// this.CustodyBatchEvent(this.eventsManager),
|
|
67
|
+
// this.WorkflowUpdateEvent(this.eventsManager),
|
|
68
|
+
// ];
|
|
69
|
+
// await Promise.all(promises);
|
|
77
70
|
} else {
|
|
78
71
|
Logger.getInstance().logEvent('startSync', 'NO NETWORK AVAILABLE!!', LOG_TYPE.SDK_INFO);
|
|
79
72
|
}
|
|
80
73
|
} catch (error) {} finally {
|
|
81
74
|
this.inProgress = false;
|
|
82
|
-
|
|
83
75
|
if ((await this.isSyncPending()) && hasNetwork) {
|
|
84
76
|
await this.startSync();
|
|
85
77
|
}
|
|
@@ -89,159 +81,294 @@ export default class EventsSyncManager {
|
|
|
89
81
|
}
|
|
90
82
|
}
|
|
91
83
|
|
|
92
|
-
async
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
}
|
|
84
|
+
// private async WorkflowUpdateEvent(eventsManager: ETEventsManager) {
|
|
85
|
+
// const unsyncedData = await eventsManager.getWorkflowUpdateEvents(
|
|
86
|
+
// SyncType.WORKFLOW
|
|
87
|
+
// );
|
|
88
|
+
// if (unsyncedData?.length > 0) {
|
|
89
|
+
// await this.syncEventToServer(unsyncedData, SyncType.WORKFLOW);
|
|
90
|
+
// } else {
|
|
91
|
+
// Logger.getInstance().logEvent(
|
|
92
|
+
// 'startSync',
|
|
93
|
+
// 'No workflow/task data to sync in Events Manager',
|
|
94
|
+
// LOG_TYPE.SDK_INFO
|
|
95
|
+
// );
|
|
96
|
+
// }
|
|
97
|
+
// }
|
|
98
|
+
|
|
99
|
+
// private async CustodyBatchEvent(eventsManager: ETEventsManager) {
|
|
100
|
+
// const dspID = await DispatchSdkCache.getInstance().getKeyFromCache(
|
|
101
|
+
// DispatchSdkCache.KEYS.DISPATCH_ID
|
|
102
|
+
// );
|
|
103
|
+
// const custodyScans = await eventsManager.getCustodyBatch(dspID ?? '');
|
|
104
|
+
// if (custodyScans && custodyScans.length > 0) {
|
|
105
|
+
// await this.startCustodyScans(custodyScans);
|
|
106
|
+
// }
|
|
107
|
+
// }
|
|
108
|
+
|
|
109
|
+
// private async JobRemovalEvent(eventsManager: ETEventsManager) {
|
|
110
|
+
// const unsyncedJobRemovalData = await eventsManager.getJobRemovalEvents(
|
|
111
|
+
// SyncType.JOB_REMOVAL
|
|
112
|
+
// );
|
|
113
|
+
// if (unsyncedJobRemovalData?.length > 0) {
|
|
114
|
+
// await this.syncEventToServer(
|
|
115
|
+
// unsyncedJobRemovalData,
|
|
116
|
+
// SyncType.JOB_REMOVAL
|
|
117
|
+
// );
|
|
118
|
+
// }
|
|
119
|
+
// }
|
|
120
|
+
|
|
121
|
+
// public async startCustodyScans(custodyScans: EventRow[]) {
|
|
122
|
+
// if (!this.cScanInProgress) {
|
|
123
|
+
// this.cScanInProgress = true;
|
|
124
|
+
// try {
|
|
125
|
+
// const inScans = custodyScans.filter(
|
|
126
|
+
// (scan) => scan.sync_type === SyncType.CUSTODY_IN_SCAN
|
|
127
|
+
// );
|
|
128
|
+
// const outScans = custodyScans.filter(
|
|
129
|
+
// (scans) => scans.sync_type === SyncType.CUSTODY_OUT_SCAN
|
|
130
|
+
// );
|
|
131
|
+
// if (inScans && inScans.length > 0) {
|
|
132
|
+
// await this.syncEventToServer(inScans, SyncType.CUSTODY_IN_SCAN);
|
|
133
|
+
// } else if (outScans && outScans.length > 0) {
|
|
134
|
+
// await this.syncEventToServer(outScans, SyncType.CUSTODY_OUT_SCAN);
|
|
135
|
+
// } else {
|
|
136
|
+
// Logger.getInstance().logEvent(
|
|
137
|
+
// 'startCustodyScans',
|
|
138
|
+
// 'NO CUSTODY SCANS LEFT TO SYNC',
|
|
139
|
+
// LOG_TYPE.SDK_INFO
|
|
140
|
+
// );
|
|
141
|
+
// }
|
|
142
|
+
// } catch (error: any) {
|
|
143
|
+
// } finally {
|
|
144
|
+
// this.cScanInProgress = false;
|
|
145
|
+
// if (await this.isSyncPending()) await this.startSync();
|
|
146
|
+
// }
|
|
147
|
+
// } else {
|
|
148
|
+
// Logger.getInstance().logEvent(
|
|
149
|
+
// 'startCustodyScans',
|
|
150
|
+
// 'Custody Scan already in Progress',
|
|
151
|
+
// LOG_TYPE.SDK_INFO
|
|
152
|
+
// );
|
|
153
|
+
// }
|
|
154
|
+
// }
|
|
115
155
|
|
|
116
156
|
async updateEventError(eventRows, errorString) {
|
|
117
157
|
if (!eventRows || eventRows.length === 0) return;
|
|
118
|
-
|
|
119
158
|
if (!this.eventsManager) {
|
|
120
159
|
this.eventsManager = await ETEventsManager.getInstance();
|
|
121
160
|
}
|
|
122
|
-
|
|
161
|
+
const promises = [];
|
|
123
162
|
for (const ev of eventRows) {
|
|
124
163
|
try {
|
|
125
|
-
|
|
164
|
+
promises.push(this.eventsManager.updateError(ev.id, errorString));
|
|
126
165
|
} catch (err) {
|
|
127
166
|
Logger.getInstance().logEvent('updateEventError', err.message, LOG_TYPE.SDK_WARNING);
|
|
128
167
|
}
|
|
129
168
|
}
|
|
169
|
+
await Promise.all(promises);
|
|
130
170
|
}
|
|
171
|
+
|
|
131
172
|
/**
|
|
132
173
|
* force sync events who retry count >3 This function can be called from app UI to sync the events forcefully
|
|
133
174
|
*/
|
|
134
|
-
|
|
135
|
-
|
|
136
175
|
async forceSync() {
|
|
137
176
|
if (!this.eventsManager) this.eventsManager = await ETEventsManager.getInstance();
|
|
138
177
|
this._retries = 0;
|
|
139
178
|
await this.startSync();
|
|
140
179
|
}
|
|
141
|
-
|
|
142
180
|
async isSyncPending() {
|
|
143
181
|
if (!this.eventsManager) {
|
|
144
182
|
this.eventsManager = await ETEventsManager.getInstance();
|
|
145
183
|
}
|
|
146
184
|
|
|
147
|
-
|
|
148
|
-
|
|
185
|
+
// NEW CODE
|
|
186
|
+
const lastSyncedEventId = await Storage.getInstance().getSharedItem(LAST_SYNCED_EVENT_ID);
|
|
187
|
+
const syncEventId = parseInt(lastSyncedEventId) + 1;
|
|
188
|
+
const dspID = await DispatchSdkCache.getInstance().getKeyFromCache(DispatchSdkCache.KEYS.DISPATCH_ID);
|
|
189
|
+
const eventRows = await this.eventsManager.getRowToSync(`${syncEventId}`, dspID ?? '');
|
|
190
|
+
return eventRows.length > 0 && this._retries < this.maxRetryCount;
|
|
191
|
+
|
|
192
|
+
// OLD CODE
|
|
193
|
+
// let unsyncedData = await this.eventsManager.getAllUnsyncedEvents();
|
|
194
|
+
// return unsyncedData?.length > 0 && this._retries < this.maxRetryCount;
|
|
149
195
|
}
|
|
150
196
|
|
|
151
197
|
async markEventSynced(eventRows) {
|
|
152
198
|
if (!eventRows || eventRows.length === 0) return;
|
|
153
|
-
|
|
154
199
|
if (!this.eventsManager) {
|
|
155
200
|
this.eventsManager = await ETEventsManager.getInstance();
|
|
156
201
|
}
|
|
157
|
-
|
|
202
|
+
const promises = [];
|
|
158
203
|
for (const ev of eventRows) {
|
|
159
204
|
try {
|
|
160
|
-
await this.eventsManager.markEventSynced(ev.id);
|
|
205
|
+
promises.push(await this.eventsManager.markEventSynced(ev.id));
|
|
161
206
|
} catch (err) {
|
|
162
207
|
Logger.getInstance().logEvent('markEventSynced', err.message, LOG_TYPE.SDK_WARNING);
|
|
163
208
|
}
|
|
164
209
|
}
|
|
210
|
+
await Promise.all(promises);
|
|
165
211
|
}
|
|
166
|
-
|
|
167
212
|
async insertEvent(sequence, payload, dspID, syncType, objectiveRef, config) {
|
|
168
213
|
if (!sequence || isEmptyOrBlank(payload) || isEmptyOrBlank(dspID) || isEmptyOrBlank(syncType) || isEmptyOrBlank(objectiveRef)) throw new BaseError(BaseErrorCodes.InvalidArgumentError, InvalidArgumentsError);
|
|
169
|
-
|
|
170
214
|
if (!this.eventsManager) {
|
|
171
215
|
this.eventsManager = await ETEventsManager.getInstance();
|
|
172
216
|
}
|
|
173
|
-
|
|
174
217
|
await this.eventsManager.insertEvent(sequence, payload, dspID, syncType, objectiveRef, config);
|
|
175
218
|
}
|
|
176
219
|
|
|
220
|
+
// NEW CODE
|
|
221
|
+
async insertBulkEvent(_bulkData) {
|
|
222
|
+
try {
|
|
223
|
+
if (!this.eventsManager) {
|
|
224
|
+
this.eventsManager = await ETEventsManager.getInstance();
|
|
225
|
+
}
|
|
226
|
+
await this.eventsManager.insertBulkEvent(_bulkData);
|
|
227
|
+
} catch (err) {
|
|
228
|
+
throw err;
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
// NEW CODE
|
|
233
|
+
async insertQueueEvent(_pushData) {
|
|
234
|
+
try {
|
|
235
|
+
if (!this.eventsManager) {
|
|
236
|
+
this.eventsManager = await ETEventsManager.getInstance();
|
|
237
|
+
}
|
|
238
|
+
await this.eventsManager.insertQueueEvent(_pushData);
|
|
239
|
+
} catch (err) {
|
|
240
|
+
throw err;
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
// OLD CODE
|
|
245
|
+
// public async insertBulkEvent(_bulkData: BulkEvent[]): Promise<void> {
|
|
246
|
+
// try {
|
|
247
|
+
// /* if (
|
|
248
|
+
// !sequence ||
|
|
249
|
+
// isEmptyOrBlank(payload) ||
|
|
250
|
+
// isEmptyOrBlank(dspID) ||
|
|
251
|
+
// isEmptyOrBlank(syncType) ||
|
|
252
|
+
// isEmptyOrBlank(objectiveRef)
|
|
253
|
+
// )
|
|
254
|
+
// throw new BaseError(
|
|
255
|
+
// BaseErrorCodes.InvalidArgumentError,
|
|
256
|
+
// InvalidArgumentsError
|
|
257
|
+
// ); */
|
|
258
|
+
// if (!this.eventsManager) {
|
|
259
|
+
// this.eventsManager = await ETEventsManager.getInstance();
|
|
260
|
+
// }
|
|
261
|
+
// await this.eventsManager.insertBulkEvent(_bulkData);
|
|
262
|
+
// } catch (err) {
|
|
263
|
+
// throw err;
|
|
264
|
+
// }
|
|
265
|
+
// }
|
|
266
|
+
|
|
177
267
|
checkForInitialization() {
|
|
178
268
|
if (!this.syncHttpClient) {
|
|
179
269
|
throw new BaseError(BaseErrorCodes.SyncManagerNotInitialized, SyncManagerNotInitialized);
|
|
180
270
|
}
|
|
181
271
|
}
|
|
182
|
-
|
|
183
272
|
async getObjectiveSummary(objectiveRef) {
|
|
184
273
|
if (!objectiveRef) return [];
|
|
185
|
-
|
|
186
274
|
if (!this.eventsManager) {
|
|
187
275
|
this.eventsManager = await ETEventsManager.getInstance();
|
|
188
276
|
}
|
|
189
|
-
|
|
190
277
|
try {
|
|
191
278
|
let data = await this.eventsManager.getObjectiveDetails(objectiveRef);
|
|
192
279
|
let requiredPayload = null;
|
|
193
|
-
|
|
194
280
|
for (const row of data) {
|
|
195
281
|
let payload = JSON.parse(row.payload);
|
|
196
|
-
|
|
197
282
|
if (payload.status === 'CLOSED') {
|
|
198
283
|
requiredPayload = payload;
|
|
199
284
|
}
|
|
200
285
|
}
|
|
201
|
-
|
|
202
286
|
if (requiredPayload) return requiredPayload.data;else return null;
|
|
203
287
|
} catch (err) {
|
|
204
288
|
Logger.getInstance().logEvent('getObjectiveSummary', err.message, LOG_TYPE.SDK_WARNING);
|
|
205
289
|
return null;
|
|
206
290
|
}
|
|
207
291
|
}
|
|
208
|
-
|
|
209
292
|
async syncEventToServer(eventRows, syncType) {
|
|
210
293
|
try {
|
|
211
294
|
var _this$syncHttpClient;
|
|
212
|
-
|
|
213
|
-
Logger.getInstance().logEvent(TAG, `Syncing ${syncType} :- ${JSON.stringify(eventRows)}`, LOG_TYPE.SDK_ERROR);
|
|
214
295
|
const success = await ((_this$syncHttpClient = this.syncHttpClient) === null || _this$syncHttpClient === void 0 ? void 0 : _this$syncHttpClient.syncEvent(eventRows, syncType));
|
|
215
|
-
Logger.getInstance().logEvent(TAG, `Synced ${syncType} :- ${JSON.stringify(eventRows)}`, LOG_TYPE.SDK_ERROR);
|
|
216
|
-
|
|
217
296
|
if (success) {
|
|
218
297
|
this._retries = 0;
|
|
298
|
+
// NEW CODE
|
|
299
|
+
const lastSyncedEventId = await Storage.getInstance().getSharedItem(LAST_SYNCED_EVENT_ID);
|
|
300
|
+
const syncEventId = parseInt(lastSyncedEventId) + 1;
|
|
301
|
+
await Storage.getInstance().setSharedItem(LAST_SYNCED_EVENT_ID, `${syncEventId}`);
|
|
302
|
+
|
|
303
|
+
// OLD CODE
|
|
219
304
|
await this.markEventSynced(eventRows);
|
|
220
305
|
} else {
|
|
221
306
|
this._retries++;
|
|
222
|
-
Logger.getInstance().logEvent(
|
|
307
|
+
/* Logger.getInstance().logEvent(
|
|
308
|
+
'syncEventToServer',
|
|
309
|
+
`Syncing Error ${syncType} :- ${JSON.stringify(eventRows)}`,
|
|
310
|
+
LOG_TYPE.SDK_ERROR
|
|
311
|
+
); */
|
|
223
312
|
await this.updateEventError(eventRows, 'Unexpected error');
|
|
224
313
|
}
|
|
225
314
|
} catch (error) {
|
|
226
315
|
this._retries++;
|
|
227
|
-
Logger.getInstance().logEvent(
|
|
316
|
+
/* Logger.getInstance().logEvent(
|
|
317
|
+
'syncEventToServer',
|
|
318
|
+
`Syncing Error ${syncType} :- ${JSON.stringify(eventRows)} -: ${
|
|
319
|
+
error.message
|
|
320
|
+
}`,
|
|
321
|
+
LOG_TYPE.SDK_ERROR
|
|
322
|
+
); */
|
|
228
323
|
await this.updateEventError(eventRows, JSON.stringify({
|
|
229
324
|
error
|
|
230
325
|
}));
|
|
231
326
|
}
|
|
232
327
|
}
|
|
328
|
+
async syncBulkEventToServer(eventRows, lastSyncedEventId) {
|
|
329
|
+
try {
|
|
330
|
+
var _this$syncHttpClient2;
|
|
331
|
+
const success = await ((_this$syncHttpClient2 = this.syncHttpClient) === null || _this$syncHttpClient2 === void 0 ? void 0 : _this$syncHttpClient2.syncBulkEvent(eventRows));
|
|
332
|
+
if (success) {
|
|
333
|
+
this._retries = 0;
|
|
334
|
+
// NEW CODE
|
|
335
|
+
|
|
336
|
+
const syncEventId = parseInt(lastSyncedEventId) + eventRows.length;
|
|
337
|
+
await Storage.getInstance().setSharedItem(LAST_SYNCED_EVENT_ID, `${syncEventId}`);
|
|
233
338
|
|
|
339
|
+
// OLD CODE
|
|
340
|
+
await this.markEventSynced(eventRows);
|
|
341
|
+
} else {
|
|
342
|
+
this._retries++;
|
|
343
|
+
/* Logger.getInstance().logEvent(
|
|
344
|
+
'syncEventToServer',
|
|
345
|
+
`Syncing Error ${syncType} :- ${JSON.stringify(eventRows)}`,
|
|
346
|
+
LOG_TYPE.SDK_ERROR
|
|
347
|
+
); */
|
|
348
|
+
await this.updateEventError(eventRows, 'Unexpected error');
|
|
349
|
+
}
|
|
350
|
+
} catch (error) {
|
|
351
|
+
this._retries++;
|
|
352
|
+
/* Logger.getInstance().logEvent(
|
|
353
|
+
'syncEventToServer',
|
|
354
|
+
`Syncing Error ${syncType} :- ${JSON.stringify(eventRows)} -: ${
|
|
355
|
+
error.message
|
|
356
|
+
}`,
|
|
357
|
+
LOG_TYPE.SDK_ERROR
|
|
358
|
+
); */
|
|
359
|
+
await this.updateEventError(eventRows, JSON.stringify({
|
|
360
|
+
error
|
|
361
|
+
}));
|
|
362
|
+
}
|
|
363
|
+
}
|
|
234
364
|
async getAllEvents(dspID) {
|
|
235
365
|
if (!this.eventsManager) this.eventsManager = await ETEventsManager.getInstance();
|
|
236
366
|
return this.eventsManager.getAllEvents(dspID);
|
|
237
367
|
}
|
|
238
|
-
|
|
239
368
|
async clearEventsDB() {
|
|
240
369
|
if (!this.eventsManager) this.eventsManager = await ETEventsManager.getInstance();
|
|
241
370
|
await this.eventsManager.deleteAllEvents();
|
|
242
371
|
}
|
|
243
|
-
|
|
244
372
|
}
|
|
245
|
-
|
|
246
373
|
_defineProperty(EventsSyncManager, "instance", void 0);
|
|
247
374
|
//# sourceMappingURL=EventsSyncManager.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["ETEventsManager","SyncHttpClient","isEmptyOrBlank","BaseError","BaseErrorCodes","InvalidArgumentsError","InvalidBaseURL","SyncManagerNotInitialized","NetworkUtil","Logger","LOG_TYPE","SyncType","DispatchSdkCache","TAG","EventsSyncManager","retries","_retries","value","constructor","initSyncManager","baseURL","retryCount","maxRetryCount","syncHttpClient","getInstance","instance","startSync","inProgress","hasNetwork","isAvailableAsync","checkForInitialization","eventsManager","dspID","getKeyFromCache","KEYS","DISPATCH_ID","custodyScans","getCustodyBatch","length","startCustodyScans","then","catch","unsyncedData","getWorkflowUpdateEvents","WORKFLOW","syncEventToServer","logEvent","SDK_INFO","error","isSyncPending","cScanInProgress","inScans","filter","scan","sync_type","CUSTODY_IN_SCAN","outScans","scans","CUSTODY_OUT_SCAN","updateEventError","eventRows","errorString","ev","updateError","id","err","message","SDK_WARNING","forceSync","getAllUnsyncedEvents","markEventSynced","insertEvent","sequence","payload","syncType","objectiveRef","config","InvalidArgumentError","getObjectiveSummary","data","getObjectiveDetails","requiredPayload","row","JSON","parse","status","stringify","SDK_ERROR","success","syncEvent","getAllEvents","clearEventsDB","deleteAllEvents"],"sources":["EventsSyncManager.ts"],"sourcesContent":["import ETEventsManager from './ETEventsManager';\nimport type { EventRow } from '../DBConfig';\nimport SyncHttpClient from './SyncHttpClient';\nimport { isEmptyOrBlank } from '../../../utils/utils';\nimport { BaseError } from '../../../errors/BaseError';\nimport BaseErrorCodes, {\n InvalidArgumentsError,\n InvalidBaseURL,\n SyncManagerNotInitialized,\n} from '../../../errors/ErrorCodes';\nimport NetworkUtil from '../../../utils/NetworkUtil';\nimport Logger, { LOG_TYPE } from '../../../utils/Logger';\nimport { SyncType } from 'mobile-execution-lib';\nimport DispatchSdkCache from '../../sdk/DispatchSdkCache';\n\nconst TAG = 'EventsSyncManager';\nexport default class EventsSyncManager {\n private syncHttpClient: SyncHttpClient | undefined;\n private static instance: EventsSyncManager;\n private inProgress: boolean = false;\n private cScanInProgress: boolean = false;\n private eventsManager: ETEventsManager | undefined;\n private maxRetryCount: number = 3;\n private _retries = 0;\n\n get retries(): number {\n return this._retries;\n }\n\n set retries(value: number) {\n this._retries = value;\n }\n\n private constructor() {}\n\n public initSyncManager(baseURL: string, retryCount: number) {\n if (isEmptyOrBlank(baseURL))\n throw new BaseError(BaseErrorCodes.InvalidBaseURL, InvalidBaseURL);\n this.maxRetryCount = retryCount;\n this.syncHttpClient = new SyncHttpClient(baseURL);\n }\n\n public static getInstance(): EventsSyncManager {\n if (!EventsSyncManager.instance) {\n EventsSyncManager.instance = new EventsSyncManager();\n }\n return EventsSyncManager.instance;\n }\n\n public async startSync(): Promise<void> {\n if (!this.inProgress && this._retries < this.maxRetryCount) {\n this.inProgress = true;\n const hasNetwork = await NetworkUtil.isAvailableAsync();\n try {\n this.checkForInitialization();\n if (!this.eventsManager) {\n this.eventsManager = await ETEventsManager.getInstance();\n }\n if (hasNetwork) {\n const dspID = await DispatchSdkCache.getInstance().getKeyFromCache(\n DispatchSdkCache.KEYS.DISPATCH_ID\n );\n const custodyScans = await this.eventsManager.getCustodyBatch(\n dspID ?? ''\n );\n if (custodyScans && custodyScans.length > 0) {\n this.startCustodyScans(custodyScans).then().catch();\n }\n let unsyncedData = await this.eventsManager.getWorkflowUpdateEvents(\n SyncType.WORKFLOW\n );\n if (unsyncedData?.length > 0) {\n await this.syncEventToServer(unsyncedData, SyncType.WORKFLOW);\n } else {\n Logger.getInstance().logEvent(\n 'startSync',\n 'No workflow/task data to sync in Events Manager',\n LOG_TYPE.SDK_INFO\n );\n }\n } else {\n Logger.getInstance().logEvent(\n 'startSync',\n 'NO NETWORK AVAILABLE!!',\n LOG_TYPE.SDK_INFO\n );\n }\n } catch (error: any) {\n } finally {\n this.inProgress = false;\n if ((await this.isSyncPending()) && hasNetwork) {\n await this.startSync();\n }\n }\n } else {\n Logger.getInstance().logEvent(\n 'startSync',\n 'WORKFLOW/TASK ALREADY IN PROGRESS || Max Retries reached',\n LOG_TYPE.SDK_INFO\n );\n }\n }\n\n public async startCustodyScans(custodyScans: EventRow[]) {\n if (!this.cScanInProgress) {\n this.cScanInProgress = true;\n try {\n const inScans = custodyScans.filter(\n (scan) => scan.sync_type === SyncType.CUSTODY_IN_SCAN\n );\n const outScans = custodyScans.filter(\n (scans) => scans.sync_type === SyncType.CUSTODY_OUT_SCAN\n );\n if (inScans && inScans.length > 0) {\n await this.syncEventToServer(inScans, SyncType.CUSTODY_IN_SCAN);\n } else if (outScans && outScans.length > 0) {\n await this.syncEventToServer(outScans, SyncType.CUSTODY_OUT_SCAN);\n } else {\n Logger.getInstance().logEvent(\n 'startCustodyScans',\n 'NO CUSTODY SCANS LEFT TO SYNC',\n LOG_TYPE.SDK_INFO\n );\n }\n } catch (error: any) {\n } finally {\n this.cScanInProgress = false;\n if (await this.isSyncPending()) await this.startSync();\n }\n } else {\n Logger.getInstance().logEvent(\n 'startCustodyScans',\n 'Custody Scan already in Progress',\n LOG_TYPE.SDK_INFO\n );\n }\n }\n\n private async updateEventError(\n eventRows: EventRow[],\n errorString: string\n ): Promise<void> {\n if (!eventRows || eventRows.length === 0) return;\n if (!this.eventsManager) {\n this.eventsManager = await ETEventsManager.getInstance();\n }\n for (const ev of eventRows) {\n try {\n await this.eventsManager.updateError(ev.id, errorString);\n } catch (err: any) {\n Logger.getInstance().logEvent(\n 'updateEventError',\n err.message,\n LOG_TYPE.SDK_WARNING\n );\n }\n }\n }\n\n /**\n * force sync events who retry count >3 This function can be called from app UI to sync the events forcefully\n */\n public async forceSync() {\n if (!this.eventsManager)\n this.eventsManager = await ETEventsManager.getInstance();\n this._retries = 0;\n await this.startSync();\n }\n\n public async isSyncPending(): Promise<boolean> {\n if (!this.eventsManager) {\n this.eventsManager = await ETEventsManager.getInstance();\n }\n let unsyncedData = await this.eventsManager.getAllUnsyncedEvents();\n return unsyncedData?.length > 0 && this._retries < this.maxRetryCount;\n }\n\n private async markEventSynced(eventRows: EventRow[]) {\n if (!eventRows || eventRows.length === 0) return;\n if (!this.eventsManager) {\n this.eventsManager = await ETEventsManager.getInstance();\n }\n for (const ev of eventRows) {\n try {\n await this.eventsManager.markEventSynced(ev.id);\n } catch (err: any) {\n Logger.getInstance().logEvent(\n 'markEventSynced',\n err.message,\n LOG_TYPE.SDK_WARNING\n );\n }\n }\n }\n\n public async insertEvent(\n sequence: number,\n payload: string,\n dspID: string,\n syncType: string,\n objectiveRef: string,\n config?: string\n ): Promise<void> {\n if (\n !sequence ||\n isEmptyOrBlank(payload) ||\n isEmptyOrBlank(dspID) ||\n isEmptyOrBlank(syncType) ||\n isEmptyOrBlank(objectiveRef)\n )\n throw new BaseError(\n BaseErrorCodes.InvalidArgumentError,\n InvalidArgumentsError\n );\n if (!this.eventsManager) {\n this.eventsManager = await ETEventsManager.getInstance();\n }\n await this.eventsManager.insertEvent(\n sequence,\n payload,\n dspID,\n syncType,\n objectiveRef,\n config\n );\n }\n private checkForInitialization() {\n if (!this.syncHttpClient) {\n throw new BaseError(\n BaseErrorCodes.SyncManagerNotInitialized,\n SyncManagerNotInitialized\n );\n }\n }\n\n public async getObjectiveSummary(objectiveRef: string): Promise<any> {\n if (!objectiveRef) return [];\n if (!this.eventsManager) {\n this.eventsManager = await ETEventsManager.getInstance();\n }\n try {\n let data = await this.eventsManager.getObjectiveDetails(objectiveRef);\n let requiredPayload: any = null;\n for (const row of data) {\n let payload = JSON.parse(row.payload);\n if (payload.status === 'CLOSED') {\n requiredPayload = payload;\n }\n }\n if (requiredPayload) return requiredPayload.data;\n else return null;\n } catch (err: any) {\n Logger.getInstance().logEvent(\n 'getObjectiveSummary',\n err.message,\n LOG_TYPE.SDK_WARNING\n );\n return null;\n }\n }\n\n private async syncEventToServer(eventRows: EventRow[], syncType: SyncType) {\n try {\n Logger.getInstance().logEvent(\n TAG,\n `Syncing ${syncType} :- ${JSON.stringify(eventRows)}`,\n LOG_TYPE.SDK_ERROR\n );\n const success = await this.syncHttpClient?.syncEvent(eventRows, syncType);\n Logger.getInstance().logEvent(\n TAG,\n `Synced ${syncType} :- ${JSON.stringify(eventRows)}`,\n LOG_TYPE.SDK_ERROR\n );\n if (success) {\n this._retries = 0;\n await this.markEventSynced(eventRows);\n } else {\n this._retries++;\n Logger.getInstance().logEvent(\n 'syncEventToServer',\n `Syncing Error ${syncType} :- ${JSON.stringify(eventRows)}`,\n LOG_TYPE.SDK_ERROR\n );\n await this.updateEventError(eventRows, 'Unexpected error');\n }\n } catch (error: any) {\n this._retries++;\n Logger.getInstance().logEvent(\n 'syncEventToServer',\n `Syncing Error ${syncType} :- ${JSON.stringify(eventRows)} -: ${\n error.message\n }`,\n LOG_TYPE.SDK_ERROR\n );\n await this.updateEventError(\n eventRows,\n JSON.stringify({\n error,\n })\n );\n }\n }\n public async getAllEvents(dspID?: string): Promise<EventRow[]> {\n if (!this.eventsManager)\n this.eventsManager = await ETEventsManager.getInstance();\n return this.eventsManager.getAllEvents(dspID);\n }\n public async clearEventsDB() {\n if (!this.eventsManager)\n this.eventsManager = await ETEventsManager.getInstance();\n await this.eventsManager.deleteAllEvents();\n }\n}\n"],"mappings":";;AAAA,OAAOA,eAAP,MAA4B,mBAA5B;AAEA,OAAOC,cAAP,MAA2B,kBAA3B;AACA,SAASC,cAAT,QAA+B,sBAA/B;AACA,SAASC,SAAT,QAA0B,2BAA1B;AACA,OAAOC,cAAP,IACEC,qBADF,EAEEC,cAFF,EAGEC,yBAHF,QAIO,4BAJP;AAKA,OAAOC,WAAP,MAAwB,4BAAxB;AACA,OAAOC,MAAP,IAAiBC,QA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AiB4B,QAAS,OAAMS,IAAI,CAACG,SAAL,CAAe1B,SAAf,CAA0B,EAF7D,EAGElD,QAAQ,CAAC6E,SAHX;QAKA,MAAM,KAAK5B,gBAAL,CAAsBC,SAAtB,EAAiC,kBAAjC,CAAN;MACD;IACF,CAxBD,CAwBE,OAAOZ,KAAP,EAAmB;MACnB,KAAKhC,QAAL;MACAP,MAAM,CAACe,WAAP,GAAqBsB,QAArB,CACE,mBADF,EAEG,iBAAgB4B,QAAS,OAAMS,IAAI,CAACG,SAAL,CAAe1B,SAAf,CAA0B,OACxDZ,KAAK,CAACkB,OACP,EAJH,EAKExD,QAAQ,CAAC6E,SALX;MAOA,MAAM,KAAK5B,gBAAL,CACJC,SADI,EAEJuB,IAAI,CAACG,SAAL,CAAe;QACbtC;MADa,CAAf,CAFI,CAAN;IAMD;EACF;;EACwB,MAAZ0C,YAAY,CAAC1D,KAAD,EAAsC;IAC7D,IAAI,CAAC,KAAKD,aAAV,EACE,KAAKA,aAAL,GAAqB,MAAM/B,eAAe,CAACwB,WAAhB,EAA3B;IACF,OAAO,KAAKO,aAAL,CAAmB2D,YAAnB,CAAgC1D,KAAhC,CAAP;EACD;;EACyB,MAAb2D,aAAa,GAAG;IAC3B,IAAI,CAAC,KAAK5D,aAAV,EACE,KAAKA,aAAL,GAAqB,MAAM/B,eAAe,CAACwB,WAAhB,EAA3B;IACF,MAAM,KAAKO,aAAL,CAAmB6D,eAAnB,EAAN;EACD;;AAxSoC;;gBAAlB9E,iB"}
|
|
1
|
+
{"version":3,"names":["ETEventsManager","SyncHttpClient","isEmptyOrBlank","BaseError","BaseErrorCodes","InvalidArgumentsError","InvalidBaseURL","SyncManagerNotInitialized","NetworkUtil","Logger","LOG_TYPE","IDispatch","SyncType","DispatchSdkCache","Storage","LAST_SYNCED_EVENT_ID","TAG","EventsSyncManager","retries","_retries","value","constructor","_defineProperty","initSyncManager","baseURL","retryCount","maxRetryCount","syncHttpClient","getInstance","instance","startSync","inProgress","hasNetwork","isAvailableAsync","checkForInitialization","eventsManager","lastSyncedEventId","getSharedItem","dspID","getKeyFromCache","KEYS","DISPATCH_ID","bulkEventRows","getBulkRowsToSync","length","syncBulkEventToServer","logEvent","SDK_INFO","error","isSyncPending","updateEventError","eventRows","errorString","promises","ev","push","updateError","id","err","message","SDK_WARNING","Promise","all","forceSync","syncEventId","parseInt","getRowToSync","markEventSynced","insertEvent","sequence","payload","syncType","objectiveRef","config","InvalidArgumentError","insertBulkEvent","_bulkData","insertQueueEvent","_pushData","getObjectiveSummary","data","getObjectiveDetails","requiredPayload","row","JSON","parse","status","syncEventToServer","_this$syncHttpClient","success","syncEvent","setSharedItem","stringify","_this$syncHttpClient2","syncBulkEvent","getAllEvents","clearEventsDB","deleteAllEvents"],"sources":["EventsSyncManager.ts"],"sourcesContent":["import ETEventsManager from './ETEventsManager';\nimport type {\n BulkEvent,\n DispatchSyncType,\n EventRow,\n ExecEngineSyncType,\n} from '../DBConfig';\nimport SyncHttpClient from './SyncHttpClient';\nimport { isEmptyOrBlank } from '../../../utils/utils';\nimport { BaseError } from '../../../errors/BaseError';\nimport BaseErrorCodes, {\n InvalidArgumentsError,\n InvalidBaseURL,\n SyncManagerNotInitialized,\n} from '../../../errors/ErrorCodes';\nimport NetworkUtil from '../../../utils/NetworkUtil';\nimport Logger, { LOG_TYPE } from '../../../utils/Logger';\nimport { IDispatch } from '@os1-platform/platform-coreos-execution-engine-sdk';\nconst SyncType = IDispatch.SyncType;\n\nimport DispatchSdkCache from '../../sdk/DispatchSdkCache';\nimport Storage from '../../../utils/storage';\nimport { LAST_SYNCED_EVENT_ID } from '../constants';\n\nconst TAG = 'EventsSyncManager';\nexport default class EventsSyncManager {\n private syncHttpClient: SyncHttpClient | undefined;\n private static instance: EventsSyncManager;\n private inProgress: boolean = false;\n private cScanInProgress: boolean = false;\n private eventsManager: ETEventsManager | undefined;\n private maxRetryCount: number = 3;\n private _retries = 0;\n\n get retries(): number {\n return this._retries;\n }\n\n set retries(value: number) {\n this._retries = value;\n }\n\n private constructor() {}\n\n public initSyncManager(baseURL: string, retryCount: number) {\n if (isEmptyOrBlank(baseURL))\n throw new BaseError(BaseErrorCodes.InvalidBaseURL, InvalidBaseURL);\n this.maxRetryCount = retryCount;\n this.syncHttpClient = new SyncHttpClient(baseURL);\n }\n\n public static getInstance(): EventsSyncManager {\n if (!EventsSyncManager.instance) {\n EventsSyncManager.instance = new EventsSyncManager();\n }\n return EventsSyncManager.instance;\n }\n\n public async startSync(): Promise<void> {\n if (!this.inProgress && this._retries < this.maxRetryCount) {\n this.inProgress = true;\n const hasNetwork = await NetworkUtil.isAvailableAsync();\n try {\n this.checkForInitialization();\n if (!this.eventsManager) {\n this.eventsManager = await ETEventsManager.getInstance();\n }\n if (hasNetwork) {\n // NEW CODE\n const lastSyncedEventId = await Storage.getInstance().getSharedItem(\n LAST_SYNCED_EVENT_ID\n );\n const dspID = await DispatchSdkCache.getInstance().getKeyFromCache(\n DispatchSdkCache.KEYS.DISPATCH_ID\n );\n\n const bulkEventRows = await this.eventsManager.getBulkRowsToSync(\n lastSyncedEventId,\n dspID ?? ''\n );\n\n if (bulkEventRows.length) {\n await this.syncBulkEventToServer(bulkEventRows, lastSyncedEventId);\n } else {\n Logger.getInstance().logEvent(\n 'startSync',\n 'No data to sync in Events Manager',\n LOG_TYPE.SDK_INFO\n );\n }\n\n // OLD CODE\n // const promises: any[] = [\n // this.JobRemovalEvent(this.eventsManager),\n // this.CustodyBatchEvent(this.eventsManager),\n // this.WorkflowUpdateEvent(this.eventsManager),\n // ];\n // await Promise.all(promises);\n } else {\n Logger.getInstance().logEvent(\n 'startSync',\n 'NO NETWORK AVAILABLE!!',\n LOG_TYPE.SDK_INFO\n );\n }\n } catch (error: any) {\n } finally {\n this.inProgress = false;\n if ((await this.isSyncPending()) && hasNetwork) {\n await this.startSync();\n }\n }\n } else {\n Logger.getInstance().logEvent(\n 'startSync',\n 'WORKFLOW/TASK ALREADY IN PROGRESS || Max Retries reached',\n LOG_TYPE.SDK_INFO\n );\n }\n }\n\n // private async WorkflowUpdateEvent(eventsManager: ETEventsManager) {\n // const unsyncedData = await eventsManager.getWorkflowUpdateEvents(\n // SyncType.WORKFLOW\n // );\n // if (unsyncedData?.length > 0) {\n // await this.syncEventToServer(unsyncedData, SyncType.WORKFLOW);\n // } else {\n // Logger.getInstance().logEvent(\n // 'startSync',\n // 'No workflow/task data to sync in Events Manager',\n // LOG_TYPE.SDK_INFO\n // );\n // }\n // }\n\n // private async CustodyBatchEvent(eventsManager: ETEventsManager) {\n // const dspID = await DispatchSdkCache.getInstance().getKeyFromCache(\n // DispatchSdkCache.KEYS.DISPATCH_ID\n // );\n // const custodyScans = await eventsManager.getCustodyBatch(dspID ?? '');\n // if (custodyScans && custodyScans.length > 0) {\n // await this.startCustodyScans(custodyScans);\n // }\n // }\n\n // private async JobRemovalEvent(eventsManager: ETEventsManager) {\n // const unsyncedJobRemovalData = await eventsManager.getJobRemovalEvents(\n // SyncType.JOB_REMOVAL\n // );\n // if (unsyncedJobRemovalData?.length > 0) {\n // await this.syncEventToServer(\n // unsyncedJobRemovalData,\n // SyncType.JOB_REMOVAL\n // );\n // }\n // }\n\n // public async startCustodyScans(custodyScans: EventRow[]) {\n // if (!this.cScanInProgress) {\n // this.cScanInProgress = true;\n // try {\n // const inScans = custodyScans.filter(\n // (scan) => scan.sync_type === SyncType.CUSTODY_IN_SCAN\n // );\n // const outScans = custodyScans.filter(\n // (scans) => scans.sync_type === SyncType.CUSTODY_OUT_SCAN\n // );\n // if (inScans && inScans.length > 0) {\n // await this.syncEventToServer(inScans, SyncType.CUSTODY_IN_SCAN);\n // } else if (outScans && outScans.length > 0) {\n // await this.syncEventToServer(outScans, SyncType.CUSTODY_OUT_SCAN);\n // } else {\n // Logger.getInstance().logEvent(\n // 'startCustodyScans',\n // 'NO CUSTODY SCANS LEFT TO SYNC',\n // LOG_TYPE.SDK_INFO\n // );\n // }\n // } catch (error: any) {\n // } finally {\n // this.cScanInProgress = false;\n // if (await this.isSyncPending()) await this.startSync();\n // }\n // } else {\n // Logger.getInstance().logEvent(\n // 'startCustodyScans',\n // 'Custody Scan already in Progress',\n // LOG_TYPE.SDK_INFO\n // );\n // }\n // }\n\n private async updateEventError(\n eventRows: EventRow[],\n errorString: string\n ): Promise<void> {\n if (!eventRows || eventRows.length === 0) return;\n if (!this.eventsManager) {\n this.eventsManager = await ETEventsManager.getInstance();\n }\n const promises: any[] = [];\n for (const ev of eventRows) {\n try {\n promises.push(this.eventsManager.updateError(ev.id, errorString));\n } catch (err: any) {\n Logger.getInstance().logEvent(\n 'updateEventError',\n err.message,\n LOG_TYPE.SDK_WARNING\n );\n }\n }\n await Promise.all(promises);\n }\n\n /**\n * force sync events who retry count >3 This function can be called from app UI to sync the events forcefully\n */\n public async forceSync() {\n if (!this.eventsManager)\n this.eventsManager = await ETEventsManager.getInstance();\n this._retries = 0;\n await this.startSync();\n }\n\n public async isSyncPending(): Promise<boolean> {\n if (!this.eventsManager) {\n this.eventsManager = await ETEventsManager.getInstance();\n }\n\n // NEW CODE\n const lastSyncedEventId = await Storage.getInstance().getSharedItem(\n LAST_SYNCED_EVENT_ID\n );\n const syncEventId = parseInt(lastSyncedEventId) + 1;\n const dspID = await DispatchSdkCache.getInstance().getKeyFromCache(\n DispatchSdkCache.KEYS.DISPATCH_ID\n );\n const eventRows = await this.eventsManager.getRowToSync(\n `${syncEventId}`,\n dspID ?? ''\n );\n\n return eventRows.length > 0 && this._retries < this.maxRetryCount;\n\n // OLD CODE\n // let unsyncedData = await this.eventsManager.getAllUnsyncedEvents();\n // return unsyncedData?.length > 0 && this._retries < this.maxRetryCount;\n }\n\n private async markEventSynced(eventRows: EventRow[]) {\n if (!eventRows || eventRows.length === 0) return;\n if (!this.eventsManager) {\n this.eventsManager = await ETEventsManager.getInstance();\n }\n const promises: any[] = [];\n for (const ev of eventRows) {\n try {\n promises.push(await this.eventsManager.markEventSynced(ev.id));\n } catch (err: any) {\n Logger.getInstance().logEvent(\n 'markEventSynced',\n err.message,\n LOG_TYPE.SDK_WARNING\n );\n }\n }\n\n await Promise.all(promises);\n }\n\n public async insertEvent(\n sequence: number,\n payload: string,\n dspID: string,\n syncType: string,\n objectiveRef: string,\n config?: string\n ): Promise<void> {\n if (\n !sequence ||\n isEmptyOrBlank(payload) ||\n isEmptyOrBlank(dspID) ||\n isEmptyOrBlank(syncType) ||\n isEmptyOrBlank(objectiveRef)\n )\n throw new BaseError(\n BaseErrorCodes.InvalidArgumentError,\n InvalidArgumentsError\n );\n if (!this.eventsManager) {\n this.eventsManager = await ETEventsManager.getInstance();\n }\n await this.eventsManager.insertEvent(\n sequence,\n payload,\n dspID,\n syncType,\n objectiveRef,\n config\n );\n }\n\n // NEW CODE\n public async insertBulkEvent(_bulkData: BulkEvent): Promise<void> {\n try {\n if (!this.eventsManager) {\n this.eventsManager = await ETEventsManager.getInstance();\n }\n await this.eventsManager.insertBulkEvent(_bulkData);\n } catch (err) {\n throw err;\n }\n }\n\n // NEW CODE\n public async insertQueueEvent(_pushData: BulkEvent): Promise<void> {\n try {\n if (!this.eventsManager) {\n this.eventsManager = await ETEventsManager.getInstance();\n }\n await this.eventsManager.insertQueueEvent(_pushData);\n } catch (err) {\n throw err;\n }\n }\n\n // OLD CODE\n // public async insertBulkEvent(_bulkData: BulkEvent[]): Promise<void> {\n // try {\n // /* if (\n // !sequence ||\n // isEmptyOrBlank(payload) ||\n // isEmptyOrBlank(dspID) ||\n // isEmptyOrBlank(syncType) ||\n // isEmptyOrBlank(objectiveRef)\n // )\n // throw new BaseError(\n // BaseErrorCodes.InvalidArgumentError,\n // InvalidArgumentsError\n // ); */\n // if (!this.eventsManager) {\n // this.eventsManager = await ETEventsManager.getInstance();\n // }\n // await this.eventsManager.insertBulkEvent(_bulkData);\n // } catch (err) {\n // throw err;\n // }\n // }\n\n private checkForInitialization() {\n if (!this.syncHttpClient) {\n throw new BaseError(\n BaseErrorCodes.SyncManagerNotInitialized,\n SyncManagerNotInitialized\n );\n }\n }\n\n public async getObjectiveSummary(objectiveRef: string): Promise<any> {\n if (!objectiveRef) return [];\n if (!this.eventsManager) {\n this.eventsManager = await ETEventsManager.getInstance();\n }\n try {\n let data = await this.eventsManager.getObjectiveDetails(objectiveRef);\n let requiredPayload: any = null;\n for (const row of data) {\n let payload = JSON.parse(row.payload);\n if (payload.status === 'CLOSED') {\n requiredPayload = payload;\n }\n }\n if (requiredPayload) return requiredPayload.data;\n else return null;\n } catch (err: any) {\n Logger.getInstance().logEvent(\n 'getObjectiveSummary',\n err.message,\n LOG_TYPE.SDK_WARNING\n );\n return null;\n }\n }\n\n private async syncEventToServer(\n eventRows: EventRow[],\n syncType: ExecEngineSyncType | DispatchSyncType\n ) {\n try {\n const success = await this.syncHttpClient?.syncEvent(eventRows, syncType);\n\n if (success) {\n this._retries = 0;\n // NEW CODE\n const lastSyncedEventId = await Storage.getInstance().getSharedItem(\n LAST_SYNCED_EVENT_ID\n );\n const syncEventId = parseInt(lastSyncedEventId) + 1;\n await Storage.getInstance().setSharedItem(\n LAST_SYNCED_EVENT_ID,\n `${syncEventId}`\n );\n\n // OLD CODE\n await this.markEventSynced(eventRows);\n } else {\n this._retries++;\n /* Logger.getInstance().logEvent(\n 'syncEventToServer',\n `Syncing Error ${syncType} :- ${JSON.stringify(eventRows)}`,\n LOG_TYPE.SDK_ERROR\n ); */\n await this.updateEventError(eventRows, 'Unexpected error');\n }\n } catch (error: any) {\n this._retries++;\n /* Logger.getInstance().logEvent(\n 'syncEventToServer',\n `Syncing Error ${syncType} :- ${JSON.stringify(eventRows)} -: ${\n error.message\n }`,\n LOG_TYPE.SDK_ERROR\n ); */\n await this.updateEventError(\n eventRows,\n JSON.stringify({\n error,\n })\n );\n }\n }\n\n private async syncBulkEventToServer(\n eventRows: EventRow[],\n lastSyncedEventId: string\n ) {\n try {\n const success = await this.syncHttpClient?.syncBulkEvent(eventRows);\n if (success) {\n this._retries = 0;\n // NEW CODE\n\n const syncEventId = parseInt(lastSyncedEventId) + eventRows.length;\n await Storage.getInstance().setSharedItem(\n LAST_SYNCED_EVENT_ID,\n `${syncEventId}`\n );\n\n // OLD CODE\n await this.markEventSynced(eventRows);\n } else {\n this._retries++;\n /* Logger.getInstance().logEvent(\n 'syncEventToServer',\n `Syncing Error ${syncType} :- ${JSON.stringify(eventRows)}`,\n LOG_TYPE.SDK_ERROR\n ); */\n await this.updateEventError(eventRows, 'Unexpected error');\n }\n } catch (error) {\n this._retries++;\n /* Logger.getInstance().logEvent(\n 'syncEventToServer',\n `Syncing Error ${syncType} :- ${JSON.stringify(eventRows)} -: ${\n error.message\n }`,\n LOG_TYPE.SDK_ERROR\n ); */\n await this.updateEventError(\n eventRows,\n JSON.stringify({\n error,\n })\n );\n }\n }\n\n public async getAllEvents(dspID?: string): Promise<EventRow[]> {\n if (!this.eventsManager)\n this.eventsManager = await ETEventsManager.getInstance();\n return this.eventsManager.getAllEvents(dspID);\n }\n public async clearEventsDB() {\n if (!this.eventsManager)\n this.eventsManager = await ETEventsManager.getInstance();\n await this.eventsManager.deleteAllEvents();\n }\n}\n"],"mappings":";;;AAAA,OAAOA,eAAe,MAAM,mBAAmB;AAO/C,OAAOC,cAAc,MAAM,kBAAkB;AAC7C,SAASC,cAAc,QAAQ,sBAAsB;AACrD,SAASC,SAAS,QAAQ,2BAA2B;AACrD,OAAOC,cAAc,IACnBC,qBAAqB,EACrBC,cAAc,EACdC,yBAAyB,QACpB,4BAA4B;AACnC,OAAOC,WAAW,MAAM,4BAA4B;AACpD,OAAOC,MAAM,IAAIC,QAAQ,QAAQ,uBAAuB;AACxD,SAASC,SAAS,QAAQ,oDAAoD;AAC9E,MAAMC,QAAQ,GAAGD,SAAS,CAACC,QAAQ;AAEnC,OAAOC,gBAAgB,MAAM,4BAA4B;AACzD,OAAOC,OAAO,MAAM,wBAAwB;AAC5C,SAASC,oBAAoB,QAAQ,cAAc;AAEnD,MAAMC,GAAG,GAAG,mBAAmB;AAC/B,eAAe,MAAMC,iBAAiB,CAAC;EASrC,IAAI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