@pnp/cli-microsoft365 5.0.0-beta.5a0b256 → 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.
@@ -15,6 +15,7 @@ class AadUserListCommand extends GraphItemsListCommand_1.GraphItemsListCommand {
15
15
  getTelemetryProperties(args) {
16
16
  const telemetryProps = super.getTelemetryProperties(args);
17
17
  telemetryProps.properties = args.options.properties;
18
+ telemetryProps.deleted = typeof args.options.deleted !== 'undefined';
18
19
  return telemetryProps;
19
20
  }
20
21
  commandAction(logger, args, cb) {
@@ -22,7 +23,8 @@ class AadUserListCommand extends GraphItemsListCommand_1.GraphItemsListCommand {
22
23
  args.options.properties.split(',').map(p => p.trim()) :
23
24
  ['userPrincipalName', 'displayName'];
24
25
  const filter = this.getFilter(args.options);
25
- const url = `${this.resource}/v1.0/users?$select=${properties.join(',')}${(filter.length > 0 ? '&' + filter : '')}&$top=100`;
26
+ const endpoint = args.options.deleted ? 'directory/deletedItems/microsoft.graph.user' : 'users';
27
+ const url = `${this.resource}/v1.0/${endpoint}?$select=${properties.join(',')}${(filter.length > 0 ? '&' + filter : '')}&$top=100`;
26
28
  this
27
29
  .getAllItems(url, logger, true)
28
30
  .then(() => {
@@ -35,6 +37,8 @@ class AadUserListCommand extends GraphItemsListCommand_1.GraphItemsListCommand {
35
37
  const excludeOptions = [
36
38
  'properties',
37
39
  'p',
40
+ 'deleted',
41
+ 'd',
38
42
  'debug',
39
43
  'verbose',
40
44
  'output',
@@ -55,9 +59,8 @@ class AadUserListCommand extends GraphItemsListCommand_1.GraphItemsListCommand {
55
59
  }
56
60
  options() {
57
61
  const options = [
58
- {
59
- option: '-p, --properties [properties]'
60
- }
62
+ { option: '-p, --properties [properties]' },
63
+ { option: '-d, --deleted' }
61
64
  ];
62
65
  const parentOptions = super.options();
63
66
  return options.concat(parentOptions);
@@ -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
@@ -13,6 +13,9 @@ m365 aad user list [options]
13
13
  `-p, --properties [properties]`
14
14
  : Comma-separated list of properties to retrieve
15
15
 
16
+ `-d, --deleted`
17
+ : Use to retrieve deleted users
18
+
16
19
  --8<-- "docs/cmd/_global.md"
17
20
 
18
21
  ## Remarks
@@ -31,6 +34,12 @@ List all users in the tenant
31
34
  m365 aad user list
32
35
  ```
33
36
 
37
+ List all recently deleted users in the tenant
38
+
39
+ ```sh
40
+ m365 aad user list --deleted
41
+ ```
42
+
34
43
  List all users in the tenant. For each one return the display name and e-mail address
35
44
 
36
45
  ```sh
@@ -0,0 +1,33 @@
1
+ # tenant service announcement health get
2
+
3
+ Get the health report of a specified service for a tenant
4
+
5
+ ## Usage
6
+
7
+ ```sh
8
+ m365 tenant serviceannouncement health get [options]
9
+ ```
10
+
11
+ ## Options
12
+
13
+ `-s, --serviceName <serviceName>`
14
+ : The service name to retrieve the health report for.
15
+
16
+ `-i, --issues`
17
+ : Return the collection of issues that happened on the service, with detailed information for each issue. Is only returned in JSON output mode.
18
+
19
+ --8<-- "docs/cmd/\_global.md"
20
+
21
+ ## Examples
22
+
23
+ Get the health report for the service _Exchange Online_
24
+
25
+ ```sh
26
+ m365 tenant serviceannouncement health get --serviceName "Exchange Online"
27
+ ```
28
+
29
+ Get the health report for the service _Exchange Online_ including the issues of the service
30
+
31
+ ```sh
32
+ m365 tenant serviceannouncement health get --serviceName "Exchange Online" --issues
33
+ ```
@@ -0,0 +1,30 @@
1
+ # tenant service announcement health list
2
+
3
+ Gets the health report of all subscribed services for a tenant
4
+
5
+ ## Usage
6
+
7
+ ```sh
8
+ m365 tenant serviceannouncement health list [options]
9
+ ```
10
+
11
+ ## Options
12
+
13
+ `-i, --issues`
14
+ : Return the collection of issues that happened on the service, with detailed information for each issue. Is only returned in JSON output mode.
15
+
16
+ --8<-- "docs/cmd/_global.md"
17
+
18
+ ## Examples
19
+
20
+ Get the health report of all subscribed services for a tenant
21
+
22
+ ```sh
23
+ m365 tenant serviceannouncement health list
24
+ ```
25
+
26
+ Get the health report of all subscribed services for a tenant including the issues that happend on each service
27
+
28
+ ```sh
29
+ m365 tenant serviceannouncement health list --issues
30
+ ```
@@ -0,0 +1,28 @@
1
+ # tenant serviceannouncement message get
2
+
3
+ Retrieves a specified service update message for the tenant
4
+
5
+ ## Usage
6
+
7
+ ```sh
8
+ m365 tenant serviceannouncement message get [options]
9
+ ```
10
+
11
+ ## Options
12
+
13
+ `-i, --id <id>`
14
+ : The ID of the service update message.
15
+
16
+ --8<-- "docs/cmd/_global.md"
17
+
18
+ ## Examples
19
+
20
+ Get service update message with ID MC001337
21
+
22
+ ```sh
23
+ m365 tenant serviceannouncement message get --id MC001337
24
+ ```
25
+
26
+ ## More information
27
+
28
+ - Microsoft Graph REST API reference: [https://docs.microsoft.com/en-us/graph/api/serviceupdatemessage-get](https://docs.microsoft.com/en-us/graph/api/serviceupdatemessage-get)
@@ -0,0 +1,34 @@
1
+ # tenant serviceannouncement message list
2
+
3
+ Gets all service update messages that exist for the tenant.
4
+
5
+ ## Usage
6
+
7
+ ```sh
8
+ m365 tenant serviceannouncement message list [options]
9
+ ```
10
+
11
+ ## Options
12
+
13
+ `-s, --service [service]`
14
+ : Retrieve service update messages for the particular service. If not provided, retrieves messages for all services
15
+
16
+ --8<-- "docs/cmd/_global.md"
17
+
18
+ ## Examples
19
+
20
+ Get service update messages of all services in Microsoft 365
21
+
22
+ ```sh
23
+ m365 tenant serviceannouncement message list
24
+ ```
25
+
26
+ Get service update messages for Microsoft Teams
27
+
28
+ ```sh
29
+ m365 tenant serviceannouncement message list --service "Microsoft Teams"
30
+ ```
31
+
32
+ ## More information
33
+
34
+ - List serviceAnnouncement messages: [https://docs.microsoft.com/en-us/graph/api/serviceannouncement-list-messages](https://docs.microsoft.com/en-us/graph/api/serviceannouncement-list-messages)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pnp/cli-microsoft365",
3
- "version": "5.0.0-beta.5a0b256",
3
+ "version": "5.0.0-beta.6fb0d2a",
4
4
  "description": "Manage Microsoft 365 and SharePoint Framework projects on any platform",
5
5
  "license": "MIT",
6
6
  "main": "./dist/index.js",