Skip to content

Commit 1f06094

Browse files
committed
fix: typing for consequence type
1 parent f748a0f commit 1f06094

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

src/Common/Policy.Types.ts

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -86,10 +86,18 @@ export enum ConsequenceAction {
8686
ALLOW_FOREVER = 'ALLOW_FOREVER',
8787
}
8888

89-
export interface ConsequenceType {
90-
action: ConsequenceAction
91-
metadataField: string
92-
}
89+
export type ConsequenceType =
90+
| {
91+
action: Exclude<ConsequenceAction, ConsequenceAction.ALLOW_UNTIL_TIME>
92+
metadataField?: never | null
93+
}
94+
| {
95+
action: ConsequenceAction.ALLOW_UNTIL_TIME
96+
/**
97+
* Denotes the time till which the policy enforcement is relaxed
98+
*/
99+
metadataField: string
100+
}
93101

94102
export interface BlockedStateData {
95103
isOffendingMandatoryPlugin: boolean

0 commit comments

Comments
 (0)