@klauswuestefeld/jux-web 2023.7.26 → 2023.9.18
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/dist/api-client.d.ts +1 -0
- package/dist/jux-web.js +39 -19
- package/dist/login/session.d.ts +1 -1
- package/dist/main.esm.js +39 -19
- package/dist/main.js +39 -19
- package/package.json +14 -14
- package/dist/JuxStore.d.ts +0 -4
- package/dist/i18n.d.ts +0 -2
package/dist/api-client.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
export declare const setBackendUrl: (backendUrl: string) => void;
|
|
1
2
|
export declare const getGoogleAuthUrl: () => string;
|
|
2
3
|
export declare const getMicrosoftAuthUrl: () => string;
|
|
3
4
|
export declare const backendRequest: (requestType: string, url: string, postContent: any, onJsonResponse: (response: any) => any, onHelpMessage: (message: string) => any) => void;
|
package/dist/jux-web.js
CHANGED
|
@@ -169,14 +169,9 @@ var juxWeb = (function (exports) {
|
|
|
169
169
|
return token;
|
|
170
170
|
};
|
|
171
171
|
|
|
172
|
-
var
|
|
173
|
-
var provider = localStorage.getItem('override-provider') || localStorage.getItem('provider');
|
|
174
|
-
return (provider === null || provider === void 0 ? void 0 : provider.replace(/\./g, '-')) || '';
|
|
175
|
-
};
|
|
176
|
-
//@ts-ignore
|
|
177
|
-
var getDynamicBackendUrl = function () { return process.env.DYNAMIC_BACKEND_URL ? process.env.DYNAMIC_BACKEND_URL.replace('%provider', kebabCaseProvider()) : false; };
|
|
172
|
+
var setBackendUrl = function (backendUrl) { return localStorage.setItem('backend-url', backendUrl); };
|
|
178
173
|
//@ts-ignore
|
|
179
|
-
var getBackendUrl = function () { return
|
|
174
|
+
var getBackendUrl = function () { return process.env.BACKEND_URL || localStorage.getItem('backend-url'); };
|
|
180
175
|
//@ts-ignore
|
|
181
176
|
var getSecondaryBackendUrl = function () { return process.env.STAGING_BACKEND_URL || getBackendUrl(); };
|
|
182
177
|
var getBackendUrlToTry = function () { return getBackendUrl(); };
|
|
@@ -14074,7 +14069,7 @@ var juxWeb = (function (exports) {
|
|
|
14074
14069
|
(_a = document.querySelector('#contact-us-modal')) === null || _a === void 0 ? void 0 : _a.remove();
|
|
14075
14070
|
}, function () { } // TODO: change it to be an error handling fn provided by the client
|
|
14076
14071
|
);
|
|
14077
|
-
// checkMixpanel(() => mixpanel.track(
|
|
14072
|
+
// checkMixpanel(() => mixpanel.track('Sent Contact Inquiry', {}));
|
|
14078
14073
|
};
|
|
14079
14074
|
var contactUsModal = function (subject) {
|
|
14080
14075
|
var _a, _b, _c, _d, _e;
|
|
@@ -14245,18 +14240,33 @@ var juxWeb = (function (exports) {
|
|
|
14245
14240
|
Array.from(clientApp.children).forEach(function (el) { return el.remove(); });
|
|
14246
14241
|
clientApp.appendChild(page);
|
|
14247
14242
|
};
|
|
14248
|
-
var initSession = function (clientApp, supportedLoginTypes, onUserLogin, backgroundImage) {
|
|
14243
|
+
var initSession = function (clientApp, supportedLoginTypes, onUserLogin, backgroundImage, fetchUserBackendUrl) {
|
|
14249
14244
|
// if (startNewDemo()) {
|
|
14250
14245
|
// initDemo(setBackendToken, onAuthentication);
|
|
14251
14246
|
// return;
|
|
14252
14247
|
// }
|
|
14248
|
+
// @ts-ignore
|
|
14249
|
+
if (!window.store) {
|
|
14250
|
+
// @ts-ignore
|
|
14251
|
+
window.store = {};
|
|
14252
|
+
}
|
|
14253
|
+
// @ts-ignore
|
|
14254
|
+
window.store.fetchUserBackendUrl = fetchUserBackendUrl;
|
|
14253
14255
|
var magicToken = extractTokenFromWindowLocation('magic-link');
|
|
14254
14256
|
if (magicToken) {
|
|
14257
|
+
var onOpenMagicLink_1 = function () {
|
|
14258
|
+
openMagicLink(magicToken, function (res) { return onAuthentication(onUserLogin, res, 'Magic Link'); }, function () { return onAuthenticationFailure('unable-magic-login'); });
|
|
14259
|
+
};
|
|
14255
14260
|
var host = extractTokenFromWindowLocation('host');
|
|
14256
14261
|
if (host) {
|
|
14257
|
-
|
|
14262
|
+
// @ts-ignore
|
|
14263
|
+
window.store.fetchUserBackendUrl({ host: host }, function (backendUrl) {
|
|
14264
|
+
setBackendUrl(backendUrl);
|
|
14265
|
+
onOpenMagicLink_1();
|
|
14266
|
+
});
|
|
14267
|
+
return;
|
|
14258
14268
|
}
|
|
14259
|
-
|
|
14269
|
+
onOpenMagicLink_1();
|
|
14260
14270
|
return;
|
|
14261
14271
|
}
|
|
14262
14272
|
if (getBackendToken()) {
|
|
@@ -14331,14 +14341,24 @@ var juxWeb = (function (exports) {
|
|
|
14331
14341
|
email = mailMagic.value;
|
|
14332
14342
|
}
|
|
14333
14343
|
var payload = { email: email, token: token };
|
|
14334
|
-
var
|
|
14335
|
-
|
|
14336
|
-
|
|
14337
|
-
|
|
14338
|
-
|
|
14339
|
-
|
|
14340
|
-
|
|
14341
|
-
}
|
|
14344
|
+
var onRequestMagicLink = function () {
|
|
14345
|
+
requestMagicLink(payload, function (_res) {
|
|
14346
|
+
currentPage.remove();
|
|
14347
|
+
clientBody.appendChild(magicLinkRequestedPage(backgroundImage, onReturn));
|
|
14348
|
+
var magicLinkEmail = document.querySelector('#magic-link-email');
|
|
14349
|
+
magicLinkEmail.textContent = email;
|
|
14350
|
+
});
|
|
14351
|
+
};
|
|
14352
|
+
// @ts-ignore
|
|
14353
|
+
if (window.store.fetchUserBackendUrl) {
|
|
14354
|
+
// @ts-ignore
|
|
14355
|
+
window.store.fetchUserBackendUrl({ email: email }, function (backendUrl) {
|
|
14356
|
+
setBackendUrl(backendUrl);
|
|
14357
|
+
onRequestMagicLink();
|
|
14358
|
+
});
|
|
14359
|
+
return;
|
|
14360
|
+
}
|
|
14361
|
+
onRequestMagicLink();
|
|
14342
14362
|
};
|
|
14343
14363
|
|
|
14344
14364
|
var socialLoginModal = function (userEmail, mailExchanger, token, onUserLogin, onReturn, backgroundImage, currentPage, clientBody, closeMagicLinkModal) {
|
package/dist/login/session.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export declare const setBackendToken: (token: string) => void;
|
|
2
2
|
export declare const onTokenAcquired: (token: string, onUserLogin: any) => void;
|
|
3
3
|
export declare const clearSession: () => void;
|
|
4
|
-
export declare const initSession: (clientApp: HTMLElement, supportedLoginTypes: string[], onUserLogin: any, backgroundImage: string) => void;
|
|
4
|
+
export declare const initSession: (clientApp: HTMLElement, supportedLoginTypes: string[], onUserLogin: any, backgroundImage: string, fetchUserBackendUrl: any) => void;
|
|
5
5
|
export declare const onMicrosoftSignIn: (onUserLogin: any) => Promise<void>;
|
|
6
6
|
export declare const onGoogleSignIn: (onUserLogin: any) => void;
|
|
7
7
|
export declare const handleMagicLinkRequest: (token: string | null, onReturn: any, backgroundImage: string, currentPage: HTMLElement, clientBody: HTMLElement, email?: string) => void;
|
package/dist/main.esm.js
CHANGED
|
@@ -168,14 +168,9 @@ var extractTokenFromWindowLocation = function (tokenParam, additionalParam) {
|
|
|
168
168
|
return token;
|
|
169
169
|
};
|
|
170
170
|
|
|
171
|
-
var
|
|
172
|
-
var provider = localStorage.getItem('override-provider') || localStorage.getItem('provider');
|
|
173
|
-
return (provider === null || provider === void 0 ? void 0 : provider.replace(/\./g, '-')) || '';
|
|
174
|
-
};
|
|
175
|
-
//@ts-ignore
|
|
176
|
-
var getDynamicBackendUrl = function () { return process.env.DYNAMIC_BACKEND_URL ? process.env.DYNAMIC_BACKEND_URL.replace('%provider', kebabCaseProvider()) : false; };
|
|
171
|
+
var setBackendUrl = function (backendUrl) { return localStorage.setItem('backend-url', backendUrl); };
|
|
177
172
|
//@ts-ignore
|
|
178
|
-
var getBackendUrl = function () { return
|
|
173
|
+
var getBackendUrl = function () { return process.env.BACKEND_URL || localStorage.getItem('backend-url'); };
|
|
179
174
|
//@ts-ignore
|
|
180
175
|
var getSecondaryBackendUrl = function () { return process.env.STAGING_BACKEND_URL || getBackendUrl(); };
|
|
181
176
|
var getBackendUrlToTry = function () { return getBackendUrl(); };
|
|
@@ -754,7 +749,7 @@ var sendInquiry = function (name, email, msg, whatsapp, subject, token) {
|
|
|
754
749
|
(_a = document.querySelector('#contact-us-modal')) === null || _a === void 0 ? void 0 : _a.remove();
|
|
755
750
|
}, function () { } // TODO: change it to be an error handling fn provided by the client
|
|
756
751
|
);
|
|
757
|
-
// checkMixpanel(() => mixpanel.track(
|
|
752
|
+
// checkMixpanel(() => mixpanel.track('Sent Contact Inquiry', {}));
|
|
758
753
|
};
|
|
759
754
|
var contactUsModal = function (subject) {
|
|
760
755
|
var _a, _b, _c, _d, _e;
|
|
@@ -925,18 +920,33 @@ var displayPage = function (clientApp, page) {
|
|
|
925
920
|
Array.from(clientApp.children).forEach(function (el) { return el.remove(); });
|
|
926
921
|
clientApp.appendChild(page);
|
|
927
922
|
};
|
|
928
|
-
var initSession = function (clientApp, supportedLoginTypes, onUserLogin, backgroundImage) {
|
|
923
|
+
var initSession = function (clientApp, supportedLoginTypes, onUserLogin, backgroundImage, fetchUserBackendUrl) {
|
|
929
924
|
// if (startNewDemo()) {
|
|
930
925
|
// initDemo(setBackendToken, onAuthentication);
|
|
931
926
|
// return;
|
|
932
927
|
// }
|
|
928
|
+
// @ts-ignore
|
|
929
|
+
if (!window.store) {
|
|
930
|
+
// @ts-ignore
|
|
931
|
+
window.store = {};
|
|
932
|
+
}
|
|
933
|
+
// @ts-ignore
|
|
934
|
+
window.store.fetchUserBackendUrl = fetchUserBackendUrl;
|
|
933
935
|
var magicToken = extractTokenFromWindowLocation('magic-link');
|
|
934
936
|
if (magicToken) {
|
|
937
|
+
var onOpenMagicLink_1 = function () {
|
|
938
|
+
openMagicLink(magicToken, function (res) { return onAuthentication(onUserLogin, res, 'Magic Link'); }, function () { return onAuthenticationFailure('unable-magic-login'); });
|
|
939
|
+
};
|
|
935
940
|
var host = extractTokenFromWindowLocation('host');
|
|
936
941
|
if (host) {
|
|
937
|
-
|
|
942
|
+
// @ts-ignore
|
|
943
|
+
window.store.fetchUserBackendUrl({ host: host }, function (backendUrl) {
|
|
944
|
+
setBackendUrl(backendUrl);
|
|
945
|
+
onOpenMagicLink_1();
|
|
946
|
+
});
|
|
947
|
+
return;
|
|
938
948
|
}
|
|
939
|
-
|
|
949
|
+
onOpenMagicLink_1();
|
|
940
950
|
return;
|
|
941
951
|
}
|
|
942
952
|
if (getBackendToken()) {
|
|
@@ -1011,14 +1021,24 @@ var handleMagicLinkRequest = function (token, onReturn, backgroundImage, current
|
|
|
1011
1021
|
email = mailMagic.value;
|
|
1012
1022
|
}
|
|
1013
1023
|
var payload = { email: email, token: token };
|
|
1014
|
-
var
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
}
|
|
1024
|
+
var onRequestMagicLink = function () {
|
|
1025
|
+
requestMagicLink(payload, function (_res) {
|
|
1026
|
+
currentPage.remove();
|
|
1027
|
+
clientBody.appendChild(magicLinkRequestedPage(backgroundImage, onReturn));
|
|
1028
|
+
var magicLinkEmail = document.querySelector('#magic-link-email');
|
|
1029
|
+
magicLinkEmail.textContent = email;
|
|
1030
|
+
});
|
|
1031
|
+
};
|
|
1032
|
+
// @ts-ignore
|
|
1033
|
+
if (window.store.fetchUserBackendUrl) {
|
|
1034
|
+
// @ts-ignore
|
|
1035
|
+
window.store.fetchUserBackendUrl({ email: email }, function (backendUrl) {
|
|
1036
|
+
setBackendUrl(backendUrl);
|
|
1037
|
+
onRequestMagicLink();
|
|
1038
|
+
});
|
|
1039
|
+
return;
|
|
1040
|
+
}
|
|
1041
|
+
onRequestMagicLink();
|
|
1022
1042
|
};
|
|
1023
1043
|
|
|
1024
1044
|
var socialLoginModal = function (userEmail, mailExchanger, token, onUserLogin, onReturn, backgroundImage, currentPage, clientBody, closeMagicLinkModal) {
|
package/dist/main.js
CHANGED
|
@@ -192,14 +192,9 @@ var extractTokenFromWindowLocation = function (tokenParam, additionalParam) {
|
|
|
192
192
|
return token;
|
|
193
193
|
};
|
|
194
194
|
|
|
195
|
-
var
|
|
196
|
-
var provider = localStorage.getItem('override-provider') || localStorage.getItem('provider');
|
|
197
|
-
return (provider === null || provider === void 0 ? void 0 : provider.replace(/\./g, '-')) || '';
|
|
198
|
-
};
|
|
199
|
-
//@ts-ignore
|
|
200
|
-
var getDynamicBackendUrl = function () { return process.env.DYNAMIC_BACKEND_URL ? process.env.DYNAMIC_BACKEND_URL.replace('%provider', kebabCaseProvider()) : false; };
|
|
195
|
+
var setBackendUrl = function (backendUrl) { return localStorage.setItem('backend-url', backendUrl); };
|
|
201
196
|
//@ts-ignore
|
|
202
|
-
var getBackendUrl = function () { return
|
|
197
|
+
var getBackendUrl = function () { return process.env.BACKEND_URL || localStorage.getItem('backend-url'); };
|
|
203
198
|
//@ts-ignore
|
|
204
199
|
var getSecondaryBackendUrl = function () { return process.env.STAGING_BACKEND_URL || getBackendUrl(); };
|
|
205
200
|
var getBackendUrlToTry = function () { return getBackendUrl(); };
|
|
@@ -778,7 +773,7 @@ var sendInquiry = function (name, email, msg, whatsapp, subject, token) {
|
|
|
778
773
|
(_a = document.querySelector('#contact-us-modal')) === null || _a === void 0 ? void 0 : _a.remove();
|
|
779
774
|
}, function () { } // TODO: change it to be an error handling fn provided by the client
|
|
780
775
|
);
|
|
781
|
-
// checkMixpanel(() => mixpanel.track(
|
|
776
|
+
// checkMixpanel(() => mixpanel.track('Sent Contact Inquiry', {}));
|
|
782
777
|
};
|
|
783
778
|
var contactUsModal = function (subject) {
|
|
784
779
|
var _a, _b, _c, _d, _e;
|
|
@@ -949,18 +944,33 @@ var displayPage = function (clientApp, page) {
|
|
|
949
944
|
Array.from(clientApp.children).forEach(function (el) { return el.remove(); });
|
|
950
945
|
clientApp.appendChild(page);
|
|
951
946
|
};
|
|
952
|
-
var initSession = function (clientApp, supportedLoginTypes, onUserLogin, backgroundImage) {
|
|
947
|
+
var initSession = function (clientApp, supportedLoginTypes, onUserLogin, backgroundImage, fetchUserBackendUrl) {
|
|
953
948
|
// if (startNewDemo()) {
|
|
954
949
|
// initDemo(setBackendToken, onAuthentication);
|
|
955
950
|
// return;
|
|
956
951
|
// }
|
|
952
|
+
// @ts-ignore
|
|
953
|
+
if (!window.store) {
|
|
954
|
+
// @ts-ignore
|
|
955
|
+
window.store = {};
|
|
956
|
+
}
|
|
957
|
+
// @ts-ignore
|
|
958
|
+
window.store.fetchUserBackendUrl = fetchUserBackendUrl;
|
|
957
959
|
var magicToken = extractTokenFromWindowLocation('magic-link');
|
|
958
960
|
if (magicToken) {
|
|
961
|
+
var onOpenMagicLink_1 = function () {
|
|
962
|
+
openMagicLink(magicToken, function (res) { return onAuthentication(onUserLogin, res, 'Magic Link'); }, function () { return onAuthenticationFailure('unable-magic-login'); });
|
|
963
|
+
};
|
|
959
964
|
var host = extractTokenFromWindowLocation('host');
|
|
960
965
|
if (host) {
|
|
961
|
-
|
|
966
|
+
// @ts-ignore
|
|
967
|
+
window.store.fetchUserBackendUrl({ host: host }, function (backendUrl) {
|
|
968
|
+
setBackendUrl(backendUrl);
|
|
969
|
+
onOpenMagicLink_1();
|
|
970
|
+
});
|
|
971
|
+
return;
|
|
962
972
|
}
|
|
963
|
-
|
|
973
|
+
onOpenMagicLink_1();
|
|
964
974
|
return;
|
|
965
975
|
}
|
|
966
976
|
if (getBackendToken()) {
|
|
@@ -1035,14 +1045,24 @@ var handleMagicLinkRequest = function (token, onReturn, backgroundImage, current
|
|
|
1035
1045
|
email = mailMagic.value;
|
|
1036
1046
|
}
|
|
1037
1047
|
var payload = { email: email, token: token };
|
|
1038
|
-
var
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
}
|
|
1048
|
+
var onRequestMagicLink = function () {
|
|
1049
|
+
requestMagicLink(payload, function (_res) {
|
|
1050
|
+
currentPage.remove();
|
|
1051
|
+
clientBody.appendChild(magicLinkRequestedPage(backgroundImage, onReturn));
|
|
1052
|
+
var magicLinkEmail = document.querySelector('#magic-link-email');
|
|
1053
|
+
magicLinkEmail.textContent = email;
|
|
1054
|
+
});
|
|
1055
|
+
};
|
|
1056
|
+
// @ts-ignore
|
|
1057
|
+
if (window.store.fetchUserBackendUrl) {
|
|
1058
|
+
// @ts-ignore
|
|
1059
|
+
window.store.fetchUserBackendUrl({ email: email }, function (backendUrl) {
|
|
1060
|
+
setBackendUrl(backendUrl);
|
|
1061
|
+
onRequestMagicLink();
|
|
1062
|
+
});
|
|
1063
|
+
return;
|
|
1064
|
+
}
|
|
1065
|
+
onRequestMagicLink();
|
|
1046
1066
|
};
|
|
1047
1067
|
|
|
1048
1068
|
var socialLoginModal = function (userEmail, mailExchanger, token, onUserLogin, onReturn, backgroundImage, currentPage, clientBody, closeMagicLinkModal) {
|
package/package.json
CHANGED
|
@@ -1,7 +1,20 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@klauswuestefeld/jux-web",
|
|
3
|
-
"version": "2023.
|
|
3
|
+
"version": "2023.09.18",
|
|
4
|
+
"author": "Jux.House",
|
|
5
|
+
"license": "Copyrighted",
|
|
4
6
|
"description": "",
|
|
7
|
+
"repository": {
|
|
8
|
+
"type": "git",
|
|
9
|
+
"url": "git+https://github.com/klauswuestefeld/jux-web.git"
|
|
10
|
+
},
|
|
11
|
+
"homepage": "https://github.com/klauswuestefeld/jux-web#readme",
|
|
12
|
+
"bugs": {
|
|
13
|
+
"url": "https://github.com/klauswuestefeld/jux-web/issues"
|
|
14
|
+
},
|
|
15
|
+
"dependencies": {
|
|
16
|
+
"@azure/msal-browser": "2.21.0"
|
|
17
|
+
},
|
|
5
18
|
"main": "dist/main.esm.js",
|
|
6
19
|
"types": "dist/main.d.ts",
|
|
7
20
|
"files": [
|
|
@@ -12,19 +25,6 @@
|
|
|
12
25
|
"test": "echo \"Error: no test specified\" && exit 1",
|
|
13
26
|
"build": "rollup -c"
|
|
14
27
|
},
|
|
15
|
-
"dependencies": {
|
|
16
|
-
"@azure/msal-browser": "2.21.0"
|
|
17
|
-
},
|
|
18
|
-
"repository": {
|
|
19
|
-
"type": "git",
|
|
20
|
-
"url": "git+https://github.com/klauswuestefeld/jux-web.git"
|
|
21
|
-
},
|
|
22
|
-
"author": "",
|
|
23
|
-
"license": "ISC",
|
|
24
|
-
"bugs": {
|
|
25
|
-
"url": "https://github.com/klauswuestefeld/jux-web/issues"
|
|
26
|
-
},
|
|
27
|
-
"homepage": "https://github.com/klauswuestefeld/jux-web#readme",
|
|
28
28
|
"devDependencies": {
|
|
29
29
|
"rollup": "^2.79.1",
|
|
30
30
|
"rollup-plugin-commonjs": "^10.1.0",
|
package/dist/JuxStore.d.ts
DELETED
package/dist/i18n.d.ts
DELETED