@tap-payments/os-micro-frontend-shared 0.1.328 → 0.1.330

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.
@@ -12,6 +12,7 @@ export declare const StyledAnimatedSpinner: import("@emotion/styled").StyledComp
12
12
  content?: string | undefined;
13
13
  translate?: "yes" | "no" | undefined;
14
14
  id?: string | undefined;
15
+ loading?: "eager" | "lazy" | undefined;
15
16
  defaultChecked?: boolean | undefined;
16
17
  defaultValue?: string | number | readonly string[] | undefined;
17
18
  suppressContentEditableWarning?: boolean | undefined;
@@ -274,7 +275,6 @@ export declare const StyledAnimatedSpinner: import("@emotion/styled").StyledComp
274
275
  src?: string | undefined;
275
276
  alt?: string | undefined;
276
277
  decoding?: "auto" | "async" | "sync" | undefined;
277
- loading?: "eager" | "lazy" | undefined;
278
278
  fetchPriority?: "auto" | "high" | "low" | undefined;
279
279
  srcSet?: string | undefined;
280
280
  } & import("framer-motion").MotionProps & import("react").RefAttributes<HTMLImageElement> & import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme> & AnimatedSpinnerIconProps, {}, {}>;
@@ -0,0 +1,5 @@
1
+ interface PaymentIconProps {
2
+ type: string;
3
+ }
4
+ export declare function PaymentIcon({ type }: PaymentIconProps): import("react/jsx-runtime").JSX.Element;
5
+ export {};
@@ -0,0 +1,9 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import Box from '@mui/material/Box';
3
+ import { getPaymentMethodsIcon } from '../../constants/index.js';
4
+ import { PaymentChip } from './style';
5
+ export function PaymentIcon({ type }) {
6
+ return (_jsx(PaymentChip, { children: _jsx(Box, { component: "img", src: getPaymentMethodsIcon(type), sx: { width: 18, height: 12, objectFit: 'contain' }, onError: (e) => {
7
+ e.currentTarget.src = getPaymentMethodsIcon('card');
8
+ } }) }));
9
+ }
@@ -14,6 +14,7 @@ import { useState, useCallback, useMemo } from 'react';
14
14
  import { Menu } from '../index.js';
15
15
  import { rightArrow } from '../../constants/index.js';
16
16
  import { MenuItemStyled } from './style';
17
+ import { PaymentIcon } from './PaymentIcon';
17
18
  export default function PaymentMethod({ icon, name, options = [], filters, setFilters }) {
18
19
  var _a;
19
20
  const [anchorEl, setAnchorEl] = useState(null);
@@ -50,5 +51,5 @@ export default function PaymentMethod({ icon, name, options = [], filters, setFi
50
51
  setFilters(Object.assign(Object.assign({}, filters), { payment_methods: [...(paymentMethods !== null && paymentMethods !== void 0 ? paymentMethods : []), selectedPaymentMethod] }));
51
52
  }
52
53
  };
53
- return (_jsxs(MenuItemStyled, Object.assign({ isSelected: isSelected, isIndeterminate: isIndeterminate, onMouseEnter: onOpen, onMouseLeave: onClose, onClick: onClick }, { children: [_jsx("img", { src: icon, alt: name }), _jsx("span", Object.assign({ className: "label" }, { children: name })), _jsx("img", { src: rightArrow, alt: "arrow", style: { height: 12 } }), _jsx(Menu, Object.assign({ open: Boolean(anchorEl), anchorEl: anchorEl, placement: "right-end" }, { children: options === null || options === void 0 ? void 0 : options.map((option) => (_jsx(MenuItemStyled, Object.assign({ isSelected: isSelectedPaymentMethod(option.type), onClick: (e) => onClickPaymentMethod(e, option.type) }, { children: _jsx("img", { src: option.icon, alt: option === null || option === void 0 ? void 0 : option.name, style: { height: 24, width: 36, objectFit: 'contain' } }) }), option.type))) }))] })));
54
+ return (_jsxs(MenuItemStyled, Object.assign({ isSelected: isSelected, isIndeterminate: isIndeterminate, onMouseEnter: onOpen, onMouseLeave: onClose, onClick: onClick }, { children: [_jsx("img", { src: icon, alt: name }), _jsx("span", Object.assign({ className: "label" }, { children: name })), _jsx("img", { src: rightArrow, alt: "arrow", style: { height: 12 } }), _jsx(Menu, Object.assign({ open: Boolean(anchorEl), anchorEl: anchorEl, placement: "right-end" }, { children: options === null || options === void 0 ? void 0 : options.map((option) => (_jsx(MenuItemStyled, Object.assign({ isSelected: isSelectedPaymentMethod(option.type), onClick: (e) => onClickPaymentMethod(e, option.type) }, { children: _jsx(PaymentIcon, { type: option.type }) }), option.type))) }))] })));
54
55
  }
@@ -14,6 +14,7 @@ import { useCallback, useMemo, useState } from 'react';
14
14
  import { Menu } from '../index.js';
15
15
  import { rightArrow } from '../../constants/index.js';
16
16
  import { MenuItemStyled } from './style';
17
+ import { PaymentIcon } from './PaymentIcon';
17
18
  export default function PaymentSchemes({ paymentSchemesSource, filters, setFilters }) {
18
19
  var _a, _b, _c, _d;
19
20
  const [anchorEl, setAnchorEl] = useState(null);
@@ -49,5 +50,5 @@ export default function PaymentSchemes({ paymentSchemesSource, filters, setFilte
49
50
  setFilters(Object.assign(Object.assign({}, filters), { payment_scheme: [...((_b = filters === null || filters === void 0 ? void 0 : filters.payment_scheme) !== null && _b !== void 0 ? _b : []), selectedPaymentScheme] }));
50
51
  }
51
52
  };
52
- return (_jsxs(MenuItemStyled, Object.assign({ isSelected: isSelected, isIndeterminate: isIndeterminate, onMouseEnter: onOpen, onMouseLeave: onClose, onClick: onClick, sx: Object.assign({}, (isDisabled && { opacity: 0.5, pointerEvents: 'none' })) }, { children: [_jsx("span", Object.assign({ className: "label" }, { children: paymentSchemesSource === null || paymentSchemesSource === void 0 ? void 0 : paymentSchemesSource.name })), _jsx("img", { src: rightArrow, alt: "arrow", style: { height: 12 } }), _jsx(Menu, Object.assign({ open: Boolean(anchorEl), anchorEl: anchorEl, placement: "right-start" }, { children: (_d = paymentSchemesSource === null || paymentSchemesSource === void 0 ? void 0 : paymentSchemesSource.options) === null || _d === void 0 ? void 0 : _d.map((scheme) => (_jsx(MenuItemStyled, Object.assign({ isSelected: isSelectedPaymentScheme(scheme.type), onClick: (e) => onClickPaymentScheme(e, scheme.type) }, { children: _jsx("img", { src: scheme.icon, alt: scheme === null || scheme === void 0 ? void 0 : scheme.name, style: { height: 24 } }) }), scheme.type))) }))] })));
53
+ return (_jsxs(MenuItemStyled, Object.assign({ isSelected: isSelected, isIndeterminate: isIndeterminate, onMouseEnter: onOpen, onMouseLeave: onClose, onClick: onClick, sx: Object.assign({}, (isDisabled && { opacity: 0.5, pointerEvents: 'none' })) }, { children: [_jsx("span", Object.assign({ className: "label" }, { children: paymentSchemesSource === null || paymentSchemesSource === void 0 ? void 0 : paymentSchemesSource.name })), _jsx("img", { src: rightArrow, alt: "arrow", style: { height: 12 } }), _jsx(Menu, Object.assign({ open: Boolean(anchorEl), anchorEl: anchorEl, placement: "right-start" }, { children: (_d = paymentSchemesSource === null || paymentSchemesSource === void 0 ? void 0 : paymentSchemesSource.options) === null || _d === void 0 ? void 0 : _d.map((scheme) => (_jsx(MenuItemStyled, Object.assign({ isSelected: isSelectedPaymentScheme(scheme.type), onClick: (e) => onClickPaymentScheme(e, scheme.type) }, { children: _jsx(PaymentIcon, { type: scheme.type }) }), scheme.type))) }))] })));
53
54
  }
@@ -1 +1,5 @@
1
+ /// <reference types="react" />
1
2
  export declare const MenuItemStyled: import("@emotion/styled").StyledComponent<import("../MenuItem/MenuItem").MenuItemProps & import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, {}, {}>;
3
+ export declare const PaymentChip: import("@emotion/styled").StyledComponent<import("@mui/system").BoxOwnProps<import("@mui/material/styles").Theme> & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
4
+ ref?: ((instance: HTMLDivElement | null) => void) | import("react").RefObject<HTMLDivElement> | null | undefined;
5
+ }, keyof import("@mui/system").BoxOwnProps<import("@mui/material/styles").Theme>> & import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, {}, {}>;
@@ -1,4 +1,5 @@
1
1
  import { styled } from '@mui/material/styles';
2
+ import Box from '@mui/material/Box';
2
3
  import { MenuItem } from '../index.js';
3
4
  export const MenuItemStyled = styled(MenuItem)(({ theme }) => ({
4
5
  height: 40,
@@ -10,3 +11,12 @@ export const MenuItemStyled = styled(MenuItem)(({ theme }) => ({
10
11
  flexGrow: 1,
11
12
  },
12
13
  }));
14
+ export const PaymentChip = styled(Box)(({ theme }) => ({
15
+ width: 36,
16
+ height: 24,
17
+ border: `1px solid ${theme.palette.divider}`,
18
+ display: 'flex',
19
+ alignItems: 'center',
20
+ justifyContent: 'center',
21
+ borderRadius: '12px',
22
+ }));
@@ -300,6 +300,7 @@ export declare const Icon: import("@emotion/styled").StyledComponent<{
300
300
  content?: string | undefined;
301
301
  translate?: "yes" | "no" | undefined;
302
302
  id?: string | undefined;
303
+ loading?: "eager" | "lazy" | undefined;
303
304
  defaultChecked?: boolean | undefined;
304
305
  defaultValue?: string | number | readonly string[] | undefined;
305
306
  suppressContentEditableWarning?: boolean | undefined;
@@ -562,7 +563,6 @@ export declare const Icon: import("@emotion/styled").StyledComponent<{
562
563
  src?: string | undefined;
563
564
  alt?: string | undefined;
564
565
  decoding?: "auto" | "async" | "sync" | undefined;
565
- loading?: "eager" | "lazy" | undefined;
566
566
  fetchPriority?: "auto" | "high" | "low" | undefined;
567
567
  srcSet?: string | undefined;
568
568
  } & import("framer-motion").MotionProps & import("react").RefAttributes<HTMLImageElement> & import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, {}, {}>;
@@ -18,6 +18,7 @@ export declare const ActionIcon: import("@emotion/styled").StyledComponent<{
18
18
  content?: string | undefined;
19
19
  translate?: "yes" | "no" | undefined;
20
20
  id?: string | undefined;
21
+ loading?: "eager" | "lazy" | undefined;
21
22
  defaultChecked?: boolean | undefined;
22
23
  defaultValue?: string | number | readonly string[] | undefined;
23
24
  suppressContentEditableWarning?: boolean | undefined;
@@ -280,7 +281,6 @@ export declare const ActionIcon: import("@emotion/styled").StyledComponent<{
280
281
  src?: string | undefined;
281
282
  alt?: string | undefined;
282
283
  decoding?: "auto" | "async" | "sync" | undefined;
283
- loading?: "eager" | "lazy" | undefined;
284
284
  fetchPriority?: "auto" | "high" | "low" | undefined;
285
285
  srcSet?: string | undefined;
286
286
  } & import("framer-motion").MotionProps & import("react").RefAttributes<HTMLImageElement> & import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme> & {
@@ -11,6 +11,7 @@ export declare const StyledDownloadFileImage: import("@emotion/styled").StyledCo
11
11
  content?: string | undefined;
12
12
  translate?: "yes" | "no" | undefined;
13
13
  id?: string | undefined;
14
+ loading?: "eager" | "lazy" | undefined;
14
15
  defaultChecked?: boolean | undefined;
15
16
  defaultValue?: string | number | readonly string[] | undefined;
16
17
  suppressContentEditableWarning?: boolean | undefined;
@@ -273,7 +274,6 @@ export declare const StyledDownloadFileImage: import("@emotion/styled").StyledCo
273
274
  src?: string | undefined;
274
275
  alt?: string | undefined;
275
276
  decoding?: "auto" | "async" | "sync" | undefined;
276
- loading?: "eager" | "lazy" | undefined;
277
277
  fetchPriority?: "auto" | "high" | "low" | undefined;
278
278
  srcSet?: string | undefined;
279
279
  } & import("framer-motion").MotionProps & import("react").RefAttributes<HTMLImageElement> & import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, {}, {}>;
@@ -8,6 +8,7 @@ export declare const MultiRefundIcon: import("@emotion/styled").StyledComponent<
8
8
  content?: string | undefined;
9
9
  translate?: "yes" | "no" | undefined;
10
10
  id?: string | undefined;
11
+ loading?: "eager" | "lazy" | undefined;
11
12
  defaultChecked?: boolean | undefined;
12
13
  defaultValue?: string | number | readonly string[] | undefined;
13
14
  suppressContentEditableWarning?: boolean | undefined;
@@ -270,7 +271,6 @@ export declare const MultiRefundIcon: import("@emotion/styled").StyledComponent<
270
271
  src?: string | undefined;
271
272
  alt?: string | undefined;
272
273
  decoding?: "auto" | "async" | "sync" | undefined;
273
- loading?: "eager" | "lazy" | undefined;
274
274
  fetchPriority?: "auto" | "high" | "low" | undefined;
275
275
  srcSet?: string | undefined;
276
276
  } & import("framer-motion").MotionProps & import("react").RefAttributes<HTMLImageElement> & import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, {}, {}>;
@@ -55,6 +55,7 @@ export declare const ActionIcon: import("@emotion/styled").StyledComponent<{
55
55
  content?: string | undefined;
56
56
  translate?: "yes" | "no" | undefined;
57
57
  id?: string | undefined;
58
+ loading?: "eager" | "lazy" | undefined;
58
59
  defaultChecked?: boolean | undefined;
59
60
  defaultValue?: string | number | readonly string[] | undefined;
60
61
  suppressContentEditableWarning?: boolean | undefined;
@@ -317,7 +318,6 @@ export declare const ActionIcon: import("@emotion/styled").StyledComponent<{
317
318
  src?: string | undefined;
318
319
  alt?: string | undefined;
319
320
  decoding?: "auto" | "async" | "sync" | undefined;
320
- loading?: "eager" | "lazy" | undefined;
321
321
  fetchPriority?: "auto" | "high" | "low" | undefined;
322
322
  srcSet?: string | undefined;
323
323
  } & import("framer-motion").MotionProps & import("react").RefAttributes<HTMLImageElement> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
@@ -76,18 +76,11 @@ export type NavigateFunction = (params: {
76
76
  sandboxMode?: boolean;
77
77
  state?: any;
78
78
  }) => void;
79
- export interface PreviewStorageData {
79
+ export interface WindowPreview {
80
80
  id: string;
81
81
  img: string;
82
- timestamp: number;
83
- }
84
- export interface PreviewData {
85
- id: string;
86
- img: string;
87
- isGenerating: boolean;
88
- serviceCode?: string;
82
+ status: 'idle' | 'completed' | 'error' | 'loading';
89
83
  appCode: string;
90
- isMinimized: boolean;
91
84
  }
92
85
  export type MFWidgetBaseProps = {
93
86
  windowId: string;
@@ -8,8 +8,14 @@ export declare enum SEGMENT_CODE {
8
8
  BUSINESS = "BUSINESS",
9
9
  PLATFORM = "PLATFORM",
10
10
  DEVELOPMENT = "DEVELOPMENT",
11
+ PSP = "PSP",
11
12
  PAYMENT_TECHNOLOGY = "PAYMENT_TECHNOLOGY",
12
13
  PAYMENT_FACILITATOR = "PAYMENT_FACILITATOR",
13
14
  PAYMENT_ACQUIRER = "PAYMENT_ACQUIRER",
14
- PAYMENT_GATEWAY = "PAYMENT_GATEWAY"
15
+ PAYMENT_GATEWAY = "PAYMENT_GATEWAY",
16
+ BILLING_PLATFORM = "BILLING_PLATFORM",
17
+ COMMERCE_PLATFORM = "COMMERCE_PLATFORM",
18
+ DEVELOPMENT_HOUSE = "DEVELOPMENT_HOUSE",
19
+ PAYMENT_GATEWAY_PROVIDER = "PAYMENT_GATEWAY_PROVIDER",
20
+ RETAIL_PLATFORM = "RETAIL_PLATFORM"
15
21
  }
@@ -3,8 +3,14 @@ export var SEGMENT_CODE;
3
3
  SEGMENT_CODE["BUSINESS"] = "BUSINESS";
4
4
  SEGMENT_CODE["PLATFORM"] = "PLATFORM";
5
5
  SEGMENT_CODE["DEVELOPMENT"] = "DEVELOPMENT";
6
+ SEGMENT_CODE["PSP"] = "PSP";
6
7
  SEGMENT_CODE["PAYMENT_TECHNOLOGY"] = "PAYMENT_TECHNOLOGY";
7
8
  SEGMENT_CODE["PAYMENT_FACILITATOR"] = "PAYMENT_FACILITATOR";
8
9
  SEGMENT_CODE["PAYMENT_ACQUIRER"] = "PAYMENT_ACQUIRER";
9
10
  SEGMENT_CODE["PAYMENT_GATEWAY"] = "PAYMENT_GATEWAY";
11
+ SEGMENT_CODE["BILLING_PLATFORM"] = "BILLING_PLATFORM";
12
+ SEGMENT_CODE["COMMERCE_PLATFORM"] = "COMMERCE_PLATFORM";
13
+ SEGMENT_CODE["DEVELOPMENT_HOUSE"] = "DEVELOPMENT_HOUSE";
14
+ SEGMENT_CODE["PAYMENT_GATEWAY_PROVIDER"] = "PAYMENT_GATEWAY_PROVIDER";
15
+ SEGMENT_CODE["RETAIL_PLATFORM"] = "RETAIL_PLATFORM";
10
16
  })(SEGMENT_CODE || (SEGMENT_CODE = {}));
@@ -1,4 +1,4 @@
1
- import { AppDetails, PreviewData, Segment, TableMode, Timezone } from '../types/index.js';
1
+ import { AppDetails, WindowPreview, Segment, TableMode, Timezone } from '../types/index.js';
2
2
  import { SheetViewColumnsData } from './columnResizeStorage';
3
3
  export declare function setSecretKey(): void;
4
4
  export declare function getSecretKey(): string | null;
@@ -32,7 +32,7 @@ export declare const getGlobalTableModeStorage: () => TableMode;
32
32
  export declare const removeGlobalTableModeStorage: () => void;
33
33
  export declare const setSheetViewColumnsStorage: (data: SheetViewColumnsData) => void;
34
34
  export declare const getSheetViewColumnsStorage: () => SheetViewColumnsData;
35
- export declare const setPreviewStorage: (previews: PreviewData[]) => void;
36
- export declare const getPreviewStorage: () => Map<string, string>;
35
+ export declare const setPreviewStorage: (previews: WindowPreview[]) => void;
36
+ export declare const getPreviewStorage: () => WindowPreview[];
37
37
  export declare const removePreviewStorage: () => void;
38
38
  export declare const clearTapOsLocalStorage: () => void;
@@ -172,14 +172,7 @@ export const setSheetViewColumnsStorage = (data) => localStorage.setItem(SHEETVI
172
172
  export const getSheetViewColumnsStorage = () => JSON.parse(localStorage.getItem(SHEETVIEW_COLUMNS_KEY) || '{}');
173
173
  export const setPreviewStorage = (previews) => {
174
174
  try {
175
- const data = previews
176
- .filter((p) => p.img)
177
- .map((p) => ({
178
- id: p.id,
179
- img: p.img,
180
- timestamp: Date.now(),
181
- }));
182
- localStorage.setItem(PREVIEW_STORAGE_KEY, JSON.stringify(data));
175
+ localStorage.setItem(PREVIEW_STORAGE_KEY, JSON.stringify(previews));
183
176
  }
184
177
  catch (error) {
185
178
  console.warn('Failed to save preview cache:', error);
@@ -189,16 +182,12 @@ export const getPreviewStorage = () => {
189
182
  try {
190
183
  const cached = localStorage.getItem(PREVIEW_STORAGE_KEY);
191
184
  if (!cached)
192
- return new Map();
185
+ return [];
193
186
  const data = JSON.parse(cached);
194
- const previewMap = new Map();
195
- data.forEach((item) => {
196
- previewMap.set(item.id, item.img);
197
- });
198
- return previewMap;
187
+ return data;
199
188
  }
200
189
  catch (error) {
201
- return new Map();
190
+ return [];
202
191
  }
203
192
  };
204
193
  export const removePreviewStorage = () => {
@@ -16,7 +16,6 @@ export declare function transformPaymentMethodsData(data?: PaymentMethod[]): {
16
16
  options: {
17
17
  name: string | undefined;
18
18
  type: string;
19
- icon: string;
20
19
  }[];
21
20
  }[] | undefined;
22
21
  };
@@ -26,7 +25,6 @@ export declare function transformPaymentSchemesData(data?: Source[]): {
26
25
  options: {
27
26
  name: string | undefined;
28
27
  type: string;
29
- icon: string;
30
28
  }[];
31
29
  };
32
30
  export {};
@@ -1,20 +1,19 @@
1
1
  import capitalize from 'lodash/capitalize';
2
- import { lightUrl, PAYMENT_TYPES_ICONS } from '../constants/index.js';
2
+ import { PAYMENT_TYPES_ICONS } from '../constants/index.js';
3
3
  import { getNameText } from './language';
4
4
  export function transformPaymentMethodsData(data) {
5
5
  return {
6
6
  name: 'Payment Methods',
7
7
  type: 'payment_methods',
8
8
  options: data === null || data === void 0 ? void 0 : data.map((category) => {
9
- var _a;
9
+ var _a, _b;
10
10
  return {
11
11
  name: capitalize(getNameText(category === null || category === void 0 ? void 0 : category.name)),
12
12
  type: category === null || category === void 0 ? void 0 : category.code,
13
- icon: PAYMENT_TYPES_ICONS[category.code],
14
- options: (_a = category.payment_methods) === null || _a === void 0 ? void 0 : _a.map((method) => ({
13
+ icon: (_a = PAYMENT_TYPES_ICONS[category.code]) !== null && _a !== void 0 ? _a : PAYMENT_TYPES_ICONS.CARD,
14
+ options: (_b = category.payment_methods) === null || _b === void 0 ? void 0 : _b.map((method) => ({
15
15
  name: getNameText(method.name),
16
16
  type: method.code,
17
- icon: `${lightUrl}/payment-method/${method.code}.svg`,
18
17
  })),
19
18
  };
20
19
  }),
@@ -30,7 +29,6 @@ export function transformPaymentSchemesData(data = []) {
30
29
  return {
31
30
  name: getNameText(scheme === null || scheme === void 0 ? void 0 : scheme.name),
32
31
  type: scheme === null || scheme === void 0 ? void 0 : scheme.code,
33
- icon: `${lightUrl}/payment-method/${scheme.code}.svg`,
34
32
  };
35
33
  }),
36
34
  };
@@ -1,2 +1,66 @@
1
1
  import { Segment, SegmentData } from '../types/index.js';
2
2
  export declare const getSegmentData: (segments: Segment[], activeSegmentId: string, activeSegments: Segment[]) => SegmentData;
3
+ export declare const getBusinessSegmentConfig: (merchantsIds: string[]) => {
4
+ business?: undefined;
5
+ } | {
6
+ business: {
7
+ merchant: string[];
8
+ };
9
+ };
10
+ export declare const getNonBusinessSegmentConfig: ({ segmentCode, segmentId, segmentTypeCode, }: {
11
+ segmentCode: string;
12
+ segmentTypeCode: string;
13
+ segmentId: string;
14
+ }) => {
15
+ payment_provider: {
16
+ technology: {
17
+ orchestrator: string[];
18
+ gateway?: undefined;
19
+ };
20
+ institution?: undefined;
21
+ };
22
+ platform?: undefined;
23
+ development_agency?: undefined;
24
+ } | {
25
+ payment_provider: {
26
+ technology: {
27
+ gateway: string[];
28
+ orchestrator?: undefined;
29
+ };
30
+ institution?: undefined;
31
+ };
32
+ platform?: undefined;
33
+ development_agency?: undefined;
34
+ } | {
35
+ payment_provider: {
36
+ institution: {
37
+ facilitator: string[];
38
+ acquirer?: undefined;
39
+ };
40
+ technology?: undefined;
41
+ };
42
+ platform?: undefined;
43
+ development_agency?: undefined;
44
+ } | {
45
+ payment_provider: {
46
+ institution: {
47
+ acquirer: string[];
48
+ facilitator?: undefined;
49
+ };
50
+ technology?: undefined;
51
+ };
52
+ platform?: undefined;
53
+ development_agency?: undefined;
54
+ } | {
55
+ platform: string[];
56
+ payment_provider?: undefined;
57
+ development_agency?: undefined;
58
+ } | {
59
+ development_agency: string[];
60
+ payment_provider?: undefined;
61
+ platform?: undefined;
62
+ } | {
63
+ payment_provider?: undefined;
64
+ platform?: undefined;
65
+ development_agency?: undefined;
66
+ };
@@ -1,7 +1,7 @@
1
+ import { SEGMENT_CODE } from '../types/index.js';
1
2
  import { getDefaultEntityCountry } from './entity';
2
3
  export const getSegmentData = (segments, activeSegmentId, activeSegments) => {
3
4
  var _a, _b, _c;
4
- // debugger
5
5
  const newSegment = (_a = segments.find((segment) => segment.id === activeSegmentId)) !== null && _a !== void 0 ? _a : {};
6
6
  const activeSegment = (_b = activeSegments.find((segment) => segment.id === activeSegmentId)) !== null && _b !== void 0 ? _b : {};
7
7
  const defaultCountry = activeSegment.countries.length === 1
@@ -11,3 +11,54 @@ export const getSegmentData = (segments, activeSegmentId, activeSegments) => {
11
11
  return Object.assign(Object.assign({}, newSegment), { defaultCountry,
12
12
  defaultEntity });
13
13
  };
14
+ export const getBusinessSegmentConfig = (merchantsIds) => {
15
+ if (!merchantsIds || !(merchantsIds === null || merchantsIds === void 0 ? void 0 : merchantsIds.length))
16
+ return {};
17
+ return { business: { merchant: merchantsIds } };
18
+ };
19
+ export const getNonBusinessSegmentConfig = ({ segmentCode, segmentId, segmentTypeCode, }) => {
20
+ const code = SEGMENT_CODE.PSP === segmentTypeCode ? segmentCode : segmentTypeCode;
21
+ if (code === SEGMENT_CODE.PAYMENT_TECHNOLOGY) {
22
+ return {
23
+ payment_provider: {
24
+ technology: {
25
+ orchestrator: [segmentId],
26
+ },
27
+ },
28
+ };
29
+ }
30
+ if (code === SEGMENT_CODE.PAYMENT_GATEWAY || code === SEGMENT_CODE.PAYMENT_GATEWAY_PROVIDER) {
31
+ return {
32
+ payment_provider: {
33
+ technology: {
34
+ gateway: [segmentId],
35
+ },
36
+ },
37
+ };
38
+ }
39
+ if (code === SEGMENT_CODE.PAYMENT_FACILITATOR) {
40
+ return {
41
+ payment_provider: {
42
+ institution: {
43
+ facilitator: [segmentId],
44
+ },
45
+ },
46
+ };
47
+ }
48
+ if (code === SEGMENT_CODE.PAYMENT_ACQUIRER) {
49
+ return {
50
+ payment_provider: {
51
+ institution: {
52
+ acquirer: [segmentId],
53
+ },
54
+ },
55
+ };
56
+ }
57
+ if (code === SEGMENT_CODE.PLATFORM) {
58
+ return { platform: [segmentId] };
59
+ }
60
+ if (code === SEGMENT_CODE.DEVELOPMENT) {
61
+ return { development_agency: [segmentId] };
62
+ }
63
+ return {};
64
+ };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@tap-payments/os-micro-frontend-shared",
3
3
  "description": "Shared components and utilities for Tap Payments micro frontends",
4
- "version": "0.1.328",
4
+ "version": "0.1.330",
5
5
  "testVersion": 0,
6
6
  "type": "module",
7
7
  "main": "build/index.js",