@masterteam/delegations 0.0.14 → 0.0.16

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/delegations",
3
- "version": "0.0.14",
3
+ "version": "0.0.16",
4
4
  "publishConfig": {
5
5
  "directory": "../../../dist/masterteam/delegations",
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/icons": "^0.0.15",
24
23
  "@masterteam/forms": "^0.0.80",
25
- "@masterteam/components": "^0.0.174"
24
+ "@masterteam/components": "^0.0.174",
25
+ "@masterteam/icons": "^0.0.15"
26
26
  },
27
27
  "sideEffects": false,
28
28
  "exports": {
@@ -83,6 +83,8 @@ interface DelegationScopeAction {
83
83
  isDelegableSnapshot?: boolean;
84
84
  }
85
85
  interface DelegationGrant {
86
+ /** Optional backend-provided stable grant identity; preferred for de-dup when present. */
87
+ key?: string;
86
88
  applicationKey: string;
87
89
  target: DelegationScopeTarget;
88
90
  action: DelegationScopeAction;
@@ -237,7 +239,7 @@ declare class TopbarDelegationMenu {
237
239
  protected readonly hasCandidates: _angular_core.Signal<boolean>;
238
240
  protected readonly onBehalfOf: _angular_core.Signal<_masterteam_delegations.DelegationParty | null>;
239
241
  protected readonly executedBy: _angular_core.Signal<_masterteam_delegations.DelegationParty | null>;
240
- protected readonly mode: _angular_core.Signal<"active" | "candidates" | "hidden">;
242
+ protected readonly mode: _angular_core.Signal<"hidden" | "active" | "candidates">;
241
243
  togglePopover(event: Event): void;
242
244
  start(row: DelegationRow, event: MouseEvent): void;
243
245
  switchTo(row: DelegationRow, event: MouseEvent): void;
@@ -276,6 +278,27 @@ declare class StartSessionDialog {
276
278
  static ɵcmp: _angular_core.ɵɵComponentDeclaration<StartSessionDialog, "mt-start-session-dialog", never, { "delegation": { "alias": "delegation"; "required": true; "isSignal": true; }; "intent": { "alias": "intent"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
277
279
  }
278
280
 
281
+ /**
282
+ * Collects a required rejection reason before calling
283
+ * POST identity/delegations/{id}/reject (doc 04 — reject requires a non-empty
284
+ * reason for audit/governance). Closes with `true` on success so the caller
285
+ * can reload the row.
286
+ */
287
+ declare class RejectDelegationDialog {
288
+ readonly delegation: _angular_core.InputSignal<DelegationRow>;
289
+ private readonly ref;
290
+ private readonly facade;
291
+ protected readonly reason: _angular_core.WritableSignal<string>;
292
+ protected readonly submitted: _angular_core.WritableSignal<boolean>;
293
+ protected readonly isBusy: _angular_core.Signal<boolean>;
294
+ protected readonly isValid: _angular_core.Signal<boolean>;
295
+ protected onReasonInput(event: Event): void;
296
+ confirm(): void;
297
+ cancel(): void;
298
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<RejectDelegationDialog, never>;
299
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<RejectDelegationDialog, "mt-reject-delegation-dialog", never, { "delegation": { "alias": "delegation"; "required": true; "isSignal": true; }; }, {}, never, never, true, never>;
300
+ }
301
+
279
302
  declare class Delegations {
280
303
  private readonly router;
281
304
  goBack(): void;
@@ -297,6 +320,13 @@ declare class DelegationsList implements OnInit {
297
320
  * `data: { showBreadcrumb: false }`.
298
321
  */
299
322
  readonly showBreadcrumb: _angular_core.InputSignal<boolean>;
323
+ /**
324
+ * Admin-managed surface: the create/edit form also collects the Delegator /
325
+ * From user (admin creates a delegation between two users). Client
326
+ * self-service leaves this false. Bound from route data via
327
+ * `withComponentInputBinding()` — admin passes `data: { adminMode: true }`.
328
+ */
329
+ readonly adminMode: _angular_core.InputSignal<boolean>;
300
330
  private readonly facade;
301
331
  private readonly modal;
302
332
  private readonly transloco;
@@ -343,7 +373,7 @@ declare class DelegationsList implements OnInit {
343
373
  private startSession;
344
374
  private mark;
345
375
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<DelegationsList, never>;
346
- static ɵcmp: _angular_core.ɵɵComponentDeclaration<DelegationsList, "mt-delegations-list", never, { "showBreadcrumb": { "alias": "showBreadcrumb"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
376
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<DelegationsList, "mt-delegations-list", never, { "showBreadcrumb": { "alias": "showBreadcrumb"; "required": false; "isSignal": true; }; "adminMode": { "alias": "adminMode"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
347
377
  }
348
378
 
349
379
  /**
@@ -357,6 +387,12 @@ declare class DelegationsList implements OnInit {
357
387
  declare class DelegationForm implements OnInit {
358
388
  readonly delegationForEdit: _angular_core.InputSignal<DelegationRow | null>;
359
389
  readonly readonly: _angular_core.InputSignal<boolean>;
390
+ /**
391
+ * Admin-managed mode: also collect the Delegator / From user, so an admin can
392
+ * create a delegation between two selected users (Ahmed → Sara). Self-service
393
+ * leaves this false; the delegator defaults to the current user server-side.
394
+ */
395
+ readonly adminMode: _angular_core.InputSignal<boolean>;
360
396
  private readonly halfWidth;
361
397
  private readonly fullWidth;
362
398
  modal: ModalService;
@@ -370,6 +406,10 @@ declare class DelegationForm implements OnInit {
370
406
  isSaving: _angular_core.Signal<boolean>;
371
407
  context: HttpContext;
372
408
  protected readonly scope: _angular_core.WritableSignal<DelegationScopeSelection>;
409
+ /** Selected delegator id (admin mode only); drives scope/options + create payload. */
410
+ protected readonly selectedDelegatorId: _angular_core.Signal<string | undefined>;
411
+ /** In admin mode the scope picker only loads once a delegator is chosen. */
412
+ protected readonly showScopePicker: _angular_core.Signal<boolean>;
373
413
  protected readonly specificDaysOptions: _angular_core.WritableSignal<{
374
414
  label: string;
375
415
  value: number;
@@ -380,7 +420,7 @@ declare class DelegationForm implements OnInit {
380
420
  protected readonly canSubmit: _angular_core.Signal<boolean>;
381
421
  onSubmit(): void;
382
422
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<DelegationForm, never>;
383
- static ɵcmp: _angular_core.ɵɵComponentDeclaration<DelegationForm, "mt-delegation-form", never, { "delegationForEdit": { "alias": "delegationForEdit"; "required": false; "isSignal": true; }; "readonly": { "alias": "readonly"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
423
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<DelegationForm, "mt-delegation-form", never, { "delegationForEdit": { "alias": "delegationForEdit"; "required": false; "isSignal": true; }; "readonly": { "alias": "readonly"; "required": false; "isSignal": true; }; "adminMode": { "alias": "adminMode"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
384
424
  }
385
425
 
386
426
  type DetailTab = 'overview' | 'scope';
@@ -421,9 +461,14 @@ interface TargetGroup {
421
461
  * `[(scope)]` two-way binds a `DelegationScopeSelection`. The component never
422
462
  * invents permission metadata — it only echoes grants returned by options.
423
463
  */
424
- declare class ScopePicker implements OnInit {
464
+ declare class ScopePicker {
425
465
  readonly scope: _angular_core.ModelSignal<DelegationScopeSelection>;
426
466
  readonly readonly: _angular_core.InputSignal<boolean>;
467
+ /**
468
+ * Delegator whose grantable scope is loaded. Undefined = current user
469
+ * (self-service). In admin mode the host rebinds this as the selected
470
+ * delegator changes, and options reload reactively.
471
+ */
427
472
  readonly delegatorUserId: _angular_core.InputSignal<string | undefined>;
428
473
  private readonly facade;
429
474
  protected readonly options: _angular_core.Signal<DelegationScopeSelection | null>;
@@ -435,7 +480,6 @@ declare class ScopePicker implements OnInit {
435
480
  /** Selected grant keys for O(1) checkbox state. */
436
481
  protected readonly selectedKeys: _angular_core.Signal<Set<string>>;
437
482
  private readonly expanded;
438
- ngOnInit(): void;
439
483
  constructor();
440
484
  protected isExpanded(group: TargetGroup): boolean;
441
485
  protected toggleAccordion(group: TargetGroup): void;
@@ -709,5 +753,5 @@ declare class DelegationSessionFacade {
709
753
  static ɵprov: _angular_core.ɵɵInjectableDeclaration<DelegationSessionFacade>;
710
754
  }
711
755
 
712
- export { ApproveDelegation, CancelDelegation, ClearDelegationDetail, ClearScopePreview, CreateDelegationLegacy, CreateDelegationV2, DelegationDetailDrawer, DelegationForm, DelegationSessionActionKey, DelegationSessionFacade, DelegationSessionState, DelegationStatusChip, Delegations, DelegationsActionKey, DelegationsFacade, DelegationsList, DelegationsState, EndDelegationSession, GetActiveAssignedDelegations, GetAssignedDelegations, GetDelegationDetail, GetMyDelegations, GetScopeOptions, LoadDelegationCandidates, PreviewScope, RejectDelegation, ScopePicker, StartDelegationSession, StartSessionDialog, SwitchDelegationSession, TopbarDelegationMenu, UpdateDelegationLegacy, UpdateDelegationV2, appDelegationInterceptor };
756
+ export { ApproveDelegation, CancelDelegation, ClearDelegationDetail, ClearScopePreview, CreateDelegationLegacy, CreateDelegationV2, DelegationDetailDrawer, DelegationForm, DelegationSessionActionKey, DelegationSessionFacade, DelegationSessionState, DelegationStatusChip, Delegations, DelegationsActionKey, DelegationsFacade, DelegationsList, DelegationsState, EndDelegationSession, GetActiveAssignedDelegations, GetAssignedDelegations, GetDelegationDetail, GetMyDelegations, GetScopeOptions, LoadDelegationCandidates, PreviewScope, RejectDelegation, RejectDelegationDialog, ScopePicker, StartDelegationSession, StartSessionDialog, SwitchDelegationSession, TopbarDelegationMenu, UpdateDelegationLegacy, UpdateDelegationV2, appDelegationInterceptor };
713
757
  export type { ActiveDelegationSession, ApproveDelegationRequest, CreateDelegationLegacyRequest, CreateDelegationV2Request, DelegationAllowedAction, DelegationApprovalInfo, DelegationApprovalStatus, DelegationCancellationInfo, DelegationDayRuleMode, DelegationDetail, DelegationDto, DelegationEffectiveStatus, DelegationGrant, DelegationListQuery, DelegationPage, DelegationParty, DelegationRow, DelegationScopeAction, DelegationScopeDeniedItem, DelegationScopeOptions, DelegationScopePreview, DelegationScopeSelection, DelegationScopeTarget, DelegationScopeWarning, DelegationSessionInvalidationReason, DelegationSessionStateModel, DelegationSortDirection, DelegationStatusInfo, DelegationsStateModel, RejectDelegationRequest, UpdateDelegationLegacyRequest, UpdateDelegationV2Request };