Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions examples/message-extensions/src/card.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Account, Message, ThumbnailCard } from '@microsoft/teams.api';
import { Account, Message, TeamsChannelAccount, ThumbnailCard } from '@microsoft/teams.api';
import {
ActionSet,
AdaptiveCard,
Expand Down Expand Up @@ -108,7 +108,7 @@ export function createMessageDetailsCard(messagePayload: Message) {
return new AdaptiveCard(...cardElements);
}

export function createConversationMembersCard(members: Account[]) {
export function createConversationMembersCard(members: (Account | TeamsChannelAccount)[]) {
const membersList = members.map((member) => member.name).join(', ');

return new AdaptiveCard(
Expand Down Expand Up @@ -157,7 +157,7 @@ export async function createDummyCards(searchQuery: string) {
// When a user clicks on a list item in Teams:
// - If the thumbnail has a `tap` property: Teams will trigger the `message.ext.select-item` activity
// - If no `tap` property: Teams will insert the full adaptive card into the compose box
// tap: {
// tap: {
// type: "invoke",
// title: item.title,
// value: {
Expand Down
4 changes: 2 additions & 2 deletions packages/api/src/activities/event/meeting-participant-join.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Account } from '../../models';
import { TeamsChannelAccount } from '../../models';
import { IActivity } from '../activity';

export interface IMeetingParticipantJoinEventActivity extends IActivity<'event'> {
Expand All @@ -18,7 +18,7 @@ export interface IMeetingParticipantJoinEventActivity extends IActivity<'event'>
/**
* The participant account.
*/
user: Account;
user: TeamsChannelAccount;

/**
* The participants info.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Account } from '../../models';
import { TeamsChannelAccount } from '../../models';
import { IActivity } from '../activity';

export interface IMeetingParticipantLeaveEventActivity extends IActivity<'event'> {
Expand All @@ -18,7 +18,7 @@ export interface IMeetingParticipantLeaveEventActivity extends IActivity<'event'
/**
* The participant account.
*/
user: Account;
user: TeamsChannelAccount;

/**
* The participants info.
Expand Down
6 changes: 3 additions & 3 deletions packages/api/src/clients/conversation/member.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Client, ClientOptions } from '@microsoft/teams.common/http';

import { Account } from '../../models';
import { TeamsChannelAccount } from '../../models';
import { ApiClientSettings, mergeApiClientSettings } from '../api-client-settings';

export class ConversationMemberClient {
Expand Down Expand Up @@ -29,14 +29,14 @@ export class ConversationMemberClient {
}

async get(conversationId: string) {
const res = await this.http.get<Account[]>(
const res = await this.http.get<TeamsChannelAccount[]>(
`${this.serviceUrl}/v3/conversations/${conversationId}/members`
);
return res.data;
}

async getById(conversationId: string, id: string) {
const res = await this.http.get<Account>(
const res = await this.http.get<TeamsChannelAccount>(
`${this.serviceUrl}/v3/conversations/${conversationId}/members/${id}`
);
return res.data;
Expand Down
13 changes: 13 additions & 0 deletions packages/api/src/models/account.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,19 @@ export type Account<P = any> = {
readonly membershipSources?: MembershipSource[];
};

export type TeamsChannelAccount<P = any> = {
readonly id: string;
readonly name: string;
readonly objectId?: string;
readonly userRole: Role;
readonly givenName?: string;
readonly surname?: string;
readonly email?: string;
readonly userPrincipalName?: string;
readonly tenantId?: string;
readonly properties?: P;
};

export type ConversationAccount = {
readonly id: string;
readonly tenantId?: string;
Expand Down
4 changes: 2 additions & 2 deletions packages/api/src/models/meeting/meeting-info.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Account, ConversationAccount } from '../account';
import { ConversationAccount, TeamsChannelAccount } from '../account';

import { MeetingDetails } from './meeting-details';

Expand All @@ -25,5 +25,5 @@ export type MeetingInfo = {
/**
* @member {TeamsChannelAccount} [organizer] The organizer's user information.
*/
organizer?: Account;
organizer?: TeamsChannelAccount;
};
4 changes: 2 additions & 2 deletions packages/api/src/models/meeting/meeting-participant.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Account, ConversationAccount } from '../account';
import { ConversationAccount, TeamsChannelAccount } from '../account';

import { Meeting } from './meeting';

Expand All @@ -11,7 +11,7 @@ export type MeetingParticipant = {
/**
* @member {TeamsChannelAccount} [user] The user details
*/
user?: Account;
user?: TeamsChannelAccount;

/**
* @member {Meeting} [meeting] The meeting details.
Expand Down