//=========================================== // THIS FILE IS AUTO-GENERATED FROM TEMPLATE. DO NOT EDIT IT DIRECTLY UNLESS YOU ALSO EDIT THE CORRESPONDING FILE IN packages/template //=========================================== import { ContactChannelsCrud } from "@hexclave/shared/dist/interface/crud/contact-channels"; export type ContactChannel = { id: string, value: string, type: 'email', isPrimary: boolean, isVerified: boolean, usedForAuth: boolean, sendVerificationEmail(options?: { callbackUrl?: string }): Promise, update(data: ContactChannelUpdateOptions): Promise, delete(): Promise, } export type ContactChannelCreateOptions = { value: string, type: 'email', usedForAuth: boolean, isPrimary?: boolean, } export function contactChannelCreateOptionsToCrud(userId: string, options: ContactChannelCreateOptions): ContactChannelsCrud["Client"]["Create"] { return { value: options.value, type: options.type, used_for_auth: options.usedForAuth, is_primary: options.isPrimary, user_id: userId, }; } export type ContactChannelUpdateOptions = { usedForAuth?: boolean, value?: string, isPrimary?: boolean, } export function contactChannelUpdateOptionsToCrud(options: ContactChannelUpdateOptions): ContactChannelsCrud["Client"]["Update"] { return { value: options.value, used_for_auth: options.usedForAuth, is_primary: options.isPrimary, }; } export type ServerContactChannel = ContactChannel & { update(data: ServerContactChannelUpdateOptions): Promise, } export type ServerContactChannelUpdateOptions = ContactChannelUpdateOptions & { isVerified?: boolean, } export function serverContactChannelUpdateOptionsToCrud(options: ServerContactChannelUpdateOptions): ContactChannelsCrud["Server"]["Update"] { return { value: options.value, is_verified: options.isVerified, used_for_auth: options.usedForAuth, is_primary: options.isPrimary, }; } export type ServerContactChannelCreateOptions = ContactChannelCreateOptions & { isVerified?: boolean, } export function serverContactChannelCreateOptionsToCrud(userId: string, options: ServerContactChannelCreateOptions): ContactChannelsCrud["Server"]["Create"] { return { type: options.type, value: options.value, is_verified: options.isVerified, user_id: userId, used_for_auth: options.usedForAuth, is_primary: options.isPrimary, }; }