@pnp/cli-microsoft365 5.0.0-beta.21e7f85 → 5.0.0-beta.30c8613

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.
@@ -3,17 +3,20 @@
3
3
  "dockerFile": "Dockerfile",
4
4
  "settings": {
5
5
  "terminal.integrated.profiles.linux": {
6
- "zsh": {
7
- "path": "/bin/zsh",
8
- "args": [
9
- "-l"
10
- ]
11
- }
12
- },
13
- "terminal.integrated.defaultProfile.linux": "zsh"
6
+ "zsh": {
7
+ "path": "/bin/zsh",
8
+ "args": [
9
+ "-l"
10
+ ]
11
+ }
12
+ },
13
+ "terminal.integrated.defaultProfile.linux": "zsh"
14
14
  },
15
15
  "postCreateCommand": "npm i && npm run clean && npm run build && npm link",
16
16
  "extensions": [
17
- "dbaeumer.vscode-eslint"
17
+ "dbaeumer.vscode-eslint",
18
+ "hbenl.vscode-test-explorer",
19
+ "hbenl.vscode-mocha-test-adapter",
20
+ "eamodio.gitlens"
18
21
  ]
19
22
  }
package/.mocharc.json ADDED
@@ -0,0 +1,9 @@
1
+ {
2
+ "extension": [
3
+ "ts"
4
+ ],
5
+ "spec": "dist/**/*.spec.js",
6
+ "require": "source-map-support/register",
7
+ "watch": "dist/**/*.js",
8
+ "logpanel": true
9
+ }
package/README.md CHANGED
@@ -208,9 +208,9 @@ If you want to get involved with helping us grow the CLI, whether that is sugges
208
208
 
209
209
  Checkout our [Wiki](https://github.com/pnp/cli-microsoft365/wiki) for guides on how to contribute to this project.
210
210
 
211
- ## Sharing is Caring
211
+ ## Microsoft 365 Platform Community
212
212
 
213
- This project is associated with the [Microsoft 365 Patterns and Practices](https://pnp.github.io) (PnP) organisation, which is a virtual team consisting of Microsoft employees and community members focused on helping the community make the best use of Microsoft products.
213
+ CLI for Microsoft 365 is a [Microsoft 365 Platform Community](https://pnp.github.io) (PnP) project. Microsoft 365 Platform Community is a virtual team consisting of Microsoft employees and community members focused on helping the community make the best use of Microsoft products. CLI for Microsoft 365 is an open-source project not affiliated with Microsoft and not covered by Microsoft support. If you experience any issues using the CLI, please submit an issue in the [issues list](https://github.com/pnp/cli-microsoft365/issues).
214
214
 
215
215
  ## Disclaimer
216
216
 
@@ -1,5 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ const fs = require("fs");
3
4
  const request_1 = require("../../../../request");
4
5
  const Utils_1 = require("../../../../Utils");
5
6
  const GraphCommand_1 = require("../../../base/GraphCommand");
@@ -21,16 +22,8 @@ class AadAppGetCommand extends GraphCommand_1.default {
21
22
  commandAction(logger, args, cb) {
22
23
  this
23
24
  .getAppObjectId(args)
24
- .then((appObjectId) => {
25
- const requestOptions = {
26
- url: `${this.resource}/v1.0/myorganization/applications/${appObjectId}`,
27
- headers: {
28
- accept: 'application/json;odata.metadata=none'
29
- },
30
- responseType: 'json'
31
- };
32
- return request_1.default.get(requestOptions);
33
- })
25
+ .then(appObjectId => this.getAppInfo(appObjectId))
26
+ .then(appInfo => this.saveAppInfo(args, appInfo, logger))
34
27
  .then((res) => {
35
28
  logger.log(res);
36
29
  cb();
@@ -64,11 +57,63 @@ class AadAppGetCommand extends GraphCommand_1.default {
64
57
  return Promise.reject(`Multiple Azure AD application registration with name ${name} found. Please disambiguate (app object IDs): ${res.value.map(a => a.id).join(', ')}`);
65
58
  });
66
59
  }
60
+ getAppInfo(appObjectId) {
61
+ const requestOptions = {
62
+ url: `${this.resource}/v1.0/myorganization/applications/${appObjectId}`,
63
+ headers: {
64
+ accept: 'application/json;odata.metadata=none'
65
+ },
66
+ responseType: 'json'
67
+ };
68
+ return request_1.default.get(requestOptions);
69
+ }
70
+ saveAppInfo(args, appInfo, logger) {
71
+ if (!args.options.save) {
72
+ return Promise.resolve(appInfo);
73
+ }
74
+ const filePath = '.m365rc.json';
75
+ if (this.verbose) {
76
+ logger.logToStderr(`Saving Azure AD app registration information to the ${filePath} file...`);
77
+ }
78
+ let m365rc = {};
79
+ if (fs.existsSync(filePath)) {
80
+ if (this.debug) {
81
+ logger.logToStderr(`Reading existing ${filePath}...`);
82
+ }
83
+ try {
84
+ const fileContents = fs.readFileSync(filePath, 'utf8');
85
+ if (fileContents) {
86
+ m365rc = JSON.parse(fileContents);
87
+ }
88
+ }
89
+ catch (e) {
90
+ logger.logToStderr(`Error reading ${filePath}: ${e}. Please add app info to ${filePath} manually.`);
91
+ return Promise.resolve(appInfo);
92
+ }
93
+ }
94
+ if (!m365rc.apps) {
95
+ m365rc.apps = [];
96
+ }
97
+ if (!m365rc.apps.some(a => a.appId === appInfo.appId)) {
98
+ m365rc.apps.push({
99
+ appId: appInfo.appId,
100
+ name: appInfo.displayName
101
+ });
102
+ try {
103
+ fs.writeFileSync(filePath, JSON.stringify(m365rc, null, 2));
104
+ }
105
+ catch (e) {
106
+ logger.logToStderr(`Error writing ${filePath}: ${e}. Please add app info to ${filePath} manually.`);
107
+ }
108
+ }
109
+ return Promise.resolve(appInfo);
110
+ }
67
111
  options() {
68
112
  const options = [
69
113
  { option: '--appId [appId]' },
70
114
  { option: '--objectId [objectId]' },
71
- { option: '--name [name]' }
115
+ { option: '--name [name]' },
116
+ { option: '--save' }
72
117
  ];
73
118
  const parentOptions = super.options();
74
119
  return options.concat(parentOptions);
@@ -28,32 +28,32 @@ const FN006006_CFG_PS_features_1 = require("./rules/FN006006_CFG_PS_features");
28
28
  const FN010001_YORC_version_1 = require("./rules/FN010001_YORC_version");
29
29
  const FN014008_CODE_launch_hostedWorkbench_type_1 = require("./rules/FN014008_CODE_launch_hostedWorkbench_type");
30
30
  module.exports = [
31
- new FN001001_DEP_microsoft_sp_core_library_1.FN001001_DEP_microsoft_sp_core_library('1.14.0-rc.2'),
32
- new FN001002_DEP_microsoft_sp_lodash_subset_1.FN001002_DEP_microsoft_sp_lodash_subset('1.14.0-rc.2'),
33
- new FN001003_DEP_microsoft_sp_office_ui_fabric_core_1.FN001003_DEP_microsoft_sp_office_ui_fabric_core('1.14.0-rc.2'),
34
- new FN001004_DEP_microsoft_sp_webpart_base_1.FN001004_DEP_microsoft_sp_webpart_base('1.14.0-rc.2'),
35
- new FN001011_DEP_microsoft_sp_dialog_1.FN001011_DEP_microsoft_sp_dialog('1.14.0-rc.2'),
36
- new FN001012_DEP_microsoft_sp_application_base_1.FN001012_DEP_microsoft_sp_application_base('1.14.0-rc.2'),
37
- new FN001013_DEP_microsoft_decorators_1.FN001013_DEP_microsoft_decorators('1.14.0-rc.2'),
38
- new FN001014_DEP_microsoft_sp_listview_extensibility_1.FN001014_DEP_microsoft_sp_listview_extensibility('1.14.0-rc.2'),
39
- new FN001021_DEP_microsoft_sp_property_pane_1.FN001021_DEP_microsoft_sp_property_pane('1.14.0-rc.2'),
40
- new FN001023_DEP_microsoft_sp_component_base_1.FN001023_DEP_microsoft_sp_component_base('1.14.0-rc.2'),
41
- new FN001024_DEP_microsoft_sp_diagnostics_1.FN001024_DEP_microsoft_sp_diagnostics('1.14.0-rc.2'),
42
- new FN001025_DEP_microsoft_sp_dynamic_data_1.FN001025_DEP_microsoft_sp_dynamic_data('1.14.0-rc.2'),
43
- new FN001026_DEP_microsoft_sp_extension_base_1.FN001026_DEP_microsoft_sp_extension_base('1.14.0-rc.2'),
44
- new FN001027_DEP_microsoft_sp_http_1.FN001027_DEP_microsoft_sp_http('1.14.0-rc.2'),
45
- new FN001028_DEP_microsoft_sp_list_subscription_1.FN001028_DEP_microsoft_sp_list_subscription('1.14.0-rc.2'),
46
- new FN001029_DEP_microsoft_sp_loader_1.FN001029_DEP_microsoft_sp_loader('1.14.0-rc.2'),
47
- new FN001030_DEP_microsoft_sp_module_interfaces_1.FN001030_DEP_microsoft_sp_module_interfaces('1.14.0-rc.2'),
48
- new FN001031_DEP_microsoft_sp_odata_types_1.FN001031_DEP_microsoft_sp_odata_types('1.14.0-rc.2'),
49
- new FN001032_DEP_microsoft_sp_page_context_1.FN001032_DEP_microsoft_sp_page_context('1.14.0-rc.2'),
50
- new FN002001_DEVDEP_microsoft_sp_build_web_1.FN002001_DEVDEP_microsoft_sp_build_web('1.14.0-rc.2'),
51
- new FN002002_DEVDEP_microsoft_sp_module_interfaces_1.FN002002_DEVDEP_microsoft_sp_module_interfaces('1.14.0-rc.2'),
52
- new FN002009_DEVDEP_microsoft_sp_tslint_rules_1.FN002009_DEVDEP_microsoft_sp_tslint_rules('1.14.0-rc.2'),
53
- new FN006004_CFG_PS_developer_1.FN006004_CFG_PS_developer('1.14.0-rc.2'),
31
+ new FN001001_DEP_microsoft_sp_core_library_1.FN001001_DEP_microsoft_sp_core_library('1.14.0'),
32
+ new FN001002_DEP_microsoft_sp_lodash_subset_1.FN001002_DEP_microsoft_sp_lodash_subset('1.14.0'),
33
+ new FN001003_DEP_microsoft_sp_office_ui_fabric_core_1.FN001003_DEP_microsoft_sp_office_ui_fabric_core('1.14.0'),
34
+ new FN001004_DEP_microsoft_sp_webpart_base_1.FN001004_DEP_microsoft_sp_webpart_base('1.14.0'),
35
+ new FN001011_DEP_microsoft_sp_dialog_1.FN001011_DEP_microsoft_sp_dialog('1.14.0'),
36
+ new FN001012_DEP_microsoft_sp_application_base_1.FN001012_DEP_microsoft_sp_application_base('1.14.0'),
37
+ new FN001013_DEP_microsoft_decorators_1.FN001013_DEP_microsoft_decorators('1.14.0'),
38
+ new FN001014_DEP_microsoft_sp_listview_extensibility_1.FN001014_DEP_microsoft_sp_listview_extensibility('1.14.0'),
39
+ new FN001021_DEP_microsoft_sp_property_pane_1.FN001021_DEP_microsoft_sp_property_pane('1.14.0'),
40
+ new FN001023_DEP_microsoft_sp_component_base_1.FN001023_DEP_microsoft_sp_component_base('1.14.0'),
41
+ new FN001024_DEP_microsoft_sp_diagnostics_1.FN001024_DEP_microsoft_sp_diagnostics('1.14.0'),
42
+ new FN001025_DEP_microsoft_sp_dynamic_data_1.FN001025_DEP_microsoft_sp_dynamic_data('1.14.0'),
43
+ new FN001026_DEP_microsoft_sp_extension_base_1.FN001026_DEP_microsoft_sp_extension_base('1.14.0'),
44
+ new FN001027_DEP_microsoft_sp_http_1.FN001027_DEP_microsoft_sp_http('1.14.0'),
45
+ new FN001028_DEP_microsoft_sp_list_subscription_1.FN001028_DEP_microsoft_sp_list_subscription('1.14.0'),
46
+ new FN001029_DEP_microsoft_sp_loader_1.FN001029_DEP_microsoft_sp_loader('1.14.0'),
47
+ new FN001030_DEP_microsoft_sp_module_interfaces_1.FN001030_DEP_microsoft_sp_module_interfaces('1.14.0'),
48
+ new FN001031_DEP_microsoft_sp_odata_types_1.FN001031_DEP_microsoft_sp_odata_types('1.14.0'),
49
+ new FN001032_DEP_microsoft_sp_page_context_1.FN001032_DEP_microsoft_sp_page_context('1.14.0'),
50
+ new FN002001_DEVDEP_microsoft_sp_build_web_1.FN002001_DEVDEP_microsoft_sp_build_web('1.14.0'),
51
+ new FN002002_DEVDEP_microsoft_sp_module_interfaces_1.FN002002_DEVDEP_microsoft_sp_module_interfaces('1.14.0'),
52
+ new FN002009_DEVDEP_microsoft_sp_tslint_rules_1.FN002009_DEVDEP_microsoft_sp_tslint_rules('1.14.0'),
53
+ new FN006004_CFG_PS_developer_1.FN006004_CFG_PS_developer('1.14.0'),
54
54
  new FN006005_CFG_PS_metadata_1.FN006005_CFG_PS_metadata(),
55
55
  new FN006006_CFG_PS_features_1.FN006006_CFG_PS_features(),
56
- new FN010001_YORC_version_1.FN010001_YORC_version('1.14.0-rc.2'),
56
+ new FN010001_YORC_version_1.FN010001_YORC_version('1.14.0'),
57
57
  new FN014008_CODE_launch_hostedWorkbench_type_1.FN014008_CODE_launch_hostedWorkbench_type('pwa-chrome')
58
58
  ];
59
- //# sourceMappingURL=upgrade-1.14.0-rc.2.js.map
59
+ //# sourceMappingURL=upgrade-1.14.0.js.map
@@ -3,8 +3,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const fs = require("fs");
4
4
  const os = require("os");
5
5
  const path = require("path");
6
- // uncomment to support upgrading to preview releases
7
- const semver_1 = require("semver");
8
6
  const Command_1 = require("../../../../Command");
9
7
  const commands_1 = require("../../commands");
10
8
  const base_project_command_1 = require("./base-project-command");
@@ -45,7 +43,7 @@ class SpfxProjectUpgradeCommand extends base_project_command_1.BaseProjectComman
45
43
  '1.12.1',
46
44
  '1.13.0',
47
45
  '1.13.1',
48
- '1.14.0-rc.2'
46
+ '1.14.0'
49
47
  ];
50
48
  }
51
49
  get name() {
@@ -58,9 +56,9 @@ class SpfxProjectUpgradeCommand extends base_project_command_1.BaseProjectComman
58
56
  const telemetryProps = super.getTelemetryProperties(args);
59
57
  telemetryProps.toVersion = args.options.toVersion || this.supportedVersions[this.supportedVersions.length - 1];
60
58
  // uncomment to support upgrading to preview releases
61
- if ((0, semver_1.prerelease)(telemetryProps.toVersion) && !args.options.preview) {
62
- telemetryProps.toVersion = this.supportedVersions[this.supportedVersions.length - 2];
63
- }
59
+ // if (prerelease(telemetryProps.toVersion) && !args.options.preview) {
60
+ // telemetryProps.toVersion = this.supportedVersions[this.supportedVersions.length - 2];
61
+ // }
64
62
  telemetryProps.packageManager = args.options.packageManager || 'npm';
65
63
  telemetryProps.shell = args.options.shell || 'bash';
66
64
  telemetryProps.preview = args.options.preview;
@@ -74,15 +72,15 @@ class SpfxProjectUpgradeCommand extends base_project_command_1.BaseProjectComman
74
72
  }
75
73
  this.toVersion = args.options.toVersion ? args.options.toVersion : this.supportedVersions[this.supportedVersions.length - 1];
76
74
  // uncomment to support upgrading to preview releases
77
- if (!args.options.toVersion &&
78
- !args.options.preview &&
79
- (0, semver_1.prerelease)(this.toVersion)) {
80
- // no version and no preview specified while the current version to
81
- // upgrade to is a prerelease so let's grab the first non-preview version
82
- // since we're supporting only one preview version, it's sufficient for
83
- // us to take second to last version
84
- this.toVersion = this.supportedVersions[this.supportedVersions.length - 2];
85
- }
75
+ // if (!args.options.toVersion &&
76
+ // !args.options.preview &&
77
+ // prerelease(this.toVersion)) {
78
+ // // no version and no preview specified while the current version to
79
+ // // upgrade to is a prerelease so let's grab the first non-preview version
80
+ // // since we're supporting only one preview version, it's sufficient for
81
+ // // us to take second to last version
82
+ // this.toVersion = this.supportedVersions[this.supportedVersions.length - 2];
83
+ // }
86
84
  this.packageManager = args.options.packageManager || 'npm';
87
85
  this.shell = args.options.shell || 'bash';
88
86
  if (this.supportedVersions.indexOf(this.toVersion) < 0) {
@@ -406,8 +406,8 @@ class SpfxDoctorCommand extends AnonymousCommand_1.default {
406
406
  fix: 'Install Node.js v12 or v14'
407
407
  },
408
408
  react: {
409
- range: '16.9.0',
410
- fix: 'npm i react@16.9.0'
409
+ range: '16.9.36',
410
+ fix: 'npm i react@16.9.36'
411
411
  },
412
412
  sp: SharePointVersion.SPO,
413
413
  yo: {
@@ -425,8 +425,8 @@ class SpfxDoctorCommand extends AnonymousCommand_1.default {
425
425
  fix: 'Install Node.js v12 or v14'
426
426
  },
427
427
  react: {
428
- range: '16.9.0',
429
- fix: 'npm i react@16.9.0'
428
+ range: '16.9.51',
429
+ fix: 'npm i react@16.9.51'
430
430
  },
431
431
  sp: SharePointVersion.SPO,
432
432
  yo: {
@@ -444,8 +444,27 @@ class SpfxDoctorCommand extends AnonymousCommand_1.default {
444
444
  fix: 'Install Node.js v12 or v14'
445
445
  },
446
446
  react: {
447
- range: '16.9.0',
448
- fix: 'npm i react@16.9.0'
447
+ range: '16.9.51',
448
+ fix: 'npm i react@16.9.51'
449
+ },
450
+ sp: SharePointVersion.SPO,
451
+ yo: {
452
+ range: '^4',
453
+ fix: 'npm i -g yo@4'
454
+ }
455
+ },
456
+ '1.14.0': {
457
+ gulp: {
458
+ range: '^4',
459
+ fix: 'npm i -g gulp@4'
460
+ },
461
+ node: {
462
+ range: '^12 || ^14',
463
+ fix: 'Install Node.js v12 or v14'
464
+ },
465
+ react: {
466
+ range: '16.9.51',
467
+ fix: 'npm i react@16.9.51'
449
468
  },
450
469
  sp: SharePointVersion.SPO,
451
470
  yo: {
@@ -1,7 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ const cli_1 = require("../../../../cli");
3
4
  const request_1 = require("../../../../request");
4
5
  const Utils_1 = require("../../../../Utils");
6
+ const AadUserGetCommand = require("../../../aad/commands/user/user-get");
5
7
  const GraphCommand_1 = require("../../../base/GraphCommand");
6
8
  const commands_1 = require("../../commands");
7
9
  class TeamsAppInstallCommand extends GraphCommand_1.default {
@@ -9,33 +11,70 @@ class TeamsAppInstallCommand extends GraphCommand_1.default {
9
11
  return commands_1.default.APP_INSTALL;
10
12
  }
11
13
  get description() {
12
- return 'Installs an app from the catalog to a Microsoft Teams team';
14
+ return 'Installs a Microsoft Teams team app from the catalog in the specified team or for the specified user';
13
15
  }
14
16
  commandAction(logger, args, cb) {
15
- const endpoint = `${this.resource}/v1.0`;
16
- const requestOptions = {
17
- url: `${endpoint}/teams/${args.options.teamId}/installedApps`,
18
- headers: {
19
- 'content-type': 'application/json;odata=nometadata',
20
- 'accept': 'application/json;odata.metadata=none'
21
- },
22
- responseType: 'json',
23
- data: {
24
- 'teamsApp@odata.bind': `${endpoint}/appCatalogs/teamsApps/${args.options.appId}`
17
+ this
18
+ .validateUser(args, logger)
19
+ .then(_ => {
20
+ var _a;
21
+ let url = `${this.resource}/v1.0`;
22
+ if (args.options.teamId) {
23
+ url += `/teams/${encodeURIComponent(args.options.teamId)}/installedApps`;
25
24
  }
26
- };
27
- request_1.default
28
- .post(requestOptions)
25
+ else {
26
+ url += `/users/${encodeURIComponent(((_a = args.options.userId) !== null && _a !== void 0 ? _a : args.options.userName))}/teamwork/installedApps`;
27
+ }
28
+ const requestOptions = {
29
+ url: url,
30
+ headers: {
31
+ 'content-type': 'application/json;odata=nometadata',
32
+ 'accept': 'application/json;odata.metadata=none'
33
+ },
34
+ responseType: 'json',
35
+ data: {
36
+ 'teamsApp@odata.bind': `${this.resource}/v1.0/appCatalogs/teamsApps/${args.options.appId}`
37
+ }
38
+ };
39
+ return request_1.default.post(requestOptions);
40
+ })
29
41
  .then(_ => cb(), (res) => this.handleRejectedODataJsonPromise(res, logger, cb));
30
42
  }
43
+ // we need this method, because passing an invalid user ID to the API
44
+ // won't cause an error
45
+ validateUser(args, logger) {
46
+ if (!args.options.userId) {
47
+ return Promise.resolve(true);
48
+ }
49
+ if (this.verbose) {
50
+ logger.logToStderr(`Checking if user ${args.options.userId} exists...`);
51
+ }
52
+ const options = {
53
+ id: args.options.userId,
54
+ output: 'json',
55
+ debug: args.options.debug,
56
+ verbose: args.options.verbose
57
+ };
58
+ return cli_1.Cli
59
+ .executeCommandWithOutput(AadUserGetCommand, { options: Object.assign(Object.assign({}, options), { _: [] }) })
60
+ .then((res) => {
61
+ if (this.verbose) {
62
+ logger.logToStderr(res.stderr);
63
+ }
64
+ return true;
65
+ }, (err) => {
66
+ if (this.verbose) {
67
+ logger.logToStderr(err.stderr);
68
+ }
69
+ return Promise.reject(`User with ID ${args.options.userId} not found. Original error: ${err.error.message}`);
70
+ });
71
+ }
31
72
  options() {
32
73
  const options = [
33
- {
34
- option: '--appId <appId>'
35
- },
36
- {
37
- option: '--teamId <teamId>'
38
- }
74
+ { option: '--appId <appId>' },
75
+ { option: '--teamId [teamId' },
76
+ { option: '--userId [userId]' },
77
+ { option: '--userName [userName]' }
39
78
  ];
40
79
  const parentOptions = super.options();
41
80
  return options.concat(parentOptions);
@@ -44,9 +83,24 @@ class TeamsAppInstallCommand extends GraphCommand_1.default {
44
83
  if (!Utils_1.default.isValidGuid(args.options.appId)) {
45
84
  return `${args.options.appId} is not a valid GUID`;
46
85
  }
47
- if (!Utils_1.default.isValidGuid(args.options.teamId)) {
86
+ if (!args.options.teamId &&
87
+ !args.options.userId &&
88
+ !args.options.userName) {
89
+ return `Specify either teamId, userId or userName`;
90
+ }
91
+ if ((args.options.teamId && args.options.userId) ||
92
+ (args.options.teamId && args.options.userName) ||
93
+ (args.options.userId && args.options.userName)) {
94
+ return `Specify either teamId, userId or userName but not multiple`;
95
+ }
96
+ if (args.options.teamId &&
97
+ !Utils_1.default.isValidGuid(args.options.teamId)) {
48
98
  return `${args.options.teamId} is not a valid GUID`;
49
99
  }
100
+ if (args.options.userId &&
101
+ !Utils_1.default.isValidGuid(args.options.userId)) {
102
+ return `${args.options.userId} is not a valid GUID`;
103
+ }
50
104
  return true;
51
105
  }
52
106
  }
@@ -19,14 +19,19 @@ m365 aad app get [options]
19
19
  `--name [name]`
20
20
  : Name of the Azure AD application registration to get. Specify either `appId`, `objectId` or `name`
21
21
 
22
+ `--save`
23
+ : Use to store the information about the created app in a local file
24
+
22
25
  --8<-- "docs/cmd/_global.md"
23
26
 
24
27
  ## Remarks
25
28
 
26
- For best performance use the `objectId` option to reference the Azure AD application registration to update. If you use `appId` or `name`, this command will first need to find the corresponding object ID for that application.
29
+ For best performance use the `objectId` option to reference the Azure AD application registration to get. If you use `appId` or `name`, this command will first need to find the corresponding object ID for that application.
27
30
 
28
31
  If the command finds multiple Azure AD application registrations with the specified app name, it will prompt you to disambiguate which app it should use, listing the discovered object IDs.
29
32
 
33
+ If you want to store the information about the Azure AD app registration, use the `--save` option. This is useful when you build solutions connected to Microsoft 365 and want to easily manage app registrations used with your solution. When you use the `--save` option, after you get the app registration, the command will write its ID and name to the `.m365rc.json` file in the current directory. If the file already exists, it will add the information about the App registration to it if it's not already present, allowing you to track multiple apps. If the file doesn't exist, the command will create it.
34
+
30
35
  ## Examples
31
36
 
32
37
  Get the Azure AD application registration by its app (client) ID
@@ -46,3 +51,9 @@ Get the Azure AD application registration by its name
46
51
  ```sh
47
52
  m365 aad app get --name "My app"
48
53
  ```
54
+
55
+ Get the Azure AD application registration by its name. Store information about the retrieved app registration in the _.m365rc.json_ file in the current directory.
56
+
57
+ ```sh
58
+ m365 aad app get --name "My app" --save
59
+ ```
@@ -32,7 +32,7 @@ m365 spfx project upgrade [options]
32
32
 
33
33
  ## Remarks
34
34
 
35
- The `spfx project upgrade` command helps you upgrade your SharePoint Framework project to the specified version. If no version is specified, the command will upgrade to the latest version of the SharePoint Framework it supports (v1.13.1).
35
+ The `spfx project upgrade` command helps you upgrade your SharePoint Framework project to the specified version. If no version is specified, the command will upgrade to the latest version of the SharePoint Framework it supports (v1.14.0).
36
36
 
37
37
  This command doesn't change your project files. Instead, it gives you a report with all steps necessary to upgrade your project to the specified version of the SharePoint Framework. Changing project files is error-prone, especially when it comes to updating your solution's code. This is why at this moment, this command produces a report that you can use yourself to perform the necessary updates and verify that everything is working as expected.
38
38
 
@@ -47,41 +47,41 @@ m365 spfx project upgrade --toVersion 1.5.0 --output md > "upgrade-report.md"
47
47
  Get instructions to upgrade the current SharePoint Framework project to SharePoint Framework version 1.5.0 and show the summary of the findings in the shell
48
48
 
49
49
  ```sh
50
- m365 spfx project upgrade --toVersion 1.5.0
50
+ m365 spfx project upgrade --toVersion 1.5.0 --output text
51
51
  ```
52
52
 
53
53
  Get instructions to upgrade the current SharePoint Framework project to the latest preview version
54
54
 
55
55
  ```sh
56
- m365 spfx project upgrade --preview
56
+ m365 spfx project upgrade --preview --output text
57
57
  ```
58
58
 
59
59
  Get instructions to upgrade the current SharePoint Framework project to the specified preview version
60
60
 
61
61
  ```sh
62
- m365 spfx project upgrade --toVersion 1.12.1-rc.0
62
+ m365 spfx project upgrade --toVersion 1.12.1-rc.0 --output text
63
63
  ```
64
64
 
65
65
  Get instructions to upgrade the current SharePoint Framework project to the latest SharePoint Framework version supported by the CLI for Microsoft 365 using pnpm
66
66
 
67
67
  ```sh
68
- m365 spfx project upgrade --packageManager pnpm
68
+ m365 spfx project upgrade --packageManager pnpm --output text
69
69
  ```
70
70
 
71
71
  Get instructions to upgrade the current SharePoint Framework project to the latest SharePoint Framework version supported by the CLI for Microsoft 365
72
72
 
73
73
  ```sh
74
- m365 spfx project upgrade
74
+ m365 spfx project upgrade --output text
75
75
  ```
76
76
 
77
77
  Get instructions to upgrade the current SharePoint Framework project to the latest SharePoint Framework version supported by the CLI for Microsoft 365 using PowerShell
78
78
 
79
79
  ```sh
80
- m365 spfx project upgrade --shell powershell
80
+ m365 spfx project upgrade --shell powershell --output text
81
81
  ```
82
82
 
83
83
  Get instructions to upgrade the current SharePoint Framework project to the latest version of SharePoint Framework and save the findings in a [CodeTour](https://aka.ms/codetour) file
84
84
 
85
85
  ```sh
86
- m365 spfx project upgrade --output tour
86
+ m365 spfx project upgrade --output tour
87
87
  ```
@@ -1,6 +1,6 @@
1
1
  # teams app install
2
2
 
3
- Installs an app from the catalog to a Microsoft Teams team
3
+ Installs a Microsoft Teams team app from the catalog in the specified team or for the specified user
4
4
 
5
5
  ## Usage
6
6
 
@@ -13,14 +13,20 @@ m365 teams app install [options]
13
13
  `--appId <appId>`
14
14
  : The ID of the app to install
15
15
 
16
- `--teamId <teamId>`
16
+ `--teamId [teamId]`
17
17
  : The ID of the Microsoft Teams team to which to install the app
18
18
 
19
+ `--userId [userId]`
20
+ : The ID of the user for who to install the app. Specify either `userId` or `userName` to install a personal app for a user.
21
+
22
+ `--userName [userName]`
23
+ : The UPN of the user for who to install the app. Specify either `userId` or `userName` to install a personal app for a user.
24
+
19
25
  --8<-- "docs/cmd/_global.md"
20
26
 
21
27
  ## Remarks
22
28
 
23
- The `appId` has to be the ID of the app from the Microsoft Teams App Catalog. Do not use the ID from the manifest of the zip app package. Use the [teams app list](./app-list.md) command to get this ID.
29
+ The `appId` has to be the ID of the app from the Microsoft Teams App Catalog. Do not use the ID from the manifest of the zip app package. Use the [teams app list](./app-list.md) command to get this ID instead.
24
30
 
25
31
  ## Examples
26
32
 
@@ -28,4 +34,16 @@ Install an app from the catalog in a Microsoft Teams team
28
34
 
29
35
  ```sh
30
36
  m365 teams app install --appId 4440558e-8c73-4597-abc7-3644a64c4bce --teamId 2609af39-7775-4f94-a3dc-0dd67657e900
31
- ```
37
+ ```
38
+
39
+ Install a personal app for the user specified using their user name
40
+
41
+ ```sh
42
+ m365 teams app install --appId 4440558e-8c73-4597-abc7-3644a64c4bce --userName steve@contoso.com
43
+ ```
44
+
45
+ Install a personal app for the user specified using their ID
46
+
47
+ ```sh
48
+ m365 teams app install --appId 4440558e-8c73-4597-abc7-3644a64c4bce --userId 2609af39-7775-4f94-a3dc-0dd67657e900
49
+ ```
@@ -65,7 +65,8 @@
65
65
  "eslint-plugin-promise": "^6.0.0",
66
66
  "mocha": "^9.2.0",
67
67
  "rimraf": "^3.0.2",
68
- "sinon": "^13.0.1"
68
+ "sinon": "^13.0.1",
69
+ "source-map-support": "^0.5.21"
69
70
  }
70
71
  },
71
72
  "eslint-rules": {
@@ -1453,6 +1454,12 @@
1453
1454
  "resolved": "https://registry.npmjs.org/buffer-equal-constant-time/-/buffer-equal-constant-time-1.0.1.tgz",
1454
1455
  "integrity": "sha1-+OcRMvf/5uAaXJaXpMbz5I1cyBk="
1455
1456
  },
1457
+ "node_modules/buffer-from": {
1458
+ "version": "1.1.2",
1459
+ "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz",
1460
+ "integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==",
1461
+ "dev": true
1462
+ },
1456
1463
  "node_modules/c8": {
1457
1464
  "version": "7.11.0",
1458
1465
  "resolved": "https://registry.npmjs.org/c8/-/c8-7.11.0.tgz",
@@ -5389,11 +5396,21 @@
5389
5396
  "version": "0.6.1",
5390
5397
  "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz",
5391
5398
  "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==",
5392
- "optional": true,
5399
+ "devOptional": true,
5393
5400
  "engines": {
5394
5401
  "node": ">=0.10.0"
5395
5402
  }
5396
5403
  },
5404
+ "node_modules/source-map-support": {
5405
+ "version": "0.5.21",
5406
+ "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.21.tgz",
5407
+ "integrity": "sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w==",
5408
+ "dev": true,
5409
+ "dependencies": {
5410
+ "buffer-from": "^1.0.0",
5411
+ "source-map": "^0.6.0"
5412
+ }
5413
+ },
5397
5414
  "node_modules/sprintf-js": {
5398
5415
  "version": "1.0.3",
5399
5416
  "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz",
@@ -7258,6 +7275,12 @@
7258
7275
  "resolved": "https://registry.npmjs.org/buffer-equal-constant-time/-/buffer-equal-constant-time-1.0.1.tgz",
7259
7276
  "integrity": "sha1-+OcRMvf/5uAaXJaXpMbz5I1cyBk="
7260
7277
  },
7278
+ "buffer-from": {
7279
+ "version": "1.1.2",
7280
+ "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz",
7281
+ "integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==",
7282
+ "dev": true
7283
+ },
7261
7284
  "c8": {
7262
7285
  "version": "7.11.0",
7263
7286
  "resolved": "https://registry.npmjs.org/c8/-/c8-7.11.0.tgz",
@@ -10238,7 +10261,17 @@
10238
10261
  "version": "0.6.1",
10239
10262
  "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz",
10240
10263
  "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==",
10241
- "optional": true
10264
+ "devOptional": true
10265
+ },
10266
+ "source-map-support": {
10267
+ "version": "0.5.21",
10268
+ "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.21.tgz",
10269
+ "integrity": "sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w==",
10270
+ "dev": true,
10271
+ "requires": {
10272
+ "buffer-from": "^1.0.0",
10273
+ "source-map": "^0.6.0"
10274
+ }
10242
10275
  },
10243
10276
  "sprintf-js": {
10244
10277
  "version": "1.0.3",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pnp/cli-microsoft365",
3
- "version": "5.0.0-beta.21e7f85",
3
+ "version": "5.0.0-beta.30c8613",
4
4
  "description": "Manage Microsoft 365 and SharePoint Framework projects on any platform",
5
5
  "license": "MIT",
6
6
  "main": "./dist/api.js",
@@ -138,6 +138,7 @@
138
138
  "Patil, Atharva <atharvapatil19202@gmail.com>",
139
139
  "Plenevaux, Yannick <yannick.plenevaux@gmail.com>",
140
140
  "Powney, Mark <powney.mark@outlook.com>",
141
+ "pramod74 <pramod.lumb@gmail.com>",
141
142
  "Priem, Mark <mark.priem@outlook.com>",
142
143
  "Raju, Arnie <arnie.raju@thesolutioncollective.com.au>",
143
144
  "Ramalho, David <dramalho@storm.ie>",
@@ -227,6 +228,7 @@
227
228
  "eslint-plugin-promise": "^6.0.0",
228
229
  "mocha": "^9.2.0",
229
230
  "rimraf": "^3.0.2",
230
- "sinon": "^13.0.1"
231
+ "sinon": "^13.0.1",
232
+ "source-map-support": "^0.5.21"
231
233
  }
232
234
  }