oip-common 0.4.0 → 0.6.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/index.d.ts CHANGED
@@ -1,10 +1,10 @@
1
1
  import * as i0 from '@angular/core';
2
2
  import { OnDestroy, OnInit, DestroyRef, WritableSignal, OnChanges, SimpleChanges, Type, InjectionToken, Provider, EventEmitter, Renderer2, EnvironmentProviders } from '@angular/core';
3
- import { MessageService, ToastMessageOptions, ConfirmationService, MenuItem, FilterMetadata } from 'primeng/api';
4
- import { ActivatedRoute, QueryParamsHandling, IsActiveMatchOptions, Params, Router, UrlTree } from '@angular/router';
5
- import { InterpolationParameters, Translation, TranslationObject, TranslateService } from '@ngx-translate/core';
6
3
  import * as rxjs from 'rxjs';
7
4
  import { Observable, BehaviorSubject, Subscription, Subject } from 'rxjs';
5
+ import { MessageService, ToastMessageOptions, ConfirmationService, MenuItem, FilterMetadata } from 'primeng/api';
6
+ import { Router, ActivatedRoute, QueryParamsHandling, IsActiveMatchOptions, Params, CanActivateChildFn } from '@angular/router';
7
+ import { TranslationObject, InterpolationParameters, Translation, TranslateService } from '@ngx-translate/core';
8
8
  import { ContextMenu } from 'primeng/contextmenu';
9
9
  import { PaletteDesignToken, Preset } from '@primeuix/themes/types';
10
10
  import { PrimeNG } from 'primeng/config';
@@ -22,6 +22,8 @@ interface TopBarDto {
22
22
 
23
23
  declare class TopBarService {
24
24
  topBarItems: TopBarDto[];
25
+ private readonly activeIdSubject;
26
+ readonly activeId$: rxjs.Observable<string>;
25
27
  private _activeId;
26
28
  get availableTopBarItems(): TopBarDto[];
27
29
  get activeTopBarItem(): TopBarDto | undefined;
@@ -45,8 +47,10 @@ declare class MsgService {
45
47
  error(detail: any, summary?: any, life?: number): void;
46
48
  extractErrorMessage(error: unknown, fallback: string): string;
47
49
  private extractValidationMessage;
50
+ private extractApiExceptionMessage;
48
51
  private toValidationMessages;
49
52
  private getObjectProperty;
53
+ private getStringProperty;
50
54
  errorFromException(error: unknown, fallback: string, summary?: string, life?: number): void;
51
55
  contrast(detail: any, summary?: any, life?: number): void;
52
56
  secondary(detail: any, summary?: any, life?: number): void;
@@ -81,6 +85,7 @@ interface AppConfig {
81
85
  timeFormat: string;
82
86
  dateTimeFormat: string;
83
87
  timeZone: string;
88
+ adminMode?: boolean;
84
89
  }
85
90
  interface LayoutState {
86
91
  staticMenuDesktopInactive?: boolean;
@@ -119,6 +124,7 @@ declare class LayoutService {
119
124
  dateTimeFormat: i0.Signal<string>;
120
125
  monthFormat: i0.Signal<string>;
121
126
  timeZone: i0.Signal<string>;
127
+ adminMode: i0.Signal<boolean>;
122
128
  transitionComplete: i0.WritableSignal<boolean>;
123
129
  private initialized;
124
130
  constructor();
@@ -141,6 +147,10 @@ declare class LayoutService {
141
147
  static ɵprov: i0.ɵɵInjectableDeclaration<LayoutService>;
142
148
  }
143
149
 
150
+ /**
151
+ * Translations of a single namespace grouped by language code, e.g. { en: {...}, ru: {...} }
152
+ */
153
+ type TranslationsByLang = Record<string, TranslationObject>;
144
154
  interface LanguageDto {
145
155
  code: string;
146
156
  name: string;
@@ -157,11 +167,30 @@ declare class L10nService {
157
167
  private readonly primeNg;
158
168
  private readonly layoutService;
159
169
  availableLanguages: LanguageDto[];
170
+ /**
171
+ * Translations bundled with components, registered at module load time.
172
+ */
173
+ private static readonly staticTranslations;
174
+ /**
175
+ * Registers translations bundled with a component instead of loading them over HTTP.
176
+ * Namespaces are taken from the root keys of the passed dictionaries.
177
+ * Components derived from <c>BaseModuleComponent</c> don't call it directly - it is enough
178
+ * to declare the static <c>translations</c> field.
179
+ * @param byLang - Translations grouped by language code
180
+ * @param namespace - Explicit namespace, needed when the dictionaries are still empty
181
+ */
182
+ static registerTranslations(byLang: TranslationsByLang | undefined, namespace?: string): void;
183
+ constructor();
160
184
  /**
161
185
  * Loads translations for a specific component
162
186
  * @param component - Name of the component to load translations for
163
187
  */
164
188
  loadComponentTranslations(component: string): Observable<unknown>;
189
+ /**
190
+ * Loads translations from an explicit asset URL and merges them into the active language dictionary.
191
+ * Use this for extension modules whose assets are hosted outside the shell application.
192
+ */
193
+ loadTranslationsFromUrl(namespace: string, url: string, lang?: string): Observable<unknown>;
165
194
  /**
166
195
  * Gets the translated value of a key (or an array of keys)
167
196
  * @returns the translated key, or an object of translated keys
@@ -173,6 +202,12 @@ declare class L10nService {
173
202
  * @param lang - Language code to load translations for
174
203
  */
175
204
  private loadTranslations;
205
+ /**
206
+ * Merges a translation dictionary into the dictionary of the given language
207
+ * @param lang - Language code
208
+ * @param translations - Translations to merge
209
+ */
210
+ private mergeTranslation;
176
211
  /**
177
212
  * Changes the lang currently used
178
213
  */
@@ -212,10 +247,11 @@ declare abstract class SecurityService {
212
247
  abstract forceRefreshSession(customParams?: RefreshCustomParams, configId?: string): Observable<AuthSessionRefreshResult>;
213
248
  abstract getCsrfToken(): Observable<AuthCsrfToken | null>;
214
249
  abstract isAdmin(): boolean;
215
- abstract authorize(): void;
250
+ abstract authorize(returnUrl?: string): void;
216
251
  abstract payload: BehaviorSubject<any>;
217
252
  }
218
253
  declare class BffSecurityService implements OnDestroy, SecurityService {
254
+ static readonly authorizeAfterLogoutReturnUrlKey = "oip.authorizeAfterLogoutReturnUrl";
219
255
  private readonly http;
220
256
  private readonly authenticated;
221
257
  private readonly currentUser;
@@ -231,14 +267,18 @@ declare class BffSecurityService implements OnDestroy, SecurityService {
231
267
  forceRefreshSession(): Observable<AuthSessionRefreshResult>;
232
268
  getCsrfToken(): Observable<AuthCsrfToken | null>;
233
269
  isAdmin(): boolean;
234
- authorize(): void;
270
+ authorize(returnUrl?: string): void;
235
271
  ngOnDestroy(): void;
236
272
  private applySession;
237
273
  private createCurrentUser;
238
274
  private splitDisplayName;
239
275
  private applyAnonymousSession;
240
276
  private createPostForm;
277
+ private normalizeReturnUrl;
278
+ private replaceWithUnauthorizedUrl;
279
+ private storeAuthorizeAfterLogoutReturnUrl;
241
280
  private buildUrl;
281
+ private getBaseUrl;
242
282
  static ɵfac: i0.ɵɵFactoryDeclaration<BffSecurityService, never>;
243
283
  static ɵprov: i0.ɵɵInjectableDeclaration<BffSecurityService>;
244
284
  }
@@ -275,8 +315,14 @@ declare enum ContentType {
275
315
  declare class HttpClient<SecurityDataType = unknown> {
276
316
  protected securityService: SecurityService;
277
317
  protected layoutService: LayoutService;
318
+ protected router: Router;
278
319
  baseUrl: string;
279
320
  private securityWorker?;
321
+ /**
322
+ * Reads the module instance id of the deepest activated route.
323
+ * The backend uses it to check module instance rights on endpoints that do not carry the id in their contract.
324
+ */
325
+ protected getCurrentModuleInstanceId(): number | undefined;
280
326
  private abortControllers;
281
327
  private customFetch;
282
328
  private baseApiParams;
@@ -291,6 +337,7 @@ declare class HttpClient<SecurityDataType = unknown> {
291
337
  protected createAbortSignal: (cancelToken: CancelToken) => AbortSignal | undefined;
292
338
  abortRequest: (cancelToken: CancelToken) => void;
293
339
  request: <T = any, E = any>({ body, secure, path, type, query, format, baseUrl, cancelToken, ...params }: FullRequestParams) => Promise<T>;
340
+ private authorizeOnUnauthorized;
294
341
  private getCsrfRequestParams;
295
342
  static ɵfac: i0.ɵɵFactoryDeclaration<HttpClient<any>, never>;
296
343
  static ɵprov: i0.ɵɵInjectableDeclaration<HttpClient<any>>;
@@ -375,6 +422,16 @@ declare abstract class BaseModuleComponent<TBackendStoreSettings, TLocalStoreSet
375
422
  * @type {string}
376
423
  */
377
424
  title: string;
425
+ /**
426
+ * Translations bundled with the component, grouped by language code.
427
+ * Declare it in a derived component to load translations from the component folder
428
+ * instead of `assets/i18n`:
429
+ *
430
+ * ```ts
431
+ * static override readonly translations = { en, ru };
432
+ * ```
433
+ */
434
+ static readonly translations: TranslationsByLang | undefined;
378
435
  l10nService: L10nService;
379
436
  l10n$: Observable<Translation | TranslationObject>;
380
437
  canRead: boolean;
@@ -465,13 +522,13 @@ declare abstract class BaseModuleComponent<TBackendStoreSettings, TLocalStoreSet
465
522
  /**
466
523
  * Starts watching current token roles and maps them to module instance security settings.
467
524
  */
468
- protected watchSecurityRights(controller?: string, id?: number | undefined): void;
525
+ protected watchSecurityRights(controller?: string, id?: number | undefined): Promise<void>;
469
526
  private resetRightsState;
470
527
  private updateRightsState;
471
528
  protected hasSecurityRight(roles: string[], securitySettings: SecurityDto[], code: string): boolean;
472
529
  protected getSecurity(controller?: string, id?: number | undefined): Promise<SecurityDto[]>;
473
530
  protected saveSecurity(request: PutSecurityDto, controller?: string): Promise<unknown>;
474
- protected getModuleInstanceSettings<TSettings>(controller?: string, id?: number | undefined): Promise<TSettings>;
531
+ protected getModuleInstanceSettings<TSettings>(controller?: string): Promise<TSettings>;
475
532
  protected saveModuleInstanceSettings<TSettings>(request: {
476
533
  id: number;
477
534
  settings: TSettings;
@@ -512,7 +569,9 @@ declare class SecurityComponent implements OnChanges, OnInit, OnDestroy {
512
569
  declare class UserService {
513
570
  private readonly securityService;
514
571
  private readonly userProfileApi;
515
- private requestedPhotoEmail;
572
+ private readonly msgService;
573
+ private readonly translateService;
574
+ private requestedPhotoKey;
516
575
  constructor();
517
576
  /**
518
577
  * Stores the user's photo as a data URL or binary blob, depending on how it's processed.
@@ -529,10 +588,11 @@ declare class UserService {
529
588
  get shortLabel(): string;
530
589
  get userName(): string;
531
590
  /**
532
- * Initiates an HTTP request to fetch the user's photo based on their email,
591
+ * Initiates an HTTP request to fetch the current user's photo,
533
592
  * and updates the `photo` and `photoLoaded` properties accordingly.
534
593
  */
535
594
  getUserPhoto(): void;
595
+ refreshUserPhoto(): void;
536
596
  /**
537
597
  * Converts a Blob image into a Base64 data URL and stores it in the `photo` property.
538
598
  *
@@ -540,6 +600,7 @@ declare class UserService {
540
600
  */
541
601
  private createImageFromBlob;
542
602
  private getInitials;
603
+ private getCurrentUserPhotoKey;
543
604
  static ɵfac: i0.ɵɵFactoryDeclaration<UserService, never>;
544
605
  static ɵprov: i0.ɵɵInjectableDeclaration<UserService>;
545
606
  }
@@ -561,6 +622,7 @@ declare class AppTopbar {
561
622
  logoService: LogoService;
562
623
  private readonly confirmationService;
563
624
  private readonly translateService;
625
+ onActiveTabChange(value: string | number | undefined): void;
564
626
  toggleDarkMode(): void;
565
627
  logoutKeyDown($event: KeyboardEvent): void;
566
628
  confirmLogout(): void;
@@ -600,6 +662,11 @@ interface EditModuleInstanceDto {
600
662
  viewRoles?: string[] | null;
601
663
  moduleId?: number | null;
602
664
  }
665
+ interface ExistModuleDto {
666
+ moduleId?: number;
667
+ name?: string | null;
668
+ currentlyLoaded?: boolean;
669
+ }
603
670
  interface FolderModuleSettings {
604
671
  html?: string | null;
605
672
  }
@@ -610,12 +677,6 @@ interface IntKeyValueDto {
610
677
  key?: number;
611
678
  value?: string | null;
612
679
  }
613
- interface ModuleDto {
614
- moduleId?: number;
615
- name?: string | null;
616
- settings?: string | null;
617
- moduleSecurities?: ModuleSecurityDto[] | null;
618
- }
619
680
  interface ModuleInstanceDto {
620
681
  moduleInstanceId?: number;
621
682
  moduleId?: number;
@@ -631,14 +692,7 @@ interface ModuleInstanceDto {
631
692
  order?: number;
632
693
  separator?: boolean;
633
694
  }
634
- interface ModuleSecurityDto {
635
- right: string | null;
636
- role: string | null;
637
- }
638
- interface GetModuleInstanceSettingsParams {
639
- id?: number;
640
- }
641
- interface GetModuleInstanceSettingsParams2 {
695
+ interface GetModuleInstanceRightsParams {
642
696
  id?: number;
643
697
  }
644
698
  interface DeleteModuleInstanceParams {
@@ -706,11 +760,13 @@ declare class MenuService {
706
760
  private readonly resetSource;
707
761
  private readonly titleService;
708
762
  private readonly menuDataService;
763
+ private readonly layoutService;
709
764
  menuSource$: rxjs.Observable<MenuChangeEvent>;
710
765
  resetSource$: rxjs.Observable<unknown>;
711
766
  contextMenuItem: any;
712
767
  menu: ModuleInstanceDto[];
713
- adminMode: boolean;
768
+ get adminMode(): boolean;
769
+ set adminMode(value: boolean);
714
770
  loadMenu(): Promise<void>;
715
771
  /**
716
772
  * Handles changes in the menu state.
@@ -731,6 +787,7 @@ declare class MenuService {
731
787
 
732
788
  declare class MenuApi<SecurityDataType = unknown> extends HttpClient<SecurityDataType> {
733
789
  get: (params?: RequestParams) => Promise<ModuleInstanceDto[]>;
790
+ getModuleInstanceRights: (query: GetModuleInstanceRightsParams, params?: RequestParams) => Promise<string[]>;
734
791
  getAdminMenu: (params?: RequestParams) => Promise<ModuleInstanceDto[]>;
735
792
  getModules: (params?: RequestParams) => Promise<IntKeyValueDto[]>;
736
793
  addModuleInstance: (data: AddModuleInstanceDto, params?: RequestParams) => Promise<void>;
@@ -777,7 +834,6 @@ declare class MenuItemEditDialogComponent {
777
834
  private readonly msgService;
778
835
  visible: boolean;
779
836
  visibleChange: EventEmitter<boolean>;
780
- modules: any[];
781
837
  roles: string[];
782
838
  iconOptions: PrimeIconOption[];
783
839
  item: EditModuleInstanceDto;
@@ -848,25 +904,59 @@ declare class NotfoundComponent {
848
904
  static ɵcmp: i0.ɵɵComponentDeclaration<NotfoundComponent, "app-notfound", never, {}, {}, never, never, true, never>;
849
905
  }
850
906
 
851
- declare class UnauthorizedComponent {
907
+ declare class UnauthorizedComponent implements OnInit {
852
908
  protected readonly securityService: SecurityService;
853
909
  private readonly route;
854
- private readonly router;
910
+ ngOnInit(): void;
855
911
  protected signIn(): void;
856
912
  static ɵfac: i0.ɵɵFactoryDeclaration<UnauthorizedComponent, never>;
857
913
  static ɵcmp: i0.ɵɵComponentDeclaration<UnauthorizedComponent, "ng-component", never, {}, {}, never, never, true, never>;
858
914
  }
859
915
 
916
+ declare class AccessComponent {
917
+ static ɵfac: i0.ɵɵFactoryDeclaration<AccessComponent, never>;
918
+ static ɵcmp: i0.ɵɵComponentDeclaration<AccessComponent, "app-access", never, {}, {}, never, never, true, never>;
919
+ }
920
+
860
921
  declare class ErrorComponent {
861
922
  static ɵfac: i0.ɵɵFactoryDeclaration<ErrorComponent, never>;
862
923
  static ɵcmp: i0.ɵɵComponentDeclaration<ErrorComponent, "app-error", never, {}, {}, never, never, true, never>;
863
924
  }
864
925
 
926
+ interface UserSettingsDto {
927
+ preset?: string | null;
928
+ primary?: string | null;
929
+ surface?: string | null;
930
+ darkTheme?: boolean;
931
+ menuMode?: string | null;
932
+ language?: string | null;
933
+ dateFormat?: string | null;
934
+ timeFormat?: string | null;
935
+ timeZone?: string | null;
936
+ }
937
+ interface GetUserPhotoByIdParams {
938
+ userId: number;
939
+ }
940
+ interface PostUserPhotoPayload {
941
+ files?: Blob;
942
+ }
943
+
944
+ declare class UserProfileApi<SecurityDataType = unknown> extends HttpClient<SecurityDataType> {
945
+ getUserPhoto: (params?: RequestParams) => Promise<Blob>;
946
+ getUserPhotoById: ({ userId, ...query }: GetUserPhotoByIdParams, params?: RequestParams) => Promise<Blob>;
947
+ postUserPhoto: (data: PostUserPhotoPayload, params?: RequestParams) => Promise<void>;
948
+ getSettings: (params?: RequestParams) => Promise<UserSettingsDto>;
949
+ setSettings: (data: UserSettingsDto, params?: RequestParams) => Promise<void>;
950
+ static ɵfac: i0.ɵɵFactoryDeclaration<UserProfileApi<any>, never>;
951
+ static ɵprov: i0.ɵɵInjectableDeclaration<UserProfileApi<any>>;
952
+ }
953
+
865
954
  declare class ProfileComponent {
866
955
  readonly userService: UserService;
867
956
  readonly msgService: MsgService;
868
957
  readonly translateService: TranslateService;
869
- onBasicUploadAuto($event: any): void;
958
+ readonly userProfileApi: UserProfileApi<any>;
959
+ uploadPhoto(event: any): Promise<void>;
870
960
  static ɵfac: i0.ɵɵFactoryDeclaration<ProfileComponent, never>;
871
961
  static ɵcmp: i0.ɵɵComponentDeclaration<ProfileComponent, "user-profile", never, {}, {}, never, never, true, never>;
872
962
  }
@@ -907,8 +997,47 @@ interface MigrationDto {
907
997
  exist: boolean;
908
998
  }
909
999
  declare class DbMigrationComponent extends BaseModuleComponent<NoSettingsDto, NoSettingsDto> implements OnInit, OnDestroy {
1000
+ static readonly translations: {
1001
+ en: {
1002
+ "db-migration": {
1003
+ migrationManager: string;
1004
+ actions: {
1005
+ refresh: string;
1006
+ cleanFilter: string;
1007
+ applyMigration: string;
1008
+ };
1009
+ columns: {
1010
+ name: string;
1011
+ applied: string;
1012
+ exist: string;
1013
+ pending: string;
1014
+ };
1015
+ messages: {
1016
+ errorRefreshing: string;
1017
+ };
1018
+ };
1019
+ };
1020
+ ru: {
1021
+ "db-migration": {
1022
+ migrationManager: string;
1023
+ actions: {
1024
+ refresh: string;
1025
+ cleanFilter: string;
1026
+ applyMigration: string;
1027
+ };
1028
+ columns: {
1029
+ name: string;
1030
+ applied: string;
1031
+ exist: string;
1032
+ pending: string;
1033
+ };
1034
+ messages: {
1035
+ errorRefreshing: string;
1036
+ };
1037
+ };
1038
+ };
1039
+ };
910
1040
  data: MigrationDto[];
911
- constructor();
912
1041
  ngOnInit(): Promise<void>;
913
1042
  refreshAction(): Promise<void>;
914
1043
  getData(): Promise<MigrationDto[]>;
@@ -918,17 +1047,22 @@ declare class DbMigrationComponent extends BaseModuleComponent<NoSettingsDto, No
918
1047
  }
919
1048
 
920
1049
  declare class AppModulesComponent implements OnInit {
921
- protected modules: ModuleDto[];
1050
+ protected modules: ExistModuleDto[];
922
1051
  protected msgService: MsgService;
923
1052
  protected confirmationService: ConfirmationService;
924
1053
  protected l10nService: L10nService;
925
1054
  protected titleService: AppTitleService;
1055
+ protected externalModuleManifestUrl: string;
1056
+ protected registeringExternalModule: boolean;
926
1057
  private moduleService;
1058
+ private extensionModulesService;
927
1059
  private translationsReady;
928
1060
  constructor();
929
1061
  ngOnInit(): Promise<void>;
930
1062
  refreshAction(): Promise<void>;
931
- deleteModule(module: ModuleDto): Promise<void>;
1063
+ protected get canRegisterExternalModule(): boolean;
1064
+ registerExternalModule(): Promise<void>;
1065
+ deleteModule(module: ExistModuleDto): Promise<void>;
932
1066
  t(key: string): any;
933
1067
  static ɵfac: i0.ɵɵFactoryDeclaration<AppModulesComponent, never>;
934
1068
  static ɵcmp: i0.ɵɵComponentDeclaration<AppModulesComponent, "app-modules", never, {}, {}, never, never, true, never>;
@@ -1240,6 +1374,28 @@ declare class DiscussionComponent implements OnChanges, OnDestroy, OnInit {
1240
1374
  }
1241
1375
 
1242
1376
  declare class IframeModuleComponent extends BaseModuleComponent<IframeModuleSettings, IframeModuleSettings> implements OnInit, OnDestroy {
1377
+ static readonly translations: {
1378
+ en: {
1379
+ "iframe-module": {
1380
+ iframeModule: {
1381
+ urlPlaceholder: string;
1382
+ settingSaveButtonLabel: string;
1383
+ emptyUrlMessage: string;
1384
+ siteLoadingMessage: string;
1385
+ };
1386
+ };
1387
+ };
1388
+ ru: {
1389
+ "iframe-module": {
1390
+ iframeModule: {
1391
+ urlPlaceholder: string;
1392
+ settingSaveButtonLabel: string;
1393
+ emptyUrlMessage: string;
1394
+ siteLoadingMessage: string;
1395
+ };
1396
+ };
1397
+ };
1398
+ };
1243
1399
  private iframe?;
1244
1400
  private readonly renderer;
1245
1401
  private readonly translate;
@@ -1255,6 +1411,39 @@ declare class IframeModuleComponent extends BaseModuleComponent<IframeModuleSett
1255
1411
  static ɵcmp: i0.ɵɵComponentDeclaration<IframeModuleComponent, "ng-component", never, {}, {}, never, never, true, never>;
1256
1412
  }
1257
1413
 
1414
+ declare class ExtensionModuleHostComponent extends BaseModuleComponent<unknown, unknown> implements OnDestroy {
1415
+ private set extensionViewContainer(value);
1416
+ private readonly injector;
1417
+ private readonly environmentInjector;
1418
+ private readonly extensionModulesApi;
1419
+ private viewContainer?;
1420
+ private extensionComponent?;
1421
+ private extensionElement?;
1422
+ private extensionMetadata?;
1423
+ private renderQueued;
1424
+ private destroyed;
1425
+ protected loadError: string | null;
1426
+ private get extensionKey();
1427
+ constructor();
1428
+ reloadExtension(): Promise<void>;
1429
+ protected onModuleInstanceChange(): Promise<void>;
1430
+ protected onSecurityRightsChange(): void;
1431
+ ngOnDestroy(): void;
1432
+ private loadExtensionMetadata;
1433
+ private renderExtension;
1434
+ private queueRenderExtension;
1435
+ private destroyExtensionComponent;
1436
+ private renderFederatedExtension;
1437
+ private loadExtensionTranslations;
1438
+ private buildExtensionI18nUrl;
1439
+ private getExtensionTranslationNamespaces;
1440
+ private toKebabCase;
1441
+ private updateExtensionContext;
1442
+ private buildUrl;
1443
+ static ɵfac: i0.ɵɵFactoryDeclaration<ExtensionModuleHostComponent, never>;
1444
+ static ɵcmp: i0.ɵɵComponentDeclaration<ExtensionModuleHostComponent, "ng-component", never, {}, {}, never, never, true, never>;
1445
+ }
1446
+
1258
1447
  declare enum ImportanceLevel {
1259
1448
  Unspecified = "Unspecified",
1260
1449
  Low = "Low",
@@ -1345,21 +1534,65 @@ declare class AppTopbarApplicationSwitcherComponent implements OnInit {
1345
1534
  */
1346
1535
  declare class AuthGuardService {
1347
1536
  private readonly oidcSecurityService;
1348
- private readonly router;
1349
1537
  /**
1350
1538
  * Checks whether the route can be activated.
1351
1539
  * - Returns `true` if the user is authenticated and the token is valid.
1352
1540
  * - Attempts to refresh the token if expired.
1353
- * - Redirects to `/unauthorized` if not authenticated or refresh fails.
1541
+ * - Starts the authorization flow if not authenticated or refresh fails.
1354
1542
  *
1355
- * @returns {Observable<boolean | UrlTree>} A stream resolving to true (allow), or UrlTree (redirect).
1543
+ * @returns {Observable<boolean>} A stream resolving to true (allow), or false after starting authorization.
1356
1544
  */
1357
- canActivate(returnUrl?: string): Observable<boolean | UrlTree>;
1358
- private getReturnUrl;
1545
+ canActivate(returnUrl?: string): Observable<boolean>;
1359
1546
  static ɵfac: i0.ɵɵFactoryDeclaration<AuthGuardService, never>;
1360
1547
  static ɵprov: i0.ɵɵInjectableDeclaration<AuthGuardService>;
1361
1548
  }
1362
1549
 
1550
+ /**
1551
+ * Route data flag marking a route that only administrators may open.
1552
+ */
1553
+ interface ModuleAccessRouteData {
1554
+ requireAdmin?: boolean;
1555
+ }
1556
+ /**
1557
+ * Guards module routes against direct navigation without the required rights.
1558
+ *
1559
+ * - Routes flagged with `data: { requireAdmin: true }` require the `admin` role.
1560
+ * - Routes carrying an `:id` segment require the `read` right on that module instance.
1561
+ * - Everything else is left to {@link AuthGuardService}.
1562
+ *
1563
+ * Denied navigation is redirected to the access denied page. This is a UX guard only:
1564
+ * the backend checks the same rights on every module endpoint.
1565
+ */
1566
+ declare const moduleAccessGuard: CanActivateChildFn;
1567
+
1568
+ /**
1569
+ * Reads the rights the current user has on a module instance.
1570
+ *
1571
+ * Results are cached per instance and dropped whenever the authenticated user changes.
1572
+ */
1573
+ declare class ModuleInstanceRightsService {
1574
+ static readonly readRight = "read";
1575
+ private readonly menuApi;
1576
+ private readonly securityService;
1577
+ private readonly cache;
1578
+ private cachedIdentity;
1579
+ constructor();
1580
+ /**
1581
+ * Gets the rights of the current user on the given module instance.
1582
+ */
1583
+ getRights(moduleInstanceId: number): Promise<string[]>;
1584
+ /**
1585
+ * Checks whether the current user has the `read` right on the given module instance.
1586
+ */
1587
+ canRead(moduleInstanceId: number): Promise<boolean>;
1588
+ /**
1589
+ * Drops every cached result, for example after module security was changed.
1590
+ */
1591
+ clearCache(): void;
1592
+ static ɵfac: i0.ɵɵFactoryDeclaration<ModuleInstanceRightsService, never>;
1593
+ static ɵprov: i0.ɵɵInjectableDeclaration<ModuleInstanceRightsService>;
1594
+ }
1595
+
1363
1596
  declare class NotificationService {
1364
1597
  private connection;
1365
1598
  private securityService;
@@ -1402,6 +1635,13 @@ declare class TableFilterService {
1402
1635
  static ɵprov: i0.ɵɵInjectableDeclaration<TableFilterService>;
1403
1636
  }
1404
1637
 
1638
+ declare class ExtensionLoaderService {
1639
+ private readonly loadedScripts;
1640
+ loadScript(scriptUrl: string): Promise<void>;
1641
+ static ɵfac: i0.ɵɵFactoryDeclaration<ExtensionLoaderService, never>;
1642
+ static ɵprov: i0.ɵɵInjectableDeclaration<ExtensionLoaderService>;
1643
+ }
1644
+
1405
1645
  interface AppThemePreset {
1406
1646
  id: string;
1407
1647
  label?: string;
@@ -1420,18 +1660,93 @@ declare function provideAppThemes(themes: AppThemePreset[], options?: ProvideApp
1420
1660
  declare function mergeWithDefaults(themes: AppThemePreset[]): EnvironmentProviders;
1421
1661
  declare function replaceDefaults(themes: AppThemePreset[]): EnvironmentProviders;
1422
1662
 
1663
+ declare const defaultTheme: AppThemePreset[];
1664
+
1423
1665
  declare function provideOip(): i0.EnvironmentProviders;
1424
1666
 
1425
1667
  declare const langIntercept: HttpInterceptorFn;
1426
1668
 
1669
+ interface OipExtensionManifest {
1670
+ key: string;
1671
+ name: string;
1672
+ version: string;
1673
+ loadType?: OipExtensionLoadType;
1674
+ elementName?: string | null;
1675
+ scriptUrl?: string | null;
1676
+ remoteEntryUrl?: string | null;
1677
+ exposedModule?: string | null;
1678
+ componentName?: string | null;
1679
+ apiBaseUrl: string;
1680
+ icon?: string | null;
1681
+ description?: string | null;
1682
+ permissions?: unknown;
1683
+ settingsSchema?: unknown;
1684
+ }
1685
+ type OipExtensionLoadType = 'moduleFederation' | 'customElement';
1686
+ interface OipExtensionModuleMetadata {
1687
+ moduleId: number;
1688
+ name: string;
1689
+ settings?: string | null;
1690
+ kind: number;
1691
+ manifestUrl?: string | null;
1692
+ extensionKey?: string | null;
1693
+ loadType?: OipExtensionLoadType | null;
1694
+ elementName?: string | null;
1695
+ scriptUrl?: string | null;
1696
+ remoteEntryUrl?: string | null;
1697
+ exposedModule?: string | null;
1698
+ componentName?: string | null;
1699
+ apiBaseUrl?: string | null;
1700
+ version?: string | null;
1701
+ }
1702
+ interface OipExtensionHostContext {
1703
+ moduleInstanceId: number | undefined;
1704
+ extensionKey: string;
1705
+ apiBasePath: string;
1706
+ settings: unknown;
1707
+ locale?: string;
1708
+ theme?: unknown;
1709
+ user?: unknown;
1710
+ activeTabId?: string;
1711
+ permissions: {
1712
+ canRead: boolean;
1713
+ canEdit: boolean;
1714
+ canDelete: boolean;
1715
+ };
1716
+ }
1717
+ interface OipExtensionNotifyEvent {
1718
+ severity?: 'success' | 'info' | 'warn' | 'error';
1719
+ summary?: string;
1720
+ detail?: string;
1721
+ }
1722
+ interface OipExtensionNavigateEvent {
1723
+ commands?: unknown[];
1724
+ url?: string;
1725
+ }
1726
+
1727
+ declare const OIP_EXTENSION_EVENTS: {
1728
+ readonly contextChange: "oip:context-change";
1729
+ readonly titleChange: "oip:title-change";
1730
+ readonly settingsChange: "oip:settings-change";
1731
+ readonly notify: "oip:notify";
1732
+ readonly navigate: "oip:navigate";
1733
+ readonly error: "oip:error";
1734
+ };
1735
+ declare function emitOipTitleChange(element: HTMLElement, title: string): void;
1736
+ declare function emitOipSettingsChange(element: HTMLElement, settings: unknown): void;
1737
+ declare function emitOipNotify(element: HTMLElement, notification: OipExtensionNotifyEvent): void;
1738
+ declare function emitOipNavigate(element: HTMLElement, navigation: OipExtensionNavigateEvent): void;
1739
+ declare function emitOipError(element: HTMLElement, error: unknown): void;
1740
+ declare function emitOipContextChange(element: HTMLElement, context: OipExtensionHostContext): void;
1741
+
1427
1742
  declare class FolderModuleApi<SecurityDataType = unknown> extends HttpClient<SecurityDataType> {
1428
- getModuleInstanceSettings: (query: GetModuleInstanceSettingsParams, params?: RequestParams) => Promise<FolderModuleSettings>;
1743
+ getModuleInstanceSettings: (params?: RequestParams) => Promise<FolderModuleSettings>;
1429
1744
  static ɵfac: i0.ɵɵFactoryDeclaration<FolderModuleApi<any>, never>;
1430
1745
  static ɵprov: i0.ɵɵInjectableDeclaration<FolderModuleApi<any>>;
1431
1746
  }
1432
1747
 
1433
1748
  declare class IframeModuleApi<SecurityDataType = unknown> extends HttpClient<SecurityDataType> {
1434
- getModuleInstanceSettings: (query: GetModuleInstanceSettingsParams2, params?: RequestParams) => Promise<IframeModuleSettings>;
1749
+ getModuleInstanceSettings: (params?: RequestParams) => Promise<IframeModuleSettings>;
1435
1750
  static ɵfac: i0.ɵɵFactoryDeclaration<IframeModuleApi<any>, never>;
1436
1751
  static ɵprov: i0.ɵɵInjectableDeclaration<IframeModuleApi<any>>;
1437
1752
  }
@@ -1456,33 +1771,6 @@ declare class ApplicationsApi<SecurityDataType = unknown> extends HttpClient<Sec
1456
1771
  static ɵprov: i0.ɵɵInjectableDeclaration<ApplicationsApi<any>>;
1457
1772
  }
1458
1773
 
1459
- interface UserSettingsDto {
1460
- preset?: string | null;
1461
- primary?: string | null;
1462
- surface?: string | null;
1463
- darkTheme?: boolean;
1464
- menuMode?: string | null;
1465
- language?: string | null;
1466
- dateFormat?: string | null;
1467
- timeFormat?: string | null;
1468
- timeZone?: string | null;
1469
- }
1470
- interface GetUserPhotoParams {
1471
- email?: string;
1472
- }
1473
- interface PostUserPhotoPayload {
1474
- files?: File;
1475
- }
1476
-
1477
- declare class UserProfileApi<SecurityDataType = unknown> extends HttpClient<SecurityDataType> {
1478
- getUserPhoto: (query: GetUserPhotoParams, params?: RequestParams) => Promise<File>;
1479
- postUserPhoto: (data: PostUserPhotoPayload, params?: RequestParams) => Promise<void>;
1480
- getSettings: (params?: RequestParams) => Promise<UserSettingsDto>;
1481
- setSettings: (data: UserSettingsDto, params?: RequestParams) => Promise<void>;
1482
- static ɵfac: i0.ɵɵFactoryDeclaration<UserProfileApi<any>, never>;
1483
- static ɵprov: i0.ɵɵInjectableDeclaration<UserProfileApi<any>>;
1484
- }
1485
-
1486
1774
  declare function convertToPrimeNgDateFormat(dateformat: string): string;
1487
1775
 
1488
1776
  declare class NotificationApi<SecurityDataType = unknown> extends HttpClient<SecurityDataType> {
@@ -1494,5 +1782,47 @@ declare class NotificationApi<SecurityDataType = unknown> extends HttpClient<Sec
1494
1782
  static ɵprov: i0.ɵɵInjectableDeclaration<NotificationApi<any>>;
1495
1783
  }
1496
1784
 
1497
- export { APP_THEME_PRESETS, APP_THEME_PRESETS_MERGE_MODE, AppConfiguratorComponent, AppFloatingConfiguratorComponent, AppLayoutComponent, AppModulesComponent, AppTopbar, AppTopbarApplicationSwitcherComponent, ApplicationRegistryService, ApplicationsApi, ApplicationsComponent, AuthGuardService, BaseModuleComponent, BffSecurityService, ConfigComponent, ContentType, DbMigrationComponent, DiscussionComponent, ErrorComponent, FolderModuleApi, FooterComponent, HttpClient, IframeModuleApi, IframeModuleComponent, L10nService, LOGO_COMPONENT_TOKEN, LayoutService, LogoComponent, LogoService, MenuComponent, MenuService, MsgService, NotfoundComponent, NotificationApi, NotificationService, ProfileComponent, SecurityApi, SecurityComponent, SecurityService, SidebarComponent, TableFilterService, TopBarService, UnauthorizedComponent, UserNotificationsComponent, UserProfileApi, UserService, convertToPrimeNgDateFormat, langIntercept, mergeWithDefaults, provideAppThemes, provideLogoComponent, provideOip, replaceDefaults };
1498
- export type { AppConfig, AppThemePreset, AppThemePresetMergeMode, AuthCsrfToken, LanguageDto, MenuChangeEvent, NoSettingsDto, PutSecurityDto, RequestParams, SecurityDto, TopBarDto };
1785
+ declare class CustomElementExtensionModuleHostComponent extends BaseModuleComponent<unknown, unknown> implements OnDestroy {
1786
+ private set extensionContainer(value);
1787
+ private readonly extensionLoader;
1788
+ private readonly router;
1789
+ private readonly hostChangeDetectorRef;
1790
+ private readonly extensionModulesApi;
1791
+ private container?;
1792
+ private extensionElement?;
1793
+ private extensionMetadata?;
1794
+ private removeListeners;
1795
+ private renderQueued;
1796
+ private activeTabSyncQueued;
1797
+ private activeTabId;
1798
+ private destroyed;
1799
+ protected loadError: string | null;
1800
+ protected get showContent(): boolean;
1801
+ protected get showSettings(): boolean;
1802
+ protected get showSecurity(): boolean;
1803
+ private get extensionKey();
1804
+ constructor();
1805
+ protected onModuleInstanceChange(): Promise<void>;
1806
+ protected onSecurityRightsChange(): void;
1807
+ ngOnDestroy(): void;
1808
+ reloadExtension(): Promise<void>;
1809
+ private loadExtensionMetadata;
1810
+ private renderExtension;
1811
+ private queueRenderExtension;
1812
+ private isActiveTab;
1813
+ private queueActiveTabSync;
1814
+ private getCurrentActiveTabId;
1815
+ private updateExtensionContext;
1816
+ private attachListeners;
1817
+ private buildUrl;
1818
+ private loadExtensionTranslations;
1819
+ private buildExtensionI18nUrl;
1820
+ private addListener;
1821
+ private destroyExtensionElement;
1822
+ private renderCustomElementExtension;
1823
+ static ɵfac: i0.ɵɵFactoryDeclaration<CustomElementExtensionModuleHostComponent, never>;
1824
+ static ɵcmp: i0.ɵɵComponentDeclaration<CustomElementExtensionModuleHostComponent, "ng-component", never, {}, {}, never, never, true, never>;
1825
+ }
1826
+
1827
+ export { APP_THEME_PRESETS, APP_THEME_PRESETS_MERGE_MODE, AccessComponent, AppConfiguratorComponent, AppFloatingConfiguratorComponent, AppLayoutComponent, AppModulesComponent, AppTopbar, AppTopbarApplicationSwitcherComponent, ApplicationRegistryService, ApplicationsApi, ApplicationsComponent, AuthGuardService, BaseModuleComponent, BffSecurityService, ConfigComponent, ContentType, CustomElementExtensionModuleHostComponent, DbMigrationComponent, DiscussionComponent, ErrorComponent, ExtensionLoaderService, ExtensionModuleHostComponent, FolderModuleApi, FooterComponent, HttpClient, IframeModuleApi, IframeModuleComponent, L10nService, LOGO_COMPONENT_TOKEN, LayoutService, LogoComponent, LogoService, MenuComponent, MenuService, ModuleInstanceRightsService, MsgService, NotfoundComponent, NotificationApi, NotificationService, OIP_EXTENSION_EVENTS, ProfileComponent, SecurityApi, SecurityComponent, SecurityService, SidebarComponent, TableFilterService, TopBarService, UnauthorizedComponent, UserNotificationsComponent, UserProfileApi, UserService, convertToPrimeNgDateFormat, defaultTheme, emitOipContextChange, emitOipError, emitOipNavigate, emitOipNotify, emitOipSettingsChange, emitOipTitleChange, langIntercept, mergeWithDefaults, moduleAccessGuard, provideAppThemes, provideLogoComponent, provideOip, replaceDefaults };
1828
+ export type { AppConfig, AppThemePreset, AppThemePresetMergeMode, AuthCsrfToken, LanguageDto, MenuChangeEvent, ModuleAccessRouteData, NoSettingsDto, OipExtensionHostContext, OipExtensionLoadType, OipExtensionManifest, OipExtensionModuleMetadata, OipExtensionNavigateEvent, OipExtensionNotifyEvent, PutSecurityDto, RequestParams, SecurityDto, TopBarDto };