@pnp/cli-microsoft365 6.0.0-beta.42305df → 6.0.0-beta.49b3c0a
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintrc.js +15 -2
- package/README.md +5 -0
- package/dist/Command.js +16 -2
- package/dist/m365/aad/commands/app/app-add.js +36 -13
- package/dist/m365/commands/status.js +6 -1
- package/dist/m365/outlook/commands/mail/mail-send.js +55 -31
- package/dist/m365/planner/commands/bucket/bucket-get.js +1 -1
- package/dist/m365/planner/commands/plan/plan-get.js +5 -20
- package/dist/m365/pp/commands/Environment.js +3 -0
- package/dist/m365/pp/commands/card/card-get.js +110 -0
- package/dist/m365/pp/commands/card/card-list.js +68 -0
- package/dist/m365/pp/commands/dataverse/dataverse-table-list.js +6 -12
- package/dist/m365/pp/commands/environment/environment-get.js +75 -0
- package/dist/m365/pp/commands/gateway/gateway-get.js +70 -0
- package/dist/m365/pp/commands/solution/Solution.js +3 -0
- package/dist/m365/pp/commands/solution/solution-get.js +117 -0
- package/dist/m365/pp/commands/solution/solution-list.js +87 -0
- package/dist/m365/pp/commands.js +6 -0
- package/dist/m365/spfx/commands/project/project-doctor.js +4 -1
- package/dist/m365/spfx/commands/project/project-externalize.js +4 -1
- package/dist/m365/spfx/commands/project/project-upgrade/rules/FN010001_YORC_version.js +2 -1
- package/dist/m365/spfx/commands/project/project-upgrade/rules/FN010002_YORC_isCreatingSolution.js +2 -1
- package/dist/m365/spfx/commands/project/project-upgrade/rules/FN010003_YORC_packageManager.js +2 -1
- package/dist/m365/spfx/commands/project/project-upgrade/rules/FN010004_YORC_componentType.js +2 -1
- package/dist/m365/spfx/commands/project/project-upgrade/rules/FN010005_YORC_environment.js +2 -1
- package/dist/m365/spfx/commands/project/project-upgrade/rules/FN010006_YORC_framework.js +3 -2
- package/dist/m365/spfx/commands/project/project-upgrade/rules/FN010007_YORC_isDomainIsolated.js +2 -1
- package/dist/m365/spfx/commands/project/project-upgrade/rules/FN010008_YORC_nodeVersion.js +2 -1
- package/dist/m365/spfx/commands/project/project-upgrade/rules/FN010009_YORC_sdkVersions_microsoft_graph_client.js +56 -0
- package/dist/m365/spfx/commands/project/project-upgrade/rules/FN010010_YORC_sdkVersions_teams_js.js +56 -0
- package/dist/m365/spfx/commands/project/project-upgrade/upgrade-1.14.0.js +0 -2
- package/dist/m365/spfx/commands/project/project-upgrade/{upgrade-1.16.0-beta.1.js → upgrade-1.16.0-beta.2.js} +44 -28
- package/dist/m365/spfx/commands/project/project-upgrade.js +1 -1
- package/dist/m365/spfx/commands/spfx-doctor.js +39 -9
- package/dist/m365/spo/commands/contenttype/contenttype-add.js +82 -43
- package/dist/m365/spo/commands/contenttype/contenttype-field-remove.js +53 -21
- package/dist/m365/spo/commands/contenttype/contenttype-get.js +35 -14
- package/dist/m365/spo/commands/eventreceiver/EventReceiver.js +3 -0
- package/dist/m365/spo/commands/eventreceiver/eventreceiver-remove.js +182 -0
- package/dist/m365/spo/commands/file/file-copy.js +25 -39
- package/dist/m365/spo/commands/file/file-move.js +24 -37
- package/dist/m365/spo/commands/file/file-rename.js +19 -16
- package/dist/m365/spo/commands/file/file-roleinheritance-break.js +129 -0
- package/dist/m365/spo/commands/folder/folder-roleassignment-remove.js +168 -0
- package/dist/m365/spo/commands/group/AssociatedGroupPropertiesCollection.js +3 -0
- package/dist/m365/spo/commands/group/group-list.js +49 -10
- package/dist/m365/spo/commands/list/list-contenttype-add.js +21 -18
- package/dist/m365/spo/commands/list/list-contenttype-default-set.js +59 -47
- package/dist/m365/spo/commands/list/list-contenttype-list.js +16 -8
- package/dist/m365/spo/commands/list/list-contenttype-remove.js +16 -8
- package/dist/m365/spo/commands/list/list-roleassignment-add.js +10 -10
- package/dist/m365/spo/commands/list/list-roleassignment-remove.js +8 -8
- package/dist/m365/spo/commands/list/list-roleinheritance-break.js +14 -6
- package/dist/m365/spo/commands/list/list-roleinheritance-reset.js +14 -6
- package/dist/m365/spo/commands/list/list-webhook-add.js +19 -11
- package/dist/m365/spo/commands/list/list-webhook-get.js +17 -10
- package/dist/m365/spo/commands/list/list-webhook-list.js +17 -42
- package/dist/m365/spo/commands/list/list-webhook-remove.js +19 -11
- package/dist/m365/spo/commands/list/list-webhook-set.js +18 -10
- package/dist/m365/spo/commands/listitem/listitem-roleassignment-add.js +239 -0
- package/dist/m365/spo/commands/listitem/listitem-roleassignment-remove.js +8 -8
- package/dist/m365/spo/commands/site/site-add.js +4 -11
- package/dist/m365/spo/commands/{hubsite/hubsite-connect.js → site/site-hubsite-connect.js} +10 -10
- package/dist/m365/spo/commands/{hubsite/hubsite-disconnect.js → site/site-hubsite-disconnect.js} +13 -13
- package/dist/m365/spo/commands/web/web-roleassignment-add.js +10 -10
- package/dist/m365/spo/commands/web/web-roleassignment-remove.js +8 -8
- package/dist/m365/spo/commands.js +6 -2
- package/dist/m365/teams/commands/channel/channel-add.js +9 -9
- package/dist/m365/teams/commands/team/team-set.js +0 -7
- package/dist/m365/todo/commands/task/task-add.js +55 -3
- package/dist/m365/todo/commands/task/task-set.js +53 -1
- package/docs/docs/_clisettings.md +18 -0
- package/docs/docs/cmd/outlook/mail/mail-send.md +13 -0
- package/docs/docs/cmd/planner/bucket/bucket-add.md +29 -0
- package/docs/docs/cmd/planner/bucket/bucket-get.md +29 -0
- package/docs/docs/cmd/planner/bucket/bucket-list.md +30 -0
- package/docs/docs/cmd/planner/bucket/bucket-remove.md +4 -0
- package/docs/docs/cmd/planner/bucket/bucket-set.md +4 -0
- package/docs/docs/cmd/planner/plan/plan-add.md +123 -0
- package/docs/docs/cmd/planner/plan/plan-get.md +75 -6
- package/docs/docs/cmd/planner/plan/plan-list.md +45 -0
- package/docs/docs/cmd/planner/plan/plan-remove.md +4 -0
- package/docs/docs/cmd/planner/task/task-get.md +0 -3
- package/docs/docs/cmd/pp/card/card-get.md +51 -0
- package/docs/docs/cmd/pp/card/card-list.md +33 -0
- package/docs/docs/cmd/pp/dataverse/dataverse-table-list.md +2 -2
- package/docs/docs/cmd/pp/environment/environment-get.md +38 -0
- package/docs/docs/cmd/pp/environment/environment-list.md +1 -1
- package/docs/docs/cmd/pp/gateway/gateway-get.md +24 -0
- package/docs/docs/cmd/pp/solution/solution-get.md +51 -0
- package/docs/docs/cmd/pp/solution/solution-list.md +33 -0
- package/docs/docs/cmd/spfx/project/project-rename.md +1 -14
- package/docs/docs/cmd/spfx/project/project-upgrade.md +1 -1
- package/docs/docs/cmd/spfx/spfx-doctor.md +10 -1
- package/docs/docs/cmd/spo/contenttype/contenttype-add.md +20 -2
- package/docs/docs/cmd/spo/contenttype/contenttype-field-remove.md +22 -4
- package/docs/docs/cmd/spo/contenttype/contenttype-get.md +21 -3
- package/docs/docs/cmd/spo/eventreceiver/eventreceiver-get.md +2 -2
- package/docs/docs/cmd/spo/eventreceiver/eventreceiver-remove.md +69 -0
- package/docs/docs/cmd/spo/file/file-roleinheritance-break.md +54 -0
- package/docs/docs/cmd/spo/folder/folder-roleassignment-remove.md +57 -0
- package/docs/docs/cmd/spo/group/group-list.md +10 -1
- package/docs/docs/cmd/spo/list/list-contenttype-add.md +15 -6
- package/docs/docs/cmd/spo/list/list-contenttype-default-set.md +16 -7
- package/docs/docs/cmd/spo/list/list-contenttype-list.md +15 -6
- package/docs/docs/cmd/spo/list/list-contenttype-remove.md +16 -7
- package/docs/docs/cmd/spo/list/list-roleinheritance-break.md +11 -8
- package/docs/docs/cmd/spo/list/list-roleinheritance-reset.md +16 -7
- package/docs/docs/cmd/spo/list/list-webhook-add.md +15 -16
- package/docs/docs/cmd/spo/list/list-webhook-get.md +17 -8
- package/docs/docs/cmd/spo/list/list-webhook-list.md +13 -10
- package/docs/docs/cmd/spo/list/list-webhook-remove.md +12 -10
- package/docs/docs/cmd/spo/list/list-webhook-set.md +15 -13
- package/docs/docs/cmd/spo/listitem/listitem-roleassignment-add.md +81 -0
- package/docs/docs/cmd/spo/site/site-add.md +0 -3
- package/docs/docs/cmd/spo/{hubsite/hubsite-connect.md → site/site-hubsite-connect.md} +4 -4
- package/docs/docs/cmd/spo/{hubsite/hubsite-disconnect.md → site/site-hubsite-disconnect.md} +7 -7
- package/docs/docs/cmd/teams/channel/channel-add.md +4 -4
- package/docs/docs/cmd/teams/team/team-clone.md +0 -3
- package/docs/docs/cmd/teams/team/team-set.md +0 -3
- package/docs/docs/cmd/todo/task/task-add.md +32 -5
- package/docs/docs/cmd/todo/task/task-set.md +29 -2
- package/package.json +12 -3
- package/dist/m365/spfx/commands/project/project-upgrade/rules/FN006006_CFG_PS_features.js +0 -60
|
@@ -25,7 +25,6 @@ const FN002009_DEVDEP_microsoft_sp_tslint_rules_1 = require("./rules/FN002009_DE
|
|
|
25
25
|
const FN002019_DEVDEP_spfx_fast_serve_helpers_1 = require("./rules/FN002019_DEVDEP_spfx_fast_serve_helpers");
|
|
26
26
|
const FN006004_CFG_PS_developer_1 = require("./rules/FN006004_CFG_PS_developer");
|
|
27
27
|
const FN006005_CFG_PS_metadata_1 = require("./rules/FN006005_CFG_PS_metadata");
|
|
28
|
-
const FN006006_CFG_PS_features_1 = require("./rules/FN006006_CFG_PS_features");
|
|
29
28
|
const FN010001_YORC_version_1 = require("./rules/FN010001_YORC_version");
|
|
30
29
|
const FN014008_CODE_launch_hostedWorkbench_type_1 = require("./rules/FN014008_CODE_launch_hostedWorkbench_type");
|
|
31
30
|
module.exports = [
|
|
@@ -54,7 +53,6 @@ module.exports = [
|
|
|
54
53
|
new FN002019_DEVDEP_spfx_fast_serve_helpers_1.FN002019_DEVDEP_spfx_fast_serve_helpers('1.14.0'),
|
|
55
54
|
new FN006004_CFG_PS_developer_1.FN006004_CFG_PS_developer('1.14.0'),
|
|
56
55
|
new FN006005_CFG_PS_metadata_1.FN006005_CFG_PS_metadata(),
|
|
57
|
-
new FN006006_CFG_PS_features_1.FN006006_CFG_PS_features(),
|
|
58
56
|
new FN010001_YORC_version_1.FN010001_YORC_version('1.14.0'),
|
|
59
57
|
new FN014008_CODE_launch_hostedWorkbench_type_1.FN014008_CODE_launch_hostedWorkbench_type('pwa-chrome')
|
|
60
58
|
];
|
|
@@ -4,6 +4,8 @@ const FN001001_DEP_microsoft_sp_core_library_1 = require("./rules/FN001001_DEP_m
|
|
|
4
4
|
const FN001002_DEP_microsoft_sp_lodash_subset_1 = require("./rules/FN001002_DEP_microsoft_sp_lodash_subset");
|
|
5
5
|
const FN001003_DEP_microsoft_sp_office_ui_fabric_core_1 = require("./rules/FN001003_DEP_microsoft_sp_office_ui_fabric_core");
|
|
6
6
|
const FN001004_DEP_microsoft_sp_webpart_base_1 = require("./rules/FN001004_DEP_microsoft_sp_webpart_base");
|
|
7
|
+
const FN001008_DEP_react_1 = require("./rules/FN001008_DEP_react");
|
|
8
|
+
const FN001009_DEP_react_dom_1 = require("./rules/FN001009_DEP_react_dom");
|
|
7
9
|
const FN001011_DEP_microsoft_sp_dialog_1 = require("./rules/FN001011_DEP_microsoft_sp_dialog");
|
|
8
10
|
const FN001012_DEP_microsoft_sp_application_base_1 = require("./rules/FN001012_DEP_microsoft_sp_application_base");
|
|
9
11
|
const FN001013_DEP_microsoft_decorators_1 = require("./rules/FN001013_DEP_microsoft_decorators");
|
|
@@ -23,39 +25,53 @@ const FN001032_DEP_microsoft_sp_page_context_1 = require("./rules/FN001032_DEP_m
|
|
|
23
25
|
const FN001034_DEP_microsoft_sp_adaptive_card_extension_base_1 = require("./rules/FN001034_DEP_microsoft_sp_adaptive_card_extension_base");
|
|
24
26
|
const FN002001_DEVDEP_microsoft_sp_build_web_1 = require("./rules/FN002001_DEVDEP_microsoft_sp_build_web");
|
|
25
27
|
const FN002002_DEVDEP_microsoft_sp_module_interfaces_1 = require("./rules/FN002002_DEVDEP_microsoft_sp_module_interfaces");
|
|
28
|
+
const FN002015_DEVDEP_types_react_1 = require("./rules/FN002015_DEVDEP_types_react");
|
|
29
|
+
const FN002016_DEVDEP_types_react_dom_1 = require("./rules/FN002016_DEVDEP_types_react_dom");
|
|
26
30
|
const FN002022_DEVDEP_microsoft_eslint_plugin_spfx_1 = require("./rules/FN002022_DEVDEP_microsoft_eslint_plugin_spfx");
|
|
27
31
|
const FN002023_DEVDEP_microsoft_eslint_config_spfx_1 = require("./rules/FN002023_DEVDEP_microsoft_eslint_config_spfx");
|
|
28
32
|
const FN010001_YORC_version_1 = require("./rules/FN010001_YORC_version");
|
|
29
33
|
const FN010008_YORC_nodeVersion_1 = require("./rules/FN010008_YORC_nodeVersion");
|
|
34
|
+
const FN010009_YORC_sdkVersions_microsoft_graph_client_1 = require("./rules/FN010009_YORC_sdkVersions_microsoft_graph_client");
|
|
35
|
+
const FN010010_YORC_sdkVersions_teams_js_1 = require("./rules/FN010010_YORC_sdkVersions_teams_js");
|
|
30
36
|
const FN021003_PKG_engines_node_1 = require("./rules/FN021003_PKG_engines_node");
|
|
37
|
+
const FN022001_SCSS_remove_fabric_react_1 = require("./rules/FN022001_SCSS_remove_fabric_react");
|
|
38
|
+
const FN022002_SCSS_add_fabric_react_1 = require("./rules/FN022002_SCSS_add_fabric_react");
|
|
31
39
|
module.exports = [
|
|
32
|
-
new FN001001_DEP_microsoft_sp_core_library_1.FN001001_DEP_microsoft_sp_core_library('1.16.0-beta.
|
|
33
|
-
new
|
|
34
|
-
new
|
|
35
|
-
new
|
|
36
|
-
new
|
|
37
|
-
new
|
|
38
|
-
new
|
|
39
|
-
new
|
|
40
|
-
new
|
|
41
|
-
new
|
|
42
|
-
new
|
|
43
|
-
new
|
|
44
|
-
new
|
|
45
|
-
new
|
|
46
|
-
new
|
|
47
|
-
new
|
|
48
|
-
new
|
|
49
|
-
new
|
|
50
|
-
new
|
|
51
|
-
new
|
|
52
|
-
new
|
|
53
|
-
new
|
|
54
|
-
new
|
|
55
|
-
new
|
|
56
|
-
new
|
|
57
|
-
new
|
|
40
|
+
new FN001001_DEP_microsoft_sp_core_library_1.FN001001_DEP_microsoft_sp_core_library('1.16.0-beta.2'),
|
|
41
|
+
new FN001002_DEP_microsoft_sp_lodash_subset_1.FN001002_DEP_microsoft_sp_lodash_subset('1.16.0-beta.2'),
|
|
42
|
+
new FN001003_DEP_microsoft_sp_office_ui_fabric_core_1.FN001003_DEP_microsoft_sp_office_ui_fabric_core('1.16.0-beta.2'),
|
|
43
|
+
new FN001004_DEP_microsoft_sp_webpart_base_1.FN001004_DEP_microsoft_sp_webpart_base('1.16.0-beta.2'),
|
|
44
|
+
new FN001008_DEP_react_1.FN001008_DEP_react('17.0.1'),
|
|
45
|
+
new FN001009_DEP_react_dom_1.FN001009_DEP_react_dom('17.0.1'),
|
|
46
|
+
new FN001011_DEP_microsoft_sp_dialog_1.FN001011_DEP_microsoft_sp_dialog('1.16.0-beta.2'),
|
|
47
|
+
new FN001012_DEP_microsoft_sp_application_base_1.FN001012_DEP_microsoft_sp_application_base('1.16.0-beta.2'),
|
|
48
|
+
new FN001014_DEP_microsoft_sp_listview_extensibility_1.FN001014_DEP_microsoft_sp_listview_extensibility('1.16.0-beta.2'),
|
|
49
|
+
new FN001021_DEP_microsoft_sp_property_pane_1.FN001021_DEP_microsoft_sp_property_pane('1.16.0-beta.2'),
|
|
50
|
+
new FN001022_DEP_office_ui_fabric_react_1.FN001022_DEP_office_ui_fabric_react('7.199.1'),
|
|
51
|
+
new FN001023_DEP_microsoft_sp_component_base_1.FN001023_DEP_microsoft_sp_component_base('1.16.0-beta.2'),
|
|
52
|
+
new FN001024_DEP_microsoft_sp_diagnostics_1.FN001024_DEP_microsoft_sp_diagnostics('1.16.0-beta.2'),
|
|
53
|
+
new FN001025_DEP_microsoft_sp_dynamic_data_1.FN001025_DEP_microsoft_sp_dynamic_data('1.16.0-beta.2'),
|
|
54
|
+
new FN001026_DEP_microsoft_sp_extension_base_1.FN001026_DEP_microsoft_sp_extension_base('1.16.0-beta.2'),
|
|
55
|
+
new FN001027_DEP_microsoft_sp_http_1.FN001027_DEP_microsoft_sp_http('1.16.0-beta.2'),
|
|
56
|
+
new FN001028_DEP_microsoft_sp_list_subscription_1.FN001028_DEP_microsoft_sp_list_subscription('1.16.0-beta.2'),
|
|
57
|
+
new FN001029_DEP_microsoft_sp_loader_1.FN001029_DEP_microsoft_sp_loader('1.16.0-beta.2'),
|
|
58
|
+
new FN001030_DEP_microsoft_sp_module_interfaces_1.FN001030_DEP_microsoft_sp_module_interfaces('1.16.0-beta.2'),
|
|
59
|
+
new FN001031_DEP_microsoft_sp_odata_types_1.FN001031_DEP_microsoft_sp_odata_types('1.16.0-beta.2'),
|
|
60
|
+
new FN001032_DEP_microsoft_sp_page_context_1.FN001032_DEP_microsoft_sp_page_context('1.16.0-beta.2'),
|
|
61
|
+
new FN001013_DEP_microsoft_decorators_1.FN001013_DEP_microsoft_decorators('1.16.0-beta.2'),
|
|
62
|
+
new FN001034_DEP_microsoft_sp_adaptive_card_extension_base_1.FN001034_DEP_microsoft_sp_adaptive_card_extension_base('1.16.0-beta.2'),
|
|
63
|
+
new FN002022_DEVDEP_microsoft_eslint_plugin_spfx_1.FN002022_DEVDEP_microsoft_eslint_plugin_spfx('1.16.0-beta.2'),
|
|
64
|
+
new FN002023_DEVDEP_microsoft_eslint_config_spfx_1.FN002023_DEVDEP_microsoft_eslint_config_spfx('1.16.0-beta.2'),
|
|
65
|
+
new FN002001_DEVDEP_microsoft_sp_build_web_1.FN002001_DEVDEP_microsoft_sp_build_web('1.16.0-beta.2'),
|
|
66
|
+
new FN002002_DEVDEP_microsoft_sp_module_interfaces_1.FN002002_DEVDEP_microsoft_sp_module_interfaces('1.16.0-beta.2'),
|
|
67
|
+
new FN002015_DEVDEP_types_react_1.FN002015_DEVDEP_types_react('17.0.45'),
|
|
68
|
+
new FN002016_DEVDEP_types_react_dom_1.FN002016_DEVDEP_types_react_dom('17.0.17'),
|
|
69
|
+
new FN010001_YORC_version_1.FN010001_YORC_version('1.16.0-beta.2'),
|
|
58
70
|
new FN010008_YORC_nodeVersion_1.FN010008_YORC_nodeVersion(),
|
|
59
|
-
new
|
|
71
|
+
new FN010009_YORC_sdkVersions_microsoft_graph_client_1.FN010009_YORC_sdkVersions_microsoft_graph_client('3.0.2'),
|
|
72
|
+
new FN010010_YORC_sdkVersions_teams_js_1.FN010010_YORC_sdkVersions_teams_js('2.4.1'),
|
|
73
|
+
new FN021003_PKG_engines_node_1.FN021003_PKG_engines_node('>=16.13.0 <17.0.0'),
|
|
74
|
+
new FN022001_SCSS_remove_fabric_react_1.FN022001_SCSS_remove_fabric_react('~office-ui-fabric-react/dist/sass/References.scss'),
|
|
75
|
+
new FN022002_SCSS_add_fabric_react_1.FN022002_SCSS_add_fabric_react('~@fluentui/react/dist/sass/References.scss')
|
|
60
76
|
];
|
|
61
|
-
//# sourceMappingURL=upgrade-1.16.0-beta.
|
|
77
|
+
//# sourceMappingURL=upgrade-1.16.0-beta.2.js.map
|
|
@@ -66,7 +66,7 @@ class SpfxProjectUpgradeCommand extends base_project_command_1.BaseProjectComman
|
|
|
66
66
|
'1.14.0',
|
|
67
67
|
'1.15.0',
|
|
68
68
|
'1.15.2',
|
|
69
|
-
'1.16.0-beta.
|
|
69
|
+
'1.16.0-beta.2'
|
|
70
70
|
];
|
|
71
71
|
__classPrivateFieldGet(this, _SpfxProjectUpgradeCommand_instances, "m", _SpfxProjectUpgradeCommand_initTelemetry).call(this);
|
|
72
72
|
__classPrivateFieldGet(this, _SpfxProjectUpgradeCommand_instances, "m", _SpfxProjectUpgradeCommand_initOptions).call(this);
|
|
@@ -13,7 +13,7 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
|
|
|
13
13
|
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");
|
|
14
14
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
15
15
|
};
|
|
16
|
-
var _SpfxDoctorCommand_instances, _SpfxDoctorCommand_initTelemetry, _SpfxDoctorCommand_initOptions, _SpfxDoctorCommand_initValidators
|
|
16
|
+
var _SpfxDoctorCommand_instances, _SpfxDoctorCommand_initTelemetry, _SpfxDoctorCommand_initOptions, _SpfxDoctorCommand_initValidators;
|
|
17
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
18
|
const chalk = require("chalk");
|
|
19
19
|
const child_process = require("child_process");
|
|
@@ -448,7 +448,9 @@ class SpfxDoctorCommand extends AnonymousCommand_1.default {
|
|
|
448
448
|
__classPrivateFieldGet(this, _SpfxDoctorCommand_instances, "m", _SpfxDoctorCommand_initTelemetry).call(this);
|
|
449
449
|
__classPrivateFieldGet(this, _SpfxDoctorCommand_instances, "m", _SpfxDoctorCommand_initOptions).call(this);
|
|
450
450
|
__classPrivateFieldGet(this, _SpfxDoctorCommand_instances, "m", _SpfxDoctorCommand_initValidators).call(this);
|
|
451
|
-
|
|
451
|
+
}
|
|
452
|
+
get allowedOutputs() {
|
|
453
|
+
return ['text'];
|
|
452
454
|
}
|
|
453
455
|
get name() {
|
|
454
456
|
return commands_1.default.DOCTOR;
|
|
@@ -457,6 +459,7 @@ class SpfxDoctorCommand extends AnonymousCommand_1.default {
|
|
|
457
459
|
return 'Verifies environment configuration for using the specific version of the SharePoint Framework';
|
|
458
460
|
}
|
|
459
461
|
commandAction(logger, args) {
|
|
462
|
+
var _a;
|
|
460
463
|
return __awaiter(this, void 0, void 0, function* () {
|
|
461
464
|
if (!args.options.output) {
|
|
462
465
|
args.options.output = 'text';
|
|
@@ -469,7 +472,7 @@ class SpfxDoctorCommand extends AnonymousCommand_1.default {
|
|
|
469
472
|
let prerequisites;
|
|
470
473
|
const fixes = [];
|
|
471
474
|
try {
|
|
472
|
-
spfxVersion = yield this.getSharePointFrameworkVersion(logger);
|
|
475
|
+
spfxVersion = (_a = args.options.spfxVersion) !== null && _a !== void 0 ? _a : yield this.getSharePointFrameworkVersion(logger);
|
|
473
476
|
if (!spfxVersion) {
|
|
474
477
|
logger.log(this.getStatus(CheckStatus.Failure, `SharePoint Framework`));
|
|
475
478
|
throw `SharePoint Framework not found`;
|
|
@@ -479,7 +482,13 @@ class SpfxDoctorCommand extends AnonymousCommand_1.default {
|
|
|
479
482
|
logger.log(this.getStatus(CheckStatus.Failure, `SharePoint Framework v${spfxVersion}`));
|
|
480
483
|
throw `spfx doctor doesn't support SPFx v${spfxVersion} at this moment`;
|
|
481
484
|
}
|
|
482
|
-
|
|
485
|
+
if (args.options.spfxVersion) {
|
|
486
|
+
yield this.checkSharePointFrameworkVersion(args.options.spfxVersion, fixes, logger);
|
|
487
|
+
}
|
|
488
|
+
else {
|
|
489
|
+
// spfx was detected and if we are here, it means that we support it
|
|
490
|
+
logger.log(this.getStatus(CheckStatus.Success, `SharePoint Framework v${spfxVersion}`));
|
|
491
|
+
}
|
|
483
492
|
yield this.checkSharePointCompatibility(spfxVersion, prerequisites, args, fixes, logger);
|
|
484
493
|
yield this.checkNodeVersion(prerequisites, fixes, logger);
|
|
485
494
|
yield this.checkYo(prerequisites, fixes, logger);
|
|
@@ -532,6 +541,23 @@ class SpfxDoctorCommand extends AnonymousCommand_1.default {
|
|
|
532
541
|
this.checkStatus('Node', nodeVersion, prerequisites.node, OptionalOrRequired.Required, fixes, logger);
|
|
533
542
|
});
|
|
534
543
|
}
|
|
544
|
+
checkSharePointFrameworkVersion(spfxVersionRequested, fixes, logger) {
|
|
545
|
+
return this
|
|
546
|
+
.getPackageVersion('@microsoft/generator-sharepoint', PackageSearchMode.GlobalOnly, HandlePromise.Continue, logger)
|
|
547
|
+
.then((spfxVersionDetected) => {
|
|
548
|
+
const versionCheck = {
|
|
549
|
+
range: spfxVersionRequested,
|
|
550
|
+
fix: `npm i -g @microsoft/generator-sharepoint@${spfxVersionRequested}`
|
|
551
|
+
};
|
|
552
|
+
if (spfxVersionDetected) {
|
|
553
|
+
this.checkStatus(`SharePoint Framework`, spfxVersionDetected, versionCheck, OptionalOrRequired.Required, fixes, logger);
|
|
554
|
+
}
|
|
555
|
+
else {
|
|
556
|
+
logger.log(this.getStatus(CheckStatus.Failure, `SharePoint Framework v${spfxVersionRequested} not found`));
|
|
557
|
+
fixes.push(versionCheck.fix);
|
|
558
|
+
}
|
|
559
|
+
});
|
|
560
|
+
}
|
|
535
561
|
checkYo(prerequisites, fixes, logger) {
|
|
536
562
|
return this
|
|
537
563
|
.getPackageVersion('yo', PackageSearchMode.GlobalOnly, HandlePromise.Continue, logger)
|
|
@@ -710,13 +736,17 @@ class SpfxDoctorCommand extends AnonymousCommand_1.default {
|
|
|
710
736
|
_SpfxDoctorCommand_instances = new WeakSet(), _SpfxDoctorCommand_initTelemetry = function _SpfxDoctorCommand_initTelemetry() {
|
|
711
737
|
this.telemetry.push((args) => {
|
|
712
738
|
Object.assign(this.telemetryProperties, {
|
|
713
|
-
env: args.options.env
|
|
739
|
+
env: args.options.env,
|
|
740
|
+
spfxVersion: args.options.spfxVersion
|
|
714
741
|
});
|
|
715
742
|
});
|
|
716
743
|
}, _SpfxDoctorCommand_initOptions = function _SpfxDoctorCommand_initOptions() {
|
|
717
744
|
this.options.unshift({
|
|
718
745
|
option: '-e, --env [env]',
|
|
719
746
|
autocomplete: ['sp2016', 'sp2019', 'spo']
|
|
747
|
+
}, {
|
|
748
|
+
option: '-v, --spfxVersion [spfxVersion]',
|
|
749
|
+
autocomplete: Object.keys(this.versions)
|
|
720
750
|
});
|
|
721
751
|
}, _SpfxDoctorCommand_initValidators = function _SpfxDoctorCommand_initValidators() {
|
|
722
752
|
this.validators.push((args) => __awaiter(this, void 0, void 0, function* () {
|
|
@@ -726,13 +756,13 @@ _SpfxDoctorCommand_instances = new WeakSet(), _SpfxDoctorCommand_initTelemetry =
|
|
|
726
756
|
return `${args.options.env} is not a valid SharePoint version. Valid versions are sp2016, sp2019 or spo`;
|
|
727
757
|
}
|
|
728
758
|
}
|
|
729
|
-
if (args.options.
|
|
730
|
-
|
|
759
|
+
if (args.options.spfxVersion) {
|
|
760
|
+
if (!this.versions[args.options.spfxVersion]) {
|
|
761
|
+
return `${args.options.spfxVersion} is not a supported SharePoint Framework version. Supported versions are ${Object.keys(this.versions).join(', ')}`;
|
|
762
|
+
}
|
|
731
763
|
}
|
|
732
764
|
return true;
|
|
733
765
|
}));
|
|
734
|
-
}, _SpfxDoctorCommand_initTypes = function _SpfxDoctorCommand_initTypes() {
|
|
735
|
-
this.types.string.push('e', 'env');
|
|
736
766
|
};
|
|
737
767
|
module.exports = new SpfxDoctorCommand();
|
|
738
768
|
//# sourceMappingURL=spfx-doctor.js.map
|
|
@@ -20,6 +20,7 @@ const config_1 = require("../../../../config");
|
|
|
20
20
|
const request_1 = require("../../../../request");
|
|
21
21
|
const formatting_1 = require("../../../../utils/formatting");
|
|
22
22
|
const spo_1 = require("../../../../utils/spo");
|
|
23
|
+
const urlUtil_1 = require("../../../../utils/urlUtil");
|
|
23
24
|
const validation_1 = require("../../../../utils/validation");
|
|
24
25
|
const SpoCommand_1 = require("../../../base/SpoCommand");
|
|
25
26
|
const commands_1 = require("../../commands");
|
|
@@ -42,7 +43,13 @@ class SpoContentTypeAddCommand extends SpoCommand_1.default {
|
|
|
42
43
|
commandAction(logger, args) {
|
|
43
44
|
return __awaiter(this, void 0, void 0, function* () {
|
|
44
45
|
try {
|
|
45
|
-
|
|
46
|
+
let parentInfo = '';
|
|
47
|
+
if (!args.options.listId && !args.options.listTitle && !args.options.listUrl) {
|
|
48
|
+
parentInfo = '<Property Id="5" ParentId="3" Name="Web" /><StaticProperty Id="3" TypeId="{3747adcd-a3c3-41b9-bfab-4a64dd2f1e0a}" Name="Current" />';
|
|
49
|
+
}
|
|
50
|
+
else {
|
|
51
|
+
parentInfo = yield this.getParentInfo(args.options, logger);
|
|
52
|
+
}
|
|
46
53
|
if (this.verbose) {
|
|
47
54
|
logger.logToStderr(`Retrieving request digest...`);
|
|
48
55
|
}
|
|
@@ -69,6 +76,8 @@ class SpoContentTypeAddCommand extends SpoCommand_1.default {
|
|
|
69
76
|
const options = {
|
|
70
77
|
webUrl: args.options.webUrl,
|
|
71
78
|
listTitle: args.options.listTitle,
|
|
79
|
+
listUrl: args.options.listUrl,
|
|
80
|
+
listId: args.options.listId,
|
|
72
81
|
id: args.options.id,
|
|
73
82
|
output: 'json',
|
|
74
83
|
debug: this.debug,
|
|
@@ -90,60 +99,79 @@ class SpoContentTypeAddCommand extends SpoCommand_1.default {
|
|
|
90
99
|
}
|
|
91
100
|
});
|
|
92
101
|
}
|
|
93
|
-
getParentInfo(
|
|
94
|
-
return
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
102
|
+
getParentInfo(options, logger) {
|
|
103
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
104
|
+
const siteId = yield this.getSiteId(options.webUrl, logger);
|
|
105
|
+
const webId = yield this.getWebId(options.webUrl, logger);
|
|
106
|
+
const listId = yield this.getListId(options, logger);
|
|
107
|
+
return `<Identity Id="5" Name="1a48869e-c092-0000-1f61-81ec89809537|740c6a0b-85e2-48a0-a494-e0f1759d4aa7:site:${siteId}:web:${webId}:list:${listId}" />`;
|
|
108
|
+
});
|
|
109
|
+
}
|
|
110
|
+
getSiteId(webUrl, logger) {
|
|
111
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
112
|
+
if (this.verbose) {
|
|
113
|
+
logger.logToStderr(`Retrieving site collection id...`);
|
|
98
114
|
}
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
115
|
+
const requestOptions = {
|
|
116
|
+
url: `${webUrl}/_api/site?$select=Id`,
|
|
117
|
+
headers: {
|
|
118
|
+
accept: 'application/json;odata=nometadata'
|
|
119
|
+
},
|
|
120
|
+
responseType: 'json'
|
|
121
|
+
};
|
|
122
|
+
const siteResponse = yield request_1.default.get(requestOptions);
|
|
123
|
+
return siteResponse.Id;
|
|
124
|
+
});
|
|
125
|
+
}
|
|
126
|
+
getWebId(webUrl, logger) {
|
|
127
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
128
|
+
if (this.verbose) {
|
|
129
|
+
logger.logToStderr(`Retrieving web id...`);
|
|
130
|
+
}
|
|
131
|
+
const requestOptions = {
|
|
132
|
+
url: `${webUrl}/_api/web?$select=Id`,
|
|
133
|
+
headers: {
|
|
134
|
+
accept: 'application/json;odata=nometadata'
|
|
135
|
+
},
|
|
136
|
+
responseType: 'json'
|
|
137
|
+
};
|
|
138
|
+
const webResponse = yield request_1.default.get(requestOptions);
|
|
139
|
+
return webResponse.Id;
|
|
140
|
+
});
|
|
141
|
+
}
|
|
142
|
+
getListId(options, logger) {
|
|
143
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
144
|
+
if (this.verbose) {
|
|
145
|
+
logger.logToStderr(`Retrieving list id...`);
|
|
146
|
+
}
|
|
147
|
+
let listId = '';
|
|
148
|
+
if (options.listId) {
|
|
149
|
+
return options.listId;
|
|
150
|
+
}
|
|
151
|
+
else if (options.listTitle) {
|
|
119
152
|
const requestOptions = {
|
|
120
|
-
url: `${webUrl}/_api/web?$select=Id`,
|
|
153
|
+
url: `${options.webUrl}/_api/web/lists/getByTitle('${formatting_1.formatting.encodeQueryParameter(options.listTitle)}')?$select=Id`,
|
|
121
154
|
headers: {
|
|
122
155
|
accept: 'application/json;odata=nometadata'
|
|
123
156
|
},
|
|
124
157
|
responseType: 'json'
|
|
125
158
|
};
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
logger.logToStderr(`Retrieving list id...`);
|
|
132
|
-
}
|
|
159
|
+
const listResponse = yield request_1.default.get(requestOptions);
|
|
160
|
+
listId = listResponse.Id;
|
|
161
|
+
}
|
|
162
|
+
else if (options.listUrl) {
|
|
163
|
+
const listServerRelativeUrl = urlUtil_1.urlUtil.getServerRelativePath(options.webUrl, options.listUrl);
|
|
133
164
|
const requestOptions = {
|
|
134
|
-
url: `${webUrl}/_api/web/
|
|
165
|
+
url: `${options.webUrl}/_api/web/GetList('${formatting_1.formatting.encodeQueryParameter(listServerRelativeUrl)}')?$select=Id`,
|
|
135
166
|
headers: {
|
|
136
167
|
accept: 'application/json;odata=nometadata'
|
|
137
168
|
},
|
|
138
169
|
responseType: 'json'
|
|
139
170
|
};
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
}, (error) => {
|
|
145
|
-
reject(error);
|
|
146
|
-
});
|
|
171
|
+
const listResponse = yield request_1.default.get(requestOptions);
|
|
172
|
+
listId = listResponse.Id;
|
|
173
|
+
}
|
|
174
|
+
return listId;
|
|
147
175
|
});
|
|
148
176
|
}
|
|
149
177
|
}
|
|
@@ -160,6 +188,10 @@ _SpoContentTypeAddCommand_instances = new WeakSet(), _SpoContentTypeAddCommand_i
|
|
|
160
188
|
option: '-u, --webUrl <webUrl>'
|
|
161
189
|
}, {
|
|
162
190
|
option: '-l, --listTitle [listTitle]'
|
|
191
|
+
}, {
|
|
192
|
+
option: '--listId [listId]'
|
|
193
|
+
}, {
|
|
194
|
+
option: '--listUrl [listUrl]'
|
|
163
195
|
}, {
|
|
164
196
|
option: '-i, --id <id>'
|
|
165
197
|
}, {
|
|
@@ -170,7 +202,14 @@ _SpoContentTypeAddCommand_instances = new WeakSet(), _SpoContentTypeAddCommand_i
|
|
|
170
202
|
option: '-g, --group [group]'
|
|
171
203
|
});
|
|
172
204
|
}, _SpoContentTypeAddCommand_initValidators = function _SpoContentTypeAddCommand_initValidators() {
|
|
173
|
-
this.validators.push((args) => __awaiter(this, void 0, void 0, function* () {
|
|
205
|
+
this.validators.push((args) => __awaiter(this, void 0, void 0, function* () {
|
|
206
|
+
if (args.options.listId) {
|
|
207
|
+
if (!validation_1.validation.isValidGuid(args.options.listId)) {
|
|
208
|
+
return `${args.options.listId} is not a valid GUID`;
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
return validation_1.validation.isValidSharePointUrl(args.options.webUrl);
|
|
212
|
+
}));
|
|
174
213
|
}, _SpoContentTypeAddCommand_initTypes = function _SpoContentTypeAddCommand_initTypes() {
|
|
175
214
|
this.types.string.push('id', 'i');
|
|
176
215
|
};
|
|
@@ -19,6 +19,7 @@ const Cli_1 = require("../../../../cli/Cli");
|
|
|
19
19
|
const request_1 = require("../../../../request");
|
|
20
20
|
const formatting_1 = require("../../../../utils/formatting");
|
|
21
21
|
const spo_1 = require("../../../../utils/spo");
|
|
22
|
+
const urlUtil_1 = require("../../../../utils/urlUtil");
|
|
22
23
|
const validation_1 = require("../../../../utils/validation");
|
|
23
24
|
const SpoCommand_1 = require("../../../base/SpoCommand");
|
|
24
25
|
const commands_1 = require("../../commands");
|
|
@@ -72,30 +73,25 @@ class SpoContentTypeFieldRemoveCommand extends SpoCommand_1.default {
|
|
|
72
73
|
logger.logToStderr(`WebId: ${webId}`);
|
|
73
74
|
}
|
|
74
75
|
let listId = undefined;
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
listId = list.Id;
|
|
87
|
-
if (this.debug) {
|
|
88
|
-
logger.logToStderr(`ListId: ${listId}`);
|
|
89
|
-
}
|
|
76
|
+
if (args.options.listId) {
|
|
77
|
+
listId = args.options.listId;
|
|
78
|
+
}
|
|
79
|
+
else if (args.options.listTitle) {
|
|
80
|
+
listId = yield this.getListIdFromListTitle(args.options.webUrl, args.options.listTitle);
|
|
81
|
+
}
|
|
82
|
+
else if (args.options.listUrl) {
|
|
83
|
+
listId = yield this.getListIdFromListUrl(args.options.webUrl, args.options.listUrl);
|
|
84
|
+
}
|
|
85
|
+
if (this.debug) {
|
|
86
|
+
logger.logToStderr(`ListId: ${listId}`);
|
|
90
87
|
}
|
|
91
88
|
const reqDigest = yield spo_1.spo.getRequestDigest(args.options.webUrl);
|
|
92
89
|
const requestDigest = reqDigest.FormDigestValue;
|
|
93
|
-
const updateChildContentTypes = args.options.listTitle ? false : args.options.updateChildContentTypes === true;
|
|
90
|
+
const updateChildContentTypes = args.options.listTitle || args.options.listId || args.options.listUrl ? false : args.options.updateChildContentTypes === true;
|
|
94
91
|
if (this.debug) {
|
|
95
|
-
const additionalLog = args.options.listTitle ? `; ListTitle='${args.options.listTitle}'` : ` ; UpdateChildContentTypes='${updateChildContentTypes}`;
|
|
92
|
+
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}`;
|
|
96
93
|
logger.logToStderr(`Remove FieldLink from ContentType. FieldLinkId='${args.options.fieldLinkId}' ; ContentTypeId='${args.options.contentTypeId}' ${additionalLog}`);
|
|
97
94
|
logger.logToStderr(`Execute ProcessQuery.`);
|
|
98
|
-
logger.logToStderr('');
|
|
99
95
|
}
|
|
100
96
|
let requestBody = '';
|
|
101
97
|
if (listId) {
|
|
@@ -138,13 +134,42 @@ class SpoContentTypeFieldRemoveCommand extends SpoCommand_1.default {
|
|
|
138
134
|
}
|
|
139
135
|
});
|
|
140
136
|
}
|
|
137
|
+
getListIdFromListTitle(webUrl, listTitle) {
|
|
138
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
139
|
+
const requestOptions = {
|
|
140
|
+
url: `${webUrl}/_api/lists/GetByTitle('${formatting_1.formatting.encodeQueryParameter(listTitle)}')?$select=Id`,
|
|
141
|
+
headers: {
|
|
142
|
+
accept: 'application/json;odata=nometadata'
|
|
143
|
+
},
|
|
144
|
+
responseType: 'json'
|
|
145
|
+
};
|
|
146
|
+
const list = yield request_1.default.get(requestOptions);
|
|
147
|
+
return list.Id;
|
|
148
|
+
});
|
|
149
|
+
}
|
|
150
|
+
getListIdFromListUrl(webUrl, listUrl) {
|
|
151
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
152
|
+
const listServerRelativeUrl = urlUtil_1.urlUtil.getServerRelativePath(webUrl, listUrl);
|
|
153
|
+
const requestOptions = {
|
|
154
|
+
url: `${webUrl}/_api/web/GetList('${formatting_1.formatting.encodeQueryParameter(listServerRelativeUrl)}')?$select=Id`,
|
|
155
|
+
headers: {
|
|
156
|
+
accept: 'application/json;odata=nometadata'
|
|
157
|
+
},
|
|
158
|
+
responseType: 'json'
|
|
159
|
+
};
|
|
160
|
+
const list = yield request_1.default.get(requestOptions);
|
|
161
|
+
return list.Id;
|
|
162
|
+
});
|
|
163
|
+
}
|
|
141
164
|
}
|
|
142
165
|
_SpoContentTypeFieldRemoveCommand_instances = new WeakSet(), _SpoContentTypeFieldRemoveCommand_initTelemetry = function _SpoContentTypeFieldRemoveCommand_initTelemetry() {
|
|
143
166
|
this.telemetry.push((args) => {
|
|
144
167
|
Object.assign(this.telemetryProperties, {
|
|
145
|
-
listTitle:
|
|
146
|
-
|
|
147
|
-
|
|
168
|
+
listTitle: typeof args.options.listTitle !== 'undefined',
|
|
169
|
+
listId: typeof args.options.listId !== 'undefined',
|
|
170
|
+
listUrl: typeof args.options.listUrl !== 'undefined',
|
|
171
|
+
updateChildContentTypes: !!args.options.updateChildContentTypes,
|
|
172
|
+
confirm: !!args.options.confirm
|
|
148
173
|
});
|
|
149
174
|
});
|
|
150
175
|
}, _SpoContentTypeFieldRemoveCommand_initOptions = function _SpoContentTypeFieldRemoveCommand_initOptions() {
|
|
@@ -152,6 +177,10 @@ _SpoContentTypeFieldRemoveCommand_instances = new WeakSet(), _SpoContentTypeFiel
|
|
|
152
177
|
option: '-u, --webUrl <webUrl>'
|
|
153
178
|
}, {
|
|
154
179
|
option: '-l, --listTitle [listTitle]'
|
|
180
|
+
}, {
|
|
181
|
+
option: '--listId [listId]'
|
|
182
|
+
}, {
|
|
183
|
+
option: '--listUrl [listUrl]'
|
|
155
184
|
}, {
|
|
156
185
|
option: '-i, --contentTypeId <contentTypeId>'
|
|
157
186
|
}, {
|
|
@@ -166,6 +195,9 @@ _SpoContentTypeFieldRemoveCommand_instances = new WeakSet(), _SpoContentTypeFiel
|
|
|
166
195
|
if (!validation_1.validation.isValidGuid(args.options.fieldLinkId)) {
|
|
167
196
|
return `${args.options.fieldLinkId} is not a valid GUID`;
|
|
168
197
|
}
|
|
198
|
+
if (args.options.listId && !validation_1.validation.isValidGuid(args.options.listId)) {
|
|
199
|
+
return `${args.options.listId} is not a valid GUID`;
|
|
200
|
+
}
|
|
169
201
|
return validation_1.validation.isValidSharePointUrl(args.options.webUrl);
|
|
170
202
|
}));
|
|
171
203
|
}, _SpoContentTypeFieldRemoveCommand_initTypes = function _SpoContentTypeFieldRemoveCommand_initTypes() {
|
|
@@ -17,6 +17,7 @@ var _SpoContentTypeGetCommand_instances, _SpoContentTypeGetCommand_initTelemetry
|
|
|
17
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
18
|
const request_1 = require("../../../../request");
|
|
19
19
|
const formatting_1 = require("../../../../utils/formatting");
|
|
20
|
+
const urlUtil_1 = require("../../../../utils/urlUtil");
|
|
20
21
|
const validation_1 = require("../../../../utils/validation");
|
|
21
22
|
const SpoCommand_1 = require("../../../base/SpoCommand");
|
|
22
23
|
const commands_1 = require("../../commands");
|
|
@@ -38,21 +39,32 @@ class SpoContentTypeGetCommand extends SpoCommand_1.default {
|
|
|
38
39
|
}
|
|
39
40
|
commandAction(logger, args) {
|
|
40
41
|
return __awaiter(this, void 0, void 0, function* () {
|
|
42
|
+
let requestUrl = `${args.options.webUrl}/_api/web`;
|
|
43
|
+
if (args.options.listId) {
|
|
44
|
+
requestUrl += `/lists(guid'${formatting_1.formatting.encodeQueryParameter(args.options.listId)}')`;
|
|
45
|
+
}
|
|
46
|
+
else if (args.options.listTitle) {
|
|
47
|
+
requestUrl += `/lists/getByTitle('${formatting_1.formatting.encodeQueryParameter(args.options.listTitle)}')`;
|
|
48
|
+
}
|
|
49
|
+
else if (args.options.listUrl) {
|
|
50
|
+
const listServerRelativeUrl = urlUtil_1.urlUtil.getServerRelativePath(args.options.webUrl, args.options.listUrl);
|
|
51
|
+
requestUrl += `/GetList('${formatting_1.formatting.encodeQueryParameter(listServerRelativeUrl)}')`;
|
|
52
|
+
}
|
|
53
|
+
requestUrl += "/contenttypes";
|
|
54
|
+
if (args.options.id) {
|
|
55
|
+
requestUrl += `('${encodeURIComponent(args.options.id)}')`;
|
|
56
|
+
}
|
|
57
|
+
else if (args.options.name) {
|
|
58
|
+
requestUrl += `?$filter=Name eq '${encodeURIComponent(args.options.name)}'`;
|
|
59
|
+
}
|
|
60
|
+
const requestOptions = {
|
|
61
|
+
url: requestUrl,
|
|
62
|
+
headers: {
|
|
63
|
+
accept: 'application/json;odata=nometadata'
|
|
64
|
+
},
|
|
65
|
+
responseType: 'json'
|
|
66
|
+
};
|
|
41
67
|
try {
|
|
42
|
-
let requestUrl = `${args.options.webUrl}/_api/web/${(args.options.listTitle ? `lists/getByTitle('${formatting_1.formatting.encodeQueryParameter(args.options.listTitle)}')/` : '')}contenttypes`;
|
|
43
|
-
if (args.options.id) {
|
|
44
|
-
requestUrl += `('${encodeURIComponent(args.options.id)}')`;
|
|
45
|
-
}
|
|
46
|
-
else if (args.options.name) {
|
|
47
|
-
requestUrl += `?$filter=Name eq '${encodeURIComponent(args.options.name)}'`;
|
|
48
|
-
}
|
|
49
|
-
const requestOptions = {
|
|
50
|
-
url: requestUrl,
|
|
51
|
-
headers: {
|
|
52
|
-
accept: 'application/json;odata=nometadata'
|
|
53
|
-
},
|
|
54
|
-
responseType: 'json'
|
|
55
|
-
};
|
|
56
68
|
let res = yield request_1.default.get(requestOptions);
|
|
57
69
|
let errorMessage = '';
|
|
58
70
|
if (args.options.name) {
|
|
@@ -80,7 +92,9 @@ class SpoContentTypeGetCommand extends SpoCommand_1.default {
|
|
|
80
92
|
_SpoContentTypeGetCommand_instances = new WeakSet(), _SpoContentTypeGetCommand_initTelemetry = function _SpoContentTypeGetCommand_initTelemetry() {
|
|
81
93
|
this.telemetry.push((args) => {
|
|
82
94
|
Object.assign(this.telemetryProperties, {
|
|
95
|
+
listId: typeof args.options.listId !== 'undefined',
|
|
83
96
|
listTitle: typeof args.options.listTitle !== 'undefined',
|
|
97
|
+
listUrl: typeof args.options.listUrl !== 'undefined',
|
|
84
98
|
id: typeof args.options.id !== 'undefined',
|
|
85
99
|
name: typeof args.options.name !== 'undefined'
|
|
86
100
|
});
|
|
@@ -90,6 +104,10 @@ _SpoContentTypeGetCommand_instances = new WeakSet(), _SpoContentTypeGetCommand_i
|
|
|
90
104
|
option: '-u, --webUrl <webUrl>'
|
|
91
105
|
}, {
|
|
92
106
|
option: '-l, --listTitle [listTitle]'
|
|
107
|
+
}, {
|
|
108
|
+
option: '--listId [listId]'
|
|
109
|
+
}, {
|
|
110
|
+
option: '--listUrl [listUrl]'
|
|
93
111
|
}, {
|
|
94
112
|
option: '-i, --id [id]'
|
|
95
113
|
}, {
|
|
@@ -101,6 +119,9 @@ _SpoContentTypeGetCommand_instances = new WeakSet(), _SpoContentTypeGetCommand_i
|
|
|
101
119
|
if (isValidSharePointUrl !== true) {
|
|
102
120
|
return isValidSharePointUrl;
|
|
103
121
|
}
|
|
122
|
+
if (args.options.listId && !validation_1.validation.isValidGuid(args.options.listId)) {
|
|
123
|
+
return `${args.options.listId} is not a valid GUID`;
|
|
124
|
+
}
|
|
104
125
|
return true;
|
|
105
126
|
}));
|
|
106
127
|
}, _SpoContentTypeGetCommand_initTypes = function _SpoContentTypeGetCommand_initTypes() {
|