maleo-foundation 0.3.63__py3-none-any.whl → 0.3.66__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.
@@ -79,6 +79,11 @@ class BaseResponses:
79
79
  message: str = "Forbidden Request"
80
80
  description: str = "You are forbidden from requesting this resource"
81
81
 
82
+ class NotFound(Fail):
83
+ code: str = "MAL-NTF-001"
84
+ message: str = "Resource not found"
85
+ description: str = "The requested resource can not be found."
86
+
82
87
  class MethodNotAllowed(Fail):
83
88
  code: str = "MAL-MTA-002"
84
89
  message: str = "Method Not Allowed"
@@ -108,10 +113,10 @@ class BaseResponses:
108
113
  message: str = "Not Implemented"
109
114
  description: str = "This request is not yet implemented by the system."
110
115
 
111
- class NotFound(Fail):
112
- code: str = "MAL-NTF-001"
113
- message: str = "Resource not found"
114
- description: str = "The requested resource can not be found."
116
+ class Unavailable(Fail):
117
+ code: str = "MAL-UNV-001"
118
+ message: str = "Unavailable"
119
+ description: str = "The service is unavailable to process the request."
115
120
 
116
121
  class NoData(Success):
117
122
  code: str = "MAL-NDT-001"
@@ -211,6 +216,10 @@ class BaseResponses:
211
216
  },
212
217
  status.HTTP_501_NOT_IMPLEMENTED: {
213
218
  "description": "Not Implemented Response",
214
- "model": ServerError,
219
+ "model": NotImplemented,
220
+ },
221
+ status.HTTP_503_SERVICE_UNAVAILABLE: {
222
+ "description": "Service Unavailable Response",
223
+ "model": Unavailable,
215
224
  },
216
225
  }
@@ -11,6 +11,7 @@ from .cache import CacheConfigurations
11
11
  from .client import ClientConfigurations
12
12
  from .database import DatabaseConfigurations
13
13
  from .middleware import MiddlewareConfigurations
14
+ from .pubsub import PubSubConfigurations
14
15
  from .service import ServiceConfigurations
15
16
 
16
17
 
@@ -25,6 +26,7 @@ class Configurations(BaseModel):
25
26
  middleware: MiddlewareConfigurations = Field(
26
27
  ..., description="Middleware's configurations"
27
28
  )
29
+ pubsub: PubSubConfigurations = Field(..., description="PubSub's configurations")
28
30
  service: ServiceConfigurations = Field(..., description="Service's configurations")
29
31
 
30
32
 
@@ -0,0 +1,15 @@
1
+ from pydantic import BaseModel, ConfigDict, Field
2
+ from maleo_foundation.types import BaseTypes
3
+ from .publisher import PublisherConfigurations
4
+
5
+
6
+ class PubSubConfigurations(BaseModel):
7
+ model_config = ConfigDict(arbitrary_types_allowed=True)
8
+
9
+ publisher: PublisherConfigurations = Field(
10
+ default_factory=PublisherConfigurations,
11
+ description="Publisher's configurations",
12
+ )
13
+ subscriptions: BaseTypes.OptionalListOfStrings = Field(
14
+ None, description="Subscriptions"
15
+ )
@@ -0,0 +1,38 @@
1
+ from pydantic import BaseModel, ConfigDict, Field
2
+ from typing import Optional
3
+
4
+
5
+ class TopicConfigurations(BaseModel):
6
+ id: str = Field(..., description="Topic's id")
7
+
8
+
9
+ DEFAULT_DATABASE_ACCESS_TOPIC_CONFIGURATIONS = TopicConfigurations(id="database-access")
10
+
11
+ DEFAULT_DATABASE_AUDIT_TOPIC_CONFIGURATIONS = TopicConfigurations(id="database-audit")
12
+
13
+ DEFAULT_OPERATION_TOPIC_CONFIGURATIONS = TopicConfigurations(id="operation")
14
+
15
+
16
+ class TopicsConfigurations(BaseModel):
17
+ model_config = ConfigDict(arbitrary_types_allowed=True)
18
+
19
+ database_access: Optional[TopicConfigurations] = Field(
20
+ default=DEFAULT_DATABASE_ACCESS_TOPIC_CONFIGURATIONS,
21
+ description="Database access topic configurations",
22
+ )
23
+ database_audit: Optional[TopicConfigurations] = Field(
24
+ default=DEFAULT_DATABASE_AUDIT_TOPIC_CONFIGURATIONS,
25
+ description="Database audit topic configurations",
26
+ )
27
+ operation: Optional[TopicConfigurations] = Field(
28
+ default=DEFAULT_OPERATION_TOPIC_CONFIGURATIONS,
29
+ description="Operation topic configurations",
30
+ )
31
+
32
+
33
+ class PublisherConfigurations(BaseModel):
34
+ model_config = ConfigDict(arbitrary_types_allowed=True)
35
+
36
+ topics: TopicsConfigurations = Field(
37
+ default_factory=TopicsConfigurations, description="Topics configurations"
38
+ )
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: maleo_foundation
3
- Version: 0.3.63
3
+ Version: 0.3.66
4
4
  Summary: Foundation package for Maleo
5
5
  Author-email: Agra Bima Yuda <agra@nexmedis.com>
6
6
  License: MIT
@@ -50,7 +50,7 @@ maleo_foundation/middlewares/authentication.py,sha256=b4dPkLKFqJBmhWKEvynTLe45Wa
50
50
  maleo_foundation/middlewares/base.py,sha256=ZXMJTiuDBa6sIbgD_g1MhhlMkszsYkt3Ocl4boPtbEU,16825
51
51
  maleo_foundation/middlewares/cors.py,sha256=1QgRXOcURuEhBYMerclqbECgtAE4CFo0EhB4gJXu8Yg,2294
52
52
  maleo_foundation/models/__init__.py,sha256=OlZXaeOhGXz_FppPm87jIOItnr-r179QhIcOWDOORyQ,248
53
- maleo_foundation/models/responses.py,sha256=Tg--iTXwA0zHhd991mJiHIrBbqEW8QYC-pCM5yboIzI,8489
53
+ maleo_foundation/models/responses.py,sha256=WNAz67ewOyWV0oHyiB_BF_-sfaoDF-FVzcwg4AulH1g,8824
54
54
  maleo_foundation/models/table.py,sha256=k0-OtahF2KRmvFUL8TborT6PoIhGsyoVrPJBKGg1QbU,1855
55
55
  maleo_foundation/models/schemas/__init__.py,sha256=tmjBCyG4uMRjiTbnbhIjZaR8q7zk0_J_CqnRzsSfoBQ,279
56
56
  maleo_foundation/models/schemas/encryption.py,sha256=S86FGlcBhyGxxZ5ObNSHTjSDwBUlUtLOMoCAKd5wE34,687
@@ -71,7 +71,7 @@ maleo_foundation/models/transfers/general/request.py,sha256=W2aKxo0lQ-kV-4XpQEzx
71
71
  maleo_foundation/models/transfers/general/settings.py,sha256=1QkPq6GP33S5R718be3XBz0BCtApAuxlL-x21EZ2Xmo,1609
72
72
  maleo_foundation/models/transfers/general/signature.py,sha256=TCTIy928EeBBeFLlyQ3_NozpR9FUcWXPQKIYIwyj66k,308
73
73
  maleo_foundation/models/transfers/general/token.py,sha256=aF7IXEYS4EnWtWquZexnrXcJBOl5M1lneo7yu7IiKYg,5022
74
- maleo_foundation/models/transfers/general/configurations/__init__.py,sha256=hrhVflh3coOvqGrxMZKkX5XDxYAbxjxnsGwJjJqV86s,1540
74
+ maleo_foundation/models/transfers/general/configurations/__init__.py,sha256=JG910HvVlFvE406Jku0fdOVYUHjedIsflyqCPafXF_Y,1666
75
75
  maleo_foundation/models/transfers/general/configurations/database.py,sha256=4j465vki3bCNGogrJLmMmF1uEXc-sUfyhwMeuaR5JyM,706
76
76
  maleo_foundation/models/transfers/general/configurations/middleware.py,sha256=gBm7yv-PYOPcv-u6SXq8cMWfuuo9LwPSXuqoJ4uw9h0,1761
77
77
  maleo_foundation/models/transfers/general/configurations/service.py,sha256=1sDBwJYvO7tlKz9YH7eIkfMPWmUqRkx7aW-EMw8tpBQ,306
@@ -79,6 +79,8 @@ maleo_foundation/models/transfers/general/configurations/cache/__init__.py,sha25
79
79
  maleo_foundation/models/transfers/general/configurations/cache/redis.py,sha256=SNnI7hm8giKfR2Kp5sD_fmxo4Q5fkRCdi9zMKwTKPCs,1331
80
80
  maleo_foundation/models/transfers/general/configurations/client/__init__.py,sha256=1w17i9CH4bSQ40o8rwIew2F_id25XklFqI1YPowcHvQ,356
81
81
  maleo_foundation/models/transfers/general/configurations/client/maleo.py,sha256=0Hk6no800DdaAlv0SZ1OqVGxbp4LtJz1cJ0ZNbBejK4,2063
82
+ maleo_foundation/models/transfers/general/configurations/pubsub/__init__.py,sha256=BJqB2lxd7iFbm__3VKWPclE6ub_FMIVbhaO7yc2KzSU,505
83
+ maleo_foundation/models/transfers/general/configurations/pubsub/publisher.py,sha256=wNKXZ1DhewlaeaxcjjwOFh_bRxNdkLycGf7bHKEgHFw,1306
82
84
  maleo_foundation/models/transfers/parameters/__init__.py,sha256=HiV7hPn8rUaN7XeOwC_VugYQ4QQO7kbZ0fsp11GDznQ,355
83
85
  maleo_foundation/models/transfers/parameters/client.py,sha256=2V1XvhSmIDDZL7MFVpD_dR5jWIoydQnFW67n9z6rRMA,4041
84
86
  maleo_foundation/models/transfers/parameters/general.py,sha256=NUFsrrfByN9OX9QLYc2Bn0LpNPoxrKBuZae-IVhOiyo,791
@@ -135,7 +137,7 @@ maleo_foundation/utils/loaders/credential/__init__.py,sha256=g-cAxkTE2EtHaG8Tv52
135
137
  maleo_foundation/utils/loaders/credential/google.py,sha256=GCJl-bsKSSxoE_ERAkIzRrRNIbIEeqYOhHwzFuBr0mk,6576
136
138
  maleo_foundation/utils/loaders/key/__init__.py,sha256=RfqIbUxkdlx1xrbzJZPD_JHiRFNFLRuQs8JoUPCGCv4,108
137
139
  maleo_foundation/utils/loaders/key/rsa.py,sha256=UXcP0rr4QVacTsHLNQuU05wcow5CHWz-JW-zsVxlbPs,4121
138
- maleo_foundation-0.3.63.dist-info/METADATA,sha256=cuAYgkv4CW6UM7ysSToHwYHXchcEiWLLQr-zoJ9gu0c,4150
139
- maleo_foundation-0.3.63.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
140
- maleo_foundation-0.3.63.dist-info/top_level.txt,sha256=_iBos3F_bhEOdjOnzeiEYSrCucasc810xXtLBXI8cQc,17
141
- maleo_foundation-0.3.63.dist-info/RECORD,,
140
+ maleo_foundation-0.3.66.dist-info/METADATA,sha256=4NJIYuPP7pJbPrmI04VLqpmE0SGH9WloO9RjQlbNYkc,4150
141
+ maleo_foundation-0.3.66.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
142
+ maleo_foundation-0.3.66.dist-info/top_level.txt,sha256=_iBos3F_bhEOdjOnzeiEYSrCucasc810xXtLBXI8cQc,17
143
+ maleo_foundation-0.3.66.dist-info/RECORD,,