UNPKG

trade360-nodejs-sdk

Version:

LSports Trade360 SDK for Node.js

60 lines (59 loc) 3.15 kB
import { IHttpServiceConfig, IMapper } from '../../common'; import { InPlaySnapshotApiClient } from '../../snapshot-api/interfaces'; import { BaseHttpClient } from '../../base-http-client/index.js'; import { GetEventsResultElement, GetFixtureMarketsResultElement, GetFixturesResultElement, GetLivescoreResultElement } from '../../common/snapshot/responses'; import { GetFixtureRequestDto, GetInPlayEventRequestDto, GetLivescoreRequestDto, GetMarketRequestDto } from '../../common/snapshot/dtos'; /** * MetadataHttpClient class is responsible for sending requests * to the metadata API. It extends the BaseHttpClient class and * contains the logic for sending requests to the metadata API. * @param packageCredentials The package credentials for the API * @param snapshotApiBaseUrl The base URL of the snapshot API * @param logger The logger instance * @param mapper The mapper instance * @returns MetadataHttpClient instance that is responsible for * sending requests to the metadata API. * @extends BaseHttpClient class for sending requests to the * customers API. * @implements IMetadataHttpClient interface for sending * requests to the metadata API. * @see BaseHttpClient class for sending requests to the * customers API. * @see IMetadataHttpClient interface for sending requests to * the metadata API. * @see IHttpServiceConfig interface for the configuration of * the HTTP service. */ export declare class InPlaySnapshotApiClientImplementation extends BaseHttpClient implements InPlaySnapshotApiClient { private readonly mapper; constructor({ packageCredentials, restApiBaseUrl, logger }: IHttpServiceConfig, mapper: IMapper); /** * Sends a request to the snapshot API to get fixtures. * @param requestDto The request DTO for getting fixtures. * @returns A promise that resolves to a * GetFixturesResultElement object containing the fixtures information. */ getFixtures(requestDto: GetFixtureRequestDto): Promise<GetFixturesResultElement | undefined>; /** * Sends a request to the snapshot API to get livescores. * @param requestDto The request DTO for getting livescores. * @returns A promise that resolves to a * GetLivescoreResultElement object containing the livescores information. */ getLivescores(requestDto: GetLivescoreRequestDto): Promise<GetLivescoreResultElement | undefined>; /** * Sends a request to the snapshot API to get fixtures markets. * @param requestDto The request DTO for getting fixtures markets. * @returns A promise that resolves to a * GetFixtureMarketsResultElement object containing the fixtures * markets information. */ getFixtureMarkets(requestDto: GetMarketRequestDto): Promise<GetFixtureMarketsResultElement | undefined>; /** * Sends a request to the snapshot API to get events. * @param requestDto The request DTO for getting events. * @returns A promise that resolves to a * GetEventsResultElement object containing the events information. */ getEvents(requestDto: GetInPlayEventRequestDto): Promise<GetEventsResultElement | undefined>; }