@pnp/cli-microsoft365 7.6.0-beta.443bfd8 → 7.6.0-beta.480812d
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/allCommands.json +1 -1
- package/allCommandsFull.json +1 -1
- package/dist/Auth.js +2 -2
- package/dist/AuthServer.js +1 -1
- package/dist/config.js +2 -2
- package/dist/m365/app/commands/app-get.js +1 -1
- package/dist/m365/app/commands/app-open.js +1 -1
- package/dist/m365/app/commands/permission/permission-add.js +2 -2
- package/dist/m365/app/commands/permission/permission-list.js +2 -2
- package/dist/m365/cli/commands/cli-consent.js +2 -2
- package/dist/m365/cli/commands/cli-reconsent.js +3 -3
- package/dist/m365/commands/login.js +1 -1
- package/dist/m365/entra/commands/administrativeunit/administrativeunit-add.js +1 -0
- package/dist/m365/entra/commands/administrativeunit/administrativeunit-get.js +1 -0
- package/dist/m365/entra/commands/administrativeunit/administrativeunit-list.js +1 -0
- package/dist/m365/entra/commands/administrativeunit/administrativeunit-member-add.js +1 -0
- package/dist/m365/entra/commands/administrativeunit/administrativeunit-member-get.js +1 -0
- package/dist/m365/entra/commands/administrativeunit/administrativeunit-member-list.js +1 -0
- package/dist/m365/entra/commands/administrativeunit/administrativeunit-remove.js +1 -0
- package/dist/m365/entra/commands/app/app-add.js +7 -6
- package/dist/m365/entra/commands/app/app-get.js +4 -3
- package/dist/m365/entra/commands/app/app-list.js +1 -0
- package/dist/m365/entra/commands/app/app-permission-add.js +3 -2
- package/dist/m365/entra/commands/app/app-permission-list.js +1 -1
- package/dist/m365/entra/commands/app/app-remove.js +5 -4
- package/dist/m365/entra/commands/app/app-role-add.js +6 -5
- package/dist/m365/entra/commands/app/app-role-list.js +4 -3
- package/dist/m365/entra/commands/app/app-role-remove.js +6 -5
- package/dist/m365/entra/commands/app/app-set.js +8 -7
- package/dist/m365/entra/commands/approleassignment/approleassignment-add.js +2 -1
- package/dist/m365/entra/commands/approleassignment/approleassignment-list.js +1 -0
- package/dist/m365/entra/commands/approleassignment/approleassignment-remove.js +1 -0
- package/dist/m365/entra/commands/enterpriseapp/enterpriseapp-add.js +1 -0
- package/dist/m365/entra/commands/enterpriseapp/enterpriseapp-get.js +1 -0
- package/dist/m365/entra/commands/enterpriseapp/enterpriseapp-list.js +1 -0
- package/dist/m365/entra/commands/group/group-get.js +1 -0
- package/dist/m365/entra/commands/group/group-list.js +1 -0
- package/dist/m365/entra/commands/group/group-remove.js +1 -0
- package/dist/m365/entra/commands/group/group-user-list.js +1 -0
- package/dist/m365/entra/commands/groupsetting/groupsetting-add.js +1 -0
- package/dist/m365/entra/commands/groupsetting/groupsetting-get.js +1 -0
- package/dist/m365/entra/commands/groupsetting/groupsetting-list.js +1 -0
- package/dist/m365/entra/commands/groupsetting/groupsetting-remove.js +1 -0
- package/dist/m365/entra/commands/groupsetting/groupsetting-set.js +1 -0
- package/dist/m365/entra/commands/groupsettingtemplate/groupsettingtemplate-get.js +1 -0
- package/dist/m365/entra/commands/groupsettingtemplate/groupsettingtemplate-list.js +1 -0
- package/dist/m365/entra/commands/license/license-list.js +1 -0
- package/dist/m365/entra/commands/m365group/m365group-add.js +1 -0
- package/dist/m365/entra/commands/m365group/m365group-conversation-list.js +1 -0
- package/dist/m365/entra/commands/m365group/m365group-conversation-post-list.js +1 -0
- package/dist/m365/entra/commands/m365group/m365group-get.js +1 -0
- package/dist/m365/entra/commands/m365group/m365group-list.js +1 -0
- package/dist/m365/entra/commands/m365group/m365group-recyclebinitem-clear.js +1 -0
- package/dist/m365/entra/commands/m365group/m365group-recyclebinitem-list.js +1 -0
- package/dist/m365/entra/commands/m365group/m365group-recyclebinitem-remove.js +1 -0
- package/dist/m365/entra/commands/m365group/m365group-recyclebinitem-restore.js +1 -0
- package/dist/m365/entra/commands/m365group/m365group-remove.js +1 -0
- package/dist/m365/entra/commands/m365group/m365group-renew.js +1 -0
- package/dist/m365/entra/commands/m365group/m365group-set.js +1 -0
- package/dist/m365/entra/commands/m365group/m365group-teamify.js +1 -0
- package/dist/m365/entra/commands/m365group/m365group-user-add.js +1 -0
- package/dist/m365/entra/commands/m365group/m365group-user-list.js +1 -0
- package/dist/m365/entra/commands/m365group/m365group-user-remove.js +1 -0
- package/dist/m365/entra/commands/m365group/m365group-user-set.js +1 -0
- package/dist/m365/entra/commands/oauth2grant/oauth2grant-add.js +1 -0
- package/dist/m365/entra/commands/oauth2grant/oauth2grant-list.js +1 -0
- package/dist/m365/entra/commands/oauth2grant/oauth2grant-remove.js +1 -0
- package/dist/m365/entra/commands/oauth2grant/oauth2grant-set.js +1 -0
- package/dist/m365/entra/commands/policy/policy-list.js +1 -0
- package/dist/m365/entra/commands/siteclassification/siteclassification-disable.js +1 -0
- package/dist/m365/entra/commands/siteclassification/siteclassification-enable.js +1 -0
- package/dist/m365/entra/commands/siteclassification/siteclassification-get.js +1 -0
- package/dist/m365/entra/commands/siteclassification/siteclassification-set.js +1 -0
- package/dist/m365/entra/commands/user/user-add.js +1 -0
- package/dist/m365/entra/commands/user/user-get.js +1 -0
- package/dist/m365/entra/commands/user/user-guest-add.js +1 -0
- package/dist/m365/entra/commands/user/user-hibp.js +1 -0
- package/dist/m365/entra/commands/user/user-license-add.js +1 -0
- package/dist/m365/entra/commands/user/user-license-list.js +1 -0
- package/dist/m365/entra/commands/user/user-license-remove.js +1 -0
- package/dist/m365/entra/commands/user/user-list.js +1 -0
- package/dist/m365/entra/commands/user/user-password-validate.js +1 -0
- package/dist/m365/entra/commands/user/user-recyclebinitem-clear.js +1 -0
- package/dist/m365/entra/commands/user/user-recyclebinitem-list.js +1 -0
- package/dist/m365/entra/commands/user/user-recyclebinitem-remove.js +2 -1
- package/dist/m365/entra/commands/user/user-recyclebinitem-restore.js +1 -0
- package/dist/m365/entra/commands/user/user-remove.js +1 -0
- package/dist/m365/entra/commands/user/user-set.js +1 -0
- package/dist/m365/entra/commands/user/user-signin-list.js +1 -0
- package/dist/m365/outlook/commands/message/message-remove.js +113 -0
- package/dist/m365/outlook/commands.js +1 -0
- package/dist/m365/pp/commands/managementapp/managementapp-add.js +7 -7
- package/dist/m365/spo/commands/folder/FolderColor.js +19 -0
- package/dist/m365/spo/commands/folder/folder-add.js +46 -17
- package/dist/m365/spo/commands/folder/folder-set.js +118 -0
- package/dist/m365/spo/commands/group/group-member-add.js +2 -2
- package/dist/m365/spo/commands/group/group-member-remove.js +1 -1
- package/dist/m365/spo/commands/site/site-apppermission-add.js +2 -2
- package/dist/m365/spo/commands/site/site-recyclebinitem-restore.js +66 -27
- package/dist/m365/spo/commands/tenant/tenant-settings-set.js +1 -1
- package/dist/m365/spo/commands.js +1 -0
- package/dist/m365/teams/commands/tab/tab-get.js +1 -1
- package/dist/utils/spo.js +1 -1
- package/docs/docs/cmd/app/app-get.mdx +10 -10
- package/docs/docs/cmd/app/app-open.mdx +6 -6
- package/docs/docs/cmd/app/permission/permission-add.mdx +2 -2
- package/docs/docs/cmd/app/permission/permission-list.mdx +5 -5
- package/docs/docs/cmd/cli/cli-consent.mdx +2 -2
- package/docs/docs/cmd/cli/cli-reconsent.mdx +6 -6
- package/docs/docs/cmd/entra/app/app-permission-add.mdx +6 -6
- package/docs/docs/cmd/entra/approleassignment/approleassignment-add.mdx +1 -1
- package/docs/docs/cmd/entra/approleassignment/approleassignment-list.mdx +4 -4
- package/docs/docs/cmd/entra/enterpriseapp/enterpriseapp-add.mdx +1 -1
- package/docs/docs/cmd/entra/enterpriseapp/enterpriseapp-get.mdx +1 -1
- package/docs/docs/cmd/entra/group/group-user-add.mdx +7 -7
- package/docs/docs/cmd/entra/oauth2grant/oauth2grant-add.mdx +1 -1
- package/docs/docs/cmd/entra/oauth2grant/oauth2grant-list.mdx +1 -1
- package/docs/docs/cmd/entra/oauth2grant/oauth2grant-remove.mdx +1 -1
- package/docs/docs/cmd/entra/oauth2grant/oauth2grant-set.mdx +1 -1
- package/docs/docs/cmd/external/connection/connection-add.mdx +2 -2
- package/docs/docs/cmd/file/file-add.mdx +1 -1
- package/docs/docs/cmd/graph/schemaextension/schemaextension-add.mdx +2 -2
- package/docs/docs/cmd/graph/schemaextension/schemaextension-set.mdx +1 -1
- package/docs/docs/cmd/login.mdx +18 -18
- package/docs/docs/cmd/outlook/message/message-remove.mdx +67 -0
- package/docs/docs/cmd/pa/app/app-owner-set.mdx +1 -1
- package/docs/docs/cmd/pa/app/app-permission-ensure.mdx +3 -3
- package/docs/docs/cmd/pa/app/app-permission-remove.mdx +3 -3
- package/docs/docs/cmd/planner/plan/plan-add.mdx +1 -1
- package/docs/docs/cmd/planner/roster/roster-add.mdx +5 -5
- package/docs/docs/cmd/planner/roster/roster-get.mdx +7 -7
- package/docs/docs/cmd/planner/roster/roster-member-add.mdx +4 -4
- package/docs/docs/cmd/planner/roster/roster-member-get.mdx +4 -4
- package/docs/docs/cmd/planner/roster/roster-member-list.mdx +2 -2
- package/docs/docs/cmd/planner/roster/roster-member-remove.mdx +5 -5
- package/docs/docs/cmd/planner/roster/roster-plan-list.mdx +1 -1
- package/docs/docs/cmd/planner/roster/roster-remove.mdx +2 -2
- package/docs/docs/cmd/planner/task/task-add.mdx +1 -1
- package/docs/docs/cmd/planner/task/task-get.mdx +1 -1
- package/docs/docs/cmd/planner/task/task-list.mdx +1 -1
- package/docs/docs/cmd/planner/task/task-remove.mdx +1 -1
- package/docs/docs/cmd/planner/task/task-set.mdx +1 -1
- package/docs/docs/cmd/pp/environment/environment-get.mdx +1 -1
- package/docs/docs/cmd/pp/environment/environment-list.mdx +1 -1
- package/docs/docs/cmd/pp/managementapp/managementapp-add.mdx +9 -9
- package/docs/docs/cmd/purview/auditlog/auditlog-list.mdx +1 -1
- package/docs/docs/cmd/purview/sensitivitylabel/sensitivitylabel-get.mdx +1 -1
- package/docs/docs/cmd/purview/sensitivitylabel/sensitivitylabel-list.mdx +1 -1
- package/docs/docs/cmd/purview/sensitivitylabel/sensitivitylabel-policysettings-list.mdx +1 -1
- package/docs/docs/cmd/request.mdx +1 -1
- package/docs/docs/cmd/spfx/project/project-github-workflow-add.mdx +2 -2
- package/docs/docs/cmd/spo/file/file-roleassignment-add.mdx +3 -3
- package/docs/docs/cmd/spo/file/file-roleassignment-remove.mdx +2 -2
- package/docs/docs/cmd/spo/folder/folder-add.mdx +38 -0
- package/docs/docs/cmd/spo/folder/folder-roleassignment-add.mdx +1 -1
- package/docs/docs/cmd/spo/folder/folder-roleassignment-remove.mdx +1 -1
- package/docs/docs/cmd/spo/folder/folder-set.mdx +88 -0
- package/docs/docs/cmd/spo/group/group-member-add.mdx +2 -2
- package/docs/docs/cmd/spo/group/group-member-remove.mdx +3 -3
- package/docs/docs/cmd/spo/list/list-roleassignment-add.mdx +3 -3
- package/docs/docs/cmd/spo/list/list-roleassignment-remove.mdx +2 -2
- package/docs/docs/cmd/spo/listitem/listitem-roleassignment-add.mdx +8 -8
- package/docs/docs/cmd/spo/listitem/listitem-roleassignment-remove.mdx +2 -2
- package/docs/docs/cmd/spo/site/site-apppermission-add.mdx +2 -2
- package/docs/docs/cmd/spo/site/site-apppermission-set.mdx +2 -2
- package/docs/docs/cmd/spo/site/site-recyclebinitem-restore.mdx +29 -5
- package/docs/docs/cmd/spo/tenant/tenant-settings-set.mdx +89 -89
- package/docs/docs/cmd/spo/user/user-ensure.mdx +1 -1
- package/docs/docs/cmd/spo/web/web-roleassignment-add.mdx +3 -3
- package/docs/docs/cmd/spo/web/web-roleassignment-remove.mdx +2 -2
- package/docs/docs/cmd/teams/channel/channel-member-remove.mdx +1 -1
- package/docs/docs/cmd/teams/channel/channel-member-set.mdx +1 -1
- package/docs/docs/cmd/teams/chat/chat-member-remove.mdx +3 -3
- package/docs/docs/cmd/teams/report/report-directroutingcalls.mdx +1 -1
- package/docs/docs/cmd/teams/report/report-pstncalls.mdx +1 -1
- package/docs/docs/cmd/teams/tab/tab-get.mdx +19 -12
- package/docs/docs/cmd/tenant/security/security-alerts-list.mdx +1 -1
- package/docs/docs/cmd/viva/engage/engage-group-list.mdx +1 -1
- package/docs/docs/cmd/viva/engage/engage-group-user-add.mdx +1 -1
- package/docs/docs/cmd/viva/engage/engage-group-user-remove.mdx +1 -1
- package/docs/docs/cmd/viva/engage/engage-message-add.mdx +1 -1
- package/docs/docs/cmd/viva/engage/engage-message-get.mdx +1 -1
- package/docs/docs/cmd/viva/engage/engage-message-like-set.mdx +1 -1
- package/docs/docs/cmd/viva/engage/engage-message-list.mdx +1 -1
- package/docs/docs/cmd/viva/engage/engage-message-remove.mdx +1 -1
- package/docs/docs/cmd/viva/engage/engage-network-list.mdx +1 -1
- package/docs/docs/cmd/viva/engage/engage-search.mdx +1 -1
- package/docs/docs/cmd/viva/engage/engage-user-get.mdx +1 -1
- package/docs/docs/cmd/viva/engage/engage-user-list.mdx +1 -1
- package/npm-shrinkwrap.json +62 -58
- package/package.json +11 -11
- package/dist/m365/spo/commands/folder/folder-rename.js +0 -72
- package/docs/docs/cmd/spo/folder/folder-rename.mdx +0 -44
package/dist/Auth.js
CHANGED
|
@@ -24,7 +24,7 @@ export class Connection {
|
|
|
24
24
|
this.certificateType = CertificateType.Unknown;
|
|
25
25
|
this.cloudType = CloudType.Public;
|
|
26
26
|
this.accessTokens = {};
|
|
27
|
-
this.appId = config.
|
|
27
|
+
this.appId = config.cliEntraAppId;
|
|
28
28
|
this.tenant = config.tenant;
|
|
29
29
|
this.cloudType = CloudType.Public;
|
|
30
30
|
}
|
|
@@ -44,7 +44,7 @@ export class Connection {
|
|
|
44
44
|
this.thumbprint = undefined;
|
|
45
45
|
this.spoUrl = undefined;
|
|
46
46
|
this.spoTenantId = undefined;
|
|
47
|
-
this.appId = config.
|
|
47
|
+
this.appId = config.cliEntraAppId;
|
|
48
48
|
this.tenant = config.tenant;
|
|
49
49
|
}
|
|
50
50
|
}
|
package/dist/AuthServer.js
CHANGED
|
@@ -54,7 +54,7 @@ export class AuthServer {
|
|
|
54
54
|
error: queryString.error,
|
|
55
55
|
errorDescription: queryString.error_description
|
|
56
56
|
};
|
|
57
|
-
body = "<p>Oops!
|
|
57
|
+
body = "<p>Oops! Microsoft Entra ID replied with an error message.</p>";
|
|
58
58
|
body += `<p>${errorMessage.error}</p>`;
|
|
59
59
|
if (errorMessage.errorDescription !== undefined) {
|
|
60
60
|
body += `<p>${errorMessage.errorDescription}</p>`;
|
package/dist/config.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { app } from "./utils/app.js";
|
|
2
|
-
const
|
|
2
|
+
const cliEntraAppId = '31359c7f-bd7e-475c-86db-fdb8c937548e';
|
|
3
3
|
export default {
|
|
4
4
|
applicationName: `CLI for Microsoft 365 v${app.packageJson().version}`,
|
|
5
5
|
delimiter: 'm365\$',
|
|
6
|
-
|
|
6
|
+
cliEntraAppId: process.env.CLIMICROSOFT365_ENTRAAPPID || process.env.CLIMICROSOFT365_AADAPPID || cliEntraAppId,
|
|
7
7
|
tenant: process.env.CLIMICROSOFT365_TENANT || 'common',
|
|
8
8
|
configstoreName: 'cli-m365-config'
|
|
9
9
|
};
|
|
@@ -7,7 +7,7 @@ class AppGetCommand extends AppCommand {
|
|
|
7
7
|
return commands.GET;
|
|
8
8
|
}
|
|
9
9
|
get description() {
|
|
10
|
-
return 'Retrieves information about the current
|
|
10
|
+
return 'Retrieves information about the current Microsoft Entra app';
|
|
11
11
|
}
|
|
12
12
|
async commandAction(logger, args) {
|
|
13
13
|
const options = {
|
|
@@ -19,7 +19,7 @@ class AppPermissionAddCommand extends AppCommand {
|
|
|
19
19
|
return commands.PERMISSION_ADD;
|
|
20
20
|
}
|
|
21
21
|
get description() {
|
|
22
|
-
return 'Adds the specified application and/or delegated permissions to the current
|
|
22
|
+
return 'Adds the specified application and/or delegated permissions to the current Microsoft Entra app API permissions';
|
|
23
23
|
}
|
|
24
24
|
constructor() {
|
|
25
25
|
super();
|
|
@@ -64,7 +64,7 @@ class AppPermissionAddCommand extends AppCommand {
|
|
|
64
64
|
async getAppObject() {
|
|
65
65
|
const apps = await odata.getAllItems(`${this.resource}/v1.0/myorganization/applications?$filter=appId eq '${formatting.encodeQueryParameter(this.appId)}'&$select=id,requiredResourceAccess`);
|
|
66
66
|
if (apps.length === 0) {
|
|
67
|
-
throw `App with id ${this.appId} not found in
|
|
67
|
+
throw `App with id ${this.appId} not found in Microsoft Entra ID.`;
|
|
68
68
|
}
|
|
69
69
|
return apps[0];
|
|
70
70
|
}
|
|
@@ -13,7 +13,7 @@ class AppPermissionListCommand extends AppCommand {
|
|
|
13
13
|
return commands.PERMISSION_LIST;
|
|
14
14
|
}
|
|
15
15
|
get description() {
|
|
16
|
-
return 'Lists API permissions for the current
|
|
16
|
+
return 'Lists API permissions for the current Microsoft Entra app';
|
|
17
17
|
}
|
|
18
18
|
async commandAction(logger) {
|
|
19
19
|
try {
|
|
@@ -178,7 +178,7 @@ class AppPermissionListCommand extends AppCommand {
|
|
|
178
178
|
}
|
|
179
179
|
async getAppRegistration(appId, logger) {
|
|
180
180
|
if (this.verbose) {
|
|
181
|
-
await logger.logToStderr(`Retrieving
|
|
181
|
+
await logger.logToStderr(`Retrieving Microsoft Entra application registration ${appId}`);
|
|
182
182
|
}
|
|
183
183
|
const options = {
|
|
184
184
|
appId: appId,
|
|
@@ -12,7 +12,7 @@ class CliConsentCommand extends AnonymousCommand {
|
|
|
12
12
|
return commands.CONSENT;
|
|
13
13
|
}
|
|
14
14
|
get description() {
|
|
15
|
-
return 'Consent additional permissions for the
|
|
15
|
+
return 'Consent additional permissions for the Microsoft Entra application used by the CLI for Microsoft 365';
|
|
16
16
|
}
|
|
17
17
|
constructor() {
|
|
18
18
|
super();
|
|
@@ -30,7 +30,7 @@ class CliConsentCommand extends AnonymousCommand {
|
|
|
30
30
|
scope = 'https://api.yammer.com/user_impersonation';
|
|
31
31
|
break;
|
|
32
32
|
}
|
|
33
|
-
await logger.log(`To consent permissions for executing ${args.options.service} commands, navigate in your web browser to https://login.microsoftonline.com/${config.tenant}/oauth2/v2.0/authorize?client_id=${config.
|
|
33
|
+
await logger.log(`To consent permissions for executing ${args.options.service} commands, navigate in your web browser to https://login.microsoftonline.com/${config.tenant}/oauth2/v2.0/authorize?client_id=${config.cliEntraAppId}&response_type=code&scope=${encodeURIComponent(scope)}`);
|
|
34
34
|
}
|
|
35
35
|
async action(logger, args) {
|
|
36
36
|
this.initAction(args, logger);
|
|
@@ -9,12 +9,12 @@ class CliReconsentCommand extends AnonymousCommand {
|
|
|
9
9
|
return commands.RECONSENT;
|
|
10
10
|
}
|
|
11
11
|
get description() {
|
|
12
|
-
return 'Returns
|
|
12
|
+
return 'Returns URL to open in the browser to re-consent CLI for Microsoft 365 Microsoft Entra permissions';
|
|
13
13
|
}
|
|
14
14
|
async commandAction(logger) {
|
|
15
|
-
const url = `https://login.microsoftonline.com/${config.tenant}/oauth2/authorize?client_id=${config.
|
|
15
|
+
const url = `https://login.microsoftonline.com/${config.tenant}/oauth2/authorize?client_id=${config.cliEntraAppId}&response_type=code&prompt=admin_consent`;
|
|
16
16
|
if (cli.getSettingWithDefaultValue(settingsNames.autoOpenLinksInBrowser, false) === false) {
|
|
17
|
-
await logger.log(`To re-consent the PnP Microsoft 365 Management Shell
|
|
17
|
+
await logger.log(`To re-consent the PnP Microsoft 365 Management Shell Microsoft Entra application navigate in your web browser to ${url}`);
|
|
18
18
|
return;
|
|
19
19
|
}
|
|
20
20
|
await logger.log(`Opening the following page in your browser: ${url}`);
|
|
@@ -37,7 +37,7 @@ class LoginCommand extends Command {
|
|
|
37
37
|
await logger.logToStderr(`Signing in to Microsoft 365...`);
|
|
38
38
|
}
|
|
39
39
|
const authType = args.options.authType || cli.getSettingWithDefaultValue(settingsNames.authType, 'deviceCode');
|
|
40
|
-
auth.connection.appId = args.options.appId || config.
|
|
40
|
+
auth.connection.appId = args.options.appId || config.cliEntraAppId;
|
|
41
41
|
auth.connection.tenant = args.options.tenant || config.tenant;
|
|
42
42
|
auth.connection.name = args.options.connectionName;
|
|
43
43
|
switch (authType) {
|
|
@@ -25,6 +25,7 @@ class EntraAdministrativeUnitAddCommand extends GraphCommand {
|
|
|
25
25
|
__classPrivateFieldGet(this, _EntraAdministrativeUnitAddCommand_instances, "m", _EntraAdministrativeUnitAddCommand_initOptions).call(this);
|
|
26
26
|
}
|
|
27
27
|
async commandAction(logger, args) {
|
|
28
|
+
await this.showDeprecationWarning(logger, aadCommands.ADMINISTRATIVEUNIT_ADD, commands.ADMINISTRATIVEUNIT_ADD);
|
|
28
29
|
const requestOptions = {
|
|
29
30
|
url: `${this.resource}/v1.0/directory/administrativeUnits`,
|
|
30
31
|
headers: {
|
|
@@ -30,6 +30,7 @@ class EntraAdministrativeUnitGetCommand extends GraphCommand {
|
|
|
30
30
|
__classPrivateFieldGet(this, _EntraAdministrativeUnitGetCommand_instances, "m", _EntraAdministrativeUnitGetCommand_initTypes).call(this);
|
|
31
31
|
}
|
|
32
32
|
async commandAction(logger, args) {
|
|
33
|
+
await this.showDeprecationWarning(logger, aadCommands.ADMINISTRATIVEUNIT_GET, commands.ADMINISTRATIVEUNIT_GET);
|
|
33
34
|
let administrativeUnit;
|
|
34
35
|
try {
|
|
35
36
|
if (args.options.id) {
|
|
@@ -16,6 +16,7 @@ class EntraAdministrativeUnitListCommand extends GraphCommand {
|
|
|
16
16
|
return ['id', 'displayName', 'visibility'];
|
|
17
17
|
}
|
|
18
18
|
async commandAction(logger) {
|
|
19
|
+
await this.showDeprecationWarning(logger, aadCommands.ADMINISTRATIVEUNIT_LIST, commands.ADMINISTRATIVEUNIT_LIST);
|
|
19
20
|
try {
|
|
20
21
|
const results = await odata.getAllItems(`${this.resource}/v1.0/directory/administrativeUnits`);
|
|
21
22
|
await logger.log(results);
|
|
@@ -32,6 +32,7 @@ class EntraAdministrativeUnitMemberAddCommand extends GraphCommand {
|
|
|
32
32
|
__classPrivateFieldGet(this, _EntraAdministrativeUnitMemberAddCommand_instances, "m", _EntraAdministrativeUnitMemberAddCommand_initOptionSets).call(this);
|
|
33
33
|
}
|
|
34
34
|
async commandAction(logger, args) {
|
|
35
|
+
await this.showDeprecationWarning(logger, aadCommands.ADMINISTRATIVEUNIT_MEMBER_ADD, commands.ADMINISTRATIVEUNIT_MEMBER_ADD);
|
|
35
36
|
let administrativeUnitId = args.options.administrativeUnitId;
|
|
36
37
|
let memberType;
|
|
37
38
|
let memberId;
|
|
@@ -29,6 +29,7 @@ class EntraAdministrativeUnitMemberGetCommand extends GraphCommand {
|
|
|
29
29
|
__classPrivateFieldGet(this, _EntraAdministrativeUnitMemberGetCommand_instances, "m", _EntraAdministrativeUnitMemberGetCommand_initOptionSets).call(this);
|
|
30
30
|
}
|
|
31
31
|
async commandAction(logger, args) {
|
|
32
|
+
await this.showDeprecationWarning(logger, aadCommands.ADMINISTRATIVEUNIT_MEMBER_GET, commands.ADMINISTRATIVEUNIT_MEMBER_GET);
|
|
32
33
|
let administrativeUnitId = args.options.administrativeUnitId;
|
|
33
34
|
try {
|
|
34
35
|
if (args.options.administrativeUnitName) {
|
|
@@ -32,6 +32,7 @@ class EntraAdministrativeUnitMemberListCommand extends GraphCommand {
|
|
|
32
32
|
__classPrivateFieldGet(this, _EntraAdministrativeUnitMemberListCommand_instances, "m", _EntraAdministrativeUnitMemberListCommand_initOptionSets).call(this);
|
|
33
33
|
}
|
|
34
34
|
async commandAction(logger, args) {
|
|
35
|
+
await this.showDeprecationWarning(logger, aadCommands.ADMINISTRATIVEUNIT_MEMBER_LIST, commands.ADMINISTRATIVEUNIT_MEMBER_LIST);
|
|
35
36
|
let administrativeUnitId = args.options.administrativeUnitId;
|
|
36
37
|
try {
|
|
37
38
|
if (args.options.administrativeUnitName) {
|
|
@@ -31,6 +31,7 @@ class EntraAdministrativeUnitRemoveCommand extends GraphCommand {
|
|
|
31
31
|
__classPrivateFieldGet(this, _EntraAdministrativeUnitRemoveCommand_instances, "m", _EntraAdministrativeUnitRemoveCommand_initTypes).call(this);
|
|
32
32
|
}
|
|
33
33
|
async commandAction(logger, args) {
|
|
34
|
+
await this.showDeprecationWarning(logger, aadCommands.ADMINISTRATIVEUNIT_REMOVE, commands.ADMINISTRATIVEUNIT_REMOVE);
|
|
34
35
|
const removeAdministrativeUnit = async () => {
|
|
35
36
|
try {
|
|
36
37
|
let administrativeUnitId = args.options.id;
|
|
@@ -34,12 +34,13 @@ class EntraAppAddCommand extends GraphCommand {
|
|
|
34
34
|
__classPrivateFieldGet(this, _EntraAppAddCommand_instances, "m", _EntraAppAddCommand_initOptionSets).call(this);
|
|
35
35
|
}
|
|
36
36
|
async commandAction(logger, args) {
|
|
37
|
+
await this.showDeprecationWarning(logger, aadCommands.APP_ADD, commands.APP_ADD);
|
|
37
38
|
try {
|
|
38
39
|
const apis = await this.resolveApis(args, logger);
|
|
39
40
|
let appInfo = await this.createAppRegistration(args, apis, logger);
|
|
40
|
-
// based on the assumption that we're adding
|
|
41
|
+
// based on the assumption that we're adding Microsoft Entra app to the current
|
|
41
42
|
// directory. If we in the future extend the command with allowing
|
|
42
|
-
// users to create
|
|
43
|
+
// users to create Microsoft Entra app in a different directory, we'll need to
|
|
43
44
|
// adjust this
|
|
44
45
|
appInfo.tenantId = accessToken.getTenantIdFromAccessToken(auth.connection.accessTokens[auth.defaultResource].accessToken);
|
|
45
46
|
appInfo = await this.updateAppFromManifest(args, appInfo);
|
|
@@ -98,7 +99,7 @@ class EntraAppAddCommand extends GraphCommand {
|
|
|
98
99
|
applicationInfo.keyCredentials = [newKeyCredential];
|
|
99
100
|
}
|
|
100
101
|
if (this.verbose) {
|
|
101
|
-
await logger.logToStderr(`Creating
|
|
102
|
+
await logger.logToStderr(`Creating Microsoft Entra app registration...`);
|
|
102
103
|
}
|
|
103
104
|
const createApplicationRequestOptions = {
|
|
104
105
|
url: `${this.resource}/v1.0/myorganization/applications`,
|
|
@@ -390,7 +391,7 @@ class EntraAppAddCommand extends GraphCommand {
|
|
|
390
391
|
return appInfo;
|
|
391
392
|
}
|
|
392
393
|
if (this.verbose) {
|
|
393
|
-
await logger.logToStderr(`Configuring
|
|
394
|
+
await logger.logToStderr(`Configuring Microsoft Entra application ID URI...`);
|
|
394
395
|
}
|
|
395
396
|
const applicationInfo = {};
|
|
396
397
|
if (args.options.uri) {
|
|
@@ -544,7 +545,7 @@ class EntraAppAddCommand extends GraphCommand {
|
|
|
544
545
|
return appInfo;
|
|
545
546
|
}
|
|
546
547
|
if (this.verbose) {
|
|
547
|
-
await logger.logToStderr(`Configure
|
|
548
|
+
await logger.logToStderr(`Configure Microsoft Entra app secret...`);
|
|
548
549
|
}
|
|
549
550
|
const secret = await this.createSecret({ appObjectId: appInfo.id });
|
|
550
551
|
if (!appInfo.secrets) {
|
|
@@ -599,7 +600,7 @@ class EntraAppAddCommand extends GraphCommand {
|
|
|
599
600
|
}
|
|
600
601
|
const filePath = '.m365rc.json';
|
|
601
602
|
if (this.verbose) {
|
|
602
|
-
await logger.logToStderr(`Saving
|
|
603
|
+
await logger.logToStderr(`Saving Microsoft Entra app registration information to the ${filePath} file...`);
|
|
603
604
|
}
|
|
604
605
|
let m365rc = {};
|
|
605
606
|
if (fs.existsSync(filePath)) {
|
|
@@ -31,6 +31,7 @@ class EntraAppGetCommand extends GraphCommand {
|
|
|
31
31
|
__classPrivateFieldGet(this, _EntraAppGetCommand_instances, "m", _EntraAppGetCommand_initOptionSets).call(this);
|
|
32
32
|
}
|
|
33
33
|
async commandAction(logger, args) {
|
|
34
|
+
await this.showDeprecationWarning(logger, aadCommands.APP_GET, commands.APP_GET);
|
|
34
35
|
try {
|
|
35
36
|
const appObjectId = await this.getAppObjectId(args);
|
|
36
37
|
const appInfo = await this.getAppInfo(appObjectId);
|
|
@@ -62,10 +63,10 @@ class EntraAppGetCommand extends GraphCommand {
|
|
|
62
63
|
}
|
|
63
64
|
if (res.value.length === 0) {
|
|
64
65
|
const applicationIdentifier = appId ? `ID ${appId}` : `name ${name}`;
|
|
65
|
-
throw `No
|
|
66
|
+
throw `No Microsoft Entra application registration with ${applicationIdentifier} found`;
|
|
66
67
|
}
|
|
67
68
|
const resultAsKeyValuePair = formatting.convertArrayToHashTable('id', res.value);
|
|
68
|
-
const result = await cli.handleMultipleResultsFound(`Multiple
|
|
69
|
+
const result = await cli.handleMultipleResultsFound(`Multiple Microsoft Entra application registrations with name '${name}' found.`, resultAsKeyValuePair);
|
|
69
70
|
return result.id;
|
|
70
71
|
}
|
|
71
72
|
async getAppInfo(appObjectId) {
|
|
@@ -84,7 +85,7 @@ class EntraAppGetCommand extends GraphCommand {
|
|
|
84
85
|
}
|
|
85
86
|
const filePath = '.m365rc.json';
|
|
86
87
|
if (this.verbose) {
|
|
87
|
-
await logger.logToStderr(`Saving
|
|
88
|
+
await logger.logToStderr(`Saving Microsoft Entra app registration information to the ${filePath} file...`);
|
|
88
89
|
}
|
|
89
90
|
let m365rc = {};
|
|
90
91
|
if (fs.existsSync(filePath)) {
|
|
@@ -16,6 +16,7 @@ class EntraAppListCommand extends GraphCommand {
|
|
|
16
16
|
return ['appId', 'id', 'displayName', "signInAudience"];
|
|
17
17
|
}
|
|
18
18
|
async commandAction(logger) {
|
|
19
|
+
await this.showDeprecationWarning(logger, aadCommands.APP_LIST, commands.APP_LIST);
|
|
19
20
|
try {
|
|
20
21
|
const results = await odata.getAllItems(`${this.resource}/v1.0/applications`);
|
|
21
22
|
await logger.log(results);
|
|
@@ -20,7 +20,7 @@ class EntraAppPermissionAddCommand extends GraphCommand {
|
|
|
20
20
|
return commands.APP_PERMISSION_ADD;
|
|
21
21
|
}
|
|
22
22
|
get description() {
|
|
23
|
-
return 'Adds the specified application and/or delegated permissions to a specified Entra
|
|
23
|
+
return 'Adds the specified application and/or delegated permissions to a specified Microsoft Entra app';
|
|
24
24
|
}
|
|
25
25
|
alias() {
|
|
26
26
|
return [aadCommands.APP_PERMISSION_ADD, commands.APPREGISTRATION_PERMISSION_ADD];
|
|
@@ -34,6 +34,7 @@ class EntraAppPermissionAddCommand extends GraphCommand {
|
|
|
34
34
|
__classPrivateFieldGet(this, _EntraAppPermissionAddCommand_instances, "m", _EntraAppPermissionAddCommand_initOptionSets).call(this);
|
|
35
35
|
}
|
|
36
36
|
async commandAction(logger, args) {
|
|
37
|
+
await this.showDeprecationWarning(logger, aadCommands.APP_PERMISSION_ADD, commands.APP_PERMISSION_ADD);
|
|
37
38
|
try {
|
|
38
39
|
const appObject = await this.getAppObject(args.options);
|
|
39
40
|
const servicePrincipals = await this.getServicePrincipals();
|
|
@@ -71,7 +72,7 @@ class EntraAppPermissionAddCommand extends GraphCommand {
|
|
|
71
72
|
? await odata.getAllItems(`${this.resource}/v1.0/applications?$filter=id eq '${options.appObjectId}'&$select=id,appId,requiredResourceAccess`)
|
|
72
73
|
: await odata.getAllItems(`${this.resource}/v1.0/applications?$filter=appId eq '${options.appId}'&$select=id,appId,requiredResourceAccess`);
|
|
73
74
|
if (apps.length === 0) {
|
|
74
|
-
throw `App with ${options.appObjectId ? 'object id' : 'client id'} ${options.appObjectId ? options.appObjectId : options.appId} not found in Entra ID
|
|
75
|
+
throw `App with ${options.appObjectId ? 'object id' : 'client id'} ${options.appObjectId ? options.appObjectId : options.appId} not found in Microsoft Entra ID`;
|
|
75
76
|
}
|
|
76
77
|
return apps[0];
|
|
77
78
|
}
|
|
@@ -49,7 +49,7 @@ class EntraAppPermissionListCommand extends GraphCommand {
|
|
|
49
49
|
};
|
|
50
50
|
const res = await request.get(requestOptions);
|
|
51
51
|
if (res.value.length === 0) {
|
|
52
|
-
throw `No
|
|
52
|
+
throw `No Microsoft Entra application registration with ID ${options.appId} found`;
|
|
53
53
|
}
|
|
54
54
|
return res.value[0].id;
|
|
55
55
|
}
|
|
@@ -30,11 +30,12 @@ class EntraAppRemoveCommand extends GraphCommand {
|
|
|
30
30
|
__classPrivateFieldGet(this, _EntraAppRemoveCommand_instances, "m", _EntraAppRemoveCommand_initOptionSets).call(this);
|
|
31
31
|
}
|
|
32
32
|
async commandAction(logger, args) {
|
|
33
|
+
await this.showDeprecationWarning(logger, aadCommands.APP_REMOVE, commands.APP_REMOVE);
|
|
33
34
|
const deleteApp = async () => {
|
|
34
35
|
try {
|
|
35
36
|
const objectId = await this.getObjectId(args, logger);
|
|
36
37
|
if (this.verbose) {
|
|
37
|
-
await logger.logToStderr(`Deleting
|
|
38
|
+
await logger.logToStderr(`Deleting Microsoft Entra app ${objectId}...`);
|
|
38
39
|
}
|
|
39
40
|
const requestOptions = {
|
|
40
41
|
url: `${this.resource}/v1.0/myorganization/applications/${objectId}`,
|
|
@@ -65,7 +66,7 @@ class EntraAppRemoveCommand extends GraphCommand {
|
|
|
65
66
|
}
|
|
66
67
|
const { appId, name } = args.options;
|
|
67
68
|
if (this.verbose) {
|
|
68
|
-
await logger.logToStderr(`Retrieving information about
|
|
69
|
+
await logger.logToStderr(`Retrieving information about Microsoft Entra app ${appId ? appId : name}...`);
|
|
69
70
|
}
|
|
70
71
|
const filter = appId ?
|
|
71
72
|
`appId eq '${formatting.encodeQueryParameter(appId)}'` :
|
|
@@ -83,10 +84,10 @@ class EntraAppRemoveCommand extends GraphCommand {
|
|
|
83
84
|
}
|
|
84
85
|
if (res.value.length === 0) {
|
|
85
86
|
const applicationIdentifier = appId ? `ID ${appId}` : `name ${name}`;
|
|
86
|
-
throw `No
|
|
87
|
+
throw `No Microsoft Entra application registration with ${applicationIdentifier} found`;
|
|
87
88
|
}
|
|
88
89
|
const resultAsKeyValuePair = formatting.convertArrayToHashTable('id', res.value);
|
|
89
|
-
const result = await cli.handleMultipleResultsFound(`Multiple
|
|
90
|
+
const result = await cli.handleMultipleResultsFound(`Multiple Microsoft Entra application registration with name '${name}' found.`, resultAsKeyValuePair);
|
|
90
91
|
return result.id;
|
|
91
92
|
}
|
|
92
93
|
}
|
|
@@ -30,11 +30,12 @@ class EntraAppRoleAddCommand extends GraphCommand {
|
|
|
30
30
|
__classPrivateFieldGet(this, _EntraAppRoleAddCommand_instances, "m", _EntraAppRoleAddCommand_initOptionSets).call(this);
|
|
31
31
|
}
|
|
32
32
|
async commandAction(logger, args) {
|
|
33
|
+
await this.showDeprecationWarning(logger, aadCommands.APP_ROLE_ADD, commands.APP_ROLE_ADD);
|
|
33
34
|
try {
|
|
34
35
|
const appId = await this.getAppObjectId(args, logger);
|
|
35
36
|
const appInfo = await this.getAppInfo(appId, logger);
|
|
36
37
|
if (this.verbose) {
|
|
37
|
-
await logger.logToStderr(`Adding role ${args.options.name} to
|
|
38
|
+
await logger.logToStderr(`Adding role ${args.options.name} to Microsoft Entra app ${appInfo.id}...`);
|
|
38
39
|
}
|
|
39
40
|
const requestOptions = {
|
|
40
41
|
url: `${this.resource}/v1.0/myorganization/applications/${appInfo.id}`,
|
|
@@ -60,7 +61,7 @@ class EntraAppRoleAddCommand extends GraphCommand {
|
|
|
60
61
|
}
|
|
61
62
|
async getAppInfo(appId, logger) {
|
|
62
63
|
if (this.verbose) {
|
|
63
|
-
await logger.logToStderr(`Retrieving information about roles for
|
|
64
|
+
await logger.logToStderr(`Retrieving information about roles for Microsoft Entra app ${appId}...`);
|
|
64
65
|
}
|
|
65
66
|
const requestOptions = {
|
|
66
67
|
url: `${this.resource}/v1.0/myorganization/applications/${appId}?$select=id,appRoles`,
|
|
@@ -89,7 +90,7 @@ class EntraAppRoleAddCommand extends GraphCommand {
|
|
|
89
90
|
}
|
|
90
91
|
const { appId, appName } = args.options;
|
|
91
92
|
if (this.verbose) {
|
|
92
|
-
await logger.logToStderr(`Retrieving information about
|
|
93
|
+
await logger.logToStderr(`Retrieving information about Microsoft Entra app ${appId ? appId : appName}...`);
|
|
93
94
|
}
|
|
94
95
|
const filter = appId ?
|
|
95
96
|
`appId eq '${formatting.encodeQueryParameter(appId)}'` :
|
|
@@ -107,10 +108,10 @@ class EntraAppRoleAddCommand extends GraphCommand {
|
|
|
107
108
|
}
|
|
108
109
|
if (res.value.length === 0) {
|
|
109
110
|
const applicationIdentifier = appId ? `ID ${appId}` : `name ${appName}`;
|
|
110
|
-
throw `No
|
|
111
|
+
throw `No Microsoft Entra application registration with ${applicationIdentifier} found`;
|
|
111
112
|
}
|
|
112
113
|
const resultAsKeyValuePair = formatting.convertArrayToHashTable('id', res.value);
|
|
113
|
-
const result = await cli.handleMultipleResultsFound(`Multiple
|
|
114
|
+
const result = await cli.handleMultipleResultsFound(`Multiple Microsoft Entra application registrations with name '${appName}' found.`, resultAsKeyValuePair);
|
|
114
115
|
return result.id;
|
|
115
116
|
}
|
|
116
117
|
}
|
|
@@ -32,6 +32,7 @@ class EntraAppRoleListCommand extends GraphCommand {
|
|
|
32
32
|
return ['displayName', 'description', 'id'];
|
|
33
33
|
}
|
|
34
34
|
async commandAction(logger, args) {
|
|
35
|
+
await this.showDeprecationWarning(logger, aadCommands.APP_ROLE_LIST, commands.APP_ROLE_LIST);
|
|
35
36
|
try {
|
|
36
37
|
const objectId = await this.getAppObjectId(args, logger);
|
|
37
38
|
const appRoles = await odata.getAllItems(`${this.resource}/v1.0/myorganization/applications/${objectId}/appRoles`);
|
|
@@ -47,7 +48,7 @@ class EntraAppRoleListCommand extends GraphCommand {
|
|
|
47
48
|
}
|
|
48
49
|
const { appId, appName } = args.options;
|
|
49
50
|
if (this.verbose) {
|
|
50
|
-
await logger.logToStderr(`Retrieving information about
|
|
51
|
+
await logger.logToStderr(`Retrieving information about Microsoft Entra app ${appId ? appId : appName}...`);
|
|
51
52
|
}
|
|
52
53
|
const filter = appId ?
|
|
53
54
|
`appId eq '${formatting.encodeQueryParameter(appId)}'` :
|
|
@@ -65,10 +66,10 @@ class EntraAppRoleListCommand extends GraphCommand {
|
|
|
65
66
|
}
|
|
66
67
|
if (res.value.length === 0) {
|
|
67
68
|
const applicationIdentifier = appId ? `ID ${appId}` : `name ${appName}`;
|
|
68
|
-
throw `No
|
|
69
|
+
throw `No Microsoft Entra application registration with ${applicationIdentifier} found`;
|
|
69
70
|
}
|
|
70
71
|
const resultAsKeyValuePair = formatting.convertArrayToHashTable('id', res.value);
|
|
71
|
-
const result = await cli.handleMultipleResultsFound(`Multiple
|
|
72
|
+
const result = await cli.handleMultipleResultsFound(`Multiple Microsoft Entra application registrations with name '${appName}' found.`, resultAsKeyValuePair);
|
|
72
73
|
return result.id;
|
|
73
74
|
}
|
|
74
75
|
}
|
|
@@ -30,6 +30,7 @@ class EntraAppRoleRemoveCommand extends GraphCommand {
|
|
|
30
30
|
__classPrivateFieldGet(this, _EntraAppRoleRemoveCommand_instances, "m", _EntraAppRoleRemoveCommand_initOptionSets).call(this);
|
|
31
31
|
}
|
|
32
32
|
async commandAction(logger, args) {
|
|
33
|
+
await this.showDeprecationWarning(logger, aadCommands.APP_ROLE_REMOVE, commands.APP_ROLE_REMOVE);
|
|
33
34
|
const deleteAppRole = async () => {
|
|
34
35
|
try {
|
|
35
36
|
await this.processAppRoleDelete(logger, args);
|
|
@@ -53,7 +54,7 @@ class EntraAppRoleRemoveCommand extends GraphCommand {
|
|
|
53
54
|
const aadApp = await this.getAadApp(appObjectId, logger);
|
|
54
55
|
const appRoleDeleteIdentifierNameValue = args.options.name ? `name '${args.options.name}'` : (args.options.claim ? `claim '${args.options.claim}'` : `id '${args.options.id}'`);
|
|
55
56
|
if (this.verbose) {
|
|
56
|
-
await logger.logToStderr(`Deleting role with ${appRoleDeleteIdentifierNameValue} from
|
|
57
|
+
await logger.logToStderr(`Deleting role with ${appRoleDeleteIdentifierNameValue} from Microsoft Entra app ${aadApp.id}...`);
|
|
57
58
|
}
|
|
58
59
|
// Find the role search criteria provided by the user.
|
|
59
60
|
const appRoleDeleteIdentifierProperty = args.options.name ? `displayName` : (args.options.claim ? `value` : `id`);
|
|
@@ -114,7 +115,7 @@ class EntraAppRoleRemoveCommand extends GraphCommand {
|
|
|
114
115
|
}
|
|
115
116
|
async getAadApp(appId, logger) {
|
|
116
117
|
if (this.verbose) {
|
|
117
|
-
await logger.logToStderr(`Retrieving app roles information for the
|
|
118
|
+
await logger.logToStderr(`Retrieving app roles information for the Microsoft Entra app ${appId}...`);
|
|
118
119
|
}
|
|
119
120
|
const requestOptions = {
|
|
120
121
|
url: `${this.resource}/v1.0/myorganization/applications/${appId}?$select=id,appRoles`,
|
|
@@ -131,7 +132,7 @@ class EntraAppRoleRemoveCommand extends GraphCommand {
|
|
|
131
132
|
}
|
|
132
133
|
const { appId, appName } = args.options;
|
|
133
134
|
if (this.verbose) {
|
|
134
|
-
await logger.logToStderr(`Retrieving information about
|
|
135
|
+
await logger.logToStderr(`Retrieving information about Microsoft Entra app ${appId ? appId : appName}...`);
|
|
135
136
|
}
|
|
136
137
|
const filter = appId ?
|
|
137
138
|
`appId eq '${formatting.encodeQueryParameter(appId)}'` :
|
|
@@ -149,10 +150,10 @@ class EntraAppRoleRemoveCommand extends GraphCommand {
|
|
|
149
150
|
}
|
|
150
151
|
if (res.value.length === 0) {
|
|
151
152
|
const applicationIdentifier = appId ? `ID ${appId}` : `name ${appName}`;
|
|
152
|
-
throw `No
|
|
153
|
+
throw `No Microsoft Entra application registration with ${applicationIdentifier} found`;
|
|
153
154
|
}
|
|
154
155
|
const resultAsKeyValuePair = formatting.convertArrayToHashTable('id', res.value);
|
|
155
|
-
const result = (await cli.handleMultipleResultsFound(`Multiple
|
|
156
|
+
const result = (await cli.handleMultipleResultsFound(`Multiple Microsoft Entra application registrations with name '${appName}' found.`, resultAsKeyValuePair));
|
|
156
157
|
return result.id;
|
|
157
158
|
}
|
|
158
159
|
}
|
|
@@ -30,6 +30,7 @@ class EntraAppSetCommand extends GraphCommand {
|
|
|
30
30
|
__classPrivateFieldGet(this, _EntraAppSetCommand_instances, "m", _EntraAppSetCommand_initOptionSets).call(this);
|
|
31
31
|
}
|
|
32
32
|
async commandAction(logger, args) {
|
|
33
|
+
await this.showDeprecationWarning(logger, aadCommands.APP_SET, commands.APP_SET);
|
|
33
34
|
try {
|
|
34
35
|
let objectId = await this.getAppObjectId(args, logger);
|
|
35
36
|
objectId = await this.configureUri(args, objectId, logger);
|
|
@@ -46,7 +47,7 @@ class EntraAppSetCommand extends GraphCommand {
|
|
|
46
47
|
}
|
|
47
48
|
const { appId, name } = args.options;
|
|
48
49
|
if (this.verbose) {
|
|
49
|
-
await logger.logToStderr(`Retrieving information about
|
|
50
|
+
await logger.logToStderr(`Retrieving information about Microsoft Entra app ${appId ? appId : name}...`);
|
|
50
51
|
}
|
|
51
52
|
const filter = appId ?
|
|
52
53
|
`appId eq '${formatting.encodeQueryParameter(appId)}'` :
|
|
@@ -64,10 +65,10 @@ class EntraAppSetCommand extends GraphCommand {
|
|
|
64
65
|
}
|
|
65
66
|
if (res.value.length === 0) {
|
|
66
67
|
const applicationIdentifier = appId ? `ID ${appId}` : `name ${name}`;
|
|
67
|
-
throw `No
|
|
68
|
+
throw `No Microsoft Entra application registration with ${applicationIdentifier} found`;
|
|
68
69
|
}
|
|
69
70
|
const resultAsKeyValuePair = formatting.convertArrayToHashTable('id', res.value);
|
|
70
|
-
const result = await cli.handleMultipleResultsFound(`Multiple
|
|
71
|
+
const result = await cli.handleMultipleResultsFound(`Multiple Microsoft Entra application registration with name '${name}' found.`, resultAsKeyValuePair);
|
|
71
72
|
return result.id;
|
|
72
73
|
}
|
|
73
74
|
async configureUri(args, objectId, logger) {
|
|
@@ -75,7 +76,7 @@ class EntraAppSetCommand extends GraphCommand {
|
|
|
75
76
|
return objectId;
|
|
76
77
|
}
|
|
77
78
|
if (this.verbose) {
|
|
78
|
-
await logger.logToStderr(`Configuring
|
|
79
|
+
await logger.logToStderr(`Configuring Microsoft Entra application ID URI...`);
|
|
79
80
|
}
|
|
80
81
|
const identifierUris = args.options.uris
|
|
81
82
|
.split(',')
|
|
@@ -99,7 +100,7 @@ class EntraAppSetCommand extends GraphCommand {
|
|
|
99
100
|
return objectId;
|
|
100
101
|
}
|
|
101
102
|
if (this.verbose) {
|
|
102
|
-
await logger.logToStderr(`Configuring
|
|
103
|
+
await logger.logToStderr(`Configuring Microsoft Entra application redirect URIs...`);
|
|
103
104
|
}
|
|
104
105
|
const getAppRequestOptions = {
|
|
105
106
|
url: `${this.resource}/v1.0/myorganization/applications/${objectId}`,
|
|
@@ -171,7 +172,7 @@ class EntraAppSetCommand extends GraphCommand {
|
|
|
171
172
|
return;
|
|
172
173
|
}
|
|
173
174
|
if (this.verbose) {
|
|
174
|
-
await logger.logToStderr(`Setting certificate for
|
|
175
|
+
await logger.logToStderr(`Setting certificate for Microsoft Entra app...`);
|
|
175
176
|
}
|
|
176
177
|
const certificateBase64Encoded = await this.getCertificateBase64Encoded(args, logger);
|
|
177
178
|
const currentKeyCredentials = await this.getCurrentKeyCredentialsList(args, objectId, certificateBase64Encoded, logger);
|
|
@@ -221,7 +222,7 @@ class EntraAppSetCommand extends GraphCommand {
|
|
|
221
222
|
}
|
|
222
223
|
async updateKeyCredentials(objectId, keyCredentials, logger) {
|
|
223
224
|
if (this.verbose) {
|
|
224
|
-
await logger.logToStderr(`Updating keyCredentials in
|
|
225
|
+
await logger.logToStderr(`Updating keyCredentials in Microsoft Entra app`);
|
|
225
226
|
}
|
|
226
227
|
const requestOptions = {
|
|
227
228
|
url: `${this.resource}/v1.0/myorganization/applications/${objectId}`,
|
|
@@ -17,7 +17,7 @@ class EntraAppRoleAssignmentAddCommand extends GraphCommand {
|
|
|
17
17
|
return commands.APPROLEASSIGNMENT_ADD;
|
|
18
18
|
}
|
|
19
19
|
get description() {
|
|
20
|
-
return 'Adds service principal permissions also known as scopes and app role assignments for specified Entra application registration';
|
|
20
|
+
return 'Adds service principal permissions also known as scopes and app role assignments for specified Microsoft Entra application registration';
|
|
21
21
|
}
|
|
22
22
|
alias() {
|
|
23
23
|
return [aadCommands.APPROLEASSIGNMENT_ADD];
|
|
@@ -31,6 +31,7 @@ class EntraAppRoleAssignmentAddCommand extends GraphCommand {
|
|
|
31
31
|
__classPrivateFieldGet(this, _EntraAppRoleAssignmentAddCommand_instances, "m", _EntraAppRoleAssignmentAddCommand_initOptionSets).call(this);
|
|
32
32
|
}
|
|
33
33
|
async commandAction(logger, args) {
|
|
34
|
+
await this.showDeprecationWarning(logger, aadCommands.APPROLEASSIGNMENT_ADD, commands.APPROLEASSIGNMENT_ADD);
|
|
34
35
|
let objectId = '';
|
|
35
36
|
let queryFilter = '';
|
|
36
37
|
if (args.options.appId) {
|
|
@@ -32,6 +32,7 @@ class EntraAppRoleAssignmentListCommand extends GraphCommand {
|
|
|
32
32
|
return ['resourceDisplayName', 'roleName'];
|
|
33
33
|
}
|
|
34
34
|
async commandAction(logger, args) {
|
|
35
|
+
await this.showDeprecationWarning(logger, aadCommands.APPROLEASSIGNMENT_LIST, commands.APPROLEASSIGNMENT_LIST);
|
|
35
36
|
try {
|
|
36
37
|
const spAppRoleAssignments = await this.getAppRoleAssignments(args.options);
|
|
37
38
|
// the role assignment has an appRoleId but no name. To get the name,
|
|
@@ -31,6 +31,7 @@ class EntraAppRoleAssignmentRemoveCommand extends GraphCommand {
|
|
|
31
31
|
__classPrivateFieldGet(this, _EntraAppRoleAssignmentRemoveCommand_instances, "m", _EntraAppRoleAssignmentRemoveCommand_initOptionSets).call(this);
|
|
32
32
|
}
|
|
33
33
|
async commandAction(logger, args) {
|
|
34
|
+
await this.showDeprecationWarning(logger, aadCommands.APPROLEASSIGNMENT_REMOVE, commands.APPROLEASSIGNMENT_REMOVE);
|
|
34
35
|
const removeAppRoleAssignment = async () => {
|
|
35
36
|
let sp;
|
|
36
37
|
// get the service principal associated with the appId
|
|
@@ -60,6 +60,7 @@ class EntraEnterpriseAppAddCommand extends GraphCommand {
|
|
|
60
60
|
return spItem.appId;
|
|
61
61
|
}
|
|
62
62
|
async commandAction(logger, args) {
|
|
63
|
+
await this.showDeprecationWarning(logger, aadCommands.SP_ADD, commands.SP_ADD);
|
|
63
64
|
try {
|
|
64
65
|
const appId = await this.getAppId(args);
|
|
65
66
|
const requestOptions = {
|
|
@@ -60,6 +60,7 @@ class EntraEnterpriseAppGetCommand extends GraphCommand {
|
|
|
60
60
|
return spItem.id;
|
|
61
61
|
}
|
|
62
62
|
async commandAction(logger, args) {
|
|
63
|
+
await this.showDeprecationWarning(logger, aadCommands.SP_GET, commands.SP_GET);
|
|
63
64
|
if (this.verbose) {
|
|
64
65
|
await logger.logToStderr(`Retrieving enterprise application information...`);
|
|
65
66
|
}
|