Download src/shared/constants/selfServiceScopes.ts from automindy/fiemwl: direct link, hf CLI and curl.
- Browser
- Download file 821 Bytes
-
https://huggingface.co/spaces/automindy/fiemwl/resolve/main/src/shared/constants/selfServiceScopes.ts
- Command line
-
hf download hf://spaces/automindy/fiemwl/src/shared/constants/selfServiceScopes.ts
-
curl -L -o selfServiceScopes.ts https://huggingface.co/spaces/automindy/fiemwl/resolve/main/src/shared/constants/selfServiceScopes.ts
821 Bytes
| export const SELF_USAGE_SCOPE = "self:usage"; | |
| export const SELF_ACCOUNT_QUOTA_SCOPE = "self:account-quota"; | |
| export const DEFAULT_SELF_SERVICE_SCOPES = [SELF_USAGE_SCOPE] as const; | |
| export function hasSelfUsageScope(scopes: readonly string[] | null | undefined): boolean { | |
| return Array.isArray(scopes) && scopes.includes(SELF_USAGE_SCOPE); | |
| } | |
| export function hasSelfAccountQuotaScope(scopes: readonly string[] | null | undefined): boolean { | |
| return Array.isArray(scopes) && scopes.includes(SELF_ACCOUNT_QUOTA_SCOPE); | |
| } | |
| export function normalizeSelfServiceScopesForCreate( | |
| scopes: readonly string[] | null | undefined | |
| ): string[] { | |
| const normalized = new Set((scopes ?? []).filter((scope) => typeof scope === "string" && scope)); | |
| normalized.add(SELF_USAGE_SCOPE); | |
| return [...normalized]; | |
| } | |