@pnp/cli-microsoft365 7.7.0-beta.72886a7 → 7.7.0-beta.7d3ef49
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/cli/cli.js +9 -4
- package/dist/m365/commands/setup.js +1 -7
- 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/user/user-list.js +20 -7
- 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/listitem/listitem-set.js +9 -156
- package/dist/m365/spo/commands/page/page-add.js +6 -24
- package/dist/m365/spo/commands/page/page-set.js +19 -43
- package/dist/m365/spo/commands/site/site-apppermission-remove.js +8 -9
- 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/prompt.js +2 -0
- package/dist/utils/spo.js +188 -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/entra/user/user-list.mdx +36 -15
- 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/docs/docs/cmd/spo/site/site-apppermission-add.mdx +1 -1
- package/npm-shrinkwrap.json +138 -214
- package/package.json +14 -14
|
@@ -5,6 +5,7 @@ import { FN002007_DEVDEP_ajv } from './rules/FN002007_DEVDEP_ajv.js';
|
|
|
5
5
|
import { FN002013_DEVDEP_types_webpack_env } from './rules/FN002013_DEVDEP_types_webpack_env.js';
|
|
6
6
|
import { FN002015_DEVDEP_types_react } from './rules/FN002015_DEVDEP_types_react.js';
|
|
7
7
|
import { FN002016_DEVDEP_types_react_dom } from './rules/FN002016_DEVDEP_types_react_dom.js';
|
|
8
|
+
import { FN021001_PKG_spfx_deps_versions_match_project_version } from './rules/FN021001_PKG_spfx_deps_versions_match_project_version.js';
|
|
8
9
|
export default [
|
|
9
10
|
new FN001008_DEP_react('16'),
|
|
10
11
|
new FN001009_DEP_react_dom('16'),
|
|
@@ -12,6 +13,7 @@ export default [
|
|
|
12
13
|
new FN002007_DEVDEP_ajv('~5.2.2'),
|
|
13
14
|
new FN002013_DEVDEP_types_webpack_env('1.13.1'),
|
|
14
15
|
new FN002015_DEVDEP_types_react('16'),
|
|
15
|
-
new FN002016_DEVDEP_types_react_dom('16')
|
|
16
|
+
new FN002016_DEVDEP_types_react_dom('16'),
|
|
17
|
+
new FN021001_PKG_spfx_deps_versions_match_project_version()
|
|
16
18
|
];
|
|
17
19
|
//# sourceMappingURL=doctor-1.7.1.js.map
|
|
@@ -6,6 +6,7 @@ import { FN002013_DEVDEP_types_webpack_env } from './rules/FN002013_DEVDEP_types
|
|
|
6
6
|
import { FN002015_DEVDEP_types_react } from './rules/FN002015_DEVDEP_types_react.js';
|
|
7
7
|
import { FN002016_DEVDEP_types_react_dom } from './rules/FN002016_DEVDEP_types_react_dom.js';
|
|
8
8
|
import { FN002019_DEVDEP_microsoft_rush_stack_compiler } from './rules/FN002019_DEVDEP_microsoft_rush_stack_compiler.js';
|
|
9
|
+
import { FN021001_PKG_spfx_deps_versions_match_project_version } from './rules/FN021001_PKG_spfx_deps_versions_match_project_version.js';
|
|
9
10
|
export default [
|
|
10
11
|
new FN001008_DEP_react('16'),
|
|
11
12
|
new FN001009_DEP_react_dom('16'),
|
|
@@ -14,6 +15,7 @@ export default [
|
|
|
14
15
|
new FN002013_DEVDEP_types_webpack_env('1.13.1'),
|
|
15
16
|
new FN002015_DEVDEP_types_react('16'),
|
|
16
17
|
new FN002016_DEVDEP_types_react_dom('16'),
|
|
17
|
-
new FN002019_DEVDEP_microsoft_rush_stack_compiler(['2.7', '2.9', '3.0'])
|
|
18
|
+
new FN002019_DEVDEP_microsoft_rush_stack_compiler(['2.7', '2.9', '3.0']),
|
|
19
|
+
new FN021001_PKG_spfx_deps_versions_match_project_version()
|
|
18
20
|
];
|
|
19
21
|
//# sourceMappingURL=doctor-1.8.0.js.map
|
|
@@ -6,6 +6,7 @@ import { FN002013_DEVDEP_types_webpack_env } from './rules/FN002013_DEVDEP_types
|
|
|
6
6
|
import { FN002015_DEVDEP_types_react } from './rules/FN002015_DEVDEP_types_react.js';
|
|
7
7
|
import { FN002016_DEVDEP_types_react_dom } from './rules/FN002016_DEVDEP_types_react_dom.js';
|
|
8
8
|
import { FN002019_DEVDEP_microsoft_rush_stack_compiler } from './rules/FN002019_DEVDEP_microsoft_rush_stack_compiler.js';
|
|
9
|
+
import { FN021001_PKG_spfx_deps_versions_match_project_version } from './rules/FN021001_PKG_spfx_deps_versions_match_project_version.js';
|
|
9
10
|
export default [
|
|
10
11
|
new FN001008_DEP_react('16'),
|
|
11
12
|
new FN001009_DEP_react_dom('16'),
|
|
@@ -14,6 +15,7 @@ export default [
|
|
|
14
15
|
new FN002013_DEVDEP_types_webpack_env('1.13.1'),
|
|
15
16
|
new FN002015_DEVDEP_types_react('16'),
|
|
16
17
|
new FN002016_DEVDEP_types_react_dom('16'),
|
|
17
|
-
new FN002019_DEVDEP_microsoft_rush_stack_compiler(['2.7', '2.9', '3.0'])
|
|
18
|
+
new FN002019_DEVDEP_microsoft_rush_stack_compiler(['2.7', '2.9', '3.0']),
|
|
19
|
+
new FN021001_PKG_spfx_deps_versions_match_project_version()
|
|
18
20
|
];
|
|
19
21
|
//# sourceMappingURL=doctor-1.8.1.js.map
|
|
@@ -7,6 +7,7 @@ import { FN002013_DEVDEP_types_webpack_env } from './rules/FN002013_DEVDEP_types
|
|
|
7
7
|
import { FN002015_DEVDEP_types_react } from './rules/FN002015_DEVDEP_types_react.js';
|
|
8
8
|
import { FN002016_DEVDEP_types_react_dom } from './rules/FN002016_DEVDEP_types_react_dom.js';
|
|
9
9
|
import { FN002019_DEVDEP_microsoft_rush_stack_compiler } from './rules/FN002019_DEVDEP_microsoft_rush_stack_compiler.js';
|
|
10
|
+
import { FN021001_PKG_spfx_deps_versions_match_project_version } from './rules/FN021001_PKG_spfx_deps_versions_match_project_version.js';
|
|
10
11
|
export default [
|
|
11
12
|
new FN001008_DEP_react('16'),
|
|
12
13
|
new FN001009_DEP_react_dom('16'),
|
|
@@ -16,6 +17,7 @@ export default [
|
|
|
16
17
|
new FN002013_DEVDEP_types_webpack_env('1.13.1'),
|
|
17
18
|
new FN002015_DEVDEP_types_react('16'),
|
|
18
19
|
new FN002016_DEVDEP_types_react_dom('16'),
|
|
19
|
-
new FN002019_DEVDEP_microsoft_rush_stack_compiler(['2.9'])
|
|
20
|
+
new FN002019_DEVDEP_microsoft_rush_stack_compiler(['2.9']),
|
|
21
|
+
new FN021001_PKG_spfx_deps_versions_match_project_version()
|
|
20
22
|
];
|
|
21
23
|
//# sourceMappingURL=doctor-1.8.2.js.map
|
|
@@ -7,6 +7,7 @@ import { FN002013_DEVDEP_types_webpack_env } from './rules/FN002013_DEVDEP_types
|
|
|
7
7
|
import { FN002015_DEVDEP_types_react } from './rules/FN002015_DEVDEP_types_react.js';
|
|
8
8
|
import { FN002016_DEVDEP_types_react_dom } from './rules/FN002016_DEVDEP_types_react_dom.js';
|
|
9
9
|
import { FN002019_DEVDEP_microsoft_rush_stack_compiler } from './rules/FN002019_DEVDEP_microsoft_rush_stack_compiler.js';
|
|
10
|
+
import { FN021001_PKG_spfx_deps_versions_match_project_version } from './rules/FN021001_PKG_spfx_deps_versions_match_project_version.js';
|
|
10
11
|
export default [
|
|
11
12
|
new FN001008_DEP_react('16'),
|
|
12
13
|
new FN001009_DEP_react_dom('16'),
|
|
@@ -16,6 +17,7 @@ export default [
|
|
|
16
17
|
new FN002013_DEVDEP_types_webpack_env('1.13.1'),
|
|
17
18
|
new FN002015_DEVDEP_types_react('16'),
|
|
18
19
|
new FN002016_DEVDEP_types_react_dom('16'),
|
|
19
|
-
new FN002019_DEVDEP_microsoft_rush_stack_compiler(['2.9'])
|
|
20
|
+
new FN002019_DEVDEP_microsoft_rush_stack_compiler(['2.9']),
|
|
21
|
+
new FN021001_PKG_spfx_deps_versions_match_project_version()
|
|
20
22
|
];
|
|
21
23
|
//# sourceMappingURL=doctor-1.9.1.js.map
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { FN021001_PKG_spfx_deps_versions_match_project_version } from "./rules/FN021001_PKG_spfx_deps_versions_match_project_version.js";
|
|
2
1
|
import { FN021002_PKG_spfx_deps_use_exact_version } from "./rules/FN021002_PKG_spfx_deps_use_exact_version.js";
|
|
3
2
|
import { FN021003_PKG_spfx_deps_installed_as_deps } from "./rules/FN021003_PKG_spfx_deps_installed_as_deps.js";
|
|
4
3
|
import { FN021004_PKG_spfx_devdeps_installed_as_devdeps } from "./rules/FN021004_PKG_spfx_devdeps_installed_as_devdeps.js";
|
|
@@ -11,7 +10,6 @@ import { FN021010_PKG_gulp_installed_as_devdep } from "./rules/FN021010_PKG_gulp
|
|
|
11
10
|
import { FN021011_PKG_ajv_installed_as_devdep } from "./rules/FN021011_PKG_ajv_installed_as_devdep.js";
|
|
12
11
|
import { FN021012_PKG_no_duplicate_pnpjs_deps } from "./rules/FN021012_PKG_no_duplicate_pnpjs_deps.js";
|
|
13
12
|
export const rules = [
|
|
14
|
-
new FN021001_PKG_spfx_deps_versions_match_project_version(),
|
|
15
13
|
new FN021002_PKG_spfx_deps_use_exact_version(),
|
|
16
14
|
new FN021003_PKG_spfx_deps_installed_as_deps(),
|
|
17
15
|
new FN021004_PKG_spfx_devdeps_installed_as_devdeps(),
|
|
@@ -2,8 +2,9 @@ import { satisfies } from 'semver';
|
|
|
2
2
|
import { JsonRule } from '../../JsonRule.js';
|
|
3
3
|
import * as spfxDeps from '../spfx-deps.js';
|
|
4
4
|
export class FN021001_PKG_spfx_deps_versions_match_project_version extends JsonRule {
|
|
5
|
-
constructor() {
|
|
5
|
+
constructor(includeDevDeps = true) {
|
|
6
6
|
super();
|
|
7
|
+
this.includeDevDeps = includeDevDeps;
|
|
7
8
|
}
|
|
8
9
|
get id() {
|
|
9
10
|
return 'FN021001';
|
|
@@ -38,7 +39,7 @@ export class FN021001_PKG_spfx_deps_versions_match_project_version extends JsonR
|
|
|
38
39
|
findings
|
|
39
40
|
});
|
|
40
41
|
}
|
|
41
|
-
if (project.packageJson.devDependencies) {
|
|
42
|
+
if (this.includeDevDeps && project.packageJson.devDependencies) {
|
|
42
43
|
const projectDevDeps = Object.keys(project.packageJson.devDependencies);
|
|
43
44
|
this.validateDependencies({
|
|
44
45
|
dependencies: projectDevDeps,
|
|
@@ -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
|