@os1-platform/dispatch-mobile 1.0.8 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +310 -74
- package/android/.gradle/7.0.2/fileChanges/last-build.bin +0 -0
- package/android/.gradle/7.0.2/fileHashes/fileHashes.lock +0 -0
- package/android/.gradle/7.0.2/gc.properties +0 -0
- package/android/.gradle/7.2/dependencies-accessors/dependencies-accessors.lock +0 -0
- package/android/.gradle/7.2/dependencies-accessors/gc.properties +0 -0
- package/android/.gradle/7.2/executionHistory/executionHistory.bin +0 -0
- package/android/.gradle/7.2/executionHistory/executionHistory.lock +0 -0
- package/android/.gradle/7.2/fileChanges/last-build.bin +0 -0
- package/android/.gradle/7.2/fileHashes/fileHashes.bin +0 -0
- package/android/.gradle/7.2/fileHashes/fileHashes.lock +0 -0
- package/android/.gradle/7.2/fileHashes/resourceHashesCache.bin +0 -0
- package/android/.gradle/7.2/gc.properties +0 -0
- package/android/.gradle/buildOutputCleanup/buildOutputCleanup.lock +0 -0
- package/android/.gradle/buildOutputCleanup/cache.properties +2 -0
- package/android/.gradle/buildOutputCleanup/outputFiles.bin +0 -0
- package/android/.gradle/checksums/checksums.lock +0 -0
- package/android/.gradle/checksums/md5-checksums.bin +0 -0
- package/android/.gradle/checksums/sha1-checksums.bin +0 -0
- package/android/.gradle/vcs-1/gc.properties +0 -0
- package/android/.idea/compiler.xml +6 -0
- package/android/.idea/gradle.xml +18 -0
- package/android/.idea/jarRepositories.xml +35 -0
- package/android/.idea/kotlinc.xml +6 -0
- package/android/.idea/misc.xml +9 -0
- package/android/.idea/vcs.xml +6 -0
- package/android/gradle.properties +1 -1
- package/android/local.properties +8 -0
- package/android/src/main/AndroidManifest.xml +0 -1
- package/android/src/main/java/com/dispatchsdk/DispatchSdkPackage.kt +3 -1
- package/android/src/main/java/com/dispatchsdk/sharedPref/SharedPreferenceModule.kt +166 -0
- package/lib/commonjs/@types/assets/index.d.js +2 -0
- package/lib/commonjs/@types/assets/index.d.js.map +1 -0
- package/lib/commonjs/components/dispatch/DispatchExecNavigator.js +50 -43
- package/lib/commonjs/components/dispatch/DispatchExecNavigator.js.map +1 -1
- package/lib/commonjs/components/executiontasks/ExecutionTasksIndex.js +10 -48
- package/lib/commonjs/components/executiontasks/ExecutionTasksIndex.js.map +1 -1
- package/lib/commonjs/components/executiontasks/cancellation/CancelET.js +142 -23
- package/lib/commonjs/components/executiontasks/cancellation/CancelET.js.map +1 -1
- package/lib/commonjs/components/executiontasks/cancellation/CancellationSchema.js.map +1 -1
- package/lib/commonjs/components/executiontasks/captureInput/CaptureText.js +66 -18
- package/lib/commonjs/components/executiontasks/captureInput/CaptureText.js.map +1 -1
- package/lib/commonjs/components/executiontasks/captureInput/utils.js +13 -0
- package/lib/commonjs/components/executiontasks/captureInput/utils.js.map +1 -0
- package/lib/commonjs/components/executiontasks/deliver/DeliverET.js +6 -16
- package/lib/commonjs/components/executiontasks/deliver/DeliverET.js.map +1 -1
- package/lib/commonjs/components/executiontasks/deliver/DeliverETInput.js.map +1 -1
- package/lib/commonjs/components/executiontasks/deliver/SLDeliverET.js +212 -95
- package/lib/commonjs/components/executiontasks/deliver/SLDeliverET.js.map +1 -1
- package/lib/commonjs/components/executiontasks/display/DisplayModalET.js +16 -25
- package/lib/commonjs/components/executiontasks/display/DisplayModalET.js.map +1 -1
- package/lib/commonjs/components/executiontasks/doodle/SignatureET.js +65 -29
- package/lib/commonjs/components/executiontasks/doodle/SignatureET.js.map +1 -1
- package/lib/commonjs/components/executiontasks/dropCash/DropCashET.js +5 -19
- package/lib/commonjs/components/executiontasks/dropCash/DropCashET.js.map +1 -1
- package/lib/commonjs/components/executiontasks/dropCash/SLDropCash.js +74 -30
- package/lib/commonjs/components/executiontasks/dropCash/SLDropCash.js.map +1 -1
- package/lib/commonjs/components/executiontasks/forms/FormGenerator.js +139 -50
- package/lib/commonjs/components/executiontasks/forms/FormGenerator.js.map +1 -1
- package/lib/commonjs/components/executiontasks/forms/widgets/DateTimeWidget.js +3 -26
- package/lib/commonjs/components/executiontasks/forms/widgets/DateTimeWidget.js.map +1 -1
- package/lib/commonjs/components/executiontasks/forms/widgets/DropdownWidget.js +49 -0
- package/lib/commonjs/components/executiontasks/forms/widgets/DropdownWidget.js.map +1 -0
- package/lib/commonjs/components/executiontasks/forms/widgets/QRBarcodeScannerWidget.js +2 -17
- package/lib/commonjs/components/executiontasks/forms/widgets/QRBarcodeScannerWidget.js.map +1 -1
- package/lib/commonjs/components/executiontasks/forms/widgets/TimeRangeSelector.js +0 -10
- package/lib/commonjs/components/executiontasks/forms/widgets/TimeRangeSelector.js.map +1 -1
- package/lib/commonjs/components/executiontasks/httpRequest/HttpEtUtils.js +5 -14
- package/lib/commonjs/components/executiontasks/httpRequest/HttpEtUtils.js.map +1 -1
- package/lib/commonjs/components/executiontasks/httpRequest/HttpRequestET.js +3 -15
- package/lib/commonjs/components/executiontasks/httpRequest/HttpRequestET.js.map +1 -1
- package/lib/commonjs/components/executiontasks/imageCapture/CaptureSchema.js.map +1 -1
- package/lib/commonjs/components/executiontasks/imageCapture/CaptureUtils.js +11 -36
- package/lib/commonjs/components/executiontasks/imageCapture/CaptureUtils.js.map +1 -1
- package/lib/commonjs/components/executiontasks/imageCapture/ImageCapture.js +73 -48
- package/lib/commonjs/components/executiontasks/imageCapture/ImageCapture.js.map +1 -1
- package/lib/commonjs/components/executiontasks/payments/PaymentStyles.js +0 -4
- package/lib/commonjs/components/executiontasks/payments/PaymentStyles.js.map +1 -1
- package/lib/commonjs/components/executiontasks/payments/PaymentUtils.js +0 -2
- package/lib/commonjs/components/executiontasks/payments/PaymentUtils.js.map +1 -1
- package/lib/commonjs/components/executiontasks/payments/completePayment/CompletePaymentET.js +76 -29
- package/lib/commonjs/components/executiontasks/payments/completePayment/CompletePaymentET.js.map +1 -1
- package/lib/commonjs/components/executiontasks/payments/init/InitPaymentET.js +63 -24
- package/lib/commonjs/components/executiontasks/payments/init/InitPaymentET.js.map +1 -1
- package/lib/commonjs/components/executiontasks/payments/processPayment/ProcessPaymentET.js +71 -22
- package/lib/commonjs/components/executiontasks/payments/processPayment/ProcessPaymentET.js.map +1 -1
- package/lib/commonjs/components/executiontasks/pickup/PickupET.js +5 -15
- package/lib/commonjs/components/executiontasks/pickup/PickupET.js.map +1 -1
- package/lib/commonjs/components/executiontasks/pickup/SLPickupET.js +138 -32
- package/lib/commonjs/components/executiontasks/pickup/SLPickupET.js.map +1 -1
- package/lib/commonjs/components/executiontasks/scan/ScanET.js +741 -0
- package/lib/commonjs/components/executiontasks/scan/ScanET.js.map +1 -0
- package/lib/commonjs/components/executiontasks/scan/ScanSchema.js +19 -0
- package/lib/commonjs/components/executiontasks/scan/ScanSchema.js.map +1 -0
- package/lib/commonjs/components/executiontasks/scan/constants.js +19 -0
- package/lib/commonjs/components/executiontasks/scan/constants.js.map +1 -0
- package/lib/commonjs/components/executiontasks/scan/interfaces.js +43 -0
- package/lib/commonjs/components/executiontasks/scan/interfaces.js.map +1 -0
- package/lib/commonjs/components/executiontasks/scan/modalConstant.js +104 -0
- package/lib/commonjs/components/executiontasks/scan/modalConstant.js.map +1 -0
- package/lib/commonjs/components/executiontasks/{scanner → scan/sub_components}/CScanner.js +9 -29
- package/lib/commonjs/components/executiontasks/scan/sub_components/CScanner.js.map +1 -0
- package/lib/commonjs/components/executiontasks/scan/sub_components/DropDownUtils.js +109 -0
- package/lib/commonjs/components/executiontasks/scan/sub_components/DropDownUtils.js.map +1 -0
- package/lib/commonjs/components/executiontasks/{scanner/returns/ReasonDropDown.js → scan/sub_components/ERDropDown.js} +72 -55
- package/lib/commonjs/components/executiontasks/scan/sub_components/ERDropDown.js.map +1 -0
- package/lib/commonjs/components/executiontasks/scan/sub_components/SummaryPage.js +1099 -0
- package/lib/commonjs/components/executiontasks/scan/sub_components/SummaryPage.js.map +1 -0
- package/lib/commonjs/components/executiontasks/scan/utils.js +762 -0
- package/lib/commonjs/components/executiontasks/scan/utils.js.map +1 -0
- package/lib/commonjs/components/executiontasks/validateOTP/ValidateOTPET.js +333 -0
- package/lib/commonjs/components/executiontasks/validateOTP/ValidateOTPET.js.map +1 -0
- package/lib/commonjs/components/executiontasks/validateOTP/ValidateOTPSchema.js +14 -0
- package/lib/commonjs/components/executiontasks/validateOTP/ValidateOTPSchema.js.map +1 -0
- package/lib/commonjs/components/executiontasks/validateOTP/constants.js +37 -0
- package/lib/commonjs/components/executiontasks/validateOTP/constants.js.map +1 -0
- package/lib/commonjs/components/executiontasks/validateOTP/sub-components/OTPInput.js +63 -0
- package/lib/commonjs/components/executiontasks/validateOTP/sub-components/OTPInput.js.map +1 -0
- package/lib/commonjs/components/executiontasks/validateOTP/utils.js +147 -0
- package/lib/commonjs/components/executiontasks/validateOTP/utils.js.map +1 -0
- package/lib/commonjs/components/executiontasks/verifyLocation/GeofenceUtils.js +0 -13
- package/lib/commonjs/components/executiontasks/verifyLocation/GeofenceUtils.js.map +1 -1
- package/lib/commonjs/components/executiontasks/verifyLocation/VerifyLocationET.js +4 -17
- package/lib/commonjs/components/executiontasks/verifyLocation/VerifyLocationET.js.map +1 -1
- package/lib/commonjs/components/executiontasks/verifyOtp/VerifyOtpET.js +3 -18
- package/lib/commonjs/components/executiontasks/verifyOtp/VerifyOtpET.js.map +1 -1
- package/lib/commonjs/components/executiontasks/verifyOtp/VerifyOtpSchema.js.map +1 -1
- package/lib/commonjs/components/utils/index.js +14 -0
- package/lib/commonjs/components/utils/index.js.map +1 -0
- package/lib/commonjs/components/widgets/AlertDisplay.js +0 -5
- package/lib/commonjs/components/widgets/AlertDisplay.js.map +1 -1
- package/lib/commonjs/components/widgets/CancelOrderDialog.js +0 -12
- package/lib/commonjs/components/widgets/CancelOrderDialog.js.map +1 -1
- package/lib/commonjs/components/widgets/Card.js +88 -0
- package/lib/commonjs/components/widgets/Card.js.map +1 -0
- package/lib/commonjs/components/widgets/GoBackModal.js +48 -0
- package/lib/commonjs/components/widgets/GoBackModal.js.map +1 -0
- package/lib/commonjs/components/widgets/IconButton.js +34 -0
- package/lib/commonjs/components/widgets/IconButton.js.map +1 -0
- package/lib/commonjs/components/widgets/ModalWidget.js +99 -0
- package/lib/commonjs/components/widgets/ModalWidget.js.map +1 -0
- package/lib/commonjs/components/widgets/ProgressDialog.js +0 -7
- package/lib/commonjs/components/widgets/ProgressDialog.js.map +1 -1
- package/lib/commonjs/components/widgets/SearchBar.js +74 -0
- package/lib/commonjs/components/widgets/SearchBar.js.map +1 -0
- package/lib/commonjs/components/widgets/SnackBarCustom.js +48 -40
- package/lib/commonjs/components/widgets/SnackBarCustom.js.map +1 -1
- package/lib/commonjs/components/widgets/SplitTextInput.js +93 -0
- package/lib/commonjs/components/widgets/SplitTextInput.js.map +1 -0
- package/lib/commonjs/components/widgets/TabsComponent.js +64 -0
- package/lib/commonjs/components/widgets/TabsComponent.js.map +1 -0
- package/lib/commonjs/components/widgets/Toaster.js +0 -2
- package/lib/commonjs/components/widgets/Toaster.js.map +1 -1
- package/lib/commonjs/config/DispatchSDKConfig.js +4 -5
- package/lib/commonjs/config/DispatchSDKConfig.js.map +1 -1
- package/lib/commonjs/constants/apiConstants.js +17 -0
- package/lib/commonjs/constants/apiConstants.js.map +1 -0
- package/lib/commonjs/constants/constants.js +7 -3
- package/lib/commonjs/constants/constants.js.map +1 -1
- package/lib/commonjs/constants/statuscode.js +3 -5
- package/lib/commonjs/constants/statuscode.js.map +1 -1
- package/lib/commonjs/errors/BaseError.js +3 -8
- package/lib/commonjs/errors/BaseError.js.map +1 -1
- package/lib/commonjs/errors/ErrorCodes.js +7 -6
- package/lib/commonjs/errors/ErrorCodes.js.map +1 -1
- package/lib/commonjs/events/EventDispatcher.js +23 -0
- package/lib/commonjs/events/EventDispatcher.js.map +1 -0
- package/lib/commonjs/events/EventListener.js +20 -0
- package/lib/commonjs/events/EventListener.js.map +1 -0
- package/lib/commonjs/events/constants.js +15 -0
- package/lib/commonjs/events/constants.js.map +1 -0
- package/lib/commonjs/events/index.js +11 -0
- package/lib/commonjs/events/index.js.map +1 -0
- package/lib/commonjs/events/interface.js +2 -0
- package/lib/commonjs/events/interface.js.map +1 -0
- package/lib/commonjs/index.js +40 -35
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/manager/dispatch/DispatchStateContainer.js +328 -272
- package/lib/commonjs/manager/dispatch/DispatchStateContainer.js.map +1 -1
- package/lib/commonjs/manager/dispatchCodes/EventCodeContainer.js +55 -4
- package/lib/commonjs/manager/dispatchCodes/EventCodeContainer.js.map +1 -1
- package/lib/commonjs/manager/dispatchCodes/EventCodeRepo.js +70 -0
- package/lib/commonjs/manager/dispatchCodes/EventCodeRepo.js.map +1 -0
- package/lib/commonjs/manager/dispatchCodes/ReasonCodeContainer.js +3 -29
- package/lib/commonjs/manager/dispatchCodes/ReasonCodeContainer.js.map +1 -1
- package/lib/commonjs/manager/dispatchCodes/ReasonCodeRepo.js +6 -20
- package/lib/commonjs/manager/dispatchCodes/ReasonCodeRepo.js.map +1 -1
- package/lib/commonjs/manager/jobRemoval/JobRemovalManager.js +23 -0
- package/lib/commonjs/manager/jobRemoval/JobRemovalManager.js.map +1 -0
- package/lib/commonjs/manager/location/LocationManager.js +3 -20
- package/lib/commonjs/manager/location/LocationManager.js.map +1 -1
- package/lib/commonjs/manager/sdk/DispatchSDKManager.js +23 -37
- package/lib/commonjs/manager/sdk/DispatchSDKManager.js.map +1 -1
- package/lib/commonjs/manager/sdk/DispatchSdkCache.js +6 -17
- package/lib/commonjs/manager/sdk/DispatchSdkCache.js.map +1 -1
- package/lib/commonjs/manager/sdk/callbacksHandler.js +26 -0
- package/lib/commonjs/manager/sdk/callbacksHandler.js.map +1 -0
- package/lib/commonjs/manager/syncmanager/AppSyncManager.js +26 -46
- package/lib/commonjs/manager/syncmanager/AppSyncManager.js.map +1 -1
- package/lib/commonjs/manager/syncmanager/DBConfig.js +48 -9
- package/lib/commonjs/manager/syncmanager/DBConfig.js.map +1 -1
- package/lib/commonjs/manager/syncmanager/NativeSyncManager.js +0 -2
- package/lib/commonjs/manager/syncmanager/NativeSyncManager.js.map +1 -1
- package/lib/commonjs/manager/syncmanager/constants.js +17 -0
- package/lib/commonjs/manager/syncmanager/constants.js.map +1 -0
- package/lib/commonjs/manager/syncmanager/database.js +28 -12
- package/lib/commonjs/manager/syncmanager/database.js.map +1 -1
- package/lib/commonjs/manager/syncmanager/document/DocumentHttpClient.js +11 -36
- package/lib/commonjs/manager/syncmanager/document/DocumentHttpClient.js.map +1 -1
- package/lib/commonjs/manager/syncmanager/document/DocumentManager.js +8 -26
- package/lib/commonjs/manager/syncmanager/document/DocumentManager.js.map +1 -1
- package/lib/commonjs/manager/syncmanager/document/DocumentSyncManager.js +19 -58
- package/lib/commonjs/manager/syncmanager/document/DocumentSyncManager.js.map +1 -1
- package/lib/commonjs/manager/syncmanager/events/ETEventsManager.js +414 -29
- package/lib/commonjs/manager/syncmanager/events/ETEventsManager.js.map +1 -1
- package/lib/commonjs/manager/syncmanager/events/EventsSyncManager.js +208 -103
- package/lib/commonjs/manager/syncmanager/events/EventsSyncManager.js.map +1 -1
- package/lib/commonjs/manager/syncmanager/events/SyncHttpClient.js +157 -36
- package/lib/commonjs/manager/syncmanager/events/SyncHttpClient.js.map +1 -1
- package/lib/commonjs/models/DispatchModels.js +4 -5
- package/lib/commonjs/models/DispatchModels.js.map +1 -1
- package/lib/commonjs/models/ReasonCodes.js.map +1 -1
- package/lib/commonjs/models/execTasks/ETBaseModels.js +4 -0
- package/lib/commonjs/models/execTasks/ETBaseModels.js.map +1 -1
- package/lib/commonjs/models/execTasks/ETConfig.js +28 -35
- package/lib/commonjs/models/execTasks/ETConfig.js.map +1 -1
- package/lib/commonjs/models/sdk.js +4 -5
- package/lib/commonjs/models/sdk.js.map +1 -1
- package/lib/commonjs/native/signature/SignatureCapture.js +3 -24
- package/lib/commonjs/native/signature/SignatureCapture.js.map +1 -1
- package/lib/commonjs/network/GraphQLClient.js +7 -35
- package/lib/commonjs/network/GraphQLClient.js.map +1 -1
- package/lib/commonjs/network/NetworkClient.js +2 -13
- package/lib/commonjs/network/NetworkClient.js.map +1 -1
- package/lib/commonjs/network/NetworkUtils.js +10 -8
- package/lib/commonjs/network/NetworkUtils.js.map +1 -1
- package/lib/commonjs/network/Queries.js +0 -2
- package/lib/commonjs/network/Queries.js.map +1 -1
- package/lib/commonjs/network/client.js +6 -21
- package/lib/commonjs/network/client.js.map +1 -1
- package/lib/commonjs/res/strings.js.map +1 -1
- package/lib/commonjs/resources/Login.js +4 -15
- package/lib/commonjs/resources/Login.js.map +1 -1
- package/lib/commonjs/resources/network.js +3 -8
- package/lib/commonjs/resources/network.js.map +1 -1
- package/lib/commonjs/styles/SdkColors.js +10 -8
- package/lib/commonjs/styles/SdkColors.js.map +1 -1
- package/lib/commonjs/styles/executionTasks/CommonStyles.js +58 -25
- package/lib/commonjs/styles/executionTasks/CommonStyles.js.map +1 -1
- package/lib/commonjs/ui/screens/CancellationScreen.js +67 -27
- package/lib/commonjs/ui/screens/CancellationScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/CaptureInputScreen.js +15 -16
- package/lib/commonjs/ui/screens/CaptureInputScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/CompleteObjectiveScreen.js +11 -23
- package/lib/commonjs/ui/screens/CompleteObjectiveScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/DeliverScreen.js +30 -17
- package/lib/commonjs/ui/screens/DeliverScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/DisplayScreen.js +17 -13
- package/lib/commonjs/ui/screens/DisplayScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/DoodleScreen.js +17 -20
- package/lib/commonjs/ui/screens/DoodleScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/DropCashScreen.js +43 -31
- package/lib/commonjs/ui/screens/DropCashScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/ETScreensIndex.js +10 -19
- package/lib/commonjs/ui/screens/ETScreensIndex.js.map +1 -1
- package/lib/commonjs/ui/screens/FormsScreen.js +105 -17
- package/lib/commonjs/ui/screens/FormsScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/GeofenceScreen.js +16 -14
- package/lib/commonjs/ui/screens/GeofenceScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/HttpRequestScreen.js +14 -11
- package/lib/commonjs/ui/screens/HttpRequestScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/ImageCaptureScreen.js +38 -17
- package/lib/commonjs/ui/screens/ImageCaptureScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/PaymentScreen.js +28 -29
- package/lib/commonjs/ui/screens/PaymentScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/PickupScreen.js +41 -19
- package/lib/commonjs/ui/screens/PickupScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/ScanScreen.js +121 -0
- package/lib/commonjs/ui/screens/ScanScreen.js.map +1 -0
- package/lib/commonjs/ui/screens/StartWorkFlowScreen.js +64 -38
- package/lib/commonjs/ui/screens/StartWorkFlowScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/ValidateOTPScreen.js +55 -0
- package/lib/commonjs/ui/screens/ValidateOTPScreen.js.map +1 -0
- package/lib/commonjs/ui/screens/WithBaseDispatchScreen.js +0 -10
- package/lib/commonjs/ui/screens/WithBaseDispatchScreen.js.map +1 -1
- package/lib/commonjs/ui/uiConfig/RouteParams.js +24 -1
- package/lib/commonjs/ui/uiConfig/RouteParams.js.map +1 -1
- package/lib/commonjs/utils/ApiUtils.js +129 -0
- package/lib/commonjs/utils/ApiUtils.js.map +1 -0
- package/lib/commonjs/utils/ExecTaskUtils.js +111 -41
- package/lib/commonjs/utils/ExecTaskUtils.js.map +1 -1
- package/lib/commonjs/utils/Logger.js +10 -29
- package/lib/commonjs/utils/Logger.js.map +1 -1
- package/lib/commonjs/utils/NetworkUtil.js +3 -19
- package/lib/commonjs/utils/NetworkUtil.js.map +1 -1
- package/lib/commonjs/utils/SdkUtils.js +2 -31
- package/lib/commonjs/utils/SdkUtils.js.map +1 -1
- package/lib/commonjs/utils/SyncManagerUtils.js +61 -43
- package/lib/commonjs/utils/SyncManagerUtils.js.map +1 -1
- package/lib/commonjs/utils/fcm/FCM.js +59 -11
- package/lib/commonjs/utils/fcm/FCM.js.map +1 -1
- package/lib/commonjs/utils/fcm/FcmUtils.js +82 -21
- package/lib/commonjs/utils/fcm/FcmUtils.js.map +1 -1
- package/lib/commonjs/utils/helper.js +0 -5
- package/lib/commonjs/utils/helper.js.map +1 -1
- package/lib/commonjs/utils/hooks/useModal.js +53 -0
- package/lib/commonjs/utils/hooks/useModal.js.map +1 -0
- package/lib/commonjs/utils/hooks/useTimer.js +44 -0
- package/lib/commonjs/utils/hooks/useTimer.js.map +1 -0
- package/lib/commonjs/utils/loginHelper.js +6 -18
- package/lib/commonjs/utils/loginHelper.js.map +1 -1
- package/lib/commonjs/utils/storage.js +87 -31
- package/lib/commonjs/utils/storage.js.map +1 -1
- package/lib/commonjs/utils/utils.js +8 -11
- package/lib/commonjs/utils/utils.js.map +1 -1
- package/lib/module/@types/assets/index.d.js +2 -0
- package/lib/module/@types/assets/index.d.js.map +1 -0
- package/lib/module/components/dispatch/DispatchExecNavigator.js +50 -32
- package/lib/module/components/dispatch/DispatchExecNavigator.js.map +1 -1
- package/lib/module/components/executiontasks/ExecutionTasksIndex.js +3 -5
- package/lib/module/components/executiontasks/ExecutionTasksIndex.js.map +1 -1
- package/lib/module/components/executiontasks/cancellation/CancelET.js +145 -19
- package/lib/module/components/executiontasks/cancellation/CancelET.js.map +1 -1
- package/lib/module/components/executiontasks/cancellation/CancellationSchema.js.map +1 -1
- package/lib/module/components/executiontasks/captureInput/CaptureText.js +68 -10
- package/lib/module/components/executiontasks/captureInput/CaptureText.js.map +1 -1
- package/lib/module/components/executiontasks/captureInput/utils.js +7 -0
- package/lib/module/components/executiontasks/captureInput/utils.js.map +1 -0
- package/lib/module/components/executiontasks/deliver/DeliverET.js +6 -7
- package/lib/module/components/executiontasks/deliver/DeliverET.js.map +1 -1
- package/lib/module/components/executiontasks/deliver/DeliverETInput.js.map +1 -1
- package/lib/module/components/executiontasks/deliver/SLDeliverET.js +214 -86
- package/lib/module/components/executiontasks/deliver/SLDeliverET.js.map +1 -1
- package/lib/module/components/executiontasks/display/DisplayModalET.js +16 -15
- package/lib/module/components/executiontasks/display/DisplayModalET.js.map +1 -1
- package/lib/module/components/executiontasks/doodle/SignatureET.js +68 -15
- package/lib/module/components/executiontasks/doodle/SignatureET.js.map +1 -1
- package/lib/module/components/executiontasks/dropCash/DropCashET.js +5 -6
- package/lib/module/components/executiontasks/dropCash/DropCashET.js.map +1 -1
- package/lib/module/components/executiontasks/dropCash/SLDropCash.js +75 -20
- package/lib/module/components/executiontasks/dropCash/SLDropCash.js.map +1 -1
- package/lib/module/components/executiontasks/forms/FormGenerator.js +142 -37
- package/lib/module/components/executiontasks/forms/FormGenerator.js.map +1 -1
- package/lib/module/components/executiontasks/forms/widgets/DateTimeWidget.js +3 -15
- package/lib/module/components/executiontasks/forms/widgets/DateTimeWidget.js.map +1 -1
- package/lib/module/components/executiontasks/forms/widgets/DropdownWidget.js +39 -0
- package/lib/module/components/executiontasks/forms/widgets/DropdownWidget.js.map +1 -0
- package/lib/module/components/executiontasks/forms/widgets/QRBarcodeScannerWidget.js +2 -6
- package/lib/module/components/executiontasks/forms/widgets/QRBarcodeScannerWidget.js.map +1 -1
- package/lib/module/components/executiontasks/forms/widgets/TimeRangeSelector.js +0 -3
- package/lib/module/components/executiontasks/forms/widgets/TimeRangeSelector.js.map +1 -1
- package/lib/module/components/executiontasks/httpRequest/HttpEtUtils.js +6 -4
- package/lib/module/components/executiontasks/httpRequest/HttpEtUtils.js.map +1 -1
- package/lib/module/components/executiontasks/httpRequest/HttpRequestET.js +3 -6
- package/lib/module/components/executiontasks/httpRequest/HttpRequestET.js.map +1 -1
- package/lib/module/components/executiontasks/imageCapture/CaptureSchema.js.map +1 -1
- package/lib/module/components/executiontasks/imageCapture/CaptureUtils.js +11 -11
- package/lib/module/components/executiontasks/imageCapture/CaptureUtils.js.map +1 -1
- package/lib/module/components/executiontasks/imageCapture/ImageCapture.js +75 -35
- package/lib/module/components/executiontasks/imageCapture/ImageCapture.js.map +1 -1
- package/lib/module/components/executiontasks/payments/PaymentStyles.js.map +1 -1
- package/lib/module/components/executiontasks/payments/PaymentUtils.js.map +1 -1
- package/lib/module/components/executiontasks/payments/completePayment/CompletePaymentET.js +77 -18
- package/lib/module/components/executiontasks/payments/completePayment/CompletePaymentET.js.map +1 -1
- package/lib/module/components/executiontasks/payments/init/InitPaymentET.js +64 -11
- package/lib/module/components/executiontasks/payments/init/InitPaymentET.js.map +1 -1
- package/lib/module/components/executiontasks/payments/processPayment/ProcessPaymentET.js +72 -11
- package/lib/module/components/executiontasks/payments/processPayment/ProcessPaymentET.js.map +1 -1
- package/lib/module/components/executiontasks/pickup/PickupET.js +5 -6
- package/lib/module/components/executiontasks/pickup/PickupET.js.map +1 -1
- package/lib/module/components/executiontasks/pickup/SLPickupET.js +141 -25
- package/lib/module/components/executiontasks/pickup/SLPickupET.js.map +1 -1
- package/lib/module/components/executiontasks/scan/ScanET.js +732 -0
- package/lib/module/components/executiontasks/scan/ScanET.js.map +1 -0
- package/lib/module/components/executiontasks/scan/ScanSchema.js +17 -0
- package/lib/module/components/executiontasks/scan/ScanSchema.js.map +1 -0
- package/lib/module/components/executiontasks/scan/constants.js +7 -0
- package/lib/module/components/executiontasks/scan/constants.js.map +1 -0
- package/lib/module/components/executiontasks/scan/interfaces.js +33 -0
- package/lib/module/components/executiontasks/scan/interfaces.js.map +1 -0
- package/lib/module/components/executiontasks/scan/modalConstant.js +94 -0
- package/lib/module/components/executiontasks/scan/modalConstant.js.map +1 -0
- package/lib/module/components/executiontasks/{scanner → scan/sub_components}/CScanner.js +9 -16
- package/lib/module/components/executiontasks/scan/sub_components/CScanner.js.map +1 -0
- package/lib/module/components/executiontasks/scan/sub_components/DropDownUtils.js +101 -0
- package/lib/module/components/executiontasks/scan/sub_components/DropDownUtils.js.map +1 -0
- package/lib/module/components/executiontasks/scan/sub_components/ERDropDown.js +107 -0
- package/lib/module/components/executiontasks/scan/sub_components/ERDropDown.js.map +1 -0
- package/lib/module/components/executiontasks/scan/sub_components/SummaryPage.js +1092 -0
- package/lib/module/components/executiontasks/scan/sub_components/SummaryPage.js.map +1 -0
- package/lib/module/components/executiontasks/scan/utils.js +726 -0
- package/lib/module/components/executiontasks/scan/utils.js.map +1 -0
- package/lib/module/components/executiontasks/validateOTP/ValidateOTPET.js +324 -0
- package/lib/module/components/executiontasks/validateOTP/ValidateOTPET.js.map +1 -0
- package/lib/module/components/executiontasks/validateOTP/ValidateOTPSchema.js +8 -0
- package/lib/module/components/executiontasks/validateOTP/ValidateOTPSchema.js.map +1 -0
- package/lib/module/components/executiontasks/validateOTP/constants.js +25 -0
- package/lib/module/components/executiontasks/validateOTP/constants.js.map +1 -0
- package/lib/module/components/executiontasks/validateOTP/sub-components/OTPInput.js +53 -0
- package/lib/module/components/executiontasks/validateOTP/sub-components/OTPInput.js.map +1 -0
- package/lib/module/components/executiontasks/validateOTP/utils.js +133 -0
- package/lib/module/components/executiontasks/validateOTP/utils.js.map +1 -0
- package/lib/module/components/executiontasks/verifyLocation/GeofenceUtils.js +0 -6
- package/lib/module/components/executiontasks/verifyLocation/GeofenceUtils.js.map +1 -1
- package/lib/module/components/executiontasks/verifyLocation/VerifyLocationET.js +4 -3
- package/lib/module/components/executiontasks/verifyLocation/VerifyLocationET.js.map +1 -1
- package/lib/module/components/executiontasks/verifyOtp/VerifyOtpET.js +5 -9
- package/lib/module/components/executiontasks/verifyOtp/VerifyOtpET.js.map +1 -1
- package/lib/module/components/executiontasks/verifyOtp/VerifyOtpSchema.js.map +1 -1
- package/lib/module/components/utils/index.js +8 -0
- package/lib/module/components/utils/index.js.map +1 -0
- package/lib/module/components/widgets/AlertDisplay.js.map +1 -1
- package/lib/module/components/widgets/CancelOrderDialog.js +0 -2
- package/lib/module/components/widgets/CancelOrderDialog.js.map +1 -1
- package/lib/module/components/widgets/Card.js +80 -0
- package/lib/module/components/widgets/Card.js.map +1 -0
- package/lib/module/components/widgets/GoBackModal.js +40 -0
- package/lib/module/components/widgets/GoBackModal.js.map +1 -0
- package/lib/module/components/widgets/IconButton.js +26 -0
- package/lib/module/components/widgets/IconButton.js.map +1 -0
- package/lib/module/components/widgets/ModalWidget.js +92 -0
- package/lib/module/components/widgets/ModalWidget.js.map +1 -0
- package/lib/module/components/widgets/ProgressDialog.js +0 -2
- package/lib/module/components/widgets/ProgressDialog.js.map +1 -1
- package/lib/module/components/widgets/SearchBar.js +66 -0
- package/lib/module/components/widgets/SearchBar.js.map +1 -0
- package/lib/module/components/widgets/SnackBarCustom.js +46 -20
- package/lib/module/components/widgets/SnackBarCustom.js.map +1 -1
- package/lib/module/components/widgets/SplitTextInput.js +84 -0
- package/lib/module/components/widgets/SplitTextInput.js.map +1 -0
- package/lib/module/components/widgets/TabsComponent.js +55 -0
- package/lib/module/components/widgets/TabsComponent.js.map +1 -0
- package/lib/module/components/widgets/Toaster.js.map +1 -1
- package/lib/module/config/DispatchSDKConfig.js +3 -4
- package/lib/module/config/DispatchSDKConfig.js.map +1 -1
- package/lib/module/constants/apiConstants.js +9 -0
- package/lib/module/constants/apiConstants.js.map +1 -0
- package/lib/module/constants/constants.js +4 -2
- package/lib/module/constants/constants.js.map +1 -1
- package/lib/module/constants/statuscode.js +3 -5
- package/lib/module/constants/statuscode.js.map +1 -1
- package/lib/module/errors/BaseError.js +3 -6
- package/lib/module/errors/BaseError.js.map +1 -1
- package/lib/module/errors/ErrorCodes.js +5 -5
- package/lib/module/errors/ErrorCodes.js.map +1 -1
- package/lib/module/events/EventDispatcher.js +16 -0
- package/lib/module/events/EventDispatcher.js.map +1 -0
- package/lib/module/events/EventListener.js +13 -0
- package/lib/module/events/EventListener.js.map +1 -0
- package/lib/module/events/constants.js +8 -0
- package/lib/module/events/constants.js.map +1 -0
- package/lib/module/events/index.js +3 -0
- package/lib/module/events/index.js.map +1 -0
- package/lib/module/events/interface.js +2 -0
- package/lib/module/events/interface.js.map +1 -0
- package/lib/module/index.js +9 -5
- package/lib/module/index.js.map +1 -1
- package/lib/module/manager/dispatch/DispatchStateContainer.js +334 -247
- package/lib/module/manager/dispatch/DispatchStateContainer.js.map +1 -1
- package/lib/module/manager/dispatchCodes/EventCodeContainer.js +52 -2
- package/lib/module/manager/dispatchCodes/EventCodeContainer.js.map +1 -1
- package/lib/module/manager/dispatchCodes/EventCodeRepo.js +61 -0
- package/lib/module/manager/dispatchCodes/EventCodeRepo.js.map +1 -0
- package/lib/module/manager/dispatchCodes/ReasonCodeContainer.js +3 -16
- package/lib/module/manager/dispatchCodes/ReasonCodeContainer.js.map +1 -1
- package/lib/module/manager/dispatchCodes/ReasonCodeRepo.js +6 -14
- package/lib/module/manager/dispatchCodes/ReasonCodeRepo.js.map +1 -1
- package/lib/module/manager/jobRemoval/JobRemovalManager.js +22 -0
- package/lib/module/manager/jobRemoval/JobRemovalManager.js.map +1 -0
- package/lib/module/manager/location/LocationManager.js +3 -14
- package/lib/module/manager/location/LocationManager.js.map +1 -1
- package/lib/module/manager/sdk/DispatchSDKManager.js +23 -15
- package/lib/module/manager/sdk/DispatchSDKManager.js.map +1 -1
- package/lib/module/manager/sdk/DispatchSdkCache.js +6 -13
- package/lib/module/manager/sdk/DispatchSdkCache.js.map +1 -1
- package/lib/module/manager/sdk/callbacksHandler.js +19 -0
- package/lib/module/manager/sdk/callbacksHandler.js.map +1 -0
- package/lib/module/manager/syncmanager/AppSyncManager.js +26 -26
- package/lib/module/manager/syncmanager/AppSyncManager.js.map +1 -1
- package/lib/module/manager/syncmanager/DBConfig.js +41 -7
- package/lib/module/manager/syncmanager/DBConfig.js.map +1 -1
- package/lib/module/manager/syncmanager/NativeSyncManager.js.map +1 -1
- package/lib/module/manager/syncmanager/constants.js +6 -0
- package/lib/module/manager/syncmanager/constants.js.map +1 -0
- package/lib/module/manager/syncmanager/database.js +27 -3
- package/lib/module/manager/syncmanager/database.js.map +1 -1
- package/lib/module/manager/syncmanager/document/DocumentHttpClient.js +11 -24
- package/lib/module/manager/syncmanager/document/DocumentHttpClient.js.map +1 -1
- package/lib/module/manager/syncmanager/document/DocumentManager.js +8 -20
- package/lib/module/manager/syncmanager/document/DocumentManager.js.map +1 -1
- package/lib/module/manager/syncmanager/document/DocumentSyncManager.js +19 -41
- package/lib/module/manager/syncmanager/document/DocumentSyncManager.js.map +1 -1
- package/lib/module/manager/syncmanager/events/ETEventsManager.js +415 -22
- package/lib/module/manager/syncmanager/events/ETEventsManager.js.map +1 -1
- package/lib/module/manager/syncmanager/events/EventsSyncManager.js +209 -82
- package/lib/module/manager/syncmanager/events/EventsSyncManager.js.map +1 -1
- package/lib/module/manager/syncmanager/events/SyncHttpClient.js +152 -24
- package/lib/module/manager/syncmanager/events/SyncHttpClient.js.map +1 -1
- package/lib/module/models/DispatchModels.js +3 -4
- package/lib/module/models/DispatchModels.js.map +1 -1
- package/lib/module/models/ReasonCodes.js.map +1 -1
- package/lib/module/models/execTasks/ETBaseModels.js +1 -1
- package/lib/module/models/execTasks/ETBaseModels.js.map +1 -1
- package/lib/module/models/execTasks/ETConfig.js +22 -29
- package/lib/module/models/execTasks/ETConfig.js.map +1 -1
- package/lib/module/models/sdk.js +3 -4
- package/lib/module/models/sdk.js.map +1 -1
- package/lib/module/native/signature/SignatureCapture.js +3 -18
- package/lib/module/native/signature/SignatureCapture.js.map +1 -1
- package/lib/module/network/GraphQLClient.js +6 -26
- package/lib/module/network/GraphQLClient.js.map +1 -1
- package/lib/module/network/NetworkClient.js +2 -6
- package/lib/module/network/NetworkClient.js.map +1 -1
- package/lib/module/network/NetworkUtils.js +10 -3
- package/lib/module/network/NetworkUtils.js.map +1 -1
- package/lib/module/network/Queries.js.map +1 -1
- package/lib/module/network/client.js +7 -17
- package/lib/module/network/client.js.map +1 -1
- package/lib/module/res/strings.js.map +1 -1
- package/lib/module/resources/Login.js +4 -13
- package/lib/module/resources/Login.js.map +1 -1
- package/lib/module/resources/network.js +3 -6
- package/lib/module/resources/network.js.map +1 -1
- package/lib/module/styles/SdkColors.js +9 -7
- package/lib/module/styles/SdkColors.js.map +1 -1
- package/lib/module/styles/executionTasks/CommonStyles.js +57 -14
- package/lib/module/styles/executionTasks/CommonStyles.js.map +1 -1
- package/lib/module/ui/screens/CancellationScreen.js +68 -15
- package/lib/module/ui/screens/CancellationScreen.js.map +1 -1
- package/lib/module/ui/screens/CaptureInputScreen.js +17 -6
- package/lib/module/ui/screens/CaptureInputScreen.js.map +1 -1
- package/lib/module/ui/screens/CompleteObjectiveScreen.js +12 -8
- package/lib/module/ui/screens/CompleteObjectiveScreen.js.map +1 -1
- package/lib/module/ui/screens/DeliverScreen.js +32 -7
- package/lib/module/ui/screens/DeliverScreen.js.map +1 -1
- package/lib/module/ui/screens/DisplayScreen.js +16 -6
- package/lib/module/ui/screens/DisplayScreen.js.map +1 -1
- package/lib/module/ui/screens/DoodleScreen.js +19 -9
- package/lib/module/ui/screens/DoodleScreen.js.map +1 -1
- package/lib/module/ui/screens/DropCashScreen.js +45 -19
- package/lib/module/ui/screens/DropCashScreen.js.map +1 -1
- package/lib/module/ui/screens/ETScreensIndex.js +3 -2
- package/lib/module/ui/screens/ETScreensIndex.js.map +1 -1
- package/lib/module/ui/screens/FormsScreen.js +104 -9
- package/lib/module/ui/screens/FormsScreen.js.map +1 -1
- package/lib/module/ui/screens/GeofenceScreen.js +15 -6
- package/lib/module/ui/screens/GeofenceScreen.js.map +1 -1
- package/lib/module/ui/screens/HttpRequestScreen.js +15 -5
- package/lib/module/ui/screens/HttpRequestScreen.js.map +1 -1
- package/lib/module/ui/screens/ImageCaptureScreen.js +37 -9
- package/lib/module/ui/screens/ImageCaptureScreen.js.map +1 -1
- package/lib/module/ui/screens/PaymentScreen.js +30 -17
- package/lib/module/ui/screens/PaymentScreen.js.map +1 -1
- package/lib/module/ui/screens/PickupScreen.js +40 -12
- package/lib/module/ui/screens/PickupScreen.js.map +1 -1
- package/lib/module/ui/screens/ScanScreen.js +111 -0
- package/lib/module/ui/screens/ScanScreen.js.map +1 -0
- package/lib/module/ui/screens/StartWorkFlowScreen.js +64 -16
- package/lib/module/ui/screens/StartWorkFlowScreen.js.map +1 -1
- package/lib/module/ui/screens/ValidateOTPScreen.js +45 -0
- package/lib/module/ui/screens/ValidateOTPScreen.js.map +1 -0
- package/lib/module/ui/screens/WithBaseDispatchScreen.js +0 -3
- package/lib/module/ui/screens/WithBaseDispatchScreen.js.map +1 -1
- package/lib/module/ui/uiConfig/RouteParams.js +23 -1
- package/lib/module/ui/uiConfig/RouteParams.js.map +1 -1
- package/lib/module/utils/ApiUtils.js +116 -0
- package/lib/module/utils/ApiUtils.js.map +1 -0
- package/lib/module/utils/ExecTaskUtils.js +110 -31
- package/lib/module/utils/ExecTaskUtils.js.map +1 -1
- package/lib/module/utils/Logger.js +9 -21
- package/lib/module/utils/Logger.js.map +1 -1
- package/lib/module/utils/NetworkUtil.js +3 -15
- package/lib/module/utils/NetworkUtil.js.map +1 -1
- package/lib/module/utils/SdkUtils.js +2 -15
- package/lib/module/utils/SdkUtils.js.map +1 -1
- package/lib/module/utils/SyncManagerUtils.js +62 -14
- package/lib/module/utils/SyncManagerUtils.js.map +1 -1
- package/lib/module/utils/fcm/FCM.js +63 -3
- package/lib/module/utils/fcm/FCM.js.map +1 -1
- package/lib/module/utils/fcm/FcmUtils.js +86 -7
- package/lib/module/utils/fcm/FcmUtils.js.map +1 -1
- package/lib/module/utils/helper.js +0 -3
- package/lib/module/utils/helper.js.map +1 -1
- package/lib/module/utils/hooks/useModal.js +43 -0
- package/lib/module/utils/hooks/useModal.js.map +1 -0
- package/lib/module/utils/hooks/useTimer.js +37 -0
- package/lib/module/utils/hooks/useTimer.js.map +1 -0
- package/lib/module/utils/loginHelper.js +6 -16
- package/lib/module/utils/loginHelper.js.map +1 -1
- package/lib/module/utils/storage.js +86 -29
- package/lib/module/utils/storage.js.map +1 -1
- package/lib/module/utils/utils.js +8 -6
- package/lib/module/utils/utils.js.map +1 -1
- package/lib/typescript/components/dispatch/DispatchExecNavigator.d.ts +2 -2
- package/lib/typescript/components/executiontasks/CompletedWFSchema.d.ts +2 -2
- package/lib/typescript/components/executiontasks/ExecutionTasksIndex.d.ts +6 -7
- package/lib/typescript/components/executiontasks/cancellation/CancelET.d.ts +2 -2
- package/lib/typescript/components/executiontasks/cancellation/CancellationSchema.d.ts +10 -5
- package/lib/typescript/components/executiontasks/captureInput/CaptureInputSchema.d.ts +7 -7
- package/lib/typescript/components/executiontasks/captureInput/CaptureText.d.ts +2 -2
- package/lib/typescript/components/executiontasks/captureInput/utils.d.ts +1 -0
- package/lib/typescript/components/executiontasks/deliver/DeliverET.d.ts +2 -2
- package/lib/typescript/components/executiontasks/deliver/DeliverETInput.d.ts +8 -7
- package/lib/typescript/components/executiontasks/deliver/SLDeliverET.d.ts +3 -3
- package/lib/typescript/components/executiontasks/display/DisplayModalET.d.ts +2 -2
- package/lib/typescript/components/executiontasks/display/DisplaySchema.d.ts +5 -5
- package/lib/typescript/components/executiontasks/doodle/SignatureET.d.ts +2 -2
- package/lib/typescript/components/executiontasks/doodle/SignatureSchema.d.ts +7 -7
- package/lib/typescript/components/executiontasks/dropCash/DropCashET.d.ts +2 -2
- package/lib/typescript/components/executiontasks/dropCash/DropCashSchema.d.ts +2 -2
- package/lib/typescript/components/executiontasks/dropCash/SLDropCash.d.ts +2 -2
- package/lib/typescript/components/executiontasks/forms/FormGenerator.d.ts +2 -2
- package/lib/typescript/components/executiontasks/forms/FormSchema.d.ts +2 -2
- package/lib/typescript/components/executiontasks/forms/widgets/DateTimeWidget.d.ts +3 -3
- package/lib/typescript/components/executiontasks/forms/widgets/DropdownWidget.d.ts +9 -0
- package/lib/typescript/components/executiontasks/forms/widgets/QRBarcodeScannerWidget.d.ts +2 -2
- package/lib/typescript/components/executiontasks/forms/widgets/TimeRangeSelector.d.ts +2 -2
- package/lib/typescript/components/executiontasks/httpRequest/HttpEtUtils.d.ts +1 -1
- package/lib/typescript/components/executiontasks/httpRequest/HttpRequestET.d.ts +2 -2
- package/lib/typescript/components/executiontasks/httpRequest/HttpRequestETSchema.d.ts +6 -6
- package/lib/typescript/components/executiontasks/imageCapture/CaptureSchema.d.ts +17 -11
- package/lib/typescript/components/executiontasks/imageCapture/ImageCapture.d.ts +2 -2
- package/lib/typescript/components/executiontasks/payments/completePayment/CompletePaymentET.d.ts +2 -2
- package/lib/typescript/components/executiontasks/payments/completePayment/CompletePaymentSchema.d.ts +2 -2
- package/lib/typescript/components/executiontasks/payments/init/InitPaymentET.d.ts +2 -2
- package/lib/typescript/components/executiontasks/payments/init/InitPaymentSchema.d.ts +3 -3
- package/lib/typescript/components/executiontasks/payments/processPayment/ProcessPaymentET.d.ts +2 -2
- package/lib/typescript/components/executiontasks/payments/processPayment/ProcessPaymentSchema.d.ts +2 -2
- package/lib/typescript/components/executiontasks/pickup/PickpSchema.d.ts +3 -3
- package/lib/typescript/components/executiontasks/pickup/PickupET.d.ts +2 -2
- package/lib/typescript/components/executiontasks/pickup/SLPickupET.d.ts +3 -3
- package/lib/typescript/components/executiontasks/scan/ScanET.d.ts +16 -0
- package/lib/typescript/components/executiontasks/scan/ScanSchema.d.ts +86 -0
- package/lib/typescript/components/executiontasks/scan/constants.d.ts +6 -0
- package/lib/typescript/components/executiontasks/scan/interfaces.d.ts +94 -0
- package/lib/typescript/components/executiontasks/scan/modalConstant.d.ts +37 -0
- package/lib/typescript/components/executiontasks/{scanner → scan/sub_components}/CScanner.d.ts +1 -1
- package/lib/typescript/components/executiontasks/scan/sub_components/DropDownUtils.d.ts +7 -0
- package/lib/typescript/components/executiontasks/scan/sub_components/ERDropDown.d.ts +17 -0
- package/lib/typescript/components/executiontasks/scan/sub_components/SummaryPage.d.ts +21 -0
- package/lib/typescript/components/executiontasks/scan/utils.d.ts +37 -0
- package/lib/typescript/components/executiontasks/validateOTP/ValidateOTPET.d.ts +4 -0
- package/lib/typescript/components/executiontasks/validateOTP/ValidateOTPSchema.d.ts +54 -0
- package/lib/typescript/components/executiontasks/validateOTP/constants.d.ts +10 -0
- package/lib/typescript/components/executiontasks/validateOTP/sub-components/OTPInput.d.ts +12 -0
- package/lib/typescript/components/executiontasks/validateOTP/utils.d.ts +7 -0
- package/lib/typescript/components/executiontasks/verifyInput/VerifyInputSchema.d.ts +8 -8
- package/lib/typescript/components/executiontasks/verifyLocation/VerifyLocSchema.d.ts +9 -9
- package/lib/typescript/components/executiontasks/verifyLocation/VerifyLocationET.d.ts +2 -2
- package/lib/typescript/components/executiontasks/verifyOtp/VerifyOtpET.d.ts +2 -2
- package/lib/typescript/components/executiontasks/verifyOtp/VerifyOtpSchema.d.ts +6 -6
- package/lib/typescript/components/utils/index.d.ts +2 -0
- package/lib/typescript/components/widgets/CancelOrderDialog.d.ts +2 -2
- package/lib/typescript/components/widgets/Card.d.ts +17 -0
- package/lib/typescript/components/widgets/GoBackModal.d.ts +9 -0
- package/lib/typescript/components/widgets/IconButton.d.ts +9 -0
- package/lib/typescript/components/widgets/ModalWidget.d.ts +30 -0
- package/lib/typescript/components/widgets/ProgressDialog.d.ts +2 -2
- package/lib/typescript/components/widgets/SearchBar.d.ts +10 -0
- package/lib/typescript/components/widgets/SnackBarCustom.d.ts +10 -5
- package/lib/typescript/components/widgets/SplitTextInput.d.ts +12 -0
- package/lib/typescript/components/widgets/TabsComponent.d.ts +15 -0
- package/lib/typescript/constants/apiConstants.d.ts +7 -0
- package/lib/typescript/constants/constants.d.ts +4 -2
- package/lib/typescript/errors/ErrorCodes.d.ts +3 -1
- package/lib/typescript/events/EventDispatcher.d.ts +3 -0
- package/lib/typescript/events/EventListener.d.ts +5 -0
- package/lib/typescript/events/constants.d.ts +7 -0
- package/lib/typescript/events/index.d.ts +2 -0
- package/lib/typescript/events/interface.d.ts +1 -0
- package/lib/typescript/index.d.ts +12 -9
- package/lib/typescript/manager/dispatch/DispatchStateContainer.d.ts +38 -17
- package/lib/typescript/manager/dispatchCodes/EventCodeContainer.d.ts +12 -1
- package/lib/typescript/manager/dispatchCodes/EventCodeRepo.d.ts +13 -0
- package/lib/typescript/manager/jobRemoval/JobRemovalManager.d.ts +0 -0
- package/lib/typescript/manager/sdk/DispatchSdkCache.d.ts +1 -0
- package/lib/typescript/manager/sdk/callbacksHandler.d.ts +13 -0
- package/lib/typescript/manager/syncmanager/AppSyncManager.d.ts +3 -1
- package/lib/typescript/manager/syncmanager/DBConfig.d.ts +80 -4
- package/lib/typescript/manager/syncmanager/constants.d.ts +5 -0
- package/lib/typescript/manager/syncmanager/database.d.ts +5 -0
- package/lib/typescript/manager/syncmanager/document/DocumentManager.d.ts +1 -1
- package/lib/typescript/manager/syncmanager/document/DocumentSyncManager.d.ts +1 -1
- package/lib/typescript/manager/syncmanager/document/models.d.ts +1 -1
- package/lib/typescript/manager/syncmanager/events/ETEventsManager.d.ts +15 -2
- package/lib/typescript/manager/syncmanager/events/EventsSyncManager.d.ts +4 -2
- package/lib/typescript/manager/syncmanager/events/SyncHttpClient.d.ts +6 -3
- package/lib/typescript/models/DispatchModels.d.ts +59 -5
- package/lib/typescript/models/ReasonCodes.d.ts +5 -0
- package/lib/typescript/models/auth.d.ts +1 -1
- package/lib/typescript/models/execTasks/ETBaseModels.d.ts +44 -20
- package/lib/typescript/models/execTasks/ETConfig.d.ts +8 -4
- package/lib/typescript/models/sdk.d.ts +12 -0
- package/lib/typescript/native/signature/SignatureCapture.d.ts +2 -2
- package/lib/typescript/network/NetworkUtils.d.ts +1 -5
- package/lib/typescript/styles/SdkColors.d.ts +2 -0
- package/lib/typescript/styles/executionTasks/CommonStyles.d.ts +50 -5
- package/lib/typescript/ui/screens/CancellationScreen.d.ts +2 -2
- package/lib/typescript/ui/screens/CaptureInputScreen.d.ts +2 -2
- package/lib/typescript/ui/screens/CompleteObjectiveScreen.d.ts +2 -2
- package/lib/typescript/ui/screens/DeliverScreen.d.ts +2 -2
- package/lib/typescript/ui/screens/DisplayScreen.d.ts +2 -2
- package/lib/typescript/ui/screens/DoodleScreen.d.ts +2 -2
- package/lib/typescript/ui/screens/DropCashScreen.d.ts +2 -2
- package/lib/typescript/ui/screens/ETScreensIndex.d.ts +3 -2
- package/lib/typescript/ui/screens/FormsScreen.d.ts +2 -2
- package/lib/typescript/ui/screens/GeofenceScreen.d.ts +2 -2
- package/lib/typescript/ui/screens/HttpRequestScreen.d.ts +1 -1
- package/lib/typescript/ui/screens/ImageCaptureScreen.d.ts +2 -2
- package/lib/typescript/ui/screens/PaymentScreen.d.ts +2 -2
- package/lib/typescript/ui/screens/PickupScreen.d.ts +2 -2
- package/lib/typescript/ui/screens/ScanScreen.d.ts +3 -0
- package/lib/typescript/ui/screens/StartWorkFlowScreen.d.ts +2 -2
- package/lib/typescript/ui/screens/ValidateOTPScreen.d.ts +3 -0
- package/lib/typescript/ui/screens/WithBaseDispatchScreen.d.ts +2 -2
- package/lib/typescript/ui/uiConfig/RouteParams.d.ts +14 -0
- package/lib/typescript/utils/ApiUtils.d.ts +61 -0
- package/lib/typescript/utils/ExecTaskUtils.d.ts +10 -4
- package/lib/typescript/utils/NetworkUtil.d.ts +1 -1
- package/lib/typescript/utils/SyncManagerUtils.d.ts +4 -3
- package/lib/typescript/utils/hooks/useModal.d.ts +6 -0
- package/lib/typescript/utils/hooks/useTimer.d.ts +5 -0
- package/lib/typescript/utils/storage.d.ts +32 -0
- package/package.json +26 -26
- package/tsconfig.json +9 -9
- package/file_unzip.js +0 -5
- package/lib/commonjs/components/executiontasks/doodle/DoodleUtils.js +0 -28
- package/lib/commonjs/components/executiontasks/doodle/DoodleUtils.js.map +0 -1
- package/lib/commonjs/components/executiontasks/scanner/CScanner.js.map +0 -1
- package/lib/commonjs/components/executiontasks/scanner/ScannerSchema.js +0 -32
- package/lib/commonjs/components/executiontasks/scanner/ScannerSchema.js.map +0 -1
- package/lib/commonjs/components/executiontasks/scanner/ScannerUtils.js +0 -193
- package/lib/commonjs/components/executiontasks/scanner/ScannerUtils.js.map +0 -1
- package/lib/commonjs/components/executiontasks/scanner/returns/DropDownSelector.js +0 -20
- package/lib/commonjs/components/executiontasks/scanner/returns/DropDownSelector.js.map +0 -1
- package/lib/commonjs/components/executiontasks/scanner/returns/DropDownUtils.js +0 -49
- package/lib/commonjs/components/executiontasks/scanner/returns/DropDownUtils.js.map +0 -1
- package/lib/commonjs/components/executiontasks/scanner/returns/RTReasonSelection.js +0 -107
- package/lib/commonjs/components/executiontasks/scanner/returns/RTReasonSelection.js.map +0 -1
- package/lib/commonjs/components/executiontasks/scanner/returns/RTScan.js +0 -317
- package/lib/commonjs/components/executiontasks/scanner/returns/RTScan.js.map +0 -1
- package/lib/commonjs/components/executiontasks/scanner/returns/ReasonDropDown.js.map +0 -1
- package/lib/commonjs/components/executiontasks/scanner/returns/ScanList.js +0 -276
- package/lib/commonjs/components/executiontasks/scanner/returns/ScanList.js.map +0 -1
- package/lib/commonjs/ui/screens/RTScanScreen.js +0 -118
- package/lib/commonjs/ui/screens/RTScanScreen.js.map +0 -1
- package/lib/module/components/executiontasks/doodle/DoodleUtils.js +0 -19
- package/lib/module/components/executiontasks/doodle/DoodleUtils.js.map +0 -1
- package/lib/module/components/executiontasks/scanner/CScanner.js.map +0 -1
- package/lib/module/components/executiontasks/scanner/ScannerSchema.js +0 -24
- package/lib/module/components/executiontasks/scanner/ScannerSchema.js.map +0 -1
- package/lib/module/components/executiontasks/scanner/ScannerUtils.js +0 -158
- package/lib/module/components/executiontasks/scanner/ScannerUtils.js.map +0 -1
- package/lib/module/components/executiontasks/scanner/returns/DropDownSelector.js +0 -9
- package/lib/module/components/executiontasks/scanner/returns/DropDownSelector.js.map +0 -1
- package/lib/module/components/executiontasks/scanner/returns/DropDownUtils.js +0 -38
- package/lib/module/components/executiontasks/scanner/returns/DropDownUtils.js.map +0 -1
- package/lib/module/components/executiontasks/scanner/returns/RTReasonSelection.js +0 -86
- package/lib/module/components/executiontasks/scanner/returns/RTReasonSelection.js.map +0 -1
- package/lib/module/components/executiontasks/scanner/returns/RTScan.js +0 -287
- package/lib/module/components/executiontasks/scanner/returns/RTScan.js.map +0 -1
- package/lib/module/components/executiontasks/scanner/returns/ReasonDropDown.js +0 -80
- package/lib/module/components/executiontasks/scanner/returns/ReasonDropDown.js.map +0 -1
- package/lib/module/components/executiontasks/scanner/returns/ScanList.js +0 -253
- package/lib/module/components/executiontasks/scanner/returns/ScanList.js.map +0 -1
- package/lib/module/ui/screens/RTScanScreen.js +0 -93
- package/lib/module/ui/screens/RTScanScreen.js.map +0 -1
- package/lib/typescript/components/executiontasks/doodle/DoodleUtils.d.ts +0 -3
- package/lib/typescript/components/executiontasks/scanner/ScannerSchema.d.ts +0 -75
- package/lib/typescript/components/executiontasks/scanner/ScannerUtils.d.ts +0 -15
- package/lib/typescript/components/executiontasks/scanner/returns/DropDownSelector.d.ts +0 -3
- package/lib/typescript/components/executiontasks/scanner/returns/DropDownUtils.d.ts +0 -3
- package/lib/typescript/components/executiontasks/scanner/returns/RTReasonSelection.d.ts +0 -7
- package/lib/typescript/components/executiontasks/scanner/returns/RTScan.d.ts +0 -4
- package/lib/typescript/components/executiontasks/scanner/returns/ReasonDropDown.d.ts +0 -14
- package/lib/typescript/components/executiontasks/scanner/returns/ScanList.d.ts +0 -17
- package/lib/typescript/ui/screens/RTScanScreen.d.ts +0 -3
- package/mobile-execution-lib-0.6.4.tgz +0 -0
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { StyleSheet, Pressable, Keyboard } from 'react-native';
|
|
2
|
+
import React, { useEffect } from 'react';
|
|
3
|
+
import SplitTextInput from '../../../widgets/SplitTextInput';
|
|
4
|
+
import { Fonts } from '../../../../styles/executionTasks/CommonStyles';
|
|
5
|
+
import { InputType } from '../ValidateOTPSchema';
|
|
6
|
+
import { INVALID_REGEX } from '../constants';
|
|
7
|
+
const OTPInput = props => {
|
|
8
|
+
const maximumCodeLength = props.input.length;
|
|
9
|
+
const keyboardType = props.input.inputType === InputType.NUMBER ? 'number-pad' : 'default';
|
|
10
|
+
useEffect(() => {
|
|
11
|
+
if (props.input.validationRegex && props.otpCode.length === maximumCodeLength) {
|
|
12
|
+
const regex = new RegExp(props.input.validationRegex);
|
|
13
|
+
const hasError = !regex.test(props.otpCode);
|
|
14
|
+
props.setHasError(hasError);
|
|
15
|
+
if (hasError) props.setErrorMessage(INVALID_REGEX);else props.setErrorMessage('');
|
|
16
|
+
}
|
|
17
|
+
}, [props.otpCode]);
|
|
18
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Pressable, {
|
|
19
|
+
onPress: Keyboard.dismiss
|
|
20
|
+
}, /*#__PURE__*/React.createElement(SplitTextInput, {
|
|
21
|
+
styles: styles.text,
|
|
22
|
+
value: props.otpCode,
|
|
23
|
+
onChange: text => {
|
|
24
|
+
if (props.input.validationRegex) {}
|
|
25
|
+
if (props.hasError) {
|
|
26
|
+
props.setErrorMessage('');
|
|
27
|
+
props.setHasError(false);
|
|
28
|
+
}
|
|
29
|
+
props.setOTPCode(text);
|
|
30
|
+
},
|
|
31
|
+
maxLength: maximumCodeLength,
|
|
32
|
+
keyboardType: keyboardType,
|
|
33
|
+
hasError: props.hasError
|
|
34
|
+
})));
|
|
35
|
+
};
|
|
36
|
+
export default OTPInput;
|
|
37
|
+
const styles = StyleSheet.create({
|
|
38
|
+
text: {
|
|
39
|
+
fontFamily: Fonts.IBMPlexSans_400Regular,
|
|
40
|
+
color: '#3D445C',
|
|
41
|
+
fontSize: 20,
|
|
42
|
+
textAlign: 'center'
|
|
43
|
+
},
|
|
44
|
+
errorMessage: {
|
|
45
|
+
marginTop: 16,
|
|
46
|
+
marginHorizontal: 10,
|
|
47
|
+
color: '#DC2626',
|
|
48
|
+
fontFamily: Fonts.IBMPlexSans_400Regular,
|
|
49
|
+
fontSize: 12,
|
|
50
|
+
lineHeight: 16
|
|
51
|
+
}
|
|
52
|
+
});
|
|
53
|
+
//# sourceMappingURL=OTPInput.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["StyleSheet","Pressable","Keyboard","React","useEffect","SplitTextInput","Fonts","InputType","INVALID_REGEX","OTPInput","props","maximumCodeLength","input","length","keyboardType","inputType","NUMBER","validationRegex","otpCode","regex","RegExp","hasError","test","setHasError","setErrorMessage","createElement","Fragment","onPress","dismiss","styles","text","value","onChange","setOTPCode","maxLength","create","fontFamily","IBMPlexSans_400Regular","color","fontSize","textAlign","errorMessage","marginTop","marginHorizontal","lineHeight"],"sources":["OTPInput.tsx"],"sourcesContent":["import { StyleSheet, Pressable, Keyboard } from 'react-native';\nimport React, { useEffect } from 'react';\nimport SplitTextInput from '../../../widgets/SplitTextInput';\nimport { Fonts } from '../../../../styles/executionTasks/CommonStyles';\nimport { InputType, CaptureInput } from '../ValidateOTPSchema';\nimport { INVALID_REGEX } from '../constants';\n\nexport interface OTPInputProps {\n input: CaptureInput;\n otpCode: string;\n setOTPCode: (otpCode: string) => void;\n hasError: boolean;\n setHasError: (hasError: boolean) => void;\n setErrorMessage: (errorMessage: string) => void;\n}\n\nconst OTPInput = (props: OTPInputProps) => {\n const maximumCodeLength = props.input.length;\n const keyboardType =\n props.input.inputType === InputType.NUMBER ? 'number-pad' : 'default';\n\n useEffect(() => {\n if (\n props.input.validationRegex &&\n props.otpCode.length === maximumCodeLength\n ) {\n const regex = new RegExp(props.input.validationRegex);\n const hasError = !regex.test(props.otpCode);\n\n props.setHasError(hasError);\n if (hasError) props.setErrorMessage(INVALID_REGEX);\n else props.setErrorMessage('');\n }\n }, [props.otpCode]);\n\n return (\n <>\n <Pressable onPress={Keyboard.dismiss}>\n <SplitTextInput\n styles={styles.text}\n value={props.otpCode}\n onChange={(text) => {\n if (props.input.validationRegex) {\n }\n if (props.hasError) {\n props.setErrorMessage('');\n props.setHasError(false);\n }\n props.setOTPCode(text);\n }}\n maxLength={maximumCodeLength}\n keyboardType={keyboardType}\n hasError={props.hasError}\n />\n </Pressable>\n </>\n );\n};\n\nexport default OTPInput;\n\nconst styles = StyleSheet.create({\n text: {\n fontFamily: Fonts.IBMPlexSans_400Regular,\n color: '#3D445C',\n fontSize: 20,\n textAlign: 'center',\n },\n errorMessage: {\n marginTop: 16,\n marginHorizontal: 10,\n color: '#DC2626',\n fontFamily: Fonts.IBMPlexSans_400Regular,\n fontSize: 12,\n lineHeight: 16,\n },\n});\n"],"mappings":"AAAA,SAASA,UAAU,EAAEC,SAAS,EAAEC,QAAQ,QAAQ,cAAc;AAC9D,OAAOC,KAAK,IAAIC,SAAS,QAAQ,OAAO;AACxC,OAAOC,cAAc,MAAM,iCAAiC;AAC5D,SAASC,KAAK,QAAQ,gDAAgD;AACtE,SAASC,SAAS,QAAsB,sBAAsB;AAC9D,SAASC,aAAa,QAAQ,cAAc;AAW5C,MAAMC,QAAQ,GAAIC,KAAoB,IAAK;EACzC,MAAMC,iBAAiB,GAAGD,KAAK,CAACE,KAAK,CAACC,MAAM;EAC5C,MAAMC,YAAY,GAChBJ,KAAK,CAACE,KAAK,CAACG,SAAS,KAAKR,SAAS,CAACS,MAAM,GAAG,YAAY,GAAG,SAAS;EAEvEZ,SAAS,CAAC,MAAM;IACd,IACEM,KAAK,CAACE,KAAK,CAACK,eAAe,IAC3BP,KAAK,CAACQ,OAAO,CAACL,MAAM,KAAKF,iBAAiB,EAC1C;MACA,MAAMQ,KAAK,GAAG,IAAIC,MAAM,CAACV,KAAK,CAACE,KAAK,CAACK,eAAe,CAAC;MACrD,MAAMI,QAAQ,GAAG,CAACF,KAAK,CAACG,IAAI,CAACZ,KAAK,CAACQ,OAAO,CAAC;MAE3CR,KAAK,CAACa,WAAW,CAACF,QAAQ,CAAC;MAC3B,IAAIA,QAAQ,EAAEX,KAAK,CAACc,eAAe,CAAChB,aAAa,CAAC,CAAC,KAC9CE,KAAK,CAACc,eAAe,CAAC,EAAE,CAAC;IAChC;EACF,CAAC,EAAE,CAACd,KAAK,CAACQ,OAAO,CAAC,CAAC;EAEnB,oBACEf,KAAA,CAAAsB,aAAA,CAAAtB,KAAA,CAAAuB,QAAA,qBACEvB,KAAA,CAAAsB,aAAA,CAACxB,SAAS;IAAC0B,OAAO,EAAEzB,QAAQ,CAAC0B;EAAQ,gBACnCzB,KAAA,CAAAsB,aAAA,CAACpB,cAAc;IACbwB,MAAM,EAAEA,MAAM,CAACC,IAAK;IACpBC,KAAK,EAAErB,KAAK,CAACQ,OAAQ;IACrBc,QAAQ,EAAGF,IAAI,IAAK;MAClB,IAAIpB,KAAK,CAACE,KAAK,CAACK,eAAe,EAAE,CACjC;MACA,IAAIP,KAAK,CAACW,QAAQ,EAAE;QAClBX,KAAK,CAACc,eAAe,CAAC,EAAE,CAAC;QACzBd,KAAK,CAACa,WAAW,CAAC,KAAK,CAAC;MAC1B;MACAb,KAAK,CAACuB,UAAU,CAACH,IAAI,CAAC;IACxB,CAAE;IACFI,SAAS,EAAEvB,iBAAkB;IAC7BG,YAAY,EAAEA,YAAa;IAC3BO,QAAQ,EAAEX,KAAK,CAACW;EAAS,CAC1B,CACQ,CACX,CAAC;AAEP,CAAC;AAED,eAAeZ,QAAQ;AAEvB,MAAMoB,MAAM,GAAG7B,UAAU,CAACmC,MAAM,CAAC;EAC/BL,IAAI,EAAE;IACJM,UAAU,EAAE9B,KAAK,CAAC+B,sBAAsB;IACxCC,KAAK,EAAE,SAAS;IAChBC,QAAQ,EAAE,EAAE;IACZC,SAAS,EAAE;EACb,CAAC;EACDC,YAAY,EAAE;IACZC,SAAS,EAAE,EAAE;IACbC,gBAAgB,EAAE,EAAE;IACpBL,KAAK,EAAE,SAAS;IAChBF,UAAU,EAAE9B,KAAK,CAAC+B,sBAAsB;IACxCE,QAAQ,EAAE,EAAE;IACZK,UAAU,EAAE;EACd;AACF,CAAC,CAAC"}
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
import * as jsonLogic from 'json-logic-js';
|
|
2
|
+
import { JSONPath } from 'jsonpath-plus';
|
|
3
|
+
import Logger, { LOG_TYPE } from '../../../utils/Logger';
|
|
4
|
+
import { getApiResponse } from '../../../utils/ApiUtils';
|
|
5
|
+
import { DEFAULT_RETRY_CONFIG } from './constants';
|
|
6
|
+
const isDyanmicValue = function (input) {
|
|
7
|
+
if (input.charAt(0) === '{' && input.charAt(1) === '{' && input.charAt(input.length - 1) === '}' && input.charAt(input.length - 2) === '}') return true;else return false;
|
|
8
|
+
};
|
|
9
|
+
export function parseBody(body, userInput) {
|
|
10
|
+
const requestBody = JSON.parse(JSON.stringify(body));
|
|
11
|
+
for (const key in requestBody) {
|
|
12
|
+
if (Object.prototype.hasOwnProperty.call(requestBody, key)) {
|
|
13
|
+
const value = requestBody[key];
|
|
14
|
+
if (typeof value === 'object') {
|
|
15
|
+
requestBody[key] = parseBody(value, userInput);
|
|
16
|
+
} else if (Array.isArray(value)) {
|
|
17
|
+
value.forEach(val => {
|
|
18
|
+
requestBody[key] = parseBody(val, userInput);
|
|
19
|
+
});
|
|
20
|
+
} else {
|
|
21
|
+
if (typeof value === 'string' && isDyanmicValue(value) && value.includes('userInput')) {
|
|
22
|
+
if (value.includes('captureInput')) requestBody[key] = userInput.captureInput;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
return requestBody;
|
|
28
|
+
}
|
|
29
|
+
export function parseKeyValue(array, userInput) {
|
|
30
|
+
array.forEach(item => {
|
|
31
|
+
if (isDyanmicValue(item.value) && item.value.includes('userInput')) {
|
|
32
|
+
if (item.value.includes('captureInput')) item.value = userInput.captureInput;
|
|
33
|
+
}
|
|
34
|
+
});
|
|
35
|
+
return array;
|
|
36
|
+
}
|
|
37
|
+
export const generateOTP = async api => {
|
|
38
|
+
// TESTING
|
|
39
|
+
try {
|
|
40
|
+
const apiData = {
|
|
41
|
+
errorJsonPath: '',
|
|
42
|
+
responseJsonPath: '',
|
|
43
|
+
uri: api.uri,
|
|
44
|
+
httpMethod: api.httpMethod,
|
|
45
|
+
timeout: api.timeout,
|
|
46
|
+
headers: api.headers
|
|
47
|
+
};
|
|
48
|
+
if (api.requestBody) {
|
|
49
|
+
apiData.requestBody = api.requestBody;
|
|
50
|
+
}
|
|
51
|
+
if (api.pathParams) {
|
|
52
|
+
apiData.pathParams = api.pathParams;
|
|
53
|
+
}
|
|
54
|
+
if (api.queryParams) {
|
|
55
|
+
apiData.queryParams = api.queryParams;
|
|
56
|
+
}
|
|
57
|
+
const apiResponse = await getApiResponse(apiData);
|
|
58
|
+
return jsonLogic.apply(api.responseJsonLogic, apiResponse.data);
|
|
59
|
+
} catch (error) {
|
|
60
|
+
Logger.getInstance().logEvent('~ generateOTP', error.message, LOG_TYPE.SDK_ERROR);
|
|
61
|
+
return false;
|
|
62
|
+
}
|
|
63
|
+
};
|
|
64
|
+
export const checkForValidation = async (otp, validation, userInput) => {
|
|
65
|
+
// API
|
|
66
|
+
if (validation.selectedIndex === 0) {
|
|
67
|
+
const otpValue = JSONPath({
|
|
68
|
+
path: '$.userInput.captureInput',
|
|
69
|
+
json: userInput
|
|
70
|
+
})[0];
|
|
71
|
+
try {
|
|
72
|
+
//@ts-ignore
|
|
73
|
+
const api = validation.logic.api;
|
|
74
|
+
const apiData = {
|
|
75
|
+
errorJsonPath: '',
|
|
76
|
+
responseJsonPath: '',
|
|
77
|
+
uri: api.uri,
|
|
78
|
+
httpMethod: api.httpMethod,
|
|
79
|
+
timeout: api.timeout,
|
|
80
|
+
headers: api.headers
|
|
81
|
+
};
|
|
82
|
+
if (api.requestBody) {
|
|
83
|
+
const parsedRequestBody = parseBody(api.requestBody, {
|
|
84
|
+
captureInput: otpValue
|
|
85
|
+
});
|
|
86
|
+
apiData.requestBody = parsedRequestBody;
|
|
87
|
+
}
|
|
88
|
+
if (api.pathParams) {
|
|
89
|
+
parseKeyValue(api.pathParams, {
|
|
90
|
+
captureInput: otpValue
|
|
91
|
+
});
|
|
92
|
+
apiData.pathParams = api.pathParams;
|
|
93
|
+
}
|
|
94
|
+
if (api.queryParams) {
|
|
95
|
+
parseKeyValue(api.queryParams, {
|
|
96
|
+
captureInput: otpValue
|
|
97
|
+
});
|
|
98
|
+
apiData.queryParams = api.queryParams;
|
|
99
|
+
}
|
|
100
|
+
const apiResponse = await getApiResponse(apiData);
|
|
101
|
+
return jsonLogic.apply(api.responseJsonLogic, apiResponse.data);
|
|
102
|
+
} catch (error) {
|
|
103
|
+
Logger.getInstance().logEvent('~ checkForValidation', error.message, LOG_TYPE.SDK_ERROR);
|
|
104
|
+
return false;
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
// Exact Value
|
|
108
|
+
else if (validation.selectedIndex === 1) {
|
|
109
|
+
// @ts-ignore
|
|
110
|
+
const value = validation.logic.value;
|
|
111
|
+
return value == otp;
|
|
112
|
+
}
|
|
113
|
+
// Invalid input received
|
|
114
|
+
else {
|
|
115
|
+
return false;
|
|
116
|
+
}
|
|
117
|
+
};
|
|
118
|
+
export const parseRetryConfig = inputRetryConfig => {
|
|
119
|
+
const retryConfig = DEFAULT_RETRY_CONFIG;
|
|
120
|
+
if (inputRetryConfig) {
|
|
121
|
+
if (inputRetryConfig.buttonTitle) {
|
|
122
|
+
retryConfig.buttonTitle = inputRetryConfig.buttonTitle;
|
|
123
|
+
}
|
|
124
|
+
if (inputRetryConfig.delay) {
|
|
125
|
+
retryConfig.delay = inputRetryConfig.delay;
|
|
126
|
+
}
|
|
127
|
+
if (inputRetryConfig.maxAttempt) {
|
|
128
|
+
retryConfig.maxAttempt = inputRetryConfig.maxAttempt;
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
return retryConfig;
|
|
132
|
+
};
|
|
133
|
+
//# sourceMappingURL=utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["jsonLogic","JSONPath","Logger","LOG_TYPE","getApiResponse","DEFAULT_RETRY_CONFIG","isDyanmicValue","input","charAt","length","parseBody","body","userInput","requestBody","JSON","parse","stringify","key","Object","prototype","hasOwnProperty","call","value","Array","isArray","forEach","val","includes","captureInput","parseKeyValue","array","item","generateOTP","api","apiData","errorJsonPath","responseJsonPath","uri","httpMethod","timeout","headers","pathParams","queryParams","apiResponse","apply","responseJsonLogic","data","error","getInstance","logEvent","message","SDK_ERROR","checkForValidation","otp","validation","selectedIndex","otpValue","path","json","logic","parsedRequestBody","parseRetryConfig","inputRetryConfig","retryConfig","buttonTitle","delay","maxAttempt"],"sources":["utils.ts"],"sourcesContent":["import * as jsonLogic from 'json-logic-js';\nimport { JSONPath } from 'jsonpath-plus';\nimport Logger, { LOG_TYPE } from '../../../utils/Logger';\nimport {\n APIData,\n getApiResponse,\n KeyValueArray,\n} from '../../../utils/ApiUtils';\nimport { DEFAULT_RETRY_CONFIG } from './constants';\nimport type {\n API,\n InputType,\n Validation,\n RetryConfig,\n} from './ValidateOTPSchema';\n\nconst isDyanmicValue = function (input: string) {\n if (\n input.charAt(0) === '{' &&\n input.charAt(1) === '{' &&\n input.charAt(input.length - 1) === '}' &&\n input.charAt(input.length - 2) === '}'\n )\n return true;\n else return false;\n};\n\nexport function parseBody(body: any, userInput: any) {\n const requestBody = JSON.parse(JSON.stringify(body));\n for (const key in requestBody) {\n if (Object.prototype.hasOwnProperty.call(requestBody, key)) {\n const value = requestBody[key];\n if (typeof value === 'object') {\n requestBody[key] = parseBody(value, userInput);\n } else if (Array.isArray(value)) {\n value.forEach((val) => {\n requestBody[key] = parseBody(val, userInput);\n });\n } else {\n if (\n typeof value === 'string' &&\n isDyanmicValue(value) &&\n value.includes('userInput')\n ) {\n if (value.includes('captureInput'))\n requestBody[key] = userInput.captureInput;\n }\n }\n }\n }\n return requestBody;\n}\n\nexport function parseKeyValue(array: KeyValueArray[], userInput: any) {\n array.forEach((item) => {\n if (isDyanmicValue(item.value) && item.value.includes('userInput')) {\n if (item.value.includes('captureInput'))\n item.value = userInput.captureInput;\n }\n });\n return array;\n}\n\nexport const generateOTP = async (api: API) => {\n // TESTING\n try {\n const apiData: APIData = {\n errorJsonPath: '',\n responseJsonPath: '',\n uri: api.uri,\n httpMethod: api.httpMethod,\n timeout: api.timeout,\n headers: api.headers,\n };\n if (api.requestBody) {\n apiData.requestBody = api.requestBody;\n }\n if (api.pathParams) {\n apiData.pathParams = api.pathParams;\n }\n if (api.queryParams) {\n apiData.queryParams = api.queryParams;\n }\n\n const apiResponse = await getApiResponse(apiData);\n\n return jsonLogic.apply(\n <jsonLogic.RulesLogic>api.responseJsonLogic,\n apiResponse.data\n );\n } catch (error: any) {\n Logger.getInstance().logEvent(\n '~ generateOTP',\n error.message,\n LOG_TYPE.SDK_ERROR\n );\n return false;\n }\n};\n\nexport const checkForValidation = async (\n otp: string,\n validation: Validation,\n userInput: any\n): Promise<boolean> => {\n // API\n if (validation.selectedIndex === 0) {\n const otpValue = JSONPath({\n path: '$.userInput.captureInput',\n json: userInput,\n })[0];\n\n try {\n //@ts-ignore\n const api: API = validation.logic.api;\n const apiData: APIData = {\n errorJsonPath: '',\n responseJsonPath: '',\n uri: api.uri,\n httpMethod: api.httpMethod,\n timeout: api.timeout,\n headers: api.headers,\n };\n if (api.requestBody) {\n const parsedRequestBody = parseBody(api.requestBody, {\n captureInput: otpValue,\n });\n apiData.requestBody = parsedRequestBody;\n }\n if (api.pathParams) {\n parseKeyValue(api.pathParams, { captureInput: otpValue });\n apiData.pathParams = api.pathParams;\n }\n if (api.queryParams) {\n parseKeyValue(api.queryParams, { captureInput: otpValue });\n apiData.queryParams = api.queryParams;\n }\n const apiResponse = await getApiResponse(apiData);\n return jsonLogic.apply(\n <jsonLogic.RulesLogic>api.responseJsonLogic,\n apiResponse.data\n );\n } catch (error: any) {\n Logger.getInstance().logEvent(\n '~ checkForValidation',\n error.message,\n LOG_TYPE.SDK_ERROR\n );\n return false;\n }\n }\n // Exact Value\n else if (validation.selectedIndex === 1) {\n // @ts-ignore\n const value: InputType = validation.logic.value;\n return value == otp;\n }\n // Invalid input received\n else {\n return false;\n }\n};\n\nexport const parseRetryConfig = (\n inputRetryConfig: RetryConfig | undefined\n): RetryConfig => {\n const retryConfig: RetryConfig = DEFAULT_RETRY_CONFIG;\n if (inputRetryConfig) {\n if (inputRetryConfig.buttonTitle) {\n retryConfig.buttonTitle = inputRetryConfig.buttonTitle;\n }\n if (inputRetryConfig.delay) {\n retryConfig.delay = inputRetryConfig.delay;\n }\n if (inputRetryConfig.maxAttempt) {\n retryConfig.maxAttempt = inputRetryConfig.maxAttempt;\n }\n }\n return retryConfig;\n};\n"],"mappings":"AAAA,OAAO,KAAKA,SAAS,MAAM,eAAe;AAC1C,SAASC,QAAQ,QAAQ,eAAe;AACxC,OAAOC,MAAM,IAAIC,QAAQ,QAAQ,uBAAuB;AACxD,SAEEC,cAAc,QAET,yBAAyB;AAChC,SAASC,oBAAoB,QAAQ,aAAa;AAQlD,MAAMC,cAAc,GAAG,SAAAA,CAAUC,KAAa,EAAE;EAC9C,IACEA,KAAK,CAACC,MAAM,CAAC,CAAC,CAAC,KAAK,GAAG,IACvBD,KAAK,CAACC,MAAM,CAAC,CAAC,CAAC,KAAK,GAAG,IACvBD,KAAK,CAACC,MAAM,CAACD,KAAK,CAACE,MAAM,GAAG,CAAC,CAAC,KAAK,GAAG,IACtCF,KAAK,CAACC,MAAM,CAACD,KAAK,CAACE,MAAM,GAAG,CAAC,CAAC,KAAK,GAAG,EAEtC,OAAO,IAAI,CAAC,KACT,OAAO,KAAK;AACnB,CAAC;AAED,OAAO,SAASC,SAASA,CAACC,IAAS,EAAEC,SAAc,EAAE;EACnD,MAAMC,WAAW,GAAGC,IAAI,CAACC,KAAK,CAACD,IAAI,CAACE,SAAS,CAACL,IAAI,CAAC,CAAC;EACpD,KAAK,MAAMM,GAAG,IAAIJ,WAAW,EAAE;IAC7B,IAAIK,MAAM,CAACC,SAAS,CAACC,cAAc,CAACC,IAAI,CAACR,WAAW,EAAEI,GAAG,CAAC,EAAE;MAC1D,MAAMK,KAAK,GAAGT,WAAW,CAACI,GAAG,CAAC;MAC9B,IAAI,OAAOK,KAAK,KAAK,QAAQ,EAAE;QAC7BT,WAAW,CAACI,GAAG,CAAC,GAAGP,SAAS,CAACY,KAAK,EAAEV,SAAS,CAAC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C,WAAW,GAAGF,gBAAgB,CAACE,WAAW;IACxD;IACA,IAAIF,gBAAgB,CAACG,KAAK,EAAE;MAC1BF,WAAW,CAACE,KAAK,GAAGH,gBAAgB,CAACG,KAAK;IAC5C;IACA,IAAIH,gBAAgB,CAACI,UAAU,EAAE;MAC/BH,WAAW,CAACG,UAAU,GAAGJ,gBAAgB,CAACI,UAAU;IACtD;EACF;EACA,OAAOH,WAAW;AACpB,CAAC"}
|
|
@@ -6,24 +6,20 @@ export async function verifyLocation(params) {
|
|
|
6
6
|
status
|
|
7
7
|
} = await Location.getForegroundPermissionsAsync();
|
|
8
8
|
let response;
|
|
9
|
-
|
|
10
9
|
if (status === 'granted') {
|
|
11
10
|
response = await geofenceLogic(params);
|
|
12
11
|
} else {
|
|
13
12
|
const {
|
|
14
13
|
status
|
|
15
14
|
} = await Location.requestForegroundPermissionsAsync();
|
|
16
|
-
|
|
17
15
|
if (status === 'granted') {
|
|
18
16
|
response = await geofenceLogic(params);
|
|
19
17
|
} else {
|
|
20
18
|
throw new BaseError(ErrorCodes.LOCATION_PERMISSION_DENIED, 'Location Permission denied');
|
|
21
19
|
}
|
|
22
20
|
}
|
|
23
|
-
|
|
24
21
|
return response;
|
|
25
22
|
}
|
|
26
|
-
|
|
27
23
|
async function geofenceLogic(params) {
|
|
28
24
|
const options = {
|
|
29
25
|
accuracy: Location.Accuracy.Highest
|
|
@@ -37,11 +33,9 @@ async function geofenceLogic(params) {
|
|
|
37
33
|
const theta = longitude - location.coords.longitude;
|
|
38
34
|
const radtheta = Math.PI * theta / 180;
|
|
39
35
|
let dist = Math.sin(radlat1) * Math.sin(radlat2) + Math.cos(radlat1) * Math.cos(radlat2) * Math.cos(radtheta);
|
|
40
|
-
|
|
41
36
|
if (dist > 1) {
|
|
42
37
|
dist = 1;
|
|
43
38
|
}
|
|
44
|
-
|
|
45
39
|
const multiplier = 180 * 60 * 1.1515 * 1.609344 * 1000 / Math.PI;
|
|
46
40
|
dist = Math.acos(dist) * multiplier;
|
|
47
41
|
return params.geolocation.geofencing.radius >= dist;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["Location","BaseError","ErrorCodes","verifyLocation","params","status","getForegroundPermissionsAsync","response","geofenceLogic","requestForegroundPermissionsAsync","LOCATION_PERMISSION_DENIED","options","accuracy","Accuracy","Highest","location","getCurrentPositionAsync","geolocation","coords","latitude","longitude","radlat1","Math","PI","radlat2","theta","radtheta","dist","sin","cos","multiplier","acos","geofencing","radius"],"sources":["GeofenceUtils.ts"],"sourcesContent":["import type { VerifyLocationInput } from './VerifyLocSchema';\nimport * as Location from 'expo-location';\nimport { BaseError } from '../../../errors/BaseError';\nimport ErrorCodes from '../../../errors/ErrorCodes';\n\nexport async function verifyLocation(\n params: VerifyLocationInput\n): Promise<boolean> {\n const { status } = await Location.getForegroundPermissionsAsync();\n let response: boolean;\n if (status === 'granted') {\n response = await geofenceLogic(params);\n } else {\n const { status } = await Location.requestForegroundPermissionsAsync();\n if (status === 'granted') {\n response = await geofenceLogic(params);\n } else {\n throw new BaseError(\n ErrorCodes.LOCATION_PERMISSION_DENIED,\n 'Location Permission denied'\n );\n }\n }\n return response;\n}\n\nasync function geofenceLogic(params: VerifyLocationInput): Promise<boolean> {\n const options = {\n accuracy: Location.Accuracy.Highest,\n };\n const location = await Location.getCurrentPositionAsync(options);\n if (\n params.geolocation.accuracy &&\n location.coords.accuracy &&\n params.geolocation.accuracy < location.coords.accuracy\n )\n return false;\n else {\n const latitude: number = +params.geolocation.latitude;\n const longitude: number = +params.geolocation.longitude;\n const radlat1 = (Math.PI * latitude) / 180;\n const radlat2 = (Math.PI * location.coords.latitude) / 180;\n const theta = longitude - location.coords.longitude;\n const radtheta = (Math.PI * theta) / 180;\n let dist =\n Math.sin(radlat1) * Math.sin(radlat2) +\n Math.cos(radlat1) * Math.cos(radlat2) * Math.cos(radtheta);\n if (dist > 1) {\n dist = 1;\n }\n const multiplier = (180 * 60 * 1.1515 * 1.609344 * 1000) / Math.PI;\n dist = Math.acos(dist) * multiplier;\n return params.geolocation.geofencing.radius >= dist;\n }\n}\n"],"mappings":"AACA,OAAO,KAAKA,
|
|
1
|
+
{"version":3,"names":["Location","BaseError","ErrorCodes","verifyLocation","params","status","getForegroundPermissionsAsync","response","geofenceLogic","requestForegroundPermissionsAsync","LOCATION_PERMISSION_DENIED","options","accuracy","Accuracy","Highest","location","getCurrentPositionAsync","geolocation","coords","latitude","longitude","radlat1","Math","PI","radlat2","theta","radtheta","dist","sin","cos","multiplier","acos","geofencing","radius"],"sources":["GeofenceUtils.ts"],"sourcesContent":["import type { VerifyLocationInput } from './VerifyLocSchema';\nimport * as Location from 'expo-location';\nimport { BaseError } from '../../../errors/BaseError';\nimport ErrorCodes from '../../../errors/ErrorCodes';\n\nexport async function verifyLocation(\n params: VerifyLocationInput\n): Promise<boolean> {\n const { status } = await Location.getForegroundPermissionsAsync();\n let response: boolean;\n if (status === 'granted') {\n response = await geofenceLogic(params);\n } else {\n const { status } = await Location.requestForegroundPermissionsAsync();\n if (status === 'granted') {\n response = await geofenceLogic(params);\n } else {\n throw new BaseError(\n ErrorCodes.LOCATION_PERMISSION_DENIED,\n 'Location Permission denied'\n );\n }\n }\n return response;\n}\n\nasync function geofenceLogic(params: VerifyLocationInput): Promise<boolean> {\n const options = {\n accuracy: Location.Accuracy.Highest,\n };\n const location = await Location.getCurrentPositionAsync(options);\n if (\n params.geolocation.accuracy &&\n location.coords.accuracy &&\n params.geolocation.accuracy < location.coords.accuracy\n )\n return false;\n else {\n const latitude: number = +params.geolocation.latitude;\n const longitude: number = +params.geolocation.longitude;\n const radlat1 = (Math.PI * latitude) / 180;\n const radlat2 = (Math.PI * location.coords.latitude) / 180;\n const theta = longitude - location.coords.longitude;\n const radtheta = (Math.PI * theta) / 180;\n let dist =\n Math.sin(radlat1) * Math.sin(radlat2) +\n Math.cos(radlat1) * Math.cos(radlat2) * Math.cos(radtheta);\n if (dist > 1) {\n dist = 1;\n }\n const multiplier = (180 * 60 * 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CAAChB,MAAM,CAACa,WAAW,CAACG,SAAS;IACvD,MAAMC,OAAO,GAAIC,IAAI,CAACC,EAAE,GAAGJ,QAAQ,GAAI,GAAG;IAC1C,MAAMK,OAAO,GAAIF,IAAI,CAACC,EAAE,GAAGR,QAAQ,CAACG,MAAM,CAACC,QAAQ,GAAI,GAAG;IAC1D,MAAMM,KAAK,GAAGL,SAAS,GAAGL,QAAQ,CAACG,MAAM,CAACE,SAAS;IACnD,MAAMM,QAAQ,GAAIJ,IAAI,CAACC,EAAE,GAAGE,KAAK,GAAI,GAAG;IACxC,IAAIE,IAAI,GACNL,IAAI,CAACM,GAAG,CAACP,OAAO,CAAC,GAAGC,IAAI,CAACM,GAAG,CAACJ,OAAO,CAAC,GACrCF,IAAI,CAACO,GAAG,CAACR,OAAO,CAAC,GAAGC,IAAI,CAACO,GAAG,CAACL,OAAO,CAAC,GAAGF,IAAI,CAACO,GAAG,CAACH,QAAQ,CAAC;IAC5D,IAAIC,IAAI,GAAG,CAAC,EAAE;MACZA,IAAI,GAAG,CAAC;IACV;IACA,MAAMG,UAAU,GAAI,GAAG,GAAG,EAAE,GAAG,MAAM,GAAG,QAAQ,GAAG,IAAI,GAAIR,IAAI,CAACC,EAAE;IAClEI,IAAI,GAAGL,IAAI,CAACS,IAAI,CAACJ,IAAI,CAAC,GAAGG,UAAU;IACnC,OAAO1B,MAAM,CAACa,WAAW,CAACe,UAAU,CAACC,MAAM,IAAIN,IAAI;EACrD;AACF"}
|
|
@@ -9,11 +9,13 @@ import ProgressDialog from '../../widgets/ProgressDialog';
|
|
|
9
9
|
import { BaseError } from '../../../errors/BaseError';
|
|
10
10
|
import { showAlert } from '../../widgets/AlertDisplay';
|
|
11
11
|
import SdkUtils from '../../../utils/SdkUtils';
|
|
12
|
-
|
|
13
12
|
const VerifyLocationET = props => {
|
|
14
13
|
const [geofencing, setGeofencing] = useState(true);
|
|
15
14
|
const submitLocationResponse = useCallback(async response => {
|
|
16
|
-
|
|
15
|
+
var _props$applicableReas, _props$applicableReas2;
|
|
16
|
+
const _appRC = response ? (_props$applicableReas = props.applicableReasons) === null || _props$applicableReas === void 0 ? void 0 : _props$applicableReas.success : (_props$applicableReas2 = props.applicableReasons) === null || _props$applicableReas2 === void 0 ? void 0 : _props$applicableReas2.failure;
|
|
17
|
+
props.onSubmitET({
|
|
18
|
+
...(await getBaseETResponse(EntityCode.VERIFY_LOCATION, response, getEventCodeByET(ExecutionTaskID.VERIFY_LOCATION, response, _appRC), '', props.mergedObjectiveId, ExecutionTaskID.VERIFY_LOCATION))
|
|
17
19
|
});
|
|
18
20
|
}, [props]);
|
|
19
21
|
useEffect(() => {
|
|
@@ -40,6 +42,5 @@ const VerifyLocationET = props => {
|
|
|
40
42
|
label: props.message ?? 'Verifying Location...'
|
|
41
43
|
}));
|
|
42
44
|
};
|
|
43
|
-
|
|
44
45
|
export default VerifyLocationET;
|
|
45
46
|
//# sourceMappingURL=VerifyLocationET.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["View","React","useCallback","useEffect","useState","verifyLocation","getBaseETResponse","getEventCodeByET","EntityCode","ExecutionTaskID","CommonStyles","ProgressDialog","BaseError","showAlert","SdkUtils","VerifyLocationET","props","geofencing","setGeofencing","submitLocationResponse","response","onSubmitET","VERIFY_LOCATION","error","openAppSettings","mainContainer","message"],"sources":["VerifyLocationET.tsx"],"sourcesContent":["import { View } from 'react-native';\nimport React, { useCallback, useEffect, useState } from 'react';\nimport type { VerifyLocationInput } from './VerifyLocSchema';\nimport { verifyLocation } from './GeofenceUtils';\nimport { getBaseETResponse } from '../../../utils/ExecTaskUtils';\nimport { getEventCodeByET } from '../../../manager/dispatchCodes/EventCodeContainer';\nimport {\n EntityCode,\n ExecutionTaskID,\n} from '../../../models/execTasks/ETConfig';\nimport { CommonStyles } from '../../../styles/executionTasks/CommonStyles';\nimport ProgressDialog from '../../widgets/ProgressDialog';\nimport { BaseError } from '../../../errors/BaseError';\nimport { showAlert } from '../../widgets/AlertDisplay';\nimport SdkUtils from '../../../utils/SdkUtils';\n\nconst VerifyLocationET = (props: VerifyLocationInput) => {\n const [geofencing, setGeofencing] = useState(true);\n const submitLocationResponse = useCallback(\n async (response: boolean) => {\n props.onSubmitET({\n ...(await getBaseETResponse(\n EntityCode.VERIFY_LOCATION,\n response,\n getEventCodeByET(ExecutionTaskID.VERIFY_LOCATION, response),\n ''\n )),\n });\n },\n [props]\n );\n useEffect(() => {\n (async () => {\n try {\n let response = await verifyLocation(props);\n await submitLocationResponse(response);\n setGeofencing(false);\n } catch (error: any) {\n if (error instanceof BaseError) {\n showAlert(\n 'Permission Denied',\n 'Please enable Location permissions from settings and Try again',\n false,\n 'Open Settings',\n () => {\n SdkUtils.openAppSettings();\n }\n );\n } else {\n await submitLocationResponse(false);\n }\n }\n })();\n }, []);\n return (\n <View style={CommonStyles.mainContainer}>\n <ProgressDialog\n visible={geofencing}\n label={props.message ?? 'Verifying Location...'}\n />\n </View>\n );\n};\nexport default VerifyLocationET;\n"],"mappings":"AAAA,SAASA,
|
|
1
|
+
{"version":3,"names":["View","React","useCallback","useEffect","useState","verifyLocation","getBaseETResponse","getEventCodeByET","EntityCode","ExecutionTaskID","CommonStyles","ProgressDialog","BaseError","showAlert","SdkUtils","VerifyLocationET","props","geofencing","setGeofencing","submitLocationResponse","response","_props$applicableReas","_props$applicableReas2","_appRC","applicableReasons","success","failure","onSubmitET","VERIFY_LOCATION","mergedObjectiveId","error","openAppSettings","createElement","style","mainContainer","visible","label","message"],"sources":["VerifyLocationET.tsx"],"sourcesContent":["import { View } from 'react-native';\nimport React, { useCallback, useEffect, useState } from 'react';\nimport type { VerifyLocationInput } from './VerifyLocSchema';\nimport { verifyLocation } from './GeofenceUtils';\nimport { getBaseETResponse } from '../../../utils/ExecTaskUtils';\nimport { getEventCodeByET } from '../../../manager/dispatchCodes/EventCodeContainer';\nimport {\n EntityCode,\n ExecutionTaskID,\n} from '../../../models/execTasks/ETConfig';\nimport { CommonStyles } from '../../../styles/executionTasks/CommonStyles';\nimport ProgressDialog from '../../widgets/ProgressDialog';\nimport { BaseError } from '../../../errors/BaseError';\nimport { showAlert } from '../../widgets/AlertDisplay';\nimport SdkUtils from '../../../utils/SdkUtils';\n\nconst VerifyLocationET = (props: VerifyLocationInput) => {\n const [geofencing, setGeofencing] = useState(true);\n const submitLocationResponse = useCallback(\n async (response: boolean) => {\n const _appRC = response\n ? props.applicableReasons?.success\n : props.applicableReasons?.failure;\n props.onSubmitET({\n ...(await getBaseETResponse(\n EntityCode.VERIFY_LOCATION,\n response,\n getEventCodeByET(ExecutionTaskID.VERIFY_LOCATION, response, _appRC),\n '',\n props.mergedObjectiveId,\n ExecutionTaskID.VERIFY_LOCATION\n )),\n });\n },\n [props]\n );\n useEffect(() => {\n (async () => {\n try {\n let response = await verifyLocation(props);\n await submitLocationResponse(response);\n setGeofencing(false);\n } catch (error: any) {\n if (error instanceof BaseError) {\n showAlert(\n 'Permission Denied',\n 'Please enable Location permissions from settings and Try again',\n false,\n 'Open Settings',\n () => {\n SdkUtils.openAppSettings();\n }\n );\n } else {\n await submitLocationResponse(false);\n }\n }\n })();\n }, []);\n return (\n <View style={CommonStyles.mainContainer}>\n <ProgressDialog\n visible={geofencing}\n label={props.message ?? 'Verifying Location...'}\n />\n </View>\n );\n};\nexport default VerifyLocationET;\n"],"mappings":"AAAA,SAASA,IAAI,QAAQ,cAAc;AACnC,OAAOC,KAAK,IAAIC,WAAW,EAAEC,SAAS,EAAEC,QAAQ,QAAQ,OAAO;AAE/D,SAASC,cAAc,QAAQ,iBAAiB;AAChD,SAASC,iBAAiB,QAAQ,8BAA8B;AAChE,SAASC,gBAAgB,QAAQ,mDAAmD;AACpF,SACEC,UAAU,EACVC,eAAe,QACV,oCAAoC;AAC3C,SAASC,YAAY,QAAQ,6CAA6C;AAC1E,OAAOC,cAAc,MAAM,8BAA8B;AACzD,SAASC,SAAS,QAAQ,2BAA2B;AACrD,SAASC,SAAS,QAAQ,4BAA4B;AACtD,OAA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AE,CAAC;EACN,CAAC,EAAE,EAAE,CAAC;EACN,oBACElB,KAAA,CAAA+B,aAAA,CAAChC,IAAI;IAACiC,KAAK,EAAEvB,YAAY,CAACwB;EAAc,gBACtCjC,KAAA,CAAA+B,aAAA,CAACrB,cAAc;IACbwB,OAAO,EAAElB,UAAW;IACpBmB,KAAK,EAAEpB,KAAK,CAACqB,OAAO,IAAI;EAAwB,CACjD,CACG,CAAC;AAEX,CAAC;AACD,eAAetB,gBAAgB"}
|
|
@@ -1,19 +1,16 @@
|
|
|
1
1
|
import { BackHandler, Pressable, StyleSheet, Text, View } from 'react-native';
|
|
2
|
-
import React, { useEffect, useRef } from 'react';
|
|
3
|
-
|
|
2
|
+
import React, { useEffect, useRef } from 'react';
|
|
3
|
+
// @ts-ignore
|
|
4
4
|
import OTPTextView from 'react-native-otp-textinput';
|
|
5
5
|
import { Colors } from 'react-native-paper';
|
|
6
6
|
import { showToast } from '../../widgets/Toaster';
|
|
7
7
|
import { getBaseETResponse } from '../../../utils/ExecTaskUtils';
|
|
8
|
-
import { EntityCode } from '../../../models/execTasks/ETConfig';
|
|
9
|
-
|
|
8
|
+
import { EntityCode, ExecutionTaskID } from '../../../models/execTasks/ETConfig';
|
|
10
9
|
const VerifyOtpET = props => {
|
|
11
10
|
const otpInput = useRef();
|
|
12
|
-
|
|
13
11
|
function backButtonHandler() {
|
|
14
12
|
return true;
|
|
15
13
|
}
|
|
16
|
-
|
|
17
14
|
useEffect(() => {
|
|
18
15
|
BackHandler.addEventListener('hardwareBackPress', backButtonHandler);
|
|
19
16
|
return () => {
|
|
@@ -31,8 +28,8 @@ const VerifyOtpET = props => {
|
|
|
31
28
|
tintColor: Colors.blue300,
|
|
32
29
|
handleTextChange: async value => {
|
|
33
30
|
if (value.length === props.inputCount) {
|
|
34
|
-
|
|
35
|
-
|
|
31
|
+
props.onSubmit({
|
|
32
|
+
...(await getBaseETResponse(EntityCode.VERIFY_INPUT, true, '', '', props.mergedObjectiveId, ExecutionTaskID.VERIFY_INPUT))
|
|
36
33
|
});
|
|
37
34
|
}
|
|
38
35
|
}
|
|
@@ -45,7 +42,6 @@ const VerifyOtpET = props => {
|
|
|
45
42
|
style: styles.sendAgainText
|
|
46
43
|
}, /*#__PURE__*/React.createElement(Text, null, "Send again")))));
|
|
47
44
|
};
|
|
48
|
-
|
|
49
45
|
export default VerifyOtpET;
|
|
50
46
|
const styles = StyleSheet.create({
|
|
51
47
|
backIconView: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["BackHandler","Pressable","StyleSheet","Text","View","React","useEffect","useRef","OTPTextView","Colors","showToast","getBaseETResponse","EntityCode","VerifyOtpET","props","otpInput","backButtonHandler","addEventListener","removeEventListener","styles","otpInputTextView","veriOtpText","otpInputStyle","inputCount","
|
|
1
|
+
{"version":3,"names":["BackHandler","Pressable","StyleSheet","Text","View","React","useEffect","useRef","OTPTextView","Colors","showToast","getBaseETResponse","EntityCode","ExecutionTaskID","VerifyOtpET","props","otpInput","backButtonHandler","addEventListener","removeEventListener","createElement","style","styles","otpInputTextView","veriOtpText","textInputStyle","otpInputStyle","ref","inputCount","tintColor","blue300","handleTextChange","value","length","onSubmit","VERIFY_INPUT","mergedObjectiveId","otpNotReceivedView","onPress","sendAgainText","create","backIconView","marginTop","marginStart","fontSize","color","black","borderRadius","borderWidth","paddingHorizontal","paddingVertical","marginHorizontal","flexDirection"],"sources":["VerifyOtpET.tsx"],"sourcesContent":["import { BackHandler, Pressable, StyleSheet, Text, View } from 'react-native';\nimport React, { useEffect, useRef } from 'react';\n// @ts-ignore\nimport OTPTextView from 'react-native-otp-textinput';\nimport { Colors } from 'react-native-paper';\nimport { showToast } from '../../widgets/Toaster';\nimport type { OtpInputSchema } from './VerifyOtpSchema';\nimport { getBaseETResponse } from '../../../utils/ExecTaskUtils';\nimport {\n EntityCode,\n ExecutionTaskID,\n} from '../../../models/execTasks/ETConfig';\n\nconst VerifyOtpET = (props: OtpInputSchema) => {\n const otpInput = useRef();\n\n function backButtonHandler() {\n return true;\n }\n useEffect(() => {\n BackHandler.addEventListener('hardwareBackPress', backButtonHandler);\n return () => {\n BackHandler.removeEventListener('hardwareBackPress', backButtonHandler);\n };\n }, []);\n\n return (\n <View>\n <View style={styles.otpInputTextView}>\n <Text style={styles.veriOtpText}>Verify OTP</Text>\n <OTPTextView\n textInputStyle={styles.otpInputStyle}\n ref={otpInput}\n inputCount={props.inputCount}\n tintColor={Colors.blue300}\n handleTextChange={async (value: string) => {\n if (value.length === props.inputCount) {\n props.onSubmit({\n ...(await getBaseETResponse(\n EntityCode.VERIFY_INPUT,\n true,\n '',\n '',\n props.mergedObjectiveId,\n ExecutionTaskID.VERIFY_INPUT\n )),\n });\n }\n }}\n />\n <View style={styles.otpNotReceivedView}>\n <Text>Haven't received the sms?</Text>\n\n <Pressable\n onPress={() => {\n showToast('Resending OTP');\n }}\n style={styles.sendAgainText}\n >\n <Text>Send again</Text>\n </Pressable>\n </View>\n </View>\n </View>\n );\n};\nexport default VerifyOtpET;\n\nconst styles = StyleSheet.create({\n backIconView: {\n marginTop: 22,\n marginStart: 22,\n },\n veriOtpText: {\n fontSize: 24,\n color: Colors.black,\n marginTop: 40,\n },\n otpInputStyle: {\n borderRadius: 4,\n borderWidth: 1,\n paddingHorizontal: 16,\n paddingVertical: 12,\n marginTop: 32,\n },\n otpInputTextView: {\n marginHorizontal: 17,\n },\n otpNotReceivedView: {\n flexDirection: 'row',\n marginTop: 10,\n },\n sendAgainText: {\n marginHorizontal: 8,\n },\n});\n"],"mappings":"AAAA,SAASA,WAAW,EAAEC,SAAS,EAAEC,UAAU,EAAEC,IAAI,EAAEC,IAAI,QAAQ,cAAc;AAC7E,OAAOC,KAAK,IAAIC,SAAS,EAAEC,MAAM,QAAQ,OAAO;AAChD;AACA,OAAOC,WAAW,MAAM,4BAA4B;AACpD,SAASC,MAAM,QAAQ,oBAAoB;AAC3C,SAASC,SAAS,QAAQ,uBAAuB;AAEjD,SAASC,iBAAiB,QAAQ,8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,gBACrChC,KAAA,CAAAe,aAAA,CAACjB,IAAI,QAAC,2BAA+B,CAAC,eAEtCE,KAAA,CAAAe,aAAA,CAACnB,SAAS;IACRqC,OAAO,EAAEA,CAAA,KAAM;MACb5B,SAAS,CAAC,eAAe,CAAC;IAC5B,CAAE;IACFW,KAAK,EAAEC,MAAM,CAACiB;EAAc,gBAE5BlC,KAAA,CAAAe,aAAA,CAACjB,IAAI,QAAC,YAAgB,CACb,CACP,CACF,CACF,CAAC;AAEX,CAAC;AACD,eAAeW,WAAW;AAE1B,MAAMQ,MAAM,GAAGpB,UAAU,CAACsC,MAAM,CAAC;EAC/BC,YAAY,EAAE;IACZC,SAAS,EAAE,EAAE;IACbC,WAAW,EAAE;EACf,CAAC;EACDnB,WAAW,EAAE;IACXoB,QAAQ,EAAE,EAAE;IACZC,KAAK,EAAEpC,MAAM,CAACqC,KAAK;IACnBJ,SAAS,EAAE;EACb,CAAC;EACDhB,aAAa,EAAE;IACbqB,YAAY,EAAE,CAAC;IACfC,WAAW,EAAE,CAAC;IACdC,iBAAiB,EAAE,EAAE;IACrBC,eAAe,EAAE,EAAE;IACnBR,SAAS,EAAE;EACb,CAAC;EACDnB,gBAAgB,EAAE;IAChB4B,gBAAgB,EAAE;EACpB,CAAC;EACDd,kBAAkB,EAAE;IAClBe,aAAa,EAAE,KAAK;IACpBV,SAAS,EAAE;EACb,CAAC;EACDH,aAAa,EAAE;IACbY,gBAAgB,EAAE;EACpB;AACF,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["VerifyOtpSchema.ts"],"sourcesContent":["/**\n * Otp entered by user\n */\nimport type {
|
|
1
|
+
{"version":3,"names":[],"sources":["VerifyOtpSchema.ts"],"sourcesContent":["/**\n * Otp entered by user\n */\nimport type {\n BaseETRequest,\n BaseETResponse,\n} from '../../../models/execTasks/ETBaseModels';\n\nexport type InputOtp = string;\n/**\n * Otp Value\n */\nexport type Otp = string;\n\nexport type OtpInputSchema = BaseETRequest & {\n inputCount: number;\n inputOtp: InputOtp;\n otp: Otp;\n onSubmit: (output: OtpOutputSchema) => void;\n};\n\nexport type OtpOutputSchema = BaseETResponse & {\n /**\n * Boolean to represent result of verification\n */\n success: boolean;\n};\n"],"mappings":""}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { GO_BACK_EVENT_CODE } from '../../constants/constants';
|
|
2
|
+
export function hasGoBackConnector(applicableReasons) {
|
|
3
|
+
var _applicableReasons$go;
|
|
4
|
+
if (applicableReasons && applicableReasons.goBack && typeof applicableReasons.goBack === 'object' && (_applicableReasons$go = applicableReasons.goBack) !== null && _applicableReasons$go !== void 0 && _applicableReasons$go.hasOwnProperty(GO_BACK_EVENT_CODE)) {
|
|
5
|
+
return true;
|
|
6
|
+
} else return false;
|
|
7
|
+
}
|
|
8
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["GO_BACK_EVENT_CODE","hasGoBackConnector","applicableReasons","_applicableReasons$go","goBack","hasOwnProperty"],"sources":["index.ts"],"sourcesContent":["import { GO_BACK_EVENT_CODE } from '../../constants/constants';\nimport {\n ApplicableReasons,\n NewApplicableReasons,\n} from '../../models/execTasks/ETBaseModels';\n\nexport function hasGoBackConnector(\n applicableReasons: ApplicableReasons | NewApplicableReasons | undefined\n): boolean {\n if (\n applicableReasons &&\n applicableReasons.goBack &&\n typeof applicableReasons.goBack === 'object' &&\n applicableReasons.goBack?.hasOwnProperty(GO_BACK_EVENT_CODE)\n ) {\n return true;\n } else return false;\n}\n"],"mappings":"AAAA,SAASA,kBAAkB,QAAQ,2BAA2B;AAM9D,OAAO,SAASC,kBAAkBA,CAChCC,iBAAuE,EAC9D;EAAA,IAAAC,qBAAA;EACT,IACED,iBAAiB,IACjBA,iBAAiB,CAACE,MAAM,IACxB,OAAOF,iBAAiB,CAACE,MAAM,KAAK,QAAQ,KAAAD,qBAAA,GAC5CD,iBAAiB,CAACE,MAAM,cAAAD,qBAAA,eAAxBA,qBAAA,CAA0BE,cAAc,CAACL,kBAAkB,CAAC,EAC5D;IACA,OAAO,IAAI;EACb,CAAC,MAAM,OAAO,KAAK;AACrB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["DispatchUtilsInterface","Logger","LOG_TYPE","showAlert","title","message","cancelable","btnPositive","positiveCall","btnNegative","negCall","showAndroidDialog","then","success","catch","error","getInstance","logEvent","SDK_ERROR"],"sources":["AlertDisplay.tsx"],"sourcesContent":["import { DispatchUtilsInterface } from '../../utils/SdkUtils';\nimport Logger, { LOG_TYPE } from '../../utils/Logger';\n\nexport function showAlert(\n title: string,\n message: string,\n cancelable: boolean,\n btnPositive: string,\n positiveCall: () => void,\n btnNegative?: string,\n negCall?: () => void\n) {\n DispatchUtilsInterface.showAndroidDialog(\n title,\n message,\n btnPositive,\n btnNegative ?? null,\n cancelable\n )\n .then((success: boolean) => {\n if (success) positiveCall();\n else if (negCall) {\n negCall();\n }\n })\n .catch((error: { message: string }) => {\n Logger.getInstance().logEvent('error', error.message, LOG_TYPE.SDK_ERROR);\n });\n}\n"],"mappings":"AAAA,SAASA,
|
|
1
|
+
{"version":3,"names":["DispatchUtilsInterface","Logger","LOG_TYPE","showAlert","title","message","cancelable","btnPositive","positiveCall","btnNegative","negCall","showAndroidDialog","then","success","catch","error","getInstance","logEvent","SDK_ERROR"],"sources":["AlertDisplay.tsx"],"sourcesContent":["import { DispatchUtilsInterface } from '../../utils/SdkUtils';\nimport Logger, { LOG_TYPE } from '../../utils/Logger';\n\nexport function showAlert(\n title: string,\n message: string,\n cancelable: boolean,\n btnPositive: string,\n positiveCall: () => void,\n btnNegative?: string,\n negCall?: () => void\n) {\n DispatchUtilsInterface.showAndroidDialog(\n title,\n message,\n btnPositive,\n btnNegative ?? null,\n cancelable\n )\n .then((success: boolean) => {\n if (success) positiveCall();\n else if (negCall) {\n negCall();\n }\n })\n .catch((error: { message: string }) => {\n Logger.getInstance().logEvent('error', error.message, LOG_TYPE.SDK_ERROR);\n });\n}\n"],"mappings":"AAAA,SAASA,sBAAsB,QAAQ,sBAAsB;AAC7D,OAAOC,MAAM,IAAIC,QAAQ,QAAQ,oBAAoB;AAErD,OAAO,SAASC,SAASA,CACvBC,KAAa,EACbC,OAAe,EACfC,UAAmB,EACnBC,WAAmB,EACnBC,YAAwB,EACxBC,WAAoB,EACpBC,OAAoB,EACpB;EACAV,sBAAsB,CAACW,iBAAiB,CACtCP,KAAK,EACLC,OAAO,EACPE,WAAW,EACXE,WAAW,IAAI,IAAI,EACnBH,UACF,CAAC,CACEM,IAAI,CAAEC,OAAgB,IAAK;IAC1B,IAAIA,OAAO,EAAEL,YAAY,CAAC,CAAC,CAAC,KACvB,IAAIE,OAAO,EAAE;MAChBA,OAAO,CAAC,CAAC;IACX;EACF,CAAC,CAAC,CACDI,KAAK,CAAEC,KAA0B,IAAK;IACrCd,MAAM,CAACe,WAAW,CAAC,CAAC,CAACC,QAAQ,CAAC,OAAO,EAAEF,KAAK,CAACV,OAAO,EAAEH,QAAQ,CAACgB,SAAS,CAAC;EAC3E,CAAC,CAAC;AACN"}
|
|
@@ -4,7 +4,6 @@ import { CommonStyles, Fonts } from '../../styles/executionTasks/CommonStyles';
|
|
|
4
4
|
import { Button, Paragraph, Title } from 'react-native-paper';
|
|
5
5
|
import Icon from 'react-native-vector-icons/MaterialCommunityIcons';
|
|
6
6
|
import SdkColors, { ColorTheme } from '../../styles/SdkColors';
|
|
7
|
-
|
|
8
7
|
const CancelOrderDialog = props => {
|
|
9
8
|
return /*#__PURE__*/React.createElement(Modal, {
|
|
10
9
|
animationType: "none",
|
|
@@ -62,7 +61,6 @@ const CancelOrderDialog = props => {
|
|
|
62
61
|
testID: "secondary"
|
|
63
62
|
}, props.negativeButtonTitle ?? 'No')))));
|
|
64
63
|
};
|
|
65
|
-
|
|
66
64
|
const styles = StyleSheet.create({
|
|
67
65
|
content: {
|
|
68
66
|
backgroundColor: 'white',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","Modal","StyleSheet","View","CommonStyles","Fonts","Button","Paragraph","Title","Icon","SdkColors","ColorTheme","CancelOrderDialog","props","visible","styles","wrapper","content","showIcon","iconName","alignSelf","LIGHT","primaryButton","fontFamily","IBMPlexSans_600SemiBold","marginTop","marginBottom","textAlign","
|
|
1
|
+
{"version":3,"names":["React","Modal","StyleSheet","View","CommonStyles","Fonts","Button","Paragraph","Title","Icon","SdkColors","ColorTheme","CancelOrderDialog","props","createElement","animationType","transparent","visible","onRequestClose","style","styles","wrapper","content","showIcon","iconName","alignSelf","size","name","color","LIGHT","primaryButton","fontFamily","IBMPlexSans_600SemiBold","marginTop","marginBottom","textAlign","label","message","fontSize","IBMPlexSans_400Regular","mode","uppercase","labelStyle","nextButtonLabel","nextButton","onPress","onSubmit","testID","positiveButtonTitle","cancelButtonLabel","cancelButton","negativeButtonTitle","create","backgroundColor","padding","borderRadius","width","flex","alignItems","justifyContent"],"sources":["CancelOrderDialog.tsx"],"sourcesContent":["import React from 'react';\nimport { Modal, StyleSheet, View } from 'react-native';\nimport { CommonStyles, Fonts } from '../../styles/executionTasks/CommonStyles';\nimport { Button, Paragraph, Title } from 'react-native-paper';\nimport Icon from 'react-native-vector-icons/MaterialCommunityIcons';\nimport SdkColors, { ColorTheme } from '../../styles/SdkColors';\n\nconst CancelOrderDialog = (props: CancelDialogProps) => {\n return (\n <Modal\n animationType=\"none\"\n transparent={true}\n visible={props.visible}\n onRequestClose={() => {}}\n >\n <View style={styles.wrapper}>\n <View style={styles.content}>\n {props.showIcon && props.iconName && (\n <Icon\n style={{ alignSelf: 'center' }}\n size={34}\n name={props.iconName}\n color={SdkColors[ColorTheme.LIGHT].primaryButton}\n />\n )}\n <Title\n style={{\n fontFamily: Fonts.IBMPlexSans_600SemiBold,\n marginTop: 0,\n marginBottom: 15,\n textAlign: 'center',\n color: '#000000',\n }}\n >\n {props.label ?? 'Cancel Order'}\n </Title>\n {props.message && (\n <Paragraph\n style={{\n textAlign: 'center',\n fontSize: 14,\n fontFamily: Fonts.IBMPlexSans_400Regular,\n }}\n >\n {props.message}\n </Paragraph>\n )}\n <View style={{ marginTop: 20 }}>\n <Button\n mode={'outlined'}\n uppercase={false}\n labelStyle={CommonStyles.nextButtonLabel}\n style={CommonStyles.nextButton}\n onPress={() => {\n props.onSubmit(true);\n }}\n testID=\"primary\"\n >\n {props.positiveButtonTitle ?? 'Yes'}\n </Button>\n <Button\n uppercase={false}\n mode={'outlined'}\n labelStyle={CommonStyles.cancelButtonLabel}\n style={[CommonStyles.cancelButton, { marginTop: 10 }]}\n onPress={async () => {\n props.onSubmit(false);\n }}\n testID=\"secondary\"\n >\n {props.negativeButtonTitle ?? 'No'}\n </Button>\n </View>\n </View>\n </View>\n </Modal>\n );\n};\n\nconst styles = StyleSheet.create({\n content: {\n backgroundColor: 'white',\n padding: 20,\n borderRadius: 5,\n width: '80%',\n },\n wrapper: {\n flex: 1,\n alignItems: 'center',\n justifyContent: 'center',\n backgroundColor: 'rgba(0,0,0,0.7)',\n },\n});\n\nexport default CancelOrderDialog;\n\nexport interface CancelDialogProps {\n visible: boolean;\n onSubmit: (success: boolean) => void;\n label?: string;\n message?: string;\n positiveButtonTitle?: string;\n negativeButtonTitle?: string;\n showIcon?: boolean;\n iconName?: string;\n}\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,KAAK,EAAEC,UAAU,EAAEC,IAAI,QAAQ,cAAc;AACtD,SAASC,YAAY,EAAEC,KAAK,QAAQ,0CAA0C;AAC9E,SAASC,MAAM,EAAEC,SAAS,EAAEC,KAAK,QAAQ,oBAAoB;AAC7D,OAAOC,IAAI,MAAM,kDAAkD;AACnE,OAAOC,SAAS,IAAIC,UAAU,QAAQ,wBAAwB;AAE9D,MAAMC,iBAAiB,GAAIC,KAAwB,IAAK;EACtD,oBACEb,KAAA,CAAAc,aAAA,CAACb,KAAK;IACJc,aAAa,EAAC,MAAM;IACpBC,WAAW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AAgB;IACzCxB,KAAK,EAAEf,YAAY,CAACwC,UAAW;IAC/BC,OAAO,EAAEA,CAAA,KAAM;MACbhC,KAAK,CAACiC,QAAQ,CAAC,IAAI,CAAC;IACtB,CAAE;IACFC,MAAM,EAAC;EAAS,GAEflC,KAAK,CAACmC,mBAAmB,IAAI,KACxB,CAAC,eACThD,KAAA,CAAAc,aAAA,CAACR,MAAM;IACLmC,SAAS,EAAE,KAAM;IACjBD,IAAI,EAAE,UAAW;IACjBE,UAAU,EAAEtC,YAAY,CAAC6C,iBAAkB;IAC3C9B,KAAK,EAAE,CAACf,YAAY,CAAC8C,YAAY,EAAE;MAAEjB,SAAS,EAAE;IAAG,CAAC,CAAE;IACtDY,OAAO,EAAE,MAAAA,CAAA,KAAY;MACnBhC,KAAK,CAACiC,QAAQ,CAAC,KAAK,CAAC;IACvB,CAAE;IACFC,MAAM,EAAC;EAAW,GAEjBlC,KAAK,CAACsC,mBAAmB,IAAI,IACxB,CACJ,CACF,CACF,CACD,CAAC;AAEZ,CAAC;AAED,MAAM/B,MAAM,GAAGlB,UAAU,CAACkD,MAAM,CAAC;EAC/B9B,OAAO,EAAE;IACP+B,eAAe,EAAE,OAAO;IACxBC,OAAO,EAAE,EAAE;IACXC,YAAY,EAAE,CAAC;IACfC,KAAK,EAAE;EACT,CAAC;EACDnC,OAAO,EAAE;IACPoC,IAAI,EAAE,CAAC;IACPC,UAAU,EAAE,QAAQ;IACpBC,cAAc,EAAE,QAAQ;IACxBN,eAAe,EAAE;EACnB;AACF,CAAC,CAAC;AAEF,eAAezC,iBAAiB"}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { View, Text, StyleSheet, TouchableOpacity } from 'react-native';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { Checkbox } from 'react-native-paper';
|
|
4
|
+
import { Feather } from '@expo/vector-icons';
|
|
5
|
+
const Card = props => {
|
|
6
|
+
var _props$selectConfig, _props$renderAddition;
|
|
7
|
+
const isSelected = (_props$selectConfig = props.selectConfig) !== null && _props$selectConfig !== void 0 && _props$selectConfig.isSelected ? 'checked' : 'unchecked';
|
|
8
|
+
return /*#__PURE__*/React.createElement(View, {
|
|
9
|
+
style: styles.container
|
|
10
|
+
}, props.selectConfig ? /*#__PURE__*/React.createElement(View, null, /*#__PURE__*/React.createElement(Checkbox, {
|
|
11
|
+
status: isSelected,
|
|
12
|
+
onPress: () => {
|
|
13
|
+
var _props$selectConfig2, _props$selectConfig3;
|
|
14
|
+
(_props$selectConfig2 = props.selectConfig) === null || _props$selectConfig2 === void 0 ? void 0 : _props$selectConfig2.onSelect((_props$selectConfig3 = props.selectConfig) === null || _props$selectConfig3 === void 0 ? void 0 : _props$selectConfig3.props);
|
|
15
|
+
},
|
|
16
|
+
theme: {
|
|
17
|
+
roundness: 5
|
|
18
|
+
}
|
|
19
|
+
})) : null, /*#__PURE__*/React.createElement(View, {
|
|
20
|
+
style: styles.body
|
|
21
|
+
}, /*#__PURE__*/React.createElement(View, {
|
|
22
|
+
style: styles.header
|
|
23
|
+
}, /*#__PURE__*/React.createElement(Text, {
|
|
24
|
+
style: styles.title
|
|
25
|
+
}, props.title), (_props$renderAddition = props.renderAdditionalHeader) === null || _props$renderAddition === void 0 ? void 0 : _props$renderAddition.call(props)), props.Body), props.editConfig ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(View, {
|
|
26
|
+
style: styles.divider
|
|
27
|
+
}), /*#__PURE__*/React.createElement(TouchableOpacity, {
|
|
28
|
+
onPress: () => {
|
|
29
|
+
var _props$editConfig, _props$editConfig2;
|
|
30
|
+
return (_props$editConfig = props.editConfig) === null || _props$editConfig === void 0 ? void 0 : _props$editConfig.onEdit((_props$editConfig2 = props.editConfig) === null || _props$editConfig2 === void 0 ? void 0 : _props$editConfig2.props);
|
|
31
|
+
},
|
|
32
|
+
style: styles.icon
|
|
33
|
+
}, /*#__PURE__*/React.createElement(Feather, {
|
|
34
|
+
name: "edit",
|
|
35
|
+
size: 24,
|
|
36
|
+
color: "#5B80F7"
|
|
37
|
+
}))) : null);
|
|
38
|
+
};
|
|
39
|
+
export default Card;
|
|
40
|
+
const styles = StyleSheet.create({
|
|
41
|
+
container: {
|
|
42
|
+
flexDirection: 'row',
|
|
43
|
+
justifyContent: 'flex-start',
|
|
44
|
+
alignItems: 'flex-start',
|
|
45
|
+
paddingVertical: 12,
|
|
46
|
+
paddingHorizontal: 16,
|
|
47
|
+
marginVertical: 10,
|
|
48
|
+
marginHorizontal: 16,
|
|
49
|
+
borderWidth: 1,
|
|
50
|
+
borderColor: '#E0E3EB',
|
|
51
|
+
borderRadius: 8
|
|
52
|
+
// height: 150,
|
|
53
|
+
},
|
|
54
|
+
|
|
55
|
+
header: {
|
|
56
|
+
flexDirection: 'row',
|
|
57
|
+
alignItems: 'center'
|
|
58
|
+
},
|
|
59
|
+
body: {
|
|
60
|
+
flex: 1
|
|
61
|
+
},
|
|
62
|
+
title: {
|
|
63
|
+
fontSize: 16,
|
|
64
|
+
fontStyle: 'normal',
|
|
65
|
+
fontWeight: '500',
|
|
66
|
+
lineHeight: 24,
|
|
67
|
+
marginRight: 8
|
|
68
|
+
},
|
|
69
|
+
divider: {
|
|
70
|
+
height: '90%',
|
|
71
|
+
width: 2,
|
|
72
|
+
backgroundColor: '#E0E3EB',
|
|
73
|
+
alignSelf: 'center'
|
|
74
|
+
},
|
|
75
|
+
icon: {
|
|
76
|
+
alignSelf: 'center',
|
|
77
|
+
margin: 10
|
|
78
|
+
}
|
|
79
|
+
});
|
|
80
|
+
//# sourceMappingURL=Card.js.map
|