aboutsummaryrefslogtreecommitdiff
path: root/src/hydrilla/proxy/state.py
diff options
context:
space:
mode:
authorWojtek Kosior <koszko@koszko.org>2022-09-29 12:52:54 +0200
committerWojtek Kosior <koszko@koszko.org>2022-10-04 21:45:11 +0200
commit48f80ae480e2fc0eabbdb5041e841b80c0f788f4 (patch)
treecda20c09831038d4b0c3ae78679b43dc127950be /src/hydrilla/proxy/state.py
parentb0fcc865599cfdc87e2ca8a637df8f5b336bb459 (diff)
downloadhaketilo-hydrilla-48f80ae480e2fc0eabbdb5041e841b80c0f788f4.tar.gz
haketilo-hydrilla-48f80ae480e2fc0eabbdb5041e841b80c0f788f4.zip
[proxy] display some more details in mapping/resource version view in the web UI
Diffstat (limited to 'src/hydrilla/proxy/state.py')
-rw-r--r--src/hydrilla/proxy/state.py58
1 files changed, 52 insertions, 6 deletions
diff --git a/src/hydrilla/proxy/state.py b/src/hydrilla/proxy/state.py
index 559a546..4142f7f 100644
--- a/src/hydrilla/proxy/state.py
+++ b/src/hydrilla/proxy/state.py
@@ -259,6 +259,13 @@ class RepoIterationRef(Ref):
@dc.dataclass(frozen=True)
+class FileData:
+ mime_type: str
+ name: str
+ contents: bytes
+
+
+@dc.dataclass(frozen=True)
class MappingDisplayInfo(item_infos.CorrespondsToMappingDCMixin):
ref: 'MappingRef'
identifier: str
@@ -300,6 +307,10 @@ class MappingStore(Store[MappingRef]):
def get_display_infos(self) -> t.Sequence[MappingDisplayInfo]:
...
+ @abstractmethod
+ def get_by_identifier(self, identifier: str) -> MappingRef:
+ ...
+
@dc.dataclass(frozen=True, unsafe_hash=True) # type: ignore[misc]
class MappingVersionRef(Ref, item_infos.CorrespondsToMappingDCMixin):
@abstractmethod
@@ -323,6 +334,23 @@ class MappingVersionRef(Ref, item_infos.CorrespondsToMappingDCMixin):
...
@abstractmethod
+ def get_license_file(self, name: str) -> FileData:
+ ...
+
+ @abstractmethod
+ def get_upstream_license_file_url(self, name: str) -> str:
+ ...
+
+ @abstractmethod
+ def get_required_mapping(self, identifier: str) -> 'MappingVersionRef':
+ ...
+
+ @abstractmethod
+ def get_payload_resource(self, pattern: str, identifier: str) \
+ -> 'ResourceVersionRef':
+ ...
+
+ @abstractmethod
def get_item_display_info(self) -> RichMappingDisplayInfo:
...
@@ -359,6 +387,10 @@ class ResourceStore(Store[ResourceRef]):
def get_display_infos(self) -> t.Sequence[ResourceDisplayInfo]:
...
+ @abstractmethod
+ def get_by_identifier(self, identifier: str) -> ResourceRef:
+ ...
+
@dc.dataclass(frozen=True, unsafe_hash=True) # type: ignore[misc]
class ResourceVersionRef(Ref, item_infos.CorrespondsToResourceDCMixin):
@@ -371,6 +403,26 @@ class ResourceVersionRef(Ref, item_infos.CorrespondsToResourceDCMixin):
...
@abstractmethod
+ def get_license_file(self, name: str) -> FileData:
+ ...
+
+ @abstractmethod
+ def get_resource_file(self, name: str) -> FileData:
+ ...
+
+ @abstractmethod
+ def get_upstream_license_file_url(self, name: str) -> str:
+ ...
+
+ @abstractmethod
+ def get_upstream_resource_file_url(self, name: str) -> str:
+ ...
+
+ @abstractmethod
+ def get_dependency(self, identifier: str) -> ResourceVersionRef:
+ ...
+
+ @abstractmethod
def get_item_display_info(self) -> RichResourceDisplayInfo:
...
@@ -409,12 +461,6 @@ class PayloadDisplayInfo:
pattern: str
has_problems: bool
-@dc.dataclass(frozen=True)
-class FileData:
- type: str
- name: str
- contents: bytes
-
@dc.dataclass(frozen=True, unsafe_hash=True) # type: ignore[misc]
class PayloadRef(Ref):
"""...."""