@pnp/cli-microsoft365 5.0.0-beta.8687ee9 → 5.0.0-beta.a1bb50f
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/.devcontainer/devcontainer.json +9 -1
- package/dist/m365/aad/commands/group/group-list.js +41 -0
- package/dist/m365/aad/commands/o365group/{Group.js → GroupExtended.js} +1 -1
- package/dist/m365/aad/commands/o365group/o365group-user-set.js +3 -3
- package/dist/m365/aad/commands.js +1 -0
- package/dist/m365/pa/cds-project-mutator.js +1 -1
- package/dist/m365/teams/commands/message/message-get.js +1 -1
- package/docs/docs/cmd/aad/group/group-list.md +21 -0
- package/docs/docs/cmd/teams/message/message-get.md +0 -3
- package/npm-shrinkwrap.json +266 -367
- package/package.json +19 -18
- package/dist/m365/aad/commands/o365group/GroupUser.js +0 -3
|
@@ -2,7 +2,15 @@
|
|
|
2
2
|
"name": "CLI for Microsoft 365",
|
|
3
3
|
"dockerFile": "Dockerfile",
|
|
4
4
|
"settings": {
|
|
5
|
-
"terminal.integrated.
|
|
5
|
+
"terminal.integrated.profiles.linux": {
|
|
6
|
+
"zsh": {
|
|
7
|
+
"path": "/bin/zsh",
|
|
8
|
+
"args": [
|
|
9
|
+
"-l"
|
|
10
|
+
]
|
|
11
|
+
}
|
|
12
|
+
},
|
|
13
|
+
"terminal.integrated.defaultProfile.linux": "zsh"
|
|
6
14
|
},
|
|
7
15
|
"postCreateCommand": "npm i && npm run clean && npm run build && npm link",
|
|
8
16
|
"extensions": [
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const GraphItemsListCommand_1 = require("../../../base/GraphItemsListCommand");
|
|
4
|
+
const commands_1 = require("../../commands");
|
|
5
|
+
class AadGroupListCommand extends GraphItemsListCommand_1.GraphItemsListCommand {
|
|
6
|
+
get name() {
|
|
7
|
+
return commands_1.default.GROUP_LIST;
|
|
8
|
+
}
|
|
9
|
+
get description() {
|
|
10
|
+
return 'Lists all groups defined in Azure Active Directory.';
|
|
11
|
+
}
|
|
12
|
+
defaultProperties() {
|
|
13
|
+
return ['id', 'displayName', 'groupType'];
|
|
14
|
+
}
|
|
15
|
+
commandAction(logger, args, cb) {
|
|
16
|
+
this
|
|
17
|
+
.getAllItems(`${this.resource}/v1.0/groups`, logger, true)
|
|
18
|
+
.then(() => {
|
|
19
|
+
if (args.options.output === 'text') {
|
|
20
|
+
this.items.forEach((group) => {
|
|
21
|
+
if (group.groupTypes && group.groupTypes.length > 0 && group.groupTypes[0] === 'Unified') {
|
|
22
|
+
group.groupType = 'Microsoft 365';
|
|
23
|
+
}
|
|
24
|
+
else if (group.mailEnabled && group.securityEnabled) {
|
|
25
|
+
group.groupType = 'Mail enabled security';
|
|
26
|
+
}
|
|
27
|
+
else if (group.securityEnabled) {
|
|
28
|
+
group.groupType = 'Security';
|
|
29
|
+
}
|
|
30
|
+
else if (group.mailEnabled) {
|
|
31
|
+
group.groupType = 'Distribution';
|
|
32
|
+
}
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
logger.log(this.items);
|
|
36
|
+
cb();
|
|
37
|
+
}, (err) => this.handleRejectedODataJsonPromise(err, logger, cb));
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
module.exports = new AadGroupListCommand();
|
|
41
|
+
//# sourceMappingURL=group-list.js.map
|
|
@@ -37,14 +37,14 @@ class AadO365GroupUserSetCommand extends GraphItemsListCommand_1.GraphItemsListC
|
|
|
37
37
|
logger.logToStderr(this.items);
|
|
38
38
|
logger.logToStderr('');
|
|
39
39
|
}
|
|
40
|
-
if (this.items.filter(i =>
|
|
40
|
+
if (this.items.filter(i => args.options.userName.toUpperCase() === i.userPrincipalName.toUpperCase()).length <= 0) {
|
|
41
41
|
const userNotInGroup = (typeof args.options.groupId !== 'undefined') ?
|
|
42
42
|
'The specified user does not belong to the given Microsoft 365 Group. Please use the \'o365group user add\' command to add new users.' :
|
|
43
43
|
'The specified user does not belong to the given Microsoft Teams team. Please use the \'graph teams user add\' command to add new users.';
|
|
44
44
|
throw new Error(userNotInGroup);
|
|
45
45
|
}
|
|
46
46
|
if (args.options.role === "Owner") {
|
|
47
|
-
const foundMember = this.items.find(e =>
|
|
47
|
+
const foundMember = this.items.find(e => args.options.userName.toUpperCase() === e.userPrincipalName.toUpperCase() && e.userType === 'Member');
|
|
48
48
|
if (foundMember !== undefined) {
|
|
49
49
|
const endpoint = `${this.resource}/v1.0/groups/${groupId}/owners/$ref`;
|
|
50
50
|
const requestOptions = {
|
|
@@ -65,7 +65,7 @@ class AadO365GroupUserSetCommand extends GraphItemsListCommand_1.GraphItemsListC
|
|
|
65
65
|
}
|
|
66
66
|
}
|
|
67
67
|
else {
|
|
68
|
-
const foundOwner = this.items.find(e =>
|
|
68
|
+
const foundOwner = this.items.find(e => args.options.userName.toUpperCase() === e.userPrincipalName.toUpperCase() && e.userType === 'Owner');
|
|
69
69
|
if (foundOwner !== undefined) {
|
|
70
70
|
const endpoint = `${this.resource}/v1.0/groups/${groupId}/owners/${foundOwner.id}/$ref`;
|
|
71
71
|
const requestOptions = {
|
|
@@ -11,6 +11,7 @@ exports.default = {
|
|
|
11
11
|
APPROLEASSIGNMENT_ADD: `${prefix} approleassignment add`,
|
|
12
12
|
APPROLEASSIGNMENT_LIST: `${prefix} approleassignment list`,
|
|
13
13
|
APPROLEASSIGNMENT_REMOVE: `${prefix} approleassignment remove`,
|
|
14
|
+
GROUP_LIST: `${prefix} group list`,
|
|
14
15
|
GROUPSETTING_ADD: `${prefix} groupsetting add`,
|
|
15
16
|
GROUPSETTING_GET: `${prefix} groupsetting get`,
|
|
16
17
|
GROUPSETTING_LIST: `${prefix} groupsetting list`,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const path = require("path");
|
|
4
|
-
const xmldom_1 = require("xmldom");
|
|
4
|
+
const xmldom_1 = require("@xmldom/xmldom");
|
|
5
5
|
/*
|
|
6
6
|
* Logic extracted from bolt.module.solution.dll
|
|
7
7
|
* Version: 0.4.3
|
|
@@ -13,7 +13,7 @@ class TeamsMessageGetCommand extends GraphCommand_1.default {
|
|
|
13
13
|
}
|
|
14
14
|
commandAction(logger, args, cb) {
|
|
15
15
|
const requestOptions = {
|
|
16
|
-
url: `${this.resource}/
|
|
16
|
+
url: `${this.resource}/v1.0/teams/${args.options.teamId}/channels/${args.options.channelId}/messages/${args.options.messageId}`,
|
|
17
17
|
headers: {
|
|
18
18
|
accept: 'application/json;odata.metadata=none'
|
|
19
19
|
},
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# aad group list
|
|
2
|
+
|
|
3
|
+
Lists Azure AD groups
|
|
4
|
+
|
|
5
|
+
## Usage
|
|
6
|
+
|
|
7
|
+
```sh
|
|
8
|
+
m365 aad group list [options]
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Options
|
|
12
|
+
|
|
13
|
+
--8<-- "docs/cmd/_global.md"
|
|
14
|
+
|
|
15
|
+
## Examples
|
|
16
|
+
|
|
17
|
+
Lists all groups defined in Azure Active Directory.
|
|
18
|
+
|
|
19
|
+
```sh
|
|
20
|
+
m365 aad group list
|
|
21
|
+
```
|
|
@@ -23,9 +23,6 @@ m365 teams message get [options]
|
|
|
23
23
|
|
|
24
24
|
## Remarks
|
|
25
25
|
|
|
26
|
-
!!! attention
|
|
27
|
-
This command is based on an API that is currently in preview and is subject to change once the API reached general availability.
|
|
28
|
-
|
|
29
26
|
You can only retrieve a message from a Microsoft Teams team if you are a member of that team.
|
|
30
27
|
|
|
31
28
|
## Examples
|