@microsoft/teams.api 2.0.6-preview.1 → 2.0.6-preview.4

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 (69) hide show
  1. package/dist/activities/activity.d.mts +15 -1
  2. package/dist/activities/activity.d.ts +15 -1
  3. package/dist/activities/activity.js +12 -1
  4. package/dist/activities/activity.js.map +1 -1
  5. package/dist/activities/activity.mjs +12 -1
  6. package/dist/activities/activity.mjs.map +1 -1
  7. package/dist/activities/index.d.mts +2 -2
  8. package/dist/activities/index.d.ts +2 -2
  9. package/dist/activities/invoke/index.d.mts +2 -2
  10. package/dist/activities/invoke/index.d.ts +2 -2
  11. package/dist/activities/invoke/message-extension/fetch-task.d.mts +2 -2
  12. package/dist/activities/invoke/message-extension/fetch-task.d.ts +2 -2
  13. package/dist/activities/invoke/message-extension/index.d.mts +2 -2
  14. package/dist/activities/invoke/message-extension/index.d.ts +2 -2
  15. package/dist/activities/invoke/message-extension/submit-action.d.mts +2 -2
  16. package/dist/activities/invoke/message-extension/submit-action.d.ts +2 -2
  17. package/dist/activities/message/index.d.mts +2 -2
  18. package/dist/activities/message/index.d.ts +2 -2
  19. package/dist/activities/message/message.d.mts +1 -1
  20. package/dist/activities/message/message.d.ts +1 -1
  21. package/dist/activities/message/message.js +5 -14
  22. package/dist/activities/message/message.js.map +1 -1
  23. package/dist/activities/message/message.mjs +5 -14
  24. package/dist/activities/message/message.mjs.map +1 -1
  25. package/dist/activities/utils/index.d.mts +2 -2
  26. package/dist/activities/utils/index.d.ts +2 -2
  27. package/dist/activities/utils/strip-mentions-text.d.mts +1 -1
  28. package/dist/activities/utils/strip-mentions-text.d.ts +1 -1
  29. package/dist/activities/utils/to-activity-params.d.mts +2 -2
  30. package/dist/activities/utils/to-activity-params.d.ts +2 -2
  31. package/dist/{activity-BXTVWTDe.d.ts → activity-C1r0B_9_.d.ts} +1 -1
  32. package/dist/{activity-DJwv7Dt6.d.mts → activity-C_Apu8i6.d.mts} +1 -1
  33. package/dist/clients/conversation/activity.d.mts +2 -2
  34. package/dist/clients/conversation/activity.d.ts +2 -2
  35. package/dist/clients/conversation/index.d.mts +2 -2
  36. package/dist/clients/conversation/index.d.ts +2 -2
  37. package/dist/clients/index.d.mts +2 -2
  38. package/dist/clients/index.d.ts +2 -2
  39. package/dist/clients/meeting.d.mts +12 -1
  40. package/dist/clients/meeting.d.ts +12 -1
  41. package/dist/clients/meeting.js +14 -3
  42. package/dist/clients/meeting.js.map +1 -1
  43. package/dist/clients/meeting.mjs +14 -3
  44. package/dist/clients/meeting.mjs.map +1 -1
  45. package/dist/index.d.mts +2 -2
  46. package/dist/index.d.ts +2 -2
  47. package/dist/{message-C7JDFGmD.d.mts → message-BfRVRgDX.d.mts} +4 -14
  48. package/dist/{message-DyL99RbG.d.ts → message-Dahma92e.d.ts} +4 -14
  49. package/dist/models/activity-like.d.mts +2 -2
  50. package/dist/models/activity-like.d.ts +2 -2
  51. package/dist/models/index.d.mts +2 -2
  52. package/dist/models/index.d.ts +2 -2
  53. package/dist/models/invoke-response.d.mts +2 -2
  54. package/dist/models/invoke-response.d.ts +2 -2
  55. package/dist/models/meeting/meeting-participant.d.mts +5 -1
  56. package/dist/models/meeting/meeting-participant.d.ts +5 -1
  57. package/dist/models/meeting/meeting.d.mts +2 -3
  58. package/dist/models/meeting/meeting.d.ts +2 -3
  59. package/dist/models/messaging-extension/index.d.mts +2 -2
  60. package/dist/models/messaging-extension/index.d.ts +2 -2
  61. package/dist/models/messaging-extension/messaging-extension-action-response.d.mts +2 -2
  62. package/dist/models/messaging-extension/messaging-extension-action-response.d.ts +2 -2
  63. package/dist/models/messaging-extension/messaging-extension-action.d.mts +2 -2
  64. package/dist/models/messaging-extension/messaging-extension-action.d.ts +2 -2
  65. package/dist/models/messaging-extension/messaging-extension-response.d.mts +2 -2
  66. package/dist/models/messaging-extension/messaging-extension-response.d.ts +2 -2
  67. package/dist/models/messaging-extension/messaging-extension-result.d.mts +2 -2
  68. package/dist/models/messaging-extension/messaging-extension-result.d.ts +2 -2
  69. package/package.json +5 -5
@@ -79,6 +79,10 @@ interface IActivity<T extends string = string> {
79
79
  * Contains the ID of the message to which this message is a reply.
80
80
  */
81
81
  replyToId?: string;
82
+ /**
83
+ * Indicates if this is a targeted message visible only to a specific recipient.
84
+ */
85
+ isTargeted: boolean;
82
86
  /**
83
87
  * Represents the entities that were mentioned in the message.
84
88
  */
@@ -163,6 +167,10 @@ declare class Activity<T extends string = string> implements IActivity<T> {
163
167
  * Contains the ID of the message to which this message is a reply.
164
168
  */
165
169
  replyToId?: string;
170
+ /**
171
+ * Indicates if this is a targeted message visible only to a specific recipient.
172
+ */
173
+ isTargeted: boolean;
166
174
  /**
167
175
  * Represents the entities that were mentioned in the message.
168
176
  */
@@ -201,7 +209,13 @@ declare class Activity<T extends string = string> implements IActivity<T> {
201
209
  withFrom(value: Account): this;
202
210
  withConversation(value: ConversationAccount): this;
203
211
  withRelatesTo(value: ConversationReference): this;
204
- withRecipient(value: Account): this;
212
+ /**
213
+ * Set the recipient of this activity, optionally marking it as a targeted message.
214
+ * @param value - The recipient account
215
+ * @param isTargeted - If true, marks this as a targeted message visible only to the recipient (default: false)
216
+ * @returns this instance for chaining
217
+ */
218
+ withRecipient(value: Account, isTargeted?: boolean): this;
205
219
  withServiceUrl(value: string): this;
206
220
  withTimestamp(value: Date): this;
207
221
  withLocale(value: string): this;
@@ -79,6 +79,10 @@ interface IActivity<T extends string = string> {
79
79
  * Contains the ID of the message to which this message is a reply.
80
80
  */
81
81
  replyToId?: string;
82
+ /**
83
+ * Indicates if this is a targeted message visible only to a specific recipient.
84
+ */
85
+ isTargeted: boolean;
82
86
  /**
83
87
  * Represents the entities that were mentioned in the message.
84
88
  */
@@ -163,6 +167,10 @@ declare class Activity<T extends string = string> implements IActivity<T> {
163
167
  * Contains the ID of the message to which this message is a reply.
164
168
  */
165
169
  replyToId?: string;
170
+ /**
171
+ * Indicates if this is a targeted message visible only to a specific recipient.
172
+ */
173
+ isTargeted: boolean;
166
174
  /**
167
175
  * Represents the entities that were mentioned in the message.
168
176
  */
@@ -201,7 +209,13 @@ declare class Activity<T extends string = string> implements IActivity<T> {
201
209
  withFrom(value: Account): this;
202
210
  withConversation(value: ConversationAccount): this;
203
211
  withRelatesTo(value: ConversationReference): this;
204
- withRecipient(value: Account): this;
212
+ /**
213
+ * Set the recipient of this activity, optionally marking it as a targeted message.
214
+ * @param value - The recipient account
215
+ * @param isTargeted - If true, marks this as a targeted message visible only to the recipient (default: false)
216
+ * @returns this instance for chaining
217
+ */
218
+ withRecipient(value: Account, isTargeted?: boolean): this;
205
219
  withServiceUrl(value: string): this;
206
220
  withTimestamp(value: Date): this;
207
221
  withLocale(value: string): this;
@@ -55,6 +55,10 @@ class Activity {
55
55
  * Contains the ID of the message to which this message is a reply.
56
56
  */
57
57
  replyToId;
58
+ /**
59
+ * Indicates if this is a targeted message visible only to a specific recipient.
60
+ */
61
+ isTargeted = false;
58
62
  /**
59
63
  * Represents the entities that were mentioned in the message.
60
64
  */
@@ -135,8 +139,15 @@ class Activity {
135
139
  this.relatesTo = value;
136
140
  return this;
137
141
  }
138
- withRecipient(value) {
142
+ /**
143
+ * Set the recipient of this activity, optionally marking it as a targeted message.
144
+ * @param value - The recipient account
145
+ * @param isTargeted - If true, marks this as a targeted message visible only to the recipient (default: false)
146
+ * @returns this instance for chaining
147
+ */
148
+ withRecipient(value, isTargeted = false) {
139
149
  this.recipient = value;
150
+ this.isTargeted = isTargeted;
140
151
  return this;
141
152
  }
142
153
  withServiceUrl(value) {
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/activities/activity.ts"],"names":[],"mappings":";;AAwHO,MAAM,QAA4D,CAAA;AAAA;AAAA;AAAA;AAAA,EAI9D,IAAA;AAAA;AAAA;AAAA;AAAA,EAKT,EAAA;AAAA;AAAA;AAAA;AAAA,EAKA,UAAA;AAAA;AAAA;AAAA;AAAA,EAKA,SAAA;AAAA;AAAA;AAAA;AAAA;AA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oBAAA;AAAA,QACZ,KAAO,EAAA;AAAA,OACT;AACA,MAAA,IAAA,CAAK,UAAU,YAAY,CAAA;AAAA;AAG7B,IAAO,OAAA,YAAA;AAAA;AAEX","file":"activity.js","sourcesContent":["import {\n Account,\n AIMessageEntity,\n ChannelData,\n ChannelID,\n ChannelInfo,\n CitationAppearance,\n CitationEntity,\n ConversationAccount,\n ConversationReference,\n Entity,\n MeetingInfo,\n MessageEntity,\n NotificationInfo,\n TeamInfo,\n} from '../models';\n\nexport interface IActivity<T extends string = string> {\n /**\n * Contains the type of the activity.\n */\n readonly type: T;\n\n /**\n * Contains an ID that uniquely identifies the activity on the channel.\n */\n id: string;\n\n /**\n * Contains the URL that specifies the channel's service endpoint. Set by the channel.\n */\n serviceUrl?: string;\n\n /**\n * Contains the date and time that the message was sent, in UTC, expressed in ISO-8601 format.\n */\n timestamp?: Date;\n\n /**\n * A locale name for the contents of the text field.\n * The locale name is a combination of an ISO 639 two- or three-letter culture code associated\n * with a language\n * and an ISO 3166 two-letter subculture code associated with a country or region.\n * The locale name can also correspond to a valid BCP-47 language tag.\n */\n locale?: string;\n\n /**\n * Contains the local date and time of the message, expressed in ISO-8601 format.\n *\n * For example, 2016-09-23T13:07:49.4714686-07:00.\n */\n localTimestamp?: Date;\n\n /**\n * Contains an ID that uniquely identifies the channel. Set by the channel.\n */\n channelId: ChannelID;\n\n /**\n * Identifies the sender of the message.\n */\n from: Account;\n\n /**\n * Identifies the conversation to which the activity belongs.\n */\n conversation: ConversationAccount;\n\n /**\n * A reference to another conversation or activity.\n */\n relatesTo?: ConversationReference;\n\n /**\n * Identifies the recipient of the message.\n */\n recipient: Account;\n\n /**\n * Contains the ID of the message to which this message is a reply.\n */\n replyToId?: string;\n\n /**\n * Represents the entities that were mentioned in the message.\n */\n entities?: Entity[];\n\n /**\n * Contains channel-specific content.\n */\n channelData?: ChannelData;\n\n /**\n * Information about the channel in which the message was sent.\n */\n get channel(): ChannelInfo | undefined;\n\n /**\n * Information about the team in which the message was sent.\n */\n get team(): TeamInfo | undefined;\n\n /**\n * Information about the tenant in which the message was sent.\n */\n get meeting(): MeetingInfo | undefined;\n\n /**\n * Notification settings for the message.\n */\n get notification(): NotificationInfo | undefined;\n\n /**\n * is this a streaming activity\n */\n isStreaming(): boolean;\n}\n\nexport class Activity<T extends string = string> implements IActivity<T> {\n /**\n * Contains the type of the activity.\n */\n readonly type!: T;\n\n /**\n * Contains an ID that uniquely identifies the activity on the channel.\n */\n id!: string;\n\n /**\n * Contains the URL that specifies the channel's service endpoint. Set by the channel.\n */\n serviceUrl?: string;\n\n /**\n * Contains the date and time that the message was sent, in UTC, expressed in ISO-8601 format.\n */\n timestamp?: Date;\n\n /**\n * A locale name for the contents of the text field.\n * The locale name is a combination of an ISO 639 two- or three-letter culture code associated\n * with a language\n * and an ISO 3166 two-letter subculture code associated with a country or region.\n * The locale name can also correspond to a valid BCP-47 language tag.\n */\n locale?: string;\n\n /**\n * Contains the local date and time of the message, expressed in ISO-8601 format.\n *\n * For example, 2016-09-23T13:07:49.4714686-07:00.\n */\n localTimestamp?: Date;\n\n /**\n * Contains an ID that uniquely identifies the channel. Set by the channel.\n */\n channelId!: ChannelID;\n\n /**\n * Identifies the sender of the message.\n */\n from!: Account;\n\n /**\n * Identifies the conversation to which the activity belongs.\n */\n conversation!: ConversationAccount;\n\n /**\n * A reference to another conversation or activity.\n */\n relatesTo?: ConversationReference;\n\n /**\n * Identifies the recipient of the message.\n */\n recipient!: Account;\n\n /**\n * Contains the ID of the message to which this message is a reply.\n */\n replyToId?: string;\n\n /**\n * Represents the entities that were mentioned in the message.\n */\n entities?: Entity[];\n\n /**\n * Contains channel-specific content.\n */\n channelData?: ChannelData;\n\n /**\n * Information about the tenant in which the message was sent.\n */\n get tenant() {\n return this.channelData?.tenant;\n }\n\n /**\n * Information about the channel in which the message was sent.\n */\n get channel() {\n return this.channelData?.channel;\n }\n\n /**\n * Information about the team in which the message was sent.\n */\n get team() {\n return this.channelData?.team;\n }\n\n /**\n * Information about the tenant in which the message was sent.\n */\n get meeting() {\n return this.channelData?.meeting;\n }\n\n /**\n * Notification settings for the message.\n */\n get notification() {\n return this.channelData?.notification;\n }\n\n constructor(value: Pick<IActivity<T>, 'type'> & Partial<Omit<IActivity<T>, 'type'>>) {\n Object.assign(this, {\n channelId: 'msteams',\n ...value,\n });\n }\n\n static from(activity: IActivity) {\n return new Activity(activity);\n }\n\n toInterface(): IActivity {\n return Object.assign({}, this);\n }\n\n clone(options: Omit<Partial<IActivity>, 'type'> = {}) {\n return new Activity({\n ...this.toInterface(),\n ...options,\n });\n }\n\n withId(value: string) {\n this.id = value;\n return this;\n }\n\n withReplyToId(value: string) {\n this.replyToId = value;\n return this;\n }\n\n withChannelId(value: ChannelID) {\n this.channelId = value;\n return this;\n }\n\n withFrom(value: Account) {\n this.from = value;\n return this;\n }\n\n withConversation(value: ConversationAccount) {\n this.conversation = value;\n return this;\n }\n\n withRelatesTo(value: ConversationReference) {\n this.relatesTo = value;\n return this;\n }\n\n withRecipient(value: Account) {\n this.recipient = value;\n return this;\n }\n\n withServiceUrl(value: string) {\n this.serviceUrl = value;\n return this;\n }\n\n withTimestamp(value: Date) {\n this.timestamp = value;\n return this;\n }\n\n withLocale(value: string) {\n this.locale = value;\n return this;\n }\n\n withLocalTimestamp(value: Date) {\n this.localTimestamp = value;\n return this;\n }\n\n withChannelData(value: ChannelData) {\n this.channelData = { ...this.channelData, ...value };\n return this;\n }\n\n /**\n * Add an entity.\n */\n addEntity(value: Entity) {\n if (!this.entities) {\n this.entities = [];\n }\n\n this.entities.push(value);\n return this;\n }\n\n /**\n * Add multiple entities\n */\n addEntities(...value: Entity[]) {\n if (!this.entities) {\n this.entities = [];\n }\n\n this.entities.push(...value);\n return this;\n }\n\n /**\n * Add the `Generated By AI` label.\n */\n addAiGenerated() {\n const messageEntity: AIMessageEntity = this.ensureSingleRootLevelMessageEntity();\n if (messageEntity.additionalType?.includes('AIGeneratedContent')) {\n return this;\n }\n\n if (!messageEntity.additionalType) {\n messageEntity.additionalType = [];\n }\n\n messageEntity.additionalType.push('AIGeneratedContent');\n return this;\n }\n\n /**\n * Enable message feedback\n */\n addFeedback() {\n if (!this.channelData) {\n this.channelData = {};\n }\n\n this.channelData.feedbackLoopEnabled = true;\n return this;\n }\n\n /**\n * Add citations\n */\n addCitation(position: number, appearance: CitationAppearance) {\n const messageEntity: CitationEntity = this.ensureSingleRootLevelMessageEntity();\n if (!messageEntity.citation) {\n messageEntity.citation = [];\n }\n\n messageEntity.citation.push({\n '@type': 'Claim',\n position,\n appearance: {\n '@type': 'DigitalDocument',\n abstract: appearance.abstract,\n name: appearance.name,\n encodingFormat: 'application/vnd.microsoft.card.adaptive',\n image: appearance.icon\n ? {\n '@type': 'ImageObject',\n name: appearance.icon,\n }\n : undefined,\n keywords: appearance.keywords,\n text: appearance.text,\n url: appearance.url,\n usageInfo: appearance.usageInfo,\n },\n });\n\n return this;\n }\n\n /**\n * is this a streaming activity\n */\n isStreaming() {\n return this.entities?.some((e) => e.type === 'streaminfo') || false;\n }\n\n /**\n * Get or create the base message entity.\n * There should only be one root level message entity.\n */\n private ensureSingleRootLevelMessageEntity(): MessageEntity {\n let mesageEntity = this.entities?.find(\n (e) => e.type === 'https://schema.org/Message' && e['@type'] === 'Message'\n ) as MessageEntity | undefined;\n\n if (!mesageEntity) {\n mesageEntity = {\n type: 'https://schema.org/Message',\n '@type': 'Message',\n '@context': 'https://schema.org',\n '@id': '',\n };\n this.addEntity(mesageEntity);\n }\n\n return mesageEntity;\n }\n}\n"]}
1
+ {"version":3,"sources":["../../src/activities/activity.ts"],"names":[],"mappings":";;AA6HO,MAAM,QAA4D,CAAA;AAAA;AAAA;AAAA;AAAA,EAI9D,IAAA;AAAA;AAAA;AAAA;AAAA,EAKT,EAAA;AAAA;AAAA;AAAA;AAAA,EAKA,UAAA;AAAA;AAAA;AAAA;AAAA,EAKA,SAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EASA,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A,IAAI,CAAC,YAAc,EAAA;AACjB,MAAe,YAAA,GAAA;AAAA,QACb,IAAM,EAAA,4BAAA;AAAA,QACN,OAAS,EAAA,SAAA;AAAA,QACT,UAAY,EAAA,oBAAA;AAAA,QACZ,KAAO,EAAA;AAAA,OACT;AACA,MAAA,IAAA,CAAK,UAAU,YAAY,CAAA;AAAA;AAG7B,IAAO,OAAA,YAAA;AAAA;AAEX","file":"activity.js","sourcesContent":["import {\n Account,\n AIMessageEntity,\n ChannelData,\n ChannelID,\n ChannelInfo,\n CitationAppearance,\n CitationEntity,\n ConversationAccount,\n ConversationReference,\n Entity,\n MeetingInfo,\n MessageEntity,\n NotificationInfo,\n TeamInfo,\n} from '../models';\n\nexport interface IActivity<T extends string = string> {\n /**\n * Contains the type of the activity.\n */\n readonly type: T;\n\n /**\n * Contains an ID that uniquely identifies the activity on the channel.\n */\n id: string;\n\n /**\n * Contains the URL that specifies the channel's service endpoint. Set by the channel.\n */\n serviceUrl?: string;\n\n /**\n * Contains the date and time that the message was sent, in UTC, expressed in ISO-8601 format.\n */\n timestamp?: Date;\n\n /**\n * A locale name for the contents of the text field.\n * The locale name is a combination of an ISO 639 two- or three-letter culture code associated\n * with a language\n * and an ISO 3166 two-letter subculture code associated with a country or region.\n * The locale name can also correspond to a valid BCP-47 language tag.\n */\n locale?: string;\n\n /**\n * Contains the local date and time of the message, expressed in ISO-8601 format.\n *\n * For example, 2016-09-23T13:07:49.4714686-07:00.\n */\n localTimestamp?: Date;\n\n /**\n * Contains an ID that uniquely identifies the channel. Set by the channel.\n */\n channelId: ChannelID;\n\n /**\n * Identifies the sender of the message.\n */\n from: Account;\n\n /**\n * Identifies the conversation to which the activity belongs.\n */\n conversation: ConversationAccount;\n\n /**\n * A reference to another conversation or activity.\n */\n relatesTo?: ConversationReference;\n\n /**\n * Identifies the recipient of the message.\n */\n recipient: Account;\n\n /**\n * Contains the ID of the message to which this message is a reply.\n */\n replyToId?: string;\n\n /**\n * Indicates if this is a targeted message visible only to a specific recipient.\n */\n isTargeted: boolean;\n\n /**\n * Represents the entities that were mentioned in the message.\n */\n entities?: Entity[];\n\n /**\n * Contains channel-specific content.\n */\n channelData?: ChannelData;\n\n /**\n * Information about the channel in which the message was sent.\n */\n get channel(): ChannelInfo | undefined;\n\n /**\n * Information about the team in which the message was sent.\n */\n get team(): TeamInfo | undefined;\n\n /**\n * Information about the tenant in which the message was sent.\n */\n get meeting(): MeetingInfo | undefined;\n\n /**\n * Notification settings for the message.\n */\n get notification(): NotificationInfo | undefined;\n\n /**\n * is this a streaming activity\n */\n isStreaming(): boolean;\n}\n\nexport class Activity<T extends string = string> implements IActivity<T> {\n /**\n * Contains the type of the activity.\n */\n readonly type!: T;\n\n /**\n * Contains an ID that uniquely identifies the activity on the channel.\n */\n id!: string;\n\n /**\n * Contains the URL that specifies the channel's service endpoint. Set by the channel.\n */\n serviceUrl?: string;\n\n /**\n * Contains the date and time that the message was sent, in UTC, expressed in ISO-8601 format.\n */\n timestamp?: Date;\n\n /**\n * A locale name for the contents of the text field.\n * The locale name is a combination of an ISO 639 two- or three-letter culture code associated\n * with a language\n * and an ISO 3166 two-letter subculture code associated with a country or region.\n * The locale name can also correspond to a valid BCP-47 language tag.\n */\n locale?: string;\n\n /**\n * Contains the local date and time of the message, expressed in ISO-8601 format.\n *\n * For example, 2016-09-23T13:07:49.4714686-07:00.\n */\n localTimestamp?: Date;\n\n /**\n * Contains an ID that uniquely identifies the channel. Set by the channel.\n */\n channelId!: ChannelID;\n\n /**\n * Identifies the sender of the message.\n */\n from!: Account;\n\n /**\n * Identifies the conversation to which the activity belongs.\n */\n conversation!: ConversationAccount;\n\n /**\n * A reference to another conversation or activity.\n */\n relatesTo?: ConversationReference;\n\n /**\n * Identifies the recipient of the message.\n */\n recipient!: Account;\n\n /**\n * Contains the ID of the message to which this message is a reply.\n */\n replyToId?: string;\n\n /**\n * Indicates if this is a targeted message visible only to a specific recipient.\n */\n isTargeted: boolean = false;\n\n /**\n * Represents the entities that were mentioned in the message.\n */\n entities?: Entity[];\n\n /**\n * Contains channel-specific content.\n */\n channelData?: ChannelData;\n\n /**\n * Information about the tenant in which the message was sent.\n */\n get tenant() {\n return this.channelData?.tenant;\n }\n\n /**\n * Information about the channel in which the message was sent.\n */\n get channel() {\n return this.channelData?.channel;\n }\n\n /**\n * Information about the team in which the message was sent.\n */\n get team() {\n return this.channelData?.team;\n }\n\n /**\n * Information about the tenant in which the message was sent.\n */\n get meeting() {\n return this.channelData?.meeting;\n }\n\n /**\n * Notification settings for the message.\n */\n get notification() {\n return this.channelData?.notification;\n }\n\n constructor(value: Pick<IActivity<T>, 'type'> & Partial<Omit<IActivity<T>, 'type'>>) {\n Object.assign(this, {\n channelId: 'msteams',\n ...value,\n });\n }\n\n static from(activity: IActivity) {\n return new Activity(activity);\n }\n\n toInterface(): IActivity {\n return Object.assign({}, this);\n }\n\n clone(options: Omit<Partial<IActivity>, 'type'> = {}) {\n return new Activity({\n ...this.toInterface(),\n ...options,\n });\n }\n\n withId(value: string) {\n this.id = value;\n return this;\n }\n\n withReplyToId(value: string) {\n this.replyToId = value;\n return this;\n }\n\n withChannelId(value: ChannelID) {\n this.channelId = value;\n return this;\n }\n\n withFrom(value: Account) {\n this.from = value;\n return this;\n }\n\n withConversation(value: ConversationAccount) {\n this.conversation = value;\n return this;\n }\n\n withRelatesTo(value: ConversationReference) {\n this.relatesTo = value;\n return this;\n }\n\n /**\n * Set the recipient of this activity, optionally marking it as a targeted message.\n * @param value - The recipient account\n * @param isTargeted - If true, marks this as a targeted message visible only to the recipient (default: false)\n * @returns this instance for chaining\n */\n withRecipient(value: Account, isTargeted: boolean = false) {\n this.recipient = value;\n this.isTargeted = isTargeted;\n return this;\n }\n\n withServiceUrl(value: string) {\n this.serviceUrl = value;\n return this;\n }\n\n withTimestamp(value: Date) {\n this.timestamp = value;\n return this;\n }\n\n withLocale(value: string) {\n this.locale = value;\n return this;\n }\n\n withLocalTimestamp(value: Date) {\n this.localTimestamp = value;\n return this;\n }\n\n withChannelData(value: ChannelData) {\n this.channelData = { ...this.channelData, ...value };\n return this;\n }\n\n /**\n * Add an entity.\n */\n addEntity(value: Entity) {\n if (!this.entities) {\n this.entities = [];\n }\n\n this.entities.push(value);\n return this;\n }\n\n /**\n * Add multiple entities\n */\n addEntities(...value: Entity[]) {\n if (!this.entities) {\n this.entities = [];\n }\n\n this.entities.push(...value);\n return this;\n }\n\n /**\n * Add the `Generated By AI` label.\n */\n addAiGenerated() {\n const messageEntity: AIMessageEntity = this.ensureSingleRootLevelMessageEntity();\n if (messageEntity.additionalType?.includes('AIGeneratedContent')) {\n return this;\n }\n\n if (!messageEntity.additionalType) {\n messageEntity.additionalType = [];\n }\n\n messageEntity.additionalType.push('AIGeneratedContent');\n return this;\n }\n\n /**\n * Enable message feedback\n */\n addFeedback() {\n if (!this.channelData) {\n this.channelData = {};\n }\n\n this.channelData.feedbackLoopEnabled = true;\n return this;\n }\n\n /**\n * Add citations\n */\n addCitation(position: number, appearance: CitationAppearance) {\n const messageEntity: CitationEntity = this.ensureSingleRootLevelMessageEntity();\n if (!messageEntity.citation) {\n messageEntity.citation = [];\n }\n\n messageEntity.citation.push({\n '@type': 'Claim',\n position,\n appearance: {\n '@type': 'DigitalDocument',\n abstract: appearance.abstract,\n name: appearance.name,\n encodingFormat: 'application/vnd.microsoft.card.adaptive',\n image: appearance.icon\n ? {\n '@type': 'ImageObject',\n name: appearance.icon,\n }\n : undefined,\n keywords: appearance.keywords,\n text: appearance.text,\n url: appearance.url,\n usageInfo: appearance.usageInfo,\n },\n });\n\n return this;\n }\n\n /**\n * is this a streaming activity\n */\n isStreaming() {\n return this.entities?.some((e) => e.type === 'streaminfo') || false;\n }\n\n /**\n * Get or create the base message entity.\n * There should only be one root level message entity.\n */\n private ensureSingleRootLevelMessageEntity(): MessageEntity {\n let mesageEntity = this.entities?.find(\n (e) => e.type === 'https://schema.org/Message' && e['@type'] === 'Message'\n ) as MessageEntity | undefined;\n\n if (!mesageEntity) {\n mesageEntity = {\n type: 'https://schema.org/Message',\n '@type': 'Message',\n '@context': 'https://schema.org',\n '@id': '',\n };\n this.addEntity(mesageEntity);\n }\n\n return mesageEntity;\n }\n}\n"]}
@@ -53,6 +53,10 @@ class Activity {
53
53
  * Contains the ID of the message to which this message is a reply.
54
54
  */
55
55
  replyToId;
56
+ /**
57
+ * Indicates if this is a targeted message visible only to a specific recipient.
58
+ */
59
+ isTargeted = false;
56
60
  /**
57
61
  * Represents the entities that were mentioned in the message.
58
62
  */
@@ -133,8 +137,15 @@ class Activity {
133
137
  this.relatesTo = value;
134
138
  return this;
135
139
  }
136
- withRecipient(value) {
140
+ /**
141
+ * Set the recipient of this activity, optionally marking it as a targeted message.
142
+ * @param value - The recipient account
143
+ * @param isTargeted - If true, marks this as a targeted message visible only to the recipient (default: false)
144
+ * @returns this instance for chaining
145
+ */
146
+ withRecipient(value, isTargeted = false) {
137
147
  this.recipient = value;
148
+ this.isTargeted = isTargeted;
138
149
  return this;
139
150
  }
140
151
  withServiceUrl(value) {
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/activities/activity.ts"],"names":[],"mappings":"AAwHO,MAAM,QAA4D,CAAA;AAAA;AAAA;AAAA;AAAA,EAI9D,IAAA;AAAA;AAAA;AAAA;AAAA,EAKT,EAAA;AAAA;AAAA;AAAA;AAAA,EAKA,UAAA;AAAA;AAAA;AAAA;AAAA,EAKA,SAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EASA,MAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOA,cAAA;AAAA;AAAA;AAAA;AAAA,EAKA,SAAA;AAAA;AAAA;AAAA;AAAA,EAKA,IAAA;AAAA;AAAA;AAAA;AAAA,EAKA,YAAA;AAAA;AAAA;AAAA;AAAA,EAKA,SAAA;AAAA;AAAA;AAAA;AAAA,EAKA,SAAA;AAAA;AAAA;AAAA;AAAA,EAKA,SAAA;AAAA;AAAA;AAAA;AAAA,EAKA,QAAA;AAAA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A;AAAA,QACrB,MAAM,UAAW,CAAA,IAAA;AAAA,QACjB,cAAgB,EAAA,yCAAA;AAAA,QAChB,KAAA,EAAO,WAAW,IACd,GAAA;AAAA,UACE,OAAS,EAAA,aAAA;AAAA,UACT,MAAM,UAAW,CAAA;AAAA,SAEnB,GAAA,MAAA;AAAA,QACJ,UAAU,UAAW,CAAA,QAAA;AAAA,QACrB,MAAM,UAAW,CAAA,IAAA;AAAA,QACjB,KAAK,UAAW,CAAA,GAAA;AAAA,QAChB,WAAW,UAAW,CAAA;AAAA;AACxB,KACD,CAAA;AAED,IAAO,OAAA,IAAA;AAAA;AACT;AAAA;AAAA;AAAA,EAKA,WAAc,GAAA;AACZ,IAAO,OAAA,IAAA,CAAK,UAAU,IAAK,CAAA,CAAC,MAAM,CAAE,CAAA,IAAA,KAAS,YAAY,CAAK,IAAA,KAAA;AAAA;AAChE;AAAA;AAAA;AAAA;AAAA,EAMQ,kCAAoD,GAAA;AAC1D,IAAI,IAAA,YAAA,GAAe,KAAK,QAAU,EAAA,IAAA;AAAA,MAChC,CAAC,CAAM,KAAA,CAAA,CAAE,SAAS,4BAAgC,IAAA,CAAA,CAAE,OAAO,CAAM,KAAA;AAAA,KACnE;AAEA,IAAA,IAAI,CAAC,YAAc,EAAA;AACjB,MAAe,YAAA,GAAA;AAAA,QACb,IAAM,EAAA,4BAAA;AAAA,QACN,OAAS,EAAA,SAAA;AAAA,QACT,UAAY,EAAA,oBAAA;AAAA,QACZ,KAAO,EAAA;AAAA,OACT;AACA,MAAA,IAAA,CAAK,UAAU,YAAY,CAAA;AAAA;AAG7B,IAAO,OAAA,YAAA;AAAA;AAEX","file":"activity.mjs","sourcesContent":["import {\n Account,\n AIMessageEntity,\n ChannelData,\n ChannelID,\n ChannelInfo,\n CitationAppearance,\n CitationEntity,\n ConversationAccount,\n ConversationReference,\n Entity,\n MeetingInfo,\n MessageEntity,\n NotificationInfo,\n TeamInfo,\n} from '../models';\n\nexport interface IActivity<T extends string = string> {\n /**\n * Contains the type of the activity.\n */\n readonly type: T;\n\n /**\n * Contains an ID that uniquely identifies the activity on the channel.\n */\n id: string;\n\n /**\n * Contains the URL that specifies the channel's service endpoint. Set by the channel.\n */\n serviceUrl?: string;\n\n /**\n * Contains the date and time that the message was sent, in UTC, expressed in ISO-8601 format.\n */\n timestamp?: Date;\n\n /**\n * A locale name for the contents of the text field.\n * The locale name is a combination of an ISO 639 two- or three-letter culture code associated\n * with a language\n * and an ISO 3166 two-letter subculture code associated with a country or region.\n * The locale name can also correspond to a valid BCP-47 language tag.\n */\n locale?: string;\n\n /**\n * Contains the local date and time of the message, expressed in ISO-8601 format.\n *\n * For example, 2016-09-23T13:07:49.4714686-07:00.\n */\n localTimestamp?: Date;\n\n /**\n * Contains an ID that uniquely identifies the channel. Set by the channel.\n */\n channelId: ChannelID;\n\n /**\n * Identifies the sender of the message.\n */\n from: Account;\n\n /**\n * Identifies the conversation to which the activity belongs.\n */\n conversation: ConversationAccount;\n\n /**\n * A reference to another conversation or activity.\n */\n relatesTo?: ConversationReference;\n\n /**\n * Identifies the recipient of the message.\n */\n recipient: Account;\n\n /**\n * Contains the ID of the message to which this message is a reply.\n */\n replyToId?: string;\n\n /**\n * Represents the entities that were mentioned in the message.\n */\n entities?: Entity[];\n\n /**\n * Contains channel-specific content.\n */\n channelData?: ChannelData;\n\n /**\n * Information about the channel in which the message was sent.\n */\n get channel(): ChannelInfo | undefined;\n\n /**\n * Information about the team in which the message was sent.\n */\n get team(): TeamInfo | undefined;\n\n /**\n * Information about the tenant in which the message was sent.\n */\n get meeting(): MeetingInfo | undefined;\n\n /**\n * Notification settings for the message.\n */\n get notification(): NotificationInfo | undefined;\n\n /**\n * is this a streaming activity\n */\n isStreaming(): boolean;\n}\n\nexport class Activity<T extends string = string> implements IActivity<T> {\n /**\n * Contains the type of the activity.\n */\n readonly type!: T;\n\n /**\n * Contains an ID that uniquely identifies the activity on the channel.\n */\n id!: string;\n\n /**\n * Contains the URL that specifies the channel's service endpoint. Set by the channel.\n */\n serviceUrl?: string;\n\n /**\n * Contains the date and time that the message was sent, in UTC, expressed in ISO-8601 format.\n */\n timestamp?: Date;\n\n /**\n * A locale name for the contents of the text field.\n * The locale name is a combination of an ISO 639 two- or three-letter culture code associated\n * with a language\n * and an ISO 3166 two-letter subculture code associated with a country or region.\n * The locale name can also correspond to a valid BCP-47 language tag.\n */\n locale?: string;\n\n /**\n * Contains the local date and time of the message, expressed in ISO-8601 format.\n *\n * For example, 2016-09-23T13:07:49.4714686-07:00.\n */\n localTimestamp?: Date;\n\n /**\n * Contains an ID that uniquely identifies the channel. Set by the channel.\n */\n channelId!: ChannelID;\n\n /**\n * Identifies the sender of the message.\n */\n from!: Account;\n\n /**\n * Identifies the conversation to which the activity belongs.\n */\n conversation!: ConversationAccount;\n\n /**\n * A reference to another conversation or activity.\n */\n relatesTo?: ConversationReference;\n\n /**\n * Identifies the recipient of the message.\n */\n recipient!: Account;\n\n /**\n * Contains the ID of the message to which this message is a reply.\n */\n replyToId?: string;\n\n /**\n * Represents the entities that were mentioned in the message.\n */\n entities?: Entity[];\n\n /**\n * Contains channel-specific content.\n */\n channelData?: ChannelData;\n\n /**\n * Information about the tenant in which the message was sent.\n */\n get tenant() {\n return this.channelData?.tenant;\n }\n\n /**\n * Information about the channel in which the message was sent.\n */\n get channel() {\n return this.channelData?.channel;\n }\n\n /**\n * Information about the team in which the message was sent.\n */\n get team() {\n return this.channelData?.team;\n }\n\n /**\n * Information about the tenant in which the message was sent.\n */\n get meeting() {\n return this.channelData?.meeting;\n }\n\n /**\n * Notification settings for the message.\n */\n get notification() {\n return this.channelData?.notification;\n }\n\n constructor(value: Pick<IActivity<T>, 'type'> & Partial<Omit<IActivity<T>, 'type'>>) {\n Object.assign(this, {\n channelId: 'msteams',\n ...value,\n });\n }\n\n static from(activity: IActivity) {\n return new Activity(activity);\n }\n\n toInterface(): IActivity {\n return Object.assign({}, this);\n }\n\n clone(options: Omit<Partial<IActivity>, 'type'> = {}) {\n return new Activity({\n ...this.toInterface(),\n ...options,\n });\n }\n\n withId(value: string) {\n this.id = value;\n return this;\n }\n\n withReplyToId(value: string) {\n this.replyToId = value;\n return this;\n }\n\n withChannelId(value: ChannelID) {\n this.channelId = value;\n return this;\n }\n\n withFrom(value: Account) {\n this.from = value;\n return this;\n }\n\n withConversation(value: ConversationAccount) {\n this.conversation = value;\n return this;\n }\n\n withRelatesTo(value: ConversationReference) {\n this.relatesTo = value;\n return this;\n }\n\n withRecipient(value: Account) {\n this.recipient = value;\n return this;\n }\n\n withServiceUrl(value: string) {\n this.serviceUrl = value;\n return this;\n }\n\n withTimestamp(value: Date) {\n this.timestamp = value;\n return this;\n }\n\n withLocale(value: string) {\n this.locale = value;\n return this;\n }\n\n withLocalTimestamp(value: Date) {\n this.localTimestamp = value;\n return this;\n }\n\n withChannelData(value: ChannelData) {\n this.channelData = { ...this.channelData, ...value };\n return this;\n }\n\n /**\n * Add an entity.\n */\n addEntity(value: Entity) {\n if (!this.entities) {\n this.entities = [];\n }\n\n this.entities.push(value);\n return this;\n }\n\n /**\n * Add multiple entities\n */\n addEntities(...value: Entity[]) {\n if (!this.entities) {\n this.entities = [];\n }\n\n this.entities.push(...value);\n return this;\n }\n\n /**\n * Add the `Generated By AI` label.\n */\n addAiGenerated() {\n const messageEntity: AIMessageEntity = this.ensureSingleRootLevelMessageEntity();\n if (messageEntity.additionalType?.includes('AIGeneratedContent')) {\n return this;\n }\n\n if (!messageEntity.additionalType) {\n messageEntity.additionalType = [];\n }\n\n messageEntity.additionalType.push('AIGeneratedContent');\n return this;\n }\n\n /**\n * Enable message feedback\n */\n addFeedback() {\n if (!this.channelData) {\n this.channelData = {};\n }\n\n this.channelData.feedbackLoopEnabled = true;\n return this;\n }\n\n /**\n * Add citations\n */\n addCitation(position: number, appearance: CitationAppearance) {\n const messageEntity: CitationEntity = this.ensureSingleRootLevelMessageEntity();\n if (!messageEntity.citation) {\n messageEntity.citation = [];\n }\n\n messageEntity.citation.push({\n '@type': 'Claim',\n position,\n appearance: {\n '@type': 'DigitalDocument',\n abstract: appearance.abstract,\n name: appearance.name,\n encodingFormat: 'application/vnd.microsoft.card.adaptive',\n image: appearance.icon\n ? {\n '@type': 'ImageObject',\n name: appearance.icon,\n }\n : undefined,\n keywords: appearance.keywords,\n text: appearance.text,\n url: appearance.url,\n usageInfo: appearance.usageInfo,\n },\n });\n\n return this;\n }\n\n /**\n * is this a streaming activity\n */\n isStreaming() {\n return this.entities?.some((e) => e.type === 'streaminfo') || false;\n }\n\n /**\n * Get or create the base message entity.\n * There should only be one root level message entity.\n */\n private ensureSingleRootLevelMessageEntity(): MessageEntity {\n let mesageEntity = this.entities?.find(\n (e) => e.type === 'https://schema.org/Message' && e['@type'] === 'Message'\n ) as MessageEntity | undefined;\n\n if (!mesageEntity) {\n mesageEntity = {\n type: 'https://schema.org/Message',\n '@type': 'Message',\n '@context': 'https://schema.org',\n '@id': '',\n };\n this.addEntity(mesageEntity);\n }\n\n return mesageEntity;\n }\n}\n"]}
1
+ {"version":3,"sources":["../../src/activities/activity.ts"],"names":[],"mappings":"AA6HO,MAAM,QAA4D,CAAA;AAAA;AAAA;AAAA;AAAA,EAI9D,IAAA;AAAA;AAAA;AAAA;AAAA,EAKT,EAAA;AAAA;AAAA;AAAA;AAAA,EAKA,UAAA;AAAA;AAAA;AAAA;AAAA,EAKA,SAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EASA,MAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOA,cAAA;AAAA;AAAA;AAAA;AAAA,EAKA,SAAA;AAAA;AAAA;AAAA;AAAA,EAKA,IAAA;AAAA;AAAA;AAAA;AAAA,EAKA,YAAA;AAAA;AAAA;AAAA;AAAA,EAKA,SAAA;AAAA;AAAA;AAAA;AAAA,EAKA,SAAA;AAAA;AAAA;AAAA;AAAA,EAKA,SAAA;AAAA;AAAA;AAAA;AAAA,EAKA,UAAsB,GAAA,KAAA;AAAA;AAAA;AAAA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itationAppearance,\n CitationEntity,\n ConversationAccount,\n ConversationReference,\n Entity,\n MeetingInfo,\n MessageEntity,\n NotificationInfo,\n TeamInfo,\n} from '../models';\n\nexport interface IActivity<T extends string = string> {\n /**\n * Contains the type of the activity.\n */\n readonly type: T;\n\n /**\n * Contains an ID that uniquely identifies the activity on the channel.\n */\n id: string;\n\n /**\n * Contains the URL that specifies the channel's service endpoint. Set by the channel.\n */\n serviceUrl?: string;\n\n /**\n * Contains the date and time that the message was sent, in UTC, expressed in ISO-8601 format.\n */\n timestamp?: Date;\n\n /**\n * A locale name for the contents of the text field.\n * The locale name is a combination of an ISO 639 two- or three-letter culture code associated\n * with a language\n * and an ISO 3166 two-letter subculture code associated with a country or region.\n * The locale name can also correspond to a valid BCP-47 language tag.\n */\n locale?: string;\n\n /**\n * Contains the local date and time of the message, expressed in ISO-8601 format.\n *\n * For example, 2016-09-23T13:07:49.4714686-07:00.\n */\n localTimestamp?: Date;\n\n /**\n * Contains an ID that uniquely identifies the channel. Set by the channel.\n */\n channelId: ChannelID;\n\n /**\n * Identifies the sender of the message.\n */\n from: Account;\n\n /**\n * Identifies the conversation to which the activity belongs.\n */\n conversation: ConversationAccount;\n\n /**\n * A reference to another conversation or activity.\n */\n relatesTo?: ConversationReference;\n\n /**\n * Identifies the recipient of the message.\n */\n recipient: Account;\n\n /**\n * Contains the ID of the message to which this message is a reply.\n */\n replyToId?: string;\n\n /**\n * Indicates if this is a targeted message visible only to a specific recipient.\n */\n isTargeted: boolean;\n\n /**\n * Represents the entities that were mentioned in the message.\n */\n entities?: Entity[];\n\n /**\n * Contains channel-specific content.\n */\n channelData?: ChannelData;\n\n /**\n * Information about the channel in which the message was sent.\n */\n get channel(): ChannelInfo | undefined;\n\n /**\n * Information about the team in which the message was sent.\n */\n get team(): TeamInfo | undefined;\n\n /**\n * Information about the tenant in which the message was sent.\n */\n get meeting(): MeetingInfo | undefined;\n\n /**\n * Notification settings for the message.\n */\n get notification(): NotificationInfo | undefined;\n\n /**\n * is this a streaming activity\n */\n isStreaming(): boolean;\n}\n\nexport class Activity<T extends string = string> implements IActivity<T> {\n /**\n * Contains the type of the activity.\n */\n readonly type!: T;\n\n /**\n * Contains an ID that uniquely identifies the activity on the channel.\n */\n id!: string;\n\n /**\n * Contains the URL that specifies the channel's service endpoint. Set by the channel.\n */\n serviceUrl?: string;\n\n /**\n * Contains the date and time that the message was sent, in UTC, expressed in ISO-8601 format.\n */\n timestamp?: Date;\n\n /**\n * A locale name for the contents of the text field.\n * The locale name is a combination of an ISO 639 two- or three-letter culture code associated\n * with a language\n * and an ISO 3166 two-letter subculture code associated with a country or region.\n * The locale name can also correspond to a valid BCP-47 language tag.\n */\n locale?: string;\n\n /**\n * Contains the local date and time of the message, expressed in ISO-8601 format.\n *\n * For example, 2016-09-23T13:07:49.4714686-07:00.\n */\n localTimestamp?: Date;\n\n /**\n * Contains an ID that uniquely identifies the channel. Set by the channel.\n */\n channelId!: ChannelID;\n\n /**\n * Identifies the sender of the message.\n */\n from!: Account;\n\n /**\n * Identifies the conversation to which the activity belongs.\n */\n conversation!: ConversationAccount;\n\n /**\n * A reference to another conversation or activity.\n */\n relatesTo?: ConversationReference;\n\n /**\n * Identifies the recipient of the message.\n */\n recipient!: Account;\n\n /**\n * Contains the ID of the message to which this message is a reply.\n */\n replyToId?: string;\n\n /**\n * Indicates if this is a targeted message visible only to a specific recipient.\n */\n isTargeted: boolean = false;\n\n /**\n * Represents the entities that were mentioned in the message.\n */\n entities?: Entity[];\n\n /**\n * Contains channel-specific content.\n */\n channelData?: ChannelData;\n\n /**\n * Information about the tenant in which the message was sent.\n */\n get tenant() {\n return this.channelData?.tenant;\n }\n\n /**\n * Information about the channel in which the message was sent.\n */\n get channel() {\n return this.channelData?.channel;\n }\n\n /**\n * Information about the team in which the message was sent.\n */\n get team() {\n return this.channelData?.team;\n }\n\n /**\n * Information about the tenant in which the message was sent.\n */\n get meeting() {\n return this.channelData?.meeting;\n }\n\n /**\n * Notification settings for the message.\n */\n get notification() {\n return this.channelData?.notification;\n }\n\n constructor(value: Pick<IActivity<T>, 'type'> & Partial<Omit<IActivity<T>, 'type'>>) {\n Object.assign(this, {\n channelId: 'msteams',\n ...value,\n });\n }\n\n static from(activity: IActivity) {\n return new Activity(activity);\n }\n\n toInterface(): IActivity {\n return Object.assign({}, this);\n }\n\n clone(options: Omit<Partial<IActivity>, 'type'> = {}) {\n return new Activity({\n ...this.toInterface(),\n ...options,\n });\n }\n\n withId(value: string) {\n this.id = value;\n return this;\n }\n\n withReplyToId(value: string) {\n this.replyToId = value;\n return this;\n }\n\n withChannelId(value: ChannelID) {\n this.channelId = value;\n return this;\n }\n\n withFrom(value: Account) {\n this.from = value;\n return this;\n }\n\n withConversation(value: ConversationAccount) {\n this.conversation = value;\n return this;\n }\n\n withRelatesTo(value: ConversationReference) {\n this.relatesTo = value;\n return this;\n }\n\n /**\n * Set the recipient of this activity, optionally marking it as a targeted message.\n * @param value - The recipient account\n * @param isTargeted - If true, marks this as a targeted message visible only to the recipient (default: false)\n * @returns this instance for chaining\n */\n withRecipient(value: Account, isTargeted: boolean = false) {\n this.recipient = value;\n this.isTargeted = isTargeted;\n return this;\n }\n\n withServiceUrl(value: string) {\n this.serviceUrl = value;\n return this;\n }\n\n withTimestamp(value: Date) {\n this.timestamp = value;\n return this;\n }\n\n withLocale(value: string) {\n this.locale = value;\n return this;\n }\n\n withLocalTimestamp(value: Date) {\n this.localTimestamp = value;\n return this;\n }\n\n withChannelData(value: ChannelData) {\n this.channelData = { ...this.channelData, ...value };\n return this;\n }\n\n /**\n * Add an entity.\n */\n addEntity(value: Entity) {\n if (!this.entities) {\n this.entities = [];\n }\n\n this.entities.push(value);\n return this;\n }\n\n /**\n * Add multiple entities\n */\n addEntities(...value: Entity[]) {\n if (!this.entities) {\n this.entities = [];\n }\n\n this.entities.push(...value);\n return this;\n }\n\n /**\n * Add the `Generated By AI` label.\n */\n addAiGenerated() {\n const messageEntity: AIMessageEntity = this.ensureSingleRootLevelMessageEntity();\n if (messageEntity.additionalType?.includes('AIGeneratedContent')) {\n return this;\n }\n\n if (!messageEntity.additionalType) {\n messageEntity.additionalType = [];\n }\n\n messageEntity.additionalType.push('AIGeneratedContent');\n return this;\n }\n\n /**\n * Enable message feedback\n */\n addFeedback() {\n if (!this.channelData) {\n this.channelData = {};\n }\n\n this.channelData.feedbackLoopEnabled = true;\n return this;\n }\n\n /**\n * Add citations\n */\n addCitation(position: number, appearance: CitationAppearance) {\n const messageEntity: CitationEntity = this.ensureSingleRootLevelMessageEntity();\n if (!messageEntity.citation) {\n messageEntity.citation = [];\n }\n\n messageEntity.citation.push({\n '@type': 'Claim',\n position,\n appearance: {\n '@type': 'DigitalDocument',\n abstract: appearance.abstract,\n name: appearance.name,\n encodingFormat: 'application/vnd.microsoft.card.adaptive',\n image: appearance.icon\n ? {\n '@type': 'ImageObject',\n name: appearance.icon,\n }\n : undefined,\n keywords: appearance.keywords,\n text: appearance.text,\n url: appearance.url,\n usageInfo: appearance.usageInfo,\n },\n });\n\n return this;\n }\n\n /**\n * is this a streaming activity\n */\n isStreaming() {\n return this.entities?.some((e) => e.type === 'streaminfo') || false;\n }\n\n /**\n * Get or create the base message entity.\n * There should only be one root level message entity.\n */\n private ensureSingleRootLevelMessageEntity(): MessageEntity {\n let mesageEntity = this.entities?.find(\n (e) => e.type === 'https://schema.org/Message' && e['@type'] === 'Message'\n ) as MessageEntity | undefined;\n\n if (!mesageEntity) {\n mesageEntity = {\n type: 'https://schema.org/Message',\n '@type': 'Message',\n '@context': 'https://schema.org',\n '@id': '',\n };\n this.addEntity(mesageEntity);\n }\n\n return mesageEntity;\n }\n}\n"]}
@@ -3,11 +3,11 @@ export { ConversationActivity } from './conversation/index.mjs';
3
3
  export { EventActivity } from './event/index.mjs';
4
4
  export { IHandoffActivity } from './handoff.mjs';
5
5
  export { InstallUpdateActivity } from './install-update/index.mjs';
6
- export { b as Activity, d as IMessageExtensionFetchTaskInvokeActivity, e as IMessageExtensionSubmitActionInvokeActivity, I as InvokeActivity, c as MessageExtensionInvokeActivity, t as toActivityParams } from '../activity-DJwv7Dt6.mjs';
6
+ export { b as Activity, d as IMessageExtensionFetchTaskInvokeActivity, e as IMessageExtensionSubmitActionInvokeActivity, I as InvokeActivity, c as MessageExtensionInvokeActivity, t as toActivityParams } from '../activity-C_Apu8i6.mjs';
7
7
  export { $MessageActivity } from './message/index.mjs';
8
8
  export { ITraceActivity } from './trace.mjs';
9
9
  export { ITypingActivity, TypingActivity } from './typing.mjs';
10
- export { A as AddMentionOptions, I as IMessageActivity, M as MessageActivity, S as StripMentionsTextOptions, s as stripMentionsText } from '../message-C7JDFGmD.mjs';
10
+ export { A as AddMentionOptions, I as IMessageActivity, M as MessageActivity, S as StripMentionsTextOptions, s as stripMentionsText } from '../message-BfRVRgDX.mjs';
11
11
  export { Activity as $Activity, IActivity } from './activity.mjs';
12
12
  export { IMessageDeleteActivity, MessageDeleteActivity } from './message/message-delete.mjs';
13
13
  export { IMessageUpdateActivity, MessageUpdateActivity } from './message/message-update.mjs';
@@ -3,11 +3,11 @@ export { ConversationActivity } from './conversation/index.js';
3
3
  export { EventActivity } from './event/index.js';
4
4
  export { IHandoffActivity } from './handoff.js';
5
5
  export { InstallUpdateActivity } from './install-update/index.js';
6
- export { b as Activity, d as IMessageExtensionFetchTaskInvokeActivity, e as IMessageExtensionSubmitActionInvokeActivity, I as InvokeActivity, c as MessageExtensionInvokeActivity, t as toActivityParams } from '../activity-BXTVWTDe.js';
6
+ export { b as Activity, d as IMessageExtensionFetchTaskInvokeActivity, e as IMessageExtensionSubmitActionInvokeActivity, I as InvokeActivity, c as MessageExtensionInvokeActivity, t as toActivityParams } from '../activity-C1r0B_9_.js';
7
7
  export { $MessageActivity } from './message/index.js';
8
8
  export { ITraceActivity } from './trace.js';
9
9
  export { ITypingActivity, TypingActivity } from './typing.js';
10
- export { A as AddMentionOptions, I as IMessageActivity, M as MessageActivity, S as StripMentionsTextOptions, s as stripMentionsText } from '../message-DyL99RbG.js';
10
+ export { A as AddMentionOptions, I as IMessageActivity, M as MessageActivity, S as StripMentionsTextOptions, s as stripMentionsText } from '../message-Dahma92e.js';
11
11
  export { Activity as $Activity, IActivity } from './activity.js';
12
12
  export { IMessageDeleteActivity, MessageDeleteActivity } from './message/message-delete.js';
13
13
  export { IMessageUpdateActivity, MessageUpdateActivity } from './message/message-update.js';
@@ -4,7 +4,7 @@ export { IExecuteActionInvokeActivity } from './execute-action.mjs';
4
4
  export { IFileConsentInvokeActivity } from './file-consent.mjs';
5
5
  export { IHandoffActionInvokeActivity } from './handoff-action.mjs';
6
6
  export { MessageInvokeActivity } from './message/index.mjs';
7
- export { d as IMessageExtensionFetchTaskInvokeActivity, e as IMessageExtensionSubmitActionInvokeActivity, I as InvokeActivity, c as MessageExtensionInvokeActivity } from '../../activity-DJwv7Dt6.mjs';
7
+ export { d as IMessageExtensionFetchTaskInvokeActivity, e as IMessageExtensionSubmitActionInvokeActivity, I as InvokeActivity, c as MessageExtensionInvokeActivity } from '../../activity-C_Apu8i6.mjs';
8
8
  export { SignInInvokeActivity } from './sign-in/index.mjs';
9
9
  export { TabInvokeActivity } from './tab/index.mjs';
10
10
  export { TaskInvokeActivity } from './task/index.mjs';
@@ -60,7 +60,7 @@ import '../../models/o365/o365-connector-card-action-query.mjs';
60
60
  import '../../models/file/file-consent-card.mjs';
61
61
  import '../../models/action.mjs';
62
62
  import '../../models/file/file-upload-info.mjs';
63
- import '../../message-C7JDFGmD.mjs';
63
+ import '../../message-BfRVRgDX.mjs';
64
64
  import '../../models/input-hint.mjs';
65
65
  import '../../models/text-format.mjs';
66
66
  import '../../models/attachment/attachment.mjs';
@@ -4,7 +4,7 @@ export { IExecuteActionInvokeActivity } from './execute-action.js';
4
4
  export { IFileConsentInvokeActivity } from './file-consent.js';
5
5
  export { IHandoffActionInvokeActivity } from './handoff-action.js';
6
6
  export { MessageInvokeActivity } from './message/index.js';
7
- export { d as IMessageExtensionFetchTaskInvokeActivity, e as IMessageExtensionSubmitActionInvokeActivity, I as InvokeActivity, c as MessageExtensionInvokeActivity } from '../../activity-BXTVWTDe.js';
7
+ export { d as IMessageExtensionFetchTaskInvokeActivity, e as IMessageExtensionSubmitActionInvokeActivity, I as InvokeActivity, c as MessageExtensionInvokeActivity } from '../../activity-C1r0B_9_.js';
8
8
  export { SignInInvokeActivity } from './sign-in/index.js';
9
9
  export { TabInvokeActivity } from './tab/index.js';
10
10
  export { TaskInvokeActivity } from './task/index.js';
@@ -60,7 +60,7 @@ import '../../models/o365/o365-connector-card-action-query.js';
60
60
  import '../../models/file/file-consent-card.js';
61
61
  import '../../models/action.js';
62
62
  import '../../models/file/file-upload-info.js';
63
- import '../../message-DyL99RbG.js';
63
+ import '../../message-Dahma92e.js';
64
64
  import '../../models/input-hint.js';
65
65
  import '../../models/text-format.js';
66
66
  import '../../models/attachment/attachment.js';
@@ -1,6 +1,6 @@
1
1
  import '../../../models/conversation/conversation-reference.mjs';
2
2
  import '../../activity.mjs';
3
- export { d as IMessageExtensionFetchTaskInvokeActivity } from '../../../activity-DJwv7Dt6.mjs';
3
+ export { d as IMessageExtensionFetchTaskInvokeActivity } from '../../../activity-C_Apu8i6.mjs';
4
4
  import '../../../models/account.mjs';
5
5
  import '../../../models/membership-source.mjs';
6
6
  import '../../../models/membership-source-types.mjs';
@@ -25,7 +25,7 @@ import '../../../models/channel-data/on-behalf-of.mjs';
25
25
  import '../../../models/channel-data/settings.mjs';
26
26
  import '../../../models/channel-data/team-info.mjs';
27
27
  import '../../../models/channel-data/tenant-info.mjs';
28
- import '../../../message-C7JDFGmD.mjs';
28
+ import '../../../message-BfRVRgDX.mjs';
29
29
  import '../../../models/input-hint.mjs';
30
30
  import '../../../models/text-format.mjs';
31
31
  import '../../../models/attachment/attachment.mjs';
@@ -1,6 +1,6 @@
1
1
  import '../../../models/conversation/conversation-reference.js';
2
2
  import '../../activity.js';
3
- export { d as IMessageExtensionFetchTaskInvokeActivity } from '../../../activity-BXTVWTDe.js';
3
+ export { d as IMessageExtensionFetchTaskInvokeActivity } from '../../../activity-C1r0B_9_.js';
4
4
  import '../../../models/account.js';
5
5
  import '../../../models/membership-source.js';
6
6
  import '../../../models/membership-source-types.js';
@@ -25,7 +25,7 @@ import '../../../models/channel-data/on-behalf-of.js';
25
25
  import '../../../models/channel-data/settings.js';
26
26
  import '../../../models/channel-data/team-info.js';
27
27
  import '../../../models/channel-data/tenant-info.js';
28
- import '../../../message-DyL99RbG.js';
28
+ import '../../../message-Dahma92e.js';
29
29
  import '../../../models/input-hint.js';
30
30
  import '../../../models/text-format.js';
31
31
  import '../../../models/attachment/attachment.js';
@@ -1,6 +1,6 @@
1
1
  export { IMessageExtensionAnonQueryLinkInvokeActivity } from './anon-query-link.mjs';
2
2
  export { IMessageExtensionCardButtonClickedInvokeActivity } from './card-button-clicked.mjs';
3
- export { d as IMessageExtensionFetchTaskInvokeActivity, e as IMessageExtensionSubmitActionInvokeActivity, c as MessageExtensionInvokeActivity } from '../../../activity-DJwv7Dt6.mjs';
3
+ export { d as IMessageExtensionFetchTaskInvokeActivity, e as IMessageExtensionSubmitActionInvokeActivity, c as MessageExtensionInvokeActivity } from '../../../activity-C_Apu8i6.mjs';
4
4
  export { IMessageExtensionQueryInvokeActivity } from './query.mjs';
5
5
  export { IMessageExtensionQueryLinkInvokeActivity } from './query-link.mjs';
6
6
  export { IMessageExtensionQuerySettingUrlInvokeActivity } from './query-setting-url.mjs';
@@ -33,7 +33,7 @@ import '../../../models/channel-data/on-behalf-of.mjs';
33
33
  import '../../../models/channel-data/settings.mjs';
34
34
  import '../../../models/channel-data/team-info.mjs';
35
35
  import '../../../models/channel-data/tenant-info.mjs';
36
- import '../../../message-C7JDFGmD.mjs';
36
+ import '../../../message-BfRVRgDX.mjs';
37
37
  import '../../../models/input-hint.mjs';
38
38
  import '../../../models/text-format.mjs';
39
39
  import '../../../models/attachment/attachment.mjs';
@@ -1,6 +1,6 @@
1
1
  export { IMessageExtensionAnonQueryLinkInvokeActivity } from './anon-query-link.js';
2
2
  export { IMessageExtensionCardButtonClickedInvokeActivity } from './card-button-clicked.js';
3
- export { d as IMessageExtensionFetchTaskInvokeActivity, e as IMessageExtensionSubmitActionInvokeActivity, c as MessageExtensionInvokeActivity } from '../../../activity-BXTVWTDe.js';
3
+ export { d as IMessageExtensionFetchTaskInvokeActivity, e as IMessageExtensionSubmitActionInvokeActivity, c as MessageExtensionInvokeActivity } from '../../../activity-C1r0B_9_.js';
4
4
  export { IMessageExtensionQueryInvokeActivity } from './query.js';
5
5
  export { IMessageExtensionQueryLinkInvokeActivity } from './query-link.js';
6
6
  export { IMessageExtensionQuerySettingUrlInvokeActivity } from './query-setting-url.js';
@@ -33,7 +33,7 @@ import '../../../models/channel-data/on-behalf-of.js';
33
33
  import '../../../models/channel-data/settings.js';
34
34
  import '../../../models/channel-data/team-info.js';
35
35
  import '../../../models/channel-data/tenant-info.js';
36
- import '../../../message-DyL99RbG.js';
36
+ import '../../../message-Dahma92e.js';
37
37
  import '../../../models/input-hint.js';
38
38
  import '../../../models/text-format.js';
39
39
  import '../../../models/attachment/attachment.js';
@@ -1,6 +1,6 @@
1
1
  import '../../../models/conversation/conversation-reference.mjs';
2
2
  import '../../activity.mjs';
3
- export { e as IMessageExtensionSubmitActionInvokeActivity } from '../../../activity-DJwv7Dt6.mjs';
3
+ export { e as IMessageExtensionSubmitActionInvokeActivity } from '../../../activity-C_Apu8i6.mjs';
4
4
  import '../../../models/account.mjs';
5
5
  import '../../../models/membership-source.mjs';
6
6
  import '../../../models/membership-source-types.mjs';
@@ -25,7 +25,7 @@ import '../../../models/channel-data/on-behalf-of.mjs';
25
25
  import '../../../models/channel-data/settings.mjs';
26
26
  import '../../../models/channel-data/team-info.mjs';
27
27
  import '../../../models/channel-data/tenant-info.mjs';
28
- import '../../../message-C7JDFGmD.mjs';
28
+ import '../../../message-BfRVRgDX.mjs';
29
29
  import '../../../models/input-hint.mjs';
30
30
  import '../../../models/text-format.mjs';
31
31
  import '../../../models/attachment/attachment.mjs';
@@ -1,6 +1,6 @@
1
1
  import '../../../models/conversation/conversation-reference.js';
2
2
  import '../../activity.js';
3
- export { e as IMessageExtensionSubmitActionInvokeActivity } from '../../../activity-BXTVWTDe.js';
3
+ export { e as IMessageExtensionSubmitActionInvokeActivity } from '../../../activity-C1r0B_9_.js';
4
4
  import '../../../models/account.js';
5
5
  import '../../../models/membership-source.js';
6
6
  import '../../../models/membership-source-types.js';
@@ -25,7 +25,7 @@ import '../../../models/channel-data/on-behalf-of.js';
25
25
  import '../../../models/channel-data/settings.js';
26
26
  import '../../../models/channel-data/team-info.js';
27
27
  import '../../../models/channel-data/tenant-info.js';
28
- import '../../../message-DyL99RbG.js';
28
+ import '../../../message-Dahma92e.js';
29
29
  import '../../../models/input-hint.js';
30
30
  import '../../../models/text-format.js';
31
31
  import '../../../models/attachment/attachment.js';
@@ -1,5 +1,5 @@
1
- import { I as IMessageActivity } from '../../message-C7JDFGmD.mjs';
2
- export { A as AddMentionOptions, M as MessageActivity } from '../../message-C7JDFGmD.mjs';
1
+ import { I as IMessageActivity } from '../../message-BfRVRgDX.mjs';
2
+ export { A as AddMentionOptions, M as MessageActivity } from '../../message-BfRVRgDX.mjs';
3
3
  import { IMessageDeleteActivity } from './message-delete.mjs';
4
4
  export { MessageDeleteActivity } from './message-delete.mjs';
5
5
  import { IMessageReactionActivity } from './message-reaction.mjs';
@@ -1,5 +1,5 @@
1
- import { I as IMessageActivity } from '../../message-DyL99RbG.js';
2
- export { A as AddMentionOptions, M as MessageActivity } from '../../message-DyL99RbG.js';
1
+ import { I as IMessageActivity } from '../../message-Dahma92e.js';
2
+ export { A as AddMentionOptions, M as MessageActivity } from '../../message-Dahma92e.js';
3
3
  import { IMessageDeleteActivity } from './message-delete.js';
4
4
  export { MessageDeleteActivity } from './message-delete.js';
5
5
  import { IMessageReactionActivity } from './message-reaction.js';
@@ -9,7 +9,7 @@ import '../../models/suggested-actions.mjs';
9
9
  import '../../models/importance.mjs';
10
10
  import '../../models/delivery-mode.mjs';
11
11
  import '../activity.mjs';
12
- export { A as AddMentionOptions, I as IMessageActivity, M as MessageActivity } from '../../message-C7JDFGmD.mjs';
12
+ export { A as AddMentionOptions, I as IMessageActivity, M as MessageActivity } from '../../message-BfRVRgDX.mjs';
13
13
  import '../../models/membership-source.mjs';
14
14
  import '../../models/membership-source-types.mjs';
15
15
  import '../../models/membership-types.mjs';
@@ -9,7 +9,7 @@ import '../../models/suggested-actions.js';
9
9
  import '../../models/importance.js';
10
10
  import '../../models/delivery-mode.js';
11
11
  import '../activity.js';
12
- export { A as AddMentionOptions, I as IMessageActivity, M as MessageActivity } from '../../message-DyL99RbG.js';
12
+ export { A as AddMentionOptions, I as IMessageActivity, M as MessageActivity } from '../../message-Dahma92e.js';
13
13
  import '../../models/membership-source.js';
14
14
  import '../../models/membership-source-types.js';
15
15
  import '../../models/membership-types.js';
@@ -58,10 +58,6 @@ class MessageActivity extends activity.Activity {
58
58
  * A value that is associated with the activity.
59
59
  */
60
60
  value;
61
- /**
62
- * Indicates if this is a targeted message visible only to a specific recipient.
63
- */
64
- isTargeted;
65
61
  constructor(text = "", value = {}) {
66
62
  super({
67
63
  ...value,
@@ -248,18 +244,13 @@ class MessageActivity extends activity.Activity {
248
244
  });
249
245
  }
250
246
  /**
251
- * Mark this message as a targeted message visible only to a specific recipient.
252
- * @param recipientOrFlag - If `true`, the recipient will be inferred from the incoming activity context.
253
- * If a string, it specifies the explicit recipient ID.
247
+ * Set the recipient of this message, optionally marking it as a targeted message.
248
+ * @param account - The recipient account
249
+ * @param isTargeted - If true, marks this as a targeted message visible only to the recipient. Defaults to false.
254
250
  * @returns this instance for chaining
255
- * @remarks When using `true`, this must be sent within an activity context (not proactively).
256
- * For proactive sends, you must provide an explicit recipient ID.
257
251
  */
258
- withTargetedRecipient(recipientOrFlag) {
259
- this.isTargeted = true;
260
- if (typeof recipientOrFlag === "string") {
261
- this.recipient = { id: recipientOrFlag, name: "", role: "user" };
262
- }
252
+ withRecipient(account, isTargeted = false) {
253
+ super.withRecipient(account, isTargeted);
263
254
  return this;
264
255
  }
265
256
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/activities/message/message.ts"],"names":["Activity","cardAttachment","stripMentionsText"],"mappings":";;;;;;AAwGO,MAAM,wBAAwBA,iBAAgD,CAAA;AAAA;AAAA;AAAA;AAAA,EAInF,IAAA;AAAA;AAAA;AAAA;AAAA,EAKA,KAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOA,SAAA;AAAA;AAAA;AAAA;AAAA,EAKA,OAAA;AAAA;AAAA;AAAA;AAAA,EAKA,UAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAMA,gBAAA;AAAA;AAAA;AAAA;AAAA,EAKA,WAAA;AAAA;AAAA;AAAA;AAAA,EAKA,gBAAA;AAAA;AAAA;AAAA;AAAA,EAKA,UAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAMA,YAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAMA,UAAA;AAAA;AAAA;AAAA;AAAA,EAKA,KAAA;AAAA;AAAA;AAAA;AAAA,EAKA,UAAA;AAAA,EAEA,WAAY,CAAA,IAAA,GAAe,EAAI,EAAA,KAAA,GAAiD,EAAI,EAAA;AAClF,IAAM,KAAA,CAAA;AAAA,MACJ,GAAG,KAAA;AAAA,MACH,IAAM,EAAA;AAAA,KACP,CAAA;AAED,IAAA,MAAA,CAAO,OAAO,IAAM,EAAA,EAAE,IAAM,EAAA,GAAG,OAAO,CAAA;AAAA;AACxC;AAAA;AAAA;AAAA,EAKA,OAAO,KAAK,QAA4B,EAAA;AACtC,IAAA,OAAO,IAAI,eAAA,CAAgB,QAAS,CAAA,IAAA,EAAM,QAAQ,CAAA;AAAA;AACpD;AAAA;AAAA;AAAA,EAKA,WAAgC,GAAA;AAC9B,IAAA,OAAO,MAAO,CAAA,MAAA;AAAA,MACZ;AAAA,QACE,iBAAmB,EAAA,IAAA,CAAK,iBAAkB,CAAA,IAAA,CAAK,IAAI,C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f,UAAY,EAAA;AAAA,KACb,CAAA;AAAA;AACH;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAUA,sBAAsB,eAAgC,EAAA;AACpD,IAAA,IAAA,CAAK,UAAa,GAAA,IAAA;AAClB,IAAI,IAAA,OAAO,oBAAoB,QAAU,EAAA;AACvC,MAAA,IAAA,CAAK,YAAY,EAAE,EAAA,EAAI,iBAAiB,IAAM,EAAA,EAAA,EAAI,MAAM,MAAO,EAAA;AAAA;AAEjE,IAAO,OAAA,IAAA;AAAA;AAEX","file":"message.js","sourcesContent":["import {\n Account,\n Attachment,\n AttachmentLayout,\n cardAttachment,\n CardAttachmentType,\n CardAttachmentTypes,\n DeliveryMode,\n Importance,\n InputHint,\n MentionEntity,\n SuggestedActions,\n TextFormat,\n} from '../../models';\nimport { Activity, IActivity } from '../activity';\nimport { stripMentionsText, StripMentionsTextOptions } from '../utils';\n\nexport interface IMessageActivity extends IActivity<'message'> {\n /**\n * The text content of the message.\n */\n text: string;\n\n /**\n * The text to speak.\n */\n speak?: string;\n\n /**\n * Indicates whether your bot is accepting,\n * expecting, or ignoring user input after the message is delivered to the client. Possible\n * values include: 'acceptingInput', 'ignoringInput', 'expectingInput'\n */\n inputHint?: InputHint;\n\n /**\n * The text to display if the channel cannot render cards.\n */\n summary?: string;\n\n /**\n * Format of text fields Default:markdown. Possible values include: 'markdown', 'plain', 'xml'\n */\n textFormat?: TextFormat;\n\n /**\n * The layout hint for multiple attachments. Default: list. Possible values include: 'list',\n * 'carousel'\n */\n attachmentLayout?: AttachmentLayout;\n\n /**\n * Attachments\n */\n attachments?: Attachment[];\n\n /**\n * The suggested actions for the activity.\n */\n suggestedActions?: SuggestedActions;\n\n /**\n * The importance of the activity. Possible values include: 'low', 'normal', 'high'\n */\n importance?: Importance;\n\n /**\n * A delivery hint to signal to the recipient alternate delivery paths for the activity.\n * The default delivery mode is \"default\". Possible values include: 'normal', 'notification'\n */\n deliveryMode?: DeliveryMode;\n\n /**\n * The time at which the activity should be considered to be \"expired\" and should not be\n * presented to the recipient.\n */\n expiration?: Date;\n\n /**\n * A value that is associated with the activity.\n */\n value?: any;\n\n /**\n * Indicates if this is a targeted message visible only to a specific recipient.\n */\n isTargeted?: boolean;\n\n /**\n * remove \"\\<at>...\\</at>\" text from an activity\n */\n stripMentionsText(options?: StripMentionsTextOptions): IMessageActivity;\n\n /**\n * is the recipient account mentioned\n */\n isRecipientMentioned(): boolean;\n\n /**\n * get a mention by the account id if exists\n */\n getAccountMention(accountId: string): MentionEntity | undefined;\n}\n\nexport class MessageActivity extends Activity<'message'> implements IMessageActivity {\n /**\n * The text content of the message.\n */\n text!: string;\n\n /**\n * The text to speak.\n */\n speak?: string;\n\n /**\n * Indicates whether your bot is accepting,\n * expecting, or ignoring user input after the message is delivered to the client. Possible\n * values include: 'acceptingInput', 'ignoringInput', 'expectingInput'\n */\n inputHint?: InputHint;\n\n /**\n * The text to display if the channel cannot render cards.\n */\n summary?: string;\n\n /**\n * Format of text fields Default:markdown. Possible values include: 'markdown', 'plain', 'xml'\n */\n textFormat?: TextFormat;\n\n /**\n * The layout hint for multiple attachments. Default: list. Possible values include: 'list',\n * 'carousel'\n */\n attachmentLayout?: AttachmentLayout;\n\n /**\n * Attachments\n */\n attachments?: Attachment[];\n\n /**\n * The suggested actions for the activity.\n */\n suggestedActions?: SuggestedActions;\n\n /**\n * The importance of the activity. Possible values include: 'low', 'normal', 'high'\n */\n importance?: Importance;\n\n /**\n * A delivery hint to signal to the recipient alternate delivery paths for the activity.\n * The default delivery mode is \"default\". Possible values include: 'normal', 'notification'\n */\n deliveryMode?: DeliveryMode;\n\n /**\n * The time at which the activity should be considered to be \"expired\" and should not be\n * presented to the recipient.\n */\n expiration?: Date;\n\n /**\n * A value that is associated with the activity.\n */\n value?: any;\n\n /**\n * Indicates if this is a targeted message visible only to a specific recipient.\n */\n isTargeted?: boolean;\n\n constructor(text: string = '', value: Omit<Partial<IMessageActivity>, 'type'> = {}) {\n super({\n ...value,\n type: 'message',\n });\n\n Object.assign(this, { text, ...value });\n }\n\n /**\n * initialize from interface\n */\n static from(activity: IMessageActivity) {\n return new MessageActivity(activity.text, activity);\n }\n\n /**\n * convert to interface\n */\n toInterface(): IMessageActivity {\n return Object.assign(\n {\n stripMentionsText: this.stripMentionsText.bind(this),\n isRecipientMentioned: this.isRecipientMentioned.bind(this),\n getAccountMention: this.getAccountMention.bind(this),\n },\n this\n );\n }\n\n /**\n * copy to a new instance\n */\n clone(options: Omit<Partial<IMessageActivity>, 'type'> = {}) {\n return new MessageActivity(this.text, {\n ...this.toInterface(),\n ...options,\n });\n }\n\n /**\n * The text content of the message.\n */\n withText(value: string) {\n this.text = value;\n return this;\n }\n\n /**\n * The text to speak.\n */\n withSpeak(value: string) {\n this.speak = value;\n return this;\n }\n\n /**\n * Indicates whether your bot is accepting,\n * expecting, or ignoring user input after the message is delivered to the client. Possible\n * values include: 'acceptingInput', 'ignoringInput', 'expectingInput'\n */\n withInputHint(value: InputHint) {\n this.inputHint = value;\n return this;\n }\n\n /**\n * The text to display if the channel cannot render cards.\n */\n withSummary(value: string) {\n this.summary = value;\n return this;\n }\n\n /**\n * Format of text fields Default:markdown. Possible values include: 'markdown', 'plain', 'xml'\n */\n withTextFormat(value: TextFormat) {\n this.textFormat = value;\n return this;\n }\n\n /**\n * The layout hint for multiple attachments. Default: list. Possible values include: 'list',\n * 'carousel'\n */\n withAttachmentLayout(value: AttachmentLayout) {\n this.attachmentLayout = value;\n return this;\n }\n\n /**\n * The suggested actions for the activity.\n */\n withSuggestedActions(value: SuggestedActions) {\n this.suggestedActions = value;\n return this;\n }\n\n /**\n * The importance of the activity. Possible values include: 'low', 'normal', 'high'\n */\n withImportance(value: Importance) {\n this.importance = value;\n return this;\n }\n\n /**\n * A delivery hint to signal to the recipient alternate delivery paths for the activity.\n * The default delivery mode is \"default\". Possible values include: 'normal', 'notification'\n */\n withDeliveryMode(value: DeliveryMode) {\n this.deliveryMode = value;\n return this;\n }\n\n /**\n * The time at which the activity should be considered to be \"expired\" and should not be\n * presented to the recipient.\n */\n withExpiration(value: Date) {\n this.expiration = value;\n return this;\n }\n\n /**\n * Append text\n */\n addText(text: string) {\n this.text += text;\n return this;\n }\n\n /**\n * Attachments\n */\n addAttachments(...value: Attachment[]) {\n if (!this.attachments) {\n this.attachments = [];\n }\n\n this.attachments.push(...value);\n return this;\n }\n\n /**\n * `@mention` an account\n * @param account the account to mention\n * @param options options to customize the mention\n */\n addMention(account: Account, options: AddMentionOptions = {}) {\n const text = options.text || account.name;\n const addText = options.addText ?? true;\n\n if (addText) {\n this.addText(`<at>${text}</at>`);\n }\n\n return this.addEntity({\n type: 'mention',\n mentioned: account,\n text: `<at>${text}</at>`,\n });\n }\n\n /**\n * Add a card attachment\n */\n addCard<T extends CardAttachmentType>(type: T, content: CardAttachmentTypes[T]['content']) {\n return this.addAttachments(cardAttachment(type, content));\n }\n\n /**\n * remove \"\\<at>...\\</at>\" text from an activity\n */\n stripMentionsText(options: StripMentionsTextOptions = {}) {\n this.text = stripMentionsText(this, options);\n return this;\n }\n\n /**\n * is the recipient account mentioned\n */\n isRecipientMentioned() {\n return (this.entities || [])\n .filter((e) => e.type === 'mention')\n .some((e) => e.mentioned.id === this.recipient.id);\n }\n\n /**\n * get a mention by the account id if exists\n */\n getAccountMention(accountId: string) {\n return (this.entities || [])\n .filter((e) => e.type === 'mention')\n .find((e) => e.mentioned.id === accountId);\n }\n\n /**\n * Add stream info, making\n * this a final stream message\n */\n addStreamFinal() {\n if (!this.channelData) {\n this.channelData = {};\n }\n\n this.channelData.streamId = this.id;\n this.channelData.streamType = 'final';\n\n return this.addEntity({\n type: 'streaminfo',\n streamId: this.id,\n streamType: 'final',\n });\n }\n\n /**\n * Mark this message as a targeted message visible only to a specific recipient.\n * @param recipientOrFlag - If `true`, the recipient will be inferred from the incoming activity context.\n * If a string, it specifies the explicit recipient ID.\n * @returns this instance for chaining\n * @remarks When using `true`, this must be sent within an activity context (not proactively).\n * For proactive sends, you must provide an explicit recipient ID.\n */\n withTargetedRecipient(recipientOrFlag: true | string) {\n this.isTargeted = true;\n if (typeof recipientOrFlag === 'string') {\n this.recipient = { id: recipientOrFlag, name: '', role: 'user' };\n }\n return this;\n }\n}\n\n/**\n * options for adding a mention\n * to an activity\n */\nexport type AddMentionOptions = {\n /**\n * if `true`, append the mention `text` to the `activity.text`\n * @default true\n */\n readonly addText?: boolean;\n\n /**\n * the `text` to use for the mention\n *\n * @default `account.name`\n * @remark\n * this text should not include `<at>` or `</at>`\n */\n readonly text?: string;\n};\n"]}
1
+ {"version":3,"sources":["../../../src/activities/message/message.ts"],"names":["Activity","cardAttachment","stripMentionsText"],"mappings":";;;;;;AAmGO,MAAM,wBAAwBA,iBAAgD,CAAA;AAAA;AAAA;AAAA;AAAA,EAInF,IAAA;AAAA;AAAA;AAAA;AAAA,EAKA,KAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOA,SAAA;AAAA;AAAA;AAAA;AAAA,EAKA,OAAA;AAAA;AAAA;AAAA;AAAA,EAKA,UAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAMA,gBAAA;AAAA;AAAA;AAAA;AAAA,EAKA,WAAA;AAAA;AAAA;AAAA;AAAA,EAKA,gBAAA;AAAA;AAAA;AAAA;AAAA,EAKA,UAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAMA,YAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAMA,UAAA;AAAA;AAAA;AAAA;AAAA,EAKA,KAAA;AAAA,EAEA,WAAY,CAAA,IAAA,GAAe,EAAI,EAAA,KAAA,GAAiD,EAAI,EAAA;AAClF,IAAM,KAAA,CAAA;AAAA,MACJ,GAAG,KAAA;AAAA,MACH,IAAM,EAAA;AAAA,KACP,CAAA;AAED,IAAA,MAAA,CAAO,OAAO,IAAM,EAAA,EAAE,IAAM,EAAA,GAAG,OAAO,CAAA;AAAA;AACxC;AAAA;AAAA;AAAA,EAKA,OAAO,KAAK,QAA4B,EA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AA,CAAK,cAAc,EAAC;AAAA;AAGtB,IAAK,IAAA,CAAA,WAAA,CAAY,WAAW,IAAK,CAAA,EAAA;AACjC,IAAA,IAAA,CAAK,YAAY,UAAa,GAAA,OAAA;AAE9B,IAAA,OAAO,KAAK,SAAU,CAAA;AAAA,MACpB,IAAM,EAAA,YAAA;AAAA,MACN,UAAU,IAAK,CAAA,EAAA;AAAA,MACf,UAAY,EAAA;AAAA,KACb,CAAA;AAAA;AACH;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAQA,aAAA,CAAc,OAAkB,EAAA,UAAA,GAAsB,KAAa,EAAA;AACjE,IAAM,KAAA,CAAA,aAAA,CAAc,SAAS,UAAU,CAAA;AACvC,IAAO,OAAA,IAAA;AAAA;AAEX","file":"message.js","sourcesContent":["import {\n Account,\n Attachment,\n AttachmentLayout,\n cardAttachment,\n CardAttachmentType,\n CardAttachmentTypes,\n DeliveryMode,\n Importance,\n InputHint,\n MentionEntity,\n SuggestedActions,\n TextFormat,\n} from '../../models';\nimport { Activity, IActivity } from '../activity';\nimport { stripMentionsText, StripMentionsTextOptions } from '../utils';\n\nexport interface IMessageActivity extends IActivity<'message'> {\n /**\n * The text content of the message.\n */\n text: string;\n\n /**\n * The text to speak.\n */\n speak?: string;\n\n /**\n * Indicates whether your bot is accepting,\n * expecting, or ignoring user input after the message is delivered to the client. Possible\n * values include: 'acceptingInput', 'ignoringInput', 'expectingInput'\n */\n inputHint?: InputHint;\n\n /**\n * The text to display if the channel cannot render cards.\n */\n summary?: string;\n\n /**\n * Format of text fields Default:markdown. Possible values include: 'markdown', 'plain', 'xml'\n */\n textFormat?: TextFormat;\n\n /**\n * The layout hint for multiple attachments. Default: list. Possible values include: 'list',\n * 'carousel'\n */\n attachmentLayout?: AttachmentLayout;\n\n /**\n * Attachments\n */\n attachments?: Attachment[];\n\n /**\n * The suggested actions for the activity.\n */\n suggestedActions?: SuggestedActions;\n\n /**\n * The importance of the activity. Possible values include: 'low', 'normal', 'high'\n */\n importance?: Importance;\n\n /**\n * A delivery hint to signal to the recipient alternate delivery paths for the activity.\n * The default delivery mode is \"default\". Possible values include: 'normal', 'notification'\n */\n deliveryMode?: DeliveryMode;\n\n /**\n * The time at which the activity should be considered to be \"expired\" and should not be\n * presented to the recipient.\n */\n expiration?: Date;\n\n /**\n * A value that is associated with the activity.\n */\n value?: any;\n\n /**\n * remove \"\\<at>...\\</at>\" text from an activity\n */\n stripMentionsText(options?: StripMentionsTextOptions): IMessageActivity;\n\n /**\n * is the recipient account mentioned\n */\n isRecipientMentioned(): boolean;\n\n /**\n * get a mention by the account id if exists\n */\n getAccountMention(accountId: string): MentionEntity | undefined;\n}\n\nexport class MessageActivity extends Activity<'message'> implements IMessageActivity {\n /**\n * The text content of the message.\n */\n text!: string;\n\n /**\n * The text to speak.\n */\n speak?: string;\n\n /**\n * Indicates whether your bot is accepting,\n * expecting, or ignoring user input after the message is delivered to the client. Possible\n * values include: 'acceptingInput', 'ignoringInput', 'expectingInput'\n */\n inputHint?: InputHint;\n\n /**\n * The text to display if the channel cannot render cards.\n */\n summary?: string;\n\n /**\n * Format of text fields Default:markdown. Possible values include: 'markdown', 'plain', 'xml'\n */\n textFormat?: TextFormat;\n\n /**\n * The layout hint for multiple attachments. Default: list. Possible values include: 'list',\n * 'carousel'\n */\n attachmentLayout?: AttachmentLayout;\n\n /**\n * Attachments\n */\n attachments?: Attachment[];\n\n /**\n * The suggested actions for the activity.\n */\n suggestedActions?: SuggestedActions;\n\n /**\n * The importance of the activity. Possible values include: 'low', 'normal', 'high'\n */\n importance?: Importance;\n\n /**\n * A delivery hint to signal to the recipient alternate delivery paths for the activity.\n * The default delivery mode is \"default\". Possible values include: 'normal', 'notification'\n */\n deliveryMode?: DeliveryMode;\n\n /**\n * The time at which the activity should be considered to be \"expired\" and should not be\n * presented to the recipient.\n */\n expiration?: Date;\n\n /**\n * A value that is associated with the activity.\n */\n value?: any;\n\n constructor(text: string = '', value: Omit<Partial<IMessageActivity>, 'type'> = {}) {\n super({\n ...value,\n type: 'message',\n });\n\n Object.assign(this, { text, ...value });\n }\n\n /**\n * initialize from interface\n */\n static from(activity: IMessageActivity) {\n return new MessageActivity(activity.text, activity);\n }\n\n /**\n * convert to interface\n */\n toInterface(): IMessageActivity {\n return Object.assign(\n {\n stripMentionsText: this.stripMentionsText.bind(this),\n isRecipientMentioned: this.isRecipientMentioned.bind(this),\n getAccountMention: this.getAccountMention.bind(this),\n },\n this\n );\n }\n\n /**\n * copy to a new instance\n */\n clone(options: Omit<Partial<IMessageActivity>, 'type'> = {}) {\n return new MessageActivity(this.text, {\n ...this.toInterface(),\n ...options,\n });\n }\n\n /**\n * The text content of the message.\n */\n withText(value: string) {\n this.text = value;\n return this;\n }\n\n /**\n * The text to speak.\n */\n withSpeak(value: string) {\n this.speak = value;\n return this;\n }\n\n /**\n * Indicates whether your bot is accepting,\n * expecting, or ignoring user input after the message is delivered to the client. Possible\n * values include: 'acceptingInput', 'ignoringInput', 'expectingInput'\n */\n withInputHint(value: InputHint) {\n this.inputHint = value;\n return this;\n }\n\n /**\n * The text to display if the channel cannot render cards.\n */\n withSummary(value: string) {\n this.summary = value;\n return this;\n }\n\n /**\n * Format of text fields Default:markdown. Possible values include: 'markdown', 'plain', 'xml'\n */\n withTextFormat(value: TextFormat) {\n this.textFormat = value;\n return this;\n }\n\n /**\n * The layout hint for multiple attachments. Default: list. Possible values include: 'list',\n * 'carousel'\n */\n withAttachmentLayout(value: AttachmentLayout) {\n this.attachmentLayout = value;\n return this;\n }\n\n /**\n * The suggested actions for the activity.\n */\n withSuggestedActions(value: SuggestedActions) {\n this.suggestedActions = value;\n return this;\n }\n\n /**\n * The importance of the activity. Possible values include: 'low', 'normal', 'high'\n */\n withImportance(value: Importance) {\n this.importance = value;\n return this;\n }\n\n /**\n * A delivery hint to signal to the recipient alternate delivery paths for the activity.\n * The default delivery mode is \"default\". Possible values include: 'normal', 'notification'\n */\n withDeliveryMode(value: DeliveryMode) {\n this.deliveryMode = value;\n return this;\n }\n\n /**\n * The time at which the activity should be considered to be \"expired\" and should not be\n * presented to the recipient.\n */\n withExpiration(value: Date) {\n this.expiration = value;\n return this;\n }\n\n /**\n * Append text\n */\n addText(text: string) {\n this.text += text;\n return this;\n }\n\n /**\n * Attachments\n */\n addAttachments(...value: Attachment[]) {\n if (!this.attachments) {\n this.attachments = [];\n }\n\n this.attachments.push(...value);\n return this;\n }\n\n /**\n * `@mention` an account\n * @param account the account to mention\n * @param options options to customize the mention\n */\n addMention(account: Account, options: AddMentionOptions = {}) {\n const text = options.text || account.name;\n const addText = options.addText ?? true;\n\n if (addText) {\n this.addText(`<at>${text}</at>`);\n }\n\n return this.addEntity({\n type: 'mention',\n mentioned: account,\n text: `<at>${text}</at>`,\n });\n }\n\n /**\n * Add a card attachment\n */\n addCard<T extends CardAttachmentType>(type: T, content: CardAttachmentTypes[T]['content']) {\n return this.addAttachments(cardAttachment(type, content));\n }\n\n /**\n * remove \"\\<at>...\\</at>\" text from an activity\n */\n stripMentionsText(options: StripMentionsTextOptions = {}) {\n this.text = stripMentionsText(this, options);\n return this;\n }\n\n /**\n * is the recipient account mentioned\n */\n isRecipientMentioned() {\n return (this.entities || [])\n .filter((e) => e.type === 'mention')\n .some((e) => e.mentioned.id === this.recipient.id);\n }\n\n /**\n * get a mention by the account id if exists\n */\n getAccountMention(accountId: string) {\n return (this.entities || [])\n .filter((e) => e.type === 'mention')\n .find((e) => e.mentioned.id === accountId);\n }\n\n /**\n * Add stream info, making\n * this a final stream message\n */\n addStreamFinal() {\n if (!this.channelData) {\n this.channelData = {};\n }\n\n this.channelData.streamId = this.id;\n this.channelData.streamType = 'final';\n\n return this.addEntity({\n type: 'streaminfo',\n streamId: this.id,\n streamType: 'final',\n });\n }\n\n /**\n * Set the recipient of this message, optionally marking it as a targeted message.\n * @param account - The recipient account\n * @param isTargeted - If true, marks this as a targeted message visible only to the recipient. Defaults to false.\n * @returns this instance for chaining\n */\n withRecipient(account: Account, isTargeted: boolean = false): this {\n super.withRecipient(account, isTargeted);\n return this;\n }\n}\n\n/**\n * options for adding a mention\n * to an activity\n */\nexport type AddMentionOptions = {\n /**\n * if `true`, append the mention `text` to the `activity.text`\n * @default true\n */\n readonly addText?: boolean;\n\n /**\n * the `text` to use for the mention\n *\n * @default `account.name`\n * @remark\n * this text should not include `<at>` or `</at>`\n */\n readonly text?: string;\n};\n"]}