@pnp/cli-microsoft365 5.5.0-beta.6fb46e0 → 5.5.0-beta.8bd301f
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/m365/aad/commands/o365group/o365group-recyclebinitem-restore.js +60 -9
- package/dist/m365/spo/commands/customaction/customaction-get.js +32 -4
- package/dist/m365/spo/commands/customaction/customaction-remove.js +43 -8
- package/dist/m365/spo/commands/field/field-get.js +14 -5
- package/dist/m365/spo/commands/field/field-remove.js +19 -10
- package/dist/m365/spo/commands/field/field-set.js +16 -9
- package/dist/m365/spo/commands/group/group-add.js +96 -0
- package/dist/m365/spo/commands/group/group-set.js +167 -0
- package/dist/m365/spo/commands/hubsite/hubsite-get.js +38 -2
- package/dist/m365/spo/commands/site/site-classic-list.js +1 -0
- package/dist/m365/spo/commands/site/site-classic-set.js +1 -0
- package/dist/m365/spo/commands/site/site-list.js +59 -17
- package/dist/m365/spo/commands/site/site-set.js +322 -162
- package/dist/m365/spo/commands/tenant/tenant-appcatalog-add.js +9 -6
- package/dist/m365/spo/commands.js +2 -0
- package/dist/m365/teams/commands/tab/tab-get.js +2 -2
- package/dist/m365/teams/commands/team/team-archive.js +51 -15
- package/dist/m365/teams/commands/team/team-clone.js +33 -7
- package/dist/m365/teams/commands/team/team-remove.js +47 -11
- package/dist/m365/teams/commands/team/team-set.js +25 -5
- package/dist/m365/teams/commands/team/team-unarchive.js +48 -12
- package/docs/docs/cmd/aad/o365group/o365group-recyclebinitem-restore.md +21 -3
- package/docs/docs/cmd/planner/task/task-get.md +6 -0
- package/docs/docs/cmd/spo/customaction/customaction-get.md +15 -2
- package/docs/docs/cmd/spo/customaction/customaction-remove.md +33 -2
- package/docs/docs/cmd/spo/field/field-get.md +6 -3
- package/docs/docs/cmd/spo/field/field-remove.md +9 -6
- package/docs/docs/cmd/spo/field/field-set.md +7 -4
- package/docs/docs/cmd/spo/group/group-add.md +51 -0
- package/docs/docs/cmd/spo/group/group-set.md +69 -0
- package/docs/docs/cmd/spo/hubsite/hubsite-get.md +21 -0
- package/docs/docs/cmd/spo/site/site-classic-list.md +3 -0
- package/docs/docs/cmd/spo/site/site-classic-set.md +3 -0
- package/docs/docs/cmd/spo/site/site-list.md +19 -7
- package/docs/docs/cmd/spo/site/site-set.md +50 -6
- package/docs/docs/cmd/teams/tab/tab-get.md +2 -2
- package/docs/docs/cmd/teams/team/team-archive.md +20 -5
- package/docs/docs/cmd/teams/team/team-clone.md +11 -5
- package/docs/docs/cmd/teams/team/team-remove.md +19 -5
- package/docs/docs/cmd/teams/team/team-set.md +10 -4
- package/docs/docs/cmd/teams/team/team-unarchive.md +18 -4
- package/npm-shrinkwrap.json +173 -158
- package/package.json +13 -13
|
@@ -5,7 +5,7 @@ const Command_1 = require("../../../../Command");
|
|
|
5
5
|
const utils_1 = require("../../../../utils");
|
|
6
6
|
const SpoCommand_1 = require("../../../base/SpoCommand");
|
|
7
7
|
const commands_1 = require("../../commands");
|
|
8
|
-
const
|
|
8
|
+
const spoSiteAddCommand = require("../site/site-add");
|
|
9
9
|
const spoSiteGetCommand = require("../site/site-get");
|
|
10
10
|
const spoSiteRemoveCommand = require("../site/site-remove");
|
|
11
11
|
const spoTenantAppCatalogUrlGetCommand = require("./tenant-appcatalogurl-get");
|
|
@@ -21,7 +21,7 @@ class SpoTenantAppCatalogAddCommand extends SpoCommand_1.default {
|
|
|
21
21
|
logger.logToStderr('Checking for existing app catalog URL...');
|
|
22
22
|
}
|
|
23
23
|
cli_1.Cli
|
|
24
|
-
.executeCommandWithOutput(spoTenantAppCatalogUrlGetCommand, { options: { _: [] } })
|
|
24
|
+
.executeCommandWithOutput(spoTenantAppCatalogUrlGetCommand, { options: { output: 'text', _: [] } })
|
|
25
25
|
.then((spoTenantAppCatalogUrlGetCommandOutput) => {
|
|
26
26
|
const appCatalogUrl = spoTenantAppCatalogUrlGetCommandOutput.stdout;
|
|
27
27
|
if (!appCatalogUrl) {
|
|
@@ -33,6 +33,7 @@ class SpoTenantAppCatalogAddCommand extends SpoCommand_1.default {
|
|
|
33
33
|
if (this.verbose) {
|
|
34
34
|
logger.logToStderr(`Found app catalog URL ${appCatalogUrl}`);
|
|
35
35
|
}
|
|
36
|
+
//Using JSON.parse
|
|
36
37
|
return this.ensureNoExistingSite(appCatalogUrl, args.options.force, logger);
|
|
37
38
|
})
|
|
38
39
|
.then(() => this.ensureNoExistingSite(args.options.url, args.options.force, logger))
|
|
@@ -92,17 +93,19 @@ class SpoTenantAppCatalogAddCommand extends SpoCommand_1.default {
|
|
|
92
93
|
if (this.verbose) {
|
|
93
94
|
logger.logToStderr(`Creating app catalog at ${options.url}...`);
|
|
94
95
|
}
|
|
95
|
-
const
|
|
96
|
+
const siteAddOptions = {
|
|
96
97
|
webTemplate: 'APPCATALOG#0',
|
|
97
98
|
title: 'App catalog',
|
|
99
|
+
type: 'ClassicSite',
|
|
98
100
|
url: options.url,
|
|
99
101
|
timeZone: options.timeZone,
|
|
100
|
-
|
|
102
|
+
owners: options.owner,
|
|
101
103
|
wait: options.wait,
|
|
102
104
|
verbose: this.verbose,
|
|
103
|
-
debug: this.debug
|
|
105
|
+
debug: this.debug,
|
|
106
|
+
removeDeletedSite: false
|
|
104
107
|
};
|
|
105
|
-
return cli_1.Cli.executeCommand(
|
|
108
|
+
return cli_1.Cli.executeCommand(spoSiteAddCommand, { options: Object.assign(Object.assign({}, siteAddOptions), { _: [] }) });
|
|
106
109
|
}
|
|
107
110
|
options() {
|
|
108
111
|
const options = [
|
|
@@ -63,9 +63,11 @@ exports.default = {
|
|
|
63
63
|
FOLDER_REMOVE: `${prefix} folder remove`,
|
|
64
64
|
FOLDER_RENAME: `${prefix} folder rename`,
|
|
65
65
|
GET: `${prefix} get`,
|
|
66
|
+
GROUP_ADD: `${prefix} group add`,
|
|
66
67
|
GROUP_GET: `${prefix} group get`,
|
|
67
68
|
GROUP_LIST: `${prefix} group list`,
|
|
68
69
|
GROUP_REMOVE: `${prefix} group remove`,
|
|
70
|
+
GROUP_SET: `${prefix} group set`,
|
|
69
71
|
GROUP_USER_ADD: `${prefix} group user add`,
|
|
70
72
|
GROUP_USER_LIST: `${prefix} group user list`,
|
|
71
73
|
GROUP_USER_REMOVE: `${prefix} group user remove`,
|
|
@@ -124,10 +124,10 @@ class TeamsTabGetCommand extends GraphCommand_1.default {
|
|
|
124
124
|
option: '--channelName [channelName]'
|
|
125
125
|
},
|
|
126
126
|
{
|
|
127
|
-
option: '--tabId [tabId]'
|
|
127
|
+
option: '-i, --tabId [tabId]'
|
|
128
128
|
},
|
|
129
129
|
{
|
|
130
|
-
option: '--tabName [tabName]'
|
|
130
|
+
option: '-n, --tabName [tabName]'
|
|
131
131
|
}
|
|
132
132
|
];
|
|
133
133
|
const parentOptions = super.options();
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const request_1 = require("../../../../request");
|
|
4
4
|
const utils_1 = require("../../../../utils");
|
|
5
|
+
const aadGroup_1 = require("../../../../utils/aadGroup");
|
|
5
6
|
const GraphCommand_1 = require("../../../base/GraphCommand");
|
|
6
7
|
const commands_1 = require("../../commands");
|
|
7
8
|
class TeamsTeamArchiveCommand extends GraphCommand_1.default {
|
|
@@ -16,27 +17,53 @@ class TeamsTeamArchiveCommand extends GraphCommand_1.default {
|
|
|
16
17
|
telemetryProps.shouldSetSpoSiteReadOnlyForMembers = args.options.shouldSetSpoSiteReadOnlyForMembers === true;
|
|
17
18
|
return telemetryProps;
|
|
18
19
|
}
|
|
20
|
+
getTeamId(args) {
|
|
21
|
+
if (args.options.id) {
|
|
22
|
+
return Promise.resolve(args.options.id);
|
|
23
|
+
}
|
|
24
|
+
return aadGroup_1.aadGroup
|
|
25
|
+
.getGroupByDisplayName(args.options.name)
|
|
26
|
+
.then(group => {
|
|
27
|
+
if (group.resourceProvisioningOptions.indexOf('Team') === -1) {
|
|
28
|
+
return Promise.reject(`The specified team does not exist in the Microsoft Teams`);
|
|
29
|
+
}
|
|
30
|
+
return group.id;
|
|
31
|
+
});
|
|
32
|
+
}
|
|
19
33
|
commandAction(logger, args, cb) {
|
|
34
|
+
if (args.options.teamId) {
|
|
35
|
+
args.options.id = args.options.teamId;
|
|
36
|
+
this.warn(logger, `Option 'teamId' is deprecated. Please use 'id' instead.`);
|
|
37
|
+
}
|
|
20
38
|
const siteReadOnlyForMembers = args.options.shouldSetSpoSiteReadOnlyForMembers === true;
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
39
|
+
this
|
|
40
|
+
.getTeamId(args)
|
|
41
|
+
.then((teamId) => {
|
|
42
|
+
const requestOptions = {
|
|
43
|
+
url: `${this.resource}/v1.0/teams/${encodeURIComponent(teamId)}/archive`,
|
|
44
|
+
headers: {
|
|
45
|
+
'content-type': 'application/json;odata=nometadata',
|
|
46
|
+
'accept': 'application/json;odata.metadata=none'
|
|
47
|
+
},
|
|
48
|
+
responseType: 'json',
|
|
49
|
+
data: {
|
|
50
|
+
shouldSetSpoSiteReadOnlyForMembers: siteReadOnlyForMembers
|
|
51
|
+
}
|
|
52
|
+
};
|
|
53
|
+
return request_1.default.post(requestOptions);
|
|
54
|
+
})
|
|
34
55
|
.then(_ => cb(), (res) => this.handleRejectedODataJsonPromise(res, logger, cb));
|
|
35
56
|
}
|
|
36
57
|
options() {
|
|
37
58
|
const options = [
|
|
38
59
|
{
|
|
39
|
-
option: '-i, --
|
|
60
|
+
option: '-i, --id [id]'
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
option: '-n, --name [name]'
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
option: '--teamId [teamId]'
|
|
40
67
|
},
|
|
41
68
|
{
|
|
42
69
|
option: '--shouldSetSpoSiteReadOnlyForMembers'
|
|
@@ -46,9 +73,18 @@ class TeamsTeamArchiveCommand extends GraphCommand_1.default {
|
|
|
46
73
|
return options.concat(parentOptions);
|
|
47
74
|
}
|
|
48
75
|
validate(args) {
|
|
49
|
-
if (!
|
|
76
|
+
if (!args.options.id && !args.options.name && !args.options.teamId) {
|
|
77
|
+
return 'Specify either id or name';
|
|
78
|
+
}
|
|
79
|
+
if (args.options.name && (args.options.id || args.options.teamId)) {
|
|
80
|
+
return 'Specify either id or name but not both';
|
|
81
|
+
}
|
|
82
|
+
if (args.options.teamId && !utils_1.validation.isValidGuid(args.options.teamId)) {
|
|
50
83
|
return `${args.options.teamId} is not a valid GUID`;
|
|
51
84
|
}
|
|
85
|
+
if (args.options.id && !utils_1.validation.isValidGuid(args.options.id)) {
|
|
86
|
+
return `${args.options.id} is not a valid GUID`;
|
|
87
|
+
}
|
|
52
88
|
return true;
|
|
53
89
|
}
|
|
54
90
|
}
|
|
@@ -15,13 +15,24 @@ class TeamsTeamCloneCommand extends GraphCommand_1.default {
|
|
|
15
15
|
const telemetryProps = super.getTelemetryProperties(args);
|
|
16
16
|
telemetryProps.description = typeof args.options.description !== 'undefined';
|
|
17
17
|
telemetryProps.classification = typeof args.options.classification !== 'undefined';
|
|
18
|
-
telemetryProps.
|
|
18
|
+
telemetryProps.id = typeof args.options.id !== 'undefined';
|
|
19
|
+
telemetryProps.teamId = typeof args.options.teamId !== 'undefined';
|
|
20
|
+
telemetryProps.name = typeof args.options.name !== 'undefined';
|
|
21
|
+
telemetryProps.displayName = typeof args.options.displayName !== 'undefined';
|
|
19
22
|
return telemetryProps;
|
|
20
23
|
}
|
|
21
24
|
commandAction(logger, args, cb) {
|
|
25
|
+
if (args.options.teamId) {
|
|
26
|
+
args.options.id = args.options.teamId;
|
|
27
|
+
this.warn(logger, `Option 'teamId' is deprecated. Please use 'id' instead.`);
|
|
28
|
+
}
|
|
29
|
+
if (args.options.displayName) {
|
|
30
|
+
args.options.name = args.options.displayName;
|
|
31
|
+
this.warn(logger, `Option 'displayName' is deprecated. Please use 'name' instead.`);
|
|
32
|
+
}
|
|
22
33
|
const data = {
|
|
23
|
-
displayName: args.options.
|
|
24
|
-
mailNickname: this.generateMailNickname(args.options.
|
|
34
|
+
displayName: args.options.name,
|
|
35
|
+
mailNickname: this.generateMailNickname(args.options.name),
|
|
25
36
|
partsToClone: args.options.partsToClone
|
|
26
37
|
};
|
|
27
38
|
if (args.options.description) {
|
|
@@ -34,7 +45,7 @@ class TeamsTeamCloneCommand extends GraphCommand_1.default {
|
|
|
34
45
|
data.visibility = args.options.visibility;
|
|
35
46
|
}
|
|
36
47
|
const requestOptions = {
|
|
37
|
-
url: `${this.resource}/v1.0/teams/${encodeURIComponent(args.options.
|
|
48
|
+
url: `${this.resource}/v1.0/teams/${encodeURIComponent(args.options.id)}/clone`,
|
|
38
49
|
headers: {
|
|
39
50
|
"content-type": "application/json",
|
|
40
51
|
accept: 'application/json;odata.metadata=none'
|
|
@@ -46,13 +57,25 @@ class TeamsTeamCloneCommand extends GraphCommand_1.default {
|
|
|
46
57
|
.post(requestOptions)
|
|
47
58
|
.then(_ => cb(), (err) => this.handleRejectedODataJsonPromise(err, logger, cb));
|
|
48
59
|
}
|
|
60
|
+
optionSets() {
|
|
61
|
+
return [
|
|
62
|
+
['id', 'teamId'],
|
|
63
|
+
['name', 'displayName']
|
|
64
|
+
];
|
|
65
|
+
}
|
|
49
66
|
options() {
|
|
50
67
|
const options = [
|
|
51
68
|
{
|
|
52
|
-
option: '-i, --
|
|
69
|
+
option: '-i, --id [teamId]'
|
|
53
70
|
},
|
|
54
71
|
{
|
|
55
|
-
option: '
|
|
72
|
+
option: '--teamId [teamId]'
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
option: '-n, --name [name]'
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
option: '--displayName [displayName]'
|
|
56
79
|
},
|
|
57
80
|
{
|
|
58
81
|
option: '-p, --partsToClone <partsToClone>',
|
|
@@ -73,9 +96,12 @@ class TeamsTeamCloneCommand extends GraphCommand_1.default {
|
|
|
73
96
|
return options.concat(parentOptions);
|
|
74
97
|
}
|
|
75
98
|
validate(args) {
|
|
76
|
-
if (!utils_1.validation.isValidGuid(args.options.teamId)) {
|
|
99
|
+
if (args.options.teamId && !utils_1.validation.isValidGuid(args.options.teamId)) {
|
|
77
100
|
return `${args.options.teamId} is not a valid GUID`;
|
|
78
101
|
}
|
|
102
|
+
if (args.options.id && !utils_1.validation.isValidGuid(args.options.id)) {
|
|
103
|
+
return `${args.options.id} is not a valid GUID`;
|
|
104
|
+
}
|
|
79
105
|
const partsToClone = args.options.partsToClone.replace(/\s/g, '').split(',');
|
|
80
106
|
for (const partToClone of partsToClone) {
|
|
81
107
|
const part = partToClone.toLowerCase();
|
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
const cli_1 = require("../../../../cli");
|
|
4
4
|
const request_1 = require("../../../../request");
|
|
5
5
|
const utils_1 = require("../../../../utils");
|
|
6
|
+
const aadGroup_1 = require("../../../../utils/aadGroup");
|
|
6
7
|
const GraphCommand_1 = require("../../../base/GraphCommand");
|
|
7
8
|
const commands_1 = require("../../commands");
|
|
8
9
|
class TeamsTeamRemoveCommand extends GraphCommand_1.default {
|
|
@@ -17,17 +18,37 @@ class TeamsTeamRemoveCommand extends GraphCommand_1.default {
|
|
|
17
18
|
telemetryProps.confirm = (!(!args.options.confirm)).toString();
|
|
18
19
|
return telemetryProps;
|
|
19
20
|
}
|
|
21
|
+
getTeamId(args) {
|
|
22
|
+
if (args.options.id) {
|
|
23
|
+
return Promise.resolve(args.options.id);
|
|
24
|
+
}
|
|
25
|
+
return aadGroup_1.aadGroup
|
|
26
|
+
.getGroupByDisplayName(args.options.name)
|
|
27
|
+
.then(group => {
|
|
28
|
+
if (group.resourceProvisioningOptions.indexOf('Team') === -1) {
|
|
29
|
+
return Promise.reject(`The specified team does not exist in the Microsoft Teams`);
|
|
30
|
+
}
|
|
31
|
+
return group.id;
|
|
32
|
+
});
|
|
33
|
+
}
|
|
20
34
|
commandAction(logger, args, cb) {
|
|
35
|
+
if (args.options.teamId) {
|
|
36
|
+
args.options.id = args.options.teamId;
|
|
37
|
+
this.warn(logger, `Option 'teamId' is deprecated. Please use 'id' instead.`);
|
|
38
|
+
}
|
|
21
39
|
const removeTeam = () => {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
40
|
+
this
|
|
41
|
+
.getTeamId(args)
|
|
42
|
+
.then((teamId) => {
|
|
43
|
+
const requestOptions = {
|
|
44
|
+
url: `${this.resource}/v1.0/groups/${encodeURIComponent(teamId)}`,
|
|
45
|
+
headers: {
|
|
46
|
+
accept: 'application/json;odata.metadata=none'
|
|
47
|
+
},
|
|
48
|
+
responseType: 'json'
|
|
49
|
+
};
|
|
50
|
+
return request_1.default.delete(requestOptions);
|
|
51
|
+
})
|
|
31
52
|
.then(_ => cb(), (err) => this.handleRejectedODataJsonPromise(err, logger, cb));
|
|
32
53
|
};
|
|
33
54
|
if (args.options.confirm) {
|
|
@@ -52,7 +73,13 @@ class TeamsTeamRemoveCommand extends GraphCommand_1.default {
|
|
|
52
73
|
options() {
|
|
53
74
|
const options = [
|
|
54
75
|
{
|
|
55
|
-
option: '-i, --
|
|
76
|
+
option: '-i, --id [id]'
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
option: '-n, --name [name]'
|
|
80
|
+
},
|
|
81
|
+
{
|
|
82
|
+
option: '--teamId [teamId]'
|
|
56
83
|
},
|
|
57
84
|
{
|
|
58
85
|
option: '--confirm'
|
|
@@ -62,9 +89,18 @@ class TeamsTeamRemoveCommand extends GraphCommand_1.default {
|
|
|
62
89
|
return options.concat(parentOptions);
|
|
63
90
|
}
|
|
64
91
|
validate(args) {
|
|
65
|
-
if (!
|
|
92
|
+
if (!args.options.id && !args.options.name && !args.options.teamId) {
|
|
93
|
+
return 'Specify either id or name';
|
|
94
|
+
}
|
|
95
|
+
if (args.options.name && (args.options.id || args.options.teamId)) {
|
|
96
|
+
return 'Specify either id or name but not both';
|
|
97
|
+
}
|
|
98
|
+
if (args.options.teamId && !utils_1.validation.isValidGuid(args.options.teamId)) {
|
|
66
99
|
return `${args.options.teamId} is not a valid GUID`;
|
|
67
100
|
}
|
|
101
|
+
if (args.options.id && !utils_1.validation.isValidGuid(args.options.id)) {
|
|
102
|
+
return `${args.options.id} is not a valid GUID`;
|
|
103
|
+
}
|
|
68
104
|
return true;
|
|
69
105
|
}
|
|
70
106
|
}
|
|
@@ -20,8 +20,8 @@ class TeamsTeamSetCommand extends GraphCommand_1.default {
|
|
|
20
20
|
}
|
|
21
21
|
mapRequestBody(options) {
|
|
22
22
|
const requestBody = {};
|
|
23
|
-
if (options.
|
|
24
|
-
requestBody.displayName = options.
|
|
23
|
+
if (options.name) {
|
|
24
|
+
requestBody.displayName = options.name;
|
|
25
25
|
}
|
|
26
26
|
if (options.description) {
|
|
27
27
|
requestBody.description = options.description;
|
|
@@ -38,9 +38,17 @@ class TeamsTeamSetCommand extends GraphCommand_1.default {
|
|
|
38
38
|
return requestBody;
|
|
39
39
|
}
|
|
40
40
|
commandAction(logger, args, cb) {
|
|
41
|
+
if (args.options.teamId) {
|
|
42
|
+
args.options.id = args.options.teamId;
|
|
43
|
+
this.warn(logger, `Option 'teamId' is deprecated. Please use 'id' instead.`);
|
|
44
|
+
}
|
|
45
|
+
if (args.options.displayName) {
|
|
46
|
+
args.options.name = args.options.displayName;
|
|
47
|
+
this.warn(logger, `Option 'displayName' is deprecated. Please use 'name' instead.`);
|
|
48
|
+
}
|
|
41
49
|
const data = this.mapRequestBody(args.options);
|
|
42
50
|
const requestOptions = {
|
|
43
|
-
url: `${this.resource}/v1.0/groups/${encodeURIComponent(args.options.
|
|
51
|
+
url: `${this.resource}/v1.0/groups/${encodeURIComponent(args.options.id)}`,
|
|
44
52
|
headers: {
|
|
45
53
|
accept: 'application/json;odata.metadata=none'
|
|
46
54
|
},
|
|
@@ -51,10 +59,19 @@ class TeamsTeamSetCommand extends GraphCommand_1.default {
|
|
|
51
59
|
.patch(requestOptions)
|
|
52
60
|
.then(_ => cb(), (err) => this.handleRejectedODataJsonPromise(err, logger, cb));
|
|
53
61
|
}
|
|
62
|
+
optionSets() {
|
|
63
|
+
return [['id', 'teamId']];
|
|
64
|
+
}
|
|
54
65
|
options() {
|
|
55
66
|
const options = [
|
|
56
67
|
{
|
|
57
|
-
option: '-i, --
|
|
68
|
+
option: '-i, --id [id]'
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
option: '--teamId [teamId]'
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
option: '-n, --name [name]'
|
|
58
75
|
},
|
|
59
76
|
{
|
|
60
77
|
option: '--displayName [displayName]'
|
|
@@ -77,9 +94,12 @@ class TeamsTeamSetCommand extends GraphCommand_1.default {
|
|
|
77
94
|
return options.concat(parentOptions);
|
|
78
95
|
}
|
|
79
96
|
validate(args) {
|
|
80
|
-
if (!utils_1.validation.isValidGuid(args.options.teamId)) {
|
|
97
|
+
if (args.options.teamId && !utils_1.validation.isValidGuid(args.options.teamId)) {
|
|
81
98
|
return `${args.options.teamId} is not a valid GUID`;
|
|
82
99
|
}
|
|
100
|
+
if (args.options.id && !utils_1.validation.isValidGuid(args.options.id)) {
|
|
101
|
+
return `${args.options.id} is not a valid GUID`;
|
|
102
|
+
}
|
|
83
103
|
if (args.options.visibility) {
|
|
84
104
|
if (args.options.visibility.toLowerCase() !== 'private' && args.options.visibility.toLowerCase() !== 'public') {
|
|
85
105
|
return `${args.options.visibility} is not a valid visibility type. Allowed values are Private|Public`;
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const request_1 = require("../../../../request");
|
|
4
4
|
const utils_1 = require("../../../../utils");
|
|
5
|
+
const aadGroup_1 = require("../../../../utils/aadGroup");
|
|
5
6
|
const GraphCommand_1 = require("../../../base/GraphCommand");
|
|
6
7
|
const commands_1 = require("../../commands");
|
|
7
8
|
class TeamsTeamUnarchiveCommand extends GraphCommand_1.default {
|
|
@@ -11,33 +12,68 @@ class TeamsTeamUnarchiveCommand extends GraphCommand_1.default {
|
|
|
11
12
|
get description() {
|
|
12
13
|
return 'Restores an archived Microsoft Teams team';
|
|
13
14
|
}
|
|
15
|
+
getTeamId(args) {
|
|
16
|
+
if (args.options.id) {
|
|
17
|
+
return Promise.resolve(args.options.id);
|
|
18
|
+
}
|
|
19
|
+
return aadGroup_1.aadGroup
|
|
20
|
+
.getGroupByDisplayName(args.options.name)
|
|
21
|
+
.then(group => {
|
|
22
|
+
if (group.resourceProvisioningOptions.indexOf('Team') === -1) {
|
|
23
|
+
return Promise.reject(`The specified team does not exist in the Microsoft Teams`);
|
|
24
|
+
}
|
|
25
|
+
return group.id;
|
|
26
|
+
});
|
|
27
|
+
}
|
|
14
28
|
commandAction(logger, args, cb) {
|
|
29
|
+
if (args.options.teamId) {
|
|
30
|
+
args.options.id = args.options.teamId;
|
|
31
|
+
this.warn(logger, `Option 'teamId' is deprecated. Please use 'id' instead.`);
|
|
32
|
+
}
|
|
15
33
|
const endpoint = `${this.resource}/v1.0`;
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
34
|
+
this
|
|
35
|
+
.getTeamId(args)
|
|
36
|
+
.then((teamId) => {
|
|
37
|
+
const requestOptions = {
|
|
38
|
+
url: `${endpoint}/teams/${encodeURIComponent(teamId)}/unarchive`,
|
|
39
|
+
headers: {
|
|
40
|
+
'content-type': 'application/json;odata=nometadata',
|
|
41
|
+
'accept': 'application/json;odata.metadata=none'
|
|
42
|
+
},
|
|
43
|
+
responseType: 'json'
|
|
44
|
+
};
|
|
45
|
+
return request_1.default.post(requestOptions);
|
|
46
|
+
})
|
|
26
47
|
.then(_ => cb(), (res) => this.handleRejectedODataJsonPromise(res, logger, cb));
|
|
27
48
|
}
|
|
28
49
|
options() {
|
|
29
50
|
const options = [
|
|
30
51
|
{
|
|
31
|
-
option: '-i, --
|
|
52
|
+
option: '-i, --id [id]'
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
option: '-n, --name [name]'
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
option: '--teamId [teamId]'
|
|
32
59
|
}
|
|
33
60
|
];
|
|
34
61
|
const parentOptions = super.options();
|
|
35
62
|
return options.concat(parentOptions);
|
|
36
63
|
}
|
|
37
64
|
validate(args) {
|
|
38
|
-
if (!
|
|
65
|
+
if (!args.options.id && !args.options.name && !args.options.teamId) {
|
|
66
|
+
return 'Specify either id or name';
|
|
67
|
+
}
|
|
68
|
+
if (args.options.name && (args.options.id || args.options.teamId)) {
|
|
69
|
+
return 'Specify either id or name but not both';
|
|
70
|
+
}
|
|
71
|
+
if (args.options.teamId && !utils_1.validation.isValidGuid(args.options.teamId)) {
|
|
39
72
|
return `${args.options.teamId} is not a valid GUID`;
|
|
40
73
|
}
|
|
74
|
+
if (args.options.id && !utils_1.validation.isValidGuid(args.options.id)) {
|
|
75
|
+
return `${args.options.id} is not a valid GUID`;
|
|
76
|
+
}
|
|
41
77
|
return true;
|
|
42
78
|
}
|
|
43
79
|
}
|
|
@@ -16,15 +16,33 @@ m365 aad o365group restore [options]
|
|
|
16
16
|
|
|
17
17
|
## Options
|
|
18
18
|
|
|
19
|
-
`-i, --id
|
|
20
|
-
: The ID of the Microsoft 365 Group to restore
|
|
19
|
+
`-i, --id [id]`
|
|
20
|
+
: The ID of the Microsoft 365 Group to restore. Specify either `id`, `displayName` or `mailNickname` but not multiple.
|
|
21
|
+
|
|
22
|
+
`-d, --displayName [displayName]`
|
|
23
|
+
: Display name for the Microsoft 365 Group to restore. Specify either `id`, `displayName` or `mailNickname` but not multiple.
|
|
24
|
+
|
|
25
|
+
`-m, --mailNickname [mailNickname]`
|
|
26
|
+
: Name of the group e-mail (part before the @). Specify either `id`, `displayName` or `mailNickname` but not multiple.
|
|
21
27
|
|
|
22
28
|
--8<-- "docs/cmd/_global.md"
|
|
23
29
|
|
|
24
30
|
## Examples
|
|
25
31
|
|
|
26
|
-
Restores the Microsoft 365 Group with
|
|
32
|
+
Restores the Microsoft 365 Group with specific ID
|
|
27
33
|
|
|
28
34
|
```sh
|
|
29
35
|
m365 aad o365group recyclebinitem restore --id 28beab62-7540-4db1-a23f-29a6018a3848
|
|
30
36
|
```
|
|
37
|
+
|
|
38
|
+
Restores the Microsoft 365 Group with specific name
|
|
39
|
+
|
|
40
|
+
```sh
|
|
41
|
+
m365 aad o365group recyclebinitem restore --displayName "My Group"
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
Restores the Microsoft 365 Group with specific mail nickname
|
|
45
|
+
|
|
46
|
+
```sh
|
|
47
|
+
m365 aad o365group recyclebinitem restore --mailNickname "Mygroup"
|
|
48
|
+
```
|
|
@@ -10,8 +10,11 @@ m365 spo customaction get [options]
|
|
|
10
10
|
|
|
11
11
|
## Options
|
|
12
12
|
|
|
13
|
-
`-i, --id
|
|
14
|
-
: ID of the user custom action to retrieve information for
|
|
13
|
+
`-i, --id [id]`
|
|
14
|
+
: ID of the user custom action to retrieve information for. Specify either `id` or `title`
|
|
15
|
+
|
|
16
|
+
`-t, --title [title]`
|
|
17
|
+
: Title of the user custom action to retrieve information for. Specify either `id` or `title`
|
|
15
18
|
|
|
16
19
|
`-u, --url <url>`
|
|
17
20
|
: Url of the site or site collection to retrieve the custom action from
|
|
@@ -21,6 +24,10 @@ m365 spo customaction get [options]
|
|
|
21
24
|
|
|
22
25
|
--8<-- "docs/cmd/_global.md"
|
|
23
26
|
|
|
27
|
+
## Remarks
|
|
28
|
+
|
|
29
|
+
If the command finds multiple user custom actions with the specified title, it will prompt you to disambiguate which user custom action it should use, listing the discovered IDs.
|
|
30
|
+
|
|
24
31
|
## Examples
|
|
25
32
|
|
|
26
33
|
Return details about the user custom action with ID _058140e3-0e37-44fc-a1d3-79c487d371a3_ located in site or site collection _https://contoso.sharepoint.com/sites/test_
|
|
@@ -29,6 +36,12 @@ Return details about the user custom action with ID _058140e3-0e37-44fc-a1d3-79c
|
|
|
29
36
|
m365 spo customaction get --id 058140e3-0e37-44fc-a1d3-79c487d371a3 --url https://contoso.sharepoint.com/sites/test
|
|
30
37
|
```
|
|
31
38
|
|
|
39
|
+
Return details about the user custom action with Title _YourAppCustomizer_ located in site or site collection _https://contoso.sharepoint.com/sites/test_
|
|
40
|
+
|
|
41
|
+
```sh
|
|
42
|
+
m365 spo customaction get --title "YourAppCustomizer" --url https://contoso.sharepoint.com/sites/test
|
|
43
|
+
```
|
|
44
|
+
|
|
32
45
|
Return details about the user custom action with ID _058140e3-0e37-44fc-a1d3-79c487d371a3_ located in site collection _https://contoso.sharepoint.com/sites/test_
|
|
33
46
|
|
|
34
47
|
```sh
|
|
@@ -10,8 +10,11 @@ m365 spo customaction remove [options]
|
|
|
10
10
|
|
|
11
11
|
## Options
|
|
12
12
|
|
|
13
|
-
`-i, --id
|
|
14
|
-
: Id (GUID) of the custom action to remove
|
|
13
|
+
`-i, --id [id]`
|
|
14
|
+
: Id (GUID) of the custom action to remove. Specify either `id` or `title`
|
|
15
|
+
|
|
16
|
+
`-t, --title [title]`
|
|
17
|
+
: Title of the user custom action to retrieve information for. Specify either `id` or `title`
|
|
15
18
|
|
|
16
19
|
`-u, --url <url>`
|
|
17
20
|
: Url of the site or site collection to remove the custom action from
|
|
@@ -24,6 +27,10 @@ m365 spo customaction remove [options]
|
|
|
24
27
|
|
|
25
28
|
--8<-- "docs/cmd/_global.md"
|
|
26
29
|
|
|
30
|
+
## Remarks
|
|
31
|
+
|
|
32
|
+
If the command finds multiple user custom actions with the specified title, it will prompt you to disambiguate which user custom action it should use, listing the discovered IDs.
|
|
33
|
+
|
|
27
34
|
## Examples
|
|
28
35
|
|
|
29
36
|
Removes user custom action with ID _058140e3-0e37-44fc-a1d3-79c487d371a3_ located in site or site collection _https://contoso.sharepoint.com/sites/test_
|
|
@@ -32,24 +39,48 @@ Removes user custom action with ID _058140e3-0e37-44fc-a1d3-79c487d371a3_ locate
|
|
|
32
39
|
m365 spo customaction remove --id 058140e3-0e37-44fc-a1d3-79c487d371a3 --url https://contoso.sharepoint.com/sites/test
|
|
33
40
|
```
|
|
34
41
|
|
|
42
|
+
Removes user custom action with Title _YourAppCustomizer_ located in site or site collection _https://contoso.sharepoint.com/sites/test_
|
|
43
|
+
|
|
44
|
+
```sh
|
|
45
|
+
m365 spo customaction remove --title "YourAppCustomizer" --url https://contoso.sharepoint.com/sites/test
|
|
46
|
+
```
|
|
47
|
+
|
|
35
48
|
Removes user custom action with ID _058140e3-0e37-44fc-a1d3-79c487d371a3_ located in site or site collection _https://contoso.sharepoint.com/sites/test_. Skips the confirmation prompt message.
|
|
36
49
|
|
|
37
50
|
```sh
|
|
38
51
|
m365 spo customaction remove --id 058140e3-0e37-44fc-a1d3-79c487d371a3 --url https://contoso.sharepoint.com/sites/test --confirm
|
|
39
52
|
```
|
|
40
53
|
|
|
54
|
+
Removes user custom action with Title _YourAppCustomizer_ located in site or site collection _https://contoso.sharepoint.com/sites/test_. Skips the confirmation prompt message.
|
|
55
|
+
|
|
56
|
+
```sh
|
|
57
|
+
m365 spo customaction remove --title "YourAppCustomizer" --url https://contoso.sharepoint.com/sites/test --confirm
|
|
58
|
+
```
|
|
59
|
+
|
|
41
60
|
Removes user custom action with ID _058140e3-0e37-44fc-a1d3-79c487d371a3_ located in site collection _https://contoso.sharepoint.com/sites/test_
|
|
42
61
|
|
|
43
62
|
```sh
|
|
44
63
|
m365 spo customaction remove --id 058140e3-0e37-44fc-a1d3-79c487d371a3 --url https://contoso.sharepoint.com/sites/test --scope Site
|
|
45
64
|
```
|
|
46
65
|
|
|
66
|
+
Removes user custom action with Title _YourAppCustomizer_ located in site collection _https://contoso.sharepoint.com/sites/test_
|
|
67
|
+
|
|
68
|
+
```sh
|
|
69
|
+
m365 spo customaction remove --title "YourAppCustomizer" --url https://contoso.sharepoint.com/sites/test --scope Site
|
|
70
|
+
```
|
|
71
|
+
|
|
47
72
|
Removes user custom action with ID _058140e3-0e37-44fc-a1d3-79c487d371a3_ located in site _https://contoso.sharepoint.com/sites/test_
|
|
48
73
|
|
|
49
74
|
```sh
|
|
50
75
|
m365 spo customaction remove --id 058140e3-0e37-44fc-a1d3-79c487d371a3 --url https://contoso.sharepoint.com/sites/test --scope Web
|
|
51
76
|
```
|
|
52
77
|
|
|
78
|
+
Removes user custom action with Title _YourAppCustomizer_ located in site _https://contoso.sharepoint.com/sites/test_
|
|
79
|
+
|
|
80
|
+
```sh
|
|
81
|
+
m365 spo customaction remove --title "YourAppCustomizer" --url https://contoso.sharepoint.com/sites/test --scope Web
|
|
82
|
+
```
|
|
83
|
+
|
|
53
84
|
## More information
|
|
54
85
|
|
|
55
86
|
- UserCustomAction REST API resources: [https://msdn.microsoft.com/en-us/library/office/dn531432.aspx#bk_UserCustomAction](https://msdn.microsoft.com/en-us/library/office/dn531432.aspx#bk_UserCustomAction)
|