@pnp/cli-microsoft365 6.0.0 → 6.1.0-beta.825554

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.
@@ -0,0 +1,305 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
12
+ if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
13
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
14
+ return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
15
+ };
16
+ var _PlannerPlanSetCommand_instances, _PlannerPlanSetCommand_initTelemetry, _PlannerPlanSetCommand_initOptions, _PlannerPlanSetCommand_initValidators, _PlannerPlanSetCommand_initOptionSets;
17
+ Object.defineProperty(exports, "__esModule", { value: true });
18
+ const Auth_1 = require("../../../../Auth");
19
+ const request_1 = require("../../../../request");
20
+ const accessToken_1 = require("../../../../utils/accessToken");
21
+ const formatting_1 = require("../../../../utils/formatting");
22
+ const validation_1 = require("../../../../utils/validation");
23
+ const aadGroup_1 = require("../../../../utils/aadGroup");
24
+ const planner_1 = require("../../../../utils/planner");
25
+ const GraphCommand_1 = require("../../../base/GraphCommand");
26
+ const commands_1 = require("../../commands");
27
+ class PlannerPlanSetCommand extends GraphCommand_1.default {
28
+ constructor() {
29
+ super();
30
+ _PlannerPlanSetCommand_instances.add(this);
31
+ __classPrivateFieldGet(this, _PlannerPlanSetCommand_instances, "m", _PlannerPlanSetCommand_initTelemetry).call(this);
32
+ __classPrivateFieldGet(this, _PlannerPlanSetCommand_instances, "m", _PlannerPlanSetCommand_initOptions).call(this);
33
+ __classPrivateFieldGet(this, _PlannerPlanSetCommand_instances, "m", _PlannerPlanSetCommand_initValidators).call(this);
34
+ __classPrivateFieldGet(this, _PlannerPlanSetCommand_instances, "m", _PlannerPlanSetCommand_initOptionSets).call(this);
35
+ }
36
+ get name() {
37
+ return commands_1.default.PLAN_SET;
38
+ }
39
+ get description() {
40
+ return 'Updates a Microsoft Planner plan';
41
+ }
42
+ defaultProperties() {
43
+ return ['id', 'title', 'createdDateTime', 'owner'];
44
+ }
45
+ allowUnknownOptions() {
46
+ return true;
47
+ }
48
+ getGroupId(args) {
49
+ return __awaiter(this, void 0, void 0, function* () {
50
+ const { ownerGroupId, ownerGroupName } = args.options;
51
+ if (ownerGroupId) {
52
+ return ownerGroupId;
53
+ }
54
+ const group = yield aadGroup_1.aadGroup.getGroupByDisplayName(ownerGroupName);
55
+ return group.id;
56
+ });
57
+ }
58
+ getPlanId(args) {
59
+ return __awaiter(this, void 0, void 0, function* () {
60
+ const { id, title } = args.options;
61
+ if (id) {
62
+ return id;
63
+ }
64
+ const groupId = yield this.getGroupId(args);
65
+ const plan = yield planner_1.planner.getPlanByTitle(title, groupId);
66
+ return plan.id;
67
+ });
68
+ }
69
+ getUserIds(options) {
70
+ if (options.shareWithUserIds) {
71
+ return Promise.resolve(options.shareWithUserIds.split(','));
72
+ }
73
+ const userNames = options.shareWithUserNames;
74
+ const userArr = userNames.split(',').map(o => o.trim());
75
+ const promises = userArr.map(user => {
76
+ const requestOptions = {
77
+ url: `${this.resource}/v1.0/users?$filter=userPrincipalName eq '${formatting_1.formatting.encodeQueryParameter(user)}'&$select=id,userPrincipalName`,
78
+ headers: {
79
+ 'content-type': 'application/json'
80
+ },
81
+ responseType: 'json'
82
+ };
83
+ return request_1.default.get(requestOptions);
84
+ });
85
+ return Promise
86
+ .all(promises)
87
+ .then((usersRes) => {
88
+ const userUpns = usersRes.map(res => { var _a; return (_a = res.value[0]) === null || _a === void 0 ? void 0 : _a.userPrincipalName; });
89
+ const userIds = usersRes.map(res => { var _a; return (_a = res.value[0]) === null || _a === void 0 ? void 0 : _a.id; });
90
+ // Find the members where no graph response was found
91
+ const invalidUsers = userArr.filter(user => !userUpns.some((upn) => (upn === null || upn === void 0 ? void 0 : upn.toLowerCase()) === user.toLowerCase()));
92
+ if (invalidUsers && invalidUsers.length > 0) {
93
+ return Promise.reject(`Cannot proceed with planner plan creation. The following users provided are invalid: ${invalidUsers.join(',')}`);
94
+ }
95
+ return Promise.resolve(userIds);
96
+ });
97
+ }
98
+ generateSharedWith(options) {
99
+ return __awaiter(this, void 0, void 0, function* () {
100
+ const sharedWith = {};
101
+ const userIds = yield this.getUserIds(options);
102
+ userIds.map(x => sharedWith[x] = true);
103
+ return sharedWith;
104
+ });
105
+ }
106
+ getPlanEtag(planId) {
107
+ return __awaiter(this, void 0, void 0, function* () {
108
+ const requestOptions = {
109
+ url: `${this.resource}/v1.0/planner/plans/${planId}`,
110
+ headers: {
111
+ accept: 'application/json'
112
+ },
113
+ responseType: 'json'
114
+ };
115
+ const response = yield request_1.default.get(requestOptions);
116
+ return response['@odata.etag'];
117
+ });
118
+ }
119
+ getPlanDetailsEtag(planId) {
120
+ return __awaiter(this, void 0, void 0, function* () {
121
+ const requestOptions = {
122
+ url: `${this.resource}/v1.0/planner/plans/${planId}/details`,
123
+ headers: {
124
+ accept: 'application/json'
125
+ },
126
+ responseType: 'json'
127
+ };
128
+ const response = yield request_1.default.get(requestOptions);
129
+ return response['@odata.etag'];
130
+ });
131
+ }
132
+ getPlanDetails(plan) {
133
+ return __awaiter(this, void 0, void 0, function* () {
134
+ const requestOptionsTaskDetails = {
135
+ url: `${this.resource}/v1.0/planner/plans/${plan.id}/details`,
136
+ headers: {
137
+ 'accept': 'application/json;odata.metadata=none',
138
+ 'Prefer': 'return=representation'
139
+ },
140
+ responseType: 'json'
141
+ };
142
+ const planDetails = yield request_1.default.get(requestOptionsTaskDetails);
143
+ return Object.assign(Object.assign({}, plan), planDetails);
144
+ });
145
+ }
146
+ updatePlanDetails(options, planId) {
147
+ return __awaiter(this, void 0, void 0, function* () {
148
+ const plan = yield planner_1.planner.getPlanById(planId);
149
+ const categories = {};
150
+ let categoriesCount = 0;
151
+ Object.keys(options).forEach(key => {
152
+ if (key.indexOf('category') !== -1) {
153
+ categories[key] = options[key];
154
+ categoriesCount++;
155
+ }
156
+ });
157
+ if (!options.shareWithUserIds && !options.shareWithUserNames && categoriesCount === 0) {
158
+ return this.getPlanDetails(plan);
159
+ }
160
+ const requestBody = {};
161
+ if (options.shareWithUserIds || options.shareWithUserNames) {
162
+ const sharedWith = yield this.generateSharedWith(options);
163
+ requestBody['sharedWith'] = sharedWith;
164
+ }
165
+ if (categoriesCount > 0) {
166
+ requestBody['categoryDescriptions'] = categories;
167
+ }
168
+ const etag = yield this.getPlanDetailsEtag(planId);
169
+ const requestOptionsPlanDetails = {
170
+ url: `${this.resource}/v1.0/planner/plans/${planId}/details`,
171
+ headers: {
172
+ 'accept': 'application/json;odata.metadata=none',
173
+ 'If-Match': etag,
174
+ 'Prefer': 'return=representation'
175
+ },
176
+ responseType: 'json',
177
+ data: requestBody
178
+ };
179
+ const planDetails = yield request_1.default.patch(requestOptionsPlanDetails);
180
+ return Object.assign(Object.assign({}, plan), planDetails);
181
+ });
182
+ }
183
+ commandAction(logger, args) {
184
+ return __awaiter(this, void 0, void 0, function* () {
185
+ if (accessToken_1.accessToken.isAppOnlyAccessToken(Auth_1.default.service.accessTokens[this.resource].accessToken)) {
186
+ this.handleError('This command does not support application permissions.');
187
+ return;
188
+ }
189
+ try {
190
+ const planId = yield this.getPlanId(args);
191
+ if (args.options.newTitle) {
192
+ const etag = yield this.getPlanEtag(planId);
193
+ const requestOptions = {
194
+ url: `${this.resource}/v1.0/planner/plans/${planId}`,
195
+ headers: {
196
+ accept: 'application/json;odata.metadata=none',
197
+ 'If-Match': etag,
198
+ 'Prefer': 'return=representation'
199
+ },
200
+ responseType: 'json',
201
+ data: {
202
+ "title": args.options.newTitle
203
+ }
204
+ };
205
+ yield request_1.default.patch(requestOptions);
206
+ }
207
+ const result = yield this.updatePlanDetails(args.options, planId);
208
+ logger.log(result);
209
+ }
210
+ catch (err) {
211
+ this.handleRejectedODataJsonPromise(err);
212
+ }
213
+ });
214
+ }
215
+ }
216
+ _PlannerPlanSetCommand_instances = new WeakSet(), _PlannerPlanSetCommand_initTelemetry = function _PlannerPlanSetCommand_initTelemetry() {
217
+ this.telemetry.push((args) => {
218
+ Object.assign(this.telemetryProperties, {
219
+ id: typeof args.options.id !== 'undefined',
220
+ title: typeof args.options.title !== 'undefined',
221
+ ownerGroupId: typeof args.options.ownerGroupId !== 'undefined',
222
+ ownerGroupName: typeof args.options.ownerGroupName !== 'undefined',
223
+ newTitle: typeof args.options.newTitle !== 'undefined',
224
+ shareWithUserIds: typeof args.options.shareWithUserIds !== 'undefined',
225
+ shareWithUserNames: typeof args.options.shareWithUserNames !== 'undefined'
226
+ });
227
+ });
228
+ }, _PlannerPlanSetCommand_initOptions = function _PlannerPlanSetCommand_initOptions() {
229
+ this.options.unshift({
230
+ option: '-i, --id [id]'
231
+ }, {
232
+ option: '-t, --title [title]'
233
+ }, {
234
+ option: '--ownerGroupId [ownerGroupId]'
235
+ }, {
236
+ option: '--ownerGroupName [ownerGroupName]'
237
+ }, {
238
+ option: '--newTitle [newTitle]'
239
+ }, {
240
+ option: '--shareWithUserIds [shareWithUserIds]'
241
+ }, {
242
+ option: '--shareWithUserNames [shareWithUserNames]'
243
+ });
244
+ }, _PlannerPlanSetCommand_initValidators = function _PlannerPlanSetCommand_initValidators() {
245
+ this.validators.push((args) => __awaiter(this, void 0, void 0, function* () {
246
+ if (args.options.title) {
247
+ if (args.options.ownerGroupId && !validation_1.validation.isValidGuid(args.options.ownerGroupId)) {
248
+ return `${args.options.ownerGroupId} is not a valid GUID`;
249
+ }
250
+ if (!args.options.ownerGroupId && !args.options.ownerGroupName) {
251
+ return 'Specify either ownerGroupId or ownerGroupName when using title';
252
+ }
253
+ if (args.options.ownerGroupId && args.options.ownerGroupName) {
254
+ return 'Specify either ownerGroupId or ownerGroupName when using title but not both';
255
+ }
256
+ }
257
+ if (args.options.shareWithUserIds && args.options.shareWithUserNames) {
258
+ return 'Specify either shareWithUserIds or shareWithUserNames but not both';
259
+ }
260
+ if (args.options.shareWithUserIds && !validation_1.validation.isValidGuidArray(args.options.shareWithUserIds.split(','))) {
261
+ return 'shareWithUserIds contains invalid GUID';
262
+ }
263
+ const allowedCategories = [
264
+ 'category1',
265
+ 'category2',
266
+ 'category3',
267
+ 'category4',
268
+ 'category5',
269
+ 'category6',
270
+ 'category7',
271
+ 'category8',
272
+ 'category9',
273
+ 'category10',
274
+ 'category11',
275
+ 'category12',
276
+ 'category13',
277
+ 'category14',
278
+ 'category15',
279
+ 'category16',
280
+ 'category17',
281
+ 'category18',
282
+ 'category19',
283
+ 'category20',
284
+ 'category21',
285
+ 'category22',
286
+ 'category23',
287
+ 'category24',
288
+ 'category25'
289
+ ];
290
+ let invalidCategoryOptions = false;
291
+ Object.keys(args.options).forEach(key => {
292
+ if (key.indexOf('category') !== -1 && allowedCategories.indexOf(key) === -1) {
293
+ invalidCategoryOptions = true;
294
+ }
295
+ });
296
+ if (invalidCategoryOptions) {
297
+ return 'Specify category values between category1 to category25';
298
+ }
299
+ return true;
300
+ }));
301
+ }, _PlannerPlanSetCommand_initOptionSets = function _PlannerPlanSetCommand_initOptionSets() {
302
+ this.optionSets.push({ options: ['id', 'title'] });
303
+ };
304
+ module.exports = new PlannerPlanSetCommand();
305
+ //# sourceMappingURL=plan-set.js.map
@@ -11,6 +11,7 @@ exports.default = {
11
11
  PLAN_GET: `${prefix} plan get`,
12
12
  PLAN_LIST: `${prefix} plan list`,
13
13
  PLAN_REMOVE: `${prefix} plan remove`,
14
+ PLAN_SET: `${prefix} plan set`,
14
15
  TASK_ADD: `${prefix} task add`,
15
16
  TASK_CHECKLISTITEM_ADD: `${prefix} task checklistitem add`,
16
17
  TASK_CHECKLISTITEM_LIST: `${prefix} task checklistitem list`,
@@ -21,6 +21,7 @@ const validation_1 = require("../../../../utils/validation");
21
21
  const SpoCommand_1 = require("../../../base/SpoCommand");
22
22
  const commands_1 = require("../../commands");
23
23
  const request_1 = require("../../../../request");
24
+ const config_1 = require("../../../../config");
24
25
  class SpoContentTypeSetCommand extends SpoCommand_1.default {
25
26
  constructor() {
26
27
  super();
@@ -35,46 +36,32 @@ class SpoContentTypeSetCommand extends SpoCommand_1.default {
35
36
  return commands_1.default.CONTENTTYPE_SET;
36
37
  }
37
38
  get description() {
38
- return 'Updates existing content type';
39
+ return 'Update an existing content type';
39
40
  }
40
41
  allowUnknownOptions() {
41
42
  return true;
42
43
  }
43
44
  commandAction(logger, args) {
44
45
  return __awaiter(this, void 0, void 0, function* () {
45
- const requestOptions = {
46
- url: `${args.options.webUrl}/_api/Web`,
47
- headers: {
48
- accept: 'application/json;odata=nometadata'
49
- },
50
- responseType: 'json',
51
- data: this.getRequestPayload(args.options)
52
- };
53
- if (args.options.listId) {
54
- requestOptions.url += `/Lists/GetById('${formatting_1.formatting.encodeQueryParameter(args.options.listId)}')`;
55
- }
56
- else if (args.options.listTitle) {
57
- requestOptions.url += `/Lists/GetByTitle('${formatting_1.formatting.encodeQueryParameter(args.options.listTitle)}')`;
58
- }
59
- else if (args.options.listUrl) {
60
- requestOptions.url += `/GetList('${formatting_1.formatting.encodeQueryParameter(urlUtil_1.urlUtil.getServerRelativePath(args.options.webUrl, args.options.listUrl))}')`;
61
- }
62
- requestOptions.url += '/ContentTypes';
63
46
  try {
64
- const contentTypeId = yield this.getContentTypeId(args.options);
65
- requestOptions.url += `/GetById('${formatting_1.formatting.encodeQueryParameter(contentTypeId)}')`;
66
- yield request_1.default.patch(requestOptions);
47
+ const contentTypeId = yield this.getContentTypeId(logger, args.options);
48
+ const siteId = yield this.getSiteId(logger, args.options.webUrl);
49
+ const webId = yield this.getWebId(logger, args.options.webUrl);
50
+ yield this.updateContentType(logger, siteId, webId, contentTypeId, args.options);
67
51
  }
68
52
  catch (err) {
69
- this.handleRejectedPromise(err);
53
+ this.handleRejectedODataJsonPromise(err);
70
54
  }
71
55
  });
72
56
  }
73
- getContentTypeId(options) {
57
+ getContentTypeId(logger, options) {
74
58
  return __awaiter(this, void 0, void 0, function* () {
75
59
  if (options.id) {
76
60
  return options.id;
77
61
  }
62
+ if (this.verbose) {
63
+ logger.logToStderr(`Retrieving content type to update...`);
64
+ }
78
65
  const requestOptions = {
79
66
  url: `${options.webUrl}/_api/Web`,
80
67
  headers: {
@@ -99,6 +86,27 @@ class SpoContentTypeSetCommand extends SpoCommand_1.default {
99
86
  return res.value[0].Id.StringValue;
100
87
  });
101
88
  }
89
+ updateContentType(logger, siteId, webId, contentTypeId, options) {
90
+ return __awaiter(this, void 0, void 0, function* () {
91
+ if (this.verbose) {
92
+ logger.logToStderr(`Updating content type...`);
93
+ }
94
+ const payload = this.getRequestPayload(options);
95
+ const requestOptions = {
96
+ url: `${options.webUrl}/_vti_bin/client.svc/ProcessQuery`,
97
+ headers: {
98
+ 'Content-Type': 'text/xml'
99
+ },
100
+ 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>${payload}</Actions><ObjectPaths><Identity Id="9" Name="fc4179a0-e0d7-5000-c38b-bc3506fbab6f|740c6a0b-85e2-48a0-a494-e0f1759d4aa7:site:${siteId}:web:${webId}:contenttype:${formatting_1.formatting.escapeXml(contentTypeId)}" /></ObjectPaths></Request>`
101
+ };
102
+ const res = yield request_1.default.post(requestOptions);
103
+ const json = JSON.parse(res);
104
+ const response = json[0];
105
+ if (response.ErrorInfo) {
106
+ throw response.ErrorInfo.ErrorMessage;
107
+ }
108
+ });
109
+ }
102
110
  getRequestPayload(options) {
103
111
  const excludeOptions = [
104
112
  'webUrl',
@@ -110,15 +118,51 @@ class SpoContentTypeSetCommand extends SpoCommand_1.default {
110
118
  'query',
111
119
  'debug',
112
120
  'verbose',
113
- 'output'
121
+ 'output',
122
+ 'updateChildren'
114
123
  ];
124
+ let i = 12;
115
125
  const payload = Object.keys(options)
116
126
  .filter(key => excludeOptions.indexOf(key) === -1)
117
- .reduce((object, key) => {
118
- object[key] = options[key];
119
- return object;
120
- }, {});
121
- return payload;
127
+ .map(key => {
128
+ return `<SetProperty Id="${i++}" ObjectPathId="9" Name="${key}"><Parameter Type="String">${formatting_1.formatting.escapeXml(options[key])}</Parameter></SetProperty>`;
129
+ });
130
+ if (options.updateChildren) {
131
+ payload.push(`<Method Name="Update" Id="${i++}" ObjectPathId="9"><Parameters><Parameter Type="Boolean">true</Parameter></Parameters></Method>`);
132
+ }
133
+ return payload.join('');
134
+ }
135
+ getSiteId(logger, webUrl) {
136
+ return __awaiter(this, void 0, void 0, function* () {
137
+ if (this.verbose) {
138
+ logger.logToStderr(`Retrieving site collection id...`);
139
+ }
140
+ const requestOptions = {
141
+ url: `${webUrl}/_api/site?$select=Id`,
142
+ headers: {
143
+ accept: 'application/json;odata=nometadata'
144
+ },
145
+ responseType: 'json'
146
+ };
147
+ const site = yield request_1.default.get(requestOptions);
148
+ return site.Id;
149
+ });
150
+ }
151
+ getWebId(logger, webUrl) {
152
+ return __awaiter(this, void 0, void 0, function* () {
153
+ if (this.verbose) {
154
+ logger.logToStderr(`Retrieving web id...`);
155
+ }
156
+ const requestOptions = {
157
+ url: `${webUrl}/_api/web?$select=Id`,
158
+ headers: {
159
+ accept: 'application/json;odata=nometadata'
160
+ },
161
+ responseType: 'json'
162
+ };
163
+ const web = yield request_1.default.get(requestOptions);
164
+ return web.Id;
165
+ });
122
166
  }
123
167
  }
124
168
  _SpoContentTypeSetCommand_instances = new WeakSet(), _SpoContentTypeSetCommand_initTelemetry = function _SpoContentTypeSetCommand_initTelemetry() {
@@ -128,7 +172,8 @@ _SpoContentTypeSetCommand_instances = new WeakSet(), _SpoContentTypeSetCommand_i
128
172
  name: typeof args.options.name !== 'undefined',
129
173
  listTitle: typeof args.options.listTitle !== 'undefined',
130
174
  listId: typeof args.options.listId !== 'undefined',
131
- listUrl: typeof args.options.listUrl !== 'undefined'
175
+ listUrl: typeof args.options.listUrl !== 'undefined',
176
+ updateChildren: args.options.updateChildren
132
177
  });
133
178
  });
134
179
  }, _SpoContentTypeSetCommand_initOptions = function _SpoContentTypeSetCommand_initOptions() {
@@ -144,6 +189,8 @@ _SpoContentTypeSetCommand_instances = new WeakSet(), _SpoContentTypeSetCommand_i
144
189
  option: '--listId [listId]'
145
190
  }, {
146
191
  option: '--listUrl [listUrl]'
192
+ }, {
193
+ option: '--updateChildren'
147
194
  });
148
195
  }, _SpoContentTypeSetCommand_initValidators = function _SpoContentTypeSetCommand_initValidators() {
149
196
  this.validators.push((args) => __awaiter(this, void 0, void 0, function* () {
@@ -21,9 +21,7 @@ const request_1 = require("../../../../request");
21
21
  const formatting_1 = require("../../../../utils/formatting");
22
22
  const validation_1 = require("../../../../utils/validation");
23
23
  const SpoCommand_1 = require("../../../base/SpoCommand");
24
- const base_permissions_1 = require("../../base-permissions");
25
24
  const commands_1 = require("../../commands");
26
- const RoleType_1 = require("../roledefinition/RoleType");
27
25
  class SpoFileGetCommand extends SpoCommand_1.default {
28
26
  constructor() {
29
27
  super();
@@ -107,10 +105,12 @@ class SpoFileGetCommand extends SpoCommand_1.default {
107
105
  if (args.options.withPermissions) {
108
106
  requestOptions.url = `${args.options.webUrl}/_api/web/GetFileByServerRelativePath(DecodedUrl='${file.ServerRelativeUrl}')/ListItemAllFields/RoleAssignments?$expand=Member,RoleDefinitionBindings`;
109
107
  const response = yield request_1.default.get(requestOptions);
110
- const roleAssignments = this.setFriendlyPermissions(response.value);
111
- fileProperties.RoleAssignments = roleAssignments;
108
+ response.value.forEach((r) => {
109
+ r.RoleDefinitionBindings = formatting_1.formatting.setFriendlyPermissions(r.RoleDefinitionBindings);
110
+ });
111
+ fileProperties.RoleAssignments = response.value;
112
112
  if (args.options.asListItem) {
113
- fileProperties.ListItemAllFields.RoleAssignments = roleAssignments;
113
+ fileProperties.ListItemAllFields.RoleAssignments = response.value;
114
114
  }
115
115
  }
116
116
  logger.log(args.options.asListItem ? fileProperties.ListItemAllFields : fileProperties);
@@ -122,18 +122,6 @@ class SpoFileGetCommand extends SpoCommand_1.default {
122
122
  }
123
123
  });
124
124
  }
125
- setFriendlyPermissions(response) {
126
- response.forEach((r) => {
127
- r.RoleDefinitionBindings.forEach((r) => {
128
- const permissions = new base_permissions_1.BasePermissions();
129
- permissions.high = r.BasePermissions.High;
130
- permissions.low = r.BasePermissions.Low;
131
- r.BasePermissionsValue = permissions.parse();
132
- r.RoleTypeKindValue = RoleType_1.RoleType[r.RoleTypeKind];
133
- });
134
- });
135
- return response;
136
- }
137
125
  }
138
126
  _SpoFileGetCommand_instances = new WeakSet(), _SpoFileGetCommand_initTelemetry = function _SpoFileGetCommand_initTelemetry() {
139
127
  this.telemetry.push((args) => {
@@ -23,8 +23,6 @@ const validation_1 = require("../../../../utils/validation");
23
23
  const SpoCommand_1 = require("../../../base/SpoCommand");
24
24
  const commands_1 = require("../../commands");
25
25
  const ListPrincipalType_1 = require("../list/ListPrincipalType");
26
- const base_permissions_1 = require("../../base-permissions");
27
- const RoleType_1 = require("../../commands/roledefinition/RoleType");
28
26
  class SpoFolderGetCommand extends SpoCommand_1.default {
29
27
  constructor() {
30
28
  super();
@@ -72,13 +70,7 @@ class SpoFolderGetCommand extends SpoCommand_1.default {
72
70
  }
73
71
  listItemAllFields.RoleAssignments.forEach(r => {
74
72
  r.Member.PrincipalTypeString = ListPrincipalType_1.ListPrincipalType[r.Member.PrincipalType];
75
- r.RoleDefinitionBindings.forEach(rb => {
76
- const permissions = new base_permissions_1.BasePermissions();
77
- permissions.high = rb.BasePermissions.High;
78
- permissions.low = rb.BasePermissions.Low;
79
- rb.BasePermissionsValue = permissions.parse();
80
- rb.RoleTypeKindValue = RoleType_1.RoleType[rb.RoleTypeKind];
81
- });
73
+ r.RoleDefinitionBindings = formatting_1.formatting.setFriendlyPermissions(r.RoleDefinitionBindings);
82
74
  });
83
75
  }
84
76
  logger.log(folder);
@@ -20,9 +20,7 @@ const formatting_1 = require("../../../../utils/formatting");
20
20
  const urlUtil_1 = require("../../../../utils/urlUtil");
21
21
  const validation_1 = require("../../../../utils/validation");
22
22
  const SpoCommand_1 = require("../../../base/SpoCommand");
23
- const base_permissions_1 = require("../../base-permissions");
24
23
  const commands_1 = require("../../commands");
25
- const RoleType_1 = require("../roledefinition/RoleType");
26
24
  class SpoListItemGetCommand extends SpoCommand_1.default {
27
25
  constructor() {
28
26
  super();
@@ -72,8 +70,10 @@ class SpoListItemGetCommand extends SpoCommand_1.default {
72
70
  if (args.options.withPermissions) {
73
71
  requestOptions.url = `${requestUrl}/items(${args.options.id})/RoleAssignments?$expand=Member,RoleDefinitionBindings`;
74
72
  const response = yield request_1.default.get(requestOptions);
75
- const roleAssignments = this.setFriendlyPermissions(response.value);
76
- itemProperties.RoleAssignments = roleAssignments;
73
+ response.value.forEach((r) => {
74
+ r.RoleDefinitionBindings = formatting_1.formatting.setFriendlyPermissions(r.RoleDefinitionBindings);
75
+ });
76
+ itemProperties.RoleAssignments = response.value;
77
77
  }
78
78
  delete itemProperties['ID'];
79
79
  logger.log(itemProperties);
@@ -83,18 +83,6 @@ class SpoListItemGetCommand extends SpoCommand_1.default {
83
83
  }
84
84
  });
85
85
  }
86
- setFriendlyPermissions(response) {
87
- response.forEach((r) => {
88
- r.RoleDefinitionBindings.forEach((r) => {
89
- const permissions = new base_permissions_1.BasePermissions();
90
- permissions.high = r.BasePermissions.High;
91
- permissions.low = r.BasePermissions.Low;
92
- r.BasePermissionsValue = permissions.parse();
93
- r.RoleTypeKindValue = RoleType_1.RoleType[r.RoleTypeKind];
94
- });
95
- });
96
- return response;
97
- }
98
86
  }
99
87
  _SpoListItemGetCommand_instances = new WeakSet(), _SpoListItemGetCommand_initTelemetry = function _SpoListItemGetCommand_initTelemetry() {
100
88
  this.telemetry.push((args) => {
@@ -127,16 +127,17 @@ class SpoListItemSetCommand extends SpoCommand_1.default {
127
127
  objectIdentity = yield this.requestObjectIdentity(args.options.webUrl, logger, formDigestValue);
128
128
  }
129
129
  const additionalContentType = (args.options.systemUpdate && args.options.contentType && contentTypeName !== '') ? `
130
+ <Method Name="ParseAndSetFieldValue" Id="1" ObjectPathId="147">
130
131
  <Parameters>
131
132
  <Parameter Type="String">ContentType</Parameter>
132
133
  <Parameter Type="String">${contentTypeName}</Parameter>
133
- </Parameters>`
134
+ </Parameters>
135
+ </Method>`
134
136
  : ``;
135
137
  const requestBody = args.options.systemUpdate ?
136
138
  `<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">
137
139
  <Actions>
138
- <Method Name="ParseAndSetFieldValue" Id="1" ObjectPathId="147">${this.mapRequestBody(args.options).join()}${additionalContentType}
139
- </Method>
140
+ ${this.mapRequestBody(args.options).join('')}${additionalContentType}
140
141
  <Method Name="SystemUpdate" Id="2" ObjectPathId="147" />
141
142
  </Actions>
142
143
  <ObjectPaths>
@@ -231,10 +232,12 @@ class SpoListItemSetCommand extends SpoCommand_1.default {
231
232
  if (excludeOptions.indexOf(key) === -1) {
232
233
  if (options.systemUpdate) {
233
234
  requestBody.push(`
235
+ <Method Name="ParseAndSetFieldValue" Id="1" ObjectPathId="147">
234
236
  <Parameters>
235
237
  <Parameter Type="String">${key}</Parameter>
236
238
  <Parameter Type="String">${options[key].toString()}</Parameter>
237
- </Parameters>`);
239
+ </Parameters>
240
+ </Method>`);
238
241
  }
239
242
  else {
240
243
  requestBody.push({ FieldName: key, FieldValue: options[key].toString() });
@@ -13,7 +13,7 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
13
13
  if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
14
14
  return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
15
15
  };
16
- var _SpoNavigationNodeAddCommand_instances, _SpoNavigationNodeAddCommand_initTelemetry, _SpoNavigationNodeAddCommand_initOptions, _SpoNavigationNodeAddCommand_initValidators;
16
+ var _SpoNavigationNodeAddCommand_instances, _SpoNavigationNodeAddCommand_initTelemetry, _SpoNavigationNodeAddCommand_initOptions, _SpoNavigationNodeAddCommand_initValidators, _SpoNavigationNodeAddCommand_initOptionSets;
17
17
  Object.defineProperty(exports, "__esModule", { value: true });
18
18
  const request_1 = require("../../../../request");
19
19
  const validation_1 = require("../../../../utils/validation");
@@ -26,6 +26,7 @@ class SpoNavigationNodeAddCommand extends SpoCommand_1.default {
26
26
  __classPrivateFieldGet(this, _SpoNavigationNodeAddCommand_instances, "m", _SpoNavigationNodeAddCommand_initTelemetry).call(this);
27
27
  __classPrivateFieldGet(this, _SpoNavigationNodeAddCommand_instances, "m", _SpoNavigationNodeAddCommand_initOptions).call(this);
28
28
  __classPrivateFieldGet(this, _SpoNavigationNodeAddCommand_instances, "m", _SpoNavigationNodeAddCommand_initValidators).call(this);
29
+ __classPrivateFieldGet(this, _SpoNavigationNodeAddCommand_instances, "m", _SpoNavigationNodeAddCommand_initOptionSets).call(this);
29
30
  }
30
31
  get name() {
31
32
  return commands_1.default.NAVIGATION_NODE_ADD;
@@ -71,6 +72,7 @@ _SpoNavigationNodeAddCommand_instances = new WeakSet(), _SpoNavigationNodeAddCom
71
72
  this.telemetry.push((args) => {
72
73
  Object.assign(this.telemetryProperties, {
73
74
  isExternal: args.options.isExternal,
75
+ location: typeof args.options.location !== 'undefined',
74
76
  parentNodeId: typeof args.options.parentNodeId !== 'undefined'
75
77
  });
76
78
  });
@@ -108,6 +110,8 @@ _SpoNavigationNodeAddCommand_instances = new WeakSet(), _SpoNavigationNodeAddCom
108
110
  }
109
111
  return true;
110
112
  }));
113
+ }, _SpoNavigationNodeAddCommand_initOptionSets = function _SpoNavigationNodeAddCommand_initOptionSets() {
114
+ this.optionSets.push({ options: ['location', 'parentNodeId'] });
111
115
  };
112
116
  module.exports = new SpoNavigationNodeAddCommand();
113
117
  //# sourceMappingURL=navigation-node-add.js.map
@@ -16,11 +16,10 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
16
16
  var _SpoRoleDefinitionListCommand_instances, _SpoRoleDefinitionListCommand_initOptions, _SpoRoleDefinitionListCommand_initValidators;
17
17
  Object.defineProperty(exports, "__esModule", { value: true });
18
18
  const odata_1 = require("../../../../utils/odata");
19
+ const formatting_1 = require("../../../../utils/formatting");
19
20
  const validation_1 = require("../../../../utils/validation");
20
21
  const SpoCommand_1 = require("../../../base/SpoCommand");
21
- const base_permissions_1 = require("../../base-permissions");
22
22
  const commands_1 = require("../../commands");
23
- const RoleType_1 = require("./RoleType");
24
23
  class SpoRoleDefinitionListCommand extends SpoCommand_1.default {
25
24
  constructor() {
26
25
  super();
@@ -44,7 +43,7 @@ class SpoRoleDefinitionListCommand extends SpoCommand_1.default {
44
43
  }
45
44
  try {
46
45
  const res = yield odata_1.odata.getAllItems(`${args.options.webUrl}/_api/web/roledefinitions`);
47
- const response = this.setFriendlyPermissions(res);
46
+ const response = formatting_1.formatting.setFriendlyPermissions(res);
48
47
  logger.log(response);
49
48
  }
50
49
  catch (err) {
@@ -52,16 +51,6 @@ class SpoRoleDefinitionListCommand extends SpoCommand_1.default {
52
51
  }
53
52
  });
54
53
  }
55
- setFriendlyPermissions(response) {
56
- response.forEach((r) => {
57
- const permissions = new base_permissions_1.BasePermissions();
58
- permissions.high = r.BasePermissions.High;
59
- permissions.low = r.BasePermissions.Low;
60
- r.BasePermissionsValue = permissions.parse();
61
- r.RoleTypeKindValue = RoleType_1.RoleType[r.RoleTypeKind];
62
- });
63
- return response;
64
- }
65
54
  }
66
55
  _SpoRoleDefinitionListCommand_instances = new WeakSet(), _SpoRoleDefinitionListCommand_initOptions = function _SpoRoleDefinitionListCommand_initOptions() {
67
56
  this.options.unshift({
@@ -16,11 +16,10 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
16
16
  var _SpoWebGetCommand_instances, _SpoWebGetCommand_initTelemetry, _SpoWebGetCommand_initOptions, _SpoWebGetCommand_initValidators;
17
17
  Object.defineProperty(exports, "__esModule", { value: true });
18
18
  const request_1 = require("../../../../request");
19
+ const formatting_1 = require("../../../../utils/formatting");
19
20
  const validation_1 = require("../../../../utils/validation");
20
21
  const SpoCommand_1 = require("../../../base/SpoCommand");
21
- const base_permissions_1 = require("../../base-permissions");
22
22
  const commands_1 = require("../../commands");
23
- const RoleType_1 = require("../roledefinition/RoleType");
24
23
  class SpoWebGetCommand extends SpoCommand_1.default {
25
24
  constructor() {
26
25
  super();
@@ -53,8 +52,10 @@ class SpoWebGetCommand extends SpoCommand_1.default {
53
52
  if (args.options.withPermissions) {
54
53
  requestOptions.url = `${args.options.url}/_api/web/RoleAssignments?$expand=Member,RoleDefinitionBindings`;
55
54
  const response = yield request_1.default.get(requestOptions);
56
- const roleAssignments = this.setFriendlyPermissions(response.value);
57
- webProperties.RoleAssignments = roleAssignments;
55
+ response.value.forEach((r) => {
56
+ r.RoleDefinitionBindings = formatting_1.formatting.setFriendlyPermissions(r.RoleDefinitionBindings);
57
+ });
58
+ webProperties.RoleAssignments = response.value;
58
59
  }
59
60
  logger.log(webProperties);
60
61
  }
@@ -63,18 +64,6 @@ class SpoWebGetCommand extends SpoCommand_1.default {
63
64
  }
64
65
  });
65
66
  }
66
- setFriendlyPermissions(response) {
67
- response.forEach((r) => {
68
- r.RoleDefinitionBindings.forEach((r) => {
69
- const permissions = new base_permissions_1.BasePermissions();
70
- permissions.high = r.BasePermissions.High;
71
- permissions.low = r.BasePermissions.Low;
72
- r.BasePermissionsValue = permissions.parse();
73
- r.RoleTypeKindValue = RoleType_1.RoleType[r.RoleTypeKind];
74
- });
75
- });
76
- return response;
77
- }
78
67
  }
79
68
  _SpoWebGetCommand_instances = new WeakSet(), _SpoWebGetCommand_initTelemetry = function _SpoWebGetCommand_initTelemetry() {
80
69
  this.telemetry.push((args) => {
@@ -2,6 +2,8 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.formatting = void 0;
4
4
  const stripJsonComments = require("strip-json-comments");
5
+ const base_permissions_1 = require("../m365/spo/base-permissions");
6
+ const RoleType_1 = require("../m365/spo/commands/roledefinition/RoleType");
5
7
  exports.formatting = {
6
8
  escapeXml(s) {
7
9
  if (!s) {
@@ -38,6 +40,16 @@ exports.formatting = {
38
40
  return filtered;
39
41
  }, {});
40
42
  },
43
+ setFriendlyPermissions(response) {
44
+ response.forEach((r) => {
45
+ const permissions = new base_permissions_1.BasePermissions();
46
+ permissions.high = r.BasePermissions.High;
47
+ permissions.low = r.BasePermissions.Low;
48
+ r.BasePermissionsValue = permissions.parse();
49
+ r.RoleTypeKindValue = RoleType_1.RoleType[r.RoleTypeKind];
50
+ });
51
+ return response;
52
+ },
41
53
  parseCsvToJson(s, quoteChar = '"', delimiter = ',') {
42
54
  const regex = new RegExp(`\\s*(${quoteChar})?(.*?)\\1\\s*(?:${delimiter}|$)`, 'gs');
43
55
  const lines = s.split('\n');
@@ -0,0 +1,144 @@
1
+ # planner plan set
2
+
3
+ Updates a Microsoft Planner plan
4
+
5
+ ## Usage
6
+
7
+ ```sh
8
+ m365 planner plan set [options]
9
+ ```
10
+
11
+ ## Options
12
+
13
+ `-i, --id [id]`
14
+ : ID of the plan. Specify either `id` or `title` but not both.
15
+
16
+ `-t, --title [title]`
17
+ : Title of the plan. Specify either `id` or `title` but not both.
18
+
19
+ `--ownerGroupId [ownerGroupId]`
20
+ : ID of the group to which the plan belongs. Specify either `ownerGroupId` or `ownerGroupName` when using `title`.
21
+
22
+ `--ownerGroupName [ownerGroupName]`
23
+ : Name of the Group to which the plan belongs. Specify either `ownerGroupId` or `ownerGroupName` when using `title`.
24
+
25
+ `--newTitle [newTitle]`
26
+ : New title of the plan.
27
+
28
+ `--shareWithUserIds [shareWithUserIds]`
29
+ : The comma-separated IDs of the users with whom you want to share the plan. Specify either `shareWithUserIds` or `shareWithUserNames` but not both.
30
+
31
+ `--shareWithUserNames [shareWithUserNames]`
32
+ : The comma-separated UPNs of the users with whom you want to share the plan. Specify either `shareWithUserIds` or `shareWithUserNames` but not both.
33
+
34
+ --8<-- "docs/cmd/_global.md"
35
+
36
+ ## Remarks
37
+
38
+ This command allows using unknown options.
39
+
40
+ `--category1 [category1]`
41
+ : New label for a category. Define the category key within your option to update the related label. Category 1 to 25 are available. E.g., `--category4`, `--category12`.
42
+
43
+ ## Examples
44
+
45
+ Updates a Microsoft Planner plan title to New Title
46
+
47
+ ```sh
48
+ m365 planner plan set --id 'gndWOTSK60GfPQfiDDj43JgACDCb' --newTitle 'New Title'
49
+ ```
50
+
51
+ Share a Microsoft Planner plan owned by the group, with the users
52
+
53
+ ```sh
54
+ m365 planner plan set --title 'Plan Title' --ownerGroupName 'My Group' --shareWithUserNames 'user1@contoso.com,user2@contoso.com'
55
+ ```
56
+
57
+ Updates a Microsoft Planner plan category labels
58
+
59
+ ```sh
60
+ m365 planner plan set --id 'gndWOTSK60GfPQfiDDj43JgACDCb' --category21 'ToDo' --category25 'Urgent'
61
+ ```
62
+
63
+ ## More information
64
+
65
+ - Update plannerPlan: [https://learn.microsoft.com/en-us/graph/api/plannerplan-update?view=graph-rest-1.0&tabs=http](https://learn.microsoft.com/en-us/graph/api/plannerplan-update?view=graph-rest-1.0&tabs=http)
66
+ - plannerPlanDetails resource type: [https://learn.microsoft.com/en-us/graph/api/resources/plannerplandetails?view=graph-rest-1.0](https://learn.microsoft.com/en-us/graph/api/resources/plannerplandetails?view=graph-rest-1.0)
67
+ - plannerCategoryDescriptions resource type: [https://learn.microsoft.com/en-us/graph/api/resources/plannercategorydescriptions?view=graph-rest-1.0](https://learn.microsoft.com/en-us/graph/api/resources/plannercategorydescriptions?view=graph-rest-1.0)
68
+
69
+
70
+ ## Response
71
+
72
+ === "JSON"
73
+
74
+ ```json
75
+ {
76
+ "createdDateTime": "2015-03-30T18:36:49.2407981Z",
77
+ "owner": "ebf3b108-5234-4e22-b93d-656d7dae5874",
78
+ "title": "My Planner Plan",
79
+ "id": "xqQg5FS2LkCp935s-FIFm2QAFkHM",
80
+ "createdBy": {
81
+ "user": {
82
+ "displayName": null,
83
+ "id": "95e27074-6c4a-447a-aa24-9d718a0b86fa"
84
+ },
85
+ "application": {
86
+ "displayName": null,
87
+ "id": "ebf3b108-5234-4e22-b93d-656d7dae5874"
88
+ }
89
+ },
90
+ "container": {
91
+ "containerId": "ebf3b108-5234-4e22-b93d-656d7dae5874",
92
+ "type": "group",
93
+ "url": "https://graph.microsoft.com/v1.0/groups/ebf3b108-5234-4e22-b93d-656d7dae5874"
94
+ },
95
+ "sharedWith": {
96
+ "ebf3b108-5234-4e22-b93d-656d7dae5874": true,
97
+ "6463a5ce-2119-4198-9f2a-628761df4a62": true
98
+ },
99
+ "categoryDescriptions": {
100
+ "category1": null,
101
+ "category2": null,
102
+ "category3": null,
103
+ "category4": null,
104
+ "category5": null,
105
+ "category6": null,
106
+ "category7": null,
107
+ "category8": null,
108
+ "category9": null,
109
+ "category10": null,
110
+ "category11": null,
111
+ "category12": null,
112
+ "category13": null,
113
+ "category14": null,
114
+ "category15": null,
115
+ "category16": null,
116
+ "category17": null,
117
+ "category18": null,
118
+ "category19": null,
119
+ "category20": null,
120
+ "category21": null,
121
+ "category22": null,
122
+ "category23": null,
123
+ "category24": null,
124
+ "category25": null
125
+ }
126
+ }
127
+ ```
128
+
129
+ === "Text"
130
+
131
+ ```text
132
+ createdDateTime: 2015-03-30T18:36:49.2407981Z
133
+ id : xqQg5FS2LkCp935s-FIFm2QAFkHM
134
+ owner : ebf3b108-5234-4e22-b93d-656d7dae5874
135
+ title : My Planner Plan
136
+ ```
137
+
138
+ === "CSV"
139
+
140
+ ```csv
141
+ id,title,createdDateTime,owner
142
+ xqQg5FS2LkCp935s-FIFm2QAFkHM,My Planner Plan,2015-03-30T18:36:49.2407981Z,ebf3b108-5234-4e22-b93d-656d7dae5874
143
+ ```
144
+
@@ -1,6 +1,6 @@
1
1
  # spo contenttype set
2
2
 
3
- Update existing content type
3
+ Update an existing content type
4
4
 
5
5
  ## Usage
6
6
 
@@ -28,8 +28,16 @@ m365 spo contenttype set [options]
28
28
  `--listUrl [listUrl]`
29
29
  : URL of the list if you want to update a list content type. Specify either `listTitle`, `listId` or `listUrl`.
30
30
 
31
+ `--updateChildren`
32
+ : Specify if you want to push updates to child content types.
33
+
31
34
  --8<-- "docs/cmd/_global.md"
32
35
 
36
+ ## Remarks
37
+
38
+ !!! important "Updating child content types"
39
+ When specifying the `--updateChildren` flag, SharePoint will only propagate the changes that are made in the current request. If you want to know more about updating a content type and propagating changes to child content types, be sure to [read more here](https://learn.microsoft.com/en-us/previous-versions/office/developer/sharepoint-2010/ms442695(v=office.14)#considerations-when-updating-child-content-types).
40
+
33
41
  ## Examples
34
42
 
35
43
  Move site content type to a different group
@@ -43,3 +51,9 @@ Rename list content type
43
51
  ```sh
44
52
  m365 spo contenttype set --name "My old item" --webUrl https://contoso.sharepoint.com --listTitle "My list" --Name "My item"
45
53
  ```
54
+
55
+ Configure a form customizer with manifest ID _19890cce-15d8-4af9-bfcb-72da06d13ed8_ on a site content type and push changes to child content types.
56
+
57
+ ```sh
58
+ m365 spo contenttype set --name "My content type" --webUrl https://contoso.sharepoint.com --DisplayFormClientSideComponentId "19890cce-15d8-4af9-bfcb-72da06d13ed8" --EditFormClientSideComponentId "19890cce-15d8-4af9-bfcb-72da06d13ed8" --NewFormClientSideComponentId "19890cce-15d8-4af9-bfcb-72da06d13ed8" --updateChildren
59
+ ```
@@ -11,22 +11,22 @@ m365 spo navigation node add [options]
11
11
  ## Options
12
12
 
13
13
  `-u, --webUrl <webUrl>`
14
- : Absolute URL of the site to which navigation should be modified
14
+ : Absolute URL of the site to which navigation should be modified.
15
15
 
16
16
  `-l, --location [location]`
17
- : Navigation type where the node should be added. Available options: `QuickLaunch`, `TopNavigationBar`
17
+ : Navigation type where the node should be added. Available options: `QuickLaunch`, `TopNavigationBar`. Specify either `location` or `parentNodeId` but not both.
18
18
 
19
19
  `-t, --title <title>`
20
- : Navigation node title
20
+ : Navigation node title.
21
21
 
22
22
  `--url <url>`
23
- : Navigation node URL
23
+ : Navigation node URL.
24
24
 
25
25
  `--parentNodeId [parentNodeId]`
26
- : ID of the node below which the node should be added
26
+ : ID of the node below which the node should be added. Specify either `location` or `parentNodeId` but not both.
27
27
 
28
28
  `--isExternal`
29
- : Set, if the navigation node points to an external URL
29
+ : Set, if the navigation node points to an external URL.
30
30
 
31
31
  --8<-- "docs/cmd/_global.md"
32
32
 
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@pnp/cli-microsoft365",
3
- "version": "6.0.0",
3
+ "version": "6.1.0",
4
4
  "lockfileVersion": 2,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "@pnp/cli-microsoft365",
9
- "version": "6.0.0",
9
+ "version": "6.1.0",
10
10
  "license": "MIT",
11
11
  "dependencies": {
12
12
  "@azure/msal-node": "^1.14.2",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pnp/cli-microsoft365",
3
- "version": "6.0.0",
3
+ "version": "6.1.0-beta.0825554",
4
4
  "description": "Manage Microsoft 365 and SharePoint Framework projects on any platform",
5
5
  "license": "MIT",
6
6
  "main": "./dist/api.js",
@@ -269,4 +269,4 @@
269
269
  "sinon": "^14.0.1",
270
270
  "source-map-support": "^0.5.21"
271
271
  }
272
- }
272
+ }