import { EMAIL_PROVIDER, EmailAddress } from '../'; import { BaseEntityClass } from '../base'; import { DeviceEntity } from '../devices'; import { UserEntity } from '../users'; export declare enum PIPEDRIVE_ENTITY_TYPE { ACTIVITIES = "activities", LEADS = "leads", NOTES = "notes", ALL = "all" } export declare enum SECRET_SCHEMA { DUAL_PASSWORD = "dual_password", PASSWORD = "password", OAUTH2 = "oauth2" } export declare enum ACCOUNT_TYPE { GENERIC = "generic", BACKUP_LOCAL = "backup_local", CRYPTOCURRENCY = "cryptocurrency", OAUTH2_MASTODON = "oauth2_mastodon", GITLAB = "gitlab", ASANA = "asana", OAUTH2_ASANA = "oauth2_asana", ETHERSCAN = "etherscan", SMTP = "smtp", POSTMARK = "postmark", PIPEDRIVE = "pipedrive", WEBHOOK_URL = "webhook_url", DISCOURSE = "discourse", GITHUB = "github", BITBUCKET = "bitbucket", OAUTH2_GITHUB = "oauth2_github", TAIGA = "taiga", WEKAN = "wekan", S3 = "s3", GOOGLE = "google", OAUTH2_GOOGLE = "oauth2_google", MATRIX = "matrix" } export interface AccountService { } export interface AccountServices { data: AccountService[]; dateEncrypted: string; } export interface AccountConfig { } export interface AccountPostmarkConfig extends AccountConfig { sender: EmailAddress; enableWebhook: boolean; } export interface AccountSmtpConfig extends AccountConfig { provider: EMAIL_PROVIDER; server: string; port: number; username: string; tls?: boolean; sender: EmailAddress; } export interface AccountWebhookConfig extends AccountConfig { webhookUrls: string[]; } export interface AccountPipedriveConfig extends AccountConfig { entityType?: PIPEDRIVE_ENTITY_TYPE; ownerId?: string; organizationId?: string; } export interface AccountGitlabConfig extends AccountConfig { host: string; } /** * - User type is for Desktop sync * - Device is for device-consumption * - Server type is for server usage (for ex. API key to get Gitlab data) */ export declare enum ACCOUNT_USAGE_TYPE { USER = "user", DEVICE = "device", SERVICE = "service" } export declare class AccountEntity extends BaseEntityClass { title: string; description: string; usageType: ACCOUNT_USAGE_TYPE; /** * When isEncrypted is true, both secret and services are expected to be encrypted */ isEncrypted: boolean; type: ACCOUNT_TYPE; secretSchema: SECRET_SCHEMA; /** * Account secret * - Secret is encrypted if isEncrypted is true * - stored as JSON string * * Support schema: * - dual_password * - password * - oauth2 * */ secret: string; /** * Primarily for px-accounts-service * - Services are encrypted if isEncrypt is true * - stored as JSON string * * Account usage type: USER, DEVICE */ services: string; /** * Primary for usage on the server * - Is not usually encrypted as it would serve no purpose * * Account usage type: SERVICE */ config: AccountConfig | AccountPostmarkConfig | AccountSmtpConfig | AccountWebhookConfig | AccountPipedriveConfig; /** * type: DEVICE */ encryptedForDevice: DeviceEntity; /** * type: USER */ encryptedForUser: UserEntity; isEnabled: boolean; }