@os1-platform/dispatch-mobile 2.1.7 → 2.1.9

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 (546) hide show
  1. package/lib/commonjs/@types/assets/index.d.js.map +1 -1
  2. package/lib/commonjs/analytics/firebase/FirebaseLogging.js.map +1 -1
  3. package/lib/commonjs/analytics/sentry/SentryAnalyticsSingleton.js +4 -4
  4. package/lib/commonjs/analytics/sentry/SentryAnalyticsSingleton.js.map +1 -1
  5. package/lib/commonjs/analytics/sentry/SentryAnalyticsUtils.js +8 -9
  6. package/lib/commonjs/analytics/sentry/SentryAnalyticsUtils.js.map +1 -1
  7. package/lib/commonjs/analytics/sentry/SentryModels.js.map +1 -1
  8. package/lib/commonjs/analytics/sentry/SentrySdkConstants.js +2 -0
  9. package/lib/commonjs/analytics/sentry/SentrySdkConstants.js.map +1 -1
  10. package/lib/commonjs/components/dispatch/DispatchExecNavigator.js +4 -5
  11. package/lib/commonjs/components/dispatch/DispatchExecNavigator.js.map +1 -1
  12. package/lib/commonjs/components/executiontasks/CompletedWFSchema.js.map +1 -1
  13. package/lib/commonjs/components/executiontasks/ExecutionTasksIndex.js.map +1 -1
  14. package/lib/commonjs/components/executiontasks/cancellation/CancelET.js +7 -9
  15. package/lib/commonjs/components/executiontasks/cancellation/CancelET.js.map +1 -1
  16. package/lib/commonjs/components/executiontasks/cancellation/CancellationSchema.js.map +1 -1
  17. package/lib/commonjs/components/executiontasks/captureInput/CaptureInputSchema.js.map +1 -1
  18. package/lib/commonjs/components/executiontasks/captureInput/CaptureText.js +1 -1
  19. package/lib/commonjs/components/executiontasks/captureInput/CaptureText.js.map +1 -1
  20. package/lib/commonjs/components/executiontasks/captureInput/utils.js.map +1 -1
  21. package/lib/commonjs/components/executiontasks/deliver/DeliverET.js +14 -20
  22. package/lib/commonjs/components/executiontasks/deliver/DeliverET.js.map +1 -1
  23. package/lib/commonjs/components/executiontasks/deliver/DeliverETInput.js.map +1 -1
  24. package/lib/commonjs/components/executiontasks/deliver/SLDeliverET.js +15 -21
  25. package/lib/commonjs/components/executiontasks/deliver/SLDeliverET.js.map +1 -1
  26. package/lib/commonjs/components/executiontasks/display/DisplayModalET.js +1 -1
  27. package/lib/commonjs/components/executiontasks/display/DisplayModalET.js.map +1 -1
  28. package/lib/commonjs/components/executiontasks/display/DisplaySchema.js.map +1 -1
  29. package/lib/commonjs/components/executiontasks/doodle/SignatureET.js +1 -2
  30. package/lib/commonjs/components/executiontasks/doodle/SignatureET.js.map +1 -1
  31. package/lib/commonjs/components/executiontasks/doodle/SignatureSchema.js.map +1 -1
  32. package/lib/commonjs/components/executiontasks/dropCash/DropCashET.js +1 -1
  33. package/lib/commonjs/components/executiontasks/dropCash/DropCashET.js.map +1 -1
  34. package/lib/commonjs/components/executiontasks/dropCash/DropCashSchema.js.map +1 -1
  35. package/lib/commonjs/components/executiontasks/dropCash/SLDropCash.js +1 -1
  36. package/lib/commonjs/components/executiontasks/dropCash/SLDropCash.js.map +1 -1
  37. package/lib/commonjs/components/executiontasks/forms/FormGenerator.js +1 -1
  38. package/lib/commonjs/components/executiontasks/forms/FormGenerator.js.map +1 -1
  39. package/lib/commonjs/components/executiontasks/forms/FormSchema.js.map +1 -1
  40. package/lib/commonjs/components/executiontasks/forms/widgets/DateTimeWidget.js +12 -13
  41. package/lib/commonjs/components/executiontasks/forms/widgets/DateTimeWidget.js.map +1 -1
  42. package/lib/commonjs/components/executiontasks/forms/widgets/DropdownWidget.js +1 -1
  43. package/lib/commonjs/components/executiontasks/forms/widgets/DropdownWidget.js.map +1 -1
  44. package/lib/commonjs/components/executiontasks/forms/widgets/QRBarcodeScannerWidget.js +10 -11
  45. package/lib/commonjs/components/executiontasks/forms/widgets/QRBarcodeScannerWidget.js.map +1 -1
  46. package/lib/commonjs/components/executiontasks/forms/widgets/TimeRangeSelector.js +1 -1
  47. package/lib/commonjs/components/executiontasks/forms/widgets/TimeRangeSelector.js.map +1 -1
  48. package/lib/commonjs/components/executiontasks/httpRequest/HttpEtUtils.js.map +1 -1
  49. package/lib/commonjs/components/executiontasks/httpRequest/HttpRequestET.js +1 -1
  50. package/lib/commonjs/components/executiontasks/httpRequest/HttpRequestET.js.map +1 -1
  51. package/lib/commonjs/components/executiontasks/httpRequest/HttpRequestETSchema.js.map +1 -1
  52. package/lib/commonjs/components/executiontasks/imageCapture/CaptureSchema.js.map +1 -1
  53. package/lib/commonjs/components/executiontasks/imageCapture/CaptureUtils.js +2 -5
  54. package/lib/commonjs/components/executiontasks/imageCapture/CaptureUtils.js.map +1 -1
  55. package/lib/commonjs/components/executiontasks/imageCapture/ImageCapture.js +10 -12
  56. package/lib/commonjs/components/executiontasks/imageCapture/ImageCapture.js.map +1 -1
  57. package/lib/commonjs/components/executiontasks/payments/PaymentStyles.js.map +1 -1
  58. package/lib/commonjs/components/executiontasks/payments/PaymentUtils.js.map +1 -1
  59. package/lib/commonjs/components/executiontasks/payments/completePayment/CompletePaymentET.js +1 -1
  60. package/lib/commonjs/components/executiontasks/payments/completePayment/CompletePaymentET.js.map +1 -1
  61. package/lib/commonjs/components/executiontasks/payments/completePayment/CompletePaymentSchema.js.map +1 -1
  62. package/lib/commonjs/components/executiontasks/payments/init/InitPaymentET.js +4 -5
  63. package/lib/commonjs/components/executiontasks/payments/init/InitPaymentET.js.map +1 -1
  64. package/lib/commonjs/components/executiontasks/payments/init/InitPaymentSchema.js.map +1 -1
  65. package/lib/commonjs/components/executiontasks/payments/processPayment/ProcessPaymentET.js +1 -1
  66. package/lib/commonjs/components/executiontasks/payments/processPayment/ProcessPaymentET.js.map +1 -1
  67. package/lib/commonjs/components/executiontasks/payments/processPayment/ProcessPaymentSchema.js.map +1 -1
  68. package/lib/commonjs/components/executiontasks/pickup/PickpSchema.js.map +1 -1
  69. package/lib/commonjs/components/executiontasks/pickup/PickupET.js +14 -20
  70. package/lib/commonjs/components/executiontasks/pickup/PickupET.js.map +1 -1
  71. package/lib/commonjs/components/executiontasks/pickup/SLPickupET.js +15 -21
  72. package/lib/commonjs/components/executiontasks/pickup/SLPickupET.js.map +1 -1
  73. package/lib/commonjs/components/executiontasks/scan/ScanET.js +2 -4
  74. package/lib/commonjs/components/executiontasks/scan/ScanET.js.map +1 -1
  75. package/lib/commonjs/components/executiontasks/scan/ScanSchema.js.map +1 -1
  76. package/lib/commonjs/components/executiontasks/scan/constants.js.map +1 -1
  77. package/lib/commonjs/components/executiontasks/scan/interfaces.js.map +1 -1
  78. package/lib/commonjs/components/executiontasks/scan/modalConstant.js.map +1 -1
  79. package/lib/commonjs/components/executiontasks/scan/sub_components/CScanner.js +4 -5
  80. package/lib/commonjs/components/executiontasks/scan/sub_components/CScanner.js.map +1 -1
  81. package/lib/commonjs/components/executiontasks/scan/sub_components/DropDownUtils.js +0 -1
  82. package/lib/commonjs/components/executiontasks/scan/sub_components/DropDownUtils.js.map +1 -1
  83. package/lib/commonjs/components/executiontasks/scan/sub_components/ERDropDown.js +1 -3
  84. package/lib/commonjs/components/executiontasks/scan/sub_components/ERDropDown.js.map +1 -1
  85. package/lib/commonjs/components/executiontasks/scan/sub_components/SummaryPage.js +2 -5
  86. package/lib/commonjs/components/executiontasks/scan/sub_components/SummaryPage.js.map +1 -1
  87. package/lib/commonjs/components/executiontasks/scan/utils.js +1 -1
  88. package/lib/commonjs/components/executiontasks/scan/utils.js.map +1 -1
  89. package/lib/commonjs/components/executiontasks/validateOTP/ValidateOTPET.js +1 -1
  90. package/lib/commonjs/components/executiontasks/validateOTP/ValidateOTPET.js.map +1 -1
  91. package/lib/commonjs/components/executiontasks/validateOTP/ValidateOTPSchema.js.map +1 -1
  92. package/lib/commonjs/components/executiontasks/validateOTP/constants.js.map +1 -1
  93. package/lib/commonjs/components/executiontasks/validateOTP/sub-components/OTPInput.js +1 -1
  94. package/lib/commonjs/components/executiontasks/validateOTP/sub-components/OTPInput.js.map +1 -1
  95. package/lib/commonjs/components/executiontasks/validateOTP/utils.js +1 -1
  96. package/lib/commonjs/components/executiontasks/validateOTP/utils.js.map +1 -1
  97. package/lib/commonjs/components/executiontasks/verifyInput/VerifyInputSchema.js.map +1 -1
  98. package/lib/commonjs/components/executiontasks/verifyLocation/GeofenceUtils.js +1 -1
  99. package/lib/commonjs/components/executiontasks/verifyLocation/GeofenceUtils.js.map +1 -1
  100. package/lib/commonjs/components/executiontasks/verifyLocation/VerifyLocSchema.js.map +1 -1
  101. package/lib/commonjs/components/executiontasks/verifyLocation/VerifyLocationET.js +1 -1
  102. package/lib/commonjs/components/executiontasks/verifyLocation/VerifyLocationET.js.map +1 -1
  103. package/lib/commonjs/components/executiontasks/verifyOtp/VerifyOtpET.js +1 -1
  104. package/lib/commonjs/components/executiontasks/verifyOtp/VerifyOtpET.js.map +1 -1
  105. package/lib/commonjs/components/executiontasks/verifyOtp/VerifyOtpSchema.js.map +1 -1
  106. package/lib/commonjs/components/utils/index.js.map +1 -1
  107. package/lib/commonjs/components/widgets/AlertDisplay.js +1 -1
  108. package/lib/commonjs/components/widgets/AlertDisplay.js.map +1 -1
  109. package/lib/commonjs/components/widgets/CancelOrderDialog.js +1 -1
  110. package/lib/commonjs/components/widgets/CancelOrderDialog.js.map +1 -1
  111. package/lib/commonjs/components/widgets/Card.js +0 -1
  112. package/lib/commonjs/components/widgets/Card.js.map +1 -1
  113. package/lib/commonjs/components/widgets/GoBackModal.js.map +1 -1
  114. package/lib/commonjs/components/widgets/IconButton.js +19 -22
  115. package/lib/commonjs/components/widgets/IconButton.js.map +1 -1
  116. package/lib/commonjs/components/widgets/ModalWidget.js.map +1 -1
  117. package/lib/commonjs/components/widgets/ProgressDialog.js.map +1 -1
  118. package/lib/commonjs/components/widgets/SearchBar.js.map +1 -1
  119. package/lib/commonjs/components/widgets/SnackBarCustom.js +15 -18
  120. package/lib/commonjs/components/widgets/SnackBarCustom.js.map +1 -1
  121. package/lib/commonjs/components/widgets/SplitTextInput.js +9 -10
  122. package/lib/commonjs/components/widgets/SplitTextInput.js.map +1 -1
  123. package/lib/commonjs/components/widgets/TabsComponent.js +1 -1
  124. package/lib/commonjs/components/widgets/TabsComponent.js.map +1 -1
  125. package/lib/commonjs/components/widgets/Toaster.js.map +1 -1
  126. package/lib/commonjs/config/DispatchSDKConfig.js.map +1 -1
  127. package/lib/commonjs/constants/apiConstants.js.map +1 -1
  128. package/lib/commonjs/constants/constants.js.map +1 -1
  129. package/lib/commonjs/constants/statuscode.js.map +1 -1
  130. package/lib/commonjs/errors/BaseError.js +2 -2
  131. package/lib/commonjs/errors/BaseError.js.map +1 -1
  132. package/lib/commonjs/errors/ErrorCodes.js.map +1 -1
  133. package/lib/commonjs/events/EventDispatcher.js.map +1 -1
  134. package/lib/commonjs/events/EventListener.js.map +1 -1
  135. package/lib/commonjs/events/constants.js.map +1 -1
  136. package/lib/commonjs/events/index.js.map +1 -1
  137. package/lib/commonjs/events/interface.js.map +1 -1
  138. package/lib/commonjs/icons/ScanIcon.js.map +1 -1
  139. package/lib/commonjs/icons/file.js.map +1 -1
  140. package/lib/commonjs/icons/interface.js.map +1 -1
  141. package/lib/commonjs/index.js +1 -1
  142. package/lib/commonjs/index.js.map +1 -1
  143. package/lib/commonjs/locale/Str.js.map +1 -1
  144. package/lib/commonjs/locale/i18n.js.map +1 -1
  145. package/lib/commonjs/locale/util.js.map +1 -1
  146. package/lib/commonjs/manager/dispatch/DispatchStateContainer.js +5 -5
  147. package/lib/commonjs/manager/dispatch/DispatchStateContainer.js.map +1 -1
  148. package/lib/commonjs/manager/dispatchCodes/EventCodeContainer.js +4 -4
  149. package/lib/commonjs/manager/dispatchCodes/EventCodeContainer.js.map +1 -1
  150. package/lib/commonjs/manager/dispatchCodes/EventCodeRepo.js +5 -5
  151. package/lib/commonjs/manager/dispatchCodes/EventCodeRepo.js.map +1 -1
  152. package/lib/commonjs/manager/dispatchCodes/ReasonCodeContainer.js +5 -5
  153. package/lib/commonjs/manager/dispatchCodes/ReasonCodeContainer.js.map +1 -1
  154. package/lib/commonjs/manager/dispatchCodes/ReasonCodeRepo.js +5 -5
  155. package/lib/commonjs/manager/dispatchCodes/ReasonCodeRepo.js.map +1 -1
  156. package/lib/commonjs/manager/jobRemoval/JobRemovalManager.js.map +1 -1
  157. package/lib/commonjs/manager/location/LocationManager.js +5 -5
  158. package/lib/commonjs/manager/location/LocationManager.js.map +1 -1
  159. package/lib/commonjs/manager/sdk/DispatchSDKManager.js +8 -8
  160. package/lib/commonjs/manager/sdk/DispatchSDKManager.js.map +1 -1
  161. package/lib/commonjs/manager/sdk/DispatchSdkCache.js +4 -4
  162. package/lib/commonjs/manager/sdk/DispatchSdkCache.js.map +1 -1
  163. package/lib/commonjs/manager/sdk/callbacksHandler.js +30 -3
  164. package/lib/commonjs/manager/sdk/callbacksHandler.js.map +1 -1
  165. package/lib/commonjs/manager/syncmanager/AppSyncManager.js +5 -5
  166. package/lib/commonjs/manager/syncmanager/AppSyncManager.js.map +1 -1
  167. package/lib/commonjs/manager/syncmanager/DBConfig.js.map +1 -1
  168. package/lib/commonjs/manager/syncmanager/NativeSyncManager.js.map +1 -1
  169. package/lib/commonjs/manager/syncmanager/constants.js.map +1 -1
  170. package/lib/commonjs/manager/syncmanager/database.js +1 -1
  171. package/lib/commonjs/manager/syncmanager/database.js.map +1 -1
  172. package/lib/commonjs/manager/syncmanager/document/DocumentHttpClient.js +38 -21
  173. package/lib/commonjs/manager/syncmanager/document/DocumentHttpClient.js.map +1 -1
  174. package/lib/commonjs/manager/syncmanager/document/DocumentManager.js +12 -5
  175. package/lib/commonjs/manager/syncmanager/document/DocumentManager.js.map +1 -1
  176. package/lib/commonjs/manager/syncmanager/document/DocumentSyncManager.js +130 -42
  177. package/lib/commonjs/manager/syncmanager/document/DocumentSyncManager.js.map +1 -1
  178. package/lib/commonjs/manager/syncmanager/document/models.js.map +1 -1
  179. package/lib/commonjs/manager/syncmanager/events/ETEventsManager.js +5 -6
  180. package/lib/commonjs/manager/syncmanager/events/ETEventsManager.js.map +1 -1
  181. package/lib/commonjs/manager/syncmanager/events/EventsGraphQLClient.js.map +1 -1
  182. package/lib/commonjs/manager/syncmanager/events/EventsSyncManager.js +5 -6
  183. package/lib/commonjs/manager/syncmanager/events/EventsSyncManager.js.map +1 -1
  184. package/lib/commonjs/manager/syncmanager/events/SyncHttpClient.js +2 -6
  185. package/lib/commonjs/manager/syncmanager/events/SyncHttpClient.js.map +1 -1
  186. package/lib/commonjs/models/DispatchModels.js.map +1 -1
  187. package/lib/commonjs/models/ReasonCodes.js.map +1 -1
  188. package/lib/commonjs/models/auth.js.map +1 -1
  189. package/lib/commonjs/models/execTasks/ETBaseModels.js.map +1 -1
  190. package/lib/commonjs/models/execTasks/ETConfig.js.map +1 -1
  191. package/lib/commonjs/models/execution.js.map +1 -1
  192. package/lib/commonjs/models/fcm.js.map +1 -1
  193. package/lib/commonjs/models/sdk.js.map +1 -1
  194. package/lib/commonjs/native/signature/SignatureCapture.js +2 -2
  195. package/lib/commonjs/native/signature/SignatureCapture.js.map +1 -1
  196. package/lib/commonjs/network/GraphQLClient.js +13 -17
  197. package/lib/commonjs/network/GraphQLClient.js.map +1 -1
  198. package/lib/commonjs/network/NetworkClient.js +12 -2
  199. package/lib/commonjs/network/NetworkClient.js.map +1 -1
  200. package/lib/commonjs/network/NetworkUtils.js +14 -10
  201. package/lib/commonjs/network/NetworkUtils.js.map +1 -1
  202. package/lib/commonjs/network/Queries.js.map +1 -1
  203. package/lib/commonjs/network/client.js +3 -4
  204. package/lib/commonjs/network/client.js.map +1 -1
  205. package/lib/commonjs/res/strings.js.map +1 -1
  206. package/lib/commonjs/resources/Login.js +2 -2
  207. package/lib/commonjs/resources/Login.js.map +1 -1
  208. package/lib/commonjs/resources/network.js +2 -2
  209. package/lib/commonjs/resources/network.js.map +1 -1
  210. package/lib/commonjs/styles/SdkColors.js.map +1 -1
  211. package/lib/commonjs/styles/executionTasks/CommonStyles.js +1 -1
  212. package/lib/commonjs/styles/executionTasks/CommonStyles.js.map +1 -1
  213. package/lib/commonjs/ui/screens/CancellationScreen.js +6 -7
  214. package/lib/commonjs/ui/screens/CancellationScreen.js.map +1 -1
  215. package/lib/commonjs/ui/screens/CaptureInputScreen.js +6 -7
  216. package/lib/commonjs/ui/screens/CaptureInputScreen.js.map +1 -1
  217. package/lib/commonjs/ui/screens/CompleteObjectiveScreen.js +6 -7
  218. package/lib/commonjs/ui/screens/CompleteObjectiveScreen.js.map +1 -1
  219. package/lib/commonjs/ui/screens/DeliverScreen.js +6 -7
  220. package/lib/commonjs/ui/screens/DeliverScreen.js.map +1 -1
  221. package/lib/commonjs/ui/screens/DisplayScreen.js +6 -7
  222. package/lib/commonjs/ui/screens/DisplayScreen.js.map +1 -1
  223. package/lib/commonjs/ui/screens/DoodleScreen.js +6 -7
  224. package/lib/commonjs/ui/screens/DoodleScreen.js.map +1 -1
  225. package/lib/commonjs/ui/screens/DropCashScreen.js +7 -7
  226. package/lib/commonjs/ui/screens/DropCashScreen.js.map +1 -1
  227. package/lib/commonjs/ui/screens/ETScreensIndex.js.map +1 -1
  228. package/lib/commonjs/ui/screens/FormsScreen.js +6 -7
  229. package/lib/commonjs/ui/screens/FormsScreen.js.map +1 -1
  230. package/lib/commonjs/ui/screens/GeofenceScreen.js +6 -7
  231. package/lib/commonjs/ui/screens/GeofenceScreen.js.map +1 -1
  232. package/lib/commonjs/ui/screens/HttpRequestScreen.js +5 -6
  233. package/lib/commonjs/ui/screens/HttpRequestScreen.js.map +1 -1
  234. package/lib/commonjs/ui/screens/ImageCaptureScreen.js +6 -7
  235. package/lib/commonjs/ui/screens/ImageCaptureScreen.js.map +1 -1
  236. package/lib/commonjs/ui/screens/PaymentScreen.js +6 -7
  237. package/lib/commonjs/ui/screens/PaymentScreen.js.map +1 -1
  238. package/lib/commonjs/ui/screens/PickupScreen.js +6 -7
  239. package/lib/commonjs/ui/screens/PickupScreen.js.map +1 -1
  240. package/lib/commonjs/ui/screens/ScanScreen.js +6 -8
  241. package/lib/commonjs/ui/screens/ScanScreen.js.map +1 -1
  242. package/lib/commonjs/ui/screens/StartWorkFlowScreen.js +6 -7
  243. package/lib/commonjs/ui/screens/StartWorkFlowScreen.js.map +1 -1
  244. package/lib/commonjs/ui/screens/ValidateOTPScreen.js +6 -7
  245. package/lib/commonjs/ui/screens/ValidateOTPScreen.js.map +1 -1
  246. package/lib/commonjs/ui/screens/WithBaseDispatchScreen.js +1 -1
  247. package/lib/commonjs/ui/screens/WithBaseDispatchScreen.js.map +1 -1
  248. package/lib/commonjs/ui/uiConfig/RouteParams.js.map +1 -1
  249. package/lib/commonjs/utils/ApiUtils.js.map +1 -1
  250. package/lib/commonjs/utils/ExecTaskUtils.js +1 -2
  251. package/lib/commonjs/utils/ExecTaskUtils.js.map +1 -1
  252. package/lib/commonjs/utils/Logger.js +4 -5
  253. package/lib/commonjs/utils/Logger.js.map +1 -1
  254. package/lib/commonjs/utils/NetworkUtil.js +2 -2
  255. package/lib/commonjs/utils/NetworkUtil.js.map +1 -1
  256. package/lib/commonjs/utils/SdkUtils.js +1 -1
  257. package/lib/commonjs/utils/SdkUtils.js.map +1 -1
  258. package/lib/commonjs/utils/SyncManagerUtils.js +1 -1
  259. package/lib/commonjs/utils/SyncManagerUtils.js.map +1 -1
  260. package/lib/commonjs/utils/fcm/FCM.js +1 -1
  261. package/lib/commonjs/utils/fcm/FCM.js.map +1 -1
  262. package/lib/commonjs/utils/fcm/FcmUtils.js +1 -1
  263. package/lib/commonjs/utils/fcm/FcmUtils.js.map +1 -1
  264. package/lib/commonjs/utils/helper.js +4 -4
  265. package/lib/commonjs/utils/helper.js.map +1 -1
  266. package/lib/commonjs/utils/hooks/useModal.js +2 -1
  267. package/lib/commonjs/utils/hooks/useModal.js.map +1 -1
  268. package/lib/commonjs/utils/hooks/useTimer.js.map +1 -1
  269. package/lib/commonjs/utils/loginHelper.js.map +1 -1
  270. package/lib/commonjs/utils/storage.js +6 -9
  271. package/lib/commonjs/utils/storage.js.map +1 -1
  272. package/lib/commonjs/utils/utils.js +1 -3
  273. package/lib/commonjs/utils/utils.js.map +1 -1
  274. package/lib/module/@types/assets/index.d.js.map +1 -1
  275. package/lib/module/analytics/firebase/FirebaseLogging.js.map +1 -1
  276. package/lib/module/analytics/sentry/SentryAnalyticsSingleton.js +4 -4
  277. package/lib/module/analytics/sentry/SentryAnalyticsSingleton.js.map +1 -1
  278. package/lib/module/analytics/sentry/SentryAnalyticsUtils.js +7 -8
  279. package/lib/module/analytics/sentry/SentryAnalyticsUtils.js.map +1 -1
  280. package/lib/module/analytics/sentry/SentryModels.js.map +1 -1
  281. package/lib/module/analytics/sentry/SentrySdkConstants.js +2 -0
  282. package/lib/module/analytics/sentry/SentrySdkConstants.js.map +1 -1
  283. package/lib/module/components/dispatch/DispatchExecNavigator.js +3 -4
  284. package/lib/module/components/dispatch/DispatchExecNavigator.js.map +1 -1
  285. package/lib/module/components/executiontasks/CompletedWFSchema.js.map +1 -1
  286. package/lib/module/components/executiontasks/ExecutionTasksIndex.js.map +1 -1
  287. package/lib/module/components/executiontasks/cancellation/CancelET.js +6 -8
  288. package/lib/module/components/executiontasks/cancellation/CancelET.js.map +1 -1
  289. package/lib/module/components/executiontasks/cancellation/CancellationSchema.js.map +1 -1
  290. package/lib/module/components/executiontasks/captureInput/CaptureInputSchema.js.map +1 -1
  291. package/lib/module/components/executiontasks/captureInput/CaptureText.js.map +1 -1
  292. package/lib/module/components/executiontasks/captureInput/utils.js.map +1 -1
  293. package/lib/module/components/executiontasks/deliver/DeliverET.js +13 -19
  294. package/lib/module/components/executiontasks/deliver/DeliverET.js.map +1 -1
  295. package/lib/module/components/executiontasks/deliver/DeliverETInput.js.map +1 -1
  296. package/lib/module/components/executiontasks/deliver/SLDeliverET.js +14 -20
  297. package/lib/module/components/executiontasks/deliver/SLDeliverET.js.map +1 -1
  298. package/lib/module/components/executiontasks/display/DisplayModalET.js.map +1 -1
  299. package/lib/module/components/executiontasks/display/DisplaySchema.js.map +1 -1
  300. package/lib/module/components/executiontasks/doodle/SignatureET.js +0 -1
  301. package/lib/module/components/executiontasks/doodle/SignatureET.js.map +1 -1
  302. package/lib/module/components/executiontasks/doodle/SignatureSchema.js.map +1 -1
  303. package/lib/module/components/executiontasks/dropCash/DropCashET.js.map +1 -1
  304. package/lib/module/components/executiontasks/dropCash/DropCashSchema.js.map +1 -1
  305. package/lib/module/components/executiontasks/dropCash/SLDropCash.js.map +1 -1
  306. package/lib/module/components/executiontasks/forms/FormGenerator.js.map +1 -1
  307. package/lib/module/components/executiontasks/forms/FormSchema.js.map +1 -1
  308. package/lib/module/components/executiontasks/forms/widgets/DateTimeWidget.js +11 -12
  309. package/lib/module/components/executiontasks/forms/widgets/DateTimeWidget.js.map +1 -1
  310. package/lib/module/components/executiontasks/forms/widgets/DropdownWidget.js.map +1 -1
  311. package/lib/module/components/executiontasks/forms/widgets/QRBarcodeScannerWidget.js +9 -10
  312. package/lib/module/components/executiontasks/forms/widgets/QRBarcodeScannerWidget.js.map +1 -1
  313. package/lib/module/components/executiontasks/forms/widgets/TimeRangeSelector.js.map +1 -1
  314. package/lib/module/components/executiontasks/httpRequest/HttpEtUtils.js.map +1 -1
  315. package/lib/module/components/executiontasks/httpRequest/HttpRequestET.js.map +1 -1
  316. package/lib/module/components/executiontasks/httpRequest/HttpRequestETSchema.js.map +1 -1
  317. package/lib/module/components/executiontasks/imageCapture/CaptureSchema.js.map +1 -1
  318. package/lib/module/components/executiontasks/imageCapture/CaptureUtils.js +1 -4
  319. package/lib/module/components/executiontasks/imageCapture/CaptureUtils.js.map +1 -1
  320. package/lib/module/components/executiontasks/imageCapture/ImageCapture.js +9 -11
  321. package/lib/module/components/executiontasks/imageCapture/ImageCapture.js.map +1 -1
  322. package/lib/module/components/executiontasks/payments/PaymentStyles.js.map +1 -1
  323. package/lib/module/components/executiontasks/payments/PaymentUtils.js.map +1 -1
  324. package/lib/module/components/executiontasks/payments/completePayment/CompletePaymentET.js.map +1 -1
  325. package/lib/module/components/executiontasks/payments/completePayment/CompletePaymentSchema.js.map +1 -1
  326. package/lib/module/components/executiontasks/payments/init/InitPaymentET.js +3 -4
  327. package/lib/module/components/executiontasks/payments/init/InitPaymentET.js.map +1 -1
  328. package/lib/module/components/executiontasks/payments/init/InitPaymentSchema.js.map +1 -1
  329. package/lib/module/components/executiontasks/payments/processPayment/ProcessPaymentET.js.map +1 -1
  330. package/lib/module/components/executiontasks/payments/processPayment/ProcessPaymentSchema.js.map +1 -1
  331. package/lib/module/components/executiontasks/pickup/PickpSchema.js.map +1 -1
  332. package/lib/module/components/executiontasks/pickup/PickupET.js +13 -19
  333. package/lib/module/components/executiontasks/pickup/PickupET.js.map +1 -1
  334. package/lib/module/components/executiontasks/pickup/SLPickupET.js +14 -20
  335. package/lib/module/components/executiontasks/pickup/SLPickupET.js.map +1 -1
  336. package/lib/module/components/executiontasks/scan/ScanET.js +1 -3
  337. package/lib/module/components/executiontasks/scan/ScanET.js.map +1 -1
  338. package/lib/module/components/executiontasks/scan/ScanSchema.js.map +1 -1
  339. package/lib/module/components/executiontasks/scan/constants.js.map +1 -1
  340. package/lib/module/components/executiontasks/scan/interfaces.js.map +1 -1
  341. package/lib/module/components/executiontasks/scan/modalConstant.js.map +1 -1
  342. package/lib/module/components/executiontasks/scan/sub_components/CScanner.js +3 -4
  343. package/lib/module/components/executiontasks/scan/sub_components/CScanner.js.map +1 -1
  344. package/lib/module/components/executiontasks/scan/sub_components/DropDownUtils.js +0 -1
  345. package/lib/module/components/executiontasks/scan/sub_components/DropDownUtils.js.map +1 -1
  346. package/lib/module/components/executiontasks/scan/sub_components/ERDropDown.js +0 -2
  347. package/lib/module/components/executiontasks/scan/sub_components/ERDropDown.js.map +1 -1
  348. package/lib/module/components/executiontasks/scan/sub_components/SummaryPage.js +1 -4
  349. package/lib/module/components/executiontasks/scan/sub_components/SummaryPage.js.map +1 -1
  350. package/lib/module/components/executiontasks/scan/utils.js.map +1 -1
  351. package/lib/module/components/executiontasks/validateOTP/ValidateOTPET.js.map +1 -1
  352. package/lib/module/components/executiontasks/validateOTP/ValidateOTPSchema.js.map +1 -1
  353. package/lib/module/components/executiontasks/validateOTP/constants.js.map +1 -1
  354. package/lib/module/components/executiontasks/validateOTP/sub-components/OTPInput.js.map +1 -1
  355. package/lib/module/components/executiontasks/validateOTP/utils.js.map +1 -1
  356. package/lib/module/components/executiontasks/verifyInput/VerifyInputSchema.js.map +1 -1
  357. package/lib/module/components/executiontasks/verifyLocation/GeofenceUtils.js.map +1 -1
  358. package/lib/module/components/executiontasks/verifyLocation/VerifyLocSchema.js.map +1 -1
  359. package/lib/module/components/executiontasks/verifyLocation/VerifyLocationET.js.map +1 -1
  360. package/lib/module/components/executiontasks/verifyOtp/VerifyOtpET.js.map +1 -1
  361. package/lib/module/components/executiontasks/verifyOtp/VerifyOtpSchema.js.map +1 -1
  362. package/lib/module/components/utils/index.js.map +1 -1
  363. package/lib/module/components/widgets/AlertDisplay.js.map +1 -1
  364. package/lib/module/components/widgets/CancelOrderDialog.js.map +1 -1
  365. package/lib/module/components/widgets/Card.js +0 -1
  366. package/lib/module/components/widgets/Card.js.map +1 -1
  367. package/lib/module/components/widgets/GoBackModal.js.map +1 -1
  368. package/lib/module/components/widgets/IconButton.js +19 -22
  369. package/lib/module/components/widgets/IconButton.js.map +1 -1
  370. package/lib/module/components/widgets/ModalWidget.js.map +1 -1
  371. package/lib/module/components/widgets/ProgressDialog.js.map +1 -1
  372. package/lib/module/components/widgets/SearchBar.js.map +1 -1
  373. package/lib/module/components/widgets/SnackBarCustom.js +15 -18
  374. package/lib/module/components/widgets/SnackBarCustom.js.map +1 -1
  375. package/lib/module/components/widgets/SplitTextInput.js +8 -9
  376. package/lib/module/components/widgets/SplitTextInput.js.map +1 -1
  377. package/lib/module/components/widgets/TabsComponent.js.map +1 -1
  378. package/lib/module/components/widgets/Toaster.js.map +1 -1
  379. package/lib/module/config/DispatchSDKConfig.js.map +1 -1
  380. package/lib/module/constants/apiConstants.js.map +1 -1
  381. package/lib/module/constants/constants.js.map +1 -1
  382. package/lib/module/constants/statuscode.js.map +1 -1
  383. package/lib/module/errors/BaseError.js +2 -2
  384. package/lib/module/errors/BaseError.js.map +1 -1
  385. package/lib/module/errors/ErrorCodes.js.map +1 -1
  386. package/lib/module/events/EventDispatcher.js.map +1 -1
  387. package/lib/module/events/EventListener.js.map +1 -1
  388. package/lib/module/events/constants.js.map +1 -1
  389. package/lib/module/events/index.js.map +1 -1
  390. package/lib/module/events/interface.js.map +1 -1
  391. package/lib/module/icons/ScanIcon.js.map +1 -1
  392. package/lib/module/icons/file.js.map +1 -1
  393. package/lib/module/icons/interface.js.map +1 -1
  394. package/lib/module/index.js.map +1 -1
  395. package/lib/module/locale/Str.js.map +1 -1
  396. package/lib/module/locale/i18n.js.map +1 -1
  397. package/lib/module/locale/util.js.map +1 -1
  398. package/lib/module/manager/dispatch/DispatchStateContainer.js +4 -4
  399. package/lib/module/manager/dispatch/DispatchStateContainer.js.map +1 -1
  400. package/lib/module/manager/dispatchCodes/EventCodeContainer.js +4 -4
  401. package/lib/module/manager/dispatchCodes/EventCodeContainer.js.map +1 -1
  402. package/lib/module/manager/dispatchCodes/EventCodeRepo.js +4 -4
  403. package/lib/module/manager/dispatchCodes/EventCodeRepo.js.map +1 -1
  404. package/lib/module/manager/dispatchCodes/ReasonCodeContainer.js +4 -4
  405. package/lib/module/manager/dispatchCodes/ReasonCodeContainer.js.map +1 -1
  406. package/lib/module/manager/dispatchCodes/ReasonCodeRepo.js +4 -4
  407. package/lib/module/manager/dispatchCodes/ReasonCodeRepo.js.map +1 -1
  408. package/lib/module/manager/jobRemoval/JobRemovalManager.js.map +1 -1
  409. package/lib/module/manager/location/LocationManager.js +4 -4
  410. package/lib/module/manager/location/LocationManager.js.map +1 -1
  411. package/lib/module/manager/sdk/DispatchSDKManager.js +7 -7
  412. package/lib/module/manager/sdk/DispatchSDKManager.js.map +1 -1
  413. package/lib/module/manager/sdk/DispatchSdkCache.js +4 -4
  414. package/lib/module/manager/sdk/DispatchSdkCache.js.map +1 -1
  415. package/lib/module/manager/sdk/callbacksHandler.js +29 -3
  416. package/lib/module/manager/sdk/callbacksHandler.js.map +1 -1
  417. package/lib/module/manager/syncmanager/AppSyncManager.js +4 -4
  418. package/lib/module/manager/syncmanager/AppSyncManager.js.map +1 -1
  419. package/lib/module/manager/syncmanager/DBConfig.js +1 -0
  420. package/lib/module/manager/syncmanager/DBConfig.js.map +1 -1
  421. package/lib/module/manager/syncmanager/NativeSyncManager.js.map +1 -1
  422. package/lib/module/manager/syncmanager/constants.js.map +1 -1
  423. package/lib/module/manager/syncmanager/database.js.map +1 -1
  424. package/lib/module/manager/syncmanager/document/DocumentHttpClient.js +38 -21
  425. package/lib/module/manager/syncmanager/document/DocumentHttpClient.js.map +1 -1
  426. package/lib/module/manager/syncmanager/document/DocumentManager.js +11 -4
  427. package/lib/module/manager/syncmanager/document/DocumentManager.js.map +1 -1
  428. package/lib/module/manager/syncmanager/document/DocumentSyncManager.js +129 -41
  429. package/lib/module/manager/syncmanager/document/DocumentSyncManager.js.map +1 -1
  430. package/lib/module/manager/syncmanager/document/models.js.map +1 -1
  431. package/lib/module/manager/syncmanager/events/ETEventsManager.js +4 -5
  432. package/lib/module/manager/syncmanager/events/ETEventsManager.js.map +1 -1
  433. package/lib/module/manager/syncmanager/events/EventsGraphQLClient.js.map +1 -1
  434. package/lib/module/manager/syncmanager/events/EventsSyncManager.js +4 -5
  435. package/lib/module/manager/syncmanager/events/EventsSyncManager.js.map +1 -1
  436. package/lib/module/manager/syncmanager/events/SyncHttpClient.js +2 -6
  437. package/lib/module/manager/syncmanager/events/SyncHttpClient.js.map +1 -1
  438. package/lib/module/models/DispatchModels.js.map +1 -1
  439. package/lib/module/models/ReasonCodes.js.map +1 -1
  440. package/lib/module/models/auth.js.map +1 -1
  441. package/lib/module/models/execTasks/ETBaseModels.js.map +1 -1
  442. package/lib/module/models/execTasks/ETConfig.js.map +1 -1
  443. package/lib/module/models/execution.js.map +1 -1
  444. package/lib/module/models/fcm.js.map +1 -1
  445. package/lib/module/models/sdk.js.map +1 -1
  446. package/lib/module/native/signature/SignatureCapture.js +2 -2
  447. package/lib/module/native/signature/SignatureCapture.js.map +1 -1
  448. package/lib/module/network/GraphQLClient.js +13 -17
  449. package/lib/module/network/GraphQLClient.js.map +1 -1
  450. package/lib/module/network/NetworkClient.js +12 -2
  451. package/lib/module/network/NetworkClient.js.map +1 -1
  452. package/lib/module/network/NetworkUtils.js +14 -10
  453. package/lib/module/network/NetworkUtils.js.map +1 -1
  454. package/lib/module/network/Queries.js.map +1 -1
  455. package/lib/module/network/client.js +3 -4
  456. package/lib/module/network/client.js.map +1 -1
  457. package/lib/module/res/strings.js.map +1 -1
  458. package/lib/module/resources/Login.js +2 -2
  459. package/lib/module/resources/Login.js.map +1 -1
  460. package/lib/module/resources/network.js +2 -2
  461. package/lib/module/resources/network.js.map +1 -1
  462. package/lib/module/styles/SdkColors.js.map +1 -1
  463. package/lib/module/styles/executionTasks/CommonStyles.js.map +1 -1
  464. package/lib/module/ui/screens/CancellationScreen.js +5 -6
  465. package/lib/module/ui/screens/CancellationScreen.js.map +1 -1
  466. package/lib/module/ui/screens/CaptureInputScreen.js +5 -6
  467. package/lib/module/ui/screens/CaptureInputScreen.js.map +1 -1
  468. package/lib/module/ui/screens/CompleteObjectiveScreen.js +5 -6
  469. package/lib/module/ui/screens/CompleteObjectiveScreen.js.map +1 -1
  470. package/lib/module/ui/screens/DeliverScreen.js +5 -6
  471. package/lib/module/ui/screens/DeliverScreen.js.map +1 -1
  472. package/lib/module/ui/screens/DisplayScreen.js +5 -6
  473. package/lib/module/ui/screens/DisplayScreen.js.map +1 -1
  474. package/lib/module/ui/screens/DoodleScreen.js +5 -6
  475. package/lib/module/ui/screens/DoodleScreen.js.map +1 -1
  476. package/lib/module/ui/screens/DropCashScreen.js +5 -6
  477. package/lib/module/ui/screens/DropCashScreen.js.map +1 -1
  478. package/lib/module/ui/screens/ETScreensIndex.js.map +1 -1
  479. package/lib/module/ui/screens/FormsScreen.js +5 -6
  480. package/lib/module/ui/screens/FormsScreen.js.map +1 -1
  481. package/lib/module/ui/screens/GeofenceScreen.js +5 -6
  482. package/lib/module/ui/screens/GeofenceScreen.js.map +1 -1
  483. package/lib/module/ui/screens/HttpRequestScreen.js +5 -6
  484. package/lib/module/ui/screens/HttpRequestScreen.js.map +1 -1
  485. package/lib/module/ui/screens/ImageCaptureScreen.js +5 -6
  486. package/lib/module/ui/screens/ImageCaptureScreen.js.map +1 -1
  487. package/lib/module/ui/screens/PaymentScreen.js +5 -6
  488. package/lib/module/ui/screens/PaymentScreen.js.map +1 -1
  489. package/lib/module/ui/screens/PickupScreen.js +5 -6
  490. package/lib/module/ui/screens/PickupScreen.js.map +1 -1
  491. package/lib/module/ui/screens/ScanScreen.js +5 -7
  492. package/lib/module/ui/screens/ScanScreen.js.map +1 -1
  493. package/lib/module/ui/screens/StartWorkFlowScreen.js +5 -6
  494. package/lib/module/ui/screens/StartWorkFlowScreen.js.map +1 -1
  495. package/lib/module/ui/screens/ValidateOTPScreen.js +5 -6
  496. package/lib/module/ui/screens/ValidateOTPScreen.js.map +1 -1
  497. package/lib/module/ui/screens/WithBaseDispatchScreen.js.map +1 -1
  498. package/lib/module/ui/uiConfig/RouteParams.js.map +1 -1
  499. package/lib/module/utils/ApiUtils.js.map +1 -1
  500. package/lib/module/utils/ExecTaskUtils.js +1 -2
  501. package/lib/module/utils/ExecTaskUtils.js.map +1 -1
  502. package/lib/module/utils/Logger.js +4 -5
  503. package/lib/module/utils/Logger.js.map +1 -1
  504. package/lib/module/utils/NetworkUtil.js +2 -2
  505. package/lib/module/utils/NetworkUtil.js.map +1 -1
  506. package/lib/module/utils/SdkUtils.js.map +1 -1
  507. package/lib/module/utils/SyncManagerUtils.js.map +1 -1
  508. package/lib/module/utils/fcm/FCM.js.map +1 -1
  509. package/lib/module/utils/fcm/FcmUtils.js.map +1 -1
  510. package/lib/module/utils/helper.js +4 -4
  511. package/lib/module/utils/helper.js.map +1 -1
  512. package/lib/module/utils/hooks/useModal.js +1 -0
  513. package/lib/module/utils/hooks/useModal.js.map +1 -1
  514. package/lib/module/utils/hooks/useTimer.js.map +1 -1
  515. package/lib/module/utils/loginHelper.js.map +1 -1
  516. package/lib/module/utils/storage.js +5 -8
  517. package/lib/module/utils/storage.js.map +1 -1
  518. package/lib/module/utils/utils.js +1 -3
  519. package/lib/module/utils/utils.js.map +1 -1
  520. package/lib/typescript/analytics/sentry/SentrySdkConstants.d.ts +2 -0
  521. package/lib/typescript/manager/sdk/callbacksHandler.d.ts +3 -1
  522. package/lib/typescript/manager/syncmanager/document/DocumentManager.d.ts +1 -0
  523. package/lib/typescript/models/sdk.d.ts +1 -0
  524. package/package.json +1 -1
  525. package/src/analytics/sentry/SentrySdkConstants.ts +2 -0
  526. package/src/components/executiontasks/imageCapture/CaptureUtils.ts +2 -3
  527. package/src/index.tsx +1 -1
  528. package/src/manager/sdk/DispatchSDKManager.ts +6 -2
  529. package/src/manager/sdk/callbacksHandler.ts +39 -2
  530. package/src/manager/syncmanager/document/DocumentHttpClient.ts +54 -24
  531. package/src/manager/syncmanager/document/DocumentManager.ts +15 -0
  532. package/src/manager/syncmanager/document/DocumentSyncManager.ts +139 -37
  533. package/src/models/auth.ts +1 -0
  534. package/src/models/sdk.ts +1 -0
  535. package/src/network/NetworkClient.ts +18 -2
  536. package/src/network/NetworkUtils.ts +9 -1
  537. package/src/network/client.ts +1 -1
  538. package/android/.gradle/6.8/fileChanges/last-build.bin +0 -0
  539. package/android/.gradle/6.8/fileHashes/fileHashes.lock +0 -0
  540. package/android/.gradle/6.8/gc.properties +0 -0
  541. package/android/.gradle/checksums/checksums.lock +0 -0
  542. package/android/.gradle/configuration-cache/gc.properties +0 -0
  543. package/android/.gradle/vcs-1/gc.properties +0 -0
  544. package/android/.idea/gradle.xml +0 -13
  545. package/android/.idea/misc.xml +0 -10
  546. package/android/.idea/vcs.xml +0 -6
@@ -1,7 +1,7 @@
1
- var _class;
1
+ var _DocumentSyncManager;
2
2
  function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
3
- function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
4
- function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
3
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
4
+ function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
5
5
  import DocumentManager from './DocumentManager';
6
6
  import DocumentHttpClient from './DocumentHttpClient';
7
7
  import { isEmptyOrBlank, flattenObject } from '../../../utils/utils';
@@ -11,7 +11,6 @@ import Logger, { LOG_TYPE } from '../../../utils/Logger';
11
11
  import NetworkUtil from '../../../utils/NetworkUtil';
12
12
  import Marker, { Position, TextBackgroundType, ImageFormat } from 'react-native-image-marker';
13
13
  import RNFS from 'react-native-fs';
14
- import Storage from '../../../utils/storage';
15
14
  import { Platform } from 'react-native';
16
15
  import { SentryEventNameSdkConstants, SeverityLevelValue } from '../../../analytics/sentry/SentrySdkConstants';
17
16
  import { fireEventWithScreenName } from '../../../analytics/sentry/SentryAnalyticsUtils';
@@ -55,10 +54,30 @@ export default class DocumentSyncManager {
55
54
  if ((documentRows === null || documentRows === void 0 ? void 0 : documentRows.length) > 0) {
56
55
  await this.uploadDocToServer(documentRows[0]);
57
56
  } else {
58
- Logger.getInstance().logEvent('startDocumentSync', 'No data to sync', LOG_TYPE.SDK_INFO);
57
+ let cta = 'startDocumentSync';
58
+ fireEventWithScreenName({
59
+ severityLevel: SeverityLevelValue.LOG,
60
+ eventName: SentryEventNameSdkConstants.APP_LOG,
61
+ screenName: cta,
62
+ cta: cta,
63
+ extraParams: {
64
+ msg: 'No data to sync'
65
+ }
66
+ });
67
+ Logger.getInstance().logEvent(cta, 'No data to sync', LOG_TYPE.SDK_ERROR);
59
68
  }
60
69
  } else {
61
- Logger.getInstance().logEvent('startDocumentSync', 'No Network', LOG_TYPE.SDK_INFO);
70
+ let cta = 'startDocumentSync';
71
+ fireEventWithScreenName({
72
+ severityLevel: SeverityLevelValue.LOG,
73
+ eventName: SentryEventNameSdkConstants.APP_LOG,
74
+ screenName: cta,
75
+ cta: cta,
76
+ extraParams: {
77
+ msg: 'No Network'
78
+ }
79
+ });
80
+ Logger.getInstance().logEvent(cta, 'No Network', LOG_TYPE.SDK_ERROR);
62
81
  }
63
82
  } catch (error) {} finally {
64
83
  this.inProgress = false;
@@ -67,7 +86,26 @@ export default class DocumentSyncManager {
67
86
  }
68
87
  }
69
88
  } else {
70
- Logger.getInstance().logEvent('startDocumentSync', 'sync already in progress ', LOG_TYPE.SDK_INFO);
89
+ if (!this.docManager) {
90
+ this.docManager = await DocumentManager.getInstance();
91
+ }
92
+ let documentRows = await this.docManager.getUnsyncedDocument();
93
+ if ((documentRows === null || documentRows === void 0 ? void 0 : documentRows.length) > 0) {
94
+ await this.docManager.updateDocPriority(documentRows[0].id, documentRows[0].priority + 1);
95
+ this._retries = 0;
96
+ this.startDocumentSync();
97
+ }
98
+ let cta = 'startDocumentSync';
99
+ fireEventWithScreenName({
100
+ severityLevel: SeverityLevelValue.LOG,
101
+ eventName: SentryEventNameSdkConstants.APP_LOG,
102
+ screenName: cta,
103
+ cta: cta,
104
+ extraParams: {
105
+ msg: 'sync already in progress'
106
+ }
107
+ });
108
+ Logger.getInstance().logEvent(cta, 'sync already in progress', LOG_TYPE.SDK_ERROR);
71
109
  }
72
110
  }
73
111
  async isSyncPending() {
@@ -78,15 +116,24 @@ export default class DocumentSyncManager {
78
116
  async insertDocument(fmsFolderID, data, base64, desc, dspID,
79
117
  // jobID: string,
80
118
  // objRef: string,
81
- filePath, fileType, fileName, geoTimeStamp, processedFilePath) {
82
- let priority = arguments.length > 10 && arguments[10] !== undefined ? arguments[10] : 1;
119
+ filePath, fileType, fileName, geoTimeStamp, processedFilePath, priority = 1) {
83
120
  if (isEmptyOrBlank(desc) || isEmptyOrBlank(dspID) ||
84
121
  // isEmptyOrBlank(jobID) ||
85
122
  // isEmptyOrBlank(objRef) ||
86
123
  isEmptyOrBlank(fileType) || isEmptyOrBlank(fileName) || base64 && isEmptyOrBlank(data) || !base64 && isEmptyOrBlank(filePath)) throw new BaseError(BaseErrorCodes.InvalidArgumentError, InvalidArgumentsError);else {
87
124
  var _this$docManager;
88
125
  if (!this.docManager) {
89
- Logger.getInstance().logEvent('insertDocument', 'INIT DOC SYNC AGAIN', LOG_TYPE.SDK_INFO);
126
+ let cta = 'insertDocument';
127
+ fireEventWithScreenName({
128
+ severityLevel: SeverityLevelValue.LOG,
129
+ eventName: SentryEventNameSdkConstants.APP_LOG,
130
+ screenName: cta,
131
+ cta: cta,
132
+ extraParams: {
133
+ msg: 'INIT DOC SYNC AGAIN'
134
+ }
135
+ });
136
+ Logger.getInstance().logEvent(cta, 'INIT DOC SYNC AGAIN', LOG_TYPE.SDK_ERROR);
90
137
  this.docManager = await DocumentManager.getInstance();
91
138
  }
92
139
  console.log('insertDocument1:', fmsFolderID);
@@ -107,7 +154,17 @@ export default class DocumentSyncManager {
107
154
  try {
108
155
  await this.docManager.markDocumentSynced(documentRow.id, fmsID);
109
156
  } catch (err) {
110
- Logger.getInstance().logEvent('updateDocument', err.message, LOG_TYPE.SDK_WARNING);
157
+ let cta = 'updateDocument';
158
+ fireEventWithScreenName({
159
+ severityLevel: SeverityLevelValue.LOG,
160
+ eventName: SentryEventNameSdkConstants.APP_LOG,
161
+ screenName: cta,
162
+ cta: cta,
163
+ extraParams: {
164
+ msg: err
165
+ }
166
+ });
167
+ Logger.getInstance().logEvent(cta, err, LOG_TYPE.SDK_WARNING);
111
168
  }
112
169
  }
113
170
 
@@ -117,7 +174,17 @@ export default class DocumentSyncManager {
117
174
  try {
118
175
  await this.docManager.updateProcesedFilePath(documentRow.id, origialFilePath, processedPath);
119
176
  } catch (err) {
120
- Logger.getInstance().logEvent('updateDocument', err.message, LOG_TYPE.SDK_WARNING);
177
+ let cta = 'updateDocument';
178
+ fireEventWithScreenName({
179
+ severityLevel: SeverityLevelValue.ERROR,
180
+ eventName: SentryEventNameSdkConstants.APP_ERROR,
181
+ screenName: cta,
182
+ cta: cta,
183
+ extraParams: {
184
+ msg: err
185
+ }
186
+ });
187
+ Logger.getInstance().logEvent(cta, err, LOG_TYPE.SDK_WARNING);
121
188
  }
122
189
  }
123
190
  async updateDocError(documentRow, uploadError) {
@@ -125,7 +192,17 @@ export default class DocumentSyncManager {
125
192
  try {
126
193
  await this.docManager.updateDocSyncError(documentRow.id, uploadError);
127
194
  } catch (err) {
128
- Logger.getInstance().logEvent('updateDocError', err.message, LOG_TYPE.SDK_WARNING);
195
+ let cta = 'updateDocError';
196
+ fireEventWithScreenName({
197
+ severityLevel: SeverityLevelValue.ERROR,
198
+ eventName: SentryEventNameSdkConstants.APP_ERROR,
199
+ screenName: cta,
200
+ cta: cta,
201
+ extraParams: {
202
+ msg: err
203
+ }
204
+ });
205
+ Logger.getInstance().logEvent(cta, err, LOG_TYPE.SDK_WARNING);
129
206
  }
130
207
  }
131
208
  checkForInitialization() {
@@ -150,19 +227,10 @@ export default class DocumentSyncManager {
150
227
  if (accuracy !== '') {
151
228
  strDMSWithAccuracy = strDMS + ' (Accuracy: ' + accuracy + 'm)'; // Appedning accuracy in location
152
229
  }
153
-
154
230
  let fontSize = 14;
155
- let fileSize = await Storage.getInstance().getItem('maxSize'); // File max size
156
- let cRatio = await Storage.getInstance().getItem('cRatio'); // File compression ratio
157
- let nFileSize = Number(fileSize);
158
- let ncRatio = Number(cRatio);
159
- let wholeRatio = Math.round(ncRatio * 100); // Compression ratio to be made
160
231
  if (Platform.OS !== 'android') {
161
232
  fontSize = 28;
162
233
  }
163
- if (wholeRatio >= 75) {
164
- wholeRatio = 25;
165
- }
166
234
  const options = {
167
235
  backgroundImage: {
168
236
  // Image for overlay
@@ -175,7 +243,6 @@ export default class DocumentSyncManager {
175
243
  position: {
176
244
  position: Position.topLeft // Overlay text position
177
245
  },
178
-
179
246
  style: {
180
247
  // Style for overlay
181
248
  color: '#ffffff',
@@ -188,15 +255,11 @@ export default class DocumentSyncManager {
188
255
  }
189
256
  }
190
257
  }],
191
- scale: 1,
192
- quality: 100 - wholeRatio,
193
- // Compressio ratio in which file will generate
194
- maxSize: nFileSize,
195
- // Max file size in which file will generate
258
+ scale: 0,
259
+ quality: 100,
196
260
  filename: pFilePath,
197
261
  saveFormat: ImageFormat.jpg // Saving in jpeg format
198
262
  };
199
-
200
263
  let processedFilePath = await Marker.markText(options); // Generating overlay image
201
264
  if (processedFilePath !== null && processedFilePath !== '') {
202
265
  let completeFilePath = processedFilePath;
@@ -209,7 +272,6 @@ export default class DocumentSyncManager {
209
272
  //original file path catprued from camera
210
273
  completeFilePath // completeFilePath is the path with file:// of processed file
211
274
  );
212
-
213
275
  documentRow.processed_file_path = completeFilePath;
214
276
  }
215
277
  }
@@ -246,7 +308,6 @@ export default class DocumentSyncManager {
246
308
  if (accuracy !== '') {
247
309
  strDMSWithAccuracy = strDMS + ' (Accuracy: ' + accuracy + 'm)'; // Appedning accuracy in location
248
310
  }
249
-
250
311
  const options = {
251
312
  backgroundImage: {
252
313
  src: filePath,
@@ -259,7 +320,6 @@ export default class DocumentSyncManager {
259
320
  position: {
260
321
  position: Position.topLeft // Overlay text position
261
322
  },
262
-
263
323
  style: {
264
324
  // Style for overlay
265
325
  color: '#ffffff',
@@ -277,7 +337,6 @@ export default class DocumentSyncManager {
277
337
  filename: pFilePath,
278
338
  saveFormat: ImageFormat.base64 // Saving in base6 format
279
339
  };
280
-
281
340
  let processedBase64 = await Marker.markText(options); // Generating overlay image
282
341
  if (processedBase64 !== null && processedBase64 !== '') {
283
342
  // Fetching base64 data from processed data.
@@ -301,13 +360,34 @@ export default class DocumentSyncManager {
301
360
  async uploadDocToServer(documentRow) {
302
361
  try {
303
362
  var _this$documentHttpCli;
304
- let docRow = await this.processPODData(documentRow);
363
+ let docRow = documentRow;
364
+ let cta = 'uploadDocToServer-geoStamp';
365
+ let geoStampAvailable = false;
366
+ if (documentRow.geo_timestamp && documentRow.geo_timestamp.length != 0) {
367
+ geoStampAvailable = true;
368
+ docRow = await this.processPODData(documentRow);
369
+ }
370
+ let extra = {
371
+ msg: geoStampAvailable ? "geoStamp availale" : 'geoStamp not availale',
372
+ fName: docRow.file_name && docRow.file_name.length != 0 ? docRow.file_name.substring(4) : '',
373
+ dName: docRow.fms_folder_id && docRow.fms_folder_id.length != 0 ? docRow.fms_folder_id.substring(4) : '',
374
+ dispId: docRow.dispatch_id && docRow.dispatch_id.length != 0 ? docRow.dispatch_id.substring(9) : ''
375
+ };
376
+ fireEventWithScreenName({
377
+ severityLevel: SeverityLevelValue.LOG,
378
+ eventName: SentryEventNameSdkConstants.APP_LOG,
379
+ screenName: cta,
380
+ cta: cta,
381
+ extraParams: extra
382
+ });
383
+ Logger.getInstance().logEvent(cta, flattenObject(extra), LOG_TYPE.SDK_ERROR);
305
384
  console.log('uploadDocToServer999:', docRow);
306
- let fmsID = await ((_this$documentHttpCli = this.documentHttpClient) === null || _this$documentHttpCli === void 0 ? void 0 : _this$documentHttpCli.uploadDocument(documentRow));
385
+ let fmsID = await ((_this$documentHttpCli = this.documentHttpClient) === null || _this$documentHttpCli === void 0 ? void 0 : _this$documentHttpCli.uploadDocument(docRow));
307
386
  let extraParameters = {
308
387
  fmsID: fmsID ?? '',
309
- fileName: docRow.file_name,
310
- folderName: docRow.fms_folder_id
388
+ fName: docRow.file_name && docRow.file_name.length != 0 ? docRow.file_name.substring(4) : '',
389
+ dName: docRow.fms_folder_id && docRow.fms_folder_id.length != 0 ? docRow.fms_folder_id.substring(4) : '',
390
+ dispId: docRow.dispatch_id && docRow.dispatch_id.length != 0 ? docRow.dispatch_id.substring(9) : ''
311
391
  };
312
392
  // TODO: SOLELY DEPENDS ON FMS_ID WHICH IS WRONG => IT SHOULD BE Response.status = 202
313
393
  if (fmsID) {
@@ -315,7 +395,15 @@ export default class DocumentSyncManager {
315
395
  await this.updateDocument(docRow, fmsID);
316
396
  } else {
317
397
  this._retries++;
318
- Logger.getInstance().logEvent('uploadDocToServer-empty-fms-id', flattenObject(extraParameters), LOG_TYPE.SDK_ERROR);
398
+ let cta = 'uploadDocToServer-empty-fms-id';
399
+ fireEventWithScreenName({
400
+ severityLevel: SeverityLevelValue.LOG,
401
+ eventName: SentryEventNameSdkConstants.APP_LOG,
402
+ screenName: cta,
403
+ cta: cta,
404
+ extraParams: extraParameters
405
+ });
406
+ Logger.getInstance().logEvent(cta, flattenObject(extraParameters), LOG_TYPE.SDK_ERROR);
319
407
  await this.updateDocError(docRow, 'Unexpected Error');
320
408
  }
321
409
  } catch (error) {
@@ -327,11 +415,11 @@ export default class DocumentSyncManager {
327
415
  screenName: cta,
328
416
  cta: cta,
329
417
  extraParams: {
330
- error: error.message
418
+ error: error
331
419
  }
332
420
  });
421
+ Logger.getInstance().logEvent(cta, error, LOG_TYPE.SDK_ERROR);
333
422
  this._retries++;
334
- Logger.getInstance().logEvent('uploadDocToServer-sync-error', error.message, LOG_TYPE.SDK_ERROR);
335
423
  await this.updateDocError(documentRow, JSON.stringify({
336
424
  message: error.message,
337
425
  error: JSON.stringify(error === null || error === void 0 || (_error$response = error.response) === null || _error$response === void 0 ? void 0 : _error$response.data),
@@ -348,6 +436,6 @@ export default class DocumentSyncManager {
348
436
  if (dspID) await this.docManager.deleteAllSyncedDocuments(dspID);
349
437
  }
350
438
  }
351
- _class = DocumentSyncManager;
439
+ _DocumentSyncManager = DocumentSyncManager;
352
440
  _defineProperty(DocumentSyncManager, "instance", void 0);
353
441
  //# sourceMappingURL=DocumentSyncManager.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["DocumentManager","DocumentHttpClient","isEmptyOrBlank","flattenObject","BaseError","BaseErrorCodes","InvalidArgumentsError","InvalidBaseURL","SyncManagerNotInitialized","Logger","LOG_TYPE","NetworkUtil","Marker","Position","TextBackgroundType","ImageFormat","RNFS","Storage","Platform","SentryEventNameSdkConstants","SeverityLevelValue","fireEventWithScreenName","latlngToDms","require","DocumentSyncManager","retries","_retries","value","constructor","_defineProperty","init","baseURL","retryCount","maxRetryCount","documentHttpClient","getInstance","instance","startDocumentSync","inProgress","hasNetwork","isAvailableAsync","checkForInitialization","docManager","documentRows","getUnsyncedDocument","length","uploadDocToServer","logEvent","SDK_INFO","error","isSyncPending","leftDocuments","getAllUnsyncedDocs","insertDocument","fmsFolderID","data","base64","desc","dspID","filePath","fileType","fileName","geoTimeStamp","processedFilePath","priority","arguments","undefined","InvalidArgumentError","_this$docManager","console","log","insertResponse","forceDocumentSync","updateDocument","documentRow","fmsID","markDocumentSynced","id","err","message","SDK_WARNING","updateDocumentProcessedPath","origialFilePath","processedPath","updateProcesedFilePath","updateDocError","uploadError","updateDocSyncError","processImageData","processed_file_path","pFilePath","file_name","strGeoStamp","geo_timestamp","objGeoStamp","JSON","parse","dateTime","lat","lng","accuracy","strDMS","strDMSWithAccuracy","fontSize","fileSize","getItem","cRatio","nFileSize","Number","ncRatio","wholeRatio","Math","round","OS","options","backgroundImage","src","file_path","scale","watermarkTexts","text","position","topLeft","style","color","fontName","textBackgroundStyle","padding","type","none","quality","maxSize","filename","saveFormat","jpg","markText","completeFilePath","includes","processBase64Data","imagePath","TemporaryDirectoryPath","writeFile","processedBase64","splittedDase64Data","split","processPODData","_this$documentHttpCli","docRow","uploadDocument","extraParameters","folderName","fms_folder_id","SDK_ERROR","_error$response","_error$response2","cta","severityLevel","ERROR","eventName","API_ERROR","screenName","extraParams","stringify","response","status","getAllDocuments","dispatchID","clearSyncedDocs","deleteAllSyncedDocuments","_class"],"sources":["DocumentSyncManager.ts"],"sourcesContent":["import type { DocumentRow } from '../DBConfig';\nimport DocumentManager from './DocumentManager';\nimport DocumentHttpClient from './DocumentHttpClient';\nimport { isEmptyOrBlank, flattenObject } from '../../../utils/utils';\nimport { BaseError } from '../../../errors/BaseError';\nimport BaseErrorCodes, {\n InvalidArgumentsError,\n InvalidBaseURL,\n SyncManagerNotInitialized,\n} from '../../../errors/ErrorCodes';\nimport Logger, { LOG_TYPE } from '../../../utils/Logger';\nimport type { SQLResultSet } from 'expo-sqlite';\nimport NetworkUtil from '../../../utils/NetworkUtil';\nimport Marker, {\n Position,\n TextBackgroundType,\n ImageFormat,\n} from 'react-native-image-marker';\nimport RNFS from 'react-native-fs';\nimport Storage from '../../../utils/storage';\nimport { Platform } from 'react-native';\nimport { ScreenNameSdkConstants, SentryEventNameSdkConstants, SeverityLevelValue } from '../../../analytics/sentry/SentrySdkConstants';\nimport { fireEventWithScreenName } from '../../../analytics/sentry/SentryAnalyticsUtils';\nconst latlngToDms = require('latlng-to-dms');\n\n\nexport default class DocumentSyncManager {\n private documentHttpClient: DocumentHttpClient | undefined;\n private inProgress: boolean = false;\n private static instance: DocumentSyncManager;\n private docManager: DocumentManager | undefined;\n private maxRetryCount: number = 3;\n private _retries = 0;\n\n get retries(): number {\n return this._retries;\n }\n\n set retries(value: number) {\n this._retries = value;\n }\n\n private constructor() {}\n\n public init(baseURL: string, retryCount: number) {\n if (isEmptyOrBlank(baseURL))\n throw new BaseError(BaseErrorCodes.InvalidBaseURL, InvalidBaseURL);\n this.maxRetryCount = retryCount;\n this.documentHttpClient = new DocumentHttpClient(baseURL);\n }\n\n public static getInstance(): DocumentSyncManager {\n if (!DocumentSyncManager.instance) {\n DocumentSyncManager.instance = new DocumentSyncManager();\n }\n return DocumentSyncManager.instance;\n }\n\n public async startDocumentSync(): Promise<void> {\n if (!this.inProgress && this._retries < this.maxRetryCount) {\n this.inProgress = true;\n const hasNetwork = await NetworkUtil.isAvailableAsync();\n try {\n this.checkForInitialization();\n if (!this.docManager) {\n this.docManager = await DocumentManager.getInstance();\n }\n if (hasNetwork) {\n let documentRows: DocumentRow[] =\n await this.docManager.getUnsyncedDocument();\n if (documentRows?.length > 0) {\n await this.uploadDocToServer(documentRows[0]);\n } else {\n Logger.getInstance().logEvent(\n 'startDocumentSync',\n 'No data to sync',\n LOG_TYPE.SDK_INFO\n );\n }\n } else {\n Logger.getInstance().logEvent(\n 'startDocumentSync',\n 'No Network',\n LOG_TYPE.SDK_INFO\n );\n }\n } catch (error: any) {\n } finally {\n this.inProgress = false;\n if ((await this.isSyncPending()) && hasNetwork) {\n await this.startDocumentSync();\n }\n }\n } else {\n Logger.getInstance().logEvent(\n 'startDocumentSync',\n 'sync already in progress ',\n LOG_TYPE.SDK_INFO\n );\n }\n }\n\n public async isSyncPending(): Promise<boolean> {\n if (!this.docManager) this.docManager = await DocumentManager.getInstance();\n let leftDocuments = await this.docManager.getAllUnsyncedDocs();\n return leftDocuments?.length > 0 && this._retries < this.maxRetryCount;\n }\n\n public async insertDocument(\n fmsFolderID: string | null,\n data: string | null,\n base64: boolean,\n desc: string,\n dspID: string,\n // jobID: string,\n // objRef: string,\n filePath: string | null,\n fileType: string,\n fileName: string,\n geoTimeStamp: string,\n processedFilePath: string,\n priority: number = 1\n ): Promise<SQLResultSet> {\n if (\n isEmptyOrBlank(desc) ||\n isEmptyOrBlank(dspID) ||\n // isEmptyOrBlank(jobID) ||\n // isEmptyOrBlank(objRef) ||\n isEmptyOrBlank(fileType) ||\n isEmptyOrBlank(fileName) ||\n (base64 && isEmptyOrBlank(data)) ||\n (!base64 && isEmptyOrBlank(filePath))\n )\n throw new BaseError(\n BaseErrorCodes.InvalidArgumentError,\n InvalidArgumentsError\n );\n else {\n if (!this.docManager) {\n Logger.getInstance().logEvent(\n 'insertDocument',\n 'INIT DOC SYNC AGAIN',\n LOG_TYPE.SDK_INFO\n );\n this.docManager = await DocumentManager.getInstance();\n }\n console.log('insertDocument1:',fmsFolderID);\n let insertResponse = await this.docManager?.insertDocument(\n fmsFolderID,\n desc,\n dspID,\n // jobID,\n // objRef,\n base64,\n fileName,\n fileType,\n data,\n filePath,\n geoTimeStamp,\n processedFilePath,\n priority\n );\n return insertResponse;\n }\n }\n\n public async forceDocumentSync() {\n if (!this.docManager) this.docManager = await DocumentManager.getInstance();\n this._retries = 0;\n await this.startDocumentSync();\n }\n\n private async updateDocument(documentRow: DocumentRow, fmsID: string) {\n if (!this.docManager) this.docManager = await DocumentManager.getInstance();\n try {\n await this.docManager.markDocumentSynced(documentRow.id, fmsID);\n } catch (err: any) {\n Logger.getInstance().logEvent(\n 'updateDocument',\n err.message,\n LOG_TYPE.SDK_WARNING\n );\n }\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 private async updateDocumentProcessedPath(\n documentRow: DocumentRow,\n origialFilePath: String,\n processedPath: String\n ) {\n if (!this.docManager) this.docManager = await DocumentManager.getInstance();\n try {\n await this.docManager.updateProcesedFilePath(\n documentRow.id,\n origialFilePath,\n processedPath\n );\n } catch (err: any) {\n Logger.getInstance().logEvent(\n 'updateDocument',\n err.message,\n LOG_TYPE.SDK_WARNING\n );\n }\n }\n\n private async updateDocError(documentRow: DocumentRow, uploadError: string) {\n if (!this.docManager) this.docManager = await DocumentManager.getInstance();\n try {\n await this.docManager.updateDocSyncError(documentRow.id, uploadError);\n } catch (err: any) {\n Logger.getInstance().logEvent(\n 'updateDocError',\n err.message,\n LOG_TYPE.SDK_WARNING\n );\n }\n }\n private checkForInitialization() {\n if (!this.documentHttpClient) {\n throw new BaseError(\n BaseErrorCodes.SyncManagerNotInitialized,\n SyncManagerNotInitialized\n );\n }\n }\n\n // This function will generate overlay image and update documents table for processed_file_path columns with overlayed image path.\n private async processImageData(documentRow: DocumentRow) {\n // If processed_file_path of overlayed image already existing then do not generate it again.\n if (\n documentRow.processed_file_path === null ||\n documentRow.processed_file_path === ''\n ) {\n let pFilePath = 'processed_' + documentRow.file_name; // File name for processed file.\n let strGeoStamp = documentRow.geo_timestamp; // Saved geostamp string\n let objGeoStamp = JSON.parse(strGeoStamp); // Conversion to geostamp object\n let dateTime = objGeoStamp.dateTime; // Date time stamp in UTC format\n let lat = objGeoStamp.lat; // Latitide\n let lng = objGeoStamp.lng; // Longitude\n let accuracy = objGeoStamp.accuracy; // Location accuracy\n let strDMS = latlngToDms(`${lat}, ${lng}`); // Location in degree format\n let strDMSWithAccuracy = strDMS; \n if (accuracy !== '') {\n strDMSWithAccuracy = strDMS + ' (Accuracy: ' + accuracy + 'm)'; // Appedning accuracy in location \n }\n let fontSize = 14;\n \n let fileSize = await Storage.getInstance().getItem('maxSize'); // File max size\n let cRatio = await Storage.getInstance().getItem('cRatio'); // File compression ratio\n let nFileSize = Number(fileSize);\n let ncRatio = Number(cRatio);\n let wholeRatio = Math.round(ncRatio * 100); // Compression ratio to be made\n if (Platform.OS !== 'android') {\n fontSize = 28;\n }\n if(wholeRatio >= 75){\n wholeRatio = 25;\n }\n const options = {\n backgroundImage: { // Image for overlay\n src: documentRow.file_path,\n scale: 1,\n },\n watermarkTexts: [ \n {\n text: `${dateTime}\\n${strDMSWithAccuracy}`, //Overlay text\n position: {\n position: Position.topLeft, // Overlay text position\n },\n style: { // Style for overlay\n color: '#ffffff',\n fontSize: fontSize,\n fontName: 'Arial',\n textBackgroundStyle: {\n padding: '1% 1%',\n type: TextBackgroundType.none,\n color: '#444444CC',\n },\n },\n },\n ],\n scale: 1,\n quality: 100 - wholeRatio, // Compressio ratio in which file will generate\n maxSize: nFileSize, // Max file size in which file will generate\n filename: pFilePath,\n saveFormat: ImageFormat.jpg, // Saving in jpeg format\n };\n let processedFilePath = await Marker.markText(options); // Generating overlay image\n if (processedFilePath !== null && processedFilePath !== '') {\n let completeFilePath = processedFilePath;\n // If processd image file path does not have prefix file:// then we are addding manually\n if (!processedFilePath.includes('file')) {\n completeFilePath = 'file://' + processedFilePath;\n }\n // Updating document document table with overlayed image path\n this.updateDocumentProcessedPath(\n documentRow,\n documentRow.file_path, //original file path catprued from camera\n completeFilePath // completeFilePath is the path with file:// of processed file \n );\n documentRow.processed_file_path = completeFilePath; \n }\n }\n return documentRow;\n }\n\n // This function will generate overlay base64 data and update documents table for processed_file_path columns with overlayed base64 data.\n private async processBase64Data(documentRow: DocumentRow) {\n // If base64 overlayed data already existing then do not generate it again.\n if (\n documentRow.processed_file_path === null ||\n documentRow.processed_file_path === ''\n ) {\n let filePath = '';\n // If templrary base 64 file already exist then do not create again\n if (documentRow.file_path === null || documentRow.file_path === '') {\n const imagePath = `${RNFS.TemporaryDirectoryPath}/${documentRow.file_name}`;\n await RNFS.writeFile(imagePath, documentRow.data, 'base64'); // Write file to temprary location\n filePath = imagePath;\n // If file generated frommbase64 data does not have file:// then we are adding manually.\n if (!imagePath.includes('file')) {\n filePath = `file://${imagePath}`;\n }\n documentRow.file_path = filePath;\n } else {\n filePath = documentRow.file_path;\n }\n let pFilePath = 'processed_' + documentRow.file_name; // File name for processed file.\n let strGeoStamp = documentRow.geo_timestamp; // Saved geostamp string\n let objGeoStamp = JSON.parse(strGeoStamp); // Conversion to geostamp object\n let dateTime = objGeoStamp.dateTime; // Date time stamp in UTC format\n let lat = objGeoStamp.lat; // Latitide\n let lng = objGeoStamp.lng; // Longitude\n let accuracy = objGeoStamp.accuracy; // Location accuracy\n let strDMS = latlngToDms(`${lat}, ${lng}`); // Location in degree format\n let strDMSWithAccuracy = strDMS; \n if (accuracy !== '') {\n strDMSWithAccuracy = strDMS + ' (Accuracy: ' + accuracy + 'm)'; // Appedning accuracy in location \n }\n const options = {\n backgroundImage: {\n src: filePath, // Image for overlay\n scale: 1,\n },\n watermarkTexts: [\n {\n text: `${dateTime}\\n${strDMSWithAccuracy}`, // Ooverlay text\n position: {\n position: Position.topLeft, // Overlay text position\n },\n style: { // Style for overlay\n color: '#ffffff',\n fontSize: 14,\n fontName: 'Arial',\n textBackgroundStyle: {\n padding: '1% 1%',\n type: TextBackgroundType.none,\n color: '#444444CC',\n },\n },\n },\n ],\n scale: 1,\n quality: 100,\n filename: pFilePath,\n saveFormat: ImageFormat.base64, // Saving in base6 format\n };\n let processedBase64 = await Marker.markText(options); // Generating overlay image\n if (processedBase64 !== null && processedBase64 !== '') {\n // Fetching base64 data from processed data.\n var splittedDase64Data = processedBase64.split(\n 'data:image/png;base64,'\n );\n // Updating document document table with overlayed base64 data\n await this.updateDocumentProcessedPath(\n documentRow,\n filePath,\n splittedDase64Data[1]\n );\n documentRow.processed_file_path = splittedDase64Data[1];\n }\n }\n return documentRow;\n }\n\n // This function will calling respective overlay method for base64 (for signature POD) or image (for image POD).\n private async processPODData(documentRow: DocumentRow) {\n if (documentRow.base64 && documentRow.data != null) {\n return await this.processBase64Data(documentRow);\n } else {\n return await this.processImageData(documentRow);\n }\n }\n\n private async uploadDocToServer(documentRow: DocumentRow) {\n try {\n let docRow = await this.processPODData(documentRow);\n console.log('uploadDocToServer999:', docRow);\n let fmsID = await this.documentHttpClient?.uploadDocument(documentRow);\n\n let extraParameters = {\n fmsID: fmsID ?? '',\n fileName: docRow.file_name,\n folderName: docRow.fms_folder_id\n };\n // TODO: SOLELY DEPENDS ON FMS_ID WHICH IS WRONG => IT SHOULD BE Response.status = 202\n if (fmsID) {\n this._retries = 0;\n await this.updateDocument(docRow, fmsID);\n } else {\n this._retries++;\n Logger.getInstance().logEvent(\n 'uploadDocToServer-empty-fms-id',\n flattenObject(extraParameters),\n LOG_TYPE.SDK_ERROR\n );\n await this.updateDocError(docRow, 'Unexpected Error');\n }\n } catch (error: any) {\n const cta = 'uploadDocToServer-error';\n fireEventWithScreenName({\n severityLevel: SeverityLevelValue.ERROR,\n eventName: SentryEventNameSdkConstants.API_ERROR,\n screenName: cta,\n cta: cta,\n extraParams: {\n error: error.message,\n },\n });\n this._retries++;\n Logger.getInstance().logEvent(\n 'uploadDocToServer-sync-error',\n error.message,\n LOG_TYPE.SDK_ERROR\n );\n await this.updateDocError(\n documentRow,\n JSON.stringify({\n message: error.message,\n error: JSON.stringify(error?.response?.data),\n status: error?.response?.status,\n })\n );\n }\n }\n\n public async getAllDocuments(dispatchID?: string): Promise<DocumentRow[]> {\n if (!this.docManager) this.docManager = await DocumentManager.getInstance();\n return this.docManager.getAllDocuments(dispatchID);\n }\n\n public async clearSyncedDocs(dspID: string) {\n if (!this.docManager) this.docManager = await DocumentManager.getInstance();\n if (dspID) await this.docManager.deleteAllSyncedDocuments(dspID);\n }\n}\n"],"mappings":";;;;AACA,OAAOA,eAAe,MAAM,mBAAmB;AAC/C,OAAOC,kBAAkB,MAAM,sBAAsB;AACrD,SAASC,cAAc,EAAEC,aAAa,QAAQ,sBAAsB;AACpE,SAASC,SAAS,QAAQ,2BAA2B;AACrD,OAAOC,cAAc,IACnBC,qBAAqB,EACrBC,cAAc,EACdC,yBAAyB,QACpB,4BAA4B;AACnC,OAAOC,MAAM,IAAIC,QAAQ,QAAQ,uBAAuB;AAExD,OAAOC,WAAW,MAAM,4BAA4B;AACpD,OAAOC,MAAM,IACXC,QAAQ,EACRC,kBAAkB,EAClBC,WAAW,QACN,2BAA2B;AAClC,OAAOC,IAAI,MAAM,iBAAiB;AAClC,OAAOC,OAAO,MAAM,wBAAwB;AAC5C,SAASC,QAAQ,QAAQ,cAAc;AACvC,SAAiCC,2BAA2B,EAAEC,kBAAkB,QAAQ,8CAA8C;AACtI,SAASC,uBAAuB,QAAQ,gDAAgD;AACxF,MAAMC,WAAW,GAAGC,OAAO,CAAC,eAAe,CAAC;AAG5C,eAAe,MAAMC,mBAAmB,CAAC;EAQvC,IAAIC,OAAOA,CAAA,EAAW;IACpB,OAAO,IAAI,CAACC,QAAQ;EACtB;EAEA,IAAID,OAAOA,CAACE,KAAa,EAAE;IACzB,IAAI,CAACD,QAAQ,GAAGC,KAAK;EACvB;EAEQC,WAAWA,CAAA,EAAG;IAAAC,eAAA;IAAAA,eAAA,qBAdQ,KAAK;IAAAA,eAAA;IAAAA,eAAA,wBAGH,CAAC;IAAAA,eAAA,mBAC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EkH,QAAQ,cAAAT,gBAAA,uBAAfA,gBAAA,CAAiBU;MAC3B,CAAC,CACH,CAAC;IACH;EACF;EAEA,MAAaC,eAAeA,CAACC,UAAmB,EAA0B;IACxE,IAAI,CAAC,IAAI,CAAC5H,UAAU,EAAE,IAAI,CAACA,UAAU,GAAG,MAAM1C,eAAe,CAACmC,WAAW,CAAC,CAAC;IAC3E,OAAO,IAAI,CAACO,UAAU,CAAC2H,eAAe,CAACC,UAAU,CAAC;EACpD;EAEA,MAAaC,eAAeA,CAAC7G,KAAa,EAAE;IAC1C,IAAI,CAAC,IAAI,CAAChB,UAAU,EAAE,IAAI,CAACA,UAAU,GAAG,MAAM1C,eAAe,CAACmC,WAAW,CAAC,CAAC;IAC3E,IAAIuB,KAAK,EAAE,MAAM,IAAI,CAAChB,UAAU,CAAC8H,wBAAwB,CAAC9G,KAAK,CAAC;EAClE;AACF;AAAC+G,MAAA,GA/aoBjJ,mBAAmB;AAAAK,eAAA,CAAnBL,mBAAmB"}
1
+ {"version":3,"names":["DocumentManager","DocumentHttpClient","isEmptyOrBlank","flattenObject","BaseError","BaseErrorCodes","InvalidArgumentsError","InvalidBaseURL","SyncManagerNotInitialized","Logger","LOG_TYPE","NetworkUtil","Marker","Position","TextBackgroundType","ImageFormat","RNFS","Platform","SentryEventNameSdkConstants","SeverityLevelValue","fireEventWithScreenName","latlngToDms","require","DocumentSyncManager","retries","_retries","value","constructor","_defineProperty","init","baseURL","retryCount","maxRetryCount","documentHttpClient","getInstance","instance","startDocumentSync","inProgress","hasNetwork","isAvailableAsync","checkForInitialization","docManager","documentRows","getUnsyncedDocument","length","uploadDocToServer","cta","severityLevel","LOG","eventName","APP_LOG","screenName","extraParams","msg","logEvent","SDK_ERROR","error","isSyncPending","updateDocPriority","id","priority","leftDocuments","getAllUnsyncedDocs","insertDocument","fmsFolderID","data","base64","desc","dspID","filePath","fileType","fileName","geoTimeStamp","processedFilePath","InvalidArgumentError","_this$docManager","console","log","insertResponse","forceDocumentSync","updateDocument","documentRow","fmsID","markDocumentSynced","err","SDK_WARNING","updateDocumentProcessedPath","origialFilePath","processedPath","updateProcesedFilePath","ERROR","APP_ERROR","updateDocError","uploadError","updateDocSyncError","processImageData","processed_file_path","pFilePath","file_name","strGeoStamp","geo_timestamp","objGeoStamp","JSON","parse","dateTime","lat","lng","accuracy","strDMS","strDMSWithAccuracy","fontSize","OS","options","backgroundImage","src","file_path","scale","watermarkTexts","text","position","topLeft","style","color","fontName","textBackgroundStyle","padding","type","none","quality","filename","saveFormat","jpg","markText","completeFilePath","includes","processBase64Data","imagePath","TemporaryDirectoryPath","writeFile","processedBase64","splittedDase64Data","split","processPODData","_this$documentHttpCli","docRow","geoStampAvailable","extra","fName","substring","dName","fms_folder_id","dispId","dispatch_id","uploadDocument","extraParameters","_error$response","_error$response2","API_ERROR","stringify","message","response","status","getAllDocuments","dispatchID","clearSyncedDocs","deleteAllSyncedDocuments","_DocumentSyncManager"],"sources":["DocumentSyncManager.ts"],"sourcesContent":["import type { DocumentRow } from '../DBConfig';\nimport DocumentManager from './DocumentManager';\nimport DocumentHttpClient from './DocumentHttpClient';\nimport { isEmptyOrBlank, flattenObject } from '../../../utils/utils';\nimport { BaseError } from '../../../errors/BaseError';\nimport BaseErrorCodes, {\n InvalidArgumentsError,\n InvalidBaseURL,\n SyncManagerNotInitialized,\n} from '../../../errors/ErrorCodes';\nimport Logger, { LOG_TYPE } from '../../../utils/Logger';\nimport type { SQLResultSet } from 'expo-sqlite';\nimport NetworkUtil from '../../../utils/NetworkUtil';\nimport Marker, {\n Position,\n TextBackgroundType,\n ImageFormat,\n} from 'react-native-image-marker';\nimport RNFS from 'react-native-fs';\nimport Storage from '../../../utils/storage';\nimport { Platform } from 'react-native';\nimport { ScreenNameSdkConstants, SentryEventNameSdkConstants, SeverityLevelValue } from '../../../analytics/sentry/SentrySdkConstants';\nimport { fireEventWithScreenName } from '../../../analytics/sentry/SentryAnalyticsUtils';\nconst latlngToDms = require('latlng-to-dms');\n\n\nexport default class DocumentSyncManager {\n private documentHttpClient: DocumentHttpClient | undefined;\n private inProgress: boolean = false;\n private static instance: DocumentSyncManager;\n private docManager: DocumentManager | undefined;\n private maxRetryCount: number = 3;\n private _retries = 0;\n get retries(): number {\n return this._retries;\n }\n\n set retries(value: number) {\n this._retries = value;\n }\n\n private constructor() {}\n\n public init(baseURL: string, retryCount: number) {\n if (isEmptyOrBlank(baseURL))\n throw new BaseError(BaseErrorCodes.InvalidBaseURL, InvalidBaseURL);\n this.maxRetryCount = retryCount;\n this.documentHttpClient = new DocumentHttpClient(baseURL);\n }\n\n public static getInstance(): DocumentSyncManager {\n if (!DocumentSyncManager.instance) {\n DocumentSyncManager.instance = new DocumentSyncManager();\n }\n return DocumentSyncManager.instance;\n }\n\n public async startDocumentSync(): Promise<void> {\n if (!this.inProgress && this._retries < this.maxRetryCount) {\n this.inProgress = true;\n const hasNetwork = await NetworkUtil.isAvailableAsync();\n try {\n this.checkForInitialization();\n if (!this.docManager) {\n this.docManager = await DocumentManager.getInstance();\n }\n if (hasNetwork) {\n let documentRows: DocumentRow[] =\n await this.docManager.getUnsyncedDocument();\n if (documentRows?.length > 0) {\n await this.uploadDocToServer(documentRows[0]);\n } else {\n let cta = 'startDocumentSync'\n fireEventWithScreenName({\n severityLevel: SeverityLevelValue.LOG,\n eventName: SentryEventNameSdkConstants.APP_LOG,\n screenName: cta,\n cta: cta,\n extraParams: {\n msg:'No data to sync'\n },\n });\n Logger.getInstance().logEvent(\n cta,\n 'No data to sync',\n LOG_TYPE.SDK_ERROR\n );\n }\n } else {\n let cta = 'startDocumentSync'\n fireEventWithScreenName({\n severityLevel: SeverityLevelValue.LOG,\n eventName: SentryEventNameSdkConstants.APP_LOG,\n screenName: cta,\n cta: cta,\n extraParams: {\n msg:'No Network'\n },\n });\n Logger.getInstance().logEvent(\n cta,\n 'No Network',\n LOG_TYPE.SDK_ERROR\n );\n }\n } catch (error: any) {\n } finally {\n this.inProgress = false;\n if ((await this.isSyncPending()) && hasNetwork) {\n await this.startDocumentSync();\n }\n }\n } else {\n if (!this.docManager) {\n this.docManager = await DocumentManager.getInstance();\n }\n let documentRows: DocumentRow[] =\n await this.docManager.getUnsyncedDocument();\n if (documentRows?.length > 0) {\n await this.docManager.updateDocPriority(documentRows[0].id, documentRows[0].priority + 1);\n this._retries = 0;\n this.startDocumentSync();\n }\n let cta = 'startDocumentSync'\n fireEventWithScreenName({\n severityLevel: SeverityLevelValue.LOG,\n eventName: SentryEventNameSdkConstants.APP_LOG,\n screenName: cta,\n cta: cta,\n extraParams: {\n msg:'sync already in progress'\n },\n });\n Logger.getInstance().logEvent(\n cta,\n 'sync already in progress',\n LOG_TYPE.SDK_ERROR\n );\n }\n }\n\n public async isSyncPending(): Promise<boolean> {\n if (!this.docManager) this.docManager = await DocumentManager.getInstance();\n let leftDocuments = await this.docManager.getAllUnsyncedDocs();\n return leftDocuments?.length > 0 && this._retries < this.maxRetryCount;\n }\n\n public async insertDocument(\n fmsFolderID: string | null,\n data: string | null,\n base64: boolean,\n desc: string,\n dspID: string,\n // jobID: string,\n // objRef: string,\n filePath: string | null,\n fileType: string,\n fileName: string,\n geoTimeStamp: string,\n processedFilePath: string,\n priority: number = 1\n ): Promise<SQLResultSet> {\n if (\n isEmptyOrBlank(desc) ||\n isEmptyOrBlank(dspID) ||\n // isEmptyOrBlank(jobID) ||\n // isEmptyOrBlank(objRef) ||\n isEmptyOrBlank(fileType) ||\n isEmptyOrBlank(fileName) ||\n (base64 && isEmptyOrBlank(data)) ||\n (!base64 && isEmptyOrBlank(filePath))\n )\n throw new BaseError(\n BaseErrorCodes.InvalidArgumentError,\n InvalidArgumentsError\n );\n else {\n if (!this.docManager) {\n let cta = 'insertDocument'\n fireEventWithScreenName({\n severityLevel: SeverityLevelValue.LOG,\n eventName: SentryEventNameSdkConstants.APP_LOG,\n screenName: cta,\n cta: cta,\n extraParams: {\n msg:'INIT DOC SYNC AGAIN'\n },\n });\n Logger.getInstance().logEvent(\n cta,\n 'INIT DOC SYNC AGAIN',\n LOG_TYPE.SDK_ERROR\n );\n this.docManager = await DocumentManager.getInstance();\n }\n console.log('insertDocument1:',fmsFolderID);\n let insertResponse = await this.docManager?.insertDocument(\n fmsFolderID,\n desc,\n dspID,\n // jobID,\n // objRef,\n base64,\n fileName,\n fileType,\n data,\n filePath,\n geoTimeStamp,\n processedFilePath,\n priority\n );\n return insertResponse;\n }\n }\n\n public async forceDocumentSync() {\n if (!this.docManager) this.docManager = await DocumentManager.getInstance();\n this._retries = 0;\n await this.startDocumentSync();\n }\n\n private async updateDocument(documentRow: DocumentRow, fmsID: string) {\n if (!this.docManager) this.docManager = await DocumentManager.getInstance();\n try {\n await this.docManager.markDocumentSynced(documentRow.id, fmsID);\n } catch (err: any) {\n let cta = 'updateDocument'\n fireEventWithScreenName({\n severityLevel: SeverityLevelValue.LOG,\n eventName: SentryEventNameSdkConstants.APP_LOG,\n screenName: cta,\n cta: cta,\n extraParams: {\n msg:err\n },\n });\n Logger.getInstance().logEvent(\n cta,\n err,\n LOG_TYPE.SDK_WARNING\n );\n }\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 private async updateDocumentProcessedPath(\n documentRow: DocumentRow,\n origialFilePath: String,\n processedPath: String\n ) {\n if (!this.docManager) this.docManager = await DocumentManager.getInstance();\n try {\n await this.docManager.updateProcesedFilePath(\n documentRow.id,\n origialFilePath,\n processedPath\n );\n } catch (err: any) {\n let cta = 'updateDocument'\n fireEventWithScreenName({\n severityLevel: SeverityLevelValue.ERROR,\n eventName: SentryEventNameSdkConstants.APP_ERROR,\n screenName: cta,\n cta: cta,\n extraParams: {\n msg:err\n },\n });\n Logger.getInstance().logEvent(\n cta,\n err,\n LOG_TYPE.SDK_WARNING\n );\n }\n }\n\n private async updateDocError(documentRow: DocumentRow, uploadError: string) {\n if (!this.docManager) this.docManager = await DocumentManager.getInstance();\n try {\n await this.docManager.updateDocSyncError(documentRow.id, uploadError);\n } catch (err: any) {\n let cta = 'updateDocError'\n fireEventWithScreenName({\n severityLevel: SeverityLevelValue.ERROR,\n eventName: SentryEventNameSdkConstants.APP_ERROR,\n screenName: cta,\n cta: cta,\n extraParams: {\n msg:err\n },\n });\n Logger.getInstance().logEvent(\n cta,\n err,\n LOG_TYPE.SDK_WARNING\n );\n }\n }\n private checkForInitialization() {\n if (!this.documentHttpClient) {\n throw new BaseError(\n BaseErrorCodes.SyncManagerNotInitialized,\n SyncManagerNotInitialized\n );\n }\n }\n\n // This function will generate overlay image and update documents table for processed_file_path columns with overlayed image path.\n private async processImageData(documentRow: DocumentRow) {\n // If processed_file_path of overlayed image already existing then do not generate it again.\n if (\n documentRow.processed_file_path === null ||\n documentRow.processed_file_path === ''\n ) {\n let pFilePath = 'processed_' + documentRow.file_name; // File name for processed file.\n let strGeoStamp = documentRow.geo_timestamp; // Saved geostamp string\n let objGeoStamp = JSON.parse(strGeoStamp); // Conversion to geostamp object\n let dateTime = objGeoStamp.dateTime; // Date time stamp in UTC format\n let lat = objGeoStamp.lat; // Latitide\n let lng = objGeoStamp.lng; // Longitude\n let accuracy = objGeoStamp.accuracy; // Location accuracy\n let strDMS = latlngToDms(`${lat}, ${lng}`); // Location in degree format\n let strDMSWithAccuracy = strDMS; \n if (accuracy !== '') {\n strDMSWithAccuracy = strDMS + ' (Accuracy: ' + accuracy + 'm)'; // Appedning accuracy in location \n }\n let fontSize = 14;\n if (Platform.OS !== 'android') {\n fontSize = 28;\n }\n const options = {\n backgroundImage: { // Image for overlay\n src: documentRow.file_path,\n scale: 1,\n },\n watermarkTexts: [ \n {\n text: `${dateTime}\\n${strDMSWithAccuracy}`, //Overlay text\n position: {\n position: Position.topLeft, // Overlay text position\n },\n style: { // Style for overlay\n color: '#ffffff',\n fontSize: fontSize,\n fontName: 'Arial',\n textBackgroundStyle: {\n padding: '1% 1%',\n type: TextBackgroundType.none,\n color: '#444444CC',\n },\n },\n },\n ],\n scale: 0,\n quality: 100, \n filename: pFilePath,\n saveFormat: ImageFormat.jpg, // Saving in jpeg format\n };\n let processedFilePath = await Marker.markText(options); // Generating overlay image\n if (processedFilePath !== null && processedFilePath !== '') {\n let completeFilePath = processedFilePath;\n // If processd image file path does not have prefix file:// then we are addding manually\n if (!processedFilePath.includes('file')) {\n completeFilePath = 'file://' + processedFilePath;\n }\n // Updating document document table with overlayed image path\n this.updateDocumentProcessedPath(\n documentRow,\n documentRow.file_path, //original file path catprued from camera\n completeFilePath // completeFilePath is the path with file:// of processed file \n );\n documentRow.processed_file_path = completeFilePath; \n }\n }\n return documentRow;\n }\n\n // This function will generate overlay base64 data and update documents table for processed_file_path columns with overlayed base64 data.\n private async processBase64Data(documentRow: DocumentRow) {\n // If base64 overlayed data already existing then do not generate it again.\n if (\n documentRow.processed_file_path === null ||\n documentRow.processed_file_path === ''\n ) {\n let filePath = '';\n // If templrary base 64 file already exist then do not create again\n if (documentRow.file_path === null || documentRow.file_path === '') {\n const imagePath = `${RNFS.TemporaryDirectoryPath}/${documentRow.file_name}`;\n await RNFS.writeFile(imagePath, documentRow.data, 'base64'); // Write file to temprary location\n filePath = imagePath;\n // If file generated frommbase64 data does not have file:// then we are adding manually.\n if (!imagePath.includes('file')) {\n filePath = `file://${imagePath}`;\n }\n documentRow.file_path = filePath;\n } else {\n filePath = documentRow.file_path;\n }\n let pFilePath = 'processed_' + documentRow.file_name; // File name for processed file.\n let strGeoStamp = documentRow.geo_timestamp; // Saved geostamp string\n let objGeoStamp = JSON.parse(strGeoStamp); // Conversion to geostamp object\n let dateTime = objGeoStamp.dateTime; // Date time stamp in UTC format\n let lat = objGeoStamp.lat; // Latitide\n let lng = objGeoStamp.lng; // Longitude\n let accuracy = objGeoStamp.accuracy; // Location accuracy\n let strDMS = latlngToDms(`${lat}, ${lng}`); // Location in degree format\n let strDMSWithAccuracy = strDMS; \n if (accuracy !== '') {\n strDMSWithAccuracy = strDMS + ' (Accuracy: ' + accuracy + 'm)'; // Appedning accuracy in location \n }\n const options = {\n backgroundImage: {\n src: filePath, // Image for overlay\n scale: 1,\n },\n watermarkTexts: [\n {\n text: `${dateTime}\\n${strDMSWithAccuracy}`, // Ooverlay text\n position: {\n position: Position.topLeft, // Overlay text position\n },\n style: { // Style for overlay\n color: '#ffffff',\n fontSize: 14,\n fontName: 'Arial',\n textBackgroundStyle: {\n padding: '1% 1%',\n type: TextBackgroundType.none,\n color: '#444444CC',\n },\n },\n },\n ],\n scale: 1,\n quality: 100,\n filename: pFilePath,\n saveFormat: ImageFormat.base64, // Saving in base6 format\n };\n let processedBase64 = await Marker.markText(options); // Generating overlay image\n if (processedBase64 !== null && processedBase64 !== '') {\n // Fetching base64 data from processed data.\n var splittedDase64Data = processedBase64.split(\n 'data:image/png;base64,'\n );\n // Updating document document table with overlayed base64 data\n await this.updateDocumentProcessedPath(\n documentRow,\n filePath,\n splittedDase64Data[1]\n );\n documentRow.processed_file_path = splittedDase64Data[1];\n }\n }\n return documentRow;\n }\n\n // This function will calling respective overlay method for base64 (for signature POD) or image (for image POD).\n private async processPODData(documentRow: DocumentRow) {\n if (documentRow.base64 && documentRow.data != null) {\n return await this.processBase64Data(documentRow);\n } else {\n return await this.processImageData(documentRow);\n }\n }\n\n private async uploadDocToServer(documentRow: DocumentRow) {\n try {\n let docRow = documentRow;\n let cta = 'uploadDocToServer-geoStamp';\n let geoStampAvailable = false\n if(documentRow.geo_timestamp && documentRow.geo_timestamp.length != 0){\n geoStampAvailable = true;\n docRow = await this.processPODData(documentRow);\n }\n let extra = {\n msg: geoStampAvailable ? \"geoStamp availale\" : 'geoStamp not availale',\n fName: docRow.file_name && docRow.file_name.length != 0 ? docRow.file_name.substring(4): '',\n dName: docRow.fms_folder_id && docRow.fms_folder_id.length != 0 ? docRow.fms_folder_id.substring(4): '',\n dispId: docRow.dispatch_id && docRow.dispatch_id.length != 0 ? docRow.dispatch_id.substring(9): ''\n };\n fireEventWithScreenName({\n severityLevel: SeverityLevelValue.LOG,\n eventName: SentryEventNameSdkConstants.APP_LOG,\n screenName: cta,\n cta: cta,\n extraParams: extra,\n });\n Logger.getInstance().logEvent(\n cta,\n flattenObject(extra),\n LOG_TYPE.SDK_ERROR\n );\n console.log('uploadDocToServer999:', docRow);\n let fmsID = await this.documentHttpClient?.uploadDocument(docRow);\n\n let extraParameters = {\n fmsID: fmsID ?? '',\n fName: docRow.file_name && docRow.file_name.length != 0 ? docRow.file_name.substring(4): '',\n dName: docRow.fms_folder_id && docRow.fms_folder_id.length != 0 ? docRow.fms_folder_id.substring(4): '',\n dispId: docRow.dispatch_id && docRow.dispatch_id.length != 0 ? docRow.dispatch_id.substring(9): ''\n };\n // TODO: SOLELY DEPENDS ON FMS_ID WHICH IS WRONG => IT SHOULD BE Response.status = 202\n if (fmsID) {\n this._retries = 0;\n await this.updateDocument(docRow, fmsID);\n } else {\n this._retries++;\n let cta = 'uploadDocToServer-empty-fms-id'\n fireEventWithScreenName({\n severityLevel: SeverityLevelValue.LOG,\n eventName: SentryEventNameSdkConstants.APP_LOG,\n screenName: cta,\n cta: cta,\n extraParams: extraParameters,\n });\n Logger.getInstance().logEvent(\n cta,\n flattenObject(extraParameters),\n LOG_TYPE.SDK_ERROR\n );\n await this.updateDocError(docRow, 'Unexpected Error');\n }\n } catch (error: any) {\n const cta = 'uploadDocToServer-error';\n fireEventWithScreenName({\n severityLevel: SeverityLevelValue.ERROR,\n eventName: SentryEventNameSdkConstants.API_ERROR,\n screenName: cta,\n cta: cta,\n extraParams: {\n error: error,\n },\n });\n Logger.getInstance().logEvent(\n cta,\n error,\n LOG_TYPE.SDK_ERROR\n );\n this._retries++;\n await this.updateDocError(\n documentRow,\n JSON.stringify({\n message: error.message,\n error: JSON.stringify(error?.response?.data),\n status: error?.response?.status,\n })\n );\n }\n }\n\n public async getAllDocuments(dispatchID?: string): Promise<DocumentRow[]> {\n if (!this.docManager) this.docManager = await DocumentManager.getInstance();\n return this.docManager.getAllDocuments(dispatchID);\n }\n\n public async clearSyncedDocs(dspID: string) {\n if (!this.docManager) this.docManager = await DocumentManager.getInstance();\n if (dspID) await this.docManager.deleteAllSyncedDocuments(dspID);\n }\n}\n"],"mappings":";;;;AACA,OAAOA,eAAe,MAAM,mBAAmB;AAC/C,OAAOC,kBAAkB,MAAM,sBAAsB;AACrD,SAASC,cAAc,EAAEC,aAAa,QAAQ,sBAAsB;AACpE,SAASC,SAAS,QAAQ,2BAA2B;AACrD,OAAOC,cAAc,IACnBC,qBAAqB,EACrBC,cAAc,EACdC,yBAAyB,QACpB,4BAA4B;AACnC,OAAOC,MAAM,IAAIC,QAAQ,QAAQ,uBAAuB;AAExD,OAAOC,WAAW,MAAM,4BAA4B;AACpD,OAAOC,MAAM,IACXC,QAAQ,EACRC,kBAAkB,EAClBC,WAAW,QACN,2BAA2B;AAClC,OAAOC,IAAI,MAAM,iBAAiB;AAElC,SAASC,QAAQ,QAAQ,cAAc;AACvC,SAAiCC,2BAA2B,EAAEC,kBAAkB,QAAQ,8CAA8C;AACtI,SAASC,uBAAuB,QAAQ,gDAAgD;AACxF,MAAMC,WAAW,GAAGC,OAAO,CAAC,eAAe,CAAC;AAG5C,eAAe,MAAMC,mBAAmB,CAAC;EAOvC,IAAIC,OAAOA,CAAA,EAAW;IACpB,OAAO,IAAI,CAACC,QAAQ;EACtB;EAEA,IAAID,OAAOA,CAACE,KAAa,EAAE;IACzB,IAAI,CAACD,QAAQ,GAAGC,KAAK;EACvB;EAEQC,WAAWA,CAAA,EAAG;IAAAC,eAAA;IAAAA,eAAA,qBAbQ,KAAK;IAAAA,eAAA;IAAAA,eAAA,wBAGH,CAAC;IAAAA,eAAA,mBACd,CAAC;EASG;EAEhBC,IAAIA,CAACC,OAAe,EAAEC,UAAkB,EAAE;IAC/C,IAAI7B,cAAc,CAAC4B,OAAO,CAAC,EACzB,MAAM,IAAI1B,SAAS,CAACC,cAAc,CAACE,cAAc,EAAEA,cAAc,CAAC;IACpE,IAAI,CAACyB,aAAa,GAAGD,UAAU;IAC/B,IAAI,CAACE,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G,KAAK,CAAC;EAClE;AACF;AAACkG,oBAAA,GArhBoB/I,mBAAmB;AAAAK,eAAA,CAAnBL,mBAAmB","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":[],"sources":["models.ts"],"sourcesContent":["export type FILE_TAGS = {\n key: string;\n value: string;\n};\n"],"mappings":""}
1
+ {"version":3,"names":[],"sources":["models.ts"],"sourcesContent":["export type FILE_TAGS = {\n key: string;\n value: string;\n};\n"],"mappings":"","ignoreList":[]}
@@ -1,7 +1,7 @@
1
- var _class;
1
+ var _ETEventsManager;
2
2
  function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
3
- function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
4
- function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
3
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
4
+ function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
5
5
  import { isEmptyOrBlank } from '../../../utils/utils';
6
6
  import { DispatchSyncType, EVENTS_COLUMNS, EVENTS_TABLE } from '../DBConfig';
7
7
  import * as Database from '../database';
@@ -218,7 +218,6 @@ export default class ETEventsManager {
218
218
  // ? _evData.meta.jobId + _evData.meta.objectiveReference
219
219
  // : 'NO_REF_FOUND'
220
220
  );
221
-
222
221
  queryData.push({
223
222
  query: `INSERT INTO ${EVENTS_TABLE}(\
224
223
  ${EVENTS_COLUMNS.PAYLOAD},\
@@ -501,6 +500,6 @@ export default class ETEventsManager {
501
500
  return sqlResult.rows._array;
502
501
  }
503
502
  }
504
- _class = ETEventsManager;
503
+ _ETEventsManager = ETEventsManager;
505
504
  _defineProperty(ETEventsManager, "instance", void 0);
506
505
  //# sourceMappingURL=ETEventsManager.js.map