@it_kyryl/arbitrage_admin_schema
Version:
Schema for arbitrage admin panel
32 lines • 1.53 kB
TypeScript
import { Account, TrafficSource } from "@prisma/client";
import { AxiosInstance } from "axios";
export type AccountBasicInfo = {
id: string;
};
export type AccountInfo = Pick<Account, 'accountId' | 'accountName' | 'accountCreateDate' | 'accountTimezone' | 'type' | 'status' | 'currency'> & {
balance: number;
};
export type BmInfo = {
id: string;
name: string;
};
declare abstract class TrafficSourceApi {
abstract trafficSourceType: TrafficSource;
protected token: string;
protected baseUrl: string;
protected api: AxiosInstance;
constructor(token: string, baseUrl: string);
abstract getAllAccounts(params?: any): Promise<AccountBasicInfo[] | null>;
abstract getAccountInfo(accountId: string): Promise<AccountInfo | null>;
abstract getAllCampaigns<T>(account: Account): Promise<T[] | null>;
abstract getAllAdgroups<T>(account: Account): Promise<T[] | null>;
abstract getAllAds<T>(account: Account): Promise<T[] | null>;
abstract getTotalSpendForAccount(accountId: string): Promise<number>;
abstract getAdStats<T>(accountId: string, dateFrom: string, dateTo: string): Promise<T[] | null>;
abstract getAllBms(next?: string, tryCount?: number): Promise<BmInfo[] | null>;
abstract getAccountsByBm(bmId: string, tryCount?: number): Promise<AccountInfo[] | null>;
/**Collect account insights */
protected abstract configBase(token: string, baseURL: string): AxiosInstance;
}
export default TrafficSourceApi;
//# sourceMappingURL=TrafficSourceApi.d.ts.map