@microsoft/teams.api
Version:
<p> <a href="https://www.npmjs.com/package/@microsoft/teams.api" target="_blank"> <img src="https://img.shields.io/npm/v/@microsoft/teams.api/latest" /> </a> <a href="https://www.npmjs.com/package/@microsoft/teams.api?activeTab=code" t
1 lines • 35.4 kB
Source Map (JSON)
{"version":3,"sources":["../../src/activities/activity.ts"],"names":[],"mappings":"AAsKO,MAAM,aAAA,CAAsE;AAAA;AAAA;AAAA;AAAA,EAIxE,IAAA;AAAA;AAAA;AAAA;AAAA,EAKT,EAAA;AAAA;AAAA;AAAA;AAAA,EAKA,SAAA;AAAA;AAAA;AAAA;AAAA,EAKA,SAAA;AAAA;AAAA;AAAA;AAAA,EAKA,QAAA;AAAA;AAAA;AAAA;AAAA,EAKA,WAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOA,WAAA,CAAY,IAAA,EAAS,KAAA,GAAkD,EAAC,EAAG;AACzE,IAAA,MAAA,CAAO,MAAA,CAAO,MAAM,KAAK,CAAA;AACzB,IAAA,IAAA,CAAK,IAAA,GAAO,IAAA;AAAA,EACd;AAAA;AAAA;AAAA;AAAA;AAAA,EAMA,OAAO,KAAA,EAAe;AACpB,IAAA,IAAA,CAAK,EAAA,GAAK,KAAA;AACV,IAAA,OAAO,IAAA;AAAA,EACT;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOA,aAAA,CAAc,KAAA,EAAgB,UAAA,GAAsB,KAAA,EAAO;AACzD,IAAA,IAAA,CAAK,YAAY,EAAE,GAAG,OAAO,UAAA,EAAY,UAAA,GAAa,OAAO,MAAA,EAAU;AACvE,IAAA,OAAO,IAAA;AAAA,EACT;AAAA;AAAA;AAAA;AAAA;AAAA,EAMA,gBAAgB,KAAA,EAAoB;AAClC,IAAA,MAAM,SAAsB,EAAE,GAAG,IAAA,CAAK,WAAA,EAAa,GAAG,KAAA,EAAM;AAE5D,IAAA,IAAI,MAAA,CAAO,iBAAiB,MAAA,EAAW;AACrC,MAAA,MAAA,CAAO,mBAA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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 SensitiveUsageEntity,\n SensitivityUsageInfo,\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 * @deprecated This will be removed by end of summer 2026.\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\n/**\n * Base shape for an OUTBOUND activity the app constructs and sends.\n *\n * This is intentionally not derived from all of {@link IActivity}: inbound/server-filled\n * fields such as `from`, `conversation`, `channelId`, `serviceUrl`, and timestamps are\n * filled by the sender or service, not by callers constructing outbound input.\n */\nexport interface IActivityInput<T extends string = string> {\n /**\n * Activity type discriminator.\n */\n readonly type: T;\n\n /**\n * Optional activity ID used when updating an existing sent activity.\n */\n id?: string;\n\n /**\n * Optional recipient account. Set `isTargeted` through {@link ActivityInput.withRecipient}\n * when sending a targeted message.\n */\n recipient?: Account;\n\n /**\n * ID of the activity this outbound activity replies to.\n */\n replyToId?: string;\n\n /**\n * Entities attached to the outbound activity.\n */\n entities?: Entity[];\n\n /**\n * Channel-specific metadata for the outbound activity.\n */\n channelData?: ChannelData;\n}\n\n/**\n * Base builder for outbound activity inputs.\n */\nexport class ActivityInput<T extends string = string> implements IActivityInput<T> {\n /**\n * Activity type discriminator.\n */\n readonly type: T;\n\n /**\n * Optional activity ID used when updating an existing sent activity.\n */\n id?: string;\n\n /**\n * Optional recipient account.\n */\n recipient?: Account;\n\n /**\n * ID of the activity this outbound activity replies to.\n */\n replyToId?: string;\n\n /**\n * Entities attached to the outbound activity.\n */\n entities?: Entity[];\n\n /**\n * Channel-specific metadata for the outbound activity.\n */\n channelData?: ChannelData;\n\n /**\n * Create an outbound activity input.\n * @param type - Activity type discriminator.\n * @param value - Initial outbound activity fields.\n */\n constructor(type: T, value: Omit<Partial<IActivityInput<T>>, 'type'> = {}) {\n Object.assign(this, value);\n this.type = type;\n }\n\n /**\n * Set the activity ID for update scenarios.\n * @param value - Activity ID.\n */\n withId(value: string) {\n this.id = value;\n return this;\n }\n\n /**\n * Set the activity recipient.\n * @param value - Recipient account.\n * @param isTargeted - Whether the activity is targeted only to this recipient.\n */\n withRecipient(value: Account, isTargeted: boolean = false) {\n this.recipient = { ...value, isTargeted: isTargeted ? true : undefined };\n return this;\n }\n\n /**\n * Merge channel-specific metadata into the outbound activity.\n * @param value - Channel metadata to merge.\n */\n withChannelData(value: ChannelData) {\n const merged: ChannelData = { ...this.channelData, ...value };\n\n if (merged.feedbackLoop !== undefined) {\n merged.feedbackLoopEnabled = undefined;\n } else if (merged.feedbackLoopEnabled === true) {\n merged.feedbackLoop = { type: 'default' };\n merged.feedbackLoopEnabled = undefined;\n }\n\n this.channelData = merged;\n return this;\n }\n\n /**\n * Add an entity to the outbound activity.\n * @param value - Entity to add.\n */\n addEntity(value: Entity) {\n if (this.isRootLevelMessageEntity(value)) {\n this.mergeRootLevelMessageEntity(this.ensureSingleRootLevelMessageEntity(), value);\n return this;\n }\n\n if (!this.entities) {\n this.entities = [];\n }\n\n this.entities.push(value);\n return this;\n }\n\n /**\n * Add multiple entities to the outbound activity.\n * @param value - Entities to add.\n */\n addEntities(...value: Entity[]) {\n for (const entity of value) {\n this.addEntity(entity);\n }\n\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 * Add a Microsoft Purview sensitivity label to the message.\n * Replaces any label previously added.\n * @param label - The sensitivity label, identified by its Purview label ID.\n */\n addSensitivityLabel(label: SensitivityUsageInfo) {\n const messageEntity: SensitiveUsageEntity = this.ensureSingleRootLevelMessageEntity();\n messageEntity.usageInfo = { ...label, '@type': label['@type'] ?? 'CreativeWork' };\n return this;\n }\n\n /**\n * Enable message feedback.\n * @param mode - `'default'` shows Teams' built-in thumbs up/down UI.\n * `'custom'` triggers a `message/fetchTask` invoke so the bot can return its own task module dialog.\n */\n addFeedback(mode: 'default' | 'custom' = 'default') {\n if (!this.channelData) {\n this.channelData = {};\n }\n\n this.channelData.feedbackLoop = { type: mode };\n this.channelData.feedbackLoopEnabled = undefined;\n return this;\n }\n\n /**\n * Add citations\n * @param position - Citation position in the message text.\n * @param appearance - Citation appearance metadata.\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: appearance.text ? 'application/vnd.microsoft.card.adaptive' : undefined,\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 ? { ...appearance.usageInfo, '@type': appearance.usageInfo['@type'] ?? 'CreativeWork' }\n : undefined,\n },\n });\n\n return this;\n }\n\n /**\n * Add a targeted message info entity for prompt preview.\n * Skips if already present.\n *\n * @param messageId the message ID of the targeted message\n */\n addTargetedMessageInfo(messageId: string) {\n if (this.entities) {\n this.entities = this.entities.filter((e) => e.type !== 'quotedReply');\n }\n\n if (this.type === 'message') {\n const msg = this as unknown as { text?: string };\n\n if (msg.text) {\n msg.text = msg.text.replace(`<quoted messageId=\"${messageId}\"/>`, '').trim();\n }\n }\n\n if (this.entities?.some((e) => e.type === 'targetedMessageInfo')) {\n return this;\n }\n\n return this.addEntity({\n type: 'targetedMessageInfo',\n messageId,\n });\n }\n\n /**\n * Determine whether the activity contains stream metadata.\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 messageEntity = this.entities?.find(\n (e) => this.isRootLevelMessageEntity(e)\n ) as MessageEntity | undefined;\n\n if (!messageEntity) {\n messageEntity = {\n type: 'https://schema.org/Message',\n '@type': 'Message',\n '@context': 'https://schema.org',\n '@id': '',\n };\n if (!this.entities) {\n this.entities = [];\n }\n this.entities.push(messageEntity);\n }\n\n return messageEntity;\n }\n\n private isRootLevelMessageEntity(entity: Entity): entity is MessageEntity {\n return entity.type === 'https://schema.org/Message' && entity['@type'] === 'Message';\n }\n\n private mergeRootLevelMessageEntity(target: MessageEntity, source: MessageEntity): MessageEntity {\n const merged: MessageEntity = {\n ...target,\n ...source,\n };\n\n if (target.additionalType || source.additionalType) {\n merged.additionalType = [\n ...new Set([...(target.additionalType || []), ...(source.additionalType || [])]),\n ];\n }\n\n if (target.citation || source.citation) {\n const dedupedCitations = new Map<number, NonNullable<typeof target.citation>[number]>();\n\n for (const citation of [...(target.citation || []), ...(source.citation || [])]) {\n dedupedCitations.set(citation.position, citation);\n }\n\n merged.citation = Array.from(dedupedCitations.values());\n }\n\n Object.assign(target, merged);\n return target;\n }\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 * @deprecated This will be removed by end of summer 2026.\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 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 /**\n * @deprecated This will be removed by end of summer 2026.\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 * Targeted messages are ephemeral to the specified recipient in a shared conversation.\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 * @deprecated Use ActivityInput/MessageActivityInput/TypingActivityInput when constructing outbound activities.\n */\n withRecipient(value: Account, isTargeted: boolean = false) {\n this.recipient = { ...value, isTargeted: isTargeted ? true : undefined };\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 /**\n * @deprecated Use ActivityInput/MessageActivityInput/TypingActivityInput when constructing outbound activities.\n */\n withChannelData(value: ChannelData) {\n const merged: ChannelData = { ...this.channelData, ...value };\n\n if (merged.feedbackLoop !== undefined) {\n merged.feedbackLoopEnabled = undefined;\n } else if (merged.feedbackLoopEnabled === true) {\n merged.feedbackLoop = { type: 'default' };\n merged.feedbackLoopEnabled = undefined;\n }\n\n this.channelData = merged;\n return this;\n }\n\n /**\n * Add an entity.\n */\n addEntity(value: Entity) {\n if (this.isRootLevelMessageEntity(value)) {\n this.mergeRootLevelMessageEntity(this.ensureSingleRootLevelMessageEntity(), value);\n return this;\n }\n\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 for (const entity of value) {\n this.addEntity(entity);\n }\n\n return this;\n }\n\n /**\n * Add the `Generated By AI` label.\n *\n * @deprecated Use ActivityInput/MessageActivityInput/TypingActivityInput when constructing outbound activities.\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 * @param mode - `'default'` shows Teams' built-in thumbs up/down UI.\n * `'custom'` triggers a `message/fetchTask` invoke so the bot can return its own task module dialog.\n *\n * @deprecated Use ActivityInput/MessageActivityInput/TypingActivityInput when constructing outbound activities.\n */\n addFeedback(mode: 'default' | 'custom' = 'default') {\n if (!this.channelData) {\n this.channelData = {};\n }\n\n this.channelData.feedbackLoop = { type: mode };\n this.channelData.feedbackLoopEnabled = undefined;\n return this;\n }\n\n /**\n * Add citations\n *\n * @deprecated Use ActivityInput/MessageActivityInput/TypingActivityInput when constructing outbound activities.\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: appearance.text ? 'application/vnd.microsoft.card.adaptive' : undefined,\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 ? { ...appearance.usageInfo, '@type': appearance.usageInfo['@type'] ?? 'CreativeWork' }\n : undefined,\n },\n });\n\n return this;\n }\n\n /**\n * Add a targeted message info entity for prompt preview.\n * Skips if already present. In reactive flows, `ctx.send()` and `ctx.reply()`\n * populate this automatically — use this helper for proactive or deferred sends.\n * An invalid or expired messageId causes the Teams service to silently drop the preview\n * while still delivering the message.\n *\n * @param messageId the message ID of the targeted message (from the incoming activity's `id`)\n *\n * @deprecated Use ActivityInput/MessageActivityInput/TypingActivityInput when constructing outbound activities.\n */\n addTargetedMessageInfo(messageId: string) {\n if (this.entities) {\n this.entities = this.entities.filter((e) => e.type !== 'quotedReply');\n }\n\n if (this.type === 'message') {\n const msg = this as unknown as { text?: string };\n\n if (msg.text) {\n msg.text = msg.text.replace(`<quoted messageId=\"${messageId}\"/>`, '').trim();\n }\n }\n\n if (this.entities?.some((e) => e.type === 'targetedMessageInfo')) {\n return this;\n }\n\n return this.addEntity({\n type: 'targetedMessageInfo',\n messageId,\n });\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 messageEntity = this.entities?.find(\n (e) => this.isRootLevelMessageEntity(e)\n ) as MessageEntity | undefined;\n\n if (!messageEntity) {\n messageEntity = {\n type: 'https://schema.org/Message',\n '@type': 'Message',\n '@context': 'https://schema.org',\n '@id': '',\n };\n if (!this.entities) {\n this.entities = [];\n }\n this.entities.push(messageEntity);\n }\n\n return messageEntity;\n }\n\n private isRootLevelMessageEntity(entity: Entity): entity is MessageEntity {\n return entity.type === 'https://schema.org/Message' && entity['@type'] === 'Message';\n }\n\n private mergeRootLevelMessageEntity(target: MessageEntity, source: MessageEntity): MessageEntity {\n const merged: MessageEntity = {\n ...target,\n ...source,\n };\n\n if (target.additionalType || source.additionalType) {\n merged.additionalType = [\n ...new Set([...(target.additionalType || []), ...(source.additionalType || [])]),\n ];\n }\n\n if (target.citation || source.citation) {\n const dedupedCitations = new Map<number, NonNullable<typeof target.citation>[number]>();\n\n for (const citation of [...(target.citation || []), ...(source.citation || [])]) {\n dedupedCitations.set(citation.position, citation);\n }\n\n merged.citation = Array.from(dedupedCitations.values());\n }\n\n Object.assign(target, merged);\n return target;\n }\n}\n"]}