@pnp/cli-microsoft365 10.1.0 → 10.2.0-beta.8c41470

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.
@@ -67,7 +67,14 @@ class EntraAppPermissionRemoveCommand extends GraphCommand {
67
67
  await request.patch(removePermissionRequestOptions);
68
68
  if (args.options.revokeAdminConsent) {
69
69
  const appServicePrincipal = servicePrincipals.find(sp => sp.appId === appObject.appId);
70
- await this.revokeAdminConsent(appServicePrincipal, appPermissions, logger);
70
+ if (appServicePrincipal) {
71
+ await this.revokeAdminConsent(appServicePrincipal, appPermissions, logger);
72
+ }
73
+ else {
74
+ if (this.debug) {
75
+ await logger.logToStderr(`No service principal found for the appId: ${appObject.appId}. Skipping revoking admin consent.`);
76
+ }
77
+ }
71
78
  }
72
79
  }
73
80
  catch (err) {
@@ -0,0 +1,50 @@
1
+ import { odata } from '../../../../utils/odata.js';
2
+ import GraphCommand from '../../../base/GraphCommand.js';
3
+ import commands from '../../commands.js';
4
+ import { z } from 'zod';
5
+ import { globalOptionsZod } from '../../../../Command.js';
6
+ import { zod } from '../../../../utils/zod.js';
7
+ const options = globalOptionsZod
8
+ .extend({
9
+ properties: zod.alias('p', z.string().optional()),
10
+ filter: zod.alias('f', z.string().optional())
11
+ })
12
+ .strict();
13
+ class EntraRoleDefinitionListCommand extends GraphCommand {
14
+ get name() {
15
+ return commands.ROLEDEFINITION_LIST;
16
+ }
17
+ get description() {
18
+ return 'Lists all Microsoft Entra ID role definitions';
19
+ }
20
+ defaultProperties() {
21
+ return ['id', 'displayName', 'isBuiltIn', 'isEnabled'];
22
+ }
23
+ get schema() {
24
+ return options;
25
+ }
26
+ async commandAction(logger, args) {
27
+ if (this.verbose) {
28
+ await logger.logToStderr('Getting Microsoft Entra ID role definitions...');
29
+ }
30
+ try {
31
+ const queryParameters = [];
32
+ if (args.options.properties) {
33
+ queryParameters.push(`$select=${args.options.properties}`);
34
+ }
35
+ if (args.options.filter) {
36
+ queryParameters.push(`$filter=${args.options.filter}`);
37
+ }
38
+ const queryString = queryParameters.length > 0
39
+ ? `?${queryParameters.join('&')}`
40
+ : '';
41
+ const results = await odata.getAllItems(`${this.resource}/v1.0/roleManagement/directory/roleDefinitions${queryString}`);
42
+ await logger.log(results);
43
+ }
44
+ catch (err) {
45
+ this.handleRejectedODataJsonPromise(err);
46
+ }
47
+ }
48
+ }
49
+ export default new EntraRoleDefinitionListCommand();
50
+ //# sourceMappingURL=roledefinition-list.js.map
@@ -87,6 +87,7 @@ export default {
87
87
  PIM_ROLE_ASSIGNMENT_ELIGIBILITY_LIST: `${prefix} pim role assignment eligibility list`,
88
88
  PIM_ROLE_REQUEST_LIST: `${prefix} pim role request list`,
89
89
  POLICY_LIST: `${prefix} policy list`,
90
+ ROLEDEFINITION_LIST: `${prefix} roledefinition list`,
90
91
  SITECLASSIFICATION_DISABLE: `${prefix} siteclassification disable`,
91
92
  SITECLASSIFICATION_ENABLE: `${prefix} siteclassification enable`,
92
93
  SITECLASSIFICATION_GET: `${prefix} siteclassification get`,
@@ -0,0 +1,148 @@
1
+ import Global from '/docs/cmd/_global.mdx';
2
+ import Tabs from '@theme/Tabs';
3
+ import TabItem from '@theme/TabItem';
4
+
5
+ # entra roledefinition list
6
+
7
+ Lists all Microsoft Entra ID role definitions.
8
+
9
+ ## Usage
10
+
11
+ ```sh
12
+ m365 entra roledefinition list [options]
13
+ ```
14
+
15
+ ## Options
16
+
17
+ ```md definition-list
18
+ `-p, --properties [properties]`
19
+ : Comma-separated list of properties to retrieve.
20
+
21
+ `-f, --filter [filter]`
22
+ : OData filter to apply when retrieving the role definitions.
23
+ ```
24
+
25
+ <Global />
26
+
27
+ ## Examples
28
+
29
+ Retrieve all Microsoft Entra ID role definitions
30
+
31
+ ```sh
32
+ m365 entra roledefinition list
33
+ ```
34
+
35
+ Retrieve only the names of the role definitions
36
+
37
+ ```sh
38
+ m365 entra roledefinition list --properties 'displayName'
39
+ ```
40
+
41
+ Retrieve only custom role definitions
42
+
43
+ ```sh
44
+ m365 entra roledefinition list --filter 'isBuiltIn eq false'
45
+ ```
46
+
47
+ ## Response
48
+
49
+ ### Standard response
50
+
51
+ <Tabs>
52
+ <TabItem value="JSON">
53
+
54
+ ```json
55
+ [
56
+ {
57
+ "id": "f28a1f50-f6e7-4571-818b-6a12f2af6b6c",
58
+ "description": "Can manage all aspects of the SharePoint service.",
59
+ "displayName": "SharePoint Administrator",
60
+ "isBuiltIn": true,
61
+ "isEnabled": true,
62
+ "resourceScopes": [
63
+ "/"
64
+ ],
65
+ "templateId": "f28a1f50-f6e7-4571-818b-6a12f2af6b6c",
66
+ "version": "1",
67
+ "rolePermissions": [
68
+ {
69
+ "allowedResourceActions": [
70
+ "microsoft.azure.serviceHealth/allEntities/allTasks",
71
+ "microsoft.azure.supportTickets/allEntities/allTasks",
72
+ "microsoft.backup/oneDriveForBusinessProtectionPolicies/allProperties/allTasks",
73
+ "microsoft.backup/oneDriveForBusinessRestoreSessions/allProperties/allTasks",
74
+ "microsoft.backup/restorePoints/sites/allProperties/allTasks",
75
+ "microsoft.backup/restorePoints/userDrives/allProperties/allTasks",
76
+ "microsoft.backup/sharePointProtectionPolicies/allProperties/allTasks",
77
+ "microsoft.backup/sharePointRestoreSessions/allProperties/allTasks",
78
+ "microsoft.backup/siteProtectionUnits/allProperties/allTasks",
79
+ "microsoft.backup/siteRestoreArtifacts/allProperties/allTasks",
80
+ "microsoft.backup/userDriveProtectionUnits/allProperties/allTasks",
81
+ "microsoft.backup/userDriveRestoreArtifacts/allProperties/allTasks",
82
+ "microsoft.directory/groups/hiddenMembers/read",
83
+ "microsoft.directory/groups.unified/basic/update",
84
+ "microsoft.directory/groups.unified/create",
85
+ "microsoft.directory/groups.unified/delete",
86
+ "microsoft.directory/groups.unified/members/update",
87
+ "microsoft.directory/groups.unified/owners/update",
88
+ "microsoft.directory/groups.unified/restore",
89
+ "microsoft.office365.migrations/allEntities/allProperties/allTasks",
90
+ "microsoft.office365.network/performance/allProperties/read",
91
+ "microsoft.office365.serviceHealth/allEntities/allTasks",
92
+ "microsoft.office365.sharePoint/allEntities/allTasks",
93
+ "microsoft.office365.supportTickets/allEntities/allTasks",
94
+ "microsoft.office365.usageReports/allEntities/allProperties/read",
95
+ "microsoft.office365.webPortal/allEntities/standard/read"
96
+ ],
97
+ "condition": null
98
+ }
99
+ ],
100
+ "inheritsPermissionsFrom": [
101
+ {
102
+ "id": "88d8e3e3-8f55-4a1e-953a-9b9898b8876b"
103
+ }
104
+ ]
105
+ }
106
+ ]
107
+ ```
108
+
109
+ </TabItem>
110
+ <TabItem value="Text">
111
+
112
+ ```text
113
+ id displayName isBuiltIn isEnabled
114
+ ------------------------------------ --------------------------------------------- --------- ---------
115
+ f28a1f50-f6e7-4571-818b-6a12f2af6b6c SharePoint Administrator true true
116
+ ```
117
+
118
+ </TabItem>
119
+ <TabItem value="CSV">
120
+
121
+ ```csv
122
+ id,description,displayName,isBuiltIn,isEnabled,templateId,version
123
+ f28a1f50-f6e7-4571-818b-6a12f2af6b6c,Can manage all aspects of the SharePoint service.,SharePoint Administrator,1,1,f28a1f50-f6e7-4571-818b-6a12f2af6b6c,1
124
+ ```
125
+
126
+ </TabItem>
127
+ <TabItem value="Markdown">
128
+
129
+ ```md
130
+ # entra roledefinition list
131
+
132
+ Date: 11/7/2024
133
+
134
+ ## SharePoint Administrator (f28a1f50-f6e7-4571-818b-6a12f2af6b6c)
135
+
136
+ Property | Value
137
+ ---------|-------
138
+ id | f28a1f50-f6e7-4571-818b-6a12f2af6b6c
139
+ description | Can manage all aspects of the SharePoint service.
140
+ displayName | SharePoint Administrator
141
+ isBuiltIn | true
142
+ isEnabled | true
143
+ templateId | f28a1f50-f6e7-4571-818b-6a12f2af6b6c
144
+ version | 1
145
+ ```
146
+
147
+ </TabItem>
148
+ </Tabs>
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@pnp/cli-microsoft365",
3
- "version": "10.1.0",
3
+ "version": "10.2.0",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "@pnp/cli-microsoft365",
9
- "version": "10.1.0",
9
+ "version": "10.2.0",
10
10
  "license": "MIT",
11
11
  "dependencies": {
12
12
  "@azure/msal-common": "14.15",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pnp/cli-microsoft365",
3
- "version": "10.1.0",
3
+ "version": "10.2.0-beta.8c41470",
4
4
  "description": "Manage Microsoft 365 and SharePoint Framework projects on any platform",
5
5
  "license": "MIT",
6
6
  "main": "./dist/api.js",
@@ -312,4 +312,4 @@
312
312
  "sinon": "^19.0.2",
313
313
  "source-map-support": "^0.5.21"
314
314
  }
315
- }
315
+ }