@masterteam/delegations 0.0.11 → 0.1.0

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.
@@ -1,16 +1,383 @@
1
+ import * as _masterteam_delegations from '@masterteam/delegations';
1
2
  import * as _angular_core from '@angular/core';
2
3
  import { OnInit, TemplateRef } from '@angular/core';
3
- import * as _masterteam_delegations from '@masterteam/delegations';
4
+ import { Popover } from 'primeng/popover';
4
5
  import { TableAction, ColumnDef } from '@masterteam/components/table';
5
- import { ModalService } from '@masterteam/components/modal';
6
6
  import { FormControl } from '@angular/forms';
7
+ import { HttpContext, HttpInterceptorFn } from '@angular/common/http';
8
+ import { DynamicFormConfig } from '@masterteam/components';
7
9
  import { ModalRef } from '@masterteam/components/dialog';
8
- import * as _masterteam_components from '@masterteam/components';
9
- import { CrudStateBase, DynamicFormConfig } from '@masterteam/components';
10
- import { HttpContext } from '@angular/common/http';
10
+ import { ModalService } from '@masterteam/components/modal';
11
11
  import * as rxjs from 'rxjs';
12
12
  import { StateContext } from '@ngxs/store';
13
13
 
14
+ interface LoadingStateShape<L extends string = string> {
15
+ loadingActive: L[];
16
+ errors: Partial<Record<L, string>>;
17
+ }
18
+
19
+ type DelegationStatus = 'PendingApproval' | 'Scheduled' | 'Active' | 'Expired' | 'Rejected' | 'Cancelled';
20
+ type DelegationApprovalStatus = 'NotRequired' | 'Pending' | 'Approved' | 'Rejected';
21
+ type DelegationActivationState = 'ApprovalRequired' | 'NotStarted' | 'OutsideAllowedDay' | 'Started';
22
+ type DelegationAllowedAction = 'View' | 'Edit' | 'Cancel' | 'Approve' | 'Reject' | 'GenerateToken' | 'StartSession' | 'Clone';
23
+ interface DelegationUser {
24
+ id: string;
25
+ displayName: string;
26
+ email?: string;
27
+ photo?: string;
28
+ }
29
+ interface DelegationDayRules {
30
+ type: 'FullRange' | 'SpecificDays';
31
+ specificDays: number[];
32
+ specificDayLabels?: string[];
33
+ }
34
+ interface DelegationApprovalMeta {
35
+ status: DelegationApprovalStatus;
36
+ approvedBy?: DelegationUser | null;
37
+ approvedAtUtc?: string | null;
38
+ rejectedBy?: DelegationUser | null;
39
+ rejectedAtUtc?: string | null;
40
+ rejectionReason?: string | null;
41
+ }
42
+ interface DelegationCancellationMeta {
43
+ cancelledBy?: DelegationUser | null;
44
+ cancelledAtUtc?: string | null;
45
+ cancellationReason?: string | null;
46
+ }
47
+ type DelegationTargetType = 'Level' | 'LevelModule' | 'ServiceModule' | 'ProcessStep' | 'Report' | 'SystemAction';
48
+ type DelegationPermissionModuleType = 'Level' | 'LevelModule';
49
+ type DelegationReadPolicy = 'ImplicitReadForSelectedActions' | 'ExplicitReadOnly' | 'NoReadUnlessOwnPermission';
50
+ interface DelegationScopeOperation {
51
+ operationKey: string;
52
+ permissionCommand: string;
53
+ displayName: string;
54
+ isHighRisk?: boolean;
55
+ }
56
+ interface DelegationScopeTarget {
57
+ targetType: DelegationTargetType;
58
+ targetId?: number;
59
+ displayName: string;
60
+ levelId?: number;
61
+ levelName?: string;
62
+ levelModuleId?: number;
63
+ domainModuleId?: number;
64
+ moduleKey: string;
65
+ moduleName?: string;
66
+ permissionModuleType?: DelegationPermissionModuleType;
67
+ permissionTargetId?: number;
68
+ operations: DelegationScopeOperation[];
69
+ dataFilter?: unknown;
70
+ constraints?: unknown;
71
+ }
72
+ interface DelegationScopeAccessibility {
73
+ appAccessibilityId: number;
74
+ accessibilityGroupId: number;
75
+ moduleKey: string;
76
+ moduleName: string;
77
+ groupName: string;
78
+ }
79
+ interface DelegationScopeWarning {
80
+ code: string;
81
+ message: string;
82
+ }
83
+ interface DelegationScope {
84
+ mode: 'Explicit';
85
+ summary: string;
86
+ readPolicy: DelegationReadPolicy;
87
+ accessibilities: DelegationScopeAccessibility[];
88
+ targets: DelegationScopeTarget[];
89
+ warnings: DelegationScopeWarning[];
90
+ }
91
+ interface DelegationScopeOperationOption {
92
+ operationKey: string;
93
+ permissionCommand: string;
94
+ displayName: string;
95
+ isDelegable: boolean;
96
+ isHighRisk?: boolean;
97
+ reason?: string;
98
+ }
99
+ interface DelegationScopeTargetOption {
100
+ targetType: DelegationTargetType;
101
+ targetId?: number;
102
+ displayName: string;
103
+ levelId?: number;
104
+ levelName?: string;
105
+ levelModuleId?: number;
106
+ domainModuleId?: number;
107
+ moduleKey: string;
108
+ moduleName?: string;
109
+ permissionModuleType?: DelegationPermissionModuleType;
110
+ permissionTargetId?: number;
111
+ operations: DelegationScopeOperationOption[];
112
+ }
113
+ interface DelegationScopeAccessibilityOption {
114
+ appAccessibilityId: number;
115
+ moduleKey: string;
116
+ moduleName: string;
117
+ groups: {
118
+ accessibilityGroupId: number;
119
+ name: string;
120
+ }[];
121
+ }
122
+ interface DelegationScopeReadPolicyOption {
123
+ key: DelegationReadPolicy;
124
+ isDefault: boolean;
125
+ }
126
+ interface DelegationScopePreset {
127
+ key: string;
128
+ displayName: string;
129
+ description: string;
130
+ }
131
+ interface DelegationScopeOptions {
132
+ delegator: DelegationUser;
133
+ scopeModes: 'Explicit'[];
134
+ readPolicies: DelegationScopeReadPolicyOption[];
135
+ accessibilities: DelegationScopeAccessibilityOption[];
136
+ targets: DelegationScopeTargetOption[];
137
+ recommendedPresets: DelegationScopePreset[];
138
+ }
139
+ interface DelegationScopeRequestTargetOperation {
140
+ operationKey: string;
141
+ permissionCommand: string;
142
+ }
143
+ interface DelegationScopeRequestTarget {
144
+ targetType: DelegationTargetType;
145
+ targetId?: number;
146
+ levelId?: number;
147
+ levelModuleId?: number;
148
+ domainModuleId?: number;
149
+ moduleKey: string;
150
+ permissionModuleType?: DelegationPermissionModuleType;
151
+ permissionTargetId?: number;
152
+ operations: DelegationScopeRequestTargetOperation[];
153
+ dataFilter?: unknown;
154
+ constraints?: unknown;
155
+ }
156
+ interface DelegationScopeRequest {
157
+ mode: 'Explicit';
158
+ readPolicy: DelegationReadPolicy;
159
+ accessibilityGroupIds: number[];
160
+ targets: DelegationScopeRequestTarget[];
161
+ }
162
+ interface DelegationScopePreviewDeniedItem {
163
+ targetType: DelegationTargetType;
164
+ targetId?: number;
165
+ operationKey: string;
166
+ permissionCommand: string;
167
+ reasonCode: string;
168
+ message: string;
169
+ }
170
+ interface DelegationScopePreview {
171
+ isValid: boolean;
172
+ normalizedScope?: DelegationScope;
173
+ summary?: string | null;
174
+ warnings: DelegationScopeWarning[];
175
+ deniedItems: DelegationScopePreviewDeniedItem[];
176
+ }
177
+ interface Delegation {
178
+ id: number;
179
+ delegator: DelegationUser;
180
+ delegatedUser: DelegationUser;
181
+ description?: string;
182
+ startDateUtc: string;
183
+ endDateUtc: string;
184
+ timeZoneId: string;
185
+ dayRules: DelegationDayRules;
186
+ status: DelegationStatus;
187
+ statusReason: string;
188
+ activationState: DelegationActivationState;
189
+ isUsableNow: boolean;
190
+ requiresApproval: boolean;
191
+ approval: DelegationApprovalMeta;
192
+ cancellation: DelegationCancellationMeta;
193
+ createdBy: DelegationUser;
194
+ createdAtUtc: string;
195
+ updatedBy?: DelegationUser | null;
196
+ updatedAtUtc?: string | null;
197
+ allowedActions: DelegationAllowedAction[];
198
+ scope: DelegationScope;
199
+ token: {
200
+ canGenerate: boolean;
201
+ reason?: string;
202
+ };
203
+ rowVersion: string;
204
+ calculatedAtUtc: string;
205
+ }
206
+ interface DelegationStatusHistoryEntry {
207
+ id: number;
208
+ fromStatus?: DelegationStatus | null;
209
+ toStatus: DelegationStatus;
210
+ fromApprovalStatus?: DelegationApprovalStatus | null;
211
+ toApprovalStatus?: DelegationApprovalStatus | null;
212
+ actor: DelegationUser;
213
+ action: string;
214
+ reason?: string | null;
215
+ createdAtUtc: string;
216
+ }
217
+ interface DelegationDetail extends Delegation {
218
+ statusHistory?: DelegationStatusHistoryEntry[];
219
+ }
220
+ /** Minimal shape returned by login + topbar candidate listing. */
221
+ interface DelegationSummary {
222
+ id: number;
223
+ delegator: DelegationUser;
224
+ delegatedUser: DelegationUser;
225
+ status: DelegationStatus;
226
+ allowedActions: DelegationAllowedAction[];
227
+ startDateUtc: string;
228
+ endDateUtc: string;
229
+ scopeSummary?: string;
230
+ }
231
+ interface DelegationListQuery {
232
+ page?: number;
233
+ pageSize?: number;
234
+ status?: DelegationStatus[];
235
+ q?: string;
236
+ startFrom?: string;
237
+ startTo?: string;
238
+ endFrom?: string;
239
+ endTo?: string;
240
+ activeOn?: string;
241
+ approvalStatus?: DelegationApprovalStatus;
242
+ moduleId?: number;
243
+ accessibilityGroupId?: number;
244
+ sortBy?: 'createdAt' | 'startDate' | 'endDate' | 'status' | 'delegatorName' | 'delegatedUserName';
245
+ sortDir?: 'asc' | 'desc';
246
+ }
247
+ interface PagedResult<T> {
248
+ items: T[];
249
+ page: number;
250
+ pageSize: number;
251
+ totalCount: number;
252
+ totalPages: number;
253
+ hasNextPage: boolean;
254
+ hasPreviousPage: boolean;
255
+ serverTimeUtc: string;
256
+ }
257
+ interface CreateDelegationRequest {
258
+ delegatedUserId: string;
259
+ description?: string;
260
+ startDateUtc: string;
261
+ endDateUtc: string;
262
+ timeZoneId: string;
263
+ dayRules: DelegationDayRules;
264
+ requiresApproval: boolean;
265
+ scope: DelegationScopeRequest;
266
+ }
267
+ interface UpdateDelegationRequest {
268
+ rowVersion: string;
269
+ description?: string;
270
+ startDateUtc: string;
271
+ endDateUtc: string;
272
+ timeZoneId: string;
273
+ dayRules: DelegationDayRules;
274
+ requiresApproval?: boolean;
275
+ scope: DelegationScopeRequest;
276
+ }
277
+ interface ApproveDelegationRequest {
278
+ rowVersion: string;
279
+ comment?: string;
280
+ }
281
+ interface RejectDelegationRequest {
282
+ rowVersion: string;
283
+ reason: string;
284
+ }
285
+ interface CancelDelegationRequest {
286
+ rowVersion: string;
287
+ reason: string;
288
+ }
289
+ interface DelegationTokenPair {
290
+ accessToken: string;
291
+ accessTokenExpiresAtUtc: string;
292
+ refreshToken: string;
293
+ refreshTokenExpiresAtUtc: string;
294
+ delegation: DelegationSummary;
295
+ }
296
+ declare enum DelegationsActionKey {
297
+ GetMyDelegations = "getMyDelegations",
298
+ GetAssignedDelegations = "getAssignedDelegations",
299
+ GetDelegation = "getDelegation",
300
+ CreateDelegation = "createDelegation",
301
+ UpdateDelegation = "updateDelegation",
302
+ ApproveDelegation = "approveDelegation",
303
+ RejectDelegation = "rejectDelegation",
304
+ CancelDelegation = "cancelDelegation",
305
+ GetScopeOptions = "getScopeOptions",
306
+ PreviewScope = "previewScope"
307
+ }
308
+ interface DelegationsStateModel extends LoadingStateShape<DelegationsActionKey> {
309
+ my: PagedResult<Delegation> | null;
310
+ assigned: PagedResult<Delegation> | null;
311
+ selected: DelegationDetail | null;
312
+ scopeOptions: DelegationScopeOptions | null;
313
+ scopePreview: DelegationScopePreview | null;
314
+ }
315
+
316
+ /**
317
+ * Topbar surface for the delegation runtime.
318
+ *
319
+ * State A — no candidates, no active session: renders nothing.
320
+ * State B — candidates exist, no active session: shows a "Switch identity" affordance.
321
+ * State C — active delegation session: shows the delegator name + back/switch.
322
+ *
323
+ * Designed to be projected into a host topbar's `[actions]` slot (alongside the
324
+ * existing user popover) — it does NOT replace the user dropdown.
325
+ */
326
+ declare class TopbarDelegationMenu {
327
+ /** Path to the management page, e.g. `/control-panel/delegations` or `/delegations`. */
328
+ readonly managePath: _angular_core.InputSignal<string>;
329
+ /** Compact mode hides the inline delegator name next to the button. */
330
+ readonly compact: _angular_core.InputSignal<boolean>;
331
+ private readonly facade;
332
+ private readonly modal;
333
+ private readonly transloco;
334
+ protected readonly popover: _angular_core.Signal<Popover>;
335
+ protected readonly active: _angular_core.Signal<_masterteam_delegations.ActiveDelegationSession | null>;
336
+ protected readonly candidates: _angular_core.Signal<DelegationSummary[]>;
337
+ protected readonly hasCandidates: _angular_core.Signal<boolean>;
338
+ protected readonly isStarting: _angular_core.Signal<boolean>;
339
+ protected readonly isEnding: _angular_core.Signal<boolean>;
340
+ protected readonly delegatorName: _angular_core.Signal<string>;
341
+ /** State machine: which UI to render. */
342
+ protected readonly mode: _angular_core.Signal<"active" | "candidates" | "hidden">;
343
+ togglePopover(event: Event): void;
344
+ startCandidate(candidate: DelegationSummary, event: MouseEvent): void;
345
+ switchTo(candidate: DelegationSummary, event: MouseEvent): void;
346
+ endSession(event: MouseEvent): void;
347
+ private openConfirmation;
348
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<TopbarDelegationMenu, never>;
349
+ 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; }; }, {}, never, never, true, never>;
350
+ }
351
+
352
+ interface StatusVisual {
353
+ i18nKey: string;
354
+ styleClass: string;
355
+ }
356
+ declare class DelegationStatusChip {
357
+ readonly status: _angular_core.InputSignal<DelegationStatus>;
358
+ protected readonly visual: _angular_core.Signal<StatusVisual>;
359
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<DelegationStatusChip, never>;
360
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<DelegationStatusChip, "mt-delegation-status-chip", never, { "status": { "alias": "status"; "required": true; "isSignal": true; }; }, {}, never, never, true, never>;
361
+ }
362
+
363
+ /**
364
+ * Confirmation dialog opened by the topbar menu before starting (or switching to)
365
+ * a delegated session. Calls the facade and closes itself on success.
366
+ */
367
+ declare class StartSessionDialog {
368
+ readonly candidate: _angular_core.InputSignal<DelegationSummary>;
369
+ readonly intent: _angular_core.InputSignal<"start" | "switch">;
370
+ private readonly ref;
371
+ private readonly facade;
372
+ protected readonly isBusy: _angular_core.Signal<boolean>;
373
+ protected readonly title: _angular_core.Signal<"delegations.switch-session-confirm-title" | "delegations.start-session-confirm-title">;
374
+ protected readonly body: _angular_core.Signal<"delegations.switch-session-confirm-body" | "delegations.start-session-confirm-body">;
375
+ confirm(): void;
376
+ cancel(): void;
377
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<StartSessionDialog, never>;
378
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<StartSessionDialog, "mt-start-session-dialog", never, { "candidate": { "alias": "candidate"; "required": true; "isSignal": true; }; "intent": { "alias": "intent"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
379
+ }
380
+
14
381
  declare class Delegations {
15
382
  private readonly router;
16
383
  goBack(): void;
@@ -18,15 +385,23 @@ declare class Delegations {
18
385
  static ɵcmp: _angular_core.ɵɵComponentDeclaration<Delegations, "mt-delegations", never, {}, {}, never, never, true, never>;
19
386
  }
20
387
 
388
+ type DelegationTab = 'my' | 'assigned';
389
+ /**
390
+ * DelegationsPage — replaces the legacy single-list CRUD view with the target
391
+ * two-list portal contract: "My Delegations" (I am delegator) and "Delegated To Me".
392
+ *
393
+ * - Rows render the BE-returned `allowedActions` only (never inferred).
394
+ * - Lifecycle actions (Approve/Reject/Cancel/Edit/StartSession) dispatch through
395
+ * the facade and the row is replaced in place from the response.
396
+ * - Scope/detail drawer and full scope-picker form are still incremental work;
397
+ * the form drawer here covers Edit/Create with the core fields.
398
+ */
21
399
  declare class DelegationsList implements OnInit {
22
- statusCol: _angular_core.Signal<TemplateRef<any>>;
23
- userCol: _angular_core.Signal<TemplateRef<any>>;
24
- userCol2: _angular_core.Signal<TemplateRef<any>>;
25
- daysCol: _angular_core.Signal<TemplateRef<any>>;
26
400
  private readonly facade;
27
- readonly modal: ModalService;
28
- private readonly translocoService;
29
- breadcrumbItems: _angular_core.WritableSignal<({
401
+ private readonly session;
402
+ private readonly modal;
403
+ private readonly transloco;
404
+ protected readonly breadcrumbItems: _angular_core.WritableSignal<({
30
405
  label: string;
31
406
  icon: string;
32
407
  routerLink: string;
@@ -39,104 +414,229 @@ declare class DelegationsList implements OnInit {
39
414
  icon?: undefined;
40
415
  routerLink?: undefined;
41
416
  })[]>;
42
- delegations: _angular_core.Signal<_masterteam_delegations.Delegation[]>;
43
- tabs: _angular_core.WritableSignal<{
417
+ protected readonly activeTab: _angular_core.WritableSignal<DelegationTab>;
418
+ protected readonly tabs: _angular_core.WritableSignal<{
419
+ value: DelegationTab;
44
420
  label: string;
45
- value: string;
46
421
  }[]>;
47
- activeTab: _angular_core.WritableSignal<string>;
48
- tableActions: _angular_core.WritableSignal<TableAction[]>;
49
- deletingRowIds: _angular_core.WritableSignal<any[]>;
50
- rowActions: _angular_core.WritableSignal<TableAction[]>;
51
- tableColumns: _angular_core.WritableSignal<ColumnDef[]>;
52
- loading: _angular_core.Signal<boolean>;
53
- private allDelegations;
54
- private activeDelegations;
55
- private inactiveDelegations;
422
+ protected readonly isLoading: _angular_core.Signal<boolean>;
423
+ protected readonly rows: _angular_core.Signal<Delegation[]>;
424
+ statusCol: _angular_core.Signal<TemplateRef<unknown>>;
425
+ userCol: _angular_core.Signal<TemplateRef<unknown>>;
426
+ scopeCol: _angular_core.Signal<TemplateRef<unknown>>;
427
+ daysCol: _angular_core.Signal<TemplateRef<unknown>>;
428
+ protected readonly tableActions: _angular_core.WritableSignal<TableAction[]>;
429
+ protected readonly rowActions: _angular_core.WritableSignal<TableAction[]>;
430
+ protected readonly tableColumns: _angular_core.WritableSignal<ColumnDef[]>;
431
+ private readonly busyIds;
432
+ private readonly weekdayKeys;
56
433
  ngOnInit(): void;
57
- addDelegationDialog(delegation?: any | null): void;
434
+ protected switchTab(tab: DelegationTab): void;
435
+ private loadCurrentTab;
436
+ protected has(row: Delegation, action: DelegationAllowedAction): boolean;
437
+ protected formatDays(row: Delegation): string;
438
+ private viewDetails;
439
+ private openForm;
440
+ private approve;
441
+ private reject;
442
+ private cancel;
443
+ private startSession;
444
+ private mark;
58
445
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<DelegationsList, never>;
59
446
  static ɵcmp: _angular_core.ɵɵComponentDeclaration<DelegationsList, "mt-delegations-list", never, {}, {}, never, never, true, never>;
60
447
  }
61
448
 
62
- interface LoadingStateShape<L extends string = string> {
63
- loadingActive: L[];
64
- errors: Partial<Record<L, string>>;
449
+ /**
450
+ * Delegation create/edit form, target-shape compliant.
451
+ *
452
+ * - Delegator is server-derived from the authenticated principal — not collected
453
+ * here (admin "create on behalf of" lives behind a separate flag).
454
+ * - `isActive` no longer exists; status is server-calculated.
455
+ * - Scope is collected by `<mt-scope-picker>` (loaded from `/scope/options`)
456
+ * and validated via `/scope/preview` on every change. Edit mode rehydrates
457
+ * the scope from the loaded delegation.
458
+ */
459
+ declare class DelegationForm implements OnInit {
460
+ readonly delegationForEdit: _angular_core.InputSignal<Delegation | null>;
461
+ readonly readonly: _angular_core.InputSignal<boolean>;
462
+ private readonly halfWidth;
463
+ private readonly fullWidth;
464
+ modal: ModalService;
465
+ ref: ModalRef;
466
+ private readonly transloco;
467
+ private readonly facade;
468
+ delegationFormControl: FormControl<any>;
469
+ formValue: _angular_core.Signal<any>;
470
+ selected: _angular_core.Signal<_masterteam_delegations.DelegationDetail | null>;
471
+ isDetailLoading: _angular_core.Signal<boolean>;
472
+ isSaving: _angular_core.Signal<boolean>;
473
+ context: HttpContext;
474
+ protected readonly isDelegatingToSelf: _angular_core.Signal<boolean>;
475
+ protected readonly scope: _angular_core.WritableSignal<DelegationScopeRequest>;
476
+ protected readonly specificDaysOptions: _angular_core.WritableSignal<{
477
+ label: string;
478
+ value: number;
479
+ }[]>;
480
+ protected readonly delegationFormConfig: _angular_core.Signal<DynamicFormConfig>;
481
+ constructor();
482
+ ngOnInit(): void;
483
+ onSubmit(): void;
484
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<DelegationForm, never>;
485
+ 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>;
65
486
  }
66
487
 
67
- interface DelegationUser {
68
- id: string;
69
- userId: string;
70
- displayName: string;
71
- mobile: string;
72
- userName: string;
73
- email: string;
74
- photo: string;
488
+ type DetailTab = 'overview' | 'scope' | 'history';
489
+ /**
490
+ * Read-only drawer that shows the full server DTO of a delegation, including
491
+ * its status history. Triggered from the row's "View details" action.
492
+ */
493
+ declare class DelegationDetailDrawer implements OnInit {
494
+ /** Delegation id passed in via the modal's inputValues. */
495
+ readonly delegationId: _angular_core.InputSignal<number>;
496
+ private readonly facade;
497
+ private readonly transloco;
498
+ protected readonly ref: ModalRef;
499
+ protected readonly tabs: {
500
+ key: DetailTab;
501
+ i18n: string;
502
+ }[];
503
+ protected readonly activeTab: _angular_core.WritableSignal<DetailTab>;
504
+ protected readonly isLoading: _angular_core.Signal<boolean>;
505
+ protected readonly detail: _angular_core.Signal<DelegationDetail | null>;
506
+ protected readonly statusHistory: _angular_core.Signal<DelegationStatusHistoryEntry[]>;
507
+ ngOnInit(): void;
508
+ protected setTab(tab: DetailTab): void;
509
+ protected approvalLabel(): string;
510
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<DelegationDetailDrawer, never>;
511
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<DelegationDetailDrawer, "mt-delegation-detail-drawer", never, { "delegationId": { "alias": "delegationId"; "required": true; "isSignal": true; }; }, {}, never, never, true, never>;
75
512
  }
76
- interface DelegationDateTime {
77
- displayValue: string;
78
- actualValue: string;
513
+
514
+ interface AccessibilityGroupOption {
515
+ appAccessibilityId: number;
516
+ accessibilityGroupId: number;
517
+ moduleName: string;
518
+ groupName: string;
79
519
  }
80
- interface Delegation {
81
- id?: number;
82
- delegateFrom?: DelegationUser;
83
- delegateTo?: DelegationUser;
84
- delegateFromDateTime?: DelegationDateTime;
85
- delegateToDateTime?: DelegationDateTime;
86
- delegationStatus?: boolean;
87
- isActive?: boolean;
88
- description?: string;
89
- delegationDaysType?: 'fullRange' | 'specificDays';
90
- specificDays?: number[];
91
- }
92
- interface DelegationFormData {
93
- delegateTo: string;
94
- delegateFromDateTime: string;
95
- delegateToDateTime: string;
96
- delegateFrom: string;
97
- description?: string;
98
- delegationDaysType?: 'fullRange' | 'specificDays';
99
- specificDays?: number[];
100
- isActive?: boolean;
520
+ /**
521
+ * Scope picker driven entirely by Identity-provided options.
522
+ *
523
+ * - `[(scope)]` two-way binds a normalized `DelegationScopeRequest`.
524
+ * - Loads options via `DelegationsFacade.loadScopeOptions()` on init.
525
+ * - Calls `/scope/preview` (debounced) so the user sees the server-built summary
526
+ * and denied items before they save.
527
+ * - Non-delegable operations render disabled with the BE-supplied `reason`.
528
+ */
529
+ declare class ScopePicker implements OnInit {
530
+ /** Two-way bound — the form drives initial value and reads updates back. */
531
+ readonly scope: _angular_core.ModelSignal<DelegationScopeRequest>;
532
+ readonly readonly: _angular_core.InputSignal<boolean>;
533
+ /** Admin scope-as-another-user — passed through to the options endpoint. */
534
+ readonly delegatorUserId: _angular_core.InputSignal<string | undefined>;
535
+ private readonly facade;
536
+ private readonly transloco;
537
+ protected readonly options: _angular_core.Signal<_masterteam_delegations.DelegationScopeOptions | null>;
538
+ protected readonly preview: _angular_core.Signal<_masterteam_delegations.DelegationScopePreview | null>;
539
+ protected readonly isLoadingOptions: _angular_core.Signal<boolean>;
540
+ protected readonly isPreviewing: _angular_core.Signal<boolean>;
541
+ /** Set of accordion target keys currently expanded. */
542
+ private readonly expanded;
543
+ protected readonly readPolicies: _angular_core.Signal<_masterteam_delegations.DelegationScopeReadPolicyOption[]>;
544
+ /** Flat list of accessibility group options (across modules). */
545
+ protected readonly accessibilityGroups: _angular_core.Signal<AccessibilityGroupOption[]>;
546
+ /** Targets grouped by `targetType` for the accordion UI. */
547
+ protected readonly groupedTargets: _angular_core.Signal<{
548
+ type: string;
549
+ items: DelegationScopeTargetOption[];
550
+ }[]>;
551
+ /** O(1) lookup: is this accessibility group selected? */
552
+ protected readonly selectedAccessibilityIds: _angular_core.Signal<Set<number>>;
553
+ /** O(1) lookup: which targets are picked, and which ops per target? */
554
+ protected readonly selectedTargetMap: _angular_core.Signal<Map<string, Set<string>>>;
555
+ ngOnInit(): void;
556
+ constructor();
557
+ protected setReadPolicy(policy: DelegationReadPolicy): void;
558
+ protected toggleAccessibility(group: AccessibilityGroupOption): void;
559
+ protected isAccessibilitySelected(group: AccessibilityGroupOption): boolean;
560
+ protected toggleAccordion(target: DelegationScopeTargetOption): void;
561
+ protected isExpanded(target: DelegationScopeTargetOption): boolean;
562
+ protected toggleOperation(target: DelegationScopeTargetOption, op: DelegationScopeOperationOption): void;
563
+ protected isOperationSelected(target: DelegationScopeTargetOption, op: DelegationScopeOperationOption): boolean;
564
+ protected selectedOpsCount(target: DelegationScopeTargetOption): number;
565
+ protected reasonLabel(op: DelegationScopeOperationOption): string;
566
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<ScopePicker, never>;
567
+ 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>;
101
568
  }
102
- declare enum DelegationsActionKey {
103
- GetDelegations = "getDelegations",
104
- AddDelegation = "addDelegation",
105
- UpdateDelegation = "updateDelegation",
106
- DeleteDelegation = "deleteDelegation",
107
- GetDelegationForm = "getDelegationForm"
569
+
570
+ /**
571
+ * Adds `app-delegation: Bearer <token>` to outgoing requests when a delegation
572
+ * session is active. Token-management endpoints are excluded.
573
+ *
574
+ * Register AFTER the gateway-auth interceptor (so `Authorization` is set first)
575
+ * and BEFORE the message interceptor (so 403s still flow through toast handling).
576
+ */
577
+ declare const appDelegationInterceptor: HttpInterceptorFn;
578
+
579
+ declare class GetMyDelegations {
580
+ query: DelegationListQuery;
581
+ static readonly type = "[Delegations] Get My Delegations";
582
+ constructor(query?: DelegationListQuery);
108
583
  }
109
- interface DelegationsStateModel extends LoadingStateShape<DelegationsActionKey> {
110
- allDelegations: Delegation[];
111
- selectedDelegation: Delegation | null;
584
+ declare class GetAssignedDelegations {
585
+ query: DelegationListQuery;
586
+ static readonly type = "[Delegations] Get Assigned Delegations";
587
+ constructor(query?: DelegationListQuery);
112
588
  }
113
-
114
- declare class GetDelegations {
115
- static readonly type = "[Delegations] Get Delegations";
589
+ declare class GetDelegation {
590
+ id: number;
591
+ includeStatusHistory: boolean;
592
+ static readonly type = "[Delegations] Get Delegation";
593
+ constructor(id: number, includeStatusHistory?: boolean);
116
594
  }
117
- declare class AddDelegation {
118
- delegation: DelegationFormData;
119
- static readonly type = "[Delegations] Add Delegation";
120
- constructor(delegation: DelegationFormData);
595
+ declare class ClearSelectedDelegation {
596
+ static readonly type = "[Delegations] Clear Selected Delegation";
597
+ }
598
+ declare class CreateDelegation {
599
+ request: CreateDelegationRequest;
600
+ static readonly type = "[Delegations] Create Delegation";
601
+ constructor(request: CreateDelegationRequest);
121
602
  }
122
603
  declare class UpdateDelegation {
123
604
  id: number;
124
- delegation: DelegationFormData;
605
+ request: UpdateDelegationRequest;
125
606
  static readonly type = "[Delegations] Update Delegation";
126
- constructor(id: number, delegation: DelegationFormData);
607
+ constructor(id: number, request: UpdateDelegationRequest);
127
608
  }
128
- declare class DeleteDelegation {
609
+ declare class ApproveDelegation {
129
610
  id: number;
130
- static readonly type = "[Delegations] Delete Delegation";
131
- constructor(id: number);
611
+ request: ApproveDelegationRequest;
612
+ static readonly type = "[Delegations] Approve Delegation";
613
+ constructor(id: number, request: ApproveDelegationRequest);
132
614
  }
133
- declare class GetDelegation {
615
+ declare class RejectDelegation {
134
616
  id: number;
135
- static readonly type = "[Delegations] Get Delegation";
136
- constructor(id: number);
617
+ request: RejectDelegationRequest;
618
+ static readonly type = "[Delegations] Reject Delegation";
619
+ constructor(id: number, request: RejectDelegationRequest);
137
620
  }
138
- declare class ClearSelectedDelegation {
139
- static readonly type = "[Delegations] Clear Selected Delegation";
621
+ declare class CancelDelegation {
622
+ id: number;
623
+ request: CancelDelegationRequest;
624
+ static readonly type = "[Delegations] Cancel Delegation";
625
+ constructor(id: number, request: CancelDelegationRequest);
626
+ }
627
+ declare class GetScopeOptions {
628
+ delegatorUserId?: string | undefined;
629
+ static readonly type = "[Delegations] Get Scope Options";
630
+ /** Admin-only override; ignored for normal users. */
631
+ constructor(delegatorUserId?: string | undefined);
632
+ }
633
+ declare class PreviewScope {
634
+ scope: DelegationScopeRequest;
635
+ static readonly type = "[Delegations] Preview Scope";
636
+ constructor(scope: DelegationScopeRequest);
637
+ }
638
+ declare class ClearScopePreview {
639
+ static readonly type = "[Delegations] Clear Scope Preview";
140
640
  }
141
641
 
142
642
  interface Response<T> {
@@ -150,77 +650,198 @@ interface Response<T> {
150
650
  cacheSession?: string;
151
651
  }
152
652
 
153
- declare class DelegationsState extends CrudStateBase<Delegation, DelegationsStateModel, DelegationsActionKey> {
653
+ declare class DelegationsState {
154
654
  private http;
155
- static getAllDelegations(state: DelegationsStateModel): Delegation[];
156
- static getSelectedDelegation(state: DelegationsStateModel): Delegation | null;
655
+ static getMyPage(state: DelegationsStateModel): PagedResult<Delegation> | null;
656
+ static getAssignedPage(state: DelegationsStateModel): PagedResult<Delegation> | null;
657
+ static getSelected(state: DelegationsStateModel): DelegationDetail | null;
658
+ static getScopeOptions(state: DelegationsStateModel): DelegationScopeOptions | null;
659
+ static getScopePreview(state: DelegationsStateModel): DelegationScopePreview | null;
157
660
  static getLoadingActive(state: DelegationsStateModel): string[];
158
- static getErrors(state: DelegationsStateModel): Record<string, string | null>;
159
- getDelegations(ctx: StateContext<DelegationsStateModel>): rxjs.Observable<Response<Delegation[]>>;
160
- getDelegation(ctx: StateContext<DelegationsStateModel>, { id }: GetDelegation): rxjs.Observable<Response<Delegation>>;
161
- addDelegation(ctx: StateContext<DelegationsStateModel>, { delegation }: AddDelegation): rxjs.Observable<_masterteam_components.Response<Delegation>>;
162
- updateDelegation(ctx: StateContext<DelegationsStateModel>, { id, delegation }: UpdateDelegation): rxjs.Observable<_masterteam_components.Response<Delegation>>;
163
- deleteDelegation(ctx: StateContext<DelegationsStateModel>, { id }: DeleteDelegation): rxjs.Observable<_masterteam_components.Response<void>>;
661
+ static getErrors(state: DelegationsStateModel): Record<string, string | null | undefined>;
662
+ getMyDelegations(ctx: StateContext<DelegationsStateModel>, { query }: GetMyDelegations): rxjs.Observable<Response<PagedResult<Delegation>>>;
663
+ getAssignedDelegations(ctx: StateContext<DelegationsStateModel>, { query }: GetAssignedDelegations): rxjs.Observable<Response<PagedResult<Delegation>>>;
664
+ getDelegation(ctx: StateContext<DelegationsStateModel>, { id, includeStatusHistory }: GetDelegation): rxjs.Observable<Response<DelegationDetail>>;
164
665
  clearSelectedDelegation(ctx: StateContext<DelegationsStateModel>): void;
666
+ createDelegation(ctx: StateContext<DelegationsStateModel>, { request }: CreateDelegation): rxjs.Observable<Response<Delegation>>;
667
+ updateDelegation(ctx: StateContext<DelegationsStateModel>, { id, request }: UpdateDelegation): rxjs.Observable<Response<Delegation>>;
668
+ approveDelegation(ctx: StateContext<DelegationsStateModel>, { id, request }: ApproveDelegation): rxjs.Observable<Response<Delegation>>;
669
+ rejectDelegation(ctx: StateContext<DelegationsStateModel>, { id, request }: RejectDelegation): rxjs.Observable<Response<Delegation>>;
670
+ cancelDelegation(ctx: StateContext<DelegationsStateModel>, { id, request }: CancelDelegation): rxjs.Observable<Response<Delegation>>;
671
+ getScopeOptions(ctx: StateContext<DelegationsStateModel>, { delegatorUserId }: GetScopeOptions): rxjs.Observable<Response<DelegationScopeOptions>>;
672
+ previewScope(ctx: StateContext<DelegationsStateModel>, { scope }: PreviewScope): rxjs.Observable<Response<DelegationScopePreview>>;
673
+ clearScopePreview(ctx: StateContext<DelegationsStateModel>): void;
674
+ private applyLifecycleResult;
165
675
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<DelegationsState, never>;
166
676
  static ɵprov: _angular_core.ɵɵInjectableDeclaration<DelegationsState>;
167
677
  }
168
678
 
169
679
  declare class DelegationsFacade {
170
680
  private readonly store;
171
- readonly allDelegations: _angular_core.Signal<_masterteam_delegations.Delegation[]>;
172
- readonly selectedDelegation: _angular_core.Signal<_masterteam_delegations.Delegation | null>;
681
+ readonly myPage: _angular_core.Signal<_masterteam_delegations.PagedResult<_masterteam_delegations.Delegation> | null>;
682
+ readonly assignedPage: _angular_core.Signal<_masterteam_delegations.PagedResult<_masterteam_delegations.Delegation> | null>;
683
+ readonly selected: _angular_core.Signal<_masterteam_delegations.DelegationDetail | null>;
684
+ readonly scopeOptions: _angular_core.Signal<_masterteam_delegations.DelegationScopeOptions | null>;
685
+ readonly scopePreview: _angular_core.Signal<_masterteam_delegations.DelegationScopePreview | null>;
173
686
  private readonly loadingActive;
174
687
  private readonly errors;
175
- readonly isLoadingDelegations: _angular_core.Signal<boolean>;
176
- readonly isLoadingDelegation: _angular_core.Signal<boolean>;
177
- readonly isAddingDelegation: _angular_core.Signal<boolean>;
178
- readonly isUpdatingDelegation: _angular_core.Signal<boolean>;
179
- readonly isDeletingDelegation: _angular_core.Signal<boolean>;
180
- readonly delegationsError: _angular_core.Signal<string | null>;
181
- readonly delegationError: _angular_core.Signal<string | null>;
182
- readonly addDelegationError: _angular_core.Signal<string | null>;
183
- readonly updateDelegationError: _angular_core.Signal<string | null>;
184
- readonly deleteDelegationError: _angular_core.Signal<string | null>;
185
- readonly activeDelegations: _angular_core.Signal<_masterteam_delegations.Delegation[]>;
186
- readonly inactiveDelegations: _angular_core.Signal<_masterteam_delegations.Delegation[]>;
187
- getDelegations(): rxjs.Observable<void>;
188
- addDelegation(delegation: DelegationFormData): rxjs.Observable<void>;
189
- updateDelegation(id: number, delegation: DelegationFormData): rxjs.Observable<void>;
190
- deleteDelegation(id: number): rxjs.Observable<void>;
191
- loadDelegation(id: number): rxjs.Observable<void>;
192
- clearSelectedDelegation(): rxjs.Observable<void>;
688
+ readonly myItems: _angular_core.Signal<_masterteam_delegations.Delegation[]>;
689
+ readonly assignedItems: _angular_core.Signal<_masterteam_delegations.Delegation[]>;
690
+ readonly isLoadingMy: _angular_core.Signal<boolean>;
691
+ readonly isLoadingAssigned: _angular_core.Signal<boolean>;
692
+ readonly isLoadingDetail: _angular_core.Signal<boolean>;
693
+ readonly isCreating: _angular_core.Signal<boolean>;
694
+ readonly isUpdating: _angular_core.Signal<boolean>;
695
+ readonly isApproving: _angular_core.Signal<boolean>;
696
+ readonly isRejecting: _angular_core.Signal<boolean>;
697
+ readonly isCancelling: _angular_core.Signal<boolean>;
698
+ readonly isLoadingScopeOptions: _angular_core.Signal<boolean>;
699
+ readonly isPreviewingScope: _angular_core.Signal<boolean>;
700
+ readonly errorMy: _angular_core.Signal<string | null>;
701
+ readonly errorAssigned: _angular_core.Signal<string | null>;
702
+ readonly errorDetail: _angular_core.Signal<string | null>;
703
+ readonly errorCreate: _angular_core.Signal<string | null>;
704
+ readonly errorUpdate: _angular_core.Signal<string | null>;
705
+ readonly errorApprove: _angular_core.Signal<string | null>;
706
+ readonly errorReject: _angular_core.Signal<string | null>;
707
+ readonly errorCancel: _angular_core.Signal<string | null>;
708
+ getMy(query?: DelegationListQuery): rxjs.Observable<void>;
709
+ getAssigned(query?: DelegationListQuery): rxjs.Observable<void>;
710
+ getOne(id: number, includeStatusHistory?: boolean): rxjs.Observable<void>;
711
+ clearSelected(): rxjs.Observable<void>;
712
+ create(request: CreateDelegationRequest): rxjs.Observable<void>;
713
+ update(id: number, request: UpdateDelegationRequest): rxjs.Observable<void>;
714
+ approve(id: number, request: ApproveDelegationRequest): rxjs.Observable<void>;
715
+ reject(id: number, request: RejectDelegationRequest): rxjs.Observable<void>;
716
+ cancel(id: number, request: CancelDelegationRequest): rxjs.Observable<void>;
717
+ loadScopeOptions(delegatorUserId?: string): rxjs.Observable<void>;
718
+ previewScope(scope: DelegationScopeRequest): rxjs.Observable<void>;
719
+ clearScopePreview(): rxjs.Observable<void>;
193
720
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<DelegationsFacade, never>;
194
721
  static ɵprov: _angular_core.ɵɵInjectableDeclaration<DelegationsFacade>;
195
722
  }
196
723
 
197
- declare class DelegationForm implements OnInit {
198
- private readonly halfWidthFieldClass;
199
- private readonly fullWidthFieldClass;
200
- modal: ModalService;
201
- ref: ModalRef;
202
- delegationForEdit: _angular_core.InputSignal<Delegation | null>;
203
- private readonly translocoService;
204
- private readonly facade;
205
- selectedDelegation: _angular_core.Signal<Delegation | null>;
206
- delegationFormControl: FormControl<any>;
207
- formValue: _angular_core.Signal<any>;
208
- getDelegationFormLoading: _angular_core.Signal<boolean>;
209
- isAddingDelegation: _angular_core.Signal<boolean>;
210
- isUpdatingDelegation: _angular_core.Signal<boolean>;
211
- context: HttpContext;
212
- isDelegatingToSelf: _angular_core.Signal<boolean>;
213
- specificDaysOptions: _angular_core.WritableSignal<{
214
- label: string;
215
- value: number;
216
- }[]>;
217
- delegationFormConfig: _angular_core.Signal<DynamicFormConfig>;
724
+ declare const DELEGATION_SESSION_STORAGE_KEY = "mt.delegation.session.v1";
725
+ interface ActiveDelegationSession {
726
+ accessToken: string;
727
+ accessTokenExpiresAtUtc: string;
728
+ refreshToken: string;
729
+ refreshTokenExpiresAtUtc: string;
730
+ delegation: DelegationSummary;
731
+ }
732
+ declare function toActiveSession(pair: DelegationTokenPair): ActiveDelegationSession;
733
+ declare enum DelegationSessionActionKey {
734
+ Bootstrap = "bootstrap",
735
+ StartSession = "startSession",
736
+ EndSession = "endSession",
737
+ RefreshSession = "refreshSession",
738
+ GetSession = "getSession"
739
+ }
740
+ interface DelegationSessionStateModel extends LoadingStateShape<DelegationSessionActionKey> {
741
+ active: ActiveDelegationSession | null;
742
+ candidates: DelegationSummary[];
743
+ }
744
+
745
+ /** Reads sessionStorage + login candidates, restores any tab-local active session. */
746
+ declare class BootstrapDelegationSession {
747
+ static readonly type = "[DelegationSession] Bootstrap";
748
+ }
749
+ /** Replaces the candidate pool (called after LoginSuccess or when user.delegations changes). */
750
+ declare class SetDelegationCandidates {
751
+ candidates: DelegationSummary[];
752
+ static readonly type = "[DelegationSession] Set Candidates";
753
+ constructor(candidates: DelegationSummary[]);
754
+ }
755
+ /** Start a delegated session for the given assignment. */
756
+ declare class StartDelegationSession {
757
+ delegationId: number;
758
+ static readonly type = "[DelegationSession] Start";
759
+ constructor(delegationId: number);
760
+ }
761
+ /** End the current delegated session (server + local). */
762
+ declare class EndDelegationSession {
763
+ options: {
764
+ silent?: boolean;
765
+ };
766
+ static readonly type = "[DelegationSession] End";
767
+ constructor(options?: {
768
+ silent?: boolean;
769
+ });
770
+ }
771
+ /** Atomically end current + start another. */
772
+ declare class SwitchDelegationSession {
773
+ delegationId: number;
774
+ static readonly type = "[DelegationSession] Switch";
775
+ constructor(delegationId: number);
776
+ }
777
+ /** Refresh the delegation access token via refresh-token rotation. */
778
+ declare class RefreshDelegationSession {
779
+ static readonly type = "[DelegationSession] Refresh";
780
+ }
781
+ /** Verify the current session against the server (used after bootstrap). */
782
+ declare class VerifyDelegationSession {
783
+ static readonly type = "[DelegationSession] Verify";
784
+ }
785
+ /** Surface a recoverable session error from any pipeline (e.g. 403 codes). */
786
+ declare class DelegationSessionInvalidated {
787
+ reason: 'TokenPrincipalMismatch' | 'NotActive' | 'ScopeDenied' | 'Expired' | 'Unknown';
788
+ static readonly type = "[DelegationSession] Invalidated";
789
+ constructor(reason: 'TokenPrincipalMismatch' | 'NotActive' | 'ScopeDenied' | 'Expired' | 'Unknown');
790
+ }
791
+
792
+ /**
793
+ * Filters a delegation list to "candidates the user could activate".
794
+ * Active + StartSession in allowedActions is the runtime gate.
795
+ */
796
+ declare function pickCandidates(delegations: DelegationSummary[] | undefined | null): DelegationSummary[];
797
+ declare class DelegationSessionState {
798
+ private http;
799
+ private actions$;
800
+ private store;
218
801
  constructor();
219
- ngOnInit(): void;
220
- onSubmit(): void;
221
- static ɵfac: _angular_core.ɵɵFactoryDeclaration<DelegationForm, never>;
222
- static ɵcmp: _angular_core.ɵɵComponentDeclaration<DelegationForm, "mt-delegation-form", never, { "delegationForEdit": { "alias": "delegationForEdit"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
802
+ static getActive(state: DelegationSessionStateModel): ActiveDelegationSession | null;
803
+ static getCandidates(state: DelegationSessionStateModel): DelegationSummary[];
804
+ static isDelegated(state: DelegationSessionStateModel): boolean;
805
+ static getLoadingActive(state: DelegationSessionStateModel): string[];
806
+ static getErrors(state: DelegationSessionStateModel): Record<string, string | null | undefined>;
807
+ bootstrap(ctx: StateContext<DelegationSessionStateModel>): void;
808
+ setCandidates(ctx: StateContext<DelegationSessionStateModel>, { candidates }: SetDelegationCandidates): void;
809
+ verify(ctx: StateContext<DelegationSessionStateModel>): rxjs.Observable<Response<DelegationSummary | null>>;
810
+ start(ctx: StateContext<DelegationSessionStateModel>, { delegationId }: StartDelegationSession): rxjs.Observable<Response<DelegationTokenPair>>;
811
+ end(ctx: StateContext<DelegationSessionStateModel>, { options }: EndDelegationSession): rxjs.Observable<Response<void>>;
812
+ switch(ctx: StateContext<DelegationSessionStateModel>, { delegationId }: SwitchDelegationSession): rxjs.Observable<void>;
813
+ refresh(ctx: StateContext<DelegationSessionStateModel>): rxjs.Observable<Response<DelegationTokenPair>>;
814
+ invalidated(ctx: StateContext<DelegationSessionStateModel>): rxjs.Observable<never>;
815
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<DelegationSessionState, never>;
816
+ static ɵprov: _angular_core.ɵɵInjectableDeclaration<DelegationSessionState>;
817
+ }
818
+
819
+ declare class DelegationSessionFacade {
820
+ private readonly store;
821
+ readonly active: _angular_core.Signal<_masterteam_delegations.ActiveDelegationSession | null>;
822
+ readonly candidates: _angular_core.Signal<DelegationSummary[]>;
823
+ readonly isDelegated: _angular_core.Signal<boolean>;
824
+ private readonly loadingActive;
825
+ readonly delegator: _angular_core.Signal<_masterteam_delegations.DelegationUser | null>;
826
+ readonly accessToken: _angular_core.Signal<string | null>;
827
+ readonly accessTokenExpiresAtUtc: _angular_core.Signal<string | null>;
828
+ readonly hasCandidates: _angular_core.Signal<boolean>;
829
+ readonly isStartingSession: _angular_core.Signal<boolean>;
830
+ readonly isEndingSession: _angular_core.Signal<boolean>;
831
+ readonly isRefreshingSession: _angular_core.Signal<boolean>;
832
+ bootstrap(): rxjs.Observable<void>;
833
+ setCandidates(candidates: DelegationSummary[]): rxjs.Observable<void>;
834
+ startSession(delegationId: number): rxjs.Observable<void>;
835
+ endSession(opts?: {
836
+ silent?: boolean;
837
+ }): rxjs.Observable<void>;
838
+ switchSession(delegationId: number): rxjs.Observable<void>;
839
+ refreshSession(): rxjs.Observable<void>;
840
+ verifySession(): rxjs.Observable<void>;
841
+ invalidate(reason?: 'TokenPrincipalMismatch' | 'NotActive' | 'ScopeDenied' | 'Expired' | 'Unknown'): rxjs.Observable<void>;
842
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<DelegationSessionFacade, never>;
843
+ static ɵprov: _angular_core.ɵɵInjectableDeclaration<DelegationSessionFacade>;
223
844
  }
224
845
 
225
- export { AddDelegation, ClearSelectedDelegation, DelegationForm, Delegations, DelegationsActionKey, DelegationsFacade, DelegationsList, DelegationsState, DeleteDelegation, GetDelegation, GetDelegations, UpdateDelegation };
226
- export type { Delegation, DelegationDateTime, DelegationFormData, DelegationUser, DelegationsStateModel };
846
+ export { ApproveDelegation, BootstrapDelegationSession, CancelDelegation, ClearScopePreview, ClearSelectedDelegation, CreateDelegation, DELEGATION_SESSION_STORAGE_KEY, DelegationDetailDrawer, DelegationForm, DelegationSessionActionKey, DelegationSessionFacade, DelegationSessionInvalidated, DelegationSessionState, DelegationStatusChip, Delegations, DelegationsActionKey, DelegationsFacade, DelegationsList, DelegationsState, EndDelegationSession, GetAssignedDelegations, GetDelegation, GetMyDelegations, GetScopeOptions, PreviewScope, RefreshDelegationSession, RejectDelegation, ScopePicker, SetDelegationCandidates, StartDelegationSession, StartSessionDialog, SwitchDelegationSession, TopbarDelegationMenu, UpdateDelegation, VerifyDelegationSession, appDelegationInterceptor, pickCandidates, toActiveSession };
847
+ export type { ActiveDelegationSession, ApproveDelegationRequest, CancelDelegationRequest, CreateDelegationRequest, Delegation, DelegationActivationState, DelegationAllowedAction, DelegationApprovalMeta, DelegationApprovalStatus, DelegationCancellationMeta, DelegationDayRules, DelegationDetail, DelegationListQuery, DelegationPermissionModuleType, DelegationReadPolicy, DelegationScope, DelegationScopeAccessibility, DelegationScopeAccessibilityOption, DelegationScopeOperation, DelegationScopeOperationOption, DelegationScopeOptions, DelegationScopePreset, DelegationScopePreview, DelegationScopePreviewDeniedItem, DelegationScopeReadPolicyOption, DelegationScopeRequest, DelegationScopeRequestTarget, DelegationScopeRequestTargetOperation, DelegationScopeTarget, DelegationScopeTargetOption, DelegationScopeWarning, DelegationSessionStateModel, DelegationStatus, DelegationStatusHistoryEntry, DelegationSummary, DelegationTargetType, DelegationTokenPair, DelegationUser, DelegationsStateModel, PagedResult, RejectDelegationRequest, UpdateDelegationRequest };