eggi-ai-db-schema
Version:
Type-safe database schema and ORM client for Eggi.AI with direct RDS connection
59 lines • 2.14 kB
TypeScript
/**
* =============================================================================
* CONTACT OPERATIONS UTILITIES
* =============================================================================
* Utility functions for creating and managing user contact information
*/
import { type ContactInfo, type ContactInfoType, type ContactInfoSource, type User } from "../lib/schema";
export interface ContactInfoWithUser extends ContactInfo {
user: User;
}
export interface CreateContactInfoData {
userId: number;
type: ContactInfoType;
value: string;
source?: ContactInfoSource;
metadata?: Record<string, any>;
}
export interface UpdateContactInfoData {
value?: string;
metadata?: Record<string, any>;
}
export interface UserWithContacts extends User {
contactInfos: ContactInfo[];
}
export interface ContactSearchCriteria {
types?: ContactInfoType[];
values?: string[];
userIds?: number[];
metadata?: Record<string, any>;
}
/**
* Creates a new contact info record for a user
*
* @param data - Contact info creation data
* @returns Promise resolving to the created contact info
*/
export declare function createContactInfo(data: CreateContactInfoData): Promise<ContactInfo>;
/**
* Creates or updates a contact info record (upsert)
*
* @param data - Contact info data
* @returns Promise resolving to the created or updated contact info
*/
export declare function upsertContactInfo(data: CreateContactInfoData): Promise<ContactInfo>;
/**
* Batch creates contact infos for multiple users
*
* @param contactInfosData - Array of contact info creation data
* @returns Promise resolving to array of created contact infos
*/
export declare function batchCreateContactInfos(contactInfosData: CreateContactInfoData[]): Promise<ContactInfo[]>;
/**
* Batch upserts contact infos (create or update)
*
* @param contactInfosData - Array of contact info data
* @returns Promise resolving to array of upserted contact infos
*/
export declare function batchUpsertContactInfos(contactInfosData: CreateContactInfoData[]): Promise<ContactInfo[]>;
//# sourceMappingURL=contact-operations.d.ts.map