@lichess-org/types 2.0.26 → 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.
Files changed (2) hide show
  1. package/lichess-api.d.ts +234 -78
  2. 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).
2458
+ *
2459
+ * An empty line is sent every 6 seconds for keep alive purposes.
2439
2460
  *
2440
- * An empty line is sent every 6 seconds for keep alive purposes.
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
2441
2467
  *
2442
- * Each non-empty line is a JSON object containing a `type` field. Possible values are:
2443
- * - `gameStart` Start of a game
2444
- * - `gameFinish` Completion of a game
2445
- * - `challenge` A player sends you a challenge or you challenge someone
2446
- * - `challengeCanceled` A player cancels their challenge to you
2447
- * - `challengeDeclined` The opponent declines your challenge
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
- * Create a public seek, to start a game with a random player.
2491
+ * @description Create a public seek, to start a game with a random player.
2492
+ *
2493
+ * ### Real-time seek
2473
2494
  *
2474
- * ### Real-time seek
2495
+ * Specify the `time` and `increment` clock values.
2496
+ * The response is streamed but doesn't contain any information.
2475
2497
  *
2476
- * Specify the `time` and `increment` clock values. The response is streamed but doesn't contain any information.
2498
+ * **Keep the connection open to keep the seek active**.
2477
2499
  *
2478
- * **Keep the connection open to keep the seek active**.
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
- * 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.
2481
- * When the seek is accepted, or expires, the server closes the connection.
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
- * **Make sure to also have an [Event stream](#operation/apiStreamEvent) open**, to be notified when a game starts.
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
- * ### Correspondence seek
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 Stream the state of a game being played with the Board API, as [ndjson](#section/Introduction/Streaming-with-ND-JSON).
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 Stream the state of a game being played with the Bot API, as [ndjson](#section/Introduction/Streaming-with-ND-JSON).
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
- * - `gameFull` Full game data. All values are immutable, except for the `state` field.
2776
- * - `gameState` Current state of the game. Immutable values not included.
2777
- * - `chatLine` Chat message sent by a user (or the bot itself) in the `room` "player" or "spectator".
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: string;
6164
+ status: components["schemas"]["SwissStatus"];
6109
6165
  stats: {
6110
6166
  games: number;
6111
6167
  whiteWins: number;
@@ -6450,14 +6506,16 @@ export interface components {
6450
6506
  /** @example CHI */
6451
6507
  fed?: string;
6452
6508
  };
6453
- BroadcastRoundForm: {
6454
- /** @description Name of the broadcast round.
6455
- * Example: `Round 1`
6456
- * */
6457
- name: string;
6458
- } & (
6459
- | Record<string, never>
6509
+ /** @description Name of the broadcast round.
6510
+ * Example: `Round 1`
6511
+ * */
6512
+ BroadcastRoundFormName: string;
6513
+ BroadcastRoundForm: (
6514
+ | {
6515
+ name: components["schemas"]["BroadcastRoundFormName"];
6516
+ }
6460
6517
  | {
6518
+ name: components["schemas"]["BroadcastRoundFormName"];
6461
6519
  /**
6462
6520
  * Format: uri
6463
6521
  * @description URL that Lichess will poll to get updates about the games. It must be publicly accessible from the Internet.
@@ -6499,6 +6557,7 @@ export interface components {
6499
6557
  slices?: string;
6500
6558
  }
6501
6559
  | {
6560
+ name: components["schemas"]["BroadcastRoundFormName"];
6502
6561
  /** @description URLs that Lichess will poll to get updates about the games, separated by newlines. They must be publicly accessible from the Internet.
6503
6562
  *
6504
6563
  * Example:
@@ -6538,41 +6597,43 @@ export interface components {
6538
6597
  slices?: string;
6539
6598
  }
6540
6599
  | {
6600
+ name: components["schemas"]["BroadcastRoundFormName"];
6541
6601
  /** @description Lichess game IDs - Up to 64 Lichess game IDs, separated by spaces.
6542
6602
  * */
6543
6603
  syncIds: string;
6544
6604
  }
6545
6605
  | {
6606
+ name: components["schemas"]["BroadcastRoundFormName"];
6546
6607
  /** @description Up to 100 Lichess usernames, separated by spaces
6547
6608
  * */
6548
6609
  syncUsers: string;
6549
6610
  }
6550
6611
  ) & {
6551
- /** @description Timestamp in milliseconds of broadcast round start. Leave empty to manually start the broadcast round.
6552
- * Example: `1356998400070`
6553
- * */
6554
- startsAt?: number;
6555
- /**
6556
- * @description The start date is unknown, and the round will start automatically when the previous round completes.
6557
- *
6558
- * @default false
6559
- */
6560
- startsAfterPrevious?: boolean;
6561
- /** @description Delay in seconds for movements to appear on the broadcast. Leave it empty if you don't need it.
6562
- * Example: `900` (15 min)
6563
- * */
6564
- delay?: number;
6565
- /**
6566
- * @description Lichess can usually detect the round status, but you can also set it manually if needed.
6567
- *
6568
- * @default new
6569
- * @enum {string}
6570
- */
6571
- status?: "new" | "started" | "finished";
6572
- /** @description (Only for Admins) Waiting time for each poll.
6573
- * */
6574
- period?: number;
6575
- };
6612
+ /** @description Timestamp in milliseconds of broadcast round start. Leave empty to manually start the broadcast round.
6613
+ * Example: `1356998400070`
6614
+ * */
6615
+ startsAt?: number;
6616
+ /**
6617
+ * @description The start date is unknown, and the round will start automatically when the previous round completes.
6618
+ *
6619
+ * @default false
6620
+ */
6621
+ startsAfterPrevious?: boolean;
6622
+ /** @description Delay in seconds for movements to appear on the broadcast. Leave it empty if you don't need it.
6623
+ * Example: `900` (15 min)
6624
+ * */
6625
+ delay?: number;
6626
+ /**
6627
+ * @description Lichess can usually detect the round status, but you can also set it manually if needed.
6628
+ *
6629
+ * @default new
6630
+ * @enum {string}
6631
+ */
6632
+ status?: "new" | "started" | "finished";
6633
+ /** @description (Only for Admins) Waiting time for each poll.
6634
+ * */
6635
+ period?: number;
6636
+ };
6576
6637
  BroadcastRoundStudyInfo: {
6577
6638
  /** @description Whether the currently authenticated user has permission to update the study */
6578
6639
  writeable?: boolean;
@@ -7261,6 +7322,8 @@ export interface components {
7261
7322
  * "binc": 10000,
7262
7323
  * "wdraw": false,
7263
7324
  * "bdraw": false,
7325
+ * "wtakeback": false,
7326
+ * "btakeback": false,
7264
7327
  * "status": "started"
7265
7328
  * } */
7266
7329
  GameStateEvent: {
@@ -7327,6 +7390,10 @@ export interface components {
7327
7390
  * "btime": 286000,
7328
7391
  * "winc": 0,
7329
7392
  * "binc": 0,
7393
+ * "wdraw": false,
7394
+ * "bdraw": false,
7395
+ * "wtakeback": false,
7396
+ * "btakeback": false,
7330
7397
  * "status": "started"
7331
7398
  * }
7332
7399
  * } */
@@ -8521,6 +8588,44 @@ export interface operations {
8521
8588
  };
8522
8589
  };
8523
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
+ };
8524
8629
  apiPuzzleDashboard: {
8525
8630
  parameters: {
8526
8631
  query?: never;
@@ -9694,6 +9799,27 @@ export interface operations {
9694
9799
  * Example: `thibault,german11,%titled`
9695
9800
  * */
9696
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;
9697
9823
  };
9698
9824
  };
9699
9825
  };
@@ -9944,6 +10070,27 @@ export interface operations {
9944
10070
  * Example: `thibault,german11,%titled`
9945
10071
  * */
9946
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;
9947
10094
  };
9948
10095
  };
9949
10096
  };
@@ -11047,6 +11194,15 @@ export interface operations {
11047
11194
  query?: {
11048
11195
  /** @description How many tournaments to download. */
11049
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;
11050
11206
  };
11051
11207
  header?: never;
11052
11208
  path: {
@@ -11198,13 +11354,13 @@ export interface operations {
11198
11354
  requestBody: {
11199
11355
  content: {
11200
11356
  "application/x-www-form-urlencoded": {
11201
- /** @description Name of the new chapter.
11202
- * If multiple chapters are created, the names will be infered from the PGN tags.
11203
- * */
11204
- name: string;
11205
11357
  /** @description PGN to import. Can contain multiple games separated by 2 or more newlines.
11206
11358
  * */
11207
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;
11208
11364
  /**
11209
11365
  * @description Default board orientation.
11210
11366
  * @default white
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lichess-org/types",
3
- "version": "2.0.26",
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.1",
16
- "typescript": "^5.7.3"
15
+ "prettier": "^3.5.3",
16
+ "typescript": "^5.8.2"
17
17
  },
18
- "packageManager": "pnpm@9.14.2+sha512.6e2baf77d06b9362294152c851c4f278ede37ab1eba3a55fda317a4a17b209f4dbb973fb250a77abc463a341fcb1f17f17cfa24091c4eb319cda0d9b84278387"
18
+ "packageManager": "pnpm@9.15.6+sha512.139cab068fdf0b751268179ac5f909b5be72afb4a75c513d1905d151befc8977b593d3cf8671ed83d4d6637c5c94b98ffbce108125de4a5a27a31233601a99de"
19
19
  }