-
-
Notifications
You must be signed in to change notification settings - Fork 63
Implement api/challenge endpoints
#52
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
Merged
kraktus
merged 18 commits into
lichess-org:master
from
Anupya:Anupya/add-challenge-endpoints
Nov 1, 2023
Merged
Changes from all commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
9d464c2
Update berserk/clients/teams.py
Anupya 7d9e164
Update README.rst
Anupya e8a41ae
Update teams.py
Anupya 8d0a4f9
Merge branch 'lichess-org:master' into master
Anupya f83c36b
Merge branch 'lichess-org:master' into master
Anupya 779b88e
add challenge endpoints
Anupya 08f97a7
fix black formatting error
Anupya dd9c38d
list of any
Anupya a9a5076
ok now all challenge endpoints have been implemented
Anupya 2f5ee90
add TypedDicts and TypedAliases
Anupya 0faf9e3
fix black and pyright errors
Anupya 6f5cabc
use pre-defined constants in common
Anupya b2237a4
move all literals into common
Anupya d7f061a
fix issues
Anupya d28516d
black reformatting
Anupya e5c30f2
add to changelog
kraktus 76a1a0c
refactor types
kraktus ad22b75
Use List of usernames for `create_tokens_for_multiple_users`
kraktus File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,57 @@ | ||
| from __future__ import annotations | ||
|
|
||
| from typing_extensions import TypeAlias, TypedDict, NotRequired, Literal | ||
|
|
||
| from .common import Variant, Color, OnlineLightUser | ||
| from .opening_explorer import Speed | ||
|
|
||
| ChallengeStatus: TypeAlias = Literal[ | ||
| "created", | ||
| "offline", | ||
| "canceled", | ||
| "declined", | ||
| "accepted", | ||
| ] | ||
|
|
||
| ChallengeDeclineReason: TypeAlias = Literal[ | ||
| "generic", | ||
| "later", | ||
| "tooFast", | ||
| "tooSlow", | ||
| "timeControl", | ||
| "rated", | ||
| "casual", | ||
| "standard", | ||
| "variant", | ||
| "noBot", | ||
| "onlyBot", | ||
| ] | ||
|
|
||
| ChallengeDirection: TypeAlias = Literal["in", "out"] | ||
|
|
||
|
|
||
| class User(OnlineLightUser): | ||
| """Challenge User""" | ||
|
|
||
| rating: NotRequired[float] | ||
| provisional: NotRequired[bool] | ||
|
|
||
|
|
||
| class Challenge(TypedDict): | ||
| """Information about a challenge.""" | ||
|
|
||
| id: str | ||
| url: str | ||
| status: ChallengeStatus | ||
| challenger: User | ||
| destUser: User | None | ||
| variant: Variant | ||
| rated: bool | ||
| speed: Speed | ||
| timeControl: object | ||
| color: Color | ||
| perf: str | ||
| direction: NotRequired[ChallengeDirection] | ||
| initialFen: NotRequired[str] | ||
| declineReason: str | ||
| declineReasonKey: str |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.