From 2d1a45c7e6e9d24718bbaaad0e56eb4fbb212809 Mon Sep 17 00:00:00 2001 From: edle Date: Wed, 18 Mar 2026 13:12:57 -0400 Subject: [PATCH 1/2] Changes --- .../src/agent-notification.ts | 67 ++++++++++++++++++- .../src/constants.ts | 5 +- 2 files changed, 69 insertions(+), 3 deletions(-) diff --git a/packages/agents-a365-notifications/src/agent-notification.ts b/packages/agents-a365-notifications/src/agent-notification.ts index d2c03c83..7c0aadd6 100644 --- a/packages/agents-a365-notifications/src/agent-notification.ts +++ b/packages/agents-a365-notifications/src/agent-notification.ts @@ -11,6 +11,9 @@ import { USER_CREATED_LIFECYCLE_EVENT, USER_WORKLOAD_ONBOARDING_LIFECYCLE_EVENT, USER_DELETED_LIFECYCLE_EVENT, + USER_UNDELETED_LIFECYCLE_EVENT, + USER_UPDATED_LIFECYCLE_EVENT, + USER_MANAGER_UPDATED_LIFECYCLE_EVENT } from './constants'; /** @@ -280,6 +283,57 @@ function onAgenticUserIdentityDeletedNotification( onLifecycleNotificationInternal(this, USER_DELETED_LIFECYCLE_EVENT, handler, rank, autoSignInHandlers); } +/** + * Registers a route handler for all lifecycle notifications. + * + * @param this - The agent application + * @param handler - The notification handler + * @param rank - Rank order in which to evaluate this + * @param autoSignInHandlers - handlers + */ +function onAgenticUserIdentityUndeletedNotification( + this: AgentApplication, + handler: AgentNotificationHandler, + rank = 32767, + autoSignInHandlers?: string[] +): void { + onLifecycleNotificationInternal(this, USER_UNDELETED_LIFECYCLE_EVENT, handler, rank, autoSignInHandlers); +} + +/** + * Registers a route handler for all lifecycle notifications. + * + * @param this - The agent application + * @param handler - The notification handler + * @param rank - Rank order in which to evaluate this + * @param autoSignInHandlers - handlers + */ +function onAgenticUserIdentityUpdatedNotification( + this: AgentApplication, + handler: AgentNotificationHandler, + rank = 32767, + autoSignInHandlers?: string[] +): void { + onLifecycleNotificationInternal(this, USER_UPDATED_LIFECYCLE_EVENT, handler, rank, autoSignInHandlers); +} + +/** + * Registers a route handler for all lifecycle notifications. + * + * @param this - The agent application + * @param handler - The notification handler + * @param rank - Rank order in which to evaluate this + * @param autoSignInHandlers - handlers + */ +function onAgenticUserManagerUpdatedNotification( + this: AgentApplication, + handler: AgentNotificationHandler, + rank = 32767, + autoSignInHandlers?: string[] +): void { + onLifecycleNotificationInternal(this, USER_MANAGER_UPDATED_LIFECYCLE_EVENT, handler, rank, autoSignInHandlers); +} + /** * Checks if the given channel ID is an agentic channel. */ @@ -307,7 +361,10 @@ function isValidLifecycleEvent(lifecycleEvent: string): boolean { const validLifecycleEvents = [ USER_CREATED_LIFECYCLE_EVENT, USER_WORKLOAD_ONBOARDING_LIFECYCLE_EVENT, - USER_DELETED_LIFECYCLE_EVENT + USER_DELETED_LIFECYCLE_EVENT, + USER_UNDELETED_LIFECYCLE_EVENT, + USER_UPDATED_LIFECYCLE_EVENT, + USER_MANAGER_UPDATED_LIFECYCLE_EVENT ]; return validLifecycleEvents.includes(lifecycleEvent.toLowerCase()); } @@ -323,6 +380,9 @@ declare module '@microsoft/agents-hosting' { onAgenticUserCreatedNotification(routeHandler: AgentNotificationHandler, rank?: number, autoSignInHandlers?: string[]): void; onAgenticUserWorkloadOnboardingNotification(routeHandler: AgentNotificationHandler, rank?: number, autoSignInHandlers?: string[]): void; onAgenticUserDeletedNotification(routeHandler: AgentNotificationHandler, rank?: number, autoSignInHandlers?: string[]): void; + onAgenticUserUndeletedNotification(routeHandler: AgentNotificationHandler, rank?: number, autoSignInHandlers?: string[]): void; + onAgenticUserUpdatedNotification(routeHandler: AgentNotificationHandler, rank?: number, autoSignInHandlers?: string[]): void; + onAgenticUserManagerUpdatedNotification(routeHandler: AgentNotificationHandler, rank?: number, autoSignInHandlers?: string[]): void; } } @@ -334,4 +394,7 @@ AgentApplication.prototype.onAgenticPowerPointNotification = onAgenticPowerPoint AgentApplication.prototype.onLifecycleNotification = onLifecycleNotification; AgentApplication.prototype.onAgenticUserCreatedNotification = onAgenticUserIdentityCreatedNotification; AgentApplication.prototype.onAgenticUserWorkloadOnboardingNotification = onAgenticUserWorkloadOnboardingNotification; -AgentApplication.prototype.onAgenticUserDeletedNotification = onAgenticUserIdentityDeletedNotification; \ No newline at end of file +AgentApplication.prototype.onAgenticUserDeletedNotification = onAgenticUserIdentityDeletedNotification; +AgentApplication.prototype.onAgenticUserUndeletedNotification = onAgenticUserIdentityUndeletedNotification; +AgentApplication.prototype.onAgenticUserUpdatedNotification = onAgenticUserIdentityUpdatedNotification; +AgentApplication.prototype.onAgenticUserManagerUpdatedNotification = onAgenticUserManagerUpdatedNotification; diff --git a/packages/agents-a365-notifications/src/constants.ts b/packages/agents-a365-notifications/src/constants.ts index 71bfcd57..34387290 100644 --- a/packages/agents-a365-notifications/src/constants.ts +++ b/packages/agents-a365-notifications/src/constants.ts @@ -13,4 +13,7 @@ export const AGENTS_POWERPOINT_SUBCHANNEL = 'agents:powerpoint'; export const AGENT_LIFECYCLE = 'agentlifecycle'; export const USER_CREATED_LIFECYCLE_EVENT = 'agenticuseridentitycreated'; export const USER_WORKLOAD_ONBOARDING_LIFECYCLE_EVENT = 'agenticuserworkloadonboardingupdated'; -export const USER_DELETED_LIFECYCLE_EVENT = 'agenticuserdeleted'; \ No newline at end of file +export const USER_DELETED_LIFECYCLE_EVENT = 'agenticuserdeleted'; +export const USER_UNDELETED_LIFECYCLE_EVENT = 'agenticuserundeleted'; +export const USER_UPDATED_LIFECYCLE_EVENT = 'agenticuseridentityupdated'; +export const USER_MANAGER_UPDATED_LIFECYCLE_EVENT = 'agenticusermanagerupdated'; From c7afce9e3ca08e2744bbfde2139b19e5a4f1f8c7 Mon Sep 17 00:00:00 2001 From: edle Date: Thu, 19 Mar 2026 17:35:43 -0400 Subject: [PATCH 2/2] taking copilto comments --- .../agents-a365-notifications/src/agent-notification.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/agents-a365-notifications/src/agent-notification.ts b/packages/agents-a365-notifications/src/agent-notification.ts index 7c0aadd6..7a78a072 100644 --- a/packages/agents-a365-notifications/src/agent-notification.ts +++ b/packages/agents-a365-notifications/src/agent-notification.ts @@ -284,7 +284,7 @@ function onAgenticUserIdentityDeletedNotification( } /** - * Registers a route handler for all lifecycle notifications. + * Registers a route handler for user identity undeleted lifecycle notifications. * * @param this - The agent application * @param handler - The notification handler @@ -301,7 +301,7 @@ function onAgenticUserIdentityUndeletedNotification( } /** - * Registers a route handler for all lifecycle notifications. + * Registers a route handler for user identity updated lifecycle notifications. * * @param this - The agent application * @param handler - The notification handler @@ -318,7 +318,7 @@ function onAgenticUserIdentityUpdatedNotification( } /** - * Registers a route handler for all lifecycle notifications. + * Registers a route handler for user manager updated lifecycle notifications. * * @param this - The agent application * @param handler - The notification handler