@yuuvis/client-core 2.10.0 → 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/fesm2022/yuuvis-client-core.mjs +27 -1
- package/fesm2022/yuuvis-client-core.mjs.map +1 -1
- package/lib/service/idm/idm.service.d.ts +26 -0
- package/lib/service/idm/models/idm-cached-user.model.d.ts +5 -0
- package/lib/service/idm/models/idm-user-cache.model.d.ts +5 -0
- package/lib/service/idm/models/idm-user-response.model.d.ts +13 -0
- package/lib/service/idm/models/organization-set-entry.model.d.ts +7 -0
- package/package.json +1 -1
|
@@ -2280,7 +2280,7 @@ class EventService {
|
|
|
2280
2280
|
this.#customEvents.push(CUSTOM_YUV_EVENT_PREFIX);
|
|
2281
2281
|
if (!event.data || typeof event.data !== 'object')
|
|
2282
2282
|
return false;
|
|
2283
|
-
if (!this.#startsWithAllowed(event.data.source) ||
|
|
2283
|
+
if (!(this.#startsWithAllowed(event.data.source) || this.#startsWithAllowed(event.data.type)))
|
|
2284
2284
|
return false;
|
|
2285
2285
|
// Accept messages from trusted origins
|
|
2286
2286
|
this.#customEventsTrustedOrigins.push(window.location.origin);
|
|
@@ -4211,6 +4211,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImpo
|
|
|
4211
4211
|
}]
|
|
4212
4212
|
}] });
|
|
4213
4213
|
|
|
4214
|
+
/**
|
|
4215
|
+
* Service for managing Identity Management (IDM) operations.
|
|
4216
|
+
* Provides functionality for querying users, roles, and organization entities,
|
|
4217
|
+
* with built-in caching mechanisms to optimize performance.
|
|
4218
|
+
*/
|
|
4214
4219
|
class IdmService {
|
|
4215
4220
|
#backend;
|
|
4216
4221
|
#clientCache;
|
|
@@ -4224,6 +4229,14 @@ class IdmService {
|
|
|
4224
4229
|
this.userCache = {};
|
|
4225
4230
|
this.#loadIdmCache();
|
|
4226
4231
|
}
|
|
4232
|
+
/**
|
|
4233
|
+
* Queries organization entities (users and/or roles) based on search term.
|
|
4234
|
+
*
|
|
4235
|
+
* @param term - The search term to filter entities
|
|
4236
|
+
* @param targetTypes - Array of entity types to search for ('user', 'role')
|
|
4237
|
+
* @param size - Optional maximum number of results to return
|
|
4238
|
+
* @returns Observable array of organization set entries matching the search criteria
|
|
4239
|
+
*/
|
|
4227
4240
|
queryOrganizationEntity(term, targetTypes, size) {
|
|
4228
4241
|
const searchParams = new URLSearchParams();
|
|
4229
4242
|
searchParams.set('search', term);
|
|
@@ -4245,11 +4258,24 @@ class IdmService {
|
|
|
4245
4258
|
: [])
|
|
4246
4259
|
]));
|
|
4247
4260
|
}
|
|
4261
|
+
/**
|
|
4262
|
+
* Retrieves available roles, optionally filtered by a search term.
|
|
4263
|
+
*
|
|
4264
|
+
* @param role - Optional search term to filter roles by name
|
|
4265
|
+
* @returns Observable array of role objects containing name and description
|
|
4266
|
+
*/
|
|
4248
4267
|
getRoles(role) {
|
|
4249
4268
|
const searchParams = new URLSearchParams();
|
|
4250
4269
|
role && searchParams.set('search', role);
|
|
4251
4270
|
return this.#backend.get(`/idm/roles?${searchParams.toString()}`).pipe(catchError$1(() => of([])));
|
|
4252
4271
|
}
|
|
4272
|
+
/**
|
|
4273
|
+
* Retrieves user information by user ID with automatic caching.
|
|
4274
|
+
* Uses a 1-hour TTL cache to minimize backend requests.
|
|
4275
|
+
*
|
|
4276
|
+
* @param id - The unique identifier of the user
|
|
4277
|
+
* @returns Observable of YuvUser object or null if user is not found
|
|
4278
|
+
*/
|
|
4253
4279
|
getUserById(id) {
|
|
4254
4280
|
const cachedUser = this.userCache[id];
|
|
4255
4281
|
const isCacheValid = cachedUser && Date.now() < cachedUser.expires;
|