monkey-front-core 22.0.0 → 22.2.1

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.
Binary file
package/package.json CHANGED
@@ -1,7 +1,8 @@
1
1
  {
2
2
  "name": "monkey-front-core",
3
- "version": "22.0.0",
3
+ "version": "22.2.1",
4
4
  "peerDependencies": {
5
+ "@angular-architects/native-federation": "22.1.3",
5
6
  "@angular/common": "22.1.7",
6
7
  "@angular/core": "22.1.7",
7
8
  "@angular/cdk": "22.1.7",
@@ -9,20 +10,20 @@
9
10
  "@angular/router": "22.1.7",
10
11
  "@angular/forms": "22.1.7",
11
12
  "@angular/service-worker": "22.1.7",
12
- "@datadog/browser-logs": "^6.31.0",
13
- "@datadog/browser-rum": "^6.31.0",
14
- "@ngx-translate/core": "^17.0.0 || ^18.0.0",
15
- "@ngrx/data": "^22.0.0",
16
- "@ngrx/effects": "^22.0.0",
17
- "@ngrx/entity": "^22.0.0",
18
- "@ngrx/store": "^22.0.0",
19
- "ngx-cookie-service": "^22.0.0",
20
- "launchdarkly-js-client-sdk": "^3.9.0",
21
- "rxjs": "~7.8.2",
22
- "date-fns": "^4.1.0"
13
+ "@datadog/browser-logs": "6.33.0",
14
+ "@datadog/browser-rum": "6.33.0",
15
+ "@ngx-translate/core": "17.0.0",
16
+ "@ngrx/data": "22.0.1",
17
+ "@ngrx/effects": "22.0.1",
18
+ "@ngrx/entity": "22.0.1",
19
+ "@ngrx/store": "22.0.1",
20
+ "ngx-cookie-service": "22.0.0",
21
+ "launchdarkly-js-client-sdk": "3.9.3",
22
+ "rxjs": "7.8.2",
23
+ "date-fns": "4.4.0"
23
24
  },
24
25
  "dependencies": {
25
- "tslib": "^2.8.1"
26
+ "tslib": "2.8.1"
26
27
  },
27
28
  "sideEffects": false,
28
29
  "module": "fesm2022/monkey-front-core.mjs",
@@ -1,10 +1,11 @@
1
1
  import * as i0 from '@angular/core';
2
- import { OnInit, OnDestroy, TemplateRef, ViewContainerRef, OnChanges, SimpleChanges, InjectionToken, ModuleWithProviders, PipeTransform } from '@angular/core';
2
+ import { OnInit, OnDestroy, TemplateRef, ViewContainerRef, OnChanges, SimpleChanges, InjectionToken, ModuleWithProviders, PipeTransform, Provider } from '@angular/core';
3
3
  import { NgModel, AbstractControl, ValidationErrors, FormGroup } from '@angular/forms';
4
- import { CanActivate, Router, ActivatedRouteSnapshot, RouterStateSnapshot, Resolve } from '@angular/router';
4
+ import { CanActivate, Router, ActivatedRouteSnapshot, RouterStateSnapshot, Resolve, Routes } from '@angular/router';
5
5
  import * as _ngrx_store from '@ngrx/store';
6
6
  import { Action, Store, ActionReducer } from '@ngrx/store';
7
7
  import { Observable, Subject, BehaviorSubject } from 'rxjs';
8
+ import { NativeFederationResult } from '@angular-architects/native-federation';
8
9
  import { HttpErrorResponse, HttpRequest, HttpHandler, HttpEvent, HttpContextToken, HttpInterceptorFn, HttpHeaders, HttpContext, HttpParams, HttpResponse } from '@angular/common/http';
9
10
  import * as i1 from '@angular/common';
10
11
  import { CurrencyPipe, DatePipe } from '@angular/common';
@@ -537,28 +538,16 @@ interface MonkeyEcxEnv {
537
538
  * This style guide was developed by Monkey Exchange Team
538
539
  * MIT Licence
539
540
  ************************* */
540
- interface MonkeyEcxCachedFile {
541
- filename: string;
542
- blob: Blob;
543
- timestamp: number;
544
- }
545
541
 
546
- /** ************************
547
- * Copyright Monkey Exchange. All Rights Reserved
548
- * This style guide was developed by Monkey Exchange Team
549
- * MIT Licence
550
- ************************* */
551
- interface MonkeyEcxHeaderCredentials {
552
- Authorization?: string;
553
- Program?: string;
542
+ interface MonkeyEcxFederationSetting {
543
+ host: string;
544
+ remoteEntry?: string;
545
+ exposedModule?: string;
546
+ preload?: boolean;
547
+ holdSplash?: boolean;
548
+ parentPath?: string;
549
+ [key: string]: any;
554
550
  }
555
-
556
- /** ************************
557
- * Copyright Monkey Exchange. All Rights Reserved
558
- * This style guide was developed by Monkey Exchange Team
559
- * MIT Licence
560
- ************************* */
561
-
562
551
  interface MonkeyEcxBootstrap {
563
552
  version: string;
564
553
  showNewVersion: boolean;
@@ -573,12 +562,8 @@ interface MonkeyEcxBootstrap {
573
562
  currency: string;
574
563
  title: string;
575
564
  }[];
576
- federationSettings: {
577
- [key: string]: {
578
- host: string;
579
- parentPath: string;
580
- [key: string]: string;
581
- };
565
+ federationSettings?: {
566
+ [name: string]: MonkeyEcxFederationSetting;
582
567
  };
583
568
  }
584
569
  interface MonkeyEcxAlert {
@@ -796,6 +781,42 @@ interface MonkeyEcxBootstrapService {
796
781
  handleProgram?(token: string): string;
797
782
  }
798
783
 
784
+ /** ************************
785
+ * Copyright Monkey Exchange. All Rights Reserved
786
+ * This style guide was developed by Monkey Exchange Team
787
+ * MIT Licence
788
+ ************************* */
789
+
790
+ type MonkeyEcxRemoteStatus = 'idle' | 'loading' | 'loaded' | 'error';
791
+ interface MonkeyEcxRemoteState {
792
+ name: string;
793
+ status: MonkeyEcxRemoteStatus;
794
+ setting: MonkeyEcxFederationSetting;
795
+ module?: any;
796
+ error?: any;
797
+ }
798
+
799
+ /** ************************
800
+ * Copyright Monkey Exchange. All Rights Reserved
801
+ * This style guide was developed by Monkey Exchange Team
802
+ * MIT Licence
803
+ ************************* */
804
+ interface MonkeyEcxCachedFile {
805
+ filename: string;
806
+ blob: Blob;
807
+ timestamp: number;
808
+ }
809
+
810
+ /** ************************
811
+ * Copyright Monkey Exchange. All Rights Reserved
812
+ * This style guide was developed by Monkey Exchange Team
813
+ * MIT Licence
814
+ ************************* */
815
+ interface MonkeyEcxHeaderCredentials {
816
+ Authorization?: string;
817
+ Program?: string;
818
+ }
819
+
799
820
  interface MonkeyEcxInterface {
800
821
  createdAt?: string;
801
822
  createUserId?: string;
@@ -1048,6 +1069,20 @@ declare const MECX_REFRESH_TOKEN_STRATEGY: InjectionToken<MonkeyEcxRefreshTokenS
1048
1069
  declare const MECX_REDIRECT_LOGIN_WELCOMEBACK_STRATEGY: InjectionToken<MonkeyEcxRedirectLoginWelcomeBackStrategy>;
1049
1070
  declare const MECX_I18N_PATH: InjectionToken<string>;
1050
1071
  declare const MECX_I18N_ALIAS: InjectionToken<string>;
1072
+ /**
1073
+ * The native federation instance resolved by `initFederation` in the shell `main.ts`.
1074
+ * Used by `MonkeyEcxFederationService` to register and load the remotes of `federationSettings`.
1075
+ *
1076
+ * ### Example
1077
+ * ```
1078
+ * // main.ts
1079
+ * initFederation({}).then((federation) => import('./bootstrap').then((m) => m.bootstrap(federation)));
1080
+ *
1081
+ * // bootstrap.ts
1082
+ * providers: [...appConfig.providers, provideMonkeyEcxFederation(federation)]
1083
+ * ```
1084
+ */
1085
+ declare const MECX_FEDERATION: InjectionToken<NativeFederationResult>;
1051
1086
 
1052
1087
  /** ************************
1053
1088
  * Copyright Monkey Exchange. All Rights Reserved
@@ -1303,7 +1338,9 @@ declare class MonkeyEcxPipesModule {
1303
1338
  static ɵinj: i0.ɵɵInjectorDeclaration<MonkeyEcxPipesModule>;
1304
1339
  }
1305
1340
 
1306
- declare function provideDomainServiceWorker(workerUrl: string, scope?: string): i0.EnvironmentProviders;
1341
+ declare function provideMonkeyEcxFederation(federation: NativeFederationResult): Provider[];
1342
+
1343
+ declare function provideMonkeyEcxDomainServiceWorker(workerUrl: string, scope?: string): i0.EnvironmentProviders;
1307
1344
 
1308
1345
  declare abstract class MonkeyEcxBaseResolver implements Resolve<any> {
1309
1346
  readonly router: Router;
@@ -1359,11 +1396,7 @@ declare class MonkeyEcxConfigsService {
1359
1396
  set whiteLabel(data: MonkeyEcxWhiteLabel);
1360
1397
  get styleGuide(): Observable<MonkeyEcxStyleGuide | null>;
1361
1398
  set styleGuide(data: MonkeyEcxStyleGuide);
1362
- federationSettings(key: string): {
1363
- [key: string]: string;
1364
- host: string;
1365
- parentPath: string;
1366
- } | null;
1399
+ federationSettings(key: string): MonkeyEcxFederationSetting | null;
1367
1400
  static ɵfac: i0.ɵɵFactoryDeclaration<MonkeyEcxConfigsService, never>;
1368
1401
  static ɵprov: i0.ɵɵInjectableDeclaration<any>;
1369
1402
  }
@@ -1393,6 +1426,35 @@ declare class MonkeyEcxFeatureToggleService {
1393
1426
  static ɵprov: i0.ɵɵInjectableDeclaration<any>;
1394
1427
  }
1395
1428
 
1429
+ type MonkeyEcxRemotes = Record<string, MonkeyEcxRemoteState>;
1430
+ declare class MonkeyEcxFederationService {
1431
+ private readonly _configsService;
1432
+ private readonly _errorService;
1433
+ private _federation;
1434
+ private readonly _remotes$;
1435
+ private readonly _initialized$;
1436
+ private readonly _loading;
1437
+ private _errorApplied;
1438
+ get remotes$(): Observable<MonkeyEcxRemotes>;
1439
+ get allLoaded$(): Observable<boolean>;
1440
+ get allSettled$(): Observable<boolean>;
1441
+ private watchHoldSplash;
1442
+ private isHoldSplashIn;
1443
+ private updateRemote;
1444
+ private handleLoad;
1445
+ private handleStartupError;
1446
+ apply(): void;
1447
+ skip(): void;
1448
+ load<T = any>(name: string): Promise<T>;
1449
+ loadRoutes(name: string): Promise<Routes>;
1450
+ status(name: string): MonkeyEcxRemoteState | null;
1451
+ isAllLoaded(): boolean;
1452
+ isAllSettled(): boolean;
1453
+ whenAllSettled(): Promise<void>;
1454
+ static ɵfac: i0.ɵɵFactoryDeclaration<MonkeyEcxFederationService, never>;
1455
+ static ɵprov: i0.ɵɵInjectableDeclaration<any>;
1456
+ }
1457
+
1396
1458
  declare class MonkeyEcxLocaleService {
1397
1459
  private readonly _localeId;
1398
1460
  private readonly _service;
@@ -1818,5 +1880,5 @@ declare class MonkeyEcxLogs {
1818
1880
  static log(params: LogParams): void;
1819
1881
  }
1820
1882
 
1821
- export { CACHE_LOCALE_EXPIRATION_MS, CountryMasks, LService, Link, MECX_ALPHA, MECX_BETA, MECX_BOOTSTRAP_SERVICE, MECX_CORE_I18N_WRAPPER, MECX_COUNTRY, MECX_DATE_FORMAT, MECX_I18N_ALIAS, MECX_I18N_PATH, MECX_REDIRECT_LOGIN_WELCOMEBACK_STRATEGY, MECX_REFRESH_TOKEN_STRATEGY, MECX_REQUEST_ID, MECX_TIMEZONEOFFSET, MonkeyEcxAuthGuard, MonkeyEcxAuthGuardByRole, MonkeyEcxAuthGuardCompany, MonkeyEcxAuthGuardLogin, MonkeyEcxBaseResolver, MonkeyEcxBlobSecurePipe, MonkeyEcxCommonsActions, MonkeyEcxCommonsSelectors, MonkeyEcxCommonsStoreService, MonkeyEcxConfigsService, MonkeyEcxCookieStorageService, MonkeyEcxCoreModule, MonkeyEcxCoreService, MonkeyEcxCurrencyCodePipe, MonkeyEcxDatadogService, MonkeyEcxDiscoveryParamsService, MonkeyEcxDisplayFirstNamePipe, MonkeyEcxDisplayInitialsPipe, MonkeyEcxErrorMessageDirective, MonkeyEcxFeatureByProgramDirective, MonkeyEcxFeatureDirective, MonkeyEcxFeatureToggleService, MonkeyEcxFileCacheService, MonkeyEcxFormValidationService, MonkeyEcxFormatAddressPipe, MonkeyEcxFormatBeaufityJSONPipe, MonkeyEcxFormatCurrencyPipe, MonkeyEcxFormatDatePipe, MonkeyEcxFormatDocumentPipe, MonkeyEcxFormatDocumentTypePipe, MonkeyEcxFormatNumberPipe, MonkeyEcxFormatPhonePipe, MonkeyEcxFormatSizePipe, MonkeyEcxFormatTaxPipe, MonkeyEcxFormatValue, MonkeyEcxFormatZipCodePipe, MonkeyEcxI18nResolver, MonkeyEcxLinksModel, MonkeyEcxLoadingDirective, MonkeyEcxLocaleService, MonkeyEcxLoggedHandleService, MonkeyEcxLogs, MonkeyEcxModel, MonkeyEcxPipesModule, MonkeyEcxScheduleService, MonkeyEcxSecurityDirective, MonkeyEcxService, MonkeyEcxTextTruncatePipe, MonkeyEcxTokenStorageService, MonkeyEcxTruncateQtdPipe, MonkeyEcxUtils, MonkeyValidators, comboValidator, containsNumber, dateRangeValidator, dateStartEndValidator, dateValidator, differentFromZero, documentValidator, documentValidatorByType, emailValidator, injectTokenWithWarning, minYearsValidator, monkeyEcxHttpConfigInterceptor, passwordConfirmValidator, provideDomainServiceWorker, registerValidator, requiredWithTrimValidator, index_d$4 as storage, index_d as store, trueValidator, urlValidator, validateFullName, valueGreaterThanZero, zipCodeValidator };
1822
- export type { MonkeyEcxAPIResponse, MonkeyEcxAccessHandleAccessTypes, MonkeyEcxAccessHandleTokenCredentials, MonkeyEcxAlert, MonkeyEcxAuthCredentials, MonkeyEcxAuthReAuthenticateData, MonkeyEcxAuthenticationService, MonkeyEcxBaseResolverData, MonkeyEcxBaseResolverParams, MonkeyEcxBootstrap, MonkeyEcxBootstrapService, MonkeyEcxCachedFile, MonkeyEcxCollectionStore, MonkeyEcxCompany, MonkeyEcxConfigStore, MonkeyEcxControlStore, MonkeyEcxEntityStore, MonkeyEcxEnv, MonkeyEcxGroup, MonkeyEcxGroupCompany, MonkeyEcxHeaderCredentials, MonkeyEcxInterface, MonkeyEcxLinks, MonkeyEcxMeCredentials, MonkeyEcxPage, MonkeyEcxPagination, MonkeyEcxPaginationActions, MonkeyEcxPaginationData, MonkeyEcxPaginationSortData, MonkeyEcxPaginationSortField, MonkeyEcxPendingRequest, MonkeyEcxProgram, MonkeyEcxRedirectLoginWelcomeBackStrategy, MonkeyEcxRefreshTokenStrategy, MonkeyEcxServiceControl, MonkeyEcxServiceCredentials, MonkeyEcxStorage, MonkeyEcxStoreControl, MonkeyEcxStoreLoadPageParams, MonkeyEcxStoreLoadParams, MonkeyEcxStoreStartParams, MonkeyEcxStyleColor, MonkeyEcxStyleGuide, MonkeyEcxStyleGuideFont, MonkeyEcxTokenCredentials, MonkeyEcxWhiteLabel };
1883
+ export { CACHE_LOCALE_EXPIRATION_MS, CountryMasks, LService, Link, MECX_ALPHA, MECX_BETA, MECX_BOOTSTRAP_SERVICE, MECX_CORE_I18N_WRAPPER, MECX_COUNTRY, MECX_DATE_FORMAT, MECX_FEDERATION, MECX_I18N_ALIAS, MECX_I18N_PATH, MECX_REDIRECT_LOGIN_WELCOMEBACK_STRATEGY, MECX_REFRESH_TOKEN_STRATEGY, MECX_REQUEST_ID, MECX_TIMEZONEOFFSET, MonkeyEcxAuthGuard, MonkeyEcxAuthGuardByRole, MonkeyEcxAuthGuardCompany, MonkeyEcxAuthGuardLogin, MonkeyEcxBaseResolver, MonkeyEcxBlobSecurePipe, MonkeyEcxCommonsActions, MonkeyEcxCommonsSelectors, MonkeyEcxCommonsStoreService, MonkeyEcxConfigsService, MonkeyEcxCookieStorageService, MonkeyEcxCoreModule, MonkeyEcxCoreService, MonkeyEcxCurrencyCodePipe, MonkeyEcxDatadogService, MonkeyEcxDiscoveryParamsService, MonkeyEcxDisplayFirstNamePipe, MonkeyEcxDisplayInitialsPipe, MonkeyEcxErrorMessageDirective, MonkeyEcxFeatureByProgramDirective, MonkeyEcxFeatureDirective, MonkeyEcxFeatureToggleService, MonkeyEcxFederationService, MonkeyEcxFileCacheService, MonkeyEcxFormValidationService, MonkeyEcxFormatAddressPipe, MonkeyEcxFormatBeaufityJSONPipe, MonkeyEcxFormatCurrencyPipe, MonkeyEcxFormatDatePipe, MonkeyEcxFormatDocumentPipe, MonkeyEcxFormatDocumentTypePipe, MonkeyEcxFormatNumberPipe, MonkeyEcxFormatPhonePipe, MonkeyEcxFormatSizePipe, MonkeyEcxFormatTaxPipe, MonkeyEcxFormatValue, MonkeyEcxFormatZipCodePipe, MonkeyEcxI18nResolver, MonkeyEcxLinksModel, MonkeyEcxLoadingDirective, MonkeyEcxLocaleService, MonkeyEcxLoggedHandleService, MonkeyEcxLogs, MonkeyEcxModel, MonkeyEcxPipesModule, MonkeyEcxScheduleService, MonkeyEcxSecurityDirective, MonkeyEcxService, MonkeyEcxTextTruncatePipe, MonkeyEcxTokenStorageService, MonkeyEcxTruncateQtdPipe, MonkeyEcxUtils, MonkeyValidators, comboValidator, containsNumber, dateRangeValidator, dateStartEndValidator, dateValidator, differentFromZero, documentValidator, documentValidatorByType, emailValidator, injectTokenWithWarning, minYearsValidator, monkeyEcxHttpConfigInterceptor, passwordConfirmValidator, provideMonkeyEcxDomainServiceWorker, provideMonkeyEcxFederation, registerValidator, requiredWithTrimValidator, index_d$4 as storage, index_d as store, trueValidator, urlValidator, validateFullName, valueGreaterThanZero, zipCodeValidator };
1884
+ export type { MonkeyEcxAPIResponse, MonkeyEcxAccessHandleAccessTypes, MonkeyEcxAccessHandleTokenCredentials, MonkeyEcxAlert, MonkeyEcxAuthCredentials, MonkeyEcxAuthReAuthenticateData, MonkeyEcxAuthenticationService, MonkeyEcxBaseResolverData, MonkeyEcxBaseResolverParams, MonkeyEcxBootstrap, MonkeyEcxBootstrapService, MonkeyEcxCachedFile, MonkeyEcxCollectionStore, MonkeyEcxCompany, MonkeyEcxConfigStore, MonkeyEcxControlStore, MonkeyEcxEntityStore, MonkeyEcxEnv, MonkeyEcxFederationSetting, MonkeyEcxGroup, MonkeyEcxGroupCompany, MonkeyEcxHeaderCredentials, MonkeyEcxInterface, MonkeyEcxLinks, MonkeyEcxMeCredentials, MonkeyEcxPage, MonkeyEcxPagination, MonkeyEcxPaginationActions, MonkeyEcxPaginationData, MonkeyEcxPaginationSortData, MonkeyEcxPaginationSortField, MonkeyEcxPendingRequest, MonkeyEcxProgram, MonkeyEcxRedirectLoginWelcomeBackStrategy, MonkeyEcxRefreshTokenStrategy, MonkeyEcxRemoteState, MonkeyEcxRemoteStatus, MonkeyEcxServiceControl, MonkeyEcxServiceCredentials, MonkeyEcxStorage, MonkeyEcxStoreControl, MonkeyEcxStoreLoadPageParams, MonkeyEcxStoreLoadParams, MonkeyEcxStoreStartParams, MonkeyEcxStyleColor, MonkeyEcxStyleGuide, MonkeyEcxStyleGuideFont, MonkeyEcxTokenCredentials, MonkeyEcxWhiteLabel };
Binary file