@masterteam/delegations 0.0.23 → 0.0.25

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.23",
3
+ "version": "0.0.25",
4
4
  "publishConfig": {
5
5
  "directory": "../../../dist/masterteam/delegations",
6
6
  "linkDirectory": false,
@@ -20,8 +20,8 @@
20
20
  "tailwindcss": "^4.2.2",
21
21
  "tailwindcss-primeui": "^0.6.1",
22
22
  "@ngxs/store": "^20.1.0",
23
- "@masterteam/forms": "^0.0.80",
24
23
  "@masterteam/components": "^0.0.175",
24
+ "@masterteam/forms": "^0.0.80",
25
25
  "@masterteam/icons": "^0.0.15"
26
26
  },
27
27
  "sideEffects": false,
@@ -253,12 +253,30 @@ interface CreateDelegationV2Request {
253
253
  requiresApproval: boolean;
254
254
  scope: DelegationScopeSelection;
255
255
  }
256
+ interface AdminCreateDelegationV2Request {
257
+ delegatorUserId: string;
258
+ delegatedUserId: string;
259
+ description?: string;
260
+ delegateFromDateTime: string;
261
+ delegateToDateTime: string;
262
+ delegationDaysType: DelegationDayRuleMode;
263
+ specificDays?: number[];
264
+ requiresApproval: boolean;
265
+ scope: DelegationScopeSelection;
266
+ }
256
267
  type UpdateDelegationLegacyRequest = CreateDelegationLegacyRequest & {
257
268
  rowVersion: string;
258
269
  };
259
270
  type UpdateDelegationV2Request = CreateDelegationV2Request & {
260
271
  rowVersion: string;
261
272
  };
273
+ type AdminUpdateDelegationV2Request = AdminCreateDelegationV2Request & {
274
+ rowVersion: string;
275
+ };
276
+ interface DelegationScopePreviewRequest {
277
+ scope: DelegationScopeSelection;
278
+ delegatorUserId?: string | null;
279
+ }
262
280
  interface ApproveDelegationRequest {
263
281
  rowVersion: string;
264
282
  reason?: string;
@@ -545,6 +563,7 @@ type DetailTab = 'overview' | 'scope';
545
563
  */
546
564
  declare class DelegationDetailDrawer implements OnInit {
547
565
  readonly delegationId: _angular_core.InputSignal<number>;
566
+ readonly adminMode: _angular_core.InputSignal<boolean>;
548
567
  private readonly facade;
549
568
  private readonly transloco;
550
569
  protected readonly ref: ModalRef;
@@ -563,7 +582,7 @@ declare class DelegationDetailDrawer implements OnInit {
563
582
  protected getScopeActionLabel(action: DelegationScopeAction): string;
564
583
  protected formatScopeSummary(summary: DelegationDisplayValue | undefined): string;
565
584
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<DelegationDetailDrawer, never>;
566
- static ɵcmp: _angular_core.ɵɵComponentDeclaration<DelegationDetailDrawer, "mt-delegation-detail-drawer", never, { "delegationId": { "alias": "delegationId"; "required": true; "isSignal": true; }; }, {}, never, never, true, never>;
585
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<DelegationDetailDrawer, "mt-delegation-detail-drawer", never, { "delegationId": { "alias": "delegationId"; "required": true; "isSignal": true; }; "adminMode": { "alias": "adminMode"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
567
586
  }
568
587
 
569
588
  interface DelegationGrantableTargetGroup {
@@ -593,6 +612,7 @@ interface DelegationGrantableHierarchyGroup {
593
612
  declare class ScopePicker {
594
613
  readonly scope: _angular_core.ModelSignal<DelegationScopeSelection>;
595
614
  readonly readonly: _angular_core.InputSignal<boolean>;
615
+ readonly adminMode: _angular_core.InputSignal<boolean>;
596
616
  /**
597
617
  * Delegator whose grantable scope is loaded. Undefined = current user
598
618
  * (self-service). In admin mode the host rebinds this as the selected
@@ -618,6 +638,8 @@ declare class ScopePicker {
618
638
  protected getPreviewSummary(summary: DelegationDisplayValue | undefined): string;
619
639
  protected formatDeniedOperation(value?: string | null): string;
620
640
  protected formatDeniedTarget(value?: string | null): string;
641
+ protected groupTargetCount(group: DelegationGrantableHierarchyGroup): number;
642
+ protected targetGrantCount(targetGroup: DelegationGrantableTargetGroup): number;
621
643
  private buildTreeNodes;
622
644
  private buildTargetNode;
623
645
  private getGroupLabel;
@@ -625,7 +647,7 @@ declare class ScopePicker {
625
647
  private getActionLabel;
626
648
  private currentLanguage;
627
649
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<ScopePicker, never>;
628
- static ɵcmp: _angular_core.ɵɵComponentDeclaration<ScopePicker, "mt-scope-picker", never, { "scope": { "alias": "scope"; "required": false; "isSignal": true; }; "readonly": { "alias": "readonly"; "required": false; "isSignal": true; }; "delegatorUserId": { "alias": "delegatorUserId"; "required": false; "isSignal": true; }; }, { "scope": "scopeChange"; }, never, never, true, never>;
650
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<ScopePicker, "mt-scope-picker", never, { "scope": { "alias": "scope"; "required": false; "isSignal": true; }; "readonly": { "alias": "readonly"; "required": false; "isSignal": true; }; "adminMode": { "alias": "adminMode"; "required": false; "isSignal": true; }; "delegatorUserId": { "alias": "delegatorUserId"; "required": false; "isSignal": true; }; }, { "scope": "scopeChange"; }, never, never, true, never>;
629
651
  }
630
652
 
631
653
  /**
@@ -657,21 +679,24 @@ declare class GetActiveAssignedDelegations {
657
679
  }
658
680
  declare class GetDelegationDetail {
659
681
  id: number;
682
+ asAdmin: boolean;
660
683
  static readonly type = "[Delegations] Get Delegation Detail";
661
- constructor(id: number);
684
+ constructor(id: number, asAdmin?: boolean);
662
685
  }
663
686
  declare class ClearDelegationDetail {
664
687
  static readonly type = "[Delegations] Clear Delegation Detail";
665
688
  }
666
689
  declare class GetScopeOptions {
667
690
  delegatorUserId?: string | undefined;
691
+ asAdmin: boolean;
668
692
  static readonly type = "[Delegations] Get Scope Options";
669
- constructor(delegatorUserId?: string | undefined);
693
+ constructor(delegatorUserId?: string | undefined, asAdmin?: boolean);
670
694
  }
671
695
  declare class PreviewScope {
672
- scope: DelegationScopeSelection;
696
+ request: DelegationScopePreviewRequest;
697
+ asAdmin: boolean;
673
698
  static readonly type = "[Delegations] Preview Scope";
674
- constructor(scope: DelegationScopeSelection);
699
+ constructor(request: DelegationScopePreviewRequest, asAdmin?: boolean);
675
700
  }
676
701
  declare class ClearScopePreview {
677
702
  static readonly type = "[Delegations] Clear Scope Preview";
@@ -682,9 +707,10 @@ declare class CreateDelegationLegacy {
682
707
  constructor(request: CreateDelegationLegacyRequest);
683
708
  }
684
709
  declare class CreateDelegationV2 {
685
- request: CreateDelegationV2Request;
710
+ request: CreateDelegationV2Request | AdminCreateDelegationV2Request;
711
+ asAdmin: boolean;
686
712
  static readonly type = "[Delegations] Create Delegation (v2)";
687
- constructor(request: CreateDelegationV2Request);
713
+ constructor(request: CreateDelegationV2Request | AdminCreateDelegationV2Request, asAdmin?: boolean);
688
714
  }
689
715
  declare class UpdateDelegationLegacy {
690
716
  id: number;
@@ -694,9 +720,10 @@ declare class UpdateDelegationLegacy {
694
720
  }
695
721
  declare class UpdateDelegationV2 {
696
722
  id: number;
697
- request: UpdateDelegationV2Request;
723
+ request: UpdateDelegationV2Request | AdminUpdateDelegationV2Request;
724
+ asAdmin: boolean;
698
725
  static readonly type = "[Delegations] Update Delegation (v2)";
699
- constructor(id: number, request: UpdateDelegationV2Request);
726
+ constructor(id: number, request: UpdateDelegationV2Request | AdminUpdateDelegationV2Request, asAdmin?: boolean);
700
727
  }
701
728
  declare class ApproveDelegation {
702
729
  id: number;
@@ -750,18 +777,20 @@ declare class DelegationsState {
750
777
  getAssigned(ctx: StateContext<DelegationsStateModel>, { query }: GetAssignedDelegations): rxjs.Observable<Response<DelegationPage<DelegationRow>>>;
751
778
  getAdmin(ctx: StateContext<DelegationsStateModel>, { query }: GetAdminDelegations): rxjs.Observable<Response<DelegationPage<DelegationRow>>>;
752
779
  getActive(ctx: StateContext<DelegationsStateModel>, { query }: GetActiveAssignedDelegations): rxjs.Observable<Response<DelegationPage<DelegationRow>>>;
753
- getDetail(ctx: StateContext<DelegationsStateModel>, { id }: GetDelegationDetail): rxjs.Observable<Response<DelegationDetail>>;
780
+ getDetail(ctx: StateContext<DelegationsStateModel>, { id, asAdmin }: GetDelegationDetail): rxjs.Observable<Response<DelegationDetail>>;
754
781
  clearDetail(ctx: StateContext<DelegationsStateModel>): void;
755
- getScopeOptions(ctx: StateContext<DelegationsStateModel>, { delegatorUserId }: GetScopeOptions): rxjs.Observable<Response<DelegationScopeOptions>>;
756
- previewScope(ctx: StateContext<DelegationsStateModel>, { scope }: PreviewScope): rxjs.Observable<Response<DelegationScopePreview>>;
782
+ getScopeOptions(ctx: StateContext<DelegationsStateModel>, { delegatorUserId, asAdmin }: GetScopeOptions): rxjs.Observable<Response<DelegationScopeOptions>>;
783
+ previewScope(ctx: StateContext<DelegationsStateModel>, { request, asAdmin }: PreviewScope): rxjs.Observable<Response<DelegationScopePreview>>;
757
784
  clearScopePreview(ctx: StateContext<DelegationsStateModel>): void;
758
785
  createLegacy(ctx: StateContext<DelegationsStateModel>, { request }: CreateDelegationLegacy): rxjs.Observable<Response<DelegationDto>>;
759
- createV2(ctx: StateContext<DelegationsStateModel>, { request }: CreateDelegationV2): rxjs.Observable<Response<DelegationDto>>;
786
+ createV2(ctx: StateContext<DelegationsStateModel>, { request, asAdmin }: CreateDelegationV2): rxjs.Observable<Response<DelegationDto>>;
760
787
  updateLegacy(ctx: StateContext<DelegationsStateModel>, { id, request }: UpdateDelegationLegacy): rxjs.Observable<Response<DelegationDto>>;
761
- updateV2(ctx: StateContext<DelegationsStateModel>, { id, request }: UpdateDelegationV2): rxjs.Observable<Response<DelegationDto>>;
788
+ updateV2(ctx: StateContext<DelegationsStateModel>, { id, request, asAdmin }: UpdateDelegationV2): rxjs.Observable<Response<DelegationDto>>;
762
789
  approve(ctx: StateContext<DelegationsStateModel>, { id, request }: ApproveDelegation): rxjs.Observable<Response<DelegationDto>>;
763
790
  reject(ctx: StateContext<DelegationsStateModel>, { id, request }: RejectDelegation): rxjs.Observable<Response<DelegationDto>>;
764
791
  cancel(ctx: StateContext<DelegationsStateModel>, { id, rowVersion, asAdmin }: CancelDelegation): rxjs.Observable<Response<boolean>>;
792
+ private buildScopePreviewRequest;
793
+ private buildAdminSaveRequest;
765
794
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<DelegationsState, never>;
766
795
  static ɵprov: _angular_core.ɵɵInjectableDeclaration<DelegationsState>;
767
796
  }
@@ -802,15 +831,18 @@ declare class DelegationsFacade {
802
831
  getAssigned(query?: DelegationListQuery): rxjs.Observable<void>;
803
832
  getAdmin(query?: DelegationListQuery): rxjs.Observable<void>;
804
833
  getActive(query?: DelegationListQuery): rxjs.Observable<void>;
805
- getDetail(id: number): rxjs.Observable<void>;
834
+ getDetail(id: number, asAdmin?: boolean): rxjs.Observable<void>;
806
835
  clearDetail(): rxjs.Observable<void>;
807
- loadScopeOptions(delegatorUserId?: string): rxjs.Observable<void>;
808
- previewScope(scope: DelegationScopeSelection): rxjs.Observable<void>;
836
+ loadScopeOptions(delegatorUserId?: string, asAdmin?: boolean): rxjs.Observable<void>;
837
+ previewScope(scope: DelegationScopeSelection, options?: {
838
+ delegatorUserId?: string;
839
+ asAdmin?: boolean;
840
+ }): rxjs.Observable<void>;
809
841
  clearScopePreview(): rxjs.Observable<void>;
810
842
  createLegacy(request: CreateDelegationLegacyRequest): rxjs.Observable<void>;
811
- createV2(request: CreateDelegationV2Request): rxjs.Observable<void>;
843
+ createV2(request: CreateDelegationV2Request | AdminCreateDelegationV2Request, asAdmin?: boolean): rxjs.Observable<void>;
812
844
  updateLegacy(id: number, request: UpdateDelegationLegacyRequest): rxjs.Observable<void>;
813
- updateV2(id: number, request: UpdateDelegationV2Request): rxjs.Observable<void>;
845
+ updateV2(id: number, request: UpdateDelegationV2Request | AdminUpdateDelegationV2Request, asAdmin?: boolean): rxjs.Observable<void>;
814
846
  approve(id: number, request: ApproveDelegationRequest): rxjs.Observable<void>;
815
847
  reject(id: number, request: RejectDelegationRequest): rxjs.Observable<void>;
816
848
  cancel(id: number, rowVersion: string, asAdmin?: boolean): rxjs.Observable<void>;
@@ -905,4 +937,4 @@ declare class DelegationSessionFacade {
905
937
  }
906
938
 
907
939
  export { ApproveDelegation, CancelDelegation, ClearDelegationDetail, ClearScopePreview, CreateDelegationLegacy, CreateDelegationV2, DelegationDetailDrawer, DelegationForm, DelegationSessionActionKey, DelegationSessionFacade, DelegationSessionState, DelegationStatusChip, Delegations, DelegationsActionKey, DelegationsFacade, DelegationsList, DelegationsState, EndDelegationSession, GetActiveAssignedDelegations, GetAdminDelegations, GetAssignedDelegations, GetDelegationDetail, GetMyDelegations, GetScopeOptions, LoadDelegationCandidates, PreviewScope, RejectDelegation, RejectDelegationDialog, ScopePicker, StartDelegationSession, StartSessionDialog, SwitchDelegationSession, TopbarDelegationMenu, UpdateDelegationLegacy, UpdateDelegationV2, appDelegationInterceptor };
908
- export type { ActiveDelegationSession, ApproveDelegationRequest, CreateDelegationLegacyRequest, CreateDelegationV2Request, DelegationAllowedAction, DelegationApprovalInfo, DelegationApprovalStatus, DelegationCancellationInfo, DelegationDayRuleMode, DelegationDetail, DelegationDisplayValue, DelegationDto, DelegationEffectiveStatus, DelegationGrant, DelegationListQuery, DelegationPage, DelegationParty, DelegationRow, DelegationScopeAction, DelegationScopeCombinationRule, DelegationScopeDeniedItem, DelegationScopeFact, DelegationScopeHierarchyGroup, DelegationScopeHierarchyTarget, DelegationScopeOptions, DelegationScopePreview, DelegationScopeSelection, DelegationScopeTarget, DelegationScopeWarning, DelegationSessionInvalidationReason, DelegationSessionStateModel, DelegationSortDirection, DelegationStatusInfo, DelegationsStateModel, RejectDelegationRequest, UpdateDelegationLegacyRequest, UpdateDelegationV2Request };
940
+ export type { ActiveDelegationSession, AdminCreateDelegationV2Request, AdminUpdateDelegationV2Request, ApproveDelegationRequest, CreateDelegationLegacyRequest, CreateDelegationV2Request, DelegationAllowedAction, DelegationApprovalInfo, DelegationApprovalStatus, DelegationCancellationInfo, DelegationDayRuleMode, DelegationDetail, DelegationDisplayValue, DelegationDto, DelegationEffectiveStatus, DelegationGrant, DelegationListQuery, DelegationPage, DelegationParty, DelegationRow, DelegationScopeAction, DelegationScopeCombinationRule, DelegationScopeDeniedItem, DelegationScopeFact, DelegationScopeHierarchyGroup, DelegationScopeHierarchyTarget, DelegationScopeOptions, DelegationScopePreview, DelegationScopePreviewRequest, DelegationScopeSelection, DelegationScopeTarget, DelegationScopeWarning, DelegationSessionInvalidationReason, DelegationSessionStateModel, DelegationSortDirection, DelegationStatusInfo, DelegationsStateModel, RejectDelegationRequest, UpdateDelegationLegacyRequest, UpdateDelegationV2Request };