@lichess-org/types 2.0.23 → 2.0.25

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 +185 -45
  2. package/package.json +3 -3
package/lichess-api.d.ts CHANGED
@@ -1685,6 +1685,8 @@ export interface paths {
1685
1685
  * @description Create a new broadcast round to relay external games.
1686
1686
  * This endpoint accepts the same form data as the web form.
1687
1687
  *
1688
+ * Choose one between `syncUrl`, `syncUrls`, `syncIds` and `syncUsers`, if it is missing, the broadcast needs to be fed by [pushing PGN to it](#operation/broadcastPush)
1689
+ *
1688
1690
  */
1689
1691
  post: operations["broadcastRoundCreate"];
1690
1692
  delete?: never;
@@ -1879,6 +1881,48 @@ export interface paths {
1879
1881
  patch?: never;
1880
1882
  trace?: never;
1881
1883
  };
1884
+ "/api/fide/player/{playerId}": {
1885
+ parameters: {
1886
+ query?: never;
1887
+ header?: never;
1888
+ path?: never;
1889
+ cookie?: never;
1890
+ };
1891
+ /**
1892
+ * Get a FIDE player
1893
+ * @description Get information about a FIDE player.
1894
+ *
1895
+ */
1896
+ get: operations["fidePlayerGet"];
1897
+ put?: never;
1898
+ post?: never;
1899
+ delete?: never;
1900
+ options?: never;
1901
+ head?: never;
1902
+ patch?: never;
1903
+ trace?: never;
1904
+ };
1905
+ "/api/fide/player": {
1906
+ parameters: {
1907
+ query?: never;
1908
+ header?: never;
1909
+ path?: never;
1910
+ cookie?: never;
1911
+ };
1912
+ /**
1913
+ * Search FIDE players
1914
+ * @description List of FIDE players search results for a query.
1915
+ *
1916
+ */
1917
+ get: operations["fidePlayerSearch"];
1918
+ put?: never;
1919
+ post?: never;
1920
+ delete?: never;
1921
+ options?: never;
1922
+ head?: never;
1923
+ patch?: never;
1924
+ trace?: never;
1925
+ };
1882
1926
  "/api/simul": {
1883
1927
  parameters: {
1884
1928
  query?: never;
@@ -3081,6 +3125,8 @@ export interface paths {
3081
3125
  * Requires the OAuth tokens of both players with `challenge:write` scope.
3082
3126
  * If the clocks have already started, the call will have no effect.
3083
3127
  *
3128
+ * For AI games with only one player, omit the `token2` parameter.
3129
+ *
3084
3130
  */
3085
3131
  post: operations["challengeStartClocks"];
3086
3132
  delete?: never;
@@ -6408,7 +6454,7 @@ export interface components {
6408
6454
  /** @description Name of the broadcast round.
6409
6455
  * Example: `Round 1`
6410
6456
  * */
6411
- name?: string;
6457
+ name: string;
6412
6458
  } & (
6413
6459
  | Record<string, never>
6414
6460
  | {
@@ -6420,10 +6466,9 @@ export interface components {
6420
6466
  * ```txt
6421
6467
  * https://myserver.org/myevent/round-10/games.pgn
6422
6468
  * ```
6423
- * Choose one between `syncUrl`, `syncUrls` and `syncIds`, if it is missing, the broadcast needs to be fed by [pushing PGN to it](#operation/broadcastPush)
6424
6469
  *
6425
6470
  */
6426
- syncUrl?: string;
6471
+ syncUrl: string;
6427
6472
  /** @description Filter games by round number
6428
6473
  *
6429
6474
  * Optional, only keep games from the source that match a round number.
@@ -6461,9 +6506,8 @@ export interface components {
6461
6506
  * https://myserver.org/myevent/round-10/game-1.pgn
6462
6507
  * https://myserver.org/myevent/round-10/game-2.pgn
6463
6508
  * ```
6464
- * Choose one between `syncUrl`, `syncUrls` and `syncIds`, if it is missing, the broadcast needs to be fed by [pushing PGN to it](#operation/broadcastPush)
6465
6509
  * */
6466
- syncUrls?: string;
6510
+ syncUrls: string;
6467
6511
  /** @description Filter games by round number
6468
6512
  *
6469
6513
  * Optional, only keep games from the source that match a round number.
@@ -6495,9 +6539,13 @@ export interface components {
6495
6539
  }
6496
6540
  | {
6497
6541
  /** @description Lichess game IDs - Up to 64 Lichess game IDs, separated by spaces.
6498
- * Choose one between `syncUrl`, `syncUrls` and `syncIds`, if it is missing, the broadcast needs to be fed by [pushing PGN to it](#operation/broadcastPush)
6499
6542
  * */
6500
- syncIds?: string;
6543
+ syncIds: string;
6544
+ }
6545
+ | {
6546
+ /** @description Up to 100 Lichess usernames, separated by spaces
6547
+ * */
6548
+ syncUsers: string;
6501
6549
  }
6502
6550
  ) & {
6503
6551
  /** @description Timestamp in milliseconds of broadcast round start. Leave empty to manually start the broadcast round.
@@ -6515,11 +6563,12 @@ export interface components {
6515
6563
  * */
6516
6564
  delay?: number;
6517
6565
  /**
6518
- * @description Mark whether the round has been completed.
6566
+ * @description Lichess can usually detect the round status, but you can also set it manually if needed.
6519
6567
  *
6520
- * @default false
6568
+ * @default new
6569
+ * @enum {string}
6521
6570
  */
6522
- finished?: boolean;
6571
+ status?: "new" | "started" | "finished";
6523
6572
  /** @description (Only for Admins) Waiting time for each poll.
6524
6573
  * */
6525
6574
  period?: number;
@@ -6736,6 +6785,25 @@ export interface components {
6736
6785
  tour: components["schemas"]["BroadcastTour"];
6737
6786
  study: components["schemas"]["BroadcastRoundStudyInfo"];
6738
6787
  };
6788
+ FIDEPlayer: {
6789
+ /** @example 35009192 */
6790
+ id: number;
6791
+ /** @example Erigaisi Arjun */
6792
+ name: string;
6793
+ title?: components["schemas"]["Title"];
6794
+ /** @example IND */
6795
+ federation: string;
6796
+ /** @example 2003 */
6797
+ year?: number;
6798
+ /** @example true */
6799
+ inactive?: boolean;
6800
+ /** @example 2797 */
6801
+ standard?: number;
6802
+ /** @example 2698 */
6803
+ rapid?: number;
6804
+ /** @example 2738 */
6805
+ blitz?: number;
6806
+ };
6739
6807
  /** @example {
6740
6808
  * "id": "pDGbxhUe",
6741
6809
  * "name": "GM ChessWeeb",
@@ -6763,7 +6831,27 @@ export interface components {
6763
6831
  * }
6764
6832
  * ]
6765
6833
  * } */
6766
- Simul: unknown;
6834
+ Simul: {
6835
+ id: string;
6836
+ host: components["schemas"]["LightUser"] & {
6837
+ rating?: number;
6838
+ provisional?: boolean;
6839
+ gameId?: string;
6840
+ online?: boolean;
6841
+ };
6842
+ name: string;
6843
+ fullName: string;
6844
+ variants: components["schemas"]["Variant"][];
6845
+ isCreated: boolean;
6846
+ isFinished: boolean;
6847
+ isRunning: boolean;
6848
+ text?: string;
6849
+ estimatedStartAt?: number;
6850
+ startedAt?: number;
6851
+ finishedAt?: number;
6852
+ nbApplicants: number;
6853
+ nbPairings: number;
6854
+ };
6767
6855
  /** @example {
6768
6856
  * "id": "lichess-swiss",
6769
6857
  * "name": "Lichess Swiss",
@@ -7434,17 +7522,22 @@ export interface components {
7434
7522
  * ]
7435
7523
  * } */
7436
7524
  CloudEval: {
7437
- depth?: number;
7438
- fen?: string;
7439
- knodes?: number;
7440
- pvs?: {
7441
- /** @description Evaluation in centi-pawns, from White's point of view */
7442
- cp?: number;
7443
- /** @description Evaluation in moves to mate, from White's point of view */
7444
- mate?: number;
7525
+ depth: number;
7526
+ fen: string;
7527
+ knodes: number;
7528
+ pvs: ({
7445
7529
  /** @description Variation in UCI notation */
7446
- moves?: string;
7447
- }[];
7530
+ moves: string;
7531
+ } & (
7532
+ | {
7533
+ /** @description Evaluation in centi-pawns, from White's point of view */
7534
+ cp: number;
7535
+ }
7536
+ | {
7537
+ /** @description Evaluation in moves to mate, from White's point of view */
7538
+ mate: number;
7539
+ }
7540
+ ))[];
7448
7541
  };
7449
7542
  /**
7450
7543
  * @default chess
@@ -8717,7 +8810,7 @@ export interface operations {
8717
8810
  };
8718
8811
  header?: never;
8719
8812
  path: {
8720
- /** @description The game ID (8 characters). */
8813
+ /** @description The game ID */
8721
8814
  gameId: string;
8722
8815
  };
8723
8816
  cookie?: never;
@@ -10002,7 +10095,7 @@ export interface operations {
10002
10095
  query?: never;
10003
10096
  header?: never;
10004
10097
  path: {
10005
- /** @description The tournament ID (8 characters).. */
10098
+ /** @description The tournament ID */
10006
10099
  id: string;
10007
10100
  };
10008
10101
  cookie?: never;
@@ -11002,9 +11095,9 @@ export interface operations {
11002
11095
  };
11003
11096
  header?: never;
11004
11097
  path: {
11005
- /** @description The study ID (8 characters). */
11098
+ /** @description The study ID */
11006
11099
  studyId: string;
11007
- /** @description The chapter ID (8 characters). */
11100
+ /** @description The chapter ID */
11008
11101
  chapterId: string;
11009
11102
  };
11010
11103
  cookie?: never;
@@ -11048,7 +11141,7 @@ export interface operations {
11048
11141
  };
11049
11142
  header?: never;
11050
11143
  path: {
11051
- /** @description The study ID (8 characters). */
11144
+ /** @description The study ID */
11052
11145
  studyId: string;
11053
11146
  };
11054
11147
  cookie?: never;
@@ -11073,7 +11166,7 @@ export interface operations {
11073
11166
  query?: never;
11074
11167
  header?: never;
11075
11168
  path: {
11076
- /** @description The study ID (8 characters). */
11169
+ /** @description The study ID */
11077
11170
  studyId: string;
11078
11171
  };
11079
11172
  cookie?: never;
@@ -11217,9 +11310,9 @@ export interface operations {
11217
11310
  query?: never;
11218
11311
  header?: never;
11219
11312
  path: {
11220
- /** @description The study ID (8 characters). */
11313
+ /** @description The study ID */
11221
11314
  studyId: string;
11222
- /** @description The chapter ID (8 characters). */
11315
+ /** @description The chapter ID */
11223
11316
  chapterId: string;
11224
11317
  };
11225
11318
  cookie?: never;
@@ -11377,7 +11470,7 @@ export interface operations {
11377
11470
  query?: never;
11378
11471
  header?: never;
11379
11472
  path: {
11380
- /** @description The broadcast tournament ID (8 characters). */
11473
+ /** @description The broadcast tournament ID */
11381
11474
  broadcastTournamentId: string;
11382
11475
  };
11383
11476
  cookie?: never;
@@ -11400,7 +11493,7 @@ export interface operations {
11400
11493
  query?: never;
11401
11494
  header?: never;
11402
11495
  path: {
11403
- /** @description The broadcast tournament ID (8 characters). */
11496
+ /** @description The broadcast tournament ID */
11404
11497
  broadcastTournamentId: string;
11405
11498
  };
11406
11499
  cookie?: never;
@@ -11423,7 +11516,7 @@ export interface operations {
11423
11516
  query?: never;
11424
11517
  header?: never;
11425
11518
  path: {
11426
- /** @description The broadcast ID (8 characters). */
11519
+ /** @description The broadcast ID */
11427
11520
  broadcastTournamentId: string;
11428
11521
  };
11429
11522
  cookie?: never;
@@ -11444,7 +11537,7 @@ export interface operations {
11444
11537
  "application/json": components["schemas"]["Ok"];
11445
11538
  };
11446
11539
  };
11447
- /** @description The edition of the broadcast tournament failed. */
11540
+ /** @description The broadcast tournament update failed. */
11448
11541
  400: {
11449
11542
  headers: {
11450
11543
  [name: string]: unknown;
@@ -11460,7 +11553,7 @@ export interface operations {
11460
11553
  query?: never;
11461
11554
  header?: never;
11462
11555
  path: {
11463
- /** @description The broadcast tournament ID (8 characters). */
11556
+ /** @description The broadcast tournament ID */
11464
11557
  broadcastTournamentId: string;
11465
11558
  };
11466
11559
  cookie?: never;
@@ -11501,7 +11594,7 @@ export interface operations {
11501
11594
  broadcastTournamentSlug: string;
11502
11595
  /** @description The broadcast round slug. Only used for SEO, the slug can be safely replaced by `-`. Only the `broadcastRoundId` is actually used. */
11503
11596
  broadcastRoundSlug: string;
11504
- /** @description The broadcast Round ID (8 characters). */
11597
+ /** @description The broadcast Round ID */
11505
11598
  broadcastRoundId: string;
11506
11599
  };
11507
11600
  cookie?: never;
@@ -11524,7 +11617,7 @@ export interface operations {
11524
11617
  query?: never;
11525
11618
  header?: never;
11526
11619
  path: {
11527
- /** @description The broadcast round ID (8 characters). */
11620
+ /** @description The broadcast round ID */
11528
11621
  broadcastRoundId: string;
11529
11622
  };
11530
11623
  cookie?: never;
@@ -11545,7 +11638,7 @@ export interface operations {
11545
11638
  "application/json": components["schemas"]["Ok"];
11546
11639
  };
11547
11640
  };
11548
- /** @description The edition of the broadcast tournament failed. */
11641
+ /** @description The broadcast round update failed. */
11549
11642
  400: {
11550
11643
  headers: {
11551
11644
  [name: string]: unknown;
@@ -11561,7 +11654,7 @@ export interface operations {
11561
11654
  query?: never;
11562
11655
  header?: never;
11563
11656
  path: {
11564
- /** @description The broadcast round ID (8 characters). */
11657
+ /** @description The broadcast round ID */
11565
11658
  broadcastRoundId: string;
11566
11659
  };
11567
11660
  cookie?: never;
@@ -11585,7 +11678,7 @@ export interface operations {
11585
11678
  query?: never;
11586
11679
  header?: never;
11587
11680
  path: {
11588
- /** @description The broadcast round ID (8 characters). */
11681
+ /** @description The broadcast round ID */
11589
11682
  broadcastRoundId: string;
11590
11683
  };
11591
11684
  cookie?: never;
@@ -11626,7 +11719,7 @@ export interface operations {
11626
11719
  query?: never;
11627
11720
  header?: never;
11628
11721
  path: {
11629
- /** @description The broadcast round ID (8 characters). */
11722
+ /** @description The broadcast round ID */
11630
11723
  broadcastRoundId: string;
11631
11724
  };
11632
11725
  cookie?: never;
@@ -11650,7 +11743,7 @@ export interface operations {
11650
11743
  query?: never;
11651
11744
  header?: never;
11652
11745
  path: {
11653
- /** @description The round ID (8 characters). */
11746
+ /** @description The round ID */
11654
11747
  broadcastRoundId: string;
11655
11748
  };
11656
11749
  cookie?: never;
@@ -11674,7 +11767,7 @@ export interface operations {
11674
11767
  query?: never;
11675
11768
  header?: never;
11676
11769
  path: {
11677
- /** @description The broadcast tournament ID (8 characters). */
11770
+ /** @description The broadcast tournament ID */
11678
11771
  broadcastTournamentId: string;
11679
11772
  };
11680
11773
  cookie?: never;
@@ -11716,6 +11809,53 @@ export interface operations {
11716
11809
  };
11717
11810
  };
11718
11811
  };
11812
+ fidePlayerGet: {
11813
+ parameters: {
11814
+ query?: never;
11815
+ header?: never;
11816
+ path: {
11817
+ /** @description The FIDE player ID. */
11818
+ playerId: number;
11819
+ };
11820
+ cookie?: never;
11821
+ };
11822
+ requestBody?: never;
11823
+ responses: {
11824
+ /** @description The information about the FIDE player. */
11825
+ 200: {
11826
+ headers: {
11827
+ [name: string]: unknown;
11828
+ };
11829
+ content: {
11830
+ "application/json": components["schemas"]["FIDEPlayer"];
11831
+ };
11832
+ };
11833
+ };
11834
+ };
11835
+ fidePlayerSearch: {
11836
+ parameters: {
11837
+ query: {
11838
+ /** @description The search query. */
11839
+ q: string;
11840
+ };
11841
+ header?: never;
11842
+ path?: never;
11843
+ cookie?: never;
11844
+ };
11845
+ requestBody?: never;
11846
+ responses: {
11847
+ /** @description The list of FIDE players. */
11848
+ 200: {
11849
+ headers: {
11850
+ "Access-Control-Allow-Origin"?: string;
11851
+ [name: string]: unknown;
11852
+ };
11853
+ content: {
11854
+ "application/json": components["schemas"]["FIDEPlayer"][];
11855
+ };
11856
+ };
11857
+ };
11858
+ };
11719
11859
  apiSimul: {
11720
11860
  parameters: {
11721
11861
  query?: never;
@@ -13488,10 +13628,10 @@ export interface operations {
13488
13628
  };
13489
13629
  challengeStartClocks: {
13490
13630
  parameters: {
13491
- query?: {
13631
+ query: {
13492
13632
  /** @description OAuth token of a player */
13493
- token1?: string;
13494
- /** @description OAuth token of the other player */
13633
+ token1: string;
13634
+ /** @description OAuth token of the other player. Omit for AI games that have only one player. */
13495
13635
  token2?: string;
13496
13636
  };
13497
13637
  header?: never;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lichess-org/types",
3
- "version": "2.0.23",
3
+ "version": "2.0.25",
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,8 +11,8 @@
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.6.0",
15
- "prettier": "^3.4.2",
14
+ "openapi-typescript": "^7.6.1",
15
+ "prettier": "^3.5.1",
16
16
  "typescript": "^5.7.3"
17
17
  },
18
18
  "packageManager": "pnpm@9.14.2+sha512.6e2baf77d06b9362294152c851c4f278ede37ab1eba3a55fda317a4a17b209f4dbb973fb250a77abc463a341fcb1f17f17cfa24091c4eb319cda0d9b84278387"