import { type AccountUuid, PersonId, WorkspaceDataId, WorkspaceUuid, type AccountRole, type Timestamp, type SocialId as SocialIdBase, PersonUuid, type WorkspaceMode, Person, WorkspaceInfo, AccountInfo, IntegrationKind } from '@hcengineering/core';
export interface LoginInfo {
    account: AccountUuid;
    name?: string;
    socialId?: PersonId;
    token?: string;
}
export interface EndpointInfo {
    internalUrl: string;
    externalUrl: string;
    region: string;
}
export interface WorkspaceVersion {
    versionMajor: number;
    versionMinor: number;
    versionPatch: number;
}
export interface LoginInfoWorkspace {
    url: string;
    dataId?: WorkspaceDataId;
    mode: WorkspaceMode;
    version: WorkspaceVersion;
    endpoint: EndpointInfo;
    role: AccountRole | null;
    progress?: number;
    branding?: string;
    passwordAgingRule?: number;
}
export interface LoginInfoWithWorkspaces extends LoginInfo {
    workspaces: Record<WorkspaceUuid, LoginInfoWorkspace>;
    socialIds: SocialId[];
}
export type LoginInfoByToken = LoginInfo | WorkspaceLoginInfo | LoginInfoRequest | null;
/**
 * @public
 */
export interface WorkspaceLoginInfo extends LoginInfo {
    workspace: WorkspaceUuid;
    workspaceDataId?: WorkspaceDataId;
    workspaceUrl: string;
    endpoint: string;
    token: string;
    role: AccountRole;
    allowGuestSignUp?: boolean;
}
export interface LoginInfoRequestData {
    firstName?: string;
    lastName?: string;
}
export type LoginInfoRequest = {
    request: true;
} & LoginInfoRequestData;
export interface WorkspaceInviteInfo {
    workspace: WorkspaceUuid;
    email?: string;
    name?: string;
}
export interface OtpInfo {
    sent: boolean;
    retryOn: Timestamp;
}
export interface RegionInfo {
    region: string;
    name: string;
}
export type WorkspaceOperation = 'create' | 'upgrade' | 'all' | 'all+backup';
export interface MailboxOptions {
    availableDomains: string[];
    minNameLength: number;
    maxNameLength: number;
    maxMailboxCount: number;
}
export interface MailboxInfo {
    mailbox: string;
    aliases: string[];
    appPasswords: string[];
}
export interface MailboxSecret {
    mailbox: string;
    app?: string;
    secret: string;
}
export interface Integration {
    socialId: PersonId;
    kind: IntegrationKind;
    workspaceUuid: WorkspaceUuid | null;
    data?: Record<string, any>;
    disabled?: boolean;
}
export interface SocialId extends SocialIdBase {
    personUuid: PersonUuid;
    isDeleted?: boolean;
}
export type IntegrationKey = Omit<Integration, 'data'>;
export interface IntegrationSecret {
    socialId: PersonId;
    kind: IntegrationKind;
    workspaceUuid: WorkspaceUuid | null;
    key: string;
    secret: string;
}
export type IntegrationSecretKey = Omit<IntegrationSecret, 'secret'>;
export interface ProviderInfo {
    name: string;
    displayName?: string;
}
export interface AccountAggregatedInfo extends AccountInfo, Person {
    uuid: AccountUuid;
    integrations: Omit<Integration, 'data'>[];
    socialIds: SocialId[];
    workspaces: Omit<WorkspaceInfo, 'allowReadOnlyGuest' | 'allowGuestSignUp'>[];
}
/**
 * User profile with additional information for public sharing
 * Stored in accounts database (global, not workspace-specific)
 */
export interface UserProfile {
    personUuid: PersonUuid;
    bio?: string;
    city?: string;
    country?: string;
    website?: string;
    socialLinks?: Record<string, string>;
    isPublic: boolean;
}
export type PersonWithProfile = Person & Omit<UserProfile, 'personUuid'>;
/**
 * Subscription status enum
 * Reflects the subscription lifecycle from active to canceled/expired
 */
export declare enum SubscriptionStatus {
    Active = "active",// Subscription is active and paid
    Trialing = "trialing",// In trial period (free usage)
    PastDue = "past_due",// Payment failed but subscription not yet canceled
    Canceled = "canceled",// Subscription was canceled by user or admin
    Paused = "paused",// Subscription is temporarily paused (some providers support this)
    Expired = "expired"
}
/**
 * Subscription type/purpose
 * Allows multiple active subscriptions per workspace for different purposes
 */
export declare enum SubscriptionType {
    Tier = "tier",// Main workspace tier (free, starter, pro, enterprise)
    Support = "support"
}
/**
 * Workspace subscription information
 * Provider-agnostic subscription data managed by billing service
 * Multiple subscriptions can be active per workspace (tier + addons + support)
 * Historical subscriptions are preserved with status: canceled/expired
 */
export interface Subscription {
    id: string;
    workspaceUuid: WorkspaceUuid;
    accountUuid: AccountUuid;
    provider: string;
    providerSubscriptionId: string;
    providerCheckoutId?: string;
    type: SubscriptionType;
    status: SubscriptionStatus;
    plan: string;
    amount?: number;
    periodStart?: Timestamp;
    periodEnd?: Timestamp;
    trialEnd?: Timestamp;
    canceledAt?: Timestamp;
    providerData?: Record<string, any>;
    createdOn: Timestamp;
    updatedOn: Timestamp;
}
/**
 * Subscription data for creating/updating subscriptions (without timestamps)
 * Used by billing service to upsert subscription data
 */
export type SubscriptionData = Omit<Subscription, 'createdOn' | 'updatedOn'>;
//# sourceMappingURL=types.d.ts.map