package.dist.src.internal.leaderboard-data-client.d.ts Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of sdk Show documentation
Show all versions of sdk Show documentation
Client SDK for Momento services
The newest version!
import { LeaderboardDelete, LeaderboardFetch, LeaderboardLength, LeaderboardRemoveElements, LeaderboardUpsert, LeaderboardOrder } from '@gomomento/sdk-core';
import { leaderboard } from '@gomomento/generated-types/dist/leaderboard';
import { ILeaderboardDataClient } from '@gomomento/sdk-core/dist/src/internal/clients/leaderboard/ILeaderboardDataClient';
import { LeaderboardClientAllProps } from './leaderboard-client-all-props';
export declare const CONNECTION_ID_KEY: unique symbol;
export declare class LeaderboardDataClient implements ILeaderboardDataClient {
private readonly configuration;
private readonly credentialProvider;
private readonly logger;
private readonly cacheServiceErrorMapper;
private readonly requestTimeoutMs;
private readonly clientWrappers;
protected nextDataClientIndex: number;
private readonly interceptors;
/**
* @param {LeaderboardClientAllProps} props
* @param dataClientID
*/
constructor(props: LeaderboardClientAllProps, dataClientID: string);
close(): void;
private validateRequestTimeout;
private initializeInterceptors;
private createMetadata;
private convertMapOrRecordToElementsList;
upsert(cacheName: string, leaderboardName: string, elements: Record | Map): Promise;
private sendUpsert;
fetchByScore(cacheName: string, leaderboardName: string, minScore?: number, maxScore?: number, order?: LeaderboardOrder, offset?: number, count?: number): Promise;
private sendFetchByScore;
fetchByRank(cacheName: string, leaderboardName: string, startRank: number, endRank: number, order?: LeaderboardOrder): Promise;
private sendFetchByRank;
getRank(cacheName: string, leaderboardName: string, ids: Array, order?: LeaderboardOrder): Promise;
private sendGetRank;
length(cacheName: string, leaderboardName: string): Promise;
private sendLength;
removeElements(cacheName: string, leaderboardName: string, ids: Array): Promise;
private sendRemoveElements;
delete(cacheName: string, leaderboardName: string): Promise;
private sendDelete;
protected getNextDataClient(): leaderboard.LeaderboardClient;
}