@pnp/cli-microsoft365 10.0.0-beta.04ac437 → 10.0.0-beta.0b765ef
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 -3
- package/dist/AuthServer.js +7 -7
- package/dist/api.js +1 -1
- package/dist/config.js +1 -0
- package/dist/m365/cli/commands/cli-doctor.js +2 -2
- package/dist/m365/cli/commands.js +1 -2
- package/dist/m365/entra/commands/group/{group-user-add.js → group-member-add.js} +18 -18
- package/dist/m365/entra/commands/group/{group-user-list.js → group-member-list.js} +17 -17
- package/dist/m365/entra/commands/group/{group-user-set.js → group-member-set.js} +19 -19
- package/dist/m365/entra/commands/m365group/m365group-set.js +24 -16
- package/dist/m365/entra/commands/m365group/m365group-user-add.js +5 -12
- package/dist/m365/entra/commands/oauth2grant/oauth2grant-list.js +3 -12
- package/dist/m365/entra/commands.js +3 -3
- package/dist/m365/external/commands/item/item-add.js +2 -5
- package/dist/m365/flow/commands/environment/environment-list.js +1 -1
- package/dist/m365/pa/commands/app/app-list.js +1 -6
- package/dist/m365/pa/commands/connector/connector-list.js +1 -6
- package/dist/m365/pa/commands/environment/environment-list.js +1 -1
- package/dist/m365/pp/commands/environment/environment-list.js +1 -1
- package/dist/m365/spfx/commands/project/project-doctor/{doctor-1.20.0-rc.1.js → doctor-1.20.0.js} +4 -2
- package/dist/m365/spfx/commands/project/project-doctor/rules/FN002021_DEVDEP_rushstack_eslint_config.js +10 -0
- package/dist/m365/spfx/commands/project/project-doctor.js +1 -1
- package/dist/m365/spfx/commands/project/project-upgrade/{upgrade-1.20.0-rc.1.js → upgrade-1.20.0.js} +28 -26
- package/dist/m365/spfx/commands/project/project-upgrade.js +13 -15
- package/dist/m365/spfx/commands/spfx-doctor.js +1 -1
- package/dist/m365/spo/commands/app/app-instance-list.js +3 -18
- package/dist/m365/spo/commands/app/app-list.js +1 -8
- package/dist/m365/spo/commands/feature/feature-list.js +1 -8
- package/dist/m365/spo/commands/list/list-webhook-list.js +1 -6
- package/dist/m365/spo/commands/listitem/listitem-attachment-list.js +1 -8
- package/dist/m365/spo/commands/page/page-list.js +1 -1
- package/dist/m365/spo/commands/page/page-remove.js +37 -16
- package/dist/m365/spo/commands/page/page-template-list.js +1 -3
- package/dist/m365/spo/commands/site/site-admin-list.js +8 -9
- package/dist/m365/spo/commands/site/site-admin-remove.js +5 -4
- package/dist/m365/spo/commands/site/site-sharingpermission-set.js +68 -0
- package/dist/m365/spo/commands/sitescript/sitescript-list.js +1 -3
- package/dist/m365/spo/commands/{site/site-rename.js → tenant/tenant-site-rename.js} +29 -32
- package/dist/m365/spo/commands/theme/theme-list.js +1 -1
- package/dist/m365/spo/commands/web/web-clientsidewebpart-list.js +1 -6
- package/dist/m365/spo/commands.js +2 -1
- package/dist/m365/teams/commands/tab/tab-list.js +5 -3
- package/dist/m365/viva/commands/engage/Community.js +2 -0
- package/dist/m365/viva/commands/engage/engage-community-list.js +28 -0
- package/dist/m365/viva/commands.js +1 -0
- package/dist/request.js +46 -61
- package/dist/utils/spo.js +5 -7
- package/dist/utils/timersUtil.js +12 -0
- package/dist/utils/urlUtil.js +8 -0
- package/docs/docs/cmd/cli/cli-doctor.mdx +24 -23
- package/docs/docs/cmd/entra/group/group-member-add.mdx +62 -0
- package/docs/docs/cmd/entra/group/{group-user-list.mdx → group-member-list.mdx} +14 -14
- package/docs/docs/cmd/entra/group/group-member-set.mdx +62 -0
- package/docs/docs/cmd/entra/m365group/m365group-set.mdx +9 -6
- package/docs/docs/cmd/entra/m365group/m365group-user-add.mdx +0 -3
- package/docs/docs/cmd/external/item/item-add.mdx +3 -3
- package/docs/docs/cmd/spfx/project/project-upgrade.mdx +1 -1
- package/docs/docs/cmd/spo/page/page-remove.mdx +30 -12
- package/docs/docs/cmd/spo/site/site-admin-list.mdx +64 -12
- package/docs/docs/cmd/spo/site/site-sharingpermission-set.mdx +58 -0
- package/docs/docs/cmd/spo/{site/site-rename.mdx → tenant/tenant-site-rename.mdx} +7 -7
- package/docs/docs/cmd/teams/tab/tab-list.mdx +1 -2
- package/docs/docs/cmd/viva/engage/engage-community-list.mdx +81 -0
- package/package.json +1 -1
- package/dist/m365/cli/commands/cli-reconsent.js +0 -29
- package/docs/docs/cmd/cli/cli-reconsent.mdx +0 -62
- package/docs/docs/cmd/entra/group/group-user-add.mdx +0 -62
- package/docs/docs/cmd/entra/group/group-user-set.mdx +0 -62
|
@@ -45,8 +45,7 @@ class ExternalItemAddCommand extends GraphCommand {
|
|
|
45
45
|
properties: {}
|
|
46
46
|
};
|
|
47
47
|
// we need to rewrite the @odata properties to the correct format
|
|
48
|
-
//
|
|
49
|
-
// we also need to extract multiple values for collections into arrays
|
|
48
|
+
// to extract multiple values for collections into arrays
|
|
50
49
|
this.rewriteCollectionProperties(args.options);
|
|
51
50
|
this.addUnknownOptionsToPayload(requestBody.properties, args.options);
|
|
52
51
|
const requestOptions = {
|
|
@@ -81,11 +80,9 @@ class ExternalItemAddCommand extends GraphCommand {
|
|
|
81
80
|
}
|
|
82
81
|
rewriteCollectionProperties(options) {
|
|
83
82
|
Object.getOwnPropertyNames(options).forEach(name => {
|
|
84
|
-
if (!name.
|
|
83
|
+
if (!name.includes('@odata')) {
|
|
85
84
|
return;
|
|
86
85
|
}
|
|
87
|
-
options[`${name}.type`] = options[name].type;
|
|
88
|
-
delete options[name];
|
|
89
86
|
// convert the value of a collection to an array
|
|
90
87
|
const nameWithoutOData = name.substring(0, name.indexOf('@odata'));
|
|
91
88
|
if (options[nameWithoutOData]) {
|
|
@@ -33,13 +33,8 @@ class PaAppListCommand extends PowerAppsCommand {
|
|
|
33
33
|
apps.forEach(a => {
|
|
34
34
|
a.displayName = a.properties.displayName;
|
|
35
35
|
});
|
|
36
|
-
await logger.log(apps);
|
|
37
|
-
}
|
|
38
|
-
else {
|
|
39
|
-
if (this.verbose) {
|
|
40
|
-
await logger.logToStderr('No apps found');
|
|
41
|
-
}
|
|
42
36
|
}
|
|
37
|
+
await logger.log(apps);
|
|
43
38
|
}
|
|
44
39
|
catch (err) {
|
|
45
40
|
this.handleRejectedODataJsonPromise(err);
|
|
@@ -35,13 +35,8 @@ class PaConnectorListCommand extends PowerAppsCommand {
|
|
|
35
35
|
connectors.forEach(c => {
|
|
36
36
|
c.displayName = c.properties.displayName;
|
|
37
37
|
});
|
|
38
|
-
await logger.log(connectors);
|
|
39
|
-
}
|
|
40
|
-
else {
|
|
41
|
-
if (this.verbose) {
|
|
42
|
-
await logger.logToStderr('No custom connectors found');
|
|
43
|
-
}
|
|
44
38
|
}
|
|
39
|
+
await logger.log(connectors);
|
|
45
40
|
}
|
|
46
41
|
catch (err) {
|
|
47
42
|
this.handleRejectedODataJsonPromise(err);
|
|
@@ -28,8 +28,8 @@ class PaEnvironmentListCommand extends PowerAppsCommand {
|
|
|
28
28
|
res.value.forEach(e => {
|
|
29
29
|
e.displayName = e.properties.displayName;
|
|
30
30
|
});
|
|
31
|
-
await logger.log(res.value);
|
|
32
31
|
}
|
|
32
|
+
await logger.log(res.value);
|
|
33
33
|
}
|
|
34
34
|
catch (err) {
|
|
35
35
|
this.handleRejectedODataJsonPromise(err);
|
|
@@ -47,8 +47,8 @@ class PpEnvironmentListCommand extends PowerPlatformCommand {
|
|
|
47
47
|
res.value.forEach(e => {
|
|
48
48
|
e.displayName = e.properties.displayName;
|
|
49
49
|
});
|
|
50
|
-
await logger.log(res.value);
|
|
51
50
|
}
|
|
51
|
+
await logger.log(res.value);
|
|
52
52
|
}
|
|
53
53
|
catch (err) {
|
|
54
54
|
this.handleRejectedODataJsonPromise(err);
|
package/dist/m365/spfx/commands/project/project-doctor/{doctor-1.20.0-rc.1.js → doctor-1.20.0.js}
RENAMED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { FN002021_DEVDEP_rushstack_eslint_config } from '../project-upgrade/rules/FN002021_DEVDEP_rushstack_eslint_config.js';
|
|
1
2
|
import { FN001008_DEP_react } from './rules/FN001008_DEP_react.js';
|
|
2
3
|
import { FN001009_DEP_react_dom } from './rules/FN001009_DEP_react_dom.js';
|
|
3
4
|
import { FN001035_DEP_fluentui_react } from './rules/FN001035_DEP_fluentui_react.js';
|
|
@@ -19,7 +20,8 @@ export default [
|
|
|
19
20
|
new FN002015_DEVDEP_types_react('17'),
|
|
20
21
|
new FN002016_DEVDEP_types_react_dom('17'),
|
|
21
22
|
new FN002019_DEVDEP_microsoft_rush_stack_compiler(['4.7']),
|
|
23
|
+
new FN002021_DEVDEP_rushstack_eslint_config('4.0.1'),
|
|
22
24
|
new FN021001_PKG_spfx_deps_versions_match_project_version(false),
|
|
23
|
-
new FN021013_PKG_spfx_devdeps_match_version('1.20.
|
|
25
|
+
new FN021013_PKG_spfx_devdeps_match_version('1.20.2')
|
|
24
26
|
];
|
|
25
|
-
//# sourceMappingURL=doctor-1.20.0
|
|
27
|
+
//# sourceMappingURL=doctor-1.20.0.js.map
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { DependencyRule } from './DependencyRule.js';
|
|
2
|
+
export class FN002021_DEVDEP_rushstack_eslint_config extends DependencyRule {
|
|
3
|
+
constructor(supportedRange) {
|
|
4
|
+
super('@rushstack/eslint-config', supportedRange, true);
|
|
5
|
+
}
|
|
6
|
+
get id() {
|
|
7
|
+
return 'FN002021';
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=FN002021_DEVDEP_rushstack_eslint_config.js.map
|
|
@@ -71,7 +71,7 @@ class SpfxProjectDoctorCommand extends BaseProjectCommand {
|
|
|
71
71
|
'1.18.1',
|
|
72
72
|
'1.18.2',
|
|
73
73
|
'1.19.0',
|
|
74
|
-
'1.20.0
|
|
74
|
+
'1.20.0'
|
|
75
75
|
];
|
|
76
76
|
__classPrivateFieldGet(this, _SpfxProjectDoctorCommand_instances, "m", _SpfxProjectDoctorCommand_initTelemetry).call(this);
|
|
77
77
|
__classPrivateFieldGet(this, _SpfxProjectDoctorCommand_instances, "m", _SpfxProjectDoctorCommand_initOptions).call(this);
|
package/dist/m365/spfx/commands/project/project-upgrade/{upgrade-1.20.0-rc.1.js → upgrade-1.20.0.js}
RENAMED
|
@@ -20,38 +20,40 @@ import { FN001032_DEP_microsoft_sp_page_context } from './rules/FN001032_DEP_mic
|
|
|
20
20
|
import { FN001034_DEP_microsoft_sp_adaptive_card_extension_base } from './rules/FN001034_DEP_microsoft_sp_adaptive_card_extension_base.js';
|
|
21
21
|
import { FN002001_DEVDEP_microsoft_sp_build_web } from './rules/FN002001_DEVDEP_microsoft_sp_build_web.js';
|
|
22
22
|
import { FN002002_DEVDEP_microsoft_sp_module_interfaces } from './rules/FN002002_DEVDEP_microsoft_sp_module_interfaces.js';
|
|
23
|
+
import { FN002021_DEVDEP_rushstack_eslint_config } from './rules/FN002021_DEVDEP_rushstack_eslint_config.js';
|
|
23
24
|
import { FN002022_DEVDEP_microsoft_eslint_plugin_spfx } from './rules/FN002022_DEVDEP_microsoft_eslint_plugin_spfx.js';
|
|
24
25
|
import { FN002023_DEVDEP_microsoft_eslint_config_spfx } from './rules/FN002023_DEVDEP_microsoft_eslint_config_spfx.js';
|
|
25
26
|
import { FN002024_DEVDEP_eslint } from './rules/FN002024_DEVDEP_eslint.js';
|
|
26
27
|
import { FN010001_YORC_version } from './rules/FN010001_YORC_version.js';
|
|
27
28
|
import { FN010010_YORC_sdkVersions_teams_js } from './rules/FN010010_YORC_sdkVersions_teams_js.js';
|
|
28
29
|
export default [
|
|
29
|
-
new FN001001_DEP_microsoft_sp_core_library('1.20.0
|
|
30
|
-
new FN001002_DEP_microsoft_sp_lodash_subset('1.20.0
|
|
31
|
-
new FN001003_DEP_microsoft_sp_office_ui_fabric_core('1.20.0
|
|
32
|
-
new FN001004_DEP_microsoft_sp_webpart_base('1.20.0
|
|
33
|
-
new FN001011_DEP_microsoft_sp_dialog('1.20.0
|
|
34
|
-
new FN001012_DEP_microsoft_sp_application_base('1.20.0
|
|
35
|
-
new FN001014_DEP_microsoft_sp_listview_extensibility('1.20.0
|
|
36
|
-
new FN001021_DEP_microsoft_sp_property_pane('1.20.0
|
|
37
|
-
new FN001023_DEP_microsoft_sp_component_base('1.20.0
|
|
38
|
-
new FN001024_DEP_microsoft_sp_diagnostics('1.20.0
|
|
39
|
-
new FN001025_DEP_microsoft_sp_dynamic_data('1.20.0
|
|
40
|
-
new FN001026_DEP_microsoft_sp_extension_base('1.20.0
|
|
41
|
-
new FN001027_DEP_microsoft_sp_http('1.20.0
|
|
42
|
-
new FN001028_DEP_microsoft_sp_list_subscription('1.20.0
|
|
43
|
-
new FN001029_DEP_microsoft_sp_loader('1.20.0
|
|
44
|
-
new FN001030_DEP_microsoft_sp_module_interfaces('1.20.0
|
|
45
|
-
new FN001031_DEP_microsoft_sp_odata_types('1.20.0
|
|
46
|
-
new FN001032_DEP_microsoft_sp_page_context('1.20.0
|
|
47
|
-
new FN001013_DEP_microsoft_decorators('1.20.0
|
|
48
|
-
new FN001034_DEP_microsoft_sp_adaptive_card_extension_base('1.20.0
|
|
49
|
-
new FN002001_DEVDEP_microsoft_sp_build_web('1.20.
|
|
50
|
-
new FN002002_DEVDEP_microsoft_sp_module_interfaces('1.20.
|
|
30
|
+
new FN001001_DEP_microsoft_sp_core_library('1.20.0'),
|
|
31
|
+
new FN001002_DEP_microsoft_sp_lodash_subset('1.20.0'),
|
|
32
|
+
new FN001003_DEP_microsoft_sp_office_ui_fabric_core('1.20.0'),
|
|
33
|
+
new FN001004_DEP_microsoft_sp_webpart_base('1.20.0'),
|
|
34
|
+
new FN001011_DEP_microsoft_sp_dialog('1.20.0'),
|
|
35
|
+
new FN001012_DEP_microsoft_sp_application_base('1.20.0'),
|
|
36
|
+
new FN001014_DEP_microsoft_sp_listview_extensibility('1.20.0'),
|
|
37
|
+
new FN001021_DEP_microsoft_sp_property_pane('1.20.0'),
|
|
38
|
+
new FN001023_DEP_microsoft_sp_component_base('1.20.0'),
|
|
39
|
+
new FN001024_DEP_microsoft_sp_diagnostics('1.20.0'),
|
|
40
|
+
new FN001025_DEP_microsoft_sp_dynamic_data('1.20.0'),
|
|
41
|
+
new FN001026_DEP_microsoft_sp_extension_base('1.20.0'),
|
|
42
|
+
new FN001027_DEP_microsoft_sp_http('1.20.0'),
|
|
43
|
+
new FN001028_DEP_microsoft_sp_list_subscription('1.20.0'),
|
|
44
|
+
new FN001029_DEP_microsoft_sp_loader('1.20.0'),
|
|
45
|
+
new FN001030_DEP_microsoft_sp_module_interfaces('1.20.0'),
|
|
46
|
+
new FN001031_DEP_microsoft_sp_odata_types('1.20.0'),
|
|
47
|
+
new FN001032_DEP_microsoft_sp_page_context('1.20.0'),
|
|
48
|
+
new FN001013_DEP_microsoft_decorators('1.20.0'),
|
|
49
|
+
new FN001034_DEP_microsoft_sp_adaptive_card_extension_base('1.20.0'),
|
|
50
|
+
new FN002001_DEVDEP_microsoft_sp_build_web('1.20.2'),
|
|
51
|
+
new FN002002_DEVDEP_microsoft_sp_module_interfaces('1.20.2'),
|
|
52
|
+
new FN002021_DEVDEP_rushstack_eslint_config('4.0.1'),
|
|
51
53
|
new FN002024_DEVDEP_eslint('8.57.0'),
|
|
52
|
-
new FN002022_DEVDEP_microsoft_eslint_plugin_spfx('1.20.
|
|
53
|
-
new FN002023_DEVDEP_microsoft_eslint_config_spfx('1.20.
|
|
54
|
-
new FN010001_YORC_version('1.20.0
|
|
54
|
+
new FN002022_DEVDEP_microsoft_eslint_plugin_spfx('1.20.2'),
|
|
55
|
+
new FN002023_DEVDEP_microsoft_eslint_config_spfx('1.20.2'),
|
|
56
|
+
new FN010001_YORC_version('1.20.0'),
|
|
55
57
|
new FN010010_YORC_sdkVersions_teams_js('2.24.0')
|
|
56
58
|
];
|
|
57
|
-
//# sourceMappingURL=upgrade-1.20.0
|
|
59
|
+
//# sourceMappingURL=upgrade-1.20.0.js.map
|
|
@@ -7,8 +7,6 @@ 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';
|
|
12
10
|
import { CommandError } from '../../../../Command.js';
|
|
13
11
|
import { fsUtil } from '../../../../utils/fsUtil.js';
|
|
14
12
|
import { packageManager } from '../../../../utils/packageManager.js';
|
|
@@ -75,7 +73,7 @@ class SpfxProjectUpgradeCommand extends BaseProjectCommand {
|
|
|
75
73
|
'1.18.1',
|
|
76
74
|
'1.18.2',
|
|
77
75
|
'1.19.0',
|
|
78
|
-
'1.20.0
|
|
76
|
+
'1.20.0'
|
|
79
77
|
];
|
|
80
78
|
__classPrivateFieldGet(this, _SpfxProjectUpgradeCommand_instances, "m", _SpfxProjectUpgradeCommand_initTelemetry).call(this);
|
|
81
79
|
__classPrivateFieldGet(this, _SpfxProjectUpgradeCommand_instances, "m", _SpfxProjectUpgradeCommand_initOptions).call(this);
|
|
@@ -88,15 +86,15 @@ class SpfxProjectUpgradeCommand extends BaseProjectCommand {
|
|
|
88
86
|
}
|
|
89
87
|
this.toVersion = args.options.toVersion ? args.options.toVersion : this.supportedVersions[this.supportedVersions.length - 1];
|
|
90
88
|
// uncomment to support upgrading to preview releases
|
|
91
|
-
if (!args.options.toVersion &&
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
}
|
|
89
|
+
// if (!args.options.toVersion &&
|
|
90
|
+
// !args.options.preview &&
|
|
91
|
+
// prerelease(this.toVersion)) {
|
|
92
|
+
// // no version and no preview specified while the current version to
|
|
93
|
+
// // upgrade to is a prerelease so let's grab the first non-preview version
|
|
94
|
+
// // since we're supporting only one preview version, it's sufficient for
|
|
95
|
+
// // us to take second to last version
|
|
96
|
+
// this.toVersion = this.supportedVersions[this.supportedVersions.length - 2];
|
|
97
|
+
// }
|
|
100
98
|
this.packageManager = args.options.packageManager || 'npm';
|
|
101
99
|
this.shell = args.options.shell || 'bash';
|
|
102
100
|
if (this.supportedVersions.indexOf(this.toVersion) < 0) {
|
|
@@ -485,9 +483,9 @@ _a = SpfxProjectUpgradeCommand, _SpfxProjectUpgradeCommand_instances = new WeakS
|
|
|
485
483
|
preview: args.options.preview
|
|
486
484
|
});
|
|
487
485
|
// uncomment to support upgrading to preview releases
|
|
488
|
-
if (prerelease(this.telemetryProperties.toVersion) && !args.options.preview) {
|
|
489
|
-
|
|
490
|
-
}
|
|
486
|
+
// if (prerelease(this.telemetryProperties.toVersion) && !args.options.preview) {
|
|
487
|
+
// this.telemetryProperties.toVersion = this.supportedVersions[this.supportedVersions.length - 2];
|
|
488
|
+
// }
|
|
491
489
|
});
|
|
492
490
|
}, _SpfxProjectUpgradeCommand_initOptions = function _SpfxProjectUpgradeCommand_initOptions() {
|
|
493
491
|
this.options.unshift({
|
|
@@ -4,7 +4,7 @@ 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 _SpoAppInStanceListCommand_instances, _SpoAppInStanceListCommand_initOptions, _SpoAppInStanceListCommand_initValidators;
|
|
7
|
-
import
|
|
7
|
+
import { odata } from '../../../../utils/odata.js';
|
|
8
8
|
import { validation } from '../../../../utils/validation.js';
|
|
9
9
|
import commands from '../../commands.js';
|
|
10
10
|
import { SpoAppBaseCommand } from './SpoAppBaseCommand.js';
|
|
@@ -28,24 +28,9 @@ class SpoAppInStanceListCommand extends SpoAppBaseCommand {
|
|
|
28
28
|
if (this.verbose) {
|
|
29
29
|
await logger.logToStderr(`Retrieving installed apps in site at ${args.options.siteUrl}...`);
|
|
30
30
|
}
|
|
31
|
-
const requestOptions = {
|
|
32
|
-
url: `${args.options.siteUrl}/_api/web/AppTiles?$filter=AppType eq 3`,
|
|
33
|
-
method: 'GET',
|
|
34
|
-
headers: {
|
|
35
|
-
'accept': 'application/json;odata=nometadata'
|
|
36
|
-
},
|
|
37
|
-
responseType: 'json'
|
|
38
|
-
};
|
|
39
31
|
try {
|
|
40
|
-
const apps = await
|
|
41
|
-
|
|
42
|
-
await logger.log(apps.value);
|
|
43
|
-
}
|
|
44
|
-
else {
|
|
45
|
-
if (this.verbose) {
|
|
46
|
-
await logger.logToStderr('No apps found');
|
|
47
|
-
}
|
|
48
|
-
}
|
|
32
|
+
const apps = await odata.getAllItems(`${args.options.siteUrl}/_api/web/AppTiles?$filter=AppType eq 3`);
|
|
33
|
+
await logger.log(apps);
|
|
49
34
|
}
|
|
50
35
|
catch (err) {
|
|
51
36
|
this.handleRejectedODataJsonPromise(err);
|
|
@@ -37,14 +37,7 @@ class SpoAppListCommand extends SpoAppBaseCommand {
|
|
|
37
37
|
await logger.logToStderr(`Retrieving apps...`);
|
|
38
38
|
}
|
|
39
39
|
const apps = await odata.getAllItems(`${appCatalogSiteUrl}/_api/web/${scope}appcatalog/AvailableApps`);
|
|
40
|
-
|
|
41
|
-
await logger.log(apps);
|
|
42
|
-
}
|
|
43
|
-
else {
|
|
44
|
-
if (this.verbose) {
|
|
45
|
-
await logger.logToStderr('No apps found');
|
|
46
|
-
}
|
|
47
|
-
}
|
|
40
|
+
await logger.log(apps);
|
|
48
41
|
}
|
|
49
42
|
catch (err) {
|
|
50
43
|
this.handleRejectedODataJsonPromise(err);
|
|
@@ -26,14 +26,7 @@ class SpoFeatureListCommand extends SpoCommand {
|
|
|
26
26
|
const scope = (args.options.scope) ? args.options.scope : 'Web';
|
|
27
27
|
try {
|
|
28
28
|
const features = await odata.getAllItems(`${args.options.webUrl}/_api/${scope}/Features?$select=DisplayName,DefinitionId`);
|
|
29
|
-
|
|
30
|
-
await logger.log(features);
|
|
31
|
-
}
|
|
32
|
-
else {
|
|
33
|
-
if (this.verbose) {
|
|
34
|
-
await logger.logToStderr('No activated Features found');
|
|
35
|
-
}
|
|
36
|
-
}
|
|
29
|
+
await logger.log(features);
|
|
37
30
|
}
|
|
38
31
|
catch (err) {
|
|
39
32
|
this.handleRejectedODataJsonPromise(err);
|
|
@@ -49,13 +49,8 @@ class SpoListWebhookListCommand extends SpoCommand {
|
|
|
49
49
|
res.forEach(w => {
|
|
50
50
|
w.clientState = w.clientState || '';
|
|
51
51
|
});
|
|
52
|
-
await logger.log(res);
|
|
53
|
-
}
|
|
54
|
-
else {
|
|
55
|
-
if (this.verbose) {
|
|
56
|
-
await logger.logToStderr('No webhooks found');
|
|
57
|
-
}
|
|
58
52
|
}
|
|
53
|
+
await logger.log(res);
|
|
59
54
|
}
|
|
60
55
|
catch (err) {
|
|
61
56
|
this.handleRejectedODataJsonPromise(err);
|
|
@@ -50,14 +50,7 @@ class SpoListItemAttachmentListCommand extends SpoCommand {
|
|
|
50
50
|
};
|
|
51
51
|
try {
|
|
52
52
|
const attachmentFiles = await request.get(requestOptions);
|
|
53
|
-
|
|
54
|
-
await logger.log(attachmentFiles.AttachmentFiles);
|
|
55
|
-
}
|
|
56
|
-
else {
|
|
57
|
-
if (this.verbose) {
|
|
58
|
-
await logger.logToStderr('No attachments found');
|
|
59
|
-
}
|
|
60
|
-
}
|
|
53
|
+
await logger.log(attachmentFiles.AttachmentFiles);
|
|
61
54
|
}
|
|
62
55
|
catch (err) {
|
|
63
56
|
this.handleRejectedODataJsonPromise(err);
|
|
@@ -48,8 +48,8 @@ class SpoPageListCommand extends SpoCommand {
|
|
|
48
48
|
return p;
|
|
49
49
|
});
|
|
50
50
|
pages.filter(p => p.ListItemAllFields).forEach(page => delete page.ListItemAllFields.ID);
|
|
51
|
-
await logger.log(pages);
|
|
52
51
|
}
|
|
52
|
+
await logger.log(pages);
|
|
53
53
|
}
|
|
54
54
|
catch (err) {
|
|
55
55
|
this.handleRejectedODataJsonPromise(err);
|
|
@@ -3,10 +3,10 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
|
|
|
3
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
4
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
5
5
|
};
|
|
6
|
-
var _SpoPageRemoveCommand_instances, _SpoPageRemoveCommand_initOptions, _SpoPageRemoveCommand_initValidators;
|
|
6
|
+
var _SpoPageRemoveCommand_instances, _SpoPageRemoveCommand_initTelemetry, _SpoPageRemoveCommand_initOptions, _SpoPageRemoveCommand_initValidators, _SpoPageRemoveCommand_initTypes;
|
|
7
7
|
import { cli } from '../../../../cli/cli.js';
|
|
8
8
|
import request from '../../../../request.js';
|
|
9
|
-
import {
|
|
9
|
+
import { formatting } from '../../../../utils/formatting.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';
|
|
@@ -21,15 +21,17 @@ class SpoPageRemoveCommand extends SpoCommand {
|
|
|
21
21
|
constructor() {
|
|
22
22
|
super();
|
|
23
23
|
_SpoPageRemoveCommand_instances.add(this);
|
|
24
|
+
__classPrivateFieldGet(this, _SpoPageRemoveCommand_instances, "m", _SpoPageRemoveCommand_initTelemetry).call(this);
|
|
24
25
|
__classPrivateFieldGet(this, _SpoPageRemoveCommand_instances, "m", _SpoPageRemoveCommand_initOptions).call(this);
|
|
25
26
|
__classPrivateFieldGet(this, _SpoPageRemoveCommand_instances, "m", _SpoPageRemoveCommand_initValidators).call(this);
|
|
27
|
+
__classPrivateFieldGet(this, _SpoPageRemoveCommand_instances, "m", _SpoPageRemoveCommand_initTypes).call(this);
|
|
26
28
|
}
|
|
27
29
|
async commandAction(logger, args) {
|
|
28
30
|
if (args.options.force) {
|
|
29
31
|
await this.removePage(logger, args);
|
|
30
32
|
}
|
|
31
33
|
else {
|
|
32
|
-
const result = await cli.promptForConfirmation({ message: `Are you sure you want to remove
|
|
34
|
+
const result = await cli.promptForConfirmation({ message: `Are you sure you want to remove page '${args.options.name}'?` });
|
|
33
35
|
if (result) {
|
|
34
36
|
await this.removePage(logger, args);
|
|
35
37
|
}
|
|
@@ -37,44 +39,63 @@ class SpoPageRemoveCommand extends SpoCommand {
|
|
|
37
39
|
}
|
|
38
40
|
async removePage(logger, args) {
|
|
39
41
|
try {
|
|
40
|
-
|
|
41
|
-
let pageName = args.options.name;
|
|
42
|
-
|
|
43
|
-
requestDigest = reqDigest.FormDigestValue;
|
|
44
|
-
if (!pageName.endsWith('.aspx')) {
|
|
42
|
+
// Remove leading slashes from the page name (page can be nested in folders)
|
|
43
|
+
let pageName = urlUtil.removeLeadingSlashes(args.options.name);
|
|
44
|
+
if (!pageName.toLowerCase().endsWith('.aspx')) {
|
|
45
45
|
pageName += '.aspx';
|
|
46
46
|
}
|
|
47
47
|
if (this.verbose) {
|
|
48
48
|
await logger.logToStderr(`Removing page ${pageName}...`);
|
|
49
49
|
}
|
|
50
|
+
const filePath = `${urlUtil.getServerRelativeSiteUrl(args.options.webUrl)}/SitePages/${pageName}`;
|
|
50
51
|
const requestOptions = {
|
|
51
|
-
url: `${args.options
|
|
52
|
-
.webUrl}/_api/web/GetFileByServerRelativePath(DecodedUrl='${urlUtil.getServerRelativeSiteUrl(args.options.webUrl)}/sitepages/${pageName}')`,
|
|
52
|
+
url: `${args.options.webUrl}/_api/web/GetFileByServerRelativePath(DecodedUrl='${formatting.encodeQueryParameter(filePath)}')`,
|
|
53
53
|
headers: {
|
|
54
|
-
'X-RequestDigest': requestDigest,
|
|
55
|
-
'X-HTTP-Method': 'DELETE',
|
|
56
|
-
'content-type': 'application/json;odata=nometadata',
|
|
57
54
|
accept: 'application/json;odata=nometadata'
|
|
58
55
|
},
|
|
59
56
|
responseType: 'json'
|
|
60
57
|
};
|
|
61
|
-
|
|
58
|
+
if (args.options.bypassSharedLock) {
|
|
59
|
+
requestOptions.headers.Prefer = 'bypass-shared-lock';
|
|
60
|
+
}
|
|
61
|
+
if (args.options.recycle) {
|
|
62
|
+
requestOptions.url += '/Recycle';
|
|
63
|
+
await request.post(requestOptions);
|
|
64
|
+
}
|
|
65
|
+
else {
|
|
66
|
+
await request.delete(requestOptions);
|
|
67
|
+
}
|
|
62
68
|
}
|
|
63
69
|
catch (err) {
|
|
64
70
|
this.handleRejectedODataJsonPromise(err);
|
|
65
71
|
}
|
|
66
72
|
}
|
|
67
73
|
}
|
|
68
|
-
_SpoPageRemoveCommand_instances = new WeakSet(),
|
|
74
|
+
_SpoPageRemoveCommand_instances = new WeakSet(), _SpoPageRemoveCommand_initTelemetry = function _SpoPageRemoveCommand_initTelemetry() {
|
|
75
|
+
this.telemetry.push((args) => {
|
|
76
|
+
Object.assign(this.telemetryProperties, {
|
|
77
|
+
force: !!args.options.force,
|
|
78
|
+
recycle: !!args.options.recycle,
|
|
79
|
+
bypassSharedLock: !!args.options.bypassSharedLock
|
|
80
|
+
});
|
|
81
|
+
});
|
|
82
|
+
}, _SpoPageRemoveCommand_initOptions = function _SpoPageRemoveCommand_initOptions() {
|
|
69
83
|
this.options.unshift({
|
|
84
|
+
option: '-u, --webUrl <webUrl>'
|
|
85
|
+
}, {
|
|
70
86
|
option: '-n, --name <name>'
|
|
71
87
|
}, {
|
|
72
|
-
option: '
|
|
88
|
+
option: '--recycle'
|
|
89
|
+
}, {
|
|
90
|
+
option: '--bypassSharedLock'
|
|
73
91
|
}, {
|
|
74
92
|
option: '-f, --force'
|
|
75
93
|
});
|
|
76
94
|
}, _SpoPageRemoveCommand_initValidators = function _SpoPageRemoveCommand_initValidators() {
|
|
77
95
|
this.validators.push(async (args) => validation.isValidSharePointUrl(args.options.webUrl));
|
|
96
|
+
}, _SpoPageRemoveCommand_initTypes = function _SpoPageRemoveCommand_initTypes() {
|
|
97
|
+
this.types.string.push('name', 'webUrl');
|
|
98
|
+
this.types.boolean.push('force', 'bypassSharedLock', 'recycle');
|
|
78
99
|
};
|
|
79
100
|
export default new SpoPageRemoveCommand();
|
|
80
101
|
//# sourceMappingURL=page-remove.js.map
|
|
@@ -30,9 +30,7 @@ class SpoPageTemplateListCommand extends SpoCommand {
|
|
|
30
30
|
}
|
|
31
31
|
try {
|
|
32
32
|
const res = await odata.getAllItems(`${args.options.webUrl}/_api/sitepages/pages/templates`);
|
|
33
|
-
|
|
34
|
-
await logger.log(res);
|
|
35
|
-
}
|
|
33
|
+
await logger.log(res);
|
|
36
34
|
}
|
|
37
35
|
catch (err) {
|
|
38
36
|
// The API returns a 404 when no templates are created on the site collection
|
|
@@ -17,6 +17,9 @@ class SpoSiteAdminListCommand extends SpoCommand {
|
|
|
17
17
|
get description() {
|
|
18
18
|
return 'Lists all administrators of a specific SharePoint site';
|
|
19
19
|
}
|
|
20
|
+
defaultProperties() {
|
|
21
|
+
return ['Id', 'LoginName', 'Title', 'PrincipalTypeString'];
|
|
22
|
+
}
|
|
20
23
|
constructor() {
|
|
21
24
|
super();
|
|
22
25
|
_SpoSiteAdminListCommand_instances.add(this);
|
|
@@ -46,20 +49,16 @@ class SpoSiteAdminListCommand extends SpoCommand {
|
|
|
46
49
|
const requestOptions = {
|
|
47
50
|
url: `${adminUrl}/_api/SPO.Tenant/GetSiteAdministrators?siteId='${siteId}'`,
|
|
48
51
|
headers: {
|
|
49
|
-
accept: 'application/json;odata=nometadata'
|
|
50
|
-
|
|
51
|
-
|
|
52
|
+
accept: 'application/json;odata=nometadata'
|
|
53
|
+
},
|
|
54
|
+
responseType: 'json'
|
|
52
55
|
};
|
|
53
56
|
const response = await request.post(requestOptions);
|
|
54
|
-
const responseContent = JSON.parse(response);
|
|
55
57
|
const primaryAdminLoginName = await spo.getPrimaryAdminLoginNameAsAdmin(adminUrl, siteId, logger, this.verbose);
|
|
56
|
-
const mappedResult =
|
|
57
|
-
Id: null,
|
|
58
|
+
const mappedResult = response.value.map((u) => ({
|
|
58
59
|
Email: u.email,
|
|
59
60
|
LoginName: u.loginName,
|
|
60
61
|
Title: u.name,
|
|
61
|
-
PrincipalType: null,
|
|
62
|
-
PrincipalTypeString: null,
|
|
63
62
|
IsPrimaryAdmin: u.loginName === primaryAdminLoginName
|
|
64
63
|
}));
|
|
65
64
|
await logger.log(mappedResult);
|
|
@@ -78,7 +77,6 @@ class SpoSiteAdminListCommand extends SpoCommand {
|
|
|
78
77
|
}
|
|
79
78
|
const requestOptions = {
|
|
80
79
|
url: `${args.options.siteUrl}/_api/web/siteusers?$filter=IsSiteAdmin eq true`,
|
|
81
|
-
method: 'GET',
|
|
82
80
|
headers: {
|
|
83
81
|
'accept': 'application/json;odata=nometadata'
|
|
84
82
|
},
|
|
@@ -114,6 +112,7 @@ _SpoSiteAdminListCommand_instances = new WeakSet(), _SpoSiteAdminListCommand_ini
|
|
|
114
112
|
this.validators.push(async (args) => validation.isValidSharePointUrl(args.options.siteUrl));
|
|
115
113
|
}, _SpoSiteAdminListCommand_initTypes = function _SpoSiteAdminListCommand_initTypes() {
|
|
116
114
|
this.types.string.push('siteUrl');
|
|
115
|
+
this.types.boolean.push('asAdmin');
|
|
117
116
|
};
|
|
118
117
|
export default new SpoSiteAdminListCommand();
|
|
119
118
|
//# sourceMappingURL=site-admin-list.js.map
|
|
@@ -77,11 +77,11 @@ class SpoSiteAdminRemoveCommand extends SpoCommand {
|
|
|
77
77
|
headers: {
|
|
78
78
|
accept: 'application/json;odata=nometadata',
|
|
79
79
|
'content-type': 'application/json;charset=utf-8'
|
|
80
|
-
}
|
|
80
|
+
},
|
|
81
|
+
responseType: 'json'
|
|
81
82
|
};
|
|
82
83
|
const response = await request.post(requestOptions);
|
|
83
|
-
|
|
84
|
-
return responseContent.value;
|
|
84
|
+
return response.value;
|
|
85
85
|
}
|
|
86
86
|
async getCorrectLoginName(options) {
|
|
87
87
|
if (options.userId || options.userName) {
|
|
@@ -116,7 +116,8 @@ class SpoSiteAdminRemoveCommand extends SpoCommand {
|
|
|
116
116
|
siteId: siteId,
|
|
117
117
|
secondaryAdministratorLoginNames: admins.map(u => u.loginName)
|
|
118
118
|
}
|
|
119
|
-
}
|
|
119
|
+
},
|
|
120
|
+
responseType: 'json'
|
|
120
121
|
};
|
|
121
122
|
await request.post(requestOptions);
|
|
122
123
|
}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import SpoCommand from '../../../base/SpoCommand.js';
|
|
2
|
+
import { globalOptionsZod } from '../../../../Command.js';
|
|
3
|
+
import { z } from 'zod';
|
|
4
|
+
import { zod } from '../../../../utils/zod.js';
|
|
5
|
+
import commands from '../../commands.js';
|
|
6
|
+
import { validation } from '../../../../utils/validation.js';
|
|
7
|
+
import request from '../../../../request.js';
|
|
8
|
+
const options = globalOptionsZod
|
|
9
|
+
.extend({
|
|
10
|
+
siteUrl: zod.alias('u', z.string()
|
|
11
|
+
.refine(url => validation.isValidSharePointUrl(url) === true, url => ({
|
|
12
|
+
message: `'${url}' is not a valid SharePoint Online site URL.`
|
|
13
|
+
}))),
|
|
14
|
+
capability: z.enum(['full', 'limited', 'ownersOnly'])
|
|
15
|
+
})
|
|
16
|
+
.strict();
|
|
17
|
+
class SpoSiteSharingPermissionSetCommand extends SpoCommand {
|
|
18
|
+
get name() {
|
|
19
|
+
return commands.SITE_SHARINGPERMISSION_SET;
|
|
20
|
+
}
|
|
21
|
+
get description() {
|
|
22
|
+
return 'Controls how a site and its components can be shared';
|
|
23
|
+
}
|
|
24
|
+
get schema() {
|
|
25
|
+
return options;
|
|
26
|
+
}
|
|
27
|
+
async commandAction(logger, args) {
|
|
28
|
+
try {
|
|
29
|
+
if (this.verbose) {
|
|
30
|
+
await logger.logToStderr(`Updating sharing permissions for site '${args.options.siteUrl}'...`);
|
|
31
|
+
}
|
|
32
|
+
const { capability } = args.options;
|
|
33
|
+
if (this.verbose) {
|
|
34
|
+
await logger.logToStderr(`Updating site sharing permissions...`);
|
|
35
|
+
}
|
|
36
|
+
const requestOptionsWeb = {
|
|
37
|
+
url: `${args.options.siteUrl}/_api/Web`,
|
|
38
|
+
headers: {
|
|
39
|
+
accept: 'application/json;odata=nometadata'
|
|
40
|
+
},
|
|
41
|
+
responseType: 'json',
|
|
42
|
+
data: {
|
|
43
|
+
MembersCanShare: capability === 'full' || capability === 'limited'
|
|
44
|
+
}
|
|
45
|
+
};
|
|
46
|
+
await request.patch(requestOptionsWeb);
|
|
47
|
+
if (this.verbose) {
|
|
48
|
+
await logger.logToStderr(`Updating associated member group sharing permissions...`);
|
|
49
|
+
}
|
|
50
|
+
const requestOptionsMemberGroup = {
|
|
51
|
+
url: `${args.options.siteUrl}/_api/Web/AssociatedMemberGroup`,
|
|
52
|
+
headers: {
|
|
53
|
+
accept: 'application/json;odata=nometadata'
|
|
54
|
+
},
|
|
55
|
+
responseType: 'json',
|
|
56
|
+
data: {
|
|
57
|
+
AllowMembersEditMembership: capability === 'full'
|
|
58
|
+
}
|
|
59
|
+
};
|
|
60
|
+
await request.patch(requestOptionsMemberGroup);
|
|
61
|
+
}
|
|
62
|
+
catch (err) {
|
|
63
|
+
this.handleRejectedODataJsonPromise(err);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
export default new SpoSiteSharingPermissionSetCommand();
|
|
68
|
+
//# sourceMappingURL=site-sharingpermission-set.js.map
|