@smartico/public-api 0.0.55 → 0.0.57

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 (36) hide show
  1. package/dist/MiniGames/SAWBuyInType.d.ts +9 -5
  2. package/dist/MiniGames/SAWGameType.d.ts +10 -6
  3. package/dist/MiniGames/SAWGetTemplatesResponse.d.ts +2 -0
  4. package/dist/MiniGames/SAWPrizeType.d.ts +12 -0
  5. package/dist/SmarticoAPI.d.ts +5 -2
  6. package/dist/Store/StoreCategory.d.ts +2 -0
  7. package/dist/Tournaments/TournamentRegistrationStatus.d.ts +11 -2
  8. package/dist/WSAPI/WSAPI.d.ts +6 -2
  9. package/dist/WSAPI/WSAPITypes.d.ts +57 -0
  10. package/dist/index.js +218 -80
  11. package/dist/index.js.map +1 -1
  12. package/dist/index.modern.mjs +139 -21
  13. package/dist/index.modern.mjs.map +1 -1
  14. package/docs/README.md +10 -6
  15. package/docs/classes/WSAPI.md +24 -0
  16. package/docs/enums/MiniGamePrizeTypeName.md +43 -0
  17. package/docs/enums/SAWBuyInTypeName.md +25 -0
  18. package/docs/enums/SAWGameTypeName.md +31 -0
  19. package/docs/enums/TournamentRegistrationStatusName.md +49 -0
  20. package/docs/interfaces/TMiniGamePrize.md +51 -0
  21. package/docs/interfaces/TMiniGameTemplate.md +109 -0
  22. package/docs/interfaces/TStoreCategory.md +21 -0
  23. package/docs/interfaces/TTournament.md +1 -1
  24. package/docs/interfaces/TTournamentDetailed.md +1 -1
  25. package/package.json +1 -1
  26. package/src/MiniGames/SAWBuyInType.ts +15 -4
  27. package/src/MiniGames/SAWGameType.ts +18 -5
  28. package/src/MiniGames/SAWGetTemplatesResponse.ts +47 -0
  29. package/src/MiniGames/SAWPrizeType.ts +23 -0
  30. package/src/SmarticoAPI.ts +18 -6
  31. package/src/Store/StoreCategory.ts +12 -0
  32. package/src/Tournaments/Tournament.ts +2 -2
  33. package/src/Tournaments/TournamentRegistrationStatus.ts +19 -10
  34. package/src/WSAPI/WSAPI.ts +12 -2
  35. package/src/WSAPI/WSAPITypes.ts +75 -1
  36. package/tsconfig.json +4 -1
@@ -1,10 +1,14 @@
1
+ /** @hidden */
1
2
  export declare enum SAWBuyInType {
2
3
  Free = 1,
3
4
  Points = 2,
4
5
  Spins = 3
5
6
  }
6
- export declare const SAWBuyInTypeName: {
7
- 1: string;
8
- 2: string;
9
- 3: string;
10
- };
7
+ export declare enum SAWBuyInTypeName {
8
+ Free = "free",
9
+ Points = "points",
10
+ Spins = "spins",
11
+ Unknown = "unknown"
12
+ }
13
+ /** @hidden */
14
+ export declare const SAWBuyInTypeNamed: (type: SAWBuyInType) => SAWBuyInTypeName;
@@ -1,12 +1,16 @@
1
+ /** @hidden */
1
2
  export declare enum SAWGameType {
2
3
  SpinAWheel = 1,
3
4
  ScratchCard = 2,
4
5
  MatchX = 3,
5
6
  GiftBox = 4
6
7
  }
7
- export declare const SAWGameTypeName: {
8
- 1: string;
9
- 2: string;
10
- 3: string;
11
- 4: string;
12
- };
8
+ export declare enum SAWGameTypeName {
9
+ SpinAWheel = "wheel",
10
+ ScratchCard = "scratch",
11
+ MatchX = "matchx",
12
+ GiftBox = "giftbox",
13
+ Unknown = "unknown"
14
+ }
15
+ /** @hidden */
16
+ export declare const SAWGameTypeNamed: (type: SAWGameType) => SAWGameTypeName;
@@ -1,5 +1,7 @@
1
+ import { TMiniGameTemplate } from "../WSAPI/WSAPITypes";
1
2
  import { ProtocolResponse } from "./../Base/ProtocolResponse";
2
3
  import { SAWTemplate } from "./SAWTemplate";
3
4
  export interface SAWGetTemplatesResponse extends ProtocolResponse {
4
5
  templates: SAWTemplate[];
5
6
  }
7
+ export declare const SAWTemplatesTransform: (items: SAWTemplate[]) => TMiniGameTemplate[];
@@ -1,3 +1,4 @@
1
+ /** @hidden */
1
2
  export declare enum SAWPrizeType {
2
3
  NO_PRIZE = 1,
3
4
  POINTS = 2,
@@ -6,3 +7,14 @@ export declare enum SAWPrizeType {
6
7
  SPIN = 5,
7
8
  JACKPOT = 6
8
9
  }
10
+ export declare enum MiniGamePrizeTypeName {
11
+ NO_PRIZE = "no-prize",
12
+ POINTS = "points",
13
+ BONUS = "bonus",
14
+ MANUAL = "manual",
15
+ SPIN = "spin",
16
+ JACKPOT = "jackpot",
17
+ UNKNOWN = "unknown"
18
+ }
19
+ /** @hidden */
20
+ export declare const MiniGamePrizeTypeNamed: (type: SAWPrizeType) => MiniGamePrizeTypeName;
@@ -5,13 +5,13 @@ import { SAWDoSpinResponse } from './MiniGames';
5
5
  import { GetTranslationsResponse, ResponseIdentify, TranslationArea } from './Core';
6
6
  import { GetLabelInfoResponse } from './Core/GetLabelInfoResponse';
7
7
  import { GetInboxMessagesResponse } from './Inbox';
8
- import { GetStoreItemsResponse } from './Store';
8
+ import { GetCategoriesStoreResponse, GetStoreItemsResponse } from './Store';
9
9
  import { GetAchievementMapResponse } from './Missions';
10
10
  import { GetTournamentInfoResponse, GetTournamentsResponse } from './Tournaments';
11
11
  import { LeaderBoardDetails, LeaderBoardPeriodType } from "./Leaderboard";
12
12
  import { GetLevelMapResponse } from "./Level";
13
13
  import { WSAPI } from "./WSAPI/WSAPI";
14
- import { TLevel, TMissionOrBadge, TStoreItem, TTournament, TTournamentDetailed } from "./WSAPI/WSAPITypes";
14
+ import { TLevel, TMiniGameTemplate, TMissionOrBadge, TStoreCategory, TStoreItem, TTournament, TTournamentDetailed } from "./WSAPI/WSAPITypes";
15
15
  interface Tracker {
16
16
  label_api_key: string;
17
17
  userPublicProps: any;
@@ -52,10 +52,13 @@ declare class SmarticoAPI {
52
52
  public_username_custom: string;
53
53
  }>;
54
54
  sawGetTemplates(user_ext_id: string, lang?: string, is_visitor_mode?: boolean): Promise<SAWGetTemplatesResponse>;
55
+ sawGetTemplatesT(user_ext_id: string): Promise<TMiniGameTemplate[]>;
55
56
  sawSpinRequest(user_ext_id: string, saw_template_id: number, round_id: number): Promise<SAWDoSpinResponse>;
56
57
  inboxGetMessages(user_ext_id: string, limit?: number, offset?: number): Promise<GetInboxMessagesResponse>;
57
58
  storeGetItems(user_ext_id: string): Promise<GetStoreItemsResponse>;
58
59
  storeGetItemsT(user_ext_id: string): Promise<TStoreItem[]>;
60
+ storeGetCategories(user_ext_id: string): Promise<GetCategoriesStoreResponse>;
61
+ storeGetCategoriesT(user_ext_id: string): Promise<TStoreCategory[]>;
59
62
  missionsGetItems(user_ext_id: string): Promise<GetAchievementMapResponse>;
60
63
  missionsGetItemsT(user_ext_id: string): Promise<TMissionOrBadge[]>;
61
64
  badgetsGetItems(user_ext_id: string): Promise<GetAchievementMapResponse>;
@@ -1,5 +1,7 @@
1
+ import { TStoreCategory } from "../WSAPI/WSAPITypes";
1
2
  import { StoreCategoryPublicMeta } from "./StoreCategoryPublicMeta";
2
3
  export interface StoreCategory {
3
4
  id?: number;
4
5
  publicMeta?: StoreCategoryPublicMeta;
5
6
  }
7
+ export declare const StoreCategoryTransform: (items: StoreCategory[]) => TStoreCategory[];
@@ -8,6 +8,15 @@ export declare enum TournamentRegistrationStatus {
8
8
  REGISTERED_PENDING_QUALIFICATION = 5,
9
9
  QUALIFIED_PENDING_REGISTRATION = 6
10
10
  }
11
- export type TournamentRegistrationStatusName = 'NOT_REGISTERED' | 'REGISTERED' | 'FINISHED' | 'PENDING' | 'CANCELLED' | 'REGISTERED_PENDING_QUALIFICATION' | 'QUALIFIED_PENDING_REGISTRATION';
11
+ export declare enum TournamentRegistrationStatusName {
12
+ NOT_REGISTERED = "NOT_REGISTERED",
13
+ REGISTERED = "REGISTERED",
14
+ FINISHED = "FINISHED",
15
+ PENDING = "PENDING",
16
+ CANCELLED = "CANCELLED",
17
+ REGISTERED_PENDING_QUALIFICATION = "REGISTERED_PENDING_QUALIFICATION",
18
+ QUALIFIED_PENDING_REGISTRATION = "QUALIFIED_PENDING_REGISTRATION",
19
+ UNKNOWN = "UNKNOWN"
20
+ }
12
21
  /** @hidden */
13
- export declare const TournamentRegistrationStatusName: (type: TournamentRegistrationStatus) => TournamentRegistrationStatusName;
22
+ export declare const TournamentRegistrationStatusNamed: (type: TournamentRegistrationStatus) => TournamentRegistrationStatusName;
@@ -1,12 +1,12 @@
1
1
  import { SmarticoAPI } from "../SmarticoAPI";
2
- import { TLevel, TMissionOrBadge, TStoreItem, TTournament, TTournamentDetailed, TUserProfile } from "./WSAPITypes";
2
+ import { TLevel, TMiniGameTemplate, TMissionOrBadge, TStoreItem, TTournament, TTournamentDetailed, TUserProfile } from "./WSAPITypes";
3
3
  /** @group General API */
4
4
  export declare class WSAPI {
5
5
  private api;
6
6
  /** @private */
7
7
  constructor(api: SmarticoAPI);
8
8
  /** Returns information about current user */
9
- getUserProfile(): Promise<TUserProfile>;
9
+ getUserProfile(): TUserProfile;
10
10
  /** Returns all the levels available the current user */
11
11
  getLevels(): Promise<TLevel[]>;
12
12
  /** Returns all the missions available the current user */
@@ -15,6 +15,10 @@ export declare class WSAPI {
15
15
  getBadges(): Promise<TMissionOrBadge[]>;
16
16
  /** Returns all the store items available the current user */
17
17
  getStoreItems(): Promise<TStoreItem[]>;
18
+ /** Returns store categories */
19
+ getStoreCategories(): Promise<TStoreItem[]>;
20
+ /** Returns the list of mini-games available for user */
21
+ getMiniGames(): Promise<TMiniGameTemplate[]>;
18
22
  /** Returns all the active instances of tournaments */
19
23
  getTournamentsList(): Promise<TTournament[]>;
20
24
  /** Returns details information of specific tournament instance, the response will includ tournamnet info and the leaderboard of players */
@@ -1,5 +1,54 @@
1
+ import { MiniGamePrizeTypeName, SAWBuyInTypeName, SAWGameTypeName } from "../MiniGames";
1
2
  import { TournamentRegistrationStatusName, TournamentRegistrationTypeName } from "../Tournaments";
2
3
  type TRibbon = 'sale' | 'hot' | 'new' | 'vip' | string;
4
+ /**
5
+ * TMiniGamePrize interface describes the information of prize in the array of prizes in the TMiniGameTemplate
6
+ */
7
+ export interface TMiniGamePrize {
8
+ /** ID of the prize */
9
+ id: number;
10
+ /** The visual name of the prize */
11
+ name: string;
12
+ /** The type of the prize, no-prize, points, bonus, manual, spin, jackpot */
13
+ prize_type: MiniGamePrizeTypeName;
14
+ /** Numeric value of the prize in case it's pints or spin type */
15
+ prize_value?: number;
16
+ /** Custom font size for the prize */
17
+ font_size?: number;
18
+ /** The URL of the icon of the prize */
19
+ icon?: string;
20
+ }
21
+ /**
22
+ * TMiniGameTemplate interface describes the information of mini-games available for the user
23
+ */
24
+ export interface TMiniGameTemplate {
25
+ /** ID of the mini-game template */
26
+ id: number;
27
+ /** Name of the mini-game template, translated to the user language */
28
+ name: string;
29
+ /** Description of the mini-game template, translated to the user language */
30
+ description: string;
31
+ /** URL of the icon of the mini-game template */
32
+ thumbnail: string;
33
+ /** The type of the game, e.g. Spin the Wheel, Gift Box, Scratch card, MatchX etc */
34
+ saw_game_type: SAWGameTypeName;
35
+ /** How the user is charged for each game attempt e.g. Free, Points or Spin attempts */
36
+ saw_buyin_type: SAWBuyInTypeName;
37
+ buyin_cost_points: number;
38
+ spin_count?: number;
39
+ /** The message that should be shown to the user when he cannot play the game, server rejected attempt with error code SAWSpinErrorCode.SAW_FAILED_MAX_SPINS_REACHED */
40
+ over_limit_message: string;
41
+ /** The message that should be shown to the user when he cannot play the game because he doesn't have spin attempts or points. */
42
+ no_attempts_message: string;
43
+ /** Current jackpont amount, if jackpot is enabled. */
44
+ jackpot_current: number;
45
+ /** The amount that will be added to the jackpot every time when somebody plays the game. Note that the contribution amount is abstract, means that no money or points are deducted from the user balance. */
46
+ jackpot_add_on_attempt: number;
47
+ /** The symbol of jackpot that is giving the sense to the 'amount' E.g. the symbol could be EUR and connected to the amount it can indicate that amount is monetary, e.g. '100 EUR'. Or the symbol can be 'Free spins' and connected to the amount it can indicate that amount is number of free spins, e.g. '100 Free spins'.
48
+ */
49
+ jackpot_symbol: string;
50
+ prizes: TMiniGamePrize[];
51
+ }
3
52
  /**
4
53
  * TUser interface describes the information of the user
5
54
  * The user object is returned by _smartico.api.getUserProfile() method.
@@ -156,6 +205,14 @@ export interface TTournamentDetailed extends TTournament {
156
205
  scores: number;
157
206
  };
158
207
  }
208
+ /**
209
+ * TStoreCategory interface describes the store category item. Each store item can be assigned to 1 or more categories
210
+ */
211
+ export interface TStoreCategory {
212
+ id: number;
213
+ name: string;
214
+ order: number;
215
+ }
159
216
  /**
160
217
  * TStoreItem interface describes the information of the store item defined in the system
161
218
  */