Skip to content
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
3 changes: 3 additions & 0 deletions doc/specs/examples/challenges-acceptChallenge.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"ok": true
}
3 changes: 3 additions & 0 deletions doc/specs/examples/challenges-addTimeToOpponent.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"ok": true
}
5 changes: 5 additions & 0 deletions doc/specs/examples/challenges-adminChallengeTokens.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"bobby": "lip_UApWGQEPAy2fn2sneRLL",
"boris": "lip_OqjzF0daIQ42uEOfUmPO",
"mary": "lip_p40VbmcuQ54qnyDtpSSX"
}
3 changes: 3 additions & 0 deletions doc/specs/examples/challenges-cancelChallenge.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"ok": true
}
21 changes: 21 additions & 0 deletions doc/specs/examples/challenges-challengeAi.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"id": "FLuFXFzs",
"variant": {
"key": "standard",
"name": "Standard",
"short": "Std"
},
"speed": "correspondence",
"perf": "correspondence",
"rated": false,
"fen": "rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1",
"turns": 0,
"source": "ai",
"status": {
"id": 20,
"name": "started"
},
"createdAt": 1747312530755,
"player": "white",
"fullId": "FLuFXFzs4NSG"
}
35 changes: 35 additions & 0 deletions doc/specs/examples/challenges-createChallenge.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
{
"id": "1jqMGJOv",
"url": "https://lichess.org/1jqMGJOv",
"status": "created",
"challenger": {
"id": "bobby",
"name": "Bobby",
"rating": 1612,
"title": null
},
"destUser": {
"id": "mary",
"name": "Mary",
"rating": 1064,
"title": null,
"flair": "objects.notebook"
},
"variant": {
"key": "standard",
"name": "Standard",
"short": "Std"
},
"rated": false,
"speed": "correspondence",
"timeControl": {
"type": "unlimited"
},
"color": "random",
"finalColor": "white",
"perf": {
"icon": "",
"name": "Correspondence"
},
"direction": "out"
}
3 changes: 3 additions & 0 deletions doc/specs/examples/challenges-declineChallenge.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"ok": true
}
40 changes: 40 additions & 0 deletions doc/specs/examples/challenges-listYourChallenges.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
{
"in": [
{
"id": "1jqMGJOv",
"url": "https://lichess.org/1jqMGJOv",
"status": "created",
"challenger": {
"id": "bobby",
"name": "Bobby",
"rating": 1612,
"title": null
},
"destUser": {
"id": "mary",
"name": "Mary",
"rating": 1064,
"title": null,
"flair": "objects.notebook"
},
"variant": {
"key": "standard",
"name": "Standard",
"short": "Std"
},
"rated": false,
"speed": "correspondence",
"timeControl": {
"type": "unlimited"
},
"color": "random",
"finalColor": "white",
"perf": {
"icon": "",
"name": "Correspondence"
},
"direction": "in"
}
],
"out": []
}
26 changes: 26 additions & 0 deletions doc/specs/examples/challenges-openEndedChallenge.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"id": "XaP00j5r",
"url": "https://lichess.org/XaP00j5r",
"status": "created",
"challenger": null,
"destUser": null,
"variant": {
"key": "standard",
"name": "Standard",
"short": "Std"
},
"rated": false,
"speed": "correspondence",
"timeControl": {
"type": "unlimited"
},
"color": "random",
"finalColor": "black",
"perf": {
"icon": "",
"name": "Correspondence"
},
"open": {},
"urlWhite": "https://lichess.org/XaP00j5r?color=white",
"urlBlack": "https://lichess.org/XaP00j5r?color=black"
}
35 changes: 35 additions & 0 deletions doc/specs/examples/challenges-showOneChallenge.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
{
"id": "1jqMGJOv",
"url": "https://lichess.org/1jqMGJOv",
"status": "created",
"challenger": {
"id": "bobby",
"name": "Bobby",
"rating": 1612,
"title": null
},
"destUser": {
"id": "mary",
"name": "Mary",
"rating": 1064,
"title": null,
"flair": "objects.notebook"
},
"variant": {
"key": "standard",
"name": "Standard",
"short": "Std"
},
"rated": false,
"speed": "correspondence",
"timeControl": {
"type": "unlimited"
},
"color": "random",
"finalColor": "white",
"perf": {
"icon": "",
"name": "Correspondence"
},
"direction": "in"
}
3 changes: 3 additions & 0 deletions doc/specs/examples/challenges-startClocks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"ok": true
}
7 changes: 1 addition & 6 deletions doc/specs/schemas/ChallengeEvent.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,4 @@ properties:
challenge:
$ref: "./ChallengeJson.yaml"
compat:
type: object
properties:
bot:
type: boolean
board:
type: boolean
$ref: "./GameCompat.yaml"
18 changes: 0 additions & 18 deletions doc/specs/schemas/ChallengeOpenJson.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -62,21 +62,3 @@ required:
- urlWhite
- urlBlack
- open
example:
{
"id": "3gH5lybT",
"url": "https://lichess.org/3gH5lybT",
"status": "created",
"challenger": null,
"destUser": null,
"variant": { "key": "standard", "name": "Standard", "short": "Std" },
"rated": false,
"speed": "rapid",
"timeControl": { "type": "clock", "limit": 600, "increment": 5, "show": "10+5" },
"color": "random",
"finalColor": "black",
"perf": { "icon": "", "name": "Rapid" },
"open": {},
"urlWhite": "https://lichess.org/3gH5lybT?color=white",
"urlBlack": "https://lichess.org/3gH5lybT?color=black",
}
19 changes: 17 additions & 2 deletions doc/specs/schemas/ChallengeUser.yaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,26 @@
allOf:
- $ref: "./LightUser.yaml"
type: object
properties:
id:
type: string
name:
type: string
rating:
type: number
title:
oneOf:
- $ref: "./Title.yaml"
- type: "null"
flair:
$ref: "./Flair.yaml"
patron:
type: boolean
provisional:
type: boolean
online:
type: boolean
lag:
type: number

required:
- id
- name
9 changes: 9 additions & 0 deletions doc/specs/schemas/GameCompat.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
type: object

properties:
bot:
type: boolean
description: Compatible with Bot API
board:
type: boolean
description: Compatible with Board API
7 changes: 1 addition & 6 deletions doc/specs/schemas/GameEventInfo.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,7 @@ properties:
secondsLeft:
type: integer
compat:
type: object
properties:
bot:
type: boolean
board:
type: boolean
$ref: "./GameCompat.yaml"
id:
type: string

Expand Down
42 changes: 41 additions & 1 deletion doc/specs/tags/challenges/api-challenge-ai.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ post:
$ref: "../../schemas/VariantKey.yaml"
fen:
$ref: "../../schemas/FromPositionFEN.yaml"
required:
- level
responses:
"201":
description: The game with Lichess AI was successfully started.
Expand All @@ -67,7 +69,45 @@ post:
content:
application/json:
schema:
$ref: "../../schemas/GameJson.yaml"
properties:
id:
type: string
minLength: 8
maxLength: 8
variant:
$ref: "../../schemas/Variant.yaml"
speed:
$ref: "../../schemas/Speed.yaml"
perf:
$ref: "../../schemas/PerfType.yaml"
rated:
type: boolean
fen:
type: string
turns:
type: integer
source:
$ref: "../../schemas/GameSource.yaml"
status:
type: object
properties:
id:
type: integer
enum: [10, 20, 25, 30, 31, 32, 33, 34, 35, 36, 37, 38, 60]
name:
$ref: "../../schemas/GameStatus.yaml"
createdAt:
type: number
format: int64
player:
type: string
enum: ["white", "black"]
fullId:
type: string
minLength: 12
maxLength: 12
example:
$ref: "../../examples/challenges-challengeAi.json"
"400":
description: The creation of a game with Lichess AI failed.
content:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ post:
application/json:
schema:
$ref: "../../schemas/Ok.yaml"
example:
$ref: "../../examples/challenges-acceptChallenge.json"
"404":
description: The challenge to accept was not found.
content:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ post:
application/json:
schema:
$ref: "../../schemas/Ok.yaml"
example:
$ref: "../../examples/challenges-cancelChallenge.json"
"404":
description: The challenge to cancel was not found.
content:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ post:
application/json:
schema:
$ref: "../../schemas/Ok.yaml"
example:
$ref: "../../examples/challenges-declineChallenge.json"
"404":
description: The challenge to decline was not found.
content:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,5 @@ post:
application/json:
schema:
$ref: "../../schemas/Ok.yaml"
example:
$ref: "../../examples/challenges-startClocks.json"
2 changes: 2 additions & 0 deletions doc/specs/tags/challenges/api-challenge-id-show.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,5 @@ get:
application/json:
schema:
$ref: "../../schemas/ChallengeJson.yaml"
example:
$ref: "../../examples/challenges-showOneChallenge.json"
2 changes: 2 additions & 0 deletions doc/specs/tags/challenges/api-challenge-open.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,8 @@ post:
application/json:
schema:
$ref: "../../schemas/ChallengeOpenJson.yaml"
example:
$ref: "../../examples/challenges-openEndedChallenge.json"
"400":
description: The creation of the challenge failed.
content:
Expand Down
2 changes: 2 additions & 0 deletions doc/specs/tags/challenges/api-challenge-username.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,8 @@ post:
application/json:
schema:
$ref: "../../schemas/ChallengeJson.yaml"
example:
$ref: "../../examples/challenges-createChallenge.json"
"400":
description: The creation of the challenge failed.
content:
Expand Down
2 changes: 2 additions & 0 deletions doc/specs/tags/challenges/api-challenge.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,5 @@ get:
description: Outgoing challenges i.e. created by you
items:
$ref: "../../schemas/ChallengeJson.yaml"
example:
$ref: "../../examples/challenges-listYourChallenges.json"
Loading