@pnp/cli-microsoft365 5.3.0-beta.d2ec1f4 → 5.3.0-beta.e83e121

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/.eslintrc.js CHANGED
@@ -29,6 +29,7 @@ const dictionary = [
29
29
  'home',
30
30
  'hub',
31
31
  'in',
32
+ 'inheritance',
32
33
  'init',
33
34
  'install',
34
35
  'installed',
@@ -22,29 +22,14 @@ class AadAppRoleAssignmentListCommand extends GraphCommand_1.default {
22
22
  return ['resourceDisplayName', 'roleName'];
23
23
  }
24
24
  commandAction(logger, args, cb) {
25
- let sp;
26
- // get the service principal associated with the appId
27
- let spMatchQuery = '';
28
- if (args.options.appId) {
29
- spMatchQuery = `appId eq '${encodeURIComponent(args.options.appId)}'`;
30
- }
31
- else if (args.options.objectId) {
32
- spMatchQuery = `id eq '${encodeURIComponent(args.options.objectId)}'`;
33
- }
34
- else {
35
- spMatchQuery = `displayName eq '${encodeURIComponent(args.options.displayName)}'`;
36
- }
37
- this
38
- .getServicePrincipalForApp(spMatchQuery)
39
- .then((resp) => {
40
- if (!resp.value.length) {
41
- return Promise.reject('app registration not found');
42
- }
43
- sp = resp.value[0];
25
+ let spAppRoleAssignments;
26
+ this.getAppRoleAssignments(args.options)
27
+ .then((appRoleAssignments) => {
28
+ spAppRoleAssignments = appRoleAssignments;
44
29
  // the role assignment has an appRoleId but no name. To get the name,
45
30
  // we need to get all the roles from the resource. the resource is
46
31
  // a service principal. Multiple roles may have same resource id.
47
- const resourceIds = sp.appRoleAssignments.map((item) => item.resourceId);
32
+ const resourceIds = appRoleAssignments.map((item) => item.resourceId);
48
33
  const tasks = [];
49
34
  for (let i = 0; i < resourceIds.length; i++) {
50
35
  tasks.push(this.getServicePrincipal(resourceIds[i]));
@@ -55,7 +40,7 @@ class AadAppRoleAssignmentListCommand extends GraphCommand_1.default {
55
40
  // loop through all appRoleAssignments for the servicePrincipal
56
41
  // and lookup the appRole.Id in the resources[resourceId].appRoles array...
57
42
  const results = [];
58
- sp.appRoleAssignments.map((appRoleAssignment) => {
43
+ spAppRoleAssignments.map((appRoleAssignment) => {
59
44
  const resource = resources.find((r) => r.id === appRoleAssignment.resourceId);
60
45
  if (resource) {
61
46
  const appRole = resource.appRoles.find((r) => r.id === appRoleAssignment.appRoleId);
@@ -65,7 +50,9 @@ class AadAppRoleAssignmentListCommand extends GraphCommand_1.default {
65
50
  resourceDisplayName: appRoleAssignment.resourceDisplayName,
66
51
  resourceId: appRoleAssignment.resourceId,
67
52
  roleId: appRole.id,
68
- roleName: appRole.value
53
+ roleName: appRole.value,
54
+ created: appRoleAssignment.createdDateTime,
55
+ deleted: appRoleAssignment.deletedDateTime
69
56
  });
70
57
  }
71
58
  }
@@ -74,6 +61,52 @@ class AadAppRoleAssignmentListCommand extends GraphCommand_1.default {
74
61
  cb();
75
62
  }, (err) => this.handleRejectedODataJsonPromise(err, logger, cb));
76
63
  }
64
+ getAppRoleAssignments(argOptions) {
65
+ return new Promise((resolve, reject) => {
66
+ if (argOptions.objectId) {
67
+ this.getSPAppRoleAssignments(argOptions.objectId)
68
+ .then((spAppRoleAssignments) => {
69
+ if (!spAppRoleAssignments.value.length) {
70
+ reject('no app role assignments found');
71
+ }
72
+ resolve(spAppRoleAssignments.value);
73
+ })
74
+ .catch((err) => {
75
+ reject(err);
76
+ });
77
+ }
78
+ else {
79
+ // Use existing way to get service principal object
80
+ let spMatchQuery = '';
81
+ if (argOptions.appId) {
82
+ spMatchQuery = `appId eq '${encodeURIComponent(argOptions.appId)}'`;
83
+ }
84
+ else {
85
+ spMatchQuery = `displayName eq '${encodeURIComponent(argOptions.displayName)}'`;
86
+ }
87
+ this.getServicePrincipalForApp(spMatchQuery)
88
+ .then((resp) => {
89
+ if (!resp.value.length) {
90
+ reject('app registration not found');
91
+ }
92
+ resolve(resp.value[0].appRoleAssignments);
93
+ })
94
+ .catch((err) => {
95
+ reject(err);
96
+ });
97
+ }
98
+ });
99
+ }
100
+ getSPAppRoleAssignments(spId) {
101
+ const spRequestOptions = {
102
+ url: `${this.resource}/v1.0/servicePrincipals/${spId}/appRoleAssignments`,
103
+ headers: {
104
+ accept: 'application/json'
105
+ },
106
+ responseType: 'json'
107
+ };
108
+ return request_1.default.get(spRequestOptions);
109
+ }
77
110
  getServicePrincipalForApp(filterParam) {
78
111
  const spRequestOptions = {
79
112
  url: `${this.resource}/v1.0/servicePrincipals?$expand=appRoleAssignments&$filter=${filterParam}`,
@@ -6,11 +6,11 @@ exports.default = {
6
6
  APP_DELETE: `${prefix} app delete`,
7
7
  APP_GET: `${prefix} app get`,
8
8
  APP_REMOVE: `${prefix} app remove`,
9
- APP_SET: `${prefix} app set`,
10
9
  APP_ROLE_ADD: `${prefix} app role add`,
11
10
  APP_ROLE_DELETE: `${prefix} app role delete`,
12
11
  APP_ROLE_LIST: `${prefix} app role list`,
13
12
  APP_ROLE_REMOVE: `${prefix} app role remove`,
13
+ APP_SET: `${prefix} app set`,
14
14
  APPROLEASSIGNMENT_ADD: `${prefix} approleassignment add`,
15
15
  APPROLEASSIGNMENT_LIST: `${prefix} approleassignment list`,
16
16
  APPROLEASSIGNMENT_REMOVE: `${prefix} approleassignment remove`,
@@ -0,0 +1,64 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const cli_1 = require("../../../cli");
4
+ const validation_1 = require("../../../utils/validation");
5
+ const settingsNames_1 = require("../../../settingsNames");
6
+ const AppCommand_1 = require("../../base/AppCommand");
7
+ const commands_1 = require("../commands");
8
+ class AppOpenCommand extends AppCommand_1.default {
9
+ get name() {
10
+ return commands_1.default.OPEN;
11
+ }
12
+ get description() {
13
+ return 'Opens Azure AD app in the Azure AD portal';
14
+ }
15
+ getTelemetryProperties(args) {
16
+ const telemetryProps = super.getTelemetryProperties(args);
17
+ telemetryProps.appId = typeof args.options.appId !== 'undefined';
18
+ telemetryProps.preview = typeof args.options.preview !== 'undefined';
19
+ return telemetryProps;
20
+ }
21
+ commandAction(logger, args, cb) {
22
+ this.logOrOpenUrl(args, logger)
23
+ .then(_ => cb(), (rawRes) => this.handleRejectedODataJsonPromise(rawRes, logger, cb));
24
+ }
25
+ logOrOpenUrl(args, logger) {
26
+ return new Promise((resolve, reject) => {
27
+ const previewPrefix = args.options.preview === true ? "preview." : "";
28
+ const url = `https://${previewPrefix}portal.azure.com/#blade/Microsoft_AAD_RegisteredApps/ApplicationMenuBlade/Overview/appId/${this.appId}/isMSAApp/`;
29
+ if (cli_1.Cli.getInstance().getSettingWithDefaultValue(settingsNames_1.settingsNames.autoOpenLinksInBrowser, false) === false) {
30
+ logger.log(`Use a web browser to open the page ${url}`);
31
+ return resolve();
32
+ }
33
+ logger.log(`Opening the following page in your browser: ${url}`);
34
+ // 'open' is required here so we can lazy load the dependency.
35
+ // _open is never set before hitting this line, but this check
36
+ // is implemented so that we can stub it when testing.
37
+ /* c8 ignore next 3 */
38
+ if (!this._open) {
39
+ this._open = require('open');
40
+ }
41
+ this._open(url).then(() => {
42
+ resolve();
43
+ }, (error) => {
44
+ reject(error);
45
+ });
46
+ });
47
+ }
48
+ options() {
49
+ const options = [
50
+ { option: '--appId [appId]' },
51
+ { option: '--preview' }
52
+ ];
53
+ const parentOptions = super.options();
54
+ return options.concat(parentOptions);
55
+ }
56
+ validate(args) {
57
+ if (args.options.appId && !validation_1.validation.isValidGuid(args.options.appId)) {
58
+ return `${args.options.appId} is not a valid GUID`;
59
+ }
60
+ return true;
61
+ }
62
+ }
63
+ module.exports = new AppOpenCommand();
64
+ //# sourceMappingURL=app-open.js.map
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const prefix = 'app';
4
4
  exports.default = {
5
5
  GET: `${prefix} get`,
6
+ OPEN: `${prefix} open`,
6
7
  PERMISSION_LIST: `${prefix} permission list`
7
8
  };
8
9
  //# sourceMappingURL=commands.js.map
@@ -0,0 +1,198 @@
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
+ const request_1 = require("../../../../request");
13
+ const utils_1 = require("../../../../utils");
14
+ const GraphCommand_1 = require("../../../base/GraphCommand");
15
+ const commands_1 = require("../../commands");
16
+ class PlannerBucketGetCommand extends GraphCommand_1.default {
17
+ get name() {
18
+ return commands_1.default.BUCKET_GET;
19
+ }
20
+ get description() {
21
+ return 'Gets the Microsoft Planner bucket in a plan';
22
+ }
23
+ getTelemetryProperties(args) {
24
+ const telemetryProps = super.getTelemetryProperties(args);
25
+ telemetryProps.id = typeof args.options.id !== 'undefined';
26
+ telemetryProps.name = typeof args.options.name !== 'undefined';
27
+ telemetryProps.planId = typeof args.options.planId !== 'undefined';
28
+ telemetryProps.planName = typeof args.options.planName !== 'undefined';
29
+ telemetryProps.ownerGroupId = typeof args.options.ownerGroupId !== 'undefined';
30
+ telemetryProps.ownerGroupName = typeof args.options.ownerGroupName !== 'undefined';
31
+ return telemetryProps;
32
+ }
33
+ commandAction(logger, args, cb) {
34
+ this
35
+ .getBucketId(args)
36
+ .then((bucketId) => this.getBucketById(bucketId))
37
+ .then((bucket) => {
38
+ logger.log(bucket);
39
+ cb();
40
+ }, (err) => this.handleRejectedODataJsonPromise(err, logger, cb));
41
+ }
42
+ getBucketId(args) {
43
+ const { id, name } = args.options;
44
+ if (id) {
45
+ return Promise.resolve(id);
46
+ }
47
+ return this
48
+ .getPlanId(args)
49
+ .then((planId) => {
50
+ const requestOptions = {
51
+ url: `${this.resource}/v1.0/planner/plans/${planId}/buckets`,
52
+ headers: {
53
+ accept: 'application/json;odata.metadata=none'
54
+ },
55
+ responseType: 'json'
56
+ };
57
+ return request_1.default.get(requestOptions);
58
+ })
59
+ .then(buckets => {
60
+ const filteredBuckets = buckets.value.filter(b => name.toLowerCase() === b.name.toLowerCase());
61
+ if (!filteredBuckets.length) {
62
+ return Promise.reject(`The specified bucket ${name} does not exist`);
63
+ }
64
+ if (filteredBuckets.length > 1) {
65
+ return Promise.reject(`Multiple buckets with name ${name} found: ${filteredBuckets.map(x => x.id)}`);
66
+ }
67
+ return Promise.resolve(filteredBuckets[0].id.toString());
68
+ });
69
+ }
70
+ getPlanId(args) {
71
+ const { planId, planName } = args.options;
72
+ if (planId) {
73
+ return Promise.resolve(planId);
74
+ }
75
+ return this
76
+ .getGroupId(args)
77
+ .then(groupId => {
78
+ const requestOptions = {
79
+ url: `${this.resource}/v1.0/planner/plans?$filter=owner eq '${groupId}'`,
80
+ headers: {
81
+ accept: 'application/json;odata.metadata=none'
82
+ },
83
+ responseType: 'json'
84
+ };
85
+ return request_1.default.get(requestOptions);
86
+ })
87
+ .then(plans => {
88
+ const filteredPlans = plans.value.filter(p => p.title.toLowerCase() === planName.toLowerCase());
89
+ if (filteredPlans.length === 0) {
90
+ return Promise.reject(`The specified plan ${planName} does not exist`);
91
+ }
92
+ if (filteredPlans.length > 1) {
93
+ return Promise.reject(`Multiple plans with name ${planName} found: ${filteredPlans.map(x => x.id)}`);
94
+ }
95
+ return Promise.resolve(filteredPlans[0].id);
96
+ });
97
+ }
98
+ getBucketById(id) {
99
+ return __awaiter(this, void 0, void 0, function* () {
100
+ const requestOptions = {
101
+ url: `${this.resource}/v1.0/planner/buckets/${id}`,
102
+ headers: {
103
+ accept: 'application/json'
104
+ },
105
+ responseType: 'json'
106
+ };
107
+ return request_1.default.get(requestOptions);
108
+ });
109
+ }
110
+ getGroupId(args) {
111
+ const { ownerGroupId, ownerGroupName } = args.options;
112
+ if (ownerGroupId) {
113
+ return Promise.resolve(ownerGroupId);
114
+ }
115
+ const requestOptions = {
116
+ url: `${this.resource}/v1.0/groups?$filter=displayName eq '${encodeURIComponent(ownerGroupName)}'`,
117
+ headers: {
118
+ accept: 'application/json;odata.metadata=none'
119
+ },
120
+ responseType: 'json'
121
+ };
122
+ return request_1.default
123
+ .get(requestOptions)
124
+ .then(response => {
125
+ if (!response.value.length) {
126
+ return Promise.reject(`The specified owner group ${ownerGroupName} does not exist`);
127
+ }
128
+ if (response.value.length > 1) {
129
+ return Promise.reject(`Multiple owner groups with name ${ownerGroupName} found: ${response.value.map(x => x.id)}`);
130
+ }
131
+ return Promise.resolve(response.value[0].id);
132
+ });
133
+ }
134
+ options() {
135
+ const options = [
136
+ {
137
+ option: '-i, --id [id]'
138
+ },
139
+ {
140
+ option: '--name [name]'
141
+ },
142
+ {
143
+ option: '--planId [planId]'
144
+ },
145
+ {
146
+ option: '--planName [planName]'
147
+ },
148
+ {
149
+ option: '--ownerGroupId [ownerGroupId]'
150
+ },
151
+ {
152
+ option: '--ownerGroupName [ownerGroupName]'
153
+ }
154
+ ];
155
+ const parentOptions = super.options();
156
+ return options.concat(parentOptions);
157
+ }
158
+ validate(args) {
159
+ if (args.options.id) {
160
+ if (args.options.planId || args.options.planName || args.options.ownerGroupId || args.options.ownerGroupName) {
161
+ return 'Don\'t specify planId, planName, ownerGroupId or ownerGroupName when using id';
162
+ }
163
+ if (args.options.name) {
164
+ return 'Specify either id or name';
165
+ }
166
+ }
167
+ if (args.options.name) {
168
+ if (!args.options.planId && !args.options.planName) {
169
+ return 'Specify either planId or planName when using name';
170
+ }
171
+ if (args.options.planId && args.options.planName) {
172
+ return 'Specify either planId or planName when using name but not both';
173
+ }
174
+ if (args.options.planName) {
175
+ if (!args.options.ownerGroupId && !args.options.ownerGroupName) {
176
+ return 'Specify either ownerGroupId or ownerGroupName when using planName';
177
+ }
178
+ if (args.options.ownerGroupId && args.options.ownerGroupName) {
179
+ return 'Specify either ownerGroupId or ownerGroupName when using planName but not both';
180
+ }
181
+ if (args.options.ownerGroupId && !utils_1.validation.isValidGuid(args.options.ownerGroupId)) {
182
+ return `${args.options.ownerGroupId} is not a valid GUID`;
183
+ }
184
+ }
185
+ if (args.options.planId) {
186
+ if (args.options.ownerGroupId || args.options.ownerGroupName) {
187
+ return 'Don\'t specify ownerGroupId or ownerGroupName when using planId';
188
+ }
189
+ }
190
+ }
191
+ if (!args.options.id && !args.options.name) {
192
+ return 'Please specify id or name';
193
+ }
194
+ return true;
195
+ }
196
+ }
197
+ module.exports = new PlannerBucketGetCommand();
198
+ //# sourceMappingURL=bucket-get.js.map
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const request_1 = require("../../../../request");
4
+ const utils_1 = require("../../../../utils");
4
5
  const GraphCommand_1 = require("../../../base/GraphCommand");
5
6
  const commands_1 = require("../../commands");
6
7
  class PlannerTaskGetCommand extends GraphCommand_1.default {
@@ -11,27 +12,169 @@ class PlannerTaskGetCommand extends GraphCommand_1.default {
11
12
  return 'Retrieve the the specified planner task';
12
13
  }
13
14
  commandAction(logger, args, cb) {
15
+ this
16
+ .getTaskId(args.options)
17
+ .then(taskId => {
18
+ const requestOptions = {
19
+ url: `${this.resource}/beta/planner/tasks/${encodeURIComponent(taskId)}`,
20
+ headers: {
21
+ accept: 'application/json;odata.metadata=none'
22
+ },
23
+ responseType: 'json'
24
+ };
25
+ return request_1.default.get(requestOptions);
26
+ })
27
+ .then((res) => {
28
+ logger.log(res);
29
+ cb();
30
+ }, (err) => this.handleRejectedODataJsonPromise(err, logger, cb));
31
+ }
32
+ getTaskId(options) {
33
+ if (options.id) {
34
+ return Promise.resolve(options.id);
35
+ }
36
+ return this
37
+ .getBucketId(options)
38
+ .then(bucketId => {
39
+ const requestOptions = {
40
+ url: `${this.resource}/v1.0/planner/buckets/${bucketId}/tasks?$select=id,title`,
41
+ headers: {
42
+ accept: 'application/json;odata.metadata=none'
43
+ },
44
+ responseType: 'json'
45
+ };
46
+ return request_1.default.get(requestOptions);
47
+ })
48
+ .then((response) => {
49
+ const title = options.title;
50
+ const tasks = response.value.filter(val => { var _a; return ((_a = val.title) === null || _a === void 0 ? void 0 : _a.toLocaleLowerCase()) === title.toLocaleLowerCase(); });
51
+ if (!tasks.length) {
52
+ return Promise.reject(`The specified task ${options.title} does not exist`);
53
+ }
54
+ if (tasks.length > 1) {
55
+ return Promise.reject(`Multiple tasks with title ${options.title} found: ${tasks.map(x => x.id)}`);
56
+ }
57
+ return Promise.resolve(tasks[0].id);
58
+ });
59
+ }
60
+ getBucketId(options) {
61
+ if (options.bucketId) {
62
+ return Promise.resolve(options.bucketId);
63
+ }
64
+ return this
65
+ .getPlanId(options)
66
+ .then(planId => {
67
+ const requestOptions = {
68
+ url: `${this.resource}/v1.0/planner/plans/${planId}/buckets?$select=id,name`,
69
+ headers: {
70
+ accept: 'application/json;odata.metadata=none'
71
+ },
72
+ responseType: 'json'
73
+ };
74
+ return request_1.default.get(requestOptions);
75
+ })
76
+ .then((response) => {
77
+ const bucketName = options.bucketName;
78
+ const buckets = response.value.filter(val => { var _a; return ((_a = val.name) === null || _a === void 0 ? void 0 : _a.toLocaleLowerCase()) === bucketName.toLocaleLowerCase(); });
79
+ if (!buckets.length) {
80
+ return Promise.reject(`The specified bucket ${options.bucketName} does not exist`);
81
+ }
82
+ if (buckets.length > 1) {
83
+ return Promise.reject(`Multiple buckets with name ${options.bucketName} found: ${buckets.map(x => x.id)}`);
84
+ }
85
+ return Promise.resolve(buckets[0].id);
86
+ });
87
+ }
88
+ getPlanId(options) {
89
+ if (options.planId) {
90
+ return Promise.resolve(options.planId);
91
+ }
92
+ return this
93
+ .getGroupId(options)
94
+ .then((groupId) => {
95
+ const requestOptions = {
96
+ url: `${this.resource}/v1.0/planner/plans?$filter=owner eq '${groupId}'&$select=id,title`,
97
+ headers: {
98
+ accept: 'application/json;odata.metadata=none'
99
+ },
100
+ responseType: 'json'
101
+ };
102
+ return request_1.default.get(requestOptions);
103
+ })
104
+ .then((response) => {
105
+ const planName = options.planName;
106
+ const plans = response.value.filter(val => { var _a; return ((_a = val.title) === null || _a === void 0 ? void 0 : _a.toLocaleLowerCase()) === planName.toLocaleLowerCase(); });
107
+ if (!plans.length) {
108
+ return Promise.reject(`The specified plan ${options.planName} does not exist`);
109
+ }
110
+ if (plans.length > 1) {
111
+ return Promise.reject(`Multiple plans with name ${options.planName} found: ${plans.map(x => x.id)}`);
112
+ }
113
+ return Promise.resolve(plans[0].id);
114
+ });
115
+ }
116
+ getGroupId(options) {
117
+ if (options.ownerGroupId) {
118
+ return Promise.resolve(options.ownerGroupId);
119
+ }
14
120
  const requestOptions = {
15
- url: `${this.resource}/beta/planner/tasks/${encodeURIComponent(args.options.id)}`,
121
+ url: `${this.resource}/v1.0/groups?$filter=displayName eq '${encodeURIComponent(options.ownerGroupName)}'&$select=id`,
16
122
  headers: {
17
123
  accept: 'application/json;odata.metadata=none'
18
124
  },
19
125
  responseType: 'json'
20
126
  };
21
- request_1.default
127
+ return request_1.default
22
128
  .get(requestOptions)
23
- .then((res) => {
24
- logger.log(res);
25
- cb();
26
- }, (err) => this.handleRejectedODataJsonPromise(err, logger, cb));
129
+ .then(response => {
130
+ const groups = response.value;
131
+ if (!groups.length) {
132
+ return Promise.reject(`The specified ownerGroup ${options.ownerGroupName} does not exist`);
133
+ }
134
+ if (groups.length > 1) {
135
+ return Promise.reject(`Multiple ownerGroups with name ${options.ownerGroupName} found: ${groups.map(x => x.id)}`);
136
+ }
137
+ return Promise.resolve(groups[0].id);
138
+ });
27
139
  }
28
140
  options() {
29
141
  const options = [
30
- { option: '-i, --id <id>' }
142
+ { option: '-i, --id [id]' },
143
+ { option: '-t, --title [title]' },
144
+ { option: '--bucketId [bucketId]' },
145
+ { option: '--bucketName [bucketName]' },
146
+ { option: '--planId [planId]' },
147
+ { option: '--planName [planName]' },
148
+ { option: '--ownerGroupId [ownerGroupId]' },
149
+ { option: '--ownerGroupName [ownerGroupName]' }
31
150
  ];
32
151
  const parentOptions = super.options();
33
152
  return options.concat(parentOptions);
34
153
  }
154
+ validate(args) {
155
+ if (args.options.title && !args.options.bucketId && !args.options.bucketName) {
156
+ return 'Specify either bucketId or bucketName when using title';
157
+ }
158
+ if (args.options.title && args.options.bucketId && args.options.bucketName) {
159
+ return 'Specify either bucketId or bucketName when using title but not both';
160
+ }
161
+ if (args.options.bucketName && !args.options.planId && !args.options.planName) {
162
+ return 'Specify either planId or planName when using bucketName';
163
+ }
164
+ if (args.options.bucketName && args.options.planId && args.options.planName) {
165
+ return 'Specify either planId or planName when using bucketName but not both';
166
+ }
167
+ if (args.options.planName && !args.options.ownerGroupId && !args.options.ownerGroupName) {
168
+ return 'Specify either ownerGroupId or ownerGroupName when using planName';
169
+ }
170
+ if (args.options.planName && args.options.ownerGroupId && args.options.ownerGroupName) {
171
+ return 'Specify either ownerGroupId or ownerGroupName when using planName but not both';
172
+ }
173
+ if (args.options.ownerGroupId && !utils_1.validation.isValidGuid(args.options.ownerGroupId)) {
174
+ return `${args.options.ownerGroupId} is not a valid GUID`;
175
+ }
176
+ return true;
177
+ }
35
178
  }
36
179
  module.exports = new PlannerTaskGetCommand();
37
180
  //# sourceMappingURL=task-get.js.map
@@ -6,6 +6,7 @@ exports.default = {
6
6
  BUCKET_LIST: `${prefix} bucket list`,
7
7
  BUCKET_SET: `${prefix} bucket set`,
8
8
  BUCKET_REMOVE: `${prefix} bucket remove`,
9
+ BUCKET_GET: `${prefix} bucket get`,
9
10
  PLAN_ADD: `${prefix} plan add`,
10
11
  PLAN_GET: `${prefix} plan get`,
11
12
  PLAN_DETAILS_GET: `${prefix} plan details get`,
@@ -0,0 +1,84 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const request_1 = require("../../../../request");
4
+ const utils_1 = require("../../../../utils");
5
+ const SpoCommand_1 = require("../../../base/SpoCommand");
6
+ const commands_1 = require("../../commands");
7
+ class SpoListRoleInheritanceBreakCommand extends SpoCommand_1.default {
8
+ get name() {
9
+ return commands_1.default.LIST_ROLEINHERITANCE_BREAK;
10
+ }
11
+ get description() {
12
+ return 'Breaks role inheritance on list or library';
13
+ }
14
+ optionSets() {
15
+ return [
16
+ ['listId', 'listTitle']
17
+ ];
18
+ }
19
+ getTelemetryProperties(args) {
20
+ const telemetryProps = super.getTelemetryProperties(args);
21
+ telemetryProps.listId = typeof args.options.listId !== 'undefined';
22
+ telemetryProps.listTitle = typeof args.options.listTitle !== 'undefined';
23
+ telemetryProps.clearExistingPermissions = args.options.clearExistingPermissions === true;
24
+ return telemetryProps;
25
+ }
26
+ commandAction(logger, args, cb) {
27
+ if (this.verbose) {
28
+ logger.logToStderr(`Breaking role inheritance of list in site at ${args.options.webUrl}...`);
29
+ }
30
+ let requestUrl = `${args.options.webUrl}/_api/web/lists`;
31
+ if (args.options.listId) {
32
+ requestUrl += `(guid'${encodeURIComponent(args.options.listId)}')`;
33
+ }
34
+ else {
35
+ requestUrl += `/getbytitle('${encodeURIComponent(args.options.listTitle)}')`;
36
+ }
37
+ let keepExistingPermissions = true;
38
+ if (args.options.clearExistingPermissions) {
39
+ keepExistingPermissions = !args.options.clearExistingPermissions;
40
+ }
41
+ const requestOptions = {
42
+ url: `${requestUrl}/breakroleinheritance(${keepExistingPermissions})`,
43
+ method: 'POST',
44
+ headers: {
45
+ 'accept': 'application/json;odata=nometadata',
46
+ 'content-type': 'application/json'
47
+ },
48
+ responseType: 'json'
49
+ };
50
+ request_1.default
51
+ .post(requestOptions)
52
+ .then(_ => cb(), (err) => this.handleRejectedODataJsonPromise(err, logger, cb));
53
+ }
54
+ options() {
55
+ const options = [
56
+ {
57
+ option: '-u, --webUrl <webUrl>'
58
+ },
59
+ {
60
+ option: '-i, --listId [listId]'
61
+ },
62
+ {
63
+ option: '-t, --listTitle [listTitle]'
64
+ },
65
+ {
66
+ option: '-c, --clearExistingPermissions'
67
+ }
68
+ ];
69
+ const parentOptions = super.options();
70
+ return options.concat(parentOptions);
71
+ }
72
+ validate(args) {
73
+ const isValidSharePointUrl = utils_1.validation.isValidSharePointUrl(args.options.webUrl);
74
+ if (isValidSharePointUrl !== true) {
75
+ return isValidSharePointUrl;
76
+ }
77
+ if (args.options.listId && !utils_1.validation.isValidGuid(args.options.listId)) {
78
+ return `${args.options.listId} is not a valid GUID`;
79
+ }
80
+ return true;
81
+ }
82
+ }
83
+ module.exports = new SpoListRoleInheritanceBreakCommand();
84
+ //# sourceMappingURL=list-roleinheritance-break.js.map
@@ -0,0 +1,76 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const request_1 = require("../../../../request");
4
+ const utils_1 = require("../../../../utils");
5
+ const SpoCommand_1 = require("../../../base/SpoCommand");
6
+ const commands_1 = require("../../commands");
7
+ class SpoListRoleInheritanceResetCommand extends SpoCommand_1.default {
8
+ get name() {
9
+ return commands_1.default.LIST_ROLEINHERITANCE_RESET;
10
+ }
11
+ get description() {
12
+ return 'Restores role inheritance on list or library';
13
+ }
14
+ optionSets() {
15
+ return [
16
+ ['listId', 'listTitle']
17
+ ];
18
+ }
19
+ getTelemetryProperties(args) {
20
+ const telemetryProps = super.getTelemetryProperties(args);
21
+ telemetryProps.listId = typeof args.options.listId !== 'undefined';
22
+ telemetryProps.listTitle = typeof args.options.listTitle !== 'undefined';
23
+ return telemetryProps;
24
+ }
25
+ commandAction(logger, args, cb) {
26
+ if (this.verbose) {
27
+ logger.logToStderr(`Restore role inheritance of list in site at ${args.options.webUrl}...`);
28
+ }
29
+ let requestUrl = `${args.options.webUrl}/_api/web/lists`;
30
+ if (args.options.listId) {
31
+ requestUrl += `(guid'${encodeURIComponent(args.options.listId)}')`;
32
+ }
33
+ else {
34
+ requestUrl += `/getbytitle('${encodeURIComponent(args.options.listTitle)}')`;
35
+ }
36
+ const requestOptions = {
37
+ url: `${requestUrl}/resetroleinheritance`,
38
+ method: 'POST',
39
+ headers: {
40
+ 'accept': 'application/json;odata=nometadata',
41
+ 'content-type': 'application/json'
42
+ },
43
+ responseType: 'json'
44
+ };
45
+ request_1.default
46
+ .post(requestOptions)
47
+ .then(_ => cb(), (err) => this.handleRejectedODataJsonPromise(err, logger, cb));
48
+ }
49
+ options() {
50
+ const options = [
51
+ {
52
+ option: '-u, --webUrl <webUrl>'
53
+ },
54
+ {
55
+ option: '-i, --listId [listId]'
56
+ },
57
+ {
58
+ option: '-t, --listTitle [listTitle]'
59
+ }
60
+ ];
61
+ const parentOptions = super.options();
62
+ return options.concat(parentOptions);
63
+ }
64
+ validate(args) {
65
+ const isValidSharePointUrl = utils_1.validation.isValidSharePointUrl(args.options.webUrl);
66
+ if (isValidSharePointUrl !== true) {
67
+ return isValidSharePointUrl;
68
+ }
69
+ if (args.options.listId && !utils_1.validation.isValidGuid(args.options.listId)) {
70
+ return `${args.options.listId} is not a valid GUID`;
71
+ }
72
+ return true;
73
+ }
74
+ }
75
+ module.exports = new SpoListRoleInheritanceResetCommand();
76
+ //# sourceMappingURL=list-roleinheritance-reset.js.map
@@ -0,0 +1,49 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const request_1 = require("../../../../request");
4
+ const utils_1 = require("../../../../utils");
5
+ const SpoCommand_1 = require("../../../base/SpoCommand");
6
+ const commands_1 = require("../../commands");
7
+ class SpoRoleDefinitionListCommand extends SpoCommand_1.default {
8
+ get name() {
9
+ return commands_1.default.ROLEDEFINITION_LIST;
10
+ }
11
+ get description() {
12
+ return 'Gets list of role definitions for the specified site';
13
+ }
14
+ defaultProperties() {
15
+ return ['Id', 'Name'];
16
+ }
17
+ commandAction(logger, args, cb) {
18
+ if (this.verbose) {
19
+ logger.logToStderr(`Getting role definitions list from ${args.options.webUrl}...`);
20
+ }
21
+ const requestOptions = {
22
+ url: `${args.options.webUrl}/_api/web/roledefinitions`,
23
+ headers: {
24
+ 'accept': 'application/json;odata=nometadata'
25
+ },
26
+ responseType: 'json'
27
+ };
28
+ request_1.default
29
+ .get(requestOptions)
30
+ .then((response) => {
31
+ logger.log(response.value);
32
+ cb();
33
+ }, (err) => this.handleRejectedODataJsonPromise(err, logger, cb));
34
+ }
35
+ options() {
36
+ const options = [
37
+ {
38
+ option: '-u, --webUrl <webUrl>'
39
+ }
40
+ ];
41
+ const parentOptions = super.options();
42
+ return options.concat(parentOptions);
43
+ }
44
+ validate(args) {
45
+ return utils_1.validation.isValidSharePointUrl(args.options.webUrl);
46
+ }
47
+ }
48
+ module.exports = new SpoRoleDefinitionListCommand();
49
+ //# sourceMappingURL=roledefinition-list.js.map
@@ -96,6 +96,8 @@ exports.default = {
96
96
  LIST_LABEL_SET: `${prefix} list label set`,
97
97
  LIST_LIST: `${prefix} list list`,
98
98
  LIST_REMOVE: `${prefix} list remove`,
99
+ LIST_ROLEINHERITANCE_BREAK: `${prefix} list roleinheritance break`,
100
+ LIST_ROLEINHERITANCE_RESET: `${prefix} list roleinheritance reset`,
99
101
  LIST_SET: `${prefix} list set`,
100
102
  LIST_SITESCRIPT_GET: `${prefix} list sitescript get`,
101
103
  LIST_VIEW_GET: `${prefix} list view get`,
@@ -160,6 +162,7 @@ exports.default = {
160
162
  REPORT_SITEUSAGEPAGES: `${prefix} report siteusagepages`,
161
163
  REPORT_SITEUSAGESITECOUNTS: `${prefix} report siteusagesitecounts`,
162
164
  REPORT_SITEUSAGESTORAGE: `${prefix} report siteusagestorage`,
165
+ ROLEDEFINITION_LIST: `${prefix} roledefinition list`,
163
166
  SEARCH: `${prefix} search`,
164
167
  SERVICEPRINCIPAL_GRANT_ADD: `${prefix} serviceprincipal grant add`,
165
168
  SERVICEPRINCIPAL_GRANT_LIST: `${prefix} serviceprincipal grant list`,
@@ -0,0 +1,71 @@
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 TenantSecurityAlertsListCommand extends GraphCommand_1.default {
7
+ get name() {
8
+ return commands_1.default.SECURITY_ALERTS_LIST;
9
+ }
10
+ get description() {
11
+ return 'Gets the security alerts for a tenant';
12
+ }
13
+ getTelemetryProperties(args) {
14
+ const telemetryProps = super.getTelemetryProperties(args);
15
+ telemetryProps.vendor = typeof args.options.vendor !== 'undefined';
16
+ return telemetryProps;
17
+ }
18
+ defaultProperties() {
19
+ return ['id', 'title', 'severity'];
20
+ }
21
+ commandAction(logger, args, cb) {
22
+ this
23
+ .listAlert(args.options)
24
+ .then((res) => {
25
+ logger.log(res);
26
+ cb();
27
+ }, (err) => this.handleRejectedODataJsonPromise(err, logger, cb));
28
+ }
29
+ listAlert(options) {
30
+ let queryFilter = '';
31
+ if (options.vendor) {
32
+ let vendorName = options.vendor;
33
+ switch (options.vendor.toLowerCase()) {
34
+ case 'azure security center':
35
+ vendorName = 'ASC';
36
+ break;
37
+ case 'microsoft cloud app security':
38
+ vendorName = 'MCAS';
39
+ break;
40
+ case 'azure active directory identity protection':
41
+ vendorName = 'IPC';
42
+ }
43
+ queryFilter = `?$filter=vendorInformation/provider eq '${encodeURIComponent(vendorName)}'`;
44
+ }
45
+ const requestOptions = {
46
+ url: `${this.resource}/v1.0/security/alerts${queryFilter}`,
47
+ headers: {
48
+ accept: 'application/json;odata.metadata=none'
49
+ },
50
+ responseType: 'json'
51
+ };
52
+ return request_1.default
53
+ .get(requestOptions)
54
+ .then(response => {
55
+ const alertList = response.value;
56
+ if (!alertList) {
57
+ return Promise.reject(`Error fetching security alerts`);
58
+ }
59
+ return Promise.resolve(alertList);
60
+ });
61
+ }
62
+ options() {
63
+ const options = [
64
+ { option: '--vendor [vendor]' }
65
+ ];
66
+ const parentOptions = super.options();
67
+ return options.concat(parentOptions);
68
+ }
69
+ }
70
+ module.exports = new TenantSecurityAlertsListCommand();
71
+ //# sourceMappingURL=security-alerts-list.js.map
@@ -9,6 +9,7 @@ exports.default = {
9
9
  REPORT_OFFICE365ACTIVATIONSUSERDETAIL: `${prefix} report office365activationsuserdetail`,
10
10
  REPORT_OFFICE365ACTIVATIONSUSERCOUNTS: `${prefix} report office365activationsusercounts`,
11
11
  REPORT_SERVICESUSERCOUNTS: `${prefix} report servicesusercounts`,
12
+ SECURITY_ALERTS_LIST: `${prefix} security alerts list`,
12
13
  SERVICEANNOUNCEMENT_HEALTHISSUE_GET: `${prefix} serviceannouncement healthissue get`,
13
14
  SERVICEANNOUNCEMENT_HEALTH_GET: `${prefix} serviceannouncement health get`,
14
15
  SERVICEANNOUNCEMENT_HEALTH_LIST: `${prefix} serviceannouncement health list`,
@@ -0,0 +1,45 @@
1
+ # aad app open
2
+
3
+ Returns deep link of the current AD app to open the Azure portal on the Azure AD app registration management page.
4
+
5
+ ## Usage
6
+
7
+ ```sh
8
+ m365 app open [options]
9
+ ```
10
+
11
+ ## Options
12
+
13
+ `--appId [appId]`
14
+ : Optional Application (client) ID of the Azure AD application registration to open. Uses the app from the `.m365rc.json` file corresponding to the `appId`. If multiple apps are available, this will evade the prompt to choose an app. If the `appId` is not available in the list of apps, an error is thrown.
15
+
16
+ `--preview`
17
+ : Use to open the url of the Azure AD preview portal.
18
+
19
+ --8<-- "docs/cmd/_global.md"
20
+
21
+ ## Remarks
22
+
23
+ If config setting `autoOpenLinksInBrowser` is configured to true, the command will automatically open the link to the Azure Portal in the browser.
24
+
25
+ Gets the app from the `.m365rc.json` file in the current directory. If the `--appId` option is not used and multiple apps are available, it will prompt the user to choose one.
26
+
27
+ ## Examples
28
+
29
+ Prints the URL to the Azure AD application registration management page on the Azure Portal.
30
+
31
+ ```sh
32
+ m365 app open
33
+ ```
34
+
35
+ Prints the url of the Azure AD application registration management page on the preview Azure Portal.
36
+
37
+ ```sh
38
+ m365 app open --preview
39
+ ```
40
+
41
+ Prints the URL to the Azure AD application registration management page on the Azure Portal, evading a possible choice prompt in the case of multiple saved apps in the `.m365rc.json` file.
42
+
43
+ ```sh
44
+ m365 app open --appId d75be2e1-0204-4f95-857d-51a37cf40be8
45
+ ```
@@ -0,0 +1,57 @@
1
+ # planner bucket get
2
+
3
+ Gets the Microsoft Planner bucket in a plan
4
+
5
+ ## Usage
6
+
7
+ ```sh
8
+ m365 planner bucket get [options]
9
+ ```
10
+
11
+ ## Options
12
+
13
+ `-i, --id [id]`
14
+ : ID of the bucket to retrieve details. Specify either `id` or `name` but not both.
15
+
16
+ `-name, --name [name]`
17
+ : Name of the bucket to retrieve details. Specify either `id` or `name` but not both.
18
+
19
+ `--planId [planId]`
20
+ : Plan ID to which the bucket belongs. Specify either `planId` or `planName` when using `name`.
21
+
22
+ `--planName [planName]`
23
+ : Plan Name to which the bucket belongs. Specify either `planId` or `planName` when using `name`.
24
+
25
+ `--ownerGroupId [ownerGroupId]`
26
+ : ID of the group to which the plan belongs. Specify `ownerGroupId` or `ownerGroupName` when using `planName`.
27
+
28
+ `--ownerGroupName [ownerGroupName]`
29
+ : Name of the group to which the plan belongs. Specify `ownerGroupId` or `ownerGroupName` when using `planName`.
30
+
31
+ --8<-- "docs/cmd/_global.md"
32
+
33
+ ## Examples
34
+
35
+ Gets the specified Microsoft Planner bucket
36
+
37
+ ```sh
38
+ m365 planner bucket get --id "5h1uuYFk4kKQ0hfoTUkRLpgALtYi"
39
+ ```
40
+
41
+ Gets the Microsoft Planner bucket in the PlanId xqQg5FS2LkCp935s-FIFm2QAFkHM
42
+
43
+ ```sh
44
+ m365 planner bucket get --name "Planner Bucket A" --planId "xqQg5FS2LkCp935s-FIFm2QAFkHM"
45
+ ```
46
+
47
+ Gets the Microsoft Planner bucket in the Plan _My Plan_ owned by group _My Group_
48
+
49
+ ```sh
50
+ m365 planner bucket get --name "Planner Bucket A" --planName "My Plan" --ownerGroupName "My Group"
51
+ ```
52
+
53
+ Gets the Microsoft Planner bucket in the Plan _My Plan_ owned by groupId ee0f40fc-b2f7-45c7-b62d-11b90dd2ea8e
54
+
55
+ ```sh
56
+ m365 planner bucket get --name "Planner Bucket A" --planName "My Plan" --ownerGroupId "ee0f40fc-b2f7-45c7-b62d-11b90dd2ea8e"
57
+ ```
@@ -10,8 +10,29 @@ m365 planner task get [options]
10
10
 
11
11
  ## Options
12
12
 
13
- `-i, --id <id>`
14
- : ID of the task to retrieve details from
13
+ `-i, --id [id]`
14
+ : ID of the task. Specify either `id` or `title` but not both. When you specify the task ID, you no longer need to provide the information for `bucket`, `plan`, and `ownerGroup`.
15
+
16
+ `-t, --title [title]`
17
+ : Title of the task. Specify either `id` or `title` but not both.
18
+
19
+ `--bucketId [bucketId]`
20
+ : Bucket ID to which the task belongs. Specify `bucketId` or `bucketName` when using `title`.
21
+
22
+ `--bucketName [bucketName]`
23
+ : Bucket Name to which the task belongs. Specify `bucketId` or `bucketName` when using `title`.
24
+
25
+ `--planId [planId]`
26
+ : Plan ID to which the task belongs. Specify `planId` or `planName` when using `bucketName`.
27
+
28
+ `--planName [planName]`
29
+ : Plan Name to which the task belongs. Specify `planId` or `planName` when using `bucketName`.
30
+
31
+ `--ownerGroupId [ownerGroupId]`
32
+ : ID of the group to which the plan belongs. Specify `ownerGroupId` or `ownerGroupName` when using `planName`.
33
+
34
+ `--ownerGroupName [ownerGroupName]`
35
+ : Name of the group to which the plan belongs. Specify `ownerGroupId` or `ownerGroupName` when using `planName`.
15
36
 
16
37
  --8<-- "docs/cmd/_global.md"
17
38
 
@@ -22,8 +43,14 @@ m365 planner task get [options]
22
43
 
23
44
  ## Examples
24
45
 
25
- Retrieve the the specified planner task
46
+ Retrieve the the specified planner task by id.
26
47
 
27
48
  ```sh
28
49
  m365 planner task get --id 'vzCcZoOv-U27PwydxHB8opcADJo-'
29
50
  ```
51
+
52
+ Retrieve the the specified planner task with the title _My Planner Task_ from the bucket named _My Planner Bucket_. Based on the plan with the name _My Planner Plan_ owned by the group _My Planner Group_.
53
+
54
+ ```sh
55
+ m365 planner task get --title "My Planner Task" --bucketName "My Planner Bucket" --planName "My Planner Plan" --ownerGroupName "My Planner Group"
56
+ ```
@@ -0,0 +1,55 @@
1
+ # spo list roleinheritance break
2
+
3
+ Breaks role inheritance on list or library
4
+
5
+ ## Usage
6
+
7
+ ```sh
8
+ m365 spo list roleinheritance break [options]
9
+ ```
10
+
11
+ ## Options
12
+
13
+ `-u, --webUrl <webUrl>`
14
+ : URL of the site where the list to retrieve is located
15
+
16
+ `-i, --listId [listId]`
17
+ : ID of the list to retrieve information for. Specify either id or title but not both
18
+
19
+ `-t, --listTitle [listTitle]`
20
+ : Title of the list to retrieve information for. Specify either id or title but not both
21
+
22
+ `-c, --clearExistingPermissions`
23
+ : Flag if used clears all roles from the list
24
+
25
+ --8<-- "docs/cmd/_global.md"
26
+
27
+ ## Remarks
28
+
29
+ By default, when breaking permissions inheritance, the list will retain existing permissions. To remove existing permissions, use the `--clearExistingPermissions` option.
30
+
31
+ ## Examples
32
+
33
+ Break inheritance of list _someList_ located in site _https://contoso.sharepoint.com/sites/project-x_
34
+
35
+ ```sh
36
+ m365 spo list roleinheritance break --webUrl "https://contoso.sharepoint.com/sites/project-x" --listTitle "someList"
37
+ ```
38
+
39
+ Break inheritance of list with ID _202b8199-b9de-43fd-9737-7f213f51c991_ located in site _https://contoso.sharepoint.com/sites/project-x_
40
+
41
+ ```sh
42
+ m365 spo list roleinheritance break --webUrl "https://contoso.sharepoint.com/sites/project-x" --listId "202b8199-b9de-43fd-9737-7f213f51c991"
43
+ ```
44
+
45
+ Break inheritance of list _someList_ located in site _https://contoso.sharepoint.com/sites/project-x_ with clearing permissions
46
+
47
+ ```sh
48
+ m365 spo list roleinheritance break --webUrl "https://contoso.sharepoint.com/sites/project-x" --listTitle "someList" --clearExistingPermissions
49
+ ```
50
+
51
+ Break inheritance of list with ID _202b8199-b9de-43fd-9737-7f213f51c991_ located in site _https://contoso.sharepoint.com/sites/project-x_ with clearing permissions
52
+
53
+ ```sh
54
+ m365 spo list roleinheritance break --webUrl "https://contoso.sharepoint.com/sites/project-x" --listId "202b8199-b9de-43fd-9737-7f213f51c991" --clearExistingPermissions
55
+ ```
@@ -0,0 +1,36 @@
1
+ # spo list roleinheritance reset
2
+
3
+ Restores role inheritance on list or library
4
+
5
+ ## Usage
6
+
7
+ ```sh
8
+ m365 spo list roleinheritance reset [options]
9
+ ```
10
+
11
+ ## Options
12
+
13
+ `-u, --webUrl <webUrl>`
14
+ : URL of the site where the list is located
15
+
16
+ `-i, --listId [listId]`
17
+ : ID of the list. Specify either id or title but not both
18
+
19
+ `-t, --listTitle [listTitle]`
20
+ : Title of the list. Specify either id or title but not both
21
+
22
+ --8<-- "docs/cmd/_global.md"
23
+
24
+ ## Examples
25
+
26
+ Restore role inheritance of list with ID _0cd891ef-afce-4e55-b836-fce03286cccf_ located in site _https://contoso.sharepoint.com/sites/project-x_
27
+
28
+ ```sh
29
+ m365 spo list roleinheritance reset --webUrl https://contoso.sharepoint.com/sites/project-x --listId 0cd891ef-afce-4e55-b836-fce03286cccf
30
+ ```
31
+
32
+ Restore role inheritance of list with title _test_ located in site _https://contoso.sharepoint.com/sites/project-x_
33
+
34
+ ```sh
35
+ m365 spo list roleinheritance reset --webUrl https://contoso.sharepoint.com/sites/project-x --listTitle test
36
+ ```
@@ -0,0 +1,24 @@
1
+ # spo roledefinition list
2
+
3
+ Gets list of role definitions for the specified site
4
+
5
+ ## Usage
6
+
7
+ ```sh
8
+ m365 spo roledefinition list [options]
9
+ ```
10
+
11
+ ## Options
12
+
13
+ `-u, --webUrl <webUrl>`
14
+ : URL of the site for which to retrieve role definitions
15
+
16
+ --8<-- "docs/cmd/_global.md"
17
+
18
+ ## Examples
19
+
20
+ Return list of role definitions for site _https://contoso.sharepoint.com/sites/project-x_
21
+
22
+ ```sh
23
+ m365 spo roledefinition list --webUrl https://contoso.sharepoint.com/sites/project-x
24
+ ```
@@ -35,10 +35,10 @@ m365 teams conversationmember list [options]
35
35
 
36
36
  ## Examples
37
37
 
38
- List the members of a specified Microsoft Teams team with id 00000000-0000-0000-0000-000000000000 and channel id 00:00000000000000000000000000000000@thread.skype
38
+ List the members of a specified Microsoft Teams team with id 00000000-0000-0000-0000-000000000000 and channel id 19:00000000000000000000000000000000@thread.skype
39
39
 
40
40
  ```sh
41
- m365 teams channel member list --teamId 00000000-0000-0000-0000-000000000000 --channelId 00:00000000000000000000000000000000@thread.skype
41
+ m365 teams channel member list --teamId 00000000-0000-0000-0000-000000000000 --channelId 19:00000000000000000000000000000000@thread.skype
42
42
  ```
43
43
 
44
44
  List the members of a specified Microsoft Teams team with name _Team Name_ and channel with name _Channel Name_
@@ -47,8 +47,8 @@ List the members of a specified Microsoft Teams team with name _Team Name_ and c
47
47
  m365 teams channel member list --teamName "Team Name" --channelName "Channel Name"
48
48
  ```
49
49
 
50
- List all owners of the specified Microsoft Teams team with id 00000000-0000-0000-0000-000000000000 and channel id 00:00000000000000000000000000000000@thread.skype
50
+ List all owners of the specified Microsoft Teams team with id 00000000-0000-0000-0000-000000000000 and channel id 19:00000000000000000000000000000000@thread.skype
51
51
 
52
52
  ```sh
53
- m365 teams channel member list --teamId 00000000-0000-0000-0000-000000000000 --channelId 00:00000000000000000000000000000000@thread.skype --role owner
53
+ m365 teams channel member list --teamId 00000000-0000-0000-0000-000000000000 --channelId 19:00000000000000000000000000000000@thread.skype --role owner
54
54
  ```
@@ -44,10 +44,10 @@ m365 teams conversationmember remove [options]
44
44
 
45
45
  ## Examples
46
46
 
47
- Remove the user _johndoe@example.com_ from the Microsoft Teams team with id 00000000-0000-0000-0000-000000000000 and channel id 00:00000000000000000000000000000000@thread.skype
47
+ Remove the user _johndoe@example.com_ from the Microsoft Teams team with id 00000000-0000-0000-0000-000000000000 and channel id 19:00000000000000000000000000000000@thread.skype
48
48
 
49
49
  ```sh
50
- m365 teams channel member remove --teamId 00000000-0000-0000-0000-000000000000 --channelId 00:00000000000000000000000000000000@thread.skype --userName "johndoe@example.com"
50
+ m365 teams channel member remove --teamId 00000000-0000-0000-0000-000000000000 --channelId 19:00000000000000000000000000000000@thread.skype --userName "johndoe@example.com"
51
51
  ```
52
52
 
53
53
  Remove the user with id 00000000-0000-0000-0000-000000000000 from the Microsoft Teams team with name _Team Name_ and channel with name _Channel Name_
@@ -38,10 +38,10 @@ m365 teams channel member set [options]
38
38
 
39
39
  ## Examples
40
40
 
41
- Updates the role of the user _johndoe@example.com_ to owner in the Microsoft Teams team with id 00000000-0000-0000-0000-000000000000 and channel id 00:00000000000000000000000000000000@thread.skype
41
+ Updates the role of the user _johndoe@example.com_ to owner in the Microsoft Teams team with id 00000000-0000-0000-0000-000000000000 and channel id 19:00000000000000000000000000000000@thread.skype
42
42
 
43
43
  ```sh
44
- m365 teams channel member set --teamId 00000000-0000-0000-0000-000000000000 --channelId 00:00000000000000000000000000000000@thread.skype --userName "johndoe@example.com" --role owner
44
+ m365 teams channel member set --teamId 00000000-0000-0000-0000-000000000000 --channelId 19:00000000000000000000000000000000@thread.skype --userName "johndoe@example.com" --role owner
45
45
  ```
46
46
 
47
47
  Updates the role of the user with id 00000000-0000-0000-0000-000000000000 to member in the Microsoft Teams team with name _Team Name_ and channel with name _Channel Name_
@@ -0,0 +1,30 @@
1
+ # tenant security alerts list
2
+
3
+ Gets the security alerts for a tenant
4
+
5
+ ## Usage
6
+
7
+ ```sh
8
+ m365 tenant security alerts list [options]
9
+ ```
10
+
11
+ ## Options
12
+
13
+ `--vendor [vendor]`
14
+ : The vendor to return alerts for. Possible values `Azure Advanced Threat Protection`, `Azure Security Center`, `Microsoft Cloud App Security`, `Azure Active Directory Identity Protection`, `Azure Sentinel`, `Microsoft Defender ATP`. If omitted, all alerts are returned
15
+
16
+ --8<-- "docs/cmd/_global.md"
17
+
18
+ ## Examples
19
+
20
+ Get all security alerts for a tenant
21
+
22
+ ```sh
23
+ m365 tenant security alerts list
24
+ ```
25
+
26
+ Get security alerts for a vendor with name _Azure Sentinel_
27
+
28
+ ```sh
29
+ m365 tenant security alerts list --vendor "Azure Sentinel"
30
+ ```
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pnp/cli-microsoft365",
3
- "version": "5.3.0-beta.d2ec1f4",
3
+ "version": "5.3.0-beta.e83e121",
4
4
  "description": "Manage Microsoft 365 and SharePoint Framework projects on any platform",
5
5
  "license": "MIT",
6
6
  "main": "./dist/api.js",