@os1-platform/dispatch-mobile 2.1.8 → 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 (544) 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 +1 -1
  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 +128 -28
  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.map +1 -1
  319. package/lib/module/components/executiontasks/imageCapture/ImageCapture.js +9 -11
  320. package/lib/module/components/executiontasks/imageCapture/ImageCapture.js.map +1 -1
  321. package/lib/module/components/executiontasks/payments/PaymentStyles.js.map +1 -1
  322. package/lib/module/components/executiontasks/payments/PaymentUtils.js.map +1 -1
  323. package/lib/module/components/executiontasks/payments/completePayment/CompletePaymentET.js.map +1 -1
  324. package/lib/module/components/executiontasks/payments/completePayment/CompletePaymentSchema.js.map +1 -1
  325. package/lib/module/components/executiontasks/payments/init/InitPaymentET.js +3 -4
  326. package/lib/module/components/executiontasks/payments/init/InitPaymentET.js.map +1 -1
  327. package/lib/module/components/executiontasks/payments/init/InitPaymentSchema.js.map +1 -1
  328. package/lib/module/components/executiontasks/payments/processPayment/ProcessPaymentET.js.map +1 -1
  329. package/lib/module/components/executiontasks/payments/processPayment/ProcessPaymentSchema.js.map +1 -1
  330. package/lib/module/components/executiontasks/pickup/PickpSchema.js.map +1 -1
  331. package/lib/module/components/executiontasks/pickup/PickupET.js +13 -19
  332. package/lib/module/components/executiontasks/pickup/PickupET.js.map +1 -1
  333. package/lib/module/components/executiontasks/pickup/SLPickupET.js +14 -20
  334. package/lib/module/components/executiontasks/pickup/SLPickupET.js.map +1 -1
  335. package/lib/module/components/executiontasks/scan/ScanET.js +1 -3
  336. package/lib/module/components/executiontasks/scan/ScanET.js.map +1 -1
  337. package/lib/module/components/executiontasks/scan/ScanSchema.js.map +1 -1
  338. package/lib/module/components/executiontasks/scan/constants.js.map +1 -1
  339. package/lib/module/components/executiontasks/scan/interfaces.js.map +1 -1
  340. package/lib/module/components/executiontasks/scan/modalConstant.js.map +1 -1
  341. package/lib/module/components/executiontasks/scan/sub_components/CScanner.js +3 -4
  342. package/lib/module/components/executiontasks/scan/sub_components/CScanner.js.map +1 -1
  343. package/lib/module/components/executiontasks/scan/sub_components/DropDownUtils.js +0 -1
  344. package/lib/module/components/executiontasks/scan/sub_components/DropDownUtils.js.map +1 -1
  345. package/lib/module/components/executiontasks/scan/sub_components/ERDropDown.js +0 -2
  346. package/lib/module/components/executiontasks/scan/sub_components/ERDropDown.js.map +1 -1
  347. package/lib/module/components/executiontasks/scan/sub_components/SummaryPage.js +1 -4
  348. package/lib/module/components/executiontasks/scan/sub_components/SummaryPage.js.map +1 -1
  349. package/lib/module/components/executiontasks/scan/utils.js.map +1 -1
  350. package/lib/module/components/executiontasks/validateOTP/ValidateOTPET.js.map +1 -1
  351. package/lib/module/components/executiontasks/validateOTP/ValidateOTPSchema.js.map +1 -1
  352. package/lib/module/components/executiontasks/validateOTP/constants.js.map +1 -1
  353. package/lib/module/components/executiontasks/validateOTP/sub-components/OTPInput.js.map +1 -1
  354. package/lib/module/components/executiontasks/validateOTP/utils.js.map +1 -1
  355. package/lib/module/components/executiontasks/verifyInput/VerifyInputSchema.js.map +1 -1
  356. package/lib/module/components/executiontasks/verifyLocation/GeofenceUtils.js.map +1 -1
  357. package/lib/module/components/executiontasks/verifyLocation/VerifyLocSchema.js.map +1 -1
  358. package/lib/module/components/executiontasks/verifyLocation/VerifyLocationET.js.map +1 -1
  359. package/lib/module/components/executiontasks/verifyOtp/VerifyOtpET.js.map +1 -1
  360. package/lib/module/components/executiontasks/verifyOtp/VerifyOtpSchema.js.map +1 -1
  361. package/lib/module/components/utils/index.js.map +1 -1
  362. package/lib/module/components/widgets/AlertDisplay.js.map +1 -1
  363. package/lib/module/components/widgets/CancelOrderDialog.js.map +1 -1
  364. package/lib/module/components/widgets/Card.js +0 -1
  365. package/lib/module/components/widgets/Card.js.map +1 -1
  366. package/lib/module/components/widgets/GoBackModal.js.map +1 -1
  367. package/lib/module/components/widgets/IconButton.js +19 -22
  368. package/lib/module/components/widgets/IconButton.js.map +1 -1
  369. package/lib/module/components/widgets/ModalWidget.js.map +1 -1
  370. package/lib/module/components/widgets/ProgressDialog.js.map +1 -1
  371. package/lib/module/components/widgets/SearchBar.js.map +1 -1
  372. package/lib/module/components/widgets/SnackBarCustom.js +15 -18
  373. package/lib/module/components/widgets/SnackBarCustom.js.map +1 -1
  374. package/lib/module/components/widgets/SplitTextInput.js +8 -9
  375. package/lib/module/components/widgets/SplitTextInput.js.map +1 -1
  376. package/lib/module/components/widgets/TabsComponent.js.map +1 -1
  377. package/lib/module/components/widgets/Toaster.js.map +1 -1
  378. package/lib/module/config/DispatchSDKConfig.js.map +1 -1
  379. package/lib/module/constants/apiConstants.js.map +1 -1
  380. package/lib/module/constants/constants.js.map +1 -1
  381. package/lib/module/constants/statuscode.js.map +1 -1
  382. package/lib/module/errors/BaseError.js +2 -2
  383. package/lib/module/errors/BaseError.js.map +1 -1
  384. package/lib/module/errors/ErrorCodes.js.map +1 -1
  385. package/lib/module/events/EventDispatcher.js.map +1 -1
  386. package/lib/module/events/EventListener.js.map +1 -1
  387. package/lib/module/events/constants.js.map +1 -1
  388. package/lib/module/events/index.js.map +1 -1
  389. package/lib/module/events/interface.js.map +1 -1
  390. package/lib/module/icons/ScanIcon.js.map +1 -1
  391. package/lib/module/icons/file.js.map +1 -1
  392. package/lib/module/icons/interface.js.map +1 -1
  393. package/lib/module/index.js.map +1 -1
  394. package/lib/module/locale/Str.js.map +1 -1
  395. package/lib/module/locale/i18n.js.map +1 -1
  396. package/lib/module/locale/util.js.map +1 -1
  397. package/lib/module/manager/dispatch/DispatchStateContainer.js +4 -4
  398. package/lib/module/manager/dispatch/DispatchStateContainer.js.map +1 -1
  399. package/lib/module/manager/dispatchCodes/EventCodeContainer.js +4 -4
  400. package/lib/module/manager/dispatchCodes/EventCodeContainer.js.map +1 -1
  401. package/lib/module/manager/dispatchCodes/EventCodeRepo.js +4 -4
  402. package/lib/module/manager/dispatchCodes/EventCodeRepo.js.map +1 -1
  403. package/lib/module/manager/dispatchCodes/ReasonCodeContainer.js +4 -4
  404. package/lib/module/manager/dispatchCodes/ReasonCodeContainer.js.map +1 -1
  405. package/lib/module/manager/dispatchCodes/ReasonCodeRepo.js +4 -4
  406. package/lib/module/manager/dispatchCodes/ReasonCodeRepo.js.map +1 -1
  407. package/lib/module/manager/jobRemoval/JobRemovalManager.js.map +1 -1
  408. package/lib/module/manager/location/LocationManager.js +4 -4
  409. package/lib/module/manager/location/LocationManager.js.map +1 -1
  410. package/lib/module/manager/sdk/DispatchSDKManager.js +7 -7
  411. package/lib/module/manager/sdk/DispatchSDKManager.js.map +1 -1
  412. package/lib/module/manager/sdk/DispatchSdkCache.js +4 -4
  413. package/lib/module/manager/sdk/DispatchSdkCache.js.map +1 -1
  414. package/lib/module/manager/sdk/callbacksHandler.js +29 -3
  415. package/lib/module/manager/sdk/callbacksHandler.js.map +1 -1
  416. package/lib/module/manager/syncmanager/AppSyncManager.js +4 -4
  417. package/lib/module/manager/syncmanager/AppSyncManager.js.map +1 -1
  418. package/lib/module/manager/syncmanager/DBConfig.js +1 -0
  419. package/lib/module/manager/syncmanager/DBConfig.js.map +1 -1
  420. package/lib/module/manager/syncmanager/NativeSyncManager.js.map +1 -1
  421. package/lib/module/manager/syncmanager/constants.js.map +1 -1
  422. package/lib/module/manager/syncmanager/database.js.map +1 -1
  423. package/lib/module/manager/syncmanager/document/DocumentHttpClient.js +38 -21
  424. package/lib/module/manager/syncmanager/document/DocumentHttpClient.js.map +1 -1
  425. package/lib/module/manager/syncmanager/document/DocumentManager.js +11 -4
  426. package/lib/module/manager/syncmanager/document/DocumentManager.js.map +1 -1
  427. package/lib/module/manager/syncmanager/document/DocumentSyncManager.js +127 -27
  428. package/lib/module/manager/syncmanager/document/DocumentSyncManager.js.map +1 -1
  429. package/lib/module/manager/syncmanager/document/models.js.map +1 -1
  430. package/lib/module/manager/syncmanager/events/ETEventsManager.js +4 -5
  431. package/lib/module/manager/syncmanager/events/ETEventsManager.js.map +1 -1
  432. package/lib/module/manager/syncmanager/events/EventsGraphQLClient.js.map +1 -1
  433. package/lib/module/manager/syncmanager/events/EventsSyncManager.js +4 -5
  434. package/lib/module/manager/syncmanager/events/EventsSyncManager.js.map +1 -1
  435. package/lib/module/manager/syncmanager/events/SyncHttpClient.js +2 -6
  436. package/lib/module/manager/syncmanager/events/SyncHttpClient.js.map +1 -1
  437. package/lib/module/models/DispatchModels.js.map +1 -1
  438. package/lib/module/models/ReasonCodes.js.map +1 -1
  439. package/lib/module/models/auth.js.map +1 -1
  440. package/lib/module/models/execTasks/ETBaseModels.js.map +1 -1
  441. package/lib/module/models/execTasks/ETConfig.js.map +1 -1
  442. package/lib/module/models/execution.js.map +1 -1
  443. package/lib/module/models/fcm.js.map +1 -1
  444. package/lib/module/models/sdk.js.map +1 -1
  445. package/lib/module/native/signature/SignatureCapture.js +2 -2
  446. package/lib/module/native/signature/SignatureCapture.js.map +1 -1
  447. package/lib/module/network/GraphQLClient.js +13 -17
  448. package/lib/module/network/GraphQLClient.js.map +1 -1
  449. package/lib/module/network/NetworkClient.js +12 -2
  450. package/lib/module/network/NetworkClient.js.map +1 -1
  451. package/lib/module/network/NetworkUtils.js +14 -10
  452. package/lib/module/network/NetworkUtils.js.map +1 -1
  453. package/lib/module/network/Queries.js.map +1 -1
  454. package/lib/module/network/client.js +3 -4
  455. package/lib/module/network/client.js.map +1 -1
  456. package/lib/module/res/strings.js.map +1 -1
  457. package/lib/module/resources/Login.js +2 -2
  458. package/lib/module/resources/Login.js.map +1 -1
  459. package/lib/module/resources/network.js +2 -2
  460. package/lib/module/resources/network.js.map +1 -1
  461. package/lib/module/styles/SdkColors.js.map +1 -1
  462. package/lib/module/styles/executionTasks/CommonStyles.js.map +1 -1
  463. package/lib/module/ui/screens/CancellationScreen.js +5 -6
  464. package/lib/module/ui/screens/CancellationScreen.js.map +1 -1
  465. package/lib/module/ui/screens/CaptureInputScreen.js +5 -6
  466. package/lib/module/ui/screens/CaptureInputScreen.js.map +1 -1
  467. package/lib/module/ui/screens/CompleteObjectiveScreen.js +5 -6
  468. package/lib/module/ui/screens/CompleteObjectiveScreen.js.map +1 -1
  469. package/lib/module/ui/screens/DeliverScreen.js +5 -6
  470. package/lib/module/ui/screens/DeliverScreen.js.map +1 -1
  471. package/lib/module/ui/screens/DisplayScreen.js +5 -6
  472. package/lib/module/ui/screens/DisplayScreen.js.map +1 -1
  473. package/lib/module/ui/screens/DoodleScreen.js +5 -6
  474. package/lib/module/ui/screens/DoodleScreen.js.map +1 -1
  475. package/lib/module/ui/screens/DropCashScreen.js +5 -6
  476. package/lib/module/ui/screens/DropCashScreen.js.map +1 -1
  477. package/lib/module/ui/screens/ETScreensIndex.js.map +1 -1
  478. package/lib/module/ui/screens/FormsScreen.js +5 -6
  479. package/lib/module/ui/screens/FormsScreen.js.map +1 -1
  480. package/lib/module/ui/screens/GeofenceScreen.js +5 -6
  481. package/lib/module/ui/screens/GeofenceScreen.js.map +1 -1
  482. package/lib/module/ui/screens/HttpRequestScreen.js +5 -6
  483. package/lib/module/ui/screens/HttpRequestScreen.js.map +1 -1
  484. package/lib/module/ui/screens/ImageCaptureScreen.js +5 -6
  485. package/lib/module/ui/screens/ImageCaptureScreen.js.map +1 -1
  486. package/lib/module/ui/screens/PaymentScreen.js +5 -6
  487. package/lib/module/ui/screens/PaymentScreen.js.map +1 -1
  488. package/lib/module/ui/screens/PickupScreen.js +5 -6
  489. package/lib/module/ui/screens/PickupScreen.js.map +1 -1
  490. package/lib/module/ui/screens/ScanScreen.js +5 -7
  491. package/lib/module/ui/screens/ScanScreen.js.map +1 -1
  492. package/lib/module/ui/screens/StartWorkFlowScreen.js +5 -6
  493. package/lib/module/ui/screens/StartWorkFlowScreen.js.map +1 -1
  494. package/lib/module/ui/screens/ValidateOTPScreen.js +5 -6
  495. package/lib/module/ui/screens/ValidateOTPScreen.js.map +1 -1
  496. package/lib/module/ui/screens/WithBaseDispatchScreen.js.map +1 -1
  497. package/lib/module/ui/uiConfig/RouteParams.js.map +1 -1
  498. package/lib/module/utils/ApiUtils.js.map +1 -1
  499. package/lib/module/utils/ExecTaskUtils.js +1 -2
  500. package/lib/module/utils/ExecTaskUtils.js.map +1 -1
  501. package/lib/module/utils/Logger.js +4 -5
  502. package/lib/module/utils/Logger.js.map +1 -1
  503. package/lib/module/utils/NetworkUtil.js +2 -2
  504. package/lib/module/utils/NetworkUtil.js.map +1 -1
  505. package/lib/module/utils/SdkUtils.js.map +1 -1
  506. package/lib/module/utils/SyncManagerUtils.js.map +1 -1
  507. package/lib/module/utils/fcm/FCM.js.map +1 -1
  508. package/lib/module/utils/fcm/FcmUtils.js.map +1 -1
  509. package/lib/module/utils/helper.js +4 -4
  510. package/lib/module/utils/helper.js.map +1 -1
  511. package/lib/module/utils/hooks/useModal.js +1 -0
  512. package/lib/module/utils/hooks/useModal.js.map +1 -1
  513. package/lib/module/utils/hooks/useTimer.js.map +1 -1
  514. package/lib/module/utils/loginHelper.js.map +1 -1
  515. package/lib/module/utils/storage.js +5 -8
  516. package/lib/module/utils/storage.js.map +1 -1
  517. package/lib/module/utils/utils.js +1 -3
  518. package/lib/module/utils/utils.js.map +1 -1
  519. package/lib/typescript/analytics/sentry/SentrySdkConstants.d.ts +2 -0
  520. package/lib/typescript/manager/sdk/callbacksHandler.d.ts +3 -1
  521. package/lib/typescript/manager/syncmanager/document/DocumentManager.d.ts +1 -0
  522. package/lib/typescript/models/sdk.d.ts +1 -0
  523. package/package.json +1 -1
  524. package/src/analytics/sentry/SentrySdkConstants.ts +2 -0
  525. package/src/index.tsx +1 -1
  526. package/src/manager/sdk/DispatchSDKManager.ts +6 -2
  527. package/src/manager/sdk/callbacksHandler.ts +39 -2
  528. package/src/manager/syncmanager/document/DocumentHttpClient.ts +54 -24
  529. package/src/manager/syncmanager/document/DocumentManager.ts +15 -0
  530. package/src/manager/syncmanager/document/DocumentSyncManager.ts +137 -25
  531. package/src/models/auth.ts +1 -0
  532. package/src/models/sdk.ts +1 -0
  533. package/src/network/NetworkClient.ts +18 -2
  534. package/src/network/NetworkUtils.ts +9 -1
  535. package/src/network/client.ts +1 -1
  536. package/android/.gradle/6.8/fileChanges/last-build.bin +0 -0
  537. package/android/.gradle/6.8/fileHashes/fileHashes.lock +0 -0
  538. package/android/.gradle/6.8/gc.properties +0 -0
  539. package/android/.gradle/checksums/checksums.lock +0 -0
  540. package/android/.gradle/configuration-cache/gc.properties +0 -0
  541. package/android/.gradle/vcs-1/gc.properties +0 -0
  542. package/android/.idea/gradle.xml +0 -13
  543. package/android/.idea/misc.xml +0 -10
  544. 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';
@@ -54,10 +54,30 @@ export default class DocumentSyncManager {
54
54
  if ((documentRows === null || documentRows === void 0 ? void 0 : documentRows.length) > 0) {
55
55
  await this.uploadDocToServer(documentRows[0]);
56
56
  } else {
57
- 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);
58
68
  }
59
69
  } else {
60
- 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);
61
81
  }
62
82
  } catch (error) {} finally {
63
83
  this.inProgress = false;
@@ -66,7 +86,26 @@ export default class DocumentSyncManager {
66
86
  }
67
87
  }
68
88
  } else {
69
- 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);
70
109
  }
71
110
  }
72
111
  async isSyncPending() {
@@ -77,15 +116,24 @@ export default class DocumentSyncManager {
77
116
  async insertDocument(fmsFolderID, data, base64, desc, dspID,
78
117
  // jobID: string,
79
118
  // objRef: string,
80
- filePath, fileType, fileName, geoTimeStamp, processedFilePath) {
81
- let priority = arguments.length > 10 && arguments[10] !== undefined ? arguments[10] : 1;
119
+ filePath, fileType, fileName, geoTimeStamp, processedFilePath, priority = 1) {
82
120
  if (isEmptyOrBlank(desc) || isEmptyOrBlank(dspID) ||
83
121
  // isEmptyOrBlank(jobID) ||
84
122
  // isEmptyOrBlank(objRef) ||
85
123
  isEmptyOrBlank(fileType) || isEmptyOrBlank(fileName) || base64 && isEmptyOrBlank(data) || !base64 && isEmptyOrBlank(filePath)) throw new BaseError(BaseErrorCodes.InvalidArgumentError, InvalidArgumentsError);else {
86
124
  var _this$docManager;
87
125
  if (!this.docManager) {
88
- 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);
89
137
  this.docManager = await DocumentManager.getInstance();
90
138
  }
91
139
  console.log('insertDocument1:', fmsFolderID);
@@ -106,7 +154,17 @@ export default class DocumentSyncManager {
106
154
  try {
107
155
  await this.docManager.markDocumentSynced(documentRow.id, fmsID);
108
156
  } catch (err) {
109
- 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);
110
168
  }
111
169
  }
112
170
 
@@ -116,7 +174,17 @@ export default class DocumentSyncManager {
116
174
  try {
117
175
  await this.docManager.updateProcesedFilePath(documentRow.id, origialFilePath, processedPath);
118
176
  } catch (err) {
119
- 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);
120
188
  }
121
189
  }
122
190
  async updateDocError(documentRow, uploadError) {
@@ -124,7 +192,17 @@ export default class DocumentSyncManager {
124
192
  try {
125
193
  await this.docManager.updateDocSyncError(documentRow.id, uploadError);
126
194
  } catch (err) {
127
- 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);
128
206
  }
129
207
  }
130
208
  checkForInitialization() {
@@ -149,7 +227,6 @@ export default class DocumentSyncManager {
149
227
  if (accuracy !== '') {
150
228
  strDMSWithAccuracy = strDMS + ' (Accuracy: ' + accuracy + 'm)'; // Appedning accuracy in location
151
229
  }
152
-
153
230
  let fontSize = 14;
154
231
  if (Platform.OS !== 'android') {
155
232
  fontSize = 28;
@@ -166,7 +243,6 @@ export default class DocumentSyncManager {
166
243
  position: {
167
244
  position: Position.topLeft // Overlay text position
168
245
  },
169
-
170
246
  style: {
171
247
  // Style for overlay
172
248
  color: '#ffffff',
@@ -184,7 +260,6 @@ export default class DocumentSyncManager {
184
260
  filename: pFilePath,
185
261
  saveFormat: ImageFormat.jpg // Saving in jpeg format
186
262
  };
187
-
188
263
  let processedFilePath = await Marker.markText(options); // Generating overlay image
189
264
  if (processedFilePath !== null && processedFilePath !== '') {
190
265
  let completeFilePath = processedFilePath;
@@ -197,7 +272,6 @@ export default class DocumentSyncManager {
197
272
  //original file path catprued from camera
198
273
  completeFilePath // completeFilePath is the path with file:// of processed file
199
274
  );
200
-
201
275
  documentRow.processed_file_path = completeFilePath;
202
276
  }
203
277
  }
@@ -234,7 +308,6 @@ export default class DocumentSyncManager {
234
308
  if (accuracy !== '') {
235
309
  strDMSWithAccuracy = strDMS + ' (Accuracy: ' + accuracy + 'm)'; // Appedning accuracy in location
236
310
  }
237
-
238
311
  const options = {
239
312
  backgroundImage: {
240
313
  src: filePath,
@@ -247,7 +320,6 @@ export default class DocumentSyncManager {
247
320
  position: {
248
321
  position: Position.topLeft // Overlay text position
249
322
  },
250
-
251
323
  style: {
252
324
  // Style for overlay
253
325
  color: '#ffffff',
@@ -265,7 +337,6 @@ export default class DocumentSyncManager {
265
337
  filename: pFilePath,
266
338
  saveFormat: ImageFormat.base64 // Saving in base6 format
267
339
  };
268
-
269
340
  let processedBase64 = await Marker.markText(options); // Generating overlay image
270
341
  if (processedBase64 !== null && processedBase64 !== '') {
271
342
  // Fetching base64 data from processed data.
@@ -289,13 +360,34 @@ export default class DocumentSyncManager {
289
360
  async uploadDocToServer(documentRow) {
290
361
  try {
291
362
  var _this$documentHttpCli;
292
- 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);
293
384
  console.log('uploadDocToServer999:', docRow);
294
- 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));
295
386
  let extraParameters = {
296
387
  fmsID: fmsID ?? '',
297
- fileName: docRow.file_name,
298
- 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) : ''
299
391
  };
300
392
  // TODO: SOLELY DEPENDS ON FMS_ID WHICH IS WRONG => IT SHOULD BE Response.status = 202
301
393
  if (fmsID) {
@@ -303,7 +395,15 @@ export default class DocumentSyncManager {
303
395
  await this.updateDocument(docRow, fmsID);
304
396
  } else {
305
397
  this._retries++;
306
- 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);
307
407
  await this.updateDocError(docRow, 'Unexpected Error');
308
408
  }
309
409
  } catch (error) {
@@ -315,11 +415,11 @@ export default class DocumentSyncManager {
315
415
  screenName: cta,
316
416
  cta: cta,
317
417
  extraParams: {
318
- error: error.message
418
+ error: error
319
419
  }
320
420
  });
421
+ Logger.getInstance().logEvent(cta, error, LOG_TYPE.SDK_ERROR);
321
422
  this._retries++;
322
- Logger.getInstance().logEvent('uploadDocToServer-sync-error', error.message, LOG_TYPE.SDK_ERROR);
323
423
  await this.updateDocError(documentRow, JSON.stringify({
324
424
  message: error.message,
325
425
  error: JSON.stringify(error === null || error === void 0 || (_error$response = error.response) === null || _error$response === void 0 ? void 0 : _error$response.data),
@@ -336,6 +436,6 @@ export default class DocumentSyncManager {
336
436
  if (dspID) await this.docManager.deleteAllSyncedDocuments(dspID);
337
437
  }
338
438
  }
339
- _class = DocumentSyncManager;
439
+ _DocumentSyncManager = DocumentSyncManager;
340
440
  _defineProperty(DocumentSyncManager, "instance", void 0);
341
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","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","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","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 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 = 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;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;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;IA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C;EAClE;AACF;AAACqG,MAAA,GAraoBvI,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,c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eAAA,GAALnG,KAAK,CAAEwG,QAAQ,cAAAL,eAAA,uBAAfA,eAAA,CAAiB1F,IAAI,CAAC;QAC5CgG,MAAM,EAAEzG,KAAK,aAALA,KAAK,gBAAAoG,gBAAA,GAALpG,KAAK,CAAEwG,QAAQ,cAAAJ,gBAAA,uBAAfA,gBAAA,CAAiBK;MAC3B,CAAC,CACH,CAAC;IACH;EACF;EAEA,MAAaC,eAAeA,CAACC,UAAmB,EAA0B;IACxE,IAAI,CAAC,IAAI,CAAC1H,UAAU,EAAE,IAAI,CAACA,UAAU,GAAG,MAAMzC,eAAe,CAACkC,WAAW,CAAC,CAAC;IAC3E,OAAO,IAAI,CAACO,UAAU,CAACyH,eAAe,CAACC,UAAU,CAAC;EACpD;EAEA,MAAaC,eAAeA,CAAChG,KAAa,EAAE;IAC1C,IAAI,CAAC,IAAI,CAAC3B,UAAU,EAAE,IAAI,CAACA,UAAU,GAAG,MAAMzC,eAAe,CAACkC,WAAW,CAAC,CAAC;IAC3E,IAAIkC,KAAK,EAAE,MAAM,IAAI,CAAC3B,UAAU,CAAC4H,wBAAwB,CAACjG,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