@lichess-org/types 2.0.27 → 2.0.28
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/lichess-api.d.ts +197 -46
- package/package.json +4 -4
package/lichess-api.d.ts
CHANGED
|
@@ -251,6 +251,26 @@ export interface paths {
|
|
|
251
251
|
patch?: never;
|
|
252
252
|
trace?: never;
|
|
253
253
|
};
|
|
254
|
+
"/api/puzzle/replay/{days}/{theme}": {
|
|
255
|
+
parameters: {
|
|
256
|
+
query?: never;
|
|
257
|
+
header?: never;
|
|
258
|
+
path?: never;
|
|
259
|
+
cookie?: never;
|
|
260
|
+
};
|
|
261
|
+
/**
|
|
262
|
+
* Get puzzles to replay
|
|
263
|
+
* @description Gets the puzzle IDs of remaining puzzles to re-attempt in JSON format.
|
|
264
|
+
*/
|
|
265
|
+
get: operations["apiPuzzleReplay"];
|
|
266
|
+
put?: never;
|
|
267
|
+
post?: never;
|
|
268
|
+
delete?: never;
|
|
269
|
+
options?: never;
|
|
270
|
+
head?: never;
|
|
271
|
+
patch?: never;
|
|
272
|
+
trace?: never;
|
|
273
|
+
};
|
|
254
274
|
"/api/puzzle/dashboard/{days}": {
|
|
255
275
|
parameters: {
|
|
256
276
|
query?: never;
|
|
@@ -2434,19 +2454,19 @@ export interface paths {
|
|
|
2434
2454
|
};
|
|
2435
2455
|
/**
|
|
2436
2456
|
* Stream incoming events
|
|
2437
|
-
* @description
|
|
2438
|
-
* Stream the events reaching a lichess user in real time as [ndjson](#section/Introduction/Streaming-with-ND-JSON).
|
|
2457
|
+
* @description Stream the events reaching a lichess user in real time as [ndjson](#section/Introduction/Streaming-with-ND-JSON).
|
|
2439
2458
|
*
|
|
2440
|
-
*
|
|
2459
|
+
* An empty line is sent every 6 seconds for keep alive purposes.
|
|
2441
2460
|
*
|
|
2442
|
-
*
|
|
2443
|
-
*
|
|
2444
|
-
*
|
|
2445
|
-
*
|
|
2446
|
-
*
|
|
2447
|
-
*
|
|
2461
|
+
* Each non-empty line is a JSON object containing a `type` field. Possible values are:
|
|
2462
|
+
* - `gameStart` Start of a game
|
|
2463
|
+
* - `gameFinish` Completion of a game
|
|
2464
|
+
* - `challenge` A player sends you a challenge or you challenge someone
|
|
2465
|
+
* - `challengeCanceled` A player cancels their challenge to you
|
|
2466
|
+
* - `challengeDeclined` The opponent declines your challenge
|
|
2467
|
+
*
|
|
2468
|
+
* When the stream opens, all current challenges and games are sent.
|
|
2448
2469
|
*
|
|
2449
|
-
* When the stream opens, all current challenges and games are sent.
|
|
2450
2470
|
*/
|
|
2451
2471
|
get: operations["apiStreamEvent"];
|
|
2452
2472
|
put?: never;
|
|
@@ -2468,25 +2488,27 @@ export interface paths {
|
|
|
2468
2488
|
put?: never;
|
|
2469
2489
|
/**
|
|
2470
2490
|
* Create a seek
|
|
2471
|
-
* @description
|
|
2472
|
-
*
|
|
2491
|
+
* @description Create a public seek, to start a game with a random player.
|
|
2492
|
+
*
|
|
2493
|
+
* ### Real-time seek
|
|
2473
2494
|
*
|
|
2474
|
-
*
|
|
2495
|
+
* Specify the `time` and `increment` clock values.
|
|
2496
|
+
* The response is streamed but doesn't contain any information.
|
|
2475
2497
|
*
|
|
2476
|
-
*
|
|
2498
|
+
* **Keep the connection open to keep the seek active**.
|
|
2477
2499
|
*
|
|
2478
|
-
*
|
|
2500
|
+
* If the client closes the connection, the seek is canceled. This way, if the client terminates, the user won't be paired in a game they wouldn't play.
|
|
2501
|
+
* When the seek is accepted, or expires, the server closes the connection.
|
|
2479
2502
|
*
|
|
2480
|
-
*
|
|
2481
|
-
*
|
|
2503
|
+
* **Make sure to also have an [Event stream](#operation/apiStreamEvent) open**, to be notified when a game starts.
|
|
2504
|
+
* We recommend opening the [Event stream](#operation/apiStreamEvent) first, then the seek stream. This way,
|
|
2505
|
+
* you won't miss the game event if the seek is accepted immediately.
|
|
2482
2506
|
*
|
|
2483
|
-
*
|
|
2484
|
-
* We recommend opening the [Event stream](#operation/apiStreamEvent) first, then the seek stream. This way,
|
|
2485
|
-
* you won't miss the game event if the seek is accepted immediately.
|
|
2507
|
+
* ### Correspondence seek
|
|
2486
2508
|
*
|
|
2487
|
-
*
|
|
2509
|
+
* Specify the `days` per turn value.
|
|
2510
|
+
* The response is not streamed, it immediately completes with the seek ID. The seek remains active on the server until it is joined by someone.
|
|
2488
2511
|
*
|
|
2489
|
-
* Specify the `days` per turn value. The response is not streamed, it immediately completes with the seek ID. The seek remains active on the server until it is joined by someone.
|
|
2490
2512
|
*/
|
|
2491
2513
|
post: operations["apiBoardSeek"];
|
|
2492
2514
|
delete?: never;
|
|
@@ -2504,7 +2526,7 @@ export interface paths {
|
|
|
2504
2526
|
};
|
|
2505
2527
|
/**
|
|
2506
2528
|
* Stream Board game state
|
|
2507
|
-
* @description
|
|
2529
|
+
* @description Stream the state of a game being played with the Board API, as [ndjson](#section/Introduction/Streaming-with-ND-JSON).
|
|
2508
2530
|
*
|
|
2509
2531
|
* Use this endpoint to get updates about the game in real-time, with a single request.
|
|
2510
2532
|
*
|
|
@@ -2512,14 +2534,12 @@ export interface paths {
|
|
|
2512
2534
|
* - `gameFull` Full game data. All values are immutable, except for the `state` field.
|
|
2513
2535
|
* - `gameState` Current state of the game. Immutable values not included. Sent when a move is played, a draw is offered, or when the game ends.
|
|
2514
2536
|
* - `chatLine` Chat message sent by a user in the `room` "player" or "spectator".
|
|
2515
|
-
*
|
|
2516
2537
|
* - `opponentGone` Whether the opponent has left the game, and how long before you can claim a win or draw.
|
|
2517
2538
|
*
|
|
2518
|
-
*
|
|
2519
2539
|
* The first line is always of type `gameFull`.
|
|
2520
2540
|
*
|
|
2521
|
-
*
|
|
2522
2541
|
* The server closes the stream when the game ends, or if the game has already ended.
|
|
2542
|
+
*
|
|
2523
2543
|
*/
|
|
2524
2544
|
get: operations["boardGameStream"];
|
|
2525
2545
|
put?: never;
|
|
@@ -2767,19 +2787,15 @@ export interface paths {
|
|
|
2767
2787
|
};
|
|
2768
2788
|
/**
|
|
2769
2789
|
* Stream Bot game state
|
|
2770
|
-
* @description
|
|
2771
|
-
*
|
|
2790
|
+
* @description Stream the state of a game being played with the Bot API, as [ndjson](#section/Introduction/Streaming-with-ND-JSON).
|
|
2772
2791
|
* Use this endpoint to get updates about the game in real-time, with a single request.
|
|
2773
|
-
*
|
|
2774
2792
|
* Each line is a JSON object containing a `type` field. Possible values are:
|
|
2775
|
-
*
|
|
2776
|
-
*
|
|
2777
|
-
*
|
|
2778
|
-
*
|
|
2779
|
-
* - `opponentGone` Whether the opponent has left the game, and how long before you can claim a win or draw.
|
|
2780
|
-
*
|
|
2781
|
-
*
|
|
2793
|
+
* - `gameFull` Full game data. All values are immutable, except for the `state` field.
|
|
2794
|
+
* - `gameState` Current state of the game. Immutable values not included.
|
|
2795
|
+
* - `chatLine` Chat message sent by a user (or the bot itself) in the `room` "player" or "spectator".
|
|
2796
|
+
* - `opponentGone` Whether the opponent has left the game, and how long before you can claim a win or draw.
|
|
2782
2797
|
* The first line is always of type `gameFull`.
|
|
2798
|
+
*
|
|
2783
2799
|
*/
|
|
2784
2800
|
get: operations["botGameStream"];
|
|
2785
2801
|
put?: never;
|
|
@@ -4078,11 +4094,6 @@ export interface components {
|
|
|
4078
4094
|
* @example false
|
|
4079
4095
|
*/
|
|
4080
4096
|
blocking?: boolean;
|
|
4081
|
-
/**
|
|
4082
|
-
* @description only appears if the request is [authenticated with OAuth2](#section/Introduction/Authentication)
|
|
4083
|
-
* @example false
|
|
4084
|
-
*/
|
|
4085
|
-
followsYou?: boolean;
|
|
4086
4097
|
};
|
|
4087
4098
|
/** @example [
|
|
4088
4099
|
* {
|
|
@@ -4606,6 +4617,35 @@ export interface components {
|
|
|
4606
4617
|
};
|
|
4607
4618
|
win: boolean;
|
|
4608
4619
|
};
|
|
4620
|
+
/** @example {
|
|
4621
|
+
* "replay": {
|
|
4622
|
+
* "days": 30,
|
|
4623
|
+
* "theme": "opening",
|
|
4624
|
+
* "nb": 2,
|
|
4625
|
+
* "remaining": [
|
|
4626
|
+
* "M5KzH",
|
|
4627
|
+
* "prIYT"
|
|
4628
|
+
* ]
|
|
4629
|
+
* },
|
|
4630
|
+
* "angle": {
|
|
4631
|
+
* "key": "opening",
|
|
4632
|
+
* "name": "Opening",
|
|
4633
|
+
* "desc": "A tactic during the first phase of the game."
|
|
4634
|
+
* }
|
|
4635
|
+
* } */
|
|
4636
|
+
PuzzleReplay: {
|
|
4637
|
+
replay: {
|
|
4638
|
+
days: number;
|
|
4639
|
+
theme: string;
|
|
4640
|
+
nb: number;
|
|
4641
|
+
remaining: string[];
|
|
4642
|
+
};
|
|
4643
|
+
angle: {
|
|
4644
|
+
key: string;
|
|
4645
|
+
name: string;
|
|
4646
|
+
desc: string;
|
|
4647
|
+
};
|
|
4648
|
+
};
|
|
4609
4649
|
PuzzlePerformance: {
|
|
4610
4650
|
firstWins: number;
|
|
4611
4651
|
nb: number;
|
|
@@ -5673,6 +5713,8 @@ export interface components {
|
|
|
5673
5713
|
minRatedGames?: {
|
|
5674
5714
|
nb?: number;
|
|
5675
5715
|
};
|
|
5716
|
+
botsAllowed?: boolean;
|
|
5717
|
+
minAccountAgeInDays?: number;
|
|
5676
5718
|
onlyTitled?: boolean;
|
|
5677
5719
|
teamMember?: string;
|
|
5678
5720
|
private?: boolean;
|
|
@@ -5967,6 +6009,14 @@ export interface components {
|
|
|
5967
6009
|
};
|
|
5968
6010
|
/** @description List of usernames allowed to join the tournament */
|
|
5969
6011
|
allowList?: string[];
|
|
6012
|
+
hasMaxRating?: boolean;
|
|
6013
|
+
maxRating?: components["schemas"]["ArenaRatingObj"];
|
|
6014
|
+
minRating?: components["schemas"]["ArenaRatingObj"];
|
|
6015
|
+
minRatedGames?: {
|
|
6016
|
+
nb?: number;
|
|
6017
|
+
};
|
|
6018
|
+
botsAllowed?: boolean;
|
|
6019
|
+
minAccountAgeInDays?: number;
|
|
5970
6020
|
perf?: {
|
|
5971
6021
|
icon: string;
|
|
5972
6022
|
key: string;
|
|
@@ -6052,6 +6102,12 @@ export interface components {
|
|
|
6052
6102
|
* @default rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1
|
|
6053
6103
|
*/
|
|
6054
6104
|
SwissFromPositionFEN: string;
|
|
6105
|
+
/**
|
|
6106
|
+
* @description The current state of the swiss tournament
|
|
6107
|
+
* @example created
|
|
6108
|
+
* @enum {string}
|
|
6109
|
+
*/
|
|
6110
|
+
SwissStatus: "created" | "started" | "finished";
|
|
6055
6111
|
/** @example {
|
|
6056
6112
|
* "clock": {
|
|
6057
6113
|
* "increment": 0,
|
|
@@ -6105,7 +6161,7 @@ export interface components {
|
|
|
6105
6161
|
nbRounds: number;
|
|
6106
6162
|
nbPlayers: number;
|
|
6107
6163
|
nbOngoing: number;
|
|
6108
|
-
status:
|
|
6164
|
+
status: components["schemas"]["SwissStatus"];
|
|
6109
6165
|
stats: {
|
|
6110
6166
|
games: number;
|
|
6111
6167
|
whiteWins: number;
|
|
@@ -7266,6 +7322,8 @@ export interface components {
|
|
|
7266
7322
|
* "binc": 10000,
|
|
7267
7323
|
* "wdraw": false,
|
|
7268
7324
|
* "bdraw": false,
|
|
7325
|
+
* "wtakeback": false,
|
|
7326
|
+
* "btakeback": false,
|
|
7269
7327
|
* "status": "started"
|
|
7270
7328
|
* } */
|
|
7271
7329
|
GameStateEvent: {
|
|
@@ -7332,6 +7390,10 @@ export interface components {
|
|
|
7332
7390
|
* "btime": 286000,
|
|
7333
7391
|
* "winc": 0,
|
|
7334
7392
|
* "binc": 0,
|
|
7393
|
+
* "wdraw": false,
|
|
7394
|
+
* "bdraw": false,
|
|
7395
|
+
* "wtakeback": false,
|
|
7396
|
+
* "btakeback": false,
|
|
7335
7397
|
* "status": "started"
|
|
7336
7398
|
* }
|
|
7337
7399
|
* } */
|
|
@@ -8526,6 +8588,44 @@ export interface operations {
|
|
|
8526
8588
|
};
|
|
8527
8589
|
};
|
|
8528
8590
|
};
|
|
8591
|
+
apiPuzzleReplay: {
|
|
8592
|
+
parameters: {
|
|
8593
|
+
query?: never;
|
|
8594
|
+
header?: never;
|
|
8595
|
+
path: {
|
|
8596
|
+
/** @description How many days to look back when aggregating puzzle results. 30 is sensible. */
|
|
8597
|
+
days: number;
|
|
8598
|
+
/** @description The theme or opening to filter puzzles with. */
|
|
8599
|
+
theme: string;
|
|
8600
|
+
};
|
|
8601
|
+
cookie?: never;
|
|
8602
|
+
};
|
|
8603
|
+
requestBody?: never;
|
|
8604
|
+
responses: {
|
|
8605
|
+
/** @description The requested puzzles to replay. */
|
|
8606
|
+
200: {
|
|
8607
|
+
headers: {
|
|
8608
|
+
"Access-Control-Allow-Origin"?: string;
|
|
8609
|
+
[name: string]: unknown;
|
|
8610
|
+
};
|
|
8611
|
+
content: {
|
|
8612
|
+
"application/json": components["schemas"]["PuzzleReplay"];
|
|
8613
|
+
};
|
|
8614
|
+
};
|
|
8615
|
+
/** @description No puzzles to replay were found */
|
|
8616
|
+
404: {
|
|
8617
|
+
headers: {
|
|
8618
|
+
[name: string]: unknown;
|
|
8619
|
+
};
|
|
8620
|
+
content: {
|
|
8621
|
+
"application/json": {
|
|
8622
|
+
/** @example No puzzles to replay */
|
|
8623
|
+
error?: string;
|
|
8624
|
+
};
|
|
8625
|
+
};
|
|
8626
|
+
};
|
|
8627
|
+
};
|
|
8628
|
+
};
|
|
8529
8629
|
apiPuzzleDashboard: {
|
|
8530
8630
|
parameters: {
|
|
8531
8631
|
query?: never;
|
|
@@ -9699,6 +9799,27 @@ export interface operations {
|
|
|
9699
9799
|
* Example: `thibault,german11,%titled`
|
|
9700
9800
|
* */
|
|
9701
9801
|
"conditions.allowList"?: string;
|
|
9802
|
+
/**
|
|
9803
|
+
* @description Whether bots are allowed to join the tournament.
|
|
9804
|
+
* @default false
|
|
9805
|
+
*/
|
|
9806
|
+
"conditions.bots"?: boolean;
|
|
9807
|
+
/**
|
|
9808
|
+
* @description Minium account age in days required to join.
|
|
9809
|
+
* @enum {integer}
|
|
9810
|
+
*/
|
|
9811
|
+
"conditions.accountAge"?:
|
|
9812
|
+
| 1
|
|
9813
|
+
| 3
|
|
9814
|
+
| 7
|
|
9815
|
+
| 14
|
|
9816
|
+
| 30
|
|
9817
|
+
| 60
|
|
9818
|
+
| 90
|
|
9819
|
+
| 180
|
|
9820
|
+
| 365
|
|
9821
|
+
| 730
|
|
9822
|
+
| 1095;
|
|
9702
9823
|
};
|
|
9703
9824
|
};
|
|
9704
9825
|
};
|
|
@@ -9949,6 +10070,27 @@ export interface operations {
|
|
|
9949
10070
|
* Example: `thibault,german11,%titled`
|
|
9950
10071
|
* */
|
|
9951
10072
|
"conditions.allowList"?: string;
|
|
10073
|
+
/**
|
|
10074
|
+
* @description Whether bots are allowed to join the tournament.
|
|
10075
|
+
* @default false
|
|
10076
|
+
*/
|
|
10077
|
+
"conditions.bots"?: boolean;
|
|
10078
|
+
/**
|
|
10079
|
+
* @description Minium account age in days required to join.
|
|
10080
|
+
* @enum {integer}
|
|
10081
|
+
*/
|
|
10082
|
+
"conditions.accountAge"?:
|
|
10083
|
+
| 1
|
|
10084
|
+
| 3
|
|
10085
|
+
| 7
|
|
10086
|
+
| 14
|
|
10087
|
+
| 30
|
|
10088
|
+
| 60
|
|
10089
|
+
| 90
|
|
10090
|
+
| 180
|
|
10091
|
+
| 365
|
|
10092
|
+
| 730
|
|
10093
|
+
| 1095;
|
|
9952
10094
|
};
|
|
9953
10095
|
};
|
|
9954
10096
|
};
|
|
@@ -11052,6 +11194,15 @@ export interface operations {
|
|
|
11052
11194
|
query?: {
|
|
11053
11195
|
/** @description How many tournaments to download. */
|
|
11054
11196
|
max?: number;
|
|
11197
|
+
/** @description [Filter] Only swiss tournaments in this current state.
|
|
11198
|
+
* */
|
|
11199
|
+
status?: components["schemas"]["SwissStatus"] & unknown;
|
|
11200
|
+
/** @description [Filter] Only swiss tournaments created by a given user.
|
|
11201
|
+
* */
|
|
11202
|
+
createdBy?: string;
|
|
11203
|
+
/** @description [Filter] Only swiss tournaments with a given name.
|
|
11204
|
+
* */
|
|
11205
|
+
name?: string;
|
|
11055
11206
|
};
|
|
11056
11207
|
header?: never;
|
|
11057
11208
|
path: {
|
|
@@ -11203,13 +11354,13 @@ export interface operations {
|
|
|
11203
11354
|
requestBody: {
|
|
11204
11355
|
content: {
|
|
11205
11356
|
"application/x-www-form-urlencoded": {
|
|
11206
|
-
/** @description Name of the new chapter.
|
|
11207
|
-
* If multiple chapters are created, the names will be infered from the PGN tags.
|
|
11208
|
-
* */
|
|
11209
|
-
name: string;
|
|
11210
11357
|
/** @description PGN to import. Can contain multiple games separated by 2 or more newlines.
|
|
11211
11358
|
* */
|
|
11212
11359
|
pgn: string;
|
|
11360
|
+
/** @description Name of the new chapter.
|
|
11361
|
+
* If not specified, or if multiple chapters are created, the names will be inferred from the PGN tags.
|
|
11362
|
+
* */
|
|
11363
|
+
name?: string;
|
|
11213
11364
|
/**
|
|
11214
11365
|
* @description Default board orientation.
|
|
11215
11366
|
* @default white
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lichess-org/types",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.28",
|
|
4
4
|
"description": "Lichess.org API types",
|
|
5
5
|
"homepage": "https://github.com/lichess-org/api",
|
|
6
6
|
"license": "AGPL-3.0-or-later",
|
|
@@ -12,8 +12,8 @@
|
|
|
12
12
|
},
|
|
13
13
|
"devDependencies": {
|
|
14
14
|
"openapi-typescript": "^7.6.1",
|
|
15
|
-
"prettier": "^3.5.
|
|
16
|
-
"typescript": "^5.
|
|
15
|
+
"prettier": "^3.5.3",
|
|
16
|
+
"typescript": "^5.8.2"
|
|
17
17
|
},
|
|
18
|
-
"packageManager": "pnpm@9.
|
|
18
|
+
"packageManager": "pnpm@9.15.6+sha512.139cab068fdf0b751268179ac5f909b5be72afb4a75c513d1905d151befc8977b593d3cf8671ed83d4d6637c5c94b98ffbce108125de4a5a27a31233601a99de"
|
|
19
19
|
}
|