Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1,178 changes: 0 additions & 1,178 deletions config.json

This file was deleted.

6 changes: 5 additions & 1 deletion src/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,11 @@ async def add_request_id(request: Request, call_next: Callable):
# Optional HTTP Bearer security for Swagger Authorize
http_bearer = HTTPBearer(auto_error=False)

config = load_config("config.json")
# Load configuration from organized structure
config_dir = os.path.join(os.path.dirname(__file__), "config")
logger.info(f"Loading config from: {config_dir}")
config = load_config(config_dir)
logger.info(f"Loaded {len(config)} endpoint(s)")

for endpoint_path, functions in config.items():
logger.debug(f"Processing endpoint: {endpoint_path}")
Expand Down
92 changes: 92 additions & 0 deletions src/config/_login_token-php/Authentication/auth.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
{
"method": "GET",
"description": "Get Moodle token for API calls.",
"query_params": [
{
"name": "username",
"type": "str",
"required": true,
"description": "Moodle instance username"
},
{
"name": "password",
"type": "str",
"required": true,
"description": "Moodle instance password"
},
{
"name": "service",
"type": "str",
"required": false,
"default": "moodle_mobile_app",
"description": "Web service name"
}
],
"responses": {
"200": {
"description": "Token response",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"token": {
"type": "string"
},
"privatetoken": {
"type": "string"
}
}
},
"example": {
"token": "abcdef1234567890",
"privatetoken": "abcdef1234567890_priv"
}
}
}
},
"422": {
"description": "Invalid Credentials",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"error": {
"type": "string"
},
"errorcode": {
"type": "string"
},
"stacktrace": {
"type": [
"string",
"null"
]
},
"debuginfo": {
"type": [
"string",
"null"
]
},
"reproductionlink": {
"type": [
"string",
"null"
]
}
}
},
"example": {
"error": "Invalid login",
"errorcode": "invalidlogin",
"stacktrace": null,
"debuginfo": null,
"reproductionlink": null
}
}
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"method": "GET",
"description": "Get assignments from specified courses",
"query_params": [
{
"name": "courseids",
"type": "list",
"required": true,
"description": "List of course IDs"
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"method": "GET",
"description": "Get assignment submission status",
"query_params": [
{
"name": "assignid",
"type": "int",
"required": true,
"description": "Assignment ID"
},
{
"name": "userid",
"type": "int",
"required": false,
"description": "User ID (optional)"
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"method": "GET",
"description": "Get assignment submissions",
"query_params": [
{
"name": "assignmentids",
"type": "list",
"required": true,
"description": "Assignment IDs"
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
{
"method": "GET",
"description": "Get action events (assignments, quizzes) by course",
"query_params": [
{
"name": "courseid",
"type": "int",
"required": true,
"description": "Course ID"
},
{
"name": "timesortfrom",
"type": "int",
"required": false,
"description": "Time sort from (timestamp)"
},
{
"name": "timesortto",
"type": "int",
"required": false,
"description": "Time sort to (timestamp)"
},
{
"name": "aftereventid",
"type": "int",
"required": false,
"description": "After event ID"
},
{
"name": "limitnum",
"type": "int",
"required": false,
"default": 20,
"description": "Number of events to return"
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"method": "GET",
"description": "Get calendar events",
"query_params": [
{
"name": "courseid",
"type": "int",
"required": false,
"description": "Course ID (optional)"
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,148 @@
{
"method": "GET",
"description": "Get Moodle site information & user information",
"query_params": [],
"responses": {
"200": {
"description": "Site and user information",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"sitename": {
"type": "string"
},
"username": {
"type": "string"
},
"firstname": {
"type": "string"
},
"lastname": {
"type": "string"
},
"fullname": {
"type": "string"
},
"lang": {
"type": "string"
},
"userid": {
"type": "integer"
},
"siteurl": {
"type": "string"
},
"userpictureurl": {
"type": "string"
},
"usercanmanageownfiles": {
"type": "boolean"
},
"userquota": {
"type": "integer"
},
"usermaxuploadfilesize": {
"type": "integer"
},
"userhomepage": {
"type": "integer"
},
"userprivateaccesskey": {
"type": "string"
},
"siteid": {
"type": "integer"
},
"sitecalendartype": {
"type": "string"
},
"usercalendartype": {
"type": "string"
},
"userissiteadmin": {
"type": "boolean"
},
"theme": {
"type": "string"
},
"limitconcurrentlogins": {
"type": "integer"
},
"policyagreed": {
"type": "integer"
}
}
},
"example": {
"sitename": "School XYZ",
"username": "jdoe",
"firstname": "John",
"lastname": "Doe",
"fullname": "John Doe",
"lang": "en",
"userid": 42,
"siteurl": "https://moodle.example.com",
"userpictureurl": "https://moodle.example.com/theme/image.php/boost/core/1690000000/u/f1",
"usercanmanageownfiles": true,
"userquota": 104857600,
"usermaxuploadfilesize": 10485760,
"userhomepage": 0,
"userprivateaccesskey": "abcdef1234567890key",
"siteid": 1,
"sitecalendartype": "gregorian",
"usercalendartype": "gregorian",
"userissiteadmin": false,
"theme": "boost",
"limitconcurrentlogins": 1,
"policyagreed": 1
}
}
}
},
"422": {
"description": "Invalid Request",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"error": {
"type": "string"
},
"errorcode": {
"type": "string"
},
"stacktrace": {
"type": [
"string",
"null"
]
},
"debuginfo": {
"type": [
"string",
"null"
]
},
"reproductionlink": {
"type": [
"string",
"null"
]
}
}
},
"example": {
"error": "Invalid parameter value detected",
"errorcode": "invalidparameter",
"stacktrace": null,
"debuginfo": null,
"reproductionlink": null
}
}
}
}
}
}
Loading
Loading