@pnp/cli-microsoft365 6.3.0-beta.3f7129c → 6.3.0-beta.64eb7da
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/.eslintrc.js +4 -0
- package/dist/Command.js +12 -1
- package/dist/cli/Cli.js +4 -1
- package/dist/m365/aad/commands/group/group-list.js +2 -1
- package/dist/m365/base/O365MgmtCommand.js +10 -0
- package/dist/m365/graph/commands/changelog/changelog-list.js +3 -2
- package/dist/m365/onenote/commands/notebook/notebook-list.js +51 -40
- package/dist/m365/planner/commands/plan/plan-add.js +20 -6
- package/dist/m365/planner/commands/plan/plan-get.js +34 -27
- package/dist/m365/planner/commands/plan/plan-list.js +24 -14
- package/dist/m365/planner/commands/plan/plan-remove.js +1 -1
- package/dist/m365/planner/commands/task/task-checklistitem-add.js +2 -1
- package/dist/m365/planner/commands/task/task-checklistitem-list.js +2 -1
- package/dist/m365/pp/commands/solution/solution-get.js +2 -1
- package/dist/m365/pp/commands/solution/solution-list.js +2 -1
- package/dist/m365/purview/commands/auditlog/auditlog-list.js +205 -0
- package/dist/m365/purview/commands/retentioneventtype/retentioneventtype-get.js +70 -0
- package/dist/m365/purview/commands.js +2 -0
- package/dist/m365/spfx/commands/project/WebApiPermissionRequests.js +3 -0
- package/dist/m365/spfx/commands/project/project-permissions-grant.js +81 -0
- package/dist/m365/spfx/commands.js +3 -2
- package/dist/m365/spo/commands/app/app-add.js +2 -1
- package/dist/m365/spo/commands/file/file-sharinginfo-get.js +2 -1
- package/dist/m365/spo/commands/file/file-sharinglink-list.js +2 -1
- package/dist/m365/spo/commands/group/group-list.js +2 -1
- package/dist/m365/spo/commands/hubsite/hubsite-get.js +1 -1
- package/dist/m365/spo/commands/listitem/listitem-list.js +2 -1
- package/dist/m365/spo/commands/page/page-column-get.js +2 -1
- package/dist/m365/spo/commands/page/page-column-list.js +2 -1
- package/dist/m365/spo/commands/page/page-section-get.js +2 -1
- package/dist/m365/spo/commands/page/page-section-list.js +2 -1
- package/dist/m365/spo/commands/spo-search.js +2 -1
- package/dist/m365/spo/commands/term/term-list.js +2 -1
- package/dist/m365/spo/commands/userprofile/userprofile-get.js +2 -2
- package/dist/m365/teams/commands/meeting/meeting-list.js +1 -1
- package/dist/m365/teams/commands/team/team-app-list.js +1 -1
- package/dist/m365/teams/commands/user/user-app-list.js +2 -1
- package/dist/m365/todo/commands/task/task-get.js +2 -1
- package/dist/m365/todo/commands/task/task-list.js +2 -1
- package/dist/m365/yammer/commands/yammer-search.js +2 -1
- package/dist/utils/planner.js +19 -5
- package/docs/docs/cmd/planner/plan/plan-add.md +17 -6
- package/docs/docs/cmd/planner/plan/plan-get.md +16 -2
- package/docs/docs/cmd/planner/plan/plan-list.md +16 -2
- package/docs/docs/cmd/purview/auditlog/auditlog-list.md +123 -0
- package/docs/docs/cmd/purview/retentioneventtype/retentioneventtype-get.md +100 -0
- package/docs/docs/cmd/spfx/project/project-permissions-grant.md +65 -0
- package/docs/docs/cmd/spo/navigation/navigation-node-add.md +1 -1
- package/docs/docs/cmd/spo/navigation/navigation-node-set.md +1 -1
- package/package.json +1 -1
package/.eslintrc.js
CHANGED
|
@@ -10,6 +10,7 @@ const dictionary = [
|
|
|
10
10
|
'apply',
|
|
11
11
|
'approve',
|
|
12
12
|
'assets',
|
|
13
|
+
'audit',
|
|
13
14
|
'bin',
|
|
14
15
|
'builder',
|
|
15
16
|
'catalog',
|
|
@@ -43,6 +44,9 @@ const dictionary = [
|
|
|
43
44
|
'label',
|
|
44
45
|
'list',
|
|
45
46
|
'link',
|
|
47
|
+
'log',
|
|
48
|
+
'login',
|
|
49
|
+
'logout',
|
|
46
50
|
'management',
|
|
47
51
|
'member',
|
|
48
52
|
'messaging',
|
package/dist/Command.js
CHANGED
|
@@ -481,7 +481,18 @@ class Command {
|
|
|
481
481
|
if (!l) {
|
|
482
482
|
return;
|
|
483
483
|
}
|
|
484
|
-
|
|
484
|
+
const title = this.getLogItemTitle(l);
|
|
485
|
+
const id = this.getLogItemId(l);
|
|
486
|
+
if (title && id) {
|
|
487
|
+
output.push(`## ${title} (${id})`);
|
|
488
|
+
}
|
|
489
|
+
else if (title) {
|
|
490
|
+
output.push(`## ${title}`);
|
|
491
|
+
}
|
|
492
|
+
else if (id) {
|
|
493
|
+
output.push(`## ${id}`);
|
|
494
|
+
}
|
|
495
|
+
output.push(os.EOL, os.EOL, `Property | Value`, os.EOL, `---------|-------`, os.EOL);
|
|
485
496
|
output.push(Object.keys(l).map(k => {
|
|
486
497
|
const value = l[k];
|
|
487
498
|
let stringValue = value;
|
package/dist/cli/Cli.js
CHANGED
|
@@ -458,7 +458,7 @@ class Cli {
|
|
|
458
458
|
// data so that returned objects contain only default properties specified
|
|
459
459
|
// on the current command. If there is no current command or the
|
|
460
460
|
// command doesn't specify default properties, return original data
|
|
461
|
-
if (
|
|
461
|
+
if (this.shouldTrimOutput(options.output)) {
|
|
462
462
|
const cli = Cli.getInstance();
|
|
463
463
|
const currentCommand = cli.commandToExecute;
|
|
464
464
|
if (arrayType === 'object' &&
|
|
@@ -753,6 +753,9 @@ class Cli {
|
|
|
753
753
|
}
|
|
754
754
|
});
|
|
755
755
|
}
|
|
756
|
+
static shouldTrimOutput(output) {
|
|
757
|
+
return output === 'text' || output === 'csv';
|
|
758
|
+
}
|
|
756
759
|
}
|
|
757
760
|
exports.Cli = Cli;
|
|
758
761
|
Cli.defaultHelpMode = 'full';
|
|
@@ -15,6 +15,7 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
|
|
|
15
15
|
};
|
|
16
16
|
var _AadGroupListCommand_instances, _AadGroupListCommand_initTelemetry, _AadGroupListCommand_initOptions;
|
|
17
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
const Cli_1 = require("../../../../cli/Cli");
|
|
18
19
|
const odata_1 = require("../../../../utils/odata");
|
|
19
20
|
const GraphCommand_1 = require("../../../base/GraphCommand");
|
|
20
21
|
const commands_1 = require("../../commands");
|
|
@@ -39,7 +40,7 @@ class AadGroupListCommand extends GraphCommand_1.default {
|
|
|
39
40
|
const endpoint = args.options.deleted ? 'directory/deletedItems/microsoft.graph.group' : 'groups';
|
|
40
41
|
try {
|
|
41
42
|
const groups = yield odata_1.odata.getAllItems(`${this.resource}/v1.0/${endpoint}`);
|
|
42
|
-
if (args.options.output
|
|
43
|
+
if (Cli_1.Cli.shouldTrimOutput(args.options.output)) {
|
|
43
44
|
groups.forEach((group) => {
|
|
44
45
|
if (group.groupTypes && group.groupTypes.length > 0 && group.groupTypes[0] === 'Unified') {
|
|
45
46
|
group.groupType = 'Microsoft 365';
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const Command_1 = require("../../Command");
|
|
4
|
+
class O365MgmtCommand extends Command_1.default {
|
|
5
|
+
get resource() {
|
|
6
|
+
return 'https://manage.office.com';
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
exports.default = O365MgmtCommand;
|
|
10
|
+
//# sourceMappingURL=O365MgmtCommand.js.map
|
|
@@ -21,6 +21,7 @@ const AnonymousCommand_1 = require("../../../base/AnonymousCommand");
|
|
|
21
21
|
const commands_1 = require("../../commands");
|
|
22
22
|
const request_1 = require("../../../../request");
|
|
23
23
|
const xmldom_1 = require("@xmldom/xmldom");
|
|
24
|
+
const Cli_1 = require("../../../../cli/Cli");
|
|
24
25
|
class GraphChangelogListCommand extends AnonymousCommand_1.default {
|
|
25
26
|
get name() {
|
|
26
27
|
return commands_1.default.CHANGELOG_LIST;
|
|
@@ -106,14 +107,14 @@ class GraphChangelogListCommand extends AnonymousCommand_1.default {
|
|
|
106
107
|
items: []
|
|
107
108
|
};
|
|
108
109
|
Array.from(xmlDoc.getElementsByTagName('item')).forEach((item) => {
|
|
109
|
-
const description = args.options.output
|
|
110
|
+
const description = Cli_1.Cli.shouldTrimOutput(args.options.output) ?
|
|
110
111
|
md_1.md.md2plain(item.getElementsByTagName('description').item(0).textContent, '') :
|
|
111
112
|
item.getElementsByTagName('description').item(0).textContent;
|
|
112
113
|
changelog.items.push({
|
|
113
114
|
guid: item.getElementsByTagName('guid').item(0).textContent,
|
|
114
115
|
category: item.getElementsByTagName('category').item(1).textContent,
|
|
115
116
|
title: item.getElementsByTagName('title').item(0).textContent,
|
|
116
|
-
description: args.options.output
|
|
117
|
+
description: Cli_1.Cli.shouldTrimOutput(args.options.output) ?
|
|
117
118
|
description.length > 50 ? `${description.substring(0, 47)}...` : description :
|
|
118
119
|
description,
|
|
119
120
|
pubDate: new Date(item.getElementsByTagName('pubDate').item(0).textContent)
|
|
@@ -13,14 +13,14 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
|
|
|
13
13
|
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
14
14
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
15
15
|
};
|
|
16
|
-
var _OneNoteNotebookListCommand_instances, _OneNoteNotebookListCommand_initTelemetry, _OneNoteNotebookListCommand_initOptions, _OneNoteNotebookListCommand_initValidators;
|
|
16
|
+
var _OneNoteNotebookListCommand_instances, _OneNoteNotebookListCommand_initTelemetry, _OneNoteNotebookListCommand_initOptions, _OneNoteNotebookListCommand_initValidators, _OneNoteNotebookListCommand_initOptionSets;
|
|
17
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
const request_1 = require("../../../../request");
|
|
18
19
|
const odata_1 = require("../../../../utils/odata");
|
|
19
20
|
const validation_1 = require("../../../../utils/validation");
|
|
20
21
|
const aadGroup_1 = require("../../../../utils/aadGroup");
|
|
21
22
|
const GraphCommand_1 = require("../../../base/GraphCommand");
|
|
22
23
|
const commands_1 = require("../../commands");
|
|
23
|
-
const spo_1 = require("../../../../utils/spo");
|
|
24
24
|
class OneNoteNotebookListCommand extends GraphCommand_1.default {
|
|
25
25
|
get name() {
|
|
26
26
|
return commands_1.default.NOTEBOOK_LIST;
|
|
@@ -28,61 +28,63 @@ class OneNoteNotebookListCommand extends GraphCommand_1.default {
|
|
|
28
28
|
get description() {
|
|
29
29
|
return 'Retrieve a list of notebooks';
|
|
30
30
|
}
|
|
31
|
+
defaultProperties() {
|
|
32
|
+
return ['createdDateTime', 'displayName', 'id'];
|
|
33
|
+
}
|
|
31
34
|
constructor() {
|
|
32
35
|
super();
|
|
33
36
|
_OneNoteNotebookListCommand_instances.add(this);
|
|
34
37
|
__classPrivateFieldGet(this, _OneNoteNotebookListCommand_instances, "m", _OneNoteNotebookListCommand_initTelemetry).call(this);
|
|
35
38
|
__classPrivateFieldGet(this, _OneNoteNotebookListCommand_instances, "m", _OneNoteNotebookListCommand_initOptions).call(this);
|
|
36
39
|
__classPrivateFieldGet(this, _OneNoteNotebookListCommand_instances, "m", _OneNoteNotebookListCommand_initValidators).call(this);
|
|
40
|
+
__classPrivateFieldGet(this, _OneNoteNotebookListCommand_instances, "m", _OneNoteNotebookListCommand_initOptionSets).call(this);
|
|
37
41
|
}
|
|
38
42
|
getEndpointUrl(args) {
|
|
39
|
-
return
|
|
40
|
-
let endpoint = `${this.resource}/v1.0
|
|
43
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
44
|
+
let endpoint = `${this.resource}/v1.0/`;
|
|
41
45
|
if (args.options.userId) {
|
|
42
|
-
endpoint
|
|
43
|
-
return resolve(endpoint);
|
|
46
|
+
endpoint += `users/${args.options.userId}`;
|
|
44
47
|
}
|
|
45
48
|
else if (args.options.userName) {
|
|
46
|
-
endpoint
|
|
47
|
-
return resolve(endpoint);
|
|
49
|
+
endpoint += `users/${args.options.userName}`;
|
|
48
50
|
}
|
|
49
51
|
else if (args.options.groupId) {
|
|
50
|
-
endpoint
|
|
51
|
-
return resolve(endpoint);
|
|
52
|
+
endpoint += `groups/${args.options.groupId}`;
|
|
52
53
|
}
|
|
53
54
|
else if (args.options.groupName) {
|
|
54
|
-
this
|
|
55
|
-
|
|
56
|
-
.then((retrievedgroupId) => {
|
|
57
|
-
endpoint = `${this.resource}/v1.0/groups/${retrievedgroupId}/onenote/notebooks`;
|
|
58
|
-
return resolve(endpoint);
|
|
59
|
-
})
|
|
60
|
-
.catch((err) => {
|
|
61
|
-
reject(err);
|
|
62
|
-
});
|
|
55
|
+
const groupId = yield this.getGroupId(args.options.groupName);
|
|
56
|
+
endpoint += `groups/${groupId}`;
|
|
63
57
|
}
|
|
64
58
|
else if (args.options.webUrl) {
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
endpoint = `${this.resource}/v1.0/sites/${siteId}/onenote/notebooks`;
|
|
68
|
-
return resolve(endpoint);
|
|
69
|
-
})
|
|
70
|
-
.catch((err) => {
|
|
71
|
-
reject(err);
|
|
72
|
-
});
|
|
59
|
+
const siteId = yield this.getSpoSiteId(args.options.webUrl);
|
|
60
|
+
endpoint += `sites/${siteId}`;
|
|
73
61
|
}
|
|
74
62
|
else {
|
|
75
|
-
|
|
63
|
+
endpoint += 'me';
|
|
76
64
|
}
|
|
65
|
+
endpoint += '/onenote/notebooks';
|
|
66
|
+
return endpoint;
|
|
77
67
|
});
|
|
78
68
|
}
|
|
79
|
-
|
|
80
|
-
return
|
|
69
|
+
getGroupId(groupName) {
|
|
70
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
71
|
+
const group = yield aadGroup_1.aadGroup.getGroupByDisplayName(groupName);
|
|
72
|
+
return group.id;
|
|
73
|
+
});
|
|
81
74
|
}
|
|
82
|
-
|
|
83
|
-
return
|
|
84
|
-
|
|
85
|
-
|
|
75
|
+
getSpoSiteId(webUrl) {
|
|
76
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
77
|
+
const url = new URL(webUrl);
|
|
78
|
+
const requestOptions = {
|
|
79
|
+
url: `${this.resource}/v1.0/sites/${url.hostname}:${url.pathname}`,
|
|
80
|
+
headers: {
|
|
81
|
+
accept: 'application/json;odata.metadata=none'
|
|
82
|
+
},
|
|
83
|
+
responseType: 'json'
|
|
84
|
+
};
|
|
85
|
+
const site = yield request_1.default.get(requestOptions);
|
|
86
|
+
return site.id;
|
|
87
|
+
});
|
|
86
88
|
}
|
|
87
89
|
commandAction(logger, args) {
|
|
88
90
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -100,7 +102,11 @@ class OneNoteNotebookListCommand extends GraphCommand_1.default {
|
|
|
100
102
|
_OneNoteNotebookListCommand_instances = new WeakSet(), _OneNoteNotebookListCommand_initTelemetry = function _OneNoteNotebookListCommand_initTelemetry() {
|
|
101
103
|
this.telemetry.push((args) => {
|
|
102
104
|
Object.assign(this.telemetryProperties, {
|
|
103
|
-
|
|
105
|
+
userId: typeof args.options.userId !== 'undefined',
|
|
106
|
+
userName: typeof args.options.userName !== 'undefined',
|
|
107
|
+
groupId: typeof args.options.groupId !== 'undefined',
|
|
108
|
+
groupName: typeof args.options.groupName !== 'undefined',
|
|
109
|
+
webUrl: typeof args.options.webUrl !== 'undefined'
|
|
104
110
|
});
|
|
105
111
|
});
|
|
106
112
|
}, _OneNoteNotebookListCommand_initOptions = function _OneNoteNotebookListCommand_initOptions() {
|
|
@@ -113,14 +119,19 @@ _OneNoteNotebookListCommand_instances = new WeakSet(), _OneNoteNotebookListComma
|
|
|
113
119
|
if (args.options.groupId && !validation_1.validation.isValidGuid(args.options.groupId)) {
|
|
114
120
|
return `${args.options.groupId} is not a valid GUID`;
|
|
115
121
|
}
|
|
116
|
-
if (args.options.
|
|
117
|
-
return
|
|
118
|
-
}
|
|
119
|
-
if (args.options.groupId && args.options.groupName) {
|
|
120
|
-
return 'Specify either groupId or groupName, but not both';
|
|
122
|
+
if (args.options.webUrl) {
|
|
123
|
+
return validation_1.validation.isValidSharePointUrl(args.options.webUrl);
|
|
121
124
|
}
|
|
122
125
|
return true;
|
|
123
126
|
}));
|
|
127
|
+
}, _OneNoteNotebookListCommand_initOptionSets = function _OneNoteNotebookListCommand_initOptionSets() {
|
|
128
|
+
this.optionSets.push({
|
|
129
|
+
options: ['userId', 'userName', 'groupId', 'groupName', 'webUrl'],
|
|
130
|
+
runsWhen: (args) => {
|
|
131
|
+
const options = [args.options.userId, args.options.userName, args.options.groupId, args.options.groupName, args.options.webUrl];
|
|
132
|
+
return options.some(item => item !== undefined);
|
|
133
|
+
}
|
|
134
|
+
});
|
|
124
135
|
};
|
|
125
136
|
module.exports = new OneNoteNotebookListCommand();
|
|
126
137
|
//# sourceMappingURL=notebook-list.js.map
|
|
@@ -15,6 +15,7 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
|
|
|
15
15
|
};
|
|
16
16
|
var _PlannerPlanAddCommand_instances, _PlannerPlanAddCommand_initTelemetry, _PlannerPlanAddCommand_initOptions, _PlannerPlanAddCommand_initValidators, _PlannerPlanAddCommand_initOptionSets;
|
|
17
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
const Command_1 = require("../../../../Command");
|
|
18
19
|
const request_1 = require("../../../../request");
|
|
19
20
|
const aadGroup_1 = require("../../../../utils/aadGroup");
|
|
20
21
|
const formatting_1 = require("../../../../utils/formatting");
|
|
@@ -42,23 +43,34 @@ class PlannerPlanAddCommand extends GraphCommand_1.default {
|
|
|
42
43
|
commandAction(logger, args) {
|
|
43
44
|
return __awaiter(this, void 0, void 0, function* () {
|
|
44
45
|
try {
|
|
45
|
-
const
|
|
46
|
+
const data = {
|
|
47
|
+
title: args.options.title
|
|
48
|
+
};
|
|
49
|
+
if (args.options.rosterId) {
|
|
50
|
+
data.container = {
|
|
51
|
+
"url": `https://graph.microsoft.com/v1.0/planner/rosters/${args.options.rosterId}`
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
else {
|
|
55
|
+
const groupId = yield this.getGroupId(args);
|
|
56
|
+
data.owner = groupId;
|
|
57
|
+
}
|
|
46
58
|
const requestOptions = {
|
|
47
59
|
url: `${this.resource}/v1.0/planner/plans`,
|
|
48
60
|
headers: {
|
|
49
61
|
'accept': 'application/json;odata.metadata=none'
|
|
50
62
|
},
|
|
51
63
|
responseType: 'json',
|
|
52
|
-
data:
|
|
53
|
-
owner: groupId,
|
|
54
|
-
title: args.options.title
|
|
55
|
-
}
|
|
64
|
+
data: data
|
|
56
65
|
};
|
|
57
66
|
const newPlan = yield request_1.default.post(requestOptions);
|
|
58
67
|
const result = yield this.updatePlanDetails(args.options, newPlan);
|
|
59
68
|
logger.log(result);
|
|
60
69
|
}
|
|
61
70
|
catch (err) {
|
|
71
|
+
if (err.error && err.error.error.message === "You do not have the required permissions to access this item, or the item may not exist.") {
|
|
72
|
+
throw new Command_1.CommandError("You can only add 1 plan to a Roster");
|
|
73
|
+
}
|
|
62
74
|
this.handleRejectedODataJsonPromise(err);
|
|
63
75
|
}
|
|
64
76
|
});
|
|
@@ -167,6 +179,8 @@ _PlannerPlanAddCommand_instances = new WeakSet(), _PlannerPlanAddCommand_initTel
|
|
|
167
179
|
option: "--ownerGroupId [ownerGroupId]"
|
|
168
180
|
}, {
|
|
169
181
|
option: "--ownerGroupName [ownerGroupName]"
|
|
182
|
+
}, {
|
|
183
|
+
option: "--rosterId [rosterId]"
|
|
170
184
|
}, {
|
|
171
185
|
option: '--shareWithUserIds [shareWithUserIds]'
|
|
172
186
|
}, {
|
|
@@ -186,7 +200,7 @@ _PlannerPlanAddCommand_instances = new WeakSet(), _PlannerPlanAddCommand_initTel
|
|
|
186
200
|
return true;
|
|
187
201
|
}));
|
|
188
202
|
}, _PlannerPlanAddCommand_initOptionSets = function _PlannerPlanAddCommand_initOptionSets() {
|
|
189
|
-
this.optionSets.push({ options: ['ownerGroupId', 'ownerGroupName'] });
|
|
203
|
+
this.optionSets.push({ options: ['ownerGroupId', 'ownerGroupName', 'rosterId'] });
|
|
190
204
|
};
|
|
191
205
|
module.exports = new PlannerPlanAddCommand();
|
|
192
206
|
//# sourceMappingURL=plan-add.js.map
|
|
@@ -48,8 +48,11 @@ class PlannerPlanGetCommand extends GraphCommand_1.default {
|
|
|
48
48
|
logger.log(result);
|
|
49
49
|
}
|
|
50
50
|
else {
|
|
51
|
-
|
|
52
|
-
|
|
51
|
+
let groupId = undefined;
|
|
52
|
+
if (args.options.ownerGroupId || args.options.ownerGroupName) {
|
|
53
|
+
groupId = yield this.getGroupId(args);
|
|
54
|
+
}
|
|
55
|
+
const plan = yield planner_1.planner.getPlanByTitle(args.options.title, groupId, args.options.rosterId);
|
|
53
56
|
const result = yield this.getPlanDetails(plan);
|
|
54
57
|
if (result) {
|
|
55
58
|
logger.log(result);
|
|
@@ -62,27 +65,27 @@ class PlannerPlanGetCommand extends GraphCommand_1.default {
|
|
|
62
65
|
});
|
|
63
66
|
}
|
|
64
67
|
getPlanDetails(plan) {
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
.get(requestOptionsTaskDetails)
|
|
75
|
-
.then(planDetails => {
|
|
68
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
69
|
+
const requestOptionsTaskDetails = {
|
|
70
|
+
url: `${this.resource}/v1.0/planner/plans/${plan.id}/details`,
|
|
71
|
+
headers: {
|
|
72
|
+
'accept': 'application/json;odata.metadata=none',
|
|
73
|
+
'Prefer': 'return=representation'
|
|
74
|
+
},
|
|
75
|
+
responseType: 'json'
|
|
76
|
+
};
|
|
77
|
+
const planDetails = yield request_1.default.get(requestOptionsTaskDetails);
|
|
76
78
|
return Object.assign(Object.assign({}, plan), planDetails);
|
|
77
79
|
});
|
|
78
80
|
}
|
|
79
81
|
getGroupId(args) {
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
.getGroupByDisplayName(args.options.ownerGroupName)
|
|
85
|
-
|
|
82
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
83
|
+
if (args.options.ownerGroupId) {
|
|
84
|
+
return args.options.ownerGroupId;
|
|
85
|
+
}
|
|
86
|
+
const group = yield aadGroup_1.aadGroup.getGroupByDisplayName(args.options.ownerGroupName);
|
|
87
|
+
return group.id;
|
|
88
|
+
});
|
|
86
89
|
}
|
|
87
90
|
}
|
|
88
91
|
_PlannerPlanGetCommand_instances = new WeakSet(), _PlannerPlanGetCommand_initTelemetry = function _PlannerPlanGetCommand_initTelemetry() {
|
|
@@ -91,7 +94,8 @@ _PlannerPlanGetCommand_instances = new WeakSet(), _PlannerPlanGetCommand_initTel
|
|
|
91
94
|
id: typeof args.options.id !== 'undefined',
|
|
92
95
|
title: typeof args.options.title !== 'undefined',
|
|
93
96
|
ownerGroupId: typeof args.options.ownerGroupId !== 'undefined',
|
|
94
|
-
ownerGroupName: typeof args.options.ownerGroupName !== 'undefined'
|
|
97
|
+
ownerGroupName: typeof args.options.ownerGroupName !== 'undefined',
|
|
98
|
+
rosterId: typeof args.options.rosterId !== 'undefined'
|
|
95
99
|
});
|
|
96
100
|
});
|
|
97
101
|
}, _PlannerPlanGetCommand_initOptions = function _PlannerPlanGetCommand_initOptions() {
|
|
@@ -103,22 +107,25 @@ _PlannerPlanGetCommand_instances = new WeakSet(), _PlannerPlanGetCommand_initTel
|
|
|
103
107
|
option: '--ownerGroupId [ownerGroupId]'
|
|
104
108
|
}, {
|
|
105
109
|
option: '--ownerGroupName [ownerGroupName]'
|
|
110
|
+
}, {
|
|
111
|
+
option: '--rosterId [rosterId]'
|
|
106
112
|
});
|
|
107
113
|
}, _PlannerPlanGetCommand_initValidators = function _PlannerPlanGetCommand_initValidators() {
|
|
108
114
|
this.validators.push((args) => __awaiter(this, void 0, void 0, function* () {
|
|
109
|
-
if (args.options.title && !args.options.ownerGroupId && !args.options.ownerGroupName) {
|
|
110
|
-
return 'Specify either ownerGroupId or ownerGroupName';
|
|
111
|
-
}
|
|
112
|
-
if (args.options.title && args.options.ownerGroupId && args.options.ownerGroupName) {
|
|
113
|
-
return 'Specify either ownerGroupId or ownerGroupName but not both';
|
|
114
|
-
}
|
|
115
115
|
if (args.options.ownerGroupId && !validation_1.validation.isValidGuid(args.options.ownerGroupId)) {
|
|
116
116
|
return `${args.options.ownerGroupId} is not a valid GUID`;
|
|
117
117
|
}
|
|
118
118
|
return true;
|
|
119
119
|
}));
|
|
120
120
|
}, _PlannerPlanGetCommand_initOptionSets = function _PlannerPlanGetCommand_initOptionSets() {
|
|
121
|
-
this.optionSets.push({
|
|
121
|
+
this.optionSets.push({
|
|
122
|
+
options: ['id', 'title']
|
|
123
|
+
}, {
|
|
124
|
+
options: ['ownerGroupId', 'ownerGroupName', 'rosterId'],
|
|
125
|
+
runsWhen: (args) => {
|
|
126
|
+
return args.options.title !== undefined;
|
|
127
|
+
}
|
|
128
|
+
});
|
|
122
129
|
};
|
|
123
130
|
module.exports = new PlannerPlanGetCommand();
|
|
124
131
|
//# sourceMappingURL=plan-get.js.map
|
|
@@ -16,16 +16,16 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
|
|
|
16
16
|
var _PlannerPlanListCommand_instances, _PlannerPlanListCommand_initTelemetry, _PlannerPlanListCommand_initOptions, _PlannerPlanListCommand_initValidators, _PlannerPlanListCommand_initOptionSets;
|
|
17
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
18
|
const validation_1 = require("../../../../utils/validation");
|
|
19
|
-
const aadGroup_1 = require("../../../../utils/aadGroup");
|
|
20
19
|
const planner_1 = require("../../../../utils/planner");
|
|
21
20
|
const GraphCommand_1 = require("../../../base/GraphCommand");
|
|
22
21
|
const commands_1 = require("../../commands");
|
|
22
|
+
const aadGroup_1 = require("../../../../utils/aadGroup");
|
|
23
23
|
class PlannerPlanListCommand extends GraphCommand_1.default {
|
|
24
24
|
get name() {
|
|
25
25
|
return commands_1.default.PLAN_LIST;
|
|
26
26
|
}
|
|
27
27
|
get description() {
|
|
28
|
-
return 'Returns a list of plans associated with a specified group';
|
|
28
|
+
return 'Returns a list of plans associated with a specified group or roster';
|
|
29
29
|
}
|
|
30
30
|
constructor() {
|
|
31
31
|
super();
|
|
@@ -41,10 +41,16 @@ class PlannerPlanListCommand extends GraphCommand_1.default {
|
|
|
41
41
|
commandAction(logger, args) {
|
|
42
42
|
return __awaiter(this, void 0, void 0, function* () {
|
|
43
43
|
try {
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
44
|
+
let plannerPlans = null;
|
|
45
|
+
if (args.options.ownerGroupId || args.options.ownerGroupName) {
|
|
46
|
+
const groupId = yield this.getGroupId(args);
|
|
47
|
+
plannerPlans = yield planner_1.planner.getPlansByGroupId(groupId);
|
|
48
|
+
}
|
|
49
|
+
else {
|
|
50
|
+
plannerPlans = yield planner_1.planner.getPlansByRosterId(args.options.rosterId);
|
|
51
|
+
}
|
|
52
|
+
if (plannerPlans && plannerPlans.length > 0) {
|
|
53
|
+
logger.log(plannerPlans);
|
|
48
54
|
}
|
|
49
55
|
}
|
|
50
56
|
catch (err) {
|
|
@@ -53,19 +59,21 @@ class PlannerPlanListCommand extends GraphCommand_1.default {
|
|
|
53
59
|
});
|
|
54
60
|
}
|
|
55
61
|
getGroupId(args) {
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
.getGroupByDisplayName(args.options.ownerGroupName)
|
|
61
|
-
|
|
62
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
63
|
+
if (args.options.ownerGroupId) {
|
|
64
|
+
return args.options.ownerGroupId;
|
|
65
|
+
}
|
|
66
|
+
const group = yield aadGroup_1.aadGroup.getGroupByDisplayName(args.options.ownerGroupName);
|
|
67
|
+
return group.id;
|
|
68
|
+
});
|
|
62
69
|
}
|
|
63
70
|
}
|
|
64
71
|
_PlannerPlanListCommand_instances = new WeakSet(), _PlannerPlanListCommand_initTelemetry = function _PlannerPlanListCommand_initTelemetry() {
|
|
65
72
|
this.telemetry.push((args) => {
|
|
66
73
|
Object.assign(this.telemetryProperties, {
|
|
67
74
|
ownerGroupId: typeof args.options.ownerGroupId !== 'undefined',
|
|
68
|
-
ownerGroupName: typeof args.options.ownerGroupName !== 'undefined'
|
|
75
|
+
ownerGroupName: typeof args.options.ownerGroupName !== 'undefined',
|
|
76
|
+
rosterId: typeof args.options.rosterId !== 'undefined'
|
|
69
77
|
});
|
|
70
78
|
});
|
|
71
79
|
}, _PlannerPlanListCommand_initOptions = function _PlannerPlanListCommand_initOptions() {
|
|
@@ -73,6 +81,8 @@ _PlannerPlanListCommand_instances = new WeakSet(), _PlannerPlanListCommand_initT
|
|
|
73
81
|
option: "--ownerGroupId [ownerGroupId]"
|
|
74
82
|
}, {
|
|
75
83
|
option: "--ownerGroupName [ownerGroupName]"
|
|
84
|
+
}, {
|
|
85
|
+
option: "--rosterId [rosterId]"
|
|
76
86
|
});
|
|
77
87
|
}, _PlannerPlanListCommand_initValidators = function _PlannerPlanListCommand_initValidators() {
|
|
78
88
|
this.validators.push((args) => __awaiter(this, void 0, void 0, function* () {
|
|
@@ -82,7 +92,7 @@ _PlannerPlanListCommand_instances = new WeakSet(), _PlannerPlanListCommand_initT
|
|
|
82
92
|
return true;
|
|
83
93
|
}));
|
|
84
94
|
}, _PlannerPlanListCommand_initOptionSets = function _PlannerPlanListCommand_initOptionSets() {
|
|
85
|
-
this.optionSets.push({ options: ['ownerGroupId', 'ownerGroupName'] });
|
|
95
|
+
this.optionSets.push({ options: ['ownerGroupId', 'ownerGroupName', 'rosterId'] });
|
|
86
96
|
};
|
|
87
97
|
module.exports = new PlannerPlanListCommand();
|
|
88
98
|
//# sourceMappingURL=plan-list.js.map
|
|
@@ -79,7 +79,7 @@ class PlannerPlanRemoveCommand extends GraphCommand_1.default {
|
|
|
79
79
|
return planner_1.planner.getPlanById(id, 'minimal');
|
|
80
80
|
}
|
|
81
81
|
const groupId = yield this.getGroupId(args);
|
|
82
|
-
return yield planner_1.planner.getPlanByTitle(title, groupId);
|
|
82
|
+
return yield planner_1.planner.getPlanByTitle(title, groupId, 'minimal');
|
|
83
83
|
});
|
|
84
84
|
}
|
|
85
85
|
getGroupId(args) {
|
|
@@ -16,6 +16,7 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
|
|
|
16
16
|
var _PlannerTaskChecklistItemAddCommand_instances, _PlannerTaskChecklistItemAddCommand_initTelemetry, _PlannerTaskChecklistItemAddCommand_initOptions;
|
|
17
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
18
|
const uuid_1 = require("uuid");
|
|
19
|
+
const Cli_1 = require("../../../../cli/Cli");
|
|
19
20
|
const request_1 = require("../../../../request");
|
|
20
21
|
const formatting_1 = require("../../../../utils/formatting");
|
|
21
22
|
const GraphCommand_1 = require("../../../base/GraphCommand");
|
|
@@ -61,7 +62,7 @@ class PlannerTaskChecklistItemAddCommand extends GraphCommand_1.default {
|
|
|
61
62
|
data: body
|
|
62
63
|
};
|
|
63
64
|
const result = yield request_1.default.patch(requestOptions);
|
|
64
|
-
if (args.options.output
|
|
65
|
+
if (!Cli_1.Cli.shouldTrimOutput(args.options.output)) {
|
|
65
66
|
logger.log(result.checklist);
|
|
66
67
|
}
|
|
67
68
|
else {
|
|
@@ -15,6 +15,7 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
|
|
|
15
15
|
};
|
|
16
16
|
var _PlannerTaskChecklistItemListCommand_instances, _PlannerTaskChecklistItemListCommand_initOptions;
|
|
17
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
const Cli_1 = require("../../../../cli/Cli");
|
|
18
19
|
const request_1 = require("../../../../request");
|
|
19
20
|
const formatting_1 = require("../../../../utils/formatting");
|
|
20
21
|
const GraphCommand_1 = require("../../../base/GraphCommand");
|
|
@@ -45,7 +46,7 @@ class PlannerTaskChecklistItemListCommand extends GraphCommand_1.default {
|
|
|
45
46
|
};
|
|
46
47
|
try {
|
|
47
48
|
const res = yield request_1.default.get(requestOptions);
|
|
48
|
-
if (!args.options.output || args.options.output
|
|
49
|
+
if (!args.options.output || !Cli_1.Cli.shouldTrimOutput(args.options.output)) {
|
|
49
50
|
logger.log(res.checklist);
|
|
50
51
|
}
|
|
51
52
|
else {
|
|
@@ -15,6 +15,7 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
|
|
|
15
15
|
};
|
|
16
16
|
var _PpSolutionGetCommand_instances, _PpSolutionGetCommand_initTelemetry, _PpSolutionGetCommand_initOptions, _PpSolutionGetCommand_initOptionSets, _PpSolutionGetCommand_initValidators;
|
|
17
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
const Cli_1 = require("../../../../cli/Cli");
|
|
18
19
|
const request_1 = require("../../../../request");
|
|
19
20
|
const powerPlatform_1 = require("../../../../utils/powerPlatform");
|
|
20
21
|
const validation_1 = require("../../../../utils/validation");
|
|
@@ -46,7 +47,7 @@ class PpSolutionGetCommand extends PowerPlatformCommand_1.default {
|
|
|
46
47
|
try {
|
|
47
48
|
const dynamicsApiUrl = yield powerPlatform_1.powerPlatform.getDynamicsInstanceApiUrl(args.options.environment, args.options.asAdmin);
|
|
48
49
|
const res = yield this.getSolution(dynamicsApiUrl, args.options);
|
|
49
|
-
if (!args.options.output || args.options.output
|
|
50
|
+
if (!args.options.output || !Cli_1.Cli.shouldTrimOutput(args.options.output)) {
|
|
50
51
|
logger.log(res);
|
|
51
52
|
}
|
|
52
53
|
else {
|
|
@@ -15,6 +15,7 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
|
|
|
15
15
|
};
|
|
16
16
|
var _PpSolutionListCommand_instances, _PpSolutionListCommand_initTelemetry, _PpSolutionListCommand_initOptions;
|
|
17
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
const Cli_1 = require("../../../../cli/Cli");
|
|
18
19
|
const odata_1 = require("../../../../utils/odata");
|
|
19
20
|
const powerPlatform_1 = require("../../../../utils/powerPlatform");
|
|
20
21
|
const PowerPlatformCommand_1 = require("../../../base/PowerPlatformCommand");
|
|
@@ -44,7 +45,7 @@ class PpSolutionListCommand extends PowerPlatformCommand_1.default {
|
|
|
44
45
|
const dynamicsApiUrl = yield powerPlatform_1.powerPlatform.getDynamicsInstanceApiUrl(args.options.environment, args.options.asAdmin);
|
|
45
46
|
const requestUrl = `${dynamicsApiUrl}/api/data/v9.0/solutions?$filter=isvisible eq true&$expand=publisherid($select=friendlyname)&$select=solutionid,uniquename,version,publisherid,installedon,solutionpackageversion,friendlyname,versionnumber&api-version=9.1`;
|
|
46
47
|
const res = yield odata_1.odata.getAllItems(requestUrl);
|
|
47
|
-
if (!args.options.output || args.options.output
|
|
48
|
+
if (!args.options.output || !Cli_1.Cli.shouldTrimOutput(args.options.output)) {
|
|
48
49
|
logger.log(res);
|
|
49
50
|
}
|
|
50
51
|
else {
|