refactor: re-order classes
This commit is contained in:
parent
39add25b3b
commit
567c636b1d
1 changed files with 22 additions and 22 deletions
|
|
@ -138,11 +138,9 @@ class ExtensionRelease(BaseModel):
|
||||||
return []
|
return []
|
||||||
|
|
||||||
|
|
||||||
class GitHubRepoRelease(BaseModel):
|
class Manifest(BaseModel):
|
||||||
name: str
|
extensions: List["ExplicitRelease"] = []
|
||||||
tag_name: str
|
repos: List["GitHubRelease"] = []
|
||||||
zipball_url: str
|
|
||||||
html_url: str
|
|
||||||
|
|
||||||
|
|
||||||
class ExplicitRelease(BaseModel):
|
class ExplicitRelease(BaseModel):
|
||||||
|
|
@ -166,6 +164,25 @@ class GitHubRelease(BaseModel):
|
||||||
repository: str
|
repository: str
|
||||||
|
|
||||||
|
|
||||||
|
class GitHubRepoRelease(BaseModel):
|
||||||
|
name: str
|
||||||
|
tag_name: str
|
||||||
|
zipball_url: str
|
||||||
|
html_url: str
|
||||||
|
|
||||||
|
|
||||||
|
class GitHubRepo(BaseModel):
|
||||||
|
stargazers_count: str
|
||||||
|
html_url: str
|
||||||
|
default_branch: str
|
||||||
|
|
||||||
|
|
||||||
|
class ExtensionConfig(BaseModel):
|
||||||
|
name: str
|
||||||
|
short_description: str
|
||||||
|
tile: str
|
||||||
|
|
||||||
|
|
||||||
class InstallableExtension(BaseModel):
|
class InstallableExtension(BaseModel):
|
||||||
id: str
|
id: str
|
||||||
name: str
|
name: str
|
||||||
|
|
@ -431,18 +448,6 @@ class InstallableExtension(BaseModel):
|
||||||
return selected_release[0] if len(selected_release) != 0 else None
|
return selected_release[0] if len(selected_release) != 0 else None
|
||||||
|
|
||||||
|
|
||||||
class GitHubRepo(BaseModel):
|
|
||||||
stargazers_count: str
|
|
||||||
html_url: str
|
|
||||||
default_branch: str
|
|
||||||
|
|
||||||
|
|
||||||
class ExtensionConfig(BaseModel):
|
|
||||||
name: str
|
|
||||||
short_description: str
|
|
||||||
tile: str
|
|
||||||
|
|
||||||
|
|
||||||
class InstalledExtensionMiddleware:
|
class InstalledExtensionMiddleware:
|
||||||
# This middleware class intercepts calls made to the extensions API and:
|
# This middleware class intercepts calls made to the extensions API and:
|
||||||
# - it blocks the calls if the extension has been disabled or uninstalled.
|
# - it blocks the calls if the extension has been disabled or uninstalled.
|
||||||
|
|
@ -494,11 +499,6 @@ class CreateExtension(BaseModel):
|
||||||
source_repo: str
|
source_repo: str
|
||||||
|
|
||||||
|
|
||||||
class Manifest(BaseModel):
|
|
||||||
extensions: List[ExplicitRelease] = []
|
|
||||||
repos: List[GitHubRelease] = []
|
|
||||||
|
|
||||||
|
|
||||||
def get_valid_extensions() -> List[Extension]:
|
def get_valid_extensions() -> List[Extension]:
|
||||||
return [
|
return [
|
||||||
extension for extension in ExtensionManager().extensions if extension.is_valid
|
extension for extension in ExtensionManager().extensions if extension.is_valid
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue