@pnp/cli-microsoft365 12.0.0-beta.1752794 → 12.0.0-beta.4ac11a7
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/allCommands.json +1 -1
- package/allCommandsFull.json +1 -1
- package/dist/Auth.js +15 -1
- package/dist/m365/spfx/commands/SpfxCompatibilityMatrix.js +15 -0
- package/dist/m365/spfx/commands/project/project-doctor/doctor-1.24.0-rc.0.js +19 -0
- package/dist/m365/spfx/commands/project/project-doctor.js +2 -1
- package/dist/m365/spfx/commands/project/project-upgrade/rules/FN012021_TSC_excludeDirectories.js +43 -0
- package/dist/m365/spfx/commands/project/project-upgrade/rules/FN027002_OVERRIDES_qs.js +33 -0
- package/dist/m365/spfx/commands/project/project-upgrade/rules/FN027003_OVERRIDES_uuid.js +33 -0
- package/dist/m365/spfx/commands/project/project-upgrade/upgrade-1.24.0-rc.0.js +77 -0
- package/dist/m365/spfx/commands/project/project-upgrade.js +12 -11
- package/dist/m365/spo/commands/navigation/navigation-node-add.js +74 -120
- package/dist/m365/spo/commands/navigation/navigation-node-get.js +4 -13
- package/dist/m365/spo/commands/navigation/navigation-node-set.js +53 -114
- package/dist/m365/spo/commands/page/page-unpublish.js +53 -0
- package/dist/m365/spo/commands/sitescript/sitescript-add.js +22 -37
- package/dist/m365/spo/commands/sitescript/sitescript-get.js +9 -26
- package/dist/m365/spo/commands/sitescript/sitescript-list.js +5 -0
- package/dist/m365/spo/commands/sitescript/sitescript-remove.js +9 -33
- package/dist/m365/spo/commands/sitescript/sitescript-set.js +29 -56
- package/dist/m365/spo/commands.js +1 -0
- package/dist/m365/spp/commands/contentcenter/contentcenter-list.js +5 -0
- package/dist/m365/spp/commands/model/model-get.js +25 -45
- package/dist/m365/spp/commands/model/model-list.js +12 -23
- package/dist/m365/spp/commands/model/model-remove.js +25 -45
- package/dist/utils/spo.js +39 -0
- package/docs/docs/cmd/login.mdx +15 -2
- package/docs/docs/cmd/spo/navigation/navigation-node-add.mdx +45 -30
- package/docs/docs/cmd/spo/navigation/navigation-node-get.mdx +64 -42
- package/docs/docs/cmd/spo/navigation/navigation-node-set.mdx +10 -8
- package/docs/docs/cmd/spo/page/page-unpublish.mdx +63 -0
- package/docs/docs/cmd/teams/tab/tab-add.mdx +19 -0
- package/docs/docs/cmd/teams/tab/tab-get.mdx +19 -0
- package/docs/docs/cmd/teams/tab/tab-list.mdx +19 -0
- package/docs/docs/cmd/teams/tab/tab-remove.mdx +21 -0
- package/docs/docs/cmd/viva/engage/engage-message-add.mdx +17 -0
- package/docs/docs/cmd/viva/engage/engage-message-get.mdx +17 -0
- package/docs/docs/cmd/viva/engage/engage-message-list.mdx +17 -0
- package/docs/docs/cmd/viva/engage/engage-message-remove.mdx +19 -0
- package/package.json +4 -6
package/dist/Auth.js
CHANGED
|
@@ -606,8 +606,22 @@ export class Auth {
|
|
|
606
606
|
const federationToken = await this.getFederationTokenFromAzureDevOps(logger, debug, serviceConnectionId);
|
|
607
607
|
return this.getAccessTokenWithFederatedToken(resource, federationToken, logger, debug);
|
|
608
608
|
}
|
|
609
|
+
else if (process.env.GITLAB_CI) {
|
|
610
|
+
if (debug) {
|
|
611
|
+
await logger.logToStderr('GITLAB_CI env variable found. The context is GitLab CI/CD...');
|
|
612
|
+
}
|
|
613
|
+
if (!process.env.GITLAB_OIDC_TOKEN) {
|
|
614
|
+
throw new CommandError('The `GITLAB_OIDC_TOKEN` environment variable is not available. Please add an id_tokens entry named GITLAB_OIDC_TOKEN with audience `api://AzureADTokenExchange` to the job.');
|
|
615
|
+
}
|
|
616
|
+
if (!this.connection.appId || this.connection.tenant === 'common') {
|
|
617
|
+
throw new CommandError('The appId and tenant parameters are required when using federated identity in GitLab CI/CD.');
|
|
618
|
+
}
|
|
619
|
+
// GitLab's id_tokens feature mints the OIDC JWT directly into the configured job variable, so no
|
|
620
|
+
// separate request to GitLab is needed to obtain the federation token before exchanging it with Entra ID.
|
|
621
|
+
return this.getAccessTokenWithFederatedToken(resource, process.env.GITLAB_OIDC_TOKEN, logger, debug);
|
|
622
|
+
}
|
|
609
623
|
else {
|
|
610
|
-
throw new CommandError('Federated identity is currently only supported in GitHub Actions
|
|
624
|
+
throw new CommandError('Federated identity is currently only supported in GitHub Actions, Azure DevOps and GitLab.');
|
|
611
625
|
}
|
|
612
626
|
}
|
|
613
627
|
async getFederationTokenFromGithub(logger, debug) {
|
|
@@ -653,6 +653,21 @@ export const versions = {
|
|
|
653
653
|
range: '^4 || ^5 || ^6 || ^7',
|
|
654
654
|
fix: 'npm i -g yo@7'
|
|
655
655
|
}
|
|
656
|
+
},
|
|
657
|
+
'1.24.0-rc.0': {
|
|
658
|
+
heft: {
|
|
659
|
+
range: '^1',
|
|
660
|
+
fix: 'npm i -g @rushstack/heft@1'
|
|
661
|
+
},
|
|
662
|
+
node: {
|
|
663
|
+
range: '>=22.14.0 <23.0.0 || >=24.0.0 <25.0.0 || >=26.0.0 <27.0.0',
|
|
664
|
+
fix: 'Install Node.js >=22.14.0 <23.0.0 || >=24.0.0 <25.0.0 || >=26.0.0 <27.0.0'
|
|
665
|
+
},
|
|
666
|
+
sp: SharePointVersion.SPO,
|
|
667
|
+
yo: {
|
|
668
|
+
range: '^4 || ^5 || ^6 || ^7',
|
|
669
|
+
fix: 'npm i -g yo@7'
|
|
670
|
+
}
|
|
656
671
|
}
|
|
657
672
|
};
|
|
658
673
|
//# sourceMappingURL=SpfxCompatibilityMatrix.js.map
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { FN001008_DEP_react } from './rules/FN001008_DEP_react.js';
|
|
2
|
+
import { FN001009_DEP_react_dom } from './rules/FN001009_DEP_react_dom.js';
|
|
3
|
+
import { FN001035_DEP_fluentui_react } from './rules/FN001035_DEP_fluentui_react.js';
|
|
4
|
+
import { FN002013_DEVDEP_types_webpack_env } from './rules/FN002013_DEVDEP_types_webpack_env.js';
|
|
5
|
+
import { FN002015_DEVDEP_types_react } from './rules/FN002015_DEVDEP_types_react.js';
|
|
6
|
+
import { FN002016_DEVDEP_types_react_dom } from './rules/FN002016_DEVDEP_types_react_dom.js';
|
|
7
|
+
import { FN002022_DEVDEP_typescript } from './rules/FN002022_DEVDEP_typescript.js';
|
|
8
|
+
import { FN021001_PKG_spfx_deps_versions_match_project_version } from './rules/FN021001_PKG_spfx_deps_versions_match_project_version.js';
|
|
9
|
+
export default [
|
|
10
|
+
new FN001008_DEP_react({ supportedRange: '18' }),
|
|
11
|
+
new FN001009_DEP_react_dom({ supportedRange: '18' }),
|
|
12
|
+
new FN001035_DEP_fluentui_react({ supportedRange: '^8.106.4' }),
|
|
13
|
+
new FN002013_DEVDEP_types_webpack_env({ supportedRange: '~1.15.2' }),
|
|
14
|
+
new FN002015_DEVDEP_types_react({ supportedRange: '18' }),
|
|
15
|
+
new FN002016_DEVDEP_types_react_dom({ supportedRange: '18' }),
|
|
16
|
+
new FN002022_DEVDEP_typescript({ supportedRange: '~5.8.0' }),
|
|
17
|
+
new FN021001_PKG_spfx_deps_versions_match_project_version({ includeDevDeps: true })
|
|
18
|
+
];
|
|
19
|
+
//# sourceMappingURL=doctor-1.24.0-rc.0.js.map
|
|
@@ -78,7 +78,8 @@ class SpfxProjectDoctorCommand extends BaseProjectCommand {
|
|
|
78
78
|
'1.22.1',
|
|
79
79
|
'1.22.2',
|
|
80
80
|
'1.23.0',
|
|
81
|
-
'1.23.2'
|
|
81
|
+
'1.23.2',
|
|
82
|
+
'1.24.0-rc.0'
|
|
82
83
|
];
|
|
83
84
|
__classPrivateFieldGet(this, _SpfxProjectDoctorCommand_instances, "m", _SpfxProjectDoctorCommand_initTelemetry).call(this);
|
|
84
85
|
__classPrivateFieldGet(this, _SpfxProjectDoctorCommand_instances, "m", _SpfxProjectDoctorCommand_initOptions).call(this);
|
package/dist/m365/spfx/commands/project/project-upgrade/rules/FN012021_TSC_excludeDirectories.js
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { JsonRule } from '../../JsonRule.js';
|
|
2
|
+
export class FN012021_TSC_excludeDirectories extends JsonRule {
|
|
3
|
+
constructor(options) {
|
|
4
|
+
super();
|
|
5
|
+
this.directories = options.directories;
|
|
6
|
+
}
|
|
7
|
+
get id() {
|
|
8
|
+
return 'FN012021';
|
|
9
|
+
}
|
|
10
|
+
get title() {
|
|
11
|
+
return 'tsconfig.json watchOptions.excludeDirectories property';
|
|
12
|
+
}
|
|
13
|
+
get description() {
|
|
14
|
+
return `Update tsconfig.json watchOptions.excludeDirectories property`;
|
|
15
|
+
}
|
|
16
|
+
get resolution() {
|
|
17
|
+
return `{
|
|
18
|
+
"watchOptions": {
|
|
19
|
+
"excludeDirectories": ${JSON.stringify(this.directories)}
|
|
20
|
+
}
|
|
21
|
+
}`;
|
|
22
|
+
}
|
|
23
|
+
get resolutionType() {
|
|
24
|
+
return 'json';
|
|
25
|
+
}
|
|
26
|
+
get severity() {
|
|
27
|
+
return 'Required';
|
|
28
|
+
}
|
|
29
|
+
get file() {
|
|
30
|
+
return './tsconfig.json';
|
|
31
|
+
}
|
|
32
|
+
visit(project, findings) {
|
|
33
|
+
if (!project.tsConfigJson) {
|
|
34
|
+
return;
|
|
35
|
+
}
|
|
36
|
+
if (!project.tsConfigJson.watchOptions?.excludeDirectories ||
|
|
37
|
+
JSON.stringify(project.tsConfigJson.watchOptions.excludeDirectories) !== JSON.stringify(this.directories)) {
|
|
38
|
+
const node = this.getAstNodeFromFile(project.tsConfigJson, 'watchOptions.excludeDirectories');
|
|
39
|
+
this.addFindingWithPosition(findings, node);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
//# sourceMappingURL=FN012021_TSC_excludeDirectories.js.map
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { DependencyRule } from "./DependencyRule.js";
|
|
2
|
+
export class FN027002_OVERRIDES_qs extends DependencyRule {
|
|
3
|
+
constructor(options) {
|
|
4
|
+
super({ packageName: 'qs', packageVersion: options.version, isOverride: true });
|
|
5
|
+
}
|
|
6
|
+
get id() {
|
|
7
|
+
return 'FN027002';
|
|
8
|
+
}
|
|
9
|
+
visit(project, findings) {
|
|
10
|
+
// If an override entry for the package already exists in package.json,
|
|
11
|
+
// emit an extra finding to remove the existing override first. This avoids
|
|
12
|
+
// having to use a separate remove-override rule (e.g. FN027002) in the upgrade scripts.
|
|
13
|
+
if (project.packageJson?.overrides?.[this.packageName] &&
|
|
14
|
+
project.packageJson.overrides[this.packageName] !== this.packageVersion) {
|
|
15
|
+
const node = this.getAstNodeFromFile(project.packageJson, `overrides.${this.packageName}`);
|
|
16
|
+
findings.push({
|
|
17
|
+
id: `${this.id}_REMOVE`,
|
|
18
|
+
title: this.packageName,
|
|
19
|
+
description: `Remove existing SharePoint Framework override dependency package ${this.packageName}`,
|
|
20
|
+
occurrences: [{
|
|
21
|
+
file: this.file,
|
|
22
|
+
resolution: `removeOverride overrides.${this.packageName}`,
|
|
23
|
+
position: this.getPositionFromNode(node)
|
|
24
|
+
}],
|
|
25
|
+
resolutionType: 'cmd',
|
|
26
|
+
severity: 'Required',
|
|
27
|
+
supersedes: []
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
super.visit(project, findings);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
//# sourceMappingURL=FN027002_OVERRIDES_qs.js.map
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { DependencyRule } from "./DependencyRule.js";
|
|
2
|
+
export class FN027003_OVERRIDES_uuid extends DependencyRule {
|
|
3
|
+
constructor(options) {
|
|
4
|
+
super({ packageName: 'uuid', packageVersion: options.version, isOverride: true });
|
|
5
|
+
}
|
|
6
|
+
get id() {
|
|
7
|
+
return 'FN027003';
|
|
8
|
+
}
|
|
9
|
+
visit(project, findings) {
|
|
10
|
+
// If an override entry for the package already exists in package.json,
|
|
11
|
+
// emit an extra finding to remove the existing override first. This avoids
|
|
12
|
+
// having to use a separate remove-override rule (e.g. FN027003) in the upgrade scripts.
|
|
13
|
+
if (project.packageJson?.overrides?.[this.packageName] &&
|
|
14
|
+
project.packageJson.overrides[this.packageName] !== this.packageVersion) {
|
|
15
|
+
const node = this.getAstNodeFromFile(project.packageJson, `overrides.${this.packageName}`);
|
|
16
|
+
findings.push({
|
|
17
|
+
id: `${this.id}_REMOVE`,
|
|
18
|
+
title: this.packageName,
|
|
19
|
+
description: `Remove existing SharePoint Framework override dependency package ${this.packageName}`,
|
|
20
|
+
occurrences: [{
|
|
21
|
+
file: this.file,
|
|
22
|
+
resolution: `removeOverride overrides.${this.packageName}`,
|
|
23
|
+
position: this.getPositionFromNode(node)
|
|
24
|
+
}],
|
|
25
|
+
resolutionType: 'cmd',
|
|
26
|
+
severity: 'Required',
|
|
27
|
+
supersedes: []
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
super.visit(project, findings);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
//# sourceMappingURL=FN027003_OVERRIDES_uuid.js.map
|
|
@@ -0,0 +1,77 @@
|
|
|
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 { FN001008_DEP_react } from './rules/FN001008_DEP_react.js';
|
|
6
|
+
import { FN001009_DEP_react_dom } from './rules/FN001009_DEP_react_dom.js';
|
|
7
|
+
import { FN001011_DEP_microsoft_sp_dialog } from './rules/FN001011_DEP_microsoft_sp_dialog.js';
|
|
8
|
+
import { FN001012_DEP_microsoft_sp_application_base } from './rules/FN001012_DEP_microsoft_sp_application_base.js';
|
|
9
|
+
import { FN001013_DEP_microsoft_decorators } from './rules/FN001013_DEP_microsoft_decorators.js';
|
|
10
|
+
import { FN001014_DEP_microsoft_sp_listview_extensibility } from './rules/FN001014_DEP_microsoft_sp_listview_extensibility.js';
|
|
11
|
+
import { FN001021_DEP_microsoft_sp_property_pane } from './rules/FN001021_DEP_microsoft_sp_property_pane.js';
|
|
12
|
+
import { FN001023_DEP_microsoft_sp_component_base } from './rules/FN001023_DEP_microsoft_sp_component_base.js';
|
|
13
|
+
import { FN001024_DEP_microsoft_sp_diagnostics } from './rules/FN001024_DEP_microsoft_sp_diagnostics.js';
|
|
14
|
+
import { FN001025_DEP_microsoft_sp_dynamic_data } from './rules/FN001025_DEP_microsoft_sp_dynamic_data.js';
|
|
15
|
+
import { FN001026_DEP_microsoft_sp_extension_base } from './rules/FN001026_DEP_microsoft_sp_extension_base.js';
|
|
16
|
+
import { FN001027_DEP_microsoft_sp_http } from './rules/FN001027_DEP_microsoft_sp_http.js';
|
|
17
|
+
import { FN001028_DEP_microsoft_sp_list_subscription } from './rules/FN001028_DEP_microsoft_sp_list_subscription.js';
|
|
18
|
+
import { FN001029_DEP_microsoft_sp_loader } from './rules/FN001029_DEP_microsoft_sp_loader.js';
|
|
19
|
+
import { FN001030_DEP_microsoft_sp_module_interfaces } from './rules/FN001030_DEP_microsoft_sp_module_interfaces.js';
|
|
20
|
+
import { FN001031_DEP_microsoft_sp_odata_types } from './rules/FN001031_DEP_microsoft_sp_odata_types.js';
|
|
21
|
+
import { FN001032_DEP_microsoft_sp_page_context } from './rules/FN001032_DEP_microsoft_sp_page_context.js';
|
|
22
|
+
import { FN001034_DEP_microsoft_sp_adaptive_card_extension_base } from './rules/FN001034_DEP_microsoft_sp_adaptive_card_extension_base.js';
|
|
23
|
+
import { FN002002_DEVDEP_microsoft_sp_module_interfaces } from './rules/FN002002_DEVDEP_microsoft_sp_module_interfaces.js';
|
|
24
|
+
import { FN002015_DEVDEP_types_react } from './rules/FN002015_DEVDEP_types_react.js';
|
|
25
|
+
import { FN002016_DEVDEP_types_react_dom } from './rules/FN002016_DEVDEP_types_react_dom.js';
|
|
26
|
+
import { FN002022_DEVDEP_microsoft_eslint_plugin_spfx } from './rules/FN002022_DEVDEP_microsoft_eslint_plugin_spfx.js';
|
|
27
|
+
import { FN002023_DEVDEP_microsoft_eslint_config_spfx } from './rules/FN002023_DEVDEP_microsoft_eslint_config_spfx.js';
|
|
28
|
+
import { FN002030_DEVDEP_microsoft_spfx_web_build_rig } from './rules/FN002030_DEVDEP_microsoft_spfx_web_build_rig.js';
|
|
29
|
+
import { FN002031_DEVDEP_rushstack_heft } from './rules/FN002031_DEVDEP_rushstack_heft.js';
|
|
30
|
+
import { FN002034_DEVDEP_microsoft_spfx_heft_plugins } from './rules/FN002034_DEVDEP_microsoft_spfx_heft_plugins.js';
|
|
31
|
+
import { FN010001_YORC_version } from './rules/FN010001_YORC_version.js';
|
|
32
|
+
import { FN012021_TSC_excludeDirectories } from './rules/FN012021_TSC_excludeDirectories.js';
|
|
33
|
+
import { FN020001_RES_types_react } from './rules/FN020001_RES_types_react.js';
|
|
34
|
+
import { FN021003_PKG_engines_node } from './rules/FN021003_PKG_engines_node.js';
|
|
35
|
+
import { FN027001_OVERRIDES_rushstack_heft } from './rules/FN027001_OVERRIDES_rushstack_heft.js';
|
|
36
|
+
import { FN027002_OVERRIDES_qs } from './rules/FN027002_OVERRIDES_qs.js';
|
|
37
|
+
import { FN027003_OVERRIDES_uuid } from './rules/FN027003_OVERRIDES_uuid.js';
|
|
38
|
+
export default [
|
|
39
|
+
new FN001001_DEP_microsoft_sp_core_library({ packageVersion: '1.24.0-rc.0' }),
|
|
40
|
+
new FN001002_DEP_microsoft_sp_lodash_subset({ packageVersion: '1.24.0-rc.0' }),
|
|
41
|
+
new FN001003_DEP_microsoft_sp_office_ui_fabric_core({ packageVersion: '1.24.0-rc.0' }),
|
|
42
|
+
new FN001004_DEP_microsoft_sp_webpart_base({ packageVersion: '1.24.0-rc.0' }),
|
|
43
|
+
new FN001008_DEP_react({ packageVersion: '18.3.1' }),
|
|
44
|
+
new FN001009_DEP_react_dom({ packageVersion: '18.3.1' }),
|
|
45
|
+
new FN001011_DEP_microsoft_sp_dialog({ packageVersion: '1.24.0-rc.0' }),
|
|
46
|
+
new FN001012_DEP_microsoft_sp_application_base({ packageVersion: '1.24.0-rc.0' }),
|
|
47
|
+
new FN001014_DEP_microsoft_sp_listview_extensibility({ packageVersion: '1.24.0-rc.0' }),
|
|
48
|
+
new FN001021_DEP_microsoft_sp_property_pane({ packageVersion: '1.24.0-rc.0' }),
|
|
49
|
+
new FN001023_DEP_microsoft_sp_component_base({ packageVersion: '1.24.0-rc.0' }),
|
|
50
|
+
new FN001024_DEP_microsoft_sp_diagnostics({ packageVersion: '1.24.0-rc.0' }),
|
|
51
|
+
new FN001025_DEP_microsoft_sp_dynamic_data({ packageVersion: '1.24.0-rc.0' }),
|
|
52
|
+
new FN001026_DEP_microsoft_sp_extension_base({ packageVersion: '1.24.0-rc.0' }),
|
|
53
|
+
new FN001027_DEP_microsoft_sp_http({ packageVersion: '1.24.0-rc.0' }),
|
|
54
|
+
new FN001028_DEP_microsoft_sp_list_subscription({ packageVersion: '1.24.0-rc.0' }),
|
|
55
|
+
new FN001029_DEP_microsoft_sp_loader({ packageVersion: '1.24.0-rc.0' }),
|
|
56
|
+
new FN001030_DEP_microsoft_sp_module_interfaces({ packageVersion: '1.24.0-rc.0' }),
|
|
57
|
+
new FN001031_DEP_microsoft_sp_odata_types({ packageVersion: '1.24.0-rc.0' }),
|
|
58
|
+
new FN001032_DEP_microsoft_sp_page_context({ packageVersion: '1.24.0-rc.0' }),
|
|
59
|
+
new FN001013_DEP_microsoft_decorators({ packageVersion: '1.24.0-rc.0' }),
|
|
60
|
+
new FN001034_DEP_microsoft_sp_adaptive_card_extension_base({ packageVersion: '1.24.0-rc.0' }),
|
|
61
|
+
new FN002002_DEVDEP_microsoft_sp_module_interfaces({ packageVersion: '1.24.0-rc.0' }),
|
|
62
|
+
new FN002015_DEVDEP_types_react({ packageVersion: '18.2.79' }),
|
|
63
|
+
new FN002016_DEVDEP_types_react_dom({ packageVersion: '18.2.25' }),
|
|
64
|
+
new FN002022_DEVDEP_microsoft_eslint_plugin_spfx({ packageVersion: '1.24.0-rc.0' }),
|
|
65
|
+
new FN002023_DEVDEP_microsoft_eslint_config_spfx({ packageVersion: '1.24.0-rc.0' }),
|
|
66
|
+
new FN002030_DEVDEP_microsoft_spfx_web_build_rig({ packageVersion: '1.24.0-rc.0' }),
|
|
67
|
+
new FN002031_DEVDEP_rushstack_heft({ packageVersion: '1.3.2' }),
|
|
68
|
+
new FN002034_DEVDEP_microsoft_spfx_heft_plugins({ packageVersion: '1.24.0-rc.0' }),
|
|
69
|
+
new FN010001_YORC_version({ version: '1.24.0-rc.0' }),
|
|
70
|
+
new FN012021_TSC_excludeDirectories({ directories: ['**/teams', '**/temp/copilot'] }),
|
|
71
|
+
new FN020001_RES_types_react({ packageVersion: '18.2.79' }),
|
|
72
|
+
new FN021003_PKG_engines_node({ version: '>=22.14.0 <23.0.0 || >=24.0.0 <25.0.0 || >=26.0.0 <27.0.0' }),
|
|
73
|
+
new FN027001_OVERRIDES_rushstack_heft({ version: '1.3.2' }),
|
|
74
|
+
new FN027002_OVERRIDES_qs({ version: '>=6.15.2' }),
|
|
75
|
+
new FN027003_OVERRIDES_uuid({ version: '>=11.1.1' })
|
|
76
|
+
];
|
|
77
|
+
//# sourceMappingURL=upgrade-1.24.0-rc.0.js.map
|
|
@@ -2,7 +2,7 @@ import fs from 'fs';
|
|
|
2
2
|
import os from 'os';
|
|
3
3
|
import path from 'path';
|
|
4
4
|
// Uncomment to support upgrading to preview releases
|
|
5
|
-
|
|
5
|
+
import { prerelease } from 'semver';
|
|
6
6
|
import { z } from 'zod';
|
|
7
7
|
import { CommandError, globalOptionsZod } from '../../../../Command.js';
|
|
8
8
|
import { fsUtil } from '../../../../utils/fsUtil.js';
|
|
@@ -87,7 +87,8 @@ class SpfxProjectUpgradeCommand extends BaseProjectCommand {
|
|
|
87
87
|
'1.22.1',
|
|
88
88
|
'1.22.2',
|
|
89
89
|
'1.23.0',
|
|
90
|
-
'1.23.2'
|
|
90
|
+
'1.23.2',
|
|
91
|
+
'1.24.0-rc.0'
|
|
91
92
|
];
|
|
92
93
|
}
|
|
93
94
|
async commandAction(logger, args) {
|
|
@@ -97,15 +98,15 @@ class SpfxProjectUpgradeCommand extends BaseProjectCommand {
|
|
|
97
98
|
}
|
|
98
99
|
this.toVersion = args.options.toVersion ? args.options.toVersion : this.supportedVersions[this.supportedVersions.length - 1];
|
|
99
100
|
// Uncomment to support upgrading to preview releases
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
101
|
+
if (!args.options.toVersion &&
|
|
102
|
+
!args.options.preview &&
|
|
103
|
+
prerelease(this.toVersion)) {
|
|
104
|
+
// no version and no preview specified while the current version to
|
|
105
|
+
// upgrade to is a prerelease so let's grab the first non-preview version
|
|
106
|
+
// since we're supporting only one preview version, it's sufficient for
|
|
107
|
+
// us to take second to last version
|
|
108
|
+
this.toVersion = this.supportedVersions[this.supportedVersions.length - 2];
|
|
109
|
+
}
|
|
109
110
|
this.packageManager = args.options.packageManager || 'npm';
|
|
110
111
|
this.shell = args.options.shell || 'powershell';
|
|
111
112
|
if (this.supportedVersions.indexOf(this.toVersion) < 0) {
|
|
@@ -1,14 +1,30 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
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 _SpoNavigationNodeAddCommand_instances, _SpoNavigationNodeAddCommand_initTelemetry, _SpoNavigationNodeAddCommand_initOptions, _SpoNavigationNodeAddCommand_initValidators, _SpoNavigationNodeAddCommand_initOptionSets;
|
|
7
|
-
import request from '../../../../request.js';
|
|
1
|
+
import { globalOptionsZod } from '../../../../Command.js';
|
|
2
|
+
import { z } from 'zod';
|
|
8
3
|
import { spo } from '../../../../utils/spo.js';
|
|
9
4
|
import { validation } from '../../../../utils/validation.js';
|
|
10
5
|
import SpoCommand from '../../../base/SpoCommand.js';
|
|
11
6
|
import commands from '../../commands.js';
|
|
7
|
+
export const options = z.strictObject({
|
|
8
|
+
...globalOptionsZod.shape,
|
|
9
|
+
webUrl: z.string()
|
|
10
|
+
.refine(url => validation.isValidSharePointUrl(url) === true, {
|
|
11
|
+
error: e => `'${e.input}' is not a valid SharePoint Online site URL.`
|
|
12
|
+
})
|
|
13
|
+
.alias('u'),
|
|
14
|
+
location: z.enum(['QuickLaunch', 'TopNavigationBar']).optional().alias('l'),
|
|
15
|
+
title: z.string().min(1, 'Cannot be empty.').alias('t'),
|
|
16
|
+
url: z.string().optional(),
|
|
17
|
+
parentNodeId: z.int().positive().optional(),
|
|
18
|
+
audienceIds: z.string()
|
|
19
|
+
.refine(audienceIds => audienceIds.split(',').length <= 10, {
|
|
20
|
+
error: 'The maximum amount of audienceIds per navigation node exceeded. The maximum amount of audienceIds is 10.'
|
|
21
|
+
})
|
|
22
|
+
.refine(audienceIds => validation.isValidGuidArray(audienceIds) === true, {
|
|
23
|
+
error: e => `The following GUIDs are invalid for the option 'audienceIds': ${validation.isValidGuidArray(e.input)}.`
|
|
24
|
+
})
|
|
25
|
+
.optional(),
|
|
26
|
+
openInNewWindow: z.boolean().optional()
|
|
27
|
+
});
|
|
12
28
|
class SpoNavigationNodeAddCommand extends SpoCommand {
|
|
13
29
|
get name() {
|
|
14
30
|
return commands.NAVIGATION_NODE_ADD;
|
|
@@ -16,134 +32,72 @@ class SpoNavigationNodeAddCommand extends SpoCommand {
|
|
|
16
32
|
get description() {
|
|
17
33
|
return 'Adds a navigation node to the specified site navigation';
|
|
18
34
|
}
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
35
|
+
get schema() {
|
|
36
|
+
return options;
|
|
37
|
+
}
|
|
38
|
+
getRefinedSchema(schema) {
|
|
39
|
+
return schema
|
|
40
|
+
.refine(options => [options.location, options.parentNodeId].filter(o => o !== undefined).length === 1, {
|
|
41
|
+
error: `Specify either 'location' or 'parentNodeId', but not both.`,
|
|
42
|
+
params: {
|
|
43
|
+
customCode: 'optionSet',
|
|
44
|
+
options: ['location', 'parentNodeId']
|
|
45
|
+
}
|
|
46
|
+
});
|
|
26
47
|
}
|
|
27
48
|
getExcludedOptionsWithUrls() {
|
|
28
49
|
return ['url'];
|
|
29
50
|
}
|
|
30
51
|
async commandAction(logger, args) {
|
|
52
|
+
const { webUrl, location, parentNodeId, title, url, audienceIds, openInNewWindow } = args.options;
|
|
31
53
|
if (this.verbose) {
|
|
32
54
|
await logger.logToStderr(`Adding navigation node...`);
|
|
33
55
|
}
|
|
34
|
-
const nodesCollection = args.options.parentNodeId ?
|
|
35
|
-
`GetNodeById(${args.options.parentNodeId})/Children` :
|
|
36
|
-
args.options.location.toLowerCase();
|
|
37
|
-
const requestOptions = {
|
|
38
|
-
url: `${args.options.webUrl}/_api/web/navigation/${nodesCollection}`,
|
|
39
|
-
headers: {
|
|
40
|
-
accept: 'application/json;odata=nometadata',
|
|
41
|
-
'content-type': 'application/json;odata=nometadata'
|
|
42
|
-
},
|
|
43
|
-
responseType: 'json',
|
|
44
|
-
data: {
|
|
45
|
-
AudienceIds: args.options.audienceIds?.split(','),
|
|
46
|
-
Title: args.options.title,
|
|
47
|
-
Url: args.options.url ?? 'http://linkless.header/',
|
|
48
|
-
IsExternal: args.options.isExternal === true
|
|
49
|
-
}
|
|
50
|
-
};
|
|
51
56
|
try {
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
menuStateItem.OpenInNewWindow = true;
|
|
65
|
-
await spo.saveMenuState(args.options.webUrl, menuState);
|
|
57
|
+
let menuState;
|
|
58
|
+
let siblingNodes;
|
|
59
|
+
if (parentNodeId) {
|
|
60
|
+
const parent = await spo.getMenuStateNodeByKey(webUrl, parentNodeId.toString());
|
|
61
|
+
menuState = parent.menuState;
|
|
62
|
+
siblingNodes = parent.node.Nodes;
|
|
63
|
+
}
|
|
64
|
+
else {
|
|
65
|
+
menuState = location === 'TopNavigationBar'
|
|
66
|
+
? await spo.getTopNavigationMenuState(webUrl)
|
|
67
|
+
: await spo.getQuickLaunchMenuState(webUrl);
|
|
68
|
+
siblingNodes = menuState.Nodes;
|
|
66
69
|
}
|
|
67
|
-
|
|
70
|
+
const existingKeys = siblingNodes.map(node => node.Key);
|
|
71
|
+
const newNode = {
|
|
72
|
+
AudienceIds: audienceIds ? audienceIds.split(',') : [],
|
|
73
|
+
IsDeleted: false,
|
|
74
|
+
IsHidden: false,
|
|
75
|
+
Key: null,
|
|
76
|
+
Nodes: [],
|
|
77
|
+
NodeType: 0,
|
|
78
|
+
OpenInNewWindow: openInNewWindow ? true : null,
|
|
79
|
+
SimpleUrl: url ?? '',
|
|
80
|
+
Title: title
|
|
81
|
+
};
|
|
82
|
+
siblingNodes.push(newNode);
|
|
83
|
+
await spo.saveMenuState(webUrl, menuState);
|
|
84
|
+
if (this.verbose) {
|
|
85
|
+
await logger.logToStderr(`Retrieving the added navigation node...`);
|
|
86
|
+
}
|
|
87
|
+
const updatedMenuState = await spo.getMenuState(webUrl, menuState.StartingNodeKey);
|
|
88
|
+
const updatedSiblingNodes = parentNodeId
|
|
89
|
+
? spo.findMenuStateNode(updatedMenuState.Nodes, parentNodeId.toString())?.Nodes
|
|
90
|
+
: updatedMenuState.Nodes;
|
|
91
|
+
const addedNode = updatedSiblingNodes?.find(node => !existingKeys.includes(node.Key) && node.Title === title);
|
|
92
|
+
if (!addedNode) {
|
|
93
|
+
throw `The navigation node was added, but it couldn't be retrieved.`;
|
|
94
|
+
}
|
|
95
|
+
await logger.log(addedNode);
|
|
68
96
|
}
|
|
69
97
|
catch (err) {
|
|
70
98
|
this.handleRejectedODataJsonPromise(err);
|
|
71
99
|
}
|
|
72
100
|
}
|
|
73
|
-
getMenuStateNode(nodes, id) {
|
|
74
|
-
let menuNode = nodes.find((node) => node.Key !== null && node.Key === id);
|
|
75
|
-
if (menuNode === undefined) {
|
|
76
|
-
for (const node of nodes.filter(node => node.Nodes.length > 0)) {
|
|
77
|
-
menuNode = this.getMenuStateNode(node.Nodes, id);
|
|
78
|
-
if (menuNode) {
|
|
79
|
-
break;
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
return menuNode;
|
|
84
|
-
}
|
|
85
101
|
}
|
|
86
|
-
_SpoNavigationNodeAddCommand_instances = new WeakSet(), _SpoNavigationNodeAddCommand_initTelemetry = function _SpoNavigationNodeAddCommand_initTelemetry() {
|
|
87
|
-
this.telemetry.push((args) => {
|
|
88
|
-
Object.assign(this.telemetryProperties, {
|
|
89
|
-
isExternal: args.options.isExternal,
|
|
90
|
-
location: typeof args.options.location !== 'undefined',
|
|
91
|
-
parentNodeId: typeof args.options.parentNodeId !== 'undefined',
|
|
92
|
-
audienceIds: typeof args.options.audienceIds !== 'undefined',
|
|
93
|
-
url: typeof args.options.url !== 'undefined',
|
|
94
|
-
openInNewWindow: !!args.options.openInNewWindow
|
|
95
|
-
});
|
|
96
|
-
});
|
|
97
|
-
}, _SpoNavigationNodeAddCommand_initOptions = function _SpoNavigationNodeAddCommand_initOptions() {
|
|
98
|
-
this.options.unshift({
|
|
99
|
-
option: '-u, --webUrl <webUrl>'
|
|
100
|
-
}, {
|
|
101
|
-
option: '-l, --location [location]',
|
|
102
|
-
autocomplete: ['QuickLaunch', 'TopNavigationBar']
|
|
103
|
-
}, {
|
|
104
|
-
option: '-t, --title <title>'
|
|
105
|
-
}, {
|
|
106
|
-
option: '--url [url]'
|
|
107
|
-
}, {
|
|
108
|
-
option: '--parentNodeId [parentNodeId]'
|
|
109
|
-
}, {
|
|
110
|
-
option: '--isExternal'
|
|
111
|
-
}, {
|
|
112
|
-
option: '--audienceIds [audienceIds]'
|
|
113
|
-
}, {
|
|
114
|
-
option: '--openInNewWindow'
|
|
115
|
-
});
|
|
116
|
-
}, _SpoNavigationNodeAddCommand_initValidators = function _SpoNavigationNodeAddCommand_initValidators() {
|
|
117
|
-
this.validators.push(async (args) => {
|
|
118
|
-
const isValidSharePointUrl = validation.isValidSharePointUrl(args.options.webUrl);
|
|
119
|
-
if (isValidSharePointUrl !== true) {
|
|
120
|
-
return isValidSharePointUrl;
|
|
121
|
-
}
|
|
122
|
-
if (args.options.parentNodeId) {
|
|
123
|
-
if (isNaN(args.options.parentNodeId)) {
|
|
124
|
-
return `${args.options.parentNodeId} is not a number`;
|
|
125
|
-
}
|
|
126
|
-
}
|
|
127
|
-
else {
|
|
128
|
-
if (args.options.location !== 'QuickLaunch' &&
|
|
129
|
-
args.options.location !== 'TopNavigationBar') {
|
|
130
|
-
return `${args.options.location} is not a valid value for the location option. Allowed values are QuickLaunch|TopNavigationBar`;
|
|
131
|
-
}
|
|
132
|
-
}
|
|
133
|
-
if (args.options.audienceIds) {
|
|
134
|
-
const audienceIdsSplitted = args.options.audienceIds.split(',');
|
|
135
|
-
if (audienceIdsSplitted.length > 10) {
|
|
136
|
-
return 'The maximum amount of audienceIds per navigation node exceeded. The maximum amount of auciendeIds is 10.';
|
|
137
|
-
}
|
|
138
|
-
const isValidGUIDArrayResult = validation.isValidGuidArray(args.options.audienceIds);
|
|
139
|
-
if (isValidGUIDArrayResult !== true) {
|
|
140
|
-
return `The following GUIDs are invalid for the option 'audienceIds': ${isValidGUIDArrayResult}.`;
|
|
141
|
-
}
|
|
142
|
-
}
|
|
143
|
-
return true;
|
|
144
|
-
});
|
|
145
|
-
}, _SpoNavigationNodeAddCommand_initOptionSets = function _SpoNavigationNodeAddCommand_initOptionSets() {
|
|
146
|
-
this.optionSets.push({ options: ['location', 'parentNodeId'] });
|
|
147
|
-
};
|
|
148
102
|
export default new SpoNavigationNodeAddCommand();
|
|
149
103
|
//# sourceMappingURL=navigation-node-add.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { globalOptionsZod } from '../../../../Command.js';
|
|
2
2
|
import { z } from 'zod';
|
|
3
|
-
import
|
|
3
|
+
import { spo } from '../../../../utils/spo.js';
|
|
4
4
|
import { validation } from '../../../../utils/validation.js';
|
|
5
5
|
import SpoCommand from '../../../base/SpoCommand.js';
|
|
6
6
|
import commands from '../../commands.js';
|
|
@@ -11,6 +11,7 @@ export const options = z.strictObject({
|
|
|
11
11
|
error: e => `'${e.input}' is not a valid SharePoint Online site URL.`
|
|
12
12
|
})
|
|
13
13
|
.alias('u'),
|
|
14
|
+
location: z.enum(['QuickLaunch', 'TopNavigationBar']).alias('l'),
|
|
14
15
|
id: z.int().positive()
|
|
15
16
|
});
|
|
16
17
|
class SpoNavigationNodeGetCommand extends SpoCommand {
|
|
@@ -27,19 +28,9 @@ class SpoNavigationNodeGetCommand extends SpoCommand {
|
|
|
27
28
|
if (this.verbose) {
|
|
28
29
|
await logger.logToStderr(`Retrieving information about navigation node with id ${args.options.id}`);
|
|
29
30
|
}
|
|
30
|
-
const requestOptions = {
|
|
31
|
-
url: `${args.options.webUrl}/_api/web/navigation/GetNodeById(${args.options.id})?$expand=Children,Children/Children,Children/Children/Children`,
|
|
32
|
-
headers: {
|
|
33
|
-
accept: 'application/json;odata=nometadata'
|
|
34
|
-
},
|
|
35
|
-
responseType: 'json'
|
|
36
|
-
};
|
|
37
31
|
try {
|
|
38
|
-
const
|
|
39
|
-
|
|
40
|
-
throw `No navigation node found with id ${args.options.id}.`;
|
|
41
|
-
}
|
|
42
|
-
await logger.log(listInstance);
|
|
32
|
+
const { node } = await spo.getMenuStateNodeByKey(args.options.webUrl, args.options.id.toString(), args.options.location);
|
|
33
|
+
await logger.log(node);
|
|
43
34
|
}
|
|
44
35
|
catch (err) {
|
|
45
36
|
this.handleRejectedODataJsonPromise(err);
|