@pnp/cli-microsoft365 5.1.0-beta.ffd9bc8 → 5.2.0-beta.90d2227
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/Dockerfile +7 -4
- package/dist/Auth.js +10 -0
- package/dist/Command.js +3 -0
- package/dist/cli/Cli.js +14 -17
- package/dist/m365/app/commands/app-get.js +30 -0
- package/dist/m365/app/commands.js +1 -0
- package/dist/m365/cli/commands/config/config-set.js +3 -2
- package/dist/m365/spfx/commands/project/{project-upgrade/rules/JsonRule.js → JsonRule.js} +0 -0
- package/dist/m365/spfx/commands/project/{project-upgrade/rules/Rule.js → Rule.js} +0 -0
- package/dist/m365/spfx/commands/project/base-project-command.js +3 -3
- package/dist/m365/spfx/commands/project/project-doctor/doctor-1.0.0.js +9 -0
- package/dist/m365/spfx/commands/project/project-doctor/doctor-1.0.1.js +9 -0
- package/dist/m365/spfx/commands/project/project-doctor/doctor-1.0.2.js +9 -0
- package/dist/m365/spfx/commands/project/project-doctor/doctor-1.1.0.js +17 -0
- package/dist/m365/spfx/commands/project/project-doctor/doctor-1.1.1.js +17 -0
- package/dist/m365/spfx/commands/project/project-doctor/doctor-1.1.3.js +17 -0
- package/dist/m365/spfx/commands/project/project-doctor/doctor-1.10.0.js +23 -0
- package/dist/m365/spfx/commands/project/project-doctor/doctor-1.11.0.js +23 -0
- package/dist/m365/spfx/commands/project/project-doctor/doctor-1.12.0.js +23 -0
- package/dist/m365/spfx/commands/project/project-doctor/doctor-1.12.1.js +23 -0
- package/dist/m365/spfx/commands/project/project-doctor/doctor-1.13.0.js +23 -0
- package/dist/m365/spfx/commands/project/project-doctor/doctor-1.13.1.js +23 -0
- package/dist/m365/spfx/commands/project/project-doctor/doctor-1.14.0.js +23 -0
- package/dist/m365/spfx/commands/project/project-doctor/doctor-1.2.0.js +17 -0
- package/dist/m365/spfx/commands/project/project-doctor/doctor-1.3.0.js +17 -0
- package/dist/m365/spfx/commands/project/project-doctor/doctor-1.3.1.js +17 -0
- package/dist/m365/spfx/commands/project/project-doctor/doctor-1.3.2.js +17 -0
- package/dist/m365/spfx/commands/project/project-doctor/doctor-1.3.4.js +19 -0
- package/dist/m365/spfx/commands/project/project-doctor/doctor-1.4.0.js +19 -0
- package/dist/m365/spfx/commands/project/project-doctor/doctor-1.4.1.js +19 -0
- package/dist/m365/spfx/commands/project/project-doctor/doctor-1.5.0.js +19 -0
- package/dist/m365/spfx/commands/project/project-doctor/doctor-1.5.1.js +19 -0
- package/dist/m365/spfx/commands/project/project-doctor/doctor-1.6.0.js +19 -0
- package/dist/m365/spfx/commands/project/project-doctor/doctor-1.7.0.js +19 -0
- package/dist/m365/spfx/commands/project/project-doctor/doctor-1.7.1.js +19 -0
- package/dist/m365/spfx/commands/project/project-doctor/doctor-1.8.0.js +21 -0
- package/dist/m365/spfx/commands/project/project-doctor/doctor-1.8.1.js +21 -0
- package/dist/m365/spfx/commands/project/project-doctor/doctor-1.8.2.js +23 -0
- package/dist/m365/spfx/commands/project/project-doctor/doctor-1.9.1.js +23 -0
- package/dist/m365/spfx/commands/project/project-doctor/generic-rules.js +30 -0
- package/dist/m365/spfx/commands/project/project-doctor/rules/DependencyRule.js +76 -0
- package/dist/m365/spfx/commands/project/project-doctor/rules/FN001008_DEP_react.js +18 -0
- package/dist/m365/spfx/commands/project/project-doctor/rules/FN001009_DEP_react_dom.js +18 -0
- package/dist/m365/spfx/commands/project/project-doctor/rules/FN001022_DEP_office_ui_fabric_react.js +18 -0
- package/dist/m365/spfx/commands/project/project-doctor/rules/FN002004_DEVDEP_gulp.js +17 -0
- package/dist/m365/spfx/commands/project/project-doctor/rules/FN002007_DEVDEP_ajv.js +17 -0
- package/dist/m365/spfx/commands/project/project-doctor/rules/FN002013_DEVDEP_types_webpack_env.js +14 -0
- package/dist/m365/spfx/commands/project/project-doctor/rules/FN002015_DEVDEP_types_react.js +18 -0
- package/dist/m365/spfx/commands/project/project-doctor/rules/FN002016_DEVDEP_types_react_dom.js +18 -0
- package/dist/m365/spfx/commands/project/project-doctor/rules/FN002019_DEVDEP_microsoft_rush_stack_compiler.js +68 -0
- package/dist/m365/spfx/commands/project/project-doctor/rules/FN021001_PKG_spfx_deps_versions_match_project_version.js +74 -0
- package/dist/m365/spfx/commands/project/project-doctor/rules/FN021002_PKG_spfx_deps_use_exact_version.js +71 -0
- package/dist/m365/spfx/commands/project/project-doctor/rules/FN021003_PKG_spfx_deps_installed_as_deps.js +46 -0
- package/dist/m365/spfx/commands/project/project-doctor/rules/FN021004_PKG_spfx_devdeps_installed_as_devdeps.js +46 -0
- package/dist/m365/spfx/commands/project/project-doctor/rules/FN021005_PKG_types_installed_as_devdep.js +45 -0
- package/dist/m365/spfx/commands/project/project-doctor/rules/FN021006_PKG_rush_stack_compiler_installed_as_devdep.js +45 -0
- package/dist/m365/spfx/commands/project/project-doctor/rules/FN021007_PKG_only_one_rush_stack_compiler_installed.js +69 -0
- package/dist/m365/spfx/commands/project/project-doctor/rules/FN021008_PKG_no_duplicate_deps.js +59 -0
- package/dist/m365/spfx/commands/project/project-doctor/rules/FN021009_PKG_no_duplicate_oui_deps.js +57 -0
- package/dist/m365/spfx/commands/project/project-doctor/rules/FN021010_PKG_gulp_installed_as_devdep.js +45 -0
- package/dist/m365/spfx/commands/project/project-doctor/rules/FN021011_PKG_ajv_installed_as_devdep.js +45 -0
- package/dist/m365/spfx/commands/project/project-doctor/rules/FN021012_PKG_no_duplicate_pnpjs_deps.js +57 -0
- package/dist/m365/spfx/commands/project/project-doctor/spfx-deps.js +29 -0
- package/dist/m365/spfx/commands/project/project-doctor.js +341 -0
- package/dist/m365/spfx/commands/project/project-externalize/rules/DynamicRule.js +3 -2
- package/dist/m365/spfx/commands/project/project-externalize/rules/PnPJsRule.js +2 -1
- package/dist/m365/spfx/commands/project/{model → project-model}/ConfigJson.js +0 -0
- package/dist/m365/spfx/commands/project/{model → project-model}/CopyAssetsJson.js +0 -0
- package/dist/m365/spfx/commands/project/{model → project-model}/DeployAzureStorageJson.js +0 -0
- package/dist/m365/spfx/commands/project/{model → project-model}/Gitignore.js +0 -0
- package/dist/m365/spfx/commands/project/{model → project-model}/GulpfileJs.js +0 -0
- package/dist/m365/spfx/commands/project/{model → project-model}/JsonFile.js +0 -0
- package/dist/m365/spfx/commands/project/{model → project-model}/Manifest.js +0 -0
- package/dist/m365/spfx/commands/project/{model → project-model}/Npmignore.js +0 -0
- package/dist/m365/spfx/commands/project/{model → project-model}/PackageJson.js +0 -0
- package/dist/m365/spfx/commands/project/{model → project-model}/PackageSolutionJson.js +0 -0
- package/dist/m365/spfx/commands/project/{model → project-model}/Project.js +0 -0
- package/dist/m365/spfx/commands/project/{model → project-model}/ScssFile.js +0 -0
- package/dist/m365/spfx/commands/project/{model → project-model}/ServeJson.js +0 -0
- package/dist/m365/spfx/commands/project/{model → project-model}/TsConfigJson.js +0 -0
- package/dist/m365/spfx/commands/project/{model → project-model}/TsFile.js +0 -0
- package/dist/m365/spfx/commands/project/{model → project-model}/TsLintJson.js +0 -0
- package/dist/m365/spfx/commands/project/{model → project-model}/VsCode.js +0 -0
- package/dist/m365/spfx/commands/project/{model → project-model}/VsCodeExtensionsJson.js +0 -0
- package/dist/m365/spfx/commands/project/{model → project-model}/VsCodeLaunchJson.js +0 -0
- package/dist/m365/spfx/commands/project/{model → project-model}/VsCodeSettingsJson.js +0 -0
- package/dist/m365/spfx/commands/project/{model → project-model}/WriteManifestsJson.js +0 -0
- package/dist/m365/spfx/commands/project/{model → project-model}/YoRcJson.js +0 -0
- package/dist/m365/spfx/commands/project/{model → project-model}/index.js +2 -1
- package/dist/m365/spfx/commands/project/project-upgrade/rules/DependencyRule.js +1 -1
- package/dist/m365/spfx/commands/project/project-upgrade/rules/FN001021_DEP_microsoft_sp_property_pane.js +1 -0
- package/dist/m365/spfx/commands/project/project-upgrade/rules/FN003001_CFG_schema.js +1 -1
- package/dist/m365/spfx/commands/project/project-upgrade/rules/FN003002_CFG_version.js +1 -1
- package/dist/m365/spfx/commands/project/project-upgrade/rules/FN003003_CFG_bundles.js +1 -1
- package/dist/m365/spfx/commands/project/project-upgrade/rules/FN003004_CFG_entries.js +1 -1
- package/dist/m365/spfx/commands/project/project-upgrade/rules/FN003005_CFG_localizedResource_pathLib.js +1 -1
- package/dist/m365/spfx/commands/project/project-upgrade/rules/FN004001_CFG_CA_schema.js +1 -1
- package/dist/m365/spfx/commands/project/project-upgrade/rules/FN004002_CFG_CA_deployCdnPath.js +1 -1
- package/dist/m365/spfx/commands/project/project-upgrade/rules/FN005001_CFG_DAS_schema.js +1 -1
- package/dist/m365/spfx/commands/project/project-upgrade/rules/FN005002_CFG_DAS_workingDir.js +1 -1
- package/dist/m365/spfx/commands/project/project-upgrade/rules/FN006001_CFG_PS_schema.js +1 -1
- package/dist/m365/spfx/commands/project/project-upgrade/rules/FN006002_CFG_PS_includeClientSideAssets.js +1 -1
- package/dist/m365/spfx/commands/project/project-upgrade/rules/FN006003_CFG_PS_isDomainIsolated.js +1 -1
- package/dist/m365/spfx/commands/project/project-upgrade/rules/FN006004_CFG_PS_developer.js +1 -1
- package/dist/m365/spfx/commands/project/project-upgrade/rules/FN006005_CFG_PS_metadata.js +1 -1
- package/dist/m365/spfx/commands/project/project-upgrade/rules/FN006006_CFG_PS_features.js +1 -1
- package/dist/m365/spfx/commands/project/project-upgrade/rules/FN007001_CFG_S_schema.js +1 -1
- package/dist/m365/spfx/commands/project/project-upgrade/rules/FN007002_CFG_S_initialPage.js +1 -1
- package/dist/m365/spfx/commands/project/project-upgrade/rules/FN007003_CFG_S_api.js +1 -1
- package/dist/m365/spfx/commands/project/project-upgrade/rules/FN008001_CFG_TSL_schema.js +1 -1
- package/dist/m365/spfx/commands/project/project-upgrade/rules/FN008002_CFG_TSL_removeRule.js +1 -1
- package/dist/m365/spfx/commands/project/project-upgrade/rules/FN008003_CFG_TSL_preferConst.js +1 -1
- package/dist/m365/spfx/commands/project/project-upgrade/rules/FN009001_CFG_WM_schema.js +1 -1
- package/dist/m365/spfx/commands/project/project-upgrade/rules/FN010001_YORC_version.js +1 -1
- package/dist/m365/spfx/commands/project/project-upgrade/rules/FN010002_YORC_isCreatingSolution.js +1 -1
- package/dist/m365/spfx/commands/project/project-upgrade/rules/FN010003_YORC_packageManager.js +1 -1
- package/dist/m365/spfx/commands/project/project-upgrade/rules/FN010004_YORC_componentType.js +1 -1
- package/dist/m365/spfx/commands/project/project-upgrade/rules/FN010005_YORC_environment.js +1 -1
- package/dist/m365/spfx/commands/project/project-upgrade/rules/FN010006_YORC_framework.js +1 -1
- package/dist/m365/spfx/commands/project/project-upgrade/rules/FN010007_YORC_isDomainIsolated.js +1 -1
- package/dist/m365/spfx/commands/project/project-upgrade/rules/FN012001_TSC_module.js +1 -1
- package/dist/m365/spfx/commands/project/project-upgrade/rules/FN012002_TSC_moduleResolution.js +1 -1
- package/dist/m365/spfx/commands/project/project-upgrade/rules/FN012003_TSC_skipLibCheck.js +1 -1
- package/dist/m365/spfx/commands/project/project-upgrade/rules/FN012004_TSC_typeRoots_types.js +1 -1
- package/dist/m365/spfx/commands/project/project-upgrade/rules/FN012005_TSC_typeRoots_microsoft.js +1 -1
- package/dist/m365/spfx/commands/project/project-upgrade/rules/FN012006_TSC_types_es6_collections.js +1 -1
- package/dist/m365/spfx/commands/project/project-upgrade/rules/FN012007_TSC_lib_es5.js +1 -1
- package/dist/m365/spfx/commands/project/project-upgrade/rules/FN012008_TSC_lib_dom.js +1 -1
- package/dist/m365/spfx/commands/project/project-upgrade/rules/FN012009_TSC_lib_es2015_collection.js +1 -1
- package/dist/m365/spfx/commands/project/project-upgrade/rules/FN012010_TSC_experimentalDecorators.js +1 -1
- package/dist/m365/spfx/commands/project/project-upgrade/rules/FN012011_TSC_outDir.js +1 -1
- package/dist/m365/spfx/commands/project/project-upgrade/rules/FN012012_TSC_include.js +1 -1
- package/dist/m365/spfx/commands/project/project-upgrade/rules/FN012013_TSC_exclude.js +1 -1
- package/dist/m365/spfx/commands/project/project-upgrade/rules/FN012014_TSC_inlineSources.js +1 -1
- package/dist/m365/spfx/commands/project/project-upgrade/rules/FN012015_TSC_strictNullChecks.js +1 -1
- package/dist/m365/spfx/commands/project/project-upgrade/rules/FN012016_TSC_noUnusedLocals.js +1 -1
- package/dist/m365/spfx/commands/project/project-upgrade/rules/FN012017_TSC_extends.js +1 -1
- package/dist/m365/spfx/commands/project/project-upgrade/rules/FN012018_TSC_lib_es2015_promise.js +1 -1
- package/dist/m365/spfx/commands/project/project-upgrade/rules/FN012019_TSC_types_es6_promise.js +1 -1
- package/dist/m365/spfx/commands/project/project-upgrade/rules/FN013001_GULP_msGridSassSuppression.js +1 -1
- package/dist/m365/spfx/commands/project/project-upgrade/rules/FN013002_GULP_serveTask.js +1 -1
- package/dist/m365/spfx/commands/project/project-upgrade/rules/FN014001_CODE_settings_jsonSchemas.js +1 -1
- package/dist/m365/spfx/commands/project/project-upgrade/rules/FN014002_CODE_extensions.js +1 -1
- package/dist/m365/spfx/commands/project/project-upgrade/rules/FN014003_CODE_launch.js +1 -1
- package/dist/m365/spfx/commands/project/project-upgrade/rules/FN014004_CODE_settings_jsonSchemas_configJson_url.js +1 -1
- package/dist/m365/spfx/commands/project/project-upgrade/rules/FN014005_CODE_settingsfile.js +1 -1
- package/dist/m365/spfx/commands/project/project-upgrade/rules/FN014006_CODE_launch_sourceMapPathOverrides.js +1 -1
- package/dist/m365/spfx/commands/project/project-upgrade/rules/FN014007_CODE_launch_localWorkbench.js +1 -1
- package/dist/m365/spfx/commands/project/project-upgrade/rules/FN014008_CODE_launch_hostedWorkbench_type.js +1 -1
- package/dist/m365/spfx/commands/project/project-upgrade/rules/FN017001_MISC_npm_dedupe.js +1 -1
- package/dist/m365/spfx/commands/project/project-upgrade/rules/FN018001_TEAMS_folder.js +1 -1
- package/dist/m365/spfx/commands/project/project-upgrade/rules/FN018002_TEAMS_manifest.js +1 -1
- package/dist/m365/spfx/commands/project/project-upgrade/rules/FN018003_TEAMS_tab20x20_png.js +1 -1
- package/dist/m365/spfx/commands/project/project-upgrade/rules/FN018004_TEAMS_tab96x96_png.js +1 -1
- package/dist/m365/spfx/commands/project/project-upgrade/rules/FN018005_TEAMS_deprecated_manifest.js +1 -1
- package/dist/m365/spfx/commands/project/project-upgrade/rules/FN019001_TSL_rulesDirectory.js +1 -1
- package/dist/m365/spfx/commands/project/project-upgrade/rules/FN019002_TSL_extends.js +1 -1
- package/dist/m365/spfx/commands/project/project-upgrade/rules/FN023001_GITIGNORE_release.js +1 -1
- package/dist/m365/spfx/commands/project/project-upgrade/rules/FN023002_GITIGNORE_heft.js +1 -1
- package/dist/m365/spfx/commands/project/project-upgrade/rules/FN024001_NPMIGNORE_file.js +1 -1
- package/dist/m365/spfx/commands/project/project-upgrade/rules/FileAddRemoveRule.js +1 -1
- package/dist/m365/spfx/commands/project/project-upgrade/rules/ManifestRule.js +1 -1
- package/dist/m365/spfx/commands/project/project-upgrade/rules/PackageRule.js +1 -1
- package/dist/m365/spfx/commands/project/project-upgrade/rules/ResolutionRule.js +1 -1
- package/dist/m365/spfx/commands/project/project-upgrade/rules/ScssRule.js +1 -1
- package/dist/m365/spfx/commands/project/project-upgrade/rules/TsRule.js +1 -1
- package/dist/m365/spfx/commands/project/project-upgrade.js +37 -153
- package/dist/m365/spfx/commands/project/{project-upgrade → report-model}/Finding.js +0 -0
- package/dist/m365/spfx/commands/project/{project-upgrade → report-model}/FindingToReport.js +0 -0
- package/dist/m365/spfx/commands/project/{project-upgrade → report-model}/FindingTour.js +0 -0
- package/dist/m365/spfx/commands/project/{project-upgrade → report-model}/FindingTourStep.js +0 -0
- package/dist/m365/spfx/commands/project/{project-upgrade → report-model}/Occurrence.js +0 -0
- package/dist/m365/spfx/commands/project/{ReportData.js → report-model/ReportData.js} +0 -0
- package/dist/m365/spfx/commands/project/{project-upgrade → report-model}/index.js +2 -3
- package/dist/m365/spfx/commands/spfx-doctor.js +6 -0
- package/dist/m365/spfx/commands.js +1 -0
- package/dist/m365/spo/commands/app/app-teamspackage-download.js +180 -0
- package/dist/m365/spo/commands/tenant/tenant-recyclebinitem-restore.js +10 -44
- package/dist/m365/spo/commands.js +1 -0
- package/dist/m365/teams/commands/chat/chat-get.js +143 -0
- package/dist/m365/teams/commands/chat/chat-message-send.js +5 -30
- package/dist/m365/teams/commands/chat/chatUtil.js +62 -0
- package/dist/m365/teams/commands.js +1 -0
- package/dist/m365/tenant/commands.js +1 -6
- package/dist/settingsNames.js +1 -0
- package/dist/utils/fsUtil.js +70 -0
- package/dist/utils/index.js +3 -0
- package/dist/utils/md.js +81 -0
- package/dist/utils/packageManager.js +66 -0
- package/dist/utils/spfx.js +6 -5
- package/dist/{m365/spfx/commands/project/project-upgrade/Hash.js → utils/types.js} +1 -1
- package/docs/docs/cmd/app/app-get.md +36 -0
- package/docs/docs/cmd/spfx/project/project-doctor.md +64 -0
- package/docs/docs/cmd/spfx/spfx-doctor.md +4 -1
- package/docs/docs/cmd/spo/app/app-teamspackage-download.md +56 -0
- package/docs/docs/cmd/teams/chat/chat-get.md +53 -0
- package/npm-shrinkwrap.json +292 -740
- package/package.json +2 -2
- package/dist/m365/spfx/commands/project/project-upgrade/DependencyInformation.js +0 -3
- package/dist/m365/spfx/commands/project/project-upgrade/Dictionary.js +0 -3
- package/dist/m365/tenant/commands/auditlog/auditlog-report.js +0 -231
- package/dist/m365/tenant/commands/service/service-list.js +0 -41
- package/dist/m365/tenant/commands/service/service-message-list.js +0 -55
- package/dist/m365/tenant/commands/service/service-report-historicalservicestatus.js +0 -54
- package/dist/m365/tenant/commands/status/status-list.js +0 -55
- package/docs/docs/cmd/tenant/auditlog/auditlog-report.md +0 -61
- package/docs/docs/cmd/tenant/service/service-list.md +0 -25
- package/docs/docs/cmd/tenant/service/service-message-list.md +0 -34
- package/docs/docs/cmd/tenant/service/service-report-historicalservicestatus.md +0 -38
- package/docs/docs/cmd/tenant/status/status-list.md +0 -34
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
const Auth_1 = require("../../../../Auth");
|
|
13
|
+
const os = require("os");
|
|
14
|
+
const request_1 = require("../../../../request");
|
|
15
|
+
const GraphCommand_1 = require("../../../base/GraphCommand");
|
|
16
|
+
const commands_1 = require("../../commands");
|
|
17
|
+
const validation_1 = require("../../../../utils/validation");
|
|
18
|
+
const accessToken_1 = require("../../../../utils/accessToken");
|
|
19
|
+
const chatUtil_1 = require("./chatUtil");
|
|
20
|
+
class TeamsChatGetCommand extends GraphCommand_1.default {
|
|
21
|
+
get name() {
|
|
22
|
+
return commands_1.default.CHAT_GET;
|
|
23
|
+
}
|
|
24
|
+
get description() {
|
|
25
|
+
return 'Get a Microsoft Teams chat conversation by id, participants or chat name.';
|
|
26
|
+
}
|
|
27
|
+
getTelemetryProperties(args) {
|
|
28
|
+
const telemetryProps = super.getTelemetryProperties(args);
|
|
29
|
+
telemetryProps.id = typeof args.options.id !== 'undefined';
|
|
30
|
+
telemetryProps.participants = typeof args.options.participants !== 'undefined';
|
|
31
|
+
telemetryProps.name = typeof args.options.name !== 'undefined';
|
|
32
|
+
return telemetryProps;
|
|
33
|
+
}
|
|
34
|
+
commandAction(logger, args, cb) {
|
|
35
|
+
this
|
|
36
|
+
.getChatId(logger, args)
|
|
37
|
+
.then(chatId => this.getChatDetailsById(chatId))
|
|
38
|
+
.then((chat) => {
|
|
39
|
+
logger.log(chat);
|
|
40
|
+
cb();
|
|
41
|
+
}, (err) => this.handleRejectedODataJsonPromise(err, logger, cb));
|
|
42
|
+
}
|
|
43
|
+
options() {
|
|
44
|
+
const options = [
|
|
45
|
+
{
|
|
46
|
+
option: '-i, --id [id]'
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
option: '-p, --participants [participants]'
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
option: '-n, --name [name]'
|
|
53
|
+
}
|
|
54
|
+
];
|
|
55
|
+
const parentOptions = super.options();
|
|
56
|
+
return options.concat(parentOptions);
|
|
57
|
+
}
|
|
58
|
+
validate(args) {
|
|
59
|
+
if (!args.options.id && !args.options.participants && !args.options.name) {
|
|
60
|
+
return 'Specify id or participants or name, one is required.';
|
|
61
|
+
}
|
|
62
|
+
let nrOfMutuallyExclusiveOptionsInUse = 0;
|
|
63
|
+
if (args.options.id) {
|
|
64
|
+
nrOfMutuallyExclusiveOptionsInUse++;
|
|
65
|
+
}
|
|
66
|
+
if (args.options.participants) {
|
|
67
|
+
nrOfMutuallyExclusiveOptionsInUse++;
|
|
68
|
+
}
|
|
69
|
+
if (args.options.name) {
|
|
70
|
+
nrOfMutuallyExclusiveOptionsInUse++;
|
|
71
|
+
}
|
|
72
|
+
if (nrOfMutuallyExclusiveOptionsInUse > 1) {
|
|
73
|
+
return 'Specify either id or participants or name, but not multiple.';
|
|
74
|
+
}
|
|
75
|
+
if (args.options.id && !validation_1.validation.isValidTeamsChatId(args.options.id)) {
|
|
76
|
+
return `${args.options.id} is not a valid Teams ChatId.`;
|
|
77
|
+
}
|
|
78
|
+
if (args.options.participants) {
|
|
79
|
+
const participants = chatUtil_1.chatUtil.convertParticipantStringToArray(args.options.participants);
|
|
80
|
+
if (!participants || participants.length === 0 || participants.some(e => !validation_1.validation.isValidUserPrincipalName(e))) {
|
|
81
|
+
return `${args.options.participants} contains one or more invalid email addresses.`;
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
return true;
|
|
85
|
+
}
|
|
86
|
+
getChatId(logger, args) {
|
|
87
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
88
|
+
if (args.options.id) {
|
|
89
|
+
return args.options.id;
|
|
90
|
+
}
|
|
91
|
+
return args.options.participants
|
|
92
|
+
? this.getChatIdByParticipants(args.options.participants, logger)
|
|
93
|
+
: this.getChatIdByName(args.options.name, logger);
|
|
94
|
+
});
|
|
95
|
+
}
|
|
96
|
+
getChatDetailsById(id) {
|
|
97
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
98
|
+
const requestOptions = {
|
|
99
|
+
url: `${this.resource}/v1.0/chats/${encodeURIComponent(id)}`,
|
|
100
|
+
headers: {
|
|
101
|
+
accept: 'application/json;odata.metadata=none'
|
|
102
|
+
},
|
|
103
|
+
responseType: 'json'
|
|
104
|
+
};
|
|
105
|
+
return request_1.default.get(requestOptions);
|
|
106
|
+
});
|
|
107
|
+
}
|
|
108
|
+
getChatIdByParticipants(participantsString, logger) {
|
|
109
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
110
|
+
const participants = chatUtil_1.chatUtil.convertParticipantStringToArray(participantsString);
|
|
111
|
+
const currentUserEmail = accessToken_1.accessToken.getUserNameFromAccessToken(Auth_1.default.service.accessTokens[this.resource].accessToken).toLowerCase();
|
|
112
|
+
const existingChats = yield chatUtil_1.chatUtil.findExistingChatsByParticipants([currentUserEmail, ...participants], logger);
|
|
113
|
+
if (!existingChats || existingChats.length === 0) {
|
|
114
|
+
throw new Error('No chat conversation was found with these participants.');
|
|
115
|
+
}
|
|
116
|
+
if (existingChats.length === 1) {
|
|
117
|
+
return existingChats[0].id;
|
|
118
|
+
}
|
|
119
|
+
const disambiguationText = existingChats.map(c => {
|
|
120
|
+
return `- ${c.id}${c.topic && ' - '}${c.topic} - ${c.createdDateTime && new Date(c.createdDateTime).toLocaleString()}`;
|
|
121
|
+
}).join(os.EOL);
|
|
122
|
+
throw new Error(`Multiple chat conversations with these participants found. Please disambiguate:${os.EOL}${disambiguationText}`);
|
|
123
|
+
});
|
|
124
|
+
}
|
|
125
|
+
getChatIdByName(name, logger) {
|
|
126
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
127
|
+
const existingChats = yield chatUtil_1.chatUtil.findExistingGroupChatsByName(name, logger);
|
|
128
|
+
if (!existingChats || existingChats.length === 0) {
|
|
129
|
+
throw new Error('No chat conversation was found with this name.');
|
|
130
|
+
}
|
|
131
|
+
if (existingChats.length === 1) {
|
|
132
|
+
return existingChats[0].id;
|
|
133
|
+
}
|
|
134
|
+
const disambiguationText = existingChats.map(c => {
|
|
135
|
+
const memberstring = c.members.map(m => m.email).join(', ');
|
|
136
|
+
return `- ${c.id} - ${c.createdDateTime && new Date(c.createdDateTime).toLocaleString()} - ${memberstring}`;
|
|
137
|
+
}).join(os.EOL);
|
|
138
|
+
throw new Error(`Multiple chat conversations with this name found. Please disambiguate:${os.EOL}${disambiguationText}`);
|
|
139
|
+
});
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
module.exports = new TeamsChatGetCommand();
|
|
143
|
+
//# sourceMappingURL=chat-get.js.map
|
|
@@ -15,6 +15,7 @@ const request_1 = require("../../../../request");
|
|
|
15
15
|
const utils_1 = require("../../../../utils");
|
|
16
16
|
const GraphCommand_1 = require("../../../base/GraphCommand");
|
|
17
17
|
const commands_1 = require("../../commands");
|
|
18
|
+
const chatUtil_1 = require("./chatUtil");
|
|
18
19
|
class TeamsChatMessageSendCommand extends GraphCommand_1.default {
|
|
19
20
|
get name() {
|
|
20
21
|
return commands_1.default.CHAT_MESSAGE_SEND;
|
|
@@ -79,7 +80,7 @@ class TeamsChatMessageSendCommand extends GraphCommand_1.default {
|
|
|
79
80
|
return `${args.options.chatId} is not a valid Teams ChatId.`;
|
|
80
81
|
}
|
|
81
82
|
if (args.options.userEmails) {
|
|
82
|
-
const userEmails =
|
|
83
|
+
const userEmails = chatUtil_1.chatUtil.convertParticipantStringToArray(args.options.userEmails);
|
|
83
84
|
if (!userEmails || userEmails.length === 0 || userEmails.some(e => !utils_1.validation.isValidUserPrincipalName(e))) {
|
|
84
85
|
return `${args.options.userEmails} contains one or more invalid email addresses.`;
|
|
85
86
|
}
|
|
@@ -98,9 +99,9 @@ class TeamsChatMessageSendCommand extends GraphCommand_1.default {
|
|
|
98
99
|
}
|
|
99
100
|
ensureChatIdByUserEmails(userEmailsOption, logger) {
|
|
100
101
|
return __awaiter(this, void 0, void 0, function* () {
|
|
101
|
-
const userEmails =
|
|
102
|
+
const userEmails = chatUtil_1.chatUtil.convertParticipantStringToArray(userEmailsOption);
|
|
102
103
|
const currentUserEmail = utils_1.accessToken.getUserNameFromAccessToken(Auth_1.default.service.accessTokens[this.resource].accessToken).toLowerCase();
|
|
103
|
-
const existingChats = yield
|
|
104
|
+
const existingChats = yield chatUtil_1.chatUtil.findExistingChatsByParticipants([currentUserEmail, ...userEmails], logger);
|
|
104
105
|
if (!existingChats || existingChats.length === 0) {
|
|
105
106
|
const chat = yield this.createConversation([currentUserEmail, ...userEmails]);
|
|
106
107
|
return chat.id;
|
|
@@ -116,7 +117,7 @@ class TeamsChatMessageSendCommand extends GraphCommand_1.default {
|
|
|
116
117
|
}
|
|
117
118
|
getChatIdByName(chatName, logger) {
|
|
118
119
|
return __awaiter(this, void 0, void 0, function* () {
|
|
119
|
-
const existingChats = yield
|
|
120
|
+
const existingChats = yield chatUtil_1.chatUtil.findExistingGroupChatsByName(chatName, logger);
|
|
120
121
|
if (!existingChats || existingChats.length === 0) {
|
|
121
122
|
throw new Error('No chat conversation was found with this name.');
|
|
122
123
|
}
|
|
@@ -186,32 +187,6 @@ class TeamsChatMessageSendCommand extends GraphCommand_1.default {
|
|
|
186
187
|
yield request_1.default.post(requestOptions);
|
|
187
188
|
});
|
|
188
189
|
}
|
|
189
|
-
findExistingGroupChatsByMembers(expectedMemberEmails, logger) {
|
|
190
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
191
|
-
const endpoint = `${this.resource}/v1.0/chats?$filter=chatType eq 'group'&$expand=members&$select=id,topic,createdDateTime,members`;
|
|
192
|
-
const foundChats = [];
|
|
193
|
-
const chats = yield utils_1.odata.getAllItems(endpoint, logger);
|
|
194
|
-
for (const chat of chats) {
|
|
195
|
-
const chatMembers = chat.members;
|
|
196
|
-
if (chatMembers.length === expectedMemberEmails.length) {
|
|
197
|
-
const chatMemberEmails = chatMembers.map(member => { var _a; return (_a = member.email) === null || _a === void 0 ? void 0 : _a.toLowerCase(); });
|
|
198
|
-
if (expectedMemberEmails.every(email => chatMemberEmails.some(memberEmail => memberEmail === email))) {
|
|
199
|
-
foundChats.push(chat);
|
|
200
|
-
}
|
|
201
|
-
}
|
|
202
|
-
}
|
|
203
|
-
return foundChats;
|
|
204
|
-
});
|
|
205
|
-
}
|
|
206
|
-
findExistingGroupChatsByName(name, logger) {
|
|
207
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
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);
|
|
210
|
-
});
|
|
211
|
-
}
|
|
212
|
-
convertCommaSeparatedListToArray(userEmailsString) {
|
|
213
|
-
return userEmailsString.toLowerCase().replace(/\s/g, '').split(',').filter(e => e && e !== '');
|
|
214
|
-
}
|
|
215
190
|
}
|
|
216
191
|
module.exports = new TeamsChatMessageSendCommand();
|
|
217
192
|
//# sourceMappingURL=chat-message-send.js.map
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.chatUtil = void 0;
|
|
13
|
+
const odata_1 = require("../../../../utils/odata");
|
|
14
|
+
exports.chatUtil = {
|
|
15
|
+
/**
|
|
16
|
+
* Finds existing Microsoft Teams chats by participants, using the Microsoft Graph
|
|
17
|
+
* @param expectedMemberEmails a string array of participant emailaddresses
|
|
18
|
+
* @param logger a logger to pipe into the graph request odata helper.
|
|
19
|
+
*/
|
|
20
|
+
findExistingChatsByParticipants(expectedMemberEmails, logger) {
|
|
21
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
22
|
+
const chatType = expectedMemberEmails.length === 2 ? 'oneOnOne' : 'group';
|
|
23
|
+
const endpoint = `https://graph.microsoft.com/v1.0/chats?$filter=chatType eq '${chatType}'&$expand=members&$select=id,topic,createdDateTime,members`;
|
|
24
|
+
const foundChats = [];
|
|
25
|
+
const chats = yield odata_1.odata.getAllItems(endpoint, logger);
|
|
26
|
+
for (const chat of chats) {
|
|
27
|
+
const chatMembers = chat.members;
|
|
28
|
+
if (chatMembers.length === expectedMemberEmails.length) {
|
|
29
|
+
const chatMemberEmails = chatMembers.map(member => { var _a; return (_a = member.email) === null || _a === void 0 ? void 0 : _a.toLowerCase(); });
|
|
30
|
+
if (expectedMemberEmails.every(email => chatMemberEmails.some(memberEmail => memberEmail === email))) {
|
|
31
|
+
foundChats.push(chat);
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
return foundChats;
|
|
36
|
+
});
|
|
37
|
+
},
|
|
38
|
+
/**
|
|
39
|
+
* Finds existing Microsoft Teams chats by name, using the Microsoft Graph
|
|
40
|
+
* @param name the name of the chat conversation to find
|
|
41
|
+
* @param logger a logger to pipe into the graph request odata helper.
|
|
42
|
+
*/
|
|
43
|
+
findExistingGroupChatsByName(name, logger) {
|
|
44
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
45
|
+
const endpoint = `https://graph.microsoft.com/v1.0/chats?$filter=topic eq '${encodeURIComponent(name).replace("'", "''")}'&$expand=members&$select=id,topic,createdDateTime,chatType`;
|
|
46
|
+
return odata_1.odata.getAllItems(endpoint, logger);
|
|
47
|
+
});
|
|
48
|
+
},
|
|
49
|
+
/**
|
|
50
|
+
* Converts a comma or space separated string into an array.
|
|
51
|
+
* @param value the string to convert
|
|
52
|
+
*/
|
|
53
|
+
convertParticipantStringToArray(value) {
|
|
54
|
+
if (value.indexOf(',') === -1) {
|
|
55
|
+
return value.trim().toLowerCase().split(' ').filter(e => e && e !== '');
|
|
56
|
+
}
|
|
57
|
+
else {
|
|
58
|
+
return value.trim().toLowerCase().split(',').filter(e => e && e !== '');
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
};
|
|
62
|
+
//# sourceMappingURL=chatUtil.js.map
|
|
@@ -13,6 +13,7 @@ exports.default = {
|
|
|
13
13
|
CHANNEL_LIST: `${prefix} channel list`,
|
|
14
14
|
CHANNEL_REMOVE: `${prefix} channel remove`,
|
|
15
15
|
CHANNEL_SET: `${prefix} channel set`,
|
|
16
|
+
CHAT_GET: `${prefix} chat get`,
|
|
16
17
|
CHAT_LIST: `${prefix} chat list`,
|
|
17
18
|
CHAT_MEMBER_LIST: `${prefix} chat member list`,
|
|
18
19
|
CHAT_MESSAGE_LIST: `${prefix} chat message list`,
|
|
@@ -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
|
package/dist/settingsNames.js
CHANGED
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.settingsNames = void 0;
|
|
4
4
|
const settingsNames = {
|
|
5
5
|
autoOpenBrowserOnLogin: 'autoOpenBrowserOnLogin',
|
|
6
|
+
copyDeviceCodeToClipboard: 'copyDeviceCodeToClipboard',
|
|
6
7
|
csvEscape: 'csvEscape',
|
|
7
8
|
csvHeader: 'csvHeader',
|
|
8
9
|
csvQuote: 'csvQuote',
|
package/dist/utils/fsUtil.js
CHANGED
|
@@ -3,6 +3,64 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.fsUtil = void 0;
|
|
4
4
|
const fs = require("fs");
|
|
5
5
|
const path = require("path");
|
|
6
|
+
const copyCommands = {
|
|
7
|
+
bash: {
|
|
8
|
+
copyCommand: 'cp',
|
|
9
|
+
copyDestinationParam: ' '
|
|
10
|
+
},
|
|
11
|
+
powershell: {
|
|
12
|
+
copyCommand: 'Copy-Item',
|
|
13
|
+
copyDestinationParam: ' -Destination '
|
|
14
|
+
},
|
|
15
|
+
cmd: {
|
|
16
|
+
copyCommand: 'copy',
|
|
17
|
+
copyDestinationParam: ' '
|
|
18
|
+
}
|
|
19
|
+
};
|
|
20
|
+
const createDirectoryCommands = {
|
|
21
|
+
bash: {
|
|
22
|
+
createDirectoryCommand: 'mkdir',
|
|
23
|
+
createDirectoryPathParam: ' "',
|
|
24
|
+
createDirectoryNameParam: '/',
|
|
25
|
+
createDirectoryItemTypeParam: '"'
|
|
26
|
+
},
|
|
27
|
+
powershell: {
|
|
28
|
+
createDirectoryCommand: 'New-Item',
|
|
29
|
+
createDirectoryPathParam: ' -Path "',
|
|
30
|
+
createDirectoryNameParam: '" -Name "',
|
|
31
|
+
createDirectoryItemTypeParam: '" -ItemType "directory"'
|
|
32
|
+
},
|
|
33
|
+
cmd: {
|
|
34
|
+
createDirectoryCommand: 'mkdir',
|
|
35
|
+
createDirectoryPathParam: ' "',
|
|
36
|
+
createDirectoryNameParam: '\\',
|
|
37
|
+
createDirectoryItemTypeParam: '"'
|
|
38
|
+
}
|
|
39
|
+
};
|
|
40
|
+
const addFileCommands = {
|
|
41
|
+
bash: {
|
|
42
|
+
addFileCommand: 'cat > [FILEPATH] << EOF [FILECONTENT]EOF'
|
|
43
|
+
},
|
|
44
|
+
powershell: {
|
|
45
|
+
addFileCommand: `@"[FILECONTENT]"@ | Out-File -FilePath "[FILEPATH]"
|
|
46
|
+
`
|
|
47
|
+
},
|
|
48
|
+
cmd: {
|
|
49
|
+
addFileCommand: `echo [FILECONTENT] > "[FILEPATH]"
|
|
50
|
+
`
|
|
51
|
+
}
|
|
52
|
+
};
|
|
53
|
+
const removeFileCommands = {
|
|
54
|
+
bash: {
|
|
55
|
+
removeFileCommand: 'rm'
|
|
56
|
+
},
|
|
57
|
+
powershell: {
|
|
58
|
+
removeFileCommand: 'Remove-Item'
|
|
59
|
+
},
|
|
60
|
+
cmd: {
|
|
61
|
+
removeFileCommand: 'del'
|
|
62
|
+
}
|
|
63
|
+
};
|
|
6
64
|
exports.fsUtil = {
|
|
7
65
|
readdirR(dir) {
|
|
8
66
|
return fs.statSync(dir).isDirectory()
|
|
@@ -31,6 +89,18 @@ exports.fsUtil = {
|
|
|
31
89
|
},
|
|
32
90
|
getSafeFileName(input) {
|
|
33
91
|
return input.replace(/'/g, "''");
|
|
92
|
+
},
|
|
93
|
+
getCopyCommand(command, shell) {
|
|
94
|
+
return copyCommands[shell][command];
|
|
95
|
+
},
|
|
96
|
+
getDirectoryCommand(command, shell) {
|
|
97
|
+
return createDirectoryCommands[shell][command];
|
|
98
|
+
},
|
|
99
|
+
getAddCommand(command, shell) {
|
|
100
|
+
return addFileCommands[shell][command];
|
|
101
|
+
},
|
|
102
|
+
getRemoveCommand(command, shell) {
|
|
103
|
+
return removeFileCommands[shell][command];
|
|
34
104
|
}
|
|
35
105
|
};
|
|
36
106
|
//# sourceMappingURL=fsUtil.js.map
|
package/dist/utils/index.js
CHANGED
|
@@ -17,10 +17,13 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
17
17
|
__exportStar(require("./accessToken"), exports);
|
|
18
18
|
__exportStar(require("./formatting"), exports);
|
|
19
19
|
__exportStar(require("./fsUtil"), exports);
|
|
20
|
+
__exportStar(require("./md"), exports);
|
|
20
21
|
__exportStar(require("./odata"), exports);
|
|
22
|
+
__exportStar(require("./packageManager"), exports);
|
|
21
23
|
__exportStar(require("./sinonUtil"), exports);
|
|
22
24
|
__exportStar(require("./spfx"), exports);
|
|
23
25
|
__exportStar(require("./spo"), exports);
|
|
26
|
+
__exportStar(require("./types"), exports);
|
|
24
27
|
__exportStar(require("./urlUtil"), exports);
|
|
25
28
|
__exportStar(require("./validation"), exports);
|
|
26
29
|
//# sourceMappingURL=index.js.map
|
package/dist/utils/md.js
ADDED
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.md = void 0;
|
|
4
|
+
const fs = require("fs");
|
|
5
|
+
const os_1 = require("os");
|
|
6
|
+
const path = require("path");
|
|
7
|
+
function convertTitle(md) {
|
|
8
|
+
return md.replace(/^#\s+(.*)/gm, (match, title) => {
|
|
9
|
+
return title.toLocaleUpperCase() + os_1.EOL + Array(title.length + 1).join('=');
|
|
10
|
+
});
|
|
11
|
+
}
|
|
12
|
+
function convertHeadings(md) {
|
|
13
|
+
return md.replace(/^(#+)\s+(.*)/gm, (match, level, content) => {
|
|
14
|
+
return `${os_1.EOL}${content.toLocaleUpperCase()}`;
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
function convertAdmonitions(md) {
|
|
18
|
+
const regex = new RegExp('^!!!\\s(.*)' + os_1.EOL + '\\s+', 'gm');
|
|
19
|
+
return md.replace(regex, (match, content) => {
|
|
20
|
+
return content.toLocaleUpperCase() + os_1.EOL + os_1.EOL;
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
function includeContent(md, rootFolder) {
|
|
24
|
+
return md.replace(/^--8<-- "([^"]+)"/gm, (match, filePath) => {
|
|
25
|
+
return fs.readFileSync(path.join(rootFolder, filePath), 'utf8');
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
function convertDd(md) {
|
|
29
|
+
return md.replace(/^:\s(.*)/gm, (match, content) => {
|
|
30
|
+
return ` ${content}`;
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
function convertHyperlinks(md) {
|
|
34
|
+
return md.replace(/\[([^\]]+)\]\(([^\)]+)\)/gm, (match, label, url) => {
|
|
35
|
+
// if the link is the same as the content, return just the link
|
|
36
|
+
if (label === url) {
|
|
37
|
+
return url;
|
|
38
|
+
}
|
|
39
|
+
// if the link is relative, remove it because there's no way to open it
|
|
40
|
+
// from the terminal anyway. In the future, we could convert it to the
|
|
41
|
+
// actual link of the docs.
|
|
42
|
+
if (!url.startsWith('http:') && !url.startsWith('https:')) {
|
|
43
|
+
return label;
|
|
44
|
+
}
|
|
45
|
+
return `${label} (${url})`;
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
function convertCodeFences(md) {
|
|
49
|
+
const regex = new RegExp('^```.*?' + os_1.EOL + '(.*?)```' + os_1.EOL, 'gms');
|
|
50
|
+
return md.replace(regex, (match, code) => {
|
|
51
|
+
return ` ${code}${os_1.EOL}`;
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
function removeInlineMarkup(md) {
|
|
55
|
+
// from https://stackoverflow.com/a/70064453
|
|
56
|
+
return md.replace(/(?<marks>[`]|\*{1,3}|_{1,3}|~{2})(?<inmarks>.*?)\1/g, '$<inmarks>$<link_text>');
|
|
57
|
+
}
|
|
58
|
+
function removeTooManyEmptyLines(md) {
|
|
59
|
+
const regex = new RegExp('(' + os_1.EOL + '){4,}', 'g');
|
|
60
|
+
return md.replace(regex, Array(4).join(os_1.EOL));
|
|
61
|
+
}
|
|
62
|
+
const convertFunctions = [
|
|
63
|
+
convertTitle,
|
|
64
|
+
convertHeadings,
|
|
65
|
+
convertAdmonitions,
|
|
66
|
+
convertDd,
|
|
67
|
+
convertHyperlinks,
|
|
68
|
+
convertCodeFences,
|
|
69
|
+
removeInlineMarkup,
|
|
70
|
+
removeTooManyEmptyLines
|
|
71
|
+
];
|
|
72
|
+
exports.md = {
|
|
73
|
+
md2plain(md, rootFolderDocs) {
|
|
74
|
+
md = includeContent(md, rootFolderDocs);
|
|
75
|
+
convertFunctions.forEach(convert => {
|
|
76
|
+
md = convert(md);
|
|
77
|
+
});
|
|
78
|
+
return md;
|
|
79
|
+
}
|
|
80
|
+
};
|
|
81
|
+
//# sourceMappingURL=md.js.map
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.packageManager = void 0;
|
|
4
|
+
const packageCommands = {
|
|
5
|
+
npm: {
|
|
6
|
+
install: 'npm i -SE',
|
|
7
|
+
installDev: 'npm i -DE',
|
|
8
|
+
uninstall: 'npm un -S',
|
|
9
|
+
uninstallDev: 'npm un -D'
|
|
10
|
+
},
|
|
11
|
+
pnpm: {
|
|
12
|
+
install: 'pnpm i -E',
|
|
13
|
+
installDev: 'pnpm i -DE',
|
|
14
|
+
uninstall: 'pnpm un',
|
|
15
|
+
uninstallDev: 'pnpm un'
|
|
16
|
+
},
|
|
17
|
+
yarn: {
|
|
18
|
+
install: 'yarn add -E',
|
|
19
|
+
installDev: 'yarn add -DE',
|
|
20
|
+
uninstall: 'yarn remove',
|
|
21
|
+
uninstallDev: 'yarn remove'
|
|
22
|
+
}
|
|
23
|
+
};
|
|
24
|
+
exports.packageManager = {
|
|
25
|
+
getPackageManagerCommand(command, packageManager) {
|
|
26
|
+
return packageCommands[packageManager][command];
|
|
27
|
+
},
|
|
28
|
+
mapPackageManagerCommand({ command, packagesDepExact, packagesDevExact, packagesDepUn, packagesDevUn, packageMgr }) {
|
|
29
|
+
// matches must be in this particular order to avoid false matches, eg.
|
|
30
|
+
// uninstallDev contains install
|
|
31
|
+
if (command.startsWith(`${exports.packageManager.getPackageManagerCommand('uninstallDev', packageMgr)} `)) {
|
|
32
|
+
packagesDevUn.push(command.replace(exports.packageManager.getPackageManagerCommand('uninstallDev', packageMgr), '').trim());
|
|
33
|
+
return;
|
|
34
|
+
}
|
|
35
|
+
if (command.startsWith(`${exports.packageManager.getPackageManagerCommand('installDev', packageMgr)} `)) {
|
|
36
|
+
packagesDevExact.push(command.replace(exports.packageManager.getPackageManagerCommand('installDev', packageMgr), '').trim());
|
|
37
|
+
return;
|
|
38
|
+
}
|
|
39
|
+
if (command.startsWith(`${exports.packageManager.getPackageManagerCommand('uninstall', packageMgr)} `)) {
|
|
40
|
+
packagesDepUn.push(command.replace(exports.packageManager.getPackageManagerCommand('uninstall', packageMgr), '').trim());
|
|
41
|
+
return;
|
|
42
|
+
}
|
|
43
|
+
if (command.startsWith(`${exports.packageManager.getPackageManagerCommand('install', packageMgr)} `)) {
|
|
44
|
+
packagesDepExact.push(command.replace(exports.packageManager.getPackageManagerCommand('install', packageMgr), '').trim());
|
|
45
|
+
}
|
|
46
|
+
},
|
|
47
|
+
reducePackageManagerCommand({ packagesDepExact, packagesDevExact, packagesDepUn, packagesDevUn, packageMgr }) {
|
|
48
|
+
const commandsToExecute = [];
|
|
49
|
+
// uninstall commands must come first otherwise there is a chance that
|
|
50
|
+
// whatever we recommended to install, will be immediately uninstalled
|
|
51
|
+
if (packagesDepUn.length > 0) {
|
|
52
|
+
commandsToExecute.push(`${exports.packageManager.getPackageManagerCommand('uninstall', packageMgr)} ${packagesDepUn.join(' ')}`);
|
|
53
|
+
}
|
|
54
|
+
if (packagesDevUn.length > 0) {
|
|
55
|
+
commandsToExecute.push(`${exports.packageManager.getPackageManagerCommand('uninstallDev', packageMgr)} ${packagesDevUn.join(' ')}`);
|
|
56
|
+
}
|
|
57
|
+
if (packagesDepExact.length > 0) {
|
|
58
|
+
commandsToExecute.push(`${exports.packageManager.getPackageManagerCommand('install', packageMgr)} ${packagesDepExact.join(' ')}`);
|
|
59
|
+
}
|
|
60
|
+
if (packagesDevExact.length > 0) {
|
|
61
|
+
commandsToExecute.push(`${exports.packageManager.getPackageManagerCommand('installDev', packageMgr)} ${packagesDevExact.join(' ')}`);
|
|
62
|
+
}
|
|
63
|
+
return commandsToExecute;
|
|
64
|
+
}
|
|
65
|
+
};
|
|
66
|
+
//# sourceMappingURL=packageManager.js.map
|
package/dist/utils/spfx.js
CHANGED
|
@@ -3,18 +3,19 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.spfx = void 0;
|
|
4
4
|
exports.spfx = {
|
|
5
5
|
isReactProject(project) {
|
|
6
|
+
var _a, _b;
|
|
6
7
|
return (typeof project.yoRcJson !== 'undefined' &&
|
|
7
8
|
typeof project.yoRcJson['@microsoft/generator-sharepoint'] !== 'undefined' &&
|
|
8
|
-
project.yoRcJson["@microsoft/generator-sharepoint"].framework === 'react'
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
(project.yoRcJson["@microsoft/generator-sharepoint"].framework === 'react' ||
|
|
10
|
+
project.yoRcJson["@microsoft/generator-sharepoint"].template === 'react')) ||
|
|
11
|
+
typeof ((_b = (_a = project.packageJson) === null || _a === void 0 ? void 0 : _a.dependencies) === null || _b === void 0 ? void 0 : _b['react']) !== 'undefined';
|
|
11
12
|
},
|
|
12
13
|
isKnockoutProject(project) {
|
|
14
|
+
var _a, _b;
|
|
13
15
|
return (typeof project.yoRcJson !== 'undefined' &&
|
|
14
16
|
typeof project.yoRcJson['@microsoft/generator-sharepoint'] !== 'undefined' &&
|
|
15
17
|
project.yoRcJson["@microsoft/generator-sharepoint"].framework === 'knockout') ||
|
|
16
|
-
|
|
17
|
-
typeof project.packageJson.dependencies['knockout'] !== 'undefined');
|
|
18
|
+
typeof ((_b = (_a = project.packageJson) === null || _a === void 0 ? void 0 : _a.dependencies) === null || _b === void 0 ? void 0 : _b['knockout']) !== 'undefined';
|
|
18
19
|
}
|
|
19
20
|
};
|
|
20
21
|
//# sourceMappingURL=spfx.js.map
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
# app get
|
|
2
|
+
|
|
3
|
+
Retrieves information about the current Azure AD app
|
|
4
|
+
|
|
5
|
+
## Usage
|
|
6
|
+
|
|
7
|
+
```sh
|
|
8
|
+
m365 app get [options]
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Options
|
|
12
|
+
|
|
13
|
+
`--appId [appId]`
|
|
14
|
+
: Client ID of the Azure AD app registered in the .m365rc.json file to retrieve information for
|
|
15
|
+
|
|
16
|
+
--8<-- "docs/cmd/_global.md"
|
|
17
|
+
|
|
18
|
+
## Remarks
|
|
19
|
+
|
|
20
|
+
Use this command to quickly look up information for the Azure AD application registration registered in the .m365rc.json file in your current project (folder).
|
|
21
|
+
|
|
22
|
+
If you have multiple apps registered in your .m365rc.json file, you can specify the app for which you'd like to retrieve permissions using the `--appId` option. If you don't specify the app using the `--appId` option, you'll be prompted to select one of the applications from your .m365rc.json file.
|
|
23
|
+
|
|
24
|
+
## Examples
|
|
25
|
+
|
|
26
|
+
Retrieve information about your current Azure AD app
|
|
27
|
+
|
|
28
|
+
```sh
|
|
29
|
+
m365 app get
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
Retrieve information about the Azure AD app with client ID _e23d235c-fcdf-45d1-ac5f-24ab2ee0695d_ specified in the _.m365rc.json_ file
|
|
33
|
+
|
|
34
|
+
```sh
|
|
35
|
+
m365 app get --appId e23d235c-fcdf-45d1-ac5f-24ab2ee0695d
|
|
36
|
+
```
|