25 lines
682 B
TypeScript
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);
|
|
}
|