@tap-payments/auth-jsconnect 2.8.62-sandbox → 2.8.65-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.
@@ -4,14 +4,11 @@ type GetOccupationBody = {
4
4
  };
5
5
  type GetSegmentsBody = {
6
6
  page: number;
7
+ limit: number;
7
8
  };
8
9
  type GetTeamSizeBody = {
9
10
  page: number;
10
11
  };
11
- type SegmentDataListBody = {
12
- page: number;
13
- limit: number;
14
- };
15
12
  type GetMonthlyIncomeBody = {
16
13
  page: number;
17
14
  country_code: Array<string>;
@@ -23,14 +20,9 @@ export type DataElementBody = {
23
20
  ar: string;
24
21
  };
25
22
  };
26
- type GetCustomerBasesBody = {
27
- page: number;
28
- };
29
- type GetExpectedSalesBody = {
30
- page: number;
31
- };
32
- type GetExpectedCustomerSalesBody = {
23
+ type GetBrandOperationsBody = {
33
24
  page: number;
25
+ country_code: string[];
34
26
  };
35
27
  type GetSourceOfIncomeBody = {
36
28
  page: number;
@@ -40,9 +32,7 @@ type GetChannelsOfServicesBody = {
40
32
  };
41
33
  declare const dataService: {
42
34
  getChannelsOfServices: (data: GetChannelsOfServicesBody) => Promise<any>;
43
- getCustomerBases: (data: GetCustomerBasesBody) => Promise<any>;
44
- getExpectedSales: (data: GetExpectedSalesBody) => Promise<any>;
45
- getExpectedCustomerSales: (data: GetExpectedCustomerSalesBody) => Promise<any>;
35
+ getBrandOperations: (data: GetBrandOperationsBody) => Promise<any>;
46
36
  getSourceOfIncome: (data: GetSourceOfIncomeBody) => Promise<any>;
47
37
  getMonthlyIncome: (data: GetMonthlyIncomeBody) => Promise<any>;
48
38
  getOccupation: (data: GetOccupationBody) => Promise<any>;
@@ -50,8 +40,5 @@ declare const dataService: {
50
40
  getTeamSize: (data: GetTeamSizeBody) => Promise<any>;
51
41
  getActivities: (config?: AxiosRequestConfig) => Promise<any>;
52
42
  getActivitiesIsIc: () => Promise<any>;
53
- getSegmentLocation: (data: SegmentDataListBody) => Promise<any>;
54
- getSegmentProfit: (data: SegmentDataListBody) => Promise<any>;
55
- getSegmentTech: (data: SegmentDataListBody) => Promise<any>;
56
43
  };
57
44
  export { dataService };
package/build/api/data.js CHANGED
@@ -18,24 +18,10 @@ var getChannelsOfServices = function (data) {
18
18
  data: data
19
19
  });
20
20
  };
21
- var getCustomerBases = function (data) {
21
+ var getBrandOperations = function (data) {
22
22
  return httpClient({
23
23
  method: 'post',
24
- url: "".concat(ENDPOINT_PATHS.CUSTOMER_BASES),
25
- data: data
26
- });
27
- };
28
- var getExpectedSales = function (data) {
29
- return httpClient({
30
- method: 'post',
31
- url: "".concat(ENDPOINT_PATHS.SALES),
32
- data: data
33
- });
34
- };
35
- var getExpectedCustomerSales = function (data) {
36
- return httpClient({
37
- method: 'post',
38
- url: "".concat(ENDPOINT_PATHS.EXPECTED_CUSTOMERS),
24
+ url: "".concat(ENDPOINT_PATHS.BRAND_OPERATIONS),
39
25
  data: data
40
26
  });
41
27
  };
@@ -73,7 +59,7 @@ var getActivitiesIsIc = function () {
73
59
  var getSegments = function (data) {
74
60
  return httpClient({
75
61
  method: 'post',
76
- url: "".concat(ENDPOINT_PATHS.SEGMENTS_PATH),
62
+ url: "".concat(ENDPOINT_PATHS.SEGMENT_LIST),
77
63
  data: data
78
64
  });
79
65
  };
@@ -84,41 +70,15 @@ var getTeamSize = function (data) {
84
70
  data: data
85
71
  });
86
72
  };
87
- var getSegmentLocation = function (data) {
88
- return httpClient({
89
- method: 'post',
90
- url: "".concat(ENDPOINT_PATHS.SEGMENT_LOCATION, "/list"),
91
- data: data
92
- });
93
- };
94
- var getSegmentProfit = function (data) {
95
- return httpClient({
96
- method: 'post',
97
- url: "".concat(ENDPOINT_PATHS.SEGMENT_PROFIT, "/list"),
98
- data: data
99
- });
100
- };
101
- var getSegmentTech = function (data) {
102
- return httpClient({
103
- method: 'post',
104
- url: "".concat(ENDPOINT_PATHS.SEGMENT_TECH, "/list"),
105
- data: data
106
- });
107
- };
108
73
  var dataService = {
109
74
  getChannelsOfServices: getChannelsOfServices,
110
- getCustomerBases: getCustomerBases,
111
- getExpectedSales: getExpectedSales,
112
- getExpectedCustomerSales: getExpectedCustomerSales,
75
+ getBrandOperations: getBrandOperations,
113
76
  getSourceOfIncome: getSourceOfIncome,
114
77
  getMonthlyIncome: getMonthlyIncome,
115
78
  getOccupation: getOccupation,
116
79
  getSegments: getSegments,
117
80
  getTeamSize: getTeamSize,
118
81
  getActivities: getActivities,
119
- getActivitiesIsIc: getActivitiesIsIc,
120
- getSegmentLocation: getSegmentLocation,
121
- getSegmentProfit: getSegmentProfit,
122
- getSegmentTech: getSegmentTech
82
+ getActivitiesIsIc: getActivitiesIsIc
123
83
  };
124
84
  export { dataService };
@@ -95,14 +95,9 @@ declare const API: {
95
95
  getChannelsOfServices: (data: {
96
96
  page: number;
97
97
  }) => Promise<any>;
98
- getCustomerBases: (data: {
99
- page: number;
100
- }) => Promise<any>;
101
- getExpectedSales: (data: {
102
- page: number;
103
- }) => Promise<any>;
104
- getExpectedCustomerSales: (data: {
98
+ getBrandOperations: (data: {
105
99
  page: number;
100
+ country_code: string[];
106
101
  }) => Promise<any>;
107
102
  getSourceOfIncome: (data: {
108
103
  page: number;
@@ -116,24 +111,13 @@ declare const API: {
116
111
  }) => Promise<any>;
117
112
  getSegments: (data: {
118
113
  page: number;
114
+ limit: number;
119
115
  }) => Promise<any>;
120
116
  getTeamSize: (data: {
121
117
  page: number;
122
118
  }) => Promise<any>;
123
119
  getActivities: (config?: import("axios").AxiosRequestConfig<any> | undefined) => Promise<any>;
124
120
  getActivitiesIsIc: () => Promise<any>;
125
- getSegmentLocation: (data: {
126
- page: number;
127
- limit: number;
128
- }) => Promise<any>;
129
- getSegmentProfit: (data: {
130
- page: number;
131
- limit: number;
132
- }) => Promise<any>;
133
- getSegmentTech: (data: {
134
- page: number;
135
- limit: number;
136
- }) => Promise<any>;
137
121
  };
138
122
  individualService: {
139
123
  retrieveIndividualInfo: (id: string) => Promise<any>;
@@ -18,5 +18,5 @@ export default function ThemeProvider(_a) {
18
18
  if (!theme) {
19
19
  return _jsx(Fragment, {});
20
20
  }
21
- return (_jsx(ScopedCssBaseline, { children: _jsx(MUIThemeProvider, __assign({ theme: theme }, { children: children })) }));
21
+ return (_jsx(ScopedCssBaseline, __assign({ sx: { background: 'inherit' } }, { children: _jsx(MUIThemeProvider, __assign({ theme: theme }, { children: children })) })));
22
22
  }
@@ -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) {
@@ -25,9 +25,7 @@ export declare const ENDPOINT_PATHS: {
25
25
  FIREBASE_URL: string;
26
26
  CREATE_ACCOUNT: string;
27
27
  CHANNEL: string;
28
- CUSTOMER_BASES: string;
29
- SALES: string;
30
- EXPECTED_CUSTOMERS: string;
28
+ BRAND_OPERATIONS: string;
31
29
  SIGNUP: string;
32
30
  SOURCE_INCOME: string;
33
31
  MONTHLY_INCOME: string;
@@ -47,7 +45,6 @@ export declare const ENDPOINT_PATHS: {
47
45
  RETRIEVE_ACTIVITIES_LIST_PATH: string;
48
46
  DOCUMENT: string;
49
47
  CREATE_AUTH_NID: string;
50
- SEGMENTS_PATH: string;
51
48
  TEAM_SIZE_PATH: string;
52
49
  CITIES: string;
53
50
  INIT: string;
@@ -55,10 +52,8 @@ export declare const ENDPOINT_PATHS: {
55
52
  RETRIEVE_ACTIVITIES_ISIC: string;
56
53
  CONNECT: string;
57
54
  CREATE_CONNECT: string;
58
- SEGMENT_LOCATION: string;
59
- SEGMENT_PROFIT: string;
60
- SEGMENT_TECH: string;
61
55
  MERCHANT: string;
62
56
  TERMINAL: string;
63
57
  CURRENCY: string;
58
+ SEGMENT_LIST: string;
64
59
  };
@@ -21,9 +21,7 @@ var CHECK_EMAIL = '/individual/email/availability';
21
21
  var CHECK_BRAND = '/brand/name/check';
22
22
  var CREATE_ACCOUNT_PATH = '/account';
23
23
  var CHANNEL_PATH = '/v2/channel';
24
- var CUSTOMER_BASES_PATH = '/v2/customerBases';
25
- var SALES_PATH = '/v2/sales';
26
- var EXPECTED_CUSTOMERS_PATH = '/v2/expectedCustomers';
24
+ var BRAND_OPERATIONS = 'v2/operations';
27
25
  var SIGNUP_PATH = '/signup';
28
26
  var SOURCE_INCOME_PATH = '/v2/sourceOfIncome';
29
27
  var MONTHLY_INCOME_PATH = '/v2/monthlyIncome';
@@ -48,16 +46,13 @@ var CREATE_CONNECT = '/v3/connect';
48
46
  var CREATE_AUTH_NID_PATH = "".concat(CONNECT_PATH, "/auth");
49
47
  var VERIFY_AUTH_OTP_PATH = "".concat(CONNECT_PATH, "/auth");
50
48
  var DOCUMENT_PATH = '/document';
51
- var SEGMENTS_PATH = '/businessSegment/list';
52
49
  var TEAM_SIZE_PATH = '/businessSegment/team/list';
53
50
  var ADDRESS_PATH = '/address';
54
51
  var INIT_PATH = 'init';
55
52
  var BUSINESS_PATH = '/business';
56
53
  var MERCHANT_PATH = '/merchant';
57
54
  var TERMINAL_PATH = '/terminal';
58
- var SEGMENT_LOCATION_PATH = "".concat(BRAND_PATH, "/segment/location");
59
- var SEGMENT_PROFIT_PATH = "".concat(BRAND_PATH, "/segment/profit");
60
- var SEGMENT_TECH_PATH = "".concat(BRAND_PATH, "/segment/tech");
55
+ var SEGMENT_LIST = "v2".concat(BRAND_PATH, "/segment");
61
56
  var CREATE_TOKEN_PATH = '/token';
62
57
  var MIGRATION_STATUS = '/migration';
63
58
  export var ENDPOINT_PATHS = {
@@ -87,9 +82,7 @@ export var ENDPOINT_PATHS = {
87
82
  FIREBASE_URL: FIREBASE_URL,
88
83
  CREATE_ACCOUNT: CREATE_ACCOUNT_PATH,
89
84
  CHANNEL: CHANNEL_PATH,
90
- CUSTOMER_BASES: CUSTOMER_BASES_PATH,
91
- SALES: SALES_PATH,
92
- EXPECTED_CUSTOMERS: EXPECTED_CUSTOMERS_PATH,
85
+ BRAND_OPERATIONS: BRAND_OPERATIONS,
93
86
  SIGNUP: SIGNUP_PATH,
94
87
  SOURCE_INCOME: SOURCE_INCOME_PATH,
95
88
  MONTHLY_INCOME: MONTHLY_INCOME_PATH,
@@ -109,7 +102,6 @@ export var ENDPOINT_PATHS = {
109
102
  RETRIEVE_ACTIVITIES_LIST_PATH: RETRIEVE_ACTIVITIES_LIST_PATH,
110
103
  DOCUMENT: DOCUMENT_PATH,
111
104
  CREATE_AUTH_NID: CREATE_AUTH_NID_PATH,
112
- SEGMENTS_PATH: SEGMENTS_PATH,
113
105
  TEAM_SIZE_PATH: TEAM_SIZE_PATH,
114
106
  CITIES: CITIES_PATH,
115
107
  INIT: INIT_PATH,
@@ -117,10 +109,8 @@ export var ENDPOINT_PATHS = {
117
109
  RETRIEVE_ACTIVITIES_ISIC: RETRIEVE_ACTIVITIES_ISIC_PATH,
118
110
  CONNECT: CONNECT_PATH,
119
111
  CREATE_CONNECT: CREATE_CONNECT,
120
- SEGMENT_LOCATION: SEGMENT_LOCATION_PATH,
121
- SEGMENT_PROFIT: SEGMENT_PROFIT_PATH,
122
- SEGMENT_TECH: SEGMENT_TECH_PATH,
123
112
  MERCHANT: MERCHANT_PATH,
124
113
  TERMINAL: TERMINAL_PATH,
125
- CURRENCY: CURRENCY_PATH
114
+ CURRENCY: CURRENCY_PATH,
115
+ SEGMENT_LIST: SEGMENT_LIST
126
116
  };
@@ -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/";
@@ -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/';
@@ -53,6 +53,7 @@ export declare const retrieveSegmentDataList: import("@reduxjs/toolkit").AsyncTh
53
53
  segmentLocation: any;
54
54
  segmentProfit: any;
55
55
  segmentTech: any;
56
+ segmentTeam: any;
56
57
  }, void, {
57
58
  state?: unknown;
58
59
  dispatch?: import("redux").Dispatch<import("redux").AnyAction> | undefined;
@@ -199,7 +199,7 @@ export var verifyBrandLeadOTP = createAsyncThunk('brand/verifyLeadOTP', function
199
199
  });
200
200
  }); });
201
201
  export var retrieveSegmentDataList = createAsyncThunk('brandRetrieveSegmentDataList', function () { return __awaiter(void 0, void 0, void 0, function () {
202
- var dataBody, _a, segmentLocation, segmentProfit, segmentTech;
202
+ var dataBody, _a, team, location, profit, tech;
203
203
  return __generator(this, function (_b) {
204
204
  switch (_b.label) {
205
205
  case 0:
@@ -207,17 +207,14 @@ export var retrieveSegmentDataList = createAsyncThunk('brandRetrieveSegmentDataL
207
207
  page: 0,
208
208
  limit: 50
209
209
  };
210
- return [4, Promise.all([
211
- API.dataService.getSegmentLocation(dataBody),
212
- API.dataService.getSegmentProfit(dataBody),
213
- API.dataService.getSegmentTech(dataBody)
214
- ])];
210
+ return [4, API.dataService.getSegments(dataBody)];
215
211
  case 1:
216
- _a = _b.sent(), segmentLocation = _a[0].list, segmentProfit = _a[1].list, segmentTech = _a[2].list;
212
+ _a = _b.sent(), team = _a.team, location = _a.location, profit = _a.profit, tech = _a.tech;
217
213
  return [2, {
218
- segmentLocation: segmentLocation,
219
- segmentProfit: segmentProfit,
220
- segmentTech: segmentTech
214
+ segmentLocation: (location === null || location === void 0 ? void 0 : location.list) || [],
215
+ segmentProfit: (profit === null || profit === void 0 ? void 0 : profit.list) || [],
216
+ segmentTech: (tech === null || tech === void 0 ? void 0 : tech.list) || [],
217
+ segmentTeam: (team === null || team === void 0 ? void 0 : team.list) || []
221
218
  }];
222
219
  }
223
220
  });
@@ -296,10 +293,10 @@ export var checkBrandNameAvailability = createAsyncThunk('checkBrandNameAvailabi
296
293
  export var updateBrand = createAsyncThunk('brandUpdateBrand', function (_a, thunkApi) {
297
294
  var formData = _a.formData, originalFormData = _a.originalFormData, isDirty = _a.isDirty;
298
295
  return __awaiter(void 0, void 0, void 0, function () {
299
- var _b, settings, brand, brandRes, _c, id, data_status, isNameENNonEditable, isNameARNonEditable, isChannelServicesNonEditable, salesChannels, brandName, brandLogoId, brandData, getAddress, channel_services, brandNameIsEditable, requestBody, brand_1, _d, teamSizeList, _e, segmentLocation, segmentProfit, segmentTech, _f, _g, _h;
300
- var _j, _k;
301
- return __generator(this, function (_l) {
302
- switch (_l.label) {
296
+ var _b, settings, brand, brandRes, _c, id, data_status, isNameENNonEditable, isNameARNonEditable, isChannelServicesNonEditable, salesChannels, brandName, brandLogoId, brandData, getAddress, channel_services, brandNameIsEditable, requestBody, brand_1, _d, segmentLocation, segmentProfit, segmentTech, segmentTeam;
297
+ var _e, _f;
298
+ return __generator(this, function (_g) {
299
+ switch (_g.label) {
303
300
  case 0:
304
301
  _b = thunkApi.getState(), settings = _b.settings, brand = _b.brand;
305
302
  brandRes = (brand.data.verify.responseBody || {}).brand;
@@ -338,24 +335,18 @@ export var updateBrand = createAsyncThunk('brandUpdateBrand', function (_a, thun
338
335
  if (!isDirty) return [3, 2];
339
336
  return [4, API.brandService.updateBrandInfo(requestBody)];
340
337
  case 1:
341
- brand_1 = (_l.sent()).brand;
338
+ brand_1 = (_g.sent()).brand;
342
339
  brandData = brand_1;
343
- _l.label = 2;
344
- case 2:
345
- _g = (_f = Promise).all;
346
- _h = [API.dataService.getTeamSize({ page: 0 })];
347
- return [4, thunkApi.dispatch(retrieveSegmentDataList()).unwrap()];
348
- case 3: return [4, _g.apply(_f, [_h.concat([
349
- _l.sent()
350
- ])])];
351
- case 4:
352
- _d = _l.sent(), teamSizeList = _d[0], _e = _d[1], segmentLocation = _e.segmentLocation, segmentProfit = _e.segmentProfit, segmentTech = _e.segmentTech;
340
+ _g.label = 2;
341
+ case 2: return [4, thunkApi.dispatch(retrieveSegmentDataList()).unwrap()];
342
+ case 3:
343
+ _d = _g.sent(), segmentLocation = _d.segmentLocation, segmentProfit = _d.segmentProfit, segmentTech = _d.segmentTech, segmentTeam = _d.segmentTeam;
353
344
  sleep(100).then(function () { return thunkApi.dispatch(handleNextScreenStep()); });
354
- (_k = (_j = settings.data.appConfig).onStepCompleted) === null || _k === void 0 ? void 0 : _k.call(_j, settings.data.activeScreen.name, id);
345
+ (_f = (_e = settings.data.appConfig).onStepCompleted) === null || _f === void 0 ? void 0 : _f.call(_e, settings.data.activeScreen.name, id);
355
346
  return [2, {
356
347
  data: __assign({}, brandData),
357
348
  formData: originalFormData,
358
- teamSizeList: teamSizeList === null || teamSizeList === void 0 ? void 0 : teamSizeList.list,
349
+ teamSizeList: segmentTeam,
359
350
  segmentLocationList: segmentLocation,
360
351
  segmentProfitList: segmentProfit,
361
352
  segmentTechList: segmentTech
@@ -499,30 +490,24 @@ export var updateBrandActivities = createAsyncThunk('brandUpdateBrandActivities'
499
490
  });
500
491
  });
501
492
  export var retrieveDataList = createAsyncThunk('brandRetrieveDataList', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
502
- var settings, countryISO2, dataBody, salesDataBody, _a, customerBases, expectedSales, expectedCustomerSales;
503
- return __generator(this, function (_b) {
504
- switch (_b.label) {
493
+ var settings, countryISO2, dataBody, _a, customer_base, sales, expected_customers;
494
+ var _b;
495
+ return __generator(this, function (_c) {
496
+ switch (_c.label) {
505
497
  case 0:
506
498
  settings = thunkApi.getState().settings;
507
499
  countryISO2 = settings.data.businessCountry.iso2;
508
500
  dataBody = {
509
- page: 0
510
- };
511
- salesDataBody = {
512
501
  page: 0,
513
502
  country_code: [countryISO2]
514
503
  };
515
- return [4, Promise.all([
516
- API.dataService.getCustomerBases(dataBody),
517
- API.dataService.getExpectedSales(salesDataBody),
518
- API.dataService.getExpectedCustomerSales(dataBody)
519
- ])];
504
+ return [4, API.dataService.getBrandOperations(dataBody)];
520
505
  case 1:
521
- _a = _b.sent(), customerBases = _a[0].list, expectedSales = _a[1].list, expectedCustomerSales = _a[2].list;
506
+ _a = _c.sent(), customer_base = _a.customer_base, sales = _a.sales, expected_customers = _a.expected_customers;
522
507
  return [2, {
523
- customerBases: customerBases,
524
- expectedSales: (expectedSales === null || expectedSales === void 0 ? void 0 : expectedSales.length) ? expectedSales : EXPECTED_SALES_LIST,
525
- expectedCustomerSales: expectedCustomerSales,
508
+ customerBases: (customer_base === null || customer_base === void 0 ? void 0 : customer_base.list) || [],
509
+ expectedSales: ((_b = sales === null || sales === void 0 ? void 0 : sales.list) === null || _b === void 0 ? void 0 : _b.length) ? sales.list : EXPECTED_SALES_LIST,
510
+ expectedCustomerSales: (expected_customers === null || expected_customers === void 0 ? void 0 : expected_customers.list) || [],
526
511
  countryISO2: countryISO2
527
512
  }];
528
513
  }
@@ -664,30 +664,24 @@ export var updateActivitiesInfo = createAsyncThunk('updateActivitiesInfo', funct
664
664
  });
665
665
  });
666
666
  export var retrieveDataList = createAsyncThunk('businessRetrieveDataList', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
667
- var settings, countryISO2, dataBody, salesDataBody, _a, customerBases, expectedSales, expectedCustomerSales;
668
- return __generator(this, function (_b) {
669
- switch (_b.label) {
667
+ var settings, countryISO2, dataBody, _a, customer_base, sales, expected_customers;
668
+ var _b;
669
+ return __generator(this, function (_c) {
670
+ switch (_c.label) {
670
671
  case 0:
671
672
  settings = thunkApi.getState().settings;
672
673
  countryISO2 = settings.data.businessCountry.iso2;
673
674
  dataBody = {
674
- page: 0
675
- };
676
- salesDataBody = {
677
675
  page: 0,
678
676
  country_code: [countryISO2]
679
677
  };
680
- return [4, Promise.all([
681
- API.dataService.getCustomerBases(dataBody),
682
- API.dataService.getExpectedSales(salesDataBody),
683
- API.dataService.getExpectedCustomerSales(dataBody)
684
- ])];
678
+ return [4, API.dataService.getBrandOperations(dataBody)];
685
679
  case 1:
686
- _a = _b.sent(), customerBases = _a[0].list, expectedSales = _a[1].list, expectedCustomerSales = _a[2].list;
680
+ _a = _c.sent(), customer_base = _a.customer_base, sales = _a.sales, expected_customers = _a.expected_customers;
687
681
  return [2, {
688
- customerBases: customerBases,
689
- expectedSales: (expectedSales === null || expectedSales === void 0 ? void 0 : expectedSales.length) ? expectedSales : EXPECTED_SALES_LIST,
690
- expectedCustomerSales: expectedCustomerSales,
682
+ customerBases: (customer_base === null || customer_base === void 0 ? void 0 : customer_base.list) || [],
683
+ expectedSales: ((_b = sales === null || sales === void 0 ? void 0 : sales.list) === null || _b === void 0 ? void 0 : _b.length) ? sales.list : EXPECTED_SALES_LIST,
684
+ expectedCustomerSales: (expected_customers === null || expected_customers === void 0 ? void 0 : expected_customers.list) || [],
691
685
  countryISO2: countryISO2
692
686
  }];
693
687
  }
@@ -463,7 +463,7 @@ export var retrieveLead = createAsyncThunk('connect/retrieveLead', function (par
463
463
  });
464
464
  }); });
465
465
  export var updateLeadBrand = createAsyncThunk('updateLeadBrand', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
466
- var _a, settings, connect, responseBody, leadBrandId, isNewBrand, brandName, salesChannels, selectedBrandItem, brandLogoId, termAndConditionChecked, getAddress, channel_services, payload_1, brandReqBody_1, brand_1, teamSize, err_5, brandNameBody, payload, lead, brandReqBody, brand, teamSize, err_6;
466
+ var _a, settings, connect, responseBody, leadBrandId, isNewBrand, brandName, salesChannels, selectedBrandItem, brandLogoId, termAndConditionChecked, getAddress, channel_services, payload_1, brandReqBody_1, brand_1, team, err_5, brandNameBody, payload, lead, brandReqBody, brand, team, err_6;
467
467
  var _b, _c, _d, _e, _f;
468
468
  return __generator(this, function (_g) {
469
469
  switch (_g.label) {
@@ -516,10 +516,10 @@ export var updateLeadBrand = createAsyncThunk('updateLeadBrand', function (param
516
516
  _g.label = 4;
517
517
  case 4:
518
518
  _g.trys.push([4, 6, , 7]);
519
- return [4, API.dataService.getTeamSize({ page: 0 })];
519
+ return [4, API.dataService.getSegments({ page: 0, limit: 50 })];
520
520
  case 5:
521
- teamSize = _g.sent();
522
- brand_1.team_size_list = teamSize.list;
521
+ team = (_g.sent()).team;
522
+ brand_1.team_size_list = (team === null || team === void 0 ? void 0 : team.list) || [];
523
523
  return [3, 7];
524
524
  case 6:
525
525
  err_5 = _g.sent();
@@ -562,10 +562,10 @@ export var updateLeadBrand = createAsyncThunk('updateLeadBrand', function (param
562
562
  _g.label = 11;
563
563
  case 11:
564
564
  _g.trys.push([11, 13, , 14]);
565
- return [4, API.dataService.getTeamSize({ page: 0 })];
565
+ return [4, API.dataService.getSegments({ page: 0, limit: 50 })];
566
566
  case 12:
567
- teamSize = _g.sent();
568
- brand.team_size_list = teamSize.list;
567
+ team = (_g.sent()).team;
568
+ brand.team_size_list = (team === null || team === void 0 ? void 0 : team.list) || [];
569
569
  return [3, 14];
570
570
  case 13:
571
571
  err_6 = _g.sent();
@@ -7,6 +7,7 @@ interface verifyLeadTokenProps {
7
7
  export declare const verifyLeadToken: import("@reduxjs/toolkit").AsyncThunk<{
8
8
  data: any;
9
9
  token: string;
10
+ flows: any;
10
11
  }, verifyLeadTokenProps, {
11
12
  state?: unknown;
12
13
  dispatch?: import("redux").Dispatch<import("redux").AnyAction> | undefined;
@@ -49,6 +50,7 @@ export declare const verifyPasswordLeadOTP: import("@reduxjs/toolkit").AsyncThun
49
50
  formData: {
50
51
  otp: string;
51
52
  };
53
+ flows: any;
52
54
  }, OTPFormValues, {
53
55
  state?: unknown;
54
56
  dispatch?: import("redux").Dispatch<import("redux").AnyAction> | undefined;
@@ -55,7 +55,7 @@ import { retrieveIndividualData, sleep } from '../../../utils';
55
55
  export var verifyLeadToken = createAsyncThunk('passwordVerifyLeadToken', function (_a, thunkApi) {
56
56
  var token = _a.token, isInternally = _a.isInternally;
57
57
  return __awaiter(void 0, void 0, void 0, function () {
58
- var payload, data, _b, config, board_info_password_status, country_code, board_id, countryIso2, publicKey, data_1;
58
+ var payload, data, _b, config, board_info_password_status, country_code, board_id, recipient, countryIso2, publicKey, data_1, flows, data_2;
59
59
  var _c, _d;
60
60
  return __generator(this, function (_e) {
61
61
  switch (_e.label) {
@@ -72,7 +72,7 @@ export var verifyLeadToken = createAsyncThunk('passwordVerifyLeadToken', functio
72
72
  throw new Error(data.errors[0].description || (data === null || data === void 0 ? void 0 : data.mw_error));
73
73
  if (isInternally)
74
74
  data.step_name = PASSWORD_STEP_NAMES.PASSWORD_INFO;
75
- _b = data || {}, config = _b.config, board_info_password_status = _b.board_info_password_status, country_code = _b.country_code, board_id = _b.board_id;
75
+ _b = data || {}, config = _b.config, board_info_password_status = _b.board_info_password_status, country_code = _b.country_code, board_id = _b.id, recipient = _b.recipient;
76
76
  countryIso2 = country_code;
77
77
  if (countryIso2)
78
78
  thunkApi.dispatch(handleSetCountryByIso2(countryIso2));
@@ -87,16 +87,27 @@ export var verifyLeadToken = createAsyncThunk('passwordVerifyLeadToken', functio
87
87
  thunkApi.dispatch(handleSetCountryByIso2(data_1.entity.country));
88
88
  _e.label = 3;
89
89
  case 3:
90
- if (data.step_name === PASSWORD_STEP_NAMES.PHONE_AUTH) {
91
- thunkApi.dispatch(handleCurrentActiveScreen('PASSWORD_VERIFY_STEP'));
92
- }
93
- else if (board_info_password_status === 'completed') {
94
- thunkApi.dispatch(handleNextScreenStep('PASSWORD_SUCCESS_FOUR_FLOWS_BUTTONS_STEP'));
95
- }
96
- else if (data.step_name === PASSWORD_STEP_NAMES.PASSWORD_INFO) {
90
+ flows = [];
91
+ if (!(data.step_name === PASSWORD_STEP_NAMES.PHONE_AUTH)) return [3, 4];
92
+ thunkApi.dispatch(handleCurrentActiveScreen('PASSWORD_VERIFY_STEP'));
93
+ return [3, 7];
94
+ case 4:
95
+ if (!(board_info_password_status === 'completed')) return [3, 6];
96
+ return [4, Promise.all([
97
+ API.boardService.retrieveBoardInfoStatus(board_id),
98
+ thunkApi.dispatch(retrieveBoardDetails({ boardId: board_id, individualId: recipient === null || recipient === void 0 ? void 0 : recipient.id, individualType: recipient === null || recipient === void 0 ? void 0 : recipient.type })).unwrap()
99
+ ])];
100
+ case 5:
101
+ data_2 = (_e.sent())[0];
102
+ flows = (data_2 === null || data_2 === void 0 ? void 0 : data_2.info) || [];
103
+ thunkApi.dispatch(handleNextScreenStep('PASSWORD_SUCCESS_FOUR_FLOWS_BUTTONS_STEP'));
104
+ return [3, 7];
105
+ case 6:
106
+ if (data.step_name === PASSWORD_STEP_NAMES.PASSWORD_INFO) {
97
107
  thunkApi.dispatch(handleNextScreenStep('PASSWORD_CREATE_PASSWORD_STEP'));
98
108
  }
99
- return [2, { data: data, token: token }];
109
+ _e.label = 7;
110
+ case 7: return [2, { data: data, token: token, flows: flows }];
100
111
  }
101
112
  });
102
113
  });
@@ -144,7 +155,7 @@ export var retrieveBoardDetails = createAsyncThunk('retrievePasswordBoardDetails
144
155
  });
145
156
  });
146
157
  export var verifyPasswordLeadOTP = createAsyncThunk('verifyPasswordLeadOTP', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
147
- var _a, password, settings, responseBody, payload, data, _b, config, board_info_password_status, country_code, board_id, countryIso2, publicKey, data_2;
158
+ var _a, password, settings, responseBody, payload, data, _b, config, board_info_password_status, country_code, board_id, recipient, countryIso2, publicKey, flows, data_3, data_4;
148
159
  var _c, _d, _e, _f, _g;
149
160
  return __generator(this, function (_h) {
150
161
  switch (_h.label) {
@@ -163,7 +174,7 @@ export var verifyPasswordLeadOTP = createAsyncThunk('verifyPasswordLeadOTP', fun
163
174
  data = (_h.sent()).data;
164
175
  if ((_d = data === null || data === void 0 ? void 0 : data.errors) === null || _d === void 0 ? void 0 : _d.length)
165
176
  throw new Error(data.errors[0].description);
166
- _b = data || {}, config = _b.config, board_info_password_status = _b.board_info_password_status, country_code = _b.country_code, board_id = _b.board_id;
177
+ _b = data || {}, config = _b.config, board_info_password_status = _b.board_info_password_status, country_code = _b.country_code, board_id = _b.id, recipient = _b.recipient;
167
178
  countryIso2 = country_code;
168
179
  if (countryIso2)
169
180
  thunkApi.dispatch(handleSetCountryByIso2(countryIso2));
@@ -171,21 +182,29 @@ export var verifyPasswordLeadOTP = createAsyncThunk('verifyPasswordLeadOTP', fun
171
182
  if (publicKey)
172
183
  thunkApi.dispatch(handlePublicKey(publicKey));
173
184
  (_f = (_e = settings.data.appConfig).onStepCompleted) === null || _f === void 0 ? void 0 : _f.call(_e, settings.data.activeScreen.name, { otp: params.otp });
174
- if (!(board_info_password_status === 'completed')) return [3, 2];
175
- thunkApi.dispatch(handleNextScreenStep('PASSWORD_SUCCESS_FOUR_FLOWS_BUTTONS_STEP'));
176
- return [3, 5];
185
+ flows = [];
186
+ if (!(board_info_password_status === 'completed')) return [3, 3];
187
+ return [4, Promise.all([
188
+ API.boardService.retrieveBoardInfoStatus(board_id),
189
+ thunkApi.dispatch(retrieveBoardDetails({ boardId: board_id, individualId: recipient === null || recipient === void 0 ? void 0 : recipient.id, individualType: recipient === null || recipient === void 0 ? void 0 : recipient.type })).unwrap()
190
+ ])];
177
191
  case 2:
178
- if (!!country_code) return [3, 4];
179
- return [4, API.boardService.retrieveBoardDetails(board_id)];
192
+ data_3 = (_h.sent())[0];
193
+ flows = (data_3 === null || data_3 === void 0 ? void 0 : data_3.info) || [];
194
+ thunkApi.dispatch(handleNextScreenStep('PASSWORD_SUCCESS_FOUR_FLOWS_BUTTONS_STEP'));
195
+ return [3, 6];
180
196
  case 3:
181
- data_2 = _h.sent();
182
- if ((_g = data_2 === null || data_2 === void 0 ? void 0 : data_2.entity) === null || _g === void 0 ? void 0 : _g.country)
183
- thunkApi.dispatch(handleSetCountryByIso2(data_2.entity.country));
184
- _h.label = 4;
197
+ if (!!country_code) return [3, 5];
198
+ return [4, API.boardService.retrieveBoardDetails(board_id)];
185
199
  case 4:
186
- thunkApi.dispatch(handleNextScreenStep('PASSWORD_CREATE_PASSWORD_STEP'));
200
+ data_4 = _h.sent();
201
+ if ((_g = data_4 === null || data_4 === void 0 ? void 0 : data_4.entity) === null || _g === void 0 ? void 0 : _g.country)
202
+ thunkApi.dispatch(handleSetCountryByIso2(data_4.entity.country));
187
203
  _h.label = 5;
188
- case 5: return [2, { data: data, formData: __assign({}, params) }];
204
+ case 5:
205
+ thunkApi.dispatch(handleNextScreenStep('PASSWORD_CREATE_PASSWORD_STEP'));
206
+ _h.label = 6;
207
+ case 6: return [2, { data: data, formData: __assign({}, params), flows: flows }];
189
208
  }
190
209
  });
191
210
  }); });
@@ -270,7 +289,7 @@ export var retrieveBoardStatus = createAsyncThunk('password/retrieveBoardStatus'
270
289
  });
271
290
  }); });
272
291
  export var verifyOperationToken = createAsyncThunk('verifyOperationToken', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
273
- var token, boardId, boardInfoId, userId, userType, payload, data, countryIso2, publicKey, data_3;
292
+ var token, boardId, boardInfoId, userId, userType, payload, data, countryIso2, publicKey, data_5;
274
293
  var _a, _b, _c;
275
294
  return __generator(this, function (_d) {
276
295
  switch (_d.label) {
@@ -294,9 +313,9 @@ export var verifyOperationToken = createAsyncThunk('verifyOperationToken', funct
294
313
  if (!!(data === null || data === void 0 ? void 0 : data.country)) return [3, 3];
295
314
  return [4, API.boardService.retrieveBoardDetails(boardId)];
296
315
  case 2:
297
- data_3 = _d.sent();
298
- if ((_c = data_3 === null || data_3 === void 0 ? void 0 : data_3.entity) === null || _c === void 0 ? void 0 : _c.country)
299
- thunkApi.dispatch(handleSetCountryByIso2(data_3.entity.country));
316
+ data_5 = _d.sent();
317
+ if ((_c = data_5 === null || data_5 === void 0 ? void 0 : data_5.entity) === null || _c === void 0 ? void 0 : _c.country)
318
+ thunkApi.dispatch(handleSetCountryByIso2(data_5.entity.country));
300
319
  _d.label = 3;
301
320
  case 3:
302
321
  thunkApi.dispatch(handleNextScreenStep('PASSWORD_CREATE_PASSWORD_STEP'));
@@ -441,8 +460,10 @@ export var passwordSlice = createSlice({
441
460
  state.data.verify.operationType = PASSWORD_OPERATION_TYPE.SET_PASSWORD;
442
461
  state.error = null;
443
462
  state.customLoading = false;
444
- var _a = action.payload, data = _a.data, token = _a.token;
445
- state.data.verify.responseBody = __assign(__assign(__assign({}, data), state.data.verify.responseBody), { board_id: data.id });
463
+ var _a = action.payload, data = _a.data, token = _a.token, flows = _a.flows;
464
+ state.data.verify.responseBody = __assign(__assign(__assign(__assign({}, data), state.data.verify.responseBody), { board_id: data.id }), ((flows === null || flows === void 0 ? void 0 : flows.length) && {
465
+ flows: flows
466
+ }));
446
467
  state.data.verify.token = token;
447
468
  })
448
469
  .addCase(verifyLeadToken.pending, function (state) {
@@ -477,10 +498,12 @@ export var passwordSlice = createSlice({
477
498
  .addCase(verifyPasswordLeadOTP.fulfilled, function (state, action) {
478
499
  state.loading = false;
479
500
  state.error = null;
480
- var _a = action.payload, data = _a.data, formData = _a.formData;
501
+ var _a = action.payload, data = _a.data, formData = _a.formData, flows = _a.flows;
481
502
  state.data.otpData = formData;
482
503
  state.data.otpData.responseBody = data;
483
- state.data.verify.responseBody = __assign(__assign(__assign({}, data), state.data.verify.responseBody), { board_id: data.id });
504
+ state.data.verify.responseBody = __assign(__assign(__assign(__assign({}, data), state.data.verify.responseBody), { board_id: data.id }), ((flows === null || flows === void 0 ? void 0 : flows.length) && {
505
+ flows: flows
506
+ }));
484
507
  })
485
508
  .addCase(verifyPasswordLeadOTP.rejected, function (state, action) {
486
509
  state.loading = false;
@@ -1,5 +1,5 @@
1
1
  import { axiosInstance } from '../api';
2
- import { ENDPOINT_PATHS, CONNECT_SANDBOX_URL, CONNECT_PROD_URL } from '../constants';
2
+ import { ENDPOINT_PATHS, CONNECT_DEV_URL, CONNECT_PROD_URL } from '../constants';
3
3
  export var sleep = function (milliseconds) {
4
4
  if (milliseconds === void 0) { milliseconds = 1000; }
5
5
  return new Promise(function (resolve) { return setTimeout(resolve, milliseconds); });
@@ -16,7 +16,7 @@ export var setBaseUrl = function (publicKey) {
16
16
  axiosInstance.defaults.baseURL = ENDPOINT_PATHS.PRODUCTION_BASE_URL;
17
17
  return;
18
18
  }
19
- axiosInstance.defaults.baseURL = ENDPOINT_PATHS.SANDBOX_BASE_URL;
19
+ axiosInstance.defaults.baseURL = ENDPOINT_PATHS.DEV_BASE_URL;
20
20
  };
21
21
  export var updateLocationUrlWithCountry = function (countryIso2) {
22
22
  var country = countryIso2.toLowerCase();
@@ -35,7 +35,7 @@ export var updateLocationUrlWithCountry = function (countryIso2) {
35
35
  window.history.replaceState({}, '', newUrl);
36
36
  };
37
37
  export var openConnect = function (pk, countryCode) {
38
- var newUrl = new URL(pk.includes('pk_live') ? CONNECT_PROD_URL : CONNECT_SANDBOX_URL);
38
+ var newUrl = new URL(pk.includes('pk_live') ? CONNECT_PROD_URL : CONNECT_DEV_URL);
39
39
  if (countryCode) {
40
40
  newUrl.pathname = "/".concat(countryCode.toLowerCase());
41
41
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tap-payments/auth-jsconnect",
3
- "version": "2.8.62-sandbox",
3
+ "version": "2.8.65-development",
4
4
  "description": "connect library, auth",
5
5
  "private": false,
6
6
  "main": "build/index.js",
@@ -21,7 +21,7 @@
21
21
  "copy:files": "copyfiles -u 1 src/**/*.css build/",
22
22
  "tsc:alias": "tsc-alias -p tsconfig.json",
23
23
  "ts:build": "rm -rf build && tsc -p tsconfig.json && tsc-alias -p tsconfig.json && yarn copy:files",
24
- "push": "npm publish --access public --tag sandbox"
24
+ "push": "npm publish --access public --tag development"
25
25
  },
26
26
  "keywords": [],
27
27
  "author": {