@os1-platform/dispatch-mobile 3.1.9 → 3.2.1

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.
Files changed (612) hide show
  1. package/README.md +0 -2
  2. package/android/.gradle/8.13/checksums/checksums.lock +0 -0
  3. package/android/.gradle/8.13/checksums/md5-checksums.bin +0 -0
  4. package/android/.gradle/8.13/checksums/sha1-checksums.bin +0 -0
  5. package/android/.gradle/8.13/executionHistory/executionHistory.lock +0 -0
  6. package/android/.gradle/{8.10.2 → 8.13}/fileHashes/fileHashes.bin +0 -0
  7. package/android/.gradle/8.13/fileHashes/fileHashes.lock +0 -0
  8. package/android/.gradle/buildOutputCleanup/buildOutputCleanup.lock +0 -0
  9. package/android/.gradle/buildOutputCleanup/cache.properties +2 -2
  10. package/android/.idea/caches/deviceStreaming.xml +218 -12
  11. package/android/build.gradle +14 -15
  12. package/android/gradle.properties +9 -4
  13. package/android/src/main/AndroidManifest.xml +4 -1
  14. package/android/src/main/java/com/dispatchsdk/location/LocationModule.kt +3 -3
  15. package/android/src/main/java/com/dispatchsdk/sync/SyncEventService.kt +2 -3
  16. package/android/src/main/java/com/dispatchsdk/utils/DispatchSdkUtils.kt +27 -11
  17. package/babel.config.js +1 -1
  18. package/dispatch-mobile.podspec +1 -1
  19. package/lib/commonjs/analytics/sentry/SentryAnalyticsUtils.js +1 -2
  20. package/lib/commonjs/analytics/sentry/SentryAnalyticsUtils.js.map +1 -1
  21. package/lib/commonjs/analytics/sentry/SentrySdkConstants.js +4 -0
  22. package/lib/commonjs/analytics/sentry/SentrySdkConstants.js.map +1 -1
  23. package/lib/commonjs/components/dispatch/DispatchExecNavigator.js +1 -2
  24. package/lib/commonjs/components/dispatch/DispatchExecNavigator.js.map +1 -1
  25. package/lib/commonjs/components/executiontasks/cancellation/CancelET.js +4 -5
  26. package/lib/commonjs/components/executiontasks/cancellation/CancelET.js.map +1 -1
  27. package/lib/commonjs/components/executiontasks/captureInput/CaptureText.js +5 -6
  28. package/lib/commonjs/components/executiontasks/captureInput/CaptureText.js.map +1 -1
  29. package/lib/commonjs/components/executiontasks/collectPayment/CollectPayment.js +1 -2
  30. package/lib/commonjs/components/executiontasks/collectPayment/CollectPayment.js.map +1 -1
  31. package/lib/commonjs/components/executiontasks/collectPayment/PaymentUtils.js +1 -2
  32. package/lib/commonjs/components/executiontasks/collectPayment/PaymentUtils.js.map +1 -1
  33. package/lib/commonjs/components/executiontasks/collectPayment/components/CompletePayment.js +3 -4
  34. package/lib/commonjs/components/executiontasks/collectPayment/components/CompletePayment.js.map +1 -1
  35. package/lib/commonjs/components/executiontasks/collectPayment/components/InitPayment.js +5 -9
  36. package/lib/commonjs/components/executiontasks/collectPayment/components/InitPayment.js.map +1 -1
  37. package/lib/commonjs/components/executiontasks/collectPayment/components/PaymentContactDetails.js +8 -9
  38. package/lib/commonjs/components/executiontasks/collectPayment/components/PaymentContactDetails.js.map +1 -1
  39. package/lib/commonjs/components/executiontasks/collectPayment/components/ProcessPayment.js +24 -25
  40. package/lib/commonjs/components/executiontasks/collectPayment/components/ProcessPayment.js.map +1 -1
  41. package/lib/commonjs/components/executiontasks/deliver/DeliverET.js +1 -2
  42. package/lib/commonjs/components/executiontasks/deliver/DeliverET.js.map +1 -1
  43. package/lib/commonjs/components/executiontasks/deliver/SLDeliverET.js +5 -6
  44. package/lib/commonjs/components/executiontasks/deliver/SLDeliverET.js.map +1 -1
  45. package/lib/commonjs/components/executiontasks/display/DisplayModalET.js +1 -2
  46. package/lib/commonjs/components/executiontasks/display/DisplayModalET.js.map +1 -1
  47. package/lib/commonjs/components/executiontasks/doodle/SignatureET.js +6 -7
  48. package/lib/commonjs/components/executiontasks/doodle/SignatureET.js.map +1 -1
  49. package/lib/commonjs/components/executiontasks/dropCash/DropCashET.js +1 -2
  50. package/lib/commonjs/components/executiontasks/dropCash/DropCashET.js.map +1 -1
  51. package/lib/commonjs/components/executiontasks/dropCash/SLDropCash.js +5 -6
  52. package/lib/commonjs/components/executiontasks/dropCash/SLDropCash.js.map +1 -1
  53. package/lib/commonjs/components/executiontasks/forms/FormGenerator.js +13 -35
  54. package/lib/commonjs/components/executiontasks/forms/FormGenerator.js.map +1 -1
  55. package/lib/commonjs/components/executiontasks/forms/widgets/DateTimeWidget.js +1 -2
  56. package/lib/commonjs/components/executiontasks/forms/widgets/DateTimeWidget.js.map +1 -1
  57. package/lib/commonjs/components/executiontasks/forms/widgets/DropdownWidget.js +1 -2
  58. package/lib/commonjs/components/executiontasks/forms/widgets/DropdownWidget.js.map +1 -1
  59. package/lib/commonjs/components/executiontasks/forms/widgets/QRBarcodeScannerWidget.js +4 -5
  60. package/lib/commonjs/components/executiontasks/forms/widgets/QRBarcodeScannerWidget.js.map +1 -1
  61. package/lib/commonjs/components/executiontasks/forms/widgets/TimeRangeSelector.js +1 -2
  62. package/lib/commonjs/components/executiontasks/forms/widgets/TimeRangeSelector.js.map +1 -1
  63. package/lib/commonjs/components/executiontasks/httpRequest/HttpRequestET.js +1 -2
  64. package/lib/commonjs/components/executiontasks/httpRequest/HttpRequestET.js.map +1 -1
  65. package/lib/commonjs/components/executiontasks/imageCapture/CaptureUtils.js +1 -2
  66. package/lib/commonjs/components/executiontasks/imageCapture/CaptureUtils.js.map +1 -1
  67. package/lib/commonjs/components/executiontasks/imageCapture/ImageCapture.js +5 -6
  68. package/lib/commonjs/components/executiontasks/imageCapture/ImageCapture.js.map +1 -1
  69. package/lib/commonjs/components/executiontasks/payments/completePayment/CompletePaymentET.js +5 -6
  70. package/lib/commonjs/components/executiontasks/payments/completePayment/CompletePaymentET.js.map +1 -1
  71. package/lib/commonjs/components/executiontasks/payments/init/InitPaymentET.js +5 -6
  72. package/lib/commonjs/components/executiontasks/payments/init/InitPaymentET.js.map +1 -1
  73. package/lib/commonjs/components/executiontasks/payments/processPayment/ProcessPaymentET.js +5 -6
  74. package/lib/commonjs/components/executiontasks/payments/processPayment/ProcessPaymentET.js.map +1 -1
  75. package/lib/commonjs/components/executiontasks/pickup/PickupET.js +1 -2
  76. package/lib/commonjs/components/executiontasks/pickup/PickupET.js.map +1 -1
  77. package/lib/commonjs/components/executiontasks/pickup/SLPickupET.js +5 -6
  78. package/lib/commonjs/components/executiontasks/pickup/SLPickupET.js.map +1 -1
  79. package/lib/commonjs/components/executiontasks/scan/ScanET.js +8 -9
  80. package/lib/commonjs/components/executiontasks/scan/ScanET.js.map +1 -1
  81. package/lib/commonjs/components/executiontasks/scan/interfaces.js +17 -1
  82. package/lib/commonjs/components/executiontasks/scan/interfaces.js.map +1 -1
  83. package/lib/commonjs/components/executiontasks/scan/sub_components/CScanner.js +5 -6
  84. package/lib/commonjs/components/executiontasks/scan/sub_components/CScanner.js.map +1 -1
  85. package/lib/commonjs/components/executiontasks/scan/sub_components/DropDownUtils.js +1 -1
  86. package/lib/commonjs/components/executiontasks/scan/sub_components/DropDownUtils.js.map +1 -1
  87. package/lib/commonjs/components/executiontasks/scan/sub_components/ERDropDown.js +1 -2
  88. package/lib/commonjs/components/executiontasks/scan/sub_components/ERDropDown.js.map +1 -1
  89. package/lib/commonjs/components/executiontasks/scan/sub_components/SummaryPage.js +6 -6
  90. package/lib/commonjs/components/executiontasks/scan/sub_components/SummaryPage.js.map +1 -1
  91. package/lib/commonjs/components/executiontasks/scan/utils.js +13 -15
  92. package/lib/commonjs/components/executiontasks/scan/utils.js.map +1 -1
  93. package/lib/commonjs/components/executiontasks/validateOTP/ValidateOTPET.js +1 -2
  94. package/lib/commonjs/components/executiontasks/validateOTP/ValidateOTPET.js.map +1 -1
  95. package/lib/commonjs/components/executiontasks/validateOTP/ValidateOTPSchema.js.map +1 -1
  96. package/lib/commonjs/components/executiontasks/validateOTP/components/ContactListView.js +5 -7
  97. package/lib/commonjs/components/executiontasks/validateOTP/components/ContactListView.js.map +1 -1
  98. package/lib/commonjs/components/executiontasks/validateOTP/components/OTPView.js +5 -6
  99. package/lib/commonjs/components/executiontasks/validateOTP/components/OTPView.js.map +1 -1
  100. package/lib/commonjs/components/executiontasks/validateOTP/components/VerificationComplete.js +8 -11
  101. package/lib/commonjs/components/executiontasks/validateOTP/components/VerificationComplete.js.map +1 -1
  102. package/lib/commonjs/components/executiontasks/validateOTP/sub-components/OTPInput.js +1 -2
  103. package/lib/commonjs/components/executiontasks/validateOTP/sub-components/OTPInput.js.map +1 -1
  104. package/lib/commonjs/components/executiontasks/validateOTP/utils.js +1 -2
  105. package/lib/commonjs/components/executiontasks/validateOTP/utils.js.map +1 -1
  106. package/lib/commonjs/components/executiontasks/verifyLocation/GeofenceUtils.js +1 -2
  107. package/lib/commonjs/components/executiontasks/verifyLocation/GeofenceUtils.js.map +1 -1
  108. package/lib/commonjs/components/executiontasks/verifyLocation/VerifyLocationET.js +1 -2
  109. package/lib/commonjs/components/executiontasks/verifyLocation/VerifyLocationET.js.map +1 -1
  110. package/lib/commonjs/components/executiontasks/verifyOtp/VerifyOtpET.js +7 -12
  111. package/lib/commonjs/components/executiontasks/verifyOtp/VerifyOtpET.js.map +1 -1
  112. package/lib/commonjs/components/widgets/AlertDisplay.js +1 -2
  113. package/lib/commonjs/components/widgets/AlertDisplay.js.map +1 -1
  114. package/lib/commonjs/components/widgets/CancelOrderDialog.js +3 -4
  115. package/lib/commonjs/components/widgets/CancelOrderDialog.js.map +1 -1
  116. package/lib/commonjs/components/widgets/Card.js +2 -2
  117. package/lib/commonjs/components/widgets/Card.js.map +1 -1
  118. package/lib/commonjs/components/widgets/SearchBar.js +4 -3
  119. package/lib/commonjs/components/widgets/SearchBar.js.map +1 -1
  120. package/lib/commonjs/components/widgets/SnackBarCustom.js +12 -15
  121. package/lib/commonjs/components/widgets/SnackBarCustom.js.map +1 -1
  122. package/lib/commonjs/components/widgets/SplitTextInput.js +2 -3
  123. package/lib/commonjs/components/widgets/SplitTextInput.js.map +1 -1
  124. package/lib/commonjs/components/widgets/TabsComponent.js +1 -2
  125. package/lib/commonjs/components/widgets/TabsComponent.js.map +1 -1
  126. package/lib/commonjs/components/widgets/Timer.js +1 -2
  127. package/lib/commonjs/components/widgets/Timer.js.map +1 -1
  128. package/lib/commonjs/database/DBManager.js +112 -0
  129. package/lib/commonjs/database/DBManager.js.map +1 -0
  130. package/lib/commonjs/database/dbUpdate.json +6 -0
  131. package/lib/commonjs/index.js +1 -2
  132. package/lib/commonjs/index.js.map +1 -1
  133. package/lib/commonjs/manager/dispatch/DispatchStateContainer.js +1 -2
  134. package/lib/commonjs/manager/dispatch/DispatchStateContainer.js.map +1 -1
  135. package/lib/commonjs/manager/dispatchCodes/EventCodeRepo.js +8 -9
  136. package/lib/commonjs/manager/dispatchCodes/EventCodeRepo.js.map +1 -1
  137. package/lib/commonjs/manager/dispatchCodes/ReasonCodeContainer.js +5 -6
  138. package/lib/commonjs/manager/dispatchCodes/ReasonCodeContainer.js.map +1 -1
  139. package/lib/commonjs/manager/dispatchCodes/ReasonCodeRepo.js +13 -10
  140. package/lib/commonjs/manager/dispatchCodes/ReasonCodeRepo.js.map +1 -1
  141. package/lib/commonjs/manager/location/LocationManager.js +0 -4
  142. package/lib/commonjs/manager/location/LocationManager.js.map +1 -1
  143. package/lib/commonjs/manager/sdk/DispatchSDKManager.js +8 -3
  144. package/lib/commonjs/manager/sdk/DispatchSDKManager.js.map +1 -1
  145. package/lib/commonjs/manager/sdk/callbacksHandler.js +1 -1
  146. package/lib/commonjs/manager/sdk/callbacksHandler.js.map +1 -1
  147. package/lib/commonjs/manager/syncmanager/AppSyncManager.js +1 -2
  148. package/lib/commonjs/manager/syncmanager/AppSyncManager.js.map +1 -1
  149. package/lib/commonjs/manager/syncmanager/DBConfig.js +6 -2
  150. package/lib/commonjs/manager/syncmanager/DBConfig.js.map +1 -1
  151. package/lib/commonjs/manager/syncmanager/database.js +118 -47
  152. package/lib/commonjs/manager/syncmanager/database.js.map +1 -1
  153. package/lib/commonjs/manager/syncmanager/document/DocumentHttpClient.js +1 -2
  154. package/lib/commonjs/manager/syncmanager/document/DocumentHttpClient.js.map +1 -1
  155. package/lib/commonjs/manager/syncmanager/document/DocumentManager.js +17 -22
  156. package/lib/commonjs/manager/syncmanager/document/DocumentManager.js.map +1 -1
  157. package/lib/commonjs/manager/syncmanager/document/DocumentSyncManager.js +86 -77
  158. package/lib/commonjs/manager/syncmanager/document/DocumentSyncManager.js.map +1 -1
  159. package/lib/commonjs/manager/syncmanager/events/ETEventsManager.js +25 -28
  160. package/lib/commonjs/manager/syncmanager/events/ETEventsManager.js.map +1 -1
  161. package/lib/commonjs/manager/syncmanager/events/EventsSyncManager.js +1 -2
  162. package/lib/commonjs/manager/syncmanager/events/EventsSyncManager.js.map +1 -1
  163. package/lib/commonjs/manager/syncmanager/events/SyncHttpClient.js +1 -2
  164. package/lib/commonjs/manager/syncmanager/events/SyncHttpClient.js.map +1 -1
  165. package/lib/commonjs/models/execTasks/ETConfig.js +1 -0
  166. package/lib/commonjs/models/execTasks/ETConfig.js.map +1 -1
  167. package/lib/commonjs/models/sdk.js.map +1 -1
  168. package/lib/commonjs/native/signature/SignatureCapture.js +2 -2
  169. package/lib/commonjs/native/signature/SignatureCapture.js.map +1 -1
  170. package/lib/commonjs/network/client.js.map +1 -1
  171. package/lib/commonjs/styles/executionTasks/CommonStyles.js +1 -2
  172. package/lib/commonjs/styles/executionTasks/CommonStyles.js.map +1 -1
  173. package/lib/commonjs/ui/screens/CancellationScreen.js +1 -2
  174. package/lib/commonjs/ui/screens/CancellationScreen.js.map +1 -1
  175. package/lib/commonjs/ui/screens/CaptureInputScreen.js +1 -2
  176. package/lib/commonjs/ui/screens/CaptureInputScreen.js.map +1 -1
  177. package/lib/commonjs/ui/screens/CollectPaymentScreen.js +1 -2
  178. package/lib/commonjs/ui/screens/CollectPaymentScreen.js.map +1 -1
  179. package/lib/commonjs/ui/screens/CompleteObjectiveScreen.js +1 -2
  180. package/lib/commonjs/ui/screens/CompleteObjectiveScreen.js.map +1 -1
  181. package/lib/commonjs/ui/screens/DeliverScreen.js +1 -2
  182. package/lib/commonjs/ui/screens/DeliverScreen.js.map +1 -1
  183. package/lib/commonjs/ui/screens/DisplayScreen.js +1 -2
  184. package/lib/commonjs/ui/screens/DisplayScreen.js.map +1 -1
  185. package/lib/commonjs/ui/screens/DoodleScreen.js +1 -2
  186. package/lib/commonjs/ui/screens/DoodleScreen.js.map +1 -1
  187. package/lib/commonjs/ui/screens/DropCashScreen.js +1 -2
  188. package/lib/commonjs/ui/screens/DropCashScreen.js.map +1 -1
  189. package/lib/commonjs/ui/screens/FormsScreen.js +1 -2
  190. package/lib/commonjs/ui/screens/FormsScreen.js.map +1 -1
  191. package/lib/commonjs/ui/screens/GeofenceScreen.js +1 -2
  192. package/lib/commonjs/ui/screens/GeofenceScreen.js.map +1 -1
  193. package/lib/commonjs/ui/screens/ImageCaptureScreen.js +1 -2
  194. package/lib/commonjs/ui/screens/ImageCaptureScreen.js.map +1 -1
  195. package/lib/commonjs/ui/screens/PaymentScreen.js +1 -2
  196. package/lib/commonjs/ui/screens/PaymentScreen.js.map +1 -1
  197. package/lib/commonjs/ui/screens/PickupScreen.js +1 -2
  198. package/lib/commonjs/ui/screens/PickupScreen.js.map +1 -1
  199. package/lib/commonjs/ui/screens/ScanScreen.js +1 -2
  200. package/lib/commonjs/ui/screens/ScanScreen.js.map +1 -1
  201. package/lib/commonjs/ui/screens/StartWorkFlowScreen.js +1 -2
  202. package/lib/commonjs/ui/screens/StartWorkFlowScreen.js.map +1 -1
  203. package/lib/commonjs/ui/screens/ValidateOTPScreen.js +1 -2
  204. package/lib/commonjs/ui/screens/ValidateOTPScreen.js.map +1 -1
  205. package/lib/commonjs/ui/screens/WithBaseDispatchScreen.js +1 -2
  206. package/lib/commonjs/ui/screens/WithBaseDispatchScreen.js.map +1 -1
  207. package/lib/commonjs/utils/Constants.js.map +1 -1
  208. package/lib/commonjs/utils/Logger.js +1 -1
  209. package/lib/commonjs/utils/Logger.js.map +1 -1
  210. package/lib/commonjs/utils/SdkUtils.js +6 -5
  211. package/lib/commonjs/utils/SdkUtils.js.map +1 -1
  212. package/lib/commonjs/utils/SyncManagerUtils.js +3 -2
  213. package/lib/commonjs/utils/SyncManagerUtils.js.map +1 -1
  214. package/lib/commonjs/utils/fcm/FCM.js +1 -2
  215. package/lib/commonjs/utils/fcm/FCM.js.map +1 -1
  216. package/lib/commonjs/utils/fcm/FcmUtils.js +1 -2
  217. package/lib/commonjs/utils/fcm/FcmUtils.js.map +1 -1
  218. package/lib/commonjs/utils/hooks/useModal.js +1 -2
  219. package/lib/commonjs/utils/hooks/useModal.js.map +1 -1
  220. package/lib/commonjs/utils/storage.js +1 -2
  221. package/lib/commonjs/utils/storage.js.map +1 -1
  222. package/lib/module/analytics/sentry/SentrySdkConstants.js +4 -0
  223. package/lib/module/analytics/sentry/SentrySdkConstants.js.map +1 -1
  224. package/lib/module/components/executiontasks/cancellation/CancelET.js +1 -1
  225. package/lib/module/components/executiontasks/cancellation/CancelET.js.map +1 -1
  226. package/lib/module/components/executiontasks/captureInput/CaptureText.js +3 -3
  227. package/lib/module/components/executiontasks/captureInput/CaptureText.js.map +1 -1
  228. package/lib/module/components/executiontasks/collectPayment/components/CompletePayment.js +2 -2
  229. package/lib/module/components/executiontasks/collectPayment/components/CompletePayment.js.map +1 -1
  230. package/lib/module/components/executiontasks/collectPayment/components/InitPayment.js +3 -6
  231. package/lib/module/components/executiontasks/collectPayment/components/InitPayment.js.map +1 -1
  232. package/lib/module/components/executiontasks/collectPayment/components/PaymentContactDetails.js +6 -6
  233. package/lib/module/components/executiontasks/collectPayment/components/PaymentContactDetails.js.map +1 -1
  234. package/lib/module/components/executiontasks/collectPayment/components/ProcessPayment.js +21 -21
  235. package/lib/module/components/executiontasks/collectPayment/components/ProcessPayment.js.map +1 -1
  236. package/lib/module/components/executiontasks/deliver/SLDeliverET.js +3 -3
  237. package/lib/module/components/executiontasks/deliver/SLDeliverET.js.map +1 -1
  238. package/lib/module/components/executiontasks/doodle/SignatureET.js +4 -4
  239. package/lib/module/components/executiontasks/doodle/SignatureET.js.map +1 -1
  240. package/lib/module/components/executiontasks/dropCash/SLDropCash.js +3 -3
  241. package/lib/module/components/executiontasks/dropCash/SLDropCash.js.map +1 -1
  242. package/lib/module/components/executiontasks/forms/FormGenerator.js +11 -32
  243. package/lib/module/components/executiontasks/forms/FormGenerator.js.map +1 -1
  244. package/lib/module/components/executiontasks/forms/widgets/QRBarcodeScannerWidget.js +2 -2
  245. package/lib/module/components/executiontasks/forms/widgets/QRBarcodeScannerWidget.js.map +1 -1
  246. package/lib/module/components/executiontasks/imageCapture/ImageCapture.js +4 -4
  247. package/lib/module/components/executiontasks/imageCapture/ImageCapture.js.map +1 -1
  248. package/lib/module/components/executiontasks/payments/completePayment/CompletePaymentET.js +3 -3
  249. package/lib/module/components/executiontasks/payments/completePayment/CompletePaymentET.js.map +1 -1
  250. package/lib/module/components/executiontasks/payments/init/InitPaymentET.js +3 -3
  251. package/lib/module/components/executiontasks/payments/init/InitPaymentET.js.map +1 -1
  252. package/lib/module/components/executiontasks/payments/processPayment/ProcessPaymentET.js +3 -3
  253. package/lib/module/components/executiontasks/payments/processPayment/ProcessPaymentET.js.map +1 -1
  254. package/lib/module/components/executiontasks/pickup/PickupET.js.map +1 -1
  255. package/lib/module/components/executiontasks/pickup/SLPickupET.js +3 -3
  256. package/lib/module/components/executiontasks/pickup/SLPickupET.js.map +1 -1
  257. package/lib/module/components/executiontasks/scan/ScanET.js +5 -5
  258. package/lib/module/components/executiontasks/scan/ScanET.js.map +1 -1
  259. package/lib/module/components/executiontasks/scan/interfaces.js +16 -0
  260. package/lib/module/components/executiontasks/scan/interfaces.js.map +1 -1
  261. package/lib/module/components/executiontasks/scan/sub_components/CScanner.js +5 -5
  262. package/lib/module/components/executiontasks/scan/sub_components/CScanner.js.map +1 -1
  263. package/lib/module/components/executiontasks/scan/sub_components/DropDownUtils.js +2 -2
  264. package/lib/module/components/executiontasks/scan/sub_components/DropDownUtils.js.map +1 -1
  265. package/lib/module/components/executiontasks/scan/sub_components/ERDropDown.js.map +1 -1
  266. package/lib/module/components/executiontasks/scan/sub_components/SummaryPage.js +3 -3
  267. package/lib/module/components/executiontasks/scan/sub_components/SummaryPage.js.map +1 -1
  268. package/lib/module/components/executiontasks/scan/utils.js +13 -14
  269. package/lib/module/components/executiontasks/scan/utils.js.map +1 -1
  270. package/lib/module/components/executiontasks/validateOTP/ValidateOTPET.js.map +1 -1
  271. package/lib/module/components/executiontasks/validateOTP/ValidateOTPSchema.js.map +1 -1
  272. package/lib/module/components/executiontasks/validateOTP/components/ContactListView.js +3 -4
  273. package/lib/module/components/executiontasks/validateOTP/components/ContactListView.js.map +1 -1
  274. package/lib/module/components/executiontasks/validateOTP/components/OTPView.js +3 -3
  275. package/lib/module/components/executiontasks/validateOTP/components/OTPView.js.map +1 -1
  276. package/lib/module/components/executiontasks/validateOTP/components/VerificationComplete.js +7 -9
  277. package/lib/module/components/executiontasks/validateOTP/components/VerificationComplete.js.map +1 -1
  278. package/lib/module/components/executiontasks/verifyOtp/VerifyOtpET.js +7 -10
  279. package/lib/module/components/executiontasks/verifyOtp/VerifyOtpET.js.map +1 -1
  280. package/lib/module/components/widgets/CancelOrderDialog.js +1 -1
  281. package/lib/module/components/widgets/CancelOrderDialog.js.map +1 -1
  282. package/lib/module/components/widgets/Card.js +1 -1
  283. package/lib/module/components/widgets/Card.js.map +1 -1
  284. package/lib/module/components/widgets/SearchBar.js +2 -1
  285. package/lib/module/components/widgets/SearchBar.js.map +1 -1
  286. package/lib/module/components/widgets/SnackBarCustom.js +6 -8
  287. package/lib/module/components/widgets/SnackBarCustom.js.map +1 -1
  288. package/lib/module/components/widgets/SplitTextInput.js +1 -1
  289. package/lib/module/components/widgets/SplitTextInput.js.map +1 -1
  290. package/lib/module/components/widgets/Timer.js.map +1 -1
  291. package/lib/module/database/DBManager.js +104 -0
  292. package/lib/module/database/DBManager.js.map +1 -0
  293. package/lib/module/database/dbUpdate.json +6 -0
  294. package/lib/module/manager/dispatch/DispatchStateContainer.js.map +1 -1
  295. package/lib/module/manager/dispatchCodes/EventCodeRepo.js +7 -7
  296. package/lib/module/manager/dispatchCodes/EventCodeRepo.js.map +1 -1
  297. package/lib/module/manager/dispatchCodes/ReasonCodeContainer.js +4 -4
  298. package/lib/module/manager/dispatchCodes/ReasonCodeContainer.js.map +1 -1
  299. package/lib/module/manager/dispatchCodes/ReasonCodeRepo.js +13 -8
  300. package/lib/module/manager/dispatchCodes/ReasonCodeRepo.js.map +1 -1
  301. package/lib/module/manager/location/LocationManager.js +0 -4
  302. package/lib/module/manager/location/LocationManager.js.map +1 -1
  303. package/lib/module/manager/sdk/DispatchSDKManager.js +7 -1
  304. package/lib/module/manager/sdk/DispatchSDKManager.js.map +1 -1
  305. package/lib/module/manager/sdk/callbacksHandler.js +0 -2
  306. package/lib/module/manager/sdk/callbacksHandler.js.map +1 -1
  307. package/lib/module/manager/syncmanager/DBConfig.js +5 -1
  308. package/lib/module/manager/syncmanager/DBConfig.js.map +1 -1
  309. package/lib/module/manager/syncmanager/database.js +117 -43
  310. package/lib/module/manager/syncmanager/database.js.map +1 -1
  311. package/lib/module/manager/syncmanager/document/DocumentManager.js +16 -20
  312. package/lib/module/manager/syncmanager/document/DocumentManager.js.map +1 -1
  313. package/lib/module/manager/syncmanager/document/DocumentSyncManager.js +85 -75
  314. package/lib/module/manager/syncmanager/document/DocumentSyncManager.js.map +1 -1
  315. package/lib/module/manager/syncmanager/events/ETEventsManager.js +20 -22
  316. package/lib/module/manager/syncmanager/events/ETEventsManager.js.map +1 -1
  317. package/lib/module/manager/syncmanager/events/EventsSyncManager.js.map +1 -1
  318. package/lib/module/models/execTasks/ETConfig.js +1 -0
  319. package/lib/module/models/execTasks/ETConfig.js.map +1 -1
  320. package/lib/module/models/sdk.js.map +1 -1
  321. package/lib/module/native/signature/SignatureCapture.js +2 -2
  322. package/lib/module/native/signature/SignatureCapture.js.map +1 -1
  323. package/lib/module/network/client.js.map +1 -1
  324. package/lib/module/ui/screens/ValidateOTPScreen.js.map +1 -1
  325. package/lib/module/utils/Constants.js.map +1 -1
  326. package/lib/module/utils/Logger.js +1 -1
  327. package/lib/module/utils/Logger.js.map +1 -1
  328. package/lib/module/utils/SdkUtils.js +5 -3
  329. package/lib/module/utils/SdkUtils.js.map +1 -1
  330. package/lib/module/utils/SyncManagerUtils.js +2 -0
  331. package/lib/module/utils/SyncManagerUtils.js.map +1 -1
  332. package/lib/typescript/babel.config.d.ts +1 -0
  333. package/lib/typescript/jest.config.d.ts +7 -0
  334. package/lib/typescript/jest.setup.d.ts +1 -0
  335. package/lib/typescript/scripts/bootstrap.d.ts +1 -0
  336. package/lib/typescript/{components → src/components}/executiontasks/httpRequest/HttpEtUtils.d.ts +1 -1
  337. package/lib/typescript/{components → src/components}/executiontasks/scan/interfaces.d.ts +15 -0
  338. package/lib/typescript/{components → src/components}/executiontasks/validateOTP/ValidateOTPSchema.d.ts +1 -1
  339. package/lib/typescript/{components → src/components}/widgets/CancelOrderDialog.d.ts +1 -1
  340. package/lib/typescript/{components → src/components}/widgets/SnackBarCustom.d.ts +3 -2
  341. package/lib/typescript/src/components/widgets/Timer.d.ts +6 -0
  342. package/lib/typescript/src/database/DBManager.d.ts +1 -0
  343. package/lib/typescript/{manager → src/manager}/dispatchCodes/EventCodeRepo.d.ts +1 -1
  344. package/lib/typescript/{manager → src/manager}/dispatchCodes/ReasonCodeRepo.d.ts +5 -3
  345. package/lib/typescript/{manager → src/manager}/syncmanager/DBConfig.d.ts +5 -1
  346. package/lib/typescript/src/manager/syncmanager/database.d.ts +31 -0
  347. package/lib/typescript/{manager → src/manager}/syncmanager/document/DocumentManager.d.ts +2 -3
  348. package/lib/typescript/{manager → src/manager}/syncmanager/document/DocumentSyncManager.d.ts +1 -2
  349. package/lib/typescript/{network → src/network}/GraphQLClient.d.ts +5 -5
  350. package/lib/typescript/{network → src/network}/NetworkClient.d.ts +3 -3
  351. package/lib/typescript/{network → src/network}/client.d.ts +3 -3
  352. package/lib/typescript/{resources → src/resources}/Login.d.ts +7 -7
  353. package/lib/typescript/{resources → src/resources}/network.d.ts +1 -1
  354. package/lib/typescript/{utils → src/utils}/ApiUtils.d.ts +2 -2
  355. package/lib/typescript/{utils → src/utils}/Constants.d.ts +4 -0
  356. package/package.json +104 -127
  357. package/src/components/executiontasks/cancellation/CancelET.tsx +1 -1
  358. package/src/components/executiontasks/captureInput/CaptureText.tsx +6 -6
  359. package/src/components/executiontasks/collectPayment/components/CompletePayment.tsx +2 -3
  360. package/src/components/executiontasks/collectPayment/components/InitPayment.tsx +3 -7
  361. package/src/components/executiontasks/collectPayment/components/PaymentContactDetails.tsx +3 -4
  362. package/src/components/executiontasks/collectPayment/components/ProcessPayment.tsx +7 -8
  363. package/src/components/executiontasks/deliver/SLDeliverET.tsx +3 -4
  364. package/src/components/executiontasks/doodle/SignatureET.tsx +5 -5
  365. package/src/components/executiontasks/dropCash/SLDropCash.tsx +3 -4
  366. package/src/components/executiontasks/forms/FormGenerator.tsx +38 -55
  367. package/src/components/executiontasks/forms/widgets/QRBarcodeScannerWidget.tsx +2 -2
  368. package/src/components/executiontasks/imageCapture/ImageCapture.tsx +5 -7
  369. package/src/components/executiontasks/payments/completePayment/CompletePaymentET.tsx +3 -4
  370. package/src/components/executiontasks/payments/init/InitPaymentET.tsx +3 -4
  371. package/src/components/executiontasks/payments/processPayment/ProcessPaymentET.tsx +3 -4
  372. package/src/components/executiontasks/pickup/PickupET.tsx +3 -9
  373. package/src/components/executiontasks/pickup/SLPickupET.tsx +3 -4
  374. package/src/components/executiontasks/scan/ScanET.tsx +5 -6
  375. package/src/components/executiontasks/scan/interfaces.ts +16 -0
  376. package/src/components/executiontasks/scan/sub_components/CScanner.tsx +7 -6
  377. package/src/components/executiontasks/scan/sub_components/DropDownUtils.ts +2 -2
  378. package/src/components/executiontasks/scan/sub_components/ERDropDown.tsx +0 -1
  379. package/src/components/executiontasks/scan/sub_components/SummaryPage.tsx +3 -3
  380. package/src/components/executiontasks/scan/utils.ts +13 -13
  381. package/src/components/executiontasks/validateOTP/ValidateOTPET.tsx +5 -0
  382. package/src/components/executiontasks/validateOTP/ValidateOTPSchema.ts +1 -1
  383. package/src/components/executiontasks/validateOTP/components/ContactListView.tsx +3 -11
  384. package/src/components/executiontasks/validateOTP/components/OTPView.tsx +3 -4
  385. package/src/components/executiontasks/validateOTP/components/VerificationComplete.tsx +7 -7
  386. package/src/components/executiontasks/verifyOtp/VerifyOtpET.tsx +9 -17
  387. package/src/components/widgets/CancelOrderDialog.tsx +2 -2
  388. package/src/components/widgets/Card.tsx +1 -1
  389. package/src/components/widgets/SearchBar.tsx +2 -1
  390. package/src/components/widgets/SnackBarCustom.tsx +8 -10
  391. package/src/components/widgets/SplitTextInput.tsx +1 -1
  392. package/src/components/widgets/Timer.tsx +0 -1
  393. package/src/database/DBManager.ts +118 -0
  394. package/src/database/dbUpdate.json +6 -0
  395. package/src/manager/dispatch/DispatchStateContainer.tsx +5 -25
  396. package/src/manager/dispatchCodes/EventCodeRepo.ts +8 -12
  397. package/src/manager/dispatchCodes/ReasonCodeContainer.ts +5 -5
  398. package/src/manager/dispatchCodes/ReasonCodeRepo.ts +17 -15
  399. package/src/manager/location/LocationManager.ts +1 -8
  400. package/src/manager/sdk/DispatchSDKManager.ts +12 -4
  401. package/src/manager/sdk/callbacksHandler.ts +3 -8
  402. package/src/manager/syncmanager/DBConfig.ts +6 -1
  403. package/src/manager/syncmanager/database.ts +130 -71
  404. package/src/manager/syncmanager/document/DocumentManager.ts +19 -24
  405. package/src/manager/syncmanager/document/DocumentSyncManager.ts +95 -82
  406. package/src/manager/syncmanager/events/ETEventsManager.ts +30 -35
  407. package/src/manager/syncmanager/events/EventsSyncManager.ts +1 -1
  408. package/src/models/sdk.ts +2 -6
  409. package/src/native/signature/SignatureCapture.tsx +4 -3
  410. package/src/network/client.ts +2 -2
  411. package/src/ui/screens/ValidateOTPScreen.tsx +2 -4
  412. package/src/utils/Constants.ts +6 -1
  413. package/src/utils/Logger.ts +2 -1
  414. package/src/utils/SdkUtils.ts +6 -7
  415. package/src/utils/SyncManagerUtils.ts +1 -0
  416. package/tsconfig.build.json +1 -1
  417. package/tsconfig.json +2 -3
  418. package/android/.gradle/8.10.2/checksums/checksums.lock +0 -0
  419. package/android/.gradle/8.10.2/checksums/md5-checksums.bin +0 -0
  420. package/android/.gradle/8.10.2/checksums/sha1-checksums.bin +0 -0
  421. package/android/.gradle/8.10.2/executionHistory/executionHistory.lock +0 -0
  422. package/android/.gradle/8.10.2/fileHashes/fileHashes.lock +0 -0
  423. package/android/.gradle/8.10.2/gc.properties +0 -0
  424. package/lib/typescript/components/widgets/Timer.d.ts +0 -7
  425. package/lib/typescript/manager/syncmanager/database.d.ts +0 -7
  426. /package/android/.gradle/{8.10.2 → 8.13}/fileChanges/last-build.bin +0 -0
  427. /package/android/.gradle/{8.10.2 → 8.13}/fileHashes/resourceHashesCache.bin +0 -0
  428. /package/android/.gradle/{8.10.2/dependencies-accessors → 8.13}/gc.properties +0 -0
  429. /package/lib/typescript/{analytics → src/analytics}/firebase/FirebaseLogging.d.ts +0 -0
  430. /package/lib/typescript/{analytics → src/analytics}/sentry/SentryAnalyticsSingleton.d.ts +0 -0
  431. /package/lib/typescript/{analytics → src/analytics}/sentry/SentryAnalyticsUtils.d.ts +0 -0
  432. /package/lib/typescript/{analytics → src/analytics}/sentry/SentryModels.d.ts +0 -0
  433. /package/lib/typescript/{analytics → src/analytics}/sentry/SentrySdkConstants.d.ts +0 -0
  434. /package/lib/typescript/{components → src/components}/dispatch/DispatchExecNavigator.d.ts +0 -0
  435. /package/lib/typescript/{components → src/components}/executiontasks/CompletedWFSchema.d.ts +0 -0
  436. /package/lib/typescript/{components → src/components}/executiontasks/ExecutionTasksIndex.d.ts +0 -0
  437. /package/lib/typescript/{components → src/components}/executiontasks/cancellation/CancelET.d.ts +0 -0
  438. /package/lib/typescript/{components → src/components}/executiontasks/cancellation/CancellationSchema.d.ts +0 -0
  439. /package/lib/typescript/{components → src/components}/executiontasks/captureInput/CaptureInputSchema.d.ts +0 -0
  440. /package/lib/typescript/{components → src/components}/executiontasks/captureInput/CaptureText.d.ts +0 -0
  441. /package/lib/typescript/{components → src/components}/executiontasks/captureInput/utils.d.ts +0 -0
  442. /package/lib/typescript/{components → src/components}/executiontasks/collectPayment/CollectPayment.d.ts +0 -0
  443. /package/lib/typescript/{components → src/components}/executiontasks/collectPayment/CollectPaymentSchema.d.ts +0 -0
  444. /package/lib/typescript/{components → src/components}/executiontasks/collectPayment/PaymentStyles.d.ts +0 -0
  445. /package/lib/typescript/{components → src/components}/executiontasks/collectPayment/PaymentUtils.d.ts +0 -0
  446. /package/lib/typescript/{components → src/components}/executiontasks/collectPayment/components/CompletePayment.d.ts +0 -0
  447. /package/lib/typescript/{components → src/components}/executiontasks/collectPayment/components/CustomContactsModal.d.ts +0 -0
  448. /package/lib/typescript/{components → src/components}/executiontasks/collectPayment/components/InitPayment.d.ts +0 -0
  449. /package/lib/typescript/{components → src/components}/executiontasks/collectPayment/components/PaymentContactDetails.d.ts +0 -0
  450. /package/lib/typescript/{components → src/components}/executiontasks/collectPayment/components/ProcessPayment.d.ts +0 -0
  451. /package/lib/typescript/{components → src/components}/executiontasks/deliver/DeliverET.d.ts +0 -0
  452. /package/lib/typescript/{components → src/components}/executiontasks/deliver/DeliverETInput.d.ts +0 -0
  453. /package/lib/typescript/{components → src/components}/executiontasks/deliver/SLDeliverET.d.ts +0 -0
  454. /package/lib/typescript/{components → src/components}/executiontasks/display/DisplayModalET.d.ts +0 -0
  455. /package/lib/typescript/{components → src/components}/executiontasks/display/DisplaySchema.d.ts +0 -0
  456. /package/lib/typescript/{components → src/components}/executiontasks/doodle/SignatureET.d.ts +0 -0
  457. /package/lib/typescript/{components → src/components}/executiontasks/doodle/SignatureSchema.d.ts +0 -0
  458. /package/lib/typescript/{components → src/components}/executiontasks/dropCash/DropCashET.d.ts +0 -0
  459. /package/lib/typescript/{components → src/components}/executiontasks/dropCash/DropCashSchema.d.ts +0 -0
  460. /package/lib/typescript/{components → src/components}/executiontasks/dropCash/SLDropCash.d.ts +0 -0
  461. /package/lib/typescript/{components → src/components}/executiontasks/forms/FormGenerator.d.ts +0 -0
  462. /package/lib/typescript/{components → src/components}/executiontasks/forms/FormSchema.d.ts +0 -0
  463. /package/lib/typescript/{components → src/components}/executiontasks/forms/widgets/DateTimeWidget.d.ts +0 -0
  464. /package/lib/typescript/{components → src/components}/executiontasks/forms/widgets/DropdownWidget.d.ts +0 -0
  465. /package/lib/typescript/{components → src/components}/executiontasks/forms/widgets/QRBarcodeScannerWidget.d.ts +0 -0
  466. /package/lib/typescript/{components → src/components}/executiontasks/forms/widgets/TimeRangeSelector.d.ts +0 -0
  467. /package/lib/typescript/{components → src/components}/executiontasks/httpRequest/HttpRequestET.d.ts +0 -0
  468. /package/lib/typescript/{components → src/components}/executiontasks/httpRequest/HttpRequestETSchema.d.ts +0 -0
  469. /package/lib/typescript/{components → src/components}/executiontasks/imageCapture/CaptureSchema.d.ts +0 -0
  470. /package/lib/typescript/{components → src/components}/executiontasks/imageCapture/CaptureUtils.d.ts +0 -0
  471. /package/lib/typescript/{components → src/components}/executiontasks/imageCapture/ImageCapture.d.ts +0 -0
  472. /package/lib/typescript/{components → src/components}/executiontasks/payments/PaymentStyles.d.ts +0 -0
  473. /package/lib/typescript/{components → src/components}/executiontasks/payments/PaymentUtils.d.ts +0 -0
  474. /package/lib/typescript/{components → src/components}/executiontasks/payments/completePayment/CompletePaymentET.d.ts +0 -0
  475. /package/lib/typescript/{components → src/components}/executiontasks/payments/completePayment/CompletePaymentSchema.d.ts +0 -0
  476. /package/lib/typescript/{components → src/components}/executiontasks/payments/init/InitPaymentET.d.ts +0 -0
  477. /package/lib/typescript/{components → src/components}/executiontasks/payments/init/InitPaymentSchema.d.ts +0 -0
  478. /package/lib/typescript/{components → src/components}/executiontasks/payments/processPayment/ProcessPaymentET.d.ts +0 -0
  479. /package/lib/typescript/{components → src/components}/executiontasks/payments/processPayment/ProcessPaymentSchema.d.ts +0 -0
  480. /package/lib/typescript/{components → src/components}/executiontasks/pickup/PickpSchema.d.ts +0 -0
  481. /package/lib/typescript/{components → src/components}/executiontasks/pickup/PickupET.d.ts +0 -0
  482. /package/lib/typescript/{components → src/components}/executiontasks/pickup/SLPickupET.d.ts +0 -0
  483. /package/lib/typescript/{components → src/components}/executiontasks/scan/ScanET.d.ts +0 -0
  484. /package/lib/typescript/{components → src/components}/executiontasks/scan/ScanSchema.d.ts +0 -0
  485. /package/lib/typescript/{components → src/components}/executiontasks/scan/constants.d.ts +0 -0
  486. /package/lib/typescript/{components → src/components}/executiontasks/scan/modalConstant.d.ts +0 -0
  487. /package/lib/typescript/{components → src/components}/executiontasks/scan/sub_components/CScanner.d.ts +0 -0
  488. /package/lib/typescript/{components → src/components}/executiontasks/scan/sub_components/DropDownUtils.d.ts +0 -0
  489. /package/lib/typescript/{components → src/components}/executiontasks/scan/sub_components/ERDropDown.d.ts +0 -0
  490. /package/lib/typescript/{components → src/components}/executiontasks/scan/sub_components/SummaryPage.d.ts +0 -0
  491. /package/lib/typescript/{components → src/components}/executiontasks/scan/utils.d.ts +0 -0
  492. /package/lib/typescript/{components → src/components}/executiontasks/validateOTP/ValidateOTPET.d.ts +0 -0
  493. /package/lib/typescript/{components → src/components}/executiontasks/validateOTP/ValidateOtpStyles.d.ts +0 -0
  494. /package/lib/typescript/{components → src/components}/executiontasks/validateOTP/components/ContactListView.d.ts +0 -0
  495. /package/lib/typescript/{components → src/components}/executiontasks/validateOTP/components/OTPView.d.ts +0 -0
  496. /package/lib/typescript/{components → src/components}/executiontasks/validateOTP/components/VerificationComplete.d.ts +0 -0
  497. /package/lib/typescript/{components → src/components}/executiontasks/validateOTP/constants.d.ts +0 -0
  498. /package/lib/typescript/{components → src/components}/executiontasks/validateOTP/sub-components/ContactCard.d.ts +0 -0
  499. /package/lib/typescript/{components → src/components}/executiontasks/validateOTP/sub-components/OTPInput.d.ts +0 -0
  500. /package/lib/typescript/{components → src/components}/executiontasks/validateOTP/sub-components/ResendOTPButton.d.ts +0 -0
  501. /package/lib/typescript/{components → src/components}/executiontasks/validateOTP/utils.d.ts +0 -0
  502. /package/lib/typescript/{components → src/components}/executiontasks/verifyInput/VerifyInputSchema.d.ts +0 -0
  503. /package/lib/typescript/{components → src/components}/executiontasks/verifyLocation/GeofenceUtils.d.ts +0 -0
  504. /package/lib/typescript/{components → src/components}/executiontasks/verifyLocation/VerifyLocSchema.d.ts +0 -0
  505. /package/lib/typescript/{components → src/components}/executiontasks/verifyLocation/VerifyLocationET.d.ts +0 -0
  506. /package/lib/typescript/{components → src/components}/executiontasks/verifyOtp/VerifyOtpET.d.ts +0 -0
  507. /package/lib/typescript/{components → src/components}/executiontasks/verifyOtp/VerifyOtpSchema.d.ts +0 -0
  508. /package/lib/typescript/{components → src/components}/utils/Scale.d.ts +0 -0
  509. /package/lib/typescript/{components → src/components}/utils/index.d.ts +0 -0
  510. /package/lib/typescript/{components → src/components}/widgets/AlertDisplay.d.ts +0 -0
  511. /package/lib/typescript/{components → src/components}/widgets/Card.d.ts +0 -0
  512. /package/lib/typescript/{components → src/components}/widgets/ConfirmCancelModal.d.ts +0 -0
  513. /package/lib/typescript/{components → src/components}/widgets/GoBackModal.d.ts +0 -0
  514. /package/lib/typescript/{components → src/components}/widgets/IconButton.d.ts +0 -0
  515. /package/lib/typescript/{components → src/components}/widgets/ModalWidget.d.ts +0 -0
  516. /package/lib/typescript/{components → src/components}/widgets/ProgressDialog.d.ts +0 -0
  517. /package/lib/typescript/{components → src/components}/widgets/SearchBar.d.ts +0 -0
  518. /package/lib/typescript/{components → src/components}/widgets/SplitTextInput.d.ts +0 -0
  519. /package/lib/typescript/{components → src/components}/widgets/TabsComponent.d.ts +0 -0
  520. /package/lib/typescript/{components → src/components}/widgets/Toaster.d.ts +0 -0
  521. /package/lib/typescript/{config → src/config}/DispatchSDKConfig.d.ts +0 -0
  522. /package/lib/typescript/{constants → src/constants}/apiConstants.d.ts +0 -0
  523. /package/lib/typescript/{constants → src/constants}/constants.d.ts +0 -0
  524. /package/lib/typescript/{constants → src/constants}/statuscode.d.ts +0 -0
  525. /package/lib/typescript/{errors → src/errors}/BaseError.d.ts +0 -0
  526. /package/lib/typescript/{errors → src/errors}/ErrorCodes.d.ts +0 -0
  527. /package/lib/typescript/{events → src/events}/EventDispatcher.d.ts +0 -0
  528. /package/lib/typescript/{events → src/events}/EventListener.d.ts +0 -0
  529. /package/lib/typescript/{events → src/events}/constants.d.ts +0 -0
  530. /package/lib/typescript/{events → src/events}/index.d.ts +0 -0
  531. /package/lib/typescript/{events → src/events}/interface.d.ts +0 -0
  532. /package/lib/typescript/{icons → src/icons}/CircleMark.d.ts +0 -0
  533. /package/lib/typescript/{icons → src/icons}/FailedIcon.d.ts +0 -0
  534. /package/lib/typescript/{icons → src/icons}/FailureCloseIcon.d.ts +0 -0
  535. /package/lib/typescript/{icons → src/icons}/ScanIcon.d.ts +0 -0
  536. /package/lib/typescript/{icons → src/icons}/SuccessCompleteIcon.d.ts +0 -0
  537. /package/lib/typescript/{icons → src/icons}/file.d.ts +0 -0
  538. /package/lib/typescript/{icons → src/icons}/index.d.ts +0 -0
  539. /package/lib/typescript/{icons → src/icons}/interface.d.ts +0 -0
  540. /package/lib/typescript/{index.d.ts → src/index.d.ts} +0 -0
  541. /package/lib/typescript/{locale → src/locale}/Str.d.ts +0 -0
  542. /package/lib/typescript/{locale → src/locale}/i18n.d.ts +0 -0
  543. /package/lib/typescript/{locale → src/locale}/util.d.ts +0 -0
  544. /package/lib/typescript/{manager → src/manager}/dispatch/DispatchStateContainer.d.ts +0 -0
  545. /package/lib/typescript/{manager → src/manager}/dispatchCodes/EventCodeContainer.d.ts +0 -0
  546. /package/lib/typescript/{manager → src/manager}/dispatchCodes/ReasonCodeContainer.d.ts +0 -0
  547. /package/lib/typescript/{manager → src/manager}/jobRemoval/JobRemovalManager.d.ts +0 -0
  548. /package/lib/typescript/{manager → src/manager}/location/LocationManager.d.ts +0 -0
  549. /package/lib/typescript/{manager → src/manager}/sdk/DispatchSDKManager.d.ts +0 -0
  550. /package/lib/typescript/{manager → src/manager}/sdk/DispatchSdkCache.d.ts +0 -0
  551. /package/lib/typescript/{manager → src/manager}/sdk/callbacksHandler.d.ts +0 -0
  552. /package/lib/typescript/{manager → src/manager}/syncmanager/AppSyncManager.d.ts +0 -0
  553. /package/lib/typescript/{manager → src/manager}/syncmanager/NativeSyncManager.d.ts +0 -0
  554. /package/lib/typescript/{manager → src/manager}/syncmanager/constants.d.ts +0 -0
  555. /package/lib/typescript/{manager → src/manager}/syncmanager/document/DocumentHttpClient.d.ts +0 -0
  556. /package/lib/typescript/{manager → src/manager}/syncmanager/document/models.d.ts +0 -0
  557. /package/lib/typescript/{manager → src/manager}/syncmanager/events/ETEventsManager.d.ts +0 -0
  558. /package/lib/typescript/{manager → src/manager}/syncmanager/events/EventsGraphQLClient.d.ts +0 -0
  559. /package/lib/typescript/{manager → src/manager}/syncmanager/events/EventsSyncManager.d.ts +0 -0
  560. /package/lib/typescript/{manager → src/manager}/syncmanager/events/SyncHttpClient.d.ts +0 -0
  561. /package/lib/typescript/{models → src/models}/DispatchModels.d.ts +0 -0
  562. /package/lib/typescript/{models → src/models}/ReasonCodes.d.ts +0 -0
  563. /package/lib/typescript/{models → src/models}/auth.d.ts +0 -0
  564. /package/lib/typescript/{models → src/models}/execTasks/ETBaseModels.d.ts +0 -0
  565. /package/lib/typescript/{models → src/models}/execTasks/ETConfig.d.ts +0 -0
  566. /package/lib/typescript/{models → src/models}/execution.d.ts +0 -0
  567. /package/lib/typescript/{models → src/models}/fcm.d.ts +0 -0
  568. /package/lib/typescript/{models → src/models}/sdk.d.ts +0 -0
  569. /package/lib/typescript/{native → src/native}/LocationModule.d.ts +0 -0
  570. /package/lib/typescript/{native → src/native}/PermissionModule.d.ts +0 -0
  571. /package/lib/typescript/{native → src/native}/signature/SignatureCapture.d.ts +0 -0
  572. /package/lib/typescript/{network → src/network}/NetworkUtils.d.ts +0 -0
  573. /package/lib/typescript/{network → src/network}/Queries.d.ts +0 -0
  574. /package/lib/typescript/{res → src/res}/strings.d.ts +0 -0
  575. /package/lib/typescript/{styles → src/styles}/SdkColors.d.ts +0 -0
  576. /package/lib/typescript/{styles → src/styles}/executionTasks/CommonStyles.d.ts +0 -0
  577. /package/lib/typescript/{ui → src/ui}/screens/CancellationScreen.d.ts +0 -0
  578. /package/lib/typescript/{ui → src/ui}/screens/CaptureInputScreen.d.ts +0 -0
  579. /package/lib/typescript/{ui → src/ui}/screens/CollectPaymentScreen.d.ts +0 -0
  580. /package/lib/typescript/{ui → src/ui}/screens/CompleteObjectiveScreen.d.ts +0 -0
  581. /package/lib/typescript/{ui → src/ui}/screens/DeliverScreen.d.ts +0 -0
  582. /package/lib/typescript/{ui → src/ui}/screens/DisplayScreen.d.ts +0 -0
  583. /package/lib/typescript/{ui → src/ui}/screens/DoodleScreen.d.ts +0 -0
  584. /package/lib/typescript/{ui → src/ui}/screens/DropCashScreen.d.ts +0 -0
  585. /package/lib/typescript/{ui → src/ui}/screens/ETScreensIndex.d.ts +0 -0
  586. /package/lib/typescript/{ui → src/ui}/screens/FormsScreen.d.ts +0 -0
  587. /package/lib/typescript/{ui → src/ui}/screens/GeofenceScreen.d.ts +0 -0
  588. /package/lib/typescript/{ui → src/ui}/screens/HttpRequestScreen.d.ts +0 -0
  589. /package/lib/typescript/{ui → src/ui}/screens/ImageCaptureScreen.d.ts +0 -0
  590. /package/lib/typescript/{ui → src/ui}/screens/PaymentScreen.d.ts +0 -0
  591. /package/lib/typescript/{ui → src/ui}/screens/PickupScreen.d.ts +0 -0
  592. /package/lib/typescript/{ui → src/ui}/screens/ScanScreen.d.ts +0 -0
  593. /package/lib/typescript/{ui → src/ui}/screens/StartWorkFlowScreen.d.ts +0 -0
  594. /package/lib/typescript/{ui → src/ui}/screens/ValidateOTPScreen.d.ts +0 -0
  595. /package/lib/typescript/{ui → src/ui}/screens/WithBaseDispatchScreen.d.ts +0 -0
  596. /package/lib/typescript/{ui → src/ui}/uiConfig/RouteParams.d.ts +0 -0
  597. /package/lib/typescript/{utils → src/utils}/Enums.d.ts +0 -0
  598. /package/lib/typescript/{utils → src/utils}/ExecTaskUtils.d.ts +0 -0
  599. /package/lib/typescript/{utils → src/utils}/Logger.d.ts +0 -0
  600. /package/lib/typescript/{utils → src/utils}/NetworkUtil.d.ts +0 -0
  601. /package/lib/typescript/{utils → src/utils}/SdkUtils.d.ts +0 -0
  602. /package/lib/typescript/{utils → src/utils}/SyncManagerUtils.d.ts +0 -0
  603. /package/lib/typescript/{utils → src/utils}/context/paymentContext.d.ts +0 -0
  604. /package/lib/typescript/{utils → src/utils}/context/valdiateOTPContext.d.ts +0 -0
  605. /package/lib/typescript/{utils → src/utils}/fcm/FCM.d.ts +0 -0
  606. /package/lib/typescript/{utils → src/utils}/fcm/FcmUtils.d.ts +0 -0
  607. /package/lib/typescript/{utils → src/utils}/helper.d.ts +0 -0
  608. /package/lib/typescript/{utils → src/utils}/hooks/useModal.d.ts +0 -0
  609. /package/lib/typescript/{utils → src/utils}/hooks/useTimer.d.ts +0 -0
  610. /package/lib/typescript/{utils → src/utils}/loginHelper.d.ts +0 -0
  611. /package/lib/typescript/{utils → src/utils}/storage.d.ts +0 -0
  612. /package/lib/typescript/{utils → src/utils}/utils.d.ts +0 -0
@@ -1,54 +1,128 @@
1
- import * as SQLite from 'expo-sqlite';
1
+ var _SQLDatabase;
2
+ function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
3
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
4
+ function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
2
5
  import * as DBConfig from './DBConfig';
3
6
  import { isEmptyOrBlank } from '../../utils/utils';
4
7
  import { BaseError } from '../../errors/BaseError';
5
8
  import BaseErrorCodes from '../../errors/ErrorCodes';
6
9
  import Logger, { LOG_TYPE } from '../../utils/Logger';
7
- let dbConnection;
8
- function openDatabase() {
9
- return SQLite.openDatabase(DBConfig.DATABASE_NAME);
10
- }
11
- export function executeQuery(query, args) {
12
- return new Promise((resolve, reject) => {
13
- if (isEmptyOrBlank(query)) {
14
- reject(new BaseError(BaseErrorCodes.InvalidArgumentError, 'SQL Query is null or empty'));
15
- return;
10
+ import { openDatabaseSync } from 'expo-sqlite';
11
+
12
+ // Legacy type for backward compatibility
13
+
14
+ class SQLDatabase {
15
+ constructor() {
16
+ _defineProperty(this, "db", void 0);
17
+ this.db = openDatabaseSync(DBConfig.DATABASE_NAME);
18
+ }
19
+ static getInstance() {
20
+ if (!SQLDatabase.instance) {
21
+ SQLDatabase.instance = new SQLDatabase();
16
22
  }
17
- if (!dbConnection) dbConnection = openDatabase();
18
- dbConnection.transaction(tx => {
19
- tx.executeSql(query, args, (_, sqlResultSet) => {
23
+ return SQLDatabase.instance;
24
+ }
25
+ executeSetDataQuery(query, args) {
26
+ return new Promise((resolve, reject) => {
27
+ if (isEmptyOrBlank(query)) {
28
+ reject(new BaseError(BaseErrorCodes.InvalidArgumentError, 'SQL Query is null or empty'));
29
+ return;
30
+ }
31
+ try {
32
+ const result = this.db.runSync(query, args);
33
+ const sqlResultSet = {
34
+ insertId: result.lastInsertRowId,
35
+ rowsAffected: result.changes,
36
+ rows: {
37
+ _array: [],
38
+ length: 0,
39
+ item: index => null
40
+ }
41
+ };
20
42
  resolve(sqlResultSet);
21
- }, (_, sqlError) => {
22
- reject(sqlError);
23
- return false;
24
- });
43
+ } catch (error) {
44
+ reject(error);
45
+ }
25
46
  });
26
- });
27
- }
28
- export function executeBulkQuery(_queryData) {
29
- return new Promise((resolve, reject) => {
30
- let _sqlResultSet = [];
31
- if (!dbConnection) dbConnection = openDatabase();
32
- dbConnection.transaction(tx => {
33
- _queryData.forEach(_q => {
34
- tx.executeSql(_q.query, _q.args, (_, sqlResultSet) => {
35
- _sqlResultSet.push(sqlResultSet);
36
- // resolve(sqlResultSet);
37
- }
38
- /* (_, sqlError) => {
39
- _sqlError.push(sqlError);
40
- // reject(sqlError);
41
- return false;
42
- } */);
43
- });
44
- }, error => {
45
- Logger.getInstance().logEvent('executeBulkQuery err: ', JSON.stringify(error), LOG_TYPE.SDK_ERROR);
46
- reject(error);
47
- // return false;
48
- }, () => {
49
- Logger.getInstance().logEvent('executeBulkQuery success: ', JSON.stringify(_sqlResultSet), LOG_TYPE.SDK_DEBUG);
50
- resolve(true);
47
+ }
48
+ executeGetDataQuery(query, args) {
49
+ return new Promise((resolve, reject) => {
50
+ if (isEmptyOrBlank(query)) {
51
+ reject(new BaseError(BaseErrorCodes.InvalidArgumentError, 'SQL Query is null or empty'));
52
+ return;
53
+ }
54
+ try {
55
+ const result = this.db.getAllSync(query, args);
56
+ const sqlResultSet = {
57
+ insertId: undefined,
58
+ rowsAffected: 0,
59
+ rows: {
60
+ _array: result,
61
+ length: result.length,
62
+ item: index => result[index] || null
63
+ }
64
+ };
65
+ resolve(sqlResultSet);
66
+ } catch (error) {
67
+ reject(error);
68
+ }
69
+ });
70
+ }
71
+ executeBulkQuery(_queryData) {
72
+ return new Promise(async (resolve, reject) => {
73
+ try {
74
+ await this.db.withExclusiveTransactionAsync(async () => {
75
+ for (const _q of _queryData) {
76
+ this.db.runSync(_q.query, _q.args);
77
+ }
78
+ });
79
+ Logger.getInstance().logEvent('executeBulkQuery success: ', JSON.stringify(_queryData.length + ' queries executed'), LOG_TYPE.SDK_DEBUG);
80
+ resolve(true);
81
+ } catch (error) {
82
+ Logger.getInstance().logEvent('executeBulkQuery err: ', JSON.stringify(error), LOG_TYPE.SDK_ERROR);
83
+ reject(error);
84
+ }
85
+ });
86
+ }
87
+
88
+ /**
89
+ * Executes an array of SQL DML statements.
90
+ *
91
+ * @param {Array<{query: string, args: any[]}>} input - The array of queries to execute.
92
+ * @return {Promise<SQLResultSet>} A promise that resolves with the SQL result set.
93
+ */
94
+ executeStatementsInTxn(input) {
95
+ return new Promise(async (resolve, reject) => {
96
+ if (input.some(_i => isEmptyOrBlank(_i.sqlSmt))) {
97
+ reject(new Error('Statement is null or empty'));
98
+ return;
99
+ }
100
+ try {
101
+ const resultSet = [];
102
+ await this.db.withExclusiveTransactionAsync(async () => {
103
+ for (const item of input) {
104
+ const result = await this.db.runAsync(item.sqlSmt, item.args);
105
+ const sqlResultSet = {
106
+ insertId: result.lastInsertRowId,
107
+ rowsAffected: result.changes,
108
+ rows: {
109
+ _array: [],
110
+ length: 0,
111
+ item: index => null
112
+ }
113
+ };
114
+ resultSet.push(sqlResultSet);
115
+ }
116
+ });
117
+ resolve(resultSet);
118
+ } catch (error) {
119
+ reject(error);
120
+ }
51
121
  });
52
- });
122
+ }
53
123
  }
124
+ _SQLDatabase = SQLDatabase;
125
+ _defineProperty(SQLDatabase, "instance", void 0);
126
+ const Database = SQLDatabase.getInstance();
127
+ export default Database;
54
128
  //# sourceMappingURL=database.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["SQLite","DBConfig","isEmptyOrBlank","BaseError","BaseErrorCodes","Logger","LOG_TYPE","dbConnection","openDatabase","DATABASE_NAME","executeQuery","query","args","Promise","resolve","reject","InvalidArgumentError","transaction","tx","executeSql","_","sqlResultSet","sqlError","executeBulkQuery","_queryData","_sqlResultSet","forEach","_q","push","error","getInstance","logEvent","JSON","stringify","SDK_ERROR","SDK_DEBUG"],"sources":["database.ts"],"sourcesContent":["import * as SQLite from 'expo-sqlite';\nimport * as DBConfig from './DBConfig';\nimport type { SQLResultSet, WebSQLDatabase } from 'expo-sqlite';\nimport { isEmptyOrBlank } from '../../utils/utils';\nimport { BaseError } from '../../errors/BaseError';\nimport BaseErrorCodes from '../../errors/ErrorCodes';\nimport Logger, { LOG_TYPE } from '../../utils/Logger';\n\nlet dbConnection: WebSQLDatabase | null;\n\nfunction openDatabase(): WebSQLDatabase {\n return SQLite.openDatabase(DBConfig.DATABASE_NAME);\n}\n\nexport interface ExecQuery {\n query: string;\n args: any[];\n}\n\nexport function executeQuery(\n query: string,\n args: any[]\n): Promise<SQLResultSet> {\n return new Promise((resolve, reject) => {\n if (isEmptyOrBlank(query)) {\n reject(\n new BaseError(\n BaseErrorCodes.InvalidArgumentError,\n 'SQL Query is null or empty'\n )\n );\n return;\n }\n if (!dbConnection) dbConnection = openDatabase();\n dbConnection.transaction((tx) => {\n tx.executeSql(\n query,\n args,\n (_, sqlResultSet) => {\n resolve(sqlResultSet);\n },\n (_, sqlError) => {\n reject(sqlError);\n return false;\n }\n );\n });\n });\n}\n\nexport function executeBulkQuery(_queryData: ExecQuery[]): Promise<boolean> {\n return new Promise((resolve, reject) => {\n let _sqlResultSet: SQLResultSet[] = [];\n\n if (!dbConnection) dbConnection = openDatabase();\n dbConnection.transaction(\n (tx) => {\n _queryData.forEach((_q) => {\n tx.executeSql(\n _q.query,\n _q.args,\n (_, sqlResultSet) => {\n _sqlResultSet.push(sqlResultSet);\n // resolve(sqlResultSet);\n }\n /* (_, sqlError) => {\n _sqlError.push(sqlError);\n // reject(sqlError);\n return false;\n } */\n );\n });\n },\n (error) => {\n Logger.getInstance().logEvent(\n 'executeBulkQuery err: ',\n JSON.stringify(error),\n LOG_TYPE.SDK_ERROR\n );\n reject(error);\n // return false;\n },\n () => {\n Logger.getInstance().logEvent(\n 'executeBulkQuery success: ',\n JSON.stringify(_sqlResultSet),\n LOG_TYPE.SDK_DEBUG\n );\n resolve(true);\n }\n );\n });\n}\n"],"mappings":"AAAA,OAAO,KAAKA,MAAM,MAAM,aAAa;AACrC,OAAO,KAAKC,QAAQ,MAAM,YAAY;AAEtC,SAASC,cAAc,QAAQ,mBAAmB;AAClD,SAASC,SAAS,QAAQ,wBAAwB;AAClD,OAAOC,cAAc,MAAM,yBAAyB;AACpD,OAAOC,MAAM,IAAIC,QAAQ,QAAQ,oBAAoB;AAErD,IAAIC,YAAmC;AAEvC,SAASC,YAAYA,CA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AAC;IACJ,CAAC,EACAQ,KAAK,IAAK;MACTxB,MAAM,CAACyB,WAAW,CAAC,CAAC,CAACC,QAAQ,CAC3B,wBAAwB,EACxBC,IAAI,CAACC,SAAS,CAACJ,KAAK,CAAC,EACrBvB,QAAQ,CAAC4B,SACX,CAAC;MACDnB,MAAM,CAACc,KAAK,CAAC;MACb;IACF,CAAC,EACD,MAAM;MACJxB,MAAM,CAACyB,WAAW,CAAC,CAAC,CAACC,QAAQ,CAC3B,4BAA4B,EAC5BC,IAAI,CAACC,SAAS,CAACR,aAAa,CAAC,EAC7BnB,QAAQ,CAAC6B,SACX,CAAC;MACDrB,OAAO,CAAC,IAAI,CAAC;IACf,CACF,CAAC;EACH,CAAC,CAAC;AACJ","ignoreList":[]}
1
+ {"version":3,"names":["DBConfig","isEmptyOrBlank","BaseError","BaseErrorCodes","Logger","LOG_TYPE","openDatabaseSync","SQLDatabase","constructor","_defineProperty","db","DATABASE_NAME","getInstance","instance","executeSetDataQuery","query","args","Promise","resolve","reject","InvalidArgumentError","result","runSync","sqlResultSet","insertId","lastInsertRowId","rowsAffected","changes","rows","_array","length","item","index","error","executeGetDataQuery","getAllSync","undefined","executeBulkQuery","_queryData","withExclusiveTransactionAsync","_q","logEvent","JSON","stringify","SDK_DEBUG","SDK_ERROR","executeStatementsInTxn","input","some","_i","sqlSmt","Error","resultSet","runAsync","push","_SQLDatabase","Database"],"sources":["database.ts"],"sourcesContent":["import * as DBConfig from './DBConfig';\nimport { isEmptyOrBlank } from '../../utils/utils';\nimport { BaseError } from '../../errors/BaseError';\nimport BaseErrorCodes from '../../errors/ErrorCodes';\nimport Logger, { LOG_TYPE } from '../../utils/Logger';\nimport type { ExecQuery } from '../../utils/Constants';\nimport { openDatabaseSync, SQLiteDatabase } from 'expo-sqlite';\n\n// Legacy type for backward compatibility\nexport interface SQLResultSet {\n insertId?: number;\n rowsAffected: number;\n rows: {\n _array: any[];\n length: number;\n item: (index: number) => any;\n };\n}\n\n\nclass SQLDatabase {\n private static instance: SQLDatabase;\n private db: SQLiteDatabase;\n\n private constructor() {\n this.db = openDatabaseSync(DBConfig.DATABASE_NAME);\n }\n\n public static getInstance(): SQLDatabase {\n if (!SQLDatabase.instance) {\n SQLDatabase.instance = new SQLDatabase();\n }\n return SQLDatabase.instance;\n }\n\n executeSetDataQuery(query: string, args: any[]): Promise<SQLResultSet> {\n return new Promise((resolve, reject) => {\n if (isEmptyOrBlank(query)) {\n reject(new BaseError( BaseErrorCodes.InvalidArgumentError, 'SQL Query is null or empty'));\n return;\n }\n try {\n const result = this.db.runSync(query, args);\n const sqlResultSet: SQLResultSet = {\n insertId: result.lastInsertRowId,\n rowsAffected: result.changes,\n rows: {\n _array: [],\n length: 0,\n item: (index: number) => null\n }\n };\n resolve(sqlResultSet);\n } catch (error) {\n reject(error);\n }\n });\n }\n\n executeGetDataQuery(query: string, args: any[]): Promise<any> {\n return new Promise((resolve, reject) => {\n if (isEmptyOrBlank(query)) {\n reject(new BaseError( BaseErrorCodes.InvalidArgumentError, 'SQL Query is null or empty'));\n return;\n }\n \n try {\n const result = this.db.getAllSync(query, args);\n const sqlResultSet: SQLResultSet = {\n insertId: undefined,\n rowsAffected: 0,\n rows: {\n _array: result,\n length: result.length,\n item: (index: number) => result[index] || null\n }\n };\n resolve(sqlResultSet);\n } catch (error) {\n reject(error);\n }\n });\n }\n\n executeBulkQuery(_queryData: ExecQuery[]): Promise<boolean> {\n return new Promise(async (resolve, reject) => {\n try {\n await this.db.withExclusiveTransactionAsync(async () => {\n for (const _q of _queryData) {\n this.db.runSync(_q.query, _q.args);\n }\n });\n \n Logger.getInstance().logEvent(\n 'executeBulkQuery success: ',\n JSON.stringify(_queryData.length + ' queries executed'),\n LOG_TYPE.SDK_DEBUG\n );\n resolve(true);\n } catch (error) {\n Logger.getInstance().logEvent(\n 'executeBulkQuery err: ',\n JSON.stringify(error),\n LOG_TYPE.SDK_ERROR\n );\n reject(error);\n }\n });\n }\n\n /**\n * Executes an array of SQL DML statements.\n *\n * @param {Array<{query: string, args: any[]}>} input - The array of queries to execute.\n * @return {Promise<SQLResultSet>} A promise that resolves with the SQL result set.\n */\n executeStatementsInTxn(input: { sqlSmt: string; args: any[] }[]): Promise<SQLResultSet[]> {\n return new Promise(async (resolve, reject) => {\n if (input.some((_i) => isEmptyOrBlank(_i.sqlSmt))) {\n reject(new Error('Statement is null or empty'));\n return;\n }\n\n try {\n const resultSet: SQLResultSet[] = [];\n \n await this.db.withExclusiveTransactionAsync(async () => {\n for (const item of input) {\n const result = await this.db.runAsync(item.sqlSmt, item.args);\n const sqlResultSet: SQLResultSet = {\n insertId: result.lastInsertRowId,\n rowsAffected: result.changes,\n rows: {\n _array: [],\n length: 0,\n item: (index: number) => null\n }\n };\n resultSet.push(sqlResultSet);\n }\n });\n\n resolve(resultSet);\n } catch (error) {\n reject(error);\n }\n });\n }\n}\n\nconst Database = SQLDatabase.getInstance();\nexport default Database;\n"],"mappings":";;;;AAAA,OAAO,KAAKA,QAAQ,MAAM,YAAY;AACtC,SAASC,cAAc,QAAQ,mBAAmB;AAClD,SAASC,SAAS,QAAQ,wBAAwB;AAClD,OAAOC,cAAc,MAAM,yBAAyB;AACpD,OAAOC,MAAM,IAAIC,QAAQ,QAAQ,oBAAoB;AAErD,SAASC,gBAAgB,QAAwB,aAAa;;AAE9D;;AAYA,MAAMC,WAAW,CAAC;EAIRC,WAAWA,CAAA,EAAG;IAAAC,eAAA;IACpB,IAAI,CAACC,EAAE,GAAGJ,gBAAgB,CAACN,QAAQ,CAACW,aAAa,CAAC;EACpD;EAEA,OAAcC,WAAWA,CAAA,EAAgB;IACvC,IAAI,CAACL,WAAW,CAACM,QAAQ,EAAE;MACzBN,WAAW,CAACM,QAAQ,GAAG,IAAIN,WAAW,CAAC,CAAC;IAC1C;IACA,OAAOA,WAAW,CAACM,QAAQ;EAC7B;EAEAC,mBAAmBA,CAACC,KAAa,EAAEC,IAAW,EAAyB;IACrE,OAAO,IAAIC,OAAO,CAAC,CAACC,OAA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yB,GAAG,EAAE;QAEpC,MAAM,IAAI,CAAC1C,EAAE,CAAC6B,6BAA6B,CAAC,YAAY;UACtD,KAAK,MAAMR,IAAI,IAAIgB,KAAK,EAAE;YACxB,MAAM1B,MAAM,GAAG,MAAM,IAAI,CAACX,EAAE,CAAC2C,QAAQ,CAACtB,IAAI,CAACmB,MAAM,EAAEnB,IAAI,CAACf,IAAI,CAAC;YAC7D,MAAMO,YAA0B,GAAG;cACjCC,QAAQ,EAAEH,MAAM,CAACI,eAAe;cAChCC,YAAY,EAAEL,MAAM,CAACM,OAAO;cAC5BC,IAAI,EAAE;gBACJC,MAAM,EAAE,EAAE;gBACVC,MAAM,EAAE,CAAC;gBACTC,IAAI,EAAGC,KAAa,IAAK;cAC3B;YACF,CAAC;YACDoB,SAAS,CAACE,IAAI,CAAC/B,YAAY,CAAC;UAC9B;QACF,CAAC,CAAC;QAEFL,OAAO,CAACkC,SAAS,CAAC;MACpB,CAAC,CAAC,OAAOnB,KAAK,EAAE;QACdd,MAAM,CAACc,KAAK,CAAC;MACf;IACF,CAAC,CAAC;EACJ;AACF;AAACsB,YAAA,GAhIKhD,WAAW;AAAAE,eAAA,CAAXF,WAAW;AAkIjB,MAAMiD,QAAQ,GAAGjD,WAAW,CAACK,WAAW,CAAC,CAAC;AAC1C,eAAe4C,QAAQ","ignoreList":[]}
@@ -4,7 +4,7 @@ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol"
4
4
  function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
5
5
  import { DOCUMENT_COLUMNS, DOCUMENT_TABLE } from '../DBConfig';
6
6
  import { MAX_RETRY_COUNT, PROCESS_MAX_RETRIED_ROWS } from '../constants';
7
- import * as Database from '../database';
7
+ import Database from '../database';
8
8
  export default class DocumentManager {
9
9
  constructor() {}
10
10
  static async getInstance() {
@@ -16,7 +16,7 @@ export default class DocumentManager {
16
16
  return DocumentManager.instance;
17
17
  }
18
18
  async init() {
19
- await Database.executeQuery(`CREATE TABLE IF NOT EXISTS ${DOCUMENT_TABLE} (\
19
+ await Database.executeSetDataQuery(`CREATE TABLE IF NOT EXISTS ${DOCUMENT_TABLE} (\
20
20
  ${DOCUMENT_COLUMNS.ID} INTEGER PRIMARY KEY AUTOINCREMENT,\
21
21
  ${DOCUMENT_COLUMNS.DATA} TEXT,\
22
22
  ${DOCUMENT_COLUMNS.BASE64} INTEGER NOT NULL DEFAULT 0,\
@@ -35,10 +35,10 @@ export default class DocumentManager {
35
35
  ${DOCUMENT_COLUMNS.DESCRIPTION} TEXT);`, []);
36
36
  }
37
37
  async truncateDocumentTable() {
38
- await Database.executeQuery(`DELETE FROM ${DOCUMENT_TABLE};`, []);
38
+ await Database.executeSetDataQuery(`DELETE FROM ${DOCUMENT_TABLE};`, []);
39
39
  }
40
40
  async insertDocument(fmsFolderID, desc, dspID, base64, fileName, fileType, data, filePath, geoTimeStamp, processedFilePath, priority) {
41
- return await Database.executeQuery(`INSERT INTO ${DOCUMENT_TABLE}(\
41
+ return await Database.executeSetDataQuery(`INSERT INTO ${DOCUMENT_TABLE}(\
42
42
  ${DOCUMENT_COLUMNS.DATA},\
43
43
  ${DOCUMENT_COLUMNS.DISPATCH_ID},\
44
44
  ${DOCUMENT_COLUMNS.FMS_FOLDER_ID},\
@@ -54,54 +54,50 @@ export default class DocumentManager {
54
54
  }
55
55
  async getAllDocuments(dispatchID) {
56
56
  if (!dispatchID) {
57
- const resultSet = await Database.executeQuery(`SELECT * FROM ${DOCUMENT_TABLE};`, []);
57
+ const resultSet = await Database.executeGetDataQuery(`SELECT * FROM ${DOCUMENT_TABLE};`, []);
58
58
  return resultSet.rows._array;
59
59
  } else {
60
- const resultSet = await Database.executeQuery(`SELECT * FROM ${DOCUMENT_TABLE}\
60
+ const resultSet = await Database.executeGetDataQuery(`SELECT * FROM ${DOCUMENT_TABLE}\
61
61
  WHERE ${DOCUMENT_COLUMNS.DISPATCH_ID} =?;`, [dispatchID]);
62
62
  return resultSet.rows._array;
63
63
  }
64
64
  }
65
65
  async getAllUnsyncedDocs() {
66
66
  if (PROCESS_MAX_RETRIED_ROWS) {
67
- let resultSet = await Database.executeQuery(`SELECT * from ${DOCUMENT_TABLE}\
68
- WHERE ${DOCUMENT_COLUMNS.SYNCED} = 0;`, []);
67
+ let resultSet = await Database.executeGetDataQuery(`SELECT * from ${DOCUMENT_TABLE} WHERE ${DOCUMENT_COLUMNS.SYNCED} = 0;`, []);
69
68
  return resultSet.rows._array;
70
69
  } else {
71
- let resultSet = await Database.executeQuery(`SELECT * from ${DOCUMENT_TABLE}\
70
+ let resultSet = await Database.executeGetDataQuery(`SELECT * from ${DOCUMENT_TABLE}\
72
71
  WHERE ${DOCUMENT_COLUMNS.SYNCED} = 0 AND ${DOCUMENT_COLUMNS.ATTEMPT_COUNT} < ${MAX_RETRY_COUNT};`, []);
73
72
  return resultSet.rows._array;
74
73
  }
75
74
  }
76
75
  deleteAllSyncedDocuments(dispatchID) {
77
- return Database.executeQuery(`DELETE FROM ${DOCUMENT_TABLE}\
76
+ return Database.executeSetDataQuery(`DELETE FROM ${DOCUMENT_TABLE}\
78
77
  WHERE ${DOCUMENT_COLUMNS.SYNCED} = 1 and ${DOCUMENT_COLUMNS.DISPATCH_ID} = ?;`, [dispatchID]);
79
78
  }
80
79
  async markDocumentSynced(id, fmsID) {
81
80
  if (!id || !fmsID) return;
82
- await Database.executeQuery(`UPDATE ${DOCUMENT_TABLE} SET ${DOCUMENT_COLUMNS.SYNCED} = 1,${DOCUMENT_COLUMNS.FMS_ID} = ? WHERE ${DOCUMENT_COLUMNS.ID} = ?;`, [fmsID, id]);
81
+ await Database.executeSetDataQuery(`UPDATE ${DOCUMENT_TABLE} SET ${DOCUMENT_COLUMNS.SYNCED} = 1,${DOCUMENT_COLUMNS.FMS_ID} = ? WHERE ${DOCUMENT_COLUMNS.ID} = ?;`, [fmsID, id]);
83
82
  }
84
83
 
85
84
  // This function will actualy update the document row with sync and attempt count.
86
85
  async markDocumentSyncedWithAttempt(id, fmsID, attempt, sync) {
87
86
  if (!id) return;
88
- await Database.executeQuery(`UPDATE ${DOCUMENT_TABLE} SET ${DOCUMENT_COLUMNS.SYNCED} = ?,${DOCUMENT_COLUMNS.FMS_ID} = ?,${DOCUMENT_COLUMNS.ATTEMPT_COUNT} = ? WHERE ${DOCUMENT_COLUMNS.ID} = ?;`, [sync, fmsID, attempt, id]);
87
+ await Database.executeSetDataQuery(`UPDATE ${DOCUMENT_TABLE} SET ${DOCUMENT_COLUMNS.SYNCED} = ?,${DOCUMENT_COLUMNS.FMS_ID} = ?,${DOCUMENT_COLUMNS.ATTEMPT_COUNT} = ? WHERE ${DOCUMENT_COLUMNS.ID} = ?;`, [sync, fmsID, attempt, id]);
89
88
  }
90
89
  // 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.
91
90
  async updateProcesedFilePath(id, origialFilePath, processedFilePath) {
92
91
  if (!id || !processedFilePath) return;
93
- await Database.executeQuery(`UPDATE ${DOCUMENT_TABLE} SET ${DOCUMENT_COLUMNS.FILE_PATH} = ?, ${DOCUMENT_COLUMNS.PROCESSED_FILE_PATH} = ? WHERE ${DOCUMENT_COLUMNS.ID} = ?;`, [origialFilePath, processedFilePath, id]);
92
+ await Database.executeSetDataQuery(`UPDATE ${DOCUMENT_TABLE} SET ${DOCUMENT_COLUMNS.FILE_PATH} = ?, ${DOCUMENT_COLUMNS.PROCESSED_FILE_PATH} = ? WHERE ${DOCUMENT_COLUMNS.ID} = ?;`, [origialFilePath, processedFilePath, id]);
94
93
  }
95
94
  async updateDocSyncError(id, uploadError) {
96
95
  if (!id) throw new TypeError('Document ID cannot be null');
97
- await Database.executeQuery(`UPDATE ${DOCUMENT_TABLE}\
98
- SET \
99
- ${DOCUMENT_COLUMNS.SYNC_ERROR} = ?\
100
- WHERE ${DOCUMENT_COLUMNS.ID} = ?;`, [uploadError, id]);
96
+ await Database.executeSetDataQuery(`UPDATE ${DOCUMENT_TABLE} SET ${DOCUMENT_COLUMNS.SYNC_ERROR} = ? WHERE ${DOCUMENT_COLUMNS.ID} = ?;`, [uploadError, id]);
101
97
  }
102
98
  async updateDocPriority(id, priority) {
103
99
  if (!id) throw new TypeError('Document ID cannot be null');
104
- await Database.executeQuery(`UPDATE ${DOCUMENT_TABLE}\
100
+ await Database.executeSetDataQuery(`UPDATE ${DOCUMENT_TABLE}\
105
101
  SET \
106
102
  ${DOCUMENT_COLUMNS.PRIORITY} = ?\
107
103
  WHERE ${DOCUMENT_COLUMNS.ID} = ?;`, [priority, id]);
@@ -109,12 +105,12 @@ export default class DocumentManager {
109
105
  async getUnsyncedDocument() {
110
106
  // 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.
111
107
  if (PROCESS_MAX_RETRIED_ROWS) {
112
- let rs = await Database.executeQuery(`SELECT * from ${DOCUMENT_TABLE}\
108
+ let rs = await Database.executeGetDataQuery(`SELECT * from ${DOCUMENT_TABLE}\
113
109
  WHERE ${DOCUMENT_COLUMNS.SYNCED} = 0 \
114
110
  ORDER BY ${DOCUMENT_COLUMNS.PRIORITY} ASC LIMIT 1;`, []);
115
111
  return rs.rows._array;
116
112
  } else {
117
- let rs = await Database.executeQuery(`SELECT * from ${DOCUMENT_TABLE}\
113
+ let rs = await Database.executeGetDataQuery(`SELECT * from ${DOCUMENT_TABLE}\
118
114
  WHERE ${DOCUMENT_COLUMNS.SYNCED} = 0 AND ${DOCUMENT_COLUMNS.ATTEMPT_COUNT} < ${MAX_RETRY_COUNT} \
119
115
  ORDER BY ${DOCUMENT_COLUMNS.PRIORITY} ASC LIMIT 1;`, []);
120
116
  return rs.rows._array;
@@ -1 +1 @@
1
- {"version":3,"names":["DOCUMENT_COLUMNS","DOCUMENT_TABLE","MAX_RETRY_COUNT","PROCESS_MAX_RETRIED_ROWS","Database","DocumentManager","constructor","getInstance","instance","managerInstance","init","executeQuery","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","deleteAllSyncedDocuments","markDocumentSynced","id","fmsID","markDocumentSyncedWithAttempt","attempt","sync","updateProcesedFilePath","origialFilePath","updateDocSyncError","uploadError","TypeError","updateDocPriority","getUnsyncedDocument","rs","_DocumentManager","_defineProperty"],"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,SAASA,gBAAgB,EAAEC,cAAc,QAAqB,aAAa;AAC3E,SAASC,eAAe,EAAEC,wBAAwB,QAAQ,cAAc;AACxE,OAAO,KAAKC,QAAQ,MAAM,aAAa;AAGvC,eAAe,MAAMC,eAAe,CAAC;EAG3BC,WAAWA,CAAA,EAAG,CAAE;EAExB,aAAoBC,WAAWA,CAAA,EAA6B;IAC1D,IAAI,CAACF,eAAe,CAACG,QAAQ,EAAE;MAC7B,IAAIC,eAAe,GAAG,IAAIJ,eAAe,CAAC,CAAC;MAC3C,MAAMI,eAAe,CAACC,IAAI,CAAC,CAAC;MAC5BL,eAAe,CAACG,QAAQ,GAAGC,eAAe;IAC5C;IACA,OAAOJ,eAAe,CAACG,QAAQ;EACjC;EAEA,MAAaE,IAAIA,CAAA,EAAkB;IACjC,MAAMN,QAAQ,CAACO,YAAY,CACzB,8BAA8BV,cAAc;AAClD,sBAAsBD,gBAAgB,CAACY,EAAE;AACzC,sBAAsBZ,gBAAgB,CAACa,IAAI;AAC3C,sBAAsBb,gBAAgB,CAACc,MAAM;AAC7C,sBAAsBd,gBAAgB,CAACe,SAAS;AAChD,sBAAsBf,gBAAgB,CAACgB,WAAW;AAClD,sBAAsBhB,gBAAgB,CAACiB,SAAS;AAChD,sBAAsBjB,gBAAgB,CAACkB,SA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;AAC9B;AACA,cAAcD,gBAAgB,CAACuB,UAAU;AACzC,oBAAoBvB,gBAAgB,CAACY,EAAE,OAAO,EACxC,CAAC6C,WAAW,EAAER,EAAE,CAClB,CAAC;EACH;EAEA,MAAaU,iBAAiBA,CAC5BV,EAAU,EACVT,QAAgB,EACD;IACf,IAAI,CAACS,EAAE,EAAE,MAAM,IAAIS,SAAS,CAAC,4BAA4B,CAAC;IAC1D,MAAMtD,QAAQ,CAACO,YAAY,CACzB,UAAUV,cAAc;AAC9B;AACA,cAAcD,gBAAgB,CAACsB,QAAQ;AACvC,oBAAoBtB,gBAAgB,CAACY,EAAE,OAAO,EACxC,CAAC4B,QAAQ,EAAES,EAAE,CACf,CAAC;EACH;EAGA,MAAaW,mBAAmBA,CAAA,EAA2B;IACzD;IACA,IAAIzD,wBAAwB,EAAE;MAC5B,IAAI0D,EAAE,GAAG,MAAMzD,QAAQ,CAACO,YAAY,CAClC,iBAAiBV,cAAc;AACvC,sBAAsBD,gBAAgB,CAACmB,MAAM;AAC7C,yBAAyBnB,gBAAgB,CAACsB,QAAQ,eAAe,EACzD,EACF,CAAC;MACD,OAAOuC,EAAE,CAACjB,IAAI,CAACC,MAAM;IACvB,CAAC,MAAM;MACL,IAAIgB,EAAE,GAAG,MAAMzD,QAAQ,CAACO,YAAY,CAClC,iBAAiBV,cAAc;AACvC,sBAAsBD,gBAAgB,CAACmB,MAAM,YAAYnB,gBAAgB,CAACwB,aAAa,MAAMtB,eAAe;AAC5G,yBAAyBF,gBAAgB,CAACsB,QAAQ,eAAe,EACzD,EACF,CAAC;MACD,OAAOuC,EAAE,CAACjB,IAAI,CAACC,MAAM;IACvB;EACF;AACF;AAACiB,gBAAA,GAlNoBzD,eAAe;AAAA0D,eAAA,CAAf1D,eAAe","ignoreList":[]}
1
+ {"version":3,"names":["DOCUMENT_COLUMNS","DOCUMENT_TABLE","MAX_RETRY_COUNT","PROCESS_MAX_RETRIED_ROWS","Database","DocumentManager","constructor","getInstance","instance","managerInstance","init","executeSetDataQuery","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","deleteAllSyncedDocuments","markDocumentSynced","id","fmsID","markDocumentSyncedWithAttempt","attempt","sync","updateProcesedFilePath","origialFilePath","updateDocSyncError","uploadError","TypeError","updateDocPriority","getUnsyncedDocument","rs","_DocumentManager","_defineProperty"],"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,SAASA,gBAAgB,EAAEC,cAAc,QAAqB,aAAa;AAC3E,SAASC,eAAe,EAAEC,wBAAwB,QAAQ,cAAc;AACxE,OAAOC,QAAQ,MAAM,aAAa;AAElC,eAAe,MAAMC,eAAe,CAAC;EAG3BC,WAAWA,CAAA,EAAG,CAAE;EAExB,aAAoBC,WAAWA,CAAA,EAA6B;IAC1D,IAAI,CAACF,eAAe,CAACG,QAAQ,EAAE;MAC7B,IAAIC,eAAe,GAAG,IAAIJ,eAAe,CAAC,CAAC;MAC3C,MAAMI,eAAe,CAACC,IAAI,CAAC,CAAC;MAC5BL,eAAe,CAACG,QAAQ,GAAGC,eAAe;IAC5C;IACA,OAAOJ,eAAe,CAACG,QAAQ;EACjC;EAEA,MAAaE,IAAIA,CAAA,EAAkB;IACjC,MAAMN,QAAQ,CAACO,mBAAmB,CAChC,8BAA8BV,cAAc;AAClD,sBAAsBD,gBAAgB,CAACY,EAAE;AACzC,sBAAsBZ,gBAAgB,CAACa,IAAI;AAC3C,sBAAsBb,gBAAgB,CAACc,MAAM;AAC7C,sBAAsBd,gBAAgB,CAACe,SAAS;AAChD,sBAAsBf,gBAAgB,CAACgB,WAAW;AAClD,sBAAsBhB,gBAAgB,CAACiB,SAAS;AAChD,sBAAsBjB,gBAAgB,CAACkB,SAAS;AAChD,sBAAsBlB,gBAAgB,CAACmB,MAAM;AA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uB,UAAU,cAAcvB,gBAAgB,CAACY,EAAE,OAAO,EACnG,CAAC8C,WAAW,EAAER,EAAE,CAClB,CAAC;EACH;EAEA,MAAaU,iBAAiBA,CAC5BV,EAAU,EACVV,QAAgB,EACD;IACf,IAAI,CAACU,EAAE,EAAE,MAAM,IAAIS,SAAS,CAAC,4BAA4B,CAAC;IAC1D,MAAMvD,QAAQ,CAACO,mBAAmB,CAChC,UAAUV,cAAc;AAC9B;AACA,cAAcD,gBAAgB,CAACsB,QAAQ;AACvC,oBAAoBtB,gBAAgB,CAACY,EAAE,OAAO,EACxC,CAAC4B,QAAQ,EAAEU,EAAE,CACf,CAAC;EACH;EAGA,MAAaW,mBAAmBA,CAAA,EAA2B;IACzD;IACA,IAAI1D,wBAAwB,EAAE;MAC5B,IAAI2D,EAAE,GAAG,MAAM1D,QAAQ,CAACwC,mBAAmB,CACzC,iBAAiB3C,cAAc;AACvC,sBAAsBD,gBAAgB,CAACmB,MAAM;AAC7C,yBAAyBnB,gBAAgB,CAACsB,QAAQ,eAAe,EACzD,EACF,CAAC;MACD,OAAOwC,EAAE,CAACjB,IAAI,CAACC,MAAM;IACvB,CAAC,MAAM;MACL,IAAIgB,EAAE,GAAG,MAAM1D,QAAQ,CAACwC,mBAAmB,CACzC,iBAAiB3C,cAAc;AACvC,sBAAsBD,gBAAgB,CAACmB,MAAM,YAAYnB,gBAAgB,CAACwB,aAAa,MAAMtB,eAAe;AAC5G,yBAAyBF,gBAAgB,CAACsB,QAAQ,eAAe,EACzD,EACF,CAAC;MACD,OAAOwC,EAAE,CAACjB,IAAI,CAACC,MAAM;IACvB;EACF;AACF;AAACiB,gBAAA,GA9MoB1D,eAAe;AAAA2D,eAAA,CAAf3D,eAAe","ignoreList":[]}
@@ -301,88 +301,98 @@ export default class DocumentSyncManager {
301
301
 
302
302
  // This function will generate overlay base64 data and update documents table for processed_file_path columns with overlayed base64 data.
303
303
  async processBase64Data(documentRow) {
304
+ let cta = 'processBase64Data-started';
305
+ let extra = {
306
+ msg: 'processBase64Data-started',
307
+ fName: documentRow.file_name && documentRow.file_name.length != 0 ? documentRow.file_name.substring(4) : '',
308
+ dName: documentRow.fms_folder_id && documentRow.fms_folder_id.length != 0 ? documentRow.fms_folder_id.substring(4) : '',
309
+ dispId: documentRow.dispatch_id && documentRow.dispatch_id.length != 0 ? documentRow.dispatch_id.substring(9) : ''
310
+ };
304
311
  if (documentRow.processed_file_path === null || documentRow.processed_file_path === '') {
305
- let cta = 'processBase64Data-started';
306
- let extra = {
307
- msg: 'processBase64Data-started',
308
- fName: documentRow.file_name && documentRow.file_name.length != 0 ? documentRow.file_name.substring(4) : '',
309
- dName: documentRow.fms_folder_id && documentRow.fms_folder_id.length != 0 ? documentRow.fms_folder_id.substring(4) : '',
310
- dispId: documentRow.dispatch_id && documentRow.dispatch_id.length != 0 ? documentRow.dispatch_id.substring(9) : ''
311
- };
312
- fireEventWithScreenName({
313
- severityLevel: SeverityLevelValue.LOG,
314
- eventName: SentryEventNameSdkConstants.APP_LOG,
315
- screenName: cta,
316
- cta: cta,
317
- extraParams: extra
318
- });
319
- Logger.getInstance().logEvent(cta, flattenObject(extra), LOG_TYPE.SDK_ERROR);
320
312
  let filePath = '';
321
- // If templrary base 64 file already exist then do not create again
322
- if (documentRow.file_path === null || documentRow.file_path === '') {
323
- const imagePath = `${RNFS.TemporaryDirectoryPath}/${documentRow.file_name}`;
324
- await RNFS.writeFile(imagePath, documentRow.data, 'base64'); // Write file to temprary location
325
- filePath = imagePath;
326
- // If file generated frommbase64 data does not have file:// then we are adding manually.
327
- if (!imagePath.includes('file')) {
328
- filePath = `file://${imagePath}`;
313
+ try {
314
+ fireEventWithScreenName({
315
+ severityLevel: SeverityLevelValue.LOG,
316
+ eventName: SentryEventNameSdkConstants.APP_LOG,
317
+ screenName: cta,
318
+ cta: cta,
319
+ extraParams: extra
320
+ });
321
+ Logger.getInstance().logEvent(cta, flattenObject(extra), LOG_TYPE.SDK_ERROR);
322
+
323
+ // If templrary base 64 file already exist then do not create again
324
+ if (documentRow.file_path === null || documentRow.file_path === '') {
325
+ const imagePath = `${RNFS.TemporaryDirectoryPath}/${documentRow.file_name}`;
326
+ await RNFS.writeFile(imagePath, documentRow.data, 'base64'); // Write file to temprary location
327
+ filePath = imagePath;
328
+ // If file generated frommbase64 data does not have file:// then we are adding manually.
329
+ if (!imagePath.includes('file')) {
330
+ filePath = `file://${imagePath}`;
331
+ }
332
+ documentRow.file_path = filePath;
333
+ } else {
334
+ filePath = documentRow.file_path;
329
335
  }
330
- documentRow.file_path = filePath;
331
- } else {
332
- filePath = documentRow.file_path;
333
- }
334
- let pFilePath = 'processed_' + documentRow.file_name; // File name for processed file.
335
- let strGeoStamp = documentRow.geo_timestamp; // Saved geostamp string
336
- let objGeoStamp = JSON.parse(strGeoStamp); // Conversion to geostamp object
337
- let dateTime = objGeoStamp.dateTime; // Date time stamp in UTC format
338
- let lat = objGeoStamp.lat; // Latitide
339
- let lng = objGeoStamp.lng; // Longitude
340
- let accuracy = objGeoStamp.accuracy; // Location accuracy
341
- let strDMS = latlngToDms(`${lat}, ${lng}`); // Location in degree format
342
- let strDMSWithAccuracy = strDMS;
343
- if (accuracy !== '') {
344
- strDMSWithAccuracy = strDMS + ' (Accuracy: ' + accuracy + 'm)'; // Appedning accuracy in location
345
- }
346
- const options = {
347
- backgroundImage: {
348
- src: filePath,
349
- // Image for overlay
350
- scale: 1
351
- },
352
- watermarkTexts: [{
353
- text: `${dateTime}\n${strDMSWithAccuracy}`,
354
- // Ooverlay text
355
- position: {
356
- position: Position.topLeft // Overlay text position
336
+ let pFilePath = 'processed_' + documentRow.file_name; // File name for processed file.
337
+ let strGeoStamp = documentRow.geo_timestamp; // Saved geostamp string
338
+ let objGeoStamp = JSON.parse(strGeoStamp); // Conversion to geostamp object
339
+ let dateTime = objGeoStamp.dateTime; // Date time stamp in UTC format
340
+ let lat = objGeoStamp.lat; // Latitide
341
+ let lng = objGeoStamp.lng; // Longitude
342
+ let accuracy = objGeoStamp.accuracy; // Location accuracy
343
+ let strDMS = latlngToDms(`${lat}, ${lng}`); // Location in degree format
344
+ let strDMSWithAccuracy = strDMS;
345
+ if (accuracy !== '') {
346
+ strDMSWithAccuracy = strDMS + ' (Accuracy: ' + accuracy + 'm)'; // Appedning accuracy in location
347
+ }
348
+ const options = {
349
+ backgroundImage: {
350
+ src: filePath,
351
+ // Image for overlay
352
+ scale: 1
357
353
  },
358
- style: {
359
- // Style for overlay
360
- color: '#ffffff',
361
- fontSize: 14,
362
- fontName: 'Arial',
363
- textBackgroundStyle: {
364
- padding: '1% 1%',
365
- type: TextBackgroundType.none,
366
- color: '#444444CC'
354
+ watermarkTexts: [{
355
+ text: `${dateTime}\n${strDMSWithAccuracy}`,
356
+ // Ooverlay text
357
+ position: {
358
+ position: Position.topLeft // Overlay text position
359
+ },
360
+ style: {
361
+ // Style for overlay
362
+ color: '#ffffff',
363
+ fontSize: 14,
364
+ fontName: 'Arial',
365
+ textBackgroundStyle: {
366
+ padding: '1% 1%',
367
+ type: TextBackgroundType.none,
368
+ color: '#444444CC'
369
+ }
367
370
  }
368
- }
369
- }],
370
- scale: 1,
371
- quality: 100,
372
- filename: pFilePath,
373
- saveFormat: ImageFormat.base64 // Saving in base6 format
374
- };
375
- let processedBase64 = await Marker.markText(options); // Generating overlay image
376
- if (processedBase64 !== null && processedBase64 !== '') {
377
- // Fetching base64 data from processed data.
378
- var splittedDase64Data = processedBase64.split('data:image/png;base64,');
379
- // Updating document document table with overlayed base64 data
380
- await this.updateDocumentProcessedPath(documentRow, filePath, splittedDase64Data[1]);
381
- documentRow.processed_file_path = splittedDase64Data[1];
371
+ }],
372
+ scale: 1,
373
+ quality: 100,
374
+ filename: pFilePath,
375
+ saveFormat: ImageFormat.base64 // Saving in base6 format
376
+ };
377
+ let processedBase64 = await Marker.markText(options); // Generating overlay image
378
+ if (processedBase64 !== null && processedBase64 !== '') {
379
+ // Fetching base64 data from processed data.
380
+ var splittedDase64Data = processedBase64.split('data:image/png;base64,');
381
+ // Updating document document table with overlayed base64 data
382
+ await this.updateDocumentProcessedPath(documentRow, filePath, splittedDase64Data[1]);
383
+ documentRow.processed_file_path = splittedDase64Data[1];
384
+ }
385
+ } catch (error) {
386
+ console.log('====================================');
387
+ console.log('processBase64Data-error:', error);
388
+ console.log('====================================');
389
+ // Updating document document table with original base64 data
390
+ await this.updateDocumentProcessedPath(documentRow, filePath, filePath);
391
+ documentRow.processed_file_path = "";
382
392
  }
383
393
  }
384
- let cta = 'processBase64Data-completed';
385
- let extra = {
394
+ cta = 'processBase64Data-completed';
395
+ extra = {
386
396
  msg: 'processBase64Data-completed',
387
397
  fName: documentRow.file_name && documentRow.file_name.length != 0 ? documentRow.file_name.substring(4) : '',
388
398
  dName: documentRow.fms_folder_id && documentRow.fms_folder_id.length != 0 ? documentRow.fms_folder_id.substring(4) : '',