opencrm/backend/dist/services/emailProvider/emailProviderService.d.ts

203 lines
7.0 KiB
TypeScript

import { EmailExistsResult, EmailOperationResult, MailEncryption } from './types.js';
export declare function getAllProviderConfigs(): Promise<{
id: number;
isActive: boolean;
createdAt: Date;
updatedAt: Date;
name: string;
type: import(".prisma/client").$Enums.EmailProviderType;
isDefault: boolean;
apiUrl: string;
apiKey: string | null;
username: string | null;
passwordEncrypted: string | null;
domain: string;
defaultForwardEmail: string | null;
imapServer: string | null;
imapPort: number | null;
smtpServer: string | null;
smtpPort: number | null;
imapEncryption: import(".prisma/client").$Enums.MailEncryption;
smtpEncryption: import(".prisma/client").$Enums.MailEncryption;
allowSelfSignedCerts: boolean;
}[]>;
export declare function getProviderConfigById(id: number): Promise<{
id: number;
isActive: boolean;
createdAt: Date;
updatedAt: Date;
name: string;
type: import(".prisma/client").$Enums.EmailProviderType;
isDefault: boolean;
apiUrl: string;
apiKey: string | null;
username: string | null;
passwordEncrypted: string | null;
domain: string;
defaultForwardEmail: string | null;
imapServer: string | null;
imapPort: number | null;
smtpServer: string | null;
smtpPort: number | null;
imapEncryption: import(".prisma/client").$Enums.MailEncryption;
smtpEncryption: import(".prisma/client").$Enums.MailEncryption;
allowSelfSignedCerts: boolean;
} | null>;
export declare function getDefaultProviderConfig(): Promise<{
id: number;
isActive: boolean;
createdAt: Date;
updatedAt: Date;
name: string;
type: import(".prisma/client").$Enums.EmailProviderType;
isDefault: boolean;
apiUrl: string;
apiKey: string | null;
username: string | null;
passwordEncrypted: string | null;
domain: string;
defaultForwardEmail: string | null;
imapServer: string | null;
imapPort: number | null;
smtpServer: string | null;
smtpPort: number | null;
imapEncryption: import(".prisma/client").$Enums.MailEncryption;
smtpEncryption: import(".prisma/client").$Enums.MailEncryption;
allowSelfSignedCerts: boolean;
} | null>;
export declare function getActiveProviderConfig(): Promise<{
id: number;
isActive: boolean;
createdAt: Date;
updatedAt: Date;
name: string;
type: import(".prisma/client").$Enums.EmailProviderType;
isDefault: boolean;
apiUrl: string;
apiKey: string | null;
username: string | null;
passwordEncrypted: string | null;
domain: string;
defaultForwardEmail: string | null;
imapServer: string | null;
imapPort: number | null;
smtpServer: string | null;
smtpPort: number | null;
imapEncryption: import(".prisma/client").$Enums.MailEncryption;
smtpEncryption: import(".prisma/client").$Enums.MailEncryption;
allowSelfSignedCerts: boolean;
} | null>;
export interface CreateProviderConfigData {
name: string;
type: 'PLESK' | 'CPANEL' | 'DIRECTADMIN';
apiUrl: string;
apiKey?: string;
username?: string;
password?: string;
domain: string;
defaultForwardEmail?: string;
imapEncryption?: MailEncryption;
smtpEncryption?: MailEncryption;
allowSelfSignedCerts?: boolean;
isActive?: boolean;
isDefault?: boolean;
}
export declare function createProviderConfig(data: CreateProviderConfigData): Promise<{
id: number;
isActive: boolean;
createdAt: Date;
updatedAt: Date;
name: string;
type: import(".prisma/client").$Enums.EmailProviderType;
isDefault: boolean;
apiUrl: string;
apiKey: string | null;
username: string | null;
passwordEncrypted: string | null;
domain: string;
defaultForwardEmail: string | null;
imapServer: string | null;
imapPort: number | null;
smtpServer: string | null;
smtpPort: number | null;
imapEncryption: import(".prisma/client").$Enums.MailEncryption;
smtpEncryption: import(".prisma/client").$Enums.MailEncryption;
allowSelfSignedCerts: boolean;
}>;
export declare function updateProviderConfig(id: number, data: Partial<CreateProviderConfigData>): Promise<{
id: number;
isActive: boolean;
createdAt: Date;
updatedAt: Date;
name: string;
type: import(".prisma/client").$Enums.EmailProviderType;
isDefault: boolean;
apiUrl: string;
apiKey: string | null;
username: string | null;
passwordEncrypted: string | null;
domain: string;
defaultForwardEmail: string | null;
imapServer: string | null;
imapPort: number | null;
smtpServer: string | null;
smtpPort: number | null;
imapEncryption: import(".prisma/client").$Enums.MailEncryption;
smtpEncryption: import(".prisma/client").$Enums.MailEncryption;
allowSelfSignedCerts: boolean;
}>;
export declare function deleteProviderConfig(id: number): Promise<{
id: number;
isActive: boolean;
createdAt: Date;
updatedAt: Date;
name: string;
type: import(".prisma/client").$Enums.EmailProviderType;
isDefault: boolean;
apiUrl: string;
apiKey: string | null;
username: string | null;
passwordEncrypted: string | null;
domain: string;
defaultForwardEmail: string | null;
imapServer: string | null;
imapPort: number | null;
smtpServer: string | null;
smtpPort: number | null;
imapEncryption: import(".prisma/client").$Enums.MailEncryption;
smtpEncryption: import(".prisma/client").$Enums.MailEncryption;
allowSelfSignedCerts: boolean;
}>;
export declare function checkEmailExists(localPart: string): Promise<EmailExistsResult>;
export declare function provisionEmail(localPart: string, customerEmail: string): Promise<EmailOperationResult>;
export declare function provisionEmailWithMailbox(localPart: string, customerEmail: string, password: string): Promise<EmailOperationResult & {
email?: string;
}>;
export declare function enableMailboxForExistingEmail(localPart: string, password: string): Promise<EmailOperationResult>;
export declare function updateMailboxPassword(localPart: string, password: string): Promise<EmailOperationResult>;
export interface ImapSmtpSettings {
imapServer: string;
imapPort: number;
imapEncryption: MailEncryption;
smtpServer: string;
smtpPort: number;
smtpEncryption: MailEncryption;
allowSelfSignedCerts: boolean;
domain: string;
}
export declare function getImapSmtpSettings(): Promise<ImapSmtpSettings | null>;
export declare function deprovisionEmail(localPart: string): Promise<EmailOperationResult>;
export declare function renameProvisionedEmail(oldLocalPart: string, newLocalPart: string): Promise<EmailOperationResult>;
export declare function getProviderDomain(): Promise<string | null>;
export declare function testProviderConnection(options?: {
id?: number;
testData?: {
type: 'PLESK' | 'CPANEL' | 'DIRECTADMIN';
apiUrl: string;
apiKey?: string;
username?: string;
password?: string;
domain: string;
};
}): Promise<EmailOperationResult>;
//# sourceMappingURL=emailProviderService.d.ts.map