@os1-platform/dispatch-mobile 3.1.8 → 3.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +0 -2
- package/android/.gradle/8.10.2/checksums/checksums.lock +0 -0
- package/android/.gradle/8.10.2/checksums/md5-checksums.bin +0 -0
- package/android/.gradle/8.10.2/checksums/sha1-checksums.bin +0 -0
- package/android/.gradle/8.10.2/executionHistory/executionHistory.lock +0 -0
- package/android/.gradle/{7.5/checksums/md5-checksums.bin → 8.10.2/fileHashes/fileHashes.bin} +0 -0
- package/android/.gradle/8.10.2/fileHashes/fileHashes.lock +0 -0
- package/android/.gradle/{7.5/fileHashes/fileHashes.bin → 8.10.2/fileHashes/resourceHashesCache.bin} +0 -0
- package/android/.gradle/buildOutputCleanup/buildOutputCleanup.lock +0 -0
- package/android/.gradle/buildOutputCleanup/cache.properties +2 -2
- package/android/.idea/AndroidProjectSystem.xml +6 -0
- package/android/.idea/caches/deviceStreaming.xml +533 -13
- package/android/.idea/gradle.xml +2 -1
- package/android/.idea/kotlinc.xml +1 -1
- package/android/.idea/misc.xml +1 -2
- package/android/.idea/runConfigurations.xml +17 -0
- package/android/.idea/studiobot.xml +6 -0
- package/android/build.gradle +3 -12
- package/android/gradle.properties +9 -4
- package/android/src/main/AndroidManifest.xml +2 -0
- package/android/src/main/java/com/dispatchsdk/utils/DispatchSdkUtils.kt +25 -10
- package/babel.config.js +1 -1
- package/lib/commonjs/analytics/sentry/SentrySdkConstants.js +4 -0
- package/lib/commonjs/analytics/sentry/SentrySdkConstants.js.map +1 -1
- package/lib/commonjs/components/executiontasks/captureInput/CaptureText.js +4 -4
- package/lib/commonjs/components/executiontasks/captureInput/CaptureText.js.map +1 -1
- package/lib/commonjs/components/executiontasks/collectPayment/components/CompletePayment.js +2 -2
- package/lib/commonjs/components/executiontasks/collectPayment/components/CompletePayment.js.map +1 -1
- package/lib/commonjs/components/executiontasks/collectPayment/components/InitPayment.js +4 -7
- package/lib/commonjs/components/executiontasks/collectPayment/components/InitPayment.js.map +1 -1
- package/lib/commonjs/components/executiontasks/collectPayment/components/PaymentContactDetails.js +7 -7
- package/lib/commonjs/components/executiontasks/collectPayment/components/PaymentContactDetails.js.map +1 -1
- package/lib/commonjs/components/executiontasks/collectPayment/components/ProcessPayment.js +20 -20
- package/lib/commonjs/components/executiontasks/collectPayment/components/ProcessPayment.js.map +1 -1
- package/lib/commonjs/components/executiontasks/deliver/SLDeliverET.js +4 -4
- package/lib/commonjs/components/executiontasks/deliver/SLDeliverET.js.map +1 -1
- package/lib/commonjs/components/executiontasks/doodle/SignatureET.js +4 -4
- package/lib/commonjs/components/executiontasks/doodle/SignatureET.js.map +1 -1
- package/lib/commonjs/components/executiontasks/dropCash/SLDropCash.js +4 -4
- package/lib/commonjs/components/executiontasks/dropCash/SLDropCash.js.map +1 -1
- package/lib/commonjs/components/executiontasks/forms/FormGenerator.js +12 -33
- package/lib/commonjs/components/executiontasks/forms/FormGenerator.js.map +1 -1
- package/lib/commonjs/components/executiontasks/imageCapture/ImageCapture.js +4 -4
- package/lib/commonjs/components/executiontasks/imageCapture/ImageCapture.js.map +1 -1
- package/lib/commonjs/components/executiontasks/payments/completePayment/CompletePaymentET.js +4 -4
- package/lib/commonjs/components/executiontasks/payments/completePayment/CompletePaymentET.js.map +1 -1
- package/lib/commonjs/components/executiontasks/payments/init/InitPaymentET.js +4 -4
- package/lib/commonjs/components/executiontasks/payments/init/InitPaymentET.js.map +1 -1
- package/lib/commonjs/components/executiontasks/payments/processPayment/ProcessPaymentET.js +4 -4
- package/lib/commonjs/components/executiontasks/payments/processPayment/ProcessPaymentET.js.map +1 -1
- package/lib/commonjs/components/executiontasks/pickup/PickupET.js.map +1 -1
- package/lib/commonjs/components/executiontasks/pickup/SLPickupET.js +4 -4
- package/lib/commonjs/components/executiontasks/pickup/SLPickupET.js.map +1 -1
- package/lib/commonjs/components/executiontasks/scan/ScanET.js +4 -4
- package/lib/commonjs/components/executiontasks/scan/ScanET.js.map +1 -1
- package/lib/commonjs/components/executiontasks/scan/interfaces.js +17 -1
- package/lib/commonjs/components/executiontasks/scan/interfaces.js.map +1 -1
- package/lib/commonjs/components/executiontasks/scan/sub_components/CScanner.js +4 -4
- package/lib/commonjs/components/executiontasks/scan/sub_components/CScanner.js.map +1 -1
- package/lib/commonjs/components/executiontasks/scan/sub_components/DropDownUtils.js +1 -1
- package/lib/commonjs/components/executiontasks/scan/sub_components/DropDownUtils.js.map +1 -1
- package/lib/commonjs/components/executiontasks/scan/sub_components/ERDropDown.js.map +1 -1
- package/lib/commonjs/components/executiontasks/scan/utils.js +12 -13
- package/lib/commonjs/components/executiontasks/scan/utils.js.map +1 -1
- package/lib/commonjs/components/executiontasks/validateOTP/ValidateOTPET.js.map +1 -1
- package/lib/commonjs/components/executiontasks/validateOTP/ValidateOTPSchema.js.map +1 -1
- package/lib/commonjs/components/executiontasks/validateOTP/components/ContactListView.js +4 -5
- package/lib/commonjs/components/executiontasks/validateOTP/components/ContactListView.js.map +1 -1
- package/lib/commonjs/components/executiontasks/validateOTP/components/OTPView.js +4 -4
- package/lib/commonjs/components/executiontasks/validateOTP/components/OTPView.js.map +1 -1
- package/lib/commonjs/components/executiontasks/verifyOtp/VerifyOtpET.js +5 -9
- package/lib/commonjs/components/executiontasks/verifyOtp/VerifyOtpET.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/SnackBarCustom.js +0 -3
- package/lib/commonjs/components/widgets/SnackBarCustom.js.map +1 -1
- package/lib/commonjs/components/widgets/Timer.js.map +1 -1
- package/lib/commonjs/database/DBManager.js +112 -0
- package/lib/commonjs/database/DBManager.js.map +1 -0
- package/lib/commonjs/database/dbUpdate.json +6 -0
- package/lib/commonjs/manager/dispatch/DispatchStateContainer.js.map +1 -1
- package/lib/commonjs/manager/dispatchCodes/EventCodeRepo.js +8 -9
- package/lib/commonjs/manager/dispatchCodes/EventCodeRepo.js.map +1 -1
- package/lib/commonjs/manager/dispatchCodes/ReasonCodeContainer.js +4 -4
- package/lib/commonjs/manager/dispatchCodes/ReasonCodeContainer.js.map +1 -1
- package/lib/commonjs/manager/dispatchCodes/ReasonCodeRepo.js +13 -10
- package/lib/commonjs/manager/dispatchCodes/ReasonCodeRepo.js.map +1 -1
- package/lib/commonjs/manager/location/LocationManager.js +0 -4
- package/lib/commonjs/manager/location/LocationManager.js.map +1 -1
- package/lib/commonjs/manager/sdk/DispatchSDKManager.js +7 -1
- package/lib/commonjs/manager/sdk/DispatchSDKManager.js.map +1 -1
- package/lib/commonjs/manager/sdk/callbacksHandler.js +1 -1
- package/lib/commonjs/manager/sdk/callbacksHandler.js.map +1 -1
- package/lib/commonjs/manager/syncmanager/DBConfig.js +6 -2
- package/lib/commonjs/manager/syncmanager/DBConfig.js.map +1 -1
- package/lib/commonjs/manager/syncmanager/database.js +117 -45
- package/lib/commonjs/manager/syncmanager/database.js.map +1 -1
- package/lib/commonjs/manager/syncmanager/document/DocumentManager.js +17 -22
- package/lib/commonjs/manager/syncmanager/document/DocumentManager.js.map +1 -1
- package/lib/commonjs/manager/syncmanager/document/DocumentSyncManager.js +85 -75
- package/lib/commonjs/manager/syncmanager/document/DocumentSyncManager.js.map +1 -1
- package/lib/commonjs/manager/syncmanager/events/ETEventsManager.js +24 -26
- package/lib/commonjs/manager/syncmanager/events/ETEventsManager.js.map +1 -1
- package/lib/commonjs/manager/syncmanager/events/EventsSyncManager.js.map +1 -1
- package/lib/commonjs/models/execTasks/ETConfig.js +1 -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 +2 -2
- package/lib/commonjs/native/signature/SignatureCapture.js.map +1 -1
- package/lib/commonjs/network/client.js.map +1 -1
- package/lib/commonjs/ui/screens/ValidateOTPScreen.js.map +1 -1
- package/lib/commonjs/utils/Constants.js.map +1 -1
- package/lib/commonjs/utils/Logger.js +1 -1
- package/lib/commonjs/utils/Logger.js.map +1 -1
- package/lib/commonjs/utils/SdkUtils.js +8 -4
- package/lib/commonjs/utils/SdkUtils.js.map +1 -1
- package/lib/commonjs/utils/SyncManagerUtils.js +2 -0
- package/lib/commonjs/utils/SyncManagerUtils.js.map +1 -1
- package/lib/module/analytics/sentry/SentrySdkConstants.js +4 -0
- package/lib/module/analytics/sentry/SentrySdkConstants.js.map +1 -1
- package/lib/module/components/executiontasks/captureInput/CaptureText.js +3 -3
- package/lib/module/components/executiontasks/captureInput/CaptureText.js.map +1 -1
- package/lib/module/components/executiontasks/collectPayment/components/CompletePayment.js +2 -2
- package/lib/module/components/executiontasks/collectPayment/components/CompletePayment.js.map +1 -1
- package/lib/module/components/executiontasks/collectPayment/components/InitPayment.js +3 -6
- package/lib/module/components/executiontasks/collectPayment/components/InitPayment.js.map +1 -1
- package/lib/module/components/executiontasks/collectPayment/components/PaymentContactDetails.js +6 -6
- package/lib/module/components/executiontasks/collectPayment/components/PaymentContactDetails.js.map +1 -1
- package/lib/module/components/executiontasks/collectPayment/components/ProcessPayment.js +18 -18
- package/lib/module/components/executiontasks/collectPayment/components/ProcessPayment.js.map +1 -1
- package/lib/module/components/executiontasks/deliver/SLDeliverET.js +3 -3
- package/lib/module/components/executiontasks/deliver/SLDeliverET.js.map +1 -1
- package/lib/module/components/executiontasks/doodle/SignatureET.js +3 -3
- package/lib/module/components/executiontasks/doodle/SignatureET.js.map +1 -1
- package/lib/module/components/executiontasks/dropCash/SLDropCash.js +3 -3
- package/lib/module/components/executiontasks/dropCash/SLDropCash.js.map +1 -1
- package/lib/module/components/executiontasks/forms/FormGenerator.js +11 -32
- package/lib/module/components/executiontasks/forms/FormGenerator.js.map +1 -1
- package/lib/module/components/executiontasks/imageCapture/ImageCapture.js +4 -4
- package/lib/module/components/executiontasks/imageCapture/ImageCapture.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/payments/init/InitPaymentET.js +3 -3
- package/lib/module/components/executiontasks/payments/init/InitPaymentET.js.map +1 -1
- package/lib/module/components/executiontasks/payments/processPayment/ProcessPaymentET.js +3 -3
- package/lib/module/components/executiontasks/payments/processPayment/ProcessPaymentET.js.map +1 -1
- package/lib/module/components/executiontasks/pickup/PickupET.js.map +1 -1
- package/lib/module/components/executiontasks/pickup/SLPickupET.js +3 -3
- package/lib/module/components/executiontasks/pickup/SLPickupET.js.map +1 -1
- package/lib/module/components/executiontasks/scan/ScanET.js +3 -3
- package/lib/module/components/executiontasks/scan/ScanET.js.map +1 -1
- package/lib/module/components/executiontasks/scan/interfaces.js +16 -0
- package/lib/module/components/executiontasks/scan/interfaces.js.map +1 -1
- package/lib/module/components/executiontasks/scan/sub_components/CScanner.js +5 -5
- package/lib/module/components/executiontasks/scan/sub_components/CScanner.js.map +1 -1
- package/lib/module/components/executiontasks/scan/sub_components/DropDownUtils.js +2 -2
- package/lib/module/components/executiontasks/scan/sub_components/DropDownUtils.js.map +1 -1
- package/lib/module/components/executiontasks/scan/sub_components/ERDropDown.js.map +1 -1
- package/lib/module/components/executiontasks/scan/utils.js +13 -14
- 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/ValidateOTPSchema.js.map +1 -1
- package/lib/module/components/executiontasks/validateOTP/components/ContactListView.js +3 -4
- package/lib/module/components/executiontasks/validateOTP/components/ContactListView.js.map +1 -1
- package/lib/module/components/executiontasks/validateOTP/components/OTPView.js +3 -3
- package/lib/module/components/executiontasks/validateOTP/components/OTPView.js.map +1 -1
- package/lib/module/components/executiontasks/verifyOtp/VerifyOtpET.js +6 -9
- package/lib/module/components/executiontasks/verifyOtp/VerifyOtpET.js.map +1 -1
- package/lib/module/components/widgets/CancelOrderDialog.js +1 -1
- package/lib/module/components/widgets/CancelOrderDialog.js.map +1 -1
- package/lib/module/components/widgets/SnackBarCustom.js +0 -2
- package/lib/module/components/widgets/SnackBarCustom.js.map +1 -1
- package/lib/module/components/widgets/Timer.js.map +1 -1
- package/lib/module/database/DBManager.js +104 -0
- package/lib/module/database/DBManager.js.map +1 -0
- package/lib/module/database/dbUpdate.json +6 -0
- package/lib/module/manager/dispatch/DispatchStateContainer.js.map +1 -1
- package/lib/module/manager/dispatchCodes/EventCodeRepo.js +7 -7
- package/lib/module/manager/dispatchCodes/EventCodeRepo.js.map +1 -1
- package/lib/module/manager/dispatchCodes/ReasonCodeContainer.js +4 -4
- package/lib/module/manager/dispatchCodes/ReasonCodeContainer.js.map +1 -1
- package/lib/module/manager/dispatchCodes/ReasonCodeRepo.js +13 -8
- package/lib/module/manager/dispatchCodes/ReasonCodeRepo.js.map +1 -1
- package/lib/module/manager/location/LocationManager.js +0 -4
- package/lib/module/manager/location/LocationManager.js.map +1 -1
- package/lib/module/manager/sdk/DispatchSDKManager.js +7 -1
- package/lib/module/manager/sdk/DispatchSDKManager.js.map +1 -1
- package/lib/module/manager/sdk/callbacksHandler.js +0 -2
- package/lib/module/manager/sdk/callbacksHandler.js.map +1 -1
- package/lib/module/manager/syncmanager/DBConfig.js +5 -1
- package/lib/module/manager/syncmanager/DBConfig.js.map +1 -1
- package/lib/module/manager/syncmanager/database.js +117 -43
- package/lib/module/manager/syncmanager/database.js.map +1 -1
- package/lib/module/manager/syncmanager/document/DocumentManager.js +16 -20
- package/lib/module/manager/syncmanager/document/DocumentManager.js.map +1 -1
- package/lib/module/manager/syncmanager/document/DocumentSyncManager.js +85 -75
- package/lib/module/manager/syncmanager/document/DocumentSyncManager.js.map +1 -1
- package/lib/module/manager/syncmanager/events/ETEventsManager.js +20 -22
- package/lib/module/manager/syncmanager/events/ETEventsManager.js.map +1 -1
- package/lib/module/manager/syncmanager/events/EventsSyncManager.js.map +1 -1
- package/lib/module/models/execTasks/ETConfig.js +1 -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 +2 -2
- package/lib/module/native/signature/SignatureCapture.js.map +1 -1
- package/lib/module/network/client.js.map +1 -1
- package/lib/module/ui/screens/ValidateOTPScreen.js.map +1 -1
- package/lib/module/utils/Constants.js.map +1 -1
- package/lib/module/utils/Logger.js +1 -1
- package/lib/module/utils/Logger.js.map +1 -1
- package/lib/module/utils/SdkUtils.js +8 -4
- package/lib/module/utils/SdkUtils.js.map +1 -1
- package/lib/module/utils/SyncManagerUtils.js +2 -0
- package/lib/module/utils/SyncManagerUtils.js.map +1 -1
- package/lib/typescript/babel.config.d.ts +1 -0
- package/lib/typescript/jest.config.d.ts +7 -0
- package/lib/typescript/jest.setup.d.ts +1 -0
- package/lib/typescript/scripts/bootstrap.d.ts +1 -0
- package/lib/typescript/{components → src/components}/executiontasks/scan/interfaces.d.ts +15 -0
- package/lib/typescript/{components → src/components}/executiontasks/validateOTP/ValidateOTPSchema.d.ts +1 -1
- package/lib/typescript/{components → src/components}/widgets/CancelOrderDialog.d.ts +1 -1
- package/lib/typescript/{components → src/components}/widgets/SnackBarCustom.d.ts +3 -2
- package/lib/typescript/src/components/widgets/Timer.d.ts +6 -0
- package/lib/typescript/src/database/DBManager.d.ts +1 -0
- package/lib/typescript/{manager → src/manager}/dispatchCodes/EventCodeRepo.d.ts +1 -1
- package/lib/typescript/{manager → src/manager}/dispatchCodes/ReasonCodeRepo.d.ts +5 -3
- package/lib/typescript/{manager → src/manager}/syncmanager/DBConfig.d.ts +5 -1
- package/lib/typescript/src/manager/syncmanager/database.d.ts +31 -0
- package/lib/typescript/{manager → src/manager}/syncmanager/document/DocumentManager.d.ts +2 -3
- package/lib/typescript/{manager → src/manager}/syncmanager/document/DocumentSyncManager.d.ts +1 -2
- package/lib/typescript/{network → src/network}/client.d.ts +2 -2
- package/lib/typescript/{utils → src/utils}/Constants.d.ts +4 -0
- package/package.json +76 -104
- package/src/components/executiontasks/captureInput/CaptureText.tsx +6 -6
- package/src/components/executiontasks/collectPayment/components/CompletePayment.tsx +2 -3
- package/src/components/executiontasks/collectPayment/components/InitPayment.tsx +3 -7
- package/src/components/executiontasks/collectPayment/components/PaymentContactDetails.tsx +3 -4
- package/src/components/executiontasks/collectPayment/components/ProcessPayment.tsx +4 -5
- package/src/components/executiontasks/deliver/SLDeliverET.tsx +3 -4
- package/src/components/executiontasks/doodle/SignatureET.tsx +4 -4
- package/src/components/executiontasks/dropCash/SLDropCash.tsx +3 -4
- package/src/components/executiontasks/forms/FormGenerator.tsx +38 -55
- package/src/components/executiontasks/imageCapture/ImageCapture.tsx +5 -7
- package/src/components/executiontasks/payments/completePayment/CompletePaymentET.tsx +3 -4
- package/src/components/executiontasks/payments/init/InitPaymentET.tsx +3 -4
- package/src/components/executiontasks/payments/processPayment/ProcessPaymentET.tsx +3 -4
- package/src/components/executiontasks/pickup/PickupET.tsx +3 -9
- package/src/components/executiontasks/pickup/SLPickupET.tsx +3 -4
- package/src/components/executiontasks/scan/ScanET.tsx +3 -4
- package/src/components/executiontasks/scan/interfaces.ts +16 -0
- package/src/components/executiontasks/scan/sub_components/CScanner.tsx +7 -6
- package/src/components/executiontasks/scan/sub_components/DropDownUtils.ts +2 -2
- package/src/components/executiontasks/scan/sub_components/ERDropDown.tsx +0 -1
- package/src/components/executiontasks/scan/utils.ts +13 -13
- package/src/components/executiontasks/validateOTP/ValidateOTPET.tsx +5 -0
- package/src/components/executiontasks/validateOTP/ValidateOTPSchema.ts +1 -1
- package/src/components/executiontasks/validateOTP/components/ContactListView.tsx +3 -11
- package/src/components/executiontasks/validateOTP/components/OTPView.tsx +3 -4
- package/src/components/executiontasks/verifyOtp/VerifyOtpET.tsx +8 -16
- package/src/components/widgets/CancelOrderDialog.tsx +2 -2
- package/src/components/widgets/SnackBarCustom.tsx +2 -4
- package/src/components/widgets/Timer.tsx +0 -1
- package/src/database/DBManager.ts +118 -0
- package/src/database/dbUpdate.json +6 -0
- package/src/manager/dispatch/DispatchStateContainer.tsx +5 -25
- package/src/manager/dispatchCodes/EventCodeRepo.ts +8 -12
- package/src/manager/dispatchCodes/ReasonCodeContainer.ts +5 -5
- package/src/manager/dispatchCodes/ReasonCodeRepo.ts +17 -15
- package/src/manager/location/LocationManager.ts +1 -8
- package/src/manager/sdk/DispatchSDKManager.ts +12 -4
- package/src/manager/sdk/callbacksHandler.ts +3 -8
- package/src/manager/syncmanager/DBConfig.ts +6 -1
- package/src/manager/syncmanager/database.ts +130 -71
- package/src/manager/syncmanager/document/DocumentManager.ts +19 -24
- package/src/manager/syncmanager/document/DocumentSyncManager.ts +95 -82
- package/src/manager/syncmanager/events/ETEventsManager.ts +30 -35
- package/src/manager/syncmanager/events/EventsSyncManager.ts +1 -1
- package/src/models/sdk.ts +2 -6
- package/src/native/signature/SignatureCapture.tsx +4 -3
- package/src/network/client.ts +2 -2
- package/src/ui/screens/ValidateOTPScreen.tsx +2 -4
- package/src/utils/Constants.ts +6 -1
- package/src/utils/Logger.ts +2 -1
- package/src/utils/SdkUtils.ts +8 -7
- package/src/utils/SyncManagerUtils.ts +1 -0
- package/tsconfig.build.json +1 -1
- package/tsconfig.json +2 -3
- package/android/.gradle/7.5/checksums/checksums.lock +0 -0
- package/android/.gradle/7.5/checksums/sha1-checksums.bin +0 -0
- package/android/.gradle/7.5/dependencies-accessors/dependencies-accessors.lock +0 -0
- package/android/.gradle/7.5/executionHistory/executionHistory.lock +0 -0
- package/android/.gradle/7.5/fileHashes/fileHashes.lock +0 -0
- package/android/.gradle/8.0.1/checksums/checksums.lock +0 -0
- package/android/.gradle/8.0.1/dependencies-accessors/dependencies-accessors.lock +0 -0
- package/android/.gradle/8.0.1/dependencies-accessors/gc.properties +0 -0
- package/android/.gradle/8.0.1/executionHistory/executionHistory.lock +0 -0
- package/android/.gradle/8.0.1/fileChanges/last-build.bin +0 -0
- package/android/.gradle/8.0.1/fileHashes/fileHashes.lock +0 -0
- package/android/.gradle/8.0.1/gc.properties +0 -0
- package/android/.gradle/8.3/checksums/checksums.lock +0 -0
- package/android/.gradle/8.3/dependencies-accessors/dependencies-accessors.lock +0 -0
- package/android/.gradle/8.3/dependencies-accessors/gc.properties +0 -0
- package/android/.gradle/8.3/executionHistory/executionHistory.lock +0 -0
- package/android/.gradle/8.3/fileChanges/last-build.bin +0 -0
- package/android/.gradle/8.3/fileHashes/fileHashes.lock +0 -0
- package/android/.gradle/8.3/gc.properties +0 -0
- package/lib/typescript/components/widgets/Timer.d.ts +0 -7
- package/lib/typescript/manager/syncmanager/database.d.ts +0 -7
- /package/android/.gradle/{7.5 → 8.10.2}/dependencies-accessors/gc.properties +0 -0
- /package/android/.gradle/{7.5 → 8.10.2}/fileChanges/last-build.bin +0 -0
- /package/android/.gradle/{7.5 → 8.10.2}/gc.properties +0 -0
- /package/lib/typescript/{analytics → src/analytics}/firebase/FirebaseLogging.d.ts +0 -0
- /package/lib/typescript/{analytics → src/analytics}/sentry/SentryAnalyticsSingleton.d.ts +0 -0
- /package/lib/typescript/{analytics → src/analytics}/sentry/SentryAnalyticsUtils.d.ts +0 -0
- /package/lib/typescript/{analytics → src/analytics}/sentry/SentryModels.d.ts +0 -0
- /package/lib/typescript/{analytics → src/analytics}/sentry/SentrySdkConstants.d.ts +0 -0
- /package/lib/typescript/{components → src/components}/dispatch/DispatchExecNavigator.d.ts +0 -0
- /package/lib/typescript/{components → src/components}/executiontasks/CompletedWFSchema.d.ts +0 -0
- /package/lib/typescript/{components → src/components}/executiontasks/ExecutionTasksIndex.d.ts +0 -0
- /package/lib/typescript/{components → src/components}/executiontasks/cancellation/CancelET.d.ts +0 -0
- /package/lib/typescript/{components → src/components}/executiontasks/cancellation/CancellationSchema.d.ts +0 -0
- /package/lib/typescript/{components → src/components}/executiontasks/captureInput/CaptureInputSchema.d.ts +0 -0
- /package/lib/typescript/{components → src/components}/executiontasks/captureInput/CaptureText.d.ts +0 -0
- /package/lib/typescript/{components → src/components}/executiontasks/captureInput/utils.d.ts +0 -0
- /package/lib/typescript/{components → src/components}/executiontasks/collectPayment/CollectPayment.d.ts +0 -0
- /package/lib/typescript/{components → src/components}/executiontasks/collectPayment/CollectPaymentSchema.d.ts +0 -0
- /package/lib/typescript/{components → src/components}/executiontasks/collectPayment/PaymentStyles.d.ts +0 -0
- /package/lib/typescript/{components → src/components}/executiontasks/collectPayment/PaymentUtils.d.ts +0 -0
- /package/lib/typescript/{components → src/components}/executiontasks/collectPayment/components/CompletePayment.d.ts +0 -0
- /package/lib/typescript/{components → src/components}/executiontasks/collectPayment/components/CustomContactsModal.d.ts +0 -0
- /package/lib/typescript/{components → src/components}/executiontasks/collectPayment/components/InitPayment.d.ts +0 -0
- /package/lib/typescript/{components → src/components}/executiontasks/collectPayment/components/PaymentContactDetails.d.ts +0 -0
- /package/lib/typescript/{components → src/components}/executiontasks/collectPayment/components/ProcessPayment.d.ts +0 -0
- /package/lib/typescript/{components → src/components}/executiontasks/deliver/DeliverET.d.ts +0 -0
- /package/lib/typescript/{components → src/components}/executiontasks/deliver/DeliverETInput.d.ts +0 -0
- /package/lib/typescript/{components → src/components}/executiontasks/deliver/SLDeliverET.d.ts +0 -0
- /package/lib/typescript/{components → src/components}/executiontasks/display/DisplayModalET.d.ts +0 -0
- /package/lib/typescript/{components → src/components}/executiontasks/display/DisplaySchema.d.ts +0 -0
- /package/lib/typescript/{components → src/components}/executiontasks/doodle/SignatureET.d.ts +0 -0
- /package/lib/typescript/{components → src/components}/executiontasks/doodle/SignatureSchema.d.ts +0 -0
- /package/lib/typescript/{components → src/components}/executiontasks/dropCash/DropCashET.d.ts +0 -0
- /package/lib/typescript/{components → src/components}/executiontasks/dropCash/DropCashSchema.d.ts +0 -0
- /package/lib/typescript/{components → src/components}/executiontasks/dropCash/SLDropCash.d.ts +0 -0
- /package/lib/typescript/{components → src/components}/executiontasks/forms/FormGenerator.d.ts +0 -0
- /package/lib/typescript/{components → src/components}/executiontasks/forms/FormSchema.d.ts +0 -0
- /package/lib/typescript/{components → src/components}/executiontasks/forms/widgets/DateTimeWidget.d.ts +0 -0
- /package/lib/typescript/{components → src/components}/executiontasks/forms/widgets/DropdownWidget.d.ts +0 -0
- /package/lib/typescript/{components → src/components}/executiontasks/forms/widgets/QRBarcodeScannerWidget.d.ts +0 -0
- /package/lib/typescript/{components → src/components}/executiontasks/forms/widgets/TimeRangeSelector.d.ts +0 -0
- /package/lib/typescript/{components → src/components}/executiontasks/httpRequest/HttpEtUtils.d.ts +0 -0
- /package/lib/typescript/{components → src/components}/executiontasks/httpRequest/HttpRequestET.d.ts +0 -0
- /package/lib/typescript/{components → src/components}/executiontasks/httpRequest/HttpRequestETSchema.d.ts +0 -0
- /package/lib/typescript/{components → src/components}/executiontasks/imageCapture/CaptureSchema.d.ts +0 -0
- /package/lib/typescript/{components → src/components}/executiontasks/imageCapture/CaptureUtils.d.ts +0 -0
- /package/lib/typescript/{components → src/components}/executiontasks/imageCapture/ImageCapture.d.ts +0 -0
- /package/lib/typescript/{components → src/components}/executiontasks/payments/PaymentStyles.d.ts +0 -0
- /package/lib/typescript/{components → src/components}/executiontasks/payments/PaymentUtils.d.ts +0 -0
- /package/lib/typescript/{components → src/components}/executiontasks/payments/completePayment/CompletePaymentET.d.ts +0 -0
- /package/lib/typescript/{components → src/components}/executiontasks/payments/completePayment/CompletePaymentSchema.d.ts +0 -0
- /package/lib/typescript/{components → src/components}/executiontasks/payments/init/InitPaymentET.d.ts +0 -0
- /package/lib/typescript/{components → src/components}/executiontasks/payments/init/InitPaymentSchema.d.ts +0 -0
- /package/lib/typescript/{components → src/components}/executiontasks/payments/processPayment/ProcessPaymentET.d.ts +0 -0
- /package/lib/typescript/{components → src/components}/executiontasks/payments/processPayment/ProcessPaymentSchema.d.ts +0 -0
- /package/lib/typescript/{components → src/components}/executiontasks/pickup/PickpSchema.d.ts +0 -0
- /package/lib/typescript/{components → src/components}/executiontasks/pickup/PickupET.d.ts +0 -0
- /package/lib/typescript/{components → src/components}/executiontasks/pickup/SLPickupET.d.ts +0 -0
- /package/lib/typescript/{components → src/components}/executiontasks/scan/ScanET.d.ts +0 -0
- /package/lib/typescript/{components → src/components}/executiontasks/scan/ScanSchema.d.ts +0 -0
- /package/lib/typescript/{components → src/components}/executiontasks/scan/constants.d.ts +0 -0
- /package/lib/typescript/{components → src/components}/executiontasks/scan/modalConstant.d.ts +0 -0
- /package/lib/typescript/{components → src/components}/executiontasks/scan/sub_components/CScanner.d.ts +0 -0
- /package/lib/typescript/{components → src/components}/executiontasks/scan/sub_components/DropDownUtils.d.ts +0 -0
- /package/lib/typescript/{components → src/components}/executiontasks/scan/sub_components/ERDropDown.d.ts +0 -0
- /package/lib/typescript/{components → src/components}/executiontasks/scan/sub_components/SummaryPage.d.ts +0 -0
- /package/lib/typescript/{components → src/components}/executiontasks/scan/utils.d.ts +0 -0
- /package/lib/typescript/{components → src/components}/executiontasks/validateOTP/ValidateOTPET.d.ts +0 -0
- /package/lib/typescript/{components → src/components}/executiontasks/validateOTP/ValidateOtpStyles.d.ts +0 -0
- /package/lib/typescript/{components → src/components}/executiontasks/validateOTP/components/ContactListView.d.ts +0 -0
- /package/lib/typescript/{components → src/components}/executiontasks/validateOTP/components/OTPView.d.ts +0 -0
- /package/lib/typescript/{components → src/components}/executiontasks/validateOTP/components/VerificationComplete.d.ts +0 -0
- /package/lib/typescript/{components → src/components}/executiontasks/validateOTP/constants.d.ts +0 -0
- /package/lib/typescript/{components → src/components}/executiontasks/validateOTP/sub-components/ContactCard.d.ts +0 -0
- /package/lib/typescript/{components → src/components}/executiontasks/validateOTP/sub-components/OTPInput.d.ts +0 -0
- /package/lib/typescript/{components → src/components}/executiontasks/validateOTP/sub-components/ResendOTPButton.d.ts +0 -0
- /package/lib/typescript/{components → src/components}/executiontasks/validateOTP/utils.d.ts +0 -0
- /package/lib/typescript/{components → src/components}/executiontasks/verifyInput/VerifyInputSchema.d.ts +0 -0
- /package/lib/typescript/{components → src/components}/executiontasks/verifyLocation/GeofenceUtils.d.ts +0 -0
- /package/lib/typescript/{components → src/components}/executiontasks/verifyLocation/VerifyLocSchema.d.ts +0 -0
- /package/lib/typescript/{components → src/components}/executiontasks/verifyLocation/VerifyLocationET.d.ts +0 -0
- /package/lib/typescript/{components → src/components}/executiontasks/verifyOtp/VerifyOtpET.d.ts +0 -0
- /package/lib/typescript/{components → src/components}/executiontasks/verifyOtp/VerifyOtpSchema.d.ts +0 -0
- /package/lib/typescript/{components → src/components}/utils/Scale.d.ts +0 -0
- /package/lib/typescript/{components → src/components}/utils/index.d.ts +0 -0
- /package/lib/typescript/{components → src/components}/widgets/AlertDisplay.d.ts +0 -0
- /package/lib/typescript/{components → src/components}/widgets/Card.d.ts +0 -0
- /package/lib/typescript/{components → src/components}/widgets/ConfirmCancelModal.d.ts +0 -0
- /package/lib/typescript/{components → src/components}/widgets/GoBackModal.d.ts +0 -0
- /package/lib/typescript/{components → src/components}/widgets/IconButton.d.ts +0 -0
- /package/lib/typescript/{components → src/components}/widgets/ModalWidget.d.ts +0 -0
- /package/lib/typescript/{components → src/components}/widgets/ProgressDialog.d.ts +0 -0
- /package/lib/typescript/{components → src/components}/widgets/SearchBar.d.ts +0 -0
- /package/lib/typescript/{components → src/components}/widgets/SplitTextInput.d.ts +0 -0
- /package/lib/typescript/{components → src/components}/widgets/TabsComponent.d.ts +0 -0
- /package/lib/typescript/{components → src/components}/widgets/Toaster.d.ts +0 -0
- /package/lib/typescript/{config → src/config}/DispatchSDKConfig.d.ts +0 -0
- /package/lib/typescript/{constants → src/constants}/apiConstants.d.ts +0 -0
- /package/lib/typescript/{constants → src/constants}/constants.d.ts +0 -0
- /package/lib/typescript/{constants → src/constants}/statuscode.d.ts +0 -0
- /package/lib/typescript/{errors → src/errors}/BaseError.d.ts +0 -0
- /package/lib/typescript/{errors → src/errors}/ErrorCodes.d.ts +0 -0
- /package/lib/typescript/{events → src/events}/EventDispatcher.d.ts +0 -0
- /package/lib/typescript/{events → src/events}/EventListener.d.ts +0 -0
- /package/lib/typescript/{events → src/events}/constants.d.ts +0 -0
- /package/lib/typescript/{events → src/events}/index.d.ts +0 -0
- /package/lib/typescript/{events → src/events}/interface.d.ts +0 -0
- /package/lib/typescript/{icons → src/icons}/CircleMark.d.ts +0 -0
- /package/lib/typescript/{icons → src/icons}/FailedIcon.d.ts +0 -0
- /package/lib/typescript/{icons → src/icons}/FailureCloseIcon.d.ts +0 -0
- /package/lib/typescript/{icons → src/icons}/ScanIcon.d.ts +0 -0
- /package/lib/typescript/{icons → src/icons}/SuccessCompleteIcon.d.ts +0 -0
- /package/lib/typescript/{icons → src/icons}/file.d.ts +0 -0
- /package/lib/typescript/{icons → src/icons}/index.d.ts +0 -0
- /package/lib/typescript/{icons → src/icons}/interface.d.ts +0 -0
- /package/lib/typescript/{index.d.ts → src/index.d.ts} +0 -0
- /package/lib/typescript/{locale → src/locale}/Str.d.ts +0 -0
- /package/lib/typescript/{locale → src/locale}/i18n.d.ts +0 -0
- /package/lib/typescript/{locale → src/locale}/util.d.ts +0 -0
- /package/lib/typescript/{manager → src/manager}/dispatch/DispatchStateContainer.d.ts +0 -0
- /package/lib/typescript/{manager → src/manager}/dispatchCodes/EventCodeContainer.d.ts +0 -0
- /package/lib/typescript/{manager → src/manager}/dispatchCodes/ReasonCodeContainer.d.ts +0 -0
- /package/lib/typescript/{manager → src/manager}/jobRemoval/JobRemovalManager.d.ts +0 -0
- /package/lib/typescript/{manager → src/manager}/location/LocationManager.d.ts +0 -0
- /package/lib/typescript/{manager → src/manager}/sdk/DispatchSDKManager.d.ts +0 -0
- /package/lib/typescript/{manager → src/manager}/sdk/DispatchSdkCache.d.ts +0 -0
- /package/lib/typescript/{manager → src/manager}/sdk/callbacksHandler.d.ts +0 -0
- /package/lib/typescript/{manager → src/manager}/syncmanager/AppSyncManager.d.ts +0 -0
- /package/lib/typescript/{manager → src/manager}/syncmanager/NativeSyncManager.d.ts +0 -0
- /package/lib/typescript/{manager → src/manager}/syncmanager/constants.d.ts +0 -0
- /package/lib/typescript/{manager → src/manager}/syncmanager/document/DocumentHttpClient.d.ts +0 -0
- /package/lib/typescript/{manager → src/manager}/syncmanager/document/models.d.ts +0 -0
- /package/lib/typescript/{manager → src/manager}/syncmanager/events/ETEventsManager.d.ts +0 -0
- /package/lib/typescript/{manager → src/manager}/syncmanager/events/EventsGraphQLClient.d.ts +0 -0
- /package/lib/typescript/{manager → src/manager}/syncmanager/events/EventsSyncManager.d.ts +0 -0
- /package/lib/typescript/{manager → src/manager}/syncmanager/events/SyncHttpClient.d.ts +0 -0
- /package/lib/typescript/{models → src/models}/DispatchModels.d.ts +0 -0
- /package/lib/typescript/{models → src/models}/ReasonCodes.d.ts +0 -0
- /package/lib/typescript/{models → src/models}/auth.d.ts +0 -0
- /package/lib/typescript/{models → src/models}/execTasks/ETBaseModels.d.ts +0 -0
- /package/lib/typescript/{models → src/models}/execTasks/ETConfig.d.ts +0 -0
- /package/lib/typescript/{models → src/models}/execution.d.ts +0 -0
- /package/lib/typescript/{models → src/models}/fcm.d.ts +0 -0
- /package/lib/typescript/{models → src/models}/sdk.d.ts +0 -0
- /package/lib/typescript/{native → src/native}/LocationModule.d.ts +0 -0
- /package/lib/typescript/{native → src/native}/PermissionModule.d.ts +0 -0
- /package/lib/typescript/{native → src/native}/signature/SignatureCapture.d.ts +0 -0
- /package/lib/typescript/{network → src/network}/GraphQLClient.d.ts +0 -0
- /package/lib/typescript/{network → src/network}/NetworkClient.d.ts +0 -0
- /package/lib/typescript/{network → src/network}/NetworkUtils.d.ts +0 -0
- /package/lib/typescript/{network → src/network}/Queries.d.ts +0 -0
- /package/lib/typescript/{res → src/res}/strings.d.ts +0 -0
- /package/lib/typescript/{resources → src/resources}/Login.d.ts +0 -0
- /package/lib/typescript/{resources → src/resources}/network.d.ts +0 -0
- /package/lib/typescript/{styles → src/styles}/SdkColors.d.ts +0 -0
- /package/lib/typescript/{styles → src/styles}/executionTasks/CommonStyles.d.ts +0 -0
- /package/lib/typescript/{ui → src/ui}/screens/CancellationScreen.d.ts +0 -0
- /package/lib/typescript/{ui → src/ui}/screens/CaptureInputScreen.d.ts +0 -0
- /package/lib/typescript/{ui → src/ui}/screens/CollectPaymentScreen.d.ts +0 -0
- /package/lib/typescript/{ui → src/ui}/screens/CompleteObjectiveScreen.d.ts +0 -0
- /package/lib/typescript/{ui → src/ui}/screens/DeliverScreen.d.ts +0 -0
- /package/lib/typescript/{ui → src/ui}/screens/DisplayScreen.d.ts +0 -0
- /package/lib/typescript/{ui → src/ui}/screens/DoodleScreen.d.ts +0 -0
- /package/lib/typescript/{ui → src/ui}/screens/DropCashScreen.d.ts +0 -0
- /package/lib/typescript/{ui → src/ui}/screens/ETScreensIndex.d.ts +0 -0
- /package/lib/typescript/{ui → src/ui}/screens/FormsScreen.d.ts +0 -0
- /package/lib/typescript/{ui → src/ui}/screens/GeofenceScreen.d.ts +0 -0
- /package/lib/typescript/{ui → src/ui}/screens/HttpRequestScreen.d.ts +0 -0
- /package/lib/typescript/{ui → src/ui}/screens/ImageCaptureScreen.d.ts +0 -0
- /package/lib/typescript/{ui → src/ui}/screens/PaymentScreen.d.ts +0 -0
- /package/lib/typescript/{ui → src/ui}/screens/PickupScreen.d.ts +0 -0
- /package/lib/typescript/{ui → src/ui}/screens/ScanScreen.d.ts +0 -0
- /package/lib/typescript/{ui → src/ui}/screens/StartWorkFlowScreen.d.ts +0 -0
- /package/lib/typescript/{ui → src/ui}/screens/ValidateOTPScreen.d.ts +0 -0
- /package/lib/typescript/{ui → src/ui}/screens/WithBaseDispatchScreen.d.ts +0 -0
- /package/lib/typescript/{ui → src/ui}/uiConfig/RouteParams.d.ts +0 -0
- /package/lib/typescript/{utils → src/utils}/ApiUtils.d.ts +0 -0
- /package/lib/typescript/{utils → src/utils}/Enums.d.ts +0 -0
- /package/lib/typescript/{utils → src/utils}/ExecTaskUtils.d.ts +0 -0
- /package/lib/typescript/{utils → src/utils}/Logger.d.ts +0 -0
- /package/lib/typescript/{utils → src/utils}/NetworkUtil.d.ts +0 -0
- /package/lib/typescript/{utils → src/utils}/SdkUtils.d.ts +0 -0
- /package/lib/typescript/{utils → src/utils}/SyncManagerUtils.d.ts +0 -0
- /package/lib/typescript/{utils → src/utils}/context/paymentContext.d.ts +0 -0
- /package/lib/typescript/{utils → src/utils}/context/valdiateOTPContext.d.ts +0 -0
- /package/lib/typescript/{utils → src/utils}/fcm/FCM.d.ts +0 -0
- /package/lib/typescript/{utils → src/utils}/fcm/FcmUtils.d.ts +0 -0
- /package/lib/typescript/{utils → src/utils}/helper.d.ts +0 -0
- /package/lib/typescript/{utils → src/utils}/hooks/useModal.d.ts +0 -0
- /package/lib/typescript/{utils → src/utils}/hooks/useTimer.d.ts +0 -0
- /package/lib/typescript/{utils → src/utils}/loginHelper.d.ts +0 -0
- /package/lib/typescript/{utils → src/utils}/storage.d.ts +0 -0
- /package/lib/typescript/{utils → src/utils}/utils.d.ts +0 -0
|
@@ -6,10 +6,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
var _DBConfig = require("../DBConfig");
|
|
8
8
|
var _constants = require("../constants");
|
|
9
|
-
var
|
|
9
|
+
var _database = _interopRequireDefault(require("../database"));
|
|
10
10
|
var _DocumentManager;
|
|
11
|
-
function
|
|
12
|
-
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
11
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
13
12
|
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; }
|
|
14
13
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
15
14
|
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); }
|
|
@@ -24,7 +23,7 @@ class DocumentManager {
|
|
|
24
23
|
return DocumentManager.instance;
|
|
25
24
|
}
|
|
26
25
|
async init() {
|
|
27
|
-
await
|
|
26
|
+
await _database.default.executeSetDataQuery(`CREATE TABLE IF NOT EXISTS ${_DBConfig.DOCUMENT_TABLE} (\
|
|
28
27
|
${_DBConfig.DOCUMENT_COLUMNS.ID} INTEGER PRIMARY KEY AUTOINCREMENT,\
|
|
29
28
|
${_DBConfig.DOCUMENT_COLUMNS.DATA} TEXT,\
|
|
30
29
|
${_DBConfig.DOCUMENT_COLUMNS.BASE64} INTEGER NOT NULL DEFAULT 0,\
|
|
@@ -43,10 +42,10 @@ class DocumentManager {
|
|
|
43
42
|
${_DBConfig.DOCUMENT_COLUMNS.DESCRIPTION} TEXT);`, []);
|
|
44
43
|
}
|
|
45
44
|
async truncateDocumentTable() {
|
|
46
|
-
await
|
|
45
|
+
await _database.default.executeSetDataQuery(`DELETE FROM ${_DBConfig.DOCUMENT_TABLE};`, []);
|
|
47
46
|
}
|
|
48
47
|
async insertDocument(fmsFolderID, desc, dspID, base64, fileName, fileType, data, filePath, geoTimeStamp, processedFilePath, priority) {
|
|
49
|
-
return await
|
|
48
|
+
return await _database.default.executeSetDataQuery(`INSERT INTO ${_DBConfig.DOCUMENT_TABLE}(\
|
|
50
49
|
${_DBConfig.DOCUMENT_COLUMNS.DATA},\
|
|
51
50
|
${_DBConfig.DOCUMENT_COLUMNS.DISPATCH_ID},\
|
|
52
51
|
${_DBConfig.DOCUMENT_COLUMNS.FMS_FOLDER_ID},\
|
|
@@ -62,54 +61,50 @@ class DocumentManager {
|
|
|
62
61
|
}
|
|
63
62
|
async getAllDocuments(dispatchID) {
|
|
64
63
|
if (!dispatchID) {
|
|
65
|
-
const resultSet = await
|
|
64
|
+
const resultSet = await _database.default.executeGetDataQuery(`SELECT * FROM ${_DBConfig.DOCUMENT_TABLE};`, []);
|
|
66
65
|
return resultSet.rows._array;
|
|
67
66
|
} else {
|
|
68
|
-
const resultSet = await
|
|
67
|
+
const resultSet = await _database.default.executeGetDataQuery(`SELECT * FROM ${_DBConfig.DOCUMENT_TABLE}\
|
|
69
68
|
WHERE ${_DBConfig.DOCUMENT_COLUMNS.DISPATCH_ID} =?;`, [dispatchID]);
|
|
70
69
|
return resultSet.rows._array;
|
|
71
70
|
}
|
|
72
71
|
}
|
|
73
72
|
async getAllUnsyncedDocs() {
|
|
74
73
|
if (_constants.PROCESS_MAX_RETRIED_ROWS) {
|
|
75
|
-
let resultSet = await
|
|
76
|
-
WHERE ${_DBConfig.DOCUMENT_COLUMNS.SYNCED} = 0;`, []);
|
|
74
|
+
let resultSet = await _database.default.executeGetDataQuery(`SELECT * from ${_DBConfig.DOCUMENT_TABLE} WHERE ${_DBConfig.DOCUMENT_COLUMNS.SYNCED} = 0;`, []);
|
|
77
75
|
return resultSet.rows._array;
|
|
78
76
|
} else {
|
|
79
|
-
let resultSet = await
|
|
77
|
+
let resultSet = await _database.default.executeGetDataQuery(`SELECT * from ${_DBConfig.DOCUMENT_TABLE}\
|
|
80
78
|
WHERE ${_DBConfig.DOCUMENT_COLUMNS.SYNCED} = 0 AND ${_DBConfig.DOCUMENT_COLUMNS.ATTEMPT_COUNT} < ${_constants.MAX_RETRY_COUNT};`, []);
|
|
81
79
|
return resultSet.rows._array;
|
|
82
80
|
}
|
|
83
81
|
}
|
|
84
82
|
deleteAllSyncedDocuments(dispatchID) {
|
|
85
|
-
return
|
|
83
|
+
return _database.default.executeSetDataQuery(`DELETE FROM ${_DBConfig.DOCUMENT_TABLE}\
|
|
86
84
|
WHERE ${_DBConfig.DOCUMENT_COLUMNS.SYNCED} = 1 and ${_DBConfig.DOCUMENT_COLUMNS.DISPATCH_ID} = ?;`, [dispatchID]);
|
|
87
85
|
}
|
|
88
86
|
async markDocumentSynced(id, fmsID) {
|
|
89
87
|
if (!id || !fmsID) return;
|
|
90
|
-
await
|
|
88
|
+
await _database.default.executeSetDataQuery(`UPDATE ${_DBConfig.DOCUMENT_TABLE} SET ${_DBConfig.DOCUMENT_COLUMNS.SYNCED} = 1,${_DBConfig.DOCUMENT_COLUMNS.FMS_ID} = ? WHERE ${_DBConfig.DOCUMENT_COLUMNS.ID} = ?;`, [fmsID, id]);
|
|
91
89
|
}
|
|
92
90
|
|
|
93
91
|
// This function will actualy update the document row with sync and attempt count.
|
|
94
92
|
async markDocumentSyncedWithAttempt(id, fmsID, attempt, sync) {
|
|
95
93
|
if (!id) return;
|
|
96
|
-
await
|
|
94
|
+
await _database.default.executeSetDataQuery(`UPDATE ${_DBConfig.DOCUMENT_TABLE} SET ${_DBConfig.DOCUMENT_COLUMNS.SYNCED} = ?,${_DBConfig.DOCUMENT_COLUMNS.FMS_ID} = ?,${_DBConfig.DOCUMENT_COLUMNS.ATTEMPT_COUNT} = ? WHERE ${_DBConfig.DOCUMENT_COLUMNS.ID} = ?;`, [sync, fmsID, attempt, id]);
|
|
97
95
|
}
|
|
98
96
|
// This function is updating processed_file_path column for the base64 overlayed data and overlayed image file for POD. Also if it is base 64 then it is also storing temprary file path in file_path as original bae64 image.
|
|
99
97
|
async updateProcesedFilePath(id, origialFilePath, processedFilePath) {
|
|
100
98
|
if (!id || !processedFilePath) return;
|
|
101
|
-
await
|
|
99
|
+
await _database.default.executeSetDataQuery(`UPDATE ${_DBConfig.DOCUMENT_TABLE} SET ${_DBConfig.DOCUMENT_COLUMNS.FILE_PATH} = ?, ${_DBConfig.DOCUMENT_COLUMNS.PROCESSED_FILE_PATH} = ? WHERE ${_DBConfig.DOCUMENT_COLUMNS.ID} = ?;`, [origialFilePath, processedFilePath, id]);
|
|
102
100
|
}
|
|
103
101
|
async updateDocSyncError(id, uploadError) {
|
|
104
102
|
if (!id) throw new TypeError('Document ID cannot be null');
|
|
105
|
-
await
|
|
106
|
-
SET \
|
|
107
|
-
${_DBConfig.DOCUMENT_COLUMNS.SYNC_ERROR} = ?\
|
|
108
|
-
WHERE ${_DBConfig.DOCUMENT_COLUMNS.ID} = ?;`, [uploadError, id]);
|
|
103
|
+
await _database.default.executeSetDataQuery(`UPDATE ${_DBConfig.DOCUMENT_TABLE} SET ${_DBConfig.DOCUMENT_COLUMNS.SYNC_ERROR} = ? WHERE ${_DBConfig.DOCUMENT_COLUMNS.ID} = ?;`, [uploadError, id]);
|
|
109
104
|
}
|
|
110
105
|
async updateDocPriority(id, priority) {
|
|
111
106
|
if (!id) throw new TypeError('Document ID cannot be null');
|
|
112
|
-
await
|
|
107
|
+
await _database.default.executeSetDataQuery(`UPDATE ${_DBConfig.DOCUMENT_TABLE}\
|
|
113
108
|
SET \
|
|
114
109
|
${_DBConfig.DOCUMENT_COLUMNS.PRIORITY} = ?\
|
|
115
110
|
WHERE ${_DBConfig.DOCUMENT_COLUMNS.ID} = ?;`, [priority, id]);
|
|
@@ -117,12 +112,12 @@ class DocumentManager {
|
|
|
117
112
|
async getUnsyncedDocument() {
|
|
118
113
|
// If it is allowed max_retried_rows are allowed to process then it will refetch those data which are even have tried max attempt otherwise it will skip those events.
|
|
119
114
|
if (_constants.PROCESS_MAX_RETRIED_ROWS) {
|
|
120
|
-
let rs = await
|
|
115
|
+
let rs = await _database.default.executeGetDataQuery(`SELECT * from ${_DBConfig.DOCUMENT_TABLE}\
|
|
121
116
|
WHERE ${_DBConfig.DOCUMENT_COLUMNS.SYNCED} = 0 \
|
|
122
117
|
ORDER BY ${_DBConfig.DOCUMENT_COLUMNS.PRIORITY} ASC LIMIT 1;`, []);
|
|
123
118
|
return rs.rows._array;
|
|
124
119
|
} else {
|
|
125
|
-
let rs = await
|
|
120
|
+
let rs = await _database.default.executeGetDataQuery(`SELECT * from ${_DBConfig.DOCUMENT_TABLE}\
|
|
126
121
|
WHERE ${_DBConfig.DOCUMENT_COLUMNS.SYNCED} = 0 AND ${_DBConfig.DOCUMENT_COLUMNS.ATTEMPT_COUNT} < ${_constants.MAX_RETRY_COUNT} \
|
|
127
122
|
ORDER BY ${_DBConfig.DOCUMENT_COLUMNS.PRIORITY} ASC LIMIT 1;`, []);
|
|
128
123
|
return rs.rows._array;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_DBConfig","require","_constants","Database","_interopRequireWildcard","_DocumentManager","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","_defineProperty","_toPropertyKey","value","enumerable","configurable","writable","_toPrimitive","Symbol","toPrimitive","TypeError","String","Number","DocumentManager","constructor","getInstance","instance","managerInstance","init","executeQuery","DOCUMENT_TABLE","DOCUMENT_COLUMNS","ID","DATA","BASE64","FILE_PATH","DISPATCH_ID","FILE_NAME","FILE_TYPE","SYNCED","FMS_ID","FMS_FOLDER_ID","PRIORITY","SYNC_ERROR","ATTEMPT_COUNT","GEO_TIMESTAMP","PROCESSED_FILE_PATH","DESCRIPTION","truncateDocumentTable","insertDocument","fmsFolderID","desc","dspID","base64","fileName","fileType","data","filePath","geoTimeStamp","processedFilePath","priority","getAllDocuments","dispatchID","resultSet","rows","_array","getAllUnsyncedDocs","PROCESS_MAX_RETRIED_ROWS","MAX_RETRY_COUNT","deleteAllSyncedDocuments","markDocumentSynced","id","fmsID","markDocumentSyncedWithAttempt","attempt","sync","updateProcesedFilePath","origialFilePath","updateDocSyncError","uploadError","updateDocPriority","getUnsyncedDocument","rs","exports"],"sources":["DocumentManager.ts"],"sourcesContent":["import { DOCUMENT_COLUMNS, DOCUMENT_TABLE, DocumentRow } from '../DBConfig';\nimport { MAX_RETRY_COUNT, PROCESS_MAX_RETRIED_ROWS } from '../constants';\nimport * as Database from '../database';\nimport type { SQLResultSet } from 'expo-sqlite';\n\nexport default class DocumentManager {\n private static instance: DocumentManager;\n\n private constructor() { }\n\n public static async getInstance(): Promise<DocumentManager> {\n if (!DocumentManager.instance) {\n let managerInstance = new DocumentManager();\n await managerInstance.init();\n DocumentManager.instance = managerInstance;\n }\n return DocumentManager.instance;\n }\n\n public async init(): Promise<void> {\n await Database.executeQuery(\n `CREATE TABLE IF NOT EXISTS ${DOCUMENT_TABLE} (\\\n ${DOCUMENT_COLUMNS.ID} INTEGER PRIMARY KEY AUTOINCREMENT,\\\n ${DOCUMENT_COLUMNS.DATA} TEXT,\\\n ${DOCUMENT_COLUMNS.BASE64} INTEGER NOT NULL DEFAULT 0,\\\n ${DOCUMENT_COLUMNS.FILE_PATH} TEXT,\\\n ${DOCUMENT_COLUMNS.DISPATCH_ID} TEXT NOT NULL,\\\n ${DOCUMENT_COLUMNS.FILE_NAME} TEXT,\\\n ${DOCUMENT_COLUMNS.FILE_TYPE} TEXT,\\\n ${DOCUMENT_COLUMNS.SYNCED} INTEGER DEFAULT 0 NOT NULL,\\\n ${DOCUMENT_COLUMNS.FMS_ID} TEXT,\\\n ${DOCUMENT_COLUMNS.FMS_FOLDER_ID} TEXT,\\\n ${DOCUMENT_COLUMNS.PRIORITY} INTEGER NOT NULL DEFAULT 1,\\\n ${DOCUMENT_COLUMNS.SYNC_ERROR} TEXT,\\\n ${DOCUMENT_COLUMNS.ATTEMPT_COUNT} INTEGER DEFAULT 0 NOT NULL,\\\n ${DOCUMENT_COLUMNS.GEO_TIMESTAMP} TEXT,\\\n ${DOCUMENT_COLUMNS.PROCESSED_FILE_PATH} TEXT,\\\n ${DOCUMENT_COLUMNS.DESCRIPTION} TEXT);`,\n []\n );\n }\n\n public async truncateDocumentTable(): Promise<void> {\n await Database.executeQuery(`DELETE FROM ${DOCUMENT_TABLE};`, []);\n }\n\n public async insertDocument(\n fmsFolderID: string | null,\n desc: string,\n dspID: string,\n base64: boolean,\n fileName: string,\n fileType: string,\n data?: string | null,\n filePath?: string | null,\n geoTimeStamp?: string | null,\n processedFilePath?: string | null,\n priority?: number\n ): Promise<SQLResultSet> {\n return await Database.executeQuery(\n `INSERT INTO ${DOCUMENT_TABLE}(\\\n ${DOCUMENT_COLUMNS.DATA},\\\n ${DOCUMENT_COLUMNS.DISPATCH_ID},\\\n ${DOCUMENT_COLUMNS.FMS_FOLDER_ID},\\\n ${DOCUMENT_COLUMNS.BASE64},\\\n ${DOCUMENT_COLUMNS.FILE_PATH},\\\n ${DOCUMENT_COLUMNS.FILE_NAME},\\\n ${DOCUMENT_COLUMNS.FILE_TYPE},\\\n ${DOCUMENT_COLUMNS.DESCRIPTION},\\\n ${DOCUMENT_COLUMNS.PRIORITY},\\\n ${DOCUMENT_COLUMNS.GEO_TIMESTAMP},\\\n ${DOCUMENT_COLUMNS.PROCESSED_FILE_PATH}) \\\n values (?,?,?,?,?,?,?,?,?,?,?)`,\n [\n data,\n dspID,\n fmsFolderID,\n base64,\n filePath,\n fileName,\n fileType,\n desc,\n priority ? priority : 1,\n geoTimeStamp,\n processedFilePath,\n ]\n );\n }\n\n public async getAllDocuments(dispatchID?: string): Promise<DocumentRow[]> {\n if (!dispatchID) {\n const resultSet = await Database.executeQuery(\n `SELECT * FROM ${DOCUMENT_TABLE};`,\n []\n );\n return resultSet.rows._array;\n } else {\n const resultSet = await Database.executeQuery(\n `SELECT * FROM ${DOCUMENT_TABLE}\\\n WHERE ${DOCUMENT_COLUMNS.DISPATCH_ID} =?;`,\n [dispatchID]\n );\n return resultSet.rows._array;\n }\n }\n\n public async getAllUnsyncedDocs(): Promise<DocumentRow[]> {\n if (PROCESS_MAX_RETRIED_ROWS) {\n let resultSet = await Database.executeQuery(\n `SELECT * from ${DOCUMENT_TABLE}\\\n WHERE ${DOCUMENT_COLUMNS.SYNCED} = 0;`,\n []\n );\n return resultSet.rows._array;\n } else {\n let resultSet = await Database.executeQuery(\n `SELECT * from ${DOCUMENT_TABLE}\\\n WHERE ${DOCUMENT_COLUMNS.SYNCED} = 0 AND ${DOCUMENT_COLUMNS.ATTEMPT_COUNT} < ${MAX_RETRY_COUNT};`,\n []\n );\n return resultSet.rows._array;\n }\n }\n\n public deleteAllSyncedDocuments(dispatchID: string) {\n return Database.executeQuery(\n `DELETE FROM ${DOCUMENT_TABLE}\\\n WHERE ${DOCUMENT_COLUMNS.SYNCED} = 1 and ${DOCUMENT_COLUMNS.DISPATCH_ID} = ?;`,\n [dispatchID]\n );\n }\n\n public async markDocumentSynced(id: number, fmsID: string): Promise<void> {\n if (!id || !fmsID) return;\n await Database.executeQuery(\n `UPDATE ${DOCUMENT_TABLE} SET ${DOCUMENT_COLUMNS.SYNCED} = 1,${DOCUMENT_COLUMNS.FMS_ID} = ? WHERE ${DOCUMENT_COLUMNS.ID} = ?;`,\n [fmsID, id]\n );\n }\n\n // This function will actualy update the document row with sync and attempt count.\n public async markDocumentSyncedWithAttempt(\n id: number,\n fmsID: string,\n attempt: number,\n sync: number\n ): Promise<void> {\n if (!id) return;\n await Database.executeQuery(\n `UPDATE ${DOCUMENT_TABLE} SET ${DOCUMENT_COLUMNS.SYNCED} = ?,${DOCUMENT_COLUMNS.FMS_ID} = ?,${DOCUMENT_COLUMNS.ATTEMPT_COUNT} = ? WHERE ${DOCUMENT_COLUMNS.ID} = ?;`,\n [sync, fmsID, attempt, id]\n );\n }\n // This function is updating processed_file_path column for the base64 overlayed data and overlayed image file for POD. Also if it is base 64 then it is also storing temprary file path in file_path as original bae64 image.\n public async updateProcesedFilePath(\n id: number,\n origialFilePath: String,\n processedFilePath: String\n ): Promise<void> {\n if (!id || !processedFilePath) return;\n await Database.executeQuery(\n `UPDATE ${DOCUMENT_TABLE} SET ${DOCUMENT_COLUMNS.FILE_PATH} = ?, ${DOCUMENT_COLUMNS.PROCESSED_FILE_PATH} = ? WHERE ${DOCUMENT_COLUMNS.ID} = ?;`,\n [origialFilePath, processedFilePath, id]\n );\n }\n\n public async updateDocSyncError(\n id: number,\n uploadError: string\n ): Promise<void> {\n if (!id) throw new TypeError('Document ID cannot be null');\n await Database.executeQuery(\n `UPDATE ${DOCUMENT_TABLE}\\\n SET \\\n ${DOCUMENT_COLUMNS.SYNC_ERROR} = ?\\\n WHERE ${DOCUMENT_COLUMNS.ID} = ?;`,\n [uploadError, id]\n );\n }\n\n public async updateDocPriority(\n id: number,\n priority: number\n ): Promise<void> {\n if (!id) throw new TypeError('Document ID cannot be null');\n await Database.executeQuery(\n `UPDATE ${DOCUMENT_TABLE}\\\n SET \\\n ${DOCUMENT_COLUMNS.PRIORITY} = ?\\\n WHERE ${DOCUMENT_COLUMNS.ID} = ?;`,\n [priority, id]\n );\n }\n\n\n public async getUnsyncedDocument(): Promise<DocumentRow[]> {\n // If it is allowed max_retried_rows are allowed to process then it will refetch those data which are even have tried max attempt otherwise it will skip those events.\n if (PROCESS_MAX_RETRIED_ROWS) {\n let rs = await Database.executeQuery(\n `SELECT * from ${DOCUMENT_TABLE}\\\n WHERE ${DOCUMENT_COLUMNS.SYNCED} = 0 \\\n ORDER BY ${DOCUMENT_COLUMNS.PRIORITY} ASC LIMIT 1;`,\n []\n );\n return rs.rows._array;\n } else {\n let rs = await Database.executeQuery(\n `SELECT * from ${DOCUMENT_TABLE}\\\n WHERE ${DOCUMENT_COLUMNS.SYNCED} = 0 AND ${DOCUMENT_COLUMNS.ATTEMPT_COUNT} < ${MAX_RETRY_COUNT} \\\n ORDER BY ${DOCUMENT_COLUMNS.PRIORITY} ASC LIMIT 1;`,\n []\n );\n return rs.rows._array;\n }\n }\n}\n"],"mappings":";;;;;;AAAA,IAAAA,SAAA,GAAAC,OAAA;AACA,IAAAC,UAAA,GAAAD,OAAA;AACA,IAAAE,QAAA,GAAAC,uBAAA,CAAAH,OAAA;AAAwC,IAAAI,gBAAA;AAAA,SAAAC,yBAAAC,CAAA,6BAAAC,OAAA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,CAACC,EAAE,OAAO,EACxC,CAAC+C,WAAW,EAAER,EAAE,CAClB,CAAC;EACH;EAEA,MAAaS,iBAAiBA,CAC5BT,EAAU,EACVX,QAAgB,EACD;IACf,IAAI,CAACW,EAAE,EAAE,MAAM,IAAInD,SAAS,CAAC,4BAA4B,CAAC;IAC1D,MAAMhC,QAAQ,CAACyC,YAAY,CACzB,UAAUC,wBAAc;AAC9B;AACA,cAAcC,0BAAgB,CAACW,QAAQ;AACvC,oBAAoBX,0BAAgB,CAACC,EAAE,OAAO,EACxC,CAAC4B,QAAQ,EAAEW,EAAE,CACf,CAAC;EACH;EAGA,MAAaU,mBAAmBA,CAAA,EAA2B;IACzD;IACA,IAAId,mCAAwB,EAAE;MAC5B,IAAIe,EAAE,GAAG,MAAM9F,QAAQ,CAACyC,YAAY,CAClC,iBAAiBC,wBAAc;AACvC,sBAAsBC,0BAAgB,CAACQ,MAAM;AAC7C,yBAAyBR,0BAAgB,CAACW,QAAQ,eAAe,EACzD,EACF,CAAC;MACD,OAAOwC,EAAE,CAAClB,IAAI,CAACC,MAAM;IACvB,CAAC,MAAM;MACL,IAAIiB,EAAE,GAAG,MAAM9F,QAAQ,CAACyC,YAAY,CAClC,iBAAiBC,wBAAc;AACvC,sBAAsBC,0BAAgB,CAACQ,MAAM,YAAYR,0BAAgB,CAACa,aAAa,MAAMwB,0BAAe;AAC5G,yBAAyBrC,0BAAgB,CAACW,QAAQ,eAAe,EACzD,EACF,CAAC;MACD,OAAOwC,EAAE,CAAClB,IAAI,CAACC,MAAM;IACvB;EACF;AACF;AAACkB,OAAA,CAAAtF,OAAA,GAAA0B,eAAA;AAAAjC,gBAAA,GAlNoBiC,eAAe;AAAAZ,eAAA,CAAfY,eAAe","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["_DBConfig","require","_constants","_database","_interopRequireDefault","_DocumentManager","e","__esModule","default","_defineProperty","r","t","_toPropertyKey","Object","defineProperty","value","enumerable","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","DocumentManager","constructor","getInstance","instance","managerInstance","init","Database","executeSetDataQuery","DOCUMENT_TABLE","DOCUMENT_COLUMNS","ID","DATA","BASE64","FILE_PATH","DISPATCH_ID","FILE_NAME","FILE_TYPE","SYNCED","FMS_ID","FMS_FOLDER_ID","PRIORITY","SYNC_ERROR","ATTEMPT_COUNT","GEO_TIMESTAMP","PROCESSED_FILE_PATH","DESCRIPTION","truncateDocumentTable","insertDocument","fmsFolderID","desc","dspID","base64","fileName","fileType","data","filePath","geoTimeStamp","processedFilePath","priority","getAllDocuments","dispatchID","resultSet","executeGetDataQuery","rows","_array","getAllUnsyncedDocs","PROCESS_MAX_RETRIED_ROWS","MAX_RETRY_COUNT","deleteAllSyncedDocuments","markDocumentSynced","id","fmsID","markDocumentSyncedWithAttempt","attempt","sync","updateProcesedFilePath","origialFilePath","updateDocSyncError","uploadError","updateDocPriority","getUnsyncedDocument","rs","exports"],"sources":["DocumentManager.ts"],"sourcesContent":["import { DOCUMENT_COLUMNS, DOCUMENT_TABLE, DocumentRow } from '../DBConfig';\nimport { MAX_RETRY_COUNT, PROCESS_MAX_RETRIED_ROWS } from '../constants';\nimport Database from '../database';\n\nexport default class DocumentManager {\n private static instance: DocumentManager;\n\n private constructor() { }\n\n public static async getInstance(): Promise<DocumentManager> {\n if (!DocumentManager.instance) {\n let managerInstance = new DocumentManager();\n await managerInstance.init();\n DocumentManager.instance = managerInstance;\n }\n return DocumentManager.instance;\n }\n\n public async init(): Promise<void> {\n await Database.executeSetDataQuery(\n `CREATE TABLE IF NOT EXISTS ${DOCUMENT_TABLE} (\\\n ${DOCUMENT_COLUMNS.ID} INTEGER PRIMARY KEY AUTOINCREMENT,\\\n ${DOCUMENT_COLUMNS.DATA} TEXT,\\\n ${DOCUMENT_COLUMNS.BASE64} INTEGER NOT NULL DEFAULT 0,\\\n ${DOCUMENT_COLUMNS.FILE_PATH} TEXT,\\\n ${DOCUMENT_COLUMNS.DISPATCH_ID} TEXT NOT NULL,\\\n ${DOCUMENT_COLUMNS.FILE_NAME} TEXT,\\\n ${DOCUMENT_COLUMNS.FILE_TYPE} TEXT,\\\n ${DOCUMENT_COLUMNS.SYNCED} INTEGER DEFAULT 0 NOT NULL,\\\n ${DOCUMENT_COLUMNS.FMS_ID} TEXT,\\\n ${DOCUMENT_COLUMNS.FMS_FOLDER_ID} TEXT,\\\n ${DOCUMENT_COLUMNS.PRIORITY} INTEGER NOT NULL DEFAULT 1,\\\n ${DOCUMENT_COLUMNS.SYNC_ERROR} TEXT,\\\n ${DOCUMENT_COLUMNS.ATTEMPT_COUNT} INTEGER DEFAULT 0 NOT NULL,\\\n ${DOCUMENT_COLUMNS.GEO_TIMESTAMP} TEXT,\\\n ${DOCUMENT_COLUMNS.PROCESSED_FILE_PATH} TEXT,\\\n ${DOCUMENT_COLUMNS.DESCRIPTION} TEXT);`,\n []\n );\n }\n\n public async truncateDocumentTable(): Promise<void> {\n await Database.executeSetDataQuery(`DELETE FROM ${DOCUMENT_TABLE};`, []);\n }\n\n public async insertDocument(\n fmsFolderID: string | null,\n desc: string,\n dspID: string,\n base64: boolean,\n fileName: string,\n fileType: string,\n data?: string | null,\n filePath?: string | null,\n geoTimeStamp?: string | null,\n processedFilePath?: string | null,\n priority?: number\n ): Promise<any> {\n return await Database.executeSetDataQuery(\n `INSERT INTO ${DOCUMENT_TABLE}(\\\n ${DOCUMENT_COLUMNS.DATA},\\\n ${DOCUMENT_COLUMNS.DISPATCH_ID},\\\n ${DOCUMENT_COLUMNS.FMS_FOLDER_ID},\\\n ${DOCUMENT_COLUMNS.BASE64},\\\n ${DOCUMENT_COLUMNS.FILE_PATH},\\\n ${DOCUMENT_COLUMNS.FILE_NAME},\\\n ${DOCUMENT_COLUMNS.FILE_TYPE},\\\n ${DOCUMENT_COLUMNS.DESCRIPTION},\\\n ${DOCUMENT_COLUMNS.PRIORITY},\\\n ${DOCUMENT_COLUMNS.GEO_TIMESTAMP},\\\n ${DOCUMENT_COLUMNS.PROCESSED_FILE_PATH}) \\\n values (?,?,?,?,?,?,?,?,?,?,?)`,\n [\n data,\n dspID,\n fmsFolderID,\n base64,\n filePath,\n fileName,\n fileType,\n desc,\n priority ? priority : 1,\n geoTimeStamp,\n processedFilePath,\n ]\n );\n }\n\n public async getAllDocuments(dispatchID?: string): Promise<DocumentRow[]> {\n if (!dispatchID) {\n const resultSet = await Database.executeGetDataQuery(\n `SELECT * FROM ${DOCUMENT_TABLE};`,\n []\n );\n return resultSet.rows._array;\n } else {\n const resultSet = await Database.executeGetDataQuery(\n `SELECT * FROM ${DOCUMENT_TABLE}\\\n WHERE ${DOCUMENT_COLUMNS.DISPATCH_ID} =?;`,\n [dispatchID]\n );\n return resultSet.rows._array;\n }\n }\n\n public async getAllUnsyncedDocs(): Promise<DocumentRow[]> {\n if (PROCESS_MAX_RETRIED_ROWS) {\n let resultSet = await Database.executeGetDataQuery(\n `SELECT * from ${DOCUMENT_TABLE} WHERE ${DOCUMENT_COLUMNS.SYNCED} = 0;`,\n []\n );\n return resultSet.rows._array;\n } else {\n let resultSet = await Database.executeGetDataQuery(\n `SELECT * from ${DOCUMENT_TABLE}\\\n WHERE ${DOCUMENT_COLUMNS.SYNCED} = 0 AND ${DOCUMENT_COLUMNS.ATTEMPT_COUNT} < ${MAX_RETRY_COUNT};`,\n []\n );\n return resultSet.rows._array;\n }\n }\n\n public deleteAllSyncedDocuments(dispatchID: string) {\n return Database.executeSetDataQuery(\n `DELETE FROM ${DOCUMENT_TABLE}\\\n WHERE ${DOCUMENT_COLUMNS.SYNCED} = 1 and ${DOCUMENT_COLUMNS.DISPATCH_ID} = ?;`,\n [dispatchID]\n );\n }\n\n public async markDocumentSynced(id: number, fmsID: string): Promise<void> {\n if (!id || !fmsID) return;\n await Database.executeSetDataQuery(\n `UPDATE ${DOCUMENT_TABLE} SET ${DOCUMENT_COLUMNS.SYNCED} = 1,${DOCUMENT_COLUMNS.FMS_ID} = ? WHERE ${DOCUMENT_COLUMNS.ID} = ?;`,\n [fmsID, id]\n );\n }\n\n // This function will actualy update the document row with sync and attempt count.\n public async markDocumentSyncedWithAttempt(\n id: number,\n fmsID: string,\n attempt: number,\n sync: number\n ): Promise<void> {\n if (!id) return;\n await Database.executeSetDataQuery(\n `UPDATE ${DOCUMENT_TABLE} SET ${DOCUMENT_COLUMNS.SYNCED} = ?,${DOCUMENT_COLUMNS.FMS_ID} = ?,${DOCUMENT_COLUMNS.ATTEMPT_COUNT} = ? WHERE ${DOCUMENT_COLUMNS.ID} = ?;`,\n [sync, fmsID, attempt, id]\n );\n }\n // This function is updating processed_file_path column for the base64 overlayed data and overlayed image file for POD. Also if it is base 64 then it is also storing temprary file path in file_path as original bae64 image.\n public async updateProcesedFilePath(\n id: number,\n origialFilePath: String,\n processedFilePath: String\n ): Promise<void> {\n if (!id || !processedFilePath) return;\n await Database.executeSetDataQuery(\n `UPDATE ${DOCUMENT_TABLE} SET ${DOCUMENT_COLUMNS.FILE_PATH} = ?, ${DOCUMENT_COLUMNS.PROCESSED_FILE_PATH} = ? WHERE ${DOCUMENT_COLUMNS.ID} = ?;`,\n [origialFilePath, processedFilePath, id]\n );\n }\n\n public async updateDocSyncError(\n id: number,\n uploadError: string\n ): Promise<void> {\n if (!id) throw new TypeError('Document ID cannot be null');\n await Database.executeSetDataQuery(\n `UPDATE ${DOCUMENT_TABLE} SET ${DOCUMENT_COLUMNS.SYNC_ERROR} = ? WHERE ${DOCUMENT_COLUMNS.ID} = ?;`,\n [uploadError, id]\n );\n }\n\n public async updateDocPriority(\n id: number,\n priority: number\n ): Promise<void> {\n if (!id) throw new TypeError('Document ID cannot be null');\n await Database.executeSetDataQuery(\n `UPDATE ${DOCUMENT_TABLE}\\\n SET \\\n ${DOCUMENT_COLUMNS.PRIORITY} = ?\\\n WHERE ${DOCUMENT_COLUMNS.ID} = ?;`,\n [priority, id]\n );\n }\n\n\n public async getUnsyncedDocument(): Promise<DocumentRow[]> {\n // If it is allowed max_retried_rows are allowed to process then it will refetch those data which are even have tried max attempt otherwise it will skip those events.\n if (PROCESS_MAX_RETRIED_ROWS) {\n let rs = await Database.executeGetDataQuery(\n `SELECT * from ${DOCUMENT_TABLE}\\\n WHERE ${DOCUMENT_COLUMNS.SYNCED} = 0 \\\n ORDER BY ${DOCUMENT_COLUMNS.PRIORITY} ASC LIMIT 1;`,\n []\n );\n return rs.rows._array;\n } else {\n let rs = await Database.executeGetDataQuery(\n `SELECT * from ${DOCUMENT_TABLE}\\\n WHERE ${DOCUMENT_COLUMNS.SYNCED} = 0 AND ${DOCUMENT_COLUMNS.ATTEMPT_COUNT} < ${MAX_RETRY_COUNT} \\\n ORDER BY ${DOCUMENT_COLUMNS.PRIORITY} ASC LIMIT 1;`,\n []\n );\n return rs.rows._array;\n }\n }\n}\n"],"mappings":";;;;;;AAAA,IAAAA,SAAA,GAAAC,OAAA;AACA,IAAAC,UAAA,GAAAD,OAAA;AACA,IAAAE,SAAA,GAAAC,sBAAA,CAAAH,OAAA;AAAmC,IAAAI,gBAAA;AAAA,SAAAD,uBAAAE,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAAA,SAAAG,gBAAAH,CAAA,EAAAI,CAAA,EAAAC,CAAA,YAAAD,CAAA,GAAAE,cAAA,CAAAF,CAAA,MAAAJ,CAAA,GAAAO,MAAA,CAAAC,cAAA,CAAAR,CAAA,EAAAI,CAAA,IAAAK,KAAA,EAAAJ,CAAA,EAAAK,UAAA,MAAAC,YAAA,MAAAC,QAAA,UAAAZ,CAAA,CAAAI,CAAA,IAAAC,CAAA,EAAAL,CAAA;AAAA,SAAAM,eAAAD,CAAA,QAAAQ,CAAA,GAAAC,YAAA,CAAAT,CAAA,uCAAAQ,CAAA,GAAAA,CAAA,GAAAA,CAAA;AAAA,SAAAC,aAAAT,CAAA,EAAAD,CAAA,2BAAAC,CAAA,KAAAA,CAAA,SAAAA,CAAA,MAAAL,CAAA,GAAAK,CAAA,CAA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,EAAE,OAAO,EACxC,CAAC4B,QAAQ,EAAEY,EAAE,CACf,CAAC;EACH;EAGA,MAAaU,mBAAmBA,CAAA,EAA2B;IACzD;IACA,IAAId,mCAAwB,EAAE;MAC5B,IAAIe,EAAE,GAAG,MAAMvD,iBAAQ,CAACoC,mBAAmB,CACzC,iBAAiBlC,wBAAc;AACvC,sBAAsBC,0BAAgB,CAACQ,MAAM;AAC7C,yBAAyBR,0BAAgB,CAACW,QAAQ,eAAe,EACzD,EACF,CAAC;MACD,OAAOyC,EAAE,CAAClB,IAAI,CAACC,MAAM;IACvB,CAAC,MAAM;MACL,IAAIiB,EAAE,GAAG,MAAMvD,iBAAQ,CAACoC,mBAAmB,CACzC,iBAAiBlC,wBAAc;AACvC,sBAAsBC,0BAAgB,CAACQ,MAAM,YAAYR,0BAAgB,CAACa,aAAa,MAAMyB,0BAAe;AAC5G,yBAAyBtC,0BAAgB,CAACW,QAAQ,eAAe,EACzD,EACF,CAAC;MACD,OAAOyC,EAAE,CAAClB,IAAI,CAACC,MAAM;IACvB;EACF;AACF;AAACkB,OAAA,CAAAjF,OAAA,GAAAmB,eAAA;AAAAtB,gBAAA,GA9MoBsB,eAAe;AAAAlB,eAAA,CAAfkB,eAAe","ignoreList":[]}
|
|
@@ -310,88 +310,98 @@ class DocumentSyncManager {
|
|
|
310
310
|
|
|
311
311
|
// This function will generate overlay base64 data and update documents table for processed_file_path columns with overlayed base64 data.
|
|
312
312
|
async processBase64Data(documentRow) {
|
|
313
|
+
let cta = 'processBase64Data-started';
|
|
314
|
+
let extra = {
|
|
315
|
+
msg: 'processBase64Data-started',
|
|
316
|
+
fName: documentRow.file_name && documentRow.file_name.length != 0 ? documentRow.file_name.substring(4) : '',
|
|
317
|
+
dName: documentRow.fms_folder_id && documentRow.fms_folder_id.length != 0 ? documentRow.fms_folder_id.substring(4) : '',
|
|
318
|
+
dispId: documentRow.dispatch_id && documentRow.dispatch_id.length != 0 ? documentRow.dispatch_id.substring(9) : ''
|
|
319
|
+
};
|
|
313
320
|
if (documentRow.processed_file_path === null || documentRow.processed_file_path === '') {
|
|
314
|
-
let cta = 'processBase64Data-started';
|
|
315
|
-
let extra = {
|
|
316
|
-
msg: 'processBase64Data-started',
|
|
317
|
-
fName: documentRow.file_name && documentRow.file_name.length != 0 ? documentRow.file_name.substring(4) : '',
|
|
318
|
-
dName: documentRow.fms_folder_id && documentRow.fms_folder_id.length != 0 ? documentRow.fms_folder_id.substring(4) : '',
|
|
319
|
-
dispId: documentRow.dispatch_id && documentRow.dispatch_id.length != 0 ? documentRow.dispatch_id.substring(9) : ''
|
|
320
|
-
};
|
|
321
|
-
(0, _SentryAnalyticsUtils.fireEventWithScreenName)({
|
|
322
|
-
severityLevel: _SentrySdkConstants.SeverityLevelValue.LOG,
|
|
323
|
-
eventName: _SentrySdkConstants.SentryEventNameSdkConstants.APP_LOG,
|
|
324
|
-
screenName: cta,
|
|
325
|
-
cta: cta,
|
|
326
|
-
extraParams: extra
|
|
327
|
-
});
|
|
328
|
-
_Logger.default.getInstance().logEvent(cta, (0, _utils.flattenObject)(extra), _Logger.LOG_TYPE.SDK_ERROR);
|
|
329
321
|
let filePath = '';
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
322
|
+
try {
|
|
323
|
+
(0, _SentryAnalyticsUtils.fireEventWithScreenName)({
|
|
324
|
+
severityLevel: _SentrySdkConstants.SeverityLevelValue.LOG,
|
|
325
|
+
eventName: _SentrySdkConstants.SentryEventNameSdkConstants.APP_LOG,
|
|
326
|
+
screenName: cta,
|
|
327
|
+
cta: cta,
|
|
328
|
+
extraParams: extra
|
|
329
|
+
});
|
|
330
|
+
_Logger.default.getInstance().logEvent(cta, (0, _utils.flattenObject)(extra), _Logger.LOG_TYPE.SDK_ERROR);
|
|
331
|
+
|
|
332
|
+
// If templrary base 64 file already exist then do not create again
|
|
333
|
+
if (documentRow.file_path === null || documentRow.file_path === '') {
|
|
334
|
+
const imagePath = `${_reactNativeFs.default.TemporaryDirectoryPath}/${documentRow.file_name}`;
|
|
335
|
+
await _reactNativeFs.default.writeFile(imagePath, documentRow.data, 'base64'); // Write file to temprary location
|
|
336
|
+
filePath = imagePath;
|
|
337
|
+
// If file generated frommbase64 data does not have file:// then we are adding manually.
|
|
338
|
+
if (!imagePath.includes('file')) {
|
|
339
|
+
filePath = `file://${imagePath}`;
|
|
340
|
+
}
|
|
341
|
+
documentRow.file_path = filePath;
|
|
342
|
+
} else {
|
|
343
|
+
filePath = documentRow.file_path;
|
|
338
344
|
}
|
|
339
|
-
documentRow.
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
backgroundImage: {
|
|
357
|
-
src: filePath,
|
|
358
|
-
// Image for overlay
|
|
359
|
-
scale: 1
|
|
360
|
-
},
|
|
361
|
-
watermarkTexts: [{
|
|
362
|
-
text: `${dateTime}\n${strDMSWithAccuracy}`,
|
|
363
|
-
// Ooverlay text
|
|
364
|
-
position: {
|
|
365
|
-
position: _reactNativeImageMarker.Position.topLeft // Overlay text position
|
|
345
|
+
let pFilePath = 'processed_' + documentRow.file_name; // File name for processed file.
|
|
346
|
+
let strGeoStamp = documentRow.geo_timestamp; // Saved geostamp string
|
|
347
|
+
let objGeoStamp = JSON.parse(strGeoStamp); // Conversion to geostamp object
|
|
348
|
+
let dateTime = objGeoStamp.dateTime; // Date time stamp in UTC format
|
|
349
|
+
let lat = objGeoStamp.lat; // Latitide
|
|
350
|
+
let lng = objGeoStamp.lng; // Longitude
|
|
351
|
+
let accuracy = objGeoStamp.accuracy; // Location accuracy
|
|
352
|
+
let strDMS = latlngToDms(`${lat}, ${lng}`); // Location in degree format
|
|
353
|
+
let strDMSWithAccuracy = strDMS;
|
|
354
|
+
if (accuracy !== '') {
|
|
355
|
+
strDMSWithAccuracy = strDMS + ' (Accuracy: ' + accuracy + 'm)'; // Appedning accuracy in location
|
|
356
|
+
}
|
|
357
|
+
const options = {
|
|
358
|
+
backgroundImage: {
|
|
359
|
+
src: filePath,
|
|
360
|
+
// Image for overlay
|
|
361
|
+
scale: 1
|
|
366
362
|
},
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
color: '#
|
|
363
|
+
watermarkTexts: [{
|
|
364
|
+
text: `${dateTime}\n${strDMSWithAccuracy}`,
|
|
365
|
+
// Ooverlay text
|
|
366
|
+
position: {
|
|
367
|
+
position: _reactNativeImageMarker.Position.topLeft // Overlay text position
|
|
368
|
+
},
|
|
369
|
+
style: {
|
|
370
|
+
// Style for overlay
|
|
371
|
+
color: '#ffffff',
|
|
372
|
+
fontSize: 14,
|
|
373
|
+
fontName: 'Arial',
|
|
374
|
+
textBackgroundStyle: {
|
|
375
|
+
padding: '1% 1%',
|
|
376
|
+
type: _reactNativeImageMarker.TextBackgroundType.none,
|
|
377
|
+
color: '#444444CC'
|
|
378
|
+
}
|
|
376
379
|
}
|
|
377
|
-
}
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
380
|
+
}],
|
|
381
|
+
scale: 1,
|
|
382
|
+
quality: 100,
|
|
383
|
+
filename: pFilePath,
|
|
384
|
+
saveFormat: _reactNativeImageMarker.ImageFormat.base64 // Saving in base6 format
|
|
385
|
+
};
|
|
386
|
+
let processedBase64 = await _reactNativeImageMarker.default.markText(options); // Generating overlay image
|
|
387
|
+
if (processedBase64 !== null && processedBase64 !== '') {
|
|
388
|
+
// Fetching base64 data from processed data.
|
|
389
|
+
var splittedDase64Data = processedBase64.split('data:image/png;base64,');
|
|
390
|
+
// Updating document document table with overlayed base64 data
|
|
391
|
+
await this.updateDocumentProcessedPath(documentRow, filePath, splittedDase64Data[1]);
|
|
392
|
+
documentRow.processed_file_path = splittedDase64Data[1];
|
|
393
|
+
}
|
|
394
|
+
} catch (error) {
|
|
395
|
+
console.log('====================================');
|
|
396
|
+
console.log('processBase64Data-error:', error);
|
|
397
|
+
console.log('====================================');
|
|
398
|
+
// Updating document document table with original base64 data
|
|
399
|
+
await this.updateDocumentProcessedPath(documentRow, filePath, filePath);
|
|
400
|
+
documentRow.processed_file_path = "";
|
|
391
401
|
}
|
|
392
402
|
}
|
|
393
|
-
|
|
394
|
-
|
|
403
|
+
cta = 'processBase64Data-completed';
|
|
404
|
+
extra = {
|
|
395
405
|
msg: 'processBase64Data-completed',
|
|
396
406
|
fName: documentRow.file_name && documentRow.file_name.length != 0 ? documentRow.file_name.substring(4) : '',
|
|
397
407
|
dName: documentRow.fms_folder_id && documentRow.fms_folder_id.length != 0 ? documentRow.fms_folder_id.substring(4) : '',
|