@masterteam/delegations 0.0.38 → 0.0.39
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.
|
|
3
|
+
"version": "0.0.39",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"directory": "../../../dist/masterteam/delegations",
|
|
6
6
|
"linkDirectory": false,
|
|
@@ -20,9 +20,9 @@
|
|
|
20
20
|
"tailwindcss": "^4.2.2",
|
|
21
21
|
"tailwindcss-primeui": "^0.6.1",
|
|
22
22
|
"@ngxs/store": "^20.1.0",
|
|
23
|
-
"@masterteam/
|
|
23
|
+
"@masterteam/components": "^0.0.179",
|
|
24
24
|
"@masterteam/icons": "^0.0.15",
|
|
25
|
-
"@masterteam/
|
|
25
|
+
"@masterteam/forms": "^0.0.81"
|
|
26
26
|
},
|
|
27
27
|
"sideEffects": false,
|
|
28
28
|
"exports": {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as _masterteam_delegations from '@masterteam/delegations';
|
|
2
2
|
import * as _angular_core from '@angular/core';
|
|
3
|
-
import { OnInit } from '@angular/core';
|
|
3
|
+
import { OnInit, InjectionToken } 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';
|
|
@@ -390,10 +390,9 @@ declare class TopbarDelegationMenu implements OnInit {
|
|
|
390
390
|
readonly showManageLink: _angular_core.InputSignal<boolean>;
|
|
391
391
|
readonly promptOnCandidates: _angular_core.InputSignal<boolean>;
|
|
392
392
|
/**
|
|
393
|
-
*
|
|
394
|
-
*
|
|
395
|
-
*
|
|
396
|
-
* even when headless — an active delegated session must always be obvious.
|
|
393
|
+
* Render no topbar UI at all (controller only) while keeping candidate
|
|
394
|
+
* loading + the post-login prompt. Use when the menu is surfaced elsewhere —
|
|
395
|
+
* e.g. embedded in the user-avatar dropdown via {@link DelegationMenuPanel}.
|
|
397
396
|
*/
|
|
398
397
|
readonly headless: _angular_core.InputSignal<boolean>;
|
|
399
398
|
private readonly facade;
|
|
@@ -405,7 +404,8 @@ declare class TopbarDelegationMenu implements OnInit {
|
|
|
405
404
|
protected readonly hasCandidates: _angular_core.Signal<boolean>;
|
|
406
405
|
protected readonly onBehalfOf: _angular_core.Signal<_masterteam_delegations.DelegationParty | null>;
|
|
407
406
|
protected readonly executedBy: _angular_core.Signal<_masterteam_delegations.DelegationParty | null>;
|
|
408
|
-
|
|
407
|
+
/** Per-instance guard; the persisted `facade.prompted()` guards across refresh. */
|
|
408
|
+
private localPrompted;
|
|
409
409
|
protected readonly mode: _angular_core.Signal<"active" | "candidates" | "hidden">;
|
|
410
410
|
constructor();
|
|
411
411
|
ngOnInit(): void;
|
|
@@ -1048,6 +1048,12 @@ declare enum DelegationSessionActionKey {
|
|
|
1048
1048
|
interface DelegationSessionStateModel extends LoadingStateShape<DelegationSessionActionKey> {
|
|
1049
1049
|
active: ActiveDelegationSession | null;
|
|
1050
1050
|
candidates: DelegationRow[];
|
|
1051
|
+
/**
|
|
1052
|
+
* Whether the post-login "delegations available" prompt has already been
|
|
1053
|
+
* shown for the current login. Reset on login so the prompt appears once,
|
|
1054
|
+
* then never again on plain refreshes (persisted with the slice).
|
|
1055
|
+
*/
|
|
1056
|
+
prompted: boolean;
|
|
1051
1057
|
}
|
|
1052
1058
|
|
|
1053
1059
|
/** Fetch the active delegations the current user may start (user/activedelegations). */
|
|
@@ -1072,6 +1078,12 @@ declare class SwitchDelegationSession {
|
|
|
1072
1078
|
static readonly type = "[DelegationSession] Switch";
|
|
1073
1079
|
constructor(delegation: DelegationRow);
|
|
1074
1080
|
}
|
|
1081
|
+
/** Set whether the post-login candidates prompt has been shown for this login. */
|
|
1082
|
+
declare class MarkDelegationPrompted {
|
|
1083
|
+
prompted: boolean;
|
|
1084
|
+
static readonly type = "[DelegationSession] Mark Prompted";
|
|
1085
|
+
constructor(prompted?: boolean);
|
|
1086
|
+
}
|
|
1075
1087
|
|
|
1076
1088
|
declare class DelegationSessionState {
|
|
1077
1089
|
private http;
|
|
@@ -1080,22 +1092,35 @@ declare class DelegationSessionState {
|
|
|
1080
1092
|
constructor();
|
|
1081
1093
|
static getActive(state: DelegationSessionStateModel): ActiveDelegationSession | null;
|
|
1082
1094
|
static getCandidates(state: DelegationSessionStateModel): DelegationRow[];
|
|
1095
|
+
static getPrompted(state: DelegationSessionStateModel): boolean;
|
|
1083
1096
|
static isDelegated(state: DelegationSessionStateModel): boolean;
|
|
1084
1097
|
static getLoadingActive(state: DelegationSessionStateModel): string[];
|
|
1085
1098
|
static getErrors(state: DelegationSessionStateModel): Record<string, string | null | undefined>;
|
|
1086
1099
|
loadCandidates(ctx: StateContext<DelegationSessionStateModel>): rxjs.Observable<Response<DelegationPage<DelegationRow>>>;
|
|
1087
1100
|
start(ctx: StateContext<DelegationSessionStateModel>, { delegation }: StartDelegationSession): rxjs.Observable<Response<string>>;
|
|
1088
1101
|
end(ctx: StateContext<DelegationSessionStateModel>, { reason }: EndDelegationSession): rxjs.Observable<never>;
|
|
1102
|
+
markPrompted(ctx: StateContext<DelegationSessionStateModel>, { prompted }: MarkDelegationPrompted): rxjs.Observable<never>;
|
|
1089
1103
|
switch(ctx: StateContext<DelegationSessionStateModel>, { delegation }: SwitchDelegationSession): rxjs.Observable<void>;
|
|
1090
1104
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<DelegationSessionState, never>;
|
|
1091
1105
|
static ɵprov: _angular_core.ɵɵInjectableDeclaration<DelegationSessionState>;
|
|
1092
1106
|
}
|
|
1093
1107
|
|
|
1108
|
+
/**
|
|
1109
|
+
* When true (default), the app reloads after a delegated session starts /
|
|
1110
|
+
* switches / ends so every subsequent request is re-fetched under the new
|
|
1111
|
+
* delegation context (the SPA otherwise keeps the previous actor's loaded data).
|
|
1112
|
+
* Consumers that drive their own refresh can provide `false` to opt out.
|
|
1113
|
+
*/
|
|
1114
|
+
declare const DELEGATION_RELOAD_ON_SESSION_CHANGE: InjectionToken<boolean>;
|
|
1094
1115
|
declare class DelegationSessionFacade {
|
|
1095
1116
|
private readonly store;
|
|
1117
|
+
private readonly document;
|
|
1118
|
+
private readonly reloadOnSessionChange;
|
|
1096
1119
|
readonly active: _angular_core.Signal<_masterteam_delegations.ActiveDelegationSession | null>;
|
|
1097
1120
|
readonly candidates: _angular_core.Signal<DelegationRow[]>;
|
|
1098
1121
|
readonly isDelegated: _angular_core.Signal<boolean>;
|
|
1122
|
+
/** Whether the post-login candidates prompt was already shown this login. */
|
|
1123
|
+
readonly prompted: _angular_core.Signal<boolean>;
|
|
1099
1124
|
private readonly loadingActive;
|
|
1100
1125
|
/** Raw delegation token for the `app-delegation` header. */
|
|
1101
1126
|
readonly token: _angular_core.Signal<string | null>;
|
|
@@ -1107,12 +1132,19 @@ declare class DelegationSessionFacade {
|
|
|
1107
1132
|
readonly isStarting: _angular_core.Signal<boolean>;
|
|
1108
1133
|
readonly isLoadingCandidates: _angular_core.Signal<boolean>;
|
|
1109
1134
|
loadCandidates(): rxjs.Observable<void>;
|
|
1135
|
+
markPrompted(prompted?: boolean): rxjs.Observable<void>;
|
|
1110
1136
|
startSession(delegation: DelegationRow): rxjs.Observable<void>;
|
|
1111
1137
|
switchSession(delegation: DelegationRow): rxjs.Observable<void>;
|
|
1112
1138
|
endSession(reason?: DelegationSessionInvalidationReason): rxjs.Observable<void>;
|
|
1139
|
+
/**
|
|
1140
|
+
* Reload so all data refetches under the new delegation context. The session
|
|
1141
|
+
* slice is persisted, so the (new/cleared) session restores after reload.
|
|
1142
|
+
* Deferred a tick to let NGXS storage flush first.
|
|
1143
|
+
*/
|
|
1144
|
+
private reloadAfterSessionChange;
|
|
1113
1145
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<DelegationSessionFacade, never>;
|
|
1114
1146
|
static ɵprov: _angular_core.ɵɵInjectableDeclaration<DelegationSessionFacade>;
|
|
1115
1147
|
}
|
|
1116
1148
|
|
|
1117
|
-
export { ApproveDelegation, CancelDelegation, ClearDelegationDetail, ClearScopePreview, CreateDelegationLegacy, CreateDelegationV2, 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 };
|
|
1149
|
+
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 };
|
|
1118
1150
|
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, DelegationScopeWarning, DelegationSessionInvalidationReason, DelegationSessionStateModel, DelegationSortDirection, DelegationStatusInfo, DelegationsStateModel, RejectDelegationRequest, UpdateDelegationLegacyRequest, UpdateDelegationV2Request };
|