@smartico/public-api 0.0.282 → 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/README.md +1 -0
- package/docs/classes/WSAPI.md +21 -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/TLevel.md +6 -0
- package/docs/interfaces/TLevelCurrent.md +139 -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
|
@@ -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
|
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export declare enum MarketsValueType {
|
|
2
|
+
HomeTeam = "1",
|
|
3
|
+
AwayTeam = "2",
|
|
4
|
+
Draw = "x",
|
|
5
|
+
HomeTeamHomeTeam = "1/1",
|
|
6
|
+
HomeTeamDraw = "1/x",
|
|
7
|
+
HomeTeamAwayTeam = "1/2",
|
|
8
|
+
DrawHomeTeam = "x/1",
|
|
9
|
+
DrawDraw = "x/x",
|
|
10
|
+
DrawAwayTeam = "x/2",
|
|
11
|
+
AwayTeamHomeTeam = "2/1",
|
|
12
|
+
AwayTeamDraw = "2/x",
|
|
13
|
+
AwayTeamAwayTeam = "2/2",
|
|
14
|
+
Yes = "yes",
|
|
15
|
+
No = "no",
|
|
16
|
+
Odd = "odd",
|
|
17
|
+
Even = "even",
|
|
18
|
+
HomeOdd = "1/odd",
|
|
19
|
+
HomeEven = "1/even",
|
|
20
|
+
AwayOdd = "2/odd",
|
|
21
|
+
AwayEven = "2/even"
|
|
22
|
+
}
|
package/dist/Raffle/Raffle.d.ts
CHANGED
|
@@ -15,7 +15,7 @@ interface RafflePublicMeta {
|
|
|
15
15
|
/**
|
|
16
16
|
* Custom data as string or JSON string that can be used in API to build custom UI
|
|
17
17
|
* You can request from Smartico to define fields for your specific case that will be managed from Smartico BackOffice
|
|
18
|
-
* Read more here - https://help.smartico.ai/welcome/products/general-concepts/custom-fields-attributes
|
|
18
|
+
* Read more here - <https://help.smartico.ai/welcome/products/general-concepts/custom-fields-attributes>
|
|
19
19
|
*/
|
|
20
20
|
custom_data: string;
|
|
21
21
|
}
|
|
@@ -41,6 +41,7 @@ interface RaffleDraw {
|
|
|
41
41
|
run_id: number;
|
|
42
42
|
/**
|
|
43
43
|
* Type of the draw execution, indicating how and when the draw is executed.
|
|
44
|
+
*
|
|
44
45
|
* - ExecDate: Draw is executed only once at a specific date and time.
|
|
45
46
|
* - Recurring: Draw is executed on a recurring basis (e.g., daily, weekly).
|
|
46
47
|
* - Grand: Draw is executed once and is marked as grand, often with larger prizes or more importance.
|
|
@@ -53,19 +54,20 @@ interface RaffleDraw {
|
|
|
53
54
|
/** Unique ID of the previusly executed draw (if there is such) */
|
|
54
55
|
previous_run_id?: number;
|
|
55
56
|
/**
|
|
56
|
-
*
|
|
57
|
-
*
|
|
58
|
-
*
|
|
59
|
-
*
|
|
57
|
+
* Date/time starting from which the tickets will participate in the upcoming draw
|
|
58
|
+
* This value need to be taken into account with next_execute_ts field value, for example
|
|
59
|
+
* 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
|
|
60
|
+
* (internally this value is calculated as next_execute_ts - ticket_start_date)
|
|
60
61
|
*/
|
|
61
62
|
ticket_start_ts: number;
|
|
62
|
-
/**
|
|
63
|
-
*
|
|
64
|
-
*
|
|
65
|
-
*
|
|
66
|
-
*
|
|
67
|
-
*
|
|
68
|
-
*
|
|
63
|
+
/**
|
|
64
|
+
* Field is indicating if same ticket can win multiple prizes in the same draw
|
|
65
|
+
* For example there are 3 types of prizes in the draw - iPhone, iPad, MacBook
|
|
66
|
+
* If this field is true, then one ticket can win all 3 prizes (depending on the chances of course),
|
|
67
|
+
* if false, then one ticket can win only one prize.
|
|
68
|
+
* The distribution of the prizes is start from top (assuming on top are the most valuable prizes) to bottom (less valuable prizes)
|
|
69
|
+
* If specific prize has multiple values, e.g. we have 3 iPhones,
|
|
70
|
+
* 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)
|
|
69
71
|
*/
|
|
70
72
|
allow_multi_prize_per_ticket: boolean;
|
|
71
73
|
/**
|
|
@@ -77,6 +79,9 @@ interface RaffleDraw {
|
|
|
77
79
|
* The number of tickets collected by current user for this instance of draw.
|
|
78
80
|
*/
|
|
79
81
|
my_tickets_count: number;
|
|
82
|
+
/**
|
|
83
|
+
* List of last 5 tickets are collected by current user for this instance of draw.
|
|
84
|
+
*/
|
|
80
85
|
my_last_tickets: RaffleTicket[];
|
|
81
86
|
}
|
|
82
87
|
export { RaffleDraw };
|
|
@@ -27,24 +27,25 @@ interface RafflePrize {
|
|
|
27
27
|
/**
|
|
28
28
|
* The actual number of prizes for the current instance.
|
|
29
29
|
* This value is taking into account follwing values:
|
|
30
|
-
*
|
|
31
|
-
*
|
|
32
|
-
*
|
|
33
|
-
*
|
|
34
|
-
*
|
|
30
|
+
*
|
|
31
|
+
* - min_required_total_tickets,
|
|
32
|
+
* - add_one_prize_per_each_x_tickets
|
|
33
|
+
* - stock_items_per_draw
|
|
34
|
+
* - total_tickets_count (from Draw instance)
|
|
35
|
+
* - cap_prizes_per_run
|
|
35
36
|
* For example:
|
|
36
|
-
*
|
|
37
|
-
*
|
|
38
|
-
*
|
|
39
|
-
*
|
|
40
|
-
*
|
|
41
|
-
*
|
|
42
|
-
*
|
|
43
|
-
*
|
|
37
|
+
*
|
|
38
|
+
* - prizes_per_run = 1
|
|
39
|
+
* - min_required_total_tickets = 1000
|
|
40
|
+
* - add_one_prize_per_each_x_tickets = 1000
|
|
41
|
+
* - stock_items_per_draw = 5
|
|
42
|
+
* - total_tickets_count = 7000
|
|
43
|
+
* - cap_prizes_per_run = 6
|
|
44
|
+
* prizes_per_run_actual will be 5, because
|
|
45
|
+
* 7000 tickets are collected, so 7 iPhones are available, but the cap is 6 and the stock is 5.
|
|
44
46
|
*/
|
|
45
47
|
prizes_per_run_actual: number;
|
|
46
48
|
/**
|
|
47
|
-
*
|
|
48
49
|
* The chances to win the prize by current player.
|
|
49
50
|
* Calculated as the ratio of the number of tickets collected by the current player to the
|
|
50
51
|
* total number of tickets collected by all players and multiplied by number of actual prizes of this kind.
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { ClassId } from "./Base/ClassId";
|
|
2
|
+
import { SAWGetTemplatesResponse } from './MiniGames/SAWGetTemplatesResponse';
|
|
3
|
+
import { SAWTemplate } from './MiniGames/SAWTemplate';
|
|
4
|
+
import { ILogger } from './ILogger';
|
|
5
|
+
interface IOptions {
|
|
6
|
+
logger?: ILogger;
|
|
7
|
+
logCIDs?: ClassId[];
|
|
8
|
+
logHTTPTiming?: boolean;
|
|
9
|
+
}
|
|
10
|
+
declare class SmarticoPublicApi {
|
|
11
|
+
private label_api_key;
|
|
12
|
+
private brand_api_key;
|
|
13
|
+
private publicUrl;
|
|
14
|
+
private logger;
|
|
15
|
+
private logCIDs;
|
|
16
|
+
private logHTTPTiming;
|
|
17
|
+
constructor(label_api_key: string, brand_api_key: string, options?: IOptions);
|
|
18
|
+
private send;
|
|
19
|
+
private buildMessage;
|
|
20
|
+
miniGamesGetTemplates(user_ext_id: string): Promise<SAWGetTemplatesResponse>;
|
|
21
|
+
miniGamesFormatTemplatesForWidget(templates: SAWTemplate[], pointsBalance: number): any[];
|
|
22
|
+
}
|
|
23
|
+
export { SmarticoPublicApi };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export declare enum BuyShopItemErrorCode {
|
|
2
|
+
FAILED_TO_BUY_SHOP_ITEM = 121,
|
|
3
|
+
SHOP_NO_BALANCE = 11000,
|
|
4
|
+
SHOP_WRONG_LABEL = 11001,
|
|
5
|
+
SHOP_FAILED_TO_BUY_BONUS = 11002,
|
|
6
|
+
SHOP_FAILED_TO_BUY_SHOP_ITEM_CONDITION = 11003,
|
|
7
|
+
SHOP_FAILED_TO_BUY_SHOP_ITEM_CONDITION_PURSHASE = 11004,
|
|
8
|
+
SHOP_FAILED_TO_BUY_MATCHING_BONUS = 11005,
|
|
9
|
+
SHOP_FAILED_MAX_BOUGHT_ITEMS_REACHED = 11006
|
|
10
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ShopItemPublicMeta } from "./ShopItemPublicMeta";
|
|
2
|
+
import { ShopItemType } from "./ShopItemType";
|
|
3
|
+
export interface ShopItem {
|
|
4
|
+
id: number;
|
|
5
|
+
itemTypeId: ShopItemType;
|
|
6
|
+
itemPublicMeta: ShopItemPublicMeta;
|
|
7
|
+
categoryIds?: number[];
|
|
8
|
+
canBuy?: boolean;
|
|
9
|
+
}
|
|
@@ -165,7 +165,12 @@ export interface TMiniGameTemplate {
|
|
|
165
165
|
custom_section_id?: number;
|
|
166
166
|
/** The UI definition of the mini-game */
|
|
167
167
|
saw_template_ui_definition: SAWTemplateUI;
|
|
168
|
+
/** When enabled the prize history icon is visible on a certain template */
|
|
168
169
|
show_prize_history?: boolean;
|
|
170
|
+
/** The maximum number of attempts that user can do during period of time */
|
|
171
|
+
max_number_of_attempts?: number;
|
|
172
|
+
/** The period of time in milliseconds during which the user can do the maximum number of attempts */
|
|
173
|
+
max_spins_period_ms?: number;
|
|
169
174
|
}
|
|
170
175
|
/**
|
|
171
176
|
* TUser describes the information of the user
|
|
@@ -881,7 +886,13 @@ export interface TRaffle {
|
|
|
881
886
|
draws: TRaffleDraw[];
|
|
882
887
|
}
|
|
883
888
|
export interface TRaffleTicket {
|
|
889
|
+
/**
|
|
890
|
+
* Int presentation of the ticket
|
|
891
|
+
*/
|
|
884
892
|
ticekt_id: number;
|
|
893
|
+
/**
|
|
894
|
+
* String presentation of the ticket
|
|
895
|
+
*/
|
|
885
896
|
ticket_id_string: string;
|
|
886
897
|
}
|
|
887
898
|
export interface TRafflePrize {
|
package/dist/index.js
CHANGED
|
@@ -450,6 +450,8 @@ var SAWTemplatesTransform = function SAWTemplatesTransform(items) {
|
|
|
450
450
|
custom_section_id: r.saw_template_ui_definition.custom_section_id,
|
|
451
451
|
saw_template_ui_definition: r.saw_template_ui_definition,
|
|
452
452
|
show_prize_history: r.show_prize_history,
|
|
453
|
+
max_number_of_attempts: r.maxSpinsCount,
|
|
454
|
+
max_spins_period_ms: r.maxSpinsPediodMs,
|
|
453
455
|
prizes: r.prizes.map(function (p) {
|
|
454
456
|
var _p$saw_prize_ui_defin;
|
|
455
457
|
var y = {
|