@tap-payments/auth-jsconnect 2.8.75-sandbox → 2.8.76-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 (101) hide show
  1. package/build/@types/form.d.ts +1 -1
  2. package/build/api/auth.d.ts +13 -0
  3. package/build/api/index.d.ts +2 -2
  4. package/build/api/lead.d.ts +6 -0
  5. package/build/assets/locales/ar.json +10 -1
  6. package/build/assets/locales/en.json +10 -1
  7. package/build/components/Tooltip/Tooltip.js +1 -1
  8. package/build/constants/app.d.ts +1 -1
  9. package/build/constants/app.js +35 -13
  10. package/build/constants/assets.d.ts +2 -0
  11. package/build/constants/assets.js +2 -0
  12. package/build/features/app/auth/authStore.d.ts +5 -15
  13. package/build/features/app/auth/authStore.js +58 -113
  14. package/build/features/app/business/businessStore.d.ts +16 -11
  15. package/build/features/app/business/businessStore.js +58 -44
  16. package/build/features/app/connect/connectStore.d.ts +19 -12
  17. package/build/features/app/connect/connectStore.js +151 -82
  18. package/build/features/app/connectExpress/connectExpressStore.d.ts +10 -33
  19. package/build/features/app/connectExpress/connectExpressStore.js +156 -251
  20. package/build/features/app/individual/individualStore.js +4 -1
  21. package/build/features/auth/screens/AuthSwitch/AuthSwitch.js +2 -2
  22. package/build/features/auth/screens/NID/IDNumber.js +1 -1
  23. package/build/features/auth/screens/NID/NID.js +4 -10
  24. package/build/features/auth/screens/NID/validation.d.ts +0 -3
  25. package/build/features/auth/screens/NID/validation.js +0 -1
  26. package/build/features/auth/screens/OTP/OTP.js +1 -5
  27. package/build/features/auth/screens/OTP/OTPInput.js +2 -13
  28. package/build/features/{connectExpress/screens/IdentityOTP/OTP.d.ts → auth/screens/VerifyNafath/VerifyNafath.d.ts} +2 -2
  29. package/build/features/auth/screens/VerifyNafath/VerifyNafath.js +34 -0
  30. package/build/features/auth/screens/VerifyNafath/index.d.ts +3 -0
  31. package/build/features/auth/screens/VerifyNafath/index.js +2 -0
  32. package/build/features/business/screens/VerifyNafath/VerifyNafath.d.ts +5 -0
  33. package/build/features/business/screens/VerifyNafath/VerifyNafath.js +34 -0
  34. package/build/features/business/screens/VerifyNafath/index.d.ts +3 -0
  35. package/build/features/business/screens/VerifyNafath/index.js +2 -0
  36. package/build/features/connect/screens/Mobile/Mobile.js +2 -2
  37. package/build/features/connect/screens/NID/IDNumber.d.ts +1 -0
  38. package/build/features/connect/screens/NID/IDNumber.js +2 -2
  39. package/build/features/connect/screens/NID/NID.js +5 -11
  40. package/build/features/connect/screens/NID/validation.d.ts +0 -3
  41. package/build/features/connect/screens/NID/validation.js +0 -1
  42. package/build/features/connect/screens/OTP/OTPInput.js +3 -11
  43. package/build/features/connect/screens/VerifyNafath/VerifyNafath.d.ts +5 -0
  44. package/build/features/connect/screens/VerifyNafath/VerifyNafath.js +34 -0
  45. package/build/features/connect/screens/VerifyNafath/index.d.ts +3 -0
  46. package/build/features/connect/screens/VerifyNafath/index.js +2 -0
  47. package/build/features/connectExpress/screens/IdentityVerifyNafath/IdentityVerifyNafath.d.ts +5 -0
  48. package/build/features/connectExpress/screens/IdentityVerifyNafath/IdentityVerifyNafath.js +34 -0
  49. package/build/features/connectExpress/screens/IdentityVerifyNafath/index.d.ts +3 -0
  50. package/build/features/connectExpress/screens/IdentityVerifyNafath/index.js +2 -0
  51. package/build/features/connectExpress/screens/Mobile/Mobile.js +2 -2
  52. package/build/features/connectExpress/screens/NID/IDNumber.d.ts +1 -0
  53. package/build/features/connectExpress/screens/NID/IDNumber.js +2 -2
  54. package/build/features/connectExpress/screens/NID/NID.js +4 -9
  55. package/build/features/connectExpress/screens/NID/validation.d.ts +0 -3
  56. package/build/features/connectExpress/screens/NID/validation.js +0 -2
  57. package/build/features/connectExpress/screens/NIDMissed/NID.js +2 -2
  58. package/build/features/connectExpress/screens/OTP/OTP.js +5 -13
  59. package/build/features/connectExpress/screens/OTP/OTPInput.js +3 -11
  60. package/build/features/connectExpress/screens/VerifyNafath/VerifyNafath.d.ts +5 -0
  61. package/build/features/connectExpress/screens/VerifyNafath/VerifyNafath.js +34 -0
  62. package/build/features/connectExpress/screens/VerifyNafath/index.d.ts +3 -0
  63. package/build/features/connectExpress/screens/VerifyNafath/index.js +2 -0
  64. package/build/features/featuresScreens.js +21 -6
  65. package/build/features/shared/Button/NafathButton.d.ts +7 -0
  66. package/build/features/shared/Button/{AbsherButton.js → NafathButton.js} +13 -3
  67. package/build/features/shared/Button/index.d.ts +2 -2
  68. package/build/features/shared/Button/index.js +2 -2
  69. package/build/features/shared/NafathVerification/NafathVerification.d.ts +13 -0
  70. package/build/features/shared/NafathVerification/NafathVerification.js +92 -0
  71. package/build/features/shared/NafathVerification/VerifyNafathLoading.d.ts +8 -0
  72. package/build/features/shared/NafathVerification/VerifyNafathLoading.js +53 -0
  73. package/build/features/shared/NafathVerification/VerifyNafathSuccess.d.ts +5 -0
  74. package/build/features/shared/NafathVerification/VerifyNafathSuccess.js +8 -0
  75. package/build/features/shared/NafathVerification/index.d.ts +2 -0
  76. package/build/features/shared/NafathVerification/index.js +2 -0
  77. package/build/theme/palette.js +2 -1
  78. package/build/utils/common.js +3 -3
  79. package/package.json +2 -2
  80. package/build/features/auth/screens/NID/DOB.d.ts +0 -6
  81. package/build/features/auth/screens/NID/DOB.js +0 -47
  82. package/build/features/business/screens/OTP/OTP.d.ts +0 -8
  83. package/build/features/business/screens/OTP/OTP.js +0 -90
  84. package/build/features/business/screens/OTP/OTPInput.d.ts +0 -5
  85. package/build/features/business/screens/OTP/OTPInput.js +0 -49
  86. package/build/features/business/screens/OTP/index.d.ts +0 -3
  87. package/build/features/business/screens/OTP/index.js +0 -2
  88. package/build/features/business/screens/OTP/validation.d.ts +0 -8
  89. package/build/features/business/screens/OTP/validation.js +0 -4
  90. package/build/features/connect/screens/NID/DOB.d.ts +0 -5
  91. package/build/features/connect/screens/NID/DOB.js +0 -47
  92. package/build/features/connectExpress/screens/IdentityOTP/OTP.js +0 -88
  93. package/build/features/connectExpress/screens/IdentityOTP/OTPInput.d.ts +0 -5
  94. package/build/features/connectExpress/screens/IdentityOTP/OTPInput.js +0 -56
  95. package/build/features/connectExpress/screens/IdentityOTP/index.d.ts +0 -3
  96. package/build/features/connectExpress/screens/IdentityOTP/index.js +0 -2
  97. package/build/features/connectExpress/screens/IdentityOTP/validation.d.ts +0 -8
  98. package/build/features/connectExpress/screens/IdentityOTP/validation.js +0 -4
  99. package/build/features/connectExpress/screens/NID/DOB.d.ts +0 -6
  100. package/build/features/connectExpress/screens/NID/DOB.js +0 -47
  101. package/build/features/shared/Button/AbsherButton.d.ts +0 -7
@@ -15,7 +15,7 @@ export type PasswordFormValues = {
15
15
  };
16
16
  export type NIDFormValues = {
17
17
  nid: string;
18
- dob: string;
18
+ dob?: any;
19
19
  termAndConditionChecked?: boolean;
20
20
  };
21
21
  export type CivilFormValues = {
@@ -30,6 +30,19 @@ export type CreateAuthBody = {
30
30
  lang?: LanguageMode;
31
31
  lead_id?: string;
32
32
  };
33
+ export type CreateNafathAuthBody = {
34
+ country: string;
35
+ scope: string;
36
+ user_credentail: IDCredential;
37
+ auth_type?: number;
38
+ email_url?: string;
39
+ sign_in?: boolean;
40
+ is_lead?: boolean;
41
+ step_name?: string;
42
+ encryption_contract: Array<string>;
43
+ lang?: LanguageMode;
44
+ lead_id?: string;
45
+ };
33
46
  export type VerifyAuthBody = {
34
47
  auth_token: string;
35
48
  auth_type: number;
@@ -1,6 +1,6 @@
1
1
  import axiosInstance, { setAxiosGlobalHeaders, removeAxiosGlobalHeaders, getAxiosHeaders } from './axios';
2
2
  import { ValidateOperatorBody, ConfirmBody } from './operator';
3
- import { CreateAuthBody, VerifyAuthBody, CreatePasswordBody, VerifyOperationAuthBody, ResetPasswordVerifyAuthBody, VerifyAuthExpressOTPBody, ConfigBody } from './auth';
3
+ import { CreateAuthBody, VerifyAuthBody, CreatePasswordBody, VerifyOperationAuthBody, ResetPasswordVerifyAuthBody, VerifyAuthExpressOTPBody, ConfigBody, CreateNafathAuthBody } from './auth';
4
4
  import { UpdateLeadBody, LeadVerifyBody, CreateLeadBody, LeadOTPVerifyBody, LeadIdentityUpdateBody, ExpressLeadVerifyBody } from './lead';
5
5
  import { CheckEmailBody, CheckBrandBody } from './availabilityServices';
6
6
  import { EntityInfoBody, EntityBankUpdateBody, BankDocumentInfo, UpdateEntityBody, UpdateEntityActivityBody, UpdateEntityCapitalBody, UpdateEntityAOAFileBody, RemoveEntityActivity, MerchantListBody, CreateEntityBody } from './entity';
@@ -161,6 +161,6 @@ declare const API: {
161
161
  getInitialData: (body: InitBody) => Promise<any>;
162
162
  };
163
163
  };
164
- export type { ValidateOperatorBody, CreateAuthBody, ExpressCreateAccountBody, VerifyAuthBody, CreateLeadBody, UpdateLeadBody, LeadVerifyBody, LeadOTPVerifyBody, CheckEmailBody, CheckBrandBody, LeadIdentityUpdateBody, EntityInfoBody, CreateAccountBody, EntityBankUpdateBody, CreatePasswordBody, BrandListBody, VerifyOperationAuthBody, ResetPasswordVerifyAuthBody, UpdateBoardBody, UpdateBrandBody, DataElementBody, UploadFileBody, UpdateEntityBody, DocumentUpdateBody, DocumentInfo, VerifyAuthExpressOTPBody, UpdateIndividualBody, UpdateEntityActivityBody, UpdateEntityCapitalBody, BankDocumentInfo, GetUserListBody, GetIndividualListBody, RequestEmailBody, DocumentBody, UpdateEntityAOAFileBody, InitBody, RemoveBrandActivity, RemoveEntityActivity, UpdateIndividualWithTypeBody, UpdateMultipleIndividualBody, ExpressLeadVerifyBody, ConfirmBody, ConfigBody, MerchantListBody, CreateEntityBody };
164
+ export type { ValidateOperatorBody, CreateAuthBody, ExpressCreateAccountBody, VerifyAuthBody, CreateLeadBody, UpdateLeadBody, LeadVerifyBody, LeadOTPVerifyBody, CheckEmailBody, CheckBrandBody, LeadIdentityUpdateBody, EntityInfoBody, CreateAccountBody, EntityBankUpdateBody, CreatePasswordBody, BrandListBody, VerifyOperationAuthBody, ResetPasswordVerifyAuthBody, UpdateBoardBody, UpdateBrandBody, DataElementBody, UploadFileBody, UpdateEntityBody, DocumentUpdateBody, DocumentInfo, VerifyAuthExpressOTPBody, UpdateIndividualBody, UpdateEntityActivityBody, UpdateEntityCapitalBody, BankDocumentInfo, GetUserListBody, GetIndividualListBody, RequestEmailBody, DocumentBody, UpdateEntityAOAFileBody, InitBody, RemoveBrandActivity, RemoveEntityActivity, UpdateIndividualWithTypeBody, UpdateMultipleIndividualBody, ExpressLeadVerifyBody, ConfirmBody, ConfigBody, MerchantListBody, CreateEntityBody, CreateNafathAuthBody };
165
165
  export { setAxiosGlobalHeaders, removeAxiosGlobalHeaders, axiosInstance, getAxiosHeaders };
166
166
  export default API;
@@ -66,6 +66,12 @@ export type UpdateLeadBody = {
66
66
  type: string;
67
67
  team: string;
68
68
  };
69
+ identification?: {
70
+ id?: string;
71
+ issued_country_code?: string;
72
+ type?: string;
73
+ };
74
+ date_of_birth?: string;
69
75
  };
70
76
  export type LeadVerifyBody = {
71
77
  verify_token: string;
@@ -610,5 +610,14 @@
610
610
  "year": "السنة",
611
611
  "yes": "نعم",
612
612
  "your_brand_details": "تفاصيل علامتك التجارية",
613
- "يرجى التحقق من اسم تطبيق ابل": ""
613
+ "يرجى التحقق من اسم تطبيق ابل": "",
614
+ "nafath_verification_title_wait": "Authenticate with NAFATH app",
615
+ "nafath_verification_title_check": "Authenticate with NAFATH app",
616
+ "nafath_verification_description_wait": "Please go to your NAFATH app and enter the above request number to authenticate.",
617
+ "nafath_verification_description_check": "Please go to your NAFATH app and enter the above request number to authenticate.",
618
+ "open_nafath_app": "Open NAFATH app",
619
+ "nafath_verification_title_error": "We cannot confirm your authentication",
620
+ "nafath_verification_description_error": "Please try again",
621
+ "nafath_verification_redirection_message": "You will be redirected now",
622
+ "nafath_button_label": "Continue with Nafath"
614
623
  }
@@ -637,5 +637,14 @@
637
637
  "website_label": "Website",
638
638
  "year": "Year",
639
639
  "yes": "Yes",
640
- "your_brand_details": "Your brand details"
640
+ "your_brand_details": "Your brand details",
641
+ "nafath_verification_title_wait": "Authenticate with NAFATH app",
642
+ "nafath_verification_title_check": "Authenticate with NAFATH app",
643
+ "nafath_verification_description_wait": "Please go to your NAFATH app and enter the above request number to authenticate.",
644
+ "nafath_verification_description_check": "Please go to your NAFATH app and enter the above request number to authenticate.",
645
+ "open_nafath_app": "Open NAFATH app",
646
+ "nafath_verification_title_error": "We cannot confirm your authentication",
647
+ "nafath_verification_description_error": "Please try again",
648
+ "nafath_verification_redirection_message": "You will be redirected now",
649
+ "nafath_button_label": "Continue with Nafath"
641
650
  }
@@ -33,7 +33,7 @@ var StyledTooltip = styled(function (_a) {
33
33
  var _b;
34
34
  var theme = _a.theme;
35
35
  return (_b = {},
36
- _b["& .".concat(tooltipClasses.tooltip)] = __assign(__assign({ color: alpha(theme.palette.text.primary, 0.5), width: 'fit-content', maxHeight: 'fit-content' }, theme.typography.body2), { fontWeight: theme.typography.fontWeightLight, backgroundColor: theme.palette.secondary.light, border: "1px solid ".concat(alpha(theme.palette.divider, 0.8)), zIndex: 2147483647 }),
36
+ _b["& .".concat(tooltipClasses.tooltip)] = __assign(__assign({ color: alpha(theme.palette.text.primary, 0.5), width: 'fit-content', maxHeight: 'fit-content' }, theme.typography.body2), { fontWeight: theme.typography.fontWeightLight, backgroundColor: theme.palette.secondary.light, border: "1px solid ".concat(alpha(theme.palette.divider, 0.8)) }),
37
37
  _b);
38
38
  });
39
39
  var TextStyled = styled(Text, { shouldForwardProp: function (prop) { return prop !== 'isAr'; } })(function (_a) {
@@ -1,6 +1,5 @@
1
1
  import { ScreenStepNavigation, BusinessType } from '../@types';
2
2
  export declare const CONNECT_DEV_URL = "https://connect.dev.tap.company";
3
- export declare const CONNECT_SANDBOX_URL = "https://connect.sandbox.tap.company";
4
3
  export declare const CONNECT_PROD_URL = "https://connect.tap.company";
5
4
  export declare const CLIENT_ORIGIN: string;
6
5
  export declare const TAP_WEBSITE = "https://www.tap.company/";
@@ -82,6 +81,7 @@ export declare const SERVICE_NAME: {
82
81
  export declare const IDENTIFICATION_TYPE: {
83
82
  NID: string;
84
83
  IQAMA: string;
84
+ NAFATH: string;
85
85
  };
86
86
  export declare const CONNECT_STEP_NAMES: {
87
87
  CREATE_AUTH_MOBILE: string;
@@ -1,6 +1,5 @@
1
1
  import { BusinessType } from '../@types';
2
2
  export var CONNECT_DEV_URL = 'https://connect.dev.tap.company';
3
- export var CONNECT_SANDBOX_URL = 'https://connect.sandbox.tap.company';
4
3
  export var CONNECT_PROD_URL = 'https://connect.tap.company';
5
4
  export var CLIENT_ORIGIN = window.location.origin;
6
5
  export var TAP_WEBSITE = 'https://www.tap.company/';
@@ -24,7 +23,7 @@ export var BACKGROUND_ID = 'auth-js-connect-background';
24
23
  export var CONNECT_SCREENS_NAVIGATION = [
25
24
  {
26
25
  name: 'CONNECT_NID_STEP',
27
- next: 'CONNECT_OTP_STEP',
26
+ next: 'CONNECT_VERIFY_NAFATH_STEP',
28
27
  prev: 'CONNECT_MOBILE_STEP',
29
28
  order: 1
30
29
  },
@@ -58,6 +57,12 @@ export var CONNECT_SCREENS_NAVIGATION = [
58
57
  prev: 'CONNECT_CIVIL_ID_STEP',
59
58
  order: 2
60
59
  },
60
+ {
61
+ name: 'CONNECT_VERIFY_NAFATH_STEP',
62
+ next: 'CONNECT_INDIVIDUAL_STEP',
63
+ prev: 'CONNECT_NID_STEP',
64
+ order: 2
65
+ },
61
66
  {
62
67
  name: 'CONNECT_OTP_STEP',
63
68
  next: 'CONNECT_INDIVIDUAL_STEP',
@@ -92,7 +97,7 @@ export var CONNECT_SCREENS_NAVIGATION = [
92
97
  export var CONNECT_EXPRESS_SCREENS_NAVIGATION = [
93
98
  {
94
99
  name: 'CONNECT_EXPRESS_NID_STEP',
95
- next: 'CONNECT_EXPRESS_OTP_STEP',
100
+ next: 'CONNECT_EXPRESS_VERIFY_NAFATH_STEP',
96
101
  prev: 'CONNECT_EXPRESS_MOBILE_STEP',
97
102
  order: 1
98
103
  },
@@ -120,6 +125,16 @@ export var CONNECT_EXPRESS_SCREENS_NAVIGATION = [
120
125
  prev: '',
121
126
  order: 1
122
127
  },
128
+ {
129
+ name: 'CONNECT_EXPRESS_VERIFY_NAFATH_STEP',
130
+ next: [
131
+ 'CONNECT_EXPRESS_COLLECT_INDIVIDUAL_INFO_STEP',
132
+ 'CONNECT_EXPRESS_WAITING_FOR_CREATING_ACCOUNT_STEP',
133
+ 'CONNECT_EXPRESS_AUTHENTICATION_LIST_STEP'
134
+ ],
135
+ prev: 'CONNECT_EXPRESS_NID_STEP',
136
+ order: 2
137
+ },
123
138
  {
124
139
  name: 'CONNECT_EXPRESS_VERIFY_PACI_STEP',
125
140
  next: [
@@ -139,7 +154,7 @@ export var CONNECT_EXPRESS_SCREENS_NAVIGATION = [
139
154
  'CONNECT_EXPRESS_CIVIL_ID_MISSED_STEP',
140
155
  'CONNECT_EXPRESS_AUTHENTICATION_LIST_STEP'
141
156
  ],
142
- prev: ['CONNECT_EXPRESS_MOBILE_STEP', 'CONNECT_EXPRESS_NID_STEP'],
157
+ prev: 'CONNECT_EXPRESS_MOBILE_STEP',
143
158
  order: 2
144
159
  },
145
160
  {
@@ -150,7 +165,7 @@ export var CONNECT_EXPRESS_SCREENS_NAVIGATION = [
150
165
  },
151
166
  {
152
167
  name: 'CONNECT_EXPRESS_NID_MISSED_STEP',
153
- next: ['CONNECT_EXPRESS_OTP_IDENTITY_STEP', 'CONNECT_EXPRESS_COLLECT_INDIVIDUAL_INFO_STEP'],
168
+ next: ['CONNECT_EXPRESS_IDENTITY_VERIFY_NAFATH_STEP', 'CONNECT_EXPRESS_COLLECT_INDIVIDUAL_INFO_STEP'],
154
169
  prev: 'CONNECT_EXPRESS_MOBILE_STEP',
155
170
  order: 3
156
171
  },
@@ -173,15 +188,15 @@ export var CONNECT_EXPRESS_SCREENS_NAVIGATION = [
173
188
  order: 4
174
189
  },
175
190
  {
176
- name: 'CONNECT_EXPRESS_VERIFY_PACI_IDENTITY_STEP',
191
+ name: 'CONNECT_EXPRESS_IDENTITY_VERIFY_NAFATH_STEP',
177
192
  next: ['CONNECT_EXPRESS_COLLECT_INDIVIDUAL_INFO_STEP', 'CONNECT_EXPRESS_WAITING_FOR_CREATING_ACCOUNT_STEP'],
178
- prev: 'CONNECT_EXPRESS_CIVIL_ID_MISSED_STEP',
193
+ prev: 'CONNECT_EXPRESS_NID_MISSED_STEP',
179
194
  order: 4
180
195
  },
181
196
  {
182
- name: 'CONNECT_EXPRESS_OTP_IDENTITY_STEP',
197
+ name: 'CONNECT_EXPRESS_VERIFY_PACI_IDENTITY_STEP',
183
198
  next: ['CONNECT_EXPRESS_COLLECT_INDIVIDUAL_INFO_STEP', 'CONNECT_EXPRESS_WAITING_FOR_CREATING_ACCOUNT_STEP'],
184
- prev: 'CONNECT_EXPRESS_NID_MISSED_STEP',
199
+ prev: 'CONNECT_EXPRESS_CIVIL_ID_MISSED_STEP',
185
200
  order: 4
186
201
  },
187
202
  {
@@ -236,7 +251,7 @@ export var AUTH_SCREENS_NAVIGATION = [
236
251
  },
237
252
  {
238
253
  name: 'AUTH_NID_STEP',
239
- next: 'AUTH_OTP_STEP',
254
+ next: 'AUTH_NAFATH_VERIFY_STEP',
240
255
  prev: 'AUTH_SWITCH_STEP',
241
256
  order: 1
242
257
  },
@@ -276,6 +291,12 @@ export var AUTH_SCREENS_NAVIGATION = [
276
291
  prev: ['AUTH_MOBILE_STEP', 'AUTH_NID_STEP', 'AUTH_EMAIL_STEP', 'AUTH_PASSWORD_STEP'],
277
292
  order: 2
278
293
  },
294
+ {
295
+ name: 'AUTH_NAFATH_VERIFY_STEP',
296
+ next: 'AUTH_PREPARING_DATA_STEP',
297
+ prev: 'AUTH_NID_STEP',
298
+ order: 2
299
+ },
279
300
  {
280
301
  name: 'AUTH_PASSWORD_STEP',
281
302
  next: ['AUTH_PREPARING_DATA_STEP', 'AUTH_OTP_STEP'],
@@ -367,7 +388,7 @@ export var BUSINESS_SCREENS_NAVIGATION = [
367
388
  },
368
389
  {
369
390
  name: 'BUSINESS_IDBOD_STEP',
370
- next: ['BUSINESS_OTP_STEP', 'BUSINESS_BUSINESS_TYPE_STEP'],
391
+ next: ['BUSINESS_VERIFY_NAFATH_STEP', 'BUSINESS_BUSINESS_TYPE_STEP'],
371
392
  prev: '',
372
393
  order: 2
373
394
  },
@@ -378,7 +399,7 @@ export var BUSINESS_SCREENS_NAVIGATION = [
378
399
  order: 3
379
400
  },
380
401
  {
381
- name: 'BUSINESS_OTP_STEP',
402
+ name: 'BUSINESS_VERIFY_NAFATH_STEP',
382
403
  next: 'BUSINESS_BUSINESS_TYPE_STEP',
383
404
  prev: 'BUSINESS_IDBOD_STEP',
384
405
  order: 3
@@ -850,7 +871,8 @@ export var SERVICE_NAME = {
850
871
  };
851
872
  export var IDENTIFICATION_TYPE = {
852
873
  NID: 'national_id',
853
- IQAMA: 'iqamah'
874
+ IQAMA: 'iqamah',
875
+ NAFATH: 'nafath'
854
876
  };
855
877
  export var CONNECT_STEP_NAMES = {
856
878
  CREATE_AUTH_MOBILE: 'connect_create_auth_mobile',
@@ -41,6 +41,8 @@ export declare const ICONS_NAMES: {
41
41
  TAP_LOGO_TEXT_AR: string;
42
42
  TAP_LOGO_TEXT_EN: string;
43
43
  PACI_VERIFY_ICON: string;
44
+ NAFATH_LOGO: string;
45
+ NAFATH_VERIFY_ICON: string;
44
46
  EXPRESS_ERROR_ICON: string;
45
47
  TAP_EN: string;
46
48
  TAP_AR: string;
@@ -41,6 +41,8 @@ export var ICONS_NAMES = {
41
41
  TAP_LOGO_TEXT_AR: ICONS_FULL_PATH + '/tap-white-text-ar' + ICONS_EXTENSION,
42
42
  TAP_LOGO_TEXT_EN: ICONS_FULL_PATH + '/tap-white-text-en' + ICONS_EXTENSION,
43
43
  PACI_VERIFY_ICON: ICONS_FULL_PATH + '/PACI_verify_icon' + '.png',
44
+ NAFATH_LOGO: 'https://tap-assets.b-cdn.net/icons/connect/light/nafath_button_logo.svg',
45
+ NAFATH_VERIFY_ICON: 'https://tap-assets.b-cdn.net/icons/connect/light/nafath_logo.svg',
44
46
  EXPRESS_ERROR_ICON: ICONS_FULL_PATH + '/EXPRESS_error_icon' + '.svg',
45
47
  TAP_EN: 'https://tap-connecet.b-cdn.net/imgs/tapEN' + ICONS_EXTENSION,
46
48
  TAP_AR: 'https://tap-connecet.b-cdn.net/imgs/tapAR' + ICONS_EXTENSION,
@@ -105,7 +105,7 @@ export declare const verifyEmailOtp: import("@reduxjs/toolkit").AsyncThunk<any,
105
105
  fulfilledMeta?: unknown;
106
106
  rejectedMeta?: unknown;
107
107
  }>;
108
- export declare const createNIDAuth: import("@reduxjs/toolkit").AsyncThunk<{
108
+ export declare const createNafathAuth: import("@reduxjs/toolkit").AsyncThunk<{
109
109
  response: any;
110
110
  formData: NIDFormValues;
111
111
  }, NIDFormValues, {
@@ -118,20 +118,10 @@ export declare const createNIDAuth: import("@reduxjs/toolkit").AsyncThunk<{
118
118
  fulfilledMeta?: unknown;
119
119
  rejectedMeta?: unknown;
120
120
  }>;
121
- export declare const resendNIDAuthOTP: import("@reduxjs/toolkit").AsyncThunk<{
122
- response: any;
123
- formData: NIDFormValues;
124
- }, NIDFormValues, {
125
- state?: unknown;
126
- dispatch?: import("redux").Dispatch<import("redux").AnyAction> | undefined;
127
- extra?: unknown;
128
- rejectValue?: unknown;
129
- serializedErrorType?: unknown;
130
- pendingMeta?: unknown;
131
- fulfilledMeta?: unknown;
132
- rejectedMeta?: unknown;
133
- }>;
134
- export declare const verifyNIDOtp: import("@reduxjs/toolkit").AsyncThunk<any, OTPFormValues, {
121
+ interface verifyNafathParams {
122
+ onSuccess?: () => void;
123
+ }
124
+ export declare const verifyNafath: import("@reduxjs/toolkit").AsyncThunk<any, verifyNafathParams, {
135
125
  state?: unknown;
136
126
  dispatch?: import("redux").Dispatch<import("redux").AnyAction> | undefined;
137
127
  extra?: unknown;
@@ -365,123 +365,76 @@ export var verifyEmailOtp = createAsyncThunk('auth/verifyEmailOtp', function (pa
365
365
  }
366
366
  });
367
367
  }); });
368
- export var createNIDAuth = createAsyncThunk('auth/createNIDAuth', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
369
- var _a, settings, auth, dob, nid, nidType, countryCode, requestBody, data;
370
- var _b, _c;
371
- return __generator(this, function (_d) {
372
- switch (_d.label) {
368
+ export var createNafathAuth = createAsyncThunk('auth/createNafathAuth', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
369
+ var settings, requestBody, data;
370
+ var _a, _b;
371
+ return __generator(this, function (_c) {
372
+ switch (_c.label) {
373
373
  case 0:
374
- _a = thunkApi.getState(), settings = _a.settings, auth = _a.auth;
375
- dob = params.dob, nid = params.nid;
376
- nidType = nid.startsWith('1') ? IDENTIFICATION_TYPE.NID : IDENTIFICATION_TYPE.IQAMA;
377
- countryCode = settings.data.businessCountry.iso2;
374
+ settings = thunkApi.getState().settings;
378
375
  requestBody = {
379
- country: countryCode,
376
+ country: settings.data.businessCountry.iso2,
380
377
  scope: settings.data.appConfig.scope,
381
378
  lang: settings.data.language,
382
- lead_id: auth.data.leadId,
383
379
  user_credentail: {
384
- identification_id: nid,
385
- identification_id_type: nidType,
386
- date_of_birth: dob,
387
- country_code: countryCode
380
+ identification_id: params.nid,
381
+ identification_id_type: IDENTIFICATION_TYPE.NAFATH,
382
+ country_code: settings.data.businessCountry.iso2
388
383
  },
389
384
  sign_in: false,
390
385
  is_lead: true,
391
386
  step_name: AUTH_STEP_NAMES.CREATE_AUTH_NID,
392
- encryption_contract: [
393
- 'user_credentail.country_code',
394
- 'user_credentail.identification_id',
395
- 'user_credentail.identification_id_type',
396
- 'user_credentail.date_of_birth'
397
- ]
387
+ encryption_contract: ['user_credentail.country_code', 'user_credentail.identification_id', 'user_credentail.identification_id_type']
398
388
  };
399
- return [4, API.authService.createAuth(requestBody)];
389
+ return [4, API.authService.createAuthKitNID(requestBody)];
400
390
  case 1:
401
- data = _d.sent();
391
+ data = _c.sent();
402
392
  thunkApi.dispatch(handleNextScreenStep());
403
- (_c = (_b = settings.data.appConfig).onStepCompleted) === null || _c === void 0 ? void 0 : _c.call(_b, settings.data.activeScreen.name, requestBody.user_credentail);
393
+ (_b = (_a = settings.data.appConfig).onStepCompleted) === null || _b === void 0 ? void 0 : _b.call(_a, settings.data.activeScreen.name, requestBody);
404
394
  return [2, { response: data, formData: params }];
405
395
  }
406
396
  });
407
397
  }); });
408
- export var resendNIDAuthOTP = createAsyncThunk('auth/resendNIDAuthOTP', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
409
- var _a, settings, auth, dob, nid, nidType, countryCode, requestBody, data;
410
- return __generator(this, function (_b) {
411
- switch (_b.label) {
412
- case 0:
413
- _a = thunkApi.getState(), settings = _a.settings, auth = _a.auth;
414
- dob = params.dob, nid = params.nid;
415
- nidType = nid.startsWith('1') ? IDENTIFICATION_TYPE.NID : IDENTIFICATION_TYPE.IQAMA;
416
- countryCode = settings.data.businessCountry.iso2;
417
- requestBody = {
418
- country: countryCode,
419
- scope: settings.data.appConfig.scope,
420
- lang: settings.data.language,
421
- lead_id: auth.data.leadId,
422
- user_credentail: {
423
- identification_id: nid,
424
- identification_id_type: nidType,
425
- date_of_birth: dob,
426
- country_code: countryCode
427
- },
428
- sign_in: false,
429
- is_lead: true,
430
- step_name: AUTH_STEP_NAMES.CREATE_AUTH_NID,
431
- encryption_contract: [
432
- 'user_credentail.country_code',
433
- 'user_credentail.identification_id',
434
- 'user_credentail.identification_id_type',
435
- 'user_credentail.date_of_birth'
436
- ]
437
- };
438
- return [4, API.authService.createAuth(requestBody)];
439
- case 1:
440
- data = _b.sent();
441
- return [2, { response: data, formData: params }];
442
- }
443
- });
444
- }); });
445
- export var verifyNIDOtp = createAsyncThunk('auth/verifyNIDOtp', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
446
- var _a, settings, auth, _b, responseData, leadId, _c, auth_token, device_token, service_name, auth_type, sign_in, scope, payload, data;
447
- var _d, _e, _f, _g;
448
- return __generator(this, function (_h) {
449
- switch (_h.label) {
398
+ export var verifyNafath = createAsyncThunk('auth/verifyNafath', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
399
+ var _a, settings, auth, authResponse, expiry, scope, interval, maxCalls, count, data, isSuccess;
400
+ var _b, _c, _d;
401
+ return __generator(this, function (_e) {
402
+ switch (_e.label) {
450
403
  case 0:
451
404
  _a = thunkApi.getState(), settings = _a.settings, auth = _a.auth;
452
- _b = auth.data || {}, responseData = _b.responseData, leadId = _b.leadId;
453
- _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;
454
- if (!auth_token)
455
- throw new Error('Auth token is missing');
405
+ authResponse = (auth.data.responseData || {}).authResponse;
406
+ expiry = (authResponse === null || authResponse === void 0 ? void 0 : authResponse.expiry) || 120;
456
407
  scope = settings.data.appConfig.scope;
457
- payload = {
458
- auth_token: auth_token,
459
- lead_id: leadId,
460
- data: params.otp,
461
- auth_type: auth_type,
462
- device_token: device_token,
463
- service_name: service_name || 'ABSHER',
464
- sign_in: sign_in,
465
- step_name: AUTH_STEP_NAMES.VERIFY_AUTH_NID,
466
- encryption_contract: ['data']
467
- };
468
- return [4, API.authService.verifyAuth(payload)];
408
+ interval = 3;
409
+ maxCalls = Math.floor(expiry / interval);
410
+ count = 1;
411
+ _e.label = 1;
469
412
  case 1:
470
- data = (_h.sent()).data;
471
- if ((_e = data.errors) === null || _e === void 0 ? void 0 : _e.length)
472
- throw new Error(data.errors[0].description);
473
- sendCustomEventToGTM({
474
- event: 'Send Event',
475
- event_category: 'User Registration Flow',
476
- event_action: 'First OTP Success'
477
- });
478
- if (scope === 'merchant') {
479
- openConnect(settings.data.appConfig.publicKey, settings.data.businessCountry.iso2);
413
+ if (!(count <= maxCalls)) return [3, 5];
414
+ if (thunkApi.signal.aborted) {
415
+ return [3, 5];
416
+ }
417
+ return [4, API.authService.getVerifyAuth(authResponse === null || authResponse === void 0 ? void 0 : authResponse.auth_token)];
418
+ case 2:
419
+ data = _e.sent();
420
+ isSuccess = ((_b = data.status) === null || _b === void 0 ? void 0 : _b.toLowerCase()) === 'success';
421
+ if (isSuccess) {
422
+ if (scope === 'merchant') {
423
+ openConnect(settings.data.appConfig.publicKey, settings.data.businessCountry.iso2);
424
+ return [2, data];
425
+ }
426
+ (_d = (_c = settings.data.appConfig).onStepCompleted) === null || _d === void 0 ? void 0 : _d.call(_c, settings.data.activeScreen.name, params);
427
+ sleep(100).then(function () { return thunkApi.dispatch(handleNextScreenStep('AUTH_PREPARING_DATA_STEP')); });
480
428
  return [2, data];
481
429
  }
482
- (_g = (_f = settings.data.appConfig).onStepCompleted) === null || _g === void 0 ? void 0 : _g.call(_f, settings.data.activeScreen.name, params);
483
- sleep(100).then(function () { return thunkApi.dispatch(handleNextScreenStep('AUTH_PREPARING_DATA_STEP')); });
484
- return [2, data];
430
+ return [4, sleep(interval * 1000)];
431
+ case 3:
432
+ _e.sent();
433
+ _e.label = 4;
434
+ case 4:
435
+ count++;
436
+ return [3, 1];
437
+ case 5: throw new Error('nafath_verification_failed');
485
438
  }
486
439
  });
487
440
  }); });
@@ -999,44 +952,36 @@ export var authSlice = createSlice({
999
952
  state.loading = false;
1000
953
  state.error = action.error.message;
1001
954
  })
1002
- .addCase(createNIDAuth.pending, function (state) {
955
+ .addCase(createNafathAuth.pending, function (state) {
1003
956
  state.loading = true;
1004
957
  state.error = null;
1005
958
  })
1006
- .addCase(createNIDAuth.fulfilled, function (state, action) {
959
+ .addCase(createNafathAuth.fulfilled, function (state, action) {
1007
960
  state.loading = false;
1008
961
  state.data.nidData = action.payload.formData;
1009
962
  state.data.otpData.authFor = AuthForType.NATIONAL_ID;
1010
963
  state.data.responseData = __assign(__assign({}, state.data.responseData), { authResponse: action.payload.response });
1011
964
  })
1012
- .addCase(createNIDAuth.rejected, function (state, action) {
965
+ .addCase(createNafathAuth.rejected, function (state, action) {
1013
966
  state.loading = false;
1014
967
  state.error = action.error.message;
1015
968
  })
1016
- .addCase(resendNIDAuthOTP.pending, function (state) {
1017
- state.error = null;
1018
- })
1019
- .addCase(resendNIDAuthOTP.fulfilled, function (state, action) {
1020
- state.data.nidData = action.payload.formData;
1021
- state.data.otpData.authFor = AuthForType.NATIONAL_ID;
1022
- state.data.responseData = __assign(__assign({}, state.data.responseData), { authResponse: action.payload.response });
1023
- })
1024
- .addCase(resendNIDAuthOTP.rejected, function (state, action) {
1025
- state.error = action.error.message;
1026
- })
1027
- .addCase(verifyNIDOtp.pending, function (state) {
969
+ .addCase(verifyNafath.pending, function (state) {
1028
970
  state.loading = true;
1029
971
  state.error = null;
1030
972
  })
1031
- .addCase(verifyNIDOtp.fulfilled, function (state, action) {
973
+ .addCase(verifyNafath.fulfilled, function (state, action) {
1032
974
  var _a;
1033
975
  state.loading = false;
1034
976
  var data = action.payload;
1035
977
  state.data.responseData = __assign(__assign({}, state.data.responseData), { authResponse: __assign(__assign({}, (_a = state.data.responseData) === null || _a === void 0 ? void 0 : _a.authResponse), data) });
1036
978
  })
1037
- .addCase(verifyNIDOtp.rejected, function (state, action) {
979
+ .addCase(verifyNafath.rejected, function (state, action) {
1038
980
  state.loading = false;
1039
- state.error = action.error.message;
981
+ var error = action.error.message;
982
+ if (error !== 'Aborted') {
983
+ state.error = error;
984
+ }
1040
985
  })
1041
986
  .addCase(createCivilIdAuth.pending, function (state) {
1042
987
  state.loading = true;
@@ -57,6 +57,21 @@ export declare const verifyLeadOTP: import("@reduxjs/toolkit").AsyncThunk<{
57
57
  fulfilledMeta?: unknown;
58
58
  rejectedMeta?: unknown;
59
59
  }>;
60
+ interface verifyNafathParams {
61
+ onSuccess?: () => void;
62
+ }
63
+ export declare const verifyNafath: import("@reduxjs/toolkit").AsyncThunk<{
64
+ response: any;
65
+ }, verifyNafathParams, {
66
+ state?: unknown;
67
+ dispatch?: import("redux").Dispatch<import("redux").AnyAction> | undefined;
68
+ extra?: unknown;
69
+ rejectValue?: unknown;
70
+ serializedErrorType?: unknown;
71
+ pendingMeta?: unknown;
72
+ fulfilledMeta?: unknown;
73
+ rejectedMeta?: unknown;
74
+ }>;
60
75
  interface verifyPACIParams {
61
76
  onSuccess?: () => void;
62
77
  }
@@ -90,7 +105,7 @@ export declare const updateLeadIdentity: import("@reduxjs/toolkit").AsyncThunk<{
90
105
  formData: {
91
106
  type: string;
92
107
  nid: string;
93
- dob: string;
108
+ dob?: any;
94
109
  termAndConditionChecked?: boolean | undefined;
95
110
  };
96
111
  }, NIDFormValues, {
@@ -103,16 +118,6 @@ export declare const updateLeadIdentity: import("@reduxjs/toolkit").AsyncThunk<{
103
118
  fulfilledMeta?: unknown;
104
119
  rejectedMeta?: unknown;
105
120
  }>;
106
- export declare const resendOTPLeadIdentity: import("@reduxjs/toolkit").AsyncThunk<any, void, {
107
- state?: unknown;
108
- dispatch?: import("redux").Dispatch<import("redux").AnyAction> | undefined;
109
- extra?: unknown;
110
- rejectValue?: unknown;
111
- serializedErrorType?: unknown;
112
- pendingMeta?: unknown;
113
- fulfilledMeta?: unknown;
114
- rejectedMeta?: unknown;
115
- }>;
116
121
  export declare const retrieveEntityList: import("@reduxjs/toolkit").AsyncThunk<any, {
117
122
  leadId: string;
118
123
  }, {