@sankhyalabs/sankhyablocks 8.3.0 → 8.3.2
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/{ConfigStorage-e9d7fa82.js → ConfigStorage-4dd5e72c.js} +4 -4
- package/dist/cjs/{DataFetcher-39b63a1e.js → DataFetcher-65199c00.js} +73 -19
- package/dist/cjs/{SnkFormConfigManager-2f8eccd9.js → SnkFormConfigManager-44717597.js} +2 -2
- package/dist/cjs/{auth-fetcher-d407c31c.js → auth-fetcher-7ed6d3e3.js} +1 -1
- package/dist/cjs/{dataunit-fetcher-15a7cc88.js → dataunit-fetcher-102030d8.js} +1 -1
- package/dist/cjs/{filter-bar-config-fetcher-24548cec.js → filter-bar-config-fetcher-2ab64f92.js} +1 -1
- package/dist/cjs/{form-config-fetcher-ab3ce222.js → form-config-fetcher-49993843.js} +2 -2
- package/dist/cjs/{pesquisa-fetcher-96c042aa.js → pesquisa-fetcher-23adae20.js} +1 -1
- package/dist/cjs/{resource-fetcher-64102551.js → resource-fetcher-8d12fee7.js} +1 -1
- package/dist/cjs/snk-actions-button.cjs.entry.js +2 -2
- package/dist/cjs/snk-application.cjs.entry.js +8 -8
- package/dist/cjs/snk-attach.cjs.entry.js +2 -2
- package/dist/cjs/snk-crud.cjs.entry.js +4 -4
- package/dist/cjs/snk-data-exporter.cjs.entry.js +1 -1
- package/dist/cjs/snk-detail-view.cjs.entry.js +8 -8
- package/dist/cjs/snk-filter-bar.cjs.entry.js +5 -5
- package/dist/cjs/snk-filter-detail.cjs.entry.js +3 -3
- package/dist/cjs/snk-filter-modal-item.cjs.entry.js +5 -5
- package/dist/cjs/snk-form-config.cjs.entry.js +3 -3
- package/dist/cjs/snk-form.cjs.entry.js +6 -6
- package/dist/cjs/snk-grid-config.cjs.entry.js +5 -5
- package/dist/cjs/snk-grid.cjs.entry.js +5 -5
- package/dist/cjs/{snk-guides-viewer-8518c61b.js → snk-guides-viewer-83cd2f15.js} +3 -3
- package/dist/cjs/snk-guides-viewer.cjs.entry.js +8 -8
- package/dist/cjs/snk-personalized-filter.cjs.entry.js +5 -5
- package/dist/cjs/snk-print-selector.cjs.entry.js +1 -1
- package/dist/cjs/snk-simple-crud.cjs.entry.js +2 -2
- package/dist/collection/lib/http/data-fetcher/DataFetcher.js +86 -19
- package/dist/components/DataFetcher.js +73 -19
- package/dist/esm/{ConfigStorage-1090289a.js → ConfigStorage-d0e26692.js} +4 -4
- package/dist/esm/{DataFetcher-a4ed43e7.js → DataFetcher-4f5ad71c.js} +73 -19
- package/dist/esm/{SnkFormConfigManager-de537eca.js → SnkFormConfigManager-457554ca.js} +2 -2
- package/dist/esm/{auth-fetcher-c53e0d6c.js → auth-fetcher-852e26c9.js} +1 -1
- package/dist/esm/{dataunit-fetcher-8d0bfa4a.js → dataunit-fetcher-97dd5148.js} +1 -1
- package/dist/esm/{filter-bar-config-fetcher-2417b8cf.js → filter-bar-config-fetcher-1093db95.js} +1 -1
- package/dist/esm/{form-config-fetcher-4065db9a.js → form-config-fetcher-ff72a867.js} +2 -2
- package/dist/esm/{pesquisa-fetcher-7460b876.js → pesquisa-fetcher-d82df64b.js} +1 -1
- package/dist/esm/{resource-fetcher-45a70066.js → resource-fetcher-be4d1ba4.js} +1 -1
- package/dist/esm/snk-actions-button.entry.js +2 -2
- package/dist/esm/snk-application.entry.js +8 -8
- package/dist/esm/snk-attach.entry.js +2 -2
- package/dist/esm/snk-crud.entry.js +4 -4
- package/dist/esm/snk-data-exporter.entry.js +1 -1
- package/dist/esm/snk-detail-view.entry.js +8 -8
- package/dist/esm/snk-filter-bar.entry.js +5 -5
- package/dist/esm/snk-filter-detail.entry.js +3 -3
- package/dist/esm/snk-filter-modal-item.entry.js +5 -5
- package/dist/esm/snk-form-config.entry.js +3 -3
- package/dist/esm/snk-form.entry.js +6 -6
- package/dist/esm/snk-grid-config.entry.js +5 -5
- package/dist/esm/snk-grid.entry.js +5 -5
- package/dist/esm/{snk-guides-viewer-cdecff6e.js → snk-guides-viewer-202c3c4d.js} +3 -3
- package/dist/esm/snk-guides-viewer.entry.js +8 -8
- package/dist/esm/snk-personalized-filter.entry.js +5 -5
- package/dist/esm/snk-print-selector.entry.js +1 -1
- package/dist/esm/snk-simple-crud.entry.js +2 -2
- package/dist/sankhyablocks/{p-4514fc6a.entry.js → p-030a2da4.entry.js} +1 -1
- package/dist/sankhyablocks/{p-6bb904bb.entry.js → p-1208becf.entry.js} +1 -1
- package/dist/sankhyablocks/{p-7588f006.entry.js → p-17724bee.entry.js} +1 -1
- package/dist/sankhyablocks/{p-0fb83448.js → p-37b17041.js} +1 -1
- package/dist/sankhyablocks/{p-6f0795c8.entry.js → p-3916c825.entry.js} +1 -1
- package/dist/sankhyablocks/{p-c6feb995.entry.js → p-3ffad8ca.entry.js} +1 -1
- package/dist/sankhyablocks/{p-9d18017a.js → p-435259af.js} +1 -1
- package/dist/sankhyablocks/{p-6e06175e.entry.js → p-44fe945a.entry.js} +1 -1
- package/dist/sankhyablocks/{p-d7c7a289.entry.js → p-4fc5a0db.entry.js} +1 -1
- package/dist/sankhyablocks/{p-216b2102.entry.js → p-5add4151.entry.js} +1 -1
- package/dist/sankhyablocks/{p-10b2aedc.entry.js → p-5de83141.entry.js} +1 -1
- package/dist/sankhyablocks/{p-a42dd503.entry.js → p-6be9191f.entry.js} +1 -1
- package/dist/sankhyablocks/{p-44e66c8d.js → p-6ee5d42c.js} +1 -1
- package/dist/sankhyablocks/{p-5994af77.js → p-72d7f00c.js} +1 -1
- package/dist/sankhyablocks/{p-1f63dcd4.entry.js → p-7352acf8.entry.js} +1 -1
- package/dist/sankhyablocks/{p-b978da60.js → p-7d9302e2.js} +1 -1
- package/dist/sankhyablocks/{p-52c6b2e7.js → p-8115f7a2.js} +1 -1
- package/dist/sankhyablocks/{p-0bd9c412.js → p-8903ffc6.js} +1 -1
- package/dist/sankhyablocks/{p-8f3652bf.entry.js → p-8dbb4c6c.entry.js} +2 -2
- package/dist/sankhyablocks/p-935bfc1c.entry.js +1 -0
- package/dist/sankhyablocks/{p-f7eded3a.entry.js → p-9395cf73.entry.js} +1 -1
- package/dist/sankhyablocks/{p-847e6c20.js → p-9d36d914.js} +2 -2
- package/dist/sankhyablocks/{p-0848ee4d.entry.js → p-aa6f27bd.entry.js} +1 -1
- package/dist/sankhyablocks/{p-f3b7b69e.js → p-aeaa5253.js} +1 -1
- package/dist/sankhyablocks/p-c1273e40.js +1 -0
- package/dist/sankhyablocks/{p-50c13cc8.entry.js → p-f5c33da3.entry.js} +1 -1
- package/dist/sankhyablocks/{p-9471cbc9.entry.js → p-f847d53a.entry.js} +1 -1
- package/dist/sankhyablocks/sankhyablocks.esm.js +1 -1
- package/dist/types/lib/http/data-fetcher/DataFetcher.d.ts +1 -1
- package/package.json +1 -1
- package/dist/sankhyablocks/p-b04fb9d4.js +0 -1
- package/dist/sankhyablocks/p-ff7383b0.entry.js +0 -1
@@ -1,3 +1,11 @@
|
|
1
|
+
var __asyncValues = (this && this.__asyncValues) || function (o) {
|
2
|
+
if (!Symbol.asyncIterator)
|
3
|
+
throw new TypeError("Symbol.asyncIterator is not defined.");
|
4
|
+
var m = o[Symbol.asyncIterator], i;
|
5
|
+
return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i);
|
6
|
+
function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }
|
7
|
+
function settle(resolve, reject, d, v) { Promise.resolve(v).then(function (v) { resolve({ value: v, done: d }); }, reject); }
|
8
|
+
};
|
1
9
|
import { ApplicationContext, ErrorException, ObjectUtils, WarningException } from '@sankhyalabs/core';
|
2
10
|
import { batchRequests } from 'graphql-request';
|
3
11
|
import UrlUtils from "../../../lib/utils/urlutils";
|
@@ -134,18 +142,71 @@ export class DataFetcher {
|
|
134
142
|
}
|
135
143
|
return false;
|
136
144
|
}
|
137
|
-
|
145
|
+
async processServiceBrokerClientEvents(processParams) {
|
146
|
+
var _a, e_1, _b, _c, _d, e_2, _e, _f;
|
147
|
+
const { clientEvents, serviceName, payloadJson, accept, reject } = processParams;
|
138
148
|
if (!(clientEvents === null || clientEvents === void 0 ? void 0 : clientEvents.length)) {
|
139
149
|
return;
|
140
150
|
}
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
151
|
+
const recaller = new ServiceBrokerRecaller(serviceName, payloadJson, accept, reject);
|
152
|
+
try {
|
153
|
+
for (var _g = true, clientEvents_1 = __asyncValues(clientEvents), clientEvents_1_1; clientEvents_1_1 = await clientEvents_1.next(), _a = clientEvents_1_1.done, !_a;) {
|
154
|
+
_c = clientEvents_1_1.value;
|
155
|
+
_g = false;
|
156
|
+
try {
|
157
|
+
const clientEvent = _c;
|
158
|
+
if (DataFetcher.hasClientEvent(clientEvent.id)) {
|
159
|
+
const handlers = DataFetcher.clientEventsByID.get(clientEvent.id);
|
160
|
+
const handlerClientEvent = {
|
161
|
+
id: clientEvent.id,
|
162
|
+
content: clientEvent
|
163
|
+
};
|
164
|
+
try {
|
165
|
+
for (var _h = true, handlers_1 = (e_2 = void 0, __asyncValues(handlers)), handlers_1_1; handlers_1_1 = await handlers_1.next(), _d = handlers_1_1.done, !_d;) {
|
166
|
+
_f = handlers_1_1.value;
|
167
|
+
_h = false;
|
168
|
+
try {
|
169
|
+
const handler = _f;
|
170
|
+
await handler(handlerClientEvent, recaller);
|
171
|
+
}
|
172
|
+
finally {
|
173
|
+
_h = true;
|
174
|
+
}
|
175
|
+
}
|
176
|
+
}
|
177
|
+
catch (e_2_1) {
|
178
|
+
e_2 = { error: e_2_1 };
|
179
|
+
}
|
180
|
+
finally {
|
181
|
+
try {
|
182
|
+
if (!_h && !_d && (_e = handlers_1.return))
|
183
|
+
await _e.call(handlers_1);
|
184
|
+
}
|
185
|
+
finally {
|
186
|
+
if (e_2)
|
187
|
+
throw e_2.error;
|
188
|
+
}
|
189
|
+
}
|
190
|
+
}
|
191
|
+
}
|
192
|
+
finally {
|
193
|
+
_g = true;
|
194
|
+
}
|
147
195
|
}
|
148
|
-
}
|
196
|
+
}
|
197
|
+
catch (e_1_1) {
|
198
|
+
e_1 = { error: e_1_1 };
|
199
|
+
}
|
200
|
+
finally {
|
201
|
+
try {
|
202
|
+
if (!_g && !_a && (_b = clientEvents_1.return))
|
203
|
+
await _b.call(clientEvents_1);
|
204
|
+
}
|
205
|
+
finally {
|
206
|
+
if (e_1)
|
207
|
+
throw e_1.error;
|
208
|
+
}
|
209
|
+
}
|
149
210
|
}
|
150
211
|
processPrinting(payload) {
|
151
212
|
if ((payload === null || payload === void 0 ? void 0 : payload.pendingPrinting) === 'true') {
|
@@ -167,12 +228,12 @@ export class DataFetcher {
|
|
167
228
|
};
|
168
229
|
}
|
169
230
|
async callServiceBroker(serviceName, payload, options) {
|
170
|
-
return new Promise((accept, reject) => {
|
231
|
+
return new Promise(async (accept, reject) => {
|
171
232
|
const parts = serviceName.split("@");
|
172
233
|
const [module, name] = parts.length === 2 ? parts : ['mge', serviceName];
|
173
234
|
const ctx = this.getContext(module);
|
174
235
|
let url = `${ctx.baseUrl}?serviceName=${name}&counter=21&application=${ctx.appName}&outputType=json&preventTransform=false&mgeSession=${ctx.mgeSession}&resourceID=${ctx.resourceID}&globalID=${ctx.globalID}&allowConcurrentCalls=true`;
|
175
|
-
url = this.addUrlParams(options, url);
|
236
|
+
url = await this.addUrlParams(options, url);
|
176
237
|
document.cookie = `JSESSIONID=${ctx.mgeSession};`;
|
177
238
|
const http = new XMLHttpRequest();
|
178
239
|
var payloadJson = {};
|
@@ -197,11 +258,12 @@ export class DataFetcher {
|
|
197
258
|
http.open("POST", url, true);
|
198
259
|
http.withCredentials = true;
|
199
260
|
http.send(ObjectUtils.objectToString(payloadJson));
|
200
|
-
http.onreadystatechange = () => {
|
261
|
+
http.onreadystatechange = async () => {
|
201
262
|
var _a;
|
202
263
|
if (http.readyState == 4 && http.status == 200) {
|
203
264
|
try {
|
204
265
|
const jsonResp = JSON.parse(http.responseText);
|
266
|
+
await this.processServiceBrokerClientEvents({ clientEvents: jsonResp === null || jsonResp === void 0 ? void 0 : jsonResp.clientEvents, serviceName, payloadJson, accept, reject });
|
205
267
|
if (this.isServiceBrokerError(jsonResp)) {
|
206
268
|
reject(this.processServiceBrokerErrorInfo(jsonResp));
|
207
269
|
}
|
@@ -214,7 +276,6 @@ export class DataFetcher {
|
|
214
276
|
(_a = this.application) === null || _a === void 0 ? void 0 : _a.info(jsonResp.statusMessage);
|
215
277
|
}
|
216
278
|
}
|
217
|
-
this.proccessServiceBorkerClientEvents(jsonResp === null || jsonResp === void 0 ? void 0 : jsonResp.clientEvents, serviceName, payloadJson, accept, reject);
|
218
279
|
this.processPrinting(jsonResp);
|
219
280
|
}
|
220
281
|
catch (err) {
|
@@ -229,16 +290,22 @@ export class DataFetcher {
|
|
229
290
|
};
|
230
291
|
});
|
231
292
|
}
|
232
|
-
addUrlParams(options, url) {
|
233
|
-
|
234
|
-
|
293
|
+
async addUrlParams(options, url) {
|
294
|
+
var _a;
|
295
|
+
const params = (options === null || options === void 0 ? void 0 : options.urlParams) || {};
|
296
|
+
const vss = await ((_a = this.application) === null || _a === void 0 ? void 0 : _a.getAttributeFromHTMLWrapper("VSS"));
|
297
|
+
if (!StringUtils.isEmpty(vss)) {
|
298
|
+
params.vss = vss;
|
299
|
+
}
|
300
|
+
const paramKeys = Object.keys(params);
|
301
|
+
if (paramKeys.length === 0) {
|
235
302
|
return url;
|
236
303
|
}
|
237
|
-
url
|
304
|
+
if (url.indexOf('?') === -1) {
|
305
|
+
url += '?';
|
306
|
+
}
|
238
307
|
for (const key in params) {
|
239
|
-
|
240
|
-
url += `${key}=${params[key]}`;
|
241
|
-
}
|
308
|
+
url += `&${key}=${params[key]}`;
|
242
309
|
}
|
243
310
|
return url;
|
244
311
|
}
|
@@ -6677,6 +6677,13 @@ class AppletImpressao {
|
|
6677
6677
|
}
|
6678
6678
|
}
|
6679
6679
|
|
6680
|
+
var __asyncValues = (undefined && undefined.__asyncValues) || function (o) {
|
6681
|
+
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
|
6682
|
+
var m = o[Symbol.asyncIterator], i;
|
6683
|
+
return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i);
|
6684
|
+
function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }
|
6685
|
+
function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }
|
6686
|
+
};
|
6680
6687
|
class DataFetcher {
|
6681
6688
|
constructor() {
|
6682
6689
|
this.GRAPHQL_PATH = `/${window.MGE_MODULE_NAME || 'mgefin-bff'}/graphql`;
|
@@ -6806,18 +6813,59 @@ class DataFetcher {
|
|
6806
6813
|
}
|
6807
6814
|
return false;
|
6808
6815
|
}
|
6809
|
-
|
6816
|
+
async processServiceBrokerClientEvents(processParams) {
|
6817
|
+
var _a, e_1, _b, _c, _d, e_2, _e, _f;
|
6818
|
+
const { clientEvents, serviceName, payloadJson, accept, reject } = processParams;
|
6810
6819
|
if (!(clientEvents === null || clientEvents === void 0 ? void 0 : clientEvents.length)) {
|
6811
6820
|
return;
|
6812
6821
|
}
|
6813
|
-
|
6814
|
-
|
6815
|
-
|
6816
|
-
|
6817
|
-
|
6818
|
-
|
6822
|
+
const recaller = new ServiceBrokerRecaller(serviceName, payloadJson, accept, reject);
|
6823
|
+
try {
|
6824
|
+
for (var _g = true, clientEvents_1 = __asyncValues(clientEvents), clientEvents_1_1; clientEvents_1_1 = await clientEvents_1.next(), _a = clientEvents_1_1.done, !_a;) {
|
6825
|
+
_c = clientEvents_1_1.value;
|
6826
|
+
_g = false;
|
6827
|
+
try {
|
6828
|
+
const clientEvent = _c;
|
6829
|
+
if (DataFetcher.hasClientEvent(clientEvent.id)) {
|
6830
|
+
const handlers = DataFetcher.clientEventsByID.get(clientEvent.id);
|
6831
|
+
const handlerClientEvent = {
|
6832
|
+
id: clientEvent.id,
|
6833
|
+
content: clientEvent
|
6834
|
+
};
|
6835
|
+
try {
|
6836
|
+
for (var _h = true, handlers_1 = (e_2 = void 0, __asyncValues(handlers)), handlers_1_1; handlers_1_1 = await handlers_1.next(), _d = handlers_1_1.done, !_d;) {
|
6837
|
+
_f = handlers_1_1.value;
|
6838
|
+
_h = false;
|
6839
|
+
try {
|
6840
|
+
const handler = _f;
|
6841
|
+
await handler(handlerClientEvent, recaller);
|
6842
|
+
}
|
6843
|
+
finally {
|
6844
|
+
_h = true;
|
6845
|
+
}
|
6846
|
+
}
|
6847
|
+
}
|
6848
|
+
catch (e_2_1) { e_2 = { error: e_2_1 }; }
|
6849
|
+
finally {
|
6850
|
+
try {
|
6851
|
+
if (!_h && !_d && (_e = handlers_1.return)) await _e.call(handlers_1);
|
6852
|
+
}
|
6853
|
+
finally { if (e_2) throw e_2.error; }
|
6854
|
+
}
|
6855
|
+
}
|
6856
|
+
}
|
6857
|
+
finally {
|
6858
|
+
_g = true;
|
6859
|
+
}
|
6819
6860
|
}
|
6820
|
-
}
|
6861
|
+
}
|
6862
|
+
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
6863
|
+
finally {
|
6864
|
+
try {
|
6865
|
+
if (!_g && !_a && (_b = clientEvents_1.return)) await _b.call(clientEvents_1);
|
6866
|
+
}
|
6867
|
+
finally { if (e_1) throw e_1.error; }
|
6868
|
+
}
|
6821
6869
|
}
|
6822
6870
|
processPrinting(payload) {
|
6823
6871
|
if ((payload === null || payload === void 0 ? void 0 : payload.pendingPrinting) === 'true') {
|
@@ -6839,12 +6887,12 @@ class DataFetcher {
|
|
6839
6887
|
};
|
6840
6888
|
}
|
6841
6889
|
async callServiceBroker(serviceName, payload, options) {
|
6842
|
-
return new Promise((accept, reject) => {
|
6890
|
+
return new Promise(async (accept, reject) => {
|
6843
6891
|
const parts = serviceName.split("@");
|
6844
6892
|
const [module, name] = parts.length === 2 ? parts : ['mge', serviceName];
|
6845
6893
|
const ctx = this.getContext(module);
|
6846
6894
|
let url = `${ctx.baseUrl}?serviceName=${name}&counter=21&application=${ctx.appName}&outputType=json&preventTransform=false&mgeSession=${ctx.mgeSession}&resourceID=${ctx.resourceID}&globalID=${ctx.globalID}&allowConcurrentCalls=true`;
|
6847
|
-
url = this.addUrlParams(options, url);
|
6895
|
+
url = await this.addUrlParams(options, url);
|
6848
6896
|
document.cookie = `JSESSIONID=${ctx.mgeSession};`;
|
6849
6897
|
const http = new XMLHttpRequest();
|
6850
6898
|
var payloadJson = {};
|
@@ -6869,11 +6917,12 @@ class DataFetcher {
|
|
6869
6917
|
http.open("POST", url, true);
|
6870
6918
|
http.withCredentials = true;
|
6871
6919
|
http.send(ObjectUtils.objectToString(payloadJson));
|
6872
|
-
http.onreadystatechange = () => {
|
6920
|
+
http.onreadystatechange = async () => {
|
6873
6921
|
var _a;
|
6874
6922
|
if (http.readyState == 4 && http.status == 200) {
|
6875
6923
|
try {
|
6876
6924
|
const jsonResp = JSON.parse(http.responseText);
|
6925
|
+
await this.processServiceBrokerClientEvents({ clientEvents: jsonResp === null || jsonResp === void 0 ? void 0 : jsonResp.clientEvents, serviceName, payloadJson, accept, reject });
|
6877
6926
|
if (this.isServiceBrokerError(jsonResp)) {
|
6878
6927
|
reject(this.processServiceBrokerErrorInfo(jsonResp));
|
6879
6928
|
}
|
@@ -6886,7 +6935,6 @@ class DataFetcher {
|
|
6886
6935
|
(_a = this.application) === null || _a === void 0 ? void 0 : _a.info(jsonResp.statusMessage);
|
6887
6936
|
}
|
6888
6937
|
}
|
6889
|
-
this.proccessServiceBorkerClientEvents(jsonResp === null || jsonResp === void 0 ? void 0 : jsonResp.clientEvents, serviceName, payloadJson, accept, reject);
|
6890
6938
|
this.processPrinting(jsonResp);
|
6891
6939
|
}
|
6892
6940
|
catch (err) {
|
@@ -6901,16 +6949,22 @@ class DataFetcher {
|
|
6901
6949
|
};
|
6902
6950
|
});
|
6903
6951
|
}
|
6904
|
-
addUrlParams(options, url) {
|
6905
|
-
|
6906
|
-
|
6952
|
+
async addUrlParams(options, url) {
|
6953
|
+
var _a;
|
6954
|
+
const params = (options === null || options === void 0 ? void 0 : options.urlParams) || {};
|
6955
|
+
const vss = await ((_a = this.application) === null || _a === void 0 ? void 0 : _a.getAttributeFromHTMLWrapper("VSS"));
|
6956
|
+
if (!StringUtils.isEmpty(vss)) {
|
6957
|
+
params.vss = vss;
|
6958
|
+
}
|
6959
|
+
const paramKeys = Object.keys(params);
|
6960
|
+
if (paramKeys.length === 0) {
|
6907
6961
|
return url;
|
6908
6962
|
}
|
6909
|
-
url
|
6963
|
+
if (url.indexOf('?') === -1) {
|
6964
|
+
url += '?';
|
6965
|
+
}
|
6910
6966
|
for (const key in params) {
|
6911
|
-
|
6912
|
-
url += `${key}=${params[key]}`;
|
6913
|
-
}
|
6967
|
+
url += `&${key}=${params[key]}`;
|
6914
6968
|
}
|
6915
6969
|
return url;
|
6916
6970
|
}
|
@@ -1,8 +1,8 @@
|
|
1
1
|
import { ApplicationContext } from '@sankhyalabs/core';
|
2
|
-
import { F as FormConfigFetcher } from './form-config-fetcher-
|
3
|
-
import { R as ResourceFetcher } from './resource-fetcher-
|
4
|
-
import { F as FilterBarConfigFetcher } from './filter-bar-config-fetcher-
|
5
|
-
import { d as dist, D as DataFetcher } from './DataFetcher-
|
2
|
+
import { F as FormConfigFetcher } from './form-config-fetcher-ff72a867.js';
|
3
|
+
import { R as ResourceFetcher } from './resource-fetcher-be4d1ba4.js';
|
4
|
+
import { F as FilterBarConfigFetcher } from './filter-bar-config-fetcher-1093db95.js';
|
5
|
+
import { d as dist, D as DataFetcher } from './DataFetcher-4f5ad71c.js';
|
6
6
|
|
7
7
|
class GridConfigFetcher extends ResourceFetcher {
|
8
8
|
constructor() {
|
@@ -6677,6 +6677,13 @@ class AppletImpressao {
|
|
6677
6677
|
}
|
6678
6678
|
}
|
6679
6679
|
|
6680
|
+
var __asyncValues = (undefined && undefined.__asyncValues) || function (o) {
|
6681
|
+
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
|
6682
|
+
var m = o[Symbol.asyncIterator], i;
|
6683
|
+
return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i);
|
6684
|
+
function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }
|
6685
|
+
function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }
|
6686
|
+
};
|
6680
6687
|
class DataFetcher {
|
6681
6688
|
constructor() {
|
6682
6689
|
this.GRAPHQL_PATH = `/${window.MGE_MODULE_NAME || 'mgefin-bff'}/graphql`;
|
@@ -6806,18 +6813,59 @@ class DataFetcher {
|
|
6806
6813
|
}
|
6807
6814
|
return false;
|
6808
6815
|
}
|
6809
|
-
|
6816
|
+
async processServiceBrokerClientEvents(processParams) {
|
6817
|
+
var _a, e_1, _b, _c, _d, e_2, _e, _f;
|
6818
|
+
const { clientEvents, serviceName, payloadJson, accept, reject } = processParams;
|
6810
6819
|
if (!(clientEvents === null || clientEvents === void 0 ? void 0 : clientEvents.length)) {
|
6811
6820
|
return;
|
6812
6821
|
}
|
6813
|
-
|
6814
|
-
|
6815
|
-
|
6816
|
-
|
6817
|
-
|
6818
|
-
|
6822
|
+
const recaller = new ServiceBrokerRecaller(serviceName, payloadJson, accept, reject);
|
6823
|
+
try {
|
6824
|
+
for (var _g = true, clientEvents_1 = __asyncValues(clientEvents), clientEvents_1_1; clientEvents_1_1 = await clientEvents_1.next(), _a = clientEvents_1_1.done, !_a;) {
|
6825
|
+
_c = clientEvents_1_1.value;
|
6826
|
+
_g = false;
|
6827
|
+
try {
|
6828
|
+
const clientEvent = _c;
|
6829
|
+
if (DataFetcher.hasClientEvent(clientEvent.id)) {
|
6830
|
+
const handlers = DataFetcher.clientEventsByID.get(clientEvent.id);
|
6831
|
+
const handlerClientEvent = {
|
6832
|
+
id: clientEvent.id,
|
6833
|
+
content: clientEvent
|
6834
|
+
};
|
6835
|
+
try {
|
6836
|
+
for (var _h = true, handlers_1 = (e_2 = void 0, __asyncValues(handlers)), handlers_1_1; handlers_1_1 = await handlers_1.next(), _d = handlers_1_1.done, !_d;) {
|
6837
|
+
_f = handlers_1_1.value;
|
6838
|
+
_h = false;
|
6839
|
+
try {
|
6840
|
+
const handler = _f;
|
6841
|
+
await handler(handlerClientEvent, recaller);
|
6842
|
+
}
|
6843
|
+
finally {
|
6844
|
+
_h = true;
|
6845
|
+
}
|
6846
|
+
}
|
6847
|
+
}
|
6848
|
+
catch (e_2_1) { e_2 = { error: e_2_1 }; }
|
6849
|
+
finally {
|
6850
|
+
try {
|
6851
|
+
if (!_h && !_d && (_e = handlers_1.return)) await _e.call(handlers_1);
|
6852
|
+
}
|
6853
|
+
finally { if (e_2) throw e_2.error; }
|
6854
|
+
}
|
6855
|
+
}
|
6856
|
+
}
|
6857
|
+
finally {
|
6858
|
+
_g = true;
|
6859
|
+
}
|
6819
6860
|
}
|
6820
|
-
}
|
6861
|
+
}
|
6862
|
+
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
6863
|
+
finally {
|
6864
|
+
try {
|
6865
|
+
if (!_g && !_a && (_b = clientEvents_1.return)) await _b.call(clientEvents_1);
|
6866
|
+
}
|
6867
|
+
finally { if (e_1) throw e_1.error; }
|
6868
|
+
}
|
6821
6869
|
}
|
6822
6870
|
processPrinting(payload) {
|
6823
6871
|
if ((payload === null || payload === void 0 ? void 0 : payload.pendingPrinting) === 'true') {
|
@@ -6839,12 +6887,12 @@ class DataFetcher {
|
|
6839
6887
|
};
|
6840
6888
|
}
|
6841
6889
|
async callServiceBroker(serviceName, payload, options) {
|
6842
|
-
return new Promise((accept, reject) => {
|
6890
|
+
return new Promise(async (accept, reject) => {
|
6843
6891
|
const parts = serviceName.split("@");
|
6844
6892
|
const [module, name] = parts.length === 2 ? parts : ['mge', serviceName];
|
6845
6893
|
const ctx = this.getContext(module);
|
6846
6894
|
let url = `${ctx.baseUrl}?serviceName=${name}&counter=21&application=${ctx.appName}&outputType=json&preventTransform=false&mgeSession=${ctx.mgeSession}&resourceID=${ctx.resourceID}&globalID=${ctx.globalID}&allowConcurrentCalls=true`;
|
6847
|
-
url = this.addUrlParams(options, url);
|
6895
|
+
url = await this.addUrlParams(options, url);
|
6848
6896
|
document.cookie = `JSESSIONID=${ctx.mgeSession};`;
|
6849
6897
|
const http = new XMLHttpRequest();
|
6850
6898
|
var payloadJson = {};
|
@@ -6869,11 +6917,12 @@ class DataFetcher {
|
|
6869
6917
|
http.open("POST", url, true);
|
6870
6918
|
http.withCredentials = true;
|
6871
6919
|
http.send(ObjectUtils.objectToString(payloadJson));
|
6872
|
-
http.onreadystatechange = () => {
|
6920
|
+
http.onreadystatechange = async () => {
|
6873
6921
|
var _a;
|
6874
6922
|
if (http.readyState == 4 && http.status == 200) {
|
6875
6923
|
try {
|
6876
6924
|
const jsonResp = JSON.parse(http.responseText);
|
6925
|
+
await this.processServiceBrokerClientEvents({ clientEvents: jsonResp === null || jsonResp === void 0 ? void 0 : jsonResp.clientEvents, serviceName, payloadJson, accept, reject });
|
6877
6926
|
if (this.isServiceBrokerError(jsonResp)) {
|
6878
6927
|
reject(this.processServiceBrokerErrorInfo(jsonResp));
|
6879
6928
|
}
|
@@ -6886,7 +6935,6 @@ class DataFetcher {
|
|
6886
6935
|
(_a = this.application) === null || _a === void 0 ? void 0 : _a.info(jsonResp.statusMessage);
|
6887
6936
|
}
|
6888
6937
|
}
|
6889
|
-
this.proccessServiceBorkerClientEvents(jsonResp === null || jsonResp === void 0 ? void 0 : jsonResp.clientEvents, serviceName, payloadJson, accept, reject);
|
6890
6938
|
this.processPrinting(jsonResp);
|
6891
6939
|
}
|
6892
6940
|
catch (err) {
|
@@ -6901,16 +6949,22 @@ class DataFetcher {
|
|
6901
6949
|
};
|
6902
6950
|
});
|
6903
6951
|
}
|
6904
|
-
addUrlParams(options, url) {
|
6905
|
-
|
6906
|
-
|
6952
|
+
async addUrlParams(options, url) {
|
6953
|
+
var _a;
|
6954
|
+
const params = (options === null || options === void 0 ? void 0 : options.urlParams) || {};
|
6955
|
+
const vss = await ((_a = this.application) === null || _a === void 0 ? void 0 : _a.getAttributeFromHTMLWrapper("VSS"));
|
6956
|
+
if (!StringUtils.isEmpty(vss)) {
|
6957
|
+
params.vss = vss;
|
6958
|
+
}
|
6959
|
+
const paramKeys = Object.keys(params);
|
6960
|
+
if (paramKeys.length === 0) {
|
6907
6961
|
return url;
|
6908
6962
|
}
|
6909
|
-
url
|
6963
|
+
if (url.indexOf('?') === -1) {
|
6964
|
+
url += '?';
|
6965
|
+
}
|
6910
6966
|
for (const key in params) {
|
6911
|
-
|
6912
|
-
url += `${key}=${params[key]}`;
|
6913
|
-
}
|
6967
|
+
url += `&${key}=${params[key]}`;
|
6914
6968
|
}
|
6915
6969
|
return url;
|
6916
6970
|
}
|
@@ -1,6 +1,6 @@
|
|
1
|
-
import { C as ConfigStorage } from './ConfigStorage-
|
1
|
+
import { C as ConfigStorage } from './ConfigStorage-d0e26692.js';
|
2
2
|
import { ObjectUtils } from '@sankhyalabs/core';
|
3
|
-
import { F as FormConfigFetcher } from './form-config-fetcher-
|
3
|
+
import { F as FormConfigFetcher } from './form-config-fetcher-ff72a867.js';
|
4
4
|
|
5
5
|
class SnkFormConfigManager {
|
6
6
|
constructor(configName, onConfigChange) {
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import { DataUnit, StringUtils, DataType, DataUnitStorage, ChangeOperation } from '@sankhyalabs/core';
|
2
|
-
import { d as dist, D as DataFetcher } from './DataFetcher-
|
2
|
+
import { d as dist, D as DataFetcher } from './DataFetcher-4f5ad71c.js';
|
3
3
|
import { DISTINCT_FILTER_NAME_PREFIX } from '@sankhyalabs/ezui/dist/collection/utils/constants';
|
4
4
|
import { DataUnitTransient } from '@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata';
|
5
5
|
|
package/dist/esm/{filter-bar-config-fetcher-2417b8cf.js → filter-bar-config-fetcher-1093db95.js}
RENAMED
@@ -1,5 +1,5 @@
|
|
1
1
|
import { F as FilterItemType } from './filter-item-type.enum-5028ed3f.js';
|
2
|
-
import { R as ResourceFetcher } from './resource-fetcher-
|
2
|
+
import { R as ResourceFetcher } from './resource-fetcher-be4d1ba4.js';
|
3
3
|
|
4
4
|
var __rest = (undefined && undefined.__rest) || function (s, e) {
|
5
5
|
var t = {};
|
@@ -1,6 +1,6 @@
|
|
1
|
-
import { d as dist, D as DataFetcher } from './DataFetcher-
|
1
|
+
import { d as dist, D as DataFetcher } from './DataFetcher-4f5ad71c.js';
|
2
2
|
import { ObjectUtils } from '@sankhyalabs/core';
|
3
|
-
import { R as ResourceFetcher } from './resource-fetcher-
|
3
|
+
import { R as ResourceFetcher } from './resource-fetcher-be4d1ba4.js';
|
4
4
|
|
5
5
|
class FormConfigFetcher extends ResourceFetcher {
|
6
6
|
constructor() {
|
@@ -1,8 +1,8 @@
|
|
1
1
|
import { r as registerInstance, h, H as Host, g as getElement } from './index-a7d3d3f1.js';
|
2
2
|
import { ApplicationContext, StringUtils, ErrorException, WarningException, ObjectUtils, DateUtils, ArrayUtils, ElementIDUtils } from '@sankhyalabs/core';
|
3
|
-
import { D as DataFetcher } from './DataFetcher-
|
3
|
+
import { D as DataFetcher } from './DataFetcher-4f5ad71c.js';
|
4
4
|
import { P as ParamType } from './ParamType-d5152b06.js';
|
5
|
-
import './pesquisa-fetcher-
|
5
|
+
import './pesquisa-fetcher-d82df64b.js';
|
6
6
|
import './index-1564817d.js';
|
7
7
|
import './_commonjsHelpers-9943807e.js';
|
8
8
|
import '@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata';
|
@@ -1,17 +1,17 @@
|
|
1
1
|
import { r as registerInstance, c as createEvent, h, g as getElement } from './index-a7d3d3f1.js';
|
2
2
|
import { WaitingChangeException, WarningException, ErrorException, ObjectUtils, DateUtils, StringUtils, OnboardingUtils, DependencyType, ElementIDUtils, ApplicationContext, ErrorTracking, DataType } from '@sankhyalabs/core';
|
3
|
-
import { d as dist, D as DataFetcher, U as UrlUtils } from './DataFetcher-
|
3
|
+
import { d as dist, D as DataFetcher, U as UrlUtils } from './DataFetcher-4f5ad71c.js';
|
4
4
|
import { ApplicationUtils } from '@sankhyalabs/ezui/dist/collection/utils';
|
5
|
-
import { P as PesquisaFetcher } from './pesquisa-fetcher-
|
6
|
-
import { G as GridConfigFetcher, C as ConfigStorage } from './ConfigStorage-
|
7
|
-
import { D as DataUnitFetcher } from './dataunit-fetcher-
|
8
|
-
import { A as AutorizationType, a as AuthFetcher } from './auth-fetcher-
|
5
|
+
import { P as PesquisaFetcher } from './pesquisa-fetcher-d82df64b.js';
|
6
|
+
import { G as GridConfigFetcher, C as ConfigStorage } from './ConfigStorage-d0e26692.js';
|
7
|
+
import { D as DataUnitFetcher } from './dataunit-fetcher-97dd5148.js';
|
8
|
+
import { A as AutorizationType, a as AuthFetcher } from './auth-fetcher-852e26c9.js';
|
9
9
|
import { S as SnkMessageBuilder } from './SnkMessageBuilder-68c1c25a.js';
|
10
10
|
import './_commonjsHelpers-9943807e.js';
|
11
11
|
import '@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata';
|
12
|
-
import './form-config-fetcher-
|
13
|
-
import './resource-fetcher-
|
14
|
-
import './filter-bar-config-fetcher-
|
12
|
+
import './form-config-fetcher-ff72a867.js';
|
13
|
+
import './resource-fetcher-be4d1ba4.js';
|
14
|
+
import './filter-bar-config-fetcher-1093db95.js';
|
15
15
|
import './filter-item-type.enum-5028ed3f.js';
|
16
16
|
import '@sankhyalabs/ezui/dist/collection/utils/constants';
|
17
17
|
|
@@ -1,8 +1,8 @@
|
|
1
1
|
import { r as registerInstance, c as createEvent, h } from './index-a7d3d3f1.js';
|
2
2
|
import { ApplicationContext, DataType, Action } from '@sankhyalabs/core';
|
3
|
-
import { D as DataFetcher } from './DataFetcher-
|
3
|
+
import { D as DataFetcher } from './DataFetcher-4f5ad71c.js';
|
4
4
|
import { c as VIEW_MODE } from './constants-3644f1b6.js';
|
5
|
-
import { D as DataUnitFetcher } from './dataunit-fetcher-
|
5
|
+
import { D as DataUnitFetcher } from './dataunit-fetcher-97dd5148.js';
|
6
6
|
import { T as TaskbarElement } from './taskbar-elements-2c761819.js';
|
7
7
|
import './_commonjsHelpers-9943807e.js';
|
8
8
|
import '@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata';
|
@@ -1,15 +1,15 @@
|
|
1
1
|
import { r as registerInstance, c as createEvent, h, g as getElement } from './index-a7d3d3f1.js';
|
2
2
|
import { ElementIDUtils, ApplicationContext } from '@sankhyalabs/core';
|
3
3
|
import { T as TaskbarElement } from './taskbar-elements-2c761819.js';
|
4
|
-
import './DataFetcher-
|
5
|
-
import './pesquisa-fetcher-
|
4
|
+
import './DataFetcher-4f5ad71c.js';
|
5
|
+
import './pesquisa-fetcher-d82df64b.js';
|
6
6
|
import { P as PresentationMode } from './index-1564817d.js';
|
7
7
|
import { c as VIEW_MODE } from './constants-3644f1b6.js';
|
8
|
-
import { A as AutorizationType } from './auth-fetcher-
|
8
|
+
import { A as AutorizationType } from './auth-fetcher-852e26c9.js';
|
9
9
|
import './index-bdf75557.js';
|
10
10
|
import './_commonjsHelpers-9943807e.js';
|
11
11
|
import '@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata';
|
12
|
-
import './resource-fetcher-
|
12
|
+
import './resource-fetcher-be4d1ba4.js';
|
13
13
|
|
14
14
|
const snkCrudCss = ".sc-snk-crud-h{display:flex;flex-direction:column;height:100%;width:100%}";
|
15
15
|
|
@@ -3,7 +3,7 @@ import { ObjectUtils, ApplicationContext, DataType, ElementIDUtils } from '@sank
|
|
3
3
|
import { ApplicationUtils, DialogType } from '@sankhyalabs/ezui/dist/collection/utils';
|
4
4
|
import { D as DataExporterOption, a as DataExporterFormat, b as DataExporterType } from './index-1564817d.js';
|
5
5
|
import { R as REPORT_LAUNCHER_RESOURCE_ID } from './constants-3644f1b6.js';
|
6
|
-
import { D as DataFetcher } from './DataFetcher-
|
6
|
+
import { D as DataFetcher } from './DataFetcher-4f5ad71c.js';
|
7
7
|
import { S as SnkDataUnit } from './snk-data-unit-8c4d944d.js';
|
8
8
|
import './_commonjsHelpers-9943807e.js';
|
9
9
|
import '@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata';
|
@@ -1,18 +1,18 @@
|
|
1
1
|
import { r as registerInstance, c as createEvent, f as forceUpdate, h, H as Host } from './index-a7d3d3f1.js';
|
2
|
-
import { S as SnkFormConfigManager } from './SnkFormConfigManager-
|
2
|
+
import { S as SnkFormConfigManager } from './SnkFormConfigManager-457554ca.js';
|
3
3
|
import { FormMetadata, buildFormMetadata } from '@sankhyalabs/ezui/dist/collection/utils/form';
|
4
|
-
import './DataFetcher-
|
5
|
-
import './pesquisa-fetcher-
|
4
|
+
import './DataFetcher-4f5ad71c.js';
|
5
|
+
import './pesquisa-fetcher-d82df64b.js';
|
6
6
|
import '@sankhyalabs/core';
|
7
7
|
import { P as PresentationMode } from './index-1564817d.js';
|
8
8
|
import { T as TaskbarElement } from './taskbar-elements-2c761819.js';
|
9
9
|
import { c as VIEW_MODE } from './constants-3644f1b6.js';
|
10
|
-
import { S as SnkGuidesViewer } from './snk-guides-viewer-
|
10
|
+
import { S as SnkGuidesViewer } from './snk-guides-viewer-202c3c4d.js';
|
11
11
|
import { S as SnkMessageBuilder } from './SnkMessageBuilder-68c1c25a.js';
|
12
|
-
import './ConfigStorage-
|
13
|
-
import './form-config-fetcher-
|
14
|
-
import './resource-fetcher-
|
15
|
-
import './filter-bar-config-fetcher-
|
12
|
+
import './ConfigStorage-d0e26692.js';
|
13
|
+
import './form-config-fetcher-ff72a867.js';
|
14
|
+
import './resource-fetcher-be4d1ba4.js';
|
15
|
+
import './filter-bar-config-fetcher-1093db95.js';
|
16
16
|
import './filter-item-type.enum-5028ed3f.js';
|
17
17
|
import './_commonjsHelpers-9943807e.js';
|
18
18
|
import '@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata';
|