@pnp/cli-microsoft365 10.4.0-beta.b552c1b → 10.4.0-beta.c93f9cd
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/allCommands.json +1 -1
- package/allCommandsFull.json +1 -1
- package/dist/Auth.js +0 -4
- package/dist/config.js +0 -1
- package/dist/m365/spfx/commands/project/project-upgrade/upgrade-1.20.0.js +1 -1
- package/dist/m365/spo/commands/{tenant/tenant-homesite-list.js → homesite/homesite-list.js} +8 -4
- package/dist/m365/spo/commands/page/page-clientsidewebpart-add.js +84 -47
- package/dist/m365/spo/commands.js +1 -0
- package/docs/docs/cmd/spo/{tenant/tenant-homesite-list.mdx → homesite/homesite-list.mdx} +9 -3
- package/docs/docs/cmd/spo/page/page-clientsidewebpart-add.mdx +11 -2
- package/package.json +1 -1
package/dist/Auth.js
CHANGED
|
@@ -91,25 +91,21 @@ export class Auth {
|
|
|
91
91
|
static initialize() {
|
|
92
92
|
this.cloudEndpoints[CloudType.USGov] = {
|
|
93
93
|
'https://graph.microsoft.com': 'https://graph.microsoft.com',
|
|
94
|
-
'https://graph.windows.net': 'https://graph.windows.net',
|
|
95
94
|
'https://management.azure.com/': 'https://management.usgovcloudapi.net/',
|
|
96
95
|
'https://login.microsoftonline.com': 'https://login.microsoftonline.com'
|
|
97
96
|
};
|
|
98
97
|
this.cloudEndpoints[CloudType.USGovHigh] = {
|
|
99
98
|
'https://graph.microsoft.com': 'https://graph.microsoft.us',
|
|
100
|
-
'https://graph.windows.net': 'https://graph.windows.net',
|
|
101
99
|
'https://management.azure.com/': 'https://management.usgovcloudapi.net/',
|
|
102
100
|
'https://login.microsoftonline.com': 'https://login.microsoftonline.us'
|
|
103
101
|
};
|
|
104
102
|
this.cloudEndpoints[CloudType.USGovDoD] = {
|
|
105
103
|
'https://graph.microsoft.com': 'https://dod-graph.microsoft.us',
|
|
106
|
-
'https://graph.windows.net': 'https://graph.windows.net',
|
|
107
104
|
'https://management.azure.com/': 'https://management.usgovcloudapi.net/',
|
|
108
105
|
'https://login.microsoftonline.com': 'https://login.microsoftonline.us'
|
|
109
106
|
};
|
|
110
107
|
this.cloudEndpoints[CloudType.China] = {
|
|
111
108
|
'https://graph.microsoft.com': 'https://microsoftgraph.chinacloudapi.cn',
|
|
112
|
-
'https://graph.windows.net': 'https://graph.chinacloudapi.cn',
|
|
113
109
|
'https://management.azure.com/': 'https://management.chinacloudapi.cn',
|
|
114
110
|
'https://login.microsoftonline.com': 'https://login.chinacloudapi.cn'
|
|
115
111
|
};
|
package/dist/config.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { app } from './utils/app.js';
|
|
2
2
|
export default {
|
|
3
3
|
allScopes: [
|
|
4
|
-
'https://graph.windows.net/Directory.AccessAsUser.All',
|
|
5
4
|
'https://management.azure.com/user_impersonation',
|
|
6
5
|
'https://admin.services.crm.dynamics.com/user_impersonation',
|
|
7
6
|
'https://graph.microsoft.com/AppCatalog.ReadWrite.All',
|
|
@@ -49,8 +49,8 @@ export default [
|
|
|
49
49
|
new FN001034_DEP_microsoft_sp_adaptive_card_extension_base('1.20.0'),
|
|
50
50
|
new FN002001_DEVDEP_microsoft_sp_build_web('1.20.2'),
|
|
51
51
|
new FN002002_DEVDEP_microsoft_sp_module_interfaces('1.20.2'),
|
|
52
|
-
new FN002021_DEVDEP_rushstack_eslint_config('4.0.1'),
|
|
53
52
|
new FN002024_DEVDEP_eslint('8.57.0'),
|
|
53
|
+
new FN002021_DEVDEP_rushstack_eslint_config('4.0.1'),
|
|
54
54
|
new FN002022_DEVDEP_microsoft_eslint_plugin_spfx('1.20.2'),
|
|
55
55
|
new FN002023_DEVDEP_microsoft_eslint_config_spfx('1.20.2'),
|
|
56
56
|
new FN010001_YORC_version('1.20.0'),
|
|
@@ -2,17 +2,21 @@ import { odata } from '../../../../utils/odata.js';
|
|
|
2
2
|
import { spo } from '../../../../utils/spo.js';
|
|
3
3
|
import SpoCommand from '../../../base/SpoCommand.js';
|
|
4
4
|
import commands from '../../commands.js';
|
|
5
|
-
class
|
|
5
|
+
class SpoHomeSiteListCommand extends SpoCommand {
|
|
6
6
|
get name() {
|
|
7
|
-
return commands.
|
|
7
|
+
return commands.HOMESITE_LIST;
|
|
8
8
|
}
|
|
9
9
|
get description() {
|
|
10
10
|
return 'Lists all home sites';
|
|
11
11
|
}
|
|
12
|
+
alias() {
|
|
13
|
+
return [commands.TENANT_HOMESITE_LIST];
|
|
14
|
+
}
|
|
12
15
|
defaultProperties() {
|
|
13
16
|
return ['Url', 'Title'];
|
|
14
17
|
}
|
|
15
18
|
async commandAction(logger) {
|
|
19
|
+
await this.showDeprecationWarning(logger, commands.TENANT_HOMESITE_LIST, commands.HOMESITE_LIST);
|
|
16
20
|
try {
|
|
17
21
|
const spoAdminUrl = await spo.getSpoAdminUrl(logger, this.verbose);
|
|
18
22
|
const requestOptions = {
|
|
@@ -33,5 +37,5 @@ class SpoTenantHomeSiteListCommand extends SpoCommand {
|
|
|
33
37
|
}
|
|
34
38
|
}
|
|
35
39
|
}
|
|
36
|
-
export default new
|
|
37
|
-
//# sourceMappingURL=
|
|
40
|
+
export default new SpoHomeSiteListCommand();
|
|
41
|
+
//# sourceMappingURL=homesite-list.js.map
|
|
@@ -80,52 +80,10 @@ class SpoPageClientSideWebPartAddCommand extends SpoCommand {
|
|
|
80
80
|
await logger.logToStderr(`Setting client-side web part layout and properties...`);
|
|
81
81
|
}
|
|
82
82
|
await this.setWebPartProperties(webPart, logger, args);
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
controlIndex: 1,
|
|
88
|
-
sectionIndex: 1,
|
|
89
|
-
zoneIndex: 1,
|
|
90
|
-
sectionFactor: 12,
|
|
91
|
-
layoutIndex: 1
|
|
92
|
-
},
|
|
93
|
-
emphasis: {},
|
|
94
|
-
displayMode: 2
|
|
95
|
-
};
|
|
96
|
-
canvasContent.unshift(defaultSection);
|
|
97
|
-
}
|
|
98
|
-
// get unique zoneIndex values given each section can have 1 or more
|
|
99
|
-
// columns each assigned to the zoneIndex of the corresponding section
|
|
100
|
-
const zoneIndices = canvasContent
|
|
101
|
-
.filter(c => c.position)
|
|
102
|
-
.map(c => c.position.zoneIndex)
|
|
103
|
-
.filter((value, index, array) => {
|
|
104
|
-
return array.indexOf(value) === index;
|
|
105
|
-
})
|
|
106
|
-
.sort((a, b) => a - b);
|
|
107
|
-
// get section number. if not specified, get the last section
|
|
108
|
-
const section = args.options.section || zoneIndices.length;
|
|
109
|
-
if (section > zoneIndices.length) {
|
|
110
|
-
throw `Invalid section '${section}'`;
|
|
111
|
-
}
|
|
112
|
-
// zoneIndex that represents the section where the web part should be added
|
|
113
|
-
const zoneIndex = zoneIndices[section - 1];
|
|
114
|
-
const column = args.options.column || 1;
|
|
115
|
-
// we need the index of the control in the array so that we know which
|
|
116
|
-
// item to replace or where to add the web part
|
|
117
|
-
const controlIndex = canvasContent
|
|
118
|
-
.findIndex(c => c.position &&
|
|
119
|
-
c.position.zoneIndex === zoneIndex &&
|
|
120
|
-
c.position.sectionIndex === column);
|
|
121
|
-
if (controlIndex === -1) {
|
|
122
|
-
throw `Invalid column '${args.options.column}'`;
|
|
123
|
-
}
|
|
124
|
-
// get the first control that matches section and column
|
|
125
|
-
// if it's a empty column, it should be replaced with the web part
|
|
126
|
-
// if it's a web part, then we need to determine if there are other
|
|
127
|
-
// web parts and where in the array the new web part should be put
|
|
128
|
-
const control = canvasContent[controlIndex];
|
|
83
|
+
const control = this.getCorrectControl(canvasContent, args);
|
|
84
|
+
const controlIndex = canvasContent.indexOf(control);
|
|
85
|
+
const zoneIndex = control.position.zoneIndex;
|
|
86
|
+
const column = control.position.sectionIndex;
|
|
129
87
|
const webPartControl = this.extend({
|
|
130
88
|
controlType: 3,
|
|
131
89
|
displayMode: 2,
|
|
@@ -294,6 +252,76 @@ class SpoPageClientSideWebPartAddCommand extends SpoCommand {
|
|
|
294
252
|
webPart.id = webPart.webPartData.instanceId;
|
|
295
253
|
}
|
|
296
254
|
}
|
|
255
|
+
getCorrectControl(canvasContent, args) {
|
|
256
|
+
// get Vertical section
|
|
257
|
+
if (args.options.verticalSection) {
|
|
258
|
+
let verticalSection = canvasContent
|
|
259
|
+
.find(c => c.position?.layoutIndex === 2);
|
|
260
|
+
//if vertical section does not exist, create it
|
|
261
|
+
if (!verticalSection) {
|
|
262
|
+
verticalSection = {
|
|
263
|
+
position: {
|
|
264
|
+
controlIndex: 1,
|
|
265
|
+
sectionIndex: 1,
|
|
266
|
+
zoneIndex: 1,
|
|
267
|
+
sectionFactor: 12,
|
|
268
|
+
layoutIndex: 2
|
|
269
|
+
},
|
|
270
|
+
emphasis: {},
|
|
271
|
+
displayMode: 2
|
|
272
|
+
};
|
|
273
|
+
canvasContent.unshift(verticalSection);
|
|
274
|
+
}
|
|
275
|
+
return verticalSection;
|
|
276
|
+
}
|
|
277
|
+
// if no section exists (canvasContent array only has 1 default object), add a default section (1 col)
|
|
278
|
+
if (canvasContent.length === 1) {
|
|
279
|
+
const defaultSection = {
|
|
280
|
+
position: {
|
|
281
|
+
controlIndex: 1,
|
|
282
|
+
sectionIndex: 1,
|
|
283
|
+
zoneIndex: 1,
|
|
284
|
+
sectionFactor: 12,
|
|
285
|
+
layoutIndex: 1
|
|
286
|
+
},
|
|
287
|
+
emphasis: {},
|
|
288
|
+
displayMode: 2
|
|
289
|
+
};
|
|
290
|
+
canvasContent.unshift(defaultSection);
|
|
291
|
+
}
|
|
292
|
+
// get unique zoneIndex values given each section can have 1 or more
|
|
293
|
+
// columns each assigned to the zoneIndex of the corresponding section
|
|
294
|
+
const zoneIndices = canvasContent
|
|
295
|
+
// Exclude the vertical section
|
|
296
|
+
.filter(c => c.position)
|
|
297
|
+
.map(c => c.position.zoneIndex)
|
|
298
|
+
.filter((value, index, array) => {
|
|
299
|
+
return array.indexOf(value) === index;
|
|
300
|
+
})
|
|
301
|
+
.sort((a, b) => a - b);
|
|
302
|
+
// get section number. if not specified, get the last section
|
|
303
|
+
const section = args.options.section || zoneIndices.length;
|
|
304
|
+
if (section > zoneIndices.length) {
|
|
305
|
+
throw `Invalid section '${section}'`;
|
|
306
|
+
}
|
|
307
|
+
// zoneIndex that represents the section where the web part should be added
|
|
308
|
+
const zoneIndex = zoneIndices[section - 1];
|
|
309
|
+
const column = args.options.column || 1;
|
|
310
|
+
// we need the index of the control in the array so that we know which
|
|
311
|
+
// item to replace or where to add the web part
|
|
312
|
+
const controlIndex = canvasContent
|
|
313
|
+
.findIndex(c => c.position &&
|
|
314
|
+
c.position.zoneIndex === zoneIndex &&
|
|
315
|
+
c.position.sectionIndex === column);
|
|
316
|
+
if (controlIndex === -1) {
|
|
317
|
+
throw `Invalid column '${args.options.column}'`;
|
|
318
|
+
}
|
|
319
|
+
// get the first control that matches section and column
|
|
320
|
+
// if it's a empty column, it should be replaced with the web part
|
|
321
|
+
// if it's a web part, then we need to determine if there are other
|
|
322
|
+
// web parts and where in the array the new web part should be put
|
|
323
|
+
return canvasContent[controlIndex];
|
|
324
|
+
}
|
|
297
325
|
/**
|
|
298
326
|
* Provides functionality to extend the given object by doing a shallow copy
|
|
299
327
|
*
|
|
@@ -318,7 +346,8 @@ _SpoPageClientSideWebPartAddCommand_instances = new WeakSet(), _SpoPageClientSid
|
|
|
318
346
|
webPartProperties: typeof args.options.webPartProperties !== 'undefined',
|
|
319
347
|
section: typeof args.options.section !== 'undefined',
|
|
320
348
|
column: typeof args.options.column !== 'undefined',
|
|
321
|
-
order: typeof args.options.order !== 'undefined'
|
|
349
|
+
order: typeof args.options.order !== 'undefined',
|
|
350
|
+
verticalSection: !!args.options.verticalSection
|
|
322
351
|
});
|
|
323
352
|
});
|
|
324
353
|
}, _SpoPageClientSideWebPartAddCommand_initOptions = function _SpoPageClientSideWebPartAddCommand_initOptions() {
|
|
@@ -340,6 +369,8 @@ _SpoPageClientSideWebPartAddCommand_instances = new WeakSet(), _SpoPageClientSid
|
|
|
340
369
|
option: '--column [column]'
|
|
341
370
|
}, {
|
|
342
371
|
option: '--order [order]'
|
|
372
|
+
}, {
|
|
373
|
+
option: '--verticalSection'
|
|
343
374
|
});
|
|
344
375
|
}, _SpoPageClientSideWebPartAddCommand_initValidators = function _SpoPageClientSideWebPartAddCommand_initValidators() {
|
|
345
376
|
this.validators.push(async (args) => {
|
|
@@ -376,6 +407,12 @@ _SpoPageClientSideWebPartAddCommand_instances = new WeakSet(), _SpoPageClientSid
|
|
|
376
407
|
if (args.options.column && (!Number.isInteger(args.options.column) || args.options.column < 1)) {
|
|
377
408
|
return 'The value of parameter column must be 1 or higher';
|
|
378
409
|
}
|
|
410
|
+
if (args.options.section && args.options.verticalSection) {
|
|
411
|
+
return 'Specify section or verticalSection but not both';
|
|
412
|
+
}
|
|
413
|
+
if (args.options.column && args.options.verticalSection) {
|
|
414
|
+
return 'Use column in combination with section, not with verticalSection';
|
|
415
|
+
}
|
|
379
416
|
return validation.isValidSharePointUrl(args.options.webUrl);
|
|
380
417
|
});
|
|
381
418
|
}, _SpoPageClientSideWebPartAddCommand_initOptionSets = function _SpoPageClientSideWebPartAddCommand_initOptionSets() {
|
|
@@ -117,6 +117,7 @@ export default {
|
|
|
117
117
|
HIDEDEFAULTTHEMES_GET: `${prefix} hidedefaultthemes get`,
|
|
118
118
|
HIDEDEFAULTTHEMES_SET: `${prefix} hidedefaultthemes set`,
|
|
119
119
|
HOMESITE_GET: `${prefix} homesite get`,
|
|
120
|
+
HOMESITE_LIST: `${prefix} homesite list`,
|
|
120
121
|
HOMESITE_REMOVE: `${prefix} homesite remove`,
|
|
121
122
|
HOMESITE_SET: `${prefix} homesite set`,
|
|
122
123
|
HUBSITE_CONNECT: `${prefix} hubsite connect`,
|
|
@@ -2,12 +2,18 @@ import Global from '/docs/cmd/_global.mdx';
|
|
|
2
2
|
import Tabs from '@theme/Tabs';
|
|
3
3
|
import TabItem from '@theme/TabItem';
|
|
4
4
|
|
|
5
|
-
# spo
|
|
5
|
+
# spo homesite list
|
|
6
6
|
|
|
7
7
|
Lists all home sites
|
|
8
8
|
|
|
9
9
|
## Usage
|
|
10
10
|
|
|
11
|
+
```sh
|
|
12
|
+
m365 spo homesite list [options]
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## Alias
|
|
16
|
+
|
|
11
17
|
```sh
|
|
12
18
|
m365 spo tenant homesite list [options]
|
|
13
19
|
```
|
|
@@ -21,7 +27,7 @@ m365 spo tenant homesite list [options]
|
|
|
21
27
|
List all home sites
|
|
22
28
|
|
|
23
29
|
```sh
|
|
24
|
-
m365 spo
|
|
30
|
+
m365 spo homesite list
|
|
25
31
|
```
|
|
26
32
|
|
|
27
33
|
## Response
|
|
@@ -72,7 +78,7 @@ m365 spo tenant homesite list
|
|
|
72
78
|
<TabItem value="Markdown">
|
|
73
79
|
|
|
74
80
|
```md
|
|
75
|
-
# spo
|
|
81
|
+
# spo homesite list
|
|
76
82
|
|
|
77
83
|
Date: 11/18/2024
|
|
78
84
|
|
|
@@ -32,13 +32,16 @@ m365 spo page clientsidewebpart add [options]
|
|
|
32
32
|
: JSON string with web part data as retrieved from the web part maintenance mode. Specify either `webPartProperties` or `webPartData` but not both.
|
|
33
33
|
|
|
34
34
|
`--section [section]`
|
|
35
|
-
: Number of the section to which the web part should be added (1 or higher).
|
|
35
|
+
: Number of the section to which the web part should be added (1 or higher). Specify `section` or `verticalSection` but not both.
|
|
36
36
|
|
|
37
37
|
`--column [column]`
|
|
38
|
-
: Number of the column in which the web part should be added (1 or higher).
|
|
38
|
+
: Number of the column in which the web part should be added (1 or higher). Use `column` in combination with `section`, not with `verticalSection`.
|
|
39
39
|
|
|
40
40
|
`--order [order]`
|
|
41
41
|
: Order of the web part in the column.
|
|
42
|
+
|
|
43
|
+
`--verticalSection`
|
|
44
|
+
: Specifies that the web part should be added to the vertical section.
|
|
42
45
|
```
|
|
43
46
|
|
|
44
47
|
<Global />
|
|
@@ -87,6 +90,12 @@ Add the standard Image web part with the preconfigured image
|
|
|
87
90
|
m365 spo page clientsidewebpart add --webUrl https://contoso.sharepoint.com/sites/a-team --pageName page.aspx --standardWebPart Image --webPartData '{ "dataVersion": "1.8", "serverProcessedContent": {"htmlStrings":{},"searchablePlainTexts":{"captionText":""},"imageSources":{"imageSource":"/sites/team-a/SiteAssets/work-life-balance.png"},"links":{}}, "properties": {"imageSourceType":2,"altText":"a group of people on a beach","overlayText":"Work life balance","fileName":"48146-OFF12_Justice_01.png","siteId":"27664b85-067d-4be9-a7d7-89b2e804d09f","webId":"a7664b85-067d-4be9-a7d7-89b2e804d09f","listId":"37664b85-067d-4be9-a7d7-89b2e804d09f","uniqueId":"67664b85-067d-4be9-a7d7-89b2e804d09f","imgWidth":650,"imgHeight":433,"fixAspectRatio":false,"isOverlayTextEnabled":true}}'
|
|
88
91
|
```
|
|
89
92
|
|
|
93
|
+
Add the standard Bing Map web part to a modern page in the vertical section
|
|
94
|
+
|
|
95
|
+
```sh
|
|
96
|
+
m365 spo page clientsidewebpart add --webUrl https://contoso.sharepoint.com/sites/a-team --pageName page.aspx --standardWebPart BingMap --verticalSection
|
|
97
|
+
```
|
|
98
|
+
|
|
90
99
|
## Response
|
|
91
100
|
|
|
92
101
|
The command won't return a response on success.
|
package/package.json
CHANGED