@yuuvis/client-core 2.10.0 → 2.10.2

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.
@@ -2,15 +2,41 @@ import { Observable } from 'rxjs';
2
2
  import { YuvUser } from '../../model/yuv-user.model';
3
3
  import { IdmUserCache, OrganizationSetEntry } from './models';
4
4
  import * as i0 from "@angular/core";
5
+ /**
6
+ * Service for managing Identity Management (IDM) operations.
7
+ * Provides functionality for querying users, roles, and organization entities,
8
+ * with built-in caching mechanisms to optimize performance.
9
+ */
5
10
  export declare class IdmService {
6
11
  #private;
7
12
  userCache: IdmUserCache;
8
13
  constructor();
14
+ /**
15
+ * Queries organization entities (users and/or roles) based on search term.
16
+ *
17
+ * @param term - The search term to filter entities
18
+ * @param targetTypes - Array of entity types to search for ('user', 'role')
19
+ * @param size - Optional maximum number of results to return
20
+ * @returns Observable array of organization set entries matching the search criteria
21
+ */
9
22
  queryOrganizationEntity(term: string, targetTypes: string[], size?: number): Observable<OrganizationSetEntry[]>;
23
+ /**
24
+ * Retrieves available roles, optionally filtered by a search term.
25
+ *
26
+ * @param role - Optional search term to filter roles by name
27
+ * @returns Observable array of role objects containing name and description
28
+ */
10
29
  getRoles(role?: string): Observable<{
11
30
  name: string;
12
31
  description: string;
13
32
  }[]>;
33
+ /**
34
+ * Retrieves user information by user ID with automatic caching.
35
+ * Uses a 1-hour TTL cache to minimize backend requests.
36
+ *
37
+ * @param id - The unique identifier of the user
38
+ * @returns Observable of YuvUser object or null if user is not found
39
+ */
14
40
  getUserById(id: string): Observable<YuvUser | null>;
15
41
  static ɵfac: i0.ɵɵFactoryDeclaration<IdmService, never>;
16
42
  static ɵprov: i0.ɵɵInjectableDeclaration<IdmService>;
@@ -1,6 +1,11 @@
1
1
  import { IdmUserResponse } from './idm-user-response.model';
2
+ /**
3
+ * Represents a cached user entry with expiration timestamp.
4
+ * Used internally by IdmService to manage user data caching.
5
+ */
2
6
  export interface IdmCachedUser {
3
7
  /** Timestamp when the cache expires (Date.now() + TTL) */
4
8
  expires: number;
9
+ /** The cached user data from the IDM API */
5
10
  user: IdmUserResponse;
6
11
  }
@@ -1,4 +1,9 @@
1
1
  import { IdmCachedUser } from './idm-cached-user.model';
2
+ /**
3
+ * Dictionary/map structure for storing cached user data.
4
+ * Keys are user IDs and values are cached user entries with expiration.
5
+ */
2
6
  export interface IdmUserCache {
7
+ /** Map of user IDs to their cached user data */
3
8
  [userId: string]: IdmCachedUser;
4
9
  }
@@ -1,11 +1,24 @@
1
+ /**
2
+ * Represents the user data structure returned from the IDM API.
3
+ * Contains all essential user information including authentication and authorization details.
4
+ */
1
5
  export interface IdmUserResponse {
6
+ /** The unique username for login */
2
7
  username: string;
8
+ /** The unique user identifier */
3
9
  id: string;
10
+ /** The user's email address */
4
11
  email: string;
12
+ /** The user's first name */
5
13
  firstname: string;
14
+ /** The user's last name */
6
15
  lastname: string;
16
+ /** Whether the user account is enabled/active */
7
17
  enabled: boolean;
18
+ /** The tenant identifier this user belongs to */
8
19
  tenant: string;
20
+ /** Array of granted authorities/permissions for the user */
9
21
  authorities: string[];
22
+ /** The formatted display name for the user */
10
23
  displayName: string;
11
24
  }
@@ -1,5 +1,12 @@
1
+ /**
2
+ * Represents an entry in the organization set, which can be either a user or a role.
3
+ * Used in search results and organization entity queries.
4
+ */
1
5
  export interface OrganizationSetEntry {
6
+ /** The unique identifier of the user or role */
2
7
  id: string;
8
+ /** The display title/name for the entry */
3
9
  title: string;
10
+ /** The type of organization entity */
4
11
  type: 'user' | 'role';
5
12
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yuuvis/client-core",
3
- "version": "2.10.0",
3
+ "version": "2.10.2",
4
4
  "author": "OPTIMAL SYSTEMS GmbH <npm@optimal-systems.de>",
5
5
  "license": "MIT",
6
6
  "peerDependencies": {