@pnp/cli-microsoft365 5.4.0-beta.d1a3a17 → 5.4.0
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/.devcontainer/Dockerfile +1 -1
- package/.eslintrc.js +1 -0
- package/dist/m365/aad/commands/app/app-set.js +4 -1
- package/dist/m365/aad/commands/o365group/o365group-conversation-post-list.js +4 -19
- package/dist/m365/aad/commands/o365group/o365group-get.js +3 -9
- package/dist/m365/aad/commands/o365group/o365group-recyclebinitem-remove.js +129 -0
- package/dist/m365/aad/commands.js +1 -0
- package/dist/m365/base/PlannerCommand.js +10 -0
- package/dist/m365/flow/commands/flow-export.js +3 -3
- package/dist/m365/planner/commands/bucket/bucket-add.js +4 -16
- package/dist/m365/planner/commands/bucket/bucket-get.js +5 -19
- package/dist/m365/planner/commands/bucket/bucket-list.js +4 -17
- package/dist/m365/planner/commands/bucket/bucket-remove.js +6 -20
- package/dist/m365/planner/commands/bucket/bucket-set.js +5 -19
- package/dist/m365/planner/commands/plan/plan-add.js +4 -16
- package/dist/m365/planner/commands/plan/plan-details-get.js +4 -19
- package/dist/m365/planner/commands/plan/plan-get.js +4 -17
- package/dist/m365/planner/commands/plan/plan-list.js +4 -17
- package/dist/m365/planner/commands/task/task-add.js +60 -23
- package/dist/m365/planner/commands/task/task-checklistitem-add.js +89 -0
- package/dist/m365/planner/commands/task/{task-details-get.js → task-checklistitem-list.js} +21 -13
- package/dist/m365/planner/commands/task/task-checklistitem-remove.js +85 -0
- package/dist/m365/planner/commands/task/task-get.js +40 -29
- package/dist/m365/planner/commands/task/task-list.js +4 -16
- package/dist/m365/planner/commands/task/task-reference-remove.js +125 -0
- package/dist/m365/planner/commands/task/task-remove.js +201 -0
- package/dist/m365/planner/commands/task/task-set.js +21 -17
- package/dist/m365/planner/commands/tenant/tenant-settings-list.js +33 -0
- package/dist/m365/planner/commands.js +8 -2
- package/dist/m365/planner/taskPriority.js +27 -0
- package/dist/m365/spfx/commands/project/project-upgrade/rules/FN002009_DEVDEP_microsoft_sp_tslint_rules.js +2 -2
- package/dist/m365/spfx/commands/project/project-upgrade/rules/FN002018_DEVDEP_microsoft_rush_stack_compiler_3_9.js +2 -2
- package/dist/m365/spfx/commands/project/project-upgrade/rules/FN002020_DEVDEP_microsoft_rush_stack_compiler_4_5.js +17 -0
- package/dist/m365/spfx/commands/project/project-upgrade/rules/FN002021_DEVDEP_rushstack_eslint_config.js +14 -0
- package/dist/m365/spfx/commands/project/project-upgrade/rules/FN002022_DEVDEP_microsoft_eslint_plugin_spfx.js +14 -0
- package/dist/m365/spfx/commands/project/project-upgrade/rules/FN002023_DEVDEP_microsoft_eslint_config_spfx.js +14 -0
- package/dist/m365/spfx/commands/project/project-upgrade/rules/FN002024_DEVDEP_eslint.js +14 -0
- package/dist/m365/spfx/commands/project/project-upgrade/rules/FN002025_DEVDEP_eslint_plugin_react_hooks.js +18 -0
- package/dist/m365/spfx/commands/project/project-upgrade/rules/FN015008_FILE_eslintrc_js.js +14 -0
- package/dist/m365/spfx/commands/project/project-upgrade/{upgrade-1.15.0-beta.6.js → upgrade-1.15.0.js} +50 -26
- package/dist/m365/spfx/commands/project/project-upgrade.js +13 -15
- package/dist/m365/spo/commands/contenttype/contenttype-add.js +1 -1
- package/dist/m365/spo/commands/contenttype/contenttype-field-remove.js +1 -1
- package/dist/m365/spo/commands/contenttype/contenttype-get.js +1 -1
- package/dist/m365/spo/commands/eventreceiver/eventreceiver-get.js +3 -3
- package/dist/m365/spo/commands/eventreceiver/eventreceiver-list.js +102 -0
- package/dist/m365/spo/commands/field/field-add.js +1 -1
- package/dist/m365/spo/commands/field/field-get.js +5 -5
- package/dist/m365/spo/commands/field/field-list.js +3 -3
- package/dist/m365/spo/commands/field/field-remove.js +5 -5
- package/dist/m365/spo/commands/file/file-sharinginfo-get.js +1 -1
- package/dist/m365/spo/commands/hubsite/hubsite-list.js +1 -1
- package/dist/m365/spo/commands/list/ListPrincipalType.js +13 -0
- package/dist/m365/spo/commands/list/list-contenttype-add.js +3 -3
- package/dist/m365/spo/commands/list/list-contenttype-default-set.js +2 -2
- package/dist/m365/spo/commands/list/list-contenttype-list.js +3 -3
- package/dist/m365/spo/commands/list/list-contenttype-remove.js +3 -3
- package/dist/m365/spo/commands/list/list-get.js +8 -2
- package/dist/m365/spo/commands/list/list-label-get.js +3 -3
- package/dist/m365/spo/commands/list/list-label-set.js +2 -2
- package/dist/m365/spo/commands/list/list-list.js +10 -1
- package/dist/m365/spo/commands/list/list-remove.js +2 -2
- package/dist/m365/spo/commands/list/list-roleinheritance-break.js +2 -2
- package/dist/m365/spo/commands/list/list-roleinheritance-reset.js +2 -2
- package/dist/m365/spo/commands/list/list-sitescript-get.js +3 -3
- package/dist/m365/spo/commands/list/list-view-add.js +3 -3
- package/dist/m365/spo/commands/list/list-view-field-add.js +2 -2
- package/dist/m365/spo/commands/list/list-view-field-remove.js +2 -2
- package/dist/m365/spo/commands/list/list-view-field-set.js +2 -2
- package/dist/m365/spo/commands/list/list-view-get.js +4 -4
- package/dist/m365/spo/commands/list/list-view-list.js +3 -3
- package/dist/m365/spo/commands/list/list-view-remove.js +3 -3
- package/dist/m365/spo/commands/list/list-view-set.js +3 -3
- package/dist/m365/spo/commands/list/list-webhook-add.js +3 -3
- package/dist/m365/spo/commands/list/list-webhook-get.js +3 -3
- package/dist/m365/spo/commands/list/list-webhook-list.js +5 -5
- package/dist/m365/spo/commands/list/list-webhook-remove.js +4 -4
- package/dist/m365/spo/commands/list/list-webhook-set.js +3 -3
- package/dist/m365/spo/commands/listitem/listitem-add.js +2 -2
- package/dist/m365/spo/commands/listitem/listitem-attachment-list.js +2 -2
- package/dist/m365/spo/commands/listitem/listitem-get.js +2 -2
- package/dist/m365/spo/commands/listitem/listitem-isrecord.js +2 -2
- package/dist/m365/spo/commands/listitem/listitem-list.js +31 -11
- package/dist/m365/spo/commands/listitem/listitem-record-declare.js +2 -2
- package/dist/m365/spo/commands/listitem/listitem-record-undeclare.js +2 -2
- package/dist/m365/spo/commands/listitem/listitem-remove.js +2 -2
- package/dist/m365/spo/commands/listitem/listitem-roleinheritance-break.js +2 -2
- package/dist/m365/spo/commands/listitem/listitem-roleinheritance-reset.js +2 -2
- package/dist/m365/spo/commands/listitem/listitem-set.js +2 -2
- package/dist/m365/spo/commands/roledefinition/roledefinition-remove.js +82 -0
- package/dist/m365/spo/commands/site/site-remove.js +23 -37
- package/dist/m365/spo/commands.js +2 -0
- package/dist/m365/teams/commands/app/app-list.js +6 -20
- package/dist/m365/teams/commands/channel/channel-get.js +6 -19
- package/dist/m365/teams/commands/channel/channel-list.js +6 -18
- package/dist/m365/teams/commands/channel/channel-member-add.js +7 -18
- package/dist/m365/teams/commands/channel/channel-member-list.js +6 -19
- package/dist/m365/teams/commands/channel/channel-member-remove.js +6 -19
- package/dist/m365/teams/commands/channel/channel-member-set.js +6 -19
- package/dist/m365/teams/commands/tab/tab-get.js +6 -19
- package/dist/m365/teams/commands/team/team-add.js +2 -7
- package/dist/m365/teams/commands/team/team-get.js +6 -19
- package/dist/utils/aadGroup.js +57 -0
- package/dist/utils/index.js +2 -0
- package/dist/utils/validation.js +12 -2
- package/docs/docs/cmd/aad/app/app-set.md +1 -1
- package/docs/docs/cmd/aad/o365group/o365group-recyclebinitem-remove.md +45 -0
- package/docs/docs/cmd/file/file-list.md +4 -4
- package/docs/docs/cmd/planner/bucket/bucket-get.md +1 -1
- package/docs/docs/cmd/planner/bucket/bucket-remove.md +2 -2
- package/docs/docs/cmd/planner/bucket/bucket-set.md +5 -5
- package/docs/docs/cmd/planner/plan/plan-details-get.md +2 -2
- package/docs/docs/cmd/planner/plan/plan-get.md +4 -4
- package/docs/docs/cmd/planner/task/task-add.md +40 -4
- package/docs/docs/cmd/planner/task/task-checklistitem-add.md +36 -0
- package/docs/docs/cmd/planner/task/task-checklistitem-list.md +24 -0
- package/docs/docs/cmd/planner/task/task-checklistitem-remove.md +36 -0
- package/docs/docs/cmd/planner/task/task-get.md +3 -0
- package/docs/docs/cmd/planner/task/task-list.md +2 -2
- package/docs/docs/cmd/planner/task/task-reference-remove.md +39 -0
- package/docs/docs/cmd/planner/task/task-remove.md +78 -0
- package/docs/docs/cmd/planner/task/task-set.md +13 -3
- package/docs/docs/cmd/planner/tenant/tenant-settings-list.md +28 -0
- package/docs/docs/cmd/spfx/project/project-upgrade.md +1 -1
- package/docs/docs/cmd/spo/eventreceiver/eventreceiver-list.md +64 -0
- package/docs/docs/cmd/spo/file/file-checkout.md +1 -1
- package/docs/docs/cmd/spo/hubsite/hubsite-list.md +1 -4
- package/docs/docs/cmd/spo/list/list-list.md +3 -0
- package/docs/docs/cmd/spo/listitem/listitem-list.md +16 -10
- package/docs/docs/cmd/spo/listitem/listitem-roleinheritance-break.md +2 -2
- package/docs/docs/cmd/spo/roledefinition/roledefinition-remove.md +36 -0
- package/npm-shrinkwrap.json +255 -1102
- package/package.json +26 -22
- package/docs/docs/cmd/planner/task/task-details-get.md +0 -24
|
@@ -3,8 +3,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
const fs = require("fs");
|
|
4
4
|
const os = require("os");
|
|
5
5
|
const path = require("path");
|
|
6
|
-
// uncomment to support upgrading to preview releases
|
|
7
|
-
const semver_1 = require("semver");
|
|
8
6
|
const Command_1 = require("../../../../Command");
|
|
9
7
|
const utils_1 = require("../../../../utils");
|
|
10
8
|
const commands_1 = require("../../commands");
|
|
@@ -47,7 +45,7 @@ class SpfxProjectUpgradeCommand extends base_project_command_1.BaseProjectComman
|
|
|
47
45
|
'1.13.0',
|
|
48
46
|
'1.13.1',
|
|
49
47
|
'1.14.0',
|
|
50
|
-
'1.15.0
|
|
48
|
+
'1.15.0'
|
|
51
49
|
];
|
|
52
50
|
}
|
|
53
51
|
get name() {
|
|
@@ -60,9 +58,9 @@ class SpfxProjectUpgradeCommand extends base_project_command_1.BaseProjectComman
|
|
|
60
58
|
const telemetryProps = super.getTelemetryProperties(args);
|
|
61
59
|
telemetryProps.toVersion = args.options.toVersion || this.supportedVersions[this.supportedVersions.length - 1];
|
|
62
60
|
// uncomment to support upgrading to preview releases
|
|
63
|
-
if (
|
|
64
|
-
|
|
65
|
-
}
|
|
61
|
+
// if (prerelease(telemetryProps.toVersion) && !args.options.preview) {
|
|
62
|
+
// telemetryProps.toVersion = this.supportedVersions[this.supportedVersions.length - 2];
|
|
63
|
+
// }
|
|
66
64
|
telemetryProps.packageManager = args.options.packageManager || 'npm';
|
|
67
65
|
telemetryProps.shell = args.options.shell || 'bash';
|
|
68
66
|
telemetryProps.preview = args.options.preview;
|
|
@@ -76,15 +74,15 @@ class SpfxProjectUpgradeCommand extends base_project_command_1.BaseProjectComman
|
|
|
76
74
|
}
|
|
77
75
|
this.toVersion = args.options.toVersion ? args.options.toVersion : this.supportedVersions[this.supportedVersions.length - 1];
|
|
78
76
|
// uncomment to support upgrading to preview releases
|
|
79
|
-
if (!args.options.toVersion &&
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
}
|
|
77
|
+
// if (!args.options.toVersion &&
|
|
78
|
+
// !args.options.preview &&
|
|
79
|
+
// prerelease(this.toVersion)) {
|
|
80
|
+
// // no version and no preview specified while the current version to
|
|
81
|
+
// // upgrade to is a prerelease so let's grab the first non-preview version
|
|
82
|
+
// // since we're supporting only one preview version, it's sufficient for
|
|
83
|
+
// // us to take second to last version
|
|
84
|
+
// this.toVersion = this.supportedVersions[this.supportedVersions.length - 2];
|
|
85
|
+
// }
|
|
88
86
|
this.packageManager = args.options.packageManager || 'npm';
|
|
89
87
|
this.shell = args.options.shell || 'bash';
|
|
90
88
|
if (this.supportedVersions.indexOf(this.toVersion) < 0) {
|
|
@@ -116,7 +116,7 @@ class SpoContentTypeAddCommand extends SpoCommand_1.default {
|
|
|
116
116
|
logger.logToStderr(`Retrieving list id...`);
|
|
117
117
|
}
|
|
118
118
|
const requestOptions = {
|
|
119
|
-
url: `${webUrl}/_api/web/lists/getByTitle('${
|
|
119
|
+
url: `${webUrl}/_api/web/lists/getByTitle('${utils_1.formatting.encodeQueryParameter(listTitle)}')?$select=Id`,
|
|
120
120
|
headers: {
|
|
121
121
|
accept: 'application/json;odata=nometadata'
|
|
122
122
|
},
|
|
@@ -70,7 +70,7 @@ class SpoContentTypeFieldRemoveCommand extends SpoCommand_1.default {
|
|
|
70
70
|
}
|
|
71
71
|
// Request for the ListId
|
|
72
72
|
const requestOptions = {
|
|
73
|
-
url: `${args.options.webUrl}/_api/lists/GetByTitle('${
|
|
73
|
+
url: `${args.options.webUrl}/_api/lists/GetByTitle('${utils_1.formatting.encodeQueryParameter(args.options.listTitle)}')?$select=Id`,
|
|
74
74
|
headers: {
|
|
75
75
|
accept: 'application/json;odata=nometadata'
|
|
76
76
|
},
|
|
@@ -18,7 +18,7 @@ class SpoContentTypeGetCommand extends SpoCommand_1.default {
|
|
|
18
18
|
};
|
|
19
19
|
}
|
|
20
20
|
commandAction(logger, args, cb) {
|
|
21
|
-
let requestUrl = `${args.options.webUrl}/_api/web/${(args.options.listTitle ? `lists/getByTitle('${
|
|
21
|
+
let requestUrl = `${args.options.webUrl}/_api/web/${(args.options.listTitle ? `lists/getByTitle('${utils_1.formatting.encodeQueryParameter(args.options.listTitle)}')/` : '')}contenttypes`;
|
|
22
22
|
if (args.options.id) {
|
|
23
23
|
requestUrl += `('${encodeURIComponent(args.options.id)}')`;
|
|
24
24
|
}
|
|
@@ -26,14 +26,14 @@ class SpoEventreceiverGetCommand extends SpoCommand_1.default {
|
|
|
26
26
|
let listUrl = '';
|
|
27
27
|
let filter = '?$filter=';
|
|
28
28
|
if (args.options.listId) {
|
|
29
|
-
listUrl = `lists(guid'${
|
|
29
|
+
listUrl = `lists(guid'${utils_1.formatting.encodeQueryParameter(args.options.listId)}')/`;
|
|
30
30
|
}
|
|
31
31
|
else if (args.options.listTitle) {
|
|
32
|
-
listUrl = `lists/getByTitle('${
|
|
32
|
+
listUrl = `lists/getByTitle('${utils_1.formatting.encodeQueryParameter(args.options.listTitle)}')/`;
|
|
33
33
|
}
|
|
34
34
|
else if (args.options.listUrl) {
|
|
35
35
|
const listServerRelativeUrl = utils_1.urlUtil.getServerRelativePath(args.options.webUrl, args.options.listUrl);
|
|
36
|
-
listUrl = `GetList('${
|
|
36
|
+
listUrl = `GetList('${utils_1.formatting.encodeQueryParameter(listServerRelativeUrl)}')/`;
|
|
37
37
|
}
|
|
38
38
|
if (!args.options.scope || args.options.scope === 'web') {
|
|
39
39
|
requestUrl += `web/${listUrl}eventreceivers`;
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const request_1 = require("../../../../request");
|
|
4
|
+
const utils_1 = require("../../../../utils");
|
|
5
|
+
const SpoCommand_1 = require("../../../base/SpoCommand");
|
|
6
|
+
const commands_1 = require("../../commands");
|
|
7
|
+
class SpoEventreceiverListCommand extends SpoCommand_1.default {
|
|
8
|
+
get name() {
|
|
9
|
+
return commands_1.default.EVENTRECEIVER_LIST;
|
|
10
|
+
}
|
|
11
|
+
get description() {
|
|
12
|
+
return 'Retrieves event receivers for the specified web, site or list.';
|
|
13
|
+
}
|
|
14
|
+
defaultProperties() {
|
|
15
|
+
return ['ReceiverId', 'ReceiverName'];
|
|
16
|
+
}
|
|
17
|
+
getTelemetryProperties(args) {
|
|
18
|
+
const telemetryProps = super.getTelemetryProperties(args);
|
|
19
|
+
telemetryProps.listId = typeof args.options.listId !== 'undefined';
|
|
20
|
+
telemetryProps.listTitle = typeof args.options.listTitle !== 'undefined';
|
|
21
|
+
telemetryProps.listUrl = typeof args.options.listUrl !== 'undefined';
|
|
22
|
+
telemetryProps.scope = typeof args.options.scope !== 'undefined';
|
|
23
|
+
return telemetryProps;
|
|
24
|
+
}
|
|
25
|
+
commandAction(logger, args, cb) {
|
|
26
|
+
let requestUrl = `${args.options.webUrl}/_api/`;
|
|
27
|
+
let listUrl = '';
|
|
28
|
+
if (args.options.listId) {
|
|
29
|
+
listUrl = `lists(guid'${encodeURIComponent(args.options.listId)}')/`;
|
|
30
|
+
}
|
|
31
|
+
else if (args.options.listTitle) {
|
|
32
|
+
listUrl = `lists/getByTitle('${encodeURIComponent(args.options.listTitle)}')/`;
|
|
33
|
+
}
|
|
34
|
+
else if (args.options.listUrl) {
|
|
35
|
+
const listServerRelativeUrl = utils_1.urlUtil.getServerRelativePath(args.options.webUrl, args.options.listUrl);
|
|
36
|
+
listUrl = `GetList('${encodeURIComponent(listServerRelativeUrl)}')/`;
|
|
37
|
+
}
|
|
38
|
+
if (!args.options.scope || args.options.scope === 'web') {
|
|
39
|
+
requestUrl += `web/${listUrl}eventreceivers`;
|
|
40
|
+
}
|
|
41
|
+
else {
|
|
42
|
+
requestUrl += 'site/eventreceivers';
|
|
43
|
+
}
|
|
44
|
+
const requestOptions = {
|
|
45
|
+
url: requestUrl,
|
|
46
|
+
headers: {
|
|
47
|
+
'accept': 'application/json;odata=nometadata'
|
|
48
|
+
},
|
|
49
|
+
responseType: 'json'
|
|
50
|
+
};
|
|
51
|
+
request_1.default
|
|
52
|
+
.get(requestOptions)
|
|
53
|
+
.then((res) => {
|
|
54
|
+
logger.log(res.value);
|
|
55
|
+
cb();
|
|
56
|
+
}, (err) => this.handleRejectedODataJsonPromise(err, logger, cb));
|
|
57
|
+
}
|
|
58
|
+
options() {
|
|
59
|
+
const options = [
|
|
60
|
+
{
|
|
61
|
+
option: '-u, --webUrl <webUrl>'
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
option: '--listTitle [listTitle]'
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
option: '--listId [listId]'
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
option: '--listUrl [listUrl]'
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
option: '-s, --scope [scope]',
|
|
74
|
+
autocomplete: ['web', 'site']
|
|
75
|
+
}
|
|
76
|
+
];
|
|
77
|
+
const parentOptions = super.options();
|
|
78
|
+
return options.concat(parentOptions);
|
|
79
|
+
}
|
|
80
|
+
validate(args) {
|
|
81
|
+
const isValidSharePointUrl = utils_1.validation.isValidSharePointUrl(args.options.webUrl);
|
|
82
|
+
if (isValidSharePointUrl !== true) {
|
|
83
|
+
return isValidSharePointUrl;
|
|
84
|
+
}
|
|
85
|
+
const listOptions = [args.options.listId, args.options.listTitle, args.options.listUrl];
|
|
86
|
+
if (listOptions.some(item => item !== undefined) && listOptions.filter(item => item !== undefined).length > 1) {
|
|
87
|
+
return `Specify either list id or title or list url`;
|
|
88
|
+
}
|
|
89
|
+
if (args.options.listId && !utils_1.validation.isValidGuid(args.options.listId)) {
|
|
90
|
+
return `${args.options.listId} is not a valid GUID`;
|
|
91
|
+
}
|
|
92
|
+
if (args.options.scope && ['web', 'site'].indexOf(args.options.scope) === -1) {
|
|
93
|
+
return `${args.options.scope} is not a valid type value. Allowed values web|site.`;
|
|
94
|
+
}
|
|
95
|
+
if (args.options.scope && args.options.scope === 'site' && (args.options.listId || args.options.listUrl || args.options.listTitle)) {
|
|
96
|
+
return 'Scope cannot be set to site when retrieving list event receivers.';
|
|
97
|
+
}
|
|
98
|
+
return true;
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
module.exports = new SpoEventreceiverListCommand();
|
|
102
|
+
//# sourceMappingURL=eventreceiver-list.js.map
|
|
@@ -16,7 +16,7 @@ class SpoFieldAddCommand extends SpoCommand_1.default {
|
|
|
16
16
|
.getRequestDigest(args.options.webUrl)
|
|
17
17
|
.then((res) => {
|
|
18
18
|
const requestOptions = {
|
|
19
|
-
url: `${args.options.webUrl}/_api/web/${(args.options.listTitle ? `lists/getByTitle('${
|
|
19
|
+
url: `${args.options.webUrl}/_api/web/${(args.options.listTitle ? `lists/getByTitle('${utils_1.formatting.encodeQueryParameter(args.options.listTitle)}')/` : '')}fields/CreateFieldAsXml`,
|
|
20
20
|
headers: {
|
|
21
21
|
'X-RequestDigest': res.FormDigestValue,
|
|
22
22
|
accept: 'application/json;odata=nometadata'
|
|
@@ -23,21 +23,21 @@ class SpoFieldGetCommand extends SpoCommand_1.default {
|
|
|
23
23
|
commandAction(logger, args, cb) {
|
|
24
24
|
let listRestUrl = '';
|
|
25
25
|
if (args.options.listId) {
|
|
26
|
-
listRestUrl = `lists(guid'${
|
|
26
|
+
listRestUrl = `lists(guid'${utils_1.formatting.encodeQueryParameter(args.options.listId)}')/`;
|
|
27
27
|
}
|
|
28
28
|
else if (args.options.listTitle) {
|
|
29
|
-
listRestUrl = `lists/getByTitle('${
|
|
29
|
+
listRestUrl = `lists/getByTitle('${utils_1.formatting.encodeQueryParameter(args.options.listTitle)}')/`;
|
|
30
30
|
}
|
|
31
31
|
else if (args.options.listUrl) {
|
|
32
32
|
const listServerRelativeUrl = utils_1.urlUtil.getServerRelativePath(args.options.webUrl, args.options.listUrl);
|
|
33
|
-
listRestUrl = `GetList('${
|
|
33
|
+
listRestUrl = `GetList('${utils_1.formatting.encodeQueryParameter(listServerRelativeUrl)}')/`;
|
|
34
34
|
}
|
|
35
35
|
let fieldRestUrl = '';
|
|
36
36
|
if (args.options.id) {
|
|
37
|
-
fieldRestUrl = `/getbyid('${
|
|
37
|
+
fieldRestUrl = `/getbyid('${utils_1.formatting.encodeQueryParameter(args.options.id)}')`;
|
|
38
38
|
}
|
|
39
39
|
else {
|
|
40
|
-
fieldRestUrl = `/getbyinternalnameortitle('${
|
|
40
|
+
fieldRestUrl = `/getbyinternalnameortitle('${utils_1.formatting.encodeQueryParameter(args.options.fieldTitle)}')`;
|
|
41
41
|
}
|
|
42
42
|
const requestOptions = {
|
|
43
43
|
url: `${args.options.webUrl}/_api/web/${listRestUrl}fields${fieldRestUrl}`,
|
|
@@ -24,14 +24,14 @@ class SpoFieldListCommand extends SpoCommand_1.default {
|
|
|
24
24
|
commandAction(logger, args, cb) {
|
|
25
25
|
let listUrl = '';
|
|
26
26
|
if (args.options.listId) {
|
|
27
|
-
listUrl = `lists(guid'${
|
|
27
|
+
listUrl = `lists(guid'${utils_1.formatting.encodeQueryParameter(args.options.listId)}')/`;
|
|
28
28
|
}
|
|
29
29
|
else if (args.options.listTitle) {
|
|
30
|
-
listUrl = `lists/getByTitle('${
|
|
30
|
+
listUrl = `lists/getByTitle('${utils_1.formatting.encodeQueryParameter(args.options.listTitle)}')/`;
|
|
31
31
|
}
|
|
32
32
|
else if (args.options.listUrl) {
|
|
33
33
|
const listServerRelativeUrl = utils_1.urlUtil.getServerRelativePath(args.options.webUrl, args.options.listUrl);
|
|
34
|
-
listUrl = `GetList('${
|
|
34
|
+
listUrl = `GetList('${utils_1.formatting.encodeQueryParameter(listServerRelativeUrl)}')/`;
|
|
35
35
|
}
|
|
36
36
|
const requestOptions = {
|
|
37
37
|
url: `${args.options.webUrl}/_api/web/${listUrl}fields`,
|
|
@@ -37,10 +37,10 @@ class SpoFieldRemoveCommand extends SpoCommand_1.default {
|
|
|
37
37
|
}
|
|
38
38
|
let fieldRestUrl = '';
|
|
39
39
|
if (fieldId) {
|
|
40
|
-
fieldRestUrl = `/getbyid('${
|
|
40
|
+
fieldRestUrl = `/getbyid('${utils_1.formatting.encodeQueryParameter(fieldId)}')`;
|
|
41
41
|
}
|
|
42
42
|
else {
|
|
43
|
-
fieldRestUrl = `/getbyinternalnameortitle('${
|
|
43
|
+
fieldRestUrl = `/getbyinternalnameortitle('${utils_1.formatting.encodeQueryParameter(fieldTitle)}')`;
|
|
44
44
|
}
|
|
45
45
|
const requestOptions = {
|
|
46
46
|
url: `${args.options.webUrl}/_api/web/${listRestUrl}fields${fieldRestUrl}`,
|
|
@@ -57,14 +57,14 @@ class SpoFieldRemoveCommand extends SpoCommand_1.default {
|
|
|
57
57
|
const prepareRemoval = () => {
|
|
58
58
|
let listRestUrl = '';
|
|
59
59
|
if (args.options.listId) {
|
|
60
|
-
listRestUrl = `lists(guid'${
|
|
60
|
+
listRestUrl = `lists(guid'${utils_1.formatting.encodeQueryParameter(args.options.listId)}')/`;
|
|
61
61
|
}
|
|
62
62
|
else if (args.options.listTitle) {
|
|
63
|
-
listRestUrl = `lists/getByTitle('${
|
|
63
|
+
listRestUrl = `lists/getByTitle('${utils_1.formatting.encodeQueryParameter(args.options.listTitle)}')/`;
|
|
64
64
|
}
|
|
65
65
|
else if (args.options.listUrl) {
|
|
66
66
|
const listServerRelativeUrl = utils_1.urlUtil.getServerRelativePath(args.options.webUrl, args.options.listUrl);
|
|
67
|
-
listRestUrl = `GetList('${
|
|
67
|
+
listRestUrl = `GetList('${utils_1.formatting.encodeQueryParameter(listServerRelativeUrl)}')/`;
|
|
68
68
|
}
|
|
69
69
|
if (args.options.group) {
|
|
70
70
|
if (this.verbose) {
|
|
@@ -32,7 +32,7 @@ class SpoFileSharinginfoGetCommand extends SpoCommand_1.default {
|
|
|
32
32
|
logger.logToStderr(`Retrieving sharing information report for the file with item Id ${fileInformation.fileItemId}`);
|
|
33
33
|
}
|
|
34
34
|
const requestOptions = {
|
|
35
|
-
url: `${args.options.webUrl}/_api/web/lists/getbytitle('${fileInformation.libraryName}')/items(${fileInformation.fileItemId})/GetSharingInformation?$select=permissionsInformation&$Expand=permissionsInformation`,
|
|
35
|
+
url: `${args.options.webUrl}/_api/web/lists/getbytitle('${utils_1.formatting.encodeQueryParameter(fileInformation.libraryName)}')/items(${fileInformation.fileItemId})/GetSharingInformation?$select=permissionsInformation&$Expand=permissionsInformation`,
|
|
36
36
|
headers: {
|
|
37
37
|
'accept': 'application/json;odata=nometadata'
|
|
38
38
|
},
|
|
@@ -42,7 +42,7 @@ class SpoHubSiteListCommand extends SpoCommand_1.default {
|
|
|
42
42
|
})
|
|
43
43
|
.then((res) => {
|
|
44
44
|
hubSites = res.value;
|
|
45
|
-
if (args.options.includeAssociatedSites !== true || args.options.output !== 'json') {
|
|
45
|
+
if (args.options.includeAssociatedSites !== true || args.options.output && args.options.output !== 'json') {
|
|
46
46
|
return Promise.resolve();
|
|
47
47
|
}
|
|
48
48
|
else {
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ListPrincipalType = void 0;
|
|
4
|
+
var ListPrincipalType;
|
|
5
|
+
(function (ListPrincipalType) {
|
|
6
|
+
ListPrincipalType[ListPrincipalType["None"] = 0] = "None";
|
|
7
|
+
ListPrincipalType[ListPrincipalType["User"] = 1] = "User";
|
|
8
|
+
ListPrincipalType[ListPrincipalType["DistributionList"] = 2] = "DistributionList";
|
|
9
|
+
ListPrincipalType[ListPrincipalType["SecurityGroup"] = 4] = "SecurityGroup";
|
|
10
|
+
ListPrincipalType[ListPrincipalType["SharePointGroup"] = 8] = "SharePointGroup";
|
|
11
|
+
ListPrincipalType[ListPrincipalType["All"] = 15] = "All";
|
|
12
|
+
})(ListPrincipalType = exports.ListPrincipalType || (exports.ListPrincipalType = {}));
|
|
13
|
+
//# sourceMappingURL=ListPrincipalType.js.map
|
|
@@ -24,15 +24,15 @@ class SpoListContentTypeAddCommand extends SpoCommand_1.default {
|
|
|
24
24
|
}
|
|
25
25
|
commandAction(logger, args, cb) {
|
|
26
26
|
if (this.verbose) {
|
|
27
|
-
const list = args.options.listId ?
|
|
27
|
+
const list = (args.options.listId ? args.options.listId : args.options.listTitle);
|
|
28
28
|
logger.logToStderr(`Adding content type ${args.options.contentTypeId} to list ${list} in site at ${args.options.webUrl}...`);
|
|
29
29
|
}
|
|
30
30
|
let requestUrl = '';
|
|
31
31
|
if (args.options.listId) {
|
|
32
|
-
requestUrl = `${args.options.webUrl}/_api/web/lists(guid'${
|
|
32
|
+
requestUrl = `${args.options.webUrl}/_api/web/lists(guid'${utils_1.formatting.encodeQueryParameter(args.options.listId)}')/ContentTypes/AddAvailableContentType`;
|
|
33
33
|
}
|
|
34
34
|
else {
|
|
35
|
-
requestUrl = `${args.options.webUrl}/_api/web/lists/GetByTitle('${
|
|
35
|
+
requestUrl = `${args.options.webUrl}/_api/web/lists/GetByTitle('${utils_1.formatting.encodeQueryParameter(args.options.listTitle)}')/ContentTypes/AddAvailableContentType`;
|
|
36
36
|
}
|
|
37
37
|
const requestBody = this.mapRequestBody(args.options);
|
|
38
38
|
const requestOptions = {
|
|
@@ -24,8 +24,8 @@ class SpoListContentTypeDefaultSetCommand extends SpoCommand_1.default {
|
|
|
24
24
|
}
|
|
25
25
|
commandAction(logger, args, cb) {
|
|
26
26
|
const baseUrl = args.options.listId ?
|
|
27
|
-
`${args.options.webUrl}/_api/web/lists(guid'${
|
|
28
|
-
`${args.options.webUrl}/_api/web/lists/GetByTitle('${
|
|
27
|
+
`${args.options.webUrl}/_api/web/lists(guid'${utils_1.formatting.encodeQueryParameter(args.options.listId)}')` :
|
|
28
|
+
`${args.options.webUrl}/_api/web/lists/GetByTitle('${utils_1.formatting.encodeQueryParameter(args.options.listTitle)}')`;
|
|
29
29
|
if (this.verbose) {
|
|
30
30
|
logger.logToStderr('Retrieving content type order...');
|
|
31
31
|
}
|
|
@@ -22,15 +22,15 @@ class SpoListContentTypeListCommand extends SpoCommand_1.default {
|
|
|
22
22
|
}
|
|
23
23
|
commandAction(logger, args, cb) {
|
|
24
24
|
if (this.verbose) {
|
|
25
|
-
const list = args.options.listId ?
|
|
25
|
+
const list = (args.options.listId ? args.options.listId : args.options.listTitle);
|
|
26
26
|
logger.logToStderr(`Retrieving content types information for list ${list} in site at ${args.options.webUrl}...`);
|
|
27
27
|
}
|
|
28
28
|
let requestUrl = '';
|
|
29
29
|
if (args.options.listId) {
|
|
30
|
-
requestUrl = `${args.options.webUrl}/_api/web/lists(guid'${
|
|
30
|
+
requestUrl = `${args.options.webUrl}/_api/web/lists(guid'${utils_1.formatting.encodeQueryParameter(args.options.listId)}')/ContentTypes`;
|
|
31
31
|
}
|
|
32
32
|
else {
|
|
33
|
-
requestUrl = `${args.options.webUrl}/_api/web/lists/GetByTitle('${
|
|
33
|
+
requestUrl = `${args.options.webUrl}/_api/web/lists/GetByTitle('${utils_1.formatting.encodeQueryParameter(args.options.listTitle)}')/ContentTypes`;
|
|
34
34
|
}
|
|
35
35
|
const requestOptions = {
|
|
36
36
|
url: requestUrl,
|
|
@@ -27,15 +27,15 @@ class SpoListContentTypeRemoveCommand extends SpoCommand_1.default {
|
|
|
27
27
|
commandAction(logger, args, cb) {
|
|
28
28
|
const removeContentTypeFromList = () => {
|
|
29
29
|
if (this.verbose) {
|
|
30
|
-
const list = args.options.listId ?
|
|
30
|
+
const list = (args.options.listId ? args.options.listId : args.options.listTitle);
|
|
31
31
|
logger.logToStderr(`Removing content type ${args.options.contentTypeId} from list ${list} in site at ${args.options.webUrl}...`);
|
|
32
32
|
}
|
|
33
33
|
let requestUrl = '';
|
|
34
34
|
if (args.options.listId) {
|
|
35
|
-
requestUrl = `${args.options.webUrl}/_api/web/lists(guid'${
|
|
35
|
+
requestUrl = `${args.options.webUrl}/_api/web/lists(guid'${utils_1.formatting.encodeQueryParameter(args.options.listId)}')/ContentTypes('${encodeURIComponent(args.options.contentTypeId)}')`;
|
|
36
36
|
}
|
|
37
37
|
else {
|
|
38
|
-
requestUrl = `${args.options.webUrl}/_api/web/lists/GetByTitle('${
|
|
38
|
+
requestUrl = `${args.options.webUrl}/_api/web/lists/GetByTitle('${utils_1.formatting.encodeQueryParameter(args.options.listTitle)}')/ContentTypes('${encodeURIComponent(args.options.contentTypeId)}')`;
|
|
39
39
|
}
|
|
40
40
|
const requestOptions = {
|
|
41
41
|
url: requestUrl,
|
|
@@ -4,6 +4,7 @@ const request_1 = require("../../../../request");
|
|
|
4
4
|
const utils_1 = require("../../../../utils");
|
|
5
5
|
const SpoCommand_1 = require("../../../base/SpoCommand");
|
|
6
6
|
const commands_1 = require("../../commands");
|
|
7
|
+
const ListPrincipalType_1 = require("./ListPrincipalType");
|
|
7
8
|
class SpoListGetCommand extends SpoCommand_1.default {
|
|
8
9
|
get name() {
|
|
9
10
|
return commands_1.default.LIST_GET;
|
|
@@ -25,10 +26,10 @@ class SpoListGetCommand extends SpoCommand_1.default {
|
|
|
25
26
|
}
|
|
26
27
|
let requestUrl = '';
|
|
27
28
|
if (args.options.id) {
|
|
28
|
-
requestUrl = `${args.options.webUrl}/_api/web/lists(guid'${
|
|
29
|
+
requestUrl = `${args.options.webUrl}/_api/web/lists(guid'${utils_1.formatting.encodeQueryParameter(args.options.id)}')`;
|
|
29
30
|
}
|
|
30
31
|
else {
|
|
31
|
-
requestUrl = `${args.options.webUrl}/_api/web/lists/GetByTitle('${
|
|
32
|
+
requestUrl = `${args.options.webUrl}/_api/web/lists/GetByTitle('${utils_1.formatting.encodeQueryParameter(args.options.title)}')`;
|
|
32
33
|
}
|
|
33
34
|
let propertiesSelect = args.options.properties ? `?$select=${encodeURIComponent(args.options.properties)}` : ``;
|
|
34
35
|
propertiesSelect += args.options.withPermissions ? `${args.options.properties ? '&' : '?'}$expand=HasUniqueRoleAssignments,RoleAssignments/Member,RoleAssignments/RoleDefinitionBindings` : ``;
|
|
@@ -42,6 +43,11 @@ class SpoListGetCommand extends SpoCommand_1.default {
|
|
|
42
43
|
request_1.default
|
|
43
44
|
.get(requestOptions)
|
|
44
45
|
.then((listInstance) => {
|
|
46
|
+
if (args.options.withPermissions) {
|
|
47
|
+
listInstance.RoleAssignments.forEach(r => {
|
|
48
|
+
r.Member.PrincipalTypeString = ListPrincipalType_1.ListPrincipalType[r.Member.PrincipalType];
|
|
49
|
+
});
|
|
50
|
+
}
|
|
45
51
|
logger.log(listInstance);
|
|
46
52
|
cb();
|
|
47
53
|
}, (err) => this.handleRejectedODataJsonPromise(err, logger, cb));
|
|
@@ -19,7 +19,7 @@ class SpoListLabelGetCommand extends SpoCommand_1.default {
|
|
|
19
19
|
}
|
|
20
20
|
commandAction(logger, args, cb) {
|
|
21
21
|
if (this.verbose) {
|
|
22
|
-
const list = args.options.listId ?
|
|
22
|
+
const list = (args.options.listId ? args.options.listId : args.options.listTitle);
|
|
23
23
|
logger.logToStderr(`Getting label set on the list ${list} in site at ${args.options.webUrl}...`);
|
|
24
24
|
}
|
|
25
25
|
let requestUrl = '';
|
|
@@ -27,13 +27,13 @@ class SpoListLabelGetCommand extends SpoCommand_1.default {
|
|
|
27
27
|
if (this.debug) {
|
|
28
28
|
logger.logToStderr(`Retrieving List Url from Id '${args.options.listId}'...`);
|
|
29
29
|
}
|
|
30
|
-
requestUrl = `${args.options.webUrl}/_api/web/lists(guid'${
|
|
30
|
+
requestUrl = `${args.options.webUrl}/_api/web/lists(guid'${utils_1.formatting.encodeQueryParameter(args.options.listId)}')?$expand=RootFolder&$select=RootFolder`;
|
|
31
31
|
}
|
|
32
32
|
else {
|
|
33
33
|
if (this.debug) {
|
|
34
34
|
logger.logToStderr(`Retrieving List Url from Title '${args.options.listTitle}'...`);
|
|
35
35
|
}
|
|
36
|
-
requestUrl = `${args.options.webUrl}/_api/web/lists/GetByTitle('${
|
|
36
|
+
requestUrl = `${args.options.webUrl}/_api/web/lists/GetByTitle('${utils_1.formatting.encodeQueryParameter(args.options.listTitle)}')?$expand=RootFolder&$select=RootFolder`;
|
|
37
37
|
}
|
|
38
38
|
const requestOptions = {
|
|
39
39
|
url: requestUrl,
|
|
@@ -29,10 +29,10 @@ class SpoListLabelSetCommand extends SpoCommand_1.default {
|
|
|
29
29
|
return Promise.resolve(listServerRelativeUrl);
|
|
30
30
|
}
|
|
31
31
|
else if (args.options.listId) {
|
|
32
|
-
listRestUrl = `lists(guid'${
|
|
32
|
+
listRestUrl = `lists(guid'${utils_1.formatting.encodeQueryParameter(args.options.listId)}')/`;
|
|
33
33
|
}
|
|
34
34
|
else {
|
|
35
|
-
listRestUrl = `lists/getByTitle('${
|
|
35
|
+
listRestUrl = `lists/getByTitle('${utils_1.formatting.encodeQueryParameter(args.options.listTitle)}')/`;
|
|
36
36
|
}
|
|
37
37
|
const requestOptions = {
|
|
38
38
|
url: `${args.options.webUrl}/_api/web/${listRestUrl}?$expand=RootFolder&$select=RootFolder`,
|
|
@@ -14,12 +14,18 @@ class SpoListListCommand extends SpoCommand_1.default {
|
|
|
14
14
|
defaultProperties() {
|
|
15
15
|
return ['Title', 'Url', 'Id'];
|
|
16
16
|
}
|
|
17
|
+
getTelemetryProperties(args) {
|
|
18
|
+
const telemetryProps = super.getTelemetryProperties(args);
|
|
19
|
+
telemetryProps.executeWithLimitedPermissions = !!args.options.executeWithLimitedPermissions;
|
|
20
|
+
return telemetryProps;
|
|
21
|
+
}
|
|
17
22
|
commandAction(logger, args, cb) {
|
|
18
23
|
if (this.verbose) {
|
|
19
24
|
logger.logToStderr(`Retrieving all lists in site at ${args.options.webUrl}...`);
|
|
20
25
|
}
|
|
26
|
+
const suffix = args.options.executeWithLimitedPermissions ? '&$select=RootFolder/ServerRelativeUrl,*' : '';
|
|
21
27
|
const requestOptions = {
|
|
22
|
-
url: `${args.options.webUrl}/_api/web/lists?$expand=RootFolder`,
|
|
28
|
+
url: `${args.options.webUrl}/_api/web/lists?$expand=RootFolder${suffix}`,
|
|
23
29
|
method: 'GET',
|
|
24
30
|
headers: {
|
|
25
31
|
'accept': 'application/json;odata=nometadata'
|
|
@@ -40,6 +46,9 @@ class SpoListListCommand extends SpoCommand_1.default {
|
|
|
40
46
|
const options = [
|
|
41
47
|
{
|
|
42
48
|
option: '-u, --webUrl <webUrl>'
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
option: '--executeWithLimitedPermissions'
|
|
43
52
|
}
|
|
44
53
|
];
|
|
45
54
|
const parentOptions = super.options();
|
|
@@ -26,10 +26,10 @@ class SpoListRemoveCommand extends SpoCommand_1.default {
|
|
|
26
26
|
}
|
|
27
27
|
let requestUrl = '';
|
|
28
28
|
if (args.options.id) {
|
|
29
|
-
requestUrl = `${args.options.webUrl}/_api/web/lists(guid'${
|
|
29
|
+
requestUrl = `${args.options.webUrl}/_api/web/lists(guid'${utils_1.formatting.encodeQueryParameter(args.options.id)}')`;
|
|
30
30
|
}
|
|
31
31
|
else {
|
|
32
|
-
requestUrl = `${args.options.webUrl}/_api/web/lists/GetByTitle('${
|
|
32
|
+
requestUrl = `${args.options.webUrl}/_api/web/lists/GetByTitle('${utils_1.formatting.encodeQueryParameter(args.options.title)}')`;
|
|
33
33
|
}
|
|
34
34
|
const requestOptions = {
|
|
35
35
|
url: requestUrl,
|
|
@@ -29,10 +29,10 @@ class SpoListRoleInheritanceBreakCommand extends SpoCommand_1.default {
|
|
|
29
29
|
}
|
|
30
30
|
let requestUrl = `${args.options.webUrl}/_api/web/lists`;
|
|
31
31
|
if (args.options.listId) {
|
|
32
|
-
requestUrl += `(guid'${
|
|
32
|
+
requestUrl += `(guid'${utils_1.formatting.encodeQueryParameter(args.options.listId)}')`;
|
|
33
33
|
}
|
|
34
34
|
else {
|
|
35
|
-
requestUrl += `/getbytitle('${
|
|
35
|
+
requestUrl += `/getbytitle('${utils_1.formatting.encodeQueryParameter(args.options.listTitle)}')`;
|
|
36
36
|
}
|
|
37
37
|
let keepExistingPermissions = true;
|
|
38
38
|
if (args.options.clearExistingPermissions) {
|
|
@@ -28,10 +28,10 @@ class SpoListRoleInheritanceResetCommand extends SpoCommand_1.default {
|
|
|
28
28
|
}
|
|
29
29
|
let requestUrl = `${args.options.webUrl}/_api/web/lists`;
|
|
30
30
|
if (args.options.listId) {
|
|
31
|
-
requestUrl += `(guid'${
|
|
31
|
+
requestUrl += `(guid'${utils_1.formatting.encodeQueryParameter(args.options.listId)}')`;
|
|
32
32
|
}
|
|
33
33
|
else {
|
|
34
|
-
requestUrl += `/getbytitle('${
|
|
34
|
+
requestUrl += `/getbytitle('${utils_1.formatting.encodeQueryParameter(args.options.listTitle)}')`;
|
|
35
35
|
}
|
|
36
36
|
const requestOptions = {
|
|
37
37
|
url: `${requestUrl}/resetroleinheritance`,
|
|
@@ -20,7 +20,7 @@ class SpoListSiteScriptGetCommand extends SpoCommand_1.default {
|
|
|
20
20
|
}
|
|
21
21
|
commandAction(logger, args, cb) {
|
|
22
22
|
if (this.verbose) {
|
|
23
|
-
const list = args.options.listId ?
|
|
23
|
+
const list = (args.options.listId ? args.options.listId : args.options.listTitle);
|
|
24
24
|
logger.logToStderr(`Extracting Site Script from list ${list} in site at ${args.options.webUrl}...`);
|
|
25
25
|
}
|
|
26
26
|
let requestUrl = '';
|
|
@@ -28,13 +28,13 @@ class SpoListSiteScriptGetCommand extends SpoCommand_1.default {
|
|
|
28
28
|
if (this.debug) {
|
|
29
29
|
logger.logToStderr(`Retrieving List Url from Id '${args.options.listId}'...`);
|
|
30
30
|
}
|
|
31
|
-
requestUrl = `${args.options.webUrl}/_api/web/lists(guid'${
|
|
31
|
+
requestUrl = `${args.options.webUrl}/_api/web/lists(guid'${utils_1.formatting.encodeQueryParameter(args.options.listId)}')?$expand=RootFolder`;
|
|
32
32
|
}
|
|
33
33
|
else {
|
|
34
34
|
if (this.debug) {
|
|
35
35
|
logger.logToStderr(`Retrieving List Url from Title '${args.options.listTitle}'...`);
|
|
36
36
|
}
|
|
37
|
-
requestUrl = `${args.options.webUrl}/_api/web/lists/GetByTitle('${
|
|
37
|
+
requestUrl = `${args.options.webUrl}/_api/web/lists/GetByTitle('${utils_1.formatting.encodeQueryParameter(args.options.listTitle)}')?$expand=RootFolder`;
|
|
38
38
|
}
|
|
39
39
|
const requestOptions = {
|
|
40
40
|
url: requestUrl,
|
|
@@ -57,13 +57,13 @@ class SpoListViewAddCommand extends SpoCommand_1.default {
|
|
|
57
57
|
getRestUrl(options) {
|
|
58
58
|
let result = `${options.webUrl}/_api/web/`;
|
|
59
59
|
if (options.listId) {
|
|
60
|
-
result += `lists(guid'${
|
|
60
|
+
result += `lists(guid'${utils_1.formatting.encodeQueryParameter(options.listId)}')`;
|
|
61
61
|
}
|
|
62
62
|
else if (options.listTitle) {
|
|
63
|
-
result += `lists/getByTitle('${
|
|
63
|
+
result += `lists/getByTitle('${utils_1.formatting.encodeQueryParameter(options.listTitle)}')`;
|
|
64
64
|
}
|
|
65
65
|
else if (options.listUrl) {
|
|
66
|
-
result += `GetList('${
|
|
66
|
+
result += `GetList('${utils_1.formatting.encodeQueryParameter(utils_1.urlUtil.getServerRelativePath(options.webUrl, options.listUrl))}')`;
|
|
67
67
|
}
|
|
68
68
|
result += '/views/add';
|
|
69
69
|
return result;
|
|
@@ -23,7 +23,7 @@ class SpoListViewFieldAddCommand extends SpoCommand_1.default {
|
|
|
23
23
|
return telemetryProps;
|
|
24
24
|
}
|
|
25
25
|
commandAction(logger, args, cb) {
|
|
26
|
-
const listSelector = args.options.listId ? `(guid'${
|
|
26
|
+
const listSelector = args.options.listId ? `(guid'${utils_1.formatting.encodeQueryParameter(args.options.listId)}')` : `/GetByTitle('${utils_1.formatting.encodeQueryParameter(args.options.listTitle)}')`;
|
|
27
27
|
let viewSelector = '';
|
|
28
28
|
let currentField;
|
|
29
29
|
if (this.verbose) {
|
|
@@ -36,7 +36,7 @@ class SpoListViewFieldAddCommand extends SpoCommand_1.default {
|
|
|
36
36
|
logger.logToStderr(`Adding the field ${args.options.fieldId || args.options.fieldTitle} to the view ${args.options.viewId || args.options.viewTitle}...`);
|
|
37
37
|
}
|
|
38
38
|
currentField = field;
|
|
39
|
-
viewSelector = args.options.viewId ? `('${
|
|
39
|
+
viewSelector = args.options.viewId ? `('${utils_1.formatting.encodeQueryParameter(args.options.viewId)}')` : `/GetByTitle('${utils_1.formatting.encodeQueryParameter(args.options.viewTitle)}')`;
|
|
40
40
|
const postRequestUrl = `${args.options.webUrl}/_api/web/lists${listSelector}/views${viewSelector}/viewfields/addviewfield('${field.InternalName}')`;
|
|
41
41
|
const postRequestOptions = {
|
|
42
42
|
url: postRequestUrl,
|