110 lines
2.3 KiB
TypeScript
110 lines
2.3 KiB
TypeScript
/** Unified contact model used for sync between Outlook and Starface */
|
|
export interface UnifiedContact {
|
|
id?: string;
|
|
outlookId?: string;
|
|
starfaceId?: string;
|
|
firstName: string;
|
|
lastName: string;
|
|
company: string;
|
|
jobTitle: string;
|
|
email: string;
|
|
emailSecondary: string;
|
|
phoneWork: string;
|
|
phoneMobile: string;
|
|
phoneHome: string;
|
|
fax: string;
|
|
street: string;
|
|
city: string;
|
|
postalCode: string;
|
|
state: string;
|
|
country: string;
|
|
website: string;
|
|
notes: string;
|
|
salutation: string;
|
|
title: string;
|
|
birthday: string;
|
|
lastModified?: string;
|
|
}
|
|
|
|
export function emptyContact(): UnifiedContact {
|
|
return {
|
|
firstName: "",
|
|
lastName: "",
|
|
company: "",
|
|
jobTitle: "",
|
|
email: "",
|
|
emailSecondary: "",
|
|
phoneWork: "",
|
|
phoneMobile: "",
|
|
phoneHome: "",
|
|
fax: "",
|
|
street: "",
|
|
city: "",
|
|
postalCode: "",
|
|
state: "",
|
|
country: "",
|
|
website: "",
|
|
notes: "",
|
|
salutation: "",
|
|
title: "",
|
|
birthday: "",
|
|
};
|
|
}
|
|
|
|
/** Starface connection settings */
|
|
export interface StarfaceConnection {
|
|
host: string;
|
|
port: number;
|
|
useSsl: boolean;
|
|
loginId: string;
|
|
password: string;
|
|
}
|
|
|
|
/** A Starface address book (represented by userId scope or tag) */
|
|
export interface StarfaceAddressBook {
|
|
type: "central" | "user" | "tag";
|
|
userId?: string;
|
|
tagId?: string;
|
|
name: string;
|
|
}
|
|
|
|
/** An Outlook contact folder */
|
|
export interface OutlookContactFolder {
|
|
id: string;
|
|
displayName: string;
|
|
parentFolderId?: string;
|
|
}
|
|
|
|
/** A sync profile mapping one Outlook folder to one Starface address book */
|
|
export interface SyncProfile {
|
|
id: string;
|
|
name: string;
|
|
starfaceConnection: StarfaceConnection;
|
|
starfaceAddressBook: StarfaceAddressBook;
|
|
outlookFolderId: string;
|
|
outlookFolderName: string;
|
|
syncDirection: "both" | "outlook-to-starface" | "starface-to-outlook";
|
|
lastSync?: string;
|
|
enabled: boolean;
|
|
}
|
|
|
|
/** Tracks which contacts have been synced to detect changes */
|
|
export interface SyncMapping {
|
|
profileId: string;
|
|
outlookId: string;
|
|
starfaceId: string;
|
|
lastSyncHash: string;
|
|
}
|
|
|
|
/** Result of a sync operation */
|
|
export interface SyncResult {
|
|
profileId: string;
|
|
profileName: string;
|
|
timestamp: string;
|
|
created: number;
|
|
updated: number;
|
|
deleted: number;
|
|
errors: string[];
|
|
direction: string;
|
|
}
|