@microsoft/agents-a365-notifications 0.1.0-preview.103

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (91) hide show
  1. package/LICENSE.md +21 -0
  2. package/README.md +33 -0
  3. package/dist/cjs/agent-notification.d.ts +16 -0
  4. package/dist/cjs/agent-notification.d.ts.map +1 -0
  5. package/dist/cjs/agent-notification.js +223 -0
  6. package/dist/cjs/agent-notification.js.map +1 -0
  7. package/dist/cjs/constants.d.ts +16 -0
  8. package/dist/cjs/constants.d.ts.map +1 -0
  9. package/dist/cjs/constants.js +19 -0
  10. package/dist/cjs/constants.js.map +1 -0
  11. package/dist/cjs/extensions/agent-notification-handler.d.ts +12 -0
  12. package/dist/cjs/extensions/agent-notification-handler.d.ts.map +1 -0
  13. package/dist/cjs/extensions/agent-notification-handler.js +3 -0
  14. package/dist/cjs/extensions/agent-notification-handler.js.map +1 -0
  15. package/dist/cjs/extensions/index.d.ts +2 -0
  16. package/dist/cjs/extensions/index.d.ts.map +1 -0
  17. package/dist/cjs/extensions/index.js +18 -0
  18. package/dist/cjs/extensions/index.js.map +1 -0
  19. package/dist/cjs/index.d.ts +5 -0
  20. package/dist/cjs/index.d.ts.map +1 -0
  21. package/dist/cjs/index.js +25 -0
  22. package/dist/cjs/index.js.map +1 -0
  23. package/dist/cjs/models/agent-notification-activity.d.ts +56 -0
  24. package/dist/cjs/models/agent-notification-activity.d.ts.map +1 -0
  25. package/dist/cjs/models/agent-notification-activity.js +51 -0
  26. package/dist/cjs/models/agent-notification-activity.js.map +1 -0
  27. package/dist/cjs/models/email-reference.d.ts +35 -0
  28. package/dist/cjs/models/email-reference.d.ts.map +1 -0
  29. package/dist/cjs/models/email-reference.js +27 -0
  30. package/dist/cjs/models/email-reference.js.map +1 -0
  31. package/dist/cjs/models/email-response.d.ts +29 -0
  32. package/dist/cjs/models/email-response.d.ts.map +1 -0
  33. package/dist/cjs/models/email-response.js +31 -0
  34. package/dist/cjs/models/email-response.js.map +1 -0
  35. package/dist/cjs/models/index.d.ts +6 -0
  36. package/dist/cjs/models/index.d.ts.map +1 -0
  37. package/dist/cjs/models/index.js +22 -0
  38. package/dist/cjs/models/index.js.map +1 -0
  39. package/dist/cjs/models/notification-type.d.ts +10 -0
  40. package/dist/cjs/models/notification-type.d.ts.map +1 -0
  41. package/dist/cjs/models/notification-type.js +14 -0
  42. package/dist/cjs/models/notification-type.js.map +1 -0
  43. package/dist/cjs/models/wpx-comment.d.ts +39 -0
  44. package/dist/cjs/models/wpx-comment.d.ts.map +1 -0
  45. package/dist/cjs/models/wpx-comment.js +28 -0
  46. package/dist/cjs/models/wpx-comment.js.map +1 -0
  47. package/dist/esm/agent-notification.d.ts +16 -0
  48. package/dist/esm/agent-notification.d.ts.map +1 -0
  49. package/dist/esm/agent-notification.js +221 -0
  50. package/dist/esm/agent-notification.js.map +1 -0
  51. package/dist/esm/constants.d.ts +16 -0
  52. package/dist/esm/constants.d.ts.map +1 -0
  53. package/dist/esm/constants.js +16 -0
  54. package/dist/esm/constants.js.map +1 -0
  55. package/dist/esm/extensions/agent-notification-handler.d.ts +12 -0
  56. package/dist/esm/extensions/agent-notification-handler.d.ts.map +1 -0
  57. package/dist/esm/extensions/agent-notification-handler.js +2 -0
  58. package/dist/esm/extensions/agent-notification-handler.js.map +1 -0
  59. package/dist/esm/extensions/index.d.ts +2 -0
  60. package/dist/esm/extensions/index.d.ts.map +1 -0
  61. package/dist/esm/extensions/index.js +2 -0
  62. package/dist/esm/extensions/index.js.map +1 -0
  63. package/dist/esm/index.d.ts +5 -0
  64. package/dist/esm/index.d.ts.map +1 -0
  65. package/dist/esm/index.js +9 -0
  66. package/dist/esm/index.js.map +1 -0
  67. package/dist/esm/models/agent-notification-activity.d.ts +56 -0
  68. package/dist/esm/models/agent-notification-activity.d.ts.map +1 -0
  69. package/dist/esm/models/agent-notification-activity.js +48 -0
  70. package/dist/esm/models/agent-notification-activity.js.map +1 -0
  71. package/dist/esm/models/email-reference.d.ts +35 -0
  72. package/dist/esm/models/email-reference.d.ts.map +1 -0
  73. package/dist/esm/models/email-reference.js +22 -0
  74. package/dist/esm/models/email-reference.js.map +1 -0
  75. package/dist/esm/models/email-response.d.ts +29 -0
  76. package/dist/esm/models/email-response.d.ts.map +1 -0
  77. package/dist/esm/models/email-response.js +26 -0
  78. package/dist/esm/models/email-response.js.map +1 -0
  79. package/dist/esm/models/index.d.ts +6 -0
  80. package/dist/esm/models/index.d.ts.map +1 -0
  81. package/dist/esm/models/index.js +6 -0
  82. package/dist/esm/models/index.js.map +1 -0
  83. package/dist/esm/models/notification-type.d.ts +10 -0
  84. package/dist/esm/models/notification-type.d.ts.map +1 -0
  85. package/dist/esm/models/notification-type.js +11 -0
  86. package/dist/esm/models/notification-type.js.map +1 -0
  87. package/dist/esm/models/wpx-comment.d.ts +39 -0
  88. package/dist/esm/models/wpx-comment.d.ts.map +1 -0
  89. package/dist/esm/models/wpx-comment.js +23 -0
  90. package/dist/esm/models/wpx-comment.js.map +1 -0
  91. package/package.json +61 -0
package/LICENSE.md ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Microsoft
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,33 @@
1
+ # @microsoft/agents-a365-notifications
2
+
3
+ [![npm](https://img.shields.io/npm/v/@microsoft/agents-a365-notifications?label=npm&logo=npm)](https://www.npmjs.com/package/@microsoft/agents-a365-notifications)
4
+ [![npm Downloads](https://img.shields.io/npm/dm/@microsoft/agents-a365-notifications?label=Downloads&logo=npm)](https://www.npmjs.com/package/@microsoft/agents-a365-notifications)
5
+
6
+ Agent notification services and models for handling user notifications in applications built with the Microsoft Agent 365 SDK. This package provides type-safe notification handling for email, Word comments, and other collaboration scenarios.
7
+
8
+ ## Installation
9
+
10
+ ```bash
11
+ npm install @microsoft/agents-a365-notifications
12
+ ```
13
+
14
+ ## Usage
15
+
16
+ For detailed usage examples and implementation guidance, see the [Microsoft Agent 365 Notification Documentation](https://learn.microsoft.com/microsoft-agent-365/developer/notification?tabs=nodejs).
17
+
18
+ ## Support
19
+
20
+ For issues, questions, or feedback:
21
+
22
+ - File issues in the [GitHub Issues](https://github.com/microsoft/Agent365-nodejs/issues) section
23
+ - See the [main documentation](../../README.md) for more information
24
+
25
+ ## Trademarks
26
+
27
+ *Microsoft, Windows, Microsoft Azure and/or other Microsoft products and services referenced in the documentation may be either trademarks or registered trademarks of Microsoft in the United States and/or other countries. The licenses for this project do not grant you rights to use any Microsoft names, logos, or trademarks. Microsoft's general trademark guidelines can be found at http://go.microsoft.com/fwlink/?LinkID=254653.*
28
+
29
+ ## License
30
+
31
+ Copyright (c) Microsoft Corporation. All rights reserved.
32
+
33
+ Licensed under the MIT License - see the [LICENSE](../../LICENSE.md) file for details
@@ -0,0 +1,16 @@
1
+ import { TurnState } from '@microsoft/agents-hosting';
2
+ import { AgentNotificationHandler } from './extensions';
3
+ declare module '@microsoft/agents-hosting' {
4
+ interface AgentApplication<TState extends TurnState> {
5
+ onAgentNotification(channelId: string, routeHandler: AgentNotificationHandler<TState>, rank?: number, autoSignInHandlers?: string[]): void;
6
+ onAgenticEmailNotification(routeHandler: AgentNotificationHandler<TState>, rank?: number, autoSignInHandlers?: string[]): void;
7
+ onAgenticWordNotification(routeHandler: AgentNotificationHandler<TState>, rank?: number, autoSignInHandlers?: string[]): void;
8
+ onAgenticExcelNotification(routeHandler: AgentNotificationHandler<TState>, rank?: number, autoSignInHandlers?: string[]): void;
9
+ onAgenticPowerPointNotification(routeHandler: AgentNotificationHandler<TState>, rank?: number, autoSignInHandlers?: string[]): void;
10
+ onLifecycleNotification(routeHandler: AgentNotificationHandler<TState>, rank?: number, autoSignInHandlers?: string[]): void;
11
+ onAgenticUserCreatedNotification(routeHandler: AgentNotificationHandler<TState>, rank?: number, autoSignInHandlers?: string[]): void;
12
+ onAgenticUserWorkloadOnboardingNotification(routeHandler: AgentNotificationHandler<TState>, rank?: number, autoSignInHandlers?: string[]): void;
13
+ onAgenticUserDeletedNotification(routeHandler: AgentNotificationHandler<TState>, rank?: number, autoSignInHandlers?: string[]): void;
14
+ }
15
+ }
16
+ //# sourceMappingURL=agent-notification.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"agent-notification.d.ts","sourceRoot":"","sources":["../../src/agent-notification.ts"],"names":[],"mappings":"AAAA,OAAO,EAAoB,SAAS,EAAuC,MAAM,2BAA2B,CAAC;AAE7G,OAAO,EAAE,wBAAwB,EAAE,MAAM,cAAc,CAAC;AAwTxD,OAAO,QAAQ,2BAA2B,CAAC;IACzC,UAAU,gBAAgB,CAAC,MAAM,SAAS,SAAS;QACjD,mBAAmB,CAAC,SAAS,EAAE,MAAM,EAAE,YAAY,EAAE,wBAAwB,CAAC,MAAM,CAAC,EAAE,IAAI,CAAC,EAAE,MAAM,EAAE,kBAAkB,CAAC,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC;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exports, "__esModule", { value: true });
3
+ const agents_hosting_1 = require("@microsoft/agents-hosting");
4
+ const agent_notification_activity_1 = require("./models/agent-notification-activity");
5
+ const constants_1 = require("./constants");
6
+ /**
7
+ * Helper function to check if an activity is an agentic request.
8
+ */
9
+ function isAgenticRequest(turnContext) {
10
+ if (!turnContext?.activity)
11
+ return false;
12
+ const role = turnContext.activity?.recipient?.role;
13
+ return role === 'agenticAppInstance' || role === 'agenticUser';
14
+ }
15
+ /**
16
+ * Helper function to add a route with agentic filtering.
17
+ */
18
+ function addAgenticRoute(app, routeSelector, routeHandler, isInvokeRoute = false, rank = 32767, autoSignInHandlers) {
19
+ const ensureAgentic = async (turnContext) => {
20
+ return isAgenticRequest(turnContext) && await Promise.resolve(routeSelector(turnContext));
21
+ };
22
+ app.addRoute(ensureAgentic, routeHandler, isInvokeRoute, rank, autoSignInHandlers);
23
+ }
24
+ /**
25
+ * Helper function to set up handler and route
26
+ */
27
+ function onAgentNotificationInternal(app, channelId,
28
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
29
+ handler, rank = 32767, autoSignInHandlers) {
30
+ const routeSelector = async (turnContext) => {
31
+ const activity = turnContext.activity;
32
+ // In case core JS SDK is updated to match .NET SDK, this will need to be updated.
33
+ if (!(activity.channelId) || !isAgenticChannel(activity.channelId)) {
34
+ return false;
35
+ }
36
+ if (channelId !== 'agents:*') {
37
+ if (!isValidChannel(channelId))
38
+ return false;
39
+ if (activity.channelId.toLowerCase() !== channelId.toLowerCase()) {
40
+ return false;
41
+ }
42
+ }
43
+ return true;
44
+ };
45
+ const routeHandler = async (turnContext, turnState) => {
46
+ // Wrap the activity
47
+ const agentNotificationActivity = (0, agent_notification_activity_1.createAgentNotificationActivity)(turnContext.activity);
48
+ // Call the user's handler
49
+ return handler(turnContext, turnState, agentNotificationActivity);
50
+ };
51
+ addAgenticRoute(app, routeSelector, routeHandler, false, rank, autoSignInHandlers);
52
+ }
53
+ /**
54
+ * Helper function to set up handler and route
55
+ */
56
+ function onLifecycleNotificationInternal(app, lifecycleEvent,
57
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
58
+ handler, rank = 32767, autoSignInHandlers) {
59
+ const routeSelector = async (turnContext) => {
60
+ const activity = turnContext.activity;
61
+ // In case core JS SDK is updated to match .NET SDK, this will need to be updated.
62
+ if (!(activity.channelId) || !isAgenticChannel(activity.channelId) || !activity.valueType) {
63
+ return false;
64
+ }
65
+ if (activity.name?.toLowerCase() !== constants_1.AGENT_LIFECYCLE) {
66
+ return false;
67
+ }
68
+ // Check if the lifecycle event is valid
69
+ if (lifecycleEvent !== '*') {
70
+ if (!isValidLifecycleEvent(lifecycleEvent))
71
+ return false;
72
+ if (activity.valueType.toLowerCase() !== lifecycleEvent.toLowerCase())
73
+ return false;
74
+ }
75
+ return true;
76
+ };
77
+ const routeHandler = async (turnContext, turnState) => {
78
+ // Wrap the activity
79
+ const agentNotificationActivity = (0, agent_notification_activity_1.createAgentNotificationActivity)(turnContext.activity);
80
+ // Call the user's handler
81
+ return handler(turnContext, turnState, agentNotificationActivity);
82
+ };
83
+ addAgenticRoute(app, routeSelector, routeHandler, false, rank, autoSignInHandlers);
84
+ }
85
+ /**
86
+ * Registers a route handler for agent notifications.
87
+ *
88
+ * @param this - The agent application
89
+ * @param channelId - The channel id to filter notifications on
90
+ * @param handler - The notification handler
91
+ * @param rank - Rank order in which to evaluate this
92
+ * @param autoSignInHandlers - handlers
93
+ */
94
+ function onAgentNotification(channelId, handler, rank = 32767, autoSignInHandlers) {
95
+ onAgentNotificationInternal(this, channelId, handler, rank, autoSignInHandlers);
96
+ }
97
+ /**
98
+ * Registers a route handler specifically for email notifications.
99
+ *
100
+ * @param this - The agent application
101
+ * @param handler - The notification handler
102
+ * @param rank - Rank order in which to evaluate this
103
+ * @param autoSignInHandlers - handlers
104
+ */
105
+ function onAgenticEmailNotification(handler, rank = 32767, autoSignInHandlers) {
106
+ onAgentNotificationInternal(this, constants_1.AGENTS_EMAIL_SUBCHANNEL, handler, rank, autoSignInHandlers);
107
+ }
108
+ /**
109
+ * Registers a route handler specifically for Word notifications.
110
+ *
111
+ * @param this - The agent application
112
+ * @param handler - The notification handler
113
+ * @param rank - Rank order in which to evaluate this
114
+ * @param autoSignInHandlers - handlers
115
+ */
116
+ function onAgenticWordNotification(handler, rank = 32767, autoSignInHandlers) {
117
+ onAgentNotificationInternal(this, constants_1.AGENTS_WORD_SUBCHANNEL, handler, rank, autoSignInHandlers);
118
+ }
119
+ /**
120
+ * Registers a route handler specifically for Excel notifications.
121
+ *
122
+ * @param this - The agent application
123
+ * @param handler - The notification handler
124
+ * @param rank - Rank order in which to evaluate this
125
+ * @param autoSignInHandlers - handlers
126
+ */
127
+ function onAgenticExcelNotification(handler, rank = 32767, autoSignInHandlers) {
128
+ onAgentNotificationInternal(this, constants_1.AGENTS_EXCEL_SUBCHANNEL, handler, rank, autoSignInHandlers);
129
+ }
130
+ /**
131
+ * Registers a route handler specifically for PowerPoint notifications.
132
+ *
133
+ * @param this - The agent application
134
+ * @param handler - The notification handler
135
+ * @param rank - Rank order in which to evaluate this
136
+ * @param autoSignInHandlers - handlers
137
+ */
138
+ function onAgenticPowerPointNotification(handler, rank = 32767, autoSignInHandlers) {
139
+ onAgentNotificationInternal(this, constants_1.AGENTS_POWERPOINT_SUBCHANNEL, handler, rank, autoSignInHandlers);
140
+ }
141
+ /**
142
+ * Registers a route handler for all lifecycle notifications.
143
+ *
144
+ * @param this - The agent application
145
+ * @param handler - The notification handler
146
+ * @param rank - Rank order in which to evaluate this
147
+ * @param autoSignInHandlers - handlers
148
+ */
149
+ function onLifecycleNotification(handler, rank = 32767, autoSignInHandlers) {
150
+ onLifecycleNotificationInternal(this, '*', handler, rank, autoSignInHandlers);
151
+ }
152
+ /**
153
+ * Registers a route handler for all lifecycle notifications.
154
+ *
155
+ * @param this - The agent application
156
+ * @param handler - The notification handler
157
+ * @param rank - Rank order in which to evaluate this
158
+ * @param autoSignInHandlers - handlers
159
+ */
160
+ function onAgenticUserIdentityCreatedNotification(handler, rank = 32767, autoSignInHandlers) {
161
+ onLifecycleNotificationInternal(this, constants_1.USER_CREATED_LIFECYCLE_EVENT, handler, rank, autoSignInHandlers);
162
+ }
163
+ /**
164
+ * Registers a route handler for all lifecycle notifications.
165
+ *
166
+ * @param this - The agent application
167
+ * @param handler - The notification handler
168
+ * @param rank - Rank order in which to evaluate this
169
+ * @param autoSignInHandlers - handlers
170
+ */
171
+ function onAgenticUserWorkloadOnboardingNotification(handler, rank = 32767, autoSignInHandlers) {
172
+ onLifecycleNotificationInternal(this, constants_1.USER_WORKLOAD_ONBOARDING_LIFECYCLE_EVENT, handler, rank, autoSignInHandlers);
173
+ }
174
+ /**
175
+ * Registers a route handler for all lifecycle notifications.
176
+ *
177
+ * @param this - The agent application
178
+ * @param handler - The notification handler
179
+ * @param rank - Rank order in which to evaluate this
180
+ * @param autoSignInHandlers - handlers
181
+ */
182
+ function onAgenticUserIdentityDeletedNotification(handler, rank = 32767, autoSignInHandlers) {
183
+ onLifecycleNotificationInternal(this, constants_1.USER_DELETED_LIFECYCLE_EVENT, handler, rank, autoSignInHandlers);
184
+ }
185
+ /**
186
+ * Checks if the given channel ID is an agentic channel.
187
+ */
188
+ function isAgenticChannel(channelId) {
189
+ return channelId.toLowerCase().startsWith(constants_1.AGENTS_CHANNEL);
190
+ }
191
+ /**
192
+ * Validates if a sub-channel is supported.
193
+ */
194
+ function isValidChannel(channel) {
195
+ const validChannels = [
196
+ constants_1.AGENTS_EMAIL_SUBCHANNEL,
197
+ constants_1.AGENTS_EXCEL_SUBCHANNEL,
198
+ constants_1.AGENTS_WORD_SUBCHANNEL,
199
+ constants_1.AGENTS_POWERPOINT_SUBCHANNEL,
200
+ ];
201
+ return validChannels.includes(channel.toLowerCase());
202
+ }
203
+ /**
204
+ * Validates if a lifecycle event is supported.
205
+ */
206
+ function isValidLifecycleEvent(lifecycleEvent) {
207
+ const validLifecycleEvents = [
208
+ constants_1.USER_CREATED_LIFECYCLE_EVENT,
209
+ constants_1.USER_WORKLOAD_ONBOARDING_LIFECYCLE_EVENT,
210
+ constants_1.USER_DELETED_LIFECYCLE_EVENT
211
+ ];
212
+ return validLifecycleEvents.includes(lifecycleEvent.toLowerCase());
213
+ }
214
+ agents_hosting_1.AgentApplication.prototype.onAgentNotification = onAgentNotification;
215
+ agents_hosting_1.AgentApplication.prototype.onAgenticEmailNotification = onAgenticEmailNotification;
216
+ agents_hosting_1.AgentApplication.prototype.onAgenticWordNotification = onAgenticWordNotification;
217
+ agents_hosting_1.AgentApplication.prototype.onAgenticExcelNotification = onAgenticExcelNotification;
218
+ agents_hosting_1.AgentApplication.prototype.onAgenticPowerPointNotification = onAgenticPowerPointNotification;
219
+ agents_hosting_1.AgentApplication.prototype.onLifecycleNotification = onLifecycleNotification;
220
+ agents_hosting_1.AgentApplication.prototype.onAgenticUserCreatedNotification = onAgenticUserIdentityCreatedNotification;
221
+ agents_hosting_1.AgentApplication.prototype.onAgenticUserWorkloadOnboardingNotification = onAgenticUserWorkloadOnboardingNotification;
222
+ agents_hosting_1.AgentApplication.prototype.onAgenticUserDeletedNotification = onAgenticUserIdentityDeletedNotification;
223
+ //# sourceMappingURL=agent-notification.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"agent-notification.js","sourceRoot":"","sources":["../../src/agent-notification.ts"],"names":[],"mappings":";;AAAA,8DAA6G;AAC7G,sFAAuF;AAEvF,2CAUqB;AAErB;;GAEG;AACH,SAAS,gBAAgB,CAAC,WAAwB;IAChD,IAAI,CAAC,WAAW,EAAE,QAAQ;QAAE,OAAO,KAAK,CAAC;IACzC,MAAM,IAAI,GAAG,WAAW,CAAC,QAAQ,EAAE,SAAS,EAAE,IAAI,CAAC;IACnD,OAAO,IAAI,KAAK,oBAAoB,IAAI,IAAI,KAAK,aAAa,CAAC;AACjE,CAAC;AAED;;GAEG;AACH,SAAS,eAAe,CACtB,GAAgC,EAChC,aAAuB,EACvB,YAAqC,EACrC,aAAa,GAAG,KAAK,EACrB,IA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CAAgB,CAAC,SAAS,CAAC,mBAAmB,GAAG,mBAAmB,CAAC;AACrE,iCAAgB,CAAC,SAAS,CAAC,0BAA0B,GAAG,0BAA0B,CAAC;AACnF,iCAAgB,CAAC,SAAS,CAAC,yBAAyB,GAAG,yBAAyB,CAAC;AACjF,iCAAgB,CAAC,SAAS,CAAC,0BAA0B,GAAG,0BAA0B,CAAC;AACnF,iCAAgB,CAAC,SAAS,CAAC,+BAA+B,GAAG,+BAA+B,CAAC;AAC7F,iCAAgB,CAAC,SAAS,CAAC,uBAAuB,GAAG,uBAAuB,CAAC;AAC7E,iCAAgB,CAAC,SAAS,CAAC,gCAAgC,GAAG,wCAAwC,CAAC;AACvG,iCAAgB,CAAC,SAAS,CAAC,2CAA2C,GAAG,2CAA2C,CAAC;AACrH,iCAAgB,CAAC,SAAS,CAAC,gCAAgC,GAAG,wCAAwC,CAAC"}
@@ -0,0 +1,16 @@
1
+ /**
2
+ * Channel and sub-channel constants for agent notifications.
3
+ */
4
+ export declare const AGENTS_CHANNEL = "agents";
5
+ export declare const AGENTS_EMAIL_SUBCHANNEL = "agents:email";
6
+ export declare const AGENTS_EXCEL_SUBCHANNEL = "agents:excel";
7
+ export declare const AGENTS_WORD_SUBCHANNEL = "agents:word";
8
+ export declare const AGENTS_POWERPOINT_SUBCHANNEL = "agents:powerpoint";
9
+ /**
10
+ * Lifecycle constants for agent notifications.
11
+ */
12
+ export declare const AGENT_LIFECYCLE = "agentlifecycle";
13
+ export declare const USER_CREATED_LIFECYCLE_EVENT = "agenticuseridentitycreated";
14
+ export declare const USER_WORKLOAD_ONBOARDING_LIFECYCLE_EVENT = "agenticuserworkloadonboardingupdated";
15
+ export declare const USER_DELETED_LIFECYCLE_EVENT = "agenticuserdeleted";
16
+ //# sourceMappingURL=constants.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/constants.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,eAAO,MAAM,cAAc,WAAW,CAAC;AACvC,eAAO,MAAM,uBAAuB,iBAAiB,CAAC;AACtD,eAAO,MAAM,uBAAuB,iBAAiB,CAAC;AACtD,eAAO,MAAM,sBAAsB,gBAAgB,CAAC;AACpD,eAAO,MAAM,4BAA4B,sBAAsB,CAAC;AAEhE;;GAEG;AACH,eAAO,MAAM,eAAe,mBAAmB,CAAC;AAChD,eAAO,MAAM,4BAA4B,+BAA+B,CAAC;AACzE,eAAO,MAAM,wCAAwC,yCAAyC,CAAC;AAC/F,eAAO,MAAM,4BAA4B,uBAAuB,CAAC"}
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.USER_DELETED_LIFECYCLE_EVENT = exports.USER_WORKLOAD_ONBOARDING_LIFECYCLE_EVENT = exports.USER_CREATED_LIFECYCLE_EVENT = exports.AGENT_LIFECYCLE = exports.AGENTS_POWERPOINT_SUBCHANNEL = exports.AGENTS_WORD_SUBCHANNEL = exports.AGENTS_EXCEL_SUBCHANNEL = exports.AGENTS_EMAIL_SUBCHANNEL = exports.AGENTS_CHANNEL = void 0;
4
+ /**
5
+ * Channel and sub-channel constants for agent notifications.
6
+ */
7
+ exports.AGENTS_CHANNEL = 'agents';
8
+ exports.AGENTS_EMAIL_SUBCHANNEL = 'agents:email';
9
+ exports.AGENTS_EXCEL_SUBCHANNEL = 'agents:excel';
10
+ exports.AGENTS_WORD_SUBCHANNEL = 'agents:word';
11
+ exports.AGENTS_POWERPOINT_SUBCHANNEL = 'agents:powerpoint';
12
+ /**
13
+ * Lifecycle constants for agent notifications.
14
+ */
15
+ exports.AGENT_LIFECYCLE = 'agentlifecycle';
16
+ exports.USER_CREATED_LIFECYCLE_EVENT = 'agenticuseridentitycreated';
17
+ exports.USER_WORKLOAD_ONBOARDING_LIFECYCLE_EVENT = 'agenticuserworkloadonboardingupdated';
18
+ exports.USER_DELETED_LIFECYCLE_EVENT = 'agenticuserdeleted';
19
+ //# sourceMappingURL=constants.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../src/constants.ts"],"names":[],"mappings":";;;AAAA;;GAEG;AACU,QAAA,cAAc,GAAG,QAAQ,CAAC;AAC1B,QAAA,uBAAuB,GAAG,cAAc,CAAC;AACzC,QAAA,uBAAuB,GAAG,cAAc,CAAC;AACzC,QAAA,sBAAsB,GAAG,aAAa,CAAC;AACvC,QAAA,4BAA4B,GAAG,mBAAmB,CAAC;AAEhE;;GAEG;AACU,QAAA,eAAe,GAAG,gBAAgB,CAAC;AACnC,QAAA,4BAA4B,GAAG,4BAA4B,CAAC;AAC5D,QAAA,wCAAwC,GAAG,sCAAsC,CAAC;AAClF,QAAA,4BAA4B,GAAG,oBAAoB,CAAC"}
@@ -0,0 +1,12 @@
1
+ import { TurnContext, TurnState } from '@microsoft/agents-hosting';
2
+ import { AgentNotificationActivity } from '../models/agent-notification-activity';
3
+ /**
4
+ * Type definition for an agent notification handler function.
5
+ * Handles agent notification activities with strongly-typed notification data.
6
+ *
7
+ * @param turnContext - The turn context
8
+ * @param turnState - The turn state
9
+ * @param agentNotificationActivity - The parsed notification activity containing notification types
10
+ */
11
+ export type AgentNotificationHandler<TState extends TurnState = TurnState> = (turnContext: TurnContext, turnState: TState, agentNotificationActivity: AgentNotificationActivity) => Promise<void>;
12
+ //# sourceMappingURL=agent-notification-handler.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"agent-notification-handler.d.ts","sourceRoot":"","sources":["../../../src/extensions/agent-notification-handler.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AACnE,OAAO,EAAE,yBAAyB,EAAE,MAAM,uCAAuC,CAAC;AAElF;;;;;;;GAOG;AACH,MAAM,MAAM,wBAAwB,CAAC,MAAM,SAAS,SAAS,GAAG,SAAS,IAAI,CAC3E,WAAW,EAAE,WAAW,EACxB,SAAS,EAAE,MAAM,EACjB,yBAAyB,EAAE,yBAAyB,KACjD,OAAO,CAAC,IAAI,CAAC,CAAC"}
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=agent-notification-handler.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"agent-notification-handler.js","sourceRoot":"","sources":["../../../src/extensions/agent-notification-handler.ts"],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ export * from './agent-notification-handler';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/extensions/index.ts"],"names":[],"mappings":"AAAA,cAAc,8BAA8B,CAAC"}
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./agent-notification-handler"), exports);
18
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/extensions/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,+DAA6C"}
@@ -0,0 +1,5 @@
1
+ export * from './models';
2
+ export * from './extensions';
3
+ export * from './constants';
4
+ export * from './agent-notification';
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AACA,cAAc,UAAU,CAAC;AAGzB,cAAc,cAAc,CAAC;AAG7B,cAAc,aAAa,CAAC;AAG5B,cAAc,sBAAsB,CAAC"}
@@ -0,0 +1,25 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ // Export all models
18
+ __exportStar(require("./models"), exports);
19
+ // Export all extensions
20
+ __exportStar(require("./extensions"), exports);
21
+ // Export all constants
22
+ __exportStar(require("./constants"), exports);
23
+ // Export main notification functions
24
+ __exportStar(require("./agent-notification"), exports);
25
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,oBAAoB;AACpB,2CAAyB;AAEzB,wBAAwB;AACxB,+CAA6B;AAE7B,uBAAuB;AACvB,8CAA4B;AAE5B,qCAAqC;AACrC,uDAAqC"}
@@ -0,0 +1,56 @@
1
+ import { NotificationType } from './notification-type';
2
+ import { EmailReference } from './email-reference';
3
+ import { WpxComment } from './wpx-comment';
4
+ import { Activity, ConversationAccount, ChannelAccount } from '@microsoft/agents-activity';
5
+ /**
6
+ * Represents a parsed agent notification activity with strongly-typed notification data.
7
+ */
8
+ export interface AgentNotificationActivity {
9
+ /**
10
+ * WPX comment notification if present.
11
+ */
12
+ wpxCommentNotification?: WpxComment;
13
+ /**
14
+ * Email notification if present.
15
+ */
16
+ emailNotification?: EmailReference;
17
+ /**
18
+ * The type of notification detected.
19
+ */
20
+ notificationType: NotificationType;
21
+ /**
22
+ * The conversation account.
23
+ */
24
+ conversation?: ConversationAccount;
25
+ /**
26
+ * The sender of the activity.
27
+ */
28
+ from: ChannelAccount;
29
+ /**
30
+ * The recipient of the activity.
31
+ */
32
+ recipient: ChannelAccount;
33
+ /**
34
+ * Channel-specific data.
35
+ */
36
+ channelData: unknown;
37
+ /**
38
+ * The text content of the activity.
39
+ */
40
+ text: string;
41
+ /**
42
+ * The value type of the activity.
43
+ */
44
+ valueType: string;
45
+ /**
46
+ * The value payload of the activity.
47
+ */
48
+ value: unknown;
49
+ }
50
+ /**
51
+ * Creates a wrapper for an agent notification activity.
52
+ * @param activity - The activity
53
+ * @returns An agent notification activity
54
+ */
55
+ export declare function createAgentNotificationActivity(activity: Activity): AgentNotificationActivity;
56
+ //# sourceMappingURL=agent-notification-activity.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"agent-notification-activity.d.ts","sourceRoot":"","sources":["../../../src/models/agent-notification-activity.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,EAAE,cAAc,EAAoB,MAAM,mBAAmB,CAAC;AACrE,OAAO,EAAE,UAAU,EAAgB,MAAM,eAAe,CAAC;AACzD,OAAO,EAAE,QAAQ,EAAE,mBAAmB,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAO3F;;GAEG;AACH,MAAM,WAAW,yBAAyB;IACxC;;OAEG;IACH,sBAAsB,CAAC,EAAE,UAAU,CAAC;IAEpC;;OAEG;IACH,iBAAiB,CAAC,EAAE,cAAc,CAAC;IAEnC;;OAEG;IACH,gBAAgB,EAAE,gBAAgB,CAAC;IAEnC;;OAEG;IACH,YAAY,CAAC,EAAE,mBAAmB,CAAC;IAEnC;;OAEG;IACH,IAAI,EAAE,cAAc,CAAC;IAErB;;OAEG;IACH,SAAS,EAAE,cAAc,CAAC;IAE1B;;OAEG;IACH,WAAW,EAAE,OAAO,CAAC;IAErB;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IAEb;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;IAElB;;OAEG;IACH,KAAK,EAAE,OAAO,CAAC;CAChB;AAED;;;;GAIG;AACH,wBAAgB,+BAA+B,CAC7C,QAAQ,EAAE,QAAQ,GACjB,yBAAyB,CAuC3B"}
@@ -0,0 +1,51 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.createAgentNotificationActivity = createAgentNotificationActivity;
4
+ const notification_type_1 = require("./notification-type");
5
+ const email_reference_1 = require("./email-reference");
6
+ const wpx_comment_1 = require("./wpx-comment");
7
+ const constants_1 = require("../constants");
8
+ /**
9
+ * Creates a wrapper for an agent notification activity.
10
+ * @param activity - The activity
11
+ * @returns An agent notification activity
12
+ */
13
+ function createAgentNotificationActivity(activity) {
14
+ if (!activity) {
15
+ throw new Error('Activity cannot be null or undefined');
16
+ }
17
+ let notificationType = notification_type_1.NotificationType.Unknown;
18
+ let wpxCommentNotification;
19
+ let emailNotification;
20
+ // Parse entities to extract notification types
21
+ if (activity.entities && Array.isArray(activity.entities)) {
22
+ for (const entity of activity.entities) {
23
+ if ((0, wpx_comment_1.isWpxComment)(entity)) {
24
+ wpxCommentNotification = entity;
25
+ notificationType = notification_type_1.NotificationType.WpxComment;
26
+ }
27
+ else if ((0, email_reference_1.isEmailReference)(entity)) {
28
+ emailNotification = entity;
29
+ notificationType = notification_type_1.NotificationType.EmailNotification;
30
+ }
31
+ }
32
+ }
33
+ else {
34
+ if (activity.name && activity.name.toLowerCase() === constants_1.AGENT_LIFECYCLE) {
35
+ notificationType = notification_type_1.NotificationType.AgentLifecycleNotification;
36
+ }
37
+ }
38
+ return {
39
+ wpxCommentNotification,
40
+ emailNotification,
41
+ notificationType,
42
+ conversation: activity.conversation,
43
+ from: activity.from ?? {},
44
+ recipient: activity.recipient ?? {},
45
+ channelData: activity.channelData ?? {},
46
+ text: activity.text ?? '',
47
+ valueType: activity.valueType ?? '',
48
+ value: activity.value ?? {}
49
+ };
50
+ }
51
+ //# sourceMappingURL=agent-notification-activity.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"agent-notification-activity.js","sourceRoot":"","sources":["../../../src/models/agent-notification-activity.ts"],"names":[],"mappings":";;AAsEA,0EAyCC;AA/GD,2DAAuD;AACvD,uDAAqE;AACrE,+CAAyD;AAGzD,4CAEsB;AA0DtB;;;;GAIG;AACH,SAAgB,+BAA+B,CAC7C,QAAkB;IAElB,IAAI,CAAC,QAAQ,EAAE,CAAC;QACd,MAAM,IAAI,KAAK,CAAC,sCAAsC,CAAC,CAAC;IAC1D,CAAC;IAED,IAAI,gBAAgB,GAAG,oCAAgB,CAAC,OAAO,CAAC;IAChD,IAAI,sBAA8C,CAAC;IACnD,IAAI,iBAA6C,CAAC;IAElD,+CAA+C;IAC/C,IAAI,QAAQ,CAAC,QAAQ,IAAI,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAC,EAAE,CAAC;QAC1D,KAAK,MAAM,MAAM,IAAI,QAAQ,CAAC,QAAQ,EAAE,CAAC;YACvC,IAAI,IAAA,0BAAY,EAAC,MAAM,CAAC,EAAE,CAAC;gBACzB,sBAAsB,GAAG,MAAM,CAAC;gBAChC,gBAAgB,GAAG,oCAAgB,CAAC,UAAU,CAAC;YACjD,CAAC;iBAAM,IAAI,IAAA,kCAAgB,EAAC,MAAM,CAAC,EAAE,CAAC;gBACpC,iBAAiB,GAAG,MAAM,CAAC;gBAC3B,gBAAgB,GAAG,oCAAgB,CAAC,iBAAiB,CAAC;YACxD,CAAC;QACH,CAAC;IACH,CAAC;SACI,CAAC;QACJ,IAAI,QAAQ,CAAC,IAAI,IAAI,QAAQ,CAAC,IAAI,CAAC,WAAW,EAAE,KAAK,2BAAe,EAAC,CAAC;YACpE,gBAAgB,GAAG,oCAAgB,CAAC,0BAA0B,CAAC;QACjE,CAAC;IACH,CAAC;IAED,OAAO;QACL,sBAAsB;QACtB,iBAAiB;QACjB,gBAAgB;QAChB,YAAY,EAAE,QAAQ,CAAC,YAAY;QACnC,IAAI,EAAE,QAAQ,CAAC,IAAI,IAAI,EAAE;QACzB,SAAS,EAAE,QAAQ,CAAC,SAAS,IAAI,EAAE;QACnC,WAAW,EAAE,QAAQ,CAAC,WAAW,IAAI,EAAE;QACvC,IAAI,EAAE,QAAQ,CAAC,IAAI,IAAI,EAAE;QACzB,SAAS,EAAE,QAAQ,CAAC,SAAS,IAAI,EAAE;QACnC,KAAK,EAAE,QAAQ,CAAC,KAAK,IAAI,EAAE;KAC5B,CAAC;AACJ,CAAC"}
@@ -0,0 +1,35 @@
1
+ import { Entity } from '@microsoft/agents-activity';
2
+ /**
3
+ * Represents an email notification entity.
4
+ */
5
+ export interface EmailReference extends Entity {
6
+ /**
7
+ * The type of the entity. Always 'emailNotification'.
8
+ */
9
+ type: 'emailNotification';
10
+ /**
11
+ * The ID of the email.
12
+ */
13
+ id?: string;
14
+ /**
15
+ * The conversation ID associated with the email.
16
+ */
17
+ conversationId?: string;
18
+ /**
19
+ * The HTML body content of the email.
20
+ */
21
+ htmlBody?: string;
22
+ }
23
+ /**
24
+ * The entity type name for email notifications.
25
+ */
26
+ export declare const EMAIL_NOTIFICATION_TYPE = "emailNotification";
27
+ /**
28
+ * Type guard to check if an entity is an EmailReference.
29
+ */
30
+ export declare function isEmailReference(entity: Entity): entity is EmailReference;
31
+ /**
32
+ * Factory function to create an EmailReference entity.
33
+ */
34
+ export declare function createEmailReference(id?: string, conversationId?: string, htmlBody?: string): EmailReference;
35
+ //# sourceMappingURL=email-reference.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"email-reference.d.ts","sourceRoot":"","sources":["../../../src/models/email-reference.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAC;AAEpD;;GAEG;AACH,MAAM,WAAW,cAAe,SAAQ,MAAM;IAC5C;;OAEG;IACH,IAAI,EAAE,mBAAmB,CAAC;IAE1B;;OAEG;IACH,EAAE,CAAC,EAAE,MAAM,CAAC;IAEZ;;OAEG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;IAExB;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED;;GAEG;AACH,eAAO,MAAM,uBAAuB,sBAAsB,CAAC;AAE3D;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,IAAI,cAAc,CAEzE;AAED;;GAEG;AACH,wBAAgB,oBAAoB,CAClC,EAAE,CAAC,EAAE,MAAM,EACX,cAAc,CAAC,EAAE,MAAM,EACvB,QAAQ,CAAC,EAAE,MAAM,GAChB,cAAc,CAOhB"}
@@ -0,0 +1,27 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.EMAIL_NOTIFICATION_TYPE = void 0;
4
+ exports.isEmailReference = isEmailReference;
5
+ exports.createEmailReference = createEmailReference;
6
+ /**
7
+ * The entity type name for email notifications.
8
+ */
9
+ exports.EMAIL_NOTIFICATION_TYPE = 'emailNotification';
10
+ /**
11
+ * Type guard to check if an entity is an EmailReference.
12
+ */
13
+ function isEmailReference(entity) {
14
+ return entity?.type?.toLowerCase() === exports.EMAIL_NOTIFICATION_TYPE.toLowerCase();
15
+ }
16
+ /**
17
+ * Factory function to create an EmailReference entity.
18
+ */
19
+ function createEmailReference(id, conversationId, htmlBody) {
20
+ return {
21
+ type: 'emailNotification',
22
+ id,
23
+ conversationId,
24
+ htmlBody,
25
+ };
26
+ }
27
+ //# sourceMappingURL=email-reference.js.map