Skip to content

Commit

Permalink
Testing
Browse files Browse the repository at this point in the history
  • Loading branch information
Gijsdeman committed Aug 19, 2023
1 parent 7e5db32 commit b209b0a
Show file tree
Hide file tree
Showing 2 changed files with 88 additions and 94 deletions.
180 changes: 87 additions & 93 deletions src/mailcowDB.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,123 +30,127 @@ export async function initializeMailcowDB(config: ContainerConfig): Promise<void
.select('c_defaults')
.from('sogo_user_profile', 'profile')
.where('c_uid = "[email protected]"')
.getRawOne();
.getRawOne<Result>();

// eslint-disable-next-line @typescript-eslint/no-use-before-define
const test2 = plainToClass(Test, test);
// const test2 = plainToClass(Test, test);

console.log(test2);
console.log(test);
console.log('=-=-=-=-=-=-=-=-=-=--=-=-=-=-=-=-=-=-=-=-');
console.log(test2.SOGoMailIdentities);
// @ts-ignore
console.log(test.SOGoMailIdentities);

}

export class Test {
SOGoCalendarCategoriesColors: SOGoCalendarCategoriesColors;
export class Result {
c_defaults: Defaults;
}

SOGoGravatarEnabled: number;
export interface Defaults {
SOGoCalendarCategoriesColors: SOGoCalendarCategoriesColors;
SOGoGravatarEnabled: number;

LocaleCode: string;
LocaleCode: string;

SOGoMailComposeFontSize: number;
SOGoMailComposeFontSize: number;

SOGoMailReceiptNonRecipientAction: string;
SOGoMailReceiptNonRecipientAction: string;

SOGoDayStartTime: string;
SOGoDayStartTime: string;

SOGoAlternateAvatar: string;
SOGoAlternateAvatar: string;

SOGoLoginModule: string;
SOGoLoginModule: string;

SOGoLDAPGroupExpansionEnabled: number;
SOGoLDAPGroupExpansionEnabled: number;

SOGoCalendarCategories: string[];
SOGoCalendarCategories: string[];

SOGoTOTPEnabled: number;
SOGoTOTPEnabled: number;

emailSeparatorKeys: number[];
emailSeparatorKeys: number[];

SOGoDayEndTime: string;
SOGoDayEndTime: string;

SOGoMailComposeMessageType: string;
SOGoMailComposeMessageType: string;

SOGoCalendarWeekdays: string[];
SOGoCalendarWeekdays: string[];

hasActiveExternalSieveScripts: number;
hasActiveExternalSieveScripts: number;

SOGoShortDateFormat: string;
SOGoShortDateFormat: string;

SOGoMailSignaturePlacement: string;
SOGoMailSignaturePlacement: string;

SOGoMailMessageForwarding: string;
SOGoMailMessageForwarding: string;

ckLocaleCode: string;
ckLocaleCode: string;

SOGoMailReceiptOutsideDomainAction: string;
SOGoMailReceiptOutsideDomainAction: string;

Forward: Forward;
Forward: Forward;

SOGoTimeZone: string;
SOGoTimeZone: string;

SOGoMailReceiptAllow: string;
SOGoMailReceiptAllow: string;

UserTimeZoneSecondsFromGMT: number;
UserTimeZoneSecondsFromGMT: number;

SOGoMailComposeWindow: string;
SOGoMailComposeWindow: string;

SOGoTimeFormat: string;
SOGoTimeFormat: string;

Vacation: Vacation;
Vacation: Vacation;

SOGoRememberLastModule: number;
SOGoRememberLastModule: number;

SOGoCalendarTasksDefaultClassification: string;
SOGoCalendarTasksDefaultClassification: string;

SOGoPasswordRecoveryMode: string;
SOGoPasswordRecoveryMode: string;

SOGoRefreshViewCheck: string;
SOGoRefreshViewCheck: string;

SOGoCalendarDefaultReminder: string;
SOGoCalendarDefaultReminder: string;

SOGoMailAutoSave: number;
SOGoMailAutoSave: number;

SOGoMailLabelsColors: { [key: string]: string[] };
SOGoMailLabelsColors: { [key: string]: string[] };

SOGoLongDateFormat: string;
SOGoLongDateFormat: string;

SOGoMailReceiptAnyAction: string;
SOGoMailReceiptAnyAction: string;

SOGoMailAutoMarkAsReadDelay: number;
SOGoMailAutoMarkAsReadDelay: number;

SOGoDefaultCalendar: string;
SOGoDefaultCalendar: string;

SOGoMailReplyPlacement: string;
SOGoMailReplyPlacement: string;

SOGoAppointmentSendEMailNotifications: number;
SOGoAppointmentSendEMailNotifications: number;

SOGoFirstWeekOfYear: string;
SOGoFirstWeekOfYear: string;

SOGoSelectedAddressBook: string;
SOGoSelectedAddressBook: string;

SOGoCalendarEventsDefaultClassification: string;

SOGoAnimationMode: string;
SOGoAnimationMode: string;

SOGoPasswordRecoveryQuestion: string;
SOGoPasswordRecoveryQuestion: string;

SOGoMailAddOutgoingAddresses: number;
SOGoMailAddOutgoingAddresses: number;

AuxiliaryMailAccounts: any[];
AuxiliaryMailAccounts: any[];

SOGoFirstDayOfWeek: number;
SOGoFirstDayOfWeek: number;

SOGoLanguage: string;
SOGoLanguage: string;

SOGoContactsCategories: string[];
SOGoContactsCategories: string[];

SOGoMailIdentities: SOGoMailIdentity[];
SOGoMailIdentities: SOGoMailIdentity[];

SOGoMailDisplayRemoteInlineImages: string;
SOGoMailDisplayRemoteInlineImages: string;
}

export interface Forward {
Expand All @@ -155,54 +159,44 @@ export interface Forward {

export interface SOGoCalendarCategoriesColors {
Miscellaneous: string;
Personal: string;
Customer: string;
Gifts: string;
Business: string;
Status: string;
Anniversary: string;
Vacation: string;
Travel: string;
Clients: string;
Competition: string;
Favorites: string;
Calls: string;
Personal: string;
Customer: string;
Gifts: string;
Business: string;
Status: string;
Anniversary: string;
Vacation: string;
Travel: string;
Clients: string;
Competition: string;
Favorites: string;
Calls: string;
PublicHoliday: string;
Issues: string;
Meeting: string;
Projects: string;
Holidays: string;
Ideas: string;
Birthday: string;
Suppliers: string;
Followup: string;
Issues: string;
Meeting: string;
Projects: string;
Holidays: string;
Ideas: string;
Birthday: string;
Suppliers: string;
Followup: string;
}

export interface SOGoMailIdentity {
isDefault?: number;
email: string;
fullName: string;
signature: string;
replyTo: string;
email: string;
fullName: string;
signature: string;
replyTo: string;
}

export interface Vacation {
daysBetweenResponse: number;
daysBetweenResponse: number;
autoReplyEmailAddresses: string[];
days: any[];
days: any[];
}












// UPDATE sogo_user_profile SET c_defaults =
// {
// "SOGoCalendarCategoriesColors":{
Expand Down
2 changes: 1 addition & 1 deletion tsconfig.tsbuildinfo

Large diffs are not rendered by default.

0 comments on commit b209b0a

Please sign in to comment.