···11+// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT.
22+33+// Lexicon schema: org.lichess.getPuzzle
44+55+package lichess
66+77+import (
88+ "context"
99+1010+ lexutil "github.com/bluesky-social/indigo/lex/util"
1111+)
1212+1313+// GetPuzzle_Output is the output of a org.lichess.getPuzzle call.
1414+type GetPuzzle_Output struct {
1515+ // fen: the FEN string of the position before the opponent makes their move.
1616+ Fen string `json:"fen" cborgen:"fen"`
1717+ // gameId: the unique identifier of the specific game and move the puzzle was extracted from. The game would be accessible at https://lichess.org/{GameId}
1818+ GameId *string `json:"gameId,omitempty" cborgen:"gameId,omitempty"`
1919+ // isOriginalLichessPuzzle: whether this puzzle is unedited from lichess.org's original puzzle dataset, as opposed to having been modified or not sourced from Lichess.
2020+ IsOriginalLichessPuzzle bool `json:"isOriginalLichessPuzzle" cborgen:"isOriginalLichessPuzzle"`
2121+ // moves: the solution to the puzzle. All player moves of the solution are "only moves", i.e. playing any other move would considerably worsen the player position. An exception is made for mates in one: there can be several. Any move that checkmates should win the puzzle.
2222+ Moves string `json:"moves" cborgen:"moves"`
2323+ // nbPlays: the number of times a puzzle was played.
2424+ NbPlays *int64 `json:"nbPlays,omitempty" cborgen:"nbPlays,omitempty"`
2525+ // openingTags: a list of openings. This is only set for puzzles starting before move 20.
2626+ OpeningTags []string `json:"openingTags,omitempty" cborgen:"openingTags,omitempty"`
2727+ // popularity: a number between 100 (best) and -100 (worst), calculated as 100 * (upvotes - downvotes)/(upvotes + downvotes). Votes are weighted by various factors such as whether the puzzle was solved successfully or the solver's puzzle rating in comparison to the puzzle's.
2828+ Popularity *int64 `json:"popularity,omitempty" cborgen:"popularity,omitempty"`
2929+ // rating: the Glicko-2 rating of the puzzle.
3030+ Rating int64 `json:"rating" cborgen:"rating"`
3131+ // ratingDeviation: the Glicko-2 rating deviation of the puzzle.
3232+ RatingDeviation int64 `json:"ratingDeviation" cborgen:"ratingDeviation"`
3333+ // themes: a list of puzzle themes.
3434+ Themes []string `json:"themes,omitempty" cborgen:"themes,omitempty"`
3535+}
3636+3737+// GetPuzzle calls the XRPC method "org.lichess.getPuzzle".
3838+//
3939+// id: the id of the puzzle to fetch.
4040+func GetPuzzle(ctx context.Context, c lexutil.LexClient, id string) (*GetPuzzle_Output, error) {
4141+ var out GetPuzzle_Output
4242+4343+ params := map[string]interface{}{}
4444+ params["id"] = id
4545+ if err := c.LexDo(ctx, lexutil.Query, "", "org.lichess.getPuzzle", params, nil, &out); err != nil {
4646+ return nil, err
4747+ }
4848+4949+ return &out, nil
5050+}
···11+// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT.
22+33+// Lexicon schema: org.lichess.puzzle
44+55+package lichess
66+77+import (
88+ lexutil "github.com/bluesky-social/indigo/lex/util"
99+)
1010+1111+func init() {
1212+ lexutil.RegisterType("org.lichess.puzzle", &Puzzle{})
1313+}
1414+1515+type Puzzle struct {
1616+ LexiconTypeID string `json:"$type" cborgen:"$type,const=org.lichess.puzzle"`
1717+ CreatedAt string `json:"createdAt" cborgen:"createdAt"`
1818+ // fen: the FEN string of the position before the opponent makes their move.
1919+ Fen string `json:"fen" cborgen:"fen"`
2020+ // gameId: the unique identifier of the specific game and move the puzzle was extracted from. The game would be accessible at https://lichess.org/{GameId}
2121+ GameId *string `json:"gameId,omitempty" cborgen:"gameId,omitempty"`
2222+ // moves: the solution to the puzzle. All player moves of the solution are "only moves", i.e. playing any other move would considerably worsen the player position. An exception is made for mates in one: there can be several. Any move that checkmates should win the puzzle.
2323+ Moves string `json:"moves" cborgen:"moves"`
2424+ // nbPlays: the number of times a puzzle was played.
2525+ NbPlays *int64 `json:"nbPlays,omitempty" cborgen:"nbPlays,omitempty"`
2626+ // openingTags: a list of openings. This is only set for puzzles starting before move 20.
2727+ OpeningTags []string `json:"openingTags,omitempty" cborgen:"openingTags,omitempty"`
2828+ // popularity: a number between 100 (best) and -100 (worst), calculated as 100 * (upvotes - downvotes)/(upvotes + downvotes). Votes are weighted by various factors such as whether the puzzle was solved successfully or the solver's puzzle rating in comparison to the puzzle's.
2929+ Popularity *int64 `json:"popularity,omitempty" cborgen:"popularity,omitempty"`
3030+ // rating: the Glicko-2 rating of the puzzle.
3131+ Rating int64 `json:"rating" cborgen:"rating"`
3232+ // ratingDeviation: the Glicko-2 rating deviation of the puzzle.
3333+ RatingDeviation int64 `json:"ratingDeviation" cborgen:"ratingDeviation"`
3434+ // themes: a list of puzzle themes.
3535+ Themes []string `json:"themes,omitempty" cborgen:"themes,omitempty"`
3636+}
···11+// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT.
22+33+// Lexicon schema: org.lichess.puzzle.attempt
44+55+package lichess
66+77+import (
88+ comatproto "github.com/bluesky-social/indigo/api/atproto"
99+ lexutil "github.com/bluesky-social/indigo/lex/util"
1010+)
1111+1212+func init() {
1313+ lexutil.RegisterType("org.lichess.puzzle.attempt", &PuzzleAttempt{})
1414+}
1515+1616+type PuzzleAttempt struct {
1717+ LexiconTypeID string `json:"$type" cborgen:"$type,const=org.lichess.puzzle.attempt"`
1818+ // createdAt: client-declared timestamp when this attempt record was created.
1919+ CreatedAt string `json:"createdAt" cborgen:"createdAt"`
2020+ // playerMoves: the moves played by the solver during the attempt, in the same notation as the puzzle's solution moves.
2121+ PlayerMoves *string `json:"playerMoves,omitempty" cborgen:"playerMoves,omitempty"`
2222+ // puzzle: a strong reference to the org.lichess.puzzle record this attempt is for.
2323+ Puzzle *comatproto.RepoStrongRef `json:"puzzle" cborgen:"puzzle"`
2424+ // result: the current outcome of the attempt.
2525+ Result string `json:"result" cborgen:"result"`
2626+}