@pnp/cli-microsoft365 5.1.0-beta.55e5dfb → 5.1.0-beta.6ab68db
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.
- package/dist/cli/index.js +5 -1
- package/dist/m365/aad/commands/o365group/o365group-add.js +39 -1
- package/dist/m365/aad/commands/o365group/o365group-conversation-post-list.js +87 -0
- package/dist/m365/aad/commands.js +1 -0
- package/dist/m365/spfx/commands/project/model/index.js +5 -1
- package/dist/m365/spfx/commands/project/project-externalize/index.js +5 -1
- package/dist/m365/spfx/commands/project/project-externalize/rules/index.js +5 -1
- package/dist/m365/spfx/commands/project/project-upgrade/index.js +5 -1
- package/dist/m365/teams/commands/chat/chat-message-send.js +50 -58
- package/dist/utils/index.js +5 -1
- package/docs/docs/cmd/aad/o365group/o365group-add.md +42 -6
- package/docs/docs/cmd/aad/o365group/o365group-conversation-post-list.md +36 -0
- package/docs/docs/cmd/teams/chat/chat-message-send.md +4 -4
- package/npm-shrinkwrap.json +173 -188
- package/package.json +10 -10
package/dist/cli/index.js
CHANGED
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
3
|
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
5
9
|
}) : (function(o, m, k, k2) {
|
|
6
10
|
if (k2 === undefined) k2 = k;
|
|
7
11
|
o[k2] = m[k];
|
|
@@ -11,15 +11,40 @@ class AadO365GroupAddCommand extends GraphCommand_1.default {
|
|
|
11
11
|
return commands_1.default.O365GROUP_ADD;
|
|
12
12
|
}
|
|
13
13
|
get description() {
|
|
14
|
-
return 'Creates Microsoft 365 Group';
|
|
14
|
+
return 'Creates a Microsoft 365 Group';
|
|
15
|
+
}
|
|
16
|
+
getTelemetryProperties(args) {
|
|
17
|
+
const telemetryProps = super.getTelemetryProperties(args);
|
|
18
|
+
telemetryProps.owners = typeof args.options.owners !== 'undefined';
|
|
19
|
+
telemetryProps.members = typeof args.options.members !== 'undefined';
|
|
20
|
+
telemetryProps.logoPath = typeof args.options.logoPath !== 'undefined';
|
|
21
|
+
telemetryProps.isPrivate = typeof args.options.isPrivate !== 'undefined';
|
|
22
|
+
telemetryProps.allowMembersToPost = (!(!args.options.allowMembersToPost)).toString();
|
|
23
|
+
telemetryProps.hideGroupInOutlook = (!(!args.options.hideGroupInOutlook)).toString();
|
|
24
|
+
telemetryProps.subscribeNewGroupMembers = (!(!args.options.subscribeNewGroupMembers)).toString();
|
|
25
|
+
telemetryProps.welcomeEmailDisabled = (!(!args.options.welcomeEmailDisabled)).toString();
|
|
26
|
+
return telemetryProps;
|
|
15
27
|
}
|
|
16
28
|
commandAction(logger, args, cb) {
|
|
17
29
|
let group;
|
|
18
30
|
let ownerIds = [];
|
|
19
31
|
let memberIds = [];
|
|
32
|
+
const resourceBehaviorOptionsCollection = [];
|
|
20
33
|
if (this.verbose) {
|
|
21
34
|
logger.logToStderr(`Creating Microsoft 365 Group...`);
|
|
22
35
|
}
|
|
36
|
+
if (args.options.allowMembersToPost) {
|
|
37
|
+
resourceBehaviorOptionsCollection.push("allowMembersToPost");
|
|
38
|
+
}
|
|
39
|
+
if (args.options.hideGroupInOutlook) {
|
|
40
|
+
resourceBehaviorOptionsCollection.push("hideGroupInOutlook");
|
|
41
|
+
}
|
|
42
|
+
if (args.options.subscribeNewGroupMembers) {
|
|
43
|
+
resourceBehaviorOptionsCollection.push("subscribeNewGroupMembers");
|
|
44
|
+
}
|
|
45
|
+
if (args.options.welcomeEmailDisabled) {
|
|
46
|
+
resourceBehaviorOptionsCollection.push("welcomeEmailDisabled");
|
|
47
|
+
}
|
|
23
48
|
const requestOptions = {
|
|
24
49
|
url: `${this.resource}/v1.0/groups`,
|
|
25
50
|
headers: {
|
|
@@ -34,6 +59,7 @@ class AadO365GroupAddCommand extends GraphCommand_1.default {
|
|
|
34
59
|
],
|
|
35
60
|
mailEnabled: true,
|
|
36
61
|
mailNickname: args.options.mailNickname,
|
|
62
|
+
resourceBehaviorOptions: resourceBehaviorOptionsCollection,
|
|
37
63
|
securityEnabled: false,
|
|
38
64
|
visibility: args.options.isPrivate === 'true' ? 'Private' : 'Public'
|
|
39
65
|
}
|
|
@@ -186,6 +212,18 @@ class AadO365GroupAddCommand extends GraphCommand_1.default {
|
|
|
186
212
|
{
|
|
187
213
|
option: '--isPrivate [isPrivate]'
|
|
188
214
|
},
|
|
215
|
+
{
|
|
216
|
+
option: '--allowMembersToPost [allowMembersToPost]'
|
|
217
|
+
},
|
|
218
|
+
{
|
|
219
|
+
option: '--hideGroupInOutlook [hideGroupInOutlook]'
|
|
220
|
+
},
|
|
221
|
+
{
|
|
222
|
+
option: '--subscribeNewGroupMembers [subscribeNewGroupMembers]'
|
|
223
|
+
},
|
|
224
|
+
{
|
|
225
|
+
option: '--welcomeEmailDisabled [welcomeEmailDisabled]'
|
|
226
|
+
},
|
|
189
227
|
{
|
|
190
228
|
option: '-l, --logoPath [logoPath]'
|
|
191
229
|
}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const utils_1 = require("../../../../utils");
|
|
4
|
+
const GraphCommand_1 = require("../../../base/GraphCommand");
|
|
5
|
+
const commands_1 = require("../../commands");
|
|
6
|
+
const request_1 = require("../../../../request");
|
|
7
|
+
class AadO365GroupConversationPostListCommand extends GraphCommand_1.default {
|
|
8
|
+
get name() {
|
|
9
|
+
return commands_1.default.O365GROUP_CONVERSATION_POST_LIST;
|
|
10
|
+
}
|
|
11
|
+
get description() {
|
|
12
|
+
return 'Lists conversation posts of a Microsoft 365 group';
|
|
13
|
+
}
|
|
14
|
+
getTelemetryProperties(args) {
|
|
15
|
+
const telemetryProps = super.getTelemetryProperties(args);
|
|
16
|
+
telemetryProps.groupId = typeof args.options.groupId !== 'undefined';
|
|
17
|
+
telemetryProps.groupDisplayName = typeof args.options.groupDisplayName !== 'undefined';
|
|
18
|
+
return telemetryProps;
|
|
19
|
+
}
|
|
20
|
+
defaultProperties() {
|
|
21
|
+
return ['receivedDateTime', 'id'];
|
|
22
|
+
}
|
|
23
|
+
commandAction(logger, args, cb) {
|
|
24
|
+
this
|
|
25
|
+
.getGroupId(args)
|
|
26
|
+
.then((retrievedgroupId) => {
|
|
27
|
+
return utils_1.odata.getAllItems(`${this.resource}/v1.0/groups/${retrievedgroupId}/threads/${args.options.threadId}/posts`, logger);
|
|
28
|
+
})
|
|
29
|
+
.then((posts) => {
|
|
30
|
+
logger.log(posts);
|
|
31
|
+
cb();
|
|
32
|
+
}, (err) => this.handleRejectedODataJsonPromise(err, logger, cb));
|
|
33
|
+
}
|
|
34
|
+
getGroupId(args) {
|
|
35
|
+
if (args.options.groupId) {
|
|
36
|
+
return Promise.resolve(encodeURIComponent(args.options.groupId));
|
|
37
|
+
}
|
|
38
|
+
const requestOptions = {
|
|
39
|
+
url: `${this.resource}/v1.0/groups?$filter=displayName eq '${encodeURIComponent(args.options.groupDisplayName)}'&$select=id`,
|
|
40
|
+
headers: {
|
|
41
|
+
accept: 'application/json;odata.metadata=none'
|
|
42
|
+
},
|
|
43
|
+
responseType: 'json'
|
|
44
|
+
};
|
|
45
|
+
return request_1.default
|
|
46
|
+
.get(requestOptions)
|
|
47
|
+
.then(res => {
|
|
48
|
+
if (res.value.length === 1) {
|
|
49
|
+
return Promise.resolve(res.value[0].id);
|
|
50
|
+
}
|
|
51
|
+
if (res.value.length === 0) {
|
|
52
|
+
return Promise.reject(`The specified group does not exist`);
|
|
53
|
+
}
|
|
54
|
+
return Promise.reject(`Multiple groups found with name ${args.options.groupDisplayName} found. Please choose between the following IDs: ${res.value.map(a => a.id).join(', ')}`);
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
options() {
|
|
58
|
+
const options = [
|
|
59
|
+
{
|
|
60
|
+
option: '-i, --groupId [groupId]'
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
option: '-d, --groupDisplayName [groupDisplayName]'
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
option: '-t, --threadId <threadId>'
|
|
67
|
+
}
|
|
68
|
+
];
|
|
69
|
+
const parentOptions = super.options();
|
|
70
|
+
return options.concat(parentOptions);
|
|
71
|
+
}
|
|
72
|
+
validate(args) {
|
|
73
|
+
if (!args.options.groupId &&
|
|
74
|
+
!args.options.groupDisplayName) {
|
|
75
|
+
return 'Specify either groupId or groupDisplayName';
|
|
76
|
+
}
|
|
77
|
+
if (args.options.groupId && args.options.groupDisplayName) {
|
|
78
|
+
return 'Specify either groupId or groupDisplayName, but not both';
|
|
79
|
+
}
|
|
80
|
+
if (args.options.groupId && !utils_1.validation.isValidGuid(args.options.groupId)) {
|
|
81
|
+
return `${args.options.groupId} is not a valid GUID`;
|
|
82
|
+
}
|
|
83
|
+
return true;
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
module.exports = new AadO365GroupConversationPostListCommand();
|
|
87
|
+
//# sourceMappingURL=o365group-conversation-post-list.js.map
|
|
@@ -24,6 +24,7 @@ exports.default = {
|
|
|
24
24
|
O365GROUP_GET: `${prefix} o365group get`,
|
|
25
25
|
O365GROUP_LIST: `${prefix} o365group list`,
|
|
26
26
|
O365GROUP_CONVERSATION_LIST: `${prefix} o365group conversation list`,
|
|
27
|
+
O365GROUP_CONVERSATION_POST_LIST: `${prefix} o365group conversation post list`,
|
|
27
28
|
O365GROUP_RECYCLEBINITEM_CLEAR: `${prefix} o365group recyclebinitem clear`,
|
|
28
29
|
O365GROUP_RECYCLEBINITEM_LIST: `${prefix} o365group recyclebinitem list`,
|
|
29
30
|
O365GROUP_RECYCLEBINITEM_RESTORE: `${prefix} o365group recyclebinitem restore`,
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
3
|
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
5
9
|
}) : (function(o, m, k, k2) {
|
|
6
10
|
if (k2 === undefined) k2 = k;
|
|
7
11
|
o[k2] = m[k];
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
3
|
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
5
9
|
}) : (function(o, m, k, k2) {
|
|
6
10
|
if (k2 === undefined) k2 = k;
|
|
7
11
|
o[k2] = m[k];
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
3
|
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
5
9
|
}) : (function(o, m, k, k2) {
|
|
6
10
|
if (k2 === undefined) k2 = k;
|
|
7
11
|
o[k2] = m[k];
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
3
|
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
5
9
|
}) : (function(o, m, k, k2) {
|
|
6
10
|
if (k2 === undefined) k2 = k;
|
|
7
11
|
o[k2] = m[k];
|
|
@@ -20,21 +20,22 @@ class TeamsChatMessageSendCommand extends GraphCommand_1.default {
|
|
|
20
20
|
return commands_1.default.CHAT_MESSAGE_SEND;
|
|
21
21
|
}
|
|
22
22
|
get description() {
|
|
23
|
-
return '
|
|
23
|
+
return 'Sends a chat message to a Microsoft Teams chat conversation.';
|
|
24
|
+
}
|
|
25
|
+
getTelemetryProperties(args) {
|
|
26
|
+
const telemetryProps = super.getTelemetryProperties(args);
|
|
27
|
+
telemetryProps.chatId = typeof args.options.chatId !== 'undefined';
|
|
28
|
+
telemetryProps.userEmails = typeof args.options.userEmails !== 'undefined';
|
|
29
|
+
telemetryProps.chatName = typeof args.options.chatName !== 'undefined';
|
|
30
|
+
return telemetryProps;
|
|
24
31
|
}
|
|
25
32
|
commandAction(logger, args, cb) {
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
cb();
|
|
33
|
-
}
|
|
34
|
-
catch (error) {
|
|
35
|
-
this.handleRejectedODataJsonPromise(error, logger, cb);
|
|
36
|
-
}
|
|
37
|
-
});
|
|
33
|
+
this
|
|
34
|
+
.getChatId(logger, args)
|
|
35
|
+
.then(chatId => this.sendChatMessage(chatId, args))
|
|
36
|
+
.then(_ => {
|
|
37
|
+
cb();
|
|
38
|
+
}, (err) => this.handleRejectedODataJsonPromise(err, logger, cb));
|
|
38
39
|
}
|
|
39
40
|
options() {
|
|
40
41
|
const options = [
|
|
@@ -78,36 +79,44 @@ class TeamsChatMessageSendCommand extends GraphCommand_1.default {
|
|
|
78
79
|
return `${args.options.chatId} is not a valid Teams ChatId.`;
|
|
79
80
|
}
|
|
80
81
|
if (args.options.userEmails) {
|
|
81
|
-
const userEmails = args.options.userEmails
|
|
82
|
+
const userEmails = this.convertCommaSeparatedListToArray(args.options.userEmails);
|
|
82
83
|
if (!userEmails || userEmails.length === 0 || userEmails.some(e => !utils_1.validation.isValidUserPrincipalName(e))) {
|
|
83
84
|
return `${args.options.userEmails} contains one or more invalid email addresses.`;
|
|
84
85
|
}
|
|
85
86
|
}
|
|
86
87
|
return true;
|
|
87
88
|
}
|
|
88
|
-
|
|
89
|
+
getChatId(logger, args) {
|
|
89
90
|
return __awaiter(this, void 0, void 0, function* () {
|
|
90
|
-
|
|
91
|
+
if (args.options.chatId) {
|
|
92
|
+
return args.options.chatId;
|
|
93
|
+
}
|
|
94
|
+
return args.options.userEmails
|
|
95
|
+
? this.ensureChatIdByUserEmails(args.options.userEmails, logger)
|
|
96
|
+
: this.getChatIdByName(args.options.chatName, logger);
|
|
97
|
+
});
|
|
98
|
+
}
|
|
99
|
+
ensureChatIdByUserEmails(userEmailsOption, logger) {
|
|
100
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
101
|
+
const userEmails = this.convertCommaSeparatedListToArray(userEmailsOption);
|
|
91
102
|
const currentUserEmail = utils_1.accessToken.getUserNameFromAccessToken(Auth_1.default.service.accessTokens[this.resource].accessToken).toLowerCase();
|
|
92
|
-
const existingChats = yield this.findExistingGroupChatsByMembers([currentUserEmail, ...userEmails]);
|
|
93
|
-
if (existingChats
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
return `- ${c.id}${c.topic && ' - '}${c.topic} - ${c.createdDateTime && new Date(c.createdDateTime).toLocaleString()}`;
|
|
97
|
-
}).join(os.EOL);
|
|
98
|
-
throw new Error(`Multiple chat conversations with this topic found. Please disambiguate:${os.EOL}${disambiguationText}`);
|
|
99
|
-
}
|
|
100
|
-
else {
|
|
101
|
-
return existingChats[0].id;
|
|
102
|
-
}
|
|
103
|
+
const existingChats = yield this.findExistingGroupChatsByMembers([currentUserEmail, ...userEmails], logger);
|
|
104
|
+
if (!existingChats || existingChats.length === 0) {
|
|
105
|
+
const chat = yield this.createConversation([currentUserEmail, ...userEmails]);
|
|
106
|
+
return chat.id;
|
|
103
107
|
}
|
|
104
|
-
|
|
105
|
-
|
|
108
|
+
if (existingChats.length === 1) {
|
|
109
|
+
return existingChats[0].id;
|
|
110
|
+
}
|
|
111
|
+
const disambiguationText = existingChats.map(c => {
|
|
112
|
+
return `- ${c.id}${c.topic && ' - '}${c.topic} - ${c.createdDateTime && new Date(c.createdDateTime).toLocaleString()}`;
|
|
113
|
+
}).join(os.EOL);
|
|
114
|
+
throw new Error(`Multiple chat conversations with this name found. Please disambiguate:${os.EOL}${disambiguationText}`);
|
|
106
115
|
});
|
|
107
116
|
}
|
|
108
|
-
getChatIdByName(chatName) {
|
|
117
|
+
getChatIdByName(chatName, logger) {
|
|
109
118
|
return __awaiter(this, void 0, void 0, function* () {
|
|
110
|
-
const existingChats = yield this.
|
|
119
|
+
const existingChats = yield this.findExistingGroupChatsByName(chatName, logger);
|
|
111
120
|
if (!existingChats || existingChats.length === 0) {
|
|
112
121
|
throw new Error('No chat conversation was found with this name.');
|
|
113
122
|
}
|
|
@@ -118,7 +127,7 @@ class TeamsChatMessageSendCommand extends GraphCommand_1.default {
|
|
|
118
127
|
const memberstring = c.members.map(m => m.email).join(', ');
|
|
119
128
|
return `- ${c.id} - ${c.createdDateTime && new Date(c.createdDateTime).toLocaleString()} - ${memberstring}`;
|
|
120
129
|
}).join(os.EOL);
|
|
121
|
-
throw new Error(`Multiple chat conversations with this
|
|
130
|
+
throw new Error(`Multiple chat conversations with this name found. Please disambiguate:${os.EOL}${disambiguationText}`);
|
|
122
131
|
});
|
|
123
132
|
}
|
|
124
133
|
// This Microsoft Graph API request throws an intermittent 404 exception, saying that it cannot find the principal.
|
|
@@ -159,7 +168,7 @@ class TeamsChatMessageSendCommand extends GraphCommand_1.default {
|
|
|
159
168
|
}
|
|
160
169
|
});
|
|
161
170
|
}
|
|
162
|
-
sendChatMessage(chatId,
|
|
171
|
+
sendChatMessage(chatId, args) {
|
|
163
172
|
return __awaiter(this, void 0, void 0, function* () {
|
|
164
173
|
const requestOptions = {
|
|
165
174
|
url: `${this.resource}/v1.0/chats/${chatId}/messages`,
|
|
@@ -170,18 +179,18 @@ class TeamsChatMessageSendCommand extends GraphCommand_1.default {
|
|
|
170
179
|
responseType: 'json',
|
|
171
180
|
data: {
|
|
172
181
|
body: {
|
|
173
|
-
content: options.message
|
|
182
|
+
content: args.options.message
|
|
174
183
|
}
|
|
175
184
|
}
|
|
176
185
|
};
|
|
177
186
|
yield request_1.default.post(requestOptions);
|
|
178
187
|
});
|
|
179
188
|
}
|
|
180
|
-
findExistingGroupChatsByMembers(expectedMemberEmails) {
|
|
189
|
+
findExistingGroupChatsByMembers(expectedMemberEmails, logger) {
|
|
181
190
|
return __awaiter(this, void 0, void 0, function* () {
|
|
182
191
|
const endpoint = `${this.resource}/v1.0/chats?$filter=chatType eq 'group'&$expand=members&$select=id,topic,createdDateTime,members`;
|
|
183
192
|
const foundChats = [];
|
|
184
|
-
const chats = yield
|
|
193
|
+
const chats = yield utils_1.odata.getAllItems(endpoint, logger);
|
|
185
194
|
for (const chat of chats) {
|
|
186
195
|
const chatMembers = chat.members;
|
|
187
196
|
if (chatMembers.length === expectedMemberEmails.length) {
|
|
@@ -194,31 +203,14 @@ class TeamsChatMessageSendCommand extends GraphCommand_1.default {
|
|
|
194
203
|
return foundChats;
|
|
195
204
|
});
|
|
196
205
|
}
|
|
197
|
-
|
|
206
|
+
findExistingGroupChatsByName(name, logger) {
|
|
198
207
|
return __awaiter(this, void 0, void 0, function* () {
|
|
199
|
-
const endpoint = `${this.resource}/v1.0/chats?$filter=topic eq '${encodeURIComponent(
|
|
200
|
-
|
|
201
|
-
return chats;
|
|
208
|
+
const endpoint = `${this.resource}/v1.0/chats?$filter=topic eq '${encodeURIComponent(name)}'&$expand=members&$select=id,topic,createdDateTime,chatType`;
|
|
209
|
+
return utils_1.odata.getAllItems(endpoint, logger);
|
|
202
210
|
});
|
|
203
211
|
}
|
|
204
|
-
|
|
205
|
-
return
|
|
206
|
-
const requestOptions = {
|
|
207
|
-
url: url,
|
|
208
|
-
headers: {
|
|
209
|
-
accept: 'application/json;odata.metadata=none'
|
|
210
|
-
},
|
|
211
|
-
responseType: 'json'
|
|
212
|
-
};
|
|
213
|
-
const res = yield request_1.default.get(requestOptions);
|
|
214
|
-
items = items.concat(res.value);
|
|
215
|
-
if (res['@odata.nextLink']) {
|
|
216
|
-
return yield this.getAllChats(res['@odata.nextLink'], items);
|
|
217
|
-
}
|
|
218
|
-
else {
|
|
219
|
-
return items;
|
|
220
|
-
}
|
|
221
|
-
});
|
|
212
|
+
convertCommaSeparatedListToArray(userEmailsString) {
|
|
213
|
+
return userEmailsString.toLowerCase().replace(/\s/g, '').split(',').filter(e => e && e !== '');
|
|
222
214
|
}
|
|
223
215
|
}
|
|
224
216
|
module.exports = new TeamsChatMessageSendCommand();
|
package/dist/utils/index.js
CHANGED
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
3
|
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
5
9
|
}) : (function(o, m, k, k2) {
|
|
6
10
|
if (k2 === undefined) k2 = k;
|
|
7
11
|
o[k2] = m[k];
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# aad o365group add
|
|
2
2
|
|
|
3
|
-
Creates Microsoft 365 Group
|
|
3
|
+
Creates a Microsoft 365 Group
|
|
4
4
|
|
|
5
5
|
## Usage
|
|
6
6
|
|
|
@@ -28,6 +28,18 @@ m365 aad o365group add [options]
|
|
|
28
28
|
`--isPrivate [isPrivate]`
|
|
29
29
|
: Set to `true` if the Microsoft 365 Group should be private and to `false` if it should be public (default)
|
|
30
30
|
|
|
31
|
+
`--allowMembersToPost [allowMembersToPost]`
|
|
32
|
+
: Set if only group members should be able to post conversations to the group
|
|
33
|
+
|
|
34
|
+
`--hideGroupInOutlook [hideGroupInOutlook]`
|
|
35
|
+
: Set to hide the group in Outlook experiences
|
|
36
|
+
|
|
37
|
+
`--subscribeNewGroupMembers [subscribeNewGroupMembers]`
|
|
38
|
+
: Set to subscribe all new group members to receive group conversation emails when new messages are posted in the group
|
|
39
|
+
|
|
40
|
+
`--welcomeEmailDisabled [welcomeEmailDisabled]`
|
|
41
|
+
: Set to not send welcome emails to new group members
|
|
42
|
+
|
|
31
43
|
`-l, --logoPath [logoPath]`
|
|
32
44
|
: Local path to the image file to use as group logo
|
|
33
45
|
|
|
@@ -43,29 +55,53 @@ If an invalid user is provided in the comma-separated list or Owners or Members,
|
|
|
43
55
|
Create a public Microsoft 365 Group
|
|
44
56
|
|
|
45
57
|
```sh
|
|
46
|
-
m365 aad o365group add --displayName Finance --description
|
|
58
|
+
m365 aad o365group add --displayName Finance --description "This is the Contoso Finance Group. Please come here and check out the latest news, posts, files, and more." --mailNickname finance
|
|
47
59
|
```
|
|
48
60
|
|
|
49
61
|
Create a private Microsoft 365 Group
|
|
50
62
|
|
|
51
63
|
```sh
|
|
52
|
-
m365 aad o365group add --displayName Finance --description
|
|
64
|
+
m365 aad o365group add --displayName Finance --description "This is the Contoso Finance Group. Please come here and check out the latest news, posts, files, and more." --mailNickname finance --isPrivate true
|
|
53
65
|
```
|
|
54
66
|
|
|
55
67
|
Create a public Microsoft 365 Group and set specified users as its owners
|
|
56
68
|
|
|
57
69
|
```sh
|
|
58
|
-
m365 aad o365group add --displayName Finance --description
|
|
70
|
+
m365 aad o365group add --displayName Finance --description "This is the Contoso Finance Group. Please come here and check out the latest news, posts, files, and more." --mailNickname finance --owners "DebraB@contoso.onmicrosoft.com,DiegoS@contoso.onmicrosoft.com"
|
|
59
71
|
```
|
|
60
72
|
|
|
61
73
|
Create a public Microsoft 365 Group and set specified users as its members
|
|
62
74
|
|
|
63
75
|
```sh
|
|
64
|
-
m365 aad o365group add --displayName Finance --description
|
|
76
|
+
m365 aad o365group add --displayName Finance --description "This is the Contoso Finance Group. Please come here and check out the latest news, posts, files, and more." --mailNickname finance --members "DebraB@contoso.onmicrosoft.com,DiegoS@contoso.onmicrosoft.com"
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
Create a public Microsoft 365 Group and allows only group members to be able to post conversations to the group.
|
|
80
|
+
|
|
81
|
+
```sh
|
|
82
|
+
m365 aad o365group add --displayName Finance --description "This is the Contoso Finance Group. Please come here and check out the latest news, posts, files, and more." --mailNickname finance --allowMembersToPost
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
Create a public Microsoft 365 Group and hides it from the Outlook experiences (web and client).
|
|
86
|
+
|
|
87
|
+
```sh
|
|
88
|
+
m365 aad o365group add --displayName Finance --description "This is the Contoso Finance Group. Please come here and check out the latest news, posts, files, and more." --mailNickname finance --hideGroupInOutlook
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
Create a public Microsoft 365 Group and subscribe all new group members to receive group conversation emails when new messages are posted in the group.
|
|
92
|
+
|
|
93
|
+
```sh
|
|
94
|
+
m365 aad o365group add --displayName Finance --description "This is the Contoso Finance Group. Please come here and check out the latest news, posts, files, and more." --mailNickname finance --subscribeNewGroupMembers
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
Create a public Microsoft 365 Group and set to not send welcome emails to new group members.
|
|
98
|
+
|
|
99
|
+
```sh
|
|
100
|
+
m365 aad o365group add --displayName Finance --description "This is the Contoso Finance Group. Please come here and check out the latest news, posts, files, and more." --mailNickname finance --welcomeEmailDisabled
|
|
65
101
|
```
|
|
66
102
|
|
|
67
103
|
Create a public Microsoft 365 Group and set its logo
|
|
68
104
|
|
|
69
105
|
```sh
|
|
70
|
-
m365 aad o365group add --displayName Finance --description
|
|
106
|
+
m365 aad o365group add --displayName Finance --description "This is the Contoso Finance Group. Please come here and check out the latest news, posts, files, and more." --mailNickname finance --logoPath images/logo.png
|
|
71
107
|
```
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
# aad o365group conversation post list
|
|
2
|
+
|
|
3
|
+
Lists conversation posts of a Microsoft 365 group
|
|
4
|
+
|
|
5
|
+
## Usage
|
|
6
|
+
|
|
7
|
+
```sh
|
|
8
|
+
m365 aad o365group conversation post list [options]
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Options
|
|
12
|
+
|
|
13
|
+
`-i, --groupId [groupId]`
|
|
14
|
+
: The Id of the Office 365 Group. You can specify the groupId or groupDisplayName, but not both.
|
|
15
|
+
|
|
16
|
+
`-d, --groupDisplayName [groupDisplayName]`
|
|
17
|
+
: The Displayname of the Office 365 Group. You can specify the groupId or groupDisplayName, but not both.
|
|
18
|
+
|
|
19
|
+
`-t, --threadId <threadId>`
|
|
20
|
+
: The ID of the thread to retrieve details for
|
|
21
|
+
|
|
22
|
+
--8<-- "docs/cmd/_global.md"
|
|
23
|
+
|
|
24
|
+
## Examples
|
|
25
|
+
|
|
26
|
+
Lists the posts of the specific conversation of Microsoft 365 group by groupId
|
|
27
|
+
|
|
28
|
+
```sh
|
|
29
|
+
m365 aad o365group conversation post list --groupId '00000000-0000-0000-0000-000000000000' --threadId 'AAQkADkwN2Q2NDg1LWQ3ZGYtNDViZi1iNGRiLTVhYjJmN2Q5NDkxZQAQAOnRAfDf71lIvrdK85FAn5E='
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
Lists the posts of the specific conversation of Microsoft 365 group by groupDisplayName
|
|
33
|
+
|
|
34
|
+
```sh
|
|
35
|
+
m365 aad o365group conversation post list --groupDisplayName 'MyGroup' --threadId 'AAQkADkwN2Q2NDg1LWQ3ZGYtNDViZi1iNGRiLTVhYjJmN2Q5NDkxZQAQAOnRAfDf71lIvrdK85FAn5E='
|
|
36
|
+
```
|
|
@@ -33,23 +33,23 @@ A new chat conversation will be created if no existing conversation with the par
|
|
|
33
33
|
Send a message to a Microsoft Teams chat conversation by id
|
|
34
34
|
|
|
35
35
|
```sh
|
|
36
|
-
m365 teams chat message send --chatId 19:2da4c29f6d7041eca70b638b43d45437@thread.v2
|
|
36
|
+
m365 teams chat message send --chatId 19:2da4c29f6d7041eca70b638b43d45437@thread.v2 --message "Welcome to Teams"
|
|
37
37
|
```
|
|
38
38
|
|
|
39
39
|
Send a message to a single person
|
|
40
40
|
|
|
41
41
|
```sh
|
|
42
|
-
m365 teams chat message send --userEmails alexw@contoso.com
|
|
42
|
+
m365 teams chat message send --userEmails alexw@contoso.com --message "Welcome to Teams"
|
|
43
43
|
```
|
|
44
44
|
|
|
45
45
|
Send a message to a group of people
|
|
46
46
|
|
|
47
47
|
```sh
|
|
48
|
-
m365 teams chat message send --userEmails alexw@contoso.com,meganb@contoso.com
|
|
48
|
+
m365 teams chat message send --userEmails alexw@contoso.com,meganb@contoso.com --message "Welcome to Teams"
|
|
49
49
|
```
|
|
50
50
|
|
|
51
51
|
Send a message to a chat conversation finding it by display name
|
|
52
52
|
|
|
53
53
|
```sh
|
|
54
|
-
m365 teams chat message send --chatName "Just a conversation"
|
|
54
|
+
m365 teams chat message send --chatName "Just a conversation" --message "Welcome to Teams"
|
|
55
55
|
```
|