UNPKG

eggi-ai-db-schema

Version:

Type-safe database schema and ORM client for Eggi.AI with direct RDS connection

72 lines 3.07 kB
/** * ============================================================================= * RELATIONSHIP OPERATIONS UTILITIES * ============================================================================= * Utility functions for querying relationship data for API endpoints */ /** * Gets the top closest connections for a specific user (for API responses) * Includes LinkedIn profile information when available * * @param cognitoUserId - The Cognito user ID to find connections for * @param modelVersion - Optional: filter by specific model version (defaults to latest) * @param limit - Maximum number of connections to return (defaults to 10) * @param sortOrder - Sort order for relationship scores: 'desc' for highest first, 'asc' for lowest first (defaults to 'desc') * @returns Promise resolving to array of top connections with profile data */ export declare function getTopClosestConnections(cognitoUserId: string, modelVersion?: number, limit?: number, sortOrder?: "asc" | "desc"): Promise<Array<{ score: number; modelVersion: number | null; createdAt: Date; otherUser: { id: number; givenName: string | null; familyName: string | null; linkedinIdentifier: string | null; profileImageUrl: string | null; }; }>>; /** * Interface for relationship mapping results with enriched profile data */ export interface RelationshipMappingResult { name: string; profile_image_url: string | null; position: string | null; current_company: string | null; score: number; social_account_id: number; linkedin_identifier: string | null; } /** * Find relationship mappings for a LinkedIn identifier (ACoA) * * This function performs a comprehensive search to find all relationships * for a given LinkedIn identifier, enriched with profile data including * name, profile image, current position, and company information. * * @param identifier - LinkedIn ACoA identifier * @param limit - Maximum number of results to return (default: 10, max: 50) * @returns Promise resolving to array of relationship mapping results with enriched profile data */ export declare function findRelationshipsByLinkedInIdentifier(identifier: string, limit?: number): Promise<RelationshipMappingResult[]>; /** * Paginated version: Find relationship mappings for a LinkedIn identifier with pagination support * * @param identifier - LinkedIn ACoA identifier * @param page - Page number (1-based, default: 1) * @param pageSize - Number of results per page (default: 10, max: 50) * @returns Promise resolving to paginated relationship mapping results with metadata */ export declare function findRelationshipsByLinkedInIdentifierPaginated(identifier: string, page?: number, pageSize?: number): Promise<{ results: RelationshipMappingResult[]; pagination: { page: number; pageSize: number; totalItems: number; totalPages: number; hasNextPage: boolean; hasPreviousPage: boolean; }; }>; //# sourceMappingURL=relationship-operations.d.ts.map