mirror of
https://github.com/Unleash/unleash.git
synced 2025-01-20 00:08:02 +01:00
chore: extract and export type used by CR emails (#6234)
This change takes the (now rather involved) type used to send CR schedule suspension emails and extracts it into a proper exported type. This will allow us to import it in enterprise as well instead of redefining it.
This commit is contained in:
parent
fd977c57e8
commit
7eb9a01bda
@ -38,6 +38,28 @@ const SCHEDULED_EXECUTION_FAILED_SUBJECT =
|
|||||||
|
|
||||||
export const MAIL_ACCEPTED = '250 Accepted';
|
export const MAIL_ACCEPTED = '250 Accepted';
|
||||||
|
|
||||||
|
export type ChangeRequestScheduleConflictData =
|
||||||
|
| { reason: 'flag archived'; flagName: string }
|
||||||
|
| {
|
||||||
|
reason: 'strategy deleted';
|
||||||
|
flagName: string;
|
||||||
|
strategyId: string;
|
||||||
|
}
|
||||||
|
| {
|
||||||
|
reason: 'strategy updated';
|
||||||
|
flagName: string;
|
||||||
|
strategyId: string;
|
||||||
|
}
|
||||||
|
| {
|
||||||
|
reason: 'segment updated';
|
||||||
|
segment: { id: number; name: string };
|
||||||
|
}
|
||||||
|
| {
|
||||||
|
reason: 'environment variants updated';
|
||||||
|
flagName: string;
|
||||||
|
environment: string;
|
||||||
|
};
|
||||||
|
|
||||||
export class EmailService {
|
export class EmailService {
|
||||||
private logger: Logger;
|
private logger: Logger;
|
||||||
private config: IUnleashConfig;
|
private config: IUnleashConfig;
|
||||||
@ -177,27 +199,8 @@ export class EmailService {
|
|||||||
|
|
||||||
async sendScheduledChangeSuspendedEmail(
|
async sendScheduledChangeSuspendedEmail(
|
||||||
recipient: string,
|
recipient: string,
|
||||||
conflictData:
|
conflictData: ChangeRequestScheduleConflictData,
|
||||||
| { reason: 'flag archived'; flagName: string }
|
|
||||||
| {
|
|
||||||
reason: 'strategy deleted';
|
|
||||||
flagName: string;
|
|
||||||
strategyId: string;
|
|
||||||
}
|
|
||||||
| {
|
|
||||||
reason: 'strategy updated';
|
|
||||||
flagName: string;
|
|
||||||
strategyId: string;
|
|
||||||
}
|
|
||||||
| {
|
|
||||||
reason: 'segment updated';
|
|
||||||
segment: { id: number; name: string };
|
|
||||||
}
|
|
||||||
| {
|
|
||||||
reason: 'environment variants updated';
|
|
||||||
flagName: string;
|
|
||||||
environment: string;
|
|
||||||
},
|
|
||||||
conflictingChangeRequestId: number | undefined,
|
conflictingChangeRequestId: number | undefined,
|
||||||
changeRequests: {
|
changeRequests: {
|
||||||
id: number;
|
id: number;
|
||||||
|
Loading…
Reference in New Issue
Block a user