@lichess-org/types 2.0.20 → 2.0.22

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 +304 -69
  2. package/package.json +2 -2
package/lichess-api.d.ts CHANGED
@@ -824,7 +824,7 @@ export interface paths {
824
824
  };
825
825
  /**
826
826
  * Get current tournaments
827
- * @description Get recently finished, ongoing, and upcoming tournaments.
827
+ * @description Get recently active and finished tournaments.
828
828
  * This API is used to display the [Lichess tournament schedule](https://lichess.org/tournament).
829
829
  *
830
830
  */
@@ -1736,7 +1736,7 @@ export interface paths {
1736
1736
  patch?: never;
1737
1737
  trace?: never;
1738
1738
  };
1739
- "/broadcast/round/{broadcastRoundId}/push": {
1739
+ "/api/broadcast/round/{broadcastRoundId}/push": {
1740
1740
  parameters: {
1741
1741
  query?: never;
1742
1742
  header?: never;
@@ -4294,6 +4294,134 @@ export interface components {
4294
4294
  * }
4295
4295
  * } */
4296
4296
  PerfStat: unknown;
4297
+ UserActivityScore: {
4298
+ win: number;
4299
+ loss: number;
4300
+ draw: number;
4301
+ rp: {
4302
+ before?: number;
4303
+ after?: number;
4304
+ };
4305
+ };
4306
+ /**
4307
+ * @default standard
4308
+ * @example standard
4309
+ * @enum {string}
4310
+ */
4311
+ VariantKey:
4312
+ | "standard"
4313
+ | "chess960"
4314
+ | "crazyhouse"
4315
+ | "antichess"
4316
+ | "atomic"
4317
+ | "horde"
4318
+ | "kingOfTheHill"
4319
+ | "racingKings"
4320
+ | "threeCheck"
4321
+ | "fromPosition";
4322
+ UserActivityCorrespondenceGame: {
4323
+ id: string;
4324
+ /** @enum {string} */
4325
+ color: "white" | "black";
4326
+ url: string;
4327
+ variant: components["schemas"]["VariantKey"];
4328
+ /** @constant */
4329
+ speed: "correspondence";
4330
+ /** @constant */
4331
+ perf: "correspondence";
4332
+ rated: boolean;
4333
+ opponent: {
4334
+ user: string;
4335
+ rating: number;
4336
+ };
4337
+ };
4338
+ UserActivityFollowList: {
4339
+ ids: string[];
4340
+ nb?: number;
4341
+ };
4342
+ UserActivity: {
4343
+ interval: {
4344
+ start: number;
4345
+ end: number;
4346
+ };
4347
+ games?: {
4348
+ chess960?: components["schemas"]["UserActivityScore"];
4349
+ atomic?: components["schemas"]["UserActivityScore"];
4350
+ racingKings?: components["schemas"]["UserActivityScore"];
4351
+ ultraBullet?: components["schemas"]["UserActivityScore"];
4352
+ blitz?: components["schemas"]["UserActivityScore"];
4353
+ kingOfTheHill?: components["schemas"]["UserActivityScore"];
4354
+ bullet?: components["schemas"]["UserActivityScore"];
4355
+ correspondence?: components["schemas"]["UserActivityScore"];
4356
+ horde?: components["schemas"]["UserActivityScore"];
4357
+ puzzle?: components["schemas"]["UserActivityScore"];
4358
+ classical?: components["schemas"]["UserActivityScore"];
4359
+ rapid?: components["schemas"]["UserActivityScore"];
4360
+ };
4361
+ puzzles?: {
4362
+ score?: components["schemas"]["UserActivityScore"];
4363
+ };
4364
+ storm?: {
4365
+ runs?: number;
4366
+ score?: number;
4367
+ };
4368
+ racer?: {
4369
+ runs?: number;
4370
+ score?: number;
4371
+ };
4372
+ streak?: {
4373
+ runs?: number;
4374
+ score?: number;
4375
+ };
4376
+ tournaments?: {
4377
+ nb?: number;
4378
+ best?: {
4379
+ tournament: {
4380
+ id: string;
4381
+ name: string;
4382
+ };
4383
+ nbGames: number;
4384
+ score: number;
4385
+ rank: number;
4386
+ rankPercent: number;
4387
+ }[];
4388
+ };
4389
+ practice?: {
4390
+ url: string;
4391
+ name: string;
4392
+ nbPositions: number;
4393
+ }[];
4394
+ simuls?: string[];
4395
+ correspondenceMoves?: {
4396
+ nb: number;
4397
+ games: components["schemas"]["UserActivityCorrespondenceGame"][];
4398
+ };
4399
+ correspondenceEnds?: {
4400
+ score: components["schemas"]["UserActivityScore"];
4401
+ games: components["schemas"]["UserActivityCorrespondenceGame"][];
4402
+ };
4403
+ follows?: {
4404
+ in?: components["schemas"]["UserActivityFollowList"];
4405
+ out?: components["schemas"]["UserActivityFollowList"];
4406
+ };
4407
+ studies?: Record<string, never>;
4408
+ teams?: {
4409
+ url: string;
4410
+ name: string;
4411
+ }[];
4412
+ posts?: {
4413
+ topicUrl: string;
4414
+ topicName: string;
4415
+ posts: {
4416
+ url: string;
4417
+ text: string;
4418
+ }[];
4419
+ }[];
4420
+ patron?: {
4421
+ months: number;
4422
+ };
4423
+ stream?: boolean;
4424
+ };
4297
4425
  /** @example {
4298
4426
  * "game": {
4299
4427
  * "clock": "3+0",
@@ -5019,23 +5147,7 @@ export interface components {
5019
5147
  *
5020
5148
  * 1. e4 { [%clk 0:03:00] } e5 { [%clk 0:03:00] } 2. Nf3 { [%clk 0:02:59] } Nc6 { [%clk 0:02:58] } 3. Bb5 { [%clk 0:02:57] } d6 { [%clk 0:02:55] } 4. h3 { [%clk 0:02:54] } Nf6 { [%clk 0:02:52] } 5. Bxc6+ { [%clk 0:02:52] } bxc6 { [%clk 0:02:49] } 6. d3 { [%clk 0:02:51] } Be7 { [%clk 0:02:46] } 7. O-O { [%clk 0:02:47] } O-O { [%clk 0:02:45] } 8. b3 { [%clk 0:02:45] } d5 { [%clk 0:02:45] } 9. exd5 { [%clk 0:02:33] } cxd5 { [%clk 0:02:40] } 10. Nxe5 { [%clk 0:02:31] } Qd6 { [%clk 0:02:38] } 1-0
5021
5149
  * */
5022
- GamePgn: unknown;
5023
- /**
5024
- * @default standard
5025
- * @example standard
5026
- * @enum {string}
5027
- */
5028
- VariantKey:
5029
- | "standard"
5030
- | "chess960"
5031
- | "crazyhouse"
5032
- | "antichess"
5033
- | "atomic"
5034
- | "horde"
5035
- | "kingOfTheHill"
5036
- | "racingKings"
5037
- | "threeCheck"
5038
- | "fromPosition";
5150
+ GamePgn: string;
5039
5151
  /** @enum {string} */
5040
5152
  Speed:
5041
5153
  | "ultraBullet"
@@ -5218,9 +5330,54 @@ export interface components {
5218
5330
  * "rating": 2288
5219
5331
  * }
5220
5332
  * }
5333
+ * },
5334
+ * {
5335
+ * "id": "A5fcMO3k",
5336
+ * "rated": true,
5337
+ * "variant": "standard",
5338
+ * "speed": "bullet",
5339
+ * "perf": "bullet",
5340
+ * "createdAt": 1525789431889,
5341
+ * "status": 31,
5342
+ * "statusName": "resign",
5343
+ * "clock": {
5344
+ * "initial": 60,
5345
+ * "increment": 0,
5346
+ * "totalTime": 60
5347
+ * },
5348
+ * "players": {
5349
+ * "white": {
5350
+ * "userId": "kastorcito",
5351
+ * "rating": 2617
5352
+ * },
5353
+ * "black": {
5354
+ * "userId": "er_or",
5355
+ * "rating": 2288
5356
+ * }
5357
+ * },
5358
+ * "winner": "white"
5221
5359
  * }
5222
5360
  * ] */
5223
5361
  GameStream: unknown;
5362
+ /** @enum {string} */
5363
+ GameSource:
5364
+ | "lobby"
5365
+ | "friend"
5366
+ | "ai"
5367
+ | "api"
5368
+ | "tournament"
5369
+ | "position"
5370
+ | "import"
5371
+ | "importlive"
5372
+ | "simul"
5373
+ | "relay"
5374
+ | "pool"
5375
+ | "swiss";
5376
+ Variant: {
5377
+ key?: components["schemas"]["VariantKey"];
5378
+ name?: string;
5379
+ short?: string;
5380
+ };
5224
5381
  /** @example [
5225
5382
  * {
5226
5383
  * "id": "LuGQwhBb",
@@ -5293,6 +5450,15 @@ export interface components {
5293
5450
  * }
5294
5451
  * ] */
5295
5452
  MoveStream: unknown;
5453
+ TvGame: {
5454
+ user: components["schemas"]["LightUser"] & {
5455
+ flair?: components["schemas"]["Flair"];
5456
+ };
5457
+ rating: number;
5458
+ gameId: string;
5459
+ /** @enum {string} */
5460
+ color: "white" | "black";
5461
+ };
5296
5462
  TvFeed: {
5297
5463
  /**
5298
5464
  * @description The type of message.
@@ -5339,11 +5505,6 @@ export interface components {
5339
5505
  limit?: number;
5340
5506
  increment?: number;
5341
5507
  };
5342
- Variant: {
5343
- key?: components["schemas"]["VariantKey"];
5344
- name?: string;
5345
- short?: string;
5346
- };
5347
5508
  /**
5348
5509
  * @description 10: created, 20: started, 30: finished
5349
5510
  *
@@ -5478,6 +5639,10 @@ export interface components {
5478
5639
  verdict: string;
5479
5640
  }[];
5480
5641
  };
5642
+ ArenaSheet: {
5643
+ scores: string;
5644
+ fire?: boolean;
5645
+ };
5481
5646
  ArenaPlayerPerformance: {
5482
5647
  name?: string;
5483
5648
  rank?: number;
@@ -5485,10 +5650,8 @@ export interface components {
5485
5650
  patron?: boolean;
5486
5651
  rating?: number;
5487
5652
  score?: number;
5488
- sheet?: {
5489
- scores?: string;
5490
- fire?: boolean;
5491
- };
5653
+ flair?: components["schemas"]["Flair"];
5654
+ sheet?: components["schemas"]["ArenaSheet"];
5492
5655
  nb?: {
5493
5656
  game?: number;
5494
5657
  beserk?: number;
@@ -6056,7 +6219,6 @@ export interface components {
6056
6219
  };
6057
6220
  BroadcastTop: {
6058
6221
  active?: components["schemas"]["BroadcastWithLastRound"][];
6059
- upcoming?: components["schemas"]["BroadcastWithLastRound"][];
6060
6222
  past?: {
6061
6223
  /** @example 4 */
6062
6224
  currentPage?: number;
@@ -6607,7 +6769,6 @@ export interface components {
6607
6769
  id: string;
6608
6770
  name: string;
6609
6771
  description?: string;
6610
- leader?: components["schemas"]["LightUser"];
6611
6772
  flair?: components["schemas"]["Flair"];
6612
6773
  leaders?: components["schemas"]["LightUser"][];
6613
6774
  nbMembers?: number;
@@ -6675,20 +6836,7 @@ export interface components {
6675
6836
  };
6676
6837
  GameEventInfo: {
6677
6838
  id?: string;
6678
- /** @enum {string} */
6679
- source?:
6680
- | "lobby"
6681
- | "friend"
6682
- | "ai"
6683
- | "api"
6684
- | "tournament"
6685
- | "position"
6686
- | "import"
6687
- | "importlive"
6688
- | "simul"
6689
- | "relay"
6690
- | "pool"
6691
- | "swiss";
6839
+ source?: components["schemas"]["GameSource"];
6692
6840
  status?: {
6693
6841
  /** @enum {integer} */
6694
6842
  id?: 10 | 20 | 25 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 60;
@@ -8152,7 +8300,7 @@ export interface operations {
8152
8300
  [name: string]: unknown;
8153
8301
  };
8154
8302
  content: {
8155
- "application/json": unknown;
8303
+ "application/json": components["schemas"]["UserActivity"];
8156
8304
  };
8157
8305
  };
8158
8306
  };
@@ -8894,7 +9042,37 @@ export interface operations {
8894
9042
  [name: string]: unknown;
8895
9043
  };
8896
9044
  content: {
8897
- "application/json": unknown;
9045
+ "application/json": {
9046
+ nowPlaying: {
9047
+ fullId: string;
9048
+ gameId: string;
9049
+ fen: string;
9050
+ /** @enum {string} */
9051
+ color: "white" | "black";
9052
+ lastMove: string;
9053
+ source: components["schemas"]["GameSource"];
9054
+ status?: components["schemas"]["GameStatus"];
9055
+ variant: components["schemas"]["Variant"];
9056
+ speed: components["schemas"]["Speed"];
9057
+ perf: components["schemas"]["PerfType"];
9058
+ rated: boolean;
9059
+ hasMoved: boolean;
9060
+ opponent: {
9061
+ id: string;
9062
+ username: string;
9063
+ rating?: number;
9064
+ ratingDiff?: number;
9065
+ ai?: number;
9066
+ };
9067
+ isMyTurn: boolean;
9068
+ secondsLeft: number;
9069
+ tournamentId?: string;
9070
+ swissId?: string;
9071
+ /** @enum {string} */
9072
+ winner?: "white" | "black";
9073
+ ratingDiff?: number;
9074
+ }[];
9075
+ };
8898
9076
  };
8899
9077
  };
8900
9078
  };
@@ -8998,7 +9176,24 @@ export interface operations {
8998
9176
  [name: string]: unknown;
8999
9177
  };
9000
9178
  content: {
9001
- "application/json": unknown;
9179
+ "application/json": {
9180
+ bot: components["schemas"]["TvGame"];
9181
+ blitz: components["schemas"]["TvGame"];
9182
+ racingKings: components["schemas"]["TvGame"];
9183
+ ultraBullet: components["schemas"]["TvGame"];
9184
+ bullet: components["schemas"]["TvGame"];
9185
+ classical: components["schemas"]["TvGame"];
9186
+ threeCheck: components["schemas"]["TvGame"];
9187
+ antichess: components["schemas"]["TvGame"];
9188
+ computer: components["schemas"]["TvGame"];
9189
+ horde: components["schemas"]["TvGame"];
9190
+ rapid: components["schemas"]["TvGame"];
9191
+ atomic: components["schemas"]["TvGame"];
9192
+ crazyhouse: components["schemas"]["TvGame"];
9193
+ chess960: components["schemas"]["TvGame"];
9194
+ kingOfTheHill: components["schemas"]["TvGame"];
9195
+ best: components["schemas"]["TvGame"];
9196
+ };
9002
9197
  };
9003
9198
  };
9004
9199
  };
@@ -9840,7 +10035,17 @@ export interface operations {
9840
10035
  [name: string]: unknown;
9841
10036
  };
9842
10037
  content: {
9843
- "application/x-ndjson": unknown;
10038
+ "application/x-ndjson": {
10039
+ rank: number;
10040
+ score: number;
10041
+ rating: number;
10042
+ username: string;
10043
+ performance: number;
10044
+ title?: components["schemas"]["Title"];
10045
+ team: string;
10046
+ flair?: components["schemas"]["Flair"];
10047
+ sheet?: components["schemas"]["ArenaSheet"];
10048
+ };
9844
10049
  };
9845
10050
  };
9846
10051
  };
@@ -9864,7 +10069,18 @@ export interface operations {
9864
10069
  [name: string]: unknown;
9865
10070
  };
9866
10071
  content: {
9867
- "application/json": unknown;
10072
+ "application/json": {
10073
+ id: string;
10074
+ teams: {
10075
+ rank: number;
10076
+ id: string;
10077
+ score: number;
10078
+ players: {
10079
+ user: components["schemas"]["LightUser"];
10080
+ score?: number;
10081
+ }[];
10082
+ }[];
10083
+ };
9868
10084
  };
9869
10085
  };
9870
10086
  };
@@ -10630,7 +10846,16 @@ export interface operations {
10630
10846
  [name: string]: unknown;
10631
10847
  };
10632
10848
  content: {
10633
- "application/x-ndjson": unknown;
10849
+ "application/x-ndjson": {
10850
+ absent?: boolean;
10851
+ rank: number;
10852
+ points: number;
10853
+ tieBreak: number;
10854
+ rating: number;
10855
+ username: string;
10856
+ title?: components["schemas"]["Title"];
10857
+ performance: number;
10858
+ };
10634
10859
  };
10635
10860
  };
10636
10861
  };
@@ -10954,7 +11179,7 @@ export interface operations {
10954
11179
  broadcastsTop: {
10955
11180
  parameters: {
10956
11181
  query?: {
10957
- /** @description Which page to fetch. Only page 1 has "active" and "upcoming" broadcasts. */
11182
+ /** @description Which page to fetch. Only page 1 has "active" broadcasts. */
10958
11183
  page?: number;
10959
11184
  /**
10960
11185
  * @description Convert the "description" field from markdown to HTML
@@ -12063,27 +12288,32 @@ export interface operations {
12063
12288
  * @example true
12064
12289
  */
12065
12290
  rated?: boolean;
12066
- /**
12067
- * @description Clock initial time in minutes. Required for real-time seeks.
12068
- * @example 15
12069
- */
12070
- time?: number;
12071
- /**
12072
- * @description Clock increment in seconds. Required for real-time seeks.
12073
- * @example 15
12074
- */
12075
- increment?: number;
12076
- /**
12077
- * @description Days per turn. Required for correspondence seeks.
12078
- * @enum {integer}
12079
- */
12080
- days?: 1 | 2 | 3 | 5 | 7 | 10 | 14;
12081
12291
  variant?: components["schemas"]["VariantKey"];
12082
12292
  /** @description The rating range of potential opponents. Better left empty.
12083
12293
  * Example: 1500-1800
12084
12294
  * */
12085
12295
  ratingRange?: string;
12086
- };
12296
+ } & (
12297
+ | {
12298
+ /**
12299
+ * @description Clock initial time in minutes. Required for real-time seeks.
12300
+ * @example 15
12301
+ */
12302
+ time: number;
12303
+ /**
12304
+ * @description Clock increment in seconds. Required for real-time seeks.
12305
+ * @example 15
12306
+ */
12307
+ increment: number;
12308
+ }
12309
+ | {
12310
+ /**
12311
+ * @description Days per turn. Required for correspondence seeks.
12312
+ * @enum {integer}
12313
+ */
12314
+ days: 1 | 2 | 3 | 5 | 7 | 10 | 14;
12315
+ }
12316
+ );
12087
12317
  };
12088
12318
  };
12089
12319
  responses: {
@@ -12094,7 +12324,10 @@ export interface operations {
12094
12324
  [name: string]: unknown;
12095
12325
  };
12096
12326
  content: {
12097
- "text/plain": unknown;
12327
+ "application/json": {
12328
+ id: string;
12329
+ };
12330
+ "application/x-ndjson": unknown;
12098
12331
  };
12099
12332
  };
12100
12333
  /** @description The creation of the seek failed. */
@@ -13510,7 +13743,9 @@ export interface operations {
13510
13743
  [name: string]: unknown;
13511
13744
  };
13512
13745
  content: {
13513
- "application/json": unknown;
13746
+ "application/json": {
13747
+ [key: string]: string;
13748
+ };
13514
13749
  };
13515
13750
  };
13516
13751
  /** @description The creation of the tokens failed. */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lichess-org/types",
3
- "version": "2.0.20",
3
+ "version": "2.0.22",
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,7 +11,7 @@
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.4.4",
14
+ "openapi-typescript": "^7.5.2",
15
15
  "prettier": "^3.4.2",
16
16
  "typescript": "^5.7.2"
17
17
  },