export type OrgType = 'PRIVATE' | 'PUBLIC' | 'PERSONAL' | 'BUSINESS'; export type OrgPlan = 'free' | 'pro' | 'enterprise'; export interface Organization { id: string; name: string; description?: string; type: OrgType; plan: OrgPlan; ownerId: string; isActive: boolean; createdAt: string; updatedAt?: string; logoUrl?: string; } export interface ListMyOrgsResponse { operationId: string; organizations: Organization[]; nextToken?: string; count: number; } export interface OrgResponse { operationId: string; organization: Organization; } export interface CreateOrgRequest { name: string; type: OrgType; description?: string; } export interface UpdateOrgRequest { name?: string; description?: string; logoUrl?: string; /** Borra el logo de la org. Distinto de logoUrl vacío (= "no cambiar"). */ clearLogo?: boolean; } export interface InviteUserRequest { email?: string; userId?: string; roleId: string; } export interface InviteUserResponse { operationId: string; inviteUrl: string; expiresAt: string; email: string; } export interface LeaveOrgResponse { operationId: string; message: string; leftAt: string; } export interface OrgMember { userId: string; email?: string; name?: string; roles: string[]; assignedAt?: string; } export interface ListOrgMembersResponse { operationId: string; members: OrgMember[]; nextToken?: string; count: number; /** Backend SSOT para labels de roles en la respuesta (ADR-024 Phase 2). */ roleDisplayNames?: Record>; } export interface PendingInvitation { orgId: string; orgName: string; roleId: string; inviterId: string; inviterName: string; expiresAt: string; } export interface ListPendingInvitationsResponse { operationId: string; items: PendingInvitation[]; } export interface AcceptInvitationResponse { operationId: string; orgId: string; orgName: string; roleId: string; } export interface OrgRole { id: string; name: string; description?: string; permissions?: string[]; isSystem?: boolean; /** Nombre legible por idioma. Backend autoritativo (ADR-024). nil para roles custom. */ displayName?: { es?: string; en?: string; [lang: string]: string | undefined; }; } /** * Resuelve el label legible de un rol para el idioma dado. * Fallback: displayName en otro idioma → role.name (snake_case). */ export declare function resolveRoleLabel(role: OrgRole, lang: string): string; /** * Resuelve el label de un rol a partir de una lista de roles disponibles. * Busca por id o name → usa resolveRoleLabel → fallback: humaniza el name. * * Función canónica de resolución. Reemplaza los keyMaps manuales en org-view y * member-detail-modal. Cubre roles del sistema Y roles custom de app. */ export declare function resolveRoleLabelFromList(roleIdOrName: string, roles: OrgRole[], lang: string): string; /** * Roles del sistema con displayName (es/en). Espejo de SystemRoleLabels (backend Go). * Backend es autoritativo — esto es un seed para renders previos a la carga de la API. */ export declare const SYSTEM_ROLE_DEFAULTS: OrgRole[]; export interface ListOrgRolesResponse { operationId: string; roles: OrgRole[]; } export interface ChangeMemberRoleRequest { roleId: string; } export interface ChangeMemberRoleResponse { operationId: string; userId: string; orgId: string; roleId: string; } export type ImportOnConflict = 'assignRole' | 'skip' | 'error'; export interface ImportUserRow { email: string; name?: string; roleName: string; } export interface ImportMembersRequest { users: ImportUserRow[]; onConflict?: ImportOnConflict; sendActivation?: boolean; } export type ImportRowStatus = 'created' | 'assigned' | 'skipped' | 'error'; export interface ImportRowResult { email: string; status: ImportRowStatus; userId?: string; activation?: 'sent' | 'pending'; reason?: string; } export interface ImportSummary { created: number; assigned: number; skipped: number; failed: number; } export interface ImportMembersResponse { operationId: string; summary: ImportSummary; results: ImportRowResult[]; }