@tap-payments/connect 2.6.3-test → 2.6.4-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.3-test/main.js"></script>
88
+ <script src="https://tap-sdks.b-cdn.net/connect/build-2.6.4-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.3-test/";
1
+ export declare const CDN_LIBRARY_BASE_URL = "https://auth-jsconnect.b-cdn.net/build-2.6.4-test/";
2
2
  export declare const Maturity: {
3
3
  readonly FULL: "full";
4
4
  readonly EXPRESS: "express";
@@ -1,4 +1,4 @@
1
- export var CDN_LIBRARY_BASE_URL = 'https://auth-jsconnect.b-cdn.net/build-2.6.3-test/';
1
+ export var CDN_LIBRARY_BASE_URL = 'https://auth-jsconnect.b-cdn.net/build-2.6.4-test/';
2
2
  export var Maturity = {
3
3
  FULL: 'full',
4
4
  EXPRESS: 'express'
@@ -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, url, payload, _c, data, publicKeyValue, _d, token, redirect, baseUrl, url_1, countryCode, url, el, root, unmount;
91
- return __generator(this, function (_e) {
92
- switch (_e.label) {
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 (!(scope === 'auth')) return [3, 2];
96
- payload = __assign(__assign(__assign({ board: board, public_key: publicKey, board_maturity: boardMaturity, domain: domain, language: language, country: country, scope: scope, lead_id: lead, maturity: false, notification: {
97
- email: false,
98
- sms: false
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 = _e.sent(), data = _a.data, publicKeyValue = _a.publicKey;
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
- url = (redirect === null || redirect === void 0 ? void 0 : redirect.url) || "".concat(baseUrl, "?config_token=").concat(token);
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 4:
124
+ case 2:
149
125
  if (tapConnectInstance) {
150
126
  return [2, tapConnectInstance];
151
127
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tap-payments/connect",
3
- "version": "2.6.3-test",
3
+ "version": "2.6.4-test",
4
4
  "description": "Tap Connect",
5
5
  "main": "build/index.js",
6
6
  "module": "build/index.js",