@masterteam/users-groups 0.0.39 → 0.0.41

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@masterteam/users-groups",
3
- "version": "0.0.39",
3
+ "version": "0.0.41",
4
4
  "publishConfig": {
5
5
  "directory": "../../../dist/masterteam/users-groups",
6
6
  "linkDirectory": false,
@@ -20,9 +20,9 @@
20
20
  "tailwindcss": "^4.2.2",
21
21
  "tailwindcss-primeui": "^0.6.1",
22
22
  "@ngxs/store": "^20.1.0",
23
- "@masterteam/components": "^0.0.0-watch+1788938712186",
24
- "@masterteam/forms": "^0.0.146",
25
- "@masterteam/icons": "^0.0.17"
23
+ "@masterteam/components": "^0.0.322",
24
+ "@masterteam/icons": "^0.0.17",
25
+ "@masterteam/forms": "^0.0.167"
26
26
  },
27
27
  "sideEffects": false,
28
28
  "exports": {
@@ -33,10 +33,25 @@ interface User {
33
33
  isLinkedToCurrentApplication?: boolean;
34
34
  email?: string;
35
35
  }
36
+ /** Identity `UserReferenceDto` — a group member as the summary returns it. */
37
+ interface UserReference {
38
+ id: string;
39
+ displayName: string;
40
+ userName?: string | null;
41
+ fullName?: string | null;
42
+ photoUrl?: string | null;
43
+ email?: string | null;
44
+ phoneNumber?: string | null;
45
+ isActive?: boolean | null;
46
+ isDeleted: boolean;
47
+ isLinkedToCurrentApplication: boolean;
48
+ hasContactDetails: boolean;
49
+ }
36
50
  interface Group {
37
51
  id?: string | number;
38
52
  name?: TranslatedField | string;
39
- description?: TranslatedField | string;
53
+ /** Plain text, or `{"ar":"…","en":"…"}` JSON — see `group-description.ts`. */
54
+ description?: string;
40
55
  createdAt?: ApiDateValue;
41
56
  workspace?: any;
42
57
  members?: any[];
@@ -132,6 +147,98 @@ interface UserSummary {
132
147
  permissionsCount?: number;
133
148
  accessibilitiesCount?: number;
134
149
  }
150
+ /**
151
+ * `GET identity/groups/{groupId}/summary` — Pplus5.BE
152
+ * `Docs/Group-Access-Summary-Frontend-Contract.md`. There is no `roles` array:
153
+ * a group's permissions are its own assignments, not a union of its members'.
154
+ */
155
+ interface GroupAccessSummary {
156
+ group: Group;
157
+ members: UserReference[];
158
+ permissions: Permission[];
159
+ accessibilities: Accessibility[];
160
+ usageSummary: IdentityPrincipalUsageSummary;
161
+ membersCount: number;
162
+ permissionsCount: number;
163
+ accessibilitiesCount: number;
164
+ usagesCount: number;
165
+ }
166
+ interface IdentityPrincipalUsageSummary {
167
+ items: IdentityPrincipalUsage[];
168
+ /** Usage-row counts, not distinct sources — never add two dictionaries up. */
169
+ countBySource: Record<string, number>;
170
+ countByUsageType: Record<string, number>;
171
+ countByCategory: Record<string, number>;
172
+ runtimeImpact: IdentityPrincipalRuntimeImpact;
173
+ warnings: IdentityPrincipalUsageWarning[];
174
+ count: number;
175
+ blockingUsagesCount: number;
176
+ canDeletePrincipal: boolean;
177
+ canDisablePrincipal: boolean;
178
+ }
179
+ /**
180
+ * One configuration reference to the principal. `source`, `usageType` and
181
+ * `usageCategory` are open-ended strings: the backend adds new values without
182
+ * a contract change, so render unknown ones instead of rejecting them.
183
+ */
184
+ interface IdentityPrincipalUsage {
185
+ principalType: string;
186
+ principalId: string;
187
+ source: string;
188
+ usageType: string;
189
+ usageCategory: string;
190
+ /** Source definition id — several rows can share it, never a row key alone. */
191
+ sourceId: number | null;
192
+ /** Plain text, or a JSON-encoded `{ ar, en }` object for workflow names. */
193
+ sourceName: string;
194
+ stepId: number | null;
195
+ stepName: string | null;
196
+ stepType: string | null;
197
+ targetType: string | null;
198
+ targetValue: string | null;
199
+ matchedBy: string;
200
+ resolutionStatus: string;
201
+ scopeResolutionStatus: string;
202
+ resolutionMode: string;
203
+ effectiveUsersCount: number;
204
+ /** At most the first five members — not the full list. */
205
+ effectiveUsersPreview: UserReference[];
206
+ moduleType: string;
207
+ moduleId: number | null;
208
+ levelId: number | null;
209
+ levelModuleId: number | null;
210
+ command: string | null;
211
+ scope: PermissionScope | null;
212
+ relatedScopes: PermissionScope[];
213
+ /** Configured content (`app` / `email` / `sms`), not proof of delivery. */
214
+ channels: string[];
215
+ runtimeImpact: IdentityPrincipalRuntimeImpact;
216
+ warnings: IdentityPrincipalUsageWarning[];
217
+ isBlocking: boolean;
218
+ canDeletePrincipal: boolean;
219
+ canDisablePrincipal: boolean;
220
+ /** Source-specific strings — `isPublished` is `"True"`/`"False"`, not a boolean. */
221
+ metadata: Record<string, string>;
222
+ }
223
+ /** Summed per usage row — an impact indicator, never a distinct-record count. */
224
+ interface IdentityPrincipalRuntimeImpact {
225
+ activeRequestsCount: number;
226
+ pendingStepsCount: number;
227
+ activeEscalationsCount: number;
228
+ pendingEscalationStepsCount: number;
229
+ activeAlertStatesCount: number;
230
+ totalInstancesCount: number;
231
+ metrics: Record<string, number>;
232
+ }
233
+ interface IdentityPrincipalUsageWarning {
234
+ code: string;
235
+ severity: string;
236
+ /** English literal from the backend; the fallback when `code` is unknown. */
237
+ message: string;
238
+ source: string;
239
+ usageType: string;
240
+ sourceId: number | null;
241
+ }
135
242
  interface TranslatedField {
136
243
  display?: string;
137
244
  en?: string;
@@ -143,12 +250,15 @@ interface ApiDateValue {
143
250
  }
144
251
  declare enum UsersGroupsActionKey {
145
252
  GetUsers = "getUsers",
253
+ GetUserLockStatuses = "getUserLockStatuses",
254
+ UnlockUser = "unlockUser",
146
255
  GetUser = "getUser",
147
256
  CreateUser = "createUser",
148
257
  UpdateUser = "updateUser",
149
258
  DeleteUser = "deleteUser",
150
259
  LinkUserToApplication = "linkUserToApplication",
151
260
  GetUserSummary = "getUserSummary",
261
+ GetGroupSummary = "getGroupSummary",
152
262
  AddUserToGroup = "addUserToGroup",
153
263
  DeleteUserFromGroup = "deleteUserFromGroup",
154
264
  GetGroups = "getGroups",
@@ -160,16 +270,38 @@ declare enum UsersGroupsActionKey {
160
270
  }
161
271
  interface UsersGroupsStateModel extends LoadingStateShape<UsersGroupsActionKey> {
162
272
  users: User[];
273
+ unlockableUserIds: string[];
274
+ unlockResponses: Record<string, UserUnlockResponse>;
163
275
  selectedUser: User | null;
164
276
  userSummary: UserSummary | null;
277
+ groupSummary: GroupAccessSummary | null;
165
278
  groups: Group[];
166
279
  selectedGroup: Group | null;
167
280
  }
281
+ interface UserLockStatus {
282
+ userId: string;
283
+ isLocked: boolean;
284
+ canUnlock: boolean;
285
+ }
286
+ interface UserUnlockResponse {
287
+ appliesToAllApplications: boolean;
288
+ message: string;
289
+ }
168
290
  interface ResetUserPasswordPayload {
169
291
  userName: string;
170
292
  newPassword: string;
171
293
  }
172
294
 
295
+ declare class GetUserLockStatuses {
296
+ userIds: string[];
297
+ static readonly type = "[UsersGroups] Get User Lock Statuses";
298
+ constructor(userIds: string[]);
299
+ }
300
+ declare class UnlockUser {
301
+ userId: string;
302
+ static readonly type = "[UsersGroups] Unlock User";
303
+ constructor(userId: string);
304
+ }
173
305
  declare class GetUsers {
174
306
  static readonly type = "[UsersGroups] Get Users";
175
307
  }
@@ -215,6 +347,11 @@ declare class GetUserSummary {
215
347
  static readonly type = "[UsersGroups] Get User Summary";
216
348
  constructor(userName: string);
217
349
  }
350
+ declare class GetGroupSummary {
351
+ groupId: string | number;
352
+ static readonly type = "[UsersGroups] Get Group Summary";
353
+ constructor(groupId: string | number);
354
+ }
218
355
  declare class ResetUserPassword {
219
356
  id: string | number;
220
357
  payload: ResetUserPasswordPayload;
@@ -256,18 +393,25 @@ declare class DeleteGroup {
256
393
 
257
394
  declare class UsersGroupsFacade {
258
395
  private readonly store;
396
+ readonly unlockableUserIds: _angular_core.Signal<string[]>;
397
+ readonly unlockResponses: _angular_core.Signal<Record<string, _masterteam_users_groups.UserUnlockResponse>>;
259
398
  readonly users: _angular_core.Signal<User[]>;
260
399
  readonly selectedUser: _angular_core.Signal<User | null>;
261
400
  readonly userSummary: _angular_core.Signal<_masterteam_users_groups.UserSummary | null>;
401
+ readonly groupSummary: _angular_core.Signal<_masterteam_users_groups.GroupAccessSummary | null>;
262
402
  readonly groups: _angular_core.Signal<Group[]>;
263
403
  readonly selectedGroup: _angular_core.Signal<Group | null>;
264
404
  private readonly loadingActive;
405
+ private readonly errors;
265
406
  readonly isLoadingUsers: _angular_core.Signal<boolean>;
266
407
  readonly isLoadingUser: _angular_core.Signal<boolean>;
267
408
  readonly isSavingUser: _angular_core.Signal<boolean>;
268
409
  readonly isDeletingUser: _angular_core.Signal<boolean>;
269
410
  readonly isLinkingUserToApplication: _angular_core.Signal<boolean>;
270
411
  readonly isLoadingUserSummary: _angular_core.Signal<boolean>;
412
+ readonly userSummaryError: _angular_core.Signal<string | null>;
413
+ readonly isLoadingGroupSummary: _angular_core.Signal<boolean>;
414
+ readonly groupSummaryError: _angular_core.Signal<string | null>;
271
415
  readonly isLoadingGroups: _angular_core.Signal<boolean>;
272
416
  readonly isLoadingGroup: _angular_core.Signal<boolean>;
273
417
  readonly isSavingGroup: _angular_core.Signal<boolean>;
@@ -275,6 +419,7 @@ declare class UsersGroupsFacade {
275
419
  readonly isAddingUserToGroup: _angular_core.Signal<boolean>;
276
420
  readonly isDeletingUserFromGroup: _angular_core.Signal<boolean>;
277
421
  readonly isResettingPassword: _angular_core.Signal<boolean>;
422
+ unlockUser(userId: string): rxjs.Observable<void>;
278
423
  getUsers(): rxjs.Observable<void>;
279
424
  getUser(id: string | null): rxjs.Observable<void>;
280
425
  createUser(payload: Partial<User>): rxjs.Observable<void>;
@@ -284,6 +429,7 @@ declare class UsersGroupsFacade {
284
429
  deleteUser(userName: string | number): rxjs.Observable<void>;
285
430
  linkUserToApplication(userName: string | number): rxjs.Observable<void>;
286
431
  getUserSummary(userName: string): rxjs.Observable<void>;
432
+ getGroupSummary(groupId: string | number): rxjs.Observable<void>;
287
433
  resetUserPassword(id: string | number, payload: ResetUserPasswordPayload): rxjs.Observable<void>;
288
434
  getGroups(): rxjs.Observable<void>;
289
435
  getGroup(id: string | number | null): rxjs.Observable<void>;
@@ -310,13 +456,18 @@ declare class UsersGroupsState extends CrudStateBase<any, UsersGroupsStateModel,
310
456
  private http;
311
457
  context: HttpContext;
312
458
  private encodeUserName;
459
+ static unlockableUserIds(state: UsersGroupsStateModel): string[];
460
+ static unlockResponses(state: UsersGroupsStateModel): Record<string, UserUnlockResponse>;
313
461
  static getUsers(state: UsersGroupsStateModel): User[];
314
462
  static getSelectedUser(state: UsersGroupsStateModel): User | null;
315
463
  static getUserSummary(state: UsersGroupsStateModel): UserSummary | null;
464
+ static getGroupSummary(state: UsersGroupsStateModel): GroupAccessSummary | null;
316
465
  static getGroups(state: UsersGroupsStateModel): Group[];
317
466
  static getSelectedGroup(state: UsersGroupsStateModel): Group | null;
318
467
  static getLoadingActive(state: UsersGroupsStateModel): string[];
319
468
  static getErrors(state: UsersGroupsStateModel): Record<string, string | null>;
469
+ getUserLockStatuses(ctx: StateContext<UsersGroupsStateModel>, { userIds }: GetUserLockStatuses): rxjs.Observable<UserLockStatus[][] | undefined>;
470
+ unlockUser(ctx: StateContext<UsersGroupsStateModel>, { userId }: UnlockUser): rxjs.Observable<Response<UserUnlockResponse>>;
320
471
  getUsers(ctx: StateContext<UsersGroupsStateModel>): rxjs.Observable<Response<User[]>>;
321
472
  getUser(ctx: StateContext<UsersGroupsStateModel>, { userName }: GetUser): rxjs.Observable<Response<User>>;
322
473
  createUser(ctx: StateContext<UsersGroupsStateModel>, { payload }: CreateUser): rxjs.Observable<Response<User>>;
@@ -325,6 +476,7 @@ declare class UsersGroupsState extends CrudStateBase<any, UsersGroupsStateModel,
325
476
  deleteUser(ctx: StateContext<UsersGroupsStateModel>, { userName }: DeleteUser): rxjs.Observable<Response<void>>;
326
477
  linkUserToApplication(ctx: StateContext<UsersGroupsStateModel>, { userName }: LinkUserToApplication): rxjs.Observable<Response<User | null>>;
327
478
  getUserSummary(ctx: StateContext<UsersGroupsStateModel>, { userName }: GetUserSummary): rxjs.Observable<Response<UserSummary>>;
479
+ getGroupSummary(ctx: StateContext<UsersGroupsStateModel>, { groupId }: GetGroupSummary): rxjs.Observable<Response<GroupAccessSummary>>;
328
480
  resetUserPassword(ctx: StateContext<UsersGroupsStateModel>, { id, payload }: ResetUserPassword): rxjs.Observable<Response<void>>;
329
481
  deleteUserFromGroup(ctx: StateContext<UsersGroupsStateModel>, { payload }: DeleteUserFromGroup): rxjs.Observable<Response<void>>;
330
482
  getGroups(ctx: StateContext<UsersGroupsStateModel>): rxjs.Observable<Response<Group[]>>;
@@ -360,10 +512,12 @@ declare class UsersGroups implements OnInit {
360
512
  declare class Users implements OnInit {
361
513
  typeCol: _angular_core.Signal<TemplateRef<any>>;
362
514
  applicationLinkCol: _angular_core.Signal<TemplateRef<any>>;
515
+ emailCol: _angular_core.Signal<TemplateRef<any>>;
363
516
  private readonly facade;
517
+ private readonly toast;
364
518
  readonly modal: ModalService;
365
519
  private readonly translocoService;
366
- users: _angular_core.Signal<_masterteam_users_groups.User[]>;
520
+ users: _angular_core.Signal<User[]>;
367
521
  tabs: _angular_core.Signal<{
368
522
  label: string;
369
523
  value: string;
@@ -373,18 +527,20 @@ declare class Users implements OnInit {
373
527
  tableActions: _angular_core.WritableSignal<TableAction[]>;
374
528
  deletingRowIds: _angular_core.WritableSignal<any[]>;
375
529
  linkingRowIds: _angular_core.WritableSignal<any[]>;
530
+ unlockingRowIds: _angular_core.WritableSignal<string[]>;
376
531
  rowActions: _angular_core.WritableSignal<TableAction[]>;
377
532
  tableColumns: _angular_core.WritableSignal<ColumnDef[]>;
378
533
  loading: _angular_core.Signal<boolean>;
379
534
  private allUsers;
380
- activeUsers: _angular_core.Signal<_masterteam_users_groups.User[]>;
535
+ activeUsers: _angular_core.Signal<User[]>;
381
536
  ngOnInit(): void;
537
+ unlockUser(user: User): void;
382
538
  isLinkedToCurrentApplication(user: any): boolean;
383
539
  linkUserToApplication(user: any): void;
384
540
  unlinkUserFromApplication(user: any): void;
385
541
  addUserDialog(user?: any | null): void;
386
542
  addResetPasswordDialog(user: any): void;
387
- openLinkedGroupsDialog(user: any): void;
543
+ openAccessSummary(user: any): void;
388
544
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<Users, never>;
389
545
  static ɵcmp: _angular_core.ɵɵComponentDeclaration<Users, "mt-users", never, {}, {}, never, never, true, never>;
390
546
  }
@@ -402,6 +558,7 @@ declare class Groups implements OnInit {
402
558
  allGroups: _angular_core.Signal<_masterteam_users_groups.Group[]>;
403
559
  ngOnInit(): void;
404
560
  addGroupDialog(group?: any | null): void;
561
+ openAccessSummary(group: any): void;
405
562
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<Groups, never>;
406
563
  static ɵcmp: _angular_core.ɵɵComponentDeclaration<Groups, "mt-groups", never, {}, {}, never, never, true, never>;
407
564
  }
@@ -430,7 +587,7 @@ declare class UserForm implements OnInit {
430
587
  context: HttpContext;
431
588
  contextGatway: HttpContext;
432
589
  internalUserFormConfig: _angular_core.WritableSignal<DynamicFormConfig>;
433
- fieldColSpan: _angular_core.Signal<12 | 6>;
590
+ fieldColSpan: _angular_core.Signal<6 | 12>;
434
591
  externalUserFormConfig: _angular_core.Signal<DynamicFormConfig>;
435
592
  constructor();
436
593
  ngOnInit(): void;
@@ -471,5 +628,5 @@ declare class GroupForm implements OnInit {
471
628
  static ɵcmp: _angular_core.ɵɵComponentDeclaration<GroupForm, "mt-group-form", never, { "groupForEdit": { "alias": "groupForEdit"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
472
629
  }
473
630
 
474
- export { AddUserToGroup, ClearSelectedGroup, CreateGroup, CreateUser, DeleteGroup, DeleteUser, DeleteUserFromGroup, GetGroup, GetGroups, GetUser, GetUserSummary, GetUsers, GroupForm, Groups, LinkUserToApplication, ResetUserPassword, UpdateGroup, UpdateUser, UserForm, Users, UsersGroups, UsersGroupsActionKey, UsersGroupsFacade, UsersGroupsState };
475
- export type { Accessibility, ApiDateValue, Group, Permission, PermissionScope, ResetUserPasswordPayload, Role, RoleLevelDataAssignment, RoleScope, RoleScopeLevel, RoleScopeModule, TranslatedField, User, UserSummary, UsersGroupsStateModel };
631
+ export { AddUserToGroup, ClearSelectedGroup, CreateGroup, CreateUser, DeleteGroup, DeleteUser, DeleteUserFromGroup, GetGroup, GetGroupSummary, GetGroups, GetUser, GetUserLockStatuses, GetUserSummary, GetUsers, GroupForm, Groups, LinkUserToApplication, ResetUserPassword, UnlockUser, UpdateGroup, UpdateUser, UserForm, Users, UsersGroups, UsersGroupsActionKey, UsersGroupsFacade, UsersGroupsState };
632
+ export type { Accessibility, ApiDateValue, Group, GroupAccessSummary, IdentityPrincipalRuntimeImpact, IdentityPrincipalUsage, IdentityPrincipalUsageSummary, IdentityPrincipalUsageWarning, Permission, PermissionScope, ResetUserPasswordPayload, Role, RoleLevelDataAssignment, RoleScope, RoleScopeLevel, RoleScopeModule, TranslatedField, User, UserLockStatus, UserReference, UserSummary, UserUnlockResponse, UsersGroupsStateModel };