monkey-front-core 0.0.70 → 0.0.74
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/pipes/monkeyecx-format-date-group.mjs +3 -3
- package/esm2020/lib/core/pipes/monkeyecx-format-date-timelapse.mjs +1 -4
- package/esm2020/lib/core/services/config/monkeyecx-config.service.mjs +5 -3
- package/esm2020/lib/core/services/config/monkeyecx-feature-toggle.service.mjs +15 -4
- package/esm2020/lib/core/utils/validate-utils.mjs +17 -15
- package/esm2020/lib/core/utils/validators.mjs +4 -2
- package/fesm2015/monkey-front-core.mjs +37 -25
- package/fesm2015/monkey-front-core.mjs.map +1 -1
- package/fesm2020/monkey-front-core.mjs +39 -25
- 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.74.tgz +0 -0
- package/package.json +1 -1
- package/monkey-front-core-0.0.70.tgz +0 -0
|
@@ -242,9 +242,6 @@ class MonkeyEcxUtils {
|
|
|
242
242
|
const moment$3 = moment_;
|
|
243
243
|
class MonkeyEcxFormatDateTimelapsePipe {
|
|
244
244
|
transform(date, showTime = false, useUtc = true, format = '- HH:mm') {
|
|
245
|
-
console.log('moment');
|
|
246
|
-
console.log('11');
|
|
247
|
-
console.log(moment$3);
|
|
248
245
|
if (!MonkeyEcxUtils.persistNullEmptyUndefined(date))
|
|
249
246
|
return '';
|
|
250
247
|
let stillUtc = moment$3.default.utc(date).toDate();
|
|
@@ -559,12 +556,12 @@ class MonkeyEcxFormatDateGroupPipe {
|
|
|
559
556
|
format(date) {
|
|
560
557
|
if (!MonkeyEcxUtils.persistNullEmptyUndefined(date))
|
|
561
558
|
return '';
|
|
562
|
-
let stillUtc = moment$2.utc(date).toDate();
|
|
559
|
+
let stillUtc = moment$2.default.utc(date).toDate();
|
|
563
560
|
if (date.toString()?.indexOf(':') <= -1) {
|
|
564
561
|
stillUtc = date;
|
|
565
562
|
}
|
|
566
563
|
const formatFrom = 'YYYY/MM/DD';
|
|
567
|
-
const fmt = moment$2(stillUtc, formatFrom).locale(this.lang);
|
|
564
|
+
const fmt = moment$2.default(stillUtc, formatFrom).locale(this.lang);
|
|
568
565
|
const dayFormated = fmt.format('DD/');
|
|
569
566
|
const monthFormated = MonkeyEcxUtils.capitalize(fmt.format('MMMM'));
|
|
570
567
|
const yearFormated = fmt.format('YYYY');
|
|
@@ -869,9 +866,11 @@ class DateValidator {
|
|
|
869
866
|
return null;
|
|
870
867
|
if (control && control.value) {
|
|
871
868
|
const dateFormat = 'MM-DD-YYYY';
|
|
872
|
-
if (!moment$1
|
|
869
|
+
if (!moment$1
|
|
870
|
+
.default(moment$1.default(control.value).format(dateFormat), ['DD/MM/YYYY', 'MM-DD-YYYY', 'YYYY-MM-DD'], true)
|
|
871
|
+
.isValid()) {
|
|
873
872
|
return {
|
|
874
|
-
invalidDate: true
|
|
873
|
+
invalidDate: true,
|
|
875
874
|
};
|
|
876
875
|
}
|
|
877
876
|
}
|
|
@@ -885,7 +884,7 @@ class DocumentValidator {
|
|
|
885
884
|
if (control && control.value) {
|
|
886
885
|
if (!MonkeyEcxUtils.isCPFCNPJValid(control.value)) {
|
|
887
886
|
return {
|
|
888
|
-
invalidCpfCnpj: true
|
|
887
|
+
invalidCpfCnpj: true,
|
|
889
888
|
};
|
|
890
889
|
}
|
|
891
890
|
}
|
|
@@ -899,7 +898,7 @@ class DocumentRutValidator {
|
|
|
899
898
|
if (control && control.value) {
|
|
900
899
|
if (!MonkeyEcxUtils.isValidRUT(control.value)) {
|
|
901
900
|
return {
|
|
902
|
-
invalidRut: true
|
|
901
|
+
invalidRut: true,
|
|
903
902
|
};
|
|
904
903
|
}
|
|
905
904
|
}
|
|
@@ -913,7 +912,7 @@ class ZipCodeValidator {
|
|
|
913
912
|
if (control && control.value) {
|
|
914
913
|
if (!MonkeyEcxUtils.isValidZipCode(control.value)) {
|
|
915
914
|
return {
|
|
916
|
-
invalidZipCode: true
|
|
915
|
+
invalidZipCode: true,
|
|
917
916
|
};
|
|
918
917
|
}
|
|
919
918
|
}
|
|
@@ -927,7 +926,7 @@ class ComboValidator {
|
|
|
927
926
|
if (control && control.value !== '0')
|
|
928
927
|
return null;
|
|
929
928
|
return {
|
|
930
|
-
invalidCombo: true
|
|
929
|
+
invalidCombo: true,
|
|
931
930
|
};
|
|
932
931
|
}
|
|
933
932
|
}
|
|
@@ -938,7 +937,7 @@ class isTrueValidator {
|
|
|
938
937
|
if (control && control.value !== false)
|
|
939
938
|
return null;
|
|
940
939
|
return {
|
|
941
|
-
invalidTrue: true
|
|
940
|
+
invalidTrue: true,
|
|
942
941
|
};
|
|
943
942
|
}
|
|
944
943
|
}
|
|
@@ -954,7 +953,7 @@ class PasswordMatchValidation {
|
|
|
954
953
|
if (password === passwordConfirm)
|
|
955
954
|
return null;
|
|
956
955
|
return {
|
|
957
|
-
passwordsNotMatching: true
|
|
956
|
+
passwordsNotMatching: true,
|
|
958
957
|
};
|
|
959
958
|
}
|
|
960
959
|
}
|
|
@@ -965,7 +964,7 @@ class UrlValidator {
|
|
|
965
964
|
if (control && control.value) {
|
|
966
965
|
if (!MonkeyEcxUtils.isValidUrl(control.value)) {
|
|
967
966
|
return {
|
|
968
|
-
invalidUrl: true
|
|
967
|
+
invalidUrl: true,
|
|
969
968
|
};
|
|
970
969
|
}
|
|
971
970
|
}
|
|
@@ -991,7 +990,7 @@ class CustomDatesStartValidator {
|
|
|
991
990
|
return null;
|
|
992
991
|
if (dateStart > dateEnd) {
|
|
993
992
|
return {
|
|
994
|
-
dateStartMustBeLessThanAnd: true
|
|
993
|
+
dateStartMustBeLessThanAnd: true,
|
|
995
994
|
};
|
|
996
995
|
}
|
|
997
996
|
return null;
|
|
@@ -1016,7 +1015,7 @@ class CustomDatesEndValidator {
|
|
|
1016
1015
|
return null;
|
|
1017
1016
|
if (dateEnd < dateStart) {
|
|
1018
1017
|
return {
|
|
1019
|
-
dateEndMustBeGreaterThanStart: true
|
|
1018
|
+
dateEndMustBeGreaterThanStart: true,
|
|
1020
1019
|
};
|
|
1021
1020
|
}
|
|
1022
1021
|
return null;
|
|
@@ -1028,7 +1027,7 @@ class UnlockRegisterBuyerValidator {
|
|
|
1028
1027
|
return null;
|
|
1029
1028
|
if (control && control.value !== '#MONKEYBUYER') {
|
|
1030
1029
|
return {
|
|
1031
|
-
invalidUnlockRegister: true
|
|
1030
|
+
invalidUnlockRegister: true,
|
|
1032
1031
|
};
|
|
1033
1032
|
}
|
|
1034
1033
|
return null;
|
|
@@ -1040,7 +1039,7 @@ class UnlockRegisterSponsorValidator {
|
|
|
1040
1039
|
return null;
|
|
1041
1040
|
if (control && control.value !== '#MONKEYSPONSOR') {
|
|
1042
1041
|
return {
|
|
1043
|
-
invalidUnlockRegister: true
|
|
1042
|
+
invalidUnlockRegister: true,
|
|
1044
1043
|
};
|
|
1045
1044
|
}
|
|
1046
1045
|
return null;
|
|
@@ -1056,7 +1055,7 @@ class DateRangeValidator {
|
|
|
1056
1055
|
(!MonkeyEcxUtils.persistNullEmptyUndefined(dates.startDate) ||
|
|
1057
1056
|
!MonkeyEcxUtils.persistNullEmptyUndefined(dates.endDate))) {
|
|
1058
1057
|
return {
|
|
1059
|
-
invalidDateRange: true
|
|
1058
|
+
invalidDateRange: true,
|
|
1060
1059
|
};
|
|
1061
1060
|
}
|
|
1062
1061
|
return null;
|
|
@@ -1315,7 +1314,9 @@ function dateValidator(control) {
|
|
|
1315
1314
|
if (!control.parent || !control || isEmptyInputValue(control.value))
|
|
1316
1315
|
return null;
|
|
1317
1316
|
const dateFormat = 'MM-DD-YYYY';
|
|
1318
|
-
if (!moment
|
|
1317
|
+
if (!moment
|
|
1318
|
+
.default(moment.default(control.value).format(dateFormat), ['DD/MM/YYYY', 'MM-DD-YYYY', 'YYYY-MM-DD'], true)
|
|
1319
|
+
.isValid()) {
|
|
1319
1320
|
return {
|
|
1320
1321
|
invalidDate: true,
|
|
1321
1322
|
};
|
|
@@ -2477,25 +2478,36 @@ class MonkeyEcxFeatureToggleService {
|
|
|
2477
2478
|
this.flagSubject$.next(true);
|
|
2478
2479
|
}
|
|
2479
2480
|
identify(config, environment) {
|
|
2481
|
+
console.log('1');
|
|
2482
|
+
console.log(this);
|
|
2480
2483
|
if (config) {
|
|
2484
|
+
console.log('2');
|
|
2481
2485
|
const email = 'monkey@monkey.exchange';
|
|
2486
|
+
console.log('3');
|
|
2482
2487
|
const user = {
|
|
2483
2488
|
email,
|
|
2484
|
-
key: `${config.program?.token}#${email}
|
|
2489
|
+
key: `${config.program?.token}#${email}`,
|
|
2485
2490
|
};
|
|
2491
|
+
console.log('4');
|
|
2486
2492
|
if (!this.ldClient) {
|
|
2493
|
+
console.log('5');
|
|
2487
2494
|
this.ldClient = initialize(environment.launchDarklyClientSideID, user, {
|
|
2488
2495
|
streaming: true,
|
|
2489
2496
|
disableSyncEventPost: true,
|
|
2490
2497
|
sendEvents: false,
|
|
2491
|
-
diagnosticOptOut: true
|
|
2498
|
+
diagnosticOptOut: true,
|
|
2492
2499
|
});
|
|
2500
|
+
console.log('6');
|
|
2493
2501
|
this.ldClient.on('change', this.getAllFlags.bind(this));
|
|
2502
|
+
console.log('7');
|
|
2494
2503
|
this.ldClient.on('ready', this.getAllFlags.bind(this));
|
|
2504
|
+
console.log('8');
|
|
2495
2505
|
}
|
|
2496
2506
|
else {
|
|
2507
|
+
console.log('9');
|
|
2497
2508
|
this.ldClient.identify(user, undefined, this.getAllFlags);
|
|
2498
2509
|
}
|
|
2510
|
+
console.log(this);
|
|
2499
2511
|
}
|
|
2500
2512
|
}
|
|
2501
2513
|
apply(configSubject$, environment) {
|
|
@@ -2521,7 +2533,7 @@ MonkeyEcxFeatureToggleService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion:
|
|
|
2521
2533
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: MonkeyEcxFeatureToggleService, decorators: [{
|
|
2522
2534
|
type: Injectable,
|
|
2523
2535
|
args: [{
|
|
2524
|
-
providedIn: 'root'
|
|
2536
|
+
providedIn: 'root',
|
|
2525
2537
|
}]
|
|
2526
2538
|
}], ctorParameters: function () { return []; } });
|
|
2527
2539
|
|
|
@@ -2551,11 +2563,13 @@ class MonkeyEcxConfigService extends MonkeyEcxCommonsService {
|
|
|
2551
2563
|
getWhiteLabelSettings(monkeyecxCode, configBoostrap, callback, environment, identifyCode) {
|
|
2552
2564
|
const { monkeyecxService, monkeyecxi18nConfigService, configSubject$, monkeyStyleGuideSettingsService, monkeyecxLogsConfigService, monkeyecxErrorConfigService, monkeyEcxFeatureToggleService, internalValidations, } = this;
|
|
2553
2565
|
const url = `${environment.urlAssets}`;
|
|
2554
|
-
monkeyecxService
|
|
2566
|
+
monkeyecxService
|
|
2567
|
+
?.get(`${url}/${monkeyecxCode.toLowerCase()}/white-label.json?t=${MonkeyUtils.getRandomString(30)}`)
|
|
2568
|
+
?.subscribe((config) => {
|
|
2555
2569
|
monkeyecxi18nConfigService.apply(config, environment);
|
|
2556
2570
|
monkeyecxLogsConfigService.apply(config, configBoostrap, environment, identifyCode);
|
|
2557
2571
|
monkeyEcxFeatureToggleService.apply(configSubject$, environment);
|
|
2558
|
-
monkeyStyleGuideSettingsService.boostrap(`${url}/${monkeyecxCode.toLowerCase()}/monkey-style-guide-settings.json`, internalValidations.bind(this, configBoostrap, callback, environment));
|
|
2572
|
+
monkeyStyleGuideSettingsService.boostrap(`${url}/${monkeyecxCode.toLowerCase()}/monkey-style-guide-settings.json?t=${MonkeyUtils.getRandomString(30)}`, internalValidations.bind(this, configBoostrap, callback, environment));
|
|
2559
2573
|
configSubject$.next(config);
|
|
2560
2574
|
}, (err) => {
|
|
2561
2575
|
monkeyecxErrorConfigService.apply('theme');
|