Skip to content
Source
Sign inSign up
pingdotgg/t3code
Open History to see the last commit

authScopes.ts

11 lines475 Bytes

1import { AuthGrantScope } from "@t3tools/contracts";
2import { Flag } from "effect/cli";
3​
4export const authScopesFlag = (defaults: ReadonlyArray<AuthGrantScope>) =>
5 Flag.Literals("scope", AuthGrantScope.literals).pipe(
6 Flag.withDescription(
7 `Authorization scope to grant. Repeat for multiple scopes; replaces the default set: ${defaults.join(", ")}.`,
8 ),
9 Flag.atLeast(0),
10 Flag.map((scopes) => [...new Set(scopes.length > 0 ? scopes : defaults)]),
11 );