@os1-platform/dispatch-mobile 3.1.8 → 3.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +0 -2
- package/android/.gradle/8.10.2/checksums/checksums.lock +0 -0
- package/android/.gradle/8.10.2/checksums/md5-checksums.bin +0 -0
- package/android/.gradle/8.10.2/checksums/sha1-checksums.bin +0 -0
- package/android/.gradle/8.10.2/executionHistory/executionHistory.lock +0 -0
- package/android/.gradle/{7.5/checksums/md5-checksums.bin → 8.10.2/fileHashes/fileHashes.bin} +0 -0
- package/android/.gradle/8.10.2/fileHashes/fileHashes.lock +0 -0
- package/android/.gradle/{7.5/fileHashes/fileHashes.bin → 8.10.2/fileHashes/resourceHashesCache.bin} +0 -0
- package/android/.gradle/buildOutputCleanup/buildOutputCleanup.lock +0 -0
- package/android/.gradle/buildOutputCleanup/cache.properties +2 -2
- package/android/.idea/AndroidProjectSystem.xml +6 -0
- package/android/.idea/caches/deviceStreaming.xml +533 -13
- package/android/.idea/gradle.xml +2 -1
- package/android/.idea/kotlinc.xml +1 -1
- package/android/.idea/misc.xml +1 -2
- package/android/.idea/runConfigurations.xml +17 -0
- package/android/.idea/studiobot.xml +6 -0
- package/android/build.gradle +3 -12
- package/android/gradle.properties +9 -4
- package/android/src/main/AndroidManifest.xml +2 -0
- package/android/src/main/java/com/dispatchsdk/utils/DispatchSdkUtils.kt +25 -10
- package/babel.config.js +1 -1
- package/lib/commonjs/analytics/sentry/SentrySdkConstants.js +4 -0
- package/lib/commonjs/analytics/sentry/SentrySdkConstants.js.map +1 -1
- package/lib/commonjs/components/executiontasks/captureInput/CaptureText.js +4 -4
- package/lib/commonjs/components/executiontasks/captureInput/CaptureText.js.map +1 -1
- package/lib/commonjs/components/executiontasks/collectPayment/components/CompletePayment.js +2 -2
- package/lib/commonjs/components/executiontasks/collectPayment/components/CompletePayment.js.map +1 -1
- package/lib/commonjs/components/executiontasks/collectPayment/components/InitPayment.js +4 -7
- package/lib/commonjs/components/executiontasks/collectPayment/components/InitPayment.js.map +1 -1
- package/lib/commonjs/components/executiontasks/collectPayment/components/PaymentContactDetails.js +7 -7
- package/lib/commonjs/components/executiontasks/collectPayment/components/PaymentContactDetails.js.map +1 -1
- package/lib/commonjs/components/executiontasks/collectPayment/components/ProcessPayment.js +20 -20
- package/lib/commonjs/components/executiontasks/collectPayment/components/ProcessPayment.js.map +1 -1
- package/lib/commonjs/components/executiontasks/deliver/SLDeliverET.js +4 -4
- package/lib/commonjs/components/executiontasks/deliver/SLDeliverET.js.map +1 -1
- package/lib/commonjs/components/executiontasks/doodle/SignatureET.js +4 -4
- package/lib/commonjs/components/executiontasks/doodle/SignatureET.js.map +1 -1
- package/lib/commonjs/components/executiontasks/dropCash/SLDropCash.js +4 -4
- package/lib/commonjs/components/executiontasks/dropCash/SLDropCash.js.map +1 -1
- package/lib/commonjs/components/executiontasks/forms/FormGenerator.js +12 -33
- package/lib/commonjs/components/executiontasks/forms/FormGenerator.js.map +1 -1
- package/lib/commonjs/components/executiontasks/imageCapture/ImageCapture.js +4 -4
- package/lib/commonjs/components/executiontasks/imageCapture/ImageCapture.js.map +1 -1
- package/lib/commonjs/components/executiontasks/payments/completePayment/CompletePaymentET.js +4 -4
- package/lib/commonjs/components/executiontasks/payments/completePayment/CompletePaymentET.js.map +1 -1
- package/lib/commonjs/components/executiontasks/payments/init/InitPaymentET.js +4 -4
- package/lib/commonjs/components/executiontasks/payments/init/InitPaymentET.js.map +1 -1
- package/lib/commonjs/components/executiontasks/payments/processPayment/ProcessPaymentET.js +4 -4
- package/lib/commonjs/components/executiontasks/payments/processPayment/ProcessPaymentET.js.map +1 -1
- package/lib/commonjs/components/executiontasks/pickup/PickupET.js.map +1 -1
- package/lib/commonjs/components/executiontasks/pickup/SLPickupET.js +4 -4
- package/lib/commonjs/components/executiontasks/pickup/SLPickupET.js.map +1 -1
- package/lib/commonjs/components/executiontasks/scan/ScanET.js +4 -4
- package/lib/commonjs/components/executiontasks/scan/ScanET.js.map +1 -1
- package/lib/commonjs/components/executiontasks/scan/interfaces.js +17 -1
- package/lib/commonjs/components/executiontasks/scan/interfaces.js.map +1 -1
- package/lib/commonjs/components/executiontasks/scan/sub_components/CScanner.js +4 -4
- package/lib/commonjs/components/executiontasks/scan/sub_components/CScanner.js.map +1 -1
- package/lib/commonjs/components/executiontasks/scan/sub_components/DropDownUtils.js +1 -1
- package/lib/commonjs/components/executiontasks/scan/sub_components/DropDownUtils.js.map +1 -1
- package/lib/commonjs/components/executiontasks/scan/sub_components/ERDropDown.js.map +1 -1
- package/lib/commonjs/components/executiontasks/scan/utils.js +12 -13
- package/lib/commonjs/components/executiontasks/scan/utils.js.map +1 -1
- package/lib/commonjs/components/executiontasks/validateOTP/ValidateOTPET.js.map +1 -1
- package/lib/commonjs/components/executiontasks/validateOTP/ValidateOTPSchema.js.map +1 -1
- package/lib/commonjs/components/executiontasks/validateOTP/components/ContactListView.js +4 -5
- package/lib/commonjs/components/executiontasks/validateOTP/components/ContactListView.js.map +1 -1
- package/lib/commonjs/components/executiontasks/validateOTP/components/OTPView.js +4 -4
- package/lib/commonjs/components/executiontasks/validateOTP/components/OTPView.js.map +1 -1
- package/lib/commonjs/components/executiontasks/verifyOtp/VerifyOtpET.js +5 -9
- package/lib/commonjs/components/executiontasks/verifyOtp/VerifyOtpET.js.map +1 -1
- package/lib/commonjs/components/widgets/CancelOrderDialog.js +2 -2
- package/lib/commonjs/components/widgets/CancelOrderDialog.js.map +1 -1
- package/lib/commonjs/components/widgets/SnackBarCustom.js +0 -3
- package/lib/commonjs/components/widgets/SnackBarCustom.js.map +1 -1
- package/lib/commonjs/components/widgets/Timer.js.map +1 -1
- package/lib/commonjs/database/DBManager.js +112 -0
- package/lib/commonjs/database/DBManager.js.map +1 -0
- package/lib/commonjs/database/dbUpdate.json +6 -0
- package/lib/commonjs/manager/dispatch/DispatchStateContainer.js.map +1 -1
- package/lib/commonjs/manager/dispatchCodes/EventCodeRepo.js +8 -9
- package/lib/commonjs/manager/dispatchCodes/EventCodeRepo.js.map +1 -1
- package/lib/commonjs/manager/dispatchCodes/ReasonCodeContainer.js +4 -4
- package/lib/commonjs/manager/dispatchCodes/ReasonCodeContainer.js.map +1 -1
- package/lib/commonjs/manager/dispatchCodes/ReasonCodeRepo.js +13 -10
- package/lib/commonjs/manager/dispatchCodes/ReasonCodeRepo.js.map +1 -1
- package/lib/commonjs/manager/location/LocationManager.js +0 -4
- package/lib/commonjs/manager/location/LocationManager.js.map +1 -1
- package/lib/commonjs/manager/sdk/DispatchSDKManager.js +7 -1
- package/lib/commonjs/manager/sdk/DispatchSDKManager.js.map +1 -1
- package/lib/commonjs/manager/sdk/callbacksHandler.js +1 -1
- package/lib/commonjs/manager/sdk/callbacksHandler.js.map +1 -1
- package/lib/commonjs/manager/syncmanager/DBConfig.js +6 -2
- package/lib/commonjs/manager/syncmanager/DBConfig.js.map +1 -1
- package/lib/commonjs/manager/syncmanager/database.js +117 -45
- package/lib/commonjs/manager/syncmanager/database.js.map +1 -1
- package/lib/commonjs/manager/syncmanager/document/DocumentManager.js +17 -22
- package/lib/commonjs/manager/syncmanager/document/DocumentManager.js.map +1 -1
- package/lib/commonjs/manager/syncmanager/document/DocumentSyncManager.js +85 -75
- package/lib/commonjs/manager/syncmanager/document/DocumentSyncManager.js.map +1 -1
- package/lib/commonjs/manager/syncmanager/events/ETEventsManager.js +24 -26
- package/lib/commonjs/manager/syncmanager/events/ETEventsManager.js.map +1 -1
- package/lib/commonjs/manager/syncmanager/events/EventsSyncManager.js.map +1 -1
- package/lib/commonjs/models/execTasks/ETConfig.js +1 -0
- package/lib/commonjs/models/execTasks/ETConfig.js.map +1 -1
- package/lib/commonjs/models/sdk.js.map +1 -1
- package/lib/commonjs/native/signature/SignatureCapture.js +2 -2
- package/lib/commonjs/native/signature/SignatureCapture.js.map +1 -1
- package/lib/commonjs/network/client.js.map +1 -1
- package/lib/commonjs/ui/screens/ValidateOTPScreen.js.map +1 -1
- package/lib/commonjs/utils/Constants.js.map +1 -1
- package/lib/commonjs/utils/Logger.js +1 -1
- package/lib/commonjs/utils/Logger.js.map +1 -1
- package/lib/commonjs/utils/SdkUtils.js +8 -4
- package/lib/commonjs/utils/SdkUtils.js.map +1 -1
- package/lib/commonjs/utils/SyncManagerUtils.js +2 -0
- package/lib/commonjs/utils/SyncManagerUtils.js.map +1 -1
- package/lib/module/analytics/sentry/SentrySdkConstants.js +4 -0
- package/lib/module/analytics/sentry/SentrySdkConstants.js.map +1 -1
- package/lib/module/components/executiontasks/captureInput/CaptureText.js +3 -3
- package/lib/module/components/executiontasks/captureInput/CaptureText.js.map +1 -1
- package/lib/module/components/executiontasks/collectPayment/components/CompletePayment.js +2 -2
- package/lib/module/components/executiontasks/collectPayment/components/CompletePayment.js.map +1 -1
- package/lib/module/components/executiontasks/collectPayment/components/InitPayment.js +3 -6
- package/lib/module/components/executiontasks/collectPayment/components/InitPayment.js.map +1 -1
- package/lib/module/components/executiontasks/collectPayment/components/PaymentContactDetails.js +6 -6
- package/lib/module/components/executiontasks/collectPayment/components/PaymentContactDetails.js.map +1 -1
- package/lib/module/components/executiontasks/collectPayment/components/ProcessPayment.js +18 -18
- package/lib/module/components/executiontasks/collectPayment/components/ProcessPayment.js.map +1 -1
- package/lib/module/components/executiontasks/deliver/SLDeliverET.js +3 -3
- package/lib/module/components/executiontasks/deliver/SLDeliverET.js.map +1 -1
- package/lib/module/components/executiontasks/doodle/SignatureET.js +3 -3
- package/lib/module/components/executiontasks/doodle/SignatureET.js.map +1 -1
- package/lib/module/components/executiontasks/dropCash/SLDropCash.js +3 -3
- package/lib/module/components/executiontasks/dropCash/SLDropCash.js.map +1 -1
- package/lib/module/components/executiontasks/forms/FormGenerator.js +11 -32
- package/lib/module/components/executiontasks/forms/FormGenerator.js.map +1 -1
- package/lib/module/components/executiontasks/imageCapture/ImageCapture.js +4 -4
- package/lib/module/components/executiontasks/imageCapture/ImageCapture.js.map +1 -1
- package/lib/module/components/executiontasks/payments/completePayment/CompletePaymentET.js +3 -3
- package/lib/module/components/executiontasks/payments/completePayment/CompletePaymentET.js.map +1 -1
- package/lib/module/components/executiontasks/payments/init/InitPaymentET.js +3 -3
- package/lib/module/components/executiontasks/payments/init/InitPaymentET.js.map +1 -1
- package/lib/module/components/executiontasks/payments/processPayment/ProcessPaymentET.js +3 -3
- package/lib/module/components/executiontasks/payments/processPayment/ProcessPaymentET.js.map +1 -1
- package/lib/module/components/executiontasks/pickup/PickupET.js.map +1 -1
- package/lib/module/components/executiontasks/pickup/SLPickupET.js +3 -3
- package/lib/module/components/executiontasks/pickup/SLPickupET.js.map +1 -1
- package/lib/module/components/executiontasks/scan/ScanET.js +3 -3
- package/lib/module/components/executiontasks/scan/ScanET.js.map +1 -1
- package/lib/module/components/executiontasks/scan/interfaces.js +16 -0
- package/lib/module/components/executiontasks/scan/interfaces.js.map +1 -1
- package/lib/module/components/executiontasks/scan/sub_components/CScanner.js +5 -5
- package/lib/module/components/executiontasks/scan/sub_components/CScanner.js.map +1 -1
- package/lib/module/components/executiontasks/scan/sub_components/DropDownUtils.js +2 -2
- package/lib/module/components/executiontasks/scan/sub_components/DropDownUtils.js.map +1 -1
- package/lib/module/components/executiontasks/scan/sub_components/ERDropDown.js.map +1 -1
- package/lib/module/components/executiontasks/scan/utils.js +13 -14
- package/lib/module/components/executiontasks/scan/utils.js.map +1 -1
- package/lib/module/components/executiontasks/validateOTP/ValidateOTPET.js.map +1 -1
- package/lib/module/components/executiontasks/validateOTP/ValidateOTPSchema.js.map +1 -1
- package/lib/module/components/executiontasks/validateOTP/components/ContactListView.js +3 -4
- package/lib/module/components/executiontasks/validateOTP/components/ContactListView.js.map +1 -1
- package/lib/module/components/executiontasks/validateOTP/components/OTPView.js +3 -3
- package/lib/module/components/executiontasks/validateOTP/components/OTPView.js.map +1 -1
- package/lib/module/components/executiontasks/verifyOtp/VerifyOtpET.js +6 -9
- package/lib/module/components/executiontasks/verifyOtp/VerifyOtpET.js.map +1 -1
- package/lib/module/components/widgets/CancelOrderDialog.js +1 -1
- package/lib/module/components/widgets/CancelOrderDialog.js.map +1 -1
- package/lib/module/components/widgets/SnackBarCustom.js +0 -2
- package/lib/module/components/widgets/SnackBarCustom.js.map +1 -1
- package/lib/module/components/widgets/Timer.js.map +1 -1
- package/lib/module/database/DBManager.js +104 -0
- package/lib/module/database/DBManager.js.map +1 -0
- package/lib/module/database/dbUpdate.json +6 -0
- package/lib/module/manager/dispatch/DispatchStateContainer.js.map +1 -1
- package/lib/module/manager/dispatchCodes/EventCodeRepo.js +7 -7
- package/lib/module/manager/dispatchCodes/EventCodeRepo.js.map +1 -1
- package/lib/module/manager/dispatchCodes/ReasonCodeContainer.js +4 -4
- package/lib/module/manager/dispatchCodes/ReasonCodeContainer.js.map +1 -1
- package/lib/module/manager/dispatchCodes/ReasonCodeRepo.js +13 -8
- package/lib/module/manager/dispatchCodes/ReasonCodeRepo.js.map +1 -1
- package/lib/module/manager/location/LocationManager.js +0 -4
- package/lib/module/manager/location/LocationManager.js.map +1 -1
- package/lib/module/manager/sdk/DispatchSDKManager.js +7 -1
- package/lib/module/manager/sdk/DispatchSDKManager.js.map +1 -1
- package/lib/module/manager/sdk/callbacksHandler.js +0 -2
- package/lib/module/manager/sdk/callbacksHandler.js.map +1 -1
- package/lib/module/manager/syncmanager/DBConfig.js +5 -1
- package/lib/module/manager/syncmanager/DBConfig.js.map +1 -1
- package/lib/module/manager/syncmanager/database.js +117 -43
- package/lib/module/manager/syncmanager/database.js.map +1 -1
- package/lib/module/manager/syncmanager/document/DocumentManager.js +16 -20
- package/lib/module/manager/syncmanager/document/DocumentManager.js.map +1 -1
- package/lib/module/manager/syncmanager/document/DocumentSyncManager.js +85 -75
- package/lib/module/manager/syncmanager/document/DocumentSyncManager.js.map +1 -1
- package/lib/module/manager/syncmanager/events/ETEventsManager.js +20 -22
- package/lib/module/manager/syncmanager/events/ETEventsManager.js.map +1 -1
- package/lib/module/manager/syncmanager/events/EventsSyncManager.js.map +1 -1
- package/lib/module/models/execTasks/ETConfig.js +1 -0
- package/lib/module/models/execTasks/ETConfig.js.map +1 -1
- package/lib/module/models/sdk.js.map +1 -1
- package/lib/module/native/signature/SignatureCapture.js +2 -2
- package/lib/module/native/signature/SignatureCapture.js.map +1 -1
- package/lib/module/network/client.js.map +1 -1
- package/lib/module/ui/screens/ValidateOTPScreen.js.map +1 -1
- package/lib/module/utils/Constants.js.map +1 -1
- package/lib/module/utils/Logger.js +1 -1
- package/lib/module/utils/Logger.js.map +1 -1
- package/lib/module/utils/SdkUtils.js +8 -4
- package/lib/module/utils/SdkUtils.js.map +1 -1
- package/lib/module/utils/SyncManagerUtils.js +2 -0
- package/lib/module/utils/SyncManagerUtils.js.map +1 -1
- package/lib/typescript/babel.config.d.ts +1 -0
- package/lib/typescript/jest.config.d.ts +7 -0
- package/lib/typescript/jest.setup.d.ts +1 -0
- package/lib/typescript/scripts/bootstrap.d.ts +1 -0
- package/lib/typescript/{components → src/components}/executiontasks/scan/interfaces.d.ts +15 -0
- package/lib/typescript/{components → src/components}/executiontasks/validateOTP/ValidateOTPSchema.d.ts +1 -1
- package/lib/typescript/{components → src/components}/widgets/CancelOrderDialog.d.ts +1 -1
- package/lib/typescript/{components → src/components}/widgets/SnackBarCustom.d.ts +3 -2
- package/lib/typescript/src/components/widgets/Timer.d.ts +6 -0
- package/lib/typescript/src/database/DBManager.d.ts +1 -0
- package/lib/typescript/{manager → src/manager}/dispatchCodes/EventCodeRepo.d.ts +1 -1
- package/lib/typescript/{manager → src/manager}/dispatchCodes/ReasonCodeRepo.d.ts +5 -3
- package/lib/typescript/{manager → src/manager}/syncmanager/DBConfig.d.ts +5 -1
- package/lib/typescript/src/manager/syncmanager/database.d.ts +31 -0
- package/lib/typescript/{manager → src/manager}/syncmanager/document/DocumentManager.d.ts +2 -3
- package/lib/typescript/{manager → src/manager}/syncmanager/document/DocumentSyncManager.d.ts +1 -2
- package/lib/typescript/{network → src/network}/client.d.ts +2 -2
- package/lib/typescript/{utils → src/utils}/Constants.d.ts +4 -0
- package/package.json +76 -104
- package/src/components/executiontasks/captureInput/CaptureText.tsx +6 -6
- package/src/components/executiontasks/collectPayment/components/CompletePayment.tsx +2 -3
- package/src/components/executiontasks/collectPayment/components/InitPayment.tsx +3 -7
- package/src/components/executiontasks/collectPayment/components/PaymentContactDetails.tsx +3 -4
- package/src/components/executiontasks/collectPayment/components/ProcessPayment.tsx +4 -5
- package/src/components/executiontasks/deliver/SLDeliverET.tsx +3 -4
- package/src/components/executiontasks/doodle/SignatureET.tsx +4 -4
- package/src/components/executiontasks/dropCash/SLDropCash.tsx +3 -4
- package/src/components/executiontasks/forms/FormGenerator.tsx +38 -55
- package/src/components/executiontasks/imageCapture/ImageCapture.tsx +5 -7
- package/src/components/executiontasks/payments/completePayment/CompletePaymentET.tsx +3 -4
- package/src/components/executiontasks/payments/init/InitPaymentET.tsx +3 -4
- package/src/components/executiontasks/payments/processPayment/ProcessPaymentET.tsx +3 -4
- package/src/components/executiontasks/pickup/PickupET.tsx +3 -9
- package/src/components/executiontasks/pickup/SLPickupET.tsx +3 -4
- package/src/components/executiontasks/scan/ScanET.tsx +3 -4
- package/src/components/executiontasks/scan/interfaces.ts +16 -0
- package/src/components/executiontasks/scan/sub_components/CScanner.tsx +7 -6
- package/src/components/executiontasks/scan/sub_components/DropDownUtils.ts +2 -2
- package/src/components/executiontasks/scan/sub_components/ERDropDown.tsx +0 -1
- package/src/components/executiontasks/scan/utils.ts +13 -13
- package/src/components/executiontasks/validateOTP/ValidateOTPET.tsx +5 -0
- package/src/components/executiontasks/validateOTP/ValidateOTPSchema.ts +1 -1
- package/src/components/executiontasks/validateOTP/components/ContactListView.tsx +3 -11
- package/src/components/executiontasks/validateOTP/components/OTPView.tsx +3 -4
- package/src/components/executiontasks/verifyOtp/VerifyOtpET.tsx +8 -16
- package/src/components/widgets/CancelOrderDialog.tsx +2 -2
- package/src/components/widgets/SnackBarCustom.tsx +2 -4
- package/src/components/widgets/Timer.tsx +0 -1
- package/src/database/DBManager.ts +118 -0
- package/src/database/dbUpdate.json +6 -0
- package/src/manager/dispatch/DispatchStateContainer.tsx +5 -25
- package/src/manager/dispatchCodes/EventCodeRepo.ts +8 -12
- package/src/manager/dispatchCodes/ReasonCodeContainer.ts +5 -5
- package/src/manager/dispatchCodes/ReasonCodeRepo.ts +17 -15
- package/src/manager/location/LocationManager.ts +1 -8
- package/src/manager/sdk/DispatchSDKManager.ts +12 -4
- package/src/manager/sdk/callbacksHandler.ts +3 -8
- package/src/manager/syncmanager/DBConfig.ts +6 -1
- package/src/manager/syncmanager/database.ts +130 -71
- package/src/manager/syncmanager/document/DocumentManager.ts +19 -24
- package/src/manager/syncmanager/document/DocumentSyncManager.ts +95 -82
- package/src/manager/syncmanager/events/ETEventsManager.ts +30 -35
- package/src/manager/syncmanager/events/EventsSyncManager.ts +1 -1
- package/src/models/sdk.ts +2 -6
- package/src/native/signature/SignatureCapture.tsx +4 -3
- package/src/network/client.ts +2 -2
- package/src/ui/screens/ValidateOTPScreen.tsx +2 -4
- package/src/utils/Constants.ts +6 -1
- package/src/utils/Logger.ts +2 -1
- package/src/utils/SdkUtils.ts +8 -7
- package/src/utils/SyncManagerUtils.ts +1 -0
- package/tsconfig.build.json +1 -1
- package/tsconfig.json +2 -3
- package/android/.gradle/7.5/checksums/checksums.lock +0 -0
- package/android/.gradle/7.5/checksums/sha1-checksums.bin +0 -0
- package/android/.gradle/7.5/dependencies-accessors/dependencies-accessors.lock +0 -0
- package/android/.gradle/7.5/executionHistory/executionHistory.lock +0 -0
- package/android/.gradle/7.5/fileHashes/fileHashes.lock +0 -0
- package/android/.gradle/8.0.1/checksums/checksums.lock +0 -0
- package/android/.gradle/8.0.1/dependencies-accessors/dependencies-accessors.lock +0 -0
- package/android/.gradle/8.0.1/dependencies-accessors/gc.properties +0 -0
- package/android/.gradle/8.0.1/executionHistory/executionHistory.lock +0 -0
- package/android/.gradle/8.0.1/fileChanges/last-build.bin +0 -0
- package/android/.gradle/8.0.1/fileHashes/fileHashes.lock +0 -0
- package/android/.gradle/8.0.1/gc.properties +0 -0
- package/android/.gradle/8.3/checksums/checksums.lock +0 -0
- package/android/.gradle/8.3/dependencies-accessors/dependencies-accessors.lock +0 -0
- package/android/.gradle/8.3/dependencies-accessors/gc.properties +0 -0
- package/android/.gradle/8.3/executionHistory/executionHistory.lock +0 -0
- package/android/.gradle/8.3/fileChanges/last-build.bin +0 -0
- package/android/.gradle/8.3/fileHashes/fileHashes.lock +0 -0
- package/android/.gradle/8.3/gc.properties +0 -0
- package/lib/typescript/components/widgets/Timer.d.ts +0 -7
- package/lib/typescript/manager/syncmanager/database.d.ts +0 -7
- /package/android/.gradle/{7.5 → 8.10.2}/dependencies-accessors/gc.properties +0 -0
- /package/android/.gradle/{7.5 → 8.10.2}/fileChanges/last-build.bin +0 -0
- /package/android/.gradle/{7.5 → 8.10.2}/gc.properties +0 -0
- /package/lib/typescript/{analytics → src/analytics}/firebase/FirebaseLogging.d.ts +0 -0
- /package/lib/typescript/{analytics → src/analytics}/sentry/SentryAnalyticsSingleton.d.ts +0 -0
- /package/lib/typescript/{analytics → src/analytics}/sentry/SentryAnalyticsUtils.d.ts +0 -0
- /package/lib/typescript/{analytics → src/analytics}/sentry/SentryModels.d.ts +0 -0
- /package/lib/typescript/{analytics → src/analytics}/sentry/SentrySdkConstants.d.ts +0 -0
- /package/lib/typescript/{components → src/components}/dispatch/DispatchExecNavigator.d.ts +0 -0
- /package/lib/typescript/{components → src/components}/executiontasks/CompletedWFSchema.d.ts +0 -0
- /package/lib/typescript/{components → src/components}/executiontasks/ExecutionTasksIndex.d.ts +0 -0
- /package/lib/typescript/{components → src/components}/executiontasks/cancellation/CancelET.d.ts +0 -0
- /package/lib/typescript/{components → src/components}/executiontasks/cancellation/CancellationSchema.d.ts +0 -0
- /package/lib/typescript/{components → src/components}/executiontasks/captureInput/CaptureInputSchema.d.ts +0 -0
- /package/lib/typescript/{components → src/components}/executiontasks/captureInput/CaptureText.d.ts +0 -0
- /package/lib/typescript/{components → src/components}/executiontasks/captureInput/utils.d.ts +0 -0
- /package/lib/typescript/{components → src/components}/executiontasks/collectPayment/CollectPayment.d.ts +0 -0
- /package/lib/typescript/{components → src/components}/executiontasks/collectPayment/CollectPaymentSchema.d.ts +0 -0
- /package/lib/typescript/{components → src/components}/executiontasks/collectPayment/PaymentStyles.d.ts +0 -0
- /package/lib/typescript/{components → src/components}/executiontasks/collectPayment/PaymentUtils.d.ts +0 -0
- /package/lib/typescript/{components → src/components}/executiontasks/collectPayment/components/CompletePayment.d.ts +0 -0
- /package/lib/typescript/{components → src/components}/executiontasks/collectPayment/components/CustomContactsModal.d.ts +0 -0
- /package/lib/typescript/{components → src/components}/executiontasks/collectPayment/components/InitPayment.d.ts +0 -0
- /package/lib/typescript/{components → src/components}/executiontasks/collectPayment/components/PaymentContactDetails.d.ts +0 -0
- /package/lib/typescript/{components → src/components}/executiontasks/collectPayment/components/ProcessPayment.d.ts +0 -0
- /package/lib/typescript/{components → src/components}/executiontasks/deliver/DeliverET.d.ts +0 -0
- /package/lib/typescript/{components → src/components}/executiontasks/deliver/DeliverETInput.d.ts +0 -0
- /package/lib/typescript/{components → src/components}/executiontasks/deliver/SLDeliverET.d.ts +0 -0
- /package/lib/typescript/{components → src/components}/executiontasks/display/DisplayModalET.d.ts +0 -0
- /package/lib/typescript/{components → src/components}/executiontasks/display/DisplaySchema.d.ts +0 -0
- /package/lib/typescript/{components → src/components}/executiontasks/doodle/SignatureET.d.ts +0 -0
- /package/lib/typescript/{components → src/components}/executiontasks/doodle/SignatureSchema.d.ts +0 -0
- /package/lib/typescript/{components → src/components}/executiontasks/dropCash/DropCashET.d.ts +0 -0
- /package/lib/typescript/{components → src/components}/executiontasks/dropCash/DropCashSchema.d.ts +0 -0
- /package/lib/typescript/{components → src/components}/executiontasks/dropCash/SLDropCash.d.ts +0 -0
- /package/lib/typescript/{components → src/components}/executiontasks/forms/FormGenerator.d.ts +0 -0
- /package/lib/typescript/{components → src/components}/executiontasks/forms/FormSchema.d.ts +0 -0
- /package/lib/typescript/{components → src/components}/executiontasks/forms/widgets/DateTimeWidget.d.ts +0 -0
- /package/lib/typescript/{components → src/components}/executiontasks/forms/widgets/DropdownWidget.d.ts +0 -0
- /package/lib/typescript/{components → src/components}/executiontasks/forms/widgets/QRBarcodeScannerWidget.d.ts +0 -0
- /package/lib/typescript/{components → src/components}/executiontasks/forms/widgets/TimeRangeSelector.d.ts +0 -0
- /package/lib/typescript/{components → src/components}/executiontasks/httpRequest/HttpEtUtils.d.ts +0 -0
- /package/lib/typescript/{components → src/components}/executiontasks/httpRequest/HttpRequestET.d.ts +0 -0
- /package/lib/typescript/{components → src/components}/executiontasks/httpRequest/HttpRequestETSchema.d.ts +0 -0
- /package/lib/typescript/{components → src/components}/executiontasks/imageCapture/CaptureSchema.d.ts +0 -0
- /package/lib/typescript/{components → src/components}/executiontasks/imageCapture/CaptureUtils.d.ts +0 -0
- /package/lib/typescript/{components → src/components}/executiontasks/imageCapture/ImageCapture.d.ts +0 -0
- /package/lib/typescript/{components → src/components}/executiontasks/payments/PaymentStyles.d.ts +0 -0
- /package/lib/typescript/{components → src/components}/executiontasks/payments/PaymentUtils.d.ts +0 -0
- /package/lib/typescript/{components → src/components}/executiontasks/payments/completePayment/CompletePaymentET.d.ts +0 -0
- /package/lib/typescript/{components → src/components}/executiontasks/payments/completePayment/CompletePaymentSchema.d.ts +0 -0
- /package/lib/typescript/{components → src/components}/executiontasks/payments/init/InitPaymentET.d.ts +0 -0
- /package/lib/typescript/{components → src/components}/executiontasks/payments/init/InitPaymentSchema.d.ts +0 -0
- /package/lib/typescript/{components → src/components}/executiontasks/payments/processPayment/ProcessPaymentET.d.ts +0 -0
- /package/lib/typescript/{components → src/components}/executiontasks/payments/processPayment/ProcessPaymentSchema.d.ts +0 -0
- /package/lib/typescript/{components → src/components}/executiontasks/pickup/PickpSchema.d.ts +0 -0
- /package/lib/typescript/{components → src/components}/executiontasks/pickup/PickupET.d.ts +0 -0
- /package/lib/typescript/{components → src/components}/executiontasks/pickup/SLPickupET.d.ts +0 -0
- /package/lib/typescript/{components → src/components}/executiontasks/scan/ScanET.d.ts +0 -0
- /package/lib/typescript/{components → src/components}/executiontasks/scan/ScanSchema.d.ts +0 -0
- /package/lib/typescript/{components → src/components}/executiontasks/scan/constants.d.ts +0 -0
- /package/lib/typescript/{components → src/components}/executiontasks/scan/modalConstant.d.ts +0 -0
- /package/lib/typescript/{components → src/components}/executiontasks/scan/sub_components/CScanner.d.ts +0 -0
- /package/lib/typescript/{components → src/components}/executiontasks/scan/sub_components/DropDownUtils.d.ts +0 -0
- /package/lib/typescript/{components → src/components}/executiontasks/scan/sub_components/ERDropDown.d.ts +0 -0
- /package/lib/typescript/{components → src/components}/executiontasks/scan/sub_components/SummaryPage.d.ts +0 -0
- /package/lib/typescript/{components → src/components}/executiontasks/scan/utils.d.ts +0 -0
- /package/lib/typescript/{components → src/components}/executiontasks/validateOTP/ValidateOTPET.d.ts +0 -0
- /package/lib/typescript/{components → src/components}/executiontasks/validateOTP/ValidateOtpStyles.d.ts +0 -0
- /package/lib/typescript/{components → src/components}/executiontasks/validateOTP/components/ContactListView.d.ts +0 -0
- /package/lib/typescript/{components → src/components}/executiontasks/validateOTP/components/OTPView.d.ts +0 -0
- /package/lib/typescript/{components → src/components}/executiontasks/validateOTP/components/VerificationComplete.d.ts +0 -0
- /package/lib/typescript/{components → src/components}/executiontasks/validateOTP/constants.d.ts +0 -0
- /package/lib/typescript/{components → src/components}/executiontasks/validateOTP/sub-components/ContactCard.d.ts +0 -0
- /package/lib/typescript/{components → src/components}/executiontasks/validateOTP/sub-components/OTPInput.d.ts +0 -0
- /package/lib/typescript/{components → src/components}/executiontasks/validateOTP/sub-components/ResendOTPButton.d.ts +0 -0
- /package/lib/typescript/{components → src/components}/executiontasks/validateOTP/utils.d.ts +0 -0
- /package/lib/typescript/{components → src/components}/executiontasks/verifyInput/VerifyInputSchema.d.ts +0 -0
- /package/lib/typescript/{components → src/components}/executiontasks/verifyLocation/GeofenceUtils.d.ts +0 -0
- /package/lib/typescript/{components → src/components}/executiontasks/verifyLocation/VerifyLocSchema.d.ts +0 -0
- /package/lib/typescript/{components → src/components}/executiontasks/verifyLocation/VerifyLocationET.d.ts +0 -0
- /package/lib/typescript/{components → src/components}/executiontasks/verifyOtp/VerifyOtpET.d.ts +0 -0
- /package/lib/typescript/{components → src/components}/executiontasks/verifyOtp/VerifyOtpSchema.d.ts +0 -0
- /package/lib/typescript/{components → src/components}/utils/Scale.d.ts +0 -0
- /package/lib/typescript/{components → src/components}/utils/index.d.ts +0 -0
- /package/lib/typescript/{components → src/components}/widgets/AlertDisplay.d.ts +0 -0
- /package/lib/typescript/{components → src/components}/widgets/Card.d.ts +0 -0
- /package/lib/typescript/{components → src/components}/widgets/ConfirmCancelModal.d.ts +0 -0
- /package/lib/typescript/{components → src/components}/widgets/GoBackModal.d.ts +0 -0
- /package/lib/typescript/{components → src/components}/widgets/IconButton.d.ts +0 -0
- /package/lib/typescript/{components → src/components}/widgets/ModalWidget.d.ts +0 -0
- /package/lib/typescript/{components → src/components}/widgets/ProgressDialog.d.ts +0 -0
- /package/lib/typescript/{components → src/components}/widgets/SearchBar.d.ts +0 -0
- /package/lib/typescript/{components → src/components}/widgets/SplitTextInput.d.ts +0 -0
- /package/lib/typescript/{components → src/components}/widgets/TabsComponent.d.ts +0 -0
- /package/lib/typescript/{components → src/components}/widgets/Toaster.d.ts +0 -0
- /package/lib/typescript/{config → src/config}/DispatchSDKConfig.d.ts +0 -0
- /package/lib/typescript/{constants → src/constants}/apiConstants.d.ts +0 -0
- /package/lib/typescript/{constants → src/constants}/constants.d.ts +0 -0
- /package/lib/typescript/{constants → src/constants}/statuscode.d.ts +0 -0
- /package/lib/typescript/{errors → src/errors}/BaseError.d.ts +0 -0
- /package/lib/typescript/{errors → src/errors}/ErrorCodes.d.ts +0 -0
- /package/lib/typescript/{events → src/events}/EventDispatcher.d.ts +0 -0
- /package/lib/typescript/{events → src/events}/EventListener.d.ts +0 -0
- /package/lib/typescript/{events → src/events}/constants.d.ts +0 -0
- /package/lib/typescript/{events → src/events}/index.d.ts +0 -0
- /package/lib/typescript/{events → src/events}/interface.d.ts +0 -0
- /package/lib/typescript/{icons → src/icons}/CircleMark.d.ts +0 -0
- /package/lib/typescript/{icons → src/icons}/FailedIcon.d.ts +0 -0
- /package/lib/typescript/{icons → src/icons}/FailureCloseIcon.d.ts +0 -0
- /package/lib/typescript/{icons → src/icons}/ScanIcon.d.ts +0 -0
- /package/lib/typescript/{icons → src/icons}/SuccessCompleteIcon.d.ts +0 -0
- /package/lib/typescript/{icons → src/icons}/file.d.ts +0 -0
- /package/lib/typescript/{icons → src/icons}/index.d.ts +0 -0
- /package/lib/typescript/{icons → src/icons}/interface.d.ts +0 -0
- /package/lib/typescript/{index.d.ts → src/index.d.ts} +0 -0
- /package/lib/typescript/{locale → src/locale}/Str.d.ts +0 -0
- /package/lib/typescript/{locale → src/locale}/i18n.d.ts +0 -0
- /package/lib/typescript/{locale → src/locale}/util.d.ts +0 -0
- /package/lib/typescript/{manager → src/manager}/dispatch/DispatchStateContainer.d.ts +0 -0
- /package/lib/typescript/{manager → src/manager}/dispatchCodes/EventCodeContainer.d.ts +0 -0
- /package/lib/typescript/{manager → src/manager}/dispatchCodes/ReasonCodeContainer.d.ts +0 -0
- /package/lib/typescript/{manager → src/manager}/jobRemoval/JobRemovalManager.d.ts +0 -0
- /package/lib/typescript/{manager → src/manager}/location/LocationManager.d.ts +0 -0
- /package/lib/typescript/{manager → src/manager}/sdk/DispatchSDKManager.d.ts +0 -0
- /package/lib/typescript/{manager → src/manager}/sdk/DispatchSdkCache.d.ts +0 -0
- /package/lib/typescript/{manager → src/manager}/sdk/callbacksHandler.d.ts +0 -0
- /package/lib/typescript/{manager → src/manager}/syncmanager/AppSyncManager.d.ts +0 -0
- /package/lib/typescript/{manager → src/manager}/syncmanager/NativeSyncManager.d.ts +0 -0
- /package/lib/typescript/{manager → src/manager}/syncmanager/constants.d.ts +0 -0
- /package/lib/typescript/{manager → src/manager}/syncmanager/document/DocumentHttpClient.d.ts +0 -0
- /package/lib/typescript/{manager → src/manager}/syncmanager/document/models.d.ts +0 -0
- /package/lib/typescript/{manager → src/manager}/syncmanager/events/ETEventsManager.d.ts +0 -0
- /package/lib/typescript/{manager → src/manager}/syncmanager/events/EventsGraphQLClient.d.ts +0 -0
- /package/lib/typescript/{manager → src/manager}/syncmanager/events/EventsSyncManager.d.ts +0 -0
- /package/lib/typescript/{manager → src/manager}/syncmanager/events/SyncHttpClient.d.ts +0 -0
- /package/lib/typescript/{models → src/models}/DispatchModels.d.ts +0 -0
- /package/lib/typescript/{models → src/models}/ReasonCodes.d.ts +0 -0
- /package/lib/typescript/{models → src/models}/auth.d.ts +0 -0
- /package/lib/typescript/{models → src/models}/execTasks/ETBaseModels.d.ts +0 -0
- /package/lib/typescript/{models → src/models}/execTasks/ETConfig.d.ts +0 -0
- /package/lib/typescript/{models → src/models}/execution.d.ts +0 -0
- /package/lib/typescript/{models → src/models}/fcm.d.ts +0 -0
- /package/lib/typescript/{models → src/models}/sdk.d.ts +0 -0
- /package/lib/typescript/{native → src/native}/LocationModule.d.ts +0 -0
- /package/lib/typescript/{native → src/native}/PermissionModule.d.ts +0 -0
- /package/lib/typescript/{native → src/native}/signature/SignatureCapture.d.ts +0 -0
- /package/lib/typescript/{network → src/network}/GraphQLClient.d.ts +0 -0
- /package/lib/typescript/{network → src/network}/NetworkClient.d.ts +0 -0
- /package/lib/typescript/{network → src/network}/NetworkUtils.d.ts +0 -0
- /package/lib/typescript/{network → src/network}/Queries.d.ts +0 -0
- /package/lib/typescript/{res → src/res}/strings.d.ts +0 -0
- /package/lib/typescript/{resources → src/resources}/Login.d.ts +0 -0
- /package/lib/typescript/{resources → src/resources}/network.d.ts +0 -0
- /package/lib/typescript/{styles → src/styles}/SdkColors.d.ts +0 -0
- /package/lib/typescript/{styles → src/styles}/executionTasks/CommonStyles.d.ts +0 -0
- /package/lib/typescript/{ui → src/ui}/screens/CancellationScreen.d.ts +0 -0
- /package/lib/typescript/{ui → src/ui}/screens/CaptureInputScreen.d.ts +0 -0
- /package/lib/typescript/{ui → src/ui}/screens/CollectPaymentScreen.d.ts +0 -0
- /package/lib/typescript/{ui → src/ui}/screens/CompleteObjectiveScreen.d.ts +0 -0
- /package/lib/typescript/{ui → src/ui}/screens/DeliverScreen.d.ts +0 -0
- /package/lib/typescript/{ui → src/ui}/screens/DisplayScreen.d.ts +0 -0
- /package/lib/typescript/{ui → src/ui}/screens/DoodleScreen.d.ts +0 -0
- /package/lib/typescript/{ui → src/ui}/screens/DropCashScreen.d.ts +0 -0
- /package/lib/typescript/{ui → src/ui}/screens/ETScreensIndex.d.ts +0 -0
- /package/lib/typescript/{ui → src/ui}/screens/FormsScreen.d.ts +0 -0
- /package/lib/typescript/{ui → src/ui}/screens/GeofenceScreen.d.ts +0 -0
- /package/lib/typescript/{ui → src/ui}/screens/HttpRequestScreen.d.ts +0 -0
- /package/lib/typescript/{ui → src/ui}/screens/ImageCaptureScreen.d.ts +0 -0
- /package/lib/typescript/{ui → src/ui}/screens/PaymentScreen.d.ts +0 -0
- /package/lib/typescript/{ui → src/ui}/screens/PickupScreen.d.ts +0 -0
- /package/lib/typescript/{ui → src/ui}/screens/ScanScreen.d.ts +0 -0
- /package/lib/typescript/{ui → src/ui}/screens/StartWorkFlowScreen.d.ts +0 -0
- /package/lib/typescript/{ui → src/ui}/screens/ValidateOTPScreen.d.ts +0 -0
- /package/lib/typescript/{ui → src/ui}/screens/WithBaseDispatchScreen.d.ts +0 -0
- /package/lib/typescript/{ui → src/ui}/uiConfig/RouteParams.d.ts +0 -0
- /package/lib/typescript/{utils → src/utils}/ApiUtils.d.ts +0 -0
- /package/lib/typescript/{utils → src/utils}/Enums.d.ts +0 -0
- /package/lib/typescript/{utils → src/utils}/ExecTaskUtils.d.ts +0 -0
- /package/lib/typescript/{utils → src/utils}/Logger.d.ts +0 -0
- /package/lib/typescript/{utils → src/utils}/NetworkUtil.d.ts +0 -0
- /package/lib/typescript/{utils → src/utils}/SdkUtils.d.ts +0 -0
- /package/lib/typescript/{utils → src/utils}/SyncManagerUtils.d.ts +0 -0
- /package/lib/typescript/{utils → src/utils}/context/paymentContext.d.ts +0 -0
- /package/lib/typescript/{utils → src/utils}/context/valdiateOTPContext.d.ts +0 -0
- /package/lib/typescript/{utils → src/utils}/fcm/FCM.d.ts +0 -0
- /package/lib/typescript/{utils → src/utils}/fcm/FcmUtils.d.ts +0 -0
- /package/lib/typescript/{utils → src/utils}/helper.d.ts +0 -0
- /package/lib/typescript/{utils → src/utils}/hooks/useModal.d.ts +0 -0
- /package/lib/typescript/{utils → src/utils}/hooks/useTimer.d.ts +0 -0
- /package/lib/typescript/{utils → src/utils}/loginHelper.d.ts +0 -0
- /package/lib/typescript/{utils → src/utils}/storage.d.ts +0 -0
- /package/lib/typescript/{utils → src/utils}/utils.d.ts +0 -0
|
@@ -1,28 +1,12 @@
|
|
|
1
1
|
import { clearCache, createFmsFolder } from '../../utils/SyncManagerUtils';
|
|
2
|
-
import {
|
|
3
|
-
DispatchExecutor as dispatchExecutor,
|
|
4
|
-
IDispatchExecutor,
|
|
5
|
-
IDispatch,
|
|
6
|
-
} from '@os1-platform/platform-coreos-execution-engine-sdk';
|
|
2
|
+
import { DispatchExecutor as dispatchExecutor, IDispatchExecutor, IDispatch } from '@os1-platform/platform-coreos-execution-engine-sdk';
|
|
7
3
|
import { showToast } from '../../components/widgets/Toaster';
|
|
8
|
-
import {
|
|
9
|
-
|
|
10
|
-
ExecutionTaskID,
|
|
11
|
-
} from '../../models/execTasks/ETConfig';
|
|
12
|
-
import type {
|
|
13
|
-
ETSummary,
|
|
14
|
-
ObjectiveSummary,
|
|
15
|
-
} from '../../models/execTasks/ETBaseModels';
|
|
16
|
-
|
|
4
|
+
import { CustomScreens, ExecutionTaskID } from '../../models/execTasks/ETConfig';
|
|
5
|
+
import type { ETSummary, ObjectiveSummary } from '../../models/execTasks/ETBaseModels';
|
|
17
6
|
import EventsSyncManager from '../syncmanager/events/EventsSyncManager';
|
|
18
7
|
import Logger, { LOG_TYPE } from '../../utils/Logger';
|
|
19
8
|
import DispatchSdkCache from '../sdk/DispatchSdkCache';
|
|
20
|
-
import type {
|
|
21
|
-
BaseETProps,
|
|
22
|
-
endEvent,
|
|
23
|
-
JobObjectiveType,
|
|
24
|
-
stateParams,
|
|
25
|
-
} from '../../models/DispatchModels';
|
|
9
|
+
import type { BaseETProps, endEvent, JobObjectiveType, stateParams } from '../../models/DispatchModels';
|
|
26
10
|
import { BaseError } from '../../errors/BaseError';
|
|
27
11
|
import { getBaseETResponse } from '../../utils/ExecTaskUtils';
|
|
28
12
|
import ReasonCodeContainer from '../dispatchCodes/ReasonCodeContainer';
|
|
@@ -106,11 +90,7 @@ export default class DispatchStateContainer {
|
|
|
106
90
|
!dispatchWorkflows ||
|
|
107
91
|
Object.keys(dispatchWorkflows).length < 1
|
|
108
92
|
) {
|
|
109
|
-
Logger.getInstance().logEvent(
|
|
110
|
-
'initDispatchExecutor',
|
|
111
|
-
InvalidArgumentsError,
|
|
112
|
-
LOG_TYPE.SDK_WARNING
|
|
113
|
-
);
|
|
93
|
+
Logger.getInstance().logEvent('initDispatchExecutor', InvalidArgumentsError, LOG_TYPE.SDK_WARNING);
|
|
114
94
|
throw new BaseError(
|
|
115
95
|
BaseErrorCodes.InvalidArgumentError,
|
|
116
96
|
InvalidArgumentsError
|
|
@@ -1,9 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
EventsRow,
|
|
4
|
-
EVENT_CODES_TABLE,
|
|
5
|
-
EventColumns,
|
|
6
|
-
} from '../syncmanager/DBConfig';
|
|
1
|
+
import Database from '../syncmanager/database';
|
|
2
|
+
import { EventsRow, EVENT_CODES_TABLE, EventColumns } from '../syncmanager/DBConfig';
|
|
7
3
|
import type { EventCodes } from '../../models/ReasonCodes';
|
|
8
4
|
|
|
9
5
|
export default class EventCodeRepo {
|
|
@@ -31,7 +27,7 @@ export default class EventCodeRepo {
|
|
|
31
27
|
await Promise.all(promises);
|
|
32
28
|
}
|
|
33
29
|
private async insertEvent(event: EventsRow) {
|
|
34
|
-
await Database.
|
|
30
|
+
await Database.executeSetDataQuery(
|
|
35
31
|
`INSERT OR REPLACE INTO ${EVENT_CODES_TABLE}(\
|
|
36
32
|
${EventColumns.CODE},\
|
|
37
33
|
${EventColumns.DESCRIPTION},\
|
|
@@ -42,7 +38,7 @@ export default class EventCodeRepo {
|
|
|
42
38
|
}
|
|
43
39
|
|
|
44
40
|
private async init(): Promise<void> {
|
|
45
|
-
await Database.
|
|
41
|
+
await Database.executeSetDataQuery(
|
|
46
42
|
`CREATE TABLE IF NOT EXISTS ${EVENT_CODES_TABLE} (\
|
|
47
43
|
${EventColumns.CODE} TEXT PRIMARY KEY NOT NULL,\
|
|
48
44
|
${EventColumns.DESCRIPTION} TEXT,\
|
|
@@ -51,20 +47,20 @@ export default class EventCodeRepo {
|
|
|
51
47
|
);
|
|
52
48
|
}
|
|
53
49
|
public async getAllEventCodes(): Promise<EventsRow[]> {
|
|
54
|
-
const resultSet = await Database.
|
|
50
|
+
const resultSet = await Database.executeGetDataQuery(
|
|
55
51
|
`SELECT * FROM ${EVENT_CODES_TABLE};`,
|
|
56
52
|
[]
|
|
57
53
|
);
|
|
58
54
|
return resultSet.rows._array;
|
|
59
55
|
}
|
|
60
56
|
public async deleteAll() {
|
|
61
|
-
return Database.
|
|
57
|
+
return Database.executeSetDataQuery(`DELETE FROM ${EVENT_CODES_TABLE};`, []);
|
|
62
58
|
}
|
|
63
59
|
|
|
64
60
|
public async getEventsByCode(codes: string[]): Promise<EventsRow[]> {
|
|
65
61
|
if (!codes || codes.length < 1) return [];
|
|
66
62
|
const placeholders = codes.map((it) => `'${it}'`).join(',');
|
|
67
|
-
const resultSet = await Database.
|
|
63
|
+
const resultSet = await Database.executeGetDataQuery(
|
|
68
64
|
`SELECT * FROM ${EVENT_CODES_TABLE} WHERE ${EventColumns.CODE} IN (${placeholders});`,
|
|
69
65
|
[]
|
|
70
66
|
);
|
|
@@ -73,7 +69,7 @@ export default class EventCodeRepo {
|
|
|
73
69
|
|
|
74
70
|
public async getEventByCode(code: string): Promise<EventsRow[]> {
|
|
75
71
|
if (!code) return [];
|
|
76
|
-
const resultSet = await Database.
|
|
72
|
+
const resultSet = await Database.executeGetDataQuery(
|
|
77
73
|
`SELECT * FROM ${EVENT_CODES_TABLE} WHERE ${EventColumns.CODE} = ?;`,
|
|
78
74
|
[code]
|
|
79
75
|
);
|
|
@@ -2,15 +2,15 @@ import DispatchSdkCache from '../sdk/DispatchSdkCache';
|
|
|
2
2
|
import Logger, { LOG_TYPE } from '../../utils/Logger';
|
|
3
3
|
import { BaseError } from '../../errors/BaseError';
|
|
4
4
|
import ErrorCodes from '../../errors/ErrorCodes';
|
|
5
|
-
import ReasonCodeRepo from './ReasonCodeRepo';
|
|
6
5
|
import type { ApplicableReasons } from '../../models/execTasks/ETBaseModels';
|
|
7
6
|
import type { ReasonsRow } from '../syncmanager/DBConfig';
|
|
8
7
|
import GraphQLClient from '../../network/GraphQLClient';
|
|
8
|
+
import ReasonCodeRepoIns from './ReasonCodeRepo';
|
|
9
9
|
|
|
10
10
|
export default class ReasonCodeContainer {
|
|
11
11
|
private static instance: ReasonCodeContainer;
|
|
12
12
|
private cache: DispatchSdkCache = DispatchSdkCache.getInstance();
|
|
13
|
-
private constructor() {}
|
|
13
|
+
private constructor() { }
|
|
14
14
|
|
|
15
15
|
public static getInstance(): ReasonCodeContainer {
|
|
16
16
|
if (!ReasonCodeContainer.instance) {
|
|
@@ -31,7 +31,7 @@ export default class ReasonCodeContainer {
|
|
|
31
31
|
try {
|
|
32
32
|
const codes: string[] = applicableCodes[entityCode];
|
|
33
33
|
let finalApplicableCodes =
|
|
34
|
-
await
|
|
34
|
+
await ReasonCodeRepoIns.getReasonsByCode(codes);
|
|
35
35
|
if (finalApplicableCodes && finalApplicableCodes.length > 0) {
|
|
36
36
|
return finalApplicableCodes;
|
|
37
37
|
} else return [];
|
|
@@ -54,7 +54,7 @@ export default class ReasonCodeContainer {
|
|
|
54
54
|
try {
|
|
55
55
|
if (!code) return null;
|
|
56
56
|
else {
|
|
57
|
-
const queryResult = await
|
|
57
|
+
const queryResult = await ReasonCodeRepoIns.getReasonByCode(
|
|
58
58
|
code
|
|
59
59
|
);
|
|
60
60
|
if (queryResult && queryResult.length > 0) {
|
|
@@ -84,7 +84,7 @@ export default class ReasonCodeContainer {
|
|
|
84
84
|
graphlQLResponse.data.reasonList &&
|
|
85
85
|
graphlQLResponse.data.reasonList.data
|
|
86
86
|
) {
|
|
87
|
-
await
|
|
87
|
+
await ReasonCodeRepoIns.saveReasonCode(
|
|
88
88
|
graphlQLResponse.data.reasonList.data
|
|
89
89
|
);
|
|
90
90
|
await this.cache.setKeyInCache(
|
|
@@ -1,12 +1,9 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
ReasonColums,
|
|
4
|
-
REASONS_TABLE,
|
|
5
|
-
ReasonsRow,
|
|
6
|
-
} from '../syncmanager/DBConfig';
|
|
1
|
+
import Database from '../syncmanager/database';
|
|
2
|
+
import { ReasonColums, REASONS_TABLE, ReasonsRow } from '../syncmanager/DBConfig';
|
|
7
3
|
import type { ReasonCodes } from '../../models/ReasonCodes';
|
|
4
|
+
import { Platform } from 'react-native';
|
|
8
5
|
|
|
9
|
-
|
|
6
|
+
class ReasonCodeRepo {
|
|
10
7
|
private static instance: ReasonCodeRepo;
|
|
11
8
|
public static getInstance(): ReasonCodeRepo {
|
|
12
9
|
if (!ReasonCodeRepo.instance) {
|
|
@@ -32,7 +29,7 @@ export default class ReasonCodeRepo {
|
|
|
32
29
|
await Promise.all(promises);
|
|
33
30
|
}
|
|
34
31
|
private async insertReason(reason: ReasonsRow) {
|
|
35
|
-
await Database.
|
|
32
|
+
await Database.executeSetDataQuery(
|
|
36
33
|
`INSERT OR REPLACE INTO ${REASONS_TABLE}(\
|
|
37
34
|
${ReasonColums.CODE},\
|
|
38
35
|
${ReasonColums.DESCRIPTION},\
|
|
@@ -48,8 +45,8 @@ export default class ReasonCodeRepo {
|
|
|
48
45
|
);
|
|
49
46
|
}
|
|
50
47
|
|
|
51
|
-
|
|
52
|
-
await Database.
|
|
48
|
+
public async init(): Promise<void> {
|
|
49
|
+
const initResult = await Database.executeSetDataQuery(
|
|
53
50
|
`CREATE TABLE IF NOT EXISTS ${REASONS_TABLE} (\
|
|
54
51
|
${ReasonColums.CODE} TEXT PRIMARY KEY NOT NULL,\
|
|
55
52
|
${ReasonColums.DESCRIPTION} TEXT,\
|
|
@@ -57,23 +54,25 @@ export default class ReasonCodeRepo {
|
|
|
57
54
|
${ReasonColums.SYSTEM_DEFINED} INTEGER);`,
|
|
58
55
|
[]
|
|
59
56
|
);
|
|
57
|
+
return;
|
|
60
58
|
}
|
|
61
59
|
public async getAllReasons(): Promise<ReasonsRow[]> {
|
|
62
|
-
const resultSet = await Database.
|
|
60
|
+
const resultSet = await Database.executeGetDataQuery(
|
|
63
61
|
`SELECT * FROM ${REASONS_TABLE};`,
|
|
64
62
|
[]
|
|
65
63
|
);
|
|
66
64
|
return resultSet.rows._array;
|
|
67
65
|
}
|
|
68
66
|
public async deleteAll() {
|
|
69
|
-
return Database.
|
|
67
|
+
return Database.executeSetDataQuery(`DELETE FROM ${REASONS_TABLE};`, []);
|
|
70
68
|
}
|
|
71
69
|
|
|
72
70
|
public async getReasonsByCode(codes: string[]): Promise<ReasonsRow[]> {
|
|
73
71
|
if (!codes || codes.length < 1) return [];
|
|
74
72
|
const placeholders = codes.map((it) => `'${it}'`).join(',');
|
|
75
|
-
const
|
|
76
|
-
|
|
73
|
+
const isEnabled = Platform.OS === 'ios' ? '1' : '1';
|
|
74
|
+
const resultSet = await Database.executeGetDataQuery(
|
|
75
|
+
`SELECT * FROM ${REASONS_TABLE} WHERE ${ReasonColums.IS_ENABLED}= '${isEnabled}' AND ${ReasonColums.CODE} IN (${placeholders});`,
|
|
77
76
|
[]
|
|
78
77
|
);
|
|
79
78
|
return resultSet.rows._array;
|
|
@@ -81,10 +80,13 @@ export default class ReasonCodeRepo {
|
|
|
81
80
|
|
|
82
81
|
public async getReasonByCode(code: string): Promise<ReasonsRow[]> {
|
|
83
82
|
if (!code) return [];
|
|
84
|
-
const resultSet = await Database.
|
|
83
|
+
const resultSet = await Database.executeGetDataQuery(
|
|
85
84
|
`SELECT * FROM ${REASONS_TABLE} WHERE ${ReasonColums.CODE} = ?;`,
|
|
86
85
|
[code]
|
|
87
86
|
);
|
|
88
87
|
return resultSet.rows._array;
|
|
89
88
|
}
|
|
90
89
|
}
|
|
90
|
+
|
|
91
|
+
const ReasonCodeRepoIns = ReasonCodeRepo.getInstance();
|
|
92
|
+
export default ReasonCodeRepoIns;
|
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
import * as Location from 'expo-location';
|
|
2
|
-
import { Accuracy, LocationObject } from 'expo-location';
|
|
3
|
-
import Logger, { LOG_TYPE } from '../../utils/Logger';
|
|
4
1
|
import { EmitterSubscription, Platform } from 'react-native';
|
|
5
2
|
import PermissionModule from '../../native/PermissionModule';
|
|
6
3
|
import LocationModule, { LocationType } from '../../native/LocationModule';
|
|
@@ -13,7 +10,6 @@ export default class LocationManager {
|
|
|
13
10
|
private subscription: EmitterSubscription | null = null;
|
|
14
11
|
|
|
15
12
|
public async checkForLocationPermissions(): Promise<boolean> {
|
|
16
|
-
console.log("checkForLocationPermissions");
|
|
17
13
|
if (Platform.OS === 'ios') {
|
|
18
14
|
// old code checking for permissions using expo-location
|
|
19
15
|
// let permissionResponse = await Location.getForegroundPermissionsAsync();
|
|
@@ -63,7 +59,6 @@ export default class LocationManager {
|
|
|
63
59
|
if (Platform.OS === 'android') {
|
|
64
60
|
LocationModule.startLocationUpdates();
|
|
65
61
|
this.subscription = LocationModule.addLocationListener((location) => {
|
|
66
|
-
console.log('Location updated:', location);
|
|
67
62
|
if (location != null) {
|
|
68
63
|
this.lastLocationAndroid = location
|
|
69
64
|
}
|
|
@@ -84,7 +79,6 @@ export default class LocationManager {
|
|
|
84
79
|
|
|
85
80
|
public async getLastLocation(): Promise<DLocation> {
|
|
86
81
|
if (Platform.OS === 'android' && this.lastLocationAndroid != null) {
|
|
87
|
-
console.log("lastLocationAndroid:", this.lastLocationAndroid);
|
|
88
82
|
return {
|
|
89
83
|
latitude: this.lastLocationAndroid.latitude.toString(),
|
|
90
84
|
longitude: this.lastLocationAndroid.longitude.toString(),
|
|
@@ -93,8 +87,7 @@ export default class LocationManager {
|
|
|
93
87
|
}
|
|
94
88
|
if (Platform.OS === 'ios') {
|
|
95
89
|
this.lastLocationiOS = await LocationModule.getLastLocation();
|
|
96
|
-
|
|
97
|
-
if(this.lastLocationiOS){
|
|
90
|
+
if (this.lastLocationiOS) {
|
|
98
91
|
return {
|
|
99
92
|
latitude: this.lastLocationiOS.latitude.toString(),
|
|
100
93
|
longitude: this.lastLocationiOS.longitude.toString(),
|
|
@@ -17,6 +17,7 @@ import { pushBulkEventForSync } from '../../utils/SyncManagerUtils';
|
|
|
17
17
|
import callbackHandler from './callbacksHandler';
|
|
18
18
|
import { DispatchExecutor as dispatchExecutor } from '@os1-platform/platform-coreos-execution-engine-sdk';
|
|
19
19
|
import { MAX_RETRY_COUNT } from '../syncmanager/constants';
|
|
20
|
+
import { initAndUpdateDatabase } from '../../database/DBManager';
|
|
20
21
|
|
|
21
22
|
export class DispatchSDKManager {
|
|
22
23
|
private static instance: DispatchSDKManager;
|
|
@@ -47,27 +48,33 @@ export class DispatchSDKManager {
|
|
|
47
48
|
'accessToken',
|
|
48
49
|
])
|
|
49
50
|
) {
|
|
50
|
-
throw new BaseError(
|
|
51
|
-
ErrorCodes.InvalidArgumentError,
|
|
52
|
-
'Invalid/Missing Argument Passed in SdkConfig'
|
|
53
|
-
);
|
|
51
|
+
throw new BaseError(ErrorCodes.InvalidArgumentError, 'Invalid/Missing Argument Passed in SdkConfig');
|
|
54
52
|
}
|
|
53
|
+
|
|
55
54
|
if (isTokenExpired(sdkConfig.accessToken)) {
|
|
56
55
|
throw new BaseError(
|
|
57
56
|
ErrorCodes.ACCESS_TOKEN_EXPIRED,
|
|
58
57
|
'JWT Token Expired!'
|
|
59
58
|
);
|
|
60
59
|
}
|
|
60
|
+
|
|
61
61
|
if (sdkConfig.sentry && sdkConfig.sentry?.enabled) {
|
|
62
62
|
Sentry.init({
|
|
63
63
|
enableNative: true,
|
|
64
64
|
environment: sdkConfig.sentry.env,
|
|
65
65
|
dsn: sdkConfig.sentry.dsn,
|
|
66
66
|
tracesSampleRate: 1.0,
|
|
67
|
+
enableAutoSessionTracking: true,
|
|
68
|
+
enableAutoPerformanceTracing: false,
|
|
69
|
+
attachStacktrace: true,
|
|
70
|
+
maxBreadcrumbs: 50,
|
|
67
71
|
});
|
|
68
72
|
}
|
|
73
|
+
|
|
69
74
|
await SdkUtils.checkMandatory();
|
|
75
|
+
|
|
70
76
|
await this.cache.setObjectInCache(this.keys.SDK_CONFIG, sdkConfig);
|
|
77
|
+
await initAndUpdateDatabase()
|
|
71
78
|
GraphQLClient.init(sdkConfig.tenantBaseURL);
|
|
72
79
|
AppSyncManager.initAppSync(
|
|
73
80
|
sdkConfig.tenantBaseURL,
|
|
@@ -78,6 +85,7 @@ export class DispatchSDKManager {
|
|
|
78
85
|
EventCodeRepo.getInstance().saveEventCode(sdkConfig.eventMapping);
|
|
79
86
|
}
|
|
80
87
|
await ReasonCodeContainer.getInstance().fetchReasonCode();
|
|
88
|
+
|
|
81
89
|
Logger.getInstance().setLogging(sdkConfig.enableLogging ?? true, sdkConfig);
|
|
82
90
|
let storage = Storage.getInstance();
|
|
83
91
|
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
import { DispatchSDKConfig } from 'src/models/sdk';
|
|
1
|
+
import { DispatchSDKConfig } from '../../models/sdk';
|
|
3
2
|
import DispatchSdkCache from './DispatchSdkCache';
|
|
4
3
|
import { BaseError } from '../../errors/BaseError';
|
|
5
4
|
import ErrorCodes from '../../errors/ErrorCodes';
|
|
@@ -17,14 +16,10 @@ class CallbacksHandler {
|
|
|
17
16
|
) => Promise<Record<string, EmailAndPhoneResponse>>;
|
|
18
17
|
|
|
19
18
|
public init(
|
|
20
|
-
phoneCallback: (
|
|
21
|
-
sdsIds: string[]
|
|
22
|
-
) => Promise<{ key: string; value: string[] }>,
|
|
19
|
+
phoneCallback: (sdsIds: string[]) => Promise<{ key: string; value: string[] }>,
|
|
23
20
|
dateTimeCallBack: () => Promise<string>,
|
|
24
21
|
tokenRefreshCallback: () => Promise<string>,
|
|
25
|
-
emailAndPhoneCallback: (
|
|
26
|
-
sdsIds: string[]
|
|
27
|
-
) => Promise<Record<string, EmailAndPhoneResponse>>
|
|
22
|
+
emailAndPhoneCallback: (sdsIds: string[]) => Promise<Record<string, EmailAndPhoneResponse>>
|
|
28
23
|
) {
|
|
29
24
|
this._callbackToFetchPhoneNumbers = phoneCallback;
|
|
30
25
|
this._callbackToFetchDateTime = dateTimeCallBack;
|
|
@@ -7,7 +7,7 @@ export enum DispatchSyncType {
|
|
|
7
7
|
DISPATCH_SUB_STATUS_UPDATE = 'DISPATCH_SUB_STATUS_UPDATE',
|
|
8
8
|
}
|
|
9
9
|
|
|
10
|
-
export const DATABASE_NAME = '
|
|
10
|
+
export const DATABASE_NAME = 'DispatchSDK_DB';
|
|
11
11
|
export const EVENTS_TABLE = 'EVENTS_TABLE';
|
|
12
12
|
export const REASONS_TABLE = 'REASONS_TABLE';
|
|
13
13
|
export const EVENT_CODES_TABLE = 'EVENT_CODES_TABLE';
|
|
@@ -110,6 +110,11 @@ export const EventColumns = {
|
|
|
110
110
|
SUCCESS_EVENT: 'successEvent',
|
|
111
111
|
};
|
|
112
112
|
|
|
113
|
+
export const VERSION_TABLE = 'VERSION_TABLE';
|
|
114
|
+
export const VERSION_COLUMNS = {
|
|
115
|
+
VERSION_NO: 'versionNo'
|
|
116
|
+
};
|
|
117
|
+
|
|
113
118
|
// NEW CODE
|
|
114
119
|
export interface BulkEvent {
|
|
115
120
|
syncType: ExecEngineSyncType | DispatchSyncType;
|
|
@@ -1,93 +1,152 @@
|
|
|
1
|
-
import * as SQLite from 'expo-sqlite';
|
|
2
1
|
import * as DBConfig from './DBConfig';
|
|
3
|
-
import type { SQLResultSet, WebSQLDatabase } from 'expo-sqlite';
|
|
4
2
|
import { isEmptyOrBlank } from '../../utils/utils';
|
|
5
3
|
import { BaseError } from '../../errors/BaseError';
|
|
6
4
|
import BaseErrorCodes from '../../errors/ErrorCodes';
|
|
7
5
|
import Logger, { LOG_TYPE } from '../../utils/Logger';
|
|
6
|
+
import type { ExecQuery } from '../../utils/Constants';
|
|
7
|
+
import { openDatabaseSync, SQLiteDatabase } from 'expo-sqlite';
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
9
|
+
// Legacy type for backward compatibility
|
|
10
|
+
export interface SQLResultSet {
|
|
11
|
+
insertId?: number;
|
|
12
|
+
rowsAffected: number;
|
|
13
|
+
rows: {
|
|
14
|
+
_array: any[];
|
|
15
|
+
length: number;
|
|
16
|
+
item: (index: number) => any;
|
|
17
|
+
};
|
|
13
18
|
}
|
|
14
19
|
|
|
15
|
-
export interface ExecQuery {
|
|
16
|
-
query: string;
|
|
17
|
-
args: any[];
|
|
18
|
-
}
|
|
19
20
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
);
|
|
32
|
-
return;
|
|
21
|
+
class SQLDatabase {
|
|
22
|
+
private static instance: SQLDatabase;
|
|
23
|
+
private db: SQLiteDatabase;
|
|
24
|
+
|
|
25
|
+
private constructor() {
|
|
26
|
+
this.db = openDatabaseSync(DBConfig.DATABASE_NAME);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
public static getInstance(): SQLDatabase {
|
|
30
|
+
if (!SQLDatabase.instance) {
|
|
31
|
+
SQLDatabase.instance = new SQLDatabase();
|
|
33
32
|
}
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
tx.executeSql(
|
|
37
|
-
query,
|
|
38
|
-
args,
|
|
39
|
-
(_, sqlResultSet) => {
|
|
40
|
-
resolve(sqlResultSet);
|
|
41
|
-
},
|
|
42
|
-
(_, sqlError) => {
|
|
43
|
-
reject(sqlError);
|
|
44
|
-
return false;
|
|
45
|
-
}
|
|
46
|
-
);
|
|
47
|
-
});
|
|
48
|
-
});
|
|
49
|
-
}
|
|
33
|
+
return SQLDatabase.instance;
|
|
34
|
+
}
|
|
50
35
|
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
36
|
+
executeSetDataQuery(query: string, args: any[]): Promise<SQLResultSet> {
|
|
37
|
+
return new Promise((resolve, reject) => {
|
|
38
|
+
if (isEmptyOrBlank(query)) {
|
|
39
|
+
reject(new BaseError( BaseErrorCodes.InvalidArgumentError, 'SQL Query is null or empty'));
|
|
40
|
+
return;
|
|
41
|
+
}
|
|
42
|
+
try {
|
|
43
|
+
const result = this.db.runSync(query, args);
|
|
44
|
+
const sqlResultSet: SQLResultSet = {
|
|
45
|
+
insertId: result.lastInsertRowId,
|
|
46
|
+
rowsAffected: result.changes,
|
|
47
|
+
rows: {
|
|
48
|
+
_array: [],
|
|
49
|
+
length: 0,
|
|
50
|
+
item: (index: number) => null
|
|
51
|
+
}
|
|
52
|
+
};
|
|
53
|
+
resolve(sqlResultSet);
|
|
54
|
+
} catch (error) {
|
|
55
|
+
reject(error);
|
|
56
|
+
}
|
|
57
|
+
});
|
|
58
|
+
}
|
|
54
59
|
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
(
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
60
|
+
executeGetDataQuery(query: string, args: any[]): Promise<any> {
|
|
61
|
+
return new Promise((resolve, reject) => {
|
|
62
|
+
if (isEmptyOrBlank(query)) {
|
|
63
|
+
reject(new BaseError( BaseErrorCodes.InvalidArgumentError, 'SQL Query is null or empty'));
|
|
64
|
+
return;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
try {
|
|
68
|
+
const result = this.db.getAllSync(query, args);
|
|
69
|
+
const sqlResultSet: SQLResultSet = {
|
|
70
|
+
insertId: undefined,
|
|
71
|
+
rowsAffected: 0,
|
|
72
|
+
rows: {
|
|
73
|
+
_array: result,
|
|
74
|
+
length: result.length,
|
|
75
|
+
item: (index: number) => result[index] || null
|
|
65
76
|
}
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
77
|
+
};
|
|
78
|
+
resolve(sqlResultSet);
|
|
79
|
+
} catch (error) {
|
|
80
|
+
reject(error);
|
|
81
|
+
}
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
executeBulkQuery(_queryData: ExecQuery[]): Promise<boolean> {
|
|
86
|
+
return new Promise(async (resolve, reject) => {
|
|
87
|
+
try {
|
|
88
|
+
await this.db.withExclusiveTransactionAsync(async () => {
|
|
89
|
+
for (const _q of _queryData) {
|
|
90
|
+
this.db.runSync(_q.query, _q.args);
|
|
91
|
+
}
|
|
72
92
|
});
|
|
73
|
-
|
|
74
|
-
|
|
93
|
+
|
|
94
|
+
Logger.getInstance().logEvent(
|
|
95
|
+
'executeBulkQuery success: ',
|
|
96
|
+
JSON.stringify(_queryData.length + ' queries executed'),
|
|
97
|
+
LOG_TYPE.SDK_DEBUG
|
|
98
|
+
);
|
|
99
|
+
resolve(true);
|
|
100
|
+
} catch (error) {
|
|
75
101
|
Logger.getInstance().logEvent(
|
|
76
102
|
'executeBulkQuery err: ',
|
|
77
103
|
JSON.stringify(error),
|
|
78
104
|
LOG_TYPE.SDK_ERROR
|
|
79
105
|
);
|
|
80
106
|
reject(error);
|
|
81
|
-
// return false;
|
|
82
|
-
},
|
|
83
|
-
() => {
|
|
84
|
-
Logger.getInstance().logEvent(
|
|
85
|
-
'executeBulkQuery success: ',
|
|
86
|
-
JSON.stringify(_sqlResultSet),
|
|
87
|
-
LOG_TYPE.SDK_DEBUG
|
|
88
|
-
);
|
|
89
|
-
resolve(true);
|
|
90
107
|
}
|
|
91
|
-
);
|
|
92
|
-
}
|
|
108
|
+
});
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
/**
|
|
112
|
+
* Executes an array of SQL DML statements.
|
|
113
|
+
*
|
|
114
|
+
* @param {Array<{query: string, args: any[]}>} input - The array of queries to execute.
|
|
115
|
+
* @return {Promise<SQLResultSet>} A promise that resolves with the SQL result set.
|
|
116
|
+
*/
|
|
117
|
+
executeStatementsInTxn(input: { sqlSmt: string; args: any[] }[]): Promise<SQLResultSet[]> {
|
|
118
|
+
return new Promise(async (resolve, reject) => {
|
|
119
|
+
if (input.some((_i) => isEmptyOrBlank(_i.sqlSmt))) {
|
|
120
|
+
reject(new Error('Statement is null or empty'));
|
|
121
|
+
return;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
try {
|
|
125
|
+
const resultSet: SQLResultSet[] = [];
|
|
126
|
+
|
|
127
|
+
await this.db.withExclusiveTransactionAsync(async () => {
|
|
128
|
+
for (const item of input) {
|
|
129
|
+
const result = await this.db.runAsync(item.sqlSmt, item.args);
|
|
130
|
+
const sqlResultSet: SQLResultSet = {
|
|
131
|
+
insertId: result.lastInsertRowId,
|
|
132
|
+
rowsAffected: result.changes,
|
|
133
|
+
rows: {
|
|
134
|
+
_array: [],
|
|
135
|
+
length: 0,
|
|
136
|
+
item: (index: number) => null
|
|
137
|
+
}
|
|
138
|
+
};
|
|
139
|
+
resultSet.push(sqlResultSet);
|
|
140
|
+
}
|
|
141
|
+
});
|
|
142
|
+
|
|
143
|
+
resolve(resultSet);
|
|
144
|
+
} catch (error) {
|
|
145
|
+
reject(error);
|
|
146
|
+
}
|
|
147
|
+
});
|
|
148
|
+
}
|
|
93
149
|
}
|
|
150
|
+
|
|
151
|
+
const Database = SQLDatabase.getInstance();
|
|
152
|
+
export default Database;
|