@pnp/cli-microsoft365 6.0.0-beta.a644c64 → 6.0.0-beta.e1e0a1b
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/planner/commands/bucket/bucket-add.js +4 -12
- package/dist/m365/planner/commands/bucket/bucket-get.js +4 -12
- package/dist/m365/planner/commands/bucket/bucket-list.js +4 -12
- package/dist/m365/planner/commands/bucket/bucket-remove.js +4 -12
- package/dist/m365/planner/commands/bucket/bucket-set.js +4 -12
- package/dist/m365/planner/commands/plan/plan-get.js +0 -4
- package/dist/m365/planner/commands/task/task-add.js +4 -10
- package/dist/m365/planner/commands/task/task-get.js +4 -19
- package/dist/m365/planner/commands/task/task-list.js +4 -12
- package/dist/m365/planner/commands/task/task-set.js +4 -10
- package/dist/m365/planner/commands.js +0 -2
- 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/list/list-list.js +1 -10
- package/dist/m365/spo/commands/site/site-list.js +47 -16
- 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 +0 -3
- package/docs/docs/cmd/aad/o365group/o365group-recyclebinitem-restore.md +21 -3
- package/docs/docs/cmd/planner/bucket/bucket-add.md +0 -3
- package/docs/docs/cmd/planner/bucket/bucket-get.md +0 -3
- package/docs/docs/cmd/planner/bucket/bucket-list.md +0 -3
- package/docs/docs/cmd/planner/bucket/bucket-remove.md +0 -3
- package/docs/docs/cmd/planner/bucket/bucket-set.md +0 -3
- package/docs/docs/cmd/planner/plan/plan-get.md +0 -6
- package/docs/docs/cmd/planner/task/task-add.md +0 -3
- package/docs/docs/cmd/planner/task/task-get.md +0 -3
- package/docs/docs/cmd/planner/task/task-list.md +0 -3
- package/docs/docs/cmd/planner/task/task-set.md +0 -3
- 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/list/list-list.md +0 -3
- package/docs/docs/cmd/spo/site/site-list.md +19 -7
- package/docs/docs/cmd/spo/site/site-set.md +50 -6
- package/package.json +1 -1
- package/dist/m365/spo/commands/site/site-classic-add.js +0 -333
- package/dist/m365/spo/commands/site/site-classic-list.js +0 -98
- package/dist/m365/spo/commands/site/site-classic-set.js +0 -358
- package/docs/docs/cmd/spo/site/site-classic-add.md +0 -93
- package/docs/docs/cmd/spo/site/site-classic-list.md +0 -65
- package/docs/docs/cmd/spo/site/site-classic-set.md +0 -99
|
@@ -14,33 +14,84 @@ class AadO365GroupRecycleBinItemRestoreCommand extends GraphCommand_1.default {
|
|
|
14
14
|
alias() {
|
|
15
15
|
return [commands_1.default.O365GROUP_RESTORE];
|
|
16
16
|
}
|
|
17
|
+
getTelemetryProperties(args) {
|
|
18
|
+
const telemetryProps = super.getTelemetryProperties(args);
|
|
19
|
+
telemetryProps.id = typeof args.options.id !== 'undefined';
|
|
20
|
+
telemetryProps.displayName = typeof args.options.displayName !== 'undefined';
|
|
21
|
+
telemetryProps.mailNickname = typeof args.options.mailNickname !== 'undefined';
|
|
22
|
+
return telemetryProps;
|
|
23
|
+
}
|
|
17
24
|
commandAction(logger, args, cb) {
|
|
18
25
|
if (this.verbose) {
|
|
19
|
-
logger.logToStderr(`Restoring Microsoft 365 Group: ${args.options.id}...`);
|
|
26
|
+
logger.logToStderr(`Restoring Microsoft 365 Group: ${args.options.id || args.options.displayName || args.options.mailNickname}...`);
|
|
27
|
+
}
|
|
28
|
+
this
|
|
29
|
+
.getGroupId(args.options)
|
|
30
|
+
.then((groupId) => {
|
|
31
|
+
const requestOptions = {
|
|
32
|
+
url: `${this.resource}/v1.0/directory/deleteditems/${groupId}/restore`,
|
|
33
|
+
headers: {
|
|
34
|
+
accept: 'application/json;odata.metadata=none',
|
|
35
|
+
'content-type': 'application/json'
|
|
36
|
+
},
|
|
37
|
+
responseType: 'json'
|
|
38
|
+
};
|
|
39
|
+
return request_1.default.post(requestOptions);
|
|
40
|
+
})
|
|
41
|
+
.then(_ => cb(), (err) => this.handleRejectedODataJsonPromise(err, logger, cb));
|
|
42
|
+
}
|
|
43
|
+
getGroupId(options) {
|
|
44
|
+
const { id, displayName, mailNickname } = options;
|
|
45
|
+
if (id) {
|
|
46
|
+
return Promise.resolve(id);
|
|
47
|
+
}
|
|
48
|
+
let filterValue = '';
|
|
49
|
+
if (displayName) {
|
|
50
|
+
filterValue = `displayName eq '${utils_1.formatting.encodeQueryParameter(displayName)}'`;
|
|
51
|
+
}
|
|
52
|
+
if (mailNickname) {
|
|
53
|
+
filterValue = `mailNickname eq '${utils_1.formatting.encodeQueryParameter(mailNickname)}'`;
|
|
20
54
|
}
|
|
21
55
|
const requestOptions = {
|
|
22
|
-
url: `${this.resource}/v1.0/directory/
|
|
56
|
+
url: `${this.resource}/v1.0/directory/deletedItems/Microsoft.Graph.Group?$filter=${filterValue}`,
|
|
23
57
|
headers: {
|
|
24
|
-
|
|
25
|
-
'content-type': 'application/json'
|
|
58
|
+
accept: 'application/json;odata.metadata=none'
|
|
26
59
|
},
|
|
27
60
|
responseType: 'json'
|
|
28
61
|
};
|
|
29
|
-
request_1.default
|
|
30
|
-
.
|
|
31
|
-
.then(
|
|
62
|
+
return request_1.default
|
|
63
|
+
.get(requestOptions)
|
|
64
|
+
.then((response) => {
|
|
65
|
+
const groups = response.value;
|
|
66
|
+
if (groups.length === 0) {
|
|
67
|
+
return Promise.reject(`The specified group '${displayName || mailNickname}' does not exist.`);
|
|
68
|
+
}
|
|
69
|
+
if (groups.length > 1) {
|
|
70
|
+
return Promise.reject(`Multiple groups with name '${displayName || mailNickname}' found: ${groups.map(x => x.id).join(',')}.`);
|
|
71
|
+
}
|
|
72
|
+
return Promise.resolve(groups[0].id);
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
optionSets() {
|
|
76
|
+
return [['id', 'displayName', 'mailNickname']];
|
|
32
77
|
}
|
|
33
78
|
options() {
|
|
34
79
|
const options = [
|
|
35
80
|
{
|
|
36
|
-
option: '-i, --id
|
|
81
|
+
option: '-i, --id [id]'
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
option: '-d, --displayName [displayName]'
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
option: '-m, --mailNickname [mailNickname]'
|
|
37
88
|
}
|
|
38
89
|
];
|
|
39
90
|
const parentOptions = super.options();
|
|
40
91
|
return options.concat(parentOptions);
|
|
41
92
|
}
|
|
42
93
|
validate(args) {
|
|
43
|
-
if (!utils_1.validation.isValidGuid(args.options.id)) {
|
|
94
|
+
if (args.options.id && !utils_1.validation.isValidGuid(args.options.id)) {
|
|
44
95
|
return `${args.options.id} is not a valid GUID`;
|
|
45
96
|
}
|
|
46
97
|
return true;
|
|
@@ -17,7 +17,6 @@ class PlannerBucketAddCommand extends GraphCommand_1.default {
|
|
|
17
17
|
getTelemetryProperties(args) {
|
|
18
18
|
const telemetryProps = super.getTelemetryProperties(args);
|
|
19
19
|
telemetryProps.planId = typeof args.options.planId !== 'undefined';
|
|
20
|
-
telemetryProps.planName = typeof args.options.planName !== 'undefined';
|
|
21
20
|
telemetryProps.planTitle = typeof args.options.planTitle !== 'undefined';
|
|
22
21
|
telemetryProps.ownerGroupId = typeof args.options.ownerGroupId !== 'undefined';
|
|
23
22
|
telemetryProps.ownerGroupName = typeof args.options.ownerGroupName !== 'undefined';
|
|
@@ -28,10 +27,6 @@ class PlannerBucketAddCommand extends GraphCommand_1.default {
|
|
|
28
27
|
return ['id', 'name', 'planId', 'orderHint'];
|
|
29
28
|
}
|
|
30
29
|
commandAction(logger, args, cb) {
|
|
31
|
-
if (args.options.planName) {
|
|
32
|
-
args.options.planTitle = args.options.planName;
|
|
33
|
-
this.warn(logger, `Option 'planName' is deprecated. Please use 'planTitle' instead`);
|
|
34
|
-
}
|
|
35
30
|
if (utils_1.accessToken.isAppOnlyAccessToken(Auth_1.default.service.accessTokens[this.resource].accessToken)) {
|
|
36
31
|
this.handleError('This command does not support application permissions.', logger, cb);
|
|
37
32
|
return;
|
|
@@ -83,9 +78,6 @@ class PlannerBucketAddCommand extends GraphCommand_1.default {
|
|
|
83
78
|
{
|
|
84
79
|
option: "--planId [planId]"
|
|
85
80
|
},
|
|
86
|
-
{
|
|
87
|
-
option: "--planName [planName]"
|
|
88
|
-
},
|
|
89
81
|
{
|
|
90
82
|
option: "--planTitle [planTitle]"
|
|
91
83
|
},
|
|
@@ -103,16 +95,16 @@ class PlannerBucketAddCommand extends GraphCommand_1.default {
|
|
|
103
95
|
return options.concat(parentOptions);
|
|
104
96
|
}
|
|
105
97
|
validate(args) {
|
|
106
|
-
if (!args.options.planId && !args.options.
|
|
98
|
+
if (!args.options.planId && !args.options.planTitle) {
|
|
107
99
|
return 'Specify either planId or planTitle';
|
|
108
100
|
}
|
|
109
|
-
if (args.options.planId &&
|
|
101
|
+
if (args.options.planId && args.options.planTitle) {
|
|
110
102
|
return 'Specify either planId or planTitle but not both';
|
|
111
103
|
}
|
|
112
|
-
if (
|
|
104
|
+
if (args.options.planTitle && !args.options.ownerGroupId && !args.options.ownerGroupName) {
|
|
113
105
|
return 'Specify either ownerGroupId or ownerGroupName when using planTitle';
|
|
114
106
|
}
|
|
115
|
-
if (
|
|
107
|
+
if (args.options.planTitle && args.options.ownerGroupId && args.options.ownerGroupName) {
|
|
116
108
|
return 'Specify either ownerGroupId or ownerGroupName when using planTitle but not both';
|
|
117
109
|
}
|
|
118
110
|
if (args.options.ownerGroupId && !utils_1.validation.isValidGuid(args.options.ownerGroupId)) {
|
|
@@ -28,17 +28,12 @@ class PlannerBucketGetCommand extends GraphCommand_1.default {
|
|
|
28
28
|
telemetryProps.id = typeof args.options.id !== 'undefined';
|
|
29
29
|
telemetryProps.name = typeof args.options.name !== 'undefined';
|
|
30
30
|
telemetryProps.planId = typeof args.options.planId !== 'undefined';
|
|
31
|
-
telemetryProps.planName = typeof args.options.planName !== 'undefined';
|
|
32
31
|
telemetryProps.planTitle = typeof args.options.planTitle !== 'undefined';
|
|
33
32
|
telemetryProps.ownerGroupId = typeof args.options.ownerGroupId !== 'undefined';
|
|
34
33
|
telemetryProps.ownerGroupName = typeof args.options.ownerGroupName !== 'undefined';
|
|
35
34
|
return telemetryProps;
|
|
36
35
|
}
|
|
37
36
|
commandAction(logger, args, cb) {
|
|
38
|
-
if (args.options.planName) {
|
|
39
|
-
args.options.planTitle = args.options.planName;
|
|
40
|
-
this.warn(logger, `Option 'planName' is deprecated. Please use 'planTitle' instead`);
|
|
41
|
-
}
|
|
42
37
|
if (utils_1.accessToken.isAppOnlyAccessToken(Auth_1.default.service.accessTokens[this.resource].accessToken)) {
|
|
43
38
|
this.handleError('This command does not support application permissions.', logger, cb);
|
|
44
39
|
return;
|
|
@@ -121,9 +116,6 @@ class PlannerBucketGetCommand extends GraphCommand_1.default {
|
|
|
121
116
|
{
|
|
122
117
|
option: '--planId [planId]'
|
|
123
118
|
},
|
|
124
|
-
{
|
|
125
|
-
option: '--planName [planName]'
|
|
126
|
-
},
|
|
127
119
|
{
|
|
128
120
|
option: "--planTitle [planTitle]"
|
|
129
121
|
},
|
|
@@ -139,7 +131,7 @@ class PlannerBucketGetCommand extends GraphCommand_1.default {
|
|
|
139
131
|
}
|
|
140
132
|
validate(args) {
|
|
141
133
|
if (args.options.id) {
|
|
142
|
-
if (args.options.planId || args.options.
|
|
134
|
+
if (args.options.planId || args.options.planTitle || args.options.ownerGroupId || args.options.ownerGroupName) {
|
|
143
135
|
return 'Don\'t specify planId, planTitle, ownerGroupId or ownerGroupName when using id';
|
|
144
136
|
}
|
|
145
137
|
if (args.options.name) {
|
|
@@ -147,13 +139,13 @@ class PlannerBucketGetCommand extends GraphCommand_1.default {
|
|
|
147
139
|
}
|
|
148
140
|
}
|
|
149
141
|
if (args.options.name) {
|
|
150
|
-
if (!args.options.planId && !args.options.
|
|
142
|
+
if (!args.options.planId && !args.options.planTitle) {
|
|
151
143
|
return 'Specify either planId or planTitle when using name';
|
|
152
144
|
}
|
|
153
|
-
if (args.options.planId &&
|
|
145
|
+
if (args.options.planId && args.options.planTitle) {
|
|
154
146
|
return 'Specify either planId or planTitle when using name but not both';
|
|
155
147
|
}
|
|
156
|
-
if (args.options.
|
|
148
|
+
if (args.options.planTitle) {
|
|
157
149
|
if (!args.options.ownerGroupId && !args.options.ownerGroupName) {
|
|
158
150
|
return 'Specify either ownerGroupId or ownerGroupName when using planTitle';
|
|
159
151
|
}
|
|
@@ -16,7 +16,6 @@ class PlannerBucketListCommand extends GraphCommand_1.default {
|
|
|
16
16
|
getTelemetryProperties(args) {
|
|
17
17
|
const telemetryProps = super.getTelemetryProperties(args);
|
|
18
18
|
telemetryProps.planId = typeof args.options.planId !== 'undefined';
|
|
19
|
-
telemetryProps.planName = typeof args.options.planName !== 'undefined';
|
|
20
19
|
telemetryProps.planTitle = typeof args.options.planTitle !== 'undefined';
|
|
21
20
|
telemetryProps.ownerGroupId = typeof args.options.ownerGroupId !== 'undefined';
|
|
22
21
|
telemetryProps.ownerGroupName = typeof args.options.ownerGroupName !== 'undefined';
|
|
@@ -26,10 +25,6 @@ class PlannerBucketListCommand extends GraphCommand_1.default {
|
|
|
26
25
|
return ['id', 'name', 'planId', 'orderHint'];
|
|
27
26
|
}
|
|
28
27
|
commandAction(logger, args, cb) {
|
|
29
|
-
if (args.options.planName) {
|
|
30
|
-
args.options.planTitle = args.options.planName;
|
|
31
|
-
this.warn(logger, `Option 'planName' is deprecated. Please use 'planTitle' instead`);
|
|
32
|
-
}
|
|
33
28
|
if (utils_1.accessToken.isAppOnlyAccessToken(Auth_1.default.service.accessTokens[this.resource].accessToken)) {
|
|
34
29
|
this.handleError('This command does not support application permissions.', logger, cb);
|
|
35
30
|
return;
|
|
@@ -64,9 +59,6 @@ class PlannerBucketListCommand extends GraphCommand_1.default {
|
|
|
64
59
|
{
|
|
65
60
|
option: '--planId [planId]'
|
|
66
61
|
},
|
|
67
|
-
{
|
|
68
|
-
option: '--planName [planName]'
|
|
69
|
-
},
|
|
70
62
|
{
|
|
71
63
|
option: "--planTitle [planTitle]"
|
|
72
64
|
},
|
|
@@ -81,16 +73,16 @@ class PlannerBucketListCommand extends GraphCommand_1.default {
|
|
|
81
73
|
return options.concat(parentOptions);
|
|
82
74
|
}
|
|
83
75
|
validate(args) {
|
|
84
|
-
if (!args.options.planId && !args.options.
|
|
76
|
+
if (!args.options.planId && !args.options.planTitle) {
|
|
85
77
|
return 'Specify either planId or planTitle';
|
|
86
78
|
}
|
|
87
|
-
if (args.options.planId &&
|
|
79
|
+
if (args.options.planId && args.options.planTitle) {
|
|
88
80
|
return 'Specify either planId or planTitle but not both';
|
|
89
81
|
}
|
|
90
|
-
if (
|
|
82
|
+
if (args.options.planTitle && !args.options.ownerGroupId && !args.options.ownerGroupName) {
|
|
91
83
|
return 'Specify either ownerGroupId or ownerGroupName when using planTitle';
|
|
92
84
|
}
|
|
93
|
-
if (
|
|
85
|
+
if (args.options.planTitle && args.options.ownerGroupId && args.options.ownerGroupName) {
|
|
94
86
|
return 'Specify either ownerGroupId or ownerGroupName when using planTitle but not both';
|
|
95
87
|
}
|
|
96
88
|
if (args.options.ownerGroupId && !utils_1.validation.isValidGuid(args.options.ownerGroupId)) {
|
|
@@ -20,7 +20,6 @@ class PlannerBucketRemoveCommand extends GraphCommand_1.default {
|
|
|
20
20
|
telemetryProps.id = typeof args.options.id !== 'undefined';
|
|
21
21
|
telemetryProps.name = typeof args.options.name !== 'undefined';
|
|
22
22
|
telemetryProps.planId = typeof args.options.planId !== 'undefined';
|
|
23
|
-
telemetryProps.planName = typeof args.options.planName !== 'undefined';
|
|
24
23
|
telemetryProps.planTitle = typeof args.options.planTitle !== 'undefined';
|
|
25
24
|
telemetryProps.ownerGroupId = typeof args.options.ownerGroupId !== 'undefined';
|
|
26
25
|
telemetryProps.ownerGroupName = typeof args.options.ownerGroupName !== 'undefined';
|
|
@@ -28,10 +27,6 @@ class PlannerBucketRemoveCommand extends GraphCommand_1.default {
|
|
|
28
27
|
return telemetryProps;
|
|
29
28
|
}
|
|
30
29
|
commandAction(logger, args, cb) {
|
|
31
|
-
if (args.options.planName) {
|
|
32
|
-
args.options.planTitle = args.options.planName;
|
|
33
|
-
this.warn(logger, `Option 'planName' is deprecated. Please use 'planTitle' instead`);
|
|
34
|
-
}
|
|
35
30
|
if (utils_1.accessToken.isAppOnlyAccessToken(Auth_1.default.service.accessTokens[this.resource].accessToken)) {
|
|
36
31
|
this.handleError('This command does not support application permissions.', logger, cb);
|
|
37
32
|
return;
|
|
@@ -135,9 +130,6 @@ class PlannerBucketRemoveCommand extends GraphCommand_1.default {
|
|
|
135
130
|
{
|
|
136
131
|
option: '--planId [planId]'
|
|
137
132
|
},
|
|
138
|
-
{
|
|
139
|
-
option: '--planName [planName]'
|
|
140
|
-
},
|
|
141
133
|
{
|
|
142
134
|
option: "--planTitle [planTitle]"
|
|
143
135
|
},
|
|
@@ -161,18 +153,18 @@ class PlannerBucketRemoveCommand extends GraphCommand_1.default {
|
|
|
161
153
|
}
|
|
162
154
|
validate(args) {
|
|
163
155
|
if (args.options.id) {
|
|
164
|
-
if (args.options.planId || args.options.
|
|
156
|
+
if (args.options.planId || args.options.planTitle || args.options.ownerGroupId || args.options.ownerGroupName) {
|
|
165
157
|
return 'Don\'t specify planId, planTitle, ownerGroupId or ownerGroupName when using id';
|
|
166
158
|
}
|
|
167
159
|
}
|
|
168
160
|
else {
|
|
169
|
-
if (!args.options.planId && !args.options.
|
|
161
|
+
if (!args.options.planId && !args.options.planTitle) {
|
|
170
162
|
return 'Specify either planId or planTitle when using name';
|
|
171
163
|
}
|
|
172
|
-
if (args.options.planId &&
|
|
164
|
+
if (args.options.planId && args.options.planTitle) {
|
|
173
165
|
return 'Specify either planId or planTitle when using name but not both';
|
|
174
166
|
}
|
|
175
|
-
if (args.options.
|
|
167
|
+
if (args.options.planTitle) {
|
|
176
168
|
if (!args.options.ownerGroupId && !args.options.ownerGroupName) {
|
|
177
169
|
return 'Specify either ownerGroupId or ownerGroupName when using planTitle';
|
|
178
170
|
}
|
|
@@ -19,7 +19,6 @@ class PlannerBucketSetCommand extends GraphCommand_1.default {
|
|
|
19
19
|
telemetryProps.id = typeof args.options.id !== 'undefined';
|
|
20
20
|
telemetryProps.name = typeof args.options.name !== 'undefined';
|
|
21
21
|
telemetryProps.planId = typeof args.options.planId !== 'undefined';
|
|
22
|
-
telemetryProps.planName = typeof args.options.planName !== 'undefined';
|
|
23
22
|
telemetryProps.planTitle = typeof args.options.planTitle !== 'undefined';
|
|
24
23
|
telemetryProps.ownerGroupId = typeof args.options.ownerGroupId !== 'undefined';
|
|
25
24
|
telemetryProps.ownerGroupName = typeof args.options.ownerGroupName !== 'undefined';
|
|
@@ -28,10 +27,6 @@ class PlannerBucketSetCommand extends GraphCommand_1.default {
|
|
|
28
27
|
return telemetryProps;
|
|
29
28
|
}
|
|
30
29
|
commandAction(logger, args, cb) {
|
|
31
|
-
if (args.options.planName) {
|
|
32
|
-
args.options.planTitle = args.options.planName;
|
|
33
|
-
this.warn(logger, `Option 'planName' is deprecated. Please use 'planTitle' instead`);
|
|
34
|
-
}
|
|
35
30
|
if (utils_1.accessToken.isAppOnlyAccessToken(Auth_1.default.service.accessTokens[this.resource].accessToken)) {
|
|
36
31
|
this.handleError('This command does not support application permissions.', logger, cb);
|
|
37
32
|
return;
|
|
@@ -123,9 +118,6 @@ class PlannerBucketSetCommand extends GraphCommand_1.default {
|
|
|
123
118
|
{
|
|
124
119
|
option: '--planId [planId]'
|
|
125
120
|
},
|
|
126
|
-
{
|
|
127
|
-
option: '--planName [planName]'
|
|
128
|
-
},
|
|
129
121
|
{
|
|
130
122
|
option: "--planTitle [planTitle]"
|
|
131
123
|
},
|
|
@@ -152,18 +144,18 @@ class PlannerBucketSetCommand extends GraphCommand_1.default {
|
|
|
152
144
|
}
|
|
153
145
|
validate(args) {
|
|
154
146
|
if (args.options.id) {
|
|
155
|
-
if (args.options.planId || args.options.
|
|
147
|
+
if (args.options.planId || args.options.planTitle || args.options.ownerGroupId || args.options.ownerGroupName) {
|
|
156
148
|
return 'Don\'t specify planId, planTitle, ownerGroupId or ownerGroupName when using id';
|
|
157
149
|
}
|
|
158
150
|
}
|
|
159
151
|
if (args.options.name) {
|
|
160
|
-
if (!args.options.planId && !args.options.
|
|
152
|
+
if (!args.options.planId && !args.options.planTitle) {
|
|
161
153
|
return 'Specify either planId or planTitle when using name';
|
|
162
154
|
}
|
|
163
|
-
if (args.options.planId &&
|
|
155
|
+
if (args.options.planId && args.options.planTitle) {
|
|
164
156
|
return 'Specify either planId or planTitle when using name but not both';
|
|
165
157
|
}
|
|
166
|
-
if (args.options.
|
|
158
|
+
if (args.options.planTitle) {
|
|
167
159
|
if (!args.options.ownerGroupId && !args.options.ownerGroupName) {
|
|
168
160
|
return 'Specify either ownerGroupId or ownerGroupName when using planTitle';
|
|
169
161
|
}
|
|
@@ -11,9 +11,6 @@ class PlannerPlanGetCommand extends GraphCommand_1.default {
|
|
|
11
11
|
get name() {
|
|
12
12
|
return commands_1.default.PLAN_GET;
|
|
13
13
|
}
|
|
14
|
-
alias() {
|
|
15
|
-
return [commands_1.default.PLAN_DETAILS_GET];
|
|
16
|
-
}
|
|
17
14
|
get description() {
|
|
18
15
|
return 'Get a Microsoft Planner plan';
|
|
19
16
|
}
|
|
@@ -31,7 +28,6 @@ class PlannerPlanGetCommand extends GraphCommand_1.default {
|
|
|
31
28
|
return ['id', 'title', 'createdDateTime', 'owner', '@odata.etag'];
|
|
32
29
|
}
|
|
33
30
|
commandAction(logger, args, cb) {
|
|
34
|
-
this.showDeprecationWarning(logger, commands_1.default.PLAN_DETAILS_GET, commands_1.default.PLAN_GET);
|
|
35
31
|
if (utils_1.accessToken.isAppOnlyAccessToken(Auth_1.default.service.accessTokens[this.resource].accessToken)) {
|
|
36
32
|
this.handleError('This command does not support application permissions.', logger, cb);
|
|
37
33
|
return;
|
|
@@ -23,7 +23,6 @@ class PlannerTaskAddCommand extends GraphCommand_1.default {
|
|
|
23
23
|
getTelemetryProperties(args) {
|
|
24
24
|
const telemetryProps = super.getTelemetryProperties(args);
|
|
25
25
|
telemetryProps.planId = typeof args.options.planId !== 'undefined';
|
|
26
|
-
telemetryProps.planName = typeof args.options.planName !== 'undefined';
|
|
27
26
|
telemetryProps.planTitle = typeof args.options.planTitle !== 'undefined';
|
|
28
27
|
telemetryProps.ownerGroupId = typeof args.options.ownerGroupId !== 'undefined';
|
|
29
28
|
telemetryProps.ownerGroupName = typeof args.options.ownerGroupName !== 'undefined';
|
|
@@ -43,10 +42,6 @@ class PlannerTaskAddCommand extends GraphCommand_1.default {
|
|
|
43
42
|
return telemetryProps;
|
|
44
43
|
}
|
|
45
44
|
commandAction(logger, args, cb) {
|
|
46
|
-
if (args.options.planName) {
|
|
47
|
-
args.options.planTitle = args.options.planName;
|
|
48
|
-
this.warn(logger, `Option 'planName' is deprecated. Please use 'planTitle' instead`);
|
|
49
|
-
}
|
|
50
45
|
if (utils_1.accessToken.isAppOnlyAccessToken(Auth_1.default.service.accessTokens[this.resource].accessToken)) {
|
|
51
46
|
this.handleError('This command does not support application permissions.', logger, cb);
|
|
52
47
|
return;
|
|
@@ -227,7 +222,6 @@ class PlannerTaskAddCommand extends GraphCommand_1.default {
|
|
|
227
222
|
const options = [
|
|
228
223
|
{ option: '-t, --title <title>' },
|
|
229
224
|
{ option: '--planId [planId]' },
|
|
230
|
-
{ option: '--planName [planName]' },
|
|
231
225
|
{ option: '--planTitle [planTitle]' },
|
|
232
226
|
{ option: '--ownerGroupId [ownerGroupId]' },
|
|
233
227
|
{ option: '--ownerGroupName [ownerGroupName]' },
|
|
@@ -255,16 +249,16 @@ class PlannerTaskAddCommand extends GraphCommand_1.default {
|
|
|
255
249
|
return options.concat(parentOptions);
|
|
256
250
|
}
|
|
257
251
|
validate(args) {
|
|
258
|
-
if (!args.options.planId && !args.options.
|
|
252
|
+
if (!args.options.planId && !args.options.planTitle) {
|
|
259
253
|
return 'Specify either planId or planTitle';
|
|
260
254
|
}
|
|
261
|
-
if (args.options.planId &&
|
|
255
|
+
if (args.options.planId && args.options.planTitle) {
|
|
262
256
|
return 'Specify either planId or planTitle but not both';
|
|
263
257
|
}
|
|
264
|
-
if (
|
|
258
|
+
if (args.options.planTitle && !args.options.ownerGroupId && !args.options.ownerGroupName) {
|
|
265
259
|
return 'Specify either ownerGroupId or ownerGroupName when using planTitle';
|
|
266
260
|
}
|
|
267
|
-
if (
|
|
261
|
+
if (args.options.planTitle && args.options.ownerGroupId && args.options.ownerGroupName) {
|
|
268
262
|
return 'Specify either ownerGroupId or ownerGroupName when using planTitle but not both';
|
|
269
263
|
}
|
|
270
264
|
if (args.options.ownerGroupId && !utils_1.validation.isValidGuid(args.options.ownerGroupId)) {
|
|
@@ -11,9 +11,6 @@ class PlannerTaskGetCommand extends GraphCommand_1.default {
|
|
|
11
11
|
get name() {
|
|
12
12
|
return commands_1.default.TASK_GET;
|
|
13
13
|
}
|
|
14
|
-
alias() {
|
|
15
|
-
return [commands_1.default.TASK_DETAILS_GET];
|
|
16
|
-
}
|
|
17
14
|
get description() {
|
|
18
15
|
return 'Retrieve the specified planner task';
|
|
19
16
|
}
|
|
@@ -24,25 +21,15 @@ class PlannerTaskGetCommand extends GraphCommand_1.default {
|
|
|
24
21
|
telemetryProps.bucketId = typeof args.options.bucketId !== 'undefined';
|
|
25
22
|
telemetryProps.bucketName = typeof args.options.bucketName !== 'undefined';
|
|
26
23
|
telemetryProps.planId = typeof args.options.planId !== 'undefined';
|
|
27
|
-
telemetryProps.planName = typeof args.options.planName !== 'undefined';
|
|
28
24
|
telemetryProps.ownerGroupId = typeof args.options.ownerGroupId !== 'undefined';
|
|
29
25
|
telemetryProps.ownerGroupName = typeof args.options.ownerGroupName !== 'undefined';
|
|
30
26
|
return telemetryProps;
|
|
31
27
|
}
|
|
32
28
|
commandAction(logger, args, cb) {
|
|
33
|
-
this.showDeprecationWarning(logger, commands_1.default.TASK_DETAILS_GET, commands_1.default.TASK_GET);
|
|
34
|
-
if (args.options.planName) {
|
|
35
|
-
args.options.planTitle = args.options.planName;
|
|
36
|
-
this.warn(logger, `Option 'planName' is deprecated. Please use 'planTitle' instead`);
|
|
37
|
-
}
|
|
38
29
|
if (utils_1.accessToken.isAppOnlyAccessToken(Auth_1.default.service.accessTokens[this.resource].accessToken)) {
|
|
39
30
|
this.handleError('This command does not support application permissions.', logger, cb);
|
|
40
31
|
return;
|
|
41
32
|
}
|
|
42
|
-
// This check has been added to support task details get alias. Needs to be removed when deprecation is removed.
|
|
43
|
-
if (args.options.taskId) {
|
|
44
|
-
args.options.id = args.options.taskId;
|
|
45
|
-
}
|
|
46
33
|
this
|
|
47
34
|
.getTaskId(args.options)
|
|
48
35
|
.then(taskId => this.getTask(taskId))
|
|
@@ -157,13 +144,11 @@ class PlannerTaskGetCommand extends GraphCommand_1.default {
|
|
|
157
144
|
}
|
|
158
145
|
options() {
|
|
159
146
|
const options = [
|
|
160
|
-
{ option: '--taskId [taskId]' },
|
|
161
147
|
{ option: '-i, --id [id]' },
|
|
162
148
|
{ option: '-t, --title [title]' },
|
|
163
149
|
{ option: '--bucketId [bucketId]' },
|
|
164
150
|
{ option: '--bucketName [bucketName]' },
|
|
165
151
|
{ option: '--planId [planId]' },
|
|
166
|
-
{ option: '--planName [planName]' },
|
|
167
152
|
{ option: '--planTitle [planTitle]' },
|
|
168
153
|
{ option: '--ownerGroupId [ownerGroupId]' },
|
|
169
154
|
{ option: '--ownerGroupName [ownerGroupName]' }
|
|
@@ -178,16 +163,16 @@ class PlannerTaskGetCommand extends GraphCommand_1.default {
|
|
|
178
163
|
if (args.options.title && args.options.bucketId && args.options.bucketName) {
|
|
179
164
|
return 'Specify either bucketId or bucketName when using title but not both';
|
|
180
165
|
}
|
|
181
|
-
if (args.options.bucketName && !args.options.planId && !args.options.
|
|
166
|
+
if (args.options.bucketName && !args.options.planId && !args.options.planTitle) {
|
|
182
167
|
return 'Specify either planId or planTitle when using bucketName';
|
|
183
168
|
}
|
|
184
|
-
if (args.options.bucketName && args.options.planId &&
|
|
169
|
+
if (args.options.bucketName && args.options.planId && args.options.planTitle) {
|
|
185
170
|
return 'Specify either planId or planTitle when using bucketName but not both';
|
|
186
171
|
}
|
|
187
|
-
if (
|
|
172
|
+
if (args.options.planTitle && !args.options.ownerGroupId && !args.options.ownerGroupName) {
|
|
188
173
|
return 'Specify either ownerGroupId or ownerGroupName when using planTitle';
|
|
189
174
|
}
|
|
190
|
-
if (
|
|
175
|
+
if (args.options.planTitle && args.options.ownerGroupId && args.options.ownerGroupName) {
|
|
191
176
|
return 'Specify either ownerGroupId or ownerGroupName when using planTitle but not both';
|
|
192
177
|
}
|
|
193
178
|
if (args.options.ownerGroupId && !utils_1.validation.isValidGuid(args.options.ownerGroupId)) {
|
|
@@ -19,7 +19,6 @@ class PlannerTaskListCommand extends GraphCommand_1.default {
|
|
|
19
19
|
telemetryProps.bucketId = typeof args.options.bucketId !== 'undefined';
|
|
20
20
|
telemetryProps.bucketName = typeof args.options.bucketName !== 'undefined';
|
|
21
21
|
telemetryProps.planId = typeof args.options.planId !== 'undefined';
|
|
22
|
-
telemetryProps.planName = typeof args.options.planName !== 'undefined';
|
|
23
22
|
telemetryProps.planTitle = typeof args.options.planTitle !== 'undefined';
|
|
24
23
|
telemetryProps.ownerGroupId = typeof args.options.ownerGroupId !== 'undefined';
|
|
25
24
|
telemetryProps.ownerGroupName = typeof args.options.ownerGroupName !== 'undefined';
|
|
@@ -29,10 +28,6 @@ class PlannerTaskListCommand extends GraphCommand_1.default {
|
|
|
29
28
|
return ['id', 'title', 'startDateTime', 'dueDateTime', 'completedDateTime'];
|
|
30
29
|
}
|
|
31
30
|
commandAction(logger, args, cb) {
|
|
32
|
-
if (args.options.planName) {
|
|
33
|
-
args.options.planTitle = args.options.planName;
|
|
34
|
-
this.warn(logger, `Option 'planName' is deprecated. Please use 'planTitle' instead`);
|
|
35
|
-
}
|
|
36
31
|
if (utils_1.accessToken.isAppOnlyAccessToken(Auth_1.default.service.accessTokens[this.resource].accessToken)) {
|
|
37
32
|
this.handleError('This command does not support application permissions.', logger, cb);
|
|
38
33
|
return;
|
|
@@ -150,9 +145,6 @@ class PlannerTaskListCommand extends GraphCommand_1.default {
|
|
|
150
145
|
{
|
|
151
146
|
option: '--planId [planId]'
|
|
152
147
|
},
|
|
153
|
-
{
|
|
154
|
-
option: '--planName [planName]'
|
|
155
|
-
},
|
|
156
148
|
{
|
|
157
149
|
option: '--planTitle [planTitle]'
|
|
158
150
|
},
|
|
@@ -170,16 +162,16 @@ class PlannerTaskListCommand extends GraphCommand_1.default {
|
|
|
170
162
|
if (args.options.bucketId && args.options.bucketName) {
|
|
171
163
|
return 'To retrieve tasks from a bucket, specify bucketId or bucketName, but not both';
|
|
172
164
|
}
|
|
173
|
-
if (args.options.bucketName && !args.options.planId && !args.options.
|
|
165
|
+
if (args.options.bucketName && !args.options.planId && !args.options.planTitle) {
|
|
174
166
|
return 'Specify either planId or planTitle when using bucketName';
|
|
175
167
|
}
|
|
176
|
-
if (args.options.planId &&
|
|
168
|
+
if (args.options.planId && args.options.planTitle) {
|
|
177
169
|
return 'Specify either planId or planTitle but not both';
|
|
178
170
|
}
|
|
179
|
-
if (
|
|
171
|
+
if (args.options.planTitle && !args.options.ownerGroupId && !args.options.ownerGroupName) {
|
|
180
172
|
return 'Specify either ownerGroupId or ownerGroupName when using planTitle';
|
|
181
173
|
}
|
|
182
|
-
if (
|
|
174
|
+
if (args.options.planTitle && args.options.ownerGroupId && args.options.ownerGroupName) {
|
|
183
175
|
return 'Specify either ownerGroupId or ownerGroupName when using planTitle but not both';
|
|
184
176
|
}
|
|
185
177
|
if (args.options.ownerGroupId && !utils_1.validation.isValidGuid(args.options.ownerGroupId)) {
|
|
@@ -23,7 +23,6 @@ class PlannerTaskSetCommand extends GraphCommand_1.default {
|
|
|
23
23
|
const telemetryProps = super.getTelemetryProperties(args);
|
|
24
24
|
telemetryProps.title = typeof args.options.title !== 'undefined';
|
|
25
25
|
telemetryProps.planId = typeof args.options.planId !== 'undefined';
|
|
26
|
-
telemetryProps.planName = typeof args.options.planName !== 'undefined';
|
|
27
26
|
telemetryProps.planTitle = typeof args.options.planTitle !== 'undefined';
|
|
28
27
|
telemetryProps.ownerGroupId = typeof args.options.ownerGroupId !== 'undefined';
|
|
29
28
|
telemetryProps.ownerGroupName = typeof args.options.ownerGroupName !== 'undefined';
|
|
@@ -42,10 +41,6 @@ class PlannerTaskSetCommand extends GraphCommand_1.default {
|
|
|
42
41
|
return telemetryProps;
|
|
43
42
|
}
|
|
44
43
|
commandAction(logger, args, cb) {
|
|
45
|
-
if (args.options.planName) {
|
|
46
|
-
args.options.planTitle = args.options.planName;
|
|
47
|
-
this.warn(logger, `Option 'planName' is deprecated. Please use 'planTitle' instead`);
|
|
48
|
-
}
|
|
49
44
|
if (utils_1.accessToken.isAppOnlyAccessToken(Auth_1.default.service.accessTokens[this.resource].accessToken)) {
|
|
50
45
|
this.handleError('This command does not support application permissions.', logger, cb);
|
|
51
46
|
return;
|
|
@@ -269,7 +264,6 @@ class PlannerTaskSetCommand extends GraphCommand_1.default {
|
|
|
269
264
|
{ option: '-i, --id <id>' },
|
|
270
265
|
{ option: '-t, --title [title]' },
|
|
271
266
|
{ option: '--planId [planId]' },
|
|
272
|
-
{ option: '--planName [planName]' },
|
|
273
267
|
{ option: '--planTitle [planTitle]' },
|
|
274
268
|
{ option: '--ownerGroupId [ownerGroupId]' },
|
|
275
269
|
{ option: '--ownerGroupName [ownerGroupName]' },
|
|
@@ -293,16 +287,16 @@ class PlannerTaskSetCommand extends GraphCommand_1.default {
|
|
|
293
287
|
if (args.options.bucketId && args.options.bucketName) {
|
|
294
288
|
return 'Specify either bucketId or bucketName but not both';
|
|
295
289
|
}
|
|
296
|
-
if (args.options.bucketName && !args.options.planId && !args.options.
|
|
290
|
+
if (args.options.bucketName && !args.options.planId && !args.options.planTitle) {
|
|
297
291
|
return 'Specify either planId or planTitle when using bucketName';
|
|
298
292
|
}
|
|
299
|
-
if (args.options.bucketName && args.options.planId &&
|
|
293
|
+
if (args.options.bucketName && args.options.planId && args.options.planTitle) {
|
|
300
294
|
return 'Specify either planId or planTitle when using bucketName but not both';
|
|
301
295
|
}
|
|
302
|
-
if (
|
|
296
|
+
if (args.options.planTitle && !args.options.ownerGroupId && !args.options.ownerGroupName) {
|
|
303
297
|
return 'Specify either ownerGroupId or ownerGroupName when using planTitle';
|
|
304
298
|
}
|
|
305
|
-
if (
|
|
299
|
+
if (args.options.planTitle && args.options.ownerGroupId && args.options.ownerGroupName) {
|
|
306
300
|
return 'Specify either ownerGroupId or ownerGroupName when using planTitle but not both';
|
|
307
301
|
}
|
|
308
302
|
if (args.options.ownerGroupId && !utils_1.validation.isValidGuid(args.options.ownerGroupId)) {
|
|
@@ -8,7 +8,6 @@ exports.default = {
|
|
|
8
8
|
BUCKET_SET: `${prefix} bucket set`,
|
|
9
9
|
BUCKET_REMOVE: `${prefix} bucket remove`,
|
|
10
10
|
PLAN_ADD: `${prefix} plan add`,
|
|
11
|
-
PLAN_DETAILS_GET: `${prefix} plan details get`,
|
|
12
11
|
PLAN_GET: `${prefix} plan get`,
|
|
13
12
|
PLAN_LIST: `${prefix} plan list`,
|
|
14
13
|
PLAN_REMOVE: `${prefix} plan remove`,
|
|
@@ -16,7 +15,6 @@ exports.default = {
|
|
|
16
15
|
TASK_CHECKLISTITEM_ADD: `${prefix} task checklistitem add`,
|
|
17
16
|
TASK_CHECKLISTITEM_LIST: `${prefix} task checklistitem list`,
|
|
18
17
|
TASK_CHECKLISTITEM_REMOVE: `${prefix} task checklistitem remove`,
|
|
19
|
-
TASK_DETAILS_GET: `${prefix} task details get`,
|
|
20
18
|
TASK_GET: `${prefix} task get`,
|
|
21
19
|
TASK_LIST: `${prefix} task list`,
|
|
22
20
|
TASK_REFERENCE_ADD: `${prefix} task reference add`,
|