@pnp/cli-microsoft365 6.0.0-beta.7d5fdf6 → 6.0.0-beta.b689fd4
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/dist/m365/aad/commands/app/app-remove.js +0 -4
- package/dist/m365/aad/commands/app/app-role-remove.js +0 -4
- package/dist/m365/aad/commands/o365group/o365group-recyclebinitem-restore.js +60 -9
- package/dist/m365/aad/commands.js +0 -2
- package/dist/m365/planner/commands/bucket/bucket-add.js +4 -12
- package/dist/m365/planner/commands/bucket/bucket-get.js +4 -12
- package/dist/m365/planner/commands/bucket/bucket-list.js +4 -12
- package/dist/m365/planner/commands/bucket/bucket-remove.js +4 -12
- package/dist/m365/planner/commands/bucket/bucket-set.js +4 -12
- package/dist/m365/planner/commands/plan/plan-get.js +0 -4
- package/dist/m365/planner/commands/task/task-add.js +4 -10
- package/dist/m365/planner/commands/task/task-get.js +4 -19
- package/dist/m365/planner/commands/task/task-list.js +4 -12
- package/dist/m365/planner/commands/task/task-set.js +4 -10
- package/dist/m365/planner/commands.js +0 -2
- package/dist/m365/spo/commands/customaction/customaction-get.js +32 -4
- package/dist/m365/spo/commands/customaction/customaction-remove.js +43 -8
- package/dist/m365/spo/commands/list/list-list.js +1 -10
- package/dist/m365/spo/commands/listitem/listitem-list.js +4 -25
- package/dist/m365/spo/commands/site/site-list.js +47 -16
- package/dist/m365/spo/commands/site/site-set.js +322 -162
- package/dist/m365/spo/commands/tenant/tenant-appcatalog-add.js +9 -6
- package/dist/m365/spo/commands.js +0 -3
- package/dist/m365/teams/commands/team/team-clone.js +33 -7
- package/dist/m365/teams/commands/team/team-set.js +25 -5
- package/docs/docs/cmd/aad/app/app-remove.md +0 -6
- package/docs/docs/cmd/aad/app/app-role-remove.md +0 -6
- package/docs/docs/cmd/aad/o365group/o365group-recyclebinitem-restore.md +21 -3
- package/docs/docs/cmd/planner/bucket/bucket-add.md +0 -3
- package/docs/docs/cmd/planner/bucket/bucket-get.md +0 -3
- package/docs/docs/cmd/planner/bucket/bucket-list.md +0 -3
- package/docs/docs/cmd/planner/bucket/bucket-remove.md +0 -3
- package/docs/docs/cmd/planner/bucket/bucket-set.md +0 -3
- package/docs/docs/cmd/planner/plan/plan-get.md +0 -6
- package/docs/docs/cmd/planner/task/task-add.md +0 -3
- package/docs/docs/cmd/planner/task/task-get.md +0 -3
- package/docs/docs/cmd/planner/task/task-list.md +0 -3
- package/docs/docs/cmd/planner/task/task-set.md +0 -3
- package/docs/docs/cmd/spo/customaction/customaction-get.md +15 -2
- package/docs/docs/cmd/spo/customaction/customaction-remove.md +33 -2
- package/docs/docs/cmd/spo/list/list-list.md +0 -3
- package/docs/docs/cmd/spo/listitem/listitem-list.md +0 -6
- package/docs/docs/cmd/spo/site/site-list.md +19 -7
- package/docs/docs/cmd/spo/site/site-set.md +50 -6
- package/docs/docs/cmd/teams/team/team-clone.md +11 -5
- package/docs/docs/cmd/teams/team/team-set.md +10 -4
- package/npm-shrinkwrap.json +173 -158
- package/package.json +13 -13
- package/dist/m365/spo/commands/site/site-classic-add.js +0 -333
- package/dist/m365/spo/commands/site/site-classic-list.js +0 -98
- package/dist/m365/spo/commands/site/site-classic-set.js +0 -358
- package/docs/docs/cmd/spo/site/site-classic-add.md +0 -93
- package/docs/docs/cmd/spo/site/site-classic-list.md +0 -65
- package/docs/docs/cmd/spo/site/site-classic-set.md +0 -99
|
@@ -8,7 +8,6 @@ exports.default = {
|
|
|
8
8
|
BUCKET_SET: `${prefix} bucket set`,
|
|
9
9
|
BUCKET_REMOVE: `${prefix} bucket remove`,
|
|
10
10
|
PLAN_ADD: `${prefix} plan add`,
|
|
11
|
-
PLAN_DETAILS_GET: `${prefix} plan details get`,
|
|
12
11
|
PLAN_GET: `${prefix} plan get`,
|
|
13
12
|
PLAN_LIST: `${prefix} plan list`,
|
|
14
13
|
PLAN_REMOVE: `${prefix} plan remove`,
|
|
@@ -16,7 +15,6 @@ exports.default = {
|
|
|
16
15
|
TASK_CHECKLISTITEM_ADD: `${prefix} task checklistitem add`,
|
|
17
16
|
TASK_CHECKLISTITEM_LIST: `${prefix} task checklistitem list`,
|
|
18
17
|
TASK_CHECKLISTITEM_REMOVE: `${prefix} task checklistitem remove`,
|
|
19
|
-
TASK_DETAILS_GET: `${prefix} task details get`,
|
|
20
18
|
TASK_GET: `${prefix} task get`,
|
|
21
19
|
TASK_LIST: `${prefix} task list`,
|
|
22
20
|
TASK_REFERENCE_ADD: `${prefix} task reference add`,
|
|
@@ -11,6 +11,11 @@ class SpoCustomActionGetCommand extends SpoCommand_1.default {
|
|
|
11
11
|
get description() {
|
|
12
12
|
return 'Gets details for the specified custom action';
|
|
13
13
|
}
|
|
14
|
+
optionSets() {
|
|
15
|
+
return [
|
|
16
|
+
['id', 'title']
|
|
17
|
+
];
|
|
18
|
+
}
|
|
14
19
|
getTelemetryProperties(args) {
|
|
15
20
|
const telemetryProps = super.getTelemetryProperties(args);
|
|
16
21
|
telemetryProps.scope = args.options.scope || 'All';
|
|
@@ -56,14 +61,34 @@ class SpoCustomActionGetCommand extends SpoCommand_1.default {
|
|
|
56
61
|
}, (err) => this.handleRejectedPromise(err, logger, cb));
|
|
57
62
|
}
|
|
58
63
|
getCustomAction(options) {
|
|
64
|
+
const filter = options.id ?
|
|
65
|
+
`('${encodeURIComponent(options.id)}')` :
|
|
66
|
+
`?$filter=Title eq '${encodeURIComponent(options.title)}'`;
|
|
59
67
|
const requestOptions = {
|
|
60
|
-
url: `${options.url}/_api/${options.scope}/UserCustomActions
|
|
68
|
+
url: `${options.url}/_api/${options.scope}/UserCustomActions${filter}`,
|
|
61
69
|
headers: {
|
|
62
70
|
accept: 'application/json;odata=nometadata'
|
|
63
71
|
},
|
|
64
72
|
responseType: 'json'
|
|
65
73
|
};
|
|
66
|
-
|
|
74
|
+
if (options.id) {
|
|
75
|
+
return request_1.default
|
|
76
|
+
.get(requestOptions)
|
|
77
|
+
.then((res) => {
|
|
78
|
+
return Promise.resolve(res);
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
return request_1.default
|
|
82
|
+
.get(requestOptions)
|
|
83
|
+
.then((res) => {
|
|
84
|
+
if (res.value.length === 1) {
|
|
85
|
+
return Promise.resolve(res.value[0]);
|
|
86
|
+
}
|
|
87
|
+
if (res.value.length === 0) {
|
|
88
|
+
return Promise.reject(`No user custom action with title '${options.title}' found`);
|
|
89
|
+
}
|
|
90
|
+
return Promise.reject(`Multiple user custom actions with title '${options.title}' found. Please disambiguate using IDs: ${res.value.map(a => a.Id).join(', ')}`);
|
|
91
|
+
});
|
|
67
92
|
}
|
|
68
93
|
/**
|
|
69
94
|
* Get request with `web` scope is send first.
|
|
@@ -104,7 +129,10 @@ class SpoCustomActionGetCommand extends SpoCommand_1.default {
|
|
|
104
129
|
options() {
|
|
105
130
|
const options = [
|
|
106
131
|
{
|
|
107
|
-
option: '-i, --id
|
|
132
|
+
option: '-i, --id [id]'
|
|
133
|
+
},
|
|
134
|
+
{
|
|
135
|
+
option: '-t, --title [title]'
|
|
108
136
|
},
|
|
109
137
|
{
|
|
110
138
|
option: '-u, --url <url>'
|
|
@@ -118,7 +146,7 @@ class SpoCustomActionGetCommand extends SpoCommand_1.default {
|
|
|
118
146
|
return options.concat(parentOptions);
|
|
119
147
|
}
|
|
120
148
|
validate(args) {
|
|
121
|
-
if (utils_1.validation.isValidGuid(args.options.id) === false) {
|
|
149
|
+
if (args.options.id && utils_1.validation.isValidGuid(args.options.id) === false) {
|
|
122
150
|
return `${args.options.id} is not valid. Custom action id (Guid) expected.`;
|
|
123
151
|
}
|
|
124
152
|
if (utils_1.validation.isValidSharePointUrl(args.options.url) !== true) {
|
|
@@ -12,6 +12,11 @@ class SpoCustomActionRemoveCommand extends SpoCommand_1.default {
|
|
|
12
12
|
get description() {
|
|
13
13
|
return 'Removes the specified custom action';
|
|
14
14
|
}
|
|
15
|
+
optionSets() {
|
|
16
|
+
return [
|
|
17
|
+
['id', 'title']
|
|
18
|
+
];
|
|
19
|
+
}
|
|
15
20
|
getTelemetryProperties(args) {
|
|
16
21
|
const telemetryProps = super.getTelemetryProperties(args);
|
|
17
22
|
telemetryProps.scope = args.options.scope || 'All';
|
|
@@ -54,16 +59,43 @@ class SpoCustomActionRemoveCommand extends SpoCommand_1.default {
|
|
|
54
59
|
});
|
|
55
60
|
}
|
|
56
61
|
}
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
62
|
+
getCustomActionId(options) {
|
|
63
|
+
if (options.id) {
|
|
64
|
+
return Promise.resolve(options.id);
|
|
65
|
+
}
|
|
66
|
+
const customActionRequestOptions = {
|
|
67
|
+
url: `${options.url}/_api/${options.scope}/UserCustomActions?$filter=Title eq '${encodeURIComponent(options.title)}'`,
|
|
60
68
|
headers: {
|
|
61
|
-
accept: 'application/json;odata=nometadata'
|
|
62
|
-
'X-HTTP-Method': 'DELETE'
|
|
69
|
+
accept: 'application/json;odata=nometadata'
|
|
63
70
|
},
|
|
64
71
|
responseType: 'json'
|
|
65
72
|
};
|
|
66
|
-
return request_1.default
|
|
73
|
+
return request_1.default
|
|
74
|
+
.get(customActionRequestOptions)
|
|
75
|
+
.then((res) => {
|
|
76
|
+
if (res.value.length === 1) {
|
|
77
|
+
return Promise.resolve(res.value[0].Id);
|
|
78
|
+
}
|
|
79
|
+
if (res.value.length === 0) {
|
|
80
|
+
return Promise.reject(`No user custom action with title '${options.title}' found`);
|
|
81
|
+
}
|
|
82
|
+
return Promise.reject(`Multiple user custom actions with title '${options.title}' found. Please disambiguate using IDs: ${res.value.map(a => a.Id).join(', ')}`);
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
removeScopedCustomAction(options) {
|
|
86
|
+
return this
|
|
87
|
+
.getCustomActionId(options)
|
|
88
|
+
.then((customActionId) => {
|
|
89
|
+
const requestOptions = {
|
|
90
|
+
url: `${options.url}/_api/${options.scope}/UserCustomActions('${encodeURIComponent(customActionId)}')')`,
|
|
91
|
+
headers: {
|
|
92
|
+
accept: 'application/json;odata=nometadata',
|
|
93
|
+
'X-HTTP-Method': 'DELETE'
|
|
94
|
+
},
|
|
95
|
+
responseType: 'json'
|
|
96
|
+
};
|
|
97
|
+
return request_1.default.post(requestOptions);
|
|
98
|
+
});
|
|
67
99
|
}
|
|
68
100
|
/**
|
|
69
101
|
* Remove request with `web` scope is send first.
|
|
@@ -95,7 +127,10 @@ class SpoCustomActionRemoveCommand extends SpoCommand_1.default {
|
|
|
95
127
|
options() {
|
|
96
128
|
const options = [
|
|
97
129
|
{
|
|
98
|
-
option: '-i, --id
|
|
130
|
+
option: '-i, --id [id]'
|
|
131
|
+
},
|
|
132
|
+
{
|
|
133
|
+
option: '-t, --title [title]'
|
|
99
134
|
},
|
|
100
135
|
{
|
|
101
136
|
option: '-u, --url <url>'
|
|
@@ -112,7 +147,7 @@ class SpoCustomActionRemoveCommand extends SpoCommand_1.default {
|
|
|
112
147
|
return options.concat(parentOptions);
|
|
113
148
|
}
|
|
114
149
|
validate(args) {
|
|
115
|
-
if (utils_1.validation.isValidGuid(args.options.id) === false) {
|
|
150
|
+
if (args.options.id && utils_1.validation.isValidGuid(args.options.id) === false) {
|
|
116
151
|
return `${args.options.id} is not valid. Custom action Id (GUID) expected.`;
|
|
117
152
|
}
|
|
118
153
|
if (utils_1.validation.isValidSharePointUrl(args.options.url) !== true) {
|
|
@@ -14,18 +14,12 @@ 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
|
-
}
|
|
22
17
|
commandAction(logger, args, cb) {
|
|
23
18
|
if (this.verbose) {
|
|
24
19
|
logger.logToStderr(`Retrieving all lists in site at ${args.options.webUrl}...`);
|
|
25
20
|
}
|
|
26
|
-
const suffix = args.options.executeWithLimitedPermissions ? '&$select=RootFolder/ServerRelativeUrl,*' : '';
|
|
27
21
|
const requestOptions = {
|
|
28
|
-
url: `${args.options.webUrl}/_api/web/lists?$expand=RootFolder
|
|
22
|
+
url: `${args.options.webUrl}/_api/web/lists?$expand=RootFolder&$select=RootFolder/ServerRelativeUrl,*`,
|
|
29
23
|
method: 'GET',
|
|
30
24
|
headers: {
|
|
31
25
|
'accept': 'application/json;odata=nometadata'
|
|
@@ -46,9 +40,6 @@ class SpoListListCommand extends SpoCommand_1.default {
|
|
|
46
40
|
const options = [
|
|
47
41
|
{
|
|
48
42
|
option: '-u, --webUrl <webUrl>'
|
|
49
|
-
},
|
|
50
|
-
{
|
|
51
|
-
option: '--executeWithLimitedPermissions'
|
|
52
43
|
}
|
|
53
44
|
];
|
|
54
45
|
const parentOptions = super.options();
|
|
@@ -13,10 +13,8 @@ class SpoListItemListCommand extends SpoCommand_1.default {
|
|
|
13
13
|
}
|
|
14
14
|
getTelemetryProperties(args) {
|
|
15
15
|
const telemetryProps = super.getTelemetryProperties(args);
|
|
16
|
-
telemetryProps.id = typeof args.options.id !== 'undefined';
|
|
17
16
|
telemetryProps.listId = typeof args.options.listId !== 'undefined';
|
|
18
17
|
telemetryProps.listTitle = typeof args.options.listTitle !== 'undefined';
|
|
19
|
-
telemetryProps.title = typeof args.options.title !== 'undefined';
|
|
20
18
|
telemetryProps.fields = typeof args.options.fields !== 'undefined';
|
|
21
19
|
telemetryProps.filter = typeof args.options.filter !== 'undefined';
|
|
22
20
|
telemetryProps.pageNumber = typeof args.options.pageNumber !== 'undefined';
|
|
@@ -25,14 +23,8 @@ class SpoListItemListCommand extends SpoCommand_1.default {
|
|
|
25
23
|
return telemetryProps;
|
|
26
24
|
}
|
|
27
25
|
commandAction(logger, args, cb) {
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
}
|
|
31
|
-
if (args.options.title) {
|
|
32
|
-
this.warn(logger, `Option 'title' is deprecated. Please use 'listTitle' instead.`);
|
|
33
|
-
}
|
|
34
|
-
const listIdArgument = args.options.listId || args.options.id || '';
|
|
35
|
-
const listTitleArgument = args.options.listTitle || args.options.title || '';
|
|
26
|
+
const listIdArgument = args.options.listId || '';
|
|
27
|
+
const listTitleArgument = args.options.listTitle || '';
|
|
36
28
|
let formDigestValue = '';
|
|
37
29
|
const fieldsArray = args.options.fields ? args.options.fields.split(",")
|
|
38
30
|
: (!args.options.output || args.options.output === "text") ? ["Title", "Id"] : [];
|
|
@@ -111,12 +103,6 @@ class SpoListItemListCommand extends SpoCommand_1.default {
|
|
|
111
103
|
{
|
|
112
104
|
option: '-u, --webUrl <webUrl>'
|
|
113
105
|
},
|
|
114
|
-
{
|
|
115
|
-
option: '--id [id]'
|
|
116
|
-
},
|
|
117
|
-
{
|
|
118
|
-
option: '--title [title]'
|
|
119
|
-
},
|
|
120
106
|
{
|
|
121
107
|
option: '-i, --listId [listId]'
|
|
122
108
|
},
|
|
@@ -161,14 +147,10 @@ class SpoListItemListCommand extends SpoCommand_1.default {
|
|
|
161
147
|
if (isValidSharePointUrl !== true) {
|
|
162
148
|
return isValidSharePointUrl;
|
|
163
149
|
}
|
|
164
|
-
if (!args.options.
|
|
150
|
+
if (!args.options.listId && !args.options.listTitle) {
|
|
165
151
|
return `Specify listId or listTitle`;
|
|
166
152
|
}
|
|
167
|
-
if (args.options.
|
|
168
|
-
return `Specify list id or title but not both`;
|
|
169
|
-
}
|
|
170
|
-
// Check if only one of the 4 options is specified
|
|
171
|
-
if ([args.options.id, args.options.title, args.options.listId, args.options.listTitle].filter(o => o).length > 1) {
|
|
153
|
+
if (args.options.listId && args.options.listTitle) {
|
|
172
154
|
return 'Specify listId or listTitle but not both';
|
|
173
155
|
}
|
|
174
156
|
if (args.options.camlQuery && args.options.fields) {
|
|
@@ -192,9 +174,6 @@ class SpoListItemListCommand extends SpoCommand_1.default {
|
|
|
192
174
|
if (args.options.listId && !utils_1.validation.isValidGuid(args.options.listId)) {
|
|
193
175
|
return `${args.options.listId} is not a valid GUID`;
|
|
194
176
|
}
|
|
195
|
-
if (args.options.id && !utils_1.validation.isValidGuid(args.options.id)) {
|
|
196
|
-
return `${args.options.id} in option id is not a valid GUID`;
|
|
197
|
-
}
|
|
198
177
|
return true;
|
|
199
178
|
}
|
|
200
179
|
}
|
|
@@ -10,22 +10,25 @@ class SpoSiteListCommand extends SpoCommand_1.default {
|
|
|
10
10
|
return commands_1.default.SITE_LIST;
|
|
11
11
|
}
|
|
12
12
|
get description() {
|
|
13
|
-
return 'Lists
|
|
13
|
+
return 'Lists sites of the given type';
|
|
14
14
|
}
|
|
15
15
|
getTelemetryProperties(args) {
|
|
16
16
|
const telemetryProps = super.getTelemetryProperties(args);
|
|
17
|
-
telemetryProps.
|
|
17
|
+
telemetryProps.webTemplate = args.options.webTemplate;
|
|
18
18
|
telemetryProps.filter = (!(!args.options.filter)).toString();
|
|
19
|
-
telemetryProps.
|
|
19
|
+
telemetryProps.includeOneDriveSites = typeof args.options.includeOneDriveSites !== 'undefined';
|
|
20
|
+
telemetryProps.deleted = typeof args.options.deleted !== 'undefined';
|
|
21
|
+
telemetryProps.siteType = args.options.type;
|
|
20
22
|
return telemetryProps;
|
|
21
23
|
}
|
|
22
24
|
defaultProperties() {
|
|
23
25
|
return ['Title', 'Url'];
|
|
24
26
|
}
|
|
25
27
|
commandAction(logger, args, cb) {
|
|
26
|
-
const
|
|
27
|
-
const
|
|
28
|
-
|
|
28
|
+
const webTemplate = this.getWebTemplateId(args.options);
|
|
29
|
+
const includeOneDriveSites = args.options.includeOneDriveSites || false;
|
|
30
|
+
const personalSite = includeOneDriveSites === false ? '0' : '1';
|
|
31
|
+
let spoAdminUrl = '';
|
|
29
32
|
utils_1.spo
|
|
30
33
|
.getSpoAdminUrl(logger, this.debug)
|
|
31
34
|
.then((_spoAdminUrl) => {
|
|
@@ -34,19 +37,19 @@ class SpoSiteListCommand extends SpoCommand_1.default {
|
|
|
34
37
|
logger.logToStderr(`Retrieving list of site collections...`);
|
|
35
38
|
}
|
|
36
39
|
this.allSites = [];
|
|
37
|
-
return this.getAllSites(spoAdminUrl, utils_1.formatting.escapeXml(args.options.filter || ''), '0', webTemplate, undefined, args.options.deleted, logger);
|
|
40
|
+
return this.getAllSites(spoAdminUrl, utils_1.formatting.escapeXml(args.options.filter || ''), '0', personalSite, webTemplate, undefined, args.options.deleted, logger);
|
|
38
41
|
})
|
|
39
42
|
.then(_ => {
|
|
40
43
|
logger.log(this.allSites);
|
|
41
44
|
cb();
|
|
42
45
|
}, (err) => this.handleRejectedPromise(err, logger, cb));
|
|
43
46
|
}
|
|
44
|
-
getAllSites(spoAdminUrl, filter, startIndex, webTemplate, formDigest, deleted, logger) {
|
|
47
|
+
getAllSites(spoAdminUrl, filter, startIndex, personalSite, webTemplate, formDigest, deleted, logger) {
|
|
45
48
|
return new Promise((resolve, reject) => {
|
|
46
49
|
utils_1.spo
|
|
47
50
|
.ensureFormDigest(spoAdminUrl, logger, formDigest, this.debug)
|
|
48
51
|
.then((res) => {
|
|
49
|
-
let requestBody = `<Request AddExpandoFieldTypeSuffix="true" SchemaVersion="15.0.0.0" LibraryVersion="16.0.0.0" ApplicationName="${config_1.default.applicationName}" xmlns="http://schemas.microsoft.com/sharepoint/clientquery/2009"><Actions><ObjectPath Id="2" ObjectPathId="1" /><ObjectPath Id="4" ObjectPathId="3" /><Query Id="5" ObjectPathId="3"><Query SelectAllProperties="true"><Properties /></Query><ChildItemQuery SelectAllProperties="true"><Properties /></ChildItemQuery></Query></Actions><ObjectPaths><Constructor Id="1" TypeId="{268004ae-ef6b-4e9b-8425-127220d84719}" /><Method Id="3" ParentId="1" Name="GetSitePropertiesFromSharePointByFilters"><Parameters><Parameter TypeId="{b92aeee2-c92c-4b67-abcc-024e471bc140}"><Property Name="Filter" Type="String">${filter}</Property><Property Name="IncludeDetail" Type="Boolean">false</Property><Property Name="IncludePersonalSite" Type="Enum"
|
|
52
|
+
let requestBody = `<Request AddExpandoFieldTypeSuffix="true" SchemaVersion="15.0.0.0" LibraryVersion="16.0.0.0" ApplicationName="${config_1.default.applicationName}" xmlns="http://schemas.microsoft.com/sharepoint/clientquery/2009"><Actions><ObjectPath Id="2" ObjectPathId="1" /><ObjectPath Id="4" ObjectPathId="3" /><Query Id="5" ObjectPathId="3"><Query SelectAllProperties="true"><Properties /></Query><ChildItemQuery SelectAllProperties="true"><Properties /></ChildItemQuery></Query></Actions><ObjectPaths><Constructor Id="1" TypeId="{268004ae-ef6b-4e9b-8425-127220d84719}" /><Method Id="3" ParentId="1" Name="GetSitePropertiesFromSharePointByFilters"><Parameters><Parameter TypeId="{b92aeee2-c92c-4b67-abcc-024e471bc140}"><Property Name="Filter" Type="String">${filter}</Property><Property Name="IncludeDetail" Type="Boolean">false</Property><Property Name="IncludePersonalSite" Type="Enum">${personalSite}</Property><Property Name="StartIndex" Type="String">${startIndex}</Property><Property Name="Template" Type="String">${webTemplate}</Property></Parameter></Parameters></Method></ObjectPaths></Request>`;
|
|
50
53
|
if (deleted) {
|
|
51
54
|
requestBody = `<Request AddExpandoFieldTypeSuffix="true" SchemaVersion="15.0.0.0" LibraryVersion="16.0.0.0" ApplicationName="${config_1.default.applicationName}" xmlns="http://schemas.microsoft.com/sharepoint/clientquery/2009"><Actions><ObjectPath Id="4" ObjectPathId="3" /><ObjectPath Id="6" ObjectPathId="5" /><Query Id="7" ObjectPathId="5"><Query SelectAllProperties="true"><Properties><Property Name="NextStartIndexFromSharePoint" ScalarProperty="true" /></Properties></Query><ChildItemQuery SelectAllProperties="true"><Properties /></ChildItemQuery></Query></Actions><ObjectPaths><Constructor Id="3" TypeId="{268004ae-ef6b-4e9b-8425-127220d84719}" /><Method Id="5" ParentId="3" Name="GetDeletedSitePropertiesFromSharePoint"><Parameters><Parameter Type="String">${startIndex}</Parameter></Parameters></Method></ObjectPaths></Request>`;
|
|
52
55
|
}
|
|
@@ -71,7 +74,7 @@ class SpoSiteListCommand extends SpoCommand_1.default {
|
|
|
71
74
|
this.allSites.push(...sites._Child_Items_);
|
|
72
75
|
if (sites.NextStartIndexFromSharePoint) {
|
|
73
76
|
this
|
|
74
|
-
.getAllSites(spoAdminUrl, filter, sites.NextStartIndexFromSharePoint, webTemplate, formDigest, deleted, logger)
|
|
77
|
+
.getAllSites(spoAdminUrl, filter, sites.NextStartIndexFromSharePoint, personalSite, webTemplate, formDigest, deleted, logger)
|
|
75
78
|
.then(_ => resolve(), err => reject(err));
|
|
76
79
|
}
|
|
77
80
|
else {
|
|
@@ -81,15 +84,37 @@ class SpoSiteListCommand extends SpoCommand_1.default {
|
|
|
81
84
|
}, err => reject(err));
|
|
82
85
|
});
|
|
83
86
|
}
|
|
87
|
+
getWebTemplateId(options) {
|
|
88
|
+
if (options.webTemplate) {
|
|
89
|
+
return options.webTemplate;
|
|
90
|
+
}
|
|
91
|
+
if (options.includeOneDriveSites) {
|
|
92
|
+
return '';
|
|
93
|
+
}
|
|
94
|
+
switch (options.type) {
|
|
95
|
+
case "TeamSite":
|
|
96
|
+
return 'GROUP#0';
|
|
97
|
+
case "CommunicationSite":
|
|
98
|
+
return 'SITEPAGEPUBLISHING#0';
|
|
99
|
+
default:
|
|
100
|
+
return '';
|
|
101
|
+
}
|
|
102
|
+
}
|
|
84
103
|
options() {
|
|
85
104
|
const options = [
|
|
86
105
|
{
|
|
87
|
-
option: '--type [type]',
|
|
106
|
+
option: '-t, --type [type]',
|
|
88
107
|
autocomplete: ['TeamSite', 'CommunicationSite']
|
|
89
108
|
},
|
|
109
|
+
{
|
|
110
|
+
option: '--webTemplate [webTemplate]'
|
|
111
|
+
},
|
|
90
112
|
{
|
|
91
113
|
option: '-f, --filter [filter]'
|
|
92
114
|
},
|
|
115
|
+
{
|
|
116
|
+
option: '--includeOneDriveSites'
|
|
117
|
+
},
|
|
93
118
|
{
|
|
94
119
|
option: '--deleted'
|
|
95
120
|
}
|
|
@@ -98,11 +123,17 @@ class SpoSiteListCommand extends SpoCommand_1.default {
|
|
|
98
123
|
return options.concat(parentOptions);
|
|
99
124
|
}
|
|
100
125
|
validate(args) {
|
|
101
|
-
if (args.options.type) {
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
126
|
+
if (args.options.type && args.options.webTemplate) {
|
|
127
|
+
return 'Specify either type or webTemplate, but not both';
|
|
128
|
+
}
|
|
129
|
+
const typeValues = ['TeamSite', 'CommunicationSite'];
|
|
130
|
+
if (args.options.type &&
|
|
131
|
+
typeValues.indexOf(args.options.type) < 0) {
|
|
132
|
+
return `${args.options.type} is not a valid value for the type option. Allowed values are ${typeValues.join('|')}`;
|
|
133
|
+
}
|
|
134
|
+
if (args.options.includeOneDriveSites
|
|
135
|
+
&& (args.options.type || args.options.webTemplate)) {
|
|
136
|
+
return 'When using includeOneDriveSites, don\'t specify the type or webTemplate options';
|
|
106
137
|
}
|
|
107
138
|
return true;
|
|
108
139
|
}
|