@pnp/cli-microsoft365 5.3.0-beta.4bf3837 → 5.3.0-beta.7862300

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.
Files changed (70) hide show
  1. package/dist/Auth.js +5 -0
  2. package/dist/m365/aad/commands/app/app-add.js +91 -35
  3. package/dist/m365/aad/commands/app/app-role-list.js +1 -1
  4. package/dist/m365/aad/commands/app/app-set.js +91 -0
  5. package/dist/m365/aad/commands/group/group-list.js +1 -1
  6. package/dist/m365/aad/commands/groupsetting/groupsetting-list.js +1 -1
  7. package/dist/m365/aad/commands/groupsettingtemplate/groupsettingtemplate-get.js +1 -1
  8. package/dist/m365/aad/commands/groupsettingtemplate/groupsettingtemplate-list.js +1 -1
  9. package/dist/m365/aad/commands/o365group/o365group-conversation-list.js +1 -1
  10. package/dist/m365/aad/commands/o365group/o365group-conversation-post-list.js +1 -1
  11. package/dist/m365/aad/commands/o365group/o365group-list.js +1 -1
  12. package/dist/m365/aad/commands/o365group/o365group-recyclebinitem-clear.js +3 -3
  13. package/dist/m365/aad/commands/o365group/o365group-recyclebinitem-list.js +1 -1
  14. package/dist/m365/aad/commands/o365group/o365group-user-list.js +2 -2
  15. package/dist/m365/aad/commands/o365group/o365group-user-set.js +2 -2
  16. package/dist/m365/aad/commands/user/user-list.js +1 -1
  17. package/dist/m365/aad/commands/user/user-signin-list.js +1 -1
  18. package/dist/m365/base/PowerBICommand.js +10 -0
  19. package/dist/m365/file/commands/file-list.js +1 -1
  20. package/dist/m365/outlook/commands/message/message-list.js +1 -1
  21. package/dist/m365/outlook/commands/room/room-list.js +1 -1
  22. package/dist/m365/outlook/commands/roomlist/roomlist-list.js +1 -1
  23. package/dist/m365/planner/commands/bucket/bucket-add.js +3 -16
  24. package/dist/m365/planner/commands/bucket/bucket-get.js +3 -20
  25. package/dist/m365/planner/commands/bucket/bucket-list.js +4 -18
  26. package/dist/m365/planner/commands/bucket/bucket-remove.js +3 -20
  27. package/dist/m365/planner/commands/bucket/bucket-set.js +3 -20
  28. package/dist/m365/planner/commands/plan/plan-details-get.js +6 -14
  29. package/dist/m365/planner/commands/plan/plan-get.js +8 -18
  30. package/dist/m365/planner/commands/plan/plan-list.js +4 -12
  31. package/dist/m365/planner/commands/task/task-add.js +3 -16
  32. package/dist/m365/planner/commands/task/task-get.js +3 -21
  33. package/dist/m365/planner/commands/task/task-list.js +9 -23
  34. package/dist/m365/planner/commands/task/task-set.js +3 -17
  35. package/dist/m365/pp/commands/gateway/gateway-list.js +36 -0
  36. package/dist/m365/pp/commands/managementapp/managementapp-list.js +1 -1
  37. package/dist/m365/pp/commands.js +1 -0
  38. package/dist/m365/spo/commands/listitem/listitem-roleinheritance-break.js +83 -0
  39. package/dist/m365/spo/commands/listitem/listitem-roleinheritance-reset.js +79 -0
  40. package/dist/m365/spo/commands.js +2 -0
  41. package/dist/m365/teams/commands/app/app-list.js +1 -1
  42. package/dist/m365/teams/commands/channel/channel-list.js +1 -1
  43. package/dist/m365/teams/commands/channel/channel-member-add.js +4 -1
  44. package/dist/m365/teams/commands/channel/channel-member-list.js +1 -1
  45. package/dist/m365/teams/commands/channel/channel-member-remove.js +3 -0
  46. package/dist/m365/teams/commands/channel/channel-member-set.js +3 -0
  47. package/dist/m365/teams/commands/chat/chat-get.js +8 -8
  48. package/dist/m365/teams/commands/chat/chat-list.js +1 -1
  49. package/dist/m365/teams/commands/chat/chat-member-list.js +1 -1
  50. package/dist/m365/teams/commands/chat/chat-message-list.js +1 -1
  51. package/dist/m365/teams/commands/chat/chat-message-send.js +6 -6
  52. package/dist/m365/teams/commands/chat/chatUtil.js +4 -4
  53. package/dist/m365/teams/commands/message/message-list.js +1 -1
  54. package/dist/m365/teams/commands/message/message-reply-list.js +1 -1
  55. package/dist/m365/teams/commands/tab/tab-list.js +1 -1
  56. package/dist/m365/teams/commands/team/team-list.js +1 -1
  57. package/dist/m365/teams/commands/user/user-app-list.js +1 -1
  58. package/dist/m365/teams/commands/user/user-list.js +2 -2
  59. package/dist/m365/tenant/commands/serviceannouncement/serviceannouncement-healthissue-list.js +1 -1
  60. package/dist/m365/tenant/commands/serviceannouncement/serviceannouncement-message-list.js +1 -1
  61. package/dist/m365/todo/commands/list/list-list.js +1 -1
  62. package/dist/m365/todo/commands/task/task-list.js +1 -1
  63. package/dist/utils/odata.js +2 -2
  64. package/dist/utils/planner.js +65 -0
  65. package/docs/docs/cmd/aad/app/app-add.md +15 -0
  66. package/docs/docs/cmd/aad/app/app-set.md +17 -0
  67. package/docs/docs/cmd/pp/gateway/gateway-list.md +21 -0
  68. package/docs/docs/cmd/spo/listitem/listitem-roleinheritance-break.md +58 -0
  69. package/docs/docs/cmd/spo/listitem/listitem-roleinheritance-reset.md +39 -0
  70. package/package.json +1 -1
@@ -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, logger))
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, logger);
56
+ return utils_1.odata.getAllItems(endpoint);
57
57
  })
58
58
  .then((items) => {
59
59
  logger.log(items);
@@ -153,8 +153,11 @@ class TeamsChannelMemberAddCommand extends GraphCommand_1.default {
153
153
  if (!channelItem) {
154
154
  return Promise.reject(`The specified channel '${args.options.channelName}' does not exist in the Microsoft Teams team with ID '${teamId}'`);
155
155
  }
156
+ if (channelItem.membershipType !== "private") {
157
+ return Promise.reject(`The specified channel is not a private channel`);
158
+ }
156
159
  return Promise.resolve(channelItem.id);
157
- }, err => { return Promise.reject(err); });
160
+ });
158
161
  }
159
162
  getUserId(args) {
160
163
  if (args.options.userId) {
@@ -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, logger);
43
+ return utils_1.odata.getAllItems(endpoint);
44
44
  })
45
45
  .then((memberships) => {
46
46
  if (args.options.role) {
@@ -135,6 +135,9 @@ class TeamsChannelMemberRemoveCommand extends GraphCommand_1.default {
135
135
  if (!channelItem) {
136
136
  return Promise.reject(`The specified channel does not exist in the Microsoft Teams team`);
137
137
  }
138
+ if (channelItem.membershipType !== "private") {
139
+ return Promise.reject(`The specified channel is not a private channel`);
140
+ }
138
141
  return Promise.resolve(channelItem.id);
139
142
  });
140
143
  }
@@ -103,6 +103,9 @@ class TeamsChannelMemberSetCommand extends GraphCommand_1.default {
103
103
  if (!channelItem) {
104
104
  return Promise.reject(`The specified channel does not exist in the Microsoft Teams team`);
105
105
  }
106
+ if (channelItem.membershipType !== "private") {
107
+ return Promise.reject(`The specified channel is not a private channel`);
108
+ }
106
109
  return Promise.resolve(channelItem.id);
107
110
  });
108
111
  }
@@ -33,7 +33,7 @@ class TeamsChatGetCommand extends GraphCommand_1.default {
33
33
  }
34
34
  commandAction(logger, args, cb) {
35
35
  this
36
- .getChatId(logger, args)
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(logger, args) {
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, logger)
93
- : this.getChatIdByName(args.options.name, logger);
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, logger) {
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], logger);
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, logger) {
125
+ getChatIdByName(name) {
126
126
  return __awaiter(this, void 0, void 0, function* () {
127
- const existingChats = yield chatUtil_1.chatUtil.findExistingGroupChatsByName(name, logger);
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, logger)
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, logger)
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, logger)
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, logger)
97
- : this.getChatIdByName(args.options.chatName, logger);
96
+ ? this.ensureChatIdByUserEmails(args.options.userEmails)
97
+ : this.getChatIdByName(args.options.chatName);
98
98
  });
99
99
  }
100
- ensureChatIdByUserEmails(userEmailsOption, logger) {
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], logger);
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, logger) {
118
+ getChatIdByName(chatName) {
119
119
  return __awaiter(this, void 0, void 0, function* () {
120
- const existingChats = yield chatUtil_1.chatUtil.findExistingGroupChatsByName(chatName, logger);
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, logger) {
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, logger);
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, logger) {
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, logger);
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, logger)
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, logger)
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, logger)
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, logger)
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, logger);
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, logger).then((items) => {
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, logger);
56
+ return utils_1.odata.getAllItems(endpoint);
57
57
  }
58
58
  options() {
59
59
  const options = [
@@ -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, logger)
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, logger)
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`, logger)
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, logger);
48
+ return utils_1.odata.getAllItems(endpoint);
49
49
  })
50
50
  .then((items) => {
51
51
  if (args.options.output === 'json') {
@@ -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, logger, metadata) {
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, logger, metadata);
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
@@ -49,6 +49,15 @@ m365 aad app add [options]
49
49
  `--scopeAdminConsentDescription [scopeAdminConsentDescription]`
50
50
  : Scope admin consent description
51
51
 
52
+ `--certificateFile [certificateFile]`
53
+ : Path to the file with certificate public key. Specify either `certificateFile` or `certificateBase64Encoded`
54
+
55
+ `--certificateBase64Encoded [certificateBase64Encoded]`
56
+ : Base64-encoded string with certificate public key. Specify either `certificateFile` or `certificateBase64Encoded`
57
+
58
+ `--certificateDisplayName [certificateDisplayName]`
59
+ : Display name for the certificate. If not given, the displayName will be set to the certificate subject. When specified, also specify either `certificateFile` or `certificateBase64Encoded`
60
+
52
61
  `--manifest [manifest]`
53
62
  : Azure AD app manifest as retrieved from the Azure Portal to create the app registration from
54
63
 
@@ -152,3 +161,9 @@ Create new Azure AD app registration with the specified name. Store information
152
161
  ```sh
153
162
  m365 aad app add --name 'My AAD app' --save
154
163
  ```
164
+
165
+ Create new Azure AD app registration with a certificate
166
+
167
+ ```sh
168
+ m365 aad app add --name 'My AAD app' --certificateDisplayName "Some certificate name" --certificateFile c:\temp\some-certificate.cer
169
+ ```
@@ -31,6 +31,15 @@ m365 aad app set [options]
31
31
  `--redirectUrisToRemove [redirectUrisToRemove]`
32
32
  : Comma-separated list of existing redirect URIs to remove. Specify, when you want to replace existing redirect URIs with another
33
33
 
34
+ `--certificateFile [certificateFile]`
35
+ : Path to the file with certificate public key. Specify either `certificateFile` or `certificateBase64Encoded`
36
+
37
+ `--certificateBase64Encoded [certificateBase64Encoded]`
38
+ : Base64-encoded string with certificate public key. Specify either `certificateFile` or `certificateBase64Encoded`
39
+
40
+ `--certificateDisplayName [certificateDisplayName]`
41
+ : Display name for the certificate. If not given, the displayName will be set to the certificate subject. When specified, also specify either `certificateFile` or `certificateBase64Encoded`
42
+
34
43
  --8<-- "docs/cmd/_global.md"
35
44
 
36
45
  ## Remarks
@@ -39,6 +48,8 @@ For best performance use the `objectId` option to reference the Azure AD applica
39
48
 
40
49
  If the command finds multiple Azure AD application registrations with the specified app name, it will prompt you to disambiguate which app it should use, listing the discovered object IDs.
41
50
 
51
+ When a certificate is specified it will be added to the list of certificates of the app without changing existing certificates.
52
+
42
53
  ## Examples
43
54
 
44
55
  Update the app URI of the Azure AD application registration specified by its object ID
@@ -70,3 +81,9 @@ Replace one redirect URI with another for SPA authentication
70
81
  ```sh
71
82
  m365 aad app set --objectId 95cfe30d-ed44-4f9d-b73d-c66560f72e83 --redirectUris https://contoso.com/auth --platform spa --redirectUrisToRemove https://contoso.com/old-auth
72
83
  ```
84
+
85
+ Add a certificate to the app
86
+
87
+ ```sh
88
+ m365 aad app set --certificateDisplayName "Some certificate name" --certificateFile c:\temp\some-certificate.cer
89
+ ```
@@ -0,0 +1,21 @@
1
+ # pp gateway list
2
+
3
+ Returns a list of gateways for which the user is an admin
4
+
5
+ ## Usage
6
+
7
+ ```sh
8
+ m365 pp gateway list [options]
9
+ ```
10
+
11
+ ## Options
12
+
13
+ --8<-- "docs/cmd/_global.md"
14
+
15
+ ## Examples
16
+
17
+ List gateways for which the user is an admin
18
+
19
+ ```sh
20
+ m365 pp gateway list
21
+ ```
@@ -0,0 +1,58 @@
1
+ # spo listitem roleinheritance break
2
+
3
+ Break inheritance of list item.
4
+
5
+ ## Usage
6
+
7
+ ```sh
8
+ m365 spo listitem roleinheritance break [options]
9
+ ```
10
+
11
+ ## Options
12
+
13
+ `-u, --webUrl <webUrl>`
14
+ : URL of the site where the item for which to break role inheritance is located
15
+
16
+ `--listItemId <listItemId>`
17
+ : ID of the item for which to break role inheritance
18
+
19
+ `-l, --listId [listId]`
20
+ : ID of the list. Specify listId or listTitle but not both
21
+
22
+ `-t, --listTitle [listTitle]`
23
+ Title of the list. Specify listId or listTitle but not both
24
+
25
+ `-c, --clearExistingPermissions`
26
+ : Set to clear existing roles from the list item
27
+
28
+ --8<-- "docs/cmd/_global.md"
29
+
30
+ ## Remarks
31
+
32
+ By default, when breaking permissions inheritance, the list item will retain existing permissions. To remove existing permissions, use the `--clearExistingPermissions` option.
33
+
34
+ ## Examples
35
+
36
+ Break inheritance of list item _1_ in list _someList_ located in site _https://contoso.sharepoint.com/sites/project-x_
37
+
38
+ ```sh
39
+ m365 spo listitem roleinheritance break --webUrl "https://contoso.sharepoint.com/sites/project-x" --listTitle "_someList_" --id 1
40
+ ```
41
+
42
+ Break inheritance of list item _1_ in list with ID _202b8199-b9de-43fd-9737-7f213f51c991_ located in site _https://contoso.sharepoint.com/sites/project-x_
43
+
44
+ ```sh
45
+ m365 spo listitem roleinheritance break --webUrl https://contoso.sharepoint.com/sites/project-x --listId 202b8199-b9de-43fd-9737-7f213f51c991 --id 1
46
+ ```
47
+
48
+ Break inheritance of list item _1_ in list _someList_ located in site _https://contoso.sharepoint.com/sites/project-x_ with clearing permissions
49
+
50
+ ```sh
51
+ m365 spo listitem roleinheritance break --webUrl "https://contoso.sharepoint.com/sites/project-x" --listTitle "_someList_" --id 1 --clearExistingPermissions
52
+ ```
53
+
54
+ Break inheritance of list item _1_ in list with ID _202b8199-b9de-43fd-9737-7f213f51c991_ located in site _https://contoso.sharepoint.com/sites/project-x_ with clearing permissions
55
+
56
+ ```sh
57
+ m365 spo listitem roleinheritance break --webUrl https://contoso.sharepoint.com/sites/project-x --listId 202b8199-b9de-43fd-9737-7f213f51c991 --id 1 --clearExistingPermissions
58
+ ```
@@ -0,0 +1,39 @@
1
+ # spo listitem roleinheritance reset
2
+
3
+ Restores the role inheritance of list item, file, or folder
4
+
5
+ ## Usage
6
+
7
+ ```sh
8
+ m365 spo listitem roleinheritance reset [options]
9
+ ```
10
+
11
+ ## Options
12
+
13
+ `-u, --webUrl <webUrl>`
14
+ : URL of the site where the item for which to reset role inheritance is located
15
+
16
+ `--listItemId <listItemId>`
17
+ : ID of the item for which to reset role inheritance
18
+
19
+ `--listId [listId]`
20
+ : ID of the list. Specify listId or listTitle but not both
21
+
22
+ `--listTitle [listTitle]`
23
+ : Title of the list. Specify listId or listTitle but not both
24
+
25
+ --8<-- "docs/cmd/_global.md"
26
+
27
+ ## Examples
28
+
29
+ Restore role inheritance of list item with id 8 from list with ID _0cd891ef-afce-4e55-b836-fce03286cccf_ located in site _https://contoso.sharepoint.com/sites/project-x_
30
+
31
+ ```sh
32
+ m365 spo listitem roleinheritance reset --webUrl https://contoso.sharepoint.com/sites/project-x --listItemId 8 --listId 0cd891ef-afce-4e55-b836-fce03286cccf
33
+ ```
34
+
35
+ Restore role inheritance of list item with id 8 from list with title _test_ located in site _https://contoso.sharepoint.com/sites/project-x_
36
+
37
+ ```sh
38
+ m365 spo listitem roleinheritance reset --webUrl https://contoso.sharepoint.com/sites/project-x --listItemId 8 --listTitle test
39
+ ```
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pnp/cli-microsoft365",
3
- "version": "5.3.0-beta.4bf3837",
3
+ "version": "5.3.0-beta.7862300",
4
4
  "description": "Manage Microsoft 365 and SharePoint Framework projects on any platform",
5
5
  "license": "MIT",
6
6
  "main": "./dist/api.js",