@pnp/cli-microsoft365 11.1.0-beta.317d8bb → 11.1.0-beta.734344f

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 (100) hide show
  1. package/allCommands.json +1 -1
  2. package/allCommandsFull.json +1 -1
  3. package/dist/Auth.js +10 -7
  4. package/dist/Command.js +2 -2
  5. package/dist/auth/msalCachePlugin.js +6 -2
  6. package/dist/autocomplete.js +6 -2
  7. package/dist/chili/chili.js +2 -1
  8. package/dist/cli/cli.js +4 -2
  9. package/dist/config.js +0 -1
  10. package/dist/m365/adaptivecard/commands/adaptivecard-send.js +2 -2
  11. package/dist/m365/app/commands/permission/permission-list.js +4 -2
  12. package/dist/m365/booking/commands/business/business-list.js +5 -0
  13. package/dist/m365/commands/setup.js +6 -3
  14. package/dist/m365/commands/status.js +5 -1
  15. package/dist/m365/connection/commands/connection-list.js +5 -1
  16. package/dist/m365/entra/commands/app/app-role-add.js +1 -1
  17. package/dist/m365/entra/commands/group/group-add.js +1 -1
  18. package/dist/m365/entra/commands/group/group-set.js +1 -1
  19. package/dist/m365/entra/commands/m365group/m365group-add.js +0 -1
  20. package/dist/m365/file/commands/convert/convert-pdf.js +1 -6
  21. package/dist/m365/flow/commands/environment/environment-list.js +5 -0
  22. package/dist/m365/flow/commands/flow-export.js +8 -5
  23. package/dist/m365/flow/commands/run/run-get.js +3 -3
  24. package/dist/m365/graph/commands/schemaextension/schemaextension-set.js +1 -1
  25. package/dist/m365/onedrive/commands/onedrive-list.js +5 -0
  26. package/dist/m365/outlook/commands/roomlist/roomlist-list.js +5 -0
  27. package/dist/m365/pa/commands/app/app-export.js +1 -1
  28. package/dist/m365/pa/commands/app/app-get.js +1 -1
  29. package/dist/m365/pa/commands/environment/environment-list.js +5 -0
  30. package/dist/m365/planner/commands/tenant/tenant-settings-list.js +5 -0
  31. package/dist/m365/pp/commands/environment/environment-list.js +10 -23
  32. package/dist/m365/pp/commands/solution/solution-publisher-get.js +1 -1
  33. package/dist/m365/purview/commands/retentionevent/retentionevent-list.js +5 -0
  34. package/dist/m365/purview/commands/retentioneventtype/retentioneventtype-list.js +5 -0
  35. package/dist/m365/purview/commands/retentionlabel/retentionlabel-list.js +5 -0
  36. package/dist/m365/spfx/commands/package/package-generate.js +3 -1
  37. package/dist/m365/spfx/commands/project/base-project-command.js +13 -5
  38. package/dist/m365/spfx/commands/project/project-doctor/rules/FN021007_PKG_only_one_rush_stack_compiler_installed.js +1 -1
  39. package/dist/m365/spfx/commands/project/project-externalize/rules/PnPJsRule.js +6 -4
  40. package/dist/m365/spfx/commands/project/project-model/ScssFile.js +3 -1
  41. package/dist/m365/spfx/commands/project/project-model/TsFile.js +6 -2
  42. package/dist/m365/spfx/commands/project/project-upgrade/upgrade-1.15.2.js +1 -1
  43. package/dist/m365/spfx/commands/spfx-doctor.js +5 -5
  44. package/dist/m365/spo/commands/file/file-add.js +4 -2
  45. package/dist/m365/spo/commands/file/file-rename.js +3 -4
  46. package/dist/m365/spo/commands/hubsite/hubsite-list.js +1 -1
  47. package/dist/m365/spo/commands/listitem/listitem-attachment-add.js +1 -1
  48. package/dist/m365/spo/commands/listitem/listitem-batch-set.js +9 -5
  49. package/dist/m365/spo/commands/page/clientsidepages.js +12 -12
  50. package/dist/m365/spo/commands/page/page-add.js +4 -2
  51. package/dist/m365/spo/commands/page/page-clientsidewebpart-add.js +1 -0
  52. package/dist/m365/spo/commands/page/page-set.js +4 -2
  53. package/dist/m365/spo/commands/page/page-text-add.js +1 -0
  54. package/dist/m365/spo/commands/propertybag/propertybag-base.js +34 -54
  55. package/dist/m365/spo/commands/theme/theme-apply.js +1 -1
  56. package/dist/m365/spo/commands/web/web-reindex.js +17 -27
  57. package/dist/m365/teams/commands/tab/tab-add.js +9 -3
  58. package/dist/m365/viva/commands/connections/connections-app-create.js +1 -1
  59. package/dist/m365/viva/commands/engage/engage-community-user-add.js +1 -1
  60. package/dist/m365/viva/commands/engage/engage-community-user-remove.js +1 -1
  61. package/dist/telemetry.js +3 -1
  62. package/dist/utils/accessToken.js +4 -0
  63. package/dist/utils/cache.js +3 -2
  64. package/dist/utils/customAppScope.js +1 -1
  65. package/dist/utils/directoryExtension.js +1 -1
  66. package/dist/utils/entraAdministrativeUnit.js +1 -1
  67. package/dist/utils/entraApp.js +2 -2
  68. package/dist/utils/entraDevice.js +1 -1
  69. package/dist/utils/entraServicePrincipal.js +2 -2
  70. package/dist/utils/formatting.js +1 -1
  71. package/dist/utils/md.js +2 -2
  72. package/dist/utils/odata.js +2 -0
  73. package/dist/utils/planner.js +1 -1
  74. package/dist/utils/powerPlatform.js +2 -2
  75. package/dist/utils/roleDefinition.js +2 -2
  76. package/dist/utils/spo.js +10 -11
  77. package/dist/utils/urlUtil.js +1 -1
  78. package/dist/utils/validation.js +1 -1
  79. package/dist/utils/vivaEngage.js +3 -3
  80. package/docs/docs/cmd/entra/enterpriseapp/enterpriseapp-add.mdx +14 -0
  81. package/docs/docs/cmd/entra/enterpriseapp/enterpriseapp-get.mdx +15 -0
  82. package/docs/docs/cmd/entra/enterpriseapp/enterpriseapp-list.mdx +14 -0
  83. package/docs/docs/cmd/entra/enterpriseapp/enterpriseapp-remove.mdx +14 -0
  84. package/docs/docs/cmd/entra/groupsetting/groupsetting-add.mdx +19 -0
  85. package/docs/docs/cmd/entra/groupsetting/groupsetting-get.mdx +19 -0
  86. package/docs/docs/cmd/entra/groupsetting/groupsetting-list.mdx +19 -0
  87. package/docs/docs/cmd/entra/groupsetting/groupsetting-remove.mdx +21 -0
  88. package/docs/docs/cmd/entra/groupsetting/groupsetting-set.mdx +21 -0
  89. package/docs/docs/cmd/entra/m365group/m365group-add.mdx +19 -0
  90. package/docs/docs/cmd/entra/m365group/m365group-get.mdx +19 -0
  91. package/docs/docs/cmd/entra/m365group/m365group-list.mdx +19 -0
  92. package/docs/docs/cmd/entra/m365group/m365group-remove.mdx +21 -0
  93. package/docs/docs/cmd/entra/m365group/m365group-renew.mdx +21 -0
  94. package/docs/docs/cmd/entra/m365group/m365group-set.mdx +21 -0
  95. package/docs/docs/cmd/entra/m365group/m365group-teamify.mdx +19 -0
  96. package/eslint-rules/lib/rules/correct-command-class-name.js +18 -2
  97. package/eslint.config.mjs +270 -0
  98. package/npm-shrinkwrap.json +1117 -2277
  99. package/package.json +22 -21
  100. package/.eslintrc.cjs +0 -289
@@ -70,9 +70,15 @@ class TeamsTabAddCommand extends GraphCommand {
70
70
  if (options.contentUrl) {
71
71
  requestBody.configuration.contentUrl = options.contentUrl;
72
72
  }
73
- options.entityId ? requestBody.configuration.entityId = options.entityId : null;
74
- options.removeUrl ? requestBody.configuration.removeUrl = options.removeUrl : null;
75
- options.websiteUrl ? requestBody.configuration.websiteUrl = options.websiteUrl : null;
73
+ if (options.entityId) {
74
+ requestBody.configuration.entityId = options.entityId;
75
+ }
76
+ if (options.removeUrl) {
77
+ requestBody.configuration.removeUrl = options.removeUrl;
78
+ }
79
+ if (options.websiteUrl) {
80
+ requestBody.configuration.websiteUrl = options.websiteUrl;
81
+ }
76
82
  Object.keys(options).forEach(key => {
77
83
  if (excludeOptions.indexOf(key) === -1) {
78
84
  requestBody.configuration[key] = `${options[key]}`;
@@ -44,7 +44,7 @@ class VivaConnectionsAppCreateCommand extends AnonymousCommand {
44
44
  const appPortalUrl = `${args.options.portalUrl}${args.options.portalUrl.indexOf('?') > -1 ? '&' : '?'}app=portals`;
45
45
  let searchUrlPath = portalUrl.hostname;
46
46
  if (portalUrl.pathname.indexOf('/teams') > -1 || portalUrl.pathname.indexOf('/sites') > -1) {
47
- const firstTwoUrlSegments = portalUrl.pathname.match(/^\/[^\/]+\/[^\/]+/);
47
+ const firstTwoUrlSegments = portalUrl.pathname.match(/^\/[^/]+\/[^/]+/);
48
48
  if (firstTwoUrlSegments) {
49
49
  searchUrlPath += firstTwoUrlSegments[0];
50
50
  }
@@ -48,7 +48,7 @@ class VivaEngageCommunityUserAddCommand extends GraphCommand {
48
48
  .refine(options => options.ids || options.userNames, {
49
49
  message: 'Specify either of ids or userNames.'
50
50
  })
51
- .refine(options => typeof options.userNames !== undefined && typeof options.ids !== undefined, {
51
+ .refine(options => options.userNames !== undefined || options.ids !== undefined, {
52
52
  message: 'Specify either ids or userNames, but not both.'
53
53
  });
54
54
  }
@@ -48,7 +48,7 @@ class VivaEngageCommunityUserRemoveCommand extends GraphCommand {
48
48
  .refine(options => options.id || options.userName, {
49
49
  message: 'Specify either of id or userName.'
50
50
  })
51
- .refine(options => typeof options.userName !== undefined && typeof options.id !== undefined, {
51
+ .refine(options => options.userName !== undefined || options.id !== undefined, {
52
52
  message: 'Specify either id or userName, but not both.'
53
53
  });
54
54
  }
package/dist/telemetry.js CHANGED
@@ -21,7 +21,9 @@ async function trackTelemetry(object) {
21
21
  }
22
22
  await appInsights.flush();
23
23
  }
24
- catch { }
24
+ catch {
25
+ // Do nothing
26
+ }
25
27
  }
26
28
  export const telemetry = {
27
29
  trackEvent: async (commandName, properties, exception) => {
@@ -16,6 +16,7 @@ export const accessToken = {
16
16
  isAppOnlyAccessToken = token.idtyp === 'app';
17
17
  }
18
18
  catch {
19
+ // Do nothing
19
20
  }
20
21
  return isAppOnlyAccessToken;
21
22
  },
@@ -34,6 +35,7 @@ export const accessToken = {
34
35
  tenantId = token.tid;
35
36
  }
36
37
  catch {
38
+ // Do nothing
37
39
  }
38
40
  return tenantId;
39
41
  },
@@ -54,6 +56,7 @@ export const accessToken = {
54
56
  userName = token.upn || token.app_displayname;
55
57
  }
56
58
  catch {
59
+ // Do nothing
57
60
  }
58
61
  return userName;
59
62
  },
@@ -72,6 +75,7 @@ export const accessToken = {
72
75
  userId = token.oid;
73
76
  }
74
77
  catch {
78
+ // Do nothing
75
79
  }
76
80
  return userId;
77
81
  },
@@ -28,7 +28,9 @@ export const cache = {
28
28
  // eslint-disable-next-line @typescript-eslint/no-empty-function
29
29
  fs.writeFile(cacheFilePath, value, () => { });
30
30
  }
31
- catch { }
31
+ catch {
32
+ // Do nothing
33
+ }
32
34
  },
33
35
  clearExpired(cb) {
34
36
  // we don't need to wait for this to complete
@@ -58,7 +60,6 @@ export const cache = {
58
60
  // remove files that haven't been accessed in the last 24 hours
59
61
  if (stats.atime.getTime() < Date.now() - 24 * 60 * 60 * 1000) {
60
62
  // we don't need to wait for the file to be deleted
61
- // eslint-disable-next-line @typescript-eslint/no-empty-function
62
63
  fs.unlink(path.join(cacheFolderPath, file), () => {
63
64
  if (cb && index === numFiles - 1) {
64
65
  cb();
@@ -16,7 +16,7 @@ export const customAppScope = {
16
16
  }
17
17
  const customAppScopes = await odata.getAllItems(url);
18
18
  if (customAppScopes.length === 0) {
19
- throw `The specified custom application scope '${displayName}' does not exist.`;
19
+ throw new Error(`The specified custom application scope '${displayName}' does not exist.`);
20
20
  }
21
21
  if (customAppScopes.length > 1) {
22
22
  const resultAsKeyValuePair = formatting.convertArrayToHashTable('id', customAppScopes);
@@ -16,7 +16,7 @@ export const directoryExtension = {
16
16
  }
17
17
  const extensionProperties = await odata.getAllItems(url);
18
18
  if (extensionProperties.length === 0) {
19
- throw `The specified directory extension '${name}' does not exist.`;
19
+ throw new Error(`The specified directory extension '${name}' does not exist.`);
20
20
  }
21
21
  // there can be only one directory extension with a given name
22
22
  return extensionProperties[0];
@@ -24,7 +24,7 @@ export const entraAdministrativeUnit = {
24
24
  const graphResource = 'https://graph.microsoft.com';
25
25
  const administrativeUnits = await odata.getAllItems(`${graphResource}/v1.0/directory/administrativeUnits?$filter=displayName eq '${formatting.encodeQueryParameter(displayName)}'${queryString}`);
26
26
  if (administrativeUnits.length === 0) {
27
- throw `The specified administrative unit '${displayName}' does not exist.`;
27
+ throw new Error(`The specified administrative unit '${displayName}' does not exist.`);
28
28
  }
29
29
  if (administrativeUnits.length > 1) {
30
30
  const resultAsKeyValuePair = formatting.convertArrayToHashTable('id', administrativeUnits);
@@ -305,7 +305,7 @@ export const entraApp = {
305
305
  }
306
306
  const apps = await odata.getAllItems(url);
307
307
  if (apps.length === 0) {
308
- throw `App with appId '${appId}' not found in Microsoft Entra ID`;
308
+ throw new Error(`App with appId '${appId}' not found in Microsoft Entra ID.`);
309
309
  }
310
310
  return apps[0];
311
311
  },
@@ -316,7 +316,7 @@ export const entraApp = {
316
316
  }
317
317
  const apps = await odata.getAllItems(url);
318
318
  if (apps.length === 0) {
319
- throw `App with name '${appName}' not found in Microsoft Entra ID`;
319
+ throw new Error(`App with name '${appName}' not found in Microsoft Entra ID.`);
320
320
  }
321
321
  if (apps.length > 1) {
322
322
  const resultAsKeyValuePair = formatting.convertArrayToHashTable('id', apps);
@@ -12,7 +12,7 @@ export const entraDevice = {
12
12
  async getDeviceByDisplayName(displayName) {
13
13
  const devices = await odata.getAllItems(`${graphResource}/v1.0/devices?$filter=displayName eq '${formatting.encodeQueryParameter(displayName)}'`);
14
14
  if (devices.length === 0) {
15
- throw `The specified device '${displayName}' does not exist.`;
15
+ throw new Error(`The specified device '${displayName}' does not exist.`);
16
16
  }
17
17
  if (devices.length > 1) {
18
18
  const resultAsKeyValuePair = formatting.convertArrayToHashTable('id', devices);
@@ -17,7 +17,7 @@ export const entraServicePrincipal = {
17
17
  }
18
18
  const apps = await odata.getAllItems(url);
19
19
  if (apps.length === 0) {
20
- throw `Service principal with appId '${appId}' not found in Microsoft Entra ID`;
20
+ throw new Error(`Service principal with appId '${appId}' not found in Microsoft Entra ID.`);
21
21
  }
22
22
  return apps[0];
23
23
  },
@@ -35,7 +35,7 @@ export const entraServicePrincipal = {
35
35
  }
36
36
  const apps = await odata.getAllItems(url);
37
37
  if (apps.length === 0) {
38
- throw `Service principal with name '${appName}' not found in Microsoft Entra ID`;
38
+ throw new Error(`Service principal with name '${appName}' not found in Microsoft Entra ID.`);
39
39
  }
40
40
  if (apps.length > 1) {
41
41
  const resultAsKeyValuePair = formatting.convertArrayToHashTable('id', apps);
@@ -99,7 +99,7 @@ export const formatting = {
99
99
  },
100
100
  openTypesEncoder(value) {
101
101
  return value
102
- .replace(/\%/g, '%25')
102
+ .replace(/%/g, '%25')
103
103
  .replace(/\./g, '%2E')
104
104
  .replace(/:/g, '%3A')
105
105
  .replace(/@/g, '%40')
package/dist/utils/md.js CHANGED
@@ -32,7 +32,7 @@ function convertDd(md) {
32
32
  });
33
33
  }
34
34
  function convertHyperlinks(md) {
35
- return md.replace(/(?!\[1m)(?!\[22m)\[([^\]]+)\]\(([^\)]+)\)/gm, (match, label, url) => {
35
+ return md.replace(/(?!\[1m)(?!\[22m)\[([^\]]+)\]\(([^)]+)\)/gm, (match, label, url) => {
36
36
  // if the link is the same as the content, return just the link
37
37
  if (label === url) {
38
38
  return url;
@@ -54,7 +54,7 @@ function convertContentTabs(md) {
54
54
  .trim();
55
55
  }
56
56
  function convertCodeFences(md) {
57
- const regex = new RegExp('^```.*?(?:\r?\n)(.*?)```(?:\r?\n)', 'gms');
57
+ const regex = /^```.*?(?:\r?\n)(.*?)```(?:\r?\n)/gms;
58
58
  return md.replace(regex, (match, code) => {
59
59
  return `${code.replace(/^(.+)$/gm, ' $1')}${EOL}`;
60
60
  });
@@ -1,4 +1,6 @@
1
1
  import request from "../request.js";
2
+ /* eslint-enable no-redeclare */
3
+ // eslint-disable-next-line no-redeclare
2
4
  async function getAllItems(param1, metadata) {
3
5
  let items = [];
4
6
  const requestOptions = typeof param1 !== 'string' ? param1 : {
@@ -22,7 +22,7 @@ export const planner = {
22
22
  try {
23
23
  return await request.get(requestOptions);
24
24
  }
25
- catch (ex) {
25
+ catch {
26
26
  throw Error(`Planner plan with id '${id}' was not found.`);
27
27
  }
28
28
  },
@@ -39,7 +39,7 @@ export const powerPlatform = {
39
39
  const response = await request.get(requestOptions);
40
40
  return response;
41
41
  }
42
- catch (ex) {
42
+ catch {
43
43
  throw Error(`The specified Power Page website with id '${id}' does not exist.`);
44
44
  }
45
45
  },
@@ -97,7 +97,7 @@ export const powerPlatform = {
97
97
  */
98
98
  async getSolutionByName(dynamicsApiUrl, name) {
99
99
  const requestOptions = {
100
- url: `${dynamicsApiUrl}/api/data/v9.0/solutions?$filter=isvisible eq true and uniquename eq \'${name}\'&$expand=publisherid($select=friendlyname)&$select=solutionid,uniquename,version,publisherid,installedon,solutionpackageversion,friendlyname,versionnumber&api-version=9.1`,
100
+ url: `${dynamicsApiUrl}/api/data/v9.0/solutions?$filter=isvisible eq true and uniquename eq '${name}'&$expand=publisherid($select=friendlyname)&$select=solutionid,uniquename,version,publisherid,installedon,solutionpackageversion,friendlyname,versionnumber&api-version=9.1`,
101
101
  headers: {
102
102
  accept: 'application/json;odata.metadata=none'
103
103
  },
@@ -17,7 +17,7 @@ export const roleDefinition = {
17
17
  }
18
18
  const roleDefinitions = await odata.getAllItems(url);
19
19
  if (roleDefinitions.length === 0) {
20
- throw `The specified role definition '${displayName}' does not exist.`;
20
+ throw new Error(`The specified role definition '${displayName}' does not exist.`);
21
21
  }
22
22
  if (roleDefinitions.length > 1) {
23
23
  const resultAsKeyValuePair = formatting.convertArrayToHashTable('id', roleDefinitions);
@@ -61,7 +61,7 @@ export const roleDefinition = {
61
61
  }
62
62
  const roleDefinitions = await odata.getAllItems(url);
63
63
  if (roleDefinitions.length === 0) {
64
- throw `The specified role definition '${displayName}' does not exist.`;
64
+ throw new Error(`The specified role definition '${displayName}' does not exist.`);
65
65
  }
66
66
  if (roleDefinitions.length > 1) {
67
67
  const resultAsKeyValuePair = formatting.convertArrayToHashTable('id', roleDefinitions);
package/dist/utils/spo.js CHANGED
@@ -114,7 +114,7 @@ export const spo = {
114
114
  try {
115
115
  await auth.storeConnectionInfo();
116
116
  }
117
- catch (e) {
117
+ catch {
118
118
  if (debug) {
119
119
  await logger.logToStderr('Error while storing connection info');
120
120
  }
@@ -123,7 +123,7 @@ export const spo = {
123
123
  },
124
124
  async getSpoAdminUrl(logger, debug) {
125
125
  const spoUrl = await spo.getSpoUrl(logger, debug);
126
- return (spoUrl.replace(/(https:\/\/)([^\.]+)(.*)/, '$1$2-admin$3'));
126
+ return (spoUrl.replace(/(https:\/\/)([^.]+)(.*)/, '$1$2-admin$3'));
127
127
  },
128
128
  async getTenantId(logger, debug) {
129
129
  if (auth.connection.spoTenantId) {
@@ -151,7 +151,7 @@ export const spo = {
151
151
  try {
152
152
  await auth.storeConnectionInfo();
153
153
  }
154
- catch (e) {
154
+ catch {
155
155
  if (debug) {
156
156
  await logger.logToStderr('Error while storing connection info');
157
157
  }
@@ -749,10 +749,7 @@ export const spo = {
749
749
  }
750
750
  }
751
751
  else {
752
- if (siteDesignId) {
753
- siteDesignId = siteDesignId;
754
- }
755
- else {
752
+ if (!siteDesignId) {
756
753
  if (siteDesign) {
757
754
  switch (siteDesign) {
758
755
  case 'Topic':
@@ -1592,10 +1589,12 @@ export const spo = {
1592
1589
  const requestBody = {
1593
1590
  formValues: requestBodyOptions
1594
1591
  };
1595
- contentTypeName && requestBody.formValues.push({
1596
- FieldName: 'ContentType',
1597
- FieldValue: contentTypeName
1598
- });
1592
+ if (contentTypeName) {
1593
+ requestBody.formValues.push({
1594
+ FieldName: 'ContentType',
1595
+ FieldValue: contentTypeName
1596
+ });
1597
+ }
1599
1598
  const requestOptions = {
1600
1599
  url: `${absoluteListUrl}/items(${itemId})/ValidateUpdateListItem()`,
1601
1600
  headers: {
@@ -176,7 +176,7 @@ export const urlUtil = {
176
176
  getTargetSiteAbsoluteUrl(webUrl, url) {
177
177
  const fullUrl = url.startsWith('https://') ? url : urlUtil.getAbsoluteUrl(webUrl, url);
178
178
  // Pattern to match SharePoint URLs
179
- const urlPattern = /https:\/\/[\w\-]+\.sharepoint\.com\/(teams|sites|personal)\/([\w\-]+)/;
179
+ const urlPattern = /https:\/\/[\w-]+\.sharepoint\.com\/(teams|sites|personal)\/([\w-]+)/;
180
180
  const match = fullUrl.match(urlPattern);
181
181
  if (match) {
182
182
  // If a match is found, return the matched URL
@@ -309,7 +309,7 @@ export const validation = {
309
309
  return false;
310
310
  }
311
311
  const hasInvalidProperties = validThemeProperties.map((property) => {
312
- return theme.hasOwnProperty(property);
312
+ return Object.prototype.hasOwnProperty.call(theme, property);
313
313
  }).includes(false);
314
314
  if (hasInvalidProperties) {
315
315
  return false;
@@ -19,7 +19,7 @@ export const vivaEngage = {
19
19
  };
20
20
  const community = await request.get(requestOptions);
21
21
  if (!community) {
22
- throw `The specified Viva Engage community with ID '${communityId}' does not exist.`;
22
+ throw new Error(`The specified Viva Engage community with ID '${communityId}' does not exist.`);
23
23
  }
24
24
  return community;
25
25
  },
@@ -32,7 +32,7 @@ export const vivaEngage = {
32
32
  async getCommunityByDisplayName(displayName, selectProperties) {
33
33
  const communities = await odata.getAllItems(`https://graph.microsoft.com/v1.0/employeeExperience/communities?$filter=displayName eq '${formatting.encodeQueryParameter(displayName)}'&$select=${selectProperties.join(',')}`);
34
34
  if (communities.length === 0) {
35
- throw `The specified Viva Engage community '${displayName}' does not exist.`;
35
+ throw new Error(`The specified Viva Engage community '${displayName}' does not exist.`);
36
36
  }
37
37
  if (communities.length > 1) {
38
38
  const resultAsKeyValuePair = formatting.convertArrayToHashTable('id', communities);
@@ -53,7 +53,7 @@ export const vivaEngage = {
53
53
  const communities = await odata.getAllItems(`https://graph.microsoft.com/v1.0/employeeExperience/communities?$select=${properties.join(',')}`);
54
54
  const filteredCommunity = communities.find(c => c.groupId === entraGroupId);
55
55
  if (!filteredCommunity) {
56
- throw `The Microsoft Entra group with id '${entraGroupId}' is not associated with any Viva Engage community.`;
56
+ throw new Error(`The Microsoft Entra group with id '${entraGroupId}' is not associated with any Viva Engage community.`);
57
57
  }
58
58
  return filteredCommunity;
59
59
  },
@@ -59,6 +59,20 @@ Creates an enterprise application for a registered Entra app with the specified
59
59
  m365 entra enterpriseapp add --objectId b2307a39-e878-458b-bc90-03bc578531d6
60
60
  ```
61
61
 
62
+ ## Permissions
63
+ <Tabs>
64
+ <TabItem value="Delegated">
65
+ | Resource | Permissions |
66
+ |-----------------|---------------------------|
67
+ | Microsoft Graph | Application.ReadWrite.All |
68
+ </TabItem>
69
+ <TabItem value="Application">
70
+ | Resource | Permissions |
71
+ |-----------------|---------------------------|
72
+ | Microsoft Graph | Application.ReadWrite.All |
73
+ </TabItem>
74
+ </Tabs>
75
+
62
76
  ## Response
63
77
 
64
78
  <Tabs>
@@ -57,6 +57,21 @@ Return details about the enterprise application with the specified ObjectId.
57
57
  m365 entra enterpriseapp get --objectId b2307a39-e878-458b-bc90-03bc578531dd
58
58
  ```
59
59
 
60
+ ## Permissions
61
+
62
+ <Tabs>
63
+ <TabItem value="Delegated">
64
+ | Resource | Permissions |
65
+ |-----------------|----------------------|
66
+ | Microsoft Graph | Application.Read.All |
67
+ </TabItem>
68
+ <TabItem value="Application">
69
+ | Resource | Permissions |
70
+ |-----------------|----------------------|
71
+ | Microsoft Graph | Application.Read.All |
72
+ </TabItem>
73
+ </Tabs>
74
+
60
75
  ## Response
61
76
 
62
77
  <Tabs>
@@ -44,6 +44,20 @@ Returns a list of all enterprise applications that comply with the specified dis
44
44
  m365 entra enterpriseapp list --displayName "My custom enterprise application" --tag "WindowsAzureActiveDirectoryIntegratedApp"
45
45
  ```
46
46
 
47
+ ## Permissions
48
+ <Tabs>
49
+ <TabItem value="Delegated">
50
+ | Resource | Permissions |
51
+ |-----------------|----------------------|
52
+ | Microsoft Graph | Application.Read.All |
53
+ </TabItem>
54
+ <TabItem value="Application">
55
+ | Resource | Permissions |
56
+ |-----------------|----------------------|
57
+ | Microsoft Graph | Application.Read.All |
58
+ </TabItem>
59
+ </Tabs>
60
+
47
61
  ## Response
48
62
 
49
63
  <Tabs>
@@ -56,6 +56,20 @@ Delete an enterprise application by object ID.
56
56
  m365 entra enterpriseapp remove --objectId b2307a39-e878-458b-bc90-03bc578531dd
57
57
  ```
58
58
 
59
+ ## Permissions
60
+ <Tabs>
61
+ <TabItem value="Delegated">
62
+ | Resource | Permissions |
63
+ |-----------------|---------------------------|
64
+ | Microsoft Graph | Application.ReadWrite.All |
65
+ </TabItem>
66
+ <TabItem value="Application">
67
+ | Resource | Permissions |
68
+ |-----------------|---------------------------|
69
+ | Microsoft Graph | Application.ReadWrite.All |
70
+ </TabItem>
71
+ </Tabs>
72
+
59
73
  ## Response
60
74
 
61
75
  The command won't return a response on success.
@@ -21,6 +21,25 @@ m365 entra groupsetting add [options]
21
21
 
22
22
  <Global />
23
23
 
24
+ ## Permissions
25
+
26
+ <Tabs>
27
+ <TabItem value="Delegated">
28
+
29
+ | Resource | Permissions |
30
+ |-----------------|-----------------------------|
31
+ | Microsoft Graph | GroupSettings.ReadWrite.All |
32
+
33
+ </TabItem>
34
+ <TabItem value="Application">
35
+
36
+ | Resource | Permissions |
37
+ |-----------------|-----------------------------|
38
+ | Microsoft Graph | GroupSettings.ReadWrite.All |
39
+
40
+ </TabItem>
41
+ </Tabs>
42
+
24
43
  ## Remarks
25
44
 
26
45
  To create a group setting, you have to specify the ID of the group setting template that should be used to create the setting. You can retrieve the ID of the template using the [entra groupsettingtemplate list](../groupsettingtemplate/groupsettingtemplate-list.mdx) command.
@@ -21,6 +21,25 @@ m365 entra groupsetting get [options]
21
21
 
22
22
  <Global />
23
23
 
24
+ ## Permissions
25
+
26
+ <Tabs>
27
+ <TabItem value="Delegated">
28
+
29
+ | Resource | Permissions |
30
+ |-----------------|------------------------|
31
+ | Microsoft Graph | GroupSettings.Read.All |
32
+
33
+ </TabItem>
34
+ <TabItem value="Application">
35
+
36
+ | Resource | Permissions |
37
+ |-----------------|------------------------|
38
+ | Microsoft Graph | GroupSettings.Read.All |
39
+
40
+ </TabItem>
41
+ </Tabs>
42
+
24
43
  ## Examples
25
44
 
26
45
  Get information about the group setting with id _1caf7dcd-7e83-4c3a-94f7-932a1299c844_
@@ -16,6 +16,25 @@ m365 entra groupsetting list [options]
16
16
 
17
17
  <Global />
18
18
 
19
+ ## Permissions
20
+
21
+ <Tabs>
22
+ <TabItem value="Delegated">
23
+
24
+ | Resource | Permissions |
25
+ |-----------------|------------------------|
26
+ | Microsoft Graph | GroupSettings.Read.All |
27
+
28
+ </TabItem>
29
+ <TabItem value="Application">
30
+
31
+ | Resource | Permissions |
32
+ |-----------------|------------------------|
33
+ | Microsoft Graph | GroupSettings.Read.All |
34
+
35
+ </TabItem>
36
+ </Tabs>
37
+
19
38
  ## Examples
20
39
 
21
40
  List all group settings in the tenant
@@ -1,4 +1,6 @@
1
1
  import Global from '/docs/cmd/_global.mdx';
2
+ import Tabs from '@theme/Tabs';
3
+ import TabItem from '@theme/TabItem';
2
4
 
3
5
  # entra groupsetting remove
4
6
 
@@ -22,6 +24,25 @@ m365 entra groupsetting remove [options]
22
24
 
23
25
  <Global />
24
26
 
27
+ ## Permissions
28
+
29
+ <Tabs>
30
+ <TabItem value="Delegated">
31
+
32
+ | Resource | Permissions |
33
+ |-----------------|-----------------------------|
34
+ | Microsoft Graph | GroupSettings.ReadWrite.All |
35
+
36
+ </TabItem>
37
+ <TabItem value="Application">
38
+
39
+ | Resource | Permissions |
40
+ |-----------------|-----------------------------|
41
+ | Microsoft Graph | GroupSettings.ReadWrite.All |
42
+
43
+ </TabItem>
44
+ </Tabs>
45
+
25
46
  ## Remarks
26
47
 
27
48
  If the specified _id_ doesn't refer to an existing group setting, you will get a `Resource does not exist` error.
@@ -1,4 +1,6 @@
1
1
  import Global from '/docs/cmd/_global.mdx';
2
+ import Tabs from '@theme/Tabs';
3
+ import TabItem from '@theme/TabItem';
2
4
 
3
5
  # entra groupsetting set
4
6
 
@@ -19,6 +21,25 @@ m365 entra groupsetting set [options]
19
21
 
20
22
  <Global />
21
23
 
24
+ ## Permissions
25
+
26
+ <Tabs>
27
+ <TabItem value="Delegated">
28
+
29
+ | Resource | Permissions |
30
+ |-----------------|-----------------------------|
31
+ | Microsoft Graph | GroupSettings.ReadWrite.All |
32
+
33
+ </TabItem>
34
+ <TabItem value="Application">
35
+
36
+ | Resource | Permissions |
37
+ |-----------------|-----------------------------|
38
+ | Microsoft Graph | GroupSettings.ReadWrite.All |
39
+
40
+ </TabItem>
41
+ </Tabs>
42
+
22
43
  ## Remarks
23
44
 
24
45
  To update a group setting, you have to specify the ID of the group setting. You can retrieve the ID of the group setting using the [entra groupsetting list](./groupsetting-list.mdx) command.
@@ -66,6 +66,25 @@ Public | Anyone can join the group without needing owner permission. Anyone can
66
66
  Private | Owner permission is needed to join the group. Anyone can view the attributes of the group. Anyone can see the members of the group.
67
67
  HiddenMembership | Owner permission is needed to join the group. Guest users cannot view the attributes of the group. Non-members cannot see the members of the group. Administrators (global, company, user, and helpdesk) can view the membership of the group. The group appears in the global address book (GAL).
68
68
 
69
+ ## Permissions
70
+
71
+ <Tabs>
72
+ <TabItem value="Delegated">
73
+
74
+ | Resource | Permissions |
75
+ |-----------------|---------------------|
76
+ | Microsoft Graph | Group.ReadWrite.All |
77
+
78
+ </TabItem>
79
+ <TabItem value="Application">
80
+
81
+ | Resource | Permissions |
82
+ |-----------------|--------------|
83
+ | Microsoft Graph | Group.Create |
84
+
85
+ </TabItem>
86
+ </Tabs>
87
+
69
88
  ## Examples
70
89
 
71
90
  Create a public Microsoft 365 Group.