@pnp/cli-microsoft365 5.0.0-beta.c797165 → 5.0.0-beta.c98b96c

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 (60) hide show
  1. package/.devcontainer/devcontainer.json +9 -1
  2. package/dist/Utils.js +7 -0
  3. package/dist/cli/Cli.js +20 -3
  4. package/dist/m365/aad/commands/group/group-list.js +41 -0
  5. package/dist/m365/aad/commands/o365group/{Group.js → GroupExtended.js} +1 -1
  6. package/dist/m365/aad/commands/o365group/o365group-user-set.js +3 -3
  7. package/dist/m365/aad/commands/user/user-get.js +33 -6
  8. package/dist/m365/aad/commands/user/user-hibp.js +67 -0
  9. package/dist/m365/aad/commands.js +2 -0
  10. package/dist/m365/app/commands/permission/permission-list.js +266 -0
  11. package/dist/m365/app/commands.js +7 -0
  12. package/dist/m365/base/AppCommand.js +76 -0
  13. package/dist/m365/cli/commands/config/config-set.js +4 -1
  14. package/dist/m365/flow/commands/flow-get.js +2 -2
  15. package/dist/m365/pa/cds-project-mutator.js +1 -1
  16. package/dist/m365/pa/commands/app/app-list.js +28 -1
  17. package/dist/m365/{aad/commands/o365group/GroupUser.js → planner/AppliedCategories.js} +1 -1
  18. package/dist/m365/planner/commands/task/task-add.js +288 -0
  19. package/dist/m365/planner/commands/task/task-set.js +357 -0
  20. package/dist/m365/planner/commands.js +3 -1
  21. package/dist/m365/spfx/commands/project/project-upgrade/rules/FN014008_CODE_launch_hostedWorkbench_type.js +62 -0
  22. package/dist/m365/spfx/commands/project/project-upgrade/{upgrade-1.14.0-beta.4.js → upgrade-1.14.0-beta.5.js} +27 -25
  23. package/dist/m365/spfx/commands/project/project-upgrade.js +1 -1
  24. package/dist/m365/spo/commands/group/group-user-add.js +64 -13
  25. package/dist/m365/spo/commands/site/site-ensure.js +1 -1
  26. package/dist/m365/spo/commands/site/site-recyclebinitem-list.js +76 -0
  27. package/dist/m365/spo/commands.js +1 -0
  28. package/dist/m365/teams/commands/app/app-list.js +9 -6
  29. package/dist/m365/teams/commands/chat/chat-list.js +43 -0
  30. package/dist/m365/teams/commands/chat/chat-member-list.js +42 -0
  31. package/dist/m365/teams/commands/chat/chat-message-list.js +60 -0
  32. package/dist/m365/teams/commands/message/message-get.js +1 -1
  33. package/dist/m365/teams/commands/tab/tab-get.js +9 -6
  34. package/dist/m365/teams/commands.js +3 -0
  35. package/dist/m365/tenant/commands/serviceannouncement/serviceannouncement-health-get.js +57 -0
  36. package/dist/m365/tenant/commands/serviceannouncement/serviceannouncement-health-list.js +56 -0
  37. package/dist/m365/tenant/commands.js +2 -0
  38. package/dist/request.js +6 -3
  39. package/dist/settingsNames.js +6 -1
  40. package/docs/docs/cmd/_global.md +2 -2
  41. package/docs/docs/cmd/aad/group/group-list.md +21 -0
  42. package/docs/docs/cmd/aad/user/user-get.md +13 -4
  43. package/docs/docs/cmd/aad/user/user-hibp.md +46 -0
  44. package/docs/docs/cmd/app/permission/permission-list.md +36 -0
  45. package/docs/docs/cmd/pa/app/app-list.md +17 -1
  46. package/docs/docs/cmd/planner/task/task-add.md +78 -0
  47. package/docs/docs/cmd/planner/task/task-set.md +99 -0
  48. package/docs/docs/cmd/spfx/project/project-externalize.md +1 -1
  49. package/docs/docs/cmd/spfx/project/project-rename.md +1 -1
  50. package/docs/docs/cmd/spfx/spfx-doctor.md +1 -1
  51. package/docs/docs/cmd/spo/group/group-user-add.md +24 -6
  52. package/docs/docs/cmd/spo/site/site-recyclebinitem-list.md +40 -0
  53. package/docs/docs/cmd/teams/chat/chat-list.md +30 -0
  54. package/docs/docs/cmd/teams/chat/chat-member-list.md +24 -0
  55. package/docs/docs/cmd/teams/chat/chat-message-list.md +24 -0
  56. package/docs/docs/cmd/teams/message/message-get.md +0 -3
  57. package/docs/docs/cmd/tenant/serviceannouncement/serviceannouncement-health-get.md +33 -0
  58. package/docs/docs/cmd/tenant/serviceannouncement/serviceannouncement-health-list.md +30 -0
  59. package/npm-shrinkwrap.json +270 -360
  60. package/package.json +21 -17
@@ -0,0 +1,76 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const request_1 = require("../../../../request");
4
+ const SpoCommand_1 = require("../../../base/SpoCommand");
5
+ const commands_1 = require("../../commands");
6
+ class SpoSiteRecycleBinItemListCommand extends SpoCommand_1.default {
7
+ get name() {
8
+ return commands_1.default.SITE_RECYCLEBINITEM_LIST;
9
+ }
10
+ get description() {
11
+ return 'Lists items from recycle bin';
12
+ }
13
+ defaultProperties() {
14
+ return ['Id', 'Title', 'DirName'];
15
+ }
16
+ commandAction(logger, args, cb) {
17
+ if (this.verbose) {
18
+ logger.logToStderr(`Retrieving all items from recycle bin at ${args.options.siteUrl}...`);
19
+ }
20
+ const state = args.options.secondary ? '2' : '1';
21
+ let requestUrl = `${args.options.siteUrl}/_api/site/RecycleBin?$filter=(ItemState eq ${state})`;
22
+ if (typeof args.options.type !== 'undefined') {
23
+ const type = SpoSiteRecycleBinItemListCommand.recycleBinItemType.find(item => item.value === args.options.type);
24
+ if (typeof type !== 'undefined') {
25
+ requestUrl += ` and (ItemType eq ${type.id})`;
26
+ }
27
+ }
28
+ const requestOptions = {
29
+ url: requestUrl,
30
+ headers: {
31
+ 'accept': 'application/json;odata=nometadata'
32
+ },
33
+ responseType: 'json'
34
+ };
35
+ request_1.default
36
+ .get(requestOptions)
37
+ .then((response) => {
38
+ logger.log(response.value);
39
+ cb();
40
+ }, (err) => this.handleRejectedODataJsonPromise(err, logger, cb));
41
+ }
42
+ options() {
43
+ const options = [
44
+ {
45
+ option: '-u, --siteUrl <siteUrl>'
46
+ },
47
+ {
48
+ option: '-t, --type [type]',
49
+ autocomplete: SpoSiteRecycleBinItemListCommand.recycleBinItemType.map(item => item.value)
50
+ },
51
+ {
52
+ option: '-s, --secondary'
53
+ }
54
+ ];
55
+ const parentOptions = super.options();
56
+ return options.concat(parentOptions);
57
+ }
58
+ validate(args) {
59
+ const isValidSharePointUrl = SpoCommand_1.default.isValidSharePointUrl(args.options.siteUrl);
60
+ if (isValidSharePointUrl !== true) {
61
+ return isValidSharePointUrl;
62
+ }
63
+ if (typeof args.options.type !== 'undefined' &&
64
+ !SpoSiteRecycleBinItemListCommand.recycleBinItemType.some(item => item.value === args.options.type)) {
65
+ return `${args.options.type} is not a valid value. Allowed values are ${SpoSiteRecycleBinItemListCommand.recycleBinItemType.map(item => item.value).join(', ')}`;
66
+ }
67
+ return true;
68
+ }
69
+ }
70
+ SpoSiteRecycleBinItemListCommand.recycleBinItemType = [
71
+ { id: 1, value: 'files' },
72
+ { id: 3, value: 'listItems' },
73
+ { id: 5, value: 'folders' }
74
+ ];
75
+ module.exports = new SpoSiteRecycleBinItemListCommand();
76
+ //# sourceMappingURL=site-recyclebinitem-list.js.map
@@ -183,6 +183,7 @@ exports.default = {
183
183
  SITE_GROUPIFY: `${prefix} site groupify`,
184
184
  SITE_LIST: `${prefix} site list`,
185
185
  SITE_INPLACERECORDSMANAGEMENT_SET: `${prefix} site inplacerecordsmanagement set`,
186
+ SITE_RECYCLEBINITEM_LIST: `${prefix} site recyclebinitem list`,
186
187
  SITE_REMOVE: `${prefix} site remove`,
187
188
  SITE_RENAME: `${prefix} site rename`,
188
189
  SITE_SET: `${prefix} site set`,
@@ -25,24 +25,27 @@ class TeamsAppListCommand extends GraphItemsListCommand_1.GraphItemsListCommand
25
25
  if (args.options.teamId) {
26
26
  return Promise.resolve(args.options.teamId);
27
27
  }
28
- const teamRequestOptions = {
29
- url: `${this.resource}/v1.0/me/joinedTeams?$filter=displayName eq '${encodeURIComponent(args.options.teamName)}'`,
28
+ const requestOptions = {
29
+ url: `${this.resource}/v1.0/groups?$filter=displayName eq '${encodeURIComponent(args.options.teamName)}'`,
30
30
  headers: {
31
31
  accept: 'application/json;odata.metadata=none'
32
32
  },
33
33
  responseType: 'json'
34
34
  };
35
35
  return request_1.default
36
- .get(teamRequestOptions)
36
+ .get(requestOptions)
37
37
  .then(response => {
38
- const teamItem = response.value[0];
39
- if (!teamItem) {
38
+ const groupItem = response.value[0];
39
+ if (!groupItem) {
40
+ return Promise.reject(`The specified team does not exist in the Microsoft Teams`);
41
+ }
42
+ if (groupItem.resourceProvisioningOptions.indexOf('Team') === -1) {
40
43
  return Promise.reject(`The specified team does not exist in the Microsoft Teams`);
41
44
  }
42
45
  if (response.value.length > 1) {
43
46
  return Promise.reject(`Multiple Microsoft Teams teams with name ${args.options.teamName} found: ${response.value.map(x => x.id)}`);
44
47
  }
45
- return Promise.resolve(teamItem.id);
48
+ return Promise.resolve(groupItem.id);
46
49
  });
47
50
  }
48
51
  getEndpointUrl(args) {
@@ -0,0 +1,43 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const GraphItemsListCommand_1 = require("../../../base/GraphItemsListCommand");
4
+ const commands_1 = require("../../commands");
5
+ class TeamsChatListCommand extends GraphItemsListCommand_1.GraphItemsListCommand {
6
+ get name() {
7
+ return commands_1.default.CHAT_LIST;
8
+ }
9
+ get description() {
10
+ return 'Lists all chat conversations';
11
+ }
12
+ defaultProperties() {
13
+ return ['id', 'topic', 'chatType'];
14
+ }
15
+ commandAction(logger, args, cb) {
16
+ const filter = args.options.type !== undefined ? `?$filter=chatType eq '${args.options.type}'` : '';
17
+ const endpoint = `${this.resource}/v1.0/chats${filter}`;
18
+ this
19
+ .getAllItems(endpoint, logger, true)
20
+ .then(() => {
21
+ logger.log(this.items);
22
+ cb();
23
+ }, (err) => this.handleRejectedODataJsonPromise(err, logger, cb));
24
+ }
25
+ options() {
26
+ const options = [
27
+ {
28
+ option: '-t, --type [chatType]'
29
+ }
30
+ ];
31
+ const parentOptions = super.options();
32
+ return options.concat(parentOptions);
33
+ }
34
+ validate(args) {
35
+ const supportedTypes = ['oneOnOne', 'group', 'meeting'];
36
+ if (args.options.type !== undefined && supportedTypes.indexOf(args.options.type) === -1) {
37
+ return `${args.options.type} is not a valid chatType. Accepted values are ${supportedTypes.join(', ')}`;
38
+ }
39
+ return true;
40
+ }
41
+ }
42
+ module.exports = new TeamsChatListCommand();
43
+ //# sourceMappingURL=chat-list.js.map
@@ -0,0 +1,42 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const Utils_1 = require("../../../../Utils");
4
+ const GraphItemsListCommand_1 = require("../../../base/GraphItemsListCommand");
5
+ const commands_1 = require("../../commands");
6
+ class TeamsChatMemberListCommand extends GraphItemsListCommand_1.GraphItemsListCommand {
7
+ get name() {
8
+ return commands_1.default.CHAT_MEMBER_LIST;
9
+ }
10
+ get description() {
11
+ return 'Lists all members from a chat';
12
+ }
13
+ defaultProperties() {
14
+ return ['userId', 'displayName', 'email'];
15
+ }
16
+ commandAction(logger, args, cb) {
17
+ const endpoint = `${this.resource}/v1.0/chats/${args.options.chatId}/members`;
18
+ this
19
+ .getAllItems(endpoint, logger, true)
20
+ .then(() => {
21
+ logger.log(this.items);
22
+ cb();
23
+ }, (err) => this.handleRejectedODataJsonPromise(err, logger, cb));
24
+ }
25
+ options() {
26
+ const options = [
27
+ {
28
+ option: '-i, --chatId <chatId>'
29
+ }
30
+ ];
31
+ const parentOptions = super.options();
32
+ return options.concat(parentOptions);
33
+ }
34
+ validate(args) {
35
+ if (!Utils_1.default.isValidTeamsChatId(args.options.chatId)) {
36
+ return `${args.options.chatId} is not a valid Teams ChatId`;
37
+ }
38
+ return true;
39
+ }
40
+ }
41
+ module.exports = new TeamsChatMemberListCommand();
42
+ //# sourceMappingURL=chat-member-list.js.map
@@ -0,0 +1,60 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const Utils_1 = require("../../../../Utils");
4
+ const GraphItemsListCommand_1 = require("../../../base/GraphItemsListCommand");
5
+ const commands_1 = require("../../commands");
6
+ class TeamsChatMessageListCommand extends GraphItemsListCommand_1.GraphItemsListCommand {
7
+ get name() {
8
+ return commands_1.default.CHAT_MESSAGE_LIST;
9
+ }
10
+ get description() {
11
+ return 'Lists all messages from a chat';
12
+ }
13
+ defaultProperties() {
14
+ return ['id', 'shortBody'];
15
+ }
16
+ commandAction(logger, args, cb) {
17
+ const endpoint = `${this.resource}/v1.0/chats/${args.options.chatId}/messages`;
18
+ this
19
+ .getAllItems(endpoint, logger, true)
20
+ .then(() => {
21
+ if (args.options.output !== 'json') {
22
+ this.items.forEach(i => {
23
+ // hoist the content to body for readability
24
+ i.body = i.body.content;
25
+ let shortBody;
26
+ const bodyToProcess = i.body;
27
+ if (bodyToProcess) {
28
+ let maxLength = 50;
29
+ let addedDots = '...';
30
+ if (bodyToProcess.length < maxLength) {
31
+ maxLength = bodyToProcess.length;
32
+ addedDots = '';
33
+ }
34
+ shortBody = bodyToProcess.replace(/\n/g, ' ').substring(0, maxLength) + addedDots;
35
+ }
36
+ i.shortBody = shortBody;
37
+ });
38
+ }
39
+ logger.log(this.items);
40
+ cb();
41
+ }, (err) => this.handleRejectedODataJsonPromise(err, logger, cb));
42
+ }
43
+ options() {
44
+ const options = [
45
+ {
46
+ option: '-i, --chatId <chatId>'
47
+ }
48
+ ];
49
+ const parentOptions = super.options();
50
+ return options.concat(parentOptions);
51
+ }
52
+ validate(args) {
53
+ if (!Utils_1.default.isValidTeamsChatId(args.options.chatId)) {
54
+ return `${args.options.chatId} is not a valid Teams chat ID`;
55
+ }
56
+ return true;
57
+ }
58
+ }
59
+ module.exports = new TeamsChatMessageListCommand();
60
+ //# sourceMappingURL=chat-message-list.js.map
@@ -13,7 +13,7 @@ class TeamsMessageGetCommand extends GraphCommand_1.default {
13
13
  }
14
14
  commandAction(logger, args, cb) {
15
15
  const requestOptions = {
16
- url: `${this.resource}/beta/teams/${args.options.teamId}/channels/${args.options.channelId}/messages/${args.options.messageId}`,
16
+ url: `${this.resource}/v1.0/teams/${args.options.teamId}/channels/${args.options.channelId}/messages/${args.options.messageId}`,
17
17
  headers: {
18
18
  accept: 'application/json;odata.metadata=none'
19
19
  },
@@ -30,24 +30,27 @@ class TeamsTabGetCommand extends GraphCommand_1.default {
30
30
  if (args.options.teamId) {
31
31
  return Promise.resolve(args.options.teamId);
32
32
  }
33
- const teamRequestOptions = {
34
- url: `${this.resource}/v1.0/me/joinedTeams?$filter=displayName eq '${encodeURIComponent(args.options.teamName)}'`,
33
+ const requestOptions = {
34
+ url: `${this.resource}/v1.0/groups?$filter=displayName eq '${encodeURIComponent(args.options.teamName)}'`,
35
35
  headers: {
36
36
  accept: 'application/json;odata.metadata=none'
37
37
  },
38
38
  responseType: 'json'
39
39
  };
40
40
  return request_1.default
41
- .get(teamRequestOptions)
41
+ .get(requestOptions)
42
42
  .then(response => {
43
- const teamItem = response.value[0];
44
- if (!teamItem) {
43
+ const groupItem = response.value[0];
44
+ if (!groupItem) {
45
+ return Promise.reject(`The specified team does not exist in the Microsoft Teams`);
46
+ }
47
+ if (groupItem.resourceProvisioningOptions.indexOf('Team') === -1) {
45
48
  return Promise.reject(`The specified team does not exist in the Microsoft Teams`);
46
49
  }
47
50
  if (response.value.length > 1) {
48
51
  return Promise.reject(`Multiple Microsoft Teams teams with name ${args.options.teamName} found: ${response.value.map(x => x.id)}`);
49
52
  }
50
- return Promise.resolve(teamItem.id);
53
+ return Promise.resolve(groupItem.id);
51
54
  });
52
55
  }
53
56
  getChannelId(args) {
@@ -13,6 +13,9 @@ exports.default = {
13
13
  CHANNEL_LIST: `${prefix} channel list`,
14
14
  CHANNEL_REMOVE: `${prefix} channel remove`,
15
15
  CHANNEL_SET: `${prefix} channel set`,
16
+ CHAT_LIST: `${prefix} chat list`,
17
+ CHAT_MEMBER_LIST: `${prefix} chat member list`,
18
+ CHAT_MESSAGE_LIST: `${prefix} chat message list`,
16
19
  CONVERSATIONMEMBER_ADD: `${prefix} conversationmember add`,
17
20
  CONVERSATIONMEMBER_LIST: `${prefix} conversationmember list`,
18
21
  FUNSETTINGS_LIST: `${prefix} funsettings list`,
@@ -0,0 +1,57 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const GraphCommand_1 = require("../../../base/GraphCommand");
4
+ const request_1 = require("../../../../request");
5
+ const commands_1 = require("../../commands");
6
+ class TenantServiceAnnouncementHealthGetCommand extends GraphCommand_1.default {
7
+ get name() {
8
+ return commands_1.default.SERVICEANNOUNCEMENT_HEALTH_GET;
9
+ }
10
+ get description() {
11
+ return 'This operation provides the health information of a specified service for a tenant';
12
+ }
13
+ getTelemetryProperties(args) {
14
+ const telemetryProps = super.getTelemetryProperties(args);
15
+ telemetryProps.issues = typeof args.options.issues !== 'undefined';
16
+ return telemetryProps;
17
+ }
18
+ defaultProperties() {
19
+ return ['id', 'status', 'service'];
20
+ }
21
+ commandAction(logger, args, cb) {
22
+ this
23
+ .getServiceHealth(args.options)
24
+ .then((res) => {
25
+ logger.log(res);
26
+ cb();
27
+ }, (err) => this.handleRejectedODataJsonPromise(err, logger, cb));
28
+ }
29
+ getServiceHealth(options) {
30
+ const requestOptions = {
31
+ url: `${this.resource}/v1.0/admin/serviceAnnouncement/healthOverviews/${options.serviceName}${options.issues && (!options.output || options.output.toLocaleLowerCase() === 'json') ? '?$expand=issues' : ''}`,
32
+ headers: {
33
+ accept: 'application/json;odata.metadata=none'
34
+ },
35
+ responseType: 'json'
36
+ };
37
+ return request_1.default
38
+ .get(requestOptions)
39
+ .then(response => {
40
+ const serviceHealth = response;
41
+ if (!serviceHealth) {
42
+ return Promise.reject(`Error fetching service health`);
43
+ }
44
+ return Promise.resolve(serviceHealth);
45
+ });
46
+ }
47
+ options() {
48
+ const options = [
49
+ { option: '-s, --serviceName <serviceName>' },
50
+ { option: '-i, --issues' }
51
+ ];
52
+ const parentOptions = super.options();
53
+ return options.concat(parentOptions);
54
+ }
55
+ }
56
+ module.exports = new TenantServiceAnnouncementHealthGetCommand();
57
+ //# sourceMappingURL=serviceannouncement-health-get.js.map
@@ -0,0 +1,56 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const GraphCommand_1 = require("../../../base/GraphCommand");
4
+ const request_1 = require("../../../../request");
5
+ const commands_1 = require("../../commands");
6
+ class TenantServiceAnnouncementHealthListCommand extends GraphCommand_1.default {
7
+ get name() {
8
+ return commands_1.default.SERVICEANNOUNCEMENT_HEALTH_LIST;
9
+ }
10
+ get description() {
11
+ return 'This operation provides the health report of all subscribed services for a tenant';
12
+ }
13
+ getTelemetryProperties(args) {
14
+ const telemetryProps = super.getTelemetryProperties(args);
15
+ telemetryProps.issues = typeof args.options.issues !== 'undefined';
16
+ return telemetryProps;
17
+ }
18
+ defaultProperties() {
19
+ return ['id', 'status', 'service'];
20
+ }
21
+ commandAction(logger, args, cb) {
22
+ this
23
+ .listServiceHealth(args.options)
24
+ .then((res) => {
25
+ logger.log(res);
26
+ cb();
27
+ }, (err) => this.handleRejectedODataJsonPromise(err, logger, cb));
28
+ }
29
+ listServiceHealth(options) {
30
+ const requestOptions = {
31
+ url: `${this.resource}/v1.0/admin/serviceAnnouncement/healthOverviews${options.issues && (!options.output || options.output.toLocaleLowerCase() === 'json') ? '?$expand=issues' : ''}`,
32
+ headers: {
33
+ accept: 'application/json;odata.metadata=none'
34
+ },
35
+ responseType: 'json'
36
+ };
37
+ return request_1.default
38
+ .get(requestOptions)
39
+ .then(response => {
40
+ const serviceHealthList = response.value;
41
+ if (!serviceHealthList) {
42
+ return Promise.reject(`Error fetching service health`);
43
+ }
44
+ return Promise.resolve(serviceHealthList);
45
+ });
46
+ }
47
+ options() {
48
+ const options = [
49
+ { option: '-i, --issues' }
50
+ ];
51
+ const parentOptions = super.options();
52
+ return options.concat(parentOptions);
53
+ }
54
+ }
55
+ module.exports = new TenantServiceAnnouncementHealthListCommand();
56
+ //# sourceMappingURL=serviceannouncement-health-list.js.map
@@ -13,6 +13,8 @@ exports.default = {
13
13
  SERVICE_LIST: `${prefix} service list`,
14
14
  SERVICE_MESSAGE_LIST: `${prefix} service message list`,
15
15
  SERVICE_REPORT_HISTORICALSERVICESTATUS: `${prefix} service report historicalservicestatus`,
16
+ SERVICEANNOUNCEMENT_HEALTH_GET: `${prefix} serviceannouncement health get`,
17
+ SERVICEANNOUNCEMENT_HEALTH_LIST: `${prefix} serviceannouncement health list`,
16
18
  STATUS_LIST: `${prefix} status list`
17
19
  };
18
20
  //# sourceMappingURL=commands.js.map
package/dist/request.js CHANGED
@@ -66,7 +66,7 @@ class Request {
66
66
  });
67
67
  // since we're stubbing requests, response interceptor is never called in
68
68
  // tests, so let's exclude it from coverage
69
- /* c8 ignore next 22 */
69
+ /* c8 ignore next 26 */
70
70
  this.req.interceptors.response.use((response) => {
71
71
  if (this._logger) {
72
72
  this._logger.logToStderr('Response:');
@@ -75,19 +75,22 @@ class Request {
75
75
  response.headers['content-type'].indexOf('json') > -1) {
76
76
  properties.push('data');
77
77
  }
78
- this._logger.logToStderr(JSON.stringify(Utils_1.default.filterObject(response, properties), null, 2));
78
+ this._logger.logToStderr(JSON.stringify(Object.assign({ url: response.config.url }, Utils_1.default.filterObject(response, properties)), null, 2));
79
79
  }
80
80
  return response;
81
81
  }, (error) => {
82
82
  if (this._logger) {
83
83
  const properties = ['status', 'statusText', 'headers'];
84
84
  this._logger.logToStderr('Request error:');
85
- this._logger.logToStderr(JSON.stringify(Object.assign(Object.assign({}, Utils_1.default.filterObject(error.response, properties)), { error: error.error }), null, 2));
85
+ this._logger.logToStderr(JSON.stringify(Object.assign(Object.assign({ url: error.config.url }, Utils_1.default.filterObject(error.response, properties)), { error: error.error }), null, 2));
86
86
  }
87
87
  throw error;
88
88
  });
89
89
  }
90
90
  }
91
+ get logger() {
92
+ return this._logger;
93
+ }
91
94
  set logger(logger) {
92
95
  this._logger = logger;
93
96
  }
@@ -5,7 +5,12 @@ const settingsNames = {
5
5
  errorOutput: 'errorOutput',
6
6
  output: 'output',
7
7
  printErrorsAsPlainText: 'printErrorsAsPlainText',
8
- showHelpOnFailure: 'showHelpOnFailure'
8
+ showHelpOnFailure: 'showHelpOnFailure',
9
+ csvHeader: 'csvHeader',
10
+ csvEscape: 'csvEscape',
11
+ csvQuote: 'csvQuote',
12
+ csvQuoted: 'csvQuoted',
13
+ csvQuotedEmpty: 'csvQuotedEmpty'
9
14
  };
10
15
  exports.settingsNames = settingsNames;
11
16
  //# sourceMappingURL=settingsNames.js.map
@@ -5,10 +5,10 @@
5
5
  : JMESPath query string. See [http://jmespath.org/](http://jmespath.org/) for more information and examples
6
6
 
7
7
  `-o, --output [output]`
8
- : Output type. `json,text`. Default `text`
8
+ : Output type. `json,text,csv`. Default `json`
9
9
 
10
10
  `--verbose`
11
11
  : Runs command with verbose logging
12
12
 
13
13
  `--debug`
14
- : Runs command with debug logging
14
+ : Runs command with debug logging
@@ -0,0 +1,21 @@
1
+ # aad group list
2
+
3
+ Lists Azure AD groups
4
+
5
+ ## Usage
6
+
7
+ ```sh
8
+ m365 aad group list [options]
9
+ ```
10
+
11
+ ## Options
12
+
13
+ --8<-- "docs/cmd/_global.md"
14
+
15
+ ## Examples
16
+
17
+ Lists all groups defined in Azure Active Directory.
18
+
19
+ ```sh
20
+ m365 aad group list
21
+ ```
@@ -11,10 +11,13 @@ m365 aad user get [options]
11
11
  ## Options
12
12
 
13
13
  `-i, --id [id]`
14
- : The ID of the user to retrieve information for. Specify `id` or `userName` but not both
14
+ : The ID of the user to retrieve information for. Use either `id`, `userName` or `email`, but not all.
15
15
 
16
16
  `-n, --userName [userName]`
17
- : The name of the user to retrieve information for. Specify `id` or `userName` but not both
17
+ : The name of the user to retrieve information for. Use either `id`, `userName` or `email`, but not all.
18
+
19
+ `--email [email]`
20
+ : The email of the user to retrieve information for. Use either `id`, `userName` or `email`, but not all.
18
21
 
19
22
  `-p, --properties [properties]`
20
23
  : Comma-separated list of properties to retrieve
@@ -23,9 +26,9 @@ m365 aad user get [options]
23
26
 
24
27
  ## Remarks
25
28
 
26
- You can retrieve information about a user, either by specifying that user's id or user name (`userPrincipalName`), but not both.
29
+ You can retrieve information about a user, either by specifying that user's id, user name (`userPrincipalName`), or email (`mail`), but not all.
27
30
 
28
- If the user with the specified id or user name doesn't exist, you will get a `Resource 'xyz' does not exist or one of its queried reference-property objects are not present.` error.
31
+ If the user with the specified id, user name, or email doesn't exist, you will get a `Resource 'xyz' does not exist or one of its queried reference-property objects are not present.` error.
29
32
 
30
33
  ## Examples
31
34
 
@@ -41,6 +44,12 @@ Get information about the user with user name _AarifS@contoso.onmicrosoft.com_
41
44
  m365 aad user get --userName AarifS@contoso.onmicrosoft.com
42
45
  ```
43
46
 
47
+ Get information about the user with email _AarifS@contoso.onmicrosoft.com_
48
+
49
+ ```sh
50
+ m365 aad user get --email AarifS@contoso.onmicrosoft.com
51
+ ```
52
+
44
53
  For the user with id _1caf7dcd-7e83-4c3a-94f7-932a1299c844_ retrieve the user name, e-mail address and full name
45
54
 
46
55
  ```sh
@@ -0,0 +1,46 @@
1
+ # aad user hibp
2
+
3
+ Allows you to retrieve all accounts that have been pwned with the specified username
4
+
5
+ ## Usage
6
+
7
+ ```sh
8
+ m365 aad user hibp [options]
9
+ ```
10
+
11
+ ## Options
12
+
13
+ `-n, --userName <userName>`
14
+ : The name of the user to retrieve information for.
15
+
16
+ `--apiKey, <apiKey>`
17
+ : Have I been pwned `API Key`. You can buy it from [https://haveibeenpwned.com/API/Key](https://haveibeenpwned.com/API/Key)
18
+
19
+ `--domain, [domain]`
20
+ : Limit the returned breaches only contain results with the domain specified.
21
+
22
+ --8<-- "docs/cmd/_global.md"
23
+
24
+ ## Remarks
25
+
26
+ If the user with the specified user name doesn't involved in any breach, you will get a `No pwnage found` message when running in debug or verbose mode.
27
+
28
+ If `API Key` is invalid, you will get a `Required option apiKey not specified` error.
29
+
30
+ ## Examples
31
+
32
+ Check if user with user name _account-exists@hibp-integration-tests.com_ is in a data breach
33
+
34
+ ```sh
35
+ m365 aad user hibp --userName account-exists@hibp-integration-tests.com --apiKey _YOUR-API-KEY_
36
+ ```
37
+
38
+ Check if user with user name _account-exists@hibp-integration-tests.com_ is in a data breach against the domain specified
39
+
40
+ ```sh
41
+ m365 aad user hibp --userName account-exists@hibp-integration-tests.com --apiKey _YOUR-API-KEY_ --domain adobe.com
42
+ ```
43
+
44
+ ## More information
45
+
46
+ - Have I been pwned API documentation: [https://haveibeenpwned.com/API/v3](https://haveibeenpwned.com/API/v3)
@@ -0,0 +1,36 @@
1
+ # app permission list
2
+
3
+ Lists API permissions for the current AAD app
4
+
5
+ ## Usage
6
+
7
+ ```sh
8
+ m365 app permission list [options]
9
+ ```
10
+
11
+ ## Options
12
+
13
+ `--appId [appId]`
14
+ : Client ID of the Azure AD app registered in the .m365rc.json file to retrieve API permissions for
15
+
16
+ --8<-- "docs/cmd/_global.md"
17
+
18
+ ## Remarks
19
+
20
+ Use this command to quickly look up API permissions for the Azure AD application registration registered in the .m365rc.json file in your current project (folder).
21
+
22
+ If you have multiple apps registered in your .m365rc.json file, you can specify the app for which you'd like to retrieve permissions using the `--appId` option. If you don't specify the app using the `--appId` option, you'll be prompted to select one of the applications from your .m365rc.json file.
23
+
24
+ ## Examples
25
+
26
+ Retrieve API permissions for your current Azure AD app
27
+
28
+ ```sh
29
+ m365 app permission list
30
+ ```
31
+
32
+ Retrieve API permissions for the Azure AD app with client ID _e23d235c-fcdf-45d1-ac5f-24ab2ee0695d_ specified in the _.m365rc.json_ file
33
+
34
+ ```sh
35
+ m365 app permission list --appId e23d235c-fcdf-45d1-ac5f-24ab2ee0695d
36
+ ```