import type { Prisma } from '../../../prisma-client';
type CredentialCreateInput = {
    type: string;
    key: any;
    userId: number;
    appId: string;
    delegationCredentialId?: string | null;
};
type CredentialUpdateInput = {
    type?: string;
    key?: any;
    userId?: number;
    appId?: string;
    delegationCredentialId?: string | null;
    invalid?: boolean;
};
export declare class CredentialRepository {
    static create(data: CredentialCreateInput): Promise<{
        key: Prisma.JsonValue;
        id: number;
        type: string;
        userId: number | null;
        teamId: number | null;
        subscriptionId: string | null;
        delegationCredentialId: string | null;
        billingCycleStart: number | null;
        appId: string | null;
        paymentStatus: string | null;
        invalid: boolean | null;
    } & {
        delegatedTo: null;
        delegatedToId: null;
        delegationCredentialId: null;
    }>;
    static findByAppIdAndUserId({ appId, userId }: {
        appId: string;
        userId: number;
    }): Promise<({
        key: Prisma.JsonValue;
        id: number;
        type: string;
        userId: number | null;
        teamId: number | null;
        subscriptionId: string | null;
        delegationCredentialId: string | null;
        billingCycleStart: number | null;
        appId: string | null;
        paymentStatus: string | null;
        invalid: boolean | null;
    } & {
        delegatedTo: null;
        delegatedToId: null;
        delegationCredentialId: null;
    }) | null>;
    /**
     * Doesn't retrieve key field as that has credentials
     */
    static findFirstByIdWithUser({ id }: {
        id: number;
    }): Promise<({
        user: {
            email: string;
        } | null;
        id: number;
        type: string;
        userId: number | null;
        teamId: number | null;
        delegationCredentialId: string | null;
        appId: string | null;
        invalid: boolean | null;
    } & {
        delegatedTo: null;
        delegatedToId: null;
        delegationCredentialId: null;
    }) | null>;
    /**
     * Includes 'key' field which is sensitive data.
     */
    static findFirstByIdWithKeyAndUser({ id }: {
        id: number;
    }): Promise<({
        key: Prisma.JsonValue;
        user: {
            email: string;
        } | null;
        id: number;
        type: string;
        userId: number | null;
        teamId: number | null;
        delegationCredentialId: string | null;
        appId: string | null;
        invalid: boolean | null;
    } & {
        delegatedTo: null;
        delegatedToId: null;
        delegationCredentialId: null;
    }) | null>;
    static findFirstByAppIdAndUserId({ appId, userId }: {
        appId: string;
        userId: number;
    }): Promise<{
        key: Prisma.JsonValue;
        id: number;
        type: string;
        userId: number | null;
        teamId: number | null;
        subscriptionId: string | null;
        delegationCredentialId: string | null;
        billingCycleStart: number | null;
        appId: string | null;
        paymentStatus: string | null;
        invalid: boolean | null;
    } | null>;
    static findFirstByUserIdAndType({ userId, type }: {
        userId: number;
        type: string;
    }): Promise<({
        key: Prisma.JsonValue;
        id: number;
        type: string;
        userId: number | null;
        teamId: number | null;
        subscriptionId: string | null;
        delegationCredentialId: string | null;
        billingCycleStart: number | null;
        appId: string | null;
        paymentStatus: string | null;
        invalid: boolean | null;
    } & {
        delegatedTo: null;
        delegatedToId: null;
        delegationCredentialId: null;
    }) | null>;
    static deleteById({ id }: {
        id: number;
    }): Promise<void>;
    static updateCredentialById({ id, data }: {
        id: number;
        data: CredentialUpdateInput;
    }): Promise<void>;
    static deleteAllByDelegationCredentialId({ delegationCredentialId, }: {
        delegationCredentialId: string;
    }): Promise<import('../../../prisma-client/runtime/library').GetBatchResult>;
    static findCredentialForCalendarServiceById({ id }: {
        id: number;
    }): Promise<({
        key: Prisma.JsonValue;
        user: {
            email: string;
        } | null;
        id: number;
        type: string;
        userId: number | null;
        teamId: number | null;
        delegationCredentialId: string | null;
        appId: string | null;
        invalid: boolean | null;
    } & {
        delegatedTo: null;
        delegatedToId: null;
        delegationCredentialId: null;
    }) | null>;
    static findByIdIncludeDelegationCredential({ id }: {
        id: number;
    }): Promise<{
        key: Prisma.JsonValue;
        user: {
            email: string;
        } | null;
        id: number;
        type: string;
        userId: number | null;
        teamId: number | null;
        delegationCredential: {
            id: string;
            enabled: boolean;
            domain: string;
            organizationId: number;
            createdAt: Date;
            updatedAt: Date;
            workspacePlatformId: number;
            serviceAccountKey: Prisma.JsonValue;
            lastEnabledAt: Date | null;
            lastDisabledAt: Date | null;
        } | null;
        delegationCredentialId: string | null;
        appId: string | null;
        invalid: boolean | null;
    } | null>;
    static findAllDelegationByUserIdsListAndDelegationCredentialIdAndType({ userIds, delegationCredentialId, type, }: {
        userIds: number[];
        delegationCredentialId: string;
        type: string;
    }): Promise<{
        userId: number | null;
    }[]>;
    static findAllDelegationByTypeIncludeUserAndTake({ type, take }: {
        type: string;
        take: number;
    }): Promise<{
        delegationCredentialId: string;
        user: {
            id: number;
            email: string;
        } | null;
        key: Prisma.JsonValue;
        id: number;
        type: string;
        userId: number | null;
        teamId: number | null;
        subscriptionId: string | null;
        billingCycleStart: number | null;
        appId: string | null;
        paymentStatus: string | null;
        invalid: boolean | null;
    }[]>;
    static findUniqueByUserIdAndDelegationCredentialId({ userId, delegationCredentialId, }: {
        userId: number;
        delegationCredentialId: string;
    }): Promise<{
        key: Prisma.JsonValue;
        id: number;
        type: string;
        userId: number | null;
        teamId: number | null;
        subscriptionId: string | null;
        delegationCredentialId: string | null;
        billingCycleStart: number | null;
        appId: string | null;
        paymentStatus: string | null;
        invalid: boolean | null;
    }>;
    static updateWhereUserIdAndDelegationCredentialId({ userId, delegationCredentialId, data, }: {
        userId: number;
        delegationCredentialId: string;
        data: {
            key: Prisma.InputJsonValue;
        };
    }): Promise<import('../../../prisma-client/runtime/library').GetBatchResult>;
    static createDelegationCredential({ userId, delegationCredentialId, type, key, appId, }: {
        userId: number;
        delegationCredentialId: string;
        type: string;
        key: Prisma.InputJsonValue;
        appId: string;
    }): Promise<{
        key: Prisma.JsonValue;
        id: number;
        type: string;
        userId: number | null;
        teamId: number | null;
        subscriptionId: string | null;
        delegationCredentialId: string | null;
        billingCycleStart: number | null;
        appId: string | null;
        paymentStatus: string | null;
        invalid: boolean | null;
    }>;
    static updateWhereId({ id, data }: {
        id: number;
        data: {
            key: Prisma.InputJsonValue;
        };
    }): Promise<{
        key: Prisma.JsonValue;
        id: number;
        type: string;
        userId: number | null;
        teamId: number | null;
        subscriptionId: string | null;
        delegationCredentialId: string | null;
        billingCycleStart: number | null;
        appId: string | null;
        paymentStatus: string | null;
        invalid: boolean | null;
    }>;
}
export {};
//# sourceMappingURL=credential.d.ts.map