@pnp/cli-microsoft365 7.7.0-beta.72886a7 → 7.7.0-beta.d874bca
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.cjs +1 -0
- package/allCommands.json +1 -1
- package/allCommandsFull.json +1 -1
- package/dist/Command.js +1 -1
- package/dist/m365/entra/commands/app/app-add.js +7 -1
- package/dist/m365/entra/commands/app/app-set.js +32 -3
- package/dist/m365/entra/commands/pim/pim-role-assignment-add.js +233 -0
- package/dist/m365/entra/commands/pim/pim-role-assignment-list.js +122 -0
- package/dist/m365/entra/commands.js +2 -0
- package/dist/m365/spfx/commands/project/project-doctor/doctor-1.0.0.js +3 -1
- package/dist/m365/spfx/commands/project/project-doctor/doctor-1.0.1.js +3 -1
- package/dist/m365/spfx/commands/project/project-doctor/doctor-1.0.2.js +3 -1
- package/dist/m365/spfx/commands/project/project-doctor/doctor-1.1.0.js +3 -1
- package/dist/m365/spfx/commands/project/project-doctor/doctor-1.1.1.js +3 -1
- package/dist/m365/spfx/commands/project/project-doctor/doctor-1.1.3.js +3 -1
- package/dist/m365/spfx/commands/project/project-doctor/doctor-1.10.0.js +3 -1
- package/dist/m365/spfx/commands/project/project-doctor/doctor-1.11.0.js +3 -1
- package/dist/m365/spfx/commands/project/project-doctor/doctor-1.12.0.js +3 -1
- package/dist/m365/spfx/commands/project/project-doctor/doctor-1.12.1.js +3 -1
- package/dist/m365/spfx/commands/project/project-doctor/doctor-1.13.0.js +3 -1
- package/dist/m365/spfx/commands/project/project-doctor/doctor-1.13.1.js +3 -1
- package/dist/m365/spfx/commands/project/project-doctor/doctor-1.14.0.js +3 -1
- package/dist/m365/spfx/commands/project/project-doctor/doctor-1.15.0.js +3 -1
- package/dist/m365/spfx/commands/project/project-doctor/doctor-1.15.2.js +3 -1
- package/dist/m365/spfx/commands/project/project-doctor/doctor-1.16.0.js +3 -1
- package/dist/m365/spfx/commands/project/project-doctor/doctor-1.16.1.js +3 -1
- package/dist/m365/spfx/commands/project/project-doctor/doctor-1.17.0.js +3 -1
- package/dist/m365/spfx/commands/project/project-doctor/doctor-1.17.1.js +3 -1
- package/dist/m365/spfx/commands/project/project-doctor/doctor-1.17.2.js +3 -1
- package/dist/m365/spfx/commands/project/project-doctor/doctor-1.17.3.js +3 -1
- package/dist/m365/spfx/commands/project/project-doctor/doctor-1.17.4.js +3 -1
- package/dist/m365/spfx/commands/project/project-doctor/doctor-1.18.0.js +3 -1
- package/dist/m365/spfx/commands/project/project-doctor/doctor-1.18.1.js +3 -1
- package/dist/m365/spfx/commands/project/project-doctor/doctor-1.18.2.js +3 -1
- package/dist/m365/spfx/commands/project/project-doctor/doctor-1.19.0-beta.0.js +25 -0
- package/dist/m365/spfx/commands/project/project-doctor/doctor-1.2.0.js +3 -1
- package/dist/m365/spfx/commands/project/project-doctor/doctor-1.3.0.js +3 -1
- package/dist/m365/spfx/commands/project/project-doctor/doctor-1.3.1.js +3 -1
- package/dist/m365/spfx/commands/project/project-doctor/doctor-1.3.2.js +3 -1
- package/dist/m365/spfx/commands/project/project-doctor/doctor-1.3.4.js +3 -1
- package/dist/m365/spfx/commands/project/project-doctor/doctor-1.4.0.js +3 -1
- package/dist/m365/spfx/commands/project/project-doctor/doctor-1.4.1.js +3 -1
- package/dist/m365/spfx/commands/project/project-doctor/doctor-1.5.0.js +3 -1
- package/dist/m365/spfx/commands/project/project-doctor/doctor-1.5.1.js +3 -1
- package/dist/m365/spfx/commands/project/project-doctor/doctor-1.6.0.js +3 -1
- package/dist/m365/spfx/commands/project/project-doctor/doctor-1.7.0.js +3 -1
- package/dist/m365/spfx/commands/project/project-doctor/doctor-1.7.1.js +3 -1
- package/dist/m365/spfx/commands/project/project-doctor/doctor-1.8.0.js +3 -1
- package/dist/m365/spfx/commands/project/project-doctor/doctor-1.8.1.js +3 -1
- package/dist/m365/spfx/commands/project/project-doctor/doctor-1.8.2.js +3 -1
- package/dist/m365/spfx/commands/project/project-doctor/doctor-1.9.1.js +3 -1
- package/dist/m365/spfx/commands/project/project-doctor/generic-rules.js +0 -2
- package/dist/m365/spfx/commands/project/project-doctor/rules/FN021001_PKG_spfx_deps_versions_match_project_version.js +3 -2
- package/dist/m365/spfx/commands/project/project-doctor/rules/FN021013_PKG_spfx_devdeps_match_version.js +58 -0
- package/dist/m365/spfx/commands/project/project-doctor/spfx-deps.js +2 -0
- package/dist/m365/spfx/commands/project/project-doctor.js +2 -1
- package/dist/m365/spfx/commands/project/project-upgrade/upgrade-1.19.0-beta.0.js +53 -0
- package/dist/m365/spfx/commands/project/project-upgrade.js +16 -13
- package/dist/m365/spfx/commands/spfx-doctor.js +15 -0
- package/dist/m365/spo/commands/contenttype/contenttype-sync.js +139 -0
- package/dist/m365/spo/commands/page/page-set.js +3 -0
- package/dist/m365/spo/commands/site/site-hubsite-connect.js +3 -3
- package/dist/m365/spo/commands/site/site-hubsite-disconnect.js +2 -5
- package/dist/m365/spo/commands.js +1 -0
- package/dist/utils/validation.js +4 -0
- package/docs/docs/cmd/entra/app/app-add.mdx +9 -0
- package/docs/docs/cmd/entra/app/app-set.mdx +9 -0
- package/docs/docs/cmd/entra/pim/pim-role-assignment-add.mdx +230 -0
- package/docs/docs/cmd/entra/pim/pim-role-assignment-list.mdx +224 -0
- package/docs/docs/cmd/spfx/project/project-upgrade.mdx +1 -1
- package/docs/docs/cmd/spo/contenttype/contenttype-sync.mdx +144 -0
- package/docs/docs/cmd/spo/page/page-set.mdx +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { satisfies } from 'semver';
|
|
2
|
+
import { JsonRule } from '../../JsonRule.js';
|
|
3
|
+
import * as spfxDeps from '../spfx-deps.js';
|
|
4
|
+
export class FN021013_PKG_spfx_devdeps_match_version extends JsonRule {
|
|
5
|
+
constructor(version) {
|
|
6
|
+
super();
|
|
7
|
+
this.version = version;
|
|
8
|
+
}
|
|
9
|
+
get id() {
|
|
10
|
+
return 'FN021013';
|
|
11
|
+
}
|
|
12
|
+
get title() {
|
|
13
|
+
return '';
|
|
14
|
+
}
|
|
15
|
+
get description() {
|
|
16
|
+
return '';
|
|
17
|
+
}
|
|
18
|
+
get severity() {
|
|
19
|
+
return 'Required';
|
|
20
|
+
}
|
|
21
|
+
get file() {
|
|
22
|
+
return './package.json';
|
|
23
|
+
}
|
|
24
|
+
get resolutionType() {
|
|
25
|
+
return 'cmd';
|
|
26
|
+
}
|
|
27
|
+
visit(project, findings) {
|
|
28
|
+
if (!project.packageJson || !project.packageJson.devDependencies) {
|
|
29
|
+
return;
|
|
30
|
+
}
|
|
31
|
+
if (project.packageJson.devDependencies) {
|
|
32
|
+
const projectDevDeps = Object.keys(project.packageJson.devDependencies);
|
|
33
|
+
this.validateDependencies({
|
|
34
|
+
dependencies: projectDevDeps,
|
|
35
|
+
spfxDeps: spfxDeps.devDeps,
|
|
36
|
+
project,
|
|
37
|
+
version: this.version,
|
|
38
|
+
findings
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
validateDependencies({ dependencies, spfxDeps, project, version, findings }) {
|
|
43
|
+
dependencies.forEach(dep => {
|
|
44
|
+
const depVersion = project.packageJson.devDependencies[dep];
|
|
45
|
+
if (!spfxDeps.includes(dep) ||
|
|
46
|
+
satisfies(version, depVersion)) {
|
|
47
|
+
return;
|
|
48
|
+
}
|
|
49
|
+
const node = this.getAstNodeFromFile(project.packageJson, 'devDependencies');
|
|
50
|
+
this.addFindingWithCustomInfo(`${dep} doesn't match project version`, `${dep}@${depVersion} doesn't match the project version ${project.version}`, [{
|
|
51
|
+
file: this.file,
|
|
52
|
+
resolution: `installDev ${dep}@${project.version}`,
|
|
53
|
+
position: this.getPositionFromNode(node)
|
|
54
|
+
}], findings);
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
//# sourceMappingURL=FN021013_PKG_spfx_devdeps_match_version.js.map
|
|
@@ -69,7 +69,8 @@ class SpfxProjectDoctorCommand extends BaseProjectCommand {
|
|
|
69
69
|
'1.17.4',
|
|
70
70
|
'1.18.0',
|
|
71
71
|
'1.18.1',
|
|
72
|
-
'1.18.2'
|
|
72
|
+
'1.18.2',
|
|
73
|
+
'1.19.0-beta.0'
|
|
73
74
|
];
|
|
74
75
|
__classPrivateFieldGet(this, _SpfxProjectDoctorCommand_instances, "m", _SpfxProjectDoctorCommand_initTelemetry).call(this);
|
|
75
76
|
__classPrivateFieldGet(this, _SpfxProjectDoctorCommand_instances, "m", _SpfxProjectDoctorCommand_initOptions).call(this);
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { FN001001_DEP_microsoft_sp_core_library } from './rules/FN001001_DEP_microsoft_sp_core_library.js';
|
|
2
|
+
import { FN001002_DEP_microsoft_sp_lodash_subset } from './rules/FN001002_DEP_microsoft_sp_lodash_subset.js';
|
|
3
|
+
import { FN001003_DEP_microsoft_sp_office_ui_fabric_core } from './rules/FN001003_DEP_microsoft_sp_office_ui_fabric_core.js';
|
|
4
|
+
import { FN001004_DEP_microsoft_sp_webpart_base } from './rules/FN001004_DEP_microsoft_sp_webpart_base.js';
|
|
5
|
+
import { FN001011_DEP_microsoft_sp_dialog } from './rules/FN001011_DEP_microsoft_sp_dialog.js';
|
|
6
|
+
import { FN001012_DEP_microsoft_sp_application_base } from './rules/FN001012_DEP_microsoft_sp_application_base.js';
|
|
7
|
+
import { FN001013_DEP_microsoft_decorators } from './rules/FN001013_DEP_microsoft_decorators.js';
|
|
8
|
+
import { FN001014_DEP_microsoft_sp_listview_extensibility } from './rules/FN001014_DEP_microsoft_sp_listview_extensibility.js';
|
|
9
|
+
import { FN001021_DEP_microsoft_sp_property_pane } from './rules/FN001021_DEP_microsoft_sp_property_pane.js';
|
|
10
|
+
import { FN001023_DEP_microsoft_sp_component_base } from './rules/FN001023_DEP_microsoft_sp_component_base.js';
|
|
11
|
+
import { FN001024_DEP_microsoft_sp_diagnostics } from './rules/FN001024_DEP_microsoft_sp_diagnostics.js';
|
|
12
|
+
import { FN001025_DEP_microsoft_sp_dynamic_data } from './rules/FN001025_DEP_microsoft_sp_dynamic_data.js';
|
|
13
|
+
import { FN001026_DEP_microsoft_sp_extension_base } from './rules/FN001026_DEP_microsoft_sp_extension_base.js';
|
|
14
|
+
import { FN001027_DEP_microsoft_sp_http } from './rules/FN001027_DEP_microsoft_sp_http.js';
|
|
15
|
+
import { FN001028_DEP_microsoft_sp_list_subscription } from './rules/FN001028_DEP_microsoft_sp_list_subscription.js';
|
|
16
|
+
import { FN001029_DEP_microsoft_sp_loader } from './rules/FN001029_DEP_microsoft_sp_loader.js';
|
|
17
|
+
import { FN001030_DEP_microsoft_sp_module_interfaces } from './rules/FN001030_DEP_microsoft_sp_module_interfaces.js';
|
|
18
|
+
import { FN001031_DEP_microsoft_sp_odata_types } from './rules/FN001031_DEP_microsoft_sp_odata_types.js';
|
|
19
|
+
import { FN001032_DEP_microsoft_sp_page_context } from './rules/FN001032_DEP_microsoft_sp_page_context.js';
|
|
20
|
+
import { FN001034_DEP_microsoft_sp_adaptive_card_extension_base } from './rules/FN001034_DEP_microsoft_sp_adaptive_card_extension_base.js';
|
|
21
|
+
import { FN002001_DEVDEP_microsoft_sp_build_web } from './rules/FN002001_DEVDEP_microsoft_sp_build_web.js';
|
|
22
|
+
import { FN002002_DEVDEP_microsoft_sp_module_interfaces } from './rules/FN002002_DEVDEP_microsoft_sp_module_interfaces.js';
|
|
23
|
+
import { FN002022_DEVDEP_microsoft_eslint_plugin_spfx } from './rules/FN002022_DEVDEP_microsoft_eslint_plugin_spfx.js';
|
|
24
|
+
import { FN002023_DEVDEP_microsoft_eslint_config_spfx } from './rules/FN002023_DEVDEP_microsoft_eslint_config_spfx.js';
|
|
25
|
+
import { FN010001_YORC_version } from './rules/FN010001_YORC_version.js';
|
|
26
|
+
export default [
|
|
27
|
+
new FN001001_DEP_microsoft_sp_core_library('1.19.0-beta.0'),
|
|
28
|
+
new FN001002_DEP_microsoft_sp_lodash_subset('1.19.0-beta.0'),
|
|
29
|
+
new FN001003_DEP_microsoft_sp_office_ui_fabric_core('1.19.0-beta.0'),
|
|
30
|
+
new FN001004_DEP_microsoft_sp_webpart_base('1.19.0-beta.0'),
|
|
31
|
+
new FN001011_DEP_microsoft_sp_dialog('1.19.0-beta.0'),
|
|
32
|
+
new FN001012_DEP_microsoft_sp_application_base('1.19.0-beta.0'),
|
|
33
|
+
new FN001014_DEP_microsoft_sp_listview_extensibility('1.19.0-beta.0'),
|
|
34
|
+
new FN001021_DEP_microsoft_sp_property_pane('1.19.0-beta.0'),
|
|
35
|
+
new FN001023_DEP_microsoft_sp_component_base('1.19.0-beta.0'),
|
|
36
|
+
new FN001024_DEP_microsoft_sp_diagnostics('1.19.0-beta.0'),
|
|
37
|
+
new FN001025_DEP_microsoft_sp_dynamic_data('1.19.0-beta.0'),
|
|
38
|
+
new FN001026_DEP_microsoft_sp_extension_base('1.19.0-beta.0'),
|
|
39
|
+
new FN001027_DEP_microsoft_sp_http('1.19.0-beta.0'),
|
|
40
|
+
new FN001028_DEP_microsoft_sp_list_subscription('1.19.0-beta.0'),
|
|
41
|
+
new FN001029_DEP_microsoft_sp_loader('1.19.0-beta.0'),
|
|
42
|
+
new FN001030_DEP_microsoft_sp_module_interfaces('1.19.0-beta.0'),
|
|
43
|
+
new FN001031_DEP_microsoft_sp_odata_types('1.19.0-beta.0'),
|
|
44
|
+
new FN001032_DEP_microsoft_sp_page_context('1.19.0-beta.0'),
|
|
45
|
+
new FN001013_DEP_microsoft_decorators('1.19.0-beta.0'),
|
|
46
|
+
new FN001034_DEP_microsoft_sp_adaptive_card_extension_base('1.19.0-beta.0'),
|
|
47
|
+
new FN002001_DEVDEP_microsoft_sp_build_web('1.20.1'),
|
|
48
|
+
new FN002002_DEVDEP_microsoft_sp_module_interfaces('1.20.1'),
|
|
49
|
+
new FN002022_DEVDEP_microsoft_eslint_plugin_spfx('1.20.1'),
|
|
50
|
+
new FN002023_DEVDEP_microsoft_eslint_config_spfx('1.20.1'),
|
|
51
|
+
new FN010001_YORC_version('1.19.0-beta.0')
|
|
52
|
+
];
|
|
53
|
+
//# sourceMappingURL=upgrade-1.19.0-beta.0.js.map
|
|
@@ -7,6 +7,8 @@ var _SpfxProjectUpgradeCommand_instances, _a, _SpfxProjectUpgradeCommand_initTel
|
|
|
7
7
|
import fs from 'fs';
|
|
8
8
|
import os from 'os';
|
|
9
9
|
import path from 'path';
|
|
10
|
+
// uncomment to support upgrading to preview releases
|
|
11
|
+
import { prerelease } from 'semver';
|
|
10
12
|
import { CommandError } from '../../../../Command.js';
|
|
11
13
|
import { fsUtil } from '../../../../utils/fsUtil.js';
|
|
12
14
|
import { packageManager } from '../../../../utils/packageManager.js';
|
|
@@ -71,7 +73,8 @@ class SpfxProjectUpgradeCommand extends BaseProjectCommand {
|
|
|
71
73
|
'1.17.4',
|
|
72
74
|
'1.18.0',
|
|
73
75
|
'1.18.1',
|
|
74
|
-
'1.18.2'
|
|
76
|
+
'1.18.2',
|
|
77
|
+
'1.19.0-beta.0'
|
|
75
78
|
];
|
|
76
79
|
__classPrivateFieldGet(this, _SpfxProjectUpgradeCommand_instances, "m", _SpfxProjectUpgradeCommand_initTelemetry).call(this);
|
|
77
80
|
__classPrivateFieldGet(this, _SpfxProjectUpgradeCommand_instances, "m", _SpfxProjectUpgradeCommand_initOptions).call(this);
|
|
@@ -84,15 +87,15 @@ class SpfxProjectUpgradeCommand extends BaseProjectCommand {
|
|
|
84
87
|
}
|
|
85
88
|
this.toVersion = args.options.toVersion ? args.options.toVersion : this.supportedVersions[this.supportedVersions.length - 1];
|
|
86
89
|
// uncomment to support upgrading to preview releases
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
90
|
+
if (!args.options.toVersion &&
|
|
91
|
+
!args.options.preview &&
|
|
92
|
+
prerelease(this.toVersion)) {
|
|
93
|
+
// no version and no preview specified while the current version to
|
|
94
|
+
// upgrade to is a prerelease so let's grab the first non-preview version
|
|
95
|
+
// since we're supporting only one preview version, it's sufficient for
|
|
96
|
+
// us to take second to last version
|
|
97
|
+
this.toVersion = this.supportedVersions[this.supportedVersions.length - 2];
|
|
98
|
+
}
|
|
96
99
|
this.packageManager = args.options.packageManager || 'npm';
|
|
97
100
|
this.shell = args.options.shell || 'bash';
|
|
98
101
|
if (this.supportedVersions.indexOf(this.toVersion) < 0) {
|
|
@@ -481,9 +484,9 @@ _a = SpfxProjectUpgradeCommand, _SpfxProjectUpgradeCommand_instances = new WeakS
|
|
|
481
484
|
preview: args.options.preview
|
|
482
485
|
});
|
|
483
486
|
// uncomment to support upgrading to preview releases
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
+
if (prerelease(this.telemetryProperties.toVersion) && !args.options.preview) {
|
|
488
|
+
this.telemetryProperties.toVersion = this.supportedVersions[this.supportedVersions.length - 2];
|
|
489
|
+
}
|
|
487
490
|
});
|
|
488
491
|
}, _SpfxProjectUpgradeCommand_initOptions = function _SpfxProjectUpgradeCommand_initOptions() {
|
|
489
492
|
this.options.unshift({
|
|
@@ -568,6 +568,21 @@ class SpfxDoctorCommand extends BaseProjectCommand {
|
|
|
568
568
|
range: '^4 || ^5',
|
|
569
569
|
fix: 'npm i -g yo@5'
|
|
570
570
|
}
|
|
571
|
+
},
|
|
572
|
+
'1.19.0-beta.0': {
|
|
573
|
+
gulpCli: {
|
|
574
|
+
range: '^1 || ^2',
|
|
575
|
+
fix: 'npm i -g gulp-cli@2'
|
|
576
|
+
},
|
|
577
|
+
node: {
|
|
578
|
+
range: '>=18.17.1 <19.0.0',
|
|
579
|
+
fix: 'Install Node.js >=18.17.1 <19.0.0'
|
|
580
|
+
},
|
|
581
|
+
sp: SharePointVersion.SPO,
|
|
582
|
+
yo: {
|
|
583
|
+
range: '^4 || ^5',
|
|
584
|
+
fix: 'npm i -g yo@5'
|
|
585
|
+
}
|
|
571
586
|
}
|
|
572
587
|
};
|
|
573
588
|
__classPrivateFieldGet(this, _SpfxDoctorCommand_instances, "m", _SpfxDoctorCommand_initTelemetry).call(this);
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
2
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
3
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
4
|
+
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
5
|
+
};
|
|
6
|
+
var _SpoContentTypeSyncCommand_instances, _SpoContentTypeSyncCommand_initTelemetry, _SpoContentTypeSyncCommand_initOptions, _SpoContentTypeSyncCommand_initValidators, _SpoContentTypeSyncCommand_initTypes, _SpoContentTypeSyncCommand_initOptionSets;
|
|
7
|
+
import { formatting } from '../../../../utils/formatting.js';
|
|
8
|
+
import request from '../../../../request.js';
|
|
9
|
+
import { validation } from '../../../../utils/validation.js';
|
|
10
|
+
import SpoCommand from '../../../base/SpoCommand.js';
|
|
11
|
+
import commands from '../../commands.js';
|
|
12
|
+
import { urlUtil } from '../../../../utils/urlUtil.js';
|
|
13
|
+
import { odata } from '../../../../utils/odata.js';
|
|
14
|
+
import { spo } from '../../../../utils/spo.js';
|
|
15
|
+
class SpoContentTypeSyncCommand extends SpoCommand {
|
|
16
|
+
get name() {
|
|
17
|
+
return commands.CONTENTTYPE_SYNC;
|
|
18
|
+
}
|
|
19
|
+
get description() {
|
|
20
|
+
return 'Adds a published content type from the content type hub to a site or syncs its latest changes';
|
|
21
|
+
}
|
|
22
|
+
constructor() {
|
|
23
|
+
super();
|
|
24
|
+
_SpoContentTypeSyncCommand_instances.add(this);
|
|
25
|
+
__classPrivateFieldGet(this, _SpoContentTypeSyncCommand_instances, "m", _SpoContentTypeSyncCommand_initTelemetry).call(this);
|
|
26
|
+
__classPrivateFieldGet(this, _SpoContentTypeSyncCommand_instances, "m", _SpoContentTypeSyncCommand_initOptions).call(this);
|
|
27
|
+
__classPrivateFieldGet(this, _SpoContentTypeSyncCommand_instances, "m", _SpoContentTypeSyncCommand_initValidators).call(this);
|
|
28
|
+
__classPrivateFieldGet(this, _SpoContentTypeSyncCommand_instances, "m", _SpoContentTypeSyncCommand_initTypes).call(this);
|
|
29
|
+
__classPrivateFieldGet(this, _SpoContentTypeSyncCommand_instances, "m", _SpoContentTypeSyncCommand_initOptionSets).call(this);
|
|
30
|
+
}
|
|
31
|
+
async commandAction(logger, args) {
|
|
32
|
+
const { listId, listTitle, listUrl, webUrl } = args.options;
|
|
33
|
+
const url = new URL(webUrl);
|
|
34
|
+
const baseUrl = 'https://graph.microsoft.com/v1.0/sites/';
|
|
35
|
+
try {
|
|
36
|
+
const siteUrl = url.pathname === '/' ? url.host : await spo.getSiteId(webUrl, logger, this.verbose);
|
|
37
|
+
const listPath = listId || listTitle || listUrl ? `/lists/${listId || listTitle || await this.getListIdByUrl(webUrl, listUrl, logger)}` : '';
|
|
38
|
+
const contentTypeId = await this.getContentTypeId(baseUrl, url, args.options, logger);
|
|
39
|
+
if (this.verbose) {
|
|
40
|
+
await logger.logToStderr(`Adding or syncing the content type...`);
|
|
41
|
+
}
|
|
42
|
+
const requestOptions = {
|
|
43
|
+
url: `${baseUrl}${siteUrl}${listPath}/contenttypes/addCopyFromContentTypeHub`,
|
|
44
|
+
headers: {
|
|
45
|
+
'accept': 'application/json;odata.metadata=minimal;odata.streaming=true;IEEE754Compatible=false'
|
|
46
|
+
},
|
|
47
|
+
responseType: 'json',
|
|
48
|
+
data: {
|
|
49
|
+
contentTypeId: contentTypeId
|
|
50
|
+
}
|
|
51
|
+
};
|
|
52
|
+
const response = await request.post(requestOptions);
|
|
53
|
+
// The endpoint only returns a response if the content type has been added for the first time
|
|
54
|
+
// When syncing, the response will be an empty string, which should not be logged.
|
|
55
|
+
if (typeof response === 'object') {
|
|
56
|
+
await logger.log(response);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
catch (err) {
|
|
60
|
+
this.handleRejectedODataJsonPromise(err);
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
async getContentTypeId(baseUrl, url, options, logger) {
|
|
64
|
+
if (options.id) {
|
|
65
|
+
return options.id;
|
|
66
|
+
}
|
|
67
|
+
const siteId = await spo.getSiteId(`${url.origin}/sites/contenttypehub`, logger, this.verbose);
|
|
68
|
+
if (this.verbose) {
|
|
69
|
+
await logger.logToStderr(`Retrieving content type Id by name...`);
|
|
70
|
+
}
|
|
71
|
+
const contentTypes = await odata.getAllItems(`${baseUrl}${siteId}/contenttypes?$filter=name eq '${options.name}'&$select=id,name`);
|
|
72
|
+
if (contentTypes.length === 0) {
|
|
73
|
+
throw `Content type with name ${options.name} not found.`;
|
|
74
|
+
}
|
|
75
|
+
return contentTypes[0].id;
|
|
76
|
+
}
|
|
77
|
+
async getListIdByUrl(webUrl, listUrl, logger) {
|
|
78
|
+
if (this.verbose) {
|
|
79
|
+
await logger.logToStderr(`Retrieving list id to sync the content type to...`);
|
|
80
|
+
}
|
|
81
|
+
const listServerRelativeUrl = urlUtil.getServerRelativePath(webUrl, listUrl);
|
|
82
|
+
const requestOptions = {
|
|
83
|
+
url: `${webUrl}/_api/web/GetList('${formatting.encodeQueryParameter(listServerRelativeUrl)}')?$select=id`,
|
|
84
|
+
headers: {
|
|
85
|
+
'accept': 'application/json;odata=nometadata'
|
|
86
|
+
},
|
|
87
|
+
responseType: 'json'
|
|
88
|
+
};
|
|
89
|
+
const response = await request.get(requestOptions);
|
|
90
|
+
return response.Id;
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
_SpoContentTypeSyncCommand_instances = new WeakSet(), _SpoContentTypeSyncCommand_initTelemetry = function _SpoContentTypeSyncCommand_initTelemetry() {
|
|
94
|
+
this.telemetry.push((args) => {
|
|
95
|
+
Object.assign(this.telemetryProperties, {
|
|
96
|
+
id: typeof args.options.id !== 'undefined',
|
|
97
|
+
name: typeof args.options.name !== 'undefined',
|
|
98
|
+
listId: typeof args.options.listId !== 'undefined',
|
|
99
|
+
listTitle: typeof args.options.listTitle !== 'undefined',
|
|
100
|
+
listUrl: typeof args.options.listUrl !== 'undefined'
|
|
101
|
+
});
|
|
102
|
+
});
|
|
103
|
+
}, _SpoContentTypeSyncCommand_initOptions = function _SpoContentTypeSyncCommand_initOptions() {
|
|
104
|
+
this.options.unshift({
|
|
105
|
+
option: '-u, --webUrl <webUrl>'
|
|
106
|
+
}, {
|
|
107
|
+
option: '-i, --id [id]'
|
|
108
|
+
}, {
|
|
109
|
+
option: '-n, --name [name]'
|
|
110
|
+
}, {
|
|
111
|
+
option: '--listTitle [listTitle]'
|
|
112
|
+
}, {
|
|
113
|
+
option: '--listId [listId]'
|
|
114
|
+
}, {
|
|
115
|
+
option: '--listUrl [listUrl]'
|
|
116
|
+
});
|
|
117
|
+
}, _SpoContentTypeSyncCommand_initValidators = function _SpoContentTypeSyncCommand_initValidators() {
|
|
118
|
+
this.validators.push(async (args) => {
|
|
119
|
+
const isValidSharePointUrl = validation.isValidSharePointUrl(args.options.webUrl);
|
|
120
|
+
if (isValidSharePointUrl !== true) {
|
|
121
|
+
return isValidSharePointUrl;
|
|
122
|
+
}
|
|
123
|
+
if (args.options.listId && !validation.isValidGuid(args.options.listId)) {
|
|
124
|
+
return `${args.options.listId} is not a valid GUID`;
|
|
125
|
+
}
|
|
126
|
+
return true;
|
|
127
|
+
});
|
|
128
|
+
}, _SpoContentTypeSyncCommand_initTypes = function _SpoContentTypeSyncCommand_initTypes() {
|
|
129
|
+
this.types.string.push('webUrl', 'id', 'name', 'listTitle', 'listId', 'listUrl');
|
|
130
|
+
}, _SpoContentTypeSyncCommand_initOptionSets = function _SpoContentTypeSyncCommand_initOptionSets() {
|
|
131
|
+
this.optionSets.push({
|
|
132
|
+
options: ['id', 'name']
|
|
133
|
+
}, {
|
|
134
|
+
options: ['listId', 'listTitle', 'listUrl'],
|
|
135
|
+
runsWhen: (args) => args.options.listId || args.options.listTitle || args.options.listUrl
|
|
136
|
+
});
|
|
137
|
+
};
|
|
138
|
+
export default new SpoContentTypeSyncCommand();
|
|
139
|
+
//# sourceMappingURL=contenttype-sync.js.map
|
|
@@ -317,6 +317,9 @@ _SpoPageSetCommand_instances = new WeakSet(), _SpoPageSetCommand_initTelemetry =
|
|
|
317
317
|
if (isValidSharePointUrl !== true) {
|
|
318
318
|
return isValidSharePointUrl;
|
|
319
319
|
}
|
|
320
|
+
if (!args.options.layoutType && !args.options.promoteAs && !args.options.demoteFrom && args.options.commentsEnabled === undefined && !args.options.publish && !args.options.description && !args.options.title && !args.options.content) {
|
|
321
|
+
return 'Specify at least one option to update.';
|
|
322
|
+
}
|
|
320
323
|
if (args.options.layoutType &&
|
|
321
324
|
supportedPageLayouts.indexOf(args.options.layoutType) < 0) {
|
|
322
325
|
return `${args.options.layoutType} is not a valid option for layoutType. Allowed values ${supportedPageLayouts.join(', ')}`;
|
|
@@ -6,7 +6,6 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
|
|
|
6
6
|
var _SpoSiteHubSiteConnectCommand_instances, _SpoSiteHubSiteConnectCommand_initOptions, _SpoSiteHubSiteConnectCommand_initValidators;
|
|
7
7
|
import request from '../../../../request.js';
|
|
8
8
|
import { formatting } from '../../../../utils/formatting.js';
|
|
9
|
-
import { spo } from '../../../../utils/spo.js';
|
|
10
9
|
import { validation } from '../../../../utils/validation.js';
|
|
11
10
|
import SpoCommand from '../../../base/SpoCommand.js';
|
|
12
11
|
import commands from '../../commands.js';
|
|
@@ -25,11 +24,12 @@ class SpoSiteHubSiteConnectCommand extends SpoCommand {
|
|
|
25
24
|
}
|
|
26
25
|
async commandAction(logger, args) {
|
|
27
26
|
try {
|
|
28
|
-
|
|
27
|
+
if (this.verbose) {
|
|
28
|
+
await logger.logToStderr(`Connecting site collection ${args.options.siteUrl} to hub site ${args.options.id}...`);
|
|
29
|
+
}
|
|
29
30
|
const requestOptions = {
|
|
30
31
|
url: `${args.options.siteUrl}/_api/site/JoinHubSite('${formatting.encodeQueryParameter(args.options.id)}')`,
|
|
31
32
|
headers: {
|
|
32
|
-
'X-RequestDigest': res.FormDigestValue,
|
|
33
33
|
accept: 'application/json;odata=nometadata'
|
|
34
34
|
},
|
|
35
35
|
responseType: 'json'
|
|
@@ -6,7 +6,6 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
|
|
|
6
6
|
var _SpoSiteHubSiteDisconnectCommand_instances, _SpoSiteHubSiteDisconnectCommand_initTelemetry, _SpoSiteHubSiteDisconnectCommand_initOptions, _SpoSiteHubSiteDisconnectCommand_initValidators;
|
|
7
7
|
import { cli } from '../../../../cli/cli.js';
|
|
8
8
|
import request from '../../../../request.js';
|
|
9
|
-
import { spo } from '../../../../utils/spo.js';
|
|
10
9
|
import { validation } from '../../../../utils/validation.js';
|
|
11
10
|
import SpoCommand from '../../../base/SpoCommand.js';
|
|
12
11
|
import commands from '../../commands.js';
|
|
@@ -15,7 +14,7 @@ class SpoSiteHubSiteDisconnectCommand extends SpoCommand {
|
|
|
15
14
|
return commands.SITE_HUBSITE_DISCONNECT;
|
|
16
15
|
}
|
|
17
16
|
get description() {
|
|
18
|
-
return 'Disconnects the
|
|
17
|
+
return 'Disconnects the specified site collection from its hub site';
|
|
19
18
|
}
|
|
20
19
|
constructor() {
|
|
21
20
|
super();
|
|
@@ -37,14 +36,12 @@ class SpoSiteHubSiteDisconnectCommand extends SpoCommand {
|
|
|
37
36
|
}
|
|
38
37
|
async disconnectHubSite(logger, args) {
|
|
39
38
|
try {
|
|
40
|
-
const res = await spo.getRequestDigest(args.options.siteUrl);
|
|
41
39
|
if (this.verbose) {
|
|
42
|
-
await logger.logToStderr(`Disconnecting site collection ${args.options.siteUrl} from its
|
|
40
|
+
await logger.logToStderr(`Disconnecting site collection ${args.options.siteUrl} from its hub site...`);
|
|
43
41
|
}
|
|
44
42
|
const requestOptions = {
|
|
45
43
|
url: `${args.options.siteUrl}/_api/site/JoinHubSite('00000000-0000-0000-0000-000000000000')`,
|
|
46
44
|
headers: {
|
|
47
|
-
'X-RequestDigest': res.FormDigestValue,
|
|
48
45
|
accept: 'application/json;odata=nometadata'
|
|
49
46
|
},
|
|
50
47
|
responseType: 'json'
|
|
@@ -37,6 +37,7 @@ export default {
|
|
|
37
37
|
CONTENTTYPE_LIST: `${prefix} contenttype list`,
|
|
38
38
|
CONTENTTYPE_REMOVE: `${prefix} contenttype remove`,
|
|
39
39
|
CONTENTTYPE_SET: `${prefix} contenttype set`,
|
|
40
|
+
CONTENTTYPE_SYNC: `${prefix} contenttype sync`,
|
|
40
41
|
CONTENTTYPEHUB_GET: `${prefix} contenttypehub get`,
|
|
41
42
|
CUSTOMACTION_ADD: `${prefix} customaction add`,
|
|
42
43
|
CUSTOMACTION_CLEAR: `${prefix} customaction clear`,
|
package/dist/utils/validation.js
CHANGED
|
@@ -325,6 +325,10 @@ export const validation = {
|
|
|
325
325
|
isValidMailNickname(mailNickname) {
|
|
326
326
|
const mailNicknameRegEx = new RegExp(/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]*$/i);
|
|
327
327
|
return mailNicknameRegEx.test(mailNickname);
|
|
328
|
+
},
|
|
329
|
+
isValidISODuration(duration) {
|
|
330
|
+
const durationRegEx = new RegExp(/^P(?!$)((\d+Y)|(\d+\.\d+Y$))?((\d+M)|(\d+\.\d+M$))?((\d+W)|(\d+\.\d+W$))?((\d+D)|(\d+\.\d+D$))?(T(?=\d)((\d+H)|(\d+\.\d+H$))?((\d+M)|(\d+\.\d+M$))?(\d+(\.\d+)?S)?)??$/);
|
|
331
|
+
return durationRegEx.test(duration);
|
|
328
332
|
}
|
|
329
333
|
};
|
|
330
334
|
//# sourceMappingURL=validation.js.map
|
|
@@ -78,6 +78,9 @@ m365 entra appregistration add [options]
|
|
|
78
78
|
|
|
79
79
|
`--save`
|
|
80
80
|
: Use to store the information about the created app in a local file.
|
|
81
|
+
|
|
82
|
+
`--allowPublicClientFlows`
|
|
83
|
+
: Enable the allow public client flows feature on the app registration.
|
|
81
84
|
```
|
|
82
85
|
|
|
83
86
|
<Global />
|
|
@@ -192,6 +195,12 @@ Create new Entra app registration with a certificate
|
|
|
192
195
|
m365 entra app add --name 'My Entra app' --certificateDisplayName "Some certificate name" --certificateFile "c:\temp\some-certificate.cer"
|
|
193
196
|
```
|
|
194
197
|
|
|
198
|
+
Create a new Entra app registration with the allow public client flows feature enabled.
|
|
199
|
+
|
|
200
|
+
```sh
|
|
201
|
+
m365 entra app add --name 'My Entra app' --allowPublicClientFlows
|
|
202
|
+
```
|
|
203
|
+
|
|
195
204
|
## Response
|
|
196
205
|
|
|
197
206
|
### Standard response
|
|
@@ -49,6 +49,9 @@ m365 entra appregistration set [options]
|
|
|
49
49
|
|
|
50
50
|
`--certificateDisplayName [certificateDisplayName]`
|
|
51
51
|
: Display name for the certificate. If not given, the displayName will be set to the certificate subject. When specified, also specify either `certificateFile` or `certificateBase64Encoded`.
|
|
52
|
+
|
|
53
|
+
`--allowPublicClientFlows [allowPublicClientFlows]`
|
|
54
|
+
: Set to `true` or `false` to toggle the allow public client flows feature on the app registration.
|
|
52
55
|
```
|
|
53
56
|
|
|
54
57
|
<Global />
|
|
@@ -99,6 +102,12 @@ Add a certificate to the app
|
|
|
99
102
|
m365 entra app set --appId e75be2e1-0204-4f95-857d-51a37cf40be8 --certificateDisplayName "Some certificate name" --certificateFile "c:\temp\some-certificate.cer"
|
|
100
103
|
```
|
|
101
104
|
|
|
105
|
+
Enable the allow public client flows feature on the app registration
|
|
106
|
+
|
|
107
|
+
```sh
|
|
108
|
+
m365 entra app set --appId e75be2e1-0204-4f95-857d-51a37cf40be8 --allowPublicClientFlows true
|
|
109
|
+
```
|
|
110
|
+
|
|
102
111
|
## Response
|
|
103
112
|
|
|
104
113
|
The command won't return a response on success.
|