@pnp/cli-microsoft365 9.1.0-beta.4ee36d4 → 9.1.0-beta.53b407a
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 +6 -4
- package/dist/AuthServer.js +7 -7
- package/dist/Command.js +4 -1
- package/dist/api.js +1 -1
- package/dist/m365/base/PowerAutomateCommand.js +1 -1
- package/dist/m365/commands/login.js +1 -1
- package/dist/m365/file/commands/file-move.js +135 -0
- package/dist/m365/file/commands.js +2 -1
- package/dist/m365/flow/commands/environment/environment-get.js +1 -1
- package/dist/m365/flow/commands/environment/environment-list.js +1 -1
- package/dist/m365/flow/commands/flow-disable.js +1 -1
- package/dist/m365/flow/commands/flow-enable.js +1 -1
- package/dist/m365/flow/commands/flow-export.js +17 -16
- package/dist/m365/flow/commands/flow-get.js +1 -1
- package/dist/m365/flow/commands/flow-list.js +1 -1
- package/dist/m365/flow/commands/flow-remove.js +1 -1
- package/dist/m365/flow/commands/owner/owner-ensure.js +1 -1
- package/dist/m365/flow/commands/owner/owner-list.js +1 -1
- package/dist/m365/flow/commands/owner/owner-remove.js +1 -1
- package/dist/m365/flow/commands/recyclebinitem/recyclebinitem-list.js +47 -0
- package/dist/m365/flow/commands/recyclebinitem/recyclebinitem-restore.js +48 -0
- package/dist/m365/flow/commands/run/run-cancel.js +1 -1
- package/dist/m365/flow/commands/run/run-get.js +1 -1
- package/dist/m365/flow/commands/run/run-list.js +1 -1
- package/dist/m365/flow/commands/run/run-resubmit.js +2 -2
- package/dist/m365/flow/commands.js +2 -0
- 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-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/file/file-roleassignment-add.js +17 -54
- package/dist/m365/spo/commands/file/file-roleassignment-remove.js +13 -40
- package/dist/m365/spo/commands/file/file-roleinheritance-break.js +5 -13
- package/dist/m365/spo/commands/file/file-roleinheritance-reset.js +5 -13
- package/dist/m365/spo/commands/folder/folder-sharinglink-add.js +143 -0
- package/dist/m365/spo/commands/folder/folder-sharinglink-clear.js +111 -0
- package/dist/m365/spo/commands/folder/folder-sharinglink-remove.js +95 -0
- package/dist/m365/spo/commands/list/list-get.js +17 -4
- package/dist/m365/spo/commands/page/page-section-add.js +185 -34
- package/dist/m365/spo/commands/site/SiteAdmin.js +2 -0
- package/dist/m365/spo/commands/site/site-admin-add.js +252 -0
- package/dist/m365/spo/commands/site/site-admin-list.js +2 -27
- package/dist/m365/spo/commands/site/site-admin-remove.js +193 -0
- package/dist/m365/spo/commands/user/user-get.js +67 -9
- package/dist/m365/spo/commands.js +5 -0
- package/dist/m365/spp/commands/contentcenter/contentcenter-list.js +56 -0
- package/dist/m365/spp/commands.js +5 -0
- 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/request.js +46 -61
- package/dist/utils/driveUtil.js +51 -0
- package/dist/utils/spo.js +75 -7
- package/dist/utils/timersUtil.js +12 -0
- package/dist/utils/zod.js +1 -1
- package/docs/docs/cmd/entra/m365group/m365group-report-activitystorage.mdx +2 -2
- package/docs/docs/cmd/file/file-move.mdx +79 -0
- package/docs/docs/cmd/flow/recyclebinitem/recyclebinitem-list.mdx +132 -0
- package/docs/docs/cmd/flow/recyclebinitem/recyclebinitem-restore.mdx +55 -0
- 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/externaluser/externaluser-list.mdx +1 -1
- package/docs/docs/cmd/spo/folder/folder-sharinglink-add.mdx +125 -0
- package/docs/docs/cmd/spo/folder/folder-sharinglink-clear.mdx +50 -0
- package/docs/docs/cmd/spo/folder/folder-sharinglink-remove.mdx +50 -0
- 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/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/page/page-section-add.mdx +57 -2
- package/docs/docs/cmd/spo/site/site-admin-add.mdx +67 -0
- 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 +1 -1
- 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-set.mdx +1 -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-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/spo/user/user-get.mdx +35 -9
- package/docs/docs/cmd/spp/contentcenter/contentcenter-list.mdx +287 -0
- package/docs/docs/cmd/teams/meeting/meeting-transcript-get.mdx +132 -0
- package/npm-shrinkwrap.json +203 -375
- package/package.json +16 -17
|
@@ -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);
|
|
@@ -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 = '';
|
|
@@ -4,17 +4,13 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
|
|
|
4
4
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
5
5
|
};
|
|
6
6
|
var _SpoFileRoleAssignmentAddCommand_instances, _SpoFileRoleAssignmentAddCommand_initTelemetry, _SpoFileRoleAssignmentAddCommand_initOptions, _SpoFileRoleAssignmentAddCommand_initValidators, _SpoFileRoleAssignmentAddCommand_initOptionSets, _SpoFileRoleAssignmentAddCommand_initTypes;
|
|
7
|
-
import { cli } from '../../../../cli/cli.js';
|
|
8
7
|
import request from '../../../../request.js';
|
|
9
8
|
import { formatting } from '../../../../utils/formatting.js';
|
|
9
|
+
import { spo } from '../../../../utils/spo.js';
|
|
10
10
|
import { urlUtil } from '../../../../utils/urlUtil.js';
|
|
11
11
|
import { validation } from '../../../../utils/validation.js';
|
|
12
12
|
import SpoCommand from '../../../base/SpoCommand.js';
|
|
13
13
|
import commands from '../../commands.js';
|
|
14
|
-
import spoGroupGetCommand from '../group/group-get.js';
|
|
15
|
-
import spoRoleDefinitionListCommand from '../roledefinition/roledefinition-list.js';
|
|
16
|
-
import spoUserGetCommand from '../user/user-get.js';
|
|
17
|
-
import spoFileGetCommand from './file-get.js';
|
|
18
14
|
class SpoFileRoleAssignmentAddCommand extends SpoCommand {
|
|
19
15
|
get name() {
|
|
20
16
|
return commands.FILE_ROLEASSIGNMENT_ADD;
|
|
@@ -36,14 +32,14 @@ class SpoFileRoleAssignmentAddCommand extends SpoCommand {
|
|
|
36
32
|
await logger.logToStderr(`Adding role assignment to file in site at ${args.options.webUrl}...`);
|
|
37
33
|
}
|
|
38
34
|
try {
|
|
39
|
-
const fileUrl = await this.getFileURL(args);
|
|
40
|
-
const roleDefinitionId = await this.getRoleDefinitionId(args.options);
|
|
35
|
+
const fileUrl = await this.getFileURL(args, logger);
|
|
36
|
+
const roleDefinitionId = await this.getRoleDefinitionId(args.options, logger);
|
|
41
37
|
if (args.options.upn) {
|
|
42
|
-
const upnPrincipalId = await this.getUserPrincipalId(args.options);
|
|
38
|
+
const upnPrincipalId = await this.getUserPrincipalId(args.options, logger);
|
|
43
39
|
await this.addRoleAssignment(fileUrl, args.options.webUrl, upnPrincipalId, roleDefinitionId);
|
|
44
40
|
}
|
|
45
41
|
else if (args.options.groupName) {
|
|
46
|
-
const groupPrincipalId = await this.getGroupPrincipalId(args.options);
|
|
42
|
+
const groupPrincipalId = await this.getGroupPrincipalId(args.options, logger);
|
|
47
43
|
await this.addRoleAssignment(fileUrl, args.options.webUrl, groupPrincipalId, roleDefinitionId);
|
|
48
44
|
}
|
|
49
45
|
else {
|
|
@@ -66,60 +62,27 @@ class SpoFileRoleAssignmentAddCommand extends SpoCommand {
|
|
|
66
62
|
};
|
|
67
63
|
return request.post(requestOptions);
|
|
68
64
|
}
|
|
69
|
-
async getRoleDefinitionId(options) {
|
|
65
|
+
async getRoleDefinitionId(options, logger) {
|
|
70
66
|
if (!options.roleDefinitionName) {
|
|
71
67
|
return options.roleDefinitionId;
|
|
72
68
|
}
|
|
73
|
-
const
|
|
74
|
-
|
|
75
|
-
output: 'json',
|
|
76
|
-
debug: this.debug,
|
|
77
|
-
verbose: this.verbose
|
|
78
|
-
};
|
|
79
|
-
const output = await cli.executeCommandWithOutput(spoRoleDefinitionListCommand, { options: { ...roleDefinitionListCommandOptions, _: [] } });
|
|
80
|
-
const getRoleDefinitionListOutput = JSON.parse(output.stdout);
|
|
81
|
-
const roleDefinitionId = getRoleDefinitionListOutput.find((role) => role.Name === options.roleDefinitionName).Id;
|
|
82
|
-
return roleDefinitionId;
|
|
69
|
+
const roleDefinition = await spo.getRoleDefinitionByName(options.webUrl, options.roleDefinitionName, logger, this.verbose);
|
|
70
|
+
return roleDefinition.Id;
|
|
83
71
|
}
|
|
84
|
-
async getGroupPrincipalId(options) {
|
|
85
|
-
const
|
|
86
|
-
|
|
87
|
-
name: options.groupName,
|
|
88
|
-
output: 'json',
|
|
89
|
-
debug: this.debug,
|
|
90
|
-
verbose: this.verbose
|
|
91
|
-
};
|
|
92
|
-
const output = await cli.executeCommandWithOutput(spoGroupGetCommand, { options: { ...groupGetCommandOptions, _: [] } });
|
|
93
|
-
const getGroupOutput = JSON.parse(output.stdout);
|
|
94
|
-
return getGroupOutput.Id;
|
|
72
|
+
async getGroupPrincipalId(options, logger) {
|
|
73
|
+
const group = await spo.getGroupByName(options.webUrl, options.groupName, logger, this.verbose);
|
|
74
|
+
return group.Id;
|
|
95
75
|
}
|
|
96
|
-
async getUserPrincipalId(options) {
|
|
97
|
-
const
|
|
98
|
-
|
|
99
|
-
email: options.upn,
|
|
100
|
-
id: undefined,
|
|
101
|
-
output: 'json',
|
|
102
|
-
debug: this.debug,
|
|
103
|
-
verbose: this.verbose
|
|
104
|
-
};
|
|
105
|
-
const output = await cli.executeCommandWithOutput(spoUserGetCommand, { options: { ...userGetCommandOptions, _: [] } });
|
|
106
|
-
const getUserOutput = JSON.parse(output.stdout);
|
|
107
|
-
return getUserOutput.Id;
|
|
76
|
+
async getUserPrincipalId(options, logger) {
|
|
77
|
+
const user = await spo.getUserByEmail(options.webUrl, options.upn, logger, this.verbose);
|
|
78
|
+
return user.Id;
|
|
108
79
|
}
|
|
109
|
-
async getFileURL(args) {
|
|
80
|
+
async getFileURL(args, logger) {
|
|
110
81
|
if (args.options.fileUrl) {
|
|
111
82
|
return urlUtil.getServerRelativePath(args.options.webUrl, args.options.fileUrl);
|
|
112
83
|
}
|
|
113
|
-
const
|
|
114
|
-
|
|
115
|
-
id: args.options.fileId,
|
|
116
|
-
output: 'json',
|
|
117
|
-
debug: this.debug,
|
|
118
|
-
verbose: this.verbose
|
|
119
|
-
};
|
|
120
|
-
const output = await cli.executeCommandWithOutput(spoFileGetCommand, { options: { ...options, _: [] } });
|
|
121
|
-
const getFileOutput = JSON.parse(output.stdout);
|
|
122
|
-
return getFileOutput.ServerRelativeUrl;
|
|
84
|
+
const file = await spo.getFileById(args.options.webUrl, args.options.fileId, logger, this.verbose);
|
|
85
|
+
return file.ServerRelativeUrl;
|
|
123
86
|
}
|
|
124
87
|
}
|
|
125
88
|
_SpoFileRoleAssignmentAddCommand_instances = new WeakSet(), _SpoFileRoleAssignmentAddCommand_initTelemetry = function _SpoFileRoleAssignmentAddCommand_initTelemetry() {
|
|
@@ -7,13 +7,11 @@ var _SpoFileRoleAssignmentRemoveCommand_instances, _SpoFileRoleAssignmentRemoveC
|
|
|
7
7
|
import { cli } from '../../../../cli/cli.js';
|
|
8
8
|
import request from '../../../../request.js';
|
|
9
9
|
import { formatting } from '../../../../utils/formatting.js';
|
|
10
|
+
import { spo } from '../../../../utils/spo.js';
|
|
10
11
|
import { urlUtil } from '../../../../utils/urlUtil.js';
|
|
11
12
|
import { validation } from '../../../../utils/validation.js';
|
|
12
13
|
import SpoCommand from '../../../base/SpoCommand.js';
|
|
13
14
|
import commands from '../../commands.js';
|
|
14
|
-
import spoGroupGetCommand from '../group/group-get.js';
|
|
15
|
-
import spoUserGetCommand from '../user/user-get.js';
|
|
16
|
-
import spoFileGetCommand from './file-get.js';
|
|
17
15
|
class SpoFileRoleAssignmentRemoveCommand extends SpoCommand {
|
|
18
16
|
get name() {
|
|
19
17
|
return commands.FILE_ROLEASSIGNMENT_REMOVE;
|
|
@@ -36,13 +34,13 @@ class SpoFileRoleAssignmentRemoveCommand extends SpoCommand {
|
|
|
36
34
|
await logger.logToStderr(`Removing role assignment for ${args.options.groupName || args.options.upn} from file ${args.options.fileUrl || args.options.fileId}`);
|
|
37
35
|
}
|
|
38
36
|
try {
|
|
39
|
-
const fileURL = await this.getFileURL(args);
|
|
37
|
+
const fileURL = await this.getFileURL(args, logger);
|
|
40
38
|
let principalId;
|
|
41
39
|
if (args.options.groupName) {
|
|
42
|
-
principalId = await this.getGroupPrincipalId(args.options);
|
|
40
|
+
principalId = await this.getGroupPrincipalId(args.options, logger);
|
|
43
41
|
}
|
|
44
42
|
else if (args.options.upn) {
|
|
45
|
-
principalId = await this.getUserPrincipalId(args.options);
|
|
43
|
+
principalId = await this.getUserPrincipalId(args.options, logger);
|
|
46
44
|
}
|
|
47
45
|
else {
|
|
48
46
|
principalId = args.options.principalId;
|
|
@@ -71,45 +69,20 @@ class SpoFileRoleAssignmentRemoveCommand extends SpoCommand {
|
|
|
71
69
|
}
|
|
72
70
|
}
|
|
73
71
|
}
|
|
74
|
-
async getFileURL(args) {
|
|
72
|
+
async getFileURL(args, logger) {
|
|
75
73
|
if (args.options.fileUrl) {
|
|
76
74
|
return urlUtil.getServerRelativePath(args.options.webUrl, args.options.fileUrl);
|
|
77
75
|
}
|
|
78
|
-
const
|
|
79
|
-
|
|
80
|
-
id: args.options.fileId,
|
|
81
|
-
output: 'json',
|
|
82
|
-
debug: this.debug,
|
|
83
|
-
verbose: this.verbose
|
|
84
|
-
};
|
|
85
|
-
const output = await cli.executeCommandWithOutput(spoFileGetCommand, { options: { ...options, _: [] } });
|
|
86
|
-
const getFileOutput = JSON.parse(output.stdout);
|
|
87
|
-
return getFileOutput.ServerRelativeUrl;
|
|
76
|
+
const file = await spo.getFileById(args.options.webUrl, args.options.fileId, logger, this.verbose);
|
|
77
|
+
return file.ServerRelativeUrl;
|
|
88
78
|
}
|
|
89
|
-
async getUserPrincipalId(options) {
|
|
90
|
-
const
|
|
91
|
-
|
|
92
|
-
email: options.upn,
|
|
93
|
-
id: undefined,
|
|
94
|
-
output: 'json',
|
|
95
|
-
debug: this.debug,
|
|
96
|
-
verbose: this.verbose
|
|
97
|
-
};
|
|
98
|
-
const output = await cli.executeCommandWithOutput(spoUserGetCommand, { options: { ...userGetCommandOptions, _: [] } });
|
|
99
|
-
const getUserOutput = JSON.parse(output.stdout);
|
|
100
|
-
return getUserOutput.Id;
|
|
79
|
+
async getUserPrincipalId(options, logger) {
|
|
80
|
+
const user = await spo.getUserByEmail(options.webUrl, options.upn, logger, this.verbose);
|
|
81
|
+
return user.Id;
|
|
101
82
|
}
|
|
102
|
-
async getGroupPrincipalId(options) {
|
|
103
|
-
const
|
|
104
|
-
|
|
105
|
-
name: options.groupName,
|
|
106
|
-
output: 'json',
|
|
107
|
-
debug: this.debug,
|
|
108
|
-
verbose: this.verbose
|
|
109
|
-
};
|
|
110
|
-
const output = await cli.executeCommandWithOutput(spoGroupGetCommand, { options: { ...groupGetCommandOptions, _: [] } });
|
|
111
|
-
const getGroupOutput = JSON.parse(output.stdout);
|
|
112
|
-
return getGroupOutput.Id;
|
|
83
|
+
async getGroupPrincipalId(options, logger) {
|
|
84
|
+
const group = await spo.getGroupByName(options.webUrl, options.groupName, logger, this.verbose);
|
|
85
|
+
return group.Id;
|
|
113
86
|
}
|
|
114
87
|
}
|
|
115
88
|
_SpoFileRoleAssignmentRemoveCommand_instances = new WeakSet(), _SpoFileRoleAssignmentRemoveCommand_initTelemetry = function _SpoFileRoleAssignmentRemoveCommand_initTelemetry() {
|
|
@@ -7,11 +7,11 @@ var _SpoFileRoleInheritanceBreakCommand_instances, _SpoFileRoleInheritanceBreakC
|
|
|
7
7
|
import { cli } from '../../../../cli/cli.js';
|
|
8
8
|
import request from '../../../../request.js';
|
|
9
9
|
import { formatting } from '../../../../utils/formatting.js';
|
|
10
|
+
import { spo } from '../../../../utils/spo.js';
|
|
10
11
|
import { urlUtil } from '../../../../utils/urlUtil.js';
|
|
11
12
|
import { validation } from '../../../../utils/validation.js';
|
|
12
13
|
import SpoCommand from '../../../base/SpoCommand.js';
|
|
13
14
|
import commands from '../../commands.js';
|
|
14
|
-
import spoFileGetCommand from './file-get.js';
|
|
15
15
|
class SpoFileRoleInheritanceBreakCommand extends SpoCommand {
|
|
16
16
|
get name() {
|
|
17
17
|
return commands.FILE_ROLEINHERITANCE_BREAK;
|
|
@@ -34,7 +34,7 @@ class SpoFileRoleInheritanceBreakCommand extends SpoCommand {
|
|
|
34
34
|
await logger.logToStderr(`Breaking role inheritance for file ${args.options.fileId || args.options.fileUrl}`);
|
|
35
35
|
}
|
|
36
36
|
try {
|
|
37
|
-
const fileURL = await this.getFileURL(args);
|
|
37
|
+
const fileURL = await this.getFileURL(args, logger);
|
|
38
38
|
const keepExistingPermissions = !args.options.clearExistingPermissions;
|
|
39
39
|
const requestOptions = {
|
|
40
40
|
url: `${args.options.webUrl}/_api/web/GetFileByServerRelativePath(DecodedUrl='${formatting.encodeQueryParameter(fileURL)}')/ListItemAllFields/breakroleinheritance(${keepExistingPermissions})`,
|
|
@@ -59,20 +59,12 @@ class SpoFileRoleInheritanceBreakCommand extends SpoCommand {
|
|
|
59
59
|
}
|
|
60
60
|
}
|
|
61
61
|
}
|
|
62
|
-
async getFileURL(args) {
|
|
62
|
+
async getFileURL(args, logger) {
|
|
63
63
|
if (args.options.fileUrl) {
|
|
64
64
|
return urlUtil.getServerRelativePath(args.options.webUrl, args.options.fileUrl);
|
|
65
65
|
}
|
|
66
|
-
const
|
|
67
|
-
|
|
68
|
-
id: args.options.fileId,
|
|
69
|
-
output: 'json',
|
|
70
|
-
debug: this.debug,
|
|
71
|
-
verbose: this.verbose
|
|
72
|
-
};
|
|
73
|
-
const output = await cli.executeCommandWithOutput(spoFileGetCommand, { options: { ...options, _: [] } });
|
|
74
|
-
const getFileOutput = JSON.parse(output.stdout);
|
|
75
|
-
return getFileOutput.ServerRelativeUrl;
|
|
66
|
+
const file = await spo.getFileById(args.options.webUrl, args.options.fileId, logger, this.verbose);
|
|
67
|
+
return file.ServerRelativeUrl;
|
|
76
68
|
}
|
|
77
69
|
}
|
|
78
70
|
_SpoFileRoleInheritanceBreakCommand_instances = new WeakSet(), _SpoFileRoleInheritanceBreakCommand_initTelemetry = function _SpoFileRoleInheritanceBreakCommand_initTelemetry() {
|
|
@@ -7,11 +7,11 @@ var _SpoFileRoleInheritanceResetCommand_instances, _SpoFileRoleInheritanceResetC
|
|
|
7
7
|
import { cli } from '../../../../cli/cli.js';
|
|
8
8
|
import request from '../../../../request.js';
|
|
9
9
|
import { formatting } from '../../../../utils/formatting.js';
|
|
10
|
+
import { spo } from '../../../../utils/spo.js';
|
|
10
11
|
import { urlUtil } from '../../../../utils/urlUtil.js';
|
|
11
12
|
import { validation } from '../../../../utils/validation.js';
|
|
12
13
|
import SpoCommand from '../../../base/SpoCommand.js';
|
|
13
14
|
import commands from '../../commands.js';
|
|
14
|
-
import spoFileGetCommand from './file-get.js';
|
|
15
15
|
class SpoFileRoleInheritanceResetCommand extends SpoCommand {
|
|
16
16
|
get name() {
|
|
17
17
|
return commands.FILE_ROLEINHERITANCE_RESET;
|
|
@@ -34,7 +34,7 @@ class SpoFileRoleInheritanceResetCommand extends SpoCommand {
|
|
|
34
34
|
await logger.logToStderr(`Resetting role inheritance for file ${args.options.fileId || args.options.fileUrl}`);
|
|
35
35
|
}
|
|
36
36
|
try {
|
|
37
|
-
const fileURL = await this.getFileURL(args);
|
|
37
|
+
const fileURL = await this.getFileURL(args, logger);
|
|
38
38
|
const requestOptions = {
|
|
39
39
|
url: `${args.options.webUrl}/_api/web/GetFileByServerRelativePath(DecodedUrl='${formatting.encodeQueryParameter(fileURL)}')/ListItemAllFields/resetroleinheritance`,
|
|
40
40
|
headers: {
|
|
@@ -58,20 +58,12 @@ class SpoFileRoleInheritanceResetCommand extends SpoCommand {
|
|
|
58
58
|
}
|
|
59
59
|
}
|
|
60
60
|
}
|
|
61
|
-
async getFileURL(args) {
|
|
61
|
+
async getFileURL(args, logger) {
|
|
62
62
|
if (args.options.fileUrl) {
|
|
63
63
|
return urlUtil.getServerRelativePath(args.options.webUrl, args.options.fileUrl);
|
|
64
64
|
}
|
|
65
|
-
const
|
|
66
|
-
|
|
67
|
-
id: args.options.fileId,
|
|
68
|
-
output: 'json',
|
|
69
|
-
debug: this.debug,
|
|
70
|
-
verbose: this.verbose
|
|
71
|
-
};
|
|
72
|
-
const output = await cli.executeCommandWithOutput(spoFileGetCommand, { options: { ...options, _: [] } });
|
|
73
|
-
const getFileOutput = JSON.parse(output.stdout);
|
|
74
|
-
return getFileOutput.ServerRelativeUrl;
|
|
65
|
+
const file = await spo.getFileById(args.options.webUrl, args.options.fileId, logger, this.verbose);
|
|
66
|
+
return file.ServerRelativeUrl;
|
|
75
67
|
}
|
|
76
68
|
}
|
|
77
69
|
_SpoFileRoleInheritanceResetCommand_instances = new WeakSet(), _SpoFileRoleInheritanceResetCommand_initTelemetry = function _SpoFileRoleInheritanceResetCommand_initTelemetry() {
|
|
@@ -0,0 +1,143 @@
|
|
|
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 _SpoFolderSharingLinkAddCommand_instances, _SpoFolderSharingLinkAddCommand_initTelemetry, _SpoFolderSharingLinkAddCommand_initOptions, _SpoFolderSharingLinkAddCommand_initValidators, _SpoFolderSharingLinkAddCommand_initOptionSets, _SpoFolderSharingLinkAddCommand_initTypes;
|
|
7
|
+
import request from '../../../../request.js';
|
|
8
|
+
import { spo } from '../../../../utils/spo.js';
|
|
9
|
+
import { urlUtil } from '../../../../utils/urlUtil.js';
|
|
10
|
+
import { drive } from '../../../../utils/drive.js';
|
|
11
|
+
import { validation } from '../../../../utils/validation.js';
|
|
12
|
+
import { formatting } from '../../../../utils/formatting.js';
|
|
13
|
+
import SpoCommand from '../../../base/SpoCommand.js';
|
|
14
|
+
import commands from '../../commands.js';
|
|
15
|
+
class SpoFolderSharingLinkAddCommand extends SpoCommand {
|
|
16
|
+
get name() {
|
|
17
|
+
return commands.FOLDER_SHARINGLINK_ADD;
|
|
18
|
+
}
|
|
19
|
+
get description() {
|
|
20
|
+
return 'Creates a new sharing link to a folder';
|
|
21
|
+
}
|
|
22
|
+
constructor() {
|
|
23
|
+
super();
|
|
24
|
+
_SpoFolderSharingLinkAddCommand_instances.add(this);
|
|
25
|
+
this.allowedTypes = ['view', 'edit'];
|
|
26
|
+
this.allowedScopes = ['anonymous', 'organization', 'users'];
|
|
27
|
+
__classPrivateFieldGet(this, _SpoFolderSharingLinkAddCommand_instances, "m", _SpoFolderSharingLinkAddCommand_initTelemetry).call(this);
|
|
28
|
+
__classPrivateFieldGet(this, _SpoFolderSharingLinkAddCommand_instances, "m", _SpoFolderSharingLinkAddCommand_initOptions).call(this);
|
|
29
|
+
__classPrivateFieldGet(this, _SpoFolderSharingLinkAddCommand_instances, "m", _SpoFolderSharingLinkAddCommand_initValidators).call(this);
|
|
30
|
+
__classPrivateFieldGet(this, _SpoFolderSharingLinkAddCommand_instances, "m", _SpoFolderSharingLinkAddCommand_initOptionSets).call(this);
|
|
31
|
+
__classPrivateFieldGet(this, _SpoFolderSharingLinkAddCommand_instances, "m", _SpoFolderSharingLinkAddCommand_initTypes).call(this);
|
|
32
|
+
}
|
|
33
|
+
async commandAction(logger, args) {
|
|
34
|
+
if (this.verbose) {
|
|
35
|
+
await logger.logToStderr(`Creating a sharing link to a folder ${args.options.folderId || args.options.folderUrl}...`);
|
|
36
|
+
}
|
|
37
|
+
try {
|
|
38
|
+
const relFolderUrl = await spo.getFolderServerRelativeUrl(args.options.webUrl, args.options.folderUrl, args.options.folderId, logger, args.options.verbose);
|
|
39
|
+
const absoluteFolderUrl = urlUtil.getAbsoluteUrl(args.options.webUrl, relFolderUrl);
|
|
40
|
+
const folderUrl = new URL(absoluteFolderUrl);
|
|
41
|
+
const siteId = await spo.getSiteId(args.options.webUrl);
|
|
42
|
+
const driveDetails = await drive.getDriveByUrl(siteId, folderUrl, logger, args.options.verbose);
|
|
43
|
+
const itemId = await drive.getDriveItemId(driveDetails, folderUrl, logger, args.options.verbose);
|
|
44
|
+
const requestOptions = {
|
|
45
|
+
url: `https://graph.microsoft.com/v1.0/drives/${driveDetails.id}/items/${itemId}/createLink`,
|
|
46
|
+
headers: {
|
|
47
|
+
accept: 'application/json;odata.metadata=none'
|
|
48
|
+
},
|
|
49
|
+
responseType: 'json',
|
|
50
|
+
data: {
|
|
51
|
+
type: args.options.type,
|
|
52
|
+
expirationDateTime: args.options.expirationDateTime,
|
|
53
|
+
scope: args.options.scope,
|
|
54
|
+
retainInheritedPermissions: !!args.options.retainInheritiedPermissions
|
|
55
|
+
}
|
|
56
|
+
};
|
|
57
|
+
if (args.options.scope === 'users' && args.options.recipients) {
|
|
58
|
+
const recipients = formatting.splitAndTrim(args.options.recipients).map(email => ({ email }));
|
|
59
|
+
requestOptions.data.recipients = recipients;
|
|
60
|
+
}
|
|
61
|
+
const sharingLink = await request.post(requestOptions);
|
|
62
|
+
// remove grantedToIdentities from the sharing link object
|
|
63
|
+
if (sharingLink.grantedToIdentities) {
|
|
64
|
+
delete sharingLink.grantedToIdentities;
|
|
65
|
+
}
|
|
66
|
+
await logger.log(sharingLink);
|
|
67
|
+
}
|
|
68
|
+
catch (err) {
|
|
69
|
+
this.handleRejectedODataJsonPromise(err);
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
_SpoFolderSharingLinkAddCommand_instances = new WeakSet(), _SpoFolderSharingLinkAddCommand_initTelemetry = function _SpoFolderSharingLinkAddCommand_initTelemetry() {
|
|
74
|
+
this.telemetry.push((args) => {
|
|
75
|
+
Object.assign(this.telemetryProperties, {
|
|
76
|
+
folderId: typeof args.options.folderId !== 'undefined',
|
|
77
|
+
folderUrl: typeof args.options.folderUrl !== 'undefined',
|
|
78
|
+
type: typeof args.options.type !== 'undefined',
|
|
79
|
+
expirationDateTime: typeof args.options.expirationDateTime !== 'undefined',
|
|
80
|
+
scope: typeof args.options.scope !== 'undefined',
|
|
81
|
+
retainInheritiedPermissions: !!args.options.retainInheritiedPermissions,
|
|
82
|
+
recipients: typeof args.options.recipients !== 'undefined'
|
|
83
|
+
});
|
|
84
|
+
});
|
|
85
|
+
}, _SpoFolderSharingLinkAddCommand_initOptions = function _SpoFolderSharingLinkAddCommand_initOptions() {
|
|
86
|
+
this.options.unshift({
|
|
87
|
+
option: '-u, --webUrl <webUrl>'
|
|
88
|
+
}, {
|
|
89
|
+
option: '--folderId [folderId]'
|
|
90
|
+
}, {
|
|
91
|
+
option: '--folderUrl [folderUrl]'
|
|
92
|
+
}, {
|
|
93
|
+
option: '--type <type>',
|
|
94
|
+
autocomplete: this.allowedTypes
|
|
95
|
+
}, {
|
|
96
|
+
option: '--expirationDateTime [expirationDateTime]'
|
|
97
|
+
}, {
|
|
98
|
+
option: '--scope [scope]',
|
|
99
|
+
autocomplete: this.allowedScopes
|
|
100
|
+
}, {
|
|
101
|
+
option: '--retainInheritedPermissions [retainInheritedPermissions]'
|
|
102
|
+
}, {
|
|
103
|
+
option: '--recipients [recipients]'
|
|
104
|
+
});
|
|
105
|
+
}, _SpoFolderSharingLinkAddCommand_initValidators = function _SpoFolderSharingLinkAddCommand_initValidators() {
|
|
106
|
+
this.validators.push(async (args) => {
|
|
107
|
+
const isValidSharePointUrl = validation.isValidSharePointUrl(args.options.webUrl);
|
|
108
|
+
if (isValidSharePointUrl !== true) {
|
|
109
|
+
return isValidSharePointUrl;
|
|
110
|
+
}
|
|
111
|
+
if (args.options.folderId && !validation.isValidGuid(args.options.folderId)) {
|
|
112
|
+
return `${args.options.folderId} is not a valid GUID`;
|
|
113
|
+
}
|
|
114
|
+
if (args.options.type && !this.allowedTypes.some(type => type === args.options.type)) {
|
|
115
|
+
return `'${args.options.type}' is not a valid type. Allowed values are: ${this.allowedTypes.join(',')}`;
|
|
116
|
+
}
|
|
117
|
+
if (args.options.scope) {
|
|
118
|
+
if (!this.allowedScopes.includes(args.options.scope)) {
|
|
119
|
+
return `'${args.options.scope}' is not a valid scope. Allowed values are: ${this.allowedScopes.join(', ')}.`;
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
if (args.options.expirationDateTime && !validation.isValidISODateTime(args.options.expirationDateTime)) {
|
|
123
|
+
return `${args.options.expirationDateTime} is not a valid ISO date string.`;
|
|
124
|
+
}
|
|
125
|
+
if (args.options.recipients) {
|
|
126
|
+
const isValidUPNArrayResult = validation.isValidUserPrincipalNameArray(args.options.recipients);
|
|
127
|
+
if (isValidUPNArrayResult !== true) {
|
|
128
|
+
return `The following user principal names are invalid for the option 'recipients': ${isValidUPNArrayResult}.`;
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
return true;
|
|
132
|
+
});
|
|
133
|
+
}, _SpoFolderSharingLinkAddCommand_initOptionSets = function _SpoFolderSharingLinkAddCommand_initOptionSets() {
|
|
134
|
+
this.optionSets.push({ options: ['folderId', 'folderUrl'] }, {
|
|
135
|
+
options: ['recipients'],
|
|
136
|
+
runsWhen: (args) => args.options.scope !== undefined && args.options.scope === 'users'
|
|
137
|
+
});
|
|
138
|
+
}, _SpoFolderSharingLinkAddCommand_initTypes = function _SpoFolderSharingLinkAddCommand_initTypes() {
|
|
139
|
+
this.types.string.push('webUrl', 'folderId', 'folderUrl', 'type', 'expirationDateTime', 'scope', 'recipients');
|
|
140
|
+
this.types.boolean.push('retainInheritiedPermissions');
|
|
141
|
+
};
|
|
142
|
+
export default new SpoFolderSharingLinkAddCommand();
|
|
143
|
+
//# sourceMappingURL=folder-sharinglink-add.js.map
|