@smartico/public-api 0.0.166 → 0.0.168
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/Base/ClassId.d.ts +4 -0
- package/dist/MiniGames/SAWDoAcknowledgeBatchRequest.d.ts +4 -0
- package/dist/MiniGames/SAWDoAcknowledgeBatchResponse.d.ts +8 -0
- package/dist/MiniGames/SAWDoSpinBatchRequest.d.ts +7 -0
- package/dist/MiniGames/SAWDoSpinBatchResponse.d.ts +7 -0
- package/dist/Missions/GetRelatedAchTourResponse.d.ts +1 -1
- package/dist/Quiz/MarketsPerSport.d.ts +1 -1
- package/dist/SmarticoAPI.d.ts +6 -0
- package/dist/WSAPI/WSAPI.d.ts +30 -1
- package/dist/WSAPI/WSAPITypes.d.ts +15 -0
- package/dist/index.js +309 -189
- package/dist/index.js.map +1 -1
- package/dist/index.modern.mjs +85 -0
- package/dist/index.modern.mjs.map +1 -1
- package/docs/README.md +1 -0
- package/docs/classes/WSAPI.md +64 -3
- package/docs/interfaces/TMiniGamePlayBatchResult.md +43 -0
- package/package.json +1 -1
- package/src/Base/ClassId.ts +4 -0
- package/src/MiniGames/SAWDoAcknowledgeBatchRequest.ts +5 -0
- package/src/MiniGames/SAWDoAcknowledgeBatchResponse.ts +5 -0
- package/src/MiniGames/SAWDoSpinBatchRequest.ts +5 -0
- package/src/MiniGames/SAWDoSpinBatchResponse.ts +8 -0
- package/src/Missions/GetRelatedAchTourResponse.ts +1 -1
- package/src/SmarticoAPI.ts +60 -0
- package/src/WSAPI/WSAPI.ts +54 -2
- package/src/WSAPI/WSAPITypes.ts +16 -0
package/dist/Base/ClassId.d.ts
CHANGED
|
@@ -84,6 +84,10 @@ export declare enum ClassId {
|
|
|
84
84
|
SAW_PRIZE_DROP_WIN_AKNOWLEDGE_REQUEST = 709,
|
|
85
85
|
SAW_PRIZE_DROP_WIN_AKNOWLEDGE_RESPONSE = 710,
|
|
86
86
|
SAW_AKNOWLEDGE_SPIN_PUSH = 711,
|
|
87
|
+
SAW_DO_SPIN_BATCH_REQUEST = 712,
|
|
88
|
+
SAW_DO_SPIN_BATCH_RESPONSE = 713,
|
|
89
|
+
SAW_AKNOWLEDGE_BATCH_REQUEST = 714,
|
|
90
|
+
SAW_AKNOWLEDGE_BATCH_RESPONSE = 715,
|
|
87
91
|
JP_GET_JACKPOTS_REQUEST = 800,
|
|
88
92
|
JP_GET_JACKPOTS_RESPONSE = 801,
|
|
89
93
|
JP_GET_LATEST_POTS_REQUEST = 802,
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { ProtocolResponse } from '../Base/ProtocolResponse';
|
|
2
|
+
import { SAWDoSpinResponse } from './SAWDoSpinResponse';
|
|
3
|
+
import { SAWSpinErrorCode } from './SAWSpinErrorCode';
|
|
4
|
+
export interface SAWDoSpinBatchResponse extends ProtocolResponse {
|
|
5
|
+
results: SAWDoSpinResponse[];
|
|
6
|
+
errCode: SAWSpinErrorCode;
|
|
7
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ProtocolResponse } from '../Base/ProtocolResponse';
|
|
2
2
|
import { Tournament } from '../Tournaments';
|
|
3
3
|
import { UserAchievement } from './UserAchievement';
|
|
4
|
-
export interface
|
|
4
|
+
export interface GetRelatedAchTourResponse extends ProtocolResponse {
|
|
5
5
|
achievements: UserAchievement[];
|
|
6
6
|
tournaments?: Tournament[];
|
|
7
7
|
}
|
package/dist/SmarticoAPI.d.ts
CHANGED
|
@@ -16,6 +16,9 @@ import { GetAchievementsUserInfoResponse } from './Core/GetAchievementsUserInfoR
|
|
|
16
16
|
import { GetJackpotsPotsResponse, GetJackpotsResponse, JackpotsOptinResponse, JackpotsOptoutResponse } from './Jackpots';
|
|
17
17
|
import { GetCustomSectionsResponse } from './CustomSections';
|
|
18
18
|
import { ClaimBonusResponse, GetBonusesResponse } from './Bonuses';
|
|
19
|
+
import { SAWDoSpinBatchResponse } from './MiniGames/SAWDoSpinBatchResponse';
|
|
20
|
+
import { SAWDoAcknowledgeBatchResponse } from './MiniGames/SAWDoAcknowledgeBatchResponse';
|
|
21
|
+
import { GetRelatedAchTourResponse } from './Missions/GetRelatedAchTourResponse';
|
|
19
22
|
interface Tracker {
|
|
20
23
|
label_api_key: string;
|
|
21
24
|
userPublicProps: any;
|
|
@@ -76,6 +79,8 @@ declare class SmarticoAPI {
|
|
|
76
79
|
sawGetTemplatesT(user_ext_id: string): Promise<TMiniGameTemplate[]>;
|
|
77
80
|
doAcknowledgeRequest(user_ext_id: string, request_id: string): Promise<SAWDoAknowledgeResponse>;
|
|
78
81
|
sawSpinRequest(user_ext_id: string, saw_template_id: number, round_id?: number): Promise<SAWDoSpinResponse>;
|
|
82
|
+
doAcknowledgeBatchRequest(user_ext_id: string, request_ids: string[]): Promise<SAWDoAcknowledgeBatchResponse>;
|
|
83
|
+
sawSpinBatchRequest(user_ext_id: string, saw_template_id: number, spins_count: number): Promise<SAWDoSpinBatchResponse>;
|
|
79
84
|
missionOptIn(user_ext_id: string, mission_id: number): Promise<AchievementOptinResponse>;
|
|
80
85
|
missionClaimPrize(user_ext_id: string, mission_id: number, ach_completed_id: number): Promise<AchClaimPrizeResponse>;
|
|
81
86
|
registerInTournament(user_ext_id: string, tournamentInstanceId: number): Promise<TournamentRegisterResponse>;
|
|
@@ -119,5 +124,6 @@ declare class SmarticoAPI {
|
|
|
119
124
|
deleteInboxMessage(user_ext_id: string, messageGuid: string): Promise<MarkInboxMessageDeletedResponse>;
|
|
120
125
|
deleteAllInboxMessages(user_ext_id: string): Promise<MarkInboxMessageDeletedResponse>;
|
|
121
126
|
getWSCalls(): WSAPI;
|
|
127
|
+
getRelatedItemsForGame(user_ext_id: string, related_game_id: string): Promise<GetRelatedAchTourResponse>;
|
|
122
128
|
}
|
|
123
129
|
export { SmarticoAPI, MessageSender };
|
package/dist/WSAPI/WSAPI.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
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 } 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 } from './WSAPITypes';
|
|
3
3
|
import { LeaderBoardPeriodType } from '../Leaderboard';
|
|
4
4
|
import { JackpotDetails, JackpotsOptinResponse, JackpotsOptoutResponse } from '../Jackpots';
|
|
5
|
+
import { GetAchievementMapResponse } from 'src/Missions';
|
|
5
6
|
/** @group General API */
|
|
6
7
|
export declare class WSAPI {
|
|
7
8
|
private api;
|
|
@@ -87,6 +88,9 @@ export declare class WSAPI {
|
|
|
87
88
|
getBadges(): Promise<TMissionOrBadge[]>;
|
|
88
89
|
/**
|
|
89
90
|
* Returns all the bonuses for the current user
|
|
91
|
+
* The returned bonuss are cached for 30 seconds. But you can pass the onUpdate callback as a parameter.
|
|
92
|
+
* Note that each time you call getBonuses with a new onUpdate callback, the old one will be overwritten by the new one.
|
|
93
|
+
* The onUpdate callback will be called on bonus claimed and the updated bonuses will be passed to it.
|
|
90
94
|
*
|
|
91
95
|
* **Visitor mode: not supported**
|
|
92
96
|
*/
|
|
@@ -252,6 +256,12 @@ export declare class WSAPI {
|
|
|
252
256
|
* **Visitor mode: not supported**
|
|
253
257
|
*/
|
|
254
258
|
playMiniGame(template_id: number): Promise<TMiniGamePlayResult>;
|
|
259
|
+
/**
|
|
260
|
+
* Plays the specified by template_id mini-game on behalf of user {count} times and returns prizes or err_code
|
|
261
|
+
*
|
|
262
|
+
* **Visitor mode: not supported**
|
|
263
|
+
*/
|
|
264
|
+
playMiniGameBatch(template_id: number, spin_count: number): Promise<TMiniGamePlayBatchResult[]>;
|
|
255
265
|
/**
|
|
256
266
|
* Requests an opt-in for the specified mission_id. Returns the err_code.
|
|
257
267
|
*
|
|
@@ -460,4 +470,23 @@ export declare class WSAPI {
|
|
|
460
470
|
jackpotOptOut(filter: {
|
|
461
471
|
jp_template_id: number;
|
|
462
472
|
}): Promise<JackpotsOptoutResponse>;
|
|
473
|
+
/**
|
|
474
|
+
* Returns all the related tournaments and missions for the provided game id for the current user
|
|
475
|
+
* The provided Game ID should correspond to the ID from the Games Catalog - https://help.smartico.ai/welcome/technical-guides/games-catalog-api
|
|
476
|
+
*
|
|
477
|
+
* **Example**:
|
|
478
|
+
* ```
|
|
479
|
+
* _smartico.api.getRelatedItemsForGame('gold-slot2').then((result) => {
|
|
480
|
+
* console.log(result);
|
|
481
|
+
* });
|
|
482
|
+
* ```
|
|
483
|
+
*
|
|
484
|
+
* **Example in the Visitor mode**:
|
|
485
|
+
* ```
|
|
486
|
+
* _smartico.vapi('EN').getRelatedItemsForGame('gold-slot2').then((result) => {
|
|
487
|
+
* console.log(result);
|
|
488
|
+
* });
|
|
489
|
+
* ```
|
|
490
|
+
*/
|
|
491
|
+
getRelatedItemsForGame(related_game_id: string): Promise<GetAchievementMapResponse>;
|
|
463
492
|
}
|
|
@@ -42,6 +42,21 @@ export interface TMiniGamePlayResult {
|
|
|
42
42
|
/** The prize_id that user won, details of the prize can be found in the mini-game definition */
|
|
43
43
|
prize_id: number;
|
|
44
44
|
}
|
|
45
|
+
/**
|
|
46
|
+
* TMiniGamePlayBatchResult describes the response of call to _smartico.api.playMiniGameBatch(template_id, spin_count) method
|
|
47
|
+
*/
|
|
48
|
+
export interface TMiniGamePlayBatchResult {
|
|
49
|
+
/** The saw_prize_id that user won, details of the prize can be found in the mini-game definition */
|
|
50
|
+
saw_prize_id: number;
|
|
51
|
+
/** Error code that represents outcome of the game play attempt. Game succeed to be played in case err_code is 0 */
|
|
52
|
+
errCode: SAWSpinErrorCode;
|
|
53
|
+
/** Optional error message */
|
|
54
|
+
errMessage?: string;
|
|
55
|
+
/** Jackpot amount what user won */
|
|
56
|
+
jackpot_amount?: number;
|
|
57
|
+
/** Period in miliseconds from last spin */
|
|
58
|
+
first_spin_in_period?: number;
|
|
59
|
+
}
|
|
45
60
|
/**
|
|
46
61
|
* TMiniGameTemplate describes the information of mini-games available for the user
|
|
47
62
|
*/
|