monkey-front-core 0.0.78 → 0.0.82
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 +6 -9
- package/esm2020/lib/core/services/config/monkeyecx-feature-toggle.service.mjs +6 -30
- package/fesm2015/monkey-front-core.mjs +10 -37
- package/fesm2015/monkey-front-core.mjs.map +1 -1
- package/fesm2020/monkey-front-core.mjs +10 -37
- package/fesm2020/monkey-front-core.mjs.map +1 -1
- package/lib/core/services/config/monkeyecx-feature-toggle.service.d.ts +0 -1
- package/monkey-front-core-0.0.82.tgz +0 -0
- package/package.json +1 -1
- package/monkey-front-core-0.0.78.tgz +0 -0
|
@@ -1927,19 +1927,16 @@ class MonkeyEcxCommonsService {
|
|
|
1927
1927
|
this.flagValidator = false;
|
|
1928
1928
|
}
|
|
1929
1929
|
resolve(route, state, otherArgs) {
|
|
1930
|
-
|
|
1931
|
-
|
|
1932
|
-
|
|
1930
|
+
if (JSON.stringify(route?.queryParams) === '{}') {
|
|
1931
|
+
this.__data = null;
|
|
1932
|
+
this.__page = null;
|
|
1933
|
+
}
|
|
1934
|
+
this.__requestPaged = null;
|
|
1933
1935
|
this.flagValidator = true;
|
|
1934
1936
|
if (this.tokenStorage) {
|
|
1935
1937
|
this.__tokenCredentials = this.tokenStorage.getToken();
|
|
1936
1938
|
}
|
|
1937
1939
|
if (this.allowedSecurityAccess(otherArgs?.security)) {
|
|
1938
|
-
//Object.entries(this).forEach(([key, value]) => {
|
|
1939
|
-
// if (value instanceof BehaviorSubject) {
|
|
1940
|
-
// Object.defineProperty(this, key, new BehaviorSubject(null));
|
|
1941
|
-
// }
|
|
1942
|
-
//});
|
|
1943
1940
|
if (this.__schedule) {
|
|
1944
1941
|
this.otherArgs?.schedule?.service?.removeSchedule(this.__schedule);
|
|
1945
1942
|
this.__schedule = null;
|
|
@@ -2471,75 +2468,51 @@ class MonkeyEcxFeatureToggleService {
|
|
|
2471
2468
|
this.flagSubject$ = new BehaviorSubject(null);
|
|
2472
2469
|
this.flags = undefined;
|
|
2473
2470
|
this.ldClient = undefined;
|
|
2474
|
-
this.self = this;
|
|
2475
2471
|
// not to do
|
|
2476
2472
|
}
|
|
2477
|
-
getAllFlags(
|
|
2478
|
-
|
|
2479
|
-
|
|
2480
|
-
console.log(this);
|
|
2481
|
-
console.log(self);
|
|
2482
|
-
console.log('!!!!!');
|
|
2473
|
+
getAllFlags() {
|
|
2474
|
+
if (!this)
|
|
2475
|
+
return;
|
|
2483
2476
|
this.flags = this.ldClient?.allFlags();
|
|
2484
|
-
console.log('11');
|
|
2485
2477
|
this.flagSubject$.next(true);
|
|
2486
|
-
console.log('12');
|
|
2487
2478
|
}
|
|
2488
2479
|
identify(config, environment) {
|
|
2489
|
-
console.log('1');
|
|
2490
|
-
console.log(this);
|
|
2491
2480
|
if (config) {
|
|
2492
|
-
console.log('2');
|
|
2493
2481
|
const email = 'monkey@monkey.exchange';
|
|
2494
|
-
console.log('3');
|
|
2495
2482
|
const user = {
|
|
2496
2483
|
email,
|
|
2497
2484
|
key: `${config.program?.token}#${email}`,
|
|
2498
2485
|
};
|
|
2499
|
-
console.log('4');
|
|
2500
2486
|
if (!this.ldClient) {
|
|
2501
|
-
console.log('5');
|
|
2502
2487
|
this.ldClient = initialize(environment.launchDarklyClientSideID, user, {
|
|
2503
2488
|
streaming: true,
|
|
2504
2489
|
disableSyncEventPost: true,
|
|
2505
2490
|
sendEvents: false,
|
|
2506
2491
|
diagnosticOptOut: true,
|
|
2507
2492
|
});
|
|
2508
|
-
|
|
2509
|
-
this.ldClient.on('
|
|
2510
|
-
console.log('7');
|
|
2511
|
-
this.ldClient.on('ready', this.getAllFlags.bind(this, this));
|
|
2512
|
-
console.log('8');
|
|
2493
|
+
this.ldClient.on('change', this.getAllFlags.bind(this));
|
|
2494
|
+
this.ldClient.on('ready', this.getAllFlags.bind(this));
|
|
2513
2495
|
}
|
|
2514
2496
|
else {
|
|
2515
|
-
console.log('9');
|
|
2516
2497
|
this.ldClient.identify(user, undefined, this.getAllFlags);
|
|
2517
2498
|
}
|
|
2518
|
-
console.log(this);
|
|
2519
2499
|
}
|
|
2520
2500
|
}
|
|
2521
2501
|
apply(configSubject$, environment) {
|
|
2522
|
-
console.log('13');
|
|
2523
2502
|
if (environment.launchDarklyClientSideID) {
|
|
2524
|
-
console.log('14');
|
|
2525
2503
|
configSubject$.subscribe((config) => {
|
|
2526
|
-
console.log('15');
|
|
2527
2504
|
this.identify(config, environment);
|
|
2528
2505
|
});
|
|
2529
2506
|
}
|
|
2530
2507
|
else {
|
|
2531
|
-
console.log('16');
|
|
2532
2508
|
this.flagSubject$.next(true);
|
|
2533
2509
|
}
|
|
2534
2510
|
}
|
|
2535
2511
|
get onFlags() {
|
|
2536
|
-
console.log('17');
|
|
2537
2512
|
return this.flagSubject$.asObservable();
|
|
2538
2513
|
}
|
|
2539
2514
|
getFlag(flag) {
|
|
2540
|
-
console.log('18');
|
|
2541
2515
|
const flagValue = this.flags?.[flag];
|
|
2542
|
-
console.log('19');
|
|
2543
2516
|
return MonkeyUtils.persistNullEmptyUndefined(flagValue) ? flagValue : null;
|
|
2544
2517
|
}
|
|
2545
2518
|
}
|