@smartico/public-api 0.0.136 → 0.0.137
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/Jackpots/JackpotDetails.d.ts +16 -0
- package/dist/Jackpots/JackpotPot.d.ts +6 -0
- package/dist/Jackpots/JackpotPublicMeta.d.ts +7 -0
- package/dist/MiniGames/SAWTemplateUI.d.ts +2 -2
- package/dist/SmarticoAPI.d.ts +2 -2
- package/dist/SmarticoLib/index.d.ts +4 -2
- package/dist/WSAPI/WSAPI.d.ts +38 -13
- package/dist/WSAPI/WSAPITypes.d.ts +1 -0
- package/dist/index.js +70 -59
- package/dist/index.js.map +1 -1
- package/dist/index.modern.mjs +43 -25
- package/dist/index.modern.mjs.map +1 -1
- package/docs/README.md +19 -1
- package/docs/classes/WSAPI.md +91 -11
- package/docs/enums/JackpotContributionType.md +13 -0
- package/docs/enums/JackpotType.md +7 -0
- package/docs/enums/LeaderBoardPeriodType.md +19 -0
- package/docs/enums/SAWGameTypeName.md +6 -0
- package/docs/interfaces/AchRelatedGame-1.md +28 -0
- package/docs/interfaces/AchRelatedGame.md +14 -12
- package/docs/interfaces/GetJackpotsPotsRequest.md +43 -0
- package/docs/interfaces/GetJackpotsPotsResponse.md +63 -0
- package/docs/interfaces/GetJackpotsRequest.md +49 -0
- package/docs/interfaces/GetJackpotsResponse.md +63 -0
- package/docs/interfaces/JackPotWinner.md +31 -0
- package/docs/interfaces/JackpotDetails.md +85 -0
- package/docs/interfaces/JackpotHtmlTemplate.md +13 -0
- package/docs/interfaces/JackpotPot.md +41 -0
- package/docs/interfaces/JackpotPublicMeta.md +57 -0
- package/docs/interfaces/JackpotWinPush.md +49 -0
- package/docs/interfaces/JackpotsOptinRequest.md +43 -0
- package/docs/interfaces/JackpotsOptinResponse.md +57 -0
- package/docs/interfaces/JackpotsOptoutRequest.md +43 -0
- package/docs/interfaces/JackpotsOptoutResponse.md +57 -0
- package/docs/interfaces/LeaderBoardDetailsT.md +1 -1
- package/docs/interfaces/TAchCategory.md +6 -0
- package/docs/interfaces/TMiniGameTemplate.md +2 -0
- package/docs/interfaces/TMissionOrBadge.md +6 -7
- package/docs/interfaces/TStoreCategory.md +6 -0
- package/docs/interfaces/TTournament.md +6 -0
- package/docs/interfaces/TTournamentDetailed.md +11 -1
- package/package.json +1 -1
- package/src/Base/AchRelatedGame.ts +3 -1
- package/src/Jackpots/JackpotDetails.ts +16 -0
- package/src/Jackpots/JackpotPot.ts +7 -1
- package/src/Jackpots/JackpotPublicMeta.ts +7 -0
- package/src/MiniGames/SAWTemplateUI.ts +2 -2
- package/src/SmarticoAPI.ts +6 -11
- package/src/SmarticoLib/index.ts +4 -2
- package/src/Tournaments/Tournament.ts +1 -0
- package/src/WSAPI/WSAPI.ts +38 -13
- package/src/WSAPI/WSAPITypes.ts +2 -0
- package/tsconfig.json +3 -0
package/src/WSAPI/WSAPI.ts
CHANGED
|
@@ -189,20 +189,17 @@ export class WSAPI {
|
|
|
189
189
|
return OCache.use(onUpdateContextKey.StoreCategories, ECacheContext.WSAPI, () => this.api.storeGetCategoriesT(null), CACHE_DATA_SEC);
|
|
190
190
|
}
|
|
191
191
|
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
192
|
+
/** Returns all the purchased store items available the current user
|
|
193
|
+
* Example usage:
|
|
194
|
+
* ```
|
|
195
|
+
* _smartico.api.getStorePurchasedItems().then((result) => {
|
|
196
|
+
* console.log(result);
|
|
197
|
+
* });
|
|
198
|
+
* ```
|
|
199
199
|
*/
|
|
200
|
-
public async storeGetPurchasedItems({ from, to, onUpdate }: { from?: number, to?: number, onUpdate?: (data: TStoreItem[]) => void } = {}): Promise<TStoreItem[]> {
|
|
201
|
-
if (onUpdate) {
|
|
202
|
-
this.onUpdateCallback.set(onUpdateContextKey.StoreHistory, onUpdate);
|
|
203
|
-
}
|
|
204
200
|
|
|
205
|
-
|
|
201
|
+
public async getStorePurchasedItems(): Promise<TStoreItem[]> {
|
|
202
|
+
return OCache.use(onUpdateContextKey.StoreItems, ECacheContext.WSAPI, () => this.api.storeGetPurchasedItemsT(null), CACHE_DATA_SEC);
|
|
206
203
|
}
|
|
207
204
|
|
|
208
205
|
/** Returns missions & badges categories */
|
|
@@ -442,7 +439,17 @@ export class WSAPI {
|
|
|
442
439
|
OCache.clear(ECacheContext.WSAPI, onUpdateContextKey.Pots);
|
|
443
440
|
}
|
|
444
441
|
|
|
445
|
-
|
|
442
|
+
/** Returns list of Jackpots that are active in the systen and matching to the filter definition.
|
|
443
|
+
* If filter is not provided, all active jackpots will be returned.
|
|
444
|
+
* Filter can be used to get jackpots related to specific game or specific jackpot template.
|
|
445
|
+
* You can call this method every second in order to get up to date information about current value of the jackpot(s) and present them to the end-users
|
|
446
|
+
* Example usage:
|
|
447
|
+
* ```
|
|
448
|
+
* _smartico.api.jackpotGet({ related_game_id: 'wooko-slot' }).then((result) => {
|
|
449
|
+
* console.log(result);
|
|
450
|
+
* });
|
|
451
|
+
* ```
|
|
452
|
+
*/
|
|
446
453
|
public async jackpotGet(filter?: { related_game_id?: string, jp_template_id?: number }): Promise<JackpotDetails[]> {
|
|
447
454
|
|
|
448
455
|
const signature: string = `${filter?.jp_template_id}:${filter?.related_game_id}`;
|
|
@@ -485,6 +492,15 @@ export class WSAPI {
|
|
|
485
492
|
|
|
486
493
|
}
|
|
487
494
|
|
|
495
|
+
/** Opt-in currently logged in user to the jackpot with the specified jp_template_id.
|
|
496
|
+
* You may call jackpotGet method after doing optin to see that user is opted in to the jackpot.
|
|
497
|
+
* Example usage:
|
|
498
|
+
* ```
|
|
499
|
+
* _smartico.api.jackpotOptIn({ jp_template_id: 123 }).then((result) => {
|
|
500
|
+
* console.log('Opted in to the jackpot');
|
|
501
|
+
* });
|
|
502
|
+
* ```
|
|
503
|
+
*/
|
|
488
504
|
public async jackpotOptIn(filter: { jp_template_id: number }): Promise<JackpotsOptinResponse> {
|
|
489
505
|
|
|
490
506
|
if (!filter.jp_template_id) {
|
|
@@ -498,6 +514,15 @@ export class WSAPI {
|
|
|
498
514
|
return result;
|
|
499
515
|
}
|
|
500
516
|
|
|
517
|
+
/** Opt-out currently logged in user from the jackpot with the specified jp_template_id.
|
|
518
|
+
* You may call jackpotGet method after doing optout to see that user is not opted in to the jackpot.
|
|
519
|
+
* Example usage:
|
|
520
|
+
* ```
|
|
521
|
+
* _smartico.api.jackpotOptOut({ jp_template_id: 123 }).then((result) => {
|
|
522
|
+
* console.log('Opted out from the jackpot');
|
|
523
|
+
* });
|
|
524
|
+
* ```
|
|
525
|
+
*/
|
|
501
526
|
public async jackpotOptOut(filter: { jp_template_id: number }): Promise<JackpotsOptoutResponse> {
|
|
502
527
|
|
|
503
528
|
if (!filter.jp_template_id) {
|
package/src/WSAPI/WSAPITypes.ts
CHANGED
|
@@ -190,6 +190,8 @@ export interface TTournament {
|
|
|
190
190
|
image1: string;
|
|
191
191
|
/* 2nd image URL representing the tournament */
|
|
192
192
|
image2: string;
|
|
193
|
+
/* 2nd image URL representing the tournament for mobile */
|
|
194
|
+
image2_mobile: string;
|
|
193
195
|
/* The message indicating the prize pool of the tournament */
|
|
194
196
|
prize_pool_short: string;
|
|
195
197
|
/* The message indicating the price to register in the tournament */
|
package/tsconfig.json
CHANGED
|
@@ -25,6 +25,9 @@
|
|
|
25
25
|
"src/MiniGames/SAWSpinErrorCode.ts",
|
|
26
26
|
"src/Tournaments/TournamentRegistrationError.ts",
|
|
27
27
|
"src/Store/BuyStoreItemErrorCode.ts",
|
|
28
|
+
"src/Leaderboard/LeaderBoardPeriodType.ts",
|
|
29
|
+
"src/Base/AchRelatedGame.ts",
|
|
30
|
+
"src/Jackpots/index.ts",
|
|
28
31
|
],
|
|
29
32
|
"out": "docs",
|
|
30
33
|
"plugin": ["typedoc-plugin-markdown", "typedoc-plugin-merge-modules"],
|