1 | "use strict";
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 |
|
9 | Object.defineProperty(exports, "__esModule", { value: true });
|
10 |
|
11 |
|
12 |
|
13 | function teamsGetChannelId(activity) {
|
14 | if (!activity) {
|
15 | throw new Error('Missing activity parameter');
|
16 | }
|
17 | const channelData = activity.channelData;
|
18 | const channel = channelData ? channelData.channel : null;
|
19 | return channel && channel.id ? channel.id : null;
|
20 | }
|
21 | exports.teamsGetChannelId = teamsGetChannelId;
|
22 | function teamsGetTeamId(activity) {
|
23 | if (!activity) {
|
24 | throw new Error('Missing activity parameter');
|
25 | }
|
26 | const channelData = activity.channelData;
|
27 | const team = channelData ? channelData.team : null;
|
28 | return team && team.id ? team.id : null;
|
29 | }
|
30 | exports.teamsGetTeamId = teamsGetTeamId;
|
31 | function teamsNotifyUser(activity) {
|
32 | if (!activity) {
|
33 | throw new Error('Missing activity parameter');
|
34 | }
|
35 | if (!activity.channelData || typeof activity.channelData !== 'object') {
|
36 | activity.channelData = {};
|
37 | }
|
38 | const channelData = activity.channelData;
|
39 | channelData.notification = { alert: true };
|
40 | }
|
41 | exports.teamsNotifyUser = teamsNotifyUser;
|
42 |
|
\ | No newline at end of file |