@tap-payments/os-micro-frontend-shared 0.1.365-test.1 → 0.1.365-test.4
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.
|
@@ -18,5 +18,5 @@ import { verificationIcon } from './constants';
|
|
|
18
18
|
export default function BrandsCell(_a) {
|
|
19
19
|
var { brand, verificationStatus, hideStatus, brandLogo } = _a, props = __rest(_a, ["brand", "verificationStatus", "hideStatus", "brandLogo"]);
|
|
20
20
|
const icon = verificationIcon[verificationStatus !== null && verificationStatus !== void 0 ? verificationStatus : 'incomplete'];
|
|
21
|
-
return (_jsx(TableCell, Object.assign({}, props, { children: _jsx(Tooltip, Object.assign({ title: brand.name }, { children: _jsx(BrandsWrapper, Object.assign({ hasClick: !!props.onClick }, { children: _jsxs(BrandsWrapperContent, { children: [brandLogo, _jsx(Label, Object.assign({ brandName: brand.name }, { children: brand.name || 'Not Available' })), !hideStatus && (_jsx(IconWithBadge, { mainIcon: icon, mainIconSize: 10, containerSize: 10, borderColor: "transparent", containerSx: { marginLeft: 'auto' } }))] }) })) })) })));
|
|
21
|
+
return (_jsx(TableCell, Object.assign({}, props, { children: _jsx(Tooltip, Object.assign({ title: brand.name }, { children: _jsx(BrandsWrapper, Object.assign({ hasClick: !!props.onClick }, { children: _jsxs(BrandsWrapperContent, { children: [brandLogo, _jsx(Label, Object.assign({ brandName: brand.name }, { children: brand.name || 'Not Available' })), !hideStatus && (_jsx(IconWithBadge, { mainIcon: icon, mainIconSize: 10.5, containerSize: 10.5, borderColor: "transparent", containerSx: { marginLeft: 'auto' } }))] }) })) })) })));
|
|
22
22
|
}
|
|
@@ -1,23 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
* Maps report **source codes** (app or service)
|
|
3
|
-
* to the corresponding **backend report filter types**.
|
|
4
|
-
*
|
|
5
|
-
* Used as a translation layer between UI report grouping
|
|
6
|
-
* and backend report filtering.
|
|
7
|
-
*
|
|
8
|
-
* - Key: App code or service code
|
|
9
|
-
* - Value: One or more backend filter types
|
|
10
|
-
*/
|
|
11
|
-
export declare const reportFilterTypesMap: {
|
|
1
|
+
export declare const filtersTypeMap: {
|
|
12
2
|
[x: string]: string[];
|
|
13
3
|
};
|
|
14
|
-
/**
|
|
15
|
-
* Reports apps
|
|
16
|
-
*
|
|
17
|
-
* Defines apps shown in the reports app, with each service linked
|
|
18
|
-
* to its backend filter type (REPORT_FILTER_TYPES).
|
|
19
|
-
*
|
|
20
|
-
*/
|
|
21
4
|
export declare const REPORTS_APPS: {
|
|
22
5
|
code: string;
|
|
23
6
|
name: string;
|
|
@@ -1,89 +1,39 @@
|
|
|
1
1
|
import { APP_CODES } from './apps';
|
|
2
2
|
import { acceptanceAppIcon, billingAppIcon, payoutsAppIcon, walletAppIcon } from './assets';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
// Billing
|
|
20
|
-
INVOICE: 'INVOICE',
|
|
21
|
-
// Payouts
|
|
22
|
-
PAYOUT: 'PAYOUT',
|
|
23
|
-
MERCHANT_PAYOUT: 'MERCHANT_PAYOUT',
|
|
24
|
-
RETAILER_PAYOUT: 'RETAILER_PAYOUT',
|
|
3
|
+
export const filtersTypeMap = {
|
|
4
|
+
[APP_CODES.acceptance.services.charges.code]: ['CHARGE'],
|
|
5
|
+
[APP_CODES.acceptance.services.authorization.code]: ['AUTHORIZE'],
|
|
6
|
+
[APP_CODES.acceptance.services.refunds.code]: ['REFUND'],
|
|
7
|
+
[APP_CODES.acceptance.services.chargeback.code]: ['CHARGEBACKS'],
|
|
8
|
+
[APP_CODES.acceptance.services.destinations.code]: ['DESTINATIONS'],
|
|
9
|
+
[APP_CODES.acceptance.code]: ['CHARGE', 'AUTHORIZE', 'REFUND', 'CHARGEBACKS', 'DESTINATIONS'],
|
|
10
|
+
[APP_CODES.payouts.code]: ['PAYOUT', 'RETAILER_PAYOUT', 'MERCHANT_PAYOUT'],
|
|
11
|
+
[APP_CODES.wallet.code]: ['STATEMENT', 'STATEMENT_SUMMARY'],
|
|
12
|
+
[APP_CODES.billing.code]: ['INVOICE'],
|
|
13
|
+
[APP_CODES.payouts.services.payouts.code]: ['PAYOUT'],
|
|
14
|
+
[APP_CODES.wallet.services.merchants.functions.statement.code]: ['STATEMENT'],
|
|
15
|
+
[APP_CODES.wallet.services.merchants.functions.summary.code]: ['STATEMENT_SUMMARY'],
|
|
16
|
+
[APP_CODES.billing.services.invoices.code]: ['INVOICE'],
|
|
17
|
+
[APP_CODES.payouts.services.merchantPayout.code]: ['MERCHANT_PAYOUT'],
|
|
18
|
+
[APP_CODES.payouts.services.retailerPayout.code]: ['RETAILER_PAYOUT'],
|
|
25
19
|
};
|
|
26
|
-
/**
|
|
27
|
-
* Maps report **source codes** (app or service)
|
|
28
|
-
* to the corresponding **backend report filter types**.
|
|
29
|
-
*
|
|
30
|
-
* Used as a translation layer between UI report grouping
|
|
31
|
-
* and backend report filtering.
|
|
32
|
-
*
|
|
33
|
-
* - Key: App code or service code
|
|
34
|
-
* - Value: One or more backend filter types
|
|
35
|
-
*/
|
|
36
|
-
export const reportFilterTypesMap = {
|
|
37
|
-
// Acceptance
|
|
38
|
-
[APP_CODES.acceptance.services.charges.code]: [REPORT_FILTER_TYPES.CHARGE],
|
|
39
|
-
[APP_CODES.acceptance.services.authorization.code]: [REPORT_FILTER_TYPES.AUTHORIZE],
|
|
40
|
-
[APP_CODES.acceptance.services.refunds.code]: [REPORT_FILTER_TYPES.REFUND],
|
|
41
|
-
[APP_CODES.acceptance.services.chargeback.code]: [REPORT_FILTER_TYPES.CHARGEBACKS],
|
|
42
|
-
[APP_CODES.acceptance.services.destinations.code]: [REPORT_FILTER_TYPES.DESTINATIONS],
|
|
43
|
-
[APP_CODES.acceptance.code]: [
|
|
44
|
-
REPORT_FILTER_TYPES.CHARGE,
|
|
45
|
-
REPORT_FILTER_TYPES.AUTHORIZE,
|
|
46
|
-
REPORT_FILTER_TYPES.REFUND,
|
|
47
|
-
REPORT_FILTER_TYPES.CHARGEBACKS,
|
|
48
|
-
REPORT_FILTER_TYPES.DESTINATIONS,
|
|
49
|
-
],
|
|
50
|
-
// Wallet
|
|
51
|
-
[APP_CODES.wallet.services.merchants.functions.statement.code]: [REPORT_FILTER_TYPES.STATEMENT],
|
|
52
|
-
[APP_CODES.wallet.services.merchants.functions.summary.code]: [REPORT_FILTER_TYPES.STATEMENT_SUMMARY],
|
|
53
|
-
[APP_CODES.wallet.code]: [REPORT_FILTER_TYPES.STATEMENT, REPORT_FILTER_TYPES.STATEMENT_SUMMARY],
|
|
54
|
-
// Billing
|
|
55
|
-
[APP_CODES.billing.services.invoices.code]: [REPORT_FILTER_TYPES.INVOICE],
|
|
56
|
-
[APP_CODES.billing.code]: [REPORT_FILTER_TYPES.INVOICE],
|
|
57
|
-
// Payouts
|
|
58
|
-
[APP_CODES.payouts.services.payouts.code]: [REPORT_FILTER_TYPES.PAYOUT],
|
|
59
|
-
[APP_CODES.payouts.services.merchantPayout.code]: [REPORT_FILTER_TYPES.MERCHANT_PAYOUT],
|
|
60
|
-
[APP_CODES.payouts.services.retailerPayout.code]: [REPORT_FILTER_TYPES.RETAILER_PAYOUT],
|
|
61
|
-
[APP_CODES.payouts.code]: [REPORT_FILTER_TYPES.PAYOUT, REPORT_FILTER_TYPES.MERCHANT_PAYOUT, REPORT_FILTER_TYPES.RETAILER_PAYOUT],
|
|
62
|
-
};
|
|
63
|
-
/**
|
|
64
|
-
* Reports apps
|
|
65
|
-
*
|
|
66
|
-
* Defines apps shown in the reports app, with each service linked
|
|
67
|
-
* to its backend filter type (REPORT_FILTER_TYPES).
|
|
68
|
-
*
|
|
69
|
-
*/
|
|
70
20
|
export const REPORTS_APPS = [
|
|
71
21
|
{
|
|
72
22
|
code: APP_CODES.billing.code,
|
|
73
23
|
name: 'Billing',
|
|
74
24
|
icon: billingAppIcon,
|
|
75
|
-
services: [{ name: 'Invoices', code:
|
|
25
|
+
services: [{ name: 'Invoices', code: 'INVOICE' }],
|
|
76
26
|
},
|
|
77
27
|
{
|
|
78
28
|
code: APP_CODES.acceptance.code,
|
|
79
29
|
name: 'Acceptance',
|
|
80
30
|
icon: acceptanceAppIcon,
|
|
81
31
|
services: [
|
|
82
|
-
{ name: 'Authorisations', code:
|
|
83
|
-
{ name: 'Charges', code:
|
|
84
|
-
{ name: 'Refunds', code:
|
|
85
|
-
{ name: 'Chargebacks', code:
|
|
86
|
-
{ name: 'Destinations', code:
|
|
32
|
+
{ name: 'Authorisations', code: 'AUTHORIZE' },
|
|
33
|
+
{ name: 'Charges', code: 'CHARGE' },
|
|
34
|
+
{ name: 'Refunds', code: 'REFUND' },
|
|
35
|
+
{ name: 'Chargebacks', code: 'CHARGEBACKS' },
|
|
36
|
+
{ name: 'Destinations', code: 'DESTINATIONS' },
|
|
87
37
|
],
|
|
88
38
|
},
|
|
89
39
|
{
|
|
@@ -91,8 +41,8 @@ export const REPORTS_APPS = [
|
|
|
91
41
|
name: 'Wallet',
|
|
92
42
|
icon: walletAppIcon,
|
|
93
43
|
services: [
|
|
94
|
-
{ name: 'Aggregated Statement', code:
|
|
95
|
-
{ name: 'Detailed Statement', code:
|
|
44
|
+
{ name: 'Aggregated Statement', code: 'STATEMENT_SUMMARY' },
|
|
45
|
+
{ name: 'Detailed Statement', code: 'STATEMENT' },
|
|
96
46
|
],
|
|
97
47
|
},
|
|
98
48
|
{
|
|
@@ -100,9 +50,9 @@ export const REPORTS_APPS = [
|
|
|
100
50
|
name: 'Payouts',
|
|
101
51
|
icon: payoutsAppIcon,
|
|
102
52
|
services: [
|
|
103
|
-
{ name: 'Payouts', code:
|
|
104
|
-
{ name: 'Merchant Payouts', code:
|
|
105
|
-
{ name: 'Retailer Payouts', code:
|
|
53
|
+
{ name: 'Payouts', code: 'PAYOUT' },
|
|
54
|
+
{ name: 'Merchant Payouts', code: 'MERCHANT_PAYOUT' },
|
|
55
|
+
{ name: 'Retailer Payouts', code: 'RETAILER_PAYOUT' },
|
|
106
56
|
],
|
|
107
57
|
},
|
|
108
58
|
];
|
package/build/types/apps.d.ts
CHANGED
|
@@ -1,16 +1,18 @@
|
|
|
1
1
|
import { ColumnsView } from './column';
|
|
2
2
|
import { Segment, SegmentCountry, SegmentUser, SelectedBrand, SelectedCountry, User } from './user';
|
|
3
|
+
import { BusinessMerchant } from './merchant';
|
|
3
4
|
import type { i18n } from 'i18next';
|
|
4
5
|
import { Theme } from '@mui/material';
|
|
5
6
|
import { CalenderMode } from './theme';
|
|
6
7
|
import { Timezone } from './appConfig';
|
|
7
8
|
import { Brand, Entity, TableMode } from './index.js';
|
|
8
9
|
import { TextAndLang } from './common';
|
|
9
|
-
export interface
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
export interface AccountAppPayload {
|
|
11
|
+
disabledAccountDataFetching?: boolean;
|
|
12
|
+
isAccountDetailsOpen: boolean;
|
|
13
|
+
selectedMerchant?: BusinessMerchant;
|
|
12
14
|
}
|
|
13
|
-
export interface
|
|
15
|
+
export interface AppPayload extends Partial<AccountAppPayload> {
|
|
14
16
|
columnFilters?: Record<string, any>;
|
|
15
17
|
filteredIds?: string[];
|
|
16
18
|
dateRange?: [Date, Date];
|
|
@@ -19,7 +21,6 @@ export interface ServicePayload {
|
|
|
19
21
|
isTextShown?: boolean;
|
|
20
22
|
tableViews?: ColumnsView[];
|
|
21
23
|
calendarTimezone?: number;
|
|
22
|
-
reportTypes?: string[];
|
|
23
24
|
}
|
|
24
25
|
export interface AppDetails {
|
|
25
26
|
id: string;
|
|
@@ -42,7 +43,7 @@ export interface AppDetails {
|
|
|
42
43
|
minWidth: number | string;
|
|
43
44
|
minHeight: number | string;
|
|
44
45
|
};
|
|
45
|
-
payload?: Record<string, any> &
|
|
46
|
+
payload?: Record<string, any> & AppPayload;
|
|
46
47
|
toolbarIconUrl?: string;
|
|
47
48
|
hideMaximizedApp?: boolean;
|
|
48
49
|
hideMinimizeApp?: boolean;
|
|
@@ -98,7 +99,7 @@ export type MFWidgetBaseProps = {
|
|
|
98
99
|
hasHeader: boolean;
|
|
99
100
|
sandboxMode: boolean;
|
|
100
101
|
initialServiceCode?: string;
|
|
101
|
-
initialPayload?: Record<string, any> &
|
|
102
|
+
initialPayload?: Record<string, any> & AppPayload;
|
|
102
103
|
};
|
|
103
104
|
user: User;
|
|
104
105
|
segment: {
|
|
@@ -6,7 +6,7 @@ export declare const openNewAppAttrs: ({ appCode, serviceCode, sandboxMode, payl
|
|
|
6
6
|
numberOfOpenedApps: number;
|
|
7
7
|
segmentId: string;
|
|
8
8
|
}) => {
|
|
9
|
-
payload?: (Record<string, any> & import("../types/index.js").
|
|
9
|
+
payload?: (Record<string, any> & import("../types/index.js").AppPayload) | undefined;
|
|
10
10
|
segmentId: string;
|
|
11
11
|
appCode: string;
|
|
12
12
|
serviceCode: string;
|
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.365-test.
|
|
5
|
-
"testVersion":
|
|
4
|
+
"version": "0.1.365-test.4",
|
|
5
|
+
"testVersion": 4,
|
|
6
6
|
"type": "module",
|
|
7
7
|
"main": "build/index.js",
|
|
8
8
|
"module": "build/index.js",
|
|
@@ -63,7 +63,7 @@
|
|
|
63
63
|
"ts:build": "rm -rf build && tsc -p tsconfig.npm.json && tsc-alias -p tsconfig.npm.json",
|
|
64
64
|
"push:local": "yarn ts:build && yalc publish --push",
|
|
65
65
|
"push": "npm run ts:build && npm publish --access public",
|
|
66
|
-
"push:test": " npm publish --access public --tag test && node scripts/restore-version.cjs",
|
|
66
|
+
"push:test": "node scripts/increment-test-version.cjs && npm run ts:build && npm publish --access public --tag test && node scripts/restore-version.cjs",
|
|
67
67
|
"dev": "vite",
|
|
68
68
|
"build": "tsc -b && vite build ",
|
|
69
69
|
"prettier": "prettier --list-different \"src/**/*.{md,mdx,ts,js,tsx,jsx,json}\"",
|
|
@@ -164,4 +164,4 @@
|
|
|
164
164
|
"publishConfig": {
|
|
165
165
|
"registry": "https://registry.npmjs.org/"
|
|
166
166
|
}
|
|
167
|
-
}
|
|
167
|
+
}
|