@os1-platform/dispatch-mobile 1.0.8 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +310 -74
- package/android/.gradle/7.0.2/fileChanges/last-build.bin +0 -0
- package/android/.gradle/7.0.2/fileHashes/fileHashes.lock +0 -0
- package/android/.gradle/7.0.2/gc.properties +0 -0
- package/android/.gradle/7.2/dependencies-accessors/dependencies-accessors.lock +0 -0
- package/android/.gradle/7.2/dependencies-accessors/gc.properties +0 -0
- package/android/.gradle/7.2/executionHistory/executionHistory.bin +0 -0
- package/android/.gradle/7.2/executionHistory/executionHistory.lock +0 -0
- package/android/.gradle/7.2/fileChanges/last-build.bin +0 -0
- package/android/.gradle/7.2/fileHashes/fileHashes.bin +0 -0
- package/android/.gradle/7.2/fileHashes/fileHashes.lock +0 -0
- package/android/.gradle/7.2/fileHashes/resourceHashesCache.bin +0 -0
- package/android/.gradle/7.2/gc.properties +0 -0
- package/android/.gradle/buildOutputCleanup/buildOutputCleanup.lock +0 -0
- package/android/.gradle/buildOutputCleanup/cache.properties +2 -0
- package/android/.gradle/buildOutputCleanup/outputFiles.bin +0 -0
- package/android/.gradle/checksums/checksums.lock +0 -0
- package/android/.gradle/checksums/md5-checksums.bin +0 -0
- package/android/.gradle/checksums/sha1-checksums.bin +0 -0
- package/android/.gradle/vcs-1/gc.properties +0 -0
- package/android/.idea/compiler.xml +6 -0
- package/android/.idea/gradle.xml +18 -0
- package/android/.idea/jarRepositories.xml +35 -0
- package/android/.idea/kotlinc.xml +6 -0
- package/android/.idea/misc.xml +9 -0
- package/android/.idea/vcs.xml +6 -0
- package/android/gradle.properties +1 -1
- package/android/local.properties +8 -0
- package/android/src/main/AndroidManifest.xml +0 -1
- package/android/src/main/java/com/dispatchsdk/DispatchSdkPackage.kt +3 -1
- package/android/src/main/java/com/dispatchsdk/sharedPref/SharedPreferenceModule.kt +166 -0
- package/lib/commonjs/@types/assets/index.d.js +2 -0
- package/lib/commonjs/@types/assets/index.d.js.map +1 -0
- package/lib/commonjs/components/dispatch/DispatchExecNavigator.js +50 -43
- package/lib/commonjs/components/dispatch/DispatchExecNavigator.js.map +1 -1
- package/lib/commonjs/components/executiontasks/ExecutionTasksIndex.js +10 -48
- package/lib/commonjs/components/executiontasks/ExecutionTasksIndex.js.map +1 -1
- package/lib/commonjs/components/executiontasks/cancellation/CancelET.js +142 -23
- package/lib/commonjs/components/executiontasks/cancellation/CancelET.js.map +1 -1
- package/lib/commonjs/components/executiontasks/cancellation/CancellationSchema.js.map +1 -1
- package/lib/commonjs/components/executiontasks/captureInput/CaptureText.js +66 -18
- package/lib/commonjs/components/executiontasks/captureInput/CaptureText.js.map +1 -1
- package/lib/commonjs/components/executiontasks/captureInput/utils.js +13 -0
- package/lib/commonjs/components/executiontasks/captureInput/utils.js.map +1 -0
- package/lib/commonjs/components/executiontasks/deliver/DeliverET.js +6 -16
- package/lib/commonjs/components/executiontasks/deliver/DeliverET.js.map +1 -1
- package/lib/commonjs/components/executiontasks/deliver/DeliverETInput.js.map +1 -1
- package/lib/commonjs/components/executiontasks/deliver/SLDeliverET.js +212 -95
- package/lib/commonjs/components/executiontasks/deliver/SLDeliverET.js.map +1 -1
- package/lib/commonjs/components/executiontasks/display/DisplayModalET.js +16 -25
- package/lib/commonjs/components/executiontasks/display/DisplayModalET.js.map +1 -1
- package/lib/commonjs/components/executiontasks/doodle/SignatureET.js +65 -29
- package/lib/commonjs/components/executiontasks/doodle/SignatureET.js.map +1 -1
- package/lib/commonjs/components/executiontasks/dropCash/DropCashET.js +5 -19
- package/lib/commonjs/components/executiontasks/dropCash/DropCashET.js.map +1 -1
- package/lib/commonjs/components/executiontasks/dropCash/SLDropCash.js +74 -30
- package/lib/commonjs/components/executiontasks/dropCash/SLDropCash.js.map +1 -1
- package/lib/commonjs/components/executiontasks/forms/FormGenerator.js +139 -50
- package/lib/commonjs/components/executiontasks/forms/FormGenerator.js.map +1 -1
- package/lib/commonjs/components/executiontasks/forms/widgets/DateTimeWidget.js +3 -26
- package/lib/commonjs/components/executiontasks/forms/widgets/DateTimeWidget.js.map +1 -1
- package/lib/commonjs/components/executiontasks/forms/widgets/DropdownWidget.js +49 -0
- package/lib/commonjs/components/executiontasks/forms/widgets/DropdownWidget.js.map +1 -0
- package/lib/commonjs/components/executiontasks/forms/widgets/QRBarcodeScannerWidget.js +2 -17
- package/lib/commonjs/components/executiontasks/forms/widgets/QRBarcodeScannerWidget.js.map +1 -1
- package/lib/commonjs/components/executiontasks/forms/widgets/TimeRangeSelector.js +0 -10
- package/lib/commonjs/components/executiontasks/forms/widgets/TimeRangeSelector.js.map +1 -1
- package/lib/commonjs/components/executiontasks/httpRequest/HttpEtUtils.js +5 -14
- package/lib/commonjs/components/executiontasks/httpRequest/HttpEtUtils.js.map +1 -1
- package/lib/commonjs/components/executiontasks/httpRequest/HttpRequestET.js +3 -15
- package/lib/commonjs/components/executiontasks/httpRequest/HttpRequestET.js.map +1 -1
- package/lib/commonjs/components/executiontasks/imageCapture/CaptureSchema.js.map +1 -1
- package/lib/commonjs/components/executiontasks/imageCapture/CaptureUtils.js +11 -36
- package/lib/commonjs/components/executiontasks/imageCapture/CaptureUtils.js.map +1 -1
- package/lib/commonjs/components/executiontasks/imageCapture/ImageCapture.js +73 -48
- package/lib/commonjs/components/executiontasks/imageCapture/ImageCapture.js.map +1 -1
- package/lib/commonjs/components/executiontasks/payments/PaymentStyles.js +0 -4
- package/lib/commonjs/components/executiontasks/payments/PaymentStyles.js.map +1 -1
- package/lib/commonjs/components/executiontasks/payments/PaymentUtils.js +0 -2
- package/lib/commonjs/components/executiontasks/payments/PaymentUtils.js.map +1 -1
- package/lib/commonjs/components/executiontasks/payments/completePayment/CompletePaymentET.js +76 -29
- package/lib/commonjs/components/executiontasks/payments/completePayment/CompletePaymentET.js.map +1 -1
- package/lib/commonjs/components/executiontasks/payments/init/InitPaymentET.js +63 -24
- package/lib/commonjs/components/executiontasks/payments/init/InitPaymentET.js.map +1 -1
- package/lib/commonjs/components/executiontasks/payments/processPayment/ProcessPaymentET.js +71 -22
- package/lib/commonjs/components/executiontasks/payments/processPayment/ProcessPaymentET.js.map +1 -1
- package/lib/commonjs/components/executiontasks/pickup/PickupET.js +5 -15
- package/lib/commonjs/components/executiontasks/pickup/PickupET.js.map +1 -1
- package/lib/commonjs/components/executiontasks/pickup/SLPickupET.js +138 -32
- package/lib/commonjs/components/executiontasks/pickup/SLPickupET.js.map +1 -1
- package/lib/commonjs/components/executiontasks/scan/ScanET.js +741 -0
- package/lib/commonjs/components/executiontasks/scan/ScanET.js.map +1 -0
- package/lib/commonjs/components/executiontasks/scan/ScanSchema.js +19 -0
- package/lib/commonjs/components/executiontasks/scan/ScanSchema.js.map +1 -0
- package/lib/commonjs/components/executiontasks/scan/constants.js +19 -0
- package/lib/commonjs/components/executiontasks/scan/constants.js.map +1 -0
- package/lib/commonjs/components/executiontasks/scan/interfaces.js +43 -0
- package/lib/commonjs/components/executiontasks/scan/interfaces.js.map +1 -0
- package/lib/commonjs/components/executiontasks/scan/modalConstant.js +104 -0
- package/lib/commonjs/components/executiontasks/scan/modalConstant.js.map +1 -0
- package/lib/commonjs/components/executiontasks/{scanner → scan/sub_components}/CScanner.js +9 -29
- package/lib/commonjs/components/executiontasks/scan/sub_components/CScanner.js.map +1 -0
- package/lib/commonjs/components/executiontasks/scan/sub_components/DropDownUtils.js +109 -0
- package/lib/commonjs/components/executiontasks/scan/sub_components/DropDownUtils.js.map +1 -0
- package/lib/commonjs/components/executiontasks/{scanner/returns/ReasonDropDown.js → scan/sub_components/ERDropDown.js} +72 -55
- package/lib/commonjs/components/executiontasks/scan/sub_components/ERDropDown.js.map +1 -0
- package/lib/commonjs/components/executiontasks/scan/sub_components/SummaryPage.js +1099 -0
- package/lib/commonjs/components/executiontasks/scan/sub_components/SummaryPage.js.map +1 -0
- package/lib/commonjs/components/executiontasks/scan/utils.js +762 -0
- package/lib/commonjs/components/executiontasks/scan/utils.js.map +1 -0
- package/lib/commonjs/components/executiontasks/validateOTP/ValidateOTPET.js +333 -0
- package/lib/commonjs/components/executiontasks/validateOTP/ValidateOTPET.js.map +1 -0
- package/lib/commonjs/components/executiontasks/validateOTP/ValidateOTPSchema.js +14 -0
- package/lib/commonjs/components/executiontasks/validateOTP/ValidateOTPSchema.js.map +1 -0
- package/lib/commonjs/components/executiontasks/validateOTP/constants.js +37 -0
- package/lib/commonjs/components/executiontasks/validateOTP/constants.js.map +1 -0
- package/lib/commonjs/components/executiontasks/validateOTP/sub-components/OTPInput.js +63 -0
- package/lib/commonjs/components/executiontasks/validateOTP/sub-components/OTPInput.js.map +1 -0
- package/lib/commonjs/components/executiontasks/validateOTP/utils.js +147 -0
- package/lib/commonjs/components/executiontasks/validateOTP/utils.js.map +1 -0
- package/lib/commonjs/components/executiontasks/verifyLocation/GeofenceUtils.js +0 -13
- package/lib/commonjs/components/executiontasks/verifyLocation/GeofenceUtils.js.map +1 -1
- package/lib/commonjs/components/executiontasks/verifyLocation/VerifyLocationET.js +4 -17
- package/lib/commonjs/components/executiontasks/verifyLocation/VerifyLocationET.js.map +1 -1
- package/lib/commonjs/components/executiontasks/verifyOtp/VerifyOtpET.js +3 -18
- package/lib/commonjs/components/executiontasks/verifyOtp/VerifyOtpET.js.map +1 -1
- package/lib/commonjs/components/executiontasks/verifyOtp/VerifyOtpSchema.js.map +1 -1
- package/lib/commonjs/components/utils/index.js +14 -0
- package/lib/commonjs/components/utils/index.js.map +1 -0
- package/lib/commonjs/components/widgets/AlertDisplay.js +0 -5
- package/lib/commonjs/components/widgets/AlertDisplay.js.map +1 -1
- package/lib/commonjs/components/widgets/CancelOrderDialog.js +0 -12
- package/lib/commonjs/components/widgets/CancelOrderDialog.js.map +1 -1
- package/lib/commonjs/components/widgets/Card.js +88 -0
- package/lib/commonjs/components/widgets/Card.js.map +1 -0
- package/lib/commonjs/components/widgets/GoBackModal.js +48 -0
- package/lib/commonjs/components/widgets/GoBackModal.js.map +1 -0
- package/lib/commonjs/components/widgets/IconButton.js +34 -0
- package/lib/commonjs/components/widgets/IconButton.js.map +1 -0
- package/lib/commonjs/components/widgets/ModalWidget.js +99 -0
- package/lib/commonjs/components/widgets/ModalWidget.js.map +1 -0
- package/lib/commonjs/components/widgets/ProgressDialog.js +0 -7
- package/lib/commonjs/components/widgets/ProgressDialog.js.map +1 -1
- package/lib/commonjs/components/widgets/SearchBar.js +74 -0
- package/lib/commonjs/components/widgets/SearchBar.js.map +1 -0
- package/lib/commonjs/components/widgets/SnackBarCustom.js +48 -40
- package/lib/commonjs/components/widgets/SnackBarCustom.js.map +1 -1
- package/lib/commonjs/components/widgets/SplitTextInput.js +93 -0
- package/lib/commonjs/components/widgets/SplitTextInput.js.map +1 -0
- package/lib/commonjs/components/widgets/TabsComponent.js +64 -0
- package/lib/commonjs/components/widgets/TabsComponent.js.map +1 -0
- package/lib/commonjs/components/widgets/Toaster.js +0 -2
- package/lib/commonjs/components/widgets/Toaster.js.map +1 -1
- package/lib/commonjs/config/DispatchSDKConfig.js +4 -5
- package/lib/commonjs/config/DispatchSDKConfig.js.map +1 -1
- package/lib/commonjs/constants/apiConstants.js +17 -0
- package/lib/commonjs/constants/apiConstants.js.map +1 -0
- package/lib/commonjs/constants/constants.js +7 -3
- package/lib/commonjs/constants/constants.js.map +1 -1
- package/lib/commonjs/constants/statuscode.js +3 -5
- package/lib/commonjs/constants/statuscode.js.map +1 -1
- package/lib/commonjs/errors/BaseError.js +3 -8
- package/lib/commonjs/errors/BaseError.js.map +1 -1
- package/lib/commonjs/errors/ErrorCodes.js +7 -6
- package/lib/commonjs/errors/ErrorCodes.js.map +1 -1
- package/lib/commonjs/events/EventDispatcher.js +23 -0
- package/lib/commonjs/events/EventDispatcher.js.map +1 -0
- package/lib/commonjs/events/EventListener.js +20 -0
- package/lib/commonjs/events/EventListener.js.map +1 -0
- package/lib/commonjs/events/constants.js +15 -0
- package/lib/commonjs/events/constants.js.map +1 -0
- package/lib/commonjs/events/index.js +11 -0
- package/lib/commonjs/events/index.js.map +1 -0
- package/lib/commonjs/events/interface.js +2 -0
- package/lib/commonjs/events/interface.js.map +1 -0
- package/lib/commonjs/index.js +40 -35
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/manager/dispatch/DispatchStateContainer.js +328 -272
- package/lib/commonjs/manager/dispatch/DispatchStateContainer.js.map +1 -1
- package/lib/commonjs/manager/dispatchCodes/EventCodeContainer.js +55 -4
- package/lib/commonjs/manager/dispatchCodes/EventCodeContainer.js.map +1 -1
- package/lib/commonjs/manager/dispatchCodes/EventCodeRepo.js +70 -0
- package/lib/commonjs/manager/dispatchCodes/EventCodeRepo.js.map +1 -0
- package/lib/commonjs/manager/dispatchCodes/ReasonCodeContainer.js +3 -29
- package/lib/commonjs/manager/dispatchCodes/ReasonCodeContainer.js.map +1 -1
- package/lib/commonjs/manager/dispatchCodes/ReasonCodeRepo.js +6 -20
- package/lib/commonjs/manager/dispatchCodes/ReasonCodeRepo.js.map +1 -1
- package/lib/commonjs/manager/jobRemoval/JobRemovalManager.js +23 -0
- package/lib/commonjs/manager/jobRemoval/JobRemovalManager.js.map +1 -0
- package/lib/commonjs/manager/location/LocationManager.js +3 -20
- package/lib/commonjs/manager/location/LocationManager.js.map +1 -1
- package/lib/commonjs/manager/sdk/DispatchSDKManager.js +23 -37
- package/lib/commonjs/manager/sdk/DispatchSDKManager.js.map +1 -1
- package/lib/commonjs/manager/sdk/DispatchSdkCache.js +6 -17
- package/lib/commonjs/manager/sdk/DispatchSdkCache.js.map +1 -1
- package/lib/commonjs/manager/sdk/callbacksHandler.js +26 -0
- package/lib/commonjs/manager/sdk/callbacksHandler.js.map +1 -0
- package/lib/commonjs/manager/syncmanager/AppSyncManager.js +26 -46
- package/lib/commonjs/manager/syncmanager/AppSyncManager.js.map +1 -1
- package/lib/commonjs/manager/syncmanager/DBConfig.js +48 -9
- package/lib/commonjs/manager/syncmanager/DBConfig.js.map +1 -1
- package/lib/commonjs/manager/syncmanager/NativeSyncManager.js +0 -2
- package/lib/commonjs/manager/syncmanager/NativeSyncManager.js.map +1 -1
- package/lib/commonjs/manager/syncmanager/constants.js +17 -0
- package/lib/commonjs/manager/syncmanager/constants.js.map +1 -0
- package/lib/commonjs/manager/syncmanager/database.js +28 -12
- package/lib/commonjs/manager/syncmanager/database.js.map +1 -1
- package/lib/commonjs/manager/syncmanager/document/DocumentHttpClient.js +11 -36
- package/lib/commonjs/manager/syncmanager/document/DocumentHttpClient.js.map +1 -1
- package/lib/commonjs/manager/syncmanager/document/DocumentManager.js +8 -26
- package/lib/commonjs/manager/syncmanager/document/DocumentManager.js.map +1 -1
- package/lib/commonjs/manager/syncmanager/document/DocumentSyncManager.js +19 -58
- package/lib/commonjs/manager/syncmanager/document/DocumentSyncManager.js.map +1 -1
- package/lib/commonjs/manager/syncmanager/events/ETEventsManager.js +414 -29
- package/lib/commonjs/manager/syncmanager/events/ETEventsManager.js.map +1 -1
- package/lib/commonjs/manager/syncmanager/events/EventsSyncManager.js +208 -103
- package/lib/commonjs/manager/syncmanager/events/EventsSyncManager.js.map +1 -1
- package/lib/commonjs/manager/syncmanager/events/SyncHttpClient.js +157 -36
- package/lib/commonjs/manager/syncmanager/events/SyncHttpClient.js.map +1 -1
- package/lib/commonjs/models/DispatchModels.js +4 -5
- package/lib/commonjs/models/DispatchModels.js.map +1 -1
- package/lib/commonjs/models/ReasonCodes.js.map +1 -1
- package/lib/commonjs/models/execTasks/ETBaseModels.js +4 -0
- package/lib/commonjs/models/execTasks/ETBaseModels.js.map +1 -1
- package/lib/commonjs/models/execTasks/ETConfig.js +28 -35
- package/lib/commonjs/models/execTasks/ETConfig.js.map +1 -1
- package/lib/commonjs/models/sdk.js +4 -5
- package/lib/commonjs/models/sdk.js.map +1 -1
- package/lib/commonjs/native/signature/SignatureCapture.js +3 -24
- package/lib/commonjs/native/signature/SignatureCapture.js.map +1 -1
- package/lib/commonjs/network/GraphQLClient.js +7 -35
- package/lib/commonjs/network/GraphQLClient.js.map +1 -1
- package/lib/commonjs/network/NetworkClient.js +2 -13
- package/lib/commonjs/network/NetworkClient.js.map +1 -1
- package/lib/commonjs/network/NetworkUtils.js +10 -8
- package/lib/commonjs/network/NetworkUtils.js.map +1 -1
- package/lib/commonjs/network/Queries.js +0 -2
- package/lib/commonjs/network/Queries.js.map +1 -1
- package/lib/commonjs/network/client.js +6 -21
- package/lib/commonjs/network/client.js.map +1 -1
- package/lib/commonjs/res/strings.js.map +1 -1
- package/lib/commonjs/resources/Login.js +4 -15
- package/lib/commonjs/resources/Login.js.map +1 -1
- package/lib/commonjs/resources/network.js +3 -8
- package/lib/commonjs/resources/network.js.map +1 -1
- package/lib/commonjs/styles/SdkColors.js +10 -8
- package/lib/commonjs/styles/SdkColors.js.map +1 -1
- package/lib/commonjs/styles/executionTasks/CommonStyles.js +58 -25
- package/lib/commonjs/styles/executionTasks/CommonStyles.js.map +1 -1
- package/lib/commonjs/ui/screens/CancellationScreen.js +67 -27
- package/lib/commonjs/ui/screens/CancellationScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/CaptureInputScreen.js +15 -16
- package/lib/commonjs/ui/screens/CaptureInputScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/CompleteObjectiveScreen.js +11 -23
- package/lib/commonjs/ui/screens/CompleteObjectiveScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/DeliverScreen.js +30 -17
- package/lib/commonjs/ui/screens/DeliverScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/DisplayScreen.js +17 -13
- package/lib/commonjs/ui/screens/DisplayScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/DoodleScreen.js +17 -20
- package/lib/commonjs/ui/screens/DoodleScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/DropCashScreen.js +43 -31
- package/lib/commonjs/ui/screens/DropCashScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/ETScreensIndex.js +10 -19
- package/lib/commonjs/ui/screens/ETScreensIndex.js.map +1 -1
- package/lib/commonjs/ui/screens/FormsScreen.js +105 -17
- package/lib/commonjs/ui/screens/FormsScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/GeofenceScreen.js +16 -14
- package/lib/commonjs/ui/screens/GeofenceScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/HttpRequestScreen.js +14 -11
- package/lib/commonjs/ui/screens/HttpRequestScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/ImageCaptureScreen.js +38 -17
- package/lib/commonjs/ui/screens/ImageCaptureScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/PaymentScreen.js +28 -29
- package/lib/commonjs/ui/screens/PaymentScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/PickupScreen.js +41 -19
- package/lib/commonjs/ui/screens/PickupScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/ScanScreen.js +121 -0
- package/lib/commonjs/ui/screens/ScanScreen.js.map +1 -0
- package/lib/commonjs/ui/screens/StartWorkFlowScreen.js +64 -38
- package/lib/commonjs/ui/screens/StartWorkFlowScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/ValidateOTPScreen.js +55 -0
- package/lib/commonjs/ui/screens/ValidateOTPScreen.js.map +1 -0
- package/lib/commonjs/ui/screens/WithBaseDispatchScreen.js +0 -10
- package/lib/commonjs/ui/screens/WithBaseDispatchScreen.js.map +1 -1
- package/lib/commonjs/ui/uiConfig/RouteParams.js +24 -1
- package/lib/commonjs/ui/uiConfig/RouteParams.js.map +1 -1
- package/lib/commonjs/utils/ApiUtils.js +129 -0
- package/lib/commonjs/utils/ApiUtils.js.map +1 -0
- package/lib/commonjs/utils/ExecTaskUtils.js +111 -41
- package/lib/commonjs/utils/ExecTaskUtils.js.map +1 -1
- package/lib/commonjs/utils/Logger.js +10 -29
- package/lib/commonjs/utils/Logger.js.map +1 -1
- package/lib/commonjs/utils/NetworkUtil.js +3 -19
- package/lib/commonjs/utils/NetworkUtil.js.map +1 -1
- package/lib/commonjs/utils/SdkUtils.js +2 -31
- package/lib/commonjs/utils/SdkUtils.js.map +1 -1
- package/lib/commonjs/utils/SyncManagerUtils.js +61 -43
- package/lib/commonjs/utils/SyncManagerUtils.js.map +1 -1
- package/lib/commonjs/utils/fcm/FCM.js +59 -11
- package/lib/commonjs/utils/fcm/FCM.js.map +1 -1
- package/lib/commonjs/utils/fcm/FcmUtils.js +82 -21
- package/lib/commonjs/utils/fcm/FcmUtils.js.map +1 -1
- package/lib/commonjs/utils/helper.js +0 -5
- package/lib/commonjs/utils/helper.js.map +1 -1
- package/lib/commonjs/utils/hooks/useModal.js +53 -0
- package/lib/commonjs/utils/hooks/useModal.js.map +1 -0
- package/lib/commonjs/utils/hooks/useTimer.js +44 -0
- package/lib/commonjs/utils/hooks/useTimer.js.map +1 -0
- package/lib/commonjs/utils/loginHelper.js +6 -18
- package/lib/commonjs/utils/loginHelper.js.map +1 -1
- package/lib/commonjs/utils/storage.js +87 -31
- package/lib/commonjs/utils/storage.js.map +1 -1
- package/lib/commonjs/utils/utils.js +8 -11
- package/lib/commonjs/utils/utils.js.map +1 -1
- package/lib/module/@types/assets/index.d.js +2 -0
- package/lib/module/@types/assets/index.d.js.map +1 -0
- package/lib/module/components/dispatch/DispatchExecNavigator.js +50 -32
- package/lib/module/components/dispatch/DispatchExecNavigator.js.map +1 -1
- package/lib/module/components/executiontasks/ExecutionTasksIndex.js +3 -5
- package/lib/module/components/executiontasks/ExecutionTasksIndex.js.map +1 -1
- package/lib/module/components/executiontasks/cancellation/CancelET.js +145 -19
- package/lib/module/components/executiontasks/cancellation/CancelET.js.map +1 -1
- package/lib/module/components/executiontasks/cancellation/CancellationSchema.js.map +1 -1
- package/lib/module/components/executiontasks/captureInput/CaptureText.js +68 -10
- package/lib/module/components/executiontasks/captureInput/CaptureText.js.map +1 -1
- package/lib/module/components/executiontasks/captureInput/utils.js +7 -0
- package/lib/module/components/executiontasks/captureInput/utils.js.map +1 -0
- package/lib/module/components/executiontasks/deliver/DeliverET.js +6 -7
- package/lib/module/components/executiontasks/deliver/DeliverET.js.map +1 -1
- package/lib/module/components/executiontasks/deliver/DeliverETInput.js.map +1 -1
- package/lib/module/components/executiontasks/deliver/SLDeliverET.js +214 -86
- package/lib/module/components/executiontasks/deliver/SLDeliverET.js.map +1 -1
- package/lib/module/components/executiontasks/display/DisplayModalET.js +16 -15
- package/lib/module/components/executiontasks/display/DisplayModalET.js.map +1 -1
- package/lib/module/components/executiontasks/doodle/SignatureET.js +68 -15
- package/lib/module/components/executiontasks/doodle/SignatureET.js.map +1 -1
- package/lib/module/components/executiontasks/dropCash/DropCashET.js +5 -6
- package/lib/module/components/executiontasks/dropCash/DropCashET.js.map +1 -1
- package/lib/module/components/executiontasks/dropCash/SLDropCash.js +75 -20
- package/lib/module/components/executiontasks/dropCash/SLDropCash.js.map +1 -1
- package/lib/module/components/executiontasks/forms/FormGenerator.js +142 -37
- package/lib/module/components/executiontasks/forms/FormGenerator.js.map +1 -1
- package/lib/module/components/executiontasks/forms/widgets/DateTimeWidget.js +3 -15
- package/lib/module/components/executiontasks/forms/widgets/DateTimeWidget.js.map +1 -1
- package/lib/module/components/executiontasks/forms/widgets/DropdownWidget.js +39 -0
- package/lib/module/components/executiontasks/forms/widgets/DropdownWidget.js.map +1 -0
- package/lib/module/components/executiontasks/forms/widgets/QRBarcodeScannerWidget.js +2 -6
- package/lib/module/components/executiontasks/forms/widgets/QRBarcodeScannerWidget.js.map +1 -1
- package/lib/module/components/executiontasks/forms/widgets/TimeRangeSelector.js +0 -3
- package/lib/module/components/executiontasks/forms/widgets/TimeRangeSelector.js.map +1 -1
- package/lib/module/components/executiontasks/httpRequest/HttpEtUtils.js +6 -4
- package/lib/module/components/executiontasks/httpRequest/HttpEtUtils.js.map +1 -1
- package/lib/module/components/executiontasks/httpRequest/HttpRequestET.js +3 -6
- package/lib/module/components/executiontasks/httpRequest/HttpRequestET.js.map +1 -1
- package/lib/module/components/executiontasks/imageCapture/CaptureSchema.js.map +1 -1
- package/lib/module/components/executiontasks/imageCapture/CaptureUtils.js +11 -11
- package/lib/module/components/executiontasks/imageCapture/CaptureUtils.js.map +1 -1
- package/lib/module/components/executiontasks/imageCapture/ImageCapture.js +75 -35
- package/lib/module/components/executiontasks/imageCapture/ImageCapture.js.map +1 -1
- package/lib/module/components/executiontasks/payments/PaymentStyles.js.map +1 -1
- package/lib/module/components/executiontasks/payments/PaymentUtils.js.map +1 -1
- package/lib/module/components/executiontasks/payments/completePayment/CompletePaymentET.js +77 -18
- package/lib/module/components/executiontasks/payments/completePayment/CompletePaymentET.js.map +1 -1
- package/lib/module/components/executiontasks/payments/init/InitPaymentET.js +64 -11
- package/lib/module/components/executiontasks/payments/init/InitPaymentET.js.map +1 -1
- package/lib/module/components/executiontasks/payments/processPayment/ProcessPaymentET.js +72 -11
- package/lib/module/components/executiontasks/payments/processPayment/ProcessPaymentET.js.map +1 -1
- package/lib/module/components/executiontasks/pickup/PickupET.js +5 -6
- package/lib/module/components/executiontasks/pickup/PickupET.js.map +1 -1
- package/lib/module/components/executiontasks/pickup/SLPickupET.js +141 -25
- package/lib/module/components/executiontasks/pickup/SLPickupET.js.map +1 -1
- package/lib/module/components/executiontasks/scan/ScanET.js +732 -0
- package/lib/module/components/executiontasks/scan/ScanET.js.map +1 -0
- package/lib/module/components/executiontasks/scan/ScanSchema.js +17 -0
- package/lib/module/components/executiontasks/scan/ScanSchema.js.map +1 -0
- package/lib/module/components/executiontasks/scan/constants.js +7 -0
- package/lib/module/components/executiontasks/scan/constants.js.map +1 -0
- package/lib/module/components/executiontasks/scan/interfaces.js +33 -0
- package/lib/module/components/executiontasks/scan/interfaces.js.map +1 -0
- package/lib/module/components/executiontasks/scan/modalConstant.js +94 -0
- package/lib/module/components/executiontasks/scan/modalConstant.js.map +1 -0
- package/lib/module/components/executiontasks/{scanner → scan/sub_components}/CScanner.js +9 -16
- package/lib/module/components/executiontasks/scan/sub_components/CScanner.js.map +1 -0
- package/lib/module/components/executiontasks/scan/sub_components/DropDownUtils.js +101 -0
- package/lib/module/components/executiontasks/scan/sub_components/DropDownUtils.js.map +1 -0
- package/lib/module/components/executiontasks/scan/sub_components/ERDropDown.js +107 -0
- package/lib/module/components/executiontasks/scan/sub_components/ERDropDown.js.map +1 -0
- package/lib/module/components/executiontasks/scan/sub_components/SummaryPage.js +1092 -0
- package/lib/module/components/executiontasks/scan/sub_components/SummaryPage.js.map +1 -0
- package/lib/module/components/executiontasks/scan/utils.js +726 -0
- package/lib/module/components/executiontasks/scan/utils.js.map +1 -0
- package/lib/module/components/executiontasks/validateOTP/ValidateOTPET.js +324 -0
- package/lib/module/components/executiontasks/validateOTP/ValidateOTPET.js.map +1 -0
- package/lib/module/components/executiontasks/validateOTP/ValidateOTPSchema.js +8 -0
- package/lib/module/components/executiontasks/validateOTP/ValidateOTPSchema.js.map +1 -0
- package/lib/module/components/executiontasks/validateOTP/constants.js +25 -0
- package/lib/module/components/executiontasks/validateOTP/constants.js.map +1 -0
- package/lib/module/components/executiontasks/validateOTP/sub-components/OTPInput.js +53 -0
- package/lib/module/components/executiontasks/validateOTP/sub-components/OTPInput.js.map +1 -0
- package/lib/module/components/executiontasks/validateOTP/utils.js +133 -0
- package/lib/module/components/executiontasks/validateOTP/utils.js.map +1 -0
- package/lib/module/components/executiontasks/verifyLocation/GeofenceUtils.js +0 -6
- package/lib/module/components/executiontasks/verifyLocation/GeofenceUtils.js.map +1 -1
- package/lib/module/components/executiontasks/verifyLocation/VerifyLocationET.js +4 -3
- package/lib/module/components/executiontasks/verifyLocation/VerifyLocationET.js.map +1 -1
- package/lib/module/components/executiontasks/verifyOtp/VerifyOtpET.js +5 -9
- package/lib/module/components/executiontasks/verifyOtp/VerifyOtpET.js.map +1 -1
- package/lib/module/components/executiontasks/verifyOtp/VerifyOtpSchema.js.map +1 -1
- package/lib/module/components/utils/index.js +8 -0
- package/lib/module/components/utils/index.js.map +1 -0
- package/lib/module/components/widgets/AlertDisplay.js.map +1 -1
- package/lib/module/components/widgets/CancelOrderDialog.js +0 -2
- package/lib/module/components/widgets/CancelOrderDialog.js.map +1 -1
- package/lib/module/components/widgets/Card.js +80 -0
- package/lib/module/components/widgets/Card.js.map +1 -0
- package/lib/module/components/widgets/GoBackModal.js +40 -0
- package/lib/module/components/widgets/GoBackModal.js.map +1 -0
- package/lib/module/components/widgets/IconButton.js +26 -0
- package/lib/module/components/widgets/IconButton.js.map +1 -0
- package/lib/module/components/widgets/ModalWidget.js +92 -0
- package/lib/module/components/widgets/ModalWidget.js.map +1 -0
- package/lib/module/components/widgets/ProgressDialog.js +0 -2
- package/lib/module/components/widgets/ProgressDialog.js.map +1 -1
- package/lib/module/components/widgets/SearchBar.js +66 -0
- package/lib/module/components/widgets/SearchBar.js.map +1 -0
- package/lib/module/components/widgets/SnackBarCustom.js +46 -20
- package/lib/module/components/widgets/SnackBarCustom.js.map +1 -1
- package/lib/module/components/widgets/SplitTextInput.js +84 -0
- package/lib/module/components/widgets/SplitTextInput.js.map +1 -0
- package/lib/module/components/widgets/TabsComponent.js +55 -0
- package/lib/module/components/widgets/TabsComponent.js.map +1 -0
- package/lib/module/components/widgets/Toaster.js.map +1 -1
- package/lib/module/config/DispatchSDKConfig.js +3 -4
- package/lib/module/config/DispatchSDKConfig.js.map +1 -1
- package/lib/module/constants/apiConstants.js +9 -0
- package/lib/module/constants/apiConstants.js.map +1 -0
- package/lib/module/constants/constants.js +4 -2
- package/lib/module/constants/constants.js.map +1 -1
- package/lib/module/constants/statuscode.js +3 -5
- package/lib/module/constants/statuscode.js.map +1 -1
- package/lib/module/errors/BaseError.js +3 -6
- package/lib/module/errors/BaseError.js.map +1 -1
- package/lib/module/errors/ErrorCodes.js +5 -5
- package/lib/module/errors/ErrorCodes.js.map +1 -1
- package/lib/module/events/EventDispatcher.js +16 -0
- package/lib/module/events/EventDispatcher.js.map +1 -0
- package/lib/module/events/EventListener.js +13 -0
- package/lib/module/events/EventListener.js.map +1 -0
- package/lib/module/events/constants.js +8 -0
- package/lib/module/events/constants.js.map +1 -0
- package/lib/module/events/index.js +3 -0
- package/lib/module/events/index.js.map +1 -0
- package/lib/module/events/interface.js +2 -0
- package/lib/module/events/interface.js.map +1 -0
- package/lib/module/index.js +9 -5
- package/lib/module/index.js.map +1 -1
- package/lib/module/manager/dispatch/DispatchStateContainer.js +334 -247
- package/lib/module/manager/dispatch/DispatchStateContainer.js.map +1 -1
- package/lib/module/manager/dispatchCodes/EventCodeContainer.js +52 -2
- package/lib/module/manager/dispatchCodes/EventCodeContainer.js.map +1 -1
- package/lib/module/manager/dispatchCodes/EventCodeRepo.js +61 -0
- package/lib/module/manager/dispatchCodes/EventCodeRepo.js.map +1 -0
- package/lib/module/manager/dispatchCodes/ReasonCodeContainer.js +3 -16
- package/lib/module/manager/dispatchCodes/ReasonCodeContainer.js.map +1 -1
- package/lib/module/manager/dispatchCodes/ReasonCodeRepo.js +6 -14
- package/lib/module/manager/dispatchCodes/ReasonCodeRepo.js.map +1 -1
- package/lib/module/manager/jobRemoval/JobRemovalManager.js +22 -0
- package/lib/module/manager/jobRemoval/JobRemovalManager.js.map +1 -0
- package/lib/module/manager/location/LocationManager.js +3 -14
- package/lib/module/manager/location/LocationManager.js.map +1 -1
- package/lib/module/manager/sdk/DispatchSDKManager.js +23 -15
- package/lib/module/manager/sdk/DispatchSDKManager.js.map +1 -1
- package/lib/module/manager/sdk/DispatchSdkCache.js +6 -13
- package/lib/module/manager/sdk/DispatchSdkCache.js.map +1 -1
- package/lib/module/manager/sdk/callbacksHandler.js +19 -0
- package/lib/module/manager/sdk/callbacksHandler.js.map +1 -0
- package/lib/module/manager/syncmanager/AppSyncManager.js +26 -26
- package/lib/module/manager/syncmanager/AppSyncManager.js.map +1 -1
- package/lib/module/manager/syncmanager/DBConfig.js +41 -7
- package/lib/module/manager/syncmanager/DBConfig.js.map +1 -1
- package/lib/module/manager/syncmanager/NativeSyncManager.js.map +1 -1
- package/lib/module/manager/syncmanager/constants.js +6 -0
- package/lib/module/manager/syncmanager/constants.js.map +1 -0
- package/lib/module/manager/syncmanager/database.js +27 -3
- package/lib/module/manager/syncmanager/database.js.map +1 -1
- package/lib/module/manager/syncmanager/document/DocumentHttpClient.js +11 -24
- package/lib/module/manager/syncmanager/document/DocumentHttpClient.js.map +1 -1
- package/lib/module/manager/syncmanager/document/DocumentManager.js +8 -20
- package/lib/module/manager/syncmanager/document/DocumentManager.js.map +1 -1
- package/lib/module/manager/syncmanager/document/DocumentSyncManager.js +19 -41
- package/lib/module/manager/syncmanager/document/DocumentSyncManager.js.map +1 -1
- package/lib/module/manager/syncmanager/events/ETEventsManager.js +415 -22
- package/lib/module/manager/syncmanager/events/ETEventsManager.js.map +1 -1
- package/lib/module/manager/syncmanager/events/EventsSyncManager.js +209 -82
- package/lib/module/manager/syncmanager/events/EventsSyncManager.js.map +1 -1
- package/lib/module/manager/syncmanager/events/SyncHttpClient.js +152 -24
- package/lib/module/manager/syncmanager/events/SyncHttpClient.js.map +1 -1
- package/lib/module/models/DispatchModels.js +3 -4
- package/lib/module/models/DispatchModels.js.map +1 -1
- package/lib/module/models/ReasonCodes.js.map +1 -1
- package/lib/module/models/execTasks/ETBaseModels.js +1 -1
- package/lib/module/models/execTasks/ETBaseModels.js.map +1 -1
- package/lib/module/models/execTasks/ETConfig.js +22 -29
- package/lib/module/models/execTasks/ETConfig.js.map +1 -1
- package/lib/module/models/sdk.js +3 -4
- package/lib/module/models/sdk.js.map +1 -1
- package/lib/module/native/signature/SignatureCapture.js +3 -18
- package/lib/module/native/signature/SignatureCapture.js.map +1 -1
- package/lib/module/network/GraphQLClient.js +6 -26
- package/lib/module/network/GraphQLClient.js.map +1 -1
- package/lib/module/network/NetworkClient.js +2 -6
- package/lib/module/network/NetworkClient.js.map +1 -1
- package/lib/module/network/NetworkUtils.js +10 -3
- package/lib/module/network/NetworkUtils.js.map +1 -1
- package/lib/module/network/Queries.js.map +1 -1
- package/lib/module/network/client.js +7 -17
- package/lib/module/network/client.js.map +1 -1
- package/lib/module/res/strings.js.map +1 -1
- package/lib/module/resources/Login.js +4 -13
- package/lib/module/resources/Login.js.map +1 -1
- package/lib/module/resources/network.js +3 -6
- package/lib/module/resources/network.js.map +1 -1
- package/lib/module/styles/SdkColors.js +9 -7
- package/lib/module/styles/SdkColors.js.map +1 -1
- package/lib/module/styles/executionTasks/CommonStyles.js +57 -14
- package/lib/module/styles/executionTasks/CommonStyles.js.map +1 -1
- package/lib/module/ui/screens/CancellationScreen.js +68 -15
- package/lib/module/ui/screens/CancellationScreen.js.map +1 -1
- package/lib/module/ui/screens/CaptureInputScreen.js +17 -6
- package/lib/module/ui/screens/CaptureInputScreen.js.map +1 -1
- package/lib/module/ui/screens/CompleteObjectiveScreen.js +12 -8
- package/lib/module/ui/screens/CompleteObjectiveScreen.js.map +1 -1
- package/lib/module/ui/screens/DeliverScreen.js +32 -7
- package/lib/module/ui/screens/DeliverScreen.js.map +1 -1
- package/lib/module/ui/screens/DisplayScreen.js +16 -6
- package/lib/module/ui/screens/DisplayScreen.js.map +1 -1
- package/lib/module/ui/screens/DoodleScreen.js +19 -9
- package/lib/module/ui/screens/DoodleScreen.js.map +1 -1
- package/lib/module/ui/screens/DropCashScreen.js +45 -19
- package/lib/module/ui/screens/DropCashScreen.js.map +1 -1
- package/lib/module/ui/screens/ETScreensIndex.js +3 -2
- package/lib/module/ui/screens/ETScreensIndex.js.map +1 -1
- package/lib/module/ui/screens/FormsScreen.js +104 -9
- package/lib/module/ui/screens/FormsScreen.js.map +1 -1
- package/lib/module/ui/screens/GeofenceScreen.js +15 -6
- package/lib/module/ui/screens/GeofenceScreen.js.map +1 -1
- package/lib/module/ui/screens/HttpRequestScreen.js +15 -5
- package/lib/module/ui/screens/HttpRequestScreen.js.map +1 -1
- package/lib/module/ui/screens/ImageCaptureScreen.js +37 -9
- package/lib/module/ui/screens/ImageCaptureScreen.js.map +1 -1
- package/lib/module/ui/screens/PaymentScreen.js +30 -17
- package/lib/module/ui/screens/PaymentScreen.js.map +1 -1
- package/lib/module/ui/screens/PickupScreen.js +40 -12
- package/lib/module/ui/screens/PickupScreen.js.map +1 -1
- package/lib/module/ui/screens/ScanScreen.js +111 -0
- package/lib/module/ui/screens/ScanScreen.js.map +1 -0
- package/lib/module/ui/screens/StartWorkFlowScreen.js +64 -16
- package/lib/module/ui/screens/StartWorkFlowScreen.js.map +1 -1
- package/lib/module/ui/screens/ValidateOTPScreen.js +45 -0
- package/lib/module/ui/screens/ValidateOTPScreen.js.map +1 -0
- package/lib/module/ui/screens/WithBaseDispatchScreen.js +0 -3
- package/lib/module/ui/screens/WithBaseDispatchScreen.js.map +1 -1
- package/lib/module/ui/uiConfig/RouteParams.js +23 -1
- package/lib/module/ui/uiConfig/RouteParams.js.map +1 -1
- package/lib/module/utils/ApiUtils.js +116 -0
- package/lib/module/utils/ApiUtils.js.map +1 -0
- package/lib/module/utils/ExecTaskUtils.js +110 -31
- package/lib/module/utils/ExecTaskUtils.js.map +1 -1
- package/lib/module/utils/Logger.js +9 -21
- package/lib/module/utils/Logger.js.map +1 -1
- package/lib/module/utils/NetworkUtil.js +3 -15
- package/lib/module/utils/NetworkUtil.js.map +1 -1
- package/lib/module/utils/SdkUtils.js +2 -15
- package/lib/module/utils/SdkUtils.js.map +1 -1
- package/lib/module/utils/SyncManagerUtils.js +62 -14
- package/lib/module/utils/SyncManagerUtils.js.map +1 -1
- package/lib/module/utils/fcm/FCM.js +63 -3
- package/lib/module/utils/fcm/FCM.js.map +1 -1
- package/lib/module/utils/fcm/FcmUtils.js +86 -7
- package/lib/module/utils/fcm/FcmUtils.js.map +1 -1
- package/lib/module/utils/helper.js +0 -3
- package/lib/module/utils/helper.js.map +1 -1
- package/lib/module/utils/hooks/useModal.js +43 -0
- package/lib/module/utils/hooks/useModal.js.map +1 -0
- package/lib/module/utils/hooks/useTimer.js +37 -0
- package/lib/module/utils/hooks/useTimer.js.map +1 -0
- package/lib/module/utils/loginHelper.js +6 -16
- package/lib/module/utils/loginHelper.js.map +1 -1
- package/lib/module/utils/storage.js +86 -29
- package/lib/module/utils/storage.js.map +1 -1
- package/lib/module/utils/utils.js +8 -6
- package/lib/module/utils/utils.js.map +1 -1
- package/lib/typescript/components/dispatch/DispatchExecNavigator.d.ts +2 -2
- package/lib/typescript/components/executiontasks/CompletedWFSchema.d.ts +2 -2
- package/lib/typescript/components/executiontasks/ExecutionTasksIndex.d.ts +6 -7
- package/lib/typescript/components/executiontasks/cancellation/CancelET.d.ts +2 -2
- package/lib/typescript/components/executiontasks/cancellation/CancellationSchema.d.ts +10 -5
- package/lib/typescript/components/executiontasks/captureInput/CaptureInputSchema.d.ts +7 -7
- package/lib/typescript/components/executiontasks/captureInput/CaptureText.d.ts +2 -2
- package/lib/typescript/components/executiontasks/captureInput/utils.d.ts +1 -0
- package/lib/typescript/components/executiontasks/deliver/DeliverET.d.ts +2 -2
- package/lib/typescript/components/executiontasks/deliver/DeliverETInput.d.ts +8 -7
- package/lib/typescript/components/executiontasks/deliver/SLDeliverET.d.ts +3 -3
- package/lib/typescript/components/executiontasks/display/DisplayModalET.d.ts +2 -2
- package/lib/typescript/components/executiontasks/display/DisplaySchema.d.ts +5 -5
- package/lib/typescript/components/executiontasks/doodle/SignatureET.d.ts +2 -2
- package/lib/typescript/components/executiontasks/doodle/SignatureSchema.d.ts +7 -7
- package/lib/typescript/components/executiontasks/dropCash/DropCashET.d.ts +2 -2
- package/lib/typescript/components/executiontasks/dropCash/DropCashSchema.d.ts +2 -2
- package/lib/typescript/components/executiontasks/dropCash/SLDropCash.d.ts +2 -2
- package/lib/typescript/components/executiontasks/forms/FormGenerator.d.ts +2 -2
- package/lib/typescript/components/executiontasks/forms/FormSchema.d.ts +2 -2
- package/lib/typescript/components/executiontasks/forms/widgets/DateTimeWidget.d.ts +3 -3
- package/lib/typescript/components/executiontasks/forms/widgets/DropdownWidget.d.ts +9 -0
- package/lib/typescript/components/executiontasks/forms/widgets/QRBarcodeScannerWidget.d.ts +2 -2
- package/lib/typescript/components/executiontasks/forms/widgets/TimeRangeSelector.d.ts +2 -2
- package/lib/typescript/components/executiontasks/httpRequest/HttpEtUtils.d.ts +1 -1
- package/lib/typescript/components/executiontasks/httpRequest/HttpRequestET.d.ts +2 -2
- package/lib/typescript/components/executiontasks/httpRequest/HttpRequestETSchema.d.ts +6 -6
- package/lib/typescript/components/executiontasks/imageCapture/CaptureSchema.d.ts +17 -11
- package/lib/typescript/components/executiontasks/imageCapture/ImageCapture.d.ts +2 -2
- package/lib/typescript/components/executiontasks/payments/completePayment/CompletePaymentET.d.ts +2 -2
- package/lib/typescript/components/executiontasks/payments/completePayment/CompletePaymentSchema.d.ts +2 -2
- package/lib/typescript/components/executiontasks/payments/init/InitPaymentET.d.ts +2 -2
- package/lib/typescript/components/executiontasks/payments/init/InitPaymentSchema.d.ts +3 -3
- package/lib/typescript/components/executiontasks/payments/processPayment/ProcessPaymentET.d.ts +2 -2
- package/lib/typescript/components/executiontasks/payments/processPayment/ProcessPaymentSchema.d.ts +2 -2
- package/lib/typescript/components/executiontasks/pickup/PickpSchema.d.ts +3 -3
- package/lib/typescript/components/executiontasks/pickup/PickupET.d.ts +2 -2
- package/lib/typescript/components/executiontasks/pickup/SLPickupET.d.ts +3 -3
- package/lib/typescript/components/executiontasks/scan/ScanET.d.ts +16 -0
- package/lib/typescript/components/executiontasks/scan/ScanSchema.d.ts +86 -0
- package/lib/typescript/components/executiontasks/scan/constants.d.ts +6 -0
- package/lib/typescript/components/executiontasks/scan/interfaces.d.ts +94 -0
- package/lib/typescript/components/executiontasks/scan/modalConstant.d.ts +37 -0
- package/lib/typescript/components/executiontasks/{scanner → scan/sub_components}/CScanner.d.ts +1 -1
- package/lib/typescript/components/executiontasks/scan/sub_components/DropDownUtils.d.ts +7 -0
- package/lib/typescript/components/executiontasks/scan/sub_components/ERDropDown.d.ts +17 -0
- package/lib/typescript/components/executiontasks/scan/sub_components/SummaryPage.d.ts +21 -0
- package/lib/typescript/components/executiontasks/scan/utils.d.ts +37 -0
- package/lib/typescript/components/executiontasks/validateOTP/ValidateOTPET.d.ts +4 -0
- package/lib/typescript/components/executiontasks/validateOTP/ValidateOTPSchema.d.ts +54 -0
- package/lib/typescript/components/executiontasks/validateOTP/constants.d.ts +10 -0
- package/lib/typescript/components/executiontasks/validateOTP/sub-components/OTPInput.d.ts +12 -0
- package/lib/typescript/components/executiontasks/validateOTP/utils.d.ts +7 -0
- package/lib/typescript/components/executiontasks/verifyInput/VerifyInputSchema.d.ts +8 -8
- package/lib/typescript/components/executiontasks/verifyLocation/VerifyLocSchema.d.ts +9 -9
- package/lib/typescript/components/executiontasks/verifyLocation/VerifyLocationET.d.ts +2 -2
- package/lib/typescript/components/executiontasks/verifyOtp/VerifyOtpET.d.ts +2 -2
- package/lib/typescript/components/executiontasks/verifyOtp/VerifyOtpSchema.d.ts +6 -6
- package/lib/typescript/components/utils/index.d.ts +2 -0
- package/lib/typescript/components/widgets/CancelOrderDialog.d.ts +2 -2
- package/lib/typescript/components/widgets/Card.d.ts +17 -0
- package/lib/typescript/components/widgets/GoBackModal.d.ts +9 -0
- package/lib/typescript/components/widgets/IconButton.d.ts +9 -0
- package/lib/typescript/components/widgets/ModalWidget.d.ts +30 -0
- package/lib/typescript/components/widgets/ProgressDialog.d.ts +2 -2
- package/lib/typescript/components/widgets/SearchBar.d.ts +10 -0
- package/lib/typescript/components/widgets/SnackBarCustom.d.ts +10 -5
- package/lib/typescript/components/widgets/SplitTextInput.d.ts +12 -0
- package/lib/typescript/components/widgets/TabsComponent.d.ts +15 -0
- package/lib/typescript/constants/apiConstants.d.ts +7 -0
- package/lib/typescript/constants/constants.d.ts +4 -2
- package/lib/typescript/errors/ErrorCodes.d.ts +3 -1
- package/lib/typescript/events/EventDispatcher.d.ts +3 -0
- package/lib/typescript/events/EventListener.d.ts +5 -0
- package/lib/typescript/events/constants.d.ts +7 -0
- package/lib/typescript/events/index.d.ts +2 -0
- package/lib/typescript/events/interface.d.ts +1 -0
- package/lib/typescript/index.d.ts +12 -9
- package/lib/typescript/manager/dispatch/DispatchStateContainer.d.ts +38 -17
- package/lib/typescript/manager/dispatchCodes/EventCodeContainer.d.ts +12 -1
- package/lib/typescript/manager/dispatchCodes/EventCodeRepo.d.ts +13 -0
- package/lib/typescript/manager/jobRemoval/JobRemovalManager.d.ts +0 -0
- package/lib/typescript/manager/sdk/DispatchSdkCache.d.ts +1 -0
- package/lib/typescript/manager/sdk/callbacksHandler.d.ts +13 -0
- package/lib/typescript/manager/syncmanager/AppSyncManager.d.ts +3 -1
- package/lib/typescript/manager/syncmanager/DBConfig.d.ts +80 -4
- package/lib/typescript/manager/syncmanager/constants.d.ts +5 -0
- package/lib/typescript/manager/syncmanager/database.d.ts +5 -0
- package/lib/typescript/manager/syncmanager/document/DocumentManager.d.ts +1 -1
- package/lib/typescript/manager/syncmanager/document/DocumentSyncManager.d.ts +1 -1
- package/lib/typescript/manager/syncmanager/document/models.d.ts +1 -1
- package/lib/typescript/manager/syncmanager/events/ETEventsManager.d.ts +15 -2
- package/lib/typescript/manager/syncmanager/events/EventsSyncManager.d.ts +4 -2
- package/lib/typescript/manager/syncmanager/events/SyncHttpClient.d.ts +6 -3
- package/lib/typescript/models/DispatchModels.d.ts +59 -5
- package/lib/typescript/models/ReasonCodes.d.ts +5 -0
- package/lib/typescript/models/auth.d.ts +1 -1
- package/lib/typescript/models/execTasks/ETBaseModels.d.ts +44 -20
- package/lib/typescript/models/execTasks/ETConfig.d.ts +8 -4
- package/lib/typescript/models/sdk.d.ts +12 -0
- package/lib/typescript/native/signature/SignatureCapture.d.ts +2 -2
- package/lib/typescript/network/NetworkUtils.d.ts +1 -5
- package/lib/typescript/styles/SdkColors.d.ts +2 -0
- package/lib/typescript/styles/executionTasks/CommonStyles.d.ts +50 -5
- package/lib/typescript/ui/screens/CancellationScreen.d.ts +2 -2
- package/lib/typescript/ui/screens/CaptureInputScreen.d.ts +2 -2
- package/lib/typescript/ui/screens/CompleteObjectiveScreen.d.ts +2 -2
- package/lib/typescript/ui/screens/DeliverScreen.d.ts +2 -2
- package/lib/typescript/ui/screens/DisplayScreen.d.ts +2 -2
- package/lib/typescript/ui/screens/DoodleScreen.d.ts +2 -2
- package/lib/typescript/ui/screens/DropCashScreen.d.ts +2 -2
- package/lib/typescript/ui/screens/ETScreensIndex.d.ts +3 -2
- package/lib/typescript/ui/screens/FormsScreen.d.ts +2 -2
- package/lib/typescript/ui/screens/GeofenceScreen.d.ts +2 -2
- package/lib/typescript/ui/screens/HttpRequestScreen.d.ts +1 -1
- package/lib/typescript/ui/screens/ImageCaptureScreen.d.ts +2 -2
- package/lib/typescript/ui/screens/PaymentScreen.d.ts +2 -2
- package/lib/typescript/ui/screens/PickupScreen.d.ts +2 -2
- package/lib/typescript/ui/screens/ScanScreen.d.ts +3 -0
- package/lib/typescript/ui/screens/StartWorkFlowScreen.d.ts +2 -2
- package/lib/typescript/ui/screens/ValidateOTPScreen.d.ts +3 -0
- package/lib/typescript/ui/screens/WithBaseDispatchScreen.d.ts +2 -2
- package/lib/typescript/ui/uiConfig/RouteParams.d.ts +14 -0
- package/lib/typescript/utils/ApiUtils.d.ts +61 -0
- package/lib/typescript/utils/ExecTaskUtils.d.ts +10 -4
- package/lib/typescript/utils/NetworkUtil.d.ts +1 -1
- package/lib/typescript/utils/SyncManagerUtils.d.ts +4 -3
- package/lib/typescript/utils/hooks/useModal.d.ts +6 -0
- package/lib/typescript/utils/hooks/useTimer.d.ts +5 -0
- package/lib/typescript/utils/storage.d.ts +32 -0
- package/package.json +26 -26
- package/tsconfig.json +9 -9
- package/file_unzip.js +0 -5
- package/lib/commonjs/components/executiontasks/doodle/DoodleUtils.js +0 -28
- package/lib/commonjs/components/executiontasks/doodle/DoodleUtils.js.map +0 -1
- package/lib/commonjs/components/executiontasks/scanner/CScanner.js.map +0 -1
- package/lib/commonjs/components/executiontasks/scanner/ScannerSchema.js +0 -32
- package/lib/commonjs/components/executiontasks/scanner/ScannerSchema.js.map +0 -1
- package/lib/commonjs/components/executiontasks/scanner/ScannerUtils.js +0 -193
- package/lib/commonjs/components/executiontasks/scanner/ScannerUtils.js.map +0 -1
- package/lib/commonjs/components/executiontasks/scanner/returns/DropDownSelector.js +0 -20
- package/lib/commonjs/components/executiontasks/scanner/returns/DropDownSelector.js.map +0 -1
- package/lib/commonjs/components/executiontasks/scanner/returns/DropDownUtils.js +0 -49
- package/lib/commonjs/components/executiontasks/scanner/returns/DropDownUtils.js.map +0 -1
- package/lib/commonjs/components/executiontasks/scanner/returns/RTReasonSelection.js +0 -107
- package/lib/commonjs/components/executiontasks/scanner/returns/RTReasonSelection.js.map +0 -1
- package/lib/commonjs/components/executiontasks/scanner/returns/RTScan.js +0 -317
- package/lib/commonjs/components/executiontasks/scanner/returns/RTScan.js.map +0 -1
- package/lib/commonjs/components/executiontasks/scanner/returns/ReasonDropDown.js.map +0 -1
- package/lib/commonjs/components/executiontasks/scanner/returns/ScanList.js +0 -276
- package/lib/commonjs/components/executiontasks/scanner/returns/ScanList.js.map +0 -1
- package/lib/commonjs/ui/screens/RTScanScreen.js +0 -118
- package/lib/commonjs/ui/screens/RTScanScreen.js.map +0 -1
- package/lib/module/components/executiontasks/doodle/DoodleUtils.js +0 -19
- package/lib/module/components/executiontasks/doodle/DoodleUtils.js.map +0 -1
- package/lib/module/components/executiontasks/scanner/CScanner.js.map +0 -1
- package/lib/module/components/executiontasks/scanner/ScannerSchema.js +0 -24
- package/lib/module/components/executiontasks/scanner/ScannerSchema.js.map +0 -1
- package/lib/module/components/executiontasks/scanner/ScannerUtils.js +0 -158
- package/lib/module/components/executiontasks/scanner/ScannerUtils.js.map +0 -1
- package/lib/module/components/executiontasks/scanner/returns/DropDownSelector.js +0 -9
- package/lib/module/components/executiontasks/scanner/returns/DropDownSelector.js.map +0 -1
- package/lib/module/components/executiontasks/scanner/returns/DropDownUtils.js +0 -38
- package/lib/module/components/executiontasks/scanner/returns/DropDownUtils.js.map +0 -1
- package/lib/module/components/executiontasks/scanner/returns/RTReasonSelection.js +0 -86
- package/lib/module/components/executiontasks/scanner/returns/RTReasonSelection.js.map +0 -1
- package/lib/module/components/executiontasks/scanner/returns/RTScan.js +0 -287
- package/lib/module/components/executiontasks/scanner/returns/RTScan.js.map +0 -1
- package/lib/module/components/executiontasks/scanner/returns/ReasonDropDown.js +0 -80
- package/lib/module/components/executiontasks/scanner/returns/ReasonDropDown.js.map +0 -1
- package/lib/module/components/executiontasks/scanner/returns/ScanList.js +0 -253
- package/lib/module/components/executiontasks/scanner/returns/ScanList.js.map +0 -1
- package/lib/module/ui/screens/RTScanScreen.js +0 -93
- package/lib/module/ui/screens/RTScanScreen.js.map +0 -1
- package/lib/typescript/components/executiontasks/doodle/DoodleUtils.d.ts +0 -3
- package/lib/typescript/components/executiontasks/scanner/ScannerSchema.d.ts +0 -75
- package/lib/typescript/components/executiontasks/scanner/ScannerUtils.d.ts +0 -15
- package/lib/typescript/components/executiontasks/scanner/returns/DropDownSelector.d.ts +0 -3
- package/lib/typescript/components/executiontasks/scanner/returns/DropDownUtils.d.ts +0 -3
- package/lib/typescript/components/executiontasks/scanner/returns/RTReasonSelection.d.ts +0 -7
- package/lib/typescript/components/executiontasks/scanner/returns/RTScan.d.ts +0 -4
- package/lib/typescript/components/executiontasks/scanner/returns/ReasonDropDown.d.ts +0 -14
- package/lib/typescript/components/executiontasks/scanner/returns/ScanList.d.ts +0 -17
- package/lib/typescript/ui/screens/RTScanScreen.d.ts +0 -3
- package/mobile-execution-lib-0.6.4.tgz +0 -0
|
@@ -4,25 +4,16 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = exports.LOG_TYPE = void 0;
|
|
7
|
-
|
|
8
7
|
var _DispatchSdkCache = _interopRequireDefault(require("../manager/sdk/DispatchSdkCache"));
|
|
9
|
-
|
|
10
8
|
var Sentry = _interopRequireWildcard(require("@sentry/react-native"));
|
|
11
|
-
|
|
12
9
|
var _crashlytics = _interopRequireDefault(require("@react-native-firebase/crashlytics"));
|
|
13
|
-
|
|
14
10
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
15
|
-
|
|
16
11
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
17
|
-
|
|
18
12
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
19
|
-
|
|
20
|
-
function
|
|
21
|
-
|
|
22
|
-
let LOG_TYPE
|
|
23
|
-
exports.LOG_TYPE = LOG_TYPE;
|
|
24
|
-
|
|
25
|
-
(function (LOG_TYPE) {
|
|
13
|
+
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; }
|
|
14
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
|
15
|
+
function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
16
|
+
let LOG_TYPE = /*#__PURE__*/function (LOG_TYPE) {
|
|
26
17
|
LOG_TYPE["SDK_ERROR"] = "sdk_error";
|
|
27
18
|
LOG_TYPE["SDK_WARNING"] = "sdk_warning";
|
|
28
19
|
LOG_TYPE["SDK_INFO"] = "sdk_info";
|
|
@@ -31,13 +22,13 @@ exports.LOG_TYPE = LOG_TYPE;
|
|
|
31
22
|
LOG_TYPE["APP_WARNING"] = "app_warning";
|
|
32
23
|
LOG_TYPE["APP_DEBUG"] = "app_debug";
|
|
33
24
|
LOG_TYPE["APP_INFO"] = "app_info";
|
|
34
|
-
|
|
35
|
-
|
|
25
|
+
return LOG_TYPE;
|
|
26
|
+
}({});
|
|
27
|
+
exports.LOG_TYPE = LOG_TYPE;
|
|
36
28
|
class Logger {
|
|
37
29
|
constructor() {
|
|
38
|
-
_defineProperty(this, "enableLogs",
|
|
30
|
+
_defineProperty(this, "enableLogs", false);
|
|
39
31
|
}
|
|
40
|
-
|
|
41
32
|
setLogging(enabled, sdkConfig) {
|
|
42
33
|
this.enableLogs = enabled;
|
|
43
34
|
(0, _crashlytics.default)().setUserId(sdkConfig.userID).then().catch();
|
|
@@ -47,26 +38,21 @@ class Logger {
|
|
|
47
38
|
tenantId: sdkConfig.tenantID
|
|
48
39
|
}).then().catch();
|
|
49
40
|
}
|
|
50
|
-
|
|
51
41
|
logEvent(TAG, message, logType) {
|
|
52
42
|
if (this.enableLogs) console.log(TAG, message);
|
|
53
|
-
|
|
54
|
-
this.sendSentryMessage(message, TAG, logType);
|
|
55
|
-
|
|
43
|
+
// crashlytics().log(`${TAG} - ${logType} -${message}`);
|
|
44
|
+
// this.sendSentryMessage(message, TAG, logType);
|
|
56
45
|
if (logType === LOG_TYPE.SDK_WARNING || logType === LOG_TYPE.SDK_ERROR || logType === LOG_TYPE.APP_ERROR || logType === LOG_TYPE.APP_WARNING) {
|
|
57
46
|
(0, _crashlytics.default)().recordError(new Error(message), TAG);
|
|
58
47
|
this.sendSentryException(new Error(message), TAG, logType);
|
|
59
48
|
}
|
|
60
49
|
}
|
|
61
|
-
|
|
62
50
|
static getInstance() {
|
|
63
51
|
if (!Logger.instance) {
|
|
64
52
|
Logger.instance = new Logger();
|
|
65
53
|
}
|
|
66
|
-
|
|
67
54
|
return Logger.instance;
|
|
68
55
|
}
|
|
69
|
-
|
|
70
56
|
sendSentryException(exception, logTag, logType) {
|
|
71
57
|
(async () => {
|
|
72
58
|
try {
|
|
@@ -74,7 +60,6 @@ class Logger {
|
|
|
74
60
|
} catch (error) {}
|
|
75
61
|
})();
|
|
76
62
|
}
|
|
77
|
-
|
|
78
63
|
sendSentryMessage(message, logTag, logType) {
|
|
79
64
|
(async () => {
|
|
80
65
|
try {
|
|
@@ -82,7 +67,6 @@ class Logger {
|
|
|
82
67
|
} catch (error) {}
|
|
83
68
|
})();
|
|
84
69
|
}
|
|
85
|
-
|
|
86
70
|
async getUserConfig(logLevel, logType, logTag) {
|
|
87
71
|
try {
|
|
88
72
|
const config = await _DispatchSdkCache.default.getInstance().getObjectFromCache(_DispatchSdkCache.default.KEYS.SDK_CONFIG);
|
|
@@ -104,11 +88,8 @@ class Logger {
|
|
|
104
88
|
return undefined;
|
|
105
89
|
}
|
|
106
90
|
}
|
|
107
|
-
|
|
108
91
|
}
|
|
109
|
-
|
|
110
92
|
_defineProperty(Logger, "instance", void 0);
|
|
111
|
-
|
|
112
93
|
var _default = Logger;
|
|
113
94
|
exports.default = _default;
|
|
114
95
|
//# sourceMappingURL=Logger.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["LOG_TYPE","Logger","setLogging","enabled","sdkConfig","enableLogs","crashlytics","setUserId","userID","then","catch","setAttributes","userId","userName","tenantId","tenantID","logEvent","TAG","message","logType","console","log","
|
|
1
|
+
{"version":3,"names":["_DispatchSdkCache","_interopRequireDefault","require","Sentry","_interopRequireWildcard","_crashlytics","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","default","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","_defineProperty","value","_toPropertyKey","enumerable","configurable","writable","arg","_toPrimitive","String","input","hint","prim","Symbol","toPrimitive","undefined","res","TypeError","Number","LOG_TYPE","exports","Logger","constructor","setLogging","enabled","sdkConfig","enableLogs","crashlytics","setUserId","userID","then","catch","setAttributes","userId","userName","tenantId","tenantID","logEvent","TAG","message","logType","console","log","SDK_WARNING","SDK_ERROR","APP_ERROR","APP_WARNING","recordError","Error","sendSentryException","getInstance","instance","exception","logTag","captureException","getUserConfig","Severity","error","sendSentryMessage","captureMessage","Warning","logLevel","config","DispatchSdkCache","getObjectFromCache","KEYS","SDK_CONFIG","dspId","getKeyFromCache","DISPATCH_ID","user","id","username","tags","dispatchId","errorTime","Date","now","level","_default"],"sources":["Logger.ts"],"sourcesContent":["import DispatchSdkCache from '../manager/sdk/DispatchSdkCache';\nimport type { DispatchSDKConfig } from '../models/sdk';\nimport * as Sentry from '@sentry/react-native';\nimport { Severity } from '@sentry/react-native';\nimport crashlytics from '@react-native-firebase/crashlytics';\n\nexport const enum LOG_TYPE {\n SDK_ERROR = 'sdk_error',\n SDK_WARNING = 'sdk_warning',\n SDK_INFO = 'sdk_info',\n SDK_DEBUG = 'sdk_debug',\n APP_ERROR = 'app_error',\n APP_WARNING = 'app_warning',\n APP_DEBUG = 'app_debug',\n APP_INFO = 'app_info',\n}\n\nclass Logger {\n private static instance: Logger;\n private enableLogs: boolean = false;\n\n setLogging(enabled: boolean, sdkConfig: DispatchSDKConfig) {\n this.enableLogs = enabled;\n crashlytics().setUserId(sdkConfig.userID).then().catch();\n crashlytics()\n .setAttributes({\n userId: sdkConfig.userID,\n userName: sdkConfig.userName,\n tenantId: sdkConfig.tenantID,\n })\n .then()\n .catch();\n }\n\n logEvent(TAG: string, message: string, logType: LOG_TYPE) {\n if (this.enableLogs) console.log(TAG, message);\n // crashlytics().log(`${TAG} - ${logType} -${message}`);\n // this.sendSentryMessage(message, TAG, logType);\n if (\n logType === LOG_TYPE.SDK_WARNING ||\n logType === LOG_TYPE.SDK_ERROR ||\n logType === LOG_TYPE.APP_ERROR ||\n logType === LOG_TYPE.APP_WARNING\n ) {\n crashlytics().recordError(new Error(message), TAG);\n this.sendSentryException(new Error(message), TAG, logType);\n }\n }\n\n public static getInstance(): Logger {\n if (!Logger.instance) {\n Logger.instance = new Logger();\n }\n return Logger.instance;\n }\n\n public sendSentryException(exception: any, logTag: string, logType: string) {\n (async () => {\n try {\n Sentry.captureException(\n exception,\n await this.getUserConfig(Severity.Error, logType, logTag)\n );\n } catch (error: any) {}\n })();\n }\n\n public sendSentryMessage(message: string, logTag: string, logType: string) {\n (async () => {\n try {\n Sentry.captureMessage(\n message,\n await this.getUserConfig(Severity.Warning, logType, logTag)\n );\n } catch (error: any) {}\n })();\n }\n\n private async getUserConfig(\n logLevel: Severity,\n logType: string,\n logTag: string\n ) {\n try {\n const config = (await DispatchSdkCache.getInstance().getObjectFromCache(\n DispatchSdkCache.KEYS.SDK_CONFIG\n )) as DispatchSDKConfig;\n const dspId = await DispatchSdkCache.getInstance().getKeyFromCache(\n DispatchSdkCache.KEYS.DISPATCH_ID\n );\n return {\n user: {\n id: config?.userID,\n username: config?.userName,\n },\n tags: {\n dispatchId: dspId,\n errorTime: Date.now(),\n logType: logType,\n logTag: logTag,\n },\n level: logLevel,\n };\n } catch (error: any) {\n return undefined;\n }\n }\n}\n\nexport default Logger;\n"],"mappings":";;;;;;AAAA,IAAAA,iBAAA,GAAAC,sBAAA,CAAAC,OAAA;AAEA,IAAAC,MAAA,GAAAC,uBAAA,CAAAF,OAAA;AAEA,IAAAG,YAAA,GAAAJ,sBAAA,CAAAC,OAAA;AAA6D,SAAAI,yBAAAC,WAAA,eAAAC,OAAA,kCAAAC,iBAAA,OAAAD,OAAA,QAAAE,gBAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,WAAA,WAAAA,WAAA,GAAAG,gBAAA,GAAAD,iBAAA,KAAAF,WAAA;AAAA,SAAAH,wBAAAO,GA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B,OAAO,EAAEa,MAAM,CAC5D,CAAC;MACH,CAAC,CAAC,OAAOI,KAAU,EAAE,CAAC;IACxB,CAAC,EAAE,CAAC;EACN;EAEA,MAAcF,aAAaA,CACzBM,QAAkB,EAClBrB,OAAe,EACfa,MAAc,EACd;IACA,IAAI;MACF,MAAMS,MAAM,GAAI,MAAMC,yBAAgB,CAACb,WAAW,CAAC,CAAC,CAACc,kBAAkB,CACrED,yBAAgB,CAACE,IAAI,CAACC,UACxB,CAAuB;MACvB,MAAMC,KAAK,GAAG,MAAMJ,yBAAgB,CAACb,WAAW,CAAC,CAAC,CAACkB,eAAe,CAChEL,yBAAgB,CAACE,IAAI,CAACI,WACxB,CAAC;MACD,OAAO;QACLC,IAAI,EAAE;UACJC,EAAE,EAAET,MAAM,aAANA,MAAM,uBAANA,MAAM,CAAEjC,MAAM;UAClB2C,QAAQ,EAAEV,MAAM,aAANA,MAAM,uBAANA,MAAM,CAAE5B;QACpB,CAAC;QACDuC,IAAI,EAAE;UACJC,UAAU,EAAEP,KAAK;UACjBQ,SAAS,EAAEC,IAAI,CAACC,GAAG,CAAC,CAAC;UACrBrC,OAAO,EAAEA,OAAO;UAChBa,MAAM,EAAEA;QACV,CAAC;QACDyB,KAAK,EAAEjB;MACT,CAAC;IACH,CAAC,CAAC,OAAOJ,KAAU,EAAE;MACnB,OAAO1C,SAAS;IAClB;EACF;AACF;AAACd,eAAA,CA1FKoB,MAAM;AAAA,IAAA0D,QAAA,GA4FG1D,MAAM;AAAAD,OAAA,CAAAlC,OAAA,GAAA6F,QAAA"}
|
|
@@ -4,41 +4,31 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
-
|
|
8
7
|
var _netinfo = _interopRequireDefault(require("@react-native-community/netinfo"));
|
|
9
|
-
|
|
10
8
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
11
|
-
|
|
12
|
-
function
|
|
13
|
-
|
|
9
|
+
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; }
|
|
10
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
|
11
|
+
function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
14
12
|
class NetworkUtils {
|
|
15
13
|
constructor() {
|
|
16
14
|
_defineProperty(this, "_isAvailable", true);
|
|
17
|
-
|
|
18
15
|
_defineProperty(this, "_listeners", new Set());
|
|
19
|
-
|
|
20
16
|
_defineProperty(this, "_handleConnectivityChange", netInfo => {
|
|
21
17
|
this._isAvailable = netInfo.isConnected ?? false;
|
|
22
|
-
|
|
23
18
|
this._listeners.forEach(listener => {
|
|
24
19
|
listener(this._isAvailable);
|
|
25
20
|
});
|
|
26
21
|
});
|
|
27
|
-
|
|
28
22
|
_netinfo.default.addEventListener(this._handleConnectivityChange);
|
|
29
|
-
|
|
30
23
|
this.isAvailableAsync();
|
|
31
24
|
}
|
|
32
|
-
|
|
33
25
|
isAvailable() {
|
|
34
26
|
return this._isAvailable;
|
|
35
27
|
}
|
|
36
|
-
|
|
37
28
|
async isAvailableAsync() {
|
|
38
29
|
if (this._isAvailable) {
|
|
39
30
|
return this._isAvailable;
|
|
40
31
|
}
|
|
41
|
-
|
|
42
32
|
try {
|
|
43
33
|
const netInfo = await _netinfo.default.fetch();
|
|
44
34
|
this._isAvailable = netInfo.isConnected ?? false;
|
|
@@ -46,21 +36,15 @@ class NetworkUtils {
|
|
|
46
36
|
this._isAvailable = false;
|
|
47
37
|
console.warn(`Uncaught error when fetching connectivity status: ${e}`);
|
|
48
38
|
}
|
|
49
|
-
|
|
50
39
|
return this._isAvailable;
|
|
51
40
|
}
|
|
52
|
-
|
|
53
41
|
addListener(listener) {
|
|
54
42
|
this._listeners.add(listener);
|
|
55
43
|
}
|
|
56
|
-
|
|
57
44
|
removeListener(listener) {
|
|
58
45
|
this._listeners.delete(listener);
|
|
59
46
|
}
|
|
60
|
-
|
|
61
47
|
}
|
|
62
|
-
|
|
63
48
|
var _default = new NetworkUtils();
|
|
64
|
-
|
|
65
49
|
exports.default = _default;
|
|
66
50
|
//# sourceMappingURL=NetworkUtil.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["NetworkUtils","constructor","Set","netInfo","_isAvailable","isConnected","_listeners","forEach","listener","NetInfo","addEventListener","_handleConnectivityChange","isAvailableAsync","isAvailable","fetch","e","console","warn","addListener","add","removeListener","delete"],"sources":["NetworkUtil.ts"],"sourcesContent":["import NetInfo, { NetInfoState } from '@react-native-community/netinfo';\n\ntype ConnectivityListener = (available: boolean) => void;\n\nclass NetworkUtils {\n _isAvailable = true;\n _listeners = new Set<ConnectivityListener>();\n\n constructor() {\n NetInfo.addEventListener(this._handleConnectivityChange);\n this.isAvailableAsync();\n }\n\n isAvailable(): boolean {\n return this._isAvailable;\n }\n\n async isAvailableAsync(): Promise<boolean> {\n if (this._isAvailable) {\n return this._isAvailable;\n }\n\n try {\n const netInfo = await NetInfo.fetch();\n this._isAvailable = netInfo.isConnected ?? false;\n } catch (e) {\n this._isAvailable = false;\n console.warn(`Uncaught error when fetching connectivity status: ${e}`);\n }\n\n return this._isAvailable;\n }\n\n _handleConnectivityChange = (netInfo: NetInfoState) => {\n this._isAvailable = netInfo.isConnected ?? false;\n this._listeners.forEach((listener) => {\n listener(this._isAvailable);\n });\n };\n\n addListener(listener: ConnectivityListener): void {\n this._listeners.add(listener);\n }\n\n removeListener(listener: ConnectivityListener): void {\n this._listeners.delete(listener);\n }\n}\n\nexport default new NetworkUtils();\n"],"mappings":"
|
|
1
|
+
{"version":3,"names":["_netinfo","_interopRequireDefault","require","obj","__esModule","default","_defineProperty","key","value","_toPropertyKey","Object","defineProperty","enumerable","configurable","writable","arg","_toPrimitive","String","input","hint","prim","Symbol","toPrimitive","undefined","res","call","TypeError","Number","NetworkUtils","constructor","Set","netInfo","_isAvailable","isConnected","_listeners","forEach","listener","NetInfo","addEventListener","_handleConnectivityChange","isAvailableAsync","isAvailable","fetch","e","console","warn","addListener","add","removeListener","delete","_default","exports"],"sources":["NetworkUtil.ts"],"sourcesContent":["import NetInfo, { NetInfoState } from '@react-native-community/netinfo';\n\ntype ConnectivityListener = (available: boolean) => void;\n\nclass NetworkUtils {\n _isAvailable = true;\n _listeners = new Set<ConnectivityListener>();\n\n constructor() {\n NetInfo.addEventListener(this._handleConnectivityChange);\n this.isAvailableAsync();\n }\n\n isAvailable(): boolean {\n return this._isAvailable;\n }\n\n async isAvailableAsync(): Promise<boolean> {\n if (this._isAvailable) {\n return this._isAvailable;\n }\n\n try {\n const netInfo = await NetInfo.fetch();\n this._isAvailable = netInfo.isConnected ?? false;\n } catch (e) {\n this._isAvailable = false;\n console.warn(`Uncaught error when fetching connectivity status: ${e}`);\n }\n\n return this._isAvailable;\n }\n\n _handleConnectivityChange = (netInfo: NetInfoState) => {\n this._isAvailable = netInfo.isConnected ?? false;\n this._listeners.forEach((listener) => {\n listener(this._isAvailable);\n });\n };\n\n addListener(listener: ConnectivityListener): void {\n this._listeners.add(listener);\n }\n\n removeListener(listener: ConnectivityListener): void {\n this._listeners.delete(listener);\n }\n}\n\nexport default new NetworkUtils();\n"],"mappings":";;;;;;AAAA,IAAAA,QAAA,GAAAC,sBAAA,CAAAC,OAAA;AAAwE,SAAAD,uBAAAE,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAAA,SAAAG,gBAAAH,GAAA,EAAAI,GAAA,EAAAC,KAAA,IAAAD,GAAA,GAAAE,cAAA,CAAAF,GAAA,O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AI,CAACR,YAAY,EAAE;MACrB,OAAO,IAAI,CAACA,YAAY;IAC1B;IAEA,IAAI;MACF,MAAMD,OAAO,GAAG,MAAMM,gBAAO,CAACK,KAAK,CAAC,CAAC;MACrC,IAAI,CAACV,YAAY,GAAGD,OAAO,CAACE,WAAW,IAAI,KAAK;IAClD,CAAC,CAAC,OAAOU,CAAC,EAAE;MACV,IAAI,CAACX,YAAY,GAAG,KAAK;MACzBY,OAAO,CAACC,IAAI,CAAE,qDAAoDF,CAAE,EAAC,CAAC;IACxE;IAEA,OAAO,IAAI,CAACX,YAAY;EAC1B;EASAc,WAAWA,CAACV,QAA8B,EAAQ;IAChD,IAAI,CAACF,UAAU,CAACa,GAAG,CAACX,QAAQ,CAAC;EAC/B;EAEAY,cAAcA,CAACZ,QAA8B,EAAQ;IACnD,IAAI,CAACF,UAAU,CAACe,MAAM,CAACb,QAAQ,CAAC;EAClC;AACF;AAAC,IAAAc,QAAA,GAEc,IAAItB,YAAY,CAAC,CAAC;AAAAuB,OAAA,CAAA9C,OAAA,GAAA6C,QAAA"}
|
|
@@ -4,34 +4,21 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = exports.DispatchUtilsInterface = void 0;
|
|
7
|
-
|
|
8
7
|
var _remoteConfig = _interopRequireDefault(require("@react-native-firebase/remote-config"));
|
|
9
|
-
|
|
10
8
|
var _Logger = _interopRequireWildcard(require("./Logger"));
|
|
11
|
-
|
|
12
9
|
var FileSystem = _interopRequireWildcard(require("expo-file-system"));
|
|
13
|
-
|
|
14
10
|
var _reactNative = require("react-native");
|
|
15
|
-
|
|
16
11
|
var Location = _interopRequireWildcard(require("expo-location"));
|
|
17
|
-
|
|
18
12
|
var _NetworkUtil = _interopRequireDefault(require("./NetworkUtil"));
|
|
19
|
-
|
|
20
13
|
var _BaseError = require("../errors/BaseError");
|
|
21
|
-
|
|
22
14
|
var _ErrorCodes = _interopRequireDefault(require("../errors/ErrorCodes"));
|
|
23
|
-
|
|
24
15
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
25
|
-
|
|
26
16
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
27
|
-
|
|
28
17
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
29
|
-
|
|
30
18
|
const {
|
|
31
19
|
DispatchSdkUtils
|
|
32
20
|
} = _reactNative.NativeModules;
|
|
33
21
|
exports.DispatchUtilsInterface = DispatchSdkUtils;
|
|
34
|
-
|
|
35
22
|
class SdkUtils {
|
|
36
23
|
/**
|
|
37
24
|
* number of seconds to cache the firebase config
|
|
@@ -43,14 +30,11 @@ class SdkUtils {
|
|
|
43
30
|
await (0, _remoteConfig.default)().fetch(expiration);
|
|
44
31
|
(0, _remoteConfig.default)().fetchAndActivate().then(fetchedRemotely => {
|
|
45
32
|
let config = (0, _remoteConfig.default)().getAll();
|
|
46
|
-
|
|
47
33
|
if (fetchedRemotely) {
|
|
48
34
|
_Logger.default.getInstance().logEvent('Remote Config', 'Configs were retrieved from the backend and activated.', _Logger.LOG_TYPE.SDK_INFO);
|
|
49
|
-
|
|
50
35
|
resolve(config);
|
|
51
36
|
} else {
|
|
52
37
|
_Logger.default.getInstance().logEvent('Remote Config', 'No configs were fetched from the backend, and the local configs were already activated', _Logger.LOG_TYPE.SDK_INFO);
|
|
53
|
-
|
|
54
38
|
resolve(config);
|
|
55
39
|
}
|
|
56
40
|
}).catch(err => {
|
|
@@ -61,69 +45,56 @@ class SdkUtils {
|
|
|
61
45
|
}
|
|
62
46
|
});
|
|
63
47
|
}
|
|
48
|
+
|
|
64
49
|
/**
|
|
65
50
|
* Function to download apk file from a public URL
|
|
66
51
|
* @param apkURL - URL where apk is hosted
|
|
67
52
|
* @param version - expected version of apk (used for naming the file)
|
|
68
53
|
* @param callback - callback for getting progress of download
|
|
69
54
|
*/
|
|
70
|
-
|
|
71
|
-
|
|
72
55
|
static async downloadAPK(apkURL, version, callback) {
|
|
73
56
|
const fileUri = FileSystem.cacheDirectory + `${version}.apk`;
|
|
74
57
|
const fileInfo = await FileSystem.getInfoAsync(fileUri);
|
|
75
58
|
const currentDate = new Date().toLocaleDateString();
|
|
76
59
|
const fileDate = new Date(fileInfo.modificationTime ? fileInfo.modificationTime * 1000 : 0).toLocaleDateString();
|
|
77
|
-
|
|
78
60
|
if (fileInfo.exists && currentDate === fileDate) {
|
|
79
61
|
return fileInfo.uri;
|
|
80
62
|
}
|
|
81
|
-
|
|
82
63
|
const downloadResumable = FileSystem.createDownloadResumable(apkURL, FileSystem.cacheDirectory + `${version}.apk`, {}, callback);
|
|
83
64
|
const downloadResult = await downloadResumable.downloadAsync();
|
|
84
65
|
return downloadResult === null || downloadResult === void 0 ? void 0 : downloadResult.uri;
|
|
85
66
|
}
|
|
67
|
+
|
|
86
68
|
/**
|
|
87
69
|
* Opens & Install an APK file
|
|
88
70
|
* @param uri - source of apk file
|
|
89
71
|
*/
|
|
90
|
-
|
|
91
|
-
|
|
92
72
|
static async deleteApk(version) {
|
|
93
73
|
await FileSystem.deleteAsync(FileSystem.cacheDirectory + `${version}.apk`);
|
|
94
74
|
}
|
|
95
|
-
|
|
96
75
|
static async openAPKFile(uri) {
|
|
97
76
|
return await DispatchSdkUtils.openAndInstallApk(uri);
|
|
98
77
|
}
|
|
99
|
-
|
|
100
78
|
static openAppSettings() {
|
|
101
79
|
DispatchSdkUtils.openSettings().then().catch(error => {
|
|
102
80
|
_Logger.default.getInstance().logEvent('Intent error', error.message, _Logger.LOG_TYPE.SDK_ERROR);
|
|
103
81
|
});
|
|
104
82
|
}
|
|
105
|
-
|
|
106
83
|
static async checkMandatory() {
|
|
107
84
|
const dateTimeCheck = await DispatchSdkUtils.isAutomaticDateTimeEnabled();
|
|
108
|
-
|
|
109
85
|
if (!dateTimeCheck) {
|
|
110
86
|
throw new _BaseError.BaseError(_ErrorCodes.default.SYSTEM_TIME_CHECK_FAILED, 'Automatic date/time not enabled!');
|
|
111
87
|
}
|
|
112
|
-
|
|
113
88
|
await Location.enableNetworkProviderAsync();
|
|
114
89
|
let locationServicesCheck = await Location.hasServicesEnabledAsync();
|
|
115
90
|
const foregroundLocation = await Location.requestForegroundPermissionsAsync();
|
|
116
91
|
const bgLocation = await Location.requestBackgroundPermissionsAsync();
|
|
117
|
-
|
|
118
92
|
if (!(locationServicesCheck && foregroundLocation && bgLocation)) {
|
|
119
93
|
throw new _BaseError.BaseError(_ErrorCodes.default.LOCATION_OR_GPS_NOT_ENABLED, 'Location or GPS not enabled');
|
|
120
94
|
}
|
|
121
|
-
|
|
122
95
|
let internet = await _NetworkUtil.default.isAvailableAsync();
|
|
123
96
|
if (!internet) throw new _BaseError.BaseError(_ErrorCodes.default.INTERNET_NOT_ENABLED, 'Internet is disabled! Please enable internet and try again ');
|
|
124
97
|
}
|
|
125
|
-
|
|
126
98
|
}
|
|
127
|
-
|
|
128
99
|
exports.default = SdkUtils;
|
|
129
100
|
//# sourceMappingURL=SdkUtils.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["DispatchSdkUtils","NativeModules","SdkUtils","getRemoteConfig","expiration","Promise","resolve","reject","remoteConfig","fetch","fetchAndActivate","then","fetchedRemotely","config","getAll","Logger","getInstance","logEvent","LOG_TYPE","SDK_INFO","catch","err","error","downloadAPK","apkURL","version","callback","fileUri","FileSystem","cacheDirectory","fileInfo","getInfoAsync","currentDate","Date","toLocaleDateString","fileDate","modificationTime","exists","uri","downloadResumable","createDownloadResumable","downloadResult","downloadAsync","deleteApk","deleteAsync","openAPKFile","openAndInstallApk","openAppSettings","openSettings","message","SDK_ERROR","checkMandatory","dateTimeCheck","isAutomaticDateTimeEnabled","BaseError","ErrorCodes","SYSTEM_TIME_CHECK_FAILED","Location","enableNetworkProviderAsync","locationServicesCheck","hasServicesEnabledAsync","foregroundLocation","requestForegroundPermissionsAsync","bgLocation","requestBackgroundPermissionsAsync","LOCATION_OR_GPS_NOT_ENABLED","internet","NetworkUtil","isAvailableAsync","INTERNET_NOT_ENABLED"],"sources":["SdkUtils.ts"],"sourcesContent":["import remoteConfig from '@react-native-firebase/remote-config';\nimport Logger, { LOG_TYPE } from './Logger';\nimport type { DownloadProgressData } from 'expo-file-system';\nimport * as FileSystem from 'expo-file-system';\nimport { NativeModules } from 'react-native';\nimport * as Location from 'expo-location';\nimport NetworkUtil from './NetworkUtil';\nimport { BaseError } from '../errors/BaseError';\nimport ErrorCodes from '../errors/ErrorCodes';\n\nconst { DispatchSdkUtils } = NativeModules;\n\ninterface DispatchUtilsInterface {\n openAndInstallApk(apkUri: String): Promise<boolean>;\n openSettings(): Promise<boolean>;\n showAndroidDialog(\n title: string,\n message: string,\n positiveText: string,\n negativeText: string | null,\n cancelable: boolean\n ): Promise<boolean>;\n isAutomaticDateTimeEnabled(): Promise<boolean>;\n}\n\nexport { DispatchSdkUtils as DispatchUtilsInterface };\n\nexport default class SdkUtils {\n /**\n * number of seconds to cache the firebase config\n * @param expiration\n */\n static async getRemoteConfig(expiration: number): Promise<any> {\n return new Promise(async (resolve, reject) => {\n try {\n await remoteConfig().fetch(expiration);\n remoteConfig()\n .fetchAndActivate()\n .then((fetchedRemotely) => {\n let config = remoteConfig().getAll();\n if (fetchedRemotely) {\n Logger.getInstance().logEvent(\n 'Remote Config',\n 'Configs were retrieved from the backend and activated.',\n LOG_TYPE.SDK_INFO\n );\n resolve(config);\n } else {\n Logger.getInstance().logEvent(\n 'Remote Config',\n 'No configs were fetched from the backend, and the local configs were already activated',\n LOG_TYPE.SDK_INFO\n );\n resolve(config);\n }\n })\n .catch((err) => {\n reject(err);\n });\n } catch (error: any) {\n reject(error);\n }\n });\n }\n\n /**\n * Function to download apk file from a public URL\n * @param apkURL - URL where apk is hosted\n * @param version - expected version of apk (used for naming the file)\n * @param callback - callback for getting progress of download\n */\n public static async downloadAPK(\n apkURL: string,\n version: string,\n callback: (progress: DownloadProgressData) => any\n ): Promise<string | undefined> {\n const fileUri = FileSystem.cacheDirectory + `${version}.apk`;\n const fileInfo = await FileSystem.getInfoAsync(fileUri);\n const currentDate = new Date().toLocaleDateString();\n const fileDate = new Date(\n fileInfo.modificationTime ? fileInfo.modificationTime * 1000 : 0\n ).toLocaleDateString();\n if (fileInfo.exists && currentDate === fileDate) {\n return fileInfo.uri;\n }\n const downloadResumable = FileSystem.createDownloadResumable(\n apkURL,\n FileSystem.cacheDirectory + `${version}.apk`,\n {},\n callback\n );\n const downloadResult = await downloadResumable.downloadAsync();\n return downloadResult?.uri;\n }\n\n /**\n * Opens & Install an APK file\n * @param uri - source of apk file\n */\n public static async deleteApk(version: string) {\n await FileSystem.deleteAsync(FileSystem.cacheDirectory + `${version}.apk`);\n }\n\n public static async openAPKFile(uri: string) {\n return await (DispatchSdkUtils as DispatchUtilsInterface).openAndInstallApk(\n uri\n );\n }\n\n public static openAppSettings() {\n (DispatchSdkUtils as DispatchUtilsInterface)\n .openSettings()\n .then()\n .catch((error) => {\n Logger.getInstance().logEvent(\n 'Intent error',\n error.message,\n LOG_TYPE.SDK_ERROR\n );\n });\n }\n\n public static async checkMandatory() {\n const dateTimeCheck = await (\n DispatchSdkUtils as DispatchUtilsInterface\n ).isAutomaticDateTimeEnabled();\n if (!dateTimeCheck) {\n throw new BaseError(\n ErrorCodes.SYSTEM_TIME_CHECK_FAILED,\n 'Automatic date/time not enabled!'\n );\n }\n await Location.enableNetworkProviderAsync();\n let locationServicesCheck = await Location.hasServicesEnabledAsync();\n const foregroundLocation =\n await Location.requestForegroundPermissionsAsync();\n const bgLocation = await Location.requestBackgroundPermissionsAsync();\n if (!(locationServicesCheck && foregroundLocation && bgLocation)) {\n throw new BaseError(\n ErrorCodes.LOCATION_OR_GPS_NOT_ENABLED,\n 'Location or GPS not enabled'\n );\n }\n let internet = await NetworkUtil.isAvailableAsync();\n if (!internet)\n throw new BaseError(\n ErrorCodes.INTERNET_NOT_ENABLED,\n 'Internet is disabled! Please enable internet and try again '\n );\n }\n}\n"],"mappings":";;;;;;;AAAA;;AACA;;AAEA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;;;AAEA,MAAM;EAAEA;AAAF,IAAuBC,0BAA7B;;;AAiBe,MAAMC,QAAN,CAAe;EAC5B;AACF;AACA;AACA;EAC8B,aAAfC,eAAe,CAACC,UAAD,EAAmC;IAC7D,OAAO,IAAIC,OAAJ,CAAY,OAAOC,OAAP,EAAgBC,MAAhB,KAA2B;MAC5C,IAAI;QACF,MAAM,IAAAC,qBAAA,IAAeC,KAAf,CAAqBL,UAArB,CAAN;QACA,IAAAI,qBAAA,IACGE,gBADH,GAEGC,IAFH,CAESC,eAAD,IAAqB;UACzB,IAAIC,MAAM,GAAG,IAAAL,qBAAA,IAAeM,MAAf,EAAb;;UACA,IAAIF,eAAJ,EAAqB;YACnBG,eAAA,CAAOC,WAAP,GAAqBC,QAArB,CACE,eADF,EAEE,wDAFF,EAGEC,gBAAA,CAASC,QAHX;;YAKAb,OAAO,CAACO,MAAD,CAAP;UACD,CAPD,MAOO;YACLE,eAAA,CAAOC,WAAP,GAAqBC,QAArB,CACE,eADF,EAEE,wFAFF,EAGEC,gBAAA,CAASC,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AA9D,CAAN;EACD;;EAE8B,aAAXoB,WAAW,CAACP,GAAD,EAAc;IAC3C,OAAO,MAAOtC,gBAAD,CAA6C8C,iBAA7C,CACXR,GADW,CAAb;EAGD;;EAE4B,OAAfS,eAAe,GAAG;IAC7B/C,gBAAD,CACGgD,YADH,GAEGrC,IAFH,GAGGS,KAHH,CAGUE,KAAD,IAAW;MAChBP,eAAA,CAAOC,WAAP,GAAqBC,QAArB,CACE,cADF,EAEEK,KAAK,CAAC2B,OAFR,EAGE/B,gBAAA,CAASgC,SAHX;IAKD,CATH;EAUD;;EAEiC,aAAdC,cAAc,GAAG;IACnC,MAAMC,aAAa,GAAG,MACpBpD,gBAD0B,CAE1BqD,0BAF0B,EAA5B;;IAGA,IAAI,CAACD,aAAL,EAAoB;MAClB,MAAM,IAAIE,oBAAJ,CACJC,mBAAA,CAAWC,wBADP,EAEJ,kCAFI,CAAN;IAID;;IACD,MAAMC,QAAQ,CAACC,0BAAT,EAAN;IACA,IAAIC,qBAAqB,GAAG,MAAMF,QAAQ,CAACG,uBAAT,EAAlC;IACA,MAAMC,kBAAkB,GACtB,MAAMJ,QAAQ,CAACK,iCAAT,EADR;IAEA,MAAMC,UAAU,GAAG,MAAMN,QAAQ,CAACO,iCAAT,EAAzB;;IACA,IAAI,EAAEL,qBAAqB,IAAIE,kBAAzB,IAA+CE,UAAjD,CAAJ,EAAkE;MAChE,MAAM,IAAIT,oBAAJ,CACJC,mBAAA,CAAWU,2BADP,EAEJ,6BAFI,CAAN;IAID;;IACD,IAAIC,QAAQ,GAAG,MAAMC,oBAAA,CAAYC,gBAAZ,EAArB;IACA,IAAI,CAACF,QAAL,EACE,MAAM,IAAIZ,oBAAJ,CACJC,mBAAA,CAAWc,oBADP,EAEJ,6DAFI,CAAN;EAIH;;AA1H2B"}
|
|
1
|
+
{"version":3,"names":["_remoteConfig","_interopRequireDefault","require","_Logger","_interopRequireWildcard","FileSystem","_reactNative","Location","_NetworkUtil","_BaseError","_ErrorCodes","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","default","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","DispatchSdkUtils","NativeModules","exports","DispatchUtilsInterface","SdkUtils","getRemoteConfig","expiration","Promise","resolve","reject","remoteConfig","fetch","fetchAndActivate","then","fetchedRemotely","config","getAll","Logger","getInstance","logEvent","LOG_TYPE","SDK_INFO","catch","err","error","downloadAPK","apkURL","version","callback","fileUri","cacheDirectory","fileInfo","getInfoAsync","currentDate","Date","toLocaleDateString","fileDate","modificationTime","exists","uri","downloadResumable","createDownloadResumable","downloadResult","downloadAsync","deleteApk","deleteAsync","openAPKFile","openAndInstallApk","openAppSettings","openSettings","message","SDK_ERROR","checkMandatory","dateTimeCheck","isAutomaticDateTimeEnabled","BaseError","ErrorCodes","SYSTEM_TIME_CHECK_FAILED","enableNetworkProviderAsync","locationServicesCheck","hasServicesEnabledAsync","foregroundLocation","requestForegroundPermissionsAsync","bgLocation","requestBackgroundPermissionsAsync","LOCATION_OR_GPS_NOT_ENABLED","internet","NetworkUtil","isAvailableAsync","INTERNET_NOT_ENABLED"],"sources":["SdkUtils.ts"],"sourcesContent":["import remoteConfig from '@react-native-firebase/remote-config';\nimport Logger, { LOG_TYPE } from './Logger';\nimport type { DownloadProgressData } from 'expo-file-system';\nimport * as FileSystem from 'expo-file-system';\nimport { NativeModules } from 'react-native';\nimport * as Location from 'expo-location';\nimport NetworkUtil from './NetworkUtil';\nimport { BaseError } from '../errors/BaseError';\nimport ErrorCodes from '../errors/ErrorCodes';\n\nconst { DispatchSdkUtils } = NativeModules;\n\ninterface DispatchUtilsInterface {\n openAndInstallApk(apkUri: String): Promise<boolean>;\n openSettings(): Promise<boolean>;\n showAndroidDialog(\n title: string,\n message: string,\n positiveText: string,\n negativeText: string | null,\n cancelable: boolean\n ): Promise<boolean>;\n isAutomaticDateTimeEnabled(): Promise<boolean>;\n}\n\nexport { DispatchSdkUtils as DispatchUtilsInterface };\n\nexport default class SdkUtils {\n /**\n * number of seconds to cache the firebase config\n * @param expiration\n */\n static async getRemoteConfig(expiration: number): Promise<any> {\n return new Promise(async (resolve, reject) => {\n try {\n await remoteConfig().fetch(expiration);\n remoteConfig()\n .fetchAndActivate()\n .then((fetchedRemotely) => {\n let config = remoteConfig().getAll();\n if (fetchedRemotely) {\n Logger.getInstance().logEvent(\n 'Remote Config',\n 'Configs were retrieved from the backend and activated.',\n LOG_TYPE.SDK_INFO\n );\n resolve(config);\n } else {\n Logger.getInstance().logEvent(\n 'Remote Config',\n 'No configs were fetched from the backend, and the local configs were already activated',\n LOG_TYPE.SDK_INFO\n );\n resolve(config);\n }\n })\n .catch((err) => {\n reject(err);\n });\n } catch (error: any) {\n reject(error);\n }\n });\n }\n\n /**\n * Function to download apk file from a public URL\n * @param apkURL - URL where apk is hosted\n * @param version - expected version of apk (used for naming the file)\n * @param callback - callback for getting progress of download\n */\n public static async downloadAPK(\n apkURL: string,\n version: string,\n callback: (progress: DownloadProgressData) => any\n ): Promise<string | undefined> {\n const fileUri = FileSystem.cacheDirectory + `${version}.apk`;\n const fileInfo = await FileSystem.getInfoAsync(fileUri);\n const currentDate = new Date().toLocaleDateString();\n const fileDate = new Date(\n fileInfo.modificationTime ? fileInfo.modificationTime * 1000 : 0\n ).toLocaleDateString();\n if (fileInfo.exists && currentDate === fileDate) {\n return fileInfo.uri;\n }\n const downloadResumable = FileSystem.createDownloadResumable(\n apkURL,\n FileSystem.cacheDirectory + `${version}.apk`,\n {},\n callback\n );\n const downloadResult = await downloadResumable.downloadAsync();\n return downloadResult?.uri;\n }\n\n /**\n * Opens & Install an APK file\n * @param uri - source of apk file\n */\n public static async deleteApk(version: string) {\n await FileSystem.deleteAsync(FileSystem.cacheDirectory + `${version}.apk`);\n }\n\n public static async openAPKFile(uri: string) {\n return await (DispatchSdkUtils as DispatchUtilsInterface).openAndInstallApk(\n uri\n );\n }\n\n public static openAppSettings() {\n (DispatchSdkUtils as DispatchUtilsInterface)\n .openSettings()\n .then()\n .catch((error) => {\n Logger.getInstance().logEvent(\n 'Intent error',\n error.message,\n LOG_TYPE.SDK_ERROR\n );\n });\n }\n\n public static async checkMandatory() {\n const dateTimeCheck = await (\n DispatchSdkUtils as DispatchUtilsInterface\n ).isAutomaticDateTimeEnabled();\n if (!dateTimeCheck) {\n throw new BaseError(\n ErrorCodes.SYSTEM_TIME_CHECK_FAILED,\n 'Automatic date/time not enabled!'\n );\n }\n await Location.enableNetworkProviderAsync();\n let locationServicesCheck = await Location.hasServicesEnabledAsync();\n const foregroundLocation =\n await Location.requestForegroundPermissionsAsync();\n const bgLocation = await Location.requestBackgroundPermissionsAsync();\n if (!(locationServicesCheck && foregroundLocation && bgLocation)) {\n throw new BaseError(\n ErrorCodes.LOCATION_OR_GPS_NOT_ENABLED,\n 'Location or GPS not enabled'\n );\n }\n let internet = await NetworkUtil.isAvailableAsync();\n if (!internet)\n throw new BaseError(\n ErrorCodes.INTERNET_NOT_ENABLED,\n 'Internet is disabled! Please enable internet and try again '\n );\n }\n}\n"],"mappings":";;;;;;AAAA,IAAAA,aAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,OAAA,GAAAC,uBAAA,CAAAF,OAAA;AAEA,IAAAG,UAAA,GAAAD,uBAAA,CAAAF,OAAA;AACA,IAAAI,YAAA,GAAAJ,OAAA;AACA,IAAAK,QAAA,GAAAH,uBAAA,CAAAF,OAAA;AACA,IAAAM,YAAA,GAAAP,sBAAA,CAAAC,OAAA;AACA,IAAAO,UAAA,GAAAP,OAAA;AACA,IAAAQ,WAAA,GAAAT,sBAAA,CAAAC,OAAA;AAA8C,SAAAS,yBAAAC,WAAA,eAAAC,OAAA,kCAAAC,iBAAA,OAAAD,OAAA,QAAAE,gBAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,WAAA,WAAAA,WAAA,GAAAG,gBAAA,GAAAD,iBAAA,KAAAF,WA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AA0B,CAAC,CAAC;IAC3C,IAAIC,qBAAqB,GAAG,MAAMrF,QAAQ,CAACsF,uBAAuB,CAAC,CAAC;IACpE,MAAMC,kBAAkB,GACtB,MAAMvF,QAAQ,CAACwF,iCAAiC,CAAC,CAAC;IACpD,MAAMC,UAAU,GAAG,MAAMzF,QAAQ,CAAC0F,iCAAiC,CAAC,CAAC;IACrE,IAAI,EAAEL,qBAAqB,IAAIE,kBAAkB,IAAIE,UAAU,CAAC,EAAE;MAChE,MAAM,IAAIR,oBAAS,CACjBC,mBAAU,CAACS,2BAA2B,EACtC,6BACF,CAAC;IACH;IACA,IAAIC,QAAQ,GAAG,MAAMC,oBAAW,CAACC,gBAAgB,CAAC,CAAC;IACnD,IAAI,CAACF,QAAQ,EACX,MAAM,IAAIX,oBAAS,CACjBC,mBAAU,CAACa,oBAAoB,EAC/B,6DACF,CAAC;EACL;AACF;AAACnE,OAAA,CAAAjB,OAAA,GAAAmB,QAAA"}
|
|
@@ -6,46 +6,36 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.clearCache = clearCache;
|
|
7
7
|
exports.createFmsFolder = createFmsFolder;
|
|
8
8
|
exports.insertDocumentInDB = insertDocumentInDB;
|
|
9
|
+
exports.pushBulkEventForSync = pushBulkEventForSync;
|
|
9
10
|
exports.pushEventForSync = pushEventForSync;
|
|
10
|
-
|
|
11
11
|
var _EventsSyncManager = _interopRequireDefault(require("../manager/syncmanager/events/EventsSyncManager"));
|
|
12
|
-
|
|
12
|
+
var _platformCoreosExecutionEngineSdk = require("@os1-platform/platform-coreos-execution-engine-sdk");
|
|
13
13
|
var _Logger = _interopRequireWildcard(require("./Logger"));
|
|
14
|
-
|
|
15
14
|
var _DispatchSdkCache = _interopRequireDefault(require("../manager/sdk/DispatchSdkCache"));
|
|
16
|
-
|
|
17
15
|
var _DocumentSyncManager = _interopRequireDefault(require("../manager/syncmanager/document/DocumentSyncManager"));
|
|
18
|
-
|
|
19
16
|
var _utils = require("./utils");
|
|
20
|
-
|
|
21
17
|
var _BaseError = require("../errors/BaseError");
|
|
22
|
-
|
|
23
18
|
var _ErrorCodes = _interopRequireDefault(require("../errors/ErrorCodes"));
|
|
24
|
-
|
|
25
19
|
var _GraphQLClient = _interopRequireDefault(require("../network/GraphQLClient"));
|
|
26
|
-
|
|
27
20
|
var _AppSyncManager = _interopRequireDefault(require("../manager/syncmanager/AppSyncManager"));
|
|
28
|
-
|
|
21
|
+
var _storage = _interopRequireDefault(require("./storage"));
|
|
29
22
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
30
|
-
|
|
31
23
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
32
|
-
|
|
33
24
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
34
|
-
|
|
25
|
+
const SyncType = _platformCoreosExecutionEngineSdk.IDispatch.SyncType;
|
|
35
26
|
const keys = _DispatchSdkCache.default.KEYS;
|
|
36
|
-
|
|
37
27
|
const cache = _DispatchSdkCache.default.getInstance();
|
|
38
|
-
|
|
39
28
|
const TAG = 'SaveEventDB';
|
|
40
|
-
|
|
41
29
|
async function pushEventForSync(syncType, dspID, data, config, sequence, meta) {
|
|
42
30
|
try {
|
|
43
31
|
await _EventsSyncManager.default.getInstance().insertEvent(sequence, data, dspID, syncType, meta ? meta.jobId + meta.objectiveReference : 'NO_REF_FOUND', JSON.stringify(config));
|
|
44
32
|
|
|
45
|
-
|
|
46
|
-
|
|
33
|
+
/* Logger.getInstance().logEvent(
|
|
34
|
+
TAG,
|
|
35
|
+
`Event Inserted ${syncType} ${JSON.stringify(data)}`,
|
|
36
|
+
LOG_TYPE.SDK_ERROR
|
|
37
|
+
); */
|
|
47
38
|
_AppSyncManager.default.getInstance().startSDKSyncManager();
|
|
48
|
-
|
|
49
39
|
return true;
|
|
50
40
|
} catch (error) {
|
|
51
41
|
_Logger.default.getInstance().logEvent('pushEventForSync ' + syncType, JSON.stringify({
|
|
@@ -55,79 +45,107 @@ async function pushEventForSync(syncType, dspID, data, config, sequence, meta) {
|
|
|
55
45
|
config: config,
|
|
56
46
|
meta: meta
|
|
57
47
|
}), _Logger.LOG_TYPE.SDK_ERROR);
|
|
48
|
+
return false;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
58
51
|
|
|
52
|
+
// NEW CODE
|
|
53
|
+
async function pushBulkEventForSync(pushData) {
|
|
54
|
+
try {
|
|
55
|
+
await _EventsSyncManager.default.getInstance().insertBulkEvent(pushData);
|
|
56
|
+
_AppSyncManager.default.getInstance().startSDKSyncManager();
|
|
57
|
+
return true;
|
|
58
|
+
} catch (error) {
|
|
59
|
+
_Logger.default.getInstance().logEvent('pushEventForSync ', JSON.stringify({
|
|
60
|
+
errorMessage: error.message
|
|
61
|
+
}), _Logger.LOG_TYPE.SDK_ERROR);
|
|
59
62
|
return false;
|
|
60
63
|
}
|
|
61
64
|
}
|
|
65
|
+
|
|
66
|
+
// OLD CODE
|
|
67
|
+
// export async function pushBulkEventForSync(
|
|
68
|
+
// pushData: BulkEvent[]
|
|
69
|
+
// ): Promise<boolean> {
|
|
70
|
+
// try {
|
|
71
|
+
// await EventsSyncManager.getInstance().insertBulkEvent(pushData);
|
|
72
|
+
|
|
73
|
+
// AppSyncManager.getInstance().startSDKSyncManager();
|
|
74
|
+
// return true;
|
|
75
|
+
// } catch (error: any) {
|
|
76
|
+
// Logger.getInstance().logEvent(
|
|
77
|
+
// 'pushEventForSync ',
|
|
78
|
+
// JSON.stringify({
|
|
79
|
+
// errorMessage: error.message,
|
|
80
|
+
// }),
|
|
81
|
+
// LOG_TYPE.SDK_ERROR
|
|
82
|
+
// );
|
|
83
|
+
// return false;
|
|
84
|
+
// }
|
|
85
|
+
// }
|
|
86
|
+
|
|
62
87
|
/**
|
|
63
88
|
* clears synced events from Sync & Document manager
|
|
64
89
|
* @param dspID
|
|
65
90
|
* @private
|
|
66
91
|
*/
|
|
67
|
-
|
|
68
|
-
|
|
69
92
|
async function clearCache(dspID) {
|
|
70
93
|
try {
|
|
71
94
|
let prevDspID = await cache.getKeyFromCache(keys.DISPATCH_ID);
|
|
72
|
-
|
|
73
95
|
if (prevDspID != null && prevDspID !== dspID) {
|
|
74
96
|
_DocumentSyncManager.default.getInstance().clearSyncedDocs(prevDspID).then().catch();
|
|
75
|
-
|
|
76
97
|
_EventsSyncManager.default.getInstance().clearEventsDB().then().catch();
|
|
98
|
+
await _storage.default.getInstance().clearShared();
|
|
77
99
|
}
|
|
78
100
|
} catch (error) {
|
|
79
101
|
_Logger.default.getInstance().logEvent('clearCache', error.message, _Logger.LOG_TYPE.SDK_WARNING);
|
|
80
102
|
}
|
|
81
103
|
}
|
|
82
|
-
|
|
83
|
-
|
|
104
|
+
async function insertDocumentInDB(fileName, fmsFolderName,
|
|
105
|
+
// jobID: string,
|
|
106
|
+
// objRef: string,
|
|
107
|
+
base64Image, imageDesc, filePath) {
|
|
84
108
|
try {
|
|
85
109
|
const dspID = await cache.getKeyFromCache(keys.DISPATCH_ID);
|
|
86
|
-
let response = await _DocumentSyncManager.default.getInstance().insertDocument(fmsFolderName, base64Image, base64Image != null, imageDesc, dspID ?? 'NULL',
|
|
87
|
-
|
|
110
|
+
let response = await _DocumentSyncManager.default.getInstance().insertDocument(fmsFolderName, base64Image, base64Image != null, imageDesc, dspID ?? 'NULL',
|
|
111
|
+
// jobID,
|
|
112
|
+
// objRef,
|
|
113
|
+
filePath, 'image', fileName);
|
|
88
114
|
_AppSyncManager.default.getInstance().startSDKSyncManager();
|
|
89
|
-
|
|
90
115
|
return response.insertId;
|
|
91
116
|
} catch (error) {
|
|
92
117
|
_Logger.default.getInstance().logEvent('insertDocumentInDB', error.message, _Logger.LOG_TYPE.SDK_ERROR);
|
|
93
|
-
|
|
94
118
|
return undefined;
|
|
95
119
|
}
|
|
96
120
|
}
|
|
97
|
-
|
|
98
121
|
async function createFmsFolder(dispatchID) {
|
|
99
|
-
const
|
|
100
|
-
const folderName = `dsp_${randomDateString.toString().slice(4)}`;
|
|
122
|
+
const folderName = `dsp_${new Date().toISOString().slice(0, 10).split('-').join('')}`;
|
|
101
123
|
let fmsFolder = await cache.getKeyFromCache(keys.FMS_FOLDER);
|
|
102
124
|
const dspID = await cache.getKeyFromCache(keys.DISPATCH_ID);
|
|
103
|
-
|
|
104
125
|
if (!(0, _utils.isEmptyOrBlank)(fmsFolder) && dspID != null && dspID === dispatchID) {
|
|
105
126
|
return;
|
|
106
127
|
} else {
|
|
107
128
|
try {
|
|
108
|
-
var _response$data
|
|
109
|
-
|
|
129
|
+
var _response$data;
|
|
110
130
|
const response = await _GraphQLClient.default.getInstance().createFmsFolder(folderName, `${dispatchID}`);
|
|
111
|
-
|
|
112
|
-
if (!(0, _utils.isEmptyOrBlank)(response === null || response === void 0 ? void 0 : (_response$data = response.data) === null || _response$data === void 0 ? void 0 : (_response$data$create = _response$data.createFolder) === null || _response$data$create === void 0 ? void 0 : _response$data$create.id)) {
|
|
131
|
+
if (!(0, _utils.isEmptyOrBlank)(response === null || response === void 0 || (_response$data = response.data) === null || _response$data === void 0 || (_response$data = _response$data.createFolder) === null || _response$data === void 0 ? void 0 : _response$data.id)) {
|
|
113
132
|
_Logger.default.getInstance().logEvent('createFmsFolder', 'Folder creation success!', _Logger.LOG_TYPE.SDK_INFO);
|
|
114
|
-
|
|
115
133
|
await cache.setKeyInCache(keys.FMS_FOLDER, folderName);
|
|
116
134
|
} else {
|
|
117
|
-
|
|
118
|
-
|
|
135
|
+
/* Logger.getInstance().logEvent(
|
|
136
|
+
'createFmsFolder',
|
|
137
|
+
JSON.stringify(response?.data),
|
|
138
|
+
LOG_TYPE.SDK_ERROR
|
|
139
|
+
); */
|
|
119
140
|
throw new _BaseError.BaseError(_ErrorCodes.default.FMS_FOLDER_CREATION_ERROR, JSON.stringify(response === null || response === void 0 ? void 0 : response.data));
|
|
120
141
|
}
|
|
121
142
|
} catch (error) {
|
|
122
143
|
var _error$graphQLErrors$;
|
|
123
|
-
|
|
124
144
|
if (error && error.graphQLErrors && error.graphQLErrors.length > 0 && ((_error$graphQLErrors$ = error.graphQLErrors[0]) === null || _error$graphQLErrors$ === void 0 ? void 0 : _error$graphQLErrors$.code) === '100010213009') {
|
|
125
145
|
await cache.setKeyInCache(keys.FMS_FOLDER, folderName);
|
|
126
|
-
|
|
127
146
|
_Logger.default.getInstance().logEvent('createFmsFolder', 'Folder already exists', _Logger.LOG_TYPE.SDK_INFO);
|
|
128
147
|
} else {
|
|
129
148
|
_Logger.default.getInstance().logEvent('createFmsFolder', error.message, _Logger.LOG_TYPE.SDK_ERROR);
|
|
130
|
-
|
|
131
149
|
throw new _BaseError.BaseError(_ErrorCodes.default.FMS_GRAPHQL_API_ERROR, error.message);
|
|
132
150
|
}
|
|
133
151
|
}
|