@codex-ts/core-lib 1.0.13 → 1.0.15

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.
@@ -0,0 +1,88 @@
1
+ import { Router } from '@angular/router';
2
+ import { Observable } from 'rxjs';
3
+ import { ConfirmationService } from 'primeng/api';
4
+ import { BaseTableComponent } from './base-table.component';
5
+ import { NotificationService } from '../services/notification.service';
6
+ import { UtilsService } from '../services/utils.service';
7
+ import * as i0 from "@angular/core";
8
+ /**
9
+ * Base component for all task dashboard components in the application.
10
+ * Provides common functionality for task management operations while
11
+ * inheriting table functionality from BaseTableComponent.
12
+ */
13
+ export declare abstract class BaseTaskDashboardComponent<T extends {
14
+ uuid: string;
15
+ }> extends BaseTableComponent<T> {
16
+ protected router: Router;
17
+ protected notificationService: NotificationService;
18
+ protected utilsService: UtilsService;
19
+ protected confirmationService: ConfirmationService;
20
+ actionLoading: boolean;
21
+ protected taskStatuses: any[];
22
+ protected taskPriorities: any[];
23
+ protected assignedToOptions: any[];
24
+ protected dateRange: {
25
+ start: Date | null;
26
+ end: Date | null;
27
+ };
28
+ constructor(router: Router, notificationService: NotificationService, utilsService: UtilsService, confirmationService: ConfirmationService);
29
+ /**
30
+ * Initialize the component and load reference data
31
+ */
32
+ ngOnInit(): void;
33
+ /**
34
+ * Load all reference data needed for the task dashboard
35
+ */
36
+ protected loadReferenceData(): void;
37
+ /**
38
+ * Create a new task
39
+ */
40
+ onCreate(): void;
41
+ /**
42
+ * Navigate to view a task
43
+ * @param item The task to view
44
+ */
45
+ onView(item: T): void;
46
+ /**
47
+ * Navigate to edit a task
48
+ * @param item The task to edit
49
+ */
50
+ onEdit(item: T): void;
51
+ /**
52
+ * Delete a task with confirmation
53
+ * @param item The task to delete
54
+ */
55
+ onDelete(item: T): void;
56
+ /**
57
+ * Navigate to a route with error handling
58
+ * @param path The route path
59
+ * @param matrixParams Optional matrix parameters
60
+ */
61
+ protected navigateTo(path: any[], matrixParams?: {
62
+ [key: string]: any;
63
+ }): void;
64
+ /**
65
+ * Validate that an item has a UUID
66
+ * @param item The item to validate
67
+ * @param action The action being performed
68
+ * @returns true if valid, false otherwise
69
+ */
70
+ protected validateItemUuid(item: T, action: string): boolean;
71
+ /**
72
+ * Override the getEntityService to include task-specific operations
73
+ */
74
+ protected abstract getEntityService(): {
75
+ getAll: (pageRequest?: any) => Observable<any>;
76
+ delete: (uuid: string) => Observable<any>;
77
+ };
78
+ /**
79
+ * Get the entity name for display in messages
80
+ */
81
+ protected abstract getEntityName(): string;
82
+ /**
83
+ * Get the route to the entity form
84
+ */
85
+ protected abstract getFormRoute(): string;
86
+ static ɵfac: i0.ɵɵFactoryDeclaration<BaseTaskDashboardComponent<any>, never>;
87
+ static ɵdir: i0.ɵɵDirectiveDeclaration<BaseTaskDashboardComponent<any>, never, never, {}, {}, never, never, true, never>;
88
+ }
@@ -0,0 +1,6 @@
1
+ import { KeycloakConfig } from './keycloak-config.interface';
2
+ import { KeycloakService } from './keycloak.service';
3
+ export declare function provideKeycloak(config: KeycloakConfig): (typeof KeycloakService | import("@angular/core").EnvironmentProviders | {
4
+ provide: import("@angular/core").InjectionToken<KeycloakConfig>;
5
+ useValue: KeycloakConfig;
6
+ })[];
@@ -1,22 +1,20 @@
1
- import { KeycloakConfig } from './keycloak-config.interface';
2
- import { Observable } from 'rxjs';
3
- import { HttpClient } from '@angular/common/http';
4
1
  import * as i0 from "@angular/core";
5
2
  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);
3
+ #private;
4
+ private readonly http;
5
+ private readonly platformId;
6
+ private readonly config;
7
+ private readonly isBrowser;
8
+ readonly isAuthenticated$: import("@angular/core").Signal<boolean>;
9
+ readonly userProfile$: import("@angular/core").Signal<any>;
10
+ private loadKeycloakScript;
11
+ private getSilentCheckUrl;
12
12
  initialize(): Promise<boolean>;
13
13
  login(options?: any): Promise<void>;
14
14
  logout(): Promise<void>;
15
- isLoggedIn(): Observable<boolean>;
16
15
  getToken(): Promise<string | null>;
17
16
  getRoles(): string[];
18
17
  hasRole(role: string): boolean;
19
- getUserProfile(): Observable<any>;
20
18
  updateToken(minValidity?: number): Promise<boolean>;
21
19
  private loadUserProfile;
22
20
  static ɵfac: i0.ɵɵFactoryDeclaration<KeycloakService, never>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@codex-ts/core-lib",
3
- "version": "1.0.13",
3
+ "version": "1.0.15",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "peerDependencies": {
@@ -25,4 +25,4 @@
25
25
  "default": "./fesm2022/codex-ts-core-lib.mjs"
26
26
  }
27
27
  }
28
- }
28
+ }
package/public-api.d.ts CHANGED
@@ -13,8 +13,8 @@ export * from './lib/models/pagination/page.interface';
13
13
  export * from './lib/models/pagination/page-request.interface';
14
14
  export { KEYCLOAK_CONFIG } from './lib/keycloak/keycloak.token';
15
15
  export * from './lib/keycloak/keycloak-config.interface';
16
- export * from './lib/keycloak/keycloak.guard';
17
16
  export * from './lib/keycloak/keycloak.service';
17
+ export { provideKeycloak } from './lib/keycloak/keycloak.providers';
18
18
  export * from './lib/services/http-utility.service';
19
19
  export * from './lib/services/utils.service';
20
20
  export * from './lib/services/notification.service';
@@ -30,6 +30,7 @@ export * from './lib/components/base-list-page.component';
30
30
  export * from './lib/components/base-tabbed-form.component';
31
31
  export * from './lib/components/base-list-tabbed-form.component';
32
32
  export * from './lib/components/base-task-details.component';
33
+ export * from './lib/components/base-task-dashboard.component';
33
34
  export * from './lib/states/form.state';
34
35
  export * from './lib/states/form-component.state';
35
36
  export * from './lib/states/tabbed-form.state';
@@ -0,0 +1,11 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>Silent SSO Check</title>
5
+ </head>
6
+ <body>
7
+ <script>
8
+ parent.postMessage(location.href, location.origin);
9
+ </script>
10
+ </body>
11
+ </html>
@@ -1,25 +0,0 @@
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
- }