@masterteam/delegations 0.0.49 → 0.0.51

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.49",
3
+ "version": "0.0.51",
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.119",
24
- "@masterteam/components": "^0.0.230",
23
+ "@masterteam/components": "^0.0.247",
24
+ "@masterteam/forms": "^0.0.132",
25
25
  "@masterteam/icons": "^0.0.17"
26
26
  },
27
27
  "sideEffects": false,
@@ -46,4 +46,4 @@
46
46
  "dependencies": {
47
47
  "tslib": "^2.8.1"
48
48
  }
49
- }
49
+ }
@@ -1,17 +1,18 @@
1
1
  import * as _masterteam_delegations from '@masterteam/delegations';
2
2
  import * as _angular_core from '@angular/core';
3
- import { OnInit, InjectionToken } from '@angular/core';
3
+ import { OnInit, InjectionToken, EnvironmentProviders } from '@angular/core';
4
4
  import { Popover } from 'primeng/popover';
5
5
  import * as _masterteam_components_entities from '@masterteam/components/entities';
6
6
  import { EntityUserValue } from '@masterteam/components/entities';
7
7
  import { PageHeaderTab } from '@masterteam/components/page-header';
8
8
  import { TableAction, TableStatusMapValue, ColumnDef } from '@masterteam/components/table';
9
9
  import { FormControl } from '@angular/forms';
10
- import { HttpContext, HttpInterceptorFn } from '@angular/common/http';
10
+ import { HttpContext, HttpInterceptorFn, HttpContextToken } from '@angular/common/http';
11
11
  import { DynamicFormConfig } from '@masterteam/components';
12
12
  import { ModalRef } from '@masterteam/components/dialog';
13
13
  import { ModalService } from '@masterteam/components/modal';
14
14
  import * as rxjs from 'rxjs';
15
+ import { Observable } from 'rxjs';
15
16
  import { StateContext } from '@ngxs/store';
16
17
 
17
18
  interface LoadingStateShape<L extends string = string> {
@@ -19,7 +20,7 @@ interface LoadingStateShape<L extends string = string> {
19
20
  errors: Partial<Record<L, string>>;
20
21
  }
21
22
 
22
- type DelegationEffectiveStatus = 'PendingApproval' | 'Scheduled' | 'Active' | 'InactiveToday' | 'Expired' | 'Rejected' | 'Cancelled';
23
+ type DelegationEffectiveStatus = 'PendingApproval' | 'Scheduled' | 'Active' | 'Expired' | 'Rejected' | 'Cancelled';
23
24
  type DelegationApprovalStatus = 'NotRequired' | 'Pending' | 'Approved' | 'Rejected';
24
25
  type DelegationAllowedAction = 'View' | 'Edit' | 'Approve' | 'Reject' | 'Cancel' | 'StartSession' | 'EndSession';
25
26
  type DelegationDayRuleMode = 'FullRange' | 'SpecificDays';
@@ -275,6 +276,7 @@ interface DelegationStatusInfo {
275
276
  }
276
277
  interface DelegationDetail {
277
278
  row: DelegationRow;
279
+ description?: string | null;
278
280
  scope: DelegationScopeSelection;
279
281
  scopeView?: DelegationScopeView | null;
280
282
  status: DelegationStatusInfo;
@@ -330,6 +332,7 @@ interface CreateDelegationV2Request {
330
332
  delegateToDateTime: string;
331
333
  delegationDaysType: DelegationDayRuleMode;
332
334
  specificDays?: number[];
335
+ timeZoneId?: string;
333
336
  requiresApproval: boolean;
334
337
  scope: DelegationScopeSelection;
335
338
  }
@@ -341,6 +344,7 @@ interface AdminCreateDelegationV2Request {
341
344
  delegateToDateTime: string;
342
345
  delegationDaysType: DelegationDayRuleMode;
343
346
  specificDays?: number[];
347
+ timeZoneId?: string;
344
348
  requiresApproval: boolean;
345
349
  scope: DelegationScopeSelection;
346
350
  }
@@ -387,8 +391,10 @@ interface DelegationsStateModel extends LoadingStateShape<DelegationsActionKey>
387
391
  admin: DelegationPage<DelegationRow> | null;
388
392
  active: DelegationPage<DelegationRow> | null;
389
393
  detail: DelegationDetail | null;
394
+ detailRequestedId: number | null;
390
395
  scopeOptions: DelegationScopeOptions | null;
391
396
  scopePreview: DelegationScopePreview | null;
397
+ scopePreviewFingerprint: string | null;
392
398
  }
393
399
 
394
400
  /**
@@ -426,17 +432,21 @@ declare class TopbarDelegationMenu implements OnInit {
426
432
  protected readonly hasCandidates: _angular_core.Signal<boolean>;
427
433
  protected readonly onBehalfOf: _angular_core.Signal<_masterteam_delegations.DelegationParty | null>;
428
434
  protected readonly executedBy: _angular_core.Signal<_masterteam_delegations.DelegationParty | null>;
429
- /** Per-instance guard; the persisted `facade.prompted()` guards across refresh. */
430
- private localPrompted;
431
- protected readonly mode: _angular_core.Signal<"candidates" | "active" | "hidden">;
435
+ protected readonly popoverOpen: _angular_core.WritableSignal<boolean>;
436
+ private promptPending;
437
+ private promptRefreshQueued;
438
+ private promptFlowOpen;
439
+ protected readonly mode: _angular_core.Signal<"active" | "candidates" | "hidden">;
432
440
  constructor();
433
441
  ngOnInit(): void;
434
442
  /** Two-letter initials for a delegator avatar (matches the user-menu pattern). */
435
443
  protected initials(party: DelegationRow['delegator'] | null | undefined): string;
436
444
  togglePopover(event: Event): void;
437
445
  closePopover(): void;
446
+ private checkPromptCandidates;
438
447
  private openConfirm;
439
448
  private openCandidatesPrompt;
449
+ private finishPromptFlow;
440
450
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<TopbarDelegationMenu, never>;
441
451
  static ɵcmp: _angular_core.ɵɵComponentDeclaration<TopbarDelegationMenu, "mt-topbar-delegation-menu", never, { "managePath": { "alias": "managePath"; "required": false; "isSignal": true; }; "compact": { "alias": "compact"; "required": false; "isSignal": true; }; "showManageLink": { "alias": "showManageLink"; "required": false; "isSignal": true; }; "promptOnCandidates": { "alias": "promptOnCandidates"; "required": false; "isSignal": true; }; "headless": { "alias": "headless"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
442
452
  }
@@ -462,15 +472,18 @@ declare class DelegationMenuPanel {
462
472
  protected readonly active: _angular_core.Signal<_masterteam_delegations.ActiveDelegationSession | null>;
463
473
  protected readonly candidates: _angular_core.Signal<DelegationRow[]>;
464
474
  protected readonly hasCandidates: _angular_core.Signal<boolean>;
475
+ protected readonly hasMoreCandidates: _angular_core.Signal<boolean>;
476
+ protected readonly isLoadingCandidates: _angular_core.Signal<boolean>;
465
477
  protected readonly onBehalfOf: _angular_core.Signal<_masterteam_delegations.DelegationParty | null>;
466
478
  protected readonly executedBy: _angular_core.Signal<_masterteam_delegations.DelegationParty | null>;
467
- protected readonly mode: _angular_core.Signal<"candidates" | "active" | "hidden">;
479
+ protected readonly mode: _angular_core.Signal<"active" | "candidates" | "hidden">;
468
480
  /** Two-letter initials for a delegator avatar (matches the user-menu pattern). */
469
481
  protected initials(party: DelegationRow['delegator'] | null | undefined): string;
470
482
  protected start(row: DelegationRow, event: MouseEvent): void;
471
483
  protected switchTo(row: DelegationRow, event: MouseEvent): void;
472
484
  protected endSession(event: MouseEvent): void;
473
485
  protected onManage(): void;
486
+ protected loadMore(event: MouseEvent): void;
474
487
  private openConfirm;
475
488
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<DelegationMenuPanel, never>;
476
489
  static ɵcmp: _angular_core.ɵɵComponentDeclaration<DelegationMenuPanel, "mt-delegation-menu-panel", never, { "managePath": { "alias": "managePath"; "required": false; "isSignal": true; }; "showManageLink": { "alias": "showManageLink"; "required": false; "isSignal": true; }; }, { "closeRequested": "closeRequested"; }, never, never, true, never>;
@@ -482,9 +495,10 @@ interface StatusVisual {
482
495
  }
483
496
  declare class DelegationStatusChip {
484
497
  readonly status: _angular_core.InputSignal<DelegationEffectiveStatus>;
498
+ readonly reasonCode: _angular_core.InputSignal<string | null | undefined>;
485
499
  protected readonly visual: _angular_core.Signal<StatusVisual>;
486
500
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<DelegationStatusChip, never>;
487
- static ɵcmp: _angular_core.ɵɵComponentDeclaration<DelegationStatusChip, "mt-delegation-status-chip", never, { "status": { "alias": "status"; "required": true; "isSignal": true; }; }, {}, never, never, true, never>;
501
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<DelegationStatusChip, "mt-delegation-status-chip", never, { "status": { "alias": "status"; "required": true; "isSignal": true; }; "reasonCode": { "alias": "reasonCode"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
488
502
  }
489
503
 
490
504
  /**
@@ -552,6 +566,7 @@ declare function toDelegationUserValue(party: DelegationParty | null | undefined
552
566
 
553
567
  type DelegationTab = 'my' | 'assigned' | 'approvals';
554
568
  type DelegationTableRow = DelegationRow & {
569
+ displayStatus: DelegationEffectiveStatus | 'InactiveToday';
555
570
  listedUser: ReturnType<typeof toDelegationUserValue>;
556
571
  delegatorUser: ReturnType<typeof toDelegationUserValue>;
557
572
  delegatedToUser: ReturnType<typeof toDelegationUserValue>;
@@ -635,6 +650,8 @@ declare class DelegationsList implements OnInit {
635
650
  protected readonly surfaceTitle: _angular_core.Signal<string>;
636
651
  protected readonly isLoading: _angular_core.Signal<boolean>;
637
652
  protected readonly rows: _angular_core.Signal<DelegationRow[]>;
653
+ protected readonly currentPage: _angular_core.Signal<_masterteam_delegations.DelegationPage<DelegationRow> | null>;
654
+ private readonly currentQuery;
638
655
  protected readonly tableRows: _angular_core.Signal<DelegationTableRow[]>;
639
656
  protected readonly emptyStateKey: _angular_core.Signal<string>;
640
657
  private readonly detailQueryId;
@@ -646,7 +663,7 @@ declare class DelegationsList implements OnInit {
646
663
  * and the status chip render the same hue for each status.
647
664
  */
648
665
  private readonly statusColors;
649
- protected readonly statusMap: _angular_core.WritableSignal<Record<DelegationEffectiveStatus, TableStatusMapValue>>;
666
+ protected readonly statusMap: _angular_core.WritableSignal<Record<DelegationEffectiveStatus | "InactiveToday", TableStatusMapValue>>;
650
667
  protected readonly tableColumns: _angular_core.WritableSignal<ColumnDef[]>;
651
668
  private readonly busyIds;
652
669
  private readonly weekdayKeys;
@@ -660,6 +677,10 @@ declare class DelegationsList implements OnInit {
660
677
  protected goBack(): void;
661
678
  private loadCurrentTab;
662
679
  private reloadCurrentTab;
680
+ protected onLazyLoad(event: {
681
+ currentPage?: number;
682
+ pageSize?: number;
683
+ }): void;
663
684
  protected has(row: DelegationRow, action: DelegationAllowedAction): boolean;
664
685
  protected formatDays(row: DelegationRow): string;
665
686
  protected getListedParty(row: DelegationRow): _masterteam_delegations.DelegationParty;
@@ -697,7 +718,7 @@ interface DelegationFormUserValue {
697
718
  *
698
719
  * - Delegator is server-derived; only the delegated user is collected.
699
720
  * - On edit, scope grants + rowVersion come from the loaded detail.
700
- * - Times are sent in UTC ISO; wrappers set timeZoneId = UTC.
721
+ * - Times are sent in UTC ISO alongside the browser/user IANA time zone.
701
722
  */
702
723
  declare class DelegationForm implements OnInit {
703
724
  readonly delegationForEdit: _angular_core.InputSignal<DelegationRow | null>;
@@ -714,6 +735,7 @@ declare class DelegationForm implements OnInit {
714
735
  ref: ModalRef;
715
736
  private readonly transloco;
716
737
  private readonly facade;
738
+ private readonly runtime;
717
739
  delegationFormControl: FormControl<any>;
718
740
  formValue: _angular_core.Signal<any>;
719
741
  detail: _angular_core.Signal<_masterteam_delegations.DelegationDetail | null>;
@@ -860,6 +882,7 @@ declare class ScopePicker {
860
882
  readonly delegatorUserId: _angular_core.InputSignal<string | undefined>;
861
883
  private readonly facade;
862
884
  private readonly transloco;
885
+ private readonly destroyRef;
863
886
  protected readonly options: _angular_core.Signal<_masterteam_delegations.DelegationScopeOptions | null>;
864
887
  protected readonly preview: _angular_core.Signal<_masterteam_delegations.DelegationScopePreview | null>;
865
888
  protected readonly isLoadingOptions: _angular_core.Signal<boolean>;
@@ -932,12 +955,66 @@ declare class ScopePicker {
932
955
  }
933
956
 
934
957
  /**
935
- * Adds `app-delegation: Bearer <token>` to outgoing requests while a delegated
936
- * session is active. Register AFTER the gateway-auth interceptor (so the normal
937
- * `Authorization` header is set first) and BEFORE the message interceptor.
958
+ * Adds delegated authority only to explicitly marked, trusted business-runtime
959
+ * requests. Register after the normal authorization interceptor.
938
960
  */
939
961
  declare const appDelegationInterceptor: HttpInterceptorFn;
940
962
 
963
+ /**
964
+ * Active delegated session. Memory-only by design (doc 05):
965
+ * the delegation token is never persisted to long-lived storage.
966
+ *
967
+ * `delegation.delegatedUser` is the executed-by (actual logged-in) user and
968
+ * `delegation.delegator` is the on-behalf-of user — both already present on the
969
+ * row from the active-delegations endpoint.
970
+ */
971
+ interface ActiveDelegationSession {
972
+ delegation: DelegationRow;
973
+ expiresAtUtc: string;
974
+ delegationVersion: number;
975
+ }
976
+ interface DelegationSessionStartResponse {
977
+ accessToken: string;
978
+ expiresAtUtc: string;
979
+ delegationId: number;
980
+ delegationVersion: number;
981
+ }
982
+ type DelegationSessionInvalidationReason = 'TokenInvalid' | 'SessionMismatch' | 'ScopeChanged' | 'VersionChanged' | 'ActorMismatch' | 'ApplicationMismatch' | 'TenantMismatch' | 'Expired' | 'Logout' | 'UserSwitch' | 'TenantSwitch' | 'AppSwitch' | 'Manual';
983
+ declare enum DelegationSessionActionKey {
984
+ LoadCandidates = "loadCandidates",
985
+ StartSession = "startSession"
986
+ }
987
+ interface DelegationSessionStateModel extends LoadingStateShape<DelegationSessionActionKey> {
988
+ active: ActiveDelegationSession | null;
989
+ candidates: DelegationRow[];
990
+ candidatesPage: number;
991
+ candidatesPageSize: number;
992
+ candidatesTotalCount: number;
993
+ }
994
+
995
+ interface DelegationPromptNamespace {
996
+ userId: string;
997
+ applicationKey: string;
998
+ tenantKey?: string | null;
999
+ }
1000
+ interface DelegationContextChange {
1001
+ previous: ActiveDelegationSession | null;
1002
+ current: ActiveDelegationSession | null;
1003
+ reason: string;
1004
+ }
1005
+ interface DelegationRuntimeConfig {
1006
+ resolveApplicationApiBaseUrl: () => string;
1007
+ resolvePromptNamespace: () => DelegationPromptNamespace;
1008
+ resolveDefaultTimeZone: () => string;
1009
+ onContextChanged: (change: DelegationContextChange) => void | Promise<void>;
1010
+ }
1011
+ type DelegationRuntimeConfigFactory = () => DelegationRuntimeConfig;
1012
+ declare const DELEGATION_RUNTIME_CONFIG: InjectionToken<DelegationRuntimeConfig>;
1013
+ declare function provideDelegationRuntime(config: DelegationRuntimeConfig | DelegationRuntimeConfigFactory): EnvironmentProviders;
1014
+ /** Opt-in marker for a trusted first-party business-runtime request. */
1015
+ declare const DELEGATED_RUNTIME_REQUEST: HttpContextToken<boolean>;
1016
+ declare function withDelegatedRuntime(context?: HttpContext): HttpContext;
1017
+
941
1018
  declare class GetMyDelegations {
942
1019
  query: DelegationListQuery;
943
1020
  static readonly type = "[Delegations] Get My Delegations";
@@ -1050,12 +1127,16 @@ interface Response<T> {
1050
1127
 
1051
1128
  declare class DelegationsState {
1052
1129
  private http;
1130
+ private actions$;
1131
+ private store;
1132
+ constructor();
1053
1133
  static getMy(state: DelegationsStateModel): DelegationPage<DelegationRow> | null;
1054
1134
  static getAssigned(state: DelegationsStateModel): DelegationPage<DelegationRow> | null;
1055
1135
  static getApprovals(state: DelegationsStateModel): DelegationPage<DelegationRow> | null;
1056
1136
  static getAdmin(state: DelegationsStateModel): DelegationPage<DelegationRow> | null;
1057
1137
  static getActive(state: DelegationsStateModel): DelegationPage<DelegationRow> | null;
1058
1138
  static getDetail(state: DelegationsStateModel): DelegationDetail | null;
1139
+ static getScopePreviewFingerprint(state: DelegationsStateModel): string | null;
1059
1140
  static getScopeOptions(state: DelegationsStateModel): DelegationScopeOptions | null;
1060
1141
  static getScopePreview(state: DelegationsStateModel): DelegationScopePreview | null;
1061
1142
  static getLoadingActive(state: DelegationsStateModel): string[];
@@ -1093,6 +1174,7 @@ declare class DelegationsFacade {
1093
1174
  readonly detail: _angular_core.Signal<_masterteam_delegations.DelegationDetail | null>;
1094
1175
  readonly scopeOptions: _angular_core.Signal<_masterteam_delegations.DelegationScopeOptions | null>;
1095
1176
  readonly scopePreview: _angular_core.Signal<_masterteam_delegations.DelegationScopePreview | null>;
1177
+ readonly scopePreviewFingerprint: _angular_core.Signal<string | null>;
1096
1178
  private readonly loadingActive;
1097
1179
  private readonly errors;
1098
1180
  readonly myItems: _angular_core.Signal<_masterteam_delegations.DelegationRow[]>;
@@ -1143,37 +1225,13 @@ declare class DelegationsFacade {
1143
1225
  static ɵprov: _angular_core.ɵɵInjectableDeclaration<DelegationsFacade>;
1144
1226
  }
1145
1227
 
1146
- /**
1147
- * Active delegated session. Memory-only by design (doc 05):
1148
- * the delegation token is never persisted to long-lived storage.
1149
- *
1150
- * `delegation.delegatedUser` is the executed-by (actual logged-in) user and
1151
- * `delegation.delegator` is the on-behalf-of user — both already present on the
1152
- * row from the active-delegations endpoint.
1153
- */
1154
- interface ActiveDelegationSession {
1155
- token: string;
1156
- delegation: DelegationRow;
1157
- }
1158
- type DelegationSessionInvalidationReason = 'TokenInvalid' | 'SessionMismatch' | 'ScopeChanged' | 'Forbidden' | 'Logout' | 'UserSwitch' | 'TenantSwitch' | 'AppSwitch' | 'Manual';
1159
- declare enum DelegationSessionActionKey {
1160
- LoadCandidates = "loadCandidates",
1161
- StartSession = "startSession"
1162
- }
1163
- interface DelegationSessionStateModel extends LoadingStateShape<DelegationSessionActionKey> {
1164
- active: ActiveDelegationSession | null;
1165
- candidates: DelegationRow[];
1166
- /**
1167
- * Whether the post-login "delegations available" prompt has already been
1168
- * shown for the current login. Reset on login so the prompt appears once,
1169
- * then never again on plain refreshes (persisted with the slice).
1170
- */
1171
- prompted: boolean;
1172
- }
1173
-
1174
1228
  /** Fetch the active delegations the current user may start (user/activedelegations). */
1175
1229
  declare class LoadDelegationCandidates {
1230
+ page: number;
1231
+ pageSize: number;
1232
+ append: boolean;
1176
1233
  static readonly type = "[DelegationSession] Load Candidates";
1234
+ constructor(page?: number, pageSize?: number, append?: boolean);
1177
1235
  }
1178
1236
  /** Start a delegated session for the given assignment row. */
1179
1237
  declare class StartDelegationSession {
@@ -1193,73 +1251,58 @@ declare class SwitchDelegationSession {
1193
1251
  static readonly type = "[DelegationSession] Switch";
1194
1252
  constructor(delegation: DelegationRow);
1195
1253
  }
1196
- /** Set whether the post-login candidates prompt has been shown for this login. */
1197
- declare class MarkDelegationPrompted {
1198
- prompted: boolean;
1199
- static readonly type = "[DelegationSession] Mark Prompted";
1200
- constructor(prompted?: boolean);
1201
- }
1202
1254
 
1203
1255
  declare class DelegationSessionState {
1204
1256
  private http;
1205
1257
  private actions$;
1206
1258
  private store;
1259
+ private vault;
1260
+ private runtime;
1261
+ private expiryTimer;
1207
1262
  constructor();
1208
1263
  static getActive(state: DelegationSessionStateModel): ActiveDelegationSession | null;
1209
1264
  static getCandidates(state: DelegationSessionStateModel): DelegationRow[];
1210
- static getPrompted(state: DelegationSessionStateModel): boolean;
1265
+ static getCandidatesTotalCount(state: DelegationSessionStateModel): number;
1211
1266
  static isDelegated(state: DelegationSessionStateModel): boolean;
1212
1267
  static getLoadingActive(state: DelegationSessionStateModel): string[];
1213
1268
  static getErrors(state: DelegationSessionStateModel): Record<string, string | null | undefined>;
1214
- loadCandidates(ctx: StateContext<DelegationSessionStateModel>): rxjs.Observable<Response<DelegationPage<DelegationRow>>>;
1215
- start(ctx: StateContext<DelegationSessionStateModel>, { delegation }: StartDelegationSession): rxjs.Observable<Response<string>>;
1216
- end(ctx: StateContext<DelegationSessionStateModel>, { reason }: EndDelegationSession): rxjs.Observable<never>;
1217
- markPrompted(ctx: StateContext<DelegationSessionStateModel>, { prompted }: MarkDelegationPrompted): rxjs.Observable<never>;
1269
+ loadCandidates(ctx: StateContext<DelegationSessionStateModel>, { page, pageSize, append }: LoadDelegationCandidates): rxjs.Observable<Response<DelegationPage<DelegationRow>>>;
1270
+ start(ctx: StateContext<DelegationSessionStateModel>, { delegation }: StartDelegationSession): rxjs.Observable<void>;
1271
+ private startSession;
1272
+ end(ctx: StateContext<DelegationSessionStateModel>, { reason }: EndDelegationSession): rxjs.Observable<void>;
1218
1273
  switch(ctx: StateContext<DelegationSessionStateModel>, { delegation }: SwitchDelegationSession): rxjs.Observable<void>;
1274
+ private scheduleExpiry;
1275
+ private clearExpiry;
1219
1276
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<DelegationSessionState, never>;
1220
1277
  static ɵprov: _angular_core.ɵɵInjectableDeclaration<DelegationSessionState>;
1221
1278
  }
1222
1279
 
1223
- /**
1224
- * When true (default), the app reloads after a delegated session starts /
1225
- * switches / ends so every subsequent request is re-fetched under the new
1226
- * delegation context (the SPA otherwise keeps the previous actor's loaded data).
1227
- * Consumers that drive their own refresh can provide `false` to opt out.
1228
- */
1229
- declare const DELEGATION_RELOAD_ON_SESSION_CHANGE: InjectionToken<boolean>;
1230
1280
  declare class DelegationSessionFacade {
1231
1281
  private readonly store;
1232
- private readonly document;
1233
- private readonly reloadOnSessionChange;
1282
+ private readonly promptReceipts;
1283
+ private endInFlight;
1234
1284
  readonly active: _angular_core.Signal<_masterteam_delegations.ActiveDelegationSession | null>;
1235
1285
  readonly candidates: _angular_core.Signal<DelegationRow[]>;
1286
+ readonly candidatesTotalCount: _angular_core.Signal<number>;
1236
1287
  readonly isDelegated: _angular_core.Signal<boolean>;
1237
- /** Whether the post-login candidates prompt was already shown this login. */
1238
- readonly prompted: _angular_core.Signal<boolean>;
1239
1288
  private readonly loadingActive;
1240
- /** Raw delegation token for the `app-delegation` header. */
1241
- readonly token: _angular_core.Signal<string | null>;
1242
1289
  /** On-behalf-of (delegator). */
1243
1290
  readonly onBehalfOf: _angular_core.Signal<_masterteam_delegations.DelegationParty | null>;
1244
1291
  /** Executed-by (actual logged-in / delegated user). */
1245
1292
  readonly executedBy: _angular_core.Signal<_masterteam_delegations.DelegationParty | null>;
1246
1293
  readonly hasCandidates: _angular_core.Signal<boolean>;
1294
+ readonly hasMoreCandidates: _angular_core.Signal<boolean>;
1247
1295
  readonly isStarting: _angular_core.Signal<boolean>;
1248
1296
  readonly isLoadingCandidates: _angular_core.Signal<boolean>;
1249
- loadCandidates(): rxjs.Observable<void>;
1250
- markPrompted(prompted?: boolean): rxjs.Observable<void>;
1251
- startSession(delegation: DelegationRow): rxjs.Observable<void>;
1252
- switchSession(delegation: DelegationRow): rxjs.Observable<void>;
1253
- endSession(reason?: DelegationSessionInvalidationReason): rxjs.Observable<void>;
1254
- /**
1255
- * Reload so all data refetches under the new delegation context. The session
1256
- * slice is persisted, so the (new/cleared) session restores after reload.
1257
- * Deferred a tick to let NGXS storage flush first.
1258
- */
1259
- private reloadAfterSessionChange;
1297
+ loadCandidates(page?: number, pageSize?: number, append?: boolean): Observable<void>;
1298
+ loadMoreCandidates(): Observable<void>;
1299
+ claimPromptCandidates(candidates: DelegationRow[]): Promise<DelegationRow[]>;
1300
+ startSession(delegation: DelegationRow): Observable<void>;
1301
+ switchSession(delegation: DelegationRow): Observable<void>;
1302
+ endSession(reason?: DelegationSessionInvalidationReason): Observable<unknown>;
1260
1303
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<DelegationSessionFacade, never>;
1261
1304
  static ɵprov: _angular_core.ɵɵInjectableDeclaration<DelegationSessionFacade>;
1262
1305
  }
1263
1306
 
1264
- export { ApproveDelegation, CancelDelegation, ClearDelegationDetail, ClearScopePreview, CreateDelegationLegacy, CreateDelegationV2, DELEGATION_RELOAD_ON_SESSION_CHANGE, DelegationDetailDrawer, DelegationForm, DelegationMenuPanel, DelegationSessionActionKey, DelegationSessionFacade, DelegationSessionState, DelegationStatusChip, Delegations, DelegationsActionKey, DelegationsFacade, DelegationsList, DelegationsState, EndDelegationSession, GetActiveAssignedDelegations, GetAdminDelegations, GetApprovalDelegations, GetAssignedDelegations, GetDelegationDetail, GetMyDelegations, GetScopeOptions, LoadDelegationCandidates, MarkDelegationPrompted, PreviewScope, RejectDelegation, RejectDelegationDialog, ScopePicker, StartDelegationSession, StartSessionDialog, SwitchDelegationSession, TopbarDelegationMenu, UpdateDelegationLegacy, UpdateDelegationV2, appDelegationInterceptor };
1265
- export type { ActiveDelegationSession, AdminCreateDelegationV2Request, AdminUpdateDelegationV2Request, ApproveDelegationRequest, CreateDelegationLegacyRequest, CreateDelegationV2Request, DelegationAllowedAction, DelegationAppAccessibility, DelegationApprovalInfo, DelegationApprovalStatus, DelegationCancellationInfo, DelegationDayRuleMode, DelegationDetail, DelegationDisplayValue, DelegationDto, DelegationEffectiveStatus, DelegationGrant, DelegationListQuery, DelegationPage, DelegationParty, DelegationRow, DelegationScopeAction, DelegationScopeCombinationRule, DelegationScopeDeniedItem, DelegationScopeFact, DelegationScopeHierarchyGroup, DelegationScopeHierarchyTarget, DelegationScopeLevelNode, DelegationScopeModuleNode, DelegationScopeOptions, DelegationScopePermissionGroup, DelegationScopePreview, DelegationScopePreviewRequest, DelegationScopeSelection, DelegationScopeTarget, DelegationScopeView, DelegationScopeViewLevel, DelegationScopeViewModule, DelegationScopeViewOperation, DelegationScopeViewTemplate, DelegationScopeWarning, DelegationSessionInvalidationReason, DelegationSessionStateModel, DelegationSortDirection, DelegationStatusInfo, DelegationsStateModel, RejectDelegationRequest, UpdateDelegationLegacyRequest, UpdateDelegationV2Request };
1307
+ export { ApproveDelegation, CancelDelegation, ClearDelegationDetail, ClearScopePreview, CreateDelegationLegacy, CreateDelegationV2, DELEGATED_RUNTIME_REQUEST, DELEGATION_RUNTIME_CONFIG, DelegationDetailDrawer, DelegationForm, DelegationMenuPanel, DelegationSessionActionKey, DelegationSessionFacade, DelegationSessionState, DelegationStatusChip, Delegations, DelegationsActionKey, DelegationsFacade, DelegationsList, DelegationsState, EndDelegationSession, GetActiveAssignedDelegations, GetAdminDelegations, GetApprovalDelegations, GetAssignedDelegations, GetDelegationDetail, GetMyDelegations, GetScopeOptions, LoadDelegationCandidates, PreviewScope, RejectDelegation, RejectDelegationDialog, ScopePicker, StartDelegationSession, StartSessionDialog, SwitchDelegationSession, TopbarDelegationMenu, UpdateDelegationLegacy, UpdateDelegationV2, appDelegationInterceptor, provideDelegationRuntime, withDelegatedRuntime };
1308
+ export type { ActiveDelegationSession, AdminCreateDelegationV2Request, AdminUpdateDelegationV2Request, ApproveDelegationRequest, CreateDelegationLegacyRequest, CreateDelegationV2Request, DelegationAllowedAction, DelegationAppAccessibility, DelegationApprovalInfo, DelegationApprovalStatus, DelegationCancellationInfo, DelegationContextChange, DelegationDayRuleMode, DelegationDetail, DelegationDisplayValue, DelegationDto, DelegationEffectiveStatus, DelegationGrant, DelegationListQuery, DelegationPage, DelegationParty, DelegationPromptNamespace, DelegationRow, DelegationRuntimeConfig, DelegationScopeAction, DelegationScopeCombinationRule, DelegationScopeDeniedItem, DelegationScopeFact, DelegationScopeHierarchyGroup, DelegationScopeHierarchyTarget, DelegationScopeLevelNode, DelegationScopeModuleNode, DelegationScopeOptions, DelegationScopePermissionGroup, DelegationScopePreview, DelegationScopePreviewRequest, DelegationScopeSelection, DelegationScopeTarget, DelegationScopeView, DelegationScopeViewLevel, DelegationScopeViewModule, DelegationScopeViewOperation, DelegationScopeViewTemplate, DelegationScopeWarning, DelegationSessionInvalidationReason, DelegationSessionStartResponse, DelegationSessionStateModel, DelegationSortDirection, DelegationStatusInfo, DelegationsStateModel, RejectDelegationRequest, UpdateDelegationLegacyRequest, UpdateDelegationV2Request };