@smartico/public-api 0.0.408 → 0.0.409
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/GamePick/GamePickTypes.d.ts +6 -1
- package/dist/Tournaments/GetClanTournamentPlayersResponse.d.ts +2 -16
- package/dist/WSAPI/WSAPITypes.d.ts +4 -0
- package/dist/index.js +5 -0
- package/dist/index.js.map +1 -1
- package/dist/index.modern.mjs +5 -0
- package/dist/index.modern.mjs.map +1 -1
- package/docs/api/README.md +0 -2
- package/docs/api/functions/clanTournamentPlayersTransform.md +2 -2
- package/docs/api/interfaces/GamePickEvent.md +6 -1
- package/docs/capabilities/gamePickGetActiveRound.md +1 -1
- package/docs/capabilities/gamePickGetActiveRounds.md +1 -1
- package/docs/capabilities/gamePickGetHistory.md +1 -1
- package/docs/capabilities/gamePickGetRoundInfoForUser.md +1 -1
- package/docs/capabilities/gamePickSubmitSelection.md +1 -1
- package/docs/capabilities/gamePickSubmitSelectionQuiz.md +1 -1
- package/package.json +2 -2
- package/src/GamePick/GamePickTypes.ts +6 -1
- package/src/MiniGames/SAWGetTemplatesResponse.ts +2 -0
- package/src/Tournaments/GetClanTournamentPlayersResponse.ts +5 -18
- package/src/WSAPI/WSAPITypes.ts +4 -0
- package/docs/api/interfaces/TClanTournamentPlayer.md +0 -55
- package/docs/api/interfaces/TClanTournamentPlayersResult.md +0 -13
package/docs/api/README.md
CHANGED
|
@@ -195,8 +195,6 @@
|
|
|
195
195
|
- [StoreItemPublicMeta](interfaces/StoreItemPublicMeta.md)
|
|
196
196
|
- [ClanTournamentPlayerRaw](interfaces/ClanTournamentPlayerRaw.md)
|
|
197
197
|
- [GetClanTournamentPlayersResponse](interfaces/GetClanTournamentPlayersResponse.md)
|
|
198
|
-
- [TClanTournamentPlayer](interfaces/TClanTournamentPlayer.md)
|
|
199
|
-
- [TClanTournamentPlayersResult](interfaces/TClanTournamentPlayersResult.md)
|
|
200
198
|
- [GetTournamentInfoResponse](interfaces/GetTournamentInfoResponse.md)
|
|
201
199
|
- [Tournament](interfaces/Tournament.md)
|
|
202
200
|
- [ClanLeaderboardEntry](interfaces/ClanLeaderboardEntry.md)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Function: clanTournamentPlayersTransform()
|
|
2
2
|
|
|
3
|
-
> **clanTournamentPlayersTransform**(`response`): [`
|
|
3
|
+
> **clanTournamentPlayersTransform**(`response`): [`TClanTournamentPlayers`](../interfaces/TClanTournamentPlayers.md)
|
|
4
4
|
|
|
5
5
|
## Parameters
|
|
6
6
|
|
|
@@ -10,4 +10,4 @@
|
|
|
10
10
|
|
|
11
11
|
## Returns
|
|
12
12
|
|
|
13
|
-
[`
|
|
13
|
+
[`TClanTournamentPlayers`](../interfaces/TClanTournamentPlayers.md)
|
|
@@ -104,7 +104,12 @@ Whether this event is still accepting predictions
|
|
|
104
104
|
|
|
105
105
|
> `optional` **odds\_details?**: `object`
|
|
106
106
|
|
|
107
|
-
|
|
107
|
+
Per-outcome numbers keyed by the outcome value (`'1'` / `'x'` / `'2'`, `'yes'` / `'no'`, …).
|
|
108
|
+
Dual-purpose by event type:
|
|
109
|
+
- Sports / MatchX: decimal **betting odds** (e.g. `{ "1": 2.45, "x": 3.26, "2": 3.01 }`).
|
|
110
|
+
- Quiz: when the round's `show_users_preference` is `true`, these are aggregated
|
|
111
|
+
**user-preference percentages** — what other users predicted, summing to ~100
|
|
112
|
+
(e.g. `{ "1": 33, "x": 25, "2": 42 }`). Render as the "what others predicted" bar.
|
|
108
113
|
|
|
109
114
|
#### odd\_value
|
|
110
115
|
|
|
@@ -118,7 +118,7 @@ Wrapped in `GamesApiResponse`: `errCode` (number — `0` = success), `errMessage
|
|
|
118
118
|
- `resolution_type_id` (GamePickResolutionType) — How the user's prediction was scored after resolution
|
|
119
119
|
- `resolution_score` (number) — Points awarded for this event based on prediction accuracy
|
|
120
120
|
- `is_open_for_bets` (boolean) — Whether this event is still accepting predictions
|
|
121
|
-
- `odds_details` ({ odd_value: { [key: string]: number } }) —
|
|
121
|
+
- `odds_details` ({ odd_value: { [key: string]: number } }) — Per-outcome numbers keyed by the outcome value (`'1'` / `'x'` / `'2'`, `'yes'` / `'no'`, …). Dual-purpose by event type: - Sports / MatchX: decimal **betting odds** (e.g. `{ "1": 2.45, "x": 3.26, "2": 3.01 }`). - Quiz: when the round's `show_users_preference` is `true`, these are aggregated **user-preference percentages** — what other users predicted, summing to ~100 (e.g. `{ "1": 33, "x": 25, "2": 42 }`). Render as the "what others predicted" bar.
|
|
122
122
|
- `question_image` (string) — URL of a question-specific image (quiz events)
|
|
123
123
|
- `user_score` (number) — Current user's total score in this round
|
|
124
124
|
- `user_placed_bet` (boolean) — Whether the current user has submitted any predictions in this round
|
|
@@ -117,7 +117,7 @@ Array of `GamePickRound`. Each item:
|
|
|
117
117
|
- `resolution_type_id` (GamePickResolutionType) — How the user's prediction was scored after resolution
|
|
118
118
|
- `resolution_score` (number) — Points awarded for this event based on prediction accuracy
|
|
119
119
|
- `is_open_for_bets` (boolean) — Whether this event is still accepting predictions
|
|
120
|
-
- `odds_details` ({ odd_value: { [key: string]: number } }) —
|
|
120
|
+
- `odds_details` ({ odd_value: { [key: string]: number } }) — Per-outcome numbers keyed by the outcome value (`'1'` / `'x'` / `'2'`, `'yes'` / `'no'`, …). Dual-purpose by event type: - Sports / MatchX: decimal **betting odds** (e.g. `{ "1": 2.45, "x": 3.26, "2": 3.01 }`). - Quiz: when the round's `show_users_preference` is `true`, these are aggregated **user-preference percentages** — what other users predicted, summing to ~100 (e.g. `{ "1": 33, "x": 25, "2": 42 }`). Render as the "what others predicted" bar.
|
|
121
121
|
- `question_image` (string) — URL of a question-specific image (quiz events)
|
|
122
122
|
- `user_score` (number) — Current user's total score in this round
|
|
123
123
|
- `user_placed_bet` (boolean) — Whether the current user has submitted any predictions in this round
|
|
@@ -117,7 +117,7 @@ Array of `GamePickRound`. Each item:
|
|
|
117
117
|
- `resolution_type_id` (GamePickResolutionType) — How the user's prediction was scored after resolution
|
|
118
118
|
- `resolution_score` (number) — Points awarded for this event based on prediction accuracy
|
|
119
119
|
- `is_open_for_bets` (boolean) — Whether this event is still accepting predictions
|
|
120
|
-
- `odds_details` ({ odd_value: { [key: string]: number } }) —
|
|
120
|
+
- `odds_details` ({ odd_value: { [key: string]: number } }) — Per-outcome numbers keyed by the outcome value (`'1'` / `'x'` / `'2'`, `'yes'` / `'no'`, …). Dual-purpose by event type: - Sports / MatchX: decimal **betting odds** (e.g. `{ "1": 2.45, "x": 3.26, "2": 3.01 }`). - Quiz: when the round's `show_users_preference` is `true`, these are aggregated **user-preference percentages** — what other users predicted, summing to ~100 (e.g. `{ "1": 33, "x": 25, "2": 42 }`). Render as the "what others predicted" bar.
|
|
121
121
|
- `question_image` (string) — URL of a question-specific image (quiz events)
|
|
122
122
|
- `user_score` (number) — Current user's total score in this round
|
|
123
123
|
- `user_placed_bet` (boolean) — Whether the current user has submitted any predictions in this round
|
|
@@ -119,7 +119,7 @@ Wrapped in `GamesApiResponse`: `errCode` (number — `0` = success), `errMessage
|
|
|
119
119
|
- `resolution_type_id` (GamePickResolutionType) — How the user's prediction was scored after resolution
|
|
120
120
|
- `resolution_score` (number) — Points awarded for this event based on prediction accuracy
|
|
121
121
|
- `is_open_for_bets` (boolean) — Whether this event is still accepting predictions
|
|
122
|
-
- `odds_details` ({ odd_value: { [key: string]: number } }) —
|
|
122
|
+
- `odds_details` ({ odd_value: { [key: string]: number } }) — Per-outcome numbers keyed by the outcome value (`'1'` / `'x'` / `'2'`, `'yes'` / `'no'`, …). Dual-purpose by event type: - Sports / MatchX: decimal **betting odds** (e.g. `{ "1": 2.45, "x": 3.26, "2": 3.01 }`). - Quiz: when the round's `show_users_preference` is `true`, these are aggregated **user-preference percentages** — what other users predicted, summing to ~100 (e.g. `{ "1": 33, "x": 25, "2": 42 }`). Render as the "what others predicted" bar.
|
|
123
123
|
- `question_image` (string) — URL of a question-specific image (quiz events)
|
|
124
124
|
- `user_score` (number) — Current user's total score in this round
|
|
125
125
|
- `user_placed_bet` (boolean) — Whether the current user has submitted any predictions in this round
|
|
@@ -118,7 +118,7 @@ Wrapped in `GamesApiResponse`: `errCode` (number — `0` = success), `errMessage
|
|
|
118
118
|
- `resolution_type_id` (GamePickResolutionType) — How the user's prediction was scored after resolution
|
|
119
119
|
- `resolution_score` (number) — Points awarded for this event based on prediction accuracy
|
|
120
120
|
- `is_open_for_bets` (boolean) — Whether this event is still accepting predictions
|
|
121
|
-
- `odds_details` ({ odd_value: { [key: string]: number } }) —
|
|
121
|
+
- `odds_details` ({ odd_value: { [key: string]: number } }) — Per-outcome numbers keyed by the outcome value (`'1'` / `'x'` / `'2'`, `'yes'` / `'no'`, …). Dual-purpose by event type: - Sports / MatchX: decimal **betting odds** (e.g. `{ "1": 2.45, "x": 3.26, "2": 3.01 }`). - Quiz: when the round's `show_users_preference` is `true`, these are aggregated **user-preference percentages** — what other users predicted, summing to ~100 (e.g. `{ "1": 33, "x": 25, "2": 42 }`). Render as the "what others predicted" bar.
|
|
122
122
|
- `question_image` (string) — URL of a question-specific image (quiz events)
|
|
123
123
|
- `user_score` (number) — Current user's total score in this round
|
|
124
124
|
- `user_placed_bet` (boolean) — Whether the current user has submitted any predictions in this round
|
|
@@ -118,7 +118,7 @@ Wrapped in `GamesApiResponse`: `errCode` (number — `0` = success), `errMessage
|
|
|
118
118
|
- `resolution_type_id` (GamePickResolutionType) — How the user's prediction was scored after resolution
|
|
119
119
|
- `resolution_score` (number) — Points awarded for this event based on prediction accuracy
|
|
120
120
|
- `is_open_for_bets` (boolean) — Whether this event is still accepting predictions
|
|
121
|
-
- `odds_details` ({ odd_value: { [key: string]: number } }) —
|
|
121
|
+
- `odds_details` ({ odd_value: { [key: string]: number } }) — Per-outcome numbers keyed by the outcome value (`'1'` / `'x'` / `'2'`, `'yes'` / `'no'`, …). Dual-purpose by event type: - Sports / MatchX: decimal **betting odds** (e.g. `{ "1": 2.45, "x": 3.26, "2": 3.01 }`). - Quiz: when the round's `show_users_preference` is `true`, these are aggregated **user-preference percentages** — what other users predicted, summing to ~100 (e.g. `{ "1": 33, "x": 25, "2": 42 }`). Render as the "what others predicted" bar.
|
|
122
122
|
- `question_image` (string) — URL of a question-specific image (quiz events)
|
|
123
123
|
- `user_score` (number) — Current user's total score in this round
|
|
124
124
|
- `user_placed_bet` (boolean) — Whether the current user has submitted any predictions in this round
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@smartico/public-api",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.409",
|
|
4
4
|
"description": "Smartico public API",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
"bump-ach": "cd ../tracker/ach && npm install @smartico/public-api@latest --legacy-peer-deps",
|
|
25
25
|
"bump-bo-server": "cd ../bo_server/server && source ~/.nvm/nvm.sh && nvm use v13.13.0 && npm install @smartico/public-api@latest",
|
|
26
26
|
"bump-bo-client": "cd ../bo_server/client && source ~/.nvm/nvm.sh && nvm use v13.13.0 && npm install @smartico/public-api@latest",
|
|
27
|
-
"doc": "typedoc && node scripts/postdoc-cleanup.js",
|
|
27
|
+
"doc": "node scripts/gen-capabilities.js && typedoc && node scripts/postdoc-cleanup.js",
|
|
28
28
|
"gen-capabilities": "node scripts/gen-capabilities.js"
|
|
29
29
|
},
|
|
30
30
|
"author": "",
|
|
@@ -233,7 +233,12 @@ export interface GamePickEvent {
|
|
|
233
233
|
resolution_score?: number;
|
|
234
234
|
/** Whether this event is still accepting predictions */
|
|
235
235
|
is_open_for_bets?: boolean;
|
|
236
|
-
/**
|
|
236
|
+
/** Per-outcome numbers keyed by the outcome value (`'1'` / `'x'` / `'2'`, `'yes'` / `'no'`, …).
|
|
237
|
+
* Dual-purpose by event type:
|
|
238
|
+
* - Sports / MatchX: decimal **betting odds** (e.g. `{ "1": 2.45, "x": 3.26, "2": 3.01 }`).
|
|
239
|
+
* - Quiz: when the round's `show_users_preference` is `true`, these are aggregated
|
|
240
|
+
* **user-preference percentages** — what other users predicted, summing to ~100
|
|
241
|
+
* (e.g. `{ "1": 33, "x": 25, "2": 42 }`). Render as the "what others predicted" bar. */
|
|
237
242
|
odds_details?: { odd_value: { [key: string]: number } };
|
|
238
243
|
/** URL of a question-specific image (quiz events) */
|
|
239
244
|
question_image?: string;
|
|
@@ -77,6 +77,8 @@ export const SAWTemplatesTransform = (items: SAWTemplate[]): TMiniGameTemplate[]
|
|
|
77
77
|
acknowledge_action_title: p.saw_prize_ui_definition.acknowledge_action_title,
|
|
78
78
|
acknowledge_dp_additional: p.saw_prize_ui_definition.acknowledge_dp_additional,
|
|
79
79
|
acknowledge_action_title_additional: p.saw_prize_ui_definition.acknowledge_action_title_additional,
|
|
80
|
+
second_btn: p.saw_prize_ui_definition.second_btn,
|
|
81
|
+
second_btn_action_title: p.saw_prize_ui_definition.second_btn_action_title,
|
|
80
82
|
out_of_stock_message: p.saw_prize_ui_definition.out_of_stock_message,
|
|
81
83
|
pool: p.pool,
|
|
82
84
|
pool_initial: p.pool_initial,
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { ProtocolResponse } from '../Base/ProtocolResponse';
|
|
2
|
+
import { TClanTournamentPlayers } from '../WSAPI/WSAPITypes';
|
|
2
3
|
|
|
3
4
|
export interface ClanTournamentPlayerRaw {
|
|
4
5
|
userId: number;
|
|
@@ -19,24 +20,10 @@ export interface GetClanTournamentPlayersResponse extends ProtocolResponse {
|
|
|
19
20
|
players: ClanTournamentPlayerRaw[];
|
|
20
21
|
}
|
|
21
22
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
avatar_id: string;
|
|
27
|
-
avatar_real_id: number;
|
|
28
|
-
avatar_url?: string;
|
|
29
|
-
position: number;
|
|
30
|
-
scores: number;
|
|
31
|
-
is_me: boolean;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
export interface TClanTournamentPlayersResult {
|
|
35
|
-
tournament_instance_id: number;
|
|
36
|
-
players: TClanTournamentPlayer[];
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
export const clanTournamentPlayersTransform = (response: GetClanTournamentPlayersResponse): TClanTournamentPlayersResult => {
|
|
23
|
+
// Consumer-facing types live in WSAPITypes.ts (`TClanTournamentPlayers`) — the
|
|
24
|
+
// single source documented + emitted to docs. This transform maps the raw wire
|
|
25
|
+
// shape onto it; do not re-declare a parallel result/player type here.
|
|
26
|
+
export const clanTournamentPlayersTransform = (response: GetClanTournamentPlayersResponse): TClanTournamentPlayers => {
|
|
40
27
|
return {
|
|
41
28
|
tournament_instance_id: response.tournament_instance_id,
|
|
42
29
|
players: (response.players || []).map((p) => ({
|
package/src/WSAPI/WSAPITypes.ts
CHANGED
|
@@ -53,6 +53,10 @@ export interface TMiniGamePrize {
|
|
|
53
53
|
acknowledge_dp_additional?: string;
|
|
54
54
|
/** The name of the action button in modal pop-up (additional) */
|
|
55
55
|
acknowledge_action_title_additional?: string;
|
|
56
|
+
/** Deep link that will trigger some action in modal pop-up (second button) */
|
|
57
|
+
second_btn?: string,
|
|
58
|
+
/** The name of the action button in modal pop-up (second button) */
|
|
59
|
+
second_btn_action_title?: string;
|
|
56
60
|
/** Message when the prize pool is empty for that specific prize */
|
|
57
61
|
out_of_stock_message?: string;
|
|
58
62
|
/** Number of items in stock */
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
# Interface: TClanTournamentPlayer
|
|
2
|
-
|
|
3
|
-
## Properties
|
|
4
|
-
|
|
5
|
-
### user\_id
|
|
6
|
-
|
|
7
|
-
> **user\_id**: `number`
|
|
8
|
-
|
|
9
|
-
***
|
|
10
|
-
|
|
11
|
-
### clean\_ext\_user\_id
|
|
12
|
-
|
|
13
|
-
> **clean\_ext\_user\_id**: `string`
|
|
14
|
-
|
|
15
|
-
***
|
|
16
|
-
|
|
17
|
-
### public\_username
|
|
18
|
-
|
|
19
|
-
> **public\_username**: `string`
|
|
20
|
-
|
|
21
|
-
***
|
|
22
|
-
|
|
23
|
-
### avatar\_id
|
|
24
|
-
|
|
25
|
-
> **avatar\_id**: `string`
|
|
26
|
-
|
|
27
|
-
***
|
|
28
|
-
|
|
29
|
-
### avatar\_real\_id
|
|
30
|
-
|
|
31
|
-
> **avatar\_real\_id**: `number`
|
|
32
|
-
|
|
33
|
-
***
|
|
34
|
-
|
|
35
|
-
### avatar\_url?
|
|
36
|
-
|
|
37
|
-
> `optional` **avatar\_url?**: `string`
|
|
38
|
-
|
|
39
|
-
***
|
|
40
|
-
|
|
41
|
-
### position
|
|
42
|
-
|
|
43
|
-
> **position**: `number`
|
|
44
|
-
|
|
45
|
-
***
|
|
46
|
-
|
|
47
|
-
### scores
|
|
48
|
-
|
|
49
|
-
> **scores**: `number`
|
|
50
|
-
|
|
51
|
-
***
|
|
52
|
-
|
|
53
|
-
### is\_me
|
|
54
|
-
|
|
55
|
-
> **is\_me**: `boolean`
|