feat: initialize Swagger documentation and API schemas
All checks were successful
Build and Release / release (push) Successful in 1m30s

This commit is contained in:
2026-05-24 19:39:00 +07:00
parent 81294af909
commit d1848174ef
3 changed files with 538 additions and 0 deletions

View File

@@ -860,6 +860,44 @@ const docTemplate = `{
}
}
},
"/geometries/bound-with/{bound_with}": {
"get": {
"description": "Get a list of geometries that are bound to the specified geometry ID",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Geometries"
],
"summary": "Get geometries by bound_with ID",
"parameters": [
{
"type": "string",
"description": "Bound-with Geometry ID",
"name": "bound_with",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/history-api_internal_dtos_response.CommonResponse"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/history-api_internal_dtos_response.CommonResponse"
}
}
}
}
},
"/geometries/entity": {
"get": {
"description": "Search entities by name (cursor pagination) and return their linked geometries",
@@ -2283,6 +2321,116 @@ const docTemplate = `{
}
}
},
"/projects/{id}/heartbeat": {
"post": {
"security": [
{
"BearerAuth": []
}
],
"description": "Refresh the TTL of the exclusive editing lock on a project for another 15 minutes",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Projects"
],
"summary": "Heartbeat to refresh project lock",
"parameters": [
{
"type": "string",
"description": "Project ID",
"name": "id",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/history-api_internal_dtos_response.CommonResponse"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/history-api_internal_dtos_response.CommonResponse"
}
},
"409": {
"description": "Conflict",
"schema": {
"$ref": "#/definitions/history-api_internal_dtos_response.CommonResponse"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/history-api_internal_dtos_response.CommonResponse"
}
}
}
}
},
"/projects/{id}/lock": {
"post": {
"security": [
{
"BearerAuth": []
}
],
"description": "Acquire an exclusive editing lock on a project for 15 minutes",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Projects"
],
"summary": "Lock a project",
"parameters": [
{
"type": "string",
"description": "Project ID",
"name": "id",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/history-api_internal_dtos_response.CommonResponse"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/history-api_internal_dtos_response.CommonResponse"
}
},
"409": {
"description": "Conflict",
"schema": {
"$ref": "#/definitions/history-api_internal_dtos_response.CommonResponse"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/history-api_internal_dtos_response.CommonResponse"
}
}
}
}
},
"/projects/{id}/members": {
"post": {
"security": [
@@ -2496,6 +2644,61 @@ const docTemplate = `{
}
}
},
"/projects/{id}/unlock": {
"post": {
"security": [
{
"BearerAuth": []
}
],
"description": "Release the exclusive editing lock on a project",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Projects"
],
"summary": "Unlock a project",
"parameters": [
{
"type": "string",
"description": "Project ID",
"name": "id",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/history-api_internal_dtos_response.CommonResponse"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/history-api_internal_dtos_response.CommonResponse"
}
},
"403": {
"description": "Forbidden",
"schema": {
"$ref": "#/definitions/history-api_internal_dtos_response.CommonResponse"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/history-api_internal_dtos_response.CommonResponse"
}
}
}
}
},
"/proxy/{path}": {
"get": {
"description": "Transparent proxy for Goong APIs to forward body, params, headers and inject API key automatically.",

View File

@@ -853,6 +853,44 @@
}
}
},
"/geometries/bound-with/{bound_with}": {
"get": {
"description": "Get a list of geometries that are bound to the specified geometry ID",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Geometries"
],
"summary": "Get geometries by bound_with ID",
"parameters": [
{
"type": "string",
"description": "Bound-with Geometry ID",
"name": "bound_with",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/history-api_internal_dtos_response.CommonResponse"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/history-api_internal_dtos_response.CommonResponse"
}
}
}
}
},
"/geometries/entity": {
"get": {
"description": "Search entities by name (cursor pagination) and return their linked geometries",
@@ -2276,6 +2314,116 @@
}
}
},
"/projects/{id}/heartbeat": {
"post": {
"security": [
{
"BearerAuth": []
}
],
"description": "Refresh the TTL of the exclusive editing lock on a project for another 15 minutes",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Projects"
],
"summary": "Heartbeat to refresh project lock",
"parameters": [
{
"type": "string",
"description": "Project ID",
"name": "id",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/history-api_internal_dtos_response.CommonResponse"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/history-api_internal_dtos_response.CommonResponse"
}
},
"409": {
"description": "Conflict",
"schema": {
"$ref": "#/definitions/history-api_internal_dtos_response.CommonResponse"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/history-api_internal_dtos_response.CommonResponse"
}
}
}
}
},
"/projects/{id}/lock": {
"post": {
"security": [
{
"BearerAuth": []
}
],
"description": "Acquire an exclusive editing lock on a project for 15 minutes",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Projects"
],
"summary": "Lock a project",
"parameters": [
{
"type": "string",
"description": "Project ID",
"name": "id",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/history-api_internal_dtos_response.CommonResponse"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/history-api_internal_dtos_response.CommonResponse"
}
},
"409": {
"description": "Conflict",
"schema": {
"$ref": "#/definitions/history-api_internal_dtos_response.CommonResponse"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/history-api_internal_dtos_response.CommonResponse"
}
}
}
}
},
"/projects/{id}/members": {
"post": {
"security": [
@@ -2489,6 +2637,61 @@
}
}
},
"/projects/{id}/unlock": {
"post": {
"security": [
{
"BearerAuth": []
}
],
"description": "Release the exclusive editing lock on a project",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Projects"
],
"summary": "Unlock a project",
"parameters": [
{
"type": "string",
"description": "Project ID",
"name": "id",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/history-api_internal_dtos_response.CommonResponse"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/history-api_internal_dtos_response.CommonResponse"
}
},
"403": {
"description": "Forbidden",
"schema": {
"$ref": "#/definitions/history-api_internal_dtos_response.CommonResponse"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/history-api_internal_dtos_response.CommonResponse"
}
}
}
}
},
"/proxy/{path}": {
"get": {
"description": "Transparent proxy for Goong APIs to forward body, params, headers and inject API key automatically.",

View File

@@ -1287,6 +1287,32 @@ paths:
summary: Get geometry by ID
tags:
- Geometries
/geometries/bound-with/{bound_with}:
get:
consumes:
- application/json
description: Get a list of geometries that are bound to the specified geometry
ID
parameters:
- description: Bound-with Geometry ID
in: path
name: bound_with
required: true
type: string
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/history-api_internal_dtos_response.CommonResponse'
"500":
description: Internal Server Error
schema:
$ref: '#/definitions/history-api_internal_dtos_response.CommonResponse'
summary: Get geometries by bound_with ID
tags:
- Geometries
/geometries/entity:
get:
consumes:
@@ -2145,6 +2171,77 @@ paths:
summary: Restore project to a commit
tags:
- Commits
/projects/{id}/heartbeat:
post:
consumes:
- application/json
description: Refresh the TTL of the exclusive editing lock on a project for
another 15 minutes
parameters:
- description: Project ID
in: path
name: id
required: true
type: string
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/history-api_internal_dtos_response.CommonResponse'
"400":
description: Bad Request
schema:
$ref: '#/definitions/history-api_internal_dtos_response.CommonResponse'
"409":
description: Conflict
schema:
$ref: '#/definitions/history-api_internal_dtos_response.CommonResponse'
"500":
description: Internal Server Error
schema:
$ref: '#/definitions/history-api_internal_dtos_response.CommonResponse'
security:
- BearerAuth: []
summary: Heartbeat to refresh project lock
tags:
- Projects
/projects/{id}/lock:
post:
consumes:
- application/json
description: Acquire an exclusive editing lock on a project for 15 minutes
parameters:
- description: Project ID
in: path
name: id
required: true
type: string
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/history-api_internal_dtos_response.CommonResponse'
"400":
description: Bad Request
schema:
$ref: '#/definitions/history-api_internal_dtos_response.CommonResponse'
"409":
description: Conflict
schema:
$ref: '#/definitions/history-api_internal_dtos_response.CommonResponse'
"500":
description: Internal Server Error
schema:
$ref: '#/definitions/history-api_internal_dtos_response.CommonResponse'
security:
- BearerAuth: []
summary: Lock a project
tags:
- Projects
/projects/{id}/members:
post:
consumes:
@@ -2285,6 +2382,41 @@ paths:
summary: Update member role
tags:
- Projects
/projects/{id}/unlock:
post:
consumes:
- application/json
description: Release the exclusive editing lock on a project
parameters:
- description: Project ID
in: path
name: id
required: true
type: string
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/history-api_internal_dtos_response.CommonResponse'
"400":
description: Bad Request
schema:
$ref: '#/definitions/history-api_internal_dtos_response.CommonResponse'
"403":
description: Forbidden
schema:
$ref: '#/definitions/history-api_internal_dtos_response.CommonResponse'
"500":
description: Internal Server Error
schema:
$ref: '#/definitions/history-api_internal_dtos_response.CommonResponse'
security:
- BearerAuth: []
summary: Unlock a project
tags:
- Projects
/projects/commits/{commitId}:
get:
consumes: