@acorex/platform 20.8.21 → 20.8.23
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/auth/index.d.ts +2 -0
- package/common/index.d.ts +41 -13
- package/core/index.d.ts +2 -0
- package/fesm2022/acorex-platform-auth.mjs +10 -2
- package/fesm2022/acorex-platform-auth.mjs.map +1 -1
- package/fesm2022/acorex-platform-common.mjs +81 -41
- package/fesm2022/acorex-platform-common.mjs.map +1 -1
- package/fesm2022/acorex-platform-core.mjs +13 -4
- package/fesm2022/acorex-platform-core.mjs.map +1 -1
- package/fesm2022/acorex-platform-layout-components.mjs +50 -20
- package/fesm2022/acorex-platform-layout-components.mjs.map +1 -1
- package/fesm2022/acorex-platform-themes-default-error-401.component-ChCmvD9Z.mjs +48 -0
- package/fesm2022/acorex-platform-themes-default-error-401.component-ChCmvD9Z.mjs.map +1 -0
- package/fesm2022/acorex-platform-themes-default.mjs +1 -1
- package/fesm2022/acorex-platform-themes-shared.mjs +1 -1
- package/fesm2022/acorex-platform-themes-shared.mjs.map +1 -1
- package/layout/components/index.d.ts +14 -7
- package/package.json +9 -9
- package/fesm2022/acorex-platform-themes-default-error-401.component-53VB-PS_.mjs +0 -31
- package/fesm2022/acorex-platform-themes-default-error-401.component-53VB-PS_.mjs.map +0 -1
package/auth/index.d.ts
CHANGED
|
@@ -298,6 +298,8 @@ declare class AXPSessionService {
|
|
|
298
298
|
readonly isAuthenticated$: Observable<boolean>;
|
|
299
299
|
readonly isAuthenticatedWithLoading$: Observable<boolean>;
|
|
300
300
|
readonly isAuthorized$: Observable<boolean>;
|
|
301
|
+
/** Waits for session restore to finish, then emits whether the session is fully authorized. */
|
|
302
|
+
readonly isAuthorizedWithLoading$: Observable<boolean>;
|
|
301
303
|
restoreSession(): Promise<void>;
|
|
302
304
|
signin(credentials: AXPBaseCredentials): Promise<void>;
|
|
303
305
|
updateToken(params?: {
|
package/common/index.d.ts
CHANGED
|
@@ -9,7 +9,7 @@ import { AXPWidgetTypesMap, AXPMetaDataDefinition, AXPWidgetNode } from '@acorex
|
|
|
9
9
|
import * as i3 from '@acorex/core/date-time';
|
|
10
10
|
import { AXCalendarService } from '@acorex/core/date-time';
|
|
11
11
|
import * as _angular_router from '@angular/router';
|
|
12
|
-
import { Route, Routes, Router, RedirectCommand, ActivatedRouteSnapshot, CanActivateFn } from '@angular/router';
|
|
12
|
+
import { Route, Routes, UrlTree, Router, RedirectCommand, ActivatedRouteSnapshot, CanActivateFn } from '@angular/router';
|
|
13
13
|
import * as i1 from '@acorex/platform/workflow';
|
|
14
14
|
import { AXPWorkflowAction, AXPWorkflowContext, AXPWorkflow } from '@acorex/platform/workflow';
|
|
15
15
|
import * as i4 from '@acorex/components/toast';
|
|
@@ -525,6 +525,10 @@ declare class AXPHomePageService {
|
|
|
525
525
|
private buildFullPaths;
|
|
526
526
|
private refreshRoutes;
|
|
527
527
|
private applyMergedConfig;
|
|
528
|
+
/**
|
|
529
|
+
* Resolves the current user's home page as a router URL tree.
|
|
530
|
+
*/
|
|
531
|
+
resolveHomeUrlTree(): UrlTree;
|
|
528
532
|
navigateTo(): Promise<void>;
|
|
529
533
|
static ɵfac: i0.ɵɵFactoryDeclaration<AXPHomePageService, never>;
|
|
530
534
|
static ɵprov: i0.ɵɵInjectableDeclaration<AXPHomePageService>;
|
|
@@ -566,6 +570,16 @@ declare class AXPNotFoundError extends Error {
|
|
|
566
570
|
|
|
567
571
|
/** Canonical route path for the platform 404 page. */
|
|
568
572
|
declare const AXP_NOT_FOUND_ROUTE = "/error/404";
|
|
573
|
+
/**
|
|
574
|
+
* Catch-all route that redirects unknown URLs to the platform 404 page.
|
|
575
|
+
* Register this as the **last** route source in the application (after all app and module routes).
|
|
576
|
+
*/
|
|
577
|
+
declare const AXP_NOT_FOUND_CATCH_ALL_ROUTE: Route;
|
|
578
|
+
/**
|
|
579
|
+
* Registers the platform catch-all 404 route.
|
|
580
|
+
* Must be the last `ROUTES` provider in `app.config` so custom app routes are matched first.
|
|
581
|
+
*/
|
|
582
|
+
declare function AXPNotFoundCatchAllRoute(): EnvironmentProviders;
|
|
569
583
|
/**
|
|
570
584
|
* Returns true when an entity byKey query did not resolve a record.
|
|
571
585
|
*/
|
|
@@ -575,6 +589,13 @@ declare function axpIsEntityRecordNotFound(data: unknown): boolean;
|
|
|
575
589
|
*/
|
|
576
590
|
declare function axpRedirectToNotFound(router?: Router): RedirectCommand;
|
|
577
591
|
|
|
592
|
+
/** Canonical route path for the platform 401 page. */
|
|
593
|
+
declare const AXP_UNAUTHORIZED_ROUTE = "/error/401";
|
|
594
|
+
/**
|
|
595
|
+
* Creates an Angular redirect command to the platform 401 page.
|
|
596
|
+
*/
|
|
597
|
+
declare function axpRedirectToUnauthorized(router?: Router): RedirectCommand;
|
|
598
|
+
|
|
578
599
|
interface AXPCommonModuleConfigs {
|
|
579
600
|
errorHandlers: (new () => AXPErrorHandler)[];
|
|
580
601
|
}
|
|
@@ -1564,6 +1585,11 @@ declare const AXPMenuService: i0.Type<{
|
|
|
1564
1585
|
*/
|
|
1565
1586
|
declare class AXPMenuVisibilityService {
|
|
1566
1587
|
private sessionService;
|
|
1588
|
+
/**
|
|
1589
|
+
* Checks visibility for a menu branch, including ancestor policies.
|
|
1590
|
+
* Parent module features and permissions must pass before child routes are accessible.
|
|
1591
|
+
*/
|
|
1592
|
+
isMenuBranchVisible(item: AXPMenuItem, ancestors?: AXPMenuItem[]): boolean;
|
|
1567
1593
|
/**
|
|
1568
1594
|
* Checks if a menu item should be visible based on permissions and features.
|
|
1569
1595
|
*/
|
|
@@ -1591,6 +1617,8 @@ declare class AXPMenuVisibilityService {
|
|
|
1591
1617
|
|
|
1592
1618
|
interface AXPMenuRouteMatchResult {
|
|
1593
1619
|
item: AXPMenuItem;
|
|
1620
|
+
/** Parent menu items from root down to the direct parent of the matched item. */
|
|
1621
|
+
ancestors: AXPMenuItem[];
|
|
1594
1622
|
isPartialMatch: boolean;
|
|
1595
1623
|
}
|
|
1596
1624
|
/**
|
|
@@ -1607,14 +1635,12 @@ declare function axpMenuPathsMatch(itemPath: string, currentPath: string, traili
|
|
|
1607
1635
|
declare function axpFindMenuItemByRoute(items: AXPMenuItem[], currentPath: string, trailingSegmentsToIgnore?: string[]): AXPMenuRouteMatchResult | null;
|
|
1608
1636
|
|
|
1609
1637
|
/**
|
|
1610
|
-
* Resolves route access using
|
|
1638
|
+
* Resolves route access using menu policy, route metadata, permissions, and features.
|
|
1611
1639
|
*/
|
|
1612
|
-
declare class
|
|
1640
|
+
declare class AXPMenuRouteAccessService {
|
|
1613
1641
|
private readonly menuProvider;
|
|
1614
1642
|
private readonly menuVisibility;
|
|
1615
1643
|
private readonly sessionService;
|
|
1616
|
-
private readonly toastService;
|
|
1617
|
-
private readonly translationService;
|
|
1618
1644
|
/**
|
|
1619
1645
|
* Checks whether navigation to the target URL is allowed for the current user.
|
|
1620
1646
|
*/
|
|
@@ -1625,18 +1651,20 @@ declare class AXPMenuRoutePermissionService {
|
|
|
1625
1651
|
private getInheritedRouteData;
|
|
1626
1652
|
private normalizeKeys;
|
|
1627
1653
|
private normalizeUrl;
|
|
1628
|
-
|
|
1629
|
-
static
|
|
1630
|
-
static ɵprov: i0.ɵɵInjectableDeclaration<AXPMenuRoutePermissionService>;
|
|
1654
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<AXPMenuRouteAccessService, never>;
|
|
1655
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<AXPMenuRouteAccessService>;
|
|
1631
1656
|
}
|
|
1632
1657
|
|
|
1633
1658
|
/**
|
|
1634
|
-
|
|
1635
|
-
*
|
|
1659
|
+
|
|
1660
|
+
* Blocks navigation when the target route is not accessible for the current user.
|
|
1661
|
+
|
|
1662
|
+
* Evaluates menu policy, permissions, and features.
|
|
1663
|
+
|
|
1636
1664
|
*/
|
|
1637
|
-
declare const
|
|
1665
|
+
declare const AXPMenuRouteGuard: CanActivateFn;
|
|
1638
1666
|
|
|
1639
|
-
/** Standard guards for authenticated routes with menu-based
|
|
1667
|
+
/** Standard guards for authenticated routes with menu-based access enforcement. */
|
|
1640
1668
|
declare const AXP_PROTECTED_ROUTE_GUARDS: readonly [_angular_router.CanActivateFn, _angular_router.CanActivateFn];
|
|
1641
1669
|
|
|
1642
1670
|
interface AXPSearchDefinitionDisplayFormat {
|
|
@@ -2800,5 +2828,5 @@ declare class AXMWorkflowErrorHandler implements AXPErrorHandler {
|
|
|
2800
2828
|
static ɵprov: i0.ɵɵInjectableDeclaration<AXMWorkflowErrorHandler>;
|
|
2801
2829
|
}
|
|
2802
2830
|
|
|
2803
|
-
export { ALL_DEFAULT_OPERATORS, AXMWorkflowErrorHandler, AXPAppVersionService, AXPCleanNestedFilters, AXPClipBoardService, AXPCommonModule, AXPCommonSettings, AXPCustomOperatorService, AXPCustomOperatorServiceImpl, AXPDataProvider, AXPDebugService, AXPDialogConfirmAction, AXPEntityCommandScope, AXPEntityQueryType, AXPErrorHandlerRegistryService, AXPExportService, AXPFileActionsService, AXPFileStorageService, AXPFileStorageStatus, AXPFileTypeProviderService, AXPFilterOperatorMiddlewareService, AXPFilterOperatorMiddlewareServiceImpl, AXPFooterTextSlotComponent, AXPGlobalErrorHandler, AXPHomePageModule, AXPHomePageService, AXPLockService, AXPMenuMiddlewareRegistry,
|
|
2831
|
+
export { ALL_DEFAULT_OPERATORS, AXMWorkflowErrorHandler, AXPAppVersionService, AXPCleanNestedFilters, AXPClipBoardService, AXPCommonModule, AXPCommonSettings, AXPCustomOperatorService, AXPCustomOperatorServiceImpl, AXPDataProvider, AXPDebugService, AXPDialogConfirmAction, AXPEntityCommandScope, AXPEntityQueryType, AXPErrorHandlerRegistryService, AXPExportService, AXPFileActionsService, AXPFileStorageService, AXPFileStorageStatus, AXPFileTypeProviderService, AXPFilterOperatorMiddlewareService, AXPFilterOperatorMiddlewareServiceImpl, AXPFooterTextSlotComponent, AXPGlobalErrorHandler, AXPHomePageModule, AXPHomePageService, AXPLockService, AXPMenuMiddlewareRegistry, AXPMenuProviderService, AXPMenuRouteAccessService, AXPMenuRouteGuard, AXPMenuSearchDefinitionProvider, AXPMenuSearchProvider, AXPMenuService, AXPMenuVisibilityService, AXPNavBarSlotComponent, AXPNavigateWorkflow, AXPNotFoundCatchAllRoute, AXPNotFoundError, AXPPlatformDefaultConfigs, AXPRedirectEvent, AXPRefreshEvent, AXPRegionalSetting, AXPRelationshipCardinality, AXPRelationshipKind, AXPReloadAction, AXPReloadEvent, AXPSearchCommandProvider, AXPSearchDefinitionActionBuilder, AXPSearchDefinitionBuilder, AXPSearchDefinitionProviderContext, AXPSearchDefinitionProviderService, AXPSearchService, AXPSettingDefaultValuesAggregatorService, AXPSettingDefinitionGroupBuilder, AXPSettingDefinitionProviderContext, AXPSettingDefinitionProviderService, AXPSettingDefinitionSectionBuilder, AXPSettingsService, AXPStatusDefinitionProviderService, AXPStatusProvider, AXPStickyDirective, AXPSystemStatusType, AXPSystemStatuses, AXPToastAction, AXPTokenDefinitionService, AXPTokenEvaluatorScopeProvider, AXPVersioningService, AXPWorkflowNavigateAction, AXPWorkflowRouterNavigateAction, AXP_APP_VERSION_PROVIDER, AXP_FILE_ACTION_PROVIDER, AXP_FILE_TYPE_INFO_PROVIDER, AXP_HOME_PAGES, AXP_HOME_PAGE_DEFAULT_KEY, AXP_MENU_MIDDLEWARE, AXP_MENU_PROVIDER, AXP_NOT_FOUND_CATCH_ALL_ROUTE, AXP_NOT_FOUND_ROUTE, AXP_PLATFORM_CONFIG_TOKEN, AXP_PROTECTED_ROUTE_GUARDS, AXP_ROOT_CONFIG_TOKEN, AXP_SEARCH_DEFINITION_PROVIDER, AXP_SEARCH_PROVIDER, AXP_SETTING_DEFAULT_VALUES_PROVIDERS, AXP_SETTING_DEFINITION_PROVIDER, AXP_SETTING_VALUE_PROVIDER, AXP_STATUS_PROVIDERS, AXP_TOKEN_DEFINITION_PROVIDER, AXP_UNAUTHORIZED_ROUTE, AXVChangeType, BETWEEN_OPER, BOOLEAN_OPERATORS, CONTAINS_OPER, DATE_OPERATORS, DEFAULT_DATE_FILTER_PRESETS, ENDS_WITH_OPER, ENVIRONMENT, EQ_OPER, GTE_OPER, GT_OPER, IN_OPER, IS_EMPTY_OPER, IS_NOT_EMPTY_OPER, LTE_OPER, LT_OPER, NOT_CONTAINS_OPER, NOT_EQ_OPER, NUMBER_OPERATORS, STARTS_WITH_OPER, STRING_OPERATORS, UploadFromComputerActionProvider, applyDateFilterPreset, axpFindMenuItemByRoute, axpIsEntityRecordNotFound, axpMenuPathsMatch, axpRedirectToNotFound, axpRedirectToUnauthorized, configPlatform, createAllQueryView, createMenuContext, createMenuMiddleware, createQueryView, findManualPresetIdByOperation, getEntityInfo, getStatusInfo, getSystemStatus, provideDynamicHomePage, provideMenuMiddleware, resolveDateFilterPresets, resolveStatusLook, systemStatusToDefinition };
|
|
2804
2832
|
export type { AXCFileUploaderAction, AXCFileUploaderActionsPayload, AXCFileUploaderCapabilities, AXEntityPropertyWidget, AXPAggregate, AXPAppVersion, AXPAppVersionProvider, AXPApplication, AXPCategoryEntity, AXPColumnAlign, AXPColumnContentAlign, AXPCommandActionCallback, AXPCommandActionDisplay, AXPCommandActionLook, AXPCommandActionPriority, AXPCommandActionType, AXPCommonModuleConfigs, AXPCurrency, AXPDateTimeFilterPreset, AXPDateTimeFilterPresetKind, AXPDateTimeFilterValue, AXPDomToImageOptions, AXPEntity, AXPEntityAction, AXPEntityCommand, AXPEntityDetailListView, AXPEntityMasterCreateLayoutView, AXPEntityMasterLayoutView, AXPEntityMasterListView, AXPEntityMasterSingleLayoutView, AXPEntityMasterUpdateLayoutView, AXPEntityProperty, AXPEntityPropertyCreateView, AXPEntityPropertyGroup, AXPEntityPropertyLayoutConfig, AXPEntityPropertyUpdateView, AXPEntityPropertyView, AXPEntityQuery, AXPEntitySectionView, AXPEntityTableColumn, AXPEntityVersionHistory, AXPErrorHandler, AXPFileActionProvider, AXPFileActionProviderToken, AXPFileExtension, AXPFileManyStorageInfo, AXPFileStorageCreateRequest, AXPFileStorageFindRequest, AXPFileStorageInfo, AXPFileStorageUpdateRequest, AXPFileType, AXPFileTypeInfoProvider, AXPFilterOperator, AXPGeoLocation, AXPGroupSearchResult, AXPHomePageDefinition, AXPLanguage, AXPLocaleProfile, AXPLockGetInfoRequest, AXPLockInfo, AXPLockRequest, AXPLockType, AXPMenuFinderResult, AXPMenuInsertion, AXPMenuItem, AXPMenuItemCommand, AXPMenuItemFinder, AXPMenuItemWithParent, AXPMenuMiddleware, AXPMenuMiddlewareContext, AXPMenuMiddlewareProvider, AXPMenuProvider, AXPMenuProviderContext, AXPMenuRouteMatchResult, AXPMenuType, AXPModule, AXPPlatformConfigs, AXPQueryFilter, AXPQuerySort, AXPQueryView, AXPRelatedEntity, AXPRelationship, AXPRootConfigs, AXPSearchAction, AXPSearchDefinition, AXPSearchDefinitionDisplayFormat, AXPSearchDefinitionProvider, AXPSearchDisplayGroupResult, AXPSearchDisplayResult, AXPSearchDisplayResultForSave, AXPSearchParentResult, AXPSearchProvider, AXPSearchResult, AXPSettingChangedEvent, AXPSettingDefaultValuesProvider, AXPSettingDefinition, AXPSettingDefinitionGroup, AXPSettingDefinitionProvider, AXPSettingDefinitionSection, AXPSettingValue, AXPSettingValueProvider, AXPSettingsServiceInterface, AXPStatusDefinition, AXPStatusTransition, AXPTimeZone, AXPTokenDefinition, AXPTokenDefinitionProvider, AXPTokenDefinitionProviderToken, AXPUnLockRequest, AXPVersionChange, AXPVersionEntry, AXPVersionStream, CanonicalChange, CanonicalChangeOp, VersionedFileInfo };
|
package/core/index.d.ts
CHANGED
|
@@ -2360,12 +2360,14 @@ declare class AXPModuleManifestRegistry {
|
|
|
2360
2360
|
|
|
2361
2361
|
interface AXPStartUpTask {
|
|
2362
2362
|
name: string;
|
|
2363
|
+
/** Translation key (e.g. `@general:startup-tasks.module-manifests`). */
|
|
2363
2364
|
statusText: string;
|
|
2364
2365
|
priority: number;
|
|
2365
2366
|
run: () => Promise<void>;
|
|
2366
2367
|
}
|
|
2367
2368
|
|
|
2368
2369
|
declare class AXPAppStartUpService {
|
|
2370
|
+
private readonly translationService;
|
|
2369
2371
|
private tasks;
|
|
2370
2372
|
registerTask(task: AXPStartUpTask): void;
|
|
2371
2373
|
runAllTasks(): Promise<void>;
|
|
@@ -272,6 +272,13 @@ class AXPSessionService {
|
|
|
272
272
|
return this.isAuthenticated$;
|
|
273
273
|
}), shareReplay(1));
|
|
274
274
|
this.isAuthorized$ = this.status$.pipe(map((status) => status === AXPSessionStatus.Authorized), shareReplay(1));
|
|
275
|
+
/** Waits for session restore to finish, then emits whether the session is fully authorized. */
|
|
276
|
+
this.isAuthorizedWithLoading$ = this.isLoading$.pipe(switchMap((loading) => {
|
|
277
|
+
if (loading) {
|
|
278
|
+
return this.isLoading$.pipe(filter((isLoading) => !isLoading), switchMap(() => this.isAuthorized$));
|
|
279
|
+
}
|
|
280
|
+
return this.isAuthorized$;
|
|
281
|
+
}), shareReplay(1));
|
|
275
282
|
}
|
|
276
283
|
static { this.SESSION_KEY = 'AXP_SESSION'; }
|
|
277
284
|
get user() {
|
|
@@ -698,12 +705,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.19", ngImpo
|
|
|
698
705
|
const AXPPermissionGuard = (route, state) => {
|
|
699
706
|
const sessionService = inject(AXPSessionService);
|
|
700
707
|
const permissionKeys = route.data['requiredPermission'];
|
|
701
|
-
return sessionService.
|
|
708
|
+
return sessionService.isAuthorizedWithLoading$.pipe(first(), map((value) => {
|
|
709
|
+
debugger;
|
|
702
710
|
const keys = !permissionKeys ? [] : Array.isArray(permissionKeys) ? permissionKeys : [permissionKeys];
|
|
703
711
|
const hasPermission = keys.length == 0 || sessionService.authorize(...keys);
|
|
704
712
|
if (!hasPermission) {
|
|
705
713
|
throw new AXPUnauthorizedError(`Access denied. Required permissions: ${keys.join(', ')}. Please contact your administrator if you believe this is an error.`, {
|
|
706
|
-
redirectUrl: state.url
|
|
714
|
+
redirectUrl: state.url,
|
|
707
715
|
});
|
|
708
716
|
}
|
|
709
717
|
return true;
|