@os1-platform/dispatch-mobile 2.1.22 → 2.1.24
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 +122 -11
- package/lib/commonjs/analytics/firebase/FirebaseLogging.js +1 -4
- package/lib/commonjs/analytics/firebase/FirebaseLogging.js.map +1 -1
- package/lib/commonjs/analytics/sentry/SentryAnalyticsSingleton.js +5 -5
- package/lib/commonjs/analytics/sentry/SentryAnalyticsSingleton.js.map +1 -1
- package/lib/commonjs/analytics/sentry/SentryAnalyticsUtils.js +9 -16
- package/lib/commonjs/analytics/sentry/SentryAnalyticsUtils.js.map +1 -1
- package/lib/commonjs/components/dispatch/DispatchExecNavigator.js +16 -6
- package/lib/commonjs/components/dispatch/DispatchExecNavigator.js.map +1 -1
- package/lib/commonjs/components/executiontasks/ExecutionTasksIndex.js +8 -1
- package/lib/commonjs/components/executiontasks/ExecutionTasksIndex.js.map +1 -1
- package/lib/commonjs/components/executiontasks/cancellation/CancelET.js +8 -10
- package/lib/commonjs/components/executiontasks/cancellation/CancelET.js.map +1 -1
- package/lib/commonjs/components/executiontasks/captureInput/CaptureText.js +2 -2
- package/lib/commonjs/components/executiontasks/captureInput/CaptureText.js.map +1 -1
- package/lib/commonjs/components/executiontasks/collectPayment/CollectPayment.js +40 -0
- package/lib/commonjs/components/executiontasks/collectPayment/CollectPayment.js.map +1 -0
- package/lib/commonjs/components/executiontasks/collectPayment/CollectPaymentSchema.js +35 -0
- package/lib/commonjs/components/executiontasks/collectPayment/CollectPaymentSchema.js.map +1 -0
- package/lib/commonjs/components/executiontasks/collectPayment/PaymentStyles.js +102 -0
- package/lib/commonjs/components/executiontasks/collectPayment/PaymentStyles.js.map +1 -0
- package/lib/commonjs/components/executiontasks/collectPayment/PaymentUtils.js +151 -0
- package/lib/commonjs/components/executiontasks/collectPayment/PaymentUtils.js.map +1 -0
- package/lib/commonjs/components/executiontasks/collectPayment/components/CompletePayment.js +188 -0
- package/lib/commonjs/components/executiontasks/collectPayment/components/CompletePayment.js.map +1 -0
- package/lib/commonjs/components/executiontasks/collectPayment/components/CustomContactsModal.js +2 -0
- package/lib/commonjs/components/executiontasks/collectPayment/components/CustomContactsModal.js.map +1 -0
- package/lib/commonjs/components/executiontasks/collectPayment/components/InitPayment.js +442 -0
- package/lib/commonjs/components/executiontasks/collectPayment/components/InitPayment.js.map +1 -0
- package/lib/commonjs/components/executiontasks/collectPayment/components/PaymentContactDetails.js +538 -0
- package/lib/commonjs/components/executiontasks/collectPayment/components/PaymentContactDetails.js.map +1 -0
- package/lib/commonjs/components/executiontasks/collectPayment/components/ProcessPayment.js +887 -0
- package/lib/commonjs/components/executiontasks/collectPayment/components/ProcessPayment.js.map +1 -0
- package/lib/commonjs/components/executiontasks/deliver/DeliverET.js +14 -20
- package/lib/commonjs/components/executiontasks/deliver/DeliverET.js.map +1 -1
- package/lib/commonjs/components/executiontasks/deliver/SLDeliverET.js +24 -27
- package/lib/commonjs/components/executiontasks/deliver/SLDeliverET.js.map +1 -1
- package/lib/commonjs/components/executiontasks/display/DisplayModalET.js +1 -1
- package/lib/commonjs/components/executiontasks/display/DisplayModalET.js.map +1 -1
- package/lib/commonjs/components/executiontasks/doodle/SignatureET.js +2 -3
- package/lib/commonjs/components/executiontasks/doodle/SignatureET.js.map +1 -1
- package/lib/commonjs/components/executiontasks/dropCash/DropCashET.js +1 -1
- package/lib/commonjs/components/executiontasks/dropCash/DropCashET.js.map +1 -1
- package/lib/commonjs/components/executiontasks/dropCash/SLDropCash.js +9 -3
- package/lib/commonjs/components/executiontasks/dropCash/SLDropCash.js.map +1 -1
- package/lib/commonjs/components/executiontasks/forms/FormGenerator.js +2 -2
- package/lib/commonjs/components/executiontasks/forms/FormGenerator.js.map +1 -1
- package/lib/commonjs/components/executiontasks/forms/widgets/DateTimeWidget.js +13 -14
- package/lib/commonjs/components/executiontasks/forms/widgets/DateTimeWidget.js.map +1 -1
- package/lib/commonjs/components/executiontasks/forms/widgets/DropdownWidget.js +2 -2
- package/lib/commonjs/components/executiontasks/forms/widgets/DropdownWidget.js.map +1 -1
- package/lib/commonjs/components/executiontasks/forms/widgets/QRBarcodeScannerWidget.js +11 -12
- package/lib/commonjs/components/executiontasks/forms/widgets/QRBarcodeScannerWidget.js.map +1 -1
- package/lib/commonjs/components/executiontasks/forms/widgets/TimeRangeSelector.js +3 -3
- package/lib/commonjs/components/executiontasks/forms/widgets/TimeRangeSelector.js.map +1 -1
- package/lib/commonjs/components/executiontasks/httpRequest/HttpEtUtils.js +1 -1
- package/lib/commonjs/components/executiontasks/httpRequest/HttpEtUtils.js.map +1 -1
- package/lib/commonjs/components/executiontasks/httpRequest/HttpRequestET.js +2 -2
- package/lib/commonjs/components/executiontasks/httpRequest/HttpRequestET.js.map +1 -1
- package/lib/commonjs/components/executiontasks/imageCapture/CaptureUtils.js +2 -2
- package/lib/commonjs/components/executiontasks/imageCapture/CaptureUtils.js.map +1 -1
- package/lib/commonjs/components/executiontasks/imageCapture/ImageCapture.js +11 -13
- package/lib/commonjs/components/executiontasks/imageCapture/ImageCapture.js.map +1 -1
- package/lib/commonjs/components/executiontasks/payments/PaymentUtils.js +11 -2
- package/lib/commonjs/components/executiontasks/payments/PaymentUtils.js.map +1 -1
- package/lib/commonjs/components/executiontasks/payments/completePayment/CompletePaymentET.js +2 -2
- package/lib/commonjs/components/executiontasks/payments/completePayment/CompletePaymentET.js.map +1 -1
- package/lib/commonjs/components/executiontasks/payments/init/InitPaymentET.js +5 -6
- package/lib/commonjs/components/executiontasks/payments/init/InitPaymentET.js.map +1 -1
- package/lib/commonjs/components/executiontasks/payments/processPayment/ProcessPaymentET.js +2 -2
- package/lib/commonjs/components/executiontasks/payments/processPayment/ProcessPaymentET.js.map +1 -1
- package/lib/commonjs/components/executiontasks/pickup/PickupET.js +14 -20
- package/lib/commonjs/components/executiontasks/pickup/PickupET.js.map +1 -1
- package/lib/commonjs/components/executiontasks/pickup/SLPickupET.js +18 -24
- package/lib/commonjs/components/executiontasks/pickup/SLPickupET.js.map +1 -1
- package/lib/commonjs/components/executiontasks/scan/ScanET.js +4 -6
- package/lib/commonjs/components/executiontasks/scan/ScanET.js.map +1 -1
- package/lib/commonjs/components/executiontasks/scan/constants.js.map +1 -1
- package/lib/commonjs/components/executiontasks/scan/interfaces.js.map +1 -1
- package/lib/commonjs/components/executiontasks/scan/modalConstant.js.map +1 -1
- package/lib/commonjs/components/executiontasks/scan/sub_components/CScanner.js +4 -5
- package/lib/commonjs/components/executiontasks/scan/sub_components/CScanner.js.map +1 -1
- package/lib/commonjs/components/executiontasks/scan/sub_components/DropDownUtils.js +1 -2
- package/lib/commonjs/components/executiontasks/scan/sub_components/DropDownUtils.js.map +1 -1
- package/lib/commonjs/components/executiontasks/scan/sub_components/ERDropDown.js +2 -4
- package/lib/commonjs/components/executiontasks/scan/sub_components/ERDropDown.js.map +1 -1
- package/lib/commonjs/components/executiontasks/scan/sub_components/SummaryPage.js +3 -6
- package/lib/commonjs/components/executiontasks/scan/sub_components/SummaryPage.js.map +1 -1
- package/lib/commonjs/components/executiontasks/scan/utils.js +14 -8
- package/lib/commonjs/components/executiontasks/scan/utils.js.map +1 -1
- package/lib/commonjs/components/executiontasks/validateOTP/ValidateOTPET.js +2 -2
- package/lib/commonjs/components/executiontasks/validateOTP/ValidateOTPET.js.map +1 -1
- package/lib/commonjs/components/executiontasks/validateOTP/constants.js.map +1 -1
- package/lib/commonjs/components/executiontasks/validateOTP/sub-components/OTPInput.js +2 -2
- package/lib/commonjs/components/executiontasks/validateOTP/sub-components/OTPInput.js.map +1 -1
- package/lib/commonjs/components/executiontasks/validateOTP/utils.js +1 -1
- package/lib/commonjs/components/executiontasks/validateOTP/utils.js.map +1 -1
- package/lib/commonjs/components/executiontasks/verifyLocation/GeofenceUtils.js +2 -2
- package/lib/commonjs/components/executiontasks/verifyLocation/GeofenceUtils.js.map +1 -1
- package/lib/commonjs/components/executiontasks/verifyLocation/VerifyLocationET.js +2 -2
- package/lib/commonjs/components/executiontasks/verifyLocation/VerifyLocationET.js.map +1 -1
- package/lib/commonjs/components/executiontasks/verifyOtp/VerifyOtpET.js +2 -2
- package/lib/commonjs/components/executiontasks/verifyOtp/VerifyOtpET.js.map +1 -1
- package/lib/commonjs/components/widgets/AlertDisplay.js +1 -1
- package/lib/commonjs/components/widgets/AlertDisplay.js.map +1 -1
- package/lib/commonjs/components/widgets/CancelOrderDialog.js +2 -2
- package/lib/commonjs/components/widgets/CancelOrderDialog.js.map +1 -1
- package/lib/commonjs/components/widgets/Card.js +1 -2
- package/lib/commonjs/components/widgets/Card.js.map +1 -1
- package/lib/commonjs/components/widgets/GoBackModal.js +1 -1
- package/lib/commonjs/components/widgets/GoBackModal.js.map +1 -1
- package/lib/commonjs/components/widgets/IconButton.js +20 -23
- package/lib/commonjs/components/widgets/IconButton.js.map +1 -1
- package/lib/commonjs/components/widgets/ModalWidget.js +3 -1
- package/lib/commonjs/components/widgets/ModalWidget.js.map +1 -1
- package/lib/commonjs/components/widgets/ProgressDialog.js +3 -3
- package/lib/commonjs/components/widgets/ProgressDialog.js.map +1 -1
- package/lib/commonjs/components/widgets/SearchBar.js +1 -1
- package/lib/commonjs/components/widgets/SearchBar.js.map +1 -1
- package/lib/commonjs/components/widgets/SnackBarCustom.js +22 -21
- package/lib/commonjs/components/widgets/SnackBarCustom.js.map +1 -1
- package/lib/commonjs/components/widgets/SplitTextInput.js +10 -11
- package/lib/commonjs/components/widgets/SplitTextInput.js.map +1 -1
- package/lib/commonjs/components/widgets/TabsComponent.js +1 -1
- package/lib/commonjs/components/widgets/TabsComponent.js.map +1 -1
- package/lib/commonjs/components/widgets/Timer.js +40 -0
- package/lib/commonjs/components/widgets/Timer.js.map +1 -0
- package/lib/commonjs/constants/apiConstants.js +4 -1
- package/lib/commonjs/constants/apiConstants.js.map +1 -1
- package/lib/commonjs/constants/constants.js +4 -1
- package/lib/commonjs/constants/constants.js.map +1 -1
- package/lib/commonjs/errors/BaseError.js +3 -3
- package/lib/commonjs/events/EventDispatcher.js +5 -1
- package/lib/commonjs/events/EventDispatcher.js.map +1 -1
- package/lib/commonjs/events/constants.js +2 -1
- package/lib/commonjs/events/constants.js.map +1 -1
- package/lib/commonjs/events/index.js +1 -1
- package/lib/commonjs/events/index.js.map +1 -1
- package/lib/commonjs/events/interface.js.map +1 -1
- package/lib/commonjs/icons/CircleMark.js +27 -0
- package/lib/commonjs/icons/CircleMark.js.map +1 -0
- package/lib/commonjs/icons/FailedIcon.js +69 -0
- package/lib/commonjs/icons/FailedIcon.js.map +1 -0
- package/lib/commonjs/icons/FailureCloseIcon.js +42 -0
- package/lib/commonjs/icons/FailureCloseIcon.js.map +1 -0
- package/lib/commonjs/icons/ScanIcon.js +1 -1
- package/lib/commonjs/icons/ScanIcon.js.map +1 -1
- package/lib/commonjs/icons/SuccessCompleteIcon.js +42 -0
- package/lib/commonjs/icons/SuccessCompleteIcon.js.map +1 -0
- package/lib/commonjs/icons/file.js +1 -1
- package/lib/commonjs/icons/file.js.map +1 -1
- package/lib/commonjs/index.js +2 -2
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/locale/i18n.js +1 -1
- package/lib/commonjs/locale/i18n.js.map +1 -1
- package/lib/commonjs/locale/util.js +1 -1
- package/lib/commonjs/locale/util.js.map +1 -1
- package/lib/commonjs/manager/dispatch/DispatchStateContainer.js +11 -9
- package/lib/commonjs/manager/dispatch/DispatchStateContainer.js.map +1 -1
- package/lib/commonjs/manager/dispatchCodes/EventCodeContainer.js +6 -6
- package/lib/commonjs/manager/dispatchCodes/EventCodeContainer.js.map +1 -1
- package/lib/commonjs/manager/dispatchCodes/EventCodeRepo.js +6 -6
- package/lib/commonjs/manager/dispatchCodes/EventCodeRepo.js.map +1 -1
- package/lib/commonjs/manager/dispatchCodes/ReasonCodeContainer.js +7 -7
- package/lib/commonjs/manager/dispatchCodes/ReasonCodeContainer.js.map +1 -1
- package/lib/commonjs/manager/dispatchCodes/ReasonCodeRepo.js +6 -6
- package/lib/commonjs/manager/dispatchCodes/ReasonCodeRepo.js.map +1 -1
- package/lib/commonjs/manager/location/LocationManager.js +6 -6
- package/lib/commonjs/manager/location/LocationManager.js.map +1 -1
- package/lib/commonjs/manager/sdk/DispatchSDKManager.js +8 -8
- package/lib/commonjs/manager/sdk/DispatchSDKManager.js.map +1 -1
- package/lib/commonjs/manager/sdk/DispatchSdkCache.js +6 -6
- package/lib/commonjs/manager/sdk/DispatchSdkCache.js.map +1 -1
- package/lib/commonjs/manager/sdk/callbacksHandler.js +4 -4
- package/lib/commonjs/manager/sdk/callbacksHandler.js.map +1 -1
- package/lib/commonjs/manager/syncmanager/AppSyncManager.js +7 -7
- package/lib/commonjs/manager/syncmanager/AppSyncManager.js.map +1 -1
- package/lib/commonjs/manager/syncmanager/constants.js +1 -1
- package/lib/commonjs/manager/syncmanager/constants.js.map +1 -1
- package/lib/commonjs/manager/syncmanager/database.js +2 -2
- package/lib/commonjs/manager/syncmanager/database.js.map +1 -1
- package/lib/commonjs/manager/syncmanager/document/DocumentHttpClient.js +2 -2
- package/lib/commonjs/manager/syncmanager/document/DocumentHttpClient.js.map +1 -1
- package/lib/commonjs/manager/syncmanager/document/DocumentManager.js +7 -10
- package/lib/commonjs/manager/syncmanager/document/DocumentManager.js.map +1 -1
- package/lib/commonjs/manager/syncmanager/document/DocumentSyncManager.js +13 -47
- package/lib/commonjs/manager/syncmanager/document/DocumentSyncManager.js.map +1 -1
- package/lib/commonjs/manager/syncmanager/events/ETEventsManager.js +6 -7
- package/lib/commonjs/manager/syncmanager/events/ETEventsManager.js.map +1 -1
- package/lib/commonjs/manager/syncmanager/events/EventsSyncManager.js +7 -8
- package/lib/commonjs/manager/syncmanager/events/EventsSyncManager.js.map +1 -1
- package/lib/commonjs/manager/syncmanager/events/SyncHttpClient.js +5 -9
- package/lib/commonjs/manager/syncmanager/events/SyncHttpClient.js.map +1 -1
- package/lib/commonjs/models/DispatchModels.js.map +1 -1
- package/lib/commonjs/models/execTasks/ETConfig.js +3 -0
- package/lib/commonjs/models/execTasks/ETConfig.js.map +1 -1
- package/lib/commonjs/models/sdk.js.map +1 -1
- package/lib/commonjs/native/signature/SignatureCapture.js +5 -5
- package/lib/commonjs/native/signature/SignatureCapture.js.map +1 -1
- package/lib/commonjs/network/GraphQLClient.js +15 -19
- package/lib/commonjs/network/GraphQLClient.js.map +1 -1
- package/lib/commonjs/network/NetworkClient.js +30 -3
- package/lib/commonjs/network/NetworkClient.js.map +1 -1
- package/lib/commonjs/network/NetworkUtils.js +2 -5
- package/lib/commonjs/network/NetworkUtils.js.map +1 -1
- package/lib/commonjs/network/Queries.js.map +1 -1
- package/lib/commonjs/network/client.js +5 -5
- package/lib/commonjs/network/client.js.map +1 -1
- package/lib/commonjs/resources/Login.js +4 -4
- package/lib/commonjs/resources/Login.js.map +1 -1
- package/lib/commonjs/resources/network.js +4 -4
- package/lib/commonjs/resources/network.js.map +1 -1
- package/lib/commonjs/styles/executionTasks/CommonStyles.js +13 -3
- package/lib/commonjs/styles/executionTasks/CommonStyles.js.map +1 -1
- package/lib/commonjs/ui/screens/CancellationScreen.js +7 -8
- package/lib/commonjs/ui/screens/CancellationScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/CaptureInputScreen.js +8 -9
- package/lib/commonjs/ui/screens/CaptureInputScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/CollectPaymentScreen.js +251 -0
- package/lib/commonjs/ui/screens/CollectPaymentScreen.js.map +1 -0
- package/lib/commonjs/ui/screens/CompleteObjectiveScreen.js +7 -8
- package/lib/commonjs/ui/screens/CompleteObjectiveScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/DeliverScreen.js +8 -9
- package/lib/commonjs/ui/screens/DeliverScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/DisplayScreen.js +8 -9
- package/lib/commonjs/ui/screens/DisplayScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/DoodleScreen.js +8 -9
- package/lib/commonjs/ui/screens/DoodleScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/DropCashScreen.js +43 -11
- package/lib/commonjs/ui/screens/DropCashScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/ETScreensIndex.js +8 -1
- package/lib/commonjs/ui/screens/ETScreensIndex.js.map +1 -1
- package/lib/commonjs/ui/screens/FormsScreen.js +8 -9
- package/lib/commonjs/ui/screens/FormsScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/GeofenceScreen.js +8 -9
- package/lib/commonjs/ui/screens/GeofenceScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/HttpRequestScreen.js +7 -8
- package/lib/commonjs/ui/screens/HttpRequestScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/ImageCaptureScreen.js +8 -9
- package/lib/commonjs/ui/screens/ImageCaptureScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/PaymentScreen.js +9 -9
- package/lib/commonjs/ui/screens/PaymentScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/PickupScreen.js +8 -9
- package/lib/commonjs/ui/screens/PickupScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/ScanScreen.js +8 -10
- package/lib/commonjs/ui/screens/ScanScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/StartWorkFlowScreen.js +14 -10
- package/lib/commonjs/ui/screens/StartWorkFlowScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/ValidateOTPScreen.js +8 -9
- package/lib/commonjs/ui/screens/ValidateOTPScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/WithBaseDispatchScreen.js +3 -3
- package/lib/commonjs/ui/screens/WithBaseDispatchScreen.js.map +1 -1
- package/lib/commonjs/ui/uiConfig/RouteParams.js +2 -1
- package/lib/commonjs/ui/uiConfig/RouteParams.js.map +1 -1
- package/lib/commonjs/utils/ApiUtils.js +3 -1
- package/lib/commonjs/utils/ApiUtils.js.map +1 -1
- package/lib/commonjs/utils/ExecTaskUtils.js +35 -5
- package/lib/commonjs/utils/ExecTaskUtils.js.map +1 -1
- package/lib/commonjs/utils/Logger.js +6 -62
- package/lib/commonjs/utils/Logger.js.map +1 -1
- package/lib/commonjs/utils/NetworkUtil.js +4 -4
- package/lib/commonjs/utils/NetworkUtil.js.map +1 -1
- package/lib/commonjs/utils/SdkUtils.js +2 -2
- package/lib/commonjs/utils/SdkUtils.js.map +1 -1
- package/lib/commonjs/utils/SyncManagerUtils.js +3 -3
- package/lib/commonjs/utils/SyncManagerUtils.js.map +1 -1
- package/lib/commonjs/utils/context/paymentContext.js +9 -0
- package/lib/commonjs/utils/context/paymentContext.js.map +1 -0
- package/lib/commonjs/utils/fcm/FCM.js +22 -4
- package/lib/commonjs/utils/fcm/FCM.js.map +1 -1
- package/lib/commonjs/utils/fcm/FcmUtils.js +12 -2
- package/lib/commonjs/utils/fcm/FcmUtils.js.map +1 -1
- package/lib/commonjs/utils/helper.js +6 -6
- package/lib/commonjs/utils/helper.js.map +1 -1
- package/lib/commonjs/utils/hooks/useModal.js +4 -3
- package/lib/commonjs/utils/hooks/useModal.js.map +1 -1
- package/lib/commonjs/utils/hooks/useTimer.js.map +1 -1
- package/lib/commonjs/utils/loginHelper.js +1 -1
- package/lib/commonjs/utils/loginHelper.js.map +1 -1
- package/lib/commonjs/utils/storage.js +11 -17
- package/lib/commonjs/utils/storage.js.map +1 -1
- package/lib/commonjs/utils/utils.js +2 -3
- package/lib/commonjs/utils/utils.js.map +1 -1
- package/lib/module/analytics/firebase/FirebaseLogging.js +0 -3
- package/lib/module/analytics/firebase/FirebaseLogging.js.map +1 -1
- package/lib/module/analytics/sentry/SentryAnalyticsSingleton.js +5 -5
- package/lib/module/analytics/sentry/SentryAnalyticsSingleton.js.map +1 -1
- package/lib/module/analytics/sentry/SentryAnalyticsUtils.js +7 -14
- package/lib/module/analytics/sentry/SentryAnalyticsUtils.js.map +1 -1
- package/lib/module/components/dispatch/DispatchExecNavigator.js +14 -4
- package/lib/module/components/dispatch/DispatchExecNavigator.js.map +1 -1
- package/lib/module/components/executiontasks/ExecutionTasksIndex.js +2 -1
- package/lib/module/components/executiontasks/ExecutionTasksIndex.js.map +1 -1
- package/lib/module/components/executiontasks/cancellation/CancelET.js +6 -8
- package/lib/module/components/executiontasks/cancellation/CancelET.js.map +1 -1
- package/lib/module/components/executiontasks/collectPayment/CollectPayment.js +32 -0
- package/lib/module/components/executiontasks/collectPayment/CollectPayment.js.map +1 -0
- package/lib/module/components/executiontasks/collectPayment/CollectPaymentSchema.js +29 -0
- package/lib/module/components/executiontasks/collectPayment/CollectPaymentSchema.js.map +1 -0
- package/lib/module/components/executiontasks/collectPayment/PaymentStyles.js +96 -0
- package/lib/module/components/executiontasks/collectPayment/PaymentStyles.js.map +1 -0
- package/lib/module/components/executiontasks/collectPayment/PaymentUtils.js +132 -0
- package/lib/module/components/executiontasks/collectPayment/PaymentUtils.js.map +1 -0
- package/lib/module/components/executiontasks/collectPayment/components/CompletePayment.js +179 -0
- package/lib/module/components/executiontasks/collectPayment/components/CompletePayment.js.map +1 -0
- package/lib/module/components/executiontasks/collectPayment/components/CustomContactsModal.js +2 -0
- package/lib/module/components/executiontasks/collectPayment/components/CustomContactsModal.js.map +1 -0
- package/lib/module/components/executiontasks/collectPayment/components/InitPayment.js +433 -0
- package/lib/module/components/executiontasks/collectPayment/components/InitPayment.js.map +1 -0
- package/lib/module/components/executiontasks/collectPayment/components/PaymentContactDetails.js +531 -0
- package/lib/module/components/executiontasks/collectPayment/components/PaymentContactDetails.js.map +1 -0
- package/lib/module/components/executiontasks/collectPayment/components/ProcessPayment.js +880 -0
- package/lib/module/components/executiontasks/collectPayment/components/ProcessPayment.js.map +1 -0
- package/lib/module/components/executiontasks/deliver/DeliverET.js +13 -19
- package/lib/module/components/executiontasks/deliver/DeliverET.js.map +1 -1
- package/lib/module/components/executiontasks/deliver/SLDeliverET.js +21 -24
- package/lib/module/components/executiontasks/deliver/SLDeliverET.js.map +1 -1
- package/lib/module/components/executiontasks/doodle/SignatureET.js +0 -1
- package/lib/module/components/executiontasks/doodle/SignatureET.js.map +1 -1
- package/lib/module/components/executiontasks/dropCash/DropCashET.js.map +1 -1
- package/lib/module/components/executiontasks/dropCash/SLDropCash.js +6 -1
- package/lib/module/components/executiontasks/dropCash/SLDropCash.js.map +1 -1
- package/lib/module/components/executiontasks/forms/widgets/DateTimeWidget.js +11 -12
- package/lib/module/components/executiontasks/forms/widgets/DateTimeWidget.js.map +1 -1
- package/lib/module/components/executiontasks/forms/widgets/QRBarcodeScannerWidget.js +9 -10
- package/lib/module/components/executiontasks/forms/widgets/QRBarcodeScannerWidget.js.map +1 -1
- package/lib/module/components/executiontasks/forms/widgets/TimeRangeSelector.js +1 -1
- package/lib/module/components/executiontasks/imageCapture/CaptureUtils.js.map +1 -1
- package/lib/module/components/executiontasks/imageCapture/ImageCapture.js +9 -11
- package/lib/module/components/executiontasks/imageCapture/ImageCapture.js.map +1 -1
- package/lib/module/components/executiontasks/payments/PaymentUtils.js +11 -2
- package/lib/module/components/executiontasks/payments/PaymentUtils.js.map +1 -1
- package/lib/module/components/executiontasks/payments/init/InitPaymentET.js +3 -4
- package/lib/module/components/executiontasks/payments/init/InitPaymentET.js.map +1 -1
- package/lib/module/components/executiontasks/payments/processPayment/ProcessPaymentET.js.map +1 -1
- package/lib/module/components/executiontasks/pickup/PickupET.js +13 -19
- package/lib/module/components/executiontasks/pickup/PickupET.js.map +1 -1
- package/lib/module/components/executiontasks/pickup/SLPickupET.js +15 -21
- package/lib/module/components/executiontasks/pickup/SLPickupET.js.map +1 -1
- package/lib/module/components/executiontasks/scan/ScanET.js +2 -4
- package/lib/module/components/executiontasks/scan/ScanET.js.map +1 -1
- package/lib/module/components/executiontasks/scan/constants.js.map +1 -1
- package/lib/module/components/executiontasks/scan/interfaces.js.map +1 -1
- package/lib/module/components/executiontasks/scan/modalConstant.js.map +1 -1
- package/lib/module/components/executiontasks/scan/sub_components/CScanner.js +3 -4
- package/lib/module/components/executiontasks/scan/sub_components/CScanner.js.map +1 -1
- package/lib/module/components/executiontasks/scan/sub_components/DropDownUtils.js +0 -1
- package/lib/module/components/executiontasks/scan/sub_components/DropDownUtils.js.map +1 -1
- package/lib/module/components/executiontasks/scan/sub_components/ERDropDown.js +0 -2
- package/lib/module/components/executiontasks/scan/sub_components/ERDropDown.js.map +1 -1
- package/lib/module/components/executiontasks/scan/sub_components/SummaryPage.js +1 -4
- package/lib/module/components/executiontasks/scan/sub_components/SummaryPage.js.map +1 -1
- package/lib/module/components/executiontasks/scan/utils.js +11 -6
- package/lib/module/components/executiontasks/scan/utils.js.map +1 -1
- package/lib/module/components/executiontasks/validateOTP/ValidateOTPET.js.map +1 -1
- package/lib/module/components/executiontasks/validateOTP/constants.js.map +1 -1
- package/lib/module/components/widgets/Card.js +0 -1
- package/lib/module/components/widgets/Card.js.map +1 -1
- package/lib/module/components/widgets/IconButton.js +19 -22
- package/lib/module/components/widgets/IconButton.js.map +1 -1
- package/lib/module/components/widgets/ModalWidget.js +1 -0
- package/lib/module/components/widgets/ModalWidget.js.map +1 -1
- package/lib/module/components/widgets/ProgressDialog.js +2 -2
- package/lib/module/components/widgets/ProgressDialog.js.map +1 -1
- package/lib/module/components/widgets/SnackBarCustom.js +21 -20
- package/lib/module/components/widgets/SnackBarCustom.js.map +1 -1
- package/lib/module/components/widgets/SplitTextInput.js +9 -10
- package/lib/module/components/widgets/SplitTextInput.js.map +1 -1
- package/lib/module/components/widgets/Timer.js +32 -0
- package/lib/module/components/widgets/Timer.js.map +1 -0
- package/lib/module/constants/apiConstants.js +4 -1
- package/lib/module/constants/apiConstants.js.map +1 -1
- package/lib/module/constants/constants.js +3 -0
- package/lib/module/constants/constants.js.map +1 -1
- package/lib/module/errors/BaseError.js +3 -3
- package/lib/module/events/EventDispatcher.js +3 -0
- package/lib/module/events/EventDispatcher.js.map +1 -1
- package/lib/module/events/constants.js +2 -1
- package/lib/module/events/constants.js.map +1 -1
- package/lib/module/events/interface.js.map +1 -1
- package/lib/module/icons/CircleMark.js +20 -0
- package/lib/module/icons/CircleMark.js.map +1 -0
- package/lib/module/icons/FailedIcon.js +62 -0
- package/lib/module/icons/FailedIcon.js.map +1 -0
- package/lib/module/icons/FailureCloseIcon.js +35 -0
- package/lib/module/icons/FailureCloseIcon.js.map +1 -0
- package/lib/module/icons/SuccessCompleteIcon.js +35 -0
- package/lib/module/icons/SuccessCompleteIcon.js.map +1 -0
- package/lib/module/manager/dispatch/DispatchStateContainer.js +10 -8
- package/lib/module/manager/dispatch/DispatchStateContainer.js.map +1 -1
- package/lib/module/manager/dispatchCodes/EventCodeContainer.js +5 -5
- package/lib/module/manager/dispatchCodes/EventCodeContainer.js.map +1 -1
- package/lib/module/manager/dispatchCodes/EventCodeRepo.js +5 -5
- package/lib/module/manager/dispatchCodes/EventCodeRepo.js.map +1 -1
- package/lib/module/manager/dispatchCodes/ReasonCodeContainer.js +5 -5
- package/lib/module/manager/dispatchCodes/ReasonCodeContainer.js.map +1 -1
- package/lib/module/manager/dispatchCodes/ReasonCodeRepo.js +5 -5
- package/lib/module/manager/dispatchCodes/ReasonCodeRepo.js.map +1 -1
- package/lib/module/manager/location/LocationManager.js +5 -5
- package/lib/module/manager/location/LocationManager.js.map +1 -1
- package/lib/module/manager/sdk/DispatchSDKManager.js +6 -6
- package/lib/module/manager/sdk/DispatchSDKManager.js.map +1 -1
- package/lib/module/manager/sdk/DispatchSdkCache.js +5 -5
- package/lib/module/manager/sdk/DispatchSdkCache.js.map +1 -1
- package/lib/module/manager/sdk/callbacksHandler.js +3 -3
- package/lib/module/manager/syncmanager/AppSyncManager.js +5 -5
- package/lib/module/manager/syncmanager/AppSyncManager.js.map +1 -1
- package/lib/module/manager/syncmanager/DBConfig.js +1 -0
- package/lib/module/manager/syncmanager/DBConfig.js.map +1 -1
- package/lib/module/manager/syncmanager/constants.js +1 -1
- package/lib/module/manager/syncmanager/constants.js.map +1 -1
- package/lib/module/manager/syncmanager/document/DocumentHttpClient.js.map +1 -1
- package/lib/module/manager/syncmanager/document/DocumentManager.js +6 -9
- package/lib/module/manager/syncmanager/document/DocumentManager.js.map +1 -1
- package/lib/module/manager/syncmanager/document/DocumentSyncManager.js +11 -45
- package/lib/module/manager/syncmanager/document/DocumentSyncManager.js.map +1 -1
- package/lib/module/manager/syncmanager/events/ETEventsManager.js +5 -6
- package/lib/module/manager/syncmanager/events/ETEventsManager.js.map +1 -1
- package/lib/module/manager/syncmanager/events/EventsSyncManager.js +5 -6
- package/lib/module/manager/syncmanager/events/EventsSyncManager.js.map +1 -1
- package/lib/module/manager/syncmanager/events/SyncHttpClient.js +3 -7
- package/lib/module/manager/syncmanager/events/SyncHttpClient.js.map +1 -1
- package/lib/module/models/DispatchModels.js.map +1 -1
- package/lib/module/models/execTasks/ETConfig.js +3 -0
- package/lib/module/models/execTasks/ETConfig.js.map +1 -1
- package/lib/module/models/sdk.js.map +1 -1
- package/lib/module/native/signature/SignatureCapture.js +4 -4
- package/lib/module/network/GraphQLClient.js +14 -18
- package/lib/module/network/GraphQLClient.js.map +1 -1
- package/lib/module/network/NetworkClient.js +29 -2
- package/lib/module/network/NetworkClient.js.map +1 -1
- package/lib/module/network/NetworkUtils.js +1 -4
- package/lib/module/network/NetworkUtils.js.map +1 -1
- package/lib/module/network/Queries.js.map +1 -1
- package/lib/module/network/client.js +4 -4
- package/lib/module/network/client.js.map +1 -1
- package/lib/module/resources/Login.js +3 -3
- package/lib/module/resources/network.js +3 -3
- package/lib/module/styles/executionTasks/CommonStyles.js +12 -2
- package/lib/module/styles/executionTasks/CommonStyles.js.map +1 -1
- package/lib/module/ui/screens/CancellationScreen.js +5 -6
- package/lib/module/ui/screens/CancellationScreen.js.map +1 -1
- package/lib/module/ui/screens/CaptureInputScreen.js +6 -7
- package/lib/module/ui/screens/CaptureInputScreen.js.map +1 -1
- package/lib/module/ui/screens/CollectPaymentScreen.js +244 -0
- package/lib/module/ui/screens/CollectPaymentScreen.js.map +1 -0
- package/lib/module/ui/screens/CompleteObjectiveScreen.js +5 -6
- package/lib/module/ui/screens/CompleteObjectiveScreen.js.map +1 -1
- package/lib/module/ui/screens/DeliverScreen.js +6 -7
- package/lib/module/ui/screens/DeliverScreen.js.map +1 -1
- package/lib/module/ui/screens/DisplayScreen.js +6 -7
- package/lib/module/ui/screens/DisplayScreen.js.map +1 -1
- package/lib/module/ui/screens/DoodleScreen.js +6 -7
- package/lib/module/ui/screens/DoodleScreen.js.map +1 -1
- package/lib/module/ui/screens/DropCashScreen.js +41 -10
- package/lib/module/ui/screens/DropCashScreen.js.map +1 -1
- package/lib/module/ui/screens/ETScreensIndex.js +2 -1
- package/lib/module/ui/screens/ETScreensIndex.js.map +1 -1
- package/lib/module/ui/screens/FormsScreen.js +6 -7
- package/lib/module/ui/screens/FormsScreen.js.map +1 -1
- package/lib/module/ui/screens/GeofenceScreen.js +6 -7
- package/lib/module/ui/screens/GeofenceScreen.js.map +1 -1
- package/lib/module/ui/screens/HttpRequestScreen.js +6 -7
- package/lib/module/ui/screens/HttpRequestScreen.js.map +1 -1
- package/lib/module/ui/screens/ImageCaptureScreen.js +6 -7
- package/lib/module/ui/screens/ImageCaptureScreen.js.map +1 -1
- package/lib/module/ui/screens/PaymentScreen.js +7 -7
- package/lib/module/ui/screens/PaymentScreen.js.map +1 -1
- package/lib/module/ui/screens/PickupScreen.js +6 -7
- package/lib/module/ui/screens/PickupScreen.js.map +1 -1
- package/lib/module/ui/screens/ScanScreen.js +6 -8
- package/lib/module/ui/screens/ScanScreen.js.map +1 -1
- package/lib/module/ui/screens/StartWorkFlowScreen.js +12 -8
- package/lib/module/ui/screens/StartWorkFlowScreen.js.map +1 -1
- package/lib/module/ui/screens/ValidateOTPScreen.js +6 -7
- package/lib/module/ui/screens/ValidateOTPScreen.js.map +1 -1
- package/lib/module/ui/screens/WithBaseDispatchScreen.js +1 -1
- package/lib/module/ui/uiConfig/RouteParams.js +2 -1
- package/lib/module/ui/uiConfig/RouteParams.js.map +1 -1
- package/lib/module/utils/ApiUtils.js +2 -0
- package/lib/module/utils/ApiUtils.js.map +1 -1
- package/lib/module/utils/ExecTaskUtils.js +31 -4
- package/lib/module/utils/ExecTaskUtils.js.map +1 -1
- package/lib/module/utils/Logger.js +5 -61
- package/lib/module/utils/Logger.js.map +1 -1
- package/lib/module/utils/NetworkUtil.js +3 -3
- package/lib/module/utils/NetworkUtil.js.map +1 -1
- package/lib/module/utils/SdkUtils.js.map +1 -1
- package/lib/module/utils/SyncManagerUtils.js +1 -1
- package/lib/module/utils/SyncManagerUtils.js.map +1 -1
- package/lib/module/utils/context/paymentContext.js +3 -0
- package/lib/module/utils/context/paymentContext.js.map +1 -0
- package/lib/module/utils/fcm/FCM.js +20 -2
- package/lib/module/utils/fcm/FCM.js.map +1 -1
- package/lib/module/utils/fcm/FcmUtils.js +10 -0
- package/lib/module/utils/fcm/FcmUtils.js.map +1 -1
- package/lib/module/utils/helper.js +5 -5
- package/lib/module/utils/helper.js.map +1 -1
- package/lib/module/utils/hooks/useModal.js +2 -1
- package/lib/module/utils/hooks/useModal.js.map +1 -1
- package/lib/module/utils/hooks/useTimer.js.map +1 -1
- package/lib/module/utils/storage.js +9 -15
- package/lib/module/utils/storage.js.map +1 -1
- package/lib/module/utils/utils.js +1 -2
- package/lib/module/utils/utils.js.map +1 -1
- package/lib/typescript/components/executiontasks/ExecutionTasksIndex.d.ts +4 -2
- package/lib/typescript/components/executiontasks/collectPayment/CollectPayment.d.ts +4 -0
- package/lib/typescript/components/executiontasks/collectPayment/CollectPaymentSchema.d.ts +155 -0
- package/lib/typescript/components/executiontasks/collectPayment/PaymentStyles.d.ts +92 -0
- package/lib/typescript/components/executiontasks/collectPayment/PaymentUtils.d.ts +16 -0
- package/lib/typescript/components/executiontasks/collectPayment/components/CompletePayment.d.ts +4 -0
- package/lib/typescript/components/executiontasks/collectPayment/components/CustomContactsModal.d.ts +0 -0
- package/lib/typescript/components/executiontasks/collectPayment/components/InitPayment.d.ts +4 -0
- package/lib/typescript/components/executiontasks/collectPayment/components/PaymentContactDetails.d.ts +4 -0
- package/lib/typescript/components/executiontasks/collectPayment/components/ProcessPayment.d.ts +4 -0
- package/lib/typescript/components/executiontasks/scan/interfaces.d.ts +1 -1
- package/lib/typescript/components/executiontasks/scan/utils.d.ts +1 -0
- package/lib/typescript/components/widgets/ProgressDialog.d.ts +3 -0
- package/lib/typescript/components/widgets/SnackBarCustom.d.ts +3 -2
- package/lib/typescript/components/widgets/Timer.d.ts +7 -0
- package/lib/typescript/constants/apiConstants.d.ts +3 -0
- package/lib/typescript/constants/constants.d.ts +3 -0
- package/lib/typescript/events/EventDispatcher.d.ts +1 -0
- package/lib/typescript/events/constants.d.ts +1 -0
- package/lib/typescript/events/interface.d.ts +1 -1
- package/lib/typescript/icons/CircleMark.d.ts +3 -0
- package/lib/typescript/icons/FailedIcon.d.ts +4 -0
- package/lib/typescript/icons/FailureCloseIcon.d.ts +4 -0
- package/lib/typescript/icons/SuccessCompleteIcon.d.ts +4 -0
- package/lib/typescript/manager/syncmanager/constants.d.ts +1 -1
- package/lib/typescript/models/DispatchModels.d.ts +11 -0
- package/lib/typescript/models/execTasks/ETConfig.d.ts +6 -3
- package/lib/typescript/models/sdk.d.ts +12 -0
- package/lib/typescript/network/NetworkClient.d.ts +3 -1
- package/lib/typescript/styles/executionTasks/CommonStyles.d.ts +10 -1
- package/lib/typescript/ui/screens/CollectPaymentScreen.d.ts +3 -0
- package/lib/typescript/ui/screens/ETScreensIndex.d.ts +2 -1
- package/lib/typescript/ui/uiConfig/RouteParams.d.ts +1 -0
- package/lib/typescript/utils/ExecTaskUtils.d.ts +2 -0
- package/lib/typescript/utils/context/paymentContext.d.ts +7 -0
- package/package.json +5 -4
- package/src/analytics/firebase/FirebaseLogging.ts +2 -11
- package/src/analytics/sentry/SentryAnalyticsUtils.ts +0 -7
- package/src/components/dispatch/DispatchExecNavigator.tsx +14 -0
- package/src/components/executiontasks/ExecutionTasksIndex.ts +8 -0
- package/src/components/executiontasks/collectPayment/CollectPayment.tsx +60 -0
- package/src/components/executiontasks/collectPayment/CollectPaymentSchema.ts +182 -0
- package/src/components/executiontasks/collectPayment/PaymentStyles.ts +102 -0
- package/src/components/executiontasks/collectPayment/PaymentUtils.ts +200 -0
- package/src/components/executiontasks/collectPayment/components/CompletePayment.tsx +273 -0
- package/src/components/executiontasks/collectPayment/components/CustomContactsModal.tsx +0 -0
- package/src/components/executiontasks/collectPayment/components/InitPayment.tsx +658 -0
- package/src/components/executiontasks/collectPayment/components/PaymentContactDetails.tsx +790 -0
- package/src/components/executiontasks/collectPayment/components/ProcessPayment.tsx +1352 -0
- package/src/components/executiontasks/deliver/SLDeliverET.tsx +132 -60
- package/src/components/executiontasks/dropCash/SLDropCash.tsx +35 -12
- package/src/components/executiontasks/payments/PaymentUtils.ts +10 -2
- package/src/components/executiontasks/pickup/SLPickupET.tsx +6 -3
- package/src/components/executiontasks/scan/ScanET.tsx +1 -1
- package/src/components/executiontasks/scan/interfaces.ts +1 -1
- package/src/components/executiontasks/scan/utils.ts +16 -8
- package/src/components/widgets/ModalWidget.tsx +26 -8
- package/src/components/widgets/ProgressDialog.tsx +23 -3
- package/src/components/widgets/SnackBarCustom.tsx +8 -1
- package/src/components/widgets/SplitTextInput.tsx +1 -1
- package/src/components/widgets/Timer.tsx +53 -0
- package/src/constants/apiConstants.ts +3 -0
- package/src/constants/constants.ts +3 -0
- package/src/events/EventDispatcher.ts +4 -0
- package/src/events/constants.ts +1 -0
- package/src/events/interface.ts +7 -1
- package/src/icons/CircleMark.tsx +18 -0
- package/src/icons/FailedIcon.tsx +80 -0
- package/src/icons/FailureCloseIcon.tsx +35 -0
- package/src/icons/SuccessCompleteIcon.tsx +35 -0
- package/src/manager/dispatch/DispatchStateContainer.tsx +6 -4
- package/src/manager/sdk/DispatchSDKManager.ts +1 -0
- package/src/manager/syncmanager/constants.ts +1 -1
- package/src/manager/syncmanager/document/DocumentManager.ts +6 -8
- package/src/manager/syncmanager/document/DocumentSyncManager.ts +8 -43
- package/src/models/DispatchModels.ts +12 -0
- package/src/models/execTasks/ETConfig.ts +3 -0
- package/src/models/sdk.ts +13 -0
- package/src/network/NetworkClient.ts +34 -1
- package/src/network/client.ts +1 -0
- package/src/styles/executionTasks/CommonStyles.ts +32 -8
- package/src/ui/screens/CollectPaymentScreen.tsx +315 -0
- package/src/ui/screens/DropCashScreen.tsx +49 -2
- package/src/ui/screens/ETScreensIndex.ts +2 -0
- package/src/ui/screens/PaymentScreen.tsx +1 -0
- package/src/ui/screens/StartWorkFlowScreen.tsx +16 -1
- package/src/ui/uiConfig/RouteParams.ts +8 -1
- package/src/utils/ApiUtils.ts +1 -0
- package/src/utils/ExecTaskUtils.ts +44 -3
- package/src/utils/Logger.ts +1 -58
- package/src/utils/SyncManagerUtils.ts +1 -0
- package/src/utils/context/paymentContext.ts +8 -0
- package/src/utils/fcm/FCM.ts +30 -0
- package/src/utils/fcm/FcmUtils.ts +53 -29
- package/lib/commonjs/icons/circleMark.svg +0 -3
- package/lib/module/icons/circleMark.svg +0 -3
- package/src/icons/circleMark.svg +0 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["useEffect","useState","useTimer","props","initialMinute","initialSeconds","minutes","setMinutes","seconds","setSeconds","myInterval","setInterval","clearInterval","resetTimer","timer"],"sources":["useTimer.ts"],"sourcesContent":["import { useEffect, useState } from 'react';\n\nconst useTimer = (props: {\n initialMinute: number;\n initialSeconds: number;\n}): [string | null, () => void] => {\n const { initialMinute = 0, initialSeconds = 0 } = props;\n const [minutes, setMinutes] = useState(initialMinute);\n const [seconds, setSeconds] = useState(initialSeconds);\n useEffect(() => {\n let myInterval = setInterval(() => {\n if (seconds > 0) {\n setSeconds(seconds - 1);\n }\n if (seconds === 0) {\n if (minutes === 0) {\n clearInterval(myInterval);\n } else {\n setMinutes(minutes - 1);\n setSeconds(59);\n }\n }\n }, 1000);\n return () => {\n clearInterval(myInterval);\n };\n });\n\n const resetTimer = () => {\n if (!minutes && !seconds) {\n setMinutes(initialMinute);\n setSeconds(initialSeconds);\n }\n };\n\n const timer =\n minutes === 0 && seconds === 0\n ? null\n : `${minutes}: ${seconds < 10 ? `0${seconds}` : seconds}`;\n\n return [timer, resetTimer];\n};\n\nexport default useTimer;\n"],"mappings":"AAAA,SAASA,SAAS,EAAEC,QAAQ,QAAQ,OAAO;AAE3C,MAAMC,QAAQ,GAAIC,KAGjB,IAAkC;EACjC,MAAM;IAAEC,aAAa,GAAG,CAAC;IAAEC,cAAc,GAAG;EAAE,CAAC,GAAGF,KAAK;EACvD,MAAM,CAACG,OAAO,EAAEC,UAAU,CAAC,GAAGN,QAAQ,CAACG,aAAa,CAAC;EACrD,MAAM,CAACI,OAAO,EAAEC,UAAU,CAAC,GAAGR,QAAQ,CAACI,cAAc,CAAC;EACtDL,SAAS,CAAC,MAAM;IACd,IAAIU,UAAU,GAAGC,WAAW,CAAC,MAAM;MACjC,IAAIH,OAAO,GAAG,CAAC,EAAE;QACfC,UAAU,CAACD,OAAO,GAAG,CAAC,CAAC;MACzB;MACA,IAAIA,OAAO,KAAK,CAAC,EAAE;QACjB,IAAIF,OAAO,KAAK,CAAC,EAAE;UACjBM,aAAa,CAACF,UAAU,CAAC;QAC3B,CAAC,MAAM;UACLH,UAAU,CAACD,OAAO,GAAG,CAAC,CAAC;UACvBG,UAAU,CAAC,EAAE,CAAC;QAChB;MACF;IACF,CAAC,EAAE,IAAI,CAAC;IACR,OAAO,MAAM;MACXG,aAAa,CAACF,UAAU,CAAC;IAC3B,CAAC;EACH,CAAC,CAAC;EAEF,MAAMG,UAAU,GAAGA,CAAA,KAAM;IACvB,IAAI,CAACP,OAAO,IAAI,CAACE,OAAO,EAAE;MACxBD,UAAU,CAACH,aAAa,CAAC;MACzBK,UAAU,CAACJ,cAAc,CAAC;IAC5B;EACF,CAAC;EAED,MAAMS,KAAK,GACTR,OAAO,KAAK,CAAC,IAAIE,OAAO,KAAK,CAAC,GAC1B,IAAI,
|
|
1
|
+
{"version":3,"names":["useEffect","useState","useTimer","props","initialMinute","initialSeconds","minutes","setMinutes","seconds","setSeconds","myInterval","setInterval","clearInterval","resetTimer","timer"],"sources":["useTimer.ts"],"sourcesContent":["import { useEffect, useState } from 'react';\n\nconst useTimer = (props: {\n initialMinute: number;\n initialSeconds: number;\n}): [string | null, () => void] => {\n const { initialMinute = 0, initialSeconds = 0 } = props;\n const [minutes, setMinutes] = useState(initialMinute);\n const [seconds, setSeconds] = useState(initialSeconds);\n useEffect(() => {\n let myInterval = setInterval(() => {\n if (seconds > 0) {\n setSeconds(seconds - 1);\n }\n if (seconds === 0) {\n if (minutes === 0) {\n clearInterval(myInterval);\n } else {\n setMinutes(minutes - 1);\n setSeconds(59);\n }\n }\n }, 1000);\n return () => {\n clearInterval(myInterval);\n };\n });\n\n const resetTimer = () => {\n if (!minutes && !seconds) {\n setMinutes(initialMinute);\n setSeconds(initialSeconds);\n }\n };\n\n const timer =\n minutes === 0 && seconds === 0\n ? null\n : `${minutes}: ${seconds < 10 ? `0${seconds}` : seconds}`;\n\n return [timer, resetTimer];\n};\n\nexport default useTimer;\n"],"mappings":"AAAA,SAASA,SAAS,EAAEC,QAAQ,QAAQ,OAAO;AAE3C,MAAMC,QAAQ,GAAIC,KAGjB,IAAkC;EACjC,MAAM;IAAEC,aAAa,GAAG,CAAC;IAAEC,cAAc,GAAG;EAAE,CAAC,GAAGF,KAAK;EACvD,MAAM,CAACG,OAAO,EAAEC,UAAU,CAAC,GAAGN,QAAQ,CAACG,aAAa,CAAC;EACrD,MAAM,CAACI,OAAO,EAAEC,UAAU,CAAC,GAAGR,QAAQ,CAACI,cAAc,CAAC;EACtDL,SAAS,CAAC,MAAM;IACd,IAAIU,UAAU,GAAGC,WAAW,CAAC,MAAM;MACjC,IAAIH,OAAO,GAAG,CAAC,EAAE;QACfC,UAAU,CAACD,OAAO,GAAG,CAAC,CAAC;MACzB;MACA,IAAIA,OAAO,KAAK,CAAC,EAAE;QACjB,IAAIF,OAAO,KAAK,CAAC,EAAE;UACjBM,aAAa,CAACF,UAAU,CAAC;QAC3B,CAAC,MAAM;UACLH,UAAU,CAACD,OAAO,GAAG,CAAC,CAAC;UACvBG,UAAU,CAAC,EAAE,CAAC;QAChB;MACF;IACF,CAAC,EAAE,IAAI,CAAC;IACR,OAAO,MAAM;MACXG,aAAa,CAACF,UAAU,CAAC;IAC3B,CAAC;EACH,CAAC,CAAC;EAEF,MAAMG,UAAU,GAAGA,CAAA,KAAM;IACvB,IAAI,CAACP,OAAO,IAAI,CAACE,OAAO,EAAE;MACxBD,UAAU,CAACH,aAAa,CAAC;MACzBK,UAAU,CAACJ,cAAc,CAAC;IAC5B;EACF,CAAC;EAED,MAAMS,KAAK,GACTR,OAAO,KAAK,CAAC,IAAIE,OAAO,KAAK,CAAC,GAC1B,IAAI,GACJ,GAAGF,OAAO,KAAKE,OAAO,GAAG,EAAE,GAAG,IAAIA,OAAO,EAAE,GAAGA,OAAO,EAAE;EAE7D,OAAO,CAACM,KAAK,EAAED,UAAU,CAAC;AAC5B,CAAC;AAED,eAAeX,QAAQ","ignoreList":[]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
var
|
|
2
|
-
function _defineProperty(
|
|
3
|
-
function _toPropertyKey(
|
|
4
|
-
function _toPrimitive(
|
|
1
|
+
var _Storage;
|
|
2
|
+
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
3
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
4
|
+
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
5
5
|
import { LOCAL_STORAGE_KEY_PREFIX } from './../constants/constants';
|
|
6
6
|
import AsyncStorage from '@react-native-async-storage/async-storage';
|
|
7
7
|
import Logger, { LOG_TYPE } from './Logger';
|
|
@@ -172,8 +172,7 @@ class Storage {
|
|
|
172
172
|
/**
|
|
173
173
|
* Shared preferences
|
|
174
174
|
*/
|
|
175
|
-
async setSharedItem(key, value) {
|
|
176
|
-
let prefix = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
|
|
175
|
+
async setSharedItem(key, value, prefix = true) {
|
|
177
176
|
if (Platform.OS === 'android') {
|
|
178
177
|
await SharedPreferencesModule.setItem(key, value);
|
|
179
178
|
} else {
|
|
@@ -193,8 +192,7 @@ class Storage {
|
|
|
193
192
|
}
|
|
194
193
|
}
|
|
195
194
|
}
|
|
196
|
-
async getSharedItem(key) {
|
|
197
|
-
let prefix = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
|
|
195
|
+
async getSharedItem(key, prefix = true) {
|
|
198
196
|
if (Platform.OS === 'android') {
|
|
199
197
|
return await SharedPreferencesModule.getItem(key);
|
|
200
198
|
} else {
|
|
@@ -222,10 +220,7 @@ class Storage {
|
|
|
222
220
|
} else {
|
|
223
221
|
const keys = await AsyncStorage.getAllKeys();
|
|
224
222
|
const data = await AsyncStorage.multiGet(keys);
|
|
225
|
-
const dataArray = data.map(
|
|
226
|
-
let [key, value] = _ref;
|
|
227
|
-
return [key, value];
|
|
228
|
-
});
|
|
223
|
+
const dataArray = data.map(([key, value]) => [key, value]);
|
|
229
224
|
return dataArray;
|
|
230
225
|
}
|
|
231
226
|
}
|
|
@@ -244,8 +239,7 @@ class Storage {
|
|
|
244
239
|
await this.clearStorage();
|
|
245
240
|
}
|
|
246
241
|
}
|
|
247
|
-
async removeSharedItem(key) {
|
|
248
|
-
let prefix = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
|
|
242
|
+
async removeSharedItem(key, prefix = true) {
|
|
249
243
|
if (Platform.OS === 'android') {
|
|
250
244
|
await SharedPreferencesModule.removeItem(key);
|
|
251
245
|
} else {
|
|
@@ -266,7 +260,7 @@ class Storage {
|
|
|
266
260
|
}
|
|
267
261
|
|
|
268
262
|
// const storage = new Storage();
|
|
269
|
-
|
|
263
|
+
_Storage = Storage;
|
|
270
264
|
_defineProperty(Storage, "classInstance", void 0);
|
|
271
265
|
// private prefixKey: string;
|
|
272
266
|
_defineProperty(Storage, "prefixKey", void 0);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["LOCAL_STORAGE_KEY_PREFIX","AsyncStorage","Logger","LOG_TYPE","NativeModules","Platform","LAST_SYNCED_EVENT_ID","SCAN_MERGED_OBJ_ID_OUTPUT","SHARED_PREFERENCE_DISPATCH_ID","SHARED_PREFERENCE_SCAN_OUTPUT","SharedPreferencesModule","Storage","constructor","getInstance","classInstance","prefixKey","getItem","key","TypeError","setItem","value","setObject","JSON","stringify","setMultiObject","input","some","arg","Array","isArray","length","Object","keys","multiSet","map","v","error","logEvent","SDK_ERROR","getObject","val","obj","parse","getMultiObject","items","multiGet","i","clearStorage","deleteItem","removeItem","deleteMultiple","alteredKeys","k","startsWith","multiRemove","getAllKeys","prefix","filter","setSharedItem","arguments","undefined","OS","setSharedItems","setItems","getSharedItem","item","getSharedItems","getItems","mappedResponse","getSharedAll","getAll","data","dataArray","_ref","getAllSharedKeys","clearShared","clear","removeSharedItem","removeSharedItems","removeItems","_class","_defineProperty"],"sources":["storage.ts"],"sourcesContent":["import { LOCAL_STORAGE_KEY_PREFIX } from './../constants/constants';\nimport AsyncStorage from '@react-native-async-storage/async-storage';\nimport Logger, { LOG_TYPE } from './Logger';\nimport { NativeModules, Platform } from 'react-native';\nimport { LAST_SYNCED_EVENT_ID, SCAN_MERGED_OBJ_ID_OUTPUT, SHARED_PREFERENCE_DISPATCH_ID, SHARED_PREFERENCE_SCAN_OUTPUT } from '../manager/syncmanager/constants';\n\ninterface MultiObject {\n key: string;\n value: {} | [];\n}\n\nconst { SharedPreferencesModule } = NativeModules;\n\n/**\n * Creating a wrapper arround localstorage as https://reactnative.dev/docs/asyncstorage\n * depreciated using communiity package instead https://github.com/react-native-async-storage/async-storage\n *\n * @class Storage\n */\nclass Storage {\n private static classInstance?: Storage;\n // private prefixKey: string;\n static prefixKey: string;\n private constructor() { }\n\n public static getInstance(): Storage {\n if (!this.classInstance) {\n this.classInstance = new Storage();\n Storage.prefixKey = LOCAL_STORAGE_KEY_PREFIX;\n }\n return this.classInstance;\n }\n /**\n * Get a single item\n *\n * @param {string} key\n * @returns {Promise<string | null>}\n */\n async getItem(key: string): Promise<string | null> {\n if (!key) {\n throw new TypeError('In-valid params.');\n }\n return await AsyncStorage.getItem(Storage.prefixKey + key);\n }\n\n /**\n * Save a single itema\n *\n * @param {string} key\n * @returns {Promise<void>}\n */\n async setItem(key: string, value: string): Promise<void> {\n if (!(key && value)) {\n throw TypeError('In-valid params.');\n }\n return await AsyncStorage.setItem(Storage.prefixKey + key, value);\n }\n\n /**\n * Save a Object\n *\n * @param {string} key\n * @returns {Promise<{}|[]>}\n */\n async setObject(key: string, value: {} | []): Promise<void> {\n if (!key) {\n throw TypeError('In-valid params.');\n } else {\n return await AsyncStorage.setItem(\n Storage.prefixKey + key,\n JSON.stringify(value)\n );\n }\n }\n\n /**\n *\n * @param input: Array<MultiObject>\n * @returns\n */\n async setMultiObject(input: Array<MultiObject>): Promise<void> {\n if (\n input.some(\n (arg) =>\n (!(arg.key && arg.value) && typeof arg.value !== 'object') ||\n (Array.isArray(arg.value) && arg.value.length === 0) ||\n Object.keys(arg.value).length === 0\n )\n ) {\n throw TypeError(`In-valid params: ${input}`);\n } else {\n try {\n return await AsyncStorage.multiSet(\n input.map((arg) => {\n const v: [string, string] = [\n Storage.prefixKey + arg.key,\n JSON.stringify(arg.value),\n ];\n return v;\n })\n );\n } catch (error) {\n Logger.getInstance().logEvent(\n '~ setMultiObject Async Storage',\n 'Unable to multiSet data in Async Storage',\n LOG_TYPE.SDK_ERROR\n );\n }\n }\n }\n\n /**\n * Get an Object\n *\n * @param {string} key\n * @returns {Promise<void>}\n */\n // the return type of the function could be made as Generic\n async getObject(key: string): Promise<{} | [] | null> {\n if (!key) {\n throw new TypeError('In-valid params.');\n }\n let val: string | null = await AsyncStorage.getItem(\n Storage.prefixKey + key\n );\n if (val !== null) {\n const obj = JSON.parse(val);\n return obj;\n } else {\n return null;\n }\n }\n\n /**\n * Get an Object\n *\n * @param {string} keys\n * @returns {Promise<void>}\n */\n\n async getMultiObject(keys: string[]): Promise<any[][]> {\n if (!keys) {\n throw new TypeError(`Read In-valid params: ${keys}`);\n }\n let items = await AsyncStorage.multiGet(\n keys.map((key) => Storage.prefixKey + key)\n );\n if (items) {\n return items.map((i) => {\n if (i[1]) return [i[0], JSON.parse(i[1])];\n else return [i[0], null];\n });\n } else {\n return [[]];\n }\n }\n\n async clearStorage(): Promise<void> {\n // AsyncStorage.clear();\n await this.deleteItem(LAST_SYNCED_EVENT_ID);\n await this.deleteItem(SHARED_PREFERENCE_DISPATCH_ID);\n await this.deleteItem(SHARED_PREFERENCE_SCAN_OUTPUT);\n await this.deleteItem(SCAN_MERGED_OBJ_ID_OUTPUT);\n }\n\n /**\n * Deletes a single item\n * @param {string} key\n * @returns {Promise<void>}\n */\n // need to handle cases for wrongs keys\n async deleteItem(key: string): Promise<void> {\n if (!key) {\n throw new TypeError('In-valid params.');\n }\n await AsyncStorage.removeItem(Storage.prefixKey + key);\n }\n\n async deleteMultiple(keys: string[]) {\n if (!keys || keys.length === 0) {\n throw new TypeError('In-valid params.');\n }\n const alteredKeys = keys.map((k) => {\n if (k.startsWith(Storage.prefixKey)) {\n return k;\n } else {\n return Storage.prefixKey + k;\n }\n });\n await AsyncStorage.multiRemove(alteredKeys);\n }\n\n async getAllKeys(prefix: string): Promise<string[]> {\n if (!prefix) {\n throw new TypeError('In-valid params.');\n }\n const keys = await AsyncStorage.getAllKeys();\n return keys.filter((key) => {\n return key.startsWith(Storage.prefixKey + prefix);\n });\n }\n\n /**\n * Shared preferences\n */\n async setSharedItem(key: string, value: string, prefix: boolean = true): Promise<void> {\n if (Platform.OS === 'android') {\n await SharedPreferencesModule.setItem(key, value);\n } else {\n if (prefix) {\n await this.setItem(key, value);\n } else {\n await AsyncStorage.setItem(key, value);\n }\n }\n }\n\n async setSharedItems(items: { key: string; value: string }[]): Promise<void> {\n if (Platform.OS === 'android') {\n await SharedPreferencesModule.setItems(JSON.stringify(items));\n } else {\n for (let i = 0; i < items.length; i++) {\n await AsyncStorage.setItem(items[i].key, items[i].value);\n }\n }\n }\n\n async getSharedItem(key: string, prefix: boolean = true): Promise<any> {\n if (Platform.OS === 'android') {\n return await SharedPreferencesModule.getItem(key);\n } else {\n if (prefix) {\n let item = await this.getItem(key);\n return item;\n } else {\n let item = await AsyncStorage.getItem(key);\n return item;\n }\n }\n }\n\n async getSharedItems(key: string[]): Promise<string[][]> {\n if (Platform.OS === 'android') {\n return await SharedPreferencesModule.getItems(key);\n } else {\n let keys = await AsyncStorage.multiGet(key);\n const mappedResponse = keys.map((item) => [\n item[0],\n item[1] ? item[1] : '',\n ]);\n return mappedResponse;\n }\n }\n\n async getSharedAll(): Promise<any[][]> {\n if (Platform.OS === 'android') {\n return await SharedPreferencesModule.getAll();\n } else {\n const keys = await AsyncStorage.getAllKeys();\n const data = await AsyncStorage.multiGet(keys);\n const dataArray = data.map(([key, value]) => [key, value]);\n return dataArray;\n }\n }\n\n async getAllSharedKeys(): Promise<string[]> {\n if (Platform.OS === 'android') {\n return await SharedPreferencesModule.getAllKeys();\n } else {\n let keys = await this.getAllKeys(Storage.prefixKey);\n return keys;\n }\n }\n\n async clearShared(): Promise<void> {\n if (Platform.OS === 'android') {\n await SharedPreferencesModule.clear();\n } else {\n await this.clearStorage();\n }\n }\n\n async removeSharedItem(key: string, prefix: boolean = true): Promise<void> {\n if (Platform.OS === 'android') {\n await SharedPreferencesModule.removeItem(key);\n } else {\n if (prefix) {\n await this.deleteItem(key);\n } else {\n await AsyncStorage.removeItem(key);\n }\n }\n }\n\n async removeSharedItems(key: string[]): Promise<void> {\n if (Platform.OS === 'android') {\n await SharedPreferencesModule.removeItems(key);\n } else {\n await AsyncStorage.multiRemove(key);\n }\n }\n}\n\n// const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SCAN_MERGED_OBJ_ID_OUTPUT","SHARED_PREFERENCE_DISPATCH_ID","SHARED_PREFERENCE_SCAN_OUTPUT","SharedPreferencesModule","Storage","constructor","getInstance","classInstance","prefixKey","getItem","key","TypeError","setItem","value","setObject","JSON","stringify","setMultiObject","input","some","arg","Array","isArray","length","Object","keys","multiSet","map","v","error","logEvent","SDK_ERROR","getObject","val","obj","parse","getMultiObject","items","multiGet","i","clearStorage","deleteItem","removeItem","deleteMultiple","alteredKeys","k","startsWith","multiRemove","getAllKeys","prefix","filter","setSharedItem","OS","setSharedItems","setItems","getSharedItem","item","getSharedItems","getItems","mappedResponse","getSharedAll","getAll","data","dataArray","getAllSharedKeys","clearShared","clear","removeSharedItem","removeSharedItems","removeItems","_Storage","_defineProperty"],"sources":["storage.ts"],"sourcesContent":["import { LOCAL_STORAGE_KEY_PREFIX } from './../constants/constants';\nimport AsyncStorage from '@react-native-async-storage/async-storage';\nimport Logger, { LOG_TYPE } from './Logger';\nimport { NativeModules, Platform } from 'react-native';\nimport { LAST_SYNCED_EVENT_ID, SCAN_MERGED_OBJ_ID_OUTPUT, SHARED_PREFERENCE_DISPATCH_ID, SHARED_PREFERENCE_SCAN_OUTPUT } from '../manager/syncmanager/constants';\n\ninterface MultiObject {\n key: string;\n value: {} | [];\n}\n\nconst { SharedPreferencesModule } = NativeModules;\n\n/**\n * Creating a wrapper arround localstorage as https://reactnative.dev/docs/asyncstorage\n * depreciated using communiity package instead https://github.com/react-native-async-storage/async-storage\n *\n * @class Storage\n */\nclass Storage {\n private static classInstance?: Storage;\n // private prefixKey: string;\n static prefixKey: string;\n private constructor() { }\n\n public static getInstance(): Storage {\n if (!this.classInstance) {\n this.classInstance = new Storage();\n Storage.prefixKey = LOCAL_STORAGE_KEY_PREFIX;\n }\n return this.classInstance;\n }\n /**\n * Get a single item\n *\n * @param {string} key\n * @returns {Promise<string | null>}\n */\n async getItem(key: string): Promise<string | null> {\n if (!key) {\n throw new TypeError('In-valid params.');\n }\n return await AsyncStorage.getItem(Storage.prefixKey + key);\n }\n\n /**\n * Save a single itema\n *\n * @param {string} key\n * @returns {Promise<void>}\n */\n async setItem(key: string, value: string): Promise<void> {\n if (!(key && value)) {\n throw TypeError('In-valid params.');\n }\n return await AsyncStorage.setItem(Storage.prefixKey + key, value);\n }\n\n /**\n * Save a Object\n *\n * @param {string} key\n * @returns {Promise<{}|[]>}\n */\n async setObject(key: string, value: {} | []): Promise<void> {\n if (!key) {\n throw TypeError('In-valid params.');\n } else {\n return await AsyncStorage.setItem(\n Storage.prefixKey + key,\n JSON.stringify(value)\n );\n }\n }\n\n /**\n *\n * @param input: Array<MultiObject>\n * @returns\n */\n async setMultiObject(input: Array<MultiObject>): Promise<void> {\n if (\n input.some(\n (arg) =>\n (!(arg.key && arg.value) && typeof arg.value !== 'object') ||\n (Array.isArray(arg.value) && arg.value.length === 0) ||\n Object.keys(arg.value).length === 0\n )\n ) {\n throw TypeError(`In-valid params: ${input}`);\n } else {\n try {\n return await AsyncStorage.multiSet(\n input.map((arg) => {\n const v: [string, string] = [\n Storage.prefixKey + arg.key,\n JSON.stringify(arg.value),\n ];\n return v;\n })\n );\n } catch (error) {\n Logger.getInstance().logEvent(\n '~ setMultiObject Async Storage',\n 'Unable to multiSet data in Async Storage',\n LOG_TYPE.SDK_ERROR\n );\n }\n }\n }\n\n /**\n * Get an Object\n *\n * @param {string} key\n * @returns {Promise<void>}\n */\n // the return type of the function could be made as Generic\n async getObject(key: string): Promise<{} | [] | null> {\n if (!key) {\n throw new TypeError('In-valid params.');\n }\n let val: string | null = await AsyncStorage.getItem(\n Storage.prefixKey + key\n );\n if (val !== null) {\n const obj = JSON.parse(val);\n return obj;\n } else {\n return null;\n }\n }\n\n /**\n * Get an Object\n *\n * @param {string} keys\n * @returns {Promise<void>}\n */\n\n async getMultiObject(keys: string[]): Promise<any[][]> {\n if (!keys) {\n throw new TypeError(`Read In-valid params: ${keys}`);\n }\n let items = await AsyncStorage.multiGet(\n keys.map((key) => Storage.prefixKey + key)\n );\n if (items) {\n return items.map((i) => {\n if (i[1]) return [i[0], JSON.parse(i[1])];\n else return [i[0], null];\n });\n } else {\n return [[]];\n }\n }\n\n async clearStorage(): Promise<void> {\n // AsyncStorage.clear();\n await this.deleteItem(LAST_SYNCED_EVENT_ID);\n await this.deleteItem(SHARED_PREFERENCE_DISPATCH_ID);\n await this.deleteItem(SHARED_PREFERENCE_SCAN_OUTPUT);\n await this.deleteItem(SCAN_MERGED_OBJ_ID_OUTPUT);\n }\n\n /**\n * Deletes a single item\n * @param {string} key\n * @returns {Promise<void>}\n */\n // need to handle cases for wrongs keys\n async deleteItem(key: string): Promise<void> {\n if (!key) {\n throw new TypeError('In-valid params.');\n }\n await AsyncStorage.removeItem(Storage.prefixKey + key);\n }\n\n async deleteMultiple(keys: string[]) {\n if (!keys || keys.length === 0) {\n throw new TypeError('In-valid params.');\n }\n const alteredKeys = keys.map((k) => {\n if (k.startsWith(Storage.prefixKey)) {\n return k;\n } else {\n return Storage.prefixKey + k;\n }\n });\n await AsyncStorage.multiRemove(alteredKeys);\n }\n\n async getAllKeys(prefix: string): Promise<string[]> {\n if (!prefix) {\n throw new TypeError('In-valid params.');\n }\n const keys = await AsyncStorage.getAllKeys();\n return keys.filter((key) => {\n return key.startsWith(Storage.prefixKey + prefix);\n });\n }\n\n /**\n * Shared preferences\n */\n async setSharedItem(key: string, value: string, prefix: boolean = true): Promise<void> {\n if (Platform.OS === 'android') {\n await SharedPreferencesModule.setItem(key, value);\n } else {\n if (prefix) {\n await this.setItem(key, value);\n } else {\n await AsyncStorage.setItem(key, value);\n }\n }\n }\n\n async setSharedItems(items: { key: string; value: string }[]): Promise<void> {\n if (Platform.OS === 'android') {\n await SharedPreferencesModule.setItems(JSON.stringify(items));\n } else {\n for (let i = 0; i < items.length; i++) {\n await AsyncStorage.setItem(items[i].key, items[i].value);\n }\n }\n }\n\n async getSharedItem(key: string, prefix: boolean = true): Promise<any> {\n if (Platform.OS === 'android') {\n return await SharedPreferencesModule.getItem(key);\n } else {\n if (prefix) {\n let item = await this.getItem(key);\n return item;\n } else {\n let item = await AsyncStorage.getItem(key);\n return item;\n }\n }\n }\n\n async getSharedItems(key: string[]): Promise<string[][]> {\n if (Platform.OS === 'android') {\n return await SharedPreferencesModule.getItems(key);\n } else {\n let keys = await AsyncStorage.multiGet(key);\n const mappedResponse = keys.map((item) => [\n item[0],\n item[1] ? item[1] : '',\n ]);\n return mappedResponse;\n }\n }\n\n async getSharedAll(): Promise<any[][]> {\n if (Platform.OS === 'android') {\n return await SharedPreferencesModule.getAll();\n } else {\n const keys = await AsyncStorage.getAllKeys();\n const data = await AsyncStorage.multiGet(keys);\n const dataArray = data.map(([key, value]) => [key, value]);\n return dataArray;\n }\n }\n\n async getAllSharedKeys(): Promise<string[]> {\n if (Platform.OS === 'android') {\n return await SharedPreferencesModule.getAllKeys();\n } else {\n let keys = await this.getAllKeys(Storage.prefixKey);\n return keys;\n }\n }\n\n async clearShared(): Promise<void> {\n if (Platform.OS === 'android') {\n await SharedPreferencesModule.clear();\n } else {\n await this.clearStorage();\n }\n }\n\n async removeSharedItem(key: string, prefix: boolean = true): Promise<void> {\n if (Platform.OS === 'android') {\n await SharedPreferencesModule.removeItem(key);\n } else {\n if (prefix) {\n await this.deleteItem(key);\n } else {\n await AsyncStorage.removeItem(key);\n }\n }\n }\n\n async removeSharedItems(key: string[]): Promise<void> {\n if (Platform.OS === 'android') {\n await SharedPreferencesModule.removeItems(key);\n } else {\n await AsyncStorage.multiRemove(key);\n }\n }\n}\n\n// const storage = new Storage();\nexport default Storage;\n"],"mappings":";;;;AAAA,SAASA,wBAAwB,QAAQ,0BAA0B;AACnE,OAAOC,YAAY,MAAM,2CAA2C;AACpE,OAAOC,MAAM,IAAIC,QAAQ,QAAQ,UAAU;AAC3C,SAASC,aAAa,EAAEC,QAAQ,QAAQ,cAAc;AACtD,SAASC,oBAAoB,EAAEC,yBAAyB,EAAEC,6BAA6B,EAAEC,6BAA6B,QAAQ,kCA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AU,CAAChC,GAAG,CAAC;IAC/C,CAAC,MAAM;MACL,IAAIuC,MAAM,EAAE;QACV,MAAM,IAAI,CAACR,UAAU,CAAC/B,GAAG,CAAC;MAC5B,CAAC,MAAM;QACL,MAAMhB,YAAY,CAACgD,UAAU,CAAChC,GAAG,CAAC;MACpC;IACF;EACF;EAEA,MAAM0D,iBAAiBA,CAAC1D,GAAa,EAAiB;IACpD,IAAIZ,QAAQ,CAACsD,EAAE,KAAK,SAAS,EAAE;MAC7B,MAAMjD,uBAAuB,CAACkE,WAAW,CAAC3D,GAAG,CAAC;IAChD,CAAC,MAAM;MACL,MAAMhB,YAAY,CAACqD,WAAW,CAACrC,GAAG,CAAC;IACrC;EACF;AACF;;AAEA;AAAA4D,QAAA,GA5RMlE,OAAO;AAAAmE,eAAA,CAAPnE,OAAO;AAEX;AAAAmE,eAAA,CAFInE,OAAO;AA6Rb,eAAeA,OAAO","ignoreList":[]}
|
|
@@ -23,8 +23,7 @@ export function isTokenExpired(accessToken) {
|
|
|
23
23
|
let decodedData = jwtDecode(accessToken);
|
|
24
24
|
return !(decodedData && decodedData.exp * 1000 > Date.now());
|
|
25
25
|
}
|
|
26
|
-
export function flattenObject(obj) {
|
|
27
|
-
let prefix = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
|
|
26
|
+
export function flattenObject(obj, prefix = '') {
|
|
28
27
|
return JSON.stringify(obj);
|
|
29
28
|
}
|
|
30
29
|
export function createObjectWithoutNullValues(obj) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["jwtDecode","isEmptyOrBlank","str","length","test","isMandatoryKeysPresent","obj","keys","i","undefined","isTokenExpired","accessToken","decodedData","exp","Date","now","flattenObject","prefix","
|
|
1
|
+
{"version":3,"names":["jwtDecode","isEmptyOrBlank","str","length","test","isMandatoryKeysPresent","obj","keys","i","undefined","isTokenExpired","accessToken","decodedData","exp","Date","now","flattenObject","prefix","JSON","stringify","createObjectWithoutNullValues","newObj","key","Object","prototype","hasOwnProperty","call"],"sources":["utils.ts"],"sourcesContent":["import jwtDecode from 'jwt-decode';\n\nexport function isEmptyOrBlank(str: string | null | undefined) {\n return !str || str.length === 0 || /^\\s*$/.test(str);\n}\n\nexport function isMandatoryKeysPresent(obj: object, keys: string[]): boolean {\n if (!obj) return false;\n if (keys?.length === 0) return true;\n for (let i = 0; i < keys.length; i++) {\n // @ts-ignore\n if (\n // @ts-ignore\n !(keys[i] in obj) ||\n // @ts-ignore\n obj[keys[i]] === null ||\n // @ts-ignore\n obj[keys[i]] === undefined ||\n // @ts-ignore\n obj[keys[i]] === ''\n )\n return false;\n }\n return true;\n}\n\nexport function isTokenExpired(accessToken: string) {\n let decodedData: any = jwtDecode(accessToken);\n return !(decodedData && decodedData.exp * 1000 > Date.now());\n}\n\nexport function flattenObject(obj: Record<string, any>, prefix = ''): string {\n return JSON.stringify(obj);\n}\n\n\nexport function createObjectWithoutNullValues<T extends { [key: string]: any }>(obj: T): Partial<T> {\n const newObj: Partial<T> = {};\n for (const key in obj) {\n if (Object.prototype.hasOwnProperty.call(obj, key) && obj[key] !== null && obj[key] !== 'request' && obj[key] !== 'headers') {\n newObj[key] = obj[key];\n }\n }\n return newObj;\n}"],"mappings":"AAAA,OAAOA,SAAS,MAAM,YAAY;AAElC,OAAO,SAASC,cAAcA,CAACC,GAA8B,EAAE;EAC7D,OAAO,CAACA,GAAG,IAAIA,GAAG,CAACC,MAAM,KAAK,CAAC,IAAI,OAAO,CAACC,IAAI,CAACF,GAAG,CAAC;AACtD;AAEA,OAAO,SAASG,sBAAsBA,CAACC,GAAW,EAAEC,IAAc,EAAW;EAC3E,IAAI,CAACD,GAAG,EAAE,OAAO,KAAK;EACtB,IAAI,CAAAC,IAAI,aAAJA,IAAI,uBAAJA,IAAI,CAAEJ,MAAM,MAAK,CAAC,EAAE,OAAO,IAAI;EACnC,KAAK,IAAIK,CAAC,GAAG,CAAC,EAAEA,CAAC,GAAGD,IAAI,CAACJ,MAAM,EAAEK,CAAC,EAAE,EAAE;IACpC;IACA;IACE;IACA,EAAED,IAAI,CAACC,CAAC,CAAC,IAAIF,GAAG,CAAC;IACjB;IACAA,GAAG,CAACC,IAAI,CAACC,CAAC,CAAC,CAAC,KAAK,IAAI;IACrB;IACAF,GAAG,CAACC,IAAI,CAACC,CAAC,CAAC,CAAC,KAAKC,SAAS;IAC1B;IACAH,GAAG,CAACC,IAAI,CAACC,CAAC,CAAC,CAAC,KAAK,EAAE,EAEnB,OAAO,KAAK;EAChB;EACA,OAAO,IAAI;AACb;AAEA,OAAO,SAASE,cAAcA,CAACC,WAAmB,EAAE;EAClD,IAAIC,WAAgB,GAAGZ,SAAS,CAACW,WAAW,CAAC;EAC7C,OAAO,EAAEC,WAAW,IAAIA,WAAW,CAACC,GAAG,GAAG,IAAI,GAAGC,IAAI,CAACC,GAAG,CAAC,CAAC,CAAC;AAC9D;AAEA,OAAO,SAASC,aAAaA,CAACV,GAAwB,EAAEW,MAAM,GAAG,EAAE,EAAU;EAC3E,OAAOC,IAAI,CAACC,SAAS,CAACb,GAAG,CAAC;AAC5B;AAGA,OAAO,SAASc,6BAA6BA,CAAmCd,GAAM,EAAc;EAClG,MAAMe,MAAkB,GAAG,CAAC,CAAC;EAC7B,KAAK,MAAMC,GAAG,IAAIhB,GAAG,EAAE;IACnB,IAAIiB,MAAM,CAACC,SAAS,CAACC,cAAc,CAACC,IAAI,CAACpB,GAAG,EAAEgB,GAAG,CAAC,IAAIhB,GAAG,CAACgB,GAAG,CAAC,KAAK,IAAI,IAAIhB,GAAG,CAACgB,GAAG,CAAC,KAAK,SAAS,IAAIhB,GAAG,CAACgB,GAAG,CAAC,KAAK,SAAS,EAAE;MACzHD,MAAM,CAACC,GAAG,CAAC,GAAGhB,GAAG,CAACgB,GAAG,CAAC;IAC1B;EACJ;EACA,OAAOD,MAAM;AACf","ignoreList":[]}
|
|
@@ -35,7 +35,9 @@ import SLDropCash from './dropCash/SLDropCash';
|
|
|
35
35
|
import HttpRequestET from './httpRequest/HttpRequestET';
|
|
36
36
|
import ScanET from './scan/ScanET';
|
|
37
37
|
import ValidateOTPET from './validateOTP/ValidateOTPET';
|
|
38
|
+
import CollectPaymentET from './collectPayment/CollectPayment';
|
|
38
39
|
import type { ScannerInput, ScannerOutput } from './scan/ScanSchema';
|
|
39
40
|
import type { ValidateOTPInput, ValidateOTPOutput } from './validateOTP/ValidateOTPSchema';
|
|
40
|
-
|
|
41
|
-
export {
|
|
41
|
+
import type { CollectPaymentInput, CollectPaymentOutput } from './collectPayment/CollectPaymentSchema';
|
|
42
|
+
export type { CancellationInput, CancellationOutput, DeliverETInput, DeliverOutput, LineItem, DeliverRemarks, DisplayETInput, DisplayETOutput, SignatureInput, SignatureOutput, FormInputSchema, FormOutputSchema, CaptureOutput, CaptureInput, VerifyLocationOutput, VerifyLocationInput, CompletePaymentInput, CompletePaymentOutput, InitPaymentInput, InitPaymentOutput, ProcessPaymentInput, ProcessPaymentOutput, PickupETInput, PickupETOutput, BaseETResponse, OtpInputSchema, OtpOutputSchema, CaptureTextInput, CaptureTextOutput, VerifyInput, VerifyInputResponse, DropCashInput, DropCashOutput, ScannerInput, ScannerOutput, ValidateOTPInput, ValidateOTPOutput, CollectPaymentInput, CollectPaymentOutput, };
|
|
43
|
+
export { CancelET, DeliverET, DisplayModalET, SignatureET, FormGenerator, ImageCapture, VerifyLocationET, verifyLocation, PickupET, VerifyOtpET, CaptureText, InitPaymentET, ProcessPaymentET, DropCashET, CompletePaymentET, SLDeliverET, SLPickupET, SLDropCash, HttpRequestET, ScanET, ValidateOTPET, CollectPaymentET, };
|
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
import { BaseETRequest, BaseETResponse } from '../../../models/execTasks/ETBaseModels';
|
|
2
|
+
import { HTTPMethod, HTTPRequestBody } from '../httpRequest/HttpRequestETSchema';
|
|
3
|
+
import { Headers, PathParams, QueryParams } from '../../../utils/ApiUtils';
|
|
4
|
+
export type AllowedModes = 'CASH' | 'QR_CODE' | 'PAYMENT_LINK' | 'ONLINE';
|
|
5
|
+
export type OnsiteLink = 'Phone Number' | 'Email';
|
|
6
|
+
export interface ETAmount {
|
|
7
|
+
value: number;
|
|
8
|
+
currencyCode: string;
|
|
9
|
+
}
|
|
10
|
+
export interface API {
|
|
11
|
+
uri: string;
|
|
12
|
+
timeout?: number;
|
|
13
|
+
httpMethod: HTTPMethod;
|
|
14
|
+
headers?: Headers[];
|
|
15
|
+
requestBody?: HTTPRequestBody;
|
|
16
|
+
queryParams?: QueryParams[];
|
|
17
|
+
pathParams?: PathParams[];
|
|
18
|
+
responseJsonLogic: object;
|
|
19
|
+
errorJsonLogic: object;
|
|
20
|
+
}
|
|
21
|
+
export type CollectPaymentInput = BaseETRequest & {
|
|
22
|
+
allowedModes: AllowedModes[];
|
|
23
|
+
plModes?: string[];
|
|
24
|
+
expectedAmount: number;
|
|
25
|
+
onsiteLinkSharing?: OnsiteLink[];
|
|
26
|
+
onSubmitET: (output: CollectPaymentOutput) => void;
|
|
27
|
+
next: (output: CollectPaymentOutput & {
|
|
28
|
+
screen: PAYMENT_SCREEN;
|
|
29
|
+
contactDetails?: string;
|
|
30
|
+
sourceScreen: PAYMENT_SCREEN;
|
|
31
|
+
}) => void;
|
|
32
|
+
screen: PAYMENT_SCREEN;
|
|
33
|
+
sourceScreen: PAYMENT_SCREEN;
|
|
34
|
+
};
|
|
35
|
+
export interface ProcessPaymentInput {
|
|
36
|
+
paymentMode: AllowedModes;
|
|
37
|
+
contactDetails?: string;
|
|
38
|
+
}
|
|
39
|
+
export interface CompletePaymentInput {
|
|
40
|
+
paymentMode: AllowedModes;
|
|
41
|
+
}
|
|
42
|
+
export type CollectPaymentOutput = BaseETResponse & {
|
|
43
|
+
refId: string;
|
|
44
|
+
collectedAmount: ETAmount;
|
|
45
|
+
paymentMeta?: {};
|
|
46
|
+
paymentMode: AllowedModes;
|
|
47
|
+
};
|
|
48
|
+
export interface QrResponse {
|
|
49
|
+
data: {
|
|
50
|
+
qrCode?: string;
|
|
51
|
+
txnId?: string;
|
|
52
|
+
paymentCompleted?: boolean;
|
|
53
|
+
status?: STATUS;
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
export interface QR_REQUEST_BODY {
|
|
57
|
+
refId: string;
|
|
58
|
+
appAbbr: string;
|
|
59
|
+
money: {
|
|
60
|
+
amount: number;
|
|
61
|
+
currency: string;
|
|
62
|
+
};
|
|
63
|
+
userInfo?: {
|
|
64
|
+
phone?: {
|
|
65
|
+
countryCode: string;
|
|
66
|
+
mobileNumber: string;
|
|
67
|
+
};
|
|
68
|
+
};
|
|
69
|
+
pgConfigId?: string;
|
|
70
|
+
description?: string;
|
|
71
|
+
meta?: {
|
|
72
|
+
[key: string]: any;
|
|
73
|
+
};
|
|
74
|
+
}
|
|
75
|
+
export interface PaymentStatusResponse {
|
|
76
|
+
data: {
|
|
77
|
+
meta?: {
|
|
78
|
+
totalCount?: number;
|
|
79
|
+
};
|
|
80
|
+
transactions?: {
|
|
81
|
+
refId: string;
|
|
82
|
+
status: STATUS;
|
|
83
|
+
subStatus: SUB_STATUS;
|
|
84
|
+
money: {
|
|
85
|
+
amount: number;
|
|
86
|
+
currency: string;
|
|
87
|
+
};
|
|
88
|
+
txnId: string;
|
|
89
|
+
txnType: TRANSACTION_TYPE;
|
|
90
|
+
appAbbr: string;
|
|
91
|
+
}[];
|
|
92
|
+
};
|
|
93
|
+
}
|
|
94
|
+
export interface PaymentLinkResponse {
|
|
95
|
+
txnId: string;
|
|
96
|
+
refId: string;
|
|
97
|
+
status?: STATUS;
|
|
98
|
+
}
|
|
99
|
+
export interface notificationPaymentStatus {
|
|
100
|
+
refId: string;
|
|
101
|
+
status: STATUS;
|
|
102
|
+
}
|
|
103
|
+
export declare enum STATUS {
|
|
104
|
+
INITIATED = "INITIATED",
|
|
105
|
+
FAILED = "FAILED",
|
|
106
|
+
SUCCESS = "SUCCESS"
|
|
107
|
+
}
|
|
108
|
+
export declare enum SUB_STATUS {
|
|
109
|
+
completed = "completed",
|
|
110
|
+
expired = "expired",
|
|
111
|
+
created = "created",
|
|
112
|
+
plFailed = "plFailed",
|
|
113
|
+
qrFailed = "qrFailed",
|
|
114
|
+
paymentFailed = "paymentFailed",
|
|
115
|
+
closed = "closed"
|
|
116
|
+
}
|
|
117
|
+
export declare enum PAYMENT_SCREEN {
|
|
118
|
+
INIT = "INIT",
|
|
119
|
+
CONTACTS = "CONTACTS",
|
|
120
|
+
PROCESS = "PROCESS",
|
|
121
|
+
COMPLETE = "COMPLETE"
|
|
122
|
+
}
|
|
123
|
+
export interface sharedPrefPaymentDataInterface {
|
|
124
|
+
paymentMode: AllowedModes;
|
|
125
|
+
amount: ETAmount;
|
|
126
|
+
moIds: string[];
|
|
127
|
+
previousSelection?: AllowedModes[];
|
|
128
|
+
}
|
|
129
|
+
export interface PaymentEventDataInterface {
|
|
130
|
+
refId: string;
|
|
131
|
+
money: {
|
|
132
|
+
amount: number;
|
|
133
|
+
currency: string;
|
|
134
|
+
};
|
|
135
|
+
contactDetails?: string;
|
|
136
|
+
paymentLink?: string;
|
|
137
|
+
}
|
|
138
|
+
export interface PaymentConfigResponse {
|
|
139
|
+
data: {
|
|
140
|
+
configDetails: {
|
|
141
|
+
tenantId: string;
|
|
142
|
+
paymentMethods: PaymentMethods;
|
|
143
|
+
modesMapping: object;
|
|
144
|
+
}[];
|
|
145
|
+
};
|
|
146
|
+
}
|
|
147
|
+
export interface PaymentMethods {
|
|
148
|
+
QR: boolean;
|
|
149
|
+
paymentLink: boolean;
|
|
150
|
+
modes?: object;
|
|
151
|
+
}
|
|
152
|
+
export declare enum TRANSACTION_TYPE {
|
|
153
|
+
LINK = "link",
|
|
154
|
+
QRCODE = "qrCode"
|
|
155
|
+
}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
export declare const PaymentStyles: {
|
|
2
|
+
amountStyle: {
|
|
3
|
+
fontSize: number;
|
|
4
|
+
fontWeight: "600";
|
|
5
|
+
fontStyle: "normal";
|
|
6
|
+
textAlign: "center";
|
|
7
|
+
alignItems: "center";
|
|
8
|
+
paddingTop: number;
|
|
9
|
+
paddingBottom: number;
|
|
10
|
+
fontFamily: string;
|
|
11
|
+
};
|
|
12
|
+
messageStyle: {
|
|
13
|
+
fontFamily: string;
|
|
14
|
+
backgroundColor: string;
|
|
15
|
+
color: string;
|
|
16
|
+
padding: number;
|
|
17
|
+
fontStyle: "normal";
|
|
18
|
+
fontWeight: "normal";
|
|
19
|
+
fontSize: number;
|
|
20
|
+
};
|
|
21
|
+
textStyle1: {
|
|
22
|
+
fontFamily: string;
|
|
23
|
+
marginTop: number;
|
|
24
|
+
marginStart: number;
|
|
25
|
+
marginEnd: number;
|
|
26
|
+
color: string;
|
|
27
|
+
fontStyle: "normal";
|
|
28
|
+
fontWeight: "normal";
|
|
29
|
+
fontSize: number;
|
|
30
|
+
};
|
|
31
|
+
reasonTextStyle: {
|
|
32
|
+
flex: number;
|
|
33
|
+
flexWrap: "wrap";
|
|
34
|
+
fontFamily: string;
|
|
35
|
+
fontStyle: "normal";
|
|
36
|
+
fontSize: number;
|
|
37
|
+
lineHeight: number;
|
|
38
|
+
letterSpacing: number;
|
|
39
|
+
textAlign: "justify";
|
|
40
|
+
color: string;
|
|
41
|
+
paddingTop: number;
|
|
42
|
+
};
|
|
43
|
+
reasonItemStyle: {
|
|
44
|
+
flexDirection: "row";
|
|
45
|
+
paddingTop: number;
|
|
46
|
+
paddingStart: number;
|
|
47
|
+
paddingEnd: number;
|
|
48
|
+
backgroundColor: string;
|
|
49
|
+
};
|
|
50
|
+
heading: {
|
|
51
|
+
marginTop: number;
|
|
52
|
+
marginStart: number;
|
|
53
|
+
fontSize: number;
|
|
54
|
+
lineHeight: number;
|
|
55
|
+
letterSpacing: number;
|
|
56
|
+
fontFamily: string;
|
|
57
|
+
color: string;
|
|
58
|
+
};
|
|
59
|
+
item: {
|
|
60
|
+
margin: number;
|
|
61
|
+
padding: number;
|
|
62
|
+
borderWidth: number;
|
|
63
|
+
};
|
|
64
|
+
btn: {
|
|
65
|
+
width: number;
|
|
66
|
+
borderRadius: number;
|
|
67
|
+
backgroundColor: string;
|
|
68
|
+
paddingHorizontal: number;
|
|
69
|
+
paddingVertical: number;
|
|
70
|
+
marginVertical: number;
|
|
71
|
+
};
|
|
72
|
+
loader: {
|
|
73
|
+
flex: number;
|
|
74
|
+
justifyContent: "center";
|
|
75
|
+
alignItems: "center";
|
|
76
|
+
};
|
|
77
|
+
flexCenter: {
|
|
78
|
+
width: number;
|
|
79
|
+
height: number;
|
|
80
|
+
flex: number;
|
|
81
|
+
justifyContent: "center";
|
|
82
|
+
alignItems: "center";
|
|
83
|
+
};
|
|
84
|
+
paymentWaitIcon: {
|
|
85
|
+
backgroundColor: string;
|
|
86
|
+
width: number;
|
|
87
|
+
height: number;
|
|
88
|
+
borderRadius: number;
|
|
89
|
+
justifyContent: "center";
|
|
90
|
+
alignItems: "center";
|
|
91
|
+
};
|
|
92
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { API, AllowedModes, TRANSACTION_TYPE, sharedPrefPaymentDataInterface } from './CollectPaymentSchema';
|
|
2
|
+
import Storage from '../../../utils/storage';
|
|
3
|
+
import { ENV } from '../../../models/sdk';
|
|
4
|
+
export declare const PAYMENT_SHARED_PREF_KEY = "@Payment_";
|
|
5
|
+
export declare const PAYMENT_SELECTION_SHARED_PREF_KEY = "@Payment_Selection_";
|
|
6
|
+
export declare function getUniqueTransactionID(amt: number): string;
|
|
7
|
+
export declare function getPaymentValue(amt: number, minorUnit?: number): number;
|
|
8
|
+
export declare function getPaymentType(txnType: TRANSACTION_TYPE): AllowedModes | null;
|
|
9
|
+
export declare function getPaymentLink(env: ENV, tenant: string, appAbbr: string, refId: string): string;
|
|
10
|
+
export declare const apiExecution: (api: API) => Promise<any>;
|
|
11
|
+
export declare function getPaymentDataMO(mergedObjectiveIds: string[], refId: string, storage: Storage): Promise<sharedPrefPaymentDataInterface | null>;
|
|
12
|
+
export declare function setSharedPrefPaymentData(refId: string, payload: sharedPrefPaymentDataInterface, storage: Storage): Promise<void>;
|
|
13
|
+
export declare function getSharedPrefPaymentSelection(refId: string, storage: Storage): Promise<AllowedModes[] | null>;
|
|
14
|
+
export declare function setSharedPrefPaymentSelection(refId: string, mode: AllowedModes, storage: Storage): Promise<void>;
|
|
15
|
+
export declare function removeSharedPrefPaymentData(refId: string, storage: Storage): Promise<void>;
|
|
16
|
+
export declare const formatTime: (time: number) => string;
|
package/lib/typescript/components/executiontasks/collectPayment/components/CustomContactsModal.d.ts
ADDED
|
File without changes
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { SnackBarType } from '
|
|
1
|
+
import { SnackBarType } from '../../../components/widgets/SnackBarCustom';
|
|
2
2
|
import { ScannerOutput } from './ScanSchema';
|
|
3
3
|
import { IDispatchExecutor } from '@os1-platform/platform-coreos-execution-engine-sdk';
|
|
4
4
|
export declare enum ExpoBarcodeTypes {
|
|
@@ -36,3 +36,4 @@ export declare const getErrorMessage: (scan: string, error: {
|
|
|
36
36
|
export declare const getSplitIds: (scanOutput: ScannerOutput) => string[];
|
|
37
37
|
export declare function filterERCItems(eventCodeItems: ercItem[], type: 'SUCCESS' | 'FAILURE'): ercItem[];
|
|
38
38
|
export declare function resetObjective(scanProps: ScannerInput): Promise<void>;
|
|
39
|
+
export declare function clearPaymentSharedData(moIds: string[]): Promise<void>;
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import { StyleProp, TextStyle } from 'react-native';
|
|
2
3
|
declare const ProgressDialog: (props: ProgressDialogProps) => React.JSX.Element;
|
|
3
4
|
export default ProgressDialog;
|
|
4
5
|
export interface ProgressDialogProps {
|
|
5
6
|
visible: boolean;
|
|
6
7
|
label: string;
|
|
8
|
+
labelStyle?: StyleProp<TextStyle>;
|
|
9
|
+
customModalContentStyle?: StyleProp<TextStyle>;
|
|
7
10
|
}
|
|
@@ -13,13 +13,14 @@ export interface SnackbarProps {
|
|
|
13
13
|
type?: SnackBarType;
|
|
14
14
|
theme: ReactNativePaper.Theme;
|
|
15
15
|
customBottom?: number;
|
|
16
|
+
customTop?: number;
|
|
16
17
|
}
|
|
17
18
|
export declare enum SnackBarType {
|
|
18
19
|
SUCCESS = 0,
|
|
19
20
|
FAILURE = 1,
|
|
20
21
|
WARNING = 2
|
|
21
22
|
}
|
|
22
|
-
declare const _default: React.ComponentType<Pick<SnackbarProps, "visible" | "message" | "type" | "onDismiss" | "duration" | "customBottom"> & {
|
|
23
|
+
declare const _default: React.ComponentType<Pick<SnackbarProps, "visible" | "message" | "type" | "onDismiss" | "duration" | "customBottom" | "customTop"> & {
|
|
23
24
|
theme?: import("@callstack/react-theme-provider").$DeepPartial<ReactNativePaper.Theme> | undefined;
|
|
24
|
-
}> & import("@callstack/react-theme-provider/typings/hoist-non-react-statics").NonReactStatics<React.ComponentType<SnackbarProps> & (({ visible, duration, onDismiss, message, theme, type, customBottom, }: SnackbarProps) => React.JSX.Element | null), {}>;
|
|
25
|
+
}> & import("@callstack/react-theme-provider/typings/hoist-non-react-statics").NonReactStatics<React.ComponentType<SnackbarProps> & (({ visible, duration, onDismiss, message, theme, type, customBottom, customTop, }: SnackbarProps) => React.JSX.Element | null), {}>;
|
|
25
26
|
export default _default;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export declare const Timer: React.ForwardRefExoticComponent<Pick<{
|
|
3
|
+
ref: any;
|
|
4
|
+
singleValue?: boolean | undefined;
|
|
5
|
+
timer?: number | undefined;
|
|
6
|
+
onTimerEnd?: (() => void) | undefined;
|
|
7
|
+
}, "timer" | "singleValue" | "onTimerEnd"> & React.RefAttributes<unknown>>;
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
export declare const ENDPOINTS: {
|
|
2
2
|
JOB_REMOVAL: (dispatchId: string) => string;
|
|
3
3
|
BULK_JOB_UPDATE: (dispatchId: string) => string;
|
|
4
|
+
GENERATE_QR: string;
|
|
5
|
+
PAYMENT_STATUS: string;
|
|
6
|
+
PAYMENT_MODES: string;
|
|
4
7
|
};
|
|
5
8
|
export declare const API_CONFIG: {
|
|
6
9
|
timeout: number;
|
|
@@ -9,3 +9,6 @@ export declare const DEFAULT_DELIVER_MESSAGE = "Confirm Drop of $ orders";
|
|
|
9
9
|
export declare const DEFAULT_SIGN_ET_MESSAGE = "Please sign here";
|
|
10
10
|
export declare const REASON_NOT_USED = "NOT_TO_BE_USED";
|
|
11
11
|
export declare const GO_BACK_EVENT_CODE = "E-099";
|
|
12
|
+
export declare const PAYMENT_NOTIFICATION = "PAYMENT_COMPLETED";
|
|
13
|
+
export declare const EMAIL_REGEX = "^([a-z0-9_.+-]+)@([da-z.-]+).([a-z.]{2,6})$";
|
|
14
|
+
export declare const PAYMENT_SUCCESS_DEFAULT_TIMEOUT = 3000;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export type eventType = 'START' | 'END' | 'BACK' | 'ON_SCAN' | 'ON_SCAN_REMOVE';
|
|
1
|
+
export type eventType = 'START' | 'END' | 'BACK' | 'ON_SCAN' | 'ON_SCAN_REMOVE' | 'ON_CLICK';
|
|
@@ -4,5 +4,5 @@ export declare const SHARED_PREFERENCE_DISPATCH_ID = "sharedPreferenceDispatchId
|
|
|
4
4
|
export declare const SHARED_PREFERENCE_SCAN_OUTPUT = "scanETMappedOutput";
|
|
5
5
|
export declare const SCAN_MERGED_OBJ_ID_OUTPUT = "scanMergedObjectiveIDs";
|
|
6
6
|
export declare const POD_DOC = "POD_DOC";
|
|
7
|
-
export declare const PROCESS_MAX_RETRIED_ROWS =
|
|
7
|
+
export declare const PROCESS_MAX_RETRIED_ROWS = true;
|
|
8
8
|
export declare const MAX_RETRY_COUNT = 3;
|