@lichess-org/types 2.0.22 → 2.0.24

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 +244 -14
  2. package/package.json +3 -3
package/lichess-api.d.ts CHANGED
@@ -726,6 +726,29 @@ export interface paths {
726
726
  patch?: never;
727
727
  trace?: never;
728
728
  };
729
+ "/api/games/export/bookmarks": {
730
+ parameters: {
731
+ query?: never;
732
+ header?: never;
733
+ path?: never;
734
+ cookie?: never;
735
+ };
736
+ /**
737
+ * Export your bookmarked games
738
+ * @description Download all games bookmarked by you, in PGN or [ndjson](#section/Introduction/Streaming-with-ND-JSON) format.
739
+ * Games are sorted by reverse chronological order (most recent first).
740
+ * We recommend streaming the response, for it can be very long.
741
+ *
742
+ */
743
+ get: operations["apiExportBookmarks"];
744
+ put?: never;
745
+ post?: never;
746
+ delete?: never;
747
+ options?: never;
748
+ head?: never;
749
+ patch?: never;
750
+ trace?: never;
751
+ };
729
752
  "/api/tv/channels": {
730
753
  parameters: {
731
754
  query?: never;
@@ -1856,6 +1879,48 @@ export interface paths {
1856
1879
  patch?: never;
1857
1880
  trace?: never;
1858
1881
  };
1882
+ "/api/fide/player/{playerId}": {
1883
+ parameters: {
1884
+ query?: never;
1885
+ header?: never;
1886
+ path?: never;
1887
+ cookie?: never;
1888
+ };
1889
+ /**
1890
+ * Get a FIDE player
1891
+ * @description Get information about a FIDE player.
1892
+ *
1893
+ */
1894
+ get: operations["fidePlayerGet"];
1895
+ put?: never;
1896
+ post?: never;
1897
+ delete?: never;
1898
+ options?: never;
1899
+ head?: never;
1900
+ patch?: never;
1901
+ trace?: never;
1902
+ };
1903
+ "/api/fide/player": {
1904
+ parameters: {
1905
+ query?: never;
1906
+ header?: never;
1907
+ path?: never;
1908
+ cookie?: never;
1909
+ };
1910
+ /**
1911
+ * Search FIDE players
1912
+ * @description List of FIDE players search results for a query.
1913
+ *
1914
+ */
1915
+ get: operations["fidePlayerSearch"];
1916
+ put?: never;
1917
+ post?: never;
1918
+ delete?: never;
1919
+ options?: never;
1920
+ head?: never;
1921
+ patch?: never;
1922
+ trace?: never;
1923
+ };
1859
1924
  "/api/simul": {
1860
1925
  parameters: {
1861
1926
  query?: never;
@@ -3058,6 +3123,8 @@ export interface paths {
3058
3123
  * Requires the OAuth tokens of both players with `challenge:write` scope.
3059
3124
  * If the clocks have already started, the call will have no effect.
3060
3125
  *
3126
+ * For AI games with only one player, omit the `token2` parameter.
3127
+ *
3061
3128
  */
3062
3129
  post: operations["challengeStartClocks"];
3063
3130
  delete?: never;
@@ -6713,6 +6780,25 @@ export interface components {
6713
6780
  tour: components["schemas"]["BroadcastTour"];
6714
6781
  study: components["schemas"]["BroadcastRoundStudyInfo"];
6715
6782
  };
6783
+ FIDEPlayer: {
6784
+ /** @example 35009192 */
6785
+ id: number;
6786
+ /** @example Erigaisi Arjun */
6787
+ name: string;
6788
+ title?: components["schemas"]["Title"];
6789
+ /** @example IND */
6790
+ federation: string;
6791
+ /** @example 2003 */
6792
+ year?: number;
6793
+ /** @example true */
6794
+ inactive?: boolean;
6795
+ /** @example 2797 */
6796
+ standard?: number;
6797
+ /** @example 2698 */
6798
+ rapid?: number;
6799
+ /** @example 2738 */
6800
+ blitz?: number;
6801
+ };
6716
6802
  /** @example {
6717
6803
  * "id": "pDGbxhUe",
6718
6804
  * "name": "GM ChessWeeb",
@@ -6740,7 +6826,27 @@ export interface components {
6740
6826
  * }
6741
6827
  * ]
6742
6828
  * } */
6743
- Simul: unknown;
6829
+ Simul: {
6830
+ id: string;
6831
+ host: components["schemas"]["LightUser"] & {
6832
+ rating?: number;
6833
+ provisional?: boolean;
6834
+ gameId?: string;
6835
+ online?: boolean;
6836
+ };
6837
+ name: string;
6838
+ fullName: string;
6839
+ variants: components["schemas"]["Variant"][];
6840
+ isCreated: boolean;
6841
+ isFinished: boolean;
6842
+ isRunning: boolean;
6843
+ text?: string;
6844
+ estimatedStartAt?: number;
6845
+ startedAt?: number;
6846
+ finishedAt?: number;
6847
+ nbApplicants: number;
6848
+ nbPairings: number;
6849
+ };
6744
6850
  /** @example {
6745
6851
  * "id": "lichess-swiss",
6746
6852
  * "name": "Lichess Swiss",
@@ -7411,17 +7517,22 @@ export interface components {
7411
7517
  * ]
7412
7518
  * } */
7413
7519
  CloudEval: {
7414
- depth?: number;
7415
- fen?: string;
7416
- knodes?: number;
7417
- pvs?: {
7418
- /** @description Evaluation in centi-pawns, from White's point of view */
7419
- cp?: number;
7420
- /** @description Evaluation in moves to mate, from White's point of view */
7421
- mate?: number;
7520
+ depth: number;
7521
+ fen: string;
7522
+ knodes: number;
7523
+ pvs: ({
7422
7524
  /** @description Variation in UCI notation */
7423
- moves?: string;
7424
- }[];
7525
+ moves: string;
7526
+ } & (
7527
+ | {
7528
+ /** @description Evaluation in centi-pawns, from White's point of view */
7529
+ cp: number;
7530
+ }
7531
+ | {
7532
+ /** @description Evaluation in moves to mate, from White's point of view */
7533
+ mate: number;
7534
+ }
7535
+ ))[];
7425
7536
  };
7426
7537
  /**
7427
7538
  * @default chess
@@ -9160,6 +9271,72 @@ export interface operations {
9160
9271
  };
9161
9272
  };
9162
9273
  };
9274
+ apiExportBookmarks: {
9275
+ parameters: {
9276
+ query?: {
9277
+ /** @description Download games bookmarked since this timestamp. Defaults to account creation date. */
9278
+ since?: number;
9279
+ /** @description Download games bookmarked until this timestamp. Defaults to now. */
9280
+ until?: number;
9281
+ /** @description How many bookmarked games to download. Leave empty to download all bookmarked games. */
9282
+ max?: number;
9283
+ /** @description Include the PGN moves. */
9284
+ moves?: boolean;
9285
+ /** @description Include the full PGN within the JSON response, in a `pgn` field. The response type must be set to `application/x-ndjson` by the request `Accept` header. */
9286
+ pgnInJson?: boolean;
9287
+ /** @description Include the PGN tags. */
9288
+ tags?: boolean;
9289
+ /** @description Include clock status when available.
9290
+ * Either as PGN comments: `2. exd5 { [%clk 1:01:27] } e5 { [%clk 1:01:28] }`
9291
+ * Or in a `clocks` JSON field, as centisecond integers, depending on the response type.
9292
+ * */
9293
+ clocks?: boolean;
9294
+ /** @description Include analysis evaluations and comments, when available.
9295
+ * Either as PGN comments: `12. Bxf6 { [%eval 0.23] } a3 { [%eval -1.09] }`
9296
+ * Or in an `analysis` JSON field, depending on the response type.
9297
+ * */
9298
+ evals?: boolean;
9299
+ /** @description Include [accuracy percent](https://lichess.org/page/accuracy) of each player, when available. Only available in JSON.
9300
+ * */
9301
+ accuracy?: boolean;
9302
+ /** @description Include the opening name.
9303
+ * Example: `[Opening "King's Gambit Accepted, King's Knight Gambit"]`
9304
+ * */
9305
+ opening?: boolean;
9306
+ /** @description Plies which mark the beginning of the middlegame and endgame.
9307
+ * Only available in JSON
9308
+ * */
9309
+ division?: boolean;
9310
+ /** @description Insert textual annotations in the PGN about the opening, analysis variations, mistakes, and game termination.
9311
+ * Example: `5... g4? { (-0.98 → 0.60) Mistake. Best move was h6. } (5... h6 6. d4 Ne7 7. g3 d5 8. exd5 fxg3 9. hxg3 c6 10. dxc6)`
9312
+ * */
9313
+ literate?: boolean;
9314
+ /** @description Include the FEN notation of the last position of the game.
9315
+ * The response type must be set to `application/x-ndjson` by the request `Accept` header.
9316
+ * */
9317
+ lastFen?: boolean;
9318
+ /** @description Sort order of the bookmarks. */
9319
+ sort?: "dateAsc" | "dateDesc";
9320
+ };
9321
+ header?: never;
9322
+ path?: never;
9323
+ cookie?: never;
9324
+ };
9325
+ requestBody?: never;
9326
+ responses: {
9327
+ /** @description The bookmarked games of the user. */
9328
+ 200: {
9329
+ headers: {
9330
+ "Access-Control-Allow-Origin"?: string;
9331
+ [name: string]: unknown;
9332
+ };
9333
+ content: {
9334
+ "application/x-chess-pgn": components["schemas"]["GamePgn"];
9335
+ "application/x-ndjson": components["schemas"]["GameJson"];
9336
+ };
9337
+ };
9338
+ };
9339
+ };
9163
9340
  tvChannels: {
9164
9341
  parameters: {
9165
9342
  query?: never;
@@ -11627,6 +11804,53 @@ export interface operations {
11627
11804
  };
11628
11805
  };
11629
11806
  };
11807
+ fidePlayerGet: {
11808
+ parameters: {
11809
+ query?: never;
11810
+ header?: never;
11811
+ path: {
11812
+ /** @description The FIDE player ID. */
11813
+ playerId: number;
11814
+ };
11815
+ cookie?: never;
11816
+ };
11817
+ requestBody?: never;
11818
+ responses: {
11819
+ /** @description The information about the FIDE player. */
11820
+ 200: {
11821
+ headers: {
11822
+ [name: string]: unknown;
11823
+ };
11824
+ content: {
11825
+ "application/json": components["schemas"]["FIDEPlayer"];
11826
+ };
11827
+ };
11828
+ };
11829
+ };
11830
+ fidePlayerSearch: {
11831
+ parameters: {
11832
+ query: {
11833
+ /** @description The search query. */
11834
+ q: string;
11835
+ };
11836
+ header?: never;
11837
+ path?: never;
11838
+ cookie?: never;
11839
+ };
11840
+ requestBody?: never;
11841
+ responses: {
11842
+ /** @description The list of FIDE players. */
11843
+ 200: {
11844
+ headers: {
11845
+ "Access-Control-Allow-Origin"?: string;
11846
+ [name: string]: unknown;
11847
+ };
11848
+ content: {
11849
+ "application/json": components["schemas"]["FIDEPlayer"][];
11850
+ };
11851
+ };
11852
+ };
11853
+ };
11630
11854
  apiSimul: {
11631
11855
  parameters: {
11632
11856
  query?: never;
@@ -12305,6 +12529,12 @@ export interface operations {
12305
12529
  * @example 15
12306
12530
  */
12307
12531
  increment: number;
12532
+ /**
12533
+ * @description The color to play. Better left empty to automatically get 50% white.
12534
+ * @default random
12535
+ * @enum {string}
12536
+ */
12537
+ color?: "random" | "white" | "black";
12308
12538
  }
12309
12539
  | {
12310
12540
  /**
@@ -13393,10 +13623,10 @@ export interface operations {
13393
13623
  };
13394
13624
  challengeStartClocks: {
13395
13625
  parameters: {
13396
- query?: {
13626
+ query: {
13397
13627
  /** @description OAuth token of a player */
13398
- token1?: string;
13399
- /** @description OAuth token of the other player */
13628
+ token1: string;
13629
+ /** @description OAuth token of the other player. Omit for AI games that have only one player. */
13400
13630
  token2?: string;
13401
13631
  };
13402
13632
  header?: never;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lichess-org/types",
3
- "version": "2.0.22",
3
+ "version": "2.0.24",
4
4
  "description": "Lichess.org API types",
5
5
  "homepage": "https://github.com/lichess-org/api",
6
6
  "license": "AGPL-3.0-or-later",
@@ -11,9 +11,9 @@
11
11
  "gen": "openapi-typescript ../doc/specs/lichess-api.yaml -o lichess-api.d.ts --default-non-nullable=false"
12
12
  },
13
13
  "devDependencies": {
14
- "openapi-typescript": "^7.5.2",
14
+ "openapi-typescript": "^7.6.1",
15
15
  "prettier": "^3.4.2",
16
- "typescript": "^5.7.2"
16
+ "typescript": "^5.7.3"
17
17
  },
18
18
  "packageManager": "pnpm@9.14.2+sha512.6e2baf77d06b9362294152c851c4f278ede37ab1eba3a55fda317a4a17b209f4dbb973fb250a77abc463a341fcb1f17f17cfa24091c4eb319cda0d9b84278387"
19
19
  }