@smartico/public-api 0.0.100 → 0.0.102

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/docs/README.md CHANGED
@@ -22,6 +22,7 @@
22
22
  - [TStoreCategory](interfaces/TStoreCategory.md)
23
23
  - [TStoreItem](interfaces/TStoreItem.md)
24
24
  - [TMissionOrBadge](interfaces/TMissionOrBadge.md)
25
+ - [AchRelatedGame](interfaces/AchRelatedGame.md)
25
26
  - [TMissionOrBadgeTask](interfaces/TMissionOrBadgeTask.md)
26
27
  - [TMissionOptInResult](interfaces/TMissionOptInResult.md)
27
28
  - [TTournamentRegistrationResult](interfaces/TTournamentRegistrationResult.md)
@@ -16,19 +16,19 @@ ___
16
16
 
17
17
  ### getLevels
18
18
 
19
- ▸ **getLevels**(): `Promise`<[`TLevel`](../interfaces/TLevel.md)[]\>
19
+ ▸ **getLevels**(): `Promise`\<[`TLevel`](../interfaces/TLevel.md)[]\>
20
20
 
21
21
  Returns all the levels available the current user
22
22
 
23
23
  #### Returns
24
24
 
25
- `Promise`<[`TLevel`](../interfaces/TLevel.md)[]\>
25
+ `Promise`\<[`TLevel`](../interfaces/TLevel.md)[]\>
26
26
 
27
27
  ___
28
28
 
29
29
  ### getMissions
30
30
 
31
- ▸ **getMissions**(`params?`): `Promise`<[`TMissionOrBadge`](../interfaces/TMissionOrBadge.md)[]\>
31
+ ▸ **getMissions**(`params?`): `Promise`\<[`TMissionOrBadge`](../interfaces/TMissionOrBadge.md)[]\>
32
32
 
33
33
  #### Parameters
34
34
 
@@ -39,37 +39,37 @@ ___
39
39
 
40
40
  #### Returns
41
41
 
42
- `Promise`<[`TMissionOrBadge`](../interfaces/TMissionOrBadge.md)[]\>
42
+ `Promise`\<[`TMissionOrBadge`](../interfaces/TMissionOrBadge.md)[]\>
43
43
 
44
44
  ___
45
45
 
46
46
  ### getBadges
47
47
 
48
- ▸ **getBadges**(): `Promise`<[`TMissionOrBadge`](../interfaces/TMissionOrBadge.md)[]\>
48
+ ▸ **getBadges**(): `Promise`\<[`TMissionOrBadge`](../interfaces/TMissionOrBadge.md)[]\>
49
49
 
50
50
  Returns all the badges available the current user
51
51
 
52
52
  #### Returns
53
53
 
54
- `Promise`<[`TMissionOrBadge`](../interfaces/TMissionOrBadge.md)[]\>
54
+ `Promise`\<[`TMissionOrBadge`](../interfaces/TMissionOrBadge.md)[]\>
55
55
 
56
56
  ___
57
57
 
58
58
  ### getStoreItems
59
59
 
60
- ▸ **getStoreItems**(): `Promise`<[`TStoreItem`](../interfaces/TStoreItem.md)[]\>
60
+ ▸ **getStoreItems**(): `Promise`\<[`TStoreItem`](../interfaces/TStoreItem.md)[]\>
61
61
 
62
62
  Returns all the store items available the current user
63
63
 
64
64
  #### Returns
65
65
 
66
- `Promise`<[`TStoreItem`](../interfaces/TStoreItem.md)[]\>
66
+ `Promise`\<[`TStoreItem`](../interfaces/TStoreItem.md)[]\>
67
67
 
68
68
  ___
69
69
 
70
70
  ### buyStoreItem
71
71
 
72
- ▸ **buyStoreItem**(`item_id`): `Promise`<[`TBuyStoreItemResult`](../interfaces/TBuyStoreItemResult.md)\>
72
+ ▸ **buyStoreItem**(`item_id`): `Promise`\<[`TBuyStoreItemResult`](../interfaces/TBuyStoreItemResult.md)\>
73
73
 
74
74
  Buy the specific shop item by item_id. Returns the err_code.
75
75
 
@@ -81,25 +81,25 @@ Buy the specific shop item by item_id. Returns the err_code.
81
81
 
82
82
  #### Returns
83
83
 
84
- `Promise`<[`TBuyStoreItemResult`](../interfaces/TBuyStoreItemResult.md)\>
84
+ `Promise`\<[`TBuyStoreItemResult`](../interfaces/TBuyStoreItemResult.md)\>
85
85
 
86
86
  ___
87
87
 
88
88
  ### getStoreCategories
89
89
 
90
- ▸ **getStoreCategories**(): `Promise`<[`TStoreItem`](../interfaces/TStoreItem.md)[]\>
90
+ ▸ **getStoreCategories**(): `Promise`\<[`TStoreItem`](../interfaces/TStoreItem.md)[]\>
91
91
 
92
92
  Returns store categories
93
93
 
94
94
  #### Returns
95
95
 
96
- `Promise`<[`TStoreItem`](../interfaces/TStoreItem.md)[]\>
96
+ `Promise`\<[`TStoreItem`](../interfaces/TStoreItem.md)[]\>
97
97
 
98
98
  ___
99
99
 
100
100
  ### getMiniGames
101
101
 
102
- ▸ **getMiniGames**(`params?`): `Promise`<[`TMiniGameTemplate`](../interfaces/TMiniGameTemplate.md)[]\>
102
+ ▸ **getMiniGames**(`params?`): `Promise`\<[`TMiniGameTemplate`](../interfaces/TMiniGameTemplate.md)[]\>
103
103
 
104
104
  /**
105
105
  *
@@ -113,13 +113,13 @@ ___
113
113
 
114
114
  #### Returns
115
115
 
116
- `Promise`<[`TMiniGameTemplate`](../interfaces/TMiniGameTemplate.md)[]\>
116
+ `Promise`\<[`TMiniGameTemplate`](../interfaces/TMiniGameTemplate.md)[]\>
117
117
 
118
118
  ___
119
119
 
120
120
  ### playMiniGame
121
121
 
122
- ▸ **playMiniGame**(`template_id`): `Promise`<[`TMiniGamePlayResult`](../interfaces/TMiniGamePlayResult.md)\>
122
+ ▸ **playMiniGame**(`template_id`): `Promise`\<[`TMiniGamePlayResult`](../interfaces/TMiniGamePlayResult.md)\>
123
123
 
124
124
  Plays the specified by template_id mini-game on behalf of user and returns prize_id or err_code
125
125
 
@@ -131,13 +131,13 @@ Plays the specified by template_id mini-game on behalf of user and returns prize
131
131
 
132
132
  #### Returns
133
133
 
134
- `Promise`<[`TMiniGamePlayResult`](../interfaces/TMiniGamePlayResult.md)\>
134
+ `Promise`\<[`TMiniGamePlayResult`](../interfaces/TMiniGamePlayResult.md)\>
135
135
 
136
136
  ___
137
137
 
138
138
  ### requestMissionOptIn
139
139
 
140
- ▸ **requestMissionOptIn**(`mission_id`): `Promise`<[`TMissionOptInResult`](../interfaces/TMissionOptInResult.md)\>
140
+ ▸ **requestMissionOptIn**(`mission_id`): `Promise`\<[`TMissionOptInResult`](../interfaces/TMissionOptInResult.md)\>
141
141
 
142
142
  Requests an opt-in for the specified mission_id. Returns the err_code.
143
143
 
@@ -149,13 +149,13 @@ Requests an opt-in for the specified mission_id. Returns the err_code.
149
149
 
150
150
  #### Returns
151
151
 
152
- `Promise`<[`TMissionOptInResult`](../interfaces/TMissionOptInResult.md)\>
152
+ `Promise`\<[`TMissionOptInResult`](../interfaces/TMissionOptInResult.md)\>
153
153
 
154
154
  ___
155
155
 
156
156
  ### getTournamentsList
157
157
 
158
- ▸ **getTournamentsList**(`params?`): `Promise`<[`TTournament`](../interfaces/TTournament.md)[]\>
158
+ ▸ **getTournamentsList**(`params?`): `Promise`\<[`TTournament`](../interfaces/TTournament.md)[]\>
159
159
 
160
160
  #### Parameters
161
161
 
@@ -166,13 +166,13 @@ ___
166
166
 
167
167
  #### Returns
168
168
 
169
- `Promise`<[`TTournament`](../interfaces/TTournament.md)[]\>
169
+ `Promise`\<[`TTournament`](../interfaces/TTournament.md)[]\>
170
170
 
171
171
  ___
172
172
 
173
173
  ### getTournamentInstanceInfo
174
174
 
175
- ▸ **getTournamentInstanceInfo**(`tournamentInstanceId`): `Promise`<[`TTournamentDetailed`](../interfaces/TTournamentDetailed.md)\>
175
+ ▸ **getTournamentInstanceInfo**(`tournamentInstanceId`): `Promise`\<[`TTournamentDetailed`](../interfaces/TTournamentDetailed.md)\>
176
176
 
177
177
  Returns details information of specific tournament instance, the response will includ tournamnet info and the leaderboard of players
178
178
 
@@ -184,13 +184,13 @@ Returns details information of specific tournament instance, the response will i
184
184
 
185
185
  #### Returns
186
186
 
187
- `Promise`<[`TTournamentDetailed`](../interfaces/TTournamentDetailed.md)\>
187
+ `Promise`\<[`TTournamentDetailed`](../interfaces/TTournamentDetailed.md)\>
188
188
 
189
189
  ___
190
190
 
191
191
  ### registerInTournament
192
192
 
193
- ▸ **registerInTournament**(`tournamentInstanceId`): `Promise`<[`TTournamentRegistrationResult`](../interfaces/TTournamentRegistrationResult.md)\>
193
+ ▸ **registerInTournament**(`tournamentInstanceId`): `Promise`\<[`TTournamentRegistrationResult`](../interfaces/TTournamentRegistrationResult.md)\>
194
194
 
195
195
  Requests registration for the specified tournament instance. Returns the err_code.
196
196
 
@@ -202,13 +202,13 @@ Requests registration for the specified tournament instance. Returns the err_cod
202
202
 
203
203
  #### Returns
204
204
 
205
- `Promise`<[`TTournamentRegistrationResult`](../interfaces/TTournamentRegistrationResult.md)\>
205
+ `Promise`\<[`TTournamentRegistrationResult`](../interfaces/TTournamentRegistrationResult.md)\>
206
206
 
207
207
  ___
208
208
 
209
209
  ### getTranslations
210
210
 
211
- ▸ **getTranslations**(`lang_code`): `Promise`<[`TGetTranslations`](../interfaces/TGetTranslations.md)\>
211
+ ▸ **getTranslations**(`lang_code`): `Promise`\<[`TGetTranslations`](../interfaces/TGetTranslations.md)\>
212
212
 
213
213
  Requests translations for the given language. Returns the object including translation key/translation value pairs. All possible translation keys defined in the back office.
214
214
 
@@ -220,4 +220,4 @@ Requests translations for the given language. Returns the object including trans
220
220
 
221
221
  #### Returns
222
222
 
223
- `Promise`<[`TGetTranslations`](../interfaces/TGetTranslations.md)\>
223
+ `Promise`\<[`TGetTranslations`](../interfaces/TGetTranslations.md)\>
@@ -0,0 +1,28 @@
1
+ # Interface: AchRelatedGame
2
+
3
+ ## Properties
4
+
5
+ ### ext\_game\_id
6
+
7
+ • **ext\_game\_id**: `string`
8
+
9
+ The ID of the related game
10
+
11
+ ___
12
+
13
+ ### game\_public\_meta
14
+
15
+ • **game\_public\_meta**: `Object`
16
+
17
+ Game public meta information
18
+
19
+ #### Type declaration
20
+
21
+ | Name | Type | Description |
22
+ | :------ | :------ | :------ |
23
+ | `name` | `string` | The name of the game |
24
+ | `link` | `string` | The URL to the game |
25
+ | `image` | `string` | The URL to the image of the game |
26
+ | `enabled` | `boolean` | The indicator if the game is enabled |
27
+ | `game_categories` | `string`[] | The list of categories of the game |
28
+ | `game_provider` | `string` | The name of the game provider |
@@ -165,3 +165,11 @@ ___
165
165
  • **tasks**: [`TMissionOrBadgeTask`](TMissionOrBadgeTask.md)[]
166
166
 
167
167
  The list of tasks of the mission or badge
168
+
169
+ ___
170
+
171
+ ### related\_games
172
+
173
+ • `Optional` **related\_games**: [`AchRelatedGame`](AchRelatedGame.md)[]
174
+
175
+ List of casino games (or other types of entities) related to the mission or badge
@@ -351,9 +351,17 @@ Indicator if tournament instance is upcoming (status PUBLISHED or REGISTER)
351
351
 
352
352
  ___
353
353
 
354
+ ### related\_games
355
+
356
+ • `Optional` **related\_games**: [`AchRelatedGame`](AchRelatedGame.md)[]
357
+
358
+ List of casino games (or other types of entities) related to the tournament
359
+
360
+ ___
361
+
354
362
  ### players
355
363
 
356
- • `Optional` **players**: { `public_username`: `string` ; `avatar_url`: `string` ; `position`: `number` ; `scores`: `number` ; `is_me`: `boolean` }[]
364
+ • `Optional` **players**: \{ `public_username`: `string` ; `avatar_url`: `string` ; `position`: `number` ; `scores`: `number` ; `is_me`: `boolean` }[]
357
365
 
358
366
  The list of the tournament participants
359
367
 
@@ -378,4 +386,4 @@ ___
378
386
 
379
387
  ### prizes
380
388
 
381
- • `Optional` **prizes**: { `name`: `string` ; `description`: `string` ; `image_url`: `string` ; `place_from`: `number` ; `place_to`: `number` ; `type`: `string` ; `points?`: `number` }[]
389
+ • `Optional` **prizes**: \{ `name`: `string` ; `description`: `string` ; `image_url`: `string` ; `place_from`: `number` ; `place_to`: `number` ; `type`: `string` ; `points?`: `number` }[]
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@smartico/public-api",
3
- "version": "0.0.100",
3
+ "version": "0.0.102",
4
4
  "description": "Smartico public API",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -2,8 +2,6 @@ export interface PublicProperties {
2
2
  core_user_language?: string;
3
3
  ach_points_balance?: number;
4
4
  ach_points_ever?: number;
5
- ach_points_board_period_type_1?: number;
6
- ach_points_board_period_type_2?: number;
7
5
  ach_level_current_id?: number;
8
6
  ach_level_current?: string;
9
7
  core_is_test_account?: boolean;
@@ -30,6 +30,7 @@ export interface UserAchievement {
30
30
  ach_status_id?: AchievementStatus;
31
31
  scheduledMissionType?: ScheduledMissionType;
32
32
  related_games?: AchRelatedGame[];
33
+ active_from_ts?: number; // indicates when 'scheduled' mission is active from
33
34
  }
34
35
 
35
36
  export const UserAchievementTransform = (items: UserAchievement[]): TMissionOrBadge[] => {
@@ -63,7 +64,18 @@ export const UserAchievementTransform = (items: UserAchievement[]): TMissionOrBa
63
64
  points_reward: t.points_reward,
64
65
  is_completed: t.isCompleted,
65
66
  progress: t.userProgress,
66
- }))
67
+ })),
68
+ related_games: (r.related_games || []).map(g => ({
69
+ ext_game_id: g.ext_game_id,
70
+ game_public_meta: {
71
+ name: g.game_public_meta.name,
72
+ link: g.game_public_meta.link,
73
+ image: g.game_public_meta.image,
74
+ enabled: g.game_public_meta.enabled,
75
+ game_categories: g.game_public_meta.game_categories,
76
+ game_provider: g.game_public_meta.game_provider,
77
+ },
78
+ })),
67
79
  }
68
80
  ));
69
81
  }
@@ -37,6 +37,17 @@ const tournamentPrizeTypeToPrizeName = (type: ActivityTypeLimited) => {
37
37
  export const tournamentInfoItemTransform = (t: GetTournamentInfoResponse): TTournamentDetailed => {
38
38
  const response: TTournamentDetailed = {
39
39
  ...TournamentItemsTransform([t.tournamentInfo.tournamentLobbyInfo])[0],
40
+ related_games: (t.tournamentInfo.tournamentLobbyInfo.related_games || []).map(g => ({
41
+ ext_game_id: g.ext_game_id,
42
+ game_public_meta: {
43
+ name: g.game_public_meta.name,
44
+ link: g.game_public_meta.link,
45
+ image: g.game_public_meta.image,
46
+ enabled: g.game_public_meta.enabled,
47
+ game_categories: g.game_public_meta.game_categories,
48
+ game_provider: g.game_public_meta.game_provider,
49
+ },
50
+ })),
40
51
  players: t.tournamentInfo.players.map( p => ({
41
52
  public_username: p.userAltName,
42
53
  avatar_url: p.avatar_url,
@@ -247,6 +247,8 @@ export interface TTournament {
247
247
  */
248
248
  export interface TTournamentDetailed extends TTournament {
249
249
 
250
+ /** List of casino games (or other types of entities) related to the tournament */
251
+ related_games?: AchRelatedGame[],
250
252
  /** The list of the tournament participants */
251
253
  players?: {
252
254
  /** The username of the participant */
@@ -389,6 +391,29 @@ export interface TMissionOrBadge {
389
391
 
390
392
  /** The list of tasks of the mission or badge */
391
393
  tasks: TMissionOrBadgeTask[]
394
+
395
+ /** List of casino games (or other types of entities) related to the mission or badge */
396
+ related_games?: AchRelatedGame[];
397
+ }
398
+
399
+ export interface AchRelatedGame {
400
+ /** The ID of the related game */
401
+ ext_game_id: string;
402
+ /** Game public meta information */
403
+ game_public_meta: {
404
+ /** The name of the game */
405
+ name: string;
406
+ /** The URL to the game */
407
+ link: string;
408
+ /** The URL to the image of the game */
409
+ image: string;
410
+ /** The indicator if the game is enabled */
411
+ enabled: boolean;
412
+ /** The list of categories of the game */
413
+ game_categories: string[];
414
+ /** The name of the game provider */
415
+ game_provider: string;
416
+ }
392
417
  }
393
418
 
394
419
  /**