Files
sk-az-tools/src/cli/commands/list-app-grants.ts
Slawomir Koszewski 9fd770999b
All checks were successful
build / build (push) Successful in 14s
Migrated from parseArgs from node:util to commander.js.
2026-03-10 07:15:00 +01:00

25 lines
682 B
TypeScript

// SPDX-License-Identifier: MIT
import { listAppGrants } from "../../graph/app.ts";
import { getGraphClient } from "../../graph/index.ts";
type ListAppGrantsOptions = {
appId?: string;
};
export function usageListAppGrants(): string {
return `Usage: sk-az-tools list-app-grants --app-id|-i <appId> [global options]
Options:
--app-id, -i <appId> Application (client) ID (required)`;
}
export async function runListAppGrantsCommand(options: ListAppGrantsOptions): Promise<unknown> {
if (!options.appId) {
throw new Error("--app-id is required for list-app-grants");
}
const client = await getGraphClient();
return listAppGrants(client, options.appId);
}