@os1-platform/dispatch-mobile 2.1.0 → 2.1.2
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/android/gradle/wrapper/gradle-wrapper.jar +0 -0
- package/android/gradle/wrapper/gradle-wrapper.properties +5 -0
- package/android/gradlew +185 -0
- package/android/gradlew.bat +89 -0
- package/lib/commonjs/components/dispatch/DispatchExecNavigator.js +4 -3
- package/lib/commonjs/components/dispatch/DispatchExecNavigator.js.map +1 -1
- package/lib/commonjs/components/executiontasks/cancellation/CancelET.js +8 -13
- package/lib/commonjs/components/executiontasks/cancellation/CancelET.js.map +1 -1
- package/lib/commonjs/components/executiontasks/captureInput/CaptureText.js +4 -3
- package/lib/commonjs/components/executiontasks/captureInput/CaptureText.js.map +1 -1
- package/lib/commonjs/components/executiontasks/deliver/DeliverET.js +4 -3
- 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 +24 -102
- package/lib/commonjs/components/executiontasks/deliver/SLDeliverET.js.map +1 -1
- package/lib/commonjs/components/executiontasks/display/DisplayModalET.js +8 -7
- package/lib/commonjs/components/executiontasks/display/DisplayModalET.js.map +1 -1
- package/lib/commonjs/components/executiontasks/doodle/SignatureET.js +13 -36
- package/lib/commonjs/components/executiontasks/doodle/SignatureET.js.map +1 -1
- package/lib/commonjs/components/executiontasks/dropCash/DropCashET.js +4 -3
- package/lib/commonjs/components/executiontasks/dropCash/DropCashET.js.map +1 -1
- package/lib/commonjs/components/executiontasks/dropCash/SLDropCash.js +7 -6
- package/lib/commonjs/components/executiontasks/dropCash/SLDropCash.js.map +1 -1
- package/lib/commonjs/components/executiontasks/forms/FormGenerator.js +6 -5
- package/lib/commonjs/components/executiontasks/forms/FormGenerator.js.map +1 -1
- package/lib/commonjs/components/executiontasks/forms/widgets/DateTimeWidget.js +5 -4
- package/lib/commonjs/components/executiontasks/forms/widgets/DateTimeWidget.js.map +1 -1
- package/lib/commonjs/components/executiontasks/forms/widgets/DropdownWidget.js +4 -3
- package/lib/commonjs/components/executiontasks/forms/widgets/DropdownWidget.js.map +1 -1
- package/lib/commonjs/components/executiontasks/forms/widgets/QRBarcodeScannerWidget.js +4 -3
- package/lib/commonjs/components/executiontasks/forms/widgets/QRBarcodeScannerWidget.js.map +1 -1
- package/lib/commonjs/components/executiontasks/forms/widgets/TimeRangeSelector.js +4 -3
- package/lib/commonjs/components/executiontasks/forms/widgets/TimeRangeSelector.js.map +1 -1
- package/lib/commonjs/components/executiontasks/httpRequest/HttpRequestET.js +4 -3
- package/lib/commonjs/components/executiontasks/httpRequest/HttpRequestET.js.map +1 -1
- package/lib/commonjs/components/executiontasks/imageCapture/CaptureUtils.js +22 -136
- package/lib/commonjs/components/executiontasks/imageCapture/CaptureUtils.js.map +1 -1
- package/lib/commonjs/components/executiontasks/imageCapture/ImageCapture.js +8 -8
- package/lib/commonjs/components/executiontasks/imageCapture/ImageCapture.js.map +1 -1
- package/lib/commonjs/components/executiontasks/payments/PaymentStyles.js +7 -6
- package/lib/commonjs/components/executiontasks/payments/PaymentStyles.js.map +1 -1
- package/lib/commonjs/components/executiontasks/payments/completePayment/CompletePaymentET.js +6 -5
- package/lib/commonjs/components/executiontasks/payments/completePayment/CompletePaymentET.js.map +1 -1
- package/lib/commonjs/components/executiontasks/payments/init/InitPaymentET.js +4 -3
- package/lib/commonjs/components/executiontasks/payments/init/InitPaymentET.js.map +1 -1
- package/lib/commonjs/components/executiontasks/payments/processPayment/ProcessPaymentET.js +4 -3
- package/lib/commonjs/components/executiontasks/payments/processPayment/ProcessPaymentET.js.map +1 -1
- package/lib/commonjs/components/executiontasks/pickup/PickupET.js +4 -3
- package/lib/commonjs/components/executiontasks/pickup/PickupET.js.map +1 -1
- package/lib/commonjs/components/executiontasks/pickup/SLPickupET.js +15 -85
- package/lib/commonjs/components/executiontasks/pickup/SLPickupET.js.map +1 -1
- package/lib/commonjs/components/executiontasks/scan/ScanET.js +15 -14
- package/lib/commonjs/components/executiontasks/scan/ScanET.js.map +1 -1
- package/lib/commonjs/components/executiontasks/scan/ScanSchema.js +2 -1
- package/lib/commonjs/components/executiontasks/scan/ScanSchema.js.map +1 -1
- package/lib/commonjs/components/executiontasks/scan/constants.js +12 -6
- package/lib/commonjs/components/executiontasks/scan/constants.js.map +1 -1
- package/lib/commonjs/components/executiontasks/scan/interfaces.js +8 -4
- package/lib/commonjs/components/executiontasks/scan/interfaces.js.map +1 -1
- package/lib/commonjs/components/executiontasks/scan/sub_components/CScanner.js +5 -4
- package/lib/commonjs/components/executiontasks/scan/sub_components/CScanner.js.map +1 -1
- package/lib/commonjs/components/executiontasks/scan/sub_components/ERDropDown.js +6 -5
- package/lib/commonjs/components/executiontasks/scan/sub_components/ERDropDown.js.map +1 -1
- package/lib/commonjs/components/executiontasks/scan/sub_components/SummaryPage.js +9 -8
- package/lib/commonjs/components/executiontasks/scan/sub_components/SummaryPage.js.map +1 -1
- package/lib/commonjs/components/executiontasks/scan/utils.js +2 -2
- package/lib/commonjs/components/executiontasks/scan/utils.js.map +1 -1
- package/lib/commonjs/components/executiontasks/validateOTP/ValidateOTPET.js +9 -8
- package/lib/commonjs/components/executiontasks/validateOTP/ValidateOTPET.js.map +1 -1
- package/lib/commonjs/components/executiontasks/validateOTP/ValidateOTPSchema.js +2 -1
- package/lib/commonjs/components/executiontasks/validateOTP/ValidateOTPSchema.js.map +1 -1
- package/lib/commonjs/components/executiontasks/validateOTP/constants.js +12 -6
- package/lib/commonjs/components/executiontasks/validateOTP/constants.js.map +1 -1
- package/lib/commonjs/components/executiontasks/validateOTP/sub-components/OTPInput.js +6 -5
- package/lib/commonjs/components/executiontasks/validateOTP/sub-components/OTPInput.js.map +1 -1
- package/lib/commonjs/components/executiontasks/validateOTP/utils.js +2 -2
- 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 +4 -3
- package/lib/commonjs/components/executiontasks/verifyLocation/VerifyLocationET.js.map +1 -1
- package/lib/commonjs/components/executiontasks/verifyOtp/VerifyOtpET.js +4 -3
- package/lib/commonjs/components/executiontasks/verifyOtp/VerifyOtpET.js.map +1 -1
- package/lib/commonjs/components/widgets/AlertDisplay.js +9 -14
- package/lib/commonjs/components/widgets/AlertDisplay.js.map +1 -1
- package/lib/commonjs/components/widgets/CancelOrderDialog.js +6 -5
- package/lib/commonjs/components/widgets/CancelOrderDialog.js.map +1 -1
- package/lib/commonjs/components/widgets/Card.js +3 -2
- package/lib/commonjs/components/widgets/Card.js.map +1 -1
- package/lib/commonjs/components/widgets/GoBackModal.js +2 -1
- package/lib/commonjs/components/widgets/GoBackModal.js.map +1 -1
- package/lib/commonjs/components/widgets/IconButton.js +2 -1
- package/lib/commonjs/components/widgets/IconButton.js.map +1 -1
- package/lib/commonjs/components/widgets/ModalWidget.js +4 -3
- package/lib/commonjs/components/widgets/ModalWidget.js.map +1 -1
- package/lib/commonjs/components/widgets/ProgressDialog.js +3 -2
- package/lib/commonjs/components/widgets/ProgressDialog.js.map +1 -1
- package/lib/commonjs/components/widgets/SearchBar.js +2 -1
- package/lib/commonjs/components/widgets/SearchBar.js.map +1 -1
- package/lib/commonjs/components/widgets/SnackBarCustom.js +5 -3
- package/lib/commonjs/components/widgets/SnackBarCustom.js.map +1 -1
- package/lib/commonjs/components/widgets/SplitTextInput.js +4 -3
- package/lib/commonjs/components/widgets/SplitTextInput.js.map +1 -1
- package/lib/commonjs/components/widgets/TabsComponent.js +4 -3
- package/lib/commonjs/components/widgets/TabsComponent.js.map +1 -1
- package/lib/commonjs/config/DispatchSDKConfig.js +2 -1
- package/lib/commonjs/config/DispatchSDKConfig.js.map +1 -1
- package/lib/commonjs/constants/apiConstants.js +4 -2
- package/lib/commonjs/constants/apiConstants.js.map +1 -1
- package/lib/commonjs/constants/constants.js +22 -11
- package/lib/commonjs/constants/constants.js.map +1 -1
- package/lib/commonjs/constants/statuscode.js +2 -1
- package/lib/commonjs/constants/statuscode.js.map +1 -1
- package/lib/commonjs/errors/ErrorCodes.js +14 -7
- package/lib/commonjs/errors/ErrorCodes.js.map +1 -1
- package/lib/commonjs/events/EventDispatcher.js +3 -5
- package/lib/commonjs/events/EventDispatcher.js.map +1 -1
- package/lib/commonjs/events/EventListener.js +2 -1
- package/lib/commonjs/events/EventListener.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 +2 -1
- package/lib/commonjs/events/index.js.map +1 -1
- package/lib/commonjs/icons/ScanIcon.js +2 -1
- package/lib/commonjs/icons/ScanIcon.js.map +1 -1
- package/lib/commonjs/icons/file.js +2 -1
- package/lib/commonjs/icons/file.js.map +1 -1
- package/lib/commonjs/index.js +2 -8
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/manager/dispatch/DispatchStateContainer.js +3 -5
- package/lib/commonjs/manager/dispatch/DispatchStateContainer.js.map +1 -1
- package/lib/commonjs/manager/dispatchCodes/EventCodeContainer.js +0 -2
- package/lib/commonjs/manager/dispatchCodes/EventCodeContainer.js.map +1 -1
- package/lib/commonjs/manager/dispatchCodes/EventCodeRepo.js +2 -4
- package/lib/commonjs/manager/dispatchCodes/EventCodeRepo.js.map +1 -1
- package/lib/commonjs/manager/dispatchCodes/ReasonCodeContainer.js +2 -4
- package/lib/commonjs/manager/dispatchCodes/ReasonCodeContainer.js.map +1 -1
- package/lib/commonjs/manager/dispatchCodes/ReasonCodeRepo.js +2 -4
- package/lib/commonjs/manager/dispatchCodes/ReasonCodeRepo.js.map +1 -1
- package/lib/commonjs/manager/location/LocationManager.js +4 -7
- package/lib/commonjs/manager/location/LocationManager.js.map +1 -1
- package/lib/commonjs/manager/sdk/DispatchSDKManager.js +2 -4
- package/lib/commonjs/manager/sdk/DispatchSDKManager.js.map +1 -1
- package/lib/commonjs/manager/sdk/DispatchSdkCache.js +0 -2
- package/lib/commonjs/manager/sdk/DispatchSdkCache.js.map +1 -1
- package/lib/commonjs/manager/sdk/callbacksHandler.js +2 -1
- package/lib/commonjs/manager/sdk/callbacksHandler.js.map +1 -1
- package/lib/commonjs/manager/syncmanager/AppSyncManager.js +2 -4
- package/lib/commonjs/manager/syncmanager/AppSyncManager.js.map +1 -1
- package/lib/commonjs/manager/syncmanager/DBConfig.js +26 -14
- package/lib/commonjs/manager/syncmanager/DBConfig.js.map +1 -1
- package/lib/commonjs/manager/syncmanager/NativeSyncManager.js +2 -1
- package/lib/commonjs/manager/syncmanager/NativeSyncManager.js.map +1 -1
- package/lib/commonjs/manager/syncmanager/constants.js +10 -5
- 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 +4 -5
- package/lib/commonjs/manager/syncmanager/document/DocumentHttpClient.js.map +1 -1
- package/lib/commonjs/manager/syncmanager/document/DocumentManager.js +2 -4
- package/lib/commonjs/manager/syncmanager/document/DocumentManager.js.map +1 -1
- package/lib/commonjs/manager/syncmanager/document/DocumentSyncManager.js +2 -4
- package/lib/commonjs/manager/syncmanager/document/DocumentSyncManager.js.map +1 -1
- package/lib/commonjs/manager/syncmanager/events/ETEventsManager.js +2 -4
- package/lib/commonjs/manager/syncmanager/events/ETEventsManager.js.map +1 -1
- package/lib/commonjs/manager/syncmanager/events/EventsSyncManager.js +2 -4
- package/lib/commonjs/manager/syncmanager/events/EventsSyncManager.js.map +1 -1
- package/lib/commonjs/models/DispatchModels.js +2 -1
- package/lib/commonjs/models/DispatchModels.js.map +1 -1
- package/lib/commonjs/models/execTasks/ETConfig.js +12 -6
- package/lib/commonjs/models/execTasks/ETConfig.js.map +1 -1
- package/lib/commonjs/models/fcm.js.map +1 -1
- package/lib/commonjs/models/sdk.js +2 -1
- package/lib/commonjs/models/sdk.js.map +1 -1
- package/lib/commonjs/native/signature/SignatureCapture.js +2 -1
- package/lib/commonjs/native/signature/SignatureCapture.js.map +1 -1
- package/lib/commonjs/network/GraphQLClient.js +4 -48
- package/lib/commonjs/network/GraphQLClient.js.map +1 -1
- package/lib/commonjs/network/Queries.js +10 -5
- package/lib/commonjs/network/Queries.js.map +1 -1
- package/lib/commonjs/res/strings.js +2 -1
- package/lib/commonjs/res/strings.js.map +1 -1
- package/lib/commonjs/resources/Login.js +2 -1
- package/lib/commonjs/resources/Login.js.map +1 -1
- package/lib/commonjs/resources/network.js +2 -1
- package/lib/commonjs/resources/network.js.map +1 -1
- package/lib/commonjs/styles/SdkColors.js +4 -2
- package/lib/commonjs/styles/SdkColors.js.map +1 -1
- package/lib/commonjs/styles/executionTasks/CommonStyles.js +10 -6
- package/lib/commonjs/styles/executionTasks/CommonStyles.js.map +1 -1
- package/lib/commonjs/ui/screens/CancellationScreen.js +4 -3
- package/lib/commonjs/ui/screens/CancellationScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/CaptureInputScreen.js +5 -5
- package/lib/commonjs/ui/screens/CaptureInputScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/CompleteObjectiveScreen.js +4 -3
- package/lib/commonjs/ui/screens/CompleteObjectiveScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/DeliverScreen.js +5 -9
- package/lib/commonjs/ui/screens/DeliverScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/DisplayScreen.js +4 -3
- package/lib/commonjs/ui/screens/DisplayScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/DoodleScreen.js +5 -5
- package/lib/commonjs/ui/screens/DoodleScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/DropCashScreen.js +5 -5
- package/lib/commonjs/ui/screens/DropCashScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/FormsScreen.js +4 -3
- package/lib/commonjs/ui/screens/FormsScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/GeofenceScreen.js +4 -3
- package/lib/commonjs/ui/screens/GeofenceScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/HttpRequestScreen.js +2 -1
- package/lib/commonjs/ui/screens/HttpRequestScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/ImageCaptureScreen.js +4 -3
- package/lib/commonjs/ui/screens/ImageCaptureScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/PaymentScreen.js +6 -6
- package/lib/commonjs/ui/screens/PaymentScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/PickupScreen.js +5 -4
- package/lib/commonjs/ui/screens/PickupScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/ScanScreen.js +4 -3
- package/lib/commonjs/ui/screens/ScanScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/StartWorkFlowScreen.js +7 -8
- package/lib/commonjs/ui/screens/StartWorkFlowScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/ValidateOTPScreen.js +4 -3
- package/lib/commonjs/ui/screens/ValidateOTPScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/WithBaseDispatchScreen.js +4 -4
- 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 +4 -2
- package/lib/commonjs/utils/ApiUtils.js.map +1 -1
- package/lib/commonjs/utils/Logger.js +9 -10
- package/lib/commonjs/utils/Logger.js.map +1 -1
- package/lib/commonjs/utils/NetworkUtil.js +2 -1
- package/lib/commonjs/utils/NetworkUtil.js.map +1 -1
- package/lib/commonjs/utils/SdkUtils.js +8 -12
- package/lib/commonjs/utils/SdkUtils.js.map +1 -1
- package/lib/commonjs/utils/SyncManagerUtils.js +2 -2
- package/lib/commonjs/utils/SyncManagerUtils.js.map +1 -1
- package/lib/commonjs/utils/fcm/FCM.js +4 -3
- package/lib/commonjs/utils/fcm/FCM.js.map +1 -1
- package/lib/commonjs/utils/fcm/FcmUtils.js +2 -14
- package/lib/commonjs/utils/fcm/FcmUtils.js.map +1 -1
- package/lib/commonjs/utils/helper.js +2 -1
- 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 +2 -1
- package/lib/commonjs/utils/hooks/useTimer.js.map +1 -1
- package/lib/commonjs/utils/loginHelper.js +2 -1
- package/lib/commonjs/utils/loginHelper.js.map +1 -1
- package/lib/commonjs/utils/storage.js +13 -71
- package/lib/commonjs/utils/storage.js.map +1 -1
- package/lib/module/components/dispatch/DispatchExecNavigator.js.map +1 -1
- package/lib/module/components/executiontasks/cancellation/CancelET.js +5 -11
- package/lib/module/components/executiontasks/cancellation/CancelET.js.map +1 -1
- package/lib/module/components/executiontasks/deliver/DeliverETInput.js.map +1 -1
- package/lib/module/components/executiontasks/deliver/SLDeliverET.js +22 -102
- package/lib/module/components/executiontasks/deliver/SLDeliverET.js.map +1 -1
- package/lib/module/components/executiontasks/display/DisplayModalET.js +5 -5
- package/lib/module/components/executiontasks/display/DisplayModalET.js.map +1 -1
- package/lib/module/components/executiontasks/doodle/SignatureET.js +10 -34
- package/lib/module/components/executiontasks/doodle/SignatureET.js.map +1 -1
- package/lib/module/components/executiontasks/dropCash/SLDropCash.js +4 -4
- package/lib/module/components/executiontasks/dropCash/SLDropCash.js.map +1 -1
- package/lib/module/components/executiontasks/forms/FormGenerator.js +3 -3
- package/lib/module/components/executiontasks/forms/FormGenerator.js.map +1 -1
- package/lib/module/components/executiontasks/forms/widgets/DateTimeWidget.js +1 -1
- package/lib/module/components/executiontasks/forms/widgets/DateTimeWidget.js.map +1 -1
- package/lib/module/components/executiontasks/imageCapture/CaptureUtils.js +18 -131
- package/lib/module/components/executiontasks/imageCapture/CaptureUtils.js.map +1 -1
- package/lib/module/components/executiontasks/imageCapture/ImageCapture.js +3 -3
- package/lib/module/components/executiontasks/imageCapture/ImageCapture.js.map +1 -1
- package/lib/module/components/executiontasks/payments/PaymentStyles.js +6 -6
- package/lib/module/components/executiontasks/payments/PaymentStyles.js.map +1 -1
- package/lib/module/components/executiontasks/payments/completePayment/CompletePaymentET.js +3 -3
- package/lib/module/components/executiontasks/payments/completePayment/CompletePaymentET.js.map +1 -1
- package/lib/module/components/executiontasks/pickup/SLPickupET.js +14 -85
- package/lib/module/components/executiontasks/pickup/SLPickupET.js.map +1 -1
- package/lib/module/components/executiontasks/scan/ScanET.js +12 -12
- package/lib/module/components/executiontasks/scan/ScanET.js.map +1 -1
- package/lib/module/components/executiontasks/scan/sub_components/CScanner.js +2 -2
- package/lib/module/components/executiontasks/scan/sub_components/CScanner.js.map +1 -1
- package/lib/module/components/executiontasks/scan/sub_components/ERDropDown.js +3 -3
- package/lib/module/components/executiontasks/scan/sub_components/ERDropDown.js.map +1 -1
- package/lib/module/components/executiontasks/scan/sub_components/SummaryPage.js +6 -6
- package/lib/module/components/executiontasks/scan/sub_components/SummaryPage.js.map +1 -1
- package/lib/module/components/executiontasks/scan/utils.js.map +1 -1
- package/lib/module/components/executiontasks/validateOTP/ValidateOTPET.js +6 -6
- package/lib/module/components/executiontasks/validateOTP/ValidateOTPET.js.map +1 -1
- package/lib/module/components/executiontasks/validateOTP/sub-components/OTPInput.js +3 -3
- package/lib/module/components/executiontasks/validateOTP/sub-components/OTPInput.js.map +1 -1
- package/lib/module/components/widgets/AlertDisplay.js +7 -12
- package/lib/module/components/widgets/AlertDisplay.js.map +1 -1
- package/lib/module/components/widgets/CancelOrderDialog.js +3 -3
- package/lib/module/components/widgets/CancelOrderDialog.js.map +1 -1
- package/lib/module/components/widgets/Card.js +1 -1
- package/lib/module/components/widgets/Card.js.map +1 -1
- package/lib/module/components/widgets/ModalWidget.js +3 -3
- 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 +2 -2
- package/lib/module/components/widgets/SnackBarCustom.js.map +1 -1
- package/lib/module/events/EventDispatcher.js +2 -5
- package/lib/module/events/EventDispatcher.js.map +1 -1
- package/lib/module/index.js +2 -2
- package/lib/module/index.js.map +1 -1
- package/lib/module/manager/dispatch/DispatchStateContainer.js +1 -3
- package/lib/module/manager/dispatch/DispatchStateContainer.js.map +1 -1
- package/lib/module/manager/dispatchCodes/EventCodeContainer.js +0 -2
- package/lib/module/manager/dispatchCodes/EventCodeContainer.js.map +1 -1
- package/lib/module/manager/dispatchCodes/EventCodeRepo.js +0 -2
- package/lib/module/manager/dispatchCodes/EventCodeRepo.js.map +1 -1
- package/lib/module/manager/dispatchCodes/ReasonCodeContainer.js +0 -2
- package/lib/module/manager/dispatchCodes/ReasonCodeContainer.js.map +1 -1
- package/lib/module/manager/dispatchCodes/ReasonCodeRepo.js +0 -2
- package/lib/module/manager/dispatchCodes/ReasonCodeRepo.js.map +1 -1
- package/lib/module/manager/location/LocationManager.js +0 -2
- package/lib/module/manager/location/LocationManager.js.map +1 -1
- package/lib/module/manager/sdk/DispatchSDKManager.js +0 -2
- package/lib/module/manager/sdk/DispatchSDKManager.js.map +1 -1
- package/lib/module/manager/sdk/DispatchSdkCache.js +0 -2
- package/lib/module/manager/sdk/DispatchSdkCache.js.map +1 -1
- package/lib/module/manager/syncmanager/AppSyncManager.js +0 -2
- package/lib/module/manager/syncmanager/AppSyncManager.js.map +1 -1
- package/lib/module/manager/syncmanager/DBConfig.js +1 -1
- package/lib/module/manager/syncmanager/DBConfig.js.map +1 -1
- package/lib/module/manager/syncmanager/document/DocumentManager.js +0 -2
- package/lib/module/manager/syncmanager/document/DocumentManager.js.map +1 -1
- package/lib/module/manager/syncmanager/document/DocumentSyncManager.js +0 -2
- package/lib/module/manager/syncmanager/document/DocumentSyncManager.js.map +1 -1
- package/lib/module/manager/syncmanager/events/ETEventsManager.js +0 -2
- package/lib/module/manager/syncmanager/events/ETEventsManager.js.map +1 -1
- package/lib/module/manager/syncmanager/events/EventsSyncManager.js +0 -2
- package/lib/module/manager/syncmanager/events/EventsSyncManager.js.map +1 -1
- package/lib/module/models/fcm.js.map +1 -1
- package/lib/module/network/GraphQLClient.js +3 -48
- package/lib/module/network/GraphQLClient.js.map +1 -1
- package/lib/module/ui/screens/CaptureInputScreen.js +1 -2
- package/lib/module/ui/screens/CaptureInputScreen.js.map +1 -1
- package/lib/module/ui/screens/DeliverScreen.js +1 -6
- package/lib/module/ui/screens/DeliverScreen.js.map +1 -1
- package/lib/module/ui/screens/DoodleScreen.js +1 -2
- package/lib/module/ui/screens/DoodleScreen.js.map +1 -1
- package/lib/module/ui/screens/DropCashScreen.js +2 -2
- package/lib/module/ui/screens/DropCashScreen.js.map +1 -1
- package/lib/module/ui/screens/PaymentScreen.js +2 -3
- package/lib/module/ui/screens/PaymentScreen.js.map +1 -1
- package/lib/module/ui/screens/PickupScreen.js +1 -1
- package/lib/module/ui/screens/PickupScreen.js.map +1 -1
- package/lib/module/ui/screens/StartWorkFlowScreen.js +4 -6
- package/lib/module/ui/screens/StartWorkFlowScreen.js.map +1 -1
- package/lib/module/ui/screens/WithBaseDispatchScreen.js +0 -1
- package/lib/module/ui/screens/WithBaseDispatchScreen.js.map +1 -1
- package/lib/module/utils/Logger.js +0 -2
- package/lib/module/utils/Logger.js.map +1 -1
- package/lib/module/utils/SdkUtils.js +7 -11
- package/lib/module/utils/SdkUtils.js.map +1 -1
- package/lib/module/utils/fcm/FcmUtils.js +0 -11
- package/lib/module/utils/fcm/FcmUtils.js.map +1 -1
- package/lib/module/utils/storage.js +10 -69
- package/lib/module/utils/storage.js.map +1 -1
- package/lib/typescript/components/executiontasks/deliver/DeliverETInput.d.ts +0 -3
- package/lib/typescript/components/executiontasks/payments/PaymentStyles.d.ts +5 -4
- package/lib/typescript/components/widgets/SnackBarCustom.d.ts +1 -1
- package/lib/typescript/index.d.ts +2 -2
- package/lib/typescript/manager/syncmanager/DBConfig.d.ts +1 -1
- package/lib/typescript/models/fcm.d.ts +0 -3
- package/lib/typescript/utils/fcm/FcmUtils.d.ts +1 -2
- package/lib/typescript/utils/storage.d.ts +2 -3
- package/package.json +8 -25
- package/dispatch-mobile.podspec +0 -35
- package/ios/DispatchSdk-Bridging-Header.h +0 -3
- package/ios/DispatchSdk.m +0 -9
- package/ios/DispatchSdk.swift +0 -8
- package/ios/DispatchSdk.xcodeproj/project.pbxproj +0 -317
- package/ios/EventEmitter.swift +0 -21
- package/ios/EventsConstant.swift +0 -13
- package/ios/RNEventEmitter.m +0 -15
- package/ios/RNEventEmitter.swift +0 -24
- package/lib/commonjs/icons/circleMark.svg +0 -3
- package/lib/commonjs/locale/Str.js +0 -18
- package/lib/commonjs/locale/Str.js.map +0 -1
- package/lib/commonjs/locale/en.json +0 -6
- package/lib/commonjs/locale/i18n.js +0 -24
- package/lib/commonjs/locale/i18n.js.map +0 -1
- package/lib/commonjs/locale/util.js +0 -27
- package/lib/commonjs/locale/util.js.map +0 -1
- package/lib/module/icons/circleMark.svg +0 -3
- package/lib/module/locale/Str.js +0 -12
- package/lib/module/locale/Str.js.map +0 -1
- package/lib/module/locale/en.json +0 -6
- package/lib/module/locale/i18n.js +0 -17
- package/lib/module/locale/i18n.js.map +0 -1
- package/lib/module/locale/util.js +0 -18
- package/lib/module/locale/util.js.map +0 -1
- package/lib/typescript/locale/Str.d.ts +0 -10
- package/lib/typescript/locale/i18n.d.ts +0 -3
- package/lib/typescript/locale/util.d.ts +0 -2
- package/src/@types/assets/index.d.ts +0 -6
- package/src/components/dispatch/DispatchExecNavigator.tsx +0 -273
- package/src/components/executiontasks/CompletedWFSchema.ts +0 -24
- package/src/components/executiontasks/ExecutionTasksIndex.ts +0 -137
- package/src/components/executiontasks/cancellation/CancelET.tsx +0 -281
- package/src/components/executiontasks/cancellation/CancellationSchema.ts +0 -30
- package/src/components/executiontasks/captureInput/CaptureInputSchema.ts +0 -52
- package/src/components/executiontasks/captureInput/CaptureText.tsx +0 -172
- package/src/components/executiontasks/captureInput/utils.ts +0 -9
- package/src/components/executiontasks/deliver/DeliverET.tsx +0 -124
- package/src/components/executiontasks/deliver/DeliverETInput.ts +0 -50
- package/src/components/executiontasks/deliver/SLDeliverET.tsx +0 -512
- package/src/components/executiontasks/display/DisplayModalET.tsx +0 -174
- package/src/components/executiontasks/display/DisplaySchema.ts +0 -29
- package/src/components/executiontasks/doodle/SignatureET.tsx +0 -320
- package/src/components/executiontasks/doodle/SignatureSchema.ts +0 -51
- package/src/components/executiontasks/dropCash/DropCashET.tsx +0 -145
- package/src/components/executiontasks/dropCash/DropCashSchema.ts +0 -22
- package/src/components/executiontasks/dropCash/SLDropCash.tsx +0 -286
- package/src/components/executiontasks/forms/FormGenerator.tsx +0 -282
- package/src/components/executiontasks/forms/FormSchema.ts +0 -29
- package/src/components/executiontasks/forms/widgets/DateTimeWidget.tsx +0 -144
- package/src/components/executiontasks/forms/widgets/DropdownWidget.tsx +0 -52
- package/src/components/executiontasks/forms/widgets/QRBarcodeScannerWidget.tsx +0 -158
- package/src/components/executiontasks/forms/widgets/TimeRangeSelector.tsx +0 -38
- package/src/components/executiontasks/httpRequest/HttpEtUtils.ts +0 -49
- package/src/components/executiontasks/httpRequest/HttpRequestET.tsx +0 -59
- package/src/components/executiontasks/httpRequest/HttpRequestETSchema.ts +0 -42
- package/src/components/executiontasks/imageCapture/CaptureSchema.ts +0 -93
- package/src/components/executiontasks/imageCapture/CaptureUtils.ts +0 -326
- package/src/components/executiontasks/imageCapture/ImageCapture.tsx +0 -363
- package/src/components/executiontasks/payments/PaymentStyles.ts +0 -93
- package/src/components/executiontasks/payments/PaymentUtils.ts +0 -7
- package/src/components/executiontasks/payments/completePayment/CompletePaymentET.tsx +0 -237
- package/src/components/executiontasks/payments/completePayment/CompletePaymentSchema.ts +0 -23
- package/src/components/executiontasks/payments/init/InitPaymentET.tsx +0 -247
- package/src/components/executiontasks/payments/init/InitPaymentSchema.ts +0 -37
- package/src/components/executiontasks/payments/processPayment/ProcessPaymentET.tsx +0 -272
- package/src/components/executiontasks/payments/processPayment/ProcessPaymentSchema.ts +0 -38
- package/src/components/executiontasks/pickup/PickpSchema.ts +0 -28
- package/src/components/executiontasks/pickup/PickupET.tsx +0 -126
- package/src/components/executiontasks/pickup/SLPickupET.tsx +0 -367
- package/src/components/executiontasks/scan/ScanET.tsx +0 -1059
- package/src/components/executiontasks/scan/ScanSchema.ts +0 -121
- package/src/components/executiontasks/scan/constants.ts +0 -6
- package/src/components/executiontasks/scan/interfaces.ts +0 -109
- package/src/components/executiontasks/scan/modalConstant.ts +0 -120
- package/src/components/executiontasks/scan/sub_components/CScanner.tsx +0 -107
- package/src/components/executiontasks/scan/sub_components/DropDownUtils.ts +0 -119
- package/src/components/executiontasks/scan/sub_components/ERDropDown.tsx +0 -134
- package/src/components/executiontasks/scan/sub_components/SummaryPage.tsx +0 -1296
- package/src/components/executiontasks/scan/utils.ts +0 -1108
- package/src/components/executiontasks/validateOTP/ValidateOTPET.tsx +0 -436
- package/src/components/executiontasks/validateOTP/ValidateOTPSchema.ts +0 -68
- package/src/components/executiontasks/validateOTP/constants.ts +0 -24
- package/src/components/executiontasks/validateOTP/sub-components/OTPInput.tsx +0 -83
- package/src/components/executiontasks/validateOTP/utils.ts +0 -180
- package/src/components/executiontasks/verifyInput/VerifyInputSchema.ts +0 -49
- package/src/components/executiontasks/verifyLocation/GeofenceUtils.ts +0 -55
- package/src/components/executiontasks/verifyLocation/VerifyLocSchema.ts +0 -56
- package/src/components/executiontasks/verifyLocation/VerifyLocationET.tsx +0 -69
- package/src/components/executiontasks/verifyOtp/VerifyOtpET.tsx +0 -96
- package/src/components/executiontasks/verifyOtp/VerifyOtpSchema.ts +0 -27
- package/src/components/utils/index.ts +0 -18
- package/src/components/widgets/AlertDisplay.tsx +0 -38
- package/src/components/widgets/CancelOrderDialog.tsx +0 -112
- package/src/components/widgets/Card.tsx +0 -99
- package/src/components/widgets/GoBackModal.tsx +0 -49
- package/src/components/widgets/IconButton.tsx +0 -32
- package/src/components/widgets/ModalWidget.tsx +0 -157
- package/src/components/widgets/ProgressDialog.tsx +0 -54
- package/src/components/widgets/SearchBar.tsx +0 -71
- package/src/components/widgets/SnackBarCustom.tsx +0 -212
- package/src/components/widgets/SplitTextInput.tsx +0 -116
- package/src/components/widgets/TabsComponent.tsx +0 -84
- package/src/components/widgets/Toaster.ts +0 -8
- package/src/config/DispatchSDKConfig.ts +0 -4
- package/src/constants/apiConstants.ts +0 -11
- package/src/constants/constants.ts +0 -12
- package/src/constants/statuscode.ts +0 -8
- package/src/errors/BaseError.ts +0 -16
- package/src/errors/ErrorCodes.ts +0 -38
- package/src/events/EventDispatcher.ts +0 -22
- package/src/events/EventListener.ts +0 -14
- package/src/events/constants.ts +0 -7
- package/src/events/index.ts +0 -3
- package/src/events/interface.ts +0 -1
- package/src/icons/ScanIcon.tsx +0 -24
- package/src/icons/circleMark.svg +0 -3
- package/src/icons/file.tsx +0 -24
- package/src/icons/interface.ts +0 -5
- package/src/index.tsx +0 -80
- package/src/locale/Str.ts +0 -12
- package/src/locale/en.json +0 -6
- package/src/locale/i18n.ts +0 -17
- package/src/locale/util.ts +0 -20
- package/src/manager/dispatch/DispatchStateContainer.tsx +0 -842
- package/src/manager/dispatchCodes/EventCodeContainer.ts +0 -75
- package/src/manager/dispatchCodes/EventCodeRepo.ts +0 -82
- package/src/manager/dispatchCodes/ReasonCodeContainer.ts +0 -121
- package/src/manager/dispatchCodes/ReasonCodeRepo.ts +0 -90
- package/src/manager/dispatchCodes/reasonCodes.json +0 -137
- package/src/manager/jobRemoval/JobRemovalManager.ts +0 -21
- package/src/manager/location/LocationManager.ts +0 -77
- package/src/manager/sdk/DispatchSDKManager.ts +0 -99
- package/src/manager/sdk/DispatchSdkCache.ts +0 -47
- package/src/manager/sdk/callbacksHandler.ts +0 -25
- package/src/manager/syncmanager/AppSyncManager.ts +0 -187
- package/src/manager/syncmanager/DBConfig.ts +0 -180
- package/src/manager/syncmanager/NativeSyncManager.ts +0 -14
- package/src/manager/syncmanager/constants.ts +0 -5
- package/src/manager/syncmanager/database.ts +0 -93
- package/src/manager/syncmanager/document/DocumentHttpClient.ts +0 -111
- package/src/manager/syncmanager/document/DocumentManager.ts +0 -143
- package/src/manager/syncmanager/document/DocumentSyncManager.ts +0 -233
- package/src/manager/syncmanager/document/models.ts +0 -4
- package/src/manager/syncmanager/events/ETEventsManager.ts +0 -633
- package/src/manager/syncmanager/events/EventsGraphQLClient.ts +0 -0
- package/src/manager/syncmanager/events/EventsSyncManager.ts +0 -490
- package/src/manager/syncmanager/events/SyncHttpClient.ts +0 -202
- package/src/models/DispatchModels.ts +0 -97
- package/src/models/ReasonCodes.ts +0 -12
- package/src/models/auth.ts +0 -43
- package/src/models/execTasks/ETBaseModels.ts +0 -113
- package/src/models/execTasks/ETConfig.ts +0 -94
- package/src/models/execution.ts +0 -9
- package/src/models/fcm.ts +0 -6
- package/src/models/sdk.ts +0 -35
- package/src/native/signature/SignatureCapture.tsx +0 -110
- package/src/network/GraphQLClient.ts +0 -147
- package/src/network/NetworkClient.ts +0 -58
- package/src/network/NetworkUtils.ts +0 -41
- package/src/network/Queries.ts +0 -46
- package/src/network/client.ts +0 -61
- package/src/res/strings.ts +0 -1
- package/src/resources/Login.ts +0 -36
- package/src/resources/network.ts +0 -13
- package/src/styles/SdkColors.ts +0 -24
- package/src/styles/executionTasks/CommonStyles.ts +0 -188
- package/src/ui/screens/CancellationScreen.tsx +0 -144
- package/src/ui/screens/CaptureInputScreen.tsx +0 -79
- package/src/ui/screens/CompleteObjectiveScreen.tsx +0 -72
- package/src/ui/screens/DeliverScreen.tsx +0 -114
- package/src/ui/screens/DisplayScreen.tsx +0 -52
- package/src/ui/screens/DoodleScreen.tsx +0 -84
- package/src/ui/screens/DropCashScreen.tsx +0 -113
- package/src/ui/screens/ETScreensIndex.ts +0 -35
- package/src/ui/screens/FormsScreen.tsx +0 -164
- package/src/ui/screens/GeofenceScreen.tsx +0 -54
- package/src/ui/screens/HttpRequestScreen.tsx +0 -47
- package/src/ui/screens/ImageCaptureScreen.tsx +0 -77
- package/src/ui/screens/PaymentScreen.tsx +0 -191
- package/src/ui/screens/PickupScreen.tsx +0 -82
- package/src/ui/screens/ScanScreen.tsx +0 -159
- package/src/ui/screens/StartWorkFlowScreen.tsx +0 -233
- package/src/ui/screens/ValidateOTPScreen.tsx +0 -62
- package/src/ui/screens/WithBaseDispatchScreen.tsx +0 -33
- package/src/ui/uiConfig/RouteParams.ts +0 -28
- package/src/utils/ApiUtils.ts +0 -157
- package/src/utils/ExecTaskUtils.ts +0 -214
- package/src/utils/Logger.ts +0 -110
- package/src/utils/NetworkUtil.ts +0 -50
- package/src/utils/SdkUtils.ts +0 -155
- package/src/utils/SyncManagerUtils.ts +0 -223
- package/src/utils/fcm/FCM.ts +0 -118
- package/src/utils/fcm/FcmUtils.ts +0 -130
- package/src/utils/helper.ts +0 -24
- package/src/utils/hooks/useModal.tsx +0 -67
- package/src/utils/hooks/useTimer.ts +0 -44
- package/src/utils/loginHelper.ts +0 -51
- package/src/utils/storage.ts +0 -292
- package/src/utils/test.json +0 -17
- package/src/utils/utils.ts +0 -30
|
@@ -1,633 +0,0 @@
|
|
|
1
|
-
import { isEmptyOrBlank } from '../../../utils/utils';
|
|
2
|
-
import {
|
|
3
|
-
BulkEvent,
|
|
4
|
-
CustodyData,
|
|
5
|
-
DispatchSyncType,
|
|
6
|
-
EventETData,
|
|
7
|
-
EventRow,
|
|
8
|
-
EVENTS_COLUMNS,
|
|
9
|
-
EVENTS_TABLE,
|
|
10
|
-
SyncManagerPayload,
|
|
11
|
-
ExecEngineSyncType,
|
|
12
|
-
WFUpdateBulkEventData,
|
|
13
|
-
WIUpdateOutputPayload,
|
|
14
|
-
WORKFLOW_INSTANCE_COLUMNS,
|
|
15
|
-
WORKFLOW_INSTANCE_TABLE,
|
|
16
|
-
} from '../DBConfig';
|
|
17
|
-
import type { ExecQuery } from '../database';
|
|
18
|
-
import * as Database from '../database';
|
|
19
|
-
import { BaseError } from '../../../errors/BaseError';
|
|
20
|
-
import BaseErrorCodes, {
|
|
21
|
-
InvalidArgumentsError,
|
|
22
|
-
} from '../../../errors/ErrorCodes';
|
|
23
|
-
import Logger, { LOG_TYPE } from '../../../utils/Logger';
|
|
24
|
-
import { BULK_DATA_LIMIT } from '../constants';
|
|
25
|
-
import Storage from '../../../utils/storage';
|
|
26
|
-
|
|
27
|
-
// NEW CODE
|
|
28
|
-
import {
|
|
29
|
-
DispatchExecutor,
|
|
30
|
-
IDispatch,
|
|
31
|
-
} from '@os1-platform/platform-coreos-execution-engine-sdk';
|
|
32
|
-
const SyncType = IDispatch.SyncType;
|
|
33
|
-
|
|
34
|
-
export default class ETEventsManager {
|
|
35
|
-
private static instance: ETEventsManager;
|
|
36
|
-
private maxRetryCount: number = 3;
|
|
37
|
-
private _retries = 0;
|
|
38
|
-
|
|
39
|
-
private constructor() {}
|
|
40
|
-
|
|
41
|
-
public static async getInstance(): Promise<ETEventsManager> {
|
|
42
|
-
if (!ETEventsManager.instance) {
|
|
43
|
-
let manager = new ETEventsManager();
|
|
44
|
-
await ETEventsManager.init();
|
|
45
|
-
ETEventsManager.instance = manager;
|
|
46
|
-
}
|
|
47
|
-
return ETEventsManager.instance;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
// NEED TO REMOVE SYNCED, CONFIG, OBJECTIVE_REF
|
|
51
|
-
private static async init(): Promise<void> {
|
|
52
|
-
await Database.executeQuery(
|
|
53
|
-
`CREATE TABLE IF NOT EXISTS ${EVENTS_TABLE} (\
|
|
54
|
-
${EVENTS_COLUMNS.ID} INTEGER PRIMARY KEY AUTOINCREMENT,\
|
|
55
|
-
${EVENTS_COLUMNS.DISPATCH_ID} TEXT NOT NULL,\
|
|
56
|
-
${EVENTS_COLUMNS.PAYLOAD} TEXT NOT NULL,\
|
|
57
|
-
${EVENTS_COLUMNS.CONFIG} TEXT,\
|
|
58
|
-
${EVENTS_COLUMNS.SYNC_TYPE} TEXT NOT NULL,\
|
|
59
|
-
${EVENTS_COLUMNS.DATA_LENGTH} INTEGER DEFAULT 0 NOT NULL,\
|
|
60
|
-
${EVENTS_COLUMNS.META} TEXT NOT NULL,\
|
|
61
|
-
${EVENTS_COLUMNS.SYNCED} INTEGER DEFAULT 0 NOT NULL,\
|
|
62
|
-
${EVENTS_COLUMNS.SYNC_ERROR} TEXT);`,
|
|
63
|
-
[]
|
|
64
|
-
);
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
async insertEvent(
|
|
68
|
-
sequence: number,
|
|
69
|
-
payload: string,
|
|
70
|
-
dspID: string,
|
|
71
|
-
syncType: string,
|
|
72
|
-
objectiveRef: string,
|
|
73
|
-
config?: string
|
|
74
|
-
): Promise<void> {
|
|
75
|
-
await Database.executeQuery(
|
|
76
|
-
`INSERT INTO ${EVENTS_TABLE}(\
|
|
77
|
-
${EVENTS_COLUMNS.PAYLOAD},\
|
|
78
|
-
${EVENTS_COLUMNS.DISPATCH_ID},\
|
|
79
|
-
${EVENTS_COLUMNS.SEQUENCE},\
|
|
80
|
-
${EVENTS_COLUMNS.CONFIG},\
|
|
81
|
-
${EVENTS_COLUMNS.SYNC_TYPE},\
|
|
82
|
-
${EVENTS_COLUMNS.META}) \
|
|
83
|
-
values (?,?,?,?,?,?)`,
|
|
84
|
-
[payload, dspID, sequence, config ?? null, syncType, objectiveRef]
|
|
85
|
-
);
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
private async getWFIPayload(
|
|
89
|
-
_bulkEventData: BulkEvent
|
|
90
|
-
): Promise<Array<WIUpdateOutputPayload>> {
|
|
91
|
-
const result: Array<WIUpdateOutputPayload> = [];
|
|
92
|
-
const dispatchId = _bulkEventData.dispatchId;
|
|
93
|
-
const { status, timestamp, code, attemptId, updatedBy, mergedObjectiveId } =
|
|
94
|
-
_bulkEventData.meta;
|
|
95
|
-
const outData: any = {};
|
|
96
|
-
const output: WFUpdateBulkEventData = _bulkEventData.data;
|
|
97
|
-
|
|
98
|
-
let offset = 0;
|
|
99
|
-
let jobMapping: Array<{ jobId: string; workflowInstanceId: string }> =
|
|
100
|
-
await DispatchExecutor.getJobMapping(
|
|
101
|
-
mergedObjectiveId,
|
|
102
|
-
BULK_DATA_LIMIT,
|
|
103
|
-
offset
|
|
104
|
-
);
|
|
105
|
-
do {
|
|
106
|
-
const __unmerged: Array<{ jobId: string; workflowInstanceId: string }> =
|
|
107
|
-
jobMapping;
|
|
108
|
-
|
|
109
|
-
Object.keys(output).forEach((customETName: string) => {
|
|
110
|
-
outData[customETName] = output[customETName];
|
|
111
|
-
});
|
|
112
|
-
|
|
113
|
-
result.push({
|
|
114
|
-
dispatchId,
|
|
115
|
-
updatedBy,
|
|
116
|
-
workflows: [
|
|
117
|
-
{
|
|
118
|
-
status,
|
|
119
|
-
attemptId,
|
|
120
|
-
timestamp,
|
|
121
|
-
code,
|
|
122
|
-
data: outData,
|
|
123
|
-
__unmerged,
|
|
124
|
-
meta: {},
|
|
125
|
-
},
|
|
126
|
-
],
|
|
127
|
-
});
|
|
128
|
-
|
|
129
|
-
offset += BULK_DATA_LIMIT;
|
|
130
|
-
jobMapping = await DispatchExecutor.getJobMapping(
|
|
131
|
-
mergedObjectiveId,
|
|
132
|
-
BULK_DATA_LIMIT,
|
|
133
|
-
offset
|
|
134
|
-
);
|
|
135
|
-
} while (jobMapping.length > 0);
|
|
136
|
-
|
|
137
|
-
return result;
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
private getCustodyPayload(_bulkEventData: BulkEvent) {
|
|
141
|
-
const data: Array<CustodyData> = _bulkEventData.data;
|
|
142
|
-
return data;
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
private getJobRemovalPayload(_bulkEventData: BulkEvent) {
|
|
146
|
-
const data: any = _bulkEventData.data;
|
|
147
|
-
return data;
|
|
148
|
-
}
|
|
149
|
-
|
|
150
|
-
private getDispatchUpdatePayload(_bulkEventData: BulkEvent) {
|
|
151
|
-
const data: any = _bulkEventData.data;
|
|
152
|
-
const payload = data.payload;
|
|
153
|
-
return payload;
|
|
154
|
-
}
|
|
155
|
-
|
|
156
|
-
private async _modifyEventData(
|
|
157
|
-
_bulkEventData: BulkEvent
|
|
158
|
-
): Promise<Array<SyncManagerPayload>> {
|
|
159
|
-
const syncType: ExecEngineSyncType | DispatchSyncType =
|
|
160
|
-
_bulkEventData.syncType;
|
|
161
|
-
switch (syncType) {
|
|
162
|
-
case SyncType.CUSTODY_IN_SCAN: {
|
|
163
|
-
const custodyInScans = this.getCustodyPayload(_bulkEventData);
|
|
164
|
-
return [
|
|
165
|
-
{
|
|
166
|
-
data: {
|
|
167
|
-
action: SyncType.CUSTODY_IN_SCAN,
|
|
168
|
-
payload: { output: custodyInScans },
|
|
169
|
-
},
|
|
170
|
-
length: custodyInScans.length,
|
|
171
|
-
},
|
|
172
|
-
];
|
|
173
|
-
}
|
|
174
|
-
case SyncType.CUSTODY_OUT_SCAN: {
|
|
175
|
-
const custodyOutScans = this.getCustodyPayload(_bulkEventData);
|
|
176
|
-
|
|
177
|
-
return [
|
|
178
|
-
{
|
|
179
|
-
data: {
|
|
180
|
-
action: SyncType.CUSTODY_OUT_SCAN,
|
|
181
|
-
payload: { output: custodyOutScans },
|
|
182
|
-
},
|
|
183
|
-
length: custodyOutScans.length,
|
|
184
|
-
},
|
|
185
|
-
];
|
|
186
|
-
}
|
|
187
|
-
case SyncType.WORKFLOW: {
|
|
188
|
-
const payload = await this.getWFIPayload(_bulkEventData);
|
|
189
|
-
return payload.map((_payload) => ({
|
|
190
|
-
data: { action: SyncType.WORKFLOW, payload: _payload },
|
|
191
|
-
length: _payload.workflows[0].__unmerged?.length || 0,
|
|
192
|
-
}));
|
|
193
|
-
}
|
|
194
|
-
case SyncType.JOB_REMOVAL: {
|
|
195
|
-
const jobRemoval = this.getJobRemovalPayload(_bulkEventData);
|
|
196
|
-
const length =
|
|
197
|
-
jobRemoval?.success?.length + jobRemoval?.failure?.length;
|
|
198
|
-
return [
|
|
199
|
-
{
|
|
200
|
-
data: {
|
|
201
|
-
action: SyncType.JOB_REMOVAL,
|
|
202
|
-
payload: jobRemoval,
|
|
203
|
-
},
|
|
204
|
-
length: length || 0,
|
|
205
|
-
},
|
|
206
|
-
];
|
|
207
|
-
}
|
|
208
|
-
case DispatchSyncType.DISPATCH_UPDATE: {
|
|
209
|
-
return [
|
|
210
|
-
{
|
|
211
|
-
data: {
|
|
212
|
-
action: DispatchSyncType.DISPATCH_UPDATE,
|
|
213
|
-
payload: this.getDispatchUpdatePayload(_bulkEventData),
|
|
214
|
-
},
|
|
215
|
-
length: 1,
|
|
216
|
-
},
|
|
217
|
-
];
|
|
218
|
-
}
|
|
219
|
-
default: {
|
|
220
|
-
return [
|
|
221
|
-
{
|
|
222
|
-
data: {
|
|
223
|
-
action: DispatchSyncType.DEFAULT,
|
|
224
|
-
payload: {},
|
|
225
|
-
},
|
|
226
|
-
length: 0,
|
|
227
|
-
},
|
|
228
|
-
];
|
|
229
|
-
}
|
|
230
|
-
}
|
|
231
|
-
}
|
|
232
|
-
|
|
233
|
-
private splitData(data: any, chunkSize: number, splitKey: string): any[] {
|
|
234
|
-
const result: any = [];
|
|
235
|
-
const splitArray = data[splitKey];
|
|
236
|
-
|
|
237
|
-
if (!splitArray || !Array.isArray(splitArray)) {
|
|
238
|
-
return result;
|
|
239
|
-
}
|
|
240
|
-
|
|
241
|
-
for (let i = 0; i < splitArray.length; i += chunkSize) {
|
|
242
|
-
const chunk: any = {};
|
|
243
|
-
|
|
244
|
-
for (const key in data) {
|
|
245
|
-
if (data.hasOwnProperty(key)) {
|
|
246
|
-
chunk[key] =
|
|
247
|
-
key === splitKey ? splitArray.slice(i, i + chunkSize) : data[key];
|
|
248
|
-
}
|
|
249
|
-
}
|
|
250
|
-
|
|
251
|
-
result.push(chunk);
|
|
252
|
-
}
|
|
253
|
-
|
|
254
|
-
return result;
|
|
255
|
-
}
|
|
256
|
-
|
|
257
|
-
// NEW CODE
|
|
258
|
-
async insertQueueEvent(_eventData: BulkEvent): Promise<void> {
|
|
259
|
-
let args: any[] = [];
|
|
260
|
-
let values: any[] = [];
|
|
261
|
-
let queryData: ExecQuery[] = []; //final data to pass to db
|
|
262
|
-
try {
|
|
263
|
-
values.push(`(?,?,?,?)`);
|
|
264
|
-
const _meta = JSON.stringify(_eventData.meta);
|
|
265
|
-
args.push(
|
|
266
|
-
_eventData.data,
|
|
267
|
-
_eventData.dispatchId,
|
|
268
|
-
_eventData.syncType,
|
|
269
|
-
_meta
|
|
270
|
-
// ? _evData.meta.jobId + _evData.meta.objectiveReference
|
|
271
|
-
// : 'NO_REF_FOUND'
|
|
272
|
-
);
|
|
273
|
-
queryData.push({
|
|
274
|
-
query: `INSERT INTO ${EVENTS_TABLE}(\
|
|
275
|
-
${EVENTS_COLUMNS.PAYLOAD},\
|
|
276
|
-
${EVENTS_COLUMNS.DISPATCH_ID},\
|
|
277
|
-
${EVENTS_COLUMNS.SYNC_TYPE},\
|
|
278
|
-
${EVENTS_COLUMNS.META}) \
|
|
279
|
-
values ${values.join(',')};`,
|
|
280
|
-
args,
|
|
281
|
-
});
|
|
282
|
-
await Database.executeBulkQuery(queryData);
|
|
283
|
-
this._retries = 0;
|
|
284
|
-
} catch (err) {
|
|
285
|
-
if (this._retries < this.maxRetryCount) {
|
|
286
|
-
Logger.getInstance().logEvent(
|
|
287
|
-
'insertQueueEvent ',
|
|
288
|
-
this._retries.toString(),
|
|
289
|
-
LOG_TYPE.SDK_DEBUG
|
|
290
|
-
);
|
|
291
|
-
this._retries++;
|
|
292
|
-
await this.insertQueueEvent(_eventData);
|
|
293
|
-
} else {
|
|
294
|
-
this._retries = 0;
|
|
295
|
-
throw err;
|
|
296
|
-
}
|
|
297
|
-
}
|
|
298
|
-
}
|
|
299
|
-
|
|
300
|
-
// NEW CODE
|
|
301
|
-
async insertBulkEvent(_eventData: BulkEvent): Promise<void> {
|
|
302
|
-
try {
|
|
303
|
-
const output: Array<SyncManagerPayload> = await this._modifyEventData(
|
|
304
|
-
_eventData
|
|
305
|
-
);
|
|
306
|
-
let args: any[] = [];
|
|
307
|
-
let values: any[] = [];
|
|
308
|
-
let queryData: ExecQuery[] = []; //final data to pass to db
|
|
309
|
-
const _meta = JSON.stringify(_eventData.meta || {});
|
|
310
|
-
|
|
311
|
-
if (
|
|
312
|
-
_eventData.syncType === SyncType.WORKFLOW ||
|
|
313
|
-
_eventData.syncType === SyncType.CUSTODY_IN_SCAN ||
|
|
314
|
-
_eventData.syncType === SyncType.CUSTODY_OUT_SCAN ||
|
|
315
|
-
_eventData.syncType === DispatchSyncType.DISPATCH_UPDATE
|
|
316
|
-
) {
|
|
317
|
-
output.forEach(
|
|
318
|
-
(syncManagerPayload: SyncManagerPayload, index: number) => {
|
|
319
|
-
const _payload = JSON.stringify(syncManagerPayload.data);
|
|
320
|
-
if (
|
|
321
|
-
isEmptyOrBlank(syncManagerPayload.data.action) ||
|
|
322
|
-
isEmptyOrBlank(_payload)
|
|
323
|
-
) {
|
|
324
|
-
throw new BaseError(
|
|
325
|
-
BaseErrorCodes.InvalidArgumentError,
|
|
326
|
-
InvalidArgumentsError
|
|
327
|
-
);
|
|
328
|
-
}
|
|
329
|
-
values.push(`(?,?,?,?,?)`);
|
|
330
|
-
args.push(
|
|
331
|
-
_payload,
|
|
332
|
-
_eventData.dispatchId,
|
|
333
|
-
_eventData.syncType,
|
|
334
|
-
syncManagerPayload.length,
|
|
335
|
-
_meta
|
|
336
|
-
);
|
|
337
|
-
queryData.push({
|
|
338
|
-
query: `INSERT INTO ${EVENTS_TABLE}(\
|
|
339
|
-
${EVENTS_COLUMNS.PAYLOAD},\
|
|
340
|
-
${EVENTS_COLUMNS.DISPATCH_ID},\
|
|
341
|
-
${EVENTS_COLUMNS.SYNC_TYPE},\
|
|
342
|
-
${EVENTS_COLUMNS.DATA_LENGTH},\
|
|
343
|
-
${EVENTS_COLUMNS.META}) \
|
|
344
|
-
values ${values.join(',')};`,
|
|
345
|
-
args,
|
|
346
|
-
});
|
|
347
|
-
values = [];
|
|
348
|
-
args = [];
|
|
349
|
-
}
|
|
350
|
-
);
|
|
351
|
-
|
|
352
|
-
await Database.executeBulkQuery(queryData);
|
|
353
|
-
this._retries = 0;
|
|
354
|
-
}
|
|
355
|
-
// else if (
|
|
356
|
-
// _eventData.syncType === SyncType.CUSTODY_IN_SCAN ||
|
|
357
|
-
// _eventData.syncType === SyncType.CUSTODY_OUT_SCAN
|
|
358
|
-
// ) {
|
|
359
|
-
// output.forEach(
|
|
360
|
-
// (syncManagerPayload: SyncManagerPayload, index: number) => {
|
|
361
|
-
// const _payload = JSON.stringify(syncManagerPayload);
|
|
362
|
-
// if (
|
|
363
|
-
// isEmptyOrBlank(syncManagerPayload.action) ||
|
|
364
|
-
// isEmptyOrBlank(_payload)
|
|
365
|
-
// ) {
|
|
366
|
-
// throw new BaseError(
|
|
367
|
-
// BaseErrorCodes.InvalidArgumentError,
|
|
368
|
-
// InvalidArgumentsError
|
|
369
|
-
// );
|
|
370
|
-
// }
|
|
371
|
-
// values.push(`(?,?,?,?)`);
|
|
372
|
-
// args.push(
|
|
373
|
-
// _payload,
|
|
374
|
-
// _eventData.dispatchId,
|
|
375
|
-
// _eventData.syncType,
|
|
376
|
-
// _meta
|
|
377
|
-
// );
|
|
378
|
-
// queryData.push({
|
|
379
|
-
// query: `INSERT INTO ${EVENTS_TABLE}(\
|
|
380
|
-
// ${EVENTS_COLUMNS.PAYLOAD},\
|
|
381
|
-
// ${EVENTS_COLUMNS.DISPATCH_ID},\
|
|
382
|
-
// ${EVENTS_COLUMNS.SYNC_TYPE},\
|
|
383
|
-
// ${EVENTS_COLUMNS.OBJECTIVE_REF}) \
|
|
384
|
-
// values ${values.join(',')};`,
|
|
385
|
-
// args,
|
|
386
|
-
// });
|
|
387
|
-
// values = [];
|
|
388
|
-
// args = [];
|
|
389
|
-
// }
|
|
390
|
-
// );
|
|
391
|
-
|
|
392
|
-
// await Database.executeBulkQuery(queryData);
|
|
393
|
-
// this._retries = 0;
|
|
394
|
-
// } else if (_eventData.syncType === DispatchSyncType.DISPATCH_UPDATE) {
|
|
395
|
-
// }
|
|
396
|
-
else {
|
|
397
|
-
const chunkedData = this.splitData(output, BULK_DATA_LIMIT, 'payload');
|
|
398
|
-
|
|
399
|
-
chunkedData.forEach((_evData, index) => {
|
|
400
|
-
const _payload = JSON.stringify(_evData.payload);
|
|
401
|
-
if (isEmptyOrBlank(_evData.action) || isEmptyOrBlank(_payload))
|
|
402
|
-
throw new BaseError(
|
|
403
|
-
BaseErrorCodes.InvalidArgumentError,
|
|
404
|
-
InvalidArgumentsError
|
|
405
|
-
);
|
|
406
|
-
values.push(`(?,?,?,?,?)`);
|
|
407
|
-
args.push(_evData, _eventData.dispatchId, _eventData.syncType, _meta);
|
|
408
|
-
queryData.push({
|
|
409
|
-
query: `INSERT INTO ${EVENTS_TABLE}(\
|
|
410
|
-
${EVENTS_COLUMNS.PAYLOAD},\
|
|
411
|
-
${EVENTS_COLUMNS.DISPATCH_ID},\
|
|
412
|
-
${EVENTS_COLUMNS.SYNC_TYPE},\
|
|
413
|
-
${EVENTS_COLUMNS.DATA_LENGTH},\
|
|
414
|
-
${EVENTS_COLUMNS.META}) \
|
|
415
|
-
values ${values.join(',')};`,
|
|
416
|
-
args,
|
|
417
|
-
});
|
|
418
|
-
values = [];
|
|
419
|
-
args = [];
|
|
420
|
-
});
|
|
421
|
-
await Database.executeBulkQuery(queryData);
|
|
422
|
-
this._retries = 0;
|
|
423
|
-
}
|
|
424
|
-
} catch (err) {
|
|
425
|
-
if (this._retries < this.maxRetryCount) {
|
|
426
|
-
Logger.getInstance().logEvent(
|
|
427
|
-
'insertBulkEvent ',
|
|
428
|
-
this._retries.toString(),
|
|
429
|
-
LOG_TYPE.SDK_DEBUG
|
|
430
|
-
);
|
|
431
|
-
this._retries++;
|
|
432
|
-
await this.insertBulkEvent(_eventData);
|
|
433
|
-
} else {
|
|
434
|
-
this._retries = 0;
|
|
435
|
-
throw err;
|
|
436
|
-
}
|
|
437
|
-
}
|
|
438
|
-
}
|
|
439
|
-
|
|
440
|
-
// OLD CODE
|
|
441
|
-
// async insertBulkEvent(_eventData: BulkEvent[]): Promise<void> {
|
|
442
|
-
// try {
|
|
443
|
-
// let args: any[] = [];
|
|
444
|
-
// let values: any[] = [];
|
|
445
|
-
// let queryData: ExecQuery[] = []; //final data to pass to db
|
|
446
|
-
// let evIndex = 100;
|
|
447
|
-
|
|
448
|
-
// _eventData.forEach((_evData, index) => {
|
|
449
|
-
// if (
|
|
450
|
-
// !_evData.sequence ||
|
|
451
|
-
// isEmptyOrBlank(_evData.data) ||
|
|
452
|
-
// isEmptyOrBlank(_evData.dispatchId) ||
|
|
453
|
-
// isEmptyOrBlank(_evData.syncType)
|
|
454
|
-
// )
|
|
455
|
-
// throw new BaseError(
|
|
456
|
-
// BaseErrorCodes.InvalidArgumentError,
|
|
457
|
-
// InvalidArgumentsError
|
|
458
|
-
// );
|
|
459
|
-
|
|
460
|
-
// values.push(`(?,?,?,?,?)`);
|
|
461
|
-
// args.push(
|
|
462
|
-
// _evData.data,
|
|
463
|
-
// _evData.dispatchId,
|
|
464
|
-
// // _evData.sequence,
|
|
465
|
-
// _evData.config ? JSON.stringify(_evData.config) : null,
|
|
466
|
-
// _evData.syncType,
|
|
467
|
-
// _evData.meta
|
|
468
|
-
// ? _evData.meta.jobId + _evData.meta.objectiveReference
|
|
469
|
-
// : 'NO_REF_FOUND'
|
|
470
|
-
// );
|
|
471
|
-
// if (index === evIndex || index === _eventData.length - 1) {
|
|
472
|
-
// queryData.push({
|
|
473
|
-
// query: `INSERT INTO ${EVENTS_TABLE}(\
|
|
474
|
-
// ${EVENTS_COLUMNS.PAYLOAD},\
|
|
475
|
-
// ${EVENTS_COLUMNS.DISPATCH_ID},\
|
|
476
|
-
// ${EVENTS_COLUMNS.CONFIG},\
|
|
477
|
-
// ${EVENTS_COLUMNS.SYNC_TYPE},\
|
|
478
|
-
// ${EVENTS_COLUMNS.OBJECTIVE_REF}) \
|
|
479
|
-
// values ${values.join(',')};`,
|
|
480
|
-
// args,
|
|
481
|
-
// });
|
|
482
|
-
// values = [];
|
|
483
|
-
// args = [];
|
|
484
|
-
// evIndex = evIndex + evIndex;
|
|
485
|
-
// }
|
|
486
|
-
// });
|
|
487
|
-
|
|
488
|
-
// await Database.executeBulkQuery(queryData);
|
|
489
|
-
// this._retries = 0;
|
|
490
|
-
// } catch (err) {
|
|
491
|
-
// if (this._retries < this.maxRetryCount) {
|
|
492
|
-
// Logger.getInstance().logEvent(
|
|
493
|
-
// 'insertBulkEvent ',
|
|
494
|
-
// this._retries.toString(),
|
|
495
|
-
// LOG_TYPE.SDK_DEBUG
|
|
496
|
-
// );
|
|
497
|
-
// this._retries++;
|
|
498
|
-
// await this.insertBulkEvent(_eventData);
|
|
499
|
-
// } else {
|
|
500
|
-
// this._retries = 0;
|
|
501
|
-
// throw err;
|
|
502
|
-
// }
|
|
503
|
-
// }
|
|
504
|
-
// }
|
|
505
|
-
|
|
506
|
-
async getAllEvents(dispatchID?: string): Promise<EventRow[]> {
|
|
507
|
-
if (dispatchID) {
|
|
508
|
-
const resultSet = await Database.executeQuery(
|
|
509
|
-
`SELECT * FROM ${EVENTS_TABLE}\
|
|
510
|
-
WHERE ${EVENTS_COLUMNS.DISPATCH_ID} = ?;`,
|
|
511
|
-
[dispatchID]
|
|
512
|
-
);
|
|
513
|
-
return resultSet.rows._array;
|
|
514
|
-
} else {
|
|
515
|
-
const resultSet = await Database.executeQuery(
|
|
516
|
-
`SELECT * FROM ${EVENTS_TABLE};`,
|
|
517
|
-
[]
|
|
518
|
-
);
|
|
519
|
-
return resultSet.rows._array;
|
|
520
|
-
}
|
|
521
|
-
}
|
|
522
|
-
|
|
523
|
-
async getAllUnsyncedEvents(): Promise<EventRow[]> {
|
|
524
|
-
let resultSet = await Database.executeQuery(
|
|
525
|
-
`SELECT * FROM ${EVENTS_TABLE} \
|
|
526
|
-
where ${EVENTS_COLUMNS.SYNCED} = 0;`,
|
|
527
|
-
[]
|
|
528
|
-
);
|
|
529
|
-
return resultSet.rows._array;
|
|
530
|
-
}
|
|
531
|
-
|
|
532
|
-
public deleteAllEvents() {
|
|
533
|
-
const deleteEventsQuery = {
|
|
534
|
-
query: `DELETE FROM ${EVENTS_TABLE};`,
|
|
535
|
-
args: [],
|
|
536
|
-
};
|
|
537
|
-
const resetAutoIncrementSequence = {
|
|
538
|
-
query: `UPDATE sqlite_sequence SET seq = 0 WHERE name
|
|
539
|
-
= '${EVENTS_TABLE}';`,
|
|
540
|
-
args: [],
|
|
541
|
-
};
|
|
542
|
-
|
|
543
|
-
return Database.executeBulkQuery([
|
|
544
|
-
deleteEventsQuery,
|
|
545
|
-
resetAutoIncrementSequence,
|
|
546
|
-
]);
|
|
547
|
-
}
|
|
548
|
-
|
|
549
|
-
async updateError(id: number, syncError: string): Promise<void> {
|
|
550
|
-
if (!id) throw new TypeError('Event ID cannot be null');
|
|
551
|
-
await Database.executeQuery(
|
|
552
|
-
`UPDATE ${EVENTS_TABLE} \
|
|
553
|
-
SET \
|
|
554
|
-
${EVENTS_COLUMNS.SYNC_ERROR} = ? WHERE ${EVENTS_COLUMNS.ID} = ?;`,
|
|
555
|
-
[syncError, id]
|
|
556
|
-
);
|
|
557
|
-
}
|
|
558
|
-
|
|
559
|
-
async markEventSynced(id: number): Promise<void> {
|
|
560
|
-
if (!id) throw new TypeError('Event ID cannot be null');
|
|
561
|
-
await Database.executeQuery(
|
|
562
|
-
`UPDATE ${EVENTS_TABLE} SET ${EVENTS_COLUMNS.SYNCED} = 1 WHERE ${EVENTS_COLUMNS.ID} = ?;`,
|
|
563
|
-
[id]
|
|
564
|
-
);
|
|
565
|
-
}
|
|
566
|
-
|
|
567
|
-
async getWorkflowUpdateEvents(syncType: string): Promise<EventRow[]> {
|
|
568
|
-
let sqlResultSet = await Database.executeQuery(
|
|
569
|
-
`SELECT * from ${EVENTS_TABLE}\
|
|
570
|
-
WHERE ${EVENTS_COLUMNS.SYNCED} = 0\
|
|
571
|
-
and ${EVENTS_COLUMNS.SYNC_TYPE} = ?\
|
|
572
|
-
ORDER BY ${EVENTS_COLUMNS.ID} ASC LIMIT 1;`,
|
|
573
|
-
[syncType]
|
|
574
|
-
);
|
|
575
|
-
return sqlResultSet.rows._array;
|
|
576
|
-
}
|
|
577
|
-
async getJobRemovalEvents(syncType: string): Promise<EventRow[]> {
|
|
578
|
-
let sqlResultSet = await Database.executeQuery(
|
|
579
|
-
`SELECT * from ${EVENTS_TABLE}\
|
|
580
|
-
WHERE ${EVENTS_COLUMNS.SYNCED} = 0\
|
|
581
|
-
and ${EVENTS_COLUMNS.SYNC_TYPE} = ?\
|
|
582
|
-
ORDER BY ${EVENTS_COLUMNS.ID} ASC LIMIT 1;`,
|
|
583
|
-
[syncType]
|
|
584
|
-
);
|
|
585
|
-
return sqlResultSet.rows._array;
|
|
586
|
-
}
|
|
587
|
-
async getCustodyBatch(dispatchID: string): Promise<EventRow[]> {
|
|
588
|
-
const sqlResult = await Database.executeQuery(
|
|
589
|
-
`SELECT * from ${EVENTS_TABLE}\
|
|
590
|
-
WHERE ${EVENTS_COLUMNS.SYNCED} = 0 and \
|
|
591
|
-
(${EVENTS_COLUMNS.SYNC_TYPE} = ? or ${EVENTS_COLUMNS.SYNC_TYPE} = ?) \
|
|
592
|
-
and ${EVENTS_COLUMNS.DISPATCH_ID} = ? \
|
|
593
|
-
ORDER BY ${EVENTS_COLUMNS.ID} ASC;`,
|
|
594
|
-
[SyncType.CUSTODY_IN_SCAN, SyncType.CUSTODY_OUT_SCAN, dispatchID]
|
|
595
|
-
);
|
|
596
|
-
return sqlResult.rows._array;
|
|
597
|
-
}
|
|
598
|
-
async getObjectiveDetails(objectiveRef: string): Promise<EventRow[]> {
|
|
599
|
-
let rs = await Database.executeQuery(
|
|
600
|
-
`SELECT * from ${EVENTS_TABLE} WHERE ${EVENTS_COLUMNS.META} = ?;`,
|
|
601
|
-
[objectiveRef]
|
|
602
|
-
);
|
|
603
|
-
return rs.rows._array;
|
|
604
|
-
}
|
|
605
|
-
|
|
606
|
-
async getRowToSync(id: string, dispatchId: string): Promise<EventRow[]> {
|
|
607
|
-
const sqlResult = await Database.executeQuery(
|
|
608
|
-
`SELECT * from ${EVENTS_TABLE}\
|
|
609
|
-
WHERE ${EVENTS_COLUMNS.ID} = ? and \
|
|
610
|
-
${EVENTS_COLUMNS.DISPATCH_ID} = ? \
|
|
611
|
-
ORDER BY ${EVENTS_COLUMNS.ID} ASC;`,
|
|
612
|
-
[id, dispatchId]
|
|
613
|
-
);
|
|
614
|
-
return sqlResult.rows._array;
|
|
615
|
-
}
|
|
616
|
-
|
|
617
|
-
async getBulkRowsToSync(id: string, dispatchId: string): Promise<EventRow[]> {
|
|
618
|
-
const query = `SELECT * FROM \
|
|
619
|
-
(SELECT *, \
|
|
620
|
-
(SELECT SUM(${EVENTS_COLUMNS.DATA_LENGTH}) \
|
|
621
|
-
FROM ${EVENTS_TABLE} \
|
|
622
|
-
WHERE id <= t.id and ${EVENTS_COLUMNS.ID} > ${id} and ${EVENTS_COLUMNS.DISPATCH_ID} \ = '${dispatchId}' and ${EVENTS_COLUMNS.DATA_LENGTH} > 0 \
|
|
623
|
-
) total \
|
|
624
|
-
FROM ${EVENTS_TABLE} t \
|
|
625
|
-
) q \
|
|
626
|
-
WHERE total <= ${BULK_DATA_LIMIT} \
|
|
627
|
-
ORDER BY ${EVENTS_COLUMNS.ID};`;
|
|
628
|
-
|
|
629
|
-
const sqlResult = await Database.executeQuery(query, []);
|
|
630
|
-
|
|
631
|
-
return sqlResult.rows._array;
|
|
632
|
-
}
|
|
633
|
-
}
|
|
File without changes
|