Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Split lichess-api.yaml #309

Merged
merged 9 commits into from
Feb 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 35 additions & 0 deletions doc/specs/examples/_index.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
challenge:
$ref: './challenge.yaml'

challengeCanceled:
$ref: './challengeCanceled.yaml'

challengeDeclined:
$ref: './challengeDeclined.yaml'

gameStart:
$ref: './gameStart.yaml'

gameFinish:
$ref: './gameFinish.yaml'

gameFull:
$ref: './gameFull.yaml'

gameState:
$ref: './gameState.yaml'

chatLine:
$ref: './chatLine.yaml'

chatLineSpectator:
$ref: './chatLineSpectator.yaml'

opponentGoneTrue:
$ref: './opponentGoneTrue.yaml'

opponentGoneFalse:
$ref: './opponentGoneFalse.yaml'

gameStateResign:
$ref: './gameStateResign.yaml'
48 changes: 48 additions & 0 deletions doc/specs/examples/challenge.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
value: {
"type":"challenge",
"challenge": {
"id":"7pGLxJ4F",
"url": "https://lichess.org/VU0nyvsW",
"status":"created",
"compat": {
"bot": false,
"board": true
},
"challenger": {
"id":"lovlas",
"name":"Lovlas",
"title":"IM",
"rating": 2506,
"patron": true,
"online": true,
"lag": 24
},
"destUser": {
"id":"thibot",
"name":"thibot",
"rating": 1500,
"provisional": true,
"online": true,
"lag": 45
},
"variant": {
"key":"standard",
"name":"Standard",
"short":"Std"
},
"rated": true,
"timeControl": {
"type":"clock",
"limit": 300,
"increment": 25,
"show":"5+25"
},
"color":"random",
"finalColor": "white",
"speed":"rapid",
"perf": {
"icon":"#",
"name":"Rapid"
}
}
}
50 changes: 50 additions & 0 deletions doc/specs/examples/challengeCanceled.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
value: {
"type":"challengeCanceled",
"challenge": {
"id":"7pGLxJ4F",
"url": "https://lichess.org/VU0nyvsW",
"status": "canceled",
"compat": {
"bot": false,
"board": true
},
"challenger": {
"id":"lovlas",
"name":"Lovlas",
"title":"IM",
"rating": 2506,
"patron": true,
"online": true,
"lag": 24
},
"destUser": {
"id":"thibot",
"name":"thibot",
"rating": 1500,
"provisional": true,
"online": true,
"lag": 45
},
"variant": {
"key":"standard",
"name":"Standard",
"short":"Std"
},
"rated": true,
"timeControl": {
"type":"clock",
"limit": 300,
"increment": 25,
"show":"5+25"
},
"color":"random",
"finalColor": "black",
"speed":"rapid",
"perf": {
"icon":"#",
"name":"Rapid"
}
}
}


51 changes: 51 additions & 0 deletions doc/specs/examples/challengeDeclined.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
value: {
"type": "challengeDeclined",
"challenge": {
"id":"7pGLxJ4F",
"url": "https://lichess.org/VU0nyvsW",
"status": "declined",
"compat": {
"bot": false,
"board": true
},
"challenger": {
"id":"lovlas",
"name":"Lovlas",
"title":"IM",
"rating": 2506,
"patron": true,
"online": true,
"lag": 24
},
"destUser": {
"id":"thibot",
"name":"thibot",
"title":null,
"rating": 1500,
"provisional": true,
"online": true,
"lag": 45
},
"variant": {
"key":"standard",
"name":"Standard",
"short":"Std"
},
"rated": true,
"timeControl": {
"type":"clock",
"limit": 300,
"increment": 25,
"show":"5+25"
},
"color":"random",
"finalColor": "white",
"speed":"rapid",
"perf": {
"icon":"#",
"name":"Rapid"
},
"declineReason": "I'm not accepting challenges at the moment.",
"declineReasonKey": "generic"
}
}
6 changes: 6 additions & 0 deletions doc/specs/examples/chatLine.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
value: {
"type": "chatLine",
"username": "thibault",
"text": "Good luck, have fun",
"room": "player"
}
6 changes: 6 additions & 0 deletions doc/specs/examples/chatLineSpectator.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
value: {
"type": "chatLine",
"username": "lovlas",
"text": "!eval",
"room": "spectator"
}
27 changes: 27 additions & 0 deletions doc/specs/examples/gameFinish.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
value: {
"type":"gameFinish",
"game": {
"gameId": "rCRw1AuO",
"fullId": "rCRw1AuOvonq",
"color": "black",
"fen": "r1bqkbnr/pppp2pp/2n1pp2/8/8/3PP3/PPPB1PPP/RN1QKBNR w KQkq - 2 4",
"hasMoved": true,
"isMyTurn": false,
"lastMove": "b8c6",
"opponent": { "id": "philippe", "username": "Philippe", "rating": 1790, "ratingDiff": -12 },
"perf": "correspondence",
"rated": true,
"secondsLeft": 1209600,
"source": "friend",
"status": { "id": 31, "name": "resign" },
"speed": "correspondence",
"variant": { "key": "standard", "name": "Standard" },
"compat": {
"bot": false,
"board": true
},
"winner": "black",
"ratingDiff": 8,
"id": "rCRw1AuO"
}
}
41 changes: 41 additions & 0 deletions doc/specs/examples/gameFull.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
value: {
"type": "gameFull",
"id": "5IrD6Gzz",
"rated": true,
"variant": {
"key": "standard",
"name": "Standard",
"short": "Std"
},
"clock": {
"initial": 1200000,
"increment": 10000
},
"speed": "classical",
"perf": {
"name": "Classical"
},
"createdAt": 1523825103562,
"white": {
"id": "lovlas",
"name": "lovlas",
"provisional": false,
"rating": 2500,
"title": "IM"
},
"black": {
"id": "leela",
"name": "leela",
"rating": 2390,
},
"initialFen": "startpos",
"state": {
"type": "gameState",
"moves": "e2e4 c7c5 f2f4 d7d6 g1f3 b8c6 f1c4 g8f6 d2d3 g7g6 e1g1 f8g7",
"wtime": 7598040,
"btime": 8395220,
"winc": 10000,
"binc": 10000,
"status": "started"
}
}
25 changes: 25 additions & 0 deletions doc/specs/examples/gameStart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
value: {
"type":"gameStart",
"game": {
"gameId": "rCRw1AuO",
"fullId": "rCRw1AuOvonq",
"color": "black",
"fen": "r1bqkbnr/pppp2pp/2n1pp2/8/8/3PP3/PPPB1PPP/RN1QKBNR w KQkq - 2 4",
"hasMoved": true,
"isMyTurn": false,
"lastMove": "b8c6",
"opponent": { "id": "philippe", "rating": 1790, "username": "Philippe" },
"perf": "correspondence",
"rated": true,
"secondsLeft": 1209600,
"source": "friend",
"status": { "id": 20, "name": "started" },
"speed": "correspondence",
"variant": { "key": "standard", "name": "Standard" },
"compat": {
"bot": false,
"board": true
},
"id": "rCRw1AuO"
}
}
9 changes: 9 additions & 0 deletions doc/specs/examples/gameState.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
value: {
"type": "gameState",
"moves": "e2e4 c7c5 f2f4 d7d6 g1f3 b8c6 f1c4 g8f6 d2d3 g7g6 e1g1 f8g7 b1c3",
"wtime": 7598040,
"btime": 8395220,
"winc": 10000,
"binc": 10000,
"status": "started"
}
10 changes: 10 additions & 0 deletions doc/specs/examples/gameStateResign.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
value: {
"type": "gameState",
"moves": "e2e4 c7c5 f2f4 d7d6 g1f3 b8c6 f1c4 g8f6 d2d3 g7g6 e1g1 f8g7 b1c3",
"wtime": 7598040,
"btime": 8395220,
"winc": 10000,
"binc": 10000,
"status": "resign",
"winner": "black"
}
4 changes: 4 additions & 0 deletions doc/specs/examples/opponentGoneFalse.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
value: {
"type": "opponentGone",
"gone": false
}
5 changes: 5 additions & 0 deletions doc/specs/examples/opponentGoneTrue.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
value: {
"type": "opponentGone",
"gone": true,
"claimWinInSeconds": 8
}
Loading