@smartico/public-api 0.0.216 → 0.0.218

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 (57) hide show
  1. package/dist/Base/ClassId.d.ts +4 -0
  2. package/dist/Inbox/GetInboxMessagesRequest.d.ts +2 -0
  3. package/dist/Inbox/InboxCategories.d.ts +5 -0
  4. package/dist/Inbox/InboxMessage.d.ts +2 -0
  5. package/dist/Inbox/index.d.ts +1 -0
  6. package/dist/Raffle/GetDrawResponse.d.ts +5 -0
  7. package/dist/Raffle/GetDrawRunRequest.d.ts +5 -0
  8. package/dist/Raffle/GetDrawRunResponse.d.ts +5 -0
  9. package/dist/Raffle/GetRafflesRequest.d.ts +4 -0
  10. package/dist/Raffle/GetRafflesResponse.d.ts +5 -0
  11. package/dist/Raffle/Raffle.d.ts +34 -0
  12. package/dist/Raffle/RaffleDraw.d.ts +70 -0
  13. package/dist/Raffle/RafflePrize.d.ts +97 -0
  14. package/dist/Raffle/RafflePrizeWinner.d.ts +9 -0
  15. package/dist/Raffle/RaffleTicket.d.ts +5 -0
  16. package/dist/Raffle/index.d.ts +9 -0
  17. package/dist/SmarticoAPI.d.ts +5 -2
  18. package/dist/WSAPI/WSAPI.d.ts +5 -1
  19. package/dist/WSAPI/WSAPITypes.d.ts +3 -0
  20. package/dist/index.js +44 -7
  21. package/dist/index.js.map +1 -1
  22. package/dist/index.modern.mjs +35 -8
  23. package/dist/index.modern.mjs.map +1 -1
  24. package/docs/README.md +9 -0
  25. package/docs/classes/WSAPI.md +12 -1
  26. package/docs/interfaces/GetDrawRunRequest.md +49 -0
  27. package/docs/interfaces/GetDrawRunResponse.md +63 -0
  28. package/docs/interfaces/GetRafflesRequest.md +37 -0
  29. package/docs/interfaces/GetRafflesResponse.md +63 -0
  30. package/docs/interfaces/Raffle.md +59 -0
  31. package/docs/interfaces/RaffleDraw.md +124 -0
  32. package/docs/interfaces/RafflePrize.md +137 -0
  33. package/docs/interfaces/RafflePrizeWinner.md +31 -0
  34. package/docs/interfaces/RaffleTicket.md +13 -0
  35. package/docs/interfaces/TInboxMessage.md +8 -0
  36. package/package.json +1 -1
  37. package/src/Base/ClassId.ts +13 -0
  38. package/src/Inbox/GetInboxMessagesRequest.ts +2 -0
  39. package/src/Inbox/GetInboxMessagesResponse.ts +1 -0
  40. package/src/Inbox/InboxCategories.ts +5 -0
  41. package/src/Inbox/InboxMessage.ts +3 -0
  42. package/src/Inbox/index.ts +1 -0
  43. package/src/MiniGames/SAWGetTemplatesResponse.ts +1 -1
  44. package/src/Raffle/GetDrawRunRequest.ts +6 -0
  45. package/src/Raffle/GetDrawRunResponse.ts +6 -0
  46. package/src/Raffle/GetRafflesRequest.ts +5 -0
  47. package/src/Raffle/GetRafflesResponse.ts +6 -0
  48. package/src/Raffle/Raffle.ts +41 -0
  49. package/src/Raffle/RaffleDraw.ts +92 -0
  50. package/src/Raffle/RafflePrize.ts +117 -0
  51. package/src/Raffle/RafflePrizeWinner.ts +11 -0
  52. package/src/Raffle/RaffleTicket.ts +9 -0
  53. package/src/Raffle/index.ts +9 -0
  54. package/src/SmarticoAPI.ts +16 -1
  55. package/src/WSAPI/WSAPI.ts +10 -3
  56. package/src/WSAPI/WSAPITypes.ts +3 -0
  57. package/tsconfig.json +1 -0
@@ -99,6 +99,10 @@ export declare enum ClassId {
99
99
  JP_OPTOUT_REQUEST = 806,
100
100
  JP_OPTOUT_RESPONSE = 807,
101
101
  JP_WIN_PUSH = 808,
102
+ RAF_GET_RAFFLES_REQUEST = 900,
103
+ RAF_GET_RAFFLES_RESPONSE = 901,
104
+ RAF_GET_DRAW_REQUEST = 904,
105
+ RAF_GET_DRAW_RESPONSE = 905,
102
106
  REGISTER_PUSH_NOTIFICATIONS_TOKEN_REQ = 1003,
103
107
  REGISTER_PUSH_NOTIFICATIONS_TOKEN_RESP = 2003,
104
108
  CLIENT_DEBUG_REQUEST = 77777,
@@ -1,6 +1,8 @@
1
+ import { InboxCategories } from './InboxCategories';
1
2
  import { ProtocolMessage } from '../Base/ProtocolMessage';
2
3
  export interface GetInboxMessagesRequest extends ProtocolMessage {
3
4
  limit?: number;
4
5
  offset?: number;
5
6
  starred_only?: boolean;
7
+ category_id?: InboxCategories;
6
8
  }
@@ -0,0 +1,5 @@
1
+ export declare enum InboxCategories {
2
+ General = 0,
3
+ Platform = 1,
4
+ Personal = 2
5
+ }
@@ -1,4 +1,5 @@
1
1
  import { TInboxMessageBody } from '../WSAPI/WSAPITypes';
2
+ import { InboxCategories } from './InboxCategories';
2
3
  import { InboxMessageType } from './InboxMessageType';
3
4
  import { OpenLinksType } from './OpenLinksType';
4
5
  export interface InboxMessageBody {
@@ -24,5 +25,6 @@ export interface InboxMessage {
24
25
  is_read: boolean;
25
26
  is_starred: boolean;
26
27
  is_deleted?: boolean;
28
+ category_id?: InboxCategories;
27
29
  }
28
30
  export declare const InboxMessageBodyTransform: (item: InboxMessageBody) => TInboxMessageBody;
@@ -9,3 +9,4 @@ export * from './MarkInboxMessageStarredResponse';
9
9
  export * from './MarkInboxMessageDeletedRequest';
10
10
  export * from './MarkInboxMessageDeletedResponse';
11
11
  export * from './OpenLinksType';
12
+ export * from './InboxCategories';
@@ -0,0 +1,5 @@
1
+ import { ProtocolResponse } from '../Base/ProtocolResponse';
2
+ import { RaffleDraw } from './RaffleDraw';
3
+ export interface GetDrawResponse extends ProtocolResponse {
4
+ draw: RaffleDraw;
5
+ }
@@ -0,0 +1,5 @@
1
+ import { ProtocolMessage } from '../Base/ProtocolMessage';
2
+ export interface GetDrawRunRequest extends ProtocolMessage {
3
+ raffle_id: number;
4
+ run_id: number;
5
+ }
@@ -0,0 +1,5 @@
1
+ import { ProtocolResponse } from '../Base/ProtocolResponse';
2
+ import { RaffleDraw } from './RaffleDraw';
3
+ export interface GetDrawRunResponse extends ProtocolResponse {
4
+ draw: RaffleDraw;
5
+ }
@@ -0,0 +1,4 @@
1
+ import { ProtocolMessage } from '../Base/ProtocolMessage';
2
+ export interface GetRafflesRequest extends ProtocolMessage {
3
+ skip_public_meta?: boolean;
4
+ }
@@ -0,0 +1,5 @@
1
+ import { ProtocolResponse } from '../Base/ProtocolResponse';
2
+ import { Raffle } from './Raffle';
3
+ export interface GetRafflesResponse extends ProtocolResponse {
4
+ items: Raffle[];
5
+ }
@@ -0,0 +1,34 @@
1
+ import { RaffleDraw } from "./RaffleDraw";
2
+ interface RafflePublicMeta {
3
+ /** Name of the raffle */
4
+ name: string;
5
+ /** Description of the raffle */
6
+ description: string;
7
+ /** ID of the custom section that is linked to the raffle in the Gamification widget */
8
+ custom_section_id: number;
9
+ /** URL of the image that represents the raffle */
10
+ image_url: string;
11
+ }
12
+ interface Raffle {
13
+ /** ID of the Raffle template */
14
+ raffle_id: number;
15
+ /** Meta information about raffle for the presentation on UI */
16
+ public_meta: RafflePublicMeta;
17
+ /** Date of start */
18
+ start_date_ts: number;
19
+ /** Date of end */
20
+ end_date_ts: number;
21
+ /** Maximum numer of tickets that can be given to all users for the whole period of raffle */
22
+ max_tickets_count: number;
23
+ /**
24
+ * Number of tickets that are already given to all users for this raffle
25
+ */
26
+ current_tickets_count: number;
27
+ /**
28
+ * List of draws that are available for this raffle.
29
+ * For example, if the raffle is containg one hourly draw, one daily draw and one draw on fixed date like 01/01/2022,
30
+ * Then the list will always return 3 draws, no matter if the draws are already executed or they are in the future.
31
+ */
32
+ draws: RaffleDraw[];
33
+ }
34
+ export { Raffle };
@@ -0,0 +1,70 @@
1
+ import { RafflePrize } from "./RafflePrize";
2
+ import { RaffleTicket } from "./RaffleTicket";
3
+ interface RaffleDrawPublicMeta {
4
+ /** Name of the draw, e.g. 'Daily draw' */
5
+ name: string;
6
+ /** Description of the draw */
7
+ description: string;
8
+ /** URL of the image that represents the draw */
9
+ image_url: string;
10
+ }
11
+ declare enum RaffleDrawInstanceState {
12
+ /** Draw is open for the tickets collection */
13
+ Open = 1,
14
+ /** Winner selection is in progress */
15
+ WinnerSelection = 2,
16
+ /** Draw is executed and the winners are selected */
17
+ Executed = 3
18
+ }
19
+ interface RaffleDraw {
20
+ /**
21
+ * Id of the Draw definition, for the repetative draws (e.g. daily), this number will be the same for all draws that are repeating daily
22
+ * (internal name: schedule_id)
23
+ */
24
+ draw_id: number;
25
+ /** Meta information of the Draw for the presentaiton in UI */
26
+ public_meta: RaffleDrawPublicMeta;
27
+ /** Information about prizes in the draw */
28
+ prizes: RafflePrize[];
29
+ /**
30
+ * State of current instance of Draw
31
+ */
32
+ current_state: RaffleDrawInstanceState;
33
+ /**
34
+ * Field indicates the ID of the latest instance/run of draw
35
+ */
36
+ run_id: number;
37
+ /** Date/time of the draw execution */
38
+ execution_ts: number;
39
+ /** Date of the previously executed draw (if there is such) */
40
+ previous_run_ts?: number;
41
+ /** Unique ID of the previusly executed draw (if there is such) */
42
+ previous_run_id?: number;
43
+ /**
44
+ * Date/time starting from which the tickets will participate in the upcoming draw
45
+ * This value need to be taken into account with next_execute_ts field value, for example
46
+ * Next draw is at 10:00, tickets_time_back_ts is 9:00, so all tickets that are collected after 9:00 will participate in the draw at 10:00
47
+ * (internally this value is calculated as next_execute_ts - time_back_period_ms)
48
+ */
49
+ tickets_time_back_ts: number;
50
+ /** Field is indicating if same ticket can win multiple prizes in the same draw
51
+ * For example there are 3 types of prizes in the draw - iPhone, iPad, MacBook
52
+ * If this field is true, then one ticket can win all 3 prizes (depending on the chances of course),
53
+ * if false, then one ticket can win only one prize.
54
+ * The distribution of the prizes is start from top (assuming on top are the most valuable prizes) to bottom (less valuable prizes)
55
+ * If specific prize has multiple values, e.g. we have 3 iPhones,
56
+ * then the same ticket can win only one prize of a kind, but can win multiple prizes of different kind (if allow_multi_prize_per_ticket is true)
57
+ */
58
+ allow_multi_prize_per_ticket: boolean;
59
+ /**
60
+ * The number of tickets that are already given to all users for this instance of draw.
61
+ * In other words tickets that are collected between tickets_time_back_ts and current time (or till current_execution_ts is the instance is executed).
62
+ */
63
+ total_tickets_count: number;
64
+ /**
65
+ * The number of tickets collected by current user for this instance of draw.
66
+ */
67
+ my_tickets_count: number;
68
+ my_last_tickets: RaffleTicket[];
69
+ }
70
+ export { RaffleDraw };
@@ -0,0 +1,97 @@
1
+ import { RafflePrizeWinner } from "./RafflePrizeWinner";
2
+ interface RafflePrizePublicMeta {
3
+ /** Name of the prize */
4
+ name: string;
5
+ /** Description of the prize */
6
+ description: string;
7
+ /** URL of the image that represents the prize */
8
+ image_url: string;
9
+ }
10
+ /**
11
+ * Represents a prize in a draw.
12
+ */
13
+ interface RafflePrize {
14
+ /**
15
+ * The unique identifier for the prize definition
16
+ */
17
+ prize_id: string;
18
+ /**
19
+ * Meta information about the prize for presentation in the UI.
20
+ */
21
+ public_meta: RafflePrizePublicMeta;
22
+ /**
23
+ * The number of prizes available per run of the draw.
24
+ * E.g. if the draw is run daily, this is the number of prizes available each day, for example 3 iPhones.
25
+ */
26
+ prizes_per_run: number;
27
+ /**
28
+ * The actual number of prizes for the current instance.
29
+ * This value is taking into account follwing values:
30
+ * - min_required_total_tickets,
31
+ * - add_one_prize_per_each_x_tickets
32
+ * - stock_items_per_draw
33
+ * - total_tickets_count (from Draw instance)
34
+ * - cap_prizes_per_run
35
+ * For example:
36
+ * - prizes_per_run = 1
37
+ * - min_required_total_tickets = 1000
38
+ * - add_one_prize_per_each_x_tickets = 1000
39
+ * - stock_items_per_draw = 5
40
+ * - total_tickets_count = 7000
41
+ * - cap_prizes_per_run = 6
42
+ * prizes_per_run_actual will be 5, because
43
+ * 7000 tickets are collected, so 7 iPhones are available, but the cap is 6 and the stock is 5.
44
+ */
45
+ prizes_per_run_actual: number;
46
+ /**
47
+ *
48
+ * The chances to win the prize by current player.
49
+ * Calculated as the ratio of the number of tickets collected by the current player to the
50
+ * total number of tickets collected by all players and multiplied by number of actual prizes of this kind.
51
+ */
52
+ chances_to_win_perc: number;
53
+ /**
54
+ * The minimum number of total tickets collected during draw period required to unlock the prize.
55
+ * If the number of tickets collected is less than this value, the prize is not available.
56
+ * Under total tickets we understand the number of tickets collected by all users.
57
+ * The 'draw period' is the time between the tickets_time_back_ts value of the draw and the current time.
58
+ */
59
+ min_required_total_tickets?: number;
60
+ /**
61
+ * One additional prize will be awarded for each X tickets.
62
+ * E.g. if the prize is 1 iPhone and the value is set to 1000, then for every 1000 tickets collected, an additional iPhone is awarded.
63
+ * If min_required_total_tickets is set to 1000, then next iPhone is awarded when 2000 tickets are collected, and so on.
64
+ * If min_required_total_tickets is not set, then the next iPhone will be awarded when 1000 tickets are collected.
65
+ */
66
+ add_one_prize_per_each_x_tickets?: number;
67
+ /**
68
+ * Indicates whether the prize requires a claim action from the user.
69
+ */
70
+ requires_claim: boolean;
71
+ /**
72
+ * The minimum number of tickets a user must have to be eligible for the prize.
73
+ * For example iPhone prize may require 10 tickets to be collected, only users with 10 or more tickets will be eligible for the prize.
74
+ * More tickets are better, as they increase the chances of winning.
75
+ */
76
+ min_required_tickets_for_user: number;
77
+ /**
78
+ * The maximum number of prizes that can be given withing one instance/run of draw.
79
+ * For example the prize is iPhone and add_one_prize_per_each_x_tickets is set to 1000,
80
+ * cap_prizes_per_run is set to 3, and the total number of tickets collected is 7000.
81
+ * In this case, the prizes_per_run_actual will be limitted by 3
82
+ */
83
+ cap_prizes_per_run?: number;
84
+ /**
85
+ * The priority of the prize. The low number means higher priority (e.g. 1 is higher priority than 2).
86
+ * If there are multiple prizes available, the prize with the highest priority (lowest number) will be awarded first.
87
+ */
88
+ priority: number;
89
+ /**
90
+ * Optional field that indicates total remaining number of the prize for all draws of the type.
91
+ * For example, the Daily draw has 1 iPhone daily, and the total number of iPhones is 10.
92
+ * the stock_items_per_draw will be decreasing by 1 each day (assuming there is enough tickets and it is won every day), and when it reaches 0, the prize is not available anymore.
93
+ */
94
+ stock_items_per_draw?: number;
95
+ winners: RafflePrizeWinner[];
96
+ }
97
+ export { RafflePrize };
@@ -0,0 +1,9 @@
1
+ import { RaffleTicket } from "./RaffleTicket";
2
+ interface RafflePrizeWinner {
3
+ user_id: number;
4
+ public_username?: string;
5
+ avatar_id: string;
6
+ avatar_url?: string;
7
+ ticket: RaffleTicket;
8
+ }
9
+ export { RafflePrizeWinner };
@@ -0,0 +1,5 @@
1
+ interface RaffleTicket {
2
+ id: number;
3
+ s: string;
4
+ }
5
+ export { RaffleTicket };
@@ -0,0 +1,9 @@
1
+ export * from './GetDrawRunRequest';
2
+ export * from './GetDrawRunResponse';
3
+ export * from './GetRafflesRequest';
4
+ export * from './GetRafflesResponse';
5
+ export * from './Raffle';
6
+ export * from './RaffleDraw';
7
+ export * from './RafflePrize';
8
+ export * from './RafflePrizeWinner';
9
+ export * from './RaffleTicket';
@@ -19,6 +19,8 @@ import { ClaimBonusResponse, GetBonusesResponse } from './Bonuses';
19
19
  import { SAWDoSpinBatchResponse } from './MiniGames/SAWDoSpinBatchResponse';
20
20
  import { SAWDoAcknowledgeBatchResponse } from './MiniGames/SAWDoAcknowledgeBatchResponse';
21
21
  import { GetRelatedAchTourResponse } from './Missions/GetRelatedAchTourResponse';
22
+ import { GetRafflesResponse } from './Raffle/GetRafflesResponse';
23
+ import { InboxCategories } from './Inbox/InboxCategories';
22
24
  interface Tracker {
23
25
  label_api_key: string;
24
26
  userPublicProps: any;
@@ -116,8 +118,8 @@ declare class SmarticoAPI {
116
118
  getCustomSections(user_ext_id: string): Promise<GetCustomSectionsResponse>;
117
119
  getCustomSectionsT(user_ext_id: string): Promise<TUICustomSection[]>;
118
120
  getTranslationsT(user_ext_id: string, lang_code: string, areas: TranslationArea[], cacheSec?: number): Promise<GetTranslationsResponse>;
119
- getInboxMessages(user_ext_id: string, limit: number, offset: number, starred_only: boolean): Promise<GetInboxMessagesResponse>;
120
- getInboxMessagesT(user_ext_id: string, from?: number, to?: number, favoriteOnly?: boolean): Promise<TInboxMessage[]>;
121
+ getInboxMessages(user_ext_id: string, limit: number, offset: number, starred_only: boolean, category_id?: InboxCategories): Promise<GetInboxMessagesResponse>;
122
+ getInboxMessagesT(user_ext_id: string, from?: number, to?: number, favoriteOnly?: boolean, categoryId?: InboxCategories): Promise<TInboxMessage[]>;
121
123
  getInboxMessageBody(messageGuid: string): Promise<InboxMessageBody>;
122
124
  getInboxMessageBodyT(messageGuid: string): Promise<TInboxMessageBody>;
123
125
  markInboxMessageRead(user_ext_id: string, messageGuid: string): Promise<MarkInboxMessageReadResponse>;
@@ -127,5 +129,6 @@ declare class SmarticoAPI {
127
129
  deleteAllInboxMessages(user_ext_id: string): Promise<MarkInboxMessageDeletedResponse>;
128
130
  getWSCalls(): WSAPI;
129
131
  getRelatedItemsForGame(user_ext_id: string, related_game_id: string): Promise<GetRelatedAchTourResponse>;
132
+ getRaffles(user_ext_id: string): Promise<GetRafflesResponse>;
130
133
  }
131
134
  export { SmarticoAPI, MessageSender };
@@ -3,6 +3,8 @@ import { InboxMarkMessageAction, LeaderBoardDetailsT, TAchCategory, TBuyStoreIte
3
3
  import { LeaderBoardPeriodType } from '../Leaderboard';
4
4
  import { JackpotDetails, JackpotsOptinResponse, JackpotsOptoutResponse } from '../Jackpots';
5
5
  import { GetRelatedAchTourResponse } from 'src/Missions/GetRelatedAchTourResponse';
6
+ import { GetRafflesResponse } from '../Raffle/GetRafflesResponse';
7
+ import { InboxCategories } from '../Inbox/InboxCategories';
6
8
  /** @group General API */
7
9
  export declare class WSAPI {
8
10
  private api;
@@ -411,10 +413,11 @@ export declare class WSAPI {
411
413
  *
412
414
  * @param params
413
415
  */
414
- getInboxMessages({ from, to, onlyFavorite, onUpdate, }?: {
416
+ getInboxMessages({ from, to, onlyFavorite, categoryId, onUpdate, }?: {
415
417
  from?: number;
416
418
  to?: number;
417
419
  onlyFavorite?: boolean;
420
+ categoryId?: InboxCategories;
418
421
  onUpdate?: (data: TInboxMessage[]) => void;
419
422
  }): Promise<TInboxMessage[]>;
420
423
  /**
@@ -541,4 +544,5 @@ export declare class WSAPI {
541
544
  * ```
542
545
  */
543
546
  getRelatedItemsForGame(related_game_id: string): Promise<GetRelatedAchTourResponse>;
547
+ getRaffles(): Promise<GetRafflesResponse>;
544
548
  }
@@ -6,6 +6,7 @@ import { LeaderBoardPeriodType } from '../Leaderboard';
6
6
  import { AchCustomLayoutTheme, AchCustomSectionType, AchMissionsTabsOptions, AchOverviewMissionsFilter } from '../CustomSections';
7
7
  import { BonusStatus, BonusTemplateMetaMap, BonusMetaMap } from '../Bonuses';
8
8
  import { PrizeModifiers } from '../MiniGames/PrizeModifiers';
9
+ import { InboxCategories } from '../Inbox/InboxCategories';
9
10
  type TRibbon = 'sale' | 'hot' | 'new' | 'vip' | string;
10
11
  /**
11
12
  * TMiniGamePrize describes the information of prize in the array of prizes in the TMiniGameTemplate
@@ -620,6 +621,8 @@ export interface TInboxMessage {
620
621
  read: boolean;
621
622
  /** Indicator if a message is added to favorites */
622
623
  favorite: boolean;
624
+ /** Category id per inbox message, can be part of System inboxes, Personal inboxes or General inbox messages */
625
+ category_id?: InboxCategories;
623
626
  }
624
627
  export interface TInboxMessageBody {
625
628
  /** Message title */
package/dist/index.js CHANGED
@@ -123,6 +123,15 @@ exports.ClassId = void 0;
123
123
  ClassId[ClassId["JP_OPTOUT_REQUEST"] = 806] = "JP_OPTOUT_REQUEST";
124
124
  ClassId[ClassId["JP_OPTOUT_RESPONSE"] = 807] = "JP_OPTOUT_RESPONSE";
125
125
  ClassId[ClassId["JP_WIN_PUSH"] = 808] = "JP_WIN_PUSH";
126
+ ClassId[ClassId["RAF_GET_RAFFLES_REQUEST"] = 900] = "RAF_GET_RAFFLES_REQUEST";
127
+ ClassId[ClassId["RAF_GET_RAFFLES_RESPONSE"] = 901] = "RAF_GET_RAFFLES_RESPONSE";
128
+ ClassId[ClassId["RAF_GET_DRAW_REQUEST"] = 904] = "RAF_GET_DRAW_REQUEST";
129
+ ClassId[ClassId["RAF_GET_DRAW_RESPONSE"] = 905] = "RAF_GET_DRAW_RESPONSE";
130
+ /*
131
+ RAF_GET_TICKETS_REQUEST = 902,
132
+ RAF_GET_TICKETS_RESPONSE = 903,
133
+ RAF_CLAIM_PRIZE_REQUEST = 906,
134
+ */
126
135
  /*
127
136
  !Important, if adding new messages that are 'acting' on behalf of the client,
128
137
  you need to include them in the CLASS_ID_IGNORE_FOR_SIMULATION
@@ -413,6 +422,7 @@ var SAWTemplatesTransform = function SAWTemplatesTransform(items) {
413
422
  saw_template_ui_definition: r.saw_template_ui_definition,
414
423
  show_prize_history: r.show_prize_history,
415
424
  prizes: r.prizes.map(function (p) {
425
+ var _p$saw_prize_ui_defin;
416
426
  var y = {
417
427
  id: p.saw_prize_id,
418
428
  name: p.saw_prize_ui_definition.name,
@@ -439,7 +449,7 @@ var SAWTemplatesTransform = function SAWTemplatesTransform(items) {
439
449
  relative_period_timezone: p.relative_period_timezone,
440
450
  is_surcharge: p.is_surcharge,
441
451
  is_deleted: p.is_deleted,
442
- custom_data: IntUtils.JsonOrText(r.saw_template_ui_definition.custom_data),
452
+ custom_data: IntUtils.JsonOrText((_p$saw_prize_ui_defin = p.saw_prize_ui_definition) == null ? void 0 : _p$saw_prize_ui_defin.custom_data),
443
453
  prize_modifiers: p.saw_prize_ui_definition.prize_modifiers,
444
454
  allow_split_decimal: p.saw_prize_ui_definition.allow_split_decimal,
445
455
  hide_prize_from_history: p.saw_prize_ui_definition.hide_prize_from_history
@@ -753,7 +763,8 @@ var InboxMessagesTransform = function InboxMessagesTransform(items) {
753
763
  sent_date: item.createDate,
754
764
  message_guid: item.engagement_uid,
755
765
  read: item.is_read,
756
- favorite: item.is_starred
766
+ favorite: item.is_starred,
767
+ category_id: item.category_id
757
768
  };
758
769
  return x;
759
770
  });
@@ -800,6 +811,13 @@ exports.OpenLinksType = void 0;
800
811
  OpenLinksType[OpenLinksType["CurrentWindow"] = 2] = "CurrentWindow";
801
812
  })(exports.OpenLinksType || (exports.OpenLinksType = {}));
802
813
 
814
+ exports.InboxCategories = void 0;
815
+ (function (InboxCategories) {
816
+ InboxCategories[InboxCategories["General"] = 0] = "General";
817
+ InboxCategories[InboxCategories["Platform"] = 1] = "Platform";
818
+ InboxCategories[InboxCategories["Personal"] = 2] = "Personal";
819
+ })(exports.InboxCategories || (exports.InboxCategories = {}));
820
+
803
821
  exports.BuyStoreItemErrorCode = void 0;
804
822
  (function (BuyStoreItemErrorCode) {
805
823
  BuyStoreItemErrorCode[BuyStoreItemErrorCode["FAILED_TO_BUY_SHOP_ITEM"] = 121] = "FAILED_TO_BUY_SHOP_ITEM";
@@ -2320,13 +2338,14 @@ var WSAPI = /*#__PURE__*/function () {
2320
2338
  from = _ref9.from,
2321
2339
  to = _ref9.to,
2322
2340
  onlyFavorite = _ref9.onlyFavorite,
2341
+ categoryId = _ref9.categoryId,
2323
2342
  onUpdate = _ref9.onUpdate;
2324
2343
  try {
2325
2344
  var _this27 = this;
2326
2345
  if (onUpdate) {
2327
2346
  _this27.onUpdateCallback.set(onUpdateContextKey.InboxMessages, onUpdate);
2328
2347
  }
2329
- return Promise.resolve(_this27.api.getInboxMessagesT(null, from, to, onlyFavorite));
2348
+ return Promise.resolve(_this27.api.getInboxMessagesT(null, from, to, onlyFavorite, categoryId));
2330
2349
  } catch (e) {
2331
2350
  return Promise.reject(e);
2332
2351
  }
@@ -2703,6 +2722,14 @@ var WSAPI = /*#__PURE__*/function () {
2703
2722
  return Promise.reject(e);
2704
2723
  }
2705
2724
  };
2725
+ _proto.getRaffles = function getRaffles() {
2726
+ try {
2727
+ var _this46 = this;
2728
+ return Promise.resolve(_this46.api.getRaffles(null));
2729
+ } catch (e) {
2730
+ return Promise.reject(e);
2731
+ }
2732
+ };
2706
2733
  return WSAPI;
2707
2734
  }();
2708
2735
 
@@ -3728,7 +3755,7 @@ var SmarticoAPI = /*#__PURE__*/function () {
3728
3755
  return Promise.reject(e);
3729
3756
  }
3730
3757
  };
3731
- _proto.getInboxMessages = function getInboxMessages(user_ext_id, limit, offset, starred_only) {
3758
+ _proto.getInboxMessages = function getInboxMessages(user_ext_id, limit, offset, starred_only, category_id) {
3732
3759
  if (limit === void 0) {
3733
3760
  limit = 20;
3734
3761
  }
@@ -3740,14 +3767,15 @@ var SmarticoAPI = /*#__PURE__*/function () {
3740
3767
  var message = _this53.buildMessage(user_ext_id, exports.ClassId.GET_INBOX_MESSAGES_REQUEST, {
3741
3768
  limit: limit,
3742
3769
  offset: offset,
3743
- starred_only: starred_only
3770
+ starred_only: starred_only,
3771
+ category_id: category_id
3744
3772
  });
3745
3773
  return Promise.resolve(_this53.send(message, exports.ClassId.GET_INBOX_MESSAGES_RESPONSE));
3746
3774
  } catch (e) {
3747
3775
  return Promise.reject(e);
3748
3776
  }
3749
3777
  };
3750
- _proto.getInboxMessagesT = function getInboxMessagesT(user_ext_id, from, to, favoriteOnly) {
3778
+ _proto.getInboxMessagesT = function getInboxMessagesT(user_ext_id, from, to, favoriteOnly, categoryId) {
3751
3779
  if (from === void 0) {
3752
3780
  from = 0;
3753
3781
  }
@@ -3761,7 +3789,7 @@ var SmarticoAPI = /*#__PURE__*/function () {
3761
3789
  var _this54 = this;
3762
3790
  var limit = to - from > 20 ? 20 : to - from;
3763
3791
  var offset = from;
3764
- return Promise.resolve(_this54.getInboxMessages(user_ext_id, limit, offset, favoriteOnly)).then(function (_this54$getInboxMessa) {
3792
+ return Promise.resolve(_this54.getInboxMessages(user_ext_id, limit, offset, favoriteOnly, categoryId)).then(function (_this54$getInboxMessa) {
3765
3793
  return InboxMessagesTransform(_this54$getInboxMessa.log);
3766
3794
  });
3767
3795
  } catch (e) {
@@ -3875,6 +3903,15 @@ var SmarticoAPI = /*#__PURE__*/function () {
3875
3903
  return Promise.reject(e);
3876
3904
  }
3877
3905
  };
3906
+ _proto.getRaffles = function getRaffles(user_ext_id) {
3907
+ try {
3908
+ var _this63 = this;
3909
+ var message = _this63.buildMessage(user_ext_id, exports.ClassId.RAF_GET_RAFFLES_REQUEST);
3910
+ return Promise.resolve(_this63.send(message, exports.ClassId.RAF_GET_DRAW_RESPONSE));
3911
+ } catch (e) {
3912
+ return Promise.reject(e);
3913
+ }
3914
+ };
3878
3915
  return SmarticoAPI;
3879
3916
  }();
3880
3917