diff --git a/api-spec.yml b/api-spec.yml new file mode 100644 index 0000000..a3144a5 --- /dev/null +++ b/api-spec.yml @@ -0,0 +1,323 @@ +openapi: 3.0.0 +paths: + /v1: + get: + description: 서버 상태 확인 + operationId: AppController_isHealthy + parameters: [] + responses: + '200': + description: 서버 정상 + content: + application/json: + schema: + type: string + default: + description: '' + content: + application/json: + schema: + type: string + summary: Health check + tags: + - Health + /v1/account/signin: + get: + description: 사용자 로그인 + operationId: AccountController_signIn + parameters: [] + responses: + '200': + description: 로그인 성공 + content: + application/json: + schema: + type: string + default: + description: '' + content: + application/json: + schema: + type: string + security: + - bearer: [] + summary: 로그인 + tags: + - Account + /v1/account: + get: + description: 현재 로그인한 사용자의 계정 정보 조회 + operationId: AccountController_getAccountInfo + parameters: [] + responses: + '200': + description: 계정 정보 조회 성공 + content: + application/json: + schema: + type: string + default: + description: '' + content: + application/json: + schema: + type: string + security: + - bearer: [] + summary: 계정 정보 조회 + tags: + - Account + /v1/image: + post: + description: 이미지 파일을 업로드합니다 + operationId: ImageController_uploadImage + parameters: [] + requestBody: + required: true + content: + multipart/form-data: + schema: + type: object + properties: + file: + type: string + format: binary + responses: + '201': + description: 이미지 업로드 성공 + content: + application/json: + schema: + type: string + default: + description: '' + content: + application/json: + schema: + type: string + summary: 이미지 업로드 + tags: + - Image + /v1/taxonomies/{id}/child-items: + get: + operationId: TaxonomyController_getChildItems + parameters: + - name: id + required: true + in: path + schema: + type: string + responses: + default: + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/GetChildResponseDto' + tags: + - Taxonomy + /v1/articles/{slug}/taxonomy-path: + get: + operationId: ArticleController_getArticleTaxonomyPath + parameters: + - name: slug + required: true + in: path + schema: + type: string + responses: + default: + description: '' + content: + application/json: + schema: + type: object + tags: + - Article + /v1/articles/{slug}: + get: + operationId: ArticleController_getArticle + parameters: + - name: slug + required: true + in: path + schema: + type: string + responses: + default: + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/GetArticleResponseDto' + tags: + - Article + /v1/contents/site-header: + get: + operationId: ContentController_getSiteHeaders + parameters: [] + responses: + '200': + description: '' + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/GetSiteHeaderResponseDto' + tags: + - Content +info: + title: Moeum API + description: The Moeum API description + version: '1.0' + contact: {} +tags: + - name: moeum + description: '' +servers: + - url: https://moeum.dahyeon.us/ +components: + schemas: + GetChildItemDto: + type: object + properties: + title: + type: string + example: Install + href: + type: string + example: install + children: + description: 하위 목차 아이템 리스트 + type: array + items: + $ref: '#/components/schemas/GetChildItemDto' + required: + - title + GetChildItemMetadataDto: + type: object + properties: {} + GetChildResponseDto: + type: object + properties: + items: + type: array + items: + $ref: '#/components/schemas/GetChildItemDto' + metadatas: + type: array + items: + $ref: '#/components/schemas/GetChildItemMetadataDto' + required: + - items + - metadatas + ArticleMetadataDto: + type: object + properties: + key: + type: string + example: category + value: + oneOf: + - type: string + - type: array + items: + type: string + dataType: + type: string + enum: + - string + - number + - boolean + - array + - json + default: string + isReserved: + type: boolean + default: false + required: + - key + - value + - dataType + GetArticleResponseDto: + type: object + properties: + _id: + type: string + title: + type: string + slug: + type: string + content: + type: string + status: + type: string + enum: + - draft + - published + - archived + metadatas: + type: array + items: + $ref: '#/components/schemas/ArticleMetadataDto' + createdAt: + type: string + format: date-time + updatedAt: + type: string + format: date-time + required: + - _id + - title + - slug + - content + - status + - metadatas + - createdAt + - updatedAt + ContentSectionEmbeddedTaxonomyDto: + type: object + properties: + taxonomyId: + type: string + example: 664fe1c3c2c1e7... + label: + type: string + example: getting-started + required: + - taxonomyId + - label + ContentSectionDto: + type: object + properties: + headline: + type: string + example: 시작하기 + taxonomies: + example: + - taxonomyId: 6916d575eaa6f7c53096e348 + label: Top Stories + type: array + items: + $ref: '#/components/schemas/ContentSectionEmbeddedTaxonomyDto' + required: + - headline + - taxonomies + GetSiteHeaderResponseDto: + type: object + properties: + key: + type: string + example: home + label: + type: string + example: Home + sections: + type: array + items: + $ref: '#/components/schemas/ContentSectionDto' + required: + - key + - label + - sections \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index 25c860f..d0e5de2 100644 --- a/package-lock.json +++ b/package-lock.json @@ -35,6 +35,7 @@ "@radix-ui/react-toggle": "^1.1.10", "@radix-ui/react-toggle-group": "^1.1.11", "@radix-ui/react-tooltip": "^1.2.8", + "@tanstack/react-query": "^5.90.8", "class-variance-authority": "^0.7.1", "clsx": "*", "cmdk": "^1.1.1", @@ -2825,6 +2826,32 @@ "@swc/counter": "^0.1.3" } }, + "node_modules/@tanstack/query-core": { + "version": "5.90.8", + "resolved": "https://registry.npmjs.org/@tanstack/query-core/-/query-core-5.90.8.tgz", + "integrity": "sha512-4E0RP/0GJCxSNiRF2kAqE/LQkTJVlL/QNU7gIJSptaseV9HP6kOuA+N11y4bZKZxa3QopK3ZuewwutHx6DqDXQ==", + "license": "MIT", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/tannerlinsley" + } + }, + "node_modules/@tanstack/react-query": { + "version": "5.90.8", + "resolved": "https://registry.npmjs.org/@tanstack/react-query/-/react-query-5.90.8.tgz", + "integrity": "sha512-/3b9QGzkf4rE5/miL6tyhldQRlLXzMHcySOm/2Tm2OLEFE9P1ImkH0+OviDBSvyAvtAOJocar5xhd7vxdLi3aQ==", + "license": "MIT", + "dependencies": { + "@tanstack/query-core": "5.90.8" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/tannerlinsley" + }, + "peerDependencies": { + "react": "^18 || ^19" + } + }, "node_modules/@types/d3-array": { "version": "3.2.2", "resolved": "https://registry.npmjs.org/@types/d3-array/-/d3-array-3.2.2.tgz", diff --git a/package.json b/package.json index 5817067..b412335 100644 --- a/package.json +++ b/package.json @@ -30,6 +30,7 @@ "@radix-ui/react-toggle": "^1.1.10", "@radix-ui/react-toggle-group": "^1.1.11", "@radix-ui/react-tooltip": "^1.2.8", + "@tanstack/react-query": "^5.90.8", "class-variance-authority": "^0.7.1", "clsx": "*", "cmdk": "^1.1.1",