monkey-front-core 0.0.219 → 0.0.222
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/esm2020/lib/core/services/commons/monkeyecx-commons.service.mjs +25 -1
- package/esm2020/lib/core/services/storage/monkeyecx-cookie-storage.service.mjs +5 -3
- package/fesm2015/monkey-front-core.mjs +54 -26
- package/fesm2015/monkey-front-core.mjs.map +1 -1
- package/fesm2020/monkey-front-core.mjs +53 -28
- package/fesm2020/monkey-front-core.mjs.map +1 -1
- package/lib/core/services/commons/monkeyecx-commons.service.d.ts +1 -0
- package/monkey-front-core-0.0.222.tgz +0 -0
- package/package.json +1 -1
- package/monkey-front-core-0.0.219.tgz +0 -0
|
@@ -338,14 +338,16 @@ class MonkeyEcxCookieStorageService {
|
|
|
338
338
|
setCookie(name, value, environment) {
|
|
339
339
|
this.removeCookie(name, environment);
|
|
340
340
|
const { urlDomain } = environment;
|
|
341
|
-
|
|
341
|
+
const handledDomain = urlDomain ? `.${urlDomain}` : '';
|
|
342
|
+
this.cookieService.set(name, value, undefined, '/', handledDomain, true, 'None');
|
|
342
343
|
}
|
|
343
344
|
getCookie(name) {
|
|
344
345
|
return this.cookieService.get(name);
|
|
345
346
|
}
|
|
346
347
|
removeCookie(name, environment) {
|
|
347
348
|
const { urlDomain } = environment;
|
|
348
|
-
|
|
349
|
+
const handledDomain = urlDomain ? `.${urlDomain}` : '';
|
|
350
|
+
this.cookieService.delete(name, '/', handledDomain, true, 'None');
|
|
349
351
|
}
|
|
350
352
|
}
|
|
351
353
|
MonkeyEcxCookieStorageService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: MonkeyEcxCookieStorageService, deps: [{ token: i1$2.CookieService }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
@@ -2129,6 +2131,37 @@ class MonkeyEcxRequestPagedHandling {
|
|
|
2129
2131
|
}
|
|
2130
2132
|
}
|
|
2131
2133
|
|
|
2134
|
+
class Link {
|
|
2135
|
+
constructor(data) {
|
|
2136
|
+
this.href = data?.href;
|
|
2137
|
+
this.type = data?.type;
|
|
2138
|
+
this.templated = data?.templated;
|
|
2139
|
+
}
|
|
2140
|
+
}
|
|
2141
|
+
class MonkeyEcxModel {
|
|
2142
|
+
getAction(type, replaceOptions) {
|
|
2143
|
+
const { _links } = this;
|
|
2144
|
+
if (!_links)
|
|
2145
|
+
return null;
|
|
2146
|
+
let link = _links[type.toLowerCase()];
|
|
2147
|
+
link = new Link(link);
|
|
2148
|
+
if (link && replaceOptions && link?.templated) {
|
|
2149
|
+
const { from, to } = replaceOptions;
|
|
2150
|
+
link = new Link({
|
|
2151
|
+
...link,
|
|
2152
|
+
href: `${link.href}`.replace(from, to),
|
|
2153
|
+
});
|
|
2154
|
+
}
|
|
2155
|
+
return link;
|
|
2156
|
+
}
|
|
2157
|
+
}
|
|
2158
|
+
|
|
2159
|
+
class LinksModel extends MonkeyEcxModel {
|
|
2160
|
+
constructor(data) {
|
|
2161
|
+
super();
|
|
2162
|
+
this._links = data?._links;
|
|
2163
|
+
}
|
|
2164
|
+
}
|
|
2132
2165
|
class MonkeyEcxCommonsService {
|
|
2133
2166
|
constructor(monkeyecxService, tokenStorage, otherArgs) {
|
|
2134
2167
|
this.monkeyecxService = monkeyecxService;
|
|
@@ -2438,6 +2471,16 @@ class MonkeyEcxCommonsService {
|
|
|
2438
2471
|
throwError(err);
|
|
2439
2472
|
});
|
|
2440
2473
|
}
|
|
2474
|
+
async getGenericData(data, action) {
|
|
2475
|
+
const { monkeyecxService } = this;
|
|
2476
|
+
if (!monkeyecxService)
|
|
2477
|
+
return null;
|
|
2478
|
+
const { href, type } = new LinksModel(data)?.getAction(action) || {
|
|
2479
|
+
href: '', type: 'get'
|
|
2480
|
+
};
|
|
2481
|
+
return monkeyecxService[type.toLowerCase()](href)
|
|
2482
|
+
.pipe(take(1)).toPromise();
|
|
2483
|
+
}
|
|
2441
2484
|
geti18n(translateService, keys) {
|
|
2442
2485
|
translateService.onDefaultLangChange.subscribe(() => {
|
|
2443
2486
|
this.__i18n = translateService.instant(keys);
|
|
@@ -2501,7 +2544,14 @@ __decorate([
|
|
|
2501
2544
|
showProgress: true
|
|
2502
2545
|
}
|
|
2503
2546
|
})
|
|
2504
|
-
], MonkeyEcxCommonsService.prototype, "genericMethod", null);
|
|
2547
|
+
], MonkeyEcxCommonsService.prototype, "genericMethod", null);
|
|
2548
|
+
__decorate([
|
|
2549
|
+
MonkeyEcxCoreService({
|
|
2550
|
+
requestInProgress: {
|
|
2551
|
+
showProgress: true
|
|
2552
|
+
}
|
|
2553
|
+
})
|
|
2554
|
+
], MonkeyEcxCommonsService.prototype, "getGenericData", null);
|
|
2505
2555
|
|
|
2506
2556
|
/* eslint-disable max-len */
|
|
2507
2557
|
class MonkeyEcxHandlingService {
|
|
@@ -4862,31 +4912,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImpor
|
|
|
4862
4912
|
}]
|
|
4863
4913
|
}] });
|
|
4864
4914
|
|
|
4865
|
-
class Link {
|
|
4866
|
-
constructor(data) {
|
|
4867
|
-
this.href = data?.href;
|
|
4868
|
-
this.type = data?.type;
|
|
4869
|
-
this.templated = data?.templated;
|
|
4870
|
-
}
|
|
4871
|
-
}
|
|
4872
|
-
class MonkeyEcxModel {
|
|
4873
|
-
getAction(type, replaceOptions) {
|
|
4874
|
-
const { _links } = this;
|
|
4875
|
-
if (!_links)
|
|
4876
|
-
return null;
|
|
4877
|
-
let link = _links[type.toLowerCase()];
|
|
4878
|
-
link = new Link(link);
|
|
4879
|
-
if (link && replaceOptions && link?.templated) {
|
|
4880
|
-
const { from, to } = replaceOptions;
|
|
4881
|
-
link = new Link({
|
|
4882
|
-
...link,
|
|
4883
|
-
href: `${link.href}`.replace(from, to),
|
|
4884
|
-
});
|
|
4885
|
-
}
|
|
4886
|
-
return link;
|
|
4887
|
-
}
|
|
4888
|
-
}
|
|
4889
|
-
|
|
4890
4915
|
/* eslint-disable no-unused-vars */
|
|
4891
4916
|
var OpSearch;
|
|
4892
4917
|
(function (OpSearch) {
|