UNPKG

steam-family-bot-core

Version:

一个用于新版 Steam 家庭的库存监控 Bot 插件

44 lines (43 loc) 2.62 kB
import { GameInfo, SteamAccount, SteamAccountFamilyRel, SteamFamilyLib, SteamFamilyLibSubscribe, SteamRelateChannelInfo } from './tables'; export type PartialBy<T, K extends keyof T> = Omit<T, K> & Partial<Pick<T, K>>; export * from './db'; export * from './tables'; export type SteamAccountWithFamilyId = SteamAccount & { familyId?: string; }; export type FamilyLib = SteamFamilyLib & { info: GameInfo; }; export interface ISteamAccountDAO<T> { getAllSteamAccount(): Promise<SteamAccount[]>; getAuthedSteamAccountByFamilyId(familyId: string): Promise<SteamAccountWithFamilyId>; getSteamAccountBySessionUid(uid: string): Promise<SteamAccountWithFamilyId & { channel: SteamRelateChannelInfo<T>; }>; getSteamAccountBySteamId(steamid: string): Promise<SteamAccountWithFamilyId>; getSteamAccountBySteamIdAndSessionId(steamid: string, uid: string): Promise<SteamAccountWithFamilyId>; upsertSteamAccount(account: Partial<SteamAccount>, channelInfo: any): Promise<void>; updateSteamAccountToken(accountId: number, account: Partial<SteamAccount>): Promise<void>; invalidAccount(id: number): Promise<void>; removeUnAuthAccount(accountId: number): Promise<void>; } export interface ISteamFamilySharedLibDAO { refreshLibByFamilyId(familyId: string, dbContent: SteamFamilyLib[], withWishes?: boolean): Promise<void>; getSteamFamilyLibByFamilyId(familyId: string, type?: 'lib' | 'wish'): Promise<FamilyLib[]>; getUnSyncedLib(limit?: number): Promise<SteamFamilyLib[]>; getLibByKeywordAndFamilyId(familyId: string, queryKey: string): Promise<FamilyLib[]>; getFamilyWishes(familyId: string): Promise<SteamFamilyLib[]>; batchRemoveByAppIdAndFamilyId(steamFamilyId: string, numbers: number[], type?: 'lib' | 'wish'): Promise<void>; batchUpsertFamilyLib(libs: Partial<SteamFamilyLib>[]): Promise<void>; batchUpsertLibInfo(infos: PartialBy<GameInfo, 'aliases' | 'top20Tags'>[]): Promise<void>; } export interface ISteamFamilyLibSubscribeDAO<T> { getSubscriptionBySessionUId(uid: string): Promise<SteamFamilyLibSubscribe>; removeSubscriptionBySessionUId(uid: string): Promise<void>; removeSubscriptionBySteamId(uid: string): Promise<void>; updateSubscription(sub: SteamFamilyLibSubscribe): Promise<void>; inactiveSubscription(subId: number): Promise<void>; getSubscriptionByChannelInfoAndFamilyId(familyId: string, channelInfo: T): Promise<SteamFamilyLibSubscribe>; addSubscription(sub: Partial<SteamFamilyLibSubscribe>, channelInfo: T): Promise<void>; addFamilyAccountRel(items: SteamAccountFamilyRel[]): Promise<void>; }