@tap-payments/auth-jsconnect 2.12.13-development → 2.12.13

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 (40) hide show
  1. package/README.md +30 -0
  2. package/build/@types/app.d.ts +2 -0
  3. package/build/@types/app.js +1 -0
  4. package/build/@types/form.d.ts +1 -0
  5. package/build/api/document.d.ts +1 -1
  6. package/build/assets/locales/ar.json +13 -10
  7. package/build/assets/locales/en.json +9 -6
  8. package/build/components/Tooltip/Tooltip.js +1 -1
  9. package/build/constants/api.d.ts +2 -2
  10. package/build/constants/api.js +10 -2
  11. package/build/constants/app.d.ts +2 -0
  12. package/build/constants/app.js +2 -0
  13. package/build/features/app/connectExpress/connectExpressStore.js +19 -16
  14. package/build/features/app/entity/entityStore.js +56 -35
  15. package/build/features/app/individual/individualStore.js +1 -0
  16. package/build/features/bank/screens/BankDetails/BankDetails.js +1 -1
  17. package/build/features/connectExpress/ConnectExpress.js +4 -4
  18. package/build/features/connectExpress/screens/AuthenticationList/AuthenticationList.js +9 -9
  19. package/build/features/connectExpress/screens/BusinessCountry/BusinessCountry.js +7 -6
  20. package/build/features/connectExpress/screens/CollectIndividualInfo/CollectIndividualInfo.js +8 -8
  21. package/build/features/connectExpress/screens/NIDMissed/NID.js +5 -6
  22. package/build/features/connectExpress/screens/OTP/OTP.js +7 -8
  23. package/build/features/connectExpress/screens/OTP/OTPInput.js +5 -8
  24. package/build/features/entity/screens/EntityName/EntityDocumentUpload.d.ts +12 -0
  25. package/build/features/entity/screens/EntityName/{LicenseCertificate.js → EntityDocumentUpload.js} +10 -15
  26. package/build/features/entity/screens/EntityName/EntityName.js +10 -4
  27. package/build/features/entity/screens/EntityName/validation.d.ts +9 -0
  28. package/build/features/entity/screens/EntityName/validation.js +3 -0
  29. package/build/hooks/index.d.ts +1 -0
  30. package/build/hooks/index.js +1 -0
  31. package/build/hooks/useAppConfig.js +1 -1
  32. package/build/hooks/useIsEmailAuth.d.ts +1 -0
  33. package/build/hooks/useIsEmailAuth.js +11 -0
  34. package/build/utils/array.d.ts +1 -1
  35. package/build/utils/array.js +3 -2
  36. package/build/utils/common.js +6 -7
  37. package/build/utils/string.d.ts +1 -1
  38. package/build/utils/string.js +3 -1
  39. package/package.json +2 -2
  40. package/build/features/entity/screens/EntityName/LicenseCertificate.d.ts +0 -9
package/README.md CHANGED
@@ -202,6 +202,36 @@ const App = () => {
202
202
  | onStepError `required` - `function` | callback function will call in case if any error happened in the screen |
203
203
  | onStepCompleted `optional` - `function` | callback function will call after completing each step |
204
204
  | onStepStarted `required` - `function` | callback function will call in the beginning of each step |
205
+ | region `optional` - `string` | selects the production API (middleware) region, see [Regions](#regions) |
206
+
207
+ ## Regions
208
+
209
+ The library decides which backend (middleware) URL to call from the `publicKey` and the optional `region` prop.
210
+
211
+ - A `pk_test_*` key always uses the **development** URL. `region` is ignored.
212
+ - A `pk_live_*` key uses the production URL that matches `region`. If `region` is empty or not in the table, it falls back to the **global production** URL.
213
+
214
+ | `region` value | Meaning | Base URL |
215
+ | -------------- | ----------------------- | -------------------------------------------------- |
216
+ | _(empty)_ | Global production | `https://connect-mw.tap.company/middleware` |
217
+ | `sa` | Saudi production | `https://connect-mw.tap.com.sa/middleware` |
218
+ | `sa-dr` | Saudi disaster recovery | `https://connect-mw-tmp.tap.com.sa/middleware` |
219
+ | `sahu` | Saudi Huawei cloud | `https://connect-mw-temp.tap.com.sa/middleware` |
220
+ | `qagc` | Qatar GCP | `https://connect-mw.tappayments.com.qa/middleware` |
221
+
222
+ Notes:
223
+
224
+ - `region` is matched as a whole value and is case-insensitive (`SA` and `sa` are the same).
225
+ - Matching is exact. A value such as `sa-xyz` is **not** treated as Saudi and falls back to global production. Use one of the values above.
226
+ - To support a new region, add its URL and map it in `REGION_BASE_URLS` in `src/constants/api.ts`.
227
+
228
+ ```js
229
+ <ConnectLib
230
+ publicKey={'pk_live_xxxxxx'}
231
+ region='sahu' // Saudi Huawei cloud
232
+ ...
233
+ />
234
+ ```
205
235
 
206
236
  ## Branch Information
207
237
 
@@ -236,6 +236,7 @@ export interface LibConfig extends LibCallbacks {
236
236
  closeButton?: boolean;
237
237
  disableNafath?: boolean;
238
238
  disablePaci?: boolean;
239
+ emailAuth?: boolean;
239
240
  dialogStartTransition?: 'left' | 'right' | 'up' | 'down';
240
241
  dialogEndTransition?: 'left' | 'right' | 'up' | 'down';
241
242
  };
@@ -420,6 +421,7 @@ export declare enum IndividualType {
420
421
  }
421
422
  export declare enum DocumentPurpose {
422
423
  CR = "commercial_registration",
424
+ COMMERCIAL_REGISTRATION_EXTRACT = "commercial_registration_extract",
423
425
  ARTICLE_ASSOCIATION = "article_of_association",
424
426
  BANK_STATEMENT = "bank_statement",
425
427
  BANK_CERTIFICATE = "bank_certificate",
@@ -92,6 +92,7 @@ export var IndividualType;
92
92
  export var DocumentPurpose;
93
93
  (function (DocumentPurpose) {
94
94
  DocumentPurpose["CR"] = "commercial_registration";
95
+ DocumentPurpose["COMMERCIAL_REGISTRATION_EXTRACT"] = "commercial_registration_extract";
95
96
  DocumentPurpose["ARTICLE_ASSOCIATION"] = "article_of_association";
96
97
  DocumentPurpose["BANK_STATEMENT"] = "bank_statement";
97
98
  DocumentPurpose["BANK_CERTIFICATE"] = "bank_certificate";
@@ -140,6 +140,7 @@ export declare type EntityNameFormValues = {
140
140
  expiryDate: string;
141
141
  unifiedNumber: string;
142
142
  certificateId?: Array<string>;
143
+ commercialRegistrationExtractId?: Array<string>;
143
144
  articleId?: string;
144
145
  };
145
146
  export declare type EntityCapitalFormValues = {
@@ -7,7 +7,7 @@ export declare type DocumentInfo = {
7
7
  images: Array<string>;
8
8
  };
9
9
  export declare type DocumentUpdateBody = {
10
- entity_id?: boolean;
10
+ entity_id?: string;
11
11
  individual_type_id?: number;
12
12
  country?: string;
13
13
  documents: Array<DocumentInfo>;
@@ -67,7 +67,7 @@
67
67
  "approve_with_paci_app": "المتابعة من خلال PACI",
68
68
  "ar": "ع",
69
69
  "arabic": "اللغة العربية",
70
- "article_of_association": "PDF, JPG or PNG files up to 5mb.",
70
+ "article_of_association": "يمكنك رفع ملف بصيغة JPG ،PDF ،PNG، على ألا يتجاوز حجمه 4 ميغابايت.",
71
71
  "auth_brand_required": "العلامة التجارية مطلوبة",
72
72
  "auth_entity_required": "المؤسسة مطلوب",
73
73
  "auth_merchant_required": "التاجر مطلوب",
@@ -178,6 +178,7 @@
178
178
  "civil_id_placeholder": "2xxxxxxxxx12",
179
179
  "civil_id_title": "البطاقة المدنية",
180
180
  "close_and_complete_later": "اغلق الان و اكمل لاحقا",
181
+ "code_sent_to": "تم إرسال الرمز إلى ",
181
182
  "commercial_reg": "منشأة تجارية",
182
183
  "commercial_reg_hint": "للمنشئات الصغيرة و المتوسطة و المنشأت الناشئة و المؤسسات برخصة مزاوة نشاط تجارى",
183
184
  "company_individuals": "الأفراد بالشركة",
@@ -214,11 +215,12 @@
214
215
  "data_loading_desc": "الرجاء الانتظار أثناء تحضير البيانات",
215
216
  "data_loading_title": "تحضير البيانات",
216
217
  "day": "اليوم",
217
- "desc_drag_and_drop_certificate": "PDF, JPG or PNG files up to 4mb. 4 files maximum",
218
- "desc_drag_and_drop_civilID": "PDF, JPG or PNG files up to 4mb. 4 files maximum",
219
- "desc_drag_and_drop_signature": "PDF, JPG or PNG files up to 4mb. 4 files maximum",
220
- "desc_drag_and_drop_tax_document": "PDF, JPG or PNG files up to 4mb. 4 files maximum",
221
- "description_brand_logo": "JPG or PNG files up to 4mb.",
218
+ "desc_drag_and_drop": "يرجى إرفاق الصفحة الأولى التي تظهر بيانات الحساب البنكي المطابقة. يمكنك رفع ملف بصيغة PDF أو JPG أو PNG، على ألا يتجاوز حجمه 4 ميغابايت.",
219
+ "desc_drag_and_drop_certificate": "يمكنك رفع 4 ملفات كحد أقصى بصيغة PDF أو JPG أو PNG، على ألا يتجاوز حجم كل ملف 4 ميغابايت.",
220
+ "desc_drag_and_drop_civilID": "يمكنك رفع 4 ملفات كحد أقصى بصيغة PDF أو JPG أو PNG، على ألا يتجاوز حجم كل ملف 4 ميغابايت.",
221
+ "desc_drag_and_drop_signature": "يمكنك رفع 4 ملفات كحد أقصى بصيغة PDF أو JPG أو PNG، على ألا يتجاوز حجم كل ملف 4 ميغابايت.",
222
+ "desc_drag_and_drop_tax_document": "يمكنك رفع 4 ملفات كحد أقصى بصيغة PDF أو JPG أو PNG، على ألا يتجاوز حجم كل ملف 4 ميغابايت.",
223
+ "description_brand_logo": "يمكنك رفع ملف بصيغة JPG أو PNG، على ألا يتجاوز حجمه 4 ميغابايت.",
222
224
  "drag_and_drop": "قم بسحب وإدراج الكشف",
223
225
  "edit": "تعديل",
224
226
  "email_activation_description": "شكراً لاختيارك تاب للمدفوعات، لقد تم تفعيل بريدك الإلكتروني بنجاح!",
@@ -370,6 +372,7 @@
370
372
  "join_our_community": "",
371
373
  "kyc_already_submitted_title": "لقد وافقت مسبقاً على كافة الوثائق",
372
374
  "kyc_dispute_policy": "سياسة المنازعات",
375
+ "kyc_privacy_policy": "سياسة الخصوصية",
373
376
  "kyc_refund_policy": "سياسة الاسترجاع",
374
377
  "kyc_success_button": "حساب لوحة التحكم",
375
378
  "kyc_success_title": "تم تحديث حسابك بنجاح",
@@ -529,6 +532,8 @@
529
532
  "select_terminal_label": "Terminal",
530
533
  "select_terminal_placeholder": "الرجاء تحديد محطة طرفية",
531
534
  "selected_activities": "الأنشطة المختارة",
535
+ "session_expired_otp": "انتهت صلاحية العملية. يرجى إدخال رمز التحقق المرسل للمتابعة.",
536
+ "session_invalid": "رمز التحقق غير صالح",
532
537
  "share_count_hint": "0",
533
538
  "share_count_label": "عدد الأسهم",
534
539
  "share_value_hint": "0000",
@@ -642,6 +647,7 @@
642
647
  "title_bank_statement": "شهادة الايبان البنكية",
643
648
  "title_brand_logo": "لوجو العلامة التجارية",
644
649
  "title_civil_id": "صورة الهوية الوطنية",
650
+ "title_commercial_registration_extract": "مستخرج السجل التجاري",
645
651
  "title_connect_flow": "استقبل المدفوعات من تاب",
646
652
  "title_license_certificate": "السجل التجاري للمنشأة",
647
653
  "title_signature_file": "صورة من التوقيع",
@@ -680,8 +686,5 @@
680
686
  "year": "السنة",
681
687
  "yes": "نعم",
682
688
  "your_brand_details": "تفاصيل علامتك التجارية",
683
- "يرجى التحقق من اسم تطبيق ابل": "",
684
- "session_expired_otp": "انتهت صلاحية العملية. يرجى إدخال رمز التحقق المرسل للمتابعة.",
685
- "code_sent_to": "تم إرسال الرمز إلى ",
686
- "session_invalid": "رمز التحقق غير صالح"
689
+ "يرجى التحقق من اسم تطبيق ابل": ""
687
690
  }
@@ -62,7 +62,7 @@
62
62
  "approve_with_paci_app": "Continue with PACI",
63
63
  "ar": "ع",
64
64
  "arabic": "اللغة العربية",
65
- "article_of_association": "PDF, JPG or PNG files up to 5mb.",
65
+ "article_of_association": "PDF, JPG or PNG files up to 4mb.",
66
66
  "auth_brand_required": "Brand is required",
67
67
  "auth_entity_required": "Entity is required",
68
68
  "auth_merchant_required": "Merchant is required",
@@ -184,6 +184,7 @@
184
184
  "civil_id_placeholder": "2xxxxxxxxx12",
185
185
  "civil_id_title": "Civil ID",
186
186
  "close_and_complete_later": "Close and Complete Later",
187
+ "code_sent_to": "Code sent to ",
187
188
  "commercial_reg": "Commercial entity",
188
189
  "commercial_reg_hint": "Small & medium businesses, Startups and Enterprises with an authorised commercial licence.",
189
190
  "commercial_registration": "Commercial registration",
@@ -221,7 +222,7 @@
221
222
  "data_loading_desc": "Please wait as we are preparing data",
222
223
  "data_loading_title": "Preparing data",
223
224
  "day": "Day",
224
- "desc_drag_and_drop": "First page showing matching bank details. PDF, JPG or PNG files up to 5mb.",
225
+ "desc_drag_and_drop": "First page showing matching bank details. PDF, JPG or PNG files up to 4mb.",
225
226
  "desc_drag_and_drop_certificate": "PDF, JPG or PNG files up to 4mb. 4 files maximum",
226
227
  "desc_drag_and_drop_civilID": "PDF, JPG or PNG files up to 4mb. 4 files maximum",
227
228
  "desc_drag_and_drop_signature": "PDF, JPG or PNG files up to 4mb. 4 files maximum",
@@ -383,6 +384,7 @@
383
384
  "join_our_community": "",
384
385
  "kyc_already_submitted_title": "You already approved all documents",
385
386
  "kyc_dispute_policy": "Dispute Policy",
387
+ "kyc_privacy_policy": "Privacy Policy",
386
388
  "kyc_refund_policy": "Refund Policy",
387
389
  "kyc_success_button": "Go to my board",
388
390
  "kyc_success_title": "All done",
@@ -393,6 +395,7 @@
393
395
  "kyc_token_invalid": "May you please verify link of which you are trying to open.",
394
396
  "kyc_users_description": "Please select an authorized registered ID to approve with {{provider}}",
395
397
  "kyc_verification": "Know Your Customer (KYC)",
398
+ "kyc_privacy_policy": "Privacy Policy",
396
399
  "language": "العربية",
397
400
  "license_info": "License information",
398
401
  "license_name_hint": "Enter legal name",
@@ -551,6 +554,8 @@
551
554
  "select_terminal_label": "Terminal",
552
555
  "select_terminal_placeholder": "Please select a terminal",
553
556
  "selected_activities": "Selected Activities",
557
+ "session_expired_otp": "Session expired. Please verify your phone number to continue.",
558
+ "session_invalid": "Session Invalid",
554
559
  "share_count_hint": "0",
555
560
  "share_count_label": "Share Count",
556
561
  "share_value_hint": "0000",
@@ -667,6 +672,7 @@
667
672
  "title_bank_statement": "Bank IBAN certificate",
668
673
  "title_brand_logo": "Brand Logo",
669
674
  "title_civil_id": "Civil ID Attachment",
675
+ "title_commercial_registration_extract": "Commercial registration extract",
670
676
  "title_connect_flow": "Connect Tap",
671
677
  "title_license_certificate": "License Certificate",
672
678
  "title_signature_file": "Signature Attachment",
@@ -707,8 +713,5 @@
707
713
  "website_label": "Website",
708
714
  "year": "Year",
709
715
  "yes": "Yes",
710
- "your_brand_details": "Your brand details",
711
- "session_expired_otp": "Session expired. Please verify your phone number to continue.",
712
- "code_sent_to": "Code sent to ",
713
- "session_invalid": "Session Invalid"
716
+ "your_brand_details": "Your brand details"
714
717
  }
@@ -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)) }),
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 }),
37
37
  _b);
38
38
  });
39
39
  var TextStyled = styled(Text, { shouldForwardProp: function (prop) { return prop !== 'isAr'; } })(function (_a) {
@@ -11,9 +11,8 @@ export declare const ENDPOINT_PATHS: {
11
11
  MIGRATION_STATUS: string;
12
12
  SANDBOX_BASE_URL: string;
13
13
  PRODUCTION_BASE_URL: string;
14
- PRODUCTION_BASE_URL_SA: string;
15
- PRODUCTION_BASE_URL_SA_DR: string;
16
14
  DEV_BASE_URL: string;
15
+ BETA_BASE_URL: string;
17
16
  BUSINESS_COUNTRIES: string;
18
17
  COUNTRIES: string;
19
18
  IP: string;
@@ -59,3 +58,4 @@ export declare const ENDPOINT_PATHS: {
59
58
  CURRENCY: string;
60
59
  SEGMENT_LIST: string;
61
60
  };
61
+ export declare const REGION_BASE_URLS: Record<string, string>;
@@ -2,7 +2,10 @@ var SANDBOX_BASE_URL = 'https://connect-mw.sandbox.tap.company/middleware';
2
2
  var PRODUCTION_BASE_URL = 'https://connect-mw.tap.company/middleware';
3
3
  var PRODUCTION_BASE_URL_SA = 'https://connect-mw.tap.com.sa/middleware';
4
4
  var PRODUCTION_BASE_URL_SA_DR = 'https://connect-mw-tmp.tap.com.sa/middleware';
5
+ var PRODUCTION_BASE_URL_SA_HU = 'https://connect-mw-temp.tap.com.sa/middleware';
6
+ var PRODUCTION_BASE_URL_QA_GC = 'https://connect-mw.tappayments.com.qa/middleware';
5
7
  var DEV_BASE_URL = 'https://connect-mw.dev.tap.company/middleware';
8
+ var BETA_BASE_URL = 'https://connect-mw.beta.tap.company/middleware';
6
9
  var API_BUSINESS_COUNTRIES = 'https://godata.sandbox.tap.company/api/v1/business/country/list';
7
10
  var API_COUNTRIES = 'https://utilities.tap.company/api/v1/country/list';
8
11
  var CURRENCY_PATH = 'https://utilities.tap.company/api/v1/currency/iso';
@@ -70,9 +73,8 @@ export var ENDPOINT_PATHS = {
70
73
  MIGRATION_STATUS: MIGRATION_STATUS,
71
74
  SANDBOX_BASE_URL: SANDBOX_BASE_URL,
72
75
  PRODUCTION_BASE_URL: PRODUCTION_BASE_URL,
73
- PRODUCTION_BASE_URL_SA: PRODUCTION_BASE_URL_SA,
74
- PRODUCTION_BASE_URL_SA_DR: PRODUCTION_BASE_URL_SA_DR,
75
76
  DEV_BASE_URL: DEV_BASE_URL,
77
+ BETA_BASE_URL: BETA_BASE_URL,
76
78
  BUSINESS_COUNTRIES: API_BUSINESS_COUNTRIES,
77
79
  COUNTRIES: API_COUNTRIES,
78
80
  IP: IP_PATH,
@@ -118,3 +120,9 @@ export var ENDPOINT_PATHS = {
118
120
  CURRENCY: CURRENCY_PATH,
119
121
  SEGMENT_LIST: SEGMENT_LIST
120
122
  };
123
+ export var REGION_BASE_URLS = {
124
+ sa: PRODUCTION_BASE_URL_SA,
125
+ 'sa-dr': PRODUCTION_BASE_URL_SA_DR,
126
+ sahu: PRODUCTION_BASE_URL_SA_HU,
127
+ qagc: PRODUCTION_BASE_URL_QA_GC
128
+ };
@@ -1,5 +1,7 @@
1
1
  import { ScreenStepNavigation, BusinessType, POSInfo, TerminalInfo } 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
+ export declare const CONNECT_BETA_URL = "https://connect.beta.tap.company";
3
5
  export declare const CONNECT_PROD_URL = "https://connect.tap.company";
4
6
  export declare const CLIENT_ORIGIN: string;
5
7
  export declare const TAP_WEBSITE = "https://www.tap.company/";
@@ -1,6 +1,8 @@
1
1
  import { BusinessType } from '../@types';
2
2
  import { CONNECT_FLOWS } from './flows';
3
3
  export var CONNECT_DEV_URL = 'https://connect.dev.tap.company';
4
+ export var CONNECT_SANDBOX_URL = 'https://connect.sandbox.tap.company';
5
+ export var CONNECT_BETA_URL = 'https://connect.beta.tap.company';
4
6
  export var CONNECT_PROD_URL = 'https://connect.tap.company';
5
7
  export var CLIENT_ORIGIN = window.location.origin;
6
8
  export var TAP_WEBSITE = 'https://www.tap.company/';
@@ -61,7 +61,7 @@ import { FlowsTypes, AuthForType, BusinessType, LicenseType, AuthForScreen } fro
61
61
  import API, { setAuthSessionToGlobalHeaders } from '../../../api';
62
62
  import { ADD_NEW_ENTITY, COLLECT_DOB_INFO_NAFATH, CONNECT_EXPRESS_STEP_NAMES, IDENTIFICATION_TYPE, NAFATH_PACI_TIMEOUT_DURATION, NAFATH_VERIFICATION_FAILED, OTHER_CR_LICENSE, OTHER_FL_LICENSE, SCOPE_AUTH, SCOPE_MERCHANT } from '../../../constants';
63
63
  import { defaultCountry } from '../../../constants';
64
- import { getIndividualName, capitalizeTheFirstLetterOfEachWord, sleep, findCountryByIddPrefix, concatenateObjectValues, isSA, isKW, isQA, isOtherThanKWOrSA, sendCustomEventToGTM, sendCustomDimension, getMetaData, isNetworkError, isTimeoutError, isInternalServerError, isAuthenticationVerificationFailed } from '../../../utils';
64
+ import { getIndividualName, capitalizeTheFirstLetterOfEachWord, sleep, findCountryByIddPrefix, concatenateObjectValues, isSA, isKW, isEmailAuthEnabled, isOtherThanKWOrSA, sendCustomEventToGTM, sendCustomDimension, getMetaData, isNetworkError, isTimeoutError, isInternalServerError, isAuthenticationVerificationFailed } from '../../../utils';
65
65
  export var updateBusinessCountryAsync = createAsyncThunk('connectExpress/updateBusinessCountryAsync', function (countryCode, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
66
66
  var connectExpress, payload, data;
67
67
  return __generator(this, function (_a) {
@@ -81,17 +81,17 @@ export var updateBusinessCountryAsync = createAsyncThunk('connectExpress/updateB
81
81
  });
82
82
  }); });
83
83
  export var retrieveLeadIdentityByIdAsync = createAsyncThunk('expressConnect/retrieveLeadIdentityByIdAsync', function (leadId, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
84
- var settings, countryCode, showBoard, data, _a, country_code, contact, phone, status, board_id, board_info_id, isRegistered, screen_1, screen_2, _b, boardInfo, boardData, error_1;
85
- var _c, _d, _e, _f, _g, _h;
86
- return __generator(this, function (_j) {
87
- switch (_j.label) {
84
+ var settings, countryCode, showBoard, data, _a, country_code, contact, phone, status, board_id, board_info_id, emailAuth, isRegistered, screen_1, screen_2, _b, boardInfo, boardData, error_1;
85
+ var _c, _d, _e, _f, _g, _h, _j;
86
+ return __generator(this, function (_k) {
87
+ switch (_k.label) {
88
88
  case 0:
89
89
  settings = thunkApi.getState().settings;
90
90
  countryCode = settings.data.businessCountry;
91
91
  showBoard = settings.data.appConfig.showBoard;
92
92
  return [4, API.leadService.retrieveLeadIdentity(leadId)];
93
93
  case 1:
94
- data = _j.sent();
94
+ data = _k.sent();
95
95
  _a = data || {}, country_code = _a.country_code, contact = _a.contact;
96
96
  if (country_code)
97
97
  thunkApi.dispatch(handleSetCountryByIso2(country_code));
@@ -103,20 +103,23 @@ export var retrieveLeadIdentityByIdAsync = createAsyncThunk('expressConnect/retr
103
103
  thunkApi.dispatch(handleCurrentActiveScreen('CONNECT_EXPRESS_BUSINESS_COUNTRY_STEP'));
104
104
  return [2, { data: data, countryCode: countryCode }];
105
105
  }
106
+ emailAuth = (_d = settings.data.appConfig.features) === null || _d === void 0 ? void 0 : _d.emailAuth;
106
107
  isRegistered = (status === null || status === void 0 ? void 0 : status.toLowerCase()) === 'registered';
107
108
  if (!isRegistered && !(data === null || data === void 0 ? void 0 : data.identification) && phone) {
108
- screen_1 = isQA(country_code || ((_d = settings.data.businessCountry) === null || _d === void 0 ? void 0 : _d.iso2)) ? 'CONNECT_EXPRESS_EMAIL_STEP' : 'CONNECT_EXPRESS_MOBILE_STEP';
109
+ screen_1 = isEmailAuthEnabled(emailAuth, country_code || ((_e = settings.data.businessCountry) === null || _e === void 0 ? void 0 : _e.iso2))
110
+ ? 'CONNECT_EXPRESS_EMAIL_STEP'
111
+ : 'CONNECT_EXPRESS_MOBILE_STEP';
109
112
  thunkApi.dispatch(handleCurrentActiveScreen(screen_1));
110
113
  return [2, { data: data, countryCode: countryCode }];
111
114
  }
112
115
  if (!isRegistered && country_code) {
113
116
  screen_2 = 'CONNECT_EXPRESS_NID_STEP';
114
117
  if (!isSA(data.country_code))
115
- screen_2 = isQA(data.country_code) ? 'CONNECT_EXPRESS_EMAIL_STEP' : 'CONNECT_EXPRESS_MOBILE_STEP';
118
+ screen_2 = isEmailAuthEnabled(emailAuth, data.country_code) ? 'CONNECT_EXPRESS_EMAIL_STEP' : 'CONNECT_EXPRESS_MOBILE_STEP';
116
119
  thunkApi.dispatch(handleCurrentActiveScreen(screen_2));
117
120
  return [2, { data: data, countryCode: countryCode }];
118
121
  }
119
- if (!isRegistered && isQA(settings.data.businessCountry.iso2)) {
122
+ if (!isRegistered && isEmailAuthEnabled(emailAuth, settings.data.businessCountry.iso2)) {
120
123
  thunkApi.dispatch(handleCurrentActiveScreen('CONNECT_EXPRESS_EMAIL_STEP'));
121
124
  return [2, { data: data, countryCode: countryCode }];
122
125
  }
@@ -128,11 +131,11 @@ export var retrieveLeadIdentityByIdAsync = createAsyncThunk('expressConnect/retr
128
131
  thunkApi.dispatch(handleCurrentActiveScreen('CONNECT_EXPRESS_NID_STEP'));
129
132
  return [2, { data: data, countryCode: countryCode }];
130
133
  }
131
- if ((_e = data === null || data === void 0 ? void 0 : data.identification) === null || _e === void 0 ? void 0 : _e.authentication_id) {
132
- thunkApi.dispatch(storeAuthId((_f = data === null || data === void 0 ? void 0 : data.identification) === null || _f === void 0 ? void 0 : _f.authentication_id));
134
+ if ((_f = data === null || data === void 0 ? void 0 : data.identification) === null || _f === void 0 ? void 0 : _f.authentication_id) {
135
+ thunkApi.dispatch(storeAuthId((_g = data === null || data === void 0 ? void 0 : data.identification) === null || _g === void 0 ? void 0 : _g.authentication_id));
133
136
  }
134
137
  if (isRegistered && !showBoard) {
135
- (_h = (_g = settings.data.appConfig).onFlowCompleted) === null || _h === void 0 ? void 0 : _h.call(_g, data);
138
+ (_j = (_h = settings.data.appConfig).onFlowCompleted) === null || _j === void 0 ? void 0 : _j.call(_h, data);
136
139
  thunkApi.dispatch(handleCurrentActiveScreen('CONNECT_EXPRESS_ACCOUNT_ALREADY_CREATED_STEP'));
137
140
  return [2, { data: data, countryCode: countryCode }];
138
141
  }
@@ -141,19 +144,19 @@ export var retrieveLeadIdentityByIdAsync = createAsyncThunk('expressConnect/retr
141
144
  return [2, { data: data, countryCode: countryCode }];
142
145
  }
143
146
  if (!(isRegistered && board_id && board_info_id)) return [3, 5];
144
- _j.label = 2;
147
+ _k.label = 2;
145
148
  case 2:
146
- _j.trys.push([2, 4, , 5]);
149
+ _k.trys.push([2, 4, , 5]);
147
150
  return [4, Promise.all([
148
151
  API.boardService.retrieveBoardInfo({ id: board_id, infoId: board_info_id }),
149
152
  API.boardService.retrieveBoardDetails(board_id)
150
153
  ])];
151
154
  case 3:
152
- _b = _j.sent(), boardInfo = _b[0], boardData = _b[1];
155
+ _b = _k.sent(), boardInfo = _b[0], boardData = _b[1];
153
156
  thunkApi.dispatch(handleCurrentActiveScreen('CONNECT_EXPRESS_SUCCESS_WITH_FLOW_BUTTONS_STEP'));
154
157
  return [2, { data: data, countryCode: countryCode, boardInfo: boardInfo, boardData: boardData }];
155
158
  case 4:
156
- error_1 = _j.sent();
159
+ error_1 = _k.sent();
157
160
  thunkApi.dispatch(handleCurrentActiveScreen('CONNECT_EXPRESS_ACCOUNT_ALREADY_CREATED_STEP'));
158
161
  return [2, { data: data, countryCode: countryCode }];
159
162
  case 5: return [2, { data: data, countryCode: countryCode }];
@@ -304,18 +304,43 @@ export var retrieveBoardDetails = createAsyncThunk('entityRetrieveEntityInfo', f
304
304
  });
305
305
  });
306
306
  });
307
+ var uploadEntityDocumentByPurpose = function (documents, entityId, purpose, imageIds) { return __awaiter(void 0, void 0, void 0, function () {
308
+ var existingDocument, documentBody_1, documentBody;
309
+ return __generator(this, function (_a) {
310
+ if ((imageIds || []).length === 0)
311
+ return [2, undefined];
312
+ existingDocument = getRecentDocumentBasedOnPurpose(documents, purpose);
313
+ if (existingDocument === null || existingDocument === void 0 ? void 0 : existingDocument.id) {
314
+ documentBody_1 = {
315
+ id: existingDocument.id,
316
+ images: imageIds
317
+ };
318
+ return [2, API.documentService.addFilesToExistingDocument(documentBody_1)];
319
+ }
320
+ documentBody = {
321
+ entity_id: entityId,
322
+ documents: [
323
+ {
324
+ type: purpose,
325
+ images: imageIds
326
+ }
327
+ ]
328
+ };
329
+ return [2, API.documentService.updateDocumentInfo(documentBody)];
330
+ });
331
+ }); };
307
332
  export var updateEntityName = createAsyncThunk('entityUpdateEntityName', function (_a, thunkApi) {
308
333
  var formData = _a.formData, originalFormData = _a.originalFormData, isDirty = _a.isDirty;
309
334
  return __awaiter(void 0, void 0, void 0, function () {
310
- var _b, settings, entity, entityRes, _c, id, data_status, data_verification, documents, issuingDate, expiryDate, licenseType, licenseNumber, articleId, unifiedNumber, legalName, certificateId, entityType, issueDate, expDate, isFL, isLegalNameENNonEditable, isLegalNameARNonEditable, isLicenseTypeNonEditable, isEntityTypeNonEditable, isLicenseNumberNonEditable, isUnifiedNumberNonEditable, isIssuingDateNonEditable, isExpiryDateNonEditable, isDocumentsNonEditable, isAOAFileNonEditable, isEntityTypeVerified, isLicenseNonEditable, isLicenseAvailable, payload, entityData, documentData, activityList, entity_1, documentResponse, document, documentBody, documentBody, entity_2, list;
311
- var _d, _e;
312
- return __generator(this, function (_f) {
313
- switch (_f.label) {
335
+ var _b, settings, entity, entityRes, _c, id, data_status, data_verification, documents, issuingDate, expiryDate, licenseType, licenseNumber, articleId, unifiedNumber, legalName, certificateId, commercialRegistrationExtractId, entityType, issueDate, expDate, isFL, isLegalNameENNonEditable, isLegalNameARNonEditable, isLicenseTypeNonEditable, isEntityTypeNonEditable, isLicenseNumberNonEditable, isUnifiedNumberNonEditable, isIssuingDateNonEditable, isExpiryDateNonEditable, isDocumentsNonEditable, isAOAFileNonEditable, isEntityTypeVerified, isLicenseNonEditable, isLicenseAvailable, payload, entityData, documentData, activityList, entity_1, documentResponse, documentUploads, _i, documentUploads_1, _d, purpose, imageIds, response, entity_2, list;
336
+ var _e, _f;
337
+ return __generator(this, function (_g) {
338
+ switch (_g.label) {
314
339
  case 0:
315
340
  _b = thunkApi.getState(), settings = _b.settings, entity = _b.entity;
316
341
  entityRes = (entity.data.verify.responseBody || {}).entity;
317
342
  _c = entityRes || {}, id = _c.id, data_status = _c.data_status, data_verification = _c.data_verification, documents = _c.documents;
318
- issuingDate = formData.issuingDate, expiryDate = formData.expiryDate, licenseType = formData.licenseType, licenseNumber = formData.licenseNumber, articleId = formData.articleId, unifiedNumber = formData.unifiedNumber, legalName = formData.legalName, certificateId = formData.certificateId, entityType = formData.entityType;
343
+ issuingDate = formData.issuingDate, expiryDate = formData.expiryDate, licenseType = formData.licenseType, licenseNumber = formData.licenseNumber, articleId = formData.articleId, unifiedNumber = formData.unifiedNumber, legalName = formData.legalName, certificateId = formData.certificateId, commercialRegistrationExtractId = formData.commercialRegistrationExtractId, entityType = formData.entityType;
319
344
  issueDate = issuingDate && new Date(issuingDate).getTime();
320
345
  expDate = expiryDate && new Date(expiryDate).getTime();
321
346
  isFL = licenseType === BusinessType.FL;
@@ -358,48 +383,44 @@ export var updateEntityName = createAsyncThunk('entityUpdateEntityName', functio
358
383
  if (!isDirty) return [3, 2];
359
384
  return [4, API.entityService.updateEntity(payload)];
360
385
  case 1:
361
- entity_1 = (_f.sent()).entity;
386
+ entity_1 = (_g.sent()).entity;
362
387
  entityData = entity_1;
363
- _f.label = 2;
388
+ _g.label = 2;
364
389
  case 2:
365
390
  documentResponse = undefined;
366
- document = getRecentDocumentBasedOnPurpose(documents, DocumentPurpose.CR);
367
- if (!(!isDocumentsNonEditable && (certificateId || []).length > 0)) return [3, 8];
368
- if (!(document === null || document === void 0 ? void 0 : document.id)) return [3, 4];
369
- documentBody = {
370
- id: document.id,
371
- images: certificateId
372
- };
373
- return [4, API.documentService.addFilesToExistingDocument(documentBody)];
391
+ if (!!isDocumentsNonEditable) return [3, 6];
392
+ documentUploads = [
393
+ { purpose: DocumentPurpose.CR, imageIds: certificateId },
394
+ { purpose: DocumentPurpose.COMMERCIAL_REGISTRATION_EXTRACT, imageIds: commercialRegistrationExtractId }
395
+ ];
396
+ _i = 0, documentUploads_1 = documentUploads;
397
+ _g.label = 3;
374
398
  case 3:
375
- documentResponse = _f.sent();
376
- return [3, 6];
399
+ if (!(_i < documentUploads_1.length)) return [3, 6];
400
+ _d = documentUploads_1[_i], purpose = _d.purpose, imageIds = _d.imageIds;
401
+ return [4, uploadEntityDocumentByPurpose(documents, id || '', purpose, imageIds)];
377
402
  case 4:
378
- documentBody = {
379
- entity_id: id || '',
380
- documents: [
381
- {
382
- type: DocumentPurpose.CR,
383
- images: certificateId
384
- }
385
- ]
386
- };
387
- return [4, API.documentService.updateDocumentInfo(documentBody)];
403
+ response = _g.sent();
404
+ if (response)
405
+ documentResponse = response;
406
+ _g.label = 5;
388
407
  case 5:
389
- documentResponse = _f.sent();
390
- _f.label = 6;
391
- case 6: return [4, API.entityService.retrieveEntity(id)];
408
+ _i++;
409
+ return [3, 3];
410
+ case 6:
411
+ if (!documentResponse) return [3, 8];
412
+ return [4, API.entityService.retrieveEntity(id)];
392
413
  case 7:
393
- entity_2 = (_f.sent()).entity;
414
+ entity_2 = (_g.sent()).entity;
394
415
  entityData = entity_2;
395
416
  documentData = documentResponse;
396
- _f.label = 8;
417
+ _g.label = 8;
397
418
  case 8: return [4, API.dataService.getActivitiesIsIc()];
398
419
  case 9:
399
- list = (_f.sent()).list;
420
+ list = (_g.sent()).list;
400
421
  activityList = list;
401
422
  sleep(100).then(function () { return thunkApi.dispatch(handleNextScreenStep()); });
402
- (_e = (_d = settings.data.appConfig).onStepCompleted) === null || _e === void 0 ? void 0 : _e.call(_d, settings.data.activeScreen.name, id);
423
+ (_f = (_e = settings.data.appConfig).onStepCompleted) === null || _f === void 0 ? void 0 : _f.call(_e, settings.data.activeScreen.name, id);
403
424
  return [2, { data: { entity: entityData, documentData: documentData, activityList: activityList }, formData: originalFormData }];
404
425
  }
405
426
  });
@@ -754,7 +775,7 @@ export var entitySlice = createSlice({
754
775
  state.error = null;
755
776
  var _a = action.payload, data = _a.data, formData = _a.formData;
756
777
  var _b = data || {}, entity = _b.entity, activityList = _b.activityList, rest = __rest(_b, ["entity", "activityList"]);
757
- state.data.entityNameData = __assign(__assign({}, formData), { certificateId: undefined });
778
+ state.data.entityNameData = __assign(__assign({}, formData), { certificateId: undefined, commercialRegistrationExtractId: undefined });
758
779
  state.data.entityNameData.responseBody = __assign(__assign({}, state.data.entityNameData.responseBody), { rest: rest });
759
780
  state.data.verify.responseBody = __assign(__assign({}, state.data.verify.responseBody), { entity: entity, activityList: activityList });
760
781
  if (entity === null || entity === void 0 ? void 0 : entity.activities)
@@ -1274,6 +1274,7 @@ export var individualSlice = createSlice({
1274
1274
  state.data.individualData.isAuthorized = is_authorized;
1275
1275
  })
1276
1276
  .addCase(retrieveIndividualInfo.rejected, function (state, action) {
1277
+ state.addOrRequestDetailLoading = false;
1277
1278
  state.error = action.error.message;
1278
1279
  })
1279
1280
  .addCase(getIndividualList.pending, function (state) {
@@ -91,7 +91,7 @@ var BankDetails = function () {
91
91
  var defaultBankFiles = React.useMemo(function () {
92
92
  if (!document)
93
93
  return [];
94
- return getFileDetailsFromDocument([document], "".concat(DocumentPurpose.BANK_STATEMENT, ",").concat(DocumentPurpose.BANK_CERTIFICATE));
94
+ return getFileDetailsFromDocument([document], [DocumentPurpose.BANK_STATEMENT, DocumentPurpose.BANK_CERTIFICATE]);
95
95
  }, [document]);
96
96
  var originalReadOnly = useFormReadOnly(methods, { bankStatementId: defaultBankFiles });
97
97
  var noneEditable = useDataNoneEditable(data_status, [
@@ -67,7 +67,7 @@ import { store } from '../../app/store';
67
67
  import { connectExpressSelector, setIsLeadIdPassed, setLeadId, retrieveLeadIdentityByIdAsync, setDefaultCountryCode, clearError, createAuthSessionExpiredAsync } from '../app/connectExpress/connectExpressStore';
68
68
  import { ReduxProvider, ThemeProvider } from '../../components/Providers';
69
69
  import Collapse from '../../components/Collapse';
70
- import { isKW, isQA, findOrCreateElementAndInject, sendPageView, isOtherThanKWOrSA, initializeGTM, sendCustomEventToGTM, sendCustomDimension } from '../../utils';
70
+ import { isKW, isEmailAuthEnabled, findOrCreateElementAndInject, sendPageView, isOtherThanKWOrSA, initializeGTM, sendCustomEventToGTM, sendCustomDimension } from '../../utils';
71
71
  import { CONNECT_EXPRESS_SCREENS_NAVIGATION } from '../../constants';
72
72
  import { connectExpressFeatureScreens } from '../featuresScreens';
73
73
  import Background from '../shared/Background';
@@ -123,7 +123,7 @@ var ConnectExpress = memo(function (_a) {
123
123
  }
124
124
  }, [data.businessCountry]);
125
125
  React.useEffect(function () {
126
- var _a, _b, _c;
126
+ var _a, _b, _c, _d;
127
127
  if (settingLoading || !props.open)
128
128
  return;
129
129
  if (!data.isValidOperator) {
@@ -146,10 +146,10 @@ var ConnectExpress = memo(function (_a) {
146
146
  dispatch(handleCurrentActiveScreen('CONNECT_EXPRESS_BUSINESS_COUNTRY_STEP'));
147
147
  return;
148
148
  }
149
- if (((_b = data.businessCountry) === null || _b === void 0 ? void 0 : _b.iso2) && isQA(data.businessCountry.iso2)) {
149
+ if (((_b = data.businessCountry) === null || _b === void 0 ? void 0 : _b.iso2) && isEmailAuthEnabled((_c = appConfig.features) === null || _c === void 0 ? void 0 : _c.emailAuth, data.businessCountry.iso2)) {
150
150
  dispatch(handleCurrentActiveScreen('CONNECT_EXPRESS_EMAIL_STEP'));
151
151
  }
152
- else if (((_c = data.businessCountry) === null || _c === void 0 ? void 0 : _c.iso2) && (isKW(data.businessCountry.iso2) || isOtherThanKWOrSA(data.businessCountry.iso2))) {
152
+ else if (((_d = data.businessCountry) === null || _d === void 0 ? void 0 : _d.iso2) && (isKW(data.businessCountry.iso2) || isOtherThanKWOrSA(data.businessCountry.iso2))) {
153
153
  dispatch(handleCurrentActiveScreen('CONNECT_EXPRESS_MOBILE_STEP'));
154
154
  }
155
155
  }, [data.isValidOperator, settingLoading]);