@pnp/cli-microsoft365 5.1.0-beta.55e5dfb → 5.1.0-beta.c8f5fd7

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.
@@ -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,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 'This is the Contoso Finance Group. Please come here and check out the latest news, posts, files, and more.' --mailNickname finance
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 'This is the Contoso Finance Group. Please come here and check out the latest news, posts, files, and more.' --mailNickname finance --isPrivate true
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 '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"
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 '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"
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 '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
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
+ ```
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pnp/cli-microsoft365",
3
- "version": "5.1.0-beta.55e5dfb",
3
+ "version": "5.1.0-beta.c8f5fd7",
4
4
  "description": "Manage Microsoft 365 and SharePoint Framework projects on any platform",
5
5
  "license": "MIT",
6
6
  "main": "./dist/api.js",