@acorex/platform 20.8.22 → 20.8.24
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 +34 -15
- 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 +70 -44
- 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 +2 -2
- package/fesm2022/acorex-platform-layout-components.mjs.map +1 -1
- package/fesm2022/acorex-platform-layout-entity.mjs +1 -1
- package/fesm2022/acorex-platform-layout-entity.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/package.json +1 -1
- 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>;
|
|
@@ -585,6 +589,13 @@ declare function axpIsEntityRecordNotFound(data: unknown): boolean;
|
|
|
585
589
|
*/
|
|
586
590
|
declare function axpRedirectToNotFound(router?: Router): RedirectCommand;
|
|
587
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
|
+
|
|
588
599
|
interface AXPCommonModuleConfigs {
|
|
589
600
|
errorHandlers: (new () => AXPErrorHandler)[];
|
|
590
601
|
}
|
|
@@ -1574,6 +1585,11 @@ declare const AXPMenuService: i0.Type<{
|
|
|
1574
1585
|
*/
|
|
1575
1586
|
declare class AXPMenuVisibilityService {
|
|
1576
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;
|
|
1577
1593
|
/**
|
|
1578
1594
|
* Checks if a menu item should be visible based on permissions and features.
|
|
1579
1595
|
*/
|
|
@@ -1601,6 +1617,8 @@ declare class AXPMenuVisibilityService {
|
|
|
1601
1617
|
|
|
1602
1618
|
interface AXPMenuRouteMatchResult {
|
|
1603
1619
|
item: AXPMenuItem;
|
|
1620
|
+
/** Parent menu items from root down to the direct parent of the matched item. */
|
|
1621
|
+
ancestors: AXPMenuItem[];
|
|
1604
1622
|
isPartialMatch: boolean;
|
|
1605
1623
|
}
|
|
1606
1624
|
/**
|
|
@@ -1617,14 +1635,12 @@ declare function axpMenuPathsMatch(itemPath: string, currentPath: string, traili
|
|
|
1617
1635
|
declare function axpFindMenuItemByRoute(items: AXPMenuItem[], currentPath: string, trailingSegmentsToIgnore?: string[]): AXPMenuRouteMatchResult | null;
|
|
1618
1636
|
|
|
1619
1637
|
/**
|
|
1620
|
-
* Resolves route access using
|
|
1638
|
+
* Resolves route access using menu policy, route metadata, permissions, and features.
|
|
1621
1639
|
*/
|
|
1622
|
-
declare class
|
|
1640
|
+
declare class AXPMenuRouteAccessService {
|
|
1623
1641
|
private readonly menuProvider;
|
|
1624
1642
|
private readonly menuVisibility;
|
|
1625
1643
|
private readonly sessionService;
|
|
1626
|
-
private readonly toastService;
|
|
1627
|
-
private readonly translationService;
|
|
1628
1644
|
/**
|
|
1629
1645
|
* Checks whether navigation to the target URL is allowed for the current user.
|
|
1630
1646
|
*/
|
|
@@ -1635,18 +1651,20 @@ declare class AXPMenuRoutePermissionService {
|
|
|
1635
1651
|
private getInheritedRouteData;
|
|
1636
1652
|
private normalizeKeys;
|
|
1637
1653
|
private normalizeUrl;
|
|
1638
|
-
|
|
1639
|
-
static
|
|
1640
|
-
static ɵprov: i0.ɵɵInjectableDeclaration<AXPMenuRoutePermissionService>;
|
|
1654
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<AXPMenuRouteAccessService, never>;
|
|
1655
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<AXPMenuRouteAccessService>;
|
|
1641
1656
|
}
|
|
1642
1657
|
|
|
1643
1658
|
/**
|
|
1644
|
-
|
|
1645
|
-
*
|
|
1659
|
+
|
|
1660
|
+
* Blocks navigation when the target route is not accessible for the current user.
|
|
1661
|
+
|
|
1662
|
+
* Evaluates menu policy, permissions, and features.
|
|
1663
|
+
|
|
1646
1664
|
*/
|
|
1647
|
-
declare const
|
|
1665
|
+
declare const AXPMenuRouteGuard: CanActivateFn;
|
|
1648
1666
|
|
|
1649
|
-
/** Standard guards for authenticated routes with menu-based
|
|
1667
|
+
/** Standard guards for authenticated routes with menu-based access enforcement. */
|
|
1650
1668
|
declare const AXP_PROTECTED_ROUTE_GUARDS: readonly [_angular_router.CanActivateFn, _angular_router.CanActivateFn];
|
|
1651
1669
|
|
|
1652
1670
|
interface AXPSearchDefinitionDisplayFormat {
|
|
@@ -2585,8 +2603,9 @@ declare class AXPTokenEvaluatorScopeProvider implements AXPExpressionEvaluatorSc
|
|
|
2585
2603
|
}
|
|
2586
2604
|
|
|
2587
2605
|
declare class AXPClipBoardService {
|
|
2588
|
-
private toast;
|
|
2589
|
-
|
|
2606
|
+
private readonly toast;
|
|
2607
|
+
private readonly translationService;
|
|
2608
|
+
copy(title: string, value: string): Promise<void>;
|
|
2590
2609
|
static ɵfac: i0.ɵɵFactoryDeclaration<AXPClipBoardService, never>;
|
|
2591
2610
|
static ɵprov: i0.ɵɵInjectableDeclaration<AXPClipBoardService>;
|
|
2592
2611
|
}
|
|
@@ -2810,5 +2829,5 @@ declare class AXMWorkflowErrorHandler implements AXPErrorHandler {
|
|
|
2810
2829
|
static ɵprov: i0.ɵɵInjectableDeclaration<AXMWorkflowErrorHandler>;
|
|
2811
2830
|
}
|
|
2812
2831
|
|
|
2813
|
-
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,
|
|
2832
|
+
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 };
|
|
2814
2833
|
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;
|