@smartico/public-api 0.0.236 → 0.0.238

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 +2 -0
  2. package/dist/CustomSections/UICustomSection.d.ts +2 -1
  3. package/dist/Raffle/GetRaffleDrawRunsHistoryRequest.d.ts +1 -1
  4. package/dist/Raffle/GetRaffleDrawRunsHistoryResponse.d.ts +1 -1
  5. package/dist/Raffle/RaffleClaimPrizeRequest.d.ts +4 -0
  6. package/dist/Raffle/RaffleClaimPrizeResponse.d.ts +3 -0
  7. package/dist/Raffle/RaffleDraw.d.ts +2 -47
  8. package/dist/Raffle/RaffleDrawPublicMeta.d.ts +14 -0
  9. package/dist/Raffle/RaffleDrawRun.d.ts +34 -0
  10. package/dist/Raffle/index.d.ts +3 -0
  11. package/dist/WSAPI/WSAPITypes.d.ts +2 -0
  12. package/dist/index.js +25 -20
  13. package/dist/index.js.map +1 -1
  14. package/dist/index.modern.mjs +25 -16
  15. package/dist/index.modern.mjs.map +1 -1
  16. package/docs/README.md +2 -0
  17. package/docs/interfaces/GetRaffleDrawRunsHistoryRequest.md +3 -1
  18. package/docs/interfaces/RaffleClaimPrizeRequest.md +43 -0
  19. package/docs/interfaces/RaffleClaimPrizeResponse.md +57 -0
  20. package/docs/interfaces/RaffleDraw.md +2 -2
  21. package/docs/interfaces/RaffleDrawRun.md +10 -2
  22. package/docs/interfaces/RafflePrize.md +2 -2
  23. package/docs/interfaces/RafflePrizeWinner.md +2 -2
  24. package/package.json +1 -1
  25. package/src/Base/ClassId.ts +2 -0
  26. package/src/CustomSections/UICustomSection.ts +16 -6
  27. package/src/Raffle/GetRaffleDrawRunsHistoryRequest.ts +2 -2
  28. package/src/Raffle/GetRaffleDrawRunsHistoryResponse.ts +1 -1
  29. package/src/Raffle/RaffleClaimPrizeRequest.ts +5 -0
  30. package/src/Raffle/RaffleClaimPrizeResponse.ts +3 -0
  31. package/src/Raffle/RaffleDraw.ts +2 -58
  32. package/src/Raffle/RaffleDrawPublicMeta.ts +14 -0
  33. package/src/Raffle/RaffleDrawRun.ts +44 -0
  34. package/src/Raffle/index.ts +3 -0
  35. package/src/SmarticoAPI.ts +1 -1
  36. package/src/WSAPI/WSAPITypes.ts +2 -0
@@ -105,6 +105,8 @@ export declare enum ClassId {
105
105
  RAF_GET_DRAW_RUN_RESPONSE = 905,
106
106
  RAF_GET_DRAW_HISTORY_REQUEST = 906,
107
107
  RAF_GET_DRAW_HISTORY_RESPONSE = 907,
108
+ RAF_CLAIM_PRIZE_REQUEST = 908,
109
+ RAF_CLAIM_PRIZE_RESPONSE = 909,
108
110
  REGISTER_PUSH_NOTIFICATIONS_TOKEN_REQ = 1003,
109
111
  REGISTER_PUSH_NOTIFICATIONS_TOKEN_RESP = 2003,
110
112
  CLIENT_DEBUG_REQUEST = 77777,
@@ -1,5 +1,6 @@
1
1
  import { TUICustomSection } from '../WSAPI/WSAPITypes';
2
2
  import { AchCustomLayoutTheme, AchCustomSectionType, AchMissionsTabsOptions, AchOverviewMissionsFilter } from './AchCustomSection';
3
+ import { GetCustomSectionsResponse } from './GetCustomSectionsResponse';
3
4
  export interface UICustomSection {
4
5
  body?: string;
5
6
  menu_img?: string;
@@ -12,4 +13,4 @@ export interface UICustomSection {
12
13
  overview_missions_filter?: AchOverviewMissionsFilter;
13
14
  overview_missions_count?: number;
14
15
  }
15
- export declare const UICustomSectionTransform: (items: UICustomSection[]) => TUICustomSection[];
16
+ export declare const UICustomSectionTransform: (response: GetCustomSectionsResponse) => TUICustomSection[];
@@ -4,5 +4,5 @@ export interface GetRaffleDrawRunsHistoryRequest extends ProtocolMessage {
4
4
  /**
5
5
  * If draw_id is not passed all draw runs that belong to raffle with passed raffle_id will be returned.
6
6
  */
7
- draw_id: number;
7
+ draw_id?: number;
8
8
  }
@@ -1,5 +1,5 @@
1
1
  import { ProtocolResponse } from '../Base/ProtocolResponse';
2
- import { RaffleDrawRun } from './RaffleDraw';
2
+ import { RaffleDrawRun } from './RaffleDrawRun';
3
3
  export interface GetRaffleDrawRunsHistoryResponse extends ProtocolResponse {
4
4
  draw_runs: RaffleDrawRun[];
5
5
  }
@@ -0,0 +1,4 @@
1
+ import { ProtocolMessage } from "../Base/ProtocolMessage";
2
+ export interface RaffleClaimPrizeRequest extends ProtocolMessage {
3
+ won_id: number;
4
+ }
@@ -0,0 +1,3 @@
1
+ import { ProtocolResponse } from "../Base/ProtocolResponse";
2
+ export interface RaffleClaimPrizeResponse extends ProtocolResponse {
3
+ }
@@ -1,19 +1,6 @@
1
+ import { RaffleDrawPublicMeta } from "./RaffleDrawPublicMeta";
1
2
  import { RafflePrize } from "./RafflePrize";
2
3
  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
- /** URL of the icon that represents the draw */
11
- icon_url: string;
12
- /** URL of the background image that will be used in the draw list item */
13
- background_image_url: string;
14
- /** Show if the draw is grand and is marked as special */
15
- is_grand: boolean;
16
- }
17
4
  declare enum RaffleDrawInstanceState {
18
5
  /** Draw is open for the tickets collection */
19
6
  Open = 1,
@@ -92,36 +79,4 @@ interface RaffleDraw {
92
79
  my_tickets_count: number;
93
80
  my_last_tickets: RaffleTicket[];
94
81
  }
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
- /** Actual Date/time of the draw execution */
110
- actual_execution_ts: number;
111
- /**
112
- * Date/time starting from which the tickets will participate in the upcoming draw
113
- * This value need to be taken into account with next_execute_ts field value, for example
114
- * 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
115
- * (internally this value is calculated as next_execute_ts - ticket_start_date)
116
- */
117
- ticket_start_ts: number;
118
- /**
119
- * Shows if user has won a prize in a current run
120
- */
121
- is_winner: boolean;
122
- /**
123
- * Shows if user has unclaimed prize
124
- */
125
- has_unclaimed_prize: boolean;
126
- }
127
- export { RaffleDraw, RaffleDrawRun };
82
+ export { RaffleDraw };
@@ -0,0 +1,14 @@
1
+ export interface RaffleDrawPublicMeta {
2
+ /** Name of the draw, e.g. 'Daily draw' */
3
+ name: string;
4
+ /** Description of the draw */
5
+ description: string;
6
+ /** URL of the image that represents the draw */
7
+ image_url: string;
8
+ /** URL of the icon that represents the draw */
9
+ icon_url: string;
10
+ /** URL of the background image that will be used in the draw list item */
11
+ background_image_url: string;
12
+ /** Show if the draw is grand and is marked as special */
13
+ is_grand: boolean;
14
+ }
@@ -0,0 +1,34 @@
1
+ import { RaffleDrawPublicMeta } from "./RaffleDrawPublicMeta";
2
+ interface RaffleDrawRun {
3
+ /**
4
+ * 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
5
+ * (internal name: schedule_id)
6
+ */
7
+ draw_id: number;
8
+ /**
9
+ * Field indicates the ID of the latest instance/run of draw
10
+ */
11
+ run_id: number;
12
+ /** Meta information of the Draw for the presentaiton in UI */
13
+ public_meta: RaffleDrawPublicMeta;
14
+ /** Date/time of the draw execution */
15
+ execution_ts: number;
16
+ /** Actual Date/time of the draw execution */
17
+ actual_execution_ts: number;
18
+ /**
19
+ * Date/time starting from which the tickets will participate in the upcoming draw
20
+ * This value need to be taken into account with next_execute_ts field value, for example
21
+ * 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
22
+ * (internally this value is calculated as next_execute_ts - ticket_start_date)
23
+ */
24
+ ticket_start_ts: number;
25
+ /**
26
+ * Shows if user has won a prize in a current run
27
+ */
28
+ is_winner: boolean;
29
+ /**
30
+ * Shows if user has unclaimed prize
31
+ */
32
+ has_unclaimed_prize: boolean;
33
+ }
34
+ export { RaffleDrawRun };
@@ -4,8 +4,11 @@ export * from './GetRafflesRequest';
4
4
  export * from './GetRafflesResponse';
5
5
  export * from './Raffle';
6
6
  export * from './RaffleDraw';
7
+ export * from './RaffleDrawRun';
7
8
  export * from './RafflePrize';
8
9
  export * from './RafflePrizeWinner';
9
10
  export * from './RaffleTicket';
10
11
  export * from './GetRaffleDrawRunsHistoryRequest';
11
12
  export * from './GetRaffleDrawRunsHistoryResponse';
13
+ export * from './RaffleClaimPrizeRequest';
14
+ export * from './RaffleClaimPrizeResponse';
@@ -700,6 +700,8 @@ export interface TSegmentCheckResult {
700
700
  is_matching: boolean;
701
701
  }
702
702
  export interface TUICustomSection {
703
+ /** The ID of the custom section */
704
+ id: number;
703
705
  /** The body of the custom section */
704
706
  body?: string;
705
707
  /** The image of the custom section */
package/dist/index.js CHANGED
@@ -129,6 +129,8 @@ exports.ClassId = void 0;
129
129
  ClassId[ClassId["RAF_GET_DRAW_RUN_RESPONSE"] = 905] = "RAF_GET_DRAW_RUN_RESPONSE";
130
130
  ClassId[ClassId["RAF_GET_DRAW_HISTORY_REQUEST"] = 906] = "RAF_GET_DRAW_HISTORY_REQUEST";
131
131
  ClassId[ClassId["RAF_GET_DRAW_HISTORY_RESPONSE"] = 907] = "RAF_GET_DRAW_HISTORY_RESPONSE";
132
+ ClassId[ClassId["RAF_CLAIM_PRIZE_REQUEST"] = 908] = "RAF_CLAIM_PRIZE_REQUEST";
133
+ ClassId[ClassId["RAF_CLAIM_PRIZE_RESPONSE"] = 909] = "RAF_CLAIM_PRIZE_RESPONSE";
132
134
  /*
133
135
  RAF_GET_TICKETS_REQUEST = 902,
134
136
  RAF_GET_TICKETS_RESPONSE = 903,
@@ -2846,24 +2848,29 @@ var AchOverviewMissionsFilter;
2846
2848
  AchOverviewMissionsFilter[AchOverviewMissionsFilter["ALL_EXCEPT_COMPLETED_AND_LOCKED"] = 5] = "ALL_EXCEPT_COMPLETED_AND_LOCKED";
2847
2849
  })(AchOverviewMissionsFilter || (AchOverviewMissionsFilter = {}));
2848
2850
 
2849
- var UICustomSectionTransform = function UICustomSectionTransform(items) {
2850
- return items.filter(function (r) {
2851
- return r.section_type_id !== undefined && r.section_type_id >= 1;
2852
- }).map(function (r) {
2853
- var x = {
2854
- body: r.body,
2855
- menu_img: r.menu_img,
2856
- menu_name: r.menu_name,
2857
- section_type_id: r.section_type_id,
2858
- custom_skin_images: r.custom_skin_images,
2859
- generic_custom_css: r.generic_custom_css,
2860
- mission_tabs_options: r.mission_tabs_options,
2861
- overview_missions_count: r.overview_missions_count,
2862
- overview_missions_filter: r.overview_missions_filter,
2863
- theme: r.theme
2864
- };
2865
- return x;
2851
+ var UICustomSectionTransform = function UICustomSectionTransform(response) {
2852
+ var items = [];
2853
+ Object.keys(response.customSections).forEach(function (key) {
2854
+ var r = response.customSections[key];
2855
+ var id = parseInt(key);
2856
+ if (r.section_type_id !== undefined && r.section_type_id >= 1) {
2857
+ var x = {
2858
+ id: id,
2859
+ body: r.body,
2860
+ menu_img: r.menu_img,
2861
+ menu_name: r.menu_name,
2862
+ section_type_id: r.section_type_id,
2863
+ custom_skin_images: r.custom_skin_images,
2864
+ generic_custom_css: r.generic_custom_css,
2865
+ mission_tabs_options: r.mission_tabs_options,
2866
+ overview_missions_count: r.overview_missions_count,
2867
+ overview_missions_filter: r.overview_missions_filter,
2868
+ theme: r.theme
2869
+ };
2870
+ items.push(x);
2871
+ }
2866
2872
  });
2873
+ return items;
2867
2874
  };
2868
2875
 
2869
2876
  var BonusItemsTransform = function BonusItemsTransform(items) {
@@ -3811,9 +3818,7 @@ var SmarticoAPI = /*#__PURE__*/function () {
3811
3818
  _proto.getCustomSectionsT = function getCustomSectionsT(user_ext_id) {
3812
3819
  try {
3813
3820
  var _this51 = this;
3814
- return Promise.resolve(_this51.getCustomSections(user_ext_id)).then(function (_this51$getCustomSect) {
3815
- return UICustomSectionTransform(Object.values(_this51$getCustomSect.customSections));
3816
- });
3821
+ return Promise.resolve(_this51.getCustomSections(user_ext_id)).then(UICustomSectionTransform);
3817
3822
  } catch (e) {
3818
3823
  return Promise.reject(e);
3819
3824
  }