UNPKG

bb-api-platforma

Version:

API module for BetBooster Platform

1,621 lines (1,619 loc) 61.5 kB
// Generated by dts-bundle-generator v9.5.1 import { AxiosInstance } from 'axios'; export interface IBetslipItems { Add1: number | null; Add2: number | null; BetVarID: number; LinesID: number; HandSize: number | null; IsLive: boolean; Odds: number; } export interface IAddToBasket { eId: number; bId: number; r: number; fs: number | null; a1: number | null; a2: number | null; isLive: boolean; } export interface IRate { Rate: string; IsEnabled?: boolean; SignChange?: string; Id?: string; TID?: string; NameShort?: string; NameLong?: string; BN?: string; BetId?: number; AddToBasket?: IAddToBasket; S?: number; N?: number; TotalSize?: number; ForaSize?: number; } export interface IMainBet { Id: string; Caption?: string; Rates?: IRate[]; } export interface IEventKeys { ID: number; LinesID: number; TurnirID: number; SportID: number; } export interface IEventsHeader { ExtraBetTypesCount: number; MainBets: IMainBet[]; HomeTeamName: string; AwayTeamName: string; SportName: string; TourneyName: string; Comment: string; EventKeys: IEventKeys; Date: string; CountryId: number; PriceNum: number; } export interface GetPrematchTournament { EventsHeaders: IEventsHeader[]; Id: number; Name: string; } export interface IRates { S: string; IsT: boolean; Caption: string; Id: string; Rates: IRate[]; State: number; GroupName: string | null; Comment: string | null; } export interface IRospisGroup { Name: string; IsEnabled: boolean; State: number; Id: number; Rates: IRates[]; } export interface IMinMatch { Minutes: number; Seconds: number; TotalMinutes: number; } export interface ILiveDescription { SportId: number; CountryId: number; TournamentId: number; LinesId: number; CommentId: null | string; PriceNum: number; Comment: string; Score: string; MinMatch: IMinMatch; Date: string; ServingTeam: number; NameTeam1: string; NameTeam2: string; TName: string; SportName: number; } export interface ILiveData { RospisGroups: IRospisGroup[]; TimeStamp: null | string; Id: string; Status: number; CountRospis: number; State: number; Description: ILiveDescription; Statistic: string; ScoreStats: any[]; TVChannels: any[]; Markets: any[]; LineArchive: null | string; } export interface ILiveDataResponce { ts: number; events: ILiveData[]; isFullPackage: boolean; Error?: string | null; } export interface ISport { ID: number; Name: string; } export interface ICountry { ID: number; Name: string; } export interface IChangePassword { mailSubject: string; userData: { UserId: number; OldPassword: string; NewPassword: string; /** * offset from GMT in the format * new Date().getTimezoneOffset() / 60 * @type {number} */ Gmt: number; /** * Блять! Id Языка * @type {number} */ Language: number; }; } export interface ISearchEventsData { CountryId: number; Date: string; Id: number; Name: string; PriceNum: number; SportId: number; SportName: string; TournamentId: number; TournamentName: string; /** * Types: * * 0 = "Sport"; * * 1 = "Tournament"; * * 2 = "PrematchEvent"; * * 3 = "LiveEvent"; * @type {0|1|2|3} */ Type: 0 | 1 | 2 | 3; isLive: boolean; to: { name: string; params: { prEventId: string; }; }; t1: string; t2: string; } export interface IPayloadWithdrawal { /** * ID платёжной системы (Кассир(5), WebMoney(2), Skrill(10)) * Всю информацию выяснять у программистов * @type {number} */ psType: number; amount: string; /** * Номер кошелька в случае * вывода через кассира - номер кассы * в случае вывода на карту - номер карты * @type {string} */ purse: string; password: string; /** * Хрень */ securityCode?: string; secAnswer?: string; additionalParams?: Record<string, any>; } export interface IPayloadCancelOrderedTransaction { transactionId: number; status: ETransactionInternalStatus; } /** * Represents the payload for retrieving account transactions. * "/account/GetAccountTransactions" */ export interface IGetMovementOfMoneyPayload { /** * Start date format: DDMMYYYY */ begin: string; /** * End date format: DDMMYYYY */ end: string; /** * Transactions types: */ type: ETransactionType; /** * Period types: */ periodType: EPeriodType; /** * Number of page (default 0) */ page: number; /** * Count items per page */ count: number; /** * (optional) Added automatically in the API class */ culture?: string; } declare enum ETransactionInternalStatus { /** Пустой, значение по умолчанию для всех транзакций (0) */ None = 0, /** Заказано на вывод, транзакция не обработана (1) */ Ordered = 1, /** Транзакция подтверждена (разрешена) админом к выводу на кассе (2) */ Confirmed = 2, /** Авто-отмена транзакции (нужна для отмены пользовательской транзакции и создания нового заказа) (3) */ AutoReturned = 3, /** Авто-заказ денег на вывод (например, перезаказ на другую сумму) (4) */ AutoOrdered = 4, /** Возвращено (отказ/отмена от выплаты) (5) */ Returned = 5, /** Вывод денег пользователю (6) */ Paid = 6, /** Подтвержденная транзакция отменена (7) */ ConfirmedReturned = 7, /** * Транзакция находится в ожидании * (для платежки DengiOnline транзакция является подстверженной кассиром, но еще находится в ожидании подтверждения/отмены от платежной системы) * можно использовать еще для банковских карточек, там ожидание от 3 до 5 рабочих дней */ Pending = 8 } export type TGetUserBetsPayload = { /** Date format 'DDMMYYYY' */ begin: string; /** Date format 'DDMMYYYY' */ end: string; /** default: 0 */ page: number; /** default: 500 */ count: number; /** hardware: 0 */ periodType: number; showLossBets: boolean; showWinBets: boolean; showWorkBets: boolean; culture?: string; }; export type TGetGameFrameGoldenRacePayload = { /** Идентификатор игры. "gameId" Обязательный параметр. */ game: number; /** URL, на который игра перенаправляет в случае неожиданной ошибки или используется для клиентских конфигураций, таких как URL лобби для мобильных игр. Обязательный параметр. */ backurl: string; /** Режим игры: 0 для виртуального (fun) или 1 для реального (real). По умолчанию: 1. */ mode: 0 | 1; /** Код языка в формате ISO 639-1 alpha-2 для загрузки локализации. По умолчанию: "en". */ language: string | "en" | "fr" | "es" | "pt" | "tr"; /** Платформа, с которой была запущена игра: "desktop" или "mobile". Укажите "mobile", если хотите открыть мобильный клиент игры. По умолчанию: "desktop". */ clientPlatform: "desktop" | "mobile"; }; export type TGetGameListGoldenRacePayload = { platforms: "mobile" | "desktop" | "retail"; gameTitle?: string; provider?: string[]; type?: string; sub_type?: string; }; export type TPlaceBetPayload = { betAmount: number; doAcceptOddsChanges: boolean; /** * Should look something like this: * `{ * "4084082_132_1.5_null_null": true, * "4083927_39_null_276_null": true * }` */ statuses: Record<string, boolean>; /** * Is system (-1) or size of system (number) * * (`-1`) not a system * * (`system_size`) e.g. 3 events with 2 each, so we pass (2) */ systemIndex: number; }; export type TSignUpPayload = { /** * UID Сайта партнера, например, "betbooster.win" */ PartnerSiteUid: string; FirstName?: string; MiddleName?: string; EmailOrPhone: string; /** * @deprecated * Устарело, неорбходимо использовать PointId */ CurrencyId?: number; /** * Новое поле, которое обозначает ID кассы, которое определяет валюту */ PointId?: number; Password: string; PasswordRepeat: string; UrlRedirect?: string; /** * Subject for e-mail */ EmailSubject?: string; /** * e-mail text Body. * Some text with {userHash}, and {userHash} can be in multiple places in {userHash} of this text. * Instead of "{userHash}", the authorisation token must be substituted in all places. */ EmailBody?: string; EmailFrom?: string; ConfirmUrl?: string; Culture?: string; }; export type TGetMovementOfMoney = { result: { income: boolean; sign: string; id: number; typeId: number; typeName: string; date: string; value: number; amount: number; bonus: number; balance: number; }[]; }; export interface TAddBetslip { culture: string; /** ID События */ eId: number; /** ID Ставыки */ bId: number; /** Коэфициент */ r: number; /** Размер Форы или Тотала */ fs: number | null; /** Доп. параметр */ a1: number | null; /** Доп. параметр */ a2: number | null; isLive: boolean; } export interface TCouponEdited { BetId: number; DoAcceptOddsChanges: boolean; BetContentWeb: IBetContentWeb[]; Culture: string; } export interface IBetContentWeb { BetContent: IOddsEdited; IdOldBet: number; } export interface IOddsEdited { Odds: number; LinesID: number; BetVarID: number; Add1: number; Add2: number; HandSize: number; IsBonus: boolean; IsLive: boolean; } export interface IUser { UserId?: number; [key: string]: string | number | null | boolean | object | undefined; } declare enum EFavoriteType { Tournament = 0, Event = 1, LiveEvent = 2, LineEvent = 3, None = 4 } declare enum EPaymentSystemTypeEnum { /** Не указана платёжная система */ None = 0, /** Ручной ввод/вывод денег */ Manual = 1, /** Система WebMoney */ WebMoney = 2, /** SmsProxy */ SmsProxy = 3, /** Ваучеры */ Voucher = 4, /** Ввод/вывод денег через кассу */ Cashier = 5, /** Система LiqPay */ LiqPay = 6, /** Не поддерживаем */ UnSupported = 7, /** OSMP system */ Osmp = 8, /** ePay system */ EPay = 9, /** MoneyBookers */ MoneyBookers = 10, /** PayPal */ PayPal = 11, /** MegaPay */ MegaPay = 12, /** Tandem */ Tandem = 13, /** TelCell */ TelCell = 14, /** WalletOne */ WalletOne = 15, /** OkPay */ OkPay = 16, /** EDram */ EDram = 17, /** ArCa */ ArCa = 18, /** TotoCards */ ScratchCardsToto = 19, /** bonus for register */ AccountBonus = 20, /** Pay2pay */ Pay2Pay = 21, /** InterKassa */ InterKassa = 22, /** AlliedWallet Custom Pay(Bank cards) */ AlliedWallet = 23, /** Terminal kz system */ CyberPlat = 24, /** EasyPay */ EasyPay = 25, /** Terminal kz system */ Altel = 26, /** Партнер Нижний Новгород */ PartnerNN = 27, /** BetsStore скачки */ BetsstoreHorseRace = 28, /** BetsStore ставки */ BetsstoreBets = 29, /** BetsStore бонусы */ BetsstoreBonus = 30, /** www.dengionline.com */ DengiOnline = 31, /** DengiOnlineLiqPay */ DengiOnlineLiqPay = 32, /** DengiOnlineIPayMTS */ DengiOnlineIPayMTS = 33, /** DengiOnlineIPayLife */ DengiOnlineIPayLife = 34, /** DengiOnlineQiwi */ DengiOnlineQiwi = 35, /** Golden Race */ GoldenRace = 44, /** qiwi */ QiWi = 45, /** beeline */ Beeline = 46, /** PayTrio */ PayTrio = 47, /** FcPay */ FcPay = 48, /** слоты http://flashslots.s3.amazonaws.com */ FlashSlots = 49, /** XProGamingCasino */ XProGamingCasino = 50, /** BetsStore Kassa24 */ BetsstoreKassa24 = 51, /** BetsStore Wooppay */ BetsstoreWooppay = 52, /** map attack bets */ MapAttackBets = 53 } declare enum EBetslipType { Ordinar = 0, Express = 1, System = 2 } declare enum ETransactionType { /** (default) all without internal; */ AllWithoutInternal = 0, /** external deposit */ ExternalDeposit = 1, /** external withdraw */ ExternalWithdraw = 1, /** internal win bets */ InternalWinBets = 3, /** Internal loss bets */ InternalLossBets = 4, /** Internal bets in work */ InternalBetsInWork = 5 } export type TBetslipSettings = { UserId: number; IsOneClick: boolean; OneClickAmount: number; IsAgreeChangeUp: boolean; IsAgreeChangeDown: boolean; IsAgreeChangeTotal: boolean; IsDeleteCupons: boolean; DeleteCuponsTime: number; FavAmount1: number; FavAmount2: number; FavAmount3: number; }; export type TPersonalData = { Country: string; TimeZone: string; PostalCode: string; Region: string; City: string; Address: string; Phone: string; Email: string; Image: string; [key: string]: string; }; declare enum EPeriodType { /** Не определено (используется для выбора даты) */ None = 0, /** За сегодня */ Today = 1, /** За вчера */ Yesterday = 2, /** За последние 7 дней */ Last7Days = 3, /** За последние 14 дней */ Last14Days = 4, /** За последние 30 дней */ Last30Days = 5, /** За последние 2 дня */ Last2Days = 6, /** За последнюю неделю */ LastWeek = 7, /** За сутки(с начальной даты) */ SelectedDate = 8 } export interface IResponseData<T> { data: T; status: number; statusText: string; error?: string | null; } export interface IApiResponse<T = any> { Data: T; Ok: boolean; Error: string; } export interface IIntgrGetGamesListPayload { /** Suppliers */ suppliers?: number[]; /** Group ID to which the site is linked */ groupId: number; /** Specific games */ games?: string[]; /** String to search games by name */ searchName?: string; /** List of providers */ providers?: { Name: string; CountGames: number; }[]; /** List of game types */ types?: string[]; /** Platform (e.g., mobile, desktop) */ platforms: "mobile" | "desktop"; /** Maximum number of items */ maxItems?: number; } export interface IIntgrInitGamePayload { /** ID of the integrator partner SQ:2, SI:1, CH:?, PP:? */ suppliers: number; gameid: number | string; /** url to which the page is returned after the game is closed */ backurl: string; /** Game mode: 0 for virtual (fun) or 1 for real (real). Default: 1. */ mode: number; /** Language code in ISO 639-1 alpha-2 format for downloading localisation. Default: "en". */ language: string; /** The platform from which the game was launched: "desktop" or "mobile". Specify "mobile" if you want to open the mobile client of the game. Default: "desktop". */ clientPlatform: "mobile" | "desktop" | "retail"; } export interface RedisPrematchSearchParams { locale?: string; searchString?: string | null; negativeString?: string | null; sportId?: number | null; tournamentId?: number | null; LIMIT?: { from: number; size: number; } | null; } /** * Represents a value that can be used as a parameter in Redis search operations. * * @remarks * This type union allows for flexible parameter handling in Redis search queries, * supporting single values, arrays of values, or null/undefined states. * * @example * ```typescript * const stringParam: RedisSearchParamValue = "user123"; * const numberParam: RedisSearchParamValue = 42; * const arrayParam: RedisSearchParamValue = ["tag1", "tag2", 100]; * const nullParam: RedisSearchParamValue = null; * ``` */ export type RedisSearchParamValue = string | number | (string | number)[] | null | undefined; /** * Options for sorting Redis data structures. * * @remarks * When defined, specifies the field to sort by and the sort direction. * Can be null or undefined to indicate no sorting should be applied. * * @example * ```typescript * const sortOptions: RedisSortOptions = { * BY: 'score', * DIRECTION: 'DESC' * }; * ``` */ export type RedisSortOptions = { BY: string; DIRECTION: "ASC" | "DESC"; } | null | undefined; /** * Type definition for Redis search parameters used to query prematch event IDs. * * @remarks * This type defines the structure for search parameters when querying Redis for prematch events. * All search parameters except locale are optional and can be used to filter results. * * @example * ```typescript * const searchParams: TRedisSearchPrematchIds = { * locale: 'en', * sportId: 1, * countryId: 'US', * LIMIT: { from: 0, size: 50 } * }; * ``` */ export type TRedisSearchPrematchIds = { locale: string; sportId?: RedisSearchParamValue; countryId?: RedisSearchParamValue; tournamentId?: RedisSearchParamValue; teams?: RedisSearchParamValue; LIMIT?: { from: number; size: number; } | null; SORT?: RedisSortOptions; }; export declare function routeNameId(id: number | string, text?: string): string; export declare function clearPhone(draftPhoneNumber: number | string, prefix?: string, suffix?: string): string; export declare class BetBoosterApi { private _baseUrl; /** * A clean superagent instance that can be used for http requests */ axi: AxiosInstance; private _locale; private _locales; private _languageIdsRemote; private EXIST_LANGUAGES; private _languageId; private _lang; private _TOKEN?; private _USER_DATA; private LANG_DEFAULT; private LOCALE_DEFAULT; private LANG_ID_DEFAULT; private maxTimeExecutionMs; liveTimestamp: string | number; private _liveTimestampReset; liveRecivedIsFullPackage?: boolean; isNotActive?: boolean; /** * Represents the BetBoosterApi class. * @constructor * @param {AxiosInstance} axiosInstance - The Axios instance to be used for making HTTP requests. Aka axios.create() * @param {string} baseUrl - The base URL of the API. * @param {string} [lang='en'] - The language to be used for API requests. Defaults to 'en'. * @param {number} [maxTimeExecutionMs=15000] - The maximum time allowed for API request execution in milliseconds. Defaults to 15000. * @param {boolean} [isDev=false] - Indicates whether the API is running in development mode. Defaults to false. */ constructor(axiosInstance: AxiosInstance, baseUrl: string, lang?: string, maxTimeExecutionMs?: number, isDev?: boolean); get locale(): string; get isSinged(): boolean; get user(): IUser; get userMain(): string[]; set user(value: IUser); get lang(): string; get languageId(): number; get token(): string | undefined; set token(value: string | undefined); /** * Processes the response data and returns an object with data, error, status and status text. * * @template T - Тип данных, возвращаемых в поле `data`. * @param {any} rawData - Сырые данные ответа. * @param {number} status - HTTP статус ответа. * @param {string} statusText - Текст статуса HTTP ответа. * @returns {{ data: T, error: string | null, status: number, statusText: string }} Объект, содержащий данные ответа, ошибку, статус и текст статуса. */ responseHandlerData<T = any | null>(rawData: any, status: number, statusText: string): { data: T | null; error: string | null; status: number; statusText: string; }; /** * Converts rawData.Data.Data format to rawData.Data.data format * Sometimes API returns a format that is difficult to process later. * Therefore it is necessary to convert the format for proper data processing (responseHandlerData) * @param rawData * @returns */ private convertDataData; setDevMode(devMode?: boolean | undefined): void; /** * Adds new locale keys and values to the existing locales. * Updates the list of existing languages with any new language codes found in the provided data. * * @param localesData - An object mapping locale keys to their translations * @example * // Add new translations * betBoosterApi.addLocalesConverters({ * 'en': 'en-US', * 'fr': 'fr-FR' * }); */ addLocalesConverters(localesData: Record<string, string>): void; checkLanguage(lang?: string): string; /** * Sets the language for the BetBooster API. * * @param {string} [lang='en'] - The language code to set. Defaults to 'en' if not provided. * @returns {string} - The language code that was set. * @example * ``` * api.setLanguage('en'); * ``` * as result: * lang='en'; * locale='en-US'; * languageId=1; */ setLanguage(lang?: string): string; /** * Sets the language and locale for the remote API. * @param lang Language (default 'en'). * @returns Returns true if the language and locale are successfully set, otherwise returns false. */ setLanguageRemoteLocale(lang?: string): Promise<any>; private setBaseUrl; private statusHandler; /** * Query string handler. Replaces values * * `null` на `'null'` * * `false` на `'false'` * * `true` на `'true'` * * `undefined` на `''` * @param queryStringData - queryString Record<string, any> * @returns The processed data of the query string. */ private queryStringHandler; private responseHandler; /** * Error Handler for Axios. * * @param error - AxiosError object. * @returns An object with error data, including the status and text of the error. */ private axiosErrorHandler; /** * Returns the URL for the specified API path and version. * * @param apiPath - API Pathway. * @param apiVersion - API Version. * @returns URL for the specified API path and version. */ private url; /** * Executes an HTTP request with the specified parameters. * @param url - The URL to execute the request. * @returns An object that contains methods for configuring the request and executing the request. */ request(url: string): { /** * Executes a query with the specified parameters. * @param queryParams - Query Parameters. * @returns An instance of BetBoosterOfficeApi class. */ query(queryParams?: Record<string, unknown> | object): any; /** * Sets the headers of the request.Sets the headers of the request. * @param headers - Query header object. * @returns An instance of BetBoosterOfficeApi class. */ headers(headers?: Record<string, string>): any; deleteAllHeaders(): any; /** * Sets the method of the GET request. * @returns An instance of BetBoosterOfficeApi class. */ GET(): any; /** * Sets the POST request method. * @param payload - The payload for the enquiry. * @returns An instance of BetBoosterOfficeApi class. */ POST(payload?: Record<string, unknown> | object): any; /** * Устанавливает метод запроса PUT и устанавливает тело запроса. * @param payload - Данные, которые будут отправлены в теле запроса. * @returns Экземпляр класса BetBoosterOfficeApi с установленным методом запроса PUT и телом запроса. */ PUT(payload?: Record<string, unknown> | object): any; /** * Устанавливает метод запроса DELETE. * @param payload Данные запроса в формате объекта или записи. * @returns Экземпляр класса BetBoosterOfficeApi. */ DELETE(payload?: Record<string, unknown> | object): any; /** * Выполняет запрос к API. * * @returns Объект, содержащий данные, статус и текст статуса ответа. * ``` * { data, status, statusText } * ``` */ exec<T>(): Promise<IResponseData<T>>; /** * Получает значение. * @returns Промис, который разрешается с данными. */ value<T>(): Promise<void>; }; /** * Sends a GET request to the specified endpoint with optional query parameters and options. * @param url - The endpoint to send the GET request to. * @param queryParams - The query parameters to include in the request URL. Defaults to an empty object. * @param headers - The options to include in the request. Defaults to an empty object. * @returns A Promise that resolves to the response body of the GET request. */ GET(url: string, queryParams?: Record<string, unknown> | object, headers?: Record<string, string>): Promise<any>; POST(url: string, payload?: Record<string, unknown> | object, queryParams?: Record<string, unknown> | object, headers?: Record<string, string>): Promise<any>; DELETE(url: string, payload?: Record<string, unknown> | object, queryParams?: Record<string, unknown> | object, headers?: Record<string, string>): Promise<any>; PUT(url: string, payload?: Record<string, unknown> | object, queryParams?: Record<string, unknown> | object, headers?: Record<string, string>): Promise<any>; /** * Returns the list of prematch sports * * @param minutes The number of minutes to consider for the data retrieval. Defaults to 0. * @returns {Promise<Array<any>>} A promise that resolves to an array of line sports data. */ getLineSports(minutes?: number): Promise<ISport[]>; /** * Retrieves the hot prematch events * @returns {Promise<Array<any>>} A promise that resolves to an array of hot events. */ getHotEvents(): Promise<any[]>; /** * Получает список стран для указанного идентификатора спорта. * @param sportId - Идентификатор спорта. * @param minutes - Опциональный параметр, количество минут. * @returns Промис, который разрешается в массив объектов типа ICountry. */ getCountriesList(sportId: number, minutes?: number): Promise<ICountry[]>; /** * Retrieves prematch tournaments based on the specified sport ID, country ID, and minutes. * @param sportId - The ID of the sport. * @param countryId - The ID of the country. * @param minutes - The number of minutes ago for which data is to be retrieved. * @returns A promise that resolves to an array of prematch tournaments. */ getPrematchTournaments(sportId: number, countryId: number, minutes?: number): Promise<GetPrematchTournament[]>; /** * Retrieves prematch tournaments based on the specified sport ID and minutes. * @param sportId - The ID of the sport. * @param minutes - The number of minutes ago for which data is to be retrieved. * @returns A filtered list of prematch tournaments. */ getPrematchTournamentsByMinutes(sportId?: number, minutes?: number): Promise<any>; /** * Retrieves the headers of prematch tournaments based on the specified sport ID and minutes. * @param sportId The ID of the sport. Defaults to 0 if not provided. * @param minutes - The number of minutes ago for which data is to be retrieved. * @returns A promise that resolves to an array of tournament headers. */ getPrematchTournamentsHeadersByMinutes(sportId?: number, minutes?: number): Promise<any>; /** * Retrieves prematch events based on the specified parameters. * @param sportId - The ID of the sport. * @param countryId - The ID of the country. * @param tournamentId - The ID of the tournament. * @param minutes - The number of minutes ago for which data is to be retrieved. * @returns A Promise that resolves to an array of prematch events. */ getPrematchEvents(sportId: number, countryId: number, tournamentId: number, minutes: number): Promise<any>; /** * Sets or resets the live timestamp reset flag. * * @param value - Whether to enable live timestamp reset. Defaults to true. */ liveTimestampReset(value?: boolean): void; /** * Retrieves an array of live event headers with main bets. * @description For interval request execution, the parameter ```this.liveTimestamp``` * stored in this class is used. After the request is executed, ```this.liveTimestamp``` * is updated from the response. * @param requestFullEventsList - Flag indicating whether to request * the full list of events or only changes since the previous request. * @param events - Array of live event IDs. In this case, the selected live events are returned with all bets. * @returns A promise that resolves to an array of live event data. */ getLive(requestFullEventsList?: boolean, events?: (number | string)[]): Promise<ILiveDataResponce>; /** * Retrieves complete data on current live events without saving the timestamp. * @returns A promise that resolves to an array of objects of type I.ILiveData. */ private getFullLiveWithoutSaveTimeStamp; /** * Возвращает массив из одного полного лайв события со всеми ставками по ID . * @param eventId - ID полного live события. * @returns Массив с информацией о событии. */ getLiveEventsAndFullEvent(eventId: number | string): Promise<ILiveData[]>; /** * Returns an array containing a single complete live event with all bets by ID. * @param eventId - The ID of the complete live event. * @returns An array with event information. */ getLiveEventFull(eventId: number | string): Promise<ILiveData>; /** * Retrieves a pre-match event by its ID. * @param eventId - The event identifier. * @returns The pre-match event object. */ getEventPrematch(eventId: number | string): Promise<any>; verifyEmail(token: string): Promise<any>; /** * Registers a new user. * @param payload - Data for registration. * @returns A promise that resolves with the registered user data. * @example * ``` * const payload = { * PartnerSiteUid: string; * FirstName?: string; * MiddleName?: string; * EmailOrPhone: string; * CurrencyId?: number; // <- Refer to Swagger !!! * PointId?: number; // <- Refer to Swagger !!! * Password: string; * PasswordRepeat: string; * UrlRedirect?: string; * EmailSubject?: string; * EmailBody?: string; * EmailFrom?: string; * ConfirmUrl?: string; * Culture?: string; * } * ``` */ signUp(payload: TSignUpPayload): Promise<any>; /** * Registers a new user via email. * ! NEW METHOD * @param payload - Data for registration. * @returns A promise that resolves with the registered user data. * @example * ``` * const payload = { * "FirstName": "string", * "MiddleName": "string", * "EmailOrPhone": "string", * "PointId": 0, // <- Refer to Swagger !!! * "CurrencyId": 0, // <- Refer to Swagger !!! * "Password": "string", * "PasswordRepeat": "string", * "Culture": "string", * "EmailSubject": "string", * "EmailFrom": "string", * "EmailBody": "string", * "PartnerSiteUid": "string" * } * * ``` */ signUpViaEmail(payload: TSignUpPayload): Promise<any>; /** * Registers a new user directly in the database without confirmation. * @param payload - Data for registration. * @returns A promise that resolves with the registered user data. * @deprecated use createInternetUser() method * @example * ``` * const payload = { * "FirstName": "string", * "MiddleName": "string", * "EmailOrPhone": "string", * "PointId": 0, // <- Refer to Swagger !!! * "CurrencyId": 0, // <- Refer to Swagger !!! * "Password": "string", * "PasswordRepeat": "string", * "Culture": "string", * "EmailSubject": "string", * "EmailFrom": "string", * "EmailBody": "string", * "PartnerSiteUid": "string" * } * * ``` */ signUpDirect(payload: TSignUpPayload): Promise<any>; /** * Creates an internet user for the cash register directly in the database. * @param payload - User registration parameters. * @returns An object containing information about the result of the operation. * @example * const SignUpPayloadDirect: I.TSignUpPayload = { * PartnerSiteUid: "partner.win", * EmailOrPhone: "380671110000", // phone number without "+" * PointId: 85, // <- Refer to Swagger !!! * CurrencyId: 85, // <- Refer to Swagger !!! * Password: "Password", * PasswordRepeat: "Password", * } */ createInternetUser(payload: TSignUpPayload): Promise<{ created: boolean | null; error: string | null; status: number; statusText: string; }>; /** * get a list of sports for the period * @param {string} from формат "DDMMYYYY" * @param {string} to формат "DDMMYYYY" * @returns */ getResultsSports(from: string, to: string): Promise<any>; /** * Retrieves tournament results by sport ID. * @param sportId - The sport identifier. * @param from - The start date as a string. * @param to - The end date as a string. * @returns A list of tournament results. */ getResultsTournamentsBySportId(sportId: number | string, from: string, to: string): Promise<any>; /** * Get results * @param {*} sportId - The sport identifier. * @param {*} countryId - The country identifier. * @param {*} tournamentId - The tournament identifier. * @param {*} from - The start date. * @param {*} to - The end date. * @returns The results. */ getResultsGrid(sportId: number | string, countryId: number | string, tournamentId: number | string, from: string, to: string): Promise<any>; /** * Returns all games providers for the 21st game each */ getGamesProvidersTopGames(): Promise<any>; /** * Retrieves the list of top game providers for games. * @returns {Promise<Array<any>>} The list of top game providers. */ getGamesTopProviders(): Promise<Array<any>>; /** * Retrieves the list of slots. * @returns {Promise<Array<any>>} The list of slots. */ getSlotsList(): Promise<Array<any>>; /** * Opens a session for Outcome slots * @deprecated * */ createSlotOutcome(game_id: number | string): Promise<{}>; /** * Creates a slotintegrator DEMO. * @param model - The model containing the data for the slot integrator demo. * @returns A Promise that resolves to the parsed JSON response from the server. */ createSlotIntegratorDemo(model: Record<string, unknown>): Promise<any>; /** * Initiates SlotIntegrators REAL Game * @example * ```javascript const model = { "game_uuid": "string", "player_id": "string", "player_name": "string", "currency": "string", "session_id": "string", "language": "string", } * ``` */ createSlotIntegratorReal(model: Record<string, unknown>): Promise<any>; /** Возвращает список провайдеров с логотипами */ getSlotIntegratorProvidersHeaders(): Promise<any>; /** Retrieves all games for a given slot integrator provider. * @param {string} providerName - The name of the provider. * @returns {Promise<Array>} - A promise that resolves to an array of games. */ getSlotIntegratorProviderAllGames(providerName: string): Promise<Array<any>>; /** Retrieves games by the given game name. * @param {string} gameName - The name of the provider. * @returns {Promise<Array>} - A promise that resolves to an array of games. */ getSlotIntegratorFilteredGames(gameName: string): Promise<Array<any>>; /** * Asynchronously performs login. * @description If the login is successful, saves the token in the class property `token` * and saves the object representing the user in the class property `user`. * These properties are subsequently used for processing requests. * @param login - The user's login. * @param password - The user's password. * @returns An object representing the user if the login is successful. Otherwise, returns an empty object. */ login({ login, password }: { login: string; password: string; }): Promise<IUser>; /** * Retrieves user data. * @returns User data or null if the user is not found. * @deprecated use this.getUserData() */ getUserData_OLD(): Promise<any>; getUserData(): Promise<{ data: any; error: string | null; status: number; statusText: string; }>; /** * @deprecated use this.getUserData() */ getUserFullData(): Promise<{ data: any; error: string | null; status: number; statusText: string; }>; /** * Logs the user out of the system. * @returns An object containing information about the success of the logout and the user's authorization status. */ logout(): Promise<{ ok: boolean; isLogged: any; }>; /** * Retrieves the user's balance. * @returns A promise that resolves to the user's balance. * @deprecated use this.getBalance(); */ balance(): Promise<{ Amount: number; } | {}>; getBalance(): Promise<{ data: string | null; error: string | null; status: number; statusText: string; }>; /** * Changes the user's password. * @param postBody - An object containing the data for changing the password. * @returns Returns `null` if the user is not authorized. */ changePassword(postBody: IChangePassword): Promise<{ ok: boolean; status: any; }>; /** * Converts a number to a GUID string. * It is used in the "Sslotegrator" * @param userId - The number to convert to a GUID. * @returns The GUID string. */ longToGuid(userId: number): string; /** * Retrieves sports events (live & prematch) based on the provided search text. * @param searchText - The text to search for. * @returns A promise that resolves to an array of ISearchEventsData. */ getSportsEventsSearch(searchText: string): Promise<ISearchEventsData[]>; /** * Retrieves the favorites from the BetBooster API. * @returns {Promise<any[]>} A promise that resolves to an array of favorites. */ getFavorites(): Promise<any>; /** * Adds an item to the favorites list. * @param id - The ID of the item to add. * @param type - The type of the item to add. Types: 0 = "Tournament"; 1 = "Event"; 2 = "LiveEvent"; 3 = "LineEvent"; 4 = "None"; * @returns A promise that resolves to a boolean indicating whether the item was successfully added to the favorites list. */ addFavorite(id: number, type: EFavoriteType): Promise<boolean>; /** * Removes a favorite item. * @param favoriteId - The ID of the favorite item to be removed. * @returns A promise that resolves to a boolean indicating whether the removal was successful. */ removeFavorite(favoriteId: number): Promise<boolean>; /** * Retrieves the user's wallets. * @param psType - The type of payment system (default is 5 - cashier). * @returns The user's wallets. */ getPurses(psType?: EPaymentSystemTypeEnum): Promise<any>; sendWithdrawal(apiPath: string, request: any): Promise<void>; /** * Sends a withdrawal request to the cashier. * @param payload - Parameters for the withdrawal request. * @returns An object with the result of the withdrawal operation. */ sendWithdrawalAgent(payload: IPayloadWithdrawal): Promise<{ ok: boolean; balance: number; userOrders: any; status?: undefined; } | { ok: boolean; status: any; balance?: undefined; userOrders?: undefined; }>; /** * Cancels a requested withdrawal transaction. * @param payload - Parameters for canceling the requested transaction. * @returns An object with information about the success of the transaction cancellation and the user's balance. */ cancelOrderedTransaction(payload: IPayloadCancelOrderedTransaction): Promise<{ ok: boolean; status: number; balance?: undefined; userOrders?: undefined; } | { ok: boolean; balance: number; userOrders: any; status?: undefined; }>; /** * Obtains information on cash flow. * @param payload - Query Parameters. * @returns An object with the result of the query. */ getMovementOfMoney(payload: IGetMovementOfMoneyPayload): Promise<TGetMovementOfMoney>; /** * Retrieves a list of ordered transactions. * * @returns Ordered transactions or an empty array if the user is not authorized. */ getOrderedTransactions(): Promise<any>; /** * Retrieves the content of a bet by betId. * @param betId - The bet identifier. * @returns The content of the bet. */ getBetContent(betId: number): Promise<any>; /** * Retrieves user bets. * @param payload - Request parameters. * @returns A promise that resolves with the result of the request. * @note The page size should not exceed 20 rows per page. * @deprecated Use the getUserBets02 method. */ getUserBets(payload: TGetUserBetsPayload): Promise<any>; /** * Retrieves user bets. * @param payload - Request parameters. * @returns A promise that resolves with the result of the request. * @note The page size should not exceed 20 rows per page. */ getUserBets02(payload: TGetUserBetsPayload): Promise<{ data: any; error: string | string[] | null; status: number; statusText: string; }>; /** * Retrieves the odds data for editing based on the provided payload. * * @param payload - The extended bet slip information required to fetch odds for editing. * @returns A promise that resolves to an object containing the data, any errors, and the HTTP response status information. */ getOddsForEdit(payload: TAddBetslip): Promise<{ data: any; error: string | string[] | null; status: number; statusText: string; }>; /** * Edits an existing coupon with the provided payload. * * @param payload - The coupon data to be edited, conforming to the `I.TCouponEdited` interface. * @returns A promise that resolves to an object containing: * - `data`: The response data from the API. * - `error`: Any error messages returned by the API, either as a string or an array of strings. Can be `null` if no errors occurred. * - `status`: The HTTP status code of the response. * - `statusText`: The HTTP status text corresponding to the status code. */ placeCouponEdited(payload: TCouponEdited): Promise<{ data: any; error: string | string[] | null; status: number; statusText: string; }>; /** * Retrieves the cashout information for the specified user bets. * * @param BetIds - An array of bet IDs for which to check the cashout information. * @returns A promise that resolves to an object containing the data, error, status, and statusText. * - data: The response data from the API. * - error: Any error message(s) returned by the API, or null if no errors occurred. * - status: The HTTP status code of the response. * - statusText: The HTTP status text of the response. */ getUserBetsCashout(BetIds: number[]): Promise<{ data: any; error: string | string[] | null; status: number; statusText: string; }>; /** * Processes a cashout return bet request. * @param payload - The cashout bet parameters * @param payload.betId - The ID of the bet to cash out * @param payload.cashOutAmount - The amount to cash out * @param payload.DoAcceptOddsChanges - Whether to accept odds changes * @returns A promise containing response data, error information, HTTP status code and status text * @returns {data} The response data from the API * @returns {error} Error message(s) if any occurred, null otherwise * @returns {status} HTTP status code * @returns {statusText} HTTP status message */ returnCashoutBet(payload: { betId: number; cashOutAmount: number; DoAcceptOddsChanges: boolean; }): Promise<{ data: any; error: string | string[] | null; status: number; statusText: string; }>; /** * Creates a coupon for placing a bet. * @param betslip - An array with information about the bets. * @param amount - The bet amount. * @param acceptChangeCoefs - A flag indicating whether to accept changes in coefficients. * @param systemIndex - The size of the system (e.g., for 3 events with 2 combinations, pass 2). Default value: -1 (if not a system). * @returns The created coupon for placing a bet. */ createCoupon(betslip: any[], amount: number, acceptCahngeCoefs: boolean, systemIndex?: number): TPlaceBetPayload; /** * Places a bet. * @param payload - Parameters for placing the bet. * @returns The result of placing the bet. */ placeCoupon(payload: TPlaceBetPayload): Promise<any>; /** * Places a bet on behalf of BetShop. * @param payload - Parameters for placing the bet. * @returns The result of placing the bet. */ placeCouponBetShop(payload: TPlaceBetPayload): Promise<any>; /** * Checks the status of a bet by coupon number. * Used for BetShop when users try to check * whether the bet won or lost. * @param {string} couponCode - The coupon number. * @returns The result of the bet. */ getBetShopCouponByCode(couponCode: string): Promise<{ data: any; error: string | null; status: number; statusText: string; } | undefined>; /** * Checks if a user with the specified login exists. * @param login - The user's login. * @returns A promise that resolves with the result of the check. */ loginIsExist(login: string): Promise<any>; /** * Checks if the specified email exists in the system. * @param email - The email to check. * @returns A promise that resolves with the result of the check. */ emailIsExist(email: string): Promise<any>; /** * Updates the user's personal data. * @param personalData - An object containing the user's personal data. * @returns Returns true if the data was successfully updated, otherwise returns false. */ changePersonalData(personalData: TPersonalData): Promise<boolean>; /** * Retrieves all messages. * @param page - The page number. * @param pageSize - The page size. * @returns An array of messages. */ getMessagesAll({ page, pageSize }: { page: number | string; pageSize: number | string; }): Promise<any>; /** * Retrieves a message by its identifier. * @param id - The message identifier. * @returns The message object or an empty object if the message is not found. */ getMessageById(id: number): Promise<any>; /** * Sends a message to a user. * @param {Object} params - Parameters for sending the message. * @param {number} params.ToUserId - The identifier of the user to whom the message is sent. * @param {string} params.Text - The text of the message. * @param {string} params.Subject - The subject of the message. * @param {number} params.ParentId - The identifier of the parent message (if any). * @returns {Promise<any>} - A promise that resolves with the result of sending the message or null if sending is not possible. */ sensMessage({ ToUserId, Text, Subject, ParentId }: { ToUserId: number; Text: string; Subject: string; ParentId: number; }): Promise<any>; /** * Marks a message as read. * * @param {Object} params - Request parameters. * @param {number} params.MessageId - The message identifier. * @param {number} params.MessageTypeId - The message type identifier. * @returns {Promise<any>} - A promise that resolves with the result of the request or null if the user is not authorized. */ markMessageAsRead({ MessageId, MessageTypeId }: { MessageId: number; MessageTypeId: number; }): Promise<any>; /** * Deletes a message by the specified message ID and type. * @param {Object} params - Parameters for deleting the message. * @param {number} params.MessageId - The message identifier. * @param {number} params.MessageTypeId - The message type identifier. * @returns {Promise<{ Result: boolean; Id: number } | null>} - An object containing the result of the deletion and the ID of the deleted message, or null if the deletion failed. */ deleteMessage({ MessageId, MessageTypeId }: { MessageId: number; MessageTypeId: number; }): Promise<{ Result: boolean; Id: number; } | null>; /** * Deletes all messages. * @returns A promise that resolves to true, false, or null. */ deleteMessagesAll(): Promise<true | false | null>; /** * Retrieves the number of messages. * @returns An object containing the count of all messages, mass messages, and personal messages. * If the user is not authorized, returns null. */ getMessagesCount(): Promise<{ All: number; Mass: number; Personal: number; } | null>; /** * Retrieves the number of unread messages. * @returns The number of unread messages or null if the user is not authorized. */ getMessagesUnreadCount(): Promise<number | null>; /** Checks if the user exists in the temporary table */ isUserTempExist(userName: string): Promise<boolean | null>; /** * Creates a user only in the temporary table. */ createUserTemp(payload: any): Promise<boolean | null>; /** * Returns a list of GoldenRace games. */ getGamesListGR(payload?: TGetGameListGoldenRacePayload): Promise<{ data: any[] | null; error: string | null; status: number; statusText: string; }>; /** * Asynchronous method to get the GoldenRace game frame. * * @param payload - An object with parameters for the request. * @param payload.game - The game identifier. gameId is a required parameter. * @param payload.backurl - The URL to which the game redirects in case of an unexpected error or is used for client configurations such as the lobby URL for mobile games. Required parameter. * @param payload.mode - The game mode: 0 for virtual (fun) or 1 for real. Default: 1. * @param payload.language - The language code in ISO 639-1 alpha-2 format for loading localization. Default: "en". * @param payload.clientPlatform - The platform from which the game was launched: "desktop" or "mobile". Specify "mobile" if you want to open the mobile client of the game. Default: "desktop". * @param payload.group - The user group. In the configuration, this is essentially the cashier number. Required parameter. * @returns An object with response data, error (if any), status, and status text. */ getGameFrameUrlGR(payload: TGetGameFrameGoldenRacePayload): Promise<{ data: string | null; error: string | null; status: number; statusText: string; }>; pingApi(): Promise<{ data: IApiResponse<any> | null; error: string | null; status: number; statusText: string; }>; intgrGetGamesList(payload: IIntgrGetGamesListPayload): Promise<{ data: any[] | null; error: string | null; status: number; statusText: string; }>; intgrGetGameTypes(groupId: number | string): Promise<{ data: any[] | null; error: string | null; status: number; statusText: string; }>; intgrGetProvidersList(groupId: number | string): Promise<{ data: any[] | null; error: string | null; status: number; statusText: string; }>; intgrGetTopGames(groupId: number | string): Promise<{ data: any[] | null; error: string | null; status: number; statusText: string; }>; intgrInitGame(payload: IIntgrInitGamePayload): Promise<{ data: any[] | null; error: string | null; status: number; statusText: string; }>; checkPromocode(promocode: string): Promise<void>; activatePromocode(promocode: any): Promise<void>; /** * @example * ``` const payload = { "isphone": this.typeLogin.phone, "login": clearLogin, } * ``` */ sendSms(payload: { isphone: string; login: string; }): Promise<void>; signUpPhone(request: any): Promise<void>; passwordRecoveryRequest(post: any): Promise<void>; passwordRecoveryEmail(email: string): Promise<void>; passwordSetNewByPhone(request: any): Promise<void>; passwordSetNewByEmail(request: any): Promise<void>; signUpEmail(request: any): Promise<void>; getUserPersonalInfo(): Promise<void>; sendPayment(apiPath: string, request: any): Promise<void>; setUserPersonalInfo(request: any): Promise<void>; getGamesToken(sToken: any): Promise<void>; getProviderHedlines(providerHash: string): Promise<void>; createTempSignUp({ login, password }: { login: string; password: string; }): Promise<void>; setRemoteLa