@smartico/public-api 0.0.283 → 0.0.284
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.
- package/dist/Jackpots/JackpotPublicMeta.d.ts +1 -1
- package/dist/MiniGames/SAWPrizeUI.d.ts +1 -0
- package/dist/Quiz/MarketsAnswersType.d.ts +22 -0
- package/dist/Raffle/GetDrawResponse.d.ts +5 -0
- package/dist/Raffle/Raffle.d.ts +1 -1
- package/dist/Raffle/RaffleDraw.d.ts +16 -11
- package/dist/Raffle/RafflePrize.d.ts +15 -14
- package/dist/Raffle/RaffleTicket.d.ts +6 -0
- package/dist/SmarticoPublicAPI.d.ts +23 -0
- package/dist/Store/BuyShopItemErrorCode.d.ts +10 -0
- package/dist/Store/BuyShopItemRequest.d.ts +4 -0
- package/dist/Store/BuyShopItemResponse.d.ts +4 -0
- package/dist/Store/GetCategoriesShopResponse.d.ts +5 -0
- package/dist/Store/GetShopItemsResponse.d.ts +5 -0
- package/dist/Store/ShopCategory.d.ts +5 -0
- package/dist/Store/ShopCategoryPublicMeta.d.ts +4 -0
- package/dist/Store/ShopItem.d.ts +9 -0
- package/dist/Store/ShopItemPublicMeta.d.ts +10 -0
- package/dist/Store/ShopItemType.d.ts +4 -0
- package/dist/Store/StorItemPruchased.d.ts +6 -0
- package/dist/WSAPI/WSAPITypes.d.ts +11 -0
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/dist/index.modern.mjs +2 -0
- package/dist/index.modern.mjs.map +1 -1
- package/dist/service/index.d.ts +5 -0
- package/dist/service/types/ErrorCodes.d.ts +13 -0
- package/dist/service/types/GRequest.d.ts +16 -0
- package/dist/service/types/GResponse.d.ts +10 -0
- package/dist/service/types/Game/GameAttemptType.d.ts +6 -0
- package/dist/service/types/Game/GameCanPlayType.d.ts +10 -0
- package/dist/service/types/Game/GameExternalStatus.d.ts +6 -0
- package/dist/service/types/Game/GameInfo.d.ts +9 -0
- package/dist/service/types/Game/GamePick.d.ts +90 -0
- package/dist/service/types/Game/GameUtil.d.ts +7 -0
- package/dist/service/types/SmarticoProto/GetTranslationsRequest.d.ts +7 -0
- package/dist/service/types/SmarticoProto/GetTranslationsResponse.d.ts +7 -0
- package/dist/service/types/SmarticoProto/ProtocolMessage.d.ts +5 -0
- package/dist/service/types/SmarticoProto/ProtocolRequest.d.ts +6 -0
- package/dist/service/types/SmarticoProto/ProtocolResponse.d.ts +5 -0
- package/dist/service/types/SmarticoProto/PublicLabelInfo.d.ts +34 -0
- package/dist/service/types/SmarticoProto/PublicProperties.d.ts +11 -0
- package/dist/service/types/SmarticoProto/ResponseIdentify.d.ts +12 -0
- package/dist/service/types/SmarticoProto/SAW/SAWAcknowledgeType.d.ts +5 -0
- package/dist/service/types/SmarticoProto/SAW/SAWBuyInType.d.ts +5 -0
- package/dist/service/types/SmarticoProto/SAW/SAWDoSpinRequest.d.ts +5 -0
- package/dist/service/types/SmarticoProto/SAW/SAWDoSpinResponse.d.ts +15 -0
- package/dist/service/types/SmarticoProto/SAW/SAWGameType.d.ts +10 -0
- package/dist/service/types/SmarticoProto/SAW/SAWGetTemplatesRequest.d.ts +3 -0
- package/dist/service/types/SmarticoProto/SAW/SAWGetTemplatesResponse.d.ts +5 -0
- package/dist/service/types/SmarticoProto/SAW/SAWPrize.d.ts +11 -0
- package/dist/service/types/SmarticoProto/SAW/SAWPrizeType.d.ts +8 -0
- package/dist/service/types/SmarticoProto/SAW/SAWPrizeUI.d.ts +13 -0
- package/dist/service/types/SmarticoProto/SAW/SAWTemplate.d.ts +21 -0
- package/dist/service/types/SmarticoProto/SAW/SAWTemplateUI.d.ts +31 -0
- package/dist/service/types/SmarticoProto/SAW/SAWWinSoundType.d.ts +12 -0
- package/dist/service/types/SmarticoProto/TranslationArea.d.ts +9 -0
- package/dist/service/types/User/UserInfo.d.ts +10 -0
- package/dist/util/Util.d.ts +51 -0
- package/docs/interfaces/JackpotPublicMeta.md +1 -1
- package/docs/interfaces/RaffleDraw.md +13 -10
- package/docs/interfaces/RafflePrize.md +18 -16
- package/docs/interfaces/RafflePublicMeta.md +1 -1
- package/docs/interfaces/RaffleTicket.md +4 -0
- package/docs/interfaces/SAWPrizeUI.md +6 -0
- package/docs/interfaces/TMiniGameTemplate.md +18 -0
- package/docs/interfaces/TRaffleTicket.md +4 -0
- package/package.json +1 -1
- package/src/Jackpots/JackpotPublicMeta.ts +1 -1
- package/src/MiniGames/SAWGetTemplatesResponse.ts +2 -0
- package/src/MiniGames/SAWPrizeUI.ts +1 -0
- package/src/Raffle/Raffle.ts +1 -1
- package/src/Raffle/RaffleClaimPrizeResponse.ts +1 -4
- package/src/Raffle/RaffleDraw.ts +17 -15
- package/src/Raffle/RafflePrize.ts +18 -17
- package/src/Raffle/RaffleTicket.ts +6 -2
- package/src/WSAPI/WSAPITypes.ts +11 -3
|
@@ -226,3 +226,21 @@ ___
|
|
|
226
226
|
### show\_prize\_history
|
|
227
227
|
|
|
228
228
|
• `Optional` **show\_prize\_history**: `boolean`
|
|
229
|
+
|
|
230
|
+
When enabled the prize history icon is visible on a certain template
|
|
231
|
+
|
|
232
|
+
___
|
|
233
|
+
|
|
234
|
+
### max\_number\_of\_attempts
|
|
235
|
+
|
|
236
|
+
• `Optional` **max\_number\_of\_attempts**: `number`
|
|
237
|
+
|
|
238
|
+
The maximum number of attempts that user can do during period of time
|
|
239
|
+
|
|
240
|
+
___
|
|
241
|
+
|
|
242
|
+
### max\_spins\_period\_ms
|
|
243
|
+
|
|
244
|
+
• `Optional` **max\_spins\_period\_ms**: `number`
|
|
245
|
+
|
|
246
|
+
The period of time in milliseconds during which the user can do the maximum number of attempts
|
package/package.json
CHANGED
|
@@ -17,7 +17,7 @@ interface JackpotPublicMeta {
|
|
|
17
17
|
/**
|
|
18
18
|
* Custom data as string or JSON string that can be used in API to build custom UI
|
|
19
19
|
* You can request from Smartico to define fields for your specific case that will be managed from Smartico BackOffice
|
|
20
|
-
* Read more here - https://help.smartico.ai/welcome/products/general-concepts/custom-fields-attributes
|
|
20
|
+
* Read more here - <https://help.smartico.ai/welcome/products/general-concepts/custom-fields-attributes>
|
|
21
21
|
*/
|
|
22
22
|
custom_data: string;
|
|
23
23
|
}
|
|
@@ -45,6 +45,8 @@ export const SAWTemplatesTransform = (items: SAWTemplate[]): TMiniGameTemplate[]
|
|
|
45
45
|
custom_section_id: r.saw_template_ui_definition.custom_section_id,
|
|
46
46
|
saw_template_ui_definition: r.saw_template_ui_definition,
|
|
47
47
|
show_prize_history: r.show_prize_history,
|
|
48
|
+
max_number_of_attempts: r.maxSpinsCount,
|
|
49
|
+
max_spins_period_ms: r.maxSpinsPediodMs,
|
|
48
50
|
|
|
49
51
|
prizes: r.prizes.map((p) => {
|
|
50
52
|
const y: TMiniGamePrize = {
|
|
@@ -8,6 +8,7 @@ export interface SAWPrizeUI {
|
|
|
8
8
|
name_original?: string; // keeps original name, how it came from the servers. This is needed for the Jackpot value replacemenet
|
|
9
9
|
hide_prize_popup: boolean; // if true, prize popup on Prize Drop will not be shown
|
|
10
10
|
aknowledge_message?: string;
|
|
11
|
+
aknowledge_message_lose?: string; // voyager specific
|
|
11
12
|
sectors?: number[];
|
|
12
13
|
acknowledge_type?: SAWAcknowledgeType;
|
|
13
14
|
acknowledge_dp?: string;
|
package/src/Raffle/Raffle.ts
CHANGED
|
@@ -17,7 +17,7 @@ interface RafflePublicMeta {
|
|
|
17
17
|
/**
|
|
18
18
|
* Custom data as string or JSON string that can be used in API to build custom UI
|
|
19
19
|
* You can request from Smartico to define fields for your specific case that will be managed from Smartico BackOffice
|
|
20
|
-
* Read more here - https://help.smartico.ai/welcome/products/general-concepts/custom-fields-attributes
|
|
20
|
+
* Read more here - <https://help.smartico.ai/welcome/products/general-concepts/custom-fields-attributes>
|
|
21
21
|
*/
|
|
22
22
|
custom_data: string;
|
|
23
23
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { TransformedRaffleClaimPrizeResponse } from "../WSAPI/WSAPITypes";
|
|
2
2
|
import { ProtocolResponse } from "../Base/ProtocolResponse";
|
|
3
3
|
|
|
4
|
-
export interface RaffleClaimPrizeResponse extends ProtocolResponse {
|
|
4
|
+
export interface RaffleClaimPrizeResponse extends ProtocolResponse {
|
|
5
5
|
errCode: number
|
|
6
6
|
errMsg?: string
|
|
7
7
|
}
|
|
@@ -13,6 +13,3 @@ export const raffleClaimPrizeResponseTransform = (info: RaffleClaimPrizeResponse
|
|
|
13
13
|
errorMessage: info.errMsg
|
|
14
14
|
}
|
|
15
15
|
}
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
package/src/Raffle/RaffleDraw.ts
CHANGED
|
@@ -50,6 +50,7 @@ interface RaffleDraw {
|
|
|
50
50
|
|
|
51
51
|
/**
|
|
52
52
|
* Type of the draw execution, indicating how and when the draw is executed.
|
|
53
|
+
*
|
|
53
54
|
* - ExecDate: Draw is executed only once at a specific date and time.
|
|
54
55
|
* - Recurring: Draw is executed on a recurring basis (e.g., daily, weekly).
|
|
55
56
|
* - Grand: Draw is executed once and is marked as grand, often with larger prizes or more importance.
|
|
@@ -65,21 +66,22 @@ interface RaffleDraw {
|
|
|
65
66
|
/** Unique ID of the previusly executed draw (if there is such) */
|
|
66
67
|
previous_run_id?: number;
|
|
67
68
|
|
|
68
|
-
/**
|
|
69
|
-
*
|
|
70
|
-
*
|
|
71
|
-
*
|
|
72
|
-
*
|
|
69
|
+
/**
|
|
70
|
+
* Date/time starting from which the tickets will participate in the upcoming draw
|
|
71
|
+
* This value need to be taken into account with next_execute_ts field value, for example
|
|
72
|
+
* 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
|
|
73
|
+
* (internally this value is calculated as next_execute_ts - ticket_start_date)
|
|
73
74
|
*/
|
|
74
75
|
ticket_start_ts: number;
|
|
75
76
|
|
|
76
|
-
/**
|
|
77
|
-
*
|
|
78
|
-
*
|
|
79
|
-
*
|
|
80
|
-
*
|
|
81
|
-
*
|
|
82
|
-
*
|
|
77
|
+
/**
|
|
78
|
+
* Field is indicating if same ticket can win multiple prizes in the same draw
|
|
79
|
+
* For example there are 3 types of prizes in the draw - iPhone, iPad, MacBook
|
|
80
|
+
* If this field is true, then one ticket can win all 3 prizes (depending on the chances of course),
|
|
81
|
+
* if false, then one ticket can win only one prize.
|
|
82
|
+
* The distribution of the prizes is start from top (assuming on top are the most valuable prizes) to bottom (less valuable prizes)
|
|
83
|
+
* If specific prize has multiple values, e.g. we have 3 iPhones,
|
|
84
|
+
* 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)
|
|
83
85
|
*/
|
|
84
86
|
allow_multi_prize_per_ticket: boolean;
|
|
85
87
|
|
|
@@ -95,9 +97,9 @@ interface RaffleDraw {
|
|
|
95
97
|
*/
|
|
96
98
|
my_tickets_count: number;
|
|
97
99
|
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
100
|
+
/**
|
|
101
|
+
* List of last 5 tickets are collected by current user for this instance of draw.
|
|
102
|
+
*/
|
|
101
103
|
my_last_tickets: RaffleTicket[];
|
|
102
104
|
}
|
|
103
105
|
|
|
@@ -34,28 +34,29 @@ interface RafflePrize {
|
|
|
34
34
|
/**
|
|
35
35
|
* The actual number of prizes for the current instance.
|
|
36
36
|
* This value is taking into account follwing values:
|
|
37
|
-
*
|
|
38
|
-
*
|
|
39
|
-
*
|
|
40
|
-
*
|
|
41
|
-
*
|
|
37
|
+
*
|
|
38
|
+
* - min_required_total_tickets,
|
|
39
|
+
* - add_one_prize_per_each_x_tickets
|
|
40
|
+
* - stock_items_per_draw
|
|
41
|
+
* - total_tickets_count (from Draw instance)
|
|
42
|
+
* - cap_prizes_per_run
|
|
42
43
|
* For example:
|
|
43
|
-
*
|
|
44
|
-
*
|
|
45
|
-
*
|
|
46
|
-
*
|
|
47
|
-
*
|
|
48
|
-
*
|
|
49
|
-
*
|
|
50
|
-
*
|
|
44
|
+
*
|
|
45
|
+
* - prizes_per_run = 1
|
|
46
|
+
* - min_required_total_tickets = 1000
|
|
47
|
+
* - add_one_prize_per_each_x_tickets = 1000
|
|
48
|
+
* - stock_items_per_draw = 5
|
|
49
|
+
* - total_tickets_count = 7000
|
|
50
|
+
* - cap_prizes_per_run = 6
|
|
51
|
+
* prizes_per_run_actual will be 5, because
|
|
52
|
+
* 7000 tickets are collected, so 7 iPhones are available, but the cap is 6 and the stock is 5.
|
|
51
53
|
*/
|
|
52
54
|
prizes_per_run_actual: number;
|
|
53
55
|
|
|
54
56
|
|
|
55
57
|
/**
|
|
56
|
-
*
|
|
57
|
-
*
|
|
58
|
-
* Calculated as the ratio of the number of tickets collected by the current player to the
|
|
58
|
+
* The chances to win the prize by current player.
|
|
59
|
+
* Calculated as the ratio of the number of tickets collected by the current player to the
|
|
59
60
|
* total number of tickets collected by all players and multiplied by number of actual prizes of this kind.
|
|
60
61
|
*/
|
|
61
62
|
chances_to_win_perc: number;
|
|
@@ -91,7 +92,7 @@ interface RafflePrize {
|
|
|
91
92
|
|
|
92
93
|
/**
|
|
93
94
|
* The maximum number of prizes that can be given within one instance/run of draw.
|
|
94
|
-
* For example the prize is iPhone and add_one_prize_per_each_x_tickets is set to 1000,
|
|
95
|
+
* For example the prize is iPhone and add_one_prize_per_each_x_tickets is set to 1000,
|
|
95
96
|
* cap_prizes_per_run is set to 3, and the total number of tickets collected is 7000.
|
|
96
97
|
* In this case, the prizes_per_run_actual will be limited by 3
|
|
97
98
|
*/
|
package/src/WSAPI/WSAPITypes.ts
CHANGED
|
@@ -181,8 +181,12 @@ export interface TMiniGameTemplate {
|
|
|
181
181
|
|
|
182
182
|
/** The UI definition of the mini-game */
|
|
183
183
|
saw_template_ui_definition: SAWTemplateUI;
|
|
184
|
-
|
|
184
|
+
/** When enabled the prize history icon is visible on a certain template */
|
|
185
185
|
show_prize_history?:boolean;
|
|
186
|
+
/** The maximum number of attempts that user can do during period of time */
|
|
187
|
+
max_number_of_attempts?: number;
|
|
188
|
+
/** The period of time in milliseconds during which the user can do the maximum number of attempts */
|
|
189
|
+
max_spins_period_ms?: number;
|
|
186
190
|
}
|
|
187
191
|
|
|
188
192
|
/**
|
|
@@ -963,9 +967,13 @@ export interface TRaffle {
|
|
|
963
967
|
}
|
|
964
968
|
|
|
965
969
|
export interface TRaffleTicket {
|
|
966
|
-
|
|
970
|
+
/**
|
|
971
|
+
* Int presentation of the ticket
|
|
972
|
+
*/
|
|
967
973
|
ticekt_id: number;
|
|
968
|
-
|
|
974
|
+
/**
|
|
975
|
+
* String presentation of the ticket
|
|
976
|
+
*/
|
|
969
977
|
ticket_id_string: string;
|
|
970
978
|
}
|
|
971
979
|
|