@os1-platform/dispatch-mobile 1.0.8 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +310 -74
- package/android/.gradle/7.0.2/fileChanges/last-build.bin +0 -0
- package/android/.gradle/7.0.2/fileHashes/fileHashes.lock +0 -0
- package/android/.gradle/7.0.2/gc.properties +0 -0
- package/android/.gradle/7.2/dependencies-accessors/dependencies-accessors.lock +0 -0
- package/android/.gradle/7.2/dependencies-accessors/gc.properties +0 -0
- package/android/.gradle/7.2/executionHistory/executionHistory.bin +0 -0
- package/android/.gradle/7.2/executionHistory/executionHistory.lock +0 -0
- package/android/.gradle/7.2/fileChanges/last-build.bin +0 -0
- package/android/.gradle/7.2/fileHashes/fileHashes.bin +0 -0
- package/android/.gradle/7.2/fileHashes/fileHashes.lock +0 -0
- package/android/.gradle/7.2/fileHashes/resourceHashesCache.bin +0 -0
- package/android/.gradle/7.2/gc.properties +0 -0
- package/android/.gradle/buildOutputCleanup/buildOutputCleanup.lock +0 -0
- package/android/.gradle/buildOutputCleanup/cache.properties +2 -0
- package/android/.gradle/buildOutputCleanup/outputFiles.bin +0 -0
- package/android/.gradle/checksums/checksums.lock +0 -0
- package/android/.gradle/checksums/md5-checksums.bin +0 -0
- package/android/.gradle/checksums/sha1-checksums.bin +0 -0
- package/android/.gradle/vcs-1/gc.properties +0 -0
- package/android/.idea/compiler.xml +6 -0
- package/android/.idea/gradle.xml +18 -0
- package/android/.idea/jarRepositories.xml +35 -0
- package/android/.idea/kotlinc.xml +6 -0
- package/android/.idea/misc.xml +9 -0
- package/android/.idea/vcs.xml +6 -0
- package/android/gradle.properties +1 -1
- package/android/local.properties +8 -0
- package/android/src/main/AndroidManifest.xml +0 -1
- package/android/src/main/java/com/dispatchsdk/DispatchSdkPackage.kt +3 -1
- package/android/src/main/java/com/dispatchsdk/sharedPref/SharedPreferenceModule.kt +166 -0
- package/lib/commonjs/@types/assets/index.d.js +2 -0
- package/lib/commonjs/@types/assets/index.d.js.map +1 -0
- package/lib/commonjs/components/dispatch/DispatchExecNavigator.js +50 -43
- package/lib/commonjs/components/dispatch/DispatchExecNavigator.js.map +1 -1
- package/lib/commonjs/components/executiontasks/ExecutionTasksIndex.js +10 -48
- package/lib/commonjs/components/executiontasks/ExecutionTasksIndex.js.map +1 -1
- package/lib/commonjs/components/executiontasks/cancellation/CancelET.js +142 -23
- package/lib/commonjs/components/executiontasks/cancellation/CancelET.js.map +1 -1
- package/lib/commonjs/components/executiontasks/cancellation/CancellationSchema.js.map +1 -1
- package/lib/commonjs/components/executiontasks/captureInput/CaptureText.js +66 -18
- package/lib/commonjs/components/executiontasks/captureInput/CaptureText.js.map +1 -1
- package/lib/commonjs/components/executiontasks/captureInput/utils.js +13 -0
- package/lib/commonjs/components/executiontasks/captureInput/utils.js.map +1 -0
- package/lib/commonjs/components/executiontasks/deliver/DeliverET.js +6 -16
- package/lib/commonjs/components/executiontasks/deliver/DeliverET.js.map +1 -1
- package/lib/commonjs/components/executiontasks/deliver/DeliverETInput.js.map +1 -1
- package/lib/commonjs/components/executiontasks/deliver/SLDeliverET.js +212 -95
- package/lib/commonjs/components/executiontasks/deliver/SLDeliverET.js.map +1 -1
- package/lib/commonjs/components/executiontasks/display/DisplayModalET.js +16 -25
- package/lib/commonjs/components/executiontasks/display/DisplayModalET.js.map +1 -1
- package/lib/commonjs/components/executiontasks/doodle/SignatureET.js +65 -29
- package/lib/commonjs/components/executiontasks/doodle/SignatureET.js.map +1 -1
- package/lib/commonjs/components/executiontasks/dropCash/DropCashET.js +5 -19
- package/lib/commonjs/components/executiontasks/dropCash/DropCashET.js.map +1 -1
- package/lib/commonjs/components/executiontasks/dropCash/SLDropCash.js +74 -30
- package/lib/commonjs/components/executiontasks/dropCash/SLDropCash.js.map +1 -1
- package/lib/commonjs/components/executiontasks/forms/FormGenerator.js +139 -50
- package/lib/commonjs/components/executiontasks/forms/FormGenerator.js.map +1 -1
- package/lib/commonjs/components/executiontasks/forms/widgets/DateTimeWidget.js +3 -26
- package/lib/commonjs/components/executiontasks/forms/widgets/DateTimeWidget.js.map +1 -1
- package/lib/commonjs/components/executiontasks/forms/widgets/DropdownWidget.js +49 -0
- package/lib/commonjs/components/executiontasks/forms/widgets/DropdownWidget.js.map +1 -0
- package/lib/commonjs/components/executiontasks/forms/widgets/QRBarcodeScannerWidget.js +2 -17
- package/lib/commonjs/components/executiontasks/forms/widgets/QRBarcodeScannerWidget.js.map +1 -1
- package/lib/commonjs/components/executiontasks/forms/widgets/TimeRangeSelector.js +0 -10
- package/lib/commonjs/components/executiontasks/forms/widgets/TimeRangeSelector.js.map +1 -1
- package/lib/commonjs/components/executiontasks/httpRequest/HttpEtUtils.js +5 -14
- package/lib/commonjs/components/executiontasks/httpRequest/HttpEtUtils.js.map +1 -1
- package/lib/commonjs/components/executiontasks/httpRequest/HttpRequestET.js +3 -15
- package/lib/commonjs/components/executiontasks/httpRequest/HttpRequestET.js.map +1 -1
- package/lib/commonjs/components/executiontasks/imageCapture/CaptureSchema.js.map +1 -1
- package/lib/commonjs/components/executiontasks/imageCapture/CaptureUtils.js +11 -36
- package/lib/commonjs/components/executiontasks/imageCapture/CaptureUtils.js.map +1 -1
- package/lib/commonjs/components/executiontasks/imageCapture/ImageCapture.js +73 -48
- package/lib/commonjs/components/executiontasks/imageCapture/ImageCapture.js.map +1 -1
- package/lib/commonjs/components/executiontasks/payments/PaymentStyles.js +0 -4
- package/lib/commonjs/components/executiontasks/payments/PaymentStyles.js.map +1 -1
- package/lib/commonjs/components/executiontasks/payments/PaymentUtils.js +0 -2
- package/lib/commonjs/components/executiontasks/payments/PaymentUtils.js.map +1 -1
- package/lib/commonjs/components/executiontasks/payments/completePayment/CompletePaymentET.js +76 -29
- package/lib/commonjs/components/executiontasks/payments/completePayment/CompletePaymentET.js.map +1 -1
- package/lib/commonjs/components/executiontasks/payments/init/InitPaymentET.js +63 -24
- package/lib/commonjs/components/executiontasks/payments/init/InitPaymentET.js.map +1 -1
- package/lib/commonjs/components/executiontasks/payments/processPayment/ProcessPaymentET.js +71 -22
- package/lib/commonjs/components/executiontasks/payments/processPayment/ProcessPaymentET.js.map +1 -1
- package/lib/commonjs/components/executiontasks/pickup/PickupET.js +5 -15
- package/lib/commonjs/components/executiontasks/pickup/PickupET.js.map +1 -1
- package/lib/commonjs/components/executiontasks/pickup/SLPickupET.js +138 -32
- package/lib/commonjs/components/executiontasks/pickup/SLPickupET.js.map +1 -1
- package/lib/commonjs/components/executiontasks/scan/ScanET.js +741 -0
- package/lib/commonjs/components/executiontasks/scan/ScanET.js.map +1 -0
- package/lib/commonjs/components/executiontasks/scan/ScanSchema.js +19 -0
- package/lib/commonjs/components/executiontasks/scan/ScanSchema.js.map +1 -0
- package/lib/commonjs/components/executiontasks/scan/constants.js +19 -0
- package/lib/commonjs/components/executiontasks/scan/constants.js.map +1 -0
- package/lib/commonjs/components/executiontasks/scan/interfaces.js +43 -0
- package/lib/commonjs/components/executiontasks/scan/interfaces.js.map +1 -0
- package/lib/commonjs/components/executiontasks/scan/modalConstant.js +104 -0
- package/lib/commonjs/components/executiontasks/scan/modalConstant.js.map +1 -0
- package/lib/commonjs/components/executiontasks/{scanner → scan/sub_components}/CScanner.js +9 -29
- package/lib/commonjs/components/executiontasks/scan/sub_components/CScanner.js.map +1 -0
- package/lib/commonjs/components/executiontasks/scan/sub_components/DropDownUtils.js +109 -0
- package/lib/commonjs/components/executiontasks/scan/sub_components/DropDownUtils.js.map +1 -0
- package/lib/commonjs/components/executiontasks/{scanner/returns/ReasonDropDown.js → scan/sub_components/ERDropDown.js} +72 -55
- package/lib/commonjs/components/executiontasks/scan/sub_components/ERDropDown.js.map +1 -0
- package/lib/commonjs/components/executiontasks/scan/sub_components/SummaryPage.js +1099 -0
- package/lib/commonjs/components/executiontasks/scan/sub_components/SummaryPage.js.map +1 -0
- package/lib/commonjs/components/executiontasks/scan/utils.js +762 -0
- package/lib/commonjs/components/executiontasks/scan/utils.js.map +1 -0
- package/lib/commonjs/components/executiontasks/validateOTP/ValidateOTPET.js +333 -0
- package/lib/commonjs/components/executiontasks/validateOTP/ValidateOTPET.js.map +1 -0
- package/lib/commonjs/components/executiontasks/validateOTP/ValidateOTPSchema.js +14 -0
- package/lib/commonjs/components/executiontasks/validateOTP/ValidateOTPSchema.js.map +1 -0
- package/lib/commonjs/components/executiontasks/validateOTP/constants.js +37 -0
- package/lib/commonjs/components/executiontasks/validateOTP/constants.js.map +1 -0
- package/lib/commonjs/components/executiontasks/validateOTP/sub-components/OTPInput.js +63 -0
- package/lib/commonjs/components/executiontasks/validateOTP/sub-components/OTPInput.js.map +1 -0
- package/lib/commonjs/components/executiontasks/validateOTP/utils.js +147 -0
- package/lib/commonjs/components/executiontasks/validateOTP/utils.js.map +1 -0
- package/lib/commonjs/components/executiontasks/verifyLocation/GeofenceUtils.js +0 -13
- package/lib/commonjs/components/executiontasks/verifyLocation/GeofenceUtils.js.map +1 -1
- package/lib/commonjs/components/executiontasks/verifyLocation/VerifyLocationET.js +4 -17
- package/lib/commonjs/components/executiontasks/verifyLocation/VerifyLocationET.js.map +1 -1
- package/lib/commonjs/components/executiontasks/verifyOtp/VerifyOtpET.js +3 -18
- package/lib/commonjs/components/executiontasks/verifyOtp/VerifyOtpET.js.map +1 -1
- package/lib/commonjs/components/executiontasks/verifyOtp/VerifyOtpSchema.js.map +1 -1
- package/lib/commonjs/components/utils/index.js +14 -0
- package/lib/commonjs/components/utils/index.js.map +1 -0
- package/lib/commonjs/components/widgets/AlertDisplay.js +0 -5
- package/lib/commonjs/components/widgets/AlertDisplay.js.map +1 -1
- package/lib/commonjs/components/widgets/CancelOrderDialog.js +0 -12
- package/lib/commonjs/components/widgets/CancelOrderDialog.js.map +1 -1
- package/lib/commonjs/components/widgets/Card.js +88 -0
- package/lib/commonjs/components/widgets/Card.js.map +1 -0
- package/lib/commonjs/components/widgets/GoBackModal.js +48 -0
- package/lib/commonjs/components/widgets/GoBackModal.js.map +1 -0
- package/lib/commonjs/components/widgets/IconButton.js +34 -0
- package/lib/commonjs/components/widgets/IconButton.js.map +1 -0
- package/lib/commonjs/components/widgets/ModalWidget.js +99 -0
- package/lib/commonjs/components/widgets/ModalWidget.js.map +1 -0
- package/lib/commonjs/components/widgets/ProgressDialog.js +0 -7
- package/lib/commonjs/components/widgets/ProgressDialog.js.map +1 -1
- package/lib/commonjs/components/widgets/SearchBar.js +74 -0
- package/lib/commonjs/components/widgets/SearchBar.js.map +1 -0
- package/lib/commonjs/components/widgets/SnackBarCustom.js +48 -40
- package/lib/commonjs/components/widgets/SnackBarCustom.js.map +1 -1
- package/lib/commonjs/components/widgets/SplitTextInput.js +93 -0
- package/lib/commonjs/components/widgets/SplitTextInput.js.map +1 -0
- package/lib/commonjs/components/widgets/TabsComponent.js +64 -0
- package/lib/commonjs/components/widgets/TabsComponent.js.map +1 -0
- package/lib/commonjs/components/widgets/Toaster.js +0 -2
- package/lib/commonjs/components/widgets/Toaster.js.map +1 -1
- package/lib/commonjs/config/DispatchSDKConfig.js +4 -5
- package/lib/commonjs/config/DispatchSDKConfig.js.map +1 -1
- package/lib/commonjs/constants/apiConstants.js +17 -0
- package/lib/commonjs/constants/apiConstants.js.map +1 -0
- package/lib/commonjs/constants/constants.js +7 -3
- package/lib/commonjs/constants/constants.js.map +1 -1
- package/lib/commonjs/constants/statuscode.js +3 -5
- package/lib/commonjs/constants/statuscode.js.map +1 -1
- package/lib/commonjs/errors/BaseError.js +3 -8
- package/lib/commonjs/errors/BaseError.js.map +1 -1
- package/lib/commonjs/errors/ErrorCodes.js +7 -6
- package/lib/commonjs/errors/ErrorCodes.js.map +1 -1
- package/lib/commonjs/events/EventDispatcher.js +23 -0
- package/lib/commonjs/events/EventDispatcher.js.map +1 -0
- package/lib/commonjs/events/EventListener.js +20 -0
- package/lib/commonjs/events/EventListener.js.map +1 -0
- package/lib/commonjs/events/constants.js +15 -0
- package/lib/commonjs/events/constants.js.map +1 -0
- package/lib/commonjs/events/index.js +11 -0
- package/lib/commonjs/events/index.js.map +1 -0
- package/lib/commonjs/events/interface.js +2 -0
- package/lib/commonjs/events/interface.js.map +1 -0
- package/lib/commonjs/index.js +40 -35
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/manager/dispatch/DispatchStateContainer.js +328 -272
- package/lib/commonjs/manager/dispatch/DispatchStateContainer.js.map +1 -1
- package/lib/commonjs/manager/dispatchCodes/EventCodeContainer.js +55 -4
- package/lib/commonjs/manager/dispatchCodes/EventCodeContainer.js.map +1 -1
- package/lib/commonjs/manager/dispatchCodes/EventCodeRepo.js +70 -0
- package/lib/commonjs/manager/dispatchCodes/EventCodeRepo.js.map +1 -0
- package/lib/commonjs/manager/dispatchCodes/ReasonCodeContainer.js +3 -29
- package/lib/commonjs/manager/dispatchCodes/ReasonCodeContainer.js.map +1 -1
- package/lib/commonjs/manager/dispatchCodes/ReasonCodeRepo.js +6 -20
- package/lib/commonjs/manager/dispatchCodes/ReasonCodeRepo.js.map +1 -1
- package/lib/commonjs/manager/jobRemoval/JobRemovalManager.js +23 -0
- package/lib/commonjs/manager/jobRemoval/JobRemovalManager.js.map +1 -0
- package/lib/commonjs/manager/location/LocationManager.js +3 -20
- package/lib/commonjs/manager/location/LocationManager.js.map +1 -1
- package/lib/commonjs/manager/sdk/DispatchSDKManager.js +23 -37
- package/lib/commonjs/manager/sdk/DispatchSDKManager.js.map +1 -1
- package/lib/commonjs/manager/sdk/DispatchSdkCache.js +6 -17
- package/lib/commonjs/manager/sdk/DispatchSdkCache.js.map +1 -1
- package/lib/commonjs/manager/sdk/callbacksHandler.js +26 -0
- package/lib/commonjs/manager/sdk/callbacksHandler.js.map +1 -0
- package/lib/commonjs/manager/syncmanager/AppSyncManager.js +26 -46
- package/lib/commonjs/manager/syncmanager/AppSyncManager.js.map +1 -1
- package/lib/commonjs/manager/syncmanager/DBConfig.js +48 -9
- package/lib/commonjs/manager/syncmanager/DBConfig.js.map +1 -1
- package/lib/commonjs/manager/syncmanager/NativeSyncManager.js +0 -2
- package/lib/commonjs/manager/syncmanager/NativeSyncManager.js.map +1 -1
- package/lib/commonjs/manager/syncmanager/constants.js +17 -0
- package/lib/commonjs/manager/syncmanager/constants.js.map +1 -0
- package/lib/commonjs/manager/syncmanager/database.js +28 -12
- package/lib/commonjs/manager/syncmanager/database.js.map +1 -1
- package/lib/commonjs/manager/syncmanager/document/DocumentHttpClient.js +11 -36
- package/lib/commonjs/manager/syncmanager/document/DocumentHttpClient.js.map +1 -1
- package/lib/commonjs/manager/syncmanager/document/DocumentManager.js +8 -26
- package/lib/commonjs/manager/syncmanager/document/DocumentManager.js.map +1 -1
- package/lib/commonjs/manager/syncmanager/document/DocumentSyncManager.js +19 -58
- package/lib/commonjs/manager/syncmanager/document/DocumentSyncManager.js.map +1 -1
- package/lib/commonjs/manager/syncmanager/events/ETEventsManager.js +414 -29
- package/lib/commonjs/manager/syncmanager/events/ETEventsManager.js.map +1 -1
- package/lib/commonjs/manager/syncmanager/events/EventsSyncManager.js +208 -103
- package/lib/commonjs/manager/syncmanager/events/EventsSyncManager.js.map +1 -1
- package/lib/commonjs/manager/syncmanager/events/SyncHttpClient.js +157 -36
- package/lib/commonjs/manager/syncmanager/events/SyncHttpClient.js.map +1 -1
- package/lib/commonjs/models/DispatchModels.js +4 -5
- package/lib/commonjs/models/DispatchModels.js.map +1 -1
- package/lib/commonjs/models/ReasonCodes.js.map +1 -1
- package/lib/commonjs/models/execTasks/ETBaseModels.js +4 -0
- package/lib/commonjs/models/execTasks/ETBaseModels.js.map +1 -1
- package/lib/commonjs/models/execTasks/ETConfig.js +28 -35
- package/lib/commonjs/models/execTasks/ETConfig.js.map +1 -1
- package/lib/commonjs/models/sdk.js +4 -5
- package/lib/commonjs/models/sdk.js.map +1 -1
- package/lib/commonjs/native/signature/SignatureCapture.js +3 -24
- package/lib/commonjs/native/signature/SignatureCapture.js.map +1 -1
- package/lib/commonjs/network/GraphQLClient.js +7 -35
- package/lib/commonjs/network/GraphQLClient.js.map +1 -1
- package/lib/commonjs/network/NetworkClient.js +2 -13
- package/lib/commonjs/network/NetworkClient.js.map +1 -1
- package/lib/commonjs/network/NetworkUtils.js +10 -8
- package/lib/commonjs/network/NetworkUtils.js.map +1 -1
- package/lib/commonjs/network/Queries.js +0 -2
- package/lib/commonjs/network/Queries.js.map +1 -1
- package/lib/commonjs/network/client.js +6 -21
- package/lib/commonjs/network/client.js.map +1 -1
- package/lib/commonjs/res/strings.js.map +1 -1
- package/lib/commonjs/resources/Login.js +4 -15
- package/lib/commonjs/resources/Login.js.map +1 -1
- package/lib/commonjs/resources/network.js +3 -8
- package/lib/commonjs/resources/network.js.map +1 -1
- package/lib/commonjs/styles/SdkColors.js +10 -8
- package/lib/commonjs/styles/SdkColors.js.map +1 -1
- package/lib/commonjs/styles/executionTasks/CommonStyles.js +58 -25
- package/lib/commonjs/styles/executionTasks/CommonStyles.js.map +1 -1
- package/lib/commonjs/ui/screens/CancellationScreen.js +67 -27
- package/lib/commonjs/ui/screens/CancellationScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/CaptureInputScreen.js +15 -16
- package/lib/commonjs/ui/screens/CaptureInputScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/CompleteObjectiveScreen.js +11 -23
- package/lib/commonjs/ui/screens/CompleteObjectiveScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/DeliverScreen.js +30 -17
- package/lib/commonjs/ui/screens/DeliverScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/DisplayScreen.js +17 -13
- package/lib/commonjs/ui/screens/DisplayScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/DoodleScreen.js +17 -20
- package/lib/commonjs/ui/screens/DoodleScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/DropCashScreen.js +43 -31
- package/lib/commonjs/ui/screens/DropCashScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/ETScreensIndex.js +10 -19
- package/lib/commonjs/ui/screens/ETScreensIndex.js.map +1 -1
- package/lib/commonjs/ui/screens/FormsScreen.js +105 -17
- package/lib/commonjs/ui/screens/FormsScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/GeofenceScreen.js +16 -14
- package/lib/commonjs/ui/screens/GeofenceScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/HttpRequestScreen.js +14 -11
- package/lib/commonjs/ui/screens/HttpRequestScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/ImageCaptureScreen.js +38 -17
- package/lib/commonjs/ui/screens/ImageCaptureScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/PaymentScreen.js +28 -29
- package/lib/commonjs/ui/screens/PaymentScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/PickupScreen.js +41 -19
- package/lib/commonjs/ui/screens/PickupScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/ScanScreen.js +121 -0
- package/lib/commonjs/ui/screens/ScanScreen.js.map +1 -0
- package/lib/commonjs/ui/screens/StartWorkFlowScreen.js +64 -38
- package/lib/commonjs/ui/screens/StartWorkFlowScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/ValidateOTPScreen.js +55 -0
- package/lib/commonjs/ui/screens/ValidateOTPScreen.js.map +1 -0
- package/lib/commonjs/ui/screens/WithBaseDispatchScreen.js +0 -10
- package/lib/commonjs/ui/screens/WithBaseDispatchScreen.js.map +1 -1
- package/lib/commonjs/ui/uiConfig/RouteParams.js +24 -1
- package/lib/commonjs/ui/uiConfig/RouteParams.js.map +1 -1
- package/lib/commonjs/utils/ApiUtils.js +129 -0
- package/lib/commonjs/utils/ApiUtils.js.map +1 -0
- package/lib/commonjs/utils/ExecTaskUtils.js +111 -41
- package/lib/commonjs/utils/ExecTaskUtils.js.map +1 -1
- package/lib/commonjs/utils/Logger.js +10 -29
- package/lib/commonjs/utils/Logger.js.map +1 -1
- package/lib/commonjs/utils/NetworkUtil.js +3 -19
- package/lib/commonjs/utils/NetworkUtil.js.map +1 -1
- package/lib/commonjs/utils/SdkUtils.js +2 -31
- package/lib/commonjs/utils/SdkUtils.js.map +1 -1
- package/lib/commonjs/utils/SyncManagerUtils.js +61 -43
- package/lib/commonjs/utils/SyncManagerUtils.js.map +1 -1
- package/lib/commonjs/utils/fcm/FCM.js +59 -11
- package/lib/commonjs/utils/fcm/FCM.js.map +1 -1
- package/lib/commonjs/utils/fcm/FcmUtils.js +82 -21
- package/lib/commonjs/utils/fcm/FcmUtils.js.map +1 -1
- package/lib/commonjs/utils/helper.js +0 -5
- package/lib/commonjs/utils/helper.js.map +1 -1
- package/lib/commonjs/utils/hooks/useModal.js +53 -0
- package/lib/commonjs/utils/hooks/useModal.js.map +1 -0
- package/lib/commonjs/utils/hooks/useTimer.js +44 -0
- package/lib/commonjs/utils/hooks/useTimer.js.map +1 -0
- package/lib/commonjs/utils/loginHelper.js +6 -18
- package/lib/commonjs/utils/loginHelper.js.map +1 -1
- package/lib/commonjs/utils/storage.js +87 -31
- package/lib/commonjs/utils/storage.js.map +1 -1
- package/lib/commonjs/utils/utils.js +8 -11
- package/lib/commonjs/utils/utils.js.map +1 -1
- package/lib/module/@types/assets/index.d.js +2 -0
- package/lib/module/@types/assets/index.d.js.map +1 -0
- package/lib/module/components/dispatch/DispatchExecNavigator.js +50 -32
- package/lib/module/components/dispatch/DispatchExecNavigator.js.map +1 -1
- package/lib/module/components/executiontasks/ExecutionTasksIndex.js +3 -5
- package/lib/module/components/executiontasks/ExecutionTasksIndex.js.map +1 -1
- package/lib/module/components/executiontasks/cancellation/CancelET.js +145 -19
- package/lib/module/components/executiontasks/cancellation/CancelET.js.map +1 -1
- package/lib/module/components/executiontasks/cancellation/CancellationSchema.js.map +1 -1
- package/lib/module/components/executiontasks/captureInput/CaptureText.js +68 -10
- package/lib/module/components/executiontasks/captureInput/CaptureText.js.map +1 -1
- package/lib/module/components/executiontasks/captureInput/utils.js +7 -0
- package/lib/module/components/executiontasks/captureInput/utils.js.map +1 -0
- package/lib/module/components/executiontasks/deliver/DeliverET.js +6 -7
- package/lib/module/components/executiontasks/deliver/DeliverET.js.map +1 -1
- package/lib/module/components/executiontasks/deliver/DeliverETInput.js.map +1 -1
- package/lib/module/components/executiontasks/deliver/SLDeliverET.js +214 -86
- package/lib/module/components/executiontasks/deliver/SLDeliverET.js.map +1 -1
- package/lib/module/components/executiontasks/display/DisplayModalET.js +16 -15
- package/lib/module/components/executiontasks/display/DisplayModalET.js.map +1 -1
- package/lib/module/components/executiontasks/doodle/SignatureET.js +68 -15
- package/lib/module/components/executiontasks/doodle/SignatureET.js.map +1 -1
- package/lib/module/components/executiontasks/dropCash/DropCashET.js +5 -6
- package/lib/module/components/executiontasks/dropCash/DropCashET.js.map +1 -1
- package/lib/module/components/executiontasks/dropCash/SLDropCash.js +75 -20
- package/lib/module/components/executiontasks/dropCash/SLDropCash.js.map +1 -1
- package/lib/module/components/executiontasks/forms/FormGenerator.js +142 -37
- package/lib/module/components/executiontasks/forms/FormGenerator.js.map +1 -1
- package/lib/module/components/executiontasks/forms/widgets/DateTimeWidget.js +3 -15
- package/lib/module/components/executiontasks/forms/widgets/DateTimeWidget.js.map +1 -1
- package/lib/module/components/executiontasks/forms/widgets/DropdownWidget.js +39 -0
- package/lib/module/components/executiontasks/forms/widgets/DropdownWidget.js.map +1 -0
- package/lib/module/components/executiontasks/forms/widgets/QRBarcodeScannerWidget.js +2 -6
- package/lib/module/components/executiontasks/forms/widgets/QRBarcodeScannerWidget.js.map +1 -1
- package/lib/module/components/executiontasks/forms/widgets/TimeRangeSelector.js +0 -3
- package/lib/module/components/executiontasks/forms/widgets/TimeRangeSelector.js.map +1 -1
- package/lib/module/components/executiontasks/httpRequest/HttpEtUtils.js +6 -4
- package/lib/module/components/executiontasks/httpRequest/HttpEtUtils.js.map +1 -1
- package/lib/module/components/executiontasks/httpRequest/HttpRequestET.js +3 -6
- package/lib/module/components/executiontasks/httpRequest/HttpRequestET.js.map +1 -1
- package/lib/module/components/executiontasks/imageCapture/CaptureSchema.js.map +1 -1
- package/lib/module/components/executiontasks/imageCapture/CaptureUtils.js +11 -11
- package/lib/module/components/executiontasks/imageCapture/CaptureUtils.js.map +1 -1
- package/lib/module/components/executiontasks/imageCapture/ImageCapture.js +75 -35
- package/lib/module/components/executiontasks/imageCapture/ImageCapture.js.map +1 -1
- package/lib/module/components/executiontasks/payments/PaymentStyles.js.map +1 -1
- package/lib/module/components/executiontasks/payments/PaymentUtils.js.map +1 -1
- package/lib/module/components/executiontasks/payments/completePayment/CompletePaymentET.js +77 -18
- package/lib/module/components/executiontasks/payments/completePayment/CompletePaymentET.js.map +1 -1
- package/lib/module/components/executiontasks/payments/init/InitPaymentET.js +64 -11
- package/lib/module/components/executiontasks/payments/init/InitPaymentET.js.map +1 -1
- package/lib/module/components/executiontasks/payments/processPayment/ProcessPaymentET.js +72 -11
- package/lib/module/components/executiontasks/payments/processPayment/ProcessPaymentET.js.map +1 -1
- package/lib/module/components/executiontasks/pickup/PickupET.js +5 -6
- package/lib/module/components/executiontasks/pickup/PickupET.js.map +1 -1
- package/lib/module/components/executiontasks/pickup/SLPickupET.js +141 -25
- package/lib/module/components/executiontasks/pickup/SLPickupET.js.map +1 -1
- package/lib/module/components/executiontasks/scan/ScanET.js +732 -0
- package/lib/module/components/executiontasks/scan/ScanET.js.map +1 -0
- package/lib/module/components/executiontasks/scan/ScanSchema.js +17 -0
- package/lib/module/components/executiontasks/scan/ScanSchema.js.map +1 -0
- package/lib/module/components/executiontasks/scan/constants.js +7 -0
- package/lib/module/components/executiontasks/scan/constants.js.map +1 -0
- package/lib/module/components/executiontasks/scan/interfaces.js +33 -0
- package/lib/module/components/executiontasks/scan/interfaces.js.map +1 -0
- package/lib/module/components/executiontasks/scan/modalConstant.js +94 -0
- package/lib/module/components/executiontasks/scan/modalConstant.js.map +1 -0
- package/lib/module/components/executiontasks/{scanner → scan/sub_components}/CScanner.js +9 -16
- package/lib/module/components/executiontasks/scan/sub_components/CScanner.js.map +1 -0
- package/lib/module/components/executiontasks/scan/sub_components/DropDownUtils.js +101 -0
- package/lib/module/components/executiontasks/scan/sub_components/DropDownUtils.js.map +1 -0
- package/lib/module/components/executiontasks/scan/sub_components/ERDropDown.js +107 -0
- package/lib/module/components/executiontasks/scan/sub_components/ERDropDown.js.map +1 -0
- package/lib/module/components/executiontasks/scan/sub_components/SummaryPage.js +1092 -0
- package/lib/module/components/executiontasks/scan/sub_components/SummaryPage.js.map +1 -0
- package/lib/module/components/executiontasks/scan/utils.js +726 -0
- package/lib/module/components/executiontasks/scan/utils.js.map +1 -0
- package/lib/module/components/executiontasks/validateOTP/ValidateOTPET.js +324 -0
- package/lib/module/components/executiontasks/validateOTP/ValidateOTPET.js.map +1 -0
- package/lib/module/components/executiontasks/validateOTP/ValidateOTPSchema.js +8 -0
- package/lib/module/components/executiontasks/validateOTP/ValidateOTPSchema.js.map +1 -0
- package/lib/module/components/executiontasks/validateOTP/constants.js +25 -0
- package/lib/module/components/executiontasks/validateOTP/constants.js.map +1 -0
- package/lib/module/components/executiontasks/validateOTP/sub-components/OTPInput.js +53 -0
- package/lib/module/components/executiontasks/validateOTP/sub-components/OTPInput.js.map +1 -0
- package/lib/module/components/executiontasks/validateOTP/utils.js +133 -0
- package/lib/module/components/executiontasks/validateOTP/utils.js.map +1 -0
- package/lib/module/components/executiontasks/verifyLocation/GeofenceUtils.js +0 -6
- package/lib/module/components/executiontasks/verifyLocation/GeofenceUtils.js.map +1 -1
- package/lib/module/components/executiontasks/verifyLocation/VerifyLocationET.js +4 -3
- package/lib/module/components/executiontasks/verifyLocation/VerifyLocationET.js.map +1 -1
- package/lib/module/components/executiontasks/verifyOtp/VerifyOtpET.js +5 -9
- package/lib/module/components/executiontasks/verifyOtp/VerifyOtpET.js.map +1 -1
- package/lib/module/components/executiontasks/verifyOtp/VerifyOtpSchema.js.map +1 -1
- package/lib/module/components/utils/index.js +8 -0
- package/lib/module/components/utils/index.js.map +1 -0
- package/lib/module/components/widgets/AlertDisplay.js.map +1 -1
- package/lib/module/components/widgets/CancelOrderDialog.js +0 -2
- package/lib/module/components/widgets/CancelOrderDialog.js.map +1 -1
- package/lib/module/components/widgets/Card.js +80 -0
- package/lib/module/components/widgets/Card.js.map +1 -0
- package/lib/module/components/widgets/GoBackModal.js +40 -0
- package/lib/module/components/widgets/GoBackModal.js.map +1 -0
- package/lib/module/components/widgets/IconButton.js +26 -0
- package/lib/module/components/widgets/IconButton.js.map +1 -0
- package/lib/module/components/widgets/ModalWidget.js +92 -0
- package/lib/module/components/widgets/ModalWidget.js.map +1 -0
- package/lib/module/components/widgets/ProgressDialog.js +0 -2
- package/lib/module/components/widgets/ProgressDialog.js.map +1 -1
- package/lib/module/components/widgets/SearchBar.js +66 -0
- package/lib/module/components/widgets/SearchBar.js.map +1 -0
- package/lib/module/components/widgets/SnackBarCustom.js +46 -20
- package/lib/module/components/widgets/SnackBarCustom.js.map +1 -1
- package/lib/module/components/widgets/SplitTextInput.js +84 -0
- package/lib/module/components/widgets/SplitTextInput.js.map +1 -0
- package/lib/module/components/widgets/TabsComponent.js +55 -0
- package/lib/module/components/widgets/TabsComponent.js.map +1 -0
- package/lib/module/components/widgets/Toaster.js.map +1 -1
- package/lib/module/config/DispatchSDKConfig.js +3 -4
- package/lib/module/config/DispatchSDKConfig.js.map +1 -1
- package/lib/module/constants/apiConstants.js +9 -0
- package/lib/module/constants/apiConstants.js.map +1 -0
- package/lib/module/constants/constants.js +4 -2
- package/lib/module/constants/constants.js.map +1 -1
- package/lib/module/constants/statuscode.js +3 -5
- package/lib/module/constants/statuscode.js.map +1 -1
- package/lib/module/errors/BaseError.js +3 -6
- package/lib/module/errors/BaseError.js.map +1 -1
- package/lib/module/errors/ErrorCodes.js +5 -5
- package/lib/module/errors/ErrorCodes.js.map +1 -1
- package/lib/module/events/EventDispatcher.js +16 -0
- package/lib/module/events/EventDispatcher.js.map +1 -0
- package/lib/module/events/EventListener.js +13 -0
- package/lib/module/events/EventListener.js.map +1 -0
- package/lib/module/events/constants.js +8 -0
- package/lib/module/events/constants.js.map +1 -0
- package/lib/module/events/index.js +3 -0
- package/lib/module/events/index.js.map +1 -0
- package/lib/module/events/interface.js +2 -0
- package/lib/module/events/interface.js.map +1 -0
- package/lib/module/index.js +9 -5
- package/lib/module/index.js.map +1 -1
- package/lib/module/manager/dispatch/DispatchStateContainer.js +334 -247
- package/lib/module/manager/dispatch/DispatchStateContainer.js.map +1 -1
- package/lib/module/manager/dispatchCodes/EventCodeContainer.js +52 -2
- package/lib/module/manager/dispatchCodes/EventCodeContainer.js.map +1 -1
- package/lib/module/manager/dispatchCodes/EventCodeRepo.js +61 -0
- package/lib/module/manager/dispatchCodes/EventCodeRepo.js.map +1 -0
- package/lib/module/manager/dispatchCodes/ReasonCodeContainer.js +3 -16
- package/lib/module/manager/dispatchCodes/ReasonCodeContainer.js.map +1 -1
- package/lib/module/manager/dispatchCodes/ReasonCodeRepo.js +6 -14
- package/lib/module/manager/dispatchCodes/ReasonCodeRepo.js.map +1 -1
- package/lib/module/manager/jobRemoval/JobRemovalManager.js +22 -0
- package/lib/module/manager/jobRemoval/JobRemovalManager.js.map +1 -0
- package/lib/module/manager/location/LocationManager.js +3 -14
- package/lib/module/manager/location/LocationManager.js.map +1 -1
- package/lib/module/manager/sdk/DispatchSDKManager.js +23 -15
- package/lib/module/manager/sdk/DispatchSDKManager.js.map +1 -1
- package/lib/module/manager/sdk/DispatchSdkCache.js +6 -13
- package/lib/module/manager/sdk/DispatchSdkCache.js.map +1 -1
- package/lib/module/manager/sdk/callbacksHandler.js +19 -0
- package/lib/module/manager/sdk/callbacksHandler.js.map +1 -0
- package/lib/module/manager/syncmanager/AppSyncManager.js +26 -26
- package/lib/module/manager/syncmanager/AppSyncManager.js.map +1 -1
- package/lib/module/manager/syncmanager/DBConfig.js +41 -7
- package/lib/module/manager/syncmanager/DBConfig.js.map +1 -1
- package/lib/module/manager/syncmanager/NativeSyncManager.js.map +1 -1
- package/lib/module/manager/syncmanager/constants.js +6 -0
- package/lib/module/manager/syncmanager/constants.js.map +1 -0
- package/lib/module/manager/syncmanager/database.js +27 -3
- package/lib/module/manager/syncmanager/database.js.map +1 -1
- package/lib/module/manager/syncmanager/document/DocumentHttpClient.js +11 -24
- package/lib/module/manager/syncmanager/document/DocumentHttpClient.js.map +1 -1
- package/lib/module/manager/syncmanager/document/DocumentManager.js +8 -20
- package/lib/module/manager/syncmanager/document/DocumentManager.js.map +1 -1
- package/lib/module/manager/syncmanager/document/DocumentSyncManager.js +19 -41
- package/lib/module/manager/syncmanager/document/DocumentSyncManager.js.map +1 -1
- package/lib/module/manager/syncmanager/events/ETEventsManager.js +415 -22
- package/lib/module/manager/syncmanager/events/ETEventsManager.js.map +1 -1
- package/lib/module/manager/syncmanager/events/EventsSyncManager.js +209 -82
- package/lib/module/manager/syncmanager/events/EventsSyncManager.js.map +1 -1
- package/lib/module/manager/syncmanager/events/SyncHttpClient.js +152 -24
- package/lib/module/manager/syncmanager/events/SyncHttpClient.js.map +1 -1
- package/lib/module/models/DispatchModels.js +3 -4
- package/lib/module/models/DispatchModels.js.map +1 -1
- package/lib/module/models/ReasonCodes.js.map +1 -1
- package/lib/module/models/execTasks/ETBaseModels.js +1 -1
- package/lib/module/models/execTasks/ETBaseModels.js.map +1 -1
- package/lib/module/models/execTasks/ETConfig.js +22 -29
- package/lib/module/models/execTasks/ETConfig.js.map +1 -1
- package/lib/module/models/sdk.js +3 -4
- package/lib/module/models/sdk.js.map +1 -1
- package/lib/module/native/signature/SignatureCapture.js +3 -18
- package/lib/module/native/signature/SignatureCapture.js.map +1 -1
- package/lib/module/network/GraphQLClient.js +6 -26
- package/lib/module/network/GraphQLClient.js.map +1 -1
- package/lib/module/network/NetworkClient.js +2 -6
- package/lib/module/network/NetworkClient.js.map +1 -1
- package/lib/module/network/NetworkUtils.js +10 -3
- package/lib/module/network/NetworkUtils.js.map +1 -1
- package/lib/module/network/Queries.js.map +1 -1
- package/lib/module/network/client.js +7 -17
- package/lib/module/network/client.js.map +1 -1
- package/lib/module/res/strings.js.map +1 -1
- package/lib/module/resources/Login.js +4 -13
- package/lib/module/resources/Login.js.map +1 -1
- package/lib/module/resources/network.js +3 -6
- package/lib/module/resources/network.js.map +1 -1
- package/lib/module/styles/SdkColors.js +9 -7
- package/lib/module/styles/SdkColors.js.map +1 -1
- package/lib/module/styles/executionTasks/CommonStyles.js +57 -14
- package/lib/module/styles/executionTasks/CommonStyles.js.map +1 -1
- package/lib/module/ui/screens/CancellationScreen.js +68 -15
- package/lib/module/ui/screens/CancellationScreen.js.map +1 -1
- package/lib/module/ui/screens/CaptureInputScreen.js +17 -6
- package/lib/module/ui/screens/CaptureInputScreen.js.map +1 -1
- package/lib/module/ui/screens/CompleteObjectiveScreen.js +12 -8
- package/lib/module/ui/screens/CompleteObjectiveScreen.js.map +1 -1
- package/lib/module/ui/screens/DeliverScreen.js +32 -7
- package/lib/module/ui/screens/DeliverScreen.js.map +1 -1
- package/lib/module/ui/screens/DisplayScreen.js +16 -6
- package/lib/module/ui/screens/DisplayScreen.js.map +1 -1
- package/lib/module/ui/screens/DoodleScreen.js +19 -9
- package/lib/module/ui/screens/DoodleScreen.js.map +1 -1
- package/lib/module/ui/screens/DropCashScreen.js +45 -19
- package/lib/module/ui/screens/DropCashScreen.js.map +1 -1
- package/lib/module/ui/screens/ETScreensIndex.js +3 -2
- package/lib/module/ui/screens/ETScreensIndex.js.map +1 -1
- package/lib/module/ui/screens/FormsScreen.js +104 -9
- package/lib/module/ui/screens/FormsScreen.js.map +1 -1
- package/lib/module/ui/screens/GeofenceScreen.js +15 -6
- package/lib/module/ui/screens/GeofenceScreen.js.map +1 -1
- package/lib/module/ui/screens/HttpRequestScreen.js +15 -5
- package/lib/module/ui/screens/HttpRequestScreen.js.map +1 -1
- package/lib/module/ui/screens/ImageCaptureScreen.js +37 -9
- package/lib/module/ui/screens/ImageCaptureScreen.js.map +1 -1
- package/lib/module/ui/screens/PaymentScreen.js +30 -17
- package/lib/module/ui/screens/PaymentScreen.js.map +1 -1
- package/lib/module/ui/screens/PickupScreen.js +40 -12
- package/lib/module/ui/screens/PickupScreen.js.map +1 -1
- package/lib/module/ui/screens/ScanScreen.js +111 -0
- package/lib/module/ui/screens/ScanScreen.js.map +1 -0
- package/lib/module/ui/screens/StartWorkFlowScreen.js +64 -16
- package/lib/module/ui/screens/StartWorkFlowScreen.js.map +1 -1
- package/lib/module/ui/screens/ValidateOTPScreen.js +45 -0
- package/lib/module/ui/screens/ValidateOTPScreen.js.map +1 -0
- package/lib/module/ui/screens/WithBaseDispatchScreen.js +0 -3
- package/lib/module/ui/screens/WithBaseDispatchScreen.js.map +1 -1
- package/lib/module/ui/uiConfig/RouteParams.js +23 -1
- package/lib/module/ui/uiConfig/RouteParams.js.map +1 -1
- package/lib/module/utils/ApiUtils.js +116 -0
- package/lib/module/utils/ApiUtils.js.map +1 -0
- package/lib/module/utils/ExecTaskUtils.js +110 -31
- package/lib/module/utils/ExecTaskUtils.js.map +1 -1
- package/lib/module/utils/Logger.js +9 -21
- package/lib/module/utils/Logger.js.map +1 -1
- package/lib/module/utils/NetworkUtil.js +3 -15
- package/lib/module/utils/NetworkUtil.js.map +1 -1
- package/lib/module/utils/SdkUtils.js +2 -15
- package/lib/module/utils/SdkUtils.js.map +1 -1
- package/lib/module/utils/SyncManagerUtils.js +62 -14
- package/lib/module/utils/SyncManagerUtils.js.map +1 -1
- package/lib/module/utils/fcm/FCM.js +63 -3
- package/lib/module/utils/fcm/FCM.js.map +1 -1
- package/lib/module/utils/fcm/FcmUtils.js +86 -7
- package/lib/module/utils/fcm/FcmUtils.js.map +1 -1
- package/lib/module/utils/helper.js +0 -3
- package/lib/module/utils/helper.js.map +1 -1
- package/lib/module/utils/hooks/useModal.js +43 -0
- package/lib/module/utils/hooks/useModal.js.map +1 -0
- package/lib/module/utils/hooks/useTimer.js +37 -0
- package/lib/module/utils/hooks/useTimer.js.map +1 -0
- package/lib/module/utils/loginHelper.js +6 -16
- package/lib/module/utils/loginHelper.js.map +1 -1
- package/lib/module/utils/storage.js +86 -29
- package/lib/module/utils/storage.js.map +1 -1
- package/lib/module/utils/utils.js +8 -6
- package/lib/module/utils/utils.js.map +1 -1
- package/lib/typescript/components/dispatch/DispatchExecNavigator.d.ts +2 -2
- package/lib/typescript/components/executiontasks/CompletedWFSchema.d.ts +2 -2
- package/lib/typescript/components/executiontasks/ExecutionTasksIndex.d.ts +6 -7
- package/lib/typescript/components/executiontasks/cancellation/CancelET.d.ts +2 -2
- package/lib/typescript/components/executiontasks/cancellation/CancellationSchema.d.ts +10 -5
- package/lib/typescript/components/executiontasks/captureInput/CaptureInputSchema.d.ts +7 -7
- package/lib/typescript/components/executiontasks/captureInput/CaptureText.d.ts +2 -2
- package/lib/typescript/components/executiontasks/captureInput/utils.d.ts +1 -0
- package/lib/typescript/components/executiontasks/deliver/DeliverET.d.ts +2 -2
- package/lib/typescript/components/executiontasks/deliver/DeliverETInput.d.ts +8 -7
- package/lib/typescript/components/executiontasks/deliver/SLDeliverET.d.ts +3 -3
- package/lib/typescript/components/executiontasks/display/DisplayModalET.d.ts +2 -2
- package/lib/typescript/components/executiontasks/display/DisplaySchema.d.ts +5 -5
- package/lib/typescript/components/executiontasks/doodle/SignatureET.d.ts +2 -2
- package/lib/typescript/components/executiontasks/doodle/SignatureSchema.d.ts +7 -7
- package/lib/typescript/components/executiontasks/dropCash/DropCashET.d.ts +2 -2
- package/lib/typescript/components/executiontasks/dropCash/DropCashSchema.d.ts +2 -2
- package/lib/typescript/components/executiontasks/dropCash/SLDropCash.d.ts +2 -2
- package/lib/typescript/components/executiontasks/forms/FormGenerator.d.ts +2 -2
- package/lib/typescript/components/executiontasks/forms/FormSchema.d.ts +2 -2
- package/lib/typescript/components/executiontasks/forms/widgets/DateTimeWidget.d.ts +3 -3
- package/lib/typescript/components/executiontasks/forms/widgets/DropdownWidget.d.ts +9 -0
- package/lib/typescript/components/executiontasks/forms/widgets/QRBarcodeScannerWidget.d.ts +2 -2
- package/lib/typescript/components/executiontasks/forms/widgets/TimeRangeSelector.d.ts +2 -2
- package/lib/typescript/components/executiontasks/httpRequest/HttpEtUtils.d.ts +1 -1
- package/lib/typescript/components/executiontasks/httpRequest/HttpRequestET.d.ts +2 -2
- package/lib/typescript/components/executiontasks/httpRequest/HttpRequestETSchema.d.ts +6 -6
- package/lib/typescript/components/executiontasks/imageCapture/CaptureSchema.d.ts +17 -11
- package/lib/typescript/components/executiontasks/imageCapture/ImageCapture.d.ts +2 -2
- package/lib/typescript/components/executiontasks/payments/completePayment/CompletePaymentET.d.ts +2 -2
- package/lib/typescript/components/executiontasks/payments/completePayment/CompletePaymentSchema.d.ts +2 -2
- package/lib/typescript/components/executiontasks/payments/init/InitPaymentET.d.ts +2 -2
- package/lib/typescript/components/executiontasks/payments/init/InitPaymentSchema.d.ts +3 -3
- package/lib/typescript/components/executiontasks/payments/processPayment/ProcessPaymentET.d.ts +2 -2
- package/lib/typescript/components/executiontasks/payments/processPayment/ProcessPaymentSchema.d.ts +2 -2
- package/lib/typescript/components/executiontasks/pickup/PickpSchema.d.ts +3 -3
- package/lib/typescript/components/executiontasks/pickup/PickupET.d.ts +2 -2
- package/lib/typescript/components/executiontasks/pickup/SLPickupET.d.ts +3 -3
- package/lib/typescript/components/executiontasks/scan/ScanET.d.ts +16 -0
- package/lib/typescript/components/executiontasks/scan/ScanSchema.d.ts +86 -0
- package/lib/typescript/components/executiontasks/scan/constants.d.ts +6 -0
- package/lib/typescript/components/executiontasks/scan/interfaces.d.ts +94 -0
- package/lib/typescript/components/executiontasks/scan/modalConstant.d.ts +37 -0
- package/lib/typescript/components/executiontasks/{scanner → scan/sub_components}/CScanner.d.ts +1 -1
- package/lib/typescript/components/executiontasks/scan/sub_components/DropDownUtils.d.ts +7 -0
- package/lib/typescript/components/executiontasks/scan/sub_components/ERDropDown.d.ts +17 -0
- package/lib/typescript/components/executiontasks/scan/sub_components/SummaryPage.d.ts +21 -0
- package/lib/typescript/components/executiontasks/scan/utils.d.ts +37 -0
- package/lib/typescript/components/executiontasks/validateOTP/ValidateOTPET.d.ts +4 -0
- package/lib/typescript/components/executiontasks/validateOTP/ValidateOTPSchema.d.ts +54 -0
- package/lib/typescript/components/executiontasks/validateOTP/constants.d.ts +10 -0
- package/lib/typescript/components/executiontasks/validateOTP/sub-components/OTPInput.d.ts +12 -0
- package/lib/typescript/components/executiontasks/validateOTP/utils.d.ts +7 -0
- package/lib/typescript/components/executiontasks/verifyInput/VerifyInputSchema.d.ts +8 -8
- package/lib/typescript/components/executiontasks/verifyLocation/VerifyLocSchema.d.ts +9 -9
- package/lib/typescript/components/executiontasks/verifyLocation/VerifyLocationET.d.ts +2 -2
- package/lib/typescript/components/executiontasks/verifyOtp/VerifyOtpET.d.ts +2 -2
- package/lib/typescript/components/executiontasks/verifyOtp/VerifyOtpSchema.d.ts +6 -6
- package/lib/typescript/components/utils/index.d.ts +2 -0
- package/lib/typescript/components/widgets/CancelOrderDialog.d.ts +2 -2
- package/lib/typescript/components/widgets/Card.d.ts +17 -0
- package/lib/typescript/components/widgets/GoBackModal.d.ts +9 -0
- package/lib/typescript/components/widgets/IconButton.d.ts +9 -0
- package/lib/typescript/components/widgets/ModalWidget.d.ts +30 -0
- package/lib/typescript/components/widgets/ProgressDialog.d.ts +2 -2
- package/lib/typescript/components/widgets/SearchBar.d.ts +10 -0
- package/lib/typescript/components/widgets/SnackBarCustom.d.ts +10 -5
- package/lib/typescript/components/widgets/SplitTextInput.d.ts +12 -0
- package/lib/typescript/components/widgets/TabsComponent.d.ts +15 -0
- package/lib/typescript/constants/apiConstants.d.ts +7 -0
- package/lib/typescript/constants/constants.d.ts +4 -2
- package/lib/typescript/errors/ErrorCodes.d.ts +3 -1
- package/lib/typescript/events/EventDispatcher.d.ts +3 -0
- package/lib/typescript/events/EventListener.d.ts +5 -0
- package/lib/typescript/events/constants.d.ts +7 -0
- package/lib/typescript/events/index.d.ts +2 -0
- package/lib/typescript/events/interface.d.ts +1 -0
- package/lib/typescript/index.d.ts +12 -9
- package/lib/typescript/manager/dispatch/DispatchStateContainer.d.ts +38 -17
- package/lib/typescript/manager/dispatchCodes/EventCodeContainer.d.ts +12 -1
- package/lib/typescript/manager/dispatchCodes/EventCodeRepo.d.ts +13 -0
- package/lib/typescript/manager/jobRemoval/JobRemovalManager.d.ts +0 -0
- package/lib/typescript/manager/sdk/DispatchSdkCache.d.ts +1 -0
- package/lib/typescript/manager/sdk/callbacksHandler.d.ts +13 -0
- package/lib/typescript/manager/syncmanager/AppSyncManager.d.ts +3 -1
- package/lib/typescript/manager/syncmanager/DBConfig.d.ts +80 -4
- package/lib/typescript/manager/syncmanager/constants.d.ts +5 -0
- package/lib/typescript/manager/syncmanager/database.d.ts +5 -0
- package/lib/typescript/manager/syncmanager/document/DocumentManager.d.ts +1 -1
- package/lib/typescript/manager/syncmanager/document/DocumentSyncManager.d.ts +1 -1
- package/lib/typescript/manager/syncmanager/document/models.d.ts +1 -1
- package/lib/typescript/manager/syncmanager/events/ETEventsManager.d.ts +15 -2
- package/lib/typescript/manager/syncmanager/events/EventsSyncManager.d.ts +4 -2
- package/lib/typescript/manager/syncmanager/events/SyncHttpClient.d.ts +6 -3
- package/lib/typescript/models/DispatchModels.d.ts +59 -5
- package/lib/typescript/models/ReasonCodes.d.ts +5 -0
- package/lib/typescript/models/auth.d.ts +1 -1
- package/lib/typescript/models/execTasks/ETBaseModels.d.ts +44 -20
- package/lib/typescript/models/execTasks/ETConfig.d.ts +8 -4
- package/lib/typescript/models/sdk.d.ts +12 -0
- package/lib/typescript/native/signature/SignatureCapture.d.ts +2 -2
- package/lib/typescript/network/NetworkUtils.d.ts +1 -5
- package/lib/typescript/styles/SdkColors.d.ts +2 -0
- package/lib/typescript/styles/executionTasks/CommonStyles.d.ts +50 -5
- package/lib/typescript/ui/screens/CancellationScreen.d.ts +2 -2
- package/lib/typescript/ui/screens/CaptureInputScreen.d.ts +2 -2
- package/lib/typescript/ui/screens/CompleteObjectiveScreen.d.ts +2 -2
- package/lib/typescript/ui/screens/DeliverScreen.d.ts +2 -2
- package/lib/typescript/ui/screens/DisplayScreen.d.ts +2 -2
- package/lib/typescript/ui/screens/DoodleScreen.d.ts +2 -2
- package/lib/typescript/ui/screens/DropCashScreen.d.ts +2 -2
- package/lib/typescript/ui/screens/ETScreensIndex.d.ts +3 -2
- package/lib/typescript/ui/screens/FormsScreen.d.ts +2 -2
- package/lib/typescript/ui/screens/GeofenceScreen.d.ts +2 -2
- package/lib/typescript/ui/screens/HttpRequestScreen.d.ts +1 -1
- package/lib/typescript/ui/screens/ImageCaptureScreen.d.ts +2 -2
- package/lib/typescript/ui/screens/PaymentScreen.d.ts +2 -2
- package/lib/typescript/ui/screens/PickupScreen.d.ts +2 -2
- package/lib/typescript/ui/screens/ScanScreen.d.ts +3 -0
- package/lib/typescript/ui/screens/StartWorkFlowScreen.d.ts +2 -2
- package/lib/typescript/ui/screens/ValidateOTPScreen.d.ts +3 -0
- package/lib/typescript/ui/screens/WithBaseDispatchScreen.d.ts +2 -2
- package/lib/typescript/ui/uiConfig/RouteParams.d.ts +14 -0
- package/lib/typescript/utils/ApiUtils.d.ts +61 -0
- package/lib/typescript/utils/ExecTaskUtils.d.ts +10 -4
- package/lib/typescript/utils/NetworkUtil.d.ts +1 -1
- package/lib/typescript/utils/SyncManagerUtils.d.ts +4 -3
- package/lib/typescript/utils/hooks/useModal.d.ts +6 -0
- package/lib/typescript/utils/hooks/useTimer.d.ts +5 -0
- package/lib/typescript/utils/storage.d.ts +32 -0
- package/package.json +26 -26
- package/tsconfig.json +9 -9
- package/file_unzip.js +0 -5
- package/lib/commonjs/components/executiontasks/doodle/DoodleUtils.js +0 -28
- package/lib/commonjs/components/executiontasks/doodle/DoodleUtils.js.map +0 -1
- package/lib/commonjs/components/executiontasks/scanner/CScanner.js.map +0 -1
- package/lib/commonjs/components/executiontasks/scanner/ScannerSchema.js +0 -32
- package/lib/commonjs/components/executiontasks/scanner/ScannerSchema.js.map +0 -1
- package/lib/commonjs/components/executiontasks/scanner/ScannerUtils.js +0 -193
- package/lib/commonjs/components/executiontasks/scanner/ScannerUtils.js.map +0 -1
- package/lib/commonjs/components/executiontasks/scanner/returns/DropDownSelector.js +0 -20
- package/lib/commonjs/components/executiontasks/scanner/returns/DropDownSelector.js.map +0 -1
- package/lib/commonjs/components/executiontasks/scanner/returns/DropDownUtils.js +0 -49
- package/lib/commonjs/components/executiontasks/scanner/returns/DropDownUtils.js.map +0 -1
- package/lib/commonjs/components/executiontasks/scanner/returns/RTReasonSelection.js +0 -107
- package/lib/commonjs/components/executiontasks/scanner/returns/RTReasonSelection.js.map +0 -1
- package/lib/commonjs/components/executiontasks/scanner/returns/RTScan.js +0 -317
- package/lib/commonjs/components/executiontasks/scanner/returns/RTScan.js.map +0 -1
- package/lib/commonjs/components/executiontasks/scanner/returns/ReasonDropDown.js.map +0 -1
- package/lib/commonjs/components/executiontasks/scanner/returns/ScanList.js +0 -276
- package/lib/commonjs/components/executiontasks/scanner/returns/ScanList.js.map +0 -1
- package/lib/commonjs/ui/screens/RTScanScreen.js +0 -118
- package/lib/commonjs/ui/screens/RTScanScreen.js.map +0 -1
- package/lib/module/components/executiontasks/doodle/DoodleUtils.js +0 -19
- package/lib/module/components/executiontasks/doodle/DoodleUtils.js.map +0 -1
- package/lib/module/components/executiontasks/scanner/CScanner.js.map +0 -1
- package/lib/module/components/executiontasks/scanner/ScannerSchema.js +0 -24
- package/lib/module/components/executiontasks/scanner/ScannerSchema.js.map +0 -1
- package/lib/module/components/executiontasks/scanner/ScannerUtils.js +0 -158
- package/lib/module/components/executiontasks/scanner/ScannerUtils.js.map +0 -1
- package/lib/module/components/executiontasks/scanner/returns/DropDownSelector.js +0 -9
- package/lib/module/components/executiontasks/scanner/returns/DropDownSelector.js.map +0 -1
- package/lib/module/components/executiontasks/scanner/returns/DropDownUtils.js +0 -38
- package/lib/module/components/executiontasks/scanner/returns/DropDownUtils.js.map +0 -1
- package/lib/module/components/executiontasks/scanner/returns/RTReasonSelection.js +0 -86
- package/lib/module/components/executiontasks/scanner/returns/RTReasonSelection.js.map +0 -1
- package/lib/module/components/executiontasks/scanner/returns/RTScan.js +0 -287
- package/lib/module/components/executiontasks/scanner/returns/RTScan.js.map +0 -1
- package/lib/module/components/executiontasks/scanner/returns/ReasonDropDown.js +0 -80
- package/lib/module/components/executiontasks/scanner/returns/ReasonDropDown.js.map +0 -1
- package/lib/module/components/executiontasks/scanner/returns/ScanList.js +0 -253
- package/lib/module/components/executiontasks/scanner/returns/ScanList.js.map +0 -1
- package/lib/module/ui/screens/RTScanScreen.js +0 -93
- package/lib/module/ui/screens/RTScanScreen.js.map +0 -1
- package/lib/typescript/components/executiontasks/doodle/DoodleUtils.d.ts +0 -3
- package/lib/typescript/components/executiontasks/scanner/ScannerSchema.d.ts +0 -75
- package/lib/typescript/components/executiontasks/scanner/ScannerUtils.d.ts +0 -15
- package/lib/typescript/components/executiontasks/scanner/returns/DropDownSelector.d.ts +0 -3
- package/lib/typescript/components/executiontasks/scanner/returns/DropDownUtils.d.ts +0 -3
- package/lib/typescript/components/executiontasks/scanner/returns/RTReasonSelection.d.ts +0 -7
- package/lib/typescript/components/executiontasks/scanner/returns/RTScan.d.ts +0 -4
- package/lib/typescript/components/executiontasks/scanner/returns/ReasonDropDown.d.ts +0 -14
- package/lib/typescript/components/executiontasks/scanner/returns/ScanList.d.ts +0 -17
- package/lib/typescript/ui/screens/RTScanScreen.d.ts +0 -3
- package/mobile-execution-lib-0.6.4.tgz +0 -0
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
// TODO: Move to execution-engine for Job Removal Manager
|
|
2
|
+
|
|
3
|
+
// const dispatchExecutor = new ExecutionEngine();
|
|
4
|
+
|
|
5
|
+
// export default class JobRemovalManager {
|
|
6
|
+
// private static instance: JobRemovalManager;
|
|
7
|
+
|
|
8
|
+
// private constructor() {}
|
|
9
|
+
|
|
10
|
+
// public static getInstance(): JobRemovalManager {
|
|
11
|
+
// if (!JobRemovalManager.instance) {
|
|
12
|
+
// let managerInstance = new JobRemovalManager();
|
|
13
|
+
// JobRemovalManager.instance = managerInstance;
|
|
14
|
+
// }
|
|
15
|
+
// return JobRemovalManager.instance;
|
|
16
|
+
// }
|
|
17
|
+
|
|
18
|
+
// public async handleRemoval(dispatchId: string, jobs: string[]) {
|
|
19
|
+
// return await dispatchExecutor.validateJobRemoval(dispatchId, jobs);
|
|
20
|
+
// }
|
|
21
|
+
// }
|
|
22
|
+
//# sourceMappingURL=JobRemovalManager.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sources":["JobRemovalManager.ts"],"sourcesContent":["// TODO: Move to execution-engine for Job Removal Manager\n\n// const dispatchExecutor = new ExecutionEngine();\n\n// export default class JobRemovalManager {\n// private static instance: JobRemovalManager;\n\n// private constructor() {}\n\n// public static getInstance(): JobRemovalManager {\n// if (!JobRemovalManager.instance) {\n// let managerInstance = new JobRemovalManager();\n// JobRemovalManager.instance = managerInstance;\n// }\n// return JobRemovalManager.instance;\n// }\n\n// public async handleRemoval(dispatchId: string, jobs: string[]) {\n// return await dispatchExecutor.validateJobRemoval(dispatchId, jobs);\n// }\n// }\n"],"mappings":"AAAA;;AAEA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA"}
|
|
@@ -1,18 +1,16 @@
|
|
|
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 * as Location from 'expo-location';
|
|
4
5
|
import { Accuracy } from 'expo-location';
|
|
5
6
|
import Logger, { LOG_TYPE } from '../../utils/Logger';
|
|
6
7
|
export default class LocationManager {
|
|
7
8
|
constructor() {
|
|
8
9
|
_defineProperty(this, "lastLocation", null);
|
|
9
|
-
|
|
10
10
|
_defineProperty(this, "stopUpdate", void 0);
|
|
11
11
|
}
|
|
12
|
-
|
|
13
12
|
async checkForLocationPermissions() {
|
|
14
13
|
let permissionResponse = await Location.getForegroundPermissionsAsync();
|
|
15
|
-
|
|
16
14
|
if (permissionResponse.status === 'granted') {
|
|
17
15
|
this.startUpdates();
|
|
18
16
|
return true;
|
|
@@ -20,7 +18,6 @@ export default class LocationManager {
|
|
|
20
18
|
let {
|
|
21
19
|
status
|
|
22
20
|
} = await Location.requestForegroundPermissionsAsync();
|
|
23
|
-
|
|
24
21
|
if (status === 'granted') {
|
|
25
22
|
this.startUpdates();
|
|
26
23
|
return true;
|
|
@@ -30,22 +27,18 @@ export default class LocationManager {
|
|
|
30
27
|
}
|
|
31
28
|
}
|
|
32
29
|
}
|
|
33
|
-
|
|
34
30
|
static getInstance() {
|
|
35
31
|
if (!LocationManager.instance) {
|
|
36
32
|
LocationManager.instance = new LocationManager();
|
|
37
33
|
}
|
|
38
|
-
|
|
39
34
|
return LocationManager.instance;
|
|
40
35
|
}
|
|
41
|
-
|
|
42
36
|
startUpdates() {
|
|
43
37
|
Location.watchPositionAsync({
|
|
44
38
|
accuracy: Accuracy.Highest,
|
|
45
39
|
timeInterval: 10000,
|
|
46
40
|
// in millis
|
|
47
41
|
distanceInterval: 10 //in metres
|
|
48
|
-
|
|
49
42
|
}, location => {
|
|
50
43
|
if (location != null) {
|
|
51
44
|
this.lastLocation = location;
|
|
@@ -56,7 +49,6 @@ export default class LocationManager {
|
|
|
56
49
|
Logger.getInstance().logEvent('LOCATION_MANAGER', error.message, LOG_TYPE.SDK_WARNING);
|
|
57
50
|
});
|
|
58
51
|
}
|
|
59
|
-
|
|
60
52
|
getLastLocation() {
|
|
61
53
|
if (this.lastLocation != null && this.lastLocation.coords != null) {
|
|
62
54
|
return {
|
|
@@ -70,14 +62,11 @@ export default class LocationManager {
|
|
|
70
62
|
};
|
|
71
63
|
}
|
|
72
64
|
}
|
|
73
|
-
|
|
74
65
|
stopLocationUpdates() {
|
|
75
66
|
try {
|
|
76
67
|
if (this.stopUpdate) this.stopUpdate.remove();
|
|
77
68
|
} catch (error) {}
|
|
78
69
|
}
|
|
79
|
-
|
|
80
70
|
}
|
|
81
|
-
|
|
82
71
|
_defineProperty(LocationManager, "instance", void 0);
|
|
83
72
|
//# sourceMappingURL=LocationManager.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["Location","Accuracy","Logger","LOG_TYPE","LocationManager","checkForLocationPermissions","permissionResponse","getForegroundPermissionsAsync","status","startUpdates","requestForegroundPermissionsAsync","stopLocationUpdates","getInstance","instance","watchPositionAsync","accuracy","Highest","timeInterval","distanceInterval","location","lastLocation","then","r","stopUpdate","catch","error","logEvent","message","SDK_WARNING","getLastLocation","coords","latitude","toString","longitude","remove"],"sources":["LocationManager.ts"],"sourcesContent":["import * as Location from 'expo-location';\nimport { Accuracy, LocationObject } from 'expo-location';\nimport Logger, { LOG_TYPE } from '../../utils/Logger';\n\nexport default class LocationManager {\n private static instance: LocationManager;\n private lastLocation: LocationObject | null = null;\n private stopUpdate: { remove(): void } | undefined;\n\n public async checkForLocationPermissions(): Promise<boolean> {\n let permissionResponse = await Location.getForegroundPermissionsAsync();\n if (permissionResponse.status === 'granted') {\n this.startUpdates();\n return true;\n } else {\n let { status } = await Location.requestForegroundPermissionsAsync();\n if (status === 'granted') {\n this.startUpdates();\n return true;\n } else {\n this.stopLocationUpdates();\n return false;\n }\n }\n }\n\n public static getInstance(): LocationManager {\n if (!LocationManager.instance) {\n LocationManager.instance = new LocationManager();\n }\n return LocationManager.instance;\n }\n public startUpdates() {\n Location.watchPositionAsync(\n {\n accuracy: Accuracy.Highest,\n timeInterval: 10000, // in millis\n distanceInterval: 10, //in metres\n },\n (location) => {\n if (location != null) {\n this.lastLocation = location;\n }\n }\n )\n .then((r) => {\n this.stopUpdate = r;\n })\n .catch((error) => {\n Logger.getInstance().logEvent(\n 'LOCATION_MANAGER',\n error.message,\n LOG_TYPE.SDK_WARNING\n );\n });\n }\n public getLastLocation(): DLocation {\n if (this.lastLocation != null && this.lastLocation.coords != null) {\n return {\n latitude: this.lastLocation.coords.latitude.toString(),\n longitude: this.lastLocation.coords.longitude.toString(),\n };\n } else {\n return { latitude: 'null', longitude: 'null' };\n }\n }\n public stopLocationUpdates() {\n try {\n if (this.stopUpdate) this.stopUpdate.remove();\n } catch (error: any) {}\n }\n}\n\nexport interface DLocation {\n latitude: string;\n longitude: string;\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"names":["Location","Accuracy","Logger","LOG_TYPE","LocationManager","constructor","_defineProperty","checkForLocationPermissions","permissionResponse","getForegroundPermissionsAsync","status","startUpdates","requestForegroundPermissionsAsync","stopLocationUpdates","getInstance","instance","watchPositionAsync","accuracy","Highest","timeInterval","distanceInterval","location","lastLocation","then","r","stopUpdate","catch","error","logEvent","message","SDK_WARNING","getLastLocation","coords","latitude","toString","longitude","remove"],"sources":["LocationManager.ts"],"sourcesContent":["import * as Location from 'expo-location';\nimport { Accuracy, LocationObject } from 'expo-location';\nimport Logger, { LOG_TYPE } from '../../utils/Logger';\n\nexport default class LocationManager {\n private static instance: LocationManager;\n private lastLocation: LocationObject | null = null;\n private stopUpdate: { remove(): void } | undefined;\n\n public async checkForLocationPermissions(): Promise<boolean> {\n let permissionResponse = await Location.getForegroundPermissionsAsync();\n if (permissionResponse.status === 'granted') {\n this.startUpdates();\n return true;\n } else {\n let { status } = await Location.requestForegroundPermissionsAsync();\n if (status === 'granted') {\n this.startUpdates();\n return true;\n } else {\n this.stopLocationUpdates();\n return false;\n }\n }\n }\n\n public static getInstance(): LocationManager {\n if (!LocationManager.instance) {\n LocationManager.instance = new LocationManager();\n }\n return LocationManager.instance;\n }\n public startUpdates() {\n Location.watchPositionAsync(\n {\n accuracy: Accuracy.Highest,\n timeInterval: 10000, // in millis\n distanceInterval: 10, //in metres\n },\n (location) => {\n if (location != null) {\n this.lastLocation = location;\n }\n }\n )\n .then((r) => {\n this.stopUpdate = r;\n })\n .catch((error) => {\n Logger.getInstance().logEvent(\n 'LOCATION_MANAGER',\n error.message,\n LOG_TYPE.SDK_WARNING\n );\n });\n }\n public getLastLocation(): DLocation {\n if (this.lastLocation != null && this.lastLocation.coords != null) {\n return {\n latitude: this.lastLocation.coords.latitude.toString(),\n longitude: this.lastLocation.coords.longitude.toString(),\n };\n } else {\n return { latitude: 'null', longitude: 'null' };\n }\n }\n public stopLocationUpdates() {\n try {\n if (this.stopUpdate) this.stopUpdate.remove();\n } catch (error: any) {}\n }\n}\n\nexport interface DLocation {\n latitude: string;\n longitude: string;\n}\n"],"mappings":";;;AAAA,OAAO,KAAKA,QAAQ,MAAM,eAAe;AACzC,SAASC,QAAQ,QAAwB,eAAe;AACxD,OAAOC,MAAM,IAAIC,QAAQ,QAAQ,oBAAoB;AAErD,eAAe,MAAMC,eAAe,CAAC;EAAAC,YAAA;IAAAC,eAAA,uBAEW,IAAI;IAAAA,eAAA;EAAA;EAGlD,MAAaC,2BAA2BA,CAAA,EAAqB;IAC3D,IAAIC,kBAAkB,GAAG,MAAMR,QAAQ,CAACS,6BAA6B,CAAC,CAAC;IACvE,IAAID,kBAAkB,CAACE,MAAM,KAAK,SAAS,EAAE;MAC3C,IAAI,CAACC,YAAY,CAAC,CAAC;MACnB,OAAO,IAAI;IACb,CAAC,MAAM;MACL,IAAI;QAAED;MAAO,CAAC,GAAG,MAAMV,QAAQ,CAACY,iCAAiC,CAAC,CAAC;MACnE,IAAIF,MAAM,KAAK,SAAS,EAAE;QACxB,IAAI,CAACC,YAAY,CAAC,CAAC;QACnB,OAAO,IAAI;MACb,CAAC,MAAM;QACL,I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AmBA,CAAA,EAAG;IAC3B,IAAI;MACF,IAAI,IAAI,CAACY,UAAU,EAAE,IAAI,CAACA,UAAU,CAACW,MAAM,CAAC,CAAC;IAC/C,CAAC,CAAC,OAAOT,KAAU,EAAE,CAAC;EACxB;AACF;AAACrB,eAAA,CAnEoBF,eAAe"}
|
|
@@ -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 DispatchSdkCache from './DispatchSdkCache';
|
|
4
5
|
import LocationManager from '../location/LocationManager';
|
|
5
6
|
import AppSyncManager from '../syncmanager/AppSyncManager';
|
|
@@ -11,37 +12,35 @@ import { BaseError } from '../../errors/BaseError';
|
|
|
11
12
|
import ErrorCodes from '../../errors/ErrorCodes';
|
|
12
13
|
import SdkUtils from '../../utils/SdkUtils';
|
|
13
14
|
import * as Sentry from '@sentry/react-native';
|
|
15
|
+
import EventCodeRepo from '../dispatchCodes/EventCodeRepo';
|
|
16
|
+
import Storage from '../../utils/storage';
|
|
17
|
+
import { pushBulkEventForSync } from '../../utils/SyncManagerUtils';
|
|
18
|
+
import callbackHandler from './callbacksHandler';
|
|
19
|
+
import { DispatchExecutor as dispatchExecutor } from '@os1-platform/platform-coreos-execution-engine-sdk';
|
|
14
20
|
export class DispatchSDKManager {
|
|
15
21
|
constructor() {
|
|
16
22
|
_defineProperty(this, "cache", DispatchSdkCache.getInstance());
|
|
17
|
-
|
|
18
23
|
_defineProperty(this, "keys", DispatchSdkCache.KEYS);
|
|
19
24
|
}
|
|
20
|
-
|
|
21
25
|
static getInstance() {
|
|
22
26
|
if (!DispatchSDKManager.instance) {
|
|
23
27
|
DispatchSDKManager.instance = new DispatchSDKManager();
|
|
24
28
|
}
|
|
25
|
-
|
|
26
29
|
return DispatchSDKManager.instance;
|
|
27
30
|
}
|
|
31
|
+
|
|
28
32
|
/**
|
|
29
33
|
* Call this init method with username,userID & authentication tokens
|
|
30
34
|
* @param sdkConfig
|
|
31
35
|
*/
|
|
32
|
-
|
|
33
|
-
|
|
34
36
|
async initDispatchSDK(sdkConfig) {
|
|
35
|
-
var _sdkConfig$sentry;
|
|
36
|
-
|
|
37
|
+
var _sdkConfig$sentry, _sdkConfig$callbacks;
|
|
37
38
|
if (!isMandatoryKeysPresent(sdkConfig, ['tenantID', 'userID', 'userName', 'tenantBaseURL', 'accessToken'])) {
|
|
38
39
|
throw new BaseError(ErrorCodes.InvalidArgumentError, 'Invalid/Missing Argument Passed in SdkConfig');
|
|
39
40
|
}
|
|
40
|
-
|
|
41
41
|
if (isTokenExpired(sdkConfig.accessToken)) {
|
|
42
42
|
throw new BaseError(ErrorCodes.ACCESS_TOKEN_EXPIRED, 'JWT Token Expired!');
|
|
43
43
|
}
|
|
44
|
-
|
|
45
44
|
if (sdkConfig.sentry && (_sdkConfig$sentry = sdkConfig.sentry) !== null && _sdkConfig$sentry !== void 0 && _sdkConfig$sentry.enabled) {
|
|
46
45
|
Sentry.init({
|
|
47
46
|
enableNative: true,
|
|
@@ -50,22 +49,31 @@ export class DispatchSDKManager {
|
|
|
50
49
|
tracesSampleRate: 1.0
|
|
51
50
|
});
|
|
52
51
|
}
|
|
53
|
-
|
|
54
52
|
await SdkUtils.checkMandatory();
|
|
55
53
|
await this.cache.setObjectInCache(this.keys.SDK_CONFIG, sdkConfig);
|
|
56
54
|
GraphQLClient.init(sdkConfig.tenantBaseURL);
|
|
57
55
|
AppSyncManager.initAppSync(sdkConfig.tenantBaseURL, sdkConfig.syncRetryCount ?? 3);
|
|
58
56
|
LocationManager.getInstance().startUpdates();
|
|
57
|
+
if (sdkConfig.eventMapping) {
|
|
58
|
+
EventCodeRepo.getInstance().saveEventCode(sdkConfig.eventMapping);
|
|
59
|
+
}
|
|
59
60
|
await ReasonCodeContainer.getInstance().fetchReasonCode();
|
|
60
61
|
Logger.getInstance().setLogging(sdkConfig.enableLogging ?? true, sdkConfig);
|
|
62
|
+
let storage = Storage.getInstance();
|
|
63
|
+
if ((_sdkConfig$callbacks = sdkConfig.callbacks) !== null && _sdkConfig$callbacks !== void 0 && _sdkConfig$callbacks.fetchPhoneNumbersCallback) {
|
|
64
|
+
await callbackHandler.init(sdkConfig.callbacks.fetchPhoneNumbersCallback);
|
|
65
|
+
}
|
|
66
|
+
await dispatchExecutor.init({
|
|
67
|
+
storeMultipleKeysCallback: storage.setSharedItems,
|
|
68
|
+
readMultipleKeysCallback: storage.getSharedItems,
|
|
69
|
+
deleteMultipleKeysCallback: storage.removeSharedItems,
|
|
70
|
+
eventBulkSyncCallback: pushBulkEventForSync
|
|
71
|
+
}, sdkConfig.debugLevelLog ? 'debug' : 'emerg');
|
|
61
72
|
AppSyncManager.getInstance().startSDKSyncManager();
|
|
62
73
|
}
|
|
63
|
-
|
|
64
74
|
removeLocationUpdates() {
|
|
65
75
|
LocationManager.getInstance().stopLocationUpdates();
|
|
66
76
|
}
|
|
67
|
-
|
|
68
77
|
}
|
|
69
|
-
|
|
70
78
|
_defineProperty(DispatchSDKManager, "instance", void 0);
|
|
71
79
|
//# sourceMappingURL=DispatchSDKManager.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["DispatchSdkCache","LocationManager","AppSyncManager","Logger","ReasonCodeContainer","GraphQLClient","isMandatoryKeysPresent","isTokenExpired","BaseError","ErrorCodes","SdkUtils","Sentry","DispatchSDKManager","constructor","getInstance","KEYS","instance","initDispatchSDK","sdkConfig","InvalidArgumentError","accessToken","ACCESS_TOKEN_EXPIRED","sentry","enabled","init","enableNative","environment","env","dsn","tracesSampleRate","checkMandatory","cache","setObjectInCache","keys","SDK_CONFIG","tenantBaseURL","initAppSync","syncRetryCount","startUpdates","fetchReasonCode","setLogging","enableLogging","startSDKSyncManager","removeLocationUpdates","stopLocationUpdates"],"sources":["DispatchSDKManager.ts"],"sourcesContent":["import DispatchSdkCache from './DispatchSdkCache';\nimport LocationManager from '../location/LocationManager';\nimport AppSyncManager from '../syncmanager/AppSyncManager';\nimport Logger from '../../utils/Logger';\nimport ReasonCodeContainer from '../dispatchCodes/ReasonCodeContainer';\nimport GraphQLClient from '../../network/GraphQLClient';\nimport { isMandatoryKeysPresent, isTokenExpired } from '../../utils/utils';\nimport { BaseError } from '../../errors/BaseError';\nimport ErrorCodes from '../../errors/ErrorCodes';\nimport SdkUtils from '../../utils/SdkUtils';\nimport * as Sentry from '@sentry/react-native';\nimport type { DispatchSDKConfig } from '../../models/sdk';\n\nexport class DispatchSDKManager {\n private static instance: DispatchSDKManager;\n private cache: DispatchSdkCache = DispatchSdkCache.getInstance();\n private keys = DispatchSdkCache.KEYS;\n\n private constructor() {}\n\n public static getInstance(): DispatchSDKManager {\n if (!DispatchSDKManager.instance) {\n DispatchSDKManager.instance = new DispatchSDKManager();\n }\n return DispatchSDKManager.instance;\n }\n\n /**\n * Call this init method with username,userID & authentication tokens\n * @param sdkConfig\n */\n public async initDispatchSDK(sdkConfig: DispatchSDKConfig) {\n if (\n !isMandatoryKeysPresent(sdkConfig, [\n 'tenantID',\n 'userID',\n 'userName',\n 'tenantBaseURL',\n 'accessToken',\n ])\n ) {\n throw new BaseError(\n ErrorCodes.InvalidArgumentError,\n 'Invalid/Missing Argument Passed in SdkConfig'\n );\n }\n if (isTokenExpired(sdkConfig.accessToken)) {\n throw new BaseError(\n ErrorCodes.ACCESS_TOKEN_EXPIRED,\n 'JWT Token Expired!'\n );\n }\n if (sdkConfig.sentry && sdkConfig.sentry?.enabled) {\n Sentry.init({\n enableNative: true,\n environment: sdkConfig.sentry.env,\n dsn: sdkConfig.sentry.dsn,\n tracesSampleRate: 1.0,\n });\n }\n await SdkUtils.checkMandatory();\n await this.cache.setObjectInCache(this.keys.SDK_CONFIG, sdkConfig);\n GraphQLClient.init(sdkConfig.tenantBaseURL);\n AppSyncManager.initAppSync(\n sdkConfig.tenantBaseURL,\n sdkConfig.syncRetryCount ?? 3\n );\n LocationManager.getInstance().startUpdates();\n await ReasonCodeContainer.getInstance().fetchReasonCode();\n Logger.getInstance().setLogging(sdkConfig.enableLogging ?? true, sdkConfig);\n AppSyncManager.getInstance().startSDKSyncManager();\n }\n\n public removeLocationUpdates() {\n LocationManager.getInstance().stopLocationUpdates();\n }\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"names":["DispatchSdkCache","LocationManager","AppSyncManager","Logger","ReasonCodeContainer","GraphQLClient","isMandatoryKeysPresent","isTokenExpired","BaseError","ErrorCodes","SdkUtils","Sentry","EventCodeRepo","Storage","pushBulkEventForSync","callbackHandler","DispatchExecutor","dispatchExecutor","DispatchSDKManager","constructor","_defineProperty","getInstance","KEYS","instance","initDispatchSDK","sdkConfig","_sdkConfig$sentry","_sdkConfig$callbacks","InvalidArgumentError","accessToken","ACCESS_TOKEN_EXPIRED","sentry","enabled","init","enableNative","environment","env","dsn","tracesSampleRate","checkMandatory","cache","setObjectInCache","keys","SDK_CONFIG","tenantBaseURL","initAppSync","syncRetryCount","startUpdates","eventMapping","saveEventCode","fetchReasonCode","setLogging","enableLogging","storage","callbacks","fetchPhoneNumbersCallback","storeMultipleKeysCallback","setSharedItems","readMultipleKeysCallback","getSharedItems","deleteMultipleKeysCallback","removeSharedItems","eventBulkSyncCallback","debugLevelLog","startSDKSyncManager","removeLocationUpdates","stopLocationUpdates"],"sources":["DispatchSDKManager.ts"],"sourcesContent":["import DispatchSdkCache from './DispatchSdkCache';\nimport LocationManager from '../location/LocationManager';\nimport AppSyncManager from '../syncmanager/AppSyncManager';\nimport Logger from '../../utils/Logger';\nimport ReasonCodeContainer from '../dispatchCodes/ReasonCodeContainer';\nimport GraphQLClient from '../../network/GraphQLClient';\nimport { isMandatoryKeysPresent, isTokenExpired } from '../../utils/utils';\nimport { BaseError } from '../../errors/BaseError';\nimport ErrorCodes from '../../errors/ErrorCodes';\nimport SdkUtils from '../../utils/SdkUtils';\nimport * as Sentry from '@sentry/react-native';\nimport type { DispatchSDKConfig } from '../../models/sdk';\nimport EventCodeRepo from '../dispatchCodes/EventCodeRepo';\nimport Storage from '../../utils/storage';\nimport { pushBulkEventForSync } from '../../utils/SyncManagerUtils';\nimport callbackHandler from './callbacksHandler';\nimport { DispatchExecutor as dispatchExecutor } from '@os1-platform/platform-coreos-execution-engine-sdk';\n\nexport class DispatchSDKManager {\n private static instance: DispatchSDKManager;\n private cache: DispatchSdkCache = DispatchSdkCache.getInstance();\n private keys = DispatchSdkCache.KEYS;\n\n private constructor() {}\n\n public static getInstance(): DispatchSDKManager {\n if (!DispatchSDKManager.instance) {\n DispatchSDKManager.instance = new DispatchSDKManager();\n }\n return DispatchSDKManager.instance;\n }\n\n /**\n * Call this init method with username,userID & authentication tokens\n * @param sdkConfig\n */\n public async initDispatchSDK(sdkConfig: DispatchSDKConfig) {\n if (\n !isMandatoryKeysPresent(sdkConfig, [\n 'tenantID',\n 'userID',\n 'userName',\n 'tenantBaseURL',\n 'accessToken',\n ])\n ) {\n throw new BaseError(\n ErrorCodes.InvalidArgumentError,\n 'Invalid/Missing Argument Passed in SdkConfig'\n );\n }\n if (isTokenExpired(sdkConfig.accessToken)) {\n throw new BaseError(\n ErrorCodes.ACCESS_TOKEN_EXPIRED,\n 'JWT Token Expired!'\n );\n }\n if (sdkConfig.sentry && sdkConfig.sentry?.enabled) {\n Sentry.init({\n enableNative: true,\n environment: sdkConfig.sentry.env,\n dsn: sdkConfig.sentry.dsn,\n tracesSampleRate: 1.0,\n });\n }\n await SdkUtils.checkMandatory();\n await this.cache.setObjectInCache(this.keys.SDK_CONFIG, sdkConfig);\n GraphQLClient.init(sdkConfig.tenantBaseURL);\n AppSyncManager.initAppSync(\n sdkConfig.tenantBaseURL,\n sdkConfig.syncRetryCount ?? 3\n );\n LocationManager.getInstance().startUpdates();\n if (sdkConfig.eventMapping) {\n EventCodeRepo.getInstance().saveEventCode(sdkConfig.eventMapping);\n }\n await ReasonCodeContainer.getInstance().fetchReasonCode();\n Logger.getInstance().setLogging(sdkConfig.enableLogging ?? true, sdkConfig);\n let storage = Storage.getInstance();\n\n if (sdkConfig.callbacks?.fetchPhoneNumbersCallback) {\n await callbackHandler.init(sdkConfig.callbacks.fetchPhoneNumbersCallback);\n }\n await dispatchExecutor.init(\n {\n storeMultipleKeysCallback: storage.setSharedItems,\n readMultipleKeysCallback: storage.getSharedItems,\n deleteMultipleKeysCallback: storage.removeSharedItems,\n eventBulkSyncCallback: pushBulkEventForSync,\n },\n sdkConfig.debugLevelLog ? 'debug' : 'emerg'\n );\n AppSyncManager.getInstance().startSDKSyncManager();\n }\n\n public removeLocationUpdates() {\n LocationManager.getInstance().stopLocationUpdates();\n }\n}\n"],"mappings":";;;AAAA,OAAOA,gBAAgB,MAAM,oBAAoB;AACjD,OAAOC,eAAe,MAAM,6BAA6B;AACzD,OAAOC,cAAc,MAAM,+BAA+B;AAC1D,OAAOC,MAAM,MAAM,oBAAoB;AACvC,OAAOC,mBAAmB,MAAM,sCAAsC;AACtE,OAAOC,aAAa,MAAM,6BAA6B;AACvD,SAASC,sBAAsB,EAAEC,cAAc,QAAQ,mBAAmB;AAC1E,SAASC,SAAS,QAAQ,wBAAwB;AAClD,OAAOC,UAAU,MAAM,yBAAyB;AAChD,OAAOC,QAAQ,MAAM,sBAAsB;AAC3C,OAAO,KAAKC,MAAM,MAAM,sBAAsB;AAE9C,OAAOC,aAAa,MAAM,gCAAgC;AAC1D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C,CAAC;IACD7D,cAAc,CAACmB,WAAW,CAAC,CAAC,CAAC2C,mBAAmB,CAAC,CAAC;EACpD;EAEOC,qBAAqBA,CAAA,EAAG;IAC7BhE,eAAe,CAACoB,WAAW,CAAC,CAAC,CAAC6C,mBAAmB,CAAC,CAAC;EACrD;AACF;AAAC9C,eAAA,CAhFYF,kBAAkB"}
|
|
@@ -1,31 +1,26 @@
|
|
|
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 Storage from '../../utils/storage';
|
|
4
5
|
export default class DispatchSdkCache {
|
|
5
6
|
constructor() {
|
|
6
7
|
_defineProperty(this, "storage", Storage.getInstance());
|
|
7
8
|
}
|
|
8
|
-
|
|
9
9
|
static getInstance() {
|
|
10
10
|
if (!DispatchSdkCache.instance) {
|
|
11
11
|
DispatchSdkCache.instance = new DispatchSdkCache();
|
|
12
12
|
}
|
|
13
|
-
|
|
14
13
|
return DispatchSdkCache.instance;
|
|
15
14
|
}
|
|
16
|
-
|
|
17
15
|
async setObjectInCache(keyName, obj) {
|
|
18
16
|
await this.storage.setObject(keyName, obj);
|
|
19
17
|
}
|
|
20
|
-
|
|
21
18
|
async getObjectFromCache(keyName) {
|
|
22
19
|
return await this.storage.getObject(keyName);
|
|
23
20
|
}
|
|
24
|
-
|
|
25
21
|
async setKeyInCache(keyName, keyValue) {
|
|
26
22
|
await this.storage.setItem(keyName, keyValue);
|
|
27
23
|
}
|
|
28
|
-
|
|
29
24
|
async getKeyFromCache(keyName) {
|
|
30
25
|
try {
|
|
31
26
|
let keyValue = await this.storage.getItem(keyName);
|
|
@@ -34,7 +29,6 @@ export default class DispatchSdkCache {
|
|
|
34
29
|
return null;
|
|
35
30
|
}
|
|
36
31
|
}
|
|
37
|
-
|
|
38
32
|
async clearKeys(keys) {
|
|
39
33
|
try {
|
|
40
34
|
for (let i = 0; i < keys.length; i++) {
|
|
@@ -42,16 +36,15 @@ export default class DispatchSdkCache {
|
|
|
42
36
|
}
|
|
43
37
|
} catch (error) {}
|
|
44
38
|
}
|
|
45
|
-
|
|
46
39
|
}
|
|
47
|
-
|
|
48
40
|
_defineProperty(DispatchSdkCache, "instance", void 0);
|
|
49
|
-
|
|
50
41
|
_defineProperty(DispatchSdkCache, "KEYS", {
|
|
51
42
|
SDK_CONFIG: 'dsc_sdk_config',
|
|
52
43
|
DISPATCH_ID: 'dsc_dispatch_id',
|
|
53
44
|
FMS_FOLDER: 'dsc_fms_folder',
|
|
54
45
|
FIREBASE_REGISTRATION_TOKEN: 'dsc_firebase_token',
|
|
55
|
-
REASON_FETCH_TIME: 'dsc_reasons_fetch_time'
|
|
46
|
+
REASON_FETCH_TIME: 'dsc_reasons_fetch_time',
|
|
47
|
+
CURRENT_WORKING_TASK_ID: 'current_working_task_id'
|
|
48
|
+
// TASK_START_TIME: 'task_start_time',
|
|
56
49
|
});
|
|
57
50
|
//# sourceMappingURL=DispatchSdkCache.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["Storage","DispatchSdkCache","getInstance","instance","setObjectInCache","keyName","obj","storage","setObject","getObjectFromCache","getObject","setKeyInCache","keyValue","setItem","getKeyFromCache","getItem","error","clearKeys","keys","i","length","deleteItem","SDK_CONFIG","DISPATCH_ID","FMS_FOLDER","FIREBASE_REGISTRATION_TOKEN","REASON_FETCH_TIME"],"sources":["DispatchSdkCache.ts"],"sourcesContent":["import Storage from '../../utils/storage';\n\nexport default class DispatchSdkCache {\n private storage: Storage = Storage.getInstance();\n private static instance: DispatchSdkCache;\n\n public static getInstance() {\n if (!DispatchSdkCache.instance) {\n DispatchSdkCache.instance = new DispatchSdkCache();\n }\n return DispatchSdkCache.instance;\n }\n public static KEYS = {\n SDK_CONFIG: 'dsc_sdk_config',\n DISPATCH_ID: 'dsc_dispatch_id',\n FMS_FOLDER: 'dsc_fms_folder',\n FIREBASE_REGISTRATION_TOKEN: 'dsc_firebase_token',\n REASON_FETCH_TIME: 'dsc_reasons_fetch_time',\n };\n public async setObjectInCache(keyName: string, obj: any) {\n await this.storage.setObject(keyName, obj);\n }\n public async getObjectFromCache(keyName: string): Promise<any> {\n return await this.storage.getObject(keyName);\n }\n public async setKeyInCache(keyName: string, keyValue: string) {\n await this.storage.setItem(keyName, keyValue);\n }\n public async getKeyFromCache(keyName: string): Promise<string | null> {\n try {\n let keyValue = await this.storage.getItem(keyName);\n if (keyValue != null) return keyValue;\n else return null;\n } catch (error: any) {\n return null;\n }\n }\n public async clearKeys(keys: string[]) {\n try {\n for (let i = 0; i < keys.length; i++) {\n await this.storage.deleteItem(keys[i]);\n }\n } catch (error: any) {}\n }\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"names":["Storage","DispatchSdkCache","constructor","_defineProperty","getInstance","instance","setObjectInCache","keyName","obj","storage","setObject","getObjectFromCache","getObject","setKeyInCache","keyValue","setItem","getKeyFromCache","getItem","error","clearKeys","keys","i","length","deleteItem","SDK_CONFIG","DISPATCH_ID","FMS_FOLDER","FIREBASE_REGISTRATION_TOKEN","REASON_FETCH_TIME","CURRENT_WORKING_TASK_ID"],"sources":["DispatchSdkCache.ts"],"sourcesContent":["import Storage from '../../utils/storage';\n\nexport default class DispatchSdkCache {\n private storage: Storage = Storage.getInstance();\n private static instance: DispatchSdkCache;\n\n public static getInstance() {\n if (!DispatchSdkCache.instance) {\n DispatchSdkCache.instance = new DispatchSdkCache();\n }\n return DispatchSdkCache.instance;\n }\n public static KEYS = {\n SDK_CONFIG: 'dsc_sdk_config',\n DISPATCH_ID: 'dsc_dispatch_id',\n FMS_FOLDER: 'dsc_fms_folder',\n FIREBASE_REGISTRATION_TOKEN: 'dsc_firebase_token',\n REASON_FETCH_TIME: 'dsc_reasons_fetch_time',\n CURRENT_WORKING_TASK_ID: 'current_working_task_id',\n // TASK_START_TIME: 'task_start_time',\n };\n public async setObjectInCache(keyName: string, obj: any) {\n await this.storage.setObject(keyName, obj);\n }\n public async getObjectFromCache(keyName: string): Promise<any> {\n return await this.storage.getObject(keyName);\n }\n public async setKeyInCache(keyName: string, keyValue: string) {\n await this.storage.setItem(keyName, keyValue);\n }\n public async getKeyFromCache(keyName: string): Promise<string | null> {\n try {\n let keyValue = await this.storage.getItem(keyName);\n if (keyValue != null) return keyValue;\n else return null;\n } catch (error: any) {\n return null;\n }\n }\n public async clearKeys(keys: string[]) {\n try {\n for (let i = 0; i < keys.length; i++) {\n await this.storage.deleteItem(keys[i]);\n }\n } catch (error: any) {}\n }\n}\n"],"mappings":";;;AAAA,OAAOA,OAAO,MAAM,qBAAqB;AAEzC,eAAe,MAAMC,gBAAgB,CAAC;EAAAC,YAAA;IAAAC,eAAA,kBACTH,OAAO,CAACI,WAAW,CAAC,CAAC;EAAA;EAGhD,OAAcA,WAAWA,CAAA,EAAG;IAC1B,IAAI,CAACH,gBAAgB,CAACI,QAAQ,EAAE;MAC9BJ,gBAAgB,CAACI,QAAQ,GAAG,IAAIJ,gBAAgB,CAAC,CAAC;IACpD;IACA,OAAOA,gBAAgB,CAACI,QAAQ;EAClC;EAUA,MAAaC,gBAAgBA,CAACC,OAAe,EAAEC,GAAQ,EAAE;IACvD,MAAM,IAAI,CAACC,OAAO,CAACC,SAAS,CAACH,OAAO,EAAEC,GAAG,CAAC;EAC5C;EACA,MAAaG,kBAAkBA,CAACJ,OAAe,EAAgB;IAC7D,OAAO,MAAM,IAAI,CAACE,OAAO,CAACG,SAAS,CAACL,OAAO,CAAC;EAC9C;EACA,MAAaM,aAAaA,CAACN,OAAe,EAAEO,QAAgB,EAAE;IAC5D,MAAM,IAAI,CAACL,OAAO,CAACM,OAAO,CAACR,OAAO,EAAEO,QAAQ,CAAC;EAC/C;EACA,MAAaE,eAAeA,CAACT,OAAe,EAA0B;IACpE,IAAI;MACF,IAAIO,QAAQ,GAAG,MAAM,IAAI,CAACL,OAAO,CAACQ,OAAO,CAACV,OAAO,CAAC;MAClD,IAAIO,QAAQ,IAAI,IAAI,EAAE,OAAOA,QAAQ,CAAC,KACjC,OAAO,IAAI;IAClB,CAAC,CAAC,OAAOI,KAAU,EAAE;MACnB,OAAO,IAAI;IACb;EACF;EACA,MAAaC,SAASA,CAACC,IAAc,EAAE;IACrC,IAAI;MACF,KAAK,IAAIC,CAAC,GAAG,CAAC,EAAEA,CAAC,GAAGD,IAAI,CAACE,MAAM,EAAED,CAAC,EAAE,EAAE;QACpC,MAAM,IAAI,CAACZ,OAAO,CAACc,UAAU,CAACH,IAAI,CAACC,CAAC,CAAC,CAAC;MACxC;IACF,CAAC,CAAC,OAAOH,KAAU,EAAE,CAAC;EACxB;AACF;AAACf,eAAA,CA5CoBF,gBAAgB;AAAAE,eAAA,CAAhBF,gBAAgB,UAUd;EACnBuB,UAAU,EAAE,gBAAgB;EAC5BC,WAAW,EAAE,iBAAiB;EAC9BC,UAAU,EAAE,gBAAgB;EAC5BC,2BAA2B,EAAE,oBAAoB;EACjDC,iBAAiB,EAAE,wBAAwB;EAC3CC,uBAAuB,EAAE;EACzB;AACF,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
2
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
|
3
|
+
function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
4
|
+
class CallbacksHandler {
|
|
5
|
+
constructor() {
|
|
6
|
+
_defineProperty(this, "_callbackToFetchPhoneNumbers", void 0);
|
|
7
|
+
}
|
|
8
|
+
init(phoneCallback) {
|
|
9
|
+
this._callbackToFetchPhoneNumbers = phoneCallback;
|
|
10
|
+
}
|
|
11
|
+
async getPhoneNumbers(sdsIds) {
|
|
12
|
+
if (!this._callbackToFetchPhoneNumbers) return null;else {
|
|
13
|
+
return await this._callbackToFetchPhoneNumbers(sdsIds);
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
const callbackHandler = new CallbacksHandler();
|
|
18
|
+
export default callbackHandler;
|
|
19
|
+
//# sourceMappingURL=callbacksHandler.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["CallbacksHandler","constructor","_defineProperty","init","phoneCallback","_callbackToFetchPhoneNumbers","getPhoneNumbers","sdsIds","callbackHandler"],"sources":["callbacksHandler.ts"],"sourcesContent":["class CallbacksHandler {\n private _callbackToFetchPhoneNumbers!: (\n sdsIds: string[]\n ) => Promise<{ key: string; value: string[] }>;\n\n public init(\n phoneCallback: (\n sdsIds: string[]\n ) => Promise<{ key: string; value: string[] }>\n ) {\n this._callbackToFetchPhoneNumbers = phoneCallback;\n }\n\n public async getPhoneNumbers(\n sdsIds: string[]\n ): Promise<{ key: string; value: string[] } | null> {\n if (!this._callbackToFetchPhoneNumbers) return null;\n else {\n return await this._callbackToFetchPhoneNumbers(sdsIds);\n }\n }\n}\n\nconst callbackHandler = new CallbacksHandler();\nexport default callbackHandler;\n"],"mappings":";;;AAAA,MAAMA,gBAAgB,CAAC;EAAAC,YAAA;IAAAC,eAAA;EAAA;EAKdC,IAAIA,CACTC,aAE8C,EAC9C;IACA,IAAI,CAACC,4BAA4B,GAAGD,aAAa;EACnD;EAEA,MAAaE,eAAeA,CAC1BC,MAAgB,EACkC;IAClD,IAAI,CAAC,IAAI,CAACF,4BAA4B,EAAE,OAAO,IAAI,CAAC,KAC/C;MACH,OAAO,MAAM,IAAI,CAACA,4BAA4B,CAACE,MAAM,CAAC;IACxD;EACF;AACF;AAEA,MAAMC,eAAe,GAAG,IAAIR,gBAAgB,CAAC,CAAC;AAC9C,eAAeQ,eAAe"}
|
|
@@ -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 DocumentSyncManager from './document/DocumentSyncManager';
|
|
4
5
|
import EventsSyncManager from './events/EventsSyncManager';
|
|
5
6
|
import NetworkUtil from '../../utils/NetworkUtil';
|
|
@@ -13,11 +14,10 @@ import { DEFAULT_INTERVAL, DEFAULT_NOTIFICATION_DESCRIPTION, DEFAULT_NOTIFICATIO
|
|
|
13
14
|
export default class AppSyncManager {
|
|
14
15
|
constructor(tenantBaseURL, retryCount) {
|
|
15
16
|
_defineProperty(this, "isSyncActive", false);
|
|
16
|
-
|
|
17
|
+
_defineProperty(this, "isForceStartEnabled", true);
|
|
17
18
|
DocumentSyncManager.getInstance().init(tenantBaseURL, retryCount);
|
|
18
19
|
EventsSyncManager.getInstance().initSyncManager(tenantBaseURL, retryCount);
|
|
19
20
|
}
|
|
20
|
-
|
|
21
21
|
/**
|
|
22
22
|
*
|
|
23
23
|
* @param forceSync - true/false - if true resets the retry count key and start the sync
|
|
@@ -26,41 +26,35 @@ export default class AppSyncManager {
|
|
|
26
26
|
async startSyncing(forceSync, _syncType) {
|
|
27
27
|
if (await NetworkUtil.isAvailableAsync()) {
|
|
28
28
|
if (forceSync) {
|
|
29
|
-
|
|
30
|
-
|
|
29
|
+
EventsSyncManager.getInstance().forceSync();
|
|
30
|
+
DocumentSyncManager.getInstance().forceDocumentSync();
|
|
31
31
|
} else {
|
|
32
|
-
|
|
33
|
-
|
|
32
|
+
EventsSyncManager.getInstance().startSync();
|
|
33
|
+
DocumentSyncManager.getInstance().startDocumentSync();
|
|
34
34
|
}
|
|
35
35
|
} else {
|
|
36
36
|
Logger.getInstance().logEvent('startSync', 'No network', LOG_TYPE.SDK_INFO);
|
|
37
37
|
}
|
|
38
38
|
}
|
|
39
|
-
|
|
40
39
|
async isAppSyncPending() {
|
|
41
40
|
return (await EventsSyncManager.getInstance().isSyncPending()) || (await DocumentSyncManager.getInstance().isSyncPending());
|
|
42
41
|
}
|
|
43
|
-
|
|
44
42
|
static initAppSync(tenantBaseURL, syncRetryCount) {
|
|
45
43
|
if (!AppSyncManager.instance) {
|
|
46
44
|
Logger.getInstance().logEvent('initAppSync', 'CREATING NEW INSTANCE', LOG_TYPE.SDK_INFO);
|
|
47
45
|
AppSyncManager.instance = new AppSyncManager(tenantBaseURL, syncRetryCount);
|
|
48
46
|
}
|
|
49
|
-
|
|
50
47
|
return AppSyncManager.instance;
|
|
51
48
|
}
|
|
52
|
-
|
|
53
49
|
static getInstance() {
|
|
54
50
|
if (!AppSyncManager.instance) throw new BaseError(ErrorCodes.AppSyncNotInitialized, 'SDK sync Manager is not initialized');else return AppSyncManager.instance;
|
|
55
51
|
}
|
|
56
|
-
|
|
57
52
|
static async startAppSyncManager() {
|
|
58
53
|
try {
|
|
59
54
|
if (!AppSyncManager.instance) {
|
|
60
55
|
NativeSyncManager.stopSyncManager();
|
|
61
56
|
let sdkConfig = await DispatchSdkCache.getInstance().getObjectFromCache(DispatchSdkCache.KEYS.SDK_CONFIG);
|
|
62
57
|
const retryCount = sdkConfig.syncRetryCount ?? 3;
|
|
63
|
-
|
|
64
58
|
if (sdkConfig.tenantBaseURL != null && retryCount != null) {
|
|
65
59
|
AppSyncManager.initAppSync(sdkConfig.tenantBaseURL, +retryCount);
|
|
66
60
|
AppSyncManager.getInstance().startSDKSyncManager();
|
|
@@ -68,7 +62,7 @@ export default class AppSyncManager {
|
|
|
68
62
|
Logger.getInstance().logEvent('SYNC_MANAGER_ASM', 'TENANT BASE URL IS NULL', LOG_TYPE.SDK_ERROR);
|
|
69
63
|
}
|
|
70
64
|
} else if (await AppSyncManager.instance.isAppSyncPending()) {
|
|
71
|
-
|
|
65
|
+
AppSyncManager.instance.startSyncing(false);
|
|
72
66
|
} else {
|
|
73
67
|
NativeSyncManager.stopSyncManager();
|
|
74
68
|
AppSyncManager.getInstance().isSyncActive = false;
|
|
@@ -77,39 +71,33 @@ export default class AppSyncManager {
|
|
|
77
71
|
Logger.getInstance().logEvent('startAppSyncManager', `Unable to start App Sync Manager ${error.message}`, LOG_TYPE.SDK_WARNING);
|
|
78
72
|
}
|
|
79
73
|
}
|
|
74
|
+
|
|
80
75
|
/**
|
|
81
76
|
* Call this method from index file of the app
|
|
82
77
|
*/
|
|
83
|
-
|
|
84
|
-
|
|
85
78
|
static registerSyncTask() {
|
|
86
79
|
AppRegistry.registerHeadlessTask('SYNC_MANAGER', () => AppSyncManager.startAppSyncManager);
|
|
87
80
|
}
|
|
88
|
-
|
|
89
81
|
async getAllEvents(dispatchID) {
|
|
90
82
|
return EventsSyncManager.getInstance().getAllEvents(dispatchID);
|
|
91
83
|
}
|
|
92
|
-
|
|
93
84
|
async getAllDocuments(dispatchID) {
|
|
94
85
|
return DocumentSyncManager.getInstance().getAllDocuments(dispatchID);
|
|
95
86
|
}
|
|
96
|
-
|
|
97
87
|
startSDKSyncManager() {
|
|
98
88
|
(async () => {
|
|
99
89
|
const config = await DispatchSdkCache.getInstance().getObjectFromCache(DispatchSdkCache.KEYS.SDK_CONFIG);
|
|
100
|
-
|
|
101
90
|
if (Platform.OS === 'android') {
|
|
102
|
-
if (!this.isSyncActive) {
|
|
91
|
+
if (!this.isSyncActive && this.isForceStartEnabled) {
|
|
103
92
|
var _config$notificationC, _config$notificationC2, _config$notificationC3;
|
|
104
|
-
|
|
105
93
|
this.isSyncActive = true;
|
|
94
|
+
|
|
106
95
|
/**
|
|
107
96
|
* Reset Retry Counter
|
|
108
97
|
*/
|
|
109
|
-
|
|
110
98
|
EventsSyncManager.getInstance().retries = 0;
|
|
111
99
|
DocumentSyncManager.getInstance().retries = 0;
|
|
112
|
-
NativeSyncManager.startSyncManager((config === null || config === void 0
|
|
100
|
+
NativeSyncManager.startSyncManager((config === null || config === void 0 || (_config$notificationC = config.notificationConfig) === null || _config$notificationC === void 0 ? void 0 : _config$notificationC.interval) ?? DEFAULT_INTERVAL, (config === null || config === void 0 || (_config$notificationC2 = config.notificationConfig) === null || _config$notificationC2 === void 0 ? void 0 : _config$notificationC2.title) ?? DEFAULT_NOTIFICATION_TITLE, (config === null || config === void 0 || (_config$notificationC3 = config.notificationConfig) === null || _config$notificationC3 === void 0 ? void 0 : _config$notificationC3.description) ?? DEFAULT_NOTIFICATION_DESCRIPTION);
|
|
113
101
|
} else {
|
|
114
102
|
Logger.getInstance().logEvent('startNativeSyncManager', 'ANDROID SYNC SERVICE ALREADY RUNNING', LOG_TYPE.SDK_INFO);
|
|
115
103
|
}
|
|
@@ -122,7 +110,19 @@ export default class AppSyncManager {
|
|
|
122
110
|
})();
|
|
123
111
|
}
|
|
124
112
|
|
|
113
|
+
// NEW CODE
|
|
114
|
+
async pushToQueue(pushData) {
|
|
115
|
+
try {
|
|
116
|
+
await EventsSyncManager.getInstance().insertBulkEvent(pushData);
|
|
117
|
+
AppSyncManager.getInstance().startSDKSyncManager();
|
|
118
|
+
return true;
|
|
119
|
+
} catch (error) {
|
|
120
|
+
Logger.getInstance().logEvent('pushToQueue ', JSON.stringify({
|
|
121
|
+
errorMessage: error.message
|
|
122
|
+
}), LOG_TYPE.SDK_ERROR);
|
|
123
|
+
return false;
|
|
124
|
+
}
|
|
125
|
+
}
|
|
125
126
|
}
|
|
126
|
-
|
|
127
127
|
_defineProperty(AppSyncManager, "instance", void 0);
|
|
128
128
|
//# sourceMappingURL=AppSyncManager.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["DocumentSyncManager","EventsSyncManager","NetworkUtil","Logger","LOG_TYPE","NativeSyncManager","DispatchSdkCache","AppRegistry","Platform","BaseError","ErrorCodes","DEFAULT_INTERVAL","DEFAULT_NOTIFICATION_DESCRIPTION","DEFAULT_NOTIFICATION_TITLE","AppSyncManager","constructor","tenantBaseURL","retryCount","getInstance","init","initSyncManager","startSyncing","forceSync","_syncType","isAvailableAsync","forceDocumentSync","startSync","startDocumentSync","logEvent","SDK_INFO","isAppSyncPending","isSyncPending","initAppSync","syncRetryCount","instance","AppSyncNotInitialized","startAppSyncManager","stopSyncManager","sdkConfig","getObjectFromCache","KEYS","SDK_CONFIG","startSDKSyncManager","SDK_ERROR","isSyncActive","error","message","SDK_WARNING","registerSyncTask","registerHeadlessTask","getAllEvents","dispatchID","getAllDocuments","config","OS","retries","startSyncManager","notificationConfig","interval","title","description","then","catch"],"sources":["AppSyncManager.ts"],"sourcesContent":["import DocumentSyncManager from './document/DocumentSyncManager';\nimport EventsSyncManager from './events/EventsSyncManager';\nimport NetworkUtil from '../../utils/NetworkUtil';\nimport Logger, { LOG_TYPE } from '../../utils/Logger';\nimport NativeSyncManager from './NativeSyncManager';\nimport DispatchSdkCache from '../sdk/DispatchSdkCache';\nimport { AppRegistry, Platform } from 'react-native';\nimport { BaseError } from '../../errors/BaseError';\nimport ErrorCodes from '../../errors/ErrorCodes';\nimport type { SdkSyncType } from '../../models/DispatchModels';\nimport type { DocumentRow, EventRow } from './DBConfig';\nimport {\n DEFAULT_INTERVAL,\n DEFAULT_NOTIFICATION_DESCRIPTION,\n DEFAULT_NOTIFICATION_TITLE,\n} from '../../constants/constants';\nimport type { DispatchSDKConfig } from '../../models/sdk';\n\nexport default class AppSyncManager {\n private constructor(tenantBaseURL: string, retryCount: number) {\n DocumentSyncManager.getInstance().init(tenantBaseURL, retryCount);\n EventsSyncManager.getInstance().initSyncManager(tenantBaseURL, retryCount);\n }\n private static instance: AppSyncManager;\n public isSyncActive = false;\n\n /**\n *\n * @param forceSync - true/false - if true resets the retry count key and start the sync\n * @param syncType\n */\n public async startSyncing(forceSync: boolean, _syncType?: SdkSyncType) {\n if (await NetworkUtil.isAvailableAsync()) {\n if (forceSync) {\n await EventsSyncManager.getInstance().forceSync();\n await DocumentSyncManager.getInstance().forceDocumentSync();\n } else {\n await EventsSyncManager.getInstance().startSync();\n await DocumentSyncManager.getInstance().startDocumentSync();\n }\n } else {\n Logger.getInstance().logEvent(\n 'startSync',\n 'No network',\n LOG_TYPE.SDK_INFO\n );\n }\n }\n\n public async isAppSyncPending(): Promise<boolean> {\n return (\n (await EventsSyncManager.getInstance().isSyncPending()) ||\n (await DocumentSyncManager.getInstance().isSyncPending())\n );\n }\n public static initAppSync(\n tenantBaseURL: string,\n syncRetryCount: number\n ): AppSyncManager {\n if (!AppSyncManager.instance) {\n Logger.getInstance().logEvent(\n 'initAppSync',\n 'CREATING NEW INSTANCE',\n LOG_TYPE.SDK_INFO\n );\n AppSyncManager.instance = new AppSyncManager(\n tenantBaseURL,\n syncRetryCount\n );\n }\n return AppSyncManager.instance;\n }\n public static getInstance(): AppSyncManager {\n if (!AppSyncManager.instance)\n throw new BaseError(\n ErrorCodes.AppSyncNotInitialized,\n 'SDK sync Manager is not initialized'\n );\n else return AppSyncManager.instance;\n }\n\n public static async startAppSyncManager() {\n try {\n if (!AppSyncManager.instance) {\n NativeSyncManager.stopSyncManager();\n let sdkConfig =\n (await DispatchSdkCache.getInstance().getObjectFromCache(\n DispatchSdkCache.KEYS.SDK_CONFIG\n )) as DispatchSDKConfig;\n const retryCount = sdkConfig.syncRetryCount ?? 3;\n if (sdkConfig.tenantBaseURL != null && retryCount != null) {\n AppSyncManager.initAppSync(sdkConfig.tenantBaseURL, +retryCount);\n AppSyncManager.getInstance().startSDKSyncManager();\n } else {\n Logger.getInstance().logEvent(\n 'SYNC_MANAGER_ASM',\n 'TENANT BASE URL IS NULL',\n LOG_TYPE.SDK_ERROR\n );\n }\n } else if (await AppSyncManager.instance.isAppSyncPending()) {\n await AppSyncManager.instance.startSyncing(false);\n } else {\n NativeSyncManager.stopSyncManager();\n AppSyncManager.getInstance().isSyncActive = false;\n }\n } catch (error: any) {\n Logger.getInstance().logEvent(\n 'startAppSyncManager',\n `Unable to start App Sync Manager ${error.message}`,\n LOG_TYPE.SDK_WARNING\n );\n }\n }\n\n /**\n * Call this method from index file of the app\n */\n public static registerSyncTask() {\n AppRegistry.registerHeadlessTask(\n 'SYNC_MANAGER',\n () => AppSyncManager.startAppSyncManager\n );\n }\n\n public async getAllEvents(dispatchID?: string): Promise<EventRow[]> {\n return EventsSyncManager.getInstance().getAllEvents(dispatchID);\n }\n public async getAllDocuments(dispatchID?: string): Promise<DocumentRow[]> {\n return DocumentSyncManager.getInstance().getAllDocuments(dispatchID);\n }\n public startSDKSyncManager() {\n (async () => {\n const config = (await DispatchSdkCache.getInstance().getObjectFromCache(\n DispatchSdkCache.KEYS.SDK_CONFIG\n )) as DispatchSDKConfig;\n if (Platform.OS === 'android') {\n if (!this.isSyncActive) {\n this.isSyncActive = true;\n /**\n * Reset Retry Counter\n */\n EventsSyncManager.getInstance().retries = 0;\n DocumentSyncManager.getInstance().retries = 0;\n NativeSyncManager.startSyncManager(\n config?.notificationConfig?.interval ?? DEFAULT_INTERVAL,\n config?.notificationConfig?.title ?? DEFAULT_NOTIFICATION_TITLE,\n config?.notificationConfig?.description ??\n DEFAULT_NOTIFICATION_DESCRIPTION\n );\n } else {\n Logger.getInstance().logEvent(\n 'startNativeSyncManager',\n 'ANDROID SYNC SERVICE ALREADY RUNNING',\n LOG_TYPE.SDK_INFO\n );\n }\n } else {\n /**\n * For iOS we have to start Normal Foreground sync\n */\n this.startSyncing(true).then().catch();\n }\n })();\n }\n}\n"],"mappings":";;AAAA,OAAOA,mBAAP,MAAgC,gCAAhC;AACA,OAAOC,iBAAP,MAA8B,4BAA9B;AACA,OAAOC,WAAP,MAAwB,yBAAxB;AACA,OAAOC,MAAP,IAAiBC,QAAjB,QAAiC,oBAAjC;AACA,OAAOC,iBAAP,MAA8B,qBAA9B;AACA,OAAOC,gBAAP,MAA6B,yBAA7B;AACA,SAASC,WAAT,EAAsBC,QAAtB,QAAsC,cAAtC;AACA,SAASC,SAAT,QAA0B,wBAA1B;AACA,OAAOC,UAAP,MAAuB,yBAAvB;AAGA,SACEC,gBADF,EAEEC,gCAFF,EAGEC,0BAHF,QAIO,2BAJP;AAOA,eAAe,MAAMC,cAAN,CAAqB;EAC1BC,WAAW,CAACC,aAAD,EAAwBC,UAAxB,EAA4C;IAAA,sCAKzC,KALyC;;IAC7DjB,mBAAmB,CAACkB,WAApB,GAAkCC,IAAlC,CAAuCH,aAAvC,EAAsDC,UAAtD;IACAhB,iBAAiB,CAACiB,WAAlB,GAAgCE,eAAhC,CAAgDJ,aAAhD,EAA+DC,UAA/D;EACD;;EAID;AACF;AACA;AACA;AACA;EAC2B,MAAZI,YAAY,CAACC,SAAD,EAAqBC,SAArB,EAA8C;IACrE,IAAI,MAAMrB,WAAW,CAACsB,gBAAZ,EAAV,EAA0C;MACxC,IAAIF,SAAJ,EAAe;QACb,MAAMrB,iBAAiB,CAACiB,WAAlB,GAAgCI,SAAhC,E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AMW,MAAM,GAAI,MAAM/C,gBAAgB,CAACY,WAAjB,GAA+BqB,kBAA/B,CACpBjC,gBAAgB,CAACkC,IAAjB,CAAsBC,UADF,CAAtB;;MAGA,IAAIjC,QAAQ,CAAC8C,EAAT,KAAgB,SAApB,EAA+B;QAC7B,IAAI,CAAC,KAAKV,YAAV,EAAwB;UAAA;;UACtB,KAAKA,YAAL,GAAoB,IAApB;UACA;AACV;AACA;;UACU3C,iBAAiB,CAACiB,WAAlB,GAAgCqC,OAAhC,GAA0C,CAA1C;UACAvD,mBAAmB,CAACkB,WAApB,GAAkCqC,OAAlC,GAA4C,CAA5C;UACAlD,iBAAiB,CAACmD,gBAAlB,CACE,CAAAH,MAAM,SAAN,IAAAA,MAAM,WAAN,qCAAAA,MAAM,CAAEI,kBAAR,gFAA4BC,QAA5B,KAAwC/C,gBAD1C,EAEE,CAAA0C,MAAM,SAAN,IAAAA,MAAM,WAAN,sCAAAA,MAAM,CAAEI,kBAAR,kFAA4BE,KAA5B,KAAqC9C,0BAFvC,EAGE,CAAAwC,MAAM,SAAN,IAAAA,MAAM,WAAN,sCAAAA,MAAM,CAAEI,kBAAR,kFAA4BG,WAA5B,KACEhD,gCAJJ;QAMD,CAbD,MAaO;UACLT,MAAM,CAACe,WAAP,GAAqBU,QAArB,CACE,wBADF,EAEE,sCAFF,EAGExB,QAAQ,CAACyB,QAHX;QAKD;MACF,CArBD,MAqBO;QACL;AACR;AACA;QACQ,KAAKR,YAAL,CAAkB,IAAlB,EAAwBwC,IAAxB,GAA+BC,KAA/B;MACD;IACF,CA/BD;EAgCD;;AAlJiC;;gBAAfhD,c"}
|
|
1
|
+
{"version":3,"names":["DocumentSyncManager","EventsSyncManager","NetworkUtil","Logger","LOG_TYPE","NativeSyncManager","DispatchSdkCache","AppRegistry","Platform","BaseError","ErrorCodes","DEFAULT_INTERVAL","DEFAULT_NOTIFICATION_DESCRIPTION","DEFAULT_NOTIFICATION_TITLE","AppSyncManager","constructor","tenantBaseURL","retryCount","_defineProperty","getInstance","init","initSyncManager","startSyncing","forceSync","_syncType","isAvailableAsync","forceDocumentSync","startSync","startDocumentSync","logEvent","SDK_INFO","isAppSyncPending","isSyncPending","initAppSync","syncRetryCount","instance","AppSyncNotInitialized","startAppSyncManager","stopSyncManager","sdkConfig","getObjectFromCache","KEYS","SDK_CONFIG","startSDKSyncManager","SDK_ERROR","isSyncActive","error","message","SDK_WARNING","registerSyncTask","registerHeadlessTask","getAllEvents","dispatchID","getAllDocuments","config","OS","isForceStartEnabled","_config$notificationC","_config$notificationC2","_config$notificationC3","retries","startSyncManager","notificationConfig","interval","title","description","then","catch","pushToQueue","pushData","insertBulkEvent","JSON","stringify","errorMessage"],"sources":["AppSyncManager.ts"],"sourcesContent":["import DocumentSyncManager from './document/DocumentSyncManager';\nimport EventsSyncManager from './events/EventsSyncManager';\nimport NetworkUtil from '../../utils/NetworkUtil';\nimport Logger, { LOG_TYPE } from '../../utils/Logger';\nimport NativeSyncManager from './NativeSyncManager';\nimport DispatchSdkCache from '../sdk/DispatchSdkCache';\nimport { AppRegistry, Platform } from 'react-native';\nimport { BaseError } from '../../errors/BaseError';\nimport ErrorCodes from '../../errors/ErrorCodes';\nimport type { SdkSyncType } from '../../models/DispatchModels';\nimport type { BulkEvent, DocumentRow, EventRow } from './DBConfig';\nimport {\n DEFAULT_INTERVAL,\n DEFAULT_NOTIFICATION_DESCRIPTION,\n DEFAULT_NOTIFICATION_TITLE,\n} from '../../constants/constants';\nimport type { DispatchSDKConfig } from '../../models/sdk';\n\nexport default class AppSyncManager {\n private constructor(tenantBaseURL: string, retryCount: number) {\n DocumentSyncManager.getInstance().init(tenantBaseURL, retryCount);\n EventsSyncManager.getInstance().initSyncManager(tenantBaseURL, retryCount);\n }\n private static instance: AppSyncManager;\n public isSyncActive = false;\n public isForceStartEnabled = true;\n\n /**\n *\n * @param forceSync - true/false - if true resets the retry count key and start the sync\n * @param syncType\n */\n public async startSyncing(forceSync: boolean, _syncType?: SdkSyncType) {\n if (await NetworkUtil.isAvailableAsync()) {\n if (forceSync) {\n EventsSyncManager.getInstance().forceSync();\n DocumentSyncManager.getInstance().forceDocumentSync();\n } else {\n EventsSyncManager.getInstance().startSync();\n DocumentSyncManager.getInstance().startDocumentSync();\n }\n } else {\n Logger.getInstance().logEvent(\n 'startSync',\n 'No network',\n LOG_TYPE.SDK_INFO\n );\n }\n }\n\n public async isAppSyncPending(): Promise<boolean> {\n return (\n (await EventsSyncManager.getInstance().isSyncPending()) ||\n (await DocumentSyncManager.getInstance().isSyncPending())\n );\n }\n public static initAppSync(\n tenantBaseURL: string,\n syncRetryCount: number\n ): AppSyncManager {\n if (!AppSyncManager.instance) {\n Logger.getInstance().logEvent(\n 'initAppSync',\n 'CREATING NEW INSTANCE',\n LOG_TYPE.SDK_INFO\n );\n AppSyncManager.instance = new AppSyncManager(\n tenantBaseURL,\n syncRetryCount\n );\n }\n return AppSyncManager.instance;\n }\n public static getInstance(): AppSyncManager {\n if (!AppSyncManager.instance)\n throw new BaseError(\n ErrorCodes.AppSyncNotInitialized,\n 'SDK sync Manager is not initialized'\n );\n else return AppSyncManager.instance;\n }\n\n public static async startAppSyncManager() {\n try {\n if (!AppSyncManager.instance) {\n NativeSyncManager.stopSyncManager();\n let sdkConfig =\n (await DispatchSdkCache.getInstance().getObjectFromCache(\n DispatchSdkCache.KEYS.SDK_CONFIG\n )) as DispatchSDKConfig;\n const retryCount = sdkConfig.syncRetryCount ?? 3;\n if (sdkConfig.tenantBaseURL != null && retryCount != null) {\n AppSyncManager.initAppSync(sdkConfig.tenantBaseURL, +retryCount);\n AppSyncManager.getInstance().startSDKSyncManager();\n } else {\n Logger.getInstance().logEvent(\n 'SYNC_MANAGER_ASM',\n 'TENANT BASE URL IS NULL',\n LOG_TYPE.SDK_ERROR\n );\n }\n } else if (await AppSyncManager.instance.isAppSyncPending()) {\n AppSyncManager.instance.startSyncing(false);\n } else {\n NativeSyncManager.stopSyncManager();\n AppSyncManager.getInstance().isSyncActive = false;\n }\n } catch (error: any) {\n Logger.getInstance().logEvent(\n 'startAppSyncManager',\n `Unable to start App Sync Manager ${error.message}`,\n LOG_TYPE.SDK_WARNING\n );\n }\n }\n\n /**\n * Call this method from index file of the app\n */\n public static registerSyncTask() {\n AppRegistry.registerHeadlessTask(\n 'SYNC_MANAGER',\n () => AppSyncManager.startAppSyncManager\n );\n }\n\n public async getAllEvents(dispatchID?: string): Promise<EventRow[]> {\n return EventsSyncManager.getInstance().getAllEvents(dispatchID);\n }\n public async getAllDocuments(dispatchID?: string): Promise<DocumentRow[]> {\n return DocumentSyncManager.getInstance().getAllDocuments(dispatchID);\n }\n public startSDKSyncManager() {\n (async () => {\n const config = (await DispatchSdkCache.getInstance().getObjectFromCache(\n DispatchSdkCache.KEYS.SDK_CONFIG\n )) as DispatchSDKConfig;\n if (Platform.OS === 'android') {\n if (!this.isSyncActive && this.isForceStartEnabled) {\n this.isSyncActive = true;\n\n /**\n * Reset Retry Counter\n */\n EventsSyncManager.getInstance().retries = 0;\n DocumentSyncManager.getInstance().retries = 0;\n NativeSyncManager.startSyncManager(\n config?.notificationConfig?.interval ?? DEFAULT_INTERVAL,\n config?.notificationConfig?.title ?? DEFAULT_NOTIFICATION_TITLE,\n config?.notificationConfig?.description ??\n DEFAULT_NOTIFICATION_DESCRIPTION\n );\n } else {\n Logger.getInstance().logEvent(\n 'startNativeSyncManager',\n 'ANDROID SYNC SERVICE ALREADY RUNNING',\n LOG_TYPE.SDK_INFO\n );\n }\n } else {\n /**\n * For iOS we have to start Normal Foreground sync\n */\n this.startSyncing(true).then().catch();\n }\n })();\n }\n\n // NEW CODE\n public async pushToQueue(pushData: BulkEvent): Promise<boolean> {\n try {\n await EventsSyncManager.getInstance().insertBulkEvent(pushData);\n\n AppSyncManager.getInstance().startSDKSyncManager();\n return true;\n } catch (error: any) {\n Logger.getInstance().logEvent(\n 'pushToQueue ',\n JSON.stringify({\n errorMessage: error.message,\n }),\n LOG_TYPE.SDK_ERROR\n );\n return false;\n }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