@smartico/public-api 0.0.328 → 0.0.330

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.
@@ -126,3 +126,19 @@ ___
126
126
  • **my\_last\_tickets**: [`RaffleTicket`](RaffleTicket.md)[]
127
127
 
128
128
  List of last 5 tickets are collected by current user for this instance of draw.
129
+
130
+ ___
131
+
132
+ ### user\_opted\_in
133
+
134
+ • **user\_opted\_in**: `boolean`
135
+
136
+ If true, the user has opted-in to the raffle.
137
+
138
+ ___
139
+
140
+ ### requires\_optin
141
+
142
+ • **requires\_optin**: `boolean`
143
+
144
+ If true, the user needs to opt-in to the raffle before they can participate.
@@ -179,3 +179,19 @@ ___
179
179
  ### my\_last\_tickets
180
180
 
181
181
  • **my\_last\_tickets**: [`TRaffleTicket`](TRaffleTicket.md)[]
182
+
183
+ ___
184
+
185
+ ### user\_opted\_in
186
+
187
+ • **user\_opted\_in**: `boolean`
188
+
189
+ If true, the user has opted-in to the raffle.
190
+
191
+ ___
192
+
193
+ ### requires\_optin
194
+
195
+ • **requires\_optin**: `boolean`
196
+
197
+ If true, the user needs to opt-in to the raffle before they can participate.
@@ -38,7 +38,7 @@ ___
38
38
 
39
39
  ### type
40
40
 
41
- • **type**: ``"unknown"`` \| ``"bonus"`` \| ``"tangible"`` \| ``"minigamespin"`` \| ``"changelevel"`` \| ``"prizedrop"`` \| ``"raffleticket"``
41
+ • **type**: ``"bonus"`` \| ``"tangible"`` \| ``"minigamespin"`` \| ``"changelevel"`` \| ``"prizedrop"`` \| ``"raffleticket"`` \| ``"unknown"``
42
42
 
43
43
  Type of the store item. Can be 'bonus' or 'tangible' or different others.
44
44
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@smartico/public-api",
3
- "version": "0.0.328",
3
+ "version": "0.0.330",
4
4
  "description": "Smartico public API",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -164,8 +164,8 @@ export enum ClassId {
164
164
  RAF_GET_DRAW_HISTORY_RESPONSE = 907,
165
165
  RAF_CLAIM_PRIZE_REQUEST = 908,
166
166
  RAF_CLAIM_PRIZE_RESPONSE = 909,
167
- RAF_OPTIN_REQUEST = 910,
168
- RAF_OPTIN_RESPONSE = 911,
167
+ RAF_OPTIN_REQUEST = 916,
168
+ RAF_OPTIN_RESPONSE = 917,
169
169
  /*
170
170
  RAF_GET_TICKETS_REQUEST = 902,
171
171
  RAF_GET_TICKETS_RESPONSE = 903,
@@ -198,7 +198,7 @@ export class MissionUtils {
198
198
  suggestedGames = value.map((v: string) => {
199
199
  const cleaned = v.replace(/_/g, ' ').toLowerCase();
200
200
  return cleaned.charAt(0).toUpperCase() + cleaned.slice(1);
201
- }).join(' ,');
201
+ }).join(', ');
202
202
  }
203
203
  }
204
204
 
@@ -30,6 +30,8 @@ export const drawRunTransform = (res: GetDrawRunResponse): TRaffleDraw => {
30
30
  allow_multi_prize_per_ticket: res.draw.allow_multi_prize_per_ticket,
31
31
  total_tickets_count: res.draw.total_tickets_count,
32
32
  my_tickets_count: res.draw.my_tickets_count,
33
- my_last_tickets: ticketsTransform(res.draw.my_last_tickets)
33
+ my_last_tickets: ticketsTransform(res.draw.my_last_tickets),
34
+ user_opted_in: Boolean(res.draw.user_opted_in),
35
+ requires_optin: Boolean(res.draw.requires_optin),
34
36
  }
35
37
  };
@@ -82,6 +82,8 @@ export const drawTransform = (items: RaffleDraw[]): TRaffleDraw[] => {
82
82
  total_tickets_count: item.total_tickets_count,
83
83
  my_tickets_count: item.my_tickets_count,
84
84
  my_last_tickets: ticketsTransform(item.my_last_tickets),
85
+ user_opted_in: Boolean(item.user_opted_in),
86
+ requires_optin: Boolean(item.requires_optin),
85
87
  };
86
88
  });
87
89
  };
@@ -101,6 +101,14 @@ interface RaffleDraw {
101
101
  * List of last 5 tickets are collected by current user for this instance of draw.
102
102
  */
103
103
  my_last_tickets: RaffleTicket[];
104
+ /**
105
+ * If true, the user has opted-in to the raffle.
106
+ */
107
+ user_opted_in: boolean;
108
+ /**
109
+ * If true, the user needs to opt-in to the raffle before they can participate.
110
+ */
111
+ requires_optin: boolean;
104
112
  }
105
113
 
106
114
  export { RaffleDraw };
@@ -1241,6 +1241,14 @@ export interface TRaffleDraw {
1241
1241
  * List of last 5 tickets are collected by current user for this instance of draw.
1242
1242
  */
1243
1243
  my_last_tickets: TRaffleTicket[];
1244
+ /**
1245
+ * If true, the user has opted-in to the raffle.
1246
+ */
1247
+ user_opted_in: boolean;
1248
+ /**
1249
+ * If true, the user needs to opt-in to the raffle before they can participate.
1250
+ */
1251
+ requires_optin: boolean;
1244
1252
  }
1245
1253
 
1246
1254
  export interface TRaffleDrawRun {
package/src/index.ts CHANGED
@@ -15,6 +15,7 @@ export * from './Tournaments';
15
15
  export * from './Level';
16
16
  export * from './Quiz';
17
17
  export * from './Jackpots';
18
+ export * from './Raffle';
18
19
 
19
20
  export * from './OCache';
20
21
  export * from './Bonuses';