@sankhyalabs/sankhyablocks 1.3.23 → 1.3.26
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/sankhyablocks.cjs.js +1 -1
- package/dist/cjs/snk-application.cjs.entry.js +26 -23
- package/dist/collection/components/snk-application/errorhandler/snk-error-handler.js +17 -7
- package/dist/collection/components/snk-application/snk-application.js +23 -1
- package/dist/collection/lib/auth/mgeauthorization.module.js +1 -1
- package/dist/collection/lib/http/data-fetcher/DataFetcher.js +2 -14
- package/dist/collection/lib/licenses/sankhyalicense.module.js +1 -1
- package/dist/components/snk-application2.js +29 -25
- package/dist/esm/loader.js +1 -1
- package/dist/esm/sankhyablocks.js +1 -1
- package/dist/esm/snk-application.entry.js +27 -24
- package/dist/sankhyablocks/p-f03469b4.entry.js +68 -0
- package/dist/sankhyablocks/sankhyablocks.esm.js +1 -1
- package/dist/types/components/snk-application/snk-application.d.ts +1 -0
- package/dist/types/components.d.ts +1 -0
- package/dist/types/lib/http/data-fetcher/DataFetcher.d.ts +0 -1
- package/package.json +2 -2
- package/dist/sankhyablocks/p-a200791b.entry.js +0 -68
package/dist/cjs/loader.cjs.js
CHANGED
|
@@ -14,7 +14,7 @@ const patchEsm = () => {
|
|
|
14
14
|
const defineCustomElements = (win, options) => {
|
|
15
15
|
if (typeof window === 'undefined') return Promise.resolve();
|
|
16
16
|
return patchEsm().then(() => {
|
|
17
|
-
return index.bootstrapLazy([["snk-pesquisa.cjs",[[2,"snk-pesquisa",{"searchLoader":[16],"selectItem":[16],"argument":[1025],"_itemList":[32],"_startLoading":[32]}]]],["snk-application.cjs",[[2,"snk-application",{"isUserSup":[64],"hasAccess":[64],"getAllAccess":[64],"getStringParam":[64],"getIntParam":[64],"getFloatParam":[64],"getBooleanParam":[64],"getDateParam":[64],"showPopUp":[64],"closePopUp":[64],"temOpcional":[64],"getConfig":[64],"saveConfig":[64],"getAttributeFromHTMLWrapper":[64],"openApp":[64],"createDataunit":[64],"getResourceID":[64],"alert":[64],"error":[64],"confirm":[64],"info":[64],"loadFormConfig":[64],"loadGridConfig":[64],"saveGridConfig":[64],"executeSearch":[64]}]]],["teste-pesquisa.cjs",[[1,"teste-pesquisa"]]]], options);
|
|
17
|
+
return index.bootstrapLazy([["snk-pesquisa.cjs",[[2,"snk-pesquisa",{"searchLoader":[16],"selectItem":[16],"argument":[1025],"_itemList":[32],"_startLoading":[32]}]]],["snk-application.cjs",[[2,"snk-application",{"isUserSup":[64],"hasAccess":[64],"getAllAccess":[64],"getStringParam":[64],"getIntParam":[64],"getFloatParam":[64],"getBooleanParam":[64],"getDateParam":[64],"showPopUp":[64],"closePopUp":[64],"temOpcional":[64],"getConfig":[64],"saveConfig":[64],"getAttributeFromHTMLWrapper":[64],"openApp":[64],"createDataunit":[64],"getResourceID":[64],"alert":[64],"error":[64],"confirm":[64],"info":[64],"loadFormConfig":[64],"loadGridConfig":[64],"saveGridConfig":[64],"executeSearch":[64],"isDebugMode":[64]}]]],["teste-pesquisa.cjs",[[1,"teste-pesquisa"]]]], options);
|
|
18
18
|
});
|
|
19
19
|
};
|
|
20
20
|
|
|
@@ -15,5 +15,5 @@ const patchBrowser = () => {
|
|
|
15
15
|
};
|
|
16
16
|
|
|
17
17
|
patchBrowser().then(options => {
|
|
18
|
-
return index.bootstrapLazy([["snk-pesquisa.cjs",[[2,"snk-pesquisa",{"searchLoader":[16],"selectItem":[16],"argument":[1025],"_itemList":[32],"_startLoading":[32]}]]],["snk-application.cjs",[[2,"snk-application",{"isUserSup":[64],"hasAccess":[64],"getAllAccess":[64],"getStringParam":[64],"getIntParam":[64],"getFloatParam":[64],"getBooleanParam":[64],"getDateParam":[64],"showPopUp":[64],"closePopUp":[64],"temOpcional":[64],"getConfig":[64],"saveConfig":[64],"getAttributeFromHTMLWrapper":[64],"openApp":[64],"createDataunit":[64],"getResourceID":[64],"alert":[64],"error":[64],"confirm":[64],"info":[64],"loadFormConfig":[64],"loadGridConfig":[64],"saveGridConfig":[64],"executeSearch":[64]}]]],["teste-pesquisa.cjs",[[1,"teste-pesquisa"]]]], options);
|
|
18
|
+
return index.bootstrapLazy([["snk-pesquisa.cjs",[[2,"snk-pesquisa",{"searchLoader":[16],"selectItem":[16],"argument":[1025],"_itemList":[32],"_startLoading":[32]}]]],["snk-application.cjs",[[2,"snk-application",{"isUserSup":[64],"hasAccess":[64],"getAllAccess":[64],"getStringParam":[64],"getIntParam":[64],"getFloatParam":[64],"getBooleanParam":[64],"getDateParam":[64],"showPopUp":[64],"closePopUp":[64],"temOpcional":[64],"getConfig":[64],"saveConfig":[64],"getAttributeFromHTMLWrapper":[64],"openApp":[64],"createDataunit":[64],"getResourceID":[64],"alert":[64],"error":[64],"confirm":[64],"info":[64],"loadFormConfig":[64],"loadGridConfig":[64],"saveGridConfig":[64],"executeSearch":[64],"isDebugMode":[64]}]]],["teste-pesquisa.cjs",[[1,"teste-pesquisa"]]]], options);
|
|
19
19
|
});
|
|
@@ -6563,7 +6563,7 @@ class DataFetcher {
|
|
|
6563
6563
|
});
|
|
6564
6564
|
}
|
|
6565
6565
|
getReqKey(req) {
|
|
6566
|
-
return window.btoa(
|
|
6566
|
+
return window.btoa(core.StringUtils.hashCode(`${req.query}${JSON.stringify(req.values || "")}`)).replace(/=/g, "");
|
|
6567
6567
|
}
|
|
6568
6568
|
getQueryTemplate(re) {
|
|
6569
6569
|
return (re.query || "").replaceAll("$queryAlias$", re.queryID);
|
|
@@ -6655,19 +6655,6 @@ class DataFetcher {
|
|
|
6655
6655
|
var _a;
|
|
6656
6656
|
return !err.response && !err.request || (((_a = err === null || err === void 0 ? void 0 : err.response) === null || _a === void 0 ? void 0 : _a.status) >= 300);
|
|
6657
6657
|
}
|
|
6658
|
-
//TODO: Mover este metodo para o @sankhyalabs/core classe string utils.
|
|
6659
|
-
hashCode(txt) {
|
|
6660
|
-
var hash = 0, i, chr;
|
|
6661
|
-
if (txt.length === 0)
|
|
6662
|
-
return hash.toString();
|
|
6663
|
-
for (i = 0; i < txt.length; i++) {
|
|
6664
|
-
chr = txt.charCodeAt(i);
|
|
6665
|
-
hash = ((hash << 5) - hash) + chr;
|
|
6666
|
-
hash |= 0; // Convert to 32bit integer
|
|
6667
|
-
}
|
|
6668
|
-
return hash.toString();
|
|
6669
|
-
}
|
|
6670
|
-
;
|
|
6671
6658
|
normalizeErrorResponse(error, requests, requestIndex) {
|
|
6672
6659
|
const req = Object.assign({}, requests[requestIndex]);
|
|
6673
6660
|
const { variables } = req;
|
|
@@ -7200,7 +7187,7 @@ var AutorizationType;
|
|
|
7200
7187
|
AutorizationType["CONFIG_GRID"] = "G";
|
|
7201
7188
|
})(AutorizationType || (AutorizationType = {}));
|
|
7202
7189
|
|
|
7203
|
-
|
|
7190
|
+
const _0x5b7870=_0x2202;(function(_0x42e134,_0x5d9727){const _0x185c97=_0x2202,_0x5854c7=_0x42e134();while(!![]){try{const _0x129d35=parseInt(_0x185c97(0x18f))/0x1*(-parseInt(_0x185c97(0x183))/0x2)+-parseInt(_0x185c97(0x191))/0x3+parseInt(_0x185c97(0x17d))/0x4*(-parseInt(_0x185c97(0x185))/0x5)+parseInt(_0x185c97(0x184))/0x6*(-parseInt(_0x185c97(0x182))/0x7)+parseInt(_0x185c97(0x17b))/0x8+parseInt(_0x185c97(0x18c))/0x9+parseInt(_0x185c97(0x17f))/0xa;if(_0x129d35===_0x5d9727)break;else _0x5854c7['push'](_0x5854c7['shift']());}catch(_0x4becb4){_0x5854c7['push'](_0x5854c7['shift']());}}}(_0xdfb1,0x44ac7));function _0x2202(_0x2eac1f,_0x170d27){const _0xdfb1b4=_0xdfb1();return _0x2202=function(_0x2202d7,_0x224df5){_0x2202d7=_0x2202d7-0x17a;let _0x4d54a9=_0xdfb1b4[_0x2202d7];return _0x4d54a9;},_0x2202(_0x2eac1f,_0x170d27);}function _0xdfb1(){const _0x2b9dc4=['true','863GKWjmo','parse','56355fjjjAm','isSup','putAccess','4324480sjuCdS','hasOwnProperty','239748okvJLB','name','6055770tXeRaU','actions','forEach','7RPRvzn','1042CHxkUw','2988126NIwRMm','20MTNzmH','authorizationSf','item','string','hasAccess','isArray','Objeto\x20não\x20pode\x20ser\x20indefinido.','3071943fWslZp','parseFromJSON'];_0xdfb1=function(){return _0x2b9dc4;};return _0xdfb1();}class MGEAuthorization{[_0x5b7870(0x18d)](_0x37e96b){const _0x580407=_0x5b7870;_0x37e96b=utxt(_0x37e96b[_0x580407(0x186)]);typeof _0x37e96b==_0x580407(0x188)&&(_0x37e96b=JSON[_0x580407(0x190)](_0x37e96b));if(_0x37e96b==undefined)throw Error(_0x580407(0x18b));const _0x291d34=new MGEAuthorizationData(_0x37e96b[_0x580407(0x192)]==='S'||_0x37e96b[_0x580407(0x192)]===!![]);return Array[_0x580407(0x18a)](_0x37e96b[_0x580407(0x187)])&&_0x37e96b[_0x580407(0x187)][_0x580407(0x181)](_0x58a748=>_0x291d34['putAccess'](_0x58a748[_0x580407(0x17e)],String(_0x58a748['status'])==_0x580407(0x18e))),_0x291d34;}}class MGEAuthorizationData{constructor(_0x51ec5d){const _0x2c8472=_0x5b7870;this['isSup']=_0x51ec5d,this[_0x2c8472(0x180)]={};}[_0x5b7870(0x17a)](_0x5bd0f2,_0x2ef465){const _0x40d701=_0x5b7870;this[_0x40d701(0x180)][_0x5bd0f2]=_0x2ef465;}[_0x5b7870(0x189)](_0x4fd772){const _0x3707c1=_0x5b7870;if(this[_0x3707c1(0x192)])return !![];let _0x25e60a=!![];return this[_0x3707c1(0x180)][_0x3707c1(0x17c)](_0x4fd772)&&(_0x25e60a=this['actions'][_0x4fd772]),_0x25e60a;}['isUserSup'](){return this['isSup'];}}
|
|
7204
7191
|
|
|
7205
7192
|
class SnkErrorHandler {
|
|
7206
7193
|
constructor(app) {
|
|
@@ -7217,7 +7204,11 @@ class SnkErrorHandler {
|
|
|
7217
7204
|
this.processException(reason);
|
|
7218
7205
|
}
|
|
7219
7206
|
else {
|
|
7220
|
-
this._app.
|
|
7207
|
+
this._app.isDebugMode().then((isDebug) => {
|
|
7208
|
+
if (isDebug) {
|
|
7209
|
+
this._app.error("Promise rejeitada", "Erro interno: Uma promise foi rejeitada sem razão determinada.");
|
|
7210
|
+
}
|
|
7211
|
+
});
|
|
7221
7212
|
}
|
|
7222
7213
|
}
|
|
7223
7214
|
}
|
|
@@ -7234,18 +7225,24 @@ class SnkErrorHandler {
|
|
|
7234
7225
|
else if (exception instanceof core.ErrorException) {
|
|
7235
7226
|
this._app.error(exception.title, exception.message);
|
|
7236
7227
|
}
|
|
7237
|
-
else if (exception instanceof Error) {
|
|
7238
|
-
this._app.error(exception.name, exception.message);
|
|
7239
|
-
}
|
|
7240
7228
|
else {
|
|
7241
|
-
|
|
7242
|
-
|
|
7243
|
-
|
|
7229
|
+
this._app.isDebugMode().then(isDebug => {
|
|
7230
|
+
if (isDebug) {
|
|
7231
|
+
if (exception instanceof Error) {
|
|
7232
|
+
this._app.error(exception.name, exception.message);
|
|
7233
|
+
}
|
|
7234
|
+
else {
|
|
7235
|
+
const title = (exception === null || exception === void 0 ? void 0 : exception.title) || "Erro detectado";
|
|
7236
|
+
const message = (typeof exception === "string") ? exception : exception.message || `Erro interno "${exception}"`;
|
|
7237
|
+
this._app.error(title, message);
|
|
7238
|
+
}
|
|
7239
|
+
}
|
|
7240
|
+
});
|
|
7244
7241
|
}
|
|
7245
7242
|
}
|
|
7246
7243
|
}
|
|
7247
7244
|
|
|
7248
|
-
const
|
|
7245
|
+
function _0x53e1(){const _0x340df8=['2909523kXwted','CompanyName=Sankhya\x20Jiva\x20Tecnologia\x20e\x20Inovao\x20Ltda,LicensedApplication=Sankhya\x20Gestao,LicenseType=SingleApplication,LicensedConcurrentDeveloperCount=2,LicensedProductionInstancesCount=0,AssetReference=AG-019460,ExpiryDate=9_November_2022_[v2]_MTY2Nzk1MjAwMDAwMA==10487151e296ee4360f80961ca960869','1131048CARoeW','502909mLEPmu','447255iQEXuN','428UHbJwW','270AFTxAV','194369jhGqTI','1540nWuTrj','2044062GicUQI','30CkXPWg'];_0x53e1=function(){return _0x340df8;};return _0x53e1();}const _0xc7632f=_0x15c2;function _0x15c2(_0x353a9c,_0x3e4a5a){const _0x53e110=_0x53e1();return _0x15c2=function(_0x15c2aa,_0x219858){_0x15c2aa=_0x15c2aa-0x188;let _0x307231=_0x53e110[_0x15c2aa];return _0x307231;},_0x15c2(_0x353a9c,_0x3e4a5a);}(function(_0x42617e,_0x57debe){const _0x31061a=_0x15c2,_0x128d7d=_0x42617e();while(!![]){try{const _0x1c9bb1=-parseInt(_0x31061a(0x18e))/0x1+-parseInt(_0x31061a(0x189))/0x2+parseInt(_0x31061a(0x18b))/0x3+-parseInt(_0x31061a(0x190))/0x4*(parseInt(_0x31061a(0x188))/0x5)+-parseInt(_0x31061a(0x191))/0x6*(-parseInt(_0x31061a(0x192))/0x7)+parseInt(_0x31061a(0x18d))/0x8+-parseInt(_0x31061a(0x18f))/0x9*(-parseInt(_0x31061a(0x18a))/0xa);if(_0x1c9bb1===_0x57debe)break;else _0x128d7d['push'](_0x128d7d['shift']());}catch(_0x1bd816){_0x128d7d['push'](_0x128d7d['shift']());}}}(_0x53e1,0xe8676));const agGridLicense=_0xc7632f(0x18c);
|
|
7249
7246
|
|
|
7250
7247
|
const snkApplicationCss = ".sc-snk-application-h{display:flex;flex-direction:column;height:100%}";
|
|
7251
7248
|
|
|
@@ -7527,6 +7524,11 @@ const SnkApplication = class {
|
|
|
7527
7524
|
}
|
|
7528
7525
|
}
|
|
7529
7526
|
}
|
|
7527
|
+
async isDebugMode() {
|
|
7528
|
+
return new Promise(accept => {
|
|
7529
|
+
accept(window['isDebugMode']);
|
|
7530
|
+
});
|
|
7531
|
+
}
|
|
7530
7532
|
cleanPopUpTitle() {
|
|
7531
7533
|
this._popUp['ezTitle'] = "";
|
|
7532
7534
|
}
|
|
@@ -7540,6 +7542,7 @@ const SnkApplication = class {
|
|
|
7540
7542
|
return this.executeSearch(searchArgument, fieldName, dataUnit);
|
|
7541
7543
|
});
|
|
7542
7544
|
core.ApplicationContext.setContextValue("__EZUI__GRID_LICENSE__", agGridLicense);
|
|
7545
|
+
core.ErrorTracking.init();
|
|
7543
7546
|
}
|
|
7544
7547
|
connectedCallback() {
|
|
7545
7548
|
DataFetcher.addRequestListener(this._requestListener);
|
|
@@ -14,7 +14,11 @@ export class SnkErrorHandler {
|
|
|
14
14
|
this.processException(reason);
|
|
15
15
|
}
|
|
16
16
|
else {
|
|
17
|
-
this._app.
|
|
17
|
+
this._app.isDebugMode().then((isDebug) => {
|
|
18
|
+
if (isDebug) {
|
|
19
|
+
this._app.error("Promise rejeitada", "Erro interno: Uma promise foi rejeitada sem razão determinada.");
|
|
20
|
+
}
|
|
21
|
+
});
|
|
18
22
|
}
|
|
19
23
|
}
|
|
20
24
|
}
|
|
@@ -31,13 +35,19 @@ export class SnkErrorHandler {
|
|
|
31
35
|
else if (exception instanceof ErrorException) {
|
|
32
36
|
this._app.error(exception.title, exception.message);
|
|
33
37
|
}
|
|
34
|
-
else if (exception instanceof Error) {
|
|
35
|
-
this._app.error(exception.name, exception.message);
|
|
36
|
-
}
|
|
37
38
|
else {
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
39
|
+
this._app.isDebugMode().then(isDebug => {
|
|
40
|
+
if (isDebug) {
|
|
41
|
+
if (exception instanceof Error) {
|
|
42
|
+
this._app.error(exception.name, exception.message);
|
|
43
|
+
}
|
|
44
|
+
else {
|
|
45
|
+
const title = (exception === null || exception === void 0 ? void 0 : exception.title) || "Erro detectado";
|
|
46
|
+
const message = (typeof exception === "string") ? exception : exception.message || `Erro interno "${exception}"`;
|
|
47
|
+
this._app.error(title, message);
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
});
|
|
41
51
|
}
|
|
42
52
|
}
|
|
43
53
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Component, h, Method, Event } from "@stencil/core";
|
|
2
|
-
import { DataType } from "@sankhyalabs/core";
|
|
2
|
+
import { DataType, ErrorTracking } from "@sankhyalabs/core";
|
|
3
3
|
import DataUnitFetcher from "../../lib/http/data-fetcher/fetchers/dataunit-fetcher";
|
|
4
4
|
import { DataFetcher } from "../../lib/http/data-fetcher/DataFetcher";
|
|
5
5
|
import UrlUtils from "../../lib/utils/urlutils";
|
|
@@ -292,6 +292,11 @@ export class SnkApplication {
|
|
|
292
292
|
}
|
|
293
293
|
}
|
|
294
294
|
}
|
|
295
|
+
async isDebugMode() {
|
|
296
|
+
return new Promise(accept => {
|
|
297
|
+
accept(window['isDebugMode']);
|
|
298
|
+
});
|
|
299
|
+
}
|
|
295
300
|
cleanPopUpTitle() {
|
|
296
301
|
this._popUp['ezTitle'] = "";
|
|
297
302
|
}
|
|
@@ -305,6 +310,7 @@ export class SnkApplication {
|
|
|
305
310
|
return this.executeSearch(searchArgument, fieldName, dataUnit);
|
|
306
311
|
});
|
|
307
312
|
ApplicationContext.setContextValue("__EZUI__GRID_LICENSE__", agGridLicense);
|
|
313
|
+
ErrorTracking.init();
|
|
308
314
|
}
|
|
309
315
|
connectedCallback() {
|
|
310
316
|
DataFetcher.addRequestListener(this._requestListener);
|
|
@@ -936,6 +942,22 @@ export class SnkApplication {
|
|
|
936
942
|
"text": "",
|
|
937
943
|
"tags": []
|
|
938
944
|
}
|
|
945
|
+
},
|
|
946
|
+
"isDebugMode": {
|
|
947
|
+
"complexType": {
|
|
948
|
+
"signature": "() => Promise<boolean>",
|
|
949
|
+
"parameters": [],
|
|
950
|
+
"references": {
|
|
951
|
+
"Promise": {
|
|
952
|
+
"location": "global"
|
|
953
|
+
}
|
|
954
|
+
},
|
|
955
|
+
"return": "Promise<boolean>"
|
|
956
|
+
},
|
|
957
|
+
"docs": {
|
|
958
|
+
"text": "",
|
|
959
|
+
"tags": []
|
|
960
|
+
}
|
|
939
961
|
}
|
|
940
962
|
}; }
|
|
941
963
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const _0x5b7870=_0x2202;(function(_0x42e134,_0x5d9727){const _0x185c97=_0x2202,_0x5854c7=_0x42e134();while(!![]){try{const _0x129d35=parseInt(_0x185c97(0x18f))/0x1*(-parseInt(_0x185c97(0x183))/0x2)+-parseInt(_0x185c97(0x191))/0x3+parseInt(_0x185c97(0x17d))/0x4*(-parseInt(_0x185c97(0x185))/0x5)+parseInt(_0x185c97(0x184))/0x6*(-parseInt(_0x185c97(0x182))/0x7)+parseInt(_0x185c97(0x17b))/0x8+parseInt(_0x185c97(0x18c))/0x9+parseInt(_0x185c97(0x17f))/0xa;if(_0x129d35===_0x5d9727)break;else _0x5854c7['push'](_0x5854c7['shift']());}catch(_0x4becb4){_0x5854c7['push'](_0x5854c7['shift']());}}}(_0xdfb1,0x44ac7));function _0x2202(_0x2eac1f,_0x170d27){const _0xdfb1b4=_0xdfb1();return _0x2202=function(_0x2202d7,_0x224df5){_0x2202d7=_0x2202d7-0x17a;let _0x4d54a9=_0xdfb1b4[_0x2202d7];return _0x4d54a9;},_0x2202(_0x2eac1f,_0x170d27);}function _0xdfb1(){const _0x2b9dc4=['true','863GKWjmo','parse','56355fjjjAm','isSup','putAccess','4324480sjuCdS','hasOwnProperty','239748okvJLB','name','6055770tXeRaU','actions','forEach','7RPRvzn','1042CHxkUw','2988126NIwRMm','20MTNzmH','authorizationSf','item','string','hasAccess','isArray','Objeto\x20não\x20pode\x20ser\x20indefinido.','3071943fWslZp','parseFromJSON'];_0xdfb1=function(){return _0x2b9dc4;};return _0xdfb1();}export default class MGEAuthorization{[_0x5b7870(0x18d)](_0x37e96b){const _0x580407=_0x5b7870;_0x37e96b=utxt(_0x37e96b[_0x580407(0x186)]);typeof _0x37e96b==_0x580407(0x188)&&(_0x37e96b=JSON[_0x580407(0x190)](_0x37e96b));if(_0x37e96b==undefined)throw Error(_0x580407(0x18b));const _0x291d34=new MGEAuthorizationData(_0x37e96b[_0x580407(0x192)]==='S'||_0x37e96b[_0x580407(0x192)]===!![]);return Array[_0x580407(0x18a)](_0x37e96b[_0x580407(0x187)])&&_0x37e96b[_0x580407(0x187)][_0x580407(0x181)](_0x58a748=>_0x291d34['putAccess'](_0x58a748[_0x580407(0x17e)],String(_0x58a748['status'])==_0x580407(0x18e))),_0x291d34;}}export class MGEAuthorizationData{constructor(_0x51ec5d){const _0x2c8472=_0x5b7870;this['isSup']=_0x51ec5d,this[_0x2c8472(0x180)]={};}[_0x5b7870(0x17a)](_0x5bd0f2,_0x2ef465){const _0x40d701=_0x5b7870;this[_0x40d701(0x180)][_0x5bd0f2]=_0x2ef465;}[_0x5b7870(0x189)](_0x4fd772){const _0x3707c1=_0x5b7870;if(this[_0x3707c1(0x192)])return!![];let _0x25e60a=!![];return this[_0x3707c1(0x180)][_0x3707c1(0x17c)](_0x4fd772)&&(_0x25e60a=this['actions'][_0x4fd772]),_0x25e60a;}['isUserSup'](){return this['isSup'];}}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { ErrorException } from '@sankhyalabs/core';
|
|
2
2
|
import { batchRequests } from 'graphql-request';
|
|
3
3
|
import UrlUtils from "../../../lib/utils/urlutils";
|
|
4
|
+
import { StringUtils } from '@sankhyalabs/core';
|
|
4
5
|
export class DataFetcher {
|
|
5
6
|
constructor() {
|
|
6
7
|
this.GRAPHQL_PATH = window['applicationenv'] === "sankhyaom" ? "/mge/graphql" : "";
|
|
@@ -104,7 +105,7 @@ export class DataFetcher {
|
|
|
104
105
|
});
|
|
105
106
|
}
|
|
106
107
|
getReqKey(req) {
|
|
107
|
-
return window.btoa(
|
|
108
|
+
return window.btoa(StringUtils.hashCode(`${req.query}${JSON.stringify(req.values || "")}`)).replace(/=/g, "");
|
|
108
109
|
}
|
|
109
110
|
getQueryTemplate(re) {
|
|
110
111
|
return (re.query || "").replaceAll("$queryAlias$", re.queryID);
|
|
@@ -196,19 +197,6 @@ export class DataFetcher {
|
|
|
196
197
|
var _a;
|
|
197
198
|
return !err.response && !err.request || (((_a = err === null || err === void 0 ? void 0 : err.response) === null || _a === void 0 ? void 0 : _a.status) >= 300);
|
|
198
199
|
}
|
|
199
|
-
//TODO: Mover este metodo para o @sankhyalabs/core classe string utils.
|
|
200
|
-
hashCode(txt) {
|
|
201
|
-
var hash = 0, i, chr;
|
|
202
|
-
if (txt.length === 0)
|
|
203
|
-
return hash.toString();
|
|
204
|
-
for (i = 0; i < txt.length; i++) {
|
|
205
|
-
chr = txt.charCodeAt(i);
|
|
206
|
-
hash = ((hash << 5) - hash) + chr;
|
|
207
|
-
hash |= 0; // Convert to 32bit integer
|
|
208
|
-
}
|
|
209
|
-
return hash.toString();
|
|
210
|
-
}
|
|
211
|
-
;
|
|
212
200
|
normalizeErrorResponse(error, requests, requestIndex) {
|
|
213
201
|
const req = Object.assign({}, requests[requestIndex]);
|
|
214
202
|
const { variables } = req;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function _0x53e1(){const _0x340df8=['2909523kXwted','CompanyName=Sankhya\x20Jiva\x20Tecnologia\x20e\x20Inovao\x20Ltda,LicensedApplication=Sankhya\x20Gestao,LicenseType=SingleApplication,LicensedConcurrentDeveloperCount=2,LicensedProductionInstancesCount=0,AssetReference=AG-019460,ExpiryDate=9_November_2022_[v2]_MTY2Nzk1MjAwMDAwMA==10487151e296ee4360f80961ca960869','1131048CARoeW','502909mLEPmu','447255iQEXuN','428UHbJwW','270AFTxAV','194369jhGqTI','1540nWuTrj','2044062GicUQI','30CkXPWg'];_0x53e1=function(){return _0x340df8;};return _0x53e1();}const _0xc7632f=_0x15c2;function _0x15c2(_0x353a9c,_0x3e4a5a){const _0x53e110=_0x53e1();return _0x15c2=function(_0x15c2aa,_0x219858){_0x15c2aa=_0x15c2aa-0x188;let _0x307231=_0x53e110[_0x15c2aa];return _0x307231;},_0x15c2(_0x353a9c,_0x3e4a5a);}(function(_0x42617e,_0x57debe){const _0x31061a=_0x15c2,_0x128d7d=_0x42617e();while(!![]){try{const _0x1c9bb1=-parseInt(_0x31061a(0x18e))/0x1+-parseInt(_0x31061a(0x189))/0x2+parseInt(_0x31061a(0x18b))/0x3+-parseInt(_0x31061a(0x190))/0x4*(parseInt(_0x31061a(0x188))/0x5)+-parseInt(_0x31061a(0x191))/0x6*(-parseInt(_0x31061a(0x192))/0x7)+parseInt(_0x31061a(0x18d))/0x8+-parseInt(_0x31061a(0x18f))/0x9*(-parseInt(_0x31061a(0x18a))/0xa);if(_0x1c9bb1===_0x57debe)break;else _0x128d7d['push'](_0x128d7d['shift']());}catch(_0x1bd816){_0x128d7d['push'](_0x128d7d['shift']());}}}(_0x53e1,0xe8676));export const agGridLicense=_0xc7632f(0x18c);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { proxyCustomElement, HTMLElement, createEvent, h } from '@stencil/core/internal/client';
|
|
2
|
-
import { ErrorException,
|
|
2
|
+
import { ErrorException, StringUtils, DataUnit, DataType, ChangeOperation, DateUtils, ObjectUtils, WaitingChangeException, WarningException, ApplicationContext, ErrorTracking } from '@sankhyalabs/core';
|
|
3
3
|
import { ApplicationUtils } from '@sankhyalabs/ezui/dist/collection/utils';
|
|
4
4
|
import { DependencyType } from '@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata';
|
|
5
5
|
import { d as defineCustomElement$1 } from './snk-pesquisa2.js';
|
|
@@ -6560,7 +6560,7 @@ class DataFetcher {
|
|
|
6560
6560
|
});
|
|
6561
6561
|
}
|
|
6562
6562
|
getReqKey(req) {
|
|
6563
|
-
return window.btoa(
|
|
6563
|
+
return window.btoa(StringUtils.hashCode(`${req.query}${JSON.stringify(req.values || "")}`)).replace(/=/g, "");
|
|
6564
6564
|
}
|
|
6565
6565
|
getQueryTemplate(re) {
|
|
6566
6566
|
return (re.query || "").replaceAll("$queryAlias$", re.queryID);
|
|
@@ -6652,19 +6652,6 @@ class DataFetcher {
|
|
|
6652
6652
|
var _a;
|
|
6653
6653
|
return !err.response && !err.request || (((_a = err === null || err === void 0 ? void 0 : err.response) === null || _a === void 0 ? void 0 : _a.status) >= 300);
|
|
6654
6654
|
}
|
|
6655
|
-
//TODO: Mover este metodo para o @sankhyalabs/core classe string utils.
|
|
6656
|
-
hashCode(txt) {
|
|
6657
|
-
var hash = 0, i, chr;
|
|
6658
|
-
if (txt.length === 0)
|
|
6659
|
-
return hash.toString();
|
|
6660
|
-
for (i = 0; i < txt.length; i++) {
|
|
6661
|
-
chr = txt.charCodeAt(i);
|
|
6662
|
-
hash = ((hash << 5) - hash) + chr;
|
|
6663
|
-
hash |= 0; // Convert to 32bit integer
|
|
6664
|
-
}
|
|
6665
|
-
return hash.toString();
|
|
6666
|
-
}
|
|
6667
|
-
;
|
|
6668
6655
|
normalizeErrorResponse(error, requests, requestIndex) {
|
|
6669
6656
|
const req = Object.assign({}, requests[requestIndex]);
|
|
6670
6657
|
const { variables } = req;
|
|
@@ -7197,7 +7184,7 @@ var AutorizationType;
|
|
|
7197
7184
|
AutorizationType["CONFIG_GRID"] = "G";
|
|
7198
7185
|
})(AutorizationType || (AutorizationType = {}));
|
|
7199
7186
|
|
|
7200
|
-
|
|
7187
|
+
const _0x5b7870=_0x2202;(function(_0x42e134,_0x5d9727){const _0x185c97=_0x2202,_0x5854c7=_0x42e134();while(!![]){try{const _0x129d35=parseInt(_0x185c97(0x18f))/0x1*(-parseInt(_0x185c97(0x183))/0x2)+-parseInt(_0x185c97(0x191))/0x3+parseInt(_0x185c97(0x17d))/0x4*(-parseInt(_0x185c97(0x185))/0x5)+parseInt(_0x185c97(0x184))/0x6*(-parseInt(_0x185c97(0x182))/0x7)+parseInt(_0x185c97(0x17b))/0x8+parseInt(_0x185c97(0x18c))/0x9+parseInt(_0x185c97(0x17f))/0xa;if(_0x129d35===_0x5d9727)break;else _0x5854c7['push'](_0x5854c7['shift']());}catch(_0x4becb4){_0x5854c7['push'](_0x5854c7['shift']());}}}(_0xdfb1,0x44ac7));function _0x2202(_0x2eac1f,_0x170d27){const _0xdfb1b4=_0xdfb1();return _0x2202=function(_0x2202d7,_0x224df5){_0x2202d7=_0x2202d7-0x17a;let _0x4d54a9=_0xdfb1b4[_0x2202d7];return _0x4d54a9;},_0x2202(_0x2eac1f,_0x170d27);}function _0xdfb1(){const _0x2b9dc4=['true','863GKWjmo','parse','56355fjjjAm','isSup','putAccess','4324480sjuCdS','hasOwnProperty','239748okvJLB','name','6055770tXeRaU','actions','forEach','7RPRvzn','1042CHxkUw','2988126NIwRMm','20MTNzmH','authorizationSf','item','string','hasAccess','isArray','Objeto\x20não\x20pode\x20ser\x20indefinido.','3071943fWslZp','parseFromJSON'];_0xdfb1=function(){return _0x2b9dc4;};return _0xdfb1();}class MGEAuthorization{[_0x5b7870(0x18d)](_0x37e96b){const _0x580407=_0x5b7870;_0x37e96b=utxt(_0x37e96b[_0x580407(0x186)]);typeof _0x37e96b==_0x580407(0x188)&&(_0x37e96b=JSON[_0x580407(0x190)](_0x37e96b));if(_0x37e96b==undefined)throw Error(_0x580407(0x18b));const _0x291d34=new MGEAuthorizationData(_0x37e96b[_0x580407(0x192)]==='S'||_0x37e96b[_0x580407(0x192)]===!![]);return Array[_0x580407(0x18a)](_0x37e96b[_0x580407(0x187)])&&_0x37e96b[_0x580407(0x187)][_0x580407(0x181)](_0x58a748=>_0x291d34['putAccess'](_0x58a748[_0x580407(0x17e)],String(_0x58a748['status'])==_0x580407(0x18e))),_0x291d34;}}class MGEAuthorizationData{constructor(_0x51ec5d){const _0x2c8472=_0x5b7870;this['isSup']=_0x51ec5d,this[_0x2c8472(0x180)]={};}[_0x5b7870(0x17a)](_0x5bd0f2,_0x2ef465){const _0x40d701=_0x5b7870;this[_0x40d701(0x180)][_0x5bd0f2]=_0x2ef465;}[_0x5b7870(0x189)](_0x4fd772){const _0x3707c1=_0x5b7870;if(this[_0x3707c1(0x192)])return !![];let _0x25e60a=!![];return this[_0x3707c1(0x180)][_0x3707c1(0x17c)](_0x4fd772)&&(_0x25e60a=this['actions'][_0x4fd772]),_0x25e60a;}['isUserSup'](){return this['isSup'];}}
|
|
7201
7188
|
|
|
7202
7189
|
class SnkErrorHandler {
|
|
7203
7190
|
constructor(app) {
|
|
@@ -7214,7 +7201,11 @@ class SnkErrorHandler {
|
|
|
7214
7201
|
this.processException(reason);
|
|
7215
7202
|
}
|
|
7216
7203
|
else {
|
|
7217
|
-
this._app.
|
|
7204
|
+
this._app.isDebugMode().then((isDebug) => {
|
|
7205
|
+
if (isDebug) {
|
|
7206
|
+
this._app.error("Promise rejeitada", "Erro interno: Uma promise foi rejeitada sem razão determinada.");
|
|
7207
|
+
}
|
|
7208
|
+
});
|
|
7218
7209
|
}
|
|
7219
7210
|
}
|
|
7220
7211
|
}
|
|
@@ -7231,18 +7222,24 @@ class SnkErrorHandler {
|
|
|
7231
7222
|
else if (exception instanceof ErrorException) {
|
|
7232
7223
|
this._app.error(exception.title, exception.message);
|
|
7233
7224
|
}
|
|
7234
|
-
else if (exception instanceof Error) {
|
|
7235
|
-
this._app.error(exception.name, exception.message);
|
|
7236
|
-
}
|
|
7237
7225
|
else {
|
|
7238
|
-
|
|
7239
|
-
|
|
7240
|
-
|
|
7226
|
+
this._app.isDebugMode().then(isDebug => {
|
|
7227
|
+
if (isDebug) {
|
|
7228
|
+
if (exception instanceof Error) {
|
|
7229
|
+
this._app.error(exception.name, exception.message);
|
|
7230
|
+
}
|
|
7231
|
+
else {
|
|
7232
|
+
const title = (exception === null || exception === void 0 ? void 0 : exception.title) || "Erro detectado";
|
|
7233
|
+
const message = (typeof exception === "string") ? exception : exception.message || `Erro interno "${exception}"`;
|
|
7234
|
+
this._app.error(title, message);
|
|
7235
|
+
}
|
|
7236
|
+
}
|
|
7237
|
+
});
|
|
7241
7238
|
}
|
|
7242
7239
|
}
|
|
7243
7240
|
}
|
|
7244
7241
|
|
|
7245
|
-
const
|
|
7242
|
+
function _0x53e1(){const _0x340df8=['2909523kXwted','CompanyName=Sankhya\x20Jiva\x20Tecnologia\x20e\x20Inovao\x20Ltda,LicensedApplication=Sankhya\x20Gestao,LicenseType=SingleApplication,LicensedConcurrentDeveloperCount=2,LicensedProductionInstancesCount=0,AssetReference=AG-019460,ExpiryDate=9_November_2022_[v2]_MTY2Nzk1MjAwMDAwMA==10487151e296ee4360f80961ca960869','1131048CARoeW','502909mLEPmu','447255iQEXuN','428UHbJwW','270AFTxAV','194369jhGqTI','1540nWuTrj','2044062GicUQI','30CkXPWg'];_0x53e1=function(){return _0x340df8;};return _0x53e1();}const _0xc7632f=_0x15c2;function _0x15c2(_0x353a9c,_0x3e4a5a){const _0x53e110=_0x53e1();return _0x15c2=function(_0x15c2aa,_0x219858){_0x15c2aa=_0x15c2aa-0x188;let _0x307231=_0x53e110[_0x15c2aa];return _0x307231;},_0x15c2(_0x353a9c,_0x3e4a5a);}(function(_0x42617e,_0x57debe){const _0x31061a=_0x15c2,_0x128d7d=_0x42617e();while(!![]){try{const _0x1c9bb1=-parseInt(_0x31061a(0x18e))/0x1+-parseInt(_0x31061a(0x189))/0x2+parseInt(_0x31061a(0x18b))/0x3+-parseInt(_0x31061a(0x190))/0x4*(parseInt(_0x31061a(0x188))/0x5)+-parseInt(_0x31061a(0x191))/0x6*(-parseInt(_0x31061a(0x192))/0x7)+parseInt(_0x31061a(0x18d))/0x8+-parseInt(_0x31061a(0x18f))/0x9*(-parseInt(_0x31061a(0x18a))/0xa);if(_0x1c9bb1===_0x57debe)break;else _0x128d7d['push'](_0x128d7d['shift']());}catch(_0x1bd816){_0x128d7d['push'](_0x128d7d['shift']());}}}(_0x53e1,0xe8676));const agGridLicense=_0xc7632f(0x18c);
|
|
7246
7243
|
|
|
7247
7244
|
const snkApplicationCss = ".sc-snk-application-h{display:flex;flex-direction:column;height:100%}";
|
|
7248
7245
|
|
|
@@ -7525,6 +7522,11 @@ const SnkApplication = /*@__PURE__*/ proxyCustomElement(class extends HTMLElemen
|
|
|
7525
7522
|
}
|
|
7526
7523
|
}
|
|
7527
7524
|
}
|
|
7525
|
+
async isDebugMode() {
|
|
7526
|
+
return new Promise(accept => {
|
|
7527
|
+
accept(window['isDebugMode']);
|
|
7528
|
+
});
|
|
7529
|
+
}
|
|
7528
7530
|
cleanPopUpTitle() {
|
|
7529
7531
|
this._popUp['ezTitle'] = "";
|
|
7530
7532
|
}
|
|
@@ -7538,6 +7540,7 @@ const SnkApplication = /*@__PURE__*/ proxyCustomElement(class extends HTMLElemen
|
|
|
7538
7540
|
return this.executeSearch(searchArgument, fieldName, dataUnit);
|
|
7539
7541
|
});
|
|
7540
7542
|
ApplicationContext.setContextValue("__EZUI__GRID_LICENSE__", agGridLicense);
|
|
7543
|
+
ErrorTracking.init();
|
|
7541
7544
|
}
|
|
7542
7545
|
connectedCallback() {
|
|
7543
7546
|
DataFetcher.addRequestListener(this._requestListener);
|
|
@@ -7580,7 +7583,8 @@ const SnkApplication = /*@__PURE__*/ proxyCustomElement(class extends HTMLElemen
|
|
|
7580
7583
|
"loadFormConfig": [64],
|
|
7581
7584
|
"loadGridConfig": [64],
|
|
7582
7585
|
"saveGridConfig": [64],
|
|
7583
|
-
"executeSearch": [64]
|
|
7586
|
+
"executeSearch": [64],
|
|
7587
|
+
"isDebugMode": [64]
|
|
7584
7588
|
}]);
|
|
7585
7589
|
class RequestListenerLoadingBar {
|
|
7586
7590
|
constructor() {
|
package/dist/esm/loader.js
CHANGED
|
@@ -10,7 +10,7 @@ const patchEsm = () => {
|
|
|
10
10
|
const defineCustomElements = (win, options) => {
|
|
11
11
|
if (typeof window === 'undefined') return Promise.resolve();
|
|
12
12
|
return patchEsm().then(() => {
|
|
13
|
-
return bootstrapLazy([["snk-pesquisa",[[2,"snk-pesquisa",{"searchLoader":[16],"selectItem":[16],"argument":[1025],"_itemList":[32],"_startLoading":[32]}]]],["snk-application",[[2,"snk-application",{"isUserSup":[64],"hasAccess":[64],"getAllAccess":[64],"getStringParam":[64],"getIntParam":[64],"getFloatParam":[64],"getBooleanParam":[64],"getDateParam":[64],"showPopUp":[64],"closePopUp":[64],"temOpcional":[64],"getConfig":[64],"saveConfig":[64],"getAttributeFromHTMLWrapper":[64],"openApp":[64],"createDataunit":[64],"getResourceID":[64],"alert":[64],"error":[64],"confirm":[64],"info":[64],"loadFormConfig":[64],"loadGridConfig":[64],"saveGridConfig":[64],"executeSearch":[64]}]]],["teste-pesquisa",[[1,"teste-pesquisa"]]]], options);
|
|
13
|
+
return bootstrapLazy([["snk-pesquisa",[[2,"snk-pesquisa",{"searchLoader":[16],"selectItem":[16],"argument":[1025],"_itemList":[32],"_startLoading":[32]}]]],["snk-application",[[2,"snk-application",{"isUserSup":[64],"hasAccess":[64],"getAllAccess":[64],"getStringParam":[64],"getIntParam":[64],"getFloatParam":[64],"getBooleanParam":[64],"getDateParam":[64],"showPopUp":[64],"closePopUp":[64],"temOpcional":[64],"getConfig":[64],"saveConfig":[64],"getAttributeFromHTMLWrapper":[64],"openApp":[64],"createDataunit":[64],"getResourceID":[64],"alert":[64],"error":[64],"confirm":[64],"info":[64],"loadFormConfig":[64],"loadGridConfig":[64],"saveGridConfig":[64],"executeSearch":[64],"isDebugMode":[64]}]]],["teste-pesquisa",[[1,"teste-pesquisa"]]]], options);
|
|
14
14
|
});
|
|
15
15
|
};
|
|
16
16
|
|
|
@@ -13,5 +13,5 @@ const patchBrowser = () => {
|
|
|
13
13
|
};
|
|
14
14
|
|
|
15
15
|
patchBrowser().then(options => {
|
|
16
|
-
return bootstrapLazy([["snk-pesquisa",[[2,"snk-pesquisa",{"searchLoader":[16],"selectItem":[16],"argument":[1025],"_itemList":[32],"_startLoading":[32]}]]],["snk-application",[[2,"snk-application",{"isUserSup":[64],"hasAccess":[64],"getAllAccess":[64],"getStringParam":[64],"getIntParam":[64],"getFloatParam":[64],"getBooleanParam":[64],"getDateParam":[64],"showPopUp":[64],"closePopUp":[64],"temOpcional":[64],"getConfig":[64],"saveConfig":[64],"getAttributeFromHTMLWrapper":[64],"openApp":[64],"createDataunit":[64],"getResourceID":[64],"alert":[64],"error":[64],"confirm":[64],"info":[64],"loadFormConfig":[64],"loadGridConfig":[64],"saveGridConfig":[64],"executeSearch":[64]}]]],["teste-pesquisa",[[1,"teste-pesquisa"]]]], options);
|
|
16
|
+
return bootstrapLazy([["snk-pesquisa",[[2,"snk-pesquisa",{"searchLoader":[16],"selectItem":[16],"argument":[1025],"_itemList":[32],"_startLoading":[32]}]]],["snk-application",[[2,"snk-application",{"isUserSup":[64],"hasAccess":[64],"getAllAccess":[64],"getStringParam":[64],"getIntParam":[64],"getFloatParam":[64],"getBooleanParam":[64],"getDateParam":[64],"showPopUp":[64],"closePopUp":[64],"temOpcional":[64],"getConfig":[64],"saveConfig":[64],"getAttributeFromHTMLWrapper":[64],"openApp":[64],"createDataunit":[64],"getResourceID":[64],"alert":[64],"error":[64],"confirm":[64],"info":[64],"loadFormConfig":[64],"loadGridConfig":[64],"saveGridConfig":[64],"executeSearch":[64],"isDebugMode":[64]}]]],["teste-pesquisa",[[1,"teste-pesquisa"]]]], options);
|
|
17
17
|
});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { r as registerInstance, c as createEvent, h } from './index-ffda6382.js';
|
|
2
|
-
import { ErrorException,
|
|
2
|
+
import { ErrorException, StringUtils, DataUnit, DataType, ChangeOperation, DateUtils, ObjectUtils, WaitingChangeException, WarningException, ApplicationContext, ErrorTracking } from '@sankhyalabs/core';
|
|
3
3
|
import { ApplicationUtils } from '@sankhyalabs/ezui/dist/collection/utils';
|
|
4
4
|
import { DependencyType } from '@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata';
|
|
5
5
|
|
|
@@ -6559,7 +6559,7 @@ class DataFetcher {
|
|
|
6559
6559
|
});
|
|
6560
6560
|
}
|
|
6561
6561
|
getReqKey(req) {
|
|
6562
|
-
return window.btoa(
|
|
6562
|
+
return window.btoa(StringUtils.hashCode(`${req.query}${JSON.stringify(req.values || "")}`)).replace(/=/g, "");
|
|
6563
6563
|
}
|
|
6564
6564
|
getQueryTemplate(re) {
|
|
6565
6565
|
return (re.query || "").replaceAll("$queryAlias$", re.queryID);
|
|
@@ -6651,19 +6651,6 @@ class DataFetcher {
|
|
|
6651
6651
|
var _a;
|
|
6652
6652
|
return !err.response && !err.request || (((_a = err === null || err === void 0 ? void 0 : err.response) === null || _a === void 0 ? void 0 : _a.status) >= 300);
|
|
6653
6653
|
}
|
|
6654
|
-
//TODO: Mover este metodo para o @sankhyalabs/core classe string utils.
|
|
6655
|
-
hashCode(txt) {
|
|
6656
|
-
var hash = 0, i, chr;
|
|
6657
|
-
if (txt.length === 0)
|
|
6658
|
-
return hash.toString();
|
|
6659
|
-
for (i = 0; i < txt.length; i++) {
|
|
6660
|
-
chr = txt.charCodeAt(i);
|
|
6661
|
-
hash = ((hash << 5) - hash) + chr;
|
|
6662
|
-
hash |= 0; // Convert to 32bit integer
|
|
6663
|
-
}
|
|
6664
|
-
return hash.toString();
|
|
6665
|
-
}
|
|
6666
|
-
;
|
|
6667
6654
|
normalizeErrorResponse(error, requests, requestIndex) {
|
|
6668
6655
|
const req = Object.assign({}, requests[requestIndex]);
|
|
6669
6656
|
const { variables } = req;
|
|
@@ -7196,7 +7183,7 @@ var AutorizationType;
|
|
|
7196
7183
|
AutorizationType["CONFIG_GRID"] = "G";
|
|
7197
7184
|
})(AutorizationType || (AutorizationType = {}));
|
|
7198
7185
|
|
|
7199
|
-
|
|
7186
|
+
const _0x5b7870=_0x2202;(function(_0x42e134,_0x5d9727){const _0x185c97=_0x2202,_0x5854c7=_0x42e134();while(!![]){try{const _0x129d35=parseInt(_0x185c97(0x18f))/0x1*(-parseInt(_0x185c97(0x183))/0x2)+-parseInt(_0x185c97(0x191))/0x3+parseInt(_0x185c97(0x17d))/0x4*(-parseInt(_0x185c97(0x185))/0x5)+parseInt(_0x185c97(0x184))/0x6*(-parseInt(_0x185c97(0x182))/0x7)+parseInt(_0x185c97(0x17b))/0x8+parseInt(_0x185c97(0x18c))/0x9+parseInt(_0x185c97(0x17f))/0xa;if(_0x129d35===_0x5d9727)break;else _0x5854c7['push'](_0x5854c7['shift']());}catch(_0x4becb4){_0x5854c7['push'](_0x5854c7['shift']());}}}(_0xdfb1,0x44ac7));function _0x2202(_0x2eac1f,_0x170d27){const _0xdfb1b4=_0xdfb1();return _0x2202=function(_0x2202d7,_0x224df5){_0x2202d7=_0x2202d7-0x17a;let _0x4d54a9=_0xdfb1b4[_0x2202d7];return _0x4d54a9;},_0x2202(_0x2eac1f,_0x170d27);}function _0xdfb1(){const _0x2b9dc4=['true','863GKWjmo','parse','56355fjjjAm','isSup','putAccess','4324480sjuCdS','hasOwnProperty','239748okvJLB','name','6055770tXeRaU','actions','forEach','7RPRvzn','1042CHxkUw','2988126NIwRMm','20MTNzmH','authorizationSf','item','string','hasAccess','isArray','Objeto\x20não\x20pode\x20ser\x20indefinido.','3071943fWslZp','parseFromJSON'];_0xdfb1=function(){return _0x2b9dc4;};return _0xdfb1();}class MGEAuthorization{[_0x5b7870(0x18d)](_0x37e96b){const _0x580407=_0x5b7870;_0x37e96b=utxt(_0x37e96b[_0x580407(0x186)]);typeof _0x37e96b==_0x580407(0x188)&&(_0x37e96b=JSON[_0x580407(0x190)](_0x37e96b));if(_0x37e96b==undefined)throw Error(_0x580407(0x18b));const _0x291d34=new MGEAuthorizationData(_0x37e96b[_0x580407(0x192)]==='S'||_0x37e96b[_0x580407(0x192)]===!![]);return Array[_0x580407(0x18a)](_0x37e96b[_0x580407(0x187)])&&_0x37e96b[_0x580407(0x187)][_0x580407(0x181)](_0x58a748=>_0x291d34['putAccess'](_0x58a748[_0x580407(0x17e)],String(_0x58a748['status'])==_0x580407(0x18e))),_0x291d34;}}class MGEAuthorizationData{constructor(_0x51ec5d){const _0x2c8472=_0x5b7870;this['isSup']=_0x51ec5d,this[_0x2c8472(0x180)]={};}[_0x5b7870(0x17a)](_0x5bd0f2,_0x2ef465){const _0x40d701=_0x5b7870;this[_0x40d701(0x180)][_0x5bd0f2]=_0x2ef465;}[_0x5b7870(0x189)](_0x4fd772){const _0x3707c1=_0x5b7870;if(this[_0x3707c1(0x192)])return !![];let _0x25e60a=!![];return this[_0x3707c1(0x180)][_0x3707c1(0x17c)](_0x4fd772)&&(_0x25e60a=this['actions'][_0x4fd772]),_0x25e60a;}['isUserSup'](){return this['isSup'];}}
|
|
7200
7187
|
|
|
7201
7188
|
class SnkErrorHandler {
|
|
7202
7189
|
constructor(app) {
|
|
@@ -7213,7 +7200,11 @@ class SnkErrorHandler {
|
|
|
7213
7200
|
this.processException(reason);
|
|
7214
7201
|
}
|
|
7215
7202
|
else {
|
|
7216
|
-
this._app.
|
|
7203
|
+
this._app.isDebugMode().then((isDebug) => {
|
|
7204
|
+
if (isDebug) {
|
|
7205
|
+
this._app.error("Promise rejeitada", "Erro interno: Uma promise foi rejeitada sem razão determinada.");
|
|
7206
|
+
}
|
|
7207
|
+
});
|
|
7217
7208
|
}
|
|
7218
7209
|
}
|
|
7219
7210
|
}
|
|
@@ -7230,18 +7221,24 @@ class SnkErrorHandler {
|
|
|
7230
7221
|
else if (exception instanceof ErrorException) {
|
|
7231
7222
|
this._app.error(exception.title, exception.message);
|
|
7232
7223
|
}
|
|
7233
|
-
else if (exception instanceof Error) {
|
|
7234
|
-
this._app.error(exception.name, exception.message);
|
|
7235
|
-
}
|
|
7236
7224
|
else {
|
|
7237
|
-
|
|
7238
|
-
|
|
7239
|
-
|
|
7225
|
+
this._app.isDebugMode().then(isDebug => {
|
|
7226
|
+
if (isDebug) {
|
|
7227
|
+
if (exception instanceof Error) {
|
|
7228
|
+
this._app.error(exception.name, exception.message);
|
|
7229
|
+
}
|
|
7230
|
+
else {
|
|
7231
|
+
const title = (exception === null || exception === void 0 ? void 0 : exception.title) || "Erro detectado";
|
|
7232
|
+
const message = (typeof exception === "string") ? exception : exception.message || `Erro interno "${exception}"`;
|
|
7233
|
+
this._app.error(title, message);
|
|
7234
|
+
}
|
|
7235
|
+
}
|
|
7236
|
+
});
|
|
7240
7237
|
}
|
|
7241
7238
|
}
|
|
7242
7239
|
}
|
|
7243
7240
|
|
|
7244
|
-
const
|
|
7241
|
+
function _0x53e1(){const _0x340df8=['2909523kXwted','CompanyName=Sankhya\x20Jiva\x20Tecnologia\x20e\x20Inovao\x20Ltda,LicensedApplication=Sankhya\x20Gestao,LicenseType=SingleApplication,LicensedConcurrentDeveloperCount=2,LicensedProductionInstancesCount=0,AssetReference=AG-019460,ExpiryDate=9_November_2022_[v2]_MTY2Nzk1MjAwMDAwMA==10487151e296ee4360f80961ca960869','1131048CARoeW','502909mLEPmu','447255iQEXuN','428UHbJwW','270AFTxAV','194369jhGqTI','1540nWuTrj','2044062GicUQI','30CkXPWg'];_0x53e1=function(){return _0x340df8;};return _0x53e1();}const _0xc7632f=_0x15c2;function _0x15c2(_0x353a9c,_0x3e4a5a){const _0x53e110=_0x53e1();return _0x15c2=function(_0x15c2aa,_0x219858){_0x15c2aa=_0x15c2aa-0x188;let _0x307231=_0x53e110[_0x15c2aa];return _0x307231;},_0x15c2(_0x353a9c,_0x3e4a5a);}(function(_0x42617e,_0x57debe){const _0x31061a=_0x15c2,_0x128d7d=_0x42617e();while(!![]){try{const _0x1c9bb1=-parseInt(_0x31061a(0x18e))/0x1+-parseInt(_0x31061a(0x189))/0x2+parseInt(_0x31061a(0x18b))/0x3+-parseInt(_0x31061a(0x190))/0x4*(parseInt(_0x31061a(0x188))/0x5)+-parseInt(_0x31061a(0x191))/0x6*(-parseInt(_0x31061a(0x192))/0x7)+parseInt(_0x31061a(0x18d))/0x8+-parseInt(_0x31061a(0x18f))/0x9*(-parseInt(_0x31061a(0x18a))/0xa);if(_0x1c9bb1===_0x57debe)break;else _0x128d7d['push'](_0x128d7d['shift']());}catch(_0x1bd816){_0x128d7d['push'](_0x128d7d['shift']());}}}(_0x53e1,0xe8676));const agGridLicense=_0xc7632f(0x18c);
|
|
7245
7242
|
|
|
7246
7243
|
const snkApplicationCss = ".sc-snk-application-h{display:flex;flex-direction:column;height:100%}";
|
|
7247
7244
|
|
|
@@ -7523,6 +7520,11 @@ const SnkApplication = class {
|
|
|
7523
7520
|
}
|
|
7524
7521
|
}
|
|
7525
7522
|
}
|
|
7523
|
+
async isDebugMode() {
|
|
7524
|
+
return new Promise(accept => {
|
|
7525
|
+
accept(window['isDebugMode']);
|
|
7526
|
+
});
|
|
7527
|
+
}
|
|
7526
7528
|
cleanPopUpTitle() {
|
|
7527
7529
|
this._popUp['ezTitle'] = "";
|
|
7528
7530
|
}
|
|
@@ -7536,6 +7538,7 @@ const SnkApplication = class {
|
|
|
7536
7538
|
return this.executeSearch(searchArgument, fieldName, dataUnit);
|
|
7537
7539
|
});
|
|
7538
7540
|
ApplicationContext.setContextValue("__EZUI__GRID_LICENSE__", agGridLicense);
|
|
7541
|
+
ErrorTracking.init();
|
|
7539
7542
|
}
|
|
7540
7543
|
connectedCallback() {
|
|
7541
7544
|
DataFetcher.addRequestListener(this._requestListener);
|