@pnp/cli-microsoft365 6.0.0-beta.a644c64 → 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.
Files changed (46) hide show
  1. package/dist/m365/aad/commands/o365group/o365group-recyclebinitem-restore.js +60 -9
  2. package/dist/m365/planner/commands/bucket/bucket-add.js +4 -12
  3. package/dist/m365/planner/commands/bucket/bucket-get.js +4 -12
  4. package/dist/m365/planner/commands/bucket/bucket-list.js +4 -12
  5. package/dist/m365/planner/commands/bucket/bucket-remove.js +4 -12
  6. package/dist/m365/planner/commands/bucket/bucket-set.js +4 -12
  7. package/dist/m365/planner/commands/plan/plan-get.js +0 -4
  8. package/dist/m365/planner/commands/task/task-add.js +4 -10
  9. package/dist/m365/planner/commands/task/task-get.js +4 -19
  10. package/dist/m365/planner/commands/task/task-list.js +4 -12
  11. package/dist/m365/planner/commands/task/task-set.js +4 -10
  12. package/dist/m365/planner/commands.js +0 -2
  13. package/dist/m365/spo/commands/customaction/customaction-get.js +32 -4
  14. package/dist/m365/spo/commands/customaction/customaction-remove.js +43 -8
  15. package/dist/m365/spo/commands/list/list-list.js +1 -10
  16. package/dist/m365/spo/commands/site/site-list.js +47 -16
  17. package/dist/m365/spo/commands/site/site-set.js +322 -162
  18. package/dist/m365/spo/commands/tenant/tenant-appcatalog-add.js +9 -6
  19. package/dist/m365/spo/commands.js +0 -3
  20. package/dist/m365/teams/commands/team/team-clone.js +33 -7
  21. package/dist/m365/teams/commands/team/team-set.js +25 -5
  22. package/docs/docs/cmd/aad/o365group/o365group-recyclebinitem-restore.md +21 -3
  23. package/docs/docs/cmd/planner/bucket/bucket-add.md +0 -3
  24. package/docs/docs/cmd/planner/bucket/bucket-get.md +0 -3
  25. package/docs/docs/cmd/planner/bucket/bucket-list.md +0 -3
  26. package/docs/docs/cmd/planner/bucket/bucket-remove.md +0 -3
  27. package/docs/docs/cmd/planner/bucket/bucket-set.md +0 -3
  28. package/docs/docs/cmd/planner/plan/plan-get.md +0 -6
  29. package/docs/docs/cmd/planner/task/task-add.md +0 -3
  30. package/docs/docs/cmd/planner/task/task-get.md +0 -3
  31. package/docs/docs/cmd/planner/task/task-list.md +0 -3
  32. package/docs/docs/cmd/planner/task/task-set.md +0 -3
  33. package/docs/docs/cmd/spo/customaction/customaction-get.md +15 -2
  34. package/docs/docs/cmd/spo/customaction/customaction-remove.md +33 -2
  35. package/docs/docs/cmd/spo/list/list-list.md +0 -3
  36. package/docs/docs/cmd/spo/site/site-list.md +19 -7
  37. package/docs/docs/cmd/spo/site/site-set.md +50 -6
  38. package/docs/docs/cmd/teams/team/team-clone.md +11 -5
  39. package/docs/docs/cmd/teams/team/team-set.md +10 -4
  40. package/package.json +1 -1
  41. package/dist/m365/spo/commands/site/site-classic-add.js +0 -333
  42. package/dist/m365/spo/commands/site/site-classic-list.js +0 -98
  43. package/dist/m365/spo/commands/site/site-classic-set.js +0 -358
  44. package/docs/docs/cmd/spo/site/site-classic-add.md +0 -93
  45. package/docs/docs/cmd/spo/site/site-classic-list.md +0 -65
  46. package/docs/docs/cmd/spo/site/site-classic-set.md +0 -99
@@ -10,11 +10,17 @@ m365 teams team clone [options]
10
10
 
11
11
  ## Options
12
12
 
13
- `-i, --teamId <teamId>`
13
+ `-i, --id [id]`
14
14
  : The ID of the Microsoft Teams team to clone
15
15
 
16
- `-n, --displayName <displayName>`
17
- : The display name for the new Microsoft Teams Team
16
+ `--teamId [teamId]`
17
+ : (deprecated. Use `id` instead) The ID of the Microsoft Teams team to clone
18
+
19
+ `-n, --name [name]`
20
+ : The display name for the new Microsoft Teams Team to clone
21
+
22
+ `--displayName [displayName]`
23
+ : (deprecated. Use `name` instead) The display name for the new Microsoft Teams Team to clone
18
24
 
19
25
  `-p, --partsToClone <partsToClone>`
20
26
  : A comma-separated list of the parts to clone. Allowed values are `apps,channels,members,settings,tabs`
@@ -41,11 +47,11 @@ When tabs are cloned, they are put into an unconfigured state. The first time yo
41
47
  Creates a clone of a Microsoft Teams team with mandatory parameters
42
48
 
43
49
  ```sh
44
- m365 teams team clone --teamId 15d7a78e-fd77-4599-97a5-dbb6372846c5 --displayName "Library Assist" --partsToClone "apps,tabs,settings,channels,members"
50
+ m365 teams team clone --id 15d7a78e-fd77-4599-97a5-dbb6372846c5 --name "Library Assist" --partsToClone "apps,tabs,settings,channels,members"
45
51
  ```
46
52
 
47
53
  Creates a clone of a Microsoft Teams team with mandatory and optional parameters
48
54
 
49
55
  ```sh
50
- m365 teams team clone --teamId 15d7a78e-fd77-4599-97a5-dbb6372846c5 --displayName "Library Assist" --partsToClone "apps,tabs,settings,channels,members" --description "Self help community for library" --classification "Library" --visibility "public"
56
+ m365 teams team clone --id 15d7a78e-fd77-4599-97a5-dbb6372846c5 --name "Library Assist" --partsToClone "apps,tabs,settings,channels,members" --description "Self help community for library" --classification "Library" --visibility "public"
51
57
  ```
@@ -10,11 +10,17 @@ m365 teams team set [options]
10
10
 
11
11
  ## Options
12
12
 
13
- `-i, --teamId <teamId>`
13
+ `-i, --id [id]`
14
14
  : The ID of the Microsoft Teams team for which to update settings
15
15
 
16
+ `--teamId [teamId]`
17
+ : (deprecated. Use `id` instead) The ID of the Microsoft Teams team for which to update settings
18
+
19
+ `-n, --name [name]`
20
+ : The display name for the Microsoft Teams team for which to update settings
21
+
16
22
  `--displayName [displayName]`
17
- : The display name for the Microsoft Teams team
23
+ : (deprecated. Use `name` instead) The display name for the Microsoft Teams team for which to update settings
18
24
 
19
25
  `--description [description]`
20
26
  : The description for the Microsoft Teams team
@@ -35,11 +41,11 @@ m365 teams team set [options]
35
41
  Set Microsoft Teams team visibility as Private
36
42
 
37
43
  ```sh
38
- m365 teams team set --teamId '00000000-0000-0000-0000-000000000000' --visibility Private
44
+ m365 teams team set --id "00000000-0000-0000-0000-000000000000" --visibility Private
39
45
  ```
40
46
 
41
47
  Set Microsoft Teams team classification as MBI
42
48
 
43
49
  ```sh
44
- m365 teams team set --teamId '00000000-0000-0000-0000-000000000000' --classification MBI
50
+ m365 teams team set --id "00000000-0000-0000-0000-000000000000" --classification MBI
45
51
  ```
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pnp/cli-microsoft365",
3
- "version": "6.0.0-beta.a644c64",
3
+ "version": "6.0.0-beta.b689fd4",
4
4
  "description": "Manage Microsoft 365 and SharePoint Framework projects on any platform",
5
5
  "license": "MIT",
6
6
  "main": "./dist/api.js",
@@ -1,333 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const config_1 = require("../../../../config");
4
- const request_1 = require("../../../../request");
5
- const utils_1 = require("../../../../utils");
6
- const SpoCommand_1 = require("../../../base/SpoCommand");
7
- const commands_1 = require("../../commands");
8
- class SpoSiteClassicAddCommand extends SpoCommand_1.default {
9
- get name() {
10
- return commands_1.default.SITE_CLASSIC_ADD;
11
- }
12
- get description() {
13
- return 'Creates new classic site';
14
- }
15
- getTelemetryProperties(args) {
16
- const telemetryProps = super.getTelemetryProperties(args);
17
- telemetryProps.lcid = typeof args.options.lcid !== 'undefined';
18
- telemetryProps.webTemplate = typeof args.options.webTemplate !== 'undefined';
19
- telemetryProps.resourceQuota = typeof args.options.resourceQuota !== 'undefined';
20
- telemetryProps.resourceQuotaWarningLevel = typeof args.options.resourceQuotaWarningLevel !== 'undefined';
21
- telemetryProps.storageQuota = typeof args.options.storageQuota !== 'undefined';
22
- telemetryProps.storageQuotaWarningLevel = typeof args.options.storageQuotaWarningLevel !== 'undefined';
23
- telemetryProps.removeDeletedSite = args.options.removeDeletedSite;
24
- telemetryProps.wait = args.options.wait;
25
- return telemetryProps;
26
- }
27
- commandAction(logger, args, cb) {
28
- this.dots = '';
29
- this.showDeprecationWarning(logger, commands_1.default.SITE_CLASSIC_ADD, commands_1.default.SITE_ADD);
30
- utils_1.spo
31
- .getSpoAdminUrl(logger, this.debug)
32
- .then((_spoAdminUrl) => {
33
- this.spoAdminUrl = _spoAdminUrl;
34
- return utils_1.spo.ensureFormDigest(this.spoAdminUrl, logger, this.context, this.debug);
35
- })
36
- .then((res) => {
37
- this.context = res;
38
- if (args.options.removeDeletedSite) {
39
- return this.siteExistsInTheRecycleBin(args.options.url, logger);
40
- }
41
- else {
42
- // assume site doesn't exist
43
- return Promise.resolve(false);
44
- }
45
- })
46
- .then((exists) => {
47
- if (exists) {
48
- if (this.verbose) {
49
- logger.logToStderr('Site exists in the recycle bin');
50
- }
51
- return this.deleteSiteFromTheRecycleBin(args.options.url, args.options.wait, logger);
52
- }
53
- else {
54
- if (this.verbose) {
55
- logger.logToStderr('Site not found');
56
- }
57
- return Promise.resolve();
58
- }
59
- })
60
- .then(() => {
61
- return utils_1.spo.ensureFormDigest(this.spoAdminUrl, logger, this.context, this.debug);
62
- })
63
- .then((res) => {
64
- this.context = res;
65
- if (this.verbose) {
66
- logger.logToStderr(`Creating site collection ${args.options.url}...`);
67
- }
68
- const lcid = typeof args.options.lcid === 'number' ? args.options.lcid : 1033;
69
- const storageQuota = typeof args.options.storageQuota === 'number' ? args.options.storageQuota : 100;
70
- const storageQuotaWarningLevel = typeof args.options.storageQuotaWarningLevel === 'number' ? args.options.storageQuotaWarningLevel : 100;
71
- const resourceQuota = typeof args.options.resourceQuota === 'number' ? args.options.resourceQuota : 0;
72
- const resourceQuotaWarningLevel = typeof args.options.resourceQuotaWarningLevel === 'number' ? args.options.resourceQuotaWarningLevel : 0;
73
- const webTemplate = args.options.webTemplate || 'STS#0';
74
- const requestOptions = {
75
- url: `${this.spoAdminUrl}/_vti_bin/client.svc/ProcessQuery`,
76
- headers: {
77
- 'X-RequestDigest': this.context.FormDigestValue
78
- },
79
- data: `<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="3"><Query SelectAllProperties="true"><Properties /></Query></Query><Query Id="8" ObjectPathId="5"><Query SelectAllProperties="false"><Properties><Property Name="IsComplete" ScalarProperty="true" /><Property Name="PollingInterval" ScalarProperty="true" /></Properties></Query></Query></Actions><ObjectPaths><Constructor Id="3" TypeId="{268004ae-ef6b-4e9b-8425-127220d84719}" /><Method Id="5" ParentId="3" Name="CreateSite"><Parameters><Parameter TypeId="{11f84fff-b8cf-47b6-8b50-34e692656606}"><Property Name="CompatibilityLevel" Type="Int32">0</Property><Property Name="Lcid" Type="UInt32">${lcid}</Property><Property Name="Owner" Type="String">${utils_1.formatting.escapeXml(args.options.owner)}</Property><Property Name="StorageMaximumLevel" Type="Int64">${storageQuota}</Property><Property Name="StorageWarningLevel" Type="Int64">${storageQuotaWarningLevel}</Property><Property Name="Template" Type="String">${utils_1.formatting.escapeXml(webTemplate)}</Property><Property Name="TimeZoneId" Type="Int32">${args.options.timeZone}</Property><Property Name="Title" Type="String">${utils_1.formatting.escapeXml(args.options.title)}</Property><Property Name="Url" Type="String">${utils_1.formatting.escapeXml(args.options.url)}</Property><Property Name="UserCodeMaximumLevel" Type="Double">${resourceQuota}</Property><Property Name="UserCodeWarningLevel" Type="Double">${resourceQuotaWarningLevel}</Property></Parameter></Parameters></Method></ObjectPaths></Request>`
80
- };
81
- return request_1.default.post(requestOptions);
82
- })
83
- .then((res) => {
84
- return new Promise((resolve, reject) => {
85
- const json = JSON.parse(res);
86
- const response = json[0];
87
- if (response.ErrorInfo) {
88
- reject(response.ErrorInfo.ErrorMessage);
89
- }
90
- else {
91
- const operation = json[json.length - 1];
92
- const isComplete = operation.IsComplete;
93
- if (!args.options.wait || isComplete) {
94
- resolve();
95
- return;
96
- }
97
- setTimeout(() => {
98
- utils_1.spo.waitUntilFinished({
99
- operationId: JSON.stringify(operation._ObjectIdentity_),
100
- siteUrl: this.spoAdminUrl,
101
- resolve,
102
- reject,
103
- logger,
104
- currentContext: this.context,
105
- dots: this.dots,
106
- debug: this.debug,
107
- verbose: this.verbose
108
- });
109
- }, operation.PollingInterval);
110
- }
111
- });
112
- })
113
- .then(_ => cb(), (err) => this.handleRejectedPromise(err, logger, cb));
114
- }
115
- siteExistsInTheRecycleBin(url, logger) {
116
- return new Promise((resolve, reject) => {
117
- utils_1.spo
118
- .ensureFormDigest(this.spoAdminUrl, logger, this.context, this.debug)
119
- .then((res) => {
120
- this.context = res;
121
- if (this.verbose) {
122
- logger.logToStderr(`Checking if the site ${url} exists...`);
123
- }
124
- const requestOptions = {
125
- url: `${this.spoAdminUrl}/_vti_bin/client.svc/ProcessQuery`,
126
- headers: {
127
- 'X-RequestDigest': this.context.FormDigestValue
128
- },
129
- data: `<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="197" ObjectPathId="196" /><ObjectPath Id="199" ObjectPathId="198" /><Query Id="200" ObjectPathId="198"><Query SelectAllProperties="true"><Properties /></Query></Query></Actions><ObjectPaths><Constructor Id="196" TypeId="{268004ae-ef6b-4e9b-8425-127220d84719}" /><Method Id="198" ParentId="196" Name="GetSitePropertiesByUrl"><Parameters><Parameter Type="String">${utils_1.formatting.escapeXml(url)}</Parameter><Parameter Type="Boolean">false</Parameter></Parameters></Method></ObjectPaths></Request>`
130
- };
131
- return request_1.default.post(requestOptions);
132
- })
133
- .then((res) => {
134
- const json = JSON.parse(res);
135
- const response = json[0];
136
- if (response.ErrorInfo) {
137
- if (response.ErrorInfo.ErrorTypeName === 'Microsoft.Online.SharePoint.Common.SpoNoSiteException') {
138
- return Promise.resolve(false);
139
- }
140
- else {
141
- return Promise.reject(response.ErrorInfo.ErrorMessage);
142
- }
143
- }
144
- else {
145
- const site = json[json.length - 1];
146
- if (site.Status === 'Recycled') {
147
- return Promise.reject(true);
148
- }
149
- else {
150
- return Promise.resolve(false);
151
- }
152
- }
153
- })
154
- .then(() => {
155
- if (this.verbose) {
156
- logger.logToStderr(`Site doesn't exist. Checking if the site ${url} exists in the recycle bin...`);
157
- }
158
- const requestOptions = {
159
- url: `${this.spoAdminUrl}/_vti_bin/client.svc/ProcessQuery`,
160
- headers: {
161
- 'X-RequestDigest': this.context.FormDigestValue
162
- },
163
- data: `<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="181" ObjectPathId="180" /><Query Id="182" ObjectPathId="180"><Query SelectAllProperties="true"><Properties /></Query></Query></Actions><ObjectPaths><Method Id="180" ParentId="175" Name="GetDeletedSitePropertiesByUrl"><Parameters><Parameter Type="String">${utils_1.formatting.escapeXml(url)}</Parameter></Parameters></Method><Constructor Id="175" TypeId="{268004ae-ef6b-4e9b-8425-127220d84719}" /></ObjectPaths></Request>`
164
- };
165
- return request_1.default.post(requestOptions);
166
- })
167
- .then((res) => {
168
- const json = JSON.parse(res);
169
- const response = json[0];
170
- if (response.ErrorInfo) {
171
- if (response.ErrorInfo.ErrorTypeName === 'Microsoft.SharePoint.Client.UnknownError') {
172
- resolve(false);
173
- }
174
- else {
175
- reject(response.ErrorInfo.ErrorMessage);
176
- }
177
- }
178
- else {
179
- const site = json[json.length - 1];
180
- if (site.Status === 'Recycled') {
181
- resolve(true);
182
- }
183
- else {
184
- resolve(false);
185
- }
186
- }
187
- }, (error) => {
188
- if (typeof error === 'boolean') {
189
- resolve(error);
190
- }
191
- else {
192
- reject(error);
193
- }
194
- });
195
- });
196
- }
197
- deleteSiteFromTheRecycleBin(url, wait, logger) {
198
- return new Promise((resolve, reject) => {
199
- utils_1.spo
200
- .ensureFormDigest(this.spoAdminUrl, logger, this.context, this.debug)
201
- .then((res) => {
202
- this.context = res;
203
- if (this.verbose) {
204
- logger.logToStderr(`Deleting site ${url} from the recycle bin...`);
205
- }
206
- const requestOptions = {
207
- url: `${this.spoAdminUrl}/_vti_bin/client.svc/ProcessQuery`,
208
- headers: {
209
- 'X-RequestDigest': this.context.FormDigestValue
210
- },
211
- data: `<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="185" ObjectPathId="184" /><Query Id="186" ObjectPathId="184"><Query SelectAllProperties="false"><Properties><Property Name="IsComplete" ScalarProperty="true" /><Property Name="PollingInterval" ScalarProperty="true" /></Properties></Query></Query></Actions><ObjectPaths><Method Id="184" ParentId="175" Name="RemoveDeletedSite"><Parameters><Parameter Type="String">${utils_1.formatting.escapeXml(url)}</Parameter></Parameters></Method><Constructor Id="175" TypeId="{268004ae-ef6b-4e9b-8425-127220d84719}" /></ObjectPaths></Request>`
212
- };
213
- return request_1.default.post(requestOptions);
214
- })
215
- .then((res) => {
216
- const json = JSON.parse(res);
217
- const response = json[0];
218
- if (response.ErrorInfo) {
219
- reject(response.ErrorInfo.ErrorMessage);
220
- }
221
- else {
222
- const operation = json[json.length - 1];
223
- const isComplete = operation.IsComplete;
224
- if (!wait || isComplete) {
225
- resolve();
226
- return;
227
- }
228
- setTimeout(() => {
229
- utils_1.spo.waitUntilFinished({
230
- operationId: JSON.stringify(operation._ObjectIdentity_),
231
- siteUrl: this.spoAdminUrl,
232
- resolve,
233
- reject,
234
- logger,
235
- currentContext: this.context,
236
- dots: this.dots,
237
- verbose: this.verbose,
238
- debug: this.debug
239
- });
240
- }, operation.PollingInterval);
241
- }
242
- });
243
- });
244
- }
245
- options() {
246
- const options = [
247
- {
248
- option: '-u, --url <url>'
249
- },
250
- {
251
- option: '-t, --title <title>'
252
- },
253
- {
254
- option: '--owner <owner>'
255
- },
256
- {
257
- option: '-z, --timeZone <timeZone>'
258
- },
259
- {
260
- option: '-l, --lcid [lcid]'
261
- },
262
- {
263
- option: '-w, --webTemplate [webTemplate]'
264
- },
265
- {
266
- option: '--resourceQuota [resourceQuota]'
267
- },
268
- {
269
- option: '--resourceQuotaWarningLevel [resourceQuotaWarningLevel]'
270
- },
271
- {
272
- option: '--storageQuota [storageQuota]'
273
- },
274
- {
275
- option: '--storageQuotaWarningLevel [storageQuotaWarningLevel]'
276
- },
277
- {
278
- option: '--removeDeletedSite'
279
- },
280
- {
281
- option: '--wait'
282
- }
283
- ];
284
- const parentOptions = super.options();
285
- return options.concat(parentOptions);
286
- }
287
- validate(args) {
288
- const isValidSharePointUrl = utils_1.validation.isValidSharePointUrl(args.options.url);
289
- if (isValidSharePointUrl !== true) {
290
- return isValidSharePointUrl;
291
- }
292
- if (typeof args.options.timeZone !== 'number') {
293
- return `${args.options.timeZone} is not a number`;
294
- }
295
- if (args.options.lcid &&
296
- typeof args.options.lcid !== 'number') {
297
- return `${args.options.lcid} is not a number`;
298
- }
299
- if (args.options.resourceQuota &&
300
- typeof args.options.resourceQuota !== 'number') {
301
- return `${args.options.resourceQuota} is not a number`;
302
- }
303
- if (args.options.resourceQuotaWarningLevel &&
304
- typeof args.options.resourceQuotaWarningLevel !== 'number') {
305
- return `${args.options.resourceQuotaWarningLevel} is not a number`;
306
- }
307
- if (args.options.resourceQuotaWarningLevel &&
308
- !args.options.resourceQuota) {
309
- return `You cannot specify resourceQuotaWarningLevel without specifying resourceQuota`;
310
- }
311
- if (args.options.resourceQuotaWarningLevel > args.options.resourceQuota) {
312
- return `resourceQuotaWarningLevel cannot exceed resourceQuota`;
313
- }
314
- if (args.options.storageQuota &&
315
- typeof args.options.storageQuota !== 'number') {
316
- return `${args.options.storageQuota} is not a number`;
317
- }
318
- if (args.options.storageQuotaWarningLevel &&
319
- typeof args.options.storageQuotaWarningLevel !== 'number') {
320
- return `${args.options.storageQuotaWarningLevel} is not a number`;
321
- }
322
- if (args.options.storageQuotaWarningLevel &&
323
- !args.options.storageQuota) {
324
- return `You cannot specify storageQuotaWarningLevel without specifying storageQuota`;
325
- }
326
- if (args.options.storageQuotaWarningLevel > args.options.storageQuota) {
327
- return `storageQuotaWarningLevel cannot exceed storageQuota`;
328
- }
329
- return true;
330
- }
331
- }
332
- module.exports = new SpoSiteClassicAddCommand();
333
- //# sourceMappingURL=site-classic-add.js.map
@@ -1,98 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const config_1 = require("../../../../config");
4
- const request_1 = require("../../../../request");
5
- const utils_1 = require("../../../../utils");
6
- const SpoCommand_1 = require("../../../base/SpoCommand");
7
- const commands_1 = require("../../commands");
8
- class SpoSiteClassicListCommand extends SpoCommand_1.default {
9
- get name() {
10
- return commands_1.default.SITE_CLASSIC_LIST;
11
- }
12
- get description() {
13
- return 'Lists sites of the given type';
14
- }
15
- getTelemetryProperties(args) {
16
- const telemetryProps = super.getTelemetryProperties(args);
17
- telemetryProps.webTemplate = args.options.webTemplate;
18
- telemetryProps.filter = (!(!args.options.filter)).toString();
19
- telemetryProps.includeOneDriveSites = args.options.includeOneDriveSites;
20
- return telemetryProps;
21
- }
22
- defaultProperties() {
23
- return ['Title', 'Url'];
24
- }
25
- commandAction(logger, args, cb) {
26
- const webTemplate = args.options.webTemplate || '';
27
- const includeOneDriveSites = args.options.includeOneDriveSites || false;
28
- const personalSite = includeOneDriveSites === false ? '0' : '1';
29
- let spoAdminUrl = '';
30
- utils_1.spo
31
- .getSpoAdminUrl(logger, this.debug)
32
- .then((_spoAdminUrl) => {
33
- spoAdminUrl = _spoAdminUrl;
34
- if (this.verbose) {
35
- logger.logToStderr(`Retrieving list of site collections...`);
36
- }
37
- this.allSites = [];
38
- return this.getAllSites(spoAdminUrl, utils_1.formatting.escapeXml(args.options.filter || ''), '0', personalSite, webTemplate, undefined, logger);
39
- })
40
- .then(_ => {
41
- logger.log(this.allSites);
42
- cb();
43
- }, (err) => this.handleRejectedPromise(err, logger, cb));
44
- }
45
- getAllSites(spoAdminUrl, filter, startIndex, personalSite, webTemplate, formDigest, logger) {
46
- return new Promise((resolve, reject) => {
47
- utils_1.spo
48
- .ensureFormDigest(spoAdminUrl, logger, formDigest, this.debug)
49
- .then((res) => {
50
- const requestOptions = {
51
- url: `${spoAdminUrl}/_vti_bin/client.svc/ProcessQuery`,
52
- headers: {
53
- 'X-RequestDigest': res.FormDigestValue
54
- },
55
- data: `<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>`
56
- };
57
- return request_1.default.post(requestOptions);
58
- })
59
- .then((res) => {
60
- const json = JSON.parse(res);
61
- const response = json[0];
62
- if (response.ErrorInfo) {
63
- reject(response.ErrorInfo.ErrorMessage);
64
- return;
65
- }
66
- else {
67
- const sites = json[json.length - 1];
68
- this.allSites.push(...sites._Child_Items_);
69
- if (sites.NextStartIndexFromSharePoint) {
70
- this
71
- .getAllSites(spoAdminUrl, filter, sites.NextStartIndexFromSharePoint, personalSite, webTemplate, formDigest, logger)
72
- .then(_ => resolve(), err => reject(err));
73
- }
74
- else {
75
- resolve();
76
- }
77
- }
78
- }, err => reject(err));
79
- });
80
- }
81
- options() {
82
- const options = [
83
- {
84
- option: '-t, --webTemplate [webTemplate]'
85
- },
86
- {
87
- option: '-f, --filter [filter]'
88
- },
89
- {
90
- option: '--includeOneDriveSites'
91
- }
92
- ];
93
- const parentOptions = super.options();
94
- return options.concat(parentOptions);
95
- }
96
- }
97
- module.exports = new SpoSiteClassicListCommand();
98
- //# sourceMappingURL=site-classic-list.js.map