@pnp/cli-microsoft365 5.3.0-beta.24cd8e4 → 5.3.0-beta.4033f50
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/m365/aad/commands/app/app-add.js +1 -1
- package/dist/m365/aad/commands/app/app-role-list.js +1 -1
- package/dist/m365/aad/commands/group/group-list.js +1 -1
- package/dist/m365/aad/commands/groupsetting/groupsetting-list.js +1 -1
- package/dist/m365/aad/commands/groupsettingtemplate/groupsettingtemplate-get.js +1 -1
- package/dist/m365/aad/commands/groupsettingtemplate/groupsettingtemplate-list.js +1 -1
- package/dist/m365/aad/commands/o365group/o365group-conversation-list.js +1 -1
- package/dist/m365/aad/commands/o365group/o365group-conversation-post-list.js +1 -1
- package/dist/m365/aad/commands/o365group/o365group-list.js +1 -1
- package/dist/m365/aad/commands/o365group/o365group-recyclebinitem-clear.js +3 -3
- package/dist/m365/aad/commands/o365group/o365group-recyclebinitem-list.js +1 -1
- package/dist/m365/aad/commands/o365group/o365group-user-list.js +2 -2
- package/dist/m365/aad/commands/o365group/o365group-user-set.js +2 -2
- package/dist/m365/aad/commands/user/user-list.js +1 -1
- package/dist/m365/aad/commands/user/user-signin-list.js +1 -1
- package/dist/m365/file/commands/file-list.js +1 -1
- package/dist/m365/outlook/commands/message/message-list.js +1 -1
- package/dist/m365/outlook/commands/room/room-list.js +1 -1
- package/dist/m365/outlook/commands/roomlist/roomlist-list.js +1 -1
- package/dist/m365/planner/commands/bucket/bucket-add.js +3 -16
- package/dist/m365/planner/commands/bucket/bucket-get.js +3 -20
- package/dist/m365/planner/commands/bucket/bucket-list.js +4 -18
- package/dist/m365/planner/commands/bucket/bucket-remove.js +3 -20
- package/dist/m365/planner/commands/bucket/bucket-set.js +3 -20
- package/dist/m365/planner/commands/plan/plan-details-get.js +6 -14
- package/dist/m365/planner/commands/plan/plan-get.js +8 -18
- package/dist/m365/planner/commands/plan/plan-list.js +4 -12
- package/dist/m365/planner/commands/task/task-add.js +3 -16
- package/dist/m365/planner/commands/task/task-get.js +3 -21
- package/dist/m365/planner/commands/task/task-list.js +9 -23
- package/dist/m365/planner/commands/task/task-set.js +3 -17
- package/dist/m365/pp/commands/managementapp/managementapp-list.js +1 -1
- package/dist/m365/teams/commands/app/app-list.js +1 -1
- package/dist/m365/teams/commands/channel/channel-list.js +1 -1
- package/dist/m365/teams/commands/channel/channel-member-list.js +1 -1
- package/dist/m365/teams/commands/chat/chat-get.js +8 -8
- package/dist/m365/teams/commands/chat/chat-list.js +1 -1
- package/dist/m365/teams/commands/chat/chat-member-list.js +1 -1
- package/dist/m365/teams/commands/chat/chat-message-list.js +1 -1
- package/dist/m365/teams/commands/chat/chat-message-send.js +6 -6
- package/dist/m365/teams/commands/chat/chatUtil.js +4 -4
- package/dist/m365/teams/commands/message/message-list.js +1 -1
- package/dist/m365/teams/commands/message/message-reply-list.js +1 -1
- package/dist/m365/teams/commands/tab/tab-list.js +1 -1
- package/dist/m365/teams/commands/team/team-list.js +1 -1
- package/dist/m365/teams/commands/user/user-app-list.js +1 -1
- package/dist/m365/teams/commands/user/user-list.js +2 -2
- package/dist/m365/tenant/commands/serviceannouncement/serviceannouncement-healthissue-list.js +1 -1
- package/dist/m365/tenant/commands/serviceannouncement/serviceannouncement-message-list.js +1 -1
- package/dist/m365/todo/commands/list/list-list.js +1 -1
- package/dist/m365/todo/commands/task/task-list.js +1 -1
- package/dist/utils/odata.js +2 -2
- package/dist/utils/planner.js +65 -0
- package/package.json +1 -1
|
@@ -325,7 +325,7 @@ class AadAppAddCommand extends GraphCommand_1.default {
|
|
|
325
325
|
logger.logToStderr('Resolving requested APIs...');
|
|
326
326
|
}
|
|
327
327
|
return utils_1.odata
|
|
328
|
-
.getAllItems(`${this.resource}/v1.0/myorganization/servicePrincipals?$select=servicePrincipalNames,appId,oauth2PermissionScopes,appRoles
|
|
328
|
+
.getAllItems(`${this.resource}/v1.0/myorganization/servicePrincipals?$select=servicePrincipalNames,appId,oauth2PermissionScopes,appRoles`)
|
|
329
329
|
.then(servicePrincipals => {
|
|
330
330
|
try {
|
|
331
331
|
const resolvedApis = this.getRequiredResourceAccessForApis(servicePrincipals, args.options.apisDelegated, 'Scope', logger);
|
|
@@ -24,7 +24,7 @@ class AadAppRoleListCommand extends GraphCommand_1.default {
|
|
|
24
24
|
commandAction(logger, args, cb) {
|
|
25
25
|
this
|
|
26
26
|
.getAppObjectId(args, logger)
|
|
27
|
-
.then(objectId => utils_1.odata.getAllItems(`${this.resource}/v1.0/myorganization/applications/${objectId}/appRoles
|
|
27
|
+
.then(objectId => utils_1.odata.getAllItems(`${this.resource}/v1.0/myorganization/applications/${objectId}/appRoles`))
|
|
28
28
|
.then(appRoles => {
|
|
29
29
|
logger.log(appRoles);
|
|
30
30
|
cb();
|
|
@@ -21,7 +21,7 @@ class AadGroupListCommand extends GraphCommand_1.default {
|
|
|
21
21
|
commandAction(logger, args, cb) {
|
|
22
22
|
const endpoint = args.options.deleted ? 'directory/deletedItems/microsoft.graph.group' : 'groups';
|
|
23
23
|
utils_1.odata
|
|
24
|
-
.getAllItems(`${this.resource}/v1.0/${endpoint}
|
|
24
|
+
.getAllItems(`${this.resource}/v1.0/${endpoint}`)
|
|
25
25
|
.then((groups) => {
|
|
26
26
|
if (args.options.output === 'text') {
|
|
27
27
|
groups.forEach((group) => {
|
|
@@ -15,7 +15,7 @@ class AadGroupSettingListCommand extends GraphCommand_1.default {
|
|
|
15
15
|
}
|
|
16
16
|
commandAction(logger, args, cb) {
|
|
17
17
|
utils_1.odata
|
|
18
|
-
.getAllItems(`${this.resource}/v1.0/groupSettings
|
|
18
|
+
.getAllItems(`${this.resource}/v1.0/groupSettings`)
|
|
19
19
|
.then((groupSettings) => {
|
|
20
20
|
logger.log(groupSettings);
|
|
21
21
|
cb();
|
|
@@ -19,7 +19,7 @@ class AadGroupSettingTemplateGetCommand extends GraphCommand_1.default {
|
|
|
19
19
|
}
|
|
20
20
|
commandAction(logger, args, cb) {
|
|
21
21
|
utils_1.odata
|
|
22
|
-
.getAllItems(`${this.resource}/v1.0/groupSettingTemplates
|
|
22
|
+
.getAllItems(`${this.resource}/v1.0/groupSettingTemplates`)
|
|
23
23
|
.then((templates) => {
|
|
24
24
|
const groupSettingTemplate = templates.filter(t => args.options.id ? t.id === args.options.id : t.displayName === args.options.displayName);
|
|
25
25
|
if (groupSettingTemplate && groupSettingTemplate.length > 0) {
|
|
@@ -15,7 +15,7 @@ class AadGroupSettingTemplateListCommand extends GraphCommand_1.default {
|
|
|
15
15
|
}
|
|
16
16
|
commandAction(logger, args, cb) {
|
|
17
17
|
utils_1.odata
|
|
18
|
-
.getAllItems(`${this.resource}/v1.0/groupSettingTemplates
|
|
18
|
+
.getAllItems(`${this.resource}/v1.0/groupSettingTemplates`)
|
|
19
19
|
.then((templates) => {
|
|
20
20
|
logger.log(templates);
|
|
21
21
|
cb();
|
|
@@ -15,7 +15,7 @@ class AadO365GroupConversationListCommand extends GraphCommand_1.default {
|
|
|
15
15
|
}
|
|
16
16
|
commandAction(logger, args, cb) {
|
|
17
17
|
utils_1.odata
|
|
18
|
-
.getAllItems(`${this.resource}/v1.0/groups/${args.options.groupId}/conversations
|
|
18
|
+
.getAllItems(`${this.resource}/v1.0/groups/${args.options.groupId}/conversations`)
|
|
19
19
|
.then((conversations) => {
|
|
20
20
|
logger.log(conversations);
|
|
21
21
|
cb();
|
|
@@ -24,7 +24,7 @@ class AadO365GroupConversationPostListCommand extends GraphCommand_1.default {
|
|
|
24
24
|
this
|
|
25
25
|
.getGroupId(args)
|
|
26
26
|
.then((retrievedgroupId) => {
|
|
27
|
-
return utils_1.odata.getAllItems(`${this.resource}/v1.0/groups/${retrievedgroupId}/threads/${args.options.threadId}/posts
|
|
27
|
+
return utils_1.odata.getAllItems(`${this.resource}/v1.0/groups/${retrievedgroupId}/threads/${args.options.threadId}/posts`);
|
|
28
28
|
})
|
|
29
29
|
.then((posts) => {
|
|
30
30
|
logger.log(posts);
|
|
@@ -19,7 +19,7 @@ class AadO365GroupRecycleBinItemClearCommand extends GraphCommand_1.default {
|
|
|
19
19
|
}
|
|
20
20
|
commandAction(logger, args, cb) {
|
|
21
21
|
const clearO365GroupRecycleBinItems = () => {
|
|
22
|
-
this.processRecycleBinItemsClear(
|
|
22
|
+
this.processRecycleBinItemsClear().then(_ => cb(), (rawRes) => this.handleRejectedODataJsonPromise(rawRes, logger, cb));
|
|
23
23
|
};
|
|
24
24
|
if (args.options.confirm) {
|
|
25
25
|
clearO365GroupRecycleBinItems();
|
|
@@ -40,12 +40,12 @@ class AadO365GroupRecycleBinItemClearCommand extends GraphCommand_1.default {
|
|
|
40
40
|
});
|
|
41
41
|
}
|
|
42
42
|
}
|
|
43
|
-
processRecycleBinItemsClear(
|
|
43
|
+
processRecycleBinItemsClear() {
|
|
44
44
|
const filter = `?$filter=groupTypes/any(c:c+eq+'Unified')`;
|
|
45
45
|
const topCount = '&$top=100';
|
|
46
46
|
const endpoint = `${this.resource}/v1.0/directory/deletedItems/Microsoft.Graph.Group${filter}${topCount}`;
|
|
47
47
|
return utils_1.odata
|
|
48
|
-
.getAllItems(endpoint
|
|
48
|
+
.getAllItems(endpoint)
|
|
49
49
|
.then((recycleBinItems) => {
|
|
50
50
|
if (recycleBinItems.length === 0) {
|
|
51
51
|
return Promise.resolve();
|
|
@@ -26,7 +26,7 @@ class AadO365GroupRecycleBinItemListCommand extends GraphCommand_1.default {
|
|
|
26
26
|
const topCount = '&$top=100';
|
|
27
27
|
const endpoint = `${this.resource}/v1.0/directory/deletedItems/Microsoft.Graph.Group${filter}${displayNameFilter}${mailNicknameFilter}${topCount}`;
|
|
28
28
|
utils_1.odata
|
|
29
|
-
.getAllItems(endpoint
|
|
29
|
+
.getAllItems(endpoint)
|
|
30
30
|
.then((recycleBinItems) => {
|
|
31
31
|
logger.log(recycleBinItems);
|
|
32
32
|
cb();
|
|
@@ -38,7 +38,7 @@ class AadO365GroupUserListCommand extends GraphCommand_1.default {
|
|
|
38
38
|
getOwners(logger, groupId) {
|
|
39
39
|
const endpoint = `${this.resource}/v1.0/groups/${groupId}/owners?$select=id,displayName,userPrincipalName,userType`;
|
|
40
40
|
return utils_1.odata
|
|
41
|
-
.getAllItems(endpoint
|
|
41
|
+
.getAllItems(endpoint)
|
|
42
42
|
.then(users => {
|
|
43
43
|
// Currently there is a bug in the Microsoft Graph that returns Owners as
|
|
44
44
|
// userType 'member'. We therefore update all returned user as owner
|
|
@@ -50,7 +50,7 @@ class AadO365GroupUserListCommand extends GraphCommand_1.default {
|
|
|
50
50
|
}
|
|
51
51
|
getMembersAndGuests(logger, groupId) {
|
|
52
52
|
const endpoint = `${this.resource}/v1.0/groups/${groupId}/members?$select=id,displayName,userPrincipalName,userType`;
|
|
53
|
-
return utils_1.odata.getAllItems(endpoint
|
|
53
|
+
return utils_1.odata.getAllItems(endpoint);
|
|
54
54
|
}
|
|
55
55
|
options() {
|
|
56
56
|
const options = [
|
|
@@ -92,7 +92,7 @@ class AadO365GroupUserSetCommand extends GraphCommand_1.default {
|
|
|
92
92
|
getOwners(logger, groupId) {
|
|
93
93
|
const endpoint = `${this.resource}/v1.0/groups/${groupId}/owners?$select=id,displayName,userPrincipalName,userType`;
|
|
94
94
|
return utils_1.odata
|
|
95
|
-
.getAllItems(endpoint
|
|
95
|
+
.getAllItems(endpoint)
|
|
96
96
|
.then(users => {
|
|
97
97
|
// Currently there is a bug in the Microsoft Graph that returns Owners as
|
|
98
98
|
// userType 'member'. We therefore update all returned user as owner
|
|
@@ -104,7 +104,7 @@ class AadO365GroupUserSetCommand extends GraphCommand_1.default {
|
|
|
104
104
|
}
|
|
105
105
|
getMembersAndGuests(logger, groupId) {
|
|
106
106
|
const endpoint = `${this.resource}/v1.0/groups/${groupId}/members?$select=id,displayName,userPrincipalName,userType`;
|
|
107
|
-
return utils_1.odata.getAllItems(endpoint
|
|
107
|
+
return utils_1.odata.getAllItems(endpoint);
|
|
108
108
|
}
|
|
109
109
|
options() {
|
|
110
110
|
const options = [
|
|
@@ -27,7 +27,7 @@ class AadUserListCommand extends GraphCommand_1.default {
|
|
|
27
27
|
const endpoint = args.options.deleted ? 'directory/deletedItems/microsoft.graph.user' : 'users';
|
|
28
28
|
const url = `${this.resource}/v1.0/${endpoint}?$select=${properties.join(',')}${(filter.length > 0 ? '&' + filter : '')}&$top=100`;
|
|
29
29
|
utils_1.odata
|
|
30
|
-
.getAllItems(url
|
|
30
|
+
.getAllItems(url)
|
|
31
31
|
.then((users) => {
|
|
32
32
|
logger.log(users);
|
|
33
33
|
cb();
|
|
@@ -156,7 +156,7 @@ class FileListCommand extends GraphCommand_1.default {
|
|
|
156
156
|
.all(folderIds.map((folderId) =>
|
|
157
157
|
// get items from folder. Because we can't filter out folders here
|
|
158
158
|
// we need to get all items from the folder and filter them out later
|
|
159
|
-
utils_1.odata.getAllItems(`${this.resource}/v1.0/drives/${driveId}/items/${folderId}/children
|
|
159
|
+
utils_1.odata.getAllItems(`${this.resource}/v1.0/drives/${driveId}/items/${folderId}/children`)))
|
|
160
160
|
.then(res => {
|
|
161
161
|
// flatten data from all promises
|
|
162
162
|
files = files.concat(...res);
|
|
@@ -27,7 +27,7 @@ class OutlookMessageListCommand extends GraphCommand_1.default {
|
|
|
27
27
|
.getFolderId(args)
|
|
28
28
|
.then((folderId) => {
|
|
29
29
|
const url = folderId ? `me/mailFolders/${folderId}/messages` : 'me/messages';
|
|
30
|
-
return utils_1.odata.getAllItems(`${this.resource}/v1.0/${url}?$top=50
|
|
30
|
+
return utils_1.odata.getAllItems(`${this.resource}/v1.0/${url}?$top=50`);
|
|
31
31
|
})
|
|
32
32
|
.then((messages) => {
|
|
33
33
|
logger.log(messages);
|
|
@@ -24,7 +24,7 @@ class OutlookRoomListCommand extends GraphCommand_1.default {
|
|
|
24
24
|
endpoint = `${this.resource}/v1.0/places/${args.options.roomlistEmail}/microsoft.graph.roomlist/rooms`;
|
|
25
25
|
}
|
|
26
26
|
utils_1.odata
|
|
27
|
-
.getAllItems(endpoint
|
|
27
|
+
.getAllItems(endpoint)
|
|
28
28
|
.then((rooms) => {
|
|
29
29
|
logger.log(rooms);
|
|
30
30
|
cb();
|
|
@@ -15,7 +15,7 @@ class OutlookRoomListListCommand extends GraphCommand_1.default {
|
|
|
15
15
|
}
|
|
16
16
|
commandAction(logger, args, cb) {
|
|
17
17
|
utils_1.odata
|
|
18
|
-
.getAllItems(`${this.resource}/v1.0/places/microsoft.graph.roomlist
|
|
18
|
+
.getAllItems(`${this.resource}/v1.0/places/microsoft.graph.roomlist`)
|
|
19
19
|
.then((roomLists) => {
|
|
20
20
|
logger.log(roomLists);
|
|
21
21
|
cb();
|
|
@@ -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 planner_1 = require("../../../../utils/planner");
|
|
6
7
|
const GraphCommand_1 = require("../../../base/GraphCommand");
|
|
7
8
|
const commands_1 = require("../../commands");
|
|
8
9
|
class PlannerBucketAddCommand extends GraphCommand_1.default {
|
|
@@ -57,22 +58,8 @@ class PlannerBucketAddCommand extends GraphCommand_1.default {
|
|
|
57
58
|
}
|
|
58
59
|
return this
|
|
59
60
|
.getGroupId(args)
|
|
60
|
-
.then(
|
|
61
|
-
|
|
62
|
-
url: `${this.resource}/v1.0/planner/plans?$filter=(owner eq '${groupId}')`,
|
|
63
|
-
headers: {
|
|
64
|
-
accept: 'application/json;odata.metadata=none'
|
|
65
|
-
},
|
|
66
|
-
responseType: 'json'
|
|
67
|
-
};
|
|
68
|
-
return request_1.default.get(requestOptions);
|
|
69
|
-
}).then((response) => {
|
|
70
|
-
const plan = response.value.find(val => val.title === args.options.planName);
|
|
71
|
-
if (!plan) {
|
|
72
|
-
return Promise.reject(`The specified plan does not exist`);
|
|
73
|
-
}
|
|
74
|
-
return Promise.resolve(plan.id);
|
|
75
|
-
});
|
|
61
|
+
.then(groupId => planner_1.planner.getPlanByName(args.options.planName, groupId))
|
|
62
|
+
.then(plan => plan.id);
|
|
76
63
|
}
|
|
77
64
|
getGroupId(args) {
|
|
78
65
|
if (args.options.ownerGroupId) {
|
|
@@ -14,6 +14,7 @@ const utils_1 = require("../../../../utils");
|
|
|
14
14
|
const GraphCommand_1 = require("../../../base/GraphCommand");
|
|
15
15
|
const commands_1 = require("../../commands");
|
|
16
16
|
const Auth_1 = require("../../../../Auth");
|
|
17
|
+
const planner_1 = require("../../../../utils/planner");
|
|
17
18
|
class PlannerBucketGetCommand extends GraphCommand_1.default {
|
|
18
19
|
get name() {
|
|
19
20
|
return commands_1.default.BUCKET_GET;
|
|
@@ -79,26 +80,8 @@ class PlannerBucketGetCommand extends GraphCommand_1.default {
|
|
|
79
80
|
}
|
|
80
81
|
return this
|
|
81
82
|
.getGroupId(args)
|
|
82
|
-
.then(groupId =>
|
|
83
|
-
|
|
84
|
-
url: `${this.resource}/v1.0/planner/plans?$filter=owner eq '${groupId}'`,
|
|
85
|
-
headers: {
|
|
86
|
-
accept: 'application/json;odata.metadata=none'
|
|
87
|
-
},
|
|
88
|
-
responseType: 'json'
|
|
89
|
-
};
|
|
90
|
-
return request_1.default.get(requestOptions);
|
|
91
|
-
})
|
|
92
|
-
.then(plans => {
|
|
93
|
-
const filteredPlans = plans.value.filter(p => p.title.toLowerCase() === planName.toLowerCase());
|
|
94
|
-
if (filteredPlans.length === 0) {
|
|
95
|
-
return Promise.reject(`The specified plan ${planName} does not exist`);
|
|
96
|
-
}
|
|
97
|
-
if (filteredPlans.length > 1) {
|
|
98
|
-
return Promise.reject(`Multiple plans with name ${planName} found: ${filteredPlans.map(x => x.id)}`);
|
|
99
|
-
}
|
|
100
|
-
return Promise.resolve(filteredPlans[0].id);
|
|
101
|
-
});
|
|
83
|
+
.then(groupId => planner_1.planner.getPlanByName(planName, groupId))
|
|
84
|
+
.then(plan => plan.id);
|
|
102
85
|
}
|
|
103
86
|
getBucketById(id) {
|
|
104
87
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const utils_1 = require("../../../../utils");
|
|
4
4
|
const request_1 = require("../../../../request");
|
|
5
|
+
const planner_1 = require("../../../../utils/planner");
|
|
5
6
|
const Auth_1 = require("../../../../Auth");
|
|
6
7
|
const GraphCommand_1 = require("../../../base/GraphCommand");
|
|
7
8
|
const commands_1 = require("../../commands");
|
|
@@ -30,7 +31,7 @@ class PlannerBucketListCommand extends GraphCommand_1.default {
|
|
|
30
31
|
}
|
|
31
32
|
this
|
|
32
33
|
.getPlanId(args)
|
|
33
|
-
.then((planId) => utils_1.odata.getAllItems(`${this.resource}/v1.0/planner/plans/${planId}/buckets
|
|
34
|
+
.then((planId) => utils_1.odata.getAllItems(`${this.resource}/v1.0/planner/plans/${planId}/buckets`))
|
|
34
35
|
.then((buckets) => {
|
|
35
36
|
logger.log(buckets);
|
|
36
37
|
cb();
|
|
@@ -42,23 +43,8 @@ class PlannerBucketListCommand extends GraphCommand_1.default {
|
|
|
42
43
|
}
|
|
43
44
|
return this
|
|
44
45
|
.getGroupId(args)
|
|
45
|
-
.then(
|
|
46
|
-
|
|
47
|
-
url: `${this.resource}/v1.0/planner/plans?$filter=(owner eq '${groupId}')`,
|
|
48
|
-
headers: {
|
|
49
|
-
accept: 'application/json;odata.metadata=none'
|
|
50
|
-
},
|
|
51
|
-
responseType: 'json'
|
|
52
|
-
};
|
|
53
|
-
return request_1.default.get(requestOptions);
|
|
54
|
-
})
|
|
55
|
-
.then(response => {
|
|
56
|
-
const plan = response.value.find(val => val.title === args.options.planName);
|
|
57
|
-
if (!plan) {
|
|
58
|
-
return Promise.reject(`The specified plan does not exist`);
|
|
59
|
-
}
|
|
60
|
-
return Promise.resolve(plan.id);
|
|
61
|
-
});
|
|
46
|
+
.then(groupId => planner_1.planner.getPlanByName(args.options.planName, groupId))
|
|
47
|
+
.then(plan => plan.id);
|
|
62
48
|
}
|
|
63
49
|
getGroupId(args) {
|
|
64
50
|
if (args.options.ownerGroupId) {
|
|
@@ -5,6 +5,7 @@ const utils_1 = require("../../../../utils");
|
|
|
5
5
|
const request_1 = require("../../../../request");
|
|
6
6
|
const GraphCommand_1 = require("../../../base/GraphCommand");
|
|
7
7
|
const commands_1 = require("../../commands");
|
|
8
|
+
const planner_1 = require("../../../../utils/planner");
|
|
8
9
|
const Auth_1 = require("../../../../Auth");
|
|
9
10
|
class PlannerBucketRemoveCommand extends GraphCommand_1.default {
|
|
10
11
|
get name() {
|
|
@@ -105,26 +106,8 @@ class PlannerBucketRemoveCommand extends GraphCommand_1.default {
|
|
|
105
106
|
}
|
|
106
107
|
return this
|
|
107
108
|
.getGroupId(args)
|
|
108
|
-
.then(groupId =>
|
|
109
|
-
|
|
110
|
-
url: `${this.resource}/v1.0/planner/plans?$filter=owner eq '${groupId}'`,
|
|
111
|
-
headers: {
|
|
112
|
-
accept: 'application/json;odata.metadata=none'
|
|
113
|
-
},
|
|
114
|
-
responseType: 'json'
|
|
115
|
-
};
|
|
116
|
-
return request_1.default.get(requestOptions);
|
|
117
|
-
})
|
|
118
|
-
.then(plans => {
|
|
119
|
-
const filteredPlans = plans.value.filter(p => p.title.toLowerCase() === planName.toLowerCase());
|
|
120
|
-
if (!filteredPlans.length) {
|
|
121
|
-
return Promise.reject(`The specified plan ${planName} does not exist`);
|
|
122
|
-
}
|
|
123
|
-
if (filteredPlans.length > 1) {
|
|
124
|
-
return Promise.reject(`Multiple plans with name ${planName} found: ${filteredPlans.map(x => x.id)}`);
|
|
125
|
-
}
|
|
126
|
-
return Promise.resolve(filteredPlans[0].id);
|
|
127
|
-
});
|
|
109
|
+
.then(groupId => planner_1.planner.getPlanByName(planName, groupId))
|
|
110
|
+
.then(plan => plan.id);
|
|
128
111
|
}
|
|
129
112
|
getGroupId(args) {
|
|
130
113
|
const { ownerGroupId, ownerGroupName } = args.options;
|
|
@@ -4,6 +4,7 @@ const utils_1 = require("../../../../utils");
|
|
|
4
4
|
const GraphCommand_1 = require("../../../base/GraphCommand");
|
|
5
5
|
const Auth_1 = require("../../../../Auth");
|
|
6
6
|
const request_1 = require("../../../../request");
|
|
7
|
+
const planner_1 = require("../../../../utils/planner");
|
|
7
8
|
const commands_1 = require("../../commands");
|
|
8
9
|
class PlannerBucketSetCommand extends GraphCommand_1.default {
|
|
9
10
|
get name() {
|
|
@@ -93,26 +94,8 @@ class PlannerBucketSetCommand extends GraphCommand_1.default {
|
|
|
93
94
|
}
|
|
94
95
|
return this
|
|
95
96
|
.getGroupId(args)
|
|
96
|
-
.then(groupId =>
|
|
97
|
-
|
|
98
|
-
url: `${this.resource}/v1.0/planner/plans?$filter=owner eq '${groupId}'`,
|
|
99
|
-
headers: {
|
|
100
|
-
accept: 'application/json;odata.metadata=none'
|
|
101
|
-
},
|
|
102
|
-
responseType: 'json'
|
|
103
|
-
};
|
|
104
|
-
return request_1.default.get(requestOptions);
|
|
105
|
-
})
|
|
106
|
-
.then(plans => {
|
|
107
|
-
const filteredPlans = plans.value.filter(p => p.title.toLowerCase() === planName.toLowerCase());
|
|
108
|
-
if (filteredPlans.length === 0) {
|
|
109
|
-
return Promise.reject(`The specified plan ${planName} does not exist`);
|
|
110
|
-
}
|
|
111
|
-
if (filteredPlans.length > 1) {
|
|
112
|
-
return Promise.reject(`Multiple plans with name ${planName} found: ${filteredPlans.map(x => x.id)}`);
|
|
113
|
-
}
|
|
114
|
-
return Promise.resolve(filteredPlans[0].id);
|
|
115
|
-
});
|
|
97
|
+
.then(groupId => planner_1.planner.getPlanByName(planName, groupId))
|
|
98
|
+
.then(plan => plan.id);
|
|
116
99
|
}
|
|
117
100
|
getGroupId(args) {
|
|
118
101
|
const { ownerGroupId, ownerGroupName } = args.options;
|
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
const utils_1 = require("../../../../utils");
|
|
4
4
|
const Auth_1 = require("../../../../Auth");
|
|
5
5
|
const request_1 = require("../../../../request");
|
|
6
|
+
const planner_1 = require("../../../../utils/planner");
|
|
6
7
|
const GraphCommand_1 = require("../../../base/GraphCommand");
|
|
7
8
|
const commands_1 = require("../../commands");
|
|
8
9
|
class PlannerPlanDetailsGetCommand extends GraphCommand_1.default {
|
|
@@ -33,7 +34,7 @@ class PlannerPlanDetailsGetCommand extends GraphCommand_1.default {
|
|
|
33
34
|
.getGroupId(args)
|
|
34
35
|
.then((groupId) => {
|
|
35
36
|
this.groupId = groupId;
|
|
36
|
-
return this.getPlanId(args
|
|
37
|
+
return this.getPlanId(args);
|
|
37
38
|
})
|
|
38
39
|
.then((planId) => {
|
|
39
40
|
args.options.planId = planId;
|
|
@@ -71,22 +72,13 @@ class PlannerPlanDetailsGetCommand extends GraphCommand_1.default {
|
|
|
71
72
|
return Promise.resolve(groupItem.id);
|
|
72
73
|
});
|
|
73
74
|
}
|
|
74
|
-
getPlanId(args
|
|
75
|
+
getPlanId(args) {
|
|
75
76
|
if (args.options.planId) {
|
|
76
77
|
return Promise.resolve(args.options.planId);
|
|
77
78
|
}
|
|
78
|
-
return
|
|
79
|
-
.
|
|
80
|
-
.then(
|
|
81
|
-
const plansMatchingName = plans.filter((plan) => plan.title === args.options.planTitle);
|
|
82
|
-
if (plansMatchingName && plansMatchingName.length > 0) {
|
|
83
|
-
if (plansMatchingName.length > 1) {
|
|
84
|
-
return Promise.reject(`Multiple plans with name ${args.options.planTitle} found: ${plansMatchingName.map(x => x.id)}`);
|
|
85
|
-
}
|
|
86
|
-
return Promise.resolve(plansMatchingName[0].id);
|
|
87
|
-
}
|
|
88
|
-
return Promise.reject(`The specified plan title does not exist`);
|
|
89
|
-
});
|
|
79
|
+
return planner_1.planner
|
|
80
|
+
.getPlanByName(args.options.planTitle, this.groupId)
|
|
81
|
+
.then(plan => plan.id);
|
|
90
82
|
}
|
|
91
83
|
getPlanDetails(args) {
|
|
92
84
|
const requestOptions = {
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const Auth_1 = require("../../../../Auth");
|
|
4
3
|
const utils_1 = require("../../../../utils");
|
|
5
4
|
const request_1 = require("../../../../request");
|
|
5
|
+
const planner_1 = require("../../../../utils/planner");
|
|
6
6
|
const GraphCommand_1 = require("../../../base/GraphCommand");
|
|
7
7
|
const commands_1 = require("../../commands");
|
|
8
|
+
const Auth_1 = require("../../../../Auth");
|
|
8
9
|
class PlannerPlanGetCommand extends GraphCommand_1.default {
|
|
9
10
|
get name() {
|
|
10
11
|
return commands_1.default.PLAN_GET;
|
|
@@ -29,8 +30,8 @@ class PlannerPlanGetCommand extends GraphCommand_1.default {
|
|
|
29
30
|
return;
|
|
30
31
|
}
|
|
31
32
|
if (args.options.id) {
|
|
32
|
-
|
|
33
|
-
.
|
|
33
|
+
planner_1.planner
|
|
34
|
+
.getPlanById(args.options.id)
|
|
34
35
|
.then((res) => {
|
|
35
36
|
logger.log(res);
|
|
36
37
|
cb();
|
|
@@ -39,11 +40,10 @@ class PlannerPlanGetCommand extends GraphCommand_1.default {
|
|
|
39
40
|
else {
|
|
40
41
|
this
|
|
41
42
|
.getGroupId(args)
|
|
42
|
-
.then(
|
|
43
|
-
.then((
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
logger.log(filteredPlan);
|
|
43
|
+
.then(groupId => planner_1.planner.getPlanByName(args.options.title, groupId))
|
|
44
|
+
.then((plan) => {
|
|
45
|
+
if (plan) {
|
|
46
|
+
logger.log(plan);
|
|
47
47
|
}
|
|
48
48
|
cb();
|
|
49
49
|
}, (err) => this.handleRejectedODataJsonPromise(err, logger, cb));
|
|
@@ -70,16 +70,6 @@ class PlannerPlanGetCommand extends GraphCommand_1.default {
|
|
|
70
70
|
return Promise.resolve(group.id);
|
|
71
71
|
});
|
|
72
72
|
}
|
|
73
|
-
getPlan(args) {
|
|
74
|
-
const requestOptions = {
|
|
75
|
-
url: `${this.resource}/v1.0/planner/plans/${args.options.id}`,
|
|
76
|
-
headers: {
|
|
77
|
-
'accept': 'application/json'
|
|
78
|
-
},
|
|
79
|
-
responseType: 'json'
|
|
80
|
-
};
|
|
81
|
-
return request_1.default.get(requestOptions);
|
|
82
|
-
}
|
|
83
73
|
options() {
|
|
84
74
|
const options = [
|
|
85
75
|
{
|
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
const utils_1 = require("../../../../utils");
|
|
4
4
|
const Auth_1 = require("../../../../Auth");
|
|
5
5
|
const request_1 = require("../../../../request");
|
|
6
|
+
const planner_1 = require("../../../../utils/planner");
|
|
6
7
|
const GraphCommand_1 = require("../../../base/GraphCommand");
|
|
7
8
|
const commands_1 = require("../../commands");
|
|
8
9
|
class PlannerPlanListCommand extends GraphCommand_1.default {
|
|
@@ -28,19 +29,10 @@ class PlannerPlanListCommand extends GraphCommand_1.default {
|
|
|
28
29
|
}
|
|
29
30
|
this
|
|
30
31
|
.getGroupId(args)
|
|
31
|
-
.then((groupId) =>
|
|
32
|
-
const requestOptions = {
|
|
33
|
-
url: `${this.resource}/v1.0/groups/${groupId}/planner/plans`,
|
|
34
|
-
headers: {
|
|
35
|
-
'accept': 'application/json;odata.metadata=none'
|
|
36
|
-
},
|
|
37
|
-
responseType: 'json'
|
|
38
|
-
};
|
|
39
|
-
return request_1.default.get(requestOptions);
|
|
40
|
-
})
|
|
32
|
+
.then((groupId) => planner_1.planner.getPlansByGroupId(groupId))
|
|
41
33
|
.then((res) => {
|
|
42
|
-
if (res
|
|
43
|
-
logger.log(res
|
|
34
|
+
if (res && res.length > 0) {
|
|
35
|
+
logger.log(res);
|
|
44
36
|
}
|
|
45
37
|
cb();
|
|
46
38
|
}, (err) => this.handleRejectedODataJsonPromise(err, logger, cb));
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const Auth_1 = require("../../../../Auth");
|
|
4
4
|
const request_1 = require("../../../../request");
|
|
5
|
+
const planner_1 = require("../../../../utils/planner");
|
|
5
6
|
const utils_1 = require("../../../../utils");
|
|
6
7
|
const GraphCommand_1 = require("../../../base/GraphCommand");
|
|
7
8
|
const commands_1 = require("../../commands");
|
|
@@ -156,22 +157,8 @@ class PlannerTaskAddCommand extends GraphCommand_1.default {
|
|
|
156
157
|
}
|
|
157
158
|
return this
|
|
158
159
|
.getGroupId(args)
|
|
159
|
-
.then((groupId) =>
|
|
160
|
-
|
|
161
|
-
url: `${this.resource}/v1.0/planner/plans?$filter=(owner eq '${groupId}')`,
|
|
162
|
-
headers: {
|
|
163
|
-
accept: 'application/json;odata.metadata=none'
|
|
164
|
-
},
|
|
165
|
-
responseType: 'json'
|
|
166
|
-
};
|
|
167
|
-
return request_1.default.get(requestOptions);
|
|
168
|
-
}).then((response) => {
|
|
169
|
-
const plan = response.value.find(val => val.title === args.options.planName);
|
|
170
|
-
if (!plan) {
|
|
171
|
-
return Promise.reject(`The specified plan does not exist`);
|
|
172
|
-
}
|
|
173
|
-
return Promise.resolve(plan.id);
|
|
174
|
-
});
|
|
160
|
+
.then((groupId) => planner_1.planner.getPlanByName(args.options.planName, groupId))
|
|
161
|
+
.then(plan => plan.id);
|
|
175
162
|
}
|
|
176
163
|
getGroupId(args) {
|
|
177
164
|
if (args.options.ownerGroupId) {
|
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
const utils_1 = require("../../../../utils");
|
|
4
4
|
const request_1 = require("../../../../request");
|
|
5
5
|
const utils_2 = require("../../../../utils");
|
|
6
|
+
const planner_1 = require("../../../../utils/planner");
|
|
6
7
|
const GraphCommand_1 = require("../../../base/GraphCommand");
|
|
7
8
|
const commands_1 = require("../../commands");
|
|
8
9
|
const Auth_1 = require("../../../../Auth");
|
|
@@ -97,27 +98,8 @@ class PlannerTaskGetCommand extends GraphCommand_1.default {
|
|
|
97
98
|
}
|
|
98
99
|
return this
|
|
99
100
|
.getGroupId(options)
|
|
100
|
-
.then(
|
|
101
|
-
|
|
102
|
-
url: `${this.resource}/v1.0/planner/plans?$filter=owner eq '${groupId}'&$select=id,title`,
|
|
103
|
-
headers: {
|
|
104
|
-
accept: 'application/json;odata.metadata=none'
|
|
105
|
-
},
|
|
106
|
-
responseType: 'json'
|
|
107
|
-
};
|
|
108
|
-
return request_1.default.get(requestOptions);
|
|
109
|
-
})
|
|
110
|
-
.then((response) => {
|
|
111
|
-
const planName = options.planName;
|
|
112
|
-
const plans = response.value.filter(val => { var _a; return ((_a = val.title) === null || _a === void 0 ? void 0 : _a.toLocaleLowerCase()) === planName.toLocaleLowerCase(); });
|
|
113
|
-
if (!plans.length) {
|
|
114
|
-
return Promise.reject(`The specified plan ${options.planName} does not exist`);
|
|
115
|
-
}
|
|
116
|
-
if (plans.length > 1) {
|
|
117
|
-
return Promise.reject(`Multiple plans with name ${options.planName} found: ${plans.map(x => x.id)}`);
|
|
118
|
-
}
|
|
119
|
-
return Promise.resolve(plans[0].id);
|
|
120
|
-
});
|
|
101
|
+
.then(groupId => planner_1.planner.getPlanByName(options.planName, groupId))
|
|
102
|
+
.then(plan => plan.id);
|
|
121
103
|
}
|
|
122
104
|
getGroupId(options) {
|
|
123
105
|
if (options.ownerGroupId) {
|
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
const utils_1 = require("../../../../utils");
|
|
4
4
|
const Auth_1 = require("../../../../Auth");
|
|
5
5
|
const request_1 = require("../../../../request");
|
|
6
|
+
const planner_1 = require("../../../../utils/planner");
|
|
6
7
|
const GraphCommand_1 = require("../../../base/GraphCommand");
|
|
7
8
|
const commands_1 = require("../../commands");
|
|
8
9
|
class PlannerTaskListCommand extends GraphCommand_1.default {
|
|
@@ -40,11 +41,11 @@ class PlannerTaskListCommand extends GraphCommand_1.default {
|
|
|
40
41
|
.getBucketId(args)
|
|
41
42
|
.then((retrievedBucketId) => {
|
|
42
43
|
bucketId = retrievedBucketId;
|
|
43
|
-
return utils_1.odata.getAllItems(`${this.resource}/v1.0/planner/buckets/${bucketId}/tasks
|
|
44
|
+
return utils_1.odata.getAllItems(`${this.resource}/v1.0/planner/buckets/${bucketId}/tasks`);
|
|
44
45
|
})
|
|
45
46
|
.then((tasks) => {
|
|
46
47
|
taskItems = tasks;
|
|
47
|
-
return utils_1.odata.getAllItems(`${this.resource}/beta/planner/buckets/${bucketId}/tasks
|
|
48
|
+
return utils_1.odata.getAllItems(`${this.resource}/beta/planner/buckets/${bucketId}/tasks`);
|
|
48
49
|
})
|
|
49
50
|
.then((betaTasks) => {
|
|
50
51
|
logger.log(this.mergeTaskPriority(taskItems, betaTasks));
|
|
@@ -56,11 +57,11 @@ class PlannerTaskListCommand extends GraphCommand_1.default {
|
|
|
56
57
|
.getPlanId(args)
|
|
57
58
|
.then((retrievedPlanId) => {
|
|
58
59
|
planId = retrievedPlanId;
|
|
59
|
-
return utils_1.odata.getAllItems(`${this.resource}/v1.0/planner/plans/${planId}/tasks
|
|
60
|
+
return utils_1.odata.getAllItems(`${this.resource}/v1.0/planner/plans/${planId}/tasks`);
|
|
60
61
|
})
|
|
61
62
|
.then((tasks) => {
|
|
62
63
|
taskItems = tasks;
|
|
63
|
-
return utils_1.odata.getAllItems(`${this.resource}/beta/planner/plans/${planId}/tasks
|
|
64
|
+
return utils_1.odata.getAllItems(`${this.resource}/beta/planner/plans/${planId}/tasks`);
|
|
64
65
|
})
|
|
65
66
|
.then((betaTasks) => {
|
|
66
67
|
logger.log(this.mergeTaskPriority(taskItems, betaTasks));
|
|
@@ -69,10 +70,10 @@ class PlannerTaskListCommand extends GraphCommand_1.default {
|
|
|
69
70
|
}
|
|
70
71
|
else {
|
|
71
72
|
utils_1.odata
|
|
72
|
-
.getAllItems(`${this.resource}/v1.0/me/planner/tasks
|
|
73
|
+
.getAllItems(`${this.resource}/v1.0/me/planner/tasks`)
|
|
73
74
|
.then((tasks) => {
|
|
74
75
|
taskItems = tasks;
|
|
75
|
-
return utils_1.odata.getAllItems(`${this.resource}/beta/me/planner/tasks
|
|
76
|
+
return utils_1.odata.getAllItems(`${this.resource}/beta/me/planner/tasks`);
|
|
76
77
|
})
|
|
77
78
|
.then((betaTasks) => {
|
|
78
79
|
logger.log(this.mergeTaskPriority(taskItems, betaTasks));
|
|
@@ -110,23 +111,8 @@ class PlannerTaskListCommand extends GraphCommand_1.default {
|
|
|
110
111
|
}
|
|
111
112
|
return this
|
|
112
113
|
.getGroupId(args)
|
|
113
|
-
.then((groupId) =>
|
|
114
|
-
|
|
115
|
-
url: `${this.resource}/v1.0/planner/plans?$filter=(owner eq '${groupId}')`,
|
|
116
|
-
headers: {
|
|
117
|
-
accept: 'application/json;odata.metadata=none'
|
|
118
|
-
},
|
|
119
|
-
responseType: 'json'
|
|
120
|
-
};
|
|
121
|
-
return request_1.default.get(requestOptions);
|
|
122
|
-
})
|
|
123
|
-
.then(response => {
|
|
124
|
-
const plan = response.value.find(val => val.title === args.options.planName);
|
|
125
|
-
if (!plan) {
|
|
126
|
-
return Promise.reject(`The specified plan does not exist`);
|
|
127
|
-
}
|
|
128
|
-
return Promise.resolve(plan.id);
|
|
129
|
-
});
|
|
114
|
+
.then((groupId) => planner_1.planner.getPlanByName(args.options.planName, groupId))
|
|
115
|
+
.then(plan => plan.id);
|
|
130
116
|
}
|
|
131
117
|
getGroupId(args) {
|
|
132
118
|
if (args.options.ownerGroupId) {
|
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
const utils_1 = require("../../../../utils");
|
|
4
4
|
const Auth_1 = require("../../../../Auth");
|
|
5
5
|
const request_1 = require("../../../../request");
|
|
6
|
+
const planner_1 = require("../../../../utils/planner");
|
|
6
7
|
const GraphCommand_1 = require("../../../base/GraphCommand");
|
|
7
8
|
const commands_1 = require("../../commands");
|
|
8
9
|
class PlannerTaskSetCommand extends GraphCommand_1.default {
|
|
@@ -222,23 +223,8 @@ class PlannerTaskSetCommand extends GraphCommand_1.default {
|
|
|
222
223
|
}
|
|
223
224
|
return this
|
|
224
225
|
.getGroupId(options)
|
|
225
|
-
.then((groupId) =>
|
|
226
|
-
|
|
227
|
-
url: `${this.resource}/v1.0/planner/plans?$filter=(owner eq '${groupId}')&$select=id,title`,
|
|
228
|
-
headers: {
|
|
229
|
-
accept: 'application/json;odata.metadata=none'
|
|
230
|
-
},
|
|
231
|
-
responseType: 'json'
|
|
232
|
-
};
|
|
233
|
-
return request_1.default.get(requestOptions);
|
|
234
|
-
})
|
|
235
|
-
.then((response) => {
|
|
236
|
-
const plan = response.value.find(val => val.title === options.planName);
|
|
237
|
-
if (!plan) {
|
|
238
|
-
return Promise.reject(`The specified plan does not exist`);
|
|
239
|
-
}
|
|
240
|
-
return Promise.resolve(plan.id);
|
|
241
|
-
});
|
|
226
|
+
.then((groupId) => planner_1.planner.getPlanByName(options.planName, groupId))
|
|
227
|
+
.then(plan => plan.id);
|
|
242
228
|
}
|
|
243
229
|
getGroupId(options) {
|
|
244
230
|
if (options.ownerGroupId) {
|
|
@@ -13,7 +13,7 @@ class PpManagementAppListCommand extends PowerPlatformCommand_1.default {
|
|
|
13
13
|
commandAction(logger, args, cb) {
|
|
14
14
|
const endpoint = `${this.resource}/providers/Microsoft.BusinessAppPlatform/adminApplications?api-version=2020-06-01`;
|
|
15
15
|
utils_1.odata
|
|
16
|
-
.getAllItems(endpoint
|
|
16
|
+
.getAllItems(endpoint)
|
|
17
17
|
.then((managementApps) => {
|
|
18
18
|
logger.log(managementApps);
|
|
19
19
|
cb();
|
|
@@ -76,7 +76,7 @@ class TeamsAppListCommand extends GraphCommand_1.default {
|
|
|
76
76
|
commandAction(logger, args, cb) {
|
|
77
77
|
this
|
|
78
78
|
.getEndpointUrl(args)
|
|
79
|
-
.then(endpoint => utils_1.odata.getAllItems(endpoint
|
|
79
|
+
.then(endpoint => utils_1.odata.getAllItems(endpoint))
|
|
80
80
|
.then((items) => {
|
|
81
81
|
if (args.options.teamId || args.options.teamName) {
|
|
82
82
|
items.forEach(t => {
|
|
@@ -53,7 +53,7 @@ class TeamsChannelListCommand extends GraphCommand_1.default {
|
|
|
53
53
|
if (args.options.type) {
|
|
54
54
|
endpoint += `?$filter=membershipType eq '${args.options.type}'`;
|
|
55
55
|
}
|
|
56
|
-
return utils_1.odata.getAllItems(endpoint
|
|
56
|
+
return utils_1.odata.getAllItems(endpoint);
|
|
57
57
|
})
|
|
58
58
|
.then((items) => {
|
|
59
59
|
logger.log(items);
|
|
@@ -40,7 +40,7 @@ class TeamsChannelMemberListCommand extends GraphCommand_1.default {
|
|
|
40
40
|
})
|
|
41
41
|
.then((channelId) => {
|
|
42
42
|
const endpoint = `${this.resource}/v1.0/teams/${this.teamId}/channels/${channelId}/members`;
|
|
43
|
-
return utils_1.odata.getAllItems(endpoint
|
|
43
|
+
return utils_1.odata.getAllItems(endpoint);
|
|
44
44
|
})
|
|
45
45
|
.then((memberships) => {
|
|
46
46
|
if (args.options.role) {
|
|
@@ -33,7 +33,7 @@ class TeamsChatGetCommand extends GraphCommand_1.default {
|
|
|
33
33
|
}
|
|
34
34
|
commandAction(logger, args, cb) {
|
|
35
35
|
this
|
|
36
|
-
.getChatId(
|
|
36
|
+
.getChatId(args)
|
|
37
37
|
.then(chatId => this.getChatDetailsById(chatId))
|
|
38
38
|
.then((chat) => {
|
|
39
39
|
logger.log(chat);
|
|
@@ -83,14 +83,14 @@ class TeamsChatGetCommand extends GraphCommand_1.default {
|
|
|
83
83
|
}
|
|
84
84
|
return true;
|
|
85
85
|
}
|
|
86
|
-
getChatId(
|
|
86
|
+
getChatId(args) {
|
|
87
87
|
return __awaiter(this, void 0, void 0, function* () {
|
|
88
88
|
if (args.options.id) {
|
|
89
89
|
return args.options.id;
|
|
90
90
|
}
|
|
91
91
|
return args.options.participants
|
|
92
|
-
? this.getChatIdByParticipants(args.options.participants
|
|
93
|
-
: this.getChatIdByName(args.options.name
|
|
92
|
+
? this.getChatIdByParticipants(args.options.participants)
|
|
93
|
+
: this.getChatIdByName(args.options.name);
|
|
94
94
|
});
|
|
95
95
|
}
|
|
96
96
|
getChatDetailsById(id) {
|
|
@@ -105,11 +105,11 @@ class TeamsChatGetCommand extends GraphCommand_1.default {
|
|
|
105
105
|
return request_1.default.get(requestOptions);
|
|
106
106
|
});
|
|
107
107
|
}
|
|
108
|
-
getChatIdByParticipants(participantsString
|
|
108
|
+
getChatIdByParticipants(participantsString) {
|
|
109
109
|
return __awaiter(this, void 0, void 0, function* () {
|
|
110
110
|
const participants = chatUtil_1.chatUtil.convertParticipantStringToArray(participantsString);
|
|
111
111
|
const currentUserEmail = accessToken_1.accessToken.getUserNameFromAccessToken(Auth_1.default.service.accessTokens[this.resource].accessToken).toLowerCase();
|
|
112
|
-
const existingChats = yield chatUtil_1.chatUtil.findExistingChatsByParticipants([currentUserEmail, ...participants]
|
|
112
|
+
const existingChats = yield chatUtil_1.chatUtil.findExistingChatsByParticipants([currentUserEmail, ...participants]);
|
|
113
113
|
if (!existingChats || existingChats.length === 0) {
|
|
114
114
|
throw new Error('No chat conversation was found with these participants.');
|
|
115
115
|
}
|
|
@@ -122,9 +122,9 @@ class TeamsChatGetCommand extends GraphCommand_1.default {
|
|
|
122
122
|
throw new Error(`Multiple chat conversations with these participants found. Please disambiguate:${os.EOL}${disambiguationText}`);
|
|
123
123
|
});
|
|
124
124
|
}
|
|
125
|
-
getChatIdByName(name
|
|
125
|
+
getChatIdByName(name) {
|
|
126
126
|
return __awaiter(this, void 0, void 0, function* () {
|
|
127
|
-
const existingChats = yield chatUtil_1.chatUtil.findExistingGroupChatsByName(name
|
|
127
|
+
const existingChats = yield chatUtil_1.chatUtil.findExistingGroupChatsByName(name);
|
|
128
128
|
if (!existingChats || existingChats.length === 0) {
|
|
129
129
|
throw new Error('No chat conversation was found with this name.');
|
|
130
130
|
}
|
|
@@ -17,7 +17,7 @@ class TeamsChatListCommand extends GraphCommand_1.default {
|
|
|
17
17
|
const filter = args.options.type !== undefined ? `?$filter=chatType eq '${args.options.type}'` : '';
|
|
18
18
|
const endpoint = `${this.resource}/v1.0/chats${filter}`;
|
|
19
19
|
utils_1.odata
|
|
20
|
-
.getAllItems(endpoint
|
|
20
|
+
.getAllItems(endpoint)
|
|
21
21
|
.then((items) => {
|
|
22
22
|
logger.log(items);
|
|
23
23
|
cb();
|
|
@@ -16,7 +16,7 @@ class TeamsChatMemberListCommand extends GraphCommand_1.default {
|
|
|
16
16
|
commandAction(logger, args, cb) {
|
|
17
17
|
const endpoint = `${this.resource}/v1.0/chats/${args.options.chatId}/members`;
|
|
18
18
|
utils_1.odata
|
|
19
|
-
.getAllItems(endpoint
|
|
19
|
+
.getAllItems(endpoint)
|
|
20
20
|
.then((items) => {
|
|
21
21
|
logger.log(items);
|
|
22
22
|
cb();
|
|
@@ -16,7 +16,7 @@ class TeamsChatMessageListCommand extends GraphCommand_1.default {
|
|
|
16
16
|
commandAction(logger, args, cb) {
|
|
17
17
|
const endpoint = `${this.resource}/v1.0/chats/${args.options.chatId}/messages`;
|
|
18
18
|
utils_1.odata
|
|
19
|
-
.getAllItems(endpoint
|
|
19
|
+
.getAllItems(endpoint)
|
|
20
20
|
.then((items) => {
|
|
21
21
|
if (args.options.output !== 'json') {
|
|
22
22
|
items.forEach(i => {
|
|
@@ -93,15 +93,15 @@ class TeamsChatMessageSendCommand extends GraphCommand_1.default {
|
|
|
93
93
|
return args.options.chatId;
|
|
94
94
|
}
|
|
95
95
|
return args.options.userEmails
|
|
96
|
-
? this.ensureChatIdByUserEmails(args.options.userEmails
|
|
97
|
-
: this.getChatIdByName(args.options.chatName
|
|
96
|
+
? this.ensureChatIdByUserEmails(args.options.userEmails)
|
|
97
|
+
: this.getChatIdByName(args.options.chatName);
|
|
98
98
|
});
|
|
99
99
|
}
|
|
100
|
-
ensureChatIdByUserEmails(userEmailsOption
|
|
100
|
+
ensureChatIdByUserEmails(userEmailsOption) {
|
|
101
101
|
return __awaiter(this, void 0, void 0, function* () {
|
|
102
102
|
const userEmails = chatUtil_1.chatUtil.convertParticipantStringToArray(userEmailsOption);
|
|
103
103
|
const currentUserEmail = utils_1.accessToken.getUserNameFromAccessToken(Auth_1.default.service.accessTokens[this.resource].accessToken).toLowerCase();
|
|
104
|
-
const existingChats = yield chatUtil_1.chatUtil.findExistingChatsByParticipants([currentUserEmail, ...userEmails]
|
|
104
|
+
const existingChats = yield chatUtil_1.chatUtil.findExistingChatsByParticipants([currentUserEmail, ...userEmails]);
|
|
105
105
|
if (!existingChats || existingChats.length === 0) {
|
|
106
106
|
const chat = yield this.createConversation([currentUserEmail, ...userEmails]);
|
|
107
107
|
return chat.id;
|
|
@@ -115,9 +115,9 @@ class TeamsChatMessageSendCommand extends GraphCommand_1.default {
|
|
|
115
115
|
throw new Error(`Multiple chat conversations with this name found. Please disambiguate:${os.EOL}${disambiguationText}`);
|
|
116
116
|
});
|
|
117
117
|
}
|
|
118
|
-
getChatIdByName(chatName
|
|
118
|
+
getChatIdByName(chatName) {
|
|
119
119
|
return __awaiter(this, void 0, void 0, function* () {
|
|
120
|
-
const existingChats = yield chatUtil_1.chatUtil.findExistingGroupChatsByName(chatName
|
|
120
|
+
const existingChats = yield chatUtil_1.chatUtil.findExistingGroupChatsByName(chatName);
|
|
121
121
|
if (!existingChats || existingChats.length === 0) {
|
|
122
122
|
throw new Error('No chat conversation was found with this name.');
|
|
123
123
|
}
|
|
@@ -17,12 +17,12 @@ exports.chatUtil = {
|
|
|
17
17
|
* @param expectedMemberEmails a string array of participant emailaddresses
|
|
18
18
|
* @param logger a logger to pipe into the graph request odata helper.
|
|
19
19
|
*/
|
|
20
|
-
findExistingChatsByParticipants(expectedMemberEmails
|
|
20
|
+
findExistingChatsByParticipants(expectedMemberEmails) {
|
|
21
21
|
return __awaiter(this, void 0, void 0, function* () {
|
|
22
22
|
const chatType = expectedMemberEmails.length === 2 ? 'oneOnOne' : 'group';
|
|
23
23
|
const endpoint = `https://graph.microsoft.com/v1.0/chats?$filter=chatType eq '${chatType}'&$expand=members&$select=id,topic,createdDateTime,members`;
|
|
24
24
|
const foundChats = [];
|
|
25
|
-
const chats = yield odata_1.odata.getAllItems(endpoint
|
|
25
|
+
const chats = yield odata_1.odata.getAllItems(endpoint);
|
|
26
26
|
for (const chat of chats) {
|
|
27
27
|
const chatMembers = chat.members;
|
|
28
28
|
if (chatMembers.length === expectedMemberEmails.length) {
|
|
@@ -40,10 +40,10 @@ exports.chatUtil = {
|
|
|
40
40
|
* @param name the name of the chat conversation to find
|
|
41
41
|
* @param logger a logger to pipe into the graph request odata helper.
|
|
42
42
|
*/
|
|
43
|
-
findExistingGroupChatsByName(name
|
|
43
|
+
findExistingGroupChatsByName(name) {
|
|
44
44
|
return __awaiter(this, void 0, void 0, function* () {
|
|
45
45
|
const endpoint = `https://graph.microsoft.com/v1.0/chats?$filter=topic eq '${encodeURIComponent(name).replace("'", "''")}'&$expand=members&$select=id,topic,createdDateTime,chatType`;
|
|
46
|
-
return odata_1.odata.getAllItems(endpoint
|
|
46
|
+
return odata_1.odata.getAllItems(endpoint);
|
|
47
47
|
});
|
|
48
48
|
},
|
|
49
49
|
/**
|
|
@@ -17,7 +17,7 @@ class TeamsMessageListCommand extends GraphCommand_1.default {
|
|
|
17
17
|
const deltaExtension = args.options.since !== undefined ? `/delta?$filter=lastModifiedDateTime gt ${args.options.since}` : '';
|
|
18
18
|
const endpoint = `${this.resource}/v1.0/teams/${args.options.teamId}/channels/${args.options.channelId}/messages${deltaExtension}`;
|
|
19
19
|
utils_1.odata
|
|
20
|
-
.getAllItems(endpoint
|
|
20
|
+
.getAllItems(endpoint)
|
|
21
21
|
.then((items) => {
|
|
22
22
|
if (args.options.output !== 'json') {
|
|
23
23
|
items.forEach(i => {
|
|
@@ -16,7 +16,7 @@ class TeamsMessageReplyListCommand extends GraphCommand_1.default {
|
|
|
16
16
|
commandAction(logger, args, cb) {
|
|
17
17
|
const endpoint = `${this.resource}/v1.0/teams/${args.options.teamId}/channels/${args.options.channelId}/messages/${args.options.messageId}/replies`;
|
|
18
18
|
utils_1.odata
|
|
19
|
-
.getAllItems(endpoint
|
|
19
|
+
.getAllItems(endpoint)
|
|
20
20
|
.then((items) => {
|
|
21
21
|
if (args.options.output !== 'json') {
|
|
22
22
|
items.forEach(i => {
|
|
@@ -16,7 +16,7 @@ class TeamsTabListCommand extends GraphCommand_1.default {
|
|
|
16
16
|
commandAction(logger, args, cb) {
|
|
17
17
|
const endpoint = `${this.resource}/v1.0/teams/${args.options.teamId}/channels/${encodeURIComponent(args.options.channelId)}/tabs?$expand=teamsApp`;
|
|
18
18
|
utils_1.odata
|
|
19
|
-
.getAllItems(endpoint
|
|
19
|
+
.getAllItems(endpoint)
|
|
20
20
|
.then((items) => {
|
|
21
21
|
items.forEach(i => {
|
|
22
22
|
i.teamsAppTabId = i.teamsApp.id;
|
|
@@ -22,7 +22,7 @@ class TeamsTeamListCommand extends GraphCommand_1.default {
|
|
|
22
22
|
endpoint = `${this.resource}/v1.0/me/joinedTeams`;
|
|
23
23
|
}
|
|
24
24
|
utils_1.odata
|
|
25
|
-
.getAllItems(endpoint
|
|
25
|
+
.getAllItems(endpoint)
|
|
26
26
|
.then((items) => {
|
|
27
27
|
if (args.options.joined) {
|
|
28
28
|
return Promise.resolve(items);
|
|
@@ -24,7 +24,7 @@ class TeamsUserAppListCommand extends GraphCommand_1.default {
|
|
|
24
24
|
.then((_userId) => {
|
|
25
25
|
userId = _userId.value;
|
|
26
26
|
const endpoint = `${this.resource}/v1.0/users/${encodeURIComponent(userId)}/teamwork/installedApps?$expand=teamsAppDefinition`;
|
|
27
|
-
return utils_1.odata.getAllItems(endpoint
|
|
27
|
+
return utils_1.odata.getAllItems(endpoint);
|
|
28
28
|
})
|
|
29
29
|
.then((items) => {
|
|
30
30
|
items.forEach(i => {
|
|
@@ -42,7 +42,7 @@ class TeamsUserListCommand extends GraphCommand_1.default {
|
|
|
42
42
|
}
|
|
43
43
|
getOwners(logger, groupId) {
|
|
44
44
|
const endpoint = `${this.resource}/v1.0/groups/${groupId}/owners?$select=id,displayName,userPrincipalName,userType`;
|
|
45
|
-
return utils_1.odata.getAllItems(endpoint
|
|
45
|
+
return utils_1.odata.getAllItems(endpoint).then((items) => {
|
|
46
46
|
this.items = this.items.concat(items);
|
|
47
47
|
// Currently there is a bug in the Microsoft Graph that returns Owners as
|
|
48
48
|
// userType 'member'. We therefore update all returned user as owner
|
|
@@ -53,7 +53,7 @@ class TeamsUserListCommand extends GraphCommand_1.default {
|
|
|
53
53
|
}
|
|
54
54
|
getMembersAndGuests(logger, groupId) {
|
|
55
55
|
const endpoint = `${this.resource}/v1.0/groups/${groupId}/members?$select=id,displayName,userPrincipalName,userType`;
|
|
56
|
-
return utils_1.odata.getAllItems(endpoint
|
|
56
|
+
return utils_1.odata.getAllItems(endpoint);
|
|
57
57
|
}
|
|
58
58
|
options() {
|
|
59
59
|
const options = [
|
package/dist/m365/tenant/commands/serviceannouncement/serviceannouncement-healthissue-list.js
CHANGED
|
@@ -19,7 +19,7 @@ class TenantServiceAnnouncementHealthIssueListCommand extends GraphCommand_1.def
|
|
|
19
19
|
endpoint += `?$filter=service eq '${encodeURIComponent(args.options.service)}'`;
|
|
20
20
|
}
|
|
21
21
|
utils_1.odata
|
|
22
|
-
.getAllItems(endpoint
|
|
22
|
+
.getAllItems(endpoint)
|
|
23
23
|
.then((items) => {
|
|
24
24
|
logger.log(items);
|
|
25
25
|
cb();
|
|
@@ -19,7 +19,7 @@ class TenantServiceAnnouncementMessageListCommand extends GraphCommand_1.default
|
|
|
19
19
|
endpoint += `?$filter=services/any(c:c+eq+'${encodeURIComponent(args.options.service)}')`;
|
|
20
20
|
}
|
|
21
21
|
utils_1.odata
|
|
22
|
-
.getAllItems(endpoint
|
|
22
|
+
.getAllItems(endpoint)
|
|
23
23
|
.then((items) => {
|
|
24
24
|
logger.log(items);
|
|
25
25
|
cb();
|
|
@@ -15,7 +15,7 @@ class TodoListListCommand extends GraphCommand_1.default {
|
|
|
15
15
|
}
|
|
16
16
|
commandAction(logger, args, cb) {
|
|
17
17
|
utils_1.odata
|
|
18
|
-
.getAllItems(`${this.resource}/v1.0/me/todo/lists
|
|
18
|
+
.getAllItems(`${this.resource}/v1.0/me/todo/lists`)
|
|
19
19
|
.then((items) => {
|
|
20
20
|
logger.log(items);
|
|
21
21
|
cb();
|
|
@@ -45,7 +45,7 @@ class TodoTaskListCommand extends GraphCommand_1.default {
|
|
|
45
45
|
.getTodoListId(args)
|
|
46
46
|
.then((listId) => {
|
|
47
47
|
const endpoint = `${this.resource}/v1.0/me/todo/lists/${listId}/tasks`;
|
|
48
|
-
return utils_1.odata.getAllItems(endpoint
|
|
48
|
+
return utils_1.odata.getAllItems(endpoint);
|
|
49
49
|
})
|
|
50
50
|
.then((items) => {
|
|
51
51
|
if (args.options.output === 'json') {
|
package/dist/utils/odata.js
CHANGED
|
@@ -12,7 +12,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
12
12
|
exports.odata = void 0;
|
|
13
13
|
const request_1 = require("../request");
|
|
14
14
|
exports.odata = {
|
|
15
|
-
getAllItems(url,
|
|
15
|
+
getAllItems(url, metadata) {
|
|
16
16
|
var _a;
|
|
17
17
|
return __awaiter(this, void 0, void 0, function* () {
|
|
18
18
|
let items = [];
|
|
@@ -27,7 +27,7 @@ exports.odata = {
|
|
|
27
27
|
items = res.value;
|
|
28
28
|
const nextLink = (_a = res['@odata.nextLink']) !== null && _a !== void 0 ? _a : res.nextLink;
|
|
29
29
|
if (nextLink) {
|
|
30
|
-
const nextPageItems = yield exports.odata.getAllItems(nextLink,
|
|
30
|
+
const nextPageItems = yield exports.odata.getAllItems(nextLink, metadata);
|
|
31
31
|
items = items.concat(nextPageItems);
|
|
32
32
|
}
|
|
33
33
|
return items;
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.planner = void 0;
|
|
13
|
+
const request_1 = require("../request");
|
|
14
|
+
const odata_1 = require("./odata");
|
|
15
|
+
const graphResource = 'https://graph.microsoft.com';
|
|
16
|
+
const getRequestOptions = (url, metadata) => ({
|
|
17
|
+
url: url,
|
|
18
|
+
headers: {
|
|
19
|
+
accept: `application/json;odata.metadata=${metadata}`
|
|
20
|
+
},
|
|
21
|
+
responseType: 'json'
|
|
22
|
+
});
|
|
23
|
+
exports.planner = {
|
|
24
|
+
/**
|
|
25
|
+
* Get Planner plan by ID.
|
|
26
|
+
* @param id Planner ID.
|
|
27
|
+
*/
|
|
28
|
+
getPlanById(id) {
|
|
29
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
30
|
+
const requestOptions = getRequestOptions(`${graphResource}/v1.0/planner/plans/${id}`, 'none');
|
|
31
|
+
try {
|
|
32
|
+
return yield request_1.default.get(requestOptions);
|
|
33
|
+
}
|
|
34
|
+
catch (ex) {
|
|
35
|
+
throw Error(`Planner plan with id '${id}' was not found.`);
|
|
36
|
+
}
|
|
37
|
+
});
|
|
38
|
+
},
|
|
39
|
+
/**
|
|
40
|
+
* Get all Planner plans for a specific group.
|
|
41
|
+
* @param groupId Group ID.
|
|
42
|
+
*/
|
|
43
|
+
getPlansByGroupId(groupId) {
|
|
44
|
+
return odata_1.odata.getAllItems(`${graphResource}/v1.0/groups/${groupId}/planner/plans`, 'none');
|
|
45
|
+
},
|
|
46
|
+
/**
|
|
47
|
+
* Get Planner plan by name in a specific group.
|
|
48
|
+
* @param name Name of the Planner plan. Case insensitive.
|
|
49
|
+
* @param groupId Owner group ID .
|
|
50
|
+
*/
|
|
51
|
+
getPlanByName(name, groupId) {
|
|
52
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
53
|
+
const plans = yield this.getPlansByGroupId(groupId);
|
|
54
|
+
const filteredPlans = plans.filter(p => p.title && p.title.toLowerCase() === name.toLowerCase());
|
|
55
|
+
if (!filteredPlans.length) {
|
|
56
|
+
throw Error(`The specified plan '${name}' does not exist.`);
|
|
57
|
+
}
|
|
58
|
+
if (filteredPlans.length > 1) {
|
|
59
|
+
throw Error(`Multiple plans with name '${name}' found: ${filteredPlans.map(x => x.id)}.`);
|
|
60
|
+
}
|
|
61
|
+
return filteredPlans[0];
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
};
|
|
65
|
+
//# sourceMappingURL=planner.js.map
|
package/package.json
CHANGED