@pnp/cli-microsoft365 6.1.0-beta.f818fbb → 6.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (38) hide show
  1. package/dist/m365/aad/commands/group/group-get.js +79 -0
  2. package/dist/m365/aad/commands/user/user-set.js +84 -11
  3. package/dist/m365/aad/commands.js +1 -0
  4. package/dist/m365/base/ContextCommand.js +33 -0
  5. package/dist/m365/context/commands/context-init.js +28 -0
  6. package/dist/m365/context/commands/context-remove.js +103 -0
  7. package/dist/m365/context/commands.js +8 -0
  8. package/dist/m365/pp/commands/environment/environment-get.js +5 -13
  9. package/dist/m365/purview/commands/retentionlabel/retentionlabel-set.js +142 -0
  10. package/dist/m365/purview/commands.js +2 -1
  11. package/dist/m365/search/commands/externalconnection/externalconnection-schema-add.js +86 -0
  12. package/dist/m365/search/commands.js +2 -1
  13. package/dist/m365/spo/commands/group/group-member-add.js +68 -30
  14. package/dist/m365/spo/commands/group/group-member-remove.js +50 -7
  15. package/dist/m365/spo/commands/list/{list-retentionlabel-set.js → list-retentionlabel-ensure.js} +21 -15
  16. package/dist/m365/spo/commands/listitem/listitem-remove.js +1 -1
  17. package/dist/m365/spo/commands/listitem/listitem-retentionlabel-remove.js +143 -0
  18. package/dist/m365/spo/commands/page/page-add.js +60 -63
  19. package/dist/m365/spo/commands/page/page-set.js +59 -70
  20. package/dist/m365/spo/commands/site/site-appcatalog-list.js +43 -0
  21. package/dist/m365/spo/commands.js +3 -1
  22. package/dist/request.js +2 -1
  23. package/dist/utils/pid.js +31 -15
  24. package/docs/docs/cmd/aad/group/group-get.md +127 -0
  25. package/docs/docs/cmd/aad/user/user-set.md +31 -3
  26. package/docs/docs/cmd/context/context-init.md +25 -0
  27. package/docs/docs/cmd/context/context-remove.md +34 -0
  28. package/docs/docs/cmd/pp/environment/environment-get.md +9 -3
  29. package/docs/docs/cmd/purview/retentionlabel/retentionlabel-set.md +63 -0
  30. package/docs/docs/cmd/search/externalconnection/externalconnection-schema-add.md +31 -0
  31. package/docs/docs/cmd/spo/group/group-member-add.md +58 -6
  32. package/docs/docs/cmd/spo/group/group-member-remove.md +24 -8
  33. package/docs/docs/cmd/spo/list/list-retentionlabel-ensure.md +65 -0
  34. package/docs/docs/cmd/spo/listitem/listitem-remove.md +6 -6
  35. package/docs/docs/cmd/spo/listitem/listitem-retentionlabel-remove.md +55 -0
  36. package/docs/docs/cmd/spo/site/site-appcatalog-list.md +55 -0
  37. package/package.json +2 -2
  38. package/docs/docs/cmd/spo/list/list-retentionlabel-set.md +0 -65
@@ -24,6 +24,9 @@ const validation_1 = require("../../../../utils/validation");
24
24
  const SpoCommand_1 = require("../../../base/SpoCommand");
25
25
  const commands_1 = require("../../commands");
26
26
  const Page_1 = require("./Page");
27
+ const spoFileGetCommand = require("../file/file-get");
28
+ const spoListItemSetCommand = require("../listitem/listitem-set");
29
+ const Cli_1 = require("../../../../cli/Cli");
27
30
  class SpoPageAddCommand extends SpoCommand_1.default {
28
31
  get name() {
29
32
  return commands_1.default.PAGE_ADD;
@@ -52,12 +55,14 @@ class SpoPageAddCommand extends SpoCommand_1.default {
52
55
  const pageTitle = args.options.title ? args.options.title : (args.options.name.indexOf('.aspx') > -1 ? args.options.name.substr(0, args.options.name.indexOf('.aspx')) : args.options.name);
53
56
  let pageId = null;
54
57
  const pageDescription = args.options.description || "";
58
+ if (!pageName.endsWith('.aspx')) {
59
+ pageName += '.aspx';
60
+ }
61
+ const listServerRelativeUrl = `${urlUtil_1.urlUtil.getServerRelativeSiteUrl(args.options.webUrl)}/sitepages`;
62
+ const serverRelativeFileUrl = `${listServerRelativeUrl}/${pageName}`;
55
63
  try {
56
64
  const reqDigest = yield spo_1.spo.getRequestDigest(args.options.webUrl);
57
65
  requestDigest = reqDigest.FormDigestValue;
58
- if (!pageName.endsWith('.aspx')) {
59
- pageName += '.aspx';
60
- }
61
66
  let requestOptions = {
62
67
  url: `${args.options.webUrl}/_api/web/getfolderbyserverrelativeurl('${serverRelativeSiteUrl}/sitepages')/files/AddTemplateFile`,
63
68
  headers: {
@@ -73,32 +78,25 @@ class SpoPageAddCommand extends SpoCommand_1.default {
73
78
  };
74
79
  const template = yield request_1.default.post(requestOptions);
75
80
  itemId = template.UniqueId;
81
+ const listItemId = yield this.getFileListItemId(args.options.webUrl, serverRelativeFileUrl);
76
82
  const layoutType = args.options.layoutType || 'Article';
77
- requestOptions = {
78
- url: `${args.options.webUrl}/_api/web/getfilebyid('${itemId}')/ListItemAllFields`,
79
- headers: {
80
- 'X-RequestDigest': requestDigest,
81
- 'X-HTTP-Method': 'MERGE',
82
- 'IF-MATCH': '*',
83
- 'content-type': 'application/json;odata=nometadata',
84
- accept: 'application/json;odata=nometadata'
85
- },
86
- data: {
87
- ContentTypeId: '0x0101009D1CB255DA76424F860D91F20E6C4118',
88
- Title: pageTitle,
89
- ClientSideApplicationId: 'b6917cb1-93a0-4b97-a84d-7cf49975d4ec',
90
- PageLayoutType: layoutType
91
- },
92
- responseType: 'json'
83
+ const listItemSetOptions = {
84
+ webUrl: args.options.webUrl,
85
+ listUrl: listServerRelativeUrl,
86
+ id: listItemId,
87
+ systemUpdate: true,
88
+ ContentTypeId: '0x0101009D1CB255DA76424F860D91F20E6C4118',
89
+ Title: pageTitle,
90
+ ClientSideApplicationId: 'b6917cb1-93a0-4b97-a84d-7cf49975d4ec',
91
+ PageLayoutType: layoutType,
92
+ verbose: this.verbose,
93
+ debug: this.debug
93
94
  };
94
- if (layoutType === 'Article') {
95
- requestOptions.data.PromotedState = 0;
96
- requestOptions.data.BannerImageUrl = {
97
- Description: '/_layouts/15/images/sitepagethumbnail.png',
98
- Url: `${resource}/_layouts/15/images/sitepagethumbnail.png`
99
- };
95
+ if (args.options.layoutType === 'Article') {
96
+ listItemSetOptions.PromotedState = 0;
97
+ listItemSetOptions.BannerImageUrl = `${resource}/_layouts/15/images/sitepagethumbnail.png, /_layouts/15/images/sitepagethumbnail.png`;
100
98
  }
101
- yield request_1.default.post(requestOptions);
99
+ yield Cli_1.Cli.executeCommand(spoListItemSetCommand, { options: Object.assign(Object.assign({}, listItemSetOptions), { _: [] }) });
102
100
  const pageProps = yield Page_1.Page.checkout(pageName, args.options.webUrl, logger, this.debug, this.verbose);
103
101
  if (pageProps) {
104
102
  pageId = pageProps.Id;
@@ -123,58 +121,43 @@ class SpoPageAddCommand extends SpoCommand_1.default {
123
121
  requestOptions.data = {
124
122
  WelcomePage: `SitePages/${pageName}`
125
123
  };
124
+ yield request_1.default.post(requestOptions);
126
125
  break;
127
126
  case 'NewsPage':
128
- requestOptions.url = `${args.options.webUrl}/_api/web/getfilebyid('${itemId}')/ListItemAllFields`;
129
- requestOptions.headers = {
130
- 'X-RequestDigest': requestDigest,
131
- 'X-HTTP-Method': 'MERGE',
132
- 'IF-MATCH': '*',
133
- 'content-type': 'application/json;odata=nometadata',
134
- accept: 'application/json;odata=nometadata'
135
- };
136
- requestOptions.data = {
127
+ const listItemSetOptions = {
128
+ webUrl: args.options.webUrl,
129
+ listUrl: listServerRelativeUrl,
130
+ id: listItemId,
131
+ systemUpdate: true,
137
132
  PromotedState: 2,
138
- FirstPublishedDate: new Date().toISOString().replace('Z', '')
133
+ FirstPublishedDate: new Date().toISOString(),
134
+ verbose: this.verbose,
135
+ debug: this.debug
139
136
  };
137
+ yield Cli_1.Cli.executeCommand(spoListItemSetCommand, { options: Object.assign(Object.assign({}, listItemSetOptions), { _: [] }) });
140
138
  break;
141
139
  case 'Template':
142
- requestOptions.url = `${args.options.webUrl}/_api/web/getfilebyid('${itemId}')/ListItemAllFields`;
140
+ requestOptions.url = `${args.options.webUrl}/_api/SitePages/Pages(${listItemId})/SavePageAsTemplate`;
143
141
  requestOptions.headers = {
144
- 'X-RequestDigest': requestDigest,
145
- 'content-type': 'application/json;odata=nometadata',
146
- accept: 'application/json;odata=nometadata'
147
- };
148
- break;
149
- }
150
- const res = yield request_1.default.post(requestOptions);
151
- if (args.options.promoteAs === 'Template') {
152
- let requestOptions = {
153
- responseType: 'json',
154
- url: `${args.options.webUrl}/_api/SitePages/Pages(${res.Id})/SavePageAsTemplate`,
155
- headers: {
156
142
  'X-RequestDigest': requestDigest,
157
143
  'content-type': 'application/json;odata=nometadata',
158
144
  'X-HTTP-Method': 'POST',
159
145
  'IF-MATCH': '*',
160
146
  accept: 'application/json;odata=nometadata'
161
- }
162
- };
163
- const tmpl = yield request_1.default.post(requestOptions);
164
- bannerImageUrl = tmpl.BannerImageUrl;
165
- canvasContent1 = tmpl.CanvasContent1;
166
- layoutWebpartsContent = tmpl.LayoutWebpartsContent;
167
- pageId = tmpl.Id;
168
- requestOptions = {
169
- url: `${args.options.webUrl}/_api/web/getfilebyid('${tmpl.UniqueId}')/ListItemAllFields/SetCommentsDisabled(${!args.options.commentsEnabled})`,
170
- headers: {
147
+ };
148
+ const tmpl = yield request_1.default.post(requestOptions);
149
+ bannerImageUrl = tmpl.BannerImageUrl;
150
+ canvasContent1 = tmpl.CanvasContent1;
151
+ layoutWebpartsContent = tmpl.LayoutWebpartsContent;
152
+ pageId = tmpl.Id;
153
+ requestOptions.url = `${args.options.webUrl}/_api/web/getfilebyid('${tmpl.UniqueId}')/ListItemAllFields/SetCommentsDisabled(${!args.options.commentsEnabled})`;
154
+ requestOptions.headers = {
171
155
  'X-RequestDigest': requestDigest,
172
156
  'content-type': 'application/json;odata=nometadata',
173
157
  accept: 'application/json;odata=nometadata'
174
- },
175
- responseType: 'json'
176
- };
177
- yield request_1.default.post(requestOptions);
158
+ };
159
+ yield request_1.default.post(requestOptions);
160
+ break;
178
161
  }
179
162
  }
180
163
  requestOptions = {
@@ -263,6 +246,20 @@ class SpoPageAddCommand extends SpoCommand_1.default {
263
246
  }
264
247
  });
265
248
  }
249
+ getFileListItemId(webUrl, serverRelativeFileUrl) {
250
+ return __awaiter(this, void 0, void 0, function* () {
251
+ const fileGetOptions = {
252
+ webUrl: webUrl,
253
+ url: serverRelativeFileUrl,
254
+ asListItem: true,
255
+ verbose: this.verbose,
256
+ debug: this.debug
257
+ };
258
+ const fileGetOutput = yield Cli_1.Cli.executeCommandWithOutput(spoFileGetCommand, { options: Object.assign(Object.assign({}, fileGetOptions), { _: [] }) });
259
+ const fileGetOutputJson = JSON.parse(fileGetOutput.stdout);
260
+ return fileGetOutputJson.Id;
261
+ });
262
+ }
266
263
  }
267
264
  _SpoPageAddCommand_instances = new WeakSet(), _SpoPageAddCommand_initTelemetry = function _SpoPageAddCommand_initTelemetry() {
268
265
  this.telemetry.push((args) => {
@@ -77,28 +77,21 @@ class SpoPageSetCommand extends SpoCommand_1.default {
77
77
  authorByline = page.AuthorByline;
78
78
  }
79
79
  if (args.options.layoutType) {
80
- const requestOptions = {
81
- url: `${args.options.webUrl}/_api/web/getfilebyserverrelativeurl('${serverRelativeFileUrl}')/ListItemAllFields`,
82
- headers: {
83
- 'X-RequestDigest': requestDigest,
84
- 'content-type': 'application/json;odata=nometadata',
85
- 'X-HTTP-Method': 'MERGE',
86
- 'IF-MATCH': '*',
87
- accept: 'application/json;odata=nometadata'
88
- },
89
- data: {
90
- PageLayoutType: args.options.layoutType
91
- },
92
- responseType: 'json'
80
+ const itemId = yield this.getFileListItemId(args.options.webUrl, serverRelativeFileUrl);
81
+ const listItemSetOptions = {
82
+ webUrl: args.options.webUrl,
83
+ listUrl: listServerRelativeUrl,
84
+ id: itemId,
85
+ systemUpdate: true,
86
+ PageLayoutType: args.options.layoutType,
87
+ verbose: this.verbose,
88
+ debug: this.debug
93
89
  };
94
90
  if (args.options.layoutType === 'Article') {
95
- requestOptions.data.PromotedState = 0;
96
- requestOptions.data.BannerImageUrl = {
97
- Description: '/_layouts/15/images/sitepagethumbnail.png',
98
- Url: `${resource}/_layouts/15/images/sitepagethumbnail.png`
99
- };
91
+ listItemSetOptions.PromotedState = 0;
92
+ listItemSetOptions.BannerImageUrl = `${resource}/_layouts/15/images/sitepagethumbnail.png, /_layouts/15/images/sitepagethumbnail.png`;
100
93
  }
101
- yield request_1.default.post(requestOptions);
94
+ yield Cli_1.Cli.executeCommand(spoListItemSetCommand, { options: Object.assign(Object.assign({}, listItemSetOptions), { _: [] }) });
102
95
  }
103
96
  if (args.options.promoteAs) {
104
97
  const requestOptions = {
@@ -117,60 +110,50 @@ class SpoPageSetCommand extends SpoCommand_1.default {
117
110
  requestOptions.data = {
118
111
  WelcomePage: `SitePages/${pageName}`
119
112
  };
113
+ yield request_1.default.post(requestOptions);
120
114
  break;
121
115
  case 'NewsPage':
122
- requestOptions.url = `${args.options.webUrl}/_api/web/getfilebyserverrelativeurl('${serverRelativeFileUrl}')/ListItemAllFields`;
123
- requestOptions.headers = {
124
- 'X-RequestDigest': requestDigest,
125
- 'X-HTTP-Method': 'MERGE',
126
- 'IF-MATCH': '*',
127
- 'content-type': 'application/json;odata=nometadata',
128
- accept: 'application/json;odata=nometadata'
129
- };
130
- requestOptions.data = {
116
+ const newsPageItemId = yield this.getFileListItemId(args.options.webUrl, serverRelativeFileUrl);
117
+ const listItemSetOptions = {
118
+ webUrl: args.options.webUrl,
119
+ listUrl: listServerRelativeUrl,
120
+ id: newsPageItemId,
121
+ systemUpdate: true,
131
122
  PromotedState: 2,
132
- FirstPublishedDate: new Date().toISOString().replace('Z', '')
123
+ FirstPublishedDate: new Date().toISOString(),
124
+ verbose: this.verbose,
125
+ debug: this.debug
133
126
  };
127
+ yield Cli_1.Cli.executeCommand(spoListItemSetCommand, { options: Object.assign(Object.assign({}, listItemSetOptions), { _: [] }) });
134
128
  break;
135
129
  case 'Template':
136
- requestOptions.url = `${args.options.webUrl}/_api/web/getfilebyserverrelativeurl('${serverRelativeFileUrl}')/ListItemAllFields`;
130
+ const templateItemId = yield this.getFileListItemId(args.options.webUrl, serverRelativeFileUrl);
137
131
  requestOptions.headers = {
138
- 'X-RequestDigest': requestDigest,
139
- 'content-type': 'application/json;odata=nometadata',
140
- accept: 'application/json;odata=nometadata'
141
- };
142
- break;
143
- }
144
- const pageRes = yield request_1.default.post(requestOptions);
145
- if (args.options.promoteAs === 'Template') {
146
- const requestOptions = {
147
- responseType: 'json',
148
- url: `${args.options.webUrl}/_api/SitePages/Pages(${pageRes.Id})/SavePageAsTemplate`,
149
- headers: {
150
132
  'X-RequestDigest': requestDigest,
151
133
  'content-type': 'application/json;odata=nometadata',
152
134
  'X-HTTP-Method': 'POST',
153
135
  'IF-MATCH': '*',
154
136
  accept: 'application/json;odata=nometadata'
137
+ };
138
+ requestOptions.url = `${args.options.webUrl}/_api/SitePages/Pages(${templateItemId})/SavePageAsTemplate`;
139
+ const res = yield request_1.default.post(requestOptions);
140
+ if (fileNameWithoutExtension) {
141
+ pageData.Title = fileNameWithoutExtension;
142
+ }
143
+ if (pageDescription) {
144
+ pageData.Description = pageDescription;
155
145
  }
156
- };
157
- const res = yield request_1.default.post(requestOptions);
158
- if (fileNameWithoutExtension) {
159
- pageData.Title = fileNameWithoutExtension;
160
- }
161
- if (pageDescription) {
162
- pageData.Description = pageDescription;
163
- }
164
- if (res.BannerImageUrl) {
165
- pageData.BannerImageUrl = res.BannerImageUrl;
166
- }
167
- if (res.LayoutWebpartsContent) {
168
- pageData.LayoutWebpartsContent = res.LayoutWebpartsContent;
169
- }
170
- if (res.CanvasContent1) {
171
- pageData.CanvasContent1 = res.CanvasContent1;
172
- }
173
- pageId = res.Id;
146
+ if (res.BannerImageUrl) {
147
+ pageData.BannerImageUrl = res.BannerImageUrl;
148
+ }
149
+ if (res.LayoutWebpartsContent) {
150
+ pageData.LayoutWebpartsContent = res.LayoutWebpartsContent;
151
+ }
152
+ if (res.CanvasContent1) {
153
+ pageData.CanvasContent1 = res.CanvasContent1;
154
+ }
155
+ pageId = res.Id;
156
+ break;
174
157
  }
175
158
  }
176
159
  if (args.options.promoteAs !== 'Template') {
@@ -239,19 +222,11 @@ class SpoPageSetCommand extends SpoCommand_1.default {
239
222
  yield request_1.default.post(requestOptions);
240
223
  }
241
224
  if (args.options.demoteFrom === 'NewsPage') {
242
- const fileGetOptions = {
243
- webUrl: args.options.webUrl,
244
- url: serverRelativeFileUrl,
245
- asListItem: true,
246
- verbose: this.verbose,
247
- debug: this.debug
248
- };
249
- const fileGetOutput = yield Cli_1.Cli.executeCommandWithOutput(spoFileGetCommand, { options: Object.assign(Object.assign({}, fileGetOptions), { _: [] }) });
250
- const fileGetOutputJson = JSON.parse(fileGetOutput.stdout);
225
+ const fileId = yield this.getFileListItemId(args.options.webUrl, serverRelativeFileUrl);
251
226
  const listItemSetOptions = {
252
227
  webUrl: args.options.webUrl,
253
228
  listUrl: listServerRelativeUrl,
254
- id: fileGetOutputJson.Id,
229
+ id: fileId,
255
230
  systemUpdate: true,
256
231
  PromotedState: 0,
257
232
  verbose: this.verbose,
@@ -292,6 +267,20 @@ class SpoPageSetCommand extends SpoCommand_1.default {
292
267
  }
293
268
  });
294
269
  }
270
+ getFileListItemId(webUrl, serverRelativeFileUrl) {
271
+ return __awaiter(this, void 0, void 0, function* () {
272
+ const fileGetOptions = {
273
+ webUrl: webUrl,
274
+ url: serverRelativeFileUrl,
275
+ asListItem: true,
276
+ verbose: this.verbose,
277
+ debug: this.debug
278
+ };
279
+ const fileGetOutput = yield Cli_1.Cli.executeCommandWithOutput(spoFileGetCommand, { options: Object.assign(Object.assign({}, fileGetOptions), { _: [] }) });
280
+ const fileGetOutputJson = JSON.parse(fileGetOutput.stdout);
281
+ return fileGetOutputJson.Id;
282
+ });
283
+ }
295
284
  }
296
285
  _SpoPageSetCommand_instances = new WeakSet(), _SpoPageSetCommand_initTelemetry = function _SpoPageSetCommand_initTelemetry() {
297
286
  this.telemetry.push((args) => {
@@ -0,0 +1,43 @@
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
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ const odata_1 = require("../../../../utils/odata");
13
+ const spo_1 = require("../../../../utils/spo");
14
+ const SpoCommand_1 = require("../../../base/SpoCommand");
15
+ const commands_1 = require("../../commands");
16
+ class SpoSiteAppCatalogListCommand extends SpoCommand_1.default {
17
+ get name() {
18
+ return commands_1.default.SITE_APPCATALOG_LIST;
19
+ }
20
+ get description() {
21
+ return 'List all site collection app catalogs within the tenant';
22
+ }
23
+ defaultProperties() {
24
+ return ['AbsoluteUrl', 'SiteID'];
25
+ }
26
+ commandAction(logger) {
27
+ return __awaiter(this, void 0, void 0, function* () {
28
+ try {
29
+ if (this.verbose) {
30
+ logger.logToStderr('Retrieving site collection app catalogs...');
31
+ }
32
+ const spoUrl = yield spo_1.spo.getSpoUrl(logger, this.debug);
33
+ const appCatalogs = yield odata_1.odata.getAllItems(`${spoUrl}/_api/Web/TenantAppCatalog/SiteCollectionAppCatalogsSites`);
34
+ logger.log(appCatalogs);
35
+ }
36
+ catch (err) {
37
+ this.handleRejectedODataJsonPromise(err);
38
+ }
39
+ });
40
+ }
41
+ }
42
+ module.exports = new SpoSiteAppCatalogListCommand();
43
+ //# sourceMappingURL=site-appcatalog-list.js.map
@@ -115,8 +115,8 @@ exports.default = {
115
115
  LIST_LABEL_SET: `${prefix} list label set`,
116
116
  LIST_LIST: `${prefix} list list`,
117
117
  LIST_REMOVE: `${prefix} list remove`,
118
+ LIST_RETENTIONLABEL_ENSURE: `${prefix} list retentionlabel ensure`,
118
119
  LIST_RETENTIONLABEL_GET: `${prefix} list retentionlabel get`,
119
- LIST_RETENTIONLABEL_SET: `${prefix} list retentionlabel set`,
120
120
  LIST_ROLEASSIGNMENT_REMOVE: `${prefix} list roleassignment remove`,
121
121
  LIST_ROLEASSIGNMENT_ADD: `${prefix} list roleassignment add`,
122
122
  LIST_ROLEINHERITANCE_BREAK: `${prefix} list roleinheritance break`,
@@ -145,6 +145,7 @@ exports.default = {
145
145
  LISTITEM_RECORD_DECLARE: `${prefix} listitem record declare`,
146
146
  LISTITEM_RECORD_UNDECLARE: `${prefix} listitem record undeclare`,
147
147
  LISTITEM_REMOVE: `${prefix} listitem remove`,
148
+ LISTITEM_RETENTIONLABEL_REMOVE: `${prefix} listitem retentionlabel remove`,
148
149
  LISTITEM_ROLEASSIGNMENT_ADD: `${prefix} listitem roleassignment add`,
149
150
  LISTITEM_ROLEASSIGNMENT_REMOVE: `${prefix} listitem roleassignment remove`,
150
151
  LISTITEM_ROLEINHERITANCE_BREAK: `${prefix} listitem roleinheritance break`,
@@ -206,6 +207,7 @@ exports.default = {
206
207
  SET: `${prefix} set`,
207
208
  SITE_ADD: `${prefix} site add`,
208
209
  SITE_APPCATALOG_ADD: `${prefix} site appcatalog add`,
210
+ SITE_APPCATALOG_LIST: `${prefix} site appcatalog list`,
209
211
  SITE_APPCATALOG_REMOVE: `${prefix} site appcatalog remove`,
210
212
  SITE_APPPERMISSION_ADD: `${prefix} site apppermission add`,
211
213
  SITE_APPPERMISSION_GET: `${prefix} site apppermission get`,
package/dist/request.js CHANGED
@@ -61,7 +61,8 @@ class Request {
61
61
  this.req = axios_1.default.create({
62
62
  headers: {
63
63
  'user-agent': `NONISV|SharePointPnP|CLIMicrosoft365/${packageJSON.version}`,
64
- 'accept-encoding': 'gzip, deflate'
64
+ 'accept-encoding': 'gzip, deflate',
65
+ 'X-ClientService-ClientTag': `M365CLI:${packageJSON.version}`
65
66
  },
66
67
  decompress: true,
67
68
  responseType: 'text',
package/dist/utils/pid.js CHANGED
@@ -1,13 +1,18 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.pid = void 0;
4
- const os = require("os");
5
- const fs = require("fs");
6
4
  const child_process_1 = require("child_process");
5
+ const fs = require("fs");
6
+ const os = require("os");
7
7
  const cache_1 = require("./cache");
8
8
  function getProcessNameOnMacOs(pid) {
9
- const stdout = (0, child_process_1.execSync)(`ps -o comm= ${pid}`, { encoding: 'utf8' });
10
- return stdout.trim();
9
+ const res = (0, child_process_1.spawnSync)('ps', ['-o', 'comm=', pid.toString()], { encoding: 'utf8' });
10
+ if (res.error || res.stderr) {
11
+ return undefined;
12
+ }
13
+ else {
14
+ return res.stdout.trim();
15
+ }
11
16
  }
12
17
  function getProcessNameOnLinux(pid) {
13
18
  if (!fs.existsSync(`/proc/${pid}/stat`)) {
@@ -19,8 +24,24 @@ function getProcessNameOnLinux(pid) {
19
24
  return procName;
20
25
  }
21
26
  function getProcessNameOnWindows(pid) {
22
- const stdout = (0, child_process_1.execSync)(`wmic PROCESS where ProcessId=${pid} get Caption | find /V "Caption"`, { encoding: 'utf8' });
23
- return stdout.trim();
27
+ const findProcess = (0, child_process_1.spawnSync)('wmic', ['PROCESS', 'where', `ProcessId=${pid}`, 'get', 'Caption'], { encoding: 'utf8' });
28
+ if (findProcess.error || findProcess.stderr) {
29
+ return undefined;
30
+ }
31
+ else {
32
+ const getPid = (0, child_process_1.spawnSync)('find', ['/V', '"Caption"'], {
33
+ encoding: 'utf8',
34
+ input: findProcess.stdout,
35
+ // must include or passing quoted "Caption" will fail
36
+ windowsVerbatimArguments: true
37
+ });
38
+ if (getPid.error || getPid.stderr) {
39
+ return undefined;
40
+ }
41
+ else {
42
+ return getPid.stdout.trim();
43
+ }
44
+ }
24
45
  }
25
46
  exports.pid = {
26
47
  getProcessName(pid) {
@@ -40,16 +61,11 @@ exports.pid = {
40
61
  getPidName = getProcessNameOnLinux;
41
62
  }
42
63
  if (getPidName) {
43
- try {
44
- processName = getPidName(pid);
45
- if (processName) {
46
- cache_1.cache.setValue(pid.toString(), processName);
47
- }
48
- return processName;
49
- }
50
- catch (_a) {
51
- return undefined;
64
+ processName = getPidName(pid);
65
+ if (processName) {
66
+ cache_1.cache.setValue(pid.toString(), processName);
52
67
  }
68
+ return processName;
53
69
  }
54
70
  return undefined;
55
71
  }
@@ -0,0 +1,127 @@
1
+ # aad group get
2
+
3
+ Gets information about the specified Azure AD Group
4
+
5
+ ## Usage
6
+
7
+ ```sh
8
+ m365 aad group get [options]
9
+ ```
10
+
11
+ ## Options
12
+
13
+ `-i, --id [id]`
14
+ : The object Id of the Azure AD group. Specify either `id` or `title` but not both
15
+
16
+ `-t, --title [title]`
17
+ : The display name of the Azure AD group. Specify either `id` or `title` but not both
18
+
19
+ --8<-- "docs/cmd/_global.md"
20
+
21
+ ## Examples
22
+
23
+ Get information about an Azure AD Group by id
24
+
25
+ ```sh
26
+ m365 aad group get --id 1caf7dcd-7e83-4c3a-94f7-932a1299c844
27
+ ```
28
+
29
+ Get information about an Azure AD Group by title
30
+
31
+ ```sh
32
+ m365 aad group get --title "Finance"
33
+ ```
34
+
35
+ ## Response
36
+
37
+ === "JSON"
38
+
39
+ ```json
40
+ {
41
+ "id": "c541afac-508e-40c7-8880-5a601b41737b",
42
+ "deletedDateTime": null,
43
+ "classification": null,
44
+ "createdDateTime": "2022-11-13T19:16:32Z",
45
+ "creationOptions": [
46
+ "YammerProvisioning"
47
+ ],
48
+ "description": "This is the default group for everyone in the network",
49
+ "displayName": "All Company",
50
+ "expirationDateTime": null,
51
+ "groupTypes": [
52
+ "Unified"
53
+ ],
54
+ "isAssignableToRole": null,
55
+ "mail": "allcompany@contoso.onmicrosoft.com",
56
+ "mailEnabled": true,
57
+ "mailNickname": "allcompany",
58
+ "membershipRule": null,
59
+ "membershipRuleProcessingState": null,
60
+ "onPremisesDomainName": null,
61
+ "onPremisesLastSyncDateTime": null,
62
+ "onPremisesNetBiosName": null,
63
+ "onPremisesSamAccountName": null,
64
+ "onPremisesSecurityIdentifier": null,
65
+ "onPremisesSyncEnabled": null,
66
+ "preferredDataLocation": null,
67
+ "preferredLanguage": null,
68
+ "proxyAddresses": [
69
+ "SPO:SPO_c3e7794d-0726-49ac-805b-2d6b0edaefdc@SPO_44744d00-3da0-45e5-9e28-da5ab48c61ac",
70
+ "SMTP:allcompany@contoso.onmicrosoft.com"
71
+ ],
72
+ "renewedDateTime": "2022-11-13T19:16:32Z",
73
+ "resourceBehaviorOptions": [
74
+ "CalendarMemberReadOnly"
75
+ ],
76
+ "resourceProvisioningOptions": [],
77
+ "securityEnabled": false,
78
+ "securityIdentifier": "S-1-12-1-4076547856-1079300050-1399127439-2879739702",
79
+ "theme": null,
80
+ "visibility": "Public",
81
+ "onPremisesProvisioningErrors": []
82
+ }
83
+ ```
84
+
85
+ === "Text"
86
+
87
+ ```text
88
+ classification : null
89
+ createdDateTime : 2022-11-13T19:16:32Z
90
+ creationOptions : ["YammerProvisioning"]
91
+ deletedDateTime : null
92
+ description : This is the default group for everyone in the network
93
+ displayName : All Company
94
+ expirationDateTime : null
95
+ groupTypes : ["Unified"]
96
+ id : c541afac-508e-40c7-8880-5a601b41737b
97
+ isAssignableToRole : null
98
+ mail : allcompany@contoso.onmicrosoft.com
99
+ mailEnabled : true
100
+ mailNickname : allcompany
101
+ membershipRule : null
102
+ membershipRuleProcessingState: null
103
+ onPremisesDomainName : null
104
+ onPremisesLastSyncDateTime : null
105
+ onPremisesNetBiosName : null
106
+ onPremisesProvisioningErrors : []
107
+ onPremisesSamAccountName : null
108
+ onPremisesSecurityIdentifier : null
109
+ onPremisesSyncEnabled : null
110
+ preferredDataLocation : null
111
+ preferredLanguage : null
112
+ proxyAddresses : ["SPO:SPO_c3e7794d-0726-49ac-805b-2d6b0edaefdc@SPO_44744d00-3da0-45e5-9e28-da5ab48c61ac","SMTP:allcompany@contoso.onmicrosoft.com"]
113
+ renewedDateTime : 2022-11-13T19:16:32Z
114
+ resourceBehaviorOptions : ["CalendarMemberReadOnly"]
115
+ resourceProvisioningOptions : []
116
+ securityEnabled : false
117
+ securityIdentifier : S-1-12-1-4076547856-1079300050-1399127439-2879739702
118
+ theme : null
119
+ visibility : Public
120
+ ```
121
+
122
+ === "CSV"
123
+
124
+ ```csv
125
+ id,deletedDateTime,classification,createdDateTime,creationOptions,description,displayName,expirationDateTime,groupTypes,isAssignableToRole,mail,mailEnabled,mailNickname,membershipRule,membershipRuleProcessingState,onPremisesDomainName,onPremisesLastSyncDateTime,onPremisesNetBiosName,onPremisesSamAccountName,onPremisesSecurityIdentifier,onPremisesSyncEnabled,preferredDataLocation,preferredLanguage,proxyAddresses,renewedDateTime,resourceBehaviorOptions,resourceProvisioningOptions,securityEnabled,securityIdentifier,theme,visibility,onPremisesProvisioningErrors
126
+ c541afac-508e-40c7-8880-5a601b41737b,,,2022-11-13T19:16:32Z,"[""YammerProvisioning""]",This is the default group for everyone in the network,All Company,,"[""Unified""]",,allcompany@contoso.onmicrosoft.com,1,allcompany,,,,,,,,,,,"[""SPO:SPO_c3e7794d-0726-49ac-805b-2d6b0edaefdc@SPO_44744d00-3da0-45e5-9e28-da5ab48c61ac"",""SMTP:allcompany@contoso.onmicrosoft.com""]",2022-11-13T19:16:32Z,"[""CalendarMemberReadOnly""]",[],,S-1-12-1-4076547856-1079300050-1399127439-2879739702,,Public,[]
127
+ ```