Commit f61e68ea authored by JunHyung An's avatar JunHyung An
Browse files

Initial commit

parents
Loading
Loading
Loading
Loading
Loading

.gitignore

0 → 100644
+2 −0
Original line number Diff line number Diff line
site/
public/

.gitlab-ci.yml

0 → 100644
+24 −0
Original line number Diff line number Diff line
# included templates
include:
  # MkDocs template
  - project: "to-be-continuous/mkdocs"
    ref: "2.1"
    file: "templates/gitlab-ci-mkdocs.yml"
  # MkDocs template (GitLab Pages variant)
  - project: "to-be-continuous/mkdocs"
    ref: "2.1"
    file: "templates/gitlab-ci-mkdocs-pages.yml"


# your pipeline stages
stages:
  - build
  - test
  - package-build
  - package-test
  - infra
  - deploy
  - acceptance
  - publish
  - infra-prod
  - production

docs/api/.api.yaml.swp

0 → 100644
+12 KiB

File added.

No diff preview for this file type.

docs/api/api.yaml

0 → 100644
+38 −0
Original line number Diff line number Diff line
openapi: 3.1.0
info:
  version: 0.1
  title: Flask REST API
servers:
  - url: http://api.biblio19.net/
paths:
  /:
    get:
      summary: default
      tags:
        - default
      responses:
        200:
          description: there's nothing here, yet
  /health:
    get:
      summary: health check
      tags:
        - health check
      responses:
        200:
          description: OK
  /file_upload:
    post:
      summary: Upload the json file
      tags:
        - audio
      parameters:
        - name: text
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Return secret key with alert?
          content:
            audio/wav: {}

docs/api/spec.json

0 → 100644
+523 −0
Original line number Diff line number Diff line
{
  "definitions": {
    "detections": {
      "items": {
        "properties": {
          "confidence": {
            "description": "신뢰치",
            "example": 0.6,
            "format": "float",
            "maximum": 1,
            "minimum": 0,
            "type": "number"
          },
          "language": {
            "description": "언어 코드",
            "example": "en",
            "type": "string"
          }
        },
        "type": "object"
      },
      "type": "array"
    },
    "error-response": {
      "properties": {
        "error": {
          "description": "오류 메시지",
          "type": "string"
        }
      },
      "type": "object"
    },
    "error-slow-down": {
      "properties": {
        "error": {
          "description": "느려지는 이유",
          "type": "string"
        }
      },
      "type": "object"
    },
    "frontend-settings": {
      "properties": {
        "apiKeys": {
          "description": "API 키 데이터베이스가 활성화되었는지 여부.",
          "type": "boolean"
        },
        "charLimit": {
          "description": "이 언어의 문자 입력 제한 (-1은 제한이 없음을 의미)",
          "type": "integer"
        },
        "frontendTimeout": {
          "description": "프론트엔드 번역 시간 초과",
          "type": "integer"
        },
        "keyRequired": {
          "description": "API 키가 필요하든.",
          "type": "boolean"
        },
        "language": {
          "properties": {
            "source": {
              "properties": {
                "code": {
                  "description": "언어 코드",
                  "type": "string"
                },
                "name": {
                  "description": "사람이 읽을 수 있는 언어 이름 (영어로)",
                  "type": "string"
                }
              },
              "type": "object"
            },
            "target": {
              "properties": {
                "code": {
                  "description": "언어 코드",
                  "type": "string"
                },
                "name": {
                  "description": "사람이 읽을 수 있는 언어 이름 (영어로)",
                  "type": "string"
                }
              },
              "type": "object"
            }
          },
          "type": "object"
        },
        "suggestions": {
          "description": "자주 묻는 질문.",
          "type": "boolean"
        },
        "supportedFilesFormat": {
          "description": "지원된 파일 형식",
          "items": {
            "type": "string"
          },
          "type": "array"
        }
      },
      "type": "object"
    },
    "languages": {
      "items": {
        "properties": {
          "code": {
            "description": "언어 코드",
            "type": "string"
          },
          "name": {
            "description": "사람이 읽을 수 있는 언어 이름 (영어로)",
            "type": "string"
          },
          "targets": {
            "description": "지원하는 언어 코드",
            "items": {
              "type": "string"
            },
            "type": "array"
          }
        },
        "type": "object"
      },
      "type": "array"
    },
    "suggest-response": {
      "properties": {
        "success": {
          "description": "제출이 성공했는지 여부",
          "type": "boolean"
        }
      },
      "type": "object"
    },
    "translate": {
      "properties": {
        "translatedText": {
          "description": "번역된 텍스트",
          "oneOf": [
            {
              "type": "string"
            },
            {
              "type": "array"
            }
          ]
        }
      },
      "type": "object"
    },
    "translate-file": {
      "properties": {
        "translatedFileUrl": {
          "description": "번역된 파일 url",
          "type": "string"
        }
      },
      "type": "object"
    }
  },
  "info": {
    "title": "LibreTranslate",
    "version": "1.5.1"
  },
  "paths": {
    "/detect": {
      "post": {
        "description": "",
        "parameters": [
          {
            "description": "감지할 텍스트",
            "in": "formData",
            "name": "q",
            "required": true,
            "schema": {
              "example": "Hello world!",
              "type": "string"
            }
          },
          {
            "description": "API 키",
            "in": "formData",
            "name": "api_key",
            "required": false,
            "schema": {
              "example": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "감지 내용",
            "schema": {
              "$ref": "#/definitions/detections"
            }
          },
          "400": {
            "description": "잘못된 요청",
            "schema": {
              "$ref": "#/definitions/error-response"
            }
          },
          "403": {
            "description": "금지됨",
            "schema": {
              "$ref": "#/definitions/error-response"
            }
          },
          "429": {
            "description": "속도가 느림",
            "schema": {
              "$ref": "#/definitions/error-slow-down"
            }
          },
          "500": {
            "description": "감지 오류",
            "schema": {
              "$ref": "#/definitions/error-response"
            }
          }
        },
        "summary": "단일 텍스트의 언어를 감지",
        "tags": [
          "번역"
        ]
      }
    },
    "/frontend/settings": {
      "get": {
        "description": "",
        "responses": {
          "200": {
            "description": "프론트엔드 설정",
            "schema": {
              "$ref": "#/definitions/frontend-settings"
            }
          }
        },
        "summary": "프론트엔드의 특정 설정을 검색",
        "tags": [
          "프론트엔드"
        ]
      }
    },
    "/languages": {
      "get": {
        "description": "",
        "responses": {
          "200": {
            "description": "언어 목록",
            "schema": {
              "$ref": "#/definitions/languages"
            }
          }
        },
        "summary": "지원되는 언어 목록 검색",
        "tags": [
          "번역"
        ]
      }
    },
    "/suggest": {
      "post": {
        "description": "",
        "parameters": [
          {
            "description": "원문",
            "in": "formData",
            "name": "q",
            "required": true,
            "schema": {
              "example": "Hello world!",
              "type": "string"
            }
          },
          {
            "description": "제안된 번역",
            "in": "formData",
            "name": "s",
            "required": true,
            "schema": {
              "example": "¡Hola mundo!",
              "type": "string"
            }
          },
          {
            "description": "원문의 언어",
            "in": "formData",
            "name": "source",
            "required": true,
            "schema": {
              "example": "en",
              "type": "string"
            }
          },
          {
            "description": "제안된 번역의 언어",
            "in": "formData",
            "name": "target",
            "required": true,
            "schema": {
              "example": "es",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "성공",
            "schema": {
              "$ref": "#/definitions/suggest-response"
            }
          },
          "403": {
            "description": "권한 없음",
            "schema": {
              "$ref": "#/definitions/error-response"
            }
          }
        },
        "summary": "번역을 개선하기 위해 제안을 제출",
        "tags": [
          "피드백"
        ]
      }
    },
    "/translate": {
      "post": {
        "description": "",
        "parameters": [
          {
            "description": "번역할 테스트",
            "in": "formData",
            "name": "q",
            "required": true,
            "schema": {
              "oneOf": [
                {
                  "example": "Hello world!",
                  "type": "string"
                },
                {
                  "example": [
                    "Hello world!"
                  ],
                  "type": "array"
                }
              ]
            }
          },
          {
            "description": "출발 언어 코드",
            "in": "formData",
            "name": "source",
            "required": true,
            "schema": {
              "example": "en",
              "type": "string"
            }
          },
          {
            "description": "도착 언어 코드",
            "in": "formData",
            "name": "target",
            "required": true,
            "schema": {
              "example": "es",
              "type": "string"
            }
          },
          {
            "description": "출발 텍스트의 형식 :\n* `text` - 평문 텍스트\n* `html` - HTML 마크 업\n",
            "in": "formData",
            "name": "format",
            "required": false,
            "schema": {
              "default": "text",
              "enum": [
                "text",
                "html"
              ],
              "example": "text",
              "type": "string"
            }
          },
          {
            "description": "API 키",
            "in": "formData",
            "name": "api_key",
            "required": false,
            "schema": {
              "example": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "번역된 텍스트",
            "schema": {
              "$ref": "#/definitions/translate"
            }
          },
          "400": {
            "description": "잘못된 요청",
            "schema": {
              "$ref": "#/definitions/error-response"
            }
          },
          "403": {
            "description": "금지됨",
            "schema": {
              "$ref": "#/definitions/error-response"
            }
          },
          "429": {
            "description": "속도가 느림",
            "schema": {
              "$ref": "#/definitions/error-slow-down"
            }
          },
          "500": {
            "description": "번역 오류",
            "schema": {
              "$ref": "#/definitions/error-response"
            }
          }
        },
        "summary": "다른 언어로 텍스트를 번역",
        "tags": [
          "번역"
        ]
      }
    },
    "/translate_file": {
      "post": {
        "consumes": [
          "multipart/form-data"
        ],
        "description": "",
        "parameters": [
          {
            "description": "번역할 파일",
            "in": "formData",
            "name": "file",
            "required": true,
            "type": "file"
          },
          {
            "description": "출발 언어 코드",
            "in": "formData",
            "name": "source",
            "required": true,
            "schema": {
              "example": "en",
              "type": "string"
            }
          },
          {
            "description": "도착 언어 코드",
            "in": "formData",
            "name": "target",
            "required": true,
            "schema": {
              "example": "es",
              "type": "string"
            }
          },
          {
            "description": "API 키",
            "in": "formData",
            "name": "api_key",
            "required": false,
            "schema": {
              "example": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "번역된 파일",
            "schema": {
              "$ref": "#/definitions/translate-file"
            }
          },
          "400": {
            "description": "잘못된 요청",
            "schema": {
              "$ref": "#/definitions/error-response"
            }
          },
          "403": {
            "description": "금지됨",
            "schema": {
              "$ref": "#/definitions/error-response"
            }
          },
          "429": {
            "description": "속도가 느림",
            "schema": {
              "$ref": "#/definitions/error-slow-down"
            }
          },
          "500": {
            "description": "번역 오류",
            "schema": {
              "$ref": "#/definitions/error-response"
            }
          }
        },
        "summary": "다른 언어로 파일을 번역",
        "tags": [
          "번역"
        ]
      }
    }
  },
  "swagger": "2.0"
}