@tap-payments/auth-jsconnect 2.8.65-development → 2.8.68-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 (102) 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/constants/app.d.ts +1 -0
  8. package/build/constants/app.js +35 -12
  9. package/build/constants/assets.d.ts +2 -0
  10. package/build/constants/assets.js +2 -0
  11. package/build/features/app/auth/authStore.d.ts +5 -15
  12. package/build/features/app/auth/authStore.js +58 -113
  13. package/build/features/app/business/businessStore.d.ts +16 -11
  14. package/build/features/app/business/businessStore.js +58 -44
  15. package/build/features/app/connect/connectStore.d.ts +19 -12
  16. package/build/features/app/connect/connectStore.js +151 -82
  17. package/build/features/app/connectExpress/connectExpressStore.d.ts +10 -33
  18. package/build/features/app/connectExpress/connectExpressStore.js +156 -251
  19. package/build/features/app/individual/individualStore.js +4 -1
  20. package/build/features/auth/screens/AuthSwitch/AuthSwitch.js +2 -2
  21. package/build/features/auth/screens/NID/IDNumber.js +1 -1
  22. package/build/features/auth/screens/NID/NID.js +4 -10
  23. package/build/features/auth/screens/NID/validation.d.ts +0 -3
  24. package/build/features/auth/screens/NID/validation.js +0 -1
  25. package/build/features/auth/screens/OTP/OTP.js +1 -5
  26. package/build/features/auth/screens/OTP/OTPInput.js +2 -13
  27. package/build/features/{connectExpress/screens/IdentityOTP/OTP.d.ts → auth/screens/VerifyNafath/VerifyNafath.d.ts} +2 -2
  28. package/build/features/auth/screens/VerifyNafath/VerifyNafath.js +34 -0
  29. package/build/features/auth/screens/VerifyNafath/index.d.ts +3 -0
  30. package/build/features/auth/screens/VerifyNafath/index.js +2 -0
  31. package/build/features/business/screens/VerifyNafath/VerifyNafath.d.ts +5 -0
  32. package/build/features/business/screens/VerifyNafath/VerifyNafath.js +34 -0
  33. package/build/features/business/screens/VerifyNafath/index.d.ts +3 -0
  34. package/build/features/business/screens/VerifyNafath/index.js +2 -0
  35. package/build/features/connect/screens/Mobile/Mobile.js +2 -2
  36. package/build/features/connect/screens/NID/IDNumber.d.ts +1 -0
  37. package/build/features/connect/screens/NID/IDNumber.js +2 -2
  38. package/build/features/connect/screens/NID/NID.js +5 -11
  39. package/build/features/connect/screens/NID/validation.d.ts +0 -3
  40. package/build/features/connect/screens/NID/validation.js +0 -1
  41. package/build/features/connect/screens/OTP/OTPInput.js +3 -11
  42. package/build/features/connect/screens/VerifyNafath/VerifyNafath.d.ts +5 -0
  43. package/build/features/connect/screens/VerifyNafath/VerifyNafath.js +34 -0
  44. package/build/features/connect/screens/VerifyNafath/index.d.ts +3 -0
  45. package/build/features/connect/screens/VerifyNafath/index.js +2 -0
  46. package/build/features/connectExpress/screens/IdentityVerifyNafath/IdentityVerifyNafath.d.ts +5 -0
  47. package/build/features/connectExpress/screens/IdentityVerifyNafath/IdentityVerifyNafath.js +34 -0
  48. package/build/features/connectExpress/screens/IdentityVerifyNafath/index.d.ts +3 -0
  49. package/build/features/connectExpress/screens/IdentityVerifyNafath/index.js +2 -0
  50. package/build/features/connectExpress/screens/Mobile/Mobile.js +2 -2
  51. package/build/features/connectExpress/screens/NID/IDNumber.d.ts +1 -0
  52. package/build/features/connectExpress/screens/NID/IDNumber.js +2 -2
  53. package/build/features/connectExpress/screens/NID/NID.js +4 -9
  54. package/build/features/connectExpress/screens/NID/validation.d.ts +0 -3
  55. package/build/features/connectExpress/screens/NID/validation.js +0 -2
  56. package/build/features/connectExpress/screens/NIDMissed/NID.js +2 -2
  57. package/build/features/connectExpress/screens/OTP/OTP.js +5 -13
  58. package/build/features/connectExpress/screens/OTP/OTPInput.js +3 -11
  59. package/build/features/connectExpress/screens/VerifyNafath/VerifyNafath.d.ts +5 -0
  60. package/build/features/connectExpress/screens/VerifyNafath/VerifyNafath.js +34 -0
  61. package/build/features/connectExpress/screens/VerifyNafath/index.d.ts +3 -0
  62. package/build/features/connectExpress/screens/VerifyNafath/index.js +2 -0
  63. package/build/features/featuresScreens.js +21 -6
  64. package/build/features/shared/Button/NafathButton.d.ts +7 -0
  65. package/build/features/shared/Button/{AbsherButton.js → NafathButton.js} +13 -3
  66. package/build/features/shared/Button/index.d.ts +2 -2
  67. package/build/features/shared/Button/index.js +2 -2
  68. package/build/features/shared/NafathVerification/NafathVerification.d.ts +13 -0
  69. package/build/features/shared/NafathVerification/NafathVerification.js +92 -0
  70. package/build/features/shared/NafathVerification/VerifyNafathLoading.d.ts +8 -0
  71. package/build/features/shared/NafathVerification/VerifyNafathLoading.js +53 -0
  72. package/build/features/shared/NafathVerification/VerifyNafathSuccess.d.ts +5 -0
  73. package/build/features/shared/NafathVerification/VerifyNafathSuccess.js +8 -0
  74. package/build/features/shared/NafathVerification/index.d.ts +2 -0
  75. package/build/features/shared/NafathVerification/index.js +2 -0
  76. package/build/hooks/useAppTheme.js +4 -3
  77. package/build/theme/palette.js +2 -1
  78. package/build/theme/theme.d.ts +1 -1
  79. package/build/theme/theme.js +2 -2
  80. package/package.json +1 -1
  81. package/build/features/auth/screens/NID/DOB.d.ts +0 -6
  82. package/build/features/auth/screens/NID/DOB.js +0 -47
  83. package/build/features/business/screens/OTP/OTP.d.ts +0 -8
  84. package/build/features/business/screens/OTP/OTP.js +0 -90
  85. package/build/features/business/screens/OTP/OTPInput.d.ts +0 -5
  86. package/build/features/business/screens/OTP/OTPInput.js +0 -49
  87. package/build/features/business/screens/OTP/index.d.ts +0 -3
  88. package/build/features/business/screens/OTP/index.js +0 -2
  89. package/build/features/business/screens/OTP/validation.d.ts +0 -8
  90. package/build/features/business/screens/OTP/validation.js +0 -4
  91. package/build/features/connect/screens/NID/DOB.d.ts +0 -5
  92. package/build/features/connect/screens/NID/DOB.js +0 -47
  93. package/build/features/connectExpress/screens/IdentityOTP/OTP.js +0 -88
  94. package/build/features/connectExpress/screens/IdentityOTP/OTPInput.d.ts +0 -5
  95. package/build/features/connectExpress/screens/IdentityOTP/OTPInput.js +0 -56
  96. package/build/features/connectExpress/screens/IdentityOTP/index.d.ts +0 -3
  97. package/build/features/connectExpress/screens/IdentityOTP/index.js +0 -2
  98. package/build/features/connectExpress/screens/IdentityOTP/validation.d.ts +0 -8
  99. package/build/features/connectExpress/screens/IdentityOTP/validation.js +0 -4
  100. package/build/features/connectExpress/screens/NID/DOB.d.ts +0 -6
  101. package/build/features/connectExpress/screens/NID/DOB.js +0 -47
  102. 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
  }
@@ -80,6 +80,7 @@ export declare const SERVICE_NAME: {
80
80
  export declare const IDENTIFICATION_TYPE: {
81
81
  NID: string;
82
82
  IQAMA: string;
83
+ NAFATH: string;
83
84
  };
84
85
  export declare const CONNECT_STEP_NAMES: {
85
86
  CREATE_AUTH_MOBILE: string;
@@ -22,7 +22,7 @@ export var BACKGROUND_ID = 'auth-js-connect-background';
22
22
  export var CONNECT_SCREENS_NAVIGATION = [
23
23
  {
24
24
  name: 'CONNECT_NID_STEP',
25
- next: 'CONNECT_OTP_STEP',
25
+ next: 'CONNECT_VERIFY_NAFATH_STEP',
26
26
  prev: 'CONNECT_MOBILE_STEP',
27
27
  order: 1
28
28
  },
@@ -56,6 +56,12 @@ export var CONNECT_SCREENS_NAVIGATION = [
56
56
  prev: 'CONNECT_CIVIL_ID_STEP',
57
57
  order: 2
58
58
  },
59
+ {
60
+ name: 'CONNECT_VERIFY_NAFATH_STEP',
61
+ next: 'CONNECT_INDIVIDUAL_STEP',
62
+ prev: 'CONNECT_NID_STEP',
63
+ order: 2
64
+ },
59
65
  {
60
66
  name: 'CONNECT_OTP_STEP',
61
67
  next: 'CONNECT_INDIVIDUAL_STEP',
@@ -90,7 +96,7 @@ export var CONNECT_SCREENS_NAVIGATION = [
90
96
  export var CONNECT_EXPRESS_SCREENS_NAVIGATION = [
91
97
  {
92
98
  name: 'CONNECT_EXPRESS_NID_STEP',
93
- next: 'CONNECT_EXPRESS_OTP_STEP',
99
+ next: 'CONNECT_EXPRESS_VERIFY_NAFATH_STEP',
94
100
  prev: 'CONNECT_EXPRESS_MOBILE_STEP',
95
101
  order: 1
96
102
  },
@@ -118,6 +124,16 @@ export var CONNECT_EXPRESS_SCREENS_NAVIGATION = [
118
124
  prev: '',
119
125
  order: 1
120
126
  },
127
+ {
128
+ name: 'CONNECT_EXPRESS_VERIFY_NAFATH_STEP',
129
+ next: [
130
+ 'CONNECT_EXPRESS_COLLECT_INDIVIDUAL_INFO_STEP',
131
+ 'CONNECT_EXPRESS_WAITING_FOR_CREATING_ACCOUNT_STEP',
132
+ 'CONNECT_EXPRESS_AUTHENTICATION_LIST_STEP'
133
+ ],
134
+ prev: 'CONNECT_EXPRESS_NID_STEP',
135
+ order: 2
136
+ },
121
137
  {
122
138
  name: 'CONNECT_EXPRESS_VERIFY_PACI_STEP',
123
139
  next: [
@@ -137,7 +153,7 @@ export var CONNECT_EXPRESS_SCREENS_NAVIGATION = [
137
153
  'CONNECT_EXPRESS_CIVIL_ID_MISSED_STEP',
138
154
  'CONNECT_EXPRESS_AUTHENTICATION_LIST_STEP'
139
155
  ],
140
- prev: ['CONNECT_EXPRESS_MOBILE_STEP', 'CONNECT_EXPRESS_NID_STEP'],
156
+ prev: 'CONNECT_EXPRESS_MOBILE_STEP',
141
157
  order: 2
142
158
  },
143
159
  {
@@ -148,7 +164,7 @@ export var CONNECT_EXPRESS_SCREENS_NAVIGATION = [
148
164
  },
149
165
  {
150
166
  name: 'CONNECT_EXPRESS_NID_MISSED_STEP',
151
- next: ['CONNECT_EXPRESS_OTP_IDENTITY_STEP', 'CONNECT_EXPRESS_COLLECT_INDIVIDUAL_INFO_STEP'],
167
+ next: ['CONNECT_EXPRESS_IDENTITY_VERIFY_NAFATH_STEP', 'CONNECT_EXPRESS_COLLECT_INDIVIDUAL_INFO_STEP'],
152
168
  prev: 'CONNECT_EXPRESS_MOBILE_STEP',
153
169
  order: 3
154
170
  },
@@ -171,15 +187,15 @@ export var CONNECT_EXPRESS_SCREENS_NAVIGATION = [
171
187
  order: 4
172
188
  },
173
189
  {
174
- name: 'CONNECT_EXPRESS_VERIFY_PACI_IDENTITY_STEP',
190
+ name: 'CONNECT_EXPRESS_IDENTITY_VERIFY_NAFATH_STEP',
175
191
  next: ['CONNECT_EXPRESS_COLLECT_INDIVIDUAL_INFO_STEP', 'CONNECT_EXPRESS_WAITING_FOR_CREATING_ACCOUNT_STEP'],
176
- prev: 'CONNECT_EXPRESS_CIVIL_ID_MISSED_STEP',
192
+ prev: 'CONNECT_EXPRESS_NID_MISSED_STEP',
177
193
  order: 4
178
194
  },
179
195
  {
180
- name: 'CONNECT_EXPRESS_OTP_IDENTITY_STEP',
196
+ name: 'CONNECT_EXPRESS_VERIFY_PACI_IDENTITY_STEP',
181
197
  next: ['CONNECT_EXPRESS_COLLECT_INDIVIDUAL_INFO_STEP', 'CONNECT_EXPRESS_WAITING_FOR_CREATING_ACCOUNT_STEP'],
182
- prev: 'CONNECT_EXPRESS_NID_MISSED_STEP',
198
+ prev: 'CONNECT_EXPRESS_CIVIL_ID_MISSED_STEP',
183
199
  order: 4
184
200
  },
185
201
  {
@@ -234,7 +250,7 @@ export var AUTH_SCREENS_NAVIGATION = [
234
250
  },
235
251
  {
236
252
  name: 'AUTH_NID_STEP',
237
- next: 'AUTH_OTP_STEP',
253
+ next: 'AUTH_NAFATH_VERIFY_STEP',
238
254
  prev: 'AUTH_SWITCH_STEP',
239
255
  order: 1
240
256
  },
@@ -274,6 +290,12 @@ export var AUTH_SCREENS_NAVIGATION = [
274
290
  prev: ['AUTH_MOBILE_STEP', 'AUTH_NID_STEP', 'AUTH_EMAIL_STEP', 'AUTH_PASSWORD_STEP'],
275
291
  order: 2
276
292
  },
293
+ {
294
+ name: 'AUTH_NAFATH_VERIFY_STEP',
295
+ next: 'AUTH_PREPARING_DATA_STEP',
296
+ prev: 'AUTH_NID_STEP',
297
+ order: 2
298
+ },
277
299
  {
278
300
  name: 'AUTH_PASSWORD_STEP',
279
301
  next: ['AUTH_PREPARING_DATA_STEP', 'AUTH_OTP_STEP'],
@@ -365,7 +387,7 @@ export var BUSINESS_SCREENS_NAVIGATION = [
365
387
  },
366
388
  {
367
389
  name: 'BUSINESS_IDBOD_STEP',
368
- next: ['BUSINESS_OTP_STEP', 'BUSINESS_BUSINESS_TYPE_STEP'],
390
+ next: ['BUSINESS_VERIFY_NAFATH_STEP', 'BUSINESS_BUSINESS_TYPE_STEP'],
369
391
  prev: '',
370
392
  order: 2
371
393
  },
@@ -376,7 +398,7 @@ export var BUSINESS_SCREENS_NAVIGATION = [
376
398
  order: 3
377
399
  },
378
400
  {
379
- name: 'BUSINESS_OTP_STEP',
401
+ name: 'BUSINESS_VERIFY_NAFATH_STEP',
380
402
  next: 'BUSINESS_BUSINESS_TYPE_STEP',
381
403
  prev: 'BUSINESS_IDBOD_STEP',
382
404
  order: 3
@@ -842,7 +864,8 @@ export var SERVICE_NAME = {
842
864
  };
843
865
  export var IDENTIFICATION_TYPE = {
844
866
  NID: 'national_id',
845
- IQAMA: 'iqamah'
867
+ IQAMA: 'iqamah',
868
+ NAFATH: 'nafath'
846
869
  };
847
870
  export var CONNECT_STEP_NAMES = {
848
871
  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()) === 'completed';
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
  }); });
@@ -996,44 +949,36 @@ export var authSlice = createSlice({
996
949
  state.loading = false;
997
950
  state.error = action.error.message;
998
951
  })
999
- .addCase(createNIDAuth.pending, function (state) {
952
+ .addCase(createNafathAuth.pending, function (state) {
1000
953
  state.loading = true;
1001
954
  state.error = null;
1002
955
  })
1003
- .addCase(createNIDAuth.fulfilled, function (state, action) {
956
+ .addCase(createNafathAuth.fulfilled, function (state, action) {
1004
957
  state.loading = false;
1005
958
  state.data.nidData = action.payload.formData;
1006
959
  state.data.otpData.authFor = AuthForType.NATIONAL_ID;
1007
960
  state.data.responseData = __assign(__assign({}, state.data.responseData), { authResponse: action.payload.response });
1008
961
  })
1009
- .addCase(createNIDAuth.rejected, function (state, action) {
962
+ .addCase(createNafathAuth.rejected, function (state, action) {
1010
963
  state.loading = false;
1011
964
  state.error = action.error.message;
1012
965
  })
1013
- .addCase(resendNIDAuthOTP.pending, function (state) {
1014
- state.error = null;
1015
- })
1016
- .addCase(resendNIDAuthOTP.fulfilled, function (state, action) {
1017
- state.data.nidData = action.payload.formData;
1018
- state.data.otpData.authFor = AuthForType.NATIONAL_ID;
1019
- state.data.responseData = __assign(__assign({}, state.data.responseData), { authResponse: action.payload.response });
1020
- })
1021
- .addCase(resendNIDAuthOTP.rejected, function (state, action) {
1022
- state.error = action.error.message;
1023
- })
1024
- .addCase(verifyNIDOtp.pending, function (state) {
966
+ .addCase(verifyNafath.pending, function (state) {
1025
967
  state.loading = true;
1026
968
  state.error = null;
1027
969
  })
1028
- .addCase(verifyNIDOtp.fulfilled, function (state, action) {
970
+ .addCase(verifyNafath.fulfilled, function (state, action) {
1029
971
  var _a;
1030
972
  state.loading = false;
1031
973
  var data = action.payload;
1032
974
  state.data.responseData = __assign(__assign({}, state.data.responseData), { authResponse: __assign(__assign({}, (_a = state.data.responseData) === null || _a === void 0 ? void 0 : _a.authResponse), data) });
1033
975
  })
1034
- .addCase(verifyNIDOtp.rejected, function (state, action) {
976
+ .addCase(verifyNafath.rejected, function (state, action) {
1035
977
  state.loading = false;
1036
- state.error = action.error.message;
978
+ var error = action.error.message;
979
+ if (error !== 'Aborted') {
980
+ state.error = error;
981
+ }
1037
982
  })
1038
983
  .addCase(createCivilIdAuth.pending, function (state) {
1039
984
  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
  }, {