@pnp/cli-microsoft365 9.1.0-beta.9a7d76f → 10.0.0-beta.04ac437
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 +3 -1
- package/dist/cli/cli.js +1 -1
- package/dist/m365/app/commands/permission/permission-add.js +9 -9
- package/dist/m365/cli/commands/cli-consent.js +3 -7
- package/dist/m365/cli/commands/config/config-set.js +0 -1
- package/dist/m365/commands/setupPresets.js +2 -4
- package/dist/m365/commands/status.js +2 -2
- package/dist/m365/entra/commands/enterpriseapp/enterpriseapp-add.js +13 -13
- package/dist/m365/entra/commands/enterpriseapp/enterpriseapp-get.js +18 -18
- package/dist/m365/entra/commands/enterpriseapp/enterpriseapp-list.js +1 -1
- package/dist/m365/entra/commands/group/group-user-list.js +4 -4
- package/dist/m365/entra/commands/m365group/m365group-conversation-post-list.js +4 -4
- package/dist/m365/entra/commands/m365group/m365group-recyclebinitem-list.js +3 -3
- package/dist/m365/entra/commands/m365group/m365group-user-list.js +6 -9
- package/dist/m365/file/commands/file-move.js +135 -0
- package/dist/m365/file/commands.js +2 -1
- package/dist/m365/outlook/commands/message/message-get.js +11 -11
- package/dist/m365/spfx/commands/project/DeployWorkflow.js +1 -1
- package/dist/m365/spfx/commands/project/project-doctor/doctor-1.20.0-rc.1.js +25 -0
- package/dist/m365/spfx/commands/project/project-doctor.js +2 -1
- package/dist/m365/spfx/commands/project/project-github-workflow-add.js +1 -10
- package/dist/m365/spfx/commands/project/project-upgrade/upgrade-1.20.0-rc.1.js +57 -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/applicationcustomizer/applicationcustomizer-get.js +0 -1
- package/dist/m365/spo/commands/contenttype/contenttype-field-remove.js +8 -8
- package/dist/m365/spo/commands/contenttype/contenttype-field-set.js +2 -2
- package/dist/m365/spo/commands/file/file-copy.js +59 -34
- package/dist/m365/spo/commands/file/file-move.js +55 -33
- package/dist/m365/spo/commands/folder/folder-set.js +0 -4
- package/dist/m365/spo/commands/list/list-list.js +1 -4
- package/dist/m365/spo/commands/site/site-admin-remove.js +193 -0
- package/dist/m365/spo/commands/site/site-appcatalog-remove.js +48 -24
- package/dist/m365/spo/commands/site/site-remove.js +1 -7
- package/dist/m365/spo/commands/sitescript/sitescript-get.js +3 -2
- package/dist/m365/spo/commands/tenant/tenant-recyclebinitem-restore.js +2 -22
- package/dist/m365/spo/commands.js +1 -1
- package/dist/m365/teams/MeetingTranscript.js +2 -0
- package/dist/m365/teams/commands/meeting/meeting-transcript-get.js +152 -0
- package/dist/m365/teams/commands.js +1 -0
- package/dist/m365/viva/commands/engage/engage-group-list.js +0 -5
- package/dist/m365/viva/commands/engage/engage-group-user-add.js +0 -5
- package/dist/m365/viva/commands/engage/engage-group-user-remove.js +0 -5
- package/dist/m365/viva/commands/engage/engage-message-add.js +0 -5
- package/dist/m365/viva/commands/engage/engage-message-get.js +0 -5
- package/dist/m365/viva/commands/engage/engage-message-like-set.js +0 -5
- package/dist/m365/viva/commands/engage/engage-message-list.js +0 -5
- package/dist/m365/viva/commands/engage/engage-message-remove.js +0 -5
- package/dist/m365/viva/commands/engage/engage-network-list.js +0 -5
- package/dist/m365/viva/commands/engage/engage-report-activitycounts.js +0 -8
- package/dist/m365/viva/commands/engage/engage-report-activityusercounts.js +0 -8
- package/dist/m365/viva/commands/engage/engage-report-activityuserdetail.js +0 -8
- package/dist/m365/viva/commands/engage/engage-report-deviceusagedistributionusercounts.js +0 -8
- package/dist/m365/viva/commands/engage/engage-report-deviceusageusercounts.js +0 -8
- package/dist/m365/viva/commands/engage/engage-report-deviceusageuserdetail.js +0 -8
- package/dist/m365/viva/commands/engage/engage-report-groupsactivitycounts.js +0 -8
- package/dist/m365/viva/commands/engage/engage-report-groupsactivitydetail.js +0 -8
- package/dist/m365/viva/commands/engage/engage-report-groupsactivitygroupcounts.js +0 -8
- package/dist/m365/viva/commands/engage/engage-search.js +0 -5
- package/dist/m365/viva/commands/engage/engage-user-get.js +0 -5
- package/dist/m365/viva/commands/engage/engage-user-list.js +0 -5
- package/dist/settingsNames.js +0 -1
- package/dist/utils/driveUtil.js +51 -0
- package/dist/utils/spo.js +76 -0
- package/docs/docs/_clisettings.mdx +0 -1
- package/docs/docs/cmd/app/permission/permission-add.mdx +5 -5
- package/docs/docs/cmd/cli/cli-consent.mdx +1 -1
- package/docs/docs/cmd/entra/enterpriseapp/enterpriseapp-add.mdx +12 -12
- package/docs/docs/cmd/entra/enterpriseapp/enterpriseapp-get.mdx +14 -14
- package/docs/docs/cmd/entra/enterpriseapp/enterpriseapp-list.mdx +5 -5
- package/docs/docs/cmd/entra/group/group-user-list.mdx +7 -7
- package/docs/docs/cmd/entra/m365group/m365group-conversation-post-list.mdx +5 -5
- package/docs/docs/cmd/entra/m365group/m365group-recyclebinitem-list.mdx +3 -3
- package/docs/docs/cmd/entra/m365group/m365group-report-activitystorage.mdx +2 -2
- package/docs/docs/cmd/entra/m365group/m365group-user-list.mdx +1 -1
- package/docs/docs/cmd/file/file-move.mdx +79 -0
- package/docs/docs/cmd/outlook/message/message-get.mdx +5 -5
- package/docs/docs/cmd/setup.mdx +1 -3
- package/docs/docs/cmd/spfx/project/project-github-workflow-add.mdx +11 -12
- package/docs/docs/cmd/spo/applicationcustomizer/applicationcustomizer-get.mdx +6 -5
- package/docs/docs/cmd/spo/cdn/cdn-get.mdx +1 -1
- package/docs/docs/cmd/spo/cdn/cdn-origin-add.mdx +1 -1
- package/docs/docs/cmd/spo/cdn/cdn-origin-list.mdx +1 -1
- package/docs/docs/cmd/spo/cdn/cdn-origin-remove.mdx +1 -1
- package/docs/docs/cmd/spo/cdn/cdn-policy-list.mdx +1 -1
- package/docs/docs/cmd/spo/cdn/cdn-policy-set.mdx +1 -1
- package/docs/docs/cmd/spo/contenttype/contenttype-field-remove.mdx +7 -7
- package/docs/docs/cmd/spo/contenttype/contenttype-field-set.mdx +2 -2
- package/docs/docs/cmd/spo/externaluser/externaluser-list.mdx +1 -1
- package/docs/docs/cmd/spo/file/file-copy.mdx +119 -12
- package/docs/docs/cmd/spo/file/file-move.mdx +116 -9
- package/docs/docs/cmd/spo/folder/folder-set.mdx +0 -6
- package/docs/docs/cmd/spo/hidedefaultthemes/hidedefaultthemes-get.mdx +1 -1
- package/docs/docs/cmd/spo/hidedefaultthemes/hidedefaultthemes-set.mdx +1 -1
- package/docs/docs/cmd/spo/homesite/homesite-remove.mdx +1 -1
- package/docs/docs/cmd/spo/knowledgehub/knowledgehub-get.mdx +1 -1
- package/docs/docs/cmd/spo/knowledgehub/knowledgehub-remove.mdx +1 -1
- package/docs/docs/cmd/spo/knowledgehub/knowledgehub-set.mdx +1 -1
- package/docs/docs/cmd/spo/list/list-list.mdx +5 -7
- package/docs/docs/cmd/spo/orgassetslibrary/orgassetslibrary-add.mdx +1 -1
- package/docs/docs/cmd/spo/orgassetslibrary/orgassetslibrary-list.mdx +1 -1
- package/docs/docs/cmd/spo/orgassetslibrary/orgassetslibrary-remove.mdx +1 -1
- package/docs/docs/cmd/spo/orgnewssite/orgnewssite-list.mdx +1 -1
- package/docs/docs/cmd/spo/orgnewssite/orgnewssite-remove.mdx +1 -1
- package/docs/docs/cmd/spo/orgnewssite/orgnewssite-set.mdx +1 -1
- package/docs/docs/cmd/spo/site/site-admin-add.mdx +2 -2
- package/docs/docs/cmd/spo/site/site-admin-remove.mdx +67 -0
- package/docs/docs/cmd/spo/site/site-appcatalog-add.mdx +1 -1
- package/docs/docs/cmd/spo/site/site-appcatalog-remove.mdx +12 -3
- package/docs/docs/cmd/spo/site/site-commsite-enable.mdx +1 -1
- package/docs/docs/cmd/spo/site/site-list.mdx +6 -4
- package/docs/docs/cmd/spo/site/site-remove.mdx +0 -3
- package/docs/docs/cmd/spo/site/site-set.mdx +1 -1
- package/docs/docs/cmd/spo/sitescript/sitescript-get.mdx +14 -1
- package/docs/docs/cmd/spo/storageentity/storageentity-remove.mdx +1 -1
- package/docs/docs/cmd/spo/storageentity/storageentity-set.mdx +1 -1
- package/docs/docs/cmd/spo/tenant/tenant-appcatalog-add.mdx +1 -1
- package/docs/docs/cmd/spo/tenant/tenant-appcatalogurl-get.mdx +1 -1
- package/docs/docs/cmd/spo/tenant/tenant-recyclebinitem-list.mdx +1 -1
- package/docs/docs/cmd/spo/tenant/tenant-recyclebinitem-remove.mdx +1 -1
- package/docs/docs/cmd/spo/tenant/tenant-recyclebinitem-restore.mdx +2 -49
- package/docs/docs/cmd/spo/tenant/tenant-settings-list.mdx +1 -1
- package/docs/docs/cmd/spo/theme/theme-apply.mdx +1 -1
- package/docs/docs/cmd/spo/theme/theme-get.mdx +1 -1
- package/docs/docs/cmd/spo/theme/theme-list.mdx +1 -1
- package/docs/docs/cmd/spo/theme/theme-remove.mdx +1 -1
- package/docs/docs/cmd/spo/theme/theme-set.mdx +1 -1
- package/docs/docs/cmd/spp/contentcenter/contentcenter-list.mdx +3 -5
- package/docs/docs/cmd/teams/meeting/meeting-transcript-get.mdx +132 -0
- package/npm-shrinkwrap.json +2 -2
- package/package.json +1 -1
- package/dist/m365/viva/commands/engage/yammerCommands.js +0 -25
|
@@ -0,0 +1,25 @@
|
|
|
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 { FN002004_DEVDEP_gulp } from './rules/FN002004_DEVDEP_gulp.js';
|
|
5
|
+
import { FN002007_DEVDEP_ajv } from './rules/FN002007_DEVDEP_ajv.js';
|
|
6
|
+
import { FN002013_DEVDEP_types_webpack_env } from './rules/FN002013_DEVDEP_types_webpack_env.js';
|
|
7
|
+
import { FN002015_DEVDEP_types_react } from './rules/FN002015_DEVDEP_types_react.js';
|
|
8
|
+
import { FN002016_DEVDEP_types_react_dom } from './rules/FN002016_DEVDEP_types_react_dom.js';
|
|
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';
|
|
11
|
+
import { FN021013_PKG_spfx_devdeps_match_version } from './rules/FN021013_PKG_spfx_devdeps_match_version.js';
|
|
12
|
+
export default [
|
|
13
|
+
new FN001008_DEP_react('17'),
|
|
14
|
+
new FN001009_DEP_react_dom('17'),
|
|
15
|
+
new FN001035_DEP_fluentui_react('^8.106.4'),
|
|
16
|
+
new FN002004_DEVDEP_gulp('4.0.2'),
|
|
17
|
+
new FN002007_DEVDEP_ajv('^6.12.5'),
|
|
18
|
+
new FN002013_DEVDEP_types_webpack_env('~1.15.2'),
|
|
19
|
+
new FN002015_DEVDEP_types_react('17'),
|
|
20
|
+
new FN002016_DEVDEP_types_react_dom('17'),
|
|
21
|
+
new FN002019_DEVDEP_microsoft_rush_stack_compiler(['4.7']),
|
|
22
|
+
new FN021001_PKG_spfx_deps_versions_match_project_version(false),
|
|
23
|
+
new FN021013_PKG_spfx_devdeps_match_version('1.20.1')
|
|
24
|
+
];
|
|
25
|
+
//# sourceMappingURL=doctor-1.20.0-rc.1.js.map
|
|
@@ -70,7 +70,8 @@ class SpfxProjectDoctorCommand extends BaseProjectCommand {
|
|
|
70
70
|
'1.18.0',
|
|
71
71
|
'1.18.1',
|
|
72
72
|
'1.18.2',
|
|
73
|
-
'1.19.0'
|
|
73
|
+
'1.19.0',
|
|
74
|
+
'1.20.0-rc.1'
|
|
74
75
|
];
|
|
75
76
|
__classPrivateFieldGet(this, _SpfxProjectDoctorCommand_instances, "m", _SpfxProjectDoctorCommand_initTelemetry).call(this);
|
|
76
77
|
__classPrivateFieldGet(this, _SpfxProjectDoctorCommand_instances, "m", _SpfxProjectDoctorCommand_initOptions).call(this);
|
|
@@ -33,9 +33,6 @@ class SpfxProjectGithubWorkflowAddCommand extends BaseProjectCommand {
|
|
|
33
33
|
if (this.projectRootPath === null) {
|
|
34
34
|
throw new CommandError(`Couldn't find project root folder`, _a.ERROR_NO_PROJECT_ROOT_FOLDER);
|
|
35
35
|
}
|
|
36
|
-
if (!args.options.overwrite) {
|
|
37
|
-
await this.warn(logger, `We recommend always using the --overwrite option and it will become the default behavior in next major release. Overwriting your sppkg file on every deployment is required to make continuous delivery of the latest version of your app which is the aim of the continuous delivery pipeline.`);
|
|
38
|
-
}
|
|
39
36
|
const solutionPackageJsonFile = path.join(this.projectRootPath, 'package.json');
|
|
40
37
|
const packageJson = fs.readFileSync(solutionPackageJsonFile, 'utf-8');
|
|
41
38
|
const solutionName = JSON.parse(packageJson).name;
|
|
@@ -81,9 +78,6 @@ class SpfxProjectGithubWorkflowAddCommand extends BaseProjectCommand {
|
|
|
81
78
|
if (options.skipFeatureDeployment) {
|
|
82
79
|
this.getDeployAction(workflow).with.SKIP_FEATURE_DEPLOYMENT = true;
|
|
83
80
|
}
|
|
84
|
-
if (options.overwrite) {
|
|
85
|
-
this.getDeployAction(workflow).with.OVERWRITE = true;
|
|
86
|
-
}
|
|
87
81
|
if (options.loginMethod === 'user') {
|
|
88
82
|
const loginAction = this.getLoginAction(workflow);
|
|
89
83
|
loginAction.with = {
|
|
@@ -125,8 +119,7 @@ _a = SpfxProjectGithubWorkflowAddCommand, _SpfxProjectGithubWorkflowAddCommand_i
|
|
|
125
119
|
manuallyTrigger: !!args.options.manuallyTrigger,
|
|
126
120
|
loginMethod: typeof args.options.loginMethod !== 'undefined',
|
|
127
121
|
scope: typeof args.options.scope !== 'undefined',
|
|
128
|
-
skipFeatureDeployment: !!args.options.skipFeatureDeployment
|
|
129
|
-
overwrite: !!args.options.overwrite
|
|
122
|
+
skipFeatureDeployment: !!args.options.skipFeatureDeployment
|
|
130
123
|
});
|
|
131
124
|
});
|
|
132
125
|
}, _SpfxProjectGithubWorkflowAddCommand_initOptions = function _SpfxProjectGithubWorkflowAddCommand_initOptions() {
|
|
@@ -146,8 +139,6 @@ _a = SpfxProjectGithubWorkflowAddCommand, _SpfxProjectGithubWorkflowAddCommand_i
|
|
|
146
139
|
option: '-u, --siteUrl [siteUrl]'
|
|
147
140
|
}, {
|
|
148
141
|
option: '--skipFeatureDeployment'
|
|
149
|
-
}, {
|
|
150
|
-
option: '--overwrite'
|
|
151
142
|
});
|
|
152
143
|
}, _SpfxProjectGithubWorkflowAddCommand_initValidators = function _SpfxProjectGithubWorkflowAddCommand_initValidators() {
|
|
153
144
|
this.validators.push(async (args) => {
|
|
@@ -0,0 +1,57 @@
|
|
|
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 { FN002024_DEVDEP_eslint } from './rules/FN002024_DEVDEP_eslint.js';
|
|
26
|
+
import { FN010001_YORC_version } from './rules/FN010001_YORC_version.js';
|
|
27
|
+
import { FN010010_YORC_sdkVersions_teams_js } from './rules/FN010010_YORC_sdkVersions_teams_js.js';
|
|
28
|
+
export default [
|
|
29
|
+
new FN001001_DEP_microsoft_sp_core_library('1.20.0-rc.1'),
|
|
30
|
+
new FN001002_DEP_microsoft_sp_lodash_subset('1.20.0-rc.1'),
|
|
31
|
+
new FN001003_DEP_microsoft_sp_office_ui_fabric_core('1.20.0-rc.1'),
|
|
32
|
+
new FN001004_DEP_microsoft_sp_webpart_base('1.20.0-rc.1'),
|
|
33
|
+
new FN001011_DEP_microsoft_sp_dialog('1.20.0-rc.1'),
|
|
34
|
+
new FN001012_DEP_microsoft_sp_application_base('1.20.0-rc.1'),
|
|
35
|
+
new FN001014_DEP_microsoft_sp_listview_extensibility('1.20.0-rc.1'),
|
|
36
|
+
new FN001021_DEP_microsoft_sp_property_pane('1.20.0-rc.1'),
|
|
37
|
+
new FN001023_DEP_microsoft_sp_component_base('1.20.0-rc.1'),
|
|
38
|
+
new FN001024_DEP_microsoft_sp_diagnostics('1.20.0-rc.1'),
|
|
39
|
+
new FN001025_DEP_microsoft_sp_dynamic_data('1.20.0-rc.1'),
|
|
40
|
+
new FN001026_DEP_microsoft_sp_extension_base('1.20.0-rc.1'),
|
|
41
|
+
new FN001027_DEP_microsoft_sp_http('1.20.0-rc.1'),
|
|
42
|
+
new FN001028_DEP_microsoft_sp_list_subscription('1.20.0-rc.1'),
|
|
43
|
+
new FN001029_DEP_microsoft_sp_loader('1.20.0-rc.1'),
|
|
44
|
+
new FN001030_DEP_microsoft_sp_module_interfaces('1.20.0-rc.1'),
|
|
45
|
+
new FN001031_DEP_microsoft_sp_odata_types('1.20.0-rc.1'),
|
|
46
|
+
new FN001032_DEP_microsoft_sp_page_context('1.20.0-rc.1'),
|
|
47
|
+
new FN001013_DEP_microsoft_decorators('1.20.0-rc.1'),
|
|
48
|
+
new FN001034_DEP_microsoft_sp_adaptive_card_extension_base('1.20.0-rc.1'),
|
|
49
|
+
new FN002001_DEVDEP_microsoft_sp_build_web('1.20.1'),
|
|
50
|
+
new FN002002_DEVDEP_microsoft_sp_module_interfaces('1.20.1'),
|
|
51
|
+
new FN002024_DEVDEP_eslint('8.57.0'),
|
|
52
|
+
new FN002022_DEVDEP_microsoft_eslint_plugin_spfx('1.20.1'),
|
|
53
|
+
new FN002023_DEVDEP_microsoft_eslint_config_spfx('1.20.1'),
|
|
54
|
+
new FN010001_YORC_version('1.20.0-rc.1'),
|
|
55
|
+
new FN010010_YORC_sdkVersions_teams_js('2.24.0')
|
|
56
|
+
];
|
|
57
|
+
//# sourceMappingURL=upgrade-1.20.0-rc.1.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';
|
|
@@ -72,7 +74,8 @@ class SpfxProjectUpgradeCommand extends BaseProjectCommand {
|
|
|
72
74
|
'1.18.0',
|
|
73
75
|
'1.18.1',
|
|
74
76
|
'1.18.2',
|
|
75
|
-
'1.19.0'
|
|
77
|
+
'1.19.0',
|
|
78
|
+
'1.20.0-rc.1'
|
|
76
79
|
];
|
|
77
80
|
__classPrivateFieldGet(this, _SpfxProjectUpgradeCommand_instances, "m", _SpfxProjectUpgradeCommand_initTelemetry).call(this);
|
|
78
81
|
__classPrivateFieldGet(this, _SpfxProjectUpgradeCommand_instances, "m", _SpfxProjectUpgradeCommand_initOptions).call(this);
|
|
@@ -85,15 +88,15 @@ class SpfxProjectUpgradeCommand extends BaseProjectCommand {
|
|
|
85
88
|
}
|
|
86
89
|
this.toVersion = args.options.toVersion ? args.options.toVersion : this.supportedVersions[this.supportedVersions.length - 1];
|
|
87
90
|
// uncomment to support upgrading to preview releases
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
91
|
+
if (!args.options.toVersion &&
|
|
92
|
+
!args.options.preview &&
|
|
93
|
+
prerelease(this.toVersion)) {
|
|
94
|
+
// no version and no preview specified while the current version to
|
|
95
|
+
// upgrade to is a prerelease so let's grab the first non-preview version
|
|
96
|
+
// since we're supporting only one preview version, it's sufficient for
|
|
97
|
+
// us to take second to last version
|
|
98
|
+
this.toVersion = this.supportedVersions[this.supportedVersions.length - 2];
|
|
99
|
+
}
|
|
97
100
|
this.packageManager = args.options.packageManager || 'npm';
|
|
98
101
|
this.shell = args.options.shell || 'bash';
|
|
99
102
|
if (this.supportedVersions.indexOf(this.toVersion) < 0) {
|
|
@@ -482,9 +485,9 @@ _a = SpfxProjectUpgradeCommand, _SpfxProjectUpgradeCommand_instances = new WeakS
|
|
|
482
485
|
preview: args.options.preview
|
|
483
486
|
});
|
|
484
487
|
// uncomment to support upgrading to preview releases
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
+
if (prerelease(this.telemetryProperties.toVersion) && !args.options.preview) {
|
|
489
|
+
this.telemetryProperties.toVersion = this.supportedVersions[this.supportedVersions.length - 2];
|
|
490
|
+
}
|
|
488
491
|
});
|
|
489
492
|
}, _SpfxProjectUpgradeCommand_initOptions = function _SpfxProjectUpgradeCommand_initOptions() {
|
|
490
493
|
this.options.unshift({
|
|
@@ -575,6 +575,21 @@ class SpfxDoctorCommand extends BaseProjectCommand {
|
|
|
575
575
|
range: '^4 || ^5',
|
|
576
576
|
fix: 'npm i -g yo@5'
|
|
577
577
|
}
|
|
578
|
+
},
|
|
579
|
+
'1.20.0-rc.1': {
|
|
580
|
+
gulpCli: {
|
|
581
|
+
range: '^1 || ^2 || ^3',
|
|
582
|
+
fix: 'npm i -g gulp-cli@3'
|
|
583
|
+
},
|
|
584
|
+
node: {
|
|
585
|
+
range: '>=18.17.1 <19.0.0',
|
|
586
|
+
fix: 'Install Node.js >=18.17.1 <19.0.0'
|
|
587
|
+
},
|
|
588
|
+
sp: SharePointVersion.SPO,
|
|
589
|
+
yo: {
|
|
590
|
+
range: '^4 || ^5',
|
|
591
|
+
fix: 'npm i -g yo@5'
|
|
592
|
+
}
|
|
578
593
|
}
|
|
579
594
|
};
|
|
580
595
|
this.output = '';
|
|
@@ -33,7 +33,6 @@ class SpoApplicationCustomizerGetCommand extends SpoCommand {
|
|
|
33
33
|
if (!args.options.clientSideComponentProperties) {
|
|
34
34
|
await logger.log({
|
|
35
35
|
...customAction,
|
|
36
|
-
Rights: JSON.stringify(customAction.Rights),
|
|
37
36
|
Scope: this.humanizeScope(customAction.Scope)
|
|
38
37
|
});
|
|
39
38
|
}
|
|
@@ -78,15 +78,15 @@ class SpoContentTypeFieldRemoveCommand extends SpoCommand {
|
|
|
78
78
|
const updateChildContentTypes = args.options.listTitle || args.options.listId || args.options.listUrl ? false : args.options.updateChildContentTypes === true;
|
|
79
79
|
if (this.debug) {
|
|
80
80
|
const additionalLog = args.options.listTitle ? `; ListTitle='${args.options.listTitle}'` : args.options.listId ? `; ListId='${args.options.listId}'` : args.options.listUrl ? `; ListUrl='${args.options.listUrl}'` : ` ; UpdateChildContentTypes='${updateChildContentTypes}`;
|
|
81
|
-
await logger.logToStderr(`Remove FieldLink from ContentType.
|
|
81
|
+
await logger.logToStderr(`Remove FieldLink from ContentType. Id='${args.options.id}' ; ContentTypeId='${args.options.contentTypeId}' ${additionalLog}`);
|
|
82
82
|
await logger.logToStderr(`Execute ProcessQuery.`);
|
|
83
83
|
}
|
|
84
84
|
let requestBody = '';
|
|
85
85
|
if (listId) {
|
|
86
|
-
requestBody = `<Request AddExpandoFieldTypeSuffix="true" SchemaVersion="15.0.0.0" LibraryVersion="16.0.0.0" ApplicationName=".NET Library" xmlns="http://schemas.microsoft.com/sharepoint/clientquery/2009"><Actions><ObjectPath Id="18" ObjectPathId="17" /><ObjectPath Id="20" ObjectPathId="19" /><Method Name="DeleteObject" Id="21" ObjectPathId="19" /><Method Name="Update" Id="22" ObjectPathId="15"><Parameters><Parameter Type="Boolean">${updateChildContentTypes}</Parameter></Parameters></Method></Actions><ObjectPaths><Property Id="17" ParentId="15" Name="FieldLinks" /><Method Id="19" ParentId="17" Name="GetById"><Parameters><Parameter Type="Guid">{${formatting.escapeXml(args.options.
|
|
86
|
+
requestBody = `<Request AddExpandoFieldTypeSuffix="true" SchemaVersion="15.0.0.0" LibraryVersion="16.0.0.0" ApplicationName=".NET Library" xmlns="http://schemas.microsoft.com/sharepoint/clientquery/2009"><Actions><ObjectPath Id="18" ObjectPathId="17" /><ObjectPath Id="20" ObjectPathId="19" /><Method Name="DeleteObject" Id="21" ObjectPathId="19" /><Method Name="Update" Id="22" ObjectPathId="15"><Parameters><Parameter Type="Boolean">${updateChildContentTypes}</Parameter></Parameters></Method></Actions><ObjectPaths><Property Id="17" ParentId="15" Name="FieldLinks" /><Method Id="19" ParentId="17" Name="GetById"><Parameters><Parameter Type="Guid">{${formatting.escapeXml(args.options.id)}}</Parameter></Parameters></Method><Identity Id="15" Name="09eec89e-709b-0000-558c-c222dcaf9162|740c6a0b-85e2-48a0-a494-e0f1759d4aa7:site:${siteId}:web:${webId}:list:${listId}:contenttype:${formatting.escapeXml(args.options.contentTypeId)}" /></ObjectPaths></Request>`;
|
|
87
87
|
}
|
|
88
88
|
else {
|
|
89
|
-
requestBody = `<Request AddExpandoFieldTypeSuffix="true" SchemaVersion="15.0.0.0" LibraryVersion="16.0.0.0" ApplicationName=".NET Library" xmlns="http://schemas.microsoft.com/sharepoint/clientquery/2009"><Actions><ObjectPath Id="77" ObjectPathId="76" /><ObjectPath Id="79" ObjectPathId="78" /><Method Name="DeleteObject" Id="80" ObjectPathId="78" /><Method Name="Update" Id="81" ObjectPathId="24"><Parameters><Parameter Type="Boolean">${updateChildContentTypes}</Parameter></Parameters></Method></Actions><ObjectPaths><Property Id="76" ParentId="24" Name="FieldLinks" /><Method Id="78" ParentId="76" Name="GetById"><Parameters><Parameter Type="Guid">{${formatting.escapeXml(args.options.
|
|
89
|
+
requestBody = `<Request AddExpandoFieldTypeSuffix="true" SchemaVersion="15.0.0.0" LibraryVersion="16.0.0.0" ApplicationName=".NET Library" xmlns="http://schemas.microsoft.com/sharepoint/clientquery/2009"><Actions><ObjectPath Id="77" ObjectPathId="76" /><ObjectPath Id="79" ObjectPathId="78" /><Method Name="DeleteObject" Id="80" ObjectPathId="78" /><Method Name="Update" Id="81" ObjectPathId="24"><Parameters><Parameter Type="Boolean">${updateChildContentTypes}</Parameter></Parameters></Method></Actions><ObjectPaths><Property Id="76" ParentId="24" Name="FieldLinks" /><Method Id="78" ParentId="76" Name="GetById"><Parameters><Parameter Type="Guid">{${formatting.escapeXml(args.options.id)}}</Parameter></Parameters></Method><Identity Id="24" Name="6b3ec69e-00a7-0000-55a3-61f8d779d2b3|740c6a0b-85e2-48a0-a494-e0f1759d4aa7:site:${siteId}:web:${webId}:contenttype:${formatting.escapeXml(args.options.contentTypeId)}" /></ObjectPaths></Request>`;
|
|
90
90
|
}
|
|
91
91
|
requestOptions = {
|
|
92
92
|
url: `${args.options.webUrl}/_vti_bin/client.svc/ProcessQuery`,
|
|
@@ -110,7 +110,7 @@ class SpoContentTypeFieldRemoveCommand extends SpoCommand {
|
|
|
110
110
|
await removeFieldLink();
|
|
111
111
|
}
|
|
112
112
|
else {
|
|
113
|
-
const result = await cli.promptForConfirmation({ message: `Are you sure you want to remove the column ${args.options.
|
|
113
|
+
const result = await cli.promptForConfirmation({ message: `Are you sure you want to remove the column ${args.options.id} from content type ${args.options.contentTypeId}?` });
|
|
114
114
|
if (result) {
|
|
115
115
|
await removeFieldLink();
|
|
116
116
|
}
|
|
@@ -160,9 +160,9 @@ _SpoContentTypeFieldRemoveCommand_instances = new WeakSet(), _SpoContentTypeFiel
|
|
|
160
160
|
}, {
|
|
161
161
|
option: '--listUrl [listUrl]'
|
|
162
162
|
}, {
|
|
163
|
-
option: '
|
|
163
|
+
option: '--contentTypeId <contentTypeId>'
|
|
164
164
|
}, {
|
|
165
|
-
option: '--
|
|
165
|
+
option: '-i, --id <id>'
|
|
166
166
|
}, {
|
|
167
167
|
option: '-c, --updateChildContentTypes'
|
|
168
168
|
}, {
|
|
@@ -170,8 +170,8 @@ _SpoContentTypeFieldRemoveCommand_instances = new WeakSet(), _SpoContentTypeFiel
|
|
|
170
170
|
});
|
|
171
171
|
}, _SpoContentTypeFieldRemoveCommand_initValidators = function _SpoContentTypeFieldRemoveCommand_initValidators() {
|
|
172
172
|
this.validators.push(async (args) => {
|
|
173
|
-
if (!validation.isValidGuid(args.options.
|
|
174
|
-
return `${args.options.
|
|
173
|
+
if (!validation.isValidGuid(args.options.id)) {
|
|
174
|
+
return `${args.options.id} is not a valid GUID`;
|
|
175
175
|
}
|
|
176
176
|
if (args.options.listId && !validation.isValidGuid(args.options.listId)) {
|
|
177
177
|
return `${args.options.listId} is not a valid GUID`;
|
|
@@ -262,9 +262,9 @@ _SpoContentTypeFieldSetCommand_instances = new WeakSet(), _SpoContentTypeFieldSe
|
|
|
262
262
|
this.options.unshift({
|
|
263
263
|
option: '-u, --webUrl <webUrl>'
|
|
264
264
|
}, {
|
|
265
|
-
option: '
|
|
265
|
+
option: '--contentTypeId <contentTypeId>'
|
|
266
266
|
}, {
|
|
267
|
-
option: '--id <id>'
|
|
267
|
+
option: '-i, --id <id>'
|
|
268
268
|
}, {
|
|
269
269
|
option: '-r, --required [required]',
|
|
270
270
|
autocomplete: ['true', 'false']
|
|
@@ -5,6 +5,7 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
|
|
|
5
5
|
};
|
|
6
6
|
var _SpoFileCopyCommand_instances, _SpoFileCopyCommand_initTelemetry, _SpoFileCopyCommand_initOptions, _SpoFileCopyCommand_initValidators, _SpoFileCopyCommand_initOptionSets, _SpoFileCopyCommand_initTypes;
|
|
7
7
|
import request from '../../../../request.js';
|
|
8
|
+
import { CreateCopyJobsNameConflictBehavior, spo } from '../../../../utils/spo.js';
|
|
8
9
|
import { urlUtil } from '../../../../utils/urlUtil.js';
|
|
9
10
|
import { validation } from '../../../../utils/validation.js';
|
|
10
11
|
import SpoCommand from '../../../base/SpoCommand.js';
|
|
@@ -26,43 +27,51 @@ class SpoFileCopyCommand extends SpoCommand {
|
|
|
26
27
|
__classPrivateFieldGet(this, _SpoFileCopyCommand_instances, "m", _SpoFileCopyCommand_initOptionSets).call(this);
|
|
27
28
|
__classPrivateFieldGet(this, _SpoFileCopyCommand_instances, "m", _SpoFileCopyCommand_initTypes).call(this);
|
|
28
29
|
}
|
|
30
|
+
getExcludedOptionsWithUrls() {
|
|
31
|
+
return ['targetUrl', 'sourceUrl'];
|
|
32
|
+
}
|
|
29
33
|
async commandAction(logger, args) {
|
|
30
34
|
try {
|
|
31
35
|
const sourceServerRelativePath = await this.getSourcePath(logger, args.options);
|
|
32
36
|
const sourcePath = this.getAbsoluteUrl(args.options.webUrl, sourceServerRelativePath);
|
|
33
|
-
|
|
34
|
-
if (
|
|
35
|
-
|
|
37
|
+
const destinationPath = this.getAbsoluteUrl(args.options.webUrl, args.options.targetUrl);
|
|
38
|
+
if (this.verbose) {
|
|
39
|
+
await logger.logToStderr(`Copying file '${sourceServerRelativePath}' to '${args.options.targetUrl}'...`);
|
|
40
|
+
}
|
|
41
|
+
let newName = args.options.newName;
|
|
42
|
+
// Add original file extension if not provided
|
|
43
|
+
if (newName && !newName.includes('.')) {
|
|
44
|
+
newName += sourceServerRelativePath.substring(sourceServerRelativePath.lastIndexOf('.'));
|
|
36
45
|
}
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
46
|
+
const copyJobResponse = await spo.createCopyJob(args.options.webUrl, sourcePath, destinationPath, {
|
|
47
|
+
nameConflictBehavior: this.getNameConflictBehaviorValue(args.options.nameConflictBehavior),
|
|
48
|
+
bypassSharedLock: !!args.options.bypassSharedLock,
|
|
49
|
+
ignoreVersionHistory: !!args.options.ignoreVersionHistory,
|
|
50
|
+
newName: newName,
|
|
51
|
+
operation: 'copy'
|
|
52
|
+
});
|
|
53
|
+
if (args.options.skipWait) {
|
|
54
|
+
return;
|
|
55
|
+
}
|
|
56
|
+
if (this.verbose) {
|
|
57
|
+
await logger.logToStderr('Waiting for the copy job to complete...');
|
|
40
58
|
}
|
|
59
|
+
const copyJobResult = await spo.getCopyJobResult(args.options.webUrl, copyJobResponse);
|
|
41
60
|
if (this.verbose) {
|
|
42
|
-
await logger.logToStderr(
|
|
61
|
+
await logger.logToStderr('Getting information about the destination file...');
|
|
43
62
|
}
|
|
63
|
+
// Get destination file data
|
|
64
|
+
const siteRelativeDestinationFolder = '/' + copyJobResult.TargetObjectSiteRelativeUrl.substring(0, copyJobResult.TargetObjectSiteRelativeUrl.lastIndexOf('/'));
|
|
65
|
+
const absoluteWebUrl = destinationPath.substring(0, destinationPath.toLowerCase().lastIndexOf(siteRelativeDestinationFolder.toLowerCase()));
|
|
44
66
|
const requestOptions = {
|
|
45
|
-
url: `${
|
|
67
|
+
url: `${absoluteWebUrl}/_api/Web/GetFileById('${copyJobResult.TargetObjectUniqueId}')`,
|
|
46
68
|
headers: {
|
|
47
69
|
accept: 'application/json;odata=nometadata'
|
|
48
70
|
},
|
|
49
|
-
responseType: 'json'
|
|
50
|
-
data: {
|
|
51
|
-
srcPath: {
|
|
52
|
-
DecodedUrl: sourcePath
|
|
53
|
-
},
|
|
54
|
-
destPath: {
|
|
55
|
-
DecodedUrl: destinationPath
|
|
56
|
-
},
|
|
57
|
-
overwrite: args.options.nameConflictBehavior === 'replace',
|
|
58
|
-
options: {
|
|
59
|
-
KeepBoth: args.options.nameConflictBehavior === 'rename',
|
|
60
|
-
ResetAuthorAndCreatedOnCopy: !!args.options.resetAuthorAndCreated,
|
|
61
|
-
ShouldBypassSharedLocks: !!args.options.bypassSharedLock
|
|
62
|
-
}
|
|
63
|
-
}
|
|
71
|
+
responseType: 'json'
|
|
64
72
|
};
|
|
65
|
-
await request.
|
|
73
|
+
const destinationFile = await request.get(requestOptions);
|
|
74
|
+
await logger.log(destinationFile);
|
|
66
75
|
}
|
|
67
76
|
catch (err) {
|
|
68
77
|
this.handleRejectedODataJsonPromise(err);
|
|
@@ -76,17 +85,30 @@ class SpoFileCopyCommand extends SpoCommand {
|
|
|
76
85
|
await logger.logToStderr(`Retrieving server-relative path for file with ID '${options.sourceId}'...`);
|
|
77
86
|
}
|
|
78
87
|
const requestOptions = {
|
|
79
|
-
url: `${options.webUrl}/_api/Web/GetFileById('${options.sourceId}')
|
|
88
|
+
url: `${options.webUrl}/_api/Web/GetFileById('${options.sourceId}')/ServerRelativePath`,
|
|
80
89
|
headers: {
|
|
81
90
|
accept: 'application/json;odata=nometadata'
|
|
82
91
|
},
|
|
83
92
|
responseType: 'json'
|
|
84
93
|
};
|
|
85
94
|
const file = await request.get(requestOptions);
|
|
86
|
-
return file.
|
|
95
|
+
return file.DecodedUrl;
|
|
96
|
+
}
|
|
97
|
+
getNameConflictBehaviorValue(nameConflictBehavior) {
|
|
98
|
+
switch (nameConflictBehavior?.toLowerCase()) {
|
|
99
|
+
case 'fail':
|
|
100
|
+
return CreateCopyJobsNameConflictBehavior.Fail;
|
|
101
|
+
case 'replace':
|
|
102
|
+
return CreateCopyJobsNameConflictBehavior.Replace;
|
|
103
|
+
case 'rename':
|
|
104
|
+
return CreateCopyJobsNameConflictBehavior.Rename;
|
|
105
|
+
default:
|
|
106
|
+
return CreateCopyJobsNameConflictBehavior.Fail;
|
|
107
|
+
}
|
|
87
108
|
}
|
|
88
109
|
getAbsoluteUrl(webUrl, url) {
|
|
89
|
-
|
|
110
|
+
const result = url.startsWith('https://') ? url : urlUtil.getAbsoluteUrl(webUrl, url);
|
|
111
|
+
return urlUtil.removeTrailingSlashes(result);
|
|
90
112
|
}
|
|
91
113
|
}
|
|
92
114
|
_SpoFileCopyCommand_instances = new WeakSet(), _SpoFileCopyCommand_initTelemetry = function _SpoFileCopyCommand_initTelemetry() {
|
|
@@ -95,9 +117,10 @@ _SpoFileCopyCommand_instances = new WeakSet(), _SpoFileCopyCommand_initTelemetry
|
|
|
95
117
|
sourceUrl: typeof args.options.sourceUrl !== 'undefined',
|
|
96
118
|
sourceId: typeof args.options.sourceId !== 'undefined',
|
|
97
119
|
newName: typeof args.options.newName !== 'undefined',
|
|
98
|
-
nameConflictBehavior: args.options.nameConflictBehavior
|
|
99
|
-
|
|
100
|
-
bypassSharedLock: !!args.options.bypassSharedLock
|
|
120
|
+
nameConflictBehavior: typeof args.options.nameConflictBehavior !== 'undefined',
|
|
121
|
+
ignoreVersionHistory: !!args.options.ignoreVersionHistory,
|
|
122
|
+
bypassSharedLock: !!args.options.bypassSharedLock,
|
|
123
|
+
skipWait: !!args.options.skipWait
|
|
101
124
|
});
|
|
102
125
|
});
|
|
103
126
|
}, _SpoFileCopyCommand_initOptions = function _SpoFileCopyCommand_initOptions() {
|
|
@@ -114,10 +137,12 @@ _SpoFileCopyCommand_instances = new WeakSet(), _SpoFileCopyCommand_initTelemetry
|
|
|
114
137
|
}, {
|
|
115
138
|
option: '--nameConflictBehavior [nameConflictBehavior]',
|
|
116
139
|
autocomplete: this.nameConflictBehaviorOptions
|
|
117
|
-
}, {
|
|
118
|
-
option: '--resetAuthorAndCreated'
|
|
119
140
|
}, {
|
|
120
141
|
option: '--bypassSharedLock'
|
|
142
|
+
}, {
|
|
143
|
+
option: '--ignoreVersionHistory'
|
|
144
|
+
}, {
|
|
145
|
+
option: '--skipWait'
|
|
121
146
|
});
|
|
122
147
|
}, _SpoFileCopyCommand_initValidators = function _SpoFileCopyCommand_initValidators() {
|
|
123
148
|
this.validators.push(async (args) => {
|
|
@@ -128,7 +153,7 @@ _SpoFileCopyCommand_instances = new WeakSet(), _SpoFileCopyCommand_initTelemetry
|
|
|
128
153
|
if (args.options.sourceId && !validation.isValidGuid(args.options.sourceId)) {
|
|
129
154
|
return `${args.options.sourceId} is not a valid GUID for sourceId.`;
|
|
130
155
|
}
|
|
131
|
-
if (args.options.nameConflictBehavior && this.nameConflictBehaviorOptions.
|
|
156
|
+
if (args.options.nameConflictBehavior && !this.nameConflictBehaviorOptions.includes(args.options.nameConflictBehavior.toLowerCase())) {
|
|
132
157
|
return `${args.options.nameConflictBehavior} is not a valid nameConflictBehavior value. Allowed values: ${this.nameConflictBehaviorOptions.join(', ')}.`;
|
|
133
158
|
}
|
|
134
159
|
return true;
|
|
@@ -137,7 +162,7 @@ _SpoFileCopyCommand_instances = new WeakSet(), _SpoFileCopyCommand_initTelemetry
|
|
|
137
162
|
this.optionSets.push({ options: ['sourceUrl', 'sourceId'] });
|
|
138
163
|
}, _SpoFileCopyCommand_initTypes = function _SpoFileCopyCommand_initTypes() {
|
|
139
164
|
this.types.string.push('webUrl', 'sourceUrl', 'sourceId', 'targetUrl', 'newName', 'nameConflictBehavior');
|
|
140
|
-
this.types.boolean.push('
|
|
165
|
+
this.types.boolean.push('bypassSharedLock', 'ignoreVersionHistory', 'skipWait');
|
|
141
166
|
};
|
|
142
167
|
export default new SpoFileCopyCommand();
|
|
143
168
|
//# sourceMappingURL=file-copy.js.map
|
|
@@ -5,6 +5,7 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
|
|
|
5
5
|
};
|
|
6
6
|
var _SpoFileMoveCommand_instances, _SpoFileMoveCommand_initTelemetry, _SpoFileMoveCommand_initOptions, _SpoFileMoveCommand_initValidators, _SpoFileMoveCommand_initOptionSets, _SpoFileMoveCommand_initTypes;
|
|
7
7
|
import request from '../../../../request.js';
|
|
8
|
+
import { CreateCopyJobsNameConflictBehavior, spo } from '../../../../utils/spo.js';
|
|
8
9
|
import { urlUtil } from '../../../../utils/urlUtil.js';
|
|
9
10
|
import { validation } from '../../../../utils/validation.js';
|
|
10
11
|
import SpoCommand from '../../../base/SpoCommand.js';
|
|
@@ -31,41 +32,46 @@ class SpoFileMoveCommand extends SpoCommand {
|
|
|
31
32
|
}
|
|
32
33
|
async commandAction(logger, args) {
|
|
33
34
|
try {
|
|
34
|
-
const
|
|
35
|
+
const sourceServerRelativePath = await this.getSourcePath(logger, args.options);
|
|
36
|
+
const sourcePath = this.getAbsoluteUrl(args.options.webUrl, sourceServerRelativePath);
|
|
37
|
+
const destinationPath = this.getAbsoluteUrl(args.options.webUrl, args.options.targetUrl);
|
|
35
38
|
if (this.verbose) {
|
|
36
|
-
await logger.logToStderr(`Moving file ${
|
|
39
|
+
await logger.logToStderr(`Moving file '${sourceServerRelativePath}' to '${args.options.targetUrl}'...`);
|
|
37
40
|
}
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
if (
|
|
41
|
-
|
|
41
|
+
let newName = args.options.newName;
|
|
42
|
+
// Add original file extension if not provided
|
|
43
|
+
if (newName && !newName.includes('.')) {
|
|
44
|
+
newName += sourceServerRelativePath.substring(sourceServerRelativePath.lastIndexOf('.'));
|
|
42
45
|
}
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
+
const copyJobResponse = await spo.createCopyJob(args.options.webUrl, sourcePath, destinationPath, {
|
|
47
|
+
nameConflictBehavior: this.getNameConflictBehaviorValue(args.options.nameConflictBehavior),
|
|
48
|
+
bypassSharedLock: !!args.options.bypassSharedLock,
|
|
49
|
+
includeItemPermissions: !!args.options.includeItemPermissions,
|
|
50
|
+
newName: newName,
|
|
51
|
+
operation: 'move'
|
|
52
|
+
});
|
|
53
|
+
if (args.options.skipWait) {
|
|
54
|
+
return;
|
|
46
55
|
}
|
|
56
|
+
if (this.verbose) {
|
|
57
|
+
await logger.logToStderr('Waiting for the move job to complete...');
|
|
58
|
+
}
|
|
59
|
+
const copyJobResult = await spo.getCopyJobResult(args.options.webUrl, copyJobResponse);
|
|
60
|
+
if (this.verbose) {
|
|
61
|
+
await logger.logToStderr('Getting information about the destination file...');
|
|
62
|
+
}
|
|
63
|
+
// Get destination file data
|
|
64
|
+
const siteRelativeDestinationFolder = '/' + copyJobResult.TargetObjectSiteRelativeUrl.substring(0, copyJobResult.TargetObjectSiteRelativeUrl.lastIndexOf('/'));
|
|
65
|
+
const absoluteWebUrl = destinationPath.substring(0, destinationPath.toLowerCase().lastIndexOf(siteRelativeDestinationFolder.toLowerCase()));
|
|
47
66
|
const requestOptions = {
|
|
48
|
-
url: `${
|
|
67
|
+
url: `${absoluteWebUrl}/_api/Web/GetFileById('${copyJobResult.TargetObjectUniqueId}')`,
|
|
49
68
|
headers: {
|
|
50
69
|
accept: 'application/json;odata=nometadata'
|
|
51
70
|
},
|
|
52
|
-
responseType: 'json'
|
|
53
|
-
data: {
|
|
54
|
-
srcPath: {
|
|
55
|
-
DecodedUrl: absoluteSourcePath
|
|
56
|
-
},
|
|
57
|
-
destPath: {
|
|
58
|
-
DecodedUrl: absoluteTargetPath
|
|
59
|
-
},
|
|
60
|
-
overwrite: args.options.nameConflictBehavior === 'replace',
|
|
61
|
-
options: {
|
|
62
|
-
KeepBoth: args.options.nameConflictBehavior === 'rename',
|
|
63
|
-
ShouldBypassSharedLocks: !!args.options.bypassSharedLock,
|
|
64
|
-
RetainEditorAndModifiedOnMove: !!args.options.retainEditorAndModified
|
|
65
|
-
}
|
|
66
|
-
}
|
|
71
|
+
responseType: 'json'
|
|
67
72
|
};
|
|
68
|
-
await request.
|
|
73
|
+
const destinationFile = await request.get(requestOptions);
|
|
74
|
+
await logger.log(destinationFile);
|
|
69
75
|
}
|
|
70
76
|
catch (err) {
|
|
71
77
|
this.handleRejectedODataJsonPromise(err);
|
|
@@ -79,17 +85,30 @@ class SpoFileMoveCommand extends SpoCommand {
|
|
|
79
85
|
await logger.logToStderr(`Retrieving server-relative path for file with ID '${options.sourceId}'...`);
|
|
80
86
|
}
|
|
81
87
|
const requestOptions = {
|
|
82
|
-
url: `${options.webUrl}/_api/Web/GetFileById('${options.sourceId}')
|
|
88
|
+
url: `${options.webUrl}/_api/Web/GetFileById('${options.sourceId}')/ServerRelativePath`,
|
|
83
89
|
headers: {
|
|
84
90
|
accept: 'application/json;odata=nometadata'
|
|
85
91
|
},
|
|
86
92
|
responseType: 'json'
|
|
87
93
|
};
|
|
88
94
|
const file = await request.get(requestOptions);
|
|
89
|
-
return file.
|
|
95
|
+
return file.DecodedUrl;
|
|
96
|
+
}
|
|
97
|
+
getNameConflictBehaviorValue(nameConflictBehavior) {
|
|
98
|
+
switch (nameConflictBehavior?.toLowerCase()) {
|
|
99
|
+
case 'fail':
|
|
100
|
+
return CreateCopyJobsNameConflictBehavior.Fail;
|
|
101
|
+
case 'replace':
|
|
102
|
+
return CreateCopyJobsNameConflictBehavior.Replace;
|
|
103
|
+
case 'rename':
|
|
104
|
+
return CreateCopyJobsNameConflictBehavior.Rename;
|
|
105
|
+
default:
|
|
106
|
+
return CreateCopyJobsNameConflictBehavior.Fail;
|
|
107
|
+
}
|
|
90
108
|
}
|
|
91
109
|
getAbsoluteUrl(webUrl, url) {
|
|
92
|
-
|
|
110
|
+
const result = url.startsWith('https://') ? url : urlUtil.getAbsoluteUrl(webUrl, url);
|
|
111
|
+
return urlUtil.removeTrailingSlashes(result);
|
|
93
112
|
}
|
|
94
113
|
}
|
|
95
114
|
_SpoFileMoveCommand_instances = new WeakSet(), _SpoFileMoveCommand_initTelemetry = function _SpoFileMoveCommand_initTelemetry() {
|
|
@@ -99,8 +118,9 @@ _SpoFileMoveCommand_instances = new WeakSet(), _SpoFileMoveCommand_initTelemetry
|
|
|
99
118
|
sourceId: typeof args.options.sourceId !== 'undefined',
|
|
100
119
|
newName: typeof args.options.newName !== 'undefined',
|
|
101
120
|
nameConflictBehavior: typeof args.options.nameConflictBehavior !== 'undefined',
|
|
102
|
-
|
|
103
|
-
bypassSharedLock: !!args.options.bypassSharedLock
|
|
121
|
+
includeItemPermissions: !!args.options.includeItemPermissions,
|
|
122
|
+
bypassSharedLock: !!args.options.bypassSharedLock,
|
|
123
|
+
skipWait: !!args.options.skipWait
|
|
104
124
|
});
|
|
105
125
|
});
|
|
106
126
|
}, _SpoFileMoveCommand_initOptions = function _SpoFileMoveCommand_initOptions() {
|
|
@@ -118,9 +138,11 @@ _SpoFileMoveCommand_instances = new WeakSet(), _SpoFileMoveCommand_initTelemetry
|
|
|
118
138
|
option: '--nameConflictBehavior [nameConflictBehavior]',
|
|
119
139
|
autocomplete: this.nameConflictBehaviorOptions
|
|
120
140
|
}, {
|
|
121
|
-
option: '--
|
|
141
|
+
option: '--includeItemPermissions'
|
|
122
142
|
}, {
|
|
123
143
|
option: '--bypassSharedLock'
|
|
144
|
+
}, {
|
|
145
|
+
option: '--skipWait'
|
|
124
146
|
});
|
|
125
147
|
}, _SpoFileMoveCommand_initValidators = function _SpoFileMoveCommand_initValidators() {
|
|
126
148
|
this.validators.push(async (args) => {
|
|
@@ -140,7 +162,7 @@ _SpoFileMoveCommand_instances = new WeakSet(), _SpoFileMoveCommand_initTelemetry
|
|
|
140
162
|
this.optionSets.push({ options: ['sourceUrl', 'sourceId'] });
|
|
141
163
|
}, _SpoFileMoveCommand_initTypes = function _SpoFileMoveCommand_initTypes() {
|
|
142
164
|
this.types.string.push('webUrl', 'sourceUrl', 'sourceId', 'targetUrl', 'newName', 'nameConflictBehavior');
|
|
143
|
-
this.types.boolean.push('
|
|
165
|
+
this.types.boolean.push('includeItemPermissions', 'bypassSharedLock', 'skipWait');
|
|
144
166
|
};
|
|
145
167
|
export default new SpoFileMoveCommand();
|
|
146
168
|
//# sourceMappingURL=file-move.js.map
|
|
@@ -18,9 +18,6 @@ class SpoFolderSetCommand extends SpoCommand {
|
|
|
18
18
|
get description() {
|
|
19
19
|
return 'Updates a folder';
|
|
20
20
|
}
|
|
21
|
-
alias() {
|
|
22
|
-
return [commands.FOLDER_RENAME];
|
|
23
|
-
}
|
|
24
21
|
constructor() {
|
|
25
22
|
super();
|
|
26
23
|
_SpoFolderSetCommand_instances.add(this);
|
|
@@ -34,7 +31,6 @@ class SpoFolderSetCommand extends SpoCommand {
|
|
|
34
31
|
}
|
|
35
32
|
async commandAction(logger, args) {
|
|
36
33
|
try {
|
|
37
|
-
await this.showDeprecationWarning(logger, this.alias()[0], this.name);
|
|
38
34
|
if (this.verbose) {
|
|
39
35
|
await logger.logToStderr(`Updating folder '${args.options.name}'...`);
|
|
40
36
|
}
|