maleo-foundation 0.2.51__tar.gz → 0.2.53__tar.gz

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.
Files changed (130) hide show
  1. {maleo_foundation-0.2.51 → maleo_foundation-0.2.53}/PKG-INFO +1 -1
  2. {maleo_foundation-0.2.51 → maleo_foundation-0.2.53}/maleo_foundation/models/responses.py +1 -2
  3. maleo_foundation-0.2.53/maleo_foundation/models/schemas/general.py +34 -0
  4. {maleo_foundation-0.2.51 → maleo_foundation-0.2.53}/maleo_foundation/models/schemas/parameter.py +46 -1
  5. {maleo_foundation-0.2.51 → maleo_foundation-0.2.53}/maleo_foundation/models/schemas/result.py +38 -1
  6. {maleo_foundation-0.2.51 → maleo_foundation-0.2.53}/maleo_foundation/models/transfers/parameters/client.py +2 -2
  7. maleo_foundation-0.2.53/maleo_foundation/models/transfers/parameters/general.py +23 -0
  8. {maleo_foundation-0.2.51 → maleo_foundation-0.2.53}/maleo_foundation/models/transfers/parameters/service.py +2 -2
  9. {maleo_foundation-0.2.51 → maleo_foundation-0.2.53}/maleo_foundation/models/transfers/results/client/service.py +1 -2
  10. {maleo_foundation-0.2.51 → maleo_foundation-0.2.53}/maleo_foundation/models/transfers/results/service/general.py +1 -2
  11. {maleo_foundation-0.2.51 → maleo_foundation-0.2.53}/maleo_foundation/models/transfers/results/service/repository.py +1 -2
  12. {maleo_foundation-0.2.51 → maleo_foundation-0.2.53}/maleo_foundation.egg-info/PKG-INFO +1 -1
  13. {maleo_foundation-0.2.51 → maleo_foundation-0.2.53}/pyproject.toml +1 -1
  14. maleo_foundation-0.2.51/maleo_foundation/models/schemas/general.py +0 -104
  15. maleo_foundation-0.2.51/maleo_foundation/models/transfers/parameters/general.py +0 -20
  16. {maleo_foundation-0.2.51 → maleo_foundation-0.2.53}/README.md +0 -0
  17. {maleo_foundation-0.2.51 → maleo_foundation-0.2.53}/maleo_foundation/__init__.py +0 -0
  18. {maleo_foundation-0.2.51 → maleo_foundation-0.2.53}/maleo_foundation/authentication.py +0 -0
  19. {maleo_foundation-0.2.51 → maleo_foundation-0.2.53}/maleo_foundation/authorization.py +0 -0
  20. {maleo_foundation-0.2.51 → maleo_foundation-0.2.53}/maleo_foundation/client/__init__.py +0 -0
  21. {maleo_foundation-0.2.51 → maleo_foundation-0.2.53}/maleo_foundation/client/manager.py +0 -0
  22. {maleo_foundation-0.2.51 → maleo_foundation-0.2.53}/maleo_foundation/client/services/__init__.py +0 -0
  23. {maleo_foundation-0.2.51 → maleo_foundation-0.2.53}/maleo_foundation/client/services/encryption/__init__.py +0 -0
  24. {maleo_foundation-0.2.51 → maleo_foundation-0.2.53}/maleo_foundation/client/services/encryption/aes.py +0 -0
  25. {maleo_foundation-0.2.51 → maleo_foundation-0.2.53}/maleo_foundation/client/services/encryption/rsa.py +0 -0
  26. {maleo_foundation-0.2.51 → maleo_foundation-0.2.53}/maleo_foundation/client/services/hash/__init__.py +0 -0
  27. {maleo_foundation-0.2.51 → maleo_foundation-0.2.53}/maleo_foundation/client/services/hash/bcrypt.py +0 -0
  28. {maleo_foundation-0.2.51 → maleo_foundation-0.2.53}/maleo_foundation/client/services/hash/hmac.py +0 -0
  29. {maleo_foundation-0.2.51 → maleo_foundation-0.2.53}/maleo_foundation/client/services/hash/sha256.py +0 -0
  30. {maleo_foundation-0.2.51 → maleo_foundation-0.2.53}/maleo_foundation/client/services/key.py +0 -0
  31. {maleo_foundation-0.2.51 → maleo_foundation-0.2.53}/maleo_foundation/client/services/signature.py +0 -0
  32. {maleo_foundation-0.2.51 → maleo_foundation-0.2.53}/maleo_foundation/client/services/token.py +0 -0
  33. {maleo_foundation-0.2.51 → maleo_foundation-0.2.53}/maleo_foundation/constants.py +0 -0
  34. {maleo_foundation-0.2.51 → maleo_foundation-0.2.53}/maleo_foundation/enums.py +0 -0
  35. {maleo_foundation-0.2.51 → maleo_foundation-0.2.53}/maleo_foundation/expanded_types/__init__.py +0 -0
  36. {maleo_foundation-0.2.51 → maleo_foundation-0.2.53}/maleo_foundation/expanded_types/client.py +0 -0
  37. {maleo_foundation-0.2.51 → maleo_foundation-0.2.53}/maleo_foundation/expanded_types/encryption/__init__.py +0 -0
  38. {maleo_foundation-0.2.51 → maleo_foundation-0.2.53}/maleo_foundation/expanded_types/encryption/aes.py +0 -0
  39. {maleo_foundation-0.2.51 → maleo_foundation-0.2.53}/maleo_foundation/expanded_types/encryption/rsa.py +0 -0
  40. {maleo_foundation-0.2.51 → maleo_foundation-0.2.53}/maleo_foundation/expanded_types/general.py +0 -0
  41. {maleo_foundation-0.2.51 → maleo_foundation-0.2.53}/maleo_foundation/expanded_types/hash.py +0 -0
  42. {maleo_foundation-0.2.51 → maleo_foundation-0.2.53}/maleo_foundation/expanded_types/key.py +0 -0
  43. {maleo_foundation-0.2.51 → maleo_foundation-0.2.53}/maleo_foundation/expanded_types/repository.py +0 -0
  44. {maleo_foundation-0.2.51 → maleo_foundation-0.2.53}/maleo_foundation/expanded_types/service.py +0 -0
  45. {maleo_foundation-0.2.51 → maleo_foundation-0.2.53}/maleo_foundation/expanded_types/signature.py +0 -0
  46. {maleo_foundation-0.2.51 → maleo_foundation-0.2.53}/maleo_foundation/expanded_types/token.py +0 -0
  47. {maleo_foundation-0.2.51 → maleo_foundation-0.2.53}/maleo_foundation/extended_types.py +0 -0
  48. {maleo_foundation-0.2.51 → maleo_foundation-0.2.53}/maleo_foundation/managers/__init__.py +0 -0
  49. {maleo_foundation-0.2.51 → maleo_foundation-0.2.53}/maleo_foundation/managers/cache/__init__.py +0 -0
  50. {maleo_foundation-0.2.51 → maleo_foundation-0.2.53}/maleo_foundation/managers/cache/base.py +0 -0
  51. {maleo_foundation-0.2.51 → maleo_foundation-0.2.53}/maleo_foundation/managers/cache/redis.py +0 -0
  52. {maleo_foundation-0.2.51 → maleo_foundation-0.2.53}/maleo_foundation/managers/client/__init__.py +0 -0
  53. {maleo_foundation-0.2.51 → maleo_foundation-0.2.53}/maleo_foundation/managers/client/base.py +0 -0
  54. {maleo_foundation-0.2.51 → maleo_foundation-0.2.53}/maleo_foundation/managers/client/google/__init__.py +0 -0
  55. {maleo_foundation-0.2.51 → maleo_foundation-0.2.53}/maleo_foundation/managers/client/google/base.py +0 -0
  56. {maleo_foundation-0.2.51 → maleo_foundation-0.2.53}/maleo_foundation/managers/client/google/parameter.py +0 -0
  57. {maleo_foundation-0.2.51 → maleo_foundation-0.2.53}/maleo_foundation/managers/client/google/secret.py +0 -0
  58. {maleo_foundation-0.2.51 → maleo_foundation-0.2.53}/maleo_foundation/managers/client/google/storage.py +0 -0
  59. {maleo_foundation-0.2.51 → maleo_foundation-0.2.53}/maleo_foundation/managers/client/maleo.py +0 -0
  60. {maleo_foundation-0.2.51 → maleo_foundation-0.2.53}/maleo_foundation/managers/db.py +0 -0
  61. {maleo_foundation-0.2.51 → maleo_foundation-0.2.53}/maleo_foundation/managers/middleware.py +0 -0
  62. {maleo_foundation-0.2.51 → maleo_foundation-0.2.53}/maleo_foundation/managers/service.py +0 -0
  63. {maleo_foundation-0.2.51 → maleo_foundation-0.2.53}/maleo_foundation/middlewares/authentication.py +0 -0
  64. {maleo_foundation-0.2.51 → maleo_foundation-0.2.53}/maleo_foundation/middlewares/base.py +0 -0
  65. {maleo_foundation-0.2.51 → maleo_foundation-0.2.53}/maleo_foundation/middlewares/cors.py +0 -0
  66. {maleo_foundation-0.2.51 → maleo_foundation-0.2.53}/maleo_foundation/models/__init__.py +0 -0
  67. {maleo_foundation-0.2.51 → maleo_foundation-0.2.53}/maleo_foundation/models/schemas/__init__.py +0 -0
  68. {maleo_foundation-0.2.51 → maleo_foundation-0.2.53}/maleo_foundation/models/schemas/encryption.py +0 -0
  69. {maleo_foundation-0.2.51 → maleo_foundation-0.2.53}/maleo_foundation/models/schemas/hash.py +0 -0
  70. {maleo_foundation-0.2.51 → maleo_foundation-0.2.53}/maleo_foundation/models/schemas/key.py +0 -0
  71. {maleo_foundation-0.2.51 → maleo_foundation-0.2.53}/maleo_foundation/models/schemas/signature.py +0 -0
  72. {maleo_foundation-0.2.51 → maleo_foundation-0.2.53}/maleo_foundation/models/schemas/token.py +0 -0
  73. {maleo_foundation-0.2.51 → maleo_foundation-0.2.53}/maleo_foundation/models/table.py +0 -0
  74. {maleo_foundation-0.2.51 → maleo_foundation-0.2.53}/maleo_foundation/models/transfers/__init__.py +0 -0
  75. {maleo_foundation-0.2.51 → maleo_foundation-0.2.53}/maleo_foundation/models/transfers/general/__init__.py +0 -0
  76. {maleo_foundation-0.2.51 → maleo_foundation-0.2.53}/maleo_foundation/models/transfers/general/key.py +0 -0
  77. {maleo_foundation-0.2.51 → maleo_foundation-0.2.53}/maleo_foundation/models/transfers/general/signature.py +0 -0
  78. {maleo_foundation-0.2.51 → maleo_foundation-0.2.53}/maleo_foundation/models/transfers/general/token.py +0 -0
  79. {maleo_foundation-0.2.51 → maleo_foundation-0.2.53}/maleo_foundation/models/transfers/parameters/__init__.py +0 -0
  80. {maleo_foundation-0.2.51 → maleo_foundation-0.2.53}/maleo_foundation/models/transfers/parameters/encryption/__init__.py +0 -0
  81. {maleo_foundation-0.2.51 → maleo_foundation-0.2.53}/maleo_foundation/models/transfers/parameters/encryption/aes.py +0 -0
  82. {maleo_foundation-0.2.51 → maleo_foundation-0.2.53}/maleo_foundation/models/transfers/parameters/encryption/rsa.py +0 -0
  83. {maleo_foundation-0.2.51 → maleo_foundation-0.2.53}/maleo_foundation/models/transfers/parameters/hash/__init__.py +0 -0
  84. {maleo_foundation-0.2.51 → maleo_foundation-0.2.53}/maleo_foundation/models/transfers/parameters/hash/bcrypt.py +0 -0
  85. {maleo_foundation-0.2.51 → maleo_foundation-0.2.53}/maleo_foundation/models/transfers/parameters/hash/hmac.py +0 -0
  86. {maleo_foundation-0.2.51 → maleo_foundation-0.2.53}/maleo_foundation/models/transfers/parameters/hash/sha256.py +0 -0
  87. {maleo_foundation-0.2.51 → maleo_foundation-0.2.53}/maleo_foundation/models/transfers/parameters/key.py +0 -0
  88. {maleo_foundation-0.2.51 → maleo_foundation-0.2.53}/maleo_foundation/models/transfers/parameters/signature.py +0 -0
  89. {maleo_foundation-0.2.51 → maleo_foundation-0.2.53}/maleo_foundation/models/transfers/parameters/token.py +0 -0
  90. {maleo_foundation-0.2.51 → maleo_foundation-0.2.53}/maleo_foundation/models/transfers/results/__init__.py +0 -0
  91. {maleo_foundation-0.2.51 → maleo_foundation-0.2.53}/maleo_foundation/models/transfers/results/client/__init__.py +0 -0
  92. {maleo_foundation-0.2.51 → maleo_foundation-0.2.53}/maleo_foundation/models/transfers/results/client/controllers/__init__.py +0 -0
  93. {maleo_foundation-0.2.51 → maleo_foundation-0.2.53}/maleo_foundation/models/transfers/results/client/controllers/http.py +0 -0
  94. {maleo_foundation-0.2.51 → maleo_foundation-0.2.53}/maleo_foundation/models/transfers/results/encryption/__init__.py +0 -0
  95. {maleo_foundation-0.2.51 → maleo_foundation-0.2.53}/maleo_foundation/models/transfers/results/encryption/aes.py +0 -0
  96. {maleo_foundation-0.2.51 → maleo_foundation-0.2.53}/maleo_foundation/models/transfers/results/encryption/rsa.py +0 -0
  97. {maleo_foundation-0.2.51 → maleo_foundation-0.2.53}/maleo_foundation/models/transfers/results/hash.py +0 -0
  98. {maleo_foundation-0.2.51 → maleo_foundation-0.2.53}/maleo_foundation/models/transfers/results/key.py +0 -0
  99. {maleo_foundation-0.2.51 → maleo_foundation-0.2.53}/maleo_foundation/models/transfers/results/service/__init__.py +0 -0
  100. {maleo_foundation-0.2.51 → maleo_foundation-0.2.53}/maleo_foundation/models/transfers/results/service/controllers/__init__.py +0 -0
  101. {maleo_foundation-0.2.51 → maleo_foundation-0.2.53}/maleo_foundation/models/transfers/results/service/controllers/rest.py +0 -0
  102. {maleo_foundation-0.2.51 → maleo_foundation-0.2.53}/maleo_foundation/models/transfers/results/signature.py +0 -0
  103. {maleo_foundation-0.2.51 → maleo_foundation-0.2.53}/maleo_foundation/models/transfers/results/token.py +0 -0
  104. {maleo_foundation-0.2.51 → maleo_foundation-0.2.53}/maleo_foundation/rest_controller_result.py +0 -0
  105. {maleo_foundation-0.2.51 → maleo_foundation-0.2.53}/maleo_foundation/types.py +0 -0
  106. {maleo_foundation-0.2.51 → maleo_foundation-0.2.53}/maleo_foundation/utils/__init__.py +0 -0
  107. {maleo_foundation-0.2.51 → maleo_foundation-0.2.53}/maleo_foundation/utils/client.py +0 -0
  108. {maleo_foundation-0.2.51 → maleo_foundation-0.2.53}/maleo_foundation/utils/controller.py +0 -0
  109. {maleo_foundation-0.2.51 → maleo_foundation-0.2.53}/maleo_foundation/utils/dependencies/__init__.py +0 -0
  110. {maleo_foundation-0.2.51 → maleo_foundation-0.2.53}/maleo_foundation/utils/dependencies/auth.py +0 -0
  111. {maleo_foundation-0.2.51 → maleo_foundation-0.2.53}/maleo_foundation/utils/exceptions.py +0 -0
  112. {maleo_foundation-0.2.51 → maleo_foundation-0.2.53}/maleo_foundation/utils/extractor.py +0 -0
  113. {maleo_foundation-0.2.51 → maleo_foundation-0.2.53}/maleo_foundation/utils/formatter/__init__.py +0 -0
  114. {maleo_foundation-0.2.51 → maleo_foundation-0.2.53}/maleo_foundation/utils/formatter/case.py +0 -0
  115. {maleo_foundation-0.2.51 → maleo_foundation-0.2.53}/maleo_foundation/utils/loaders/__init__.py +0 -0
  116. {maleo_foundation-0.2.51 → maleo_foundation-0.2.53}/maleo_foundation/utils/loaders/credential/__init__.py +0 -0
  117. {maleo_foundation-0.2.51 → maleo_foundation-0.2.53}/maleo_foundation/utils/loaders/credential/google.py +0 -0
  118. {maleo_foundation-0.2.51 → maleo_foundation-0.2.53}/maleo_foundation/utils/loaders/json.py +0 -0
  119. {maleo_foundation-0.2.51 → maleo_foundation-0.2.53}/maleo_foundation/utils/loaders/key/__init__.py +0 -0
  120. {maleo_foundation-0.2.51 → maleo_foundation-0.2.53}/maleo_foundation/utils/loaders/key/rsa.py +0 -0
  121. {maleo_foundation-0.2.51 → maleo_foundation-0.2.53}/maleo_foundation/utils/loaders/yaml.py +0 -0
  122. {maleo_foundation-0.2.51 → maleo_foundation-0.2.53}/maleo_foundation/utils/logging.py +0 -0
  123. {maleo_foundation-0.2.51 → maleo_foundation-0.2.53}/maleo_foundation/utils/mergers.py +0 -0
  124. {maleo_foundation-0.2.51 → maleo_foundation-0.2.53}/maleo_foundation/utils/query.py +0 -0
  125. {maleo_foundation-0.2.51 → maleo_foundation-0.2.53}/maleo_foundation/utils/repository.py +0 -0
  126. {maleo_foundation-0.2.51 → maleo_foundation-0.2.53}/maleo_foundation.egg-info/SOURCES.txt +0 -0
  127. {maleo_foundation-0.2.51 → maleo_foundation-0.2.53}/maleo_foundation.egg-info/dependency_links.txt +0 -0
  128. {maleo_foundation-0.2.51 → maleo_foundation-0.2.53}/maleo_foundation.egg-info/requires.txt +0 -0
  129. {maleo_foundation-0.2.51 → maleo_foundation-0.2.53}/maleo_foundation.egg-info/top_level.txt +0 -0
  130. {maleo_foundation-0.2.51 → maleo_foundation-0.2.53}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: maleo_foundation
3
- Version: 0.2.51
3
+ Version: 0.2.53
4
4
  Summary: Foundation package for Maleo
5
5
  Author-email: Agra Bima Yuda <agra@nexmedis.com>
6
6
  License: MIT
@@ -2,7 +2,6 @@ from __future__ import annotations
2
2
  from fastapi import status
3
3
  from pydantic import Field, model_validator
4
4
  from typing import Dict, Type, Union
5
- from maleo_foundation.models.schemas.general import BaseGeneralSchemas
6
5
  from maleo_foundation.models.schemas.result import BaseResultSchemas
7
6
  from maleo_foundation.types import BaseTypes
8
7
 
@@ -83,7 +82,7 @@ class BaseResponses:
83
82
  total_pages = (total_data // limit) + (1 if total_data % limit > 0 else 0)
84
83
 
85
84
  #* Assign computed pagination object before validation
86
- values["pagination"] = BaseGeneralSchemas.ExtendedPagination(
85
+ values["pagination"] = BaseResultSchemas.ExtendedPagination(
87
86
  page=page,
88
87
  limit=limit,
89
88
  data_count=len(data),
@@ -0,0 +1,34 @@
1
+ from __future__ import annotations
2
+ from pydantic import BaseModel, Field
3
+ from maleo_foundation.enums import BaseEnums
4
+ from maleo_foundation.types import BaseTypes
5
+
6
+ class BaseGeneralSchemas:
7
+ class DateFilter(BaseModel):
8
+ name:str = Field(..., description="Column name.")
9
+ from_date:BaseTypes.OptionalDatetime = Field(None, description="From date.")
10
+ to_date:BaseTypes.OptionalDatetime = Field(None, description="To date.")
11
+
12
+ class SortColumn(BaseModel):
13
+ name:str = Field(..., description="Column name.")
14
+ order:BaseEnums.SortOrder = Field(..., description="Sort order.")
15
+
16
+ class SimplePagination(BaseModel):
17
+ page:int = Field(1, ge=1, description="Page number, must be >= 1.")
18
+ limit:int = Field(10, ge=1, le=100, description="Page size, must be 1 <= limit <= 100.")
19
+
20
+ class PrivateKey(BaseModel):
21
+ private_key:str = Field(..., description="Private key in str format.")
22
+
23
+ class PublicKey(BaseModel):
24
+ public_key:str = Field(..., description="Public key in str format.")
25
+
26
+ class KeyPair(PublicKey, PrivateKey): pass
27
+
28
+ class Status(BaseModel):
29
+ status:BaseEnums.StatusType = Field(..., description="Data's status")
30
+
31
+ class RSAKeys(BaseModel):
32
+ password:str = Field(..., description="Key's password")
33
+ private:str = Field(..., description="Private key")
34
+ public:str = Field(..., description="Public key")
@@ -8,6 +8,18 @@ from maleo_foundation.types import BaseTypes
8
8
  from maleo_foundation.extended_types import ExtendedTypes
9
9
 
10
10
  class BaseParameterSchemas:
11
+ class IdentifierType(BaseModel):
12
+ identifier:BaseEnums.IdentifierTypes = Field(..., description="Data's identifier type")
13
+
14
+ class IdentifierValue(BaseModel):
15
+ value:BaseTypes.IdentifierValue = Field(..., description="Data's identifier value")
16
+
17
+ class OptionalListOfIds(BaseModel):
18
+ ids:BaseTypes.OptionalListOfIntegers = Field(None, description="Specific Ids")
19
+
20
+ class OptionalListOfUuids(BaseModel):
21
+ uuids:BaseTypes.OptionalListOfUUIDs = Field(None, description="Specific Uuids")
22
+
11
23
  class Filters(BaseModel):
12
24
  filters:BaseTypes.ListOfStrings = Field([], description="Filters for date range, e.g. 'created_at|from::<ISO_DATETIME>|to::<ISO_DATETIME>'.")
13
25
 
@@ -28,6 +40,33 @@ class BaseParameterSchemas:
28
40
  class DateFilters(BaseModel):
29
41
  date_filters:ExtendedTypes.ListOfDateFilters = Field([], description="Date filters to be applied")
30
42
 
43
+ class OptionalListOfStatuses(BaseModel):
44
+ statuses:BaseTypes.OptionalListOfStatuses = Field(None, description="Data's status")
45
+
46
+ class IsRoot(BaseModel):
47
+ is_root:BaseTypes.OptionalBoolean = Field(None, description="Whether data is root")
48
+
49
+ class IsParent(BaseModel):
50
+ is_parent:BaseTypes.OptionalBoolean = Field(None, description="Whether data is parent")
51
+
52
+ class IsChild(BaseModel):
53
+ is_child:BaseTypes.OptionalBoolean = Field(None, description="Whether data is child")
54
+
55
+ class IsLeaf(BaseModel):
56
+ is_leaf:BaseTypes.OptionalBoolean = Field(None, description="Whether data is leaf")
57
+
58
+ class OptionalListOfCodes(BaseModel):
59
+ codes:BaseTypes.OptionalListOfStrings = Field(None, description="Specific Codes")
60
+
61
+ class OptionalListOfKeys(BaseModel):
62
+ keys:BaseTypes.OptionalListOfStrings = Field(None, description="Specific Keys")
63
+
64
+ class OptionalListOfNames(BaseModel):
65
+ names:BaseTypes.OptionalListOfStrings = Field(None, description="Specific Names")
66
+
67
+ class Search(BaseModel):
68
+ search:BaseTypes.OptionalString = Field(None, description="Search string.")
69
+
31
70
  class Sorts(BaseModel):
32
71
  sorts:BaseTypes.ListOfStrings = Field(["id.asc"], description="Sorting columns in 'column_name.asc' or 'column_name.desc' format.")
33
72
 
@@ -37,4 +76,10 @@ class BaseParameterSchemas:
37
76
  return [value for value in values if SORT_COLUMN_PATTERN.match(value)]
38
77
 
39
78
  class SortColumns(BaseModel):
40
- sort_columns:ExtendedTypes.ListOfSortColumns = Field([BaseGeneralSchemas.SortColumn(name="id", order=BaseEnums.SortOrder.ASC)], description="List of columns to be sorted")
79
+ sort_columns:ExtendedTypes.ListOfSortColumns = Field([BaseGeneralSchemas.SortColumn(name="id", order=BaseEnums.SortOrder.ASC)], description="List of columns to be sorted")
80
+
81
+ class Expand(BaseModel):
82
+ expand:BaseTypes.OptionalListOfStrings = Field(None, description="Expanded field(s)")
83
+
84
+ class Data(BaseModel):
85
+ data:BaseTypes.StringToAnyDict = Field(..., description="Data")
@@ -1,5 +1,7 @@
1
1
  from pydantic import BaseModel, Field
2
+ from datetime import datetime
2
3
  from typing import Dict, Optional, Union, Any
4
+ from uuid import UUID
3
5
  from maleo_foundation.models.schemas.general import BaseGeneralSchemas
4
6
  from maleo_foundation.types import BaseTypes
5
7
 
@@ -14,6 +16,39 @@ class ResultMetadata(BaseModel):
14
16
  field_expansion:Optional[Union[str, Dict[str, FieldExpansionMetadata]]] = Field(None, description="Field expansion metadata")
15
17
 
16
18
  class BaseResultSchemas:
19
+ class Identifiers(BaseModel):
20
+ id:int = Field(..., ge=1, description="Data's ID, must be >= 1.")
21
+ uuid:UUID = Field(..., description="Data's UUID.")
22
+
23
+ class Timestamps(BaseModel):
24
+ created_at:datetime = Field(..., description="Data's created_at timestamp")
25
+ updated_at:datetime = Field(..., description="Data's updated_at timestamp")
26
+ deleted_at:BaseTypes.OptionalDatetime = Field(..., description="Data's deleted_at timestamp")
27
+ restored_at:BaseTypes.OptionalDatetime = Field(..., description="Data's restored_at timestamp")
28
+ deactivated_at:BaseTypes.OptionalDatetime = Field(..., description="Data's deactivated_at timestamp")
29
+ activated_at:datetime = Field(..., description="Data's activated_at timestamp")
30
+
31
+ class Order(BaseModel):
32
+ order:BaseTypes.OptionalInteger = Field(..., description="Data's order")
33
+
34
+ class Code(BaseModel):
35
+ code:str = Field(..., description="Data's code")
36
+
37
+ class Key(BaseModel):
38
+ key:str = Field(..., description="Data's key")
39
+
40
+ class Name(BaseModel):
41
+ name:str = Field(..., description="Data's name")
42
+
43
+ class Secret(BaseModel):
44
+ secret:UUID = Field(..., description="Data's secret")
45
+
46
+ class ExtendedPagination(BaseGeneralSchemas.SimplePagination):
47
+ data_count:int = Field(..., description="Fetched data count")
48
+ total_data:int = Field(..., description="Total data count")
49
+ total_pages:int = Field(..., description="Total pages count")
50
+
51
+ #* ----- ----- ----- Base ----- ----- ----- *#
17
52
  class Base(BaseModel):
18
53
  success:bool = Field(..., description="Success status")
19
54
  code:BaseTypes.OptionalString = Field(None, description="Optional result code")
@@ -71,4 +106,6 @@ class BaseResultSchemas:
71
106
  message:str = "Multiple paginated data found"
72
107
  description:str = "Requested paginated data found in database."
73
108
  total_data:int = Field(..., ge=0, description="Total data count")
74
- pagination:BaseGeneralSchemas.ExtendedPagination = Field(..., description="Pagination metadata")
109
+ pagination:"BaseResultSchemas.ExtendedPagination" = Field(..., description="Pagination metadata")
110
+
111
+ BaseResultSchemas.PaginatedMultipleData.model_rebuild()
@@ -8,8 +8,8 @@ from maleo_foundation.models.schemas.parameter import BaseParameterSchemas
8
8
  class BaseClientParametersTransfers:
9
9
  class GetUnpaginatedMultiple(
10
10
  BaseParameterSchemas.SortColumns,
11
- BaseGeneralSchemas.Search,
12
- BaseGeneralSchemas.Statuses,
11
+ BaseParameterSchemas.Search,
12
+ BaseParameterSchemas.OptionalListOfStatuses,
13
13
  BaseParameterSchemas.DateFilters
14
14
  ):
15
15
  pass
@@ -0,0 +1,23 @@
1
+ from __future__ import annotations
2
+ from maleo_foundation.models.schemas.general import BaseGeneralSchemas
3
+ from maleo_foundation.models.schemas.parameter import BaseParameterSchemas
4
+
5
+ class BaseGeneralParametersTransfers:
6
+ class FieldExpansionProcessor(
7
+ BaseParameterSchemas.Expand,
8
+ BaseParameterSchemas.Data
9
+ ): pass
10
+
11
+ class GetSingleQuery(BaseParameterSchemas.OptionalListOfStatuses): pass
12
+
13
+ class BaseGetSingle(
14
+ BaseParameterSchemas.IdentifierValue,
15
+ BaseParameterSchemas.IdentifierType
16
+ ): pass
17
+
18
+ class GetSingle(
19
+ BaseParameterSchemas.OptionalListOfStatuses,
20
+ BaseGetSingle
21
+ ): pass
22
+
23
+ class StatusUpdate(BaseGeneralSchemas.Status): pass
@@ -9,8 +9,8 @@ from maleo_foundation.models.schemas.parameter import BaseParameterSchemas
9
9
  class BaseServiceParametersTransfers:
10
10
  class GetUnpaginatedMultipleQuery(
11
11
  BaseParameterSchemas.Sorts,
12
- BaseGeneralSchemas.Search,
13
- BaseGeneralSchemas.Statuses,
12
+ BaseParameterSchemas.Search,
13
+ BaseParameterSchemas.OptionalListOfStatuses,
14
14
  BaseParameterSchemas.Filters
15
15
  ): pass
16
16
 
@@ -1,6 +1,5 @@
1
1
  from __future__ import annotations
2
2
  from pydantic import model_validator
3
- from maleo_foundation.models.schemas.general import BaseGeneralSchemas
4
3
  from maleo_foundation.models.schemas.result import BaseResultSchemas
5
4
 
6
5
  class BaseClientServiceResultsTransfers:
@@ -22,7 +21,7 @@ class BaseClientServiceResultsTransfers:
22
21
  pagination = values.get("pagination")
23
22
  if pagination is None:
24
23
  raise ValueError("Pagination field did not exists")
25
- pagination = BaseGeneralSchemas.ExtendedPagination.model_validate(pagination)
24
+ pagination = BaseResultSchemas.ExtendedPagination.model_validate(pagination)
26
25
  values["page"] = pagination.page
27
26
  values["limit"] = pagination.limit
28
27
  values["total_data"] = pagination.total_data
@@ -1,6 +1,5 @@
1
1
  from __future__ import annotations
2
2
  from pydantic import model_validator
3
- from maleo_foundation.models.schemas.general import BaseGeneralSchemas
4
3
  from maleo_foundation.models.schemas.result import BaseResultSchemas
5
4
 
6
5
  class BaseServiceGeneralResultsTransfers:
@@ -30,7 +29,7 @@ class BaseServiceGeneralResultsTransfers:
30
29
  total_pages = (total_data // limit) + (1 if total_data % limit > 0 else 0)
31
30
 
32
31
  #* Assign computed pagination object before validation
33
- values["pagination"] = BaseGeneralSchemas.ExtendedPagination(
32
+ values["pagination"] = BaseResultSchemas.ExtendedPagination(
34
33
  page=page,
35
34
  limit=limit,
36
35
  data_count=len(data),
@@ -1,6 +1,5 @@
1
1
  from __future__ import annotations
2
2
  from pydantic import model_validator
3
- from maleo_foundation.models.schemas.general import BaseGeneralSchemas
4
3
  from maleo_foundation.models.schemas.result import BaseResultSchemas
5
4
 
6
5
  class BaseServiceRepositoryResultsTransfers:
@@ -30,7 +29,7 @@ class BaseServiceRepositoryResultsTransfers:
30
29
  total_pages = (total_data // limit) + (1 if total_data % limit > 0 else 0)
31
30
 
32
31
  #* Assign computed pagination object before validation
33
- values["pagination"] = BaseGeneralSchemas.ExtendedPagination(
32
+ values["pagination"] = BaseResultSchemas.ExtendedPagination(
34
33
  page=page,
35
34
  limit=limit,
36
35
  data_count=len(data),
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: maleo_foundation
3
- Version: 0.2.51
3
+ Version: 0.2.53
4
4
  Summary: Foundation package for Maleo
5
5
  Author-email: Agra Bima Yuda <agra@nexmedis.com>
6
6
  License: MIT
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "maleo_foundation"
7
- version = "0.2.51"
7
+ version = "0.2.53"
8
8
  description = "Foundation package for Maleo"
9
9
  authors = [
10
10
  { name = "Agra Bima Yuda", email = "agra@nexmedis.com" }
@@ -1,104 +0,0 @@
1
- from __future__ import annotations
2
- from datetime import datetime
3
- from pydantic import BaseModel, Field
4
- from uuid import UUID
5
- from maleo_foundation.enums import BaseEnums
6
- from maleo_foundation.types import BaseTypes
7
-
8
- class BaseGeneralSchemas:
9
- class IdentifierType(BaseModel):
10
- identifier:BaseEnums.IdentifierTypes = Field(..., description="Data's identifier type")
11
-
12
- class IdentifierValue(BaseModel):
13
- value:BaseTypes.IdentifierValue = Field(..., description="Data's identifier value")
14
-
15
- class Ids(BaseModel):
16
- ids:BaseTypes.OptionalListOfIntegers = Field(None, description="Specific Ids")
17
-
18
- class Uuids(BaseModel):
19
- uuids:BaseTypes.OptionalListOfUUIDs = Field(None, description="Specific Uuids")
20
-
21
- class Codes(BaseModel):
22
- codes:BaseTypes.OptionalListOfStrings = Field(None, description="Specific Codes")
23
-
24
- class Keys(BaseModel):
25
- keys:BaseTypes.OptionalListOfStrings = Field(None, description="Specific Keys")
26
-
27
- class Names(BaseModel):
28
- names:BaseTypes.OptionalListOfStrings = Field(None, description="Specific Names")
29
-
30
- class Search(BaseModel):
31
- search:BaseTypes.OptionalString = Field(None, description="Search parameter string.")
32
-
33
- class DateFilter(BaseModel):
34
- name:str = Field(..., description="Column name.")
35
- from_date:BaseTypes.OptionalDatetime = Field(None, description="From date.")
36
- to_date:BaseTypes.OptionalDatetime = Field(None, description="To date.")
37
-
38
- class Statuses(BaseModel):
39
- statuses:BaseTypes.OptionalListOfStatuses = Field(None, description="Data's status")
40
-
41
- class SortColumn(BaseModel):
42
- name:str = Field(..., description="Column name.")
43
- order:BaseEnums.SortOrder = Field(..., description="Sort order.")
44
-
45
- class SimplePagination(BaseModel):
46
- page:int = Field(1, ge=1, description="Page number, must be >= 1.")
47
- limit:int = Field(10, ge=1, le=100, description="Page size, must be 1 <= limit <= 100.")
48
-
49
- class ExtendedPagination(SimplePagination):
50
- data_count:int = Field(..., description="Fetched data count")
51
- total_data:int = Field(..., description="Total data count")
52
- total_pages:int = Field(..., description="Total pages count")
53
-
54
- class Status(BaseModel):
55
- status:BaseEnums.StatusType = Field(..., description="Status")
56
-
57
- class Expand(BaseModel):
58
- expand:BaseTypes.OptionalListOfStrings = Field(None, description="Expanded field(s)")
59
-
60
- class PrivateKey(BaseModel):
61
- private_key:str = Field(..., description="Private key in str format.")
62
-
63
- class PublicKey(BaseModel):
64
- public_key:str = Field(..., description="Public key in str format.")
65
-
66
- class KeyPair(PublicKey, PrivateKey): pass
67
-
68
- class Identifiers(BaseModel):
69
- id:int = Field(..., ge=1, description="Data's ID, must be >= 1.")
70
- uuid:UUID = Field(..., description="Data's UUID.")
71
-
72
- class Timestamps(BaseModel):
73
- created_at:datetime = Field(..., description="Data's created_at timestamp")
74
- updated_at:datetime = Field(..., description="Data's updated_at timestamp")
75
- deleted_at:BaseTypes.OptionalDatetime = Field(..., description="Data's deleted_at timestamp")
76
- restored_at:BaseTypes.OptionalDatetime = Field(..., description="Data's restored_at timestamp")
77
- deactivated_at:BaseTypes.OptionalDatetime = Field(..., description="Data's deactivated_at timestamp")
78
- activated_at:datetime = Field(..., description="Data's activated_at timestamp")
79
-
80
- class Status(BaseModel):
81
- status:BaseEnums.StatusType = Field(..., description="Data's status")
82
-
83
- class Order(BaseModel):
84
- order:BaseTypes.OptionalInteger = Field(..., description="Data's order")
85
-
86
- class Code(BaseModel):
87
- code:str = Field(..., description="Data's code")
88
-
89
- class Key(BaseModel):
90
- key:str = Field(..., description="Data's key")
91
-
92
- class Name(BaseModel):
93
- name:str = Field(..., description="Data's name")
94
-
95
- class Secret(BaseModel):
96
- secret:UUID = Field(..., description="Data's secret")
97
-
98
- class Data(BaseModel):
99
- data:BaseTypes.StringToAnyDict = Field(..., description="Data")
100
-
101
- class RSAKeys(BaseModel):
102
- password:str = Field(..., description="Key's password")
103
- private:str = Field(..., description="Private key")
104
- public:str = Field(..., description="Public key")
@@ -1,20 +0,0 @@
1
- from __future__ import annotations
2
- from maleo_foundation.models.schemas.general import BaseGeneralSchemas
3
-
4
- class BaseGeneralParametersTransfers:
5
- class FieldExpansionProcessor(
6
- BaseGeneralSchemas.Expand,
7
- BaseGeneralSchemas.Data
8
- ): pass
9
-
10
- class GetSingleQuery(BaseGeneralSchemas.Statuses): pass
11
-
12
- class BaseGetSingle(
13
- BaseGeneralSchemas.IdentifierValue,
14
- BaseGeneralSchemas.IdentifierType
15
- ):
16
- pass
17
-
18
- class GetSingle(BaseGeneralSchemas.Statuses, BaseGetSingle): pass
19
-
20
- class StatusUpdate(BaseGeneralSchemas.Status): pass