maleo-foundation 0.0.29__py3-none-any.whl → 0.0.30__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- maleo_foundation/models/schemas/general.py +14 -14
- maleo_foundation/models/schemas/parameter.py +3 -3
- maleo_foundation/models/schemas/result.py +8 -8
- maleo_foundation/models/{types/general.py → types.py} +1 -1
- {maleo_foundation-0.0.29.dist-info → maleo_foundation-0.0.30.dist-info}/METADATA +1 -1
- {maleo_foundation-0.0.29.dist-info → maleo_foundation-0.0.30.dist-info}/RECORD +9 -10
- maleo_foundation/models/types/__init__.py +0 -7
- /maleo_foundation/models/{types → extended_types}/parameter.py +0 -0
- {maleo_foundation-0.0.29.dist-info → maleo_foundation-0.0.30.dist-info}/WHEEL +0 -0
- {maleo_foundation-0.0.29.dist-info → maleo_foundation-0.0.30.dist-info}/top_level.txt +0 -0
@@ -5,22 +5,22 @@ from typing import Optional, Any
|
|
5
5
|
from uuid import UUID
|
6
6
|
from maleo_foundation.constants import REFRESH_TOKEN_DURATION_DAYS, ACCESS_TOKEN_DURATION_MINUTES
|
7
7
|
from maleo_foundation.models.enums import BaseEnums
|
8
|
-
from maleo_foundation.models.types
|
8
|
+
from maleo_foundation.models.types import BaseTypes
|
9
9
|
|
10
10
|
class BaseGeneralSchemas:
|
11
11
|
class IDs(BaseModel):
|
12
|
-
ids:
|
12
|
+
ids:BaseTypes.OptionalListOfIntegers = Field(None, description="Specific IDs")
|
13
13
|
|
14
14
|
class Search(BaseModel):
|
15
|
-
search:
|
15
|
+
search:BaseTypes.OptionalString = Field(None, description="Search parameter string.")
|
16
16
|
|
17
17
|
class DateFilter(BaseModel):
|
18
18
|
name:str = Field(..., description="Column name.")
|
19
|
-
from_date:
|
20
|
-
to_date:
|
19
|
+
from_date:BaseTypes.OptionalDatetime = Field(None, description="From date.")
|
20
|
+
to_date:BaseTypes.OptionalDatetime = Field(None, description="To date.")
|
21
21
|
|
22
22
|
class Statuses(BaseModel):
|
23
|
-
statuses:
|
23
|
+
statuses:BaseTypes.OptionalListOfStatuses = Field(None, description="Data's status")
|
24
24
|
|
25
25
|
class SortColumn(BaseModel):
|
26
26
|
name:str = Field(..., description="Column name.")
|
@@ -39,7 +39,7 @@ class BaseGeneralSchemas:
|
|
39
39
|
action:BaseEnums.StatusUpdateAction = Field(..., description="Status update's action to be executed")
|
40
40
|
|
41
41
|
class Expand(BaseModel):
|
42
|
-
expand:
|
42
|
+
expand:BaseTypes.OptionalListOfStrings = Field(None, description="Expanded field(s)")
|
43
43
|
|
44
44
|
class PrivateKey(BaseModel):
|
45
45
|
private_key:str = Field(..., description="Private key in str format.")
|
@@ -61,13 +61,13 @@ class BaseGeneralSchemas:
|
|
61
61
|
class Timestamps(BaseModel):
|
62
62
|
created_at:datetime = Field(..., description="Data's created_at timestamp")
|
63
63
|
updated_at:datetime = Field(..., description="Data's updated_at timestamp")
|
64
|
-
deleted_at:
|
65
|
-
restored_at:
|
66
|
-
deactivated_at:
|
64
|
+
deleted_at:BaseTypes.OptionalDatetime = Field(..., description="Data's deleted_at timestamp")
|
65
|
+
restored_at:BaseTypes.OptionalDatetime = Field(..., description="Data's restored_at timestamp")
|
66
|
+
deactivated_at:BaseTypes.OptionalDatetime = Field(..., description="Data's deactivated_at timestamp")
|
67
67
|
activated_at:datetime = Field(..., description="Data's activated_at timestamp")
|
68
68
|
|
69
69
|
@field_serializer('created_at', 'updated_at', 'deleted_at', 'restored_at', 'deactivated_at', 'activated_at')
|
70
|
-
def serialize_timestamps(self, value:
|
70
|
+
def serialize_timestamps(self, value:BaseTypes.OptionalDatetime, info:FieldSerializationInfo) -> str:
|
71
71
|
"""Serializes datetime/date fields to ISO format."""
|
72
72
|
if value is not None:
|
73
73
|
return value.isoformat()
|
@@ -77,7 +77,7 @@ class BaseGeneralSchemas:
|
|
77
77
|
status:BaseEnums.StatusType = Field(..., description="Data's status")
|
78
78
|
|
79
79
|
class Order(BaseModel):
|
80
|
-
order:
|
80
|
+
order:BaseTypes.OptionalInteger = Field(..., description="Data's order")
|
81
81
|
|
82
82
|
class Key(BaseModel):
|
83
83
|
key:str = Field(..., description="Data's key")
|
@@ -89,8 +89,8 @@ class BaseGeneralSchemas:
|
|
89
89
|
t:BaseEnums.TokenType = Field(..., description="Token Type")
|
90
90
|
sr:UUID = Field(..., description="System role")
|
91
91
|
u:UUID = Field(..., description="user")
|
92
|
-
o:
|
93
|
-
uor:
|
92
|
+
o:BaseTypes.OptionalUUID = Field(..., description="Organization")
|
93
|
+
uor:BaseTypes.OptionalListOfUUIDs = Field(..., description="User Organization Role")
|
94
94
|
iat_dt:datetime = Field(datetime.now(timezone.utc), description="Issued at (datetime)")
|
95
95
|
iat:int = Field(None, description="Issued at (integer)")
|
96
96
|
exp_dt:datetime = Field(None, description="Expired at (datetime)")
|
@@ -1,18 +1,18 @@
|
|
1
1
|
from pydantic import BaseModel, Field
|
2
2
|
from maleo_foundation.models.enums import BaseEnums
|
3
3
|
from maleo_foundation.models.schemas.general import BaseGeneralSchemas
|
4
|
-
from maleo_foundation.models.types
|
4
|
+
from maleo_foundation.models.types import BaseTypes
|
5
5
|
# from maleo_foundation.models.types.parameter import BaseParameterTypes
|
6
6
|
|
7
7
|
class BaseParameterSchemas:
|
8
8
|
class Filters(BaseModel):
|
9
|
-
filters:
|
9
|
+
filters:BaseTypes.ListOfStrings = Field([], description="Filters for date range, e.g. 'created_at|from::<ISO_DATETIME>|to::<ISO_DATETIME>'.")
|
10
10
|
|
11
11
|
class DateFilters(BaseModel):
|
12
12
|
date_filters:list[BaseGeneralSchemas.DateFilter] = Field([], description="Date filters to be applied")
|
13
13
|
|
14
14
|
class Sorts(BaseModel):
|
15
|
-
sorts:
|
15
|
+
sorts:BaseTypes.ListOfStrings = Field(["id.asc"], description="Sorting columns in 'column_name.asc' or 'column_name.desc' format.")
|
16
16
|
|
17
17
|
class SortColumns(BaseModel):
|
18
18
|
sort_columns:list[BaseGeneralSchemas.SortColumn] = Field([BaseGeneralSchemas.SortColumn(name="id", order=BaseEnums.SortOrder.ASC)], description="List of columns to be sorted")
|
@@ -1,24 +1,24 @@
|
|
1
1
|
from pydantic import BaseModel, Field
|
2
2
|
from typing import Literal, Optional, Any
|
3
3
|
from maleo_foundation.models.schemas.general import BaseGeneralSchemas
|
4
|
-
from maleo_foundation.models.types
|
4
|
+
from maleo_foundation.models.types import BaseTypes
|
5
5
|
|
6
6
|
class BaseResultSchemas:
|
7
7
|
class Base(BaseModel):
|
8
8
|
success:bool = Field(..., description="Success status")
|
9
|
-
code:
|
10
|
-
message:
|
11
|
-
description:
|
9
|
+
code:BaseTypes.OptionalString = Field(None, description="Optional result code")
|
10
|
+
message:BaseTypes.OptionalString = Field(None, description="Optional message")
|
11
|
+
description:BaseTypes.OptionalString = Field(None, description="Optional description")
|
12
12
|
data:Any = Field(..., description="Data")
|
13
|
-
other:
|
13
|
+
other:BaseTypes.OptionalAny = Field(None, description="Optional other information")
|
14
14
|
|
15
15
|
#* ----- ----- ----- Intermediary ----- ----- ----- *#
|
16
16
|
class Fail(Base):
|
17
|
-
success:
|
17
|
+
success:BaseTypes.LiteralFalse = Field(False, description="Success status")
|
18
18
|
data:None = Field(None, description="No data")
|
19
19
|
|
20
20
|
class Success(Base):
|
21
|
-
success:
|
21
|
+
success:BaseTypes.LiteralTrue = Field(True, description="Success status")
|
22
22
|
data:Any = Field(..., description="Data")
|
23
23
|
|
24
24
|
#* ----- ----- ----- Derived ----- ----- ----- *#
|
@@ -29,7 +29,7 @@ class BaseResultSchemas:
|
|
29
29
|
data:Any = Field(..., description="Fetched single data")
|
30
30
|
|
31
31
|
class UnpaginatedMultipleData(Success):
|
32
|
-
data:
|
32
|
+
data:BaseTypes.ListOfAny = Field(..., description="Unpaginated multiple data")
|
33
33
|
|
34
34
|
class PaginatedMultipleData(
|
35
35
|
UnpaginatedMultipleData,
|
@@ -20,14 +20,16 @@ maleo_foundation/middlewares/cors.py,sha256=9uvBvY2N6Vxa9RP_YtESxcWo6Doi6uS0lzAG
|
|
20
20
|
maleo_foundation/models/__init__.py,sha256=o1XI5JgHLH7yEnFlNIM_17ZDnBVzs2WGsAeWeI_v9nQ,424
|
21
21
|
maleo_foundation/models/enums.py,sha256=Ob2v312JxypHEq7hTKZKOV462FEeLkIjIhpx-YF6Jdw,2203
|
22
22
|
maleo_foundation/models/responses.py,sha256=1Rs3EflBJdsTC8PSbaOFbbTyxwRwK031eU3qLEj21sU,4215
|
23
|
+
maleo_foundation/models/types.py,sha256=rg9AoNwwECJ2BhYdoz3DiUMlBgFRWVEl4KGrfTCntnI,1213
|
23
24
|
maleo_foundation/models/extended_types/__init__.py,sha256=rv2_EO_97UwaJq3NxTBrw-08E786vb3boSlIezMnA48,275
|
24
25
|
maleo_foundation/models/extended_types/client.py,sha256=zHY2yvSKf6vMHr08FUjSh9n-nXjdFR0CD1J1S_nAa0M,1582
|
26
|
+
maleo_foundation/models/extended_types/parameter.py,sha256=TXZ3WHvtn8g6jOQY5k4h5GQQk_8e4unpg1Q7W1J3EY0,306
|
25
27
|
maleo_foundation/models/extended_types/query.py,sha256=9hI_w5xuCNkzOL6VW4LcDta60vlT-AZ5WYyRJyucsv8,1571
|
26
28
|
maleo_foundation/models/extended_types/service.py,sha256=Xos2wYJUwTODKeJ95DIQPn0udfA7pS1JkLnQ2XrtscE,1599
|
27
29
|
maleo_foundation/models/schemas/__init__.py,sha256=Xj8Ahsqyra-fmEaVcGPok5GOOsPQlKcknHYMvbjvENA,277
|
28
|
-
maleo_foundation/models/schemas/general.py,sha256=
|
29
|
-
maleo_foundation/models/schemas/parameter.py,sha256=
|
30
|
-
maleo_foundation/models/schemas/result.py,sha256=
|
30
|
+
maleo_foundation/models/schemas/general.py,sha256=JwsAP-rLO_o4lgPUi9gYHGhwzV7KVzsg8axAJZNyxlw,6680
|
31
|
+
maleo_foundation/models/schemas/parameter.py,sha256=NYB1gOnTCIaju8WZ66TeH03kQGtmPSprxlqatdiWoX0,1028
|
32
|
+
maleo_foundation/models/schemas/result.py,sha256=JNivX8JS5KH2P3cTl51RfqvSBQbtaLNFWP9-SNVG4-g,1773
|
31
33
|
maleo_foundation/models/transfers/__init__.py,sha256=B8oCZHE3NTsrJ_rviSXaDsuc-gc25jpjuhJO40lpQiE,222
|
32
34
|
maleo_foundation/models/transfers/parameters/__init__.py,sha256=oKW4RPIEISISRjsJzD8lsCGY1HhZRTzshPpWHcJu86k,353
|
33
35
|
maleo_foundation/models/transfers/parameters/client.py,sha256=Q43A-Z7JPXcxb_v7iUKoA1_WV8AMdEaeSl9Z39WSF_8,2287
|
@@ -43,15 +45,12 @@ maleo_foundation/models/transfers/results/service/general.py,sha256=G4x-MhQI7Km9
|
|
43
45
|
maleo_foundation/models/transfers/results/service/query.py,sha256=Wj9GCWk7FrKP0EoK55vJcr9YJ42Lo24mLXbRk9j0IJw,2566
|
44
46
|
maleo_foundation/models/transfers/results/service/controllers/__init__.py,sha256=HZJWMy2dskzOCzLmp_UaL9rjbQ-sDMI7sd2bXb-4QOU,175
|
45
47
|
maleo_foundation/models/transfers/results/service/controllers/rest.py,sha256=bZ4NibT58aim6p3epFJ9ipR8Z54FkOuFx2GniK4CUfM,1114
|
46
|
-
maleo_foundation/models/types/__init__.py,sha256=qR0IswZWJSbe_Pa-SSHGbi38bK1_M5M3fhuq4q8b4hw,198
|
47
|
-
maleo_foundation/models/types/general.py,sha256=j_bwdMYaYoUpI4CsA5_xMyk_J1PMGzD2Ms8TpDNN1MQ,1220
|
48
|
-
maleo_foundation/models/types/parameter.py,sha256=TXZ3WHvtn8g6jOQY5k4h5GQQk_8e4unpg1Q7W1J3EY0,306
|
49
48
|
maleo_foundation/utils/__init__.py,sha256=tfgaHZI2PDgxEVSQztfnDMN5S6L5Y4FcK5v_Wkf5snE,245
|
50
49
|
maleo_foundation/utils/exceptions.py,sha256=mcvBwHm6uWpVQkPtO1T2j-GaTYEiyPOeGxiDL9-sjNA,3639
|
51
50
|
maleo_foundation/utils/logger.py,sha256=ICrFi0MxuAjDy8KTRL7pex1miwzZqZX-HHArgN3niJM,2453
|
52
51
|
maleo_foundation/utils/formatter/__init__.py,sha256=iKf5YCbEdg1qKnFHyKqqcQbqAqEeRUf8mhI3v3dQoj8,78
|
53
52
|
maleo_foundation/utils/formatter/case.py,sha256=TmvvlfzGdC_omMTB5vAa40TZBxQ3hnr-SYeo0M52Rlg,1352
|
54
|
-
maleo_foundation-0.0.
|
55
|
-
maleo_foundation-0.0.
|
56
|
-
maleo_foundation-0.0.
|
57
|
-
maleo_foundation-0.0.
|
53
|
+
maleo_foundation-0.0.30.dist-info/METADATA,sha256=ZOY-bdyVHfekG7GkNV7HCjKGes3LrLQw2XU-Xo0ZmbA,3160
|
54
|
+
maleo_foundation-0.0.30.dist-info/WHEEL,sha256=lTU6B6eIfYoiQJTZNc-fyaR6BpL6ehTzU3xGYxn2n8k,91
|
55
|
+
maleo_foundation-0.0.30.dist-info/top_level.txt,sha256=_iBos3F_bhEOdjOnzeiEYSrCucasc810xXtLBXI8cQc,17
|
56
|
+
maleo_foundation-0.0.30.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|