mftsccs-browser 2.0.12-beta → 2.0.14-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 +198 -110
- package/dist/main.bundle.js.map +1 -1
- package/dist/serviceWorker.bundle.js +211 -113
- package/dist/serviceWorker.bundle.js.map +1 -1
- package/dist/types/DataStructures/BaseUrl.d.ts +1 -1
- package/dist/types/Middleware/ApplicationMonitor.d.ts +4 -0
- package/dist/types/Middleware/logger.service.d.ts +2 -2
- package/dist/types/app.d.ts +1 -1
- package/package.json +1 -1
package/dist/main.bundle.js
CHANGED
|
@@ -33,6 +33,8 @@ class AccessTracker {
|
|
|
33
33
|
if (conceptId) {
|
|
34
34
|
this.conceptsData[conceptId] = (this.conceptsData[conceptId] || 0) + 1;
|
|
35
35
|
}
|
|
36
|
+
// console.log("Concept Added into Access Tracker : ", conceptId);
|
|
37
|
+
// console.log("Updated Concept: ", this.conceptsData);
|
|
36
38
|
}
|
|
37
39
|
catch (error) {
|
|
38
40
|
console.error("Failed on increment concept");
|
|
@@ -46,6 +48,8 @@ class AccessTracker {
|
|
|
46
48
|
if (connectionId) {
|
|
47
49
|
this.connectionsData[connectionId] = (this.connectionsData[connectionId] || 0) + 1;
|
|
48
50
|
}
|
|
51
|
+
// console.log("Connection Added into Access Tracker : ", connectionId);
|
|
52
|
+
// console.log("Updated Connections: ", this.connectionsData);
|
|
49
53
|
}
|
|
50
54
|
catch (error) {
|
|
51
55
|
console.error("Failed on increment connection");
|
|
@@ -299,6 +303,7 @@ AccessTracker.nextSyncTime = Date.now();
|
|
|
299
303
|
AccessTracker.activateStatus = false;
|
|
300
304
|
AccessTracker.accessData = "Access Data";
|
|
301
305
|
(() => {
|
|
306
|
+
// console.log("Access Tracker init...")
|
|
302
307
|
_a.startAutoSync();
|
|
303
308
|
})();
|
|
304
309
|
|
|
@@ -4149,19 +4154,20 @@ class BaseUrl {
|
|
|
4149
4154
|
// return this.AI_URL + '/api/get_ranked_type_id?inpage=300' || process.env.AI_URL || 'https://ai.freeschema.com/api/get_ranked_type_id?inpage=300';
|
|
4150
4155
|
}
|
|
4151
4156
|
static PostPrefetchConceptConnections() {
|
|
4152
|
-
return this.NODE_URL + '/api/v1/access-tracker/sync-access-tracker'
|
|
4157
|
+
// return this.NODE_URL + '/api/v1/access-tracker/sync-access-tracker'
|
|
4158
|
+
return this.NODE_URL + '/access-tracker/sync-access-tracker';
|
|
4153
4159
|
}
|
|
4154
4160
|
static GetSuggestedConcepts() {
|
|
4155
|
-
return this.NODE_URL + '/api/v1/access-tracker/list-concepts-file'
|
|
4161
|
+
// return this.NODE_URL + '/api/v1/access-tracker/list-concepts-file'
|
|
4162
|
+
return this.NODE_URL + '/access-tracker/list-concepts-file';
|
|
4156
4163
|
}
|
|
4157
4164
|
static GetSuggestedConnections() {
|
|
4158
|
-
return this.NODE_URL + '/api/v1/access-tracker/list-connections-file'
|
|
4165
|
+
// return this.NODE_URL + '/api/v1/access-tracker/list-connections-file'
|
|
4166
|
+
return this.NODE_URL + '/access-tracker/list-connections-file';
|
|
4159
4167
|
}
|
|
4160
4168
|
static PostLogger() {
|
|
4161
|
-
return this.NODE_URL + '/
|
|
4162
|
-
|
|
4163
|
-
static GetLogger() {
|
|
4164
|
-
return this.NODE_URL + '/api/v1/logger/logs';
|
|
4169
|
+
return this.NODE_URL + '/logger/logs';
|
|
4170
|
+
// return this.NODE_URL + '/api/v1/logger/logs'
|
|
4165
4171
|
}
|
|
4166
4172
|
static GetAllPrefetchConnectionsUrl() {
|
|
4167
4173
|
return this.BASE_URL + '/api/get_all_connections_of_user?inpage=500';
|
|
@@ -4280,6 +4286,12 @@ BaseUrl.AI_URL = "https://ai.freeschema.com";
|
|
|
4280
4286
|
BaseUrl.MQTT_URL = '192.168.1.249';
|
|
4281
4287
|
BaseUrl.NODE_URL = "http://localhost:5001";
|
|
4282
4288
|
BaseUrl.BASE_APPLICATION = "";
|
|
4289
|
+
BaseUrl.FLAGS = {
|
|
4290
|
+
logApplication: false,
|
|
4291
|
+
logPackage: false,
|
|
4292
|
+
accessTracker: false,
|
|
4293
|
+
isTest: false
|
|
4294
|
+
};
|
|
4283
4295
|
BaseUrl.BASE_RANDOMIZER = 999;
|
|
4284
4296
|
|
|
4285
4297
|
|
|
@@ -11297,11 +11309,62 @@ var __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _argume
|
|
|
11297
11309
|
|
|
11298
11310
|
class ApplicationMonitor {
|
|
11299
11311
|
static initialize() {
|
|
11300
|
-
console.warn("Initialized Application Moniroring...");
|
|
11312
|
+
console.warn("Initialized Application Moniroring for tracking error...");
|
|
11313
|
+
this.initGlobalErrorHandlers();
|
|
11314
|
+
this.logCatchError();
|
|
11315
|
+
this.logErrorEvent();
|
|
11316
|
+
this.logUnhandledError();
|
|
11317
|
+
// Log user interactions
|
|
11318
|
+
this.logUserInteractions();
|
|
11319
|
+
// Log network requests requires interception with Service Worker or monkey-patching
|
|
11320
|
+
this.logNetworkRequests();
|
|
11321
|
+
// Log application state changes for SPAs
|
|
11322
|
+
this.logRouteChanges();
|
|
11323
|
+
}
|
|
11324
|
+
// Initialize global error handlers for JavaScript errors and promise rejections
|
|
11325
|
+
static initGlobalErrorHandlers() {
|
|
11326
|
+
// console.log("Into initGlobalErrorHandlers.")
|
|
11327
|
+
if (typeof window === undefined)
|
|
11328
|
+
return;
|
|
11329
|
+
// Track runtime errors
|
|
11330
|
+
window.onerror = (message, source, lineno, colno, error) => {
|
|
11331
|
+
const errorDetails = {
|
|
11332
|
+
message,
|
|
11333
|
+
source,
|
|
11334
|
+
lineno,
|
|
11335
|
+
colno,
|
|
11336
|
+
stack: (error === null || error === void 0 ? void 0 : error.stack) || 'undefined',
|
|
11337
|
+
};
|
|
11338
|
+
_logger_service__WEBPACK_IMPORTED_MODULE_1__.Logger.logApplication("ERROR", "Runtime Error", errorDetails);
|
|
11339
|
+
};
|
|
11340
|
+
// Track unhandled promise rejections
|
|
11341
|
+
window.onunhandledrejection = (event) => {
|
|
11342
|
+
_logger_service__WEBPACK_IMPORTED_MODULE_1__.Logger.logApplication("ERROR", "Unhandled Promise Rejection", {
|
|
11343
|
+
message: event.reason ? event.reason.message : event.reason,
|
|
11344
|
+
stack: event.reason ? event.reason.stack : null,
|
|
11345
|
+
});
|
|
11346
|
+
};
|
|
11347
|
+
}
|
|
11348
|
+
static logCatchError() {
|
|
11349
|
+
try {
|
|
11350
|
+
const originalConsoleError = console.error;
|
|
11351
|
+
console.log("Inside originalConsoleError...");
|
|
11352
|
+
console.error = function (...args) {
|
|
11353
|
+
const message = "Console Error";
|
|
11354
|
+
const errorDetails = { arguments: args };
|
|
11355
|
+
_logger_service__WEBPACK_IMPORTED_MODULE_1__.Logger.logApplication("ERROR", message, errorDetails);
|
|
11356
|
+
originalConsoleError.apply(console, args);
|
|
11357
|
+
};
|
|
11358
|
+
}
|
|
11359
|
+
catch (error) {
|
|
11360
|
+
console.warn("Failed to override console.error:", error);
|
|
11361
|
+
}
|
|
11362
|
+
}
|
|
11363
|
+
static logErrorEvent() {
|
|
11301
11364
|
// Log unhandled errors
|
|
11302
11365
|
window.addEventListener("error", (event) => {
|
|
11303
11366
|
var _a, _b;
|
|
11304
|
-
|
|
11367
|
+
console.log("Inside error event...");
|
|
11305
11368
|
const errorDetails = {
|
|
11306
11369
|
error: ((_a = event.error) === null || _a === void 0 ? void 0 : _a.message) || event.message,
|
|
11307
11370
|
source: event.filename,
|
|
@@ -11312,23 +11375,18 @@ class ApplicationMonitor {
|
|
|
11312
11375
|
const message = "Unhandled Error";
|
|
11313
11376
|
_logger_service__WEBPACK_IMPORTED_MODULE_1__.Logger.logApplication("Error", message, errorDetails);
|
|
11314
11377
|
});
|
|
11378
|
+
}
|
|
11379
|
+
static logUnhandledError() {
|
|
11315
11380
|
// Log unhandled promise rejections
|
|
11316
11381
|
window.addEventListener("unhandledrejection", (event) => {
|
|
11317
|
-
var _a;
|
|
11318
|
-
|
|
11382
|
+
var _a, _b;
|
|
11383
|
+
console.log("Inside unhandledrejection...");
|
|
11319
11384
|
const errorDetails = {
|
|
11320
|
-
reason: event.reason,
|
|
11321
|
-
stack: (
|
|
11385
|
+
reason: ((_a = event.reason) === null || _a === void 0 ? void 0 : _a.message) || String(event.reason),
|
|
11386
|
+
stack: ((_b = event.reason) === null || _b === void 0 ? void 0 : _b.stack) || "No stack trace available",
|
|
11322
11387
|
};
|
|
11323
|
-
|
|
11324
|
-
_logger_service__WEBPACK_IMPORTED_MODULE_1__.Logger.logApplication("Error", message, errorDetails);
|
|
11388
|
+
_logger_service__WEBPACK_IMPORTED_MODULE_1__.Logger.logApplication("ERROR", "Unhandled Promise Rejection", errorDetails);
|
|
11325
11389
|
});
|
|
11326
|
-
// Log user interactions
|
|
11327
|
-
this.logUserInteractions();
|
|
11328
|
-
// Log network requests requires interception with Service Worker or monkey-patching
|
|
11329
|
-
this.logNetworkRequests();
|
|
11330
|
-
// Log application state changes for SPAs
|
|
11331
|
-
this.logRouteChanges();
|
|
11332
11390
|
}
|
|
11333
11391
|
// Log user interactions
|
|
11334
11392
|
static logUserInteractions() {
|
|
@@ -11342,7 +11400,7 @@ class ApplicationMonitor {
|
|
|
11342
11400
|
classes: target.className,
|
|
11343
11401
|
text: (_a = target.innerText) === null || _a === void 0 ? void 0 : _a.slice(0, 50),
|
|
11344
11402
|
};
|
|
11345
|
-
|
|
11403
|
+
// Logger.logApplication("INFO", message, details)
|
|
11346
11404
|
});
|
|
11347
11405
|
document.addEventListener("input", (event) => {
|
|
11348
11406
|
const target = event.target;
|
|
@@ -11352,14 +11410,14 @@ class ApplicationMonitor {
|
|
|
11352
11410
|
id: target.id,
|
|
11353
11411
|
value: target.value,
|
|
11354
11412
|
};
|
|
11355
|
-
|
|
11413
|
+
// Logger.logApplication("INFO", message, details)
|
|
11356
11414
|
});
|
|
11357
11415
|
document.addEventListener("scroll", () => {
|
|
11358
11416
|
const message = "User Scroll";
|
|
11359
11417
|
const details = {
|
|
11360
11418
|
position: window.scrollY,
|
|
11361
11419
|
};
|
|
11362
|
-
|
|
11420
|
+
// Logger.logApplication("INFO", message, details)
|
|
11363
11421
|
});
|
|
11364
11422
|
}
|
|
11365
11423
|
static logNetworkRequests() {
|
|
@@ -11404,16 +11462,16 @@ class ApplicationMonitor {
|
|
|
11404
11462
|
url: urlString,
|
|
11405
11463
|
status: response.status,
|
|
11406
11464
|
};
|
|
11407
|
-
|
|
11465
|
+
// Logger.logApplication("INFO", "Successful Network Request", networkDetails)
|
|
11408
11466
|
return response;
|
|
11409
11467
|
}
|
|
11410
11468
|
catch (error) {
|
|
11411
11469
|
// Log full error message
|
|
11412
|
-
if (error instanceof Error) {
|
|
11413
|
-
|
|
11414
|
-
|
|
11415
|
-
}
|
|
11416
|
-
console.error("Fetch failed for:", urlString, error);
|
|
11470
|
+
// if (error instanceof Error) {
|
|
11471
|
+
// console.error("Error message:", error.message);
|
|
11472
|
+
// console.error("Stack trace:", error.stack);
|
|
11473
|
+
// }
|
|
11474
|
+
// console.error("Fetch failed for:", urlString, error);
|
|
11417
11475
|
// Add error details to the network log
|
|
11418
11476
|
networkDetails.response = {
|
|
11419
11477
|
type: "ERROR",
|
|
@@ -11422,7 +11480,7 @@ class ApplicationMonitor {
|
|
|
11422
11480
|
error: error instanceof Error ? error.message : String(error),
|
|
11423
11481
|
};
|
|
11424
11482
|
// Log or process networkDetails if needed
|
|
11425
|
-
_logger_service__WEBPACK_IMPORTED_MODULE_1__.Logger.logApplication("ERROR", "Network Request", networkDetails);
|
|
11483
|
+
_logger_service__WEBPACK_IMPORTED_MODULE_1__.Logger.logApplication("ERROR", "Failed Network Request", networkDetails);
|
|
11426
11484
|
// Throw a standard Error object (not the networkDetails object)
|
|
11427
11485
|
throw new Error(`Network request failed for ${urlString}: ${error.message}`);
|
|
11428
11486
|
}
|
|
@@ -11438,7 +11496,7 @@ class ApplicationMonitor {
|
|
|
11438
11496
|
loadTime: timing.loadEventEnd - timing.navigationStart,
|
|
11439
11497
|
domContentLoadedTime: timing.domContentLoadedEventEnd - timing.navigationStart,
|
|
11440
11498
|
};
|
|
11441
|
-
|
|
11499
|
+
// Logger.logApplication("INFO", "Performance Metrics", details)
|
|
11442
11500
|
});
|
|
11443
11501
|
}
|
|
11444
11502
|
// Log route changes (SPAs)
|
|
@@ -11602,6 +11660,7 @@ var __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _argume
|
|
|
11602
11660
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
11603
11661
|
});
|
|
11604
11662
|
};
|
|
11663
|
+
var _a;
|
|
11605
11664
|
|
|
11606
11665
|
|
|
11607
11666
|
class Logger {
|
|
@@ -11614,14 +11673,15 @@ class Logger {
|
|
|
11614
11673
|
console.warn("Auto-sync is already running.");
|
|
11615
11674
|
return;
|
|
11616
11675
|
}
|
|
11617
|
-
|
|
11676
|
+
this.nextSyncTime = Date.now() + this.SYNC_INTERVAL_MS;
|
|
11618
11677
|
setInterval(() => {
|
|
11619
11678
|
const currentTime = Date.now();
|
|
11620
11679
|
// console.log("Current Time : ",currentTime);
|
|
11621
|
-
if (
|
|
11622
|
-
|
|
11623
|
-
|
|
11624
|
-
|
|
11680
|
+
if (this.nextSyncTime && currentTime >= this.nextSyncTime) {
|
|
11681
|
+
// console.log("Time to sync log.")
|
|
11682
|
+
this.nextSyncTime = currentTime + this.SYNC_INTERVAL_MS;
|
|
11683
|
+
this.sendPackageLogsToServer();
|
|
11684
|
+
this.sendApplicationLogsToServer();
|
|
11625
11685
|
}
|
|
11626
11686
|
}, 60000); // Check every minute
|
|
11627
11687
|
}
|
|
@@ -11632,37 +11692,38 @@ class Logger {
|
|
|
11632
11692
|
if (this.autoSyncInterval !== null) {
|
|
11633
11693
|
clearInterval(this.autoSyncInterval);
|
|
11634
11694
|
this.autoSyncInterval = null;
|
|
11635
|
-
|
|
11695
|
+
this.nextSyncTime = null;
|
|
11636
11696
|
}
|
|
11637
11697
|
}
|
|
11638
11698
|
/**
|
|
11639
11699
|
* Set the log level (e.g., "DEBUG", "INFO", "WARNING", "ERROR").
|
|
11640
11700
|
*/
|
|
11641
11701
|
static setLogLevel(level) {
|
|
11642
|
-
|
|
11702
|
+
this.logLevel = level;
|
|
11643
11703
|
}
|
|
11644
11704
|
/**
|
|
11645
11705
|
* Determines whether the current log level permits the given level to be logged.
|
|
11646
11706
|
*/
|
|
11647
11707
|
static shouldLog(level) {
|
|
11648
|
-
return
|
|
11708
|
+
return this.LOG_LEVELS.indexOf(level) >= this.LOG_LEVELS.indexOf(this.logLevel);
|
|
11649
11709
|
}
|
|
11650
11710
|
/**
|
|
11651
11711
|
* Logs a message with optional additional structured data.
|
|
11652
11712
|
*/
|
|
11653
11713
|
static formatLogData(level, message, data) {
|
|
11654
|
-
if (!
|
|
11714
|
+
if (!this.shouldLog(level))
|
|
11655
11715
|
return;
|
|
11656
11716
|
const logEntry = Object.assign({ timestamp: new Date().toLocaleString(), level,
|
|
11657
11717
|
message }, data);
|
|
11658
|
-
|
|
11718
|
+
this.packageLogsData.push(logEntry);
|
|
11659
11719
|
// this.saveLogToLocalStorage(this.mftsccsBrowser, logEntry)
|
|
11720
|
+
// console.log("Package Log Updated : ", this.log);
|
|
11660
11721
|
}
|
|
11661
11722
|
static log(level, message, data) {
|
|
11662
11723
|
if (!this.logPackageActivationStatus)
|
|
11663
11724
|
return;
|
|
11664
11725
|
try {
|
|
11665
|
-
|
|
11726
|
+
this.formatLogData(level, message, data || null);
|
|
11666
11727
|
}
|
|
11667
11728
|
catch (error) {
|
|
11668
11729
|
console.error("Error on Logger Log : ", error);
|
|
@@ -11687,7 +11748,7 @@ class Logger {
|
|
|
11687
11748
|
userAgent,
|
|
11688
11749
|
conceptsUsed,
|
|
11689
11750
|
};
|
|
11690
|
-
|
|
11751
|
+
this.log("INFO", `Information logged for ${functionName}`, logData);
|
|
11691
11752
|
}
|
|
11692
11753
|
catch (error) {
|
|
11693
11754
|
console.error("Error on logInfo");
|
|
@@ -11712,7 +11773,7 @@ class Logger {
|
|
|
11712
11773
|
userAgent,
|
|
11713
11774
|
conceptsUsed,
|
|
11714
11775
|
};
|
|
11715
|
-
|
|
11776
|
+
this.formatLogData("ERROR", `Information logged for ${functionName}`, logData);
|
|
11716
11777
|
}
|
|
11717
11778
|
catch (error) {
|
|
11718
11779
|
console.error("Error on logError");
|
|
@@ -11737,7 +11798,7 @@ class Logger {
|
|
|
11737
11798
|
userAgent,
|
|
11738
11799
|
conceptsUsed,
|
|
11739
11800
|
};
|
|
11740
|
-
|
|
11801
|
+
this.formatLogData("WARNING", `Information logged for ${functionName}`, logData);
|
|
11741
11802
|
}
|
|
11742
11803
|
catch (error) {
|
|
11743
11804
|
console.error("Error on logWarning");
|
|
@@ -11762,7 +11823,7 @@ class Logger {
|
|
|
11762
11823
|
userAgent,
|
|
11763
11824
|
conceptsUsed,
|
|
11764
11825
|
};
|
|
11765
|
-
|
|
11826
|
+
this.formatLogData("DEBUG", `Information logged for ${functionName}`, logData);
|
|
11766
11827
|
}
|
|
11767
11828
|
catch (error) {
|
|
11768
11829
|
console.error("Error on logDebug");
|
|
@@ -11770,6 +11831,7 @@ class Logger {
|
|
|
11770
11831
|
}
|
|
11771
11832
|
// Log Application Activity
|
|
11772
11833
|
static logApplication(type, message, data) {
|
|
11834
|
+
console.log("LogApplicationActivationStatus : ", this.logApplicationActivationStatus);
|
|
11773
11835
|
if (!this.logApplicationActivationStatus)
|
|
11774
11836
|
return;
|
|
11775
11837
|
try {
|
|
@@ -11780,8 +11842,9 @@ class Logger {
|
|
|
11780
11842
|
message: message,
|
|
11781
11843
|
data: data || null,
|
|
11782
11844
|
};
|
|
11783
|
-
|
|
11845
|
+
this.applicationLogsData.push(logEntry);
|
|
11784
11846
|
// this.saveLogToLocalStorage(this.appLogs, logEntry)
|
|
11847
|
+
// console.log("Application Log Updated : ", this.applicationLogsData);
|
|
11785
11848
|
}
|
|
11786
11849
|
catch (error) {
|
|
11787
11850
|
console.error("Failed to log application activity:", error);
|
|
@@ -11793,6 +11856,7 @@ class Logger {
|
|
|
11793
11856
|
static sendApplicationLogsToServer() {
|
|
11794
11857
|
return __awaiter(this, void 0, void 0, function* () {
|
|
11795
11858
|
try {
|
|
11859
|
+
console.log("Log from sendApplicationLogsToServer : ", this.applicationLogsData);
|
|
11796
11860
|
if (this.applicationLogsData.length === 0) {
|
|
11797
11861
|
return;
|
|
11798
11862
|
}
|
|
@@ -11817,29 +11881,26 @@ class Logger {
|
|
|
11817
11881
|
if (!response.ok) {
|
|
11818
11882
|
const responseBody = yield response.text();
|
|
11819
11883
|
console.error("Failed to send app-logs:-", response.status, response.statusText, responseBody);
|
|
11820
|
-
return;
|
|
11821
11884
|
}
|
|
11822
11885
|
}
|
|
11823
11886
|
// clear application log from memory
|
|
11824
11887
|
this.applicationLogsData = [];
|
|
11825
11888
|
}
|
|
11826
11889
|
catch (error) {
|
|
11827
|
-
console.error("
|
|
11890
|
+
console.error("Network error while sending logs:", error);
|
|
11828
11891
|
}
|
|
11829
11892
|
});
|
|
11830
11893
|
}
|
|
11831
|
-
static
|
|
11894
|
+
static sendPackageLogsToServer() {
|
|
11832
11895
|
return __awaiter(this, void 0, void 0, function* () {
|
|
11833
11896
|
try {
|
|
11834
|
-
|
|
11897
|
+
console.log("Log from sendPackageLogsToServer : ", this.packageLogsData);
|
|
11898
|
+
if (this.packageLogsData.length === 0)
|
|
11835
11899
|
return;
|
|
11836
|
-
if (this.logsData.length === 0) {
|
|
11837
|
-
return;
|
|
11838
|
-
}
|
|
11839
11900
|
const accessToken = _DataStructures_Security_TokenStorage__WEBPACK_IMPORTED_MODULE_1__.TokenStorage.BearerAccessToken;
|
|
11840
11901
|
if (!accessToken)
|
|
11841
11902
|
return;
|
|
11842
|
-
const storedLogs = this.
|
|
11903
|
+
const storedLogs = this.packageLogsData;
|
|
11843
11904
|
const chunkSize = 50;
|
|
11844
11905
|
for (let i = 0; i < storedLogs.length; i += chunkSize) {
|
|
11845
11906
|
const chunk = storedLogs.slice(i, i + chunkSize);
|
|
@@ -11861,7 +11922,7 @@ class Logger {
|
|
|
11861
11922
|
}
|
|
11862
11923
|
}
|
|
11863
11924
|
// clear mftsccs log from memory
|
|
11864
|
-
this.
|
|
11925
|
+
this.packageLogsData = [];
|
|
11865
11926
|
}
|
|
11866
11927
|
catch (error) {
|
|
11867
11928
|
console.error("Error while sending logs to server:", error);
|
|
@@ -11885,7 +11946,7 @@ class Logger {
|
|
|
11885
11946
|
}
|
|
11886
11947
|
catch (error) {
|
|
11887
11948
|
console.error("Error on saving log in localstorage");
|
|
11888
|
-
|
|
11949
|
+
this.log("ERROR", "Error while saving log in local storage");
|
|
11889
11950
|
}
|
|
11890
11951
|
}
|
|
11891
11952
|
static clearLogsFromLocalStorage(logType) {
|
|
@@ -11899,8 +11960,9 @@ class Logger {
|
|
|
11899
11960
|
}
|
|
11900
11961
|
}
|
|
11901
11962
|
}
|
|
11963
|
+
_a = Logger;
|
|
11902
11964
|
Logger.logLevel = "INFO";
|
|
11903
|
-
Logger.
|
|
11965
|
+
Logger.packageLogsData = [];
|
|
11904
11966
|
Logger.applicationLogsData = [];
|
|
11905
11967
|
Logger.LOG_LEVELS = ["DEBUG", "INFO", "WARNING", "ERROR"];
|
|
11906
11968
|
Logger.SYNC_INTERVAL_MS = 120 * 1000; // 120 Sec
|
|
@@ -11913,7 +11975,7 @@ Logger.logPackageActivationStatus = false;
|
|
|
11913
11975
|
Logger.autoSyncInterval = null;
|
|
11914
11976
|
// Ensure logs are managed automatically
|
|
11915
11977
|
(() => {
|
|
11916
|
-
|
|
11978
|
+
_a.startAutoSync();
|
|
11917
11979
|
})();
|
|
11918
11980
|
/**
|
|
11919
11981
|
*
|
|
@@ -13479,6 +13541,9 @@ function FindConceptsFromConnections() {
|
|
|
13479
13541
|
if (!ConceptList.includes(connectionList[i].toTheConceptId)) {
|
|
13480
13542
|
ConceptList.push(connectionList[i].toTheConceptId);
|
|
13481
13543
|
}
|
|
13544
|
+
if (!ConceptList.includes(connectionList[i].typeId)) {
|
|
13545
|
+
ConceptList.push(connectionList[i].typeId);
|
|
13546
|
+
}
|
|
13482
13547
|
}
|
|
13483
13548
|
yield (0,_Api_GetConceptBulk__WEBPACK_IMPORTED_MODULE_0__.GetConceptBulk)(ConceptList);
|
|
13484
13549
|
}
|
|
@@ -14800,6 +14865,7 @@ function GetConnectionDataPrefetch(connectionIds) {
|
|
|
14800
14865
|
for (let j = 0; j < connectionsAll.length; j++) {
|
|
14801
14866
|
prefetchConcepts.push(connectionsAll[j].ofTheConceptId);
|
|
14802
14867
|
prefetchConcepts.push(connectionsAll[j].toTheConceptId);
|
|
14868
|
+
prefetchConcepts.push(connectionsAll[j].typeId);
|
|
14803
14869
|
}
|
|
14804
14870
|
yield (0,_app__WEBPACK_IMPORTED_MODULE_2__.GetConceptBulk)(prefetchConcepts);
|
|
14805
14871
|
return connectionsAll;
|
|
@@ -15327,6 +15393,7 @@ var __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _argume
|
|
|
15327
15393
|
function GetConnectionById(id) {
|
|
15328
15394
|
return __awaiter(this, void 0, void 0, function* () {
|
|
15329
15395
|
let startTime = performance.now();
|
|
15396
|
+
console.log("AccessTracker activation status from GetConnectionById");
|
|
15330
15397
|
// Add connection id in access tracker
|
|
15331
15398
|
if (_AccessTracker_accessTracker__WEBPACK_IMPORTED_MODULE_0__.AccessTracker.activateStatus === true) {
|
|
15332
15399
|
try {
|
|
@@ -15728,16 +15795,18 @@ var __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _argume
|
|
|
15728
15795
|
function GetTheConcept(id_1) {
|
|
15729
15796
|
return __awaiter(this, arguments, void 0, function* (id, userId = 999) {
|
|
15730
15797
|
let startTime = performance.now();
|
|
15731
|
-
|
|
15732
|
-
|
|
15733
|
-
|
|
15734
|
-
|
|
15735
|
-
|
|
15736
|
-
}
|
|
15737
|
-
catch (_a) {
|
|
15738
|
-
console.error("Error adding concepts in access tracker");
|
|
15739
|
-
}
|
|
15798
|
+
// console.log("I skip GetTheConcept : ", id)
|
|
15799
|
+
// console.log("Log from GetTheConcept.............", id)
|
|
15800
|
+
if (_AccessTracker_accessTracker__WEBPACK_IMPORTED_MODULE_0__.AccessTracker.activateStatus) {
|
|
15801
|
+
try {
|
|
15802
|
+
_AccessTracker_accessTracker__WEBPACK_IMPORTED_MODULE_0__.AccessTracker.incrementConcept(id);
|
|
15740
15803
|
}
|
|
15804
|
+
catch (_a) {
|
|
15805
|
+
console.error("Error adding connection in access tracker");
|
|
15806
|
+
_app__WEBPACK_IMPORTED_MODULE_2__.Logger.log("ERROR", "Error Adding Connection");
|
|
15807
|
+
}
|
|
15808
|
+
}
|
|
15809
|
+
try {
|
|
15741
15810
|
if (_app__WEBPACK_IMPORTED_MODULE_2__.serviceWorker) {
|
|
15742
15811
|
try {
|
|
15743
15812
|
const res = yield (0,_app__WEBPACK_IMPORTED_MODULE_2__.sendMessage)('GetTheConcept', { id, userId });
|
|
@@ -22902,7 +22971,7 @@ function updateAccessToken(accessToken = "") {
|
|
|
22902
22971
|
* @param enableSW {activate: boolean, scope?: string, pathToSW?: string, manual?: boolean} | undefined - This is for enabling service worker with its scope
|
|
22903
22972
|
*/
|
|
22904
22973
|
function init() {
|
|
22905
|
-
return __awaiter(this, arguments, void 0, function* (url = "", aiurl = "", accessToken = "", nodeUrl = "", enableAi = true, applicationName = "", enableSW = undefined,
|
|
22974
|
+
return __awaiter(this, arguments, void 0, function* (url = "", aiurl = "", accessToken = "", nodeUrl = "", enableAi = true, applicationName = "", enableSW = undefined, flags = {}) {
|
|
22906
22975
|
try {
|
|
22907
22976
|
_DataStructures_BaseUrl__WEBPACK_IMPORTED_MODULE_98__.BaseUrl.BASE_URL = url;
|
|
22908
22977
|
_DataStructures_BaseUrl__WEBPACK_IMPORTED_MODULE_98__.BaseUrl.AI_URL = aiurl;
|
|
@@ -22913,37 +22982,18 @@ function init() {
|
|
|
22913
22982
|
// BaseUrl.BASE_RANDOMIZER = randomizer;
|
|
22914
22983
|
// BaseUrl.BASE_RANDOMIZER = 999;
|
|
22915
22984
|
_DataStructures_BaseUrl__WEBPACK_IMPORTED_MODULE_98__.BaseUrl.setRandomizer(randomizer);
|
|
22916
|
-
|
|
22917
|
-
|
|
22918
|
-
|
|
22919
|
-
|
|
22920
|
-
|
|
22921
|
-
|
|
22922
|
-
|
|
22923
|
-
|
|
22924
|
-
|
|
22925
|
-
|
|
22926
|
-
|
|
22927
|
-
|
|
22928
|
-
// Flag setup
|
|
22929
|
-
try {
|
|
22930
|
-
if (flag.logApplication) {
|
|
22931
|
-
_Middleware_ApplicationMonitor__WEBPACK_IMPORTED_MODULE_103__.ApplicationMonitor.initialize();
|
|
22932
|
-
_app__WEBPACK_IMPORTED_MODULE_105__.Logger.logApplicationActivationStatus = true;
|
|
22933
|
-
console.warn("Application log started...");
|
|
22934
|
-
}
|
|
22935
|
-
if (flag.logPackage) {
|
|
22936
|
-
_app__WEBPACK_IMPORTED_MODULE_105__.Logger.logPackageActivationStatus = true;
|
|
22937
|
-
console.warn("Package log started...");
|
|
22938
|
-
}
|
|
22939
|
-
if (flag.accessTracker) {
|
|
22940
|
-
_app__WEBPACK_IMPORTED_MODULE_105__.AccessTracker.activateStatus = true;
|
|
22941
|
-
console.warn("Access Tracker Activated...");
|
|
22942
|
-
}
|
|
22943
|
-
}
|
|
22944
|
-
catch (error) {
|
|
22945
|
-
console.error("Flag setup failed in init");
|
|
22946
|
-
}
|
|
22985
|
+
// Change Default Flags
|
|
22986
|
+
const defaultFlags = {
|
|
22987
|
+
logApplication: false,
|
|
22988
|
+
logPackage: false,
|
|
22989
|
+
accessTracker: false,
|
|
22990
|
+
isTest: false
|
|
22991
|
+
};
|
|
22992
|
+
_DataStructures_BaseUrl__WEBPACK_IMPORTED_MODULE_98__.BaseUrl.FLAGS = defaultFlags;
|
|
22993
|
+
// Merge Provided Flags with Defaults
|
|
22994
|
+
_DataStructures_BaseUrl__WEBPACK_IMPORTED_MODULE_98__.BaseUrl.FLAGS = Object.assign(Object.assign({}, defaultFlags), flags);
|
|
22995
|
+
initializeFlags(_DataStructures_BaseUrl__WEBPACK_IMPORTED_MODULE_98__.BaseUrl.FLAGS);
|
|
22996
|
+
// console.log("BaseUrl.FLAGS before sending to service worker : ", BaseUrl.FLAGS)
|
|
22947
22997
|
if (!("serviceWorker" in navigator)) {
|
|
22948
22998
|
yield initConceptConnection();
|
|
22949
22999
|
console.warn("Service Worker not supported in this browser.");
|
|
@@ -22964,7 +23014,7 @@ function init() {
|
|
|
22964
23014
|
nodeUrl,
|
|
22965
23015
|
enableAi,
|
|
22966
23016
|
applicationName,
|
|
22967
|
-
|
|
23017
|
+
flags
|
|
22968
23018
|
});
|
|
22969
23019
|
resolve('done');
|
|
22970
23020
|
}))
|
|
@@ -23026,7 +23076,7 @@ function init() {
|
|
|
23026
23076
|
// nodeUrl,
|
|
23027
23077
|
// enableAi,
|
|
23028
23078
|
// applicationName,
|
|
23029
|
-
//
|
|
23079
|
+
// flags
|
|
23030
23080
|
// });
|
|
23031
23081
|
// processMessageQueue();
|
|
23032
23082
|
// resolve();
|
|
@@ -23049,7 +23099,7 @@ function init() {
|
|
|
23049
23099
|
// nodeUrl,
|
|
23050
23100
|
// enableAi,
|
|
23051
23101
|
// applicationName,
|
|
23052
|
-
//
|
|
23102
|
+
// flags
|
|
23053
23103
|
// });
|
|
23054
23104
|
// }
|
|
23055
23105
|
// });
|
|
@@ -23073,6 +23123,7 @@ function init() {
|
|
|
23073
23123
|
// && navigator.serviceWorker.controller) {
|
|
23074
23124
|
console.log("New Service Worker is active", registration);
|
|
23075
23125
|
serviceWorker = newWorker;
|
|
23126
|
+
console.log("This is a flag after sw init : ", flags);
|
|
23076
23127
|
// serviceWorker = registration.active;
|
|
23077
23128
|
// Send init message now that it's active
|
|
23078
23129
|
yield sendMessage("init", {
|
|
@@ -23082,7 +23133,7 @@ function init() {
|
|
|
23082
23133
|
nodeUrl,
|
|
23083
23134
|
enableAi,
|
|
23084
23135
|
applicationName,
|
|
23085
|
-
|
|
23136
|
+
flags
|
|
23086
23137
|
});
|
|
23087
23138
|
success = true;
|
|
23088
23139
|
serviceWorkerReady = true;
|
|
@@ -23105,7 +23156,7 @@ function init() {
|
|
|
23105
23156
|
nodeUrl,
|
|
23106
23157
|
enableAi,
|
|
23107
23158
|
applicationName,
|
|
23108
|
-
|
|
23159
|
+
flags
|
|
23109
23160
|
});
|
|
23110
23161
|
// The new service worker is now controlling the page
|
|
23111
23162
|
// You can reload the page if necessary or handle the update process here
|
|
@@ -23125,7 +23176,7 @@ function init() {
|
|
|
23125
23176
|
nodeUrl,
|
|
23126
23177
|
enableAi,
|
|
23127
23178
|
applicationName,
|
|
23128
|
-
|
|
23179
|
+
flags,
|
|
23129
23180
|
});
|
|
23130
23181
|
}
|
|
23131
23182
|
}));
|
|
@@ -23142,7 +23193,7 @@ function init() {
|
|
|
23142
23193
|
nodeUrl,
|
|
23143
23194
|
enableAi,
|
|
23144
23195
|
applicationName,
|
|
23145
|
-
|
|
23196
|
+
flags,
|
|
23146
23197
|
});
|
|
23147
23198
|
processMessageQueue();
|
|
23148
23199
|
resolve();
|
|
@@ -23200,7 +23251,6 @@ function sendMessage(type, payload) {
|
|
|
23200
23251
|
return new Promise((resolve, reject) => {
|
|
23201
23252
|
// navigator.serviceWorker.ready
|
|
23202
23253
|
// .then((registration) => {
|
|
23203
|
-
console.debug('debug', navigator.serviceWorker.controller, serviceWorker, serviceWorkerReady, type == 'init');
|
|
23204
23254
|
if ((navigator.serviceWorker.controller || serviceWorker) && (serviceWorkerReady || type == 'init')) {
|
|
23205
23255
|
const responseHandler = (event) => {
|
|
23206
23256
|
var _a, _b, _c, _d, _e, _f;
|
|
@@ -23325,7 +23375,8 @@ const broadcastActions = {
|
|
|
23325
23375
|
accessToken: _DataStructures_Security_TokenStorage__WEBPACK_IMPORTED_MODULE_99__.TokenStorage.BearerAccessToken,
|
|
23326
23376
|
nodeUrl: _DataStructures_BaseUrl__WEBPACK_IMPORTED_MODULE_98__.BaseUrl.NODE_URL,
|
|
23327
23377
|
enableAi: false,
|
|
23328
|
-
applicationName: _DataStructures_BaseUrl__WEBPACK_IMPORTED_MODULE_98__.BaseUrl.BASE_APPLICATION
|
|
23378
|
+
applicationName: _DataStructures_BaseUrl__WEBPACK_IMPORTED_MODULE_98__.BaseUrl.BASE_APPLICATION,
|
|
23379
|
+
flags: _DataStructures_BaseUrl__WEBPACK_IMPORTED_MODULE_98__.BaseUrl.FLAGS
|
|
23329
23380
|
});
|
|
23330
23381
|
return { success: true };
|
|
23331
23382
|
})
|
|
@@ -23521,6 +23572,43 @@ const handleServiceWorkerException = (error) => {
|
|
|
23521
23572
|
// if (error instanceof FreeSchemaResponse && error.getStatus() == 401) console.error('401 triggered in sw defaulting')
|
|
23522
23573
|
console.error('Service Worker Error', error);
|
|
23523
23574
|
};
|
|
23575
|
+
/**
|
|
23576
|
+
* Function to setup initial flag
|
|
23577
|
+
*/
|
|
23578
|
+
function initializeFlags(flags) {
|
|
23579
|
+
try {
|
|
23580
|
+
if (flags.logApplication) {
|
|
23581
|
+
_Middleware_ApplicationMonitor__WEBPACK_IMPORTED_MODULE_103__.ApplicationMonitor.initialize();
|
|
23582
|
+
_app__WEBPACK_IMPORTED_MODULE_105__.Logger.logApplicationActivationStatus = true;
|
|
23583
|
+
console.warn("Application log started.");
|
|
23584
|
+
}
|
|
23585
|
+
if (flags.logPackage) {
|
|
23586
|
+
_app__WEBPACK_IMPORTED_MODULE_105__.Logger.logPackageActivationStatus = true;
|
|
23587
|
+
console.warn("Package log started.");
|
|
23588
|
+
}
|
|
23589
|
+
if (flags.accessTracker) {
|
|
23590
|
+
_app__WEBPACK_IMPORTED_MODULE_105__.AccessTracker.activateStatus = true;
|
|
23591
|
+
console.warn("Access Tracker Activated.");
|
|
23592
|
+
}
|
|
23593
|
+
if (flags.isTest) {
|
|
23594
|
+
_DataStructures_IdentifierFlags__WEBPACK_IMPORTED_MODULE_1__.IdentifierFlags.isDataLoaded = true;
|
|
23595
|
+
_DataStructures_IdentifierFlags__WEBPACK_IMPORTED_MODULE_1__.IdentifierFlags.isCharacterLoaded = true;
|
|
23596
|
+
_DataStructures_IdentifierFlags__WEBPACK_IMPORTED_MODULE_1__.IdentifierFlags.isTypeLoaded = true;
|
|
23597
|
+
_DataStructures_IdentifierFlags__WEBPACK_IMPORTED_MODULE_1__.IdentifierFlags.isLocalDataLoaded = true;
|
|
23598
|
+
_DataStructures_IdentifierFlags__WEBPACK_IMPORTED_MODULE_1__.IdentifierFlags.isLocalTypeLoaded = true;
|
|
23599
|
+
_DataStructures_IdentifierFlags__WEBPACK_IMPORTED_MODULE_1__.IdentifierFlags.isLocalCharacterLoaded = true;
|
|
23600
|
+
_DataStructures_IdentifierFlags__WEBPACK_IMPORTED_MODULE_1__.IdentifierFlags.isConnectionLoaded = true;
|
|
23601
|
+
_DataStructures_IdentifierFlags__WEBPACK_IMPORTED_MODULE_1__.IdentifierFlags.isConnectionTypeLoaded = true;
|
|
23602
|
+
_DataStructures_IdentifierFlags__WEBPACK_IMPORTED_MODULE_1__.IdentifierFlags.isLocalConnectionLoaded = true;
|
|
23603
|
+
// return true;
|
|
23604
|
+
}
|
|
23605
|
+
return flags;
|
|
23606
|
+
}
|
|
23607
|
+
catch (error) {
|
|
23608
|
+
console.error("Failed to initialize flags:", error);
|
|
23609
|
+
throw error;
|
|
23610
|
+
}
|
|
23611
|
+
}
|
|
23524
23612
|
|
|
23525
23613
|
|
|
23526
23614
|
/***/ })
|