@codex-ts/core-lib 1.0.9 → 1.0.13

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.
Files changed (30) hide show
  1. package/fesm2022/codex-ts-core-lib.mjs +2388 -1794
  2. package/fesm2022/codex-ts-core-lib.mjs.map +1 -1
  3. package/lib/components/base-form.component.d.ts +27 -22
  4. package/lib/components/base-list-page.component.d.ts +12 -71
  5. package/lib/components/base-list-tabbed-form.component.d.ts +40 -0
  6. package/lib/components/base-tabbed-form.component.d.ts +17 -20
  7. package/lib/components/base-table.component.d.ts +72 -0
  8. package/lib/components/base-task-details.component.d.ts +59 -0
  9. package/lib/enums/task-role.enum.d.ts +37 -0
  10. package/lib/keycloak/keycloak-config.interface.d.ts +19 -0
  11. package/lib/keycloak/keycloak.guard.d.ts +25 -0
  12. package/lib/keycloak/keycloak.service.d.ts +24 -0
  13. package/lib/keycloak/keycloak.token.d.ts +3 -0
  14. package/lib/models/base-create-request.model.d.ts +12 -0
  15. package/lib/models/base-request.model.d.ts +9 -0
  16. package/lib/models/base-response.model.d.ts +15 -0
  17. package/lib/models/base-task.model.d.ts +17 -0
  18. package/lib/models/base-update-request.model.d.ts +16 -0
  19. package/lib/models/base.model.d.ts +59 -0
  20. package/lib/models/pagination/page.interface.d.ts +23 -6
  21. package/lib/services/base-task.service.d.ts +40 -0
  22. package/lib/services/form.service.d.ts +31 -0
  23. package/lib/states/form-component.state.d.ts +12 -0
  24. package/lib/states/form.state.d.ts +21 -0
  25. package/lib/states/list-tabbed-form.state.d.ts +9 -0
  26. package/lib/states/tabbed-form.state.d.ts +21 -0
  27. package/package.json +7 -2
  28. package/public-api.d.ts +29 -21
  29. package/lib/services/entity-registry.service.d.ts +0 -26
  30. package/lib/services/reference-data-provider.service.d.ts +0 -8
@@ -1,40 +1,42 @@
1
- import { OnInit } from '@angular/core';
2
- import { ComponentContext } from '../enums/component-context.enum';
3
- import { FormGroup } from '@angular/forms';
1
+ import { OnDestroy, OnInit } from '@angular/core';
4
2
  import { ActivatedRoute, Router } from '@angular/router';
5
3
  import { FormlyFieldConfig } from '@ngx-formly/core';
6
- import { BasePageComponent } from './base-page.component';
7
- import { UtilsService } from '../services/utils.service';
8
- import { NotificationService } from '../services/notification.service';
9
- import { AppConstants, PageMode } from '../constants/app.constants';
10
4
  import { Observable } from 'rxjs';
11
- import { FormlyConfigService } from '../services/formly-config.service';
5
+ import { AppConstants } from '../constants/app.constants';
6
+ import { ComponentContext } from '../enums/component-context.enum';
12
7
  import { EntityService } from '../services/entity.service';
8
+ import { FormlyConfigService } from '../services/formly-config.service';
9
+ import { NotificationService } from '../services/notification.service';
10
+ import { UtilsService } from '../services/utils.service';
11
+ import { FormComponentState } from '../states/form-component.state';
12
+ import { BasePageComponent } from './base-page.component';
13
13
  import * as i0 from "@angular/core";
14
14
  export declare abstract class BaseFormComponent<T extends {
15
15
  uuid: string;
16
- }> extends BasePageComponent implements OnInit {
16
+ }> extends BasePageComponent implements OnInit, OnDestroy {
17
17
  protected route: ActivatedRoute;
18
18
  protected router: Router;
19
19
  protected notificationService: NotificationService;
20
20
  protected utilsService: UtilsService;
21
21
  protected formlyConfigService: FormlyConfigService;
22
- form: FormGroup<any>;
23
- fields: FormlyFieldConfig[];
24
- isNew: boolean;
25
- mode: PageMode;
26
- currentFormData: any;
27
- protected originalFormData: T | null;
28
- protected hasChanges: boolean;
29
- context: ComponentContext;
22
+ private readonly destroyed$;
23
+ protected state: FormComponentState<T>;
30
24
  constructor(route: ActivatedRoute, router: Router, notificationService: NotificationService, utilsService: UtilsService, formlyConfigService: FormlyConfigService);
31
25
  ngOnInit(): void;
32
- private initializeFormData;
33
- private loadFromUuid;
34
26
  private initializeForm;
27
+ private loadFormData;
28
+ private getRouterState;
29
+ private initializeFormSubscriptions;
30
+ set formData(data: T | null);
31
+ private updateCurrentData;
32
+ private checkFormChanges;
33
+ protected updateFormState(data: T): void;
34
+ private handleInitError;
35
+ private handleLoadError;
35
36
  protected patchFormData(data: any): void;
36
37
  private initializeFormMode;
37
38
  private setupFormState;
39
+ private onFormReady;
38
40
  protected getFormlyFieldConfig(): FormlyFieldConfig[];
39
41
  protected onSubmitRoute(): string[];
40
42
  protected getEntityOperations(): {
@@ -43,9 +45,12 @@ export declare abstract class BaseFormComponent<T extends {
43
45
  getById: (uuid: string) => Observable<T>;
44
46
  };
45
47
  protected onSubmit(): void;
48
+ private validateSubmission;
49
+ private getSubmitOperation;
50
+ private handleSubmitSuccess;
51
+ private handleSubmitError;
46
52
  protected hasFormChanges(currentData: any): boolean;
47
- protected saveEntity(): void;
48
- protected loadEntity(uuid: string): void;
53
+ ngOnDestroy(): void;
49
54
  protected abstract getEntityService(): EntityService<T>;
50
55
  private isValidPageMode;
51
56
  protected getDropdownOptions(): Record<string, any>;
@@ -57,6 +62,6 @@ export declare abstract class BaseFormComponent<T extends {
57
62
  */
58
63
  protected isInContext(contextType: ComponentContext): boolean;
59
64
  static ɵfac: i0.ɵɵFactoryDeclaration<BaseFormComponent<any>, never>;
60
- static ɵcmp: i0.ɵɵComponentDeclaration<BaseFormComponent<any>, "ng-component", never, { "context": { "alias": "context"; "required": false; }; }, {}, never, never, true, never>;
65
+ static ɵcmp: i0.ɵɵComponentDeclaration<BaseFormComponent<any>, "ng-component", never, { "formData": { "alias": "formData"; "required": false; }; }, {}, never, never, true, never>;
61
66
  static ɵprov: i0.ɵɵInjectableDeclaration<BaseFormComponent<any>>;
62
67
  }
@@ -1,78 +1,24 @@
1
- import { OnInit, OnDestroy } from '@angular/core';
2
1
  import { Router } from '@angular/router';
3
- import { Table, TableLazyLoadEvent } from 'primeng/table';
4
2
  import { ConfirmationService } from 'primeng/api';
3
+ import { Observable } from 'rxjs';
4
+ import { BaseTableComponent } from './base-table.component';
5
5
  import { NotificationService } from '../services/notification.service';
6
- import { Subscription, Observable } from 'rxjs';
7
- import { Page } from '../models/pagination/page.interface';
8
- import { PageRequest } from '../models/pagination/page-request.interface';
9
- import { FilterCriteria, FilterOperator } from '../models/pagination/filter-criteria.interface';
10
- import { BasePageComponent } from './base-page.component';
11
6
  import { UtilsService } from '../services/utils.service';
12
7
  import * as i0 from "@angular/core";
13
8
  /**
14
9
  * Base component for all list page components in the application.
15
- * Provides common functionality for list operations like loading data,
16
- * pagination, sorting, and CRUD operations.
10
+ * Provides common functionality for list operations like CRUD operations
11
+ * while inheriting table functionality from BaseTableComponent.
17
12
  */
18
13
  export declare abstract class BaseListPageComponent<T extends {
19
14
  uuid: string;
20
- }> extends BasePageComponent implements OnInit, OnDestroy {
15
+ }> extends BaseTableComponent<T> {
21
16
  protected router: Router;
22
17
  protected notificationService: NotificationService;
23
18
  protected utilsService: UtilsService;
24
19
  protected confirmationService: ConfirmationService;
25
- table: Table;
26
- items: T[];
27
20
  actionLoading: boolean;
28
- rows: number;
29
- totalRecords: number;
30
- filters: FilterCriteria[];
31
- protected subscriptions: Subscription[];
32
21
  constructor(router: Router, notificationService: NotificationService, utilsService: UtilsService, confirmationService: ConfirmationService);
33
- /**
34
- * Initialize the component, subscribe to loading state if available,
35
- * and load initial data.
36
- */
37
- ngOnInit(): void;
38
- /**
39
- * Clean up any subscriptions when the component is destroyed
40
- */
41
- ngOnDestroy(): void;
42
- /**
43
- * Handle search event from the UI
44
- * @param event The search event
45
- */
46
- onSearch(event: Event): void;
47
- /**
48
- * Load data with pagination and sorting
49
- * @param event The lazy load event from PrimeNG table
50
- */
51
- /**
52
- * Convert PrimeNG filter format to backend format
53
- * @param filters The PrimeNG filters object
54
- * @returns Converted filters object for backend
55
- */
56
- /**
57
- * Convert PrimeNG filter format to backend format
58
- * @param filters The PrimeNG filters object
59
- * @returns Converted filters object for backend
60
- */
61
- /**
62
- * Convert PrimeNG filters to backend format with proper operator mapping
63
- */
64
- protected convertFilters(filters: {
65
- [key: string]: any;
66
- }): FilterCriteria[];
67
- /**
68
- * Transform filter value based on backend requirements - all values must be strings
69
- */
70
- protected transformFilterValue(value: any): string;
71
- /**
72
- * Map PrimeNG operators to backend operators
73
- */
74
- protected transformOperator(operator: string): FilterOperator;
75
- loadData(event?: TableLazyLoadEvent): void;
76
22
  /**
77
23
  * Navigate to create a new entity
78
24
  */
@@ -87,6 +33,11 @@ export declare abstract class BaseListPageComponent<T extends {
87
33
  * @param item The entity to edit
88
34
  */
89
35
  onEdit(item: T): void;
36
+ /**
37
+ * Delete an entity with confirmation
38
+ * @param item The entity to delete
39
+ */
40
+ onDelete(item: T): void;
90
41
  /**
91
42
  * Navigate to a route with error handling
92
43
  * @param path The route path
@@ -95,11 +46,6 @@ export declare abstract class BaseListPageComponent<T extends {
95
46
  protected navigateTo(path: any[], matrixParams?: {
96
47
  [key: string]: any;
97
48
  }): void;
98
- /**
99
- * Delete an entity with confirmation
100
- * @param item The entity to delete
101
- */
102
- onDelete(item: T): void;
103
49
  /**
104
50
  * Validate that an entity has a UUID
105
51
  * @param item The entity to validate
@@ -108,15 +54,10 @@ export declare abstract class BaseListPageComponent<T extends {
108
54
  */
109
55
  protected validateItemUuid(item: T, action: string): boolean;
110
56
  /**
111
- * Get an observable for loading state from the entity service
112
- * @returns An observable of loading state if available, null otherwise
113
- */
114
- protected getLoadingObservable(): Observable<boolean> | null;
115
- /**
116
- * Get the entity service for data operations
57
+ * Override the getEntityService to include the delete operation
117
58
  */
118
59
  protected abstract getEntityService(): {
119
- getAll: (pageRequest?: PageRequest) => Observable<Page<T>>;
60
+ getAll: (pageRequest?: any) => Observable<any>;
120
61
  delete: (uuid: string) => Observable<any>;
121
62
  };
122
63
  /**
@@ -0,0 +1,40 @@
1
+ import { OnInit, OnDestroy } from '@angular/core';
2
+ import { ActivatedRoute, Router } from '@angular/router';
3
+ import { FormComponentState } from '../states/form-component.state';
4
+ import { BasePageComponent } from './base-page.component';
5
+ import { UtilsService } from '../services/utils.service';
6
+ import { NotificationService } from '../services/notification.service';
7
+ import { ListTabbedFormState } from '../states/list-tabbed-form.state';
8
+ import * as i0 from "@angular/core";
9
+ export declare abstract class BaseListTabbedFormComponent<T extends {
10
+ uuid: string;
11
+ }> extends BasePageComponent implements OnInit, OnDestroy {
12
+ protected route: ActivatedRoute;
13
+ protected router: Router;
14
+ protected notificationService: NotificationService;
15
+ protected utilsService: UtilsService;
16
+ private readonly destroyed$;
17
+ private readonly tabState$;
18
+ state: ListTabbedFormState<T> & FormComponentState<T>;
19
+ constructor(route: ActivatedRoute, router: Router, notificationService: NotificationService, utilsService: UtilsService);
20
+ ngOnInit(): void;
21
+ private initializeFormFromQueryParams;
22
+ private setupTabStateSubscription;
23
+ private setupRouteParamsSubscription;
24
+ private handleTabChange;
25
+ private findTabData;
26
+ private updateComponentState;
27
+ private initializeForm;
28
+ private initializeFormMode;
29
+ private setupFormState;
30
+ protected initializeListForm(): void;
31
+ private createTabsFromFormDataList;
32
+ protected onTabChange(event: any): void;
33
+ protected navigateToTab(uuid: string): void;
34
+ ngOnDestroy(): void;
35
+ private isValidPageMode;
36
+ protected abstract getTabTitle(data: T): string;
37
+ static ɵfac: i0.ɵɵFactoryDeclaration<BaseListTabbedFormComponent<any>, never>;
38
+ static ɵcmp: i0.ɵɵComponentDeclaration<BaseListTabbedFormComponent<any>, "ng-component", never, {}, {}, never, never, true, never>;
39
+ static ɵprov: i0.ɵɵInjectableDeclaration<BaseListTabbedFormComponent<any>>;
40
+ }
@@ -1,33 +1,30 @@
1
- import { OnInit } from '@angular/core';
1
+ import { OnInit, OnDestroy } from '@angular/core';
2
2
  import { ActivatedRoute, Router } from '@angular/router';
3
3
  import { BasePageComponent } from './base-page.component';
4
4
  import { UtilsService } from '../services/utils.service';
5
5
  import { NotificationService } from '../services/notification.service';
6
- import { PageMode } from '../constants/app.constants';
7
6
  import { EntityService } from '../services/entity.service';
7
+ import { TabConfig, TabbedFormState } from '../states/tabbed-form.state';
8
8
  import * as i0 from "@angular/core";
9
- export interface TabConfig {
10
- value: string;
11
- title: string;
12
- isParentModel?: boolean;
13
- }
14
9
  export declare abstract class BaseTabbedFormComponent<T extends {
15
10
  uuid: string;
16
- }> extends BasePageComponent implements OnInit {
11
+ }> extends BasePageComponent implements OnInit, OnDestroy {
17
12
  protected route: ActivatedRoute;
18
13
  protected router: Router;
19
14
  protected notificationService: NotificationService;
20
15
  protected utilsService: UtilsService;
21
- activeTab: string;
22
- tabs: TabConfig[];
23
- formType: string;
24
- isNew: boolean;
25
- mode: PageMode;
26
- currentFormData: T;
27
- protected originalFormData: T | null;
28
- protected hasChanges: boolean;
16
+ private readonly destroyed$;
17
+ private readonly stateManager$;
18
+ private getInitialState;
19
+ protected get state(): TabbedFormState<T>;
20
+ protected set state(value: TabbedFormState<T>);
21
+ private hasStateChanged;
22
+ private areTabsEqual;
29
23
  constructor(route: ActivatedRoute, router: Router, notificationService: NotificationService, utilsService: UtilsService);
30
24
  ngOnInit(): void;
25
+ private initializeFormWithErrorHandling;
26
+ private setupStateSubscription;
27
+ private handleStateChange;
31
28
  private initializeFormData;
32
29
  private loadFromUuid;
33
30
  private initializeForm;
@@ -38,16 +35,16 @@ export declare abstract class BaseTabbedFormComponent<T extends {
38
35
  protected findTabByValue(value: string): TabConfig | undefined;
39
36
  protected loadDefaultTab(): void;
40
37
  protected getTabFormData(tabConfig: TabConfig): T | null;
41
- private initializeListForm;
42
- private createTabsFromFormDataList;
43
- protected abstract getTabTitle(data: T): string;
38
+ private isTabFormData;
44
39
  protected onTabChange(value: string | number): void;
45
40
  protected hasFormChanges(currentData: T): boolean;
46
- private isEqual;
41
+ private detectChanges;
42
+ ngOnDestroy(): void;
47
43
  private isValidPageMode;
48
44
  protected abstract getTabs(): TabConfig[];
49
45
  protected abstract getEntityService(): EntityService<T>;
50
46
  protected abstract getEntityName(): string;
47
+ protected getTabTitle(data: T): string;
51
48
  static ɵfac: i0.ɵɵFactoryDeclaration<BaseTabbedFormComponent<any>, never>;
52
49
  static ɵcmp: i0.ɵɵComponentDeclaration<BaseTabbedFormComponent<any>, "ng-component", never, {}, {}, never, never, true, never>;
53
50
  static ɵprov: i0.ɵɵInjectableDeclaration<BaseTabbedFormComponent<any>>;
@@ -0,0 +1,72 @@
1
+ import { Table, TableLazyLoadEvent } from 'primeng/table';
2
+ import { Subscription, Observable } from 'rxjs';
3
+ import { Page } from '../models/pagination/page.interface';
4
+ import { PageRequest } from '../models/pagination/page-request.interface';
5
+ import { FilterCriteria, FilterOperator } from '../models/pagination/filter-criteria.interface';
6
+ import { BasePageComponent } from './base-page.component';
7
+ import { UtilsService } from '../services/utils.service';
8
+ import { NotificationService } from '../services/notification.service';
9
+ import * as i0 from "@angular/core";
10
+ /**
11
+ * Base component for all table components in the application.
12
+ * Provides common functionality for table operations like loading data,
13
+ * pagination, sorting, and filtering.
14
+ */
15
+ export declare abstract class BaseTableComponent<T extends {
16
+ uuid: string;
17
+ }> extends BasePageComponent {
18
+ protected utilsService: UtilsService;
19
+ protected notificationService: NotificationService;
20
+ table: Table;
21
+ items: T[];
22
+ rows: number;
23
+ totalRecords: number;
24
+ filters: FilterCriteria[];
25
+ protected subscriptions: Subscription[];
26
+ constructor(utilsService: UtilsService, notificationService: NotificationService);
27
+ /**
28
+ * Initialize the component and load initial data
29
+ */
30
+ ngOnInit(): void;
31
+ /**
32
+ * Clean up any subscriptions when the component is destroyed
33
+ */
34
+ ngOnDestroy(): void;
35
+ /**
36
+ * Handle search event from the UI
37
+ * @param event The search event
38
+ */
39
+ onSearch(event: Event): void;
40
+ /**
41
+ * Load data with pagination and sorting
42
+ * @param event The lazy load event from PrimeNG table
43
+ */
44
+ loadData(event?: TableLazyLoadEvent): void;
45
+ /**
46
+ * Convert PrimeNG filters to backend format with proper operator mapping
47
+ */
48
+ protected convertFilters(filters: {
49
+ [key: string]: any;
50
+ }): FilterCriteria[];
51
+ /**
52
+ * Transform filter value based on backend requirements - all values must be strings
53
+ */
54
+ protected transformFilterValue(value: any): string;
55
+ /**
56
+ * Map PrimeNG operators to backend operators
57
+ */
58
+ protected transformOperator(operator: string): FilterOperator;
59
+ /**
60
+ * Get an observable for loading state from the entity service
61
+ * @returns An observable of loading state if available, null otherwise
62
+ */
63
+ protected getLoadingObservable(): Observable<boolean> | null;
64
+ /**
65
+ * Get the entity service for data operations
66
+ */
67
+ protected abstract getEntityService(): {
68
+ getAll: (pageRequest?: PageRequest) => Observable<Page<T>>;
69
+ };
70
+ static ɵfac: i0.ɵɵFactoryDeclaration<BaseTableComponent<any>, never>;
71
+ static ɵdir: i0.ɵɵDirectiveDeclaration<BaseTableComponent<any>, never, never, {}, {}, never, never, true, never>;
72
+ }
@@ -0,0 +1,59 @@
1
+ import { OnDestroy, OnInit } from '@angular/core';
2
+ import { ActivatedRoute, Router } from '@angular/router';
3
+ import { Observable } from 'rxjs';
4
+ import { BasePageComponent } from './base-page.component';
5
+ import { UtilsService } from '../services/utils.service';
6
+ import { NotificationService } from '../services/notification.service';
7
+ import { FormlyConfigService } from '../services/formly-config.service';
8
+ import { EntityService } from '../services/entity.service';
9
+ import { FormService } from '../services/form.service';
10
+ import { ComponentContext } from '../enums/component-context.enum';
11
+ import { FormComponentState } from '../states/form-component.state';
12
+ import * as i0 from "@angular/core";
13
+ /**
14
+ * Base component for all task detail components in the application.
15
+ * Uses composition with FormService for form functionality.
16
+ */
17
+ export declare abstract class BaseTaskDetailsComponent<T extends {
18
+ uuid: string;
19
+ }> extends BasePageComponent implements OnInit, OnDestroy {
20
+ protected route: ActivatedRoute;
21
+ protected router: Router;
22
+ protected notificationService: NotificationService;
23
+ protected utilsService: UtilsService;
24
+ protected formlyConfigService: FormlyConfigService;
25
+ private readonly destroyed$;
26
+ protected formService: FormService<T>;
27
+ protected state: FormComponentState<T>;
28
+ constructor(route: ActivatedRoute, router: Router, notificationService: NotificationService, utilsService: UtilsService, formlyConfigService: FormlyConfigService);
29
+ protected initializeServices(): Observable<void>;
30
+ ngOnInit(): void;
31
+ private initializeFromRoute;
32
+ protected loadData(uuid: string): void;
33
+ protected onSubmit(): void;
34
+ protected navigateAfterSubmit(): void;
35
+ private onInitialized;
36
+ private handleInitError;
37
+ protected handleLoadError(error: any): void;
38
+ protected handleSubmitError(error: any): void;
39
+ protected isInContext(contextType: ComponentContext): boolean;
40
+ ngOnDestroy(): void;
41
+ /**
42
+ * Get the entity service for CRUD operations
43
+ */
44
+ protected abstract getEntityService(): EntityService<T>;
45
+ /**
46
+ * Get field configuration for the form
47
+ */
48
+ protected abstract getJsonFields(): any;
49
+ /**
50
+ * Get dropdown options for form fields
51
+ */
52
+ protected abstract getDropdownOptions(): Record<string, any>;
53
+ /**
54
+ * Get entity name for messages
55
+ */
56
+ protected abstract getEntityName(): string;
57
+ static ɵfac: i0.ɵɵFactoryDeclaration<BaseTaskDetailsComponent<any>, never>;
58
+ static ɵdir: i0.ɵɵDirectiveDeclaration<BaseTaskDetailsComponent<any>, never, never, {}, {}, never, never, true, never>;
59
+ }
@@ -0,0 +1,37 @@
1
+ /**
2
+ * Standard task roles that define user permissions within a task workflow.
3
+ * These roles control what operations a user can perform on tasks.
4
+ */
5
+ export declare enum TaskRole {
6
+ /**
7
+ * Can create new tasks. This could be a user initiating a task manually
8
+ * or a system process creating tasks automatically.
9
+ */
10
+ TASK_CREATOR = "TASK_CREATOR",
11
+ /**
12
+ * Can assign or reassign tasks to other users. Typically used by
13
+ * team leads or workflow managers to distribute work.
14
+ */
15
+ TASK_ASSIGNER = "TASK_ASSIGNER",
16
+ /**
17
+ * Can pick tasks for self-assignment from a task pool.
18
+ * Useful in scenarios where tasks can be claimed by available workers.
19
+ */
20
+ TASK_PICKER = "TASK_PICKER",
21
+ /**
22
+ * Can review and approve completed tasks. This role is responsible for
23
+ * quality assurance or approval steps in the workflow.
24
+ */
25
+ TASK_REVIEWER = "TASK_REVIEWER",
26
+ /**
27
+ * Can view task details but cannot modify them. Useful for stakeholders
28
+ * who need to monitor task progress without making changes.
29
+ */
30
+ TASK_VIEWER = "TASK_VIEWER",
31
+ /**
32
+ * Has full administrative control over tasks. Can override or force
33
+ * state changes, bypass normal workflow restrictions, and manage
34
+ * task configuration.
35
+ */
36
+ TASK_ADMIN = "TASK_ADMIN"
37
+ }
@@ -0,0 +1,19 @@
1
+ export interface KeycloakConfig {
2
+ authServerUrl: string;
3
+ realm: string;
4
+ clientId: string;
5
+ scope?: string;
6
+ useSSO?: boolean;
7
+ enableBearerInterceptor?: boolean;
8
+ tokenValidityInSeconds?: number;
9
+ bearerExcludedUrls?: string[];
10
+ silentCheckSsoRedirectUri?: string;
11
+ loginOptions?: KeycloakLoginOptions;
12
+ }
13
+ export interface KeycloakLoginOptions {
14
+ redirectUri?: string;
15
+ prompt?: 'none' | 'login' | 'consent';
16
+ maxAge?: number;
17
+ loginHint?: string;
18
+ idpHint?: string;
19
+ }
@@ -0,0 +1,25 @@
1
+ import { ActivatedRouteSnapshot, RouterStateSnapshot, UrlTree, Router } from '@angular/router';
2
+ import { KeycloakService } from './keycloak.service';
3
+ import { Observable } from 'rxjs';
4
+ import * as i0 from "@angular/core";
5
+ export declare class KeycloakAuthGuard {
6
+ protected keycloakService: KeycloakService;
7
+ protected router: Router;
8
+ constructor(keycloakService: KeycloakService, router: Router);
9
+ canActivate(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): Observable<boolean | UrlTree>;
10
+ protected hasRequiredRoles(requiredRoles: string[]): boolean;
11
+ /**
12
+ * Checks if all required roles are present
13
+ * @param route Route being activated
14
+ * @returns true if no roles are required or if all required roles are present
15
+ */
16
+ protected checkRoles(route: ActivatedRouteSnapshot): boolean;
17
+ /**
18
+ * Gets redirect URL from route if present
19
+ * @param state Router state
20
+ * @returns URL to redirect to after login or undefined
21
+ */
22
+ protected getLoginRedirectUrl(state: RouterStateSnapshot): string;
23
+ static ɵfac: i0.ɵɵFactoryDeclaration<KeycloakAuthGuard, never>;
24
+ static ɵprov: i0.ɵɵInjectableDeclaration<KeycloakAuthGuard>;
25
+ }
@@ -0,0 +1,24 @@
1
+ import { KeycloakConfig } from './keycloak-config.interface';
2
+ import { Observable } from 'rxjs';
3
+ import { HttpClient } from '@angular/common/http';
4
+ import * as i0 from "@angular/core";
5
+ export declare class KeycloakService {
6
+ private config;
7
+ private http;
8
+ private keycloak;
9
+ private isAuthenticated$;
10
+ private userProfile$;
11
+ constructor(config: KeycloakConfig, http: HttpClient);
12
+ initialize(): Promise<boolean>;
13
+ login(options?: any): Promise<void>;
14
+ logout(): Promise<void>;
15
+ isLoggedIn(): Observable<boolean>;
16
+ getToken(): Promise<string | null>;
17
+ getRoles(): string[];
18
+ hasRole(role: string): boolean;
19
+ getUserProfile(): Observable<any>;
20
+ updateToken(minValidity?: number): Promise<boolean>;
21
+ private loadUserProfile;
22
+ static ɵfac: i0.ɵɵFactoryDeclaration<KeycloakService, never>;
23
+ static ɵprov: i0.ɵɵInjectableDeclaration<KeycloakService>;
24
+ }
@@ -0,0 +1,3 @@
1
+ import { InjectionToken } from '@angular/core';
2
+ import { KeycloakConfig } from './keycloak-config.interface';
3
+ export declare const KEYCLOAK_CONFIG: InjectionToken<KeycloakConfig>;
@@ -0,0 +1,12 @@
1
+ import { BaseRequest } from './base-request.model';
2
+ /**
3
+ * Base interface for create operation requests
4
+ * Contains minimal fields needed when creating a new entity
5
+ */
6
+ export interface BaseCreateRequest extends BaseRequest {
7
+ /**
8
+ * Whether the entity should be active upon creation
9
+ * Optional, defaults to true on server
10
+ */
11
+ active?: boolean;
12
+ }
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Base interface for all API request DTOs
3
+ */
4
+ export interface BaseRequest {
5
+ /**
6
+ * Unique request identifier for tracing/debugging
7
+ */
8
+ requestId?: string;
9
+ }
@@ -0,0 +1,15 @@
1
+ import { BaseModel } from './base.model';
2
+ /**
3
+ * Base interface for all API response DTOs
4
+ * Extends BaseModel to include audit fields and adds response-specific fields
5
+ */
6
+ export interface BaseResponse extends BaseModel {
7
+ /**
8
+ * Unique request identifier for tracing/debugging
9
+ */
10
+ requestId?: string;
11
+ /**
12
+ * Timestamp when the response was generated
13
+ */
14
+ timestamp: Date;
15
+ }
@@ -0,0 +1,17 @@
1
+ import { BaseModel } from './base.model';
2
+ /**
3
+ * Base model interface for all task entities
4
+ * Contains common fields used across different types of tasks
5
+ */
6
+ export interface BaseTaskModel extends BaseModel {
7
+ title: string;
8
+ description: string;
9
+ type: string;
10
+ category: string;
11
+ priority: string;
12
+ assignedUser: string;
13
+ assignedDepartment: string;
14
+ product: string;
15
+ subProduct: string;
16
+ business: string;
17
+ }
@@ -0,0 +1,16 @@
1
+ import { BaseRequest } from './base-request.model';
2
+ /**
3
+ * Base interface for update operation requests
4
+ * Contains fields required for entity identification and version control
5
+ */
6
+ export interface BaseUpdateRequest extends BaseRequest {
7
+ /**
8
+ * Unique identifier of the entity to update
9
+ */
10
+ uuid: string;
11
+ /**
12
+ * Version number for optimistic locking
13
+ * Must match the current version in database
14
+ */
15
+ version: number;
16
+ }