@smartico/public-api 0.0.111 → 0.0.113
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.
- package/dist/Leaderboard/LeaderBoards.d.ts +3 -0
- package/dist/MiniGames/SAWPrizeUI.d.ts +1 -0
- package/dist/MiniGames/SAWWinSoundType.d.ts +2 -1
- package/dist/SmarticoAPI.d.ts +2 -1
- package/dist/WSAPI/WSAPI.d.ts +6 -1
- package/dist/WSAPI/WSAPITypes.d.ts +39 -0
- package/dist/index.js +194 -92
- package/dist/index.js.map +1 -1
- package/dist/index.modern.mjs +92 -21
- package/dist/index.modern.mjs.map +1 -1
- package/docs/README.md +3 -0
- package/docs/classes/WSAPI.md +25 -6
- package/docs/interfaces/LeaderBoardDetailsT.md +65 -0
- package/docs/interfaces/LeaderBoardUserT.md +41 -0
- package/docs/interfaces/LeaderBoardsRewardsT.md +13 -0
- package/docs/interfaces/TAchCategory.md +1 -1
- package/docs/interfaces/TMissionOrBadge.md +8 -0
- package/docs/interfaces/TStoreItem.md +8 -0
- package/package.json +1 -1
- package/src/Leaderboard/LeaderBoards.ts +51 -0
- package/src/MiniGames/SAWPrizeUI.ts +1 -0
- package/src/MiniGames/SAWWinSoundType.ts +2 -1
- package/src/Missions/UserAchievement.ts +5 -3
- package/src/OCache.ts +10 -3
- package/src/SmarticoAPI.ts +18 -7
- package/src/Store/StoreItem.ts +1 -0
- package/src/WSAPI/WSAPI.ts +20 -6
- package/src/WSAPI/WSAPITypes.ts +45 -1
package/dist/SmarticoAPI.d.ts
CHANGED
|
@@ -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>;
|
package/dist/WSAPI/WSAPI.d.ts
CHANGED
|
@@ -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
|
|
@@ -323,6 +324,8 @@ export interface TStoreItem {
|
|
|
323
324
|
category_ids: number[];
|
|
324
325
|
/** Number of items in the pool avaliable for the purchase.*/
|
|
325
326
|
pool?: number;
|
|
327
|
+
/** The T&C text for the store item */
|
|
328
|
+
hint_text?: string;
|
|
326
329
|
}
|
|
327
330
|
/**
|
|
328
331
|
* TAchCategory describes the badge category item. Each badge item can be assigned to 1 or more categories
|
|
@@ -389,6 +392,8 @@ export interface TMissionOrBadge {
|
|
|
389
392
|
related_games?: AchRelatedGame[];
|
|
390
393
|
/** The list of IDs of the categories where the badge item is assigned, information about categories can be retrieved with getAchCategories method */
|
|
391
394
|
category_ids: number[];
|
|
395
|
+
/** The T&C text for the missions */
|
|
396
|
+
hint_text?: string;
|
|
392
397
|
}
|
|
393
398
|
export interface AchRelatedGame {
|
|
394
399
|
/** The ID of the related game */
|
|
@@ -488,4 +493,38 @@ export interface InboxMarkMessageAction {
|
|
|
488
493
|
/** Optional error message */
|
|
489
494
|
err_message: string;
|
|
490
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
|
+
}
|
|
491
530
|
export {};
|