mesauth-angular 1.7.0 → 1.8.0
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/fesm2022/mesauth-angular.mjs +230 -1157
- package/fesm2022/mesauth-angular.mjs.map +1 -1
- package/package.json +1 -1
- package/types/mesauth-angular.d.ts +114 -4
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mesauth-angular",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.8.0",
|
|
4
4
|
"description": "Angular helper library to connect to a backend API and SignalR hub to surface the current logged-in user and incoming notifications with dark/light theme support",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"angular",
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { InjectionToken, NgZone, EnvironmentProviders, OnDestroy, OnInit, EventEmitter, ChangeDetectorRef, AfterViewInit, ElementRef } from '@angular/core';
|
|
2
|
+
import { InjectionToken, NgZone, EnvironmentProviders, OnDestroy, OnInit, EventEmitter, ChangeDetectorRef, AfterViewInit, ElementRef, OnChanges, SimpleChanges } from '@angular/core';
|
|
3
3
|
import { HttpClient, HttpInterceptorFn, HttpResponse, HttpParams } from '@angular/common/http';
|
|
4
4
|
import { Observable, OperatorFunction } from 'rxjs';
|
|
5
5
|
import { Router } from '@angular/router';
|
|
@@ -9,6 +9,12 @@ interface MesAuthConfig {
|
|
|
9
9
|
apiBaseUrl: string;
|
|
10
10
|
withCredentials?: boolean;
|
|
11
11
|
userBaseUrl?: string;
|
|
12
|
+
/**
|
|
13
|
+
* Base URL for hosted UI assets (CSS themes, icons, manifest).
|
|
14
|
+
* Defaults to `{apiBaseUrl}/mesauth-angular/v1` when omitted.
|
|
15
|
+
* Allows updating themes, icons, and labels without republishing the npm package.
|
|
16
|
+
*/
|
|
17
|
+
uiAssetsUrl?: string;
|
|
12
18
|
}
|
|
13
19
|
/** Injection token for MesAuth configuration */
|
|
14
20
|
declare const MES_AUTH_CONFIG: InjectionToken<MesAuthConfig>;
|
|
@@ -136,6 +142,7 @@ declare class MesAuthService {
|
|
|
136
142
|
private ngZone;
|
|
137
143
|
constructor();
|
|
138
144
|
init(config: MesAuthConfig, httpClient: HttpClient, router?: Router, ngZone?: NgZone): void;
|
|
145
|
+
private injectThemeStylesheet;
|
|
139
146
|
getConfig(): MesAuthConfig | null;
|
|
140
147
|
private fetchCurrentUser;
|
|
141
148
|
getUnreadCount(): Observable<any>;
|
|
@@ -598,6 +605,7 @@ declare class MaArvContainerComponent implements OnInit, OnDestroy {
|
|
|
598
605
|
description?: string;
|
|
599
606
|
referenceId: string;
|
|
600
607
|
templateId?: number;
|
|
608
|
+
templateIds?: number[];
|
|
601
609
|
callbackUrl?: string;
|
|
602
610
|
deadlineHours?: number;
|
|
603
611
|
approvalSubmitted: EventEmitter<ApprovalSubmitResult>;
|
|
@@ -652,7 +660,7 @@ declare class MaArvContainerComponent implements OnInit, OnDestroy {
|
|
|
652
660
|
private captureThumbnail;
|
|
653
661
|
private getStyleProperties;
|
|
654
662
|
static ɵfac: i0.ɵɵFactoryDeclaration<MaArvContainerComponent, never>;
|
|
655
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<MaArvContainerComponent, "ma-arv-container", never, { "title": { "alias": "title"; "required": false; }; "description": { "alias": "description"; "required": false; }; "referenceId": { "alias": "referenceId"; "required": false; }; "templateId": { "alias": "templateId"; "required": false; }; "callbackUrl": { "alias": "callbackUrl"; "required": false; }; "deadlineHours": { "alias": "deadlineHours"; "required": false; }; }, { "approvalSubmitted": "approvalSubmitted"; "approvalSubmitting": "approvalSubmitting"; "cancelled": "cancelled"; }, never, ["*"], true, never>;
|
|
663
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<MaArvContainerComponent, "ma-arv-container", never, { "title": { "alias": "title"; "required": false; }; "description": { "alias": "description"; "required": false; }; "referenceId": { "alias": "referenceId"; "required": false; }; "templateId": { "alias": "templateId"; "required": false; }; "templateIds": { "alias": "templateIds"; "required": false; }; "callbackUrl": { "alias": "callbackUrl"; "required": false; }; "deadlineHours": { "alias": "deadlineHours"; "required": false; }; }, { "approvalSubmitted": "approvalSubmitted"; "approvalSubmitting": "approvalSubmitting"; "cancelled": "cancelled"; }, never, ["*"], true, never>;
|
|
656
664
|
}
|
|
657
665
|
|
|
658
666
|
interface PermissionHeader {
|
|
@@ -675,5 +683,107 @@ declare function xMaResource<T>(request: () => RequestConfig): i0.ResourceRef<{
|
|
|
675
683
|
allowedActions: string[];
|
|
676
684
|
}>;
|
|
677
685
|
|
|
678
|
-
|
|
679
|
-
|
|
686
|
+
interface MaUiManifest {
|
|
687
|
+
/** Version of the package that created this manifest. */
|
|
688
|
+
version: string;
|
|
689
|
+
/** Latest published package version — library logs a warning if installed version is older. */
|
|
690
|
+
latestPackageVersion?: string;
|
|
691
|
+
/** Set true to show an upgrade banner inside components. */
|
|
692
|
+
updateRequired?: boolean;
|
|
693
|
+
/** URL override for the theme CSS (defaults to themes/default.css relative to assetsUrl). */
|
|
694
|
+
themeUrl?: string;
|
|
695
|
+
/** URL override for the SVG icon sprite. */
|
|
696
|
+
iconSpriteUrl?: string;
|
|
697
|
+
/** UI string overrides — keys match component label identifiers. */
|
|
698
|
+
labels?: Record<string, string>;
|
|
699
|
+
/** Feature flags read by components at runtime. */
|
|
700
|
+
features?: Record<string, boolean>;
|
|
701
|
+
}
|
|
702
|
+
/**
|
|
703
|
+
* Provides server-driven UI configuration loaded from the hosted manifest.
|
|
704
|
+
* Components read `labels()` and `features()` signals instead of hardcoded strings.
|
|
705
|
+
* Update manifest.json on the server to change labels or toggle features without
|
|
706
|
+
* republishing the npm package.
|
|
707
|
+
*/
|
|
708
|
+
declare class MaUiConfigService {
|
|
709
|
+
private _labels;
|
|
710
|
+
private _features;
|
|
711
|
+
private _updateRequired;
|
|
712
|
+
/** Reactive map of UI string overrides from the server manifest. */
|
|
713
|
+
readonly labels: i0.Signal<Record<string, string>>;
|
|
714
|
+
/** Reactive map of feature flags from the server manifest. */
|
|
715
|
+
readonly features: i0.Signal<Record<string, boolean>>;
|
|
716
|
+
/** True when the server signals that a package upgrade is needed. */
|
|
717
|
+
readonly updateRequired: i0.Signal<boolean>;
|
|
718
|
+
/**
|
|
719
|
+
* Returns a label by key, falling back to `defaultValue` when the server
|
|
720
|
+
* manifest has not provided an override.
|
|
721
|
+
*/
|
|
722
|
+
label(key: string, defaultValue: string): string;
|
|
723
|
+
/**
|
|
724
|
+
* Returns a feature flag by key, falling back to `defaultValue`.
|
|
725
|
+
*/
|
|
726
|
+
feature(key: string, defaultValue?: boolean): boolean;
|
|
727
|
+
/**
|
|
728
|
+
* Called by MesAuthService.init() — fetches the manifest and applies any
|
|
729
|
+
* label/feature overrides. Failures are silently ignored so the library
|
|
730
|
+
* works without a manifest endpoint.
|
|
731
|
+
*/
|
|
732
|
+
loadManifest(assetsUrl: string, http: HttpClient): void;
|
|
733
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<MaUiConfigService, never>;
|
|
734
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<MaUiConfigService>;
|
|
735
|
+
}
|
|
736
|
+
|
|
737
|
+
/**
|
|
738
|
+
* MaIconComponent
|
|
739
|
+
* Renders an SVG icon from the server-hosted sprite.
|
|
740
|
+
* The sprite URL is derived from the stylesheet link injected by MesAuthService,
|
|
741
|
+
* so changing the sprite on the server updates icons without a package rebuild.
|
|
742
|
+
*
|
|
743
|
+
* Selector: <ma-icon name="bell" [size]="20" />
|
|
744
|
+
*
|
|
745
|
+
* When the sprite is not available, falls back to inline SVG definitions
|
|
746
|
+
* for the icons used internally by the library (bell, check, close, etc.).
|
|
747
|
+
*
|
|
748
|
+
* This component is intentionally lightweight — it is the single place where
|
|
749
|
+
* icon SVG is defined, replacing the repeated inline <svg> blocks that were
|
|
750
|
+
* scattered across every component template.
|
|
751
|
+
*/
|
|
752
|
+
declare class MaIconComponent implements OnChanges {
|
|
753
|
+
name: string;
|
|
754
|
+
size: number;
|
|
755
|
+
stroke: string;
|
|
756
|
+
strokeWidth: number;
|
|
757
|
+
svgContent: SafeHtml;
|
|
758
|
+
private sanitizer;
|
|
759
|
+
ngOnChanges(changes: SimpleChanges): void;
|
|
760
|
+
private buildSvg;
|
|
761
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<MaIconComponent, never>;
|
|
762
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<MaIconComponent, "ma-icon", never, { "name": { "alias": "name"; "required": false; }; "size": { "alias": "size"; "required": false; }; "stroke": { "alias": "stroke"; "required": false; }; "strokeWidth": { "alias": "strokeWidth"; "required": false; }; }, {}, never, never, true, never>;
|
|
763
|
+
}
|
|
764
|
+
|
|
765
|
+
/**
|
|
766
|
+
* MaThemeDirective
|
|
767
|
+
* Apply `maTheme` to any element or component that needs automatic theme-class binding.
|
|
768
|
+
* Adds `theme-light` or `theme-dark` to the host element's class list and keeps it
|
|
769
|
+
* in sync with ThemeService, replacing the duplicated @HostBinding + subscription
|
|
770
|
+
* pattern that was repeated in every component.
|
|
771
|
+
*
|
|
772
|
+
* Usage:
|
|
773
|
+
* <div maTheme> ... </div>
|
|
774
|
+
*
|
|
775
|
+
* Or as a hostDirective in a component:
|
|
776
|
+
* @Component({ hostDirectives: [MaThemeDirective], ... })
|
|
777
|
+
*/
|
|
778
|
+
declare class MaThemeDirective implements OnInit, OnDestroy {
|
|
779
|
+
themeClass: string;
|
|
780
|
+
private themeService;
|
|
781
|
+
private destroy$;
|
|
782
|
+
ngOnInit(): void;
|
|
783
|
+
ngOnDestroy(): void;
|
|
784
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<MaThemeDirective, never>;
|
|
785
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<MaThemeDirective, "[maTheme]", never, {}, {}, never, never, true, never>;
|
|
786
|
+
}
|
|
787
|
+
|
|
788
|
+
export { ALL_ACTIONS, ApprovalActionType, ApprovalDocumentStatus, ApprovalStepMode, ApprovalStepStatus, MES_AUTH_CONFIG, MaApprovalPanelComponent, MaApprovalService, MaArvContainerComponent, MaIconComponent, MaThemeDirective, MaUiConfigService, MaUserComponent, MesAuthModule, MesAuthService, NotificationBadgeComponent, NotificationPanelComponent, NotificationType, ThemeService, ToastContainerComponent, ToastService, UserProfileComponent, extractXMaPerm, mesAuthInterceptor, provideMesAuth, withXMaPerm, xMaResource };
|
|
789
|
+
export type { ApprovalDashboardDto, ApprovalDocumentDto, ApprovalDocumentSummaryDto, ApprovalHistoryDto, ApprovalReferenceDto, ApprovalStepDto, ApprovalStepRequest, ApprovalSubmitResult, ApprovalTemplateDto, ApprovalTemplateStepDto, ApprovalTemplateSummaryDto, ApproveRejectRequest, CreateApprovalRequest, CreateApprovalResponseDto, CreateApprovalTemplateRequest, DelegateRequest, FrontEndRoute, IUser, MaUiManifest, MesAuthConfig, NotificationDto, PagedList, PermissionHeader, RealTimeNotificationDto, RequestConfig, RolePreviewUserDto, StepRoleDto, Theme, Toast, UpdateApprovalTemplateRequest, UserFrontEndRoutesGrouped };
|