@pnp/cli-microsoft365 5.4.0-beta.3879fc9 → 5.4.0-beta.96022f3
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 +1 -0
- package/dist/m365/aad/commands/o365group/o365group-conversation-post-list.js +4 -19
- package/dist/m365/aad/commands/o365group/o365group-get.js +3 -9
- package/dist/m365/planner/commands/bucket/bucket-add.js +4 -16
- package/dist/m365/planner/commands/bucket/bucket-get.js +4 -18
- package/dist/m365/planner/commands/bucket/bucket-list.js +4 -17
- package/dist/m365/planner/commands/bucket/bucket-remove.js +4 -18
- package/dist/m365/planner/commands/bucket/bucket-set.js +4 -18
- package/dist/m365/planner/commands/plan/plan-add.js +4 -16
- package/dist/m365/planner/commands/plan/plan-details-get.js +4 -19
- package/dist/m365/planner/commands/plan/plan-get.js +4 -17
- package/dist/m365/planner/commands/plan/plan-list.js +4 -17
- package/dist/m365/planner/commands/task/task-add.js +4 -16
- package/dist/m365/planner/commands/task/task-checklistitem-add.js +89 -0
- package/dist/m365/planner/commands/task/task-get.js +4 -19
- package/dist/m365/planner/commands/task/task-list.js +4 -16
- package/dist/m365/planner/commands/task/task-set.js +4 -16
- package/dist/m365/planner/commands.js +1 -0
- package/dist/m365/spo/commands/listitem/listitem-list.js +30 -10
- package/dist/m365/spo/commands/roledefinition/roledefinition-remove.js +82 -0
- package/dist/m365/spo/commands/site/site-remove.js +23 -37
- package/dist/m365/spo/commands.js +1 -0
- package/dist/m365/teams/commands/app/app-list.js +6 -20
- package/dist/m365/teams/commands/channel/channel-get.js +6 -19
- package/dist/m365/teams/commands/channel/channel-list.js +6 -18
- package/dist/m365/teams/commands/channel/channel-member-add.js +7 -18
- package/dist/m365/teams/commands/channel/channel-member-list.js +6 -19
- package/dist/m365/teams/commands/channel/channel-member-remove.js +6 -19
- package/dist/m365/teams/commands/channel/channel-member-set.js +6 -19
- package/dist/m365/teams/commands/tab/tab-get.js +6 -19
- package/dist/m365/teams/commands/team/team-add.js +2 -7
- package/dist/m365/teams/commands/team/team-get.js +6 -19
- package/dist/utils/aadGroup.js +57 -0
- package/dist/utils/index.js +2 -0
- package/docs/docs/cmd/planner/task/task-checklistitem-add.md +36 -0
- package/docs/docs/cmd/spo/listitem/listitem-list.md +16 -10
- package/docs/docs/cmd/spo/roledefinition/roledefinition-remove.md +36 -0
- package/package.json +1 -1
package/.eslintrc.js
CHANGED
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
const utils_1 = require("../../../../utils");
|
|
4
4
|
const GraphCommand_1 = require("../../../base/GraphCommand");
|
|
5
5
|
const commands_1 = require("../../commands");
|
|
6
|
-
const
|
|
6
|
+
const aadGroup_1 = require("../../../../utils/aadGroup");
|
|
7
7
|
class AadO365GroupConversationPostListCommand extends GraphCommand_1.default {
|
|
8
8
|
get name() {
|
|
9
9
|
return commands_1.default.O365GROUP_CONVERSATION_POST_LIST;
|
|
@@ -35,24 +35,9 @@ class AadO365GroupConversationPostListCommand extends GraphCommand_1.default {
|
|
|
35
35
|
if (args.options.groupId) {
|
|
36
36
|
return Promise.resolve(encodeURIComponent(args.options.groupId));
|
|
37
37
|
}
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
accept: 'application/json;odata.metadata=none'
|
|
42
|
-
},
|
|
43
|
-
responseType: 'json'
|
|
44
|
-
};
|
|
45
|
-
return request_1.default
|
|
46
|
-
.get(requestOptions)
|
|
47
|
-
.then(res => {
|
|
48
|
-
if (res.value.length === 1) {
|
|
49
|
-
return Promise.resolve(res.value[0].id);
|
|
50
|
-
}
|
|
51
|
-
if (res.value.length === 0) {
|
|
52
|
-
return Promise.reject(`The specified group does not exist`);
|
|
53
|
-
}
|
|
54
|
-
return Promise.reject(`Multiple groups found with name ${args.options.groupDisplayName} found. Please choose between the following IDs: ${res.value.map(a => a.id).join(', ')}`);
|
|
55
|
-
});
|
|
38
|
+
return aadGroup_1.aadGroup
|
|
39
|
+
.getGroupByDisplayName(args.options.groupDisplayName)
|
|
40
|
+
.then(group => group.id);
|
|
56
41
|
}
|
|
57
42
|
options() {
|
|
58
43
|
const options = [
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const request_1 = require("../../../../request");
|
|
4
4
|
const utils_1 = require("../../../../utils");
|
|
5
|
+
const aadGroup_1 = require("../../../../utils/aadGroup");
|
|
5
6
|
const GraphCommand_1 = require("../../../base/GraphCommand");
|
|
6
7
|
const commands_1 = require("../../commands");
|
|
7
8
|
class AadO365GroupGetCommand extends GraphCommand_1.default {
|
|
@@ -13,15 +14,8 @@ class AadO365GroupGetCommand extends GraphCommand_1.default {
|
|
|
13
14
|
}
|
|
14
15
|
commandAction(logger, args, cb) {
|
|
15
16
|
let group;
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
headers: {
|
|
19
|
-
accept: 'application/json;odata.metadata=none'
|
|
20
|
-
},
|
|
21
|
-
responseType: 'json'
|
|
22
|
-
};
|
|
23
|
-
request_1.default
|
|
24
|
-
.get(requestOptions)
|
|
17
|
+
aadGroup_1.aadGroup
|
|
18
|
+
.getGroupById(args.options.id)
|
|
25
19
|
.then((res) => {
|
|
26
20
|
group = res;
|
|
27
21
|
if (args.options.includeSiteUrl) {
|
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
const Auth_1 = require("../../../../Auth");
|
|
4
4
|
const request_1 = require("../../../../request");
|
|
5
5
|
const utils_1 = require("../../../../utils");
|
|
6
|
+
const aadGroup_1 = require("../../../../utils/aadGroup");
|
|
6
7
|
const planner_1 = require("../../../../utils/planner");
|
|
7
8
|
const GraphCommand_1 = require("../../../base/GraphCommand");
|
|
8
9
|
const commands_1 = require("../../commands");
|
|
@@ -65,22 +66,9 @@ class PlannerBucketAddCommand extends GraphCommand_1.default {
|
|
|
65
66
|
if (args.options.ownerGroupId) {
|
|
66
67
|
return Promise.resolve(args.options.ownerGroupId);
|
|
67
68
|
}
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
accept: 'application/json;odata.metadata=none'
|
|
72
|
-
},
|
|
73
|
-
responseType: 'json'
|
|
74
|
-
};
|
|
75
|
-
return request_1.default
|
|
76
|
-
.get(requestOptions)
|
|
77
|
-
.then(response => {
|
|
78
|
-
const group = response.value[0];
|
|
79
|
-
if (!group) {
|
|
80
|
-
return Promise.reject(`The specified owner group does not exist`);
|
|
81
|
-
}
|
|
82
|
-
return Promise.resolve(group.id);
|
|
83
|
-
});
|
|
69
|
+
return aadGroup_1.aadGroup
|
|
70
|
+
.getGroupByDisplayName(args.options.ownerGroupName)
|
|
71
|
+
.then(group => group.id);
|
|
84
72
|
}
|
|
85
73
|
options() {
|
|
86
74
|
const options = [
|
|
@@ -15,6 +15,7 @@ const GraphCommand_1 = require("../../../base/GraphCommand");
|
|
|
15
15
|
const commands_1 = require("../../commands");
|
|
16
16
|
const Auth_1 = require("../../../../Auth");
|
|
17
17
|
const planner_1 = require("../../../../utils/planner");
|
|
18
|
+
const aadGroup_1 = require("../../../../utils/aadGroup");
|
|
18
19
|
class PlannerBucketGetCommand extends GraphCommand_1.default {
|
|
19
20
|
get name() {
|
|
20
21
|
return commands_1.default.BUCKET_GET;
|
|
@@ -100,24 +101,9 @@ class PlannerBucketGetCommand extends GraphCommand_1.default {
|
|
|
100
101
|
if (ownerGroupId) {
|
|
101
102
|
return Promise.resolve(ownerGroupId);
|
|
102
103
|
}
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
accept: 'application/json;odata.metadata=none'
|
|
107
|
-
},
|
|
108
|
-
responseType: 'json'
|
|
109
|
-
};
|
|
110
|
-
return request_1.default
|
|
111
|
-
.get(requestOptions)
|
|
112
|
-
.then(response => {
|
|
113
|
-
if (!response.value.length) {
|
|
114
|
-
return Promise.reject(`The specified owner group ${ownerGroupName} does not exist`);
|
|
115
|
-
}
|
|
116
|
-
if (response.value.length > 1) {
|
|
117
|
-
return Promise.reject(`Multiple owner groups with name ${ownerGroupName} found: ${response.value.map(x => x.id)}`);
|
|
118
|
-
}
|
|
119
|
-
return Promise.resolve(response.value[0].id);
|
|
120
|
-
});
|
|
104
|
+
return aadGroup_1.aadGroup
|
|
105
|
+
.getGroupByDisplayName(ownerGroupName)
|
|
106
|
+
.then(group => group.id);
|
|
121
107
|
}
|
|
122
108
|
options() {
|
|
123
109
|
const options = [
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const utils_1 = require("../../../../utils");
|
|
4
|
-
const request_1 = require("../../../../request");
|
|
5
4
|
const planner_1 = require("../../../../utils/planner");
|
|
6
5
|
const Auth_1 = require("../../../../Auth");
|
|
7
6
|
const GraphCommand_1 = require("../../../base/GraphCommand");
|
|
8
7
|
const commands_1 = require("../../commands");
|
|
8
|
+
const aadGroup_1 = require("../../../../utils/aadGroup");
|
|
9
9
|
class PlannerBucketListCommand extends GraphCommand_1.default {
|
|
10
10
|
get name() {
|
|
11
11
|
return commands_1.default.BUCKET_LIST;
|
|
@@ -50,22 +50,9 @@ class PlannerBucketListCommand extends GraphCommand_1.default {
|
|
|
50
50
|
if (args.options.ownerGroupId) {
|
|
51
51
|
return Promise.resolve(args.options.ownerGroupId);
|
|
52
52
|
}
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
accept: 'application/json;odata.metadata=none'
|
|
57
|
-
},
|
|
58
|
-
responseType: 'json'
|
|
59
|
-
};
|
|
60
|
-
return request_1.default
|
|
61
|
-
.get(requestOptions)
|
|
62
|
-
.then(response => {
|
|
63
|
-
const group = response.value[0];
|
|
64
|
-
if (!group) {
|
|
65
|
-
return Promise.reject(`The specified owner group does not exist`);
|
|
66
|
-
}
|
|
67
|
-
return Promise.resolve(group.id);
|
|
68
|
-
});
|
|
53
|
+
return aadGroup_1.aadGroup
|
|
54
|
+
.getGroupByDisplayName(args.options.ownerGroupName)
|
|
55
|
+
.then(group => group.id);
|
|
69
56
|
}
|
|
70
57
|
options() {
|
|
71
58
|
const options = [
|
|
@@ -7,6 +7,7 @@ const GraphCommand_1 = require("../../../base/GraphCommand");
|
|
|
7
7
|
const commands_1 = require("../../commands");
|
|
8
8
|
const planner_1 = require("../../../../utils/planner");
|
|
9
9
|
const Auth_1 = require("../../../../Auth");
|
|
10
|
+
const aadGroup_1 = require("../../../../utils/aadGroup");
|
|
10
11
|
class PlannerBucketRemoveCommand extends GraphCommand_1.default {
|
|
11
12
|
get name() {
|
|
12
13
|
return commands_1.default.BUCKET_REMOVE;
|
|
@@ -114,24 +115,9 @@ class PlannerBucketRemoveCommand extends GraphCommand_1.default {
|
|
|
114
115
|
if (ownerGroupId) {
|
|
115
116
|
return Promise.resolve(ownerGroupId);
|
|
116
117
|
}
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
accept: 'application/json;odata.metadata=none'
|
|
121
|
-
},
|
|
122
|
-
responseType: 'json'
|
|
123
|
-
};
|
|
124
|
-
return request_1.default
|
|
125
|
-
.get(requestOptions)
|
|
126
|
-
.then(response => {
|
|
127
|
-
if (!response.value.length) {
|
|
128
|
-
return Promise.reject(`The specified owner group ${ownerGroupName} does not exist`);
|
|
129
|
-
}
|
|
130
|
-
if (response.value.length > 1) {
|
|
131
|
-
return Promise.reject(`Multiple owner groups with name ${ownerGroupName} found: ${response.value.map(x => x.id)}`);
|
|
132
|
-
}
|
|
133
|
-
return Promise.resolve(response.value[0].id);
|
|
134
|
-
});
|
|
118
|
+
return aadGroup_1.aadGroup
|
|
119
|
+
.getGroupByDisplayName(ownerGroupName)
|
|
120
|
+
.then(group => group.id);
|
|
135
121
|
}
|
|
136
122
|
options() {
|
|
137
123
|
const options = [
|
|
@@ -6,6 +6,7 @@ const Auth_1 = require("../../../../Auth");
|
|
|
6
6
|
const request_1 = require("../../../../request");
|
|
7
7
|
const planner_1 = require("../../../../utils/planner");
|
|
8
8
|
const commands_1 = require("../../commands");
|
|
9
|
+
const aadGroup_1 = require("../../../../utils/aadGroup");
|
|
9
10
|
class PlannerBucketSetCommand extends GraphCommand_1.default {
|
|
10
11
|
get name() {
|
|
11
12
|
return commands_1.default.BUCKET_SET;
|
|
@@ -102,24 +103,9 @@ class PlannerBucketSetCommand extends GraphCommand_1.default {
|
|
|
102
103
|
if (ownerGroupId) {
|
|
103
104
|
return Promise.resolve(ownerGroupId);
|
|
104
105
|
}
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
accept: 'application/json;odata.metadata=none'
|
|
109
|
-
},
|
|
110
|
-
responseType: 'json'
|
|
111
|
-
};
|
|
112
|
-
return request_1.default
|
|
113
|
-
.get(requestOptions)
|
|
114
|
-
.then(response => {
|
|
115
|
-
if (response.value.length === 0) {
|
|
116
|
-
return Promise.reject(`The specified owner group ${ownerGroupName} does not exist`);
|
|
117
|
-
}
|
|
118
|
-
if (response.value.length > 1) {
|
|
119
|
-
return Promise.reject(`Multiple owner groups with name ${ownerGroupName} found: ${response.value.map(x => x.id)}`);
|
|
120
|
-
}
|
|
121
|
-
return Promise.resolve(response.value[0].id);
|
|
122
|
-
});
|
|
106
|
+
return aadGroup_1.aadGroup
|
|
107
|
+
.getGroupByDisplayName(ownerGroupName)
|
|
108
|
+
.then(group => group.id);
|
|
123
109
|
}
|
|
124
110
|
options() {
|
|
125
111
|
const options = [
|
|
@@ -5,6 +5,7 @@ const Auth_1 = require("../../../../Auth");
|
|
|
5
5
|
const request_1 = require("../../../../request");
|
|
6
6
|
const GraphCommand_1 = require("../../../base/GraphCommand");
|
|
7
7
|
const commands_1 = require("../../commands");
|
|
8
|
+
const aadGroup_1 = require("../../../../utils/aadGroup");
|
|
8
9
|
class PlannerPlanAddCommand extends GraphCommand_1.default {
|
|
9
10
|
get name() {
|
|
10
11
|
return commands_1.default.PLAN_ADD;
|
|
@@ -51,22 +52,9 @@ class PlannerPlanAddCommand extends GraphCommand_1.default {
|
|
|
51
52
|
if (args.options.ownerGroupId) {
|
|
52
53
|
return Promise.resolve(args.options.ownerGroupId);
|
|
53
54
|
}
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
accept: 'application/json;odata.metadata=none'
|
|
58
|
-
},
|
|
59
|
-
responseType: 'json'
|
|
60
|
-
};
|
|
61
|
-
return request_1.default
|
|
62
|
-
.get(requestOptions)
|
|
63
|
-
.then(response => {
|
|
64
|
-
const group = response.value[0];
|
|
65
|
-
if (!group) {
|
|
66
|
-
return Promise.reject(`The specified owner group does not exist`);
|
|
67
|
-
}
|
|
68
|
-
return Promise.resolve(group.id);
|
|
69
|
-
});
|
|
55
|
+
return aadGroup_1.aadGroup
|
|
56
|
+
.getGroupByDisplayName(args.options.ownerGroupName)
|
|
57
|
+
.then(group => group.id);
|
|
70
58
|
}
|
|
71
59
|
options() {
|
|
72
60
|
const options = [
|
|
@@ -6,6 +6,7 @@ const request_1 = require("../../../../request");
|
|
|
6
6
|
const planner_1 = require("../../../../utils/planner");
|
|
7
7
|
const GraphCommand_1 = require("../../../base/GraphCommand");
|
|
8
8
|
const commands_1 = require("../../commands");
|
|
9
|
+
const aadGroup_1 = require("../../../../utils/aadGroup");
|
|
9
10
|
class PlannerPlanDetailsGetCommand extends GraphCommand_1.default {
|
|
10
11
|
constructor() {
|
|
11
12
|
super(...arguments);
|
|
@@ -52,25 +53,9 @@ class PlannerPlanDetailsGetCommand extends GraphCommand_1.default {
|
|
|
52
53
|
if (args.options.ownerGroupId) {
|
|
53
54
|
return Promise.resolve(args.options.ownerGroupId);
|
|
54
55
|
}
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
accept: 'application/json;odata.metadata=none'
|
|
59
|
-
},
|
|
60
|
-
responseType: 'json'
|
|
61
|
-
};
|
|
62
|
-
return request_1.default
|
|
63
|
-
.get(requestOptions)
|
|
64
|
-
.then(response => {
|
|
65
|
-
const groupItem = response.value[0];
|
|
66
|
-
if (!groupItem) {
|
|
67
|
-
return Promise.reject(`The specified ownerGroup does not exist`);
|
|
68
|
-
}
|
|
69
|
-
if (response.value.length > 1) {
|
|
70
|
-
return Promise.reject(`Multiple ownerGroups with name ${args.options.ownerGroupName} found: Please choose between the following IDs ${response.value.map(x => x.id)}`);
|
|
71
|
-
}
|
|
72
|
-
return Promise.resolve(groupItem.id);
|
|
73
|
-
});
|
|
56
|
+
return aadGroup_1.aadGroup
|
|
57
|
+
.getGroupByDisplayName(args.options.ownerGroupName)
|
|
58
|
+
.then(group => group.id);
|
|
74
59
|
}
|
|
75
60
|
getPlanId(args) {
|
|
76
61
|
if (args.options.planId) {
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const utils_1 = require("../../../../utils");
|
|
4
|
-
const request_1 = require("../../../../request");
|
|
5
4
|
const planner_1 = require("../../../../utils/planner");
|
|
6
5
|
const GraphCommand_1 = require("../../../base/GraphCommand");
|
|
7
6
|
const commands_1 = require("../../commands");
|
|
8
7
|
const Auth_1 = require("../../../../Auth");
|
|
8
|
+
const aadGroup_1 = require("../../../../utils/aadGroup");
|
|
9
9
|
class PlannerPlanGetCommand extends GraphCommand_1.default {
|
|
10
10
|
get name() {
|
|
11
11
|
return commands_1.default.PLAN_GET;
|
|
@@ -53,22 +53,9 @@ class PlannerPlanGetCommand extends GraphCommand_1.default {
|
|
|
53
53
|
if (args.options.ownerGroupId) {
|
|
54
54
|
return Promise.resolve(args.options.ownerGroupId);
|
|
55
55
|
}
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
accept: 'application/json;odata.metadata=none'
|
|
60
|
-
},
|
|
61
|
-
responseType: 'json'
|
|
62
|
-
};
|
|
63
|
-
return request_1.default
|
|
64
|
-
.get(requestOptions)
|
|
65
|
-
.then(response => {
|
|
66
|
-
const group = response.value[0];
|
|
67
|
-
if (!group) {
|
|
68
|
-
return Promise.reject(`The specified owner group does not exist`);
|
|
69
|
-
}
|
|
70
|
-
return Promise.resolve(group.id);
|
|
71
|
-
});
|
|
56
|
+
return aadGroup_1.aadGroup
|
|
57
|
+
.getGroupByDisplayName(args.options.ownerGroupName)
|
|
58
|
+
.then(group => group.id);
|
|
72
59
|
}
|
|
73
60
|
options() {
|
|
74
61
|
const options = [
|
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const utils_1 = require("../../../../utils");
|
|
4
4
|
const Auth_1 = require("../../../../Auth");
|
|
5
|
-
const request_1 = require("../../../../request");
|
|
6
5
|
const planner_1 = require("../../../../utils/planner");
|
|
7
6
|
const GraphCommand_1 = require("../../../base/GraphCommand");
|
|
8
7
|
const commands_1 = require("../../commands");
|
|
8
|
+
const aadGroup_1 = require("../../../../utils/aadGroup");
|
|
9
9
|
class PlannerPlanListCommand extends GraphCommand_1.default {
|
|
10
10
|
get name() {
|
|
11
11
|
return commands_1.default.PLAN_LIST;
|
|
@@ -41,22 +41,9 @@ class PlannerPlanListCommand extends GraphCommand_1.default {
|
|
|
41
41
|
if (args.options.ownerGroupId) {
|
|
42
42
|
return Promise.resolve(args.options.ownerGroupId);
|
|
43
43
|
}
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
accept: 'application/json;odata.metadata=none'
|
|
48
|
-
},
|
|
49
|
-
responseType: 'json'
|
|
50
|
-
};
|
|
51
|
-
return request_1.default
|
|
52
|
-
.get(requestOptions)
|
|
53
|
-
.then(response => {
|
|
54
|
-
const group = response.value[0];
|
|
55
|
-
if (!group) {
|
|
56
|
-
return Promise.reject(`The specified owner group does not exist`);
|
|
57
|
-
}
|
|
58
|
-
return Promise.resolve(group.id);
|
|
59
|
-
});
|
|
44
|
+
return aadGroup_1.aadGroup
|
|
45
|
+
.getGroupByDisplayName(args.options.ownerGroupName)
|
|
46
|
+
.then(group => group.id);
|
|
60
47
|
}
|
|
61
48
|
options() {
|
|
62
49
|
const options = [
|
|
@@ -6,6 +6,7 @@ const planner_1 = require("../../../../utils/planner");
|
|
|
6
6
|
const utils_1 = require("../../../../utils");
|
|
7
7
|
const GraphCommand_1 = require("../../../base/GraphCommand");
|
|
8
8
|
const commands_1 = require("../../commands");
|
|
9
|
+
const aadGroup_1 = require("../../../../utils/aadGroup");
|
|
9
10
|
class PlannerTaskAddCommand extends GraphCommand_1.default {
|
|
10
11
|
get name() {
|
|
11
12
|
return commands_1.default.TASK_ADD;
|
|
@@ -164,22 +165,9 @@ class PlannerTaskAddCommand extends GraphCommand_1.default {
|
|
|
164
165
|
if (args.options.ownerGroupId) {
|
|
165
166
|
return Promise.resolve(args.options.ownerGroupId);
|
|
166
167
|
}
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
accept: 'application/json;odata.metadata=none'
|
|
171
|
-
},
|
|
172
|
-
responseType: 'json'
|
|
173
|
-
};
|
|
174
|
-
return request_1.default
|
|
175
|
-
.get(requestOptions)
|
|
176
|
-
.then(response => {
|
|
177
|
-
const group = response.value[0];
|
|
178
|
-
if (!group) {
|
|
179
|
-
return Promise.reject(`The specified owner group does not exist`);
|
|
180
|
-
}
|
|
181
|
-
return Promise.resolve(group.id);
|
|
182
|
-
});
|
|
168
|
+
return aadGroup_1.aadGroup
|
|
169
|
+
.getGroupByDisplayName(args.options.ownerGroupName)
|
|
170
|
+
.then(group => group.id);
|
|
183
171
|
}
|
|
184
172
|
getUserIds(options) {
|
|
185
173
|
if (options.assignedToUserIds) {
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const accessToken_1 = require("../../../../utils/accessToken");
|
|
4
|
+
const uuid_1 = require("uuid");
|
|
5
|
+
const Auth_1 = require("../../../../Auth");
|
|
6
|
+
const GraphCommand_1 = require("../../../base/GraphCommand");
|
|
7
|
+
const commands_1 = require("../../commands");
|
|
8
|
+
const request_1 = require("../../../../request");
|
|
9
|
+
class PlannerTaskChecklistItemAddCommand extends GraphCommand_1.default {
|
|
10
|
+
get name() {
|
|
11
|
+
return commands_1.default.TASK_CHECKLISTITEM_ADD;
|
|
12
|
+
}
|
|
13
|
+
get description() {
|
|
14
|
+
return 'Adds a new checklist item to a Planner task.';
|
|
15
|
+
}
|
|
16
|
+
getTelemetryProperties(args) {
|
|
17
|
+
const telemetryProps = super.getTelemetryProperties(args);
|
|
18
|
+
telemetryProps.isChecked = args.options.isChecked || false;
|
|
19
|
+
return telemetryProps;
|
|
20
|
+
}
|
|
21
|
+
defaultProperties() {
|
|
22
|
+
return ['id', 'title', 'isChecked'];
|
|
23
|
+
}
|
|
24
|
+
commandAction(logger, args, cb) {
|
|
25
|
+
if (accessToken_1.accessToken.isAppOnlyAccessToken(Auth_1.default.service.accessTokens[this.resource].accessToken)) {
|
|
26
|
+
this.handleError('This command does not support application permissions.', logger, cb);
|
|
27
|
+
return;
|
|
28
|
+
}
|
|
29
|
+
this
|
|
30
|
+
.getTaskDetailsEtag(args.options.taskId)
|
|
31
|
+
.then(etag => {
|
|
32
|
+
const body = {
|
|
33
|
+
checklist: {
|
|
34
|
+
// Generate new GUID for new task checklist item
|
|
35
|
+
[(0, uuid_1.v4)()]: {
|
|
36
|
+
'@odata.type': 'microsoft.graph.plannerChecklistItem',
|
|
37
|
+
title: args.options.title,
|
|
38
|
+
isChecked: args.options.isChecked || false
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
const requestOptions = {
|
|
43
|
+
url: `${this.resource}/v1.0/planner/tasks/${encodeURIComponent(args.options.taskId)}/details`,
|
|
44
|
+
headers: {
|
|
45
|
+
accept: 'application/json;odata.metadata=none',
|
|
46
|
+
prefer: 'return=representation',
|
|
47
|
+
'if-match': etag
|
|
48
|
+
},
|
|
49
|
+
responseType: 'json',
|
|
50
|
+
data: body
|
|
51
|
+
};
|
|
52
|
+
return request_1.default.patch(requestOptions);
|
|
53
|
+
})
|
|
54
|
+
.then((result) => {
|
|
55
|
+
if (args.options.output === 'json') {
|
|
56
|
+
logger.log(result.checklist);
|
|
57
|
+
}
|
|
58
|
+
else {
|
|
59
|
+
// Transform checklist item object to text friendly format
|
|
60
|
+
const output = Object.getOwnPropertyNames(result.checklist).map(prop => (Object.assign({ id: prop }, result.checklist[prop])));
|
|
61
|
+
logger.log(output);
|
|
62
|
+
}
|
|
63
|
+
cb();
|
|
64
|
+
}, (err) => this.handleRejectedODataJsonPromise(err, logger, cb));
|
|
65
|
+
}
|
|
66
|
+
getTaskDetailsEtag(taskId) {
|
|
67
|
+
const requestOptions = {
|
|
68
|
+
url: `${this.resource}/v1.0/planner/tasks/${encodeURIComponent(taskId)}/details`,
|
|
69
|
+
headers: {
|
|
70
|
+
accept: 'application/json;odata.metadata=minimal'
|
|
71
|
+
},
|
|
72
|
+
responseType: 'json'
|
|
73
|
+
};
|
|
74
|
+
return request_1.default
|
|
75
|
+
.get(requestOptions)
|
|
76
|
+
.then((task) => task['@odata.etag'], () => Promise.reject('Planner task was not found.'));
|
|
77
|
+
}
|
|
78
|
+
options() {
|
|
79
|
+
const options = [
|
|
80
|
+
{ option: '-i, --taskId <taskId>' },
|
|
81
|
+
{ option: '-t, --title <title>' },
|
|
82
|
+
{ option: '--isChecked' }
|
|
83
|
+
];
|
|
84
|
+
const parentOptions = super.options();
|
|
85
|
+
return options.concat(parentOptions);
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
module.exports = new PlannerTaskChecklistItemAddCommand();
|
|
89
|
+
//# sourceMappingURL=task-checklistitem-add.js.map
|
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
const Auth_1 = require("../../../../Auth");
|
|
4
4
|
const request_1 = require("../../../../request");
|
|
5
5
|
const utils_1 = require("../../../../utils");
|
|
6
|
+
const aadGroup_1 = require("../../../../utils/aadGroup");
|
|
6
7
|
const planner_1 = require("../../../../utils/planner");
|
|
7
8
|
const GraphCommand_1 = require("../../../base/GraphCommand");
|
|
8
9
|
const commands_1 = require("../../commands");
|
|
@@ -116,25 +117,9 @@ class PlannerTaskGetCommand extends GraphCommand_1.default {
|
|
|
116
117
|
if (options.ownerGroupId) {
|
|
117
118
|
return Promise.resolve(options.ownerGroupId);
|
|
118
119
|
}
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
accept: 'application/json;odata.metadata=none'
|
|
123
|
-
},
|
|
124
|
-
responseType: 'json'
|
|
125
|
-
};
|
|
126
|
-
return request_1.default
|
|
127
|
-
.get(requestOptions)
|
|
128
|
-
.then(response => {
|
|
129
|
-
const groups = response.value;
|
|
130
|
-
if (!groups.length) {
|
|
131
|
-
return Promise.reject(`The specified ownerGroup ${options.ownerGroupName} does not exist`);
|
|
132
|
-
}
|
|
133
|
-
if (groups.length > 1) {
|
|
134
|
-
return Promise.reject(`Multiple ownerGroups with name ${options.ownerGroupName} found: ${groups.map(x => x.id)}`);
|
|
135
|
-
}
|
|
136
|
-
return Promise.resolve(groups[0].id);
|
|
137
|
-
});
|
|
120
|
+
return aadGroup_1.aadGroup
|
|
121
|
+
.getGroupByDisplayName(options.ownerGroupName)
|
|
122
|
+
.then(group => group.id);
|
|
138
123
|
}
|
|
139
124
|
optionSets() {
|
|
140
125
|
return [
|
|
@@ -6,6 +6,7 @@ const request_1 = require("../../../../request");
|
|
|
6
6
|
const planner_1 = require("../../../../utils/planner");
|
|
7
7
|
const GraphCommand_1 = require("../../../base/GraphCommand");
|
|
8
8
|
const commands_1 = require("../../commands");
|
|
9
|
+
const aadGroup_1 = require("../../../../utils/aadGroup");
|
|
9
10
|
class PlannerTaskListCommand extends GraphCommand_1.default {
|
|
10
11
|
get name() {
|
|
11
12
|
return commands_1.default.TASK_LIST;
|
|
@@ -118,22 +119,9 @@ class PlannerTaskListCommand extends GraphCommand_1.default {
|
|
|
118
119
|
if (args.options.ownerGroupId) {
|
|
119
120
|
return Promise.resolve(encodeURIComponent(args.options.ownerGroupId));
|
|
120
121
|
}
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
accept: 'application/json;odata.metadata=none'
|
|
125
|
-
},
|
|
126
|
-
responseType: 'json'
|
|
127
|
-
};
|
|
128
|
-
return request_1.default
|
|
129
|
-
.get(requestOptions)
|
|
130
|
-
.then(response => {
|
|
131
|
-
const group = response.value[0];
|
|
132
|
-
if (!group) {
|
|
133
|
-
return Promise.reject(`The specified owner group does not exist`);
|
|
134
|
-
}
|
|
135
|
-
return Promise.resolve(group.id);
|
|
136
|
-
});
|
|
122
|
+
return aadGroup_1.aadGroup
|
|
123
|
+
.getGroupByDisplayName(args.options.ownerGroupName)
|
|
124
|
+
.then(group => group.id);
|
|
137
125
|
}
|
|
138
126
|
mergeTaskPriority(taskItems, betaTaskItems) {
|
|
139
127
|
const findBetaTask = (id) => betaTaskItems.find(task => task.id === id);
|
|
@@ -6,6 +6,7 @@ const request_1 = require("../../../../request");
|
|
|
6
6
|
const planner_1 = require("../../../../utils/planner");
|
|
7
7
|
const GraphCommand_1 = require("../../../base/GraphCommand");
|
|
8
8
|
const commands_1 = require("../../commands");
|
|
9
|
+
const aadGroup_1 = require("../../../../utils/aadGroup");
|
|
9
10
|
class PlannerTaskSetCommand extends GraphCommand_1.default {
|
|
10
11
|
constructor() {
|
|
11
12
|
super(...arguments);
|
|
@@ -230,22 +231,9 @@ class PlannerTaskSetCommand extends GraphCommand_1.default {
|
|
|
230
231
|
if (options.ownerGroupId) {
|
|
231
232
|
return Promise.resolve(options.ownerGroupId);
|
|
232
233
|
}
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
accept: 'application/json;odata.metadata=none'
|
|
237
|
-
},
|
|
238
|
-
responseType: 'json'
|
|
239
|
-
};
|
|
240
|
-
return request_1.default
|
|
241
|
-
.get(requestOptions)
|
|
242
|
-
.then(response => {
|
|
243
|
-
const group = response.value[0];
|
|
244
|
-
if (!group) {
|
|
245
|
-
return Promise.reject(`The specified owner group does not exist`);
|
|
246
|
-
}
|
|
247
|
-
return Promise.resolve(group.id);
|
|
248
|
-
});
|
|
234
|
+
return aadGroup_1.aadGroup
|
|
235
|
+
.getGroupByDisplayName(options.ownerGroupName)
|
|
236
|
+
.then(group => group.id);
|
|
249
237
|
}
|
|
250
238
|
mapRequestBody(options, appliedCategories) {
|
|
251
239
|
const requestBody = {};
|
|
@@ -12,6 +12,7 @@ exports.default = {
|
|
|
12
12
|
PLAN_GET: `${prefix} plan get`,
|
|
13
13
|
PLAN_LIST: `${prefix} plan list`,
|
|
14
14
|
TASK_ADD: `${prefix} task add`,
|
|
15
|
+
TASK_CHECKLISTITEM_ADD: `${prefix} task checklistitem add`,
|
|
15
16
|
TASK_DETAILS_GET: `${prefix} task details get`,
|
|
16
17
|
TASK_GET: `${prefix} task get`,
|
|
17
18
|
TASK_LIST: `${prefix} task list`,
|