@lichess-org/types 2.0.78 → 2.0.79

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 -0
  2. package/package.json +1 -1
package/lichess-api.d.ts CHANGED
@@ -228,6 +228,31 @@ 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["apiPuzzleBatchAngle"];
248
+ put?: never;
249
+ post?: never;
250
+ delete?: never;
251
+ options?: never;
252
+ head?: never;
253
+ patch?: never;
254
+ trace?: never;
255
+ };
231
256
  "/api/puzzle/activity": {
232
257
  parameters: {
233
258
  query?: never;
@@ -4598,6 +4623,9 @@ export interface components {
4598
4623
  themes: string[];
4599
4624
  };
4600
4625
  };
4626
+ PuzzleBatch: {
4627
+ puzzles?: components["schemas"]["PuzzleAndGame"][];
4628
+ };
4601
4629
  PuzzleActivity: {
4602
4630
  date: number;
4603
4631
  puzzle: {
@@ -10245,6 +10273,90 @@ export interface operations {
10245
10273
  };
10246
10274
  };
10247
10275
  };
10276
+ apiPuzzleBatchAngle: {
10277
+ parameters: {
10278
+ query?: {
10279
+ /** @description The desired puzzle difficulty, relative to the authenticated user puzzle rating, or 1500 if anonymous. */
10280
+ difficulty?: "easiest" | "easier" | "normal" | "harder" | "hardest";
10281
+ /** @description How many puzzles to fetch. Just set it to `1` if you only need one puzzle.
10282
+ * */
10283
+ nb?: number;
10284
+ };
10285
+ header?: never;
10286
+ path: {
10287
+ /** @description The theme or opening to filter puzzles with. Recommended: "mix".
10288
+ *
10289
+ * Available themes are listed in [the lichess source code](https://github.com/ornicar/lila/blob/master/translation/source/puzzleTheme.xml).
10290
+ * */
10291
+ angle: string;
10292
+ };
10293
+ cookie?: never;
10294
+ };
10295
+ requestBody?: never;
10296
+ responses: {
10297
+ /** @description The requested puzzles. */
10298
+ 200: {
10299
+ headers: {
10300
+ "Access-Control-Allow-Origin"?: string;
10301
+ [name: string]: unknown;
10302
+ };
10303
+ content: {
10304
+ /** @example {
10305
+ * "puzzles": [
10306
+ * {
10307
+ * "game": {
10308
+ * "id": "oXmU07Il",
10309
+ * "perf": {
10310
+ * "key": "blitz",
10311
+ * "name": "Blitz"
10312
+ * },
10313
+ * "rated": true,
10314
+ * "players": [
10315
+ * {
10316
+ * "name": "paximi",
10317
+ * "id": "paximi",
10318
+ * "color": "white",
10319
+ * "rating": 2009
10320
+ * },
10321
+ * {
10322
+ * "name": "Patteblomquist",
10323
+ * "id": "patteblomquist",
10324
+ * "color": "black",
10325
+ * "rating": 2000
10326
+ * }
10327
+ * ],
10328
+ * "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",
10329
+ * "clock": "3+2"
10330
+ * },
10331
+ * "puzzle": {
10332
+ * "id": "hFFk9",
10333
+ * "rating": 1733,
10334
+ * "plays": 469,
10335
+ * "solution": [
10336
+ * "c1c5",
10337
+ * "c8c5",
10338
+ * "d2e4",
10339
+ * "f6e6",
10340
+ * "e4c5"
10341
+ * ],
10342
+ * "themes": [
10343
+ * "endgame",
10344
+ * "advantage",
10345
+ * "attraction",
10346
+ * "fork",
10347
+ * "long",
10348
+ * "sacrifice"
10349
+ * ],
10350
+ * "initialPly": 63
10351
+ * }
10352
+ * }
10353
+ * ]
10354
+ * } */
10355
+ "application/json": components["schemas"]["PuzzleBatch"];
10356
+ };
10357
+ };
10358
+ };
10359
+ };
10248
10360
  apiPuzzleActivity: {
10249
10361
  parameters: {
10250
10362
  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.79",
4
4
  "description": "Lichess.org API types",
5
5
  "homepage": "https://github.com/lichess-org/api",
6
6
  "license": "AGPL-3.0-or-later",