1
1
# Liberty API
2
2
3
- ** Description:** API For Liberty Framework
3
+ ** Description:**
4
+ ** Liberty API** provides a powerful and scalable backend for managing authentication,
5
+ database operations, and framework functionalities in the ** Liberty Framework** .
6
+
7
+ ### 🔹 Key Features:
8
+ - ** Authentication & Authorization** : Secure endpoints with JWT tokens and OAuth2.
9
+ - ** Database Management** : Query, insert, update, and delete records across multiple pools.
10
+ - ** Framework Controls** : Manage modules, applications, themes, and logs.
11
+ - ** Security & Encryption** : Encrypt data and ensure safe database access.
12
+ - ** Logging & Auditing** : Retrieve and analyze logs for security and debugging.
13
+
14
+ ### 🔹 Authentication
15
+ - ** ` /api/auth/token ` ** - Generate a JWT token for authentication.
16
+ - ** ` /api/auth/user ` ** - Retrieve authenticated user details.
17
+
18
+ ### 🔹 Database Operations
19
+ - ** ` /api/db/check ` ** - Validate database connection.
20
+ - ** ` /api/db/query ` ** - Retrieve, insert, update, or delete records.
21
+ - ** ` /api/db/audit/{table}/{user} ` ** - Audit changes on a specific table.
22
+
23
+ ### 🔹 Framework Features
24
+ - ** ` /api/fmw/modules ` ** - Retrieve framework modules.
25
+ - ** ` /api/fmw/applications ` ** - Retrieve available applications.
26
+ - ** ` /api/fmw/themes ` ** - Manage application themes.
27
+
28
+ ** 🔗 Explore the API using Swagger UI (` /api/test ` ) or Redoc (` /api ` ).**
29
+
4
30
5
31
** Version:** 1.0.0
6
32
@@ -43,32 +69,8 @@ Retrieve user information.
43
69
"status": "success"
44
70
}
45
71
```
46
- ??? warning "Response ` 422 ` : Validation Error "
72
+ ??? warning "Response ` 422 ` : Unprocessable Entity "
47
73
- ** Content-Type:** ` application/json `
48
- - ** Example:**
49
-
50
- ```json
51
- {
52
- "detail": [
53
- {
54
- "loc": [
55
- "query",
56
- "name"
57
- ],
58
- "msg": "field required",
59
- "type": "value_error.missing"
60
- },
61
- {
62
- "loc": [
63
- "query",
64
- "quantity"
65
- ],
66
- "msg": "value is not a valid integer",
67
- "type": "type_error.integer"
68
- }
69
- ]
70
- }
71
- ```
72
74
??? danger "Response ` 500 ` : Internal server error"
73
75
- ** Content-Type:** ` application/json `
74
76
- ** Example:**
@@ -98,7 +100,29 @@ Generate a JWT token for the user.
98
100
99
101
```json
100
102
{
101
- "$ref": "#/components/schemas/LoginRequest"
103
+ "properties": {
104
+ "user": {
105
+ "type": "string",
106
+ "title": "User"
107
+ },
108
+ "password": {
109
+ "anyOf": [
110
+ {
111
+ "type": "string"
112
+ },
113
+ {
114
+ "type": "null"
115
+ }
116
+ ],
117
+ "title": "Password"
118
+ }
119
+ },
120
+ "type": "object",
121
+ "required": [
122
+ "user",
123
+ "password"
124
+ ],
125
+ "title": "LoginRequest"
102
126
}
103
127
```
104
128
** 📥 Responses:**
@@ -620,7 +644,7 @@ Performs a basic check to ensure the database connection is functional. Returns
620
644
"rows": [
621
645
{
622
646
"ROW_ID": 1,
623
- "CURRENT_TIME ": "2025-01-27T08:14:13.809494+00:00"
647
+ "CURRENT_DATE ": "2025-01-27T08:14:13.809494+00:00"
624
648
}
625
649
],
626
650
"rowCount": 1,
@@ -630,7 +654,7 @@ Performs a basic check to ensure the database connection is functional. Returns
630
654
"type": "int"
631
655
},
632
656
{
633
- "name": "CURRENT_TIME ",
657
+ "name": "CURRENT_DATE ",
634
658
"type": "datetime"
635
659
}
636
660
]
@@ -927,10 +951,75 @@ Audit user actions on a table.
927
951
- ** ` user ` ** * (in path)* : No description (** Required** )
928
952
** 📥 Responses:**
929
953
930
- ??? success "Response ` 200 ` : Successful Response "
954
+ ??? success "Response ` 200 ` : Data inserted/updated successfully "
931
955
- ** Content-Type:** ` application/json `
956
+ - ** Example:**
957
+
958
+ ```json
959
+ {
960
+ "items": [],
961
+ "status": "success",
962
+ "count": 0
963
+ }
964
+ ```
965
+ ??? warning "Response ` 400 ` : Bad Request"
966
+ - ** Content-Type:** ` application/json `
967
+ - ** Example:**
968
+
969
+ ```json
970
+ {
971
+ "status": "failed",
972
+ "message": "Request body cannot be empty. JSON object with key-value pairs is required."
973
+ }
974
+ ```
932
975
??? warning "Response ` 422 ` : Validation Error"
933
976
- ** Content-Type:** ` application/json `
977
+ - ** Example:**
978
+
979
+ ```json
980
+ {
981
+ "detail": [
982
+ {
983
+ "loc": [
984
+ "query",
985
+ "name"
986
+ ],
987
+ "msg": "field required",
988
+ "type": "value_error.missing"
989
+ },
990
+ {
991
+ "loc": [
992
+ "query",
993
+ "quantity"
994
+ ],
995
+ "msg": "value is not a valid integer",
996
+ "type": "type_error.integer"
997
+ }
998
+ ]
999
+ }
1000
+ ```
1001
+ ??? danger "Response ` 500 ` : Internal server error"
1002
+ - ** Content-Type:** ` application/json `
1003
+ - ** Example:**
1004
+
1005
+ ```json
1006
+ {
1007
+ "status": "failed",
1008
+ "message": {
1009
+ "items": [
1010
+ {
1011
+ "message": "Error: Query execution failed: Query execution failed: INSERT INTO...",
1012
+ "line": {
1013
+ "field1": "<string>",
1014
+ "field2": "<string>"
1015
+ }
1016
+ }
1017
+ ],
1018
+ "status": "error",
1019
+ "count": 0
1020
+ }
1021
+ }
1022
+ ```
934
1023
935
1024
---
936
1025
0 commit comments