@pnp/cli-microsoft365 5.0.0-beta.60ed6bc → 5.0.0-beta.6fb0d2a

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 (109) hide show
  1. package/.devcontainer/devcontainer.json +9 -1
  2. package/.eslintrc.js +1 -0
  3. package/README.md +1 -1
  4. package/dist/Utils.js +7 -0
  5. package/dist/appInsights.js +5 -2
  6. package/dist/cli/Cli.js +24 -4
  7. package/dist/m365/aad/commands/app/app-add.js +58 -5
  8. package/dist/m365/aad/commands/app/app-get.js +97 -0
  9. package/dist/m365/aad/commands/group/group-list.js +41 -0
  10. package/dist/m365/aad/commands/o365group/{GroupUser.js → GroupExtended.js} +1 -1
  11. package/dist/m365/aad/commands/o365group/o365group-add.js +56 -50
  12. package/dist/m365/aad/commands/o365group/o365group-user-set.js +3 -3
  13. package/dist/m365/aad/commands/oauth2grant/oauth2grant-list.js +4 -4
  14. package/dist/m365/aad/commands/oauth2grant/oauth2grant-remove.js +36 -12
  15. package/dist/m365/aad/commands/user/user-get.js +33 -6
  16. package/dist/m365/aad/commands/user/user-hibp.js +67 -0
  17. package/dist/m365/aad/commands/user/user-list.js +7 -4
  18. package/dist/m365/aad/commands/user/user-password-validate.js +42 -0
  19. package/dist/m365/aad/commands.js +4 -0
  20. package/dist/m365/app/commands/permission/permission-list.js +266 -0
  21. package/dist/m365/app/commands.js +7 -0
  22. package/dist/m365/base/AppCommand.js +76 -0
  23. package/dist/m365/{aad/commands/o365group/Group.js → base/M365RcJson.js} +1 -1
  24. package/dist/m365/cli/commands/cli-doctor.js +2 -0
  25. package/dist/m365/cli/commands/config/config-set.js +4 -1
  26. package/dist/m365/file/commands/file-list.js +181 -0
  27. package/dist/m365/file/commands.js +2 -1
  28. package/dist/m365/flow/commands/flow-get.js +2 -2
  29. package/dist/m365/pa/cds-project-mutator.js +1 -1
  30. package/dist/m365/pa/commands/app/app-list.js +28 -1
  31. package/dist/m365/planner/AppliedCategories.js +3 -0
  32. package/dist/m365/planner/commands/task/task-add.js +288 -0
  33. package/dist/m365/planner/commands/task/task-set.js +357 -0
  34. package/dist/m365/planner/commands.js +3 -1
  35. package/dist/m365/search/commands/externalconnection/externalconnection-add.js +99 -0
  36. package/dist/m365/search/commands.js +7 -0
  37. package/dist/m365/spfx/commands/project/project-upgrade/rules/FN006005_CFG_PS_metadata.js +63 -0
  38. package/dist/m365/spfx/commands/project/project-upgrade/rules/FN006006_CFG_PS_features.js +60 -0
  39. package/dist/m365/spfx/commands/project/project-upgrade/rules/FN014008_CODE_launch_hostedWorkbench_type.js +62 -0
  40. package/dist/m365/spfx/commands/project/project-upgrade/upgrade-1.13.1.js +53 -0
  41. package/dist/m365/spfx/commands/project/project-upgrade/upgrade-1.14.0-beta.5.js +59 -0
  42. package/dist/m365/spfx/commands/project/project-upgrade.js +17 -13
  43. package/dist/m365/spfx/commands/spfx-doctor.js +176 -62
  44. package/dist/m365/spo/commands/contenttype/contenttype-list.js +52 -0
  45. package/dist/m365/spo/commands/group/group-user-add.js +64 -13
  46. package/dist/m365/spo/commands/list/list-get.js +6 -2
  47. package/dist/m365/spo/commands/page/Page.js +3 -1
  48. package/dist/m365/spo/commands/page/page-add.js +7 -10
  49. package/dist/m365/spo/commands/page/page-set.js +7 -10
  50. package/dist/m365/spo/commands/site/site-ensure.js +1 -1
  51. package/dist/m365/spo/commands/site/site-recyclebinitem-list.js +76 -0
  52. package/dist/m365/spo/commands/site/site-remove.js +98 -30
  53. package/dist/m365/spo/commands/web/web-installedlanguage-list.js +48 -0
  54. package/dist/m365/spo/commands.js +4 -1
  55. package/dist/m365/teams/commands/app/app-list.js +9 -6
  56. package/dist/m365/teams/commands/chat/chat-list.js +43 -0
  57. package/dist/m365/teams/commands/chat/chat-member-list.js +42 -0
  58. package/dist/m365/teams/commands/chat/chat-message-list.js +60 -0
  59. package/dist/m365/teams/commands/message/message-get.js +1 -1
  60. package/dist/m365/teams/commands/report/report-directroutingcalls.js +1 -1
  61. package/dist/m365/teams/commands/tab/tab-get.js +9 -6
  62. package/dist/m365/teams/commands.js +3 -0
  63. package/dist/m365/tenant/commands/serviceannouncement/serviceannouncement-health-get.js +57 -0
  64. package/dist/m365/tenant/commands/serviceannouncement/serviceannouncement-health-list.js +56 -0
  65. package/dist/m365/tenant/commands/serviceannouncement/serviceannouncement-message-get.js +54 -0
  66. package/dist/m365/tenant/commands/serviceannouncement/serviceannouncement-message-list.js +46 -0
  67. package/dist/m365/tenant/commands.js +4 -0
  68. package/dist/request.js +9 -4
  69. package/dist/settingsNames.js +6 -1
  70. package/docs/docs/cmd/_global.md +2 -2
  71. package/docs/docs/cmd/aad/app/app-add.md +11 -0
  72. package/docs/docs/cmd/aad/app/app-get.md +48 -0
  73. package/docs/docs/cmd/aad/group/group-list.md +21 -0
  74. package/docs/docs/cmd/aad/o365group/o365group-add.md +1 -0
  75. package/docs/docs/cmd/aad/oauth2grant/oauth2grant-list.md +2 -2
  76. package/docs/docs/cmd/aad/oauth2grant/oauth2grant-remove.md +9 -0
  77. package/docs/docs/cmd/aad/user/user-get.md +13 -4
  78. package/docs/docs/cmd/aad/user/user-hibp.md +46 -0
  79. package/docs/docs/cmd/aad/user/user-list.md +9 -0
  80. package/docs/docs/cmd/aad/user/user-password-validate.md +29 -0
  81. package/docs/docs/cmd/app/permission/permission-list.md +36 -0
  82. package/docs/docs/cmd/file/file-list.md +46 -0
  83. package/docs/docs/cmd/pa/app/app-list.md +17 -1
  84. package/docs/docs/cmd/planner/task/task-add.md +78 -0
  85. package/docs/docs/cmd/planner/task/task-set.md +99 -0
  86. package/docs/docs/cmd/search/externalconnection/externalconnection-add.md +43 -0
  87. package/docs/docs/cmd/spfx/project/project-externalize.md +1 -1
  88. package/docs/docs/cmd/spfx/project/project-rename.md +1 -1
  89. package/docs/docs/cmd/spfx/project/project-upgrade.md +1 -1
  90. package/docs/docs/cmd/spfx/spfx-doctor.md +1 -1
  91. package/docs/docs/cmd/spo/contenttype/contenttype-list.md +33 -0
  92. package/docs/docs/cmd/spo/group/group-user-add.md +24 -6
  93. package/docs/docs/cmd/spo/list/list-get.md +9 -0
  94. package/docs/docs/cmd/spo/page/page-add.md +2 -2
  95. package/docs/docs/cmd/spo/page/page-set.md +3 -3
  96. package/docs/docs/cmd/spo/site/site-recyclebinitem-list.md +40 -0
  97. package/docs/docs/cmd/spo/site/site-remove.md +3 -1
  98. package/docs/docs/cmd/spo/web/web-installedlanguage-list.md +24 -0
  99. package/docs/docs/cmd/teams/chat/chat-list.md +30 -0
  100. package/docs/docs/cmd/teams/chat/chat-member-list.md +24 -0
  101. package/docs/docs/cmd/teams/chat/chat-message-list.md +24 -0
  102. package/docs/docs/cmd/teams/message/message-get.md +0 -3
  103. package/docs/docs/cmd/teams/report/report-directroutingcalls.md +0 -3
  104. package/docs/docs/cmd/tenant/serviceannouncement/serviceannouncement-health-get.md +33 -0
  105. package/docs/docs/cmd/tenant/serviceannouncement/serviceannouncement-health-list.md +30 -0
  106. package/docs/docs/cmd/tenant/serviceannouncement/serviceannouncement-message-get.md +28 -0
  107. package/docs/docs/cmd/tenant/serviceannouncement/serviceannouncement-message-list.md +34 -0
  108. package/npm-shrinkwrap.json +768 -976
  109. package/package.json +28 -21
@@ -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
  },
@@ -22,7 +22,7 @@ class TeamsReportDirectroutingcallsCommand extends GraphCommand_1.default {
22
22
  commandAction(logger, args, cb) {
23
23
  const toDateTimeParameter = encodeURIComponent(args.options.toDateTime ? args.options.toDateTime : new Date().toISOString());
24
24
  const requestOptions = {
25
- url: `${this.resource}/beta/communications/callRecords/getDirectRoutingCalls(fromDateTime=${encodeURIComponent(args.options.fromDateTime)},toDateTime=${toDateTimeParameter})`,
25
+ url: `${this.resource}/v1.0/communications/callRecords/getDirectRoutingCalls(fromDateTime=${encodeURIComponent(args.options.fromDateTime)},toDateTime=${toDateTimeParameter})`,
26
26
  headers: {
27
27
  accept: 'application/json;odata.metadata=none'
28
28
  },
@@ -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
@@ -0,0 +1,54 @@
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 TenantServiceAnnouncementMessageGetCommand extends GraphCommand_1.default {
7
+ get name() {
8
+ return commands_1.default.SERVICEANNOUNCEMENT_MESSAGE_GET;
9
+ }
10
+ get description() {
11
+ return 'Retrieves a specified service update message for the tenant';
12
+ }
13
+ defaultProperties() {
14
+ return ['startDateTime', 'endDateTime', 'lastModifiedDateTime', 'title', 'id', 'category', 'severity', 'tags', 'isMajorChange', 'actionRequiredByDateTime', 'services', 'expiryDateTime', 'hasAttachments', 'viewPoint'];
15
+ }
16
+ commandAction(logger, args, cb) {
17
+ if (this.verbose) {
18
+ logger.logToStderr(`Retrieving service update message ${args.id}`);
19
+ }
20
+ const requestOptions = {
21
+ url: `${this.resource}/v1.0/admin/serviceAnnouncement/messages/${args.options.id}`,
22
+ headers: {
23
+ accept: 'application/json;odata.metadata=none'
24
+ },
25
+ responseType: 'json'
26
+ };
27
+ request_1.default
28
+ .get(requestOptions)
29
+ .then((res) => {
30
+ logger.log(res);
31
+ cb();
32
+ }, (err) => this.handleRejectedODataJsonPromise(err, logger, cb));
33
+ }
34
+ options() {
35
+ const options = [
36
+ {
37
+ option: '-i, --id [id]'
38
+ }
39
+ ];
40
+ const parentOptions = super.options();
41
+ return options.concat(parentOptions);
42
+ }
43
+ isValidId(id) {
44
+ return (/MC\d{6}/).test(id);
45
+ }
46
+ validate(args) {
47
+ if (!this.isValidId(args.options.id)) {
48
+ return `${args.options.id} is not a valid message ID`;
49
+ }
50
+ return true;
51
+ }
52
+ }
53
+ module.exports = new TenantServiceAnnouncementMessageGetCommand();
54
+ //# sourceMappingURL=serviceannouncement-message-get.js.map
@@ -0,0 +1,46 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const request_1 = require("../../../../request");
4
+ const GraphItemsListCommand_1 = require("../../../base/GraphItemsListCommand");
5
+ const commands_1 = require("../../commands");
6
+ class TenantServiceAnnouncementMessageListCommand extends GraphItemsListCommand_1.GraphItemsListCommand {
7
+ get name() {
8
+ return commands_1.default.SERVICEANNOUNCEMENT_MESSAGE_LIST;
9
+ }
10
+ get description() {
11
+ return 'Gets all service update messages that exist for the tenant';
12
+ }
13
+ defaultProperties() {
14
+ return ['id', 'title'];
15
+ }
16
+ commandAction(logger, args, cb) {
17
+ let endpoint = `${this.resource}/v1.0/admin/serviceAnnouncement/messages`;
18
+ if (args.options.service) {
19
+ endpoint += `?$filter=services/any(c:c+eq+'${encodeURIComponent(args.options.service)}')`;
20
+ }
21
+ const requestOptions = {
22
+ url: endpoint,
23
+ headers: {
24
+ accept: 'application/json;odata.metadata=none'
25
+ },
26
+ responseType: 'json'
27
+ };
28
+ request_1.default
29
+ .get(requestOptions)
30
+ .then((res) => {
31
+ logger.log(res.value);
32
+ cb();
33
+ }, (err) => this.handleRejectedODataJsonPromise(err, logger, cb));
34
+ }
35
+ options() {
36
+ const options = [
37
+ {
38
+ option: '-s, --service [service] '
39
+ }
40
+ ];
41
+ const parentOptions = super.options();
42
+ return options.concat(parentOptions);
43
+ }
44
+ }
45
+ module.exports = new TenantServiceAnnouncementMessageListCommand();
46
+ //# sourceMappingURL=serviceannouncement-message-list.js.map
@@ -13,6 +13,10 @@ 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`,
18
+ SERVICEANNOUNCEMENT_MESSAGE_GET: `${prefix} serviceannouncement message get`,
19
+ SERVICEANNOUNCEMENT_MESSAGE_LIST: `${prefix} serviceannouncement message list`,
16
20
  STATUS_LIST: `${prefix} status list`
17
21
  };
18
22
  //# sourceMappingURL=commands.js.map
package/dist/request.js CHANGED
@@ -16,7 +16,9 @@ class Request {
16
16
  decompress: true,
17
17
  responseType: 'text',
18
18
  /* c8 ignore next */
19
- transformResponse: [data => data]
19
+ transformResponse: [data => data],
20
+ maxBodyLength: Infinity,
21
+ maxContentLength: Infinity
20
22
  });
21
23
  // since we're stubbing requests, request interceptor is never called in
22
24
  // tests, so let's exclude it from coverage
@@ -64,7 +66,7 @@ class Request {
64
66
  });
65
67
  // since we're stubbing requests, response interceptor is never called in
66
68
  // tests, so let's exclude it from coverage
67
- /* c8 ignore next 22 */
69
+ /* c8 ignore next 26 */
68
70
  this.req.interceptors.response.use((response) => {
69
71
  if (this._logger) {
70
72
  this._logger.logToStderr('Response:');
@@ -73,19 +75,22 @@ class Request {
73
75
  response.headers['content-type'].indexOf('json') > -1) {
74
76
  properties.push('data');
75
77
  }
76
- 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));
77
79
  }
78
80
  return response;
79
81
  }, (error) => {
80
82
  if (this._logger) {
81
83
  const properties = ['status', 'statusText', 'headers'];
82
84
  this._logger.logToStderr('Request error:');
83
- 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));
84
86
  }
85
87
  throw error;
86
88
  });
87
89
  }
88
90
  }
91
+ get logger() {
92
+ return this._logger;
93
+ }
89
94
  set logger(logger) {
90
95
  this._logger = logger;
91
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
@@ -52,6 +52,9 @@ m365 aad app add [options]
52
52
  `--manifest [manifest]`
53
53
  : Azure AD app manifest as retrieved from the Azure Portal to create the app registration from
54
54
 
55
+ `--save`
56
+ : Use to store the information about the created app in a local file
57
+
55
58
  --8<-- "docs/cmd/_global.md"
56
59
 
57
60
  ## Remarks
@@ -80,6 +83,8 @@ When using the `withSecret` option, this command will automatically generate a s
80
83
 
81
84
  After creating the Azure AD app registration, this command returns the app ID and object ID of the created app registration. If you used the `withSecret` option, it will also return the generated secret.
82
85
 
86
+ If you want to store the information about the created Azure AD app registration, use the `--save` option. This is useful when you build solutions connected to Microsoft 365 and want to easily manage app registrations used with your solution. When you use the `--save` option, after you create the app registration, the command will write its ID and name to the `.m365rc.json` file in the current directory. If the file already exists, it will add the information about the to it, allowing you to track multiple apps. If the file doesn't exist, the command will create it.
87
+
83
88
  ## Examples
84
89
 
85
90
  Create new Azure AD app registration with the specified name
@@ -141,3 +146,9 @@ Create new Azure AD app registration with Application ID URI set to a value that
141
146
  ```sh
142
147
  m365 aad app add --name 'My AAD app' --uri api://caf406b91cd4.ngrok.io/_appId_ --scopeName access_as_user --scopeAdminConsentDescription 'Access as a user' --scopeAdminConsentDisplayName 'Access as a user' --scopeConsentBy adminsAndUsers
143
148
  ```
149
+
150
+ Create new Azure AD app registration with the specified name. Store information about the created app registration in the _.m365rc.json_ file in the current directory.
151
+
152
+ ```sh
153
+ m365 aad app add --name 'My AAD app' --save
154
+ ```
@@ -0,0 +1,48 @@
1
+ # aad app get
2
+
3
+ Gets an Azure AD app registration
4
+
5
+ ## Usage
6
+
7
+ ```sh
8
+ m365 aad app get [options]
9
+ ```
10
+
11
+ ## Options
12
+
13
+ `--appId [appId]`
14
+ : Application (client) ID of the Azure AD application registration to get. Specify either `appId`, `objectId` or `name`
15
+
16
+ `--objectId [objectId]`
17
+ : Object ID of the Azure AD application registration to get. Specify either `appId`, `objectId` or `name`
18
+
19
+ `--name [name]`
20
+ : Name of the Azure AD application registration to get. Specify either `appId`, `objectId` or `name`
21
+
22
+ --8<-- "docs/cmd/_global.md"
23
+
24
+ ## Remarks
25
+
26
+ For best performance use the `objectId` option to reference the Azure AD application registration to update. If you use `appId` or `name`, this command will first need to find the corresponding object ID for that application.
27
+
28
+ 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.
29
+
30
+ ## Examples
31
+
32
+ Get the Azure AD application registration by its app (client) ID
33
+
34
+ ```sh
35
+ m365 aad app get --appId d75be2e1-0204-4f95-857d-51a37cf40be8
36
+ ```
37
+
38
+ Get the Azure AD application registration by its object ID
39
+
40
+ ```sh
41
+ m365 aad app get --objectId d75be2e1-0204-4f95-857d-51a37cf40be8
42
+ ```
43
+
44
+ Get the Azure AD application registration by its name
45
+
46
+ ```sh
47
+ m365 aad app get --name "My app"
48
+ ```
@@ -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
+ ```
@@ -36,6 +36,7 @@ m365 aad o365group add [options]
36
36
  ## Remarks
37
37
 
38
38
  When specifying the path to the logo image you can use both relative and absolute paths. Note, that ~ in the path, will not be resolved and will most likely result in an error.
39
+ If an invalid user is provided in the comma-separated list or Owners or Members, the command operation will fail and the Micrsoft 365 Group will not be created.
39
40
 
40
41
  ## Examples
41
42
 
@@ -10,7 +10,7 @@ m365 aad oauth2grant list [options]
10
10
 
11
11
  ## Options
12
12
 
13
- `-i, --clientId <clientId>`
13
+ `-i, --spObjectId <spObjectId>`
14
14
  : objectId of the service principal for which the configured OAuth2 permission grants should be retrieved
15
15
 
16
16
  --8<-- "docs/cmd/_global.md"
@@ -26,7 +26,7 @@ When using the text output type (default), the command lists only the values of
26
26
  List OAuth2 permissions granted to service principal with `objectId` _b2307a39-e878-458b-bc90-03bc578531d6_.
27
27
 
28
28
  ```sh
29
- m365 aad oauth2grant list --clientId b2307a39-e878-458b-bc90-03bc578531d6
29
+ m365 aad oauth2grant list --spObjectId b2307a39-e878-458b-bc90-03bc578531d6
30
30
  ```
31
31
 
32
32
  ## More information