@microsoft/agents-hosting-extensions-teams 0.5.1-g2e246ff274

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 (317) hide show
  1. package/dist/src/activity-extensions/channelInfo.d.ts +38 -0
  2. package/dist/src/activity-extensions/channelInfo.js +17 -0
  3. package/dist/src/activity-extensions/channelInfo.js.map +1 -0
  4. package/dist/src/activity-extensions/index.d.ts +15 -0
  5. package/dist/src/activity-extensions/index.js +25 -0
  6. package/dist/src/activity-extensions/index.js.map +1 -0
  7. package/dist/src/activity-extensions/notificationInfo.d.ts +38 -0
  8. package/dist/src/activity-extensions/notificationInfo.js +17 -0
  9. package/dist/src/activity-extensions/notificationInfo.js.map +1 -0
  10. package/dist/src/activity-extensions/onBehalfOf.d.ts +45 -0
  11. package/dist/src/activity-extensions/onBehalfOf.js +18 -0
  12. package/dist/src/activity-extensions/onBehalfOf.js.map +1 -0
  13. package/dist/src/activity-extensions/teamInfo.d.ts +38 -0
  14. package/dist/src/activity-extensions/teamInfo.js +17 -0
  15. package/dist/src/activity-extensions/teamInfo.js.map +1 -0
  16. package/dist/src/activity-extensions/teamsChannelAccount.d.ts +34 -0
  17. package/dist/src/activity-extensions/teamsChannelAccount.js +7 -0
  18. package/dist/src/activity-extensions/teamsChannelAccount.js.map +1 -0
  19. package/dist/src/activity-extensions/teamsChannelData.d.ts +230 -0
  20. package/dist/src/activity-extensions/teamsChannelData.js +39 -0
  21. package/dist/src/activity-extensions/teamsChannelData.js.map +1 -0
  22. package/dist/src/activity-extensions/teamsChannelDataParser.d.ts +12 -0
  23. package/dist/src/activity-extensions/teamsChannelDataParser.js +19 -0
  24. package/dist/src/activity-extensions/teamsChannelDataParser.js.map +1 -0
  25. package/dist/src/activity-extensions/teamsChannelDataSettings.d.ts +49 -0
  26. package/dist/src/activity-extensions/teamsChannelDataSettings.js +16 -0
  27. package/dist/src/activity-extensions/teamsChannelDataSettings.js.map +1 -0
  28. package/dist/src/activity-extensions/teamsConversationUpdateEvents.d.ts +58 -0
  29. package/dist/src/activity-extensions/teamsConversationUpdateEvents.js +7 -0
  30. package/dist/src/activity-extensions/teamsConversationUpdateEvents.js.map +1 -0
  31. package/dist/src/activity-extensions/teamsMeetingInfo.d.ts +24 -0
  32. package/dist/src/activity-extensions/teamsMeetingInfo.js +15 -0
  33. package/dist/src/activity-extensions/teamsMeetingInfo.js.map +1 -0
  34. package/dist/src/activity-extensions/teamsMessageEvents.d.ts +5 -0
  35. package/dist/src/activity-extensions/teamsMessageEvents.js +7 -0
  36. package/dist/src/activity-extensions/teamsMessageEvents.js.map +1 -0
  37. package/dist/src/activity-extensions/tenantInfo.d.ts +24 -0
  38. package/dist/src/activity-extensions/tenantInfo.js +15 -0
  39. package/dist/src/activity-extensions/tenantInfo.js.map +1 -0
  40. package/dist/src/client/index.d.ts +6 -0
  41. package/dist/src/client/index.js +23 -0
  42. package/dist/src/client/index.js.map +1 -0
  43. package/dist/src/client/teamsConnectorClient.d.ts +146 -0
  44. package/dist/src/client/teamsConnectorClient.js +313 -0
  45. package/dist/src/client/teamsConnectorClient.js.map +1 -0
  46. package/dist/src/client/teamsConnectorClient.types.d.ts +157 -0
  47. package/dist/src/client/teamsConnectorClient.types.js +7 -0
  48. package/dist/src/client/teamsConnectorClient.types.js.map +1 -0
  49. package/dist/src/compat/readReceipInfo.d.ts +31 -0
  50. package/dist/src/compat/readReceipInfo.js +48 -0
  51. package/dist/src/compat/readReceipInfo.js.map +1 -0
  52. package/dist/src/compat/teamsActivityHandler.d.ts +423 -0
  53. package/dist/src/compat/teamsActivityHandler.js +911 -0
  54. package/dist/src/compat/teamsActivityHandler.js.map +1 -0
  55. package/dist/src/file/fileConsentCardResponse.d.ts +26 -0
  56. package/dist/src/file/fileConsentCardResponse.js +7 -0
  57. package/dist/src/file/fileConsentCardResponse.js.map +1 -0
  58. package/dist/src/file/fileUploadInfo.d.ts +29 -0
  59. package/dist/src/file/fileUploadInfo.js +7 -0
  60. package/dist/src/file/fileUploadInfo.js.map +1 -0
  61. package/dist/src/file/index.d.ts +6 -0
  62. package/dist/src/file/index.js +23 -0
  63. package/dist/src/file/index.js.map +1 -0
  64. package/dist/src/index.d.ts +10 -0
  65. package/dist/src/index.js +27 -0
  66. package/dist/src/index.js.map +1 -0
  67. package/dist/src/meeting/index.d.ts +22 -0
  68. package/dist/src/meeting/index.js +39 -0
  69. package/dist/src/meeting/index.js.map +1 -0
  70. package/dist/src/meeting/meeting.d.ts +115 -0
  71. package/dist/src/meeting/meeting.js +257 -0
  72. package/dist/src/meeting/meeting.js.map +1 -0
  73. package/dist/src/meeting/meetingDetails.d.ts +18 -0
  74. package/dist/src/meeting/meetingDetails.js +7 -0
  75. package/dist/src/meeting/meetingDetails.js.map +1 -0
  76. package/dist/src/meeting/meetingDetailsBase.d.ts +15 -0
  77. package/dist/src/meeting/meetingDetailsBase.js +7 -0
  78. package/dist/src/meeting/meetingDetailsBase.js.map +1 -0
  79. package/dist/src/meeting/meetingEndEventDetails.d.ts +12 -0
  80. package/dist/src/meeting/meetingEndEventDetails.js +7 -0
  81. package/dist/src/meeting/meetingEndEventDetails.js.map +1 -0
  82. package/dist/src/meeting/meetingEventDetails.d.ts +12 -0
  83. package/dist/src/meeting/meetingEventDetails.js +7 -0
  84. package/dist/src/meeting/meetingEventDetails.js.map +1 -0
  85. package/dist/src/meeting/meetingInfo.d.ts +24 -0
  86. package/dist/src/meeting/meetingInfo.js +7 -0
  87. package/dist/src/meeting/meetingInfo.js.map +1 -0
  88. package/dist/src/meeting/meetingNotification.d.ts +9 -0
  89. package/dist/src/meeting/meetingNotification.js +7 -0
  90. package/dist/src/meeting/meetingNotification.js.map +1 -0
  91. package/dist/src/meeting/meetingNotificationBase.d.ts +14 -0
  92. package/dist/src/meeting/meetingNotificationBase.js +7 -0
  93. package/dist/src/meeting/meetingNotificationBase.js.map +1 -0
  94. package/dist/src/meeting/meetingNotificationChannelData.d.ts +12 -0
  95. package/dist/src/meeting/meetingNotificationChannelData.js +7 -0
  96. package/dist/src/meeting/meetingNotificationChannelData.js.map +1 -0
  97. package/dist/src/meeting/meetingNotificationRecipientFailureInfo.d.ts +15 -0
  98. package/dist/src/meeting/meetingNotificationRecipientFailureInfo.js +7 -0
  99. package/dist/src/meeting/meetingNotificationRecipientFailureInfo.js.map +1 -0
  100. package/dist/src/meeting/meetingNotificationResponse.d.ts +14 -0
  101. package/dist/src/meeting/meetingNotificationResponse.js +7 -0
  102. package/dist/src/meeting/meetingNotificationResponse.js.map +1 -0
  103. package/dist/src/meeting/meetingParticipantsEventDetails.d.ts +12 -0
  104. package/dist/src/meeting/meetingParticipantsEventDetails.js +7 -0
  105. package/dist/src/meeting/meetingParticipantsEventDetails.js.map +1 -0
  106. package/dist/src/meeting/meetingStageSurface.d.ts +16 -0
  107. package/dist/src/meeting/meetingStageSurface.js +7 -0
  108. package/dist/src/meeting/meetingStageSurface.js.map +1 -0
  109. package/dist/src/meeting/meetingStartEventDetails.d.ts +14 -0
  110. package/dist/src/meeting/meetingStartEventDetails.js +7 -0
  111. package/dist/src/meeting/meetingStartEventDetails.js.map +1 -0
  112. package/dist/src/meeting/meetingSurface.d.ts +10 -0
  113. package/dist/src/meeting/meetingSurface.js +7 -0
  114. package/dist/src/meeting/meetingSurface.js.map +1 -0
  115. package/dist/src/meeting/meetingTabIconSurface.d.ts +17 -0
  116. package/dist/src/meeting/meetingTabIconSurface.js +7 -0
  117. package/dist/src/meeting/meetingTabIconSurface.js.map +1 -0
  118. package/dist/src/meeting/targetedMeetingNotification.d.ts +20 -0
  119. package/dist/src/meeting/targetedMeetingNotification.js +7 -0
  120. package/dist/src/meeting/targetedMeetingNotification.js.map +1 -0
  121. package/dist/src/meeting/targetedMeetingNotificationValue.d.ts +18 -0
  122. package/dist/src/meeting/targetedMeetingNotificationValue.js +7 -0
  123. package/dist/src/meeting/targetedMeetingNotificationValue.js.map +1 -0
  124. package/dist/src/meeting/teamsMeetingMember.d.ts +19 -0
  125. package/dist/src/meeting/teamsMeetingMember.js +7 -0
  126. package/dist/src/meeting/teamsMeetingMember.js.map +1 -0
  127. package/dist/src/meeting/teamsMeetingParticipant.d.ts +25 -0
  128. package/dist/src/meeting/teamsMeetingParticipant.js +7 -0
  129. package/dist/src/meeting/teamsMeetingParticipant.js.map +1 -0
  130. package/dist/src/meeting/userMeetingDetails.d.ts +17 -0
  131. package/dist/src/meeting/userMeetingDetails.js +7 -0
  132. package/dist/src/meeting/userMeetingDetails.js.map +1 -0
  133. package/dist/src/message-actions-payload/index.d.ts +13 -0
  134. package/dist/src/message-actions-payload/index.js +30 -0
  135. package/dist/src/message-actions-payload/index.js.map +1 -0
  136. package/dist/src/message-actions-payload/messageActionsPayload.d.ts +90 -0
  137. package/dist/src/message-actions-payload/messageActionsPayload.js +7 -0
  138. package/dist/src/message-actions-payload/messageActionsPayload.js.map +1 -0
  139. package/dist/src/message-actions-payload/messageActionsPayloadApp.d.ts +25 -0
  140. package/dist/src/message-actions-payload/messageActionsPayloadApp.js +7 -0
  141. package/dist/src/message-actions-payload/messageActionsPayloadApp.js.map +1 -0
  142. package/dist/src/message-actions-payload/messageActionsPayloadAttachment.d.ts +33 -0
  143. package/dist/src/message-actions-payload/messageActionsPayloadAttachment.js +7 -0
  144. package/dist/src/message-actions-payload/messageActionsPayloadAttachment.js.map +1 -0
  145. package/dist/src/message-actions-payload/messageActionsPayloadBody.d.ts +25 -0
  146. package/dist/src/message-actions-payload/messageActionsPayloadBody.js +7 -0
  147. package/dist/src/message-actions-payload/messageActionsPayloadBody.js.map +1 -0
  148. package/dist/src/message-actions-payload/messageActionsPayloadConversation.d.ts +25 -0
  149. package/dist/src/message-actions-payload/messageActionsPayloadConversation.js +7 -0
  150. package/dist/src/message-actions-payload/messageActionsPayloadConversation.js.map +1 -0
  151. package/dist/src/message-actions-payload/messageActionsPayloadFrom.d.ts +24 -0
  152. package/dist/src/message-actions-payload/messageActionsPayloadFrom.js +7 -0
  153. package/dist/src/message-actions-payload/messageActionsPayloadFrom.js.map +1 -0
  154. package/dist/src/message-actions-payload/messageActionsPayloadMention.d.ts +22 -0
  155. package/dist/src/message-actions-payload/messageActionsPayloadMention.js +7 -0
  156. package/dist/src/message-actions-payload/messageActionsPayloadMention.js.map +1 -0
  157. package/dist/src/message-actions-payload/messageActionsPayloadReaction.d.ts +26 -0
  158. package/dist/src/message-actions-payload/messageActionsPayloadReaction.js +7 -0
  159. package/dist/src/message-actions-payload/messageActionsPayloadReaction.js.map +1 -0
  160. package/dist/src/message-actions-payload/messageActionsPayloadUser.d.ts +29 -0
  161. package/dist/src/message-actions-payload/messageActionsPayloadUser.js +7 -0
  162. package/dist/src/message-actions-payload/messageActionsPayloadUser.js.map +1 -0
  163. package/dist/src/messageExtension/appBasedLinkQuery.d.ts +19 -0
  164. package/dist/src/messageExtension/appBasedLinkQuery.js +7 -0
  165. package/dist/src/messageExtension/appBasedLinkQuery.js.map +1 -0
  166. package/dist/src/messageExtension/index.d.ts +14 -0
  167. package/dist/src/messageExtension/index.js +29 -0
  168. package/dist/src/messageExtension/index.js.map +1 -0
  169. package/dist/src/messageExtension/messageExtension.d.ts +88 -0
  170. package/dist/src/messageExtension/messageExtension.js +283 -0
  171. package/dist/src/messageExtension/messageExtension.js.map +1 -0
  172. package/dist/src/messageExtension/messagingExtensionAction.d.ts +40 -0
  173. package/dist/src/messageExtension/messagingExtensionAction.js +7 -0
  174. package/dist/src/messageExtension/messagingExtensionAction.js.map +1 -0
  175. package/dist/src/messageExtension/messagingExtensionActionResponse.d.ts +23 -0
  176. package/dist/src/messageExtension/messagingExtensionActionResponse.js +7 -0
  177. package/dist/src/messageExtension/messagingExtensionActionResponse.js.map +1 -0
  178. package/dist/src/messageExtension/messagingExtensionAttachment.d.ts +14 -0
  179. package/dist/src/messageExtension/messagingExtensionAttachment.js +7 -0
  180. package/dist/src/messageExtension/messagingExtensionAttachment.js.map +1 -0
  181. package/dist/src/messageExtension/messagingExtensionParameter.d.ts +31 -0
  182. package/dist/src/messageExtension/messagingExtensionParameter.js +16 -0
  183. package/dist/src/messageExtension/messagingExtensionParameter.js.map +1 -0
  184. package/dist/src/messageExtension/messagingExtensionQuery.d.ts +84 -0
  185. package/dist/src/messageExtension/messagingExtensionQuery.js +31 -0
  186. package/dist/src/messageExtension/messagingExtensionQuery.js.map +1 -0
  187. package/dist/src/messageExtension/messagingExtensionQueryOptions.d.ts +31 -0
  188. package/dist/src/messageExtension/messagingExtensionQueryOptions.js +16 -0
  189. package/dist/src/messageExtension/messagingExtensionQueryOptions.js.map +1 -0
  190. package/dist/src/messageExtension/messagingExtensionResponse.d.ts +18 -0
  191. package/dist/src/messageExtension/messagingExtensionResponse.js +7 -0
  192. package/dist/src/messageExtension/messagingExtensionResponse.js.map +1 -0
  193. package/dist/src/messageExtension/messagingExtensionResult.d.ts +50 -0
  194. package/dist/src/messageExtension/messagingExtensionResult.js +7 -0
  195. package/dist/src/messageExtension/messagingExtensionResult.js.map +1 -0
  196. package/dist/src/messageExtension/messagingExtensionSuggestedAction.d.ts +14 -0
  197. package/dist/src/messageExtension/messagingExtensionSuggestedAction.js +7 -0
  198. package/dist/src/messageExtension/messagingExtensionSuggestedAction.js.map +1 -0
  199. package/dist/src/messages/messages.d.ts +40 -0
  200. package/dist/src/messages/messages.js +82 -0
  201. package/dist/src/messages/messages.js.map +1 -0
  202. package/dist/src/taskModule/index.d.ts +11 -0
  203. package/dist/src/taskModule/index.js +28 -0
  204. package/dist/src/taskModule/index.js.map +1 -0
  205. package/dist/src/taskModule/taskModule.d.ts +72 -0
  206. package/dist/src/taskModule/taskModule.js +210 -0
  207. package/dist/src/taskModule/taskModule.js.map +1 -0
  208. package/dist/src/taskModule/taskModuleContinueResponse.d.ts +15 -0
  209. package/dist/src/taskModule/taskModuleContinueResponse.js +7 -0
  210. package/dist/src/taskModule/taskModuleContinueResponse.js.map +1 -0
  211. package/dist/src/taskModule/taskModuleMessageResponse.d.ts +14 -0
  212. package/dist/src/taskModule/taskModuleMessageResponse.js +7 -0
  213. package/dist/src/taskModule/taskModuleMessageResponse.js.map +1 -0
  214. package/dist/src/taskModule/taskModuleRequest.d.ts +22 -0
  215. package/dist/src/taskModule/taskModuleRequest.js +7 -0
  216. package/dist/src/taskModule/taskModuleRequest.js.map +1 -0
  217. package/dist/src/taskModule/taskModuleRequestContext.d.ts +13 -0
  218. package/dist/src/taskModule/taskModuleRequestContext.js +7 -0
  219. package/dist/src/taskModule/taskModuleRequestContext.js.map +1 -0
  220. package/dist/src/taskModule/taskModuleResponse.d.ts +19 -0
  221. package/dist/src/taskModule/taskModuleResponse.js +7 -0
  222. package/dist/src/taskModule/taskModuleResponse.js.map +1 -0
  223. package/dist/src/taskModule/taskModuleResponseBase.d.ts +17 -0
  224. package/dist/src/taskModule/taskModuleResponseBase.js +7 -0
  225. package/dist/src/taskModule/taskModuleResponseBase.js.map +1 -0
  226. package/dist/src/taskModule/taskModuleTaskInfo.d.ts +38 -0
  227. package/dist/src/taskModule/taskModuleTaskInfo.js +7 -0
  228. package/dist/src/taskModule/taskModuleTaskInfo.js.map +1 -0
  229. package/dist/src/teamsAgentExtension.d.ts +30 -0
  230. package/dist/src/teamsAgentExtension.js +184 -0
  231. package/dist/src/teamsAgentExtension.js.map +1 -0
  232. package/dist/src/teamsAttachmentDownloader.d.ts +27 -0
  233. package/dist/src/teamsAttachmentDownloader.js +80 -0
  234. package/dist/src/teamsAttachmentDownloader.js.map +1 -0
  235. package/dist/src/teamsInfo.d.ts +174 -0
  236. package/dist/src/teamsInfo.js +387 -0
  237. package/dist/src/teamsInfo.js.map +1 -0
  238. package/package.json +37 -0
  239. package/src/activity-extensions/channelInfo.ts +33 -0
  240. package/src/activity-extensions/index.ts +16 -0
  241. package/src/activity-extensions/notificationInfo.ts +33 -0
  242. package/src/activity-extensions/onBehalfOf.ts +38 -0
  243. package/src/activity-extensions/teamInfo.ts +33 -0
  244. package/src/activity-extensions/teamsChannelAccount.ts +36 -0
  245. package/src/activity-extensions/teamsChannelData.ts +75 -0
  246. package/src/activity-extensions/teamsChannelDataParser.ts +17 -0
  247. package/src/activity-extensions/teamsChannelDataSettings.ts +28 -0
  248. package/src/activity-extensions/teamsConversationUpdateEvents.ts +61 -0
  249. package/src/activity-extensions/teamsMeetingInfo.ts +23 -0
  250. package/src/activity-extensions/teamsMessageEvents.ts +6 -0
  251. package/src/activity-extensions/tenantInfo.ts +23 -0
  252. package/src/client/index.ts +7 -0
  253. package/src/client/teamsConnectorClient.ts +340 -0
  254. package/src/client/teamsConnectorClient.types.ts +168 -0
  255. package/src/compat/readReceipInfo.ts +54 -0
  256. package/src/compat/teamsActivityHandler.ts +1140 -0
  257. package/src/file/fileConsentCardResponse.ts +31 -0
  258. package/src/file/fileUploadInfo.ts +34 -0
  259. package/src/file/index.ts +7 -0
  260. package/src/index.ts +10 -0
  261. package/src/meeting/index.ts +23 -0
  262. package/src/meeting/meeting.ts +307 -0
  263. package/src/meeting/meetingDetails.ts +20 -0
  264. package/src/meeting/meetingDetailsBase.ts +16 -0
  265. package/src/meeting/meetingEndEventDetails.ts +14 -0
  266. package/src/meeting/meetingEventDetails.ts +14 -0
  267. package/src/meeting/meetingInfo.ts +26 -0
  268. package/src/meeting/meetingNotification.ts +11 -0
  269. package/src/meeting/meetingNotificationBase.ts +15 -0
  270. package/src/meeting/meetingNotificationChannelData.ts +14 -0
  271. package/src/meeting/meetingNotificationRecipientFailureInfo.ts +16 -0
  272. package/src/meeting/meetingNotificationResponse.ts +16 -0
  273. package/src/meeting/meetingParticipantsEventDetails.ts +14 -0
  274. package/src/meeting/meetingStageSurface.ts +17 -0
  275. package/src/meeting/meetingStartEventDetails.ts +16 -0
  276. package/src/meeting/meetingSurface.ts +12 -0
  277. package/src/meeting/meetingTabIconSurface.ts +19 -0
  278. package/src/meeting/targetedMeetingNotification.ts +23 -0
  279. package/src/meeting/targetedMeetingNotificationValue.ts +21 -0
  280. package/src/meeting/teamsMeetingMember.ts +22 -0
  281. package/src/meeting/teamsMeetingParticipant.ts +29 -0
  282. package/src/meeting/userMeetingDetails.ts +19 -0
  283. package/src/message-actions-payload/index.ts +14 -0
  284. package/src/message-actions-payload/messageActionsPayload.ts +93 -0
  285. package/src/message-actions-payload/messageActionsPayloadApp.ts +27 -0
  286. package/src/message-actions-payload/messageActionsPayloadAttachment.ts +34 -0
  287. package/src/message-actions-payload/messageActionsPayloadBody.ts +27 -0
  288. package/src/message-actions-payload/messageActionsPayloadConversation.ts +27 -0
  289. package/src/message-actions-payload/messageActionsPayloadFrom.ts +26 -0
  290. package/src/message-actions-payload/messageActionsPayloadMention.ts +24 -0
  291. package/src/message-actions-payload/messageActionsPayloadReaction.ts +29 -0
  292. package/src/message-actions-payload/messageActionsPayloadUser.ts +31 -0
  293. package/src/messageExtension/appBasedLinkQuery.ts +20 -0
  294. package/src/messageExtension/index.ts +15 -0
  295. package/src/messageExtension/messageExtension.ts +324 -0
  296. package/src/messageExtension/messagingExtensionAction.ts +44 -0
  297. package/src/messageExtension/messagingExtensionActionResponse.ts +25 -0
  298. package/src/messageExtension/messagingExtensionAttachment.ts +16 -0
  299. package/src/messageExtension/messagingExtensionParameter.ts +28 -0
  300. package/src/messageExtension/messagingExtensionQuery.ts +51 -0
  301. package/src/messageExtension/messagingExtensionQueryOptions.ts +28 -0
  302. package/src/messageExtension/messagingExtensionResponse.ts +21 -0
  303. package/src/messageExtension/messagingExtensionResult.ts +60 -0
  304. package/src/messageExtension/messagingExtensionSuggestedAction.ts +16 -0
  305. package/src/messages/messages.ts +91 -0
  306. package/src/taskModule/index.ts +12 -0
  307. package/src/taskModule/taskModule.ts +241 -0
  308. package/src/taskModule/taskModuleContinueResponse.ts +17 -0
  309. package/src/taskModule/taskModuleMessageResponse.ts +16 -0
  310. package/src/taskModule/taskModuleRequest.ts +24 -0
  311. package/src/taskModule/taskModuleRequestContext.ts +14 -0
  312. package/src/taskModule/taskModuleResponse.ts +21 -0
  313. package/src/taskModule/taskModuleResponseBase.ts +19 -0
  314. package/src/taskModule/taskModuleTaskInfo.ts +40 -0
  315. package/src/teamsAgentExtension.ts +201 -0
  316. package/src/teamsAttachmentDownloader.ts +78 -0
  317. package/src/teamsInfo.ts +430 -0
@@ -0,0 +1,91 @@
1
+ /**
2
+ * Copyright (c) Microsoft Corporation. All rights reserved.
3
+ * Licensed under the MIT License.
4
+ */
5
+
6
+ import { Activity, ActivityTypes, Channels } from '@microsoft/agents-activity'
7
+ import { AgentApplication, INVOKE_RESPONSE_KEY, InvokeResponse, TurnContext, TurnState } from '@microsoft/agents-hosting'
8
+ import { TaskModuleResponse, TaskModuleTaskInfo } from '../taskModule'
9
+
10
+ /**
11
+ * Enum representing the names of message invoke actions.
12
+ *
13
+ * This enum is used to define the specific invoke actions that can be triggered
14
+ * in the context of message handling.
15
+ */
16
+ export enum MessageInvokeNames {
17
+ /**
18
+ * Represents the action to fetch a task associated with a message.
19
+ */
20
+ FETCH_INVOKE_NAME = 'message/fetchTask'
21
+ }
22
+
23
+ /**
24
+ * Handles message-related operations for Teams applications.
25
+ * Provides methods for handling message fetch operations.
26
+ * @template TState Type extending TurnState to be used by the application
27
+ */
28
+ export class Messages<TState extends TurnState> {
29
+ private readonly _app: AgentApplication<TState>
30
+
31
+ /**
32
+ * Creates a new Messages instance.
33
+ * @param app The TeamsApplication instance to associate with this Messages instance
34
+ */
35
+ public constructor (app: AgentApplication<TState>) {
36
+ this._app = app
37
+ }
38
+
39
+ /**
40
+ * Handles fetch requests for messages in Teams, which typically occur when
41
+ * a message action is invoked.
42
+ *
43
+ * @template TData Type of data expected in the message fetch request
44
+ * @param handler Function to handle the message fetch request
45
+ * @returns The TeamsApplication instance for chaining
46
+ */
47
+ public fetch<TData extends Record<string, any> = Record<string, any>>(
48
+ handler: (context: TurnContext, state: TState, data: TData) => Promise<TaskModuleTaskInfo | string>
49
+ ): AgentApplication<TState> {
50
+ this._app.addRoute(
51
+ async (context) => {
52
+ return (
53
+ context?.activity?.type === ActivityTypes.Invoke &&
54
+ context?.activity?.name === MessageInvokeNames.FETCH_INVOKE_NAME
55
+ )
56
+ },
57
+ async (context, state) => {
58
+ if (context?.activity?.channelId === Channels.Msteams) {
59
+ const result = await handler(context, state, (context.activity.value as TData)?.data ?? {} as TData)
60
+
61
+ if (!context.turnState.get(INVOKE_RESPONSE_KEY)) {
62
+ let response: TaskModuleResponse
63
+ if (typeof result === 'string') {
64
+ response = {
65
+ task: {
66
+ type: 'message',
67
+ value: result
68
+ }
69
+ }
70
+ } else {
71
+ response = {
72
+ task: {
73
+ type: 'continue',
74
+ value: result
75
+ }
76
+ }
77
+ }
78
+
79
+ await context.sendActivity({
80
+ value: { body: response, status: 200 } as InvokeResponse,
81
+ type: ActivityTypes.InvokeResponse
82
+ } as Activity)
83
+ }
84
+ }
85
+ },
86
+ true
87
+ )
88
+
89
+ return this._app
90
+ }
91
+ }
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Copyright (c) Microsoft Corporation. All rights reserved.
3
+ * Licensed under the MIT License.
4
+ */
5
+
6
+ export * from './taskModuleContinueResponse'
7
+ export * from './taskModuleMessageResponse'
8
+ export * from './taskModuleRequest'
9
+ export * from './taskModuleRequestContext'
10
+ export * from './taskModuleResponse'
11
+ export * from './taskModuleResponseBase'
12
+ export * from './taskModuleTaskInfo'
@@ -0,0 +1,241 @@
1
+ import { Activity, ActivityTypes, Channels } from '@microsoft/agents-activity'
2
+ import { AgentApplication, INVOKE_RESPONSE_KEY, InvokeResponse, RouteHandler, RouteSelector, TurnContext, TurnState } from '@microsoft/agents-hosting'
3
+ import { TaskModuleTaskInfo } from './taskModuleTaskInfo'
4
+ import { TaskModuleResponse } from './taskModuleResponse'
5
+
6
+ export enum TaskModuleInvokeNames {
7
+ CONFIG_FETCH_INVOKE_NAME = 'config/fetch',
8
+ CONFIG_SUBMIT_INVOKE_NAME = 'config/submit',
9
+ FETCH_INVOKE_NAME = 'task/fetch',
10
+ SUBMIT_INVOKE_NAME = 'task/submit',
11
+ DEFAULT_TASK_DATA_FILTER = 'verb'
12
+ }
13
+
14
+ interface TaskModuleOptions {
15
+ taskDataFilter?: string
16
+ }
17
+
18
+ /**
19
+ * Class that exposes Teams task module-related events.
20
+ * Provides an organized way to handle task module operations in Microsoft Teams.
21
+ */
22
+ export class TaskModule<TState extends TurnState> {
23
+ _app: AgentApplication<TState>
24
+ _options: TaskModuleOptions
25
+
26
+ /**
27
+ * Creates a new instance of the TaskModule class.
28
+ * @param app - The agent application
29
+ */
30
+ constructor (app: AgentApplication<TState>, options?: TaskModuleOptions) {
31
+ this._options = options ?? { taskDataFilter: TaskModuleInvokeNames.DEFAULT_TASK_DATA_FILTER }
32
+ this._app = app
33
+ }
34
+
35
+ /**
36
+ * Handles task module fetch events. These occur when a task module is requested to be displayed.
37
+ * @param handler - The handler to call when a task module fetch event occurs
38
+ * @returns this (for method chaining)
39
+ */
40
+ onFetch (handler: RouteHandler<TurnState>) {
41
+ const routeSel: RouteSelector = (context: TurnContext) => {
42
+ return Promise.resolve(
43
+ context.activity.type === ActivityTypes.Invoke &&
44
+ context.activity.channelId === 'msteams' &&
45
+ context.activity.name === 'task/fetch'
46
+ )
47
+ }
48
+ this._app.addRoute(routeSel, handler, true) // Invoke requires true
49
+ return this
50
+ }
51
+
52
+ /**
53
+ * Registers a handler to process the submission of a task module.
54
+ * @remarks
55
+ * Handlers should respond with another TaskInfo object, message string, or `null` to indicate
56
+ * the task is completed.
57
+ * @template TData Optional. Type of the data object being passed to the handler.
58
+ * @param {string | RegExp | RouteSelector | string[] | RegExp[] | RouteSelector[]} verb - Name of the verb(s) to register the handler for.
59
+ * @param {(context: TurnContext, state: TState, data: TData) => Promise<TaskModuleTaskInfo | string | null | undefined>} handler - Function to call when the handler is triggered.
60
+ * @param {TurnContext} handler.context - Context for the current turn of conversation with the user.
61
+ * @param {TState} handler.state - Current state of the turn.
62
+ * @param {TData} handler.data - Data object passed to the handler.
63
+ * @returns {Application<TState>} The application for chaining purposes.
64
+ */
65
+ public submit<TData extends Record<string, any> = Record<string, any>>(
66
+ verb: string | RegExp | RouteSelector | (string | RegExp | RouteSelector)[],
67
+ handler: (
68
+ context: TurnContext,
69
+ state: TState,
70
+ data: TData
71
+ ) => Promise<TaskModuleTaskInfo | string | null | undefined>
72
+ ): AgentApplication<TState> {
73
+ (Array.isArray(verb) ? verb : [verb]).forEach((v) => {
74
+ const { DEFAULT_TASK_DATA_FILTER, SUBMIT_INVOKE_NAME } = TaskModuleInvokeNames
75
+ const filterField = this._options.taskDataFilter ?? DEFAULT_TASK_DATA_FILTER
76
+ const selector = createTaskSelector(v, filterField, SUBMIT_INVOKE_NAME)
77
+ this._app.addRoute(
78
+ selector,
79
+ async (context, state) => {
80
+ if (context?.activity?.channelId === Channels.Msteams) {
81
+ if (context?.activity?.type !== ActivityTypes.Invoke || context?.activity?.name !== SUBMIT_INVOKE_NAME) {
82
+ throw new Error(`Unexpected TaskModules.submit() triggered for activity type: ${context?.activity?.type}`
83
+ )
84
+ }
85
+
86
+ const result = await handler(context, state, (context.activity.value as any).data ?? {})
87
+
88
+ if (!result) {
89
+ await context.sendActivity(Activity.fromObject({
90
+ value: { status: 200 } as InvokeResponse,
91
+ type: ActivityTypes.InvokeResponse
92
+ }))
93
+ }
94
+ if (!context.turnState.get(INVOKE_RESPONSE_KEY)) {
95
+ let response: TaskModuleResponse | undefined
96
+ if (typeof result === 'string') {
97
+ response = {
98
+ task: {
99
+ type: 'message',
100
+ value: result
101
+ }
102
+ }
103
+ } else if (typeof result === 'object') {
104
+ // Return card
105
+ response = {
106
+ task: {
107
+ type: 'continue',
108
+ value: result as TaskModuleTaskInfo
109
+ }
110
+ }
111
+ }
112
+
113
+ // Queue up invoke response
114
+ await context.sendActivity(Activity.fromObject({
115
+ value: { body: response, status: 200 } as InvokeResponse,
116
+ type: ActivityTypes.InvokeResponse
117
+ }))
118
+ }
119
+ }
120
+ },
121
+ true
122
+ )
123
+ })
124
+ return this._app
125
+ }
126
+
127
+ /**
128
+ * Handles specific task module fetch events based on a verb/action.
129
+ * @param verb - The verb or action identifier to match against in the task module data
130
+ * @param handler - The handler to call when a matching task module fetch event occurs
131
+ * @returns this (for method chaining)
132
+ */
133
+ onFetchByVerb (verb: string, handler: RouteHandler<TurnState>) {
134
+ const routeSel: RouteSelector = (context: TurnContext) => {
135
+ return Promise.resolve(
136
+ context.activity.type === ActivityTypes.Invoke &&
137
+ context.activity.channelId === 'msteams' &&
138
+ context.activity.name === 'task/fetch' &&
139
+ // @ts-ignore
140
+ context.activity.value?.data === verb
141
+ )
142
+ }
143
+ this._app.addRoute(routeSel, handler, true)
144
+ return this
145
+ }
146
+
147
+ /**
148
+ * Handles specific task module submit events based on a verb/action.
149
+ * @param verb - The verb or action identifier to match against in the task module data
150
+ * @param handler - The handler to call when a matching task module submit event occurs
151
+ * @returns this (for method chaining)
152
+ */
153
+ onSubmitByVerb (verb: string, handler: RouteHandler<TurnState>) {
154
+ const routeSel: RouteSelector = (context: TurnContext) => {
155
+ return Promise.resolve(
156
+ context.activity.type === ActivityTypes.Invoke &&
157
+ context.activity.channelId === 'msteams' &&
158
+ context.activity.name === 'task/submit' &&
159
+ // @ts-ignore
160
+ context.activity.value?.data === verb
161
+ )
162
+ }
163
+ this._app.addRoute(routeSel, handler, true)
164
+ return this
165
+ }
166
+
167
+ /**
168
+ * Handles configuration fetch events. These occur when an agent configuration is requested.
169
+ * @param handler - The handler to call when a configuration fetch event occurs
170
+ * @returns this (for method chaining)
171
+ */
172
+ onConfigurationFetch (handler: RouteHandler<TurnState>) {
173
+ const routeSel: RouteSelector = (context: TurnContext) => {
174
+ return Promise.resolve(
175
+ context.activity.type === ActivityTypes.Invoke &&
176
+ context.activity.channelId === 'msteams' &&
177
+ context.activity.name === 'config/fetch'
178
+ )
179
+ }
180
+ this._app.addRoute(routeSel, handler, true)
181
+ return this
182
+ }
183
+
184
+ /**
185
+ * Handles configuration submit events. These occur when an agent configuration is submitted.
186
+ * @param handler - The handler to call when a configuration submit event occurs
187
+ * @returns this (for method chaining)
188
+ */
189
+ onConfigurationSubmit (handler: RouteHandler<TurnState>) {
190
+ const routeSel: RouteSelector = (context: TurnContext) => {
191
+ return Promise.resolve(
192
+ context.activity.type === ActivityTypes.Invoke &&
193
+ context.activity.channelId === 'msteams' &&
194
+ context.activity.name === 'config/submit'
195
+ )
196
+ }
197
+ this._app.addRoute(routeSel, handler, true)
198
+ return this
199
+ }
200
+ }
201
+
202
+ /**
203
+ * Creates a route selector function for a given verb, filter field, and invoke name.
204
+ * @param {string | RegExp | RouteSelector} verb - The verb to match.
205
+ * @param {string} filterField - The field to use for filtering.
206
+ * @param {string} invokeName - The name of the invoke action.
207
+ * @returns {RouteSelector} The route selector function.
208
+ * @private
209
+ * @remarks
210
+ * This function is used to create a route selector function for a given verb, filter field, and invoke name.
211
+ * The route selector function is used to match incoming requests to the appropriate handler function.
212
+ */
213
+ function createTaskSelector (
214
+ verb: string | RegExp | RouteSelector,
215
+ filterField: string,
216
+ invokeName: string
217
+ ): RouteSelector {
218
+ if (typeof verb === 'function') {
219
+ // Return the passed in selector function
220
+ return verb
221
+ } else if (verb instanceof RegExp) {
222
+ // Return a function that matches the verb using a RegExp
223
+ return (context: TurnContext) => {
224
+ const isTeams = context.activity.channelId === Channels.Msteams
225
+ const isInvoke = context?.activity?.type === ActivityTypes.Invoke && context?.activity?.name === invokeName
226
+ const data = (context?.activity?.value as any).data
227
+ if (isInvoke && isTeams && typeof data === 'object' && typeof data[filterField] === 'string') {
228
+ return Promise.resolve(verb.test(data[filterField]))
229
+ } else {
230
+ return Promise.resolve(false)
231
+ }
232
+ }
233
+ } else {
234
+ // Return a function that attempts to match verb
235
+ return (context: TurnContext) => {
236
+ const isInvoke = context?.activity?.type === ActivityTypes.Invoke && context?.activity?.name === invokeName
237
+ const data = (context?.activity?.value as any).data
238
+ return Promise.resolve(isInvoke && typeof data === 'object' && data[filterField] === verb)
239
+ }
240
+ }
241
+ }
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Copyright(c) Microsoft Corporation.All rights reserved.
3
+ * Licensed under the MIT License.
4
+ */
5
+
6
+ import { TaskModuleResponseBase } from './taskModuleResponseBase'
7
+ import { TaskModuleTaskInfo } from './taskModuleTaskInfo'
8
+
9
+ /**
10
+ * Interface representing the continue response of a task module.
11
+ */
12
+ export interface TaskModuleContinueResponse extends TaskModuleResponseBase {
13
+ /**
14
+ * The task module task information.
15
+ */
16
+ value?: TaskModuleTaskInfo
17
+ }
@@ -0,0 +1,16 @@
1
+ /**
2
+ * Copyright(c) Microsoft Corporation.All rights reserved.
3
+ * Licensed under the MIT License.
4
+ */
5
+
6
+ import { TaskModuleResponseBase } from './taskModuleResponseBase'
7
+
8
+ /**
9
+ * Interface representing the message response of a task module.
10
+ */
11
+ export interface TaskModuleMessageResponse extends TaskModuleResponseBase {
12
+ /**
13
+ * The value of the task module message response.
14
+ */
15
+ value?: string
16
+ }
@@ -0,0 +1,24 @@
1
+ /**
2
+ * Copyright(c) Microsoft Corporation.All rights reserved.
3
+ * Licensed under the MIT License.
4
+ */
5
+
6
+ import { TaskModuleRequestContext } from './taskModuleRequestContext'
7
+
8
+ /**
9
+ * Interface representing the request of a task module.
10
+ */
11
+ export interface TaskModuleRequest {
12
+ /**
13
+ * The data of the task module request.
14
+ */
15
+ data?: any
16
+ /**
17
+ * The context of the task module request.
18
+ */
19
+ context?: TaskModuleRequestContext
20
+ /**
21
+ * The tab context of the task module request.
22
+ */
23
+ tabContext?: any // TODO TabEntityContext
24
+ }
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Copyright(c) Microsoft Corporation.All rights reserved.
3
+ * Licensed under the MIT License.
4
+ */
5
+
6
+ /**
7
+ * Interface representing the context of a task module request.
8
+ */
9
+ export interface TaskModuleRequestContext {
10
+ /**
11
+ * The theme of the task module request.
12
+ */
13
+ theme?: string
14
+ }
@@ -0,0 +1,21 @@
1
+ /**
2
+ * Copyright(c) Microsoft Corporation.All rights reserved.
3
+ * Licensed under the MIT License.
4
+ */
5
+
6
+ import { TaskModuleContinueResponse } from './taskModuleContinueResponse'
7
+ import { TaskModuleMessageResponse } from './taskModuleMessageResponse'
8
+
9
+ /**
10
+ * Interface representing the response of a task module.
11
+ */
12
+ export interface TaskModuleResponse {
13
+ /**
14
+ * The task module continue or message response.
15
+ */
16
+ task?: TaskModuleContinueResponse | TaskModuleMessageResponse
17
+ /**
18
+ * The cache information.
19
+ */
20
+ cacheInfo?: any // TODO CacheInfo
21
+ }
@@ -0,0 +1,19 @@
1
+ /**
2
+ * Copyright(c) Microsoft Corporation.All rights reserved.
3
+ * Licensed under the MIT License.
4
+ */
5
+
6
+ /**
7
+ * Type representing the message preview type.
8
+ */
9
+ export type MessagePreviewType = 'message' | 'continue'
10
+
11
+ /**
12
+ * Interface representing the base response of a task module.
13
+ */
14
+ export interface TaskModuleResponseBase {
15
+ /**
16
+ * The type of the message preview.
17
+ */
18
+ type?: MessagePreviewType
19
+ }
@@ -0,0 +1,40 @@
1
+ /**
2
+ * Copyright(c) Microsoft Corporation.All rights reserved.
3
+ * Licensed under the MIT License.
4
+ */
5
+
6
+ import { Attachment } from '@microsoft/agents-activity'
7
+
8
+ /**
9
+ * Interface representing the task module task information.
10
+ */
11
+ export interface TaskModuleTaskInfo {
12
+ /**
13
+ * The title of the task module.
14
+ */
15
+ title?: string
16
+ /**
17
+ * The height of the task module.
18
+ */
19
+ height?: number | 'small' | 'medium' | 'large'
20
+ /**
21
+ * The width of the task module.
22
+ */
23
+ width?: number | 'small' | 'medium' | 'large'
24
+ /**
25
+ * The URL of the task module.
26
+ */
27
+ url?: string
28
+ /**
29
+ * The card attachment of the task module.
30
+ */
31
+ card?: Attachment
32
+ /**
33
+ * The fallback URL of the task module.
34
+ */
35
+ fallbackUrl?: string
36
+ /**
37
+ * The completion agent ID of the task module.
38
+ */
39
+ completionAgentId?: string
40
+ }