oip-common 0.9.0 → 0.11.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
@@ -6,10 +6,10 @@ import { MessageService, ToastMessageOptions, ConfirmationService, MenuItem, Fil
6
6
  import { Router, ActivatedRoute, QueryParamsHandling, IsActiveMatchOptions, Params, CanActivateChildFn, UrlTree, CanActivateFn, Routes, Route } from '@angular/router';
7
7
  import { TranslationObject, InterpolationParameters, Translation, TranslateService } from '@ngx-translate/core';
8
8
  import { ContextMenu } from 'primeng/contextmenu';
9
+ import { Table } from 'primeng/table';
9
10
  import { PaletteDesignToken, Preset } from '@primeuix/themes/types';
10
11
  import { PrimeNG } from 'primeng/config';
11
12
  import { PaginatorState } from 'primeng/paginator';
12
- import { Table } from 'primeng/table';
13
13
  import { HttpInterceptorFn } from '@angular/common/http';
14
14
 
15
15
  interface TopBarDto {
@@ -85,6 +85,8 @@ interface AppConfig {
85
85
  timeFormat: string;
86
86
  dateTimeFormat: string;
87
87
  timeZone: string;
88
+ /** First day of the week in date pickers: 0 - Sunday, 1 - Monday, ..., 6 - Saturday. */
89
+ firstDayOfWeek?: number;
88
90
  adminMode?: boolean;
89
91
  }
90
92
  interface LayoutState {
@@ -124,6 +126,7 @@ declare class LayoutService {
124
126
  dateTimeFormat: i0.Signal<string>;
125
127
  monthFormat: i0.Signal<string>;
126
128
  timeZone: i0.Signal<string>;
129
+ firstDayOfWeek: i0.Signal<number>;
127
130
  adminMode: i0.Signal<boolean>;
128
131
  transitionComplete: i0.WritableSignal<boolean>;
129
132
  /**
@@ -219,6 +222,10 @@ declare class L10nService {
219
222
  */
220
223
  use(selectedLanguage: string, key?: string): void;
221
224
  init(languages: LanguageDto[]): void;
225
+ /**
226
+ * Passes the PrimeNG dictionary of the current language to PrimeNG, keeping the user's first day of the week
227
+ */
228
+ private applyPrimeNgTranslation;
222
229
  instant(key: string | string[], interpolateParams?: InterpolationParameters): Translation | TranslationObject;
223
230
  static ɵfac: i0.ɵɵFactoryDeclaration<L10nService, never>;
224
231
  static ɵprov: i0.ɵɵInjectableDeclaration<L10nService>;
@@ -743,6 +750,19 @@ interface AuthCsrfTokenResponse {
743
750
  token?: string | null;
744
751
  headerName?: string | null;
745
752
  }
753
+ interface AuthSessionDto {
754
+ sessionId: string | null;
755
+ userId?: string | null;
756
+ userName?: string | null;
757
+ displayName?: string | null;
758
+ email?: string | null;
759
+ createdUtc?: Date | null;
760
+ lastActivityUtc?: Date | null;
761
+ expiresUtc?: Date | null;
762
+ ipAddress?: string | null;
763
+ userAgent?: string | null;
764
+ isCurrent?: boolean;
765
+ }
746
766
  interface AuthSessionResponse {
747
767
  isAuthenticated?: boolean;
748
768
  userName?: string | null;
@@ -761,6 +781,9 @@ interface DefaultSecretsReportResponse {
761
781
  showBanner?: boolean;
762
782
  findings?: DefaultSecretFindingResponse[] | null;
763
783
  }
784
+ interface DeleteAuthSessionsResponse {
785
+ deletedCount?: number;
786
+ }
764
787
  interface EditModuleInstanceDto {
765
788
  moduleInstanceId?: number;
766
789
  label?: string | null;
@@ -780,10 +803,6 @@ interface FolderModuleSettings {
780
803
  interface IframeModuleSettings {
781
804
  url?: string | null;
782
805
  }
783
- interface IntKeyValueDto {
784
- key?: number;
785
- value?: string | null;
786
- }
787
806
  interface ModuleInstanceDto {
788
807
  moduleInstanceId?: number;
789
808
  moduleId?: number;
@@ -799,6 +818,22 @@ interface ModuleInstanceDto {
799
818
  order?: number;
800
819
  separator?: boolean;
801
820
  isStart?: boolean;
821
+ isFolder?: boolean;
822
+ }
823
+ interface ModuleKeyValueDto {
824
+ key?: number;
825
+ value?: string | null;
826
+ icon?: string | null;
827
+ isFolder?: boolean;
828
+ }
829
+ interface GetAuthSessionsParams {
830
+ userId?: string;
831
+ }
832
+ interface DeleteAuthSessionParams {
833
+ sessionId: string;
834
+ }
835
+ interface DeleteAuthSessionsByUserParams {
836
+ userId: string;
802
837
  }
803
838
  interface SetStartModuleParams {
804
839
  id: number;
@@ -809,6 +844,9 @@ interface GetModuleInstanceRightsParams {
809
844
  interface DeleteModuleInstanceParams {
810
845
  id?: number;
811
846
  }
847
+ interface CopyModuleInstanceParams {
848
+ id: number;
849
+ }
812
850
  interface ChangeOrderParams {
813
851
  firstModuleId?: number;
814
852
  secondModuleId?: number;
@@ -817,6 +855,7 @@ interface ChangeOrderParams {
817
855
  interface ContextMenuItemDto {
818
856
  moduleInstanceId: number;
819
857
  isStart?: boolean;
858
+ isFolder?: boolean;
820
859
  url: any;
821
860
  class: string | string[] | Set<string> | {
822
861
  [p: string]: any;
@@ -890,7 +929,7 @@ declare class MenuService {
890
929
  reset(): void;
891
930
  getMenu(): Promise<ModuleInstanceDto[]>;
892
931
  getAdminMenu(): Promise<ModuleInstanceDto[]>;
893
- getModules(): Promise<IntKeyValueDto[]>;
932
+ getModules(): Promise<ModuleKeyValueDto[]>;
894
933
  addModuleInstance(addModuleInstance: AddModuleInstanceDto): Promise<void>;
895
934
  deleteItem(moduleInstanceId: number): Promise<void>;
896
935
  editModuleInstance(item: EditModuleInstanceDto): Promise<void>;
@@ -904,10 +943,11 @@ declare class MenuApi<SecurityDataType = unknown> extends HttpClient<SecurityDat
904
943
  deleteStartModule: (params?: RequestParams) => Promise<void>;
905
944
  getModuleInstanceRights: (query: GetModuleInstanceRightsParams, params?: RequestParams) => Promise<string[]>;
906
945
  getAdminMenu: (params?: RequestParams) => Promise<ModuleInstanceDto[]>;
907
- getModules: (params?: RequestParams) => Promise<IntKeyValueDto[]>;
946
+ getModules: (params?: RequestParams) => Promise<ModuleKeyValueDto[]>;
908
947
  addModuleInstance: (data: AddModuleInstanceDto, params?: RequestParams) => Promise<void>;
909
948
  editModuleInstance: (data: EditModuleInstanceDto, params?: RequestParams) => Promise<void>;
910
949
  deleteModuleInstance: (query: DeleteModuleInstanceParams, params?: RequestParams) => Promise<void>;
950
+ copyModuleInstance: ({ id, ...query }: CopyModuleInstanceParams, params?: RequestParams) => Promise<number>;
911
951
  changeOrder: (query: ChangeOrderParams, params?: RequestParams) => Promise<void>;
912
952
  static ɵfac: i0.ɵɵFactoryDeclaration<MenuApi<any>, never>;
913
953
  static ɵprov: i0.ɵɵInjectableDeclaration<MenuApi<any>>;
@@ -918,12 +958,14 @@ type PrimeIconOption$1 = {
918
958
  value: string;
919
959
  };
920
960
  declare class MenuItemCreateDialogComponent implements OnInit {
961
+ private static readonly defaultIcon;
921
962
  protected readonly menuService: MenuService;
922
963
  protected readonly menu: MenuApi<any>;
923
964
  private readonly msgService;
924
965
  visible: boolean;
925
966
  visibleChange: EventEmitter<boolean>;
926
- modules: IntKeyValueDto[];
967
+ modules: ModuleKeyValueDto[];
968
+ moduleOptions: ModuleKeyValueDto[];
927
969
  iconOptions: PrimeIconOption$1[];
928
970
  selectModule: any;
929
971
  label: string;
@@ -931,6 +973,12 @@ declare class MenuItemCreateDialogComponent implements OnInit {
931
973
  saving: boolean;
932
974
  get canSave(): boolean;
933
975
  ngOnInit(): Promise<void>;
976
+ /**
977
+ * Restricts the module list to the folder when the item is created at the menu root,
978
+ * since only a folder can be placed there.
979
+ */
980
+ private updateModuleOptions;
981
+ onModuleChange(moduleId: number): void;
934
982
  changeVisible(): void;
935
983
  save(): Promise<void>;
936
984
  hide(): void;
@@ -1100,10 +1148,17 @@ declare class ConfigComponent {
1100
1148
  protected selectedDateFormat: string;
1101
1149
  protected selectedTimeFormat: string;
1102
1150
  protected selectedTimeZone: string;
1151
+ protected selectedFirstDayOfWeek: number;
1152
+ /** Days of the week starting from Monday, named in the current language. */
1153
+ protected readonly weekDays: i0.Signal<{
1154
+ value: number;
1155
+ label: string;
1156
+ }[]>;
1103
1157
  constructor();
1104
1158
  changeLanguage(): void;
1105
1159
  changeDateFormat(): void;
1106
1160
  changeTimeFormat(): void;
1161
+ changeFirstDayOfWeek(): void;
1107
1162
  changeTimeZone(): void;
1108
1163
  onSwitchChange(): Promise<void>;
1109
1164
  static ɵfac: i0.ɵɵFactoryDeclaration<ConfigComponent, never>;
@@ -1124,9 +1179,14 @@ interface MigrationDto {
1124
1179
  }
1125
1180
  declare class DbMigrationComponent extends BaseModuleComponent<NoSettingsDto, NoSettingsDto> implements OnInit, OnDestroy {
1126
1181
  private readonly translations;
1182
+ dt: Table;
1127
1183
  data: MigrationDto[];
1184
+ protected loading: boolean;
1185
+ protected globalFilter: string;
1128
1186
  ngOnInit(): Promise<void>;
1129
1187
  refreshAction(): Promise<void>;
1188
+ protected get hasActiveFilters(): boolean;
1189
+ clearFilter(): void;
1130
1190
  getData(): Promise<MigrationDto[]>;
1131
1191
  applyMigration(rowData: MigrationDto): Promise<unknown>;
1132
1192
  static ɵfac: i0.ɵɵFactoryDeclaration<DbMigrationComponent, never>;
@@ -1135,6 +1195,8 @@ declare class DbMigrationComponent extends BaseModuleComponent<NoSettingsDto, No
1135
1195
 
1136
1196
  declare class AppModulesComponent implements OnInit {
1137
1197
  protected modules: ExistModuleDto[];
1198
+ protected moduleFilter: string;
1199
+ protected loading: boolean;
1138
1200
  protected msgService: MsgService;
1139
1201
  protected confirmationService: ConfirmationService;
1140
1202
  protected l10nService: L10nService;
@@ -1146,6 +1208,7 @@ declare class AppModulesComponent implements OnInit {
1146
1208
  private translationsReady;
1147
1209
  constructor();
1148
1210
  ngOnInit(): Promise<void>;
1211
+ protected get filteredModules(): ExistModuleDto[];
1149
1212
  refreshAction(): Promise<void>;
1150
1213
  protected get canRegisterExternalModule(): boolean;
1151
1214
  registerExternalModule(): Promise<void>;
@@ -1155,6 +1218,34 @@ declare class AppModulesComponent implements OnInit {
1155
1218
  static ɵcmp: i0.ɵɵComponentDeclaration<AppModulesComponent, "app-modules", never, {}, {}, never, never, true, never>;
1156
1219
  }
1157
1220
 
1221
+ /**
1222
+ * Administrator page listing active authentication sessions with the ability to terminate them.
1223
+ */
1224
+ declare class AuthSessionsComponent implements OnInit {
1225
+ protected sessions: AuthSessionDto[];
1226
+ protected userFilter: string;
1227
+ protected loading: boolean;
1228
+ protected msgService: MsgService;
1229
+ protected confirmationService: ConfirmationService;
1230
+ protected l10nService: L10nService;
1231
+ protected titleService: AppTitleService;
1232
+ protected layoutService: LayoutService;
1233
+ private authSessionsApi;
1234
+ private readonly translationsReady;
1235
+ constructor();
1236
+ ngOnInit(): Promise<void>;
1237
+ protected get filteredSessions(): AuthSessionDto[];
1238
+ refreshAction(): Promise<void>;
1239
+ protected get hasOtherSessionsThanCurrent(): boolean;
1240
+ terminateAllSessions(): Promise<void>;
1241
+ protected hasOtherSessions(session: AuthSessionDto): boolean;
1242
+ terminateSession(session: AuthSessionDto): Promise<void>;
1243
+ terminateUserSessions(session: AuthSessionDto): Promise<void>;
1244
+ t(key: string): any;
1245
+ static ɵfac: i0.ɵɵFactoryDeclaration<AuthSessionsComponent, never>;
1246
+ static ɵcmp: i0.ɵɵComponentDeclaration<AuthSessionsComponent, "app-auth-sessions", never, {}, {}, never, never, true, never>;
1247
+ }
1248
+
1158
1249
  declare enum ServiceType {
1159
1250
  Service = "Service",
1160
1251
  Application = "Application"
@@ -1975,6 +2066,15 @@ declare class SecurityApi<SecurityDataType = unknown> extends HttpClient<Securit
1975
2066
  static ɵprov: i0.ɵɵInjectableDeclaration<SecurityApi<any>>;
1976
2067
  }
1977
2068
 
2069
+ declare class AuthSessionsApi<SecurityDataType = unknown> extends HttpClient<SecurityDataType> {
2070
+ getAuthSessions: (query: GetAuthSessionsParams, params?: RequestParams) => Promise<AuthSessionDto[]>;
2071
+ deleteAuthSession: ({ sessionId, ...query }: DeleteAuthSessionParams, params?: RequestParams) => Promise<void>;
2072
+ deleteAuthSessionsByUser: ({ userId, ...query }: DeleteAuthSessionsByUserParams, params?: RequestParams) => Promise<DeleteAuthSessionsResponse>;
2073
+ deleteAllAuthSessions: (params?: RequestParams) => Promise<DeleteAuthSessionsResponse>;
2074
+ static ɵfac: i0.ɵɵFactoryDeclaration<AuthSessionsApi<any>, never>;
2075
+ static ɵprov: i0.ɵɵInjectableDeclaration<AuthSessionsApi<any>>;
2076
+ }
2077
+
1978
2078
  declare class ApplicationsApi<SecurityDataType = unknown> extends HttpClient<SecurityDataType> {
1979
2079
  getApplicationRegistryItems: (params?: RequestParams) => Promise<ApplicationRegistryItemDto[]>;
1980
2080
  getApplicationRegistryItemByCode: ({ code, ...query }: GetApplicationRegistryItemByCodeParams, params?: RequestParams) => Promise<any>;
@@ -2109,6 +2209,8 @@ declare function oipConfigRoute(path?: string): Route;
2109
2209
  declare function oipApplicationsRoute(path?: string): Route;
2110
2210
  /** Module registry, administrators only. */
2111
2211
  declare function oipModulesRoute(path?: string): Route;
2212
+ /** Active authentication sessions, administrators only. */
2213
+ declare function oipSessionsRoute(path?: string): Route;
2112
2214
  /** Discussion module. The path must keep an `:id` segment. */
2113
2215
  declare function oipDiscussionRoute(path?: string): Route;
2114
2216
  /** Database migration module. The path must keep an `:id` segment. */
@@ -2142,6 +2244,8 @@ interface OipRouteFeatures {
2142
2244
  applications?: OipRouteToggle;
2143
2245
  /** Module registry, administrators only. Default path: `modules`. */
2144
2246
  modules?: OipRouteToggle;
2247
+ /** Active authentication sessions, administrators only. Default path: `sessions`. */
2248
+ sessions?: OipRouteToggle;
2145
2249
  /** Discussion module. Default path: `discussion/:id`. */
2146
2250
  discussion?: OipRouteToggle;
2147
2251
  /** Database migration module. Default path: `db-migration/:id`. */
@@ -2205,5 +2309,5 @@ interface OipRoutesOptions {
2205
2309
  */
2206
2310
  declare function provideOipRoutes(options?: OipRoutesOptions): Routes;
2207
2311
 
2208
- export { APP_INFO_TOKEN, APP_THEME_PRESETS, APP_THEME_PRESETS_MERGE_MODE, AccessComponent, AppConfiguratorComponent, AppFloatingConfiguratorComponent, AppInfoService, AppLayoutComponent, AppModulesComponent, AppTopbar, AppTopbarApplicationSwitcherComponent, ApplicationRegistryService, ApplicationsApi, ApplicationsComponent, AuthGuardService, BaseModuleComponent, BffSecurityService, BlockLoaderComponent, ConfigComponent, ContentType, CustomElementExtensionModuleHostComponent, DbMigrationComponent, DefaultSecretsBannerComponent, DiscussionComponent, ErrorComponent, ExtensionLoaderService, ExtensionModuleHostComponent, FolderModuleApi, FooterComponent, HttpClient, IframeModuleApi, IframeModuleComponent, L10nService, LOGO_COMPONENT_TOKEN, LayoutService, LogoComponent, LogoService, MenuComponent, MenuService, ModuleInstanceRightsService, ModuleLoadingService, MsgService, NoModulesComponent, NotfoundComponent, NotificationApi, NotificationService, OIP_EXTENSION_EVENTS, SecurityApi, SecurityComponent, SecurityService, SidebarComponent, StartPageService, TableFilterService, TopBarService, UnauthorizedComponent, UserNotificationsComponent, UserProfileApi, UserProfileComponent, UserService, convertToPrimeNgDateFormat, defaultTheme, emitOipContextChange, emitOipError, emitOipNavigate, emitOipNotify, emitOipSettingsChange, emitOipTitleChange, langIntercept, mergeWithDefaults, moduleAccessGuard, oipAccessRoute, oipApplicationsRoute, oipAuthGuard, oipConfigRoute, oipDbMigrationRoute, oipDiscussionRoute, oipErrorRoute, oipExtensionsRoute, oipIframeModuleRoute, oipModulesRoute, oipNoModulesRoute, oipProfileRoute, oipStartRedirectGuard, oipStartRoute, provideAppInfo, provideAppThemes, provideLogoComponent, provideOip, provideOipRoutes, provideTranslations, replaceDefaults };
2312
+ export { APP_INFO_TOKEN, APP_THEME_PRESETS, APP_THEME_PRESETS_MERGE_MODE, AccessComponent, AppConfiguratorComponent, AppFloatingConfiguratorComponent, AppInfoService, AppLayoutComponent, AppModulesComponent, AppTopbar, AppTopbarApplicationSwitcherComponent, ApplicationRegistryService, ApplicationsApi, ApplicationsComponent, AuthGuardService, AuthSessionsApi, AuthSessionsComponent, BaseModuleComponent, BffSecurityService, BlockLoaderComponent, ConfigComponent, ContentType, CustomElementExtensionModuleHostComponent, DbMigrationComponent, DefaultSecretsBannerComponent, DiscussionComponent, ErrorComponent, ExtensionLoaderService, ExtensionModuleHostComponent, FolderModuleApi, FooterComponent, HttpClient, IframeModuleApi, IframeModuleComponent, L10nService, LOGO_COMPONENT_TOKEN, LayoutService, LogoComponent, LogoService, MenuComponent, MenuService, ModuleInstanceRightsService, ModuleLoadingService, MsgService, NoModulesComponent, NotfoundComponent, NotificationApi, NotificationService, OIP_EXTENSION_EVENTS, SecurityApi, SecurityComponent, SecurityService, SidebarComponent, StartPageService, TableFilterService, TopBarService, UnauthorizedComponent, UserNotificationsComponent, UserProfileApi, UserProfileComponent, UserService, convertToPrimeNgDateFormat, defaultTheme, emitOipContextChange, emitOipError, emitOipNavigate, emitOipNotify, emitOipSettingsChange, emitOipTitleChange, langIntercept, mergeWithDefaults, moduleAccessGuard, oipAccessRoute, oipApplicationsRoute, oipAuthGuard, oipConfigRoute, oipDbMigrationRoute, oipDiscussionRoute, oipErrorRoute, oipExtensionsRoute, oipIframeModuleRoute, oipModulesRoute, oipNoModulesRoute, oipProfileRoute, oipSessionsRoute, oipStartRedirectGuard, oipStartRoute, provideAppInfo, provideAppThemes, provideLogoComponent, provideOip, provideOipRoutes, provideTranslations, replaceDefaults };
2209
2313
  export type { AppConfig, AppInfo, AppInfoValue, AppThemePreset, AppThemePresetLoader, AppThemePresetMergeMode, AuthCsrfToken, LanguageDto, MenuChangeEvent, ModuleAccessRouteData, NoSettingsDto, OipExtensionHostContext, OipExtensionLoadType, OipExtensionManifest, OipExtensionModuleMetadata, OipExtensionNavigateEvent, OipExtensionNotifyEvent, OipRouteFeatures, OipRouteToggle, OipRoutesOptions, PutSecurityDto, RequestParams, SecurityDto, StartRouteData, TopBarDto };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "oip-common",
3
- "version": "0.9.0",
3
+ "version": "0.11.0",
4
4
  "description": "A template for cross-platform web applications based on sakai-ng and primeNG",
5
5
  "main": "index.js",
6
6
  "keywords": [