@tap-payments/auth-jsconnect 2.10.12-beta → 2.10.12-development

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 (176) hide show
  1. package/README.md +2 -2
  2. package/build/@types/app.d.ts +4 -2
  3. package/build/@types/app.js +2 -0
  4. package/build/@types/form.d.ts +3 -0
  5. package/build/@types/index.d.ts +1 -0
  6. package/build/@types/index.js +1 -0
  7. package/build/@types/terminal.d.ts +116 -0
  8. package/build/@types/terminal.js +1 -0
  9. package/build/api/auth.d.ts +10 -1
  10. package/build/api/index.d.ts +7 -1
  11. package/build/api/index.js +3 -1
  12. package/build/api/terminal.d.ts +28 -0
  13. package/build/api/terminal.js +45 -0
  14. package/build/app/rootReducer.d.ts +1 -0
  15. package/build/app/rootReducer.js +3 -1
  16. package/build/app/settings.d.ts +1 -0
  17. package/build/app/settings.js +7 -3
  18. package/build/app/store.d.ts +2 -0
  19. package/build/assets/currencies/AEDSymbol.d.ts +7 -0
  20. package/build/assets/currencies/AEDSymbol.js +28 -0
  21. package/build/assets/currencies/SARSymbol.d.ts +7 -0
  22. package/build/assets/currencies/SARSymbol.js +28 -0
  23. package/build/assets/currencies/index.d.ts +2 -0
  24. package/build/assets/currencies/index.js +2 -0
  25. package/build/assets/currencies/utils.d.ts +4 -0
  26. package/build/assets/currencies/utils.js +6 -0
  27. package/build/assets/locales/ar.json +43 -6
  28. package/build/assets/locales/en.json +46 -9
  29. package/build/components/DeviceCard/DeviceCard.d.ts +18 -0
  30. package/build/components/DeviceCard/DeviceCard.js +103 -0
  31. package/build/components/DeviceCard/index.d.ts +3 -0
  32. package/build/components/DeviceCard/index.js +2 -0
  33. package/build/components/OTPTimer/OTPTimer.d.ts +2 -1
  34. package/build/components/OTPTimer/OTPTimer.js +4 -4
  35. package/build/components/TextWithCurrency/TextWithCurrency.d.ts +7 -0
  36. package/build/components/TextWithCurrency/TextWithCurrency.js +14 -0
  37. package/build/components/TextWithCurrency/index.d.ts +2 -0
  38. package/build/components/TextWithCurrency/index.js +2 -0
  39. package/build/components/Tooltip/Tooltip.js +1 -1
  40. package/build/constants/api.d.ts +0 -1
  41. package/build/constants/api.js +0 -2
  42. package/build/constants/app.d.ts +14 -3
  43. package/build/constants/app.js +128 -6
  44. package/build/constants/assets.d.ts +11 -6
  45. package/build/constants/assets.js +118 -107
  46. package/build/constants/dummy.js +27 -20
  47. package/build/constants/flows.d.ts +15 -0
  48. package/build/constants/flows.js +15 -0
  49. package/build/constants/validation.d.ts +1 -0
  50. package/build/constants/validation.js +1 -0
  51. package/build/features/app/auth/authStore.d.ts +24 -5
  52. package/build/features/app/auth/authStore.js +136 -71
  53. package/build/features/app/connectExpress/connectExpressStore.js +38 -19
  54. package/build/features/app/individual/individualStore.js +0 -1
  55. package/build/features/app/tax/taxStore.js +1 -1
  56. package/build/features/app/terminal/terminalStore.d.ts +110 -0
  57. package/build/features/app/terminal/terminalStore.js +676 -0
  58. package/build/features/auth/screens/OTP/OTP.d.ts +13 -2
  59. package/build/features/auth/screens/OTP/OTP.js +15 -3
  60. package/build/features/auth/screens/OTP/index.d.ts +1 -2
  61. package/build/features/auth/screens/Passcode/Passcode.d.ts +16 -0
  62. package/build/features/auth/screens/Passcode/Passcode.js +82 -0
  63. package/build/features/auth/screens/Passcode/PasscodeInput.d.ts +6 -0
  64. package/build/features/auth/screens/Passcode/PasscodeInput.js +42 -0
  65. package/build/features/auth/screens/Passcode/index.d.ts +2 -0
  66. package/build/features/auth/screens/Passcode/index.js +2 -0
  67. package/build/features/auth/screens/Passcode/validation.d.ts +8 -0
  68. package/build/features/auth/screens/Passcode/validation.js +4 -0
  69. package/build/features/brand/screens/BrandActivities/ExpectedSalesRange.js +3 -8
  70. package/build/features/business/screens/Customers/ExpectedSalesRange.js +3 -8
  71. package/build/features/entity/screens/EntityCapital/CapitalPaid.js +3 -7
  72. package/build/features/entity/screens/EntityCapital/CapitalShareValue.js +3 -7
  73. package/build/features/featuresScreens.d.ts +1 -0
  74. package/build/features/featuresScreens.js +72 -0
  75. package/build/features/individual/screens/AdditionalIndividualInfo/MonthlyIncome.js +3 -8
  76. package/build/features/individual/screens/AdditionalIndividualInfo/ShareValue.js +3 -8
  77. package/build/features/shared/Background/LogoBackground.js +1 -1
  78. package/build/features/shared/Button/Button.js +2 -3
  79. package/build/features/shared/Button/FlowsButtons.js +1 -1
  80. package/build/features/shared/Input/Input.d.ts +1 -1
  81. package/build/features/shared/PushNotification/PushNotification.d.ts +11 -0
  82. package/build/features/shared/PushNotification/PushNotification.js +34 -0
  83. package/build/features/shared/PushNotification/index.d.ts +2 -0
  84. package/build/features/shared/PushNotification/index.js +2 -0
  85. package/build/features/shared/SuccessFlowButtons/SuccessFlowButtons.js +2 -2
  86. package/build/features/shared/SuccessScreen/SuccessScreen.d.ts +3 -1
  87. package/build/features/shared/SuccessScreen/SuccessScreen.js +2 -2
  88. package/build/features/terminal/Terminal.d.ts +14 -0
  89. package/build/features/terminal/Terminal.js +95 -0
  90. package/build/features/terminal/index.d.ts +1 -0
  91. package/build/features/terminal/index.js +1 -0
  92. package/build/features/terminal/screens/LinkNewTerminal/LinkNewTerminal.d.ts +3 -0
  93. package/build/features/terminal/screens/LinkNewTerminal/LinkNewTerminal.js +69 -0
  94. package/build/features/terminal/screens/LinkNewTerminal/index.d.ts +2 -0
  95. package/build/features/terminal/screens/LinkNewTerminal/index.js +2 -0
  96. package/build/features/terminal/screens/LinkNewTerminal/styles.d.ts +10 -0
  97. package/build/features/terminal/screens/LinkNewTerminal/styles.js +28 -0
  98. package/build/features/terminal/screens/LinkedSuccess/LinkedSuccess.d.ts +3 -0
  99. package/build/features/terminal/screens/LinkedSuccess/LinkedSuccess.js +51 -0
  100. package/build/features/terminal/screens/LinkedSuccess/index.d.ts +2 -0
  101. package/build/features/terminal/screens/LinkedSuccess/index.js +2 -0
  102. package/build/features/terminal/screens/LinkedTerminalInfo/LinkedTerminalInfo.d.ts +3 -0
  103. package/build/features/terminal/screens/LinkedTerminalInfo/LinkedTerminalInfo.js +55 -0
  104. package/build/features/terminal/screens/LinkedTerminalInfo/index.d.ts +2 -0
  105. package/build/features/terminal/screens/LinkedTerminalInfo/index.js +2 -0
  106. package/build/features/terminal/screens/Loading/Loading.d.ts +4 -0
  107. package/build/features/terminal/screens/Loading/Loading.js +10 -0
  108. package/build/features/terminal/screens/Loading/index.d.ts +2 -0
  109. package/build/features/terminal/screens/Loading/index.js +2 -0
  110. package/build/features/terminal/screens/NoTerminalDeviceLinked/NoTerminalDeviceLinked.d.ts +3 -0
  111. package/build/features/terminal/screens/NoTerminalDeviceLinked/NoTerminalDeviceLinked.js +56 -0
  112. package/build/features/terminal/screens/NoTerminalDeviceLinked/index.d.ts +2 -0
  113. package/build/features/terminal/screens/NoTerminalDeviceLinked/index.js +2 -0
  114. package/build/features/terminal/screens/NoTerminalDeviceLinked/styles.d.ts +36 -0
  115. package/build/features/terminal/screens/NoTerminalDeviceLinked/styles.js +34 -0
  116. package/build/features/terminal/screens/OperatorError/OperatorError.d.ts +5 -0
  117. package/build/features/terminal/screens/OperatorError/OperatorError.js +9 -0
  118. package/build/features/terminal/screens/OperatorError/index.d.ts +2 -0
  119. package/build/features/terminal/screens/OperatorError/index.js +2 -0
  120. package/build/features/terminal/screens/ResetPasswordSuccess/ResetPasswordSuccess.d.ts +3 -0
  121. package/build/features/terminal/screens/ResetPasswordSuccess/ResetPasswordSuccess.js +21 -0
  122. package/build/features/terminal/screens/ResetPasswordSuccess/index.d.ts +2 -0
  123. package/build/features/terminal/screens/ResetPasswordSuccess/index.js +2 -0
  124. package/build/features/terminal/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.d.ts +3 -0
  125. package/build/features/terminal/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +31 -0
  126. package/build/features/terminal/screens/SuccessWithFlowButtons/index.d.ts +2 -0
  127. package/build/features/terminal/screens/SuccessWithFlowButtons/index.js +2 -0
  128. package/build/features/terminal/screens/TerminalDeviceList/DeviceList.d.ts +9 -0
  129. package/build/features/terminal/screens/TerminalDeviceList/DeviceList.js +20 -0
  130. package/build/features/terminal/screens/TerminalDeviceList/TerminalDeviceList.d.ts +3 -0
  131. package/build/features/terminal/screens/TerminalDeviceList/TerminalDeviceList.js +153 -0
  132. package/build/features/terminal/screens/TerminalDeviceList/index.d.ts +2 -0
  133. package/build/features/terminal/screens/TerminalDeviceList/index.js +2 -0
  134. package/build/features/terminal/screens/TerminalDeviceList/styles.d.ts +9 -0
  135. package/build/features/terminal/screens/TerminalDeviceList/styles.js +13 -0
  136. package/build/features/terminal/screens/TerminalListPage/TerminalListPage.d.ts +3 -0
  137. package/build/features/terminal/screens/TerminalListPage/TerminalListPage.js +47 -0
  138. package/build/features/terminal/screens/TerminalListPage/index.d.ts +2 -0
  139. package/build/features/terminal/screens/TerminalListPage/index.js +2 -0
  140. package/build/features/terminal/screens/UnlinkedSuccess/UnlinkedSuccess.d.ts +3 -0
  141. package/build/features/terminal/screens/UnlinkedSuccess/UnlinkedSuccess.js +53 -0
  142. package/build/features/terminal/screens/UnlinkedSuccess/index.d.ts +2 -0
  143. package/build/features/terminal/screens/UnlinkedSuccess/index.js +2 -0
  144. package/build/features/terminal/screens/UnlinkedTerminalInfo/UnlinkedTerminalInfo.d.ts +3 -0
  145. package/build/features/terminal/screens/UnlinkedTerminalInfo/UnlinkedTerminalInfo.js +98 -0
  146. package/build/features/terminal/screens/UnlinkedTerminalInfo/index.d.ts +2 -0
  147. package/build/features/terminal/screens/UnlinkedTerminalInfo/index.js +2 -0
  148. package/build/features/terminal/screens/UnlinkedTerminalInfo/styles.d.ts +26 -0
  149. package/build/features/terminal/screens/UnlinkedTerminalInfo/styles.js +30 -0
  150. package/build/features/terminal/screens/Verify/OTPInput.d.ts +7 -0
  151. package/build/features/terminal/screens/Verify/OTPInput.js +51 -0
  152. package/build/features/terminal/screens/Verify/Verify.d.ts +5 -0
  153. package/build/features/terminal/screens/Verify/Verify.js +85 -0
  154. package/build/features/terminal/screens/Verify/index.d.ts +2 -0
  155. package/build/features/terminal/screens/Verify/index.js +2 -0
  156. package/build/features/terminal/screens/Verify/validation.d.ts +8 -0
  157. package/build/features/terminal/screens/Verify/validation.js +4 -0
  158. package/build/features/terminal/screens/shared/Header.d.ts +10 -0
  159. package/build/features/terminal/screens/shared/Header.js +30 -0
  160. package/build/features/terminal/screens/shared/TerminalList.d.ts +11 -0
  161. package/build/features/terminal/screens/shared/TerminalList.js +25 -0
  162. package/build/features/terminal/screens/shared/index.d.ts +5 -0
  163. package/build/features/terminal/screens/shared/index.js +5 -0
  164. package/build/features/terminal/screens/shared/styles.d.ts +196 -0
  165. package/build/features/terminal/screens/shared/styles.js +155 -0
  166. package/build/features/terminal/screens/shared/utils.d.ts +7 -0
  167. package/build/features/terminal/screens/shared/utils.js +24 -0
  168. package/build/hooks/useAppDispatch.d.ts +1 -0
  169. package/build/index.d.ts +3 -2
  170. package/build/index.js +4 -2
  171. package/build/theme/palette.js +12 -0
  172. package/build/theme/typography.js +4 -0
  173. package/build/utils/common.js +4 -4
  174. package/build/utils/string.d.ts +3 -2
  175. package/build/utils/string.js +10 -1
  176. package/package.json +2 -2
@@ -1,3 +1,10 @@
1
+ import { ASSETS_DASHBOARD_FULL_PATH, BACKEND_ICONS_FULL_PATH, PNG_ICON_EXTENSION, SVG_ICON_EXTENSION } from './assets';
2
+ var getCountryLogoSVGPath = function (country) {
3
+ return "".concat(ASSETS_DASHBOARD_FULL_PATH, "/country/").concat(country).concat(SVG_ICON_EXTENSION);
4
+ };
5
+ var getCountryLogoPNGPath = function (country) {
6
+ return "".concat(BACKEND_ICONS_FULL_PATH, "/country/png/").concat(country).concat(PNG_ICON_EXTENSION);
7
+ };
1
8
  export var OTHER_BRAND = {
2
9
  id: 'other',
3
10
  code: 'other',
@@ -358,7 +365,7 @@ export var defaultCountry = {
358
365
  capital: 'Riyadh',
359
366
  geoNameId: '102358',
360
367
  idd_prefix: 966,
361
- logo: 'https://back-end.b-cdn.net/country/png/SA.png',
368
+ logo: getCountryLogoPNGPath('SA'),
362
369
  digits: 10,
363
370
  supported_by_tap: true,
364
371
  min_digits: 10,
@@ -608,7 +615,7 @@ export var BUSINESS_COUNTRIES = [
608
615
  iso2: 'SA',
609
616
  iso3: 'SAU',
610
617
  idd_prefix: '966',
611
- logo: 'https://tap-assets.b-cdn.net/icons/dashboard/light/country/SA.svg',
618
+ logo: getCountryLogoSVGPath('SA'),
612
619
  min_digits: 10,
613
620
  max_digits: 10
614
621
  }
@@ -623,7 +630,7 @@ export var BUSINESS_COUNTRIES = [
623
630
  iso2: 'BH',
624
631
  iso3: 'BHR',
625
632
  idd_prefix: '973',
626
- logo: 'https://tap-assets.b-cdn.net/icons/dashboard/light/country/BH.svg',
633
+ logo: getCountryLogoSVGPath('BH'),
627
634
  min_digits: 8,
628
635
  max_digits: 8
629
636
  }
@@ -638,7 +645,7 @@ export var BUSINESS_COUNTRIES = [
638
645
  iso2: 'EG',
639
646
  iso3: 'EGY',
640
647
  idd_prefix: '20',
641
- logo: 'https://tap-assets.b-cdn.net/icons/dashboard/light/country/EG.svg',
648
+ logo: getCountryLogoSVGPath('EG'),
642
649
  min_digits: 10,
643
650
  max_digits: 10
644
651
  }
@@ -653,7 +660,7 @@ export var BUSINESS_COUNTRIES = [
653
660
  iso2: 'JO',
654
661
  iso3: 'JOR',
655
662
  idd_prefix: '962',
656
- logo: 'https://tap-assets.b-cdn.net/icons/dashboard/light/country/JO.svg',
663
+ logo: getCountryLogoSVGPath('JO'),
657
664
  min_digits: 9,
658
665
  max_digits: 9
659
666
  }
@@ -668,7 +675,7 @@ export var BUSINESS_COUNTRIES = [
668
675
  iso2: 'KW',
669
676
  iso3: 'KWT',
670
677
  idd_prefix: '965',
671
- logo: 'https://tap-assets.b-cdn.net/icons/dashboard/light/country/KW.svg',
678
+ logo: getCountryLogoSVGPath('KW'),
672
679
  min_digits: 8,
673
680
  max_digits: 8
674
681
  }
@@ -683,7 +690,7 @@ export var BUSINESS_COUNTRIES = [
683
690
  iso2: 'LB',
684
691
  iso3: 'LBN',
685
692
  idd_prefix: '961',
686
- logo: 'https://tap-assets.b-cdn.net/icons/dashboard/light/country/LB.svg',
693
+ logo: getCountryLogoSVGPath('LB'),
687
694
  min_digits: 7,
688
695
  max_digits: 8
689
696
  }
@@ -698,7 +705,7 @@ export var BUSINESS_COUNTRIES = [
698
705
  iso2: 'OM',
699
706
  iso3: 'OMN',
700
707
  idd_prefix: '968',
701
- logo: 'https://tap-assets.b-cdn.net/icons/dashboard/light/country/OM.svg',
708
+ logo: getCountryLogoSVGPath('OM'),
702
709
  min_digits: 7,
703
710
  max_digits: 8
704
711
  }
@@ -713,7 +720,7 @@ export var BUSINESS_COUNTRIES = [
713
720
  iso2: 'QA',
714
721
  iso3: 'QAT',
715
722
  idd_prefix: '974',
716
- logo: 'https://tap-assets.b-cdn.net/icons/dashboard/light/country/QA.svg',
723
+ logo: getCountryLogoSVGPath('QA'),
717
724
  min_digits: 8,
718
725
  max_digits: 8
719
726
  }
@@ -728,7 +735,7 @@ export var BUSINESS_COUNTRIES = [
728
735
  iso2: 'AE',
729
736
  iso3: 'ARE',
730
737
  idd_prefix: '971',
731
- logo: 'https://tap-assets.b-cdn.net/icons/dashboard/light/country/AE.svg',
738
+ logo: getCountryLogoSVGPath('AE'),
732
739
  min_digits: 9,
733
740
  max_digits: 9
734
741
  }
@@ -750,7 +757,7 @@ export var BUSINESS_COUNTRIES = [
750
757
  iso2: 'GB',
751
758
  iso3: 'GBR',
752
759
  idd_prefix: '44',
753
- logo: 'https://tap-assets.b-cdn.net/icons/dashboard/light/country/GB.svg',
760
+ logo: getCountryLogoSVGPath('GB'),
754
761
  min_digits: 10,
755
762
  max_digits: 10
756
763
  }
@@ -765,7 +772,7 @@ export var BUSINESS_COUNTRIES = [
765
772
  iso2: 'IE',
766
773
  iso3: 'IRL',
767
774
  idd_prefix: '353',
768
- logo: 'https://tap-assets.b-cdn.net/icons/dashboard/light/country/IE.svg',
775
+ logo: getCountryLogoSVGPath('IE'),
769
776
  min_digits: 10,
770
777
  max_digits: 10
771
778
  }
@@ -780,7 +787,7 @@ export var BUSINESS_COUNTRIES = [
780
787
  iso2: 'FR',
781
788
  iso3: 'FRA',
782
789
  idd_prefix: '33',
783
- logo: 'https://tap-assets.b-cdn.net/icons/dashboard/light/country/FR.svg',
790
+ logo: getCountryLogoSVGPath('FR'),
784
791
  min_digits: 9,
785
792
  max_digits: 9
786
793
  }
@@ -795,7 +802,7 @@ export var BUSINESS_COUNTRIES = [
795
802
  iso2: 'NL',
796
803
  iso3: 'NLD',
797
804
  idd_prefix: '31',
798
- logo: 'https://tap-assets.b-cdn.net/icons/dashboard/light/country/NL.svg',
805
+ logo: getCountryLogoSVGPath('NL'),
799
806
  min_digits: 9,
800
807
  max_digits: 9
801
808
  }
@@ -810,7 +817,7 @@ export var BUSINESS_COUNTRIES = [
810
817
  iso2: 'DE',
811
818
  iso3: 'DEU',
812
819
  idd_prefix: '49',
813
- logo: 'https://tap-assets.b-cdn.net/icons/dashboard/light/country/DE.svg',
820
+ logo: getCountryLogoSVGPath('DE'),
814
821
  min_digits: 11,
815
822
  max_digits: 11
816
823
  }
@@ -825,7 +832,7 @@ export var BUSINESS_COUNTRIES = [
825
832
  iso2: 'ES',
826
833
  iso3: 'ESP',
827
834
  idd_prefix: '34',
828
- logo: 'https://tap-assets.b-cdn.net/icons/dashboard/light/country/ES.svg',
835
+ logo: getCountryLogoSVGPath('ES'),
829
836
  min_digits: 9,
830
837
  max_digits: 9
831
838
  }
@@ -840,7 +847,7 @@ export var BUSINESS_COUNTRIES = [
840
847
  iso2: 'IT',
841
848
  iso3: 'ITA',
842
849
  idd_prefix: '39',
843
- logo: 'https://tap-assets.b-cdn.net/icons/dashboard/light/country/IT.svg',
850
+ logo: getCountryLogoSVGPath('IT'),
844
851
  min_digits: 11,
845
852
  max_digits: 11
846
853
  }
@@ -862,7 +869,7 @@ export var BUSINESS_COUNTRIES = [
862
869
  iso2: 'PK',
863
870
  iso3: 'PAK',
864
871
  idd_prefix: '92',
865
- logo: 'https://tap-assets.b-cdn.net/icons/dashboard/light/country/PK.svg',
872
+ logo: getCountryLogoSVGPath('PK'),
866
873
  min_digits: 10,
867
874
  max_digits: 10
868
875
  }
@@ -877,7 +884,7 @@ export var BUSINESS_COUNTRIES = [
877
884
  iso2: 'IN',
878
885
  iso3: 'IND',
879
886
  idd_prefix: '91',
880
- logo: 'https://tap-assets.b-cdn.net/icons/dashboard/light/country/IN.svg',
887
+ logo: getCountryLogoSVGPath('IN'),
881
888
  min_digits: 10,
882
889
  max_digits: 10
883
890
  }
@@ -899,7 +906,7 @@ export var BUSINESS_COUNTRIES = [
899
906
  iso2: 'SG',
900
907
  iso3: 'SGP',
901
908
  idd_prefix: '65',
902
- logo: 'https://tap-assets.b-cdn.net/icons/dashboard/light/country/SG.svg',
909
+ logo: getCountryLogoSVGPath('SG'),
903
910
  min_digits: 8,
904
911
  max_digits: 8
905
912
  }
@@ -23,4 +23,19 @@ export declare const CONNECT_FLOWS: {
23
23
  verifyNafath: KYC_FLOWS;
24
24
  success: KYC_FLOWS;
25
25
  };
26
+ terminal: {
27
+ loadingData: string;
28
+ operatorError: string;
29
+ verify: string;
30
+ noTerminalLinked: string;
31
+ terminalDeviceList: string;
32
+ terminalLinkNew: string;
33
+ linkedTerminalInfo: string;
34
+ unlinkedTerminalInfo: string;
35
+ terminalLinkedSuccess: string;
36
+ terminalUnlinkedSuccess: string;
37
+ board: string;
38
+ resetPassword: string;
39
+ terminalList: string;
40
+ };
26
41
  };
@@ -23,5 +23,20 @@ export var CONNECT_FLOWS = {
23
23
  verifyPACI: KYC_FLOWS.verifyPACI,
24
24
  verifyNafath: KYC_FLOWS.verifyNafath,
25
25
  success: KYC_FLOWS.success
26
+ },
27
+ terminal: {
28
+ loadingData: 'TERMINAL_LOADING_DATA_STEP',
29
+ operatorError: 'TERMINAL_OPERATOR_ERROR_STEP',
30
+ verify: 'TERMINAL_VERIFY_OTP_STEP',
31
+ noTerminalLinked: 'TERMINAL_NO_TERMINAL_LINKED',
32
+ terminalDeviceList: 'TERMINAL_DEVICE_LIST_STEP',
33
+ terminalLinkNew: 'TERMINAL_LINK_NEW_STEP',
34
+ linkedTerminalInfo: 'TERMINAL_LINKED_INFO_STEP',
35
+ unlinkedTerminalInfo: 'TERMINAL_UNLINKED_INFO_STEP',
36
+ terminalLinkedSuccess: 'TERMINAL_LINKED_SUCCESS_STEP',
37
+ terminalUnlinkedSuccess: 'TERMINAL_UNLINKED_SUCCESS_STEP',
38
+ board: 'TERMINAL_BOARD_STEP',
39
+ resetPassword: 'TERMINAL_RESET_PASSWORD',
40
+ terminalList: 'TERMINAL_LIST_STEP'
26
41
  }
27
42
  };
@@ -32,3 +32,4 @@ export declare const DIGITS_ONLY: RegExp;
32
32
  export declare const REGEX_PHONE_APP_NAME: RegExp;
33
33
  export declare const REGEX_IBAN: RegExp;
34
34
  export declare const NAFATH_PACI_TIMEOUT_DURATION = 30000;
35
+ export declare const TERMINAL_PUSH_NOTIFICATION_DURATION = 10000000;
@@ -32,3 +32,4 @@ export var DIGITS_ONLY = /^\d+$/;
32
32
  export var REGEX_PHONE_APP_NAME = /^[a-zA-Z0-9[._-]*$/;
33
33
  export var REGEX_IBAN = /^[a-zA-Z]{2}[a-zA-Z0-9]{13,34}$/g;
34
34
  export var NAFATH_PACI_TIMEOUT_DURATION = 30000;
35
+ export var TERMINAL_PUSH_NOTIFICATION_DURATION = 10000000;
@@ -1,23 +1,38 @@
1
1
  import { RootState } from '../../../app/store';
2
- import { ActionState, AuthEmailFormValues, AuthForType, AuthMerchantFormValues, AuthenticationListFormValues, CivilFormValues, CountryCode, DOBFormValues, FlowsTypes, MobileFormValues, NIDFormValues, OTPFormValues, PasswordFormValues, SharedState } from '../../../@types';
2
+ import { ActionState, AuthEmailFormValues, AuthForType, AuthMerchantFormValues, AuthenticationListFormValues, CivilFormValues, CountryCode, DOBFormValues, FlowsTypes, MobileFormValues, NIDFormValues, OTPFormValues, PasscodeFormValues, PasswordFormValues, SharedState } from '../../../@types';
3
3
  export declare const updateBusinessCountry: import("@reduxjs/toolkit").AsyncThunk<any, string, {}>;
4
4
  export declare const retrieveLeadIdentityByIdAsync: import("@reduxjs/toolkit").AsyncThunk<{
5
5
  data: any;
6
6
  countryCode: CountryCode;
7
7
  }, string, {}>;
8
+ interface CreateMobileAuthParams extends MobileFormValues {
9
+ skipPasscode?: boolean;
10
+ }
8
11
  export declare const createMobileAuth: import("@reduxjs/toolkit").AsyncThunk<{
9
12
  response: any;
10
- formData: MobileFormValues;
11
- }, MobileFormValues, {}>;
13
+ formData: {
14
+ mobile: string;
15
+ countryCode: CountryCode;
16
+ termAndConditionChecked?: boolean | undefined;
17
+ };
18
+ skipPasscode: boolean | undefined;
19
+ }, CreateMobileAuthParams, {}>;
12
20
  export declare const resendMobileAuthOTP: import("@reduxjs/toolkit").AsyncThunk<{
13
21
  response: any;
14
22
  formData: MobileFormValues;
15
23
  }, MobileFormValues, {}>;
16
24
  export declare const verifyMobileOtp: import("@reduxjs/toolkit").AsyncThunk<any, OTPFormValues, {}>;
25
+ export declare const verifyPasscode: import("@reduxjs/toolkit").AsyncThunk<any, PasscodeFormValues, {}>;
26
+ interface CreateEmailAuthParams extends AuthEmailFormValues {
27
+ skipPasscode?: boolean;
28
+ }
17
29
  export declare const createEmailAuth: import("@reduxjs/toolkit").AsyncThunk<{
18
30
  response: any;
19
- formData: AuthEmailFormValues;
20
- }, AuthEmailFormValues, {}>;
31
+ formData: {
32
+ email: string;
33
+ };
34
+ skipPasscode: boolean | undefined;
35
+ }, CreateEmailAuthParams, {}>;
21
36
  export declare const verifyEmailPassword: import("@reduxjs/toolkit").AsyncThunk<any, PasswordFormValues, {}>;
22
37
  export declare const resendEmailAuthOTP: import("@reduxjs/toolkit").AsyncThunk<{
23
38
  response: any;
@@ -75,6 +90,10 @@ export interface authData {
75
90
  otpData: OTPFormValues & {
76
91
  authFor?: AuthForType;
77
92
  };
93
+ passcodeData: PasscodeFormValues & {
94
+ skipPasscode?: boolean;
95
+ allowOTPToPasscodeRedirection?: boolean;
96
+ };
78
97
  passwordData: PasswordFormValues;
79
98
  leadId?: string;
80
99
  isStartFromBusinessCountry?: boolean;
@@ -45,6 +45,17 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
45
45
  if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
46
46
  }
47
47
  };
48
+ var __rest = (this && this.__rest) || function (s, e) {
49
+ var t = {};
50
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
51
+ t[p] = s[p];
52
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
53
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
54
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
55
+ t[p[i]] = s[p[i]];
56
+ }
57
+ return t;
58
+ };
48
59
  var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
49
60
  if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
50
61
  if (ar || !(i in from)) {
@@ -113,40 +124,35 @@ export var retrieveLeadIdentityByIdAsync = createAsyncThunk('auth/retrieveLeadId
113
124
  }
114
125
  });
115
126
  }); });
116
- export var createMobileAuth = createAsyncThunk('auth/createMobileAuth', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
117
- var _a, settings, auth, isStartWithZero, mobileNumber, requestBody, data;
118
- var _b, _c, _d;
119
- return __generator(this, function (_e) {
120
- switch (_e.label) {
127
+ export var createMobileAuth = createAsyncThunk('auth/createMobileAuth', function (_a, thunkApi) { var _b, _c, _d; return __awaiter(void 0, void 0, void 0, function () {
128
+ var _e, settings, auth, isStartWithZero, mobileNumber, requestBody, data, stepName;
129
+ var skipPasscode = _a.skipPasscode, params = __rest(_a, ["skipPasscode"]);
130
+ return __generator(this, function (_f) {
131
+ switch (_f.label) {
121
132
  case 0:
122
- _a = thunkApi.getState(), settings = _a.settings, auth = _a.auth;
133
+ _e = thunkApi.getState(), settings = _e.settings, auth = _e.auth;
123
134
  isStartWithZero = (_b = params.mobile) === null || _b === void 0 ? void 0 : _b.startsWith('0');
124
135
  mobileNumber = isStartWithZero ? params.mobile.slice(1) : params.mobile;
125
- requestBody = {
126
- country: settings.data.businessCountry.iso2,
127
- scope: settings.data.appConfig.scope,
128
- lang: settings.data.language,
129
- lead_id: auth.data.leadId,
130
- user_credentail: {
136
+ requestBody = __assign({ country: settings.data.businessCountry.iso2, scope: settings.data.appConfig.scope, lang: settings.data.language, lead_id: auth.data.leadId, user_credentail: {
131
137
  phone: mobileNumber || '',
132
138
  code: params.countryCode.idd_prefix.toString()
133
- },
134
- sign_in: false,
135
- is_lead: true,
136
- step_name: AUTH_STEP_NAMES.CREATE_AUTH_MOBILE,
137
- encryption_contract: ['user_credentail.phone', 'user_credentail.code']
138
- };
139
+ }, sign_in: false, login: true, is_lead: true, step_name: AUTH_STEP_NAMES.CREATE_AUTH_MOBILE, encryption_contract: ['user_credentail.phone', 'user_credentail.code'] }, (skipPasscode && {
140
+ auth_info: {
141
+ skip_auth_method: true
142
+ }
143
+ }));
139
144
  return [4, API.authService.createAuth(requestBody)];
140
145
  case 1:
141
- data = _e.sent();
142
- thunkApi.dispatch(handleNextScreenStep());
146
+ data = _f.sent();
147
+ stepName = (data === null || data === void 0 ? void 0 : data.auth_type) === AuthTypeNumber.PASSCODE ? 'AUTH_PASSCODE_STEP' : 'AUTH_OTP_STEP';
148
+ thunkApi.dispatch(handleNextScreenStep(stepName));
143
149
  (_d = (_c = settings.data.appConfig).onStepCompleted) === null || _d === void 0 ? void 0 : _d.call(_c, settings.data.activeScreen.name, requestBody.user_credentail);
144
- return [2, { response: data, formData: params }];
150
+ return [2, { response: data, formData: params, skipPasscode: skipPasscode }];
145
151
  }
146
152
  });
147
153
  }); });
148
154
  export var resendMobileAuthOTP = createAsyncThunk('auth/resendMobileAuthOTP', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
149
- var _a, settings, auth, isStartWithZero, mobileNumber, requestBody, data;
155
+ var _a, settings, auth, isStartWithZero, mobileNumber, skipPasscode, requestBody, data;
150
156
  var _b;
151
157
  return __generator(this, function (_c) {
152
158
  switch (_c.label) {
@@ -154,20 +160,15 @@ export var resendMobileAuthOTP = createAsyncThunk('auth/resendMobileAuthOTP', fu
154
160
  _a = thunkApi.getState(), settings = _a.settings, auth = _a.auth;
155
161
  isStartWithZero = (_b = params.mobile) === null || _b === void 0 ? void 0 : _b.startsWith('0');
156
162
  mobileNumber = isStartWithZero ? params.mobile.slice(1) : params.mobile;
157
- requestBody = {
158
- country: settings.data.businessCountry.iso2,
159
- scope: settings.data.appConfig.scope,
160
- lang: settings.data.language,
161
- lead_id: auth.data.leadId,
162
- user_credentail: {
163
+ skipPasscode = auth.data.passcodeData.skipPasscode;
164
+ requestBody = __assign({ country: settings.data.businessCountry.iso2, scope: settings.data.appConfig.scope, lang: settings.data.language, lead_id: auth.data.leadId, user_credentail: {
163
165
  phone: mobileNumber,
164
166
  code: params.countryCode.idd_prefix.toString()
165
- },
166
- sign_in: false,
167
- is_lead: true,
168
- step_name: AUTH_STEP_NAMES.CREATE_AUTH_MOBILE,
169
- encryption_contract: ['user_credentail.phone', 'user_credentail.code']
170
- };
167
+ }, sign_in: false, login: true, is_lead: true, step_name: AUTH_STEP_NAMES.CREATE_AUTH_MOBILE, encryption_contract: ['user_credentail.phone', 'user_credentail.code'] }, (skipPasscode && {
168
+ auth_info: {
169
+ skip_auth_method: true
170
+ }
171
+ }));
171
172
  return [4, API.authService.createAuth(requestBody)];
172
173
  case 1:
173
174
  data = _c.sent();
@@ -218,37 +219,79 @@ export var verifyMobileOtp = createAsyncThunk('auth/verifyMobileOtp', function (
218
219
  }
219
220
  });
220
221
  }); });
221
- export var createEmailAuth = createAsyncThunk('auth/createEmailAuth', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
222
- var _a, settings, auth, requestBody, data, screen;
223
- var _b, _c;
224
- return __generator(this, function (_d) {
225
- switch (_d.label) {
222
+ export var verifyPasscode = createAsyncThunk('auth/verifyPasscode', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
223
+ var _a, settings, auth, _b, responseData, leadId, _c, auth_token, device_token, service_name, auth_type, sign_in, scope, payload, data, stepName_1;
224
+ var _d, _e, _f, _g, _h, _j;
225
+ return __generator(this, function (_k) {
226
+ switch (_k.label) {
226
227
  case 0:
227
228
  _a = thunkApi.getState(), settings = _a.settings, auth = _a.auth;
228
- requestBody = {
229
- country: settings.data.businessCountry.iso2,
230
- scope: settings.data.appConfig.scope,
231
- lang: settings.data.language,
232
- lead_id: auth.data.leadId,
233
- user_credentail: {
234
- email: params.email || ''
235
- },
236
- sign_in: true,
237
- is_lead: false,
238
- step_name: AUTH_STEP_NAMES.CREATE_AUTH_EMAIL,
239
- encryption_contract: ['user_credentail.email']
229
+ _b = auth.data || {}, responseData = _b.responseData, leadId = _b.leadId;
230
+ _c = (_d = responseData === null || responseData === void 0 ? void 0 : responseData.authResponse) !== null && _d !== void 0 ? _d : {}, auth_token = _c.auth_token, device_token = _c.device_token, service_name = _c.service_name, auth_type = _c.auth_type, sign_in = _c.sign_in;
231
+ if (!auth_token)
232
+ throw new Error('Auth token is missing');
233
+ scope = settings.data.appConfig.scope;
234
+ payload = {
235
+ auth_token: auth_token,
236
+ lead_id: leadId,
237
+ data: params.passcode,
238
+ auth_type: auth_type,
239
+ device_token: device_token,
240
+ service_name: service_name,
241
+ sign_in: sign_in,
242
+ step_name: AUTH_STEP_NAMES.CREATE_AUTH_PASSCODE,
243
+ encryption_contract: ['data']
240
244
  };
245
+ return [4, API.authService.verifyAuth(payload)];
246
+ case 1:
247
+ data = (_k.sent()).data;
248
+ if ((_e = data.errors) === null || _e === void 0 ? void 0 : _e.length)
249
+ throw new Error(data.errors[0].description);
250
+ if (((_f = data === null || data === void 0 ? void 0 : data.status) === null || _f === void 0 ? void 0 : _f.toLowerCase()) === 'success' && (data === null || data === void 0 ? void 0 : data.auth_session)) {
251
+ if (scope === 'merchant') {
252
+ openConnect(settings.data.appConfig.publicKey, settings.data.businessCountry.iso2);
253
+ return [2, data];
254
+ }
255
+ stepName_1 = 'AUTH_PREPARING_DATA_STEP';
256
+ if ((data === null || data === void 0 ? void 0 : data.auth_type) === AuthTypeNumber.MIGRATION)
257
+ stepName_1 = 'AUTH_MIGRATING_DATA_STEP';
258
+ (_h = (_g = settings.data.appConfig).onStepCompleted) === null || _h === void 0 ? void 0 : _h.call(_g, settings.data.activeScreen.name, params);
259
+ sleep(100).then(function () { return thunkApi.dispatch(handleNextScreenStep(stepName_1)); });
260
+ }
261
+ else if (((_j = data === null || data === void 0 ? void 0 : data.status) === null || _j === void 0 ? void 0 : _j.toLowerCase()) === 'pending') {
262
+ sleep(100).then(function () { return thunkApi.dispatch(handleNextScreenStep('AUTH_OTP_STEP')); });
263
+ }
264
+ return [2, data];
265
+ }
266
+ });
267
+ }); });
268
+ export var createEmailAuth = createAsyncThunk('auth/createEmailAuth', function (_a, thunkApi) { var _b, _c; return __awaiter(void 0, void 0, void 0, function () {
269
+ var _d, settings, auth, requestBody, data, stepName;
270
+ var skipPasscode = _a.skipPasscode, params = __rest(_a, ["skipPasscode"]);
271
+ return __generator(this, function (_e) {
272
+ switch (_e.label) {
273
+ case 0:
274
+ _d = thunkApi.getState(), settings = _d.settings, auth = _d.auth;
275
+ requestBody = __assign({ country: settings.data.businessCountry.iso2, scope: settings.data.appConfig.scope, lang: settings.data.language, lead_id: auth.data.leadId, user_credentail: {
276
+ email: params.email || ''
277
+ }, sign_in: true, login: true, is_lead: false, step_name: AUTH_STEP_NAMES.CREATE_AUTH_EMAIL, encryption_contract: ['user_credentail.email'] }, (skipPasscode && {
278
+ auth_info: {
279
+ skip_auth_method: true
280
+ }
281
+ }));
241
282
  return [4, API.authService.createAuth(requestBody)];
242
283
  case 1:
243
- data = _d.sent();
244
- screen = 'AUTH_PASSWORD_STEP';
284
+ data = _e.sent();
285
+ stepName = 'AUTH_PASSWORD_STEP';
245
286
  if ((data === null || data === void 0 ? void 0 : data.auth_type) === AuthTypeNumber.RESET_PASSWORD)
246
- screen = 'AUTH_RESET_PASSWORD_MESSAGE_STEP';
247
- if ((data === null || data === void 0 ? void 0 : data.auth_type) === AuthTypeNumber.EMAIL_OTP)
248
- screen = 'AUTH_OTP_STEP';
249
- thunkApi.dispatch(handleNextScreenStep(screen));
287
+ stepName = 'AUTH_RESET_PASSWORD_MESSAGE_STEP';
288
+ else if ((data === null || data === void 0 ? void 0 : data.auth_type) === AuthTypeNumber.EMAIL_OTP)
289
+ stepName = 'AUTH_OTP_STEP';
290
+ else if ((data === null || data === void 0 ? void 0 : data.auth_type) === AuthTypeNumber.PASSCODE)
291
+ stepName = 'AUTH_PASSCODE_STEP';
292
+ thunkApi.dispatch(handleNextScreenStep(stepName));
250
293
  (_c = (_b = settings.data.appConfig).onStepCompleted) === null || _c === void 0 ? void 0 : _c.call(_b, settings.data.activeScreen.name, requestBody.user_credentail);
251
- return [2, { response: data, formData: params }];
294
+ return [2, { response: data, formData: params, skipPasscode: skipPasscode }];
252
295
  }
253
296
  });
254
297
  }); });
@@ -296,24 +339,19 @@ export var verifyEmailPassword = createAsyncThunk('auth/verifyEmailPassword', fu
296
339
  });
297
340
  }); });
298
341
  export var resendEmailAuthOTP = createAsyncThunk('auth/resendEmailAuthOTP', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
299
- var _a, settings, auth, requestBody, data;
342
+ var _a, settings, auth, skipPasscode, requestBody, data;
300
343
  return __generator(this, function (_b) {
301
344
  switch (_b.label) {
302
345
  case 0:
303
346
  _a = thunkApi.getState(), settings = _a.settings, auth = _a.auth;
304
- requestBody = {
305
- country: settings.data.businessCountry.iso2,
306
- scope: settings.data.appConfig.scope,
307
- lang: settings.data.language,
308
- lead_id: auth.data.leadId,
309
- user_credentail: {
347
+ skipPasscode = auth.data.passcodeData.skipPasscode;
348
+ requestBody = __assign({ country: settings.data.businessCountry.iso2, scope: settings.data.appConfig.scope, lang: settings.data.language, lead_id: auth.data.leadId, user_credentail: {
310
349
  email: params.email || ''
311
- },
312
- sign_in: true,
313
- is_lead: false,
314
- step_name: AUTH_STEP_NAMES.CREATE_AUTH_EMAIL,
315
- encryption_contract: ['user_credentail.email']
316
- };
350
+ }, sign_in: true, login: true, is_lead: false, step_name: AUTH_STEP_NAMES.CREATE_AUTH_EMAIL, encryption_contract: ['user_credentail.email'] }, (skipPasscode && {
351
+ auth_info: {
352
+ skip_auth_method: true
353
+ }
354
+ }));
317
355
  return [4, API.authService.createAuth(requestBody)];
318
356
  case 1:
319
357
  data = _b.sent();
@@ -861,6 +899,9 @@ var initialState = {
861
899
  otp: '',
862
900
  authFor: AuthForType.MOBILE
863
901
  },
902
+ passcodeData: {
903
+ passcode: ''
904
+ },
864
905
  passwordData: {
865
906
  password: ''
866
907
  },
@@ -955,6 +996,8 @@ export var authSlice = createSlice({
955
996
  state.loading = false;
956
997
  state.data.mobileData = action.payload.formData;
957
998
  state.data.otpData.authFor = AuthForType.MOBILE;
999
+ state.data.passcodeData.skipPasscode = action.payload.skipPasscode;
1000
+ state.data.passcodeData.allowOTPToPasscodeRedirection = action.payload.skipPasscode;
958
1001
  state.data.responseData = __assign(__assign({}, state.data.responseData), { authResponse: action.payload.response });
959
1002
  })
960
1003
  .addCase(createMobileAuth.rejected, function (state, action) {
@@ -981,10 +1024,28 @@ export var authSlice = createSlice({
981
1024
  state.loading = false;
982
1025
  var data = action.payload;
983
1026
  state.data.responseData = __assign(__assign({}, state.data.responseData), { authResponse: __assign(__assign({}, (_a = state.data.responseData) === null || _a === void 0 ? void 0 : _a.authResponse), data) });
1027
+ state.data.passcodeData.skipPasscode = false;
1028
+ state.data.passcodeData.allowOTPToPasscodeRedirection = false;
984
1029
  })
985
1030
  .addCase(verifyMobileOtp.rejected, function (state, action) {
986
1031
  state.loading = false;
987
1032
  state.error = action.error.message;
1033
+ })
1034
+ .addCase(verifyPasscode.pending, function (state) {
1035
+ state.loading = true;
1036
+ state.error = null;
1037
+ })
1038
+ .addCase(verifyPasscode.fulfilled, function (state, action) {
1039
+ var _a, _b;
1040
+ state.loading = false;
1041
+ var data = action.payload;
1042
+ state.data.responseData = __assign(__assign({}, state.data.responseData), { authResponse: __assign(__assign({}, (_a = state.data.responseData) === null || _a === void 0 ? void 0 : _a.authResponse), data) });
1043
+ state.data.passcodeData.skipPasscode = ((_b = data === null || data === void 0 ? void 0 : data.status) === null || _b === void 0 ? void 0 : _b.toLowerCase()) === 'pending';
1044
+ state.data.passcodeData.allowOTPToPasscodeRedirection = false;
1045
+ })
1046
+ .addCase(verifyPasscode.rejected, function (state, action) {
1047
+ state.loading = false;
1048
+ state.error = action.error.message;
988
1049
  })
989
1050
  .addCase(createEmailAuth.pending, function (state) {
990
1051
  state.loading = true;
@@ -994,6 +1055,8 @@ export var authSlice = createSlice({
994
1055
  state.loading = false;
995
1056
  state.data.emailData = action.payload.formData;
996
1057
  state.data.otpData.authFor = AuthForType.EMAIL;
1058
+ state.data.passcodeData.skipPasscode = action.payload.skipPasscode;
1059
+ state.data.passcodeData.allowOTPToPasscodeRedirection = action.payload.skipPasscode;
997
1060
  state.data.responseData = __assign(__assign({}, state.data.responseData), { authResponse: action.payload.response });
998
1061
  })
999
1062
  .addCase(createEmailAuth.rejected, function (state, action) {
@@ -1034,6 +1097,8 @@ export var authSlice = createSlice({
1034
1097
  state.loading = false;
1035
1098
  var data = action.payload;
1036
1099
  state.data.responseData = __assign(__assign({}, state.data.responseData), { authResponse: __assign(__assign({}, (_a = state.data.responseData) === null || _a === void 0 ? void 0 : _a.authResponse), data) });
1100
+ state.data.passcodeData.skipPasscode = false;
1101
+ state.data.passcodeData.allowOTPToPasscodeRedirection = false;
1037
1102
  })
1038
1103
  .addCase(verifyEmailOtp.rejected, function (state, action) {
1039
1104
  state.loading = false;