1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-01-25 00:07:47 +01:00

feat: webhook data for completed (#7043)

Now we post status and statusValue with webhook.
This commit is contained in:
Jaanus Sellin 2024-05-13 12:18:02 +03:00 committed by GitHub
parent fddb78380e
commit dac3f4a186
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 6 additions and 1 deletions

View File

@ -183,6 +183,7 @@ export class FeatureLifecycleService extends EventEmitter {
await this.eventService.storeEvent(
new FeatureCompletedEvent({
featureName: feature,
data: status,
auditUser,
}),
);

View File

@ -1,6 +1,7 @@
import type { FeatureToggle, IStrategyConfig, ITag, IVariant } from './model';
import type { IApiToken } from './models/api-token';
import type { IAuditUser, IUserWithRootRole } from './user';
import type { FeatureLifecycleCompletedSchema } from '../openapi';
export const APPLICATION_CREATED = 'application-created' as const;
@ -634,14 +635,17 @@ export class FeatureCreatedEvent extends BaseEvent {
export class FeatureCompletedEvent extends BaseEvent {
readonly featureName: string;
readonly data: FeatureLifecycleCompletedSchema;
constructor(p: {
featureName: string;
data: FeatureLifecycleCompletedSchema;
auditUser: IAuditUser;
}) {
super(FEATURE_COMPLETED, p.auditUser);
const { featureName } = p;
const { featureName, data } = p;
this.featureName = featureName;
this.data = data;
}
}