@smartico/public-api 0.0.405 → 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 +3 -25
- package/dist/WSAPI/WSAPITournaments.d.ts +4 -7
- package/dist/WSAPI/WSAPITypes.d.ts +16 -8
- package/dist/index.js +10 -12
- package/dist/index.js.map +1 -1
- package/dist/index.modern.mjs +10 -12
- package/dist/index.modern.mjs.map +1 -1
- package/docs/api/README.md +0 -2
- package/docs/api/classes/WSAPITournaments.md +4 -7
- package/docs/api/functions/clanTournamentPlayersTransform.md +2 -2
- package/docs/api/interfaces/GamePickEvent.md +6 -1
- package/docs/api/interfaces/GetClanTournamentPlayersResponse.md +2 -16
- package/docs/api/interfaces/SAWTemplateUI.md +6 -2
- package/docs/api/interfaces/TClanTournamentPlayers.md +24 -22
- 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/docs/capabilities/getClanTournamentPlayers.md +16 -11
- package/package.json +2 -2
- package/src/GamePick/GamePickTypes.ts +6 -1
- package/src/MiniGames/SAWGetTemplatesResponse.ts +2 -0
- package/src/Tournaments/GetClanTournamentPlayersResponse.ts +7 -26
- package/src/WSAPI/WSAPITournaments.ts +4 -7
- package/src/WSAPI/WSAPITypes.ts +16 -5
- package/docs/api/interfaces/TClanTournamentPlayer.md +0 -55
- package/docs/api/interfaces/TClanTournamentPlayersResult.md +0 -27
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)
|
|
@@ -330,16 +330,13 @@ non-clan tournament typically returns an empty `players` array.
|
|
|
330
330
|
polling cadence.
|
|
331
331
|
|
|
332
332
|
**Returned shape**
|
|
333
|
-
`TClanTournamentPlayers` carries the
|
|
334
|
-
(`clan_id`, `clan_public_meta.name`, `clan_public_meta.image_url`)
|
|
333
|
+
`TClanTournamentPlayers` carries the `tournament_instance_id`
|
|
335
334
|
alongside the `players[]` array — each entry has `position`,
|
|
336
335
|
`scores`, `public_username`, `clean_ext_user_id`, `avatar_id`,
|
|
337
336
|
`avatar_real_id`, the resolved `avatar_url`, `user_id`, and the
|
|
338
|
-
`is_me` flag identifying the current user's row. The
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
caller-side `ClanLeaderboardEntry` object, but they're available
|
|
342
|
-
for consumers that don't already have that context.
|
|
337
|
+
`is_me` flag identifying the current user's row. The response does
|
|
338
|
+
NOT echo the clan's identity — render the clan header from the
|
|
339
|
+
caller-side `ClanLeaderboardEntry` object you passed in.
|
|
343
340
|
|
|
344
341
|
**Username display**: prefer `clean_ext_user_id` when set, falling
|
|
345
342
|
back to `public_username`. The default Smartico UI uses
|
|
@@ -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
|
|
|
@@ -56,23 +56,9 @@
|
|
|
56
56
|
|
|
57
57
|
***
|
|
58
58
|
|
|
59
|
-
###
|
|
59
|
+
### tournament\_instance\_id
|
|
60
60
|
|
|
61
|
-
> **
|
|
62
|
-
|
|
63
|
-
***
|
|
64
|
-
|
|
65
|
-
### clan\_public\_meta
|
|
66
|
-
|
|
67
|
-
> **clan\_public\_meta**: `object`
|
|
68
|
-
|
|
69
|
-
#### name
|
|
70
|
-
|
|
71
|
-
> **name**: `string`
|
|
72
|
-
|
|
73
|
-
#### image\_url
|
|
74
|
-
|
|
75
|
-
> **image\_url**: `string`
|
|
61
|
+
> **tournament\_instance\_id**: `number`
|
|
76
62
|
|
|
77
63
|
***
|
|
78
64
|
|
|
@@ -571,8 +571,12 @@ controlling obstacle frequency and game speed.
|
|
|
571
571
|
> `optional` **custom\_game\_url?**: `string`
|
|
572
572
|
|
|
573
573
|
URL of the operator-hosted custom mini-game, loaded inside an iframe by
|
|
574
|
-
the widget for `SAWGameType.CustomMinigame`. The operator is trusted
|
|
575
|
-
the
|
|
574
|
+
the widget for `SAWGameType.CustomMinigame`. The operator is trusted
|
|
575
|
+
(the URL resolves to the operator's own published Web Studio game), but
|
|
576
|
+
the iframe is still rendered with a restrictive sandbox as defence in
|
|
577
|
+
depth: `sandbox="allow-scripts allow-forms allow-same-origin allow-popups
|
|
578
|
+
allow-pointer-lock"`. Top-level navigation is intentionally not allowed,
|
|
579
|
+
so the game cannot redirect the host page.
|
|
576
580
|
Back-Office label: _"Game URL"_.
|
|
577
581
|
|
|
578
582
|
***
|
|
@@ -4,27 +4,11 @@ TClanTournamentPlayers describes the players of a specific clan in a clan-based
|
|
|
4
4
|
|
|
5
5
|
## Properties
|
|
6
6
|
|
|
7
|
-
###
|
|
7
|
+
### tournament\_instance\_id
|
|
8
8
|
|
|
9
|
-
> **
|
|
9
|
+
> **tournament\_instance\_id**: `number`
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
***
|
|
14
|
-
|
|
15
|
-
### clan\_public\_meta
|
|
16
|
-
|
|
17
|
-
> **clan\_public\_meta**: `object`
|
|
18
|
-
|
|
19
|
-
Clan display metadata
|
|
20
|
-
|
|
21
|
-
#### name
|
|
22
|
-
|
|
23
|
-
> **name**: `string`
|
|
24
|
-
|
|
25
|
-
#### image\_url
|
|
26
|
-
|
|
27
|
-
> **image\_url**: `string`
|
|
11
|
+
Tournament instance ID
|
|
28
12
|
|
|
29
13
|
***
|
|
30
14
|
|
|
@@ -38,34 +22,52 @@ Top players of this clan ranked by score DESC
|
|
|
38
22
|
|
|
39
23
|
> **user\_id**: `number`
|
|
40
24
|
|
|
25
|
+
Smartico User ID
|
|
26
|
+
|
|
27
|
+
#### clean\_ext\_user\_id
|
|
28
|
+
|
|
29
|
+
> **clean\_ext\_user\_id**: `string`
|
|
30
|
+
|
|
31
|
+
External User ID
|
|
32
|
+
|
|
41
33
|
#### public\_username
|
|
42
34
|
|
|
43
35
|
> **public\_username**: `string`
|
|
44
36
|
|
|
37
|
+
Public username
|
|
38
|
+
|
|
45
39
|
#### avatar\_id
|
|
46
40
|
|
|
47
41
|
> **avatar\_id**: `string`
|
|
48
42
|
|
|
43
|
+
Avatar ID
|
|
44
|
+
|
|
49
45
|
#### avatar\_real\_id
|
|
50
46
|
|
|
51
47
|
> **avatar\_real\_id**: `number`
|
|
52
48
|
|
|
49
|
+
Avatar real ID
|
|
50
|
+
|
|
53
51
|
#### avatar\_url?
|
|
54
52
|
|
|
55
53
|
> `optional` **avatar\_url?**: `string`
|
|
56
54
|
|
|
55
|
+
Avatar URL
|
|
56
|
+
|
|
57
57
|
#### position
|
|
58
58
|
|
|
59
59
|
> **position**: `number`
|
|
60
60
|
|
|
61
|
+
Position in the leaderboard
|
|
62
|
+
|
|
61
63
|
#### scores
|
|
62
64
|
|
|
63
65
|
> **scores**: `number`
|
|
64
66
|
|
|
67
|
+
Score of the player
|
|
68
|
+
|
|
65
69
|
#### is\_me
|
|
66
70
|
|
|
67
71
|
> **is\_me**: `boolean`
|
|
68
72
|
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
> **clean\_ext\_user\_id**: `string`
|
|
73
|
+
Indicator if record is the current user
|
|
@@ -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
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
> Returns the ranked players of a specific clan within a clan-based tournament instance.
|
|
4
4
|
> Import: `import { TClanTournamentPlayers } from '@smartico/public-api'`
|
|
5
|
-
> Search terms: getClanTournamentPlayers, tournaments, TClanTournamentPlayers
|
|
5
|
+
> Search terms: getClanTournamentPlayers, tournaments, TClanTournamentPlayers, Smartico, User, External, Public, Avatar, Position, Score, Indicator
|
|
6
6
|
|
|
7
7
|
## Signature
|
|
8
8
|
```ts
|
|
@@ -15,18 +15,26 @@ _smartico.api.getClanTournamentPlayers(tournamentInstanceId: number, clanId: num
|
|
|
15
15
|
|
|
16
16
|
## Returns — `Promise<TClanTournamentPlayers>`
|
|
17
17
|
`TClanTournamentPlayers`:
|
|
18
|
-
- `
|
|
19
|
-
- `clan_public_meta` ({ name: string; image_url: string }) — Clan display metadata
|
|
18
|
+
- `tournament_instance_id` (number) — Tournament instance ID
|
|
20
19
|
- `players` ({
|
|
20
|
+
/** Smartico User ID */
|
|
21
21
|
user_id: number;
|
|
22
|
+
/** External User ID */
|
|
23
|
+
clean_ext_user_id: string;
|
|
24
|
+
/** Public username */
|
|
22
25
|
public_username: string;
|
|
26
|
+
/** Avatar ID */
|
|
23
27
|
avatar_id: string;
|
|
28
|
+
/** Avatar real ID */
|
|
24
29
|
avatar_real_id: number;
|
|
30
|
+
/** Avatar URL */
|
|
25
31
|
avatar_url?: string;
|
|
32
|
+
/** Position in the leaderboard */
|
|
26
33
|
position: number;
|
|
34
|
+
/** Score of the player */
|
|
27
35
|
scores: number;
|
|
36
|
+
/** Indicator if record is the current user */
|
|
28
37
|
is_me: boolean;
|
|
29
|
-
clean_ext_user_id: string;
|
|
30
38
|
}[]) — Top players of this clan ranked by score DESC
|
|
31
39
|
|
|
32
40
|
## Behavioral contract
|
|
@@ -51,16 +59,13 @@ non-clan tournament typically returns an empty `players` array.
|
|
|
51
59
|
polling cadence.
|
|
52
60
|
|
|
53
61
|
**Returned shape**
|
|
54
|
-
`TClanTournamentPlayers` carries the
|
|
55
|
-
(`clan_id`, `clan_public_meta.name`, `clan_public_meta.image_url`)
|
|
62
|
+
`TClanTournamentPlayers` carries the `tournament_instance_id`
|
|
56
63
|
alongside the `players[]` array — each entry has `position`,
|
|
57
64
|
`scores`, `public_username`, `clean_ext_user_id`, `avatar_id`,
|
|
58
65
|
`avatar_real_id`, the resolved `avatar_url`, `user_id`, and the
|
|
59
|
-
`is_me` flag identifying the current user's row. The
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
caller-side `ClanLeaderboardEntry` object, but they're available
|
|
63
|
-
for consumers that don't already have that context.
|
|
66
|
+
`is_me` flag identifying the current user's row. The response does
|
|
67
|
+
NOT echo the clan's identity — render the clan header from the
|
|
68
|
+
caller-side `ClanLeaderboardEntry` object you passed in.
|
|
64
69
|
|
|
65
70
|
**Username display**: prefer `clean_ext_user_id` when set, falling
|
|
66
71
|
back to `public_username`. The default Smartico UI uses
|
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;
|
|
@@ -15,36 +16,16 @@ export interface ClanTournamentPlayerRaw {
|
|
|
15
16
|
}
|
|
16
17
|
|
|
17
18
|
export interface GetClanTournamentPlayersResponse extends ProtocolResponse {
|
|
18
|
-
|
|
19
|
-
clan_public_meta: { name: string; image_url: string };
|
|
19
|
+
tournament_instance_id: number;
|
|
20
20
|
players: ClanTournamentPlayerRaw[];
|
|
21
21
|
}
|
|
22
22
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
avatar_id: string;
|
|
28
|
-
avatar_real_id: number;
|
|
29
|
-
avatar_url?: string;
|
|
30
|
-
position: number;
|
|
31
|
-
scores: number;
|
|
32
|
-
is_me: boolean;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
export interface TClanTournamentPlayersResult {
|
|
36
|
-
clan_id: number;
|
|
37
|
-
clan_public_meta: { name: string; image_url: string };
|
|
38
|
-
players: TClanTournamentPlayer[];
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
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 => {
|
|
42
27
|
return {
|
|
43
|
-
|
|
44
|
-
clan_public_meta: {
|
|
45
|
-
name: response.clan_public_meta.name,
|
|
46
|
-
image_url: response.clan_public_meta.image_url,
|
|
47
|
-
},
|
|
28
|
+
tournament_instance_id: response.tournament_instance_id,
|
|
48
29
|
players: (response.players || []).map((p) => ({
|
|
49
30
|
user_id: p.userId,
|
|
50
31
|
clean_ext_user_id: p.cleanExtUserId,
|
|
@@ -288,16 +288,13 @@ export class WSAPITournaments extends WSAPIStore {
|
|
|
288
288
|
* polling cadence.
|
|
289
289
|
*
|
|
290
290
|
* **Returned shape**
|
|
291
|
-
* `TClanTournamentPlayers` carries the
|
|
292
|
-
* (`clan_id`, `clan_public_meta.name`, `clan_public_meta.image_url`)
|
|
291
|
+
* `TClanTournamentPlayers` carries the `tournament_instance_id`
|
|
293
292
|
* alongside the `players[]` array — each entry has `position`,
|
|
294
293
|
* `scores`, `public_username`, `clean_ext_user_id`, `avatar_id`,
|
|
295
294
|
* `avatar_real_id`, the resolved `avatar_url`, `user_id`, and the
|
|
296
|
-
* `is_me` flag identifying the current user's row. The
|
|
297
|
-
*
|
|
298
|
-
*
|
|
299
|
-
* caller-side `ClanLeaderboardEntry` object, but they're available
|
|
300
|
-
* for consumers that don't already have that context.
|
|
295
|
+
* `is_me` flag identifying the current user's row. The response does
|
|
296
|
+
* NOT echo the clan's identity — render the clan header from the
|
|
297
|
+
* caller-side `ClanLeaderboardEntry` object you passed in.
|
|
301
298
|
*
|
|
302
299
|
* **Username display**: prefer `clean_ext_user_id` when set, falling
|
|
303
300
|
* back to `public_username`. The default Smartico UI uses
|
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 */
|
|
@@ -574,21 +578,28 @@ export interface TTournamentDetailed extends TTournament {
|
|
|
574
578
|
* TClanTournamentPlayers describes the players of a specific clan in a clan-based tournament.
|
|
575
579
|
*/
|
|
576
580
|
export interface TClanTournamentPlayers {
|
|
577
|
-
/**
|
|
578
|
-
|
|
579
|
-
/** Clan display metadata */
|
|
580
|
-
clan_public_meta: { name: string; image_url: string };
|
|
581
|
+
/** Tournament instance ID */
|
|
582
|
+
tournament_instance_id: number;
|
|
581
583
|
/** Top players of this clan ranked by score DESC */
|
|
582
584
|
players: {
|
|
585
|
+
/** Smartico User ID */
|
|
583
586
|
user_id: number;
|
|
587
|
+
/** External User ID */
|
|
588
|
+
clean_ext_user_id: string;
|
|
589
|
+
/** Public username */
|
|
584
590
|
public_username: string;
|
|
591
|
+
/** Avatar ID */
|
|
585
592
|
avatar_id: string;
|
|
593
|
+
/** Avatar real ID */
|
|
586
594
|
avatar_real_id: number;
|
|
595
|
+
/** Avatar URL */
|
|
587
596
|
avatar_url?: string;
|
|
597
|
+
/** Position in the leaderboard */
|
|
588
598
|
position: number;
|
|
599
|
+
/** Score of the player */
|
|
589
600
|
scores: number;
|
|
601
|
+
/** Indicator if record is the current user */
|
|
590
602
|
is_me: boolean;
|
|
591
|
-
clean_ext_user_id: string;
|
|
592
603
|
}[];
|
|
593
604
|
}
|
|
594
605
|
|
|
@@ -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`
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
# Interface: TClanTournamentPlayersResult
|
|
2
|
-
|
|
3
|
-
## Properties
|
|
4
|
-
|
|
5
|
-
### clan\_id
|
|
6
|
-
|
|
7
|
-
> **clan\_id**: `number`
|
|
8
|
-
|
|
9
|
-
***
|
|
10
|
-
|
|
11
|
-
### clan\_public\_meta
|
|
12
|
-
|
|
13
|
-
> **clan\_public\_meta**: `object`
|
|
14
|
-
|
|
15
|
-
#### name
|
|
16
|
-
|
|
17
|
-
> **name**: `string`
|
|
18
|
-
|
|
19
|
-
#### image\_url
|
|
20
|
-
|
|
21
|
-
> **image\_url**: `string`
|
|
22
|
-
|
|
23
|
-
***
|
|
24
|
-
|
|
25
|
-
### players
|
|
26
|
-
|
|
27
|
-
> **players**: [`TClanTournamentPlayer`](TClanTournamentPlayer.md)[]
|