@pnp/cli-microsoft365 10.4.0-beta.47f1e4d → 10.4.0-beta.5adfc5b

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/config.js CHANGED
@@ -34,7 +34,7 @@ export default {
34
34
  'https://graph.microsoft.com/Place.Read.All',
35
35
  'https://graph.microsoft.com/Policy.Read.All',
36
36
  'https://graph.microsoft.com/RecordsManagement.ReadWrite.All',
37
- 'https://graph.microsoft.com/Reports.ReadWrite.All',
37
+ 'https://graph.microsoft.com/Reports.Read.All',
38
38
  'https://graph.microsoft.com/ReportSettings.ReadWrite.All',
39
39
  'https://graph.microsoft.com/RoleAssignmentSchedule.ReadWrite.Directory',
40
40
  'https://graph.microsoft.com/RoleEligibilitySchedule.Read.Directory',
@@ -29,8 +29,11 @@ class EntraGroupMemberAddCommand extends GraphCommand {
29
29
  }
30
30
  async commandAction(logger, args) {
31
31
  try {
32
+ if (args.options.groupDisplayName) {
33
+ await this.warn(logger, `Option 'groupDisplayName' is deprecated and will be removed in the next major release.`);
34
+ }
32
35
  if (this.verbose) {
33
- await logger.logToStderr(`Adding member(s) ${args.options.ids || args.options.userNames} to group ${args.options.groupId || args.options.groupDisplayName}...`);
36
+ await logger.logToStderr(`Adding member(s) ${args.options.ids || args.options.userNames} to group ${args.options.groupId || args.options.groupDisplayName || args.options.groupName}...`);
34
37
  }
35
38
  const groupId = await this.getGroupId(logger, args.options);
36
39
  const userIds = await this.getUserIds(logger, args.options);
@@ -77,9 +80,9 @@ class EntraGroupMemberAddCommand extends GraphCommand {
77
80
  return options.groupId;
78
81
  }
79
82
  if (this.verbose) {
80
- await logger.logToStderr(`Retrieving ID of group ${options.groupDisplayName}...`);
83
+ await logger.logToStderr(`Retrieving ID of group ${options.groupDisplayName || options.groupName}...`);
81
84
  }
82
- return entraGroup.getGroupIdByDisplayName(options.groupDisplayName);
85
+ return entraGroup.getGroupIdByDisplayName(options.groupDisplayName || options.groupName);
83
86
  }
84
87
  async getUserIds(logger, options) {
85
88
  if (options.ids) {
@@ -96,6 +99,7 @@ _EntraGroupMemberAddCommand_instances = new WeakSet(), _EntraGroupMemberAddComma
96
99
  Object.assign(this.telemetryProperties, {
97
100
  groupId: typeof args.options.groupId !== 'undefined',
98
101
  groupDisplayName: typeof args.options.groupDisplayName !== 'undefined',
102
+ groupName: typeof args.options.groupName !== 'undefined',
99
103
  ids: typeof args.options.ids !== 'undefined',
100
104
  userNames: typeof args.options.userNames !== 'undefined'
101
105
  });
@@ -104,7 +108,9 @@ _EntraGroupMemberAddCommand_instances = new WeakSet(), _EntraGroupMemberAddComma
104
108
  this.options.unshift({
105
109
  option: '-i, --groupId [groupId]'
106
110
  }, {
107
- option: '-n, --groupDisplayName [groupDisplayName]'
111
+ option: '--groupDisplayName [groupDisplayName]'
112
+ }, {
113
+ option: '-n, --groupName [groupName]'
108
114
  }, {
109
115
  option: '--ids [ids]'
110
116
  }, {
@@ -136,9 +142,9 @@ _EntraGroupMemberAddCommand_instances = new WeakSet(), _EntraGroupMemberAddComma
136
142
  return true;
137
143
  });
138
144
  }, _EntraGroupMemberAddCommand_initOptionSets = function _EntraGroupMemberAddCommand_initOptionSets() {
139
- this.optionSets.push({ options: ['groupId', 'groupDisplayName'] }, { options: ['ids', 'userNames'] });
145
+ this.optionSets.push({ options: ['groupId', 'groupDisplayName', 'groupName'] }, { options: ['ids', 'userNames'] });
140
146
  }, _EntraGroupMemberAddCommand_initTypes = function _EntraGroupMemberAddCommand_initTypes() {
141
- this.types.string.push('groupId', 'groupDisplayName', 'ids', 'userNames', 'role');
147
+ this.types.string.push('groupId', 'groupDisplayName', 'groupName', 'ids', 'userNames', 'role');
142
148
  };
143
149
  export default new EntraGroupMemberAddCommand();
144
150
  //# sourceMappingURL=group-member-add.js.map
@@ -29,8 +29,11 @@ class EntraGroupMemberSetCommand extends GraphCommand {
29
29
  }
30
30
  async commandAction(logger, args) {
31
31
  try {
32
+ if (args.options.groupDisplayName) {
33
+ await this.warn(logger, `Option 'groupDisplayName' is deprecated and will be removed in the next major release.`);
34
+ }
32
35
  if (this.verbose) {
33
- await logger.logToStderr(`Adding member(s) ${args.options.ids || args.options.userNames} to role ${args.options.role} of group ${args.options.groupId || args.options.groupDisplayName}...`);
36
+ await logger.logToStderr(`Adding member(s) ${args.options.ids || args.options.userNames} to role ${args.options.role} of group ${args.options.groupId || args.options.groupDisplayName || args.options.groupName}...`);
34
37
  }
35
38
  const groupId = await this.getGroupId(logger, args.options);
36
39
  const userIds = await this.getUserIds(logger, args.options);
@@ -49,9 +52,9 @@ class EntraGroupMemberSetCommand extends GraphCommand {
49
52
  return options.groupId;
50
53
  }
51
54
  if (this.verbose) {
52
- await logger.logToStderr(`Retrieving ID of group ${options.groupDisplayName}...`);
55
+ await logger.logToStderr(`Retrieving ID of group ${options.groupDisplayName || options.groupName}...`);
53
56
  }
54
- return entraGroup.getGroupIdByDisplayName(options.groupDisplayName);
57
+ return entraGroup.getGroupIdByDisplayName(options.groupDisplayName || options.groupName);
55
58
  }
56
59
  async getUserIds(logger, options) {
57
60
  if (options.ids) {
@@ -158,6 +161,7 @@ _EntraGroupMemberSetCommand_instances = new WeakSet(), _EntraGroupMemberSetComma
158
161
  Object.assign(this.telemetryProperties, {
159
162
  groupId: typeof args.options.groupId !== 'undefined',
160
163
  groupDisplayName: typeof args.options.groupDisplayName !== 'undefined',
164
+ groupName: typeof args.options.groupName !== 'undefined',
161
165
  ids: typeof args.options.ids !== 'undefined',
162
166
  userNames: typeof args.options.userNames !== 'undefined'
163
167
  });
@@ -166,7 +170,9 @@ _EntraGroupMemberSetCommand_instances = new WeakSet(), _EntraGroupMemberSetComma
166
170
  this.options.unshift({
167
171
  option: '-i, --groupId [groupId]'
168
172
  }, {
169
- option: '-n, --groupDisplayName [groupDisplayName]'
173
+ option: '--groupDisplayName [groupDisplayName]'
174
+ }, {
175
+ option: '-n, --groupName [groupName]'
170
176
  }, {
171
177
  option: '--ids [ids]'
172
178
  }, {
@@ -198,9 +204,9 @@ _EntraGroupMemberSetCommand_instances = new WeakSet(), _EntraGroupMemberSetComma
198
204
  return true;
199
205
  });
200
206
  }, _EntraGroupMemberSetCommand_initOptionSets = function _EntraGroupMemberSetCommand_initOptionSets() {
201
- this.optionSets.push({ options: ['groupId', 'groupDisplayName'] }, { options: ['ids', 'userNames'] });
207
+ this.optionSets.push({ options: ['groupId', 'groupDisplayName', 'groupName'] }, { options: ['ids', 'userNames'] });
202
208
  }, _EntraGroupMemberSetCommand_initTypes = function _EntraGroupMemberSetCommand_initTypes() {
203
- this.types.string.push('groupId', 'groupDisplayName', 'ids', 'userNames', 'role');
209
+ this.types.string.push('groupId', 'groupDisplayName', 'groupName', 'ids', 'userNames', 'role');
204
210
  };
205
211
  export default new EntraGroupMemberSetCommand();
206
212
  //# sourceMappingURL=group-member-set.js.map
@@ -42,7 +42,7 @@ class SpoFieldGetCommand extends SpoCommand {
42
42
  fieldRestUrl = `/getbyid('${formatting.encodeQueryParameter(args.options.id)}')`;
43
43
  }
44
44
  else {
45
- fieldRestUrl = `/getbyinternalnameortitle('${formatting.encodeQueryParameter(args.options.title)}')`;
45
+ fieldRestUrl = `/getbyinternalnameortitle('${formatting.encodeQueryParameter((args.options.title || args.options.internalName))}')`;
46
46
  }
47
47
  const requestOptions = {
48
48
  url: `${args.options.webUrl}/_api/web/${listRestUrl}fields${fieldRestUrl}`,
@@ -67,7 +67,8 @@ _SpoFieldGetCommand_instances = new WeakSet(), _SpoFieldGetCommand_initTelemetry
67
67
  listTitle: typeof args.options.listTitle !== 'undefined',
68
68
  listUrl: typeof args.options.listUrl !== 'undefined',
69
69
  id: typeof args.options.id !== 'undefined',
70
- title: typeof args.options.title !== 'undefined'
70
+ title: typeof args.options.title !== 'undefined',
71
+ internalName: typeof args.options.internalName !== 'undefined'
71
72
  });
72
73
  });
73
74
  }, _SpoFieldGetCommand_initOptions = function _SpoFieldGetCommand_initOptions() {
@@ -83,6 +84,8 @@ _SpoFieldGetCommand_instances = new WeakSet(), _SpoFieldGetCommand_initTelemetry
83
84
  option: '-i, --id [id]'
84
85
  }, {
85
86
  option: '-t, --title [title]'
87
+ }, {
88
+ option: '--internalName [internalName]'
86
89
  });
87
90
  }, _SpoFieldGetCommand_initValidators = function _SpoFieldGetCommand_initValidators() {
88
91
  this.validators.push(async (args) => {
@@ -99,7 +102,7 @@ _SpoFieldGetCommand_instances = new WeakSet(), _SpoFieldGetCommand_initTelemetry
99
102
  return true;
100
103
  });
101
104
  }, _SpoFieldGetCommand_initOptionSets = function _SpoFieldGetCommand_initOptionSets() {
102
- this.optionSets.push({ options: ['id', 'title'] });
105
+ this.optionSets.push({ options: ['id', 'title', 'internalName'] });
103
106
  };
104
107
  export default new SpoFieldGetCommand();
105
108
  //# sourceMappingURL=field-get.js.map
@@ -34,16 +34,16 @@ class SpoFieldRemoveCommand extends SpoCommand {
34
34
  else {
35
35
  messageEnd = `in site ${args.options.webUrl}`;
36
36
  }
37
- const removeField = async (listRestUrl, fieldId, title) => {
37
+ const removeField = async (listRestUrl, fieldId, title, internalName) => {
38
38
  if (this.verbose) {
39
- await logger.logToStderr(`Removing field ${fieldId || title} ${messageEnd}...`);
39
+ await logger.logToStderr(`Removing field ${fieldId || title || internalName} ${messageEnd}...`);
40
40
  }
41
41
  let fieldRestUrl = '';
42
42
  if (fieldId) {
43
43
  fieldRestUrl = `/getbyid('${formatting.encodeQueryParameter(fieldId)}')`;
44
44
  }
45
45
  else {
46
- fieldRestUrl = `/getbyinternalnameortitle('${formatting.encodeQueryParameter(title)}')`;
46
+ fieldRestUrl = `/getbyinternalnameortitle('${formatting.encodeQueryParameter(title || internalName)}')`;
47
47
  }
48
48
  const requestOptions = {
49
49
  url: `${args.options.webUrl}/_api/web/${listRestUrl}fields${fieldRestUrl}`,
@@ -88,7 +88,7 @@ class SpoFieldRemoveCommand extends SpoCommand {
88
88
  }
89
89
  const promises = [];
90
90
  for (let index = 0; index < filteredResults.length; index++) {
91
- promises.push(removeField(listRestUrl, filteredResults[index].Id, undefined));
91
+ promises.push(removeField(listRestUrl, filteredResults[index].Id));
92
92
  }
93
93
  await Promise.all(promises);
94
94
  }
@@ -98,8 +98,7 @@ class SpoFieldRemoveCommand extends SpoCommand {
98
98
  }
99
99
  else {
100
100
  try {
101
- await removeField(listRestUrl, args.options.id, args.options.title);
102
- // REST post call doesn't return anything
101
+ await removeField(listRestUrl, args.options.id, args.options.title, args.options.internalName);
103
102
  }
104
103
  catch (err) {
105
104
  this.handleRejectedODataJsonPromise(err);
@@ -110,7 +109,7 @@ class SpoFieldRemoveCommand extends SpoCommand {
110
109
  await prepareRemoval();
111
110
  }
112
111
  else {
113
- const confirmMessage = `Are you sure you want to remove the ${args.options.group ? 'fields' : 'field'} ${args.options.id || args.options.title || 'from group ' + args.options.group} ${messageEnd}?`;
112
+ const confirmMessage = `Are you sure you want to remove the ${args.options.group ? 'fields' : 'field'} ${args.options.id || args.options.title || args.options.internalName || 'from group ' + args.options.group} ${messageEnd}?`;
114
113
  const result = await cli.promptForConfirmation({ message: confirmMessage });
115
114
  if (result) {
116
115
  await prepareRemoval();
@@ -127,6 +126,7 @@ _SpoFieldRemoveCommand_instances = new WeakSet(), _SpoFieldRemoveCommand_initTel
127
126
  id: typeof args.options.id !== 'undefined',
128
127
  group: typeof args.options.group !== 'undefined',
129
128
  title: typeof args.options.title !== 'undefined',
129
+ internalName: typeof args.options.internalName !== 'undefined',
130
130
  force: (!(!args.options.force)).toString()
131
131
  });
132
132
  });
@@ -143,6 +143,8 @@ _SpoFieldRemoveCommand_instances = new WeakSet(), _SpoFieldRemoveCommand_initTel
143
143
  option: '-i, --id [id]'
144
144
  }, {
145
145
  option: '-t, --title [title]'
146
+ }, {
147
+ option: '--internalName [internalName]'
146
148
  }, {
147
149
  option: '-g, --group [group]'
148
150
  }, {
@@ -163,7 +165,7 @@ _SpoFieldRemoveCommand_instances = new WeakSet(), _SpoFieldRemoveCommand_initTel
163
165
  return true;
164
166
  });
165
167
  }, _SpoFieldRemoveCommand_initOptionSets = function _SpoFieldRemoveCommand_initOptionSets() {
166
- this.optionSets.push({ options: ['id', 'title', 'group'] });
168
+ this.optionSets.push({ options: ['id', 'title', 'internalName', 'group'] });
167
169
  };
168
170
  export default new SpoFieldRemoveCommand();
169
171
  //# sourceMappingURL=field-remove.js.map
@@ -66,7 +66,7 @@ class SpoFieldSetCommand extends SpoCommand {
66
66
  // retrieve column CSOM object id
67
67
  const fieldQuery = args.options.id ?
68
68
  `<Method Id="663" ParentId="7" Name="GetById"><Parameters><Parameter Type="Guid">${formatting.escapeXml(args.options.id)}</Parameter></Parameters></Method>` :
69
- `<Method Id="663" ParentId="7" Name="GetByInternalNameOrTitle"><Parameters><Parameter Type="String">${formatting.escapeXml(args.options.name || args.options.title)}</Parameter></Parameters></Method>`;
69
+ `<Method Id="663" ParentId="7" Name="GetByInternalNameOrTitle"><Parameters><Parameter Type="String">${formatting.escapeXml(args.options.title || args.options.internalName)}</Parameter></Parameters></Method>`;
70
70
  let requestOptions = {
71
71
  url: `${args.options.webUrl}/_vti_bin/client.svc/ProcessQuery`,
72
72
  headers: {
@@ -108,6 +108,7 @@ class SpoFieldSetCommand extends SpoCommand {
108
108
  'listUrl',
109
109
  'id',
110
110
  'title',
111
+ 'internalName',
111
112
  'updateExistingLists',
112
113
  'debug',
113
114
  'verbose',
@@ -125,6 +126,7 @@ _SpoFieldSetCommand_instances = new WeakSet(), _SpoFieldSetCommand_initTelemetry
125
126
  Object.assign(this.telemetryProperties, {
126
127
  id: typeof args.options.id !== 'undefined',
127
128
  title: typeof args.options.title !== 'undefined',
129
+ internalName: typeof args.options.internalName !== 'undefined',
128
130
  listId: typeof args.options.listId !== 'undefined',
129
131
  listTitle: typeof args.options.listTitle !== 'undefined',
130
132
  listUrl: typeof args.options.listUrl !== 'undefined',
@@ -144,6 +146,8 @@ _SpoFieldSetCommand_instances = new WeakSet(), _SpoFieldSetCommand_initTelemetry
144
146
  option: '-i, --id [id]'
145
147
  }, {
146
148
  option: '-t, --title [title]'
149
+ }, {
150
+ option: '--internalName [internalName]'
147
151
  }, {
148
152
  option: '--updateExistingLists'
149
153
  });
@@ -168,7 +172,7 @@ _SpoFieldSetCommand_instances = new WeakSet(), _SpoFieldSetCommand_initTelemetry
168
172
  return true;
169
173
  });
170
174
  }, _SpoFieldSetCommand_initOptionSets = function _SpoFieldSetCommand_initOptionSets() {
171
- this.optionSets.push({ options: ['id', 'title'] });
175
+ this.optionSets.push({ options: ['id', 'title', 'internalName'] });
172
176
  };
173
177
  export default new SpoFieldSetCommand();
174
178
  //# sourceMappingURL=field-set.js.map
@@ -271,6 +271,12 @@ export class ClientSidePage {
271
271
  for (let i = 0; i < this.sections.length; i++) {
272
272
  html.push(this.sections[i].toHtml());
273
273
  }
274
+ if (this.pageSettings) {
275
+ html.push(this.pageSettings.toHtml());
276
+ }
277
+ if (this.backgroundSettings) {
278
+ html.push(this.backgroundSettings.toHtml());
279
+ }
274
280
  html.push("</div>");
275
281
  return html.join("");
276
282
  }
@@ -286,17 +292,23 @@ export class ClientSidePage {
286
292
  // gather our controls from the supplied html
287
293
  getBoundedDivMarkup(html, /<div\b[^>]*data-sp-canvascontrol[^>]*?>/i, markup => {
288
294
  // get the control type
289
- const ct = /controlType&quot;&#58;(\d*?),/i.exec(markup);
295
+ const ct = /controlType&quot;&#58;(\d*?)(,|&)/i.exec(markup);
290
296
  // if no control type is present this is a column which we give type 0 to let us process it
291
- const controlType = ct == null || ct.length < 2 ? 0 : parseInt(ct[1], 10);
297
+ const controlType = ct == null || ct.length < 0 ? -1 : parseInt(ct[1], 10);
292
298
  let control = null;
293
299
  switch (controlType) {
294
- case 0:
300
+ case -1:
295
301
  // empty canvas column
296
302
  control = new CanvasColumn(null, 0);
297
303
  control.fromHtml(markup);
298
304
  page.mergeColumnToTree(control);
299
305
  break;
306
+ case 0:
307
+ // page settings
308
+ control = new PageSettings();
309
+ control.fromHtml(markup);
310
+ page.pageSettings = control;
311
+ break;
300
312
  case 3:
301
313
  // client side webpart
302
314
  control = new ClientSideWebpart("");
@@ -309,6 +321,12 @@ export class ClientSidePage {
309
321
  control.fromHtml(markup);
310
322
  page.mergePartToTree(control);
311
323
  break;
324
+ case 14:
325
+ // backgroundSection
326
+ control = new BackgroundSettings();
327
+ control.fromHtml(markup);
328
+ page.backgroundSettings = control;
329
+ break;
312
330
  }
313
331
  });
314
332
  // refresh all the orders within the tree
@@ -364,7 +382,7 @@ export class ClientSidePage {
364
382
  }
365
383
  const sections = this.sections.filter(s => s.order === zoneIndex);
366
384
  if (sections.length < 1) {
367
- section = new CanvasSection(this, zoneIndex);
385
+ section = new CanvasSection(this, zoneIndex, [], control?.controlData?.position.zoneId, control.controlData?.zoneGroupMetadata);
368
386
  this.sections.push(section);
369
387
  }
370
388
  else {
@@ -392,7 +410,7 @@ export class ClientSidePage {
392
410
  let section = null;
393
411
  const sections = this.sections.filter(s => s.order === order);
394
412
  if (sections.length < 1) {
395
- section = new CanvasSection(this, order);
413
+ section = new CanvasSection(this, order, [], column.controlData?.position?.zoneId, column.controlData?.zoneGroupMetadata);
396
414
  this.sections.push(section);
397
415
  }
398
416
  else {
@@ -403,10 +421,12 @@ export class ClientSidePage {
403
421
  }
404
422
  }
405
423
  export class CanvasSection {
406
- constructor(page, order, columns = []) {
424
+ constructor(page, order, columns = [], zoneId, zoneGroupMetadata) {
407
425
  this.page = page;
408
426
  this.order = order;
409
427
  this.columns = columns;
428
+ this.zoneId = zoneId;
429
+ this.zoneGroupMetadata = zoneGroupMetadata;
410
430
  }
411
431
  /**
412
432
  * Default column (this.columns[0]) for this section
@@ -457,6 +477,20 @@ class CanvasControl {
457
477
  this.id = this.controlData.id;
458
478
  }
459
479
  }
480
+ export class PageSettings extends CanvasControl {
481
+ constructor() {
482
+ super(0, "1.0");
483
+ }
484
+ getControlData() {
485
+ return this.controlData;
486
+ }
487
+ toHtml() {
488
+ return `<div data-sp-canvascontrol="" data-sp-canvasdataversion="${this.dataVersion}" data-sp-controldata="${this.jsonData}"></div>`;
489
+ }
490
+ fromHtml(html) {
491
+ super.fromHtml(html);
492
+ }
493
+ }
460
494
  export class CanvasColumn extends CanvasControl {
461
495
  constructor(section, order, factor = 12, controls = [], dataVersion = "1.0") {
462
496
  super(0, dataVersion);
@@ -513,8 +547,10 @@ export class CanvasColumn extends CanvasControl {
513
547
  position: {
514
548
  sectionFactor: this.factor,
515
549
  sectionIndex: this.order,
516
- zoneIndex: this.section ? this.section.order : 0
550
+ zoneIndex: this.section ? this.section.order : 0,
551
+ zoneId: this.section?.zoneId
517
552
  },
553
+ zoneGroupMetadata: this.section?.zoneGroupMetadata,
518
554
  };
519
555
  }
520
556
  /**
@@ -543,6 +579,58 @@ export class ClientSidePart extends CanvasControl {
543
579
  }
544
580
  }
545
581
  }
582
+ export class BackgroundSettings extends ClientSidePart {
583
+ constructor() {
584
+ super(0, "1.0");
585
+ this.propertieJson = {};
586
+ this.serverProcessedContent = null;
587
+ }
588
+ getControlData() {
589
+ return {
590
+ controlType: this.controlType
591
+ };
592
+ }
593
+ toHtml() {
594
+ // will form the value of the data-sp-webpartdata attribute
595
+ const data = {
596
+ dataVersion: this.dataVersion,
597
+ instanceId: this.id,
598
+ properties: this.propertieJson,
599
+ serverProcessedContent: this.serverProcessedContent,
600
+ };
601
+ const html = [];
602
+ html.push(`<div data-sp-canvascontrol="" data-sp-canvasdataversion="${this.dataVersion}" data-sp-controldata="${this.jsonData}">`);
603
+ html.push(`<div data-sp-webpart="" data-sp-webpartdataversion="${this.dataVersion}" data-sp-webpartdata="${ClientSidePage.jsonToEscapedString(data)}">`);
604
+ html.push(`<div data-sp-componentid="">`);
605
+ html.push("</div>");
606
+ html.push(`<div data-sp-htmlproperties="">`);
607
+ for (let imageSource in this.serverProcessedContent?.imageSources) {
608
+ html.push(`<img data-sp-prop-name="${imageSource}" src="${this.serverProcessedContent?.imageSources[imageSource]}" />`);
609
+ }
610
+ html.push("</div>");
611
+ html.push("</div>");
612
+ html.push("</div>");
613
+ return html.join("");
614
+ }
615
+ setProperties(properties) {
616
+ this.propertieJson = extend(this.propertieJson, properties);
617
+ return this;
618
+ }
619
+ fromHtml(html) {
620
+ super.fromHtml(html);
621
+ const webPartData = ClientSidePage.escapedStringToJson(getAttrValueFromString(html, "data-sp-webpartdata"));
622
+ this.setProperties(webPartData.properties);
623
+ if (typeof webPartData.serverProcessedContent !== "undefined") {
624
+ this.serverProcessedContent = webPartData.serverProcessedContent;
625
+ }
626
+ if (typeof webPartData.dynamicDataPaths !== "undefined") {
627
+ this.dynamicDataPaths = webPartData.dynamicDataPaths;
628
+ }
629
+ if (typeof webPartData.dynamicDataValues !== "undefined") {
630
+ this.dynamicDataValues = webPartData.dynamicDataValues;
631
+ }
632
+ }
633
+ }
546
634
  export class ClientSideText extends ClientSidePart {
547
635
  constructor(text = "") {
548
636
  super(4, "1.0");
@@ -570,8 +658,10 @@ export class ClientSideText extends ClientSidePart {
570
658
  controlIndex: this.order,
571
659
  sectionFactor: this.column ? this.column.factor : 0,
572
660
  sectionIndex: this.column ? this.column.order : 0,
573
- zoneIndex: this.column && this.column.section ? this.column.section.order : 0
661
+ zoneIndex: this.column && this.column.section ? this.column.section.order : 0,
662
+ zoneId: this.column?.section?.zoneId
574
663
  },
664
+ zoneGroupMetadata: this.column?.section?.zoneGroupMetadata,
575
665
  };
576
666
  }
577
667
  toHtml(index) {
@@ -684,9 +774,11 @@ export class ClientSideWebpart extends ClientSidePart {
684
774
  controlIndex: this.order,
685
775
  sectionFactor: this.column ? this.column.factor : 0,
686
776
  sectionIndex: this.column ? this.column.order : 0,
687
- zoneIndex: this.column && this.column.section ? this.column.section.order : 0
777
+ zoneIndex: this.column && this.column.section ? this.column.section.order : 0,
778
+ zoneId: this.column?.section?.zoneId
688
779
  },
689
780
  webPartId: this.webPartId,
781
+ zoneGroupMetadata: this.column?.section?.zoneGroupMetadata,
690
782
  };
691
783
  }
692
784
  renderHtmlProperties() {
@@ -132,7 +132,8 @@ class SpoPageClientSideWebPartAddCommand extends SpoCommand {
132
132
  id: webPart.id,
133
133
  position: Object.assign({}, control.position),
134
134
  webPartId: webPart.webPartId,
135
- emphasis: {}
135
+ emphasis: {},
136
+ zoneGroupMetadata: control.zoneGroupMetadata
136
137
  }, webPart);
137
138
  if (!control.controlType) {
138
139
  // it's an empty column so we need to replace it with the web part
@@ -10,7 +10,7 @@ import { urlUtil } from '../../../../utils/urlUtil.js';
10
10
  import { validation } from '../../../../utils/validation.js';
11
11
  import SpoCommand from '../../../base/SpoCommand.js';
12
12
  import commands from '../../commands.js';
13
- import { ClientSideText } from './clientsidepages.js';
13
+ import { CanvasSection, ClientSideText } from './clientsidepages.js';
14
14
  import { Page } from './Page.js';
15
15
  class SpoPageTextAddCommand extends SpoCommand {
16
16
  get name() {
@@ -46,6 +46,12 @@ class SpoPageTextAddCommand extends SpoCommand {
46
46
  const page = await Page.getPage(pageName, args.options.webUrl, logger, this.debug, this.verbose);
47
47
  const section = (args.options.section || 1) - 1;
48
48
  const column = (args.options.column || 1) - 1;
49
+ // Add a new section when page does not contain any sections
50
+ if (page.sections.length < 1) {
51
+ const newSection = new CanvasSection(page, 1);
52
+ newSection.defaultColumn;
53
+ page.sections.push(newSection);
54
+ }
49
55
  // Make sure the section is in range
50
56
  if (section >= page.sections.length) {
51
57
  throw new Error(`Invalid section '${section + 1}'`);
@@ -14,10 +14,13 @@ m365 entra group member add [options]
14
14
 
15
15
  ```md definition-list
16
16
  `-i, --groupId [groupId]`
17
- : The ID of the Microsoft Entra group. Specify `groupId` or `groupDisplayName` but not both.
17
+ : The ID of the Microsoft Entra group. Specify `groupId`, `groupDisplayName` or `groupName` but not multiple.
18
18
 
19
19
  `-n, --groupDisplayName [groupDisplayName]`
20
- : The display name of the Microsoft Entra group. Specify `groupId` or `groupDisplayName` but not both.
20
+ : (deprecated. Use option `groupName` instead) The display name of the Microsoft Entra group. Specify `groupId`, `groupDisplayName` or `groupName` but not multiple.
21
+
22
+ `--groupName [groupName]`
23
+ : The display name of the Microsoft Entra group. Specify `groupId`, `groupDisplayName` or `groupName` but not multiple.
21
24
 
22
25
  `--ids [ids]`
23
26
  : Microsoft Entra IDs of users. You can also pass a comma-separated list of IDs. Specify either `ids` or `userNames` but not both.
@@ -39,6 +42,12 @@ Add a single member specified by ID as a member to a group specified by display
39
42
  m365 entra group member add --groupDisplayName Developers --ids 098b9f52-f48c-4401-819f-29c33794c3f5 --role Member
40
43
  ```
41
44
 
45
+ Add a single member specified by ID as a member to a group specified by group name.
46
+
47
+ ```sh
48
+ m365 entra group member add --groupName Developers --ids 098b9f52-f48c-4401-819f-29c33794c3f5 --role Member
49
+ ```
50
+
42
51
  Add multiple members specified by ID as members to a group specified by ID.
43
52
 
44
53
  ```sh
@@ -51,6 +60,12 @@ Add a single member specified by UPN as an owner to a group specified by display
51
60
  m365 entra group member add --groupDisplayName Developers --userNames john.doe@contoso.com --role Owner
52
61
  ```
53
62
 
63
+ Add a single member specified by UPN as an owner to a group specified by group name.
64
+
65
+ ```sh
66
+ m365 entra group member add --groupName Developers --userNames john.doe@contoso.com --role Owner
67
+ ```
68
+
54
69
  Adds multiple members specified by UPN as owners to a group specified by ID.
55
70
 
56
71
  ```sh
@@ -14,10 +14,13 @@ m365 entra group member set [options]
14
14
 
15
15
  ```md definition-list
16
16
  `-i, --groupId [groupId]`
17
- : The ID of the Entra ID group. Specify `groupId` or `groupDisplayName` but not both.
17
+ : The ID of the Entra ID group. Specify `groupId`, `groupDisplayName` or `groupName` but not multiple.
18
18
 
19
19
  `-n, --groupDisplayName [groupDisplayName]`
20
- : The display name of the Entra ID group. Specify `groupId` or `groupDisplayName` but not both.
20
+ : (deprecated. Use option `groupName` instead) The display name of the Entra ID group. Specify `groupId`, `groupDisplayName` or `groupName` but not multiple.
21
+
22
+ `--groupName [groupName]`
23
+ : The display name of the Microsoft Entra group. Specify `groupId`, `groupDisplayName` or `groupName` but not multiple.
21
24
 
22
25
  `--ids [ids]`
23
26
  : Comma-separated list of user IDs. Specify either `ids` or `userNames` but not both.
@@ -39,6 +42,12 @@ Update a single member specified by ID to a member of a group specified by displ
39
42
  m365 entra group member set --groupDisplayName Developers --ids 098b9f52-f48c-4401-819f-29c33794c3f5 --role Member
40
43
  ```
41
44
 
45
+ Update a single member specified by ID to a member of a group specified by group name
46
+
47
+ ```sh
48
+ m365 entra group member set --groupName Developers --ids 098b9f52-f48c-4401-819f-29c33794c3f5 --role Member
49
+ ```
50
+
42
51
  Update multiple members specified by ID to members of a group specified by ID
43
52
 
44
53
  ```sh
@@ -51,6 +60,12 @@ Update a single member specified by UPN to an owner of a group specified by disp
51
60
  m365 entra group member set --groupDisplayName Developers --userNames john.doe@contoso.com --role Owner
52
61
  ```
53
62
 
63
+ Update a single member specified by UPN to an owner of a group specified by group name
64
+
65
+ ```sh
66
+ m365 entra group member set --groupName Developers --userNames john.doe@contoso.com --role Owner
67
+ ```
68
+
54
69
  Update multiple members specified by UPN to owners of a group specified by ID
55
70
 
56
71
  ```sh
@@ -28,10 +28,14 @@ m365 spo field get [options]
28
28
  : Server- or web-relative URL of the list where the field is located. Specify either `listTitle`, `listId` or `listUrl`.
29
29
 
30
30
  `-i, --id [id]`
31
- : The ID of the field to retrieve. Specify `id` or `title` but not both.
31
+ : The ID of the field to retrieve. Specify either `id`, `title` or `internalName`.
32
32
 
33
33
  `-t, --title [title]`
34
- : The display name (case-sensitive) of the field to retrieve. Specify `id` or `title` but not both.
34
+ : The display name (case-sensitive) of the field to retrieve. Specify either `id`, `title` or `internalName`.
35
+ ```
36
+
37
+ `--internalName [internalName]`
38
+ : The internal name (case-sensitive) of the field to retrieve. Specify either `id`, `title` or `internalName`.
35
39
  ```
36
40
 
37
41
  <Global />
@@ -56,6 +60,12 @@ Retrieves list column by display name located in the specified site. Retrieves t
56
60
  m365 spo field get --webUrl https://contoso.sharepoint.com/sites/contoso-sales --listUrl "Lists/Events" --title "Title"
57
61
  ```
58
62
 
63
+ Retrieves list column by internal name located in the specified site. Retrieves the list by its url.
64
+
65
+ ```sh
66
+ m365 spo field get --webUrl https://contoso.sharepoint.com/sites/contoso-sales --listUrl "Lists/Events" --internalName "Title"
67
+ ```
68
+
59
69
  ## Response
60
70
 
61
71
  <Tabs>
@@ -26,13 +26,16 @@ m365 spo field remove [options]
26
26
  : Server- or web-relative URL of the list where the field is located. Specify either `listTitle`, `listId` or `listUrl`.
27
27
 
28
28
  `-i, --id [id]`
29
- : The ID of the field to remove. Specify either `id`, `title`, or `group`.
29
+ : The ID of the field to remove. Specify either `id`, `title`, `internalName`, or `group`.
30
30
 
31
31
  `-t, --title [title]`
32
- : The display name (case-sensitive) of the field to remove. Specify either `id`, `title`, or `group`.
32
+ : The display name (case-sensitive) of the field to remove. Specify either `id`, `title`, `internalName`, or `group`.
33
+
34
+ `--internalName [internalName]`
35
+ : The internal name (case-sensitive) of the field to remove. Specify either `id`, `title`, `internalName`, or `group`.
33
36
 
34
37
  `-g, --group [group]`
35
- : Delete all fields from this group (case-sensitive). Specify either `id`, `title`, or `group`.
38
+ : Delete all fields from this group (case-sensitive). Specify either `id`, `title`, `internalName`, or `group`.
36
39
 
37
40
  `-f, --force`
38
41
  : Don't prompt for confirming removing the field.
@@ -60,6 +63,12 @@ Remove the list column with the specified display name, located in the specified
60
63
  m365 spo field remove --webUrl https://contoso.sharepoint.com/sites/contoso-sales --listUrl "Lists/Events" --title "Title"
61
64
  ```
62
65
 
66
+ Remove the list column with the specified display name, located in the specified site. Retrieves the list by its url.
67
+
68
+ ```sh
69
+ m365 spo field remove --webUrl https://contoso.sharepoint.com/sites/contoso-sales --listUrl "Lists/Events" --internalName "Title"
70
+ ```
71
+
63
72
  Remove all site columns from the specified group.
64
73
 
65
74
  ```sh