@tap-payments/os-micro-frontend-shared 0.1.224 → 0.1.226-test.1

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 (108) hide show
  1. package/build/components/AccordionAdapter/style.d.ts +2 -2
  2. package/build/components/AccountDropdown/style.d.ts +1 -1
  3. package/build/components/ActionMenu/style.d.ts +1 -1
  4. package/build/components/ActivityAreaChart/styles.d.ts +3 -3
  5. package/build/components/AppServices/style.d.ts +1 -1
  6. package/build/components/AppWindowWrapper/AppWindow/style.d.ts +2 -2
  7. package/build/components/Button/style.d.ts +1 -1
  8. package/build/components/Calender/style.d.ts +4 -4
  9. package/build/components/Chip/style.d.ts +6 -7
  10. package/build/components/CircularProgressWithLabel/style.d.ts +1 -1
  11. package/build/components/ColorPicker/style.d.ts +3 -3
  12. package/build/components/ConfirmDialog/styles.d.ts +1 -1
  13. package/build/components/CountBadge/style.d.ts +6 -7
  14. package/build/components/Dialog/style.d.ts +6 -7
  15. package/build/components/DockButton/style.d.ts +1 -1
  16. package/build/components/DropdownButton/constants.d.ts +2 -2
  17. package/build/components/DropdownButton/style.d.ts +2 -2
  18. package/build/components/DropdownMenu/styles.d.ts +2 -2
  19. package/build/components/ErrorBoundary/style.d.ts +1 -1
  20. package/build/components/ErrorToast/style.d.ts +1 -1
  21. package/build/components/FileUpload/style.d.ts +3 -3
  22. package/build/components/FileUploader/style.d.ts +1 -1
  23. package/build/components/FlippingCard/style.d.ts +6 -7
  24. package/build/components/IconWithLabel/style.d.ts +1 -1
  25. package/build/components/IconsDropdown/style.d.ts +2 -2
  26. package/build/components/ImageWrapper/ImageWrapper.d.ts +6 -7
  27. package/build/components/InputBase/SelectBase/style.d.ts +1 -1
  28. package/build/components/Inputs/FileInput/style.d.ts +1 -1
  29. package/build/components/JSONViewer/style.d.ts +13 -14
  30. package/build/components/LabeledIconDropdown/style.d.ts +3 -3
  31. package/build/components/LeftPeekRightExpandingChip/style.d.ts +18 -19
  32. package/build/components/MultiSelectStatusButton/style.d.ts +1 -1
  33. package/build/components/MultiSelectWithSearch/style.d.ts +3 -3
  34. package/build/components/NestedDropdown/styles.d.ts +1 -1
  35. package/build/components/ProgressBar/style.d.ts +1 -1
  36. package/build/components/ProgressRing/style.d.ts +2 -2
  37. package/build/components/RFH/Inputs/SelectWithAccordion/style.d.ts +3 -3
  38. package/build/components/RangeCalender/components/QuickFilters/style.d.ts +1 -1
  39. package/build/components/RangeCalender/components/RangeDatepicker/style.d.ts +1 -1
  40. package/build/components/RangeCalender/style.d.ts +3 -3
  41. package/build/components/RightLeftExpandingCenterChip/style.d.ts +78 -79
  42. package/build/components/SearchButton/styles.d.ts +17 -18
  43. package/build/components/SelectDropdown/style.d.ts +1 -1
  44. package/build/components/SelectWithSearch/style.d.ts +3 -3
  45. package/build/components/StatusButton/style.d.ts +2 -2
  46. package/build/components/StatusIcons/AuthIcons/style.d.ts +12 -13
  47. package/build/components/StatusIcons/AuthorizationAutoIcons/style.d.ts +6 -7
  48. package/build/components/StatusIcons/ChargeStatusIcon/style.d.ts +36 -37
  49. package/build/components/StatusIcons/SourceIcons/style.d.ts +6 -7
  50. package/build/components/StatusLabel/style.d.ts +1 -1
  51. package/build/components/TableCells/CustomCells/ActionCell/hooks/useActionCell.d.ts +1 -1
  52. package/build/components/TableCells/CustomCells/ActionCell/style.d.ts +8 -9
  53. package/build/components/TableCells/CustomCells/ApplicationStatusCell/style.d.ts +6 -7
  54. package/build/components/TableCells/CustomCells/AuthenticationCell/style.d.ts +12 -13
  55. package/build/components/TableCells/CustomCells/AuthenticationStatusCell/style.d.ts +30 -31
  56. package/build/components/TableCells/CustomCells/AuthenticationTypeCell/style.d.ts +30 -31
  57. package/build/components/TableCells/CustomCells/BalanceCell/style.d.ts +6 -7
  58. package/build/components/TableCells/CustomCells/ChannelsCell/style.d.ts +6 -7
  59. package/build/components/TableCells/CustomCells/CheckoutStatusCell/style.d.ts +6 -7
  60. package/build/components/TableCells/CustomCells/DestinationStatusCell/style.d.ts +30 -31
  61. package/build/components/TableCells/CustomCells/DueDateCell/style.d.ts +6 -7
  62. package/build/components/TableCells/CustomCells/IDButton/style.d.ts +12 -13
  63. package/build/components/TableCells/CustomCells/IntentsStatusCell/style.d.ts +6 -7
  64. package/build/components/TableCells/CustomCells/InvoiceStatusCell/style.d.ts +6 -7
  65. package/build/components/TableCells/CustomCells/PayoutStatusCell/style.d.ts +30 -31
  66. package/build/components/TableCells/CustomCells/ProductsCell/style.d.ts +6 -7
  67. package/build/components/TableCells/CustomCells/ReferenceCell/style.d.ts +6 -7
  68. package/build/components/TableCells/CustomCells/RefundChargeCell/style.d.ts +12 -13
  69. package/build/components/TableCells/CustomCells/RefundStatusCell/style.d.ts +6 -7
  70. package/build/components/TableCells/CustomCells/SalesChannelCell/style.d.ts +6 -7
  71. package/build/components/TableCells/CustomCells/SegmentsCell/style.d.ts +6 -7
  72. package/build/components/TableCells/CustomCells/SourceCell/style.d.ts +6 -7
  73. package/build/components/TableCells/CustomCells/StatusCell/style.d.ts +37 -38
  74. package/build/components/TableCells/CustomCells/TokenStatusCell/style.d.ts +30 -31
  75. package/build/components/TableCells/CustomCells/style.d.ts +7 -8
  76. package/build/components/TableHeader/style.d.ts +1 -1
  77. package/build/components/Timepicker/style.d.ts +2 -2
  78. package/build/components/ToolbarIcon/ExpandButton/style.d.ts +1 -1
  79. package/build/components/VirtualTables/SheetViewVirtualTable/style.d.ts +2 -2
  80. package/build/components/VirtualTables/components/ColumnFilter/Inputs/style.d.ts +1 -1
  81. package/build/components/VirtualTables/components/ColumnFilter/style.d.ts +2 -2
  82. package/build/components/VirtualTables/components/ErrorList/styles.d.ts +1 -1
  83. package/build/components/VirtualTables/components/TableFooter/style.d.ts +2 -2
  84. package/build/components/VirtualTables/components/TableHeader/style.d.ts +2 -2
  85. package/build/components/VirtualTables/components/style.d.ts +8 -9
  86. package/build/components/Widget/style.d.ts +1 -1
  87. package/build/components/Window/style.d.ts +12 -12
  88. package/build/components/WindowAppIcon/style.d.ts +1 -1
  89. package/build/constants/apps.d.ts +1 -0
  90. package/build/constants/apps.js +1 -0
  91. package/build/constants/table/cell/invoicesTableCellWidth.d.ts +28 -8
  92. package/build/constants/table/cell/invoicesTableCellWidth.js +28 -8
  93. package/build/hooks/index.d.ts +3 -0
  94. package/build/hooks/index.js +3 -0
  95. package/build/hooks/useAppEventListener.d.ts +2 -0
  96. package/build/hooks/useAppEventListener.js +13 -0
  97. package/build/hooks/useAppEventPublisher.d.ts +2 -0
  98. package/build/hooks/useAppEventPublisher.js +7 -0
  99. package/build/hooks/useAppsInfo.d.ts +17 -0
  100. package/build/hooks/useAppsInfo.js +21 -0
  101. package/build/types/appEvents.d.ts +30 -0
  102. package/build/types/appEvents.js +1 -0
  103. package/build/types/apps.d.ts +20 -15
  104. package/build/types/index.d.ts +1 -0
  105. package/build/types/index.js +1 -0
  106. package/build/utils/table.d.ts +12 -1
  107. package/build/utils/table.js +147 -1
  108. package/package.json +3 -3
@@ -7,37 +7,57 @@ export const invoicesTableCellWidth = {
7
7
  link: {
8
8
  default: '145px',
9
9
  text: '145px',
10
- sheet: '145px',
10
+ sheet: '350px',
11
11
  },
12
12
  date: {
13
13
  default: '150px',
14
14
  text: '150px',
15
- sheet: '150px',
15
+ sheet: '130px',
16
16
  },
17
17
  order: {
18
18
  default: '80px',
19
19
  text: '80px',
20
- sheet: '80px',
20
+ sheet: '90px',
21
21
  },
22
22
  customer: {
23
23
  default: '180px',
24
24
  text: '180px',
25
25
  sheet: '180px',
26
26
  },
27
+ customer_id: {
28
+ default: '180px',
29
+ text: '180px',
30
+ sheet: '270px',
31
+ },
32
+ customer_name: {
33
+ default: '180px',
34
+ text: '180px',
35
+ sheet: '155px',
36
+ },
37
+ customer_phone: {
38
+ default: '180px',
39
+ text: '180px',
40
+ sheet: '150px',
41
+ },
42
+ merchant: {
43
+ default: '180px',
44
+ text: '180px',
45
+ sheet: '92px',
46
+ },
27
47
  amount: {
28
48
  default: '195px',
29
49
  text: '195px',
30
- sheet: '195px',
50
+ sheet: '150px',
31
51
  },
32
52
  channel: {
33
53
  default: '90px',
34
54
  text: '90px',
35
- sheet: '90px',
55
+ sheet: '156px',
36
56
  },
37
57
  due: {
38
58
  default: '92px',
39
59
  text: '340px',
40
- sheet: '340px',
60
+ sheet: '108px',
41
61
  },
42
62
  status: {
43
63
  default: '90px',
@@ -52,7 +72,7 @@ export const invoicesTableCellWidth = {
52
72
  paymentMethod: {
53
73
  default: '110px',
54
74
  text: '130px',
55
- sheet: '130px',
75
+ sheet: '122px',
56
76
  },
57
77
  cardNo: {
58
78
  default: '130px',
@@ -62,7 +82,7 @@ export const invoicesTableCellWidth = {
62
82
  chargeId: {
63
83
  default: '225px',
64
84
  text: '225px',
65
- sheet: '225px',
85
+ sheet: '230px',
66
86
  },
67
87
  receiptId: {
68
88
  default: '180px',
@@ -9,3 +9,6 @@ export * from './useIsParameterSelected';
9
9
  export * from './useStickyHeaderShadow';
10
10
  export * from './useThemeMode';
11
11
  export * from './useCountdown';
12
+ export * from './useAppsInfo';
13
+ export * from './useAppEventPublisher';
14
+ export * from './useAppEventListener';
@@ -9,3 +9,6 @@ export * from './useIsParameterSelected';
9
9
  export * from './useStickyHeaderShadow';
10
10
  export * from './useThemeMode';
11
11
  export * from './useCountdown';
12
+ export * from './useAppsInfo';
13
+ export * from './useAppEventPublisher';
14
+ export * from './useAppEventListener';
@@ -0,0 +1,2 @@
1
+ import { CustomEventMap } from '../types';
2
+ export declare function useAppEventListener<K extends keyof CustomEventMap>(eventName: K, handler: CustomEventMap[K]): void;
@@ -0,0 +1,13 @@
1
+ import { useEffect } from 'react';
2
+ export function useAppEventListener(eventName, handler) {
3
+ useEffect(() => {
4
+ const listener = (e) => {
5
+ const customEvent = e;
6
+ handler(...(customEvent.detail || []));
7
+ };
8
+ window.addEventListener(eventName, listener);
9
+ return () => {
10
+ window.removeEventListener(eventName, listener);
11
+ };
12
+ }, [eventName, handler]);
13
+ }
@@ -0,0 +1,2 @@
1
+ import { CustomEventMap } from '../types';
2
+ export declare function useAppEventPublisher<K extends keyof CustomEventMap>(eventName: K): (...args: Parameters<CustomEventMap[K]>) => void;
@@ -0,0 +1,7 @@
1
+ import { useCallback } from 'react';
2
+ export function useAppEventPublisher(eventName) {
3
+ return useCallback((...args) => {
4
+ const event = new CustomEvent(eventName, { detail: args });
5
+ window.dispatchEvent(event);
6
+ }, [eventName]);
7
+ }
@@ -0,0 +1,17 @@
1
+ import { AppService, UserApp } from '../types/index.js';
2
+ interface GetService {
3
+ appCode: string;
4
+ serviceCode: string;
5
+ }
6
+ interface GetFunction {
7
+ appCode: string;
8
+ serviceCode: string;
9
+ functionCode: string;
10
+ }
11
+ export declare const useAppsInfo: (segmentApps: UserApp[]) => {
12
+ getAppInfo: (appCode: string) => UserApp | undefined;
13
+ getServiceInfo: ({ appCode, serviceCode }: GetService) => AppService | undefined;
14
+ getServiceFunctions: ({ appCode, serviceCode }: GetService) => import("../types/index.js").ServiceFunction[];
15
+ getFunctionInfo: ({ appCode, serviceCode, functionCode }: GetFunction) => import("../types/index.js").ServiceFunction | undefined;
16
+ };
17
+ export {};
@@ -0,0 +1,21 @@
1
+ import { useCallback } from 'react';
2
+ export const useAppsInfo = (segmentApps) => {
3
+ const getAppInfo = useCallback((appCode) => segmentApps.find((app) => app.code.toLowerCase() === appCode.toLowerCase()), [segmentApps]);
4
+ const getServiceInfo = useCallback(({ appCode, serviceCode }) => {
5
+ var _a;
6
+ return (_a = getAppInfo(appCode)) === null || _a === void 0 ? void 0 : _a.app_services.find(({ code }) => code.toLowerCase() === serviceCode.toLowerCase());
7
+ }, [getAppInfo]);
8
+ const getServiceFunctions = useCallback(({ appCode, serviceCode }) => {
9
+ var _a, _b;
10
+ return (_b = (_a = getServiceInfo({ appCode, serviceCode })) === null || _a === void 0 ? void 0 : _a.functions) !== null && _b !== void 0 ? _b : [];
11
+ }, [getServiceInfo]);
12
+ const getFunctionInfo = useCallback(({ appCode, serviceCode, functionCode }) => {
13
+ return getServiceFunctions({ appCode, serviceCode }).find(({ code }) => code.toLowerCase() === functionCode.toLowerCase());
14
+ }, [getServiceFunctions]);
15
+ return {
16
+ getAppInfo,
17
+ getServiceInfo,
18
+ getServiceFunctions,
19
+ getFunctionInfo,
20
+ };
21
+ };
@@ -0,0 +1,30 @@
1
+ import { CalenderMode, NavigateFunction, TableMode, Timezone } from './index.js';
2
+ import { DragControls } from 'framer-motion';
3
+ export type CustomEventMap = {
4
+ 'on-click-table-action': (params: {
5
+ targetApp: {
6
+ appCode: string;
7
+ serviceCode: string;
8
+ sandboxMode?: boolean;
9
+ payload?: object;
10
+ };
11
+ }) => void;
12
+ 'on-right-click-table-action': (params: {
13
+ targetApp: {
14
+ appCode: string;
15
+ serviceCode: string;
16
+ sandboxMode?: boolean;
17
+ payload?: object;
18
+ };
19
+ }) => void;
20
+ 'modify-remote-payload': (params: {
21
+ instanceId: string;
22
+ payload: object;
23
+ }) => void;
24
+ 'on-toggle-table-mode': () => void;
25
+ 'on-change-table-mode': (tableMode: TableMode) => void;
26
+ 'on-change-calender-mode': (calenderMode: CalenderMode) => void;
27
+ 'on-change-timezone': (timezone: Timezone) => void;
28
+ 'on-navigate': NavigateFunction;
29
+ 'on-start-drag': (...args: Parameters<DragControls['start']>) => void;
30
+ };
@@ -0,0 +1 @@
1
+ export {};
@@ -1,11 +1,11 @@
1
1
  import { ColumnsView } from './column';
2
- import { Segment, SegmentCountry, TextAndLang } from './user';
2
+ import { SegmentCountry, SelectedBrand, SelectedCountry, TextAndLang } from './user';
3
3
  import { BusinessMerchant } from './merchant';
4
4
  import type { i18n } from 'i18next';
5
- import type { DragControls } from 'framer-motion';
6
5
  import { Theme } from '@mui/material';
7
6
  import { CalenderMode } from './theme';
8
7
  import { Timezone } from './appConfig';
8
+ import { Brand, Entity, TableMode } from './index.js';
9
9
  export interface AccountAppPayload {
10
10
  disabledAccountDataFetching?: boolean;
11
11
  isAccountDetailsOpen: boolean;
@@ -73,12 +73,13 @@ export type NavigateFunction = (params: {
73
73
  appId?: string;
74
74
  appCode: string;
75
75
  serviceCode: string;
76
+ sandboxMode?: boolean;
76
77
  state?: any;
77
78
  }) => void;
78
79
  export type MFWidgetBaseProps = {
79
80
  instanceId: string;
80
81
  i18n?: i18n;
81
- app?: UserApp;
82
+ app: UserApp;
82
83
  appWindow: {
83
84
  isMinimized: boolean;
84
85
  isMaximized: boolean;
@@ -86,29 +87,33 @@ export type MFWidgetBaseProps = {
86
87
  dimensions: Pick<AppDetails['dimensions'], 'width' | 'height'>;
87
88
  };
88
89
  features: {
90
+ calendarMode: CalenderMode;
91
+ tableMode: TableMode;
89
92
  hasReportsApp: boolean;
90
93
  hasHeader: boolean;
91
94
  sandboxMode: boolean;
92
95
  initialServiceCode?: string;
96
+ initialPayload?: Record<string, any> & AppPayload;
93
97
  };
94
- segment: Pick<Segment, 'id' | 'brands' | 'countries'> & {
95
- defaultCountry?: SegmentCountry;
98
+ segment: {
99
+ brands: Brand[];
100
+ countries: SegmentCountry[];
101
+ defaultCountry: SegmentCountry;
102
+ defaultEntity: Entity;
103
+ apps: UserApp[];
104
+ isBusinessSegment: boolean;
105
+ isAnyMerchantHasMarketplace: boolean;
106
+ };
107
+ activeSegment: {
108
+ id: string;
109
+ brands: SelectedBrand[];
110
+ countries: SelectedCountry[];
96
111
  };
97
112
  ui: {
98
113
  theme: Theme;
99
- onStartDrag: DragControls['start'];
100
- };
101
- calendar: {
102
- mode: CalenderMode;
103
- onSwitch: (mode: CalenderMode) => void;
104
- };
105
- navigation: {
106
- navigate: NavigateFunction;
107
114
  };
108
115
  timezone: {
109
116
  current?: Timezone | null;
110
117
  default?: Timezone;
111
- onChange: (timezone: Timezone) => void;
112
- onChangeHistory: (timezone: Timezone) => void;
113
118
  };
114
119
  };
@@ -23,3 +23,4 @@ export * from './refund';
23
23
  export * from './destination';
24
24
  export * from './account';
25
25
  export * from './day';
26
+ export * from './appEvents';
@@ -23,3 +23,4 @@ export * from './refund';
23
23
  export * from './destination';
24
24
  export * from './account';
25
25
  export * from './day';
26
+ export * from './appEvents';
@@ -1,4 +1,4 @@
1
- import { TableCellWidthProps, TableMode } from '../types/index.js';
1
+ import { TableCellWidthProps, TableMode, TableNavigation } from '../types/index.js';
2
2
  export declare const getColumnWidthPercentage: (widthInPx: number, options?: {
3
3
  isFirst?: boolean;
4
4
  isLast?: boolean;
@@ -9,3 +9,14 @@ export declare const isHeightNotFullyFilledByRows: (totalRows: number) => boolea
9
9
  export declare const isTableDefaultMode: (tableMode: TableMode) => boolean;
10
10
  export declare const isTableSheetMode: (tableMode: TableMode) => boolean;
11
11
  export declare const isTableTextMode: (tableMode: TableMode) => boolean;
12
+ interface NavigationMap<T> {
13
+ prefixes: string[];
14
+ keys?: string[];
15
+ label: string;
16
+ appCode: string;
17
+ serviceCode: string;
18
+ icon: TableNavigation['icon'];
19
+ accessor?: (rowData: T) => string[];
20
+ }
21
+ export declare const getPossibleNavigationTablesMap: <T>() => Record<string, NavigationMap<T>>;
22
+ export {};
@@ -1,4 +1,4 @@
1
- import { walletDetailsTableCellWidth, authenticationsTableCellWidth, authorizationTableCellWidth, chargeTableCellWidth, destinationsTableCellWidth, intentsTableCellWidth, invoicesTableCellWidth, leadsTableCellWidth, ordersTableCellWidth, payoutsTableCellWidth, protectChargesTableCellWidth, protectAuthorizationsTableCellWidth, refundTableCellWidth, tokensTableCellWidth, walletStatementTableCellWidth, topupsTableCellWidth, walletTableCellWidth, TABLE_CONTENT_ROW_HEIGHT, TABLE_LOADING_ROW_HEIGHT, TABLE_ROW_HEIGHT, merchantsTableCellWidth, terminalsTableCellWidth, } from '../constants/index.js';
1
+ import { walletDetailsTableCellWidth, authenticationsTableCellWidth, authorizationTableCellWidth, chargeTableCellWidth, destinationsTableCellWidth, intentsTableCellWidth, invoicesTableCellWidth, leadsTableCellWidth, ordersTableCellWidth, payoutsTableCellWidth, protectChargesTableCellWidth, protectAuthorizationsTableCellWidth, refundTableCellWidth, tokensTableCellWidth, walletStatementTableCellWidth, topupsTableCellWidth, walletTableCellWidth, TABLE_CONTENT_ROW_HEIGHT, TABLE_LOADING_ROW_HEIGHT, TABLE_ROW_HEIGHT, merchantsTableCellWidth, terminalsTableCellWidth, APP_CODES, } from '../constants/index.js';
2
2
  export const getColumnWidthPercentage = (widthInPx, options) => {
3
3
  const { isFirst, isLast } = options || {};
4
4
  const paddingInPx = isFirst || isLast ? 0 : 0;
@@ -82,3 +82,149 @@ export const isTableSheetMode = (tableMode) => {
82
82
  export const isTableTextMode = (tableMode) => {
83
83
  return tableMode === 'text';
84
84
  };
85
+ export const getPossibleNavigationTablesMap = () => {
86
+ return {
87
+ charge: {
88
+ prefixes: ['chg_', 'payout_', 'settlement_', 'terminal_'],
89
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
90
+ accessor: (rowData) => {
91
+ var _a, _b, _c, _d;
92
+ return [
93
+ rowData.id,
94
+ (_b = (_a = rowData.capture) === null || _a === void 0 ? void 0 : _a.charge) === null || _b === void 0 ? void 0 : _b.map((charge) => charge.id),
95
+ (_c = rowData.charge) === null || _c === void 0 ? void 0 : _c.id,
96
+ (_d = rowData.transactions) === null || _d === void 0 ? void 0 : _d.map((transaction) => transaction.id),
97
+ rowData.charge_id,
98
+ ];
99
+ },
100
+ label: 'Charge',
101
+ appCode: APP_CODES.acceptance.code,
102
+ serviceCode: APP_CODES.acceptance.services.charges.code,
103
+ icon: 'capture',
104
+ },
105
+ authorize: {
106
+ prefixes: ['auth_'],
107
+ keys: ['id', 'authorize.id', 'source.id'],
108
+ label: 'Authorization',
109
+ appCode: APP_CODES.acceptance.code,
110
+ serviceCode: APP_CODES.acceptance.services.authorization.code,
111
+ icon: 'capture',
112
+ },
113
+ intents: {
114
+ prefixes: ['intent_'],
115
+ keys: [],
116
+ label: 'Intents',
117
+ appCode: APP_CODES.acceptance.code,
118
+ serviceCode: APP_CODES.acceptance.services.intents.code,
119
+ icon: 'capture',
120
+ },
121
+ refunds: {
122
+ prefixes: ['re_', 'payout_'],
123
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
124
+ accessor: (rowData) => {
125
+ var _a, _b, _c, _d;
126
+ return [
127
+ (_b = (_a = rowData === null || rowData === void 0 ? void 0 : rowData.refunds) === null || _a === void 0 ? void 0 : _a.refund) === null || _b === void 0 ? void 0 : _b.map((refund) => refund.id),
128
+ rowData === null || rowData === void 0 ? void 0 : rowData.id,
129
+ ...(((_c = rowData === null || rowData === void 0 ? void 0 : rowData.refunds) === null || _c === void 0 ? void 0 : _c.length) ? [(_d = rowData === null || rowData === void 0 ? void 0 : rowData.refunds) === null || _d === void 0 ? void 0 : _d.map((refund) => refund.id)] : []),
130
+ ];
131
+ },
132
+ label: 'Refunds',
133
+ appCode: APP_CODES.acceptance.code,
134
+ serviceCode: APP_CODES.acceptance.services.refunds.code,
135
+ icon: 'refund',
136
+ },
137
+ authentication: {
138
+ prefixes: ['auth_payer_'],
139
+ keys: ['authentication.id'],
140
+ label: 'Authentication',
141
+ appCode: APP_CODES.authentication.code,
142
+ serviceCode: APP_CODES.authentication.services.authentication.code,
143
+ icon: 'capture',
144
+ },
145
+ order: {
146
+ prefixes: ['order_', 'ord_'],
147
+ keys: ['order.id'],
148
+ label: 'Order',
149
+ appCode: APP_CODES.order.code,
150
+ serviceCode: APP_CODES.order.services.orders.code,
151
+ icon: 'capture',
152
+ },
153
+ chargeFlags: {
154
+ prefixes: ['flag_'],
155
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
156
+ accessor: (rowData) => {
157
+ var _a, _b;
158
+ return (_b = (_a = rowData === null || rowData === void 0 ? void 0 : rowData.flags) === null || _a === void 0 ? void 0 : _a.flag) === null || _b === void 0 ? void 0 : _b.map((flag) => flag.id);
159
+ },
160
+ label: 'Flags',
161
+ appCode: APP_CODES.protect.code,
162
+ serviceCode: APP_CODES.protect.services.chargesFlags.code,
163
+ icon: 'flag',
164
+ },
165
+ authorizationFlags: {
166
+ prefixes: ['flag_'],
167
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
168
+ accessor: (rowData) => {
169
+ var _a, _b;
170
+ return (_b = (_a = rowData === null || rowData === void 0 ? void 0 : rowData.flags) === null || _a === void 0 ? void 0 : _a.flag) === null || _b === void 0 ? void 0 : _b.map((flag) => flag.id);
171
+ },
172
+ label: 'Flags',
173
+ appCode: APP_CODES.protect.code,
174
+ serviceCode: APP_CODES.protect.services.authorizationsFlags.code,
175
+ icon: 'flag',
176
+ },
177
+ token: {
178
+ prefixes: ['tok_'],
179
+ keys: ['source.id'],
180
+ label: 'Token',
181
+ appCode: APP_CODES.tokens.code,
182
+ serviceCode: APP_CODES.tokens.services.tokens.code,
183
+ icon: 'capture',
184
+ },
185
+ destination: {
186
+ prefixes: ['trf_', 'payout_'],
187
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
188
+ accessor: (rowData) => {
189
+ var _a, _b;
190
+ return [(_b = (_a = rowData === null || rowData === void 0 ? void 0 : rowData.destinations) === null || _a === void 0 ? void 0 : _a.destination) === null || _b === void 0 ? void 0 : _b.map((destination) => { var _a; return (_a = destination === null || destination === void 0 ? void 0 : destination.transfer) === null || _a === void 0 ? void 0 : _a.id; }), rowData === null || rowData === void 0 ? void 0 : rowData.id];
191
+ },
192
+ label: 'Destination',
193
+ appCode: APP_CODES.acceptance.code,
194
+ serviceCode: APP_CODES.acceptance.services.destinations.code,
195
+ icon: 'destination',
196
+ },
197
+ payout: {
198
+ prefixes: ['payout_'],
199
+ keys: ['balance.payout.id'],
200
+ label: 'Payout',
201
+ appCode: APP_CODES.payouts.code,
202
+ serviceCode: APP_CODES.payouts.services.payouts.code,
203
+ icon: 'capture',
204
+ },
205
+ settlement: {
206
+ prefixes: ['settlement_'],
207
+ keys: ['settlement.id'],
208
+ label: 'Settlement',
209
+ appCode: APP_CODES.acceptance.code,
210
+ serviceCode: APP_CODES.acceptance.services.settlements.code,
211
+ icon: 'capture',
212
+ },
213
+ intent: {
214
+ prefixes: ['intent_'],
215
+ keys: ['intent.id'],
216
+ label: 'Intent',
217
+ appCode: APP_CODES.acceptance.code,
218
+ serviceCode: APP_CODES.acceptance.services.intents.code,
219
+ icon: 'capture',
220
+ },
221
+ topup: {
222
+ prefixes: ['topup_'],
223
+ keys: ['topup.id'],
224
+ label: 'Topup',
225
+ appCode: APP_CODES.acceptance.code,
226
+ serviceCode: APP_CODES.acceptance.services.topups.code,
227
+ icon: 'capture',
228
+ },
229
+ };
230
+ };
package/package.json CHANGED
@@ -1,8 +1,8 @@
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.224",
5
- "testVersion": 0,
4
+ "version": "0.1.226-test.1",
5
+ "testVersion": 1,
6
6
  "type": "module",
7
7
  "main": "build/index.js",
8
8
  "module": "build/index.js",
@@ -163,4 +163,4 @@
163
163
  "publishConfig": {
164
164
  "registry": "https://registry.npmjs.org/"
165
165
  }
166
- }
166
+ }