@lichess-org/types 2.0.43 → 2.0.45

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 +112 -261
  2. package/package.json +1 -1
package/lichess-api.d.ts CHANGED
@@ -3925,22 +3925,17 @@ export interface components {
3925
3925
  * } */
3926
3926
  Leaderboard: unknown;
3927
3927
  Perf: {
3928
- /** @example 2945 */
3929
- games?: number;
3930
- /** @example 1609 */
3931
- rating?: number;
3932
- /** @example 60 */
3933
- rd?: number;
3934
- /** @example -22 */
3935
- prog?: number;
3928
+ games: number;
3929
+ rating: number;
3930
+ /** @description rating deviation */
3931
+ rd: number;
3932
+ prog: number;
3936
3933
  /** @description only appears if a user's perf rating are [provisional](https://lichess.org/faq#provisional) */
3937
3934
  prov?: boolean;
3938
3935
  };
3939
3936
  PuzzleModePerf: {
3940
- /** @example 44 */
3941
- runs?: number;
3942
- /** @example 61 */
3943
- score?: number;
3937
+ runs: number;
3938
+ score: number;
3944
3939
  };
3945
3940
  Perfs: {
3946
3941
  chess960?: components["schemas"]["Perf"];
@@ -4465,18 +4460,9 @@ export interface components {
4465
4460
  puzzles?: {
4466
4461
  score?: components["schemas"]["UserActivityScore"];
4467
4462
  };
4468
- storm?: {
4469
- runs?: number;
4470
- score?: number;
4471
- };
4472
- racer?: {
4473
- runs?: number;
4474
- score?: number;
4475
- };
4476
- streak?: {
4477
- runs?: number;
4478
- score?: number;
4479
- };
4463
+ storm?: components["schemas"]["PuzzleModePerf"];
4464
+ racer?: components["schemas"]["PuzzleModePerf"];
4465
+ streak?: components["schemas"]["PuzzleModePerf"];
4480
4466
  tournaments?: {
4481
4467
  nb?: number;
4482
4468
  best?: {
@@ -4512,6 +4498,7 @@ export interface components {
4512
4498
  teams?: {
4513
4499
  url: string;
4514
4500
  name: string;
4501
+ flair?: components["schemas"]["Flair"];
4515
4502
  }[];
4516
4503
  posts?: {
4517
4504
  topicUrl: string;
@@ -5095,11 +5082,8 @@ export interface components {
5095
5082
  | "rapid"
5096
5083
  | "classical"
5097
5084
  | "correspondence";
5098
- /**
5099
- * @description Game status code. https://github.com/lichess-org/scalachess/blob/0a7d6f2c63b1ca06cd3c958ed3264e738af5c5f6/src/main/scala/Status.scala#L16-L28
5100
- * @enum {string}
5101
- */
5102
- GameStatus:
5085
+ /** @enum {string} */
5086
+ GameStatusName:
5103
5087
  | "created"
5104
5088
  | "started"
5105
5089
  | "aborted"
@@ -5169,7 +5153,7 @@ export interface components {
5169
5153
  createdAt: number;
5170
5154
  /** Format: int64 */
5171
5155
  lastMoveAt: number;
5172
- status: components["schemas"]["GameStatus"];
5156
+ status: components["schemas"]["GameStatusName"];
5173
5157
  source?: string;
5174
5158
  players: {
5175
5159
  white: components["schemas"]["GameUser"];
@@ -5404,19 +5388,18 @@ export interface components {
5404
5388
  */
5405
5389
  ArenaStatus: 10 | 20 | 30;
5406
5390
  ArenaPerf: {
5407
- /** @example blitz */
5408
- key?: string;
5391
+ key: components["schemas"]["PerfType"];
5409
5392
  /** @example Blitz */
5410
- name?: string;
5393
+ name: string;
5411
5394
  /** @example 1 */
5412
- position?: number;
5395
+ position: number;
5413
5396
  /** @example ) */
5414
5397
  icon?: string;
5415
5398
  };
5416
5399
  ArenaRatingObj: {
5417
5400
  perf?: components["schemas"]["PerfType"];
5418
5401
  /** @example 1700 */
5419
- rating?: number;
5402
+ rating: number;
5420
5403
  };
5421
5404
  ArenaPosition:
5422
5405
  | {
@@ -5438,58 +5421,23 @@ export interface components {
5438
5421
  /** @example rnbq1bnr/ppppkppp/8/4p3/4P3/8/PPPPKPPP/RNBQ1BNR w - - 2 3 */
5439
5422
  fen?: string;
5440
5423
  };
5441
- /** @example {
5442
- * "id": "XhfVxYPG",
5443
- * "createdBy": "lichess",
5444
- * "system": "arena",
5445
- * "minutes": 27,
5446
- * "clock": {
5447
- * "limit": 60,
5448
- * "increment": 0
5449
- * },
5450
- * "rated": true,
5451
- * "fullName": "Hourly Bullet Arena",
5452
- * "nbPlayers": 4,
5453
- * "variant": {
5454
- * "key": "standard",
5455
- * "short": "Std",
5456
- * "name": "Standard"
5457
- * },
5458
- * "startsAt": 1716930043067,
5459
- * "finishesAt": 1716931663067,
5460
- * "status": 10,
5461
- * "perf": {
5462
- * "key": "bullet",
5463
- * "name": "Bullet",
5464
- * "position": 0,
5465
- * "icon": "T"
5466
- * },
5467
- * "secondsToStart": 871,
5468
- * "minRatedGames": {
5469
- * "nb": 20
5470
- * },
5471
- * "schedule": {
5472
- * "freq": "hourly",
5473
- * "speed": "bullet"
5474
- * }
5475
- * } */
5476
5424
  ArenaTournament: {
5477
- id?: string;
5478
- createdBy?: string;
5425
+ id: string;
5426
+ createdBy: string;
5479
5427
  /** @constant */
5480
- system?: "arena";
5481
- minutes?: number;
5482
- clock?: components["schemas"]["Clock"];
5483
- rated?: boolean;
5484
- fullName?: string;
5485
- nbPlayers?: number;
5486
- variant?: components["schemas"]["Variant"];
5428
+ system: "arena";
5429
+ minutes: number;
5430
+ clock: components["schemas"]["Clock"];
5431
+ rated: boolean;
5432
+ fullName: string;
5433
+ nbPlayers: number;
5434
+ variant: components["schemas"]["Variant"];
5487
5435
  /** Format: int64 */
5488
- startsAt?: number;
5436
+ startsAt: number;
5489
5437
  /** Format: int64 */
5490
- finishesAt?: number;
5491
- status?: components["schemas"]["ArenaStatus"];
5492
- perf?: components["schemas"]["ArenaPerf"];
5438
+ finishesAt: number;
5439
+ status: components["schemas"]["ArenaStatus"];
5440
+ perf: components["schemas"]["ArenaPerf"];
5493
5441
  secondsToStart?: number;
5494
5442
  hasMaxRating?: boolean;
5495
5443
  maxRating?: components["schemas"]["ArenaRatingObj"];
@@ -5511,11 +5459,7 @@ export interface components {
5511
5459
  teams?: string[];
5512
5460
  nbLeaders?: number;
5513
5461
  };
5514
- winner?: {
5515
- id?: string;
5516
- name?: string;
5517
- title?: components["schemas"]["Title"];
5518
- };
5462
+ winner?: components["schemas"]["LightUser"];
5519
5463
  };
5520
5464
  ArenaTournaments: {
5521
5465
  created?: components["schemas"]["ArenaTournament"][];
@@ -5556,7 +5500,7 @@ export interface components {
5556
5500
  system?: string;
5557
5501
  secondsToStart?: number;
5558
5502
  secondsToFinish?: number;
5559
- isFinished: boolean;
5503
+ isFinished?: boolean;
5560
5504
  isRecentlyFinished?: boolean;
5561
5505
  pairingsClosed?: boolean;
5562
5506
  /** Format: int64 */
@@ -5568,6 +5512,11 @@ export interface components {
5568
5512
  text?: string;
5569
5513
  author?: string;
5570
5514
  };
5515
+ greatPlayer?: {
5516
+ name?: string;
5517
+ /** Format: uri */
5518
+ url?: string;
5519
+ };
5571
5520
  /** @description List of usernames allowed to join the tournament */
5572
5521
  allowList?: string[];
5573
5522
  hasMaxRating?: boolean;
@@ -5650,7 +5599,7 @@ export interface components {
5650
5599
  };
5651
5600
  performance?: number;
5652
5601
  }[];
5653
- stats: {
5602
+ stats?: {
5654
5603
  games: number;
5655
5604
  moves: number;
5656
5605
  whiteWins: number;
@@ -5659,6 +5608,7 @@ export interface components {
5659
5608
  berserks: number;
5660
5609
  averageRating: number;
5661
5610
  };
5611
+ myUsername?: string;
5662
5612
  };
5663
5613
  /** @example {
5664
5614
  * "error": "This request is invalid because [...]"
@@ -6306,7 +6256,6 @@ export interface components {
6306
6256
  };
6307
6257
  /**
6308
6258
  * @description The current state of the arena tournament
6309
- * @example created
6310
6259
  * @enum {string}
6311
6260
  */
6312
6261
  ArenaStatusName: "created" | "started" | "finished";
@@ -6351,70 +6300,51 @@ export interface components {
6351
6300
  */
6352
6301
  date?: number;
6353
6302
  };
6303
+ /** @enum {integer} */
6304
+ GameStatusId:
6305
+ | 10
6306
+ | 20
6307
+ | 25
6308
+ | 30
6309
+ | 31
6310
+ | 32
6311
+ | 33
6312
+ | 34
6313
+ | 35
6314
+ | 36
6315
+ | 37
6316
+ | 38
6317
+ | 60;
6318
+ GameStatus: {
6319
+ id?: components["schemas"]["GameStatusId"];
6320
+ name?: components["schemas"]["GameStatusName"];
6321
+ };
6322
+ GameEventOpponent: {
6323
+ id?: string;
6324
+ username?: string;
6325
+ rating?: number;
6326
+ };
6354
6327
  GameCompat: {
6355
6328
  /** @description Compatible with Bot API */
6356
6329
  bot?: boolean;
6357
6330
  /** @description Compatible with Board API */
6358
6331
  board?: boolean;
6359
6332
  };
6360
- /** @example {
6361
- * "fullId": "9NaCTu2vz1c4",
6362
- * "gameId": "9NaCTu2v",
6363
- * "fen": "rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1",
6364
- * "color": "white",
6365
- * "lastMove": "",
6366
- * "source": "friend",
6367
- * "status": {
6368
- * "id": 20,
6369
- * "name": "started"
6370
- * },
6371
- * "variant": {
6372
- * "key": "standard",
6373
- * "name": "Standard"
6374
- * },
6375
- * "speed": "blitz",
6376
- * "perf": "blitz",
6377
- * "rated": false,
6378
- * "hasMoved": false,
6379
- * "opponent": {
6380
- * "id": "mary",
6381
- * "username": "Mary",
6382
- * "rating": 1007
6383
- * },
6384
- * "isMyTurn": true,
6385
- * "secondsLeft": 300,
6386
- * "compat": {
6387
- * "bot": false,
6388
- * "board": true
6389
- * },
6390
- * "id": "9NaCTu2v"
6391
- * } */
6392
6333
  GameEventInfo: {
6393
- fullId?: string;
6394
- gameId?: string;
6334
+ fullId: string;
6335
+ gameId: string;
6395
6336
  fen?: string;
6396
6337
  /** @enum {string} */
6397
6338
  color?: "white" | "black";
6398
6339
  lastMove?: string;
6399
6340
  source?: components["schemas"]["GameSource"];
6400
- status?: {
6401
- /** @enum {integer} */
6402
- id?: 10 | 20 | 25 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 60;
6403
- name?: components["schemas"]["GameStatus"];
6404
- };
6405
- variant?: {
6406
- key?: string;
6407
- name?: string;
6408
- };
6341
+ status?: components["schemas"]["GameStatus"];
6342
+ variant?: components["schemas"]["Variant"];
6409
6343
  speed?: components["schemas"]["Speed"];
6410
6344
  perf?: string;
6411
6345
  rated?: boolean;
6412
6346
  hasMoved?: boolean;
6413
- opponent?: {
6414
- id?: string;
6415
- username?: string;
6416
- rating?: number;
6417
- };
6347
+ opponent?: components["schemas"]["GameEventOpponent"];
6418
6348
  isMyTurn?: boolean;
6419
6349
  secondsLeft?: number;
6420
6350
  compat?: components["schemas"]["GameCompat"];
@@ -6647,7 +6577,7 @@ export interface components {
6647
6577
  winc: number;
6648
6578
  /** @description Integer of Black Fisher increment. */
6649
6579
  binc: number;
6650
- status: components["schemas"]["GameStatus"];
6580
+ status: components["schemas"]["GameStatusName"];
6651
6581
  /** @description Color of the winner, if any */
6652
6582
  winner?: string;
6653
6583
  /** @description true if white is offering draw, else omitted */
@@ -6751,7 +6681,7 @@ export interface components {
6751
6681
  * "gone": true,
6752
6682
  * "claimWinInSeconds": 8
6753
6683
  * } */
6754
- OpponentGone: {
6684
+ OpponentGoneEvent: {
6755
6685
  /** @constant */
6756
6686
  type: "opponentGone";
6757
6687
  gone: boolean;
@@ -6892,45 +6822,22 @@ export interface components {
6892
6822
  | "racingkings"
6893
6823
  | "3check";
6894
6824
  ExternalEngine: {
6895
- /**
6896
- * @description Unique engine registration ID.
6897
- * @example eei_aTKImBJOnv6j
6898
- */
6825
+ /** @description Unique engine registration ID. */
6899
6826
  id: string;
6900
- /**
6901
- * @description Display name of the engine.
6902
- * @example Stockfish 15
6903
- */
6827
+ /** @description Display name of the engine. */
6904
6828
  name: string;
6905
- /**
6906
- * @description A secret token that can be used to
6829
+ /** @description A secret token that can be used to
6907
6830
  * [*request* analysis](#tag/External-engine/operation/apiExternalEngineAnalyse)
6908
6831
  * from this external engine.
6909
- *
6910
- * @example ees_mdF2hK0hlKGSPeC6
6911
- */
6832
+ * */
6912
6833
  clientSecret: string;
6913
- /**
6914
- * @description The user this engine has been registered for.
6915
- * @example thibault
6916
- */
6834
+ /** @description The user this engine has been registered for. */
6917
6835
  userId: string;
6918
- /**
6919
- * @description Maximum number of available threads.
6920
- * @example 8
6921
- */
6836
+ /** @description Maximum number of available threads. */
6922
6837
  maxThreads: number;
6923
- /**
6924
- * @description Maximum available hash table size, in MiB.
6925
- * @example 2048
6926
- */
6838
+ /** @description Maximum available hash table size, in MiB. */
6927
6839
  maxHash: number;
6928
- /**
6929
- * @description List of supported chess variants.
6930
- * @example [
6931
- * "chess"
6932
- * ]
6933
- */
6840
+ /** @description List of supported chess variants. */
6934
6841
  variants: components["schemas"]["UciVariant"][];
6935
6842
  /** @description Arbitrary data that the engine provider can use for identification
6936
6843
  * or bookkeeping.
@@ -6938,7 +6845,7 @@ export interface components {
6938
6845
  * Users can read this information, but updating it requires knowing
6939
6846
  * or changing the `providerSecret`.
6940
6847
  * */
6941
- providerData?: string;
6848
+ providerData?: string | null;
6942
6849
  };
6943
6850
  ExternalEngineRegistration: {
6944
6851
  /**
@@ -6983,50 +6890,36 @@ export interface components {
6983
6890
  * */
6984
6891
  providerData?: string;
6985
6892
  };
6986
- ExternalEngineWork: {
6987
- /**
6988
- * @description Arbitary string that identifies the analysis session.
6893
+ ExternalEngineWorkCommon: {
6894
+ /** @description Arbitary string that identifies the analysis session.
6989
6895
  * Providers may wish to clear the hash table between sessions.
6990
- *
6991
- * @example abcd1234
6992
- */
6896
+ * */
6993
6897
  sessionId: string;
6994
- /**
6995
- * @description Number of threads to use for analysis.
6996
- * @example 4
6997
- */
6898
+ /** @description Number of threads to use for analysis. */
6998
6899
  threads: number;
6999
- /**
7000
- * @description Hash table size to use for analysis, in MiB.
7001
- * @example 128
7002
- */
6900
+ /** @description Hash table size to use for analysis, in MiB. */
7003
6901
  hash: number;
7004
- /**
7005
- * @description Requested number of principal variations.
7006
- * @example 1
7007
- */
6902
+ /** @description Requested number of principal variations. */
7008
6903
  multiPv: number;
7009
6904
  variant: components["schemas"]["UciVariant"];
7010
- /**
7011
- * @description Initial position of the game.
7012
- * @example rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1
7013
- */
6905
+ /** @description Initial position of the game. */
7014
6906
  initialFen: string;
7015
- /**
7016
- * @description List of moves played from the initial position, in UCI notation.
7017
- * @example [
7018
- * "e2e4",
7019
- * "g8f6"
7020
- * ]
7021
- */
6907
+ /** @description List of moves played from the initial position, in UCI notation. */
7022
6908
  moves: string[];
7023
- /** @description Amount of time to analyse the position, in milliseconds. */
7024
- movetime?: number;
7025
- /** @description Analysis target depth */
7026
- depth?: number;
7027
- /** @description Number of nodes to analyse in the position */
7028
- nodes?: number;
7029
6909
  };
6910
+ ExternalEngineWork:
6911
+ | ({
6912
+ /** @description Amount of time to analyse the position, in milliseconds. */
6913
+ movetime: number;
6914
+ } & components["schemas"]["ExternalEngineWorkCommon"])
6915
+ | ({
6916
+ /** @description Analysis target depth */
6917
+ depth: number;
6918
+ } & components["schemas"]["ExternalEngineWorkCommon"])
6919
+ | ({
6920
+ /** @description Number of nodes to analyse in the position */
6921
+ nodes: number;
6922
+ } & components["schemas"]["ExternalEngineWorkCommon"]);
7030
6923
  /** @example {
7031
6924
  * "error": "invalid_grant",
7032
6925
  * "error_description": "hash of code_verifier does not match code_challenge"
@@ -8378,7 +8271,7 @@ export interface operations {
8378
8271
  color: "white" | "black";
8379
8272
  lastMove: string;
8380
8273
  source: components["schemas"]["GameSource"];
8381
- status?: components["schemas"]["GameStatus"];
8274
+ status?: components["schemas"]["GameStatusName"];
8382
8275
  variant: components["schemas"]["Variant"];
8383
8276
  speed: components["schemas"]["Speed"];
8384
8277
  perf: components["schemas"]["PerfType"];
@@ -9483,7 +9376,7 @@ export interface operations {
9483
9376
  username: string;
9484
9377
  performance: number;
9485
9378
  title?: components["schemas"]["Title"];
9486
- team: string;
9379
+ team?: string;
9487
9380
  flair?: components["schemas"]["Flair"];
9488
9381
  sheet?: components["schemas"]["ArenaSheet"];
9489
9382
  };
@@ -11938,7 +11831,7 @@ export interface operations {
11938
11831
  | components["schemas"]["GameFullEvent"]
11939
11832
  | components["schemas"]["GameStateEvent"]
11940
11833
  | components["schemas"]["ChatLineEvent"]
11941
- | components["schemas"]["OpponentGone"];
11834
+ | components["schemas"]["OpponentGoneEvent"];
11942
11835
  };
11943
11836
  };
11944
11837
  /** @description The game was not found. */
@@ -12323,7 +12216,7 @@ export interface operations {
12323
12216
  | components["schemas"]["GameFullEvent"]
12324
12217
  | components["schemas"]["GameStateEvent"]
12325
12218
  | components["schemas"]["ChatLineEvent"]
12326
- | components["schemas"]["OpponentGone"];
12219
+ | components["schemas"]["OpponentGoneEvent"];
12327
12220
  };
12328
12221
  };
12329
12222
  /** @description The bot game was not found. */
@@ -12912,24 +12805,7 @@ export interface operations {
12912
12805
  fen?: string;
12913
12806
  turns?: number;
12914
12807
  source?: components["schemas"]["GameSource"];
12915
- status?: {
12916
- /** @enum {integer} */
12917
- id?:
12918
- | 10
12919
- | 20
12920
- | 25
12921
- | 30
12922
- | 31
12923
- | 32
12924
- | 33
12925
- | 34
12926
- | 35
12927
- | 36
12928
- | 37
12929
- | 38
12930
- | 60;
12931
- name?: components["schemas"]["GameStatus"];
12932
- };
12808
+ status?: components["schemas"]["GameStatus"];
12933
12809
  /** Format: int64 */
12934
12810
  createdAt?: number;
12935
12811
  /** @enum {string} */
@@ -13652,46 +13528,21 @@ export interface operations {
13652
13528
  };
13653
13529
  content: {
13654
13530
  "application/x-ndjson": {
13655
- /**
13656
- * @description Number of milliseconds the search has been going on
13657
- * @example 6880
13658
- */
13531
+ /** @description Number of milliseconds the search has been going on */
13659
13532
  time: number;
13660
- /**
13661
- * @description Current search depth
13662
- * @example 25
13663
- */
13533
+ /** @description Current search depth */
13664
13534
  depth: number;
13665
- /**
13666
- * @description Number of nodes visited so far
13667
- * @example 7230340
13668
- */
13535
+ /** @description Number of nodes visited so far */
13669
13536
  nodes: number;
13670
13537
  /** @description Information about up to 5 pvs, with the primary pv at index 0. */
13671
13538
  pvs: {
13672
- /**
13673
- * @description Current search depth of the pv
13674
- * @example 25
13675
- */
13539
+ /** @description Current search depth of the pv */
13676
13540
  depth: number;
13677
- /**
13678
- * @description Evaluation in centi-pawns, from White's point of view
13679
- * @example 40
13680
- */
13541
+ /** @description Evaluation in centi-pawns, from White's point of view */
13681
13542
  cp?: number;
13682
13543
  /** @description Evaluation in signed moves to mate, from White's point of view */
13683
13544
  mate?: number;
13684
- /**
13685
- * @description Variation in UCI notation
13686
- * @example [
13687
- * "e2e4",
13688
- * "c7c6",
13689
- * "g1f3",
13690
- * "d7d5",
13691
- * "d2d3",
13692
- * "d5e4"
13693
- * ]
13694
- */
13545
+ /** @description Variation in UCI notation */
13695
13546
  moves: string[];
13696
13547
  }[];
13697
13548
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lichess-org/types",
3
- "version": "2.0.43",
3
+ "version": "2.0.45",
4
4
  "description": "Lichess.org API types",
5
5
  "homepage": "https://github.com/lichess-org/api",
6
6
  "license": "AGPL-3.0-or-later",