23 lines
705 B
TypeScript
23 lines
705 B
TypeScript
// SPDX-License-Identifier: MIT
|
|
|
|
import { listAppGrants } from "../../graph/app.ts";
|
|
|
|
import { getGraphClientFromPublicConfig } from "./shared.ts";
|
|
import type { CommandValues } from "./types.ts";
|
|
|
|
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(values: CommandValues): Promise<unknown> {
|
|
if (!values["app-id"]) {
|
|
throw new Error("--app-id is required for list-app-grants");
|
|
}
|
|
|
|
const { client } = await getGraphClientFromPublicConfig();
|
|
return listAppGrants(client, values["app-id"]);
|
|
}
|