From dbd4e30be49163fefb4f5c1e40210ff377bf6326 Mon Sep 17 00:00:00 2001 From: rito528 <39003544+rito528@users.noreply.github.com> Date: Fri, 14 Jun 2024 14:44:27 +0900 Subject: [PATCH] =?UTF-8?q?chore:=20API=E5=AE=9A=E7=BE=A9=E3=82=92typespec?= =?UTF-8?q?=E3=81=AB=E7=BD=AE=E3=81=8D=E6=8F=9B=E3=81=88=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../workflows/compile-typespec-and-deploy.yml | 59 ++ .github/workflows/lint-openapi.yml | 55 +- .github/workflows/pub-docs.yml | 43 - .gitignore | 3 +- docker/Dockerfile | 2 +- docker/entrypoint.sh | 4 +- endpoints/forms.tsp | 347 ++++++++ endpoints/users.tsp | 47 + main.tsp | 21 + models/errors.tsp | 11 + models/form.tsp | 83 ++ models/user.tsp | 10 + package-lock.json | 818 ++++++++++++++++++ package.json | 13 + schema/openapi.yml | 53 -- schema/paths/forms/[formId]/answers/index.yml | 24 - schema/paths/forms/[formId]/index.yml | 79 -- .../paths/forms/[formId]/questions/index.yml | 23 - schema/paths/forms/answers/comment/index.yml | 75 -- schema/paths/forms/answers/index.yml | 46 - schema/paths/forms/index.yml | 90 -- schema/paths/forms/labels/index.yml | 73 -- schema/paths/forms/questions/index.yml | 83 -- schema/paths/users/[uuid]/index.yml | 21 - schema/paths/users/index.yml | 19 - schema/paths/users/list/index.yml | 21 - schema/types/forms/components.yml | 219 ----- schema/types/forms/definitions.yml | 147 ---- schema/types/forms/parameters.yml | 75 -- schema/types/users/components.yml | 15 - schema/types/users/definitions.yml | 18 - schema/types/users/parameters.yml | 15 - tspconfig.yaml | 2 + 33 files changed, 1446 insertions(+), 1168 deletions(-) create mode 100644 .github/workflows/compile-typespec-and-deploy.yml delete mode 100644 .github/workflows/pub-docs.yml create mode 100644 endpoints/forms.tsp create mode 100644 endpoints/users.tsp create mode 100644 main.tsp create mode 100644 models/errors.tsp create mode 100644 models/form.tsp create mode 100644 models/user.tsp create mode 100644 package-lock.json create mode 100644 package.json delete mode 100644 schema/openapi.yml delete mode 100644 schema/paths/forms/[formId]/answers/index.yml delete mode 100644 schema/paths/forms/[formId]/index.yml delete mode 100644 schema/paths/forms/[formId]/questions/index.yml delete mode 100644 schema/paths/forms/answers/comment/index.yml delete mode 100644 schema/paths/forms/answers/index.yml delete mode 100644 schema/paths/forms/index.yml delete mode 100644 schema/paths/forms/labels/index.yml delete mode 100644 schema/paths/forms/questions/index.yml delete mode 100644 schema/paths/users/[uuid]/index.yml delete mode 100644 schema/paths/users/index.yml delete mode 100644 schema/paths/users/list/index.yml delete mode 100644 schema/types/forms/components.yml delete mode 100644 schema/types/forms/definitions.yml delete mode 100644 schema/types/forms/parameters.yml delete mode 100644 schema/types/users/components.yml delete mode 100644 schema/types/users/definitions.yml delete mode 100644 schema/types/users/parameters.yml create mode 100644 tspconfig.yaml diff --git a/.github/workflows/compile-typespec-and-deploy.yml b/.github/workflows/compile-typespec-and-deploy.yml new file mode 100644 index 0000000..6a5fe7b --- /dev/null +++ b/.github/workflows/compile-typespec-and-deploy.yml @@ -0,0 +1,59 @@ +name: typespec-compile-and-deploy-gh-pages +on: + push: + branches: + - main + +jobs: + compile: + runs-on: ubuntu-22.04 + steps: + - name: checkout + uses: actions/checkout@v4 + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: "20" + + - name: Install typespec + run: npm install -g @typespec/compiler + + - name: Cache npm modules + uses: actions/cache@v4 + with: + path: node_modules + key: ${{ runner.os }}-node-${{ hashFiles('package-lock.json') }} + restore-keys: | + ${{ runner.os }}-node- + + - name: Install node_modules + run: npm ci + + - name: Compile typespec + run: tsp compile . + + - name: Install redocly-cli + uses: ./.github/actions/install-redocly-cli + + - name: Build docs + run: redocly build-docs tsp-output/@typespec/openapi3/openapi.yaml -o ./docs/index.html -t ./.github/template.hbs + + - name: Upload artifact + uses: actions/upload-pages-artifact@v3 + with: + path: ./docs + + deploy-github-pages: + needs: compile + permissions: + pages: write + id-token: write + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + runs-on: ubuntu-22.04 + steps: + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v4 diff --git a/.github/workflows/lint-openapi.yml b/.github/workflows/lint-openapi.yml index 1f08495..abe4149 100644 --- a/.github/workflows/lint-openapi.yml +++ b/.github/workflows/lint-openapi.yml @@ -1,29 +1,32 @@ -name: Lint OpenAPI +name: Lint Typespec OpenAPI Definitions on: - pull_request: - branches: - - main - workflow_call: + push: + jobs: - lint-definitions: - name: Lint OpenAPI definitions - runs-on: ubuntu-latest + check-format: + runs-on: ubuntu-22.04 steps: - - uses: actions/checkout@v4 - - name: Install redocly-cli - uses: ./.github/actions/install-redocly-cli - - name: Lint OpenAPI yml - run: redocly lint ./schema/openapi.yml - lint-examples: - name: Lint OpenAPI examples - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - name: Install redocly-cli - uses: ./.github/actions/install-redocly-cli - - name: Bundle OpenAPI yml - run: redocly bundle ./schema/openapi.yml -o ./bundled-openapi.yml - - name: Install openapi-examples-validator - run: npm install -g openapi-examples-validator - - name: Lint examples - run: openapi-examples-validator ./bundled-openapi.yml + - name: checkout + uses: actions/checkout@v4 + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: "20" + + - name: Install typespec + run: npm install -g @typespec/compiler + + - name: Cache npm modules + uses: actions/cache@v4 + with: + path: node_modules + key: ${{ runner.os }}-node-${{ hashFiles('package-lock.json') }} + restore-keys: | + ${{ runner.os }}-node- + + - name: Install node_modules + run: npm ci + + - name: Check format + run: tsp format --check "**/*.tsp" diff --git a/.github/workflows/pub-docs.yml b/.github/workflows/pub-docs.yml deleted file mode 100644 index e6c43e8..0000000 --- a/.github/workflows/pub-docs.yml +++ /dev/null @@ -1,43 +0,0 @@ -name: Lint and Publish OpenAPI Documents -on: - push: - branches: - - main - workflow_dispatch: -concurrency: - group: pages - cancel-in-progress: true -jobs: - lint: - name: Lint - uses: ./.github/workflows/lint-openapi.yml - build: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - name: Setup Pages - uses: actions/configure-pages@v4 - - name: Install redocly-cli - uses: ./.github/actions/install-redocly-cli - - name: Build docs - run: redocly build-docs ./schema/openapi.yml -o ./docs/index.html -t ./.github/template.hbs - - name: Upload artifact - uses: actions/upload-pages-artifact@v3 - with: - path: ./docs - deploy: - runs-on: ubuntu-latest - needs: - - lint - - build - environment: - name: github-pages - url: ${{ steps.deployment.outputs.page_url }} - permissions: - contents: read - pages: write - id-token: write - steps: - - name: Deploy to GitHub Pages - id: deployment - uses: actions/deploy-pages@v4 diff --git a/.gitignore b/.gitignore index 539d70d..622fc9a 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ .idea -docs +node_modules +**/tsp-output diff --git a/docker/Dockerfile b/docker/Dockerfile index 9b912d0..64a4dd5 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -6,7 +6,7 @@ ENV PORT=8080 EXPOSE 8080 -RUN npm install -g @redocly/cli http-server +RUN npm install -g @typespec/compiler @redocly/cli http-server USER node WORKDIR /tmp/files diff --git a/docker/entrypoint.sh b/docker/entrypoint.sh index dd1066a..7796fe4 100644 --- a/docker/entrypoint.sh +++ b/docker/entrypoint.sh @@ -1,4 +1,6 @@ #!/bin/bash -redocly build-docs /schema/openapi.yml -o ./docs/index.html -t ./template.hbs +tsp compile . + +redocly build-docs ./tsp-output/@typespec/openapi3/openapi.yaml -o ./docs/index.html -t ./template.hbs http-server ./docs -p $PORT diff --git a/endpoints/forms.tsp b/endpoints/forms.tsp new file mode 100644 index 0000000..0d3b7ac --- /dev/null +++ b/endpoints/forms.tsp @@ -0,0 +1,347 @@ +import "@typespec/http"; +import "@typespec/rest"; +import "../models/errors.tsp"; +import "../models/form.tsp"; + +@service +namespace SeichiPortalApiSchema; + +using TypeSpec.Http; +using TypeSpec.Rest; + +@tag("Forms") +@route("/forms") +namespace Forms { + +/** + * フォームを新しく作ります。 + * + * 作られたフォームのIDがJSONとして返却され、作成されたフォームへのURLを含むHeaderが返されます。 + * + */ +@post +@summary("フォームの新規作成") +op create( + @header + contentType: "application/json", + @body body: { + title: string; + description?: string; + } +): { + @statusCode statusCode: 201; + @header Location: string; + @body body: { + id: uint32; + }; +} | { + @statusCode statusCode: 400 | 401 | 403 | 500; + @body body: Error; +}; + + +/** + * フォームの一覧を返す。 + * + * このエンドポイントでは最小限のフォーム情報を含むリストが返されます。 + * + * また、取得パラメータとしてlimitとoffsetを指定し、取得件数を絞り込むことができます。 + * レスポンス内容はid基準とし、昇順ソートしたものになります。 + * ※各フォームの詳細情報などは別APIを利用することを想定しています。 + */ +@get +@summary("フォームの一覧取得") +op list( + @doc("取得件数の下限値 例えば、offsetを1とすると2件目からのデータが取得できます。") + @query + offset: uint32, + @doc("取得件数の上限値 例えば、limitを10とすると10番目までのデータが取得できます。") + @minValue(1) + @query + limit: uint32 +): { + @statusCode statusCode: 200; + @body body: MinimalForm[]; +} | { + @statusCode statusCode: 400 | 401 | 500; + @body body: Error; +}; + +@route("/{formId}") +namespace IndividualForm { + + @get + @summary("フォームの詳細取得") + op get( + @path formId: uint32 + ): { + @statusCode statusCode: 200; + @body body: Form; + } | { + @statusCode statusCode: 400 | 401 | 403 | 404 | 500; + @body body: Error; + }; + + @delete + @summary("フォームの削除") + op delete( + @path formId: uint32 + ): { + @statusCode statusCode: 200; + } | { + @statusCode statusCode: 400 | 401 | 403 | 404 | 500; + @body body: Error; + }; + + /** + * フォームの設定値を変更するエンドポイント。 + * 回答可能期間を新たに設定する場合、start_atとend_atの両方を指定してください。 + */ + @patch + @summary("フォームの値を更新する") + op update( + @path formId: uint32, + @query title?: string, + @query description?: string, + @query start_at?: utcDateTime, + @query end_at?: utcDateTime, + @query webhook_url?: url, + /** + * 各回答に対して自動でつけられるタイトルを設定します。 + * `$[question_id]`と指定することで、`question_id`の質問の回答をタイトルに含めることができます。 + */ + @query default_answer_title?: string, + @query visibility?: Visibility, + ): { + @statusCode statusCode: 200; + @body body: Form; + } | { + @statusCode statusCode: 400 | 401 | 403 | 404 | 500; + @body body: Error; + }; + + @route("/questions") + @summary("フォームの質問一覧取得") + op listQuestions( + @path formId: uint32 + ): { + @statusCode statusCode: 200; + @body body: Question[]; + } | { + @statusCode statusCode: 400 | 401 | 404 | 500; + @body body: Error; + }; + + + @route("/answers") + @summary("フォームの回答一覧取得") + op listAnswers( + @path formId: uint32 + ): { + @statusCode statusCode: 200; + @body body: Answer[]; + } | { + @statusCode statusCode: 400 | 401 | 404 | 500; + @body body: Error; + }; + +} + +@route("/questions") +namespace Questions { + + @post + @summary("質問の新規作成") + op create( + @header + contentType: "application/json", + @body body: { + form_id: uint32; + questions: Question[]; + } + ): { + @statusCode statusCode: 201; + @body body: { + id: uint32; + }; + } | { + @statusCode statusCode: 400 | 401 | 403 | 500; + @body body: Error; + }; + + @delete + @summary("質問の削除") + op delete( + @body body: { + question_id: uint32; + } + ): { + @statusCode statusCode: 200; + } | { + @statusCode statusCode: 400 | 401 | 403 | 404 | 500; + @body body: Error; + }; + + @put + @summary("質問の置き換え") + op replace( + @body body: { + form_id: uint32; + questions: Question[]; + } + ): { + @statusCode statusCode: 200; + } | { + @statusCode statusCode: 400 | 401 | 403 | 404 | 500; + @body body: Error; + }; + +} + +@route("/answers") +namespace Answers { + + @get + @summary("回答の一覧取得") + op list(): { + @statusCode statusCode: 200; + @body body: Answer[]; + } | { + @statusCode statusCode: 400 | 401 | 403 | 500; + @body body: Error; + }; + + @post + @summary("指定されたフォームに回答を追加する") + op create( + @header + contentType: "application/json", + @body body: { + form_id: uint32; + answers: RealAnswer[]; + } + ): { + @statusCode statusCode: 201; + @body body: { + id: uint32; + }; + } | { + @statusCode statusCode: 400 | 401 | 403 | 500; + @body body: Error; + }; + + + @route("/labels") + namespace Labels { + + @post + @summary("フォームの回答につけられるラベルを作成する") + op createLabel( + @header + contentType: "application/json", + @body body: Label + ): { + @statusCode statusCode: 201; + } | { + @statusCode statusCode: 400 | 401 | 403 | 404 | 500; + @body body: Error; + }; + + @delete + @summary("フォームの回答につけられるラベルを削除する") + op deleteLabel( + @body body: { + id: uint32; + } + ): { + @statusCode statusCode: 200; + } | { + @statusCode statusCode: 400 | 401 | 403 | 404 | 500; + @body body: Error; + }; + + } + + @route("/comment") + namespace Comment { + + @post + @summary("回答にコメントを追加する") + op create( + @header + contentType: "application/json", + @body body: { + answer_id: uint32; + content: string; + } + ): { + @statusCode statusCode: 201; + } | { + @statusCode statusCode: 400 | 401 | 403 | 404 | 500; + @body body: Error; + }; + + @delete + @summary("回答のコメントを削除する") + op delete( + @body body: { + comment_id: uint32; + } + ): { + @statusCode statusCode: 200; + } | { + @statusCode statusCode: 400 | 401 | 403 | 404 | 500; + @body body: Error; + }; + + @patch + @summary("回答のコメントを更新する") + op update( + @body body: { + comment_id: uint32; + content: string; + } + ): { + @statusCode statusCode: 200; + } | { + @statusCode statusCode: 400 | 401 | 403 | 404 | 500; + @body body: Error; + }; + + } + + } + + @route("/labels") + namespace Labels { + + @post + @summary("フォームにつけられるラベルを作成する") + op create( + @header + contentType: "application/json", + @body body: Label + ): { + @statusCode statusCode: 201; + } | { + @statusCode statusCode: 400 | 401 | 403 | 404 | 500; + @body body: Error; + }; + + @delete + @summary("フォームにつけられるラベルを削除する") + op delete( + @body body: { + id: uint32; + } + ): { + @statusCode statusCode: 200; + } | { + @statusCode statusCode: 400 | 401 | 403 | 404 | 500; + @body body: Error; + }; + + } +} + + diff --git a/endpoints/users.tsp b/endpoints/users.tsp new file mode 100644 index 0000000..8c52626 --- /dev/null +++ b/endpoints/users.tsp @@ -0,0 +1,47 @@ +import "@typespec/http"; +import "@typespec/rest"; +import "../models/errors.tsp"; +import "../models/user.tsp"; + +using TypeSpec.Http; +using TypeSpec.Rest; + +namespace SeichiPortalApiSchema; + +@tag("Users") +@route("/users") +namespace Users { + @get + @summary("自身のユーザー情報の取得") + op get(): { + @statusCode statusCode: 200; + @body body: User; + } | { + @statusCode statusCode: 400 | 401 | 403 | 500; + @body body: Error; + }; + + @patch + @summary("ユーザー情報を更新する") + @route("/{uuid}") + op update( + @path uuid: string; + @query role: Role; + ): { + @statusCode statusCode: 200; + } | { + @statusCode statusCode: 400 | 401 | 403 | 404 | 500; + @body body: Error; + }; + + @get + @summary("ユーザー一覧の取得") + @route("/list") + op list(): { + @statusCode statusCode: 200; + @body body: User[]; + } | { + @statusCode statusCode: 400 | 401 | 403 | 500; + @body body: Error; + }; +} diff --git a/main.tsp b/main.tsp new file mode 100644 index 0000000..500e71e --- /dev/null +++ b/main.tsp @@ -0,0 +1,21 @@ +import "./endpoints/forms.tsp"; +import "./endpoints/users.tsp"; +import "@typespec/openapi"; + +using TypeSpec.Http; +using TypeSpec.Rest; +using TypeSpec.OpenAPI; + +@service({ + title: "seichi-portal-api-schema" +}) +@server("http://localhost:9000", "開発環境") +@useAuth(BearerAuth) +@info({ + license: { + name: "Apache 2.0", + url: "http://www.apache.org/licenses/LICENSE-2.0.html" + } +}) +namespace SeichiPortalApiSchema; + diff --git a/models/errors.tsp b/models/errors.tsp new file mode 100644 index 0000000..e89027c --- /dev/null +++ b/models/errors.tsp @@ -0,0 +1,11 @@ +enum ErrorCode { + FORM_NOT_FOUND, + OUT_OF_PERIOD, + DO_NOT_HAVE_PERMISSION_TO_POST_FORM_COMMENT, + INTERNAL_SERVER_ERROR +} + +model Error { + errorCode: ErrorCode; + reason: string; +} diff --git a/models/form.tsp b/models/form.tsp new file mode 100644 index 0000000..f1453f3 --- /dev/null +++ b/models/form.tsp @@ -0,0 +1,83 @@ +model ResponsePeriod { + start_at: utcDateTime; + end_at: utcDateTime; +} + +/** + * 必要最低限の情報を含むフォーム + * + * 設定権限を持たないユーザーが必要な情報を取得するために使用することを想定 + */ +model MinimalForm { + id: uint32; + title: string; + description?: string; + response_period: ResponsePeriod; +} + +/** + * PUBLIC: 全体公開 + * PRIVATE: 非公開 + */ +enum Visibility { + PUBLIC: "PUBLIC", + PRIVATE: "PRIVATE" +} + +/** + * TEXT: 文章形式 + * MULTIPLE: 複数選択 + * SINGLE: 単一選択 + */ +enum QuestionType { + TEXT: "TEXT", + SINGLE: "SINGLE", + MULTIPLE: "MULTIPLE" +} + +model Question { + id: uint32; + title: string; + description: string; + question_type: QuestionType; + choices: string[]; + is_required: boolean; +} + +model Form { + id: uint32; + title: string; + description?: string; + settings: { + response_period: ResponsePeriod; + /** + * フォームに関する何らかのアクションが行われたときに通知を行うURL + */ + webhook_url: url; + default_title: string; + visibility: Visibility; + }; + metadata: { + created_at: utcDateTime; + updated_at: utcDateTime; + }; + questions: Question[] +} + +model RealAnswer { + @visibility("read") + question_id: uint32; + answer: string; +} + +model Answer { + form_id: uint32; + title: string; + answers: RealAnswer[]; +} + +model Label { + @visibility("read") + id: uint32; + name: string; +} diff --git a/models/user.tsp b/models/user.tsp new file mode 100644 index 0000000..9bca960 --- /dev/null +++ b/models/user.tsp @@ -0,0 +1,10 @@ +enum Role { + STANDARD_USER, + ADMINISTRATOR, +} + +model User { + uuid: string; + name: string; + role: Role +} diff --git a/package-lock.json b/package-lock.json new file mode 100644 index 0000000..a2a6438 --- /dev/null +++ b/package-lock.json @@ -0,0 +1,818 @@ +{ + "name": "seichi-portal-api-schema", + "version": "0.1.0", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "seichi-portal-api-schema", + "version": "0.1.0", + "dependencies": { + "@typespec/compiler": "^0.56.0", + "@typespec/http": "latest", + "@typespec/openapi": "^0.56.0", + "@typespec/openapi3": "^0.56.0", + "@typespec/rest": "latest" + } + }, + "node_modules/@babel/code-frame": { + "version": "7.24.6", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.24.6.tgz", + "integrity": "sha512-ZJhac6FkEd1yhG2AHOmfcXG4ceoLltoCVJjN5XsWN9BifBQr+cHJbWi0h68HZuSORq+3WtJ2z0hwF2NG1b5kcA==", + "dependencies": { + "@babel/highlight": "^7.24.6", + "picocolors": "^1.0.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-validator-identifier": { + "version": "7.24.6", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.24.6.tgz", + "integrity": "sha512-4yA7s865JHaqUdRbnaxarZREuPTHrjpDT+pXoAZ1yhyo6uFnIEpS8VMu16siFOHDpZNKYv5BObhsB//ycbICyw==", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/highlight": { + "version": "7.24.6", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.24.6.tgz", + "integrity": "sha512-2YnuOp4HAk2BsBrJJvYCbItHx0zWscI1C3zgWkz+wDyD9I7GIVrfnLyrR4Y1VR+7p+chAEcrgRQYZAGIKMV7vQ==", + "dependencies": { + "@babel/helper-validator-identifier": "^7.24.6", + "chalk": "^2.4.2", + "js-tokens": "^4.0.0", + "picocolors": "^1.0.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@nodelib/fs.scandir": { + "version": "2.1.5", + "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", + "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==", + "dependencies": { + "@nodelib/fs.stat": "2.0.5", + "run-parallel": "^1.1.9" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/@nodelib/fs.stat": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz", + "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==", + "engines": { + "node": ">= 8" + } + }, + "node_modules/@nodelib/fs.walk": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz", + "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==", + "dependencies": { + "@nodelib/fs.scandir": "2.1.5", + "fastq": "^1.6.0" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/@sindresorhus/merge-streams": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/@sindresorhus/merge-streams/-/merge-streams-2.3.0.tgz", + "integrity": "sha512-LtoMMhxAlorcGhmFYI+LhPgbPZCkgP6ra1YL604EeF6U98pLlQ3iWIGMdWSC+vWmPBWBNgmDBAhnAobLROJmwg==", + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/@typespec/compiler": { + "version": "0.56.0", + "resolved": "https://registry.npmjs.org/@typespec/compiler/-/compiler-0.56.0.tgz", + "integrity": "sha512-K+VhXycoeqcoSGtB0/l1XYco4V2qRsCOOwqklVM4Yew7kTcKVfz7CT7a6a2OKWDMNg5iijZtRBoM5YF50XtQug==", + "dependencies": { + "@babel/code-frame": "~7.24.2", + "ajv": "~8.12.0", + "change-case": "~5.4.4", + "globby": "~14.0.1", + "mustache": "~4.2.0", + "picocolors": "~1.0.0", + "prettier": "~3.2.5", + "prompts": "~2.4.2", + "semver": "^7.6.0", + "vscode-languageserver": "~9.0.1", + "vscode-languageserver-textdocument": "~1.0.11", + "yaml": "~2.4.1", + "yargs": "~17.7.2" + }, + "bin": { + "tsp": "cmd/tsp.js", + "tsp-server": "cmd/tsp-server.js" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@typespec/http": { + "version": "0.56.0", + "resolved": "https://registry.npmjs.org/@typespec/http/-/http-0.56.0.tgz", + "integrity": "sha512-f/tpHRWev9bnAtNPFkfCU/5SFou9glA/rPDY0m2W5bK6EG1/6/TKKKz5FoKPA4xvc2dQ5vu/ouGLb4i5UzXvWQ==", + "engines": { + "node": ">=18.0.0" + }, + "peerDependencies": { + "@typespec/compiler": "~0.56.0" + } + }, + "node_modules/@typespec/openapi": { + "version": "0.56.0", + "resolved": "https://registry.npmjs.org/@typespec/openapi/-/openapi-0.56.0.tgz", + "integrity": "sha512-q8+IHRglXBm3slvonRLSNYN2fX7plbWA+ugIiMJZTeyc3enqfxPqMGA8BCiAFV3kwP0uPPpIXbCSIVhHgkONbA==", + "engines": { + "node": ">=18.0.0" + }, + "peerDependencies": { + "@typespec/compiler": "~0.56.0", + "@typespec/http": "~0.56.0" + } + }, + "node_modules/@typespec/openapi3": { + "version": "0.56.0", + "resolved": "https://registry.npmjs.org/@typespec/openapi3/-/openapi3-0.56.0.tgz", + "integrity": "sha512-55JPUP7dFk4iXn4fNKZEs76j7hAdlWfoMWNPsQPRJCP//KWCtNXfTP+/TTVPVv1L/6HztbXyPV0agKZwyS7gDw==", + "dependencies": { + "yaml": "~2.4.1" + }, + "engines": { + "node": ">=18.0.0" + }, + "peerDependencies": { + "@typespec/compiler": "~0.56.0", + "@typespec/http": "~0.56.0", + "@typespec/openapi": "~0.56.0", + "@typespec/versioning": "~0.56.0" + } + }, + "node_modules/@typespec/rest": { + "version": "0.56.0", + "resolved": "https://registry.npmjs.org/@typespec/rest/-/rest-0.56.0.tgz", + "integrity": "sha512-8w4WhWDcpEQNW8bB1BHhiBxIQUChDJtyq/n9p2OI/Bm1wncd61y/ZNOtcxmlKq8uB9d+dzHiZdEfqFCR8HF8/Q==", + "engines": { + "node": ">=18.0.0" + }, + "peerDependencies": { + "@typespec/compiler": "~0.56.0", + "@typespec/http": "~0.56.0" + } + }, + "node_modules/@typespec/versioning": { + "version": "0.56.0", + "resolved": "https://registry.npmjs.org/@typespec/versioning/-/versioning-0.56.0.tgz", + "integrity": "sha512-j7IN9XFyGn3LH6IOJkinEvk9sDncsxiWPULOAe0VQ+D/dtCfLawDMUALnvklMDRKeD1OOUPSCjjUAp9OB0f7YA==", + "peer": true, + "engines": { + "node": ">=18.0.0" + }, + "peerDependencies": { + "@typespec/compiler": "~0.56.0" + } + }, + "node_modules/ajv": { + "version": "8.12.0", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.12.0.tgz", + "integrity": "sha512-sRu1kpcO9yLtYxBKvqfTeh9KzZEwO3STyX1HT+4CaDzC6HpTGYhIhPIzj9XuKU7KYDwnaeh5hcOwjy1QuJzBPA==", + "dependencies": { + "fast-deep-equal": "^3.1.1", + "json-schema-traverse": "^1.0.0", + "require-from-string": "^2.0.2", + "uri-js": "^4.2.2" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" + } + }, + "node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "engines": { + "node": ">=8" + } + }, + "node_modules/ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dependencies": { + "color-convert": "^1.9.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/braces": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz", + "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==", + "dependencies": { + "fill-range": "^7.1.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "dependencies": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + }, + "engines": { + "node": ">=4" + } + }, + "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==" + }, + "node_modules/cliui": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-8.0.1.tgz", + "integrity": "sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==", + "dependencies": { + "string-width": "^4.2.0", + "strip-ansi": "^6.0.1", + "wrap-ansi": "^7.0.0" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "dependencies": { + "color-name": "1.1.3" + } + }, + "node_modules/color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==" + }, + "node_modules/emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==" + }, + "node_modules/escalade": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.2.tgz", + "integrity": "sha512-ErCHMCae19vR8vQGe50xIsVomy19rg6gFu3+r3jkEO46suLMWBksvVyoGgQV+jOfl84ZSOSlmv6Gxa89PmTGmA==", + "engines": { + "node": ">=6" + } + }, + "node_modules/escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", + "engines": { + "node": ">=0.8.0" + } + }, + "node_modules/fast-deep-equal": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", + "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==" + }, + "node_modules/fast-glob": { + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.2.tgz", + "integrity": "sha512-oX2ruAFQwf/Orj8m737Y5adxDQO0LAB7/S5MnxCdTNDd4p6BsyIVsv9JQsATbTSq8KHRpLwIHbVlUNatxd+1Ow==", + "dependencies": { + "@nodelib/fs.stat": "^2.0.2", + "@nodelib/fs.walk": "^1.2.3", + "glob-parent": "^5.1.2", + "merge2": "^1.3.0", + "micromatch": "^4.0.4" + }, + "engines": { + "node": ">=8.6.0" + } + }, + "node_modules/fastq": { + "version": "1.17.1", + "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.17.1.tgz", + "integrity": "sha512-sRVD3lWVIXWg6By68ZN7vho9a1pQcN/WBFaAAsDDFzlJjvoGx0P8z7V1t72grFJfJhu3YPZBuu25f7Kaw2jN1w==", + "dependencies": { + "reusify": "^1.0.4" + } + }, + "node_modules/fill-range": { + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", + "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==", + "dependencies": { + "to-regex-range": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/get-caller-file": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", + "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", + "engines": { + "node": "6.* || 8.* || >= 10.*" + } + }, + "node_modules/glob-parent": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", + "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", + "dependencies": { + "is-glob": "^4.0.1" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/globby": { + "version": "14.0.1", + "resolved": "https://registry.npmjs.org/globby/-/globby-14.0.1.tgz", + "integrity": "sha512-jOMLD2Z7MAhyG8aJpNOpmziMOP4rPLcc95oQPKXBazW82z+CEgPFBQvEpRUa1KeIMUJo4Wsm+q6uzO/Q/4BksQ==", + "dependencies": { + "@sindresorhus/merge-streams": "^2.1.0", + "fast-glob": "^3.3.2", + "ignore": "^5.2.4", + "path-type": "^5.0.0", + "slash": "^5.1.0", + "unicorn-magic": "^0.1.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", + "engines": { + "node": ">=4" + } + }, + "node_modules/ignore": { + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.3.1.tgz", + "integrity": "sha512-5Fytz/IraMjqpwfd34ke28PTVMjZjJG2MPn5t7OE4eUCUNf8BAa7b5WUS9/Qvr6mwOQS7Mk6vdsMno5he+T8Xw==", + "engines": { + "node": ">= 4" + } + }, + "node_modules/is-extglob": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "engines": { + "node": ">=8" + } + }, + "node_modules/is-glob": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", + "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", + "dependencies": { + "is-extglob": "^2.1.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-number": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", + "engines": { + "node": ">=0.12.0" + } + }, + "node_modules/js-tokens": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", + "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==" + }, + "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==" + }, + "node_modules/kleur": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/kleur/-/kleur-3.0.3.tgz", + "integrity": "sha512-eTIzlVOSUR+JxdDFepEYcBMtZ9Qqdef+rnzWdRZuMbOywu5tO2w2N7rqjoANZ5k9vywhL6Br1VRjUIgTQx4E8w==", + "engines": { + "node": ">=6" + } + }, + "node_modules/merge2": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", + "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==", + "engines": { + "node": ">= 8" + } + }, + "node_modules/micromatch": { + "version": "4.0.7", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.7.tgz", + "integrity": "sha512-LPP/3KorzCwBxfeUuZmaR6bG2kdeHSbe0P2tY3FLRU4vYrjYz5hI4QZwV0njUx3jeuKe67YukQ1LSPZBKDqO/Q==", + "dependencies": { + "braces": "^3.0.3", + "picomatch": "^2.3.1" + }, + "engines": { + "node": ">=8.6" + } + }, + "node_modules/mustache": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/mustache/-/mustache-4.2.0.tgz", + "integrity": "sha512-71ippSywq5Yb7/tVYyGbkBggbU8H3u5Rz56fH60jGFgr8uHwxs+aSKeqmluIVzM0m0kB7xQjKS6qPfd0b2ZoqQ==", + "bin": { + "mustache": "bin/mustache" + } + }, + "node_modules/path-type": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-5.0.0.tgz", + "integrity": "sha512-5HviZNaZcfqP95rwpv+1HDgUamezbqdSYTyzjTvwtJSnIH+3vnbmWsItli8OFEndS984VT55M3jduxZbX351gg==", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/picocolors": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.0.1.tgz", + "integrity": "sha512-anP1Z8qwhkbmu7MFP5iTt+wQKXgwzf7zTyGlcdzabySa9vd0Xt392U0rVmz9poOaBj0uHJKyyo9/upk0HrEQew==" + }, + "node_modules/picomatch": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", + "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", + "engines": { + "node": ">=8.6" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, + "node_modules/prettier": { + "version": "3.2.5", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.2.5.tgz", + "integrity": "sha512-3/GWa9aOC0YeD7LUfvOG2NiDyhOWRvt1k+rcKhOuYnMY24iiCphgneUfJDyFXd6rZCAnuLBv6UeAULtrhT/F4A==", + "bin": { + "prettier": "bin/prettier.cjs" + }, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/prettier/prettier?sponsor=1" + } + }, + "node_modules/prompts": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/prompts/-/prompts-2.4.2.tgz", + "integrity": "sha512-NxNv/kLguCA7p3jE8oL2aEBsrJWgAakBpgmgK6lpPWV+WuOmY6r2/zbAVnP+T8bQlA0nzHXSJSJW0Hq7ylaD2Q==", + "dependencies": { + "kleur": "^3.0.3", + "sisteransi": "^1.0.5" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/punycode": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz", + "integrity": "sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==", + "engines": { + "node": ">=6" + } + }, + "node_modules/queue-microtask": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", + "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] + }, + "node_modules/require-directory": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", + "integrity": "sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/require-from-string": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/require-from-string/-/require-from-string-2.0.2.tgz", + "integrity": "sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/reusify": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", + "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==", + "engines": { + "iojs": ">=1.0.0", + "node": ">=0.10.0" + } + }, + "node_modules/run-parallel": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", + "integrity": "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "dependencies": { + "queue-microtask": "^1.2.2" + } + }, + "node_modules/semver": { + "version": "7.6.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.2.tgz", + "integrity": "sha512-FNAIBWCx9qcRhoHcgcJ0gvU7SN1lYU2ZXuSfl04bSC5OpvDHFyJCjdNHomPXxjQlCBU67YW64PzY7/VIEH7F2w==", + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/sisteransi": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/sisteransi/-/sisteransi-1.0.5.tgz", + "integrity": "sha512-bLGGlR1QxBcynn2d5YmDX4MGjlZvy2MRBDRNHLJ8VI6l6+9FUiyTFNJ0IveOSP0bcXgVDPRcfGqA0pjaqUpfVg==" + }, + "node_modules/slash": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/slash/-/slash-5.1.0.tgz", + "integrity": "sha512-ZA6oR3T/pEyuqwMgAKT0/hAv8oAXckzbkmR0UkUosQ+Mc4RxGoJkRmwHgHufaenlyAgE1Mxgpdcrf75y6XcnDg==", + "engines": { + "node": ">=14.16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dependencies": { + "has-flag": "^3.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/to-regex-range": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", + "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", + "dependencies": { + "is-number": "^7.0.0" + }, + "engines": { + "node": ">=8.0" + } + }, + "node_modules/unicorn-magic": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/unicorn-magic/-/unicorn-magic-0.1.0.tgz", + "integrity": "sha512-lRfVq8fE8gz6QMBuDM6a+LO3IAzTi05H6gCVaUpir2E1Rwpo4ZUog45KpNXKC/Mn3Yb9UDuHumeFTo9iV/D9FQ==", + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/uri-js": { + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", + "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", + "dependencies": { + "punycode": "^2.1.0" + } + }, + "node_modules/vscode-jsonrpc": { + "version": "8.2.0", + "resolved": "https://registry.npmjs.org/vscode-jsonrpc/-/vscode-jsonrpc-8.2.0.tgz", + "integrity": "sha512-C+r0eKJUIfiDIfwJhria30+TYWPtuHJXHtI7J0YlOmKAo7ogxP20T0zxB7HZQIFhIyvoBPwWskjxrvAtfjyZfA==", + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/vscode-languageserver": { + "version": "9.0.1", + "resolved": "https://registry.npmjs.org/vscode-languageserver/-/vscode-languageserver-9.0.1.tgz", + "integrity": "sha512-woByF3PDpkHFUreUa7Hos7+pUWdeWMXRd26+ZX2A8cFx6v/JPTtd4/uN0/jB6XQHYaOlHbio03NTHCqrgG5n7g==", + "dependencies": { + "vscode-languageserver-protocol": "3.17.5" + }, + "bin": { + "installServerIntoExtension": "bin/installServerIntoExtension" + } + }, + "node_modules/vscode-languageserver-protocol": { + "version": "3.17.5", + "resolved": "https://registry.npmjs.org/vscode-languageserver-protocol/-/vscode-languageserver-protocol-3.17.5.tgz", + "integrity": "sha512-mb1bvRJN8SVznADSGWM9u/b07H7Ecg0I3OgXDuLdn307rl/J3A9YD6/eYOssqhecL27hK1IPZAsaqh00i/Jljg==", + "dependencies": { + "vscode-jsonrpc": "8.2.0", + "vscode-languageserver-types": "3.17.5" + } + }, + "node_modules/vscode-languageserver-textdocument": { + "version": "1.0.11", + "resolved": "https://registry.npmjs.org/vscode-languageserver-textdocument/-/vscode-languageserver-textdocument-1.0.11.tgz", + "integrity": "sha512-X+8T3GoiwTVlJbicx/sIAF+yuJAqz8VvwJyoMVhwEMoEKE/fkDmrqUgDMyBECcM2A2frVZIUj5HI/ErRXCfOeA==" + }, + "node_modules/vscode-languageserver-types": { + "version": "3.17.5", + "resolved": "https://registry.npmjs.org/vscode-languageserver-types/-/vscode-languageserver-types-3.17.5.tgz", + "integrity": "sha512-Ld1VelNuX9pdF39h2Hgaeb5hEZM2Z3jUrrMgWQAu82jMtZp7p3vJT3BzToKtZI7NgQssZje5o0zryOrhQvzQAg==" + }, + "node_modules/wrap-ansi": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", + "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", + "dependencies": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } + }, + "node_modules/wrap-ansi/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/wrap-ansi/node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/wrap-ansi/node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" + }, + "node_modules/y18n": { + "version": "5.0.8", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", + "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==", + "engines": { + "node": ">=10" + } + }, + "node_modules/yaml": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.4.2.tgz", + "integrity": "sha512-B3VqDZ+JAg1nZpaEmWtTXUlBneoGx6CPM9b0TENK6aoSu5t73dItudwdgmi6tHlIZZId4dZ9skcAQ2UbcyAeVA==", + "bin": { + "yaml": "bin.mjs" + }, + "engines": { + "node": ">= 14" + } + }, + "node_modules/yargs": { + "version": "17.7.2", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.7.2.tgz", + "integrity": "sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==", + "dependencies": { + "cliui": "^8.0.1", + "escalade": "^3.1.1", + "get-caller-file": "^2.0.5", + "require-directory": "^2.1.1", + "string-width": "^4.2.3", + "y18n": "^5.0.5", + "yargs-parser": "^21.1.1" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/yargs-parser": { + "version": "21.1.1", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.1.1.tgz", + "integrity": "sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==", + "engines": { + "node": ">=12" + } + } + } +} diff --git a/package.json b/package.json new file mode 100644 index 0000000..ab0259a --- /dev/null +++ b/package.json @@ -0,0 +1,13 @@ +{ + "name": "seichi-portal-api-schema", + "version": "0.1.0", + "type": "module", + "dependencies": { + "@typespec/compiler": "^0.56.0", + "@typespec/http": "latest", + "@typespec/openapi": "^0.56.0", + "@typespec/openapi3": "^0.56.0", + "@typespec/rest": "latest" + }, + "private": true +} diff --git a/schema/openapi.yml b/schema/openapi.yml deleted file mode 100644 index 3d7501e..0000000 --- a/schema/openapi.yml +++ /dev/null @@ -1,53 +0,0 @@ -openapi: 3.0.3 - -info: - title: SeichiAPISchema - description: 整地鯖のAPIのドキュメントをまとめるOpenAPIサーバー - version: 1.0.0 - license: - name: Apache 2.0 - url: https://github.com/GiganticMinecraft/seichi-api-schema/blob/main/LICENSE - -servers: - - url: "http://localhost:9000" - description: seichi-portal-backend(開発環境) - -components: - securitySchemes: - Bearer: - type: http - scheme: bearer - description: APIにアクセスするためのユーザー認証 - -security: - - Bearer: [] - -tags: - - name: forms - description: フォーム操作に関連するAPI - - name: users - description: ユーザー操作に関連するAPI - -paths: - /forms: - $ref: "./paths/forms/index.yml" - /forms/{formId}: - $ref: "./paths/forms/[formId]/index.yml" - /forms/{formId}/questions: - $ref: "./paths/forms/[formId]/questions/index.yml" - /forms/{formId}/answers: - $ref: "./paths/forms/[formId]/answers/index.yml" - /forms/questions: - $ref: "./paths/forms/questions/index.yml" - /forms/answers: - $ref: "./paths/forms/answers/index.yml" - /forms/answers/comment: - $ref: "./paths/forms/answers/comment/index.yml" - /forms/labels: - $ref: "./paths/forms/labels/index.yml" - /users: - $ref: "./paths/users/index.yml" - /users/{uuid}: - $ref: "./paths/users/[uuid]/index.yml" - /users/list: - $ref: "./paths/users/list/index.yml" diff --git a/schema/paths/forms/[formId]/answers/index.yml b/schema/paths/forms/[formId]/answers/index.yml deleted file mode 100644 index 3668dc6..0000000 --- a/schema/paths/forms/[formId]/answers/index.yml +++ /dev/null @@ -1,24 +0,0 @@ -get: - tags: - - forms - operationId: getFormAnswers - summary: 指定したフォームのすべての回答を取得する - parameters: - - $ref: "../../../../types/forms/parameters.yml#/parameters/id" - responses: - "200": - description: 指定されたフォームの回答の取得に成功 - content: - application/json: - schema: - $ref: "../../../../types/forms/definitions.yml#/definitions/answers" - "400": - description: リクエストの構文が間違っている - "401": - description: 認証されていない - "403": - description: 権限が不足している - "404": - description: 指定されたフォームが見つからなかった - "500": - description: サーバーエラー diff --git a/schema/paths/forms/[formId]/index.yml b/schema/paths/forms/[formId]/index.yml deleted file mode 100644 index c7da30c..0000000 --- a/schema/paths/forms/[formId]/index.yml +++ /dev/null @@ -1,79 +0,0 @@ -get: - tags: - - forms - operationId: getForm - summary: フォームの詳細を取得する - parameters: - - $ref: "../../../types/forms/parameters.yml#/parameters/id" - responses: - "200": - description: 指定されたフォームIDの情報取得に成功 - content: - application/json: - schema: - $ref: "../../../types/forms/definitions.yml#/definitions/form" - "400": - description: リクエストの構文が間違っている - "401": - description: 認証されていない - "404": - description: 見つからなかった - "500": - description: サーバーエラー - -delete: - tags: - - forms - operationId: deleteForm - summary: フォームを削除する - parameters: - - $ref: "../../../types/forms/parameters.yml#/parameters/id" - responses: - "200": - description: 指定されたFormIdの削除に成功 - content: - application/json: - schema: - $ref: "../../../types/forms/definitions.yml#/definitions/id" - "400": - description: リクエストの構文が間違っている - "401": - description: 認証されていない - "403": - description: 権限が不足している - "404": - description: 見つからなかった - "500": - description: サーバーエラー - -patch: - tags: - - forms - operationId: updateForm - summary: フォームの値を更新する - parameters: - - $ref: "../../../types/forms/parameters.yml#/parameters/id" - - $ref: "../../../types/forms/parameters.yml#/parameters/form_title" - - $ref: "../../../types/forms/parameters.yml#/parameters/form_description" - - $ref: "../../../types/forms/parameters.yml#/parameters/start_at" - - $ref: "../../../types/forms/parameters.yml#/parameters/end_at" - - $ref: "../../../types/forms/parameters.yml#/parameters/webhook_url" - - $ref: "../../../types/forms/parameters.yml#/parameters/default_title" - - $ref: "../../../types/forms/parameters.yml#/parameters/visibility" - responses: - "200": - description: 指定されたFormの更新に成功 - content: - application/json: - schema: - $ref: "../../../types/forms/definitions.yml#/definitions/form" - "400": - description: リクエストの構文が間違っている - "401": - description: 認証されていない - "403": - description: 権限が不足している - "404": - description: 見つからなかった - "500": - description: サーバーエラー diff --git a/schema/paths/forms/[formId]/questions/index.yml b/schema/paths/forms/[formId]/questions/index.yml deleted file mode 100644 index 73f2175..0000000 --- a/schema/paths/forms/[formId]/questions/index.yml +++ /dev/null @@ -1,23 +0,0 @@ -get: - tags: - - forms - operationId: getQuestions - summary: 質問の取得 - description: 指定したフォームの質問をすべて取得します。 - parameters: - - $ref: "../../../../types/forms/parameters.yml#/parameters/id" - responses: - "200": - description: 指定されたフォームの回答の取得に成功 - content: - application/json: - schema: - $ref: "../../../../types/forms/definitions.yml#/definitions/questions" - "400": - description: リクエストの構文が間違っている - "401": - description: 認証されていない - "404": - description: 指定されたフォームが見つからなかった - "500": - description: サーバーエラー diff --git a/schema/paths/forms/answers/comment/index.yml b/schema/paths/forms/answers/comment/index.yml deleted file mode 100644 index 70a295d..0000000 --- a/schema/paths/forms/answers/comment/index.yml +++ /dev/null @@ -1,75 +0,0 @@ -post: - tags: - - forms - operationId: addComment - summary: 回答に対してコメントを残す - requestBody: - description: コメントを残す回答のIDとコメントの内容 - required: true - content: - application/json: - schema: - $ref: "../../../../types/forms/definitions.yml#/definitions/comments" - responses: - "200": - description: コメント成功 - "400": - description: リクエストの構文が間違っている - "401": - description: 認証されていない - "404": - description: 回答が見つからなかった - "500": - description: サーバーエラー - -delete: - tags: - - forms - operationId: deleteComment - summary: コメントを削除する - requestBody: - description: 削除するコメントのID - required: true - content: - application/json: - schema: - $ref: "../../../../types/forms/definitions.yml#/definitions/comment_id" - responses: - "200": - description: コメントの削除成功 - "400": - description: リクエストの構文が間違っている - "401": - description: 認証されていない - "403": - description: 権限が不足している - "404": - description: コメントIDが見つからなかった - "500": - description: サーバーエラー - -patch: - tags: - - forms - operationId: editComment - summary: コメントを編集する - requestBody: - description: 編集するコメントのID - required: true - content: - application/json: - schema: - $ref: "../../../../types/forms/definitions.yml#/definitions/comment_for_edit" - responses: - "200": - description: コメント編集成功 - "400": - description: リクエストの構文が間違っている - "401": - description: 認証されていない - "403": - description: 権限が不足している - "404": - description: 見つからなかった - "500": - description: サーバーエラー diff --git a/schema/paths/forms/answers/index.yml b/schema/paths/forms/answers/index.yml deleted file mode 100644 index 013dd8d..0000000 --- a/schema/paths/forms/answers/index.yml +++ /dev/null @@ -1,46 +0,0 @@ -get: - tags: - - forms - operationId: getAllAnswers - summary: フォームの回答をすべて取得する - responses: - "200": - description: 指定されたフォームIDの情報取得に成功 - content: - application/json: - schema: - $ref: "../../../types/forms/definitions.yml#/definitions/answers" - "400": - description: リクエストの構文が間違っている - "401": - description: 認証されていない - "403": - description: 権限が不足している - "404": - description: フォームが見つからなかった - "500": - description: サーバーエラー - -post: - tags: - - forms - operationId: postFormAnswers - summary: 指定フォームに対して回答する - requestBody: - description: 回答の内容 - required: true - content: - application/json: - schema: - $ref: "../../../types/forms/definitions.yml#/definitions/batch_answers" - responses: - "200": - description: 回答に成功 - "401": - description: 認証されていない - "403": - description: 回答期間外のフォームに回答された - "404": - description: フォームか質問が見つからなかった - "500": - description: サーバーエラー diff --git a/schema/paths/forms/index.yml b/schema/paths/forms/index.yml deleted file mode 100644 index 44247f2..0000000 --- a/schema/paths/forms/index.yml +++ /dev/null @@ -1,90 +0,0 @@ -post: - tags: - - forms - operationId: createForm - summary: フォームの新規作成 - description: | - フォームを新しく作ります。 - - 作られたフォームのIDがJSONとして返却され、作成されたフォームへのURLを含むHeaderが返されます。 - requestBody: - description: 作成するフォームの内容 - required: true - content: - application/json: - schema: - $ref: "../../types/forms/definitions.yml#/definitions/form" - responses: - "201": - description: フォームの作成に成功 - content: - application/json: - schema: - $ref: "../../types/forms/definitions.yml#/definitions/id" - headers: - Location: - description: 作成されたフォームへのURL - schema: - type: string - "400": - description: リクエストの構文が間違っている - "401": - description: 認証されていない - "403": - description: 権限が不足している - "500": - description: サーバーエラー -get: - tags: - - forms - operationId: listForms - summary: フォームの一覧を取得する - description: | - このAPIでは以下の内容のみ返します。 - - フォームID - - フォーム名 - - フォームの説明 - - 設定 - - 回答開始日時 - - 回答期限日時 - - また、取得パラメータとしてlimitとoffsetを指定し、取得件数を絞り込むことができます。 - - レスポンス内容はid基準とし、昇順ソートしたものになります。 - ※各フォームの詳細情報などは別APIを利用することを想定しています。 - parameters: - - in: query - name: offset - description: | - 取得件数の下限値 - 例えば、offsetを1とすると2件目からのデータが取得できます。 - schema: - type: integer - minimum: 0 - required: false - - in: query - name: limit - description: | - 取得件数の上限値 - 例えば、limitを10とすると10番目までのデータが取得できます。 - schema: - type: integer - minimum: 1 - required: false - responses: - "200": - description: フォーム一覧の取得に成功 - content: - application/json: - schema: - type: array - uniqueItems: true - minItems: 1 - items: - $ref: "../../types/forms/definitions.yml#/definitions/simple_form" - "400": - description: リクエストの構文が間違っている - "401": - description: 認証されていない - "500": - description: サーバーエラー diff --git a/schema/paths/forms/labels/index.yml b/schema/paths/forms/labels/index.yml deleted file mode 100644 index 2f5c93b..0000000 --- a/schema/paths/forms/labels/index.yml +++ /dev/null @@ -1,73 +0,0 @@ -get: - tags: - - forms - operationId: getFormLabels - summary: 指定した種類のラベルをすべて取得する - description: 指定されたものに対してつけられるラベルをすべて取得する - parameters: - - $ref: "../../../types/forms/parameters.yml#/parameters/form_label_target" - responses: - "200": - description: すべての指定ラベルの取得成功 - content: - application/json: - schema: - $ref: "../../../types/forms/definitions.yml#/definitions/form_labels" - "400": - description: リクエストの構文が間違っている - "401": - description: 認証されていない - "500": - description: サーバーエラー - -post: - tags: - - forms - operationId: createFormLabel - summary: ラベルを作成する - description: ラベルを新規作成する - requestBody: - description: 作成するラベルの内容 - required: true - content: - application/json: - schema: - $ref: "../../../types/forms/definitions.yml#/definitions/form_label" - responses: - "200": - description: "ラベルの作成に成功" - "400": - description: リクエストの構文が間違っている - "403": - description: 権限が不足している - "401": - description: 認証されていない - "500": - description: サーバーエラー - -delete: - tags: - - forms - operationId: deleteFormLabel - summary: ラベルを削除する - description: 作成済みのラベルを削除する - requestBody: - description: 削除するフォームラベルID - required: true - content: - application/json: - schema: - $ref: "../../../types/forms/definitions.yml#/definitions/form_label_id" - responses: - "200": - description: "ラベルの削除に成功" - "400": - description: リクエストの構文が間違っている - "401": - description: 認証されていない - "403": - description: 権限が不足している - "404": - description: ラベルIDが見つからなかった - "500": - description: サーバーエラー diff --git a/schema/paths/forms/questions/index.yml b/schema/paths/forms/questions/index.yml deleted file mode 100644 index fded612..0000000 --- a/schema/paths/forms/questions/index.yml +++ /dev/null @@ -1,83 +0,0 @@ -post: - tags: - - forms - operationId: createQuestion - summary: 質問の新規作成 - description: | - 質問を新しく作ります。 - requestBody: - description: 作成する質問の内容 - required: true - content: - application/json: - schema: - $ref: "../../../types/forms/definitions.yml#/definitions/questions" - responses: - "201": - description: 質問の作成に成功 - content: - application/json: - schema: - $ref: "../../../types/forms/definitions.yml#/definitions/id" - "400": - description: リクエストの構文が間違っている - "401": - description: 認証されていない - "403": - description: 権限が不足している - "500": - description: サーバーエラー - -delete: - tags: - - forms - operationId: deleteQuestion - summary: 質問を削除する - description: 作成済みの質問を削除する - requestBody: - description: 削除するフォーム質問ID - required: true - content: - application/json: - schema: - $ref: "../../../types/forms/definitions.yml#/definitions/question_id" - responses: - "200": - description: "質問の削除に成功" - "400": - description: リクエストの構文が間違っている - "401": - description: 認証されていない - "403": - description: 権限が不足している - "404": - description: question_idが見つからなかった - "500": - description: サーバーエラー - -put: - tags: - - forms - operationId: updateQuestion - summary: 質問の値を更新する - description: 指定したフォームの質問を上書きする - requestBody: - description: 更新するフォーム質問IDと更新内容 - required: true - content: - application/json: - schema: - $ref: "../../../types/forms/definitions.yml#/definitions/questions" - responses: - "200": - description: 質問編集成功 - "400": - description: リクエストの構文が間違っている - "401": - description: 認証されていない - "403": - description: 権限が不足している - "404": - description: 質問IDが見つからなかった - "500": - description: サーバーエラー diff --git a/schema/paths/users/[uuid]/index.yml b/schema/paths/users/[uuid]/index.yml deleted file mode 100644 index 910f5eb..0000000 --- a/schema/paths/users/[uuid]/index.yml +++ /dev/null @@ -1,21 +0,0 @@ -patch: - tags: - - users - operationId: updateUser - summary: ユーザー情報を変更する - parameters: - - $ref: "../../../types/users/parameters.yml#/parameters/uuid" - - $ref: "../../../types/users/parameters.yml#/parameters/role" - responses: - "200": - description: ユーザー情報の変更に成功 - "400": - description: リクエストの構文が間違っている - "401": - description: 認証されていない - "403": - description: 権限が不足している - "404": - description: ユーザーが見つからなかった - "500": - description: サーバーエラー diff --git a/schema/paths/users/index.yml b/schema/paths/users/index.yml deleted file mode 100644 index b348469..0000000 --- a/schema/paths/users/index.yml +++ /dev/null @@ -1,19 +0,0 @@ -get: - tags: - - users - operationId: getUserInfo - summary: 自身のユーザー情報の取得 - description: | - Bearer TokenにMicrosoftから取得したトークンを含めて実行すると - 自身のユーザー情報が帰ってきます - responses: - "200": - description: 自身のユーザー情報の取得成功 - content: - application/json: - schema: - $ref: "../../types/users/definitions.yml#/definitions/user" - "401": - description: 認証されていない - "500": - description: サーバーエラー diff --git a/schema/paths/users/list/index.yml b/schema/paths/users/list/index.yml deleted file mode 100644 index b72e68a..0000000 --- a/schema/paths/users/list/index.yml +++ /dev/null @@ -1,21 +0,0 @@ -get: - tags: - - users - operationId: getUsersList - summary: すべてのユーザーの取得 - description: ユーザーリストを返します - responses: - "200": - description: 自身のユーザー情報の取得成功 - content: - application/json: - schema: - $ref: "../../../types/users/definitions.yml#/definitions/users" - "400": - description: リクエストの構文が間違っている - "401": - description: 認証されていない - "403": - description: 権限が不足している - "500": - description: サーバーエラー diff --git a/schema/types/forms/components.yml b/schema/types/forms/components.yml deleted file mode 100644 index 0c47bf5..0000000 --- a/schema/types/forms/components.yml +++ /dev/null @@ -1,219 +0,0 @@ -components: - schemas: - id: - description: フォームのID - type: integer - format: int64 - minimum: 0 - example: 0 - title: - description: フォームの名前 - type: string - example: お問い合わせフォーム - description: - description: フォームの説明 - type: string - nullable: true - example: このフォームはお問い合わせをする際にご回答いただくフォームです。 - start_at: - description: 回答の受付を開始する日時 - type: string - format: date-time - end_at: - description: 回答の受付を終了する日時 - type: string - format: date-time - response_period: - description: 回答可能期間 - type: object - nullable: true - properties: - start_at: - $ref: "#/components/schemas/start_at" - end_at: - $ref: "#/components/schemas/end_at" - webhook_url: - description: webhookのURL - type: string - default_title: - description: | - フォームに回答された内容に対して設定されるタイトル。 - これが設定されていないとタイトルは「未設定」となります。 - type: string - example: 未設定 - visibility: - description: | - フォームの公開設定。 - - | ENUM | 説明 | - | -------- | ------------| - | PUBLIC | 全体公開 | - | PRIVATE | 非公開 | - type: string - enum: - - PUBLIC - - PRIVATE - settings: - description: フォームの設定 - type: object - properties: - response_period: - $ref: "#/components/schemas/response_period" - webhook_url: - $ref: "#/components/schemas/webhook_url" - default_title: - $ref: "#/components/schemas/default_title" - visibility: - $ref: "#/components/schemas/visibility" - created_at: - description: フォームの作成日時 - type: string - format: date-time - updated_at: - description: フォームの最終更新日時 - type: string - format: date-time - metadata: - description: フォームのメタデータ - type: object - properties: - created_at: - $ref: "#/components/schemas/created_at" - updated_at: - $ref: "#/components/schemas/updated_at" - question_id: - description: 質問のID - type: integer - minimum: 0 - example: 0 - question_title: - description: 質問のタイトル - type: string - example: お問い合わせフォーム - question_description: - description: 質問の説明 - type: string - example: 運営に問い合わせる内容を具体的に記述してください。 - question_type: - description: | - 質問形式を定義する。 - - | ENUM | 説明 | - | -------- | ------------| - | TEXT | 自由記述 | - | MULTIPLE | 複数選択 | - | SINGLE | 単一選択 | - type: string - enum: - - TEXT - - MULTIPLE - - SINGLE - example: TEXT - question_choices: - description: | - 質問の選択肢の配列。 - TEXT以外の場合は指定必須。 - type: array - uniqueItems: true - minItems: 1 - items: - type: string - example: [] - is_required: - description: | - 質問に対する解答を必須にする。 - デフォルトはfalseで、trueだと有効になる。 - type: boolean - example: false - question: - description: 質問 - type: object - properties: - id: - readOnly: true - allOf: - - $ref: "#/components/schemas/question_id" - title: - $ref: "#/components/schemas/question_title" - description: - $ref: "#/components/schemas/question_description" - question_type: - $ref: "#/components/schemas/question_type" - choices: - $ref: "#/components/schemas/question_choices" - is_required: - $ref: "#/components/schemas/is_required" - questions: - description: 質問の配列 - type: array - uniqueItems: true - minItems: 1 - items: - $ref: "#/components/schemas/question" - answer_id: - description: 回答のID - type: integer - minimum: 0 - example: 0 - answer: - description: 質問に対する回答 - type: object - properties: - question_id: - $ref: "./components.yml#/components/schemas/question_id" - answer: - type: string - example: 整地鯖にアクセスできません。どうしたらいいですか。 - kind_of_labels: - description: | - ラベルの種類 - | 名前 | 説明 | - | ------------ | --------------------------------------------| - | FORM | フォームに対してつけられるラベル | - | FORM_ANSWERS | フォームについた回答に対してつけられるラベル | - type: string - enum: - - FORM - - FORM_ANSWERS - form_label_id: - description: フォームラベルを一意に定めるためのID - type: integer - format: int64 - minimum: 0 - form_label_name: - description: フォームに対してつけるラベルの名前 - type: string - example: 常設フォーム - form_label_description: - description: フォームに対してつけるラベルの説明 - type: string - example: このラベルがついているフォームは、常に設置されているフォームです。 - comment_id: - description: コメントを一意に定めるID - type: integer - format: int64 - minimum: 0 - comment_content: - description: コメントの内容 - type: string - example: テストコメント - comment: - description: コメント - type: object - properties: - id: - readOnly: true - allOf: - - $ref: "#/components/schemas/comment_id" - answer_id: - $ref: "#/components/schemas/answer_id" - content: - $ref: "#/components/schemas/comment_content" - comment_for_edit: - description: コメント - type: object - properties: - id: - $ref: "#/components/schemas/comment_id" - content: - $ref: "#/components/schemas/comment_content" diff --git a/schema/types/forms/definitions.yml b/schema/types/forms/definitions.yml deleted file mode 100644 index 5377508..0000000 --- a/schema/types/forms/definitions.yml +++ /dev/null @@ -1,147 +0,0 @@ -definitions: - form: - description: フォーム - type: object - properties: - id: - readOnly: true - allOf: - - $ref: "./components.yml#/components/schemas/id" - title: - $ref: "./components.yml#/components/schemas/title" - description: - $ref: "./components.yml#/components/schemas/description" - settings: - readOnly: true - allOf: - - $ref: "./components.yml#/components/schemas/settings" - metadata: - readOnly: true - allOf: - - $ref: "./components.yml#/components/schemas/metadata" - questions: - readOnly: true - allOf: - - $ref: "./components.yml#/components/schemas/questions" - required: - - id - - title - simple_form: - description: フォームの最低限必要な情報のみを集めたもの。 - type: object - properties: - id: - readOnly: true - allOf: - - $ref: "./components.yml#/components/schemas/id" - title: - $ref: "./components.yml#/components/schemas/title" - description: - $ref: "./components.yml#/components/schemas/description" - response_period: - $ref: "./components.yml#/components/schemas/response_period" - questions: - description: 質問の配列 - type: object - properties: - form_id: - writeOnly: true - allOf: - - $ref: "./components.yml#/components/schemas/id" - questions: - $ref: "./components.yml#/components/schemas/questions" - question_id: - description: 質問のID - type: object - properties: - question_id: - $ref: "./components.yml#/components/schemas/question_id" - id: - type: object - properties: - id: - $ref: "./components.yml#/components/schemas/id" - required: - - id - batch_answers: - description: ひとまとまりの回答 - type: object - properties: - title: - type: string - description: titleをnullにするとデフォルト設定が適用 - example: "[hoge] 整地の心得違反" - nullable: true - form_id: - $ref: "./components.yml#/components/schemas/id" - answers: - type: array - uniqueItems: true - minItems: 0 - items: - $ref: "./components.yml#/components/schemas/answer" - answers: - description: batch_answersの配列 - type: array - uniqueItems: true - minItems: 0 - items: - $ref: "#/definitions/batch_answers" - kind_of_labels: - type: object - properties: - kind_of_labels: - $ref: "./components.yml#/components/schemas/kind_of_labels" - required: - - kind_of_labels - form_label_id: - type: object - properties: - id: - $ref: "./components.yml#/components/schemas/form_label_id" - required: - - id - form_label: - description: フォームに対してつけるラベル - type: object - properties: - id: - $ref: "./components.yml#/components/schemas/form_label_id" - kind_of_labels: - $ref: "./components.yml#/components/schemas/kind_of_labels" - name: - $ref: "./components.yml#/components/schemas/form_label_name" - description: - $ref: "./components.yml#/components/schemas/form_label_description" - form_labels: - description: フォームラベルの配列 - type: array - uniqueItems: true - minItems: 0 - items: - $ref: "#/definitions/form_label" - comment_id: - description: コメントのID - type: object - properties: - id: - $ref: "./components.yml#/components/schemas/comment_id" - comment: - description: 単一のコメント - type: object - properties: - comment: - $ref: "./components.yml#/components/schemas/comment" - comment_for_edit: - description: 単一のコメント - type: object - properties: - comment: - $ref: "./components.yml#/components/schemas/comment_for_edit" - comments: - description: コメントの配列 - type: array - uniqueItems: true - minItems: 0 - items: - $ref: "./components.yml#/components/schemas/comment" diff --git a/schema/types/forms/parameters.yml b/schema/types/forms/parameters.yml deleted file mode 100644 index 7166c61..0000000 --- a/schema/types/forms/parameters.yml +++ /dev/null @@ -1,75 +0,0 @@ -parameters: - id: - name: formId - in: path - description: フォームID - required: true - schema: - $ref: "./components.yml#/components/schemas/id" - form_title: - name: title - in: query - description: フォームのタイトル - required: false - schema: - $ref: "./components.yml#/components/schemas/title" - form_description: - name: description - in: query - description: フォームの説明 - required: false - schema: - $ref: "./components.yml#/components/schemas/description" - start_at: - name: start_at - in: query - description: | - フォームの回答期間の開始日。 - この開始日は回答可能期間に含まれます。 - 終了日(`end_at`)が指定されていない場合は失敗する可能性があります。 - 新たに設定する場合は`start_at`と`end_at`の両方を含めたパラメータを指定してください。 - required: false - schema: - $ref: "./components.yml#/components/schemas/start_at" - end_at: - name: end_at - in: query - description: | - フォームの回答期間の終了日。 - この終了日は回答可能期間に含まれます。 - 開始日(`start_at`)が指定されていない場合は失敗する可能性があります。 - 新たに設定する場合は`start_at`と`end_at`の両方を含めたパラメータを指定してください。 - required: false - schema: - $ref: "./components.yml#/components/schemas/end_at" - webhook_url: - name: webhook - in: query - description: フォームの変更などを通知するリンク - required: false - schema: - $ref: "./components.yml#/components/schemas/webhook_url" - default_title: - name: default_answer_title - in: query - description: | - 各回答に対してつけられるタイトル。 - $[question_id]と指定することで質問のquestion_idに対応する回答を埋め込むことができます。 - デフォルト値: 未設定 - required: false - schema: - $ref: "./components.yml#/components/schemas/default_title" - visibility: - name: visibility - in: query - description: フォームの公開設定 - required: false - schema: - $ref: "./components.yml#/components/schemas/visibility" - form_label_target: - name: target - in: query - required: true - description: 何に対してのラベルを取得するかを取得するか。 - schema: - $ref: "./components.yml#/components/schemas/kind_of_labels" diff --git a/schema/types/users/components.yml b/schema/types/users/components.yml deleted file mode 100644 index 0616105..0000000 --- a/schema/types/users/components.yml +++ /dev/null @@ -1,15 +0,0 @@ -components: - schemas: - uuid: - description: Minecraftプレイヤーに紐づくUUID - type: string - format: uuid - name: - description: Minecraftプレイヤー名 - type: string - role: - description: ユーザー権限 - type: string - enum: - - ADMINISTRATOR - - STANDARD_USER diff --git a/schema/types/users/definitions.yml b/schema/types/users/definitions.yml deleted file mode 100644 index b09eaef..0000000 --- a/schema/types/users/definitions.yml +++ /dev/null @@ -1,18 +0,0 @@ -definitions: - user: - description: ユーザー - type: object - properties: - uuid: - $ref: "./components.yml#/components/schemas/uuid" - name: - $ref: "./components.yml#/components/schemas/name" - role: - $ref: "./components.yml#/components/schemas/role" - users: - description: ユーザーの配列 - type: array - uniqueItems: true - minItems: 0 - items: - $ref: "#/definitions/user" diff --git a/schema/types/users/parameters.yml b/schema/types/users/parameters.yml deleted file mode 100644 index c9b2dc0..0000000 --- a/schema/types/users/parameters.yml +++ /dev/null @@ -1,15 +0,0 @@ -parameters: - uuid: - name: uuid - in: path - description: プレイヤーUUID - required: true - schema: - $ref: "./components.yml#/components/schemas/uuid" - role: - name: role - in: query - description: ユーザー権限 - required: false - schema: - $ref: "./components.yml#/components/schemas/role" diff --git a/tspconfig.yaml b/tspconfig.yaml new file mode 100644 index 0000000..a3fe48f --- /dev/null +++ b/tspconfig.yaml @@ -0,0 +1,2 @@ +emit: + - "@typespec/openapi3"