@tap-payments/connect 2.6.3-test → 2.6.5-test
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
CHANGED
|
@@ -85,7 +85,7 @@ const ConnectComponent = () => {
|
|
|
85
85
|
content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=no,shrink-to-fit=no"
|
|
86
86
|
/>
|
|
87
87
|
<title>Auth-JsConnect</title>
|
|
88
|
-
<script src="https://tap-sdks.b-cdn.net/connect/build-2.6.
|
|
88
|
+
<script src="https://tap-sdks.b-cdn.net/connect/build-2.6.5-test/main.js"></script>
|
|
89
89
|
</head>
|
|
90
90
|
<body>
|
|
91
91
|
<div id="root"></div>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare const CDN_LIBRARY_BASE_URL = "https://auth-jsconnect.b-cdn.net/build-2.6.
|
|
1
|
+
export declare const CDN_LIBRARY_BASE_URL = "https://auth-jsconnect.b-cdn.net/build-2.6.5-test/";
|
|
2
2
|
export declare const Maturity: {
|
|
3
3
|
readonly FULL: "full";
|
|
4
4
|
readonly EXPRESS: "express";
|
package/build/constants/index.js
CHANGED
|
@@ -87,56 +87,32 @@ export var TapConnect = React.memo(function (props) {
|
|
|
87
87
|
});
|
|
88
88
|
var tapConnectInstance = null;
|
|
89
89
|
export var renderTapConnect = function (props, elementId) { return __awaiter(void 0, void 0, void 0, function () {
|
|
90
|
-
var mode, board, publicKey, boardMaturity, domain, language, country, scope, lead, postURL, mature, onError, redirectUrl, AuthData, payload, _a, data, publicKeyValue, _b, token, redirect, baseUrl,
|
|
91
|
-
return __generator(this, function (
|
|
92
|
-
switch (
|
|
90
|
+
var mode, board, publicKey, boardMaturity, domain, language, country, scope, lead, postURL, mature, onError, redirectUrl, AuthData, payload, _a, data, publicKeyValue, _b, token, redirect, baseUrl, url_1, countryCode, url, el, root, unmount;
|
|
91
|
+
return __generator(this, function (_c) {
|
|
92
|
+
switch (_c.label) {
|
|
93
93
|
case 0:
|
|
94
94
|
mode = props.mode, board = props.board, publicKey = props.publicKey, boardMaturity = props.boardMaturity, domain = props.domain, language = props.language, country = props.country, scope = props.scope, lead = props.lead, postURL = props.postURL, mature = props.mature, onError = props.onError, redirectUrl = props.redirectUrl, AuthData = props.data;
|
|
95
|
-
if (!(
|
|
96
|
-
payload = __assign(
|
|
97
|
-
email:
|
|
98
|
-
sms:
|
|
99
|
-
} }, (postURL && {
|
|
100
|
-
post: {
|
|
95
|
+
if (!(mode === 'page')) return [3, 2];
|
|
96
|
+
payload = __assign({ board: board, public_key: publicKey, board_maturity: boardMaturity, domain: domain, language: language, country: country, scope: scope, lead_id: lead, maturity: scope === 'auth' ? false : mature, notification: {
|
|
97
|
+
email: scope !== 'auth',
|
|
98
|
+
sms: scope !== 'auth'
|
|
99
|
+
} }, (postURL && __assign(__assign({ post: {
|
|
101
100
|
url: postURL
|
|
102
|
-
}
|
|
103
|
-
})), (redirectUrl && {
|
|
101
|
+
} }, (redirectUrl && {
|
|
104
102
|
platform_redirect_url: redirectUrl
|
|
105
103
|
})), (AuthData && {
|
|
106
104
|
data: AuthData
|
|
107
|
-
}));
|
|
105
|
+
}))));
|
|
108
106
|
return [4, generateConfigToken(payload)];
|
|
109
107
|
case 1:
|
|
110
|
-
_a =
|
|
108
|
+
_a = _c.sent(), data = _a.data, publicKeyValue = _a.publicKey;
|
|
111
109
|
if (data === null || data === void 0 ? void 0 : data.error) {
|
|
112
110
|
onError === null || onError === void 0 ? void 0 : onError(data.error);
|
|
113
111
|
return [2];
|
|
114
112
|
}
|
|
115
113
|
_b = data || {}, token = _b.token, redirect = _b.redirect;
|
|
116
114
|
baseUrl = getRedirectBaseUrl(publicKeyValue || '');
|
|
117
|
-
|
|
118
|
-
window.location.href = url;
|
|
119
|
-
return [2];
|
|
120
|
-
case 2:
|
|
121
|
-
if (!(mode === 'page')) return [3, 4];
|
|
122
|
-
payload = __assign({ board: board, public_key: publicKey, board_maturity: boardMaturity, domain: domain, language: language, country: country, scope: scope, lead_id: lead, maturity: mature, notification: {
|
|
123
|
-
email: true,
|
|
124
|
-
sms: true
|
|
125
|
-
} }, (postURL && {
|
|
126
|
-
post: {
|
|
127
|
-
url: postURL
|
|
128
|
-
}
|
|
129
|
-
}));
|
|
130
|
-
return [4, generateConfigToken(payload)];
|
|
131
|
-
case 3:
|
|
132
|
-
_c = _e.sent(), data = _c.data, publicKeyValue = _c.publicKey;
|
|
133
|
-
if (data === null || data === void 0 ? void 0 : data.error) {
|
|
134
|
-
onError === null || onError === void 0 ? void 0 : onError(data.error);
|
|
135
|
-
return [2];
|
|
136
|
-
}
|
|
137
|
-
_d = data || {}, token = _d.token, redirect = _d.redirect;
|
|
138
|
-
baseUrl = getRedirectBaseUrl(publicKeyValue || '');
|
|
139
|
-
if (!mature) {
|
|
115
|
+
if (!mature || scope === 'auth') {
|
|
140
116
|
url_1 = (redirect === null || redirect === void 0 ? void 0 : redirect.url) || "".concat(baseUrl, "?config_token=").concat(token);
|
|
141
117
|
window.location.href = url_1;
|
|
142
118
|
return [2];
|
|
@@ -145,7 +121,7 @@ export var renderTapConnect = function (props, elementId) { return __awaiter(voi
|
|
|
145
121
|
url = (redirect === null || redirect === void 0 ? void 0 : redirect.url) || "".concat(baseUrl).concat(countryCode, "?config_token=").concat(token);
|
|
146
122
|
window.location.href = url;
|
|
147
123
|
return [2];
|
|
148
|
-
case
|
|
124
|
+
case 2:
|
|
149
125
|
if (tapConnectInstance) {
|
|
150
126
|
return [2, tapConnectInstance];
|
|
151
127
|
}
|
package/build/utils/config.d.ts
CHANGED
|
@@ -3,5 +3,5 @@ type ExtraProps = {
|
|
|
3
3
|
verifyToken?: string;
|
|
4
4
|
onBoardButtonClick?: (data: Record<string, string>) => void;
|
|
5
5
|
};
|
|
6
|
-
export declare const wrapLibConfig: ({ publicKey, open, language, country, scope, lead, postURL, onError, onReady, onSuccess, board, verifyToken, domain, onBoardButtonClick, onClose, onCreated, onBoardCompleted, boardMaturity }: ConnectProps & ExtraProps) => OriginalConnectProps;
|
|
6
|
+
export declare const wrapLibConfig: ({ publicKey, open, language, country, scope, lead, postURL, onError, onReady, onSuccess, board, verifyToken, domain, onBoardButtonClick, onClose, onCreated, onBoardCompleted, boardMaturity, data, redirectUrl }: ConnectProps & ExtraProps) => OriginalConnectProps;
|
|
7
7
|
export {};
|
package/build/utils/config.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export var wrapLibConfig = function (_a) {
|
|
2
|
-
var publicKey = _a.publicKey, open = _a.open, language = _a.language, country = _a.country, scope = _a.scope, lead = _a.lead, postURL = _a.postURL, onError = _a.onError, onReady = _a.onReady, onSuccess = _a.onSuccess, board = _a.board, verifyToken = _a.verifyToken, domain = _a.domain, onBoardButtonClick = _a.onBoardButtonClick, onClose = _a.onClose, onCreated = _a.onCreated, onBoardCompleted = _a.onBoardCompleted, boardMaturity = _a.boardMaturity;
|
|
2
|
+
var publicKey = _a.publicKey, open = _a.open, language = _a.language, country = _a.country, scope = _a.scope, lead = _a.lead, postURL = _a.postURL, onError = _a.onError, onReady = _a.onReady, onSuccess = _a.onSuccess, board = _a.board, verifyToken = _a.verifyToken, domain = _a.domain, onBoardButtonClick = _a.onBoardButtonClick, onClose = _a.onClose, onCreated = _a.onCreated, onBoardCompleted = _a.onBoardCompleted, boardMaturity = _a.boardMaturity, data = _a.data, redirectUrl = _a.redirectUrl;
|
|
3
3
|
return {
|
|
4
4
|
appInfo: {
|
|
5
5
|
name: window.location.hostname || window.location.origin
|
|
@@ -11,6 +11,8 @@ export var wrapLibConfig = function (_a) {
|
|
|
11
11
|
postURL: postURL,
|
|
12
12
|
publicKey: publicKey,
|
|
13
13
|
scope: scope,
|
|
14
|
+
data: data,
|
|
15
|
+
redirectUrl: redirectUrl,
|
|
14
16
|
leadId: lead,
|
|
15
17
|
showBoard: board,
|
|
16
18
|
boardMaturity: boardMaturity,
|