@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.
Files changed (53) hide show
  1. package/dist/Jackpots/JackpotDetails.d.ts +16 -0
  2. package/dist/Jackpots/JackpotPot.d.ts +6 -0
  3. package/dist/Jackpots/JackpotPublicMeta.d.ts +7 -0
  4. package/dist/MiniGames/SAWTemplateUI.d.ts +2 -2
  5. package/dist/SmarticoAPI.d.ts +2 -2
  6. package/dist/SmarticoLib/index.d.ts +4 -2
  7. package/dist/WSAPI/WSAPI.d.ts +38 -13
  8. package/dist/WSAPI/WSAPITypes.d.ts +1 -0
  9. package/dist/index.js +70 -59
  10. package/dist/index.js.map +1 -1
  11. package/dist/index.modern.mjs +43 -25
  12. package/dist/index.modern.mjs.map +1 -1
  13. package/docs/README.md +19 -1
  14. package/docs/classes/WSAPI.md +91 -11
  15. package/docs/enums/JackpotContributionType.md +13 -0
  16. package/docs/enums/JackpotType.md +7 -0
  17. package/docs/enums/LeaderBoardPeriodType.md +19 -0
  18. package/docs/enums/SAWGameTypeName.md +6 -0
  19. package/docs/interfaces/AchRelatedGame-1.md +28 -0
  20. package/docs/interfaces/AchRelatedGame.md +14 -12
  21. package/docs/interfaces/GetJackpotsPotsRequest.md +43 -0
  22. package/docs/interfaces/GetJackpotsPotsResponse.md +63 -0
  23. package/docs/interfaces/GetJackpotsRequest.md +49 -0
  24. package/docs/interfaces/GetJackpotsResponse.md +63 -0
  25. package/docs/interfaces/JackPotWinner.md +31 -0
  26. package/docs/interfaces/JackpotDetails.md +85 -0
  27. package/docs/interfaces/JackpotHtmlTemplate.md +13 -0
  28. package/docs/interfaces/JackpotPot.md +41 -0
  29. package/docs/interfaces/JackpotPublicMeta.md +57 -0
  30. package/docs/interfaces/JackpotWinPush.md +49 -0
  31. package/docs/interfaces/JackpotsOptinRequest.md +43 -0
  32. package/docs/interfaces/JackpotsOptinResponse.md +57 -0
  33. package/docs/interfaces/JackpotsOptoutRequest.md +43 -0
  34. package/docs/interfaces/JackpotsOptoutResponse.md +57 -0
  35. package/docs/interfaces/LeaderBoardDetailsT.md +1 -1
  36. package/docs/interfaces/TAchCategory.md +6 -0
  37. package/docs/interfaces/TMiniGameTemplate.md +2 -0
  38. package/docs/interfaces/TMissionOrBadge.md +6 -7
  39. package/docs/interfaces/TStoreCategory.md +6 -0
  40. package/docs/interfaces/TTournament.md +6 -0
  41. package/docs/interfaces/TTournamentDetailed.md +11 -1
  42. package/package.json +1 -1
  43. package/src/Base/AchRelatedGame.ts +3 -1
  44. package/src/Jackpots/JackpotDetails.ts +16 -0
  45. package/src/Jackpots/JackpotPot.ts +7 -1
  46. package/src/Jackpots/JackpotPublicMeta.ts +7 -0
  47. package/src/MiniGames/SAWTemplateUI.ts +2 -2
  48. package/src/SmarticoAPI.ts +6 -11
  49. package/src/SmarticoLib/index.ts +4 -2
  50. package/src/Tournaments/Tournament.ts +1 -0
  51. package/src/WSAPI/WSAPI.ts +38 -13
  52. package/src/WSAPI/WSAPITypes.ts +2 -0
  53. package/tsconfig.json +3 -0
@@ -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
- /** Returns store purchased items based on the provided parameters. "From" and "to" indicate the range of items to be fetched.
193
- * The maximum number of messages per request is limited to 20.
194
- * You can leave this params empty and by default it will return list of purchased items ranging from 0 to 20.
195
- * This functions return list of purchased items.
196
- * The "onUpdate" callback will be triggered when the user receives a new purchased item. It will provide an updated list of items, ranging from 0 to 20, to the onUpdate callback function. */
197
- /**
198
- * @param params
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
- return await this.api.storeGetPurchasedItemsT(null, from, to);
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) {
@@ -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"],