acsi-core 1.2.35 → 1.2.37
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/index.d.ts +2 -4
- package/dist/index.js +7 -60
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +8 -58
- package/dist/index.modern.js.map +1 -1
- package/dist/utils/constants.d.ts +0 -1
- package/package.json +2 -3
- package/dist/utils/sanitizeHTMLText.d.ts +0 -2
- package/dist/utils/sanitizeSrc.d.ts +0 -7
package/dist/index.modern.js
CHANGED
|
@@ -29,7 +29,6 @@ import { init as init$1, replayIntegration } from '@sentry/react';
|
|
|
29
29
|
import { FaCaretDown } from 'react-icons/fa';
|
|
30
30
|
import CreatableSelect from 'react-select/creatable';
|
|
31
31
|
import moment$1 from 'moment-timezone';
|
|
32
|
-
import DOMPurify from 'dompurify';
|
|
33
32
|
|
|
34
33
|
var setLoading = createAction("common/setLoading");
|
|
35
34
|
var setLoadingPage = createAction("common/setLoadingPage");
|
|
@@ -89,7 +88,6 @@ var COLORS = {
|
|
|
89
88
|
var ORGANIZATION_TENANT = "ORGANIZATION_TENANT";
|
|
90
89
|
var ORGANIZATION_TEAM = "ORGANIZATION_TEAM";
|
|
91
90
|
var TIMEZONE_ID = "TIMEZONE_ID";
|
|
92
|
-
var UID_TENANT = "uid";
|
|
93
91
|
|
|
94
92
|
var styleGlobal = {"signup_wrap":"_1KLz9","box-signin":"_2Jo1o","signin_title":"_3egBO","signup_link":"_1DoIT","google_button":"_34hK_","microsoft_button":"_19ESb","box-field":"_2e9xO","box-input":"_3zXRp","box-text":"_8NJga","box-button-email":"_21FPk","box-signin-container":"_1QERu","box-signin-text":"_2-znH","box-signin-logo":"_1aB2m","box-right":"_3qndF","image-slideshow":"_1aM7m","active":"_Vx1zf","box-right-body":"_JzdCr","box-right-footer":"_19aCA","pr-30":"_2HB5r","width-400":"_4ehXP"};
|
|
95
93
|
|
|
@@ -1723,7 +1721,6 @@ var apiUpload = axios.create({
|
|
|
1723
1721
|
[api, apiUpload].forEach(function (i) {
|
|
1724
1722
|
return i.interceptors.request.use(function (config) {
|
|
1725
1723
|
var token = getAccessToken();
|
|
1726
|
-
var organizationTenant = localStorage.getItem(ORGANIZATION_TENANT);
|
|
1727
1724
|
if (token) {
|
|
1728
1725
|
config.headers.Authorization = "Bearer " + token;
|
|
1729
1726
|
localStorage.setItem("LAST_TIME_REQUETST", moment().utc().format("YYYY-MM-DD HH:mm:ss"));
|
|
@@ -1732,8 +1729,9 @@ var apiUpload = axios.create({
|
|
|
1732
1729
|
if (imPersonate) {
|
|
1733
1730
|
config.headers.ImPersonate = imPersonate;
|
|
1734
1731
|
}
|
|
1735
|
-
|
|
1736
|
-
|
|
1732
|
+
var tenantId = config.externalTenantId || localStorage.getItem(ORGANIZATION_TENANT);
|
|
1733
|
+
if (tenantId) {
|
|
1734
|
+
config.headers["X-TenantID"] = tenantId;
|
|
1737
1735
|
}
|
|
1738
1736
|
return config;
|
|
1739
1737
|
}, function (error) {
|
|
@@ -1744,7 +1742,10 @@ var apiUpload = axios.create({
|
|
|
1744
1742
|
return i.interceptors.response.use(function (response) {
|
|
1745
1743
|
return response;
|
|
1746
1744
|
}, function (error) {
|
|
1747
|
-
if (
|
|
1745
|
+
if (error.response.status === 401) {
|
|
1746
|
+
window.location.href = "/login";
|
|
1747
|
+
}
|
|
1748
|
+
if (error.response.status == 403) {
|
|
1748
1749
|
var hostname = window.location.hostname;
|
|
1749
1750
|
var parts = hostname.split('.');
|
|
1750
1751
|
var domain = parts.slice(-2).join('.');
|
|
@@ -1752,7 +1753,6 @@ var apiUpload = axios.create({
|
|
|
1752
1753
|
localStorage.removeItem(ORGANIZATION_TENANT);
|
|
1753
1754
|
localStorage.removeItem(TIMEZONE_ID);
|
|
1754
1755
|
localStorage.removeItem(ORGANIZATION_TEAM);
|
|
1755
|
-
localStorage.removeItem(UID_TENANT);
|
|
1756
1756
|
Cookies.remove('auth', {
|
|
1757
1757
|
path: '/',
|
|
1758
1758
|
domain: "." + domain
|
|
@@ -3625,57 +3625,7 @@ var timeSpanToUtc = (function (time, timezone, format) {
|
|
|
3625
3625
|
}
|
|
3626
3626
|
});
|
|
3627
3627
|
|
|
3628
|
-
var sanitizeSrc = function sanitizeSrc(url) {
|
|
3629
|
-
if (!url || typeof url !== 'string') {
|
|
3630
|
-
return '';
|
|
3631
|
-
}
|
|
3632
|
-
url = url.trim().replace(/[\s\n\r\t]+/g, '');
|
|
3633
|
-
if (url.length > 2048) {
|
|
3634
|
-
return '';
|
|
3635
|
-
}
|
|
3636
|
-
var dangerousProtocols = ['javascript:', 'data:text/html', 'vbscript:', 'file:', 'about:', 'blob:'];
|
|
3637
|
-
var lowerUrl = url.toLowerCase();
|
|
3638
|
-
for (var _i = 0, _dangerousProtocols = dangerousProtocols; _i < _dangerousProtocols.length; _i++) {
|
|
3639
|
-
var protocol = _dangerousProtocols[_i];
|
|
3640
|
-
if (lowerUrl.startsWith(protocol)) {
|
|
3641
|
-
return '';
|
|
3642
|
-
}
|
|
3643
|
-
}
|
|
3644
|
-
var decoded = decodeURIComponent(url);
|
|
3645
|
-
var decodedLower = decoded.toLowerCase();
|
|
3646
|
-
for (var _i2 = 0, _dangerousProtocols2 = dangerousProtocols; _i2 < _dangerousProtocols2.length; _i2++) {
|
|
3647
|
-
var _protocol = _dangerousProtocols2[_i2];
|
|
3648
|
-
if (decodedLower.includes(_protocol)) {
|
|
3649
|
-
return '';
|
|
3650
|
-
}
|
|
3651
|
-
}
|
|
3652
|
-
try {
|
|
3653
|
-
if (url.startsWith('data:')) {
|
|
3654
|
-
if (/^data:image\/(png|jpeg|jpg|gif|webp|bmp|ico);base64,[A-Za-z0-9+/]+=*$/.test(url)) {
|
|
3655
|
-
return url;
|
|
3656
|
-
}
|
|
3657
|
-
return '';
|
|
3658
|
-
}
|
|
3659
|
-
var parsed = new URL(url, window.location.origin);
|
|
3660
|
-
if (parsed.protocol !== 'http:' && parsed.protocol !== 'https:') {
|
|
3661
|
-
return '';
|
|
3662
|
-
}
|
|
3663
|
-
if (parsed.username || parsed.password) {
|
|
3664
|
-
return '';
|
|
3665
|
-
}
|
|
3666
|
-
return parsed.href;
|
|
3667
|
-
} catch (error) {
|
|
3668
|
-
return '';
|
|
3669
|
-
}
|
|
3670
|
-
};
|
|
3671
|
-
|
|
3672
|
-
var sanitizeHTMLText = function sanitizeHTMLText(text) {
|
|
3673
|
-
var _DOMPurify$sanitize;
|
|
3674
|
-
if (!text) return "";
|
|
3675
|
-
return (_DOMPurify$sanitize = DOMPurify.sanitize(text)) != null ? _DOMPurify$sanitize : "";
|
|
3676
|
-
};
|
|
3677
|
-
|
|
3678
3628
|
var historyCore = createBrowserHistory();
|
|
3679
3629
|
|
|
3680
|
-
export { ACCESS_TOKEN, AmplitudeEvent, BASE_URL, CommonDialog, ConfirmDialog, CoreButton, CoreInput$1 as CoreCheckbox, CoreError, CoreInput, CoreInputCompact, CoreModal, CoreRadio, CoreRange, CoreSearch, CoreSelect, CoreSelectCompact, CoreTextArea, CoreTitleInput, CoreTooltip, CustomAsyncSelect, CustomCreatable, CustomPagination, CustomSelect, CustomSelectOption, DATE_TIME_MIN_VALUE, LayoutContext, Loading, Login, MarkdownRenderer as MarkdownLatexRender, NotFound, OPENSALT_BASE_URL, ORGANIZATION_TEAM, ORGANIZATION_TENANT, RichContentRenderer, Role, TIMEZONE_ID,
|
|
3630
|
+
export { ACCESS_TOKEN, AmplitudeEvent, BASE_URL, CommonDialog, ConfirmDialog, CoreButton, CoreInput$1 as CoreCheckbox, CoreError, CoreInput, CoreInputCompact, CoreModal, CoreRadio, CoreRange, CoreSearch, CoreSelect, CoreSelectCompact, CoreTextArea, CoreTitleInput, CoreTooltip, CustomAsyncSelect, CustomCreatable, CustomPagination, CustomSelect, CustomSelectOption, DATE_TIME_MIN_VALUE, LayoutContext, Loading, Login, MarkdownRenderer as MarkdownLatexRender, NotFound, OPENSALT_BASE_URL, ORGANIZATION_TEAM, ORGANIZATION_TENANT, RichContentRenderer, Role, TIMEZONE_ID, api, apiUpload, firstCheckToken, getAccessToken, getErrorMessage, getImageUrl, getTimeZoneId, historyCore, initSentry, initializeAmplitude, setAddTenant, setAlert, setIsFirstCalendar, setIsRefetchSidebar, setLoading, setLoadingPage, setMenuCollapse, setTeam, setTenant, setUser, store, timeSpanToLocalMoment, timeSpanToUtc, useAmplitude, useGoogleSignOut, utcToLocalTime };
|
|
3681
3631
|
//# sourceMappingURL=index.modern.js.map
|