@os1-platform/dispatch-mobile 2.1.7 → 2.1.9
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/lib/commonjs/@types/assets/index.d.js.map +1 -1
- package/lib/commonjs/analytics/firebase/FirebaseLogging.js.map +1 -1
- package/lib/commonjs/analytics/sentry/SentryAnalyticsSingleton.js +4 -4
- package/lib/commonjs/analytics/sentry/SentryAnalyticsSingleton.js.map +1 -1
- package/lib/commonjs/analytics/sentry/SentryAnalyticsUtils.js +8 -9
- package/lib/commonjs/analytics/sentry/SentryAnalyticsUtils.js.map +1 -1
- package/lib/commonjs/analytics/sentry/SentryModels.js.map +1 -1
- package/lib/commonjs/analytics/sentry/SentrySdkConstants.js +2 -0
- package/lib/commonjs/analytics/sentry/SentrySdkConstants.js.map +1 -1
- package/lib/commonjs/components/dispatch/DispatchExecNavigator.js +4 -5
- package/lib/commonjs/components/dispatch/DispatchExecNavigator.js.map +1 -1
- package/lib/commonjs/components/executiontasks/CompletedWFSchema.js.map +1 -1
- package/lib/commonjs/components/executiontasks/ExecutionTasksIndex.js.map +1 -1
- package/lib/commonjs/components/executiontasks/cancellation/CancelET.js +7 -9
- 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/CaptureInputSchema.js.map +1 -1
- package/lib/commonjs/components/executiontasks/captureInput/CaptureText.js +1 -1
- package/lib/commonjs/components/executiontasks/captureInput/CaptureText.js.map +1 -1
- package/lib/commonjs/components/executiontasks/captureInput/utils.js.map +1 -1
- package/lib/commonjs/components/executiontasks/deliver/DeliverET.js +14 -20
- 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 +15 -21
- package/lib/commonjs/components/executiontasks/deliver/SLDeliverET.js.map +1 -1
- package/lib/commonjs/components/executiontasks/display/DisplayModalET.js +1 -1
- package/lib/commonjs/components/executiontasks/display/DisplayModalET.js.map +1 -1
- package/lib/commonjs/components/executiontasks/display/DisplaySchema.js.map +1 -1
- package/lib/commonjs/components/executiontasks/doodle/SignatureET.js +1 -2
- package/lib/commonjs/components/executiontasks/doodle/SignatureET.js.map +1 -1
- package/lib/commonjs/components/executiontasks/doodle/SignatureSchema.js.map +1 -1
- package/lib/commonjs/components/executiontasks/dropCash/DropCashET.js +1 -1
- package/lib/commonjs/components/executiontasks/dropCash/DropCashET.js.map +1 -1
- package/lib/commonjs/components/executiontasks/dropCash/DropCashSchema.js.map +1 -1
- package/lib/commonjs/components/executiontasks/dropCash/SLDropCash.js +1 -1
- package/lib/commonjs/components/executiontasks/dropCash/SLDropCash.js.map +1 -1
- package/lib/commonjs/components/executiontasks/forms/FormGenerator.js +1 -1
- package/lib/commonjs/components/executiontasks/forms/FormGenerator.js.map +1 -1
- package/lib/commonjs/components/executiontasks/forms/FormSchema.js.map +1 -1
- package/lib/commonjs/components/executiontasks/forms/widgets/DateTimeWidget.js +12 -13
- package/lib/commonjs/components/executiontasks/forms/widgets/DateTimeWidget.js.map +1 -1
- package/lib/commonjs/components/executiontasks/forms/widgets/DropdownWidget.js +1 -1
- package/lib/commonjs/components/executiontasks/forms/widgets/DropdownWidget.js.map +1 -1
- package/lib/commonjs/components/executiontasks/forms/widgets/QRBarcodeScannerWidget.js +10 -11
- package/lib/commonjs/components/executiontasks/forms/widgets/QRBarcodeScannerWidget.js.map +1 -1
- package/lib/commonjs/components/executiontasks/forms/widgets/TimeRangeSelector.js +1 -1
- package/lib/commonjs/components/executiontasks/forms/widgets/TimeRangeSelector.js.map +1 -1
- package/lib/commonjs/components/executiontasks/httpRequest/HttpEtUtils.js.map +1 -1
- package/lib/commonjs/components/executiontasks/httpRequest/HttpRequestET.js +1 -1
- package/lib/commonjs/components/executiontasks/httpRequest/HttpRequestET.js.map +1 -1
- package/lib/commonjs/components/executiontasks/httpRequest/HttpRequestETSchema.js.map +1 -1
- package/lib/commonjs/components/executiontasks/imageCapture/CaptureSchema.js.map +1 -1
- package/lib/commonjs/components/executiontasks/imageCapture/CaptureUtils.js +2 -5
- package/lib/commonjs/components/executiontasks/imageCapture/CaptureUtils.js.map +1 -1
- package/lib/commonjs/components/executiontasks/imageCapture/ImageCapture.js +10 -12
- package/lib/commonjs/components/executiontasks/imageCapture/ImageCapture.js.map +1 -1
- package/lib/commonjs/components/executiontasks/payments/PaymentStyles.js.map +1 -1
- package/lib/commonjs/components/executiontasks/payments/PaymentUtils.js.map +1 -1
- package/lib/commonjs/components/executiontasks/payments/completePayment/CompletePaymentET.js +1 -1
- package/lib/commonjs/components/executiontasks/payments/completePayment/CompletePaymentET.js.map +1 -1
- package/lib/commonjs/components/executiontasks/payments/completePayment/CompletePaymentSchema.js.map +1 -1
- package/lib/commonjs/components/executiontasks/payments/init/InitPaymentET.js +4 -5
- package/lib/commonjs/components/executiontasks/payments/init/InitPaymentET.js.map +1 -1
- package/lib/commonjs/components/executiontasks/payments/init/InitPaymentSchema.js.map +1 -1
- package/lib/commonjs/components/executiontasks/payments/processPayment/ProcessPaymentET.js +1 -1
- package/lib/commonjs/components/executiontasks/payments/processPayment/ProcessPaymentET.js.map +1 -1
- package/lib/commonjs/components/executiontasks/payments/processPayment/ProcessPaymentSchema.js.map +1 -1
- package/lib/commonjs/components/executiontasks/pickup/PickpSchema.js.map +1 -1
- package/lib/commonjs/components/executiontasks/pickup/PickupET.js +14 -20
- package/lib/commonjs/components/executiontasks/pickup/PickupET.js.map +1 -1
- package/lib/commonjs/components/executiontasks/pickup/SLPickupET.js +15 -21
- package/lib/commonjs/components/executiontasks/pickup/SLPickupET.js.map +1 -1
- package/lib/commonjs/components/executiontasks/scan/ScanET.js +2 -4
- package/lib/commonjs/components/executiontasks/scan/ScanET.js.map +1 -1
- package/lib/commonjs/components/executiontasks/scan/ScanSchema.js.map +1 -1
- package/lib/commonjs/components/executiontasks/scan/constants.js.map +1 -1
- package/lib/commonjs/components/executiontasks/scan/interfaces.js.map +1 -1
- package/lib/commonjs/components/executiontasks/scan/modalConstant.js.map +1 -1
- package/lib/commonjs/components/executiontasks/scan/sub_components/CScanner.js +4 -5
- package/lib/commonjs/components/executiontasks/scan/sub_components/CScanner.js.map +1 -1
- package/lib/commonjs/components/executiontasks/scan/sub_components/DropDownUtils.js +0 -1
- package/lib/commonjs/components/executiontasks/scan/sub_components/DropDownUtils.js.map +1 -1
- package/lib/commonjs/components/executiontasks/scan/sub_components/ERDropDown.js +1 -3
- package/lib/commonjs/components/executiontasks/scan/sub_components/ERDropDown.js.map +1 -1
- package/lib/commonjs/components/executiontasks/scan/sub_components/SummaryPage.js +2 -5
- package/lib/commonjs/components/executiontasks/scan/sub_components/SummaryPage.js.map +1 -1
- package/lib/commonjs/components/executiontasks/scan/utils.js +1 -1
- package/lib/commonjs/components/executiontasks/scan/utils.js.map +1 -1
- package/lib/commonjs/components/executiontasks/validateOTP/ValidateOTPET.js +1 -1
- package/lib/commonjs/components/executiontasks/validateOTP/ValidateOTPET.js.map +1 -1
- package/lib/commonjs/components/executiontasks/validateOTP/ValidateOTPSchema.js.map +1 -1
- package/lib/commonjs/components/executiontasks/validateOTP/constants.js.map +1 -1
- package/lib/commonjs/components/executiontasks/validateOTP/sub-components/OTPInput.js +1 -1
- package/lib/commonjs/components/executiontasks/validateOTP/sub-components/OTPInput.js.map +1 -1
- package/lib/commonjs/components/executiontasks/validateOTP/utils.js +1 -1
- package/lib/commonjs/components/executiontasks/validateOTP/utils.js.map +1 -1
- package/lib/commonjs/components/executiontasks/verifyInput/VerifyInputSchema.js.map +1 -1
- package/lib/commonjs/components/executiontasks/verifyLocation/GeofenceUtils.js +1 -1
- package/lib/commonjs/components/executiontasks/verifyLocation/GeofenceUtils.js.map +1 -1
- package/lib/commonjs/components/executiontasks/verifyLocation/VerifyLocSchema.js.map +1 -1
- package/lib/commonjs/components/executiontasks/verifyLocation/VerifyLocationET.js +1 -1
- package/lib/commonjs/components/executiontasks/verifyLocation/VerifyLocationET.js.map +1 -1
- package/lib/commonjs/components/executiontasks/verifyOtp/VerifyOtpET.js +1 -1
- 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.map +1 -1
- package/lib/commonjs/components/widgets/AlertDisplay.js +1 -1
- package/lib/commonjs/components/widgets/AlertDisplay.js.map +1 -1
- package/lib/commonjs/components/widgets/CancelOrderDialog.js +1 -1
- package/lib/commonjs/components/widgets/CancelOrderDialog.js.map +1 -1
- package/lib/commonjs/components/widgets/Card.js +0 -1
- package/lib/commonjs/components/widgets/Card.js.map +1 -1
- package/lib/commonjs/components/widgets/GoBackModal.js.map +1 -1
- package/lib/commonjs/components/widgets/IconButton.js +19 -22
- package/lib/commonjs/components/widgets/IconButton.js.map +1 -1
- package/lib/commonjs/components/widgets/ModalWidget.js.map +1 -1
- package/lib/commonjs/components/widgets/ProgressDialog.js.map +1 -1
- package/lib/commonjs/components/widgets/SearchBar.js.map +1 -1
- package/lib/commonjs/components/widgets/SnackBarCustom.js +15 -18
- package/lib/commonjs/components/widgets/SnackBarCustom.js.map +1 -1
- package/lib/commonjs/components/widgets/SplitTextInput.js +9 -10
- package/lib/commonjs/components/widgets/SplitTextInput.js.map +1 -1
- package/lib/commonjs/components/widgets/TabsComponent.js +1 -1
- package/lib/commonjs/components/widgets/TabsComponent.js.map +1 -1
- package/lib/commonjs/components/widgets/Toaster.js.map +1 -1
- package/lib/commonjs/config/DispatchSDKConfig.js.map +1 -1
- package/lib/commonjs/constants/apiConstants.js.map +1 -1
- package/lib/commonjs/constants/constants.js.map +1 -1
- package/lib/commonjs/constants/statuscode.js.map +1 -1
- package/lib/commonjs/errors/BaseError.js +2 -2
- package/lib/commonjs/errors/BaseError.js.map +1 -1
- package/lib/commonjs/errors/ErrorCodes.js.map +1 -1
- package/lib/commonjs/events/EventDispatcher.js.map +1 -1
- package/lib/commonjs/events/EventListener.js.map +1 -1
- package/lib/commonjs/events/constants.js.map +1 -1
- package/lib/commonjs/events/index.js.map +1 -1
- package/lib/commonjs/events/interface.js.map +1 -1
- package/lib/commonjs/icons/ScanIcon.js.map +1 -1
- package/lib/commonjs/icons/file.js.map +1 -1
- package/lib/commonjs/icons/interface.js.map +1 -1
- package/lib/commonjs/index.js +1 -1
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/locale/Str.js.map +1 -1
- package/lib/commonjs/locale/i18n.js.map +1 -1
- package/lib/commonjs/locale/util.js.map +1 -1
- package/lib/commonjs/manager/dispatch/DispatchStateContainer.js +5 -5
- package/lib/commonjs/manager/dispatch/DispatchStateContainer.js.map +1 -1
- package/lib/commonjs/manager/dispatchCodes/EventCodeContainer.js +4 -4
- package/lib/commonjs/manager/dispatchCodes/EventCodeContainer.js.map +1 -1
- package/lib/commonjs/manager/dispatchCodes/EventCodeRepo.js +5 -5
- package/lib/commonjs/manager/dispatchCodes/EventCodeRepo.js.map +1 -1
- package/lib/commonjs/manager/dispatchCodes/ReasonCodeContainer.js +5 -5
- package/lib/commonjs/manager/dispatchCodes/ReasonCodeContainer.js.map +1 -1
- package/lib/commonjs/manager/dispatchCodes/ReasonCodeRepo.js +5 -5
- package/lib/commonjs/manager/dispatchCodes/ReasonCodeRepo.js.map +1 -1
- package/lib/commonjs/manager/jobRemoval/JobRemovalManager.js.map +1 -1
- package/lib/commonjs/manager/location/LocationManager.js +5 -5
- package/lib/commonjs/manager/location/LocationManager.js.map +1 -1
- package/lib/commonjs/manager/sdk/DispatchSDKManager.js +8 -8
- package/lib/commonjs/manager/sdk/DispatchSDKManager.js.map +1 -1
- package/lib/commonjs/manager/sdk/DispatchSdkCache.js +4 -4
- package/lib/commonjs/manager/sdk/DispatchSdkCache.js.map +1 -1
- package/lib/commonjs/manager/sdk/callbacksHandler.js +30 -3
- package/lib/commonjs/manager/sdk/callbacksHandler.js.map +1 -1
- package/lib/commonjs/manager/syncmanager/AppSyncManager.js +5 -5
- package/lib/commonjs/manager/syncmanager/AppSyncManager.js.map +1 -1
- package/lib/commonjs/manager/syncmanager/DBConfig.js.map +1 -1
- package/lib/commonjs/manager/syncmanager/NativeSyncManager.js.map +1 -1
- package/lib/commonjs/manager/syncmanager/constants.js.map +1 -1
- package/lib/commonjs/manager/syncmanager/database.js +1 -1
- package/lib/commonjs/manager/syncmanager/database.js.map +1 -1
- package/lib/commonjs/manager/syncmanager/document/DocumentHttpClient.js +38 -21
- package/lib/commonjs/manager/syncmanager/document/DocumentHttpClient.js.map +1 -1
- package/lib/commonjs/manager/syncmanager/document/DocumentManager.js +12 -5
- package/lib/commonjs/manager/syncmanager/document/DocumentManager.js.map +1 -1
- package/lib/commonjs/manager/syncmanager/document/DocumentSyncManager.js +130 -42
- package/lib/commonjs/manager/syncmanager/document/DocumentSyncManager.js.map +1 -1
- package/lib/commonjs/manager/syncmanager/document/models.js.map +1 -1
- package/lib/commonjs/manager/syncmanager/events/ETEventsManager.js +5 -6
- package/lib/commonjs/manager/syncmanager/events/ETEventsManager.js.map +1 -1
- package/lib/commonjs/manager/syncmanager/events/EventsGraphQLClient.js.map +1 -1
- package/lib/commonjs/manager/syncmanager/events/EventsSyncManager.js +5 -6
- package/lib/commonjs/manager/syncmanager/events/EventsSyncManager.js.map +1 -1
- package/lib/commonjs/manager/syncmanager/events/SyncHttpClient.js +2 -6
- package/lib/commonjs/manager/syncmanager/events/SyncHttpClient.js.map +1 -1
- package/lib/commonjs/models/DispatchModels.js.map +1 -1
- package/lib/commonjs/models/ReasonCodes.js.map +1 -1
- package/lib/commonjs/models/auth.js.map +1 -1
- package/lib/commonjs/models/execTasks/ETBaseModels.js.map +1 -1
- package/lib/commonjs/models/execTasks/ETConfig.js.map +1 -1
- package/lib/commonjs/models/execution.js.map +1 -1
- package/lib/commonjs/models/fcm.js.map +1 -1
- package/lib/commonjs/models/sdk.js.map +1 -1
- package/lib/commonjs/native/signature/SignatureCapture.js +2 -2
- package/lib/commonjs/native/signature/SignatureCapture.js.map +1 -1
- package/lib/commonjs/network/GraphQLClient.js +13 -17
- package/lib/commonjs/network/GraphQLClient.js.map +1 -1
- package/lib/commonjs/network/NetworkClient.js +12 -2
- package/lib/commonjs/network/NetworkClient.js.map +1 -1
- package/lib/commonjs/network/NetworkUtils.js +14 -10
- package/lib/commonjs/network/NetworkUtils.js.map +1 -1
- package/lib/commonjs/network/Queries.js.map +1 -1
- package/lib/commonjs/network/client.js +3 -4
- package/lib/commonjs/network/client.js.map +1 -1
- package/lib/commonjs/res/strings.js.map +1 -1
- package/lib/commonjs/resources/Login.js +2 -2
- package/lib/commonjs/resources/Login.js.map +1 -1
- package/lib/commonjs/resources/network.js +2 -2
- package/lib/commonjs/resources/network.js.map +1 -1
- package/lib/commonjs/styles/SdkColors.js.map +1 -1
- package/lib/commonjs/styles/executionTasks/CommonStyles.js +1 -1
- package/lib/commonjs/styles/executionTasks/CommonStyles.js.map +1 -1
- package/lib/commonjs/ui/screens/CancellationScreen.js +6 -7
- package/lib/commonjs/ui/screens/CancellationScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/CaptureInputScreen.js +6 -7
- package/lib/commonjs/ui/screens/CaptureInputScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/CompleteObjectiveScreen.js +6 -7
- package/lib/commonjs/ui/screens/CompleteObjectiveScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/DeliverScreen.js +6 -7
- package/lib/commonjs/ui/screens/DeliverScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/DisplayScreen.js +6 -7
- package/lib/commonjs/ui/screens/DisplayScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/DoodleScreen.js +6 -7
- package/lib/commonjs/ui/screens/DoodleScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/DropCashScreen.js +7 -7
- package/lib/commonjs/ui/screens/DropCashScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/ETScreensIndex.js.map +1 -1
- package/lib/commonjs/ui/screens/FormsScreen.js +6 -7
- package/lib/commonjs/ui/screens/FormsScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/GeofenceScreen.js +6 -7
- package/lib/commonjs/ui/screens/GeofenceScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/HttpRequestScreen.js +5 -6
- package/lib/commonjs/ui/screens/HttpRequestScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/ImageCaptureScreen.js +6 -7
- package/lib/commonjs/ui/screens/ImageCaptureScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/PaymentScreen.js +6 -7
- package/lib/commonjs/ui/screens/PaymentScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/PickupScreen.js +6 -7
- package/lib/commonjs/ui/screens/PickupScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/ScanScreen.js +6 -8
- package/lib/commonjs/ui/screens/ScanScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/StartWorkFlowScreen.js +6 -7
- package/lib/commonjs/ui/screens/StartWorkFlowScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/ValidateOTPScreen.js +6 -7
- package/lib/commonjs/ui/screens/ValidateOTPScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/WithBaseDispatchScreen.js +1 -1
- package/lib/commonjs/ui/screens/WithBaseDispatchScreen.js.map +1 -1
- package/lib/commonjs/ui/uiConfig/RouteParams.js.map +1 -1
- package/lib/commonjs/utils/ApiUtils.js.map +1 -1
- package/lib/commonjs/utils/ExecTaskUtils.js +1 -2
- package/lib/commonjs/utils/ExecTaskUtils.js.map +1 -1
- package/lib/commonjs/utils/Logger.js +4 -5
- package/lib/commonjs/utils/Logger.js.map +1 -1
- package/lib/commonjs/utils/NetworkUtil.js +2 -2
- package/lib/commonjs/utils/NetworkUtil.js.map +1 -1
- package/lib/commonjs/utils/SdkUtils.js +1 -1
- package/lib/commonjs/utils/SdkUtils.js.map +1 -1
- package/lib/commonjs/utils/SyncManagerUtils.js +1 -1
- package/lib/commonjs/utils/SyncManagerUtils.js.map +1 -1
- package/lib/commonjs/utils/fcm/FCM.js +1 -1
- package/lib/commonjs/utils/fcm/FCM.js.map +1 -1
- package/lib/commonjs/utils/fcm/FcmUtils.js +1 -1
- package/lib/commonjs/utils/fcm/FcmUtils.js.map +1 -1
- package/lib/commonjs/utils/helper.js +4 -4
- package/lib/commonjs/utils/helper.js.map +1 -1
- package/lib/commonjs/utils/hooks/useModal.js +2 -1
- package/lib/commonjs/utils/hooks/useModal.js.map +1 -1
- package/lib/commonjs/utils/hooks/useTimer.js.map +1 -1
- package/lib/commonjs/utils/loginHelper.js.map +1 -1
- package/lib/commonjs/utils/storage.js +6 -9
- package/lib/commonjs/utils/storage.js.map +1 -1
- package/lib/commonjs/utils/utils.js +1 -3
- package/lib/commonjs/utils/utils.js.map +1 -1
- package/lib/module/@types/assets/index.d.js.map +1 -1
- package/lib/module/analytics/firebase/FirebaseLogging.js.map +1 -1
- package/lib/module/analytics/sentry/SentryAnalyticsSingleton.js +4 -4
- package/lib/module/analytics/sentry/SentryAnalyticsSingleton.js.map +1 -1
- package/lib/module/analytics/sentry/SentryAnalyticsUtils.js +7 -8
- package/lib/module/analytics/sentry/SentryAnalyticsUtils.js.map +1 -1
- package/lib/module/analytics/sentry/SentryModels.js.map +1 -1
- package/lib/module/analytics/sentry/SentrySdkConstants.js +2 -0
- package/lib/module/analytics/sentry/SentrySdkConstants.js.map +1 -1
- package/lib/module/components/dispatch/DispatchExecNavigator.js +3 -4
- package/lib/module/components/dispatch/DispatchExecNavigator.js.map +1 -1
- package/lib/module/components/executiontasks/CompletedWFSchema.js.map +1 -1
- package/lib/module/components/executiontasks/ExecutionTasksIndex.js.map +1 -1
- package/lib/module/components/executiontasks/cancellation/CancelET.js +6 -8
- 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/CaptureInputSchema.js.map +1 -1
- package/lib/module/components/executiontasks/captureInput/CaptureText.js.map +1 -1
- package/lib/module/components/executiontasks/captureInput/utils.js.map +1 -1
- package/lib/module/components/executiontasks/deliver/DeliverET.js +13 -19
- 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 +14 -20
- package/lib/module/components/executiontasks/deliver/SLDeliverET.js.map +1 -1
- package/lib/module/components/executiontasks/display/DisplayModalET.js.map +1 -1
- package/lib/module/components/executiontasks/display/DisplaySchema.js.map +1 -1
- package/lib/module/components/executiontasks/doodle/SignatureET.js +0 -1
- package/lib/module/components/executiontasks/doodle/SignatureET.js.map +1 -1
- package/lib/module/components/executiontasks/doodle/SignatureSchema.js.map +1 -1
- package/lib/module/components/executiontasks/dropCash/DropCashET.js.map +1 -1
- package/lib/module/components/executiontasks/dropCash/DropCashSchema.js.map +1 -1
- package/lib/module/components/executiontasks/dropCash/SLDropCash.js.map +1 -1
- package/lib/module/components/executiontasks/forms/FormGenerator.js.map +1 -1
- package/lib/module/components/executiontasks/forms/FormSchema.js.map +1 -1
- package/lib/module/components/executiontasks/forms/widgets/DateTimeWidget.js +11 -12
- package/lib/module/components/executiontasks/forms/widgets/DateTimeWidget.js.map +1 -1
- package/lib/module/components/executiontasks/forms/widgets/DropdownWidget.js.map +1 -1
- package/lib/module/components/executiontasks/forms/widgets/QRBarcodeScannerWidget.js +9 -10
- package/lib/module/components/executiontasks/forms/widgets/QRBarcodeScannerWidget.js.map +1 -1
- package/lib/module/components/executiontasks/forms/widgets/TimeRangeSelector.js.map +1 -1
- package/lib/module/components/executiontasks/httpRequest/HttpEtUtils.js.map +1 -1
- package/lib/module/components/executiontasks/httpRequest/HttpRequestET.js.map +1 -1
- package/lib/module/components/executiontasks/httpRequest/HttpRequestETSchema.js.map +1 -1
- package/lib/module/components/executiontasks/imageCapture/CaptureSchema.js.map +1 -1
- package/lib/module/components/executiontasks/imageCapture/CaptureUtils.js +1 -4
- package/lib/module/components/executiontasks/imageCapture/CaptureUtils.js.map +1 -1
- package/lib/module/components/executiontasks/imageCapture/ImageCapture.js +9 -11
- 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.map +1 -1
- package/lib/module/components/executiontasks/payments/completePayment/CompletePaymentSchema.js.map +1 -1
- package/lib/module/components/executiontasks/payments/init/InitPaymentET.js +3 -4
- package/lib/module/components/executiontasks/payments/init/InitPaymentET.js.map +1 -1
- package/lib/module/components/executiontasks/payments/init/InitPaymentSchema.js.map +1 -1
- package/lib/module/components/executiontasks/payments/processPayment/ProcessPaymentET.js.map +1 -1
- package/lib/module/components/executiontasks/payments/processPayment/ProcessPaymentSchema.js.map +1 -1
- package/lib/module/components/executiontasks/pickup/PickpSchema.js.map +1 -1
- package/lib/module/components/executiontasks/pickup/PickupET.js +13 -19
- package/lib/module/components/executiontasks/pickup/PickupET.js.map +1 -1
- package/lib/module/components/executiontasks/pickup/SLPickupET.js +14 -20
- package/lib/module/components/executiontasks/pickup/SLPickupET.js.map +1 -1
- package/lib/module/components/executiontasks/scan/ScanET.js +1 -3
- package/lib/module/components/executiontasks/scan/ScanET.js.map +1 -1
- package/lib/module/components/executiontasks/scan/ScanSchema.js.map +1 -1
- package/lib/module/components/executiontasks/scan/constants.js.map +1 -1
- package/lib/module/components/executiontasks/scan/interfaces.js.map +1 -1
- package/lib/module/components/executiontasks/scan/modalConstant.js.map +1 -1
- package/lib/module/components/executiontasks/scan/sub_components/CScanner.js +3 -4
- package/lib/module/components/executiontasks/scan/sub_components/CScanner.js.map +1 -1
- package/lib/module/components/executiontasks/scan/sub_components/DropDownUtils.js +0 -1
- package/lib/module/components/executiontasks/scan/sub_components/DropDownUtils.js.map +1 -1
- package/lib/module/components/executiontasks/scan/sub_components/ERDropDown.js +0 -2
- package/lib/module/components/executiontasks/scan/sub_components/ERDropDown.js.map +1 -1
- package/lib/module/components/executiontasks/scan/sub_components/SummaryPage.js +1 -4
- package/lib/module/components/executiontasks/scan/sub_components/SummaryPage.js.map +1 -1
- package/lib/module/components/executiontasks/scan/utils.js.map +1 -1
- package/lib/module/components/executiontasks/validateOTP/ValidateOTPET.js.map +1 -1
- package/lib/module/components/executiontasks/validateOTP/ValidateOTPSchema.js.map +1 -1
- package/lib/module/components/executiontasks/validateOTP/constants.js.map +1 -1
- package/lib/module/components/executiontasks/validateOTP/sub-components/OTPInput.js.map +1 -1
- package/lib/module/components/executiontasks/validateOTP/utils.js.map +1 -1
- package/lib/module/components/executiontasks/verifyInput/VerifyInputSchema.js.map +1 -1
- package/lib/module/components/executiontasks/verifyLocation/GeofenceUtils.js.map +1 -1
- package/lib/module/components/executiontasks/verifyLocation/VerifyLocSchema.js.map +1 -1
- package/lib/module/components/executiontasks/verifyLocation/VerifyLocationET.js.map +1 -1
- 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.map +1 -1
- package/lib/module/components/widgets/AlertDisplay.js.map +1 -1
- package/lib/module/components/widgets/CancelOrderDialog.js.map +1 -1
- package/lib/module/components/widgets/Card.js +0 -1
- package/lib/module/components/widgets/Card.js.map +1 -1
- package/lib/module/components/widgets/GoBackModal.js.map +1 -1
- package/lib/module/components/widgets/IconButton.js +19 -22
- package/lib/module/components/widgets/IconButton.js.map +1 -1
- package/lib/module/components/widgets/ModalWidget.js.map +1 -1
- package/lib/module/components/widgets/ProgressDialog.js.map +1 -1
- package/lib/module/components/widgets/SearchBar.js.map +1 -1
- package/lib/module/components/widgets/SnackBarCustom.js +15 -18
- package/lib/module/components/widgets/SnackBarCustom.js.map +1 -1
- package/lib/module/components/widgets/SplitTextInput.js +8 -9
- package/lib/module/components/widgets/SplitTextInput.js.map +1 -1
- package/lib/module/components/widgets/TabsComponent.js.map +1 -1
- package/lib/module/components/widgets/Toaster.js.map +1 -1
- package/lib/module/config/DispatchSDKConfig.js.map +1 -1
- package/lib/module/constants/apiConstants.js.map +1 -1
- package/lib/module/constants/constants.js.map +1 -1
- package/lib/module/constants/statuscode.js.map +1 -1
- package/lib/module/errors/BaseError.js +2 -2
- package/lib/module/errors/BaseError.js.map +1 -1
- package/lib/module/errors/ErrorCodes.js.map +1 -1
- package/lib/module/events/EventDispatcher.js.map +1 -1
- package/lib/module/events/EventListener.js.map +1 -1
- package/lib/module/events/constants.js.map +1 -1
- package/lib/module/events/index.js.map +1 -1
- package/lib/module/events/interface.js.map +1 -1
- package/lib/module/icons/ScanIcon.js.map +1 -1
- package/lib/module/icons/file.js.map +1 -1
- package/lib/module/icons/interface.js.map +1 -1
- package/lib/module/index.js.map +1 -1
- package/lib/module/locale/Str.js.map +1 -1
- package/lib/module/locale/i18n.js.map +1 -1
- package/lib/module/locale/util.js.map +1 -1
- package/lib/module/manager/dispatch/DispatchStateContainer.js +4 -4
- package/lib/module/manager/dispatch/DispatchStateContainer.js.map +1 -1
- package/lib/module/manager/dispatchCodes/EventCodeContainer.js +4 -4
- package/lib/module/manager/dispatchCodes/EventCodeContainer.js.map +1 -1
- package/lib/module/manager/dispatchCodes/EventCodeRepo.js +4 -4
- package/lib/module/manager/dispatchCodes/EventCodeRepo.js.map +1 -1
- package/lib/module/manager/dispatchCodes/ReasonCodeContainer.js +4 -4
- package/lib/module/manager/dispatchCodes/ReasonCodeContainer.js.map +1 -1
- package/lib/module/manager/dispatchCodes/ReasonCodeRepo.js +4 -4
- package/lib/module/manager/dispatchCodes/ReasonCodeRepo.js.map +1 -1
- package/lib/module/manager/jobRemoval/JobRemovalManager.js.map +1 -1
- package/lib/module/manager/location/LocationManager.js +4 -4
- package/lib/module/manager/location/LocationManager.js.map +1 -1
- package/lib/module/manager/sdk/DispatchSDKManager.js +7 -7
- package/lib/module/manager/sdk/DispatchSDKManager.js.map +1 -1
- package/lib/module/manager/sdk/DispatchSdkCache.js +4 -4
- package/lib/module/manager/sdk/DispatchSdkCache.js.map +1 -1
- package/lib/module/manager/sdk/callbacksHandler.js +29 -3
- package/lib/module/manager/sdk/callbacksHandler.js.map +1 -1
- package/lib/module/manager/syncmanager/AppSyncManager.js +4 -4
- package/lib/module/manager/syncmanager/AppSyncManager.js.map +1 -1
- package/lib/module/manager/syncmanager/DBConfig.js +1 -0
- 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.map +1 -1
- package/lib/module/manager/syncmanager/database.js.map +1 -1
- package/lib/module/manager/syncmanager/document/DocumentHttpClient.js +38 -21
- package/lib/module/manager/syncmanager/document/DocumentHttpClient.js.map +1 -1
- package/lib/module/manager/syncmanager/document/DocumentManager.js +11 -4
- package/lib/module/manager/syncmanager/document/DocumentManager.js.map +1 -1
- package/lib/module/manager/syncmanager/document/DocumentSyncManager.js +129 -41
- package/lib/module/manager/syncmanager/document/DocumentSyncManager.js.map +1 -1
- package/lib/module/manager/syncmanager/document/models.js.map +1 -1
- package/lib/module/manager/syncmanager/events/ETEventsManager.js +4 -5
- package/lib/module/manager/syncmanager/events/ETEventsManager.js.map +1 -1
- package/lib/module/manager/syncmanager/events/EventsGraphQLClient.js.map +1 -1
- package/lib/module/manager/syncmanager/events/EventsSyncManager.js +4 -5
- package/lib/module/manager/syncmanager/events/EventsSyncManager.js.map +1 -1
- package/lib/module/manager/syncmanager/events/SyncHttpClient.js +2 -6
- package/lib/module/manager/syncmanager/events/SyncHttpClient.js.map +1 -1
- package/lib/module/models/DispatchModels.js.map +1 -1
- package/lib/module/models/ReasonCodes.js.map +1 -1
- package/lib/module/models/auth.js.map +1 -1
- package/lib/module/models/execTasks/ETBaseModels.js.map +1 -1
- package/lib/module/models/execTasks/ETConfig.js.map +1 -1
- package/lib/module/models/execution.js.map +1 -1
- package/lib/module/models/fcm.js.map +1 -1
- package/lib/module/models/sdk.js.map +1 -1
- package/lib/module/native/signature/SignatureCapture.js +2 -2
- package/lib/module/native/signature/SignatureCapture.js.map +1 -1
- package/lib/module/network/GraphQLClient.js +13 -17
- package/lib/module/network/GraphQLClient.js.map +1 -1
- package/lib/module/network/NetworkClient.js +12 -2
- package/lib/module/network/NetworkClient.js.map +1 -1
- package/lib/module/network/NetworkUtils.js +14 -10
- package/lib/module/network/NetworkUtils.js.map +1 -1
- package/lib/module/network/Queries.js.map +1 -1
- package/lib/module/network/client.js +3 -4
- package/lib/module/network/client.js.map +1 -1
- package/lib/module/res/strings.js.map +1 -1
- package/lib/module/resources/Login.js +2 -2
- package/lib/module/resources/Login.js.map +1 -1
- package/lib/module/resources/network.js +2 -2
- package/lib/module/resources/network.js.map +1 -1
- package/lib/module/styles/SdkColors.js.map +1 -1
- package/lib/module/styles/executionTasks/CommonStyles.js.map +1 -1
- package/lib/module/ui/screens/CancellationScreen.js +5 -6
- package/lib/module/ui/screens/CancellationScreen.js.map +1 -1
- package/lib/module/ui/screens/CaptureInputScreen.js +5 -6
- package/lib/module/ui/screens/CaptureInputScreen.js.map +1 -1
- package/lib/module/ui/screens/CompleteObjectiveScreen.js +5 -6
- package/lib/module/ui/screens/CompleteObjectiveScreen.js.map +1 -1
- package/lib/module/ui/screens/DeliverScreen.js +5 -6
- package/lib/module/ui/screens/DeliverScreen.js.map +1 -1
- package/lib/module/ui/screens/DisplayScreen.js +5 -6
- package/lib/module/ui/screens/DisplayScreen.js.map +1 -1
- package/lib/module/ui/screens/DoodleScreen.js +5 -6
- package/lib/module/ui/screens/DoodleScreen.js.map +1 -1
- package/lib/module/ui/screens/DropCashScreen.js +5 -6
- package/lib/module/ui/screens/DropCashScreen.js.map +1 -1
- package/lib/module/ui/screens/ETScreensIndex.js.map +1 -1
- package/lib/module/ui/screens/FormsScreen.js +5 -6
- package/lib/module/ui/screens/FormsScreen.js.map +1 -1
- package/lib/module/ui/screens/GeofenceScreen.js +5 -6
- package/lib/module/ui/screens/GeofenceScreen.js.map +1 -1
- package/lib/module/ui/screens/HttpRequestScreen.js +5 -6
- package/lib/module/ui/screens/HttpRequestScreen.js.map +1 -1
- package/lib/module/ui/screens/ImageCaptureScreen.js +5 -6
- package/lib/module/ui/screens/ImageCaptureScreen.js.map +1 -1
- package/lib/module/ui/screens/PaymentScreen.js +5 -6
- package/lib/module/ui/screens/PaymentScreen.js.map +1 -1
- package/lib/module/ui/screens/PickupScreen.js +5 -6
- package/lib/module/ui/screens/PickupScreen.js.map +1 -1
- package/lib/module/ui/screens/ScanScreen.js +5 -7
- package/lib/module/ui/screens/ScanScreen.js.map +1 -1
- package/lib/module/ui/screens/StartWorkFlowScreen.js +5 -6
- package/lib/module/ui/screens/StartWorkFlowScreen.js.map +1 -1
- package/lib/module/ui/screens/ValidateOTPScreen.js +5 -6
- package/lib/module/ui/screens/ValidateOTPScreen.js.map +1 -1
- package/lib/module/ui/screens/WithBaseDispatchScreen.js.map +1 -1
- package/lib/module/ui/uiConfig/RouteParams.js.map +1 -1
- package/lib/module/utils/ApiUtils.js.map +1 -1
- package/lib/module/utils/ExecTaskUtils.js +1 -2
- package/lib/module/utils/ExecTaskUtils.js.map +1 -1
- package/lib/module/utils/Logger.js +4 -5
- package/lib/module/utils/Logger.js.map +1 -1
- package/lib/module/utils/NetworkUtil.js +2 -2
- package/lib/module/utils/NetworkUtil.js.map +1 -1
- package/lib/module/utils/SdkUtils.js.map +1 -1
- package/lib/module/utils/SyncManagerUtils.js.map +1 -1
- package/lib/module/utils/fcm/FCM.js.map +1 -1
- package/lib/module/utils/fcm/FcmUtils.js.map +1 -1
- package/lib/module/utils/helper.js +4 -4
- package/lib/module/utils/helper.js.map +1 -1
- package/lib/module/utils/hooks/useModal.js +1 -0
- package/lib/module/utils/hooks/useModal.js.map +1 -1
- package/lib/module/utils/hooks/useTimer.js.map +1 -1
- package/lib/module/utils/loginHelper.js.map +1 -1
- package/lib/module/utils/storage.js +5 -8
- package/lib/module/utils/storage.js.map +1 -1
- package/lib/module/utils/utils.js +1 -3
- package/lib/module/utils/utils.js.map +1 -1
- package/lib/typescript/analytics/sentry/SentrySdkConstants.d.ts +2 -0
- package/lib/typescript/manager/sdk/callbacksHandler.d.ts +3 -1
- package/lib/typescript/manager/syncmanager/document/DocumentManager.d.ts +1 -0
- package/lib/typescript/models/sdk.d.ts +1 -0
- package/package.json +1 -1
- package/src/analytics/sentry/SentrySdkConstants.ts +2 -0
- package/src/components/executiontasks/imageCapture/CaptureUtils.ts +2 -3
- package/src/index.tsx +1 -1
- package/src/manager/sdk/DispatchSDKManager.ts +6 -2
- package/src/manager/sdk/callbacksHandler.ts +39 -2
- package/src/manager/syncmanager/document/DocumentHttpClient.ts +54 -24
- package/src/manager/syncmanager/document/DocumentManager.ts +15 -0
- package/src/manager/syncmanager/document/DocumentSyncManager.ts +139 -37
- package/src/models/auth.ts +1 -0
- package/src/models/sdk.ts +1 -0
- package/src/network/NetworkClient.ts +18 -2
- package/src/network/NetworkUtils.ts +9 -1
- package/src/network/client.ts +1 -1
- package/android/.gradle/6.8/fileChanges/last-build.bin +0 -0
- package/android/.gradle/6.8/fileHashes/fileHashes.lock +0 -0
- package/android/.gradle/6.8/gc.properties +0 -0
- package/android/.gradle/checksums/checksums.lock +0 -0
- package/android/.gradle/configuration-cache/gc.properties +0 -0
- package/android/.gradle/vcs-1/gc.properties +0 -0
- package/android/.idea/gradle.xml +0 -13
- package/android/.idea/misc.xml +0 -10
- package/android/.idea/vcs.xml +0 -6
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
var
|
|
1
|
+
var _DocumentSyncManager;
|
|
2
2
|
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; }
|
|
3
|
-
function _toPropertyKey(
|
|
4
|
-
function _toPrimitive(
|
|
3
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
4
|
+
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
5
5
|
import DocumentManager from './DocumentManager';
|
|
6
6
|
import DocumentHttpClient from './DocumentHttpClient';
|
|
7
7
|
import { isEmptyOrBlank, flattenObject } from '../../../utils/utils';
|
|
@@ -11,7 +11,6 @@ import Logger, { LOG_TYPE } from '../../../utils/Logger';
|
|
|
11
11
|
import NetworkUtil from '../../../utils/NetworkUtil';
|
|
12
12
|
import Marker, { Position, TextBackgroundType, ImageFormat } from 'react-native-image-marker';
|
|
13
13
|
import RNFS from 'react-native-fs';
|
|
14
|
-
import Storage from '../../../utils/storage';
|
|
15
14
|
import { Platform } from 'react-native';
|
|
16
15
|
import { SentryEventNameSdkConstants, SeverityLevelValue } from '../../../analytics/sentry/SentrySdkConstants';
|
|
17
16
|
import { fireEventWithScreenName } from '../../../analytics/sentry/SentryAnalyticsUtils';
|
|
@@ -55,10 +54,30 @@ export default class DocumentSyncManager {
|
|
|
55
54
|
if ((documentRows === null || documentRows === void 0 ? void 0 : documentRows.length) > 0) {
|
|
56
55
|
await this.uploadDocToServer(documentRows[0]);
|
|
57
56
|
} else {
|
|
58
|
-
|
|
57
|
+
let cta = 'startDocumentSync';
|
|
58
|
+
fireEventWithScreenName({
|
|
59
|
+
severityLevel: SeverityLevelValue.LOG,
|
|
60
|
+
eventName: SentryEventNameSdkConstants.APP_LOG,
|
|
61
|
+
screenName: cta,
|
|
62
|
+
cta: cta,
|
|
63
|
+
extraParams: {
|
|
64
|
+
msg: 'No data to sync'
|
|
65
|
+
}
|
|
66
|
+
});
|
|
67
|
+
Logger.getInstance().logEvent(cta, 'No data to sync', LOG_TYPE.SDK_ERROR);
|
|
59
68
|
}
|
|
60
69
|
} else {
|
|
61
|
-
|
|
70
|
+
let cta = 'startDocumentSync';
|
|
71
|
+
fireEventWithScreenName({
|
|
72
|
+
severityLevel: SeverityLevelValue.LOG,
|
|
73
|
+
eventName: SentryEventNameSdkConstants.APP_LOG,
|
|
74
|
+
screenName: cta,
|
|
75
|
+
cta: cta,
|
|
76
|
+
extraParams: {
|
|
77
|
+
msg: 'No Network'
|
|
78
|
+
}
|
|
79
|
+
});
|
|
80
|
+
Logger.getInstance().logEvent(cta, 'No Network', LOG_TYPE.SDK_ERROR);
|
|
62
81
|
}
|
|
63
82
|
} catch (error) {} finally {
|
|
64
83
|
this.inProgress = false;
|
|
@@ -67,7 +86,26 @@ export default class DocumentSyncManager {
|
|
|
67
86
|
}
|
|
68
87
|
}
|
|
69
88
|
} else {
|
|
70
|
-
|
|
89
|
+
if (!this.docManager) {
|
|
90
|
+
this.docManager = await DocumentManager.getInstance();
|
|
91
|
+
}
|
|
92
|
+
let documentRows = await this.docManager.getUnsyncedDocument();
|
|
93
|
+
if ((documentRows === null || documentRows === void 0 ? void 0 : documentRows.length) > 0) {
|
|
94
|
+
await this.docManager.updateDocPriority(documentRows[0].id, documentRows[0].priority + 1);
|
|
95
|
+
this._retries = 0;
|
|
96
|
+
this.startDocumentSync();
|
|
97
|
+
}
|
|
98
|
+
let cta = 'startDocumentSync';
|
|
99
|
+
fireEventWithScreenName({
|
|
100
|
+
severityLevel: SeverityLevelValue.LOG,
|
|
101
|
+
eventName: SentryEventNameSdkConstants.APP_LOG,
|
|
102
|
+
screenName: cta,
|
|
103
|
+
cta: cta,
|
|
104
|
+
extraParams: {
|
|
105
|
+
msg: 'sync already in progress'
|
|
106
|
+
}
|
|
107
|
+
});
|
|
108
|
+
Logger.getInstance().logEvent(cta, 'sync already in progress', LOG_TYPE.SDK_ERROR);
|
|
71
109
|
}
|
|
72
110
|
}
|
|
73
111
|
async isSyncPending() {
|
|
@@ -78,15 +116,24 @@ export default class DocumentSyncManager {
|
|
|
78
116
|
async insertDocument(fmsFolderID, data, base64, desc, dspID,
|
|
79
117
|
// jobID: string,
|
|
80
118
|
// objRef: string,
|
|
81
|
-
filePath, fileType, fileName, geoTimeStamp, processedFilePath) {
|
|
82
|
-
let priority = arguments.length > 10 && arguments[10] !== undefined ? arguments[10] : 1;
|
|
119
|
+
filePath, fileType, fileName, geoTimeStamp, processedFilePath, priority = 1) {
|
|
83
120
|
if (isEmptyOrBlank(desc) || isEmptyOrBlank(dspID) ||
|
|
84
121
|
// isEmptyOrBlank(jobID) ||
|
|
85
122
|
// isEmptyOrBlank(objRef) ||
|
|
86
123
|
isEmptyOrBlank(fileType) || isEmptyOrBlank(fileName) || base64 && isEmptyOrBlank(data) || !base64 && isEmptyOrBlank(filePath)) throw new BaseError(BaseErrorCodes.InvalidArgumentError, InvalidArgumentsError);else {
|
|
87
124
|
var _this$docManager;
|
|
88
125
|
if (!this.docManager) {
|
|
89
|
-
|
|
126
|
+
let cta = 'insertDocument';
|
|
127
|
+
fireEventWithScreenName({
|
|
128
|
+
severityLevel: SeverityLevelValue.LOG,
|
|
129
|
+
eventName: SentryEventNameSdkConstants.APP_LOG,
|
|
130
|
+
screenName: cta,
|
|
131
|
+
cta: cta,
|
|
132
|
+
extraParams: {
|
|
133
|
+
msg: 'INIT DOC SYNC AGAIN'
|
|
134
|
+
}
|
|
135
|
+
});
|
|
136
|
+
Logger.getInstance().logEvent(cta, 'INIT DOC SYNC AGAIN', LOG_TYPE.SDK_ERROR);
|
|
90
137
|
this.docManager = await DocumentManager.getInstance();
|
|
91
138
|
}
|
|
92
139
|
console.log('insertDocument1:', fmsFolderID);
|
|
@@ -107,7 +154,17 @@ export default class DocumentSyncManager {
|
|
|
107
154
|
try {
|
|
108
155
|
await this.docManager.markDocumentSynced(documentRow.id, fmsID);
|
|
109
156
|
} catch (err) {
|
|
110
|
-
|
|
157
|
+
let cta = 'updateDocument';
|
|
158
|
+
fireEventWithScreenName({
|
|
159
|
+
severityLevel: SeverityLevelValue.LOG,
|
|
160
|
+
eventName: SentryEventNameSdkConstants.APP_LOG,
|
|
161
|
+
screenName: cta,
|
|
162
|
+
cta: cta,
|
|
163
|
+
extraParams: {
|
|
164
|
+
msg: err
|
|
165
|
+
}
|
|
166
|
+
});
|
|
167
|
+
Logger.getInstance().logEvent(cta, err, LOG_TYPE.SDK_WARNING);
|
|
111
168
|
}
|
|
112
169
|
}
|
|
113
170
|
|
|
@@ -117,7 +174,17 @@ export default class DocumentSyncManager {
|
|
|
117
174
|
try {
|
|
118
175
|
await this.docManager.updateProcesedFilePath(documentRow.id, origialFilePath, processedPath);
|
|
119
176
|
} catch (err) {
|
|
120
|
-
|
|
177
|
+
let cta = 'updateDocument';
|
|
178
|
+
fireEventWithScreenName({
|
|
179
|
+
severityLevel: SeverityLevelValue.ERROR,
|
|
180
|
+
eventName: SentryEventNameSdkConstants.APP_ERROR,
|
|
181
|
+
screenName: cta,
|
|
182
|
+
cta: cta,
|
|
183
|
+
extraParams: {
|
|
184
|
+
msg: err
|
|
185
|
+
}
|
|
186
|
+
});
|
|
187
|
+
Logger.getInstance().logEvent(cta, err, LOG_TYPE.SDK_WARNING);
|
|
121
188
|
}
|
|
122
189
|
}
|
|
123
190
|
async updateDocError(documentRow, uploadError) {
|
|
@@ -125,7 +192,17 @@ export default class DocumentSyncManager {
|
|
|
125
192
|
try {
|
|
126
193
|
await this.docManager.updateDocSyncError(documentRow.id, uploadError);
|
|
127
194
|
} catch (err) {
|
|
128
|
-
|
|
195
|
+
let cta = 'updateDocError';
|
|
196
|
+
fireEventWithScreenName({
|
|
197
|
+
severityLevel: SeverityLevelValue.ERROR,
|
|
198
|
+
eventName: SentryEventNameSdkConstants.APP_ERROR,
|
|
199
|
+
screenName: cta,
|
|
200
|
+
cta: cta,
|
|
201
|
+
extraParams: {
|
|
202
|
+
msg: err
|
|
203
|
+
}
|
|
204
|
+
});
|
|
205
|
+
Logger.getInstance().logEvent(cta, err, LOG_TYPE.SDK_WARNING);
|
|
129
206
|
}
|
|
130
207
|
}
|
|
131
208
|
checkForInitialization() {
|
|
@@ -150,19 +227,10 @@ export default class DocumentSyncManager {
|
|
|
150
227
|
if (accuracy !== '') {
|
|
151
228
|
strDMSWithAccuracy = strDMS + ' (Accuracy: ' + accuracy + 'm)'; // Appedning accuracy in location
|
|
152
229
|
}
|
|
153
|
-
|
|
154
230
|
let fontSize = 14;
|
|
155
|
-
let fileSize = await Storage.getInstance().getItem('maxSize'); // File max size
|
|
156
|
-
let cRatio = await Storage.getInstance().getItem('cRatio'); // File compression ratio
|
|
157
|
-
let nFileSize = Number(fileSize);
|
|
158
|
-
let ncRatio = Number(cRatio);
|
|
159
|
-
let wholeRatio = Math.round(ncRatio * 100); // Compression ratio to be made
|
|
160
231
|
if (Platform.OS !== 'android') {
|
|
161
232
|
fontSize = 28;
|
|
162
233
|
}
|
|
163
|
-
if (wholeRatio >= 75) {
|
|
164
|
-
wholeRatio = 25;
|
|
165
|
-
}
|
|
166
234
|
const options = {
|
|
167
235
|
backgroundImage: {
|
|
168
236
|
// Image for overlay
|
|
@@ -175,7 +243,6 @@ export default class DocumentSyncManager {
|
|
|
175
243
|
position: {
|
|
176
244
|
position: Position.topLeft // Overlay text position
|
|
177
245
|
},
|
|
178
|
-
|
|
179
246
|
style: {
|
|
180
247
|
// Style for overlay
|
|
181
248
|
color: '#ffffff',
|
|
@@ -188,15 +255,11 @@ export default class DocumentSyncManager {
|
|
|
188
255
|
}
|
|
189
256
|
}
|
|
190
257
|
}],
|
|
191
|
-
scale:
|
|
192
|
-
quality: 100
|
|
193
|
-
// Compressio ratio in which file will generate
|
|
194
|
-
maxSize: nFileSize,
|
|
195
|
-
// Max file size in which file will generate
|
|
258
|
+
scale: 0,
|
|
259
|
+
quality: 100,
|
|
196
260
|
filename: pFilePath,
|
|
197
261
|
saveFormat: ImageFormat.jpg // Saving in jpeg format
|
|
198
262
|
};
|
|
199
|
-
|
|
200
263
|
let processedFilePath = await Marker.markText(options); // Generating overlay image
|
|
201
264
|
if (processedFilePath !== null && processedFilePath !== '') {
|
|
202
265
|
let completeFilePath = processedFilePath;
|
|
@@ -209,7 +272,6 @@ export default class DocumentSyncManager {
|
|
|
209
272
|
//original file path catprued from camera
|
|
210
273
|
completeFilePath // completeFilePath is the path with file:// of processed file
|
|
211
274
|
);
|
|
212
|
-
|
|
213
275
|
documentRow.processed_file_path = completeFilePath;
|
|
214
276
|
}
|
|
215
277
|
}
|
|
@@ -246,7 +308,6 @@ export default class DocumentSyncManager {
|
|
|
246
308
|
if (accuracy !== '') {
|
|
247
309
|
strDMSWithAccuracy = strDMS + ' (Accuracy: ' + accuracy + 'm)'; // Appedning accuracy in location
|
|
248
310
|
}
|
|
249
|
-
|
|
250
311
|
const options = {
|
|
251
312
|
backgroundImage: {
|
|
252
313
|
src: filePath,
|
|
@@ -259,7 +320,6 @@ export default class DocumentSyncManager {
|
|
|
259
320
|
position: {
|
|
260
321
|
position: Position.topLeft // Overlay text position
|
|
261
322
|
},
|
|
262
|
-
|
|
263
323
|
style: {
|
|
264
324
|
// Style for overlay
|
|
265
325
|
color: '#ffffff',
|
|
@@ -277,7 +337,6 @@ export default class DocumentSyncManager {
|
|
|
277
337
|
filename: pFilePath,
|
|
278
338
|
saveFormat: ImageFormat.base64 // Saving in base6 format
|
|
279
339
|
};
|
|
280
|
-
|
|
281
340
|
let processedBase64 = await Marker.markText(options); // Generating overlay image
|
|
282
341
|
if (processedBase64 !== null && processedBase64 !== '') {
|
|
283
342
|
// Fetching base64 data from processed data.
|
|
@@ -301,13 +360,34 @@ export default class DocumentSyncManager {
|
|
|
301
360
|
async uploadDocToServer(documentRow) {
|
|
302
361
|
try {
|
|
303
362
|
var _this$documentHttpCli;
|
|
304
|
-
let docRow =
|
|
363
|
+
let docRow = documentRow;
|
|
364
|
+
let cta = 'uploadDocToServer-geoStamp';
|
|
365
|
+
let geoStampAvailable = false;
|
|
366
|
+
if (documentRow.geo_timestamp && documentRow.geo_timestamp.length != 0) {
|
|
367
|
+
geoStampAvailable = true;
|
|
368
|
+
docRow = await this.processPODData(documentRow);
|
|
369
|
+
}
|
|
370
|
+
let extra = {
|
|
371
|
+
msg: geoStampAvailable ? "geoStamp availale" : 'geoStamp not availale',
|
|
372
|
+
fName: docRow.file_name && docRow.file_name.length != 0 ? docRow.file_name.substring(4) : '',
|
|
373
|
+
dName: docRow.fms_folder_id && docRow.fms_folder_id.length != 0 ? docRow.fms_folder_id.substring(4) : '',
|
|
374
|
+
dispId: docRow.dispatch_id && docRow.dispatch_id.length != 0 ? docRow.dispatch_id.substring(9) : ''
|
|
375
|
+
};
|
|
376
|
+
fireEventWithScreenName({
|
|
377
|
+
severityLevel: SeverityLevelValue.LOG,
|
|
378
|
+
eventName: SentryEventNameSdkConstants.APP_LOG,
|
|
379
|
+
screenName: cta,
|
|
380
|
+
cta: cta,
|
|
381
|
+
extraParams: extra
|
|
382
|
+
});
|
|
383
|
+
Logger.getInstance().logEvent(cta, flattenObject(extra), LOG_TYPE.SDK_ERROR);
|
|
305
384
|
console.log('uploadDocToServer999:', docRow);
|
|
306
|
-
let fmsID = await ((_this$documentHttpCli = this.documentHttpClient) === null || _this$documentHttpCli === void 0 ? void 0 : _this$documentHttpCli.uploadDocument(
|
|
385
|
+
let fmsID = await ((_this$documentHttpCli = this.documentHttpClient) === null || _this$documentHttpCli === void 0 ? void 0 : _this$documentHttpCli.uploadDocument(docRow));
|
|
307
386
|
let extraParameters = {
|
|
308
387
|
fmsID: fmsID ?? '',
|
|
309
|
-
|
|
310
|
-
|
|
388
|
+
fName: docRow.file_name && docRow.file_name.length != 0 ? docRow.file_name.substring(4) : '',
|
|
389
|
+
dName: docRow.fms_folder_id && docRow.fms_folder_id.length != 0 ? docRow.fms_folder_id.substring(4) : '',
|
|
390
|
+
dispId: docRow.dispatch_id && docRow.dispatch_id.length != 0 ? docRow.dispatch_id.substring(9) : ''
|
|
311
391
|
};
|
|
312
392
|
// TODO: SOLELY DEPENDS ON FMS_ID WHICH IS WRONG => IT SHOULD BE Response.status = 202
|
|
313
393
|
if (fmsID) {
|
|
@@ -315,7 +395,15 @@ export default class DocumentSyncManager {
|
|
|
315
395
|
await this.updateDocument(docRow, fmsID);
|
|
316
396
|
} else {
|
|
317
397
|
this._retries++;
|
|
318
|
-
|
|
398
|
+
let cta = 'uploadDocToServer-empty-fms-id';
|
|
399
|
+
fireEventWithScreenName({
|
|
400
|
+
severityLevel: SeverityLevelValue.LOG,
|
|
401
|
+
eventName: SentryEventNameSdkConstants.APP_LOG,
|
|
402
|
+
screenName: cta,
|
|
403
|
+
cta: cta,
|
|
404
|
+
extraParams: extraParameters
|
|
405
|
+
});
|
|
406
|
+
Logger.getInstance().logEvent(cta, flattenObject(extraParameters), LOG_TYPE.SDK_ERROR);
|
|
319
407
|
await this.updateDocError(docRow, 'Unexpected Error');
|
|
320
408
|
}
|
|
321
409
|
} catch (error) {
|
|
@@ -327,11 +415,11 @@ export default class DocumentSyncManager {
|
|
|
327
415
|
screenName: cta,
|
|
328
416
|
cta: cta,
|
|
329
417
|
extraParams: {
|
|
330
|
-
error: error
|
|
418
|
+
error: error
|
|
331
419
|
}
|
|
332
420
|
});
|
|
421
|
+
Logger.getInstance().logEvent(cta, error, LOG_TYPE.SDK_ERROR);
|
|
333
422
|
this._retries++;
|
|
334
|
-
Logger.getInstance().logEvent('uploadDocToServer-sync-error', error.message, LOG_TYPE.SDK_ERROR);
|
|
335
423
|
await this.updateDocError(documentRow, JSON.stringify({
|
|
336
424
|
message: error.message,
|
|
337
425
|
error: JSON.stringify(error === null || error === void 0 || (_error$response = error.response) === null || _error$response === void 0 ? void 0 : _error$response.data),
|
|
@@ -348,6 +436,6 @@ export default class DocumentSyncManager {
|
|
|
348
436
|
if (dspID) await this.docManager.deleteAllSyncedDocuments(dspID);
|
|
349
437
|
}
|
|
350
438
|
}
|
|
351
|
-
|
|
439
|
+
_DocumentSyncManager = DocumentSyncManager;
|
|
352
440
|
_defineProperty(DocumentSyncManager, "instance", void 0);
|
|
353
441
|
//# sourceMappingURL=DocumentSyncManager.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["DocumentManager","DocumentHttpClient","isEmptyOrBlank","flattenObject","BaseError","BaseErrorCodes","InvalidArgumentsError","InvalidBaseURL","SyncManagerNotInitialized","Logger","LOG_TYPE","NetworkUtil","Marker","Position","TextBackgroundType","ImageFormat","RNFS","Storage","Platform","SentryEventNameSdkConstants","SeverityLevelValue","fireEventWithScreenName","latlngToDms","require","DocumentSyncManager","retries","_retries","value","constructor","_defineProperty","init","baseURL","retryCount","maxRetryCount","documentHttpClient","getInstance","instance","startDocumentSync","inProgress","hasNetwork","isAvailableAsync","checkForInitialization","docManager","documentRows","getUnsyncedDocument","length","uploadDocToServer","logEvent","SDK_INFO","error","isSyncPending","leftDocuments","getAllUnsyncedDocs","insertDocument","fmsFolderID","data","base64","desc","dspID","filePath","fileType","fileName","geoTimeStamp","processedFilePath","priority","arguments","undefined","InvalidArgumentError","_this$docManager","console","log","insertResponse","forceDocumentSync","updateDocument","documentRow","fmsID","markDocumentSynced","id","err","message","SDK_WARNING","updateDocumentProcessedPath","origialFilePath","processedPath","updateProcesedFilePath","updateDocError","uploadError","updateDocSyncError","processImageData","processed_file_path","pFilePath","file_name","strGeoStamp","geo_timestamp","objGeoStamp","JSON","parse","dateTime","lat","lng","accuracy","strDMS","strDMSWithAccuracy","fontSize","fileSize","getItem","cRatio","nFileSize","Number","ncRatio","wholeRatio","Math","round","OS","options","backgroundImage","src","file_path","scale","watermarkTexts","text","position","topLeft","style","color","fontName","textBackgroundStyle","padding","type","none","quality","maxSize","filename","saveFormat","jpg","markText","completeFilePath","includes","processBase64Data","imagePath","TemporaryDirectoryPath","writeFile","processedBase64","splittedDase64Data","split","processPODData","_this$documentHttpCli","docRow","uploadDocument","extraParameters","folderName","fms_folder_id","SDK_ERROR","_error$response","_error$response2","cta","severityLevel","ERROR","eventName","API_ERROR","screenName","extraParams","stringify","response","status","getAllDocuments","dispatchID","clearSyncedDocs","deleteAllSyncedDocuments","_class"],"sources":["DocumentSyncManager.ts"],"sourcesContent":["import type { DocumentRow } from '../DBConfig';\nimport DocumentManager from './DocumentManager';\nimport DocumentHttpClient from './DocumentHttpClient';\nimport { isEmptyOrBlank, flattenObject } from '../../../utils/utils';\nimport { BaseError } from '../../../errors/BaseError';\nimport BaseErrorCodes, {\n InvalidArgumentsError,\n InvalidBaseURL,\n SyncManagerNotInitialized,\n} from '../../../errors/ErrorCodes';\nimport Logger, { LOG_TYPE } from '../../../utils/Logger';\nimport type { SQLResultSet } from 'expo-sqlite';\nimport NetworkUtil from '../../../utils/NetworkUtil';\nimport Marker, {\n Position,\n TextBackgroundType,\n ImageFormat,\n} from 'react-native-image-marker';\nimport RNFS from 'react-native-fs';\nimport Storage from '../../../utils/storage';\nimport { Platform } from 'react-native';\nimport { ScreenNameSdkConstants, SentryEventNameSdkConstants, SeverityLevelValue } from '../../../analytics/sentry/SentrySdkConstants';\nimport { fireEventWithScreenName } from '../../../analytics/sentry/SentryAnalyticsUtils';\nconst latlngToDms = require('latlng-to-dms');\n\n\nexport default class DocumentSyncManager {\n private documentHttpClient: DocumentHttpClient | undefined;\n private inProgress: boolean = false;\n private static instance: DocumentSyncManager;\n private docManager: DocumentManager | undefined;\n private maxRetryCount: number = 3;\n private _retries = 0;\n\n get retries(): number {\n return this._retries;\n }\n\n set retries(value: number) {\n this._retries = value;\n }\n\n private constructor() {}\n\n public init(baseURL: string, retryCount: number) {\n if (isEmptyOrBlank(baseURL))\n throw new BaseError(BaseErrorCodes.InvalidBaseURL, InvalidBaseURL);\n this.maxRetryCount = retryCount;\n this.documentHttpClient = new DocumentHttpClient(baseURL);\n }\n\n public static getInstance(): DocumentSyncManager {\n if (!DocumentSyncManager.instance) {\n DocumentSyncManager.instance = new DocumentSyncManager();\n }\n return DocumentSyncManager.instance;\n }\n\n public async startDocumentSync(): Promise<void> {\n if (!this.inProgress && this._retries < this.maxRetryCount) {\n this.inProgress = true;\n const hasNetwork = await NetworkUtil.isAvailableAsync();\n try {\n this.checkForInitialization();\n if (!this.docManager) {\n this.docManager = await DocumentManager.getInstance();\n }\n if (hasNetwork) {\n let documentRows: DocumentRow[] =\n await this.docManager.getUnsyncedDocument();\n if (documentRows?.length > 0) {\n await this.uploadDocToServer(documentRows[0]);\n } else {\n Logger.getInstance().logEvent(\n 'startDocumentSync',\n 'No data to sync',\n LOG_TYPE.SDK_INFO\n );\n }\n } else {\n Logger.getInstance().logEvent(\n 'startDocumentSync',\n 'No Network',\n LOG_TYPE.SDK_INFO\n );\n }\n } catch (error: any) {\n } finally {\n this.inProgress = false;\n if ((await this.isSyncPending()) && hasNetwork) {\n await this.startDocumentSync();\n }\n }\n } else {\n Logger.getInstance().logEvent(\n 'startDocumentSync',\n 'sync already in progress ',\n LOG_TYPE.SDK_INFO\n );\n }\n }\n\n public async isSyncPending(): Promise<boolean> {\n if (!this.docManager) this.docManager = await DocumentManager.getInstance();\n let leftDocuments = await this.docManager.getAllUnsyncedDocs();\n return leftDocuments?.length > 0 && this._retries < this.maxRetryCount;\n }\n\n public async insertDocument(\n fmsFolderID: string | null,\n data: string | null,\n base64: boolean,\n desc: string,\n dspID: string,\n // jobID: string,\n // objRef: string,\n filePath: string | null,\n fileType: string,\n fileName: string,\n geoTimeStamp: string,\n processedFilePath: string,\n priority: number = 1\n ): Promise<SQLResultSet> {\n if (\n isEmptyOrBlank(desc) ||\n isEmptyOrBlank(dspID) ||\n // isEmptyOrBlank(jobID) ||\n // isEmptyOrBlank(objRef) ||\n isEmptyOrBlank(fileType) ||\n isEmptyOrBlank(fileName) ||\n (base64 && isEmptyOrBlank(data)) ||\n (!base64 && isEmptyOrBlank(filePath))\n )\n throw new BaseError(\n BaseErrorCodes.InvalidArgumentError,\n InvalidArgumentsError\n );\n else {\n if (!this.docManager) {\n Logger.getInstance().logEvent(\n 'insertDocument',\n 'INIT DOC SYNC AGAIN',\n LOG_TYPE.SDK_INFO\n );\n this.docManager = await DocumentManager.getInstance();\n }\n console.log('insertDocument1:',fmsFolderID);\n let insertResponse = await this.docManager?.insertDocument(\n fmsFolderID,\n desc,\n dspID,\n // jobID,\n // objRef,\n base64,\n fileName,\n fileType,\n data,\n filePath,\n geoTimeStamp,\n processedFilePath,\n priority\n );\n return insertResponse;\n }\n }\n\n public async forceDocumentSync() {\n if (!this.docManager) this.docManager = await DocumentManager.getInstance();\n this._retries = 0;\n await this.startDocumentSync();\n }\n\n private async updateDocument(documentRow: DocumentRow, fmsID: string) {\n if (!this.docManager) this.docManager = await DocumentManager.getInstance();\n try {\n await this.docManager.markDocumentSynced(documentRow.id, fmsID);\n } catch (err: any) {\n Logger.getInstance().logEvent(\n 'updateDocument',\n err.message,\n LOG_TYPE.SDK_WARNING\n );\n }\n }\n\n // This function is updating processed_file_path column for the base64 overlayed data and overlayed image file for POD. Also if it is base 64 then it is also storing temprary file path in file_path as original bae64 image.\n private async updateDocumentProcessedPath(\n documentRow: DocumentRow,\n origialFilePath: String,\n processedPath: String\n ) {\n if (!this.docManager) this.docManager = await DocumentManager.getInstance();\n try {\n await this.docManager.updateProcesedFilePath(\n documentRow.id,\n origialFilePath,\n processedPath\n );\n } catch (err: any) {\n Logger.getInstance().logEvent(\n 'updateDocument',\n err.message,\n LOG_TYPE.SDK_WARNING\n );\n }\n }\n\n private async updateDocError(documentRow: DocumentRow, uploadError: string) {\n if (!this.docManager) this.docManager = await DocumentManager.getInstance();\n try {\n await this.docManager.updateDocSyncError(documentRow.id, uploadError);\n } catch (err: any) {\n Logger.getInstance().logEvent(\n 'updateDocError',\n err.message,\n LOG_TYPE.SDK_WARNING\n );\n }\n }\n private checkForInitialization() {\n if (!this.documentHttpClient) {\n throw new BaseError(\n BaseErrorCodes.SyncManagerNotInitialized,\n SyncManagerNotInitialized\n );\n }\n }\n\n // This function will generate overlay image and update documents table for processed_file_path columns with overlayed image path.\n private async processImageData(documentRow: DocumentRow) {\n // If processed_file_path of overlayed image already existing then do not generate it again.\n if (\n documentRow.processed_file_path === null ||\n documentRow.processed_file_path === ''\n ) {\n let pFilePath = 'processed_' + documentRow.file_name; // File name for processed file.\n let strGeoStamp = documentRow.geo_timestamp; // Saved geostamp string\n let objGeoStamp = JSON.parse(strGeoStamp); // Conversion to geostamp object\n let dateTime = objGeoStamp.dateTime; // Date time stamp in UTC format\n let lat = objGeoStamp.lat; // Latitide\n let lng = objGeoStamp.lng; // Longitude\n let accuracy = objGeoStamp.accuracy; // Location accuracy\n let strDMS = latlngToDms(`${lat}, ${lng}`); // Location in degree format\n let strDMSWithAccuracy = strDMS; \n if (accuracy !== '') {\n strDMSWithAccuracy = strDMS + ' (Accuracy: ' + accuracy + 'm)'; // Appedning accuracy in location \n }\n let fontSize = 14;\n \n let fileSize = await Storage.getInstance().getItem('maxSize'); // File max size\n let cRatio = await Storage.getInstance().getItem('cRatio'); // File compression ratio\n let nFileSize = Number(fileSize);\n let ncRatio = Number(cRatio);\n let wholeRatio = Math.round(ncRatio * 100); // Compression ratio to be made\n if (Platform.OS !== 'android') {\n fontSize = 28;\n }\n if(wholeRatio >= 75){\n wholeRatio = 25;\n }\n const options = {\n backgroundImage: { // Image for overlay\n src: documentRow.file_path,\n scale: 1,\n },\n watermarkTexts: [ \n {\n text: `${dateTime}\\n${strDMSWithAccuracy}`, //Overlay text\n position: {\n position: Position.topLeft, // Overlay text position\n },\n style: { // Style for overlay\n color: '#ffffff',\n fontSize: fontSize,\n fontName: 'Arial',\n textBackgroundStyle: {\n padding: '1% 1%',\n type: TextBackgroundType.none,\n color: '#444444CC',\n },\n },\n },\n ],\n scale: 1,\n quality: 100 - wholeRatio, // Compressio ratio in which file will generate\n maxSize: nFileSize, // Max file size in which file will generate\n filename: pFilePath,\n saveFormat: ImageFormat.jpg, // Saving in jpeg format\n };\n let processedFilePath = await Marker.markText(options); // Generating overlay image\n if (processedFilePath !== null && processedFilePath !== '') {\n let completeFilePath = processedFilePath;\n // If processd image file path does not have prefix file:// then we are addding manually\n if (!processedFilePath.includes('file')) {\n completeFilePath = 'file://' + processedFilePath;\n }\n // Updating document document table with overlayed image path\n this.updateDocumentProcessedPath(\n documentRow,\n documentRow.file_path, //original file path catprued from camera\n completeFilePath // completeFilePath is the path with file:// of processed file \n );\n documentRow.processed_file_path = completeFilePath; \n }\n }\n return documentRow;\n }\n\n // This function will generate overlay base64 data and update documents table for processed_file_path columns with overlayed base64 data.\n private async processBase64Data(documentRow: DocumentRow) {\n // If base64 overlayed data already existing then do not generate it again.\n if (\n documentRow.processed_file_path === null ||\n documentRow.processed_file_path === ''\n ) {\n let filePath = '';\n // If templrary base 64 file already exist then do not create again\n if (documentRow.file_path === null || documentRow.file_path === '') {\n const imagePath = `${RNFS.TemporaryDirectoryPath}/${documentRow.file_name}`;\n await RNFS.writeFile(imagePath, documentRow.data, 'base64'); // Write file to temprary location\n filePath = imagePath;\n // If file generated frommbase64 data does not have file:// then we are adding manually.\n if (!imagePath.includes('file')) {\n filePath = `file://${imagePath}`;\n }\n documentRow.file_path = filePath;\n } else {\n filePath = documentRow.file_path;\n }\n let pFilePath = 'processed_' + documentRow.file_name; // File name for processed file.\n let strGeoStamp = documentRow.geo_timestamp; // Saved geostamp string\n let objGeoStamp = JSON.parse(strGeoStamp); // Conversion to geostamp object\n let dateTime = objGeoStamp.dateTime; // Date time stamp in UTC format\n let lat = objGeoStamp.lat; // Latitide\n let lng = objGeoStamp.lng; // Longitude\n let accuracy = objGeoStamp.accuracy; // Location accuracy\n let strDMS = latlngToDms(`${lat}, ${lng}`); // Location in degree format\n let strDMSWithAccuracy = strDMS; \n if (accuracy !== '') {\n strDMSWithAccuracy = strDMS + ' (Accuracy: ' + accuracy + 'm)'; // Appedning accuracy in location \n }\n const options = {\n backgroundImage: {\n src: filePath, // Image for overlay\n scale: 1,\n },\n watermarkTexts: [\n {\n text: `${dateTime}\\n${strDMSWithAccuracy}`, // Ooverlay text\n position: {\n position: Position.topLeft, // Overlay text position\n },\n style: { // Style for overlay\n color: '#ffffff',\n fontSize: 14,\n fontName: 'Arial',\n textBackgroundStyle: {\n padding: '1% 1%',\n type: TextBackgroundType.none,\n color: '#444444CC',\n },\n },\n },\n ],\n scale: 1,\n quality: 100,\n filename: pFilePath,\n saveFormat: ImageFormat.base64, // Saving in base6 format\n };\n let processedBase64 = await Marker.markText(options); // Generating overlay image\n if (processedBase64 !== null && processedBase64 !== '') {\n // Fetching base64 data from processed data.\n var splittedDase64Data = processedBase64.split(\n 'data:image/png;base64,'\n );\n // Updating document document table with overlayed base64 data\n await this.updateDocumentProcessedPath(\n documentRow,\n filePath,\n splittedDase64Data[1]\n );\n documentRow.processed_file_path = splittedDase64Data[1];\n }\n }\n return documentRow;\n }\n\n // This function will calling respective overlay method for base64 (for signature POD) or image (for image POD).\n private async processPODData(documentRow: DocumentRow) {\n if (documentRow.base64 && documentRow.data != null) {\n return await this.processBase64Data(documentRow);\n } else {\n return await this.processImageData(documentRow);\n }\n }\n\n private async uploadDocToServer(documentRow: DocumentRow) {\n try {\n let docRow = await this.processPODData(documentRow);\n console.log('uploadDocToServer999:', docRow);\n let fmsID = await this.documentHttpClient?.uploadDocument(documentRow);\n\n let extraParameters = {\n fmsID: fmsID ?? '',\n fileName: docRow.file_name,\n folderName: docRow.fms_folder_id\n };\n // TODO: SOLELY DEPENDS ON FMS_ID WHICH IS WRONG => IT SHOULD BE Response.status = 202\n if (fmsID) {\n this._retries = 0;\n await this.updateDocument(docRow, fmsID);\n } else {\n this._retries++;\n Logger.getInstance().logEvent(\n 'uploadDocToServer-empty-fms-id',\n flattenObject(extraParameters),\n LOG_TYPE.SDK_ERROR\n );\n await this.updateDocError(docRow, 'Unexpected Error');\n }\n } catch (error: any) {\n const cta = 'uploadDocToServer-error';\n fireEventWithScreenName({\n severityLevel: SeverityLevelValue.ERROR,\n eventName: SentryEventNameSdkConstants.API_ERROR,\n screenName: cta,\n cta: cta,\n extraParams: {\n error: error.message,\n },\n });\n this._retries++;\n Logger.getInstance().logEvent(\n 'uploadDocToServer-sync-error',\n error.message,\n LOG_TYPE.SDK_ERROR\n );\n await this.updateDocError(\n documentRow,\n JSON.stringify({\n message: error.message,\n error: JSON.stringify(error?.response?.data),\n status: error?.response?.status,\n })\n );\n }\n }\n\n public async getAllDocuments(dispatchID?: string): Promise<DocumentRow[]> {\n if (!this.docManager) this.docManager = await DocumentManager.getInstance();\n return this.docManager.getAllDocuments(dispatchID);\n }\n\n public async clearSyncedDocs(dspID: string) {\n if (!this.docManager) this.docManager = await DocumentManager.getInstance();\n if (dspID) await this.docManager.deleteAllSyncedDocuments(dspID);\n }\n}\n"],"mappings":";;;;AACA,OAAOA,eAAe,MAAM,mBAAmB;AAC/C,OAAOC,kBAAkB,MAAM,sBAAsB;AACrD,SAASC,cAAc,EAAEC,aAAa,QAAQ,sBAAsB;AACpE,SAASC,SAAS,QAAQ,2BAA2B;AACrD,OAAOC,cAAc,IACnBC,qBAAqB,EACrBC,cAAc,EACdC,yBAAyB,QACpB,4BAA4B;AACnC,OAAOC,MAAM,IAAIC,QAAQ,QAAQ,uBAAuB;AAExD,OAAOC,WAAW,MAAM,4BAA4B;AACpD,OAAOC,MAAM,IACXC,QAAQ,EACRC,kBAAkB,EAClBC,WAAW,QACN,2BAA2B;AAClC,OAAOC,IAAI,MAAM,iBAAiB;AAClC,OAAOC,OAAO,MAAM,wBAAwB;AAC5C,SAASC,QAAQ,QAAQ,cAAc;AACvC,SAAiCC,2BAA2B,EAAEC,kBAAkB,QAAQ,8CAA8C;AACtI,SAASC,uBAAuB,QAAQ,gDAAgD;AACxF,MAAMC,WAAW,GAAGC,OAAO,CAAC,eAAe,CAAC;AAG5C,eAAe,MAAMC,mBAAmB,CAAC;EAQvC,IAAIC,OAAOA,CAAA,EAAW;IACpB,OAAO,IAAI,CAACC,QAAQ;EACtB;EAEA,IAAID,OAAOA,CAACE,KAAa,EAAE;IACzB,IAAI,CAACD,QAAQ,GAAGC,KAAK;EACvB;EAEQC,WAAW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uBAAfA,eAAA,CAAiBlG,IAAI,CAAC;QAC5C6G,MAAM,EAAEnH,KAAK,aAALA,KAAK,gBAAAyG,gBAAA,GAALzG,KAAK,CAAEkH,QAAQ,cAAAT,gBAAA,uBAAfA,gBAAA,CAAiBU;MAC3B,CAAC,CACH,CAAC;IACH;EACF;EAEA,MAAaC,eAAeA,CAACC,UAAmB,EAA0B;IACxE,IAAI,CAAC,IAAI,CAAC5H,UAAU,EAAE,IAAI,CAACA,UAAU,GAAG,MAAM1C,eAAe,CAACmC,WAAW,CAAC,CAAC;IAC3E,OAAO,IAAI,CAACO,UAAU,CAAC2H,eAAe,CAACC,UAAU,CAAC;EACpD;EAEA,MAAaC,eAAeA,CAAC7G,KAAa,EAAE;IAC1C,IAAI,CAAC,IAAI,CAAChB,UAAU,EAAE,IAAI,CAACA,UAAU,GAAG,MAAM1C,eAAe,CAACmC,WAAW,CAAC,CAAC;IAC3E,IAAIuB,KAAK,EAAE,MAAM,IAAI,CAAChB,UAAU,CAAC8H,wBAAwB,CAAC9G,KAAK,CAAC;EAClE;AACF;AAAC+G,MAAA,GA/aoBjJ,mBAAmB;AAAAK,eAAA,CAAnBL,mBAAmB"}
|
|
1
|
+
{"version":3,"names":["DocumentManager","DocumentHttpClient","isEmptyOrBlank","flattenObject","BaseError","BaseErrorCodes","InvalidArgumentsError","InvalidBaseURL","SyncManagerNotInitialized","Logger","LOG_TYPE","NetworkUtil","Marker","Position","TextBackgroundType","ImageFormat","RNFS","Platform","SentryEventNameSdkConstants","SeverityLevelValue","fireEventWithScreenName","latlngToDms","require","DocumentSyncManager","retries","_retries","value","constructor","_defineProperty","init","baseURL","retryCount","maxRetryCount","documentHttpClient","getInstance","instance","startDocumentSync","inProgress","hasNetwork","isAvailableAsync","checkForInitialization","docManager","documentRows","getUnsyncedDocument","length","uploadDocToServer","cta","severityLevel","LOG","eventName","APP_LOG","screenName","extraParams","msg","logEvent","SDK_ERROR","error","isSyncPending","updateDocPriority","id","priority","leftDocuments","getAllUnsyncedDocs","insertDocument","fmsFolderID","data","base64","desc","dspID","filePath","fileType","fileName","geoTimeStamp","processedFilePath","InvalidArgumentError","_this$docManager","console","log","insertResponse","forceDocumentSync","updateDocument","documentRow","fmsID","markDocumentSynced","err","SDK_WARNING","updateDocumentProcessedPath","origialFilePath","processedPath","updateProcesedFilePath","ERROR","APP_ERROR","updateDocError","uploadError","updateDocSyncError","processImageData","processed_file_path","pFilePath","file_name","strGeoStamp","geo_timestamp","objGeoStamp","JSON","parse","dateTime","lat","lng","accuracy","strDMS","strDMSWithAccuracy","fontSize","OS","options","backgroundImage","src","file_path","scale","watermarkTexts","text","position","topLeft","style","color","fontName","textBackgroundStyle","padding","type","none","quality","filename","saveFormat","jpg","markText","completeFilePath","includes","processBase64Data","imagePath","TemporaryDirectoryPath","writeFile","processedBase64","splittedDase64Data","split","processPODData","_this$documentHttpCli","docRow","geoStampAvailable","extra","fName","substring","dName","fms_folder_id","dispId","dispatch_id","uploadDocument","extraParameters","_error$response","_error$response2","API_ERROR","stringify","message","response","status","getAllDocuments","dispatchID","clearSyncedDocs","deleteAllSyncedDocuments","_DocumentSyncManager"],"sources":["DocumentSyncManager.ts"],"sourcesContent":["import type { DocumentRow } from '../DBConfig';\nimport DocumentManager from './DocumentManager';\nimport DocumentHttpClient from './DocumentHttpClient';\nimport { isEmptyOrBlank, flattenObject } from '../../../utils/utils';\nimport { BaseError } from '../../../errors/BaseError';\nimport BaseErrorCodes, {\n InvalidArgumentsError,\n InvalidBaseURL,\n SyncManagerNotInitialized,\n} from '../../../errors/ErrorCodes';\nimport Logger, { LOG_TYPE } from '../../../utils/Logger';\nimport type { SQLResultSet } from 'expo-sqlite';\nimport NetworkUtil from '../../../utils/NetworkUtil';\nimport Marker, {\n Position,\n TextBackgroundType,\n ImageFormat,\n} from 'react-native-image-marker';\nimport RNFS from 'react-native-fs';\nimport Storage from '../../../utils/storage';\nimport { Platform } from 'react-native';\nimport { ScreenNameSdkConstants, SentryEventNameSdkConstants, SeverityLevelValue } from '../../../analytics/sentry/SentrySdkConstants';\nimport { fireEventWithScreenName } from '../../../analytics/sentry/SentryAnalyticsUtils';\nconst latlngToDms = require('latlng-to-dms');\n\n\nexport default class DocumentSyncManager {\n private documentHttpClient: DocumentHttpClient | undefined;\n private inProgress: boolean = false;\n private static instance: DocumentSyncManager;\n private docManager: DocumentManager | undefined;\n private maxRetryCount: number = 3;\n private _retries = 0;\n get retries(): number {\n return this._retries;\n }\n\n set retries(value: number) {\n this._retries = value;\n }\n\n private constructor() {}\n\n public init(baseURL: string, retryCount: number) {\n if (isEmptyOrBlank(baseURL))\n throw new BaseError(BaseErrorCodes.InvalidBaseURL, InvalidBaseURL);\n this.maxRetryCount = retryCount;\n this.documentHttpClient = new DocumentHttpClient(baseURL);\n }\n\n public static getInstance(): DocumentSyncManager {\n if (!DocumentSyncManager.instance) {\n DocumentSyncManager.instance = new DocumentSyncManager();\n }\n return DocumentSyncManager.instance;\n }\n\n public async startDocumentSync(): Promise<void> {\n if (!this.inProgress && this._retries < this.maxRetryCount) {\n this.inProgress = true;\n const hasNetwork = await NetworkUtil.isAvailableAsync();\n try {\n this.checkForInitialization();\n if (!this.docManager) {\n this.docManager = await DocumentManager.getInstance();\n }\n if (hasNetwork) {\n let documentRows: DocumentRow[] =\n await this.docManager.getUnsyncedDocument();\n if (documentRows?.length > 0) {\n await this.uploadDocToServer(documentRows[0]);\n } else {\n let cta = 'startDocumentSync'\n fireEventWithScreenName({\n severityLevel: SeverityLevelValue.LOG,\n eventName: SentryEventNameSdkConstants.APP_LOG,\n screenName: cta,\n cta: cta,\n extraParams: {\n msg:'No data to sync'\n },\n });\n Logger.getInstance().logEvent(\n cta,\n 'No data to sync',\n LOG_TYPE.SDK_ERROR\n );\n }\n } else {\n let cta = 'startDocumentSync'\n fireEventWithScreenName({\n severityLevel: SeverityLevelValue.LOG,\n eventName: SentryEventNameSdkConstants.APP_LOG,\n screenName: cta,\n cta: cta,\n extraParams: {\n msg:'No Network'\n },\n });\n Logger.getInstance().logEvent(\n cta,\n 'No Network',\n LOG_TYPE.SDK_ERROR\n );\n }\n } catch (error: any) {\n } finally {\n this.inProgress = false;\n if ((await this.isSyncPending()) && hasNetwork) {\n await this.startDocumentSync();\n }\n }\n } else {\n if (!this.docManager) {\n this.docManager = await DocumentManager.getInstance();\n }\n let documentRows: DocumentRow[] =\n await this.docManager.getUnsyncedDocument();\n if (documentRows?.length > 0) {\n await this.docManager.updateDocPriority(documentRows[0].id, documentRows[0].priority + 1);\n this._retries = 0;\n this.startDocumentSync();\n }\n let cta = 'startDocumentSync'\n fireEventWithScreenName({\n severityLevel: SeverityLevelValue.LOG,\n eventName: SentryEventNameSdkConstants.APP_LOG,\n screenName: cta,\n cta: cta,\n extraParams: {\n msg:'sync already in progress'\n },\n });\n Logger.getInstance().logEvent(\n cta,\n 'sync already in progress',\n LOG_TYPE.SDK_ERROR\n );\n }\n }\n\n public async isSyncPending(): Promise<boolean> {\n if (!this.docManager) this.docManager = await DocumentManager.getInstance();\n let leftDocuments = await this.docManager.getAllUnsyncedDocs();\n return leftDocuments?.length > 0 && this._retries < this.maxRetryCount;\n }\n\n public async insertDocument(\n fmsFolderID: string | null,\n data: string | null,\n base64: boolean,\n desc: string,\n dspID: string,\n // jobID: string,\n // objRef: string,\n filePath: string | null,\n fileType: string,\n fileName: string,\n geoTimeStamp: string,\n processedFilePath: string,\n priority: number = 1\n ): Promise<SQLResultSet> {\n if (\n isEmptyOrBlank(desc) ||\n isEmptyOrBlank(dspID) ||\n // isEmptyOrBlank(jobID) ||\n // isEmptyOrBlank(objRef) ||\n isEmptyOrBlank(fileType) ||\n isEmptyOrBlank(fileName) ||\n (base64 && isEmptyOrBlank(data)) ||\n (!base64 && isEmptyOrBlank(filePath))\n )\n throw new BaseError(\n BaseErrorCodes.InvalidArgumentError,\n InvalidArgumentsError\n );\n else {\n if (!this.docManager) {\n let cta = 'insertDocument'\n fireEventWithScreenName({\n severityLevel: SeverityLevelValue.LOG,\n eventName: SentryEventNameSdkConstants.APP_LOG,\n screenName: cta,\n cta: cta,\n extraParams: {\n msg:'INIT DOC SYNC AGAIN'\n },\n });\n Logger.getInstance().logEvent(\n cta,\n 'INIT DOC SYNC AGAIN',\n LOG_TYPE.SDK_ERROR\n );\n this.docManager = await DocumentManager.getInstance();\n }\n console.log('insertDocument1:',fmsFolderID);\n let insertResponse = await this.docManager?.insertDocument(\n fmsFolderID,\n desc,\n dspID,\n // jobID,\n // objRef,\n base64,\n fileName,\n fileType,\n data,\n filePath,\n geoTimeStamp,\n processedFilePath,\n priority\n );\n return insertResponse;\n }\n }\n\n public async forceDocumentSync() {\n if (!this.docManager) this.docManager = await DocumentManager.getInstance();\n this._retries = 0;\n await this.startDocumentSync();\n }\n\n private async updateDocument(documentRow: DocumentRow, fmsID: string) {\n if (!this.docManager) this.docManager = await DocumentManager.getInstance();\n try {\n await this.docManager.markDocumentSynced(documentRow.id, fmsID);\n } catch (err: any) {\n let cta = 'updateDocument'\n fireEventWithScreenName({\n severityLevel: SeverityLevelValue.LOG,\n eventName: SentryEventNameSdkConstants.APP_LOG,\n screenName: cta,\n cta: cta,\n extraParams: {\n msg:err\n },\n });\n Logger.getInstance().logEvent(\n cta,\n err,\n LOG_TYPE.SDK_WARNING\n );\n }\n }\n\n // This function is updating processed_file_path column for the base64 overlayed data and overlayed image file for POD. Also if it is base 64 then it is also storing temprary file path in file_path as original bae64 image.\n private async updateDocumentProcessedPath(\n documentRow: DocumentRow,\n origialFilePath: String,\n processedPath: String\n ) {\n if (!this.docManager) this.docManager = await DocumentManager.getInstance();\n try {\n await this.docManager.updateProcesedFilePath(\n documentRow.id,\n origialFilePath,\n processedPath\n );\n } catch (err: any) {\n let cta = 'updateDocument'\n fireEventWithScreenName({\n severityLevel: SeverityLevelValue.ERROR,\n eventName: SentryEventNameSdkConstants.APP_ERROR,\n screenName: cta,\n cta: cta,\n extraParams: {\n msg:err\n },\n });\n Logger.getInstance().logEvent(\n cta,\n err,\n LOG_TYPE.SDK_WARNING\n );\n }\n }\n\n private async updateDocError(documentRow: DocumentRow, uploadError: string) {\n if (!this.docManager) this.docManager = await DocumentManager.getInstance();\n try {\n await this.docManager.updateDocSyncError(documentRow.id, uploadError);\n } catch (err: any) {\n let cta = 'updateDocError'\n fireEventWithScreenName({\n severityLevel: SeverityLevelValue.ERROR,\n eventName: SentryEventNameSdkConstants.APP_ERROR,\n screenName: cta,\n cta: cta,\n extraParams: {\n msg:err\n },\n });\n Logger.getInstance().logEvent(\n cta,\n err,\n LOG_TYPE.SDK_WARNING\n );\n }\n }\n private checkForInitialization() {\n if (!this.documentHttpClient) {\n throw new BaseError(\n BaseErrorCodes.SyncManagerNotInitialized,\n SyncManagerNotInitialized\n );\n }\n }\n\n // This function will generate overlay image and update documents table for processed_file_path columns with overlayed image path.\n private async processImageData(documentRow: DocumentRow) {\n // If processed_file_path of overlayed image already existing then do not generate it again.\n if (\n documentRow.processed_file_path === null ||\n documentRow.processed_file_path === ''\n ) {\n let pFilePath = 'processed_' + documentRow.file_name; // File name for processed file.\n let strGeoStamp = documentRow.geo_timestamp; // Saved geostamp string\n let objGeoStamp = JSON.parse(strGeoStamp); // Conversion to geostamp object\n let dateTime = objGeoStamp.dateTime; // Date time stamp in UTC format\n let lat = objGeoStamp.lat; // Latitide\n let lng = objGeoStamp.lng; // Longitude\n let accuracy = objGeoStamp.accuracy; // Location accuracy\n let strDMS = latlngToDms(`${lat}, ${lng}`); // Location in degree format\n let strDMSWithAccuracy = strDMS; \n if (accuracy !== '') {\n strDMSWithAccuracy = strDMS + ' (Accuracy: ' + accuracy + 'm)'; // Appedning accuracy in location \n }\n let fontSize = 14;\n if (Platform.OS !== 'android') {\n fontSize = 28;\n }\n const options = {\n backgroundImage: { // Image for overlay\n src: documentRow.file_path,\n scale: 1,\n },\n watermarkTexts: [ \n {\n text: `${dateTime}\\n${strDMSWithAccuracy}`, //Overlay text\n position: {\n position: Position.topLeft, // Overlay text position\n },\n style: { // Style for overlay\n color: '#ffffff',\n fontSize: fontSize,\n fontName: 'Arial',\n textBackgroundStyle: {\n padding: '1% 1%',\n type: TextBackgroundType.none,\n color: '#444444CC',\n },\n },\n },\n ],\n scale: 0,\n quality: 100, \n filename: pFilePath,\n saveFormat: ImageFormat.jpg, // Saving in jpeg format\n };\n let processedFilePath = await Marker.markText(options); // Generating overlay image\n if (processedFilePath !== null && processedFilePath !== '') {\n let completeFilePath = processedFilePath;\n // If processd image file path does not have prefix file:// then we are addding manually\n if (!processedFilePath.includes('file')) {\n completeFilePath = 'file://' + processedFilePath;\n }\n // Updating document document table with overlayed image path\n this.updateDocumentProcessedPath(\n documentRow,\n documentRow.file_path, //original file path catprued from camera\n completeFilePath // completeFilePath is the path with file:// of processed file \n );\n documentRow.processed_file_path = completeFilePath; \n }\n }\n return documentRow;\n }\n\n // This function will generate overlay base64 data and update documents table for processed_file_path columns with overlayed base64 data.\n private async processBase64Data(documentRow: DocumentRow) {\n // If base64 overlayed data already existing then do not generate it again.\n if (\n documentRow.processed_file_path === null ||\n documentRow.processed_file_path === ''\n ) {\n let filePath = '';\n // If templrary base 64 file already exist then do not create again\n if (documentRow.file_path === null || documentRow.file_path === '') {\n const imagePath = `${RNFS.TemporaryDirectoryPath}/${documentRow.file_name}`;\n await RNFS.writeFile(imagePath, documentRow.data, 'base64'); // Write file to temprary location\n filePath = imagePath;\n // If file generated frommbase64 data does not have file:// then we are adding manually.\n if (!imagePath.includes('file')) {\n filePath = `file://${imagePath}`;\n }\n documentRow.file_path = filePath;\n } else {\n filePath = documentRow.file_path;\n }\n let pFilePath = 'processed_' + documentRow.file_name; // File name for processed file.\n let strGeoStamp = documentRow.geo_timestamp; // Saved geostamp string\n let objGeoStamp = JSON.parse(strGeoStamp); // Conversion to geostamp object\n let dateTime = objGeoStamp.dateTime; // Date time stamp in UTC format\n let lat = objGeoStamp.lat; // Latitide\n let lng = objGeoStamp.lng; // Longitude\n let accuracy = objGeoStamp.accuracy; // Location accuracy\n let strDMS = latlngToDms(`${lat}, ${lng}`); // Location in degree format\n let strDMSWithAccuracy = strDMS; \n if (accuracy !== '') {\n strDMSWithAccuracy = strDMS + ' (Accuracy: ' + accuracy + 'm)'; // Appedning accuracy in location \n }\n const options = {\n backgroundImage: {\n src: filePath, // Image for overlay\n scale: 1,\n },\n watermarkTexts: [\n {\n text: `${dateTime}\\n${strDMSWithAccuracy}`, // Ooverlay text\n position: {\n position: Position.topLeft, // Overlay text position\n },\n style: { // Style for overlay\n color: '#ffffff',\n fontSize: 14,\n fontName: 'Arial',\n textBackgroundStyle: {\n padding: '1% 1%',\n type: TextBackgroundType.none,\n color: '#444444CC',\n },\n },\n },\n ],\n scale: 1,\n quality: 100,\n filename: pFilePath,\n saveFormat: ImageFormat.base64, // Saving in base6 format\n };\n let processedBase64 = await Marker.markText(options); // Generating overlay image\n if (processedBase64 !== null && processedBase64 !== '') {\n // Fetching base64 data from processed data.\n var splittedDase64Data = processedBase64.split(\n 'data:image/png;base64,'\n );\n // Updating document document table with overlayed base64 data\n await this.updateDocumentProcessedPath(\n documentRow,\n filePath,\n splittedDase64Data[1]\n );\n documentRow.processed_file_path = splittedDase64Data[1];\n }\n }\n return documentRow;\n }\n\n // This function will calling respective overlay method for base64 (for signature POD) or image (for image POD).\n private async processPODData(documentRow: DocumentRow) {\n if (documentRow.base64 && documentRow.data != null) {\n return await this.processBase64Data(documentRow);\n } else {\n return await this.processImageData(documentRow);\n }\n }\n\n private async uploadDocToServer(documentRow: DocumentRow) {\n try {\n let docRow = documentRow;\n let cta = 'uploadDocToServer-geoStamp';\n let geoStampAvailable = false\n if(documentRow.geo_timestamp && documentRow.geo_timestamp.length != 0){\n geoStampAvailable = true;\n docRow = await this.processPODData(documentRow);\n }\n let extra = {\n msg: geoStampAvailable ? \"geoStamp availale\" : 'geoStamp not availale',\n fName: docRow.file_name && docRow.file_name.length != 0 ? docRow.file_name.substring(4): '',\n dName: docRow.fms_folder_id && docRow.fms_folder_id.length != 0 ? docRow.fms_folder_id.substring(4): '',\n dispId: docRow.dispatch_id && docRow.dispatch_id.length != 0 ? docRow.dispatch_id.substring(9): ''\n };\n fireEventWithScreenName({\n severityLevel: SeverityLevelValue.LOG,\n eventName: SentryEventNameSdkConstants.APP_LOG,\n screenName: cta,\n cta: cta,\n extraParams: extra,\n });\n Logger.getInstance().logEvent(\n cta,\n flattenObject(extra),\n LOG_TYPE.SDK_ERROR\n );\n console.log('uploadDocToServer999:', docRow);\n let fmsID = await this.documentHttpClient?.uploadDocument(docRow);\n\n let extraParameters = {\n fmsID: fmsID ?? '',\n fName: docRow.file_name && docRow.file_name.length != 0 ? docRow.file_name.substring(4): '',\n dName: docRow.fms_folder_id && docRow.fms_folder_id.length != 0 ? docRow.fms_folder_id.substring(4): '',\n dispId: docRow.dispatch_id && docRow.dispatch_id.length != 0 ? docRow.dispatch_id.substring(9): ''\n };\n // TODO: SOLELY DEPENDS ON FMS_ID WHICH IS WRONG => IT SHOULD BE Response.status = 202\n if (fmsID) {\n this._retries = 0;\n await this.updateDocument(docRow, fmsID);\n } else {\n this._retries++;\n let cta = 'uploadDocToServer-empty-fms-id'\n fireEventWithScreenName({\n severityLevel: SeverityLevelValue.LOG,\n eventName: SentryEventNameSdkConstants.APP_LOG,\n screenName: cta,\n cta: cta,\n extraParams: extraParameters,\n });\n Logger.getInstance().logEvent(\n cta,\n flattenObject(extraParameters),\n LOG_TYPE.SDK_ERROR\n );\n await this.updateDocError(docRow, 'Unexpected Error');\n }\n } catch (error: any) {\n const cta = 'uploadDocToServer-error';\n fireEventWithScreenName({\n severityLevel: SeverityLevelValue.ERROR,\n eventName: SentryEventNameSdkConstants.API_ERROR,\n screenName: cta,\n cta: cta,\n extraParams: {\n error: error,\n },\n });\n Logger.getInstance().logEvent(\n cta,\n error,\n LOG_TYPE.SDK_ERROR\n );\n this._retries++;\n await this.updateDocError(\n documentRow,\n JSON.stringify({\n message: error.message,\n error: JSON.stringify(error?.response?.data),\n status: error?.response?.status,\n })\n );\n }\n }\n\n public async getAllDocuments(dispatchID?: string): Promise<DocumentRow[]> {\n if (!this.docManager) this.docManager = await DocumentManager.getInstance();\n return this.docManager.getAllDocuments(dispatchID);\n }\n\n public async clearSyncedDocs(dspID: string) {\n if (!this.docManager) this.docManager = await DocumentManager.getInstance();\n if (dspID) await this.docManager.deleteAllSyncedDocuments(dspID);\n }\n}\n"],"mappings":";;;;AACA,OAAOA,eAAe,MAAM,mBAAmB;AAC/C,OAAOC,kBAAkB,MAAM,sBAAsB;AACrD,SAASC,cAAc,EAAEC,aAAa,QAAQ,sBAAsB;AACpE,SAASC,SAAS,QAAQ,2BAA2B;AACrD,OAAOC,cAAc,IACnBC,qBAAqB,EACrBC,cAAc,EACdC,yBAAyB,QACpB,4BAA4B;AACnC,OAAOC,MAAM,IAAIC,QAAQ,QAAQ,uBAAuB;AAExD,OAAOC,WAAW,MAAM,4BAA4B;AACpD,OAAOC,MAAM,IACXC,QAAQ,EACRC,kBAAkB,EAClBC,WAAW,QACN,2BAA2B;AAClC,OAAOC,IAAI,MAAM,iBAAiB;AAElC,SAASC,QAAQ,QAAQ,cAAc;AACvC,SAAiCC,2BAA2B,EAAEC,kBAAkB,QAAQ,8CAA8C;AACtI,SAASC,uBAAuB,QAAQ,gDAAgD;AACxF,MAAMC,WAAW,GAAGC,OAAO,CAAC,eAAe,CAAC;AAG5C,eAAe,MAAMC,mBAAmB,CAAC;EAOvC,IAAIC,OAAOA,CAAA,EAAW;IACpB,OAAO,IAAI,CAACC,QAAQ;EACtB;EAEA,IAAID,OAAOA,CAACE,KAAa,EAAE;IACzB,IAAI,CAACD,QAAQ,GAAGC,KAAK;EACvB;EAEQC,WAAWA,CAAA,EAAG;IAAAC,eAAA;IAAAA,eAAA,qBAbQ,KAAK;IAAAA,eAAA;IAAAA,eAAA,wBAGH,CAAC;IAAAA,eAAA,mBACd,CAAC;EASG;EAEhBC,IAAIA,CAACC,OAAe,EAAEC,UAAkB,EAAE;IAC/C,IAAI7B,cAAc,CAAC4B,OAAO,CAAC,EACzB,MA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AG,MAAMzC,eAAe,CAACkC,WAAW,CAAC,CAAC;IAC3E,IAAIkC,KAAK,EAAE,MAAM,IAAI,CAAC3B,UAAU,CAAC4H,wBAAwB,CAACjG,KAAK,CAAC;EAClE;AACF;AAACkG,oBAAA,GArhBoB/I,mBAAmB;AAAAK,eAAA,CAAnBL,mBAAmB","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["models.ts"],"sourcesContent":["export type FILE_TAGS = {\n key: string;\n value: string;\n};\n"],"mappings":""}
|
|
1
|
+
{"version":3,"names":[],"sources":["models.ts"],"sourcesContent":["export type FILE_TAGS = {\n key: string;\n value: string;\n};\n"],"mappings":"","ignoreList":[]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
var
|
|
1
|
+
var _ETEventsManager;
|
|
2
2
|
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; }
|
|
3
|
-
function _toPropertyKey(
|
|
4
|
-
function _toPrimitive(
|
|
3
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
4
|
+
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
5
5
|
import { isEmptyOrBlank } from '../../../utils/utils';
|
|
6
6
|
import { DispatchSyncType, EVENTS_COLUMNS, EVENTS_TABLE } from '../DBConfig';
|
|
7
7
|
import * as Database from '../database';
|
|
@@ -218,7 +218,6 @@ export default class ETEventsManager {
|
|
|
218
218
|
// ? _evData.meta.jobId + _evData.meta.objectiveReference
|
|
219
219
|
// : 'NO_REF_FOUND'
|
|
220
220
|
);
|
|
221
|
-
|
|
222
221
|
queryData.push({
|
|
223
222
|
query: `INSERT INTO ${EVENTS_TABLE}(\
|
|
224
223
|
${EVENTS_COLUMNS.PAYLOAD},\
|
|
@@ -501,6 +500,6 @@ export default class ETEventsManager {
|
|
|
501
500
|
return sqlResult.rows._array;
|
|
502
501
|
}
|
|
503
502
|
}
|
|
504
|
-
|
|
503
|
+
_ETEventsManager = ETEventsManager;
|
|
505
504
|
_defineProperty(ETEventsManager, "instance", void 0);
|
|
506
505
|
//# sourceMappingURL=ETEventsManager.js.map
|