@yuuvis/client-core 2.9.2 → 2.10.1

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,7 +1,7 @@
1
1
  export { TranslateDirective, TranslateLoader, TranslateModule, TranslatePipe, TranslateService } from '@ngx-translate/core';
2
2
  export * from './lib/model/dms-object.interface';
3
- export * from './lib/model/object-flavor.interface';
4
3
  export * from './lib/model/dms-object.model';
4
+ export * from './lib/model/object-flavor.interface';
5
5
  export * from './lib/model/range-value.interface';
6
6
  export * from './lib/model/yuv-error.model';
7
7
  export * from './lib/model/yuv-user.model';
@@ -12,11 +12,13 @@ export * from './lib/service/auth/auth.service';
12
12
  export * from './lib/service/backend/api.enum';
13
13
  export * from './lib/service/backend/backend.interface';
14
14
  export * from './lib/service/backend/backend.service';
15
- export * from './lib/service/bpm/bpm.service';
16
15
  export * from './lib/service/bpm/bpm.interface';
16
+ export * from './lib/service/bpm/bpm.service';
17
17
  export * from './lib/service/cache/app-cache.service';
18
18
  export * from './lib/service/catalog/catalog.interface';
19
19
  export * from './lib/service/catalog/catalog.service';
20
+ export * from './lib/service/client-cache/client-cache.interface';
21
+ export * from './lib/service/client-cache/client-cache.service';
20
22
  export * from './lib/service/clipboard/clipboard.interface';
21
23
  export * from './lib/service/clipboard/clipboard.service';
22
24
  export * from './lib/service/config/config.interface';
@@ -25,31 +27,31 @@ export * from './lib/service/config/core-config';
25
27
  export * from './lib/service/config/core-config.tokens';
26
28
  export * from './lib/service/connection/connection.service';
27
29
  export * from './lib/service/core-init/core-init.service';
28
- export * from './lib/service/device/device.service';
29
30
  export * from './lib/service/device/device.interface';
31
+ export * from './lib/service/device/device.service';
30
32
  export * from './lib/service/dms/dms.service';
31
33
  export * from './lib/service/dms/dms.service.interface';
32
34
  export * from './lib/service/event/event.interface';
33
35
  export * from './lib/service/event/event.service';
34
36
  export * from './lib/service/event/events';
35
- export * from './lib/service/idm/idm.interface';
37
+ export * from './lib/service/idm/models';
36
38
  export * from './lib/service/idm/idm.service';
37
- export * from './lib/service/logger/logger.service';
38
39
  export * from './lib/service/logger/logger.interface';
40
+ export * from './lib/service/logger/logger.service';
39
41
  export * from './lib/service/notification/notification.service';
40
42
  export * from './lib/service/object-config/object-config.interface';
41
43
  export * from './lib/service/object-config/object-config.service';
44
+ export * from './lib/service/object-form/object-form.interface';
45
+ export * from './lib/service/object-form/object-form.model';
42
46
  export * from './lib/service/pending-changes';
43
47
  export * from './lib/service/prediction/prediction.interface';
44
48
  export * from './lib/service/prediction/prediction.service';
45
- export * from './lib/service/retention/retention.service';
46
49
  export * from './lib/service/retention/retention.interface';
50
+ export * from './lib/service/retention/retention.service';
47
51
  export * from './lib/service/search/search.service';
48
- export * from './lib/service/search/search.utils';
49
52
  export * from './lib/service/search/search.service.interface';
53
+ export * from './lib/service/search/search.utils';
50
54
  export * from './lib/service/session-storage/session-storage.service';
51
- export * from './lib/service/object-form/object-form.interface';
52
- export * from './lib/service/object-form/object-form.model';
53
55
  export * from './lib/service/system/system.enum';
54
56
  export * from './lib/service/system/system.interface';
55
57
  export * from './lib/service/system/system.service';
@@ -57,9 +59,9 @@ export * from './lib/service/toast/toast.interface';
57
59
  export * from './lib/service/toast/toast.service';
58
60
  export * from './lib/service/upload/upload.interface';
59
61
  export * from './lib/service/upload/upload.service';
60
- export * from './lib/service/user/user.service';
61
- export * from './lib/service/user/user.providers';
62
62
  export * from './lib/service/user/user-storage.service';
63
+ export * from './lib/service/user/user.providers';
64
+ export * from './lib/service/user/user.service';
63
65
  export * from './lib/util/utils';
64
66
  export * from './lib/util/utils.helper.enum';
65
67
  export * from './lib/common/pipes';
@@ -1,3 +1,4 @@
1
+ import { IdmUserResponse } from "../service/idm/models";
1
2
  /**
2
3
  * User account configuration
3
4
  */
@@ -9,11 +10,8 @@ export declare class YuvUser {
9
10
  lastname: string;
10
11
  title: string;
11
12
  email: string;
12
- image: string;
13
13
  tenant: string;
14
- domain: string;
15
14
  authorities: string[];
16
- substituteOf: string[];
17
15
  enabled: boolean;
18
16
  /**
19
17
  * User settings
@@ -26,7 +24,7 @@ export declare class YuvUser {
26
24
  /**
27
25
  * @ignore
28
26
  */
29
- constructor(json: any, userSettings?: UserSettings);
27
+ constructor(json: IdmUserResponse, userSettings?: UserSettings);
30
28
  /**
31
29
  * Gets the users configured client locale
32
30
  * @returns locale string
@@ -7,8 +7,7 @@ import * as i0 from "@angular/core";
7
7
  * Service for http communication with the yuuvis Momentum backend. Apps
8
8
  * should use this service to communicate with the backend instead of default
9
9
  * httpClient because required headers are managed and apps do not have
10
- * to care about preqrequisits.
11
- *
10
+ * to care about prerequisites.
12
11
  */
13
12
  export declare class BackendService {
14
13
  #private;
@@ -31,7 +30,7 @@ export declare class BackendService {
31
30
  * @param requestOptions Additional request options
32
31
  * @returns The data retrieved from the given endpoint
33
32
  */
34
- get(uri: string, base?: string, requestOptions?: HttpOptions): Observable<any>;
33
+ get<T = any>(uri: string, base?: string, requestOptions?: HttpOptions): Observable<T>;
35
34
  /**
36
35
  * Wrapped HTTP POST method
37
36
  * @param uri The target REST URI
@@ -40,7 +39,7 @@ export declare class BackendService {
40
39
  * @param requestOptions Additional request options
41
40
  * @returns The return value of the target POST endpoint
42
41
  */
43
- post(uri: string, data?: any, base?: string, requestOptions?: HttpOptions): Observable<any>;
42
+ post<T = any>(uri: string, data?: any, base?: string, requestOptions?: HttpOptions): Observable<T>;
44
43
  /**
45
44
  * Performs a multipart form data POST request.
46
45
  * @param uri The target REST URI
@@ -58,7 +57,7 @@ export declare class BackendService {
58
57
  * @param requestOptions Additional request options
59
58
  * @returns The return value of the target PATCH endpoint
60
59
  */
61
- patch(uri: string, data?: any, base?: string, requestOptions?: HttpOptions): Observable<any>;
60
+ patch<T = any>(uri: string, data?: any, base?: string, requestOptions?: HttpOptions): Observable<T>;
62
61
  /**
63
62
  * Wrapped HTTP PUT method
64
63
  * @param uri The target REST URI
@@ -67,7 +66,7 @@ export declare class BackendService {
67
66
  * @param requestOptions Additional request options
68
67
  * @returns The return value of the target PUT endpoint
69
68
  */
70
- put(uri: string, data?: any, base?: string, requestOptions?: HttpOptions): Observable<any>;
69
+ put<T = any>(uri: string, data?: any, base?: string, requestOptions?: HttpOptions): Observable<T>;
71
70
  /**
72
71
  * Wrapped HTTP DELETE method
73
72
  * @param uri The target REST URI
@@ -75,7 +74,7 @@ export declare class BackendService {
75
74
  * @param requestOptions Additional request options
76
75
  * @returns The return value of the target DELETE endpoint
77
76
  */
78
- delete(uri: string, base?: string, requestOptions?: HttpDeleteOptions): Observable<any>;
77
+ delete<T = any>(uri: string, base?: string, requestOptions?: HttpDeleteOptions): Observable<T>;
79
78
  /**
80
79
  * @ignore
81
80
  * Cache for small requests like icons and configs
@@ -7,10 +7,35 @@ import * as i0 from "@angular/core";
7
7
  */
8
8
  export declare class AppCacheService {
9
9
  #private;
10
- setItem(key: string, value: any): Observable<boolean>;
10
+ /**
11
+ * Set item in storage.
12
+ * @param key The key under which the value is stored.
13
+ * @param value The value to store.
14
+ * @returns An Observable that emits true when the operation is successful.
15
+ */
16
+ setItem<T = any>(key: string, value: T): Observable<boolean>;
17
+ /**
18
+ * Get item from storage.
19
+ * @param key The key of the item to retrieve.
20
+ * @returns An Observable that emits the retrieved value.
21
+ */
11
22
  getItem<T = any>(key: string): Observable<T>;
23
+ /**
24
+ * Remove item from storage.
25
+ * @param key The key of the item to remove.
26
+ * @returns An Observable that emits true when the operation is successful.
27
+ */
12
28
  removeItem(key: string): Observable<boolean>;
29
+ /**
30
+ * Clear storage, optionally filtered by a function.
31
+ * @param filter A function to filter which keys to clear.
32
+ * @returns An Observable that emits true when the operation is successful.
33
+ */
13
34
  clear(filter?: (key: any) => boolean): Observable<boolean>;
35
+ /**
36
+ * Get all storage keys.
37
+ * @returns An Observable that emits an array of all storage keys.
38
+ */
14
39
  getStorageKeys(): Observable<string[]>;
15
40
  setStorage(options: any): Observable<any>;
16
41
  static ɵfac: i0.ɵɵFactoryDeclaration<AppCacheService, never>;
@@ -0,0 +1,5 @@
1
+ export interface CacheEntry<T> {
2
+ expires?: number;
3
+ id: string;
4
+ data: T;
5
+ }
@@ -0,0 +1,35 @@
1
+ import { Observable } from 'rxjs';
2
+ import { CacheEntry } from './client-cache.interface';
3
+ import * as i0 from "@angular/core";
4
+ /**
5
+ * Service for client-side caching of data with expiry handling.
6
+ * Provides methods to get, update, and invalidate cache entries.
7
+ */
8
+ export declare class ClientCacheService {
9
+ #private;
10
+ /**
11
+ * Get cached entry by ID.
12
+ * @param id The ID of the cache entry.
13
+ * @param keepIfExpired Whether to return/keep the entry even if it is expired.
14
+ * @returns The cached data or null if not found/expired.
15
+ */
16
+ getFromCache<T>(id: string, keepIfExpired?: boolean): Observable<T | null>;
17
+ /**
18
+ * Update or add cache entry.
19
+ * @param id The ID of the cache entry.
20
+ * @param data The data to cache.
21
+ * @param ttl TimeToLeave - The cache expiry time in milliseconds (how long to keep the cache entry valid).
22
+ */
23
+ updateCache<T>(id: string, data: T, ttl?: number): Observable<CacheEntry<T>>;
24
+ /**
25
+ * Invalidate cache entry by ID. This will remove the entry from the cache.
26
+ * @param id The ID of the cache entry to invalidate.
27
+ */
28
+ invalidateCache(id: string): Observable<boolean>;
29
+ /**
30
+ * Clear all client cache entries.
31
+ */
32
+ clear(): Observable<boolean>;
33
+ static ɵfac: i0.ɵɵFactoryDeclaration<ClientCacheService, never>;
34
+ static ɵprov: i0.ɵɵInjectableDeclaration<ClientCacheService>;
35
+ }
@@ -1,14 +1,42 @@
1
1
  import { Observable } from 'rxjs';
2
- import { OrganizationSetEntry } from './idm.interface';
3
2
  import { YuvUser } from '../../model/yuv-user.model';
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;
12
+ userCache: IdmUserCache;
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
+ */
7
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
+ */
8
29
  getRoles(role?: string): Observable<{
9
30
  name: string;
10
31
  description: string;
11
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
+ */
12
40
  getUserById(id: string): Observable<YuvUser | null>;
13
41
  static ɵfac: i0.ɵɵFactoryDeclaration<IdmService, never>;
14
42
  static ɵprov: i0.ɵɵInjectableDeclaration<IdmService>;
@@ -0,0 +1,11 @@
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
+ */
6
+ export interface IdmCachedUser {
7
+ /** Timestamp when the cache expires (Date.now() + TTL) */
8
+ expires: number;
9
+ /** The cached user data from the IDM API */
10
+ user: IdmUserResponse;
11
+ }
@@ -0,0 +1,9 @@
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
+ */
6
+ export interface IdmUserCache {
7
+ /** Map of user IDs to their cached user data */
8
+ [userId: string]: IdmCachedUser;
9
+ }
@@ -0,0 +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
+ */
5
+ export interface IdmUserResponse {
6
+ /** The unique username for login */
7
+ username: string;
8
+ /** The unique user identifier */
9
+ id: string;
10
+ /** The user's email address */
11
+ email: string;
12
+ /** The user's first name */
13
+ firstname: string;
14
+ /** The user's last name */
15
+ lastname: string;
16
+ /** Whether the user account is enabled/active */
17
+ enabled: boolean;
18
+ /** The tenant identifier this user belongs to */
19
+ tenant: string;
20
+ /** Array of granted authorities/permissions for the user */
21
+ authorities: string[];
22
+ /** The formatted display name for the user */
23
+ displayName: string;
24
+ }
@@ -0,0 +1,4 @@
1
+ export * from './organization-set-entry.model';
2
+ export * from './idm-user-cache.model';
3
+ export * from './idm-cached-user.model';
4
+ export * from './idm-user-response.model';
@@ -0,0 +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
+ */
5
+ export interface OrganizationSetEntry {
6
+ /** The unique identifier of the user or role */
7
+ id: string;
8
+ /** The display title/name for the entry */
9
+ title: string;
10
+ /** The type of organization entity */
11
+ type: 'user' | 'role';
12
+ }
@@ -23,7 +23,7 @@ export declare class SearchService {
23
23
  * @param size The number of items to return
24
24
  * @returns Observable of a SearchResult
25
25
  */
26
- searchCmis(statement: string, size?: number): Observable<SearchResult>;
26
+ searchCmis(statement: string, size?: number, includePermissions?: boolean): Observable<SearchResult>;
27
27
  /**
28
28
  * Fetch aggragations for a given query.
29
29
  * @param q The query
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yuuvis/client-core",
3
- "version": "2.9.2",
3
+ "version": "2.10.1",
4
4
  "author": "OPTIMAL SYSTEMS GmbH <npm@optimal-systems.de>",
5
5
  "license": "MIT",
6
6
  "peerDependencies": {
@@ -1,5 +0,0 @@
1
- export interface OrganizationSetEntry {
2
- id: string;
3
- title: string;
4
- type: 'user' | 'role';
5
- }