feat(graph): add --resolve for list-app-permissions
This commit is contained in:
15
src/cli.js
15
src/cli.js
@@ -7,7 +7,12 @@ import jmespath from "jmespath";
|
||||
|
||||
import { loadPublicConfig } from "./index.js";
|
||||
import { getGraphClient } from "./graph/auth.js";
|
||||
import { listApps, listAppPermissions, listAppGrants } from "./graph/app.js";
|
||||
import {
|
||||
listApps,
|
||||
listAppPermissions,
|
||||
listAppPermissionsResolved,
|
||||
listAppGrants,
|
||||
} from "./graph/app.js";
|
||||
import { toMarkdownTable } from "./markdown.js";
|
||||
|
||||
function usage() {
|
||||
@@ -15,13 +20,14 @@ function usage() {
|
||||
|
||||
Commands:
|
||||
list-apps [--display-name <name>]
|
||||
list-app-permissions --app-id <appId>
|
||||
list-app-permissions --app-id <appId> [--resolve]
|
||||
list-app-grants --app-id <appId>
|
||||
table [--pretty]
|
||||
|
||||
Options:
|
||||
--display-name <name> Filter apps by exact display name
|
||||
--app-id <appId> Application (client) ID
|
||||
--resolve Resolve permission GUIDs to human-readable values
|
||||
--query <jmespath> Filter output JSON using JMESPath
|
||||
--pretty Use normalized column widths for Markdown table output
|
||||
--output <format> Output format: json|table|prettytable (default: json)
|
||||
@@ -73,6 +79,7 @@ async function main() {
|
||||
help: { type: "boolean", short: "h" },
|
||||
"display-name": { type: "string" },
|
||||
"app-id": { type: "string" },
|
||||
resolve: { type: "boolean" },
|
||||
query: { type: "string" },
|
||||
pretty: { type: "boolean" },
|
||||
output: { type: "string" },
|
||||
@@ -117,7 +124,9 @@ async function main() {
|
||||
tenantId: config.tenantId,
|
||||
clientId: config.clientId,
|
||||
});
|
||||
result = await listAppPermissions(client, values["app-id"]);
|
||||
result = values.resolve
|
||||
? await listAppPermissionsResolved(client, values["app-id"])
|
||||
: await listAppPermissions(client, values["app-id"]);
|
||||
}
|
||||
break;
|
||||
case "list-app-grants":
|
||||
|
||||
Reference in New Issue
Block a user