mftsccs-browser 2.0.9-beta → 2.0.11-beta
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/main.bundle.js +258 -174
- package/dist/main.bundle.js.map +1 -1
- package/dist/serviceWorker.bundle.js +351 -197
- package/dist/serviceWorker.bundle.js.map +1 -1
- package/dist/types/AccessTracker/accessTracker.d.ts +1 -1
- package/dist/types/DataStructures/Count/CountInfo.d.ts +6 -0
- package/dist/types/Middleware/logger.service.d.ts +2 -0
- package/dist/types/Services/Common/DecodeCountInfo.d.ts +3 -0
- package/dist/types/Widgets/WidgetTree.d.ts +2 -0
- package/dist/types/app.d.ts +3 -0
- package/package.json +1 -1
|
@@ -93,10 +93,7 @@ class AccessTracker {
|
|
|
93
93
|
static sendToServer() {
|
|
94
94
|
return __awaiter(this, void 0, void 0, function* () {
|
|
95
95
|
try {
|
|
96
|
-
|
|
97
|
-
if (!accessToken)
|
|
98
|
-
return;
|
|
99
|
-
yield this.syncToServer(accessToken);
|
|
96
|
+
yield this.syncToServer();
|
|
100
97
|
}
|
|
101
98
|
catch (error) {
|
|
102
99
|
console.error("Failed to process Access Tracker Sync with Server");
|
|
@@ -106,16 +103,18 @@ class AccessTracker {
|
|
|
106
103
|
/**
|
|
107
104
|
* Syncs the concept and connection data with the server.
|
|
108
105
|
*/
|
|
109
|
-
static syncToServer(
|
|
106
|
+
static syncToServer() {
|
|
110
107
|
return __awaiter(this, void 0, void 0, function* () {
|
|
111
108
|
try {
|
|
112
109
|
if (!Object.keys(this.conceptsData).length && !Object.keys(this.connectionsData).length) {
|
|
113
110
|
return;
|
|
114
111
|
}
|
|
112
|
+
const accessToken = _DataStructures_Security_TokenStorage__WEBPACK_IMPORTED_MODULE_1__.TokenStorage.BearerAccessToken;
|
|
113
|
+
if (!accessToken)
|
|
114
|
+
return;
|
|
115
115
|
// Ensure conceptsData and connectionsData are not undefined or null
|
|
116
116
|
const conceptsToSend = this.conceptsData && Object.keys(this.conceptsData).length > 0 ? this.conceptsData : {};
|
|
117
117
|
const connectionsToSend = this.connectionsData && Object.keys(this.connectionsData).length > 0 ? this.connectionsData : {};
|
|
118
|
-
console.log("Access Tracker Sent to SERVER..", conceptsToSend, connectionsToSend);
|
|
119
118
|
const response = yield fetch(_app__WEBPACK_IMPORTED_MODULE_0__.BaseUrl.PostPrefetchConceptConnections(), {
|
|
120
119
|
method: 'POST',
|
|
121
120
|
headers: {
|
|
@@ -130,7 +129,7 @@ class AccessTracker {
|
|
|
130
129
|
if (!response.ok) {
|
|
131
130
|
throw new Error('Failed to sync data to the server.');
|
|
132
131
|
}
|
|
133
|
-
|
|
132
|
+
yield response.json();
|
|
134
133
|
this.conceptsData = {};
|
|
135
134
|
this.connectionsData = {};
|
|
136
135
|
this.setNextSyncTime();
|
|
@@ -154,13 +153,10 @@ class AccessTracker {
|
|
|
154
153
|
* This will automatically call `syncToServer` every 5 minutes
|
|
155
154
|
*/
|
|
156
155
|
static startAutoSync() {
|
|
157
|
-
const tokenString = _DataStructures_Security_TokenStorage__WEBPACK_IMPORTED_MODULE_1__.TokenStorage.BearerAccessToken;
|
|
158
|
-
if (tokenString) {
|
|
159
|
-
this.syncNow().catch(console.error);
|
|
160
|
-
}
|
|
161
156
|
setInterval(() => {
|
|
162
157
|
const currentTime = Date.now();
|
|
163
158
|
// console.log(`[CHECK] Current Time: ${new Date(currentTime).toISOString()}`);
|
|
159
|
+
// console.log(`Update Time: ${this.nextSyncTime}`);
|
|
164
160
|
if (this.nextSyncTime && currentTime >= this.nextSyncTime) {
|
|
165
161
|
// console.log(`[SYNC TRIGGER] Time to sync! Triggering sync at: ${new Date(currentTime).toISOString()}`);
|
|
166
162
|
this.syncNow().catch(console.error);
|
|
@@ -172,12 +168,17 @@ class AccessTracker {
|
|
|
172
168
|
*/
|
|
173
169
|
static syncNow() {
|
|
174
170
|
return __awaiter(this, void 0, void 0, function* () {
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
171
|
+
try {
|
|
172
|
+
// console.log("Status of Access Tracker is : ", this.activateStatus);
|
|
173
|
+
if (this.activateStatus) {
|
|
174
|
+
yield this.syncToServer();
|
|
175
|
+
}
|
|
176
|
+
else {
|
|
177
|
+
console.warn("Access Tracker inactive.");
|
|
178
|
+
}
|
|
178
179
|
}
|
|
179
|
-
|
|
180
|
-
console.
|
|
180
|
+
catch (error) {
|
|
181
|
+
console.error("Error on sync access tracker");
|
|
181
182
|
}
|
|
182
183
|
});
|
|
183
184
|
}
|
|
@@ -11378,7 +11379,6 @@ class ApplicationMonitor {
|
|
|
11378
11379
|
};
|
|
11379
11380
|
_logger_service__WEBPACK_IMPORTED_MODULE_1__.Logger.logApplication("INFO", "Network Request", networkDetails);
|
|
11380
11381
|
return originalFetch(...args);
|
|
11381
|
-
// return new Response(null, { status: 200 });
|
|
11382
11382
|
}
|
|
11383
11383
|
let networkDetails = {
|
|
11384
11384
|
"request": {
|
|
@@ -11653,6 +11653,8 @@ class Logger {
|
|
|
11653
11653
|
// this.saveLogToLocalStorage(this.mftsccsBrowser, logEntry)
|
|
11654
11654
|
}
|
|
11655
11655
|
static log(level, message, data) {
|
|
11656
|
+
if (!this.logPackageActivationStatus)
|
|
11657
|
+
return;
|
|
11656
11658
|
try {
|
|
11657
11659
|
Logger.formatLogData(level, message, data || null);
|
|
11658
11660
|
}
|
|
@@ -11661,87 +11663,109 @@ class Logger {
|
|
|
11661
11663
|
}
|
|
11662
11664
|
}
|
|
11663
11665
|
static logInfo(startTime, userId, operationType, requestFrom, requestIP, responseStatus, responseData, functionName, functionParameters, userAgent, conceptsUsed) {
|
|
11664
|
-
|
|
11665
|
-
|
|
11666
|
-
|
|
11667
|
-
|
|
11668
|
-
|
|
11669
|
-
|
|
11670
|
-
|
|
11671
|
-
|
|
11672
|
-
|
|
11673
|
-
|
|
11674
|
-
|
|
11675
|
-
|
|
11676
|
-
|
|
11677
|
-
|
|
11678
|
-
|
|
11679
|
-
|
|
11680
|
-
|
|
11681
|
-
|
|
11666
|
+
try {
|
|
11667
|
+
const sessionId = getCookie("SessionId");
|
|
11668
|
+
const responseTime = `${(performance.now() - startTime).toFixed(3)}ms`;
|
|
11669
|
+
const responseSize = responseData ? `${JSON.stringify(responseData).length}` : "0";
|
|
11670
|
+
const logData = {
|
|
11671
|
+
userId,
|
|
11672
|
+
operationType,
|
|
11673
|
+
requestFrom,
|
|
11674
|
+
requestIP,
|
|
11675
|
+
responseStatus,
|
|
11676
|
+
responseTime,
|
|
11677
|
+
responseSize,
|
|
11678
|
+
sessionId: sessionId === null || sessionId === void 0 ? void 0 : sessionId.toString(),
|
|
11679
|
+
functionName,
|
|
11680
|
+
functionParameters,
|
|
11681
|
+
userAgent,
|
|
11682
|
+
conceptsUsed,
|
|
11683
|
+
};
|
|
11684
|
+
Logger.log("INFO", `Information logged for ${functionName}`, logData);
|
|
11685
|
+
}
|
|
11686
|
+
catch (error) {
|
|
11687
|
+
console.error("Error on logInfo");
|
|
11688
|
+
}
|
|
11682
11689
|
}
|
|
11683
11690
|
static logError(startTime, userId, operationType, requestFrom, requestIP, responseStatus, responseData, functionName, functionParameters, userAgent, conceptsUsed) {
|
|
11684
|
-
|
|
11685
|
-
|
|
11686
|
-
|
|
11687
|
-
|
|
11688
|
-
|
|
11689
|
-
|
|
11690
|
-
|
|
11691
|
-
|
|
11692
|
-
|
|
11693
|
-
|
|
11694
|
-
|
|
11695
|
-
|
|
11696
|
-
|
|
11697
|
-
|
|
11698
|
-
|
|
11699
|
-
|
|
11700
|
-
|
|
11701
|
-
|
|
11691
|
+
try {
|
|
11692
|
+
const sessionId = getCookie("SessionId");
|
|
11693
|
+
const responseTime = `${(performance.now() - startTime).toFixed(3)}ms`;
|
|
11694
|
+
const responseSize = responseData ? `${JSON.stringify(responseData).length}` : "0";
|
|
11695
|
+
const logData = {
|
|
11696
|
+
userId,
|
|
11697
|
+
operationType,
|
|
11698
|
+
requestFrom,
|
|
11699
|
+
requestIP,
|
|
11700
|
+
responseStatus,
|
|
11701
|
+
responseTime,
|
|
11702
|
+
responseSize,
|
|
11703
|
+
sessionId: sessionId === null || sessionId === void 0 ? void 0 : sessionId.toString(),
|
|
11704
|
+
functionName,
|
|
11705
|
+
functionParameters,
|
|
11706
|
+
userAgent,
|
|
11707
|
+
conceptsUsed,
|
|
11708
|
+
};
|
|
11709
|
+
Logger.formatLogData("ERROR", `Information logged for ${functionName}`, logData);
|
|
11710
|
+
}
|
|
11711
|
+
catch (error) {
|
|
11712
|
+
console.error("Error on logError");
|
|
11713
|
+
}
|
|
11702
11714
|
}
|
|
11703
11715
|
static logWarning(startTime, userId, operationType, requestFrom, requestIP, responseStatus, responseData, functionName, functionParameters, userAgent, conceptsUsed) {
|
|
11704
|
-
|
|
11705
|
-
|
|
11706
|
-
|
|
11707
|
-
|
|
11708
|
-
|
|
11709
|
-
|
|
11710
|
-
|
|
11711
|
-
|
|
11712
|
-
|
|
11713
|
-
|
|
11714
|
-
|
|
11715
|
-
|
|
11716
|
-
|
|
11717
|
-
|
|
11718
|
-
|
|
11719
|
-
|
|
11720
|
-
|
|
11721
|
-
|
|
11716
|
+
try {
|
|
11717
|
+
const sessionId = getCookie("SessionId");
|
|
11718
|
+
const responseTime = `${(performance.now() - startTime).toFixed(3)}ms`;
|
|
11719
|
+
const responseSize = responseData ? `${JSON.stringify(responseData).length}` : "0";
|
|
11720
|
+
const logData = {
|
|
11721
|
+
userId,
|
|
11722
|
+
operationType,
|
|
11723
|
+
requestFrom,
|
|
11724
|
+
requestIP,
|
|
11725
|
+
responseStatus,
|
|
11726
|
+
responseTime,
|
|
11727
|
+
responseSize,
|
|
11728
|
+
sessionId: sessionId === null || sessionId === void 0 ? void 0 : sessionId.toString(),
|
|
11729
|
+
functionName,
|
|
11730
|
+
functionParameters,
|
|
11731
|
+
userAgent,
|
|
11732
|
+
conceptsUsed,
|
|
11733
|
+
};
|
|
11734
|
+
Logger.formatLogData("WARNING", `Information logged for ${functionName}`, logData);
|
|
11735
|
+
}
|
|
11736
|
+
catch (error) {
|
|
11737
|
+
console.error("Error on logWarning");
|
|
11738
|
+
}
|
|
11722
11739
|
}
|
|
11723
11740
|
static logDebug(startTime, userId, operationType, requestFrom, requestIP, responseStatus, responseData, functionName, functionParameters, userAgent, conceptsUsed) {
|
|
11724
|
-
|
|
11725
|
-
|
|
11726
|
-
|
|
11727
|
-
|
|
11728
|
-
|
|
11729
|
-
|
|
11730
|
-
|
|
11731
|
-
|
|
11732
|
-
|
|
11733
|
-
|
|
11734
|
-
|
|
11735
|
-
|
|
11736
|
-
|
|
11737
|
-
|
|
11738
|
-
|
|
11739
|
-
|
|
11740
|
-
|
|
11741
|
-
|
|
11741
|
+
try {
|
|
11742
|
+
const sessionId = getCookie("SessionId");
|
|
11743
|
+
const responseTime = `${(performance.now() - startTime).toFixed(3)}ms`;
|
|
11744
|
+
const responseSize = responseData ? `${JSON.stringify(responseData).length}` : "0";
|
|
11745
|
+
const logData = {
|
|
11746
|
+
userId,
|
|
11747
|
+
operationType,
|
|
11748
|
+
requestFrom,
|
|
11749
|
+
requestIP,
|
|
11750
|
+
responseStatus,
|
|
11751
|
+
responseTime,
|
|
11752
|
+
responseSize,
|
|
11753
|
+
sessionId: sessionId === null || sessionId === void 0 ? void 0 : sessionId.toString(),
|
|
11754
|
+
functionName,
|
|
11755
|
+
functionParameters,
|
|
11756
|
+
userAgent,
|
|
11757
|
+
conceptsUsed,
|
|
11758
|
+
};
|
|
11759
|
+
Logger.formatLogData("DEBUG", `Information logged for ${functionName}`, logData);
|
|
11760
|
+
}
|
|
11761
|
+
catch (error) {
|
|
11762
|
+
console.error("Error on logDebug");
|
|
11763
|
+
}
|
|
11742
11764
|
}
|
|
11743
11765
|
// Log Application Activity
|
|
11744
11766
|
static logApplication(type, message, data) {
|
|
11767
|
+
if (!this.logApplicationActivationStatus)
|
|
11768
|
+
return;
|
|
11745
11769
|
try {
|
|
11746
11770
|
const timestamp = new Date().toLocaleString();
|
|
11747
11771
|
const logEntry = {
|
|
@@ -11763,18 +11787,13 @@ class Logger {
|
|
|
11763
11787
|
static sendApplicationLogsToServer() {
|
|
11764
11788
|
return __awaiter(this, void 0, void 0, function* () {
|
|
11765
11789
|
try {
|
|
11766
|
-
|
|
11767
|
-
// console.log("Log To Server : \n", this.applicationLogsData);
|
|
11768
|
-
if (this.applicationLogsData.length < 0) {
|
|
11790
|
+
if (this.applicationLogsData.length === 0) {
|
|
11769
11791
|
return;
|
|
11770
11792
|
}
|
|
11771
11793
|
const accessToken = _DataStructures_Security_TokenStorage__WEBPACK_IMPORTED_MODULE_1__.TokenStorage.BearerAccessToken;
|
|
11772
|
-
const storedLogs = this.applicationLogsData;
|
|
11773
|
-
console.log("Application Logs of AppLog : ", storedLogs);
|
|
11774
11794
|
if (!accessToken)
|
|
11775
11795
|
return;
|
|
11776
|
-
|
|
11777
|
-
return;
|
|
11796
|
+
const storedLogs = this.applicationLogsData;
|
|
11778
11797
|
const chunkSize = 50;
|
|
11779
11798
|
for (let i = 0; i < storedLogs.length; i += chunkSize) {
|
|
11780
11799
|
const chunk = storedLogs.slice(i, i + chunkSize);
|
|
@@ -11797,8 +11816,6 @@ class Logger {
|
|
|
11797
11816
|
}
|
|
11798
11817
|
// clear application log from memory
|
|
11799
11818
|
this.applicationLogsData = [];
|
|
11800
|
-
// this.clearLogsFromLocalStorage(this.appLogs)
|
|
11801
|
-
// Logger.log("INFO", "Sync Application Logs to server")
|
|
11802
11819
|
}
|
|
11803
11820
|
catch (error) {
|
|
11804
11821
|
console.error("Error while sending logs to server:", error);
|
|
@@ -11808,18 +11825,15 @@ class Logger {
|
|
|
11808
11825
|
static sendLogsToServer() {
|
|
11809
11826
|
return __awaiter(this, void 0, void 0, function* () {
|
|
11810
11827
|
try {
|
|
11811
|
-
console.warn("Log sending to server...");
|
|
11812
|
-
// console.log("Log To Server : \n", this.logsData);
|
|
11813
11828
|
if (this.logsData.length === 0)
|
|
11814
11829
|
return;
|
|
11830
|
+
if (this.logsData.length === 0) {
|
|
11831
|
+
return;
|
|
11832
|
+
}
|
|
11815
11833
|
const accessToken = _DataStructures_Security_TokenStorage__WEBPACK_IMPORTED_MODULE_1__.TokenStorage.BearerAccessToken;
|
|
11816
|
-
const storedLogs = this.logsData;
|
|
11817
|
-
console.log("Package Logs for syncing... ", storedLogs);
|
|
11818
11834
|
if (!accessToken)
|
|
11819
11835
|
return;
|
|
11820
|
-
|
|
11821
|
-
if (storedLogs.length === 0)
|
|
11822
|
-
return;
|
|
11836
|
+
const storedLogs = this.logsData;
|
|
11823
11837
|
const chunkSize = 50;
|
|
11824
11838
|
for (let i = 0; i < storedLogs.length; i += chunkSize) {
|
|
11825
11839
|
const chunk = storedLogs.slice(i, i + chunkSize);
|
|
@@ -11842,8 +11856,6 @@ class Logger {
|
|
|
11842
11856
|
}
|
|
11843
11857
|
// clear mftsccs log from memory
|
|
11844
11858
|
this.logsData = [];
|
|
11845
|
-
// this.clearLogsFromLocalStorage(this.mftsccsBrowser)
|
|
11846
|
-
// Logger.log("INFO", "Sync Application Logs to server")
|
|
11847
11859
|
}
|
|
11848
11860
|
catch (error) {
|
|
11849
11861
|
console.error("Error while sending logs to server:", error);
|
|
@@ -11889,6 +11901,8 @@ Logger.SYNC_INTERVAL_MS = 120 * 1000; // 120 Sec
|
|
|
11889
11901
|
Logger.nextSyncTime = null;
|
|
11890
11902
|
Logger.appLogs = "app";
|
|
11891
11903
|
Logger.mftsccsBrowser = "mftsccs";
|
|
11904
|
+
Logger.logApplicationActivationStatus = false;
|
|
11905
|
+
Logger.logPackageActivationStatus = false;
|
|
11892
11906
|
// Private auto-sync interval management
|
|
11893
11907
|
Logger.autoSyncInterval = null;
|
|
11894
11908
|
// Ensure logs are managed automatically
|
|
@@ -11901,19 +11915,25 @@ Logger.autoSyncInterval = null;
|
|
|
11901
11915
|
* @returns Cookie value
|
|
11902
11916
|
*/
|
|
11903
11917
|
function getCookie(cname) {
|
|
11904
|
-
|
|
11905
|
-
|
|
11906
|
-
|
|
11907
|
-
|
|
11908
|
-
let
|
|
11909
|
-
|
|
11910
|
-
|
|
11911
|
-
|
|
11912
|
-
|
|
11913
|
-
|
|
11918
|
+
try {
|
|
11919
|
+
let name = cname + "=";
|
|
11920
|
+
let decodedCookie = decodeURIComponent(document.cookie);
|
|
11921
|
+
let ca = decodedCookie.split(';');
|
|
11922
|
+
for (let i = 0; i < ca.length; i++) {
|
|
11923
|
+
let c = ca[i];
|
|
11924
|
+
while (c.charAt(0) == ' ') {
|
|
11925
|
+
c = c.substring(1);
|
|
11926
|
+
}
|
|
11927
|
+
if (c.indexOf(name) == 0) {
|
|
11928
|
+
return c.substring(name.length, c.length);
|
|
11929
|
+
}
|
|
11914
11930
|
}
|
|
11931
|
+
return "";
|
|
11932
|
+
}
|
|
11933
|
+
catch (error) {
|
|
11934
|
+
console.error("Error on getcookie");
|
|
11935
|
+
return "";
|
|
11915
11936
|
}
|
|
11916
|
-
return "";
|
|
11917
11937
|
}
|
|
11918
11938
|
|
|
11919
11939
|
|
|
@@ -21989,6 +22009,8 @@ class WidgetTree {
|
|
|
21989
22009
|
this.after_render = "";
|
|
21990
22010
|
this.before_render = "";
|
|
21991
22011
|
this.update = "";
|
|
22012
|
+
this.origin = 0;
|
|
22013
|
+
this.version = 0;
|
|
21992
22014
|
this.mount_child = "";
|
|
21993
22015
|
this.children = [];
|
|
21994
22016
|
this.wrapper = 0;
|
|
@@ -23178,12 +23200,14 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
23178
23200
|
/* harmony export */ getFromDatabaseWithType: () => (/* reexport safe */ _Database_NoIndexDb__WEBPACK_IMPORTED_MODULE_15__.getFromDatabaseWithType),
|
|
23179
23201
|
/* harmony export */ getObjectsFromIndexDb: () => (/* reexport safe */ _Database_NoIndexDb__WEBPACK_IMPORTED_MODULE_15__.getObjectsFromIndexDb),
|
|
23180
23202
|
/* harmony export */ handleServiceWorkerException: () => (/* binding */ handleServiceWorkerException),
|
|
23203
|
+
/* harmony export */ hasActivatedSW: () => (/* binding */ hasActivatedSW),
|
|
23181
23204
|
/* harmony export */ init: () => (/* binding */ init),
|
|
23182
23205
|
/* harmony export */ recursiveFetch: () => (/* reexport safe */ _Services_GetComposition__WEBPACK_IMPORTED_MODULE_7__.recursiveFetch),
|
|
23183
23206
|
/* harmony export */ recursiveFetchNew: () => (/* reexport safe */ _Services_Composition_BuildComposition__WEBPACK_IMPORTED_MODULE_45__.recursiveFetchNew),
|
|
23184
23207
|
/* harmony export */ searchLinkMultipleListener: () => (/* reexport safe */ _WrapperFunctions_SearchLinkMultipleAllObservable__WEBPACK_IMPORTED_MODULE_69__.searchLinkMultipleListener),
|
|
23185
23208
|
/* harmony export */ sendMessage: () => (/* binding */ sendMessage),
|
|
23186
23209
|
/* harmony export */ serviceWorker: () => (/* binding */ serviceWorker),
|
|
23210
|
+
/* harmony export */ setHasActivatedSW: () => (/* binding */ setHasActivatedSW),
|
|
23187
23211
|
/* harmony export */ storeToDatabase: () => (/* reexport safe */ _Database_NoIndexDb__WEBPACK_IMPORTED_MODULE_15__.storeToDatabase),
|
|
23188
23212
|
/* harmony export */ subscribedListeners: () => (/* binding */ subscribedListeners),
|
|
23189
23213
|
/* harmony export */ updateAccessToken: () => (/* binding */ updateAccessToken)
|
|
@@ -23442,6 +23466,7 @@ var __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _argume
|
|
|
23442
23466
|
|
|
23443
23467
|
|
|
23444
23468
|
|
|
23469
|
+
|
|
23445
23470
|
|
|
23446
23471
|
|
|
23447
23472
|
var serviceWorker;
|
|
@@ -23449,6 +23474,10 @@ const TABID = Date.now().toString(36) + Math.random().toString(36).substring(2);
|
|
|
23449
23474
|
let subscribedListeners = [];
|
|
23450
23475
|
let serviceWorkerReady = false;
|
|
23451
23476
|
let messageQueue = [];
|
|
23477
|
+
// for sw use only START
|
|
23478
|
+
let hasActivatedSW = false;
|
|
23479
|
+
function setHasActivatedSW(value) { hasActivatedSW = value; }
|
|
23480
|
+
// for sw use only END
|
|
23452
23481
|
/**
|
|
23453
23482
|
* This function lets you update the access token that the package uses. If this is not passed you cannot create, update, view or delete
|
|
23454
23483
|
* Your concepts using this package.
|
|
@@ -23471,7 +23500,7 @@ function updateAccessToken(accessToken = "") {
|
|
|
23471
23500
|
* @param enableSW {activate: boolean, scope?: string, pathToSW?: string, manual?: boolean} | undefined - This is for enabling service worker with its scope
|
|
23472
23501
|
*/
|
|
23473
23502
|
function init() {
|
|
23474
|
-
return __awaiter(this, arguments, void 0, function* (url = "", aiurl = "", accessToken = "", nodeUrl = "", enableAi = true, applicationName = "", enableSW = undefined, flag = { logApplication: false, accessTracker: false, isTest: false }) {
|
|
23503
|
+
return __awaiter(this, arguments, void 0, function* (url = "", aiurl = "", accessToken = "", nodeUrl = "", enableAi = true, applicationName = "", enableSW = undefined, flag = { logApplication: false, logPackage: false, accessTracker: false, isTest: false }) {
|
|
23475
23504
|
try {
|
|
23476
23505
|
_DataStructures_BaseUrl__WEBPACK_IMPORTED_MODULE_98__.BaseUrl.BASE_URL = url;
|
|
23477
23506
|
_DataStructures_BaseUrl__WEBPACK_IMPORTED_MODULE_98__.BaseUrl.AI_URL = aiurl;
|
|
@@ -23494,19 +23523,31 @@ function init() {
|
|
|
23494
23523
|
_DataStructures_IdentifierFlags__WEBPACK_IMPORTED_MODULE_1__.IdentifierFlags.isLocalConnectionLoaded = true;
|
|
23495
23524
|
return true;
|
|
23496
23525
|
}
|
|
23497
|
-
|
|
23498
|
-
|
|
23499
|
-
|
|
23526
|
+
// Flag setup
|
|
23527
|
+
try {
|
|
23528
|
+
if (flag.logApplication) {
|
|
23529
|
+
_Middleware_ApplicationMonitor__WEBPACK_IMPORTED_MODULE_103__.ApplicationMonitor.initialize();
|
|
23530
|
+
_app__WEBPACK_IMPORTED_MODULE_105__.Logger.logApplicationActivationStatus = true;
|
|
23531
|
+
console.warn("Application log started...");
|
|
23532
|
+
}
|
|
23533
|
+
if (flag.logPackage) {
|
|
23534
|
+
_app__WEBPACK_IMPORTED_MODULE_105__.Logger.logPackageActivationStatus = true;
|
|
23535
|
+
console.warn("Package log started...");
|
|
23536
|
+
}
|
|
23537
|
+
if (flag.accessTracker) {
|
|
23538
|
+
_app__WEBPACK_IMPORTED_MODULE_105__.AccessTracker.activateStatus = true;
|
|
23539
|
+
console.warn("Access Tracker Activated...");
|
|
23540
|
+
}
|
|
23500
23541
|
}
|
|
23501
|
-
|
|
23502
|
-
|
|
23503
|
-
console.warn("Access Tracker Activated...");
|
|
23542
|
+
catch (error) {
|
|
23543
|
+
console.error("Flag setup failed in init");
|
|
23504
23544
|
}
|
|
23505
23545
|
if (!("serviceWorker" in navigator)) {
|
|
23506
23546
|
yield initConceptConnection();
|
|
23507
23547
|
console.warn("Service Worker not supported in this browser.");
|
|
23508
23548
|
return;
|
|
23509
23549
|
}
|
|
23550
|
+
listenPostMessagaes();
|
|
23510
23551
|
listenBroadCastMessages();
|
|
23511
23552
|
if (enableSW && enableSW.activate && enableSW.manual) {
|
|
23512
23553
|
yield new Promise((resolve, reject) => {
|
|
@@ -23572,48 +23613,45 @@ function init() {
|
|
|
23572
23613
|
.then((registration) => __awaiter(this, void 0, void 0, function* () {
|
|
23573
23614
|
console.log("Service Worker registered:", registration);
|
|
23574
23615
|
// If the service worker is already active, mark it as ready
|
|
23575
|
-
if (registration.active) {
|
|
23576
|
-
|
|
23577
|
-
|
|
23578
|
-
|
|
23579
|
-
|
|
23580
|
-
|
|
23581
|
-
|
|
23582
|
-
|
|
23583
|
-
|
|
23584
|
-
|
|
23585
|
-
|
|
23586
|
-
|
|
23587
|
-
|
|
23588
|
-
|
|
23589
|
-
|
|
23590
|
-
}
|
|
23591
|
-
|
|
23592
|
-
|
|
23593
|
-
|
|
23594
|
-
|
|
23595
|
-
|
|
23596
|
-
}, 5000);
|
|
23597
|
-
}
|
|
23616
|
+
// if (registration.active) {
|
|
23617
|
+
// serviceWorkerReady = true;
|
|
23618
|
+
// console.log("active sw");
|
|
23619
|
+
// serviceWorker = registration.active;
|
|
23620
|
+
// await sendMessage("init", {
|
|
23621
|
+
// url,
|
|
23622
|
+
// aiurl,
|
|
23623
|
+
// accessToken,
|
|
23624
|
+
// nodeUrl,
|
|
23625
|
+
// enableAi,
|
|
23626
|
+
// applicationName,
|
|
23627
|
+
// flag
|
|
23628
|
+
// });
|
|
23629
|
+
// processMessageQueue();
|
|
23630
|
+
// resolve();
|
|
23631
|
+
// } else {
|
|
23632
|
+
// // Handle if on state change didn't trigger
|
|
23633
|
+
// setTimeout(() => {
|
|
23634
|
+
// if (!success) reject("Not Completed Initialization");
|
|
23635
|
+
// }, 5000);
|
|
23636
|
+
// }
|
|
23598
23637
|
// state change
|
|
23599
|
-
if (registration.installing || registration.waiting || registration.active) {
|
|
23600
|
-
|
|
23601
|
-
|
|
23602
|
-
|
|
23603
|
-
|
|
23604
|
-
|
|
23605
|
-
|
|
23606
|
-
|
|
23607
|
-
|
|
23608
|
-
|
|
23609
|
-
|
|
23610
|
-
|
|
23611
|
-
|
|
23612
|
-
|
|
23613
|
-
|
|
23614
|
-
|
|
23615
|
-
|
|
23616
|
-
}
|
|
23638
|
+
// if (registration.installing || registration.waiting || registration.active) {
|
|
23639
|
+
// registration.addEventListener('statechange', async (event: any) => {
|
|
23640
|
+
// if (event?.target?.state === 'activating') {
|
|
23641
|
+
// serviceWorker = navigator.serviceWorker.controller
|
|
23642
|
+
// console.log('Service Worker is activating statechange');
|
|
23643
|
+
// await sendMessage("init", {
|
|
23644
|
+
// url,
|
|
23645
|
+
// aiurl,
|
|
23646
|
+
// accessToken,
|
|
23647
|
+
// nodeUrl,
|
|
23648
|
+
// enableAi,
|
|
23649
|
+
// applicationName,
|
|
23650
|
+
// flag
|
|
23651
|
+
// });
|
|
23652
|
+
// }
|
|
23653
|
+
// });
|
|
23654
|
+
// }
|
|
23617
23655
|
// Add Listeners before initializing the service worker
|
|
23618
23656
|
// Listen for updates to the service worker
|
|
23619
23657
|
console.log("update listen start");
|
|
@@ -23622,7 +23660,7 @@ function init() {
|
|
|
23622
23660
|
console.log("new worker", newWorker);
|
|
23623
23661
|
if (newWorker) {
|
|
23624
23662
|
newWorker.onstatechange = () => __awaiter(this, void 0, void 0, function* () {
|
|
23625
|
-
console.
|
|
23663
|
+
console.warn("on state change triggered", (newWorker.state === "installed" || newWorker.state === "activated" || newWorker.state === 'redundant'), navigator.serviceWorker.controller);
|
|
23626
23664
|
if (newWorker.state === "installing") {
|
|
23627
23665
|
console.log("Service Worker installing");
|
|
23628
23666
|
serviceWorker = undefined;
|
|
@@ -23657,7 +23695,7 @@ function init() {
|
|
|
23657
23695
|
console.warn('controller change triggered', navigator.serviceWorker.controller);
|
|
23658
23696
|
if (navigator.serviceWorker.controller) {
|
|
23659
23697
|
serviceWorker = navigator.serviceWorker.controller;
|
|
23660
|
-
console.
|
|
23698
|
+
console.warn('Service worker has been activated; controller change');
|
|
23661
23699
|
yield sendMessage("init", {
|
|
23662
23700
|
url,
|
|
23663
23701
|
aiurl,
|
|
@@ -23677,7 +23715,7 @@ function init() {
|
|
|
23677
23715
|
var _a;
|
|
23678
23716
|
if (((_a = event === null || event === void 0 ? void 0 : event.target) === null || _a === void 0 ? void 0 : _a.state) === 'activating') {
|
|
23679
23717
|
serviceWorker = navigator.serviceWorker.controller;
|
|
23680
|
-
console.
|
|
23718
|
+
console.warn('Service Worker is activating statechange');
|
|
23681
23719
|
yield sendMessage("init", {
|
|
23682
23720
|
url,
|
|
23683
23721
|
aiurl,
|
|
@@ -23712,7 +23750,7 @@ function init() {
|
|
|
23712
23750
|
setTimeout(() => {
|
|
23713
23751
|
if (!success)
|
|
23714
23752
|
reject("Not Completed Initialization");
|
|
23715
|
-
},
|
|
23753
|
+
}, 10000);
|
|
23716
23754
|
}
|
|
23717
23755
|
}))
|
|
23718
23756
|
.catch((error) => __awaiter(this, void 0, void 0, function* () {
|
|
@@ -23760,6 +23798,7 @@ function sendMessage(type, payload) {
|
|
|
23760
23798
|
return new Promise((resolve, reject) => {
|
|
23761
23799
|
// navigator.serviceWorker.ready
|
|
23762
23800
|
// .then((registration) => {
|
|
23801
|
+
console.debug('debug', navigator.serviceWorker.controller, serviceWorker, serviceWorkerReady, type == 'init');
|
|
23763
23802
|
if ((navigator.serviceWorker.controller || serviceWorker) && (serviceWorkerReady || type == 'init')) {
|
|
23764
23803
|
const responseHandler = (event) => {
|
|
23765
23804
|
var _a, _b, _c, _d, _e, _f;
|
|
@@ -23798,7 +23837,7 @@ function sendMessage(type, payload) {
|
|
|
23798
23837
|
serviceWorker.postMessage({ type, payload: newPayload });
|
|
23799
23838
|
}
|
|
23800
23839
|
catch (err) {
|
|
23801
|
-
console.log(err);
|
|
23840
|
+
console.log('Retrying again on catch service worker', err);
|
|
23802
23841
|
// serviceWorker.postMessage({ type, payload: newPayload });
|
|
23803
23842
|
serviceWorker.postMessage({ type, payload: newPayload });
|
|
23804
23843
|
}
|
|
@@ -23808,6 +23847,7 @@ function sendMessage(type, payload) {
|
|
|
23808
23847
|
console.warn(`Service Worker hasn't loaded yet. messageId: ${messageId}, type: ${type}`);
|
|
23809
23848
|
if (serviceWorkerReady)
|
|
23810
23849
|
console.warn('service worker was registered already but is not available NOW!!!');
|
|
23850
|
+
console.info('ready', navigator.serviceWorker.ready);
|
|
23811
23851
|
// wait one second before checking again
|
|
23812
23852
|
setTimeout(() => {
|
|
23813
23853
|
console.warn(`Re-Trying after certain time. messageId: ${messageId}, type: ${type}`);
|
|
@@ -23827,7 +23867,7 @@ function sendMessage(type, payload) {
|
|
|
23827
23867
|
setTimeout(() => {
|
|
23828
23868
|
reject(`No response from service worker after timeout: ${type}`);
|
|
23829
23869
|
navigator.serviceWorker.removeEventListener("message", responseHandler);
|
|
23830
|
-
},
|
|
23870
|
+
}, 210000); // 3.5 minutes
|
|
23831
23871
|
}
|
|
23832
23872
|
else {
|
|
23833
23873
|
messageQueue.push({ message: { type, payload: newPayload } });
|
|
@@ -23902,7 +23942,47 @@ function listenBroadCastMessages() {
|
|
|
23902
23942
|
responseData = yield broadcastActions[type](payload);
|
|
23903
23943
|
}
|
|
23904
23944
|
else {
|
|
23905
|
-
console.
|
|
23945
|
+
console.warn(`Unable to handle "${type}" case in BC service worker`);
|
|
23946
|
+
}
|
|
23947
|
+
}));
|
|
23948
|
+
}
|
|
23949
|
+
/**
|
|
23950
|
+
* Method to trigger broadcast message listener
|
|
23951
|
+
*/
|
|
23952
|
+
function listenPostMessagaes() {
|
|
23953
|
+
// broadcast event can be listened through both the service worker and other tabs
|
|
23954
|
+
navigator.serviceWorker.addEventListener('message', (event) => __awaiter(this, void 0, void 0, function* () {
|
|
23955
|
+
var _a, _b, _c, _d;
|
|
23956
|
+
try {
|
|
23957
|
+
if (event.data && event.data.type === 'API_401') {
|
|
23958
|
+
const { requestDetails } = event.data;
|
|
23959
|
+
// Re-create the POST request with the same headers and body
|
|
23960
|
+
const requestOptions = {
|
|
23961
|
+
method: requestDetails.method,
|
|
23962
|
+
headers: new Headers(requestDetails.headers),
|
|
23963
|
+
body: requestDetails.body // Pass the original body
|
|
23964
|
+
};
|
|
23965
|
+
// Re-hit the API with the same details
|
|
23966
|
+
const apiResponse = yield fetch(requestDetails.url, requestOptions);
|
|
23967
|
+
const responseBody = yield (apiResponse === null || apiResponse === void 0 ? void 0 : apiResponse.json()); // Get the response text
|
|
23968
|
+
// Send the response back to the Service Worker (same client)
|
|
23969
|
+
(_b = (_a = navigator === null || navigator === void 0 ? void 0 : navigator.serviceWorker) === null || _a === void 0 ? void 0 : _a.controller) === null || _b === void 0 ? void 0 : _b.postMessage({
|
|
23970
|
+
type: 'API_RESPONSE',
|
|
23971
|
+
messageId: event.data.messageId,
|
|
23972
|
+
response: new Response(responseBody, {
|
|
23973
|
+
status: apiResponse.status,
|
|
23974
|
+
statusText: apiResponse.statusText,
|
|
23975
|
+
headers: apiResponse.headers
|
|
23976
|
+
})
|
|
23977
|
+
});
|
|
23978
|
+
}
|
|
23979
|
+
}
|
|
23980
|
+
catch (error) {
|
|
23981
|
+
console.error("Error during listenPostMessage", error);
|
|
23982
|
+
(_d = (_c = navigator === null || navigator === void 0 ? void 0 : navigator.serviceWorker) === null || _c === void 0 ? void 0 : _c.controller) === null || _d === void 0 ? void 0 : _d.postMessage({
|
|
23983
|
+
type: 'API_RESPONSE',
|
|
23984
|
+
messageId: event.data.messageId
|
|
23985
|
+
});
|
|
23906
23986
|
}
|
|
23907
23987
|
}));
|
|
23908
23988
|
}
|
|
@@ -24031,10 +24111,12 @@ function processMessageQueue() {
|
|
|
24031
24111
|
});
|
|
24032
24112
|
}
|
|
24033
24113
|
const handleServiceWorkerException = (error) => {
|
|
24114
|
+
// if (error instanceof FreeSchemaResponse && error.getStatus() != 401) {
|
|
24034
24115
|
if (error instanceof _DataStructures_Responses_ErrorResponse__WEBPACK_IMPORTED_MODULE_104__.FreeSchemaResponse) {
|
|
24035
24116
|
console.error('FreeSchemaResponse Error', error);
|
|
24036
24117
|
throw error;
|
|
24037
24118
|
}
|
|
24119
|
+
// if (error instanceof FreeSchemaResponse && error.getStatus() == 401) console.error('401 triggered in sw defaulting')
|
|
24038
24120
|
console.error('Service Worker Error', error);
|
|
24039
24121
|
};
|
|
24040
24122
|
|
|
@@ -24140,6 +24222,7 @@ self.addEventListener("install", (event) => {
|
|
|
24140
24222
|
});
|
|
24141
24223
|
// Activate Service Worker
|
|
24142
24224
|
self.addEventListener("activate", (event) => __awaiter(void 0, void 0, void 0, function* () {
|
|
24225
|
+
yield (0,_app__WEBPACK_IMPORTED_MODULE_0__.setHasActivatedSW)(true);
|
|
24143
24226
|
console.log("Service Worker activating... sw");
|
|
24144
24227
|
// Using event.waitUntil to wait for the Promise to resolve
|
|
24145
24228
|
event.waitUntil(new Promise((resolve, reject) => {
|
|
@@ -24158,28 +24241,12 @@ self.addEventListener("activate", (event) => __awaiter(void 0, void 0, void 0, f
|
|
|
24158
24241
|
}));
|
|
24159
24242
|
}));
|
|
24160
24243
|
// Handle 401 in service worker
|
|
24161
|
-
//
|
|
24162
|
-
|
|
24163
|
-
|
|
24164
|
-
|
|
24165
|
-
|
|
24166
|
-
|
|
24167
|
-
// event.source.postMessage({success: false, data: {status: 401, statusText: response.statusText}, messageId: event?.payload?.messageId})
|
|
24168
|
-
// // (self as any).clients.matchAll().then((clients: any) => {
|
|
24169
|
-
// // clients.forEach((client: any) => {
|
|
24170
|
-
// // client.postMessage({ type: 'auth-error', message: 'Unauthorized' });
|
|
24171
|
-
// // });
|
|
24172
|
-
// // });
|
|
24173
|
-
// }
|
|
24174
|
-
// return response;
|
|
24175
|
-
// })
|
|
24176
|
-
// .catch(error => {
|
|
24177
|
-
// console.error('Network error: ', error)
|
|
24178
|
-
// // Handle network errors
|
|
24179
|
-
// return new Response('Network error', { status: 500 });
|
|
24180
|
-
// })
|
|
24181
|
-
// );
|
|
24182
|
-
// });
|
|
24244
|
+
// Fetch event listener
|
|
24245
|
+
self.addEventListener('fetch', (event) => {
|
|
24246
|
+
if (!event.clientId) {
|
|
24247
|
+
event.respondWith(handleInterceptRequest(event));
|
|
24248
|
+
}
|
|
24249
|
+
});
|
|
24183
24250
|
// For Caching gives the event when fetch request is triggered
|
|
24184
24251
|
// self.addEventListener('fetch', (event: any) => {
|
|
24185
24252
|
// console.log('Fetching: sw', event.request.url);
|
|
@@ -24209,7 +24276,26 @@ self.addEventListener("message", (event) => __awaiter(void 0, void 0, void 0, fu
|
|
|
24209
24276
|
return;
|
|
24210
24277
|
if (type != 'init' && !checkSWInitialization()) {
|
|
24211
24278
|
console.warn('Message received before sw initialization', type);
|
|
24212
|
-
|
|
24279
|
+
// wait for init to complete
|
|
24280
|
+
yield new Promise((resolve) => {
|
|
24281
|
+
let count = 1;
|
|
24282
|
+
const interval = setInterval(() => {
|
|
24283
|
+
if (TSCCS_init) {
|
|
24284
|
+
clearInterval(interval);
|
|
24285
|
+
resolve(undefined);
|
|
24286
|
+
}
|
|
24287
|
+
else {
|
|
24288
|
+
console.warn(`Watring for init ${count}:`, type);
|
|
24289
|
+
}
|
|
24290
|
+
}, 200); // check every 200ms
|
|
24291
|
+
setTimeout(() => {
|
|
24292
|
+
console.warn('Tried waiting for init but couldn\'t complete in time: ', type);
|
|
24293
|
+
clearInterval(interval);
|
|
24294
|
+
resolve(undefined);
|
|
24295
|
+
}, 90000); // 1.5 minute
|
|
24296
|
+
});
|
|
24297
|
+
if (!TSCCS_init)
|
|
24298
|
+
event.source.postMessage(responseData);
|
|
24213
24299
|
}
|
|
24214
24300
|
if (!tabActionsMap.has(tabId))
|
|
24215
24301
|
tabActionsMap.set(tabId, { concepts: [], connections: [] });
|
|
@@ -24260,7 +24346,7 @@ self.addEventListener("message", (event) => __awaiter(void 0, void 0, void 0, fu
|
|
|
24260
24346
|
event.source.postMessage(responseData);
|
|
24261
24347
|
}
|
|
24262
24348
|
catch (error) {
|
|
24263
|
-
console.
|
|
24349
|
+
console.error('Service worker Message Handle Error: ', type, error);
|
|
24264
24350
|
if ((error === null || error === void 0 ? void 0 : error.status) == 401 || (error === null || error === void 0 ? void 0 : error.status) == 500) {
|
|
24265
24351
|
responseData = { success: false, data: { status: error.status, statusText: error === null || error === void 0 ? void 0 : error.url }, messageId: payload.messageId };
|
|
24266
24352
|
}
|
|
@@ -24398,6 +24484,74 @@ const checkSWInitialization = () => {
|
|
|
24398
24484
|
}
|
|
24399
24485
|
return true;
|
|
24400
24486
|
};
|
|
24487
|
+
// let refreshingToken = false;
|
|
24488
|
+
// let refreshTokenPromise;
|
|
24489
|
+
const handleInterceptRequest = (event) => __awaiter(void 0, void 0, void 0, function* () {
|
|
24490
|
+
try {
|
|
24491
|
+
const response = yield fetch(event.request);
|
|
24492
|
+
// If the response is 401 (Unauthorized), send it back to the main thread
|
|
24493
|
+
if (response.status === 401) {
|
|
24494
|
+
const messageId = Math.random().toString(36).substring(2);
|
|
24495
|
+
event.waitUntil(
|
|
24496
|
+
// (self as any).clients.matchAll().then((clients: any) => {
|
|
24497
|
+
// clients.forEach(async (client: any) => {
|
|
24498
|
+
// client.postMessage({
|
|
24499
|
+
event.source.postMessage({
|
|
24500
|
+
type: 'API_401',
|
|
24501
|
+
messageId,
|
|
24502
|
+
message: 'Unauthorized',
|
|
24503
|
+
payload: {
|
|
24504
|
+
method: event.request.method,
|
|
24505
|
+
url: event.request.url,
|
|
24506
|
+
headers: Array.from(event.request.headers.entries()), // Convert headers to array
|
|
24507
|
+
// body: await event.request.clone().text() // Clone and send the body
|
|
24508
|
+
body: yield event.request.clone().json() // Clone and send the body
|
|
24509
|
+
}
|
|
24510
|
+
})
|
|
24511
|
+
// });
|
|
24512
|
+
// })
|
|
24513
|
+
);
|
|
24514
|
+
// Wait for the main thread to send back the response
|
|
24515
|
+
const newResponse = yield new Promise((resolve) => {
|
|
24516
|
+
console.log('Re resolving 401', response.url);
|
|
24517
|
+
// fallback
|
|
24518
|
+
setTimeout(() => resolve(response), 60000); // 60 sec
|
|
24519
|
+
navigator.serviceWorker.addEventListener('message', (e) => {
|
|
24520
|
+
var _a, _b, _c;
|
|
24521
|
+
if (e.data && ((_a = e.data) === null || _a === void 0 ? void 0 : _a.messageId) == messageId && ((_b = e.data) === null || _b === void 0 ? void 0 : _b.type) === 'API_RESPONSE') {
|
|
24522
|
+
if ((_c = e === null || e === void 0 ? void 0 : e.data) === null || _c === void 0 ? void 0 : _c.response)
|
|
24523
|
+
resolve(e.data.response); // Resolve with the old response
|
|
24524
|
+
else {
|
|
24525
|
+
console.log('Unable to resolve re 401', response.url);
|
|
24526
|
+
resolve(response); // Resolve with the old response
|
|
24527
|
+
}
|
|
24528
|
+
}
|
|
24529
|
+
});
|
|
24530
|
+
});
|
|
24531
|
+
return newResponse; // Return the new response
|
|
24532
|
+
}
|
|
24533
|
+
// if (response.status == 401) {
|
|
24534
|
+
// if (!refreshingToken) {
|
|
24535
|
+
// refreshingToken = true;
|
|
24536
|
+
// refreshTokenPromise = refreshToken()
|
|
24537
|
+
// }
|
|
24538
|
+
// console.warn('Awating to perform token refresh')
|
|
24539
|
+
// // set options to update if need else not
|
|
24540
|
+
// setTimeout(() => {
|
|
24541
|
+
// return response
|
|
24542
|
+
// }, 30000) // return after 30 sec if unable to update token
|
|
24543
|
+
// await refreshingToken
|
|
24544
|
+
// const clonedRequest = event.request.clone()
|
|
24545
|
+
// clonedRequest.headers.set()
|
|
24546
|
+
// }
|
|
24547
|
+
// If no issues, return the response as is
|
|
24548
|
+
return response;
|
|
24549
|
+
}
|
|
24550
|
+
catch (error) {
|
|
24551
|
+
console.error('Error occured during 401 intercepting', error);
|
|
24552
|
+
throw error;
|
|
24553
|
+
}
|
|
24554
|
+
});
|
|
24401
24555
|
|
|
24402
24556
|
|
|
24403
24557
|
//# sourceMappingURL=serviceWorker.bundle.js.map
|