@lichess-org/types 2.0.15 → 2.0.17

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 +167 -60
  2. package/package.json +1 -1
package/lichess-api.d.ts CHANGED
@@ -1029,6 +1029,10 @@ export interface paths {
1029
1029
  * @description Get all tournaments created by a given user.
1030
1030
  * Tournaments are sorted by reverse chronological order of start date (last starting first).
1031
1031
  * Tournaments are streamed as [ndjson](#section/Introduction/Streaming-with-ND-JSON).
1032
+ * The stream is throttled, depending on who is making the request:
1033
+ * - Anonymous request: 20 tournaments per second
1034
+ * - [OAuth2 authenticated](#section/Introduction/Authentication) request: 30 tournaments per second
1035
+ * - Authenticated, downloading your own tournaments: 50 games per second
1032
1036
  *
1033
1037
  */
1034
1038
  get: operations["apiUserNameTournamentCreated"];
@@ -1040,6 +1044,33 @@ export interface paths {
1040
1044
  patch?: never;
1041
1045
  trace?: never;
1042
1046
  };
1047
+ "/api/user/{username}/tournament/played": {
1048
+ parameters: {
1049
+ query?: never;
1050
+ header?: never;
1051
+ path?: never;
1052
+ cookie?: never;
1053
+ };
1054
+ /**
1055
+ * Get tournaments played by a user
1056
+ * @description Get all tournaments played by a given user.
1057
+ * Tournaments are sorted by reverse chronological order of start date (last played first).
1058
+ * Tournaments are streamed as [ndjson](#section/Introduction/Streaming-with-ND-JSON).
1059
+ * The stream is throttled, depending on who is making the request:
1060
+ * - Anonymous request: 20 tournaments per second
1061
+ * - [OAuth2 authenticated](#section/Introduction/Authentication) request: 30 tournaments per second
1062
+ * - Authenticated, downloading your own tournaments: 50 games per second
1063
+ *
1064
+ */
1065
+ get: operations["apiUserNameTournamentPlayed"];
1066
+ put?: never;
1067
+ post?: never;
1068
+ delete?: never;
1069
+ options?: never;
1070
+ head?: never;
1071
+ patch?: never;
1072
+ trace?: never;
1073
+ };
1043
1074
  "/api/swiss/new/{teamId}": {
1044
1075
  parameters: {
1045
1076
  query?: never;
@@ -1235,7 +1266,7 @@ export interface paths {
1235
1266
  /**
1236
1267
  * Export games of a Swiss tournament
1237
1268
  * @description Download games of a swiss tournament in PGN or [ndjson](#section/Introduction/Streaming-with-ND-JSON) format.
1238
- * Games are sorted by reverse chronological order (last round first).
1269
+ * Games are sorted by chronological order.
1239
1270
  * The game stream is throttled, depending on who is making the request:
1240
1271
  * - Anonymous request: 20 games per second
1241
1272
  * - [OAuth2 authenticated](#section/Introduction/Authentication) request: 30 games per second
@@ -5570,6 +5601,21 @@ export interface components {
5570
5601
  /** @description The cause of the error. */
5571
5602
  error?: string;
5572
5603
  };
5604
+ ArenaTournamentPlayed: {
5605
+ tournament?: components["schemas"]["ArenaTournament"];
5606
+ /** @example {
5607
+ * "games": 10,
5608
+ * "score": 14,
5609
+ * "rank": 30,
5610
+ * "performance": 1935
5611
+ * } */
5612
+ player?: {
5613
+ games: number;
5614
+ score: number;
5615
+ rank: number;
5616
+ performance?: number;
5617
+ };
5618
+ };
5573
5619
  /**
5574
5620
  * @description Custom initial position (in FEN). Variant must be standard and the game cannot be rated.
5575
5621
  * @default rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1
@@ -5932,58 +5978,7 @@ export interface components {
5932
5978
  /** @description Name of the broadcast round.
5933
5979
  * Example: `Round 1`
5934
5980
  * */
5935
- name: string;
5936
- /** @description Filter games by round number
5937
- *
5938
- * Optional, only keep games from the source that match a round number.
5939
- * It uses the PGN **Round** tag. These would match round 3:
5940
- * ```txt
5941
- * [Round "3"]
5942
- * [Round "3.1"]
5943
- * ```
5944
- * If you set a round number, then games without a **Round** tag are dropped.
5945
- *
5946
- * It only works if you chose `syncUrl` or `syncUrls` as the source.
5947
- * */
5948
- onlyRound?: number;
5949
- /** @description Select slices of the games
5950
- *
5951
- * Optional. Select games based on their position in the source.
5952
- * ```txt
5953
- * 1 only select the first board
5954
- * 1-4 only select the first 4 boards
5955
- * 1,2,3,4 same as above, first 4 boards
5956
- * 11-15,21-25 boards 11 to 15, and boards 21 to 25
5957
- * 2,3,7-9 boards 2, 3, 7, 8, and 9
5958
- * ```
5959
- * Slicing is done after filtering by round number.
5960
- *
5961
- * It only works if you chose `syncUrl` or `syncUrls` as the source.
5962
- * */
5963
- slices?: string;
5964
- /** @description Timestamp in milliseconds of broadcast round start. Leave empty to manually start the broadcast round.
5965
- * Example: `1356998400070`
5966
- * */
5967
- startsAt?: number;
5968
- /**
5969
- * @description The start date is unknown, and the round will start automatically when the previous round completes.
5970
- *
5971
- * @default false
5972
- */
5973
- startsAfterPrevious?: boolean;
5974
- /** @description Delay in seconds for movements to appear on the broadcast. Leave it empty if you don't need it.
5975
- * Example: `900` (15 min)
5976
- * */
5977
- delay?: number;
5978
- /**
5979
- * @description Mark whether the round has been completed.
5980
- *
5981
- * @default false
5982
- */
5983
- finished?: boolean;
5984
- /** @description (Only for Admins) Waiting time for each poll.
5985
- * */
5986
- period?: number;
5981
+ name?: string;
5987
5982
  } & (
5988
5983
  | Record<string, never>
5989
5984
  | {
@@ -5999,6 +5994,34 @@ export interface components {
5999
5994
  *
6000
5995
  */
6001
5996
  syncUrl?: string;
5997
+ /** @description Filter games by round number
5998
+ *
5999
+ * Optional, only keep games from the source that match a round number.
6000
+ * It uses the PGN **Round** tag. These would match round 3:
6001
+ * ```txt
6002
+ * [Round "3"]
6003
+ * [Round "3.1"]
6004
+ * ```
6005
+ * If you set a round number, then games without a **Round** tag are dropped.
6006
+ *
6007
+ * It only works if you chose `syncUrl` or `syncUrls` as the source.
6008
+ * */
6009
+ onlyRound?: number;
6010
+ /** @description Select slices of the games
6011
+ *
6012
+ * Optional. Select games based on their position in the source.
6013
+ * ```txt
6014
+ * 1 only select the first board
6015
+ * 1-4 only select the first 4 boards
6016
+ * 1,2,3,4 same as above, first 4 boards
6017
+ * 11-15,21-25 boards 11 to 15, and boards 21 to 25
6018
+ * 2,3,7-9 boards 2, 3, 7, 8, and 9
6019
+ * ```
6020
+ * Slicing is done after filtering by round number.
6021
+ *
6022
+ * It only works if you chose `syncUrl` or `syncUrls` as the source.
6023
+ * */
6024
+ slices?: string;
6002
6025
  }
6003
6026
  | {
6004
6027
  /** @description URLs that Lichess will poll to get updates about the games, separated by newlines. They must be publicly accessible from the Internet.
@@ -6011,6 +6034,34 @@ export interface components {
6011
6034
  * Choose one between `syncUrl`, `syncUrls` and `syncIds`, if it is missing, the broadcast needs to be fed by [pushing PGN to it](#operation/broadcastPush)
6012
6035
  * */
6013
6036
  syncUrls?: string;
6037
+ /** @description Filter games by round number
6038
+ *
6039
+ * Optional, only keep games from the source that match a round number.
6040
+ * It uses the PGN **Round** tag. These would match round 3:
6041
+ * ```txt
6042
+ * [Round "3"]
6043
+ * [Round "3.1"]
6044
+ * ```
6045
+ * If you set a round number, then games without a **Round** tag are dropped.
6046
+ *
6047
+ * It only works if you chose `syncUrl` or `syncUrls` as the source.
6048
+ * */
6049
+ onlyRound?: number;
6050
+ /** @description Select slices of the games
6051
+ *
6052
+ * Optional. Select games based on their position in the source.
6053
+ * ```txt
6054
+ * 1 only select the first board
6055
+ * 1-4 only select the first 4 boards
6056
+ * 1,2,3,4 same as above, first 4 boards
6057
+ * 11-15,21-25 boards 11 to 15, and boards 21 to 25
6058
+ * 2,3,7-9 boards 2, 3, 7, 8, and 9
6059
+ * ```
6060
+ * Slicing is done after filtering by round number.
6061
+ *
6062
+ * It only works if you chose `syncUrl` or `syncUrls` as the source.
6063
+ * */
6064
+ slices?: string;
6014
6065
  }
6015
6066
  | {
6016
6067
  /** @description Lichess game IDs - Up to 64 Lichess game IDs, separated by spaces.
@@ -6018,7 +6069,31 @@ export interface components {
6018
6069
  * */
6019
6070
  syncIds?: string;
6020
6071
  }
6021
- );
6072
+ ) & {
6073
+ /** @description Timestamp in milliseconds of broadcast round start. Leave empty to manually start the broadcast round.
6074
+ * Example: `1356998400070`
6075
+ * */
6076
+ startsAt?: number;
6077
+ /**
6078
+ * @description The start date is unknown, and the round will start automatically when the previous round completes.
6079
+ *
6080
+ * @default false
6081
+ */
6082
+ startsAfterPrevious?: boolean;
6083
+ /** @description Delay in seconds for movements to appear on the broadcast. Leave it empty if you don't need it.
6084
+ * Example: `900` (15 min)
6085
+ * */
6086
+ delay?: number;
6087
+ /**
6088
+ * @description Mark whether the round has been completed.
6089
+ *
6090
+ * @default false
6091
+ */
6092
+ finished?: boolean;
6093
+ /** @description (Only for Admins) Waiting time for each poll.
6094
+ * */
6095
+ period?: number;
6096
+ };
6022
6097
  BroadcastRoundStudyInfo: {
6023
6098
  /** @description Whether the currently authenticated user has permission to update the study */
6024
6099
  writeable?: boolean;
@@ -9037,7 +9112,7 @@ export interface operations {
9037
9112
  cookie?: never;
9038
9113
  };
9039
9114
  /** @description You may need these depending on the tournament to join */
9040
- requestBody: {
9115
+ requestBody?: {
9041
9116
  content: {
9042
9117
  "application/x-www-form-urlencoded": {
9043
9118
  /** @description The tournament password, if one is required.
@@ -9306,6 +9381,8 @@ export interface operations {
9306
9381
  apiUserNameTournamentCreated: {
9307
9382
  parameters: {
9308
9383
  query?: {
9384
+ /** @description Max number of tournaments to fetch */
9385
+ nb?: number;
9309
9386
  /** @description Include tournaments in the given status: "Created" (10), "Started" (20), "Finished" (30)
9310
9387
  * You can add this parameter more than once to include tournaments in different statuses.
9311
9388
  * Example: `?status=10&status=20`
@@ -9333,6 +9410,36 @@ export interface operations {
9333
9410
  };
9334
9411
  };
9335
9412
  };
9413
+ apiUserNameTournamentPlayed: {
9414
+ parameters: {
9415
+ query?: {
9416
+ /** @description Max number of tournaments to fetch */
9417
+ nb?: number;
9418
+ /** @description Include the player performance rating in the response, at some cost for the server.
9419
+ * */
9420
+ performance?: boolean;
9421
+ };
9422
+ header?: never;
9423
+ path: {
9424
+ /** @description The user whose played tournaments to fetch */
9425
+ username: string;
9426
+ };
9427
+ cookie?: never;
9428
+ };
9429
+ requestBody?: never;
9430
+ responses: {
9431
+ /** @description The list of tournaments played by the user. */
9432
+ 200: {
9433
+ headers: {
9434
+ "Access-Control-Allow-Origin"?: string;
9435
+ [name: string]: unknown;
9436
+ };
9437
+ content: {
9438
+ "application/x-ndjson": components["schemas"]["ArenaTournamentPlayed"];
9439
+ };
9440
+ };
9441
+ };
9442
+ };
9336
9443
  apiSwissNew: {
9337
9444
  parameters: {
9338
9445
  query?: never;
@@ -9844,7 +9951,7 @@ export interface operations {
9844
9951
  cookie?: never;
9845
9952
  };
9846
9953
  /** @description You may need these depending on the tournament to join */
9847
- requestBody: {
9954
+ requestBody?: {
9848
9955
  content: {
9849
9956
  "application/x-www-form-urlencoded": {
9850
9957
  /** @description The tournament password, if one is required */
@@ -11000,7 +11107,7 @@ export interface operations {
11000
11107
  };
11001
11108
  cookie?: never;
11002
11109
  };
11003
- requestBody: {
11110
+ requestBody?: {
11004
11111
  content: {
11005
11112
  "application/x-www-form-urlencoded": {
11006
11113
  /** @description Required if team manually reviews admission requests. */
@@ -11456,7 +11563,7 @@ export interface operations {
11456
11563
  cookie?: never;
11457
11564
  };
11458
11565
  /** @description Parameters of the seek */
11459
- requestBody: {
11566
+ requestBody?: {
11460
11567
  content: {
11461
11568
  "application/x-www-form-urlencoded": {
11462
11569
  /**
@@ -12198,7 +12305,7 @@ export interface operations {
12198
12305
  cookie?: never;
12199
12306
  };
12200
12307
  /** @description Parameters of the challenge */
12201
- requestBody: {
12308
+ requestBody?: {
12202
12309
  content: {
12203
12310
  "application/x-www-form-urlencoded": {
12204
12311
  /**
@@ -12487,7 +12594,7 @@ export interface operations {
12487
12594
  cookie?: never;
12488
12595
  };
12489
12596
  /** @description Parameters of the game */
12490
- requestBody: {
12597
+ requestBody?: {
12491
12598
  content: {
12492
12599
  "application/x-www-form-urlencoded": {
12493
12600
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lichess-org/types",
3
- "version": "2.0.15",
3
+ "version": "2.0.17",
4
4
  "description": "Lichess.org API types",
5
5
  "homepage": "https://github.com/lichess-org/api",
6
6
  "license": "AGPL-3.0-or-later",