mftsccs-browser 1.1.68-beta → 1.1.70-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 +203 -220
- package/dist/main.bundle.js.map +1 -1
- package/dist/serviceWorker.bundle.js +219 -221
- 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/Services/Search/JustIdFormat.d.ts +3 -2
- package/dist/types/Widgets/StatefulWidget.d.ts +2 -0
- package/dist/types/app.d.ts +1 -0
- package/package.json +1 -1
package/dist/main.bundle.js
CHANGED
|
@@ -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
|
|
|
@@ -14758,7 +14778,7 @@ function GetConnectionDataPrefetch(connectionIds) {
|
|
|
14758
14778
|
connectionsAll.push(connection);
|
|
14759
14779
|
}
|
|
14760
14780
|
}
|
|
14761
|
-
for (let i = 0; i <
|
|
14781
|
+
for (let i = 0; i < remainingConnections.length; i++) {
|
|
14762
14782
|
remainingIds[connectionIds[i]] = false;
|
|
14763
14783
|
}
|
|
14764
14784
|
//await ConnectionData.GetConnectionBulkData(connectionIds, connectionsAll, remainingIds);
|
|
@@ -20666,56 +20686,6 @@ class BuilderStatefulWidget extends _StatefulWidget__WEBPACK_IMPORTED_MODULE_0__
|
|
|
20666
20686
|
this.widgetType = "the_element_name";
|
|
20667
20687
|
this.parentConceptList = [];
|
|
20668
20688
|
}
|
|
20669
|
-
// async getWidgetCodeFromId(widgetId: number, token: string) {
|
|
20670
|
-
// //console.log("getWidgetCodeFromId", widgetId, token);
|
|
20671
|
-
// return new Promise(async (resolve: any, reject: any) => {
|
|
20672
|
-
// try {
|
|
20673
|
-
// let searchFirst = new SearchQuery();
|
|
20674
|
-
// searchFirst.composition = widgetId;
|
|
20675
|
-
// searchFirst.fullLinkers = [
|
|
20676
|
-
// "the_widgetcode",
|
|
20677
|
-
// "the_widgetcode_widget",
|
|
20678
|
-
// "the_widgetcode_name",
|
|
20679
|
-
// "the_widgetcode_html",
|
|
20680
|
-
// "the_widgetcode_css",
|
|
20681
|
-
// "the_widgetcode_js",
|
|
20682
|
-
// "the_widgetcode_timestamp",
|
|
20683
|
-
// "the_widgetcode_typevalue",
|
|
20684
|
-
// "the_widgetcode_addevent",
|
|
20685
|
-
// "the_widgetcode_onmount",
|
|
20686
|
-
// "the_widgetcode_onupdate",
|
|
20687
|
-
// "the_widgetcode_mountChildWidgets",
|
|
20688
|
-
// "the_widgetcode_cleanhtml",
|
|
20689
|
-
// "the_widgetcode_s_child",
|
|
20690
|
-
// ];
|
|
20691
|
-
// searchFirst.inpage = 100;
|
|
20692
|
-
// let searchSecond = new SearchQuery();
|
|
20693
|
-
// searchSecond.fullLinkers = [
|
|
20694
|
-
// "the_childwidget",
|
|
20695
|
-
// "the_childwidget_typevalue",
|
|
20696
|
-
// "the_childwidget_widget",
|
|
20697
|
-
// "the_childwidget_wrapperId",
|
|
20698
|
-
// ];
|
|
20699
|
-
// searchSecond.inpage = 100;
|
|
20700
|
-
// const queryParams = [searchFirst, searchSecond];
|
|
20701
|
-
// const output = await SearchLinkMultipleAll(queryParams, token);
|
|
20702
|
-
// //console.log("getWidgetCodeFromId output ->", output);
|
|
20703
|
-
// resolve(output);
|
|
20704
|
-
// return output;
|
|
20705
|
-
// } catch (error: any) {
|
|
20706
|
-
// console.error("error", error);
|
|
20707
|
-
// if (error?.status === 401) {
|
|
20708
|
-
// HandleHttpError(error?.response)
|
|
20709
|
-
// }
|
|
20710
|
-
// reject(error);
|
|
20711
|
-
// }
|
|
20712
|
-
// });
|
|
20713
|
-
// }
|
|
20714
|
-
// async CreateConceptConnections(){
|
|
20715
|
-
// let mainConcept = await
|
|
20716
|
-
// for(let i=0; i<this.childrenData.length; i++){
|
|
20717
|
-
// }
|
|
20718
|
-
// }
|
|
20719
20689
|
getUserId() {
|
|
20720
20690
|
return __awaiter(this, void 0, void 0, function* () {
|
|
20721
20691
|
const profileData = yield new Promise((resolve) => {
|
|
@@ -20992,6 +20962,8 @@ class StatefulWidget extends _BaseWidget__WEBPACK_IMPORTED_MODULE_0__.BaseWidget
|
|
|
20992
20962
|
constructor() {
|
|
20993
20963
|
super(...arguments);
|
|
20994
20964
|
this.html = "";
|
|
20965
|
+
this.css = "";
|
|
20966
|
+
this.js = "";
|
|
20995
20967
|
/**
|
|
20996
20968
|
* These are the child widgets that need to be added to this widget
|
|
20997
20969
|
*/
|
|
@@ -22620,6 +22592,7 @@ var __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _argume
|
|
|
22620
22592
|
|
|
22621
22593
|
|
|
22622
22594
|
|
|
22595
|
+
|
|
22623
22596
|
|
|
22624
22597
|
|
|
22625
22598
|
var serviceWorker;
|
|
@@ -22649,7 +22622,7 @@ function updateAccessToken(accessToken = "") {
|
|
|
22649
22622
|
* @param enableSW {activate: boolean, scope?: string, pathToSW?: string, manual?: boolean} | undefined - This is for enabling service worker with its scope
|
|
22650
22623
|
*/
|
|
22651
22624
|
function init() {
|
|
22652
|
-
return __awaiter(this, arguments, void 0, function* (url = "", aiurl = "", accessToken = "", nodeUrl = "", enableAi = true, applicationName = "", enableSW = undefined, flag = { logApplication: false, accessTracker: false, isTest: false }) {
|
|
22625
|
+
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 }) {
|
|
22653
22626
|
try {
|
|
22654
22627
|
_DataStructures_BaseUrl__WEBPACK_IMPORTED_MODULE_98__.BaseUrl.BASE_URL = url;
|
|
22655
22628
|
_DataStructures_BaseUrl__WEBPACK_IMPORTED_MODULE_98__.BaseUrl.AI_URL = aiurl;
|
|
@@ -22672,13 +22645,24 @@ function init() {
|
|
|
22672
22645
|
_DataStructures_IdentifierFlags__WEBPACK_IMPORTED_MODULE_1__.IdentifierFlags.isLocalConnectionLoaded = true;
|
|
22673
22646
|
return true;
|
|
22674
22647
|
}
|
|
22675
|
-
|
|
22676
|
-
|
|
22677
|
-
|
|
22648
|
+
// Flag setup
|
|
22649
|
+
try {
|
|
22650
|
+
if (flag.logApplication) {
|
|
22651
|
+
_Middleware_ApplicationMonitor__WEBPACK_IMPORTED_MODULE_103__.ApplicationMonitor.initialize();
|
|
22652
|
+
_app__WEBPACK_IMPORTED_MODULE_105__.Logger.logApplicationActivationStatus = true;
|
|
22653
|
+
console.warn("Application log started...");
|
|
22654
|
+
}
|
|
22655
|
+
if (flag.logPackage) {
|
|
22656
|
+
_app__WEBPACK_IMPORTED_MODULE_105__.Logger.logPackageActivationStatus = true;
|
|
22657
|
+
console.warn("Package log started...");
|
|
22658
|
+
}
|
|
22659
|
+
if (flag.accessTracker) {
|
|
22660
|
+
_app__WEBPACK_IMPORTED_MODULE_105__.AccessTracker.activateStatus = true;
|
|
22661
|
+
console.warn("Access Tracker Activated...");
|
|
22662
|
+
}
|
|
22678
22663
|
}
|
|
22679
|
-
|
|
22680
|
-
|
|
22681
|
-
console.warn("Access Tracker Activated...");
|
|
22664
|
+
catch (error) {
|
|
22665
|
+
console.error("Flag setup failed in init");
|
|
22682
22666
|
}
|
|
22683
22667
|
if (!("serviceWorker" in navigator)) {
|
|
22684
22668
|
yield initConceptConnection();
|
|
@@ -22750,48 +22734,45 @@ function init() {
|
|
|
22750
22734
|
.then((registration) => __awaiter(this, void 0, void 0, function* () {
|
|
22751
22735
|
console.log("Service Worker registered:", registration);
|
|
22752
22736
|
// If the service worker is already active, mark it as ready
|
|
22753
|
-
if (registration.active) {
|
|
22754
|
-
|
|
22755
|
-
|
|
22756
|
-
|
|
22757
|
-
|
|
22758
|
-
|
|
22759
|
-
|
|
22760
|
-
|
|
22761
|
-
|
|
22762
|
-
|
|
22763
|
-
|
|
22764
|
-
|
|
22765
|
-
|
|
22766
|
-
|
|
22767
|
-
|
|
22768
|
-
}
|
|
22769
|
-
|
|
22770
|
-
|
|
22771
|
-
|
|
22772
|
-
|
|
22773
|
-
|
|
22774
|
-
}, 5000);
|
|
22775
|
-
}
|
|
22737
|
+
// if (registration.active) {
|
|
22738
|
+
// serviceWorkerReady = true;
|
|
22739
|
+
// console.log("active sw");
|
|
22740
|
+
// serviceWorker = registration.active;
|
|
22741
|
+
// await sendMessage("init", {
|
|
22742
|
+
// url,
|
|
22743
|
+
// aiurl,
|
|
22744
|
+
// accessToken,
|
|
22745
|
+
// nodeUrl,
|
|
22746
|
+
// enableAi,
|
|
22747
|
+
// applicationName,
|
|
22748
|
+
// flag
|
|
22749
|
+
// });
|
|
22750
|
+
// processMessageQueue();
|
|
22751
|
+
// resolve();
|
|
22752
|
+
// } else {
|
|
22753
|
+
// // Handle if on state change didn't trigger
|
|
22754
|
+
// setTimeout(() => {
|
|
22755
|
+
// if (!success) reject("Not Completed Initialization");
|
|
22756
|
+
// }, 5000);
|
|
22757
|
+
// }
|
|
22776
22758
|
// state change
|
|
22777
|
-
if (registration.installing || registration.waiting || registration.active) {
|
|
22778
|
-
|
|
22779
|
-
|
|
22780
|
-
|
|
22781
|
-
|
|
22782
|
-
|
|
22783
|
-
|
|
22784
|
-
|
|
22785
|
-
|
|
22786
|
-
|
|
22787
|
-
|
|
22788
|
-
|
|
22789
|
-
|
|
22790
|
-
|
|
22791
|
-
|
|
22792
|
-
|
|
22793
|
-
|
|
22794
|
-
}
|
|
22759
|
+
// if (registration.installing || registration.waiting || registration.active) {
|
|
22760
|
+
// registration.addEventListener('statechange', async (event: any) => {
|
|
22761
|
+
// if (event?.target?.state === 'activating') {
|
|
22762
|
+
// serviceWorker = navigator.serviceWorker.controller
|
|
22763
|
+
// console.log('Service Worker is activating statechange');
|
|
22764
|
+
// await sendMessage("init", {
|
|
22765
|
+
// url,
|
|
22766
|
+
// aiurl,
|
|
22767
|
+
// accessToken,
|
|
22768
|
+
// nodeUrl,
|
|
22769
|
+
// enableAi,
|
|
22770
|
+
// applicationName,
|
|
22771
|
+
// flag
|
|
22772
|
+
// });
|
|
22773
|
+
// }
|
|
22774
|
+
// });
|
|
22775
|
+
// }
|
|
22795
22776
|
// Add Listeners before initializing the service worker
|
|
22796
22777
|
// Listen for updates to the service worker
|
|
22797
22778
|
console.log("update listen start");
|
|
@@ -22890,7 +22871,7 @@ function init() {
|
|
|
22890
22871
|
setTimeout(() => {
|
|
22891
22872
|
if (!success)
|
|
22892
22873
|
reject("Not Completed Initialization");
|
|
22893
|
-
},
|
|
22874
|
+
}, 10000);
|
|
22894
22875
|
}
|
|
22895
22876
|
}))
|
|
22896
22877
|
.catch((error) => __awaiter(this, void 0, void 0, function* () {
|
|
@@ -22938,6 +22919,7 @@ function sendMessage(type, payload) {
|
|
|
22938
22919
|
return new Promise((resolve, reject) => {
|
|
22939
22920
|
// navigator.serviceWorker.ready
|
|
22940
22921
|
// .then((registration) => {
|
|
22922
|
+
console.debug('debug', navigator.serviceWorker.controller, serviceWorker, serviceWorkerReady, type == 'init');
|
|
22941
22923
|
if ((navigator.serviceWorker.controller || serviceWorker) && (serviceWorkerReady || type == 'init')) {
|
|
22942
22924
|
const responseHandler = (event) => {
|
|
22943
22925
|
var _a, _b, _c, _d, _e, _f;
|
|
@@ -22976,7 +22958,7 @@ function sendMessage(type, payload) {
|
|
|
22976
22958
|
serviceWorker.postMessage({ type, payload: newPayload });
|
|
22977
22959
|
}
|
|
22978
22960
|
catch (err) {
|
|
22979
|
-
console.log(err);
|
|
22961
|
+
console.log('Retrying again on catch service worker', err);
|
|
22980
22962
|
// serviceWorker.postMessage({ type, payload: newPayload });
|
|
22981
22963
|
serviceWorker.postMessage({ type, payload: newPayload });
|
|
22982
22964
|
}
|
|
@@ -22986,6 +22968,7 @@ function sendMessage(type, payload) {
|
|
|
22986
22968
|
console.warn(`Service Worker hasn't loaded yet. messageId: ${messageId}, type: ${type}`);
|
|
22987
22969
|
if (serviceWorkerReady)
|
|
22988
22970
|
console.warn('service worker was registered already but is not available NOW!!!');
|
|
22971
|
+
console.info('ready', navigator.serviceWorker.ready);
|
|
22989
22972
|
// wait one second before checking again
|
|
22990
22973
|
setTimeout(() => {
|
|
22991
22974
|
console.warn(`Re-Trying after certain time. messageId: ${messageId}, type: ${type}`);
|
|
@@ -23005,7 +22988,7 @@ function sendMessage(type, payload) {
|
|
|
23005
22988
|
setTimeout(() => {
|
|
23006
22989
|
reject(`No response from service worker after timeout: ${type}`);
|
|
23007
22990
|
navigator.serviceWorker.removeEventListener("message", responseHandler);
|
|
23008
|
-
},
|
|
22991
|
+
}, 210000); // 3.5 minutes
|
|
23009
22992
|
}
|
|
23010
22993
|
else {
|
|
23011
22994
|
messageQueue.push({ message: { type, payload: newPayload } });
|