@os1-platform/dispatch-mobile 3.1.9 → 3.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (469) hide show
  1. package/README.md +0 -2
  2. package/android/.gradle/8.10.2/checksums/checksums.lock +0 -0
  3. package/android/.gradle/8.10.2/checksums/md5-checksums.bin +0 -0
  4. package/android/.gradle/8.10.2/checksums/sha1-checksums.bin +0 -0
  5. package/android/.gradle/8.10.2/fileHashes/fileHashes.bin +0 -0
  6. package/android/.gradle/8.10.2/fileHashes/fileHashes.lock +0 -0
  7. package/android/.idea/caches/deviceStreaming.xml +25 -0
  8. package/android/build.gradle +3 -12
  9. package/android/gradle.properties +9 -4
  10. package/android/src/main/AndroidManifest.xml +2 -0
  11. package/android/src/main/java/com/dispatchsdk/utils/DispatchSdkUtils.kt +25 -10
  12. package/babel.config.js +1 -1
  13. package/lib/commonjs/analytics/sentry/SentrySdkConstants.js +4 -0
  14. package/lib/commonjs/analytics/sentry/SentrySdkConstants.js.map +1 -1
  15. package/lib/commonjs/components/executiontasks/captureInput/CaptureText.js +4 -4
  16. package/lib/commonjs/components/executiontasks/captureInput/CaptureText.js.map +1 -1
  17. package/lib/commonjs/components/executiontasks/collectPayment/components/CompletePayment.js +2 -2
  18. package/lib/commonjs/components/executiontasks/collectPayment/components/CompletePayment.js.map +1 -1
  19. package/lib/commonjs/components/executiontasks/collectPayment/components/InitPayment.js +4 -7
  20. package/lib/commonjs/components/executiontasks/collectPayment/components/InitPayment.js.map +1 -1
  21. package/lib/commonjs/components/executiontasks/collectPayment/components/PaymentContactDetails.js +7 -7
  22. package/lib/commonjs/components/executiontasks/collectPayment/components/PaymentContactDetails.js.map +1 -1
  23. package/lib/commonjs/components/executiontasks/collectPayment/components/ProcessPayment.js +20 -20
  24. package/lib/commonjs/components/executiontasks/collectPayment/components/ProcessPayment.js.map +1 -1
  25. package/lib/commonjs/components/executiontasks/deliver/SLDeliverET.js +4 -4
  26. package/lib/commonjs/components/executiontasks/deliver/SLDeliverET.js.map +1 -1
  27. package/lib/commonjs/components/executiontasks/doodle/SignatureET.js +4 -4
  28. package/lib/commonjs/components/executiontasks/doodle/SignatureET.js.map +1 -1
  29. package/lib/commonjs/components/executiontasks/dropCash/SLDropCash.js +4 -4
  30. package/lib/commonjs/components/executiontasks/dropCash/SLDropCash.js.map +1 -1
  31. package/lib/commonjs/components/executiontasks/forms/FormGenerator.js +12 -33
  32. package/lib/commonjs/components/executiontasks/forms/FormGenerator.js.map +1 -1
  33. package/lib/commonjs/components/executiontasks/imageCapture/ImageCapture.js +4 -4
  34. package/lib/commonjs/components/executiontasks/imageCapture/ImageCapture.js.map +1 -1
  35. package/lib/commonjs/components/executiontasks/payments/completePayment/CompletePaymentET.js +4 -4
  36. package/lib/commonjs/components/executiontasks/payments/completePayment/CompletePaymentET.js.map +1 -1
  37. package/lib/commonjs/components/executiontasks/payments/init/InitPaymentET.js +4 -4
  38. package/lib/commonjs/components/executiontasks/payments/init/InitPaymentET.js.map +1 -1
  39. package/lib/commonjs/components/executiontasks/payments/processPayment/ProcessPaymentET.js +4 -4
  40. package/lib/commonjs/components/executiontasks/payments/processPayment/ProcessPaymentET.js.map +1 -1
  41. package/lib/commonjs/components/executiontasks/pickup/PickupET.js.map +1 -1
  42. package/lib/commonjs/components/executiontasks/pickup/SLPickupET.js +4 -4
  43. package/lib/commonjs/components/executiontasks/pickup/SLPickupET.js.map +1 -1
  44. package/lib/commonjs/components/executiontasks/scan/ScanET.js +4 -4
  45. package/lib/commonjs/components/executiontasks/scan/ScanET.js.map +1 -1
  46. package/lib/commonjs/components/executiontasks/scan/interfaces.js +17 -1
  47. package/lib/commonjs/components/executiontasks/scan/interfaces.js.map +1 -1
  48. package/lib/commonjs/components/executiontasks/scan/sub_components/CScanner.js +4 -4
  49. package/lib/commonjs/components/executiontasks/scan/sub_components/CScanner.js.map +1 -1
  50. package/lib/commonjs/components/executiontasks/scan/sub_components/DropDownUtils.js +1 -1
  51. package/lib/commonjs/components/executiontasks/scan/sub_components/DropDownUtils.js.map +1 -1
  52. package/lib/commonjs/components/executiontasks/scan/sub_components/ERDropDown.js.map +1 -1
  53. package/lib/commonjs/components/executiontasks/scan/utils.js +12 -13
  54. package/lib/commonjs/components/executiontasks/scan/utils.js.map +1 -1
  55. package/lib/commonjs/components/executiontasks/validateOTP/ValidateOTPET.js.map +1 -1
  56. package/lib/commonjs/components/executiontasks/validateOTP/ValidateOTPSchema.js.map +1 -1
  57. package/lib/commonjs/components/executiontasks/validateOTP/components/ContactListView.js +4 -5
  58. package/lib/commonjs/components/executiontasks/validateOTP/components/ContactListView.js.map +1 -1
  59. package/lib/commonjs/components/executiontasks/validateOTP/components/OTPView.js +4 -4
  60. package/lib/commonjs/components/executiontasks/validateOTP/components/OTPView.js.map +1 -1
  61. package/lib/commonjs/components/executiontasks/verifyOtp/VerifyOtpET.js +5 -9
  62. package/lib/commonjs/components/executiontasks/verifyOtp/VerifyOtpET.js.map +1 -1
  63. package/lib/commonjs/components/widgets/CancelOrderDialog.js +2 -2
  64. package/lib/commonjs/components/widgets/CancelOrderDialog.js.map +1 -1
  65. package/lib/commonjs/components/widgets/SnackBarCustom.js +0 -3
  66. package/lib/commonjs/components/widgets/SnackBarCustom.js.map +1 -1
  67. package/lib/commonjs/components/widgets/Timer.js.map +1 -1
  68. package/lib/commonjs/database/DBManager.js +112 -0
  69. package/lib/commonjs/database/DBManager.js.map +1 -0
  70. package/lib/commonjs/database/dbUpdate.json +6 -0
  71. package/lib/commonjs/manager/dispatch/DispatchStateContainer.js.map +1 -1
  72. package/lib/commonjs/manager/dispatchCodes/EventCodeRepo.js +8 -9
  73. package/lib/commonjs/manager/dispatchCodes/EventCodeRepo.js.map +1 -1
  74. package/lib/commonjs/manager/dispatchCodes/ReasonCodeContainer.js +4 -4
  75. package/lib/commonjs/manager/dispatchCodes/ReasonCodeContainer.js.map +1 -1
  76. package/lib/commonjs/manager/dispatchCodes/ReasonCodeRepo.js +13 -10
  77. package/lib/commonjs/manager/dispatchCodes/ReasonCodeRepo.js.map +1 -1
  78. package/lib/commonjs/manager/location/LocationManager.js +0 -4
  79. package/lib/commonjs/manager/location/LocationManager.js.map +1 -1
  80. package/lib/commonjs/manager/sdk/DispatchSDKManager.js +7 -1
  81. package/lib/commonjs/manager/sdk/DispatchSDKManager.js.map +1 -1
  82. package/lib/commonjs/manager/sdk/callbacksHandler.js +1 -1
  83. package/lib/commonjs/manager/sdk/callbacksHandler.js.map +1 -1
  84. package/lib/commonjs/manager/syncmanager/DBConfig.js +6 -2
  85. package/lib/commonjs/manager/syncmanager/DBConfig.js.map +1 -1
  86. package/lib/commonjs/manager/syncmanager/database.js +117 -45
  87. package/lib/commonjs/manager/syncmanager/database.js.map +1 -1
  88. package/lib/commonjs/manager/syncmanager/document/DocumentManager.js +17 -22
  89. package/lib/commonjs/manager/syncmanager/document/DocumentManager.js.map +1 -1
  90. package/lib/commonjs/manager/syncmanager/document/DocumentSyncManager.js +85 -75
  91. package/lib/commonjs/manager/syncmanager/document/DocumentSyncManager.js.map +1 -1
  92. package/lib/commonjs/manager/syncmanager/events/ETEventsManager.js +24 -26
  93. package/lib/commonjs/manager/syncmanager/events/ETEventsManager.js.map +1 -1
  94. package/lib/commonjs/manager/syncmanager/events/EventsSyncManager.js.map +1 -1
  95. package/lib/commonjs/models/execTasks/ETConfig.js +1 -0
  96. package/lib/commonjs/models/execTasks/ETConfig.js.map +1 -1
  97. package/lib/commonjs/models/sdk.js.map +1 -1
  98. package/lib/commonjs/native/signature/SignatureCapture.js +2 -2
  99. package/lib/commonjs/native/signature/SignatureCapture.js.map +1 -1
  100. package/lib/commonjs/network/client.js.map +1 -1
  101. package/lib/commonjs/ui/screens/ValidateOTPScreen.js.map +1 -1
  102. package/lib/commonjs/utils/Constants.js.map +1 -1
  103. package/lib/commonjs/utils/Logger.js +1 -1
  104. package/lib/commonjs/utils/Logger.js.map +1 -1
  105. package/lib/commonjs/utils/SdkUtils.js +5 -3
  106. package/lib/commonjs/utils/SdkUtils.js.map +1 -1
  107. package/lib/commonjs/utils/SyncManagerUtils.js +2 -0
  108. package/lib/commonjs/utils/SyncManagerUtils.js.map +1 -1
  109. package/lib/module/analytics/sentry/SentrySdkConstants.js +4 -0
  110. package/lib/module/analytics/sentry/SentrySdkConstants.js.map +1 -1
  111. package/lib/module/components/executiontasks/captureInput/CaptureText.js +3 -3
  112. package/lib/module/components/executiontasks/captureInput/CaptureText.js.map +1 -1
  113. package/lib/module/components/executiontasks/collectPayment/components/CompletePayment.js +2 -2
  114. package/lib/module/components/executiontasks/collectPayment/components/CompletePayment.js.map +1 -1
  115. package/lib/module/components/executiontasks/collectPayment/components/InitPayment.js +3 -6
  116. package/lib/module/components/executiontasks/collectPayment/components/InitPayment.js.map +1 -1
  117. package/lib/module/components/executiontasks/collectPayment/components/PaymentContactDetails.js +6 -6
  118. package/lib/module/components/executiontasks/collectPayment/components/PaymentContactDetails.js.map +1 -1
  119. package/lib/module/components/executiontasks/collectPayment/components/ProcessPayment.js +18 -18
  120. package/lib/module/components/executiontasks/collectPayment/components/ProcessPayment.js.map +1 -1
  121. package/lib/module/components/executiontasks/deliver/SLDeliverET.js +3 -3
  122. package/lib/module/components/executiontasks/deliver/SLDeliverET.js.map +1 -1
  123. package/lib/module/components/executiontasks/doodle/SignatureET.js +3 -3
  124. package/lib/module/components/executiontasks/doodle/SignatureET.js.map +1 -1
  125. package/lib/module/components/executiontasks/dropCash/SLDropCash.js +3 -3
  126. package/lib/module/components/executiontasks/dropCash/SLDropCash.js.map +1 -1
  127. package/lib/module/components/executiontasks/forms/FormGenerator.js +11 -32
  128. package/lib/module/components/executiontasks/forms/FormGenerator.js.map +1 -1
  129. package/lib/module/components/executiontasks/imageCapture/ImageCapture.js +4 -4
  130. package/lib/module/components/executiontasks/imageCapture/ImageCapture.js.map +1 -1
  131. package/lib/module/components/executiontasks/payments/completePayment/CompletePaymentET.js +3 -3
  132. package/lib/module/components/executiontasks/payments/completePayment/CompletePaymentET.js.map +1 -1
  133. package/lib/module/components/executiontasks/payments/init/InitPaymentET.js +3 -3
  134. package/lib/module/components/executiontasks/payments/init/InitPaymentET.js.map +1 -1
  135. package/lib/module/components/executiontasks/payments/processPayment/ProcessPaymentET.js +3 -3
  136. package/lib/module/components/executiontasks/payments/processPayment/ProcessPaymentET.js.map +1 -1
  137. package/lib/module/components/executiontasks/pickup/PickupET.js.map +1 -1
  138. package/lib/module/components/executiontasks/pickup/SLPickupET.js +3 -3
  139. package/lib/module/components/executiontasks/pickup/SLPickupET.js.map +1 -1
  140. package/lib/module/components/executiontasks/scan/ScanET.js +3 -3
  141. package/lib/module/components/executiontasks/scan/ScanET.js.map +1 -1
  142. package/lib/module/components/executiontasks/scan/interfaces.js +16 -0
  143. package/lib/module/components/executiontasks/scan/interfaces.js.map +1 -1
  144. package/lib/module/components/executiontasks/scan/sub_components/CScanner.js +5 -5
  145. package/lib/module/components/executiontasks/scan/sub_components/CScanner.js.map +1 -1
  146. package/lib/module/components/executiontasks/scan/sub_components/DropDownUtils.js +2 -2
  147. package/lib/module/components/executiontasks/scan/sub_components/DropDownUtils.js.map +1 -1
  148. package/lib/module/components/executiontasks/scan/sub_components/ERDropDown.js.map +1 -1
  149. package/lib/module/components/executiontasks/scan/utils.js +13 -14
  150. package/lib/module/components/executiontasks/scan/utils.js.map +1 -1
  151. package/lib/module/components/executiontasks/validateOTP/ValidateOTPET.js.map +1 -1
  152. package/lib/module/components/executiontasks/validateOTP/ValidateOTPSchema.js.map +1 -1
  153. package/lib/module/components/executiontasks/validateOTP/components/ContactListView.js +3 -4
  154. package/lib/module/components/executiontasks/validateOTP/components/ContactListView.js.map +1 -1
  155. package/lib/module/components/executiontasks/validateOTP/components/OTPView.js +3 -3
  156. package/lib/module/components/executiontasks/validateOTP/components/OTPView.js.map +1 -1
  157. package/lib/module/components/executiontasks/verifyOtp/VerifyOtpET.js +6 -9
  158. package/lib/module/components/executiontasks/verifyOtp/VerifyOtpET.js.map +1 -1
  159. package/lib/module/components/widgets/CancelOrderDialog.js +1 -1
  160. package/lib/module/components/widgets/CancelOrderDialog.js.map +1 -1
  161. package/lib/module/components/widgets/SnackBarCustom.js +0 -2
  162. package/lib/module/components/widgets/SnackBarCustom.js.map +1 -1
  163. package/lib/module/components/widgets/Timer.js.map +1 -1
  164. package/lib/module/database/DBManager.js +104 -0
  165. package/lib/module/database/DBManager.js.map +1 -0
  166. package/lib/module/database/dbUpdate.json +6 -0
  167. package/lib/module/manager/dispatch/DispatchStateContainer.js.map +1 -1
  168. package/lib/module/manager/dispatchCodes/EventCodeRepo.js +7 -7
  169. package/lib/module/manager/dispatchCodes/EventCodeRepo.js.map +1 -1
  170. package/lib/module/manager/dispatchCodes/ReasonCodeContainer.js +4 -4
  171. package/lib/module/manager/dispatchCodes/ReasonCodeContainer.js.map +1 -1
  172. package/lib/module/manager/dispatchCodes/ReasonCodeRepo.js +13 -8
  173. package/lib/module/manager/dispatchCodes/ReasonCodeRepo.js.map +1 -1
  174. package/lib/module/manager/location/LocationManager.js +0 -4
  175. package/lib/module/manager/location/LocationManager.js.map +1 -1
  176. package/lib/module/manager/sdk/DispatchSDKManager.js +7 -1
  177. package/lib/module/manager/sdk/DispatchSDKManager.js.map +1 -1
  178. package/lib/module/manager/sdk/callbacksHandler.js +0 -2
  179. package/lib/module/manager/sdk/callbacksHandler.js.map +1 -1
  180. package/lib/module/manager/syncmanager/DBConfig.js +5 -1
  181. package/lib/module/manager/syncmanager/DBConfig.js.map +1 -1
  182. package/lib/module/manager/syncmanager/database.js +117 -43
  183. package/lib/module/manager/syncmanager/database.js.map +1 -1
  184. package/lib/module/manager/syncmanager/document/DocumentManager.js +16 -20
  185. package/lib/module/manager/syncmanager/document/DocumentManager.js.map +1 -1
  186. package/lib/module/manager/syncmanager/document/DocumentSyncManager.js +85 -75
  187. package/lib/module/manager/syncmanager/document/DocumentSyncManager.js.map +1 -1
  188. package/lib/module/manager/syncmanager/events/ETEventsManager.js +20 -22
  189. package/lib/module/manager/syncmanager/events/ETEventsManager.js.map +1 -1
  190. package/lib/module/manager/syncmanager/events/EventsSyncManager.js.map +1 -1
  191. package/lib/module/models/execTasks/ETConfig.js +1 -0
  192. package/lib/module/models/execTasks/ETConfig.js.map +1 -1
  193. package/lib/module/models/sdk.js.map +1 -1
  194. package/lib/module/native/signature/SignatureCapture.js +2 -2
  195. package/lib/module/native/signature/SignatureCapture.js.map +1 -1
  196. package/lib/module/network/client.js.map +1 -1
  197. package/lib/module/ui/screens/ValidateOTPScreen.js.map +1 -1
  198. package/lib/module/utils/Constants.js.map +1 -1
  199. package/lib/module/utils/Logger.js +1 -1
  200. package/lib/module/utils/Logger.js.map +1 -1
  201. package/lib/module/utils/SdkUtils.js +5 -3
  202. package/lib/module/utils/SdkUtils.js.map +1 -1
  203. package/lib/module/utils/SyncManagerUtils.js +2 -0
  204. package/lib/module/utils/SyncManagerUtils.js.map +1 -1
  205. package/lib/typescript/babel.config.d.ts +1 -0
  206. package/lib/typescript/jest.config.d.ts +7 -0
  207. package/lib/typescript/jest.setup.d.ts +1 -0
  208. package/lib/typescript/scripts/bootstrap.d.ts +1 -0
  209. package/lib/typescript/{components → src/components}/executiontasks/scan/interfaces.d.ts +15 -0
  210. package/lib/typescript/{components → src/components}/executiontasks/validateOTP/ValidateOTPSchema.d.ts +1 -1
  211. package/lib/typescript/{components → src/components}/widgets/CancelOrderDialog.d.ts +1 -1
  212. package/lib/typescript/{components → src/components}/widgets/SnackBarCustom.d.ts +3 -2
  213. package/lib/typescript/src/components/widgets/Timer.d.ts +6 -0
  214. package/lib/typescript/src/database/DBManager.d.ts +1 -0
  215. package/lib/typescript/{manager → src/manager}/dispatchCodes/EventCodeRepo.d.ts +1 -1
  216. package/lib/typescript/{manager → src/manager}/dispatchCodes/ReasonCodeRepo.d.ts +5 -3
  217. package/lib/typescript/{manager → src/manager}/syncmanager/DBConfig.d.ts +5 -1
  218. package/lib/typescript/src/manager/syncmanager/database.d.ts +31 -0
  219. package/lib/typescript/{manager → src/manager}/syncmanager/document/DocumentManager.d.ts +2 -3
  220. package/lib/typescript/{manager → src/manager}/syncmanager/document/DocumentSyncManager.d.ts +1 -2
  221. package/lib/typescript/{network → src/network}/client.d.ts +2 -2
  222. package/lib/typescript/{utils → src/utils}/Constants.d.ts +4 -0
  223. package/package.json +76 -104
  224. package/src/components/executiontasks/captureInput/CaptureText.tsx +6 -6
  225. package/src/components/executiontasks/collectPayment/components/CompletePayment.tsx +2 -3
  226. package/src/components/executiontasks/collectPayment/components/InitPayment.tsx +3 -7
  227. package/src/components/executiontasks/collectPayment/components/PaymentContactDetails.tsx +3 -4
  228. package/src/components/executiontasks/collectPayment/components/ProcessPayment.tsx +4 -5
  229. package/src/components/executiontasks/deliver/SLDeliverET.tsx +3 -4
  230. package/src/components/executiontasks/doodle/SignatureET.tsx +4 -4
  231. package/src/components/executiontasks/dropCash/SLDropCash.tsx +3 -4
  232. package/src/components/executiontasks/forms/FormGenerator.tsx +38 -55
  233. package/src/components/executiontasks/imageCapture/ImageCapture.tsx +5 -7
  234. package/src/components/executiontasks/payments/completePayment/CompletePaymentET.tsx +3 -4
  235. package/src/components/executiontasks/payments/init/InitPaymentET.tsx +3 -4
  236. package/src/components/executiontasks/payments/processPayment/ProcessPaymentET.tsx +3 -4
  237. package/src/components/executiontasks/pickup/PickupET.tsx +3 -9
  238. package/src/components/executiontasks/pickup/SLPickupET.tsx +3 -4
  239. package/src/components/executiontasks/scan/ScanET.tsx +3 -4
  240. package/src/components/executiontasks/scan/interfaces.ts +16 -0
  241. package/src/components/executiontasks/scan/sub_components/CScanner.tsx +7 -6
  242. package/src/components/executiontasks/scan/sub_components/DropDownUtils.ts +2 -2
  243. package/src/components/executiontasks/scan/sub_components/ERDropDown.tsx +0 -1
  244. package/src/components/executiontasks/scan/utils.ts +13 -13
  245. package/src/components/executiontasks/validateOTP/ValidateOTPET.tsx +5 -0
  246. package/src/components/executiontasks/validateOTP/ValidateOTPSchema.ts +1 -1
  247. package/src/components/executiontasks/validateOTP/components/ContactListView.tsx +3 -11
  248. package/src/components/executiontasks/validateOTP/components/OTPView.tsx +3 -4
  249. package/src/components/executiontasks/verifyOtp/VerifyOtpET.tsx +8 -16
  250. package/src/components/widgets/CancelOrderDialog.tsx +2 -2
  251. package/src/components/widgets/SnackBarCustom.tsx +2 -4
  252. package/src/components/widgets/Timer.tsx +0 -1
  253. package/src/database/DBManager.ts +118 -0
  254. package/src/database/dbUpdate.json +6 -0
  255. package/src/manager/dispatch/DispatchStateContainer.tsx +5 -25
  256. package/src/manager/dispatchCodes/EventCodeRepo.ts +8 -12
  257. package/src/manager/dispatchCodes/ReasonCodeContainer.ts +5 -5
  258. package/src/manager/dispatchCodes/ReasonCodeRepo.ts +17 -15
  259. package/src/manager/location/LocationManager.ts +1 -8
  260. package/src/manager/sdk/DispatchSDKManager.ts +12 -4
  261. package/src/manager/sdk/callbacksHandler.ts +3 -8
  262. package/src/manager/syncmanager/DBConfig.ts +6 -1
  263. package/src/manager/syncmanager/database.ts +130 -71
  264. package/src/manager/syncmanager/document/DocumentManager.ts +19 -24
  265. package/src/manager/syncmanager/document/DocumentSyncManager.ts +95 -82
  266. package/src/manager/syncmanager/events/ETEventsManager.ts +30 -35
  267. package/src/manager/syncmanager/events/EventsSyncManager.ts +1 -1
  268. package/src/models/sdk.ts +2 -6
  269. package/src/native/signature/SignatureCapture.tsx +4 -3
  270. package/src/network/client.ts +2 -2
  271. package/src/ui/screens/ValidateOTPScreen.tsx +2 -4
  272. package/src/utils/Constants.ts +6 -1
  273. package/src/utils/Logger.ts +2 -1
  274. package/src/utils/SdkUtils.ts +6 -7
  275. package/src/utils/SyncManagerUtils.ts +1 -0
  276. package/tsconfig.build.json +1 -1
  277. package/tsconfig.json +2 -3
  278. package/lib/typescript/components/widgets/Timer.d.ts +0 -7
  279. package/lib/typescript/manager/syncmanager/database.d.ts +0 -7
  280. /package/lib/typescript/{analytics → src/analytics}/firebase/FirebaseLogging.d.ts +0 -0
  281. /package/lib/typescript/{analytics → src/analytics}/sentry/SentryAnalyticsSingleton.d.ts +0 -0
  282. /package/lib/typescript/{analytics → src/analytics}/sentry/SentryAnalyticsUtils.d.ts +0 -0
  283. /package/lib/typescript/{analytics → src/analytics}/sentry/SentryModels.d.ts +0 -0
  284. /package/lib/typescript/{analytics → src/analytics}/sentry/SentrySdkConstants.d.ts +0 -0
  285. /package/lib/typescript/{components → src/components}/dispatch/DispatchExecNavigator.d.ts +0 -0
  286. /package/lib/typescript/{components → src/components}/executiontasks/CompletedWFSchema.d.ts +0 -0
  287. /package/lib/typescript/{components → src/components}/executiontasks/ExecutionTasksIndex.d.ts +0 -0
  288. /package/lib/typescript/{components → src/components}/executiontasks/cancellation/CancelET.d.ts +0 -0
  289. /package/lib/typescript/{components → src/components}/executiontasks/cancellation/CancellationSchema.d.ts +0 -0
  290. /package/lib/typescript/{components → src/components}/executiontasks/captureInput/CaptureInputSchema.d.ts +0 -0
  291. /package/lib/typescript/{components → src/components}/executiontasks/captureInput/CaptureText.d.ts +0 -0
  292. /package/lib/typescript/{components → src/components}/executiontasks/captureInput/utils.d.ts +0 -0
  293. /package/lib/typescript/{components → src/components}/executiontasks/collectPayment/CollectPayment.d.ts +0 -0
  294. /package/lib/typescript/{components → src/components}/executiontasks/collectPayment/CollectPaymentSchema.d.ts +0 -0
  295. /package/lib/typescript/{components → src/components}/executiontasks/collectPayment/PaymentStyles.d.ts +0 -0
  296. /package/lib/typescript/{components → src/components}/executiontasks/collectPayment/PaymentUtils.d.ts +0 -0
  297. /package/lib/typescript/{components → src/components}/executiontasks/collectPayment/components/CompletePayment.d.ts +0 -0
  298. /package/lib/typescript/{components → src/components}/executiontasks/collectPayment/components/CustomContactsModal.d.ts +0 -0
  299. /package/lib/typescript/{components → src/components}/executiontasks/collectPayment/components/InitPayment.d.ts +0 -0
  300. /package/lib/typescript/{components → src/components}/executiontasks/collectPayment/components/PaymentContactDetails.d.ts +0 -0
  301. /package/lib/typescript/{components → src/components}/executiontasks/collectPayment/components/ProcessPayment.d.ts +0 -0
  302. /package/lib/typescript/{components → src/components}/executiontasks/deliver/DeliverET.d.ts +0 -0
  303. /package/lib/typescript/{components → src/components}/executiontasks/deliver/DeliverETInput.d.ts +0 -0
  304. /package/lib/typescript/{components → src/components}/executiontasks/deliver/SLDeliverET.d.ts +0 -0
  305. /package/lib/typescript/{components → src/components}/executiontasks/display/DisplayModalET.d.ts +0 -0
  306. /package/lib/typescript/{components → src/components}/executiontasks/display/DisplaySchema.d.ts +0 -0
  307. /package/lib/typescript/{components → src/components}/executiontasks/doodle/SignatureET.d.ts +0 -0
  308. /package/lib/typescript/{components → src/components}/executiontasks/doodle/SignatureSchema.d.ts +0 -0
  309. /package/lib/typescript/{components → src/components}/executiontasks/dropCash/DropCashET.d.ts +0 -0
  310. /package/lib/typescript/{components → src/components}/executiontasks/dropCash/DropCashSchema.d.ts +0 -0
  311. /package/lib/typescript/{components → src/components}/executiontasks/dropCash/SLDropCash.d.ts +0 -0
  312. /package/lib/typescript/{components → src/components}/executiontasks/forms/FormGenerator.d.ts +0 -0
  313. /package/lib/typescript/{components → src/components}/executiontasks/forms/FormSchema.d.ts +0 -0
  314. /package/lib/typescript/{components → src/components}/executiontasks/forms/widgets/DateTimeWidget.d.ts +0 -0
  315. /package/lib/typescript/{components → src/components}/executiontasks/forms/widgets/DropdownWidget.d.ts +0 -0
  316. /package/lib/typescript/{components → src/components}/executiontasks/forms/widgets/QRBarcodeScannerWidget.d.ts +0 -0
  317. /package/lib/typescript/{components → src/components}/executiontasks/forms/widgets/TimeRangeSelector.d.ts +0 -0
  318. /package/lib/typescript/{components → src/components}/executiontasks/httpRequest/HttpEtUtils.d.ts +0 -0
  319. /package/lib/typescript/{components → src/components}/executiontasks/httpRequest/HttpRequestET.d.ts +0 -0
  320. /package/lib/typescript/{components → src/components}/executiontasks/httpRequest/HttpRequestETSchema.d.ts +0 -0
  321. /package/lib/typescript/{components → src/components}/executiontasks/imageCapture/CaptureSchema.d.ts +0 -0
  322. /package/lib/typescript/{components → src/components}/executiontasks/imageCapture/CaptureUtils.d.ts +0 -0
  323. /package/lib/typescript/{components → src/components}/executiontasks/imageCapture/ImageCapture.d.ts +0 -0
  324. /package/lib/typescript/{components → src/components}/executiontasks/payments/PaymentStyles.d.ts +0 -0
  325. /package/lib/typescript/{components → src/components}/executiontasks/payments/PaymentUtils.d.ts +0 -0
  326. /package/lib/typescript/{components → src/components}/executiontasks/payments/completePayment/CompletePaymentET.d.ts +0 -0
  327. /package/lib/typescript/{components → src/components}/executiontasks/payments/completePayment/CompletePaymentSchema.d.ts +0 -0
  328. /package/lib/typescript/{components → src/components}/executiontasks/payments/init/InitPaymentET.d.ts +0 -0
  329. /package/lib/typescript/{components → src/components}/executiontasks/payments/init/InitPaymentSchema.d.ts +0 -0
  330. /package/lib/typescript/{components → src/components}/executiontasks/payments/processPayment/ProcessPaymentET.d.ts +0 -0
  331. /package/lib/typescript/{components → src/components}/executiontasks/payments/processPayment/ProcessPaymentSchema.d.ts +0 -0
  332. /package/lib/typescript/{components → src/components}/executiontasks/pickup/PickpSchema.d.ts +0 -0
  333. /package/lib/typescript/{components → src/components}/executiontasks/pickup/PickupET.d.ts +0 -0
  334. /package/lib/typescript/{components → src/components}/executiontasks/pickup/SLPickupET.d.ts +0 -0
  335. /package/lib/typescript/{components → src/components}/executiontasks/scan/ScanET.d.ts +0 -0
  336. /package/lib/typescript/{components → src/components}/executiontasks/scan/ScanSchema.d.ts +0 -0
  337. /package/lib/typescript/{components → src/components}/executiontasks/scan/constants.d.ts +0 -0
  338. /package/lib/typescript/{components → src/components}/executiontasks/scan/modalConstant.d.ts +0 -0
  339. /package/lib/typescript/{components → src/components}/executiontasks/scan/sub_components/CScanner.d.ts +0 -0
  340. /package/lib/typescript/{components → src/components}/executiontasks/scan/sub_components/DropDownUtils.d.ts +0 -0
  341. /package/lib/typescript/{components → src/components}/executiontasks/scan/sub_components/ERDropDown.d.ts +0 -0
  342. /package/lib/typescript/{components → src/components}/executiontasks/scan/sub_components/SummaryPage.d.ts +0 -0
  343. /package/lib/typescript/{components → src/components}/executiontasks/scan/utils.d.ts +0 -0
  344. /package/lib/typescript/{components → src/components}/executiontasks/validateOTP/ValidateOTPET.d.ts +0 -0
  345. /package/lib/typescript/{components → src/components}/executiontasks/validateOTP/ValidateOtpStyles.d.ts +0 -0
  346. /package/lib/typescript/{components → src/components}/executiontasks/validateOTP/components/ContactListView.d.ts +0 -0
  347. /package/lib/typescript/{components → src/components}/executiontasks/validateOTP/components/OTPView.d.ts +0 -0
  348. /package/lib/typescript/{components → src/components}/executiontasks/validateOTP/components/VerificationComplete.d.ts +0 -0
  349. /package/lib/typescript/{components → src/components}/executiontasks/validateOTP/constants.d.ts +0 -0
  350. /package/lib/typescript/{components → src/components}/executiontasks/validateOTP/sub-components/ContactCard.d.ts +0 -0
  351. /package/lib/typescript/{components → src/components}/executiontasks/validateOTP/sub-components/OTPInput.d.ts +0 -0
  352. /package/lib/typescript/{components → src/components}/executiontasks/validateOTP/sub-components/ResendOTPButton.d.ts +0 -0
  353. /package/lib/typescript/{components → src/components}/executiontasks/validateOTP/utils.d.ts +0 -0
  354. /package/lib/typescript/{components → src/components}/executiontasks/verifyInput/VerifyInputSchema.d.ts +0 -0
  355. /package/lib/typescript/{components → src/components}/executiontasks/verifyLocation/GeofenceUtils.d.ts +0 -0
  356. /package/lib/typescript/{components → src/components}/executiontasks/verifyLocation/VerifyLocSchema.d.ts +0 -0
  357. /package/lib/typescript/{components → src/components}/executiontasks/verifyLocation/VerifyLocationET.d.ts +0 -0
  358. /package/lib/typescript/{components → src/components}/executiontasks/verifyOtp/VerifyOtpET.d.ts +0 -0
  359. /package/lib/typescript/{components → src/components}/executiontasks/verifyOtp/VerifyOtpSchema.d.ts +0 -0
  360. /package/lib/typescript/{components → src/components}/utils/Scale.d.ts +0 -0
  361. /package/lib/typescript/{components → src/components}/utils/index.d.ts +0 -0
  362. /package/lib/typescript/{components → src/components}/widgets/AlertDisplay.d.ts +0 -0
  363. /package/lib/typescript/{components → src/components}/widgets/Card.d.ts +0 -0
  364. /package/lib/typescript/{components → src/components}/widgets/ConfirmCancelModal.d.ts +0 -0
  365. /package/lib/typescript/{components → src/components}/widgets/GoBackModal.d.ts +0 -0
  366. /package/lib/typescript/{components → src/components}/widgets/IconButton.d.ts +0 -0
  367. /package/lib/typescript/{components → src/components}/widgets/ModalWidget.d.ts +0 -0
  368. /package/lib/typescript/{components → src/components}/widgets/ProgressDialog.d.ts +0 -0
  369. /package/lib/typescript/{components → src/components}/widgets/SearchBar.d.ts +0 -0
  370. /package/lib/typescript/{components → src/components}/widgets/SplitTextInput.d.ts +0 -0
  371. /package/lib/typescript/{components → src/components}/widgets/TabsComponent.d.ts +0 -0
  372. /package/lib/typescript/{components → src/components}/widgets/Toaster.d.ts +0 -0
  373. /package/lib/typescript/{config → src/config}/DispatchSDKConfig.d.ts +0 -0
  374. /package/lib/typescript/{constants → src/constants}/apiConstants.d.ts +0 -0
  375. /package/lib/typescript/{constants → src/constants}/constants.d.ts +0 -0
  376. /package/lib/typescript/{constants → src/constants}/statuscode.d.ts +0 -0
  377. /package/lib/typescript/{errors → src/errors}/BaseError.d.ts +0 -0
  378. /package/lib/typescript/{errors → src/errors}/ErrorCodes.d.ts +0 -0
  379. /package/lib/typescript/{events → src/events}/EventDispatcher.d.ts +0 -0
  380. /package/lib/typescript/{events → src/events}/EventListener.d.ts +0 -0
  381. /package/lib/typescript/{events → src/events}/constants.d.ts +0 -0
  382. /package/lib/typescript/{events → src/events}/index.d.ts +0 -0
  383. /package/lib/typescript/{events → src/events}/interface.d.ts +0 -0
  384. /package/lib/typescript/{icons → src/icons}/CircleMark.d.ts +0 -0
  385. /package/lib/typescript/{icons → src/icons}/FailedIcon.d.ts +0 -0
  386. /package/lib/typescript/{icons → src/icons}/FailureCloseIcon.d.ts +0 -0
  387. /package/lib/typescript/{icons → src/icons}/ScanIcon.d.ts +0 -0
  388. /package/lib/typescript/{icons → src/icons}/SuccessCompleteIcon.d.ts +0 -0
  389. /package/lib/typescript/{icons → src/icons}/file.d.ts +0 -0
  390. /package/lib/typescript/{icons → src/icons}/index.d.ts +0 -0
  391. /package/lib/typescript/{icons → src/icons}/interface.d.ts +0 -0
  392. /package/lib/typescript/{index.d.ts → src/index.d.ts} +0 -0
  393. /package/lib/typescript/{locale → src/locale}/Str.d.ts +0 -0
  394. /package/lib/typescript/{locale → src/locale}/i18n.d.ts +0 -0
  395. /package/lib/typescript/{locale → src/locale}/util.d.ts +0 -0
  396. /package/lib/typescript/{manager → src/manager}/dispatch/DispatchStateContainer.d.ts +0 -0
  397. /package/lib/typescript/{manager → src/manager}/dispatchCodes/EventCodeContainer.d.ts +0 -0
  398. /package/lib/typescript/{manager → src/manager}/dispatchCodes/ReasonCodeContainer.d.ts +0 -0
  399. /package/lib/typescript/{manager → src/manager}/jobRemoval/JobRemovalManager.d.ts +0 -0
  400. /package/lib/typescript/{manager → src/manager}/location/LocationManager.d.ts +0 -0
  401. /package/lib/typescript/{manager → src/manager}/sdk/DispatchSDKManager.d.ts +0 -0
  402. /package/lib/typescript/{manager → src/manager}/sdk/DispatchSdkCache.d.ts +0 -0
  403. /package/lib/typescript/{manager → src/manager}/sdk/callbacksHandler.d.ts +0 -0
  404. /package/lib/typescript/{manager → src/manager}/syncmanager/AppSyncManager.d.ts +0 -0
  405. /package/lib/typescript/{manager → src/manager}/syncmanager/NativeSyncManager.d.ts +0 -0
  406. /package/lib/typescript/{manager → src/manager}/syncmanager/constants.d.ts +0 -0
  407. /package/lib/typescript/{manager → src/manager}/syncmanager/document/DocumentHttpClient.d.ts +0 -0
  408. /package/lib/typescript/{manager → src/manager}/syncmanager/document/models.d.ts +0 -0
  409. /package/lib/typescript/{manager → src/manager}/syncmanager/events/ETEventsManager.d.ts +0 -0
  410. /package/lib/typescript/{manager → src/manager}/syncmanager/events/EventsGraphQLClient.d.ts +0 -0
  411. /package/lib/typescript/{manager → src/manager}/syncmanager/events/EventsSyncManager.d.ts +0 -0
  412. /package/lib/typescript/{manager → src/manager}/syncmanager/events/SyncHttpClient.d.ts +0 -0
  413. /package/lib/typescript/{models → src/models}/DispatchModels.d.ts +0 -0
  414. /package/lib/typescript/{models → src/models}/ReasonCodes.d.ts +0 -0
  415. /package/lib/typescript/{models → src/models}/auth.d.ts +0 -0
  416. /package/lib/typescript/{models → src/models}/execTasks/ETBaseModels.d.ts +0 -0
  417. /package/lib/typescript/{models → src/models}/execTasks/ETConfig.d.ts +0 -0
  418. /package/lib/typescript/{models → src/models}/execution.d.ts +0 -0
  419. /package/lib/typescript/{models → src/models}/fcm.d.ts +0 -0
  420. /package/lib/typescript/{models → src/models}/sdk.d.ts +0 -0
  421. /package/lib/typescript/{native → src/native}/LocationModule.d.ts +0 -0
  422. /package/lib/typescript/{native → src/native}/PermissionModule.d.ts +0 -0
  423. /package/lib/typescript/{native → src/native}/signature/SignatureCapture.d.ts +0 -0
  424. /package/lib/typescript/{network → src/network}/GraphQLClient.d.ts +0 -0
  425. /package/lib/typescript/{network → src/network}/NetworkClient.d.ts +0 -0
  426. /package/lib/typescript/{network → src/network}/NetworkUtils.d.ts +0 -0
  427. /package/lib/typescript/{network → src/network}/Queries.d.ts +0 -0
  428. /package/lib/typescript/{res → src/res}/strings.d.ts +0 -0
  429. /package/lib/typescript/{resources → src/resources}/Login.d.ts +0 -0
  430. /package/lib/typescript/{resources → src/resources}/network.d.ts +0 -0
  431. /package/lib/typescript/{styles → src/styles}/SdkColors.d.ts +0 -0
  432. /package/lib/typescript/{styles → src/styles}/executionTasks/CommonStyles.d.ts +0 -0
  433. /package/lib/typescript/{ui → src/ui}/screens/CancellationScreen.d.ts +0 -0
  434. /package/lib/typescript/{ui → src/ui}/screens/CaptureInputScreen.d.ts +0 -0
  435. /package/lib/typescript/{ui → src/ui}/screens/CollectPaymentScreen.d.ts +0 -0
  436. /package/lib/typescript/{ui → src/ui}/screens/CompleteObjectiveScreen.d.ts +0 -0
  437. /package/lib/typescript/{ui → src/ui}/screens/DeliverScreen.d.ts +0 -0
  438. /package/lib/typescript/{ui → src/ui}/screens/DisplayScreen.d.ts +0 -0
  439. /package/lib/typescript/{ui → src/ui}/screens/DoodleScreen.d.ts +0 -0
  440. /package/lib/typescript/{ui → src/ui}/screens/DropCashScreen.d.ts +0 -0
  441. /package/lib/typescript/{ui → src/ui}/screens/ETScreensIndex.d.ts +0 -0
  442. /package/lib/typescript/{ui → src/ui}/screens/FormsScreen.d.ts +0 -0
  443. /package/lib/typescript/{ui → src/ui}/screens/GeofenceScreen.d.ts +0 -0
  444. /package/lib/typescript/{ui → src/ui}/screens/HttpRequestScreen.d.ts +0 -0
  445. /package/lib/typescript/{ui → src/ui}/screens/ImageCaptureScreen.d.ts +0 -0
  446. /package/lib/typescript/{ui → src/ui}/screens/PaymentScreen.d.ts +0 -0
  447. /package/lib/typescript/{ui → src/ui}/screens/PickupScreen.d.ts +0 -0
  448. /package/lib/typescript/{ui → src/ui}/screens/ScanScreen.d.ts +0 -0
  449. /package/lib/typescript/{ui → src/ui}/screens/StartWorkFlowScreen.d.ts +0 -0
  450. /package/lib/typescript/{ui → src/ui}/screens/ValidateOTPScreen.d.ts +0 -0
  451. /package/lib/typescript/{ui → src/ui}/screens/WithBaseDispatchScreen.d.ts +0 -0
  452. /package/lib/typescript/{ui → src/ui}/uiConfig/RouteParams.d.ts +0 -0
  453. /package/lib/typescript/{utils → src/utils}/ApiUtils.d.ts +0 -0
  454. /package/lib/typescript/{utils → src/utils}/Enums.d.ts +0 -0
  455. /package/lib/typescript/{utils → src/utils}/ExecTaskUtils.d.ts +0 -0
  456. /package/lib/typescript/{utils → src/utils}/Logger.d.ts +0 -0
  457. /package/lib/typescript/{utils → src/utils}/NetworkUtil.d.ts +0 -0
  458. /package/lib/typescript/{utils → src/utils}/SdkUtils.d.ts +0 -0
  459. /package/lib/typescript/{utils → src/utils}/SyncManagerUtils.d.ts +0 -0
  460. /package/lib/typescript/{utils → src/utils}/context/paymentContext.d.ts +0 -0
  461. /package/lib/typescript/{utils → src/utils}/context/valdiateOTPContext.d.ts +0 -0
  462. /package/lib/typescript/{utils → src/utils}/fcm/FCM.d.ts +0 -0
  463. /package/lib/typescript/{utils → src/utils}/fcm/FcmUtils.d.ts +0 -0
  464. /package/lib/typescript/{utils → src/utils}/helper.d.ts +0 -0
  465. /package/lib/typescript/{utils → src/utils}/hooks/useModal.d.ts +0 -0
  466. /package/lib/typescript/{utils → src/utils}/hooks/useTimer.d.ts +0 -0
  467. /package/lib/typescript/{utils → src/utils}/loginHelper.d.ts +0 -0
  468. /package/lib/typescript/{utils → src/utils}/storage.d.ts +0 -0
  469. /package/lib/typescript/{utils → src/utils}/utils.d.ts +0 -0
@@ -4,8 +4,7 @@ import * as CaptureUtils from './CaptureUtils';
4
4
  import { getCaptureOutput } from './CaptureUtils';
5
5
  import { showToast } from '../../widgets/Toaster';
6
6
  import SdkColors, { ColorTheme } from '../../../styles/SdkColors';
7
- import Icon from 'react-native-vector-icons/Feather';
8
- import Iconn from 'react-native-vector-icons/MaterialIcons';
7
+ import Icon from '@react-native-vector-icons/material-icons';
9
8
  import { CommonStyles, Fonts } from '../../../styles/executionTasks/CommonStyles';
10
9
  import { getBaseETResponse } from '../../../utils/ExecTaskUtils';
11
10
  import { EntityCode, ExecutionTaskID } from '../../../models/execTasks/ETConfig';
@@ -53,9 +52,8 @@ const ImageCapture = (props: any) => {
53
52
  return true;
54
53
  }
55
54
  };
56
- BackHandler.addEventListener('hardwareBackPress', onBackPress);
57
- return () =>
58
- BackHandler.removeEventListener('hardwareBackPress', onBackPress);
55
+ const backHandler = BackHandler.addEventListener('hardwareBackPress', onBackPress);
56
+ return () => backHandler.remove();
59
57
  }, [])
60
58
  );
61
59
 
@@ -64,7 +62,7 @@ const ImageCapture = (props: any) => {
64
62
  title: props.title,
65
63
  headerLeft: () => {
66
64
  return (
67
- <Iconn
65
+ <Icon
68
66
  onPress={() => {
69
67
  if (
70
68
  props.taskMeta?.enableGoBack &&
@@ -284,7 +282,7 @@ const ImageCapture = (props: any) => {
284
282
  // }
285
283
  // }, [images, props, showCapture]);
286
284
 
287
- const captureImage = useCallback(async (index) => {
285
+ const captureImage = useCallback(async (index: number) => {
288
286
  try {
289
287
  let imageDataResponse = await CaptureUtils.captureImage(
290
288
  props.resolution.breadth,
@@ -27,7 +27,7 @@ import {
27
27
  import { getPaymentValue } from '../PaymentUtils';
28
28
  import { PaymentStyles } from '../PaymentStyles';
29
29
  import { GO_BACK_EVENT_CODE } from '../../../../constants/constants';
30
- import Icon from 'react-native-vector-icons/MaterialIcons';
30
+ import Icon from '@react-native-vector-icons/material-icons';
31
31
  import GoBackModal from '../../../../components/widgets/GoBackModal';
32
32
  import { hasGoBackConnector } from '../../../../components/utils';
33
33
  import { useFocusEffect } from '@react-navigation/native';
@@ -54,9 +54,8 @@ const CompletePaymentET = (props: CompletePaymentInput) => {
54
54
  return true;
55
55
  }
56
56
  };
57
- BackHandler.addEventListener('hardwareBackPress', onBackPress);
58
- return () =>
59
- BackHandler.removeEventListener('hardwareBackPress', onBackPress);
57
+ const backHandler = BackHandler.addEventListener('hardwareBackPress', onBackPress);
58
+ return () => backHandler.remove();
60
59
  }, [])
61
60
  );
62
61
 
@@ -17,7 +17,7 @@ import {
17
17
  Provider,
18
18
  RadioButton,
19
19
  } from 'react-native-paper';
20
- import Icon from 'react-native-vector-icons/MaterialIcons';
20
+ import Icon from '@react-native-vector-icons/material-icons';
21
21
  import { GO_BACK_EVENT_CODE } from '../../../../constants/constants';
22
22
  import { hasGoBackConnector } from '../../../../components/utils';
23
23
  import GoBackModal from '../../../../components/widgets/GoBackModal';
@@ -58,9 +58,8 @@ const InitPaymentET = (props: InitPaymentInput) => {
58
58
  return true;
59
59
  }
60
60
  };
61
- BackHandler.addEventListener('hardwareBackPress', onBackPress);
62
- return () =>
63
- BackHandler.removeEventListener('hardwareBackPress', onBackPress);
61
+ const backHandler = BackHandler.addEventListener('hardwareBackPress', onBackPress);
62
+ return () => backHandler.remove();
64
63
  }, [])
65
64
  );
66
65
 
@@ -18,7 +18,7 @@ import { isEmptyOrBlank } from '../../../../utils/utils';
18
18
  import { CommonStyles } from '../../../../styles/executionTasks/CommonStyles';
19
19
  import { getPaymentValue } from '../PaymentUtils';
20
20
  import { Button, Provider, TextInput } from 'react-native-paper';
21
- import Icon from 'react-native-vector-icons/MaterialIcons';
21
+ import Icon from '@react-native-vector-icons/material-icons';
22
22
  import { GO_BACK_EVENT_CODE } from '../../../../constants/constants';
23
23
  import GoBackModal from '../../../../components/widgets/GoBackModal';
24
24
  import { hasGoBackConnector } from '../../../../components/utils';
@@ -49,9 +49,8 @@ const ProcessPaymentET = (props: ProcessPaymentInput) => {
49
49
  return true;
50
50
  }
51
51
  };
52
- BackHandler.addEventListener('hardwareBackPress', onBackPress);
53
- return () =>
54
- BackHandler.removeEventListener('hardwareBackPress', onBackPress);
52
+ const backHandler = BackHandler.addEventListener('hardwareBackPress', onBackPress);
53
+ return () => backHandler.remove();
55
54
  }, [])
56
55
  );
57
56
 
@@ -1,17 +1,11 @@
1
- import { FlatList, View } from 'react-native';
1
+ import { View } from 'react-native';
2
2
  import React, { useState } from 'react';
3
3
  import type { PickupETInput } from './PickpSchema';
4
4
  import { Button, Card, Paragraph, TextInput, Title } from 'react-native-paper';
5
- import {
6
- CommonStyles,
7
- deliverETStyles,
8
- } from '../../../styles/executionTasks/CommonStyles';
5
+ import { CommonStyles, deliverETStyles } from '../../../styles/executionTasks/CommonStyles';
9
6
  import { getBaseETResponse } from '../../../utils/ExecTaskUtils';
10
7
  import { getEventCodeByET } from '../../../manager/dispatchCodes/EventCodeContainer';
11
- import {
12
- EntityCode,
13
- ExecutionTaskID,
14
- } from '../../../models/execTasks/ETConfig';
8
+ import { EntityCode, ExecutionTaskID } from '../../../models/execTasks/ETConfig';
15
9
  import type { LineItem } from '../deliver/DeliverETInput';
16
10
  import { ScreenNameSdkConstants, SentryEventNameSdkConstants, SeverityLevelValue } from '../../../analytics/sentry/SentrySdkConstants';
17
11
  import { fireEventWithScreenName } from '../../../analytics/sentry/SentryAnalyticsUtils';
@@ -20,7 +20,7 @@ import {
20
20
  DEFAULT_PICKUP_TITLE,
21
21
  GO_BACK_EVENT_CODE,
22
22
  } from '../../../constants/constants';
23
- import Icon from 'react-native-vector-icons/MaterialIcons';
23
+ import Icon from '@react-native-vector-icons/material-icons';
24
24
  import { hasGoBackConnector } from '../../../components/utils';
25
25
  import GoBackModal from '../../../components/widgets/GoBackModal';
26
26
  import { useFocusEffect } from '@react-navigation/native';
@@ -77,9 +77,8 @@ const SLPickupET = (props: PickupETInput) => {
77
77
  return true;
78
78
  }
79
79
  };
80
- BackHandler.addEventListener('hardwareBackPress', onBackPress);
81
- return () =>
82
- BackHandler.removeEventListener('hardwareBackPress', onBackPress);
80
+ const backHandler = BackHandler.addEventListener('hardwareBackPress', onBackPress);
81
+ return () => backHandler.remove();
83
82
  }, [])
84
83
  );
85
84
 
@@ -68,7 +68,7 @@ import {
68
68
  GO_BACK_EVENT_CODE,
69
69
  REASON_NOT_USED,
70
70
  } from '../../../constants/constants';
71
- import Icon from 'react-native-vector-icons/MaterialIcons';
71
+ import Icon from '@react-native-vector-icons/material-icons';
72
72
  import type { ScannerOutput } from './ScanSchema';
73
73
  import {
74
74
  DispatchExecutor,
@@ -611,9 +611,8 @@ const ScanET = (props: ScannerInput) => {
611
611
  return true;
612
612
  }
613
613
  };
614
- BackHandler.addEventListener('hardwareBackPress', onBackPress);
615
- return () =>
616
- BackHandler.removeEventListener('hardwareBackPress', onBackPress);
614
+ const backHandler = BackHandler.addEventListener('hardwareBackPress', onBackPress);
615
+ return () => backHandler.remove();
617
616
  }, [showScanList])
618
617
  );
619
618
 
@@ -17,6 +17,22 @@ export enum ExpoBarcodeTypes {
17
17
  upc_e = 'upc_e',
18
18
  }
19
19
 
20
+ export enum BarcodeType {
21
+ aztec = 'aztec',
22
+ ean13 = 'ean13',
23
+ ean8 = 'ean8',
24
+ qr = 'qr',
25
+ pdf417 = 'pdf417',
26
+ upc_e = 'upc_e',
27
+ datamatrix = 'datamatrix',
28
+ code39 = 'code39',
29
+ code93 = 'code93',
30
+ itf14 = 'itf14',
31
+ codabar = 'codabar',
32
+ code128 = 'code128',
33
+ upc_a = 'upc_a'
34
+ }
35
+
20
36
  export enum SCAN_STATUS {
21
37
  SCANNED,
22
38
  FAILED,
@@ -1,6 +1,7 @@
1
1
  import React, { memo, useEffect, useState } from 'react';
2
2
  import { Platform, StyleSheet, Text, View } from 'react-native';
3
- import { BarCodeScanningResult, Camera } from 'expo-camera';
3
+ import { BarcodeScanningResult } from 'expo-camera';
4
+ import { CameraView } from 'expo-camera';
4
5
  import { isEmptyOrBlank } from '../../../../utils/utils';
5
6
  import { checkCameraPermissionUtil } from '../../imageCapture/CaptureUtils';
6
7
  import { Title } from 'react-native-paper';
@@ -27,7 +28,7 @@ const CScanner = (props: CScannerProps) => {
27
28
  })();
28
29
  }, []);
29
30
 
30
- const _handleBarCodeScanned = (scan: BarCodeScanningResult) => {
31
+ const _handleBarCodeScanned = (scan: BarcodeScanningResult) => {
31
32
  if (!isEmptyOrBlank(scan.data)) {
32
33
  setVisible(false);
33
34
  props.onScanned(scan.data);
@@ -49,11 +50,11 @@ const CScanner = (props: CScannerProps) => {
49
50
  return (
50
51
  <>
51
52
  {isVisible ? (
52
- <Camera
53
- barCodeScannerSettings={{
54
- barCodeTypes: props.barCodeTypes,
53
+ <CameraView
54
+ barcodeScannerSettings={{
55
+ barcodeTypes: props.barCodeTypes
55
56
  }}
56
- onBarCodeScanned={_handleBarCodeScanned}
57
+ onBarcodeScanned={_handleBarCodeScanned}
57
58
  style={StyleSheet.absoluteFill}
58
59
  />
59
60
  ) : null}
@@ -3,8 +3,8 @@ import ReasonCodeContainer from '../../../../manager/dispatchCodes/ReasonCodeCon
3
3
  import type { DefaultERC, ERCode } from '../ScanSchema';
4
4
  import EventCodeContainer from '../../../../manager/dispatchCodes/EventCodeContainer';
5
5
  import EventCodeRepo from '../../../../manager/dispatchCodes/EventCodeRepo';
6
- import ReasonCodeRepo from '../../../../manager/dispatchCodes/ReasonCodeRepo';
7
6
  import { ReasonsRow } from '../../../../manager/syncmanager/DBConfig';
7
+ import ReasonCodeRepoIns from '../../../../manager/dispatchCodes/ReasonCodeRepo';
8
8
 
9
9
  export async function getErcDropDownItems(
10
10
  type: 'EVENT' | 'REASON',
@@ -60,7 +60,7 @@ export async function getErcDropDownItems(
60
60
  } else if (type === 'REASON' && eventCode) {
61
61
  const item = list.find((erc) => erc.eventCode === eventCode);
62
62
  const reasonCodesList = item?.reasonCode || [];
63
- const reasonCodes = await ReasonCodeRepo.getInstance().getReasonsByCode(
63
+ const reasonCodes = await ReasonCodeRepoIns.getReasonsByCode(
64
64
  reasonCodesList
65
65
  );
66
66
  erc = reasonCodes.map((code: ReasonsRow) => ({
@@ -2,7 +2,6 @@ import React, { useEffect, useState } from 'react';
2
2
  import { Fonts } from '../../../../styles/executionTasks/CommonStyles';
3
3
  import { Platform, StyleSheet, Text, View } from 'react-native';
4
4
  import DropDownPicker from 'react-native-dropdown-picker';
5
- import FIcon from 'react-native-vector-icons/FontAwesome';
6
5
 
7
6
  function getDropDownItems(erItem: ercItem[]) {
8
7
  if (!erItem || erItem.length === 0) return [];
@@ -1,6 +1,6 @@
1
- import { BarCodeScanner } from 'expo-barcode-scanner';
2
1
  import {
3
2
  ADD_SCAN,
3
+ BarcodeType,
4
4
  ExpoBarcodeTypes,
5
5
  MergedScan,
6
6
  SCANNED_RECORD,
@@ -69,40 +69,40 @@ export function getBarCodeTypes(input: ScannerInput): any[] {
69
69
  scanType.forEach((type: ScannerType) => {
70
70
  switch (type) {
71
71
  case ExpoBarcodeTypes.QRCODE:
72
- barCodeType.push(BarCodeScanner.Constants.BarCodeType.qr);
72
+ barCodeType.push(BarcodeType.qr);
73
73
  break;
74
74
  case ExpoBarcodeTypes.aztec:
75
- barCodeType.push(BarCodeScanner.Constants.BarCodeType.aztec);
75
+ barCodeType.push(BarcodeType.aztec);
76
76
  break;
77
77
  case ExpoBarcodeTypes.codabar:
78
- barCodeType.push(BarCodeScanner.Constants.BarCodeType.codabar);
78
+ barCodeType.push(BarcodeType.codabar);
79
79
  break;
80
80
  case ExpoBarcodeTypes.code128:
81
- barCodeType.push(BarCodeScanner.Constants.BarCodeType.code128);
81
+ barCodeType.push(BarcodeType.code128);
82
82
  break;
83
83
  case ExpoBarcodeTypes.code39:
84
- barCodeType.push(BarCodeScanner.Constants.BarCodeType.code39);
84
+ barCodeType.push(BarcodeType.code39);
85
85
  break;
86
86
  case ExpoBarcodeTypes.code93:
87
- barCodeType.push(BarCodeScanner.Constants.BarCodeType.code93);
87
+ barCodeType.push(BarcodeType.code93);
88
88
  break;
89
89
  case ExpoBarcodeTypes.datamatrix:
90
- barCodeType.push(BarCodeScanner.Constants.BarCodeType.datamatrix);
90
+ barCodeType.push(BarcodeType.datamatrix);
91
91
  break;
92
92
  case ExpoBarcodeTypes.ean13:
93
- barCodeType.push(BarCodeScanner.Constants.BarCodeType.ean13);
93
+ barCodeType.push(BarcodeType.ean13);
94
94
  break;
95
95
  case ExpoBarcodeTypes.ean8:
96
- barCodeType.push(BarCodeScanner.Constants.BarCodeType.ean8);
96
+ barCodeType.push(BarcodeType.ean8);
97
97
  break;
98
98
  case ExpoBarcodeTypes.itf14:
99
- barCodeType.push(BarCodeScanner.Constants.BarCodeType.itf14);
99
+ barCodeType.push(BarcodeType.itf14);
100
100
  break;
101
101
  case ExpoBarcodeTypes.pdf417:
102
- barCodeType.push(BarCodeScanner.Constants.BarCodeType.pdf417);
102
+ barCodeType.push(BarcodeType.pdf417);
103
103
  break;
104
104
  case ExpoBarcodeTypes.upc_e:
105
- barCodeType.push(BarCodeScanner.Constants.BarCodeType.upc_e);
105
+ barCodeType.push(BarcodeType.upc_e);
106
106
  break;
107
107
 
108
108
  default:
@@ -111,6 +111,7 @@ const ValidateOTPET: FC<ValidateOTPInput> = (props) => {
111
111
  const [selectedContact, setSelectedContact] = useState<ContactTypes>(
112
112
  contactList[0] || null
113
113
  );
114
+
114
115
  const [isContactVisited, setIsContactVisited] = useState<boolean>(
115
116
  props.doorstepOTP
116
117
  );
@@ -206,11 +207,15 @@ const ValidateOTPET: FC<ValidateOTPInput> = (props) => {
206
207
  isSelected: index === 0, // Select the first contact by default
207
208
  }));
208
209
 
210
+
211
+
212
+
209
213
  // Update the state with the filtered contacts
210
214
  setContactList(filteredContacts);
211
215
  if (props.doorstepOTP) {
212
216
  setSelectedContact(filteredContacts[0]);
213
217
  }
218
+
214
219
  }, [contacts, props.doorstepOTP, props.otpDeliveryMethod]);
215
220
 
216
221
  // Monitor shouldNavigateBack to trigger navigation if set
@@ -9,7 +9,7 @@ import type {
9
9
  BaseETResponse,
10
10
  } from '../../../models/execTasks/ETBaseModels';
11
11
  import type { Headers, HTTPMethod } from '../httpRequest/HttpRequestETSchema';
12
- import { SnackBarType } from 'src/components/widgets/SnackBarCustom';
12
+ import { SnackBarType } from '../../widgets/SnackBarCustom';
13
13
 
14
14
  export interface API {
15
15
  uri: string;
@@ -3,7 +3,7 @@
3
3
  import React, { FC, useEffect, useLayoutEffect } from 'react';
4
4
  import { BackHandler, FlatList, Text, View } from 'react-native';
5
5
  import { useFocusEffect } from '@react-navigation/native';
6
- import Icon from 'react-native-vector-icons/MaterialIcons';
6
+ import Icon from '@react-native-vector-icons/material-icons';
7
7
 
8
8
  // Styles
9
9
  import styles from '../ValidateOtpStyles';
@@ -29,16 +29,8 @@ export const ContactListView: FC<ValidateOTPInput> = (props) => {
29
29
  // Handle back-button click
30
30
  useFocusEffect(
31
31
  React.useCallback(() => {
32
- BackHandler.addEventListener(
33
- 'hardwareBackPress',
34
- props.handleBackNavigation
35
- );
36
- return () =>
37
- BackHandler.removeEventListener(
38
- 'hardwareBackPress',
39
- props.handleBackNavigation
40
- );
41
- // eslint-disable-next-line react-hooks/exhaustive-deps
32
+ const backHandler = BackHandler.addEventListener('hardwareBackPress', props.handleBackNavigation);
33
+ return () => backHandler.remove();
42
34
  }, [])
43
35
  );
44
36
 
@@ -3,7 +3,7 @@
3
3
  import React, { FC, useEffect, useLayoutEffect } from 'react';
4
4
  import { BackHandler, Text, View } from 'react-native';
5
5
  import { useFocusEffect } from '@react-navigation/native';
6
- import Icon from 'react-native-vector-icons/MaterialIcons';
6
+ import Icon from '@react-native-vector-icons/material-icons';
7
7
 
8
8
  // Components
9
9
  import OTPInput from '../sub-components/OTPInput';
@@ -125,9 +125,8 @@ export const OTPView: FC<ValidateOTPInput> = (props) => {
125
125
  // Handle back-button click
126
126
  useFocusEffect(
127
127
  React.useCallback(() => {
128
- BackHandler.addEventListener('hardwareBackPress', handleBackPress);
129
- return () =>
130
- BackHandler.removeEventListener('hardwareBackPress', handleBackPress);
128
+ const backHandler = BackHandler.addEventListener('hardwareBackPress', handleBackPress);
129
+ return () => backHandler.remove();
131
130
  // eslint-disable-next-line react-hooks/exhaustive-deps
132
131
  }, [])
133
132
  );
@@ -1,15 +1,11 @@
1
1
  import { BackHandler, Pressable, StyleSheet, Text, View } from 'react-native';
2
2
  import React, { useEffect, useRef } from 'react';
3
- // @ts-ignore
4
3
  import OTPTextView from 'react-native-otp-textinput';
5
- import { Colors } from 'react-native-paper';
4
+ import { MD2Colors } from 'react-native-paper';
6
5
  import { showToast } from '../../widgets/Toaster';
7
6
  import type { OtpInputSchema } from './VerifyOtpSchema';
8
7
  import { getBaseETResponse } from '../../../utils/ExecTaskUtils';
9
- import {
10
- EntityCode,
11
- ExecutionTaskID,
12
- } from '../../../models/execTasks/ETConfig';
8
+ import { EntityCode, ExecutionTaskID } from '../../../models/execTasks/ETConfig';
13
9
  import { ScreenNameSdkConstants, SentryEventNameSdkConstants, SeverityLevelValue } from '../../../analytics/sentry/SentrySdkConstants';
14
10
  import { fireEventWithScreenName } from '../../../analytics/sentry/SentryAnalyticsUtils';
15
11
 
@@ -20,10 +16,8 @@ const VerifyOtpET = (props: OtpInputSchema) => {
20
16
  return true;
21
17
  }
22
18
  useEffect(() => {
23
- BackHandler.addEventListener('hardwareBackPress', backButtonHandler);
24
- return () => {
25
- BackHandler.removeEventListener('hardwareBackPress', backButtonHandler);
26
- };
19
+ const backHandler = BackHandler.addEventListener('hardwareBackPress', backButtonHandler);
20
+ return () => backHandler.remove();
27
21
  }, []);
28
22
 
29
23
  return (
@@ -32,9 +26,9 @@ const VerifyOtpET = (props: OtpInputSchema) => {
32
26
  <Text style={styles.veriOtpText}>Verify OTP</Text>
33
27
  <OTPTextView
34
28
  textInputStyle={styles.otpInputStyle}
35
- ref={otpInput}
29
+ ref={otpInput.current}
36
30
  inputCount={props.inputCount}
37
- tintColor={Colors.blue300}
31
+ tintColor={MD2Colors.blue300}
38
32
  handleTextChange={async (value: string) => {
39
33
  if (value.length === props.inputCount) {
40
34
  props.onSubmit({
@@ -58,10 +52,8 @@ const VerifyOtpET = (props: OtpInputSchema) => {
58
52
  showToast('Resending OTP');
59
53
  const cta = 'Send again';
60
54
  fireEventWithScreenName({ severityLevel: SeverityLevelValue.LOG, eventName: SentryEventNameSdkConstants.BUTTON_CLICKED, screenName: ScreenNameSdkConstants.VERIFY_OTP_ET_SCREEN, cta: cta });
61
-
62
55
  }}
63
- style={styles.sendAgainText}
64
- >
56
+ style={styles.sendAgainText}>
65
57
  <Text>Send again</Text>
66
58
  </Pressable>
67
59
  </View>
@@ -78,7 +70,7 @@ const styles = StyleSheet.create({
78
70
  },
79
71
  veriOtpText: {
80
72
  fontSize: 24,
81
- color: Colors.black,
73
+ color: "#000000",
82
74
  marginTop: 40,
83
75
  },
84
76
  otpInputStyle: {
@@ -2,7 +2,7 @@ import React from 'react';
2
2
  import { Modal, Platform, StyleSheet, View } from 'react-native';
3
3
  import { CommonStyles, Fonts } from '../../styles/executionTasks/CommonStyles';
4
4
  import { Button, Paragraph, Title } from 'react-native-paper';
5
- import Icon from 'react-native-vector-icons/MaterialCommunityIcons';
5
+ import Icon from '@react-native-vector-icons/material-design-icons';
6
6
  import SdkColors, { ColorTheme } from '../../styles/SdkColors';
7
7
  import { ScreenNameSdkConstants, SentryEventNameSdkConstants, SeverityLevelValue } from '../../analytics/sentry/SentrySdkConstants';
8
8
  import { fireEventWithScreenName } from '../../analytics/sentry/SentryAnalyticsUtils';
@@ -115,5 +115,5 @@ export interface CancelDialogProps {
115
115
  positiveButtonTitle?: string;
116
116
  negativeButtonTitle?: string;
117
117
  showIcon?: boolean;
118
- iconName?: string;
118
+ iconName?: any;
119
119
  }
@@ -1,5 +1,3 @@
1
- /* eslint-disable react-native/no-inline-styles */
2
- /* eslint-disable @typescript-eslint/no-unused-vars */
3
1
  import React from 'react';
4
2
  import {
5
3
  Animated,
@@ -11,7 +9,7 @@ import {
11
9
  View,
12
10
  ViewStyle,
13
11
  } from 'react-native';
14
- import { Surface, withTheme } from 'react-native-paper';
12
+ import { Surface, withTheme, MD3Theme } from 'react-native-paper';
15
13
  import { AntDesign } from '@expo/vector-icons';
16
14
  import { Fonts } from '../../styles/executionTasks/CommonStyles';
17
15
  import {
@@ -27,7 +25,7 @@ export interface SnackbarProps {
27
25
  onDismiss: () => void;
28
26
  message: string;
29
27
  type?: SnackBarType;
30
- theme: ReactNativePaper.Theme;
28
+ theme: MD3Theme;
31
29
  customBottom?: number;
32
30
  customTop?: number;
33
31
  }
@@ -13,7 +13,6 @@ const DEFAULT_TIMER = 120;
13
13
  export const Timer = forwardRef(
14
14
  (
15
15
  props: {
16
- ref: any;
17
16
  singleValue?: boolean;
18
17
  timer?: number;
19
18
  onTimerEnd?: () => void;
@@ -0,0 +1,118 @@
1
+ import Database from "../manager/syncmanager/database"
2
+ import {
3
+ EVENT_CODES_TABLE, EventColumns, REASONS_TABLE, ReasonColums,
4
+ DOCUMENT_TABLE, DOCUMENT_COLUMNS, EVENTS_TABLE, EVENTS_COLUMNS,
5
+ VERSION_TABLE, VERSION_COLUMNS
6
+ } from "../manager/syncmanager/DBConfig"
7
+ import dbUpdate from "./dbUpdate.json"
8
+ import DispatchSdkCache from "../manager/sdk/DispatchSdkCache"
9
+
10
+ export const initAndUpdateDatabase = async () => {
11
+ try {
12
+ const createStmts = [
13
+ {
14
+ sqlSmt: `CREATE TABLE IF NOT EXISTS ${VERSION_TABLE}
15
+ (${VERSION_COLUMNS.VERSION_NO} TEXT NOT NULL);`,
16
+ args: [],
17
+ },
18
+ {
19
+ sqlSmt: `CREATE TABLE IF NOT EXISTS ${EVENT_CODES_TABLE} (
20
+ ${EventColumns.CODE} TEXT PRIMARY KEY NOT NULL,
21
+ ${EventColumns.DESCRIPTION} TEXT,
22
+ ${EventColumns.SUCCESS_EVENT} INTEGER);`,
23
+ args: [],
24
+ },
25
+ {
26
+ sqlSmt: `CREATE TABLE IF NOT EXISTS ${REASONS_TABLE} (
27
+ ${ReasonColums.CODE} TEXT PRIMARY KEY NOT NULL,
28
+ ${ReasonColums.DESCRIPTION} TEXT,
29
+ ${ReasonColums.IS_ENABLED} INTEGER,
30
+ ${ReasonColums.SYSTEM_DEFINED} INTEGER);`,
31
+ args: []
32
+ },
33
+ {
34
+ sqlSmt: `CREATE TABLE IF NOT EXISTS ${DOCUMENT_TABLE} (
35
+ ${DOCUMENT_COLUMNS.ID} INTEGER PRIMARY KEY AUTOINCREMENT,
36
+ ${DOCUMENT_COLUMNS.DATA} TEXT,
37
+ ${DOCUMENT_COLUMNS.BASE64} INTEGER NOT NULL DEFAULT 0,
38
+ ${DOCUMENT_COLUMNS.FILE_PATH} TEXT,
39
+ ${DOCUMENT_COLUMNS.DISPATCH_ID} TEXT NOT NULL,
40
+ ${DOCUMENT_COLUMNS.FILE_NAME} TEXT,
41
+ ${DOCUMENT_COLUMNS.FILE_TYPE} TEXT,
42
+ ${DOCUMENT_COLUMNS.SYNCED} INTEGER DEFAULT 0 NOT NULL,
43
+ ${DOCUMENT_COLUMNS.FMS_ID} TEXT,
44
+ ${DOCUMENT_COLUMNS.FMS_FOLDER_ID} TEXT,
45
+ ${DOCUMENT_COLUMNS.PRIORITY} INTEGER NOT NULL DEFAULT 1,
46
+ ${DOCUMENT_COLUMNS.SYNC_ERROR} TEXT,
47
+ ${DOCUMENT_COLUMNS.ATTEMPT_COUNT} INTEGER DEFAULT 0 NOT NULL,
48
+ ${DOCUMENT_COLUMNS.GEO_TIMESTAMP} TEXT,
49
+ ${DOCUMENT_COLUMNS.PROCESSED_FILE_PATH} TEXT,
50
+ ${DOCUMENT_COLUMNS.DESCRIPTION} TEXT);`,
51
+ args: []
52
+ },
53
+ {
54
+ sqlSmt: `CREATE TABLE IF NOT EXISTS ${EVENTS_TABLE} (
55
+ ${EVENTS_COLUMNS.ID} INTEGER PRIMARY KEY AUTOINCREMENT,
56
+ ${EVENTS_COLUMNS.DISPATCH_ID} TEXT NOT NULL,
57
+ ${EVENTS_COLUMNS.PAYLOAD} TEXT NOT NULL,
58
+ ${EVENTS_COLUMNS.CONFIG} TEXT,
59
+ ${EVENTS_COLUMNS.SYNC_TYPE} TEXT NOT NULL,
60
+ ${EVENTS_COLUMNS.DATA_LENGTH} INTEGER DEFAULT 0 NOT NULL,
61
+ ${EVENTS_COLUMNS.META} TEXT NOT NULL,
62
+ ${EVENTS_COLUMNS.SYNCED} INTEGER DEFAULT 0 NOT NULL,
63
+ ${EVENTS_COLUMNS.ATTEMPT_COUNT} INTEGER DEFAULT 0 NOT NULL,
64
+ ${EVENTS_COLUMNS.SYNC_ERROR} TEXT);`,
65
+ args: []
66
+ }
67
+ ]
68
+ const initResult = await Database.executeStatementsInTxn(createStmts);
69
+ console.debug("Database initialized: ", initResult);
70
+ const versionResult = await Database.executeGetDataQuery(
71
+ `SELECT MAX(${VERSION_COLUMNS.VERSION_NO}) AS version FROM ${VERSION_TABLE}`, []);
72
+ console.debug('versionResult SDK', JSON.stringify(versionResult));
73
+ const raw = (versionResult as any).rows._array[0]?.version;
74
+ const currentVersion = raw != null ? Number(raw) : 0;
75
+
76
+ if (currentVersion === 0) {
77
+ console.debug(`no version found, inserting initial version ${dbUpdate.version}`);
78
+ await DispatchSdkCache.getInstance().clearKeys([DispatchSdkCache.KEYS.REASON_FETCH_TIME]);
79
+ await Database.executeSetDataQuery(
80
+ `INSERT OR REPLACE INTO ${VERSION_TABLE}(${VERSION_COLUMNS.VERSION_NO}) VALUES (?);`,
81
+ [dbUpdate.version]);
82
+ return;
83
+ }
84
+
85
+ if (currentVersion < dbUpdate.version) {
86
+ console.debug(`migrating DB from v${currentVersion} → v${dbUpdate.version}`);
87
+ await DispatchSdkCache.getInstance().clearKeys([DispatchSdkCache.KEYS.REASON_FETCH_TIME]);
88
+ const migrationStmts = buildMigrationStatements(currentVersion, dbUpdate.version);
89
+ await Database.executeStatementsInTxn(migrationStmts);
90
+ }
91
+
92
+ console.debug('Database is up to date (v' + dbUpdate.version + ').');
93
+ } catch (err: any) {
94
+ console.error('initDatabase failed:', err);
95
+ throw new Error('Database initialization error: ' + (err as Error).message);
96
+ }
97
+ }
98
+
99
+ /** Assemble all the SQL statements needed to go from `from v` → `to v`. */
100
+ function buildMigrationStatements(from: number, to: number) {
101
+ const stmts: Array<{ sqlSmt: string; args: any[] }> = [];
102
+
103
+ for (let v = from + 1; v <= to; v++) {
104
+ const key = `v${v}`;
105
+ const upgrade = (dbUpdate.upgrades as Record<string, string[]>)[key];
106
+ if (!upgrade) break;
107
+
108
+ upgrade.forEach((sql) => {
109
+ stmts.push({ sqlSmt: sql, args: [] });
110
+ });
111
+ }
112
+ // finally bump the version
113
+ stmts.push({
114
+ sqlSmt: `INSERT OR REPLACE INTO ${VERSION_TABLE}(${VERSION_COLUMNS.VERSION_NO}) VALUES (?);`,
115
+ args: [to],
116
+ });
117
+ return stmts;
118
+ }
@@ -0,0 +1,6 @@
1
+ {
2
+ "version": 1,
3
+ "upgrades": {
4
+ "v1": []
5
+ }
6
+ }