@smartico/public-api 0.0.344 → 0.0.346

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@smartico/public-api",
3
- "version": "0.0.344",
3
+ "version": "0.0.346",
4
4
  "description": "Smartico public API",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -1,4 +1,19 @@
1
1
  export enum SAWExposeUserSpinId {
2
2
  UserId = 1,
3
3
  SpinId = 2,
4
- }
4
+ }
5
+
6
+ export enum SAWExposeUserSpinIdName {
7
+ UserId = 'userId',
8
+ SpinId = 'spinId',
9
+ }
10
+
11
+ /** @hidden */
12
+ export const SAWExposeUserSpinIdNamed = (id: SAWExposeUserSpinId): SAWExposeUserSpinIdName => {
13
+ return (
14
+ {
15
+ [SAWExposeUserSpinId.UserId]: SAWExposeUserSpinIdName.UserId,
16
+ [SAWExposeUserSpinId.SpinId]: SAWExposeUserSpinIdName.SpinId,
17
+ }[id]
18
+ );
19
+ };
@@ -1,4 +1,19 @@
1
1
  export enum SAWGameLayout {
2
2
  Horizontal = 1,
3
3
  VerticalMap = 2,
4
- }
4
+ }
5
+
6
+ export enum SAWGameLayoutName {
7
+ Horizontal = 'horizontal',
8
+ VerticalMap = 'vertical-map',
9
+ }
10
+
11
+ /** @hidden */
12
+ export const SAWGameLayoutNamed = (layout: SAWGameLayout): SAWGameLayoutName => {
13
+ return (
14
+ {
15
+ [SAWGameLayout.Horizontal]: SAWGameLayoutName.Horizontal,
16
+ [SAWGameLayout.VerticalMap]: SAWGameLayoutName.VerticalMap,
17
+ }[layout]
18
+ );
19
+ };
@@ -3,7 +3,9 @@ import { TMiniGamePrize, TMiniGameTemplate } from '../WSAPI/WSAPITypes';
3
3
  import { ProtocolResponse } from './../Base/ProtocolResponse';
4
4
  import { SAWAcknowledgeTypeNamed } from './SAWAcknowledgeType';
5
5
  import { SAWBuyInType, SAWBuyInTypeNamed } from './SAWBuyInType';
6
- import { SAWGameTypeNamed } from './SAWGameType';
6
+ import { SAWExposeUserSpinIdNamed } from './SAWExposeUserSpinId';
7
+ import { SAWGameLayoutNamed } from './SAWGameLayout';
8
+ import { SAWGameType, SAWGameTypeNamed } from './SAWGameType';
7
9
  import { MiniGamePrizeTypeNamed } from './SAWPrizeType';
8
10
  import { SAWTemplate } from './SAWTemplate';
9
11
 
@@ -45,9 +47,16 @@ export const SAWTemplatesTransform = (items: SAWTemplate[]): TMiniGameTemplate[]
45
47
  steps_to_finish_game: r.saw_template_ui_definition.steps_to_finish_game,
46
48
  custom_section_id: r.saw_template_ui_definition.custom_section_id,
47
49
  saw_template_ui_definition: r.saw_template_ui_definition,
50
+ ...(r.saw_game_type_id === SAWGameType.LootboxCalendarDays || r.saw_game_type_id === SAWGameType.LootboxWeekdays
51
+ ? { game_layout: SAWGameLayoutNamed(r.saw_template_ui_definition.game_layout) }
52
+ : {}
53
+ ),
48
54
  show_prize_history: r.show_prize_history,
49
55
  max_number_of_attempts: r.maxSpinsCount,
50
56
  max_spins_period_ms: r.maxSpinsPediodMs,
57
+ ...(r.saw_template_ui_definition.expose_user_spin_id
58
+ ? { expose_user_spin_id: SAWExposeUserSpinIdNamed(r.saw_template_ui_definition.expose_user_spin_id) }
59
+ : {}),
51
60
 
52
61
  prizes: r.prizes.map((p) => {
53
62
  const y: TMiniGamePrize = {
@@ -56,6 +56,7 @@ export const StoreItemTransform = (items: StoreItem[]): TStoreItem[] => {
56
56
  custom_section_id: r.itemPublicMeta.custom_section_id,
57
57
  only_in_custom_section: r.itemPublicMeta.only_in_custom_section,
58
58
  custom_section_type_id: r.itemPublicMeta.custom_section_type_id,
59
+ ...(r.itemPublicMeta.cant_buy_message ? { cant_buy_message: r.itemPublicMeta.cant_buy_message } : {}),
59
60
  };
60
61
  return x;
61
62
  });
@@ -1,5 +1,5 @@
1
1
  import { BuyStoreItemErrorCode } from '../Store';
2
- import { AttemptPeriodType, MiniGamePrizeTypeName, SAWAcknowledgeTypeName, SAWAskForUsername, SAWBuyInTypeName, SAWGameLayout, SAWGameTypeName, SAWSpinErrorCode, SAWTemplate, SAWTemplateUI } from '../MiniGames';
2
+ import { AttemptPeriodType, MiniGamePrizeTypeName, SAWAcknowledgeTypeName, SAWAskForUsername, SAWBuyInTypeName, SAWExposeUserSpinIdName, SAWGameLayout, SAWGameLayoutName, SAWGameTypeName, SAWSpinErrorCode, SAWTemplate, SAWTemplateUI } from '../MiniGames';
3
3
  import { TournamentRegistrationError, TournamentRegistrationStatusName, TournamentRegistrationTypeName } from '../Tournaments';
4
4
  import { AchievementAvailabilityStatus, BadgesTimeLimitStates } from '../Missions';
5
5
  import { LeaderBoardPeriodType } from '../Leaderboard';
@@ -188,12 +188,16 @@ export interface TMiniGameTemplate {
188
188
 
189
189
  /** The UI definition of the mini-game */
190
190
  saw_template_ui_definition: SAWTemplateUI;
191
+ /** The layout of the game */
192
+ game_layout?: SAWGameLayoutName;
191
193
  /** When enabled the prize history icon is visible on a certain template */
192
194
  show_prize_history?: boolean;
193
195
  /** The maximum number of attempts that user can do during period of time */
194
196
  max_number_of_attempts?: number;
195
197
  /** The period of time in milliseconds during which the user can do the maximum number of attempts */
196
198
  max_spins_period_ms?: number;
199
+ /** The ID of the user spin id to expose on the game */
200
+ expose_user_spin_id?: SAWExposeUserSpinIdName;
197
201
  }
198
202
 
199
203
  /**
@@ -554,6 +558,8 @@ export interface TStoreItem {
554
558
  only_in_custom_section?: boolean;
555
559
  /** ID of specific Custom Section type */
556
560
  custom_section_type_id?: number;
561
+ /** The message that should be shown to the user if they are not eligible to buy it. This message can be used to explain the reason why user cannot buy the item, e.g. 'You should be VIP to buy this item'. */
562
+ cant_buy_message?: string;
557
563
  }
558
564
 
559
565
  /**
@@ -1,43 +0,0 @@
1
- # Interface: GemsDiamondsLog
2
-
3
- ## Properties
4
-
5
- ### create\_date
6
-
7
- • **create\_date**: `number`
8
-
9
- ___
10
-
11
- ### user\_ext\_id
12
-
13
- • **user\_ext\_id**: `string`
14
-
15
- ___
16
-
17
- ### crm\_brand\_id
18
-
19
- • **crm\_brand\_id**: `number`
20
-
21
- ___
22
-
23
- ### type
24
-
25
- • **type**: [`UserBalanceType`](../enums/UserBalanceType.md)
26
-
27
- ___
28
-
29
- ### amount
30
-
31
- • **amount**: `number`
32
-
33
- ___
34
-
35
- ### balance
36
-
37
- • **balance**: `number`
38
-
39
- ___
40
-
41
- ### source\_type\_id
42
-
43
- • **source\_type\_id**: [`PointChangeSourceType`](../enums/PointChangeSourceType.md)
@@ -1,43 +0,0 @@
1
- # Interface: PointsLog
2
-
3
- ## Properties
4
-
5
- ### create\_date
6
-
7
- • **create\_date**: `number`
8
-
9
- ___
10
-
11
- ### user\_ext\_id
12
-
13
- • **user\_ext\_id**: `string`
14
-
15
- ___
16
-
17
- ### crm\_brand\_id
18
-
19
- • **crm\_brand\_id**: `number`
20
-
21
- ___
22
-
23
- ### points\_collected
24
-
25
- • **points\_collected**: `number`
26
-
27
- ___
28
-
29
- ### user\_points\_ever
30
-
31
- • **user\_points\_ever**: `number`
32
-
33
- ___
34
-
35
- ### user\_points\_balance
36
-
37
- • **user\_points\_balance**: `number`
38
-
39
- ___
40
-
41
- ### source\_type\_id
42
-
43
- • **source\_type\_id**: [`PointChangeSourceType`](../enums/PointChangeSourceType.md)