@tap-payments/auth-jsconnect 2.10.0-development → 2.10.0
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.
- package/README.md +2 -2
- package/build/@types/app.d.ts +1 -0
- package/build/@types/form.d.ts +2 -0
- package/build/@types/index.d.ts +0 -1
- package/build/@types/index.js +0 -1
- package/build/api/auth.d.ts +1 -9
- package/build/api/entity.d.ts +3 -0
- package/build/api/index.d.ts +1 -8
- package/build/api/index.js +1 -3
- package/build/api/lead.d.ts +1 -0
- package/build/app/rootReducer.d.ts +0 -1
- package/build/app/rootReducer.js +1 -3
- package/build/app/settings.js +1 -2
- package/build/app/store.d.ts +0 -2
- package/build/assets/currencies/AEDSymbol.d.ts +7 -0
- package/build/assets/currencies/AEDSymbol.js +28 -0
- package/build/assets/currencies/index.d.ts +2 -2
- package/build/assets/currencies/index.js +2 -2
- package/build/assets/currencies/utils.js +3 -1
- package/build/assets/locales/ar.json +48 -12
- package/build/assets/locales/en.json +51 -40
- package/build/components/TextWithCurrency/TextWithCurrency.js +1 -1
- package/build/components/Tooltip/Tooltip.js +1 -1
- package/build/constants/api.d.ts +1 -0
- package/build/constants/api.js +2 -0
- package/build/constants/app.d.ts +12 -11
- package/build/constants/app.js +8 -112
- package/build/constants/assets.d.ts +7 -6
- package/build/constants/assets.js +118 -111
- package/build/constants/dummy.js +27 -20
- package/build/constants/flows.d.ts +0 -14
- package/build/constants/flows.js +0 -14
- package/build/constants/validation.d.ts +1 -1
- package/build/constants/validation.js +1 -1
- package/build/features/app/business/businessStore.js +15 -10
- package/build/features/app/connectExpress/connectExpressStore.js +19 -4
- package/build/features/app/individual/individualStore.js +1 -0
- package/build/features/auth/Auth.d.ts +1 -1
- package/build/features/auth/screens/AuthenticationList/EntityList.js +2 -2
- package/build/features/business/screens/BusinessType/BusinessType.js +13 -2
- package/build/features/business/screens/BusinessType/EntityLicenseList.js +11 -5
- package/build/features/business/screens/BusinessType/LicenseList.js +15 -7
- package/build/features/business/screens/BusinessType/UnifiedNumber.d.ts +35 -0
- package/build/features/business/screens/BusinessType/UnifiedNumber.js +84 -0
- package/build/features/business/screens/BusinessType/validation.d.ts +6 -3
- package/build/features/business/screens/BusinessType/validation.js +31 -10
- package/build/features/connectExpress/screens/AuthenticationList/EntityList.js +2 -2
- package/build/features/connectExpress/screens/CollectBusinessInfo/CollectBusinessInfo.js +1 -0
- package/build/features/connectExpress/screens/CollectBusinessInfo/LicenseList.js +23 -7
- package/build/features/connectExpress/screens/CollectBusinessInfo/LicenseNumber.js +2 -2
- package/build/features/connectExpress/screens/CollectBusinessInfo/TAC.js +1 -1
- package/build/features/connectExpress/screens/CollectBusinessInfo/UnifiedNumber.d.ts +36 -0
- package/build/features/connectExpress/screens/CollectBusinessInfo/UnifiedNumber.js +81 -0
- package/build/features/connectExpress/screens/CollectBusinessInfo/validation.d.ts +6 -3
- package/build/features/connectExpress/screens/CollectBusinessInfo/validation.js +57 -21
- package/build/features/entity/screens/EntityName/EntityName.js +2 -1
- package/build/features/entity/screens/EntityName/UnifiedNumber.js +2 -2
- package/build/features/entity/screens/EntityName/validation.d.ts +3 -3
- package/build/features/entity/screens/EntityName/validation.js +14 -3
- package/build/features/featuresScreens.d.ts +0 -1
- package/build/features/featuresScreens.js +0 -62
- package/build/features/shared/Button/Button.js +1 -1
- package/build/features/shared/Button/FlowsButtons.js +1 -2
- package/build/features/shared/SuccessScreen/SuccessScreen.d.ts +1 -3
- package/build/features/shared/SuccessScreen/SuccessScreen.js +2 -2
- package/build/hooks/useAppConfig.js +1 -1
- package/build/hooks/useAppDispatch.d.ts +0 -1
- package/build/index.d.ts +2 -3
- package/build/index.js +2 -4
- package/build/theme/palette.js +0 -12
- package/build/theme/typography.js +0 -4
- package/build/utils/common.d.ts +1 -1
- package/build/utils/common.js +5 -6
- package/build/utils/string.d.ts +1 -1
- package/build/utils/string.js +3 -1
- package/build/utils/validation.js +1 -1
- package/package.json +2 -2
- package/build/@types/terminal.d.ts +0 -116
- package/build/@types/terminal.js +0 -1
- package/build/api/terminal.d.ts +0 -23
- package/build/api/terminal.js +0 -60
- package/build/components/DeviceCard/DeviceCard.d.ts +0 -18
- package/build/components/DeviceCard/DeviceCard.js +0 -103
- package/build/components/DeviceCard/index.d.ts +0 -3
- package/build/components/DeviceCard/index.js +0 -2
- package/build/features/app/terminal/terminalStore.d.ts +0 -106
- package/build/features/app/terminal/terminalStore.js +0 -635
- package/build/features/shared/PushNotification/PushNotification.d.ts +0 -11
- package/build/features/shared/PushNotification/PushNotification.js +0 -34
- package/build/features/shared/PushNotification/index.d.ts +0 -2
- package/build/features/shared/PushNotification/index.js +0 -2
- package/build/features/terminal/Terminal.d.ts +0 -14
- package/build/features/terminal/Terminal.js +0 -95
- package/build/features/terminal/index.d.ts +0 -1
- package/build/features/terminal/index.js +0 -1
- package/build/features/terminal/screens/LinkNewTerminal/LinkNewTerminal.d.ts +0 -3
- package/build/features/terminal/screens/LinkNewTerminal/LinkNewTerminal.js +0 -68
- package/build/features/terminal/screens/LinkNewTerminal/index.d.ts +0 -2
- package/build/features/terminal/screens/LinkNewTerminal/index.js +0 -2
- package/build/features/terminal/screens/LinkNewTerminal/styles.d.ts +0 -10
- package/build/features/terminal/screens/LinkNewTerminal/styles.js +0 -28
- package/build/features/terminal/screens/LinkedSuccess/LinkedSuccess.d.ts +0 -3
- package/build/features/terminal/screens/LinkedSuccess/LinkedSuccess.js +0 -50
- package/build/features/terminal/screens/LinkedSuccess/index.d.ts +0 -2
- package/build/features/terminal/screens/LinkedSuccess/index.js +0 -2
- package/build/features/terminal/screens/LinkedTerminalInfo/LinkedTerminalInfo.d.ts +0 -3
- package/build/features/terminal/screens/LinkedTerminalInfo/LinkedTerminalInfo.js +0 -50
- package/build/features/terminal/screens/LinkedTerminalInfo/index.d.ts +0 -2
- package/build/features/terminal/screens/LinkedTerminalInfo/index.js +0 -2
- package/build/features/terminal/screens/Loading/Loading.d.ts +0 -4
- package/build/features/terminal/screens/Loading/Loading.js +0 -10
- package/build/features/terminal/screens/Loading/index.d.ts +0 -2
- package/build/features/terminal/screens/Loading/index.js +0 -2
- package/build/features/terminal/screens/NoTerminalLinked/NoTerminalLinked.d.ts +0 -3
- package/build/features/terminal/screens/NoTerminalLinked/NoTerminalLinked.js +0 -57
- package/build/features/terminal/screens/NoTerminalLinked/index.d.ts +0 -2
- package/build/features/terminal/screens/NoTerminalLinked/index.js +0 -2
- package/build/features/terminal/screens/NoTerminalLinked/styles.d.ts +0 -36
- package/build/features/terminal/screens/NoTerminalLinked/styles.js +0 -34
- package/build/features/terminal/screens/OperatorError/OperatorError.d.ts +0 -5
- package/build/features/terminal/screens/OperatorError/OperatorError.js +0 -9
- package/build/features/terminal/screens/OperatorError/index.d.ts +0 -2
- package/build/features/terminal/screens/OperatorError/index.js +0 -2
- package/build/features/terminal/screens/ResetPasswordSuccess/ResetPasswordSuccess.d.ts +0 -3
- package/build/features/terminal/screens/ResetPasswordSuccess/ResetPasswordSuccess.js +0 -21
- package/build/features/terminal/screens/ResetPasswordSuccess/index.d.ts +0 -2
- package/build/features/terminal/screens/ResetPasswordSuccess/index.js +0 -2
- package/build/features/terminal/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.d.ts +0 -3
- package/build/features/terminal/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +0 -31
- package/build/features/terminal/screens/SuccessWithFlowButtons/index.d.ts +0 -2
- package/build/features/terminal/screens/SuccessWithFlowButtons/index.js +0 -2
- package/build/features/terminal/screens/TerminalDeviceList/DeviceList.d.ts +0 -9
- package/build/features/terminal/screens/TerminalDeviceList/DeviceList.js +0 -20
- package/build/features/terminal/screens/TerminalDeviceList/Header.d.ts +0 -6
- package/build/features/terminal/screens/TerminalDeviceList/Header.js +0 -23
- package/build/features/terminal/screens/TerminalDeviceList/TerminalDeviceList.d.ts +0 -3
- package/build/features/terminal/screens/TerminalDeviceList/TerminalDeviceList.js +0 -129
- package/build/features/terminal/screens/TerminalDeviceList/index.d.ts +0 -2
- package/build/features/terminal/screens/TerminalDeviceList/index.js +0 -2
- package/build/features/terminal/screens/TerminalDeviceList/styles.d.ts +0 -71
- package/build/features/terminal/screens/TerminalDeviceList/styles.js +0 -56
- package/build/features/terminal/screens/UnlinkedSuccess/UnlinkedSuccess.d.ts +0 -3
- package/build/features/terminal/screens/UnlinkedSuccess/UnlinkedSuccess.js +0 -52
- package/build/features/terminal/screens/UnlinkedSuccess/index.d.ts +0 -2
- package/build/features/terminal/screens/UnlinkedSuccess/index.js +0 -2
- package/build/features/terminal/screens/UnlinkedTerminalInfo/TerminalList.d.ts +0 -9
- package/build/features/terminal/screens/UnlinkedTerminalInfo/TerminalList.js +0 -16
- package/build/features/terminal/screens/UnlinkedTerminalInfo/UnlinkedTerminalInfo.d.ts +0 -3
- package/build/features/terminal/screens/UnlinkedTerminalInfo/UnlinkedTerminalInfo.js +0 -94
- package/build/features/terminal/screens/UnlinkedTerminalInfo/index.d.ts +0 -2
- package/build/features/terminal/screens/UnlinkedTerminalInfo/index.js +0 -2
- package/build/features/terminal/screens/UnlinkedTerminalInfo/styles.d.ts +0 -74
- package/build/features/terminal/screens/UnlinkedTerminalInfo/styles.js +0 -98
- package/build/features/terminal/screens/Verify/OTPInput.d.ts +0 -7
- package/build/features/terminal/screens/Verify/OTPInput.js +0 -51
- package/build/features/terminal/screens/Verify/Verify.d.ts +0 -5
- package/build/features/terminal/screens/Verify/Verify.js +0 -85
- package/build/features/terminal/screens/Verify/index.d.ts +0 -2
- package/build/features/terminal/screens/Verify/index.js +0 -2
- package/build/features/terminal/screens/Verify/validation.d.ts +0 -8
- package/build/features/terminal/screens/Verify/validation.js +0 -4
- package/build/features/terminal/screens/shared/index.d.ts +0 -2
- package/build/features/terminal/screens/shared/index.js +0 -2
- package/build/features/terminal/screens/shared/styles.d.ts +0 -72
- package/build/features/terminal/screens/shared/styles.js +0 -50
- package/build/features/terminal/screens/shared/utils.d.ts +0 -7
- package/build/features/terminal/screens/shared/utils.js +0 -24
|
@@ -53,7 +53,7 @@ export var keepLettersAndSpace = function (str) {
|
|
|
53
53
|
return str.replace(/[^a-zA-Z] /g, '');
|
|
54
54
|
};
|
|
55
55
|
export var isConnectTapDomain = function (domain) {
|
|
56
|
-
var regex = /^(https:\/\/)?connect(\.\w+)?\.tap\.company$/;
|
|
56
|
+
var regex = /^(https:\/\/)?connect(\.\w+)?\.tap\.(company|com\.\w{2})$/;
|
|
57
57
|
return regex.test(domain);
|
|
58
58
|
};
|
|
59
59
|
export var isTapDomain = function (domain) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tap-payments/auth-jsconnect",
|
|
3
|
-
"version": "2.10.0
|
|
3
|
+
"version": "2.10.0",
|
|
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
|
|
24
|
+
"push": "npm publish --access public"
|
|
25
25
|
},
|
|
26
26
|
"keywords": [],
|
|
27
27
|
"author": {
|
|
@@ -1,116 +0,0 @@
|
|
|
1
|
-
declare type Name = {
|
|
2
|
-
en: string;
|
|
3
|
-
};
|
|
4
|
-
export interface TerminalDeviceInfo {
|
|
5
|
-
id: string;
|
|
6
|
-
status: string;
|
|
7
|
-
object?: string;
|
|
8
|
-
live_mode: boolean;
|
|
9
|
-
api_version?: string;
|
|
10
|
-
feature_version?: string;
|
|
11
|
-
serial_number: string;
|
|
12
|
-
linked: boolean;
|
|
13
|
-
display_name: string;
|
|
14
|
-
model: {
|
|
15
|
-
id: string;
|
|
16
|
-
status: string;
|
|
17
|
-
object?: string;
|
|
18
|
-
live_mode: boolean;
|
|
19
|
-
api_version?: string;
|
|
20
|
-
feature_version?: string;
|
|
21
|
-
model: string;
|
|
22
|
-
type: string;
|
|
23
|
-
name: {
|
|
24
|
-
text: string;
|
|
25
|
-
lang: string;
|
|
26
|
-
}[];
|
|
27
|
-
image: string;
|
|
28
|
-
image_url: string;
|
|
29
|
-
};
|
|
30
|
-
merchant?: {
|
|
31
|
-
id: string;
|
|
32
|
-
brand: {
|
|
33
|
-
id: string;
|
|
34
|
-
name: {
|
|
35
|
-
text: string;
|
|
36
|
-
lang: string;
|
|
37
|
-
}[];
|
|
38
|
-
logo: string;
|
|
39
|
-
};
|
|
40
|
-
};
|
|
41
|
-
terminal?: {
|
|
42
|
-
id: string;
|
|
43
|
-
legacy_id: string;
|
|
44
|
-
name: Name;
|
|
45
|
-
device: {
|
|
46
|
-
id: string;
|
|
47
|
-
created: string;
|
|
48
|
-
display_name: string;
|
|
49
|
-
};
|
|
50
|
-
};
|
|
51
|
-
platform?: {
|
|
52
|
-
id: string;
|
|
53
|
-
segment: string;
|
|
54
|
-
brand?: {
|
|
55
|
-
id: string;
|
|
56
|
-
name: {
|
|
57
|
-
text: string;
|
|
58
|
-
lang: string;
|
|
59
|
-
}[];
|
|
60
|
-
logo: string;
|
|
61
|
-
};
|
|
62
|
-
};
|
|
63
|
-
}
|
|
64
|
-
export interface TerminalInfo {
|
|
65
|
-
acceptance_status?: string;
|
|
66
|
-
acceptance_status_control?: string;
|
|
67
|
-
api_version?: string;
|
|
68
|
-
authorizes?: {
|
|
69
|
-
status: string;
|
|
70
|
-
status_message: string;
|
|
71
|
-
};
|
|
72
|
-
brand?: {
|
|
73
|
-
id: string;
|
|
74
|
-
};
|
|
75
|
-
charges?: {
|
|
76
|
-
status: string;
|
|
77
|
-
status_message: string;
|
|
78
|
-
};
|
|
79
|
-
feature_version?: string;
|
|
80
|
-
id: string;
|
|
81
|
-
legacy_id: string;
|
|
82
|
-
live_mode?: boolean;
|
|
83
|
-
merchant: {
|
|
84
|
-
base_currency?: string;
|
|
85
|
-
country?: string;
|
|
86
|
-
id: string;
|
|
87
|
-
};
|
|
88
|
-
name: Name;
|
|
89
|
-
platform?: {
|
|
90
|
-
brand: {
|
|
91
|
-
id: string;
|
|
92
|
-
logo: string;
|
|
93
|
-
name: {
|
|
94
|
-
text: string;
|
|
95
|
-
lang: string;
|
|
96
|
-
}[];
|
|
97
|
-
};
|
|
98
|
-
id: string;
|
|
99
|
-
segment: string;
|
|
100
|
-
};
|
|
101
|
-
object?: string;
|
|
102
|
-
refunds?: {
|
|
103
|
-
status: string;
|
|
104
|
-
status_message: string;
|
|
105
|
-
};
|
|
106
|
-
virtual?: boolean;
|
|
107
|
-
wallet?: {
|
|
108
|
-
id: string;
|
|
109
|
-
};
|
|
110
|
-
device?: {
|
|
111
|
-
id: string;
|
|
112
|
-
created: string;
|
|
113
|
-
display_name: string;
|
|
114
|
-
};
|
|
115
|
-
}
|
|
116
|
-
export {};
|
package/build/@types/terminal.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
package/build/api/terminal.d.ts
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
export interface GenerateAuthLinkNewTerminalProps {
|
|
2
|
-
merchant: {
|
|
3
|
-
id: string;
|
|
4
|
-
terminal: {
|
|
5
|
-
id: string;
|
|
6
|
-
};
|
|
7
|
-
};
|
|
8
|
-
}
|
|
9
|
-
export interface UnlinkTerminalDeviceProps {
|
|
10
|
-
id: string;
|
|
11
|
-
action: string;
|
|
12
|
-
}
|
|
13
|
-
export interface LinkTerminalDeviceProps {
|
|
14
|
-
id: string;
|
|
15
|
-
action: string;
|
|
16
|
-
}
|
|
17
|
-
declare const terminalService: {
|
|
18
|
-
retrieveTerminalDeviceList: (merchants: string[]) => Promise<any>;
|
|
19
|
-
generateAuthenticationToLinkNewTerminal: (payload: GenerateAuthLinkNewTerminalProps) => Promise<any>;
|
|
20
|
-
unlinkTerminalDevice: (payload: UnlinkTerminalDeviceProps) => Promise<any>;
|
|
21
|
-
retrieveTerminalList: (merchantIds: string[]) => Promise<any>;
|
|
22
|
-
};
|
|
23
|
-
export { terminalService };
|
package/build/api/terminal.js
DELETED
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
import { ENDPOINT_PATHS } from '../constants';
|
|
2
|
-
import { httpClient } from './axios';
|
|
3
|
-
var retrieveTerminalDeviceList = function (merchants) {
|
|
4
|
-
return httpClient({
|
|
5
|
-
method: 'post',
|
|
6
|
-
url: "".concat(ENDPOINT_PATHS.TERMINAL, "/device/list"),
|
|
7
|
-
data: {
|
|
8
|
-
merchants: merchants
|
|
9
|
-
}
|
|
10
|
-
});
|
|
11
|
-
};
|
|
12
|
-
var retrieveTerminalList = function (merchantIds) {
|
|
13
|
-
return httpClient({
|
|
14
|
-
method: 'post',
|
|
15
|
-
url: "".concat(ENDPOINT_PATHS.TERMINAL, "/list"),
|
|
16
|
-
data: {
|
|
17
|
-
merchant_id: merchantIds
|
|
18
|
-
}
|
|
19
|
-
});
|
|
20
|
-
};
|
|
21
|
-
var generateAuthenticationToLinkNewTerminal = function (payload) {
|
|
22
|
-
return httpClient({
|
|
23
|
-
method: 'get',
|
|
24
|
-
url: 'https://dummyjson.com/c/7544-fa91-4a47-9612'
|
|
25
|
-
});
|
|
26
|
-
return httpClient({
|
|
27
|
-
method: 'post',
|
|
28
|
-
url: "".concat(ENDPOINT_PATHS.TERMINAL, "/link"),
|
|
29
|
-
data: payload
|
|
30
|
-
});
|
|
31
|
-
};
|
|
32
|
-
var unlinkTerminalDevice = function (payload) {
|
|
33
|
-
return httpClient({
|
|
34
|
-
method: 'get',
|
|
35
|
-
url: 'https://dummyjson.com/c/15d1-eae7-43ad-9734'
|
|
36
|
-
});
|
|
37
|
-
return httpClient({
|
|
38
|
-
method: 'post',
|
|
39
|
-
url: "".concat(ENDPOINT_PATHS.TERMINAL, "/link"),
|
|
40
|
-
data: payload
|
|
41
|
-
});
|
|
42
|
-
};
|
|
43
|
-
var linkTerminalDevice = function (payload) {
|
|
44
|
-
return httpClient({
|
|
45
|
-
method: 'get',
|
|
46
|
-
url: 'https://dummyjson.com/c/7544-fa91-4a47-9612'
|
|
47
|
-
});
|
|
48
|
-
return httpClient({
|
|
49
|
-
method: 'post',
|
|
50
|
-
url: "".concat(ENDPOINT_PATHS.TERMINAL, "/link"),
|
|
51
|
-
data: payload
|
|
52
|
-
});
|
|
53
|
-
};
|
|
54
|
-
var terminalService = {
|
|
55
|
-
retrieveTerminalDeviceList: retrieveTerminalDeviceList,
|
|
56
|
-
generateAuthenticationToLinkNewTerminal: generateAuthenticationToLinkNewTerminal,
|
|
57
|
-
unlinkTerminalDevice: unlinkTerminalDevice,
|
|
58
|
-
retrieveTerminalList: retrieveTerminalList
|
|
59
|
-
};
|
|
60
|
-
export { terminalService };
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { CardProps } from '@mui/material/Card';
|
|
3
|
-
export interface DeviceCardProps extends CardProps {
|
|
4
|
-
image?: string;
|
|
5
|
-
name: string;
|
|
6
|
-
deviceId: string;
|
|
7
|
-
deviceIdLabel?: string;
|
|
8
|
-
isLinked?: boolean;
|
|
9
|
-
pairedWith?: string;
|
|
10
|
-
badge?: boolean;
|
|
11
|
-
border?: boolean;
|
|
12
|
-
loading?: boolean;
|
|
13
|
-
arrow?: boolean;
|
|
14
|
-
endAdornment?: React.ReactNode;
|
|
15
|
-
}
|
|
16
|
-
export declare const DeviceCard: ({ image, name, deviceId, deviceIdLabel, isLinked, pairedWith, onClick, badge, border, arrow, loading, endAdornment, ...rest }: DeviceCardProps) => JSX.Element;
|
|
17
|
-
declare const _default: React.MemoExoticComponent<({ image, name, deviceId, deviceIdLabel, isLinked, pairedWith, onClick, badge, border, arrow, loading, endAdornment, ...rest }: DeviceCardProps) => JSX.Element>;
|
|
18
|
-
export default _default;
|
|
@@ -1,103 +0,0 @@
|
|
|
1
|
-
var __assign = (this && this.__assign) || function () {
|
|
2
|
-
__assign = Object.assign || function(t) {
|
|
3
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
-
s = arguments[i];
|
|
5
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
-
t[p] = s[p];
|
|
7
|
-
}
|
|
8
|
-
return t;
|
|
9
|
-
};
|
|
10
|
-
return __assign.apply(this, arguments);
|
|
11
|
-
};
|
|
12
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
13
|
-
var t = {};
|
|
14
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
15
|
-
t[p] = s[p];
|
|
16
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
17
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
18
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
19
|
-
t[p[i]] = s[p[i]];
|
|
20
|
-
}
|
|
21
|
-
return t;
|
|
22
|
-
};
|
|
23
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
24
|
-
import { memo } from 'react';
|
|
25
|
-
import { useTranslation } from 'react-i18next';
|
|
26
|
-
import { alpha, styled } from '@mui/material/styles';
|
|
27
|
-
import ArrowForwardIosIcon from '@mui/icons-material/ArrowForwardIos';
|
|
28
|
-
import Card from '@mui/material/Card';
|
|
29
|
-
import Box from '@mui/material/Box';
|
|
30
|
-
import Typography from '@mui/material/Typography';
|
|
31
|
-
import Icon from '../Icon';
|
|
32
|
-
import Loader from '../Loader';
|
|
33
|
-
var DeviceCardContainer = styled(Card, { shouldForwardProp: function (prop) { return !['showBorder'].includes(prop.toString()); } })(function (_a) {
|
|
34
|
-
var _b = _a.theme, spacing = _b.spacing, _c = _b.palette, background = _c.background, components = _c.components, showBorder = _a.showBorder;
|
|
35
|
-
return (__assign({ display: 'flex', alignItems: 'center', justifyContent: 'space-between', padding: spacing(2), borderRadius: spacing(0.5), boxShadow: 'none', width: '100%', backgroundColor: background.default, minHeight: spacing(14.125), position: 'relative' }, (showBorder && {
|
|
36
|
-
border: "1px solid ".concat(components.deviceCard.border)
|
|
37
|
-
})));
|
|
38
|
-
});
|
|
39
|
-
var DeviceDetails = styled(Box)(function (_a) {
|
|
40
|
-
var spacing = _a.theme.spacing;
|
|
41
|
-
return ({
|
|
42
|
-
display: 'flex',
|
|
43
|
-
alignItems: 'center',
|
|
44
|
-
gap: spacing(3.125)
|
|
45
|
-
});
|
|
46
|
-
});
|
|
47
|
-
var DeviceImage = styled(Icon)(function (_a) {
|
|
48
|
-
var spacing = _a.theme.spacing;
|
|
49
|
-
return ({
|
|
50
|
-
width: spacing(4.5),
|
|
51
|
-
height: 'auto',
|
|
52
|
-
objectFit: 'contain'
|
|
53
|
-
});
|
|
54
|
-
});
|
|
55
|
-
var DeviceInfo = styled(Box)(function (_a) {
|
|
56
|
-
var spacing = _a.theme.spacing;
|
|
57
|
-
return ({
|
|
58
|
-
display: 'flex',
|
|
59
|
-
flexDirection: 'column',
|
|
60
|
-
gap: spacing(1)
|
|
61
|
-
});
|
|
62
|
-
});
|
|
63
|
-
var DeviceTitle = styled(Typography)(function (_a) {
|
|
64
|
-
var _b = _a.theme, typography = _b.typography, palette = _b.palette;
|
|
65
|
-
return (__assign(__assign({}, typography.subtitle1), { color: palette.components.deviceCard.title, fontWeight: typography.fontWeightBold }));
|
|
66
|
-
});
|
|
67
|
-
var DeviceIdInfo = styled(Box)(function (_a) {
|
|
68
|
-
var _b = _a.theme, typography = _b.typography, palette = _b.palette, spacing = _b.spacing;
|
|
69
|
-
return (__assign(__assign({}, typography.caption_small), { color: alpha(palette.text.primary, 0.6), display: 'flex', flexDirection: 'column', gap: spacing(0.5) }));
|
|
70
|
-
});
|
|
71
|
-
var DeviceIdBold = styled('strong')(function (_a) {
|
|
72
|
-
var palette = _a.theme.palette;
|
|
73
|
-
return ({
|
|
74
|
-
color: palette.components.deviceCard.title
|
|
75
|
-
});
|
|
76
|
-
});
|
|
77
|
-
var Badge = styled(Box, { shouldForwardProp: function (prop) { return !['active'].includes(prop.toString()); } })(function (_a) {
|
|
78
|
-
var _b = _a.theme, direction = _b.direction, spacing = _b.spacing, palette = _b.palette, typography = _b.typography, active = _a.active;
|
|
79
|
-
return (__assign(__assign(__assign({ backgroundColor: palette.components.deviceCard.statusBackground, color: palette.components.deviceCard.statusText }, typography.caption), { fontWeight: typography.fontWeightSemiBold, padding: spacing(0.5, 1, 0.5, 1), position: 'absolute', top: 0, left: direction === 'rtl' ? 0 : 'unset', right: direction === 'rtl' ? 'unset' : '0', borderBottomLeftRadius: spacing(0.5) }), (active && {
|
|
80
|
-
backgroundColor: alpha(palette.primary.main, 0.1),
|
|
81
|
-
color: palette.primary.main
|
|
82
|
-
})));
|
|
83
|
-
});
|
|
84
|
-
var ArrowIcon = styled(ArrowForwardIosIcon)(function (_a) {
|
|
85
|
-
var _b = _a.theme, palette = _b.palette, direction = _b.direction;
|
|
86
|
-
return (__assign({ color: palette.components.deviceCard.title, fontSize: '16px' }, (direction === 'rtl' && {
|
|
87
|
-
transform: 'rotate(180deg)'
|
|
88
|
-
})));
|
|
89
|
-
});
|
|
90
|
-
export var DeviceCard = function (_a) {
|
|
91
|
-
var image = _a.image, name = _a.name, deviceId = _a.deviceId, deviceIdLabel = _a.deviceIdLabel, isLinked = _a.isLinked, pairedWith = _a.pairedWith, onClick = _a.onClick, badge = _a.badge, border = _a.border, arrow = _a.arrow, loading = _a.loading, endAdornment = _a.endAdornment, rest = __rest(_a, ["image", "name", "deviceId", "deviceIdLabel", "isLinked", "pairedWith", "onClick", "badge", "border", "arrow", "loading", "endAdornment"]);
|
|
92
|
-
var t = useTranslation().t;
|
|
93
|
-
var getEndComponent = function () {
|
|
94
|
-
if (endAdornment)
|
|
95
|
-
return endAdornment;
|
|
96
|
-
if (loading)
|
|
97
|
-
return _jsx(Loader, { innerColor: 'black', outerColor: 'black', size: 10, style: { height: 24, width: 24 }, toggleAnimation: !!loading });
|
|
98
|
-
if (arrow)
|
|
99
|
-
return _jsx(ArrowIcon, {});
|
|
100
|
-
};
|
|
101
|
-
return (_jsxs(DeviceCardContainer, __assign({ onClick: onClick, sx: { cursor: onClick ? 'pointer' : 'default' }, showBorder: border }, rest, { children: [_jsxs(DeviceDetails, { children: [image && _jsx(DeviceImage, { src: image, alt: 'Device' }), _jsxs(DeviceInfo, { children: [_jsx(DeviceTitle, { children: name }), _jsxs(DeviceIdInfo, { children: [pairedWith && (_jsxs("span", { children: [t('terminal_paired_with'), ": ", _jsx(DeviceIdBold, { children: pairedWith })] })), _jsxs("span", { children: [t(deviceIdLabel !== null && deviceIdLabel !== void 0 ? deviceIdLabel : 'terminal_device_id'), ": ", _jsx(DeviceIdBold, { children: deviceId }), "`"] })] })] })] }), badge && _jsx(Badge, __assign({ active: isLinked }, { children: isLinked ? t('terminal_linked') : t('terminal_unlinked') })), _jsx(Box, __assign({ display: 'flex', alignItems: 'center' }, { children: getEndComponent() }))] })));
|
|
102
|
-
};
|
|
103
|
-
export default memo(DeviceCard);
|
|
@@ -1,106 +0,0 @@
|
|
|
1
|
-
import { RootState } from '../../../app/store';
|
|
2
|
-
import { ActionState, FlowsTypes, OTPFormValues, SharedState, TerminalDeviceInfo, TerminalInfo } from '../../../@types';
|
|
3
|
-
interface VerifyLeadTokenProps {
|
|
4
|
-
token: string;
|
|
5
|
-
isInternally?: boolean;
|
|
6
|
-
}
|
|
7
|
-
export declare const verifyToken: import("@reduxjs/toolkit").AsyncThunk<{
|
|
8
|
-
data: any;
|
|
9
|
-
token: string;
|
|
10
|
-
nextScreen: string;
|
|
11
|
-
terminalData?: undefined;
|
|
12
|
-
} | {
|
|
13
|
-
data: any;
|
|
14
|
-
token: string;
|
|
15
|
-
terminalData: any;
|
|
16
|
-
nextScreen: string;
|
|
17
|
-
}, VerifyLeadTokenProps, {}>;
|
|
18
|
-
export declare const resendOTP: import("@reduxjs/toolkit").AsyncThunk<{
|
|
19
|
-
data: any;
|
|
20
|
-
}, void, {}>;
|
|
21
|
-
export declare const verifyTokenOTP: import("@reduxjs/toolkit").AsyncThunk<{
|
|
22
|
-
data: any;
|
|
23
|
-
terminalData: any;
|
|
24
|
-
formData: OTPFormValues;
|
|
25
|
-
nextScreen: string;
|
|
26
|
-
}, OTPFormValues, {}>;
|
|
27
|
-
export declare const linkNewTerminal: import("@reduxjs/toolkit").AsyncThunk<{
|
|
28
|
-
data: any;
|
|
29
|
-
nextScreen: string;
|
|
30
|
-
}, void, {}>;
|
|
31
|
-
export declare const retrieveTerminalList: import("@reduxjs/toolkit").AsyncThunk<{
|
|
32
|
-
data: any;
|
|
33
|
-
}, void, {}>;
|
|
34
|
-
interface pushNotificationLinkNewTerminalParams {
|
|
35
|
-
newTerminal: boolean;
|
|
36
|
-
onSuccess: () => void;
|
|
37
|
-
onFailure?: () => void;
|
|
38
|
-
}
|
|
39
|
-
export declare const pushNotificationLinkNewTerminal: import("@reduxjs/toolkit").AsyncThunk<{
|
|
40
|
-
data: any;
|
|
41
|
-
nextScreen?: undefined;
|
|
42
|
-
linkNewTerminalData?: undefined;
|
|
43
|
-
} | {
|
|
44
|
-
data: any;
|
|
45
|
-
nextScreen: string;
|
|
46
|
-
linkNewTerminalData: any;
|
|
47
|
-
}, pushNotificationLinkNewTerminalParams, {}>;
|
|
48
|
-
export declare const unlinkTerminalDevice: import("@reduxjs/toolkit").AsyncThunk<{
|
|
49
|
-
data: any;
|
|
50
|
-
nextScreen: string;
|
|
51
|
-
}, void, {}>;
|
|
52
|
-
export declare const linkTerminalDevice: import("@reduxjs/toolkit").AsyncThunk<{
|
|
53
|
-
data: any;
|
|
54
|
-
}, void, {}>;
|
|
55
|
-
declare type RetrieveBoardProps = {
|
|
56
|
-
boardId: string;
|
|
57
|
-
individualId: string;
|
|
58
|
-
individualType: string;
|
|
59
|
-
};
|
|
60
|
-
export declare const retrieveBoardDetails: import("@reduxjs/toolkit").AsyncThunk<any, RetrieveBoardProps, {}>;
|
|
61
|
-
declare type RetrieveBoardStatusProps = {
|
|
62
|
-
boardId: string;
|
|
63
|
-
};
|
|
64
|
-
export declare const retrieveBoardStatus: import("@reduxjs/toolkit").AsyncThunk<{
|
|
65
|
-
flows: any;
|
|
66
|
-
}, RetrieveBoardStatusProps, {}>;
|
|
67
|
-
export declare const updateDeviceLinkedSuccess: import("@reduxjs/toolkit").AsyncThunk<{
|
|
68
|
-
data: any;
|
|
69
|
-
nextScreen: string;
|
|
70
|
-
}, void, {}>;
|
|
71
|
-
export declare const updateDeviceUnlinkedSuccess: import("@reduxjs/toolkit").AsyncThunk<{
|
|
72
|
-
data: any;
|
|
73
|
-
nextScreen: string;
|
|
74
|
-
}, void, {}>;
|
|
75
|
-
export declare const onCloseCompleteTerminal: import("@reduxjs/toolkit").AsyncThunk<void, void, {}>;
|
|
76
|
-
interface ResponseData {
|
|
77
|
-
responseData?: Record<string, any>;
|
|
78
|
-
}
|
|
79
|
-
declare type VerifyData = {
|
|
80
|
-
token: string;
|
|
81
|
-
};
|
|
82
|
-
export interface TerminalData {
|
|
83
|
-
flowName: FlowsTypes;
|
|
84
|
-
verify: VerifyData;
|
|
85
|
-
otpData: OTPFormValues;
|
|
86
|
-
terminalInfo: {
|
|
87
|
-
selectedTerminalDevice: TerminalDeviceInfo;
|
|
88
|
-
selectedTerminal: TerminalInfo;
|
|
89
|
-
};
|
|
90
|
-
}
|
|
91
|
-
export interface TerminalDataState extends SharedState<TerminalData & ResponseData> {
|
|
92
|
-
customLoading?: boolean;
|
|
93
|
-
terminalListLoading?: boolean;
|
|
94
|
-
}
|
|
95
|
-
export declare const terminalSlice: import("@reduxjs/toolkit").Slice<TerminalDataState, {
|
|
96
|
-
clearError: (state: TerminalDataState) => void;
|
|
97
|
-
setError(state: TerminalDataState, action: ActionState<string>): void;
|
|
98
|
-
stopLoader: (state: TerminalDataState) => void;
|
|
99
|
-
resetOTPScreen: (state: TerminalDataState) => void;
|
|
100
|
-
storeSelectedTerminalDevice: (state: TerminalDataState, action: ActionState<TerminalDeviceInfo>) => void;
|
|
101
|
-
storeSelectedTerminal: (state: TerminalDataState, action: ActionState<TerminalInfo>) => void;
|
|
102
|
-
}, "terminal/store">;
|
|
103
|
-
export declare const clearError: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>, setError: import("@reduxjs/toolkit").ActionCreatorWithPayload<string, string>, stopLoader: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>, resetOTPScreen: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>, storeSelectedTerminalDevice: import("@reduxjs/toolkit").ActionCreatorWithPayload<TerminalDeviceInfo, string>, storeSelectedTerminal: import("@reduxjs/toolkit").ActionCreatorWithPayload<TerminalInfo, string>;
|
|
104
|
-
declare const _default: import("redux").Reducer<TerminalDataState, import("redux").AnyAction>;
|
|
105
|
-
export default _default;
|
|
106
|
-
export declare const terminalSelector: (state: RootState) => TerminalDataState;
|