@smartico/public-api 0.0.110 → 0.0.112

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,3 @@
1
+ import { LeaderBoardDetailsT } from "src/WSAPI/WSAPITypes";
2
+ import { LeaderBoardDetails } from "./LeaderBoardDetails";
3
+ export declare const getLeaderBoardTransform: (board: LeaderBoardDetails) => LeaderBoardDetailsT;
@@ -14,4 +14,6 @@ export interface LevelPublicMeta {
14
14
  dx: number;
15
15
  dy: number;
16
16
  };
17
+ /**custom data as string or JSON string that can be used in UIWidget */
18
+ custom_data: string;
17
19
  }
@@ -11,7 +11,7 @@ import { GetTournamentInfoResponse, GetTournamentsResponse, TournamentRegisterRe
11
11
  import { LeaderBoardDetails, LeaderBoardPeriodType } from "./Leaderboard";
12
12
  import { GetLevelMapResponse } from "./Level";
13
13
  import { WSAPI } from "./WSAPI/WSAPI";
14
- import { TInboxMessage, TInboxMessageBody, TLevel, TMiniGameTemplate, TMissionOrBadge, TStoreCategory, TAchCategory, TStoreItem, TTournament, TTournamentDetailed } from "./WSAPI/WSAPITypes";
14
+ import { TInboxMessage, TInboxMessageBody, TLevel, TMiniGameTemplate, TMissionOrBadge, TStoreCategory, TAchCategory, TStoreItem, TTournament, TTournamentDetailed, LeaderBoardDetailsT } from "./WSAPI/WSAPITypes";
15
15
  interface Tracker {
16
16
  label_api_key: string;
17
17
  userPublicProps: any;
@@ -77,6 +77,7 @@ declare class SmarticoAPI {
77
77
  tournamentsGetInfo(user_ext_id: string, tournamentInstanceId: number): Promise<GetTournamentInfoResponse>;
78
78
  tournamentsGetInfoT(user_ext_id: string, tournamentInstanceId: number): Promise<TTournamentDetailed>;
79
79
  leaderboardGet(user_ext_id: string, period_type_id?: LeaderBoardPeriodType, prevPeriod?: boolean): Promise<LeaderBoardDetails>;
80
+ leaderboardsGetT(user_ext_id: string, period_type_id?: LeaderBoardPeriodType, prevPeriod?: boolean): Promise<LeaderBoardDetailsT>;
80
81
  levelsGet(user_ext_id: string): Promise<GetLevelMapResponse>;
81
82
  levelsGetT(user_ext_id: string): Promise<TLevel[]>;
82
83
  getTranslationsT(user_ext_id: string, lang_code: string, areas: TranslationArea[], cacheSec?: number): Promise<GetTranslationsResponse>;
@@ -1,5 +1,6 @@
1
1
  import { SmarticoAPI } from "../SmarticoAPI";
2
- import { InboxMarkMessageAction, TAchCategory, TBuyStoreItemResult, TGetTranslations, TInboxMessage, TInboxMessageBody, TLevel, TMiniGamePlayResult, TMiniGameTemplate, TMissionOptInResult, TMissionOrBadge, TStoreCategory, TStoreItem, TTournament, TTournamentDetailed, TTournamentRegistrationResult, TUserProfile } from "./WSAPITypes";
2
+ import { InboxMarkMessageAction, LeaderBoardDetailsT, TAchCategory, TBuyStoreItemResult, TGetTranslations, TInboxMessage, TInboxMessageBody, TLevel, TMiniGamePlayResult, TMiniGameTemplate, TMissionOptInResult, TMissionOrBadge, TStoreCategory, TStoreItem, TTournament, TTournamentDetailed, TTournamentRegistrationResult, TUserProfile } from "./WSAPITypes";
3
+ import { LeaderBoardPeriodType } from "src/Leaderboard";
3
4
  /** @group General API */
4
5
  export declare class WSAPI {
5
6
  private api;
@@ -56,6 +57,10 @@ export declare class WSAPI {
56
57
  getTournamentInstanceInfo(tournamentInstanceId: number): Promise<TTournamentDetailed>;
57
58
  /** Requests registration for the specified tournament instance. Returns the err_code. */
58
59
  registerInTournament(tournamentInstanceId: number): Promise<TTournamentRegistrationResult>;
60
+ /** Returns the leaderboard for the current type (default is Daily). If getPreviousPeriod is passed as true, a leaderboard for the previous period for the current type will be returned.
61
+ For example, if the type is Weekly and getPreviousPeriod is true, a leaderboard for the previous week will be returned.
62
+ */
63
+ getLeaderBoard(periodType: LeaderBoardPeriodType, getPreviousPeriod?: boolean): Promise<LeaderBoardDetailsT>;
59
64
  /** Returns inbox messages based on the provided parameters. "From" and "to" indicate the range of messages to be fetched.
60
65
  * The maximum number of messages per request is limited to 20. An indicator "onlyFavorite" can be passed to get only messages marked as favorites.
61
66
  * You can leave this params empty and by default it will return list of messages ranging from 0 to 20.
@@ -1,6 +1,7 @@
1
1
  import { BuyStoreItemErrorCode } from "../Store";
2
2
  import { MiniGamePrizeTypeName, SAWBuyInTypeName, SAWGameTypeName, SAWSpinErrorCode } from "../MiniGames";
3
3
  import { TournamentRegistrationError, TournamentRegistrationStatusName, TournamentRegistrationTypeName } from "../Tournaments";
4
+ import { LeaderBoardPeriodType } from "src/Leaderboard";
4
5
  type TRibbon = 'sale' | 'hot' | 'new' | 'vip' | string;
5
6
  /**
6
7
  * TMiniGamePrize describes the information of prize in the array of prizes in the TMiniGameTemplate
@@ -139,6 +140,8 @@ export interface TLevel {
139
140
  *
140
141
  */
141
142
  required_level_counter_2: number;
143
+ /** The custom data of the mini-game defined by operator. Can be a JSON object, string or number */
144
+ custom_data: string;
142
145
  }
143
146
  /**
144
147
  * TTournament describes the general information of the tournament item
@@ -321,6 +324,8 @@ export interface TStoreItem {
321
324
  category_ids: number[];
322
325
  /** Number of items in the pool avaliable for the purchase.*/
323
326
  pool?: number;
327
+ /** The T&C text for the store item */
328
+ hint_text?: string;
324
329
  }
325
330
  /**
326
331
  * TAchCategory describes the badge category item. Each badge item can be assigned to 1 or more categories
@@ -387,6 +392,8 @@ export interface TMissionOrBadge {
387
392
  related_games?: AchRelatedGame[];
388
393
  /** The list of IDs of the categories where the badge item is assigned, information about categories can be retrieved with getAchCategories method */
389
394
  category_ids: number[];
395
+ /** The T&C text for the missions */
396
+ hint_text?: string;
390
397
  }
391
398
  export interface AchRelatedGame {
392
399
  /** The ID of the related game */
@@ -486,4 +493,38 @@ export interface InboxMarkMessageAction {
486
493
  /** Optional error message */
487
494
  err_message: string;
488
495
  }
496
+ export interface LeaderBoardDetailsT {
497
+ /** ID of the leaderboard */
498
+ board_id: number;
499
+ /** Name of the leaderboard */
500
+ name: string;
501
+ /** Description of the leaderboard */
502
+ description: string;
503
+ /** Rules of the leaderboard */
504
+ rules: string;
505
+ /** Leaderboard period type ID */
506
+ period_type_id: LeaderBoardPeriodType;
507
+ /** Leaderboard points rewards */
508
+ rewards: LeaderBoardsRewardsT[];
509
+ /** Leaderboard users */
510
+ users: LeaderBoardUserT[];
511
+ /** Info about current user in leaderboard */
512
+ me?: LeaderBoardUserT;
513
+ }
514
+ export interface LeaderBoardsRewardsT {
515
+ place: number;
516
+ points: number;
517
+ }
518
+ export interface LeaderBoardUserT {
519
+ /** The username of the participant */
520
+ public_username: string;
521
+ /** The URL to the avatar of the participant */
522
+ avatar_url: string;
523
+ /** The position of the participant in the leaderboard */
524
+ position: number;
525
+ /** The points of the participant in the leaderboard */
526
+ points: number;
527
+ /** The indicator if the participant is current user */
528
+ is_me: boolean;
529
+ }
489
530
  export {};