monkey-front-core 0.0.71 → 0.0.75
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/interfaces/monkeyecx-auth-credentials.mjs +1 -1
- package/esm2020/lib/core/services/config/monkeyecx-config.service.mjs +5 -3
- package/esm2020/lib/core/services/config/monkeyecx-feature-toggle.service.mjs +25 -4
- package/fesm2015/monkey-front-core.mjs +26 -5
- package/fesm2015/monkey-front-core.mjs.map +1 -1
- package/fesm2020/monkey-front-core.mjs +28 -5
- package/fesm2020/monkey-front-core.mjs.map +1 -1
- package/lib/core/interfaces/monkeyecx-auth-credentials.d.ts +1 -0
- package/monkey-front-core-0.0.75.tgz +0 -0
- package/package.json +1 -1
- package/monkey-front-core-0.0.71.tgz +0 -0
|
@@ -2474,46 +2474,67 @@ class MonkeyEcxFeatureToggleService {
|
|
|
2474
2474
|
// not to do
|
|
2475
2475
|
}
|
|
2476
2476
|
getAllFlags() {
|
|
2477
|
+
console.log('10');
|
|
2477
2478
|
this.flags = this.ldClient?.allFlags();
|
|
2479
|
+
console.log('11');
|
|
2478
2480
|
this.flagSubject$.next(true);
|
|
2481
|
+
console.log('12');
|
|
2479
2482
|
}
|
|
2480
2483
|
identify(config, environment) {
|
|
2484
|
+
console.log('1');
|
|
2485
|
+
console.log(this);
|
|
2481
2486
|
if (config) {
|
|
2487
|
+
console.log('2');
|
|
2482
2488
|
const email = 'monkey@monkey.exchange';
|
|
2489
|
+
console.log('3');
|
|
2483
2490
|
const user = {
|
|
2484
2491
|
email,
|
|
2485
|
-
key: `${config.program?.token}#${email}
|
|
2492
|
+
key: `${config.program?.token}#${email}`,
|
|
2486
2493
|
};
|
|
2494
|
+
console.log('4');
|
|
2487
2495
|
if (!this.ldClient) {
|
|
2496
|
+
console.log('5');
|
|
2488
2497
|
this.ldClient = initialize(environment.launchDarklyClientSideID, user, {
|
|
2489
2498
|
streaming: true,
|
|
2490
2499
|
disableSyncEventPost: true,
|
|
2491
2500
|
sendEvents: false,
|
|
2492
|
-
diagnosticOptOut: true
|
|
2501
|
+
diagnosticOptOut: true,
|
|
2493
2502
|
});
|
|
2503
|
+
console.log('6');
|
|
2494
2504
|
this.ldClient.on('change', this.getAllFlags.bind(this));
|
|
2505
|
+
console.log('7');
|
|
2495
2506
|
this.ldClient.on('ready', this.getAllFlags.bind(this));
|
|
2507
|
+
console.log('8');
|
|
2496
2508
|
}
|
|
2497
2509
|
else {
|
|
2510
|
+
console.log('9');
|
|
2498
2511
|
this.ldClient.identify(user, undefined, this.getAllFlags);
|
|
2499
2512
|
}
|
|
2513
|
+
console.log(this);
|
|
2500
2514
|
}
|
|
2501
2515
|
}
|
|
2502
2516
|
apply(configSubject$, environment) {
|
|
2517
|
+
console.log('13');
|
|
2503
2518
|
if (environment.launchDarklyClientSideID) {
|
|
2519
|
+
console.log('14');
|
|
2504
2520
|
configSubject$.subscribe((config) => {
|
|
2521
|
+
console.log('15');
|
|
2505
2522
|
this.identify(config, environment);
|
|
2506
2523
|
});
|
|
2507
2524
|
}
|
|
2508
2525
|
else {
|
|
2526
|
+
console.log('16');
|
|
2509
2527
|
this.flagSubject$.next(true);
|
|
2510
2528
|
}
|
|
2511
2529
|
}
|
|
2512
2530
|
get onFlags() {
|
|
2531
|
+
console.log('17');
|
|
2513
2532
|
return this.flagSubject$.asObservable();
|
|
2514
2533
|
}
|
|
2515
2534
|
getFlag(flag) {
|
|
2535
|
+
console.log('18');
|
|
2516
2536
|
const flagValue = this.flags?.[flag];
|
|
2537
|
+
console.log('19');
|
|
2517
2538
|
return MonkeyUtils.persistNullEmptyUndefined(flagValue) ? flagValue : null;
|
|
2518
2539
|
}
|
|
2519
2540
|
}
|
|
@@ -2522,7 +2543,7 @@ MonkeyEcxFeatureToggleService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion:
|
|
|
2522
2543
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: MonkeyEcxFeatureToggleService, decorators: [{
|
|
2523
2544
|
type: Injectable,
|
|
2524
2545
|
args: [{
|
|
2525
|
-
providedIn: 'root'
|
|
2546
|
+
providedIn: 'root',
|
|
2526
2547
|
}]
|
|
2527
2548
|
}], ctorParameters: function () { return []; } });
|
|
2528
2549
|
|
|
@@ -2552,11 +2573,13 @@ class MonkeyEcxConfigService extends MonkeyEcxCommonsService {
|
|
|
2552
2573
|
getWhiteLabelSettings(monkeyecxCode, configBoostrap, callback, environment, identifyCode) {
|
|
2553
2574
|
const { monkeyecxService, monkeyecxi18nConfigService, configSubject$, monkeyStyleGuideSettingsService, monkeyecxLogsConfigService, monkeyecxErrorConfigService, monkeyEcxFeatureToggleService, internalValidations, } = this;
|
|
2554
2575
|
const url = `${environment.urlAssets}`;
|
|
2555
|
-
monkeyecxService
|
|
2576
|
+
monkeyecxService
|
|
2577
|
+
?.get(`${url}/${monkeyecxCode.toLowerCase()}/white-label.json?t=${MonkeyUtils.getRandomString(30)}`)
|
|
2578
|
+
?.subscribe((config) => {
|
|
2556
2579
|
monkeyecxi18nConfigService.apply(config, environment);
|
|
2557
2580
|
monkeyecxLogsConfigService.apply(config, configBoostrap, environment, identifyCode);
|
|
2558
2581
|
monkeyEcxFeatureToggleService.apply(configSubject$, environment);
|
|
2559
|
-
monkeyStyleGuideSettingsService.boostrap(`${url}/${monkeyecxCode.toLowerCase()}/monkey-style-guide-settings.json`, internalValidations.bind(this, configBoostrap, callback, environment));
|
|
2582
|
+
monkeyStyleGuideSettingsService.boostrap(`${url}/${monkeyecxCode.toLowerCase()}/monkey-style-guide-settings.json?t=${MonkeyUtils.getRandomString(30)}`, internalValidations.bind(this, configBoostrap, callback, environment));
|
|
2560
2583
|
configSubject$.next(config);
|
|
2561
2584
|
}, (err) => {
|
|
2562
2585
|
monkeyecxErrorConfigService.apply('theme');
|