From 7f9af29007499ad41a5ce1b313bd38fdd4c3cefc Mon Sep 17 00:00:00 2001 From: rabyeoljji Date: Sun, 8 Dec 2024 06:37:50 +0000 Subject: [PATCH] feat: openapi typescript (#304) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat: bookmark collection * feat: openapi-typescript 도입 * feat: 전역 namespace로 등록 * fix: type --- package-lock.json | 285 ++ package.json | 4 +- .../document/(main)/@header/default.tsx | 2 +- .../directory/contexts/directory-context.tsx | 2 +- src/types/collection.d.ts | 306 +- src/types/directory.d.ts | 102 +- src/types/document.d.ts | 310 +- src/types/quiz.d.ts | 323 +- src/types/schema.d.ts | 4300 +++++++++++++++++ src/types/user.d.ts | 67 +- tsconfig.json | 1 + 11 files changed, 4997 insertions(+), 705 deletions(-) create mode 100644 src/types/schema.d.ts diff --git a/package-lock.json b/package-lock.json index 03d3a6ed..8b97a0fb 100644 --- a/package-lock.json +++ b/package-lock.json @@ -99,6 +99,7 @@ "eslint-plugin-storybook": "^0.10.1", "eslint-plugin-tailwindcss": "^3.15.1", "husky": "^9.0.11", + "openapi-typescript": "^7.4.4", "postcss": "^8", "storybook": "^8.3.6", "tailwindcss": "^3.3.0", @@ -6090,6 +6091,81 @@ "react": "^18.2.0" } }, + "node_modules/@redocly/ajv": { + "version": "8.11.2", + "resolved": "https://registry.npmjs.org/@redocly/ajv/-/ajv-8.11.2.tgz", + "integrity": "sha512-io1JpnwtIcvojV7QKDUSIuMN/ikdOUd1ReEnUnMKGfDVridQZ31J0MmIuqwuRjWDZfmvr+Q0MqCcfHM2gTivOg==", + "dev": true, + "license": "MIT", + "dependencies": { + "fast-deep-equal": "^3.1.1", + "json-schema-traverse": "^1.0.0", + "require-from-string": "^2.0.2", + "uri-js-replace": "^1.0.1" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" + } + }, + "node_modules/@redocly/ajv/node_modules/json-schema-traverse": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", + "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==", + "dev": true, + "license": "MIT" + }, + "node_modules/@redocly/config": { + "version": "0.17.1", + "resolved": "https://registry.npmjs.org/@redocly/config/-/config-0.17.1.tgz", + "integrity": "sha512-CEmvaJuG7pm2ylQg53emPmtgm4nW2nxBgwXzbVEHpGas/lGnMyN8Zlkgiz6rPw0unASg6VW3wlz27SOL5XFHYQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/@redocly/openapi-core": { + "version": "1.25.15", + "resolved": "https://registry.npmjs.org/@redocly/openapi-core/-/openapi-core-1.25.15.tgz", + "integrity": "sha512-/dpr5zpGj2t1Bf7EIXEboRZm1hsJZBQfv3Q1pkivtdAEg3if2khv+b9gY68aquC6cM/2aQY2kMLy8LlY2tn+Og==", + "dev": true, + "license": "MIT", + "dependencies": { + "@redocly/ajv": "^8.11.2", + "@redocly/config": "^0.17.0", + "colorette": "^1.2.0", + "https-proxy-agent": "^7.0.4", + "js-levenshtein": "^1.1.6", + "js-yaml": "^4.1.0", + "lodash.isequal": "^4.5.0", + "minimatch": "^5.0.1", + "node-fetch": "^2.6.1", + "pluralize": "^8.0.0", + "yaml-ast-parser": "0.0.43" + }, + "engines": { + "node": ">=14.19.0", + "npm": ">=7.0.0" + } + }, + "node_modules/@redocly/openapi-core/node_modules/colorette": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/colorette/-/colorette-1.4.0.tgz", + "integrity": "sha512-Y2oEozpomLn7Q3HFP7dpww7AtMJplbM9lGZP6RDfHqmbeRjiwRg4n6VM6j4KLmRke85uWEI7JqF17f3pqdRA0g==", + "dev": true, + "license": "MIT" + }, + "node_modules/@redocly/openapi-core/node_modules/minimatch": { + "version": "5.1.6", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.6.tgz", + "integrity": "sha512-lKwV/1brpG6mBUFHtb7NUmtABCb2WZZmm2wNiOA5hAb8VdCS4B3dtMWyvcoViccwAW/COERjXLt0zP1zXUN26g==", + "dev": true, + "license": "ISC", + "dependencies": { + "brace-expansion": "^2.0.1" + }, + "engines": { + "node": ">=10" + } + }, "node_modules/@remirror/core": { "version": "2.0.19", "resolved": "https://registry.npmjs.org/@remirror/core/-/core-2.0.19.tgz", @@ -10269,6 +10345,19 @@ "node": ">=8.9.0" } }, + "node_modules/agent-base": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-7.1.2.tgz", + "integrity": "sha512-JVzqkCNRT+VfqzzgPWDPnwvDheSAUdiMUn3NoLXpDJF5lRqeJqyC9iGsAxIOAW+mzIdq+uP1TvcX6bMtrH0agg==", + "dev": true, + "license": "MIT", + "dependencies": { + "debug": "^4.3.4" + }, + "engines": { + "node": ">= 14" + } + }, "node_modules/ajv": { "version": "6.12.6", "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", @@ -10331,6 +10420,16 @@ "ajv": "^6.9.1" } }, + "node_modules/ansi-colors": { + "version": "4.1.3", + "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.3.tgz", + "integrity": "sha512-/6w/C21Pm1A7aZitlI5Ni/2J6FFQN8i1Cvz3kHABAAbw93v/NlvKdVOqz7CCWz/3iv/JplRSEEZ83XION15ovw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, "node_modules/ansi-html": { "version": "0.0.9", "resolved": "https://registry.npmjs.org/ansi-html/-/ansi-html-0.0.9.tgz", @@ -11494,6 +11593,13 @@ "node": ">=0.8.0" } }, + "node_modules/change-case": { + "version": "5.4.4", + "resolved": "https://registry.npmjs.org/change-case/-/change-case-5.4.4.tgz", + "integrity": "sha512-HRQyTk2/YPEkt9TnUPbOpr64Uw3KOicFWPVBb+xiHvd6eBx/qPr9xqfBFDT8P2vWsvvz4jbEkfDe71W3VyNu2w==", + "dev": true, + "license": "MIT" + }, "node_modules/character-entities": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/character-entities/-/character-entities-2.0.2.tgz", @@ -16086,6 +16192,20 @@ "integrity": "sha512-J+FkSdyD+0mA0N+81tMotaRMfSL9SGi+xpD3T6YApKsc3bGSXJlfXri3VyFOeYkfLRQisDk1W+jIFFKBeUBbBg==", "dev": true }, + "node_modules/https-proxy-agent": { + "version": "7.0.6", + "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-7.0.6.tgz", + "integrity": "sha512-vK9P5/iUfdl95AI+JVyUuIcVtd4ofvtrOr3HNtM2yxC9bnMbEdp3x01OhQNnjb8IJYi38VlTE3mBXwcfvywuSw==", + "dev": true, + "license": "MIT", + "dependencies": { + "agent-base": "^7.1.2", + "debug": "4" + }, + "engines": { + "node": ">= 14" + } + }, "node_modules/husky": { "version": "9.1.6", "resolved": "https://registry.npmjs.org/husky/-/husky-9.1.6.tgz", @@ -16248,6 +16368,19 @@ "node": ">=8" } }, + "node_modules/index-to-position": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/index-to-position/-/index-to-position-0.1.2.tgz", + "integrity": "sha512-MWDKS3AS1bGCHLBA2VLImJz42f7bJh8wQsTGCzI3j519/CASStoDONUBVz2I/VID0MpiX3SGSnbOD2xUalbE5g==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/inflight": { "version": "1.0.6", "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", @@ -17153,6 +17286,16 @@ "node": ">=14" } }, + "node_modules/js-levenshtein": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/js-levenshtein/-/js-levenshtein-1.1.6.tgz", + "integrity": "sha512-X2BB11YZtrRqY4EnQcLX5Rh373zbK4alC1FW7D7MBhL2gtcC17cTnr6DmfHZeS0s2rTHjUTMMHfG7gO8SSdw+g==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/js-sha256": { "version": "0.10.1", "resolved": "https://registry.npmjs.org/js-sha256/-/js-sha256-0.10.1.tgz", @@ -17413,6 +17556,13 @@ "resolved": "https://registry.npmjs.org/lodash.debounce/-/lodash.debounce-4.0.8.tgz", "integrity": "sha512-FT1yDzDYEoYWhnSGnpE/4Kj1fLZkDFyqRb7fNt6FdYOSxlUWAtp42Eh6Wb0rGIv/m9Bgo7x4GhQbm5Ys4SG5ow==" }, + "node_modules/lodash.isequal": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/lodash.isequal/-/lodash.isequal-4.5.0.tgz", + "integrity": "sha512-pDo3lu8Jhfjqls6GkMgpahsF9kCyayhgykjyLMNFTKWrpVdAQtYyB4muAMWozBB4ig/dtWAmsMxLEI8wuz+DYQ==", + "dev": true, + "license": "MIT" + }, "node_modules/lodash.isplainobject": { "version": "4.0.6", "resolved": "https://registry.npmjs.org/lodash.isplainobject/-/lodash.isplainobject-4.0.6.tgz", @@ -19004,6 +19154,52 @@ "integrity": "sha512-AGK2yQKIjRuqnc6VkX2Xj5d+QW8xZ87pa1UK6yA6ouUyuxfHuMP6umE5QK7UmTeOAymo+Zx1Fxiuw9rVx8taHQ==", "dev": true }, + "node_modules/node-fetch": { + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.7.0.tgz", + "integrity": "sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A==", + "dev": true, + "license": "MIT", + "dependencies": { + "whatwg-url": "^5.0.0" + }, + "engines": { + "node": "4.x || >=6.0.0" + }, + "peerDependencies": { + "encoding": "^0.1.0" + }, + "peerDependenciesMeta": { + "encoding": { + "optional": true + } + } + }, + "node_modules/node-fetch/node_modules/tr46": { + "version": "0.0.3", + "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", + "integrity": "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==", + "dev": true, + "license": "MIT" + }, + "node_modules/node-fetch/node_modules/webidl-conversions": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", + "integrity": "sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==", + "dev": true, + "license": "BSD-2-Clause" + }, + "node_modules/node-fetch/node_modules/whatwg-url": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz", + "integrity": "sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==", + "dev": true, + "license": "MIT", + "dependencies": { + "tr46": "~0.0.3", + "webidl-conversions": "^3.0.0" + } + }, "node_modules/node-polyfill-webpack-plugin": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/node-polyfill-webpack-plugin/-/node-polyfill-webpack-plugin-2.0.1.tgz", @@ -19303,6 +19499,71 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/openapi-typescript": { + "version": "7.4.4", + "resolved": "https://registry.npmjs.org/openapi-typescript/-/openapi-typescript-7.4.4.tgz", + "integrity": "sha512-7j3nktnRzlQdlHnHsrcr6Gqz8f80/RhfA2I8s1clPI+jkY0hLNmnYVKBfuUEli5EEgK1B6M+ibdS5REasPlsUw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@redocly/openapi-core": "^1.25.9", + "ansi-colors": "^4.1.3", + "change-case": "^5.4.4", + "parse-json": "^8.1.0", + "supports-color": "^9.4.0", + "yargs-parser": "^21.1.1" + }, + "bin": { + "openapi-typescript": "bin/cli.js" + }, + "peerDependencies": { + "typescript": "^5.x" + } + }, + "node_modules/openapi-typescript/node_modules/parse-json": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-8.1.0.tgz", + "integrity": "sha512-rum1bPifK5SSar35Z6EKZuYPJx85pkNaFrxBK3mwdfSJ1/WKbYrjoW/zTPSjRRamfmVX1ACBIdFAO0VRErW/EA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/code-frame": "^7.22.13", + "index-to-position": "^0.1.2", + "type-fest": "^4.7.1" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/openapi-typescript/node_modules/supports-color": { + "version": "9.4.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-9.4.0.tgz", + "integrity": "sha512-VL+lNrEoIXww1coLPOmiEmK/0sGigko5COxI09KzHc2VJXJsQ37UaQ+8quuxjDeA7+KnLGTWRyOXSLLR2Wb4jw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/supports-color?sponsor=1" + } + }, + "node_modules/openapi-typescript/node_modules/type-fest": { + "version": "4.30.0", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-4.30.0.tgz", + "integrity": "sha512-G6zXWS1dLj6eagy6sVhOMQiLtJdxQBHIA9Z6HFUNLOlr6MFOgzV8wvmidtPONfPtEUv0uZsy77XJNzTAfwPDaA==", + "dev": true, + "license": "(MIT OR CC0-1.0)", + "engines": { + "node": ">=16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/optionator": { "version": "0.9.4", "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.4.tgz", @@ -19722,6 +19983,16 @@ "node": ">=8" } }, + "node_modules/pluralize": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/pluralize/-/pluralize-8.0.0.tgz", + "integrity": "sha512-Nc3IT5yHzflTfbjgqWcCPpo7DaKy4FnpB0l/zCAW0Tc7jxAiuqSxHasntB3D7887LSrA93kDJ9IXovxJYxyLCA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=4" + } + }, "node_modules/pnp-webpack-plugin": { "version": "1.7.0", "resolved": "https://registry.npmjs.org/pnp-webpack-plugin/-/pnp-webpack-plugin-1.7.0.tgz", @@ -24007,6 +24278,13 @@ "punycode": "^2.1.0" } }, + "node_modules/uri-js-replace": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/uri-js-replace/-/uri-js-replace-1.0.1.tgz", + "integrity": "sha512-W+C9NWNLFOoBI2QWDp4UT9pv65r2w5Cx+3sTYFvtMdDBxkKt1syCqsUdSFAChbEe1uK5TfS04wt/nGwmaeIQ0g==", + "dev": true, + "license": "MIT" + }, "node_modules/url": { "version": "0.11.4", "resolved": "https://registry.npmjs.org/url/-/url-0.11.4.tgz", @@ -25065,6 +25343,13 @@ "node": ">= 6" } }, + "node_modules/yaml-ast-parser": { + "version": "0.0.43", + "resolved": "https://registry.npmjs.org/yaml-ast-parser/-/yaml-ast-parser-0.0.43.tgz", + "integrity": "sha512-2PTINUwsRqSd+s8XxKaJWQlUuEMHJQyEuh2edBbW8KNJz0SJPwUSD2zRWqezFEdN7IzAgeuYHFUCF7o8zRdZ0A==", + "dev": true, + "license": "Apache-2.0" + }, "node_modules/yargs": { "version": "17.7.2", "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.7.2.tgz", diff --git a/package.json b/package.json index 877a6896..458117cb 100644 --- a/package.json +++ b/package.json @@ -15,7 +15,8 @@ "storybook": "storybook dev -p 6006", "build-storybook": "storybook build", "prechromatic": "npm run build-storybook", - "chromatic": "npx chromatic --project-token=$CHROMATIC_PROJECT_TOKEN" + "chromatic": "npx chromatic --project-token=$CHROMATIC_PROJECT_TOKEN", + "code-gen": "npx openapi-typescript https://api.picktoss.com:444/v3/api-docs -o ./src/types/schema.d.ts" }, "dependencies": { "@amplitude/analytics-browser": "^2.9.3", @@ -109,6 +110,7 @@ "eslint-plugin-storybook": "^0.10.1", "eslint-plugin-tailwindcss": "^3.15.1", "husky": "^9.0.11", + "openapi-typescript": "^7.4.4", "postcss": "^8", "storybook": "^8.3.6", "tailwindcss": "^3.3.0", diff --git a/src/app/(routes)/document/(main)/@header/default.tsx b/src/app/(routes)/document/(main)/@header/default.tsx index 4592f4c2..75f80a59 100644 --- a/src/app/(routes)/document/(main)/@header/default.tsx +++ b/src/app/(routes)/document/(main)/@header/default.tsx @@ -76,7 +76,7 @@ export default Header interface Props { isDrawerOpen: boolean setIsDrawerOpen: (value: boolean) => void - directories: Directory.List + directories: Directory.Item[] } const DirectorySelectDrawer = ({ isDrawerOpen, setIsDrawerOpen, directories }: Props) => { diff --git a/src/features/directory/contexts/directory-context.tsx b/src/features/directory/contexts/directory-context.tsx index 67615f84..1157da13 100644 --- a/src/features/directory/contexts/directory-context.tsx +++ b/src/features/directory/contexts/directory-context.tsx @@ -4,7 +4,7 @@ import { useDirectories } from '@/requests/directory/hooks' import { PropsWithChildren, createContext, useContext, useMemo, useState } from 'react' interface DirectoryContextValues { - directories: Directory.List + directories: Directory.Item[] selectedDirectory: Directory.Item | null selectedDirectoryId: number | null diff --git a/src/types/collection.d.ts b/src/types/collection.d.ts index a508d8e7..a931ecbf 100644 --- a/src/types/collection.d.ts +++ b/src/types/collection.d.ts @@ -1,3 +1,6 @@ +import { DeepRequired } from 'react-hook-form' +import { components, paths } from './schema' + // Common Types type CollectionField = | 'IT' @@ -11,216 +14,97 @@ type CollectionField = | 'HISTORY_PHILOSOPHY' | 'OTHER' -type QuizType = 'MIX_UP' | 'MULTIPLE_CHOICE' - -type BaseQuiz = { - id: number - quizType: QuizType - question: string - answer: string - explanation: string - options?: string[] -} - -type Collection = { - id: number - name: string - description: string - emoji: string - bookmarkCount: number - collectionCategory: string - solvedMemberCount: number - bookmarked: boolean - member: { - creatorId: number - creatorName: string - } -} - -type CollectionWithQuizzes = Collection & { - quizzes: BaseQuiz[] -} - -type CollectionQuizResult = { - quizId: number - elapsedTimeMs: number - isAnswer: boolean - choseAnswer: string -} - -type AnsweredQuiz = BaseQuiz & { - choseAnswer: string -} - -/** GET /api/v2/collections */ -interface AllCollectionsResponse { - collections: Collection[] -} - -/** GET /api/v2/collections/{keyword} */ -interface KeywordCollectionsResponse { - collections: Collection[] -} - -/** GET /api/v2/collections/{collection_id}/record */ -interface CollectionRecordResponse { - createdAt: string - elapsedTime: number - quizzes: AnsweredQuiz[] -} - -/** GET /api/v2/collections/{collection_id}/collection_info */ -type CollectionInfoResponse = CollectionWithQuizzes - -/** GET /api/v2/collections/my-collections */ -interface MyCollectionsResponse { - collections: Collection[] -} - -/** GET /api/v2/collections/interest-field-collection */ -interface InterestFieldCollectionsResponse { - collections: Collection[] -} - -/** GET /api/v2/collections/bookmarked-collections */ -interface BookmarkedCollectionsResponse { - collections: Collection[] -} - -/** GET /api/v2/collections-analysis */ -interface CollectionAnalysisResponse { - collectionsAnalysis: { - additionalProp1: number - additionalProp2: number - additionalProp3: number - } -} - -/** POST /api/v2/collections/{collection_id}/collection-quizzes */ -interface StartCollectionQuizResponse { - quizSetId: string - createdAt: string -} - -/** PATCH /api/v2/collections/{collection_id}/update-quizzes */ -interface UpdateCollectionQuizzesPayload { - quizzes: number[] -} - -/** PATCH /api/v2/collections/{collection_id}/update-info */ -interface UpdateCollectionInfoPayload { - name: string - emoji: string - description: string - collectionField: CollectionField -} - -/** PATCH /api/v2/collections/{collection_id}/update-collection-result */ -interface UpdateCollectionResultPayload { - collectionQuizzes: CollectionQuizResult[] -} - -/** PATCH /api/v2/collection/{collection_id}/add-quiz */ -interface AddQuizPayload { - quizId: number -} - -/** POST /api/v2/collections */ -interface CreateCollectionPayload { - name: string - emoji: string - description: string - collectionField: CollectionField - quizzes: number[] -} - -interface CreateBookmark { - collectionId: number -} - -declare namespace Collection { - type Item = Collection - type List = Collection[] - type QuizResult = CollectionQuizResult - type AnsweredQuiz = AnsweredQuiz - type Field = CollectionField - - declare namespace Request { - /** PATCH /api/v2/collections/{collection_id}/update-quizzes - * 컬렉션 문제 편집 - */ - type UpdateQuizzes = UpdateCollectionQuizzesPayload - - /** PATCH /api/v2/collections/{collection_id}/update-info - * 컬렉션 정보 수정 - */ - type UpdateInfo = UpdateCollectionInfoPayload - - /** PATCH /api/v2/collections/{collection_id}/update-collection-result - * 컬렉션을 풀었을 때 결과 업데이트 - */ - type UpdateCollectionResult = UpdateCollectionResultPayload - - /** PATCH /api/v2/collection/{collection_id}/add-quiz - * 컬렉션에 퀴즈 추가 - */ - type AddQuiz = AddQuizPayload - - /** POST /api/v2/collections - * 컬렉션 생성 - */ - type CreateCollection = CreateCollectionPayload - - /** POST /api/v2/collections/{collection_id}/create-bookmark - * 컬렉션 북마크하기 - */ - type Bookmark = CreateBookmark - } - - declare namespace Response { - /** GET /api/v2/collections - * 모든 컬렉션 가져오기(탐색) - */ - type GetAllCollections = AllCollectionsResponse - - /** GET /api/v2/collections/{keyword} - * 컬렉션 검색하기 - */ - type GetCollectionsByKeyword = KeywordCollectionsResponse - - /** GET /api/v2/collections/{collection_id}/record - * 퀴즈를 푼 컬렉션의 상세 기록 - */ - type GetCollectionRecord = CollectionRecordResponse - - /** GET /api/v2/collections/{collection_id}/collection_info - * 만든 컬렉션 상세 정보 가져오기 - */ - type GetCollectionInfo = CollectionInfoResponse - - /** GET /api/v2/collections/my-collections - * 직접 생성한 컬렉션 가져오기 - */ - type GetMyCollections = MyCollectionsResponse - - /** GET /api/v2/collections/interest-field-collection - * 사용자 관심 분야 컬렉션 가져오기 - */ - type GetInterestFieldCollections = InterestFieldCollectionsResponse - - /** GET /api/v2/collections/bookmarked-collections - * 북마크한 컬렉션 가져오기 - */ - type GetBookmarkedCollections = BookmarkedCollectionsResponse - - /** GET /api/v2/collections-analysis - * 컬렉션 분석 - */ - type GetCollectionsAnalysis = CollectionAnalysisResponse - - /** POST /api/v2/collections - * 컬렉션 생성 - */ - type CreateCollection = Collection +declare global { + declare namespace Collection { + type Item = DeepRequired + type Field = CollectionField + + declare namespace Request { + /** PATCH /api/v2/collections/{collection_id}/update-quizzes + * 컬렉션 문제 편집 + */ + type UpdateQuizzes = DeepRequired< + paths['/api/v2/collections/{collection_id}/update-quizzes']['patch']['requestBody']['content']['application/json;charset=UTF-8'] + > + + /** PATCH /api/v2/collections/{collection_id}/update-info + * 컬렉션 정보 수정 + */ + type UpdateInfo = DeepRequired< + paths['/api/v2/collections/{collection_id}/update-info']['patch']['requestBody']['content']['application/json;charset=UTF-8'] + > + + /** PATCH /api/v2/collection/{collection_id}/add-quiz + * 컬렉션에 퀴즈 추가 + */ + type AddQuiz = DeepRequired< + paths['/api/v2/collection/{collection_id}/add-quiz']['patch']['requestBody']['content']['application/json;charset=UTF-8'] + > + + /** POST /api/v2/collections + * 컬렉션 생성 + */ + type CreateCollection = DeepRequired< + paths['/api/v2/collections']['post']['requestBody']['content']['application/json;charset=UTF-8'] + > + } + + declare namespace Response { + /** GET /api/v2/collections + * 모든 컬렉션 가져오기(탐색) + */ + type GetAllCollections = DeepRequired< + paths['/api/v2/collections']['get']['responses']['200']['content']['application/json;charset=UTF-8'] + > + + /** GET /api/v2/collections/{keyword} + * 컬렉션 검색하기 + */ + type GetCollectionsByKeyword = DeepRequired< + paths['/api/v2/collections/{keyword}']['get']['responses']['200']['content']['application/json;charset=UTF-8'] + > + + /** GET /api/v2/collections/{collection_id}/info + * 만든 컬렉션 상세 정보 가져오기 + */ + type GetCollectionInfo = DeepRequired< + paths['/api/v2/collections/{collection_id}/info']['get']['responses']['200']['content']['application/json;charset=UTF-8'] + > + + /** GET /api/v2/collections/my-collections + * 직접 생성한 컬렉션 가져오기 + */ + type GetMyCollections = DeepRequired< + paths['/api/v2/collections/my-collections']['get']['responses']['200']['content']['application/json;charset=UTF-8'] + > + + /** GET /api/v2/collections/interest-category-collection + * 사용자 관심 분야 컬렉션 가져오기 + */ + type GetInterestFieldCollections = DeepRequired< + paths['/api/v2/collections/interest-category-collection']['get']['responses']['200']['content']['application/json;charset=UTF-8'] + > + + /** GET /api/v2/collections/bookmarked-collections + * 북마크한 컬렉션 가져오기 + */ + type GetBookmarkedCollections = DeepRequired< + paths['/api/v2/collections/bookmarked-collections']['get']['responses']['200']['content']['application/json;charset=UTF-8'] + > + + /** GET /api/v2/collections-analysis + * 컬렉션 분석 + */ + type GetCollectionsAnalysis = DeepRequired< + paths['/api/v2/collections-analysis']['get']['responses']['200']['content']['application/json;charset=UTF-8'] + > + + /** POST /api/v2/collections + * 컬렉션 생성 + */ + type CreateCollection = DeepRequired< + paths['/api/v2/collections']['post']['responses']['201']['content']['application/json;charset=UTF-8'] + > + } } } diff --git a/src/types/directory.d.ts b/src/types/directory.d.ts index d9f619b4..66bbc11e 100644 --- a/src/types/directory.d.ts +++ b/src/types/directory.d.ts @@ -1,59 +1,47 @@ -interface DirectoryItem { - id: number - name: string - tag: string - emoji: string - documentCount: number -} - -interface CreateDirectoryPayload { - name: string - emoji: string -} - -interface UpdateDirectoryInfoPayload { - name: string - emoji: string -} - -interface GetDirectoriesResponse { - directories: DirectoryItem[] -} - -interface GetDirectoryResponse { - directories: DirectoryItem -} - -declare namespace Directory { - type Item = DirectoryItem - type List = DirectoryItem[] - - declare namespace Request { - /** POST /api/v2/directories - * 디렉토리 생성 - */ - type CreateDirectory = CreateDirectoryPayload - - /** PATCH /api/v2/directories/{directory_id}/update-info - * 디렉토리 정보 변경 - */ - type UpdateDirectoryInfo = UpdateDirectoryInfoPayload - } - - declare namespace Response { - /** GET /api/v2/directories - * 모든 디렉토리 가져오기 - */ - type GetDirectories = GetDirectoriesResponse - - /** GET /api/v2/directories/{directory_id} - * directory_id로 디렉토리 가져오기 - */ - type GetDirectory = GetDirectoryResponse - - /** POST /api/v2/directories - * 디렉토리 생성 - */ - type CreateDirectory = DirectoryItem['id'] +import { DeepRequired } from 'react-hook-form' +import { components, paths } from './schema' + +declare global { + declare namespace Directory { + type Item = DeepRequired + + declare namespace Request { + /** POST /api/v2/directories + * 디렉토리 생성 + */ + type CreateDirectory = DeepRequired< + paths['/api/v2/directories']['post']['requestBody']['content']['application/json;charset=UTF-8'] + > + + /** PATCH /api/v2/directories/{directory_id}/update-info + * 디렉토리 정보 변경 + */ + type UpdateDirectoryInfo = DeepRequired< + paths['/api/v2/directories/{directory_id}/update-info']['patch']['requestBody']['content']['application/json;charset=UTF-8'] + > + } + + declare namespace Response { + /** GET /api/v2/directories + * 모든 디렉토리 가져오기 + */ + type GetDirectories = DeepRequired< + paths['/api/v2/directories']['get']['responses']['200']['content']['application/json;charset=UTF-8'] + > + + /** GET /api/v2/directories/{directory_id} + * directory_id로 디렉토리 가져오기 + */ + type GetDirectory = DeepRequired< + paths['/api/v2/directories/{directory_id}']['get']['responses']['200']['content']['application/json;charset=UTF-8'] + > + + /** POST /api/v2/directories + * 디렉토리 생성 + */ + type CreateDirectory = DeepRequired< + paths['/api/v2/directories']['post']['responses']['201']['content']['application/json;charset=UTF-8'] + > + } } } diff --git a/src/types/document.d.ts b/src/types/document.d.ts index 6269518d..9f60cccc 100644 --- a/src/types/document.d.ts +++ b/src/types/document.d.ts @@ -1,3 +1,6 @@ +import { DeepRequired } from 'react-hook-form' +import { components, paths } from './schema' + type DirectoryInDocument = Pick & { emoji?: string } type SortOption = 'CREATED_AT' | 'UPDATED_AT' @@ -85,209 +88,108 @@ type SearchedCollection = { quizCount: number } -/** GET /api/v2/documents/{document_id} */ -interface DocumentResponse { - document: DocumentItem -} - -/** GET /api/v2/documents/review-need-documents */ -interface ReviewNeedDocumentsResponse { - documents: { - id: number - name: string - reviewNeededQuizCount: number - directory: DirectoryInDocument - }[] -} - -/** GET /api/v2/directories/documents */ -interface AllDocumentsResponse { - documents: DocumentItem[] -} - -/** PATCH /api/v2/documents/{document_id}/update-name */ -interface UpdateDocumentNamePayload { - name: string -} - -/** PATCH /api/v2/documents/{document_id}/update-content */ -interface UpdateDocumentContentPayload { - name: string - file: File -} - -/** PATCH /api/v2/documents/today-quiz-settings */ -interface UpdateTodayQuizSettingsPayload { - documentIdTodayQuizMap: { - additionalProp1: boolean - additionalProp2: boolean - additionalProp3: boolean - } -} - -/** PATCH /api/v2/documents/move */ -interface MoveDocumentPayload { - documentIds: number[] - directoryId: number | null -} - -/** DELETE /api/v2/documents/delete-documents - * 여러 문서 id를 리스트 형태로 delete의 body로 보내고 있습니다 - */ -interface DeleteDocumentPayload { - documentIds: number[] -} - -/** POST /api/v2/integrated-search */ -interface IntegratedSearchPayload { - keyword: string -} -interface IntegratedSearchResponse { - documents: SearchedDocument[] - quizzes: SearchedQuiz[] - collections: SearchedCollection[] -} - -/** POST /api/v2/documents */ -interface CreateDocumentPayload { - file: string - documentType: CreateType - directoryId: number - documentName: string - star: number - quizType: QuizType -} -interface CreateDocumentResponse { - id: number -} - -/** POST /api/v2/documents/search */ -interface SearchDocumentsPayload { - keyword: string -} -interface SearchDocumentsResponse { - documents: SearchedDocument[] - quizzes: SearchedQuiz[] -} - -declare namespace Document { - type DetailItem = DocumentDetailItem - type ItemInList = DocumentListItem - type List = DocumentListItem[] - type Status = DocumentStatus - type Sort = SortOption - - declare namespace Request { - /** GET /api/v2/documents/{document_id} - * document_id로 문서 가져오기 - */ - type GetDocument = void - - /** GET /api/v2/documents/review-need-documents - * 복습 필수 노트 top 5 - */ - type GetReviewNeedDocuments = void - - /** GET /api/v2/directories/documents - * 모든 문서 가져오기 - */ - type GetAllDocuments = void - - /** PATCH /api/v2/documents/{document_id}/update-name - * 문서 이름 변경 - */ - type UpdateName = UpdateDocumentNamePayload - - /** PATCH /api/v2/documents/{document_id}/update-content - * 문서 내용 업데이트 - */ - type UpdateContent = UpdateDocumentContentPayload - - /** PATCH /api/v2/documents/today-quiz-settings - * 오늘의 퀴즈 관리(문제를 가져올 노트 선택) - */ - type UpdateTodayQuizSettings = UpdateTodayQuizSettingsPayload - - /** PATCH /api/v2/documents/move - * 문서 다른 폴더로 옮기기 - */ - type MoveDocument = MoveDocumentPayload - - /** POST /api/v2/integrated-search - * 통합(문서, 컬렉션, 퀴즈) 검색 - */ - type IntegratedSearch = IntegratedSearchPayload - - /** POST /api/v2/documents - * 문서 생성 - */ - type CreateDocument = CreateDocumentPayload - - /** POST /api/v2/documents/search - * 문서 검색 - */ - type SearchDocuments = SearchDocumentsPayload - - /** DELETE /api/v2/documents/delete-documents - * 문서 삭제 - */ - type DeleteDocuments = DeleteDocumentPayload - } - - declare namespace Response { - /** GET /api/v2/documents/{document_id} - * document_id로 문서 가져오기 - */ - type GetDocument = DocumentResponse - - /** GET /api/v2/documents/review-need-documents - * 복습 필수 노트 top 5 - */ - type GetReviewNeedDocuments = ReviewNeedDocumentsResponse - - /** GET /api/v2/directories/documents - * 모든 문서 가져오기 - */ - type GetAllDocuments = AllDocumentsResponse - - /** PATCH /api/v2/documents/{document_id}/update-name - * 문서 이름 변경 - */ - type UpdateName = void - - /** PATCH /api/v2/documents/{document_id}/update-content - * 문서 내용 업데이트 - */ - type UpdateContent = void - - /** PATCH /api/v2/documents/today-quiz-settings - * 오늘의 퀴즈 관리(문제를 가져올 노트 선택) - */ - type UpdateTodayQuizSettings = void - - /** PATCH /api/v2/documents/move - * 문서 다른 폴더로 옮기기 - */ - type MoveDocument = void - - /** POST /api/v2/integrated-search - * 통합(문서, 컬렉션, 퀴즈) 검색 - */ - type IntegratedSearch = IntegratedSearchResponse - - /** POST /api/v2/documents - * 문서 생성 - */ - type CreateDocument = CreateDocumentResponse - - /** POST /api/v2/documents/search - * 문서 검색 - */ - type SearchDocuments = SearchDocumentsResponse - - /** DELETE /api/v2/documents/delete-documents - * 문서 삭제 (여러 문서 id를 리스트 형태로 delete의 body로 보내고 있습니다) - */ - type DeleteDocuments = void +declare global { + declare namespace Document { + type DetailItem = DocumentDetailItem + type ItemInList = DocumentListItem + type List = DocumentListItem[] + type Status = DocumentStatus + type Sort = SortOption + + declare namespace Request { + /** PATCH /api/v2/documents/{document_id}/update-name + * 문서 이름 변경 + */ + type UpdateName = DeepRequired< + paths['/api/v2/documents/{document_id}/update-name']['patch']['requestBody']['content']['application/json;charset=UTF-8'] + > + + /** PATCH /api/v2/documents/{document_id}/update-content + * 문서 내용 업데이트 + */ + type UpdateContent = DeepRequired + + /** PATCH /api/v2/documents/today-quiz-settings + * 오늘의 퀴즈 관리(문제를 가져올 노트 선택) + */ + type UpdateTodayQuizSettings = DeepRequired< + paths['/api/v2/documents/today-quiz-settings']['patch']['requestBody']['content']['application/json;charset=UTF-8'] + > + + /** PATCH /api/v2/documents/move + * 문서 다른 폴더로 옮기기 + */ + type MoveDocument = DeepRequired< + paths['/api/v2/documents/move']['patch']['requestBody']['content']['application/json;charset=UTF-8'] + > + + /** POST /api/v2/integrated-search + * 통합(문서, 컬렉션, 퀴즈) 검색 + */ + type IntegratedSearch = DeepRequired< + paths['/api/v2/integrated-search']['post']['requestBody']['content']['application/json;charset=UTF-8'] + > + + /** POST /api/v2/documents + * 문서 생성 + */ + type CreateDocument = DeepRequired + + /** POST /api/v2/documents/search + * 문서 검색 + */ + type SearchDocuments = DeepRequired< + paths['/api/v2/documents/search']['post']['requestBody']['content']['application/json;charset=UTF-8'] + > + + /** DELETE /api/v2/documents/delete-documents + * 문서 삭제 + */ + type DeleteDocuments = DeepRequired< + paths['/api/v2/documents/delete-documents']['delete']['requestBody']['content']['application/json;charset=UTF-8'] + > + } + + declare namespace Response { + /** GET /api/v2/documents/{document_id} + * document_id로 문서 가져오기 + */ + type GetDocument = DeepRequired< + paths['/api/v2/documents/{document_id}']['get']['responses']['200']['content']['application/json;charset=UTF-8'] + > + + /** GET /api/v2/documents/review-need-documents + * 복습 필수 노트 top 5 + */ + type GetReviewNeedDocuments = DeepRequired< + paths['/api/v2/documents/review-need-documents']['get']['responses']['200']['content']['application/json;charset=UTF-8'] + > + + /** GET /api/v2/directories/documents + * 모든 문서 가져오기 + */ + type GetAllDocuments = DeepRequired< + paths['/api/v2/directories/documents']['get']['responses']['200']['content']['application/json;charset=UTF-8'] + > + + /** POST /api/v2/integrated-search + * 통합(문서, 컬렉션, 퀴즈) 검색 + */ + type IntegratedSearch = DeepRequired< + paths['/api/v2/integrated-search']['post']['responses']['200']['content']['application/json;charset=UTF-8'] + > + + /** POST /api/v2/documents + * 문서 생성 + */ + type CreateDocument = DeepRequired + + /** POST /api/v2/documents/search + * 문서 검색 + */ + type SearchDocuments = DeepRequired< + paths['/api/v2/documents/search']['post']['responses']['200']['content']['application/json;charset=UTF-8'] + > + } } } diff --git a/src/types/quiz.d.ts b/src/types/quiz.d.ts index b9c78001..07d2dfc4 100644 --- a/src/types/quiz.d.ts +++ b/src/types/quiz.d.ts @@ -1,3 +1,6 @@ +import { DeepRequired } from 'react-hook-form' +import { paths } from './schema' + type QuizSetType = 'DOCUMENT_QUIZ_SET' | 'TODAY_QUIZ_SET' | 'COLLECTION_QUIZ_SET' | 'FIRST_QUIZ_SET' type QuizItem = { @@ -56,200 +59,130 @@ type QuizSetRecord = { solvedDate: string } -/** GET /api/v2/today-quiz-info */ -interface TodayQuizInfoResponse extends ConsecutiveDays {} - -/** GET /api/v2/quizzes/{quiz_set_id}/{quiz_set_type}/quiz-record */ -interface QuizSetRecordResponse { - createdAt: string - totalElapsedTimeMs: number - quizzes: QuizRecord[] -} - -/** GET /api/v2/quizzes/quiz-records */ -interface QuizRecordsResponse extends ConsecutiveDays { - quizRecords: QuizSetRecord[] -} - -/** GET /api/v2/quiz-sets/{quiz_set_id} */ -interface BaseQuizSetResponse { - quizzes: QuizWithMetadata[] - collectionName?: string -} - -/** GET /api/v2/quiz-sets/today */ -interface TodayQuizSetResponse { - quizSetId: string - createdAt?: string - type: 'READY' | 'NOT_READY' | 'DONE' -} - -/** GET /api/v2/quiz-analysis */ -interface QuizAnalysisResponse { - totalElapsedTime: number - quizzes: { - date: string - quizCount: number - incorrectAnswerCount: number - }[] -} - -/** GET /api/v2/documents/{document_id}/review-pick */ -interface ReviewPickResponse { - quizzes: { - id: number - question: string - answer: string - explanation: string - options: string[] - quizType: QuizType - description: string - }[] -} - -/** GET /api/v2/documents/{document_id}/quizzes */ -interface DocumentQuizzesResponse { - quizzes: QuizWithMetadata[] -} - -/** GET /api/v2/documents/{document_id}/download-quiz */ -type DownloadQuizResponse = string[] - -/** GET /api/v2/incorrect-quizzes */ -type WrongAnswerQuizzesResponse = { - quizzes: QuizWithMetadata[] -} - -/** PATCH /api/v2/quiz/result */ -interface UpdateQuizResultPayload { - quizSetId: string - quizzes: { - id: number - answer: boolean - choseAnswer: string - elapsedTime: number - }[] -} -interface UpdateQuizResultResponse { - reward: number - currentConsecutiveTodayQuizDate: number -} - -/** PATCH /api/v2/wrong-quiz/result */ -interface UpdateWrongQuizResultPayload { - quizzes: { - id: number - answer: boolean - }[] -} - -/** POST /api/v2/quizzes/documents/{document_id}/custom-quiz-set */ -interface CreateReplayQuizSetPayload { - quizType: ReplayQuizType - quizCount: number -} - -/** GET /api/v2/directories/{directory_id}/quizzes */ -interface GetDirectoryQuizzesResponse { - quizzes: QuizWithMetadata[] -} - -/** POST /api/v2/quizzes/documents/{document_id}/check-quiz-set */ -interface CreateQuizSetResponse { - quizSetId: string - createdAt: string -} - -declare namespace Quiz { - type Item = QuizItem - type List = QuizItem[] - type ItemWithMetadata = QuizWithMetadata - type ItemWithCategory = QuizWithCategory - type Type = QuizType - type Record = QuizRecord - type Result = UpdateQuizResultPayload['quizzes'][number] - - declare namespace Request { - /** PATCH /api/v2/quiz/result - * 퀴즈 결과 업데이트 - */ - type UpdateQuizResult = UpdateQuizResultPayload - - /** POST /api/v2/quizzes/documents/{document_id}/custom-quiz-set - * 사용자가 생성한 기존 문서에서 직접 퀴즈 세트 생성(랜덤, OX, 객관식) - 다시풀기 세트 만들기 - */ - type CreateReplayQuizSet = CreateReplayQuizSetPayload - - /** PATCH /api/v2/wrong-quiz/result - * 오답 터뜨리기 결과 업데이트 - */ - type UpdateWrongQuizResult = UpdateWrongQuizResultPayload - } - - declare namespace Response { - /** GET /api/v2/today-quiz-info - * 오늘의 퀴즈 현황 - */ - type GetTodayInfo = TodayQuizInfoResponse - - /** GET /api/v2/quizzes/{quiz_set_id}/{quiz_set_type}/quiz-record - * 퀴즈 세트에 대한 상세 기록 - */ - type GetQuizSetRecord = QuizSetRecordResponse - - /** GET /api/v2/quizzes/quiz-records - * 전체 퀴즈 기록 - */ - type GetQuizRecords = QuizRecordsResponse - - /** GET /api/v2/quiz-sets/{quiz_set_id} - * quizSet-type과 quizSet_id로 퀴즈 세트 가져오기 - */ - type GetBaseQuizSet = BaseQuizSetResponse - - /** GET /api/v2/quiz-sets/today - * 오늘의 퀴즈 세트 정보 가져오기 - */ - type GetTodayQuizSet = TodayQuizSetResponse - - /** GET /api/v2/quiz-analysis - * 퀴즈 분석 - */ - type GetQuizAnalysis = QuizAnalysisResponse - - /** GET /api/v2/documents/{document_id}/review-pick - * document_id로 복습 pick 가져오기 - */ - type GetReviewPick = ReviewPickResponse - - /** GET /api/v2/documents/{document_id}/quizzes - * document_id에 해당하는 모든 퀴즈 가져오기 - */ - type GetDocumentQuizzes = DocumentQuizzesResponse - - /** GET /api/v2/directories/{directory_id}/quizzes - * 디렉토리에 생성된 모든 퀴즈 랜덤하게 가져오기 - */ - type GetDirectoryQuizzes = GetDirectoryQuizzesResponse - - /** GET /api/v2/documents/{document_id}/download-quiz - * 퀴즈 다운로드 - */ - type DownloadQuiz = DownloadQuizResponse - - /** GET /api/v2/incorrect-quizzes - * 오답 터뜨리기 퀴즈 가져오기 - */ - type GetWrongAnswerQuizzes = WrongAnswerQuizzesResponse - - /** PATCH /api/v2/quiz/result - * 퀴즈 결과 업데이트 - */ - type UpdateQuizResult = UpdateQuizResultResponse - - /** POST /api/v2/quizzes/documents/{document_id}/check-quiz-set - * 퀴즈 생성 후 퀴즈 오류 확인을 위한 퀴즈 세트 생성 - */ - type CreateQuizSet = CreateQuizSetResponse +declare global { + declare namespace Quiz { + type Item = QuizItem + type List = QuizItem[] + type ItemWithMetadata = QuizWithMetadata + type ItemWithCategory = QuizWithCategory + type Type = QuizType + type Record = QuizRecord + type Result = UpdateQuizResultPayload['quizzes'][number] + + declare namespace Request { + /** PATCH /api/v2/quiz/result + * 퀴즈 결과 업데이트 + */ + type UpdateQuizResult = DeepRequired< + paths['/api/v2/quiz/result']['patch']['requestBody']['content']['application/json;charset=UTF-8'] + > + + /** POST /api/v2/quizzes/documents/{document_id}/custom-quiz-set + * 사용자가 생성한 기존 문서에서 직접 퀴즈 세트 생성(랜덤, OX, 객관식) - 다시풀기 세트 만들기 + */ + type CreateReplayQuizSet = DeepRequired< + paths['/api/v2/quizzes/documents/{document_id}/custom-quiz-set']['post']['requestBody']['content']['application/json;charset=UTF-8'] + > + + /** PATCH /api/v2/wrong-quiz/result + * 오답 터뜨리기 결과 업데이트 + */ + type UpdateWrongQuizResult = DeepRequired< + paths['/api/v2/wrong-quiz/result']['patch']['requestBody']['content']['application/json;charset=UTF-8'] + > + } + + declare namespace Response { + /** GET /api/v2/today-quiz-info + * 오늘의 퀴즈 현황 + */ + type GetTodayInfo = DeepRequired< + paths['/api/v2/today-quiz-info']['get']['responses']['200']['content']['application/json;charset=UTF-8'] + > + + /** GET /api/v2/quizzes/{quiz_set_id}/{quiz_set_type}/quiz-record + * 퀴즈 세트에 대한 상세 기록 + */ + type GetQuizSetRecord = DeepRequired< + paths['/api/v2/quizzes/{quiz_set_id}/{quiz_set_type}/quiz-record']['get']['responses']['200']['content']['application/json;charset=UTF-8'] + > + + /** GET /api/v2/quizzes/quiz-records + * 전체 퀴즈 기록 + */ + type GetQuizRecords = DeepRequired< + paths['/api/v2/quizzes/quiz-records']['get']['responses']['200']['content']['application/json;charset=UTF-8'] + > + + /** GET /api/v2/quiz-sets/{quiz_set_id} + * quizSet-type과 quizSet_id로 퀴즈 세트 가져오기 + */ + type GetBaseQuizSet = DeepRequired< + paths['/api/v2/quiz-sets/{quiz_set_id}']['get']['responses']['200']['content']['application/json;charset=UTF-8'] + > + + /** GET /api/v2/quiz-sets/today + * 오늘의 퀴즈 세트 정보 가져오기 + */ + type GetTodayQuizSet = DeepRequired< + paths['/api/v2/quiz-sets/today']['get']['responses']['200']['content']['application/json;charset=UTF-8'] + > + + /** GET /api/v2/quiz-analysis + * 퀴즈 분석 + */ + type GetQuizAnalysis = DeepRequired< + paths['/api/v2/quiz-analysis']['get']['responses']['200']['content']['application/json;charset=UTF-8'] + > + + /** GET /api/v2/documents/{document_id}/review-pick + * document_id로 복습 pick 가져오기 + */ + type GetReviewPick = DeepRequired< + paths['/api/v2/documents/{document_id}/review-pick']['get']['responses']['200']['content']['application/json;charset=UTF-8'] + > + + /** GET /api/v2/documents/{document_id}/quizzes + * document_id에 해당하는 모든 퀴즈 가져오기 + */ + type GetDocumentQuizzes = DeepRequired< + paths['/api/v2/documents/{document_id}/quizzes']['get']['responses']['200']['content']['application/json;charset=UTF-8'] + > + + /** GET /api/v2/directories/{directory_id}/quizzes + * 디렉토리에 생성된 모든 퀴즈 랜덤하게 가져오기 + */ + type GetDirectoryQuizzes = DeepRequired< + paths['/api/v2/directories/{directory_id}/quizzes']['get']['responses']['200']['content']['application/json;charset=UTF-8'] + > + + /** GET /api/v2/documents/{document_id}/download-quiz + * 퀴즈 다운로드 + */ + type DownloadQuiz = DeepRequired< + paths['/api/v2/documents/{document_id}/download-quiz']['get']['responses']['200']['content']['application/json;charset=UTF-8'] + > + + /** GET /api/v2/incorrect-quizzes + * 오답 터뜨리기 퀴즈 가져오기 + */ + type GetWrongAnswerQuizzes = DeepRequired< + paths['/api/v2/incorrect-quizzes']['get']['responses']['200']['content']['application/json;charset=UTF-8'] + > + + /** PATCH /api/v2/quiz/result + * 퀴즈 결과 업데이트 + */ + type UpdateQuizResult = DeepRequired< + paths['/api/v2/quiz/result']['patch']['responses']['200']['content']['application/json;charset=UTF-8'] + > + + /** POST /api/v2/quizzes/documents/{document_id}/check-quiz-set + * 퀴즈 생성 후 퀴즈 오류 확인을 위한 퀴즈 세트 생성 + */ + type CreateQuizSet = DeepRequired< + paths['/api/v2/quizzes/documents/{document_id}/check-quiz-set']['post']['responses']['201']['content']['application/json;charset=UTF-8'] + > + } } } diff --git a/src/types/schema.d.ts b/src/types/schema.d.ts new file mode 100644 index 00000000..8b3f709f --- /dev/null +++ b/src/types/schema.d.ts @@ -0,0 +1,4300 @@ +/** + * This file was auto-generated by openapi-typescript. + * Do not make direct changes to the file. + */ + +export interface paths { + "/api/v2/tokens": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + get?: never; + put?: never; + /** Fcm token 저장 */ + post: operations["saveFcmToken"]; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/api/v2/test/create-today-quiz": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + get?: never; + put?: never; + /** 오늘의 퀴즈 생성 API(테스트 혹은 예외처리를 위한 API로서 실제 사용 X) */ + post: operations["createTodayQuizForTest"]; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/api/v2/test/create-member": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + get?: never; + put?: never; + post: operations["createMemberForTest"]; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/api/v2/quizzes/documents/{document_id}/custom-quiz-set": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + get?: never; + put?: never; + /** 사용자가 생성한 문서에서 직접 퀴즈 세트 생성(랜덤, OX, 객관식) */ + post: operations["createMemberGeneratedQuizSet"]; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/api/v2/quizzes/documents/{document_id}/check-quiz-set": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + get?: never; + put?: never; + /** 퀴즈 생성 후 퀴즈 오류 확인을 위한 퀴즈세트 생성(퀴즈 시작하기 후 모든 퀴즈 생성이 완료되면 요청) */ + post: operations["createErrorCheckQuizSet"]; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/api/v2/payments/verify-amount": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + get?: never; + put?: never; + /** 결제금액 확인 */ + post: operations["verifyAmount"]; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/api/v2/payments/temp-save": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + get?: never; + put?: never; + /** 주문과 결제금액 임시저장 */ + post: operations["tempSaveAmount"]; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/api/v2/payments/confirm": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + get?: never; + put?: never; + /** 결제 승인 요청 */ + post: operations["confirmPayment"]; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/api/v2/payments/cancel": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + get?: never; + put?: never; + /** 결제 취소 요청 */ + post: operations["cancelPayment"]; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/api/v2/message/send": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + get?: never; + put?: never; + /** 메시지 전송 2 */ + post: operations["messageSendSend"]; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/api/v2/message-send": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + get?: never; + put?: never; + /** 메시지 전송 1 */ + post: operations["messageSend"]; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/api/v2/login": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + get?: never; + put?: never; + /** login */ + post: operations["login"]; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/api/v2/integrated-search": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + get?: never; + put?: never; + /** 통합(문서, 컬렉션, 퀴즈) 검색 */ + post: operations["integratedSearchByKeyword"]; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/api/v2/feedback": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + get?: never; + put?: never; + /** Create Feedback */ + post: operations["createFeedback"]; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/api/v2/documents": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + get?: never; + put?: never; + /** 문서 생성 */ + post: operations["createDocument"]; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/api/v2/documents/search": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + get?: never; + put?: never; + /** 문서 검색 */ + post: operations["searchDocumentByKeyword"]; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/api/v2/directories": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + /** 모든 디렉토리 가져오기 */ + get: operations["getDirectories"]; + put?: never; + /** 디렉토리 생성 */ + post: operations["createDirectory"]; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/api/v2/collections": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + /** 모든 컬렉션 가져오기(탐색) */ + get: operations["getAllCollections"]; + put?: never; + /** 컬렉션 생성 */ + post: operations["createCollection"]; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/api/v2/collections/{collection_id}/create-bookmark": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + get?: never; + put?: never; + /** 컬렉션 북마크하기 */ + post: operations["createCollectionBookmark"]; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/api/v2/collections/{collection_id}/collection-quizzes": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + get?: never; + put?: never; + /** 컬렉션 퀴즈 시작하기 */ + post: operations["createCollectionQuizSet"]; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/api/v2/auth/verification": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + get?: never; + put?: never; + /** 이메일 인증 코드 생성 및 발송 */ + post: operations["sendVerificationCode"]; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/api/v2/auth/verification/check": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + get?: never; + put?: never; + /** 이메일 코드 인증 */ + post: operations["verifyVerificationCode"]; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/api/v2/auth/invite-code/verify": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + get?: never; + put?: never; + /** 초대 코드 인증 */ + post: operations["verifyInviteCode"]; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/api/v2/wrong-quiz/result": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + get?: never; + put?: never; + post?: never; + delete?: never; + options?: never; + head?: never; + /** 오답 터뜨리기 결과 업데이트 */ + patch: operations["updateWrongQuizResult"]; + trace?: never; + }; + "/api/v2/random-quiz/result": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + get?: never; + put?: never; + post?: never; + delete?: never; + options?: never; + head?: never; + /** 랜덤 퀴즈 결과 업데이트 */ + patch: operations["updateRandomQuizResult"]; + trace?: never; + }; + "/api/v2/quiz/result": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + get?: never; + put?: never; + post?: never; + delete?: never; + options?: never; + head?: never; + /** 퀴즈 결과 업데이트 */ + patch: operations["updateQuizResult"]; + trace?: never; + }; + "/api/v2/members/update-today-quiz-count": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + get?: never; + put?: never; + post?: never; + delete?: never; + options?: never; + head?: never; + /** 오늘의 퀴즈 관리(오늘의 퀴즈 개수 설정) */ + patch: operations["updateTodayQuizCount"]; + trace?: never; + }; + "/api/v2/members/update-quiz-notification": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + get?: never; + put?: never; + post?: never; + delete?: never; + options?: never; + head?: never; + /** 사용자 퀴즈 알림 ON/OFF */ + patch: operations["updateQuizNotification"]; + trace?: never; + }; + "/api/v2/members/update-name": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + get?: never; + put?: never; + post?: never; + delete?: never; + options?: never; + head?: never; + /** 사용자 이름 수정 */ + patch: operations["updateMemberName"]; + trace?: never; + }; + "/api/v2/members/update-collection-categories": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + get?: never; + put?: never; + post?: never; + delete?: never; + options?: never; + head?: never; + /** 관심분야 태그 설정 */ + patch: operations["updateInterestCollectionCategories"]; + trace?: never; + }; + "/api/v2/documents/{document_id}/update-name": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + get?: never; + put?: never; + post?: never; + delete?: never; + options?: never; + head?: never; + /** 문서 이름 변경 */ + patch: operations["updateDocumentName"]; + trace?: never; + }; + "/api/v2/documents/{document_id}/update-content": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + get?: never; + put?: never; + post?: never; + delete?: never; + options?: never; + head?: never; + /** 문서 내용 업데이트 */ + patch: operations["changeDocumentContent"]; + trace?: never; + }; + "/api/v2/documents/today-quiz-settings": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + get?: never; + put?: never; + post?: never; + delete?: never; + options?: never; + head?: never; + /** + * 오늘의 퀴즈 관리(문제를 가져올 노트 선택) + * @description Request map에서 key값은 number, value값은 boolean입니다. + */ + patch: operations["selectDocumentToNotGenerateByTodayQuiz"]; + trace?: never; + }; + "/api/v2/documents/move": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + get?: never; + put?: never; + post?: never; + delete?: never; + options?: never; + head?: never; + /** 문서 다른 폴더로 옮기기 */ + patch: operations["moveDocumentToDirectory"]; + trace?: never; + }; + "/api/v2/directories/{directory_id}/update-info": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + get?: never; + put?: never; + post?: never; + delete?: never; + options?: never; + head?: never; + /** 디렉토리 정보 변경 */ + patch: operations["updateDirectoryInfo"]; + trace?: never; + }; + "/api/v2/collections/{collection_id}/update-quizzes": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + get?: never; + put?: never; + post?: never; + delete?: never; + options?: never; + head?: never; + /** 컬렉션 문제 편집 */ + patch: operations["updateCollectionQuizzes"]; + trace?: never; + }; + "/api/v2/collections/{collection_id}/update-info": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + get?: never; + put?: never; + post?: never; + delete?: never; + options?: never; + head?: never; + /** 컬렉션 정보 수정 */ + patch: operations["updateCollectionInfo"]; + trace?: never; + }; + "/api/v2/collection/{collection_id}/add-quiz": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + get?: never; + put?: never; + post?: never; + delete?: never; + options?: never; + head?: never; + /** + * 컬렉션에 퀴즈 추가 + * @description 노트 상세에서 특정 퀴즈를 특정 컬렉션에 추가 + */ + patch: operations["addQuizToCollection"]; + trace?: never; + }; + "/api/v2/today-quiz-info": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + /** 오늘의 퀴즈 현황 */ + get: operations["getCurrentTodayQuizInfo"]; + put?: never; + post?: never; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/api/v2/quizzes/{quiz_set_id}/{quiz_set_type}/quiz-record": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + /** 퀴즈 세트에 대한 상세 기록 */ + get: operations["getSingleQuizSetRecord"]; + put?: never; + post?: never; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/api/v2/quizzes/quiz-records": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + /** 전체 퀴즈 기록 */ + get: operations["getAllQuizzesAndCollectionRecords"]; + put?: never; + post?: never; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/api/v2/quiz-sets/{quiz_set_id}": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + /** quiz_set_id와 quiz-set-type으로 퀴즈 가져오기 */ + get: operations["getQuizSetByCollection"]; + put?: never; + post?: never; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/api/v2/quiz-sets/today": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + /** 오늘의 퀴즈 세트 정보 가져오기 */ + get: operations["getQuizSetToday"]; + put?: never; + post?: never; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/api/v2/quiz-analysis": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + /** 퀴즈 분석 */ + get: operations["getQuizAnswerRateAnalysis"]; + put?: never; + post?: never; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/api/v2/payments/{payment_key}": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + /** paymentKey로 결제 조회 */ + get: operations["getPaymentByPaymentKey"]; + put?: never; + post?: never; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/api/v2/payments/orders/{order_id}": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + /** orderId로 결제 조회 */ + get: operations["getPaymentByOrderId"]; + put?: never; + post?: never; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/api/v2/oauth/url": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + /** Oauth url api */ + get: operations["oauthUrlApi"]; + put?: never; + post?: never; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/api/v2/notion/pages": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + /** Get notion pages */ + get: operations["getNotionPages"]; + put?: never; + post?: never; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/api/v2/notion/page/{page_id}": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + /** Get notion page */ + get: operations["getNotionPage"]; + put?: never; + post?: never; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/api/v2/notion/oauth": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + get: operations["verifyNotion"]; + put?: never; + post?: never; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/api/v2/notion/callback": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + get: operations["notionCallback"]; + put?: never; + post?: never; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/api/v2/members/info": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + /** Get member info */ + get: operations["getMemberInfo"]; + put?: never; + post?: never; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/api/v2/incorrect-quizzes": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + /** 오답 터뜨리기 퀴즈 가져오기 */ + get: operations["getIncorrectQuizzes"]; + put?: never; + post?: never; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/api/v2/health-check": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + /** Health check */ + get: operations["healthCheck"]; + put?: never; + post?: never; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/api/v2/documents/{document_id}": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + /** document_id로 문서 가져오기 */ + get: operations["getSingleDocument"]; + put?: never; + post?: never; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/api/v2/documents/{document_id}/review-pick": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + /** document_id로 복습 pick 가져오기 */ + get: operations["getDocumentsNeedingReviewPick"]; + put?: never; + post?: never; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/api/v2/documents/{document_id}/quizzes": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + /** document_id에 해당하는 모든 퀴즈 가져오기 */ + get: operations["getGeneratedQuizzes"]; + put?: never; + post?: never; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/api/v2/documents/{document_id}/download-quiz": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + /** 퀴즈 다운로드 */ + get: operations["downloadQuizzes"]; + put?: never; + post?: never; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/api/v2/documents/review-need-documents": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + /** 복습 필수 노트 top 5 */ + get: operations["getDocumentsNeedingReview"]; + put?: never; + post?: never; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/api/v2/directories/{directory_id}": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + /** directory_id로 디렉토리 가져오기 */ + get: operations["getSingleDirectory"]; + put?: never; + post?: never; + /** 디렉토리 삭제 */ + delete: operations["deleteDirectory"]; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/api/v2/directories/{directory_id}/quizzes": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + /** 디렉토리에 생성된 모든 퀴즈 랜덤하게 가져오기(랜덤 퀴즈) */ + get: operations["getAllQuizzesByMemberId"]; + put?: never; + post?: never; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/api/v2/directories/documents": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + /** 모든 문서 가져오기 */ + get: operations["getAllDocuments"]; + put?: never; + post?: never; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/api/v2/collections/{keyword}": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + /** 컬렉션 검색하기 */ + get: operations["searchCollections"]; + put?: never; + post?: never; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/api/v2/collections/{collection_id}/info": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + /** 컬렉션 상세 정보 가져오기 */ + get: operations["getCollectionInfoByCollectionId"]; + put?: never; + post?: never; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/api/v2/collections/{collection_category}/quizzes": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + /** 북마크하거나 소유한 컬렉션 분야별로 모든 퀴즈 랜덤하게 가져오기 */ + get: operations["getQuizzesInCollectionByCollectionCategory"]; + put?: never; + post?: never; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/api/v2/collections/my-collections": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + /** 직접 생성한 컬렉션 가져오기 */ + get: operations["getAllByMemberId"]; + put?: never; + post?: never; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/api/v2/collections/interest-category-collection": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + /** 사용자 관심 분야 컬렉션 가져오기 */ + get: operations["getInterestCategoryCollections"]; + put?: never; + post?: never; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/api/v2/collections/categories": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + /** 사용자가 북마크했거나 생성한 컬렉션 카테고리 가져오기 */ + get: operations["getCollectionCategories"]; + put?: never; + post?: never; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/api/v2/collections/bookmarked-collections": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + /** 북마크한 컬렉션 가져오기 */ + get: operations["getAllByMemberIdAndBookmarked"]; + put?: never; + post?: never; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/api/v2/collections-analysis": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + /** 컬렉션 분석 */ + get: operations["getCollectionAnalysis"]; + put?: never; + post?: never; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/api/v2/callback": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + /** Oauth callback */ + get: operations["googleLogin"]; + put?: never; + post?: never; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/api/v2/auth/invite-link": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + /** 초대 링크 생성 */ + get: operations["createInviteLink"]; + put?: never; + post?: never; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/api/v2/quizzes/{quiz_id}/invalid": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + get?: never; + put?: never; + post?: never; + /** 오류가 발생한 퀴즈 삭제 */ + delete: operations["deleteInvalidQuiz"]; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/api/v2/quizzes/{quiz_id}/delete-quiz": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + get?: never; + put?: never; + post?: never; + /** 퀴즈 삭제 */ + delete: operations["deleteQuiz"]; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/api/v2/documents/delete-documents": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + get?: never; + put?: never; + post?: never; + /** 문서 삭제 */ + delete: operations["deleteDocument"]; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/api/v2/collections/{collection_id}/delete-collection": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + get?: never; + put?: never; + post?: never; + /** 컬렉션 삭제 */ + delete: operations["deleteCollection"]; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/api/v2/collections/{collection_id}/delete-bookmark": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + get?: never; + put?: never; + post?: never; + /** 컬렉션 북마크 취소하기 */ + delete: operations["deleteCollectionBookmark"]; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; +} +export type webhooks = Record; +export interface components { + schemas: { + SaveFcmTokenRequest: { + fcmToken?: string; + }; + CreateQuizzesResponse: { + quizSetId?: string; + /** @enum {string} */ + quizSetType?: "TODAY_QUIZ_SET" | "DOCUMENT_QUIZ_SET" | "COLLECTION_QUIZ_SET" | "FIRST_QUIZ_SET"; + /** Format: date-time */ + createdAt?: string; + }; + CreateQuizzesByDocumentRequest: { + /** @enum {string} */ + quizType?: "MIX_UP" | "MULTIPLE_CHOICE"; + /** Format: int32 */ + quizCount?: number; + }; + SaveAmountRequest: { + orderId?: string; + /** Format: int32 */ + amount?: number; + }; + TossPaymentRequest: { + paymentKey?: string; + orderId?: string; + /** Format: int32 */ + amount?: number; + }; + CancelPaymentRequest: { + paymentKey?: string; + }; + FcmMessageDto: { + content?: string; + }; + FcmNotificationRequestDto: { + title?: string; + body?: string; + content?: string; + }; + LoginRequest: { + accessToken?: string; + /** @enum {string} */ + socialPlatform?: "KAKAO" | "GOOGLE"; + }; + LoginResponse: { + accessToken?: string; + /** Format: date-time */ + accessTokenExpiration?: string; + signUp?: boolean; + }; + SearchRequest: { + keyword?: string; + }; + IntegratedSearchCollectionDto: { + /** Format: int64 */ + id?: number; + name?: string; + emoji?: string; + /** Format: int32 */ + bookmarkCount?: number; + /** @enum {string} */ + collectionCategory?: "IT" | "LAW" | "BUSINESS_ECONOMY" | "SOCIETY_POLITICS" | "LANGUAGE" | "MEDICINE_PHARMACY" | "ART" | "SCIENCE_ENGINEERING" | "HISTORY_PHILOSOPHY" | "OTHER"; + memberName?: string; + /** Format: int32 */ + quizCount?: number; + }; + IntegratedSearchDirectoryDto: { + /** Format: int64 */ + id?: number; + name?: string; + }; + IntegratedSearchDocumentDto: { + /** Format: int64 */ + documentId?: number; + documentName?: string; + content?: string; + directory?: components["schemas"]["IntegratedSearchDirectoryDto"]; + }; + IntegratedSearchQuizDto: { + /** Format: int64 */ + id?: number; + question?: string; + answer?: string; + documentName?: string; + directoryName?: string; + }; + IntegratedSearchResponse: { + documents?: components["schemas"]["IntegratedSearchDocumentDto"][]; + quizzes?: components["schemas"]["IntegratedSearchQuizDto"][]; + collections?: components["schemas"]["IntegratedSearchCollectionDto"][]; + }; + CreateFeedbackRequest: { + files?: string[]; + title?: string; + content?: string; + /** @enum {string} */ + type?: "ERROR" | "PAYMENT" | "PARTNERSHIP" | "EVENT" | "ACCOUNT_INFO" | "CANCELLATION" | "OTHER"; + email?: string; + }; + CreateDocumentRequest: { + /** Format: binary */ + file?: string; + directoryId?: string; + documentName?: string; + star?: string; + /** @enum {string} */ + quizType?: "MIX_UP" | "MULTIPLE_CHOICE"; + /** @enum {string} */ + documentType?: "FILE" | "TEXT" | "NOTION"; + }; + CreateDocumentResponse: { + /** Format: int64 */ + id?: number; + }; + SearchDocumentDirectoryDto: { + /** Format: int64 */ + id?: number; + name?: string; + }; + SearchDocumentDto: { + /** Format: int64 */ + documentId?: number; + documentName?: string; + content?: string; + directory?: components["schemas"]["SearchDocumentDirectoryDto"]; + }; + SearchDocumentQuizDto: { + /** Format: int64 */ + id?: number; + question?: string; + answer?: string; + documentName?: string; + directoryName?: string; + }; + SearchDocumentResponse: { + documents?: components["schemas"]["SearchDocumentDto"][]; + quizzes?: components["schemas"]["SearchDocumentQuizDto"][]; + }; + CreateDirectoryRequest: { + name?: string; + emoji?: string; + }; + CreateDirectoryResponse: { + /** Format: int64 */ + id?: number; + }; + CreateCollectionRequest: { + /** @example 컬렉션 제목 */ + name?: string; + /** @example 📙 */ + emoji?: string; + /** @example 컬렉션 설명 */ + description?: string; + /** + * @example IT, LAW, BUSINESS_ECONOMY, SOCIETY_POLITICS, LANGUAGE, MEDICINE_PHARMACY, ART, SCIENCE_ENGINEERING, HISTORY_PHILOSOPHY, OTHER + * @enum {string} + */ + collectionCategory?: "IT" | "LAW" | "BUSINESS_ECONOMY" | "SOCIETY_POLITICS" | "LANGUAGE" | "MEDICINE_PHARMACY" | "ART" | "SCIENCE_ENGINEERING" | "HISTORY_PHILOSOPHY" | "OTHER"; + quizzes?: number[]; + }; + CreateCollectionResponse: { + /** Format: int64 */ + collectionId?: number; + }; + SendVerificationCodeRequest: { + email?: string; + }; + VerifyVerificationCodeRequest: { + email?: string; + verificationCode?: string; + }; + VerifyInviteCode: { + inviteCode?: string; + }; + UpdateRandomQuizResultDto: { + /** Format: int64 */ + id?: number; + answer?: boolean; + }; + UpdateRandomQuizResultRequest: { + quizzes?: components["schemas"]["UpdateRandomQuizResultDto"][]; + }; + UpdateQuizResultQuizDto: { + /** Format: int64 */ + id?: number; + answer?: boolean; + choseAnswer?: string; + /** Format: int32 */ + elapsedTime?: number; + }; + UpdateQuizResultRequest: { + quizSetId?: string; + quizzes?: components["schemas"]["UpdateQuizResultQuizDto"][]; + }; + UpdateQuizResultResponse: { + /** Format: int32 */ + reward?: number; + /** Format: int32 */ + currentConsecutiveTodayQuizDate?: number; + }; + UpdateTodayQuizCountRequest: { + /** Format: int32 */ + todayQuizCount?: number; + }; + UpdateQuizNotificationRequest: { + quizNotificationEnabled?: boolean; + }; + UpdateMemberNameRequest: { + name?: string; + }; + UpdateInterestCollectionCategoriesRequest: { + interestCollectionCategories?: ("IT" | "LAW" | "BUSINESS_ECONOMY" | "SOCIETY_POLITICS" | "LANGUAGE" | "MEDICINE_PHARMACY" | "ART" | "SCIENCE_ENGINEERING" | "HISTORY_PHILOSOPHY" | "OTHER")[]; + }; + UpdateDocumentNameRequest: { + name?: string; + }; + UpdateDocumentContentRequest: { + name?: string; + /** Format: binary */ + file?: string; + }; + UpdateTodayQuizSettingsRequest: { + /** + * @description 문서 ID와 퀴즈 설정 값 (true/false) 맵 + * @example { + * "1": true, + * "2": false, + * "3": true + * } + */ + documentIdTodayQuizMap?: { + [key: string]: boolean; + }; + }; + MoveDocumentToDirectoryRequest: { + documentIds?: number[]; + /** Format: int64 */ + directoryId?: number; + }; + UpdateDirectoryInfoRequest: { + name?: string; + emoji?: string; + }; + UpdateCollectionQuizzesRequest: { + quizzes?: number[]; + }; + UpdateCollectionInfoRequest: { + /** @example 컬렉션 제목 */ + name?: string; + /** @example 📙 */ + emoji?: string; + /** @example 컬렉션 설명 */ + description?: string; + /** + * @example IT, LAW, BUSINESS_ECONOMY, SOCIETY_POLITICS, LANGUAGE, MEDICINE_PHARMACY, ART, SCIENCE_ENGINEERING, HISTORY_PHILOSOPHY, OTHER + * @enum {string} + */ + collectionCategory?: "IT" | "LAW" | "BUSINESS_ECONOMY" | "SOCIETY_POLITICS" | "LANGUAGE" | "MEDICINE_PHARMACY" | "ART" | "SCIENCE_ENGINEERING" | "HISTORY_PHILOSOPHY" | "OTHER"; + }; + AddQuizToCollectionRequest: { + /** Format: int64 */ + quizId?: number; + }; + GetCurrentTodayQuizInfo: { + /** Format: int32 */ + currentConsecutiveDays?: number; + /** Format: int32 */ + maxConsecutiveDays?: number; + }; + GetSingleQuizSetRecordDto: { + question?: string; + answer?: string; + explanation?: string; + options?: string[]; + choseAnswer?: string; + documentName?: string; + directoryName?: string; + collectionName?: string; + /** @enum {string} */ + quizSetType?: "TODAY_QUIZ_SET" | "DOCUMENT_QUIZ_SET" | "COLLECTION_QUIZ_SET" | "FIRST_QUIZ_SET"; + }; + GetSingleQuizSetRecordResponse: { + /** Format: int32 */ + totalElapsedTimeMs?: number; + quizzes?: components["schemas"]["GetSingleQuizSetRecordDto"][]; + /** Format: date-time */ + createdAt?: string; + }; + GetQuizRecordDto: { + quizSetId?: string; + name?: string; + /** Format: int32 */ + quizCount?: number; + /** Format: int32 */ + score?: number; + /** @enum {string} */ + quizSetType?: "TODAY_QUIZ_SET" | "DOCUMENT_QUIZ_SET" | "COLLECTION_QUIZ_SET" | "FIRST_QUIZ_SET"; + /** Format: date-time */ + solvedDate?: string; + }; + GetQuizRecordResponse: { + /** Format: int32 */ + currentConsecutiveDays?: number; + /** Format: int32 */ + maxConsecutiveDays?: number; + quizRecords?: components["schemas"]["GetQuizRecordDto"][]; + }; + GetQuizSetDirectoryDto: { + /** Format: int64 */ + id?: number; + name?: string; + }; + GetQuizSetDocumentDto: { + /** Format: int64 */ + id?: number; + name?: string; + }; + GetQuizSetQuizDto: { + /** Format: int64 */ + id?: number; + question?: string; + answer?: string; + explanation?: string; + options?: string[]; + /** @enum {string} */ + quizType?: "MIX_UP" | "MULTIPLE_CHOICE"; + document?: components["schemas"]["GetQuizSetDocumentDto"]; + directory?: components["schemas"]["GetQuizSetDirectoryDto"]; + }; + GetQuizSetResponse: { + quizzes?: components["schemas"]["GetQuizSetQuizDto"][]; + collectionName?: string; + }; + GetQuizSetTodayResponse: { + quizSetId?: string; + /** @enum {string} */ + quizSetType?: "TODAY_QUIZ_SET" | "DOCUMENT_QUIZ_SET" | "COLLECTION_QUIZ_SET" | "FIRST_QUIZ_SET"; + /** @enum {string} */ + type?: "READY" | "NOT_READY" | "DONE"; + /** Format: date-time */ + createdAt?: string; + }; + GetQuizAnswerRateAnalysisResponse: { + /** Format: int32 */ + totalElapsedTime?: number; + quizzes?: components["schemas"]["QuizAnswerRateAnalysisDto"][]; + }; + QuizAnswerRateAnalysisDto: { + /** Format: date */ + date?: string; + /** Format: int32 */ + quizCount?: number; + /** Format: int32 */ + incorrectAnswerCount?: number; + }; + ApplicationContext: { + parent?: components["schemas"]["ApplicationContext"]; + id?: string; + displayName?: string; + applicationName?: string; + /** Format: int64 */ + startupDate?: number; + autowireCapableBeanFactory?: components["schemas"]["AutowireCapableBeanFactory"]; + environment?: components["schemas"]["Environment"]; + /** Format: int32 */ + beanDefinitionCount?: number; + beanDefinitionNames?: string[]; + parentBeanFactory?: components["schemas"]["BeanFactory"]; + classLoader?: { + name?: string; + registeredAsParallelCapable?: boolean; + parent?: { + name?: string; + registeredAsParallelCapable?: boolean; + unnamedModule?: { + name?: string; + classLoader?: { + name?: string; + registeredAsParallelCapable?: boolean; + definedPackages?: { + name?: string; + annotations?: Record[]; + declaredAnnotations?: Record[]; + sealed?: boolean; + specificationTitle?: string; + specificationVersion?: string; + specificationVendor?: string; + implementationTitle?: string; + implementationVersion?: string; + implementationVendor?: string; + }[]; + defaultAssertionStatus?: boolean; + }; + descriptor?: { + open?: boolean; + automatic?: boolean; + }; + named?: boolean; + annotations?: Record[]; + declaredAnnotations?: Record[]; + packages?: string[]; + nativeAccessEnabled?: boolean; + layer?: Record; + }; + definedPackages?: { + name?: string; + annotations?: Record[]; + declaredAnnotations?: Record[]; + sealed?: boolean; + specificationTitle?: string; + specificationVersion?: string; + specificationVendor?: string; + implementationTitle?: string; + implementationVersion?: string; + implementationVendor?: string; + }[]; + defaultAssertionStatus?: boolean; + }; + unnamedModule?: { + name?: string; + classLoader?: { + name?: string; + registeredAsParallelCapable?: boolean; + definedPackages?: { + name?: string; + annotations?: Record[]; + declaredAnnotations?: Record[]; + sealed?: boolean; + specificationTitle?: string; + specificationVersion?: string; + specificationVendor?: string; + implementationTitle?: string; + implementationVersion?: string; + implementationVendor?: string; + }[]; + defaultAssertionStatus?: boolean; + }; + descriptor?: { + open?: boolean; + automatic?: boolean; + }; + named?: boolean; + annotations?: Record[]; + declaredAnnotations?: Record[]; + packages?: string[]; + nativeAccessEnabled?: boolean; + layer?: Record; + }; + definedPackages?: { + name?: string; + annotations?: Record[]; + declaredAnnotations?: Record[]; + sealed?: boolean; + specificationTitle?: string; + specificationVersion?: string; + specificationVendor?: string; + implementationTitle?: string; + implementationVersion?: string; + implementationVendor?: string; + }[]; + defaultAssertionStatus?: boolean; + }; + }; + AutowireCapableBeanFactory: Record; + BeanFactory: Record; + Environment: { + activeProfiles?: string[]; + defaultProfiles?: string[]; + }; + FilterRegistration: { + servletNameMappings?: string[]; + urlPatternMappings?: string[]; + name?: string; + className?: string; + initParameters?: { + [key: string]: string; + }; + }; + HttpStatusCode: { + error?: boolean; + is4xxClientError?: boolean; + is5xxServerError?: boolean; + is1xxInformational?: boolean; + is2xxSuccessful?: boolean; + is3xxRedirection?: boolean; + }; + JspConfigDescriptor: { + taglibs?: components["schemas"]["TaglibDescriptor"][]; + jspPropertyGroups?: components["schemas"]["JspPropertyGroupDescriptor"][]; + }; + JspPropertyGroupDescriptor: { + defaultContentType?: string; + deferredSyntaxAllowedAsLiteral?: string; + elIgnored?: string; + errorOnELNotFound?: string; + pageEncoding?: string; + scriptingInvalid?: string; + isXml?: string; + includePreludes?: string[]; + includeCodas?: string[]; + trimDirectiveWhitespaces?: string; + errorOnUndeclaredNamespace?: string; + buffer?: string; + urlPatterns?: string[]; + }; + RedirectView: { + applicationContext?: components["schemas"]["ApplicationContext"]; + servletContext?: components["schemas"]["ServletContext"]; + contentType?: string; + requestContextAttribute?: string; + staticAttributes?: { + [key: string]: Record; + }; + exposePathVariables?: boolean; + exposeContextBeansAsAttributes?: boolean; + exposedContextBeanNames?: string[]; + beanName?: string; + url?: string; + contextRelative?: boolean; + http10Compatible?: boolean; + exposeModelAttributes?: boolean; + encodingScheme?: string; + statusCode?: components["schemas"]["HttpStatusCode"]; + expandUriTemplateVariables?: boolean; + propagateQueryParams?: boolean; + hosts?: string[]; + redirectView?: boolean; + propagateQueryProperties?: boolean; + attributesMap?: { + [key: string]: Record; + }; + attributes?: { + [key: string]: string; + }; + attributesCSV?: string; + }; + ServletContext: { + sessionCookieConfig?: components["schemas"]["SessionCookieConfig"]; + virtualServerName?: string; + classLoader?: { + name?: string; + registeredAsParallelCapable?: boolean; + definedPackages?: { + name?: string; + annotations?: Record[]; + declaredAnnotations?: Record[]; + sealed?: boolean; + specificationTitle?: string; + specificationVersion?: string; + specificationVendor?: string; + implementationTitle?: string; + implementationVersion?: string; + implementationVendor?: string; + }[]; + defaultAssertionStatus?: boolean; + }; + /** Format: int32 */ + majorVersion?: number; + /** Format: int32 */ + minorVersion?: number; + attributeNames?: Record; + contextPath?: string; + initParameterNames?: Record; + sessionTrackingModes?: ("COOKIE" | "URL" | "SSL")[]; + /** Format: int32 */ + sessionTimeout?: number; + servletRegistrations?: { + [key: string]: components["schemas"]["ServletRegistration"]; + }; + defaultSessionTrackingModes?: ("COOKIE" | "URL" | "SSL")[]; + /** Format: int32 */ + effectiveMajorVersion?: number; + /** Format: int32 */ + effectiveMinorVersion?: number; + serverInfo?: string; + servletContextName?: string; + filterRegistrations?: { + [key: string]: components["schemas"]["FilterRegistration"]; + }; + effectiveSessionTrackingModes?: ("COOKIE" | "URL" | "SSL")[]; + jspConfigDescriptor?: components["schemas"]["JspConfigDescriptor"]; + requestCharacterEncoding?: string; + responseCharacterEncoding?: string; + }; + ServletRegistration: { + mappings?: string[]; + runAsRole?: string; + name?: string; + className?: string; + initParameters?: { + [key: string]: string; + }; + }; + SessionCookieConfig: { + /** Format: int32 */ + maxAge?: number; + domain?: string; + httpOnly?: boolean; + path?: string; + secure?: boolean; + name?: string; + attributes?: { + [key: string]: string; + }; + /** @deprecated */ + comment?: string; + }; + TaglibDescriptor: { + taglibURI?: string; + taglibLocation?: string; + }; + GetMemberInfoDocumentDto: { + /** Format: int32 */ + possessDocumentCount?: number; + /** Format: int32 */ + maxPossessDocumentCount?: number; + }; + GetMemberInfoResponse: { + /** Format: int64 */ + id?: number; + name?: string; + email?: string; + /** @enum {string} */ + socialPlatform?: "KAKAO" | "GOOGLE"; + /** @enum {string} */ + role?: "ROLE_USER" | "ROLE_ADMIN"; + interestCategories?: string[]; + documentUsage?: components["schemas"]["GetMemberInfoDocumentDto"]; + /** Format: int32 */ + star?: number; + quizNotificationEnabled?: boolean; + }; + DirectoryDto: { + /** Format: int64 */ + id?: number; + name?: string; + }; + DocumentDto: { + /** Format: int64 */ + id?: number; + name?: string; + }; + QuizDto: { + /** Format: int64 */ + id?: number; + question?: string; + answer?: string; + explanation?: string; + options?: string[]; + /** @enum {string} */ + quizType?: "MIX_UP" | "MULTIPLE_CHOICE"; + document?: components["schemas"]["DocumentDto"]; + directory?: components["schemas"]["DirectoryDto"]; + }; + QuizResponseDto: { + quizzes?: components["schemas"]["QuizDto"][]; + }; + GetSingleDocumentDirectoryDto: { + /** Format: int64 */ + id?: number; + name?: string; + emoji?: string; + }; + GetSingleDocumentQuizDto: { + /** Format: int64 */ + id?: number; + question?: string; + answer?: string; + explanation?: string; + options?: string[]; + /** @enum {string} */ + quizType?: "MIX_UP" | "MULTIPLE_CHOICE"; + }; + GetSingleDocumentResponse: { + /** Format: int64 */ + id?: number; + documentName?: string; + /** @enum {string} */ + status?: "UNPROCESSED" | "PROCESSED" | "PROCESSING" | "COMPLETELY_FAILED" | "PARTIAL_SUCCESS" | "DEFAULT_DOCUMENT"; + content?: string; + /** Format: int32 */ + characterCount?: number; + /** Format: int32 */ + totalQuizCount?: number; + /** Format: date-time */ + updatedAt?: string; + directory?: components["schemas"]["GetSingleDocumentDirectoryDto"]; + quizzes?: components["schemas"]["GetSingleDocumentQuizDto"][]; + }; + GetDocumentsNeedingReviewPickResponse: { + quizzes?: components["schemas"]["GetReviewQuizDto"][]; + }; + GetReviewQuizDto: { + /** Format: int64 */ + id?: number; + question?: string; + answer?: string; + explanation?: string; + options?: string[]; + /** @enum {string} */ + quizType?: "MIX_UP" | "MULTIPLE_CHOICE"; + description?: string; + }; + GetDocumentsNeedingReviewResponse: { + documents?: components["schemas"]["GetReviewNeededDocumentsDto"][]; + }; + GetReviewNeededDocumentsDirectoryDto: { + /** Format: int64 */ + id?: number; + name?: string; + }; + GetReviewNeededDocumentsDto: { + /** Format: int64 */ + id?: number; + name?: string; + /** Format: int32 */ + reviewNeededQuizCount?: number; + directory?: components["schemas"]["GetReviewNeededDocumentsDirectoryDto"]; + }; + GetAllDirectoriesDirectoryDto: { + /** Format: int64 */ + id?: number; + name?: string; + /** @enum {string} */ + tag?: "DEFAULT" | "NORMAL"; + emoji?: string; + /** Format: int32 */ + documentCount?: number; + }; + GetAllDirectoriesResponse: { + directories?: components["schemas"]["GetAllDirectoriesDirectoryDto"][]; + }; + GetSingleDirectoryResponse: { + /** Format: int64 */ + id?: number; + name?: string; + emoji?: string; + /** @enum {string} */ + tag?: "DEFAULT" | "NORMAL"; + }; + GetAllDocumentsDirectoryDto: { + name?: string; + /** @enum {string} */ + tag?: "DEFAULT" | "NORMAL"; + }; + GetAllDocumentsDocumentDto: { + /** Format: int64 */ + id?: number; + name?: string; + previewContent?: string; + /** Format: int32 */ + characterCount?: number; + /** @enum {string} */ + status?: "UNPROCESSED" | "PROCESSED" | "PROCESSING" | "COMPLETELY_FAILED" | "PARTIAL_SUCCESS" | "DEFAULT_DOCUMENT"; + /** Format: int32 */ + totalQuizCount?: number; + /** @enum {string} */ + documentType?: "FILE" | "TEXT" | "NOTION"; + /** Format: date-time */ + createdAt?: string; + /** Format: date-time */ + updatedAt?: string; + /** Format: int32 */ + reviewNeededQuizCount?: number; + directory?: components["schemas"]["GetAllDocumentsDirectoryDto"]; + }; + GetAllDocumentsResponse: { + documents?: components["schemas"]["GetAllDocumentsDocumentDto"][]; + }; + CollectionDto: { + /** Format: int64 */ + id?: number; + name?: string; + description?: string; + emoji?: string; + /** Format: int32 */ + bookmarkCount?: number; + collectionCategory?: string; + /** Format: int32 */ + solvedMemberCount?: number; + bookmarked?: boolean; + /** Format: int32 */ + totalQuizCount?: number; + member?: components["schemas"]["CollectionMemberDto"]; + }; + CollectionMemberDto: { + /** Format: int64 */ + creatorId?: number; + creatorName?: string; + }; + CollectionResponseDto: { + collections?: components["schemas"]["CollectionDto"][]; + }; + GetSingleCollectionMemberDto: { + /** Format: int64 */ + creatorId?: number; + creatorName?: string; + }; + GetSingleCollectionQuizDto: { + /** Format: int64 */ + id?: number; + question?: string; + answer?: string; + explanation?: string; + options?: string[]; + /** @enum {string} */ + quizType?: "MIX_UP" | "MULTIPLE_CHOICE"; + }; + GetSingleCollectionResponse: { + /** Format: int64 */ + id?: number; + name?: string; + description?: string; + emoji?: string; + /** Format: int32 */ + bookmarkCount?: number; + collectionCategory?: string; + /** Format: int32 */ + solvedMemberCount?: number; + bookmarked?: boolean; + member?: components["schemas"]["GetSingleCollectionMemberDto"]; + quizzes?: components["schemas"]["GetSingleCollectionQuizDto"][]; + }; + GetQuizzesInCollectionByCollectionCategory: { + quizzes?: components["schemas"]["QuizInCollectionDto"][]; + }; + QuizInCollectionDto: { + /** Format: int64 */ + id?: number; + question?: string; + answer?: string; + explanation?: string; + options?: string[]; + /** @enum {string} */ + quizType?: "MIX_UP" | "MULTIPLE_CHOICE"; + }; + GetCollectionCategoriesCollectionDto: { + /** Format: int64 */ + id?: number; + name?: string; + }; + GetCollectionCategoriesDto: { + /** @enum {string} */ + collectionCategory?: "IT" | "LAW" | "BUSINESS_ECONOMY" | "SOCIETY_POLITICS" | "LANGUAGE" | "MEDICINE_PHARMACY" | "ART" | "SCIENCE_ENGINEERING" | "HISTORY_PHILOSOPHY" | "OTHER"; + categoryName?: string; + emoji?: string; + collections?: components["schemas"]["GetCollectionCategoriesCollectionDto"][]; + }; + GetCollectionCategoriesResponse: { + collectionCategories?: components["schemas"]["GetCollectionCategoriesDto"][]; + }; + GetCollectionSAnalysisResponse: { + /** + * @description 컬렉션 분야와 해당 컬렉션을 푼 횟수 map + * @example { + * "IT": 1, + * "RAW": 1 + * } + */ + collectionsAnalysis?: { + [key: string]: number; + }; + }; + CreateInviteLinkResponse: { + inviteLink?: string; + }; + DeleteInvalidQuizRequest: { + /** + * @example CHOICE_OR_QUESTION_MISSING, QUIZ_TYPE_MISMATCH, UNRELATED_QUIZ + * @enum {string} + */ + quizErrorType?: "CHOICE_OR_QUESTION_MISSING" | "QUIZ_TYPE_MISMATCH" | "UNRELATED_QUIZ"; + }; + DeleteDocumentRequest: { + documentIds?: number[]; + }; + }; + responses: never; + parameters: never; + requestBodies: never; + headers: never; + pathItems: never; +} +export type $defs = Record; +export interface operations { + saveFcmToken: { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + requestBody: { + content: { + "application/json;charset=UTF-8": components["schemas"]["SaveFcmTokenRequest"]; + }; + }; + responses: { + /** @description OK */ + 200: { + headers: { + [name: string]: unknown; + }; + content?: never; + }; + }; + }; + createTodayQuizForTest: { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description No Content */ + 204: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json;charset=UTF-8": components["schemas"]["CreateQuizzesResponse"]; + }; + }; + }; + }; + createMemberForTest: { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description No Content */ + 204: { + headers: { + [name: string]: unknown; + }; + content?: never; + }; + }; + }; + createMemberGeneratedQuizSet: { + parameters: { + query?: never; + header?: never; + path: { + document_id: number; + }; + cookie?: never; + }; + requestBody: { + content: { + "application/json;charset=UTF-8": components["schemas"]["CreateQuizzesByDocumentRequest"]; + }; + }; + responses: { + /** @description Created */ + 201: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json;charset=UTF-8": components["schemas"]["CreateQuizzesResponse"]; + }; + }; + 400: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": unknown; + }; + }; + }; + }; + createErrorCheckQuizSet: { + parameters: { + query?: never; + header?: never; + path: { + document_id: number; + }; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description Created */ + 201: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json;charset=UTF-8": components["schemas"]["CreateQuizzesResponse"]; + }; + }; + 400: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": unknown; + }; + }; + }; + }; + verifyAmount: { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + requestBody: { + content: { + "application/json;charset=UTF-8": components["schemas"]["SaveAmountRequest"]; + }; + }; + responses: { + /** @description OK */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json;charset=UTF-8": Record; + }; + }; + 400: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": unknown; + }; + }; + }; + }; + tempSaveAmount: { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + requestBody: { + content: { + "application/json;charset=UTF-8": components["schemas"]["SaveAmountRequest"]; + }; + }; + responses: { + /** @description OK */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json;charset=UTF-8": Record; + }; + }; + 400: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": unknown; + }; + }; + }; + }; + confirmPayment: { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + requestBody: { + content: { + "application/json;charset=UTF-8": components["schemas"]["TossPaymentRequest"]; + }; + }; + responses: { + /** @description OK */ + 200: { + headers: { + [name: string]: unknown; + }; + content?: never; + }; + }; + }; + cancelPayment: { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + requestBody: { + content: { + "application/json;charset=UTF-8": components["schemas"]["CancelPaymentRequest"]; + }; + }; + responses: { + /** @description OK */ + 200: { + headers: { + [name: string]: unknown; + }; + content?: never; + }; + }; + }; + messageSendSend: { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + requestBody: { + content: { + "application/json;charset=UTF-8": components["schemas"]["FcmMessageDto"]; + }; + }; + responses: { + /** @description OK */ + 200: { + headers: { + [name: string]: unknown; + }; + content?: never; + }; + }; + }; + messageSend: { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + requestBody: { + content: { + "application/json;charset=UTF-8": components["schemas"]["FcmNotificationRequestDto"]; + }; + }; + responses: { + /** @description OK */ + 200: { + headers: { + [name: string]: unknown; + }; + content?: never; + }; + }; + }; + login: { + parameters: { + query?: { + "invite-link"?: string; + }; + header?: never; + path?: never; + cookie?: never; + }; + requestBody: { + content: { + "application/json;charset=UTF-8": components["schemas"]["LoginRequest"]; + }; + }; + responses: { + /** @description OK */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json;charset=UTF-8": components["schemas"]["LoginResponse"]; + }; + }; + }; + }; + integratedSearchByKeyword: { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + requestBody: { + content: { + "application/json;charset=UTF-8": components["schemas"]["SearchRequest"]; + }; + }; + responses: { + /** @description OK */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json;charset=UTF-8": components["schemas"]["IntegratedSearchResponse"]; + }; + }; + 400: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": unknown; + }; + }; + }; + }; + createFeedback: { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + requestBody?: { + content: { + "multipart/form-data": components["schemas"]["CreateFeedbackRequest"]; + }; + }; + responses: { + /** @description Created */ + 201: { + headers: { + [name: string]: unknown; + }; + content?: never; + }; + 400: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": unknown; + }; + }; + }; + }; + createDocument: { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + requestBody?: { + content: { + "multipart/form-data": components["schemas"]["CreateDocumentRequest"]; + }; + }; + responses: { + /** @description Created */ + 201: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["CreateDocumentResponse"]; + }; + }; + 400: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": unknown; + }; + }; + }; + }; + searchDocumentByKeyword: { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + requestBody: { + content: { + "application/json;charset=UTF-8": components["schemas"]["SearchRequest"]; + }; + }; + responses: { + /** @description OK */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json;charset=UTF-8": components["schemas"]["SearchDocumentResponse"]; + }; + }; + 400: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": unknown; + }; + }; + }; + }; + getDirectories: { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description OK */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json;charset=UTF-8": components["schemas"]["GetAllDirectoriesResponse"]; + }; + }; + }; + }; + createDirectory: { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + requestBody: { + content: { + "application/json;charset=UTF-8": components["schemas"]["CreateDirectoryRequest"]; + }; + }; + responses: { + /** @description Created */ + 201: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json;charset=UTF-8": components["schemas"]["CreateDirectoryResponse"]; + }; + }; + 400: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": unknown; + }; + }; + }; + }; + getAllCollections: { + parameters: { + query?: { + "collection-sort-option"?: "POPULARITY" | "UPDATED"; + "collection-category"?: ("IT" | "LAW" | "BUSINESS_ECONOMY" | "SOCIETY_POLITICS" | "LANGUAGE" | "MEDICINE_PHARMACY" | "ART" | "SCIENCE_ENGINEERING" | "HISTORY_PHILOSOPHY" | "OTHER")[]; + "quiz-type"?: "MIX_UP" | "MULTIPLE_CHOICE"; + "quiz-count"?: number; + }; + header?: never; + path?: never; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description OK */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json;charset=UTF-8": components["schemas"]["CollectionResponseDto"]; + }; + }; + }; + }; + createCollection: { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + requestBody: { + content: { + "application/json;charset=UTF-8": components["schemas"]["CreateCollectionRequest"]; + }; + }; + responses: { + /** @description Created */ + 201: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json;charset=UTF-8": components["schemas"]["CreateCollectionResponse"]; + }; + }; + 400: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": unknown; + }; + }; + }; + }; + createCollectionBookmark: { + parameters: { + query?: never; + header?: never; + path: { + collection_id: number; + }; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description No Content */ + 204: { + headers: { + [name: string]: unknown; + }; + content?: never; + }; + 400: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": unknown; + }; + }; + }; + }; + createCollectionQuizSet: { + parameters: { + query?: never; + header?: never; + path: { + collection_id: number; + }; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description Created */ + 201: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json;charset=UTF-8": components["schemas"]["CreateQuizzesResponse"]; + }; + }; + }; + }; + sendVerificationCode: { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + requestBody: { + content: { + "application/json;charset=UTF-8": components["schemas"]["SendVerificationCodeRequest"]; + }; + }; + responses: { + /** @description OK */ + 200: { + headers: { + [name: string]: unknown; + }; + content?: never; + }; + }; + }; + verifyVerificationCode: { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + requestBody: { + content: { + "application/json;charset=UTF-8": components["schemas"]["VerifyVerificationCodeRequest"]; + }; + }; + responses: { + /** @description OK */ + 200: { + headers: { + [name: string]: unknown; + }; + content?: never; + }; + 400: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": unknown; + }; + }; + }; + }; + verifyInviteCode: { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + requestBody: { + content: { + "application/json;charset=UTF-8": components["schemas"]["VerifyInviteCode"]; + }; + }; + responses: { + /** @description OK */ + 200: { + headers: { + [name: string]: unknown; + }; + content?: never; + }; + 400: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": unknown; + }; + }; + }; + }; + updateWrongQuizResult: { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + requestBody: { + content: { + "application/json;charset=UTF-8": components["schemas"]["UpdateRandomQuizResultRequest"]; + }; + }; + responses: { + /** @description No Content */ + 204: { + headers: { + [name: string]: unknown; + }; + content?: never; + }; + }; + }; + updateRandomQuizResult: { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + requestBody: { + content: { + "application/json;charset=UTF-8": components["schemas"]["UpdateRandomQuizResultRequest"]; + }; + }; + responses: { + /** @description No Content */ + 204: { + headers: { + [name: string]: unknown; + }; + content?: never; + }; + }; + }; + updateQuizResult: { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + requestBody: { + content: { + "application/json;charset=UTF-8": components["schemas"]["UpdateQuizResultRequest"]; + }; + }; + responses: { + /** @description OK */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json;charset=UTF-8": components["schemas"]["UpdateQuizResultResponse"]; + }; + }; + 400: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": unknown; + }; + }; + }; + }; + updateTodayQuizCount: { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + requestBody: { + content: { + "application/json;charset=UTF-8": components["schemas"]["UpdateTodayQuizCountRequest"]; + }; + }; + responses: { + /** @description No Content */ + 204: { + headers: { + [name: string]: unknown; + }; + content?: never; + }; + 400: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": unknown; + }; + }; + }; + }; + updateQuizNotification: { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + requestBody: { + content: { + "application/json;charset=UTF-8": components["schemas"]["UpdateQuizNotificationRequest"]; + }; + }; + responses: { + /** @description No Content */ + 204: { + headers: { + [name: string]: unknown; + }; + content?: never; + }; + 400: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": unknown; + }; + }; + }; + }; + updateMemberName: { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + requestBody: { + content: { + "application/json;charset=UTF-8": components["schemas"]["UpdateMemberNameRequest"]; + }; + }; + responses: { + /** @description No Content */ + 204: { + headers: { + [name: string]: unknown; + }; + content?: never; + }; + 400: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": unknown; + }; + }; + }; + }; + updateInterestCollectionCategories: { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + requestBody: { + content: { + "application/json;charset=UTF-8": components["schemas"]["UpdateInterestCollectionCategoriesRequest"]; + }; + }; + responses: { + /** @description No Content */ + 204: { + headers: { + [name: string]: unknown; + }; + content?: never; + }; + 400: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": unknown; + }; + }; + }; + }; + updateDocumentName: { + parameters: { + query?: never; + header?: never; + path: { + document_id: number; + }; + cookie?: never; + }; + requestBody: { + content: { + "application/json;charset=UTF-8": components["schemas"]["UpdateDocumentNameRequest"]; + }; + }; + responses: { + /** @description No Content */ + 204: { + headers: { + [name: string]: unknown; + }; + content?: never; + }; + 400: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": unknown; + }; + }; + }; + }; + changeDocumentContent: { + parameters: { + query?: never; + header?: never; + path: { + document_id: number; + }; + cookie?: never; + }; + requestBody?: { + content: { + "multipart/form-data": components["schemas"]["UpdateDocumentContentRequest"]; + }; + }; + responses: { + /** @description No Content */ + 204: { + headers: { + [name: string]: unknown; + }; + content?: never; + }; + 400: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": unknown; + }; + }; + }; + }; + selectDocumentToNotGenerateByTodayQuiz: { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + requestBody: { + content: { + "application/json;charset=UTF-8": components["schemas"]["UpdateTodayQuizSettingsRequest"]; + }; + }; + responses: { + /** @description No Content */ + 204: { + headers: { + [name: string]: unknown; + }; + content?: never; + }; + }; + }; + moveDocumentToDirectory: { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + requestBody: { + content: { + "application/json;charset=UTF-8": components["schemas"]["MoveDocumentToDirectoryRequest"]; + }; + }; + responses: { + /** @description No Content */ + 204: { + headers: { + [name: string]: unknown; + }; + content?: never; + }; + 400: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": unknown; + }; + }; + }; + }; + updateDirectoryInfo: { + parameters: { + query?: never; + header?: never; + path: { + directory_id: number; + }; + cookie?: never; + }; + requestBody: { + content: { + "application/json;charset=UTF-8": components["schemas"]["UpdateDirectoryInfoRequest"]; + }; + }; + responses: { + /** @description No Content */ + 204: { + headers: { + [name: string]: unknown; + }; + content?: never; + }; + 400: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": unknown; + }; + }; + 403: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": unknown; + }; + }; + }; + }; + updateCollectionQuizzes: { + parameters: { + query?: never; + header?: never; + path: { + collection_id: number; + }; + cookie?: never; + }; + requestBody: { + content: { + "application/json;charset=UTF-8": components["schemas"]["UpdateCollectionQuizzesRequest"]; + }; + }; + responses: { + /** @description No Content */ + 204: { + headers: { + [name: string]: unknown; + }; + content?: never; + }; + 400: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": unknown; + }; + }; + }; + }; + updateCollectionInfo: { + parameters: { + query?: never; + header?: never; + path: { + collection_id: number; + }; + cookie?: never; + }; + requestBody: { + content: { + "application/json;charset=UTF-8": components["schemas"]["UpdateCollectionInfoRequest"]; + }; + }; + responses: { + /** @description No Content */ + 204: { + headers: { + [name: string]: unknown; + }; + content?: never; + }; + 400: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": unknown; + }; + }; + }; + }; + addQuizToCollection: { + parameters: { + query?: never; + header?: never; + path: { + collection_id: number; + }; + cookie?: never; + }; + requestBody: { + content: { + "application/json;charset=UTF-8": components["schemas"]["AddQuizToCollectionRequest"]; + }; + }; + responses: { + /** @description No Content */ + 204: { + headers: { + [name: string]: unknown; + }; + content?: never; + }; + 400: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": unknown; + }; + }; + }; + }; + getCurrentTodayQuizInfo: { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description OK */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json;charset=UTF-8": components["schemas"]["GetCurrentTodayQuizInfo"]; + }; + }; + }; + }; + getSingleQuizSetRecord: { + parameters: { + query?: never; + header?: never; + path: { + quiz_set_id: string; + quiz_set_type: "TODAY_QUIZ_SET" | "DOCUMENT_QUIZ_SET" | "COLLECTION_QUIZ_SET" | "FIRST_QUIZ_SET"; + }; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description OK */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json;charset=UTF-8": components["schemas"]["GetSingleQuizSetRecordResponse"]; + }; + }; + 400: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": unknown; + }; + }; + }; + }; + getAllQuizzesAndCollectionRecords: { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description OK */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json;charset=UTF-8": components["schemas"]["GetQuizRecordResponse"]; + }; + }; + 400: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": unknown; + }; + }; + }; + }; + getQuizSetByCollection: { + parameters: { + query: { + "collection-id"?: number; + "quiz-set-type": "TODAY_QUIZ_SET" | "DOCUMENT_QUIZ_SET" | "COLLECTION_QUIZ_SET" | "FIRST_QUIZ_SET"; + }; + header?: never; + path: { + quiz_set_id: string; + }; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description OK */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json;charset=UTF-8": components["schemas"]["GetQuizSetResponse"]; + }; + }; + }; + }; + getQuizSetToday: { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description OK */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json;charset=UTF-8": components["schemas"]["GetQuizSetTodayResponse"]; + }; + }; + }; + }; + getQuizAnswerRateAnalysis: { + parameters: { + query?: { + "directory-id"?: number; + week?: string; + month?: string; + }; + header?: never; + path?: never; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description OK */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json;charset=UTF-8": components["schemas"]["GetQuizAnswerRateAnalysisResponse"]; + }; + }; + }; + }; + getPaymentByPaymentKey: { + parameters: { + query?: never; + header?: never; + path: { + payment_key: string; + }; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description OK */ + 200: { + headers: { + [name: string]: unknown; + }; + content?: never; + }; + }; + }; + getPaymentByOrderId: { + parameters: { + query?: never; + header?: never; + path: { + order_id: string; + }; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description OK */ + 200: { + headers: { + [name: string]: unknown; + }; + content?: never; + }; + }; + }; + oauthUrlApi: { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description OK */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json;charset=UTF-8": components["schemas"]["RedirectView"]; + }; + }; + }; + }; + getNotionPages: { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description OK */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json;charset=UTF-8": string; + }; + }; + }; + }; + getNotionPage: { + parameters: { + query?: never; + header?: never; + path: { + page_id: string; + }; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description OK */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json;charset=UTF-8": string; + }; + }; + }; + }; + verifyNotion: { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description OK */ + 200: { + headers: { + [name: string]: unknown; + }; + content?: never; + }; + }; + }; + notionCallback: { + parameters: { + query: { + code: string; + }; + header?: never; + path?: never; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description OK */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json;charset=UTF-8": string; + }; + }; + }; + }; + getMemberInfo: { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description OK */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json;charset=UTF-8": components["schemas"]["GetMemberInfoResponse"]; + }; + }; + 400: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": unknown; + }; + }; + }; + }; + getIncorrectQuizzes: { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description OK */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json;charset=UTF-8": components["schemas"]["QuizResponseDto"]; + }; + }; + }; + }; + healthCheck: { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description OK */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json;charset=UTF-8": string; + }; + }; + }; + }; + getSingleDocument: { + parameters: { + query?: never; + header?: never; + path: { + document_id: number; + }; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description OK */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json;charset=UTF-8": components["schemas"]["GetSingleDocumentResponse"]; + }; + }; + 400: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": unknown; + }; + }; + }; + }; + getDocumentsNeedingReviewPick: { + parameters: { + query?: never; + header?: never; + path: { + document_id: number; + }; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description OK */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json;charset=UTF-8": components["schemas"]["GetDocumentsNeedingReviewPickResponse"]; + }; + }; + }; + }; + getGeneratedQuizzes: { + parameters: { + query?: { + "quiz-type"?: "MIX_UP" | "MULTIPLE_CHOICE"; + }; + header?: never; + path: { + document_id: number; + }; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description OK */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json;charset=UTF-8": components["schemas"]["QuizResponseDto"]; + }; + }; + }; + }; + downloadQuizzes: { + parameters: { + query?: never; + header?: never; + path: { + document_id: number; + }; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description OK */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json;charset=UTF-8": string[]; + }; + }; + }; + }; + getDocumentsNeedingReview: { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description OK */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json;charset=UTF-8": components["schemas"]["GetDocumentsNeedingReviewResponse"]; + }; + }; + }; + }; + getSingleDirectory: { + parameters: { + query?: never; + header?: never; + path: { + directory_id: number; + }; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description OK */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json;charset=UTF-8": components["schemas"]["GetSingleDirectoryResponse"]; + }; + }; + 400: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": unknown; + }; + }; + }; + }; + deleteDirectory: { + parameters: { + query?: never; + header?: never; + path: { + directory_id: number; + }; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description No Content */ + 204: { + headers: { + [name: string]: unknown; + }; + content?: never; + }; + 400: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": unknown; + }; + }; + 403: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": unknown; + }; + }; + }; + }; + getAllQuizzesByMemberId: { + parameters: { + query?: never; + header?: never; + path: { + directory_id: number; + }; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description OK */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json;charset=UTF-8": components["schemas"]["QuizResponseDto"]; + }; + }; + }; + }; + getAllDocuments: { + parameters: { + query?: { + "directory-id"?: number; + "sort-option"?: "CREATED_AT" | "UPDATED_AT"; + }; + header?: never; + path?: never; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description OK */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json;charset=UTF-8": components["schemas"]["GetAllDocumentsResponse"]; + }; + }; + 400: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": unknown; + }; + }; + }; + }; + searchCollections: { + parameters: { + query?: never; + header?: never; + path: { + keyword: string; + }; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description OK */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json;charset=UTF-8": components["schemas"]["CollectionResponseDto"]; + }; + }; + }; + }; + getCollectionInfoByCollectionId: { + parameters: { + query?: never; + header?: never; + path: { + collection_id: number; + }; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description OK */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json;charset=UTF-8": components["schemas"]["GetSingleCollectionResponse"]; + }; + }; + 400: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": unknown; + }; + }; + }; + }; + getQuizzesInCollectionByCollectionCategory: { + parameters: { + query?: never; + header?: never; + path: { + collection_category: "IT" | "LAW" | "BUSINESS_ECONOMY" | "SOCIETY_POLITICS" | "LANGUAGE" | "MEDICINE_PHARMACY" | "ART" | "SCIENCE_ENGINEERING" | "HISTORY_PHILOSOPHY" | "OTHER"; + }; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description OK */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json;charset=UTF-8": components["schemas"]["GetQuizzesInCollectionByCollectionCategory"]; + }; + }; + }; + }; + getAllByMemberId: { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description OK */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json;charset=UTF-8": components["schemas"]["CollectionResponseDto"]; + }; + }; + }; + }; + getInterestCategoryCollections: { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description OK */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json;charset=UTF-8": components["schemas"]["CollectionResponseDto"]; + }; + }; + 400: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": unknown; + }; + }; + }; + }; + getCollectionCategories: { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description OK */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json;charset=UTF-8": components["schemas"]["GetCollectionCategoriesResponse"]; + }; + }; + }; + }; + getAllByMemberIdAndBookmarked: { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description OK */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json;charset=UTF-8": components["schemas"]["CollectionResponseDto"]; + }; + }; + }; + }; + getCollectionAnalysis: { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description OK */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json;charset=UTF-8": components["schemas"]["GetCollectionSAnalysisResponse"]; + }; + }; + }; + }; + googleLogin: { + parameters: { + query: { + code: string; + }; + header?: never; + path?: never; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description OK */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json;charset=UTF-8": string; + }; + }; + }; + }; + createInviteLink: { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description Created */ + 201: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json;charset=UTF-8": components["schemas"]["CreateInviteLinkResponse"]; + }; + }; + 400: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": unknown; + }; + }; + }; + }; + deleteInvalidQuiz: { + parameters: { + query?: never; + header?: never; + path: { + quiz_id: number; + }; + cookie?: never; + }; + requestBody: { + content: { + "application/json;charset=UTF-8": components["schemas"]["DeleteInvalidQuizRequest"]; + }; + }; + responses: { + /** @description No Content */ + 204: { + headers: { + [name: string]: unknown; + }; + content?: never; + }; + 400: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": unknown; + }; + }; + }; + }; + deleteQuiz: { + parameters: { + query?: never; + header?: never; + path: { + quiz_id: number; + }; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description No Content */ + 204: { + headers: { + [name: string]: unknown; + }; + content?: never; + }; + 400: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": unknown; + }; + }; + }; + }; + deleteDocument: { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + requestBody: { + content: { + "application/json;charset=UTF-8": components["schemas"]["DeleteDocumentRequest"]; + }; + }; + responses: { + /** @description No Content */ + 204: { + headers: { + [name: string]: unknown; + }; + content?: never; + }; + 400: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": unknown; + }; + }; + }; + }; + deleteCollection: { + parameters: { + query?: never; + header?: never; + path: { + collection_id: number; + }; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description No Content */ + 204: { + headers: { + [name: string]: unknown; + }; + content?: never; + }; + 400: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": unknown; + }; + }; + }; + }; + deleteCollectionBookmark: { + parameters: { + query?: never; + header?: never; + path: { + collection_id: number; + }; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description No Content */ + 204: { + headers: { + [name: string]: unknown; + }; + content?: never; + }; + 400: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": unknown; + }; + }; + }; + }; +} diff --git a/src/types/user.d.ts b/src/types/user.d.ts index 2859e544..c2ff3adc 100644 --- a/src/types/user.d.ts +++ b/src/types/user.d.ts @@ -1,3 +1,6 @@ +import { DeepRequired } from 'react-hook-form' +import { paths } from './schema' + type interestedCategory = | 'IT' | 'LAW' @@ -25,44 +28,38 @@ interface UserInfo { quizNotificationEnabled: boolean } -interface UpdateTodayQuizCountPayload { - todayQuizCount: number -} - -interface UpdateQuizNotificationPayload { - quizNotificationEnabled: boolean -} - -interface UpdateNamePayload { - name: string -} - -interface UpdateCollectionFieldsPayload { - interestCollectionFields: interestedCategory[] -} - -declare namespace User { - type Info = UserInfo +declare global { + declare namespace User { + type Info = UserInfo - declare namespace Request { - /** PATCH /api/v2/members/update-today-quiz-count - * 오늘의 퀴즈 관리(오늘의 퀴즈 개수 설정) - */ - type UpdateTodayQuizCount = UpdateTodayQuizCountPayload + declare namespace Request { + /** PATCH /api/v2/members/update-today-quiz-count + * 오늘의 퀴즈 관리(오늘의 퀴즈 개수 설정) + */ + type UpdateTodayQuizCount = DeepRequired< + paths['/api/v2/members/update-today-quiz-count']['patch']['requestBody']['content']['application/json;charset=UTF-8'] + > - /** PATCH /api/v2/members/update-quiz-notification - * 사용자 퀴즈 알림 ON/OFF - */ - type UpdateQuizNotification = UpdateQuizNotificationPayload + /** PATCH /api/v2/members/update-quiz-notification + * 사용자 퀴즈 알림 ON/OFF + */ + type UpdateQuizNotification = DeepRequired< + paths['/api/v2/members/update-quiz-notification']['patch']['requestBody']['content']['application/json;charset=UTF-8'] + > - /** PATCH /api/v2/members/update-name - * 사용자 이름 수정 - */ - type UpdateName = UpdateNamePayload + /** PATCH /api/v2/members/update-name + * 사용자 이름 수정 + */ + type UpdateName = DeepRequired< + paths['/api/v2/members/update-name']['patch']['requestBody']['content']['application/json;charset=UTF-8'] + > - /** PATCH /api/v2/members/update-collection-fields - * 관심분야 태그 설정 - */ - type UpdateCollectionFields = UpdateCollectionFieldsPayload + /** PATCH /api/v2/members/update-collection-fields + * 관심분야 태그 설정 + */ + type UpdateCollectionFields = DeepRequired< + paths['/api/v2/members/update-collection-categories']['patch']['requestBody']['content']['application/json;charset=UTF-8'] + > + } } } diff --git a/tsconfig.json b/tsconfig.json index 7b285893..81b17d03 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -12,6 +12,7 @@ "isolatedModules": true, "jsx": "preserve", "incremental": true, + "noUncheckedIndexedAccess": true, "plugins": [ { "name": "next"