@pnp/cli-microsoft365 7.8.0-beta.3152fc7 → 7.8.0-beta.4a6e6f7
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/allCommands.json +1 -1
- package/allCommandsFull.json +1 -1
- package/dist/cli/cli.js +21 -9
- package/dist/index.js +13 -12
- package/dist/m365/cli/commands/config/config-set.js +4 -0
- package/dist/m365/commands/setup.js +3 -3
- package/dist/m365/entra/commands/app/app-permission-add.js +25 -6
- package/dist/m365/entra/commands/app/app-permission-list.js +17 -5
- package/dist/m365/entra/commands/group/group-add.js +12 -14
- package/dist/m365/entra/commands/group/group-user-add.js +6 -7
- package/dist/m365/entra/commands/m365group/m365group-add.js +4 -2
- package/dist/m365/entra/commands/user/user-registrationdetails-list.js +6 -7
- package/dist/m365/flow/commands/run/run-list.js +25 -0
- package/dist/m365/outlook/commands/message/message-list.js +87 -17
- package/dist/m365/planner/commands/bucket/bucket-add.js +4 -7
- package/dist/m365/planner/commands/bucket/bucket-get.js +7 -30
- package/dist/m365/planner/commands/bucket/bucket-list.js +3 -6
- package/dist/m365/planner/commands/bucket/bucket-remove.js +8 -25
- package/dist/m365/planner/commands/bucket/bucket-set.js +12 -34
- package/dist/m365/planner/commands/plan/plan-add.js +17 -7
- package/dist/m365/planner/commands/plan/plan-get.js +12 -22
- package/dist/m365/planner/commands/plan/plan-list.js +1 -2
- package/dist/m365/planner/commands/plan/plan-remove.js +5 -3
- package/dist/m365/planner/commands/plan/plan-set.js +18 -10
- package/dist/m365/planner/commands/roster/roster-add.js +1 -2
- package/dist/m365/planner/commands/task/task-add.js +15 -21
- package/dist/m365/planner/commands/task/task-checklistitem-add.js +1 -1
- package/dist/m365/planner/commands/task/task-checklistitem-remove.js +1 -1
- package/dist/m365/planner/commands/task/task-get.js +5 -26
- package/dist/m365/planner/commands/task/task-list.js +11 -37
- package/dist/m365/planner/commands/task/task-reference-remove.js +1 -1
- package/dist/m365/planner/commands/task/task-remove.js +12 -29
- package/dist/m365/planner/commands/task/task-set.js +15 -21
- package/dist/m365/spfx/commands/project/project-doctor/{doctor-1.19.0-beta.0.js → doctor-1.19.0.js} +1 -1
- package/dist/m365/spfx/commands/project/project-doctor.js +1 -1
- package/dist/m365/spfx/commands/project/project-upgrade/{upgrade-1.19.0-beta.0.js → upgrade-1.19.0.js} +22 -22
- package/dist/m365/spfx/commands/project/project-upgrade.js +13 -15
- package/dist/m365/spfx/commands/spfx-doctor.js +1 -1
- package/dist/m365/spo/commands/listitem/listitem-batch-remove.js +222 -0
- package/dist/m365/spo/commands/navigation/navigation-node-add.js +3 -2
- package/dist/m365/spo/commands/navigation/navigation-node-set.js +3 -2
- package/dist/m365/spo/commands/site/site-add.js +17 -26
- package/dist/m365/spo/commands/site/site-recyclebinitem-move.js +5 -2
- package/dist/m365/spo/commands/site/site-recyclebinitem-remove.js +3 -2
- package/dist/m365/spo/commands/site/site-remove.js +129 -159
- package/dist/m365/spo/commands/site/site-set.js +9 -13
- package/dist/m365/spo/commands/spo-set.js +6 -2
- package/dist/m365/spo/commands/tenant/tenant-recyclebinitem-remove.js +9 -13
- package/dist/m365/spo/commands.js +1 -0
- package/dist/m365/teams/commands/meeting/meeting-add.js +3 -3
- package/dist/m365/teams/commands/team/team-add.js +22 -16
- package/dist/settingsNames.js +1 -0
- package/dist/utils/planner.js +87 -8
- package/dist/utils/spo.js +209 -278
- package/dist/utils/urlUtil.js +8 -0
- package/dist/utils/validation.js +8 -5
- package/docs/docs/_clisettings.mdx +1 -0
- package/docs/docs/cmd/entra/app/app-permission-add.mdx +7 -4
- package/docs/docs/cmd/entra/app/app-permission-list.mdx +14 -5
- package/docs/docs/cmd/entra/m365group/m365group-add.mdx +24 -24
- package/docs/docs/cmd/flow/run/run-list.mdx +74 -1
- package/docs/docs/cmd/outlook/message/message-list.mdx +18 -6
- package/docs/docs/cmd/spfx/project/project-upgrade.mdx +1 -1
- package/docs/docs/cmd/spo/listitem/listitem-batch-remove.mdx +70 -0
- package/docs/docs/cmd/spo/site/site-remove.mdx +9 -19
- package/npm-shrinkwrap.json +168 -228
- package/package.json +16 -16
|
@@ -35,7 +35,7 @@ class PlannerBucketAddCommand extends GraphCommand {
|
|
|
35
35
|
const requestOptions = {
|
|
36
36
|
url: `${this.resource}/v1.0/planner/buckets`,
|
|
37
37
|
headers: {
|
|
38
|
-
|
|
38
|
+
accept: 'application/json;odata.metadata=none'
|
|
39
39
|
},
|
|
40
40
|
responseType: 'json',
|
|
41
41
|
data: {
|
|
@@ -57,18 +57,15 @@ class PlannerBucketAddCommand extends GraphCommand {
|
|
|
57
57
|
}
|
|
58
58
|
if (args.options.planTitle) {
|
|
59
59
|
const groupId = await this.getGroupId(args);
|
|
60
|
-
|
|
61
|
-
return plan.id;
|
|
60
|
+
return planner.getPlanIdByTitle(args.options.planTitle, groupId);
|
|
62
61
|
}
|
|
63
|
-
|
|
64
|
-
return plan.id;
|
|
62
|
+
return planner.getPlanIdByRosterId(args.options.rosterId);
|
|
65
63
|
}
|
|
66
64
|
async getGroupId(args) {
|
|
67
65
|
if (args.options.ownerGroupId) {
|
|
68
66
|
return args.options.ownerGroupId;
|
|
69
67
|
}
|
|
70
|
-
|
|
71
|
-
return group.id;
|
|
68
|
+
return entraGroup.getGroupIdByDisplayName(args.options.ownerGroupName);
|
|
72
69
|
}
|
|
73
70
|
}
|
|
74
71
|
_PlannerBucketAddCommand_instances = new WeakSet(), _PlannerBucketAddCommand_initTelemetry = function _PlannerBucketAddCommand_initTelemetry() {
|
|
@@ -10,8 +10,6 @@ import { planner } from '../../../../utils/planner.js';
|
|
|
10
10
|
import { validation } from '../../../../utils/validation.js';
|
|
11
11
|
import GraphCommand from '../../../base/GraphCommand.js';
|
|
12
12
|
import commands from '../../commands.js';
|
|
13
|
-
import { cli } from '../../../../cli/cli.js';
|
|
14
|
-
import { formatting } from '../../../../utils/formatting.js';
|
|
15
13
|
class PlannerBucketGetCommand extends GraphCommand {
|
|
16
14
|
get name() {
|
|
17
15
|
return commands.BUCKET_GET;
|
|
@@ -30,38 +28,20 @@ class PlannerBucketGetCommand extends GraphCommand {
|
|
|
30
28
|
}
|
|
31
29
|
async commandAction(logger, args) {
|
|
32
30
|
try {
|
|
33
|
-
const
|
|
34
|
-
const bucket = await this.getBucketById(bucketId);
|
|
31
|
+
const bucket = await this.getBucket(args);
|
|
35
32
|
await logger.log(bucket);
|
|
36
33
|
}
|
|
37
34
|
catch (err) {
|
|
38
35
|
this.handleRejectedODataJsonPromise(err);
|
|
39
36
|
}
|
|
40
37
|
}
|
|
41
|
-
async
|
|
38
|
+
async getBucket(args) {
|
|
42
39
|
const { id, name } = args.options;
|
|
43
40
|
if (id) {
|
|
44
|
-
return id;
|
|
41
|
+
return this.getBucketById(id);
|
|
45
42
|
}
|
|
46
43
|
const planId = await this.getPlanId(args);
|
|
47
|
-
|
|
48
|
-
url: `${this.resource}/v1.0/planner/plans/${planId}/buckets`,
|
|
49
|
-
headers: {
|
|
50
|
-
accept: 'application/json;odata.metadata=none'
|
|
51
|
-
},
|
|
52
|
-
responseType: 'json'
|
|
53
|
-
};
|
|
54
|
-
const buckets = await request.get(requestOptions);
|
|
55
|
-
const filteredBuckets = buckets.value.filter(b => name.toLowerCase() === b.name.toLowerCase());
|
|
56
|
-
if (!filteredBuckets.length) {
|
|
57
|
-
throw `The specified bucket ${name} does not exist`;
|
|
58
|
-
}
|
|
59
|
-
if (filteredBuckets.length > 1) {
|
|
60
|
-
const resultAsKeyValuePair = formatting.convertArrayToHashTable('id', filteredBuckets);
|
|
61
|
-
const result = await cli.handleMultipleResultsFound(`Multiple buckets with name '${name}' found.`, resultAsKeyValuePair);
|
|
62
|
-
return result.id.toString();
|
|
63
|
-
}
|
|
64
|
-
return filteredBuckets[0].id.toString();
|
|
44
|
+
return planner.getBucketByTitle(name, planId);
|
|
65
45
|
}
|
|
66
46
|
async getPlanId(args) {
|
|
67
47
|
const { planId, planTitle, rosterId } = args.options;
|
|
@@ -70,11 +50,9 @@ class PlannerBucketGetCommand extends GraphCommand {
|
|
|
70
50
|
}
|
|
71
51
|
if (planTitle) {
|
|
72
52
|
const groupId = await this.getGroupId(args);
|
|
73
|
-
|
|
74
|
-
return plan.id;
|
|
53
|
+
return planner.getPlanIdByTitle(planTitle, groupId);
|
|
75
54
|
}
|
|
76
|
-
|
|
77
|
-
return plan.id;
|
|
55
|
+
return planner.getPlanIdByRosterId(rosterId);
|
|
78
56
|
}
|
|
79
57
|
async getBucketById(id) {
|
|
80
58
|
const requestOptions = {
|
|
@@ -91,8 +69,7 @@ class PlannerBucketGetCommand extends GraphCommand {
|
|
|
91
69
|
if (ownerGroupId) {
|
|
92
70
|
return ownerGroupId;
|
|
93
71
|
}
|
|
94
|
-
|
|
95
|
-
return group.id;
|
|
72
|
+
return entraGroup.getGroupIdByDisplayName(ownerGroupName);
|
|
96
73
|
}
|
|
97
74
|
}
|
|
98
75
|
_PlannerBucketGetCommand_instances = new WeakSet(), _PlannerBucketGetCommand_initTelemetry = function _PlannerBucketGetCommand_initTelemetry() {
|
|
@@ -45,18 +45,15 @@ class PlannerBucketListCommand extends GraphCommand {
|
|
|
45
45
|
}
|
|
46
46
|
if (args.options.planTitle) {
|
|
47
47
|
const groupId = await this.getGroupId(args);
|
|
48
|
-
|
|
49
|
-
return plan.id;
|
|
48
|
+
return planner.getPlanIdByTitle(args.options.planTitle, groupId);
|
|
50
49
|
}
|
|
51
|
-
|
|
52
|
-
return plan.id;
|
|
50
|
+
return planner.getPlanIdByRosterId(args.options.rosterId);
|
|
53
51
|
}
|
|
54
52
|
async getGroupId(args) {
|
|
55
53
|
if (args.options.ownerGroupId) {
|
|
56
54
|
return args.options.ownerGroupId;
|
|
57
55
|
}
|
|
58
|
-
|
|
59
|
-
return group.id;
|
|
56
|
+
return entraGroup.getGroupIdByDisplayName(args.options.ownerGroupName);
|
|
60
57
|
}
|
|
61
58
|
}
|
|
62
59
|
_PlannerBucketListCommand_instances = new WeakSet(), _PlannerBucketListCommand_initTelemetry = function _PlannerBucketListCommand_initTelemetry() {
|
|
@@ -11,7 +11,6 @@ import { planner } from '../../../../utils/planner.js';
|
|
|
11
11
|
import { validation } from '../../../../utils/validation.js';
|
|
12
12
|
import GraphCommand from '../../../base/GraphCommand.js';
|
|
13
13
|
import commands from '../../commands.js';
|
|
14
|
-
import { formatting } from '../../../../utils/formatting.js';
|
|
15
14
|
class PlannerBucketRemoveCommand extends GraphCommand {
|
|
16
15
|
get name() {
|
|
17
16
|
return commands.BUCKET_REMOVE;
|
|
@@ -30,6 +29,9 @@ class PlannerBucketRemoveCommand extends GraphCommand {
|
|
|
30
29
|
}
|
|
31
30
|
async commandAction(logger, args) {
|
|
32
31
|
const removeBucket = async () => {
|
|
32
|
+
if (this.verbose) {
|
|
33
|
+
await logger.logToStderr(`Removing bucket...`);
|
|
34
|
+
}
|
|
33
35
|
try {
|
|
34
36
|
const bucket = await this.getBucket(args);
|
|
35
37
|
const requestOptions = {
|
|
@@ -61,30 +63,14 @@ class PlannerBucketRemoveCommand extends GraphCommand {
|
|
|
61
63
|
const requestOptions = {
|
|
62
64
|
url: `${this.resource}/v1.0/planner/buckets/${args.options.id}`,
|
|
63
65
|
headers: {
|
|
64
|
-
accept: 'application/json'
|
|
66
|
+
accept: 'application/json;odata.metadata=minimal'
|
|
65
67
|
},
|
|
66
68
|
responseType: 'json'
|
|
67
69
|
};
|
|
68
70
|
return await request.get(requestOptions);
|
|
69
71
|
}
|
|
70
72
|
const planId = await this.getPlanId(args);
|
|
71
|
-
|
|
72
|
-
url: `${this.resource}/v1.0/planner/plans/${planId}/buckets`,
|
|
73
|
-
headers: {
|
|
74
|
-
accept: 'application/json'
|
|
75
|
-
},
|
|
76
|
-
responseType: 'json'
|
|
77
|
-
};
|
|
78
|
-
const buckets = await request.get(requestOptions);
|
|
79
|
-
const filteredBuckets = buckets.value.filter(b => args.options.name.toLowerCase() === b.name.toLowerCase());
|
|
80
|
-
if (!filteredBuckets.length) {
|
|
81
|
-
throw `The specified bucket ${args.options.name} does not exist`;
|
|
82
|
-
}
|
|
83
|
-
if (filteredBuckets.length > 1) {
|
|
84
|
-
const resultAsKeyValuePair = formatting.convertArrayToHashTable('id', filteredBuckets);
|
|
85
|
-
return await cli.handleMultipleResultsFound(`Multiple buckets with name '${args.options.name}' found.`, resultAsKeyValuePair);
|
|
86
|
-
}
|
|
87
|
-
return filteredBuckets[0];
|
|
73
|
+
return planner.getBucketByTitle(args.options.name, planId, 'minimal');
|
|
88
74
|
}
|
|
89
75
|
async getPlanId(args) {
|
|
90
76
|
const { planId, planTitle, rosterId } = args.options;
|
|
@@ -93,19 +79,16 @@ class PlannerBucketRemoveCommand extends GraphCommand {
|
|
|
93
79
|
}
|
|
94
80
|
if (planTitle) {
|
|
95
81
|
const groupId = await this.getGroupId(args);
|
|
96
|
-
|
|
97
|
-
return plan.id;
|
|
82
|
+
return planner.getPlanIdByTitle(planTitle, groupId);
|
|
98
83
|
}
|
|
99
|
-
|
|
100
|
-
return plan.id;
|
|
84
|
+
return planner.getPlanIdByRosterId(rosterId);
|
|
101
85
|
}
|
|
102
86
|
async getGroupId(args) {
|
|
103
87
|
const { ownerGroupId, ownerGroupName } = args.options;
|
|
104
88
|
if (ownerGroupId) {
|
|
105
89
|
return ownerGroupId;
|
|
106
90
|
}
|
|
107
|
-
|
|
108
|
-
return group.id;
|
|
91
|
+
return entraGroup.getGroupIdByDisplayName(ownerGroupName);
|
|
109
92
|
}
|
|
110
93
|
}
|
|
111
94
|
_PlannerBucketRemoveCommand_instances = new WeakSet(), _PlannerBucketRemoveCommand_initTelemetry = function _PlannerBucketRemoveCommand_initTelemetry() {
|
|
@@ -10,8 +10,6 @@ import { planner } from '../../../../utils/planner.js';
|
|
|
10
10
|
import { validation } from '../../../../utils/validation.js';
|
|
11
11
|
import GraphCommand from '../../../base/GraphCommand.js';
|
|
12
12
|
import commands from '../../commands.js';
|
|
13
|
-
import { cli } from '../../../../cli/cli.js';
|
|
14
|
-
import { formatting } from '../../../../utils/formatting.js';
|
|
15
13
|
class PlannerBucketSetCommand extends GraphCommand {
|
|
16
14
|
get name() {
|
|
17
15
|
return commands.BUCKET_SET;
|
|
@@ -29,6 +27,9 @@ class PlannerBucketSetCommand extends GraphCommand {
|
|
|
29
27
|
__classPrivateFieldGet(this, _PlannerBucketSetCommand_instances, "m", _PlannerBucketSetCommand_initTypes).call(this);
|
|
30
28
|
}
|
|
31
29
|
async commandAction(logger, args) {
|
|
30
|
+
if (this.verbose) {
|
|
31
|
+
await logger.logToStderr(`Updating bucket...`);
|
|
32
|
+
}
|
|
32
33
|
try {
|
|
33
34
|
const bucket = await this.getBucket(args);
|
|
34
35
|
const requestOptions = {
|
|
@@ -38,15 +39,11 @@ class PlannerBucketSetCommand extends GraphCommand {
|
|
|
38
39
|
'if-match': bucket['@odata.etag']
|
|
39
40
|
},
|
|
40
41
|
responseType: 'json',
|
|
41
|
-
data: {
|
|
42
|
+
data: {
|
|
43
|
+
name: args.options.newName,
|
|
44
|
+
orderHint: args.options.orderHint
|
|
45
|
+
}
|
|
42
46
|
};
|
|
43
|
-
const { newName, orderHint } = args.options;
|
|
44
|
-
if (newName) {
|
|
45
|
-
requestOptions.data.name = newName;
|
|
46
|
-
}
|
|
47
|
-
if (orderHint) {
|
|
48
|
-
requestOptions.data.orderHint = orderHint;
|
|
49
|
-
}
|
|
50
47
|
await request.patch(requestOptions);
|
|
51
48
|
}
|
|
52
49
|
catch (err) {
|
|
@@ -58,30 +55,14 @@ class PlannerBucketSetCommand extends GraphCommand {
|
|
|
58
55
|
const requestOptions = {
|
|
59
56
|
url: `${this.resource}/v1.0/planner/buckets/${args.options.id}`,
|
|
60
57
|
headers: {
|
|
61
|
-
accept: 'application/json'
|
|
58
|
+
accept: 'application/json;odata.metadata=minimal'
|
|
62
59
|
},
|
|
63
60
|
responseType: 'json'
|
|
64
61
|
};
|
|
65
62
|
return await request.get(requestOptions);
|
|
66
63
|
}
|
|
67
64
|
const planId = await this.getPlanId(args);
|
|
68
|
-
|
|
69
|
-
url: `${this.resource}/v1.0/planner/plans/${planId}/buckets`,
|
|
70
|
-
headers: {
|
|
71
|
-
accept: 'application/json'
|
|
72
|
-
},
|
|
73
|
-
responseType: 'json'
|
|
74
|
-
};
|
|
75
|
-
const buckets = await request.get(requestOptions);
|
|
76
|
-
const filteredBuckets = buckets.value.filter(b => args.options.name.toLowerCase() === b.name.toLowerCase());
|
|
77
|
-
if (!filteredBuckets.length) {
|
|
78
|
-
throw `The specified bucket ${args.options.name} does not exist`;
|
|
79
|
-
}
|
|
80
|
-
if (filteredBuckets.length > 1) {
|
|
81
|
-
const resultAsKeyValuePair = formatting.convertArrayToHashTable('id', filteredBuckets);
|
|
82
|
-
return await cli.handleMultipleResultsFound(`Multiple buckets with name '${args.options.name}' found.`, resultAsKeyValuePair);
|
|
83
|
-
}
|
|
84
|
-
return filteredBuckets[0];
|
|
65
|
+
return planner.getBucketByTitle(args.options.name, planId, 'minimal');
|
|
85
66
|
}
|
|
86
67
|
async getPlanId(args) {
|
|
87
68
|
const { planId, planTitle, rosterId } = args.options;
|
|
@@ -90,19 +71,16 @@ class PlannerBucketSetCommand extends GraphCommand {
|
|
|
90
71
|
}
|
|
91
72
|
if (planTitle) {
|
|
92
73
|
const groupId = await this.getGroupId(args);
|
|
93
|
-
|
|
94
|
-
return plan.id;
|
|
74
|
+
return planner.getPlanIdByTitle(planTitle, groupId);
|
|
95
75
|
}
|
|
96
|
-
|
|
97
|
-
return plan.id;
|
|
76
|
+
return planner.getPlanIdByRosterId(rosterId);
|
|
98
77
|
}
|
|
99
78
|
async getGroupId(args) {
|
|
100
79
|
const { ownerGroupId, ownerGroupName } = args.options;
|
|
101
80
|
if (ownerGroupId) {
|
|
102
81
|
return ownerGroupId;
|
|
103
82
|
}
|
|
104
|
-
|
|
105
|
-
return group.id;
|
|
83
|
+
return entraGroup.getGroupIdByDisplayName(ownerGroupName);
|
|
106
84
|
}
|
|
107
85
|
}
|
|
108
86
|
_PlannerBucketSetCommand_instances = new WeakSet(), _PlannerBucketSetCommand_initTelemetry = function _PlannerBucketSetCommand_initTelemetry() {
|
|
@@ -37,12 +37,14 @@ class PlannerPlanAddCommand extends GraphCommand {
|
|
|
37
37
|
};
|
|
38
38
|
if (args.options.rosterId) {
|
|
39
39
|
data.container = {
|
|
40
|
-
|
|
40
|
+
url: `https://graph.microsoft.com/v1.0/planner/rosters/${args.options.rosterId}`
|
|
41
41
|
};
|
|
42
42
|
}
|
|
43
43
|
else {
|
|
44
44
|
const groupId = await this.getGroupId(args);
|
|
45
|
-
data.
|
|
45
|
+
data.container = {
|
|
46
|
+
url: `https://graph.microsoft.com/v1.0/groups/${groupId}`
|
|
47
|
+
};
|
|
46
48
|
}
|
|
47
49
|
const requestOptions = {
|
|
48
50
|
url: `${this.resource}/v1.0/planner/plans`,
|
|
@@ -57,7 +59,7 @@ class PlannerPlanAddCommand extends GraphCommand {
|
|
|
57
59
|
await logger.log(result);
|
|
58
60
|
}
|
|
59
61
|
catch (err) {
|
|
60
|
-
if (
|
|
62
|
+
if (args.options.rosterId && err.error?.error.message === "You do not have the required permissions to access this item, or the item may not exist.") {
|
|
61
63
|
throw new CommandError("You can only add 1 plan to a Roster");
|
|
62
64
|
}
|
|
63
65
|
this.handleRejectedODataJsonPromise(err);
|
|
@@ -134,8 +136,7 @@ class PlannerPlanAddCommand extends GraphCommand {
|
|
|
134
136
|
if (args.options.ownerGroupId) {
|
|
135
137
|
return args.options.ownerGroupId;
|
|
136
138
|
}
|
|
137
|
-
|
|
138
|
-
return group.id;
|
|
139
|
+
return entraGroup.getGroupIdByDisplayName(args.options.ownerGroupName);
|
|
139
140
|
}
|
|
140
141
|
}
|
|
141
142
|
_PlannerPlanAddCommand_instances = new WeakSet(), _PlannerPlanAddCommand_initTelemetry = function _PlannerPlanAddCommand_initTelemetry() {
|
|
@@ -169,8 +170,17 @@ _PlannerPlanAddCommand_instances = new WeakSet(), _PlannerPlanAddCommand_initTel
|
|
|
169
170
|
if (args.options.shareWithUserIds && args.options.shareWithUserNames) {
|
|
170
171
|
return 'Specify either shareWithUserIds or shareWithUserNames but not both';
|
|
171
172
|
}
|
|
172
|
-
if (args.options.shareWithUserIds
|
|
173
|
-
|
|
173
|
+
if (args.options.shareWithUserIds) {
|
|
174
|
+
const isValidGUIDArrayResult = validation.isValidGuidArray(args.options.shareWithUserIds);
|
|
175
|
+
if (isValidGUIDArrayResult !== true) {
|
|
176
|
+
return `The following GUIDs are invalid for the option 'shareWithUserIds': ${isValidGUIDArrayResult}.`;
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
if (args.options.shareWithUserNames) {
|
|
180
|
+
const isValidUPNArrayResult = validation.isValidUserPrincipalNameArray(args.options.shareWithUserNames);
|
|
181
|
+
if (isValidUPNArrayResult !== true) {
|
|
182
|
+
return `The following user principal names are invalid for the option 'shareWithUserNames': ${isValidUPNArrayResult}.`;
|
|
183
|
+
}
|
|
174
184
|
}
|
|
175
185
|
return true;
|
|
176
186
|
});
|
|
@@ -31,28 +31,19 @@ class PlannerPlanGetCommand extends GraphCommand {
|
|
|
31
31
|
}
|
|
32
32
|
async commandAction(logger, args) {
|
|
33
33
|
try {
|
|
34
|
+
let plan;
|
|
34
35
|
if (args.options.id) {
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
36
|
+
plan = await planner.getPlanById(args.options.id);
|
|
37
|
+
}
|
|
38
|
+
else if (args.options.rosterId) {
|
|
39
|
+
plan = await planner.getPlanByRosterId(args.options.rosterId);
|
|
38
40
|
}
|
|
39
41
|
else {
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
plan = await planner.getPlanByRosterId(args.options.rosterId);
|
|
43
|
-
}
|
|
44
|
-
else {
|
|
45
|
-
let groupId = undefined;
|
|
46
|
-
if (args.options.ownerGroupId || args.options.ownerGroupName) {
|
|
47
|
-
groupId = await this.getGroupId(args);
|
|
48
|
-
}
|
|
49
|
-
plan = await planner.getPlanByTitle(args.options.title, groupId);
|
|
50
|
-
}
|
|
51
|
-
const result = await this.getPlanDetails(plan);
|
|
52
|
-
if (result) {
|
|
53
|
-
await logger.log(result);
|
|
54
|
-
}
|
|
42
|
+
const groupId = await this.getGroupId(args);
|
|
43
|
+
plan = await planner.getPlanByTitle(args.options.title, groupId);
|
|
55
44
|
}
|
|
45
|
+
const result = await this.getPlanDetails(plan);
|
|
46
|
+
await logger.log(result);
|
|
56
47
|
}
|
|
57
48
|
catch (err) {
|
|
58
49
|
this.handleRejectedODataJsonPromise(err);
|
|
@@ -62,8 +53,8 @@ class PlannerPlanGetCommand extends GraphCommand {
|
|
|
62
53
|
const requestOptionsTaskDetails = {
|
|
63
54
|
url: `${this.resource}/v1.0/planner/plans/${plan.id}/details`,
|
|
64
55
|
headers: {
|
|
65
|
-
|
|
66
|
-
|
|
56
|
+
accept: 'application/json;odata.metadata=none',
|
|
57
|
+
Prefer: 'return=representation'
|
|
67
58
|
},
|
|
68
59
|
responseType: 'json'
|
|
69
60
|
};
|
|
@@ -74,8 +65,7 @@ class PlannerPlanGetCommand extends GraphCommand {
|
|
|
74
65
|
if (args.options.ownerGroupId) {
|
|
75
66
|
return args.options.ownerGroupId;
|
|
76
67
|
}
|
|
77
|
-
|
|
78
|
-
return group.id;
|
|
68
|
+
return entraGroup.getGroupIdByDisplayName(args.options.ownerGroupName);
|
|
79
69
|
}
|
|
80
70
|
}
|
|
81
71
|
_PlannerPlanGetCommand_instances = new WeakSet(), _PlannerPlanGetCommand_initTelemetry = function _PlannerPlanGetCommand_initTelemetry() {
|
|
@@ -49,8 +49,7 @@ class PlannerPlanListCommand extends GraphCommand {
|
|
|
49
49
|
if (args.options.ownerGroupId) {
|
|
50
50
|
return args.options.ownerGroupId;
|
|
51
51
|
}
|
|
52
|
-
|
|
53
|
-
return group.id;
|
|
52
|
+
return entraGroup.getGroupIdByDisplayName(args.options.ownerGroupName);
|
|
54
53
|
}
|
|
55
54
|
}
|
|
56
55
|
_PlannerPlanListCommand_instances = new WeakSet(), _PlannerPlanListCommand_initTelemetry = function _PlannerPlanListCommand_initTelemetry() {
|
|
@@ -31,6 +31,9 @@ class PlannerPlanRemoveCommand extends GraphCommand {
|
|
|
31
31
|
const removePlan = async () => {
|
|
32
32
|
try {
|
|
33
33
|
const plan = await this.getPlan(args);
|
|
34
|
+
if (this.verbose) {
|
|
35
|
+
await logger.logToStderr(`Removing plan '${plan.title}' ...`);
|
|
36
|
+
}
|
|
34
37
|
const requestOptions = {
|
|
35
38
|
url: `${this.resource}/v1.0/planner/plans/${plan.id}`,
|
|
36
39
|
headers: {
|
|
@@ -61,15 +64,14 @@ class PlannerPlanRemoveCommand extends GraphCommand {
|
|
|
61
64
|
return planner.getPlanById(id, 'minimal');
|
|
62
65
|
}
|
|
63
66
|
const groupId = await this.getGroupId(args);
|
|
64
|
-
return
|
|
67
|
+
return planner.getPlanByTitle(title, groupId, 'minimal');
|
|
65
68
|
}
|
|
66
69
|
async getGroupId(args) {
|
|
67
70
|
const { ownerGroupId, ownerGroupName } = args.options;
|
|
68
71
|
if (ownerGroupId) {
|
|
69
72
|
return ownerGroupId;
|
|
70
73
|
}
|
|
71
|
-
|
|
72
|
-
return group.id;
|
|
74
|
+
return entraGroup.getGroupIdByDisplayName(ownerGroupName);
|
|
73
75
|
}
|
|
74
76
|
}
|
|
75
77
|
_PlannerPlanRemoveCommand_instances = new WeakSet(), _PlannerPlanRemoveCommand_initTelemetry = function _PlannerPlanRemoveCommand_initTelemetry() {
|
|
@@ -38,23 +38,22 @@ class PlannerPlanSetCommand extends GraphCommand {
|
|
|
38
38
|
if (ownerGroupId) {
|
|
39
39
|
return ownerGroupId;
|
|
40
40
|
}
|
|
41
|
-
const
|
|
42
|
-
return
|
|
41
|
+
const id = await entraGroup.getGroupIdByDisplayName(ownerGroupName);
|
|
42
|
+
return id;
|
|
43
43
|
}
|
|
44
44
|
async getPlanId(args) {
|
|
45
45
|
const { id, title } = args.options;
|
|
46
46
|
if (id) {
|
|
47
47
|
return id;
|
|
48
48
|
}
|
|
49
|
-
let groupId = '';
|
|
50
49
|
if (args.options.rosterId) {
|
|
51
|
-
const
|
|
52
|
-
return
|
|
50
|
+
const id = await planner.getPlanIdByRosterId(args.options.rosterId);
|
|
51
|
+
return id;
|
|
53
52
|
}
|
|
54
53
|
else {
|
|
55
|
-
groupId = await this.getGroupId(args);
|
|
56
|
-
const
|
|
57
|
-
return
|
|
54
|
+
const groupId = await this.getGroupId(args);
|
|
55
|
+
const id = await planner.getPlanIdByTitle(title, groupId);
|
|
56
|
+
return id;
|
|
58
57
|
}
|
|
59
58
|
}
|
|
60
59
|
async getUserIds(options) {
|
|
@@ -226,8 +225,17 @@ _PlannerPlanSetCommand_instances = new WeakSet(), _PlannerPlanSetCommand_initTel
|
|
|
226
225
|
if (args.options.shareWithUserIds && args.options.shareWithUserNames) {
|
|
227
226
|
return 'Specify either shareWithUserIds or shareWithUserNames but not both';
|
|
228
227
|
}
|
|
229
|
-
if (args.options.shareWithUserIds
|
|
230
|
-
|
|
228
|
+
if (args.options.shareWithUserIds) {
|
|
229
|
+
const isValidGUIDArrayResult = validation.isValidGuidArray(args.options.shareWithUserIds);
|
|
230
|
+
if (isValidGUIDArrayResult !== true) {
|
|
231
|
+
return `The following GUIDs are invalid for the option 'shareWithUserIds': ${isValidGUIDArrayResult}.`;
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
if (args.options.shareWithUserNames) {
|
|
235
|
+
const isValidUPNArrayResult = validation.isValidUserPrincipalNameArray(args.options.shareWithUserNames);
|
|
236
|
+
if (isValidUPNArrayResult !== true) {
|
|
237
|
+
return `The following user principal names are invalid for the option 'shareWithUserNames': ${isValidUPNArrayResult}.`;
|
|
238
|
+
}
|
|
231
239
|
}
|
|
232
240
|
const allowedCategories = [
|
|
233
241
|
'category1',
|
|
@@ -13,13 +13,12 @@ class PlannerRosterAddCommand extends GraphCommand {
|
|
|
13
13
|
await logger.logToStderr('Creating a new Microsoft Planner Roster');
|
|
14
14
|
}
|
|
15
15
|
try {
|
|
16
|
-
const requestBody = {};
|
|
17
16
|
const requestOptions = {
|
|
18
17
|
url: `${this.resource}/beta/planner/rosters`,
|
|
19
18
|
headers: {
|
|
20
19
|
accept: 'application/json;odata.metadata=none'
|
|
21
20
|
},
|
|
22
|
-
data:
|
|
21
|
+
data: {},
|
|
23
22
|
responseType: 'json'
|
|
24
23
|
};
|
|
25
24
|
const response = await request.post(requestOptions);
|
|
@@ -124,40 +124,25 @@ class PlannerTaskAddCommand extends GraphCommand {
|
|
|
124
124
|
if (args.options.bucketId) {
|
|
125
125
|
return args.options.bucketId;
|
|
126
126
|
}
|
|
127
|
-
|
|
128
|
-
url: `${this.resource}/v1.0/planner/plans/${planId}/buckets`,
|
|
129
|
-
headers: {
|
|
130
|
-
accept: 'application/json;odata.metadata=none'
|
|
131
|
-
},
|
|
132
|
-
responseType: 'json'
|
|
133
|
-
};
|
|
134
|
-
const response = await request.get(requestOptions);
|
|
135
|
-
const bucket = response.value.find(val => val.name === args.options.bucketName);
|
|
136
|
-
if (!bucket) {
|
|
137
|
-
throw `The specified bucket does not exist`;
|
|
138
|
-
}
|
|
139
|
-
return bucket.id;
|
|
127
|
+
return planner.getBucketIdByTitle(args.options.bucketName, planId);
|
|
140
128
|
}
|
|
141
129
|
async getPlanId(args) {
|
|
142
130
|
if (args.options.planId) {
|
|
143
131
|
return args.options.planId;
|
|
144
132
|
}
|
|
145
133
|
if (args.options.rosterId) {
|
|
146
|
-
|
|
147
|
-
return plan.id;
|
|
134
|
+
return planner.getPlanIdByRosterId(args.options.rosterId);
|
|
148
135
|
}
|
|
149
136
|
else {
|
|
150
137
|
const groupId = await this.getGroupId(args);
|
|
151
|
-
|
|
152
|
-
return plan.id;
|
|
138
|
+
return planner.getPlanIdByTitle(args.options.planTitle, groupId);
|
|
153
139
|
}
|
|
154
140
|
}
|
|
155
141
|
async getGroupId(args) {
|
|
156
142
|
if (args.options.ownerGroupId) {
|
|
157
143
|
return args.options.ownerGroupId;
|
|
158
144
|
}
|
|
159
|
-
|
|
160
|
-
return group.id;
|
|
145
|
+
return entraGroup.getGroupIdByDisplayName(args.options.ownerGroupName);
|
|
161
146
|
}
|
|
162
147
|
async getUserIds(options) {
|
|
163
148
|
if (options.assignedToUserIds) {
|
|
@@ -237,12 +222,21 @@ _PlannerTaskAddCommand_instances = new WeakSet(), _PlannerTaskAddCommand_initTel
|
|
|
237
222
|
if (args.options.percentComplete && (args.options.percentComplete < 0 || args.options.percentComplete > 100)) {
|
|
238
223
|
return `percentComplete should be between 0 and 100`;
|
|
239
224
|
}
|
|
240
|
-
if (args.options.assignedToUserIds
|
|
241
|
-
|
|
225
|
+
if (args.options.assignedToUserIds) {
|
|
226
|
+
const isValidGUIDArrayResult = validation.isValidGuidArray(args.options.assignedToUserIds);
|
|
227
|
+
if (isValidGUIDArrayResult !== true) {
|
|
228
|
+
return `The following GUIDs are invalid for the option 'assignedToUserIds': ${isValidGUIDArrayResult}.`;
|
|
229
|
+
}
|
|
242
230
|
}
|
|
243
231
|
if (args.options.assignedToUserIds && args.options.assignedToUserNames) {
|
|
244
232
|
return 'Specify either assignedToUserIds or assignedToUserNames but not both';
|
|
245
233
|
}
|
|
234
|
+
if (args.options.assignedToUserNames) {
|
|
235
|
+
const isValidUPNArrayResult = validation.isValidUserPrincipalNameArray(args.options.assignedToUserNames);
|
|
236
|
+
if (isValidUPNArrayResult !== true) {
|
|
237
|
+
return `The following user principal names are invalid for the option 'assignedToUserNames': ${isValidUPNArrayResult}.`;
|
|
238
|
+
}
|
|
239
|
+
}
|
|
246
240
|
if (args.options.appliedCategories && args.options.appliedCategories.split(',').filter(category => this.allowedAppliedCategories.indexOf(category.toLocaleLowerCase()) < 0).length !== 0) {
|
|
247
241
|
return `The appliedCategories contains invalid value. Specify either ${this.allowedAppliedCategories.join(', ')} as properties`;
|
|
248
242
|
}
|
|
@@ -79,7 +79,7 @@ class PlannerTaskChecklistItemAddCommand extends GraphCommand {
|
|
|
79
79
|
_PlannerTaskChecklistItemAddCommand_instances = new WeakSet(), _PlannerTaskChecklistItemAddCommand_initTelemetry = function _PlannerTaskChecklistItemAddCommand_initTelemetry() {
|
|
80
80
|
this.telemetry.push((args) => {
|
|
81
81
|
Object.assign(this.telemetryProperties, {
|
|
82
|
-
isChecked: args.options.isChecked
|
|
82
|
+
isChecked: !!args.options.isChecked
|
|
83
83
|
});
|
|
84
84
|
});
|
|
85
85
|
}, _PlannerTaskChecklistItemAddCommand_initOptions = function _PlannerTaskChecklistItemAddCommand_initOptions() {
|
|
@@ -74,7 +74,7 @@ class PlannerTaskChecklistItemRemoveCommand extends GraphCommand {
|
|
|
74
74
|
_PlannerTaskChecklistItemRemoveCommand_instances = new WeakSet(), _PlannerTaskChecklistItemRemoveCommand_initTelemetry = function _PlannerTaskChecklistItemRemoveCommand_initTelemetry() {
|
|
75
75
|
this.telemetry.push((args) => {
|
|
76
76
|
Object.assign(this.telemetryProperties, {
|
|
77
|
-
force:
|
|
77
|
+
force: !!args.options.force
|
|
78
78
|
});
|
|
79
79
|
});
|
|
80
80
|
}, _PlannerTaskChecklistItemRemoveCommand_initOptions = function _PlannerTaskChecklistItemRemoveCommand_initOptions() {
|