diff --git a/doc/specs/schemas/UserActivity.yaml b/doc/specs/schemas/UserActivity.yaml new file mode 100644 index 0000000..81b4c24 --- /dev/null +++ b/doc/specs/schemas/UserActivity.yaml @@ -0,0 +1,203 @@ +type: object + +properties: + interval: + type: object + required: + - start + - end + properties: + start: + type: number + end: + type: number + games: + type: object + properties: + chess960: + $ref: './UserActivityScore.yaml' + atomic: + $ref: './UserActivityScore.yaml' + racingKings: + $ref: './UserActivityScore.yaml' + ultraBullet: + $ref: './UserActivityScore.yaml' + blitz: + $ref: './UserActivityScore.yaml' + kingOfTheHill: + $ref: './UserActivityScore.yaml' + bullet: + $ref: './UserActivityScore.yaml' + correspondence: + $ref: './UserActivityScore.yaml' + horde: + $ref: './UserActivityScore.yaml' + puzzle: + $ref: './UserActivityScore.yaml' + classical: + $ref: './UserActivityScore.yaml' + rapid: + $ref: './UserActivityScore.yaml' + + puzzles: + type: object + properties: + score: + $ref: './UserActivityScore.yaml' + + storm: + type: object + properties: + runs: + type: number + score: + type: number + racer: + type: object + properties: + runs: + type: number + score: + type: number + streak: + type: object + properties: + runs: + type: number + score: + type: number + tournaments: + type: object + properties: + nb: + type: number + best: + type: array + items: + type: object + required: + - tournament + - nbGames + - score + - rank + - rankPercent + properties: + tournament: + type: object + required: + - id + - name + properties: + id: + type: string + name: + type: string + nbGames: + type: number + score: + type: number + rank: + type: number + rankPercent: + type: number + practice: + type: array + items: + type: object + required: + - url + - name + - nbPositions + properties: + url: + type: string + name: + type: string + nbPositions: + type: number + simuls: + type: array + items: + type: string + correspondenceMoves: + type: object + required: + - nb + - games + properties: + nb: + type: number + games: + type: array + items: + $ref: './UserActivityCorrespondenceGame.yaml' + correspondenceEnds: + type: object + required: + - score + - games + properties: + score: + $ref: './UserActivityScore.yaml' + games: + type: array + items: + $ref: './UserActivityCorrespondenceGame.yaml' + follows: + type: object + properties: + in: + $ref: './UserActivityFollowList.yaml' + out: + $ref: './UserActivityFollowList.yaml' + studies: + type: object + teams: + type: array + items: + type: object + required: + - url + - name + properties: + url: + type: string + name: + type: string + posts: + type: array + items: + type: object + required: + - topicUrl + - topicName + - posts + properties: + topicUrl: + type: string + topicName: + type: string + posts: + type: array + items: + type: object + required: + - url + - text + properties: + url: + type: string + text: + type: string + patron: + type: object + required: + - months + properties: + months: + type: number + stream: + type: boolean + +required: + - interval diff --git a/doc/specs/schemas/UserActivityCorrespondenceGame.yaml b/doc/specs/schemas/UserActivityCorrespondenceGame.yaml new file mode 100644 index 0000000..568ca73 --- /dev/null +++ b/doc/specs/schemas/UserActivityCorrespondenceGame.yaml @@ -0,0 +1,40 @@ +type: object + +properties: + id: + type: string + color: + type: string + enum: ['white', 'black'] + url: + type: string + variant: + $ref: './VariantKey.yaml' + speed: + type: string + const: correspondence + perf: + type: string + const: correspondence + rated: + type: boolean + opponent: + type: object + required: + - user + - rating + properties: + user: + type: string + rating: + type: number + +required: + - id + - color + - url + - variant + - speed + - perf + - rated + - opponent diff --git a/doc/specs/schemas/UserActivityFollowList.yaml b/doc/specs/schemas/UserActivityFollowList.yaml new file mode 100644 index 0000000..65104cf --- /dev/null +++ b/doc/specs/schemas/UserActivityFollowList.yaml @@ -0,0 +1,12 @@ +type: object + +properties: + ids: + type: array + items: + type: string + nb: + type: number + +required: + - ids diff --git a/doc/specs/schemas/UserActivityScore.yaml b/doc/specs/schemas/UserActivityScore.yaml new file mode 100644 index 0000000..9fbff48 --- /dev/null +++ b/doc/specs/schemas/UserActivityScore.yaml @@ -0,0 +1,22 @@ +type: object + +properties: + win: + type: number + loss: + type: number + draw: + type: number + rp: + type: object + properties: + before: + type: number + after: + type: number + +required: + - win + - loss + - draw + - rp diff --git a/doc/specs/tags/users/api-user-username-activity.yaml b/doc/specs/tags/users/api-user-username-activity.yaml index 8750bdf..23e0ab6 100644 --- a/doc/specs/tags/users/api-user-username-activity.yaml +++ b/doc/specs/tags/users/api-user-username-activity.yaml @@ -13,7 +13,7 @@ get: type: string required: true responses: - "200": + '200': description: The activity feed of the user. headers: Access-Control-Allow-Origin: @@ -22,5 +22,6 @@ get: default: "'*'" content: application/json: - example: - https://gist.github.com/ornicar/0ee2d2427cb74ed1a35e86f5ba09fabc + schema: + $ref: '../../schemas/UserActivity.yaml' + example: 'https://gist.github.com/ornicar/0ee2d2427cb74ed1a35e86f5ba09fabc'