@smartico/public-api 0.0.241 → 0.0.242

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 (61) hide show
  1. package/dist/Jackpots/JackpotPublicMeta.d.ts +2 -0
  2. package/dist/Quiz/MarketsAnswersType.d.ts +22 -0
  3. package/dist/Raffle/GetDrawResponse.d.ts +5 -0
  4. package/dist/Raffle/Raffle.d.ts +2 -0
  5. package/dist/SmarticoPublicAPI.d.ts +23 -0
  6. package/dist/Store/BuyShopItemErrorCode.d.ts +10 -0
  7. package/dist/Store/BuyShopItemRequest.d.ts +4 -0
  8. package/dist/Store/BuyShopItemResponse.d.ts +4 -0
  9. package/dist/Store/BuyStoreItemErrorCode.d.ts +8 -1
  10. package/dist/Store/GetCategoriesShopResponse.d.ts +5 -0
  11. package/dist/Store/GetShopItemsResponse.d.ts +5 -0
  12. package/dist/Store/ShopCategory.d.ts +5 -0
  13. package/dist/Store/ShopCategoryPublicMeta.d.ts +4 -0
  14. package/dist/Store/ShopItem.d.ts +9 -0
  15. package/dist/Store/ShopItemPublicMeta.d.ts +10 -0
  16. package/dist/Store/ShopItemType.d.ts +4 -0
  17. package/dist/Store/StorItemPruchased.d.ts +6 -0
  18. package/dist/index.js +8 -1
  19. package/dist/index.js.map +1 -1
  20. package/dist/index.modern.mjs +8 -1
  21. package/dist/index.modern.mjs.map +1 -1
  22. package/dist/service/index.d.ts +5 -0
  23. package/dist/service/types/ErrorCodes.d.ts +13 -0
  24. package/dist/service/types/GRequest.d.ts +16 -0
  25. package/dist/service/types/GResponse.d.ts +10 -0
  26. package/dist/service/types/Game/GameAttemptType.d.ts +6 -0
  27. package/dist/service/types/Game/GameCanPlayType.d.ts +10 -0
  28. package/dist/service/types/Game/GameExternalStatus.d.ts +6 -0
  29. package/dist/service/types/Game/GameInfo.d.ts +9 -0
  30. package/dist/service/types/Game/GamePick.d.ts +90 -0
  31. package/dist/service/types/Game/GameUtil.d.ts +7 -0
  32. package/dist/service/types/SmarticoProto/GetTranslationsRequest.d.ts +7 -0
  33. package/dist/service/types/SmarticoProto/GetTranslationsResponse.d.ts +7 -0
  34. package/dist/service/types/SmarticoProto/ProtocolMessage.d.ts +5 -0
  35. package/dist/service/types/SmarticoProto/ProtocolRequest.d.ts +6 -0
  36. package/dist/service/types/SmarticoProto/ProtocolResponse.d.ts +5 -0
  37. package/dist/service/types/SmarticoProto/PublicLabelInfo.d.ts +34 -0
  38. package/dist/service/types/SmarticoProto/PublicProperties.d.ts +11 -0
  39. package/dist/service/types/SmarticoProto/ResponseIdentify.d.ts +12 -0
  40. package/dist/service/types/SmarticoProto/SAW/SAWAcknowledgeType.d.ts +5 -0
  41. package/dist/service/types/SmarticoProto/SAW/SAWBuyInType.d.ts +5 -0
  42. package/dist/service/types/SmarticoProto/SAW/SAWDoSpinRequest.d.ts +5 -0
  43. package/dist/service/types/SmarticoProto/SAW/SAWDoSpinResponse.d.ts +15 -0
  44. package/dist/service/types/SmarticoProto/SAW/SAWGameType.d.ts +10 -0
  45. package/dist/service/types/SmarticoProto/SAW/SAWGetTemplatesRequest.d.ts +3 -0
  46. package/dist/service/types/SmarticoProto/SAW/SAWGetTemplatesResponse.d.ts +5 -0
  47. package/dist/service/types/SmarticoProto/SAW/SAWPrize.d.ts +11 -0
  48. package/dist/service/types/SmarticoProto/SAW/SAWPrizeType.d.ts +8 -0
  49. package/dist/service/types/SmarticoProto/SAW/SAWPrizeUI.d.ts +13 -0
  50. package/dist/service/types/SmarticoProto/SAW/SAWTemplate.d.ts +21 -0
  51. package/dist/service/types/SmarticoProto/SAW/SAWTemplateUI.d.ts +31 -0
  52. package/dist/service/types/SmarticoProto/SAW/SAWWinSoundType.d.ts +12 -0
  53. package/dist/service/types/SmarticoProto/TranslationArea.d.ts +9 -0
  54. package/dist/service/types/User/UserInfo.d.ts +10 -0
  55. package/dist/util/Util.d.ts +51 -0
  56. package/docs/enums/BuyStoreItemErrorCode.md +16 -6
  57. package/docs/interfaces/JackpotPublicMeta.md +8 -0
  58. package/package.json +1 -1
  59. package/src/Jackpots/JackpotPublicMeta.ts +2 -0
  60. package/src/Raffle/Raffle.ts +2 -0
  61. package/src/Store/BuyStoreItemErrorCode.ts +9 -2
@@ -14,5 +14,7 @@ interface JackpotPublicMeta {
14
14
  placeholder1: string;
15
15
  /** custom value of placeholder2 defined by operator and can be used in the HTML templates */
16
16
  placeholder2: string;
17
+ /** custom data as string or JSON string that can be used in UIWidget */
18
+ custom_data: string;
17
19
  }
18
20
  export { JackpotPublicMeta };
@@ -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
+ }
@@ -0,0 +1,5 @@
1
+ import { ProtocolResponse } from '../Base/ProtocolResponse';
2
+ import { RaffleDraw } from './RaffleDraw';
3
+ export interface GetDrawResponse extends ProtocolResponse {
4
+ draw: RaffleDraw;
5
+ }
@@ -8,6 +8,8 @@ interface RafflePublicMeta {
8
8
  custom_section_id: number;
9
9
  /** URL of the image that represents the raffle */
10
10
  image_url: string;
11
+ /** Custom data as string or JSON string that can be used in UIWidget */
12
+ custom_data: string;
11
13
  }
12
14
  interface Raffle {
13
15
  /** ID of the Raffle template */
@@ -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,4 @@
1
+ import { ProtocolMessage } from "../Base/ProtocolMessage";
2
+ export interface BuyShopItemRequest extends ProtocolMessage {
3
+ itemId: number;
4
+ }
@@ -0,0 +1,4 @@
1
+ import { ProtocolResponse } from "../Base/ProtocolResponse";
2
+ export interface BuyShopItemResponse extends ProtocolResponse {
3
+ success?: boolean;
4
+ }
@@ -1,11 +1,18 @@
1
1
  export declare enum BuyStoreItemErrorCode {
2
- FAILED_TO_BUY_SHOP_ITEM = 121,
2
+ /** User don't have enough points on balance */
3
3
  SHOP_NO_BALANCE = 11000,
4
+ /** Wrong shop item id */
4
5
  SHOP_WRONG_LABEL = 11001,
6
+ /** Failed to buy bonus item, probably something wrong with the bonus configuration. */
5
7
  SHOP_FAILED_TO_BUY_BONUS = 11002,
8
+ /** Failed to buy store item because segment conditions are set by operator for specific CRM item */
6
9
  SHOP_FAILED_TO_BUY_SHOP_ITEM_CONDITION = 11003,
10
+ /** Segment conditions are set by operator for specific CRM item and user not matching to this conditions */
7
11
  SHOP_FAILED_TO_BUY_SHOP_ITEM_CONDITION_PURSHASE = 11004,
12
+ /** Failed to buy matching bonus item */
8
13
  SHOP_FAILED_TO_BUY_MATCHING_BONUS = 11005,
14
+ /** Failed to buy item because of limit of max items is reached */
9
15
  SHOP_FAILED_MAX_BOUGHT_ITEMS_REACHED = 11006,
16
+ /** Failed to buy item because no more items are available */
10
17
  SHOP_FAILED_POOL_EMPTY = 11009
11
18
  }
@@ -0,0 +1,5 @@
1
+ import { ProtocolResponse } from "../Base/ProtocolResponse";
2
+ import { ShopCategory } from "./ShopCategory";
3
+ export interface GetCategoriesShopResponse extends ProtocolResponse {
4
+ categories: ShopCategory[];
5
+ }
@@ -0,0 +1,5 @@
1
+ import { ProtocolResponse } from "../Base/ProtocolResponse";
2
+ import { ShopItem } from "./ShopItem";
3
+ export interface GetShopItemsResponse extends ProtocolResponse {
4
+ items: ShopItem[];
5
+ }
@@ -0,0 +1,5 @@
1
+ import { ShopCategoryPublicMeta } from "./ShopCategoryPublicMeta";
2
+ export interface ShopCategory {
3
+ id?: number;
4
+ publicMeta?: ShopCategoryPublicMeta;
5
+ }
@@ -0,0 +1,4 @@
1
+ export interface ShopCategoryPublicMeta {
2
+ name?: string;
3
+ order?: number;
4
+ }
@@ -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
+ }
@@ -0,0 +1,10 @@
1
+ export interface ShopItemPublicMeta {
2
+ price: string;
3
+ image_url: string;
4
+ name: string;
5
+ description: string;
6
+ label_tag: string;
7
+ limit_message: string;
8
+ priority: number;
9
+ related_items: number[];
10
+ }
@@ -0,0 +1,4 @@
1
+ export declare enum ShopItemType {
2
+ Bonus = 1,
3
+ Manual = 2
4
+ }
@@ -0,0 +1,6 @@
1
+ import { StoreItem } from "./StoreItem";
2
+ interface StorItemPruchased extends StoreItem {
3
+ purchase_ts: number;
4
+ purchase_points_amount: number;
5
+ }
6
+ export { StorItemPruchased };
package/dist/index.js CHANGED
@@ -834,14 +834,21 @@ exports.InboxCategories = void 0;
834
834
 
835
835
  exports.BuyStoreItemErrorCode = void 0;
836
836
  (function (BuyStoreItemErrorCode) {
837
- BuyStoreItemErrorCode[BuyStoreItemErrorCode["FAILED_TO_BUY_SHOP_ITEM"] = 121] = "FAILED_TO_BUY_SHOP_ITEM";
837
+ /** User don't have enough points on balance */
838
838
  BuyStoreItemErrorCode[BuyStoreItemErrorCode["SHOP_NO_BALANCE"] = 11000] = "SHOP_NO_BALANCE";
839
+ /** Wrong shop item id */
839
840
  BuyStoreItemErrorCode[BuyStoreItemErrorCode["SHOP_WRONG_LABEL"] = 11001] = "SHOP_WRONG_LABEL";
841
+ /** Failed to buy bonus item, probably something wrong with the bonus configuration. */
840
842
  BuyStoreItemErrorCode[BuyStoreItemErrorCode["SHOP_FAILED_TO_BUY_BONUS"] = 11002] = "SHOP_FAILED_TO_BUY_BONUS";
843
+ /** Failed to buy store item because segment conditions are set by operator for specific CRM item */
841
844
  BuyStoreItemErrorCode[BuyStoreItemErrorCode["SHOP_FAILED_TO_BUY_SHOP_ITEM_CONDITION"] = 11003] = "SHOP_FAILED_TO_BUY_SHOP_ITEM_CONDITION";
845
+ /** Segment conditions are set by operator for specific CRM item and user not matching to this conditions */
842
846
  BuyStoreItemErrorCode[BuyStoreItemErrorCode["SHOP_FAILED_TO_BUY_SHOP_ITEM_CONDITION_PURSHASE"] = 11004] = "SHOP_FAILED_TO_BUY_SHOP_ITEM_CONDITION_PURSHASE";
847
+ /** Failed to buy matching bonus item */
843
848
  BuyStoreItemErrorCode[BuyStoreItemErrorCode["SHOP_FAILED_TO_BUY_MATCHING_BONUS"] = 11005] = "SHOP_FAILED_TO_BUY_MATCHING_BONUS";
849
+ /** Failed to buy item because of limit of max items is reached */
844
850
  BuyStoreItemErrorCode[BuyStoreItemErrorCode["SHOP_FAILED_MAX_BOUGHT_ITEMS_REACHED"] = 11006] = "SHOP_FAILED_MAX_BOUGHT_ITEMS_REACHED";
851
+ /** Failed to buy item because no more items are available */
845
852
  BuyStoreItemErrorCode[BuyStoreItemErrorCode["SHOP_FAILED_POOL_EMPTY"] = 11009] = "SHOP_FAILED_POOL_EMPTY";
846
853
  })(exports.BuyStoreItemErrorCode || (exports.BuyStoreItemErrorCode = {}));
847
854