@pnp/cli-microsoft365 5.5.0-beta.4e973d9 → 5.5.0-beta.5a6c547
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/Auth.js +1 -1
- package/dist/m365/planner/commands/plan/plan-get.js +57 -16
- package/dist/m365/planner/commands/tenant/tenant-settings-set.js +95 -0
- package/dist/m365/planner/commands.js +2 -1
- package/docs/docs/cmd/planner/plan/plan-get.md +14 -2
- package/docs/docs/cmd/planner/tenant/tenant-settings-set.md +56 -0
- package/docs/docs/cmd/tenant/serviceannouncement/serviceannouncement-health-get.md +1 -1
- package/docs/docs/cmd/tenant/serviceannouncement/serviceannouncement-healthissue-list.md +1 -1
- package/docs/docs/cmd/tenant/serviceannouncement/serviceannouncement-message-list.md +1 -1
- package/package.json +1 -1
- package/dist/m365/planner/commands/plan/plan-details-get.js +0 -116
- package/docs/docs/cmd/planner/plan/plan-details-get.md +0 -45
package/dist/Auth.js
CHANGED
|
@@ -330,7 +330,7 @@ class Auth {
|
|
|
330
330
|
}
|
|
331
331
|
return this.clientApplication.acquireTokenByUsernamePassword({
|
|
332
332
|
username: this.service.userName,
|
|
333
|
-
password:
|
|
333
|
+
password: this.service.password,
|
|
334
334
|
scopes: [`${resource}/.default`]
|
|
335
335
|
});
|
|
336
336
|
});
|
|
@@ -6,15 +6,21 @@ const GraphCommand_1 = require("../../../base/GraphCommand");
|
|
|
6
6
|
const commands_1 = require("../../commands");
|
|
7
7
|
const Auth_1 = require("../../../../Auth");
|
|
8
8
|
const aadGroup_1 = require("../../../../utils/aadGroup");
|
|
9
|
+
const request_1 = require("../../../../request");
|
|
9
10
|
class PlannerPlanGetCommand extends GraphCommand_1.default {
|
|
10
11
|
get name() {
|
|
11
12
|
return commands_1.default.PLAN_GET;
|
|
12
13
|
}
|
|
14
|
+
alias() {
|
|
15
|
+
return [commands_1.default.PLAN_DETAILS_GET];
|
|
16
|
+
}
|
|
13
17
|
get description() {
|
|
14
18
|
return 'Get a Microsoft Planner plan';
|
|
15
19
|
}
|
|
16
20
|
getTelemetryProperties(args) {
|
|
17
21
|
const telemetryProps = super.getTelemetryProperties(args);
|
|
22
|
+
telemetryProps.planId = typeof args.options.planId !== 'undefined';
|
|
23
|
+
telemetryProps.planTitle = typeof args.options.planTitle !== 'undefined';
|
|
18
24
|
telemetryProps.id = typeof args.options.id !== 'undefined';
|
|
19
25
|
telemetryProps.title = typeof args.options.title !== 'undefined';
|
|
20
26
|
telemetryProps.ownerGroupId = typeof args.options.ownerGroupId !== 'undefined';
|
|
@@ -25,13 +31,21 @@ class PlannerPlanGetCommand extends GraphCommand_1.default {
|
|
|
25
31
|
return ['id', 'title', 'createdDateTime', 'owner', '@odata.etag'];
|
|
26
32
|
}
|
|
27
33
|
commandAction(logger, args, cb) {
|
|
34
|
+
this.showDeprecationWarning(logger, commands_1.default.PLAN_DETAILS_GET, commands_1.default.PLAN_GET);
|
|
28
35
|
if (utils_1.accessToken.isAppOnlyAccessToken(Auth_1.default.service.accessTokens[this.resource].accessToken)) {
|
|
29
36
|
this.handleError('This command does not support application permissions.', logger, cb);
|
|
30
37
|
return;
|
|
31
38
|
}
|
|
39
|
+
if (args.options.planId) {
|
|
40
|
+
args.options.id = args.options.planId;
|
|
41
|
+
}
|
|
42
|
+
if (args.options.planTitle) {
|
|
43
|
+
args.options.title = args.options.planTitle;
|
|
44
|
+
}
|
|
32
45
|
if (args.options.id) {
|
|
33
46
|
planner_1.planner
|
|
34
47
|
.getPlanById(args.options.id)
|
|
48
|
+
.then(plan => this.getPlanDetails(plan))
|
|
35
49
|
.then((res) => {
|
|
36
50
|
logger.log(res);
|
|
37
51
|
cb();
|
|
@@ -41,14 +55,30 @@ class PlannerPlanGetCommand extends GraphCommand_1.default {
|
|
|
41
55
|
this
|
|
42
56
|
.getGroupId(args)
|
|
43
57
|
.then(groupId => planner_1.planner.getPlanByName(args.options.title, groupId))
|
|
44
|
-
.then(
|
|
45
|
-
|
|
46
|
-
|
|
58
|
+
.then(plan => this.getPlanDetails(plan))
|
|
59
|
+
.then((res) => {
|
|
60
|
+
if (res) {
|
|
61
|
+
logger.log(res);
|
|
47
62
|
}
|
|
48
63
|
cb();
|
|
49
64
|
}, (err) => this.handleRejectedODataJsonPromise(err, logger, cb));
|
|
50
65
|
}
|
|
51
66
|
}
|
|
67
|
+
getPlanDetails(plan) {
|
|
68
|
+
const requestOptionsTaskDetails = {
|
|
69
|
+
url: `${this.resource}/v1.0/planner/plans/${plan.id}/details`,
|
|
70
|
+
headers: {
|
|
71
|
+
'accept': 'application/json;odata.metadata=none',
|
|
72
|
+
'Prefer': 'return=representation'
|
|
73
|
+
},
|
|
74
|
+
responseType: 'json'
|
|
75
|
+
};
|
|
76
|
+
return request_1.default
|
|
77
|
+
.get(requestOptionsTaskDetails)
|
|
78
|
+
.then(planDetails => {
|
|
79
|
+
return Object.assign(Object.assign({}, plan), planDetails);
|
|
80
|
+
});
|
|
81
|
+
}
|
|
52
82
|
getGroupId(args) {
|
|
53
83
|
if (args.options.ownerGroupId) {
|
|
54
84
|
return Promise.resolve(args.options.ownerGroupId);
|
|
@@ -59,6 +89,12 @@ class PlannerPlanGetCommand extends GraphCommand_1.default {
|
|
|
59
89
|
}
|
|
60
90
|
options() {
|
|
61
91
|
const options = [
|
|
92
|
+
{
|
|
93
|
+
option: '--planId [planId]'
|
|
94
|
+
},
|
|
95
|
+
{
|
|
96
|
+
option: '--planTitle [planTitle]'
|
|
97
|
+
},
|
|
62
98
|
{
|
|
63
99
|
option: '-i, --id [id]'
|
|
64
100
|
},
|
|
@@ -76,20 +112,25 @@ class PlannerPlanGetCommand extends GraphCommand_1.default {
|
|
|
76
112
|
return options.concat(parentOptions);
|
|
77
113
|
}
|
|
78
114
|
validate(args) {
|
|
79
|
-
if (
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
return 'Specify either id or title';
|
|
84
|
-
}
|
|
85
|
-
if (args.options.title && !args.options.ownerGroupId && !args.options.ownerGroupName) {
|
|
86
|
-
return 'Specify either ownerGroupId or ownerGroupName';
|
|
87
|
-
}
|
|
88
|
-
if (args.options.title && args.options.ownerGroupId && args.options.ownerGroupName) {
|
|
89
|
-
return 'Specify either ownerGroupId or ownerGroupName but not both';
|
|
115
|
+
if (args.options.planId && args.options.planTitle ||
|
|
116
|
+
args.options.id && args.options.title ||
|
|
117
|
+
args.options.planId && args.options.title ||
|
|
118
|
+
args.options.id && args.options.planTitle) {
|
|
119
|
+
return 'Specify either id or title but not both';
|
|
90
120
|
}
|
|
91
|
-
if (args.options.
|
|
92
|
-
|
|
121
|
+
if (!args.options.planId && !args.options.id) {
|
|
122
|
+
if (!args.options.planTitle && !args.options.title) {
|
|
123
|
+
return 'Specify either id or title';
|
|
124
|
+
}
|
|
125
|
+
if ((args.options.title || args.options.planTitle) && !args.options.ownerGroupId && !args.options.ownerGroupName) {
|
|
126
|
+
return 'Specify either ownerGroupId or ownerGroupName';
|
|
127
|
+
}
|
|
128
|
+
if ((args.options.title || args.options.planTitle) && args.options.ownerGroupId && args.options.ownerGroupName) {
|
|
129
|
+
return 'Specify either ownerGroupId or ownerGroupName but not both';
|
|
130
|
+
}
|
|
131
|
+
if (args.options.ownerGroupId && !utils_1.validation.isValidGuid(args.options.ownerGroupId)) {
|
|
132
|
+
return `${args.options.ownerGroupId} is not a valid GUID`;
|
|
133
|
+
}
|
|
93
134
|
}
|
|
94
135
|
return true;
|
|
95
136
|
}
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const utils_1 = require("../../../../utils");
|
|
4
|
+
const request_1 = require("../../../../request");
|
|
5
|
+
const PlannerCommand_1 = require("../../../base/PlannerCommand");
|
|
6
|
+
const commands_1 = require("../../commands");
|
|
7
|
+
class PlannerTenantSettingsSetCommand extends PlannerCommand_1.default {
|
|
8
|
+
get name() {
|
|
9
|
+
return commands_1.default.TENANT_SETTINGS_SET;
|
|
10
|
+
}
|
|
11
|
+
get description() {
|
|
12
|
+
return 'Sets Microsoft Planner configuration of the tenant';
|
|
13
|
+
}
|
|
14
|
+
getTelemetryProperties(args) {
|
|
15
|
+
const telemetryProps = super.getTelemetryProperties(args);
|
|
16
|
+
telemetryProps.isPlannerAllowed = typeof args.options.isPlannerAllowed !== 'undefined';
|
|
17
|
+
telemetryProps.allowCalendarSharing = typeof args.options.allowCalendarSharing !== 'undefined';
|
|
18
|
+
telemetryProps.allowTenantMoveWithDataLoss = typeof args.options.allowTenantMoveWithDataLoss !== 'undefined';
|
|
19
|
+
telemetryProps.allowTenantMoveWithDataMigration = typeof args.options.allowTenantMoveWithDataMigration !== 'undefined';
|
|
20
|
+
telemetryProps.allowRosterCreation = typeof args.options.allowRosterCreation !== 'undefined';
|
|
21
|
+
telemetryProps.allowPlannerMobilePushNotifications = typeof args.options.allowPlannerMobilePushNotifications !== 'undefined';
|
|
22
|
+
return telemetryProps;
|
|
23
|
+
}
|
|
24
|
+
commandAction(logger, args, cb) {
|
|
25
|
+
const requestOptions = {
|
|
26
|
+
url: `${this.resource}/taskAPI/tenantAdminSettings/Settings`,
|
|
27
|
+
headers: {
|
|
28
|
+
accept: 'application/json;odata.metadata=none',
|
|
29
|
+
prefer: 'return=representation'
|
|
30
|
+
},
|
|
31
|
+
responseType: 'json',
|
|
32
|
+
data: {
|
|
33
|
+
isPlannerAllowed: args.options.isPlannerAllowed,
|
|
34
|
+
allowCalendarSharing: args.options.allowCalendarSharing,
|
|
35
|
+
allowTenantMoveWithDataLoss: args.options.allowTenantMoveWithDataLoss,
|
|
36
|
+
allowTenantMoveWithDataMigration: args.options.allowTenantMoveWithDataMigration,
|
|
37
|
+
allowRosterCreation: args.options.allowRosterCreation,
|
|
38
|
+
allowPlannerMobilePushNotifications: args.options.allowPlannerMobilePushNotifications
|
|
39
|
+
}
|
|
40
|
+
};
|
|
41
|
+
request_1.default
|
|
42
|
+
.patch(requestOptions)
|
|
43
|
+
.then((result) => {
|
|
44
|
+
logger.log(result);
|
|
45
|
+
cb();
|
|
46
|
+
}, (err) => this.handleRejectedODataJsonPromise(err, logger, cb));
|
|
47
|
+
}
|
|
48
|
+
options() {
|
|
49
|
+
const options = [
|
|
50
|
+
{
|
|
51
|
+
option: '--isPlannerAllowed [isPlannerAllowed]',
|
|
52
|
+
autocomplete: ['true', 'false']
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
option: '--allowCalendarSharing [allowCalendarSharing]',
|
|
56
|
+
autocomplete: ['true', 'false']
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
option: '--allowTenantMoveWithDataLoss [allowTenantMoveWithDataLoss]',
|
|
60
|
+
autocomplete: ['true', 'false']
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
option: '--allowTenantMoveWithDataMigration [allowTenantMoveWithDataMigration]',
|
|
64
|
+
autocomplete: ['true', 'false']
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
option: '--allowRosterCreation [allowRosterCreation]',
|
|
68
|
+
autocomplete: ['true', 'false']
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
option: '--allowPlannerMobilePushNotifications [allowPlannerMobilePushNotifications]',
|
|
72
|
+
autocomplete: ['true', 'false']
|
|
73
|
+
}
|
|
74
|
+
];
|
|
75
|
+
const parentOptions = super.options();
|
|
76
|
+
return options.concat(parentOptions);
|
|
77
|
+
}
|
|
78
|
+
validate(args) {
|
|
79
|
+
const optionsArray = [
|
|
80
|
+
args.options.isPlannerAllowed, args.options.allowCalendarSharing, args.options.allowTenantMoveWithDataLoss,
|
|
81
|
+
args.options.allowTenantMoveWithDataMigration, args.options.allowRosterCreation, args.options.allowPlannerMobilePushNotifications
|
|
82
|
+
];
|
|
83
|
+
if (optionsArray.every(o => typeof o === 'undefined')) {
|
|
84
|
+
return 'You must specify at least one option';
|
|
85
|
+
}
|
|
86
|
+
for (const option of optionsArray) {
|
|
87
|
+
if (typeof option !== 'undefined' && !utils_1.validation.isValidBoolean(option)) {
|
|
88
|
+
return `Value '${option}' is not a valid boolean`;
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
return true;
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
module.exports = new PlannerTenantSettingsSetCommand();
|
|
95
|
+
//# sourceMappingURL=tenant-settings-set.js.map
|
|
@@ -23,6 +23,7 @@ exports.default = {
|
|
|
23
23
|
TASK_REFERENCE_REMOVE: `${prefix} task reference remove`,
|
|
24
24
|
TASK_REMOVE: `${prefix} task remove`,
|
|
25
25
|
TASK_SET: `${prefix} task set`,
|
|
26
|
-
TENANT_SETTINGS_LIST: `${prefix} tenant settings list
|
|
26
|
+
TENANT_SETTINGS_LIST: `${prefix} tenant settings list`,
|
|
27
|
+
TENANT_SETTINGS_SET: `${prefix} tenant settings set`
|
|
27
28
|
};
|
|
28
29
|
//# sourceMappingURL=commands.js.map
|
|
@@ -8,6 +8,12 @@ Retrieve information about the specified plan
|
|
|
8
8
|
m365 planner plan get [options]
|
|
9
9
|
```
|
|
10
10
|
|
|
11
|
+
## Alias
|
|
12
|
+
|
|
13
|
+
```sh
|
|
14
|
+
m365 planner plan details get [options]
|
|
15
|
+
```
|
|
16
|
+
|
|
11
17
|
## Options
|
|
12
18
|
|
|
13
19
|
`-i, --id [id]`
|
|
@@ -16,11 +22,17 @@ m365 planner plan get [options]
|
|
|
16
22
|
`-t, --title [title]`
|
|
17
23
|
: Title of the plan. Specify either `id` or `title` but not both.
|
|
18
24
|
|
|
25
|
+
`--planId [planId]`
|
|
26
|
+
: (deprecated. Use `id` instead) ID of the plan. Specify either `planId` or `planTitle` but not both.
|
|
27
|
+
|
|
28
|
+
`---planTitle [planTitle]`
|
|
29
|
+
: (deprecated. Use `title` instead) Title of the plan. Specify either `planId` or `planTitle` but not both.
|
|
30
|
+
|
|
19
31
|
`--ownerGroupId [ownerGroupId]`
|
|
20
|
-
: ID of the Group that owns the plan. Specify either `ownerGroupId` or `ownerGroupName` when using `title`.
|
|
32
|
+
: ID of the Group that owns the plan. Specify either `ownerGroupId` or `ownerGroupName` when using `title` or the deprecated `planTitle`.
|
|
21
33
|
|
|
22
34
|
`--ownerGroupName [ownerGroupName]`
|
|
23
|
-
: Name of the Group that owns the plan. Specify either `ownerGroupId` or `ownerGroupName` when using `title`.
|
|
35
|
+
: Name of the Group that owns the plan. Specify either `ownerGroupId` or `ownerGroupName` when using `title` or the deprecated `planTitle`.
|
|
24
36
|
|
|
25
37
|
--8<-- "docs/cmd/_global.md"
|
|
26
38
|
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
# planner tenant settings set
|
|
2
|
+
|
|
3
|
+
Sets Microsoft Planner configuration of the tenant
|
|
4
|
+
|
|
5
|
+
## Usage
|
|
6
|
+
|
|
7
|
+
```sh
|
|
8
|
+
m365 planner tenant settings set [options]
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Options
|
|
12
|
+
|
|
13
|
+
`--isPlannerAllowed [isPlannerAllowed]`
|
|
14
|
+
: Configure whether Planner should be enabled on the tenant.
|
|
15
|
+
|
|
16
|
+
`--allowCalendarSharing [allowCalendarSharing]`
|
|
17
|
+
: Configure whether Outlook calendar sync is enabled.
|
|
18
|
+
|
|
19
|
+
`--allowTenantMoveWithDataLoss [allowTenantMoveWithDataLoss]`
|
|
20
|
+
: Configure whether a tenant move into a new region is authorized.
|
|
21
|
+
|
|
22
|
+
`--allowTenantMoveWithDataMigration [allowTenantMoveWithDataMigration]`
|
|
23
|
+
: Configure whether a tenant move with data migration is authorized.
|
|
24
|
+
|
|
25
|
+
`--allowRosterCreation [allowRosterCreation]`
|
|
26
|
+
: Configure whether Planner roster creation is allowed.
|
|
27
|
+
|
|
28
|
+
`--allowPlannerMobilePushNotifications [allowPlannerMobilePushNotifications]`
|
|
29
|
+
: Configure whether push notifications are enabled in the mobile app.
|
|
30
|
+
|
|
31
|
+
--8<-- "docs/cmd/_global.md"
|
|
32
|
+
|
|
33
|
+
## Remarks
|
|
34
|
+
|
|
35
|
+
!!! important
|
|
36
|
+
To use this command you must be a global administrator.
|
|
37
|
+
|
|
38
|
+
## Examples
|
|
39
|
+
|
|
40
|
+
Disable Microsoft Planner in the tenant
|
|
41
|
+
|
|
42
|
+
```sh
|
|
43
|
+
m365 planner tenant settings set --isPlannerAllowed false
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
Disable Outlook calendar sync and mobile push notifications
|
|
47
|
+
|
|
48
|
+
```sh
|
|
49
|
+
m365 planner tenant settings set --allowCalendarSharing false --allowPlannerMobilePushNotifications false
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
Enable Microsoft Planner but disallow roster plans to be created
|
|
53
|
+
|
|
54
|
+
```sh
|
|
55
|
+
m365 planner tenant settings set --isPlannerAllowed true --allowRosterCreation false
|
|
56
|
+
```
|
|
@@ -16,7 +16,7 @@ m365 tenant serviceannouncement health get [options]
|
|
|
16
16
|
`-i, --issues`
|
|
17
17
|
: Return the collection of issues that happened on the service, with detailed information for each issue. Is only returned in JSON output mode.
|
|
18
18
|
|
|
19
|
-
--8<-- "docs/cmd
|
|
19
|
+
--8<-- "docs/cmd/_global.md"
|
|
20
20
|
|
|
21
21
|
## Examples
|
|
22
22
|
|
|
@@ -13,7 +13,7 @@ m365 tenant serviceannouncement healthissue list [options]
|
|
|
13
13
|
`-s, --service [service]`
|
|
14
14
|
: Retrieve service health issues for the particular service. If not provided, retrieves health issues for all services
|
|
15
15
|
|
|
16
|
-
--8<-- "docs/cmd
|
|
16
|
+
--8<-- "docs/cmd/_global.md"
|
|
17
17
|
|
|
18
18
|
## Examples
|
|
19
19
|
|
|
@@ -13,7 +13,7 @@ m365 tenant serviceannouncement message list [options]
|
|
|
13
13
|
`-s, --service [service]`
|
|
14
14
|
: Retrieve service update messages for the particular service. If not provided, retrieves messages for all services
|
|
15
15
|
|
|
16
|
-
--8<-- "docs/cmd
|
|
16
|
+
--8<-- "docs/cmd/_global.md"
|
|
17
17
|
|
|
18
18
|
## Examples
|
|
19
19
|
|
package/package.json
CHANGED
|
@@ -1,116 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const utils_1 = require("../../../../utils");
|
|
4
|
-
const Auth_1 = require("../../../../Auth");
|
|
5
|
-
const request_1 = require("../../../../request");
|
|
6
|
-
const planner_1 = require("../../../../utils/planner");
|
|
7
|
-
const GraphCommand_1 = require("../../../base/GraphCommand");
|
|
8
|
-
const commands_1 = require("../../commands");
|
|
9
|
-
const aadGroup_1 = require("../../../../utils/aadGroup");
|
|
10
|
-
class PlannerPlanDetailsGetCommand extends GraphCommand_1.default {
|
|
11
|
-
constructor() {
|
|
12
|
-
super(...arguments);
|
|
13
|
-
this.groupId = '';
|
|
14
|
-
}
|
|
15
|
-
get name() {
|
|
16
|
-
return commands_1.default.PLAN_DETAILS_GET;
|
|
17
|
-
}
|
|
18
|
-
get description() {
|
|
19
|
-
return 'Get details of a Microsoft Planner plan';
|
|
20
|
-
}
|
|
21
|
-
getTelemetryProperties(args) {
|
|
22
|
-
const telemetryProps = super.getTelemetryProperties(args);
|
|
23
|
-
telemetryProps.planId = typeof args.options.planId !== 'undefined';
|
|
24
|
-
telemetryProps.planTitle = typeof args.options.planTitle !== 'undefined';
|
|
25
|
-
telemetryProps.ownerGroupId = typeof args.options.ownerGroupId !== 'undefined';
|
|
26
|
-
telemetryProps.ownerGroupName = typeof args.options.ownerGroupName !== 'undefined';
|
|
27
|
-
return telemetryProps;
|
|
28
|
-
}
|
|
29
|
-
commandAction(logger, args, cb) {
|
|
30
|
-
if (utils_1.accessToken.isAppOnlyAccessToken(Auth_1.default.service.accessTokens[this.resource].accessToken)) {
|
|
31
|
-
this.handleError('This command does not support application permissions.', logger, cb);
|
|
32
|
-
return;
|
|
33
|
-
}
|
|
34
|
-
this
|
|
35
|
-
.getGroupId(args)
|
|
36
|
-
.then((groupId) => {
|
|
37
|
-
this.groupId = groupId;
|
|
38
|
-
return this.getPlanId(args);
|
|
39
|
-
})
|
|
40
|
-
.then((planId) => {
|
|
41
|
-
args.options.planId = planId;
|
|
42
|
-
return this.getPlanDetails(args);
|
|
43
|
-
})
|
|
44
|
-
.then((res) => {
|
|
45
|
-
logger.log(res);
|
|
46
|
-
cb();
|
|
47
|
-
}, (err) => this.handleRejectedODataJsonPromise(err, logger, cb));
|
|
48
|
-
}
|
|
49
|
-
getGroupId(args) {
|
|
50
|
-
if (args.options.planId) {
|
|
51
|
-
return Promise.resolve('');
|
|
52
|
-
}
|
|
53
|
-
if (args.options.ownerGroupId) {
|
|
54
|
-
return Promise.resolve(args.options.ownerGroupId);
|
|
55
|
-
}
|
|
56
|
-
return aadGroup_1.aadGroup
|
|
57
|
-
.getGroupByDisplayName(args.options.ownerGroupName)
|
|
58
|
-
.then(group => group.id);
|
|
59
|
-
}
|
|
60
|
-
getPlanId(args) {
|
|
61
|
-
if (args.options.planId) {
|
|
62
|
-
return Promise.resolve(args.options.planId);
|
|
63
|
-
}
|
|
64
|
-
return planner_1.planner
|
|
65
|
-
.getPlanByName(args.options.planTitle, this.groupId)
|
|
66
|
-
.then(plan => plan.id);
|
|
67
|
-
}
|
|
68
|
-
getPlanDetails(args) {
|
|
69
|
-
const requestOptions = {
|
|
70
|
-
url: `${this.resource}/v1.0/planner/plans/${args.options.planId}/details`,
|
|
71
|
-
headers: {
|
|
72
|
-
'accept': 'application/json;odata.metadata=none'
|
|
73
|
-
},
|
|
74
|
-
responseType: 'json'
|
|
75
|
-
};
|
|
76
|
-
return request_1.default.get(requestOptions);
|
|
77
|
-
}
|
|
78
|
-
options() {
|
|
79
|
-
const options = [
|
|
80
|
-
{
|
|
81
|
-
option: '-i, --planId [planId]'
|
|
82
|
-
},
|
|
83
|
-
{
|
|
84
|
-
option: '-t, --planTitle [planTitle]'
|
|
85
|
-
},
|
|
86
|
-
{
|
|
87
|
-
option: '--ownerGroupId [ownerGroupId]'
|
|
88
|
-
},
|
|
89
|
-
{
|
|
90
|
-
option: '--ownerGroupName [ownerGroupName]'
|
|
91
|
-
}
|
|
92
|
-
];
|
|
93
|
-
const parentOptions = super.options();
|
|
94
|
-
return options.concat(parentOptions);
|
|
95
|
-
}
|
|
96
|
-
validate(args) {
|
|
97
|
-
if (!args.options.planId && !args.options.planTitle) {
|
|
98
|
-
return 'Specify either planId or planTitle';
|
|
99
|
-
}
|
|
100
|
-
if (args.options.planId && args.options.planTitle) {
|
|
101
|
-
return 'Specify either planId or planTitle';
|
|
102
|
-
}
|
|
103
|
-
if (args.options.planTitle && !args.options.ownerGroupId && !args.options.ownerGroupName) {
|
|
104
|
-
return 'Specify either ownerGroupId or ownerGroupName';
|
|
105
|
-
}
|
|
106
|
-
if (args.options.planTitle && args.options.ownerGroupId && args.options.ownerGroupName) {
|
|
107
|
-
return 'Specify either ownerGroupId or ownerGroupName but not both';
|
|
108
|
-
}
|
|
109
|
-
if (args.options.ownerGroupId && !utils_1.validation.isValidGuid(args.options.ownerGroupId)) {
|
|
110
|
-
return `${args.options.ownerGroupId} is not a valid GUID`;
|
|
111
|
-
}
|
|
112
|
-
return true;
|
|
113
|
-
}
|
|
114
|
-
}
|
|
115
|
-
module.exports = new PlannerPlanDetailsGetCommand();
|
|
116
|
-
//# sourceMappingURL=plan-details-get.js.map
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
# planner plan details get
|
|
2
|
-
|
|
3
|
-
Retrieve the planner details about the specified plan.
|
|
4
|
-
|
|
5
|
-
## Usage
|
|
6
|
-
|
|
7
|
-
```sh
|
|
8
|
-
m365 planner plan details get [options]
|
|
9
|
-
```
|
|
10
|
-
|
|
11
|
-
## Options
|
|
12
|
-
|
|
13
|
-
`-i, --planId [planId]`
|
|
14
|
-
: ID of the plan. Specify either `planId` or `planTitle` but not both.
|
|
15
|
-
|
|
16
|
-
`-t, --planTitle [planTitle]`
|
|
17
|
-
: Title of the plan. Specify either `planId` or `planTitle` but not both.
|
|
18
|
-
|
|
19
|
-
`--ownerGroupId [ownerGroupId]`
|
|
20
|
-
: ID of the Group that owns the plan. Specify either `ownerGroupId` or `ownerGroupName` when using `planTitle`.
|
|
21
|
-
|
|
22
|
-
`--ownerGroupName [ownerGroupName]`
|
|
23
|
-
: Name of the Group that owns the plan. Specify either `ownerGroupId` or `ownerGroupName` when using `planTitle`.
|
|
24
|
-
|
|
25
|
-
--8<-- "docs/cmd/_global.md"
|
|
26
|
-
|
|
27
|
-
## Examples
|
|
28
|
-
|
|
29
|
-
Returns the Microsoft Planner plan details with id _gndWOTSK60GfPQfiDDj43JgACDCb_
|
|
30
|
-
|
|
31
|
-
```sh
|
|
32
|
-
m365 planner plan details get --planId "gndWOTSK60GfPQfiDDj43JgACDCb"
|
|
33
|
-
```
|
|
34
|
-
|
|
35
|
-
Returns the Microsoft Planner plan details with title _MyPlan_ for Group _233e43d0-dc6a-482e-9b4e-0de7a7bce9b4_
|
|
36
|
-
|
|
37
|
-
```sh
|
|
38
|
-
m365 planner plan details get --planTitle "MyPlan" --ownerGroupId "233e43d0-dc6a-482e-9b4e-0de7a7bce9b4"
|
|
39
|
-
```
|
|
40
|
-
|
|
41
|
-
Returns the Microsoft Planner plan details with title _MyPlan_ for Group _My Planner Group_
|
|
42
|
-
|
|
43
|
-
```sh
|
|
44
|
-
m365 planner plan details get --planTitle "MyPlan" --ownerGroupName "My Planner Group"
|
|
45
|
-
```
|