@bigbinary/neeto-commons-frontend 4.13.25 → 4.13.27
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/cjs/initializers/axiosInitializer/index.js +20 -0
- package/dist/cjs/initializers/axiosInitializer/index.js.map +1 -1
- package/dist/cjs/react-utils/HoneybadgerErrorBoundary/constants.js +1 -1
- package/dist/cjs/react-utils/HoneybadgerErrorBoundary/constants.js.map +1 -1
- package/dist/cjs/react-utils/useDisplayErrorPage/useDisplayErrorPage.js +2 -1
- package/dist/cjs/react-utils/useDisplayErrorPage/useDisplayErrorPage.js.map +1 -1
- package/dist/initializers/axiosInitializer/index.js +20 -0
- package/dist/initializers/axiosInitializer/index.js.map +1 -1
- package/dist/react-utils/HoneybadgerErrorBoundary/constants.js +1 -1
- package/dist/react-utils/HoneybadgerErrorBoundary/constants.js.map +1 -1
- package/dist/react-utils/useDisplayErrorPage/useDisplayErrorPage.js +2 -1
- package/dist/react-utils/useDisplayErrorPage/useDisplayErrorPage.js.map +1 -1
- package/initializers.d.ts +2 -0
- package/package.json +1 -1
- package/react-utils.d.ts +1 -0
|
@@ -73,6 +73,7 @@ var showSuccessToastr = function showSuccessToastr(response) {
|
|
|
73
73
|
showThumbsUpToastr: true
|
|
74
74
|
}, response.data)) {
|
|
75
75
|
// @ts-ignore
|
|
76
|
+
// eslint-disable-next-line @bigbinary/neeto/use-show-thumbs-up-toastr
|
|
76
77
|
Toastr.success("", {
|
|
77
78
|
icon: "👍",
|
|
78
79
|
className: "w-20"
|
|
@@ -81,6 +82,7 @@ var showSuccessToastr = function showSuccessToastr(response) {
|
|
|
81
82
|
noticeCode: "thumbs_up"
|
|
82
83
|
}, response.data)) {
|
|
83
84
|
// @ts-ignore
|
|
85
|
+
// eslint-disable-next-line @bigbinary/neeto/use-show-thumbs-up-toastr
|
|
84
86
|
Toastr.success("", {
|
|
85
87
|
icon: "👍",
|
|
86
88
|
className: "w-20"
|
|
@@ -95,10 +97,25 @@ var pullDataFromResponse = function pullDataFromResponse(response) {
|
|
|
95
97
|
includeMetadataInResponse = _response$config$incl === void 0 ? false : _response$config$incl;
|
|
96
98
|
return includeMetadataInResponse ? response : response.data;
|
|
97
99
|
};
|
|
100
|
+
var checkForReleaseVersionMismatch = function checkForReleaseVersionMismatch(response) {
|
|
101
|
+
var _res$headers, _globalProps;
|
|
102
|
+
var res = (response === null || response === void 0 ? void 0 : response.response) || response;
|
|
103
|
+
var newReleaseVersion = Number(res === null || res === void 0 || (_res$headers = res.headers) === null || _res$headers === void 0 ? void 0 : _res$headers["x-deploy-release-version"]);
|
|
104
|
+
var currentReleaseVersion = Number((_globalProps = globalProps) === null || _globalProps === void 0 ? void 0 : _globalProps.deployReleaseVersion);
|
|
105
|
+
if (newReleaseVersion && currentReleaseVersion && newReleaseVersion !== currentReleaseVersion) {
|
|
106
|
+
reactUtils_useDisplayErrorPage_useDisplayErrorPage.useErrorDisplayStore.setState({
|
|
107
|
+
showRefreshRibbon: true
|
|
108
|
+
});
|
|
109
|
+
}
|
|
110
|
+
return response;
|
|
111
|
+
};
|
|
98
112
|
var buildSuccessResponseHandler = function buildSuccessResponseHandler(skip) {
|
|
99
113
|
var interceptors = [];
|
|
100
114
|
if (!(skip !== null && skip !== void 0 && skip.transformCase)) interceptors.push(transformResponseKeysToCamelCase);
|
|
101
115
|
if (!(skip !== null && skip !== void 0 && skip.showToastr)) interceptors.push(showSuccessToastr);
|
|
116
|
+
if (!(skip !== null && skip !== void 0 && skip.checkForReleaseVersionMismatch)) {
|
|
117
|
+
interceptors.push(checkForReleaseVersionMismatch);
|
|
118
|
+
}
|
|
102
119
|
if (!(skip !== null && skip !== void 0 && skip.pullDataFromResponse)) interceptors.push(pullDataFromResponse);
|
|
103
120
|
return createPipe(interceptors);
|
|
104
121
|
};
|
|
@@ -229,6 +246,9 @@ var buildErrorResponseHandler = function buildErrorResponseHandler(skip) {
|
|
|
229
246
|
if (!(skip !== null && skip !== void 0 && skip.show404ErrorPage)) interceptors.push(handle404ErrorResponse);
|
|
230
247
|
if (!(skip !== null && skip !== void 0 && skip.logoutOn401)) interceptors.push(handleUnauthorizedErrorResponse);
|
|
231
248
|
if (!(skip !== null && skip !== void 0 && skip.showToastr)) interceptors.push(showErrorToastr);
|
|
249
|
+
if (!(skip !== null && skip !== void 0 && skip.checkForReleaseVersionMismatch)) {
|
|
250
|
+
interceptors.push(checkForReleaseVersionMismatch);
|
|
251
|
+
}
|
|
232
252
|
interceptors.push(Promise.reject.bind(Promise));
|
|
233
253
|
return createPipe(interceptors);
|
|
234
254
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../../src/initializers/axiosInitializer/index.js"],"sourcesContent":["import axios from \"axios\";\nimport i18next from \"i18next\";\nimport {\n isNotEmpty,\n keysToCamelCase,\n matches,\n serializeKeysToSnakeCase,\n} from \"neetocist\";\nimport { Toastr } from \"neetoui\";\nimport { dissoc, evolve, omit } from \"ramda\";\nimport { toast } from \"react-toastify\";\nimport { useErrorDisplayStore } from \"react-utils/useDisplayErrorPage\";\nimport { resetAuthTokens } from \"utils/axios\";\n\nimport setParamsSerializer from \"./paramsSerializer\";\n\nimport { HEADERS_KEYS, MAXIMUM_OFFLINE_DURATION } from \"../constants\";\n\nlet checkOnlineInterval = null;\nlet requestErrorToasts = {};\n\nconst shouldNot = skip => typeof skip === \"object\" || !skip;\n\nconst shouldShowToastr = response =>\n (typeof response === \"string\" && isNotEmpty(response)) ||\n (typeof response === \"object\" && (response?.notice || response?.noticeCode));\n\nconst setAuthHeaders = () => {\n // @ts-ignore\n axios.defaults.headers = {\n [HEADERS_KEYS.accept]: \"application/json\",\n [HEADERS_KEYS.contentType]: \"application/json\",\n [HEADERS_KEYS.xCsrfToken]: document\n .querySelector('[name=\"csrf-token\"]')\n ?.getAttribute(\"content\"),\n };\n};\n\n// pipe function from ramda doesn't accept array of functions.\n// We can't use spread operator too. So this is a workaround.\nconst createPipe = functions => data =>\n functions.reduce((acc, fn) => fn(acc), data);\n\nconst transformResponseKeysToCamelCase = response => {\n const { transformResponseCase = true } = response.config;\n\n if (response.data && transformResponseCase) {\n response.data = keysToCamelCase(response.data);\n }\n\n return response;\n};\n\nconst transformErrorKeysToCamelCase = error => {\n const { transformResponseCase = true } = error.config ?? {};\n\n if (error.response?.data && transformResponseCase) {\n error.response.data = keysToCamelCase(error.response.data);\n }\n\n return error;\n};\n\nconst showSuccessToastr = response => {\n const {\n showToastr = true,\n url: requestUrl,\n method: requestMethod,\n } = response.config;\n if (!showToastr) return response;\n\n const toastIdKey = `${requestMethod}:${requestUrl}`;\n const errorToastId = requestErrorToasts[toastIdKey];\n if (errorToastId) {\n toast.dismiss(errorToastId);\n requestErrorToasts = dissoc(toastIdKey, requestErrorToasts);\n }\n\n if (matches({ showThumbsUpToastr: true }, response.data)) {\n // @ts-ignore\n Toastr.success(\"\", { icon: \"👍\", className: \"w-20\" });\n } else if (matches({ noticeCode: \"thumbs_up\" }, response.data)) {\n // @ts-ignore\n Toastr.success(\"\", { icon: \"👍\", className: \"w-20\" });\n } else if (shouldShowToastr(response.data)) {\n Toastr.success(response.data);\n }\n\n return response;\n};\n\nconst pullDataFromResponse = response => {\n const { includeMetadataInResponse = false } = response.config;\n\n return includeMetadataInResponse ? response : response.data;\n};\n\nconst buildSuccessResponseHandler = skip => {\n const interceptors = [];\n if (!skip?.transformCase) interceptors.push(transformResponseKeysToCamelCase);\n\n if (!skip?.showToastr) interceptors.push(showSuccessToastr);\n\n if (!skip?.pullDataFromResponse) interceptors.push(pullDataFromResponse);\n\n return createPipe(interceptors);\n};\n\nconst handleUnauthorizedErrorResponse = error => {\n if (error.response?.status !== 401) return error;\n\n resetAuthTokens();\n\n const { redirectOnError = true } = error.config ?? {};\n if (redirectOnError) {\n setTimeout(() => {\n const redirectTo =\n window.location.pathname === \"/login\"\n ? \"/login\"\n : `/login?redirect_uri=${encodeURIComponent(window.location.href)}`;\n\n // eslint-disable-next-line xss/no-location-href-assign\n window.location.href = redirectTo;\n }, 300);\n }\n\n return error;\n};\n\nconst isOnline = () => window.navigator.onLine;\n\nconst showOfflineToastr = () => {\n const toastId = Toastr.error(\n i18next.t(\"neetoCommons.toastr.error.networkError\")\n );\n\n if (toastId) {\n const dismissToastInterval = setInterval(() => {\n if (!isOnline()) return;\n\n toast.dismiss(toastId);\n clearInterval(dismissToastInterval);\n checkOnlineInterval = null;\n }, 1000);\n }\n};\n\nconst handleNetworkError = error => {\n if (checkOnlineInterval) return error;\n\n const startTime = Date.now();\n\n checkOnlineInterval = setInterval(() => {\n const elapsedTime = Date.now() - startTime;\n\n if (isOnline()) {\n clearInterval(checkOnlineInterval);\n checkOnlineInterval = null;\n } else if (elapsedTime >= MAXIMUM_OFFLINE_DURATION) {\n clearInterval(checkOnlineInterval);\n showOfflineToastr();\n }\n }, 1000);\n\n return error;\n};\n\nconst showErrorToastr = error => {\n const {\n showToastr = true,\n show422ErrorToastr = true,\n url: requestUrl = \"\",\n method: requestMethod = \"\",\n } = error.config ?? {};\n const { status } = error.response ?? {};\n\n if (!showToastr) return error;\n\n if (error.message === \"Network Error\") return handleNetworkError(error);\n\n if (error.code === \"ECONNABORTED\") {\n return error;\n }\n\n let shouldShowToastr = false,\n toastrContent = error;\n\n const skippedStatusCodes = [403, 404, 520, 422];\n if (!skippedStatusCodes.includes(status) && !axios.isCancel(error)) {\n // we already display a page in case of 403 & 404 and we don't want to show a toastr for cancelled requests.\n // We handle cloudflare error differently for production and other environments.\n shouldShowToastr = true;\n }\n\n if (status === 422 && show422ErrorToastr) shouldShowToastr = true;\n\n if (status === 520) {\n shouldShowToastr = true;\n if (globalProps.railsEnv === \"production\") {\n toastrContent = i18next.t(\"generic.error\");\n }\n }\n\n const toastIdKey = `${requestMethod}:${requestUrl}`;\n const errorToastId = requestErrorToasts[toastIdKey];\n if (errorToastId) toast.dismiss(errorToastId);\n\n if (shouldShowToastr) {\n if (errorToastId) {\n // if there's an existing toastr with the same message, the onClose callback in the neetoUI which\n // removes the toastr from the unique list will be fired only after the toast is completely removed\n // from the UI. If there's no delay, the new toastr will be considered as duplicate and ignored.\n setTimeout(() => {\n requestErrorToasts[toastIdKey] = Toastr.error(toastrContent);\n }, 1200);\n } else requestErrorToasts[toastIdKey] = Toastr.error(toastrContent);\n }\n\n return error;\n};\n\nconst getUrlPathName = url => {\n try {\n return new URL(url).pathname;\n } catch {\n return url;\n }\n};\n\nconst handle404ErrorResponse = error => {\n const { show404ErrorPage = true, show403ErrorPage = true } =\n error.config ?? {};\n\n const status = error.response?.status;\n if (\n (status === 404 && show404ErrorPage) ||\n (status === 403 && show403ErrorPage)\n ) {\n const fullUrl = error.request?.responseURL || error.config.url;\n useErrorDisplayStore.setState({\n showErrorPage: true,\n statusCode: status,\n failedApiUrl: fullUrl,\n failedApiPath: getUrlPathName(fullUrl),\n });\n }\n\n return error;\n};\n\nconst buildErrorResponseHandler = skip => {\n const interceptors = [];\n if (!skip?.transformCase) interceptors.push(transformErrorKeysToCamelCase);\n\n if (!skip?.show404ErrorPage) interceptors.push(handle404ErrorResponse);\n\n if (!skip?.logoutOn401) interceptors.push(handleUnauthorizedErrorResponse);\n\n if (!skip?.showToastr) interceptors.push(showErrorToastr);\n\n interceptors.push(Promise.reject.bind(Promise));\n\n return createPipe(interceptors);\n};\n\nconst cleanupCredentialsForCrossOrigin = request => {\n if (!request.url.includes(\"://\")) return request;\n\n if (request.url.includes(window.location.hostname)) return request;\n\n return evolve({ headers: omit([HEADERS_KEYS.xCsrfToken]) })(request);\n};\n\nconst transformDataToSnakeCase = request => {\n const { transformRequestCase = true } = request;\n\n if (!transformRequestCase) return request;\n\n return evolve(\n { data: serializeKeysToSnakeCase, params: serializeKeysToSnakeCase },\n request\n );\n};\n\nconst addRequestInterceptors = skip => {\n if (!skip?.cleanCredentialsForCrossOrigin) {\n axios.interceptors.request.use(cleanupCredentialsForCrossOrigin);\n }\n\n if (!skip?.transformCase) {\n axios.interceptors.request.use(transformDataToSnakeCase);\n }\n};\n\nconst addResponseInterceptors = skip => {\n axios.interceptors.response.use(\n buildSuccessResponseHandler(skip),\n buildErrorResponseHandler(skip)\n );\n};\n\nconst registerIntercepts = skip => {\n if (shouldNot(skip?.request)) addRequestInterceptors(skip?.request);\n\n if (shouldNot(skip?.response)) addResponseInterceptors(skip?.response);\n};\n\nexport default function initializeAxios(skip) {\n if (!skip?.baseURL) axios.defaults.baseURL = \"/\";\n\n if (!skip?.authHeaders) setAuthHeaders();\n\n if (!skip?.paramsSerializer) setParamsSerializer();\n\n if (shouldNot(skip?.interceptors)) registerIntercepts(skip?.interceptors);\n}\n"],"names":["checkOnlineInterval","requestErrorToasts","shouldNot","skip","_typeof","shouldShowToastr","response","isNotEmpty","notice","noticeCode","setAuthHeaders","_document$querySelect","axios","defaults","headers","_defineProperty","HEADERS_KEYS","accept","contentType","xCsrfToken","document","querySelector","getAttribute","createPipe","functions","data","reduce","acc","fn","transformResponseKeysToCamelCase","_response$config$tran","config","transformResponseCase","keysToCamelCase","transformErrorKeysToCamelCase","error","_error$config","_error$response","_ref","_ref$transformRespons","showSuccessToastr","_response$config","_response$config$show","showToastr","requestUrl","url","requestMethod","method","toastIdKey","concat","errorToastId","toast","dismiss","dissoc","matches","showThumbsUpToastr","Toastr","success","icon","className","pullDataFromResponse","_response$config$incl","includeMetadataInResponse","buildSuccessResponseHandler","interceptors","transformCase","push","handleUnauthorizedErrorResponse","_error$response2","_error$config2","status","resetAuthTokens","_ref2","_ref2$redirectOnError","redirectOnError","setTimeout","redirectTo","window","location","pathname","encodeURIComponent","href","isOnline","navigator","onLine","showOfflineToastr","toastId","i18next","t","dismissToastInterval","setInterval","clearInterval","handleNetworkError","startTime","Date","now","elapsedTime","MAXIMUM_OFFLINE_DURATION","showErrorToastr","_error$config3","_error$response3","_ref3","_ref3$showToastr","_ref3$show422ErrorToa","show422ErrorToastr","_ref3$url","_ref3$method","_ref4","message","code","toastrContent","skippedStatusCodes","includes","isCancel","globalProps","railsEnv","getUrlPathName","URL","_unused","handle404ErrorResponse","_error$config4","_error$response4","_ref5","_ref5$show404ErrorPag","show404ErrorPage","_ref5$show403ErrorPag","show403ErrorPage","_error$request","fullUrl","request","responseURL","useErrorDisplayStore","setState","showErrorPage","statusCode","failedApiUrl","failedApiPath","buildErrorResponseHandler","logoutOn401","Promise","reject","bind","cleanupCredentialsForCrossOrigin","hostname","evolve","omit","transformDataToSnakeCase","_request$transformReq","transformRequestCase","serializeKeysToSnakeCase","params","addRequestInterceptors","cleanCredentialsForCrossOrigin","use","addResponseInterceptors","registerIntercepts","initializeAxios","baseURL","authHeaders","paramsSerializer","setParamsSerializer"],"mappings":";;;;;;;;;;;;;;;;;AAkBA,IAAIA,mBAAmB,GAAG,IAAI,CAAA;AAC9B,IAAIC,kBAAkB,GAAG,EAAE,CAAA;AAE3B,IAAMC,SAAS,GAAG,SAAZA,SAASA,CAAGC,IAAI,EAAA;AAAA,EAAA,OAAIC,eAAA,CAAOD,IAAI,MAAK,QAAQ,IAAI,CAACA,IAAI,CAAA;AAAA,CAAA,CAAA;AAE3D,IAAME,gBAAgB,GAAG,SAAnBA,gBAAgBA,CAAGC,QAAQ,EAAA;AAAA,EAAA,OAC9B,OAAOA,QAAQ,KAAK,QAAQ,IAAIC,oBAAU,CAACD,QAAQ,CAAC,IACpDF,eAAA,CAAOE,QAAQ,MAAK,QAAQ,KAAK,CAAAA,QAAQ,KAARA,IAAAA,IAAAA,QAAQ,KAARA,KAAAA,CAAAA,GAAAA,KAAAA,CAAAA,GAAAA,QAAQ,CAAEE,MAAM,MAAIF,QAAQ,KAAA,IAAA,IAARA,QAAQ,KAAA,KAAA,CAAA,GAAA,KAAA,CAAA,GAARA,QAAQ,CAAEG,UAAU,CAAE,CAAA,CAAA;AAAA,CAAA,CAAA;AAE9E,IAAMC,cAAc,GAAG,SAAjBA,cAAcA,GAAS;AAAA,EAAA,IAAAC,qBAAA,CAAA;AAC3B;EACAC,KAAK,CAACC,QAAQ,CAACC,OAAO,GAAAC,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EAAE;AAC5C,EAAA,IAAI,EAACA,IAAI,KAAJA,IAAAA,IAAAA,IAAI,eAAJA,IAAI,CAAE0J,OAAO,CAAA,EAAEjJ,KAAK,CAACC,QAAQ,CAACgJ,OAAO,GAAG,GAAG,CAAA;EAEhD,IAAI,EAAC1J,IAAI,KAAA,IAAA,IAAJA,IAAI,KAAA,KAAA,CAAA,IAAJA,IAAI,CAAE2J,WAAW,CAAA,EAAEpJ,cAAc,EAAE,CAAA;EAExC,IAAI,EAACP,IAAI,KAAA,IAAA,IAAJA,IAAI,KAAA,KAAA,CAAA,IAAJA,IAAI,CAAE4J,gBAAgB,CAAA,EAAEC,8CAAmB,EAAE,CAAA;EAElD,IAAI9J,SAAS,CAACC,IAAI,KAAA,IAAA,IAAJA,IAAI,KAAJA,KAAAA,CAAAA,GAAAA,KAAAA,CAAAA,GAAAA,IAAI,CAAE6D,YAAY,CAAC,EAAE2F,kBAAkB,CAACxJ,IAAI,KAAJA,IAAAA,IAAAA,IAAI,uBAAJA,IAAI,CAAE6D,YAAY,CAAC,CAAA;AAC3E;;;;"}
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../src/initializers/axiosInitializer/index.js"],"sourcesContent":["import axios from \"axios\";\nimport i18next from \"i18next\";\nimport {\n isNotEmpty,\n keysToCamelCase,\n matches,\n serializeKeysToSnakeCase,\n} from \"neetocist\";\nimport { Toastr } from \"neetoui\";\nimport { dissoc, evolve, omit } from \"ramda\";\nimport { toast } from \"react-toastify\";\nimport { useErrorDisplayStore } from \"react-utils/useDisplayErrorPage\";\nimport { resetAuthTokens } from \"utils/axios\";\n\nimport setParamsSerializer from \"./paramsSerializer\";\n\nimport { HEADERS_KEYS, MAXIMUM_OFFLINE_DURATION } from \"../constants\";\n\nlet checkOnlineInterval = null;\nlet requestErrorToasts = {};\n\nconst shouldNot = skip => typeof skip === \"object\" || !skip;\n\nconst shouldShowToastr = response =>\n (typeof response === \"string\" && isNotEmpty(response)) ||\n (typeof response === \"object\" && (response?.notice || response?.noticeCode));\n\nconst setAuthHeaders = () => {\n // @ts-ignore\n axios.defaults.headers = {\n [HEADERS_KEYS.accept]: \"application/json\",\n [HEADERS_KEYS.contentType]: \"application/json\",\n [HEADERS_KEYS.xCsrfToken]: document\n .querySelector('[name=\"csrf-token\"]')\n ?.getAttribute(\"content\"),\n };\n};\n\n// pipe function from ramda doesn't accept array of functions.\n// We can't use spread operator too. So this is a workaround.\nconst createPipe = functions => data =>\n functions.reduce((acc, fn) => fn(acc), data);\n\nconst transformResponseKeysToCamelCase = response => {\n const { transformResponseCase = true } = response.config;\n\n if (response.data && transformResponseCase) {\n response.data = keysToCamelCase(response.data);\n }\n\n return response;\n};\n\nconst transformErrorKeysToCamelCase = error => {\n const { transformResponseCase = true } = error.config ?? {};\n\n if (error.response?.data && transformResponseCase) {\n error.response.data = keysToCamelCase(error.response.data);\n }\n\n return error;\n};\n\nconst showSuccessToastr = response => {\n const {\n showToastr = true,\n url: requestUrl,\n method: requestMethod,\n } = response.config;\n if (!showToastr) return response;\n\n const toastIdKey = `${requestMethod}:${requestUrl}`;\n const errorToastId = requestErrorToasts[toastIdKey];\n if (errorToastId) {\n toast.dismiss(errorToastId);\n requestErrorToasts = dissoc(toastIdKey, requestErrorToasts);\n }\n\n if (matches({ showThumbsUpToastr: true }, response.data)) {\n // @ts-ignore\n // eslint-disable-next-line @bigbinary/neeto/use-show-thumbs-up-toastr\n Toastr.success(\"\", { icon: \"👍\", className: \"w-20\" });\n } else if (matches({ noticeCode: \"thumbs_up\" }, response.data)) {\n // @ts-ignore\n // eslint-disable-next-line @bigbinary/neeto/use-show-thumbs-up-toastr\n Toastr.success(\"\", { icon: \"👍\", className: \"w-20\" });\n } else if (shouldShowToastr(response.data)) {\n Toastr.success(response.data);\n }\n\n return response;\n};\n\nconst pullDataFromResponse = response => {\n const { includeMetadataInResponse = false } = response.config;\n\n return includeMetadataInResponse ? response : response.data;\n};\n\nconst checkForReleaseVersionMismatch = response => {\n const res = response?.response || response;\n const newReleaseVersion = Number(res?.headers?.[\"x-deploy-release-version\"]);\n const currentReleaseVersion = Number(globalProps?.deployReleaseVersion);\n\n if (\n newReleaseVersion &&\n currentReleaseVersion &&\n newReleaseVersion !== currentReleaseVersion\n ) {\n useErrorDisplayStore.setState({ showRefreshRibbon: true });\n }\n\n return response;\n};\n\nconst buildSuccessResponseHandler = skip => {\n const interceptors = [];\n if (!skip?.transformCase) interceptors.push(transformResponseKeysToCamelCase);\n\n if (!skip?.showToastr) interceptors.push(showSuccessToastr);\n\n if (!skip?.checkForReleaseVersionMismatch) {\n interceptors.push(checkForReleaseVersionMismatch);\n }\n\n if (!skip?.pullDataFromResponse) interceptors.push(pullDataFromResponse);\n\n return createPipe(interceptors);\n};\n\nconst handleUnauthorizedErrorResponse = error => {\n if (error.response?.status !== 401) return error;\n\n resetAuthTokens();\n\n const { redirectOnError = true } = error.config ?? {};\n if (redirectOnError) {\n setTimeout(() => {\n const redirectTo =\n window.location.pathname === \"/login\"\n ? \"/login\"\n : `/login?redirect_uri=${encodeURIComponent(window.location.href)}`;\n\n // eslint-disable-next-line xss/no-location-href-assign\n window.location.href = redirectTo;\n }, 300);\n }\n\n return error;\n};\n\nconst isOnline = () => window.navigator.onLine;\n\nconst showOfflineToastr = () => {\n const toastId = Toastr.error(\n i18next.t(\"neetoCommons.toastr.error.networkError\")\n );\n\n if (toastId) {\n const dismissToastInterval = setInterval(() => {\n if (!isOnline()) return;\n\n toast.dismiss(toastId);\n clearInterval(dismissToastInterval);\n checkOnlineInterval = null;\n }, 1000);\n }\n};\n\nconst handleNetworkError = error => {\n if (checkOnlineInterval) return error;\n\n const startTime = Date.now();\n\n checkOnlineInterval = setInterval(() => {\n const elapsedTime = Date.now() - startTime;\n\n if (isOnline()) {\n clearInterval(checkOnlineInterval);\n checkOnlineInterval = null;\n } else if (elapsedTime >= MAXIMUM_OFFLINE_DURATION) {\n clearInterval(checkOnlineInterval);\n showOfflineToastr();\n }\n }, 1000);\n\n return error;\n};\n\nconst showErrorToastr = error => {\n const {\n showToastr = true,\n show422ErrorToastr = true,\n url: requestUrl = \"\",\n method: requestMethod = \"\",\n } = error.config ?? {};\n const { status } = error.response ?? {};\n\n if (!showToastr) return error;\n\n if (error.message === \"Network Error\") return handleNetworkError(error);\n\n if (error.code === \"ECONNABORTED\") {\n return error;\n }\n\n let shouldShowToastr = false,\n toastrContent = error;\n\n const skippedStatusCodes = [403, 404, 520, 422];\n if (!skippedStatusCodes.includes(status) && !axios.isCancel(error)) {\n // we already display a page in case of 403 & 404 and we don't want to show a toastr for cancelled requests.\n // We handle cloudflare error differently for production and other environments.\n shouldShowToastr = true;\n }\n\n if (status === 422 && show422ErrorToastr) shouldShowToastr = true;\n\n if (status === 520) {\n shouldShowToastr = true;\n if (globalProps.railsEnv === \"production\") {\n toastrContent = i18next.t(\"generic.error\");\n }\n }\n\n const toastIdKey = `${requestMethod}:${requestUrl}`;\n const errorToastId = requestErrorToasts[toastIdKey];\n if (errorToastId) toast.dismiss(errorToastId);\n\n if (shouldShowToastr) {\n if (errorToastId) {\n // if there's an existing toastr with the same message, the onClose callback in the neetoUI which\n // removes the toastr from the unique list will be fired only after the toast is completely removed\n // from the UI. If there's no delay, the new toastr will be considered as duplicate and ignored.\n setTimeout(() => {\n requestErrorToasts[toastIdKey] = Toastr.error(toastrContent);\n }, 1200);\n } else requestErrorToasts[toastIdKey] = Toastr.error(toastrContent);\n }\n\n return error;\n};\n\nconst getUrlPathName = url => {\n try {\n return new URL(url).pathname;\n } catch {\n return url;\n }\n};\n\nconst handle404ErrorResponse = error => {\n const { show404ErrorPage = true, show403ErrorPage = true } =\n error.config ?? {};\n\n const status = error.response?.status;\n if (\n (status === 404 && show404ErrorPage) ||\n (status === 403 && show403ErrorPage)\n ) {\n const fullUrl = error.request?.responseURL || error.config.url;\n useErrorDisplayStore.setState({\n showErrorPage: true,\n statusCode: status,\n failedApiUrl: fullUrl,\n failedApiPath: getUrlPathName(fullUrl),\n });\n }\n\n return error;\n};\n\nconst buildErrorResponseHandler = skip => {\n const interceptors = [];\n if (!skip?.transformCase) interceptors.push(transformErrorKeysToCamelCase);\n\n if (!skip?.show404ErrorPage) interceptors.push(handle404ErrorResponse);\n\n if (!skip?.logoutOn401) interceptors.push(handleUnauthorizedErrorResponse);\n\n if (!skip?.showToastr) interceptors.push(showErrorToastr);\n\n if (!skip?.checkForReleaseVersionMismatch) {\n interceptors.push(checkForReleaseVersionMismatch);\n }\n\n interceptors.push(Promise.reject.bind(Promise));\n\n return createPipe(interceptors);\n};\n\nconst cleanupCredentialsForCrossOrigin = request => {\n if (!request.url.includes(\"://\")) return request;\n\n if (request.url.includes(window.location.hostname)) return request;\n\n return evolve({ headers: omit([HEADERS_KEYS.xCsrfToken]) })(request);\n};\n\nconst transformDataToSnakeCase = request => {\n const { transformRequestCase = true } = request;\n\n if (!transformRequestCase) return request;\n\n return evolve(\n { data: serializeKeysToSnakeCase, params: serializeKeysToSnakeCase },\n request\n );\n};\n\nconst addRequestInterceptors = skip => {\n if (!skip?.cleanCredentialsForCrossOrigin) {\n axios.interceptors.request.use(cleanupCredentialsForCrossOrigin);\n }\n\n if (!skip?.transformCase) {\n axios.interceptors.request.use(transformDataToSnakeCase);\n }\n};\n\nconst addResponseInterceptors = skip => {\n axios.interceptors.response.use(\n buildSuccessResponseHandler(skip),\n buildErrorResponseHandler(skip)\n );\n};\n\nconst registerIntercepts = skip => {\n if (shouldNot(skip?.request)) addRequestInterceptors(skip?.request);\n\n if (shouldNot(skip?.response)) addResponseInterceptors(skip?.response);\n};\n\nexport default function initializeAxios(skip) {\n if (!skip?.baseURL) axios.defaults.baseURL = \"/\";\n\n if (!skip?.authHeaders) setAuthHeaders();\n\n if (!skip?.paramsSerializer) setParamsSerializer();\n\n if (shouldNot(skip?.interceptors)) registerIntercepts(skip?.interceptors);\n}\n"],"names":["checkOnlineInterval","requestErrorToasts","shouldNot","skip","_typeof","shouldShowToastr","response","isNotEmpty","notice","noticeCode","setAuthHeaders","_document$querySelect","axios","defaults","headers","_defineProperty","HEADERS_KEYS","accept","contentType","xCsrfToken","document","querySelector","getAttribute","createPipe","functions","data","reduce","acc","fn","transformResponseKeysToCamelCase","_response$config$tran","config","transformResponseCase","keysToCamelCase","transformErrorKeysToCamelCase","error","_error$config","_error$response","_ref","_ref$transformRespons","showSuccessToastr","_response$config","_response$config$show","showToastr","requestUrl","url","requestMethod","method","toastIdKey","concat","errorToastId","toast","dismiss","dissoc","matches","showThumbsUpToastr","Toastr","success","icon","className","pullDataFromResponse","_response$config$incl","includeMetadataInResponse","checkForReleaseVersionMismatch","_res$headers","_globalProps","res","newReleaseVersion","Number","currentReleaseVersion","globalProps","deployReleaseVersion","useErrorDisplayStore","setState","showRefreshRibbon","buildSuccessResponseHandler","interceptors","transformCase","push","handleUnauthorizedErrorResponse","_error$response2","_error$config2","status","resetAuthTokens","_ref2","_ref2$redirectOnError","redirectOnError","setTimeout","redirectTo","window","location","pathname","encodeURIComponent","href","isOnline","navigator","onLine","showOfflineToastr","toastId","i18next","t","dismissToastInterval","setInterval","clearInterval","handleNetworkError","startTime","Date","now","elapsedTime","MAXIMUM_OFFLINE_DURATION","showErrorToastr","_error$config3","_error$response3","_ref3","_ref3$showToastr","_ref3$show422ErrorToa","show422ErrorToastr","_ref3$url","_ref3$method","_ref4","message","code","toastrContent","skippedStatusCodes","includes","isCancel","railsEnv","getUrlPathName","URL","_unused","handle404ErrorResponse","_error$config4","_error$response4","_ref5","_ref5$show404ErrorPag","show404ErrorPage","_ref5$show403ErrorPag","show403ErrorPage","_error$request","fullUrl","request","responseURL","showErrorPage","statusCode","failedApiUrl","failedApiPath","buildErrorResponseHandler","logoutOn401","Promise","reject","bind","cleanupCredentialsForCrossOrigin","hostname","evolve","omit","transformDataToSnakeCase","_request$transformReq","transformRequestCase","serializeKeysToSnakeCase","params","addRequestInterceptors","cleanCredentialsForCrossOrigin","use","addResponseInterceptors","registerIntercepts","initializeAxios","baseURL","authHeaders","paramsSerializer","setParamsSerializer"],"mappings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,EAAE,CAAA;EAElD,IAAIvK,SAAS,CAACC,IAAI,KAAA,IAAA,IAAJA,IAAI,KAAJA,KAAAA,CAAAA,GAAAA,KAAAA,CAAAA,GAAAA,IAAI,CAAEyE,YAAY,CAAC,EAAEwF,kBAAkB,CAACjK,IAAI,KAAJA,IAAAA,IAAAA,IAAI,uBAAJA,IAAI,CAAEyE,YAAY,CAAC,CAAA;AAC3E;;;;"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var IGNORABLE_ERRORS_REGEX = new RegExp(["window.requestAnimationFrame", "ResizeObserver", "ChunkLoadError", "window.webkit.messageHandlers", "Request aborted", "Network Error", "Cannot redefine property: googletag", "Failed to execute 'removeChild' on 'Node'", "Failed to execute 'insertBefore' on 'Node'", "Can't find variable: disableWebkitEnterFullscreen", "rendererInterfaces is null", "Can't find variable: gmo", "Uncaught NetworkError: Failed to execute 'importScripts' on 'WorkerGlobalScope': The script at 'blob:.*' failed to load.", "Can't find variable: zaloJSV2"].join("|"));
|
|
3
|
+
var IGNORABLE_ERRORS_REGEX = new RegExp(["window.requestAnimationFrame", "ResizeObserver", "ChunkLoadError", "window.webkit.messageHandlers", "Request aborted", "Network Error", "Cannot redefine property: googletag", "Failed to execute 'removeChild' on 'Node'", "Failed to execute 'insertBefore' on 'Node'", "Can't find variable: disableWebkitEnterFullscreen", "rendererInterfaces is null", "Can't find variable: gmo", "Uncaught NetworkError: Failed to execute 'importScripts' on 'WorkerGlobalScope': The script at 'blob:.*' failed to load.", "Can't find variable: zaloJSV2", "Importing a module script failed"].join("|"));
|
|
4
4
|
var IGNORABLE_ERROR_NAMES_REGEX = /(ChunkLoadError)/;
|
|
5
5
|
|
|
6
6
|
exports.IGNORABLE_ERRORS_REGEX = IGNORABLE_ERRORS_REGEX;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.js","sources":["../../../../src/react-utils/HoneybadgerErrorBoundary/constants.js"],"sourcesContent":["export const IGNORABLE_ERRORS_REGEX = new RegExp(\n [\n \"window.requestAnimationFrame\",\n \"ResizeObserver\",\n \"ChunkLoadError\",\n \"window.webkit.messageHandlers\",\n \"Request aborted\",\n \"Network Error\",\n \"Cannot redefine property: googletag\",\n \"Failed to execute 'removeChild' on 'Node'\",\n \"Failed to execute 'insertBefore' on 'Node'\",\n \"Can't find variable: disableWebkitEnterFullscreen\",\n \"rendererInterfaces is null\",\n \"Can't find variable: gmo\",\n \"Uncaught NetworkError: Failed to execute 'importScripts' on 'WorkerGlobalScope': The script at 'blob:.*' failed to load.\",\n \"Can't find variable: zaloJSV2\",\n ].join(\"|\")\n);\nexport const IGNORABLE_ERROR_NAMES_REGEX = /(ChunkLoadError)/;\n"],"names":["IGNORABLE_ERRORS_REGEX","RegExp","join","IGNORABLE_ERROR_NAMES_REGEX"],"mappings":";;IAAaA,sBAAsB,GAAG,IAAIC,MAAM,CAC9C,CACE,8BAA8B,EAC9B,gBAAgB,EAChB,gBAAgB,EAChB,+BAA+B,EAC/B,iBAAiB,EACjB,eAAe,EACf,qCAAqC,EACrC,2CAA2C,EAC3C,4CAA4C,EAC5C,mDAAmD,EACnD,4BAA4B,EAC5B,0BAA0B,EAC1B,0HAA0H,EAC1H,+BAA+B,
|
|
1
|
+
{"version":3,"file":"constants.js","sources":["../../../../src/react-utils/HoneybadgerErrorBoundary/constants.js"],"sourcesContent":["export const IGNORABLE_ERRORS_REGEX = new RegExp(\n [\n \"window.requestAnimationFrame\",\n \"ResizeObserver\",\n \"ChunkLoadError\",\n \"window.webkit.messageHandlers\",\n \"Request aborted\",\n \"Network Error\",\n \"Cannot redefine property: googletag\",\n \"Failed to execute 'removeChild' on 'Node'\",\n \"Failed to execute 'insertBefore' on 'Node'\",\n \"Can't find variable: disableWebkitEnterFullscreen\",\n \"rendererInterfaces is null\",\n \"Can't find variable: gmo\",\n \"Uncaught NetworkError: Failed to execute 'importScripts' on 'WorkerGlobalScope': The script at 'blob:.*' failed to load.\",\n \"Can't find variable: zaloJSV2\",\n \"Importing a module script failed\",\n ].join(\"|\")\n);\nexport const IGNORABLE_ERROR_NAMES_REGEX = /(ChunkLoadError)/;\n"],"names":["IGNORABLE_ERRORS_REGEX","RegExp","join","IGNORABLE_ERROR_NAMES_REGEX"],"mappings":";;IAAaA,sBAAsB,GAAG,IAAIC,MAAM,CAC9C,CACE,8BAA8B,EAC9B,gBAAgB,EAChB,gBAAgB,EAChB,+BAA+B,EAC/B,iBAAiB,EACjB,eAAe,EACf,qCAAqC,EACrC,2CAA2C,EAC3C,4CAA4C,EAC5C,mDAAmD,EACnD,4BAA4B,EAC5B,0BAA0B,EAC1B,0HAA0H,EAC1H,+BAA+B,EAC/B,kCAAkC,CACnC,CAACC,IAAI,CAAC,GAAG,CACZ,EAAC;AACM,IAAMC,2BAA2B,GAAG;;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useDisplayErrorPage.js","sources":["../../../../src/react-utils/useDisplayErrorPage/useDisplayErrorPage.js"],"sourcesContent":["import { prop } from \"ramda\";\nimport { create } from \"zustand\";\n\nconst useDisplayErrorPage = () => useErrorDisplayStore(prop(\"showErrorPage\"));\n\nexport const useErrorDisplayStore = create(() => ({\n showErrorPage: false,\n statusCode: 404,\n failedApiUrl: \"\",\n failedApiPath: \"\",\n}));\n\nexport default useDisplayErrorPage;\n"],"names":["useDisplayErrorPage","useErrorDisplayStore","prop","create","showErrorPage","statusCode","failedApiUrl","failedApiPath"],"mappings":";;;;;;;AAGA,IAAMA,mBAAmB,GAAG,SAAtBA,mBAAmBA,GAAA;AAAA,EAAA,OAASC,oBAAoB,CAACC,UAAI,CAAC,eAAe,CAAC,CAAC,CAAA;AAAA,EAAA;AAEhED,IAAAA,oBAAoB,GAAGE,cAAM,CAAC,YAAA;EAAA,OAAO;AAChDC,IAAAA,aAAa,EAAE,KAAK;AACpBC,IAAAA,UAAU,EAAE,GAAG;AACfC,IAAAA,YAAY,EAAE,EAAE;AAChBC,IAAAA,aAAa,EAAE,
|
|
1
|
+
{"version":3,"file":"useDisplayErrorPage.js","sources":["../../../../src/react-utils/useDisplayErrorPage/useDisplayErrorPage.js"],"sourcesContent":["import { prop } from \"ramda\";\nimport { create } from \"zustand\";\n\nconst useDisplayErrorPage = () => useErrorDisplayStore(prop(\"showErrorPage\"));\n\nexport const useErrorDisplayStore = create(() => ({\n showErrorPage: false,\n statusCode: 404,\n failedApiUrl: \"\",\n failedApiPath: \"\",\n showRefreshRibbon: false,\n}));\n\nexport default useDisplayErrorPage;\n"],"names":["useDisplayErrorPage","useErrorDisplayStore","prop","create","showErrorPage","statusCode","failedApiUrl","failedApiPath","showRefreshRibbon"],"mappings":";;;;;;;AAGA,IAAMA,mBAAmB,GAAG,SAAtBA,mBAAmBA,GAAA;AAAA,EAAA,OAASC,oBAAoB,CAACC,UAAI,CAAC,eAAe,CAAC,CAAC,CAAA;AAAA,EAAA;AAEhED,IAAAA,oBAAoB,GAAGE,cAAM,CAAC,YAAA;EAAA,OAAO;AAChDC,IAAAA,aAAa,EAAE,KAAK;AACpBC,IAAAA,UAAU,EAAE,GAAG;AACfC,IAAAA,YAAY,EAAE,EAAE;AAChBC,IAAAA,aAAa,EAAE,EAAE;AACjBC,IAAAA,iBAAiB,EAAE,KAAA;GACpB,CAAA;AAAA,CAAC;;;;;"}
|
|
@@ -71,6 +71,7 @@ var showSuccessToastr = function showSuccessToastr(response) {
|
|
|
71
71
|
showThumbsUpToastr: true
|
|
72
72
|
}, response.data)) {
|
|
73
73
|
// @ts-ignore
|
|
74
|
+
// eslint-disable-next-line @bigbinary/neeto/use-show-thumbs-up-toastr
|
|
74
75
|
Toastr.success("", {
|
|
75
76
|
icon: "👍",
|
|
76
77
|
className: "w-20"
|
|
@@ -79,6 +80,7 @@ var showSuccessToastr = function showSuccessToastr(response) {
|
|
|
79
80
|
noticeCode: "thumbs_up"
|
|
80
81
|
}, response.data)) {
|
|
81
82
|
// @ts-ignore
|
|
83
|
+
// eslint-disable-next-line @bigbinary/neeto/use-show-thumbs-up-toastr
|
|
82
84
|
Toastr.success("", {
|
|
83
85
|
icon: "👍",
|
|
84
86
|
className: "w-20"
|
|
@@ -93,10 +95,25 @@ var pullDataFromResponse = function pullDataFromResponse(response) {
|
|
|
93
95
|
includeMetadataInResponse = _response$config$incl === void 0 ? false : _response$config$incl;
|
|
94
96
|
return includeMetadataInResponse ? response : response.data;
|
|
95
97
|
};
|
|
98
|
+
var checkForReleaseVersionMismatch = function checkForReleaseVersionMismatch(response) {
|
|
99
|
+
var _res$headers, _globalProps;
|
|
100
|
+
var res = (response === null || response === void 0 ? void 0 : response.response) || response;
|
|
101
|
+
var newReleaseVersion = Number(res === null || res === void 0 || (_res$headers = res.headers) === null || _res$headers === void 0 ? void 0 : _res$headers["x-deploy-release-version"]);
|
|
102
|
+
var currentReleaseVersion = Number((_globalProps = globalProps) === null || _globalProps === void 0 ? void 0 : _globalProps.deployReleaseVersion);
|
|
103
|
+
if (newReleaseVersion && currentReleaseVersion && newReleaseVersion !== currentReleaseVersion) {
|
|
104
|
+
useErrorDisplayStore.setState({
|
|
105
|
+
showRefreshRibbon: true
|
|
106
|
+
});
|
|
107
|
+
}
|
|
108
|
+
return response;
|
|
109
|
+
};
|
|
96
110
|
var buildSuccessResponseHandler = function buildSuccessResponseHandler(skip) {
|
|
97
111
|
var interceptors = [];
|
|
98
112
|
if (!(skip !== null && skip !== void 0 && skip.transformCase)) interceptors.push(transformResponseKeysToCamelCase);
|
|
99
113
|
if (!(skip !== null && skip !== void 0 && skip.showToastr)) interceptors.push(showSuccessToastr);
|
|
114
|
+
if (!(skip !== null && skip !== void 0 && skip.checkForReleaseVersionMismatch)) {
|
|
115
|
+
interceptors.push(checkForReleaseVersionMismatch);
|
|
116
|
+
}
|
|
100
117
|
if (!(skip !== null && skip !== void 0 && skip.pullDataFromResponse)) interceptors.push(pullDataFromResponse);
|
|
101
118
|
return createPipe(interceptors);
|
|
102
119
|
};
|
|
@@ -227,6 +244,9 @@ var buildErrorResponseHandler = function buildErrorResponseHandler(skip) {
|
|
|
227
244
|
if (!(skip !== null && skip !== void 0 && skip.show404ErrorPage)) interceptors.push(handle404ErrorResponse);
|
|
228
245
|
if (!(skip !== null && skip !== void 0 && skip.logoutOn401)) interceptors.push(handleUnauthorizedErrorResponse);
|
|
229
246
|
if (!(skip !== null && skip !== void 0 && skip.showToastr)) interceptors.push(showErrorToastr);
|
|
247
|
+
if (!(skip !== null && skip !== void 0 && skip.checkForReleaseVersionMismatch)) {
|
|
248
|
+
interceptors.push(checkForReleaseVersionMismatch);
|
|
249
|
+
}
|
|
230
250
|
interceptors.push(Promise.reject.bind(Promise));
|
|
231
251
|
return createPipe(interceptors);
|
|
232
252
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../src/initializers/axiosInitializer/index.js"],"sourcesContent":["import axios from \"axios\";\nimport i18next from \"i18next\";\nimport {\n isNotEmpty,\n keysToCamelCase,\n matches,\n serializeKeysToSnakeCase,\n} from \"neetocist\";\nimport { Toastr } from \"neetoui\";\nimport { dissoc, evolve, omit } from \"ramda\";\nimport { toast } from \"react-toastify\";\nimport { useErrorDisplayStore } from \"react-utils/useDisplayErrorPage\";\nimport { resetAuthTokens } from \"utils/axios\";\n\nimport setParamsSerializer from \"./paramsSerializer\";\n\nimport { HEADERS_KEYS, MAXIMUM_OFFLINE_DURATION } from \"../constants\";\n\nlet checkOnlineInterval = null;\nlet requestErrorToasts = {};\n\nconst shouldNot = skip => typeof skip === \"object\" || !skip;\n\nconst shouldShowToastr = response =>\n (typeof response === \"string\" && isNotEmpty(response)) ||\n (typeof response === \"object\" && (response?.notice || response?.noticeCode));\n\nconst setAuthHeaders = () => {\n // @ts-ignore\n axios.defaults.headers = {\n [HEADERS_KEYS.accept]: \"application/json\",\n [HEADERS_KEYS.contentType]: \"application/json\",\n [HEADERS_KEYS.xCsrfToken]: document\n .querySelector('[name=\"csrf-token\"]')\n ?.getAttribute(\"content\"),\n };\n};\n\n// pipe function from ramda doesn't accept array of functions.\n// We can't use spread operator too. So this is a workaround.\nconst createPipe = functions => data =>\n functions.reduce((acc, fn) => fn(acc), data);\n\nconst transformResponseKeysToCamelCase = response => {\n const { transformResponseCase = true } = response.config;\n\n if (response.data && transformResponseCase) {\n response.data = keysToCamelCase(response.data);\n }\n\n return response;\n};\n\nconst transformErrorKeysToCamelCase = error => {\n const { transformResponseCase = true } = error.config ?? {};\n\n if (error.response?.data && transformResponseCase) {\n error.response.data = keysToCamelCase(error.response.data);\n }\n\n return error;\n};\n\nconst showSuccessToastr = response => {\n const {\n showToastr = true,\n url: requestUrl,\n method: requestMethod,\n } = response.config;\n if (!showToastr) return response;\n\n const toastIdKey = `${requestMethod}:${requestUrl}`;\n const errorToastId = requestErrorToasts[toastIdKey];\n if (errorToastId) {\n toast.dismiss(errorToastId);\n requestErrorToasts = dissoc(toastIdKey, requestErrorToasts);\n }\n\n if (matches({ showThumbsUpToastr: true }, response.data)) {\n // @ts-ignore\n Toastr.success(\"\", { icon: \"👍\", className: \"w-20\" });\n } else if (matches({ noticeCode: \"thumbs_up\" }, response.data)) {\n // @ts-ignore\n Toastr.success(\"\", { icon: \"👍\", className: \"w-20\" });\n } else if (shouldShowToastr(response.data)) {\n Toastr.success(response.data);\n }\n\n return response;\n};\n\nconst pullDataFromResponse = response => {\n const { includeMetadataInResponse = false } = response.config;\n\n return includeMetadataInResponse ? response : response.data;\n};\n\nconst buildSuccessResponseHandler = skip => {\n const interceptors = [];\n if (!skip?.transformCase) interceptors.push(transformResponseKeysToCamelCase);\n\n if (!skip?.showToastr) interceptors.push(showSuccessToastr);\n\n if (!skip?.pullDataFromResponse) interceptors.push(pullDataFromResponse);\n\n return createPipe(interceptors);\n};\n\nconst handleUnauthorizedErrorResponse = error => {\n if (error.response?.status !== 401) return error;\n\n resetAuthTokens();\n\n const { redirectOnError = true } = error.config ?? {};\n if (redirectOnError) {\n setTimeout(() => {\n const redirectTo =\n window.location.pathname === \"/login\"\n ? \"/login\"\n : `/login?redirect_uri=${encodeURIComponent(window.location.href)}`;\n\n // eslint-disable-next-line xss/no-location-href-assign\n window.location.href = redirectTo;\n }, 300);\n }\n\n return error;\n};\n\nconst isOnline = () => window.navigator.onLine;\n\nconst showOfflineToastr = () => {\n const toastId = Toastr.error(\n i18next.t(\"neetoCommons.toastr.error.networkError\")\n );\n\n if (toastId) {\n const dismissToastInterval = setInterval(() => {\n if (!isOnline()) return;\n\n toast.dismiss(toastId);\n clearInterval(dismissToastInterval);\n checkOnlineInterval = null;\n }, 1000);\n }\n};\n\nconst handleNetworkError = error => {\n if (checkOnlineInterval) return error;\n\n const startTime = Date.now();\n\n checkOnlineInterval = setInterval(() => {\n const elapsedTime = Date.now() - startTime;\n\n if (isOnline()) {\n clearInterval(checkOnlineInterval);\n checkOnlineInterval = null;\n } else if (elapsedTime >= MAXIMUM_OFFLINE_DURATION) {\n clearInterval(checkOnlineInterval);\n showOfflineToastr();\n }\n }, 1000);\n\n return error;\n};\n\nconst showErrorToastr = error => {\n const {\n showToastr = true,\n show422ErrorToastr = true,\n url: requestUrl = \"\",\n method: requestMethod = \"\",\n } = error.config ?? {};\n const { status } = error.response ?? {};\n\n if (!showToastr) return error;\n\n if (error.message === \"Network Error\") return handleNetworkError(error);\n\n if (error.code === \"ECONNABORTED\") {\n return error;\n }\n\n let shouldShowToastr = false,\n toastrContent = error;\n\n const skippedStatusCodes = [403, 404, 520, 422];\n if (!skippedStatusCodes.includes(status) && !axios.isCancel(error)) {\n // we already display a page in case of 403 & 404 and we don't want to show a toastr for cancelled requests.\n // We handle cloudflare error differently for production and other environments.\n shouldShowToastr = true;\n }\n\n if (status === 422 && show422ErrorToastr) shouldShowToastr = true;\n\n if (status === 520) {\n shouldShowToastr = true;\n if (globalProps.railsEnv === \"production\") {\n toastrContent = i18next.t(\"generic.error\");\n }\n }\n\n const toastIdKey = `${requestMethod}:${requestUrl}`;\n const errorToastId = requestErrorToasts[toastIdKey];\n if (errorToastId) toast.dismiss(errorToastId);\n\n if (shouldShowToastr) {\n if (errorToastId) {\n // if there's an existing toastr with the same message, the onClose callback in the neetoUI which\n // removes the toastr from the unique list will be fired only after the toast is completely removed\n // from the UI. If there's no delay, the new toastr will be considered as duplicate and ignored.\n setTimeout(() => {\n requestErrorToasts[toastIdKey] = Toastr.error(toastrContent);\n }, 1200);\n } else requestErrorToasts[toastIdKey] = Toastr.error(toastrContent);\n }\n\n return error;\n};\n\nconst getUrlPathName = url => {\n try {\n return new URL(url).pathname;\n } catch {\n return url;\n }\n};\n\nconst handle404ErrorResponse = error => {\n const { show404ErrorPage = true, show403ErrorPage = true } =\n error.config ?? {};\n\n const status = error.response?.status;\n if (\n (status === 404 && show404ErrorPage) ||\n (status === 403 && show403ErrorPage)\n ) {\n const fullUrl = error.request?.responseURL || error.config.url;\n useErrorDisplayStore.setState({\n showErrorPage: true,\n statusCode: status,\n failedApiUrl: fullUrl,\n failedApiPath: getUrlPathName(fullUrl),\n });\n }\n\n return error;\n};\n\nconst buildErrorResponseHandler = skip => {\n const interceptors = [];\n if (!skip?.transformCase) interceptors.push(transformErrorKeysToCamelCase);\n\n if (!skip?.show404ErrorPage) interceptors.push(handle404ErrorResponse);\n\n if (!skip?.logoutOn401) interceptors.push(handleUnauthorizedErrorResponse);\n\n if (!skip?.showToastr) interceptors.push(showErrorToastr);\n\n interceptors.push(Promise.reject.bind(Promise));\n\n return createPipe(interceptors);\n};\n\nconst cleanupCredentialsForCrossOrigin = request => {\n if (!request.url.includes(\"://\")) return request;\n\n if (request.url.includes(window.location.hostname)) return request;\n\n return evolve({ headers: omit([HEADERS_KEYS.xCsrfToken]) })(request);\n};\n\nconst transformDataToSnakeCase = request => {\n const { transformRequestCase = true } = request;\n\n if (!transformRequestCase) return request;\n\n return evolve(\n { data: serializeKeysToSnakeCase, params: serializeKeysToSnakeCase },\n request\n );\n};\n\nconst addRequestInterceptors = skip => {\n if (!skip?.cleanCredentialsForCrossOrigin) {\n axios.interceptors.request.use(cleanupCredentialsForCrossOrigin);\n }\n\n if (!skip?.transformCase) {\n axios.interceptors.request.use(transformDataToSnakeCase);\n }\n};\n\nconst addResponseInterceptors = skip => {\n axios.interceptors.response.use(\n buildSuccessResponseHandler(skip),\n buildErrorResponseHandler(skip)\n );\n};\n\nconst registerIntercepts = skip => {\n if (shouldNot(skip?.request)) addRequestInterceptors(skip?.request);\n\n if (shouldNot(skip?.response)) addResponseInterceptors(skip?.response);\n};\n\nexport default function initializeAxios(skip) {\n if (!skip?.baseURL) axios.defaults.baseURL = \"/\";\n\n if (!skip?.authHeaders) setAuthHeaders();\n\n if (!skip?.paramsSerializer) setParamsSerializer();\n\n if (shouldNot(skip?.interceptors)) registerIntercepts(skip?.interceptors);\n}\n"],"names":["checkOnlineInterval","requestErrorToasts","shouldNot","skip","_typeof","shouldShowToastr","response","isNotEmpty","notice","noticeCode","setAuthHeaders","_document$querySelect","axios","defaults","headers","_defineProperty","HEADERS_KEYS","accept","contentType","xCsrfToken","document","querySelector","getAttribute","createPipe","functions","data","reduce","acc","fn","transformResponseKeysToCamelCase","_response$config$tran","config","transformResponseCase","keysToCamelCase","transformErrorKeysToCamelCase","error","_error$config","_error$response","_ref","_ref$transformRespons","showSuccessToastr","_response$config","_response$config$show","showToastr","requestUrl","url","requestMethod","method","toastIdKey","concat","errorToastId","toast","dismiss","dissoc","matches","showThumbsUpToastr","Toastr","success","icon","className","pullDataFromResponse","_response$config$incl","includeMetadataInResponse","buildSuccessResponseHandler","interceptors","transformCase","push","handleUnauthorizedErrorResponse","_error$response2","_error$config2","status","resetAuthTokens","_ref2","_ref2$redirectOnError","redirectOnError","setTimeout","redirectTo","window","location","pathname","encodeURIComponent","href","isOnline","navigator","onLine","showOfflineToastr","toastId","i18next","t","dismissToastInterval","setInterval","clearInterval","handleNetworkError","startTime","Date","now","elapsedTime","MAXIMUM_OFFLINE_DURATION","showErrorToastr","_error$config3","_error$response3","_ref3","_ref3$showToastr","_ref3$show422ErrorToa","show422ErrorToastr","_ref3$url","_ref3$method","_ref4","message","code","toastrContent","skippedStatusCodes","includes","isCancel","globalProps","railsEnv","getUrlPathName","URL","_unused","handle404ErrorResponse","_error$config4","_error$response4","_ref5","_ref5$show404ErrorPag","show404ErrorPage","_ref5$show403ErrorPag","show403ErrorPage","_error$request","fullUrl","request","responseURL","useErrorDisplayStore","setState","showErrorPage","statusCode","failedApiUrl","failedApiPath","buildErrorResponseHandler","logoutOn401","Promise","reject","bind","cleanupCredentialsForCrossOrigin","hostname","evolve","omit","transformDataToSnakeCase","_request$transformReq","transformRequestCase","serializeKeysToSnakeCase","params","addRequestInterceptors","cleanCredentialsForCrossOrigin","use","addResponseInterceptors","registerIntercepts","initializeAxios","baseURL","authHeaders","paramsSerializer","setParamsSerializer"],"mappings":";;;;;;;;;;;;;;;AAkBA,IAAIA,mBAAmB,GAAG,IAAI,CAAA;AAC9B,IAAIC,kBAAkB,GAAG,EAAE,CAAA;AAE3B,IAAMC,SAAS,GAAG,SAAZA,SAASA,CAAGC,IAAI,EAAA;AAAA,EAAA,OAAIC,OAAA,CAAOD,IAAI,MAAK,QAAQ,IAAI,CAACA,IAAI,CAAA;AAAA,CAAA,CAAA;AAE3D,IAAME,gBAAgB,GAAG,SAAnBA,gBAAgBA,CAAGC,QAAQ,EAAA;AAAA,EAAA,OAC9B,OAAOA,QAAQ,KAAK,QAAQ,IAAIC,UAAU,CAACD,QAAQ,CAAC,IACpDF,OAAA,CAAOE,QAAQ,MAAK,QAAQ,KAAK,CAAAA,QAAQ,KAARA,IAAAA,IAAAA,QAAQ,KAARA,KAAAA,CAAAA,GAAAA,KAAAA,CAAAA,GAAAA,QAAQ,CAAEE,MAAM,MAAIF,QAAQ,KAAA,IAAA,IAARA,QAAQ,KAAA,KAAA,CAAA,GAAA,KAAA,CAAA,GAARA,QAAQ,CAAEG,UAAU,CAAE,CAAA,CAAA;AAAA,CAAA,CAAA;AAE9E,IAAMC,cAAc,GAAG,SAAjBA,cAAcA,GAAS;AAAA,EAAA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;AACxE,CAAC,CAAA;AAEc,SAASsJ,eAAeA,CAACzJ,IAAI,EAAE;AAC5C,EAAA,IAAI,EAACA,IAAI,KAAJA,IAAAA,IAAAA,IAAI,eAAJA,IAAI,CAAE0J,OAAO,CAAA,EAAEjJ,KAAK,CAACC,QAAQ,CAACgJ,OAAO,GAAG,GAAG,CAAA;EAEhD,IAAI,EAAC1J,IAAI,KAAA,IAAA,IAAJA,IAAI,KAAA,KAAA,CAAA,IAAJA,IAAI,CAAE2J,WAAW,CAAA,EAAEpJ,cAAc,EAAE,CAAA;EAExC,IAAI,EAACP,IAAI,KAAA,IAAA,IAAJA,IAAI,KAAA,KAAA,CAAA,IAAJA,IAAI,CAAE4J,gBAAgB,CAAA,EAAEC,mBAAmB,EAAE,CAAA;EAElD,IAAI9J,SAAS,CAACC,IAAI,KAAA,IAAA,IAAJA,IAAI,KAAJA,KAAAA,CAAAA,GAAAA,KAAAA,CAAAA,GAAAA,IAAI,CAAE6D,YAAY,CAAC,EAAE2F,kBAAkB,CAACxJ,IAAI,KAAJA,IAAAA,IAAAA,IAAI,uBAAJA,IAAI,CAAE6D,YAAY,CAAC,CAAA;AAC3E;;;;"}
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../src/initializers/axiosInitializer/index.js"],"sourcesContent":["import axios from \"axios\";\nimport i18next from \"i18next\";\nimport {\n isNotEmpty,\n keysToCamelCase,\n matches,\n serializeKeysToSnakeCase,\n} from \"neetocist\";\nimport { Toastr } from \"neetoui\";\nimport { dissoc, evolve, omit } from \"ramda\";\nimport { toast } from \"react-toastify\";\nimport { useErrorDisplayStore } from \"react-utils/useDisplayErrorPage\";\nimport { resetAuthTokens } from \"utils/axios\";\n\nimport setParamsSerializer from \"./paramsSerializer\";\n\nimport { HEADERS_KEYS, MAXIMUM_OFFLINE_DURATION } from \"../constants\";\n\nlet checkOnlineInterval = null;\nlet requestErrorToasts = {};\n\nconst shouldNot = skip => typeof skip === \"object\" || !skip;\n\nconst shouldShowToastr = response =>\n (typeof response === \"string\" && isNotEmpty(response)) ||\n (typeof response === \"object\" && (response?.notice || response?.noticeCode));\n\nconst setAuthHeaders = () => {\n // @ts-ignore\n axios.defaults.headers = {\n [HEADERS_KEYS.accept]: \"application/json\",\n [HEADERS_KEYS.contentType]: \"application/json\",\n [HEADERS_KEYS.xCsrfToken]: document\n .querySelector('[name=\"csrf-token\"]')\n ?.getAttribute(\"content\"),\n };\n};\n\n// pipe function from ramda doesn't accept array of functions.\n// We can't use spread operator too. So this is a workaround.\nconst createPipe = functions => data =>\n functions.reduce((acc, fn) => fn(acc), data);\n\nconst transformResponseKeysToCamelCase = response => {\n const { transformResponseCase = true } = response.config;\n\n if (response.data && transformResponseCase) {\n response.data = keysToCamelCase(response.data);\n }\n\n return response;\n};\n\nconst transformErrorKeysToCamelCase = error => {\n const { transformResponseCase = true } = error.config ?? {};\n\n if (error.response?.data && transformResponseCase) {\n error.response.data = keysToCamelCase(error.response.data);\n }\n\n return error;\n};\n\nconst showSuccessToastr = response => {\n const {\n showToastr = true,\n url: requestUrl,\n method: requestMethod,\n } = response.config;\n if (!showToastr) return response;\n\n const toastIdKey = `${requestMethod}:${requestUrl}`;\n const errorToastId = requestErrorToasts[toastIdKey];\n if (errorToastId) {\n toast.dismiss(errorToastId);\n requestErrorToasts = dissoc(toastIdKey, requestErrorToasts);\n }\n\n if (matches({ showThumbsUpToastr: true }, response.data)) {\n // @ts-ignore\n // eslint-disable-next-line @bigbinary/neeto/use-show-thumbs-up-toastr\n Toastr.success(\"\", { icon: \"👍\", className: \"w-20\" });\n } else if (matches({ noticeCode: \"thumbs_up\" }, response.data)) {\n // @ts-ignore\n // eslint-disable-next-line @bigbinary/neeto/use-show-thumbs-up-toastr\n Toastr.success(\"\", { icon: \"👍\", className: \"w-20\" });\n } else if (shouldShowToastr(response.data)) {\n Toastr.success(response.data);\n }\n\n return response;\n};\n\nconst pullDataFromResponse = response => {\n const { includeMetadataInResponse = false } = response.config;\n\n return includeMetadataInResponse ? response : response.data;\n};\n\nconst checkForReleaseVersionMismatch = response => {\n const res = response?.response || response;\n const newReleaseVersion = Number(res?.headers?.[\"x-deploy-release-version\"]);\n const currentReleaseVersion = Number(globalProps?.deployReleaseVersion);\n\n if (\n newReleaseVersion &&\n currentReleaseVersion &&\n newReleaseVersion !== currentReleaseVersion\n ) {\n useErrorDisplayStore.setState({ showRefreshRibbon: true });\n }\n\n return response;\n};\n\nconst buildSuccessResponseHandler = skip => {\n const interceptors = [];\n if (!skip?.transformCase) interceptors.push(transformResponseKeysToCamelCase);\n\n if (!skip?.showToastr) interceptors.push(showSuccessToastr);\n\n if (!skip?.checkForReleaseVersionMismatch) {\n interceptors.push(checkForReleaseVersionMismatch);\n }\n\n if (!skip?.pullDataFromResponse) interceptors.push(pullDataFromResponse);\n\n return createPipe(interceptors);\n};\n\nconst handleUnauthorizedErrorResponse = error => {\n if (error.response?.status !== 401) return error;\n\n resetAuthTokens();\n\n const { redirectOnError = true } = error.config ?? {};\n if (redirectOnError) {\n setTimeout(() => {\n const redirectTo =\n window.location.pathname === \"/login\"\n ? \"/login\"\n : `/login?redirect_uri=${encodeURIComponent(window.location.href)}`;\n\n // eslint-disable-next-line xss/no-location-href-assign\n window.location.href = redirectTo;\n }, 300);\n }\n\n return error;\n};\n\nconst isOnline = () => window.navigator.onLine;\n\nconst showOfflineToastr = () => {\n const toastId = Toastr.error(\n i18next.t(\"neetoCommons.toastr.error.networkError\")\n );\n\n if (toastId) {\n const dismissToastInterval = setInterval(() => {\n if (!isOnline()) return;\n\n toast.dismiss(toastId);\n clearInterval(dismissToastInterval);\n checkOnlineInterval = null;\n }, 1000);\n }\n};\n\nconst handleNetworkError = error => {\n if (checkOnlineInterval) return error;\n\n const startTime = Date.now();\n\n checkOnlineInterval = setInterval(() => {\n const elapsedTime = Date.now() - startTime;\n\n if (isOnline()) {\n clearInterval(checkOnlineInterval);\n checkOnlineInterval = null;\n } else if (elapsedTime >= MAXIMUM_OFFLINE_DURATION) {\n clearInterval(checkOnlineInterval);\n showOfflineToastr();\n }\n }, 1000);\n\n return error;\n};\n\nconst showErrorToastr = error => {\n const {\n showToastr = true,\n show422ErrorToastr = true,\n url: requestUrl = \"\",\n method: requestMethod = \"\",\n } = error.config ?? {};\n const { status } = error.response ?? {};\n\n if (!showToastr) return error;\n\n if (error.message === \"Network Error\") return handleNetworkError(error);\n\n if (error.code === \"ECONNABORTED\") {\n return error;\n }\n\n let shouldShowToastr = false,\n toastrContent = error;\n\n const skippedStatusCodes = [403, 404, 520, 422];\n if (!skippedStatusCodes.includes(status) && !axios.isCancel(error)) {\n // we already display a page in case of 403 & 404 and we don't want to show a toastr for cancelled requests.\n // We handle cloudflare error differently for production and other environments.\n shouldShowToastr = true;\n }\n\n if (status === 422 && show422ErrorToastr) shouldShowToastr = true;\n\n if (status === 520) {\n shouldShowToastr = true;\n if (globalProps.railsEnv === \"production\") {\n toastrContent = i18next.t(\"generic.error\");\n }\n }\n\n const toastIdKey = `${requestMethod}:${requestUrl}`;\n const errorToastId = requestErrorToasts[toastIdKey];\n if (errorToastId) toast.dismiss(errorToastId);\n\n if (shouldShowToastr) {\n if (errorToastId) {\n // if there's an existing toastr with the same message, the onClose callback in the neetoUI which\n // removes the toastr from the unique list will be fired only after the toast is completely removed\n // from the UI. If there's no delay, the new toastr will be considered as duplicate and ignored.\n setTimeout(() => {\n requestErrorToasts[toastIdKey] = Toastr.error(toastrContent);\n }, 1200);\n } else requestErrorToasts[toastIdKey] = Toastr.error(toastrContent);\n }\n\n return error;\n};\n\nconst getUrlPathName = url => {\n try {\n return new URL(url).pathname;\n } catch {\n return url;\n }\n};\n\nconst handle404ErrorResponse = error => {\n const { show404ErrorPage = true, show403ErrorPage = true } =\n error.config ?? {};\n\n const status = error.response?.status;\n if (\n (status === 404 && show404ErrorPage) ||\n (status === 403 && show403ErrorPage)\n ) {\n const fullUrl = error.request?.responseURL || error.config.url;\n useErrorDisplayStore.setState({\n showErrorPage: true,\n statusCode: status,\n failedApiUrl: fullUrl,\n failedApiPath: getUrlPathName(fullUrl),\n });\n }\n\n return error;\n};\n\nconst buildErrorResponseHandler = skip => {\n const interceptors = [];\n if (!skip?.transformCase) interceptors.push(transformErrorKeysToCamelCase);\n\n if (!skip?.show404ErrorPage) interceptors.push(handle404ErrorResponse);\n\n if (!skip?.logoutOn401) interceptors.push(handleUnauthorizedErrorResponse);\n\n if (!skip?.showToastr) interceptors.push(showErrorToastr);\n\n if (!skip?.checkForReleaseVersionMismatch) {\n interceptors.push(checkForReleaseVersionMismatch);\n }\n\n interceptors.push(Promise.reject.bind(Promise));\n\n return createPipe(interceptors);\n};\n\nconst cleanupCredentialsForCrossOrigin = request => {\n if (!request.url.includes(\"://\")) return request;\n\n if (request.url.includes(window.location.hostname)) return request;\n\n return evolve({ headers: omit([HEADERS_KEYS.xCsrfToken]) })(request);\n};\n\nconst transformDataToSnakeCase = request => {\n const { transformRequestCase = true } = request;\n\n if (!transformRequestCase) return request;\n\n return evolve(\n { data: serializeKeysToSnakeCase, params: serializeKeysToSnakeCase },\n request\n );\n};\n\nconst addRequestInterceptors = skip => {\n if (!skip?.cleanCredentialsForCrossOrigin) {\n axios.interceptors.request.use(cleanupCredentialsForCrossOrigin);\n }\n\n if (!skip?.transformCase) {\n axios.interceptors.request.use(transformDataToSnakeCase);\n }\n};\n\nconst addResponseInterceptors = skip => {\n axios.interceptors.response.use(\n buildSuccessResponseHandler(skip),\n buildErrorResponseHandler(skip)\n );\n};\n\nconst registerIntercepts = skip => {\n if (shouldNot(skip?.request)) addRequestInterceptors(skip?.request);\n\n if (shouldNot(skip?.response)) addResponseInterceptors(skip?.response);\n};\n\nexport default function initializeAxios(skip) {\n if (!skip?.baseURL) axios.defaults.baseURL = \"/\";\n\n if (!skip?.authHeaders) setAuthHeaders();\n\n if (!skip?.paramsSerializer) setParamsSerializer();\n\n if (shouldNot(skip?.interceptors)) registerIntercepts(skip?.interceptors);\n}\n"],"names":["checkOnlineInterval","requestErrorToasts","shouldNot","skip","_typeof","shouldShowToastr","response","isNotEmpty","notice","noticeCode","setAuthHeaders","_document$querySelect","axios","defaults","headers","_defineProperty","HEADERS_KEYS","accept","contentType","xCsrfToken","document","querySelector","getAttribute","createPipe","functions","data","reduce","acc","fn","transformResponseKeysToCamelCase","_response$config$tran","config","transformResponseCase","keysToCamelCase","transformErrorKeysToCamelCase","error","_error$config","_error$response","_ref","_ref$transformRespons","showSuccessToastr","_response$config","_response$config$show","showToastr","requestUrl","url","requestMethod","method","toastIdKey","concat","errorToastId","toast","dismiss","dissoc","matches","showThumbsUpToastr","Toastr","success","icon","className","pullDataFromResponse","_response$config$incl","includeMetadataInResponse","checkForReleaseVersionMismatch","_res$headers","_globalProps","res","newReleaseVersion","Number","currentReleaseVersion","globalProps","deployReleaseVersion","useErrorDisplayStore","setState","showRefreshRibbon","buildSuccessResponseHandler","interceptors","transformCase","push","handleUnauthorizedErrorResponse","_error$response2","_error$config2","status","resetAuthTokens","_ref2","_ref2$redirectOnError","redirectOnError","setTimeout","redirectTo","window","location","pathname","encodeURIComponent","href","isOnline","navigator","onLine","showOfflineToastr","toastId","i18next","t","dismissToastInterval","setInterval","clearInterval","handleNetworkError","startTime","Date","now","elapsedTime","MAXIMUM_OFFLINE_DURATION","showErrorToastr","_error$config3","_error$response3","_ref3","_ref3$showToastr","_ref3$show422ErrorToa","show422ErrorToastr","_ref3$url","_ref3$method","_ref4","message","code","toastrContent","skippedStatusCodes","includes","isCancel","railsEnv","getUrlPathName","URL","_unused","handle404ErrorResponse","_error$config4","_error$response4","_ref5","_ref5$show404ErrorPag","show404ErrorPage","_ref5$show403ErrorPag","show403ErrorPage","_error$request","fullUrl","request","responseURL","showErrorPage","statusCode","failedApiUrl","failedApiPath","buildErrorResponseHandler","logoutOn401","Promise","reject","bind","cleanupCredentialsForCrossOrigin","hostname","evolve","omit","transformDataToSnakeCase","_request$transformReq","transformRequestCase","serializeKeysToSnakeCase","params","addRequestInterceptors","cleanCredentialsForCrossOrigin","use","addResponseInterceptors","registerI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qK,gBAAgB,CAAA,EAAEC,mBAAmB,EAAE,CAAA;EAElD,IAAIvK,SAAS,CAACC,IAAI,KAAA,IAAA,IAAJA,IAAI,KAAJA,KAAAA,CAAAA,GAAAA,KAAAA,CAAAA,GAAAA,IAAI,CAAEyE,YAAY,CAAC,EAAEwF,kBAAkB,CAACjK,IAAI,KAAJA,IAAAA,IAAAA,IAAI,uBAAJA,IAAI,CAAEyE,YAAY,CAAC,CAAA;AAC3E;;;;"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var IGNORABLE_ERRORS_REGEX = new RegExp(["window.requestAnimationFrame", "ResizeObserver", "ChunkLoadError", "window.webkit.messageHandlers", "Request aborted", "Network Error", "Cannot redefine property: googletag", "Failed to execute 'removeChild' on 'Node'", "Failed to execute 'insertBefore' on 'Node'", "Can't find variable: disableWebkitEnterFullscreen", "rendererInterfaces is null", "Can't find variable: gmo", "Uncaught NetworkError: Failed to execute 'importScripts' on 'WorkerGlobalScope': The script at 'blob:.*' failed to load.", "Can't find variable: zaloJSV2"].join("|"));
|
|
1
|
+
var IGNORABLE_ERRORS_REGEX = new RegExp(["window.requestAnimationFrame", "ResizeObserver", "ChunkLoadError", "window.webkit.messageHandlers", "Request aborted", "Network Error", "Cannot redefine property: googletag", "Failed to execute 'removeChild' on 'Node'", "Failed to execute 'insertBefore' on 'Node'", "Can't find variable: disableWebkitEnterFullscreen", "rendererInterfaces is null", "Can't find variable: gmo", "Uncaught NetworkError: Failed to execute 'importScripts' on 'WorkerGlobalScope': The script at 'blob:.*' failed to load.", "Can't find variable: zaloJSV2", "Importing a module script failed"].join("|"));
|
|
2
2
|
var IGNORABLE_ERROR_NAMES_REGEX = /(ChunkLoadError)/;
|
|
3
3
|
|
|
4
4
|
export { IGNORABLE_ERRORS_REGEX, IGNORABLE_ERROR_NAMES_REGEX };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.js","sources":["../../../src/react-utils/HoneybadgerErrorBoundary/constants.js"],"sourcesContent":["export const IGNORABLE_ERRORS_REGEX = new RegExp(\n [\n \"window.requestAnimationFrame\",\n \"ResizeObserver\",\n \"ChunkLoadError\",\n \"window.webkit.messageHandlers\",\n \"Request aborted\",\n \"Network Error\",\n \"Cannot redefine property: googletag\",\n \"Failed to execute 'removeChild' on 'Node'\",\n \"Failed to execute 'insertBefore' on 'Node'\",\n \"Can't find variable: disableWebkitEnterFullscreen\",\n \"rendererInterfaces is null\",\n \"Can't find variable: gmo\",\n \"Uncaught NetworkError: Failed to execute 'importScripts' on 'WorkerGlobalScope': The script at 'blob:.*' failed to load.\",\n \"Can't find variable: zaloJSV2\",\n ].join(\"|\")\n);\nexport const IGNORABLE_ERROR_NAMES_REGEX = /(ChunkLoadError)/;\n"],"names":["IGNORABLE_ERRORS_REGEX","RegExp","join","IGNORABLE_ERROR_NAMES_REGEX"],"mappings":"IAAaA,sBAAsB,GAAG,IAAIC,MAAM,CAC9C,CACE,8BAA8B,EAC9B,gBAAgB,EAChB,gBAAgB,EAChB,+BAA+B,EAC/B,iBAAiB,EACjB,eAAe,EACf,qCAAqC,EACrC,2CAA2C,EAC3C,4CAA4C,EAC5C,mDAAmD,EACnD,4BAA4B,EAC5B,0BAA0B,EAC1B,0HAA0H,EAC1H,+BAA+B,
|
|
1
|
+
{"version":3,"file":"constants.js","sources":["../../../src/react-utils/HoneybadgerErrorBoundary/constants.js"],"sourcesContent":["export const IGNORABLE_ERRORS_REGEX = new RegExp(\n [\n \"window.requestAnimationFrame\",\n \"ResizeObserver\",\n \"ChunkLoadError\",\n \"window.webkit.messageHandlers\",\n \"Request aborted\",\n \"Network Error\",\n \"Cannot redefine property: googletag\",\n \"Failed to execute 'removeChild' on 'Node'\",\n \"Failed to execute 'insertBefore' on 'Node'\",\n \"Can't find variable: disableWebkitEnterFullscreen\",\n \"rendererInterfaces is null\",\n \"Can't find variable: gmo\",\n \"Uncaught NetworkError: Failed to execute 'importScripts' on 'WorkerGlobalScope': The script at 'blob:.*' failed to load.\",\n \"Can't find variable: zaloJSV2\",\n \"Importing a module script failed\",\n ].join(\"|\")\n);\nexport const IGNORABLE_ERROR_NAMES_REGEX = /(ChunkLoadError)/;\n"],"names":["IGNORABLE_ERRORS_REGEX","RegExp","join","IGNORABLE_ERROR_NAMES_REGEX"],"mappings":"IAAaA,sBAAsB,GAAG,IAAIC,MAAM,CAC9C,CACE,8BAA8B,EAC9B,gBAAgB,EAChB,gBAAgB,EAChB,+BAA+B,EAC/B,iBAAiB,EACjB,eAAe,EACf,qCAAqC,EACrC,2CAA2C,EAC3C,4CAA4C,EAC5C,mDAAmD,EACnD,4BAA4B,EAC5B,0BAA0B,EAC1B,0HAA0H,EAC1H,+BAA+B,EAC/B,kCAAkC,CACnC,CAACC,IAAI,CAAC,GAAG,CACZ,EAAC;AACM,IAAMC,2BAA2B,GAAG;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useDisplayErrorPage.js","sources":["../../../src/react-utils/useDisplayErrorPage/useDisplayErrorPage.js"],"sourcesContent":["import { prop } from \"ramda\";\nimport { create } from \"zustand\";\n\nconst useDisplayErrorPage = () => useErrorDisplayStore(prop(\"showErrorPage\"));\n\nexport const useErrorDisplayStore = create(() => ({\n showErrorPage: false,\n statusCode: 404,\n failedApiUrl: \"\",\n failedApiPath: \"\",\n}));\n\nexport default useDisplayErrorPage;\n"],"names":["useDisplayErrorPage","useErrorDisplayStore","prop","create","showErrorPage","statusCode","failedApiUrl","failedApiPath"],"mappings":";;;AAGA,IAAMA,mBAAmB,GAAG,SAAtBA,mBAAmBA,GAAA;AAAA,EAAA,OAASC,oBAAoB,CAACC,IAAI,CAAC,eAAe,CAAC,CAAC,CAAA;AAAA,EAAA;AAEhED,IAAAA,oBAAoB,GAAGE,MAAM,CAAC,YAAA;EAAA,OAAO;AAChDC,IAAAA,aAAa,EAAE,KAAK;AACpBC,IAAAA,UAAU,EAAE,GAAG;AACfC,IAAAA,YAAY,EAAE,EAAE;AAChBC,IAAAA,aAAa,EAAE,
|
|
1
|
+
{"version":3,"file":"useDisplayErrorPage.js","sources":["../../../src/react-utils/useDisplayErrorPage/useDisplayErrorPage.js"],"sourcesContent":["import { prop } from \"ramda\";\nimport { create } from \"zustand\";\n\nconst useDisplayErrorPage = () => useErrorDisplayStore(prop(\"showErrorPage\"));\n\nexport const useErrorDisplayStore = create(() => ({\n showErrorPage: false,\n statusCode: 404,\n failedApiUrl: \"\",\n failedApiPath: \"\",\n showRefreshRibbon: false,\n}));\n\nexport default useDisplayErrorPage;\n"],"names":["useDisplayErrorPage","useErrorDisplayStore","prop","create","showErrorPage","statusCode","failedApiUrl","failedApiPath","showRefreshRibbon"],"mappings":";;;AAGA,IAAMA,mBAAmB,GAAG,SAAtBA,mBAAmBA,GAAA;AAAA,EAAA,OAASC,oBAAoB,CAACC,IAAI,CAAC,eAAe,CAAC,CAAC,CAAA;AAAA,EAAA;AAEhED,IAAAA,oBAAoB,GAAGE,MAAM,CAAC,YAAA;EAAA,OAAO;AAChDC,IAAAA,aAAa,EAAE,KAAK;AACpBC,IAAAA,UAAU,EAAE,GAAG;AACfC,IAAAA,YAAY,EAAE,EAAE;AAChBC,IAAAA,aAAa,EAAE,EAAE;AACjBC,IAAAA,iBAAiB,EAAE,KAAA;GACpB,CAAA;AAAA,CAAC;;;;"}
|
package/initializers.d.ts
CHANGED
|
@@ -26,6 +26,7 @@ type Configurations = {
|
|
|
26
26
|
pullDataFromResponse: boolean;
|
|
27
27
|
show404ErrorPage: boolean;
|
|
28
28
|
logoutOn401: boolean;
|
|
29
|
+
checkForReleaseVersionMismatch: boolean;
|
|
29
30
|
}>;
|
|
30
31
|
}>;
|
|
31
32
|
}>;
|
|
@@ -34,6 +35,7 @@ type Configurations = {
|
|
|
34
35
|
type GlobalPropsType = {
|
|
35
36
|
railsEnv: string;
|
|
36
37
|
honeybadgerApiKey: string;
|
|
38
|
+
deployReleaseVersion: number;
|
|
37
39
|
organization: {
|
|
38
40
|
name: string;
|
|
39
41
|
subdomain: string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bigbinary/neeto-commons-frontend",
|
|
3
|
-
"version": "4.13.
|
|
3
|
+
"version": "4.13.27",
|
|
4
4
|
"description": "A package encapsulating common code across neeto projects including initializers, utility functions, common components and hooks and so on.",
|
|
5
5
|
"repository": "git@github.com:bigbinary/neeto-commons-frontend.git",
|
|
6
6
|
"author": "Amaljith K <amaljith.k@bigbinary.com>",
|
package/react-utils.d.ts
CHANGED