Skip to content

Commit 66d9a56

Browse files
authored
ci: update api (#51)
1 parent 5c46db7 commit 66d9a56

8 files changed

Lines changed: 112 additions & 95 deletions

File tree

specs/lichess-api.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
openapi: "3.1.0"
22
info:
3-
version: 2.0.144
3+
version: 2.0.145
44
title: Lichess.org API reference
55
contact:
66
name: "Lichess.org API"

specs/schemas/BroadcastForm.yaml

Lines changed: 30 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -8,45 +8,8 @@ properties:
88
Name of the broadcast tournament.
99
1010
Example: `Sinquefield Cup`
11-
info.format:
12-
type: string
13-
maxLength: 80
14-
description: |
15-
Tournament format.
16-
Example: `"8-player round-robin" or "5-round Swiss"`
17-
info.location:
18-
type: string
19-
maxLength: 80
20-
description: |
21-
Tournament Location
22-
info.tc:
23-
type: string
24-
maxLength: 80
25-
description: |
26-
Time control.
27-
Example: `"Classical" or "Rapid" or "Rapid & Blitz"`
28-
info.fideTC:
29-
$ref: "./FideTimeControl.yaml"
30-
info.timeZone:
31-
type: string
32-
description: |
33-
Timezone of the tournament. Example: `America/New_York`.
34-
See [list of possible timezone identifiers](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones) for more.
35-
info.players:
36-
type: string
37-
maxLength: 120
38-
description: |
39-
Mention up to 4 of the best players participating.
40-
info.website:
41-
type: string
42-
format: uri
43-
description: |
44-
Official website. External website URL
45-
info.standings:
46-
type: string
47-
format: uri
48-
description: |
49-
Official Standings. External website URL, e.g. chess-results.com, info64.org
11+
info:
12+
$ref: "./BroadcastTourInfo.yaml"
5013
markdown:
5114
type: string
5215
maxLength: 20000
@@ -138,11 +101,38 @@ properties:
138101
* `3` for Official: normal tier
139102
* `4` for Official: high tier
140103
* `5` for Official: best tier
141-
tiebreaks[]:
104+
tiebreaks:
142105
type: array
143106
maxItems: 5
144107
items:
145108
$ref: "./BroadcastTiebreakExtendedCode.yaml"
109+
grouping:
110+
type: object
111+
description: |
112+
Group this broadcast along with others
113+
properties:
114+
info:
115+
type: object
116+
properties:
117+
name:
118+
type: string
119+
description: Name of the group
120+
example: "Chess Olympiad | Open"
121+
tours:
122+
type: string
123+
description: |
124+
A comma separated list of tournament IDs to group together.
125+
example: wYigbpXq,M5YHvpOX,q6ezoCXP
126+
scoreGroups:
127+
type: array
128+
maxItems: 10
129+
items:
130+
type: string
131+
description: |
132+
A comma separated list of tournament IDs to group together for scoring purposes
133+
Cannot overlap with other score groups.
134+
Can only use groups mentioned in `info.tours`.
135+
example: wYigbpXq,M5YHvpOX
146136

147137
required:
148138
- name

specs/schemas/BroadcastTour.yaml

Lines changed: 1 addition & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -20,37 +20,7 @@ properties:
2020
maxItems: 2
2121
example: [1722169800000, 1722666600000]
2222
info:
23-
type: object
24-
description: "Additional display information about the tournament"
25-
properties:
26-
website:
27-
type: string
28-
format: uri
29-
description: "Official website. External website URL"
30-
players:
31-
type: string
32-
description: "Featured players"
33-
location:
34-
type: string
35-
description: "Tournament location"
36-
tc:
37-
type: string
38-
description: "Time control"
39-
fideTC:
40-
description: "FIDE rating category"
41-
$ref: "./FideTimeControl.yaml"
42-
timeZone:
43-
type: string
44-
description: |
45-
Timezone of the tournament. Example: `America/New_York`.
46-
See [list of possible timezone identifiers](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones) for more.
47-
standings:
48-
type: string
49-
format: uri
50-
description: "Official standings website. External website URL"
51-
format:
52-
type: string
53-
description: "Tournament format"
23+
$ref: "./BroadcastTourInfo.yaml"
5424
tier:
5525
type: integer
5626
description: "Used to designate featured tournaments on Lichess"
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
type: object
2+
description: "Additional display information about the tournament"
3+
properties:
4+
format:
5+
type: string
6+
maxLength: 80
7+
description: |
8+
Tournament format.
9+
Example: `"8-player round-robin" or "5-round Swiss"`
10+
tc:
11+
type: string
12+
description: |
13+
Time control.
14+
Example: `"Classical" or "Rapid" or "Rapid & Blitz"`
15+
fideTC:
16+
$ref: "./FideTimeControl.yaml"
17+
timeZone:
18+
type: string
19+
description: |
20+
Timezone of the tournament. Example: `America/New_York`.
21+
See [list of possible timezone identifiers](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones) for more.
22+
location:
23+
type: string
24+
maxLength: 80
25+
description: "Tournament location"
26+
players:
27+
type: string
28+
maxLength: 120
29+
description: |
30+
Mentioning up to 4 of the best players participating.
31+
website:
32+
type: string
33+
format: uri
34+
description: Official website. External website URL
35+
standings:
36+
type: string
37+
format: uri
38+
description: |
39+
Official standings website. External website URL, e.g. chess-results.com, info64.org
40+
regulations:
41+
type: string
42+
format: uri
43+
description: |
44+
External URL to the official tournament regulations.

src/schemas/BroadcastForm.ts

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,11 @@
11
import * as z from "minizod";
22

33
import { BroadcastTiebreakExtendedCode } from "./BroadcastTiebreakExtendedCode";
4-
import { FideTimeControl } from "./FideTimeControl";
4+
import { BroadcastTourInfo } from "./BroadcastTourInfo";
55

66
const BroadcastForm = z.object({
77
name: z.string().check(z.minLength(3)).check(z.maxLength(80)),
8-
"info.format": z.optional(z.string().check(z.maxLength(80))),
9-
"info.location": z.optional(z.string().check(z.maxLength(80))),
10-
"info.tc": z.optional(z.string().check(z.maxLength(80))),
11-
"info.fideTC": z.optional(FideTimeControl),
12-
"info.timeZone": z.optional(z.string()),
13-
"info.players": z.optional(z.string().check(z.maxLength(120))),
14-
"info.website": z.optional(z.url()),
15-
"info.standings": z.optional(z.url()),
8+
info: z.optional(BroadcastTourInfo),
169
markdown: z.optional(z.string().check(z.maxLength(20000))),
1710
showScores: z.optional(z.boolean()),
1811
showRatingDiffs: z.optional(z.boolean()),
@@ -21,9 +14,20 @@ const BroadcastForm = z.object({
2114
players: z.optional(z.string()),
2215
teams: z.optional(z.string()),
2316
tier: z.optional(z.literal([3, 4, 5])),
24-
"tiebreaks[]": z.optional(
17+
tiebreaks: z.optional(
2518
z.array(BroadcastTiebreakExtendedCode).check(z.maxLength(5)),
2619
),
20+
grouping: z.optional(
21+
z.object({
22+
info: z.optional(
23+
z.object({
24+
name: z.optional(z.string()),
25+
tours: z.optional(z.string()),
26+
}),
27+
),
28+
scoreGroups: z.optional(z.array(z.string()).check(z.maxLength(10))),
29+
}),
30+
),
2731
});
2832

2933
type BroadcastForm = z.infer<typeof BroadcastForm>;

src/schemas/BroadcastTour.ts

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import * as z from "minizod";
22

3-
import { FideTimeControl } from "./FideTimeControl";
3+
import { BroadcastTourInfo } from "./BroadcastTourInfo";
44
import { LightUser } from "./LightUser";
55

66
const BroadcastTour = z.object({
@@ -11,18 +11,7 @@ const BroadcastTour = z.object({
1111
dates: z.optional(
1212
z.array(z.int()).check(z.minLength(1)).check(z.maxLength(2)),
1313
),
14-
info: z.optional(
15-
z.object({
16-
website: z.optional(z.url()),
17-
players: z.optional(z.string()),
18-
location: z.optional(z.string()),
19-
tc: z.optional(z.string()),
20-
fideTC: z.optional(FideTimeControl),
21-
timeZone: z.optional(z.string()),
22-
standings: z.optional(z.url()),
23-
format: z.optional(z.string()),
24-
}),
25-
),
14+
info: z.optional(BroadcastTourInfo),
2615
tier: z.optional(z.int()),
2716
image: z.optional(z.url()),
2817
description: z.optional(z.string()),

src/schemas/BroadcastTourInfo.ts

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
import * as z from "minizod";
2+
3+
import { FideTimeControl } from "./FideTimeControl";
4+
5+
const BroadcastTourInfo = z.object({
6+
format: z.optional(z.string().check(z.maxLength(80))),
7+
tc: z.optional(z.string()),
8+
fideTC: z.optional(FideTimeControl),
9+
timeZone: z.optional(z.string()),
10+
location: z.optional(z.string().check(z.maxLength(80))),
11+
players: z.optional(z.string().check(z.maxLength(120))),
12+
website: z.optional(z.url()),
13+
standings: z.optional(z.url()),
14+
regulations: z.optional(z.url()),
15+
});
16+
17+
type BroadcastTourInfo = z.infer<typeof BroadcastTourInfo>;
18+
19+
export { BroadcastTourInfo };

src/schemas/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ export { BroadcastTeamPOVMatchEntry } from "./BroadcastTeamPOVMatchEntry";
3838
export { BroadcastTiebreakExtendedCode } from "./BroadcastTiebreakExtendedCode";
3939
export { BroadcastTop } from "./BroadcastTop";
4040
export { BroadcastTour } from "./BroadcastTour";
41+
export { BroadcastTourInfo } from "./BroadcastTourInfo";
4142
export { BroadcastWithLastRound } from "./BroadcastWithLastRound";
4243
export { BroadcastWithRounds } from "./BroadcastWithRounds";
4344
export { BroadcastWithRoundsAndFullGroup } from "./BroadcastWithRoundsAndFullGroup";

0 commit comments

Comments
 (0)