@smartico/public-api 0.0.172 → 0.0.174

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.
@@ -88,6 +88,8 @@ export declare enum ClassId {
88
88
  SAW_DO_SPIN_BATCH_RESPONSE = 713,
89
89
  SAW_AKNOWLEDGE_BATCH_REQUEST = 714,
90
90
  SAW_AKNOWLEDGE_BATCH_RESPONSE = 715,
91
+ GET_SAW_HISTORY_REQUEST = 716,
92
+ GET_SAW_HISTORY_RESPONSE = 717,
91
93
  JP_GET_JACKPOTS_REQUEST = 800,
92
94
  JP_GET_JACKPOTS_RESPONSE = 801,
93
95
  JP_GET_LATEST_POTS_REQUEST = 802,
@@ -11,4 +11,7 @@ export interface SAWPrize {
11
11
  pool?: number;
12
12
  pool_initial?: number;
13
13
  wins_count?: number;
14
+ weekdays?: number[];
15
+ active_from_ts?: number;
16
+ active_till_ts?: number;
14
17
  }
@@ -0,0 +1,7 @@
1
+ import { ProtocolMessage } from "../Base/ProtocolMessage";
2
+ export interface SAWWinningHistoryRequest extends ProtocolMessage {
3
+ limit: number;
4
+ offset: number;
5
+ saw_template_id?: number;
6
+ only_claimed?: boolean;
7
+ }
@@ -0,0 +1,15 @@
1
+ import { ProtocolResponse } from "../SmarticoLib";
2
+ import { TSawHistory } from "../WSAPI/WSAPITypes";
3
+ import { SAWTemplate } from "./SAWTemplate";
4
+ export interface SAWWinningHistoryResponse extends ProtocolResponse {
5
+ prizes: SAWPrizesHistory[];
6
+ }
7
+ export interface SAWPrizesHistory {
8
+ template: SAWTemplate;
9
+ saw_template_id: number;
10
+ saw_prize_id: number;
11
+ prize_amount: number;
12
+ client_request_id: string;
13
+ is_claimed: boolean;
14
+ }
15
+ export declare const SAWHistoryTransform: (items: SAWPrizesHistory[]) => TSawHistory[];
@@ -22,3 +22,5 @@ export * from './SAWPrizeDropAknowledgeRequest';
22
22
  export * from './SAWPrizeDropAknowledgeResponse';
23
23
  export * from './SAWEventSawPush';
24
24
  export * from './SAWAcknowledgeSpinPushRequest';
25
+ export * from './SAWWinningHistoryRequest';
26
+ export * from './SAWWinningHistoryResponse';
@@ -1,4 +1,5 @@
1
1
  import { ProtocolMessage } from '../Base/ProtocolMessage';
2
2
  export interface GetRelatedAchTourRequest extends ProtocolMessage {
3
3
  related_game_id?: string;
4
+ force_language?: string;
4
5
  }
@@ -1,7 +1,7 @@
1
1
  import { ClassId } from './Base/ClassId';
2
2
  import { SAWGetTemplatesResponse } from './MiniGames/SAWGetTemplatesResponse';
3
3
  import { ILogger } from './ILogger';
4
- import { SAWDoAknowledgeResponse, SAWDoSpinResponse } from './MiniGames';
4
+ import { SAWDoAknowledgeResponse, SAWDoSpinResponse, SAWPrizesHistory, SAWWinningHistoryResponse } from './MiniGames';
5
5
  import { GetTranslationsResponse, PublicLabelSettings, ResponseIdentify, TranslationArea } from './Core';
6
6
  import { GetLabelInfoResponse } from './Core/GetLabelInfoResponse';
7
7
  import { GetInboxMessagesResponse, InboxMessageBody, MarkInboxMessageDeletedResponse, MarkInboxMessageReadResponse, MarkInboxMessageStarredResponse } from './Inbox';
@@ -81,6 +81,8 @@ declare class SmarticoAPI {
81
81
  sawSpinRequest(user_ext_id: string, saw_template_id: number, round_id?: number): Promise<SAWDoSpinResponse>;
82
82
  doAcknowledgeBatchRequest(user_ext_id: string, request_ids: string[]): Promise<SAWDoAcknowledgeBatchResponse>;
83
83
  sawSpinBatchRequest(user_ext_id: string, saw_template_id: number, spins_count: number): Promise<SAWDoSpinBatchResponse>;
84
+ getSawWinningHistory(user_ext_id: string, limit: number, offset: number, saw_template_id: number): Promise<SAWWinningHistoryResponse>;
85
+ getSawWinningHistoryT(user_ext_id: string, limit?: number, offset?: number, saw_template_id?: number): Promise<SAWPrizesHistory[]>;
84
86
  missionOptIn(user_ext_id: string, mission_id: number): Promise<AchievementOptinResponse>;
85
87
  missionClaimPrize(user_ext_id: string, mission_id: number, ach_completed_id: number): Promise<AchClaimPrizeResponse>;
86
88
  registerInTournament(user_ext_id: string, tournamentInstanceId: number): Promise<TournamentRegisterResponse>;
@@ -124,6 +126,6 @@ declare class SmarticoAPI {
124
126
  deleteInboxMessage(user_ext_id: string, messageGuid: string): Promise<MarkInboxMessageDeletedResponse>;
125
127
  deleteAllInboxMessages(user_ext_id: string): Promise<MarkInboxMessageDeletedResponse>;
126
128
  getWSCalls(): WSAPI;
127
- getRelatedItemsForGame(user_ext_id: string, related_game_id: string): Promise<GetRelatedAchTourResponse>;
129
+ getRelatedItemsForGame(user_ext_id: string, related_game_id: string, force_language?: string): Promise<GetRelatedAchTourResponse>;
128
130
  }
129
131
  export { SmarticoAPI, MessageSender };
@@ -1,5 +1,5 @@
1
1
  import { SmarticoAPI } from '../SmarticoAPI';
2
- import { InboxMarkMessageAction, LeaderBoardDetailsT, TAchCategory, TBuyStoreItemResult, TGetTranslations, TInboxMessage, TInboxMessageBody, TLevel, TMiniGamePlayResult, TMiniGameTemplate, TMissionClaimRewardResult, TMissionOptInResult, TMissionOrBadge, TSegmentCheckResult, TStoreCategory, TStoreItem, TTournament, TTournamentDetailed, TTournamentRegistrationResult, TUICustomSection, TUserProfile, UserLevelExtraCountersT, TBonus, TClaimBonusResult, TMiniGamePlayBatchResult } from './WSAPITypes';
2
+ import { InboxMarkMessageAction, LeaderBoardDetailsT, TAchCategory, TBuyStoreItemResult, TGetTranslations, TInboxMessage, TInboxMessageBody, TLevel, TMiniGamePlayResult, TMiniGameTemplate, TMissionClaimRewardResult, TMissionOptInResult, TMissionOrBadge, TSegmentCheckResult, TStoreCategory, TStoreItem, TTournament, TTournamentDetailed, TTournamentRegistrationResult, TUICustomSection, TUserProfile, UserLevelExtraCountersT, TBonus, TClaimBonusResult, TMiniGamePlayBatchResult, TSawHistory } from './WSAPITypes';
3
3
  import { LeaderBoardPeriodType } from '../Leaderboard';
4
4
  import { JackpotDetails, JackpotsOptinResponse, JackpotsOptoutResponse } from '../Jackpots';
5
5
  import { GetAchievementMapResponse } from '../Missions';
@@ -250,8 +250,32 @@ export declare class WSAPI {
250
250
  getMiniGames({ onUpdate }?: {
251
251
  onUpdate?: (data: TMiniGameTemplate[]) => void;
252
252
  }): Promise<TMiniGameTemplate[]>;
253
+ /**
254
+ * Returns the list of mini-games based on the provided parameters. "Limit" and "offset" indicate the range of items to be fetched.
255
+ * The maximum number of items per request is limited to 20.
256
+ * You can leave this params empty and by default it will return list of mini-games ranging from 0 to 20.
257
+ * The returned list of mini-games is cached for 30 seconds. But you can pass the onUpdate callback as a parameter. Note that each time you call getMiniGamesHistory with a new onUpdate callback, the old one will be overwritten by the new one.
258
+ * Updated templates will be passed to onUpdate callback.
259
+ *
260
+ * **Example**:
261
+ * ```
262
+ * _smartico.api.getMiniGamesHistory().then((result) => {
263
+ * console.log(result);
264
+ * });
265
+ * ```
266
+ *
267
+ * **Visitor mode: not supported**
268
+ */
269
+ getMiniGamesHistory({ limit, offset, saw_template_id, onUpdate }: {
270
+ limit?: number;
271
+ offset?: number;
272
+ saw_template_id?: number;
273
+ onUpdate?: (data: TMiniGameTemplate[]) => void;
274
+ }): Promise<TSawHistory[]>;
253
275
  /**
254
276
  * Plays the specified by template_id mini-game on behalf of user and returns prize_id or err_code
277
+ * After playMiniGame is called, you can call getMiniGames to get the list of mini-games.The returned list of mini-games is cached for 30 seconds. But you can pass the onUpdate callback as a parameter. Note that each time you call playMiniGame with a new onUpdate callback, the old one will be overwritten by the new one.
278
+ * The onUpdate callback will be called on available spin count change, if mini-game has increasing jackpot per spin or wined prize is spin/jackpot and if max count of the available user spin equal one, also if the spins were issued to the user manually in the BO. Updated templates will be passed to onUpdate callback.
255
279
  *
256
280
  * **Example**:
257
281
  * ```
@@ -262,9 +286,13 @@ export declare class WSAPI {
262
286
  *
263
287
  * **Visitor mode: not supported**
264
288
  */
265
- playMiniGame(template_id: number): Promise<TMiniGamePlayResult>;
289
+ playMiniGame(template_id: number, { onUpdate }?: {
290
+ onUpdate?: (data: TMissionOrBadge[]) => void;
291
+ }): Promise<TMiniGamePlayResult>;
266
292
  /**
267
293
  * Plays the specified by template_id mini-game on behalf of user spin_count times and returns array of the prizes
294
+ * After playMiniGameBatch is called, you can call getMiniGames to get the list of mini-games. The returned list of mini-games is cached for 30 seconds. But you can pass the onUpdate callback as a parameter. Note that each time you call playMiniGameBatch with a new onUpdate callback, the old one will be overwritten by the new one.
295
+ * The onUpdate callback will be called on available spin count change, if mini-game has increasing jackpot per spin or wined prize is spin/jackpot and if max count of the available user spin equal one, also if the spins were issued to the user manually in the BO. Updated templates will be passed to onUpdate callback.
268
296
  *
269
297
  * **Example**:
270
298
  * ```
@@ -274,7 +302,9 @@ export declare class WSAPI {
274
302
  * ```
275
303
  * **Visitor mode: not supported**
276
304
  */
277
- playMiniGameBatch(template_id: number, spin_count: number): Promise<TMiniGamePlayBatchResult[]>;
305
+ playMiniGameBatch(template_id: number, spin_count: number, { onUpdate }?: {
306
+ onUpdate?: (data: TMissionOrBadge[]) => void;
307
+ }): Promise<TMiniGamePlayBatchResult[]>;
278
308
  /**
279
309
  * Requests an opt-in for the specified mission_id. Returns the err_code.
280
310
  *
@@ -501,5 +531,5 @@ export declare class WSAPI {
501
531
  * });
502
532
  * ```
503
533
  */
504
- getRelatedItemsForGame(related_game_id: string): Promise<GetAchievementMapResponse>;
534
+ getRelatedItemsForGame(related_game_id: string, force_language?: string): Promise<GetAchievementMapResponse>;
505
535
  }
@@ -1,5 +1,5 @@
1
1
  import { BuyStoreItemErrorCode } from '../Store';
2
- import { MiniGamePrizeTypeName, SAWBuyInTypeName, SAWGameTypeName, SAWSpinErrorCode } from '../MiniGames';
2
+ import { MiniGamePrizeTypeName, SAWBuyInTypeName, SAWGameTypeName, SAWSpinErrorCode, SAWTemplate } from '../MiniGames';
3
3
  import { TournamentRegistrationError, TournamentRegistrationStatusName, TournamentRegistrationTypeName } from '../Tournaments';
4
4
  import { LeaderBoardPeriodType } from '../Leaderboard';
5
5
  import { AchCustomLayoutTheme, AchCustomSectionType, AchMissionsTabsOptions, AchOverviewMissionsFilter } from '../CustomSections';
@@ -30,6 +30,9 @@ export interface TMiniGamePrize {
30
30
  pool?: number;
31
31
  pool_initial?: number;
32
32
  wins_count?: number;
33
+ weekdays?: number[];
34
+ active_from_ts?: number;
35
+ active_till_ts?: number;
33
36
  }
34
37
  /**
35
38
  * TMiniGamePlayResult describes the response of call to _smartico.api.playMiniGame(template_id) method
@@ -666,4 +669,18 @@ export interface TClaimBonusResult {
666
669
  /** If the bonus was claimed successfully, then success is true */
667
670
  success?: boolean;
668
671
  }
672
+ export interface TSawHistory {
673
+ /** The initial information about mini-game */
674
+ template: SAWTemplate;
675
+ /** ID of the mini-game template */
676
+ saw_template_id: number;
677
+ /** The saw_prize_id that user won, details of the prize can be found in the mini-game definition */
678
+ saw_prize_id: number;
679
+ /** Amount of prizes in stock */
680
+ prize_amount: number;
681
+ /** Request ID that client is sending to show history*/
682
+ client_request_id: string;
683
+ /** Flag indicating to show whether prize in the mini-game claimed or not */
684
+ is_claimed: boolean;
685
+ }
669
686
  export {};