@os1-platform/dispatch-mobile 1.0.7 → 1.3.11
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 +90 -26
- package/android/.gradle/6.8/fileChanges/last-build.bin +0 -0
- package/android/.gradle/6.8/fileHashes/fileHashes.lock +0 -0
- package/android/.gradle/6.8/gc.properties +0 -0
- package/android/.gradle/buildOutputCleanup/buildOutputCleanup.lock +0 -0
- package/android/.gradle/buildOutputCleanup/cache.properties +2 -0
- package/android/.gradle/checksums/checksums.lock +0 -0
- package/android/.gradle/configuration-cache/gc.properties +0 -0
- package/android/.gradle/vcs-1/gc.properties +0 -0
- package/android/.idea/gradle.xml +13 -0
- package/android/.idea/misc.xml +4 -0
- package/android/.idea/vcs.xml +6 -0
- package/android/.idea/workspace.xml +131 -0
- package/android/gradle.properties +1 -1
- package/android/local.properties +8 -0
- package/android/src/main/AndroidManifest.xml +0 -1
- package/lib/commonjs/components/dispatch/DispatchExecNavigator.js +46 -39
- package/lib/commonjs/components/dispatch/DispatchExecNavigator.js.map +1 -1
- package/lib/commonjs/components/executiontasks/ExecutionTasksIndex.js +14 -24
- 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 +64 -16
- package/lib/commonjs/components/executiontasks/captureInput/CaptureText.js.map +1 -1
- 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/SLDeliverET.js +68 -26
- package/lib/commonjs/components/executiontasks/deliver/SLDeliverET.js.map +1 -1
- package/lib/commonjs/components/executiontasks/display/DisplayModalET.js +4 -13
- package/lib/commonjs/components/executiontasks/display/DisplayModalET.js.map +1 -1
- package/lib/commonjs/components/executiontasks/doodle/DoodleUtils.js +0 -2
- package/lib/commonjs/components/executiontasks/doodle/DoodleUtils.js.map +1 -1
- package/lib/commonjs/components/executiontasks/doodle/SignatureET.js +61 -28
- 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 +62 -18
- package/lib/commonjs/components/executiontasks/dropCash/SLDropCash.js.map +1 -1
- package/lib/commonjs/components/executiontasks/forms/FormGenerator.js +112 -28
- 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 +1 -16
- 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 +4 -13
- package/lib/commonjs/components/executiontasks/httpRequest/HttpEtUtils.js.map +1 -1
- package/lib/commonjs/components/executiontasks/httpRequest/HttpRequestET.js +0 -12
- 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 +7 -35
- package/lib/commonjs/components/executiontasks/imageCapture/CaptureUtils.js.map +1 -1
- package/lib/commonjs/components/executiontasks/imageCapture/ImageCapture.js +74 -49
- 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 +64 -17
- 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 +60 -19
- package/lib/commonjs/components/executiontasks/pickup/SLPickupET.js.map +1 -1
- package/lib/commonjs/components/executiontasks/scan/ScanET.js +843 -0
- package/lib/commonjs/components/executiontasks/scan/ScanET.js.map +1 -0
- package/lib/commonjs/components/executiontasks/scan/ScanSchema.js +6 -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 +29 -0
- package/lib/commonjs/components/executiontasks/scan/interfaces.js.map +1 -0
- package/lib/commonjs/components/executiontasks/scan/sub_components/CScanner.js +103 -0
- package/lib/commonjs/components/executiontasks/scan/sub_components/CScanner.js.map +1 -0
- package/lib/commonjs/components/executiontasks/scan/sub_components/DropDownUtils.js +74 -0
- package/lib/commonjs/components/executiontasks/scan/sub_components/DropDownUtils.js.map +1 -0
- package/lib/commonjs/components/executiontasks/scan/sub_components/ERDropDown.js +115 -0
- package/lib/commonjs/components/executiontasks/scan/sub_components/ERDropDown.js.map +1 -0
- package/lib/commonjs/components/executiontasks/scan/sub_components/ScanList.js +134 -0
- package/lib/commonjs/components/executiontasks/scan/sub_components/ScanList.js.map +1 -0
- package/lib/commonjs/components/executiontasks/scan/utils.js +373 -0
- package/lib/commonjs/components/executiontasks/scan/utils.js.map +1 -0
- package/lib/commonjs/components/executiontasks/scanner/CScanner.js +3 -21
- package/lib/commonjs/components/executiontasks/scanner/CScanner.js.map +1 -1
- package/lib/commonjs/components/executiontasks/scanner/ScannerSchema.js +4 -9
- package/lib/commonjs/components/executiontasks/scanner/ScannerSchema.js.map +1 -1
- package/lib/commonjs/components/executiontasks/scanner/ScannerUtils.js +7 -36
- package/lib/commonjs/components/executiontasks/scanner/ScannerUtils.js.map +1 -1
- package/lib/commonjs/components/executiontasks/scanner/returns/DropDownSelector.js +0 -5
- package/lib/commonjs/components/executiontasks/scanner/returns/DropDownSelector.js.map +1 -1
- package/lib/commonjs/components/executiontasks/scanner/returns/DropDownUtils.js +0 -9
- package/lib/commonjs/components/executiontasks/scanner/returns/DropDownUtils.js.map +1 -1
- package/lib/commonjs/components/executiontasks/scanner/returns/RTReasonSelection.js +0 -14
- package/lib/commonjs/components/executiontasks/scanner/returns/RTReasonSelection.js.map +1 -1
- package/lib/commonjs/components/executiontasks/scanner/returns/RTScan.js +1 -40
- package/lib/commonjs/components/executiontasks/scanner/returns/RTScan.js.map +1 -1
- package/lib/commonjs/components/executiontasks/scanner/returns/ReasonDropDown.js +0 -17
- package/lib/commonjs/components/executiontasks/scanner/returns/ReasonDropDown.js.map +1 -1
- package/lib/commonjs/components/executiontasks/scanner/returns/ScanList.js +0 -28
- package/lib/commonjs/components/executiontasks/scanner/returns/ScanList.js.map +1 -1
- package/lib/commonjs/components/executiontasks/validateOTP/ValidateOTPET.js +334 -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 +59 -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/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/IconButton.js +34 -0
- package/lib/commonjs/components/widgets/IconButton.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/SnackBarCustom.js +38 -38
- 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/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 +15 -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 +27 -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 +13 -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 +9 -23
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/manager/dispatch/DispatchStateContainer.js +527 -177
- 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 +27 -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 +8 -36
- 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/syncmanager/AppSyncManager.js +12 -46
- package/lib/commonjs/manager/syncmanager/AppSyncManager.js.map +1 -1
- package/lib/commonjs/manager/syncmanager/DBConfig.js +13 -7
- 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/database.js +28 -12
- package/lib/commonjs/manager/syncmanager/database.js.map +1 -1
- package/lib/commonjs/manager/syncmanager/document/DocumentHttpClient.js +0 -19
- package/lib/commonjs/manager/syncmanager/document/DocumentHttpClient.js.map +1 -1
- package/lib/commonjs/manager/syncmanager/document/DocumentManager.js +3 -20
- package/lib/commonjs/manager/syncmanager/document/DocumentManager.js.map +1 -1
- package/lib/commonjs/manager/syncmanager/document/DocumentSyncManager.js +3 -52
- package/lib/commonjs/manager/syncmanager/document/DocumentSyncManager.js.map +1 -1
- package/lib/commonjs/manager/syncmanager/events/ETEventsManager.js +59 -25
- package/lib/commonjs/manager/syncmanager/events/ETEventsManager.js.map +1 -1
- package/lib/commonjs/manager/syncmanager/events/EventsSyncManager.js +77 -90
- package/lib/commonjs/manager/syncmanager/events/EventsSyncManager.js.map +1 -1
- package/lib/commonjs/manager/syncmanager/events/SyncHttpClient.js +27 -19
- 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.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 +7 -7
- package/lib/commonjs/styles/SdkColors.js.map +1 -1
- package/lib/commonjs/styles/executionTasks/CommonStyles.js +42 -18
- package/lib/commonjs/styles/executionTasks/CommonStyles.js.map +1 -1
- package/lib/commonjs/ui/screens/CancellationScreen.js +36 -27
- package/lib/commonjs/ui/screens/CancellationScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/CaptureInputScreen.js +6 -15
- package/lib/commonjs/ui/screens/CaptureInputScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/CompleteObjectiveScreen.js +0 -19
- package/lib/commonjs/ui/screens/CompleteObjectiveScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/DeliverScreen.js +6 -15
- package/lib/commonjs/ui/screens/DeliverScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/DisplayScreen.js +7 -12
- package/lib/commonjs/ui/screens/DisplayScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/DoodleScreen.js +6 -16
- package/lib/commonjs/ui/screens/DoodleScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/DropCashScreen.js +6 -18
- package/lib/commonjs/ui/screens/DropCashScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/ETScreensIndex.js +14 -16
- package/lib/commonjs/ui/screens/ETScreensIndex.js.map +1 -1
- package/lib/commonjs/ui/screens/FormsScreen.js +36 -15
- package/lib/commonjs/ui/screens/FormsScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/GeofenceScreen.js +7 -13
- package/lib/commonjs/ui/screens/GeofenceScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/HttpRequestScreen.js +5 -10
- package/lib/commonjs/ui/screens/HttpRequestScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/ImageCaptureScreen.js +27 -14
- package/lib/commonjs/ui/screens/ImageCaptureScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/PaymentScreen.js +11 -23
- package/lib/commonjs/ui/screens/PaymentScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/PickupScreen.js +9 -13
- package/lib/commonjs/ui/screens/PickupScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/RTScanScreen.js +8 -27
- package/lib/commonjs/ui/screens/RTScanScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/ScanScreen.js +268 -0
- package/lib/commonjs/ui/screens/ScanScreen.js.map +1 -0
- package/lib/commonjs/ui/screens/StartWorkFlowScreen.js +21 -30
- package/lib/commonjs/ui/screens/StartWorkFlowScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/ValidateOTPScreen.js +49 -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 +9 -1
- package/lib/commonjs/ui/uiConfig/RouteParams.js.map +1 -1
- package/lib/commonjs/utils/ApiUtils.js +115 -0
- package/lib/commonjs/utils/ApiUtils.js.map +1 -0
- package/lib/commonjs/utils/ExecTaskUtils.js +93 -31
- 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 +25 -40
- package/lib/commonjs/utils/SyncManagerUtils.js.map +1 -1
- package/lib/commonjs/utils/fcm/FCM.js +35 -16
- package/lib/commonjs/utils/fcm/FCM.js.map +1 -1
- package/lib/commonjs/utils/fcm/FcmUtils.js +50 -25
- 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/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 +53 -32
- 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/components/dispatch/DispatchExecNavigator.js +46 -28
- package/lib/module/components/dispatch/DispatchExecNavigator.js.map +1 -1
- package/lib/module/components/executiontasks/ExecutionTasksIndex.js +3 -1
- 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 +66 -9
- package/lib/module/components/executiontasks/captureInput/CaptureText.js.map +1 -1
- 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/SLDeliverET.js +69 -16
- package/lib/module/components/executiontasks/deliver/SLDeliverET.js.map +1 -1
- package/lib/module/components/executiontasks/display/DisplayModalET.js +4 -3
- package/lib/module/components/executiontasks/display/DisplayModalET.js.map +1 -1
- package/lib/module/components/executiontasks/doodle/DoodleUtils.js.map +1 -1
- package/lib/module/components/executiontasks/doodle/SignatureET.js +64 -14
- 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 +62 -8
- package/lib/module/components/executiontasks/dropCash/SLDropCash.js.map +1 -1
- package/lib/module/components/executiontasks/forms/FormGenerator.js +114 -14
- 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 +1 -5
- 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 +4 -2
- package/lib/module/components/executiontasks/httpRequest/HttpEtUtils.js.map +1 -1
- package/lib/module/components/executiontasks/httpRequest/HttpRequestET.js +0 -3
- 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 +7 -10
- 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 +64 -6
- package/lib/module/components/executiontasks/payments/completePayment/CompletePaymentET.js.map +1 -1
- package/lib/module/components/executiontasks/payments/init/InitPaymentET.js +63 -11
- package/lib/module/components/executiontasks/payments/init/InitPaymentET.js.map +1 -1
- package/lib/module/components/executiontasks/payments/processPayment/ProcessPaymentET.js +71 -10
- 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 +61 -10
- package/lib/module/components/executiontasks/pickup/SLPickupET.js.map +1 -1
- package/lib/module/components/executiontasks/scan/ScanET.js +833 -0
- package/lib/module/components/executiontasks/scan/ScanET.js.map +1 -0
- package/lib/module/components/executiontasks/scan/ScanSchema.js +2 -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 +21 -0
- package/lib/module/components/executiontasks/scan/interfaces.js.map +1 -0
- package/lib/module/components/executiontasks/scan/sub_components/CScanner.js +94 -0
- package/lib/module/components/executiontasks/scan/sub_components/CScanner.js.map +1 -0
- package/lib/module/components/executiontasks/scan/sub_components/DropDownUtils.js +66 -0
- package/lib/module/components/executiontasks/scan/sub_components/DropDownUtils.js.map +1 -0
- package/lib/module/components/executiontasks/scan/sub_components/ERDropDown.js +105 -0
- package/lib/module/components/executiontasks/scan/sub_components/ERDropDown.js.map +1 -0
- package/lib/module/components/executiontasks/scan/sub_components/ScanList.js +124 -0
- package/lib/module/components/executiontasks/scan/sub_components/ScanList.js.map +1 -0
- package/lib/module/components/executiontasks/scan/utils.js +358 -0
- package/lib/module/components/executiontasks/scan/utils.js.map +1 -0
- package/lib/module/components/executiontasks/scanner/CScanner.js +3 -8
- package/lib/module/components/executiontasks/scanner/CScanner.js.map +1 -1
- package/lib/module/components/executiontasks/scanner/ScannerSchema.js +3 -3
- package/lib/module/components/executiontasks/scanner/ScannerSchema.js.map +1 -1
- package/lib/module/components/executiontasks/scanner/ScannerUtils.js +6 -18
- package/lib/module/components/executiontasks/scanner/ScannerUtils.js.map +1 -1
- package/lib/module/components/executiontasks/scanner/returns/DropDownSelector.js +0 -2
- package/lib/module/components/executiontasks/scanner/returns/DropDownSelector.js.map +1 -1
- package/lib/module/components/executiontasks/scanner/returns/DropDownUtils.js +0 -5
- package/lib/module/components/executiontasks/scanner/returns/DropDownUtils.js.map +1 -1
- package/lib/module/components/executiontasks/scanner/returns/RTReasonSelection.js +0 -3
- package/lib/module/components/executiontasks/scanner/returns/RTReasonSelection.js.map +1 -1
- package/lib/module/components/executiontasks/scanner/returns/RTScan.js +1 -19
- package/lib/module/components/executiontasks/scanner/returns/RTScan.js.map +1 -1
- package/lib/module/components/executiontasks/scanner/returns/ReasonDropDown.js +0 -7
- package/lib/module/components/executiontasks/scanner/returns/ReasonDropDown.js.map +1 -1
- package/lib/module/components/executiontasks/scanner/returns/ScanList.js +0 -15
- package/lib/module/components/executiontasks/scanner/returns/ScanList.js.map +1 -1
- package/lib/module/components/executiontasks/validateOTP/ValidateOTPET.js +325 -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 +49 -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 +4 -8
- package/lib/module/components/executiontasks/verifyOtp/VerifyOtpET.js.map +1 -1
- 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/IconButton.js +26 -0
- package/lib/module/components/widgets/IconButton.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/SnackBarCustom.js +36 -18
- 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/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 +7 -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 +19 -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 +6 -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 +4 -3
- package/lib/module/index.js.map +1 -1
- package/lib/module/manager/dispatch/DispatchStateContainer.js +529 -151
- 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 +20 -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 +8 -14
- 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/syncmanager/AppSyncManager.js +12 -26
- package/lib/module/manager/syncmanager/AppSyncManager.js.map +1 -1
- package/lib/module/manager/syncmanager/DBConfig.js +9 -5
- 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/database.js +27 -3
- package/lib/module/manager/syncmanager/database.js.map +1 -1
- package/lib/module/manager/syncmanager/document/DocumentHttpClient.js +0 -7
- package/lib/module/manager/syncmanager/document/DocumentHttpClient.js.map +1 -1
- package/lib/module/manager/syncmanager/document/DocumentManager.js +3 -14
- package/lib/module/manager/syncmanager/document/DocumentManager.js.map +1 -1
- package/lib/module/manager/syncmanager/document/DocumentSyncManager.js +3 -35
- package/lib/module/manager/syncmanager/document/DocumentSyncManager.js.map +1 -1
- package/lib/module/manager/syncmanager/events/ETEventsManager.js +59 -18
- package/lib/module/manager/syncmanager/events/ETEventsManager.js.map +1 -1
- package/lib/module/manager/syncmanager/events/EventsSyncManager.js +77 -68
- package/lib/module/manager/syncmanager/events/EventsSyncManager.js.map +1 -1
- package/lib/module/manager/syncmanager/events/SyncHttpClient.js +26 -11
- 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.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 +6 -6
- package/lib/module/styles/SdkColors.js.map +1 -1
- package/lib/module/styles/executionTasks/CommonStyles.js +41 -7
- package/lib/module/styles/executionTasks/CommonStyles.js.map +1 -1
- package/lib/module/ui/screens/CancellationScreen.js +36 -14
- package/lib/module/ui/screens/CancellationScreen.js.map +1 -1
- package/lib/module/ui/screens/CaptureInputScreen.js +7 -4
- package/lib/module/ui/screens/CaptureInputScreen.js.map +1 -1
- package/lib/module/ui/screens/CompleteObjectiveScreen.js +0 -3
- package/lib/module/ui/screens/CompleteObjectiveScreen.js.map +1 -1
- package/lib/module/ui/screens/DeliverScreen.js +7 -4
- package/lib/module/ui/screens/DeliverScreen.js.map +1 -1
- package/lib/module/ui/screens/DisplayScreen.js +5 -4
- package/lib/module/ui/screens/DisplayScreen.js.map +1 -1
- package/lib/module/ui/screens/DoodleScreen.js +7 -4
- package/lib/module/ui/screens/DoodleScreen.js.map +1 -1
- package/lib/module/ui/screens/DropCashScreen.js +7 -7
- package/lib/module/ui/screens/DropCashScreen.js.map +1 -1
- package/lib/module/ui/screens/ETScreensIndex.js +3 -1
- package/lib/module/ui/screens/ETScreensIndex.js.map +1 -1
- package/lib/module/ui/screens/FormsScreen.js +34 -6
- package/lib/module/ui/screens/FormsScreen.js.map +1 -1
- package/lib/module/ui/screens/GeofenceScreen.js +5 -4
- package/lib/module/ui/screens/GeofenceScreen.js.map +1 -1
- package/lib/module/ui/screens/HttpRequestScreen.js +5 -3
- package/lib/module/ui/screens/HttpRequestScreen.js.map +1 -1
- package/lib/module/ui/screens/ImageCaptureScreen.js +25 -5
- package/lib/module/ui/screens/ImageCaptureScreen.js.map +1 -1
- package/lib/module/ui/screens/PaymentScreen.js +12 -10
- package/lib/module/ui/screens/PaymentScreen.js.map +1 -1
- package/lib/module/ui/screens/PickupScreen.js +7 -5
- package/lib/module/ui/screens/PickupScreen.js.map +1 -1
- package/lib/module/ui/screens/RTScanScreen.js +9 -13
- package/lib/module/ui/screens/RTScanScreen.js.map +1 -1
- package/lib/module/ui/screens/ScanScreen.js +259 -0
- package/lib/module/ui/screens/ScanScreen.js.map +1 -0
- package/lib/module/ui/screens/StartWorkFlowScreen.js +22 -9
- package/lib/module/ui/screens/StartWorkFlowScreen.js.map +1 -1
- package/lib/module/ui/screens/ValidateOTPScreen.js +39 -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 +9 -1
- package/lib/module/ui/uiConfig/RouteParams.js.map +1 -1
- package/lib/module/utils/ApiUtils.js +101 -0
- package/lib/module/utils/ApiUtils.js.map +1 -0
- package/lib/module/utils/ExecTaskUtils.js +92 -21
- 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 +25 -10
- package/lib/module/utils/SyncManagerUtils.js.map +1 -1
- package/lib/module/utils/fcm/FCM.js +35 -4
- package/lib/module/utils/fcm/FCM.js.map +1 -1
- package/lib/module/utils/fcm/FcmUtils.js +50 -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/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 +51 -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/executiontasks/CompletedWFSchema.d.ts +2 -2
- package/lib/typescript/components/executiontasks/ExecutionTasksIndex.d.ts +6 -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/deliver/DeliverETInput.d.ts +7 -7
- package/lib/typescript/components/executiontasks/display/DisplaySchema.d.ts +5 -5
- package/lib/typescript/components/executiontasks/doodle/SignatureSchema.d.ts +7 -7
- package/lib/typescript/components/executiontasks/dropCash/DropCashSchema.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 +1 -1
- package/lib/typescript/components/executiontasks/forms/widgets/DropdownWidget.d.ts +9 -0
- package/lib/typescript/components/executiontasks/httpRequest/HttpRequestETSchema.d.ts +6 -6
- package/lib/typescript/components/executiontasks/imageCapture/CaptureSchema.d.ts +16 -11
- package/lib/typescript/components/executiontasks/payments/completePayment/CompletePaymentSchema.d.ts +2 -2
- package/lib/typescript/components/executiontasks/payments/init/InitPaymentSchema.d.ts +3 -3
- 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/scan/ScanET.d.ts +16 -0
- package/lib/typescript/components/executiontasks/scan/ScanSchema.d.ts +70 -0
- package/lib/typescript/components/executiontasks/scan/constants.d.ts +6 -0
- package/lib/typescript/components/executiontasks/scan/interfaces.d.ts +41 -0
- package/lib/typescript/components/executiontasks/scan/sub_components/CScanner.d.ts +7 -0
- 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/ScanList.d.ts +8 -0
- package/lib/typescript/components/executiontasks/scan/utils.d.ts +21 -0
- package/lib/typescript/components/executiontasks/scanner/ScannerSchema.d.ts +6 -6
- package/lib/typescript/components/executiontasks/scanner/returns/DropDownUtils.d.ts +1 -2
- package/lib/typescript/components/executiontasks/scanner/returns/RTReasonSelection.d.ts +1 -1
- package/lib/typescript/components/executiontasks/scanner/returns/ScanList.d.ts +1 -1
- 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/verifyOtp/VerifyOtpSchema.d.ts +3 -3
- package/lib/typescript/components/widgets/IconButton.d.ts +9 -0
- package/lib/typescript/components/widgets/SnackBarCustom.d.ts +9 -5
- package/lib/typescript/components/widgets/SplitTextInput.d.ts +12 -0
- package/lib/typescript/constants/apiConstants.d.ts +6 -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 +5 -0
- package/lib/typescript/events/EventListener.d.ts +5 -0
- package/lib/typescript/events/constants.d.ts +5 -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 +5 -4
- package/lib/typescript/manager/dispatch/DispatchStateContainer.d.ts +21 -8
- 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 +6 -0
- package/lib/typescript/manager/sdk/DispatchSdkCache.d.ts +2 -0
- package/lib/typescript/manager/syncmanager/AppSyncManager.d.ts +1 -0
- package/lib/typescript/manager/syncmanager/DBConfig.d.ts +22 -2
- package/lib/typescript/manager/syncmanager/database.d.ts +5 -0
- package/lib/typescript/manager/syncmanager/document/models.d.ts +1 -1
- package/lib/typescript/manager/syncmanager/events/ETEventsManager.d.ts +5 -1
- package/lib/typescript/manager/syncmanager/events/EventsSyncManager.d.ts +5 -1
- package/lib/typescript/manager/syncmanager/events/SyncHttpClient.d.ts +3 -1
- package/lib/typescript/models/DispatchModels.d.ts +56 -1
- 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 +27 -8
- package/lib/typescript/models/execTasks/ETConfig.d.ts +8 -4
- package/lib/typescript/models/sdk.d.ts +5 -0
- package/lib/typescript/native/signature/SignatureCapture.d.ts +1 -1
- package/lib/typescript/network/NetworkUtils.d.ts +1 -5
- package/lib/typescript/styles/SdkColors.d.ts +1 -0
- package/lib/typescript/styles/executionTasks/CommonStyles.d.ts +36 -0
- package/lib/typescript/ui/screens/ETScreensIndex.d.ts +3 -1
- package/lib/typescript/ui/screens/ScanScreen.d.ts +3 -0
- package/lib/typescript/ui/screens/ValidateOTPScreen.d.ts +3 -0
- package/lib/typescript/ui/uiConfig/RouteParams.d.ts +8 -0
- package/lib/typescript/utils/ApiUtils.d.ts +61 -0
- package/lib/typescript/utils/ExecTaskUtils.d.ts +7 -2
- package/lib/typescript/utils/NetworkUtil.d.ts +1 -1
- package/lib/typescript/utils/SyncManagerUtils.d.ts +3 -1
- package/lib/typescript/utils/hooks/useTimer.d.ts +5 -0
- package/lib/typescript/utils/storage.d.ts +17 -0
- package/package.json +23 -24
- package/tsconfig.json +9 -8
- package/file_unzip.js +0 -5
- package/mobile-execution-lib-0.6.4.tgz +0 -0
|
@@ -4,21 +4,13 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
-
|
|
8
7
|
var _react = _interopRequireWildcard(require("react"));
|
|
9
|
-
|
|
10
8
|
var _reactNative = require("react-native");
|
|
11
|
-
|
|
12
9
|
var _DateTimeWidget = _interopRequireDefault(require("./DateTimeWidget"));
|
|
13
|
-
|
|
14
10
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
15
|
-
|
|
16
11
|
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); }
|
|
17
|
-
|
|
18
12
|
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; }
|
|
19
|
-
|
|
20
13
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
21
|
-
|
|
22
14
|
const TimeRangeSelector = props => {
|
|
23
15
|
const [start, setStart] = (0, _react.useState)(new Date());
|
|
24
16
|
const [end, setEnd] = (0, _react.useState)(new Date());
|
|
@@ -40,7 +32,6 @@ const TimeRangeSelector = props => {
|
|
|
40
32
|
}
|
|
41
33
|
})));
|
|
42
34
|
};
|
|
43
|
-
|
|
44
35
|
const styles = _reactNative.StyleSheet.create({
|
|
45
36
|
container: {
|
|
46
37
|
flex: 1,
|
|
@@ -48,7 +39,6 @@ const styles = _reactNative.StyleSheet.create({
|
|
|
48
39
|
justifyContent: 'space-between'
|
|
49
40
|
}
|
|
50
41
|
});
|
|
51
|
-
|
|
52
42
|
var _default = TimeRangeSelector;
|
|
53
43
|
exports.default = _default;
|
|
54
44
|
//# sourceMappingURL=TimeRangeSelector.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["TimeRangeSelector","props","start","setStart","useState","Date","end","setEnd","useEffect","onChange","JSON","stringify","styles","container","date","StyleSheet","create","flex","flexDirection","justifyContent"],"sources":["TimeRangeSelector.tsx"],"sourcesContent":["import React, { useEffect, useState } from 'react';\nimport { StyleSheet, View } from 'react-native';\nimport type { WidgetProps } from '@rjsf/core';\nimport DateTimeWidget from './DateTimeWidget';\n\nconst TimeRangeSelector = (props: WidgetProps) => {\n const [start, setStart] = useState(new Date());\n const [end, setEnd] = useState(new Date());\n useEffect(() => {\n props.onChange(JSON.stringify({ start: start, end: end }));\n });\n return (\n <View style={styles.container}>\n <DateTimeWidget\n {...props}\n onChange={(date) => {\n setStart(date);\n }}\n />\n <DateTimeWidget\n {...props}\n onChange={(date) => {\n setEnd(date);\n }}\n />\n </View>\n );\n};\n\nconst styles = StyleSheet.create({\n container: {\n flex: 1,\n flexDirection: 'row',\n justifyContent: 'space-between',\n },\n});\n\nexport default TimeRangeSelector;\n"],"mappings":"
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireWildcard","require","_reactNative","_DateTimeWidget","_interopRequireDefault","obj","__esModule","default","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","_extends","assign","bind","target","i","arguments","length","source","apply","TimeRangeSelector","props","start","setStart","useState","Date","end","setEnd","useEffect","onChange","JSON","stringify","createElement","View","style","styles","container","date","StyleSheet","create","flex","flexDirection","justifyContent","_default","exports"],"sources":["TimeRangeSelector.tsx"],"sourcesContent":["import React, { useEffect, useState } from 'react';\nimport { StyleSheet, View } from 'react-native';\nimport type { WidgetProps } from '@rjsf/core';\nimport DateTimeWidget from './DateTimeWidget';\n\nconst TimeRangeSelector = (props: WidgetProps) => {\n const [start, setStart] = useState(new Date());\n const [end, setEnd] = useState(new Date());\n useEffect(() => {\n props.onChange(JSON.stringify({ start: start, end: end }));\n });\n return (\n <View style={styles.container}>\n <DateTimeWidget\n {...props}\n onChange={(date) => {\n setStart(date);\n }}\n />\n <DateTimeWidget\n {...props}\n onChange={(date) => {\n setEnd(date);\n }}\n />\n </View>\n );\n};\n\nconst styles = StyleSheet.create({\n container: {\n flex: 1,\n flexDirection: 'row',\n justifyContent: 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AGQ,IAAI,IAAK;MAClBd,QAAQ,CAACc,IAAI,CAAC;IAChB;EAAE,GACF,eACFtD,MAAA,CAAAQ,OAAA,CAAAyC,aAAA,CAAC7C,eAAA,CAAAI,OAAc,EAAAoB,QAAA,KACTU,KAAK;IACTQ,QAAQ,EAAGQ,IAAI,IAAK;MAClBV,MAAM,CAACU,IAAI,CAAC;IACd;EAAE,GACF,CACG;AAEX,CAAC;AAED,MAAMF,MAAM,GAAGG,uBAAU,CAACC,MAAM,CAAC;EAC/BH,SAAS,EAAE;IACTI,IAAI,EAAE,CAAC;IACPC,aAAa,EAAE,KAAK;IACpBC,cAAc,EAAE;EAClB;AACF,CAAC,CAAC;AAAC,IAAAC,QAAA,GAEYvB,iBAAiB;AAAAwB,OAAA,CAAArD,OAAA,GAAAoD,QAAA"}
|
|
@@ -6,23 +6,14 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.getApiResponse = getApiResponse;
|
|
7
7
|
exports.getHttpETOutput = getHttpETOutput;
|
|
8
8
|
exports.getOutputUsingJsonpath = getOutputUsingJsonpath;
|
|
9
|
-
|
|
10
9
|
var _axios = _interopRequireDefault(require("axios"));
|
|
11
|
-
|
|
12
10
|
var _NetworkUtils = require("../../../network/NetworkUtils");
|
|
13
|
-
|
|
14
11
|
var _GraphQLClient = require("../../../network/GraphQLClient");
|
|
15
|
-
|
|
16
12
|
var _jsonpathPlus = require("jsonpath-plus");
|
|
17
|
-
|
|
18
13
|
var _utils = require("../../../utils/utils");
|
|
19
|
-
|
|
20
14
|
var _ExecTaskUtils = require("../../../utils/ExecTaskUtils");
|
|
21
|
-
|
|
22
15
|
var _ETConfig = require("../../../models/execTasks/ETConfig");
|
|
23
|
-
|
|
24
16
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
25
|
-
|
|
26
17
|
async function getApiResponse(apiData) {
|
|
27
18
|
const axiosConfig = {
|
|
28
19
|
data: apiData.requestBody,
|
|
@@ -30,13 +21,13 @@ async function getApiResponse(apiData) {
|
|
|
30
21
|
timeout: apiData.timeout ?? 15000,
|
|
31
22
|
// timeout in millis i.e 15s
|
|
32
23
|
url: apiData.uri,
|
|
33
|
-
headers: {
|
|
24
|
+
headers: {
|
|
25
|
+
...(0, _NetworkUtils.getAddHeaders)(apiData.headers),
|
|
34
26
|
...(await (0, _NetworkUtils.getHeaders)(_GraphQLClient.API_CONTENT_TYPES.APPLICATION_JSON))
|
|
35
27
|
}
|
|
36
28
|
};
|
|
37
29
|
return (0, _axios.default)(axiosConfig);
|
|
38
30
|
}
|
|
39
|
-
|
|
40
31
|
function getOutputUsingJsonpath(json, jsonPath) {
|
|
41
32
|
if ((0, _utils.isEmptyOrBlank)(jsonPath)) return json;
|
|
42
33
|
return (0, _jsonpathPlus.JSONPath)({
|
|
@@ -44,9 +35,9 @@ function getOutputUsingJsonpath(json, jsonPath) {
|
|
|
44
35
|
json
|
|
45
36
|
});
|
|
46
37
|
}
|
|
47
|
-
|
|
48
38
|
async function getHttpETOutput(apiResponse, jsonPath, success) {
|
|
49
|
-
return {
|
|
39
|
+
return {
|
|
40
|
+
...(await (0, _ExecTaskUtils.getBaseETResponse)(_ETConfig.EntityCode.HTTP_REQUEST_ET, success, success ? _ETConfig.BaseEventCodes.ENTITY_SUCCESS : _ETConfig.BaseEventCodes.ENTITY_FAILURE, '')),
|
|
50
41
|
apiResponse: getOutputUsingJsonpath(apiResponse, jsonPath)
|
|
51
42
|
};
|
|
52
43
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["getApiResponse","apiData","axiosConfig","data","requestBody","method","httpMethod","timeout","url","uri","headers","getAddHeaders","getHeaders","API_CONTENT_TYPES","APPLICATION_JSON","axios","getOutputUsingJsonpath","json","jsonPath","isEmptyOrBlank","JSONPath","path","getHttpETOutput","apiResponse","success","getBaseETResponse","EntityCode","HTTP_REQUEST_ET","BaseEventCodes","ENTITY_SUCCESS","ENTITY_FAILURE"],"sources":["HttpEtUtils.ts"],"sourcesContent":["import type { APIData, HttpRequestETOutput } from './HttpRequestETSchema';\nimport axios, { AxiosRequestConfig } from 'axios';\nimport { getAddHeaders, getHeaders } from '../../../network/NetworkUtils';\nimport { API_CONTENT_TYPES } from '../../../network/GraphQLClient';\nimport { JSONPath } from 'jsonpath-plus';\nimport { isEmptyOrBlank } from '../../../utils/utils';\nimport { getBaseETResponse } from '../../../utils/ExecTaskUtils';\nimport { BaseEventCodes, EntityCode } from '../../../models/execTasks/ETConfig';\n\nexport async function getApiResponse(apiData: APIData) {\n const axiosConfig: AxiosRequestConfig = {\n data: apiData.requestBody,\n method: apiData.httpMethod,\n timeout: apiData.timeout ?? 15000, // timeout in millis i.e 15s\n url: apiData.uri,\n headers: {\n ...getAddHeaders(apiData.headers),\n ...(await getHeaders(API_CONTENT_TYPES.APPLICATION_JSON)),\n },\n };\n return axios(axiosConfig);\n}\nexport function getOutputUsingJsonpath(json: object, jsonPath: string) {\n if (isEmptyOrBlank(jsonPath)) return json;\n return JSONPath({ path: jsonPath, json });\n}\n\nexport async function getHttpETOutput(\n apiResponse: object,\n jsonPath: string,\n success: boolean\n): Promise<HttpRequestETOutput> {\n return {\n ...(await getBaseETResponse(\n EntityCode.HTTP_REQUEST_ET,\n success,\n success ? BaseEventCodes.ENTITY_SUCCESS : BaseEventCodes.ENTITY_FAILURE,\n ''\n )),\n apiResponse: getOutputUsingJsonpath(apiResponse, jsonPath),\n };\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"names":["_axios","_interopRequireDefault","require","_NetworkUtils","_GraphQLClient","_jsonpathPlus","_utils","_ExecTaskUtils","_ETConfig","obj","__esModule","default","getApiResponse","apiData","axiosConfig","data","requestBody","method","httpMethod","timeout","url","uri","headers","getAddHeaders","getHeaders","API_CONTENT_TYPES","APPLICATION_JSON","axios","getOutputUsingJsonpath","json","jsonPath","isEmptyOrBlank","JSONPath","path","getHttpETOutput","apiResponse","success","getBaseETResponse","EntityCode","HTTP_REQUEST_ET","BaseEventCodes","ENTITY_SUCCESS","ENTITY_FAILURE"],"sources":["HttpEtUtils.ts"],"sourcesContent":["import type { APIData, HttpRequestETOutput } from './HttpRequestETSchema';\nimport axios, { AxiosRequestConfig } from 'axios';\nimport { getAddHeaders, getHeaders } from '../../../network/NetworkUtils';\nimport { API_CONTENT_TYPES } from '../../../network/GraphQLClient';\nimport { JSONPath } from 'jsonpath-plus';\nimport { isEmptyOrBlank } from '../../../utils/utils';\nimport { getBaseETResponse } from '../../../utils/ExecTaskUtils';\nimport { BaseEventCodes, EntityCode } from '../../../models/execTasks/ETConfig';\n\nexport async function getApiResponse(apiData: APIData) {\n const axiosConfig: AxiosRequestConfig = {\n data: apiData.requestBody,\n method: apiData.httpMethod,\n timeout: apiData.timeout ?? 15000, // timeout in millis i.e 15s\n url: apiData.uri,\n headers: {\n ...getAddHeaders(apiData.headers),\n ...(await getHeaders(API_CONTENT_TYPES.APPLICATION_JSON)),\n },\n };\n return axios(axiosConfig);\n}\nexport function getOutputUsingJsonpath(json: object, jsonPath: string) {\n if (isEmptyOrBlank(jsonPath)) return json;\n return JSONPath({ path: jsonPath, json });\n}\n\nexport async function getHttpETOutput(\n apiResponse: object,\n jsonPath: string,\n success: boolean\n): Promise<HttpRequestETOutput> {\n return {\n ...(await getBaseETResponse(\n EntityCode.HTTP_REQUEST_ET,\n success,\n success ? BaseEventCodes.ENTITY_SUCCESS : BaseEventCodes.ENTITY_FAILURE,\n ''\n )),\n apiResponse: getOutputUsingJsonpath(apiResponse, jsonPath),\n };\n}\n"],"mappings":";;;;;;;;AACA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,aAAA,GAAAD,OAAA;AACA,IAAAE,cAAA,GAAAF,OAAA;AACA,IAAAG,aAAA,GAAAH,OAAA;AACA,IAAAI,MAAA,GAAAJ,OAAA;AACA,IAAAK,cAAA,GAAAL,OAAA;AACA,IAAAM,SAAA,GAAAN,OAAA;AAAgF,SAAAD,uBAAAQ,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAEzE,eAAeG,cAAcA,CAACC,OAAgB,EAAE;EACrD,MAAMC,WAA+B,GAAG;IACtCC,IAAI,EAAEF,OAAO,CAACG,WAAW;IACzBC,MAAM,EAAEJ,OAAO,CAACK,UAAU;IAC1BC,OAAO,EAAEN,OAAO,CAACM,OAAO,IAAI,KAAK;IAAE;IACnCC,GAAG,EAAEP,OAAO,CAACQ,GAAG;IAChBC,OAAO,EAAE;MACP,GAAG,IAAAC,2BAAa,EAACV,OAAO,CAACS,OAAO,CAAC;MACjC,IAAI,MAAM,IAAAE,wBAAU,EAACC,gCAAiB,CAACC,gBAAgB,CAAC;IAC1D;EACF,CAAC;EACD,OAAO,IAAAC,cAAK,EAACb,WAAW,CAAC;AAC3B;AACO,SAASc,sBAAsBA,CAACC,IAAY,EAAEC,QAAgB,EAAE;EACrE,IAAI,IAAAC,qBAAc,EAACD,QAAQ,CAAC,EAAE,OAAOD,IAAI;EACzC,OAAO,IAAAG,sBAAQ,EAAC;IAAEC,IAAI,EAAEH,QAAQ;IAAED;EAAK,CAAC,CAAC;AAC3C;AAEO,eAAeK,eAAeA,CACnCC,WAAmB,EACnBL,QAAgB,EAChBM,OAAgB,EACc;EAC9B,OAAO;IACL,IAAI,MAAM,IAAAC,gCAAiB,EACzBC,oBAAU,CAACC,eAAe,EAC1BH,OAAO,EACPA,OAAO,GAAGI,wBAAc,CAACC,cAAc,GAAGD,wBAAc,CAACE,cAAc,EACvE,EAAE,CACH,CAAC;IACFP,WAAW,EAAEP,sBAAsB,CAACO,WAAW,EAAEL,QAAQ;EAC3D,CAAC;AACH"}
|
|
@@ -4,25 +4,15 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
-
|
|
8
7
|
var _CommonStyles = require("../../../styles/executionTasks/CommonStyles");
|
|
9
|
-
|
|
10
8
|
var _ProgressDialog = _interopRequireDefault(require("../../widgets/ProgressDialog"));
|
|
11
|
-
|
|
12
9
|
var _reactNative = require("react-native");
|
|
13
|
-
|
|
14
10
|
var _react = _interopRequireWildcard(require("react"));
|
|
15
|
-
|
|
16
11
|
var _strings = require("../../../res/strings");
|
|
17
|
-
|
|
18
12
|
var _HttpEtUtils = require("./HttpEtUtils");
|
|
19
|
-
|
|
20
13
|
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); }
|
|
21
|
-
|
|
22
14
|
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; }
|
|
23
|
-
|
|
24
15
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
25
|
-
|
|
26
16
|
const HttpRequestET = props => {
|
|
27
17
|
const [inProgress, setInProgress] = (0, _react.useState)(true);
|
|
28
18
|
(0, _react.useEffect)(() => {
|
|
@@ -34,7 +24,6 @@ const HttpRequestET = props => {
|
|
|
34
24
|
props.onSubmitET(await (0, _HttpEtUtils.getHttpETOutput)(apiResponse.data, props.api.responseJsonPath, true));
|
|
35
25
|
} catch (error) {
|
|
36
26
|
setInProgress(false);
|
|
37
|
-
|
|
38
27
|
if (error.response) {
|
|
39
28
|
/**
|
|
40
29
|
* The request was made and the server responded
|
|
@@ -55,7 +44,6 @@ const HttpRequestET = props => {
|
|
|
55
44
|
label: props.message ?? _strings.PLEASE_WAIT
|
|
56
45
|
}));
|
|
57
46
|
};
|
|
58
|
-
|
|
59
47
|
var _default = HttpRequestET;
|
|
60
48
|
exports.default = _default;
|
|
61
49
|
//# sourceMappingURL=HttpRequestET.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["HttpRequestET","props","inProgress","setInProgress","useState","useEffect","apiResponse","getApiResponse","api","onSubmitET","getHttpETOutput","data","responseJsonPath","error","response","errorJsonPath","CommonStyles","mainContainer","message","PLEASE_WAIT"],"sources":["HttpRequestET.tsx"],"sourcesContent":["import type { HttpRequestETInput } from './HttpRequestETSchema';\nimport { CommonStyles } from '../../../styles/executionTasks/CommonStyles';\nimport ProgressDialog from '../../widgets/ProgressDialog';\nimport { View } from 'react-native';\nimport React, { useEffect, useState } from 'react';\nimport { PLEASE_WAIT } from '../../../res/strings';\nimport { getApiResponse, getHttpETOutput } from './HttpEtUtils';\n\nconst HttpRequestET = (props: HttpRequestETInput) => {\n const [inProgress, setInProgress] = useState(true);\n\n useEffect(() => {\n (async () => {\n if (inProgress) {\n try {\n const apiResponse = await getApiResponse(props.api);\n setInProgress(false);\n props.onSubmitET(\n await getHttpETOutput(\n apiResponse.data,\n props.api.responseJsonPath,\n true\n )\n );\n } catch (error: any) {\n setInProgress(false);\n if (error.response) {\n /**\n * The request was made and the server responded\n * with a status code that falls out of the range of 2xx\n */\n props.onSubmitET(\n await getHttpETOutput(\n error.response.data,\n props.api.errorJsonPath,\n false\n )\n );\n } else {\n props.onSubmitET(await getHttpETOutput(error, '', false));\n }\n }\n }\n })();\n }, [inProgress, props]);\n return (\n <View style={CommonStyles.mainContainer}>\n <ProgressDialog\n visible={inProgress}\n label={props.message ?? PLEASE_WAIT}\n />\n </View>\n );\n};\nexport default HttpRequestET;\n"],"mappings":"
|
|
1
|
+
{"version":3,"names":["_CommonStyles","require","_ProgressDialog","_interopRequireDefault","_reactNative","_react","_interopRequireWildcard","_strings","_HttpEtUtils","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","default","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","HttpRequestET","props","inProgress","setInProgress","useState","useEffect","apiResponse","getApiResponse","api","onSubmitET","getHttpETOutput","data","responseJsonPath","error","response","errorJsonPath","createElement","View","style","CommonStyles","mainContainer","visible","label","message","PLEASE_WAIT","_default","exports"],"sources":["HttpRequestET.tsx"],"sourcesContent":["import type { HttpRequestETInput } from './HttpRequestETSchema';\nimport { CommonStyles } from '../../../styles/executionTasks/CommonStyles';\nimport ProgressDialog from '../../widgets/ProgressDialog';\nimport { View } from 'react-native';\nimport React, { useEffect, useState } from 'react';\nimport { PLEASE_WAIT } from '../../../res/strings';\nimport { getApiResponse, getHttpETOutput } from './HttpEtUtils';\n\nconst HttpRequestET = (props: HttpRequestETInput) => {\n const [inProgress, setInProgress] = useState(true);\n\n useEffect(() => {\n (async () => {\n if (inProgress) {\n try {\n const apiResponse = await getApiResponse(props.api);\n setInProgress(false);\n props.onSubmitET(\n await getHttpETOutput(\n apiResponse.data,\n props.api.responseJsonPath,\n true\n )\n );\n } catch (error: any) {\n setInProgress(false);\n if (error.response) {\n /**\n * The request was made and the server responded\n * with a status code that falls out of the range of 2xx\n */\n props.onSubmitET(\n await getHttpETOutput(\n error.response.data,\n props.api.errorJsonPath,\n false\n )\n );\n } else {\n props.onSubmitET(await getHttpETOutput(error, '', false));\n }\n }\n }\n })();\n }, [inProgress, props]);\n return (\n <View style={CommonStyles.mainContainer}>\n <ProgressDialog\n visible={inProgress}\n label={props.message ?? PLEASE_WAIT}\n />\n </View>\n );\n};\nexport default HttpRequestET;\n"],"mappings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Y,CAACC;EAAc,gBACtC9C,MAAA,CAAAW,OAAA,CAAA+B,aAAA,CAAC7C,eAAA,CAAAc,OAAc;IACboC,OAAO,EAAEnB,UAAW;IACpBoB,KAAK,EAAErB,KAAK,CAACsB,OAAO,IAAIC;EAAY,EACpC,CACG;AAEX,CAAC;AAAC,IAAAC,QAAA,GACazB,aAAa;AAAA0B,OAAA,CAAAzC,OAAA,GAAAwC,QAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["CaptureSchema.ts"],"sourcesContent":["/**\n * Length (in cm)\n */\nimport type {\n BaseETRequest,\n BaseETResponse,\n} from '../../../models/execTasks/ETBaseModels';\n\nexport interface CapturedImage {\n /**\n * Url of image\n */\n url: string;\n file?: { folder: string; name: string };\n\n /**\n * Epoch timestamp for the image capture\n */\n timestamp: number;\n}\n\nexport type CaptureOutput = BaseETResponse & {\n /**\n * Array of captured images\n */\n captures?: CapturedImage[];\n};\n\nexport type ImageData = {\n id: string;\n path: string;\n url: string;\n timestamp: number;\n};\n\n/**\n * Length (in cm)\n */\nexport type Length = number;\n/**\n * Breadth (in cm)\n */\nexport type Breadth = number;\n/**\n * Maximum Size limit (in kb) of image to be captured\n */\nexport type MaxFileSize = number;\n/**\n * Mode of capturing image\n */\nexport type CaptureMode = 'SINGLE' | 'MULTI';\n/**\n * Max limit of images to be captured in multi-capture mode\n */\nexport type MaxImageCount = number;\n/**\n * Title of instruction\n */\nexport type Title = string;\n/**\n * Message of instruction\n */\nexport type Message = string;\n/**\n * Can go back\n */\nexport type CanGoBack = boolean;\n\nexport type CaptureInput = BaseETRequest & {\n resolution: Resolution;\n fileSizeLimit: MaxFileSize;\n captureMode: CaptureMode;\n captureCountLimit?: MaxImageCount;\n onSubmitET: (etOutput: CaptureOutput) => void;\n} & {\n jobIds: string[];\n objRefs: string[];\n};\n/**\n * Resolution of image to be captured\n */\nexport interface Resolution {\n length: Length;\n breadth: Breadth;\n}\n"],"mappings":""}
|
|
1
|
+
{"version":3,"names":[],"sources":["CaptureSchema.ts"],"sourcesContent":["/**\n * Length (in cm)\n */\nimport type {\n BaseETRequest,\n BaseETResponse,\n} from '../../../models/execTasks/ETBaseModels';\n\nexport interface CapturedImage {\n /**\n * Url of image\n */\n url: string;\n file?: { folder: string; name: string };\n\n /**\n * Epoch timestamp for the image capture\n */\n timestamp: number;\n}\n\nexport type CaptureOutput = BaseETResponse & {\n /**\n * Array of captured images\n */\n captures?: CapturedImage[];\n};\n\nexport type ImageData = {\n id: string;\n path: string;\n url: string;\n timestamp: number;\n};\n\n/**\n * Length (in cm)\n */\nexport type Length = number;\n/**\n * Breadth (in cm)\n */\nexport type Breadth = number;\n/**\n * Maximum Size limit (in kb) of image to be captured\n */\nexport type MaxFileSize = number;\n/**\n * Mode of capturing image\n */\nexport type CaptureMode = 'SINGLE' | 'MULTI';\n/**\n * Max limit of images to be captured in multi-capture mode\n */\nexport type MaxImageCount = number;\n/**\n * Title of instruction\n */\nexport type Title = string;\n/**\n * Message of instruction\n */\nexport type Message = string;\n/**\n * Can go back\n */\nexport type CanGoBack = boolean;\n\nexport type MultiAdditionalConfig = '1' | 'N';\n\nexport interface AdditionalMultiConfig {\n minCaptureCount: MultiAdditionalConfig;\n}\n\nexport type CaptureInput = BaseETRequest & {\n resolution: Resolution;\n fileSizeLimit: MaxFileSize;\n captureMode: CaptureMode;\n captureCountLimit?: MaxImageCount;\n additionalMultiConfig?: AdditionalMultiConfig;\n onSubmitET: (etOutput: CaptureOutput) => void;\n} & {\n jobIds: string[];\n objRefs: string[];\n};\n/**\n * Resolution of image to be captured\n */\nexport interface Resolution {\n length: Length;\n breadth: Breadth;\n}\n"],"mappings":""}
|
|
@@ -10,39 +10,22 @@ exports.getCaptureOutput = getCaptureOutput;
|
|
|
10
10
|
exports.getCompressionRatio = getCompressionRatio;
|
|
11
11
|
exports.getImagesFileName = getImagesFileName;
|
|
12
12
|
exports.getMaxImagesCount = getMaxImagesCount;
|
|
13
|
-
|
|
14
13
|
var _reactNative = require("react-native");
|
|
15
|
-
|
|
16
14
|
var FileSystem = _interopRequireWildcard(require("expo-file-system"));
|
|
17
|
-
|
|
18
15
|
var ImagePicker = _interopRequireWildcard(require("expo-image-picker"));
|
|
19
|
-
|
|
20
16
|
var _Toaster = require("../../widgets/Toaster");
|
|
21
|
-
|
|
22
17
|
var ImageManipulator = _interopRequireWildcard(require("expo-image-manipulator"));
|
|
23
|
-
|
|
24
18
|
var _Logger = _interopRequireWildcard(require("../../../utils/Logger"));
|
|
25
|
-
|
|
26
19
|
var _ExecTaskUtils = require("../../../utils/ExecTaskUtils");
|
|
27
|
-
|
|
28
20
|
var _EventCodeContainer = require("../../../manager/dispatchCodes/EventCodeContainer");
|
|
29
|
-
|
|
30
21
|
var _ETConfig = require("../../../models/execTasks/ETConfig");
|
|
31
|
-
|
|
32
22
|
var _BaseError = require("../../../errors/BaseError");
|
|
33
|
-
|
|
34
23
|
var _ErrorCodes = _interopRequireDefault(require("../../../errors/ErrorCodes"));
|
|
35
|
-
|
|
36
24
|
var _DispatchSdkCache = _interopRequireDefault(require("../../../manager/sdk/DispatchSdkCache"));
|
|
37
|
-
|
|
38
25
|
var _SyncManagerUtils = require("../../../utils/SyncManagerUtils");
|
|
39
|
-
|
|
40
26
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
41
|
-
|
|
42
27
|
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); }
|
|
43
|
-
|
|
44
28
|
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; }
|
|
45
|
-
|
|
46
29
|
async function deleteImage(imageData, images) {
|
|
47
30
|
await FileSystem.deleteAsync(imageData.path);
|
|
48
31
|
let filtered = images.filter(img => {
|
|
@@ -50,38 +33,30 @@ async function deleteImage(imageData, images) {
|
|
|
50
33
|
});
|
|
51
34
|
return filtered;
|
|
52
35
|
}
|
|
53
|
-
|
|
54
36
|
function getMaxImagesCount(props) {
|
|
55
37
|
if (props && props.captureCountLimit) return props.captureCountLimit;else return 1;
|
|
56
38
|
}
|
|
57
|
-
|
|
58
39
|
function getImagesFileName() {
|
|
59
40
|
return `IMG_${Date.now().toString()}.jpg`;
|
|
60
41
|
}
|
|
61
|
-
|
|
62
42
|
async function getCompressionRatio(uri, maxSize) {
|
|
63
43
|
try {
|
|
64
44
|
let fileInfo = await FileSystem.getInfoAsync(uri, {
|
|
65
45
|
size: true
|
|
66
46
|
});
|
|
67
47
|
maxSize = Math.min(maxSize, 1024);
|
|
68
|
-
|
|
69
48
|
if (fileInfo.exists) {
|
|
70
49
|
let fileSize = fileInfo.size / 1024;
|
|
71
|
-
|
|
72
50
|
if (fileSize > maxSize) {
|
|
73
51
|
return maxSize / fileSize;
|
|
74
52
|
} else return 1;
|
|
75
53
|
}
|
|
76
|
-
|
|
77
54
|
return 1;
|
|
78
55
|
} catch (error) {
|
|
79
56
|
_Logger.default.getInstance().logEvent('getCompressionRatio', error.message, _Logger.LOG_TYPE.SDK_ERROR);
|
|
80
|
-
|
|
81
57
|
return 1;
|
|
82
58
|
}
|
|
83
59
|
}
|
|
84
|
-
|
|
85
60
|
async function checkCameraPermissionUtil() {
|
|
86
61
|
let response = await ImagePicker.getCameraPermissionsAsync();
|
|
87
62
|
if (response.granted) return true;else {
|
|
@@ -89,19 +64,15 @@ async function checkCameraPermissionUtil() {
|
|
|
89
64
|
return resp.status === ImagePicker.PermissionStatus.GRANTED;
|
|
90
65
|
}
|
|
91
66
|
}
|
|
92
|
-
|
|
93
67
|
async function captureImage(imageWidth, imageHeight, fileSize) {
|
|
94
68
|
try {
|
|
95
69
|
if (!(await checkCameraPermissionUtil())) {
|
|
96
70
|
_reactNative.Alert.alert('Permissions Error', 'Camera permissions not provided!');
|
|
97
|
-
|
|
98
71
|
return null;
|
|
99
72
|
}
|
|
100
|
-
|
|
101
73
|
let response = await ImagePicker.launchCameraAsync({
|
|
102
74
|
quality: 1
|
|
103
75
|
});
|
|
104
|
-
|
|
105
76
|
if (!response.cancelled) {
|
|
106
77
|
let actionResize = {
|
|
107
78
|
resize: {
|
|
@@ -123,24 +94,26 @@ async function captureImage(imageWidth, imageHeight, fileSize) {
|
|
|
123
94
|
}
|
|
124
95
|
} catch (exception) {
|
|
125
96
|
(0, _Toaster.showToast)(`Error ${exception.message}`);
|
|
97
|
+
console.error('capture image error: ', exception);
|
|
126
98
|
return null;
|
|
127
99
|
}
|
|
128
100
|
}
|
|
129
|
-
|
|
130
101
|
async function getCaptureOutput(imageDataList, captureProps) {
|
|
131
|
-
|
|
102
|
+
var _captureProps$applica;
|
|
103
|
+
if (!imageDataList || imageDataList.length === 0) return {
|
|
104
|
+
...(await (0, _ExecTaskUtils.getBaseETResponse)(_ETConfig.EntityCode.IMAGE_CAPTURE, false, (0, _EventCodeContainer.getEventCodeByET)(_ETConfig.ExecutionTaskID.IMAGE_CAPTURE, false, (_captureProps$applica = captureProps.applicableReasons) === null || _captureProps$applica === void 0 ? void 0 : _captureProps$applica.failure), ''))
|
|
132
105
|
};else {
|
|
133
|
-
|
|
106
|
+
var _captureProps$applica2;
|
|
107
|
+
return {
|
|
108
|
+
...(await (0, _ExecTaskUtils.getBaseETResponse)(_ETConfig.EntityCode.IMAGE_CAPTURE, true, (0, _EventCodeContainer.getEventCodeByET)(_ETConfig.ExecutionTaskID.IMAGE_CAPTURE, true, (_captureProps$applica2 = captureProps.applicableReasons) === null || _captureProps$applica2 === void 0 ? void 0 : _captureProps$applica2.success), '')),
|
|
134
109
|
captures: await getImagesData(imageDataList, captureProps)
|
|
135
110
|
};
|
|
136
111
|
}
|
|
137
112
|
}
|
|
138
|
-
|
|
139
113
|
async function getImagesData(imagesDataList, captureProps) {
|
|
140
114
|
if (imagesDataList && imagesDataList.length > 0) {
|
|
141
115
|
let output = [];
|
|
142
116
|
const folderName = (await _DispatchSdkCache.default.getInstance().getKeyFromCache(_DispatchSdkCache.default.KEYS.FMS_FOLDER)) ?? 'NULL';
|
|
143
|
-
|
|
144
117
|
for (const data of imagesDataList) {
|
|
145
118
|
let insertID = await (0, _SyncManagerUtils.insertDocumentInDB)(data.id, folderName, JSON.stringify(captureProps.jobIds), JSON.stringify(captureProps.objRefs), null, captureProps.title, data.path);
|
|
146
119
|
if (insertID) output.push({
|
|
@@ -152,7 +125,6 @@ async function getImagesData(imagesDataList, captureProps) {
|
|
|
152
125
|
}
|
|
153
126
|
});else throw new _BaseError.BaseError(_ErrorCodes.default.SQLiteDBIssue, 'Unable to save Image');
|
|
154
127
|
}
|
|
155
|
-
|
|
156
128
|
return output;
|
|
157
129
|
} else return [];
|
|
158
130
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["deleteImage","imageData","images","FileSystem","deleteAsync","path","filtered","filter","img","id","getMaxImagesCount","props","captureCountLimit","getImagesFileName","Date","now","toString","getCompressionRatio","uri","maxSize","fileInfo","getInfoAsync","size","Math","min","exists","fileSize","error","Logger","getInstance","logEvent","message","LOG_TYPE","SDK_ERROR","checkCameraPermissionUtil","response","ImagePicker","getCameraPermissionsAsync","granted","resp","requestCameraPermissionsAsync","status","PermissionStatus","GRANTED","captureImage","imageWidth","imageHeight","Alert","alert","launchCameraAsync","quality","cancelled","actionResize","resize","width","height","compressionRatio","resizedImage","ImageManipulator","manipulateAsync","compress","then","SDK_DEBUG","catch","showToast","exception","getCaptureOutput","imageDataList","captureProps","length","getBaseETResponse","EntityCode","IMAGE_CAPTURE","getEventCodeByET","ExecutionTaskID","captures","getImagesData","imagesDataList","output","folderName","DispatchSdkCache","getKeyFromCache","KEYS","FMS_FOLDER","data","insertID","insertDocumentInDB","JSON","stringify","jobIds","objRefs","title","push","url","timestamp","file","folder","name","BaseError","BaseErrorCodes","SQLiteDBIssue"],"sources":["CaptureUtils.ts"],"sourcesContent":["import type {\n CapturedImage,\n CaptureInput,\n CaptureOutput,\n ImageData,\n} from './CaptureSchema';\nimport { Alert } from 'react-native';\nimport * as FileSystem from 'expo-file-system';\nimport * as ImagePicker from 'expo-image-picker';\nimport { PermissionStatus } from 'expo-image-picker';\nimport { showToast } from '../../widgets/Toaster';\nimport type { ActionResize, ImageResult } from 'expo-image-manipulator';\nimport * as ImageManipulator from 'expo-image-manipulator';\nimport Logger, { LOG_TYPE } from '../../../utils/Logger';\nimport { getBaseETResponse } from '../../../utils/ExecTaskUtils';\nimport { getEventCodeByET } from '../../../manager/dispatchCodes/EventCodeContainer';\nimport {\n EntityCode,\n ExecutionTaskID,\n} from '../../../models/execTasks/ETConfig';\nimport { BaseError } from '../../../errors/BaseError';\nimport BaseErrorCodes from '../../../errors/ErrorCodes';\nimport DispatchSdkCache from '../../../manager/sdk/DispatchSdkCache';\nimport { insertDocumentInDB } from '../../../utils/SyncManagerUtils';\n\nexport async function deleteImage(\n imageData: ImageData,\n images: ImageData[]\n): Promise<ImageData[]> {\n await FileSystem.deleteAsync(imageData.path);\n let filtered = images.filter((img) => {\n return img.id !== imageData.id;\n });\n return filtered;\n}\n\nexport function getMaxImagesCount(props: CaptureInput) {\n if (props && props.captureCountLimit) return props.captureCountLimit;\n else return 1;\n}\n\nexport function getImagesFileName() {\n return `IMG_${Date.now().toString()}.jpg`;\n}\n\nexport async function getCompressionRatio(\n uri: string,\n maxSize: number\n): Promise<number> {\n try {\n let fileInfo = await FileSystem.getInfoAsync(uri, {\n size: true,\n });\n maxSize = Math.min(maxSize, 1024);\n if (fileInfo.exists) {\n let fileSize = fileInfo.size / 1024;\n if (fileSize > maxSize) {\n return maxSize / fileSize;\n } else return 1;\n }\n return 1;\n } catch (error: any) {\n Logger.getInstance().logEvent(\n 'getCompressionRatio',\n error.message,\n LOG_TYPE.SDK_ERROR\n );\n return 1;\n }\n}\n\nexport async function checkCameraPermissionUtil(): Promise<boolean> {\n let response = await ImagePicker.getCameraPermissionsAsync();\n if (response.granted) return true;\n else {\n let resp = await ImagePicker.requestCameraPermissionsAsync();\n return resp.status === PermissionStatus.GRANTED;\n }\n}\n\nexport async function captureImage(\n imageWidth: number,\n imageHeight: number,\n fileSize: number\n): Promise<ImageResult | null> {\n try {\n if (!(await checkCameraPermissionUtil())) {\n Alert.alert('Permissions Error', 'Camera permissions not provided!');\n return null;\n }\n let response = await ImagePicker.launchCameraAsync({\n quality: 1,\n });\n if (!response.cancelled) {\n let actionResize: ActionResize = {\n resize: {\n width: imageWidth,\n height: imageHeight,\n },\n };\n let compressionRatio = await getCompressionRatio(response.uri, fileSize);\n let resizedImage = await ImageManipulator.manipulateAsync(\n response.uri,\n [actionResize],\n {\n compress: compressionRatio,\n }\n );\n FileSystem.deleteAsync(response.uri)\n .then(() =>\n Logger.getInstance().logEvent(\n 'CAPTURE_ET',\n 'File deleted success',\n LOG_TYPE.SDK_DEBUG\n )\n )\n .catch((error) => {\n Logger.getInstance().logEvent(\n 'CAPTURE_ET',\n error.message,\n LOG_TYPE.SDK_ERROR\n );\n });\n return resizedImage;\n } else {\n showToast('User cancelled the action');\n return null;\n }\n } catch (exception: any) {\n showToast(`Error ${exception.message}`);\n return null;\n }\n}\n\nexport async function getCaptureOutput(\n imageDataList: ImageData[],\n captureProps: CaptureInput\n): Promise<CaptureOutput> {\n if (!imageDataList || imageDataList.length === 0)\n return {\n ...(await getBaseETResponse(\n EntityCode.IMAGE_CAPTURE,\n false,\n getEventCodeByET(ExecutionTaskID.IMAGE_CAPTURE, false),\n ''\n )),\n };\n else {\n return {\n ...(await getBaseETResponse(\n EntityCode.IMAGE_CAPTURE,\n true,\n getEventCodeByET(ExecutionTaskID.IMAGE_CAPTURE, true),\n ''\n )),\n captures: await getImagesData(imageDataList, captureProps),\n };\n }\n}\n\nasync function getImagesData(\n imagesDataList: ImageData[],\n captureProps: CaptureInput\n): Promise<CapturedImage[]> {\n if (imagesDataList && imagesDataList.length > 0) {\n let output: CapturedImage[] = [];\n const folderName =\n (await DispatchSdkCache.getInstance().getKeyFromCache(\n DispatchSdkCache.KEYS.FMS_FOLDER\n )) ?? 'NULL';\n for (const data of imagesDataList) {\n let insertID = await insertDocumentInDB(\n data.id,\n folderName,\n JSON.stringify(captureProps.jobIds),\n JSON.stringify(captureProps.objRefs),\n null,\n captureProps.title,\n data.path\n );\n if (insertID)\n output.push({\n url: '',\n timestamp: data.timestamp,\n file: { folder: folderName, name: data.id },\n });\n else\n throw new BaseError(\n BaseErrorCodes.SQLiteDBIssue,\n 'Unable to save Image'\n );\n }\n return output;\n } else return [];\n}\n"],"mappings":";;;;;;;;;;;;;AAMA;;AACA;;AACA;;AAEA;;AAEA;;AACA;;AACA;;AACA;;AACA;;AAIA;;AACA;;AACA;;AACA;;;;;;;;AAEO,eAAeA,WAAf,CACLC,SADK,EAELC,MAFK,EAGiB;EACtB,MAAMC,UAAU,CAACC,WAAX,CAAuBH,SAAS,CAACI,IAAjC,CAAN;EACA,IAAIC,QAAQ,GAAGJ,MAAM,CAACK,MAAP,CAAeC,GAAD,IAAS;IACpC,OAAOA,GAAG,CAACC,EAAJ,KAAWR,SAAS,CAACQ,EAA5B;EACD,CAFc,CAAf;EAGA,OAAOH,QAAP;AACD;;AAEM,SAASI,iBAAT,CAA2BC,KAA3B,EAAgD;EACrD,IAAIA,KAAK,IAAIA,KAAK,CAACC,iBAAnB,EAAsC,OAAOD,KAAK,C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,IAAI,EAAEb,IAAI,CAAC3E;QAAjC;MAHI,CAAZ,EADF,KAOE,MAAM,IAAIyF,oBAAJ,CACJC,mBAAA,CAAeC,aADX,EAEJ,sBAFI,CAAN;IAIH;;IACD,OAAOtB,MAAP;EACD,CA7BD,MA6BO,OAAO,EAAP;AACR"}
|
|
1
|
+
{"version":3,"names":["_reactNative","require","FileSystem","_interopRequireWildcard","ImagePicker","_Toaster","ImageManipulator","_Logger","_ExecTaskUtils","_EventCodeContainer","_ETConfig","_BaseError","_ErrorCodes","_interopRequireDefault","_DispatchSdkCache","_SyncManagerUtils","obj","__esModule","default","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","deleteImage","imageData","images","deleteAsync","path","filtered","filter","img","id","getMaxImagesCount","props","captureCountLimit","getImagesFileName","Date","now","toString","getCompressionRatio","uri","maxSize","fileInfo","getInfoAsync","size","Math","min","exists","fileSize","error","Logger","getInstance","logEvent","message","LOG_TYPE","SDK_ERROR","checkCameraPermissionUtil","response","getCameraPermissionsAsync","granted","resp","requestCameraPermissionsAsync","status","PermissionStatus","GRANTED","captureImage","imageWidth","imageHeight","Alert","alert","launchCameraAsync","quality","cancelled","actionResize","resize","width","height","compressionRatio","resizedImage","manipulateAsync","compress","then","SDK_DEBUG","catch","showToast","exception","console","getCaptureOutput","imageDataList","captureProps","_captureProps$applica","length","getBaseETResponse","EntityCode","IMAGE_CAPTURE","getEventCodeByET","ExecutionTaskID","applicableReasons","failure","_captureProps$applica2","success","captures","getImagesData","imagesDataList","output","folderName","DispatchSdkCache","getKeyFromCache","KEYS","FMS_FOLDER","data","insertID","insertDocumentInDB","JSON","stringify","jobIds","objRefs","title","push","url","timestamp","file","folder","name","BaseError","BaseErrorCodes","SQLiteDBIssue"],"sources":["CaptureUtils.ts"],"sourcesContent":["import type {\n CapturedImage,\n CaptureInput,\n CaptureOutput,\n ImageData,\n} from './CaptureSchema';\nimport { Alert } from 'react-native';\nimport * as FileSystem from 'expo-file-system';\nimport * as ImagePicker from 'expo-image-picker';\nimport { PermissionStatus } from 'expo-image-picker';\nimport { showToast } from '../../widgets/Toaster';\nimport type { ActionResize, ImageResult } from 'expo-image-manipulator';\nimport * as ImageManipulator from 'expo-image-manipulator';\nimport Logger, { LOG_TYPE } from '../../../utils/Logger';\nimport { getBaseETResponse } from '../../../utils/ExecTaskUtils';\nimport { getEventCodeByET } from '../../../manager/dispatchCodes/EventCodeContainer';\nimport {\n EntityCode,\n ExecutionTaskID,\n} from '../../../models/execTasks/ETConfig';\nimport { BaseError } from '../../../errors/BaseError';\nimport BaseErrorCodes from '../../../errors/ErrorCodes';\nimport DispatchSdkCache from '../../../manager/sdk/DispatchSdkCache';\nimport { insertDocumentInDB } from '../../../utils/SyncManagerUtils';\n\nexport async function deleteImage(\n imageData: ImageData,\n images: ImageData[]\n): Promise<ImageData[]> {\n await FileSystem.deleteAsync(imageData.path);\n let filtered = images.filter((img) => {\n return img.id !== imageData.id;\n });\n return filtered;\n}\n\nexport function getMaxImagesCount(props: CaptureInput) {\n if (props && props.captureCountLimit) return props.captureCountLimit;\n else return 1;\n}\n\nexport function getImagesFileName() {\n return `IMG_${Date.now().toString()}.jpg`;\n}\n\nexport async function getCompressionRatio(\n uri: string,\n maxSize: number\n): Promise<number> {\n try {\n let fileInfo = await FileSystem.getInfoAsync(uri, {\n size: true,\n });\n maxSize = Math.min(maxSize, 1024);\n if (fileInfo.exists) {\n let fileSize = fileInfo.size / 1024;\n if (fileSize > maxSize) {\n return maxSize / fileSize;\n } else return 1;\n }\n return 1;\n } catch (error: any) {\n Logger.getInstance().logEvent(\n 'getCompressionRatio',\n error.message,\n LOG_TYPE.SDK_ERROR\n );\n return 1;\n }\n}\n\nexport async function checkCameraPermissionUtil(): Promise<boolean> {\n let response = await ImagePicker.getCameraPermissionsAsync();\n if (response.granted) return true;\n else {\n let resp = await ImagePicker.requestCameraPermissionsAsync();\n return resp.status === PermissionStatus.GRANTED;\n }\n}\n\nexport async function captureImage(\n imageWidth: number,\n imageHeight: number,\n fileSize: number\n): Promise<ImageResult | null> {\n try {\n if (!(await checkCameraPermissionUtil())) {\n Alert.alert('Permissions Error', 'Camera permissions not provided!');\n return null;\n }\n let response = await ImagePicker.launchCameraAsync({\n quality: 1,\n });\n if (!response.cancelled) {\n let actionResize: ActionResize = {\n resize: {\n width: imageWidth,\n height: imageHeight,\n },\n };\n let compressionRatio = await getCompressionRatio(response.uri, fileSize);\n let resizedImage = await ImageManipulator.manipulateAsync(\n response.uri,\n [actionResize],\n {\n compress: compressionRatio,\n }\n );\n FileSystem.deleteAsync(response.uri)\n .then(() =>\n Logger.getInstance().logEvent(\n 'CAPTURE_ET',\n 'File deleted success',\n LOG_TYPE.SDK_DEBUG\n )\n )\n .catch((error) => {\n Logger.getInstance().logEvent(\n 'CAPTURE_ET',\n error.message,\n LOG_TYPE.SDK_ERROR\n );\n });\n return resizedImage;\n } else {\n showToast('User cancelled the action');\n return null;\n }\n } catch (exception: any) {\n showToast(`Error ${exception.message}`);\n console.error('capture image error: ', exception);\n\n return null;\n }\n}\n\nexport async function getCaptureOutput(\n imageDataList: ImageData[],\n captureProps: CaptureInput\n): Promise<CaptureOutput> {\n if (!imageDataList || imageDataList.length === 0)\n return {\n ...(await getBaseETResponse(\n EntityCode.IMAGE_CAPTURE,\n false,\n getEventCodeByET(\n ExecutionTaskID.IMAGE_CAPTURE,\n false,\n captureProps.applicableReasons?.failure\n ),\n ''\n )),\n };\n else {\n return {\n ...(await getBaseETResponse(\n EntityCode.IMAGE_CAPTURE,\n true,\n getEventCodeByET(\n ExecutionTaskID.IMAGE_CAPTURE,\n true,\n captureProps.applicableReasons?.success\n ),\n ''\n )),\n captures: await getImagesData(imageDataList, captureProps),\n };\n }\n}\n\nasync function getImagesData(\n imagesDataList: ImageData[],\n captureProps: CaptureInput\n): Promise<CapturedImage[]> {\n if (imagesDataList && imagesDataList.length > 0) {\n let output: CapturedImage[] = [];\n const folderName =\n (await DispatchSdkCache.getInstance().getKeyFromCache(\n DispatchSdkCache.KEYS.FMS_FOLDER\n )) ?? 'NULL';\n for (const data of imagesDataList) {\n let insertID = await insertDocumentInDB(\n data.id,\n folderName,\n JSON.stringify(captureProps.jobIds),\n JSON.stringify(captureProps.objRefs),\n null,\n captureProps.title,\n data.path\n );\n if (insertID)\n output.push({\n url: '',\n timestamp: data.timestamp,\n file: { folder: folderName, name: data.id },\n });\n else\n throw new BaseError(\n BaseErrorCodes.SQLiteDBIssue,\n 'Unable to save Image'\n );\n }\n return output;\n } else return [];\n}\n"],"mappings":";;;;;;;;;;;;AAMA,IAAAA,YAAA,GAAAC,OAAA;AACA,IAAAC,UAAA,GAAAC,uBAAA,CAAAF,OAAA;AACA,IAAAG,WAAA,GAAAD,uBAAA,CAAAF,OAAA;AAEA,IAAAI,QAAA,GAAAJ,OAAA;AAEA,IAAAK,gBAAA,GAAAH,uBAAA,CAAAF,OAAA;AACA,IAAAM,OAAA,GAAAJ,uBAAA,CAAAF,OAAA;AACA,IAAAO,cAAA,GAAAP,OAAA;AACA,IAAAQ,mBAAA,GAAAR,OAAA;AACA,IAAAS,SAAA,GAAAT,OAAA;AAIA,IAAAU,UAAA,GAAAV,OAAA;AACA,IAAAW,WAAA,GAAAC,sBAAA,CAAAZ,OAAA;AACA,IAAAa,iBAAA,GAAAD,sBAAA,CAAAZ,OAAA;AACA,IAAAc,iBAAA,GAAAd,OAAA;AAAqE,SAAAY,uBAAAG,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAAA,SAAAG,yBAAAC,WAAA,eAAAC,OAAA,kCAAAC,iBAAA,OAAAD,OAAA,QAAAE,gBAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,WAAA,WAAAA,WAAA,GAAAG,gBAAA,GAAAD,iBAAA,KAA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B,EACrCF,IAAI,CAAC/E,EAAE,EACP0E,UAAU,EACVQ,IAAI,CAACC,SAAS,CAACzB,YAAY,CAAC0B,MAAM,CAAC,EACnCF,IAAI,CAACC,SAAS,CAACzB,YAAY,CAAC2B,OAAO,CAAC,EACpC,IAAI,EACJ3B,YAAY,CAAC4B,KAAK,EAClBP,IAAI,CAACnF,IAAI,CACV;MACD,IAAIoF,QAAQ,EACVP,MAAM,CAACc,IAAI,CAAC;QACVC,GAAG,EAAE,EAAE;QACPC,SAAS,EAAEV,IAAI,CAACU,SAAS;QACzBC,IAAI,EAAE;UAAEC,MAAM,EAAEjB,UAAU;UAAEkB,IAAI,EAAEb,IAAI,CAAC/E;QAAG;MAC5C,CAAC,CAAC,CAAC,KAEH,MAAM,IAAI6F,oBAAS,CACjBC,mBAAc,CAACC,aAAa,EAC5B,sBAAsB,CACvB;IACL;IACA,OAAOtB,MAAM;EACf,CAAC,MAAM,OAAO,EAAE;AAClB"}
|
|
@@ -4,35 +4,22 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
-
|
|
8
7
|
var _react = _interopRequireWildcard(require("react"));
|
|
9
|
-
|
|
10
8
|
var _reactNative = require("react-native");
|
|
11
|
-
|
|
12
9
|
var CaptureUtils = _interopRequireWildcard(require("./CaptureUtils"));
|
|
13
|
-
|
|
14
|
-
var _reactNativePaper = require("react-native-paper");
|
|
15
|
-
|
|
16
10
|
var _Toaster = require("../../widgets/Toaster");
|
|
17
|
-
|
|
18
11
|
var _SdkColors = _interopRequireWildcard(require("../../../styles/SdkColors"));
|
|
19
|
-
|
|
20
12
|
var _MaterialIcons = _interopRequireDefault(require("react-native-vector-icons/MaterialIcons"));
|
|
21
|
-
|
|
22
13
|
var _CommonStyles = require("../../../styles/executionTasks/CommonStyles");
|
|
23
|
-
|
|
24
14
|
var _ExecTaskUtils = require("../../../utils/ExecTaskUtils");
|
|
25
|
-
|
|
26
15
|
var _ETConfig = require("../../../models/execTasks/ETConfig");
|
|
27
|
-
|
|
28
16
|
var _EventCodeContainer = require("../../../manager/dispatchCodes/EventCodeContainer");
|
|
29
|
-
|
|
17
|
+
var _constants = require("../../../constants/constants");
|
|
18
|
+
var _reactNativePaper = require("react-native-paper");
|
|
19
|
+
var _Logger = _interopRequireWildcard(require("../../../utils/Logger"));
|
|
30
20
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
31
|
-
|
|
32
21
|
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); }
|
|
33
|
-
|
|
34
22
|
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; }
|
|
35
|
-
|
|
36
23
|
const ImageItem = _ref => {
|
|
37
24
|
let {
|
|
38
25
|
item,
|
|
@@ -59,36 +46,79 @@ const ImageItem = _ref => {
|
|
|
59
46
|
}
|
|
60
47
|
}));
|
|
61
48
|
};
|
|
62
|
-
|
|
63
49
|
const ImageCapture = props => {
|
|
64
50
|
const [images, setImages] = (0, _react.useState)([]);
|
|
65
51
|
const [showCapture, setShowCapture] = (0, _react.useState)(true);
|
|
66
52
|
const [disableProceed, setDisableProceed] = (0, _react.useState)(false);
|
|
67
|
-
|
|
53
|
+
const [showBackModal, setShowBackModal] = (0, _react.useState)(false);
|
|
54
|
+
(0, _react.useLayoutEffect)(() => {
|
|
55
|
+
props.navigation.setOptions({
|
|
56
|
+
title: props.title,
|
|
57
|
+
headerLeft: () => {
|
|
58
|
+
var _props$taskMeta;
|
|
59
|
+
return (_props$taskMeta = props.taskMeta) !== null && _props$taskMeta !== void 0 && _props$taskMeta.enableGoBack ? /*#__PURE__*/_react.default.createElement(_MaterialIcons.default, {
|
|
60
|
+
onPress: async () => {
|
|
61
|
+
setShowBackModal(true);
|
|
62
|
+
},
|
|
63
|
+
name: "arrow-back",
|
|
64
|
+
color: 'black',
|
|
65
|
+
size: 25,
|
|
66
|
+
style: {
|
|
67
|
+
paddingRight: 15,
|
|
68
|
+
paddingTop: 5
|
|
69
|
+
}
|
|
70
|
+
}) : null;
|
|
71
|
+
}
|
|
72
|
+
});
|
|
73
|
+
}, [props.navigation, props.title]);
|
|
74
|
+
const renderModal = () => {
|
|
75
|
+
return /*#__PURE__*/_react.default.createElement(_reactNativePaper.Portal, null, /*#__PURE__*/_react.default.createElement(_reactNativePaper.Modal, {
|
|
76
|
+
visible: showBackModal,
|
|
77
|
+
dismissable: true,
|
|
78
|
+
contentContainerStyle: _CommonStyles.CommonStyles.modalContent
|
|
79
|
+
}, /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
|
80
|
+
style: _CommonStyles.CommonStyles.modalView
|
|
81
|
+
}, /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
|
|
82
|
+
style: _CommonStyles.CommonStyles.subText
|
|
83
|
+
}, 'Are you sure you want to go back?'), /*#__PURE__*/_react.default.createElement(_reactNativePaper.Button, {
|
|
84
|
+
labelStyle: _CommonStyles.CommonStyles.nextButtonLabel,
|
|
85
|
+
style: {
|
|
86
|
+
..._CommonStyles.CommonStyles.nextButton,
|
|
87
|
+
marginTop: 10
|
|
88
|
+
},
|
|
89
|
+
uppercase: false,
|
|
90
|
+
onPress: async () => {
|
|
91
|
+
props.onSubmitET({
|
|
92
|
+
...(await (0, _ExecTaskUtils.getBaseETResponse)(_ETConfig.EntityCode.IMAGE_CAPTURE, false, _constants.GO_BACK_EVENT_CODE, ''))
|
|
93
|
+
});
|
|
94
|
+
setShowBackModal(false);
|
|
95
|
+
}
|
|
96
|
+
}, "Yes"), /*#__PURE__*/_react.default.createElement(_reactNativePaper.Button, {
|
|
97
|
+
labelStyle: _CommonStyles.CommonStyles.cancelButtonLabel,
|
|
98
|
+
style: {
|
|
99
|
+
..._CommonStyles.CommonStyles.cancelButton,
|
|
100
|
+
marginTop: 10
|
|
101
|
+
},
|
|
102
|
+
uppercase: false,
|
|
103
|
+
onPress: () => setShowBackModal(false)
|
|
104
|
+
}, "No"))));
|
|
105
|
+
};
|
|
68
106
|
const handleSubmit = async () => {
|
|
69
107
|
try {
|
|
70
108
|
setDisableProceed(true);
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
if (images.length
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
(0, _Toaster.showToast)('No Images captured');
|
|
109
|
+
if (images.length > 0) {
|
|
110
|
+
var _props$additionalMult;
|
|
111
|
+
if (((_props$additionalMult = props.additionalMultiConfig) === null || _props$additionalMult === void 0 ? void 0 : _props$additionalMult.minCaptureCount) === 'N' && images.length < props.jobIds.length) {
|
|
112
|
+
(0, _Toaster.showToast)(`Min ${props.jobIds.length} image(s) required to be captured.`);
|
|
113
|
+
return;
|
|
77
114
|
}
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
props.onSubmitET(await (0, CaptureUtils.getCaptureOutput)(images, props));
|
|
82
|
-
} else {
|
|
83
|
-
(0, _Toaster.showToast)(`${props.captureCountLimit - images.length} Images left`);
|
|
84
|
-
}
|
|
85
|
-
} else {
|
|
86
|
-
if (images.length > 0) {
|
|
87
|
-
props.onSubmitET(await (0, CaptureUtils.getCaptureOutput)(images, props));
|
|
88
|
-
} else {
|
|
89
|
-
(0, _Toaster.showToast)('No Images captured');
|
|
90
|
-
}
|
|
115
|
+
if (props.captureMode === 'MULTI' && props.captureCountLimit && props.captureCountLimit > 0 && images.length > CaptureUtils.getMaxImagesCount(props)) {
|
|
116
|
+
(0, _Toaster.showToast)(`Max ${props.captureCountLimit} image(s) allowed.`);
|
|
117
|
+
return;
|
|
91
118
|
}
|
|
119
|
+
props.onSubmitET(await (0, CaptureUtils.getCaptureOutput)(images, props));
|
|
120
|
+
} else {
|
|
121
|
+
(0, _Toaster.showToast)('No Images captured');
|
|
92
122
|
}
|
|
93
123
|
} catch (error) {
|
|
94
124
|
setDisableProceed(false);
|
|
@@ -97,7 +127,6 @@ const ImageCapture = props => {
|
|
|
97
127
|
setDisableProceed(false);
|
|
98
128
|
}
|
|
99
129
|
};
|
|
100
|
-
|
|
101
130
|
(0, _react.useEffect)(() => {
|
|
102
131
|
if (props.captureMode === 'SINGLE') {
|
|
103
132
|
if (images.length > 0) {
|
|
@@ -118,9 +147,7 @@ const ImageCapture = props => {
|
|
|
118
147
|
(0, _Toaster.showToast)(`Max Image Limit reached`);
|
|
119
148
|
return;
|
|
120
149
|
}
|
|
121
|
-
|
|
122
150
|
let imageDataResponse = await CaptureUtils.captureImage(props.resolution.breadth, props.resolution.length, props.fileSizeLimit);
|
|
123
|
-
|
|
124
151
|
if (imageDataResponse != null) {
|
|
125
152
|
setImages(prevState => {
|
|
126
153
|
return [...prevState, {
|
|
@@ -133,16 +160,15 @@ const ImageCapture = props => {
|
|
|
133
160
|
});
|
|
134
161
|
}
|
|
135
162
|
}, [props, showCapture]);
|
|
136
|
-
|
|
137
163
|
const deleteImage = async imageData => {
|
|
138
164
|
try {
|
|
139
165
|
let filteredImages = await CaptureUtils.deleteImage(imageData, images);
|
|
140
166
|
setImages(filteredImages);
|
|
141
167
|
} catch (err) {
|
|
142
|
-
|
|
168
|
+
_Logger.default.getInstance().logEvent('deleteImageError', err.message, _Logger.LOG_TYPE.SDK_ERROR);
|
|
169
|
+
return;
|
|
143
170
|
}
|
|
144
171
|
};
|
|
145
|
-
|
|
146
172
|
const renderItem = _ref2 => {
|
|
147
173
|
let {
|
|
148
174
|
item
|
|
@@ -154,8 +180,7 @@ const ImageCapture = props => {
|
|
|
154
180
|
}
|
|
155
181
|
});
|
|
156
182
|
};
|
|
157
|
-
|
|
158
|
-
return /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
|
183
|
+
return /*#__PURE__*/_react.default.createElement(_reactNativePaper.Provider, null, renderModal(), /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
|
159
184
|
style: _CommonStyles.CommonStyles.mainContainer
|
|
160
185
|
}, props.message && /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
|
161
186
|
style: styles.etMessageView
|
|
@@ -205,12 +230,13 @@ const ImageCapture = props => {
|
|
|
205
230
|
mode: "outlined",
|
|
206
231
|
labelStyle: _CommonStyles.CommonStyles.cancelButtonLabel,
|
|
207
232
|
onPress: async () => {
|
|
208
|
-
|
|
233
|
+
var _props$applicableReas;
|
|
234
|
+
props.onSubmitET({
|
|
235
|
+
...(await (0, _ExecTaskUtils.getBaseETResponse)(_ETConfig.EntityCode.IMAGE_CAPTURE, false, (0, _EventCodeContainer.getEventCodeByET)(_ETConfig.ExecutionTaskID.IMAGE_CAPTURE, false, (_props$applicableReas = props.applicableReasons) === null || _props$applicableReas === void 0 ? void 0 : _props$applicableReas.failure), ''))
|
|
209
236
|
});
|
|
210
237
|
}
|
|
211
|
-
}, "Cancel")));
|
|
238
|
+
}, "Cancel"))));
|
|
212
239
|
};
|
|
213
|
-
|
|
214
240
|
const styles = _reactNative.StyleSheet.create({
|
|
215
241
|
imageEtContainer: {
|
|
216
242
|
display: 'flex',
|
|
@@ -250,7 +276,6 @@ const styles = _reactNative.StyleSheet.create({
|
|
|
250
276
|
backgroundColor: '#ffffff'
|
|
251
277
|
}
|
|
252
278
|
});
|
|
253
|
-
|
|
254
279
|
var _default = ImageCapture;
|
|
255
280
|
exports.default = _default;
|
|
256
281
|
//# sourceMappingURL=ImageCapture.js.map
|