@pnp/cli-microsoft365 5.1.0-beta.04832fc → 5.1.0-beta.9b2f51d

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 (25) hide show
  1. package/.eslintrc.js +1 -0
  2. package/dist/m365/aad/commands/app/app-add.js +68 -10
  3. package/dist/m365/aad/commands/app/{app-delete.js → app-remove.js} +9 -5
  4. package/dist/m365/aad/commands/app/{app-role-delete.js → app-role-remove.js} +11 -7
  5. package/dist/m365/aad/commands.js +3 -1
  6. package/dist/m365/base/PowerPlatformCommand.js +10 -0
  7. package/dist/m365/pp/commands/managementapp/managementapp-add.js +98 -0
  8. package/dist/m365/pp/commands.js +7 -0
  9. package/dist/m365/spfx/commands/project/project-upgrade/upgrade-1.12.0.js +0 -2
  10. package/dist/m365/tenant/commands.js +1 -6
  11. package/docs/docs/cmd/aad/app/{app-delete.md → app-remove.md} +15 -9
  12. package/docs/docs/cmd/aad/app/{app-role-delete.md → app-role-remove.md} +25 -19
  13. package/docs/docs/cmd/pp/managementapp/managementapp-add.md +50 -0
  14. package/package.json +3 -2
  15. package/dist/m365/spfx/commands/project/project-upgrade/rules/FN015006_FILE_editorconfig.js +0 -14
  16. package/dist/m365/tenant/commands/auditlog/auditlog-report.js +0 -231
  17. package/dist/m365/tenant/commands/service/service-list.js +0 -41
  18. package/dist/m365/tenant/commands/service/service-message-list.js +0 -55
  19. package/dist/m365/tenant/commands/service/service-report-historicalservicestatus.js +0 -54
  20. package/dist/m365/tenant/commands/status/status-list.js +0 -55
  21. package/docs/docs/cmd/tenant/auditlog/auditlog-report.md +0 -61
  22. package/docs/docs/cmd/tenant/service/service-list.md +0 -25
  23. package/docs/docs/cmd/tenant/service/service-message-list.md +0 -34
  24. package/docs/docs/cmd/tenant/service/service-report-historicalservicestatus.md +0 -38
  25. package/docs/docs/cmd/tenant/status/status-list.md +0 -34
package/.eslintrc.js CHANGED
@@ -35,6 +35,7 @@ const dictionary = [
35
35
  'is',
36
36
  'issue',
37
37
  'list',
38
+ 'management',
38
39
  'member',
39
40
  'messaging',
40
41
  'news',
@@ -58,6 +58,9 @@ class AadAppAddCommand extends GraphCommand_1.default {
58
58
  if (_appInfo.secret) {
59
59
  appInfo.secret = _appInfo.secret;
60
60
  }
61
+ if (_appInfo.secrets) {
62
+ appInfo.secrets = _appInfo.secrets;
63
+ }
61
64
  logger.log(appInfo);
62
65
  cb();
63
66
  }, (rawRes) => this.handleRejectedODataJsonPromise(rawRes, logger, cb));
@@ -111,6 +114,10 @@ class AadAppAddCommand extends GraphCommand_1.default {
111
114
  delete v2Manifest.id;
112
115
  delete v2Manifest.appId;
113
116
  delete v2Manifest.publisherDomain;
117
+ // extract secrets from the manifest. Store them in a separate variable
118
+ // and remove them from the manifest because we need to create them
119
+ // separately
120
+ const secrets = this.getSecretsFromManifest(v2Manifest);
114
121
  // Azure Portal returns v2 manifest whereas the Graph API expects a v1.6
115
122
  const graphManifest = this.transformManifest(v2Manifest);
116
123
  const updateAppRequestOptions = {
@@ -124,7 +131,26 @@ class AadAppAddCommand extends GraphCommand_1.default {
124
131
  return request_1.default
125
132
  .patch(updateAppRequestOptions)
126
133
  .then(_ => this.updatePreAuthorizedAppsFromManifest(v2Manifest, appInfo))
127
- .then(_ => Promise.resolve(appInfo));
134
+ .then(_ => this.createSecrets(secrets, appInfo));
135
+ }
136
+ getSecretsFromManifest(manifest) {
137
+ if (!manifest.passwordCredentials || manifest.passwordCredentials.length === 0) {
138
+ return [];
139
+ }
140
+ const secrets = manifest.passwordCredentials.map((c) => {
141
+ const startDate = new Date(c.startDate);
142
+ const endDate = new Date(c.endDate);
143
+ const expirationDate = new Date();
144
+ expirationDate.setMilliseconds(endDate.valueOf() - startDate.valueOf());
145
+ return {
146
+ name: c.displayName,
147
+ expirationDate
148
+ };
149
+ });
150
+ // delete the secrets from the manifest so that we won't try to set them
151
+ // from the manifest
152
+ delete manifest.passwordCredentials;
153
+ return secrets;
128
154
  }
129
155
  updatePreAuthorizedAppsFromManifest(manifest, appInfo) {
130
156
  if (!manifest ||
@@ -153,6 +179,21 @@ class AadAppAddCommand extends GraphCommand_1.default {
153
179
  .patch(updateAppRequestOptions)
154
180
  .then(_ => Promise.resolve(appInfo));
155
181
  }
182
+ createSecrets(secrets, appInfo) {
183
+ if (secrets.length === 0) {
184
+ return Promise.resolve(appInfo);
185
+ }
186
+ return Promise
187
+ .all(secrets.map(secret => this.createSecret({
188
+ appObjectId: appInfo.id,
189
+ displayName: secret.name,
190
+ expirationDate: secret.expirationDate
191
+ })))
192
+ .then(secrets => {
193
+ appInfo.secrets = secrets;
194
+ return appInfo;
195
+ });
196
+ }
156
197
  transformManifest(v2Manifest) {
157
198
  var _a, _b, _c, _d;
158
199
  const graphManifest = JSON.parse(JSON.stringify(v2Manifest));
@@ -187,7 +228,7 @@ class AadAppAddCommand extends GraphCommand_1.default {
187
228
  unsupportedProperties.forEach(p => delete graphManifest[p]);
188
229
  graphManifest.api.acceptMappedClaims = v2Manifest.acceptMappedClaims;
189
230
  delete graphManifest.acceptMappedClaims;
190
- graphManifest.publicClient = v2Manifest.allowPublicClient;
231
+ graphManifest.isFallbackPublicClient = v2Manifest.allowPublicClient;
191
232
  delete graphManifest.allowPublicClient;
192
233
  graphManifest.info.termsOfServiceUrl = (_a = v2Manifest.informationalUrls) === null || _a === void 0 ? void 0 : _a.termsOfService;
193
234
  graphManifest.info.supportUrl = (_b = v2Manifest.informationalUrls) === null || _b === void 0 ? void 0 : _b.support;
@@ -234,6 +275,11 @@ class AadAppAddCommand extends GraphCommand_1.default {
234
275
  }
235
276
  graphManifest.web.homePageUrl = v2Manifest.signInUrl;
236
277
  delete graphManifest.signInUrl;
278
+ if (graphManifest.appRoles) {
279
+ graphManifest.appRoles.forEach((role) => {
280
+ delete role.lang;
281
+ });
282
+ }
237
283
  return graphManifest;
238
284
  }
239
285
  configureUri(args, appInfo, logger) {
@@ -357,27 +403,39 @@ class AadAppAddCommand extends GraphCommand_1.default {
357
403
  if (this.verbose) {
358
404
  logger.logToStderr(`Configure Azure AD app secret...`);
359
405
  }
360
- const secretExpirationDate = new Date();
361
- secretExpirationDate.setFullYear(secretExpirationDate.getFullYear() + 1);
406
+ return this
407
+ .createSecret({ appObjectId: appInfo.id })
408
+ .then(secret => {
409
+ appInfo.secret = secret.value;
410
+ return Promise.resolve(appInfo);
411
+ });
412
+ }
413
+ createSecret({ appObjectId, displayName = undefined, expirationDate = undefined }) {
414
+ let secretExpirationDate = expirationDate;
415
+ if (!secretExpirationDate) {
416
+ secretExpirationDate = new Date();
417
+ secretExpirationDate.setFullYear(secretExpirationDate.getFullYear() + 1);
418
+ }
419
+ const secretName = displayName !== null && displayName !== void 0 ? displayName : 'Default';
362
420
  const requestOptions = {
363
- url: `${this.resource}/v1.0/myorganization/applications/${appInfo.id}/addPassword`,
421
+ url: `${this.resource}/v1.0/myorganization/applications/${appObjectId}/addPassword`,
364
422
  headers: {
365
423
  'content-type': 'application/json'
366
424
  },
367
425
  responseType: 'json',
368
426
  data: {
369
427
  passwordCredential: {
370
- displayName: 'Default',
428
+ displayName: secretName,
371
429
  endDateTime: secretExpirationDate.toISOString()
372
430
  }
373
431
  }
374
432
  };
375
433
  return request_1.default
376
434
  .post(requestOptions)
377
- .then((password) => {
378
- appInfo.secret = password.secretText;
379
- return Promise.resolve(appInfo);
380
- });
435
+ .then((password) => Promise.resolve({
436
+ displayName: secretName,
437
+ value: password.secretText
438
+ }));
381
439
  }
382
440
  saveAppInfo(args, appInfo, logger) {
383
441
  if (!args.options.save) {
@@ -5,9 +5,12 @@ const request_1 = require("../../../../request");
5
5
  const utils_1 = require("../../../../utils");
6
6
  const GraphCommand_1 = require("../../../base/GraphCommand");
7
7
  const commands_1 = require("../../commands");
8
- class AadAppDeleteCommand extends GraphCommand_1.default {
8
+ class AadAppRemoveCommand extends GraphCommand_1.default {
9
9
  get name() {
10
- return commands_1.default.APP_DELETE;
10
+ return commands_1.default.APP_REMOVE;
11
+ }
12
+ alias() {
13
+ return [commands_1.default.APP_DELETE];
11
14
  }
12
15
  get description() {
13
16
  return 'Removes an Azure AD app registration';
@@ -21,6 +24,7 @@ class AadAppDeleteCommand extends GraphCommand_1.default {
21
24
  return telemetryProps;
22
25
  }
23
26
  commandAction(logger, args, cb) {
27
+ this.showDeprecationWarning(logger, commands_1.default.APP_DELETE, commands_1.default.APP_REMOVE);
24
28
  const deleteApp = () => {
25
29
  this
26
30
  .getObjectId(args, logger)
@@ -47,7 +51,7 @@ class AadAppDeleteCommand extends GraphCommand_1.default {
47
51
  type: 'confirm',
48
52
  name: 'continue',
49
53
  default: false,
50
- message: `Are you sure you want to delete the App?`
54
+ message: `Are you sure you want to remove the app?`
51
55
  }, (result) => {
52
56
  if (!result.continue) {
53
57
  cb();
@@ -119,5 +123,5 @@ class AadAppDeleteCommand extends GraphCommand_1.default {
119
123
  return true;
120
124
  }
121
125
  }
122
- module.exports = new AadAppDeleteCommand();
123
- //# sourceMappingURL=app-delete.js.map
126
+ module.exports = new AadAppRemoveCommand();
127
+ //# sourceMappingURL=app-remove.js.map
@@ -5,12 +5,15 @@ const request_1 = require("../../../../request");
5
5
  const utils_1 = require("../../../../utils");
6
6
  const GraphCommand_1 = require("../../../base/GraphCommand");
7
7
  const commands_1 = require("../../commands");
8
- class AadAppRoleDeleteCommand extends GraphCommand_1.default {
8
+ class AadAppRoleRemoveCommand extends GraphCommand_1.default {
9
9
  get name() {
10
- return commands_1.default.APP_ROLE_DELETE;
10
+ return commands_1.default.APP_ROLE_REMOVE;
11
11
  }
12
12
  get description() {
13
- return 'Deletes role from the specified Azure AD app registration';
13
+ return 'Removes role from the specified Azure AD app registration';
14
+ }
15
+ alias() {
16
+ return [commands_1.default.APP_ROLE_DELETE];
14
17
  }
15
18
  getTelemetryProperties(args) {
16
19
  const telemetryProps = super.getTelemetryProperties(args);
@@ -23,6 +26,7 @@ class AadAppRoleDeleteCommand extends GraphCommand_1.default {
23
26
  return telemetryProps;
24
27
  }
25
28
  commandAction(logger, args, cb) {
29
+ this.showDeprecationWarning(logger, commands_1.default.APP_ROLE_DELETE, commands_1.default.APP_ROLE_REMOVE);
26
30
  const deleteAppRole = () => {
27
31
  this
28
32
  .processAppRoleDelete(logger, args)
@@ -36,7 +40,7 @@ class AadAppRoleDeleteCommand extends GraphCommand_1.default {
36
40
  type: 'confirm',
37
41
  name: 'continue',
38
42
  default: false,
39
- message: `Are you sure you want to delete the App role ?`
43
+ message: `Are you sure you want to remove the app role ?`
40
44
  }, (result) => {
41
45
  if (!result.continue) {
42
46
  cb();
@@ -56,7 +60,7 @@ class AadAppRoleDeleteCommand extends GraphCommand_1.default {
56
60
  if (this.verbose) {
57
61
  logger.logToStderr(`Deleting role with ${appRoleDeleteIdentifierNameValue} from Azure AD app ${aadApp.id}...`);
58
62
  }
59
- // Find the role search criteria provided by the user.
63
+ // Find the role search criteria provided by the user.
60
64
  const appRoleDeleteIdentifierProperty = args.options.name ? `displayName` : (args.options.claim ? `value` : `id`);
61
65
  const appRoleDeleteIdentifierValue = args.options.name ? args.options.name : (args.options.claim ? args.options.claim : args.options.id);
62
66
  const appRoleToDelete = aadApp.appRoles.filter((role) => role[appRoleDeleteIdentifierProperty] === appRoleDeleteIdentifierValue);
@@ -201,5 +205,5 @@ class AadAppRoleDeleteCommand extends GraphCommand_1.default {
201
205
  return true;
202
206
  }
203
207
  }
204
- module.exports = new AadAppRoleDeleteCommand();
205
- //# sourceMappingURL=app-role-delete.js.map
208
+ module.exports = new AadAppRoleRemoveCommand();
209
+ //# sourceMappingURL=app-role-remove.js.map
@@ -5,10 +5,12 @@ exports.default = {
5
5
  APP_ADD: `${prefix} app add`,
6
6
  APP_DELETE: `${prefix} app delete`,
7
7
  APP_GET: `${prefix} app get`,
8
+ APP_REMOVE: `${prefix} app remove`,
8
9
  APP_SET: `${prefix} app set`,
9
10
  APP_ROLE_ADD: `${prefix} app role add`,
10
- APP_ROLE_LIST: `${prefix} app role list`,
11
11
  APP_ROLE_DELETE: `${prefix} app role delete`,
12
+ APP_ROLE_LIST: `${prefix} app role list`,
13
+ APP_ROLE_REMOVE: `${prefix} app role remove`,
12
14
  APPROLEASSIGNMENT_ADD: `${prefix} approleassignment add`,
13
15
  APPROLEASSIGNMENT_LIST: `${prefix} approleassignment list`,
14
16
  APPROLEASSIGNMENT_REMOVE: `${prefix} approleassignment remove`,
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const Command_1 = require("../../Command");
4
+ class PowerPlatformCommand extends Command_1.default {
5
+ get resource() {
6
+ return 'https://api.bap.microsoft.com';
7
+ }
8
+ }
9
+ exports.default = PowerPlatformCommand;
10
+ //# sourceMappingURL=PowerPlatformCommand.js.map
@@ -0,0 +1,98 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const request_1 = require("../../../../request");
4
+ const utils_1 = require("../../../../utils");
5
+ const PowerPlatformCommand_1 = require("../../../base/PowerPlatformCommand");
6
+ const commands_1 = require("../../commands");
7
+ class PpManagementAppAddCommand extends PowerPlatformCommand_1.default {
8
+ get name() {
9
+ return commands_1.default.MANAGEMENTAPP_ADD;
10
+ }
11
+ get description() {
12
+ return 'Register management application for Power Platform';
13
+ }
14
+ getTelemetryProperties(args) {
15
+ const telemetryProps = super.getTelemetryProperties(args);
16
+ telemetryProps.appId = typeof args.options.appId !== 'undefined';
17
+ telemetryProps.objectId = typeof args.options.objectId !== 'undefined';
18
+ telemetryProps.name = typeof args.options.name !== 'undefined';
19
+ return telemetryProps;
20
+ }
21
+ commandAction(logger, args, cb) {
22
+ this
23
+ .getAppId(args)
24
+ .then((appId) => {
25
+ const requestOptions = {
26
+ // This should be refactored once we implement a PowerPlatform base class as api.bap will differ between envs.
27
+ url: `${this.resource}/providers/Microsoft.BusinessAppPlatform/adminApplications/${appId}?api-version=2020-06-01`,
28
+ headers: {
29
+ accept: 'application/json;odata.metadata=none'
30
+ },
31
+ responseType: 'json'
32
+ };
33
+ return request_1.default.put(requestOptions);
34
+ })
35
+ .then((res) => {
36
+ logger.log(res);
37
+ cb();
38
+ }, (err) => this.handleRejectedODataJsonPromise(err, logger, cb));
39
+ }
40
+ getAppId(args) {
41
+ if (args.options.appId) {
42
+ return Promise.resolve(args.options.appId);
43
+ }
44
+ const { objectId, name } = args.options;
45
+ const filter = objectId ?
46
+ `id eq '${encodeURIComponent(objectId)}'` :
47
+ `displayName eq '${encodeURIComponent(name)}'`;
48
+ const requestOptions = {
49
+ url: `https://graph.microsoft.com/v1.0/myorganization/applications?$filter=${filter}&$select=appId`,
50
+ headers: {
51
+ accept: 'application/json;odata.metadata=none'
52
+ },
53
+ responseType: 'json'
54
+ };
55
+ return request_1.default
56
+ .get((requestOptions))
57
+ .then((aadApps) => {
58
+ if (aadApps.value.length === 0) {
59
+ const applicationIdentifier = objectId ? `ID ${objectId}` : `name ${name}`;
60
+ return Promise.reject(`No Azure AD application registration with ${applicationIdentifier} found`);
61
+ }
62
+ if (aadApps.value.length === 1 && aadApps.value[0].appId) {
63
+ return Promise.resolve(aadApps.value[0].appId);
64
+ }
65
+ return Promise.reject(`Multiple Azure AD application registration with name ${name} found. Please disambiguate (app IDs): ${aadApps.value.map(a => a.appId).join(', ')}`);
66
+ });
67
+ }
68
+ options() {
69
+ const options = [
70
+ { option: '--appId [appId]' },
71
+ { option: '--objectId [objectId]' },
72
+ { option: '--name [name]' }
73
+ ];
74
+ const parentOptions = super.options();
75
+ return options.concat(parentOptions);
76
+ }
77
+ validate(args) {
78
+ if (!args.options.appId &&
79
+ !args.options.objectId &&
80
+ !args.options.name) {
81
+ return 'Specify either appId, objectId, or name';
82
+ }
83
+ if ((args.options.appId && args.options.objectId) ||
84
+ (args.options.appId && args.options.name) ||
85
+ (args.options.objectId && args.options.name)) {
86
+ return 'Specify either appId, objectId, or name but not both';
87
+ }
88
+ if (args.options.appId && !utils_1.validation.isValidGuid(args.options.appId)) {
89
+ return `${args.options.appId} is not a valid GUID`;
90
+ }
91
+ if (args.options.objectId && !utils_1.validation.isValidGuid(args.options.objectId)) {
92
+ return `${args.options.objectId} is not a valid GUID`;
93
+ }
94
+ return true;
95
+ }
96
+ }
97
+ module.exports = new PpManagementAppAddCommand();
98
+ //# sourceMappingURL=managementapp-add.js.map
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const prefix = 'pp';
4
+ exports.default = {
5
+ MANAGEMENTAPP_ADD: `${prefix} managementapp add`
6
+ };
7
+ //# sourceMappingURL=commands.js.map
@@ -40,7 +40,6 @@ const FN012017_TSC_extends_1 = require("./rules/FN012017_TSC_extends");
40
40
  const FN012018_TSC_lib_es2015_promise_1 = require("./rules/FN012018_TSC_lib_es2015_promise");
41
41
  const FN012019_TSC_types_es6_promise_1 = require("./rules/FN012019_TSC_types_es6_promise");
42
42
  const FN013002_GULP_serveTask_1 = require("./rules/FN013002_GULP_serveTask");
43
- const FN015006_FILE_editorconfig_1 = require("./rules/FN015006_FILE_editorconfig");
44
43
  const FN019002_TSL_extends_1 = require("./rules/FN019002_TSL_extends");
45
44
  const FN021002_PKG_engines_1 = require("./rules/FN021002_PKG_engines");
46
45
  module.exports = [
@@ -84,7 +83,6 @@ module.exports = [
84
83
  new FN012018_TSC_lib_es2015_promise_1.FN012018_TSC_lib_es2015_promise(),
85
84
  new FN012019_TSC_types_es6_promise_1.FN012019_TSC_types_es6_promise(false),
86
85
  new FN013002_GULP_serveTask_1.FN013002_GULP_serveTask(),
87
- new FN015006_FILE_editorconfig_1.FN015006_FILE_editorconfig(false),
88
86
  new FN019002_TSL_extends_1.FN019002_TSL_extends('./node_modules/@microsoft/sp-tslint-rules/base-tslint.json'),
89
87
  new FN021002_PKG_engines_1.FN021002_PKG_engines(false)
90
88
  ];
@@ -2,7 +2,6 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const prefix = 'tenant';
4
4
  exports.default = {
5
- AUDITLOG_REPORT: `${prefix} auditlog report`,
6
5
  ID_GET: `${prefix} id get`,
7
6
  REPORT_ACTIVEUSERCOUNTS: `${prefix} report activeusercounts`,
8
7
  REPORT_ACTIVEUSERDETAIL: `${prefix} report activeuserdetail`,
@@ -11,14 +10,10 @@ exports.default = {
11
10
  REPORT_OFFICE365ACTIVATIONSUSERCOUNTS: `${prefix} report office365activationsusercounts`,
12
11
  REPORT_SERVICESUSERCOUNTS: `${prefix} report servicesusercounts`,
13
12
  SERVICEANNOUNCEMENT_HEALTHISSUE_GET: `${prefix} serviceannouncement healthissue get`,
14
- SERVICE_LIST: `${prefix} service list`,
15
- SERVICE_MESSAGE_LIST: `${prefix} service message list`,
16
- SERVICE_REPORT_HISTORICALSERVICESTATUS: `${prefix} service report historicalservicestatus`,
17
13
  SERVICEANNOUNCEMENT_HEALTH_GET: `${prefix} serviceannouncement health get`,
18
14
  SERVICEANNOUNCEMENT_HEALTH_LIST: `${prefix} serviceannouncement health list`,
19
15
  SERVICEANNOUNCEMENT_HEALTHISSUE_LIST: `${prefix} serviceannouncement healthissue list`,
20
16
  SERVICEANNOUNCEMENT_MESSAGE_GET: `${prefix} serviceannouncement message get`,
21
- SERVICEANNOUNCEMENT_MESSAGE_LIST: `${prefix} serviceannouncement message list`,
22
- STATUS_LIST: `${prefix} status list`
17
+ SERVICEANNOUNCEMENT_MESSAGE_LIST: `${prefix} serviceannouncement message list`
23
18
  };
24
19
  //# sourceMappingURL=commands.js.map
@@ -1,9 +1,15 @@
1
- # aad app delete
1
+ # aad app remove
2
2
 
3
3
  Removes an Azure AD app registration
4
4
 
5
5
  ## Usage
6
6
 
7
+ ```sh
8
+ m365 aad app remove [options]
9
+ ```
10
+
11
+ ## Alias
12
+
7
13
  ```sh
8
14
  m365 aad app delete [options]
9
15
  ```
@@ -20,32 +26,32 @@ m365 aad app delete [options]
20
26
  : Name of the Azure AD application registration to remove. Specify either `appId`, `objectId` or `name`
21
27
 
22
28
  `--confirm`:
23
- : Don't prompt for confirmation to delete the app
29
+ : Don't prompt for confirmation to remove the app
24
30
 
25
31
  --8<-- "docs/cmd/_global.md"
26
32
 
27
33
  ## Remarks
28
34
 
29
- For best performance use the `objectId` option to reference the Azure AD application registration to delete. If you use `appId` or `name`, this command will first need to find the corresponding object ID for that application.
35
+ For best performance use the `objectId` option to reference the Azure AD application registration to remove. If you use `appId` or `name`, this command will first need to find the corresponding object ID for that application.
30
36
 
31
37
  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.
32
38
 
33
39
  ## Examples
34
40
 
35
- Delete the Azure AD application registration by its app (client) ID
41
+ Remove the Azure AD application registration by its app (client) ID
36
42
 
37
43
  ```sh
38
- m365 aad app delete --appId d75be2e1-0204-4f95-857d-51a37cf40be8
44
+ m365 aad app remove --appId d75be2e1-0204-4f95-857d-51a37cf40be8
39
45
  ```
40
46
 
41
- Delete the Azure AD application registration by its object ID
47
+ Remove the Azure AD application registration by its object ID
42
48
 
43
49
  ```sh
44
- m365 aad app delete --objectId d75be2e1-0204-4f95-857d-51a37cf40be8
50
+ m365 aad app remove --objectId d75be2e1-0204-4f95-857d-51a37cf40be8
45
51
  ```
46
52
 
47
- Delete the Azure AD application registration by its name. Will NOT prompt for confirmation before deleting.
53
+ Remove the Azure AD application registration by its name. Will NOT prompt for confirmation before deleting.
48
54
 
49
55
  ```sh
50
- m365 aad app delete --name "My app" --confirm
56
+ m365 aad app remove --name "My app" --confirm
51
57
  ```
@@ -1,9 +1,15 @@
1
- # aad app role delete
1
+ # aad app role remove
2
2
 
3
- Deletes role from the specified Azure AD app registration
3
+ Removes role from the specified Azure AD app registration
4
4
 
5
5
  ## Usage
6
6
 
7
+ ```sh
8
+ m365 aad app role remove [options]
9
+ ```
10
+
11
+ ## Alias
12
+
7
13
  ```sh
8
14
  m365 aad app role delete [options]
9
15
  ```
@@ -11,60 +17,60 @@ m365 aad app role delete [options]
11
17
  ## Options
12
18
 
13
19
  `--appId [appId]`
14
- : Application (client) ID of the Azure AD application registration from which role should be deleted. Specify either `appId`, `appObjectId` or `appName`
20
+ : Application (client) ID of the Azure AD application registration from which role should be removed. Specify either `appId`, `appObjectId` or `appName`
15
21
 
16
22
  `--appObjectId [appObjectId]`
17
- : Object ID of the Azure AD application registration from which role should be deleted. Specify either `appId`, `appObjectId` or `appName`
23
+ : Object ID of the Azure AD application registration from which role should be removed. Specify either `appId`, `appObjectId` or `appName`
18
24
 
19
25
  `--appName [appName]`
20
- : Name of the Azure AD application registration from which role should be deleted. Specify either `appId`, `appObjectId` or `appName`
26
+ : Name of the Azure AD application registration from which role should be removed. Specify either `appId`, `appObjectId` or `appName`
21
27
 
22
28
  `-n, --name [name]`
23
- : Name of the role to delete. Specify either `name`, `id` or `claim`
29
+ : Name of the role to remove. Specify either `name`, `id` or `claim`
24
30
 
25
31
  `-i, --id [id]`
26
- : Id of the role to delete. Specify either `name`, `id` or `claim`
32
+ : Id of the role to remove. Specify either `name`, `id` or `claim`
27
33
 
28
34
  `-c, --claim [claim]`
29
- : Claim value of the role to delete. Specify either `name`, `id` or `claim`
35
+ : Claim value of the role to remove. Specify either `name`, `id` or `claim`
30
36
 
31
37
  `--confirm`
32
- : Don't prompt for confirmation to delete the role.
38
+ : Don't prompt for confirmation to remove the role.
33
39
 
34
40
  --8<-- "docs/cmd/_global.md"
35
41
 
36
42
  ## Remarks
37
43
 
38
- For best performance use the `appObjectId` option to reference the Azure AD application registration from which to delete the role. If you use `appId` or `appName`, this command will first need to find the corresponding object ID for that application.
44
+ For best performance use the `appObjectId` option to reference the Azure AD application registration from which to remove the role. If you use `appId` or `appName`, this command will first need to find the corresponding object ID for that application.
39
45
 
40
46
  If the command finds multiple Azure AD application registrations with the specified app name, it will prompt you to disambiguate which app it should use, listing the discovered object IDs.
41
47
 
42
48
  If the command finds multiple roles with the specified role name, it will prompt you to disambiguate which role it should use, listing the claim values.
43
49
 
44
- If the role to be deleted is 'Enabled', this command will disable the role first and then delete.
50
+ If the role to be removed is 'Enabled', this command will disable the role first and then remove.
45
51
 
46
52
  ## Examples
47
53
 
48
- Delete role from a Azure AD application registration using object ID and role name options. Will prompt for confirmation before deleting the role.
54
+ Remove role from a Azure AD application registration using object ID and role name options. Will prompt for confirmation before deleting the role.
49
55
 
50
56
  ```sh
51
- m365 aad app role delete --appObjectId d75be2e1-0204-4f95-857d-51a37cf40be8 --name "Get Product"
57
+ m365 aad app role remove --appObjectId d75be2e1-0204-4f95-857d-51a37cf40be8 --name "Get Product"
52
58
  ```
53
59
 
54
- Delete role from a Azure AD application registration using app (client) ID and role claim options. Will prompt for confirmation before deleting the role.
60
+ Remove role from a Azure AD application registration using app (client) ID and role claim options. Will prompt for confirmation before deleting the role.
55
61
 
56
62
  ```sh
57
- m365 aad app role delete --appId e75be2e1-0204-4f95-857d-51a37cf40be8 --claim "Product.Get"
63
+ m365 aad app role remove --appId e75be2e1-0204-4f95-857d-51a37cf40be8 --claim "Product.Get"
58
64
  ```
59
65
 
60
- Delete role from a Azure AD application registration using app name and role claim options. Will prompt for confirmation before deleting the role.
66
+ Remove role from a Azure AD application registration using app name and role claim options. Will prompt for confirmation before deleting the role.
61
67
 
62
68
  ```sh
63
- m365 aad app role delete --appName "My app" --claim "Product.Get"
69
+ m365 aad app role remove --appName "My app" --claim "Product.Get"
64
70
  ```
65
71
 
66
- Delete role from a Azure AD application registration using object ID and role id options. Will NOT prompt for confirmation before deleting the role.
72
+ Remove role from a Azure AD application registration using object ID and role id options. Will NOT prompt for confirmation before deleting the role.
67
73
 
68
74
  ```sh
69
- m365 aad app role delete --appObjectId d75be2e1-0204-4f95-857d-51a37cf40be8 --id 15927ce6-1933-4b2f-b029-4dee3d53f4dd --confirm
75
+ m365 aad app role remove --appObjectId d75be2e1-0204-4f95-857d-51a37cf40be8 --id 15927ce6-1933-4b2f-b029-4dee3d53f4dd --confirm
70
76
  ```
@@ -0,0 +1,50 @@
1
+ # pp managementapp add
2
+
3
+ Register management application for Power Platform
4
+
5
+ ## Usage
6
+
7
+ ```sh
8
+ m365 pp managementapp add [options]
9
+ ```
10
+
11
+ ## Options
12
+
13
+ `--appId [appId]`
14
+ : Application (client) ID of the Azure AD application registration to register as a management app. Specify either `appId`, `objectId` or `name`
15
+
16
+ `--objectId [objectId]`
17
+ : Object ID of the Azure AD application registration to register as a management app. Specify either `appId`, `objectId` or `name`
18
+
19
+ `--name [name]`
20
+ : Name of the Azure AD application registration to register as a management app. Specify either `appId`, `objectId` or `name`
21
+
22
+ --8<-- "docs/cmd/_global.md"
23
+
24
+ ## Remarks
25
+
26
+ To execute this command the first time you'll need sign in using the Microsoft Azure PowerShell app registration. You can do this by executing `m365 login --appId 1950a258-227b-4e31-a9cf-717495945fc2`. To register the Azure AD app registration that CLI for Microsoft 365 uses by default, execute `m365 pp managementapp add--appId 31359c7f-bd7e-475c-86db-fdb8c937548e`.
27
+
28
+ For best performance use the `appId` option to reference the Azure AD application registration to update. If you use `objectId` or `name`, this command will first need to find the corresponding `appId` for that application.
29
+
30
+ 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.
31
+
32
+ ## Examples
33
+
34
+ Register CLI for Microsoft 365 as a management application for the Power Platform
35
+
36
+ ```sh
37
+ m365 pp managementapp add --appId 31359c7f-bd7e-475c-86db-fdb8c937548e
38
+ ```
39
+
40
+ Register Azure AD application with the specified object ID as a management application for the Power Platform
41
+
42
+ ```sh
43
+ m365 pp managementapp add --objectId d75be2e1-0204-4f95-857d-51a37cf40be8
44
+ ```
45
+
46
+ Register Azure AD application named _My app_ as a management application for the Power Platform
47
+
48
+ ```sh
49
+ m365 pp managementapp add --name "My app"
50
+ ```
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pnp/cli-microsoft365",
3
- "version": "5.1.0-beta.04832fc",
3
+ "version": "5.1.0-beta.9b2f51d",
4
4
  "description": "Manage Microsoft 365 and SharePoint Framework projects on any platform",
5
5
  "license": "MIT",
6
6
  "main": "./dist/api.js",
@@ -107,9 +107,10 @@
107
107
  "Georgiev, Velin <velin.georgiev@gmail.com>",
108
108
  "Ghuge, Pramod <pramod7@gmail.com>",
109
109
  "Gölles, Thomas <thomy@outlook.at>",
110
- "Hagström, Joakim <joakim.hogberg@bravero.se>",
110
+ "Hagström, Joakim <johags@johags-sb2.localdomain>",
111
111
  "Harding, Phil <pil.harding@platinumdogs.co.uk>",
112
112
  "Hawrylak, Paweł <phawrylak@outlook.com>",
113
+ "Holemans, Milan <Milan.Holemans@vanroey.be>",
113
114
  "Högberg, Joakim <joakim.hogberg@bravero.se>",
114
115
  "Hvam, Allan <ahp@delegate.dk>",
115
116
  "Jaakke, Robert <robert.jaakke@mavention.nl>",
@@ -1,14 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.FN015006_FILE_editorconfig = void 0;
4
- const FileAddRemoveRule_1 = require("./FileAddRemoveRule");
5
- class FN015006_FILE_editorconfig extends FileAddRemoveRule_1.FileAddRemoveRule {
6
- constructor(add) {
7
- super('.editorconfig', add);
8
- }
9
- get id() {
10
- return 'FN015006';
11
- }
12
- }
13
- exports.FN015006_FILE_editorconfig = FN015006_FILE_editorconfig;
14
- //# sourceMappingURL=FN015006_FILE_editorconfig.js.map
@@ -1,231 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const Auth_1 = require("../../../../Auth");
4
- const Command_1 = require("../../../../Command");
5
- const request_1 = require("../../../../request");
6
- const utils_1 = require("../../../../utils");
7
- const commands_1 = require("../../commands");
8
- var AuditContentTypes;
9
- (function (AuditContentTypes) {
10
- AuditContentTypes["AzureActiveDirectory"] = "Audit.AzureActiveDirectory";
11
- AuditContentTypes["Exchange"] = "Audit.Exchange";
12
- AuditContentTypes["SharePoint"] = "Audit.SharePoint";
13
- AuditContentTypes["General"] = "Audit.General";
14
- AuditContentTypes["DLP"] = "DLP.All";
15
- })(AuditContentTypes || (AuditContentTypes = {}));
16
- class TenantAuditlogReportCommand extends Command_1.default {
17
- constructor() {
18
- super(...arguments);
19
- this.serviceUrl = 'https://manage.office.com/api/v1.0';
20
- this.completeAuditReports = [];
21
- }
22
- get name() {
23
- return commands_1.default.AUDITLOG_REPORT;
24
- }
25
- get description() {
26
- return 'Gets audit logs from the Office 365 Management API';
27
- }
28
- getTelemetryProperties(args) {
29
- const telemetryProps = super.getTelemetryProperties(args);
30
- telemetryProps.startTime = typeof args.options.startTime !== 'undefined';
31
- telemetryProps.endTime = typeof args.options.endTime !== 'undefined';
32
- telemetryProps.contentType = args.options.contentType;
33
- return telemetryProps;
34
- }
35
- defaultProperties() {
36
- return ['CreationTime', 'Operation', 'ClientIP', 'UserId', 'Workload'];
37
- }
38
- commandAction(logger, args, cb) {
39
- if (this.verbose) {
40
- logger.logToStderr(`Start retrieving Audit Log Report`);
41
- }
42
- this.tenantId = utils_1.accessToken.getTenantIdFromAccessToken(Auth_1.default.service.accessTokens[Auth_1.default.defaultResource].accessToken);
43
- this
44
- .getCompleteAuditReports(args, logger)
45
- .then((res) => {
46
- logger.log(res);
47
- cb();
48
- }, (err) => this.handleRejectedODataJsonPromise(err, logger, cb));
49
- }
50
- getCompleteAuditReports(args, logger) {
51
- return this
52
- .startContentSubscriptionIfNotActive(args, logger)
53
- .then(() => this.getAuditContentList(args, logger))
54
- .then((auditContentLists) => this.getBatchedPromises(auditContentLists, 10))
55
- .then((batchedPromise) => {
56
- return new Promise((resolve, reject) => {
57
- if (batchedPromise.length > 0) {
58
- this.getBatchedAuditlogData(logger, batchedPromise, 0, resolve, reject);
59
- }
60
- else {
61
- resolve();
62
- }
63
- });
64
- })
65
- .then(_ => this.completeAuditReports);
66
- }
67
- startContentSubscriptionIfNotActive(args, logger) {
68
- if (this.verbose) {
69
- logger.logToStderr(`Checking if subscription is active...`);
70
- }
71
- const subscriptionListEndpoint = 'activity/feed/subscriptions/list';
72
- const requestOptions = {
73
- url: `${this.serviceUrl}/${this.tenantId}/${subscriptionListEndpoint}`,
74
- headers: {
75
- accept: 'application/json;odata.metadata=none'
76
- },
77
- responseType: 'json'
78
- };
79
- return request_1.default
80
- .get(requestOptions)
81
- .then((subscriptionLists) => {
82
- return subscriptionLists.some(subscriptionList => subscriptionList.contentType === AuditContentTypes[args.options.contentType] &&
83
- subscriptionList.status === 'enabled');
84
- })
85
- .then((hasActiveSubscription) => {
86
- if (hasActiveSubscription) {
87
- return Promise.resolve();
88
- }
89
- if (this.verbose) {
90
- logger.logToStderr(`Starting subscription since subscription is not active for the content type`);
91
- }
92
- const startSubscriptionEndPoint = `activity/feed/subscriptions/start?contentType=${AuditContentTypes[args.options.contentType]}&PublisherIdentifier=${this.tenantId}`;
93
- const requestOptions = {
94
- url: `${this.serviceUrl}/${this.tenantId}/${startSubscriptionEndPoint}`,
95
- headers: {
96
- accept: 'application/json;odata.metadata=none'
97
- },
98
- responseType: 'json'
99
- };
100
- return request_1.default.post(requestOptions);
101
- });
102
- }
103
- getAuditContentList(args, logger) {
104
- if (this.verbose) {
105
- logger.logToStderr(`Start listing Audit Content URL`);
106
- }
107
- let subscriptionListEndpoint = `activity/feed/subscriptions/content?contentType=${AuditContentTypes[args.options.contentType]}&PublisherIdentifier=${this.tenantId}`;
108
- if (typeof args.options.startTime !== 'undefined') {
109
- if (typeof args.options.endTime !== 'undefined') {
110
- subscriptionListEndpoint += `&starttime=${escape(args.options.startTime)}&endTime=${escape(args.options.endTime)}`;
111
- }
112
- else {
113
- const parsedEndDate = new Date(args.options.startTime);
114
- parsedEndDate.setDate(parsedEndDate.getDate() + 1);
115
- subscriptionListEndpoint += `&starttime=${escape(args.options.startTime)}&endTime=${escape(parsedEndDate.toISOString())}`;
116
- }
117
- }
118
- const requestOptions = {
119
- url: `${this.serviceUrl}/${this.tenantId}/${subscriptionListEndpoint}`,
120
- headers: {
121
- accept: 'application/json;odata.metadata=none'
122
- },
123
- responseType: 'json'
124
- };
125
- return request_1.default.get(requestOptions);
126
- }
127
- getBatchedPromises(auditContentLists, batchSize) {
128
- const batchedPromises = [];
129
- for (let i = 0; i < auditContentLists.length; i += batchSize) {
130
- const promiseRequestBatch = auditContentLists
131
- .slice(i, i + batchSize < auditContentLists.length ? i + batchSize : auditContentLists.length)
132
- .map((AuditContentList) => this.getAuditLogReportForSingleContentUrl(AuditContentList.contentUri));
133
- batchedPromises.push(promiseRequestBatch);
134
- }
135
- return Promise.resolve(batchedPromises);
136
- }
137
- getBatchedAuditlogData(logger, batchedPromiseList, batchNumber, resolve, reject) {
138
- if (this.verbose) {
139
- logger.logToStderr(`Starting Batch : ${batchNumber}`);
140
- }
141
- Promise
142
- .all(batchedPromiseList[batchNumber])
143
- .then((data) => {
144
- data.forEach(d1 => {
145
- d1.forEach(d2 => {
146
- this.completeAuditReports.push(d2);
147
- });
148
- });
149
- if (batchNumber < batchedPromiseList.length - 1) {
150
- this.getBatchedAuditlogData(logger, batchedPromiseList, ++batchNumber, resolve, reject);
151
- }
152
- else {
153
- resolve();
154
- }
155
- }, (err) => reject(err));
156
- }
157
- getAuditLogReportForSingleContentUrl(auditURL) {
158
- const requestOptions = {
159
- url: auditURL,
160
- headers: {
161
- accept: 'application/json'
162
- },
163
- responseType: 'json'
164
- };
165
- return request_1.default.get(requestOptions);
166
- }
167
- get auditContentTypeLists() {
168
- const result = [];
169
- for (const auditContentType in AuditContentTypes) {
170
- result.push(auditContentType);
171
- }
172
- return result;
173
- }
174
- options() {
175
- const options = [
176
- {
177
- option: '-c, --contentType <contentType>',
178
- autocomplete: this.auditContentTypeLists
179
- },
180
- {
181
- option: '-s, --startTime [startTime]'
182
- },
183
- {
184
- option: '-e, --endTime [endTime]'
185
- }
186
- ];
187
- const parentOptions = super.options();
188
- return options.concat(parentOptions);
189
- }
190
- validate(args) {
191
- if (AuditContentTypes[args.options.contentType] === undefined) {
192
- return `${args.options.contentType} is not a valid value for the contentType option. Allowed values are ${this.auditContentTypeLists.join(' | ')}`;
193
- }
194
- if (args.options.startTime || args.options.endTime) {
195
- if (!args.options.startTime) {
196
- return `Please specify startTime`;
197
- }
198
- const parsedStartTime = Date.parse(args.options.startTime);
199
- if (isNaN(parsedStartTime)) {
200
- return `${args.options.startTime} is not a valid startTime. Provide the date in one of the following formats:
201
- 'YYYY-MM-DD'
202
- 'YYYY-MM-DDThh:mm'
203
- 'YYYY-MM-DDThh:mmZ'
204
- 'YYYY-MM-DDThh:mm±hh:mm'`;
205
- }
206
- const startdateTodayDifference = (new Date().getTime() - parsedStartTime) / (1000 * 60 * 60 * 24);
207
- if (startdateTodayDifference > 7) {
208
- return `Start time should be no more than 7 days in the past`;
209
- }
210
- if (args.options.endTime) {
211
- const parsedEndTime = Date.parse(args.options.endTime);
212
- if (isNaN(parsedEndTime)) {
213
- return `${args.options.endTime} is not a valid endTime. Provide the date in one of the following formats:
214
- 'YYYY-MM-DD'
215
- 'YYYY-MM-DDThh:mm'
216
- 'YYYY-MM-DDThh:mmZ'
217
- 'YYYY-MM-DDThh:mm±hh:mm'`;
218
- }
219
- if (parsedStartTime && parsedEndTime) {
220
- const startEndDateDifference = (parsedEndTime - parsedStartTime) / (1000 * 60 * 60 * 24);
221
- if (startEndDateDifference < 0 || startEndDateDifference > 1) {
222
- return `startTime and endTime must be less than or equal to 24 hours apart, with the start time prior to end time.`;
223
- }
224
- }
225
- }
226
- }
227
- return true;
228
- }
229
- }
230
- module.exports = new TenantAuditlogReportCommand();
231
- //# sourceMappingURL=auditlog-report.js.map
@@ -1,41 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const Auth_1 = require("../../../../Auth");
4
- const Command_1 = require("../../../../Command");
5
- const request_1 = require("../../../../request");
6
- const utils_1 = require("../../../../utils");
7
- const commands_1 = require("../../commands");
8
- class TenantServiceListCommand extends Command_1.default {
9
- get name() {
10
- return commands_1.default.SERVICE_LIST;
11
- }
12
- get description() {
13
- return 'Gets services available in Microsoft 365';
14
- }
15
- defaultProperties() {
16
- return ['Id', 'DisplayName'];
17
- }
18
- commandAction(logger, args, cb) {
19
- if (this.verbose) {
20
- logger.logToStderr(`Getting the health status of the different services in Microsoft 365.`);
21
- }
22
- const serviceUrl = 'https://manage.office.com/api/v1.0';
23
- const statusEndpoint = 'ServiceComms/Services';
24
- const tenantId = utils_1.accessToken.getTenantIdFromAccessToken(Auth_1.default.service.accessTokens[Auth_1.default.defaultResource].accessToken);
25
- const requestOptions = {
26
- url: `${serviceUrl}/${tenantId}/${statusEndpoint}`,
27
- headers: {
28
- accept: 'application/json;odata.metadata=none'
29
- },
30
- responseType: 'json'
31
- };
32
- request_1.default
33
- .get(requestOptions)
34
- .then((res) => {
35
- logger.log(res.value);
36
- cb();
37
- }, (err) => this.handleRejectedODataJsonPromise(err, logger, cb));
38
- }
39
- }
40
- module.exports = new TenantServiceListCommand();
41
- //# sourceMappingURL=service-list.js.map
@@ -1,55 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const Auth_1 = require("../../../../Auth");
4
- const Command_1 = require("../../../../Command");
5
- const request_1 = require("../../../../request");
6
- const utils_1 = require("../../../../utils");
7
- const commands_1 = require("../../commands");
8
- class TenantServiceMessageListCommand extends Command_1.default {
9
- get name() {
10
- return commands_1.default.SERVICE_MESSAGE_LIST;
11
- }
12
- get description() {
13
- return 'Gets service messages Microsoft 365';
14
- }
15
- defaultProperties() {
16
- return ['Workload', 'Id', 'Message'];
17
- }
18
- commandAction(logger, args, cb) {
19
- if (this.verbose) {
20
- logger.logToStderr(`Getting service messages...`);
21
- }
22
- const serviceUrl = 'https://manage.office.com/api/v1.0';
23
- const statusEndpoint = args.options.workload ? `ServiceComms/Messages?$filter=Workload eq '${encodeURIComponent(args.options.workload)}'` : 'ServiceComms/Messages';
24
- const tenantId = utils_1.accessToken.getTenantIdFromAccessToken(Auth_1.default.service.accessTokens[Auth_1.default.defaultResource].accessToken);
25
- const requestOptions = {
26
- url: `${serviceUrl}/${tenantId}/${statusEndpoint}`,
27
- headers: {
28
- accept: 'application/json;odata.metadata=none'
29
- },
30
- responseType: 'json'
31
- };
32
- request_1.default
33
- .get(requestOptions)
34
- .then((res) => {
35
- res.value.forEach(r => {
36
- r.Workload = r.Id.startsWith('MC') ? r.AffectedWorkloadDisplayNames.join(', ') : r.Workload;
37
- r.Id = r.Id;
38
- r.Message = r.Id.startsWith('MC') ? r.Title : r.ImpactDescription;
39
- });
40
- logger.log(res.value);
41
- cb();
42
- }, (err) => this.handleRejectedODataJsonPromise(err, logger, cb));
43
- }
44
- options() {
45
- const options = [
46
- {
47
- option: '-w, --workload [workload] '
48
- }
49
- ];
50
- const parentOptions = super.options();
51
- return options.concat(parentOptions);
52
- }
53
- }
54
- module.exports = new TenantServiceMessageListCommand();
55
- //# sourceMappingURL=service-message-list.js.map
@@ -1,54 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const Auth_1 = require("../../../../Auth");
4
- const Command_1 = require("../../../../Command");
5
- const request_1 = require("../../../../request");
6
- const utils_1 = require("../../../../utils");
7
- const commands_1 = require("../../commands");
8
- class TenantServiceReportHistoricalServiceStatusCommand extends Command_1.default {
9
- get name() {
10
- return commands_1.default.SERVICE_REPORT_HISTORICALSERVICESTATUS;
11
- }
12
- get description() {
13
- return 'Gets the historical service status of Microsoft 365 Services of the last 7 days';
14
- }
15
- getTelemetryProperties(args) {
16
- const telemetryProps = super.getTelemetryProperties(args);
17
- telemetryProps.workload = args.options.workload;
18
- return telemetryProps;
19
- }
20
- defaultProperties() {
21
- return ['WorkloadDisplayName', 'StatusDisplayName', 'StatusTime'];
22
- }
23
- commandAction(logger, args, cb) {
24
- if (this.verbose) {
25
- logger.logToStderr(`Gets the historical service status of Microsoft 365 Services of the last 7 days`);
26
- }
27
- const serviceUrl = 'https://manage.office.com/api/v1.0';
28
- const statusEndpoint = typeof args.options.workload !== 'undefined' ? `ServiceComms/HistoricalStatus?$filter=Workload eq '${encodeURIComponent(args.options.workload)}'` : 'ServiceComms/HistoricalStatus';
29
- const tenantId = utils_1.accessToken.getTenantIdFromAccessToken(Auth_1.default.service.accessTokens[Auth_1.default.defaultResource].accessToken);
30
- const requestOptions = {
31
- url: `${serviceUrl}/${tenantId}/${statusEndpoint}`,
32
- headers: {
33
- accept: 'application/json;odata.metadata=none'
34
- },
35
- responseType: 'json'
36
- };
37
- request_1.default.get(requestOptions)
38
- .then((res) => {
39
- logger.log(res);
40
- cb();
41
- }, (err) => this.handleRejectedODataJsonPromise(err, logger, cb));
42
- }
43
- options() {
44
- const options = [
45
- {
46
- option: '-w, --workload [workload]'
47
- }
48
- ];
49
- const parentOptions = super.options();
50
- return options.concat(parentOptions);
51
- }
52
- }
53
- module.exports = new TenantServiceReportHistoricalServiceStatusCommand();
54
- //# sourceMappingURL=service-report-historicalservicestatus.js.map
@@ -1,55 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const Auth_1 = require("../../../../Auth");
4
- const Command_1 = require("../../../../Command");
5
- const request_1 = require("../../../../request");
6
- const utils_1 = require("../../../../utils");
7
- const commands_1 = require("../../commands");
8
- class TenantStatusListCommand extends Command_1.default {
9
- get name() {
10
- return commands_1.default.STATUS_LIST;
11
- }
12
- get description() {
13
- return 'Gets health status of the different services in Microsoft 365';
14
- }
15
- getTelemetryProperties(args) {
16
- const telemetryProps = super.getTelemetryProperties(args);
17
- telemetryProps.workload = args.options.workload;
18
- return telemetryProps;
19
- }
20
- defaultProperties() {
21
- return ['WorkloadDisplayName', 'StatusDisplayName'];
22
- }
23
- commandAction(logger, args, cb) {
24
- if (this.verbose) {
25
- logger.logToStderr(`Getting the health status of the different services in Microsoft 365.`);
26
- }
27
- const serviceUrl = 'https://manage.office.com/api/v1.0';
28
- const statusEndpoint = typeof args.options.workload !== 'undefined' ? `ServiceComms/CurrentStatus?$filter=Workload eq '${encodeURIComponent(args.options.workload)}'` : 'ServiceComms/CurrentStatus';
29
- const tenantId = utils_1.accessToken.getTenantIdFromAccessToken(Auth_1.default.service.accessTokens[Auth_1.default.defaultResource].accessToken);
30
- const requestOptions = {
31
- url: `${serviceUrl}/${tenantId}/${statusEndpoint}`,
32
- headers: {
33
- accept: 'application/json;odata.metadata=none'
34
- },
35
- responseType: 'json'
36
- };
37
- request_1.default
38
- .get(requestOptions)
39
- .then((res) => {
40
- logger.log(res.value);
41
- cb();
42
- }, (err) => this.handleRejectedODataJsonPromise(err, logger, cb));
43
- }
44
- options() {
45
- const options = [
46
- {
47
- option: '-w, --workload [workload]'
48
- }
49
- ];
50
- const parentOptions = super.options();
51
- return options.concat(parentOptions);
52
- }
53
- }
54
- module.exports = new TenantStatusListCommand();
55
- //# sourceMappingURL=status-list.js.map
@@ -1,61 +0,0 @@
1
- # tenant auditlog report
2
-
3
- Gets audit logs from the Office 365 Management API
4
-
5
- ## Usage
6
-
7
- ```sh
8
- m365 tenant auditlog report [options]
9
- ```
10
-
11
- ## Options
12
-
13
- `-c, --contentType <contentType>`
14
- : Audit content type of logs to be retrieved, should be one of the following: `AzureActiveDirectory`, `Exchange`, `SharePoint`, `General`, `DLP`.
15
-
16
- `-s, --startTime [startTime]`
17
- : Start time of logs to be retrieved. Start time and end time must be less than or equal to 24 hours apart. Start time is mandatory if End time is specified.
18
-
19
- `-e, --endTime [endTime]`
20
- : End time of logs to be retrieved. Start time and end time must be less than or equal to 24 hours apart. If End time is not specified, command will assume the End time to be 24 hours from the specified Start time.
21
-
22
- --8<-- "docs/cmd/_global.md"
23
-
24
- ## Remarks
25
-
26
- By default, if `startTime` and `endTime` are not mentioned, then the content available in the last **24 hours** is returned. `startTime` and `endTime` must be less than or equal to **24 hours** apart, with the `startTime` prior to `endTime` and `startTime` no more than 7 days in the past.
27
-
28
- If `endTime` is not specified, command will assume the `endTime` to be **24 hours** from the specified `startTime`.
29
- `startTime` is mandatory if `endTime` is specified.
30
-
31
- `DLP` audit log data is only available to users that have been granted “Read DLP sensitive data” permission. Otherwise you will get `Error: Request failed with status code 401`
32
-
33
- ## Examples
34
-
35
- Gets audit logs from the Office 365 Management API for the `Exchange` content type.
36
-
37
- ```sh
38
- m365 tenant auditlog report --contentType "Exchange"
39
- ```
40
-
41
- Gets audit logs from the Office 365 Management API for the `Exchange` content type in the date range between `2020-12-13` and `2020-12-14`
42
-
43
- ```sh
44
- m365 tenant auditlog report --contentType "Exchange" --startTime "2020-12-13" --endTime "2020-12-14"
45
- ```
46
-
47
- Gets audit logs from the Office 365 Management API for the `Exchange` content type between `15:00` hours and `16:00` hours on `2020-12-13`
48
-
49
- ```sh
50
- m365 tenant auditlog report --contentType "Exchange" --startTime "2020-12-13T15:00:00" --endTime "2020-12-13T16:00:00"
51
- ```
52
-
53
- Gets audit logs from the Office 365 Management API for the `Exchange` content type between `23:00` hours on `2020-12-13` and `05:00` hours on `2020-12-14`
54
-
55
- ```sh
56
- m365 tenant auditlog report --contentType "Exchange" --startTime "2020-12-13T23:00:00" --endTime "2020-12-14T05:00:00"
57
- ```
58
-
59
- ## More information
60
-
61
- - Office 365 Management Activity API reference: [https://docs.microsoft.com/en-us/office/office-365-management-api/office-365-management-activity-api-reference](https://docs.microsoft.com/en-us/office/office-365-management-api/office-365-management-activity-api-reference)
@@ -1,25 +0,0 @@
1
- # tenant service list
2
-
3
- Gets services available in Microsoft 365
4
-
5
- ## Usage
6
-
7
- ```sh
8
- m365 tenant service list [options]
9
- ```
10
-
11
- ## Options
12
-
13
- --8<-- "docs/cmd/_global.md"
14
-
15
- ## Examples
16
-
17
- Get services available in Microsoft 365
18
-
19
- ```sh
20
- m365 tenant service list
21
- ```
22
-
23
- ## More information
24
-
25
- - Microsoft 365 Service Communications API reference: [https://docs.microsoft.com/en-us/office/office-365-management-api/office-365-service-communications-api-reference#get-services](https://docs.microsoft.com/en-us/office/office-365-management-api/office-365-service-communications-api-reference#get-services)
@@ -1,34 +0,0 @@
1
- # tenant service message list
2
-
3
- Gets service messages Microsoft 365
4
-
5
- ## Usage
6
-
7
- ```sh
8
- m365 tenant service message list [options]
9
- ```
10
-
11
- ## Options
12
-
13
- `-w, --workload [workload]`
14
- : Retrieve service messages for the particular workload. If not provided, retrieves messages for all workloads
15
-
16
- --8<-- "docs/cmd/_global.md"
17
-
18
- ## Examples
19
-
20
- Get service messages of all services in Microsoft 365
21
-
22
- ```sh
23
- m365 tenant service message list
24
- ```
25
-
26
- Get service messages for Microsoft Teams
27
-
28
- ```sh
29
- m365 tenant service message list --workload microsoftteams
30
- ```
31
-
32
- ## More information
33
-
34
- - Microsoft 365 Service Communications API reference: [https://docs.microsoft.com/office/office-365-management-api/office-365-service-communications-api-reference#get-messages](https://docs.microsoft.com/office/office-365-management-api/office-365-service-communications-api-reference#get-messages)
@@ -1,38 +0,0 @@
1
- # tenant service report historicalservicestatus
2
-
3
- Gets the historical service status of Microsoft 365 Services of the last 7 days
4
-
5
- ## Usage
6
-
7
- ```sh
8
- m365 tenant service report historicalservicestatus [options]
9
- ```
10
-
11
- ## Options
12
-
13
- `-w, --workload [workload]`
14
- : Retrieve the historical service status for the particular service. If not provided, the historical service status of all services will be returned.
15
-
16
- --8<-- "docs/cmd/_global.md"
17
-
18
- ## Remarks
19
-
20
- To get the name of the particular workload for use with the workload option, execute `m365 tenant service report historicalservicestatus --output json` and get the value of the `Workload` property for the particular service.
21
-
22
- ## Examples
23
-
24
- Gets the historical service status of Microsoft 365 Services of the last 7 days
25
-
26
- ```sh
27
- m365 tenant service report historicalservicestatus
28
- ```
29
-
30
- Gets the historical service status of Microsoft Teams for the last 7 days
31
-
32
- ```sh
33
- m365 tenant service report historicalservicestatus --workload "microsoftteams"
34
- ```
35
-
36
- ## More information
37
-
38
- - Microsoft 365 Service Communications API reference: [https://docs.microsoft.com/en-us/office/office-365-management-api/office-365-service-communications-api-reference#get-historical-status](https://docs.microsoft.com/en-us/office/office-365-management-api/office-365-service-communications-api-reference#get-historical-status)
@@ -1,34 +0,0 @@
1
- # tenant status list
2
-
3
- Gets health status of the different services in Microsoft 365
4
-
5
- ## Usage
6
-
7
- ```sh
8
- m365 tenant status list [options]
9
- ```
10
-
11
- ## Options
12
-
13
- `-w, --workload [workload]`
14
- : Retrieve service status for the specified service. If not provided, will list the current service status of all services
15
-
16
- --8<-- "docs/cmd/_global.md"
17
-
18
- ## Examples
19
-
20
- Gets health status of the different services in Microsoft 365
21
-
22
- ```sh
23
- m365 tenant status list
24
- ```
25
-
26
- Gets health status for SharePoint Online
27
-
28
- ```sh
29
- m365 tenant status list --workload "SharePoint"
30
- ```
31
-
32
- ## More information
33
-
34
- - Microsoft 365 Service Communications API reference: [https://docs.microsoft.com/en-us/office/office-365-management-api/office-365-service-communications-api-reference#get-current-status](https://docs.microsoft.com/en-us/office/office-365-management-api/office-365-service-communications-api-reference#get-current-status)