import type { z } from 'zod'; import type { RESOURCES, API_KEY_RESOURCES } from './constants.ee'; import type { assignableGlobalRoleSchema, credentialSharingRoleSchema, globalRoleSchema, Role, systemProjectRoleSchema, roleNamespaceSchema, teamRoleSchema, workflowSharingRoleSchema, secretsProviderConnectionSharingRoleSchema, assignableProjectRoleSchema } from './schemas.ee'; export type ScopeInformation = { displayName: string; description?: string | null; }; export type Resource = keyof typeof RESOURCES; type ResourceScope = `${R}:${Operation}`; type AllScopesObject = { [R in Resource]: ResourceScope; }; export type Scope = AllScopesObject[Resource]; export type ScopeLevels = { global: Scope[]; project?: Scope[]; resource?: Scope[]; }; export type MaskLevels = { sharing: Scope[]; }; export type ScopeOptions = { mode: 'oneOf' | 'allOf'; }; export type RoleNamespace = z.infer; export type GlobalRole = z.infer; export type AssignableGlobalRole = z.infer; export type CredentialSharingRole = z.infer; export type WorkflowSharingRole = z.infer; export type SecretsProviderConnectionSharingRole = z.infer; export type TeamProjectRole = z.infer; export type ProjectRole = z.infer; export type AssignableProjectRole = z.infer; export declare function isAssignableProjectRoleSlug(slug: string): slug is AssignableProjectRole; export type AllRoleTypes = GlobalRole | ProjectRole | WorkflowSharingRole | CredentialSharingRole | SecretsProviderConnectionSharingRole; export type AllRolesMap = { global: Role[]; project: Role[]; credential: Role[]; workflow: Role[]; secretsProviderConnection: Role[]; }; export type DbScope = { slug: Scope; }; export type DbRole = { slug: string; scopes: DbScope[]; }; export type AuthPrincipal = { role: DbRole; }; type PublicApiKeyResources = keyof typeof API_KEY_RESOURCES; type ApiKeyResourceScope = `${R}:${Operation}`; type AllApiKeyScopesObject = { [R in PublicApiKeyResources]: ApiKeyResourceScope; }; export type ApiKeyScope = AllApiKeyScopesObject[PublicApiKeyResources]; export declare function isApiKeyScope(scope: Scope | ApiKeyScope): scope is ApiKeyScope; export {};