// SPDX-License-Identifier: AGPL-3.0-or-later import type {ConnectionType} from '@fluxer/constants/src/ConnectionConstants'; import type {UserID} from '../BrandedTypes'; import type {UserConnectionRow} from '../database/types/ConnectionTypes'; import type {UpdateConnectionParams} from './IConnectionRepository'; export type InitiateConnectionResult = Record; export abstract class IConnectionService { abstract getConnectionsForUser(userId: UserID): Promise>; abstract initiateConnection( userId: UserID, type: ConnectionType, identifier: string, ): Promise; abstract verifyAndCreateConnection( userId: UserID, type: ConnectionType, identifier: string, verificationCode: string, visibilityFlags: number, ): Promise; abstract updateConnection( userId: UserID, connectionType: ConnectionType, connectionId: string, patch: UpdateConnectionParams, ): Promise; abstract deleteConnection(userId: UserID, connectionType: ConnectionType, connectionId: string): Promise; abstract verifyConnection( userId: UserID, connectionType: ConnectionType, connectionId: string, ): Promise; abstract reorderConnections(userId: UserID, connectionIds: Array): Promise; abstract revalidateConnection(connection: UserConnectionRow): Promise<{ isValid: boolean; updateParams: UpdateConnectionParams | null; }>; abstract createOrUpdateBlueskyConnection(userId: UserID, did: string, handle: string): Promise; }