@smartico/public-api 0.0.225 → 0.0.227

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/Base/ClassId.d.ts +4 -2
  2. package/dist/MiniGames/SAWTemplateUI.d.ts +2 -0
  3. package/dist/MiniGames/SAWWheelLayout.d.ts +6 -0
  4. package/dist/MiniGames/index.d.ts +1 -0
  5. package/dist/Raffle/GetRaffleDrawRunsHistoryRequest.d.ts +5 -0
  6. package/dist/Raffle/GetRaffleDrawRunsHistoryResponse.d.ts +5 -0
  7. package/dist/Raffle/RaffleDraw.d.ts +31 -1
  8. package/dist/Raffle/RafflePrize.d.ts +4 -0
  9. package/dist/Raffle/RafflePrizeWinner.d.ts +2 -1
  10. package/dist/Raffle/index.d.ts +2 -0
  11. package/dist/SmarticoAPI.d.ts +3 -0
  12. package/dist/WSAPI/WSAPI.d.ts +3 -0
  13. package/dist/index.js +46 -2
  14. package/dist/index.js.map +1 -1
  15. package/dist/index.modern.mjs +27 -3
  16. package/dist/index.modern.mjs.map +1 -1
  17. package/docs/README.md +3 -0
  18. package/docs/classes/WSAPI.md +32 -0
  19. package/docs/interfaces/GetRaffleDrawRunsHistoryRequest.md +49 -0
  20. package/docs/interfaces/GetRaffleDrawRunsHistoryResponse.md +63 -0
  21. package/docs/interfaces/RaffleDrawRun.md +61 -0
  22. package/docs/interfaces/RafflePrize.md +8 -0
  23. package/docs/interfaces/RafflePrizeWinner.md +6 -0
  24. package/package.json +1 -1
  25. package/src/Base/ClassId.ts +4 -3
  26. package/src/MiniGames/SAWTemplateUI.ts +3 -0
  27. package/src/MiniGames/SAWWheelLayout.ts +6 -0
  28. package/src/MiniGames/index.ts +1 -0
  29. package/src/Raffle/GetRaffleDrawRunsHistoryRequest.ts +6 -0
  30. package/src/Raffle/GetRaffleDrawRunsHistoryResponse.ts +6 -0
  31. package/src/Raffle/RaffleDraw.ts +39 -1
  32. package/src/Raffle/RafflePrize.ts +6 -1
  33. package/src/Raffle/RafflePrizeWinner.ts +7 -6
  34. package/src/Raffle/index.ts +3 -1
  35. package/src/SmarticoAPI.ts +22 -0
  36. package/src/WSAPI/WSAPI.ts +10 -1
@@ -101,8 +101,10 @@ export declare enum ClassId {
101
101
  JP_WIN_PUSH = 808,
102
102
  RAF_GET_RAFFLES_REQUEST = 902,
103
103
  RAF_GET_RAFFLES_RESPONSE = 903,
104
- RAF_GET_DRAW_REQUEST = 904,
105
- RAF_GET_DRAW_RESPONSE = 905,
104
+ RAF_GET_DRAW_RUN_REQUEST = 904,
105
+ RAF_GET_DRAW_RUN_RESPONSE = 905,
106
+ RAF_GET_DRAW_HISTORY_REQUEST = 906,
107
+ RAF_GET_DRAW_HISTORY_RESPONSE = 907,
106
108
  REGISTER_PUSH_NOTIFICATIONS_TOKEN_REQ = 1003,
107
109
  REGISTER_PUSH_NOTIFICATIONS_TOKEN_RESP = 2003,
108
110
  CLIENT_DEBUG_REQUEST = 77777,
@@ -1,5 +1,6 @@
1
1
  import { SAWAskForUsername } from './SAWAskForUsername';
2
2
  import { SAWGameLayout } from './SAWGameLayout';
3
+ import { SAWWheelLayout } from './SAWWheelLayout';
3
4
  export interface SAWTemplateUI {
4
5
  skin: string;
5
6
  name: string;
@@ -48,4 +49,5 @@ export interface SAWTemplateUI {
48
49
  };
49
50
  game_layout?: SAWGameLayout;
50
51
  steps_to_finish_game?: number;
52
+ wheel_layout?: SAWWheelLayout;
51
53
  }
@@ -0,0 +1,6 @@
1
+ export declare enum SAWWheelLayout {
2
+ Centered = 1,
3
+ LeftAligned = 2,
4
+ RightAligned = 3,
5
+ BottomAligned = 4
6
+ }
@@ -26,3 +26,4 @@ export * from './SAWWinningHistoryRequest';
26
26
  export * from './SAWWinningHistoryResponse';
27
27
  export * from './SAWGameLayout';
28
28
  export * from './PrizeModifiers';
29
+ export * from './SAWWheelLayout';
@@ -0,0 +1,5 @@
1
+ import { ProtocolMessage } from "src/Base/ProtocolMessage";
2
+ export interface GetRaffleDrawRunsHistoryRequest extends ProtocolMessage {
3
+ raffle_id: number;
4
+ draw_id: number;
5
+ }
@@ -0,0 +1,5 @@
1
+ import { ProtocolResponse } from 'src/Base/ProtocolResponse';
2
+ import { RaffleDrawRun } from './RaffleDraw';
3
+ export interface GetRaffleDrawRunsHistoryResponse extends ProtocolResponse {
4
+ draw_runs: RaffleDrawRun[];
5
+ }
@@ -92,4 +92,34 @@ interface RaffleDraw {
92
92
  my_tickets_count: number;
93
93
  my_last_tickets: RaffleTicket[];
94
94
  }
95
- export { RaffleDraw };
95
+ interface RaffleDrawRun {
96
+ /**
97
+ * 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
98
+ * (internal name: schedule_id)
99
+ */
100
+ draw_id: number;
101
+ /**
102
+ * Field indicates the ID of the latest instance/run of draw
103
+ */
104
+ run_id: number;
105
+ /** Meta information of the Draw for the presentaiton in UI */
106
+ public_meta: RaffleDrawPublicMeta;
107
+ /** Date/time of the draw execution */
108
+ execution_ts: number;
109
+ /**
110
+ * Date/time starting from which the tickets will participate in the upcoming draw
111
+ * This value need to be taken into account with next_execute_ts field value, for example
112
+ * Next draw is at 10:00, ticket_start_date is 9:00, so all tickets that are collected after 9:00 will participate in the draw at 10:00
113
+ * (internally this value is calculated as next_execute_ts - ticket_start_date)
114
+ */
115
+ ticket_start_date: number;
116
+ /**
117
+ * Shows if user has won a prize in a current run
118
+ */
119
+ is_winner: boolean;
120
+ /**
121
+ * Shows if user has unclaimed prize
122
+ */
123
+ has_unclaimed_prize: boolean;
124
+ }
125
+ export { RaffleDraw, RaffleDrawRun };
@@ -92,6 +92,10 @@ interface RafflePrize {
92
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
93
  */
94
94
  stock_items_per_draw?: number;
95
+ /**
96
+ * Shows if the prize has been claimed
97
+ */
98
+ is_claimed: boolean;
95
99
  winners: RafflePrizeWinner[];
96
100
  }
97
101
  export { RafflePrize };
@@ -1,9 +1,10 @@
1
- import { RaffleTicket } from "./RaffleTicket";
1
+ import { RaffleTicket } from './RaffleTicket';
2
2
  interface RafflePrizeWinner {
3
3
  user_id: number;
4
4
  public_username?: string;
5
5
  avatar_id: string;
6
6
  avatar_url?: string;
7
7
  ticket: RaffleTicket;
8
+ won_ids: number[];
8
9
  }
9
10
  export { RafflePrizeWinner };
@@ -7,3 +7,5 @@ export * from './RaffleDraw';
7
7
  export * from './RafflePrize';
8
8
  export * from './RafflePrizeWinner';
9
9
  export * from './RaffleTicket';
10
+ export * from './GetRaffleDrawRunsHistoryRequest';
11
+ export * from './GetRaffleDrawRunsHistoryResponse';
@@ -21,6 +21,7 @@ import { SAWDoAcknowledgeBatchResponse } from './MiniGames/SAWDoAcknowledgeBatch
21
21
  import { GetRelatedAchTourResponse } from './Missions/GetRelatedAchTourResponse';
22
22
  import { GetRafflesResponse } from './Raffle/GetRafflesResponse';
23
23
  import { InboxCategories } from './Inbox/InboxCategories';
24
+ import { GetDrawRunRequest, GetDrawRunResponse, GetRaffleDrawRunsHistoryRequest, GetRaffleDrawRunsHistoryResponse } from './Raffle';
24
25
  interface Tracker {
25
26
  label_api_key: string;
26
27
  userPublicProps: any;
@@ -131,5 +132,7 @@ declare class SmarticoAPI {
131
132
  getWSCalls(): WSAPI;
132
133
  getRelatedItemsForGame(user_ext_id: string, related_game_id: string): Promise<GetRelatedAchTourResponse>;
133
134
  getRaffles(user_ext_id: string): Promise<GetRafflesResponse>;
135
+ getDrawRun(user_ext_id: string, payload: GetDrawRunRequest): Promise<GetDrawRunResponse>;
136
+ getRaffleDrawRunsHistory(user_ext_id: string, payload: GetRaffleDrawRunsHistoryRequest): Promise<GetRaffleDrawRunsHistoryResponse>;
134
137
  }
135
138
  export { SmarticoAPI, MessageSender };
@@ -5,6 +5,7 @@ import { JackpotDetails, JackpotsOptinResponse, JackpotsOptoutResponse } from '.
5
5
  import { GetRelatedAchTourResponse } from '../Missions/GetRelatedAchTourResponse';
6
6
  import { GetRafflesResponse } from '../Raffle/GetRafflesResponse';
7
7
  import { InboxCategories } from '../Inbox/InboxCategories';
8
+ import { GetDrawRunRequest, GetDrawRunResponse, GetRaffleDrawRunsHistoryRequest, GetRaffleDrawRunsHistoryResponse } from 'src/Raffle';
8
9
  /** @group General API */
9
10
  export declare class WSAPI {
10
11
  private api;
@@ -545,4 +546,6 @@ export declare class WSAPI {
545
546
  */
546
547
  getRelatedItemsForGame(related_game_id: string): Promise<GetRelatedAchTourResponse>;
547
548
  getRaffles(): Promise<GetRafflesResponse>;
549
+ getDrawRun(payload: GetDrawRunRequest): Promise<GetDrawRunResponse>;
550
+ getRaffleDrawRunsHistory(payload: GetRaffleDrawRunsHistoryRequest): Promise<GetRaffleDrawRunsHistoryResponse>;
548
551
  }
package/dist/index.js CHANGED
@@ -125,8 +125,10 @@ exports.ClassId = void 0;
125
125
  ClassId[ClassId["JP_WIN_PUSH"] = 808] = "JP_WIN_PUSH";
126
126
  ClassId[ClassId["RAF_GET_RAFFLES_REQUEST"] = 902] = "RAF_GET_RAFFLES_REQUEST";
127
127
  ClassId[ClassId["RAF_GET_RAFFLES_RESPONSE"] = 903] = "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";
128
+ ClassId[ClassId["RAF_GET_DRAW_RUN_REQUEST"] = 904] = "RAF_GET_DRAW_RUN_REQUEST";
129
+ ClassId[ClassId["RAF_GET_DRAW_RUN_RESPONSE"] = 905] = "RAF_GET_DRAW_RUN_RESPONSE";
130
+ ClassId[ClassId["RAF_GET_DRAW_HISTORY_REQUEST"] = 906] = "RAF_GET_DRAW_HISTORY_REQUEST";
131
+ ClassId[ClassId["RAF_GET_DRAW_HISTORY_RESPONSE"] = 907] = "RAF_GET_DRAW_HISTORY_RESPONSE";
130
132
  /*
131
133
  RAF_GET_TICKETS_REQUEST = 902,
132
134
  RAF_GET_TICKETS_RESPONSE = 903,
@@ -531,6 +533,14 @@ exports.PrizeModifiers = void 0;
531
533
  })(exports.PrizeModifiers || (exports.PrizeModifiers = {}));
532
534
  var PrizeModifiersKeysNames = (_PrizeModifiersKeysNa = {}, _PrizeModifiersKeysNa[exports.PrizeModifiers['2x']] = '2x', _PrizeModifiersKeysNa[exports.PrizeModifiers['5x']] = '5x', _PrizeModifiersKeysNa[exports.PrizeModifiers['10x']] = '10x', _PrizeModifiersKeysNa[exports.PrizeModifiers['/2']] = '/2', _PrizeModifiersKeysNa[exports.PrizeModifiers['/5']] = '/5', _PrizeModifiersKeysNa[exports.PrizeModifiers['/10']] = '/10', _PrizeModifiersKeysNa[exports.PrizeModifiers['0x']] = '0', _PrizeModifiersKeysNa[exports.PrizeModifiers['reset']] = 'Reset to 0', _PrizeModifiersKeysNa);
533
535
 
536
+ exports.SAWWheelLayout = void 0;
537
+ (function (SAWWheelLayout) {
538
+ SAWWheelLayout[SAWWheelLayout["Centered"] = 1] = "Centered";
539
+ SAWWheelLayout[SAWWheelLayout["LeftAligned"] = 2] = "LeftAligned";
540
+ SAWWheelLayout[SAWWheelLayout["RightAligned"] = 3] = "RightAligned";
541
+ SAWWheelLayout[SAWWheelLayout["BottomAligned"] = 4] = "BottomAligned";
542
+ })(exports.SAWWheelLayout || (exports.SAWWheelLayout = {}));
543
+
534
544
  var NodeCache = /*#__PURE__*/function () {
535
545
  function NodeCache() {
536
546
  var _this = this;
@@ -2734,6 +2744,22 @@ var WSAPI = /*#__PURE__*/function () {
2734
2744
  return Promise.reject(e);
2735
2745
  }
2736
2746
  };
2747
+ _proto.getDrawRun = function getDrawRun(payload) {
2748
+ try {
2749
+ var _this47 = this;
2750
+ return Promise.resolve(_this47.api.getDrawRun(null, payload));
2751
+ } catch (e) {
2752
+ return Promise.reject(e);
2753
+ }
2754
+ };
2755
+ _proto.getRaffleDrawRunsHistory = function getRaffleDrawRunsHistory(payload) {
2756
+ try {
2757
+ var _this48 = this;
2758
+ return Promise.resolve(_this48.api.getRaffleDrawRunsHistory(null, payload));
2759
+ } catch (e) {
2760
+ return Promise.reject(e);
2761
+ }
2762
+ };
2737
2763
  return WSAPI;
2738
2764
  }();
2739
2765
 
@@ -3943,6 +3969,24 @@ var SmarticoAPI = /*#__PURE__*/function () {
3943
3969
  return Promise.reject(e);
3944
3970
  }
3945
3971
  };
3972
+ _proto.getDrawRun = function getDrawRun(user_ext_id, payload) {
3973
+ try {
3974
+ var _this64 = this;
3975
+ var message = _this64.buildMessage(user_ext_id, exports.ClassId.RAF_GET_DRAW_RUN_REQUEST, payload);
3976
+ return Promise.resolve(_this64.send(message, exports.ClassId.RAF_GET_DRAW_RUN_RESPONSE));
3977
+ } catch (e) {
3978
+ return Promise.reject(e);
3979
+ }
3980
+ };
3981
+ _proto.getRaffleDrawRunsHistory = function getRaffleDrawRunsHistory(user_ext_id, payload) {
3982
+ try {
3983
+ var _this65 = this;
3984
+ var message = _this65.buildMessage(user_ext_id, exports.ClassId.RAF_GET_DRAW_HISTORY_REQUEST, payload);
3985
+ return Promise.resolve(_this65.send(message, exports.ClassId.RAF_GET_DRAW_HISTORY_RESPONSE));
3986
+ } catch (e) {
3987
+ return Promise.reject(e);
3988
+ }
3989
+ };
3946
3990
  return SmarticoAPI;
3947
3991
  }();
3948
3992