@smartico/public-api 0.0.405 → 0.0.408
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/Tournaments/GetClanTournamentPlayersResponse.d.ts +2 -10
- package/dist/WSAPI/WSAPITournaments.d.ts +4 -7
- package/dist/WSAPI/WSAPITypes.d.ts +12 -8
- package/dist/index.js +5 -12
- package/dist/index.js.map +1 -1
- package/dist/index.modern.mjs +5 -12
- package/dist/index.modern.mjs.map +1 -1
- package/docs/api/classes/WSAPITournaments.md +4 -7
- 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/api/interfaces/TClanTournamentPlayersResult.md +2 -16
- package/docs/capabilities/getClanTournamentPlayers.md +16 -11
- package/package.json +1 -1
- package/src/Tournaments/GetClanTournamentPlayersResponse.ts +3 -9
- package/src/WSAPI/WSAPITournaments.ts +4 -7
- package/src/WSAPI/WSAPITypes.ts +12 -5
|
@@ -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
|
|
@@ -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
|
|
@@ -2,23 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
## Properties
|
|
4
4
|
|
|
5
|
-
###
|
|
5
|
+
### tournament\_instance\_id
|
|
6
6
|
|
|
7
|
-
> **
|
|
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`
|
|
7
|
+
> **tournament\_instance\_id**: `number`
|
|
22
8
|
|
|
23
9
|
***
|
|
24
10
|
|
|
@@ -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
|
@@ -15,8 +15,7 @@ export interface ClanTournamentPlayerRaw {
|
|
|
15
15
|
}
|
|
16
16
|
|
|
17
17
|
export interface GetClanTournamentPlayersResponse extends ProtocolResponse {
|
|
18
|
-
|
|
19
|
-
clan_public_meta: { name: string; image_url: string };
|
|
18
|
+
tournament_instance_id: number;
|
|
20
19
|
players: ClanTournamentPlayerRaw[];
|
|
21
20
|
}
|
|
22
21
|
|
|
@@ -33,18 +32,13 @@ export interface TClanTournamentPlayer {
|
|
|
33
32
|
}
|
|
34
33
|
|
|
35
34
|
export interface TClanTournamentPlayersResult {
|
|
36
|
-
|
|
37
|
-
clan_public_meta: { name: string; image_url: string };
|
|
35
|
+
tournament_instance_id: number;
|
|
38
36
|
players: TClanTournamentPlayer[];
|
|
39
37
|
}
|
|
40
38
|
|
|
41
39
|
export const clanTournamentPlayersTransform = (response: GetClanTournamentPlayersResponse): TClanTournamentPlayersResult => {
|
|
42
40
|
return {
|
|
43
|
-
|
|
44
|
-
clan_public_meta: {
|
|
45
|
-
name: response.clan_public_meta.name,
|
|
46
|
-
image_url: response.clan_public_meta.image_url,
|
|
47
|
-
},
|
|
41
|
+
tournament_instance_id: response.tournament_instance_id,
|
|
48
42
|
players: (response.players || []).map((p) => ({
|
|
49
43
|
user_id: p.userId,
|
|
50
44
|
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
|
@@ -574,21 +574,28 @@ export interface TTournamentDetailed extends TTournament {
|
|
|
574
574
|
* TClanTournamentPlayers describes the players of a specific clan in a clan-based tournament.
|
|
575
575
|
*/
|
|
576
576
|
export interface TClanTournamentPlayers {
|
|
577
|
-
/**
|
|
578
|
-
|
|
579
|
-
/** Clan display metadata */
|
|
580
|
-
clan_public_meta: { name: string; image_url: string };
|
|
577
|
+
/** Tournament instance ID */
|
|
578
|
+
tournament_instance_id: number;
|
|
581
579
|
/** Top players of this clan ranked by score DESC */
|
|
582
580
|
players: {
|
|
581
|
+
/** Smartico User ID */
|
|
583
582
|
user_id: number;
|
|
583
|
+
/** External User ID */
|
|
584
|
+
clean_ext_user_id: string;
|
|
585
|
+
/** Public username */
|
|
584
586
|
public_username: string;
|
|
587
|
+
/** Avatar ID */
|
|
585
588
|
avatar_id: string;
|
|
589
|
+
/** Avatar real ID */
|
|
586
590
|
avatar_real_id: number;
|
|
591
|
+
/** Avatar URL */
|
|
587
592
|
avatar_url?: string;
|
|
593
|
+
/** Position in the leaderboard */
|
|
588
594
|
position: number;
|
|
595
|
+
/** Score of the player */
|
|
589
596
|
scores: number;
|
|
597
|
+
/** Indicator if record is the current user */
|
|
590
598
|
is_me: boolean;
|
|
591
|
-
clean_ext_user_id: string;
|
|
592
599
|
}[];
|
|
593
600
|
}
|
|
594
601
|
|