@microsoft/agents-hosting-extensions-teams
Version:
Microsoft 365 Agents SDK for JavaScript. Teams extensions
343 lines (342 loc) • 11.2 kB
TypeScript
/**
* Copyright(c) Microsoft Corporation.All rights reserved.
* Licensed under the MIT License.
*/
import { z } from 'zod';
import { ChannelInfo } from './channelInfo';
import { NotificationInfo } from './notificationInfo';
import { OnBehalfOf } from './onBehalfOf';
import { TeamsChannelDataSettings } from './teamsChannelDataSettings';
import { TeamsMeetingInfo } from './teamsMeetingInfo';
import { TenantInfo } from './tenantInfo';
import { TeamInfo } from './teamInfo';
import { MembershipSource } from '@microsoft/agents-activity';
/**
* Represents data for a Teams channel.
*/
export interface TeamsChannelData {
/**
* Information about the channel.
*/
channel?: ChannelInfo;
/**
* The type of event.
*/
eventType?: string;
/**
* Information about the team.
*/
team?: TeamInfo;
/**
* Information about the notification.
*/
notification?: NotificationInfo;
/**
* Information about the tenant.
*/
tenant?: TenantInfo;
/**
* Information about the meeting.
*/
meeting?: TeamsMeetingInfo;
/**
* Settings for the Teams channel data.
*/
settings?: TeamsChannelDataSettings;
/**
* Information about the users on behalf of whom the action is performed.
*/
onBehalfOf?: OnBehalfOf[];
/**
* List of teams that a channel was shared with.
*/
sharedWithTeams?: TeamInfo[];
/**
* List of teams that a channel was unshared from.
*/
unsharedFromTeams?: TeamInfo[];
/**
* Information about the source of a member that was added or removed from a shared channel.
*/
membershipSource?: MembershipSource;
}
/**
* Zod schema for validating TeamsChannelData objects.
*/
export declare const teamsChannelDataZodSchema: z.ZodObject<{
channel: z.ZodOptional<z.ZodObject<{
id: z.ZodOptional<z.ZodString>;
name: z.ZodOptional<z.ZodString>;
type: z.ZodOptional<z.ZodEnum<["standard", "private", "shared"]>>;
}, "strip", z.ZodTypeAny, {
id?: string | undefined;
name?: string | undefined;
type?: "private" | "shared" | "standard" | undefined;
}, {
id?: string | undefined;
name?: string | undefined;
type?: "private" | "shared" | "standard" | undefined;
}>>;
eventType: z.ZodOptional<z.ZodString>;
team: z.ZodOptional<z.ZodObject<{
id: z.ZodOptional<z.ZodString>;
name: z.ZodOptional<z.ZodString>;
aadGroupId: z.ZodOptional<z.ZodString>;
tenantId: z.ZodOptional<z.ZodString>;
}, "strip", z.ZodTypeAny, {
id?: string | undefined;
name?: string | undefined;
aadGroupId?: string | undefined;
tenantId?: string | undefined;
}, {
id?: string | undefined;
name?: string | undefined;
aadGroupId?: string | undefined;
tenantId?: string | undefined;
}>>;
notification: z.ZodOptional<z.ZodObject<{
alert: z.ZodOptional<z.ZodBoolean>;
alertInMeeting: z.ZodOptional<z.ZodBoolean>;
externalResourceUrl: z.ZodOptional<z.ZodString>;
}, "strip", z.ZodTypeAny, {
alert?: boolean | undefined;
alertInMeeting?: boolean | undefined;
externalResourceUrl?: string | undefined;
}, {
alert?: boolean | undefined;
alertInMeeting?: boolean | undefined;
externalResourceUrl?: string | undefined;
}>>;
tenant: z.ZodOptional<z.ZodObject<{
id: z.ZodOptional<z.ZodString>;
}, "strip", z.ZodTypeAny, {
id?: string | undefined;
}, {
id?: string | undefined;
}>>;
meeting: z.ZodOptional<z.ZodObject<{
id: z.ZodOptional<z.ZodString>;
}, "strip", z.ZodTypeAny, {
id?: string | undefined;
}, {
id?: string | undefined;
}>>;
settings: z.ZodOptional<z.ZodObject<{
selectedChannel: z.ZodOptional<z.ZodObject<{
id: z.ZodOptional<z.ZodString>;
name: z.ZodOptional<z.ZodString>;
type: z.ZodOptional<z.ZodEnum<["standard", "private", "shared"]>>;
}, "strip", z.ZodTypeAny, {
id?: string | undefined;
name?: string | undefined;
type?: "private" | "shared" | "standard" | undefined;
}, {
id?: string | undefined;
name?: string | undefined;
type?: "private" | "shared" | "standard" | undefined;
}>>;
}, "strip", z.ZodTypeAny, {
selectedChannel?: {
id?: string | undefined;
name?: string | undefined;
type?: "private" | "shared" | "standard" | undefined;
} | undefined;
}, {
selectedChannel?: {
id?: string | undefined;
name?: string | undefined;
type?: "private" | "shared" | "standard" | undefined;
} | undefined;
}>>;
onBehalfOf: z.ZodOptional<z.ZodArray<z.ZodObject<{
itemid: z.ZodUnion<[z.ZodLiteral<0>, z.ZodNumber]>;
mentionType: z.ZodUnion<[z.ZodString, z.ZodLiteral<"person">]>;
mri: z.ZodString;
displayName: z.ZodOptional<z.ZodString>;
}, "strip", z.ZodTypeAny, {
itemid: number;
mentionType: string;
mri: string;
displayName?: string | undefined;
}, {
itemid: number;
mentionType: string;
mri: string;
displayName?: string | undefined;
}>, "many">>;
sharedWithTeams: z.ZodOptional<z.ZodArray<z.ZodObject<{
id: z.ZodOptional<z.ZodString>;
name: z.ZodOptional<z.ZodString>;
aadGroupId: z.ZodOptional<z.ZodString>;
tenantId: z.ZodOptional<z.ZodString>;
}, "strip", z.ZodTypeAny, {
id?: string | undefined;
name?: string | undefined;
aadGroupId?: string | undefined;
tenantId?: string | undefined;
}, {
id?: string | undefined;
name?: string | undefined;
aadGroupId?: string | undefined;
tenantId?: string | undefined;
}>, "many">>;
unsharedFromTeams: z.ZodOptional<z.ZodArray<z.ZodObject<{
id: z.ZodOptional<z.ZodString>;
name: z.ZodOptional<z.ZodString>;
aadGroupId: z.ZodOptional<z.ZodString>;
tenantId: z.ZodOptional<z.ZodString>;
}, "strip", z.ZodTypeAny, {
id?: string | undefined;
name?: string | undefined;
aadGroupId?: string | undefined;
tenantId?: string | undefined;
}, {
id?: string | undefined;
name?: string | undefined;
aadGroupId?: string | undefined;
tenantId?: string | undefined;
}>, "many">>;
membershipSource: z.ZodOptional<z.ZodObject<{
sourceType: z.ZodEnum<["channel", "team"]>;
id: z.ZodString;
name: z.ZodOptional<z.ZodString>;
membershipType: z.ZodEnum<["direct", "transitive"]>;
aadGroupId: z.ZodOptional<z.ZodString>;
tenantId: z.ZodOptional<z.ZodString>;
}, "strip", z.ZodTypeAny, {
id: string;
sourceType: "channel" | "team";
membershipType: "direct" | "transitive";
name?: string | undefined;
aadGroupId?: string | undefined;
tenantId?: string | undefined;
}, {
id: string;
sourceType: "channel" | "team";
membershipType: "direct" | "transitive";
name?: string | undefined;
aadGroupId?: string | undefined;
tenantId?: string | undefined;
}>>;
}, "strip", z.ZodTypeAny, {
channel?: {
id?: string | undefined;
name?: string | undefined;
type?: "private" | "shared" | "standard" | undefined;
} | undefined;
team?: {
id?: string | undefined;
name?: string | undefined;
aadGroupId?: string | undefined;
tenantId?: string | undefined;
} | undefined;
eventType?: string | undefined;
notification?: {
alert?: boolean | undefined;
alertInMeeting?: boolean | undefined;
externalResourceUrl?: string | undefined;
} | undefined;
tenant?: {
id?: string | undefined;
} | undefined;
meeting?: {
id?: string | undefined;
} | undefined;
settings?: {
selectedChannel?: {
id?: string | undefined;
name?: string | undefined;
type?: "private" | "shared" | "standard" | undefined;
} | undefined;
} | undefined;
onBehalfOf?: {
itemid: number;
mentionType: string;
mri: string;
displayName?: string | undefined;
}[] | undefined;
sharedWithTeams?: {
id?: string | undefined;
name?: string | undefined;
aadGroupId?: string | undefined;
tenantId?: string | undefined;
}[] | undefined;
unsharedFromTeams?: {
id?: string | undefined;
name?: string | undefined;
aadGroupId?: string | undefined;
tenantId?: string | undefined;
}[] | undefined;
membershipSource?: {
id: string;
sourceType: "channel" | "team";
membershipType: "direct" | "transitive";
name?: string | undefined;
aadGroupId?: string | undefined;
tenantId?: string | undefined;
} | undefined;
}, {
channel?: {
id?: string | undefined;
name?: string | undefined;
type?: "private" | "shared" | "standard" | undefined;
} | undefined;
team?: {
id?: string | undefined;
name?: string | undefined;
aadGroupId?: string | undefined;
tenantId?: string | undefined;
} | undefined;
eventType?: string | undefined;
notification?: {
alert?: boolean | undefined;
alertInMeeting?: boolean | undefined;
externalResourceUrl?: string | undefined;
} | undefined;
tenant?: {
id?: string | undefined;
} | undefined;
meeting?: {
id?: string | undefined;
} | undefined;
settings?: {
selectedChannel?: {
id?: string | undefined;
name?: string | undefined;
type?: "private" | "shared" | "standard" | undefined;
} | undefined;
} | undefined;
onBehalfOf?: {
itemid: number;
mentionType: string;
mri: string;
displayName?: string | undefined;
}[] | undefined;
sharedWithTeams?: {
id?: string | undefined;
name?: string | undefined;
aadGroupId?: string | undefined;
tenantId?: string | undefined;
}[] | undefined;
unsharedFromTeams?: {
id?: string | undefined;
name?: string | undefined;
aadGroupId?: string | undefined;
tenantId?: string | undefined;
}[] | undefined;
membershipSource?: {
id: string;
sourceType: "channel" | "team";
membershipType: "direct" | "transitive";
name?: string | undefined;
aadGroupId?: string | undefined;
tenantId?: string | undefined;
} | undefined;
}>;
/**
* Parses the given object as TeamsChannelData.
*
* @param {object} o - The object to parse.
* @returns {TeamsChannelData} - The parsed TeamsChannelData.
*/
export declare function parseTeamsChannelData(o: object): TeamsChannelData;