@pnp/cli-microsoft365 4.0.0-beta.fa432b6 → 4.1.0-beta.22e5a2d
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/README.md +6 -5
- package/dist/Utils.js +6 -0
- package/dist/cli/Cli.js +1 -1
- package/dist/m365/aad/commands/o365group/o365group-get.js +0 -4
- package/dist/m365/aad/commands/o365group/{o365group-restore.js → o365group-recyclebinitem-restore.js} +10 -10
- package/dist/m365/aad/commands/o365group/o365group-teamify.js +48 -12
- package/dist/m365/aad/commands/serviceprincipal/serviceprincipal-get.js +116 -0
- package/dist/m365/aad/commands/siteclassification/siteclassification-disable.js +2 -2
- package/dist/m365/aad/commands/siteclassification/siteclassification-enable.js +2 -2
- package/dist/m365/aad/commands/siteclassification/siteclassification-get.js +1 -1
- package/dist/m365/aad/commands/siteclassification/siteclassification-set.js +2 -2
- package/dist/m365/aad/commands/user/user-set.js +90 -0
- package/dist/m365/aad/commands.js +4 -1
- package/dist/m365/base/SpoCommand.js +13 -0
- package/dist/m365/pa/commands/connector/connector-export.js +2 -2
- package/dist/m365/spfx/commands/project/project-upgrade/Utils.js +1 -1
- package/dist/m365/spfx/commands/project/project-upgrade/rules/FN002017_DEVDEP_microsoft_rush_stack_compiler_3_7.js +2 -2
- package/dist/m365/spfx/commands/project/project-upgrade/rules/FN002018_DEVDEP_microsoft_rush_stack_compiler_3_9.js +17 -0
- package/dist/m365/spfx/commands/project/project-upgrade/rules/FN015007_FILE_config_copy_assets_json.js +17 -0
- package/dist/m365/spfx/commands/project/project-upgrade/{upgrade-1.13.0-beta.20.js → upgrade-1.13.0-rc.1.js} +43 -25
- package/dist/m365/spfx/commands/project/project-upgrade.js +1 -1
- package/dist/m365/spo/commands/contenttype/contenttype-add.js +21 -1
- package/dist/m365/spo/commands/file/file-list.js +2 -1
- package/dist/m365/teams/commands/channel/channel-list.js +5 -4
- package/dist/m365/teams/commands/conversationmember/conversationmember-add.js +9 -8
- package/dist/m365/teams/commands/conversationmember/conversationmember-list.js +20 -22
- package/dist/m365/teams/commands/team/team-get.js +91 -0
- package/dist/m365/teams/commands/user/user-app-list.js +8 -6
- package/docs/docs/cmd/aad/o365group/{o365group-restore.md → o365group-recyclebinitem-restore.md} +7 -1
- package/docs/docs/cmd/aad/o365group/o365group-teamify.md +12 -3
- package/docs/docs/cmd/aad/serviceprincipal/serviceprincipal-get.md +42 -0
- package/docs/docs/cmd/aad/siteclassification/siteclassification-disable.md +0 -5
- package/docs/docs/cmd/aad/siteclassification/siteclassification-enable.md +0 -5
- package/docs/docs/cmd/aad/siteclassification/siteclassification-get.md +0 -5
- package/docs/docs/cmd/aad/siteclassification/siteclassification-set.md +0 -4
- package/docs/docs/cmd/aad/user/user-set.md +60 -0
- package/docs/docs/cmd/spfx/project/project-upgrade.md +1 -1
- package/docs/docs/cmd/teams/team/team-get.md +33 -0
- package/npm-shrinkwrap.json +485 -481
- package/package.json +20 -20
- package/dist/m365/teams/UserTeamsApp.js +0 -3
package/README.md
CHANGED
|
@@ -82,6 +82,7 @@
|
|
|
82
82
|
- Supported authentication methods
|
|
83
83
|
- Azure Managed Identity
|
|
84
84
|
- Certificate
|
|
85
|
+
- Client Secret
|
|
85
86
|
- Device Code
|
|
86
87
|
- Username and Password
|
|
87
88
|
- Manage your SharePoint Framework projects
|
|
@@ -156,22 +157,22 @@ Get command information and example usage using the global `--help` option.
|
|
|
156
157
|
m365 spo site get --help
|
|
157
158
|
```
|
|
158
159
|
|
|
159
|
-
Execute a command and output response as
|
|
160
|
+
Execute a command and output response as JSON.
|
|
160
161
|
|
|
161
162
|
```sh
|
|
162
163
|
m365 spo site get --url https://contoso.sharepoint.com
|
|
163
164
|
```
|
|
164
165
|
|
|
165
|
-
|
|
166
|
+
Filter responses and return custom objects using [JMESPath](https://jmespath.org/) queries using the global `--query` option.
|
|
166
167
|
|
|
167
168
|
```sh
|
|
168
|
-
m365 spo site
|
|
169
|
+
m365 spo site list --query '[?Template==`GROUP#0`].{Title:Title, Url:Url}'
|
|
169
170
|
```
|
|
170
171
|
|
|
171
|
-
|
|
172
|
+
Execute a command and output response as text using the global `--output` option.
|
|
172
173
|
|
|
173
174
|
```sh
|
|
174
|
-
m365 spo site
|
|
175
|
+
m365 spo site get --url https://contoso.sharepoint.com --output text
|
|
175
176
|
```
|
|
176
177
|
|
|
177
178
|
> For more examples and usage, refer to the [command](https://pnp.github.io/cli-microsoft365/cmd/login/) and [sample scripts](https://pnp.github.io/cli-microsoft365/sample-scripts/) documentation.
|
package/dist/Utils.js
CHANGED
|
@@ -557,6 +557,12 @@ class Utils {
|
|
|
557
557
|
}
|
|
558
558
|
return jsonObj;
|
|
559
559
|
}
|
|
560
|
+
static encodeQueryParameter(value) {
|
|
561
|
+
if (!value) {
|
|
562
|
+
return value;
|
|
563
|
+
}
|
|
564
|
+
return encodeURIComponent(value).replace(/'/g, "''");
|
|
565
|
+
}
|
|
560
566
|
}
|
|
561
567
|
exports.default = Utils;
|
|
562
568
|
//# sourceMappingURL=Utils.js.map
|
package/dist/cli/Cli.js
CHANGED
|
@@ -369,7 +369,7 @@ class Cli {
|
|
|
369
369
|
// know this in order to decide if we should use default command's
|
|
370
370
|
// properties or custom ones from JMESPath
|
|
371
371
|
const originalObject = Array.isArray(logStatement) ? Cli.getFirstNonUndefinedArrayItem(logStatement) : logStatement;
|
|
372
|
-
const originalProperties = originalObject ? Object.getOwnPropertyNames(originalObject) : [];
|
|
372
|
+
const originalProperties = originalObject && typeof originalObject !== 'string' ? Object.getOwnPropertyNames(originalObject) : [];
|
|
373
373
|
if (options.query &&
|
|
374
374
|
!options.help) {
|
|
375
375
|
const jmespath = require('jmespath');
|
|
@@ -4,7 +4,6 @@ const request_1 = require("../../../../request");
|
|
|
4
4
|
const Utils_1 = require("../../../../Utils");
|
|
5
5
|
const GraphCommand_1 = require("../../../base/GraphCommand");
|
|
6
6
|
const commands_1 = require("../../commands");
|
|
7
|
-
const commands_2 = require("../../../teams/commands");
|
|
8
7
|
class AadO365GroupGetCommand extends GraphCommand_1.default {
|
|
9
8
|
get name() {
|
|
10
9
|
return commands_1.default.O365GROUP_GET;
|
|
@@ -12,9 +11,6 @@ class AadO365GroupGetCommand extends GraphCommand_1.default {
|
|
|
12
11
|
get description() {
|
|
13
12
|
return 'Gets information about the specified Microsoft 365 Group or Microsoft Teams team';
|
|
14
13
|
}
|
|
15
|
-
alias() {
|
|
16
|
-
return [commands_2.default.TEAM_GET];
|
|
17
|
-
}
|
|
18
14
|
commandAction(logger, args, cb) {
|
|
19
15
|
let group;
|
|
20
16
|
const requestOptions = {
|
|
@@ -4,17 +4,15 @@ const request_1 = require("../../../../request");
|
|
|
4
4
|
const Utils_1 = require("../../../../Utils");
|
|
5
5
|
const GraphCommand_1 = require("../../../base/GraphCommand");
|
|
6
6
|
const commands_1 = require("../../commands");
|
|
7
|
-
class
|
|
7
|
+
class AadO365GroupRecycleBinItemRestoreCommand extends GraphCommand_1.default {
|
|
8
8
|
get name() {
|
|
9
|
-
return commands_1.default.
|
|
9
|
+
return commands_1.default.O365GROUP_RECYCLEBINITEM_RESTORE;
|
|
10
10
|
}
|
|
11
11
|
get description() {
|
|
12
12
|
return 'Restores a deleted Microsoft 365 Group';
|
|
13
13
|
}
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
telemetryProps.id = (!(!args.options.id)).toString();
|
|
17
|
-
return telemetryProps;
|
|
14
|
+
alias() {
|
|
15
|
+
return [commands_1.default.O365GROUP_RESTORE];
|
|
18
16
|
}
|
|
19
17
|
commandAction(logger, args, cb) {
|
|
20
18
|
if (this.verbose) {
|
|
@@ -23,8 +21,10 @@ class AadO365GroupRestoreCommand extends GraphCommand_1.default {
|
|
|
23
21
|
const requestOptions = {
|
|
24
22
|
url: `${this.resource}/v1.0/directory/deleteditems/${args.options.id}/restore/`,
|
|
25
23
|
headers: {
|
|
26
|
-
'accept': 'application/json;odata.metadata=none'
|
|
27
|
-
|
|
24
|
+
'accept': 'application/json;odata.metadata=none',
|
|
25
|
+
'content-type': 'application/json'
|
|
26
|
+
},
|
|
27
|
+
responseType: 'json'
|
|
28
28
|
};
|
|
29
29
|
request_1.default
|
|
30
30
|
.post(requestOptions)
|
|
@@ -46,5 +46,5 @@ class AadO365GroupRestoreCommand extends GraphCommand_1.default {
|
|
|
46
46
|
return true;
|
|
47
47
|
}
|
|
48
48
|
}
|
|
49
|
-
module.exports = new
|
|
50
|
-
//# sourceMappingURL=o365group-restore.js.map
|
|
49
|
+
module.exports = new AadO365GroupRecycleBinItemRestoreCommand();
|
|
50
|
+
//# sourceMappingURL=o365group-recyclebinitem-restore.js.map
|
|
@@ -11,6 +11,30 @@ class AadO365GroupTeamifyCommand extends GraphCommand_1.default {
|
|
|
11
11
|
get description() {
|
|
12
12
|
return 'Creates a new Microsoft Teams team under existing Microsoft 365 group';
|
|
13
13
|
}
|
|
14
|
+
getGroupId(args) {
|
|
15
|
+
if (args.options.groupId) {
|
|
16
|
+
return Promise.resolve(args.options.groupId);
|
|
17
|
+
}
|
|
18
|
+
const requestOptions = {
|
|
19
|
+
url: `${this.resource}/v1.0/groups?$filter=mailNickname eq '${encodeURIComponent(args.options.mailNickname)}'`,
|
|
20
|
+
headers: {
|
|
21
|
+
accept: 'application/json;odata.metadata=none'
|
|
22
|
+
},
|
|
23
|
+
responseType: 'json'
|
|
24
|
+
};
|
|
25
|
+
return request_1.default
|
|
26
|
+
.get(requestOptions)
|
|
27
|
+
.then(response => {
|
|
28
|
+
const groupItem = response.value[0];
|
|
29
|
+
if (!groupItem) {
|
|
30
|
+
return Promise.reject(`The specified Microsoft 365 Group does not exist`);
|
|
31
|
+
}
|
|
32
|
+
if (response.value.length > 1) {
|
|
33
|
+
return Promise.reject(`Multiple Microsoft 365 Groups with name ${args.options.mailNickname} found: ${response.value.map(x => x.id)}`);
|
|
34
|
+
}
|
|
35
|
+
return Promise.resolve(groupItem.id);
|
|
36
|
+
});
|
|
37
|
+
}
|
|
14
38
|
commandAction(logger, args, cb) {
|
|
15
39
|
const data = {
|
|
16
40
|
"memberSettings": {
|
|
@@ -26,29 +50,41 @@ class AadO365GroupTeamifyCommand extends GraphCommand_1.default {
|
|
|
26
50
|
"giphyContentRating": "strict"
|
|
27
51
|
}
|
|
28
52
|
};
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
53
|
+
this
|
|
54
|
+
.getGroupId(args)
|
|
55
|
+
.then((groupId) => {
|
|
56
|
+
const requestOptions = {
|
|
57
|
+
url: `${this.resource}/v1.0/groups/${encodeURIComponent(groupId)}/team`,
|
|
58
|
+
headers: {
|
|
59
|
+
accept: 'application/json;odata.metadata=none'
|
|
60
|
+
},
|
|
61
|
+
data: data,
|
|
62
|
+
responseType: 'json'
|
|
63
|
+
};
|
|
64
|
+
return request_1.default.put(requestOptions);
|
|
65
|
+
})
|
|
39
66
|
.then(_ => cb(), (err) => this.handleRejectedODataJsonPromise(err, logger, cb));
|
|
40
67
|
}
|
|
41
68
|
options() {
|
|
42
69
|
const options = [
|
|
43
70
|
{
|
|
44
|
-
option: '-i, --groupId
|
|
71
|
+
option: '-i, --groupId [groupId]'
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
option: '--mailNickname [mailNickname]'
|
|
45
75
|
}
|
|
46
76
|
];
|
|
47
77
|
const parentOptions = super.options();
|
|
48
78
|
return options.concat(parentOptions);
|
|
49
79
|
}
|
|
50
80
|
validate(args) {
|
|
51
|
-
if (
|
|
81
|
+
if (args.options.groupId && args.options.mailNickname) {
|
|
82
|
+
return 'Specify either groupId or mailNickname, but not both.';
|
|
83
|
+
}
|
|
84
|
+
if (!args.options.groupId && !args.options.mailNickname) {
|
|
85
|
+
return 'Specify groupId or mailNickname, one is required';
|
|
86
|
+
}
|
|
87
|
+
if (args.options.groupId && !Utils_1.default.isValidGuid(args.options.groupId)) {
|
|
52
88
|
return `${args.options.groupId} is not a valid GUID`;
|
|
53
89
|
}
|
|
54
90
|
return true;
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const request_1 = require("../../../../request");
|
|
4
|
+
const Utils_1 = require("../../../../Utils");
|
|
5
|
+
const GraphCommand_1 = require("../../../base/GraphCommand");
|
|
6
|
+
const commands_1 = require("../../commands");
|
|
7
|
+
class AadServicePrincipalGetCommand extends GraphCommand_1.default {
|
|
8
|
+
get name() {
|
|
9
|
+
return commands_1.default.SERVICEPRINCIPAL_GET;
|
|
10
|
+
}
|
|
11
|
+
get description() {
|
|
12
|
+
return 'Retrieves a service principal from Azure AD directory';
|
|
13
|
+
}
|
|
14
|
+
getTelemetryProperties(args) {
|
|
15
|
+
const telemetryProps = super.getTelemetryProperties(args);
|
|
16
|
+
telemetryProps.id = typeof args.options.id !== 'undefined';
|
|
17
|
+
telemetryProps.appId = typeof args.options.appId !== 'undefined';
|
|
18
|
+
telemetryProps.name = typeof args.options.name !== 'undefined';
|
|
19
|
+
return telemetryProps;
|
|
20
|
+
}
|
|
21
|
+
getServicePrincipalId(args) {
|
|
22
|
+
if (args.options.id) {
|
|
23
|
+
return Promise.resolve(args.options.id);
|
|
24
|
+
}
|
|
25
|
+
let requestURL = '';
|
|
26
|
+
if (args.options.appId) {
|
|
27
|
+
requestURL = `${this.resource}/v1.0/serviceprincipals?$filter=appId eq '${encodeURIComponent(args.options.appId)}'&$select=id`;
|
|
28
|
+
}
|
|
29
|
+
else {
|
|
30
|
+
requestURL = `${this.resource}/v1.0/serviceprincipals?$filter=displayName eq '${encodeURIComponent(args.options.name)}'&$select=id`;
|
|
31
|
+
}
|
|
32
|
+
const requestOptions = {
|
|
33
|
+
url: requestURL,
|
|
34
|
+
headers: {
|
|
35
|
+
accept: 'application/json;odata.metadata=none',
|
|
36
|
+
ConsistencyLevel: 'eventual'
|
|
37
|
+
},
|
|
38
|
+
responseType: 'json'
|
|
39
|
+
};
|
|
40
|
+
return request_1.default
|
|
41
|
+
.get(requestOptions)
|
|
42
|
+
.then(response => {
|
|
43
|
+
const servicePrincipalItem = response.value[0];
|
|
44
|
+
if (!servicePrincipalItem) {
|
|
45
|
+
return Promise.reject(`The specified service principal doesn't exist in Azure AD`);
|
|
46
|
+
}
|
|
47
|
+
if (response.value.length > 1 && args.options.name) {
|
|
48
|
+
return Promise.reject(`Multiple service principals with name ${args.options.name} found: ${response.value.map(x => x.id)}`);
|
|
49
|
+
}
|
|
50
|
+
if (response.value.length > 1 && args.options.appId) {
|
|
51
|
+
return Promise.reject(`Multiple service principals with appId ${args.options.appId} found: ${response.value.map(x => x.id)}`);
|
|
52
|
+
}
|
|
53
|
+
return Promise.resolve(servicePrincipalItem.id);
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
commandAction(logger, args, cb) {
|
|
57
|
+
this
|
|
58
|
+
.getServicePrincipalId(args)
|
|
59
|
+
.then((servicePrincipalId) => {
|
|
60
|
+
const requestOptions = {
|
|
61
|
+
url: `${this.resource}/v1.0/serviceprincipals/${encodeURIComponent(servicePrincipalId)}`,
|
|
62
|
+
headers: {
|
|
63
|
+
accept: 'application/json;odata.metadata=none',
|
|
64
|
+
ConsistencyLevel: 'eventual'
|
|
65
|
+
},
|
|
66
|
+
responseType: 'json'
|
|
67
|
+
};
|
|
68
|
+
return request_1.default.get(requestOptions);
|
|
69
|
+
})
|
|
70
|
+
.then((res) => {
|
|
71
|
+
logger.log(res);
|
|
72
|
+
cb();
|
|
73
|
+
}, (err) => this.handleRejectedODataJsonPromise(err, logger, cb));
|
|
74
|
+
}
|
|
75
|
+
options() {
|
|
76
|
+
const options = [
|
|
77
|
+
{
|
|
78
|
+
option: '-i, --id [id]'
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
option: '--appId [appId]'
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
option: '--n, --name [name]'
|
|
85
|
+
}
|
|
86
|
+
];
|
|
87
|
+
const parentOptions = super.options();
|
|
88
|
+
return options.concat(parentOptions);
|
|
89
|
+
}
|
|
90
|
+
validate(args) {
|
|
91
|
+
if (args.options.id && args.options.appId && args.options.name) {
|
|
92
|
+
return 'Specify either id, appId or name, but not all.';
|
|
93
|
+
}
|
|
94
|
+
if (args.options.id && args.options.appId) {
|
|
95
|
+
return 'Specify either id or appId, but not both.';
|
|
96
|
+
}
|
|
97
|
+
if (args.options.appId && args.options.name) {
|
|
98
|
+
return 'Specify either appId or name, but not both.';
|
|
99
|
+
}
|
|
100
|
+
if (args.options.name && args.options.id) {
|
|
101
|
+
return 'Specify either id or name, but not both.';
|
|
102
|
+
}
|
|
103
|
+
if (!args.options.id && !args.options.appId && !args.options.name) {
|
|
104
|
+
return 'Specify id, appId or name, one is required';
|
|
105
|
+
}
|
|
106
|
+
if (args.options.id && !Utils_1.default.isValidGuid(args.options.id)) {
|
|
107
|
+
return `${args.options.id} is not a valid GUID`;
|
|
108
|
+
}
|
|
109
|
+
if (args.options.appId && !Utils_1.default.isValidGuid(args.options.appId)) {
|
|
110
|
+
return `${args.options.appId} is not a valid GUID`;
|
|
111
|
+
}
|
|
112
|
+
return true;
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
module.exports = new AadServicePrincipalGetCommand();
|
|
116
|
+
//# sourceMappingURL=serviceprincipal-get.js.map
|
|
@@ -19,7 +19,7 @@ class AadSiteClassificationDisableCommand extends GraphCommand_1.default {
|
|
|
19
19
|
commandAction(logger, args, cb) {
|
|
20
20
|
const disableSiteClassification = () => {
|
|
21
21
|
const requestOptions = {
|
|
22
|
-
url: `${this.resource}/
|
|
22
|
+
url: `${this.resource}/v1.0/groupSettings`,
|
|
23
23
|
headers: {
|
|
24
24
|
accept: 'application/json;odata.metadata=none'
|
|
25
25
|
},
|
|
@@ -42,7 +42,7 @@ class AadSiteClassificationDisableCommand extends GraphCommand_1.default {
|
|
|
42
42
|
return Promise.reject('Missing UnifiedGroupSettting id');
|
|
43
43
|
}
|
|
44
44
|
const requestOptions = {
|
|
45
|
-
url: `${this.resource}/
|
|
45
|
+
url: `${this.resource}/v1.0/groupSettings/` + unifiedGroupSetting[0].id,
|
|
46
46
|
headers: {
|
|
47
47
|
accept: 'application/json;odata.metadata=none',
|
|
48
48
|
'content-type': 'application/json'
|
|
@@ -19,7 +19,7 @@ class AadSiteClassificationEnableCommand extends GraphCommand_1.default {
|
|
|
19
19
|
}
|
|
20
20
|
commandAction(logger, args, cb) {
|
|
21
21
|
const requestOptions = {
|
|
22
|
-
url: `${this.resource}/
|
|
22
|
+
url: `${this.resource}/v1.0/groupSettingTemplates`,
|
|
23
23
|
headers: {
|
|
24
24
|
accept: 'application/json;odata.metadata=none'
|
|
25
25
|
},
|
|
@@ -88,7 +88,7 @@ class AadSiteClassificationEnableCommand extends GraphCommand_1.default {
|
|
|
88
88
|
}
|
|
89
89
|
});
|
|
90
90
|
const requestOptions = {
|
|
91
|
-
url: `${this.resource}/
|
|
91
|
+
url: `${this.resource}/v1.0/groupSettings`,
|
|
92
92
|
headers: {
|
|
93
93
|
accept: 'application/json;odata.metadata=none',
|
|
94
94
|
'content-type': 'application/json'
|
|
@@ -14,7 +14,7 @@ class AadSiteClassificationGetCommand extends GraphCommand_1.default {
|
|
|
14
14
|
}
|
|
15
15
|
commandAction(logger, args, cb) {
|
|
16
16
|
const requestOptions = {
|
|
17
|
-
url: `${this.resource}/
|
|
17
|
+
url: `${this.resource}/v1.0/groupSettings`,
|
|
18
18
|
headers: {
|
|
19
19
|
accept: 'application/json;odata.metadata=none'
|
|
20
20
|
},
|
|
@@ -21,7 +21,7 @@ class AadSiteClassificationSetCommand extends GraphCommand_1.default {
|
|
|
21
21
|
}
|
|
22
22
|
commandAction(logger, args, cb) {
|
|
23
23
|
const requestOptions = {
|
|
24
|
-
url: `${this.resource}/
|
|
24
|
+
url: `${this.resource}/v1.0/groupSettings`,
|
|
25
25
|
headers: {
|
|
26
26
|
accept: 'application/json;odata.metadata=none'
|
|
27
27
|
},
|
|
@@ -105,7 +105,7 @@ class AadSiteClassificationSetCommand extends GraphCommand_1.default {
|
|
|
105
105
|
}
|
|
106
106
|
});
|
|
107
107
|
const requestOptions = {
|
|
108
|
-
url: `${this.resource}/
|
|
108
|
+
url: `${this.resource}/v1.0/groupSettings/${unifiedGroupSetting[0].id}`,
|
|
109
109
|
headers: {
|
|
110
110
|
accept: 'application/json;odata.metadata=none',
|
|
111
111
|
'content-type': 'application/json'
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const request_1 = require("../../../../request");
|
|
4
|
+
const Utils_1 = require("../../../../Utils");
|
|
5
|
+
const GraphCommand_1 = require("../../../base/GraphCommand");
|
|
6
|
+
const commands_1 = require("../../commands");
|
|
7
|
+
class AadUserSetCommand extends GraphCommand_1.default {
|
|
8
|
+
get name() {
|
|
9
|
+
return commands_1.default.USER_SET;
|
|
10
|
+
}
|
|
11
|
+
get description() {
|
|
12
|
+
return 'Updates information about the specified user';
|
|
13
|
+
}
|
|
14
|
+
allowUnknownOptions() {
|
|
15
|
+
return true;
|
|
16
|
+
}
|
|
17
|
+
getTelemetryProperties(args) {
|
|
18
|
+
const telemetryProps = super.getTelemetryProperties(args);
|
|
19
|
+
telemetryProps.objectId = typeof args.options.objectId !== 'undefined';
|
|
20
|
+
telemetryProps.userPrincipalName = typeof args.options.userPrincipalName !== 'undefined';
|
|
21
|
+
telemetryProps.accountEnabled = (!!args.options.accountEnabled).toString();
|
|
22
|
+
return telemetryProps;
|
|
23
|
+
}
|
|
24
|
+
commandAction(logger, args, cb) {
|
|
25
|
+
const manifest = this.mapRequestBody(args.options);
|
|
26
|
+
const requestOptions = {
|
|
27
|
+
url: `${this.resource}/v1.0/users/${encodeURIComponent(args.options.objectId ? args.options.objectId : args.options.userPrincipalName)}`,
|
|
28
|
+
headers: {
|
|
29
|
+
accept: 'application/json'
|
|
30
|
+
},
|
|
31
|
+
responseType: 'json',
|
|
32
|
+
data: manifest
|
|
33
|
+
};
|
|
34
|
+
request_1.default
|
|
35
|
+
.patch(requestOptions)
|
|
36
|
+
.then(_ => cb(), (err) => this.handleRejectedODataJsonPromise(err, logger, cb));
|
|
37
|
+
}
|
|
38
|
+
mapRequestBody(options) {
|
|
39
|
+
const requestBody = {};
|
|
40
|
+
const excludeOptions = [
|
|
41
|
+
'debug',
|
|
42
|
+
'verbose',
|
|
43
|
+
'output',
|
|
44
|
+
'objectId',
|
|
45
|
+
'i',
|
|
46
|
+
'userPrincipalName',
|
|
47
|
+
'n',
|
|
48
|
+
'accountEnabled'
|
|
49
|
+
];
|
|
50
|
+
if (options.accountEnabled) {
|
|
51
|
+
requestBody['AccountEnabled'] = String(options.accountEnabled) === "true";
|
|
52
|
+
}
|
|
53
|
+
Object.keys(options).forEach(key => {
|
|
54
|
+
if (excludeOptions.indexOf(key) === -1) {
|
|
55
|
+
requestBody[key] = `${options[key]}`;
|
|
56
|
+
}
|
|
57
|
+
});
|
|
58
|
+
return requestBody;
|
|
59
|
+
}
|
|
60
|
+
options() {
|
|
61
|
+
const options = [
|
|
62
|
+
{
|
|
63
|
+
option: '-i, --objectId [objectId]'
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
option: '-n, --userPrincipalName [userPrincipalName]'
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
option: '--accountEnabled [accountEnabled]'
|
|
70
|
+
}
|
|
71
|
+
];
|
|
72
|
+
const parentOptions = super.options();
|
|
73
|
+
return options.concat(parentOptions);
|
|
74
|
+
}
|
|
75
|
+
validate(args) {
|
|
76
|
+
if (!args.options.objectId && !args.options.userPrincipalName) {
|
|
77
|
+
return 'Specify either objectId or userPrincipalName';
|
|
78
|
+
}
|
|
79
|
+
if (args.options.objectId && args.options.userPrincipalName) {
|
|
80
|
+
return 'Specify either objectId or userPrincipalName but not both';
|
|
81
|
+
}
|
|
82
|
+
if (args.options.objectId &&
|
|
83
|
+
!Utils_1.default.isValidGuid(args.options.objectId)) {
|
|
84
|
+
return `${args.options.objectId} is not a valid GUID`;
|
|
85
|
+
}
|
|
86
|
+
return true;
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
module.exports = new AadUserSetCommand();
|
|
90
|
+
//# sourceMappingURL=user-set.js.map
|
|
@@ -22,6 +22,7 @@ exports.default = {
|
|
|
22
22
|
O365GROUP_LIST: `${prefix} o365group list`,
|
|
23
23
|
O365GROUP_RECYCLEBINITEM_CLEAR: `${prefix} o365group recyclebinitem clear`,
|
|
24
24
|
O365GROUP_RECYCLEBINITEM_LIST: `${prefix} o365group recyclebinitem list`,
|
|
25
|
+
O365GROUP_RECYCLEBINITEM_RESTORE: `${prefix} o365group recyclebinitem restore`,
|
|
25
26
|
O365GROUP_SET: `${prefix} o365group set`,
|
|
26
27
|
O365GROUP_TEAMIFY: `${prefix} o365group teamify`,
|
|
27
28
|
O365GROUP_REMOVE: `${prefix} o365group remove`,
|
|
@@ -41,12 +42,14 @@ exports.default = {
|
|
|
41
42
|
OAUTH2GRANT_REMOVE: `${prefix} oauth2grant remove`,
|
|
42
43
|
OAUTH2GRANT_SET: `${prefix} oauth2grant set`,
|
|
43
44
|
POLICY_LIST: `${prefix} policy list`,
|
|
45
|
+
SERVICEPRINCIPAL_GET: `${prefix} serviceprincipal get`,
|
|
44
46
|
SITECLASSIFICATION_DISABLE: `${prefix} siteclassification disable`,
|
|
45
47
|
SITECLASSIFICATION_ENABLE: `${prefix} siteclassification enable`,
|
|
46
48
|
SITECLASSIFICATION_GET: `${prefix} siteclassification get`,
|
|
47
49
|
SITECLASSIFICATION_SET: `${prefix} siteclassification set`,
|
|
48
50
|
SP_GET: `${prefix} sp get`,
|
|
49
51
|
USER_GET: `${prefix} user get`,
|
|
50
|
-
USER_LIST: `${prefix} user list
|
|
52
|
+
USER_LIST: `${prefix} user list`,
|
|
53
|
+
USER_SET: `${prefix} user set`
|
|
51
54
|
};
|
|
52
55
|
//# sourceMappingURL=commands.js.map
|
|
@@ -357,6 +357,19 @@ class SpoCommand extends Command_1.default {
|
|
|
357
357
|
}
|
|
358
358
|
return `${baseUrl}/${relativeUrl}`;
|
|
359
359
|
}
|
|
360
|
+
action(logger, args, cb) {
|
|
361
|
+
Auth_1.default
|
|
362
|
+
.restoreAuth()
|
|
363
|
+
.then(() => {
|
|
364
|
+
if (Auth_1.default.service.connected && Auth_1.AuthType[Auth_1.default.service.authType] === Auth_1.AuthType[Auth_1.AuthType.Secret]) {
|
|
365
|
+
cb(new Command_1.CommandError(`SharePoint does not support authentication using client ID and secret. Please use a different login type to use SharePoint commands.`));
|
|
366
|
+
return;
|
|
367
|
+
}
|
|
368
|
+
super.action(logger, args, cb);
|
|
369
|
+
}, (error) => {
|
|
370
|
+
cb(new Command_1.CommandError(error));
|
|
371
|
+
});
|
|
372
|
+
}
|
|
360
373
|
}
|
|
361
374
|
exports.default = SpoCommand;
|
|
362
375
|
//# sourceMappingURL=SpoCommand.js.map
|
|
@@ -80,7 +80,7 @@ class PaConnectorExportCommand extends AzmgmtCommand_1.default {
|
|
|
80
80
|
.get({
|
|
81
81
|
url: connector.properties.apiDefinitions.originalSwaggerUrl,
|
|
82
82
|
headers: {
|
|
83
|
-
'x-anonymous': true
|
|
83
|
+
'x-anonymous': 'true'
|
|
84
84
|
}
|
|
85
85
|
});
|
|
86
86
|
}
|
|
@@ -111,7 +111,7 @@ class PaConnectorExportCommand extends AzmgmtCommand_1.default {
|
|
|
111
111
|
url: connector.properties.iconUri,
|
|
112
112
|
responseType: 'arraybuffer',
|
|
113
113
|
headers: {
|
|
114
|
-
'x-anonymous': true
|
|
114
|
+
'x-anonymous': 'true'
|
|
115
115
|
}
|
|
116
116
|
});
|
|
117
117
|
}
|
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.Utils = void 0;
|
|
4
4
|
const fs = require("fs");
|
|
5
5
|
const path = require("path");
|
|
6
|
-
const stripJsonComments = require(
|
|
6
|
+
const stripJsonComments = require("strip-json-comments");
|
|
7
7
|
class Utils {
|
|
8
8
|
static removeSingleLineComments(s) {
|
|
9
9
|
return stripJsonComments(s);
|
|
@@ -3,8 +3,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.FN002017_DEVDEP_microsoft_rush_stack_compiler_3_7 = void 0;
|
|
4
4
|
const DependencyRule_1 = require("./DependencyRule");
|
|
5
5
|
class FN002017_DEVDEP_microsoft_rush_stack_compiler_3_7 extends DependencyRule_1.DependencyRule {
|
|
6
|
-
constructor(packageVersion) {
|
|
7
|
-
super('@microsoft/rush-stack-compiler-3.7', packageVersion, true);
|
|
6
|
+
constructor(packageVersion, add = true) {
|
|
7
|
+
super('@microsoft/rush-stack-compiler-3.7', packageVersion, true, false, add);
|
|
8
8
|
}
|
|
9
9
|
get id() {
|
|
10
10
|
return 'FN002017';
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.FN002018_DEVDEP_microsoft_rush_stack_compiler_3_9 = void 0;
|
|
4
|
+
const DependencyRule_1 = require("./DependencyRule");
|
|
5
|
+
class FN002018_DEVDEP_microsoft_rush_stack_compiler_3_9 extends DependencyRule_1.DependencyRule {
|
|
6
|
+
constructor(packageVersion) {
|
|
7
|
+
super('@microsoft/rush-stack-compiler-3.9', packageVersion, true);
|
|
8
|
+
}
|
|
9
|
+
get id() {
|
|
10
|
+
return 'FN002018';
|
|
11
|
+
}
|
|
12
|
+
get supersedes() {
|
|
13
|
+
return ['FN002010', 'FN002011', 'FN002012', 'FN002017'];
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
exports.FN002018_DEVDEP_microsoft_rush_stack_compiler_3_9 = FN002018_DEVDEP_microsoft_rush_stack_compiler_3_9;
|
|
17
|
+
//# sourceMappingURL=FN002018_DEVDEP_microsoft_rush_stack_compiler_3_9.js.map
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.FN015007_FILE_config_copy_assets_json = void 0;
|
|
4
|
+
const FileAddRemoveRule_1 = require("./FileAddRemoveRule");
|
|
5
|
+
class FN015007_FILE_config_copy_assets_json extends FileAddRemoveRule_1.FileAddRemoveRule {
|
|
6
|
+
constructor(add) {
|
|
7
|
+
super('./config/copy-assets.json', add);
|
|
8
|
+
}
|
|
9
|
+
get id() {
|
|
10
|
+
return 'FN015007';
|
|
11
|
+
}
|
|
12
|
+
get supersedes() {
|
|
13
|
+
return ['FN004001', 'FN004002'];
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
exports.FN015007_FILE_config_copy_assets_json = FN015007_FILE_config_copy_assets_json;
|
|
17
|
+
//# sourceMappingURL=FN015007_FILE_config_copy_assets_json.js.map
|