- Created documentation for FunctionsCreatePostRequest and FunctionsDeletePostRequest. - Added Log and LogContentInner models with corresponding documentation. - Introduced LoggerIdFindAllPostRequest and LoggingApi for log management. - Added Migration and Project models with their respective documentation. - Implemented ProjectCreatePutRequest and ProjectManagementApi for project management. - Created Query and QueryCreatePostRequest models with documentation. - Added RedisNode and RedisNodeCreatePostRequest for Redis management. - Included Token model for API token management. - Added a script for git push operations and updated index.ts for API exports.
1342 lines
34 KiB
YAML
1342 lines
34 KiB
YAML
openapi: 3.0.3
|
|
info:
|
|
title: Low-Code Engine API
|
|
description: API documentation for the Low-Code Engine platform that provides query execution, database management, and project administration capabilities.
|
|
version: 1.0.0
|
|
contact:
|
|
name: Low-Code Engine Team
|
|
servers:
|
|
- url: http://localhost:3000
|
|
description: Development server
|
|
security:
|
|
- ApiKeyAuth: []
|
|
paths:
|
|
# API Controller
|
|
/api/token/generate:
|
|
post:
|
|
tags:
|
|
- API Tokens
|
|
summary: Generate API token
|
|
description: Generate a new API token for a project
|
|
security:
|
|
- ApiKeyAuth: []
|
|
- AdminAuth: []
|
|
requestBody:
|
|
required: true
|
|
content:
|
|
application/json:
|
|
schema:
|
|
type: object
|
|
required:
|
|
- id
|
|
properties:
|
|
id:
|
|
type: string
|
|
description: Project ID
|
|
responses:
|
|
"200":
|
|
description: Token generated successfully
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: "#/components/schemas/Token"
|
|
"400":
|
|
description: Project ID is required
|
|
"401":
|
|
description: Unauthorized
|
|
"403":
|
|
description: Admin access required
|
|
|
|
/api/token/revoke/{token}:
|
|
delete:
|
|
tags:
|
|
- API Tokens
|
|
summary: Revoke API token
|
|
description: Revoke an existing API token
|
|
security:
|
|
- ApiKeyAuth: []
|
|
- AdminAuth: []
|
|
parameters:
|
|
- name: token
|
|
in: path
|
|
required: true
|
|
schema:
|
|
type: string
|
|
description: Token to revoke
|
|
responses:
|
|
"200":
|
|
description: Token revoked successfully
|
|
"401":
|
|
description: Unauthorized
|
|
"403":
|
|
description: Admin access required
|
|
"404":
|
|
description: Token not found
|
|
|
|
# Database Manager Controller
|
|
/database/create:
|
|
post:
|
|
tags:
|
|
- Database Management
|
|
summary: Create database
|
|
description: Create a new database for a project
|
|
security:
|
|
- ApiKeyAuth: []
|
|
- AdminAuth: []
|
|
requestBody:
|
|
required: true
|
|
content:
|
|
application/json:
|
|
schema:
|
|
type: object
|
|
required:
|
|
- projectId
|
|
properties:
|
|
projectId:
|
|
type: string
|
|
description: Project ID
|
|
responses:
|
|
"200":
|
|
description: Database created successfully
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: "#/components/schemas/Database"
|
|
"401":
|
|
description: Unauthorized
|
|
"403":
|
|
description: Admin access required
|
|
|
|
/database/node/create:
|
|
post:
|
|
tags:
|
|
- Database Management
|
|
summary: Add database node
|
|
description: Add a new database node to the system
|
|
security:
|
|
- ApiKeyAuth: []
|
|
- AdminAuth: []
|
|
requestBody:
|
|
required: true
|
|
content:
|
|
application/json:
|
|
schema:
|
|
type: object
|
|
required:
|
|
- host
|
|
- port
|
|
- username
|
|
- password
|
|
properties:
|
|
host:
|
|
type: string
|
|
description: Database host
|
|
port:
|
|
type: integer
|
|
description: Database port
|
|
username:
|
|
type: string
|
|
description: Database username
|
|
password:
|
|
type: string
|
|
description: Database password
|
|
responses:
|
|
"200":
|
|
description: Database node created successfully
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: "#/components/schemas/DatabaseNode"
|
|
"401":
|
|
description: Unauthorized
|
|
"403":
|
|
description: Admin access required
|
|
|
|
/database/tables/{databaseId}:
|
|
get:
|
|
tags:
|
|
- Database Management
|
|
summary: Get database tables
|
|
description: Retrieve list of tables in a database
|
|
security:
|
|
- ApiKeyAuth: []
|
|
parameters:
|
|
- name: databaseId
|
|
in: path
|
|
required: true
|
|
schema:
|
|
type: string
|
|
description: Database ID
|
|
responses:
|
|
"200":
|
|
description: Tables retrieved successfully
|
|
content:
|
|
application/json:
|
|
schema:
|
|
type: array
|
|
items:
|
|
type: string
|
|
"401":
|
|
description: Unauthorized
|
|
"404":
|
|
description: Database not found
|
|
|
|
/database/columns/{databaseId}/{tableName}:
|
|
get:
|
|
tags:
|
|
- Database Management
|
|
summary: Get table columns
|
|
description: Retrieve columns information for a specific table
|
|
security:
|
|
- ApiKeyAuth: []
|
|
parameters:
|
|
- name: databaseId
|
|
in: path
|
|
required: true
|
|
schema:
|
|
type: string
|
|
description: Database ID
|
|
- name: tableName
|
|
in: path
|
|
required: true
|
|
schema:
|
|
type: string
|
|
description: Table name
|
|
responses:
|
|
"200":
|
|
description: Columns retrieved successfully
|
|
content:
|
|
application/json:
|
|
schema:
|
|
type: array
|
|
items:
|
|
type: object
|
|
"401":
|
|
description: Unauthorized
|
|
"404":
|
|
description: Database or table not found
|
|
|
|
/database/migration/up/{databaseId}:
|
|
get:
|
|
tags:
|
|
- Database Management
|
|
summary: Run migrations up
|
|
description: Execute pending database migrations
|
|
security:
|
|
- ApiKeyAuth: []
|
|
parameters:
|
|
- name: databaseId
|
|
in: path
|
|
required: true
|
|
schema:
|
|
type: string
|
|
description: Database ID
|
|
responses:
|
|
"200":
|
|
description: Migrations executed successfully
|
|
"401":
|
|
description: Unauthorized
|
|
"404":
|
|
description: Database not found
|
|
|
|
/database/migration/down/{databaseId}:
|
|
get:
|
|
tags:
|
|
- Database Management
|
|
summary: Run migrations down
|
|
description: Rollback database migrations
|
|
security:
|
|
- ApiKeyAuth: []
|
|
parameters:
|
|
- name: databaseId
|
|
in: path
|
|
required: true
|
|
schema:
|
|
type: string
|
|
description: Database ID
|
|
responses:
|
|
"200":
|
|
description: Migrations rolled back successfully
|
|
"401":
|
|
description: Unauthorized
|
|
"404":
|
|
description: Database not found
|
|
|
|
/database/migration/create:
|
|
post:
|
|
tags:
|
|
- Database Management
|
|
summary: Create migration
|
|
description: Create a new database migration
|
|
security:
|
|
- ApiKeyAuth: []
|
|
requestBody:
|
|
required: true
|
|
content:
|
|
application/json:
|
|
schema:
|
|
type: object
|
|
required:
|
|
- up
|
|
- down
|
|
- databaseId
|
|
properties:
|
|
up:
|
|
type: string
|
|
description: Migration up SQL
|
|
down:
|
|
type: string
|
|
description: Migration down SQL
|
|
databaseId:
|
|
type: string
|
|
description: Database ID
|
|
responses:
|
|
"200":
|
|
description: Migration created successfully
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: "#/components/schemas/Migration"
|
|
"401":
|
|
description: Unauthorized
|
|
|
|
/database/query/{databaseId}:
|
|
post:
|
|
tags:
|
|
- Database Management
|
|
summary: Run database query
|
|
description: Execute a SQL query on the database
|
|
security:
|
|
- ApiKeyAuth: []
|
|
parameters:
|
|
- name: databaseId
|
|
in: path
|
|
required: true
|
|
schema:
|
|
type: string
|
|
description: Database ID
|
|
requestBody:
|
|
required: true
|
|
content:
|
|
application/json:
|
|
schema:
|
|
type: object
|
|
required:
|
|
- query
|
|
properties:
|
|
query:
|
|
type: string
|
|
description: SQL query to execute
|
|
responses:
|
|
"200":
|
|
description: Query executed successfully
|
|
content:
|
|
application/json:
|
|
schema:
|
|
type: object
|
|
"401":
|
|
description: Unauthorized
|
|
"404":
|
|
description: Database not found
|
|
|
|
# Project Controller
|
|
/project/create:
|
|
put:
|
|
tags:
|
|
- Project Management
|
|
summary: Create project
|
|
description: Create a new project with database
|
|
security:
|
|
- ApiKeyAuth: []
|
|
requestBody:
|
|
required: true
|
|
content:
|
|
application/json:
|
|
schema:
|
|
type: object
|
|
required:
|
|
- name
|
|
properties:
|
|
name:
|
|
type: string
|
|
description: Project name
|
|
responses:
|
|
"200":
|
|
description: Project created successfully
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: "#/components/schemas/Project"
|
|
"401":
|
|
description: Unauthorized
|
|
|
|
/project/create-without-db:
|
|
put:
|
|
tags:
|
|
- Project Management
|
|
summary: Create project without database
|
|
description: Create a new project without creating a database
|
|
security:
|
|
- ApiKeyAuth: []
|
|
- AdminAuth: []
|
|
requestBody:
|
|
required: true
|
|
content:
|
|
application/json:
|
|
schema:
|
|
type: object
|
|
required:
|
|
- name
|
|
properties:
|
|
name:
|
|
type: string
|
|
description: Project name
|
|
responses:
|
|
"200":
|
|
description: Project created successfully
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: "#/components/schemas/Project"
|
|
"401":
|
|
description: Unauthorized
|
|
"403":
|
|
description: Admin access required
|
|
|
|
/project/settings/create:
|
|
put:
|
|
tags:
|
|
- Project Management
|
|
summary: Create project setting
|
|
description: Create a new project setting
|
|
security:
|
|
- ApiKeyAuth: []
|
|
requestBody:
|
|
required: true
|
|
content:
|
|
application/json:
|
|
schema:
|
|
type: object
|
|
required:
|
|
- key
|
|
- value
|
|
properties:
|
|
key:
|
|
type: string
|
|
description: Setting key
|
|
value:
|
|
type: string
|
|
description: Setting value
|
|
responses:
|
|
"200":
|
|
description: Setting created successfully
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: "#/components/schemas/ProjectSetting"
|
|
"401":
|
|
description: Unauthorized
|
|
|
|
/project/settings/delete/{key}:
|
|
delete:
|
|
tags:
|
|
- Project Management
|
|
summary: Delete project setting
|
|
description: Delete a project setting by key
|
|
security:
|
|
- ApiKeyAuth: []
|
|
parameters:
|
|
- name: key
|
|
in: path
|
|
required: true
|
|
schema:
|
|
type: string
|
|
description: Setting key to delete
|
|
responses:
|
|
"200":
|
|
description: Setting deleted successfully
|
|
"401":
|
|
description: Unauthorized
|
|
"404":
|
|
description: Setting not found
|
|
|
|
/project/settings:
|
|
get:
|
|
tags:
|
|
- Project Management
|
|
summary: Get all project settings
|
|
description: Retrieve all settings for the current project
|
|
security:
|
|
- ApiKeyAuth: []
|
|
responses:
|
|
"200":
|
|
description: Settings retrieved successfully
|
|
content:
|
|
application/json:
|
|
schema:
|
|
type: array
|
|
items:
|
|
$ref: "#/components/schemas/ProjectSetting"
|
|
"401":
|
|
description: Unauthorized
|
|
|
|
/project/api-tokens:
|
|
get:
|
|
tags:
|
|
- Project Management
|
|
summary: Get all API tokens
|
|
description: Retrieve all API tokens for the current project
|
|
security:
|
|
- ApiKeyAuth: []
|
|
- AdminAuth: []
|
|
responses:
|
|
"200":
|
|
description: API tokens retrieved successfully
|
|
content:
|
|
application/json:
|
|
schema:
|
|
type: array
|
|
items:
|
|
$ref: "#/components/schemas/Token"
|
|
"401":
|
|
description: Unauthorized
|
|
"403":
|
|
description: Admin access required
|
|
|
|
# Redis Manager Controller
|
|
/redis/node/create:
|
|
post:
|
|
tags:
|
|
- Redis Management
|
|
summary: Add Redis node
|
|
description: Add a new Redis node to the system
|
|
security:
|
|
- ApiKeyAuth: []
|
|
- AdminAuth: []
|
|
requestBody:
|
|
required: true
|
|
content:
|
|
application/json:
|
|
schema:
|
|
type: object
|
|
required:
|
|
- host
|
|
- port
|
|
- user
|
|
- password
|
|
properties:
|
|
host:
|
|
type: string
|
|
description: Redis host
|
|
port:
|
|
type: integer
|
|
description: Redis port
|
|
user:
|
|
type: string
|
|
description: Redis username
|
|
password:
|
|
type: string
|
|
description: Redis password
|
|
responses:
|
|
"200":
|
|
description: Redis node created successfully
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: "#/components/schemas/RedisNode"
|
|
"401":
|
|
description: Unauthorized
|
|
"403":
|
|
description: Admin access required
|
|
|
|
# Function Controller
|
|
/functions/create:
|
|
post:
|
|
tags:
|
|
- Functions
|
|
summary: Create function
|
|
description: Create a new function in the project
|
|
security:
|
|
- ApiKeyAuth: []
|
|
requestBody:
|
|
required: true
|
|
content:
|
|
application/json:
|
|
schema:
|
|
type: object
|
|
required:
|
|
- name
|
|
- source
|
|
properties:
|
|
name:
|
|
type: string
|
|
description: Function name
|
|
source:
|
|
type: string
|
|
description: Function source code
|
|
responses:
|
|
"200":
|
|
description: Function created successfully
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: "#/components/schemas/Function"
|
|
"401":
|
|
description: Unauthorized
|
|
|
|
/functions/delete:
|
|
post:
|
|
tags:
|
|
- Functions
|
|
summary: Delete function
|
|
description: Delete a function from the project
|
|
security:
|
|
- ApiKeyAuth: []
|
|
requestBody:
|
|
required: true
|
|
content:
|
|
application/json:
|
|
schema:
|
|
type: object
|
|
required:
|
|
- name
|
|
properties:
|
|
name:
|
|
type: string
|
|
description: Function name to delete
|
|
responses:
|
|
"200":
|
|
description: Function deleted successfully
|
|
"401":
|
|
description: Unauthorized
|
|
"404":
|
|
description: Function not found
|
|
|
|
# Logger Controller
|
|
/logger/{id}/{traceId}:
|
|
get:
|
|
tags:
|
|
- Logging
|
|
summary: Get log by trace ID
|
|
description: Retrieve log entries by trace ID
|
|
security:
|
|
- ApiKeyAuth: []
|
|
parameters:
|
|
- name: id
|
|
in: path
|
|
required: true
|
|
schema:
|
|
type: string
|
|
description: Log ID
|
|
- name: traceId
|
|
in: path
|
|
required: true
|
|
schema:
|
|
type: string
|
|
description: Trace ID
|
|
responses:
|
|
"200":
|
|
description: Log retrieved successfully
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: "#/components/schemas/Log"
|
|
"401":
|
|
description: Unauthorized
|
|
"404":
|
|
description: Log not found
|
|
|
|
/logger/{id}/findAll:
|
|
post:
|
|
tags:
|
|
- Logging
|
|
summary: Find all logs
|
|
description: Find all logs for a project with filtering
|
|
security:
|
|
- ApiKeyAuth: []
|
|
parameters:
|
|
- name: id
|
|
in: path
|
|
required: true
|
|
schema:
|
|
type: string
|
|
description: Project ID
|
|
requestBody:
|
|
required: true
|
|
content:
|
|
application/json:
|
|
schema:
|
|
type: object
|
|
required:
|
|
- limit
|
|
- offset
|
|
properties:
|
|
traceId:
|
|
type: string
|
|
description: Filter by trace ID
|
|
fromDate:
|
|
type: string
|
|
format: date-time
|
|
description: Filter from date
|
|
toDate:
|
|
type: string
|
|
format: date-time
|
|
description: Filter to date
|
|
url:
|
|
type: string
|
|
description: Filter by URL
|
|
limit:
|
|
type: integer
|
|
description: Number of results to return
|
|
offset:
|
|
type: integer
|
|
description: Number of results to skip
|
|
responses:
|
|
"200":
|
|
description: Logs retrieved successfully
|
|
content:
|
|
application/json:
|
|
schema:
|
|
type: array
|
|
items:
|
|
$ref: "#/components/schemas/Log"
|
|
"401":
|
|
description: Unauthorized
|
|
|
|
/logger/{id}/find:
|
|
post:
|
|
tags:
|
|
- Logging
|
|
summary: Find logs for query
|
|
description: Find logs for a specific query with filtering
|
|
security:
|
|
- ApiKeyAuth: []
|
|
- QueryGuard: []
|
|
parameters:
|
|
- name: id
|
|
in: path
|
|
required: true
|
|
schema:
|
|
type: string
|
|
description: Query ID
|
|
requestBody:
|
|
required: true
|
|
content:
|
|
application/json:
|
|
schema:
|
|
type: object
|
|
required:
|
|
- limit
|
|
- offset
|
|
properties:
|
|
traceId:
|
|
type: string
|
|
description: Filter by trace ID
|
|
fromDate:
|
|
type: string
|
|
format: date-time
|
|
description: Filter from date
|
|
toDate:
|
|
type: string
|
|
format: date-time
|
|
description: Filter to date
|
|
url:
|
|
type: string
|
|
description: Filter by URL
|
|
limit:
|
|
type: integer
|
|
description: Number of results to return
|
|
offset:
|
|
type: integer
|
|
description: Number of results to skip
|
|
responses:
|
|
"200":
|
|
description: Logs retrieved successfully
|
|
content:
|
|
application/json:
|
|
schema:
|
|
type: array
|
|
items:
|
|
$ref: "#/components/schemas/Log"
|
|
"401":
|
|
description: Unauthorized
|
|
"403":
|
|
description: Query access required
|
|
|
|
# Query Controller (via BaseQueryController)
|
|
/query/create:
|
|
post:
|
|
tags:
|
|
- Queries
|
|
summary: Create query
|
|
description: Create a new query in the project
|
|
security:
|
|
- ApiKeyAuth: []
|
|
requestBody:
|
|
required: true
|
|
content:
|
|
application/json:
|
|
schema:
|
|
type: object
|
|
required:
|
|
- source
|
|
properties:
|
|
source:
|
|
type: string
|
|
description: Query source code
|
|
responses:
|
|
"200":
|
|
description: Query created successfully
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: "#/components/schemas/Query"
|
|
"401":
|
|
description: Unauthorized
|
|
|
|
/query/update/{id}:
|
|
post:
|
|
tags:
|
|
- Queries
|
|
summary: Update query
|
|
description: Update an existing query
|
|
security:
|
|
- ApiKeyAuth: []
|
|
- QueryGuard: []
|
|
parameters:
|
|
- name: id
|
|
in: path
|
|
required: true
|
|
schema:
|
|
type: string
|
|
description: Query ID
|
|
requestBody:
|
|
required: true
|
|
content:
|
|
application/json:
|
|
schema:
|
|
type: object
|
|
properties:
|
|
source:
|
|
type: string
|
|
description: Updated query source code
|
|
responses:
|
|
"200":
|
|
description: Query updated successfully
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: "#/components/schemas/Query"
|
|
"401":
|
|
description: Unauthorized
|
|
"403":
|
|
description: Query access required
|
|
"404":
|
|
description: Query not found
|
|
|
|
/query/run/{id}:
|
|
post:
|
|
tags:
|
|
- Queries
|
|
summary: Run query
|
|
description: Execute a query with provided data
|
|
security:
|
|
- ApiKeyAuth: []
|
|
- QueryGuard: []
|
|
parameters:
|
|
- name: id
|
|
in: path
|
|
required: true
|
|
schema:
|
|
type: string
|
|
description: Query ID
|
|
- name: x-trace-id
|
|
in: header
|
|
required: false
|
|
schema:
|
|
type: string
|
|
description: Trace ID for logging
|
|
requestBody:
|
|
required: true
|
|
content:
|
|
application/json:
|
|
schema:
|
|
type: object
|
|
description: Query execution data
|
|
responses:
|
|
"200":
|
|
description: Query executed successfully
|
|
content:
|
|
application/json:
|
|
schema:
|
|
type: object
|
|
"302":
|
|
description: Redirect response
|
|
"401":
|
|
description: Unauthorized
|
|
"403":
|
|
description: Query access required
|
|
"404":
|
|
description: Query not found
|
|
"500":
|
|
description: Internal Server Error
|
|
|
|
/query/delete/{id}:
|
|
delete:
|
|
tags:
|
|
- Queries
|
|
summary: Delete query
|
|
description: Delete an existing query
|
|
security:
|
|
- ApiKeyAuth: []
|
|
- QueryGuard: []
|
|
parameters:
|
|
- name: id
|
|
in: path
|
|
required: true
|
|
schema:
|
|
type: string
|
|
description: Query ID
|
|
responses:
|
|
"200":
|
|
description: Query deleted successfully
|
|
"401":
|
|
description: Unauthorized
|
|
"403":
|
|
description: Query access required
|
|
"404":
|
|
description: Query not found
|
|
|
|
# Command Controller (via BaseQueryController)
|
|
/command/create:
|
|
post:
|
|
tags:
|
|
- Commands
|
|
summary: Create command
|
|
description: Create a new command in the project
|
|
security:
|
|
- ApiKeyAuth: []
|
|
requestBody:
|
|
required: true
|
|
content:
|
|
application/json:
|
|
schema:
|
|
type: object
|
|
required:
|
|
- source
|
|
properties:
|
|
source:
|
|
type: string
|
|
description: Command source code
|
|
responses:
|
|
"200":
|
|
description: Command created successfully
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: "#/components/schemas/Query"
|
|
"401":
|
|
description: Unauthorized
|
|
|
|
/command/update/{id}:
|
|
post:
|
|
tags:
|
|
- Commands
|
|
summary: Update command
|
|
description: Update an existing command
|
|
security:
|
|
- ApiKeyAuth: []
|
|
- QueryGuard: []
|
|
parameters:
|
|
- name: id
|
|
in: path
|
|
required: true
|
|
schema:
|
|
type: string
|
|
description: Command ID
|
|
requestBody:
|
|
required: true
|
|
content:
|
|
application/json:
|
|
schema:
|
|
type: object
|
|
properties:
|
|
source:
|
|
type: string
|
|
description: Updated command source code
|
|
responses:
|
|
"200":
|
|
description: Command updated successfully
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: "#/components/schemas/Query"
|
|
"401":
|
|
description: Unauthorized
|
|
"403":
|
|
description: Query access required
|
|
"404":
|
|
description: Command not found
|
|
|
|
/command/run/{id}:
|
|
post:
|
|
tags:
|
|
- Commands
|
|
summary: Run command
|
|
description: Execute a command with provided data
|
|
security:
|
|
- ApiKeyAuth: []
|
|
- QueryGuard: []
|
|
parameters:
|
|
- name: id
|
|
in: path
|
|
required: true
|
|
schema:
|
|
type: string
|
|
description: Command ID
|
|
- name: x-trace-id
|
|
in: header
|
|
required: false
|
|
schema:
|
|
type: string
|
|
description: Trace ID for logging
|
|
requestBody:
|
|
required: true
|
|
content:
|
|
application/json:
|
|
schema:
|
|
type: object
|
|
description: Command execution data
|
|
responses:
|
|
"200":
|
|
description: Command executed successfully
|
|
content:
|
|
application/json:
|
|
schema:
|
|
type: object
|
|
"302":
|
|
description: Redirect response
|
|
"401":
|
|
description: Unauthorized
|
|
"403":
|
|
description: Query access required
|
|
"404":
|
|
description: Command not found
|
|
"500":
|
|
description: Internal Server Error
|
|
|
|
/command/delete/{id}:
|
|
delete:
|
|
tags:
|
|
- Commands
|
|
summary: Delete command
|
|
description: Delete an existing command
|
|
security:
|
|
- ApiKeyAuth: []
|
|
- QueryGuard: []
|
|
parameters:
|
|
- name: id
|
|
in: path
|
|
required: true
|
|
schema:
|
|
type: string
|
|
description: Command ID
|
|
responses:
|
|
"200":
|
|
description: Command deleted successfully
|
|
"401":
|
|
description: Unauthorized
|
|
"403":
|
|
description: Query access required
|
|
"404":
|
|
description: Command not found
|
|
|
|
components:
|
|
securitySchemes:
|
|
ApiKeyAuth:
|
|
type: apiKey
|
|
in: header
|
|
name: Authorization
|
|
description: API token for authentication
|
|
AdminAuth:
|
|
type: apiKey
|
|
in: header
|
|
name: x-admin-token
|
|
description: Admin token for administrative operations
|
|
QueryGuard:
|
|
type: apiKey
|
|
in: header
|
|
name: x-query-access
|
|
description: Query-specific access token
|
|
|
|
schemas:
|
|
Token:
|
|
type: object
|
|
properties:
|
|
token:
|
|
type: string
|
|
format: uuid
|
|
description: Unique token identifier
|
|
isActive:
|
|
type: boolean
|
|
description: Whether the token is active
|
|
isAdmin:
|
|
type: boolean
|
|
description: Whether the token has admin privileges
|
|
project:
|
|
$ref: "#/components/schemas/Project"
|
|
|
|
Project:
|
|
type: object
|
|
properties:
|
|
id:
|
|
type: string
|
|
format: uuid
|
|
description: Unique project identifier
|
|
name:
|
|
type: string
|
|
description: Project name
|
|
apiTokens:
|
|
type: array
|
|
items:
|
|
$ref: "#/components/schemas/Token"
|
|
database:
|
|
$ref: "#/components/schemas/Database"
|
|
queries:
|
|
type: array
|
|
items:
|
|
$ref: "#/components/schemas/Query"
|
|
functions:
|
|
type: array
|
|
items:
|
|
$ref: "#/components/schemas/Function"
|
|
settings:
|
|
type: array
|
|
items:
|
|
$ref: "#/components/schemas/ProjectSetting"
|
|
|
|
Query:
|
|
type: object
|
|
properties:
|
|
id:
|
|
type: string
|
|
format: uuid
|
|
description: Unique query identifier
|
|
source:
|
|
type: string
|
|
description: Query source code
|
|
isActive:
|
|
type: integer
|
|
description: Whether the query is active (1 = active, 0 = inactive)
|
|
isCommand:
|
|
type: integer
|
|
description: Whether this is a command (1 = command, 0 = query)
|
|
project:
|
|
$ref: "#/components/schemas/Project"
|
|
logs:
|
|
type: array
|
|
items:
|
|
$ref: "#/components/schemas/Log"
|
|
|
|
Database:
|
|
type: object
|
|
properties:
|
|
id:
|
|
type: string
|
|
format: uuid
|
|
description: Unique database identifier
|
|
q_username:
|
|
type: string
|
|
description: Query username for database access
|
|
c_username:
|
|
type: string
|
|
description: Command username for database access
|
|
password:
|
|
type: string
|
|
description: Database password
|
|
database:
|
|
type: string
|
|
description: Database name
|
|
migrations:
|
|
type: array
|
|
items:
|
|
$ref: "#/components/schemas/Migration"
|
|
project:
|
|
$ref: "#/components/schemas/Project"
|
|
node:
|
|
$ref: "#/components/schemas/DatabaseNode"
|
|
|
|
DatabaseNode:
|
|
type: object
|
|
properties:
|
|
id:
|
|
type: string
|
|
format: uuid
|
|
description: Unique database node identifier
|
|
host:
|
|
type: string
|
|
description: Database host
|
|
port:
|
|
type: integer
|
|
description: Database port
|
|
username:
|
|
type: string
|
|
description: Database username
|
|
password:
|
|
type: string
|
|
description: Database password
|
|
databases:
|
|
type: array
|
|
items:
|
|
$ref: "#/components/schemas/Database"
|
|
|
|
Migration:
|
|
type: object
|
|
properties:
|
|
id:
|
|
type: string
|
|
format: uuid
|
|
description: Unique migration identifier
|
|
up:
|
|
type: string
|
|
description: Migration up SQL
|
|
down:
|
|
type: string
|
|
description: Migration down SQL
|
|
database:
|
|
$ref: "#/components/schemas/Database"
|
|
|
|
RedisNode:
|
|
type: object
|
|
properties:
|
|
id:
|
|
type: string
|
|
format: uuid
|
|
description: Unique Redis node identifier
|
|
host:
|
|
type: string
|
|
description: Redis host
|
|
port:
|
|
type: integer
|
|
description: Redis port
|
|
user:
|
|
type: string
|
|
description: Redis username
|
|
password:
|
|
type: string
|
|
description: Redis password
|
|
projects:
|
|
type: array
|
|
items:
|
|
$ref: "#/components/schemas/Project"
|
|
|
|
Function:
|
|
type: object
|
|
properties:
|
|
id:
|
|
type: string
|
|
format: uuid
|
|
description: Unique function identifier
|
|
name:
|
|
type: string
|
|
description: Function name
|
|
source:
|
|
type: string
|
|
description: Function source code
|
|
project:
|
|
$ref: "#/components/schemas/Project"
|
|
|
|
ProjectSetting:
|
|
type: object
|
|
properties:
|
|
id:
|
|
type: string
|
|
format: uuid
|
|
description: Unique setting identifier
|
|
key:
|
|
type: string
|
|
description: Setting key
|
|
value:
|
|
type: string
|
|
description: Setting value
|
|
project:
|
|
$ref: "#/components/schemas/Project"
|
|
|
|
Log:
|
|
type: object
|
|
properties:
|
|
id:
|
|
type: string
|
|
format: uuid
|
|
description: Unique log identifier
|
|
traceId:
|
|
type: string
|
|
description: Trace ID for tracking requests
|
|
startTime:
|
|
type: integer
|
|
description: Request start timestamp
|
|
endTime:
|
|
type: integer
|
|
description: Request end timestamp
|
|
payload:
|
|
type: object
|
|
description: Request payload
|
|
headers:
|
|
type: object
|
|
description: Request headers
|
|
cookies:
|
|
type: string
|
|
description: Request cookies
|
|
url:
|
|
type: string
|
|
description: Request URL
|
|
response:
|
|
type: object
|
|
description: Response data
|
|
content:
|
|
type: array
|
|
items:
|
|
type: object
|
|
properties:
|
|
content:
|
|
type: string
|
|
description: Log content
|
|
type:
|
|
type: string
|
|
description: Log type (info, error, warning)
|
|
timeStamp:
|
|
type: integer
|
|
description: Log entry timestamp
|
|
project:
|
|
$ref: "#/components/schemas/Project"
|
|
query:
|
|
$ref: "#/components/schemas/Query"
|
|
|
|
Error:
|
|
type: object
|
|
properties:
|
|
error:
|
|
type: string
|
|
description: Error message
|
|
details:
|
|
type: string
|
|
description: Error details
|
|
|
|
tags:
|
|
- name: API Tokens
|
|
description: API token management operations
|
|
- name: Database Management
|
|
description: Database and database node management
|
|
- name: Project Management
|
|
description: Project and project settings management
|
|
- name: Redis Management
|
|
description: Redis node management
|
|
- name: Functions
|
|
description: Function management operations
|
|
- name: Logging
|
|
description: Log retrieval and management
|
|
- name: Queries
|
|
description: Query management and execution
|
|
- name: Commands
|
|
description: Command management and execution
|