(20241225) Work started on upgrades and server-registration module.

This commit is contained in:
2024-12-25 14:52:07 +05:30
parent 053e2c49e3
commit 1fd287900d
8 changed files with 647 additions and 164 deletions
+45 -4
View File
@@ -74,6 +74,50 @@ import datetime
# *****************************************************************************************************************
class LogChainRequestData(BaseModel):
limit: int = Field(
description = "the max. logs to pick",
default = 25,
frozen = True
)
skip: int = Field(
description = "how many initial matches to skip before picking logs; needed for pagination",
default = 0,
frozen = True
)
sort: dict = Field(
description = "the sorting conditions for the picked logs",
default = {"ts": 1, "_id": -1},
frozen = True
)
projection: dict = Field(
description = "to decide what fields are retrieved",
default = {"_id": False},
frozen = True
)
# ┏┓ ┏•
# ┃ ┏┓┏┓╋┓┏┓
# ┗┛┗┛┛┗┛┗┗┫
# ┛
class Config:
extra = "forbid"
# ┓┏ ┓• ┓ •
# ┃┃┏┓┃┓┏┫┏┓╋┓┏┓┏┓
# ┗┛┗┻┗┗┗┻┗┻┗┗┗┛┛┗
pass
# ---------------------------------------------------------------------------------------------------------------------
class LogsByFilterRequestData(BaseModel):
filter: dict = Field(
@@ -117,10 +161,7 @@ class LogsByFilterRequestData(BaseModel):
# ┃┃┏┓┃┓┏┫┏┓╋┓┏┓┏┓
# ┗┛┗┻┗┗┗┻┗┻┗┗┗┛┛┗
@field_validator("unsetJson", "setJson", mode = "before")
def ensure_non_null(cls, value):
if value is None: value = {}
return value
pass
# *****************************************************************************************************************