@os1-platform/dispatch-mobile 1.0.7 → 1.3.11

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 (653) hide show
  1. package/README.md +90 -26
  2. package/android/.gradle/6.8/fileChanges/last-build.bin +0 -0
  3. package/android/.gradle/6.8/fileHashes/fileHashes.lock +0 -0
  4. package/android/.gradle/6.8/gc.properties +0 -0
  5. package/android/.gradle/buildOutputCleanup/buildOutputCleanup.lock +0 -0
  6. package/android/.gradle/buildOutputCleanup/cache.properties +2 -0
  7. package/android/.gradle/checksums/checksums.lock +0 -0
  8. package/android/.gradle/configuration-cache/gc.properties +0 -0
  9. package/android/.gradle/vcs-1/gc.properties +0 -0
  10. package/android/.idea/gradle.xml +13 -0
  11. package/android/.idea/misc.xml +4 -0
  12. package/android/.idea/vcs.xml +6 -0
  13. package/android/.idea/workspace.xml +131 -0
  14. package/android/gradle.properties +1 -1
  15. package/android/local.properties +8 -0
  16. package/android/src/main/AndroidManifest.xml +0 -1
  17. package/lib/commonjs/components/dispatch/DispatchExecNavigator.js +46 -39
  18. package/lib/commonjs/components/dispatch/DispatchExecNavigator.js.map +1 -1
  19. package/lib/commonjs/components/executiontasks/ExecutionTasksIndex.js +14 -24
  20. package/lib/commonjs/components/executiontasks/ExecutionTasksIndex.js.map +1 -1
  21. package/lib/commonjs/components/executiontasks/cancellation/CancelET.js +142 -23
  22. package/lib/commonjs/components/executiontasks/cancellation/CancelET.js.map +1 -1
  23. package/lib/commonjs/components/executiontasks/cancellation/CancellationSchema.js.map +1 -1
  24. package/lib/commonjs/components/executiontasks/captureInput/CaptureText.js +64 -16
  25. package/lib/commonjs/components/executiontasks/captureInput/CaptureText.js.map +1 -1
  26. package/lib/commonjs/components/executiontasks/deliver/DeliverET.js +6 -16
  27. package/lib/commonjs/components/executiontasks/deliver/DeliverET.js.map +1 -1
  28. package/lib/commonjs/components/executiontasks/deliver/SLDeliverET.js +68 -26
  29. package/lib/commonjs/components/executiontasks/deliver/SLDeliverET.js.map +1 -1
  30. package/lib/commonjs/components/executiontasks/display/DisplayModalET.js +4 -13
  31. package/lib/commonjs/components/executiontasks/display/DisplayModalET.js.map +1 -1
  32. package/lib/commonjs/components/executiontasks/doodle/DoodleUtils.js +0 -2
  33. package/lib/commonjs/components/executiontasks/doodle/DoodleUtils.js.map +1 -1
  34. package/lib/commonjs/components/executiontasks/doodle/SignatureET.js +61 -28
  35. package/lib/commonjs/components/executiontasks/doodle/SignatureET.js.map +1 -1
  36. package/lib/commonjs/components/executiontasks/dropCash/DropCashET.js +5 -19
  37. package/lib/commonjs/components/executiontasks/dropCash/DropCashET.js.map +1 -1
  38. package/lib/commonjs/components/executiontasks/dropCash/SLDropCash.js +62 -18
  39. package/lib/commonjs/components/executiontasks/dropCash/SLDropCash.js.map +1 -1
  40. package/lib/commonjs/components/executiontasks/forms/FormGenerator.js +112 -28
  41. package/lib/commonjs/components/executiontasks/forms/FormGenerator.js.map +1 -1
  42. package/lib/commonjs/components/executiontasks/forms/widgets/DateTimeWidget.js +3 -26
  43. package/lib/commonjs/components/executiontasks/forms/widgets/DateTimeWidget.js.map +1 -1
  44. package/lib/commonjs/components/executiontasks/forms/widgets/DropdownWidget.js +49 -0
  45. package/lib/commonjs/components/executiontasks/forms/widgets/DropdownWidget.js.map +1 -0
  46. package/lib/commonjs/components/executiontasks/forms/widgets/QRBarcodeScannerWidget.js +1 -16
  47. package/lib/commonjs/components/executiontasks/forms/widgets/QRBarcodeScannerWidget.js.map +1 -1
  48. package/lib/commonjs/components/executiontasks/forms/widgets/TimeRangeSelector.js +0 -10
  49. package/lib/commonjs/components/executiontasks/forms/widgets/TimeRangeSelector.js.map +1 -1
  50. package/lib/commonjs/components/executiontasks/httpRequest/HttpEtUtils.js +4 -13
  51. package/lib/commonjs/components/executiontasks/httpRequest/HttpEtUtils.js.map +1 -1
  52. package/lib/commonjs/components/executiontasks/httpRequest/HttpRequestET.js +0 -12
  53. package/lib/commonjs/components/executiontasks/httpRequest/HttpRequestET.js.map +1 -1
  54. package/lib/commonjs/components/executiontasks/imageCapture/CaptureSchema.js.map +1 -1
  55. package/lib/commonjs/components/executiontasks/imageCapture/CaptureUtils.js +7 -35
  56. package/lib/commonjs/components/executiontasks/imageCapture/CaptureUtils.js.map +1 -1
  57. package/lib/commonjs/components/executiontasks/imageCapture/ImageCapture.js +74 -49
  58. package/lib/commonjs/components/executiontasks/imageCapture/ImageCapture.js.map +1 -1
  59. package/lib/commonjs/components/executiontasks/payments/PaymentStyles.js +0 -4
  60. package/lib/commonjs/components/executiontasks/payments/PaymentStyles.js.map +1 -1
  61. package/lib/commonjs/components/executiontasks/payments/PaymentUtils.js +0 -2
  62. package/lib/commonjs/components/executiontasks/payments/PaymentUtils.js.map +1 -1
  63. package/lib/commonjs/components/executiontasks/payments/completePayment/CompletePaymentET.js +64 -17
  64. package/lib/commonjs/components/executiontasks/payments/completePayment/CompletePaymentET.js.map +1 -1
  65. package/lib/commonjs/components/executiontasks/payments/init/InitPaymentET.js +63 -24
  66. package/lib/commonjs/components/executiontasks/payments/init/InitPaymentET.js.map +1 -1
  67. package/lib/commonjs/components/executiontasks/payments/processPayment/ProcessPaymentET.js +71 -22
  68. package/lib/commonjs/components/executiontasks/payments/processPayment/ProcessPaymentET.js.map +1 -1
  69. package/lib/commonjs/components/executiontasks/pickup/PickupET.js +5 -15
  70. package/lib/commonjs/components/executiontasks/pickup/PickupET.js.map +1 -1
  71. package/lib/commonjs/components/executiontasks/pickup/SLPickupET.js +60 -19
  72. package/lib/commonjs/components/executiontasks/pickup/SLPickupET.js.map +1 -1
  73. package/lib/commonjs/components/executiontasks/scan/ScanET.js +843 -0
  74. package/lib/commonjs/components/executiontasks/scan/ScanET.js.map +1 -0
  75. package/lib/commonjs/components/executiontasks/scan/ScanSchema.js +6 -0
  76. package/lib/commonjs/components/executiontasks/scan/ScanSchema.js.map +1 -0
  77. package/lib/commonjs/components/executiontasks/scan/constants.js +19 -0
  78. package/lib/commonjs/components/executiontasks/scan/constants.js.map +1 -0
  79. package/lib/commonjs/components/executiontasks/scan/interfaces.js +29 -0
  80. package/lib/commonjs/components/executiontasks/scan/interfaces.js.map +1 -0
  81. package/lib/commonjs/components/executiontasks/scan/sub_components/CScanner.js +103 -0
  82. package/lib/commonjs/components/executiontasks/scan/sub_components/CScanner.js.map +1 -0
  83. package/lib/commonjs/components/executiontasks/scan/sub_components/DropDownUtils.js +74 -0
  84. package/lib/commonjs/components/executiontasks/scan/sub_components/DropDownUtils.js.map +1 -0
  85. package/lib/commonjs/components/executiontasks/scan/sub_components/ERDropDown.js +115 -0
  86. package/lib/commonjs/components/executiontasks/scan/sub_components/ERDropDown.js.map +1 -0
  87. package/lib/commonjs/components/executiontasks/scan/sub_components/ScanList.js +134 -0
  88. package/lib/commonjs/components/executiontasks/scan/sub_components/ScanList.js.map +1 -0
  89. package/lib/commonjs/components/executiontasks/scan/utils.js +373 -0
  90. package/lib/commonjs/components/executiontasks/scan/utils.js.map +1 -0
  91. package/lib/commonjs/components/executiontasks/scanner/CScanner.js +3 -21
  92. package/lib/commonjs/components/executiontasks/scanner/CScanner.js.map +1 -1
  93. package/lib/commonjs/components/executiontasks/scanner/ScannerSchema.js +4 -9
  94. package/lib/commonjs/components/executiontasks/scanner/ScannerSchema.js.map +1 -1
  95. package/lib/commonjs/components/executiontasks/scanner/ScannerUtils.js +7 -36
  96. package/lib/commonjs/components/executiontasks/scanner/ScannerUtils.js.map +1 -1
  97. package/lib/commonjs/components/executiontasks/scanner/returns/DropDownSelector.js +0 -5
  98. package/lib/commonjs/components/executiontasks/scanner/returns/DropDownSelector.js.map +1 -1
  99. package/lib/commonjs/components/executiontasks/scanner/returns/DropDownUtils.js +0 -9
  100. package/lib/commonjs/components/executiontasks/scanner/returns/DropDownUtils.js.map +1 -1
  101. package/lib/commonjs/components/executiontasks/scanner/returns/RTReasonSelection.js +0 -14
  102. package/lib/commonjs/components/executiontasks/scanner/returns/RTReasonSelection.js.map +1 -1
  103. package/lib/commonjs/components/executiontasks/scanner/returns/RTScan.js +1 -40
  104. package/lib/commonjs/components/executiontasks/scanner/returns/RTScan.js.map +1 -1
  105. package/lib/commonjs/components/executiontasks/scanner/returns/ReasonDropDown.js +0 -17
  106. package/lib/commonjs/components/executiontasks/scanner/returns/ReasonDropDown.js.map +1 -1
  107. package/lib/commonjs/components/executiontasks/scanner/returns/ScanList.js +0 -28
  108. package/lib/commonjs/components/executiontasks/scanner/returns/ScanList.js.map +1 -1
  109. package/lib/commonjs/components/executiontasks/validateOTP/ValidateOTPET.js +334 -0
  110. package/lib/commonjs/components/executiontasks/validateOTP/ValidateOTPET.js.map +1 -0
  111. package/lib/commonjs/components/executiontasks/validateOTP/ValidateOTPSchema.js +14 -0
  112. package/lib/commonjs/components/executiontasks/validateOTP/ValidateOTPSchema.js.map +1 -0
  113. package/lib/commonjs/components/executiontasks/validateOTP/constants.js +37 -0
  114. package/lib/commonjs/components/executiontasks/validateOTP/constants.js.map +1 -0
  115. package/lib/commonjs/components/executiontasks/validateOTP/sub-components/OTPInput.js +59 -0
  116. package/lib/commonjs/components/executiontasks/validateOTP/sub-components/OTPInput.js.map +1 -0
  117. package/lib/commonjs/components/executiontasks/validateOTP/utils.js +147 -0
  118. package/lib/commonjs/components/executiontasks/validateOTP/utils.js.map +1 -0
  119. package/lib/commonjs/components/executiontasks/verifyLocation/GeofenceUtils.js +0 -13
  120. package/lib/commonjs/components/executiontasks/verifyLocation/GeofenceUtils.js.map +1 -1
  121. package/lib/commonjs/components/executiontasks/verifyLocation/VerifyLocationET.js +4 -17
  122. package/lib/commonjs/components/executiontasks/verifyLocation/VerifyLocationET.js.map +1 -1
  123. package/lib/commonjs/components/executiontasks/verifyOtp/VerifyOtpET.js +3 -18
  124. package/lib/commonjs/components/executiontasks/verifyOtp/VerifyOtpET.js.map +1 -1
  125. package/lib/commonjs/components/widgets/AlertDisplay.js +0 -5
  126. package/lib/commonjs/components/widgets/AlertDisplay.js.map +1 -1
  127. package/lib/commonjs/components/widgets/CancelOrderDialog.js +0 -12
  128. package/lib/commonjs/components/widgets/CancelOrderDialog.js.map +1 -1
  129. package/lib/commonjs/components/widgets/IconButton.js +34 -0
  130. package/lib/commonjs/components/widgets/IconButton.js.map +1 -0
  131. package/lib/commonjs/components/widgets/ProgressDialog.js +0 -7
  132. package/lib/commonjs/components/widgets/ProgressDialog.js.map +1 -1
  133. package/lib/commonjs/components/widgets/SnackBarCustom.js +38 -38
  134. package/lib/commonjs/components/widgets/SnackBarCustom.js.map +1 -1
  135. package/lib/commonjs/components/widgets/SplitTextInput.js +93 -0
  136. package/lib/commonjs/components/widgets/SplitTextInput.js.map +1 -0
  137. package/lib/commonjs/components/widgets/Toaster.js +0 -2
  138. package/lib/commonjs/components/widgets/Toaster.js.map +1 -1
  139. package/lib/commonjs/config/DispatchSDKConfig.js +4 -5
  140. package/lib/commonjs/config/DispatchSDKConfig.js.map +1 -1
  141. package/lib/commonjs/constants/apiConstants.js +15 -0
  142. package/lib/commonjs/constants/apiConstants.js.map +1 -0
  143. package/lib/commonjs/constants/constants.js +7 -3
  144. package/lib/commonjs/constants/constants.js.map +1 -1
  145. package/lib/commonjs/constants/statuscode.js +3 -5
  146. package/lib/commonjs/constants/statuscode.js.map +1 -1
  147. package/lib/commonjs/errors/BaseError.js +3 -8
  148. package/lib/commonjs/errors/BaseError.js.map +1 -1
  149. package/lib/commonjs/errors/ErrorCodes.js +7 -6
  150. package/lib/commonjs/errors/ErrorCodes.js.map +1 -1
  151. package/lib/commonjs/events/EventDispatcher.js +27 -0
  152. package/lib/commonjs/events/EventDispatcher.js.map +1 -0
  153. package/lib/commonjs/events/EventListener.js +20 -0
  154. package/lib/commonjs/events/EventListener.js.map +1 -0
  155. package/lib/commonjs/events/constants.js +13 -0
  156. package/lib/commonjs/events/constants.js.map +1 -0
  157. package/lib/commonjs/events/index.js +11 -0
  158. package/lib/commonjs/events/index.js.map +1 -0
  159. package/lib/commonjs/events/interface.js +2 -0
  160. package/lib/commonjs/events/interface.js.map +1 -0
  161. package/lib/commonjs/index.js +9 -23
  162. package/lib/commonjs/index.js.map +1 -1
  163. package/lib/commonjs/manager/dispatch/DispatchStateContainer.js +527 -177
  164. package/lib/commonjs/manager/dispatch/DispatchStateContainer.js.map +1 -1
  165. package/lib/commonjs/manager/dispatchCodes/EventCodeContainer.js +55 -4
  166. package/lib/commonjs/manager/dispatchCodes/EventCodeContainer.js.map +1 -1
  167. package/lib/commonjs/manager/dispatchCodes/EventCodeRepo.js +70 -0
  168. package/lib/commonjs/manager/dispatchCodes/EventCodeRepo.js.map +1 -0
  169. package/lib/commonjs/manager/dispatchCodes/ReasonCodeContainer.js +3 -29
  170. package/lib/commonjs/manager/dispatchCodes/ReasonCodeContainer.js.map +1 -1
  171. package/lib/commonjs/manager/dispatchCodes/ReasonCodeRepo.js +6 -20
  172. package/lib/commonjs/manager/dispatchCodes/ReasonCodeRepo.js.map +1 -1
  173. package/lib/commonjs/manager/jobRemoval/JobRemovalManager.js +27 -0
  174. package/lib/commonjs/manager/jobRemoval/JobRemovalManager.js.map +1 -0
  175. package/lib/commonjs/manager/location/LocationManager.js +3 -20
  176. package/lib/commonjs/manager/location/LocationManager.js.map +1 -1
  177. package/lib/commonjs/manager/sdk/DispatchSDKManager.js +8 -36
  178. package/lib/commonjs/manager/sdk/DispatchSDKManager.js.map +1 -1
  179. package/lib/commonjs/manager/sdk/DispatchSdkCache.js +6 -17
  180. package/lib/commonjs/manager/sdk/DispatchSdkCache.js.map +1 -1
  181. package/lib/commonjs/manager/syncmanager/AppSyncManager.js +12 -46
  182. package/lib/commonjs/manager/syncmanager/AppSyncManager.js.map +1 -1
  183. package/lib/commonjs/manager/syncmanager/DBConfig.js +13 -7
  184. package/lib/commonjs/manager/syncmanager/DBConfig.js.map +1 -1
  185. package/lib/commonjs/manager/syncmanager/NativeSyncManager.js +0 -2
  186. package/lib/commonjs/manager/syncmanager/NativeSyncManager.js.map +1 -1
  187. package/lib/commonjs/manager/syncmanager/database.js +28 -12
  188. package/lib/commonjs/manager/syncmanager/database.js.map +1 -1
  189. package/lib/commonjs/manager/syncmanager/document/DocumentHttpClient.js +0 -19
  190. package/lib/commonjs/manager/syncmanager/document/DocumentHttpClient.js.map +1 -1
  191. package/lib/commonjs/manager/syncmanager/document/DocumentManager.js +3 -20
  192. package/lib/commonjs/manager/syncmanager/document/DocumentManager.js.map +1 -1
  193. package/lib/commonjs/manager/syncmanager/document/DocumentSyncManager.js +3 -52
  194. package/lib/commonjs/manager/syncmanager/document/DocumentSyncManager.js.map +1 -1
  195. package/lib/commonjs/manager/syncmanager/events/ETEventsManager.js +59 -25
  196. package/lib/commonjs/manager/syncmanager/events/ETEventsManager.js.map +1 -1
  197. package/lib/commonjs/manager/syncmanager/events/EventsSyncManager.js +77 -90
  198. package/lib/commonjs/manager/syncmanager/events/EventsSyncManager.js.map +1 -1
  199. package/lib/commonjs/manager/syncmanager/events/SyncHttpClient.js +27 -19
  200. package/lib/commonjs/manager/syncmanager/events/SyncHttpClient.js.map +1 -1
  201. package/lib/commonjs/models/DispatchModels.js +4 -5
  202. package/lib/commonjs/models/DispatchModels.js.map +1 -1
  203. package/lib/commonjs/models/ReasonCodes.js.map +1 -1
  204. package/lib/commonjs/models/execTasks/ETBaseModels.js.map +1 -1
  205. package/lib/commonjs/models/execTasks/ETConfig.js +28 -35
  206. package/lib/commonjs/models/execTasks/ETConfig.js.map +1 -1
  207. package/lib/commonjs/models/sdk.js +4 -5
  208. package/lib/commonjs/models/sdk.js.map +1 -1
  209. package/lib/commonjs/native/signature/SignatureCapture.js +3 -24
  210. package/lib/commonjs/native/signature/SignatureCapture.js.map +1 -1
  211. package/lib/commonjs/network/GraphQLClient.js +7 -35
  212. package/lib/commonjs/network/GraphQLClient.js.map +1 -1
  213. package/lib/commonjs/network/NetworkClient.js +2 -13
  214. package/lib/commonjs/network/NetworkClient.js.map +1 -1
  215. package/lib/commonjs/network/NetworkUtils.js +10 -8
  216. package/lib/commonjs/network/NetworkUtils.js.map +1 -1
  217. package/lib/commonjs/network/Queries.js +0 -2
  218. package/lib/commonjs/network/Queries.js.map +1 -1
  219. package/lib/commonjs/network/client.js +6 -21
  220. package/lib/commonjs/network/client.js.map +1 -1
  221. package/lib/commonjs/res/strings.js.map +1 -1
  222. package/lib/commonjs/resources/Login.js +4 -15
  223. package/lib/commonjs/resources/Login.js.map +1 -1
  224. package/lib/commonjs/resources/network.js +3 -8
  225. package/lib/commonjs/resources/network.js.map +1 -1
  226. package/lib/commonjs/styles/SdkColors.js +7 -7
  227. package/lib/commonjs/styles/SdkColors.js.map +1 -1
  228. package/lib/commonjs/styles/executionTasks/CommonStyles.js +42 -18
  229. package/lib/commonjs/styles/executionTasks/CommonStyles.js.map +1 -1
  230. package/lib/commonjs/ui/screens/CancellationScreen.js +36 -27
  231. package/lib/commonjs/ui/screens/CancellationScreen.js.map +1 -1
  232. package/lib/commonjs/ui/screens/CaptureInputScreen.js +6 -15
  233. package/lib/commonjs/ui/screens/CaptureInputScreen.js.map +1 -1
  234. package/lib/commonjs/ui/screens/CompleteObjectiveScreen.js +0 -19
  235. package/lib/commonjs/ui/screens/CompleteObjectiveScreen.js.map +1 -1
  236. package/lib/commonjs/ui/screens/DeliverScreen.js +6 -15
  237. package/lib/commonjs/ui/screens/DeliverScreen.js.map +1 -1
  238. package/lib/commonjs/ui/screens/DisplayScreen.js +7 -12
  239. package/lib/commonjs/ui/screens/DisplayScreen.js.map +1 -1
  240. package/lib/commonjs/ui/screens/DoodleScreen.js +6 -16
  241. package/lib/commonjs/ui/screens/DoodleScreen.js.map +1 -1
  242. package/lib/commonjs/ui/screens/DropCashScreen.js +6 -18
  243. package/lib/commonjs/ui/screens/DropCashScreen.js.map +1 -1
  244. package/lib/commonjs/ui/screens/ETScreensIndex.js +14 -16
  245. package/lib/commonjs/ui/screens/ETScreensIndex.js.map +1 -1
  246. package/lib/commonjs/ui/screens/FormsScreen.js +36 -15
  247. package/lib/commonjs/ui/screens/FormsScreen.js.map +1 -1
  248. package/lib/commonjs/ui/screens/GeofenceScreen.js +7 -13
  249. package/lib/commonjs/ui/screens/GeofenceScreen.js.map +1 -1
  250. package/lib/commonjs/ui/screens/HttpRequestScreen.js +5 -10
  251. package/lib/commonjs/ui/screens/HttpRequestScreen.js.map +1 -1
  252. package/lib/commonjs/ui/screens/ImageCaptureScreen.js +27 -14
  253. package/lib/commonjs/ui/screens/ImageCaptureScreen.js.map +1 -1
  254. package/lib/commonjs/ui/screens/PaymentScreen.js +11 -23
  255. package/lib/commonjs/ui/screens/PaymentScreen.js.map +1 -1
  256. package/lib/commonjs/ui/screens/PickupScreen.js +9 -13
  257. package/lib/commonjs/ui/screens/PickupScreen.js.map +1 -1
  258. package/lib/commonjs/ui/screens/RTScanScreen.js +8 -27
  259. package/lib/commonjs/ui/screens/RTScanScreen.js.map +1 -1
  260. package/lib/commonjs/ui/screens/ScanScreen.js +268 -0
  261. package/lib/commonjs/ui/screens/ScanScreen.js.map +1 -0
  262. package/lib/commonjs/ui/screens/StartWorkFlowScreen.js +21 -30
  263. package/lib/commonjs/ui/screens/StartWorkFlowScreen.js.map +1 -1
  264. package/lib/commonjs/ui/screens/ValidateOTPScreen.js +49 -0
  265. package/lib/commonjs/ui/screens/ValidateOTPScreen.js.map +1 -0
  266. package/lib/commonjs/ui/screens/WithBaseDispatchScreen.js +0 -10
  267. package/lib/commonjs/ui/screens/WithBaseDispatchScreen.js.map +1 -1
  268. package/lib/commonjs/ui/uiConfig/RouteParams.js +9 -1
  269. package/lib/commonjs/ui/uiConfig/RouteParams.js.map +1 -1
  270. package/lib/commonjs/utils/ApiUtils.js +115 -0
  271. package/lib/commonjs/utils/ApiUtils.js.map +1 -0
  272. package/lib/commonjs/utils/ExecTaskUtils.js +93 -31
  273. package/lib/commonjs/utils/ExecTaskUtils.js.map +1 -1
  274. package/lib/commonjs/utils/Logger.js +10 -29
  275. package/lib/commonjs/utils/Logger.js.map +1 -1
  276. package/lib/commonjs/utils/NetworkUtil.js +3 -19
  277. package/lib/commonjs/utils/NetworkUtil.js.map +1 -1
  278. package/lib/commonjs/utils/SdkUtils.js +2 -31
  279. package/lib/commonjs/utils/SdkUtils.js.map +1 -1
  280. package/lib/commonjs/utils/SyncManagerUtils.js +25 -40
  281. package/lib/commonjs/utils/SyncManagerUtils.js.map +1 -1
  282. package/lib/commonjs/utils/fcm/FCM.js +35 -16
  283. package/lib/commonjs/utils/fcm/FCM.js.map +1 -1
  284. package/lib/commonjs/utils/fcm/FcmUtils.js +50 -25
  285. package/lib/commonjs/utils/fcm/FcmUtils.js.map +1 -1
  286. package/lib/commonjs/utils/helper.js +0 -5
  287. package/lib/commonjs/utils/helper.js.map +1 -1
  288. package/lib/commonjs/utils/hooks/useTimer.js +44 -0
  289. package/lib/commonjs/utils/hooks/useTimer.js.map +1 -0
  290. package/lib/commonjs/utils/loginHelper.js +6 -18
  291. package/lib/commonjs/utils/loginHelper.js.map +1 -1
  292. package/lib/commonjs/utils/storage.js +53 -32
  293. package/lib/commonjs/utils/storage.js.map +1 -1
  294. package/lib/commonjs/utils/utils.js +8 -11
  295. package/lib/commonjs/utils/utils.js.map +1 -1
  296. package/lib/module/components/dispatch/DispatchExecNavigator.js +46 -28
  297. package/lib/module/components/dispatch/DispatchExecNavigator.js.map +1 -1
  298. package/lib/module/components/executiontasks/ExecutionTasksIndex.js +3 -1
  299. package/lib/module/components/executiontasks/ExecutionTasksIndex.js.map +1 -1
  300. package/lib/module/components/executiontasks/cancellation/CancelET.js +145 -19
  301. package/lib/module/components/executiontasks/cancellation/CancelET.js.map +1 -1
  302. package/lib/module/components/executiontasks/cancellation/CancellationSchema.js.map +1 -1
  303. package/lib/module/components/executiontasks/captureInput/CaptureText.js +66 -9
  304. package/lib/module/components/executiontasks/captureInput/CaptureText.js.map +1 -1
  305. package/lib/module/components/executiontasks/deliver/DeliverET.js +6 -7
  306. package/lib/module/components/executiontasks/deliver/DeliverET.js.map +1 -1
  307. package/lib/module/components/executiontasks/deliver/SLDeliverET.js +69 -16
  308. package/lib/module/components/executiontasks/deliver/SLDeliverET.js.map +1 -1
  309. package/lib/module/components/executiontasks/display/DisplayModalET.js +4 -3
  310. package/lib/module/components/executiontasks/display/DisplayModalET.js.map +1 -1
  311. package/lib/module/components/executiontasks/doodle/DoodleUtils.js.map +1 -1
  312. package/lib/module/components/executiontasks/doodle/SignatureET.js +64 -14
  313. package/lib/module/components/executiontasks/doodle/SignatureET.js.map +1 -1
  314. package/lib/module/components/executiontasks/dropCash/DropCashET.js +5 -6
  315. package/lib/module/components/executiontasks/dropCash/DropCashET.js.map +1 -1
  316. package/lib/module/components/executiontasks/dropCash/SLDropCash.js +62 -8
  317. package/lib/module/components/executiontasks/dropCash/SLDropCash.js.map +1 -1
  318. package/lib/module/components/executiontasks/forms/FormGenerator.js +114 -14
  319. package/lib/module/components/executiontasks/forms/FormGenerator.js.map +1 -1
  320. package/lib/module/components/executiontasks/forms/widgets/DateTimeWidget.js +3 -15
  321. package/lib/module/components/executiontasks/forms/widgets/DateTimeWidget.js.map +1 -1
  322. package/lib/module/components/executiontasks/forms/widgets/DropdownWidget.js +39 -0
  323. package/lib/module/components/executiontasks/forms/widgets/DropdownWidget.js.map +1 -0
  324. package/lib/module/components/executiontasks/forms/widgets/QRBarcodeScannerWidget.js +1 -5
  325. package/lib/module/components/executiontasks/forms/widgets/QRBarcodeScannerWidget.js.map +1 -1
  326. package/lib/module/components/executiontasks/forms/widgets/TimeRangeSelector.js +0 -3
  327. package/lib/module/components/executiontasks/forms/widgets/TimeRangeSelector.js.map +1 -1
  328. package/lib/module/components/executiontasks/httpRequest/HttpEtUtils.js +4 -2
  329. package/lib/module/components/executiontasks/httpRequest/HttpEtUtils.js.map +1 -1
  330. package/lib/module/components/executiontasks/httpRequest/HttpRequestET.js +0 -3
  331. package/lib/module/components/executiontasks/httpRequest/HttpRequestET.js.map +1 -1
  332. package/lib/module/components/executiontasks/imageCapture/CaptureSchema.js.map +1 -1
  333. package/lib/module/components/executiontasks/imageCapture/CaptureUtils.js +7 -10
  334. package/lib/module/components/executiontasks/imageCapture/CaptureUtils.js.map +1 -1
  335. package/lib/module/components/executiontasks/imageCapture/ImageCapture.js +75 -35
  336. package/lib/module/components/executiontasks/imageCapture/ImageCapture.js.map +1 -1
  337. package/lib/module/components/executiontasks/payments/PaymentStyles.js.map +1 -1
  338. package/lib/module/components/executiontasks/payments/PaymentUtils.js.map +1 -1
  339. package/lib/module/components/executiontasks/payments/completePayment/CompletePaymentET.js +64 -6
  340. package/lib/module/components/executiontasks/payments/completePayment/CompletePaymentET.js.map +1 -1
  341. package/lib/module/components/executiontasks/payments/init/InitPaymentET.js +63 -11
  342. package/lib/module/components/executiontasks/payments/init/InitPaymentET.js.map +1 -1
  343. package/lib/module/components/executiontasks/payments/processPayment/ProcessPaymentET.js +71 -10
  344. package/lib/module/components/executiontasks/payments/processPayment/ProcessPaymentET.js.map +1 -1
  345. package/lib/module/components/executiontasks/pickup/PickupET.js +5 -6
  346. package/lib/module/components/executiontasks/pickup/PickupET.js.map +1 -1
  347. package/lib/module/components/executiontasks/pickup/SLPickupET.js +61 -10
  348. package/lib/module/components/executiontasks/pickup/SLPickupET.js.map +1 -1
  349. package/lib/module/components/executiontasks/scan/ScanET.js +833 -0
  350. package/lib/module/components/executiontasks/scan/ScanET.js.map +1 -0
  351. package/lib/module/components/executiontasks/scan/ScanSchema.js +2 -0
  352. package/lib/module/components/executiontasks/scan/ScanSchema.js.map +1 -0
  353. package/lib/module/components/executiontasks/scan/constants.js +7 -0
  354. package/lib/module/components/executiontasks/scan/constants.js.map +1 -0
  355. package/lib/module/components/executiontasks/scan/interfaces.js +21 -0
  356. package/lib/module/components/executiontasks/scan/interfaces.js.map +1 -0
  357. package/lib/module/components/executiontasks/scan/sub_components/CScanner.js +94 -0
  358. package/lib/module/components/executiontasks/scan/sub_components/CScanner.js.map +1 -0
  359. package/lib/module/components/executiontasks/scan/sub_components/DropDownUtils.js +66 -0
  360. package/lib/module/components/executiontasks/scan/sub_components/DropDownUtils.js.map +1 -0
  361. package/lib/module/components/executiontasks/scan/sub_components/ERDropDown.js +105 -0
  362. package/lib/module/components/executiontasks/scan/sub_components/ERDropDown.js.map +1 -0
  363. package/lib/module/components/executiontasks/scan/sub_components/ScanList.js +124 -0
  364. package/lib/module/components/executiontasks/scan/sub_components/ScanList.js.map +1 -0
  365. package/lib/module/components/executiontasks/scan/utils.js +358 -0
  366. package/lib/module/components/executiontasks/scan/utils.js.map +1 -0
  367. package/lib/module/components/executiontasks/scanner/CScanner.js +3 -8
  368. package/lib/module/components/executiontasks/scanner/CScanner.js.map +1 -1
  369. package/lib/module/components/executiontasks/scanner/ScannerSchema.js +3 -3
  370. package/lib/module/components/executiontasks/scanner/ScannerSchema.js.map +1 -1
  371. package/lib/module/components/executiontasks/scanner/ScannerUtils.js +6 -18
  372. package/lib/module/components/executiontasks/scanner/ScannerUtils.js.map +1 -1
  373. package/lib/module/components/executiontasks/scanner/returns/DropDownSelector.js +0 -2
  374. package/lib/module/components/executiontasks/scanner/returns/DropDownSelector.js.map +1 -1
  375. package/lib/module/components/executiontasks/scanner/returns/DropDownUtils.js +0 -5
  376. package/lib/module/components/executiontasks/scanner/returns/DropDownUtils.js.map +1 -1
  377. package/lib/module/components/executiontasks/scanner/returns/RTReasonSelection.js +0 -3
  378. package/lib/module/components/executiontasks/scanner/returns/RTReasonSelection.js.map +1 -1
  379. package/lib/module/components/executiontasks/scanner/returns/RTScan.js +1 -19
  380. package/lib/module/components/executiontasks/scanner/returns/RTScan.js.map +1 -1
  381. package/lib/module/components/executiontasks/scanner/returns/ReasonDropDown.js +0 -7
  382. package/lib/module/components/executiontasks/scanner/returns/ReasonDropDown.js.map +1 -1
  383. package/lib/module/components/executiontasks/scanner/returns/ScanList.js +0 -15
  384. package/lib/module/components/executiontasks/scanner/returns/ScanList.js.map +1 -1
  385. package/lib/module/components/executiontasks/validateOTP/ValidateOTPET.js +325 -0
  386. package/lib/module/components/executiontasks/validateOTP/ValidateOTPET.js.map +1 -0
  387. package/lib/module/components/executiontasks/validateOTP/ValidateOTPSchema.js +8 -0
  388. package/lib/module/components/executiontasks/validateOTP/ValidateOTPSchema.js.map +1 -0
  389. package/lib/module/components/executiontasks/validateOTP/constants.js +25 -0
  390. package/lib/module/components/executiontasks/validateOTP/constants.js.map +1 -0
  391. package/lib/module/components/executiontasks/validateOTP/sub-components/OTPInput.js +49 -0
  392. package/lib/module/components/executiontasks/validateOTP/sub-components/OTPInput.js.map +1 -0
  393. package/lib/module/components/executiontasks/validateOTP/utils.js +133 -0
  394. package/lib/module/components/executiontasks/validateOTP/utils.js.map +1 -0
  395. package/lib/module/components/executiontasks/verifyLocation/GeofenceUtils.js +0 -6
  396. package/lib/module/components/executiontasks/verifyLocation/GeofenceUtils.js.map +1 -1
  397. package/lib/module/components/executiontasks/verifyLocation/VerifyLocationET.js +4 -3
  398. package/lib/module/components/executiontasks/verifyLocation/VerifyLocationET.js.map +1 -1
  399. package/lib/module/components/executiontasks/verifyOtp/VerifyOtpET.js +4 -8
  400. package/lib/module/components/executiontasks/verifyOtp/VerifyOtpET.js.map +1 -1
  401. package/lib/module/components/widgets/AlertDisplay.js.map +1 -1
  402. package/lib/module/components/widgets/CancelOrderDialog.js +0 -2
  403. package/lib/module/components/widgets/CancelOrderDialog.js.map +1 -1
  404. package/lib/module/components/widgets/IconButton.js +26 -0
  405. package/lib/module/components/widgets/IconButton.js.map +1 -0
  406. package/lib/module/components/widgets/ProgressDialog.js +0 -2
  407. package/lib/module/components/widgets/ProgressDialog.js.map +1 -1
  408. package/lib/module/components/widgets/SnackBarCustom.js +36 -18
  409. package/lib/module/components/widgets/SnackBarCustom.js.map +1 -1
  410. package/lib/module/components/widgets/SplitTextInput.js +84 -0
  411. package/lib/module/components/widgets/SplitTextInput.js.map +1 -0
  412. package/lib/module/components/widgets/Toaster.js.map +1 -1
  413. package/lib/module/config/DispatchSDKConfig.js +3 -4
  414. package/lib/module/config/DispatchSDKConfig.js.map +1 -1
  415. package/lib/module/constants/apiConstants.js +7 -0
  416. package/lib/module/constants/apiConstants.js.map +1 -0
  417. package/lib/module/constants/constants.js +4 -2
  418. package/lib/module/constants/constants.js.map +1 -1
  419. package/lib/module/constants/statuscode.js +3 -5
  420. package/lib/module/constants/statuscode.js.map +1 -1
  421. package/lib/module/errors/BaseError.js +3 -6
  422. package/lib/module/errors/BaseError.js.map +1 -1
  423. package/lib/module/errors/ErrorCodes.js +5 -5
  424. package/lib/module/errors/ErrorCodes.js.map +1 -1
  425. package/lib/module/events/EventDispatcher.js +19 -0
  426. package/lib/module/events/EventDispatcher.js.map +1 -0
  427. package/lib/module/events/EventListener.js +13 -0
  428. package/lib/module/events/EventListener.js.map +1 -0
  429. package/lib/module/events/constants.js +6 -0
  430. package/lib/module/events/constants.js.map +1 -0
  431. package/lib/module/events/index.js +3 -0
  432. package/lib/module/events/index.js.map +1 -0
  433. package/lib/module/events/interface.js +2 -0
  434. package/lib/module/events/interface.js.map +1 -0
  435. package/lib/module/index.js +4 -3
  436. package/lib/module/index.js.map +1 -1
  437. package/lib/module/manager/dispatch/DispatchStateContainer.js +529 -151
  438. package/lib/module/manager/dispatch/DispatchStateContainer.js.map +1 -1
  439. package/lib/module/manager/dispatchCodes/EventCodeContainer.js +52 -2
  440. package/lib/module/manager/dispatchCodes/EventCodeContainer.js.map +1 -1
  441. package/lib/module/manager/dispatchCodes/EventCodeRepo.js +61 -0
  442. package/lib/module/manager/dispatchCodes/EventCodeRepo.js.map +1 -0
  443. package/lib/module/manager/dispatchCodes/ReasonCodeContainer.js +3 -16
  444. package/lib/module/manager/dispatchCodes/ReasonCodeContainer.js.map +1 -1
  445. package/lib/module/manager/dispatchCodes/ReasonCodeRepo.js +6 -14
  446. package/lib/module/manager/dispatchCodes/ReasonCodeRepo.js.map +1 -1
  447. package/lib/module/manager/jobRemoval/JobRemovalManager.js +20 -0
  448. package/lib/module/manager/jobRemoval/JobRemovalManager.js.map +1 -0
  449. package/lib/module/manager/location/LocationManager.js +3 -14
  450. package/lib/module/manager/location/LocationManager.js.map +1 -1
  451. package/lib/module/manager/sdk/DispatchSDKManager.js +8 -14
  452. package/lib/module/manager/sdk/DispatchSDKManager.js.map +1 -1
  453. package/lib/module/manager/sdk/DispatchSdkCache.js +6 -13
  454. package/lib/module/manager/sdk/DispatchSdkCache.js.map +1 -1
  455. package/lib/module/manager/syncmanager/AppSyncManager.js +12 -26
  456. package/lib/module/manager/syncmanager/AppSyncManager.js.map +1 -1
  457. package/lib/module/manager/syncmanager/DBConfig.js +9 -5
  458. package/lib/module/manager/syncmanager/DBConfig.js.map +1 -1
  459. package/lib/module/manager/syncmanager/NativeSyncManager.js.map +1 -1
  460. package/lib/module/manager/syncmanager/database.js +27 -3
  461. package/lib/module/manager/syncmanager/database.js.map +1 -1
  462. package/lib/module/manager/syncmanager/document/DocumentHttpClient.js +0 -7
  463. package/lib/module/manager/syncmanager/document/DocumentHttpClient.js.map +1 -1
  464. package/lib/module/manager/syncmanager/document/DocumentManager.js +3 -14
  465. package/lib/module/manager/syncmanager/document/DocumentManager.js.map +1 -1
  466. package/lib/module/manager/syncmanager/document/DocumentSyncManager.js +3 -35
  467. package/lib/module/manager/syncmanager/document/DocumentSyncManager.js.map +1 -1
  468. package/lib/module/manager/syncmanager/events/ETEventsManager.js +59 -18
  469. package/lib/module/manager/syncmanager/events/ETEventsManager.js.map +1 -1
  470. package/lib/module/manager/syncmanager/events/EventsSyncManager.js +77 -68
  471. package/lib/module/manager/syncmanager/events/EventsSyncManager.js.map +1 -1
  472. package/lib/module/manager/syncmanager/events/SyncHttpClient.js +26 -11
  473. package/lib/module/manager/syncmanager/events/SyncHttpClient.js.map +1 -1
  474. package/lib/module/models/DispatchModels.js +3 -4
  475. package/lib/module/models/DispatchModels.js.map +1 -1
  476. package/lib/module/models/ReasonCodes.js.map +1 -1
  477. package/lib/module/models/execTasks/ETBaseModels.js.map +1 -1
  478. package/lib/module/models/execTasks/ETConfig.js +22 -29
  479. package/lib/module/models/execTasks/ETConfig.js.map +1 -1
  480. package/lib/module/models/sdk.js +3 -4
  481. package/lib/module/models/sdk.js.map +1 -1
  482. package/lib/module/native/signature/SignatureCapture.js +3 -18
  483. package/lib/module/native/signature/SignatureCapture.js.map +1 -1
  484. package/lib/module/network/GraphQLClient.js +6 -26
  485. package/lib/module/network/GraphQLClient.js.map +1 -1
  486. package/lib/module/network/NetworkClient.js +2 -6
  487. package/lib/module/network/NetworkClient.js.map +1 -1
  488. package/lib/module/network/NetworkUtils.js +10 -3
  489. package/lib/module/network/NetworkUtils.js.map +1 -1
  490. package/lib/module/network/Queries.js.map +1 -1
  491. package/lib/module/network/client.js +7 -17
  492. package/lib/module/network/client.js.map +1 -1
  493. package/lib/module/res/strings.js.map +1 -1
  494. package/lib/module/resources/Login.js +4 -13
  495. package/lib/module/resources/Login.js.map +1 -1
  496. package/lib/module/resources/network.js +3 -6
  497. package/lib/module/resources/network.js.map +1 -1
  498. package/lib/module/styles/SdkColors.js +6 -6
  499. package/lib/module/styles/SdkColors.js.map +1 -1
  500. package/lib/module/styles/executionTasks/CommonStyles.js +41 -7
  501. package/lib/module/styles/executionTasks/CommonStyles.js.map +1 -1
  502. package/lib/module/ui/screens/CancellationScreen.js +36 -14
  503. package/lib/module/ui/screens/CancellationScreen.js.map +1 -1
  504. package/lib/module/ui/screens/CaptureInputScreen.js +7 -4
  505. package/lib/module/ui/screens/CaptureInputScreen.js.map +1 -1
  506. package/lib/module/ui/screens/CompleteObjectiveScreen.js +0 -3
  507. package/lib/module/ui/screens/CompleteObjectiveScreen.js.map +1 -1
  508. package/lib/module/ui/screens/DeliverScreen.js +7 -4
  509. package/lib/module/ui/screens/DeliverScreen.js.map +1 -1
  510. package/lib/module/ui/screens/DisplayScreen.js +5 -4
  511. package/lib/module/ui/screens/DisplayScreen.js.map +1 -1
  512. package/lib/module/ui/screens/DoodleScreen.js +7 -4
  513. package/lib/module/ui/screens/DoodleScreen.js.map +1 -1
  514. package/lib/module/ui/screens/DropCashScreen.js +7 -7
  515. package/lib/module/ui/screens/DropCashScreen.js.map +1 -1
  516. package/lib/module/ui/screens/ETScreensIndex.js +3 -1
  517. package/lib/module/ui/screens/ETScreensIndex.js.map +1 -1
  518. package/lib/module/ui/screens/FormsScreen.js +34 -6
  519. package/lib/module/ui/screens/FormsScreen.js.map +1 -1
  520. package/lib/module/ui/screens/GeofenceScreen.js +5 -4
  521. package/lib/module/ui/screens/GeofenceScreen.js.map +1 -1
  522. package/lib/module/ui/screens/HttpRequestScreen.js +5 -3
  523. package/lib/module/ui/screens/HttpRequestScreen.js.map +1 -1
  524. package/lib/module/ui/screens/ImageCaptureScreen.js +25 -5
  525. package/lib/module/ui/screens/ImageCaptureScreen.js.map +1 -1
  526. package/lib/module/ui/screens/PaymentScreen.js +12 -10
  527. package/lib/module/ui/screens/PaymentScreen.js.map +1 -1
  528. package/lib/module/ui/screens/PickupScreen.js +7 -5
  529. package/lib/module/ui/screens/PickupScreen.js.map +1 -1
  530. package/lib/module/ui/screens/RTScanScreen.js +9 -13
  531. package/lib/module/ui/screens/RTScanScreen.js.map +1 -1
  532. package/lib/module/ui/screens/ScanScreen.js +259 -0
  533. package/lib/module/ui/screens/ScanScreen.js.map +1 -0
  534. package/lib/module/ui/screens/StartWorkFlowScreen.js +22 -9
  535. package/lib/module/ui/screens/StartWorkFlowScreen.js.map +1 -1
  536. package/lib/module/ui/screens/ValidateOTPScreen.js +39 -0
  537. package/lib/module/ui/screens/ValidateOTPScreen.js.map +1 -0
  538. package/lib/module/ui/screens/WithBaseDispatchScreen.js +0 -3
  539. package/lib/module/ui/screens/WithBaseDispatchScreen.js.map +1 -1
  540. package/lib/module/ui/uiConfig/RouteParams.js +9 -1
  541. package/lib/module/ui/uiConfig/RouteParams.js.map +1 -1
  542. package/lib/module/utils/ApiUtils.js +101 -0
  543. package/lib/module/utils/ApiUtils.js.map +1 -0
  544. package/lib/module/utils/ExecTaskUtils.js +92 -21
  545. package/lib/module/utils/ExecTaskUtils.js.map +1 -1
  546. package/lib/module/utils/Logger.js +9 -21
  547. package/lib/module/utils/Logger.js.map +1 -1
  548. package/lib/module/utils/NetworkUtil.js +3 -15
  549. package/lib/module/utils/NetworkUtil.js.map +1 -1
  550. package/lib/module/utils/SdkUtils.js +2 -15
  551. package/lib/module/utils/SdkUtils.js.map +1 -1
  552. package/lib/module/utils/SyncManagerUtils.js +25 -10
  553. package/lib/module/utils/SyncManagerUtils.js.map +1 -1
  554. package/lib/module/utils/fcm/FCM.js +35 -4
  555. package/lib/module/utils/fcm/FCM.js.map +1 -1
  556. package/lib/module/utils/fcm/FcmUtils.js +50 -7
  557. package/lib/module/utils/fcm/FcmUtils.js.map +1 -1
  558. package/lib/module/utils/helper.js +0 -3
  559. package/lib/module/utils/helper.js.map +1 -1
  560. package/lib/module/utils/hooks/useTimer.js +37 -0
  561. package/lib/module/utils/hooks/useTimer.js.map +1 -0
  562. package/lib/module/utils/loginHelper.js +6 -16
  563. package/lib/module/utils/loginHelper.js.map +1 -1
  564. package/lib/module/utils/storage.js +51 -29
  565. package/lib/module/utils/storage.js.map +1 -1
  566. package/lib/module/utils/utils.js +8 -6
  567. package/lib/module/utils/utils.js.map +1 -1
  568. package/lib/typescript/components/executiontasks/CompletedWFSchema.d.ts +2 -2
  569. package/lib/typescript/components/executiontasks/ExecutionTasksIndex.d.ts +6 -2
  570. package/lib/typescript/components/executiontasks/cancellation/CancellationSchema.d.ts +10 -5
  571. package/lib/typescript/components/executiontasks/captureInput/CaptureInputSchema.d.ts +7 -7
  572. package/lib/typescript/components/executiontasks/deliver/DeliverETInput.d.ts +7 -7
  573. package/lib/typescript/components/executiontasks/display/DisplaySchema.d.ts +5 -5
  574. package/lib/typescript/components/executiontasks/doodle/SignatureSchema.d.ts +7 -7
  575. package/lib/typescript/components/executiontasks/dropCash/DropCashSchema.d.ts +2 -2
  576. package/lib/typescript/components/executiontasks/forms/FormSchema.d.ts +2 -2
  577. package/lib/typescript/components/executiontasks/forms/widgets/DateTimeWidget.d.ts +1 -1
  578. package/lib/typescript/components/executiontasks/forms/widgets/DropdownWidget.d.ts +9 -0
  579. package/lib/typescript/components/executiontasks/httpRequest/HttpRequestETSchema.d.ts +6 -6
  580. package/lib/typescript/components/executiontasks/imageCapture/CaptureSchema.d.ts +16 -11
  581. package/lib/typescript/components/executiontasks/payments/completePayment/CompletePaymentSchema.d.ts +2 -2
  582. package/lib/typescript/components/executiontasks/payments/init/InitPaymentSchema.d.ts +3 -3
  583. package/lib/typescript/components/executiontasks/payments/processPayment/ProcessPaymentSchema.d.ts +2 -2
  584. package/lib/typescript/components/executiontasks/pickup/PickpSchema.d.ts +3 -3
  585. package/lib/typescript/components/executiontasks/scan/ScanET.d.ts +16 -0
  586. package/lib/typescript/components/executiontasks/scan/ScanSchema.d.ts +70 -0
  587. package/lib/typescript/components/executiontasks/scan/constants.d.ts +6 -0
  588. package/lib/typescript/components/executiontasks/scan/interfaces.d.ts +41 -0
  589. package/lib/typescript/components/executiontasks/scan/sub_components/CScanner.d.ts +7 -0
  590. package/lib/typescript/components/executiontasks/scan/sub_components/DropDownUtils.d.ts +7 -0
  591. package/lib/typescript/components/executiontasks/scan/sub_components/ERDropDown.d.ts +17 -0
  592. package/lib/typescript/components/executiontasks/scan/sub_components/ScanList.d.ts +8 -0
  593. package/lib/typescript/components/executiontasks/scan/utils.d.ts +21 -0
  594. package/lib/typescript/components/executiontasks/scanner/ScannerSchema.d.ts +6 -6
  595. package/lib/typescript/components/executiontasks/scanner/returns/DropDownUtils.d.ts +1 -2
  596. package/lib/typescript/components/executiontasks/scanner/returns/RTReasonSelection.d.ts +1 -1
  597. package/lib/typescript/components/executiontasks/scanner/returns/ScanList.d.ts +1 -1
  598. package/lib/typescript/components/executiontasks/validateOTP/ValidateOTPET.d.ts +4 -0
  599. package/lib/typescript/components/executiontasks/validateOTP/ValidateOTPSchema.d.ts +54 -0
  600. package/lib/typescript/components/executiontasks/validateOTP/constants.d.ts +10 -0
  601. package/lib/typescript/components/executiontasks/validateOTP/sub-components/OTPInput.d.ts +12 -0
  602. package/lib/typescript/components/executiontasks/validateOTP/utils.d.ts +7 -0
  603. package/lib/typescript/components/executiontasks/verifyInput/VerifyInputSchema.d.ts +8 -8
  604. package/lib/typescript/components/executiontasks/verifyLocation/VerifyLocSchema.d.ts +9 -9
  605. package/lib/typescript/components/executiontasks/verifyOtp/VerifyOtpSchema.d.ts +3 -3
  606. package/lib/typescript/components/widgets/IconButton.d.ts +9 -0
  607. package/lib/typescript/components/widgets/SnackBarCustom.d.ts +9 -5
  608. package/lib/typescript/components/widgets/SplitTextInput.d.ts +12 -0
  609. package/lib/typescript/constants/apiConstants.d.ts +6 -0
  610. package/lib/typescript/constants/constants.d.ts +4 -2
  611. package/lib/typescript/errors/ErrorCodes.d.ts +3 -1
  612. package/lib/typescript/events/EventDispatcher.d.ts +5 -0
  613. package/lib/typescript/events/EventListener.d.ts +5 -0
  614. package/lib/typescript/events/constants.d.ts +5 -0
  615. package/lib/typescript/events/index.d.ts +2 -0
  616. package/lib/typescript/events/interface.d.ts +1 -0
  617. package/lib/typescript/index.d.ts +5 -4
  618. package/lib/typescript/manager/dispatch/DispatchStateContainer.d.ts +21 -8
  619. package/lib/typescript/manager/dispatchCodes/EventCodeContainer.d.ts +12 -1
  620. package/lib/typescript/manager/dispatchCodes/EventCodeRepo.d.ts +13 -0
  621. package/lib/typescript/manager/jobRemoval/JobRemovalManager.d.ts +6 -0
  622. package/lib/typescript/manager/sdk/DispatchSdkCache.d.ts +2 -0
  623. package/lib/typescript/manager/syncmanager/AppSyncManager.d.ts +1 -0
  624. package/lib/typescript/manager/syncmanager/DBConfig.d.ts +22 -2
  625. package/lib/typescript/manager/syncmanager/database.d.ts +5 -0
  626. package/lib/typescript/manager/syncmanager/document/models.d.ts +1 -1
  627. package/lib/typescript/manager/syncmanager/events/ETEventsManager.d.ts +5 -1
  628. package/lib/typescript/manager/syncmanager/events/EventsSyncManager.d.ts +5 -1
  629. package/lib/typescript/manager/syncmanager/events/SyncHttpClient.d.ts +3 -1
  630. package/lib/typescript/models/DispatchModels.d.ts +56 -1
  631. package/lib/typescript/models/ReasonCodes.d.ts +5 -0
  632. package/lib/typescript/models/auth.d.ts +1 -1
  633. package/lib/typescript/models/execTasks/ETBaseModels.d.ts +27 -8
  634. package/lib/typescript/models/execTasks/ETConfig.d.ts +8 -4
  635. package/lib/typescript/models/sdk.d.ts +5 -0
  636. package/lib/typescript/native/signature/SignatureCapture.d.ts +1 -1
  637. package/lib/typescript/network/NetworkUtils.d.ts +1 -5
  638. package/lib/typescript/styles/SdkColors.d.ts +1 -0
  639. package/lib/typescript/styles/executionTasks/CommonStyles.d.ts +36 -0
  640. package/lib/typescript/ui/screens/ETScreensIndex.d.ts +3 -1
  641. package/lib/typescript/ui/screens/ScanScreen.d.ts +3 -0
  642. package/lib/typescript/ui/screens/ValidateOTPScreen.d.ts +3 -0
  643. package/lib/typescript/ui/uiConfig/RouteParams.d.ts +8 -0
  644. package/lib/typescript/utils/ApiUtils.d.ts +61 -0
  645. package/lib/typescript/utils/ExecTaskUtils.d.ts +7 -2
  646. package/lib/typescript/utils/NetworkUtil.d.ts +1 -1
  647. package/lib/typescript/utils/SyncManagerUtils.d.ts +3 -1
  648. package/lib/typescript/utils/hooks/useTimer.d.ts +5 -0
  649. package/lib/typescript/utils/storage.d.ts +17 -0
  650. package/package.json +23 -24
  651. package/tsconfig.json +9 -8
  652. package/file_unzip.js +0 -5
  653. package/mobile-execution-lib-0.6.4.tgz +0 -0
@@ -4,21 +4,13 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.default = void 0;
7
-
8
7
  var _react = _interopRequireWildcard(require("react"));
9
-
10
8
  var _reactNative = require("react-native");
11
-
12
9
  var _DateTimeWidget = _interopRequireDefault(require("./DateTimeWidget"));
13
-
14
10
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
15
-
16
11
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
17
-
18
12
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
19
-
20
13
  function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
21
-
22
14
  const TimeRangeSelector = props => {
23
15
  const [start, setStart] = (0, _react.useState)(new Date());
24
16
  const [end, setEnd] = (0, _react.useState)(new Date());
@@ -40,7 +32,6 @@ const TimeRangeSelector = props => {
40
32
  }
41
33
  })));
42
34
  };
43
-
44
35
  const styles = _reactNative.StyleSheet.create({
45
36
  container: {
46
37
  flex: 1,
@@ -48,7 +39,6 @@ const styles = _reactNative.StyleSheet.create({
48
39
  justifyContent: 'space-between'
49
40
  }
50
41
  });
51
-
52
42
  var _default = TimeRangeSelector;
53
43
  exports.default = _default;
54
44
  //# sourceMappingURL=TimeRangeSelector.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["TimeRangeSelector","props","start","setStart","useState","Date","end","setEnd","useEffect","onChange","JSON","stringify","styles","container","date","StyleSheet","create","flex","flexDirection","justifyContent"],"sources":["TimeRangeSelector.tsx"],"sourcesContent":["import React, { useEffect, useState } from 'react';\nimport { StyleSheet, View } from 'react-native';\nimport type { WidgetProps } from '@rjsf/core';\nimport DateTimeWidget from './DateTimeWidget';\n\nconst TimeRangeSelector = (props: WidgetProps) => {\n const [start, setStart] = useState(new Date());\n const [end, setEnd] = useState(new Date());\n useEffect(() => {\n props.onChange(JSON.stringify({ start: start, end: end }));\n });\n return (\n <View style={styles.container}>\n <DateTimeWidget\n {...props}\n onChange={(date) => {\n setStart(date);\n }}\n />\n <DateTimeWidget\n {...props}\n onChange={(date) => {\n setEnd(date);\n }}\n />\n </View>\n );\n};\n\nconst styles = StyleSheet.create({\n container: {\n flex: 1,\n flexDirection: 'row',\n justifyContent: 'space-between',\n },\n});\n\nexport default TimeRangeSelector;\n"],"mappings":";;;;;;;AAAA;;AACA;;AAEA;;;;;;;;;;AAEA,MAAMA,iBAAiB,GAAIC,KAAD,IAAwB;EAChD,MAAM,CAACC,KAAD,EAAQC,QAAR,IAAoB,IAAAC,eAAA,EAAS,IAAIC,IAAJ,EAAT,CAA1B;EACA,MAAM,CAACC,GAAD,EAAMC,MAAN,IAAgB,IAAAH,eAAA,EAAS,IAAIC,IAAJ,EAAT,CAAtB;EACA,IAAAG,gBAAA,EAAU,MAAM;IACdP,KAAK,CAACQ,QAAN,CAAeC,IAAI,CAACC,SAAL,CAAe;MAAET,KAAK,EAAEA,KAAT;MAAgBI,GAAG,EAAEA;IAArB,CAAf,CAAf;EACD,CAFD;EAGA,oBACE,6BAAC,iBAAD;IAAM,KAAK,EAAEM,MAAM,CAACC;EAApB,gBACE,6BAAC,uBAAD,eACMZ,KADN;IAEE,QAAQ,EAAGa,IAAD,IAAU;MAClBX,QAAQ,CAACW,IAAD,CAAR;IACD;EAJH,GADF,eAOE,6BAAC,uBAAD,eACMb,KADN;IAEE,QAAQ,EAAGa,IAAD,IAAU;MAClBP,MAAM,CAACO,IAAD,CAAN;IACD;EAJH,GAPF,CADF;AAgBD,CAtBD;;AAwBA,MAAMF,MAAM,GAAGG,uBAAA,CAAWC,MAAX,CAAkB;EAC/BH,SAAS,EAAE;IACTI,IAAI,EAAE,CADG;IAETC,aAAa,EAAE,KAFN;IAGTC,cAAc,EAAE;EAHP;AADoB,CAAlB,CAAf;;eAQenB,iB"}
1
+ {"version":3,"names":["_react","_interopRequireWildcard","require","_reactNative","_DateTimeWidget","_interopRequireDefault","obj","__esModule","default","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","_extends","assign","bind","target","i","arguments","length","source","apply","TimeRangeSelector","props","start","setStart","useState","Date","end","setEnd","useEffect","onChange","JSON","stringify","createElement","View","style","styles","container","date","StyleSheet","create","flex","flexDirection","justifyContent","_default","exports"],"sources":["TimeRangeSelector.tsx"],"sourcesContent":["import React, { useEffect, useState } from 'react';\nimport { StyleSheet, View } from 'react-native';\nimport type { WidgetProps } from '@rjsf/core';\nimport DateTimeWidget from './DateTimeWidget';\n\nconst TimeRangeSelector = (props: WidgetProps) => {\n const [start, setStart] = useState(new Date());\n const [end, setEnd] = useState(new Date());\n useEffect(() => {\n props.onChange(JSON.stringify({ start: start, end: end }));\n });\n return (\n <View style={styles.container}>\n <DateTimeWidget\n {...props}\n onChange={(date) => {\n setStart(date);\n }}\n />\n <DateTimeWidget\n {...props}\n onChange={(date) => {\n setEnd(date);\n }}\n />\n </View>\n );\n};\n\nconst styles = StyleSheet.create({\n container: {\n flex: 1,\n flexDirection: 'row',\n justifyContent: 'space-between',\n },\n});\n\nexport default TimeRangeSelector;\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AAEA,IAAAE,eAAA,GAAAC,sBAAA,CAAAH,OAAA;AAA8C,SAAAG,uBAAAC,GAAA,WAAAA,GAAA,IAAAA,GAA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IACd;EAAE,GACF,CACG;AAEX,CAAC;AAED,MAAMF,MAAM,GAAGG,uBAAU,CAACC,MAAM,CAAC;EAC/BH,SAAS,EAAE;IACTI,IAAI,EAAE,CAAC;IACPC,aAAa,EAAE,KAAK;IACpBC,cAAc,EAAE;EAClB;AACF,CAAC,CAAC;AAAC,IAAAC,QAAA,GAEYvB,iBAAiB;AAAAwB,OAAA,CAAArD,OAAA,GAAAoD,QAAA"}
@@ -6,23 +6,14 @@ Object.defineProperty(exports, "__esModule", {
6
6
  exports.getApiResponse = getApiResponse;
7
7
  exports.getHttpETOutput = getHttpETOutput;
8
8
  exports.getOutputUsingJsonpath = getOutputUsingJsonpath;
9
-
10
9
  var _axios = _interopRequireDefault(require("axios"));
11
-
12
10
  var _NetworkUtils = require("../../../network/NetworkUtils");
13
-
14
11
  var _GraphQLClient = require("../../../network/GraphQLClient");
15
-
16
12
  var _jsonpathPlus = require("jsonpath-plus");
17
-
18
13
  var _utils = require("../../../utils/utils");
19
-
20
14
  var _ExecTaskUtils = require("../../../utils/ExecTaskUtils");
21
-
22
15
  var _ETConfig = require("../../../models/execTasks/ETConfig");
23
-
24
16
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
25
-
26
17
  async function getApiResponse(apiData) {
27
18
  const axiosConfig = {
28
19
  data: apiData.requestBody,
@@ -30,13 +21,13 @@ async function getApiResponse(apiData) {
30
21
  timeout: apiData.timeout ?? 15000,
31
22
  // timeout in millis i.e 15s
32
23
  url: apiData.uri,
33
- headers: { ...(0, _NetworkUtils.getAddHeaders)(apiData.headers),
24
+ headers: {
25
+ ...(0, _NetworkUtils.getAddHeaders)(apiData.headers),
34
26
  ...(await (0, _NetworkUtils.getHeaders)(_GraphQLClient.API_CONTENT_TYPES.APPLICATION_JSON))
35
27
  }
36
28
  };
37
29
  return (0, _axios.default)(axiosConfig);
38
30
  }
39
-
40
31
  function getOutputUsingJsonpath(json, jsonPath) {
41
32
  if ((0, _utils.isEmptyOrBlank)(jsonPath)) return json;
42
33
  return (0, _jsonpathPlus.JSONPath)({
@@ -44,9 +35,9 @@ function getOutputUsingJsonpath(json, jsonPath) {
44
35
  json
45
36
  });
46
37
  }
47
-
48
38
  async function getHttpETOutput(apiResponse, jsonPath, success) {
49
- return { ...(await (0, _ExecTaskUtils.getBaseETResponse)(_ETConfig.EntityCode.HTTP_REQUEST_ET, success, success ? _ETConfig.BaseEventCodes.ENTITY_SUCCESS : _ETConfig.BaseEventCodes.ENTITY_FAILURE, '')),
39
+ return {
40
+ ...(await (0, _ExecTaskUtils.getBaseETResponse)(_ETConfig.EntityCode.HTTP_REQUEST_ET, success, success ? _ETConfig.BaseEventCodes.ENTITY_SUCCESS : _ETConfig.BaseEventCodes.ENTITY_FAILURE, '')),
50
41
  apiResponse: getOutputUsingJsonpath(apiResponse, jsonPath)
51
42
  };
52
43
  }
@@ -1 +1 @@
1
- {"version":3,"names":["getApiResponse","apiData","axiosConfig","data","requestBody","method","httpMethod","timeout","url","uri","headers","getAddHeaders","getHeaders","API_CONTENT_TYPES","APPLICATION_JSON","axios","getOutputUsingJsonpath","json","jsonPath","isEmptyOrBlank","JSONPath","path","getHttpETOutput","apiResponse","success","getBaseETResponse","EntityCode","HTTP_REQUEST_ET","BaseEventCodes","ENTITY_SUCCESS","ENTITY_FAILURE"],"sources":["HttpEtUtils.ts"],"sourcesContent":["import type { APIData, HttpRequestETOutput } from './HttpRequestETSchema';\nimport axios, { AxiosRequestConfig } from 'axios';\nimport { getAddHeaders, getHeaders } from '../../../network/NetworkUtils';\nimport { API_CONTENT_TYPES } from '../../../network/GraphQLClient';\nimport { JSONPath } from 'jsonpath-plus';\nimport { isEmptyOrBlank } from '../../../utils/utils';\nimport { getBaseETResponse } from '../../../utils/ExecTaskUtils';\nimport { BaseEventCodes, EntityCode } from '../../../models/execTasks/ETConfig';\n\nexport async function getApiResponse(apiData: APIData) {\n const axiosConfig: AxiosRequestConfig = {\n data: apiData.requestBody,\n method: apiData.httpMethod,\n timeout: apiData.timeout ?? 15000, // timeout in millis i.e 15s\n url: apiData.uri,\n headers: {\n ...getAddHeaders(apiData.headers),\n ...(await getHeaders(API_CONTENT_TYPES.APPLICATION_JSON)),\n },\n };\n return axios(axiosConfig);\n}\nexport function getOutputUsingJsonpath(json: object, jsonPath: string) {\n if (isEmptyOrBlank(jsonPath)) return json;\n return JSONPath({ path: jsonPath, json });\n}\n\nexport async function getHttpETOutput(\n apiResponse: object,\n jsonPath: string,\n success: boolean\n): Promise<HttpRequestETOutput> {\n return {\n ...(await getBaseETResponse(\n EntityCode.HTTP_REQUEST_ET,\n success,\n success ? BaseEventCodes.ENTITY_SUCCESS : BaseEventCodes.ENTITY_FAILURE,\n ''\n )),\n apiResponse: getOutputUsingJsonpath(apiResponse, jsonPath),\n };\n}\n"],"mappings":";;;;;;;;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;AAEO,eAAeA,cAAf,CAA8BC,OAA9B,EAAgD;EACrD,MAAMC,WAA+B,GAAG;IACtCC,IAAI,EAAEF,OAAO,CAACG,WADwB;IAEtCC,MAAM,EAAEJ,OAAO,CAACK,UAFsB;IAGtCC,OAAO,EAAEN,OAAO,CAACM,OAAR,IAAmB,KAHU;IAGH;IACnCC,GAAG,EAAEP,OAAO,CAACQ,GAJyB;IAKtCC,OAAO,EAAE,EACP,GAAG,IAAAC,2BAAA,EAAcV,OAAO,CAACS,OAAtB,CADI;MAEP,IAAI,MAAM,IAAAE,wBAAA,EAAWC,gCAAA,CAAkBC,gBAA7B,CAAV;IAFO;EAL6B,CAAxC;EAUA,OAAO,IAAAC,cAAA,EAAMb,WAAN,CAAP;AACD;;AACM,SAASc,sBAAT,CAAgCC,IAAhC,EAA8CC,QAA9C,EAAgE;EACrE,IAAI,IAAAC,qBAAA,EAAeD,QAAf,CAAJ,EAA8B,OAAOD,IAAP;EAC9B,OAAO,IAAAG,sBAAA,EAAS;IAAEC,IAAI,EAAEH,QAAR;IAAkBD;EAAlB,CAAT,CAAP;AACD;;AAEM,eAAeK,eAAf,CACLC,WADK,EAELL,QAFK,EAGLM,OAHK,EAIyB;EAC9B,OAAO,EACL,IAAI,MAAM,IAAAC,gCAAA,EACRC,oBAAA,CAAWC,eADH,EAERH,OAFQ,EAGRA,OAAO,GAAGI,wBAAA,CAAeC,cAAlB,GAAmCD,wBAAA,CAAeE,cAHjD,EAIR,EAJQ,CAAV,CADK;IAOLP,WAAW,EAAEP,sBAAsB,CAACO,WAAD,EAAcL,QAAd;EAP9B,CAAP;AASD"}
1
+ {"version":3,"names":["_axios","_interopRequireDefault","require","_NetworkUtils","_GraphQLClient","_jsonpathPlus","_utils","_ExecTaskUtils","_ETConfig","obj","__esModule","default","getApiResponse","apiData","axiosConfig","data","requestBody","method","httpMethod","timeout","url","uri","headers","getAddHeaders","getHeaders","API_CONTENT_TYPES","APPLICATION_JSON","axios","getOutputUsingJsonpath","json","jsonPath","isEmptyOrBlank","JSONPath","path","getHttpETOutput","apiResponse","success","getBaseETResponse","EntityCode","HTTP_REQUEST_ET","BaseEventCodes","ENTITY_SUCCESS","ENTITY_FAILURE"],"sources":["HttpEtUtils.ts"],"sourcesContent":["import type { APIData, HttpRequestETOutput } from './HttpRequestETSchema';\nimport axios, { AxiosRequestConfig } from 'axios';\nimport { getAddHeaders, getHeaders } from '../../../network/NetworkUtils';\nimport { API_CONTENT_TYPES } from '../../../network/GraphQLClient';\nimport { JSONPath } from 'jsonpath-plus';\nimport { isEmptyOrBlank } from '../../../utils/utils';\nimport { getBaseETResponse } from '../../../utils/ExecTaskUtils';\nimport { BaseEventCodes, EntityCode } from '../../../models/execTasks/ETConfig';\n\nexport async function getApiResponse(apiData: APIData) {\n const axiosConfig: AxiosRequestConfig = {\n data: apiData.requestBody,\n method: apiData.httpMethod,\n timeout: apiData.timeout ?? 15000, // timeout in millis i.e 15s\n url: apiData.uri,\n headers: {\n ...getAddHeaders(apiData.headers),\n ...(await getHeaders(API_CONTENT_TYPES.APPLICATION_JSON)),\n },\n };\n return axios(axiosConfig);\n}\nexport function getOutputUsingJsonpath(json: object, jsonPath: string) {\n if (isEmptyOrBlank(jsonPath)) return json;\n return JSONPath({ path: jsonPath, json });\n}\n\nexport async function getHttpETOutput(\n apiResponse: object,\n jsonPath: string,\n success: boolean\n): Promise<HttpRequestETOutput> {\n return {\n ...(await getBaseETResponse(\n EntityCode.HTTP_REQUEST_ET,\n success,\n success ? BaseEventCodes.ENTITY_SUCCESS : BaseEventCodes.ENTITY_FAILURE,\n ''\n )),\n apiResponse: getOutputUsingJsonpath(apiResponse, jsonPath),\n };\n}\n"],"mappings":";;;;;;;;AACA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,aAAA,GAAAD,OAAA;AACA,IAAAE,cAAA,GAAAF,OAAA;AACA,IAAAG,aAAA,GAAAH,OAAA;AACA,IAAAI,MAAA,GAAAJ,OAAA;AACA,IAAAK,cAAA,GAAAL,OAAA;AACA,IAAAM,SAAA,GAAAN,OAAA;AAAgF,SAAAD,uBAAAQ,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAEzE,eAAeG,cAAcA,CAACC,OAAgB,EAAE;EACrD,MAAMC,WAA+B,GAAG;IACtCC,IAAI,EAAEF,OAAO,CAACG,WAAW;IACzBC,MAAM,EAAEJ,OAAO,CAACK,UAAU;IAC1BC,OAAO,EAAEN,OAAO,CAACM,OAAO,IAAI,KAAK;IAAE;IACnCC,GAAG,EAAEP,OAAO,CAACQ,GAAG;IAChBC,OAAO,EAAE;MACP,GAAG,IAAAC,2BAAa,EAACV,OAAO,CAACS,OAAO,CAAC;MACjC,IAAI,MAAM,IAAAE,wBAAU,EAACC,gCAAiB,CAACC,gBAAgB,CAAC;IAC1D;EACF,CAAC;EACD,OAAO,IAAAC,cAAK,EAACb,WAAW,CAAC;AAC3B;AACO,SAASc,sBAAsBA,CAACC,IAAY,EAAEC,QAAgB,EAAE;EACrE,IAAI,IAAAC,qBAAc,EAACD,QAAQ,CAAC,EAAE,OAAOD,IAAI;EACzC,OAAO,IAAAG,sBAAQ,EAAC;IAAEC,IAAI,EAAEH,QAAQ;IAAED;EAAK,CAAC,CAAC;AAC3C;AAEO,eAAeK,eAAeA,CACnCC,WAAmB,EACnBL,QAAgB,EAChBM,OAAgB,EACc;EAC9B,OAAO;IACL,IAAI,MAAM,IAAAC,gCAAiB,EACzBC,oBAAU,CAACC,eAAe,EAC1BH,OAAO,EACPA,OAAO,GAAGI,wBAAc,CAACC,cAAc,GAAGD,wBAAc,CAACE,cAAc,EACvE,EAAE,CACH,CAAC;IACFP,WAAW,EAAEP,sBAAsB,CAACO,WAAW,EAAEL,QAAQ;EAC3D,CAAC;AACH"}
@@ -4,25 +4,15 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.default = void 0;
7
-
8
7
  var _CommonStyles = require("../../../styles/executionTasks/CommonStyles");
9
-
10
8
  var _ProgressDialog = _interopRequireDefault(require("../../widgets/ProgressDialog"));
11
-
12
9
  var _reactNative = require("react-native");
13
-
14
10
  var _react = _interopRequireWildcard(require("react"));
15
-
16
11
  var _strings = require("../../../res/strings");
17
-
18
12
  var _HttpEtUtils = require("./HttpEtUtils");
19
-
20
13
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
21
-
22
14
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
23
-
24
15
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
25
-
26
16
  const HttpRequestET = props => {
27
17
  const [inProgress, setInProgress] = (0, _react.useState)(true);
28
18
  (0, _react.useEffect)(() => {
@@ -34,7 +24,6 @@ const HttpRequestET = props => {
34
24
  props.onSubmitET(await (0, _HttpEtUtils.getHttpETOutput)(apiResponse.data, props.api.responseJsonPath, true));
35
25
  } catch (error) {
36
26
  setInProgress(false);
37
-
38
27
  if (error.response) {
39
28
  /**
40
29
  * The request was made and the server responded
@@ -55,7 +44,6 @@ const HttpRequestET = props => {
55
44
  label: props.message ?? _strings.PLEASE_WAIT
56
45
  }));
57
46
  };
58
-
59
47
  var _default = HttpRequestET;
60
48
  exports.default = _default;
61
49
  //# sourceMappingURL=HttpRequestET.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["HttpRequestET","props","inProgress","setInProgress","useState","useEffect","apiResponse","getApiResponse","api","onSubmitET","getHttpETOutput","data","responseJsonPath","error","response","errorJsonPath","CommonStyles","mainContainer","message","PLEASE_WAIT"],"sources":["HttpRequestET.tsx"],"sourcesContent":["import type { HttpRequestETInput } from './HttpRequestETSchema';\nimport { CommonStyles } from '../../../styles/executionTasks/CommonStyles';\nimport ProgressDialog from '../../widgets/ProgressDialog';\nimport { View } from 'react-native';\nimport React, { useEffect, useState } from 'react';\nimport { PLEASE_WAIT } from '../../../res/strings';\nimport { getApiResponse, getHttpETOutput } from './HttpEtUtils';\n\nconst HttpRequestET = (props: HttpRequestETInput) => {\n const [inProgress, setInProgress] = useState(true);\n\n useEffect(() => {\n (async () => {\n if (inProgress) {\n try {\n const apiResponse = await getApiResponse(props.api);\n setInProgress(false);\n props.onSubmitET(\n await getHttpETOutput(\n apiResponse.data,\n props.api.responseJsonPath,\n true\n )\n );\n } catch (error: any) {\n setInProgress(false);\n if (error.response) {\n /**\n * The request was made and the server responded\n * with a status code that falls out of the range of 2xx\n */\n props.onSubmitET(\n await getHttpETOutput(\n error.response.data,\n props.api.errorJsonPath,\n false\n )\n );\n } else {\n props.onSubmitET(await getHttpETOutput(error, '', false));\n }\n }\n }\n })();\n }, [inProgress, props]);\n return (\n <View style={CommonStyles.mainContainer}>\n <ProgressDialog\n visible={inProgress}\n label={props.message ?? PLEASE_WAIT}\n />\n </View>\n );\n};\nexport default HttpRequestET;\n"],"mappings":";;;;;;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;;;AAEA,MAAMA,aAAa,GAAIC,KAAD,IAA+B;EACnD,MAAM,CAACC,UAAD,EAAaC,aAAb,IAA8B,IAAAC,eAAA,EAAS,IAAT,CAApC;EAEA,IAAAC,gBAAA,EAAU,MAAM;IACd,CAAC,YAAY;MACX,IAAIH,UAAJ,EAAgB;QACd,IAAI;UACF,MAAMI,WAAW,GAAG,MAAM,IAAAC,2BAAA,EAAeN,KAAK,CAACO,GAArB,CAA1B;UACAL,aAAa,CAAC,KAAD,CAAb;UACAF,KAAK,CAACQ,UAAN,CACE,MAAM,IAAAC,4BAAA,EACJJ,WAAW,CAACK,IADR,EAEJV,KAAK,CAACO,GAAN,CAAUI,gBAFN,EAGJ,IAHI,CADR;QAOD,CAVD,CAUE,OAAOC,KAAP,EAAmB;UACnBV,aAAa,CAAC,KAAD,CAAb;;UACA,IAAIU,KAAK,CAACC,QAAV,EAAoB;YAClB;AACZ;AACA;AACA;YACYb,KAAK,CAACQ,UAAN,CACE,MAAM,IAAAC,4BAAA,EACJG,KAAK,CAACC,QAAN,CAAeH,IADX,EAEJV,KAAK,CAACO,GAAN,CAAUO,aAFN,EAGJ,KAHI,CADR;UAOD,CAZD,MAYO;YACLd,KAAK,CAACQ,UAAN,CAAiB,MAAM,IAAAC,4BAAA,EAAgBG,KAAhB,EAAuB,EAAvB,EAA2B,KAA3B,CAAvB;UACD;QACF;MACF;IACF,CA/BD;EAgCD,CAjCD,EAiCG,CAACX,UAAD,EAAaD,KAAb,CAjCH;EAkCA,oBACE,6BAAC,iBAAD;IAAM,KAAK,EAAEe,0BAAA,CAAaC;EAA1B,gBACE,6BAAC,uBAAD;IACE,OAAO,EAAEf,UADX;IAEE,KAAK,EAAED,KAAK,CAACiB,OAAN,IAAiBC;EAF1B,EADF,CADF;AAQD,CA7CD;;eA8CenB,a"}
1
+ {"version":3,"names":["_CommonStyles","require","_ProgressDialog","_interopRequireDefault","_reactNative","_react","_interopRequireWildcard","_strings","_HttpEtUtils","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","default","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","HttpRequestET","props","inProgress","setInProgress","useState","useEffect","apiResponse","getApiResponse","api","onSubmitET","getHttpETOutput","data","responseJsonPath","error","response","errorJsonPath","createElement","View","style","CommonStyles","mainContainer","visible","label","message","PLEASE_WAIT","_default","exports"],"sources":["HttpRequestET.tsx"],"sourcesContent":["import type { HttpRequestETInput } from './HttpRequestETSchema';\nimport { CommonStyles } from '../../../styles/executionTasks/CommonStyles';\nimport ProgressDialog from '../../widgets/ProgressDialog';\nimport { View } from 'react-native';\nimport React, { useEffect, useState } from 'react';\nimport { PLEASE_WAIT } from '../../../res/strings';\nimport { getApiResponse, getHttpETOutput } from './HttpEtUtils';\n\nconst HttpRequestET = (props: HttpRequestETInput) => {\n const [inProgress, setInProgress] = useState(true);\n\n useEffect(() => {\n (async () => {\n if (inProgress) {\n try {\n const apiResponse = await getApiResponse(props.api);\n setInProgress(false);\n props.onSubmitET(\n await getHttpETOutput(\n apiResponse.data,\n props.api.responseJsonPath,\n true\n )\n );\n } catch (error: any) {\n setInProgress(false);\n if (error.response) {\n /**\n * The request was made and the server responded\n * with a status code that falls out of the range of 2xx\n */\n props.onSubmitET(\n await getHttpETOutput(\n error.response.data,\n props.api.errorJsonPath,\n false\n )\n );\n } else {\n props.onSubmitET(await getHttpETOutput(error, '', false));\n }\n }\n }\n })();\n }, [inProgress, props]);\n return (\n <View style={CommonStyles.mainContainer}>\n <ProgressDialog\n visible={inProgress}\n label={props.message ?? PLEASE_WAIT}\n />\n </View>\n );\n};\nexport default HttpRequestET;\n"],"mappings":";;;;;;AACA,IAAAA,aAAA,GAAAC,OAAA;AACA,IAAAC,eAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,YAAA,GAAAH,OAAA;AACA,IAAAI,MAAA,GAAAC,uBAAA,CAAAL,OAAA;AACA,IAAAM,QAAA,GAAAN,OAAA;AACA,IAAAO,YAAA,GAAAP,OAAA;AAAgE,SAAAQ,yBAAAC,WAAA,eAAAC,OAAA,kCAAAC,iBAAA,OAAAD,OAAA,QAAAE,gBAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,WAAA,WAAAA,WAAA,GAAAG,gBAAA,GAAAD,iBAAA,KAAAF,WAAA;AAAA,SAAAJ,wBAAAQ,GAAA,EAAAJ,WAAA,SAAAA,WAAA,IAAAI,GAAA,IAAAA,GAAA,CAAAC,UAAA,WAAAD,GAAA,QAAAA,GAAA,oBAAAA,GAAA,wBAAAA,GAAA,4BAAAE,OAAA,EAAAF,GAAA,UAAAG,KAAA,GAAAR,wBAAA,CAAAC,WAAA,OAAAO,KAAA,IAAAA,KAAA,CAAAC,GAAA,CAAAJ,GAAA,YAAAG,KAAA,CAAAE,GAAA,CAAAL,GAAA,SAAAM,MAAA,WAAAC,qBAAA,GAAAC,MAAA,CAAAC,cAAA,IAAAD,MAAA,CAAAE,wBAAA,WAAAC,GAAA,IAAAX,GAAA,QAAAW,GAAA,kBAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAd,GAAA,EAAAW,GAAA,SAAAI,IA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M;YACLd,KAAK,CAACQ,UAAU,CAAC,MAAM,IAAAC,4BAAe,EAACG,KAAK,EAAE,EAAE,EAAE,KAAK,CAAC,CAAC;UAC3D;QACF;MACF;IACF,CAAC,GAAG;EACN,CAAC,EAAE,CAACX,UAAU,EAAED,KAAK,CAAC,CAAC;EACvB,oBACE3B,MAAA,CAAAW,OAAA,CAAA+B,aAAA,CAAC3C,YAAA,CAAA4C,IAAI;IAACC,KAAK,EAAEC,0BAAY,CAACC;EAAc,gBACtC9C,MAAA,CAAAW,OAAA,CAAA+B,aAAA,CAAC7C,eAAA,CAAAc,OAAc;IACboC,OAAO,EAAEnB,UAAW;IACpBoB,KAAK,EAAErB,KAAK,CAACsB,OAAO,IAAIC;EAAY,EACpC,CACG;AAEX,CAAC;AAAC,IAAAC,QAAA,GACazB,aAAa;AAAA0B,OAAA,CAAAzC,OAAA,GAAAwC,QAAA"}
@@ -1 +1 @@
1
- {"version":3,"names":[],"sources":["CaptureSchema.ts"],"sourcesContent":["/**\n * Length (in cm)\n */\nimport type {\n BaseETRequest,\n BaseETResponse,\n} from '../../../models/execTasks/ETBaseModels';\n\nexport interface CapturedImage {\n /**\n * Url of image\n */\n url: string;\n file?: { folder: string; name: string };\n\n /**\n * Epoch timestamp for the image capture\n */\n timestamp: number;\n}\n\nexport type CaptureOutput = BaseETResponse & {\n /**\n * Array of captured images\n */\n captures?: CapturedImage[];\n};\n\nexport type ImageData = {\n id: string;\n path: string;\n url: string;\n timestamp: number;\n};\n\n/**\n * Length (in cm)\n */\nexport type Length = number;\n/**\n * Breadth (in cm)\n */\nexport type Breadth = number;\n/**\n * Maximum Size limit (in kb) of image to be captured\n */\nexport type MaxFileSize = number;\n/**\n * Mode of capturing image\n */\nexport type CaptureMode = 'SINGLE' | 'MULTI';\n/**\n * Max limit of images to be captured in multi-capture mode\n */\nexport type MaxImageCount = number;\n/**\n * Title of instruction\n */\nexport type Title = string;\n/**\n * Message of instruction\n */\nexport type Message = string;\n/**\n * Can go back\n */\nexport type CanGoBack = boolean;\n\nexport type CaptureInput = BaseETRequest & {\n resolution: Resolution;\n fileSizeLimit: MaxFileSize;\n captureMode: CaptureMode;\n captureCountLimit?: MaxImageCount;\n onSubmitET: (etOutput: CaptureOutput) => void;\n} & {\n jobIds: string[];\n objRefs: string[];\n};\n/**\n * Resolution of image to be captured\n */\nexport interface Resolution {\n length: Length;\n breadth: Breadth;\n}\n"],"mappings":""}
1
+ {"version":3,"names":[],"sources":["CaptureSchema.ts"],"sourcesContent":["/**\n * Length (in cm)\n */\nimport type {\n BaseETRequest,\n BaseETResponse,\n} from '../../../models/execTasks/ETBaseModels';\n\nexport interface CapturedImage {\n /**\n * Url of image\n */\n url: string;\n file?: { folder: string; name: string };\n\n /**\n * Epoch timestamp for the image capture\n */\n timestamp: number;\n}\n\nexport type CaptureOutput = BaseETResponse & {\n /**\n * Array of captured images\n */\n captures?: CapturedImage[];\n};\n\nexport type ImageData = {\n id: string;\n path: string;\n url: string;\n timestamp: number;\n};\n\n/**\n * Length (in cm)\n */\nexport type Length = number;\n/**\n * Breadth (in cm)\n */\nexport type Breadth = number;\n/**\n * Maximum Size limit (in kb) of image to be captured\n */\nexport type MaxFileSize = number;\n/**\n * Mode of capturing image\n */\nexport type CaptureMode = 'SINGLE' | 'MULTI';\n/**\n * Max limit of images to be captured in multi-capture mode\n */\nexport type MaxImageCount = number;\n/**\n * Title of instruction\n */\nexport type Title = string;\n/**\n * Message of instruction\n */\nexport type Message = string;\n/**\n * Can go back\n */\nexport type CanGoBack = boolean;\n\nexport type MultiAdditionalConfig = '1' | 'N';\n\nexport interface AdditionalMultiConfig {\n minCaptureCount: MultiAdditionalConfig;\n}\n\nexport type CaptureInput = BaseETRequest & {\n resolution: Resolution;\n fileSizeLimit: MaxFileSize;\n captureMode: CaptureMode;\n captureCountLimit?: MaxImageCount;\n additionalMultiConfig?: AdditionalMultiConfig;\n onSubmitET: (etOutput: CaptureOutput) => void;\n} & {\n jobIds: string[];\n objRefs: string[];\n};\n/**\n * Resolution of image to be captured\n */\nexport interface Resolution {\n length: Length;\n breadth: Breadth;\n}\n"],"mappings":""}
@@ -10,39 +10,22 @@ exports.getCaptureOutput = getCaptureOutput;
10
10
  exports.getCompressionRatio = getCompressionRatio;
11
11
  exports.getImagesFileName = getImagesFileName;
12
12
  exports.getMaxImagesCount = getMaxImagesCount;
13
-
14
13
  var _reactNative = require("react-native");
15
-
16
14
  var FileSystem = _interopRequireWildcard(require("expo-file-system"));
17
-
18
15
  var ImagePicker = _interopRequireWildcard(require("expo-image-picker"));
19
-
20
16
  var _Toaster = require("../../widgets/Toaster");
21
-
22
17
  var ImageManipulator = _interopRequireWildcard(require("expo-image-manipulator"));
23
-
24
18
  var _Logger = _interopRequireWildcard(require("../../../utils/Logger"));
25
-
26
19
  var _ExecTaskUtils = require("../../../utils/ExecTaskUtils");
27
-
28
20
  var _EventCodeContainer = require("../../../manager/dispatchCodes/EventCodeContainer");
29
-
30
21
  var _ETConfig = require("../../../models/execTasks/ETConfig");
31
-
32
22
  var _BaseError = require("../../../errors/BaseError");
33
-
34
23
  var _ErrorCodes = _interopRequireDefault(require("../../../errors/ErrorCodes"));
35
-
36
24
  var _DispatchSdkCache = _interopRequireDefault(require("../../../manager/sdk/DispatchSdkCache"));
37
-
38
25
  var _SyncManagerUtils = require("../../../utils/SyncManagerUtils");
39
-
40
26
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
41
-
42
27
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
43
-
44
28
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
45
-
46
29
  async function deleteImage(imageData, images) {
47
30
  await FileSystem.deleteAsync(imageData.path);
48
31
  let filtered = images.filter(img => {
@@ -50,38 +33,30 @@ async function deleteImage(imageData, images) {
50
33
  });
51
34
  return filtered;
52
35
  }
53
-
54
36
  function getMaxImagesCount(props) {
55
37
  if (props && props.captureCountLimit) return props.captureCountLimit;else return 1;
56
38
  }
57
-
58
39
  function getImagesFileName() {
59
40
  return `IMG_${Date.now().toString()}.jpg`;
60
41
  }
61
-
62
42
  async function getCompressionRatio(uri, maxSize) {
63
43
  try {
64
44
  let fileInfo = await FileSystem.getInfoAsync(uri, {
65
45
  size: true
66
46
  });
67
47
  maxSize = Math.min(maxSize, 1024);
68
-
69
48
  if (fileInfo.exists) {
70
49
  let fileSize = fileInfo.size / 1024;
71
-
72
50
  if (fileSize > maxSize) {
73
51
  return maxSize / fileSize;
74
52
  } else return 1;
75
53
  }
76
-
77
54
  return 1;
78
55
  } catch (error) {
79
56
  _Logger.default.getInstance().logEvent('getCompressionRatio', error.message, _Logger.LOG_TYPE.SDK_ERROR);
80
-
81
57
  return 1;
82
58
  }
83
59
  }
84
-
85
60
  async function checkCameraPermissionUtil() {
86
61
  let response = await ImagePicker.getCameraPermissionsAsync();
87
62
  if (response.granted) return true;else {
@@ -89,19 +64,15 @@ async function checkCameraPermissionUtil() {
89
64
  return resp.status === ImagePicker.PermissionStatus.GRANTED;
90
65
  }
91
66
  }
92
-
93
67
  async function captureImage(imageWidth, imageHeight, fileSize) {
94
68
  try {
95
69
  if (!(await checkCameraPermissionUtil())) {
96
70
  _reactNative.Alert.alert('Permissions Error', 'Camera permissions not provided!');
97
-
98
71
  return null;
99
72
  }
100
-
101
73
  let response = await ImagePicker.launchCameraAsync({
102
74
  quality: 1
103
75
  });
104
-
105
76
  if (!response.cancelled) {
106
77
  let actionResize = {
107
78
  resize: {
@@ -123,24 +94,26 @@ async function captureImage(imageWidth, imageHeight, fileSize) {
123
94
  }
124
95
  } catch (exception) {
125
96
  (0, _Toaster.showToast)(`Error ${exception.message}`);
97
+ console.error('capture image error: ', exception);
126
98
  return null;
127
99
  }
128
100
  }
129
-
130
101
  async function getCaptureOutput(imageDataList, captureProps) {
131
- if (!imageDataList || imageDataList.length === 0) return { ...(await (0, _ExecTaskUtils.getBaseETResponse)(_ETConfig.EntityCode.IMAGE_CAPTURE, false, (0, _EventCodeContainer.getEventCodeByET)(_ETConfig.ExecutionTaskID.IMAGE_CAPTURE, false), ''))
102
+ var _captureProps$applica;
103
+ if (!imageDataList || imageDataList.length === 0) return {
104
+ ...(await (0, _ExecTaskUtils.getBaseETResponse)(_ETConfig.EntityCode.IMAGE_CAPTURE, false, (0, _EventCodeContainer.getEventCodeByET)(_ETConfig.ExecutionTaskID.IMAGE_CAPTURE, false, (_captureProps$applica = captureProps.applicableReasons) === null || _captureProps$applica === void 0 ? void 0 : _captureProps$applica.failure), ''))
132
105
  };else {
133
- return { ...(await (0, _ExecTaskUtils.getBaseETResponse)(_ETConfig.EntityCode.IMAGE_CAPTURE, true, (0, _EventCodeContainer.getEventCodeByET)(_ETConfig.ExecutionTaskID.IMAGE_CAPTURE, true), '')),
106
+ var _captureProps$applica2;
107
+ return {
108
+ ...(await (0, _ExecTaskUtils.getBaseETResponse)(_ETConfig.EntityCode.IMAGE_CAPTURE, true, (0, _EventCodeContainer.getEventCodeByET)(_ETConfig.ExecutionTaskID.IMAGE_CAPTURE, true, (_captureProps$applica2 = captureProps.applicableReasons) === null || _captureProps$applica2 === void 0 ? void 0 : _captureProps$applica2.success), '')),
134
109
  captures: await getImagesData(imageDataList, captureProps)
135
110
  };
136
111
  }
137
112
  }
138
-
139
113
  async function getImagesData(imagesDataList, captureProps) {
140
114
  if (imagesDataList && imagesDataList.length > 0) {
141
115
  let output = [];
142
116
  const folderName = (await _DispatchSdkCache.default.getInstance().getKeyFromCache(_DispatchSdkCache.default.KEYS.FMS_FOLDER)) ?? 'NULL';
143
-
144
117
  for (const data of imagesDataList) {
145
118
  let insertID = await (0, _SyncManagerUtils.insertDocumentInDB)(data.id, folderName, JSON.stringify(captureProps.jobIds), JSON.stringify(captureProps.objRefs), null, captureProps.title, data.path);
146
119
  if (insertID) output.push({
@@ -152,7 +125,6 @@ async function getImagesData(imagesDataList, captureProps) {
152
125
  }
153
126
  });else throw new _BaseError.BaseError(_ErrorCodes.default.SQLiteDBIssue, 'Unable to save Image');
154
127
  }
155
-
156
128
  return output;
157
129
  } else return [];
158
130
  }
@@ -1 +1 @@
1
- {"version":3,"names":["deleteImage","imageData","images","FileSystem","deleteAsync","path","filtered","filter","img","id","getMaxImagesCount","props","captureCountLimit","getImagesFileName","Date","now","toString","getCompressionRatio","uri","maxSize","fileInfo","getInfoAsync","size","Math","min","exists","fileSize","error","Logger","getInstance","logEvent","message","LOG_TYPE","SDK_ERROR","checkCameraPermissionUtil","response","ImagePicker","getCameraPermissionsAsync","granted","resp","requestCameraPermissionsAsync","status","PermissionStatus","GRANTED","captureImage","imageWidth","imageHeight","Alert","alert","launchCameraAsync","quality","cancelled","actionResize","resize","width","height","compressionRatio","resizedImage","ImageManipulator","manipulateAsync","compress","then","SDK_DEBUG","catch","showToast","exception","getCaptureOutput","imageDataList","captureProps","length","getBaseETResponse","EntityCode","IMAGE_CAPTURE","getEventCodeByET","ExecutionTaskID","captures","getImagesData","imagesDataList","output","folderName","DispatchSdkCache","getKeyFromCache","KEYS","FMS_FOLDER","data","insertID","insertDocumentInDB","JSON","stringify","jobIds","objRefs","title","push","url","timestamp","file","folder","name","BaseError","BaseErrorCodes","SQLiteDBIssue"],"sources":["CaptureUtils.ts"],"sourcesContent":["import type {\n CapturedImage,\n CaptureInput,\n CaptureOutput,\n ImageData,\n} from './CaptureSchema';\nimport { Alert } from 'react-native';\nimport * as FileSystem from 'expo-file-system';\nimport * as ImagePicker from 'expo-image-picker';\nimport { PermissionStatus } from 'expo-image-picker';\nimport { showToast } from '../../widgets/Toaster';\nimport type { ActionResize, ImageResult } from 'expo-image-manipulator';\nimport * as ImageManipulator from 'expo-image-manipulator';\nimport Logger, { LOG_TYPE } from '../../../utils/Logger';\nimport { getBaseETResponse } from '../../../utils/ExecTaskUtils';\nimport { getEventCodeByET } from '../../../manager/dispatchCodes/EventCodeContainer';\nimport {\n EntityCode,\n ExecutionTaskID,\n} from '../../../models/execTasks/ETConfig';\nimport { BaseError } from '../../../errors/BaseError';\nimport BaseErrorCodes from '../../../errors/ErrorCodes';\nimport DispatchSdkCache from '../../../manager/sdk/DispatchSdkCache';\nimport { insertDocumentInDB } from '../../../utils/SyncManagerUtils';\n\nexport async function deleteImage(\n imageData: ImageData,\n images: ImageData[]\n): Promise<ImageData[]> {\n await FileSystem.deleteAsync(imageData.path);\n let filtered = images.filter((img) => {\n return img.id !== imageData.id;\n });\n return filtered;\n}\n\nexport function getMaxImagesCount(props: CaptureInput) {\n if (props && props.captureCountLimit) return props.captureCountLimit;\n else return 1;\n}\n\nexport function getImagesFileName() {\n return `IMG_${Date.now().toString()}.jpg`;\n}\n\nexport async function getCompressionRatio(\n uri: string,\n maxSize: number\n): Promise<number> {\n try {\n let fileInfo = await FileSystem.getInfoAsync(uri, {\n size: true,\n });\n maxSize = Math.min(maxSize, 1024);\n if (fileInfo.exists) {\n let fileSize = fileInfo.size / 1024;\n if (fileSize > maxSize) {\n return maxSize / fileSize;\n } else return 1;\n }\n return 1;\n } catch (error: any) {\n Logger.getInstance().logEvent(\n 'getCompressionRatio',\n error.message,\n LOG_TYPE.SDK_ERROR\n );\n return 1;\n }\n}\n\nexport async function checkCameraPermissionUtil(): Promise<boolean> {\n let response = await ImagePicker.getCameraPermissionsAsync();\n if (response.granted) return true;\n else {\n let resp = await ImagePicker.requestCameraPermissionsAsync();\n return resp.status === PermissionStatus.GRANTED;\n }\n}\n\nexport async function captureImage(\n imageWidth: number,\n imageHeight: number,\n fileSize: number\n): Promise<ImageResult | null> {\n try {\n if (!(await checkCameraPermissionUtil())) {\n Alert.alert('Permissions Error', 'Camera permissions not provided!');\n return null;\n }\n let response = await ImagePicker.launchCameraAsync({\n quality: 1,\n });\n if (!response.cancelled) {\n let actionResize: ActionResize = {\n resize: {\n width: imageWidth,\n height: imageHeight,\n },\n };\n let compressionRatio = await getCompressionRatio(response.uri, fileSize);\n let resizedImage = await ImageManipulator.manipulateAsync(\n response.uri,\n [actionResize],\n {\n compress: compressionRatio,\n }\n );\n FileSystem.deleteAsync(response.uri)\n .then(() =>\n Logger.getInstance().logEvent(\n 'CAPTURE_ET',\n 'File deleted success',\n LOG_TYPE.SDK_DEBUG\n )\n )\n .catch((error) => {\n Logger.getInstance().logEvent(\n 'CAPTURE_ET',\n error.message,\n LOG_TYPE.SDK_ERROR\n );\n });\n return resizedImage;\n } else {\n showToast('User cancelled the action');\n return null;\n }\n } catch (exception: any) {\n showToast(`Error ${exception.message}`);\n return null;\n }\n}\n\nexport async function getCaptureOutput(\n imageDataList: ImageData[],\n captureProps: CaptureInput\n): Promise<CaptureOutput> {\n if (!imageDataList || imageDataList.length === 0)\n return {\n ...(await getBaseETResponse(\n EntityCode.IMAGE_CAPTURE,\n false,\n getEventCodeByET(ExecutionTaskID.IMAGE_CAPTURE, false),\n ''\n )),\n };\n else {\n return {\n ...(await getBaseETResponse(\n EntityCode.IMAGE_CAPTURE,\n true,\n getEventCodeByET(ExecutionTaskID.IMAGE_CAPTURE, true),\n ''\n )),\n captures: await getImagesData(imageDataList, captureProps),\n };\n }\n}\n\nasync function getImagesData(\n imagesDataList: ImageData[],\n captureProps: CaptureInput\n): Promise<CapturedImage[]> {\n if (imagesDataList && imagesDataList.length > 0) {\n let output: CapturedImage[] = [];\n const folderName =\n (await DispatchSdkCache.getInstance().getKeyFromCache(\n DispatchSdkCache.KEYS.FMS_FOLDER\n )) ?? 'NULL';\n for (const data of imagesDataList) {\n let insertID = await insertDocumentInDB(\n data.id,\n folderName,\n JSON.stringify(captureProps.jobIds),\n JSON.stringify(captureProps.objRefs),\n null,\n captureProps.title,\n data.path\n );\n if (insertID)\n output.push({\n url: '',\n timestamp: data.timestamp,\n file: { folder: folderName, name: data.id },\n });\n else\n throw new BaseError(\n BaseErrorCodes.SQLiteDBIssue,\n 'Unable to save Image'\n );\n }\n return output;\n } else return [];\n}\n"],"mappings":";;;;;;;;;;;;;AAMA;;AACA;;AACA;;AAEA;;AAEA;;AACA;;AACA;;AACA;;AACA;;AAIA;;AACA;;AACA;;AACA;;;;;;;;AAEO,eAAeA,WAAf,CACLC,SADK,EAELC,MAFK,EAGiB;EACtB,MAAMC,UAAU,CAACC,WAAX,CAAuBH,SAAS,CAACI,IAAjC,CAAN;EACA,IAAIC,QAAQ,GAAGJ,MAAM,CAACK,MAAP,CAAeC,GAAD,IAAS;IACpC,OAAOA,GAAG,CAACC,EAAJ,KAAWR,SAAS,CAACQ,EAA5B;EACD,CAFc,CAAf;EAGA,OAAOH,QAAP;AACD;;AAEM,SAASI,iBAAT,CAA2BC,KAA3B,EAAgD;EACrD,IAAIA,KAAK,IAAIA,KAAK,CAACC,iBAAnB,EAAsC,OAAOD,KAAK,CAACC,iBAAb,CAAtC,KACK,OAAO,CAAP;AACN;;AAEM,SAASC,iBAAT,GAA6B;EAClC,OAAQ,OAAMC,IAAI,CAACC,GAAL,GAAWC,QAAX,EAAsB,MAApC;AACD;;AAEM,eAAeC,mBAAf,CACLC,GADK,EAELC,OAFK,EAGY;EACjB,IAAI;IACF,IAAIC,QAAQ,GAAG,MAAMjB,UAAU,CAACkB,YAAX,CAAwBH,GAAxB,EAA6B;MAChDI,IAAI,EAAE;IAD0C,CAA7B,CAArB;IAGAH,OAAO,GAAGI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Q,CAAV,CADK;MAOLG,QAAQ,EAAE,MAAMC,aAAa,CAACT,aAAD,EAAgBC,YAAhB;IAPxB,CAAP;EASD;AACF;;AAED,eAAeQ,aAAf,CACEC,cADF,EAEET,YAFF,EAG4B;EAC1B,IAAIS,cAAc,IAAIA,cAAc,CAACR,MAAf,GAAwB,CAA9C,EAAiD;IAC/C,IAAIS,MAAuB,GAAG,EAA9B;IACA,MAAMC,UAAU,GACd,CAAC,MAAMC,yBAAA,CAAiBnD,WAAjB,GAA+BoD,eAA/B,CACLD,yBAAA,CAAiBE,IAAjB,CAAsBC,UADjB,CAAP,KAEM,MAHR;;IAIA,KAAK,MAAMC,IAAX,IAAmBP,cAAnB,EAAmC;MACjC,IAAIQ,QAAQ,GAAG,MAAM,IAAAC,oCAAA,EACnBF,IAAI,CAAC3E,EADc,EAEnBsE,UAFmB,EAGnBQ,IAAI,CAACC,SAAL,CAAepB,YAAY,CAACqB,MAA5B,CAHmB,EAInBF,IAAI,CAACC,SAAL,CAAepB,YAAY,CAACsB,OAA5B,CAJmB,EAKnB,IALmB,EAMnBtB,YAAY,CAACuB,KANM,EAOnBP,IAAI,CAAC/E,IAPc,CAArB;MASA,IAAIgF,QAAJ,EACEP,MAAM,CAACc,IAAP,CAAY;QACVC,GAAG,EAAE,EADK;QAEVC,SAAS,EAAEV,IAAI,CAACU,SAFN;QAGVC,IAAI,EAAE;UAAEC,MAAM,EAAEjB,UAAV;UAAsBkB,IAAI,EAAEb,IAAI,CAAC3E;QAAjC;MAHI,CAAZ,EADF,KAOE,MAAM,IAAIyF,oBAAJ,CACJC,mBAAA,CAAeC,aADX,EAEJ,sBAFI,CAAN;IAIH;;IACD,OAAOtB,MAAP;EACD,CA7BD,MA6BO,OAAO,EAAP;AACR"}
1
+ {"version":3,"names":["_reactNative","require","FileSystem","_interopRequireWildcard","ImagePicker","_Toaster","ImageManipulator","_Logger","_ExecTaskUtils","_EventCodeContainer","_ETConfig","_BaseError","_ErrorCodes","_interopRequireDefault","_DispatchSdkCache","_SyncManagerUtils","obj","__esModule","default","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","deleteImage","imageData","images","deleteAsync","path","filtered","filter","img","id","getMaxImagesCount","props","captureCountLimit","getImagesFileName","Date","now","toString","getCompressionRatio","uri","maxSize","fileInfo","getInfoAsync","size","Math","min","exists","fileSize","error","Logger","getInstance","logEvent","message","LOG_TYPE","SDK_ERROR","checkCameraPermissionUtil","response","getCameraPermissionsAsync","granted","resp","requestCameraPermissionsAsync","status","PermissionStatus","GRANTED","captureImage","imageWidth","imageHeight","Alert","alert","launchCameraAsync","quality","cancelled","actionResize","resize","width","height","compressionRatio","resizedImage","manipulateAsync","compress","then","SDK_DEBUG","catch","showToast","exception","console","getCaptureOutput","imageDataList","captureProps","_captureProps$applica","length","getBaseETResponse","EntityCode","IMAGE_CAPTURE","getEventCodeByET","ExecutionTaskID","applicableReasons","failure","_captureProps$applica2","success","captures","getImagesData","imagesDataList","output","folderName","DispatchSdkCache","getKeyFromCache","KEYS","FMS_FOLDER","data","insertID","insertDocumentInDB","JSON","stringify","jobIds","objRefs","title","push","url","timestamp","file","folder","name","BaseError","BaseErrorCodes","SQLiteDBIssue"],"sources":["CaptureUtils.ts"],"sourcesContent":["import type {\n CapturedImage,\n CaptureInput,\n CaptureOutput,\n ImageData,\n} from './CaptureSchema';\nimport { Alert } from 'react-native';\nimport * as FileSystem from 'expo-file-system';\nimport * as ImagePicker from 'expo-image-picker';\nimport { PermissionStatus } from 'expo-image-picker';\nimport { showToast } from '../../widgets/Toaster';\nimport type { ActionResize, ImageResult } from 'expo-image-manipulator';\nimport * as ImageManipulator from 'expo-image-manipulator';\nimport Logger, { LOG_TYPE } from '../../../utils/Logger';\nimport { getBaseETResponse } from '../../../utils/ExecTaskUtils';\nimport { getEventCodeByET } from '../../../manager/dispatchCodes/EventCodeContainer';\nimport {\n EntityCode,\n ExecutionTaskID,\n} from '../../../models/execTasks/ETConfig';\nimport { BaseError } from '../../../errors/BaseError';\nimport BaseErrorCodes from '../../../errors/ErrorCodes';\nimport DispatchSdkCache from '../../../manager/sdk/DispatchSdkCache';\nimport { insertDocumentInDB } from '../../../utils/SyncManagerUtils';\n\nexport async function deleteImage(\n imageData: ImageData,\n images: ImageData[]\n): Promise<ImageData[]> {\n await FileSystem.deleteAsync(imageData.path);\n let filtered = images.filter((img) => {\n return img.id !== imageData.id;\n });\n return filtered;\n}\n\nexport function getMaxImagesCount(props: CaptureInput) {\n if (props && props.captureCountLimit) return props.captureCountLimit;\n else return 1;\n}\n\nexport function getImagesFileName() {\n return `IMG_${Date.now().toString()}.jpg`;\n}\n\nexport async function getCompressionRatio(\n uri: string,\n maxSize: number\n): Promise<number> {\n try {\n let fileInfo = await FileSystem.getInfoAsync(uri, {\n size: true,\n });\n maxSize = Math.min(maxSize, 1024);\n if (fileInfo.exists) {\n let fileSize = fileInfo.size / 1024;\n if (fileSize > maxSize) {\n return maxSize / fileSize;\n } else return 1;\n }\n return 1;\n } catch (error: any) {\n Logger.getInstance().logEvent(\n 'getCompressionRatio',\n error.message,\n LOG_TYPE.SDK_ERROR\n );\n return 1;\n }\n}\n\nexport async function checkCameraPermissionUtil(): Promise<boolean> {\n let response = await ImagePicker.getCameraPermissionsAsync();\n if (response.granted) return true;\n else {\n let resp = await ImagePicker.requestCameraPermissionsAsync();\n return resp.status === PermissionStatus.GRANTED;\n }\n}\n\nexport async function captureImage(\n imageWidth: number,\n imageHeight: number,\n fileSize: number\n): Promise<ImageResult | null> {\n try {\n if (!(await checkCameraPermissionUtil())) {\n Alert.alert('Permissions Error', 'Camera permissions not provided!');\n return null;\n }\n let response = await ImagePicker.launchCameraAsync({\n quality: 1,\n });\n if (!response.cancelled) {\n let actionResize: ActionResize = {\n resize: {\n width: imageWidth,\n height: imageHeight,\n },\n };\n let compressionRatio = await getCompressionRatio(response.uri, fileSize);\n let resizedImage = await ImageManipulator.manipulateAsync(\n response.uri,\n [actionResize],\n {\n compress: compressionRatio,\n }\n );\n FileSystem.deleteAsync(response.uri)\n .then(() =>\n Logger.getInstance().logEvent(\n 'CAPTURE_ET',\n 'File deleted success',\n LOG_TYPE.SDK_DEBUG\n )\n )\n .catch((error) => {\n Logger.getInstance().logEvent(\n 'CAPTURE_ET',\n error.message,\n LOG_TYPE.SDK_ERROR\n );\n });\n return resizedImage;\n } else {\n showToast('User cancelled the action');\n return null;\n }\n } catch (exception: any) {\n showToast(`Error ${exception.message}`);\n console.error('capture image error: ', exception);\n\n return null;\n }\n}\n\nexport async function getCaptureOutput(\n imageDataList: ImageData[],\n captureProps: CaptureInput\n): Promise<CaptureOutput> {\n if (!imageDataList || imageDataList.length === 0)\n return {\n ...(await getBaseETResponse(\n EntityCode.IMAGE_CAPTURE,\n false,\n getEventCodeByET(\n ExecutionTaskID.IMAGE_CAPTURE,\n false,\n captureProps.applicableReasons?.failure\n ),\n ''\n )),\n };\n else {\n return {\n ...(await getBaseETResponse(\n EntityCode.IMAGE_CAPTURE,\n true,\n getEventCodeByET(\n ExecutionTaskID.IMAGE_CAPTURE,\n true,\n captureProps.applicableReasons?.success\n ),\n ''\n )),\n captures: await getImagesData(imageDataList, captureProps),\n };\n }\n}\n\nasync function getImagesData(\n imagesDataList: ImageData[],\n captureProps: CaptureInput\n): Promise<CapturedImage[]> {\n if (imagesDataList && imagesDataList.length > 0) {\n let output: CapturedImage[] = [];\n const folderName =\n (await DispatchSdkCache.getInstance().getKeyFromCache(\n DispatchSdkCache.KEYS.FMS_FOLDER\n )) ?? 'NULL';\n for (const data of imagesDataList) {\n let insertID = await insertDocumentInDB(\n data.id,\n folderName,\n JSON.stringify(captureProps.jobIds),\n JSON.stringify(captureProps.objRefs),\n null,\n captureProps.title,\n data.path\n );\n if (insertID)\n output.push({\n url: '',\n timestamp: data.timestamp,\n file: { folder: folderName, name: data.id },\n });\n else\n throw new BaseError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S;QACzBC,IAAI,EAAE;UAAEC,MAAM,EAAEjB,UAAU;UAAEkB,IAAI,EAAEb,IAAI,CAAC/E;QAAG;MAC5C,CAAC,CAAC,CAAC,KAEH,MAAM,IAAI6F,oBAAS,CACjBC,mBAAc,CAACC,aAAa,EAC5B,sBAAsB,CACvB;IACL;IACA,OAAOtB,MAAM;EACf,CAAC,MAAM,OAAO,EAAE;AAClB"}
@@ -4,35 +4,22 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.default = void 0;
7
-
8
7
  var _react = _interopRequireWildcard(require("react"));
9
-
10
8
  var _reactNative = require("react-native");
11
-
12
9
  var CaptureUtils = _interopRequireWildcard(require("./CaptureUtils"));
13
-
14
- var _reactNativePaper = require("react-native-paper");
15
-
16
10
  var _Toaster = require("../../widgets/Toaster");
17
-
18
11
  var _SdkColors = _interopRequireWildcard(require("../../../styles/SdkColors"));
19
-
20
12
  var _MaterialIcons = _interopRequireDefault(require("react-native-vector-icons/MaterialIcons"));
21
-
22
13
  var _CommonStyles = require("../../../styles/executionTasks/CommonStyles");
23
-
24
14
  var _ExecTaskUtils = require("../../../utils/ExecTaskUtils");
25
-
26
15
  var _ETConfig = require("../../../models/execTasks/ETConfig");
27
-
28
16
  var _EventCodeContainer = require("../../../manager/dispatchCodes/EventCodeContainer");
29
-
17
+ var _constants = require("../../../constants/constants");
18
+ var _reactNativePaper = require("react-native-paper");
19
+ var _Logger = _interopRequireWildcard(require("../../../utils/Logger"));
30
20
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
31
-
32
21
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
33
-
34
22
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
35
-
36
23
  const ImageItem = _ref => {
37
24
  let {
38
25
  item,
@@ -59,36 +46,79 @@ const ImageItem = _ref => {
59
46
  }
60
47
  }));
61
48
  };
62
-
63
49
  const ImageCapture = props => {
64
50
  const [images, setImages] = (0, _react.useState)([]);
65
51
  const [showCapture, setShowCapture] = (0, _react.useState)(true);
66
52
  const [disableProceed, setDisableProceed] = (0, _react.useState)(false);
67
-
53
+ const [showBackModal, setShowBackModal] = (0, _react.useState)(false);
54
+ (0, _react.useLayoutEffect)(() => {
55
+ props.navigation.setOptions({
56
+ title: props.title,
57
+ headerLeft: () => {
58
+ var _props$taskMeta;
59
+ return (_props$taskMeta = props.taskMeta) !== null && _props$taskMeta !== void 0 && _props$taskMeta.enableGoBack ? /*#__PURE__*/_react.default.createElement(_MaterialIcons.default, {
60
+ onPress: async () => {
61
+ setShowBackModal(true);
62
+ },
63
+ name: "arrow-back",
64
+ color: 'black',
65
+ size: 25,
66
+ style: {
67
+ paddingRight: 15,
68
+ paddingTop: 5
69
+ }
70
+ }) : null;
71
+ }
72
+ });
73
+ }, [props.navigation, props.title]);
74
+ const renderModal = () => {
75
+ return /*#__PURE__*/_react.default.createElement(_reactNativePaper.Portal, null, /*#__PURE__*/_react.default.createElement(_reactNativePaper.Modal, {
76
+ visible: showBackModal,
77
+ dismissable: true,
78
+ contentContainerStyle: _CommonStyles.CommonStyles.modalContent
79
+ }, /*#__PURE__*/_react.default.createElement(_reactNative.View, {
80
+ style: _CommonStyles.CommonStyles.modalView
81
+ }, /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
82
+ style: _CommonStyles.CommonStyles.subText
83
+ }, 'Are you sure you want to go back?'), /*#__PURE__*/_react.default.createElement(_reactNativePaper.Button, {
84
+ labelStyle: _CommonStyles.CommonStyles.nextButtonLabel,
85
+ style: {
86
+ ..._CommonStyles.CommonStyles.nextButton,
87
+ marginTop: 10
88
+ },
89
+ uppercase: false,
90
+ onPress: async () => {
91
+ props.onSubmitET({
92
+ ...(await (0, _ExecTaskUtils.getBaseETResponse)(_ETConfig.EntityCode.IMAGE_CAPTURE, false, _constants.GO_BACK_EVENT_CODE, ''))
93
+ });
94
+ setShowBackModal(false);
95
+ }
96
+ }, "Yes"), /*#__PURE__*/_react.default.createElement(_reactNativePaper.Button, {
97
+ labelStyle: _CommonStyles.CommonStyles.cancelButtonLabel,
98
+ style: {
99
+ ..._CommonStyles.CommonStyles.cancelButton,
100
+ marginTop: 10
101
+ },
102
+ uppercase: false,
103
+ onPress: () => setShowBackModal(false)
104
+ }, "No"))));
105
+ };
68
106
  const handleSubmit = async () => {
69
107
  try {
70
108
  setDisableProceed(true);
71
-
72
- if (props.captureMode === 'SINGLE') {
73
- if (images.length > 0) {
74
- props.onSubmitET(await (0, CaptureUtils.getCaptureOutput)(images, props));
75
- } else {
76
- (0, _Toaster.showToast)('No Images captured');
109
+ if (images.length > 0) {
110
+ var _props$additionalMult;
111
+ if (((_props$additionalMult = props.additionalMultiConfig) === null || _props$additionalMult === void 0 ? void 0 : _props$additionalMult.minCaptureCount) === 'N' && images.length < props.jobIds.length) {
112
+ (0, _Toaster.showToast)(`Min ${props.jobIds.length} image(s) required to be captured.`);
113
+ return;
77
114
  }
78
- } else {
79
- if (props.captureCountLimit && props.captureCountLimit > 0) {
80
- if (images.length === CaptureUtils.getMaxImagesCount(props)) {
81
- props.onSubmitET(await (0, CaptureUtils.getCaptureOutput)(images, props));
82
- } else {
83
- (0, _Toaster.showToast)(`${props.captureCountLimit - images.length} Images left`);
84
- }
85
- } else {
86
- if (images.length > 0) {
87
- props.onSubmitET(await (0, CaptureUtils.getCaptureOutput)(images, props));
88
- } else {
89
- (0, _Toaster.showToast)('No Images captured');
90
- }
115
+ if (props.captureMode === 'MULTI' && props.captureCountLimit && props.captureCountLimit > 0 && images.length > CaptureUtils.getMaxImagesCount(props)) {
116
+ (0, _Toaster.showToast)(`Max ${props.captureCountLimit} image(s) allowed.`);
117
+ return;
91
118
  }
119
+ props.onSubmitET(await (0, CaptureUtils.getCaptureOutput)(images, props));
120
+ } else {
121
+ (0, _Toaster.showToast)('No Images captured');
92
122
  }
93
123
  } catch (error) {
94
124
  setDisableProceed(false);
@@ -97,7 +127,6 @@ const ImageCapture = props => {
97
127
  setDisableProceed(false);
98
128
  }
99
129
  };
100
-
101
130
  (0, _react.useEffect)(() => {
102
131
  if (props.captureMode === 'SINGLE') {
103
132
  if (images.length > 0) {
@@ -118,9 +147,7 @@ const ImageCapture = props => {
118
147
  (0, _Toaster.showToast)(`Max Image Limit reached`);
119
148
  return;
120
149
  }
121
-
122
150
  let imageDataResponse = await CaptureUtils.captureImage(props.resolution.breadth, props.resolution.length, props.fileSizeLimit);
123
-
124
151
  if (imageDataResponse != null) {
125
152
  setImages(prevState => {
126
153
  return [...prevState, {
@@ -133,16 +160,15 @@ const ImageCapture = props => {
133
160
  });
134
161
  }
135
162
  }, [props, showCapture]);
136
-
137
163
  const deleteImage = async imageData => {
138
164
  try {
139
165
  let filteredImages = await CaptureUtils.deleteImage(imageData, images);
140
166
  setImages(filteredImages);
141
167
  } catch (err) {
142
- console.log(err);
168
+ _Logger.default.getInstance().logEvent('deleteImageError', err.message, _Logger.LOG_TYPE.SDK_ERROR);
169
+ return;
143
170
  }
144
171
  };
145
-
146
172
  const renderItem = _ref2 => {
147
173
  let {
148
174
  item
@@ -154,8 +180,7 @@ const ImageCapture = props => {
154
180
  }
155
181
  });
156
182
  };
157
-
158
- return /*#__PURE__*/_react.default.createElement(_reactNative.View, {
183
+ return /*#__PURE__*/_react.default.createElement(_reactNativePaper.Provider, null, renderModal(), /*#__PURE__*/_react.default.createElement(_reactNative.View, {
159
184
  style: _CommonStyles.CommonStyles.mainContainer
160
185
  }, props.message && /*#__PURE__*/_react.default.createElement(_reactNative.View, {
161
186
  style: styles.etMessageView
@@ -205,12 +230,13 @@ const ImageCapture = props => {
205
230
  mode: "outlined",
206
231
  labelStyle: _CommonStyles.CommonStyles.cancelButtonLabel,
207
232
  onPress: async () => {
208
- props.onSubmitET({ ...(await (0, _ExecTaskUtils.getBaseETResponse)(_ETConfig.EntityCode.IMAGE_CAPTURE, false, (0, _EventCodeContainer.getEventCodeByET)(_ETConfig.ExecutionTaskID.IMAGE_CAPTURE, false), ''))
233
+ var _props$applicableReas;
234
+ props.onSubmitET({
235
+ ...(await (0, _ExecTaskUtils.getBaseETResponse)(_ETConfig.EntityCode.IMAGE_CAPTURE, false, (0, _EventCodeContainer.getEventCodeByET)(_ETConfig.ExecutionTaskID.IMAGE_CAPTURE, false, (_props$applicableReas = props.applicableReasons) === null || _props$applicableReas === void 0 ? void 0 : _props$applicableReas.failure), ''))
209
236
  });
210
237
  }
211
- }, "Cancel")));
238
+ }, "Cancel"))));
212
239
  };
213
-
214
240
  const styles = _reactNative.StyleSheet.create({
215
241
  imageEtContainer: {
216
242
  display: 'flex',
@@ -250,7 +276,6 @@ const styles = _reactNative.StyleSheet.create({
250
276
  backgroundColor: '#ffffff'
251
277
  }
252
278
  });
253
-
254
279
  var _default = ImageCapture;
255
280
  exports.default = _default;
256
281
  //# sourceMappingURL=ImageCapture.js.map