@lichess-org/types 2.0.78 → 2.0.80

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 +218 -0
  2. package/package.json +1 -1
package/lichess-api.d.ts CHANGED
@@ -228,6 +228,36 @@ export interface paths {
228
228
  patch?: never;
229
229
  trace?: never;
230
230
  };
231
+ "/api/puzzle/batch/{angle}": {
232
+ parameters: {
233
+ query?: never;
234
+ header?: never;
235
+ path?: never;
236
+ cookie?: never;
237
+ };
238
+ /**
239
+ * Get multiple puzzles at once
240
+ * @description Get a batch of random Lichess puzzles in JSON format.
241
+ *
242
+ * If authenticated, only returns puzzles that the user has never seen before.
243
+ *
244
+ * **DO NOT** use this endpoint to enumerate puzzles for mass download. Instead, download the [full public puzzle database](https://database.lichess.org/#puzzles).
245
+ *
246
+ */
247
+ get: operations["apiPuzzleBatchSelect"];
248
+ put?: never;
249
+ /**
250
+ * Solve multiple puzzles at once
251
+ * @description Set puzzles as solved and update ratings.
252
+ *
253
+ */
254
+ post: operations["apiPuzzleBatchSolve"];
255
+ delete?: never;
256
+ options?: never;
257
+ head?: never;
258
+ patch?: never;
259
+ trace?: never;
260
+ };
231
261
  "/api/puzzle/activity": {
232
262
  parameters: {
233
263
  query?: never;
@@ -4598,6 +4628,20 @@ export interface components {
4598
4628
  themes: string[];
4599
4629
  };
4600
4630
  };
4631
+ PuzzleBatchSelect: {
4632
+ puzzles?: components["schemas"]["PuzzleAndGame"][];
4633
+ };
4634
+ PuzzleBatchSolveRequest: {
4635
+ solutions?: {
4636
+ id?: string;
4637
+ win?: boolean;
4638
+ rated?: boolean;
4639
+ }[];
4640
+ };
4641
+ PuzzleBatchSolveResponse: {
4642
+ puzzles?: components["schemas"]["PuzzleAndGame"][];
4643
+ rounds?: unknown[];
4644
+ };
4601
4645
  PuzzleActivity: {
4602
4646
  date: number;
4603
4647
  puzzle: {
@@ -10245,6 +10289,180 @@ export interface operations {
10245
10289
  };
10246
10290
  };
10247
10291
  };
10292
+ apiPuzzleBatchSelect: {
10293
+ parameters: {
10294
+ query?: {
10295
+ /** @description The desired puzzle difficulty, relative to the authenticated user puzzle rating, or 1500 if anonymous. */
10296
+ difficulty?: "easiest" | "easier" | "normal" | "harder" | "hardest";
10297
+ /** @description How many puzzles to fetch. Just set it to `1` if you only need one puzzle.
10298
+ * */
10299
+ nb?: number;
10300
+ };
10301
+ header?: never;
10302
+ path: {
10303
+ /** @description The theme or opening to filter puzzles with. Recommended: `mix`.
10304
+ *
10305
+ * Available themes are listed in [the lichess source code](https://github.com/ornicar/lila/blob/master/translation/source/puzzleTheme.xml).
10306
+ * */
10307
+ angle: string;
10308
+ };
10309
+ cookie?: never;
10310
+ };
10311
+ requestBody?: never;
10312
+ responses: {
10313
+ /** @description The requested puzzles. */
10314
+ 200: {
10315
+ headers: {
10316
+ "Access-Control-Allow-Origin"?: string;
10317
+ [name: string]: unknown;
10318
+ };
10319
+ content: {
10320
+ /** @example {
10321
+ * "puzzles": [
10322
+ * {
10323
+ * "game": {
10324
+ * "id": "oXmU07Il",
10325
+ * "perf": {
10326
+ * "key": "blitz",
10327
+ * "name": "Blitz"
10328
+ * },
10329
+ * "rated": true,
10330
+ * "players": [
10331
+ * {
10332
+ * "name": "paximi",
10333
+ * "id": "paximi",
10334
+ * "color": "white",
10335
+ * "rating": 2009
10336
+ * },
10337
+ * {
10338
+ * "name": "Patteblomquist",
10339
+ * "id": "patteblomquist",
10340
+ * "color": "black",
10341
+ * "rating": 2000
10342
+ * }
10343
+ * ],
10344
+ * "pgn": "e4 c5 Nf3 d6 d4 cxd4 Nxd4 Nf6 Nc3 a6 f3 e5 Nb3 Be6 Be3 Be7 Nd5 Nxd5 exd5 Bf5 Bd3 Bxd3 Qxd3 Nd7 Qd2 h5 O-O Rc8 Na5 Qc7 c4 Nc5 b4 Nd7 Rac1 f5 Rfd1 f4 Bf2 h4 c5 h3 Nc4 dxc5 bxc5 Bxc5 Bxc5 Qxc5+ Kh1 hxg2+ Kxg2 Qe7 d6 Qh4 Kh1 Qh3 Qg2 Qxg2+ Kxg2 Kf7 Re1 Kf6 Nd2 Nc5",
10345
+ * "clock": "3+2"
10346
+ * },
10347
+ * "puzzle": {
10348
+ * "id": "hFFk9",
10349
+ * "rating": 1733,
10350
+ * "plays": 469,
10351
+ * "solution": [
10352
+ * "c1c5",
10353
+ * "c8c5",
10354
+ * "d2e4",
10355
+ * "f6e6",
10356
+ * "e4c5"
10357
+ * ],
10358
+ * "themes": [
10359
+ * "endgame",
10360
+ * "advantage",
10361
+ * "attraction",
10362
+ * "fork",
10363
+ * "long",
10364
+ * "sacrifice"
10365
+ * ],
10366
+ * "initialPly": 63
10367
+ * }
10368
+ * }
10369
+ * ]
10370
+ * } */
10371
+ "application/json": components["schemas"]["PuzzleBatchSelect"];
10372
+ };
10373
+ };
10374
+ };
10375
+ };
10376
+ apiPuzzleBatchSolve: {
10377
+ parameters: {
10378
+ query?: {
10379
+ /** @description When > 0, the response includes a new puzzle batch with that many puzzles.
10380
+ *
10381
+ * This is equivalent to calling [/api/puzzle/batch/{angle}](#tag/Puzzles/operation/apiPuzzleBatchSelect),
10382
+ * and can sometimes save a request.
10383
+ * */
10384
+ nb?: number;
10385
+ };
10386
+ header?: never;
10387
+ path: {
10388
+ /** @description The theme or opening of the solved puzzles.
10389
+ *
10390
+ * Available themes are listed in [the lichess source code](https://github.com/ornicar/lila/blob/master/translation/source/puzzleTheme.xml).
10391
+ * */
10392
+ angle: string;
10393
+ };
10394
+ cookie?: never;
10395
+ };
10396
+ /** @description A new external engine registration. */
10397
+ requestBody: {
10398
+ content: {
10399
+ "application/json": components["schemas"]["PuzzleBatchSolveRequest"];
10400
+ };
10401
+ };
10402
+ responses: {
10403
+ /** @description The solved puzzles, named `rounds`, and a new puzzle batch named `puzzles`. */
10404
+ 200: {
10405
+ headers: {
10406
+ "Access-Control-Allow-Origin"?: string;
10407
+ [name: string]: unknown;
10408
+ };
10409
+ content: {
10410
+ /** @example {
10411
+ * "puzzles": [
10412
+ * {
10413
+ * "game": {
10414
+ * "id": "oXmU07Il",
10415
+ * "perf": {
10416
+ * "key": "blitz",
10417
+ * "name": "Blitz"
10418
+ * },
10419
+ * "rated": true,
10420
+ * "players": [
10421
+ * {
10422
+ * "name": "paximi",
10423
+ * "id": "paximi",
10424
+ * "color": "white",
10425
+ * "rating": 2009
10426
+ * },
10427
+ * {
10428
+ * "name": "Patteblomquist",
10429
+ * "id": "patteblomquist",
10430
+ * "color": "black",
10431
+ * "rating": 2000
10432
+ * }
10433
+ * ],
10434
+ * "pgn": "e4 c5 Nf3 d6 d4 cxd4 Nxd4 Nf6 Nc3 a6 f3 e5 Nb3 Be6 Be3 Be7 Nd5 Nxd5 exd5 Bf5 Bd3 Bxd3 Qxd3 Nd7 Qd2 h5 O-O Rc8 Na5 Qc7 c4 Nc5 b4 Nd7 Rac1 f5 Rfd1 f4 Bf2 h4 c5 h3 Nc4 dxc5 bxc5 Bxc5 Bxc5 Qxc5+ Kh1 hxg2+ Kxg2 Qe7 d6 Qh4 Kh1 Qh3 Qg2 Qxg2+ Kxg2 Kf7 Re1 Kf6 Nd2 Nc5",
10435
+ * "clock": "3+2"
10436
+ * },
10437
+ * "puzzle": {
10438
+ * "id": "hFFk9",
10439
+ * "rating": 1733,
10440
+ * "plays": 469,
10441
+ * "solution": [
10442
+ * "c1c5",
10443
+ * "c8c5",
10444
+ * "d2e4",
10445
+ * "f6e6",
10446
+ * "e4c5"
10447
+ * ],
10448
+ * "themes": [
10449
+ * "endgame",
10450
+ * "advantage",
10451
+ * "attraction",
10452
+ * "fork",
10453
+ * "long",
10454
+ * "sacrifice"
10455
+ * ],
10456
+ * "initialPly": 63
10457
+ * }
10458
+ * }
10459
+ * ]
10460
+ * } */
10461
+ "application/json": components["schemas"]["PuzzleBatchSolveResponse"];
10462
+ };
10463
+ };
10464
+ };
10465
+ };
10248
10466
  apiPuzzleActivity: {
10249
10467
  parameters: {
10250
10468
  query?: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lichess-org/types",
3
- "version": "2.0.78",
3
+ "version": "2.0.80",
4
4
  "description": "Lichess.org API types",
5
5
  "homepage": "https://github.com/lichess-org/api",
6
6
  "license": "AGPL-3.0-or-later",