From aff4987cd6a5cd440278bfd7bca1fbd499e6fd72 Mon Sep 17 00:00:00 2001 From: Carmine Porricelli Date: Mon, 11 Nov 2024 11:50:28 +0100 Subject: [PATCH] Added TenantDelegatedProducerFeatureRemoved event --- proto/v2/tenant/events.proto | 3 +++ src/tenant/eventsV2.ts | 12 ++++++++++++ 2 files changed, 15 insertions(+) diff --git a/proto/v2/tenant/events.proto b/proto/v2/tenant/events.proto index 95e142a..c51f160 100644 --- a/proto/v2/tenant/events.proto +++ b/proto/v2/tenant/events.proto @@ -70,3 +70,6 @@ message TenantDelegatedProducerFeatureAddedV2 { TenantV2 tenant = 1; } +message TenantDelegatedProducerFeatureRemovedV2 { + TenantV2 tenant = 1; +} diff --git a/src/tenant/eventsV2.ts b/src/tenant/eventsV2.ts index 2738e6e..10a19b7 100644 --- a/src/tenant/eventsV2.ts +++ b/src/tenant/eventsV2.ts @@ -15,6 +15,7 @@ import { TenantKindUpdatedV2, MaintenanceTenantPromotedToCertifierV2, TenantDelegatedProducerFeatureAddedV2, + TenantDelegatedProducerFeatureRemovedV2, } from "../gen/v2/tenant/events.js"; import { protobufDecoder } from "../utils.js"; @@ -62,6 +63,9 @@ export function tenantEventToBinaryDataV2(event: TenantEventV2): Uint8Array { .with({ type: "TenantDelegatedProducerFeatureAdded" }, ({ data }) => TenantDelegatedProducerFeatureAddedV2.toBinary(data) ) + .with({ type: "TenantDelegatedProducerFeatureRemoved" }, ({ data }) => + TenantDelegatedProducerFeatureRemovedV2.toBinary(data) + ) .exhaustive(); } @@ -178,6 +182,14 @@ export const TenantEventV2 = z.discriminatedUnion("type", [ version: z.number(), timestamp: z.coerce.date(), }), + z.object({ + event_version: z.literal(2), + type: z.literal("TenantDelegatedProducerFeatureRemoved"), + data: protobufDecoder(TenantDelegatedProducerFeatureRemovedV2), + stream_id: z.string(), + version: z.number(), + timestamp: z.coerce.date(), + }), ]); export type TenantEventV2 = z.infer;