@pnp/cli-microsoft365 5.1.0-beta.efe1dcb → 5.1.0-beta.ffd9bc8
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 +1 -0
- package/dist/cli/Cli.js +18 -3
- package/dist/cli/index.js +5 -1
- package/dist/m365/aad/commands/app/app-add.js +68 -10
- package/dist/m365/aad/commands/app/{app-delete.js → app-remove.js} +9 -5
- package/dist/m365/aad/commands/app/{app-role-delete.js → app-role-remove.js} +11 -7
- package/dist/m365/aad/commands/o365group/o365group-add.js +39 -1
- package/dist/m365/aad/commands/o365group/o365group-conversation-post-list.js +87 -0
- package/dist/m365/aad/commands.js +4 -1
- package/dist/m365/base/PowerPlatformCommand.js +10 -0
- package/dist/m365/pp/commands/managementapp/managementapp-add.js +98 -0
- package/dist/m365/pp/commands.js +7 -0
- package/dist/m365/spfx/commands/project/model/index.js +5 -1
- package/dist/m365/spfx/commands/project/project-externalize/index.js +5 -1
- package/dist/m365/spfx/commands/project/project-externalize/rules/index.js +5 -1
- package/dist/m365/spfx/commands/project/project-upgrade/index.js +5 -1
- package/dist/m365/spfx/commands/project/project-upgrade/rules/FN001033_DEP_tslib.js +14 -0
- package/dist/m365/spfx/commands/project/project-upgrade/rules/FN023002_GITIGNORE_heft.js +40 -0
- package/dist/m365/spfx/commands/project/project-upgrade/upgrade-1.12.0.js +0 -2
- package/dist/m365/spfx/commands/project/project-upgrade/upgrade-1.15.0-beta.1.js +63 -0
- package/dist/m365/spfx/commands/project/project-upgrade.js +24 -19
- package/dist/m365/spo/commands/site/site-recyclebinitem-restore.js +66 -0
- package/dist/m365/spo/commands.js +1 -0
- package/dist/m365/teams/commands/chat/chat-message-send.js +50 -58
- package/dist/settingsNames.js +1 -0
- package/dist/utils/formatting.js +3 -0
- package/dist/utils/index.js +5 -1
- package/docs/docs/cmd/aad/app/{app-delete.md → app-remove.md} +15 -9
- package/docs/docs/cmd/aad/app/{app-role-delete.md → app-role-remove.md} +25 -19
- package/docs/docs/cmd/aad/o365group/o365group-add.md +42 -6
- package/docs/docs/cmd/aad/o365group/o365group-conversation-post-list.md +36 -0
- package/docs/docs/cmd/pp/managementapp/managementapp-add.md +50 -0
- package/docs/docs/cmd/spfx/project/project-upgrade.md +1 -1
- package/docs/docs/cmd/spo/site/site-recyclebinitem-restore.md +27 -0
- package/docs/docs/cmd/teams/chat/chat-message-send.md +4 -4
- package/npm-shrinkwrap.json +173 -188
- package/package.json +12 -11
- package/dist/m365/spfx/commands/project/project-upgrade/rules/FN015006_FILE_editorconfig.js +0 -14
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.FN023002_GITIGNORE_heft = void 0;
|
|
4
|
+
const Rule_1 = require("./Rule");
|
|
5
|
+
class FN023002_GITIGNORE_heft extends Rule_1.Rule {
|
|
6
|
+
constructor() {
|
|
7
|
+
super();
|
|
8
|
+
}
|
|
9
|
+
get id() {
|
|
10
|
+
return 'FN023002';
|
|
11
|
+
}
|
|
12
|
+
get title() {
|
|
13
|
+
return `.gitignore '.heft' folder`;
|
|
14
|
+
}
|
|
15
|
+
get description() {
|
|
16
|
+
return `To .gitignore add the '.heft' folder`;
|
|
17
|
+
}
|
|
18
|
+
get resolution() {
|
|
19
|
+
return `.heft`;
|
|
20
|
+
}
|
|
21
|
+
get resolutionType() {
|
|
22
|
+
return 'text';
|
|
23
|
+
}
|
|
24
|
+
get severity() {
|
|
25
|
+
return 'Required';
|
|
26
|
+
}
|
|
27
|
+
get file() {
|
|
28
|
+
return './.gitignore';
|
|
29
|
+
}
|
|
30
|
+
visit(project, findings) {
|
|
31
|
+
if (!project.gitignore) {
|
|
32
|
+
return;
|
|
33
|
+
}
|
|
34
|
+
if (!/^\.heft$/m.test(project.gitignore.source)) {
|
|
35
|
+
this.addFinding(findings);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
exports.FN023002_GITIGNORE_heft = FN023002_GITIGNORE_heft;
|
|
40
|
+
//# sourceMappingURL=FN023002_GITIGNORE_heft.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
|
];
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const FN001001_DEP_microsoft_sp_core_library_1 = require("./rules/FN001001_DEP_microsoft_sp_core_library");
|
|
4
|
+
const FN001002_DEP_microsoft_sp_lodash_subset_1 = require("./rules/FN001002_DEP_microsoft_sp_lodash_subset");
|
|
5
|
+
const FN001003_DEP_microsoft_sp_office_ui_fabric_core_1 = require("./rules/FN001003_DEP_microsoft_sp_office_ui_fabric_core");
|
|
6
|
+
const FN001004_DEP_microsoft_sp_webpart_base_1 = require("./rules/FN001004_DEP_microsoft_sp_webpart_base");
|
|
7
|
+
const FN001011_DEP_microsoft_sp_dialog_1 = require("./rules/FN001011_DEP_microsoft_sp_dialog");
|
|
8
|
+
const FN001012_DEP_microsoft_sp_application_base_1 = require("./rules/FN001012_DEP_microsoft_sp_application_base");
|
|
9
|
+
const FN001013_DEP_microsoft_decorators_1 = require("./rules/FN001013_DEP_microsoft_decorators");
|
|
10
|
+
const FN001014_DEP_microsoft_sp_listview_extensibility_1 = require("./rules/FN001014_DEP_microsoft_sp_listview_extensibility");
|
|
11
|
+
const FN001021_DEP_microsoft_sp_property_pane_1 = require("./rules/FN001021_DEP_microsoft_sp_property_pane");
|
|
12
|
+
const FN001022_DEP_office_ui_fabric_react_1 = require("./rules/FN001022_DEP_office_ui_fabric_react");
|
|
13
|
+
const FN001023_DEP_microsoft_sp_component_base_1 = require("./rules/FN001023_DEP_microsoft_sp_component_base");
|
|
14
|
+
const FN001024_DEP_microsoft_sp_diagnostics_1 = require("./rules/FN001024_DEP_microsoft_sp_diagnostics");
|
|
15
|
+
const FN001025_DEP_microsoft_sp_dynamic_data_1 = require("./rules/FN001025_DEP_microsoft_sp_dynamic_data");
|
|
16
|
+
const FN001026_DEP_microsoft_sp_extension_base_1 = require("./rules/FN001026_DEP_microsoft_sp_extension_base");
|
|
17
|
+
const FN001027_DEP_microsoft_sp_http_1 = require("./rules/FN001027_DEP_microsoft_sp_http");
|
|
18
|
+
const FN001028_DEP_microsoft_sp_list_subscription_1 = require("./rules/FN001028_DEP_microsoft_sp_list_subscription");
|
|
19
|
+
const FN001029_DEP_microsoft_sp_loader_1 = require("./rules/FN001029_DEP_microsoft_sp_loader");
|
|
20
|
+
const FN001030_DEP_microsoft_sp_module_interfaces_1 = require("./rules/FN001030_DEP_microsoft_sp_module_interfaces");
|
|
21
|
+
const FN001031_DEP_microsoft_sp_odata_types_1 = require("./rules/FN001031_DEP_microsoft_sp_odata_types");
|
|
22
|
+
const FN001032_DEP_microsoft_sp_page_context_1 = require("./rules/FN001032_DEP_microsoft_sp_page_context");
|
|
23
|
+
const FN001033_DEP_tslib_1 = require("./rules/FN001033_DEP_tslib");
|
|
24
|
+
const FN002001_DEVDEP_microsoft_sp_build_web_1 = require("./rules/FN002001_DEVDEP_microsoft_sp_build_web");
|
|
25
|
+
const FN002002_DEVDEP_microsoft_sp_module_interfaces_1 = require("./rules/FN002002_DEVDEP_microsoft_sp_module_interfaces");
|
|
26
|
+
const FN002007_DEVDEP_ajv_1 = require("./rules/FN002007_DEVDEP_ajv");
|
|
27
|
+
const FN002009_DEVDEP_microsoft_sp_tslint_rules_1 = require("./rules/FN002009_DEVDEP_microsoft_sp_tslint_rules");
|
|
28
|
+
const FN002013_DEVDEP_types_webpack_env_1 = require("./rules/FN002013_DEVDEP_types_webpack_env");
|
|
29
|
+
const FN006004_CFG_PS_developer_1 = require("./rules/FN006004_CFG_PS_developer");
|
|
30
|
+
const FN010001_YORC_version_1 = require("./rules/FN010001_YORC_version");
|
|
31
|
+
const FN023002_GITIGNORE_heft_1 = require("./rules/FN023002_GITIGNORE_heft");
|
|
32
|
+
module.exports = [
|
|
33
|
+
new FN001001_DEP_microsoft_sp_core_library_1.FN001001_DEP_microsoft_sp_core_library('1.15.0-beta.1'),
|
|
34
|
+
new FN001002_DEP_microsoft_sp_lodash_subset_1.FN001002_DEP_microsoft_sp_lodash_subset('1.15.0-beta.1'),
|
|
35
|
+
new FN001003_DEP_microsoft_sp_office_ui_fabric_core_1.FN001003_DEP_microsoft_sp_office_ui_fabric_core('1.15.0-beta.1'),
|
|
36
|
+
new FN001004_DEP_microsoft_sp_webpart_base_1.FN001004_DEP_microsoft_sp_webpart_base('1.15.0-beta.1'),
|
|
37
|
+
new FN001011_DEP_microsoft_sp_dialog_1.FN001011_DEP_microsoft_sp_dialog('1.15.0-beta.1'),
|
|
38
|
+
new FN001012_DEP_microsoft_sp_application_base_1.FN001012_DEP_microsoft_sp_application_base('1.15.0-beta.1'),
|
|
39
|
+
new FN001013_DEP_microsoft_decorators_1.FN001013_DEP_microsoft_decorators('1.15.0-beta.1'),
|
|
40
|
+
new FN001014_DEP_microsoft_sp_listview_extensibility_1.FN001014_DEP_microsoft_sp_listview_extensibility('1.15.0-beta.1'),
|
|
41
|
+
new FN001021_DEP_microsoft_sp_property_pane_1.FN001021_DEP_microsoft_sp_property_pane('1.15.0-beta.1'),
|
|
42
|
+
new FN001022_DEP_office_ui_fabric_react_1.FN001022_DEP_office_ui_fabric_react('7.181.1'),
|
|
43
|
+
new FN001023_DEP_microsoft_sp_component_base_1.FN001023_DEP_microsoft_sp_component_base('1.15.0-beta.1'),
|
|
44
|
+
new FN001024_DEP_microsoft_sp_diagnostics_1.FN001024_DEP_microsoft_sp_diagnostics('1.15.0-beta.1'),
|
|
45
|
+
new FN001025_DEP_microsoft_sp_dynamic_data_1.FN001025_DEP_microsoft_sp_dynamic_data('1.15.0-beta.1'),
|
|
46
|
+
new FN001026_DEP_microsoft_sp_extension_base_1.FN001026_DEP_microsoft_sp_extension_base('1.15.0-beta.1'),
|
|
47
|
+
new FN001027_DEP_microsoft_sp_http_1.FN001027_DEP_microsoft_sp_http('1.15.0-beta.1'),
|
|
48
|
+
new FN001028_DEP_microsoft_sp_list_subscription_1.FN001028_DEP_microsoft_sp_list_subscription('1.15.0-beta.1'),
|
|
49
|
+
new FN001029_DEP_microsoft_sp_loader_1.FN001029_DEP_microsoft_sp_loader('1.15.0-beta.1'),
|
|
50
|
+
new FN001030_DEP_microsoft_sp_module_interfaces_1.FN001030_DEP_microsoft_sp_module_interfaces('1.15.0-beta.1'),
|
|
51
|
+
new FN001031_DEP_microsoft_sp_odata_types_1.FN001031_DEP_microsoft_sp_odata_types('1.15.0-beta.1'),
|
|
52
|
+
new FN001032_DEP_microsoft_sp_page_context_1.FN001032_DEP_microsoft_sp_page_context('1.15.0-beta.1'),
|
|
53
|
+
new FN001033_DEP_tslib_1.FN001033_DEP_tslib('1.13.0'),
|
|
54
|
+
new FN002001_DEVDEP_microsoft_sp_build_web_1.FN002001_DEVDEP_microsoft_sp_build_web('1.15.0-beta.1'),
|
|
55
|
+
new FN002002_DEVDEP_microsoft_sp_module_interfaces_1.FN002002_DEVDEP_microsoft_sp_module_interfaces('1.15.0-beta.1'),
|
|
56
|
+
new FN002007_DEVDEP_ajv_1.FN002007_DEVDEP_ajv('6.12.5'),
|
|
57
|
+
new FN002009_DEVDEP_microsoft_sp_tslint_rules_1.FN002009_DEVDEP_microsoft_sp_tslint_rules('1.15.0-beta.1'),
|
|
58
|
+
new FN002013_DEVDEP_types_webpack_env_1.FN002013_DEVDEP_types_webpack_env('1.15.2'),
|
|
59
|
+
new FN006004_CFG_PS_developer_1.FN006004_CFG_PS_developer('1.15.0-beta.1'),
|
|
60
|
+
new FN010001_YORC_version_1.FN010001_YORC_version('1.15.0-beta.1'),
|
|
61
|
+
new FN023002_GITIGNORE_heft_1.FN023002_GITIGNORE_heft()
|
|
62
|
+
];
|
|
63
|
+
//# sourceMappingURL=upgrade-1.15.0-beta.1.js.map
|
|
@@ -3,6 +3,8 @@ 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");
|
|
6
8
|
const Command_1 = require("../../../../Command");
|
|
7
9
|
const commands_1 = require("../../commands");
|
|
8
10
|
const base_project_command_1 = require("./base-project-command");
|
|
@@ -43,7 +45,8 @@ class SpfxProjectUpgradeCommand extends base_project_command_1.BaseProjectComman
|
|
|
43
45
|
'1.12.1',
|
|
44
46
|
'1.13.0',
|
|
45
47
|
'1.13.1',
|
|
46
|
-
'1.14.0'
|
|
48
|
+
'1.14.0',
|
|
49
|
+
'1.15.0-beta.1'
|
|
47
50
|
];
|
|
48
51
|
}
|
|
49
52
|
get name() {
|
|
@@ -56,9 +59,9 @@ class SpfxProjectUpgradeCommand extends base_project_command_1.BaseProjectComman
|
|
|
56
59
|
const telemetryProps = super.getTelemetryProperties(args);
|
|
57
60
|
telemetryProps.toVersion = args.options.toVersion || this.supportedVersions[this.supportedVersions.length - 1];
|
|
58
61
|
// uncomment to support upgrading to preview releases
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
+
if ((0, semver_1.prerelease)(telemetryProps.toVersion) && !args.options.preview) {
|
|
63
|
+
telemetryProps.toVersion = this.supportedVersions[this.supportedVersions.length - 2];
|
|
64
|
+
}
|
|
62
65
|
telemetryProps.packageManager = args.options.packageManager || 'npm';
|
|
63
66
|
telemetryProps.shell = args.options.shell || 'bash';
|
|
64
67
|
telemetryProps.preview = args.options.preview;
|
|
@@ -72,15 +75,15 @@ class SpfxProjectUpgradeCommand extends base_project_command_1.BaseProjectComman
|
|
|
72
75
|
}
|
|
73
76
|
this.toVersion = args.options.toVersion ? args.options.toVersion : this.supportedVersions[this.supportedVersions.length - 1];
|
|
74
77
|
// uncomment to support upgrading to preview releases
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
78
|
+
if (!args.options.toVersion &&
|
|
79
|
+
!args.options.preview &&
|
|
80
|
+
(0, semver_1.prerelease)(this.toVersion)) {
|
|
81
|
+
// no version and no preview specified while the current version to
|
|
82
|
+
// upgrade to is a prerelease so let's grab the first non-preview version
|
|
83
|
+
// since we're supporting only one preview version, it's sufficient for
|
|
84
|
+
// us to take second to last version
|
|
85
|
+
this.toVersion = this.supportedVersions[this.supportedVersions.length - 2];
|
|
86
|
+
}
|
|
84
87
|
this.packageManager = args.options.packageManager || 'npm';
|
|
85
88
|
this.shell = args.options.shell || 'bash';
|
|
86
89
|
if (this.supportedVersions.indexOf(this.toVersion) < 0) {
|
|
@@ -501,11 +504,11 @@ ${f.resolution}
|
|
|
501
504
|
},
|
|
502
505
|
{
|
|
503
506
|
option: '--packageManager [packageManager]',
|
|
504
|
-
autocomplete:
|
|
507
|
+
autocomplete: SpfxProjectUpgradeCommand.packageManagers
|
|
505
508
|
},
|
|
506
509
|
{
|
|
507
510
|
option: '--shell [shell]',
|
|
508
|
-
autocomplete:
|
|
511
|
+
autocomplete: SpfxProjectUpgradeCommand.shells
|
|
509
512
|
},
|
|
510
513
|
{
|
|
511
514
|
option: '--preview'
|
|
@@ -521,18 +524,20 @@ ${f.resolution}
|
|
|
521
524
|
}
|
|
522
525
|
validate(args) {
|
|
523
526
|
if (args.options.packageManager) {
|
|
524
|
-
if (
|
|
525
|
-
return `${args.options.packageManager} is not a supported package manager. Supported package managers are
|
|
527
|
+
if (SpfxProjectUpgradeCommand.packageManagers.indexOf(args.options.packageManager) < 0) {
|
|
528
|
+
return `${args.options.packageManager} is not a supported package manager. Supported package managers are ${SpfxProjectUpgradeCommand.packageManagers.join(', ')}`;
|
|
526
529
|
}
|
|
527
530
|
}
|
|
528
531
|
if (args.options.shell) {
|
|
529
|
-
if (
|
|
530
|
-
return `${args.options.shell} is not a supported shell. Supported shells are
|
|
532
|
+
if (SpfxProjectUpgradeCommand.shells.indexOf(args.options.shell) < 0) {
|
|
533
|
+
return `${args.options.shell} is not a supported shell. Supported shells are ${SpfxProjectUpgradeCommand.shells.join(', ')}`;
|
|
531
534
|
}
|
|
532
535
|
}
|
|
533
536
|
return true;
|
|
534
537
|
}
|
|
535
538
|
}
|
|
539
|
+
SpfxProjectUpgradeCommand.packageManagers = ['npm', 'pnpm', 'yarn'];
|
|
540
|
+
SpfxProjectUpgradeCommand.shells = ['bash', 'powershell', 'cmd'];
|
|
536
541
|
SpfxProjectUpgradeCommand.packageCommands = {
|
|
537
542
|
npm: {
|
|
538
543
|
install: 'npm i -SE',
|
|
@@ -0,0 +1,66 @@
|
|
|
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 SpoSiteRecycleBinItemRestoreCommand extends SpoCommand_1.default {
|
|
8
|
+
get name() {
|
|
9
|
+
return commands_1.default.SITE_RECYCLEBINITEM_RESTORE;
|
|
10
|
+
}
|
|
11
|
+
get description() {
|
|
12
|
+
return 'Restores given items from the site recycle bin';
|
|
13
|
+
}
|
|
14
|
+
commandAction(logger, args, cb) {
|
|
15
|
+
if (this.verbose) {
|
|
16
|
+
logger.logToStderr(`Restoring items from recycle bin at ${args.options.siteUrl}...`);
|
|
17
|
+
}
|
|
18
|
+
const requestUrl = `${args.options.siteUrl}/_api/site/RecycleBin/RestoreByIds`;
|
|
19
|
+
const ids = utils_1.formatting.splitAndTrim(args.options.ids);
|
|
20
|
+
const idsChunks = [];
|
|
21
|
+
while (ids.length) {
|
|
22
|
+
idsChunks.push(ids.splice(0, 20));
|
|
23
|
+
}
|
|
24
|
+
Promise.all(idsChunks.map((idsChunk) => {
|
|
25
|
+
const requestOptions = {
|
|
26
|
+
url: requestUrl,
|
|
27
|
+
headers: {
|
|
28
|
+
'accept': 'application/json;odata=nometadata',
|
|
29
|
+
'content-type': 'application/json'
|
|
30
|
+
},
|
|
31
|
+
responseType: 'json',
|
|
32
|
+
data: {
|
|
33
|
+
ids: idsChunk
|
|
34
|
+
}
|
|
35
|
+
};
|
|
36
|
+
return request_1.default.post(requestOptions);
|
|
37
|
+
})).then(_ => cb(), (rawRes) => this.handleRejectedODataJsonPromise(rawRes, logger, cb));
|
|
38
|
+
}
|
|
39
|
+
options() {
|
|
40
|
+
const options = [
|
|
41
|
+
{
|
|
42
|
+
option: '-u, --siteUrl <siteUrl>'
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
option: '-i, --ids <ids>'
|
|
46
|
+
}
|
|
47
|
+
];
|
|
48
|
+
const parentOptions = super.options();
|
|
49
|
+
return options.concat(parentOptions);
|
|
50
|
+
}
|
|
51
|
+
validate(args) {
|
|
52
|
+
const isValidSharePointUrl = utils_1.validation.isValidSharePointUrl(args.options.siteUrl);
|
|
53
|
+
if (isValidSharePointUrl !== true) {
|
|
54
|
+
return isValidSharePointUrl;
|
|
55
|
+
}
|
|
56
|
+
const invalidIds = utils_1.formatting
|
|
57
|
+
.splitAndTrim(args.options.ids)
|
|
58
|
+
.filter(id => !utils_1.validation.isValidGuid(id));
|
|
59
|
+
if (invalidIds.length > 0) {
|
|
60
|
+
return `The following IDs are invalid: ${invalidIds.join(', ')}`;
|
|
61
|
+
}
|
|
62
|
+
return true;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
module.exports = new SpoSiteRecycleBinItemRestoreCommand();
|
|
66
|
+
//# sourceMappingURL=site-recyclebinitem-restore.js.map
|
|
@@ -185,6 +185,7 @@ exports.default = {
|
|
|
185
185
|
SITE_LIST: `${prefix} site list`,
|
|
186
186
|
SITE_INPLACERECORDSMANAGEMENT_SET: `${prefix} site inplacerecordsmanagement set`,
|
|
187
187
|
SITE_RECYCLEBINITEM_LIST: `${prefix} site recyclebinitem list`,
|
|
188
|
+
SITE_RECYCLEBINITEM_RESTORE: `${prefix} site recyclebinitem restore`,
|
|
188
189
|
SITE_REMOVE: `${prefix} site remove`,
|
|
189
190
|
SITE_RENAME: `${prefix} site rename`,
|
|
190
191
|
SITE_SET: `${prefix} site set`,
|
|
@@ -20,21 +20,22 @@ class TeamsChatMessageSendCommand extends GraphCommand_1.default {
|
|
|
20
20
|
return commands_1.default.CHAT_MESSAGE_SEND;
|
|
21
21
|
}
|
|
22
22
|
get description() {
|
|
23
|
-
return '
|
|
23
|
+
return 'Sends a chat message to a Microsoft Teams chat conversation.';
|
|
24
|
+
}
|
|
25
|
+
getTelemetryProperties(args) {
|
|
26
|
+
const telemetryProps = super.getTelemetryProperties(args);
|
|
27
|
+
telemetryProps.chatId = typeof args.options.chatId !== 'undefined';
|
|
28
|
+
telemetryProps.userEmails = typeof args.options.userEmails !== 'undefined';
|
|
29
|
+
telemetryProps.chatName = typeof args.options.chatName !== 'undefined';
|
|
30
|
+
return telemetryProps;
|
|
24
31
|
}
|
|
25
32
|
commandAction(logger, args, cb) {
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
cb();
|
|
33
|
-
}
|
|
34
|
-
catch (error) {
|
|
35
|
-
this.handleRejectedODataJsonPromise(error, logger, cb);
|
|
36
|
-
}
|
|
37
|
-
});
|
|
33
|
+
this
|
|
34
|
+
.getChatId(logger, args)
|
|
35
|
+
.then(chatId => this.sendChatMessage(chatId, args))
|
|
36
|
+
.then(_ => {
|
|
37
|
+
cb();
|
|
38
|
+
}, (err) => this.handleRejectedODataJsonPromise(err, logger, cb));
|
|
38
39
|
}
|
|
39
40
|
options() {
|
|
40
41
|
const options = [
|
|
@@ -78,36 +79,44 @@ class TeamsChatMessageSendCommand extends GraphCommand_1.default {
|
|
|
78
79
|
return `${args.options.chatId} is not a valid Teams ChatId.`;
|
|
79
80
|
}
|
|
80
81
|
if (args.options.userEmails) {
|
|
81
|
-
const userEmails = args.options.userEmails
|
|
82
|
+
const userEmails = this.convertCommaSeparatedListToArray(args.options.userEmails);
|
|
82
83
|
if (!userEmails || userEmails.length === 0 || userEmails.some(e => !utils_1.validation.isValidUserPrincipalName(e))) {
|
|
83
84
|
return `${args.options.userEmails} contains one or more invalid email addresses.`;
|
|
84
85
|
}
|
|
85
86
|
}
|
|
86
87
|
return true;
|
|
87
88
|
}
|
|
88
|
-
|
|
89
|
+
getChatId(logger, args) {
|
|
89
90
|
return __awaiter(this, void 0, void 0, function* () {
|
|
90
|
-
|
|
91
|
+
if (args.options.chatId) {
|
|
92
|
+
return args.options.chatId;
|
|
93
|
+
}
|
|
94
|
+
return args.options.userEmails
|
|
95
|
+
? this.ensureChatIdByUserEmails(args.options.userEmails, logger)
|
|
96
|
+
: this.getChatIdByName(args.options.chatName, logger);
|
|
97
|
+
});
|
|
98
|
+
}
|
|
99
|
+
ensureChatIdByUserEmails(userEmailsOption, logger) {
|
|
100
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
101
|
+
const userEmails = this.convertCommaSeparatedListToArray(userEmailsOption);
|
|
91
102
|
const currentUserEmail = utils_1.accessToken.getUserNameFromAccessToken(Auth_1.default.service.accessTokens[this.resource].accessToken).toLowerCase();
|
|
92
|
-
const existingChats = yield this.findExistingGroupChatsByMembers([currentUserEmail, ...userEmails]);
|
|
93
|
-
if (existingChats
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
return `- ${c.id}${c.topic && ' - '}${c.topic} - ${c.createdDateTime && new Date(c.createdDateTime).toLocaleString()}`;
|
|
97
|
-
}).join(os.EOL);
|
|
98
|
-
throw new Error(`Multiple chat conversations with this topic found. Please disambiguate:${os.EOL}${disambiguationText}`);
|
|
99
|
-
}
|
|
100
|
-
else {
|
|
101
|
-
return existingChats[0].id;
|
|
102
|
-
}
|
|
103
|
+
const existingChats = yield this.findExistingGroupChatsByMembers([currentUserEmail, ...userEmails], logger);
|
|
104
|
+
if (!existingChats || existingChats.length === 0) {
|
|
105
|
+
const chat = yield this.createConversation([currentUserEmail, ...userEmails]);
|
|
106
|
+
return chat.id;
|
|
103
107
|
}
|
|
104
|
-
|
|
105
|
-
|
|
108
|
+
if (existingChats.length === 1) {
|
|
109
|
+
return existingChats[0].id;
|
|
110
|
+
}
|
|
111
|
+
const disambiguationText = existingChats.map(c => {
|
|
112
|
+
return `- ${c.id}${c.topic && ' - '}${c.topic} - ${c.createdDateTime && new Date(c.createdDateTime).toLocaleString()}`;
|
|
113
|
+
}).join(os.EOL);
|
|
114
|
+
throw new Error(`Multiple chat conversations with this name found. Please disambiguate:${os.EOL}${disambiguationText}`);
|
|
106
115
|
});
|
|
107
116
|
}
|
|
108
|
-
getChatIdByName(chatName) {
|
|
117
|
+
getChatIdByName(chatName, logger) {
|
|
109
118
|
return __awaiter(this, void 0, void 0, function* () {
|
|
110
|
-
const existingChats = yield this.
|
|
119
|
+
const existingChats = yield this.findExistingGroupChatsByName(chatName, logger);
|
|
111
120
|
if (!existingChats || existingChats.length === 0) {
|
|
112
121
|
throw new Error('No chat conversation was found with this name.');
|
|
113
122
|
}
|
|
@@ -118,7 +127,7 @@ class TeamsChatMessageSendCommand extends GraphCommand_1.default {
|
|
|
118
127
|
const memberstring = c.members.map(m => m.email).join(', ');
|
|
119
128
|
return `- ${c.id} - ${c.createdDateTime && new Date(c.createdDateTime).toLocaleString()} - ${memberstring}`;
|
|
120
129
|
}).join(os.EOL);
|
|
121
|
-
throw new Error(`Multiple chat conversations with this
|
|
130
|
+
throw new Error(`Multiple chat conversations with this name found. Please disambiguate:${os.EOL}${disambiguationText}`);
|
|
122
131
|
});
|
|
123
132
|
}
|
|
124
133
|
// This Microsoft Graph API request throws an intermittent 404 exception, saying that it cannot find the principal.
|
|
@@ -159,7 +168,7 @@ class TeamsChatMessageSendCommand extends GraphCommand_1.default {
|
|
|
159
168
|
}
|
|
160
169
|
});
|
|
161
170
|
}
|
|
162
|
-
sendChatMessage(chatId,
|
|
171
|
+
sendChatMessage(chatId, args) {
|
|
163
172
|
return __awaiter(this, void 0, void 0, function* () {
|
|
164
173
|
const requestOptions = {
|
|
165
174
|
url: `${this.resource}/v1.0/chats/${chatId}/messages`,
|
|
@@ -170,18 +179,18 @@ class TeamsChatMessageSendCommand extends GraphCommand_1.default {
|
|
|
170
179
|
responseType: 'json',
|
|
171
180
|
data: {
|
|
172
181
|
body: {
|
|
173
|
-
content: options.message
|
|
182
|
+
content: args.options.message
|
|
174
183
|
}
|
|
175
184
|
}
|
|
176
185
|
};
|
|
177
186
|
yield request_1.default.post(requestOptions);
|
|
178
187
|
});
|
|
179
188
|
}
|
|
180
|
-
findExistingGroupChatsByMembers(expectedMemberEmails) {
|
|
189
|
+
findExistingGroupChatsByMembers(expectedMemberEmails, logger) {
|
|
181
190
|
return __awaiter(this, void 0, void 0, function* () {
|
|
182
191
|
const endpoint = `${this.resource}/v1.0/chats?$filter=chatType eq 'group'&$expand=members&$select=id,topic,createdDateTime,members`;
|
|
183
192
|
const foundChats = [];
|
|
184
|
-
const chats = yield
|
|
193
|
+
const chats = yield utils_1.odata.getAllItems(endpoint, logger);
|
|
185
194
|
for (const chat of chats) {
|
|
186
195
|
const chatMembers = chat.members;
|
|
187
196
|
if (chatMembers.length === expectedMemberEmails.length) {
|
|
@@ -194,31 +203,14 @@ class TeamsChatMessageSendCommand extends GraphCommand_1.default {
|
|
|
194
203
|
return foundChats;
|
|
195
204
|
});
|
|
196
205
|
}
|
|
197
|
-
|
|
206
|
+
findExistingGroupChatsByName(name, logger) {
|
|
198
207
|
return __awaiter(this, void 0, void 0, function* () {
|
|
199
|
-
const endpoint = `${this.resource}/v1.0/chats?$filter=topic eq '${encodeURIComponent(
|
|
200
|
-
|
|
201
|
-
return chats;
|
|
208
|
+
const endpoint = `${this.resource}/v1.0/chats?$filter=topic eq '${encodeURIComponent(name)}'&$expand=members&$select=id,topic,createdDateTime,chatType`;
|
|
209
|
+
return utils_1.odata.getAllItems(endpoint, logger);
|
|
202
210
|
});
|
|
203
211
|
}
|
|
204
|
-
|
|
205
|
-
return
|
|
206
|
-
const requestOptions = {
|
|
207
|
-
url: url,
|
|
208
|
-
headers: {
|
|
209
|
-
accept: 'application/json;odata.metadata=none'
|
|
210
|
-
},
|
|
211
|
-
responseType: 'json'
|
|
212
|
-
};
|
|
213
|
-
const res = yield request_1.default.get(requestOptions);
|
|
214
|
-
items = items.concat(res.value);
|
|
215
|
-
if (res['@odata.nextLink']) {
|
|
216
|
-
return yield this.getAllChats(res['@odata.nextLink'], items);
|
|
217
|
-
}
|
|
218
|
-
else {
|
|
219
|
-
return items;
|
|
220
|
-
}
|
|
221
|
-
});
|
|
212
|
+
convertCommaSeparatedListToArray(userEmailsString) {
|
|
213
|
+
return userEmailsString.toLowerCase().replace(/\s/g, '').split(',').filter(e => e && e !== '');
|
|
222
214
|
}
|
|
223
215
|
}
|
|
224
216
|
module.exports = new TeamsChatMessageSendCommand();
|
package/dist/settingsNames.js
CHANGED
package/dist/utils/formatting.js
CHANGED
package/dist/utils/index.js
CHANGED
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
3
|
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
5
9
|
}) : (function(o, m, k, k2) {
|
|
6
10
|
if (k2 === undefined) k2 = k;
|
|
7
11
|
o[k2] = m[k];
|
|
@@ -1,9 +1,15 @@
|
|
|
1
|
-
# aad app
|
|
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
|
|
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
|
|
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
|
-
|
|
41
|
+
Remove the Azure AD application registration by its app (client) ID
|
|
36
42
|
|
|
37
43
|
```sh
|
|
38
|
-
m365 aad app
|
|
44
|
+
m365 aad app remove --appId d75be2e1-0204-4f95-857d-51a37cf40be8
|
|
39
45
|
```
|
|
40
46
|
|
|
41
|
-
|
|
47
|
+
Remove the Azure AD application registration by its object ID
|
|
42
48
|
|
|
43
49
|
```sh
|
|
44
|
-
m365 aad app
|
|
50
|
+
m365 aad app remove --objectId d75be2e1-0204-4f95-857d-51a37cf40be8
|
|
45
51
|
```
|
|
46
52
|
|
|
47
|
-
|
|
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
|
|
56
|
+
m365 aad app remove --name "My app" --confirm
|
|
51
57
|
```
|