@smartico/public-api 0.0.254 → 0.0.256
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/Quiz/MarketsAnswersType.d.ts +22 -0
- package/dist/Raffle/GetDrawResponse.d.ts +5 -0
- package/dist/SmarticoAPI.d.ts +6 -2
- 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 +6 -0
- package/dist/index.js +15 -6
- package/dist/index.js.map +1 -1
- package/dist/index.modern.mjs +16 -5
- 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/JackpotEligibleGame.md +2 -0
- package/docs/interfaces/TStoreItem.md +24 -0
- package/package.json +1 -1
- package/src/SmarticoAPI.ts +4 -4
- package/src/Store/StoreItem.ts +4 -1
- package/src/WSAPI/WSAPI.ts +3 -3
- package/src/WSAPI/WSAPITypes.ts +6 -0
|
@@ -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/SmarticoAPI.d.ts
CHANGED
|
@@ -85,8 +85,12 @@ declare class SmarticoAPI {
|
|
|
85
85
|
}): Promise<JackpotsOptoutResponse>;
|
|
86
86
|
getJackpotWinners(user_ext_id: string, limit: number, offset: number, jp_template_id: number): Promise<GetJackpotWinnersResponse>;
|
|
87
87
|
getJackpotWinnersT(user_ext_id: string, limit: number, offset: number, jp_template_id: number): Promise<JackpotWinnerHistory[]>;
|
|
88
|
-
getJackpotEligibleGames(user_ext_id: string, jp_template_id
|
|
89
|
-
|
|
88
|
+
getJackpotEligibleGames(user_ext_id: string, { jp_template_id }: {
|
|
89
|
+
jp_template_id: number;
|
|
90
|
+
}): Promise<GetJackpotEligibleGamesResponse>;
|
|
91
|
+
getJackpotEligibleGamesT(user_ext_id: string, { jp_template_id }: {
|
|
92
|
+
jp_template_id: number;
|
|
93
|
+
}): Promise<TGetJackpotEligibleGamesResponse>;
|
|
90
94
|
sawGetTemplates(user_ext_id: string, force_language?: string, is_visitor_mode?: boolean): Promise<SAWGetTemplatesResponse>;
|
|
91
95
|
sawGetTemplatesT(user_ext_id: string): Promise<TMiniGameTemplate[]>;
|
|
92
96
|
doAcknowledgeRequest(user_ext_id: string, request_id: string): Promise<SAWDoAknowledgeResponse>;
|
|
@@ -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
|
+
}
|
|
@@ -442,6 +442,12 @@ export interface TStoreItem {
|
|
|
442
442
|
purchase_type: 'points' | 'gems' | 'diamonds';
|
|
443
443
|
/** The date when the store item will be available till */
|
|
444
444
|
active_till_date?: number;
|
|
445
|
+
/** The discounted price of the store item */
|
|
446
|
+
discounted_price?: number;
|
|
447
|
+
/** The ribbon of the discounted price. */
|
|
448
|
+
discount_price_ribbon?: string;
|
|
449
|
+
/** The custom ribbon image of the discounted price. */
|
|
450
|
+
custom_ribbon_image?: string;
|
|
445
451
|
}
|
|
446
452
|
/**
|
|
447
453
|
* TAchCategory describes the badge category item. Each badge item can be assigned to 1 or more categories
|
package/dist/index.js
CHANGED
|
@@ -934,7 +934,10 @@ var StoreItemTransform = function StoreItemTransform(items) {
|
|
|
934
934
|
category_ids: (_r$categoryIds = r.categoryIds) != null ? _r$categoryIds : [],
|
|
935
935
|
pool: r.shopPool,
|
|
936
936
|
custom_data: IntUtils.JsonOrText(r.itemPublicMeta.custom_data),
|
|
937
|
-
active_till_date: r.activeTillDate
|
|
937
|
+
active_till_date: r.activeTillDate,
|
|
938
|
+
discounted_price: r.itemPublicMeta.discount_prize,
|
|
939
|
+
discount_price_ribbon: r.itemPublicMeta.discount_prize_ribbon,
|
|
940
|
+
custom_ribbon_image: r.itemPublicMeta.custom_ribbon_image
|
|
938
941
|
};
|
|
939
942
|
return x;
|
|
940
943
|
});
|
|
@@ -3043,8 +3046,10 @@ var WSAPI = /*#__PURE__*/function () {
|
|
|
3043
3046
|
if (onUpdate) {
|
|
3044
3047
|
_this47.onUpdateCallback.set(onUpdateContextKey.JackpotEligibleGames, onUpdate);
|
|
3045
3048
|
}
|
|
3046
|
-
return Promise.resolve(OCache.use(onUpdateContextKey.JackpotEligibleGames, exports.ECacheContext.WSAPI, function () {
|
|
3047
|
-
return _this47.api.getJackpotEligibleGamesT(null,
|
|
3049
|
+
return Promise.resolve(OCache.use(onUpdateContextKey.JackpotEligibleGames + jp_template_id, exports.ECacheContext.WSAPI, function () {
|
|
3050
|
+
return _this47.api.getJackpotEligibleGamesT(null, {
|
|
3051
|
+
jp_template_id: jp_template_id
|
|
3052
|
+
});
|
|
3048
3053
|
}, JACKPOT_ELIGIBLE_GAMES_CACHE_SEC));
|
|
3049
3054
|
} catch (e) {
|
|
3050
3055
|
return Promise.reject(e);
|
|
@@ -3712,7 +3717,8 @@ var SmarticoAPI = /*#__PURE__*/function () {
|
|
|
3712
3717
|
return Promise.reject(e);
|
|
3713
3718
|
}
|
|
3714
3719
|
};
|
|
3715
|
-
_proto.getJackpotEligibleGames = function getJackpotEligibleGames(user_ext_id,
|
|
3720
|
+
_proto.getJackpotEligibleGames = function getJackpotEligibleGames(user_ext_id, _ref) {
|
|
3721
|
+
var jp_template_id = _ref.jp_template_id;
|
|
3716
3722
|
try {
|
|
3717
3723
|
var _this14 = this;
|
|
3718
3724
|
var message = _this14.buildMessage(user_ext_id, exports.ClassId.JP_GET_ELIGIBLE_GAMES_REQUEST, {
|
|
@@ -3723,10 +3729,13 @@ var SmarticoAPI = /*#__PURE__*/function () {
|
|
|
3723
3729
|
return Promise.reject(e);
|
|
3724
3730
|
}
|
|
3725
3731
|
};
|
|
3726
|
-
_proto.getJackpotEligibleGamesT = function getJackpotEligibleGamesT(user_ext_id,
|
|
3732
|
+
_proto.getJackpotEligibleGamesT = function getJackpotEligibleGamesT(user_ext_id, _ref2) {
|
|
3733
|
+
var jp_template_id = _ref2.jp_template_id;
|
|
3727
3734
|
try {
|
|
3728
3735
|
var _this15 = this;
|
|
3729
|
-
return Promise.resolve(_this15.getJackpotEligibleGames(user_ext_id,
|
|
3736
|
+
return Promise.resolve(_this15.getJackpotEligibleGames(user_ext_id, {
|
|
3737
|
+
jp_template_id: jp_template_id
|
|
3738
|
+
})).then(GetJackpotEligibleGamesResponseTransform);
|
|
3730
3739
|
} catch (e) {
|
|
3731
3740
|
return Promise.reject(e);
|
|
3732
3741
|
}
|