remove ducjdb extension from postgres
This commit is contained in:
parent
3bcec2abff
commit
980da5a085
|
|
@ -83,18 +83,14 @@ class RedisCategoryPageInfoKeysAction:
|
||||||
page_index: str = (
|
page_index: str = (
|
||||||
f"{RedisCategoryPageInfoKeys.PAGE_MENU_INDEX}:{RedisCategoryPageInfoKeys.PAGE_URL}"
|
f"{RedisCategoryPageInfoKeys.PAGE_MENU_INDEX}:{RedisCategoryPageInfoKeys.PAGE_URL}"
|
||||||
)
|
)
|
||||||
|
page_mapper_key_language: str = (
|
||||||
page_mapper_key: str = (
|
f"{RedisCategoryPageInfoKeys.PAGE_MENU_INDEX}:{RedisCategoryPageInfoKeys.PAGE_LANGUAGE}"
|
||||||
f"{RedisCategoryPageInfoKeys.PAGE_MENU_INDEX}:{RedisCategoryPageInfoKeys.PAGE_URL}"
|
|
||||||
)
|
|
||||||
page_mapper_key: str = (
|
|
||||||
f"{page_mapper_key}:{RedisCategoryPageInfoKeys.PAGE_LANGUAGE}"
|
|
||||||
)
|
)
|
||||||
menu_mapper_key: str = (
|
menu_mapper_key: str = (
|
||||||
f"{RedisCategoryPageInfoKeys.PAGE_URL}:{RedisCategoryPageInfoKeys.PAGE_MENU_INDEX}"
|
f"{RedisCategoryPageInfoKeys.PAGE_URL}:{RedisCategoryPageInfoKeys.PAGE_MENU_INDEX}"
|
||||||
)
|
)
|
||||||
menu_mapper_key: str = (
|
menu_mapper_key_component: str = (
|
||||||
f"{menu_mapper_key}:{RedisCategoryPageInfoKeys.PAGE_MENU_COMPONENT}"
|
f"{RedisCategoryPageInfoKeys.PAGE_URL}:{RedisCategoryPageInfoKeys.PAGE_MENU_COMPONENT}"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -4,8 +4,10 @@ from Events.Engine.abstract_class import PageInfo
|
||||||
authentication_page_info = PageInfo(
|
authentication_page_info = PageInfo(
|
||||||
name="Authentication",
|
name="Authentication",
|
||||||
url="",
|
url="",
|
||||||
language_models={},
|
|
||||||
endpoints={},
|
|
||||||
icon="Authentication",
|
icon="Authentication",
|
||||||
|
language_models=None,
|
||||||
|
endpoints=None,
|
||||||
|
info=None,
|
||||||
|
instructions=None,
|
||||||
sub_components=[],
|
sub_components=[],
|
||||||
)
|
)
|
||||||
|
|
|
||||||
|
|
@ -24,6 +24,14 @@ class KeyValidations:
|
||||||
data = "data"
|
data = "data"
|
||||||
validation = "validations"
|
validation = "validations"
|
||||||
|
|
||||||
|
# Keys for Validation TYPES
|
||||||
|
class KeyTypeValidations:
|
||||||
|
HEADERS = "HEADERS"
|
||||||
|
DATA = "DATA"
|
||||||
|
MODIFY = "MODIFY"
|
||||||
|
VALIDATION = "VALIDATION"
|
||||||
|
BOTH = "BOTH"
|
||||||
|
|
||||||
# Types of keys
|
# Types of keys
|
||||||
class KeyTypes:
|
class KeyTypes:
|
||||||
REQUEST = "REQUEST"
|
REQUEST = "REQUEST"
|
||||||
|
|
@ -37,16 +45,17 @@ class KeyURLs:
|
||||||
|
|
||||||
# "data": {"event_code": f"{KeyBases.list_key}", "asked_field": KeyValidations.headers, "type": KeyTypes.RESPONSE},
|
# "data": {"event_code": f"{KeyBases.list_key}", "asked_field": KeyValidations.headers, "type": KeyTypes.RESPONSE},
|
||||||
class ValidationRequest:
|
class ValidationRequest:
|
||||||
event_code: str
|
|
||||||
asked_field: str
|
|
||||||
type: Optional[str] = "REQUEST"
|
|
||||||
|
|
||||||
@classmethod
|
def __init__(self, event_code: str, asked_field: str, type_: Optional[str] = "REQUEST"):
|
||||||
def dump(cls) -> Dict[str, Any]:
|
self.event_code = event_code
|
||||||
|
self.asked_field = asked_field
|
||||||
|
self.type = type_
|
||||||
|
|
||||||
|
def dump(self) -> Dict[str, Any]:
|
||||||
return {
|
return {
|
||||||
"event_code": cls.event_code,
|
"event_code": self.event_code,
|
||||||
"asked_field": cls.asked_field,
|
"asked_field": self.asked_field,
|
||||||
"type": cls.type,
|
"type": self.type,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -21,6 +21,7 @@ AccountCluster = CategoryCluster(
|
||||||
},
|
},
|
||||||
mapping=page_2_keys,
|
mapping=page_2_keys,
|
||||||
include_in_schema=True,
|
include_in_schema=True,
|
||||||
|
template_ui="LCU",
|
||||||
sub_category=[],
|
sub_category=[],
|
||||||
is_client=True,
|
is_client=True,
|
||||||
)
|
)
|
||||||
|
|
|
||||||
|
|
@ -1,11 +1,12 @@
|
||||||
from Events.Engine.abstract_class import PageInfo
|
from Events.Engine.abstract_class import PageInfo
|
||||||
from .bases import Components, KeyTypes, ValidationRequest, icon, cluster_name
|
from Events.base_request_model import AUTH_URL_EXTENSION, EVENTS_URL_EXTENSION, VALID_URL_EXTENSION
|
||||||
from .bases import KeyValidations, KeyBases, PageBases, KeyURLs
|
|
||||||
from .account_records import (
|
from .account_records import (
|
||||||
AccountRecordsUpdateEventMethods,
|
AccountRecordsUpdateEventMethods,
|
||||||
AccountRecordsCreateEventMethods,
|
AccountRecordsCreateEventMethods,
|
||||||
AccountRecordsListEventMethods,
|
AccountRecordsListEventMethods,
|
||||||
)
|
)
|
||||||
|
from .bases import Components, KeyTypeValidations, KeyTypes, ValidationRequest, icon, cluster_name
|
||||||
|
from .bases import KeyValidations, KeyBases, PageBases, KeyURLs
|
||||||
from .lang_models import (
|
from .lang_models import (
|
||||||
account_language_list_models_as_dict,
|
account_language_list_models_as_dict,
|
||||||
account_language_create_form_models_as_dict,
|
account_language_create_form_models_as_dict,
|
||||||
|
|
@ -84,10 +85,11 @@ RedisValidation = dict(
|
||||||
class ClustersPageInfo:
|
class ClustersPageInfo:
|
||||||
|
|
||||||
# Cluster Page Infos that are available for the client
|
# Cluster Page Infos that are available for the client
|
||||||
dashboard_page_info = PageInfo(
|
DASHBOARD = PageInfo(
|
||||||
name=f"{cluster_name}",
|
name=f"{cluster_name}",
|
||||||
url=PageBases.DASHBOARD,
|
url=PageBases.DASHBOARD,
|
||||||
icon=icon,
|
icon=icon,
|
||||||
|
template_ui="LCU",
|
||||||
info={
|
info={
|
||||||
"en": {
|
"en": {
|
||||||
"page": "Account Records for reaching user all types account information",
|
"page": "Account Records for reaching user all types account information",
|
||||||
|
|
@ -124,18 +126,18 @@ class ClustersPageInfo:
|
||||||
"ENDPOINTS": AccountRecordsListEventMethods.retrieve_all_event_keys(),
|
"ENDPOINTS": AccountRecordsListEventMethods.retrieve_all_event_keys(),
|
||||||
"LANGUAGE_MODELS": account_language_list_models_as_dict,
|
"LANGUAGE_MODELS": account_language_list_models_as_dict,
|
||||||
"INSTRUCTIONS": {
|
"INSTRUCTIONS": {
|
||||||
"HEADERS": {
|
KeyTypeValidations.HEADERS: {
|
||||||
"store": True,
|
"store": True,
|
||||||
"url": KeyURLs.validations,
|
"url": f"{VALID_URL_EXTENSION}{KeyURLs.validations}",
|
||||||
"data": ValidationRequest(
|
"data": ValidationRequest(
|
||||||
event_code=f"{KeyBases.list_key}",
|
event_code=f"{KeyBases.list_key}",
|
||||||
asked_field=KeyValidations.headers,
|
asked_field=KeyValidations.headers,
|
||||||
type=KeyTypes.RESPONSE
|
type_=KeyTypes.RESPONSE
|
||||||
).dump(),
|
).dump(),
|
||||||
},
|
},
|
||||||
"DATA": {
|
KeyTypeValidations.DATA: {
|
||||||
"store": True,
|
"store": True,
|
||||||
"url": f"{KeyBases.list_key}",
|
"url": f"{EVENTS_URL_EXTENSION}{KeyBases.list_key}",
|
||||||
"params": None,
|
"params": None,
|
||||||
"data": dict(page=1, limit=1, order_by="uu_id", order_type="desc", query=None),
|
"data": dict(page=1, limit=1, order_by="uu_id", order_type="desc", query=None),
|
||||||
},
|
},
|
||||||
|
|
@ -144,10 +146,11 @@ class ClustersPageInfo:
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
|
|
||||||
create_page_info = PageInfo(
|
CREATE = PageInfo(
|
||||||
name=f"{cluster_name}",
|
name=f"{cluster_name}",
|
||||||
url=PageBases.CREATE,
|
url=PageBases.CREATE,
|
||||||
icon=icon,
|
icon=icon,
|
||||||
|
template_ui="LCU",
|
||||||
info={
|
info={
|
||||||
"en": {
|
"en": {
|
||||||
"page": "Create Account Records for reaching user all types account information",
|
"page": "Create Account Records for reaching user all types account information",
|
||||||
|
|
@ -168,33 +171,40 @@ class ClustersPageInfo:
|
||||||
"ENDPOINTS": AccountRecordsCreateEventMethods.retrieve_all_event_keys(),
|
"ENDPOINTS": AccountRecordsCreateEventMethods.retrieve_all_event_keys(),
|
||||||
"LANGUAGE_MODELS": account_language_create_form_models_as_dict,
|
"LANGUAGE_MODELS": account_language_create_form_models_as_dict,
|
||||||
"INSTRUCTIONS": {
|
"INSTRUCTIONS": {
|
||||||
"VALIDATION": {
|
KeyTypeValidations.VALIDATION: {
|
||||||
"store": True,
|
"store": True,
|
||||||
"url": KeyURLs.validations,
|
"url": f"{VALID_URL_EXTENSION}{KeyURLs.validations}",
|
||||||
"data": ValidationRequest(
|
"data": ValidationRequest(
|
||||||
event_code=f"{KeyBases.create_key}",
|
event_code=f"{KeyBases.create_key}",
|
||||||
asked_field=KeyValidations.validation,
|
asked_field=KeyValidations.validation,
|
||||||
type=KeyTypes.REQUEST
|
type_=KeyTypes.REQUEST
|
||||||
).dump(),
|
).dump(),
|
||||||
},
|
},
|
||||||
"HEADERS": {
|
KeyTypeValidations.HEADERS: {
|
||||||
"store": True,
|
"store": True,
|
||||||
"url": KeyURLs.validations,
|
"url": f"{VALID_URL_EXTENSION}{KeyURLs.validations}",
|
||||||
"data": ValidationRequest(
|
"data": ValidationRequest(
|
||||||
event_code=f"{KeyBases.create_key}",
|
event_code=f"{KeyBases.create_key}",
|
||||||
asked_field=KeyValidations.headers,
|
asked_field=KeyValidations.headers,
|
||||||
type=KeyTypes.REQUEST
|
type_=KeyTypes.REQUEST
|
||||||
).dump(),
|
).dump(),
|
||||||
},
|
},
|
||||||
|
KeyTypeValidations.MODIFY: {
|
||||||
|
"store": False,
|
||||||
|
"url": f"{EVENTS_URL_EXTENSION}{KeyBases.create_key}",
|
||||||
|
"params": None,
|
||||||
|
"data": None,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
|
|
||||||
update_page_info = PageInfo(
|
UPDATE = PageInfo(
|
||||||
name=f"{cluster_name}",
|
name=f"{cluster_name}",
|
||||||
url=PageBases.UPDATE,
|
url=PageBases.UPDATE,
|
||||||
icon=icon,
|
icon=icon,
|
||||||
|
template_ui="LCU",
|
||||||
info={
|
info={
|
||||||
"en": {
|
"en": {
|
||||||
"page": "Update Account Records via all types account information",
|
"page": "Update Account Records via all types account information",
|
||||||
|
|
@ -215,29 +225,29 @@ class ClustersPageInfo:
|
||||||
"ENDPOINTS": AccountRecordsUpdateEventMethods.retrieve_all_event_keys(),
|
"ENDPOINTS": AccountRecordsUpdateEventMethods.retrieve_all_event_keys(),
|
||||||
"LANGUAGE_MODELS": account_language_update_form_models_as_dict,
|
"LANGUAGE_MODELS": account_language_update_form_models_as_dict,
|
||||||
"INSTRUCTIONS": {
|
"INSTRUCTIONS": {
|
||||||
"VALIDATION": {
|
KeyTypeValidations.VALIDATION: {
|
||||||
"store": True,
|
"store": True,
|
||||||
"url": KeyURLs.validations,
|
"url": f"{VALID_URL_EXTENSION}{KeyURLs.validations}",
|
||||||
"data": ValidationRequest(
|
"data": ValidationRequest(
|
||||||
event_code=f"{KeyBases.update_key}",
|
event_code=f"{KeyBases.update_key}",
|
||||||
asked_field=KeyValidations.validation,
|
asked_field=KeyValidations.validation,
|
||||||
type=KeyTypes.REQUEST
|
type_=KeyTypes.REQUEST
|
||||||
).dump(),
|
).dump(),
|
||||||
},
|
},
|
||||||
"HEADERS": {
|
KeyTypeValidations.HEADERS: {
|
||||||
"store": True,
|
"store": True,
|
||||||
"url": KeyURLs.validations,
|
"url": f"{VALID_URL_EXTENSION}{KeyURLs.validations}",
|
||||||
"data": ValidationRequest(
|
"data": ValidationRequest(
|
||||||
event_code=f"{KeyBases.update_key}",
|
event_code=f"{KeyBases.update_key}",
|
||||||
asked_field=KeyValidations.headers,
|
asked_field=KeyValidations.headers,
|
||||||
type=KeyTypes.REQUEST
|
type_=KeyTypes.REQUEST
|
||||||
).dump(),
|
).dump(),
|
||||||
},
|
},
|
||||||
"DATA": {
|
KeyTypeValidations.MODIFY: {
|
||||||
"store": True,
|
"store": False,
|
||||||
"url": f"{KeyBases.list_key}",
|
"url": f"{EVENTS_URL_EXTENSION}{KeyBases.update_key}",
|
||||||
"params": {"uu_id": "SomeUUID"},
|
"params": None,
|
||||||
"data": dict(page=1, size=1, limit=1, order_by="uu_id", order_type="desc", query={"uu_id": "SomeUUID"}),
|
"data": None,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
@ -246,9 +256,9 @@ class ClustersPageInfo:
|
||||||
|
|
||||||
# Page Variations of the cluster
|
# Page Variations of the cluster
|
||||||
page_infos = {
|
page_infos = {
|
||||||
ClustersPageInfo.dashboard_page_info.URL: ClustersPageInfo.dashboard_page_info,
|
ClustersPageInfo.DASHBOARD.URL: ClustersPageInfo.DASHBOARD,
|
||||||
ClustersPageInfo.create_page_info.URL: ClustersPageInfo.create_page_info,
|
ClustersPageInfo.CREATE.URL: ClustersPageInfo.CREATE,
|
||||||
ClustersPageInfo.update_page_info.URL: ClustersPageInfo.update_page_info,
|
ClustersPageInfo.UPDATE.URL: ClustersPageInfo.UPDATE,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -63,7 +63,7 @@ cluster_event.endpoint_callable = get_cluster_by_event_function_code
|
||||||
# Page Event
|
# Page Event
|
||||||
page_event = Event(
|
page_event = Event(
|
||||||
name="page_event",
|
name="page_event",
|
||||||
key="",
|
key="2a43bff2-3720-4427-b226-9b2f6ef00b57",
|
||||||
request_validator=PagePydantic,
|
request_validator=PagePydantic,
|
||||||
language_models=[],
|
language_models=[],
|
||||||
statics=None,
|
statics=None,
|
||||||
|
|
|
||||||
|
|
@ -6,9 +6,12 @@ from typing import Dict, Any, Optional
|
||||||
from fastapi import Request
|
from fastapi import Request
|
||||||
|
|
||||||
from ApiLayers.AllConfigs.Redis.configs import (
|
from ApiLayers.AllConfigs.Redis.configs import (
|
||||||
RedisValidationKeysAction,
|
|
||||||
RedisCategoryKeys,
|
RedisCategoryKeys,
|
||||||
|
RedisValidationKeysAction,
|
||||||
|
RedisCategoryPageInfoKeysAction,
|
||||||
)
|
)
|
||||||
|
from ApiLayers.ApiLibrary.common.line_number import get_line_number_for_error
|
||||||
|
from ApiLayers.ErrorHandlers.Exceptions.api_exc import HTTPExceptionApi
|
||||||
from Services.Redis.Actions.actions import RedisActions
|
from Services.Redis.Actions.actions import RedisActions
|
||||||
from Events.base_request_model import BaseRouteModel
|
from Events.base_request_model import BaseRouteModel
|
||||||
|
|
||||||
|
|
@ -163,6 +166,12 @@ class RetrievePage(BaseRouteModel):
|
||||||
Context Token Retriever to get user information from ACCESS_TOKEN
|
Context Token Retriever to get user information from ACCESS_TOKEN
|
||||||
CategoryCluster Retrieve Cluster Retrieve cluster by name
|
CategoryCluster Retrieve Cluster Retrieve cluster by name
|
||||||
Check available instructions of page and info user with it
|
Check available instructions of page and info user with it
|
||||||
|
Args:
|
||||||
|
request: FastAPI request object
|
||||||
|
data.page: Request body containing login credentials
|
||||||
|
{
|
||||||
|
"page": "/dashboard?site=AccountCluster"
|
||||||
|
}
|
||||||
Returns:
|
Returns:
|
||||||
NAME=cluster_name.name,
|
NAME=cluster_name.name,
|
||||||
PREFIX=cluster_name.PREFIX,
|
PREFIX=cluster_name.PREFIX,
|
||||||
|
|
@ -174,8 +183,7 @@ class RetrievePage(BaseRouteModel):
|
||||||
from Events.Engine import CategoryCluster
|
from Events.Engine import CategoryCluster
|
||||||
from Events.JustEvents.events_file import retrieve_cluster_by_name
|
from Events.JustEvents.events_file import retrieve_cluster_by_name
|
||||||
|
|
||||||
reachable_codes = []
|
reachable_codes, page_name = [], getattr(data, "page", None)
|
||||||
page_name = getattr(data, "page", None)
|
|
||||||
if cls.context_retriever.token.is_employee:
|
if cls.context_retriever.token.is_employee:
|
||||||
reachable_codes = (
|
reachable_codes = (
|
||||||
cls.context_retriever.token.selected_company.reachable_event_codes
|
cls.context_retriever.token.selected_company.reachable_event_codes
|
||||||
|
|
@ -184,25 +192,43 @@ class RetrievePage(BaseRouteModel):
|
||||||
reachable_codes = (
|
reachable_codes = (
|
||||||
cls.context_retriever.token.selected_occupant.reachable_event_codes
|
cls.context_retriever.token.selected_occupant.reachable_event_codes
|
||||||
)
|
)
|
||||||
cluster_from_all_events = cls.get_site_cluster(page_name=page_name)
|
cluster_name = str(page_name).split("?")[1].split("=")[1]
|
||||||
if not cluster_from_all_events:
|
print("page_name", f"{RedisCategoryPageInfoKeysAction.page_index}:{page_name}")
|
||||||
raise ValueError(f"Cluster not found : {page_name}")
|
page_info_from_redis = RedisActions.get_json(
|
||||||
|
list_keys=[
|
||||||
|
RedisCategoryPageInfoKeysAction.page_index,
|
||||||
|
cluster_name,
|
||||||
|
]
|
||||||
|
)
|
||||||
|
page_info_all = page_info_from_redis.first
|
||||||
|
if not page_info_all:
|
||||||
|
return dict(
|
||||||
|
NAME=f"{cluster_name}",
|
||||||
|
PREFIX=f"NOT IMPLEMENTED",
|
||||||
|
URL=f"{page_name}",
|
||||||
|
MESSAGE="Cluster not found"
|
||||||
|
)
|
||||||
|
|
||||||
cluster_name: CategoryCluster = retrieve_cluster_by_name(cluster_from_all_events)
|
page_info = page_info_all.get(page_name, {})
|
||||||
if not cluster_name:
|
sub_components = dict(page_info).get("SUB_COMPONENTS", {})
|
||||||
raise ValueError("Cluster not found")
|
|
||||||
|
|
||||||
page_info = cluster_name.retrieve_page_info().get(page_name, None)
|
print("PAGE INFO : ", dict(
|
||||||
if not page_info:
|
page_name=page_name,
|
||||||
raise ValueError("Page not found")
|
page_info=page_info,
|
||||||
|
sub_components=sub_components,
|
||||||
sub_components: dict = dict(page_info).get("SUB_COMPONENTS", {})
|
NAME=cluster_name,
|
||||||
if not sub_components:
|
PREFIX=page_info_all.get("prefix", ""),
|
||||||
raise ValueError("Sub components not found")
|
TEMPLATE_UI=dict(page_info).get("TEMPLATE_UI", ""),
|
||||||
|
URL=dict(page_info).get("URL", None),
|
||||||
new_page_info_dict = dict(
|
ICON=dict(page_info).get("ICON", None),
|
||||||
NAME=cluster_name.name,
|
INFO=dict(page_info).get("INFO", None),
|
||||||
PREFIX=cluster_name.PREFIX,
|
SUB_COMPONENTS=sub_components,
|
||||||
|
# MAPPING=cluster_name.MAPPING,
|
||||||
|
))
|
||||||
|
new_page_info = dict(
|
||||||
|
NAME=cluster_name,
|
||||||
|
PREFIX=page_info_all.get("prefix", ""),
|
||||||
|
TEMPLATE_UI=dict(page_info).get("TEMPLATE_UI", ""),
|
||||||
URL=dict(page_info).get("URL", None),
|
URL=dict(page_info).get("URL", None),
|
||||||
ICON=dict(page_info).get("ICON", None),
|
ICON=dict(page_info).get("ICON", None),
|
||||||
INFO=dict(page_info).get("INFO", None),
|
INFO=dict(page_info).get("INFO", None),
|
||||||
|
|
@ -210,10 +236,17 @@ class RetrievePage(BaseRouteModel):
|
||||||
# MAPPING=cluster_name.MAPPING,
|
# MAPPING=cluster_name.MAPPING,
|
||||||
)
|
)
|
||||||
for key, events in dict(sub_components).items():
|
for key, events in dict(sub_components).items():
|
||||||
# Meaning client can reach this endpoint [] & [] intersection
|
# Meaning client can reach this endpoint [] & [] intersection in reachable_codes
|
||||||
endpoint_event_codes = dict(events).get("ENDPOINTS", [])
|
endpoint_event_codes = dict(events).get("ENDPOINTS", [])
|
||||||
new_page_info_dict["SUB_COMPONENTS"][key].pop("ENDPOINTS")
|
if not len(list(set(endpoint_event_codes) & set(reachable_codes))) == 1:
|
||||||
if not set(endpoint_event_codes) & set(reachable_codes):
|
print(f"{endpoint_event_codes} :||: Endpoint is not available for the current user")
|
||||||
new_page_info_dict["SUB_COMPONENTS"].pop(key)
|
new_page_info["SUB_COMPONENTS"].pop(key, None)
|
||||||
|
for key in new_page_info["SUB_COMPONENTS"].keys():
|
||||||
return new_page_info_dict
|
new_page_info["SUB_COMPONENTS"][key].pop("ENDPOINTS", None)
|
||||||
|
if len(new_page_info["SUB_COMPONENTS"]) == 0:
|
||||||
|
return dict(
|
||||||
|
NAME=cluster_name,
|
||||||
|
PREFIX=page_info_all.get("prefix", ""),
|
||||||
|
MESSAGE="This cluster is not registered or not accessible for the current user"
|
||||||
|
)
|
||||||
|
return new_page_info
|
||||||
|
|
|
||||||
|
|
@ -128,6 +128,7 @@ class PageInfo:
|
||||||
LANGUAGE_MODELS: Dict[str, Any]
|
LANGUAGE_MODELS: Dict[str, Any]
|
||||||
SUB_COMPONENTS: Optional[list["PageComponent"]] = None
|
SUB_COMPONENTS: Optional[list["PageComponent"]] = None
|
||||||
INSTRUCTIONS: Optional[Dict[str, Any]] = None
|
INSTRUCTIONS: Optional[Dict[str, Any]] = None
|
||||||
|
TEMPLATE_UI: Optional[str] = "LCU"
|
||||||
|
|
||||||
def __init__(
|
def __init__(
|
||||||
self,
|
self,
|
||||||
|
|
@ -139,6 +140,7 @@ class PageInfo:
|
||||||
language_models: Optional[Dict[str, Any]] = None,
|
language_models: Optional[Dict[str, Any]] = None,
|
||||||
sub_components: Optional[list[Dict[str, Any]]] = None,
|
sub_components: Optional[list[Dict[str, Any]]] = None,
|
||||||
instructions: Optional[Dict[str, Any]] = None,
|
instructions: Optional[Dict[str, Any]] = None,
|
||||||
|
template_ui: Optional[str] = "LCU",
|
||||||
):
|
):
|
||||||
self.NAME = name
|
self.NAME = name
|
||||||
self.LANGUAGE_MODELS = language_models
|
self.LANGUAGE_MODELS = language_models
|
||||||
|
|
@ -148,6 +150,7 @@ class PageInfo:
|
||||||
self.ENDPOINTS = endpoints
|
self.ENDPOINTS = endpoints
|
||||||
self.INFO = info
|
self.INFO = info
|
||||||
self.INSTRUCTIONS = instructions
|
self.INSTRUCTIONS = instructions
|
||||||
|
self.TEMPLATE_UI = template_ui
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def endpoints(self):
|
def endpoints(self):
|
||||||
|
|
@ -163,6 +166,7 @@ class PageInfo:
|
||||||
"NAME": self.NAME,
|
"NAME": self.NAME,
|
||||||
"ICON": self.ICON,
|
"ICON": self.ICON,
|
||||||
"URL": self.URL,
|
"URL": self.URL,
|
||||||
|
"TEMPLATE_UI": self.TEMPLATE_UI,
|
||||||
"LANGUAGE_MODELS": self.LANGUAGE_MODELS,
|
"LANGUAGE_MODELS": self.LANGUAGE_MODELS,
|
||||||
"INFO": self.INFO,
|
"INFO": self.INFO,
|
||||||
"SUB_COMPONENTS": self.SUB_COMPONENTS,
|
"SUB_COMPONENTS": self.SUB_COMPONENTS,
|
||||||
|
|
@ -329,6 +333,7 @@ class CategoryCluster:
|
||||||
DESCRIPTION: str
|
DESCRIPTION: str
|
||||||
ENDPOINTS: dict[str, MethodToEvent] # {"MethodToEvent": MethodToEvent, ...}
|
ENDPOINTS: dict[str, MethodToEvent] # {"MethodToEvent": MethodToEvent, ...}
|
||||||
SUBCATEGORY: Optional[List["CategoryCluster"]] # [CategoryCluster, ...]
|
SUBCATEGORY: Optional[List["CategoryCluster"]] # [CategoryCluster, ...]
|
||||||
|
TEMPLATE_UI: Optional[str] = "LCU" # LCU as List/Create/Update
|
||||||
MAPPING: Optional[List[Dict[str, Any]]] # [{"key": "value"}, ...]
|
MAPPING: Optional[List[Dict[str, Any]]] # [{"key": "value"}, ...]
|
||||||
INCLUDE_IN_SCHEMA: Optional[bool] = True
|
INCLUDE_IN_SCHEMA: Optional[bool] = True
|
||||||
IS_CLIENT: Optional[bool] = False
|
IS_CLIENT: Optional[bool] = False
|
||||||
|
|
@ -343,6 +348,7 @@ class CategoryCluster:
|
||||||
sub_category: list,
|
sub_category: list,
|
||||||
mapping: Optional[List[Dict[str, Any]]] = None,
|
mapping: Optional[List[Dict[str, Any]]] = None,
|
||||||
pageinfo: Optional[Dict["str", PageInfo]] = None,
|
pageinfo: Optional[Dict["str", PageInfo]] = None,
|
||||||
|
template_ui: Optional[str] = "LCU",
|
||||||
include_in_schema: Optional[bool] = True,
|
include_in_schema: Optional[bool] = True,
|
||||||
is_client: Optional[bool] = False,
|
is_client: Optional[bool] = False,
|
||||||
):
|
):
|
||||||
|
|
@ -355,6 +361,7 @@ class CategoryCluster:
|
||||||
self.SUBCATEGORY = sub_category or []
|
self.SUBCATEGORY = sub_category or []
|
||||||
self.INCLUDE_IN_SCHEMA = include_in_schema
|
self.INCLUDE_IN_SCHEMA = include_in_schema
|
||||||
self.MAPPING = mapping
|
self.MAPPING = mapping
|
||||||
|
self.TEMPLATE_UI = template_ui
|
||||||
self.IS_CLIENT = is_client
|
self.IS_CLIENT = is_client
|
||||||
|
|
||||||
@property
|
@property
|
||||||
|
|
@ -408,6 +415,7 @@ class CategoryCluster:
|
||||||
return {"prefix": self.PREFIX, "mapping": self.MAPPING, **page_infos}
|
return {"prefix": self.PREFIX, "mapping": self.MAPPING, **page_infos}
|
||||||
"""
|
"""
|
||||||
page_infos = {}
|
page_infos = {}
|
||||||
|
print('def retrieve_page_info self.PAGEINFO',self.PAGEINFO)
|
||||||
if isinstance(self.PAGEINFO, dict):
|
if isinstance(self.PAGEINFO, dict):
|
||||||
for page_key, page_info in dict(self.PAGEINFO).items():
|
for page_key, page_info in dict(self.PAGEINFO).items():
|
||||||
if page_info_dict := getattr(page_info, "as_dict", None):
|
if page_info_dict := getattr(page_info, "as_dict", None):
|
||||||
|
|
@ -415,7 +423,7 @@ class CategoryCluster:
|
||||||
return {"prefix": self.PREFIX, "mapping": self.MAPPING, **page_infos}
|
return {"prefix": self.PREFIX, "mapping": self.MAPPING, **page_infos}
|
||||||
if hasattr(self.PAGEINFO, "as_dict"):
|
if hasattr(self.PAGEINFO, "as_dict"):
|
||||||
return {"prefix": self.PREFIX, "mapping": self.MAPPING, **self.PAGEINFO.as_dict}
|
return {"prefix": self.PREFIX, "mapping": self.MAPPING, **self.PAGEINFO.as_dict}
|
||||||
raise ValueError("PAGE_INFO not found")
|
return {"prefix": self.PREFIX, "mapping": self.MAPPING}
|
||||||
|
|
||||||
|
|
||||||
class LanguageModels:
|
class LanguageModels:
|
||||||
|
|
|
||||||
|
|
@ -24,6 +24,10 @@ from Services.PostgresDb.Models.pagination import (
|
||||||
TokenDictType = Union[EmployeeTokenObject, OccupantTokenObject]
|
TokenDictType = Union[EmployeeTokenObject, OccupantTokenObject]
|
||||||
|
|
||||||
STATIC_PATH = "events"
|
STATIC_PATH = "events"
|
||||||
|
AUTH_URL_EXTENSION = "http://auth-service:8888"
|
||||||
|
EVENTS_URL_EXTENSION = "http://events-service:8888"
|
||||||
|
VALID_URL_EXTENSION = "http://validation-service:8888"
|
||||||
|
|
||||||
|
|
||||||
class EndpointBaseRequestModel(BaseModel):
|
class EndpointBaseRequestModel(BaseModel):
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -168,4 +168,4 @@ The AI will automatically:
|
||||||
- Update existing notes when relevant
|
- Update existing notes when relevant
|
||||||
- Track development progress
|
- Track development progress
|
||||||
|
|
||||||
For detailed documentation about specific components, refer to the corresponding files in the `/docs/` directory.
|
For detailed documentation about specific components, refer to the corresponding files in the `/docs/` directory.
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,5 @@
|
||||||
services:
|
services:
|
||||||
|
|
||||||
initservice:
|
initservice:
|
||||||
container_name: initservice
|
container_name: initservice
|
||||||
build:
|
build:
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue