diff --git a/.changeset/afraid-news-know.md b/.changeset/afraid-news-know.md new file mode 100644 index 0000000..19d3616 --- /dev/null +++ b/.changeset/afraid-news-know.md @@ -0,0 +1,5 @@ +--- +'openapi-ts-request': patch +--- + +fix: refactor test cases to use vitest as testing framework diff --git a/.changeset/eager-books-throw.md b/.changeset/eager-books-throw.md new file mode 100644 index 0000000..e698ae1 --- /dev/null +++ b/.changeset/eager-books-throw.md @@ -0,0 +1,5 @@ +--- +'openapi-ts-request': patch +--- + +fix: 生成的类型缺少namespace问题 diff --git a/.changeset/sharp-bees-stay.md b/.changeset/sharp-bees-stay.md new file mode 100644 index 0000000..7837c13 --- /dev/null +++ b/.changeset/sharp-bees-stay.md @@ -0,0 +1,5 @@ +--- +'openapi-ts-request': patch +--- + +style: prefer type import diff --git a/.eslintrc.cjs b/.eslintrc.cjs index 75f8875..c6f9041 100644 --- a/.eslintrc.cjs +++ b/.eslintrc.cjs @@ -11,6 +11,7 @@ module.exports = { 'test', '*.cjs', 'openapi-ts-request.config.ts', + 'vitest.config.ts', ], plugins: [], parserOptions: { @@ -21,5 +22,6 @@ module.exports = { rules: { '@typescript-eslint/ban-ts-comment': 'warn', '@typescript-eslint/no-explicit-any': 'off', + '@typescript-eslint/consistent-type-imports': 'error', }, }; diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..3665cde --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,28 @@ +name: CI + +on: + pull_request: + branches: [main] + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Install pnpm + uses: pnpm/action-setup@v4 + + - name: Use node.js + uses: actions/setup-node@v4 + with: + node-version: '20.x' + registry-url: 'https://registry.npmjs.org' + cache: 'pnpm' + + - name: Installing Dependencies + run: pnpm install + + - name: Running unit Test + run: pnpm run test:unit \ No newline at end of file diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 859f624..c7c104f 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -33,8 +33,8 @@ jobs: if: steps.cache-dependencies.outputs.cache-hit != 'true' run: pnpm install - - name: Running Test - run: pnpm run test + - name: Running unit Test + run: pnpm run test:unit - name: Running Build run: pnpm run build diff --git a/.husky/pre-push b/.husky/pre-push index ed4148f..dc20395 100755 --- a/.husky/pre-push +++ b/.husky/pre-push @@ -1 +1 @@ -# pnpm test +# pnpm test:unit diff --git a/README-en_US.md b/README-en_US.md index 111e606..95b05c5 100644 --- a/README-en_US.md +++ b/README-en_US.md @@ -338,7 +338,7 @@ export default { 1. learn [Pull Request]("https://help.github.com/articles/using-pull-requests") specification 2. fork this repository 3. create a new branch to modify the code:`git checkout -b my-branch main` -4. make sure your code passes all test cases (new functional test cases need to be added for new features):`pnpm test` +4. make sure your code passes all test cases (new functional test cases need to be added for new features):`pnpm test:unit` 5. create a changeset file using the command:`pnpm changeset` 6. submit your changes using commit (must follow commitlint specification) 7. submit Pull Request diff --git a/README.md b/README.md index b512cbf..8b584ef 100644 --- a/README.md +++ b/README.md @@ -340,7 +340,7 @@ export default { 1. 熟悉 [Pull Request]("https://help.github.com/articles/using-pull-requests") 规范 2. fork 此仓库 3. 开一个新分支修改代码:`git checkout -b my-branch main` -4. 确保你的代码可以通过所有测试用例(新增功能需要添加新的功能测试用例):`pnpm test` +4. 确保你的代码可以通过所有测试用例(新增功能需要添加新的功能测试用例):`pnpm test:unit` 5. 创建 changeset 文件通过命令:`pnpm changeset` 6. 使用 commit 提交你的修改(需遵循 commitlint 规范) 7. 发起 Pull Request diff --git a/package.json b/package.json index 80cf7bd..fc09e26 100644 --- a/package.json +++ b/package.json @@ -30,6 +30,7 @@ "changeset": "changeset", "lint": "eslint ./src --report-unused-disable-directives --max-warnings=0", "lint:fix": "eslint ./src --report-unused-disable-directives --max-warnings=0 --fix", + "test:unit": "vitest", "test": "rm -rf ./test/apis/ ./test/mocks && npm run build && cd ./test && node ./test.js && cd ..", "test:new": "npm run build && cd ./test && node ./test.js && cd ..", "test:windows": "rimraf ./test/apis/ ./test/mocks && npm run build && cd ./test && node ./test.js && cd ..", @@ -81,8 +82,10 @@ "husky": "^9.0.11", "lint-staged": "^16.0.0", "openapi-types": "^12.1.3", + "sanitize-filename": "^1.6.3", "ts-node": "^10.9.2", - "typescript": "5.8.3" + "typescript": "5.8.3", + "vitest": "^3.2.4" }, "keywords": [ "openapi", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 5e3ae19..ed79c6f 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -135,12 +135,18 @@ importers: openapi-types: specifier: ^12.1.3 version: 12.1.3 + sanitize-filename: + specifier: ^1.6.3 + version: 1.6.3 ts-node: specifier: ^10.9.2 version: 10.9.2(@types/node@22.15.30)(typescript@5.8.3) typescript: specifier: 5.8.3 version: 5.8.3 + vitest: + specifier: ^3.2.4 + version: 3.2.4(@types/node@22.15.30)(jiti@2.4.2)(yaml@2.8.0) packages: @@ -332,6 +338,156 @@ packages: resolution: {integrity: sha512-IchNf6dN4tHoMFIn/7OE8LWZ19Y6q/67Bmf6vnGREv8RSbBVb9LPJxEcnwrcwX6ixSvaiGoomAUvu4YSxXrVgw==} engines: {node: '>=12'} + '@esbuild/aix-ppc64@0.25.5': + resolution: {integrity: sha512-9o3TMmpmftaCMepOdA5k/yDw8SfInyzWWTjYTFCX3kPSDJMROQTb8jg+h9Cnwnmm1vOzvxN7gIfB5V2ewpjtGA==} + engines: {node: '>=18'} + cpu: [ppc64] + os: [aix] + + '@esbuild/android-arm64@0.25.5': + resolution: {integrity: sha512-VGzGhj4lJO+TVGV1v8ntCZWJktV7SGCs3Pn1GRWI1SBFtRALoomm8k5E9Pmwg3HOAal2VDc2F9+PM/rEY6oIDg==} + engines: {node: '>=18'} + cpu: [arm64] + os: [android] + + '@esbuild/android-arm@0.25.5': + resolution: {integrity: sha512-AdJKSPeEHgi7/ZhuIPtcQKr5RQdo6OO2IL87JkianiMYMPbCtot9fxPbrMiBADOWWm3T2si9stAiVsGbTQFkbA==} + engines: {node: '>=18'} + cpu: [arm] + os: [android] + + '@esbuild/android-x64@0.25.5': + resolution: {integrity: sha512-D2GyJT1kjvO//drbRT3Hib9XPwQeWd9vZoBJn+bu/lVsOZ13cqNdDeqIF/xQ5/VmWvMduP6AmXvylO/PIc2isw==} + engines: {node: '>=18'} + cpu: [x64] + os: [android] + + '@esbuild/darwin-arm64@0.25.5': + resolution: {integrity: sha512-GtaBgammVvdF7aPIgH2jxMDdivezgFu6iKpmT+48+F8Hhg5J/sfnDieg0aeG/jfSvkYQU2/pceFPDKlqZzwnfQ==} + engines: {node: '>=18'} + cpu: [arm64] + os: [darwin] + + '@esbuild/darwin-x64@0.25.5': + resolution: {integrity: sha512-1iT4FVL0dJ76/q1wd7XDsXrSW+oLoquptvh4CLR4kITDtqi2e/xwXwdCVH8hVHU43wgJdsq7Gxuzcs6Iq/7bxQ==} + engines: {node: '>=18'} + cpu: [x64] + os: [darwin] + + '@esbuild/freebsd-arm64@0.25.5': + resolution: {integrity: sha512-nk4tGP3JThz4La38Uy/gzyXtpkPW8zSAmoUhK9xKKXdBCzKODMc2adkB2+8om9BDYugz+uGV7sLmpTYzvmz6Sw==} + engines: {node: '>=18'} + cpu: [arm64] + os: [freebsd] + + '@esbuild/freebsd-x64@0.25.5': + resolution: {integrity: sha512-PrikaNjiXdR2laW6OIjlbeuCPrPaAl0IwPIaRv+SMV8CiM8i2LqVUHFC1+8eORgWyY7yhQY+2U2fA55mBzReaw==} + engines: {node: '>=18'} + cpu: [x64] + os: [freebsd] + + '@esbuild/linux-arm64@0.25.5': + resolution: {integrity: sha512-Z9kfb1v6ZlGbWj8EJk9T6czVEjjq2ntSYLY2cw6pAZl4oKtfgQuS4HOq41M/BcoLPzrUbNd+R4BXFyH//nHxVg==} + engines: {node: '>=18'} + cpu: [arm64] + os: [linux] + + '@esbuild/linux-arm@0.25.5': + resolution: {integrity: sha512-cPzojwW2okgh7ZlRpcBEtsX7WBuqbLrNXqLU89GxWbNt6uIg78ET82qifUy3W6OVww6ZWobWub5oqZOVtwolfw==} + engines: {node: '>=18'} + cpu: [arm] + os: [linux] + + '@esbuild/linux-ia32@0.25.5': + resolution: {integrity: sha512-sQ7l00M8bSv36GLV95BVAdhJ2QsIbCuCjh/uYrWiMQSUuV+LpXwIqhgJDcvMTj+VsQmqAHL2yYaasENvJ7CDKA==} + engines: {node: '>=18'} + cpu: [ia32] + os: [linux] + + '@esbuild/linux-loong64@0.25.5': + resolution: {integrity: sha512-0ur7ae16hDUC4OL5iEnDb0tZHDxYmuQyhKhsPBV8f99f6Z9KQM02g33f93rNH5A30agMS46u2HP6qTdEt6Q1kg==} + engines: {node: '>=18'} + cpu: [loong64] + os: [linux] + + '@esbuild/linux-mips64el@0.25.5': + resolution: {integrity: sha512-kB/66P1OsHO5zLz0i6X0RxlQ+3cu0mkxS3TKFvkb5lin6uwZ/ttOkP3Z8lfR9mJOBk14ZwZ9182SIIWFGNmqmg==} + engines: {node: '>=18'} + cpu: [mips64el] + os: [linux] + + '@esbuild/linux-ppc64@0.25.5': + resolution: {integrity: sha512-UZCmJ7r9X2fe2D6jBmkLBMQetXPXIsZjQJCjgwpVDz+YMcS6oFR27alkgGv3Oqkv07bxdvw7fyB71/olceJhkQ==} + engines: {node: '>=18'} + cpu: [ppc64] + os: [linux] + + '@esbuild/linux-riscv64@0.25.5': + resolution: {integrity: sha512-kTxwu4mLyeOlsVIFPfQo+fQJAV9mh24xL+y+Bm6ej067sYANjyEw1dNHmvoqxJUCMnkBdKpvOn0Ahql6+4VyeA==} + engines: {node: '>=18'} + cpu: [riscv64] + os: [linux] + + '@esbuild/linux-s390x@0.25.5': + resolution: {integrity: sha512-K2dSKTKfmdh78uJ3NcWFiqyRrimfdinS5ErLSn3vluHNeHVnBAFWC8a4X5N+7FgVE1EjXS1QDZbpqZBjfrqMTQ==} + engines: {node: '>=18'} + cpu: [s390x] + os: [linux] + + '@esbuild/linux-x64@0.25.5': + resolution: {integrity: sha512-uhj8N2obKTE6pSZ+aMUbqq+1nXxNjZIIjCjGLfsWvVpy7gKCOL6rsY1MhRh9zLtUtAI7vpgLMK6DxjO8Qm9lJw==} + engines: {node: '>=18'} + cpu: [x64] + os: [linux] + + '@esbuild/netbsd-arm64@0.25.5': + resolution: {integrity: sha512-pwHtMP9viAy1oHPvgxtOv+OkduK5ugofNTVDilIzBLpoWAM16r7b/mxBvfpuQDpRQFMfuVr5aLcn4yveGvBZvw==} + engines: {node: '>=18'} + cpu: [arm64] + os: [netbsd] + + '@esbuild/netbsd-x64@0.25.5': + resolution: {integrity: sha512-WOb5fKrvVTRMfWFNCroYWWklbnXH0Q5rZppjq0vQIdlsQKuw6mdSihwSo4RV/YdQ5UCKKvBy7/0ZZYLBZKIbwQ==} + engines: {node: '>=18'} + cpu: [x64] + os: [netbsd] + + '@esbuild/openbsd-arm64@0.25.5': + resolution: {integrity: sha512-7A208+uQKgTxHd0G0uqZO8UjK2R0DDb4fDmERtARjSHWxqMTye4Erz4zZafx7Di9Cv+lNHYuncAkiGFySoD+Mw==} + engines: {node: '>=18'} + cpu: [arm64] + os: [openbsd] + + '@esbuild/openbsd-x64@0.25.5': + resolution: {integrity: sha512-G4hE405ErTWraiZ8UiSoesH8DaCsMm0Cay4fsFWOOUcz8b8rC6uCvnagr+gnioEjWn0wC+o1/TAHt+It+MpIMg==} + engines: {node: '>=18'} + cpu: [x64] + os: [openbsd] + + '@esbuild/sunos-x64@0.25.5': + resolution: {integrity: sha512-l+azKShMy7FxzY0Rj4RCt5VD/q8mG/e+mDivgspo+yL8zW7qEwctQ6YqKX34DTEleFAvCIUviCFX1SDZRSyMQA==} + engines: {node: '>=18'} + cpu: [x64] + os: [sunos] + + '@esbuild/win32-arm64@0.25.5': + resolution: {integrity: sha512-O2S7SNZzdcFG7eFKgvwUEZ2VG9D/sn/eIiz8XRZ1Q/DO5a3s76Xv0mdBzVM5j5R639lXQmPmSo0iRpHqUUrsxw==} + engines: {node: '>=18'} + cpu: [arm64] + os: [win32] + + '@esbuild/win32-ia32@0.25.5': + resolution: {integrity: sha512-onOJ02pqs9h1iMJ1PQphR+VZv8qBMQ77Klcsqv9CNW2w6yLqoURLcgERAIurY6QE63bbLuqgP9ATqajFLK5AMQ==} + engines: {node: '>=18'} + cpu: [ia32] + os: [win32] + + '@esbuild/win32-x64@0.25.5': + resolution: {integrity: sha512-TXv6YnJ8ZMVdX+SXWVBo/0p8LTcrUYngpWjvm91TMjjBQii7Oz11Lw5lbDV5Y0TzuhSJHwiH4hEtC1I42mMS0g==} + engines: {node: '>=18'} + cpu: [x64] + os: [win32] + '@eslint-community/eslint-utils@4.4.1': resolution: {integrity: sha512-s3O3waFUrMV8P/XaF/+ZTp1X9XBZW1a4B97ZnjQF2KYWaFD2A8KyFBsrsfSjEmjn3RGWAIuvlneuZm3CUK3jbA==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} @@ -425,6 +581,117 @@ packages: peerDependencies: prettier: '*' + '@rollup/rollup-android-arm-eabi@4.44.1': + resolution: {integrity: sha512-JAcBr1+fgqx20m7Fwe1DxPUl/hPkee6jA6Pl7n1v2EFiktAHenTaXl5aIFjUIEsfn9w3HE4gK1lEgNGMzBDs1w==} + cpu: [arm] + os: [android] + + '@rollup/rollup-android-arm64@4.44.1': + resolution: {integrity: sha512-RurZetXqTu4p+G0ChbnkwBuAtwAbIwJkycw1n6GvlGlBuS4u5qlr5opix8cBAYFJgaY05TWtM+LaoFggUmbZEQ==} + cpu: [arm64] + os: [android] + + '@rollup/rollup-darwin-arm64@4.44.1': + resolution: {integrity: sha512-fM/xPesi7g2M7chk37LOnmnSTHLG/v2ggWqKj3CCA1rMA4mm5KVBT1fNoswbo1JhPuNNZrVwpTvlCVggv8A2zg==} + cpu: [arm64] + os: [darwin] + + '@rollup/rollup-darwin-x64@4.44.1': + resolution: {integrity: sha512-gDnWk57urJrkrHQ2WVx9TSVTH7lSlU7E3AFqiko+bgjlh78aJ88/3nycMax52VIVjIm3ObXnDL2H00e/xzoipw==} + cpu: [x64] + os: [darwin] + + '@rollup/rollup-freebsd-arm64@4.44.1': + resolution: {integrity: sha512-wnFQmJ/zPThM5zEGcnDcCJeYJgtSLjh1d//WuHzhf6zT3Md1BvvhJnWoy+HECKu2bMxaIcfWiu3bJgx6z4g2XA==} + cpu: [arm64] + os: [freebsd] + + '@rollup/rollup-freebsd-x64@4.44.1': + resolution: {integrity: sha512-uBmIxoJ4493YATvU2c0upGz87f99e3wop7TJgOA/bXMFd2SvKCI7xkxY/5k50bv7J6dw1SXT4MQBQSLn8Bb/Uw==} + cpu: [x64] + os: [freebsd] + + '@rollup/rollup-linux-arm-gnueabihf@4.44.1': + resolution: {integrity: sha512-n0edDmSHlXFhrlmTK7XBuwKlG5MbS7yleS1cQ9nn4kIeW+dJH+ExqNgQ0RrFRew8Y+0V/x6C5IjsHrJmiHtkxQ==} + cpu: [arm] + os: [linux] + libc: [glibc] + + '@rollup/rollup-linux-arm-musleabihf@4.44.1': + resolution: {integrity: sha512-8WVUPy3FtAsKSpyk21kV52HCxB+me6YkbkFHATzC2Yd3yuqHwy2lbFL4alJOLXKljoRw08Zk8/xEj89cLQ/4Nw==} + cpu: [arm] + os: [linux] + libc: [musl] + + '@rollup/rollup-linux-arm64-gnu@4.44.1': + resolution: {integrity: sha512-yuktAOaeOgorWDeFJggjuCkMGeITfqvPgkIXhDqsfKX8J3jGyxdDZgBV/2kj/2DyPaLiX6bPdjJDTu9RB8lUPQ==} + cpu: [arm64] + os: [linux] + libc: [glibc] + + '@rollup/rollup-linux-arm64-musl@4.44.1': + resolution: {integrity: sha512-W+GBM4ifET1Plw8pdVaecwUgxmiH23CfAUj32u8knq0JPFyK4weRy6H7ooxYFD19YxBulL0Ktsflg5XS7+7u9g==} + cpu: [arm64] + os: [linux] + libc: [musl] + + '@rollup/rollup-linux-loongarch64-gnu@4.44.1': + resolution: {integrity: sha512-1zqnUEMWp9WrGVuVak6jWTl4fEtrVKfZY7CvcBmUUpxAJ7WcSowPSAWIKa/0o5mBL/Ij50SIf9tuirGx63Ovew==} + cpu: [loong64] + os: [linux] + libc: [glibc] + + '@rollup/rollup-linux-powerpc64le-gnu@4.44.1': + resolution: {integrity: sha512-Rl3JKaRu0LHIx7ExBAAnf0JcOQetQffaw34T8vLlg9b1IhzcBgaIdnvEbbsZq9uZp3uAH+JkHd20Nwn0h9zPjA==} + cpu: [ppc64] + os: [linux] + libc: [glibc] + + '@rollup/rollup-linux-riscv64-gnu@4.44.1': + resolution: {integrity: sha512-j5akelU3snyL6K3N/iX7otLBIl347fGwmd95U5gS/7z6T4ftK288jKq3A5lcFKcx7wwzb5rgNvAg3ZbV4BqUSw==} + cpu: [riscv64] + os: [linux] + libc: [glibc] + + '@rollup/rollup-linux-riscv64-musl@4.44.1': + resolution: {integrity: sha512-ppn5llVGgrZw7yxbIm8TTvtj1EoPgYUAbfw0uDjIOzzoqlZlZrLJ/KuiE7uf5EpTpCTrNt1EdtzF0naMm0wGYg==} + cpu: [riscv64] + os: [linux] + libc: [musl] + + '@rollup/rollup-linux-s390x-gnu@4.44.1': + resolution: {integrity: sha512-Hu6hEdix0oxtUma99jSP7xbvjkUM/ycke/AQQ4EC5g7jNRLLIwjcNwaUy95ZKBJJwg1ZowsclNnjYqzN4zwkAw==} + cpu: [s390x] + os: [linux] + libc: [glibc] + + '@rollup/rollup-linux-x64-gnu@4.44.1': + resolution: {integrity: sha512-EtnsrmZGomz9WxK1bR5079zee3+7a+AdFlghyd6VbAjgRJDbTANJ9dcPIPAi76uG05micpEL+gPGmAKYTschQw==} + cpu: [x64] + os: [linux] + libc: [glibc] + + '@rollup/rollup-linux-x64-musl@4.44.1': + resolution: {integrity: sha512-iAS4p+J1az6Usn0f8xhgL4PaU878KEtutP4hqw52I4IO6AGoyOkHCxcc4bqufv1tQLdDWFx8lR9YlwxKuv3/3g==} + cpu: [x64] + os: [linux] + libc: [musl] + + '@rollup/rollup-win32-arm64-msvc@4.44.1': + resolution: {integrity: sha512-NtSJVKcXwcqozOl+FwI41OH3OApDyLk3kqTJgx8+gp6On9ZEt5mYhIsKNPGuaZr3p9T6NWPKGU/03Vw4CNU9qg==} + cpu: [arm64] + os: [win32] + + '@rollup/rollup-win32-ia32-msvc@4.44.1': + resolution: {integrity: sha512-JYA3qvCOLXSsnTR3oiyGws1Dm0YTuxAAeaYGVlGpUsHqloPcFjPg+X0Fj2qODGLNwQOAcCiQmHub/V007kiH5A==} + cpu: [ia32] + os: [win32] + + '@rollup/rollup-win32-x64-msvc@4.44.1': + resolution: {integrity: sha512-J8o22LuF0kTe7m+8PvW9wk3/bRq5+mRo5Dqo6+vXb7otCm3TPhYOJqOaQtGU9YMWQSL3krMnoOxMr0+9E6F3Ug==} + cpu: [x64] + os: [win32] + '@sindresorhus/is@4.6.0': resolution: {integrity: sha512-t09vSN3MdfsyCHoFcTRCH/iUtG7OJ0CsjzB8cjAmKc/va/kIgeDI/TxsigdncE/4be734m0cvIYwNaV4i2XqAw==} engines: {node: '>=10'} @@ -491,9 +758,18 @@ packages: '@types/cacheable-request@6.0.3': resolution: {integrity: sha512-IQ3EbTzGxIigb1I3qPZc1rWJnH0BmSKv5QYTalEwweFvyBDLSAe24zP0le/hyi7ecGfZVlIVAg4BZqb8WBwKqw==} + '@types/chai@5.2.2': + resolution: {integrity: sha512-8kB30R7Hwqf40JPiKhVzodJs2Qc1ZJ5zuT3uzw5Hq/dhNCl3G3l83jfpdI1e20BP348+fV7VIL/+FxaXkqBmWg==} + '@types/conventional-commits-parser@5.0.1': resolution: {integrity: sha512-7uz5EHdzz2TqoMfV7ee61Egf5y6NkcO4FB/1iCCQnbeiI1F3xzv3vK5dBCXUCLQgGYS+mUeigK1iKQzvED+QnQ==} + '@types/deep-eql@4.0.2': + resolution: {integrity: sha512-c9h9dVVMigMPc4bwTvC5dxqtqJZwQPePsWjPlpSOnojbor6pGqdk541lfA7AqFQr5pB1BRdq0juY9db81BwyFw==} + + '@types/estree@1.0.8': + resolution: {integrity: sha512-dWHzHa2WqEXI/O1E9OjrocMTKJl2mSrEolh1Iomrv6U+JuNwaHXsXx9bLu5gG7BUWFIN0skIQJQ/L1rIex4X6w==} + '@types/http-cache-semantics@4.0.4': resolution: {integrity: sha512-1m0bIFVc7eJWyve9S0RnuRgcQqF/Xd5QsUZAZeQFr1Q3/p9JWoQQEqmVy+DPTNpGXwhgIetAoYF8JSc33q29QA==} @@ -591,6 +867,35 @@ packages: '@ungap/structured-clone@1.2.1': resolution: {integrity: sha512-fEzPV3hSkSMltkw152tJKNARhOupqbH96MZWyRjNaYZOMIzbrTeQDG+MTc6Mr2pgzFQzFxAfmhGDNP5QK++2ZA==} + '@vitest/expect@3.2.4': + resolution: {integrity: sha512-Io0yyORnB6sikFlt8QW5K7slY4OjqNX9jmJQ02QDda8lyM6B5oNgVWoSoKPac8/kgnCUzuHQKrSLtu/uOqqrig==} + + '@vitest/mocker@3.2.4': + resolution: {integrity: sha512-46ryTE9RZO/rfDd7pEqFl7etuyzekzEhUbTW3BvmeO/BcCMEgq59BKhek3dXDWgAj4oMK6OZi+vRr1wPW6qjEQ==} + peerDependencies: + msw: ^2.4.9 + vite: ^5.0.0 || ^6.0.0 || ^7.0.0-0 + peerDependenciesMeta: + msw: + optional: true + vite: + optional: true + + '@vitest/pretty-format@3.2.4': + resolution: {integrity: sha512-IVNZik8IVRJRTr9fxlitMKeJeXFFFN0JaB9PHPGQ8NKQbGpfjlTx9zO4RefN8gp7eqjNy8nyK3NZmBzOPeIxtA==} + + '@vitest/runner@3.2.4': + resolution: {integrity: sha512-oukfKT9Mk41LreEW09vt45f8wx7DordoWUZMYdY/cyAk7w5TWkTRCNZYF7sX7n2wB7jyGAl74OxgwhPgKaqDMQ==} + + '@vitest/snapshot@3.2.4': + resolution: {integrity: sha512-dEYtS7qQP2CjU27QBC5oUOxLE/v5eLkGqPE0ZKEIDGMs4vKWe7IjgLOeauHsR0D5YuuycGRO5oSRXnwnmA78fQ==} + + '@vitest/spy@3.2.4': + resolution: {integrity: sha512-vAfasCOe6AIK70iP5UD11Ac4siNUNJ9i/9PZ3NKx07sG6sUxeag1LWdNrMWeKKYBLlzuK+Gn65Yd5nyL6ds+nw==} + + '@vitest/utils@3.2.4': + resolution: {integrity: sha512-fB2V0JFrQSMsCo9HiSq3Ezpdv4iYaXRG1Sx8edX3MwxfyNn83mKiGzOcH+Fkxt4MHxr3y42fQi1oeAInqgX2QA==} + '@vue/compiler-core@3.5.13': resolution: {integrity: sha512-oOdAkwqUfW1WqpwSYJce06wvt6HljgY3fGeM9NcVA1HaYOij3mZG9Rkysn0OHuyUAGMbEbARIpsG+LPVlBJ5/Q==} @@ -693,6 +998,10 @@ packages: asap@2.0.6: resolution: {integrity: sha512-BSHWgDSAiKs50o2Re8ppvp3seVHXSRM44cdSsT9FfNEUUZLOGWVCsiWaRPWM1Znn+mqZ1OfVZ3z3DWEzSp7hRA==} + assertion-error@2.0.1: + resolution: {integrity: sha512-Izi8RQcffqCeNVgFigKli1ssklIbpHnCYc6AknXGYoB6grJqyeby7jv12JUQgmTAnIDnbck1uxksT4dzN3PWBA==} + engines: {node: '>=12'} + asynckit@0.4.0: resolution: {integrity: sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==} @@ -719,6 +1028,10 @@ packages: resolution: {integrity: sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==} engines: {node: '>=8'} + cac@6.7.14: + resolution: {integrity: sha512-b6Ilus+c3RrdDk+JhLKUAQfzzgLEPy6wcXqS7f/xe1EETvsDP6GORG7SFuOs6cID5YkqchW/LXZbX5bc8j7ZcQ==} + engines: {node: '>=8'} + cacheable-lookup@5.0.4: resolution: {integrity: sha512-2/kNscPhpcxrOigMZzbiWF7dz8ilhb/nIHU3EyZiXWXpeq/au8qJ8VhdftMkty3n7Gj6HIGalQG8oiBNB3AJgA==} engines: {node: '>=10.6.0'} @@ -738,6 +1051,10 @@ packages: resolution: {integrity: sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==} engines: {node: '>=6'} + chai@5.2.0: + resolution: {integrity: sha512-mCuXncKXk5iCLhfhwTc0izo0gtEmpz5CtG2y8GiOINBlMVS6v8TMRc5TaLWKS6692m9+dVVfzgeVxR5UxWHTYw==} + engines: {node: '>=12'} + chalk@4.1.2: resolution: {integrity: sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==} engines: {node: '>=10'} @@ -749,6 +1066,10 @@ packages: chardet@0.7.0: resolution: {integrity: sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA==} + check-error@2.1.1: + resolution: {integrity: sha512-OAlb+T7V4Op9OwdkjmguYRqncdlx5JiofwOAUkmTF+jNdHwzTaTs4sRAGpzLF3oOz5xAyDGrPgeIDFQmDOTiJw==} + engines: {node: '>= 16'} + ci-info@3.9.0: resolution: {integrity: sha512-NIxF55hv4nSqQswkAeiOi1r83xy8JldOFDTWiug55KBu9Jnblncd2U6ViHmYgHf01TPZS77NJBhBMKdWj9HQMQ==} engines: {node: '>=8'} @@ -876,6 +1197,10 @@ packages: resolution: {integrity: sha512-aW35yZM6Bb/4oJlZncMH2LCoZtJXTRxES17vE3hoRiowU2kWHaJKFkSBDnDR+cm9J+9QhXmREyIfv0pji9ejCQ==} engines: {node: '>=10'} + deep-eql@5.0.2: + resolution: {integrity: sha512-h5k/5U50IJJFpzfL6nO9jaaumfjO/f2NjK/oYB2Djzm4p9L+3T9qWpZqZ2hAbLPuuYq9wrU08WQyBTL5GbPk5Q==} + engines: {node: '>=6'} + deep-is@0.1.4: resolution: {integrity: sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==} @@ -957,6 +1282,9 @@ packages: resolution: {integrity: sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==} engines: {node: '>= 0.4'} + es-module-lexer@1.7.0: + resolution: {integrity: sha512-jEQoCwk8hyb2AZziIOLhDqpm5+2ww5uIE6lkO/6jcOCusfk6LhMHpXXfBLXTZ7Ydyt0j4VoUQv6uGNYbdW+kBA==} + es-object-atoms@1.1.1: resolution: {integrity: sha512-FGgH2h8zKNim9ljj7dankFPcICIK9Cp5bm+c2gQSYePhpaG5+esrLODihIorn+Pe6FGJzWhXQotPv73jTaldXA==} engines: {node: '>= 0.4'} @@ -982,6 +1310,11 @@ packages: es6-weak-map@2.0.3: resolution: {integrity: sha512-p5um32HOTO1kP+w7PRnB+5lQ43Z6muuMuIMffvDN8ZB4GcnjLBV6zGStpbASIMk4DCAvEaamhe2zhyCb/QXXsA==} + esbuild@0.25.5: + resolution: {integrity: sha512-P8OtKZRv/5J5hhz0cUAdu/cLuPIKXpQl1R9pZtvmHWQvrAUVd0UNIPT4IB4W3rNOqVO0rlqHmCIbSwxh/c9yUQ==} + engines: {node: '>=18'} + hasBin: true + escalade@3.2.0: resolution: {integrity: sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA==} engines: {node: '>=6'} @@ -1032,6 +1365,9 @@ packages: estree-walker@2.0.2: resolution: {integrity: sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==} + estree-walker@3.0.3: + resolution: {integrity: sha512-7RUKfXgSMMkzt6ZuXmqapOurLGPPfgj6l9uRZ7lRGolvk0y2yocc35LdcxKC5PQZdn2DMqioAQ2NoWcrTKmm6g==} + esutils@2.0.3: resolution: {integrity: sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==} engines: {node: '>=0.10.0'} @@ -1042,6 +1378,10 @@ packages: eventemitter3@5.0.1: resolution: {integrity: sha512-GWkBvjiSZK87ELrYOSESUYeVIc9mvLLf/nXalMOS5dYrgZq9o5OVkbZAVM06CVxYsCwH9BDZFPlQTlPA1j4ahA==} + expect-type@1.2.1: + resolution: {integrity: sha512-/kP8CAwxzLVEeFrMm4kMmy4CCDlpipyA7MYLVrdJIkV0fYF0UaigQHRsxHiuY/GEea+bh4KSv3TIlgr+2UL6bw==} + engines: {node: '>=12.0.0'} + ext@1.7.0: resolution: {integrity: sha512-6hxeJYaL110a9b5TEJSj0gojyHQAmA2ch5Os+ySCiA1QGdS697XWY1pzsrSjqA9LDEEgdB/KypIlR59RcLuHYw==} @@ -1074,6 +1414,14 @@ packages: fastq@1.18.0: resolution: {integrity: sha512-QKHXPW0hD8g4UET03SdOdunzSouc9N4AuHdsX8XNcTsuz+yYFILVNIX4l9yHABMhiEI9Db0JTTIpu0wB+Y1QQw==} + fdir@6.4.6: + resolution: {integrity: sha512-hiFoqpyZcfNm1yc4u8oWCf9A2c4D3QjCrks3zmoVKVxpQRzmPNar1hUJcBG2RQHvEVGDN+Jm81ZheVLAQMK6+w==} + peerDependencies: + picomatch: ^3 || ^4 + peerDependenciesMeta: + picomatch: + optional: true + file-entry-cache@6.0.1: resolution: {integrity: sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg==} engines: {node: ^10.12.0 || >=12.0.0} @@ -1129,6 +1477,11 @@ packages: fs.realpath@1.0.0: resolution: {integrity: sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==} + fsevents@2.3.3: + resolution: {integrity: sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==} + engines: {node: ^8.16.0 || ^10.6.0 || >=11.0.0} + os: [darwin] + function-bind@1.1.2: resolution: {integrity: sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==} @@ -1336,6 +1689,9 @@ packages: js-tokens@4.0.0: resolution: {integrity: sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==} + js-tokens@9.0.1: + resolution: {integrity: sha512-mxa9E9ITFOt0ban3j6L5MpjwegGz6lBQmM1IJkWeBZGcMxto50+eWdjC/52xDbS2vy0k7vIMK0Fe2wfL9OQSpQ==} + js-yaml@3.14.1: resolution: {integrity: sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==} hasBin: true @@ -1440,6 +1796,9 @@ packages: resolution: {integrity: sha512-9ie8ItPR6tjY5uYJh8K/Zrv/RMZ5VOlOWvtZdEHYSTFKZfIBPQa9tOAEeAWhd+AnIneLJ22w5fjOYtoutpWq5w==} engines: {node: '>=18'} + loupe@3.1.4: + resolution: {integrity: sha512-wJzkKwJrheKtknCOKNEtDK4iqg/MxmZheEMtSTYvnzRdEYaZzmgH976nenp8WdJRdx5Vc1X/9MO0Oszl6ezeXg==} + lowercase-keys@2.0.0: resolution: {integrity: sha512-tqNXrS78oMOE73NMxK4EMLQsQowWf8jKooH9g7xPavRT706R6bkQJ6DY2Te7QukaZsulxa30wQ7bk0pm4XiHmA==} engines: {node: '>=8'} @@ -1692,6 +2051,13 @@ packages: resolution: {integrity: sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==} engines: {node: '>=8'} + pathe@2.0.3: + resolution: {integrity: sha512-WUjGcAqP1gQacoQe+OBJsFA7Ld4DyXuUIjZ5cc75cLHvJ7dtNsTugphxIADwspS+AraAUePCKrSVtPLFj/F88w==} + + pathval@2.0.1: + resolution: {integrity: sha512-//nshmD55c46FuFw26xV/xFAaB5HF9Xdap7HJBBnrKdAd6/GxDBaNA1870O79+9ueg61cZLSVc+OaFlfmObYVQ==} + engines: {node: '>= 14.16'} + picocolors@1.1.1: resolution: {integrity: sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==} @@ -1699,6 +2065,10 @@ packages: resolution: {integrity: sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==} engines: {node: '>=8.6'} + picomatch@4.0.2: + resolution: {integrity: sha512-M7BAV6Rlcy5u+m6oPhAPFgJTzAioX/6B0DxyvDlo9l8+T3nLKbrczg2WLUyzd45L8RqfUMyGPzekbMvX2Ldkwg==} + engines: {node: '>=12'} + pidtree@0.6.0: resolution: {integrity: sha512-eG2dWTVw5bzqGRztnHExczNxt5VGsE6OwTeCG3fdUf9KBsZzO3R5OIIIzWR+iZA0NtZ+RDVdaoE2dK1cn6jH4g==} engines: {node: '>=0.10'} @@ -1806,12 +2176,20 @@ packages: engines: {node: 20 || >=22} hasBin: true + rollup@4.44.1: + resolution: {integrity: sha512-x8H8aPvD+xbl0Do8oez5f5o8eMS3trfCghc4HhLAnCkj7Vl0d1JWGs0UF/D886zLW2rOj2QymV/JcSSsw+XDNg==} + engines: {node: '>=18.0.0', npm: '>=8.0.0'} + hasBin: true + run-parallel@1.2.0: resolution: {integrity: sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==} safer-buffer@2.1.2: resolution: {integrity: sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==} + sanitize-filename@1.6.3: + resolution: {integrity: sha512-y/52Mcy7aw3gRm7IrcGDFx/bCk4AhRh2eI9luHOQM86nZsqwiRkkq2GekHXBBD+SmPidc8i2PqtYZl+pWJ8Oeg==} + semver@7.7.2: resolution: {integrity: sha512-RF0Fw+rO5AMf9MAyaRXI4AV0Ulj5lMHqVxxdSgiVbixSCXoEmmX/jk0CuJw4+3SqroYO9VoUh+HcuJivvtJemA==} engines: {node: '>=10'} @@ -1843,6 +2221,9 @@ packages: should@13.2.3: resolution: {integrity: sha512-ggLesLtu2xp+ZxI+ysJTmNjh2U0TsC+rQ/pfED9bUZZ4DKefP27D+7YJVVTvKsmjLpIi9jAa7itwDGkDDmt1GQ==} + siginfo@2.0.0: + resolution: {integrity: sha512-ybx0WO1/8bSBLEWXZvEd7gMW3Sn3JFlW3TvX1nREbDLRNQNaeNN8WK0meBwPdAaOI7TtRRRJn/Es1zhrrCHu7g==} + signal-exit@4.1.0: resolution: {integrity: sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==} engines: {node: '>=14'} @@ -1873,6 +2254,12 @@ packages: sprintf-js@1.0.3: resolution: {integrity: sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g==} + stackback@0.0.2: + resolution: {integrity: sha512-1XMJE5fQo1jGH6Y/7ebnwPOBEkIEnT4QF32d5R1+VXdXveM0IBMJt8zfaxX1P3QhVwrYe+576+jkANtSS2mBbw==} + + std-env@3.9.0: + resolution: {integrity: sha512-UGvjygr6F6tpH7o2qyqR6QYpwraIjKSdtzyBdyytFOHmPZY917kwdwLG0RbOjWOnKmnm3PeHjaoLLMie7kPLQw==} + string-argv@0.3.2: resolution: {integrity: sha512-aqD2Q0144Z+/RqG52NeHEkZauTAUWJO8c6yTftGJKO3Tja5tUgIfmIl6kExvhtxSDP7fXB6DvzkfMpCd/F3G+Q==} engines: {node: '>=0.6.19'} @@ -1905,6 +2292,9 @@ packages: resolution: {integrity: sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==} engines: {node: '>=8'} + strip-literal@3.0.0: + resolution: {integrity: sha512-TcccoMhJOM3OebGhSBEmp3UZ2SfDMZUEBdRA/9ynfLi8yYajyWX3JiXArcJt4Umh4vISpspkQIY8ZZoCqjbviA==} + supports-color@7.2.0: resolution: {integrity: sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==} engines: {node: '>=8'} @@ -1934,9 +2324,31 @@ packages: tiny-pinyin@1.3.2: resolution: {integrity: sha512-uHNGu4evFt/8eNLldazeAM1M8JrMc1jshhJJfVRARTN3yT8HEEibofeQ7QETWQ5ISBjd6fKtTVBCC/+mGS6FpA==} + tinybench@2.9.0: + resolution: {integrity: sha512-0+DUvqWMValLmha6lr4kD8iAMK1HzV0/aKnCtWb9v9641TnP/MFb7Pc2bxoxQjTXAErryXVgUOfv2YqNllqGeg==} + + tinyexec@0.3.2: + resolution: {integrity: sha512-KQQR9yN7R5+OSwaK0XQoj22pwHoTlgYqmUscPYoknOoWCWfj/5/ABTMRi69FrKU5ffPVh5QcFikpWJI/P1ocHA==} + tinyexec@1.0.1: resolution: {integrity: sha512-5uC6DDlmeqiOwCPmK9jMSdOuZTh8bU39Ys6yidB+UTt5hfZUPGAypSgFRiEp+jbi9qH40BLDvy85jIU88wKSqw==} + tinyglobby@0.2.14: + resolution: {integrity: sha512-tX5e7OM1HnYr2+a2C/4V0htOcSQcoSTH9KgJnVvNm5zm/cyEWKJ7j7YutsH9CxMdtOkkLFy2AHrMci9IM8IPZQ==} + engines: {node: '>=12.0.0'} + + tinypool@1.1.1: + resolution: {integrity: sha512-Zba82s87IFq9A9XmjiX5uZA/ARWDrB03OHlq+Vw1fSdt0I+4/Kutwy8BP4Y/y/aORMo61FQ0vIb5j44vSo5Pkg==} + engines: {node: ^18.0.0 || >=20.0.0} + + tinyrainbow@2.0.0: + resolution: {integrity: sha512-op4nsTR47R6p0vMUUoYl/a+ljLFVtlfaXkLQmqfLR1qHma1h/ysYk4hEXZ880bf2CYgTskvTa/e196Vd5dDQXw==} + engines: {node: '>=14.0.0'} + + tinyspy@4.0.3: + resolution: {integrity: sha512-t2T/WLB2WRgZ9EpE4jgPJ9w+i66UZfDc8wHh0xrwiRNN+UwH98GIJkTeZqX9rg0i0ptwzqW+uYeIF0T4F8LR7A==} + engines: {node: '>=14.0.0'} + tmp@0.0.33: resolution: {integrity: sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==} engines: {node: '>=0.6.0'} @@ -1948,6 +2360,9 @@ packages: tr46@0.0.3: resolution: {integrity: sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==} + truncate-utf8-bytes@1.0.2: + resolution: {integrity: sha512-95Pu1QXQvruGEhv62XCMO3Mm90GscOCClvrIUwCM0PYOXK3kaF3l3sIHxx71ThJfcbM2O5Au6SO3AWCSEfW4mQ==} + ts-api-utils@1.4.3: resolution: {integrity: sha512-i3eMG77UTMD0hZhgRS562pv83RC6ukSAC2GMNWc+9dieh/+jDM5u5YG+NHX6VNDRHQcHwmsTHctP9LhbC3WxVw==} engines: {node: '>=16'} @@ -2004,9 +2419,85 @@ packages: uri-js@4.4.1: resolution: {integrity: sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==} + utf8-byte-length@1.0.5: + resolution: {integrity: sha512-Xn0w3MtiQ6zoz2vFyUVruaCL53O/DwUvkEeOvj+uulMm0BkUGYWmBYVyElqZaSLhY6ZD0ulfU3aBra2aVT4xfA==} + v8-compile-cache-lib@3.0.1: resolution: {integrity: sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg==} + vite-node@3.2.4: + resolution: {integrity: sha512-EbKSKh+bh1E1IFxeO0pg1n4dvoOTt0UDiXMd/qn++r98+jPO1xtJilvXldeuQ8giIB5IkpjCgMleHMNEsGH6pg==} + engines: {node: ^18.0.0 || ^20.0.0 || >=22.0.0} + hasBin: true + + vite@7.0.0: + resolution: {integrity: sha512-ixXJB1YRgDIw2OszKQS9WxGHKwLdCsbQNkpJN171udl6szi/rIySHL6/Os3s2+oE4P/FLD4dxg4mD7Wust+u5g==} + engines: {node: ^20.19.0 || >=22.12.0} + hasBin: true + peerDependencies: + '@types/node': ^20.19.0 || >=22.12.0 + jiti: '>=1.21.0' + less: ^4.0.0 + lightningcss: ^1.21.0 + sass: ^1.70.0 + sass-embedded: ^1.70.0 + stylus: '>=0.54.8' + sugarss: ^5.0.0 + terser: ^5.16.0 + tsx: ^4.8.1 + yaml: ^2.4.2 + peerDependenciesMeta: + '@types/node': + optional: true + jiti: + optional: true + less: + optional: true + lightningcss: + optional: true + sass: + optional: true + sass-embedded: + optional: true + stylus: + optional: true + sugarss: + optional: true + terser: + optional: true + tsx: + optional: true + yaml: + optional: true + + vitest@3.2.4: + resolution: {integrity: sha512-LUCP5ev3GURDysTWiP47wRRUpLKMOfPh+yKTx3kVIEiu5KOMeqzpnYNsKyOoVrULivR8tLcks4+lga33Whn90A==} + engines: {node: ^18.0.0 || ^20.0.0 || >=22.0.0} + hasBin: true + peerDependencies: + '@edge-runtime/vm': '*' + '@types/debug': ^4.1.12 + '@types/node': ^18.0.0 || ^20.0.0 || >=22.0.0 + '@vitest/browser': 3.2.4 + '@vitest/ui': 3.2.4 + happy-dom: '*' + jsdom: '*' + peerDependenciesMeta: + '@edge-runtime/vm': + optional: true + '@types/debug': + optional: true + '@types/node': + optional: true + '@vitest/browser': + optional: true + '@vitest/ui': + optional: true + happy-dom: + optional: true + jsdom: + optional: true + vue-demi@0.14.10: resolution: {integrity: sha512-nMZBOwuzabUO0nLgIcc6rycZEebF6eeUfaiQx9+WSk8e29IbLvPU9feI6tqW4kTo3hvoYAJkMh8n8D0fuISphg==} engines: {node: '>=12'} @@ -2037,6 +2528,11 @@ packages: engines: {node: '>= 8'} hasBin: true + why-is-node-running@2.3.0: + resolution: {integrity: sha512-hUrmaWBdVDcxvYqnyh09zunKzROWjbZTiNy8dBEjkS7ehEDQibXJ7XvlmtbwuTclUiIyN+CyXQD4Vmko8fNm8w==} + engines: {node: '>=8'} + hasBin: true + word-wrap@1.2.5: resolution: {integrity: sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA==} engines: {node: '>=0.10.0'} @@ -2422,6 +2918,81 @@ snapshots: dependencies: '@jridgewell/trace-mapping': 0.3.9 + '@esbuild/aix-ppc64@0.25.5': + optional: true + + '@esbuild/android-arm64@0.25.5': + optional: true + + '@esbuild/android-arm@0.25.5': + optional: true + + '@esbuild/android-x64@0.25.5': + optional: true + + '@esbuild/darwin-arm64@0.25.5': + optional: true + + '@esbuild/darwin-x64@0.25.5': + optional: true + + '@esbuild/freebsd-arm64@0.25.5': + optional: true + + '@esbuild/freebsd-x64@0.25.5': + optional: true + + '@esbuild/linux-arm64@0.25.5': + optional: true + + '@esbuild/linux-arm@0.25.5': + optional: true + + '@esbuild/linux-ia32@0.25.5': + optional: true + + '@esbuild/linux-loong64@0.25.5': + optional: true + + '@esbuild/linux-mips64el@0.25.5': + optional: true + + '@esbuild/linux-ppc64@0.25.5': + optional: true + + '@esbuild/linux-riscv64@0.25.5': + optional: true + + '@esbuild/linux-s390x@0.25.5': + optional: true + + '@esbuild/linux-x64@0.25.5': + optional: true + + '@esbuild/netbsd-arm64@0.25.5': + optional: true + + '@esbuild/netbsd-x64@0.25.5': + optional: true + + '@esbuild/openbsd-arm64@0.25.5': + optional: true + + '@esbuild/openbsd-x64@0.25.5': + optional: true + + '@esbuild/sunos-x64@0.25.5': + optional: true + + '@esbuild/win32-arm64@0.25.5': + optional: true + + '@esbuild/win32-ia32@0.25.5': + optional: true + + '@esbuild/win32-x64@0.25.5': + optional: true + '@eslint-community/eslint-utils@4.4.1(eslint@8.57.1)': dependencies: eslint: 8.57.1 @@ -2531,6 +3102,66 @@ snapshots: make-synchronized: 0.8.0 prettier: 3.5.3 + '@rollup/rollup-android-arm-eabi@4.44.1': + optional: true + + '@rollup/rollup-android-arm64@4.44.1': + optional: true + + '@rollup/rollup-darwin-arm64@4.44.1': + optional: true + + '@rollup/rollup-darwin-x64@4.44.1': + optional: true + + '@rollup/rollup-freebsd-arm64@4.44.1': + optional: true + + '@rollup/rollup-freebsd-x64@4.44.1': + optional: true + + '@rollup/rollup-linux-arm-gnueabihf@4.44.1': + optional: true + + '@rollup/rollup-linux-arm-musleabihf@4.44.1': + optional: true + + '@rollup/rollup-linux-arm64-gnu@4.44.1': + optional: true + + '@rollup/rollup-linux-arm64-musl@4.44.1': + optional: true + + '@rollup/rollup-linux-loongarch64-gnu@4.44.1': + optional: true + + '@rollup/rollup-linux-powerpc64le-gnu@4.44.1': + optional: true + + '@rollup/rollup-linux-riscv64-gnu@4.44.1': + optional: true + + '@rollup/rollup-linux-riscv64-musl@4.44.1': + optional: true + + '@rollup/rollup-linux-s390x-gnu@4.44.1': + optional: true + + '@rollup/rollup-linux-x64-gnu@4.44.1': + optional: true + + '@rollup/rollup-linux-x64-musl@4.44.1': + optional: true + + '@rollup/rollup-win32-arm64-msvc@4.44.1': + optional: true + + '@rollup/rollup-win32-ia32-msvc@4.44.1': + optional: true + + '@rollup/rollup-win32-x64-msvc@4.44.1': + optional: true + '@sindresorhus/is@4.6.0': {} '@szmarczak/http-timer@4.0.6': @@ -2593,10 +3224,18 @@ snapshots: '@types/node': 22.15.30 '@types/responselike': 1.0.3 + '@types/chai@5.2.2': + dependencies: + '@types/deep-eql': 4.0.2 + '@types/conventional-commits-parser@5.0.1': dependencies: '@types/node': 22.15.30 + '@types/deep-eql@4.0.2': {} + + '@types/estree@1.0.8': {} + '@types/http-cache-semantics@4.0.4': {} '@types/js-yaml@4.0.9': {} @@ -2713,6 +3352,48 @@ snapshots: '@ungap/structured-clone@1.2.1': {} + '@vitest/expect@3.2.4': + dependencies: + '@types/chai': 5.2.2 + '@vitest/spy': 3.2.4 + '@vitest/utils': 3.2.4 + chai: 5.2.0 + tinyrainbow: 2.0.0 + + '@vitest/mocker@3.2.4(vite@7.0.0(@types/node@22.15.30)(jiti@2.4.2)(yaml@2.8.0))': + dependencies: + '@vitest/spy': 3.2.4 + estree-walker: 3.0.3 + magic-string: 0.30.17 + optionalDependencies: + vite: 7.0.0(@types/node@22.15.30)(jiti@2.4.2)(yaml@2.8.0) + + '@vitest/pretty-format@3.2.4': + dependencies: + tinyrainbow: 2.0.0 + + '@vitest/runner@3.2.4': + dependencies: + '@vitest/utils': 3.2.4 + pathe: 2.0.3 + strip-literal: 3.0.0 + + '@vitest/snapshot@3.2.4': + dependencies: + '@vitest/pretty-format': 3.2.4 + magic-string: 0.30.17 + pathe: 2.0.3 + + '@vitest/spy@3.2.4': + dependencies: + tinyspy: 4.0.3 + + '@vitest/utils@3.2.4': + dependencies: + '@vitest/pretty-format': 3.2.4 + loupe: 3.1.4 + tinyrainbow: 2.0.0 + '@vue/compiler-core@3.5.13': dependencies: '@babel/parser': 7.27.7 @@ -2830,6 +3511,8 @@ snapshots: asap@2.0.6: {} + assertion-error@2.0.1: {} + asynckit@0.4.0: {} axios@1.10.0: @@ -2863,6 +3546,8 @@ snapshots: dependencies: fill-range: 7.1.1 + cac@6.7.14: {} + cacheable-lookup@5.0.4: {} cacheable-request@7.0.4: @@ -2884,6 +3569,14 @@ snapshots: callsites@3.1.0: {} + chai@5.2.0: + dependencies: + assertion-error: 2.0.1 + check-error: 2.1.1 + deep-eql: 5.0.2 + loupe: 3.1.4 + pathval: 2.0.1 + chalk@4.1.2: dependencies: ansi-styles: 4.3.0 @@ -2893,6 +3586,8 @@ snapshots: chardet@0.7.0: {} + check-error@2.1.1: {} + ci-info@3.9.0: {} cli-cursor@5.0.0: @@ -3003,6 +3698,8 @@ snapshots: dependencies: mimic-response: 3.1.0 + deep-eql@5.0.2: {} + deep-is@0.1.4: {} defer-to-connect@2.0.1: {} @@ -3064,6 +3761,8 @@ snapshots: es-errors@1.3.0: {} + es-module-lexer@1.7.0: {} + es-object-atoms@1.1.1: dependencies: es-errors: 1.3.0 @@ -3102,6 +3801,34 @@ snapshots: es6-iterator: 2.0.3 es6-symbol: 3.1.4 + esbuild@0.25.5: + optionalDependencies: + '@esbuild/aix-ppc64': 0.25.5 + '@esbuild/android-arm': 0.25.5 + '@esbuild/android-arm64': 0.25.5 + '@esbuild/android-x64': 0.25.5 + '@esbuild/darwin-arm64': 0.25.5 + '@esbuild/darwin-x64': 0.25.5 + '@esbuild/freebsd-arm64': 0.25.5 + '@esbuild/freebsd-x64': 0.25.5 + '@esbuild/linux-arm': 0.25.5 + '@esbuild/linux-arm64': 0.25.5 + '@esbuild/linux-ia32': 0.25.5 + '@esbuild/linux-loong64': 0.25.5 + '@esbuild/linux-mips64el': 0.25.5 + '@esbuild/linux-ppc64': 0.25.5 + '@esbuild/linux-riscv64': 0.25.5 + '@esbuild/linux-s390x': 0.25.5 + '@esbuild/linux-x64': 0.25.5 + '@esbuild/netbsd-arm64': 0.25.5 + '@esbuild/netbsd-x64': 0.25.5 + '@esbuild/openbsd-arm64': 0.25.5 + '@esbuild/openbsd-x64': 0.25.5 + '@esbuild/sunos-x64': 0.25.5 + '@esbuild/win32-arm64': 0.25.5 + '@esbuild/win32-ia32': 0.25.5 + '@esbuild/win32-x64': 0.25.5 + escalade@3.2.0: {} escape-string-regexp@4.0.0: {} @@ -3183,6 +3910,10 @@ snapshots: estree-walker@2.0.2: {} + estree-walker@3.0.3: + dependencies: + '@types/estree': 1.0.8 + esutils@2.0.3: {} event-emitter@0.3.5: @@ -3192,6 +3923,8 @@ snapshots: eventemitter3@5.0.1: {} + expect-type@1.2.1: {} + ext@1.7.0: dependencies: type: 2.7.3 @@ -3226,6 +3959,10 @@ snapshots: dependencies: reusify: 1.0.4 + fdir@6.4.6(picomatch@4.0.2): + optionalDependencies: + picomatch: 4.0.2 + file-entry-cache@6.0.1: dependencies: flat-cache: 3.2.0 @@ -3287,6 +4024,9 @@ snapshots: fs.realpath@1.0.0: {} + fsevents@2.3.3: + optional: true + function-bind@1.1.2: {} get-caller-file@2.0.5: {} @@ -3481,6 +4221,8 @@ snapshots: js-tokens@4.0.0: {} + js-tokens@9.0.1: {} + js-yaml@3.14.1: dependencies: argparse: 1.0.10 @@ -3585,6 +4327,8 @@ snapshots: strip-ansi: 7.1.0 wrap-ansi: 9.0.0 + loupe@3.1.4: {} + lowercase-keys@2.0.0: {} lru-cache@11.1.0: {} @@ -3809,10 +4553,16 @@ snapshots: path-type@4.0.0: {} + pathe@2.0.3: {} + + pathval@2.0.1: {} + picocolors@1.1.1: {} picomatch@2.3.1: {} + picomatch@4.0.2: {} + pidtree@0.6.0: {} pify@4.0.1: {} @@ -3891,12 +4641,42 @@ snapshots: glob: 11.0.3 package-json-from-dist: 1.0.1 + rollup@4.44.1: + dependencies: + '@types/estree': 1.0.8 + optionalDependencies: + '@rollup/rollup-android-arm-eabi': 4.44.1 + '@rollup/rollup-android-arm64': 4.44.1 + '@rollup/rollup-darwin-arm64': 4.44.1 + '@rollup/rollup-darwin-x64': 4.44.1 + '@rollup/rollup-freebsd-arm64': 4.44.1 + '@rollup/rollup-freebsd-x64': 4.44.1 + '@rollup/rollup-linux-arm-gnueabihf': 4.44.1 + '@rollup/rollup-linux-arm-musleabihf': 4.44.1 + '@rollup/rollup-linux-arm64-gnu': 4.44.1 + '@rollup/rollup-linux-arm64-musl': 4.44.1 + '@rollup/rollup-linux-loongarch64-gnu': 4.44.1 + '@rollup/rollup-linux-powerpc64le-gnu': 4.44.1 + '@rollup/rollup-linux-riscv64-gnu': 4.44.1 + '@rollup/rollup-linux-riscv64-musl': 4.44.1 + '@rollup/rollup-linux-s390x-gnu': 4.44.1 + '@rollup/rollup-linux-x64-gnu': 4.44.1 + '@rollup/rollup-linux-x64-musl': 4.44.1 + '@rollup/rollup-win32-arm64-msvc': 4.44.1 + '@rollup/rollup-win32-ia32-msvc': 4.44.1 + '@rollup/rollup-win32-x64-msvc': 4.44.1 + fsevents: 2.3.3 + run-parallel@1.2.0: dependencies: queue-microtask: 1.2.3 safer-buffer@2.1.2: {} + sanitize-filename@1.6.3: + dependencies: + truncate-utf8-bytes: 1.0.2 + semver@7.7.2: {} shebang-command@2.0.0: @@ -3931,6 +4711,8 @@ snapshots: should-type-adaptors: 1.1.0 should-util: 1.0.1 + siginfo@2.0.0: {} + signal-exit@4.1.0: {} slash@3.0.0: {} @@ -3956,6 +4738,10 @@ snapshots: sprintf-js@1.0.3: {} + stackback@0.0.2: {} + + std-env@3.9.0: {} + string-argv@0.3.2: {} string-width@4.2.3: @@ -3988,6 +4774,10 @@ snapshots: strip-json-comments@3.1.1: {} + strip-literal@3.0.0: + dependencies: + js-tokens: 9.0.1 + supports-color@7.2.0: dependencies: has-flag: 4.0.0 @@ -4023,8 +4813,23 @@ snapshots: tiny-pinyin@1.3.2: {} + tinybench@2.9.0: {} + + tinyexec@0.3.2: {} + tinyexec@1.0.1: {} + tinyglobby@0.2.14: + dependencies: + fdir: 6.4.6(picomatch@4.0.2) + picomatch: 4.0.2 + + tinypool@1.1.1: {} + + tinyrainbow@2.0.0: {} + + tinyspy@4.0.3: {} + tmp@0.0.33: dependencies: os-tmpdir: 1.0.2 @@ -4035,6 +4840,10 @@ snapshots: tr46@0.0.3: {} + truncate-utf8-bytes@1.0.2: + dependencies: + utf8-byte-length: 1.0.5 + ts-api-utils@1.4.3(typescript@5.8.3): dependencies: typescript: 5.8.3 @@ -4084,8 +4893,86 @@ snapshots: dependencies: punycode: 2.3.1 + utf8-byte-length@1.0.5: {} + v8-compile-cache-lib@3.0.1: {} + vite-node@3.2.4(@types/node@22.15.30)(jiti@2.4.2)(yaml@2.8.0): + dependencies: + cac: 6.7.14 + debug: 4.4.1 + es-module-lexer: 1.7.0 + pathe: 2.0.3 + vite: 7.0.0(@types/node@22.15.30)(jiti@2.4.2)(yaml@2.8.0) + transitivePeerDependencies: + - '@types/node' + - jiti + - less + - lightningcss + - sass + - sass-embedded + - stylus + - sugarss + - supports-color + - terser + - tsx + - yaml + + vite@7.0.0(@types/node@22.15.30)(jiti@2.4.2)(yaml@2.8.0): + dependencies: + esbuild: 0.25.5 + fdir: 6.4.6(picomatch@4.0.2) + picomatch: 4.0.2 + postcss: 8.5.6 + rollup: 4.44.1 + tinyglobby: 0.2.14 + optionalDependencies: + '@types/node': 22.15.30 + fsevents: 2.3.3 + jiti: 2.4.2 + yaml: 2.8.0 + + vitest@3.2.4(@types/node@22.15.30)(jiti@2.4.2)(yaml@2.8.0): + dependencies: + '@types/chai': 5.2.2 + '@vitest/expect': 3.2.4 + '@vitest/mocker': 3.2.4(vite@7.0.0(@types/node@22.15.30)(jiti@2.4.2)(yaml@2.8.0)) + '@vitest/pretty-format': 3.2.4 + '@vitest/runner': 3.2.4 + '@vitest/snapshot': 3.2.4 + '@vitest/spy': 3.2.4 + '@vitest/utils': 3.2.4 + chai: 5.2.0 + debug: 4.4.1 + expect-type: 1.2.1 + magic-string: 0.30.17 + pathe: 2.0.3 + picomatch: 4.0.2 + std-env: 3.9.0 + tinybench: 2.9.0 + tinyexec: 0.3.2 + tinyglobby: 0.2.14 + tinypool: 1.1.1 + tinyrainbow: 2.0.0 + vite: 7.0.0(@types/node@22.15.30)(jiti@2.4.2)(yaml@2.8.0) + vite-node: 3.2.4(@types/node@22.15.30)(jiti@2.4.2)(yaml@2.8.0) + why-is-node-running: 2.3.0 + optionalDependencies: + '@types/node': 22.15.30 + transitivePeerDependencies: + - jiti + - less + - lightningcss + - msw + - sass + - sass-embedded + - stylus + - sugarss + - supports-color + - terser + - tsx + - yaml + vue-demi@0.14.10(vue@3.5.13(typescript@5.8.3)): dependencies: vue: 3.5.13(typescript@5.8.3) @@ -4111,6 +4998,11 @@ snapshots: dependencies: isexe: 2.0.0 + why-is-node-running@2.3.0: + dependencies: + siginfo: 2.0.0 + stackback: 0.0.2 + word-wrap@1.2.5: {} wrap-ansi@7.0.0: diff --git a/src/bin/cli.ts b/src/bin/cli.ts index 22b3037..fd27b2e 100644 --- a/src/bin/cli.ts +++ b/src/bin/cli.ts @@ -2,7 +2,8 @@ import chalk from 'chalk'; import { program } from 'commander'; -import { GenerateServiceProps, generateService } from '../index'; +import type { GenerateServiceProps } from '../index'; +import { generateService } from '../index'; import { readConfig } from '../readConfig'; program diff --git a/src/bin/openapi.ts b/src/bin/openapi.ts index 635c2b0..37b1123 100644 --- a/src/bin/openapi.ts +++ b/src/bin/openapi.ts @@ -4,10 +4,11 @@ import { pickBy } from 'lodash'; import { join } from 'path'; import * as pkg from '../../package.json'; -import { GenerateServiceProps, generateService } from '../index'; +import type { GenerateServiceProps } from '../index'; +import { generateService } from '../index'; import { logError } from '../log'; import { readConfig } from '../readConfig'; -import { IPriorityRule, IReactQueryMode } from '../type'; +import type { IPriorityRule, IReactQueryMode } from '../type'; const params = program .name('openapi') diff --git a/src/config.ts b/src/config.ts index 798f16c..d76ea74 100644 --- a/src/config.ts +++ b/src/config.ts @@ -1,4 +1,4 @@ -import { IReactQueryMode } from './type'; +import type { IReactQueryMode } from './type'; export enum SchemaObjectFormat { int32 = 'int32', diff --git a/src/generator/config.ts b/src/generator/config.ts index c00c7ec..ee59f5f 100644 --- a/src/generator/config.ts +++ b/src/generator/config.ts @@ -1,6 +1,6 @@ -import { Dictionary } from 'lodash'; +import type { Dictionary } from 'lodash'; -import { IReactQueryMode, ParameterObject, SchemaObject } from '../type'; +import type { IReactQueryMode, ParameterObject, SchemaObject } from '../type'; export const serviceEntryFileName = 'index'; diff --git a/src/generator/mockGenarator.ts b/src/generator/mockGenarator.ts index 422b745..13804d6 100644 --- a/src/generator/mockGenarator.ts +++ b/src/generator/mockGenarator.ts @@ -1,5 +1,6 @@ import fs from 'fs'; -import { Dictionary, forEach, includes, isUndefined, keys } from 'lodash'; +import type { Dictionary } from 'lodash'; +import { forEach, includes, isUndefined, keys } from 'lodash'; import Mock from 'mockjs'; import { dirname, join } from 'path'; import pinyin from 'tiny-pinyin'; @@ -7,7 +8,7 @@ import pinyin from 'tiny-pinyin'; import log from '../log'; import OpenAPIParserMock from '../parser-mock/index'; import { getRandomInt } from '../parser-mock/util'; -import { +import type { OpenAPIObject, OperationObject, ParameterObject, diff --git a/src/generator/patchSchema.ts b/src/generator/patchSchema.ts index f68e709..ce62c11 100644 --- a/src/generator/patchSchema.ts +++ b/src/generator/patchSchema.ts @@ -1,5 +1,5 @@ +import type { Dictionary } from 'lodash'; import { - Dictionary, forEach, has, isEmpty, @@ -12,7 +12,7 @@ import { uniq, } from 'lodash'; -import { ComponentsObject, ISchemaObject, SchemaObject } from '../type'; +import type { ComponentsObject, ISchemaObject, SchemaObject } from '../type'; import { isArraySchemaObject, isNonArraySchemaObject, diff --git a/src/generator/serviceGenarator.ts b/src/generator/serviceGenarator.ts index 18e9cde..eb05190 100644 --- a/src/generator/serviceGenarator.ts +++ b/src/generator/serviceGenarator.ts @@ -1,7 +1,7 @@ import { existsSync, readFileSync } from 'fs'; import { globSync } from 'glob'; +import type { Dictionary } from 'lodash'; import { - Dictionary, // camelCase, entries, filter, @@ -27,7 +27,7 @@ import { } from '../config'; import type { GenerateServiceProps } from '../index'; import log from '../log'; -import { +import type { ArraySchemaObject, ContentObject, ISchemaObject, @@ -62,7 +62,7 @@ import { import { writeFile } from './file'; import { Merger } from './merge'; import { patchSchema } from './patchSchema'; -import { +import type { APIDataType, ControllerType, ICustomParameterObject, @@ -72,9 +72,9 @@ import { IServiceControllerPayload, ITypeItem, ITypescriptFileType, - type MergeOption, TagAPIDataType, } from './type'; +import { type MergeOption } from './type'; import { capitalizeFirstLetter, genDefaultFunctionName, @@ -947,7 +947,7 @@ export default class ServiceGenerator { // 具名 body 场景 if (isReferenceObject(schema)) { - bodySchema.type = `${this.config.namespace}.${bodySchema.type}`; + bodySchema.type = `${bodySchema.type}`; } else { bodySchema.isAnonymous = true; } @@ -1049,7 +1049,7 @@ export default class ServiceGenerator { DEFAULT_SCHEMA) as SchemaObject; } - responseSchema.type = `${this.config.namespace}.${this.getType(schema, this.config.namespace)}`; + responseSchema.type = `${this.getType(schema, this.config.namespace)}`; return responseSchema; } diff --git a/src/generator/type.ts b/src/generator/type.ts index c2d28b9..b1fe6fd 100644 --- a/src/generator/type.ts +++ b/src/generator/type.ts @@ -1,12 +1,8 @@ import type { ProjectOptions } from 'ts-morph'; -import { - type MutuallyExclusive, - OperationObject, - ParameterObject, - SchemaObject, -} from '../type'; -import { TypescriptFileType } from './config'; +import type { OperationObject, ParameterObject, SchemaObject } from '../type'; +import { type MutuallyExclusive } from '../type'; +import type { TypescriptFileType } from './config'; export type ITypescriptFileType = keyof typeof TypescriptFileType; diff --git a/src/generator/util.ts b/src/generator/util.ts index 0c362b9..1f8a581 100644 --- a/src/generator/util.ts +++ b/src/generator/util.ts @@ -1,5 +1,5 @@ +import type { Dictionary } from 'lodash'; import { - Dictionary, countBy, every, filter, @@ -20,7 +20,7 @@ import pinyin from 'tiny-pinyin'; import { SchemaObjectType } from '../config'; import log from '../log'; -import { +import type { ArraySchemaObject, BinaryArraySchemaObject, ComponentsObject, @@ -32,7 +32,7 @@ import { SchemaObject, } from '../type'; import { numberEnum } from './config'; -import { ICustomSchemaObject, ITypeItem } from './type'; +import type { ICustomSchemaObject, ITypeItem } from './type'; export function stripDot(str: string) { return str.replace(/[-_ .](\w)/g, (_all, letter: string) => @@ -135,8 +135,8 @@ export function getDefaultType( } if (isReferenceObject(schemaObject)) { - return getRefName(schemaObject); - // return [namespace, getRefName(schemaObject)].filter((s) => s).join('.'); + // return getRefName(schemaObject); + return [namespace, getRefName(schemaObject)].filter((s) => s).join('.'); } let type = schemaObject?.type; diff --git a/src/index.ts b/src/index.ts index fb5c380..0f4277c 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,13 +1,12 @@ import { isEmpty, map } from 'lodash'; import { PriorityRule, ReactQueryMode } from './config'; -import { TypescriptFileType } from './generator/config'; +import type { TypescriptFileType } from './generator/config'; import { mockGenerator } from './generator/mockGenarator'; import ServiceGenerator from './generator/serviceGenarator'; -import { APIDataType } from './generator/type'; -import { +import type { APIDataType } from './generator/type'; +import type { ComponentsObject, - type GetSchemaByApifoxProps, IPriorityRule, IReactQueryMode, OpenAPIObject, @@ -15,6 +14,7 @@ import { ReferenceObject, SchemaObject, } from './type'; +import { type GetSchemaByApifoxProps } from './type'; import { getImportStatement, getOpenAPIConfig, diff --git a/src/parser-mock/index.ts b/src/parser-mock/index.ts index 3ba0469..32ad4f7 100644 --- a/src/parser-mock/index.ts +++ b/src/parser-mock/index.ts @@ -1,9 +1,9 @@ import { isObject, isUndefined, keys } from 'lodash'; import memoizee from 'memoizee'; -import { OpenAPIV3 } from 'openapi-types'; +import type { OpenAPIV3 } from 'openapi-types'; import { isReferenceObject } from '../generator/util'; -import { +import type { ArraySchemaObject, ISchemaObject, OpenAPIObject, diff --git a/src/parser-mock/util.ts b/src/parser-mock/util.ts index f67bd89..1e3af67 100644 --- a/src/parser-mock/util.ts +++ b/src/parser-mock/util.ts @@ -1,8 +1,8 @@ import { isArray, isObject } from 'lodash'; -import { OpenAPIV3 } from 'openapi-types'; +import type { OpenAPIV3 } from 'openapi-types'; import { isSchemaObject } from '../generator/util'; -import { +import type { OpenAPIObject, ParameterObject, ReferenceObject, diff --git a/src/type.ts b/src/type.ts index e54c6b4..aab1266 100644 --- a/src/type.ts +++ b/src/type.ts @@ -1,6 +1,6 @@ -import { OpenAPIV3 } from 'openapi-types'; +import type { OpenAPIV3 } from 'openapi-types'; -import { +import type { PriorityRule, ReactQueryMode, SchemaObjectFormat, diff --git a/src/util.ts b/src/util.ts index bffef3f..cc19b1f 100644 --- a/src/util.ts +++ b/src/util.ts @@ -12,16 +12,12 @@ import { uniq, } from 'lodash'; import { readFileSync } from 'node:fs'; -import { OpenAPI, OpenAPIV2, OpenAPIV3 } from 'openapi-types'; +import type { OpenAPI, OpenAPIV2, OpenAPIV3 } from 'openapi-types'; import converter from 'swagger2openapi'; import log, { logError } from './log'; -import { - type APIFoxBody, - type GetSchemaByApifoxProps, - OpenAPIObject, - OperationObject, -} from './type'; +import type { OpenAPIObject, OperationObject } from './type'; +import { type APIFoxBody, type GetSchemaByApifoxProps } from './type'; export const getImportStatement = (requestLibPath: string) => { if (requestLibPath) { diff --git a/test/__snapshots__/both/should both excludeTags and excludePaths works while excludePaths has wildcard.snap b/test/__snapshots__/both/should both excludeTags and excludePaths works while excludePaths has wildcard.snap new file mode 100644 index 0000000..180b0be --- /dev/null +++ b/test/__snapshots__/both/should both excludeTags and excludePaths works while excludePaths has wildcard.snap @@ -0,0 +1,37 @@ +/* eslint-disable */ +// @ts-ignore +export * from './types'; + +export * from './userZ'; +/* eslint-disable */ +// @ts-ignore +export {}; +/* eslint-disable */ +// @ts-ignore +import request from '../request'; + +import * as API from './types'; + +/** f1 ffff GET /user-z/z1 */ +export async function userZz1UsingGet({ + options, +}: { + options?: { [key: string]: unknown }; +}) { + return request('/user-z/z1', { + method: 'GET', + ...(options || {}), + }); +} + +/** z1/zz1 GET /user-z/z1/zz1 */ +export async function userZz1Zz1UsingGet({ + options, +}: { + options?: { [key: string]: unknown }; +}) { + return request('/user-z/z1/zz1', { + method: 'GET', + ...(options || {}), + }); +} diff --git a/test/__snapshots__/both/should both excludeTags and excludePaths works with includeTags.snap b/test/__snapshots__/both/should both excludeTags and excludePaths works with includeTags.snap new file mode 100644 index 0000000..d148157 --- /dev/null +++ b/test/__snapshots__/both/should both excludeTags and excludePaths works with includeTags.snap @@ -0,0 +1,25 @@ +/* eslint-disable */ +// @ts-ignore +export * from './types'; + +export * from './userZ'; +/* eslint-disable */ +// @ts-ignore +export {}; +/* eslint-disable */ +// @ts-ignore +import request from '../request'; + +import * as API from './types'; + +/** f1 ffff GET /user-z/z1 */ +export async function userZz1UsingGet({ + options, +}: { + options?: { [key: string]: unknown }; +}) { + return request('/user-z/z1', { + method: 'GET', + ...(options || {}), + }); +} diff --git a/test/__snapshots__/both/should empty excludeTags and excludePaths return none.snap b/test/__snapshots__/both/should empty excludeTags and excludePaths return none.snap new file mode 100644 index 0000000..1924b51 --- /dev/null +++ b/test/__snapshots__/both/should empty excludeTags and excludePaths return none.snap @@ -0,0 +1,6 @@ +/* eslint-disable */ +// @ts-ignore +export * from './types'; +/* eslint-disable */ +// @ts-ignore +export {}; diff --git a/test/__snapshots__/both/should exclude items from includePaths and includeTags.snap b/test/__snapshots__/both/should exclude items from includePaths and includeTags.snap new file mode 100644 index 0000000..11a1dc9 --- /dev/null +++ b/test/__snapshots__/both/should exclude items from includePaths and includeTags.snap @@ -0,0 +1,25 @@ +/* eslint-disable */ +// @ts-ignore +export * from './types'; + +export * from './sysA'; +/* eslint-disable */ +// @ts-ignore +import request from '../request'; + +import * as API from './types'; + +/** a1 GET /sys-a/a1 */ +export async function sysAa1UsingGet({ + options, +}: { + options?: { [key: string]: unknown }; +}) { + return request('/sys-a/a1', { + method: 'GET', + ...(options || {}), + }); +} +/* eslint-disable */ +// @ts-ignore +export {}; diff --git a/test/__snapshots__/both/should return all while includeTags match all.snap b/test/__snapshots__/both/should return all while includeTags match all.snap new file mode 100644 index 0000000..c42915f --- /dev/null +++ b/test/__snapshots__/both/should return all while includeTags match all.snap @@ -0,0 +1,355 @@ +/* eslint-disable */ +// @ts-ignore +export * from './types'; + +export * from './userZ'; +export * from './userY'; +export * from './userX'; +export * from './sysC'; +export * from './sysB'; +export * from './sysA'; +/* eslint-disable */ +// @ts-ignore +import request from '../request'; + +import * as API from './types'; + +/** a1 GET /sys-a/a1 */ +export async function sysAa1UsingGet({ + options, +}: { + options?: { [key: string]: unknown }; +}) { + return request('/sys-a/a1', { + method: 'GET', + ...(options || {}), + }); +} + +/** a1/aa1 GET /sys-a/a1/aa1 */ +export async function sysAa1Aa1UsingGet({ + options, +}: { + options?: { [key: string]: unknown }; +}) { + return request('/sys-a/a1/aa1', { + method: 'GET', + ...(options || {}), + }); +} + +/** a1/a1/aa1 GET /sys-a/a1/aa1/aaa1 */ +export async function sysAa1Aa1Aaa1UsingGet({ + options, +}: { + options?: { [key: string]: unknown }; +}) { + return request('/sys-a/a1/aa1/aaa1', { + method: 'GET', + ...(options || {}), + }); +} + +/** a1/a1/aa1/aaa1 GET /sys-a/a1/aa1/aaa1/aaaa1 */ +export async function sysAa1Aa1Aaa1Aaaa1UsingGet({ + options, +}: { + options?: { [key: string]: unknown }; +}) { + return request('/sys-a/a1/aa1/aaa1/aaaa1', { + method: 'GET', + ...(options || {}), + }); +} +/* eslint-disable */ +// @ts-ignore +import request from '../request'; + +import * as API from './types'; + +/** b1 GET /sys-b/b1 */ +export async function sysBb1UsingGet({ + options, +}: { + options?: { [key: string]: unknown }; +}) { + return request('/sys-b/b1', { + method: 'GET', + ...(options || {}), + }); +} + +/** b1/bb1 GET /sys-b/b1/bb1 */ +export async function sysBb1Bb1UsingGet({ + options, +}: { + options?: { [key: string]: unknown }; +}) { + return request('/sys-b/b1/bb1', { + method: 'GET', + ...(options || {}), + }); +} + +/** b1/bb1/bbb1 GET /sys-b/b1/bb1/bbb1 */ +export async function sysBb1Bb1Bbb1UsingGet({ + options, +}: { + options?: { [key: string]: unknown }; +}) { + return request('/sys-b/b1/bb1/bbb1', { + method: 'GET', + ...(options || {}), + }); +} + +/** b1/bb1/bbb1/bbbb1 GET /sys-b/b1/bb1/bbb1/bbbb1 */ +export async function sysBb1Bb1Bbb1Bbbb1UsingGet({ + options, +}: { + options?: { [key: string]: unknown }; +}) { + return request('/sys-b/b1/bb1/bbb1/bbbb1', { + method: 'GET', + ...(options || {}), + }); +} +/* eslint-disable */ +// @ts-ignore +import request from '../request'; + +import * as API from './types'; + +/** c1 GET /sys-c/c1 */ +export async function sysCc1UsingGet({ + options, +}: { + options?: { [key: string]: unknown }; +}) { + return request('/sys-c/c1', { + method: 'GET', + ...(options || {}), + }); +} + +/** c1/cc1 GET /sys-c/c1/cc1 */ +export async function sysCc1Cc1UsingGet({ + options, +}: { + options?: { [key: string]: unknown }; +}) { + return request('/sys-c/c1/cc1', { + method: 'GET', + ...(options || {}), + }); +} + +/** c1/cc1/ccc1 GET /sys-c/c1/cc1/ccc1 */ +export async function sysCc1Cc1Ccc1UsingGet({ + options, +}: { + options?: { [key: string]: unknown }; +}) { + return request('/sys-c/c1/cc1/ccc1', { + method: 'GET', + ...(options || {}), + }); +} + +/** c1/cc1/ccc1/cccc1 GET /sys-c/c1/cc1/ccc1/cccc1 */ +export async function sysCc1Cc1Ccc1Cccc1UsingGet({ + options, +}: { + options?: { [key: string]: unknown }; +}) { + return request('/sys-c/c1/cc1/ccc1/cccc1', { + method: 'GET', + ...(options || {}), + }); +} +/* eslint-disable */ +// @ts-ignore +export {}; +/* eslint-disable */ +// @ts-ignore +import request from '../request'; + +import * as API from './types'; + +/** x1 GET /user-x/x1 */ +export async function userXx1UsingGet({ + options, +}: { + options?: { [key: string]: unknown }; +}) { + return request('/user-x/x1', { + method: 'GET', + ...(options || {}), + }); +} + +/** x1/xx1 GET /user-x/x1/xx1 */ +export async function userXx1Xx1UsingGet({ + options, +}: { + options?: { [key: string]: unknown }; +}) { + return request('/user-x/x1/xx1', { + method: 'GET', + ...(options || {}), + }); +} + +/** x1/xx1/xxx1 GET /user-x/x1/xx1/xxx1 */ +export async function userXx1Xx1Xxx1UsingGet({ + options, +}: { + options?: { [key: string]: unknown }; +}) { + return request('/user-x/x1/xx1/xxx1', { + method: 'GET', + ...(options || {}), + }); +} + +/** x1/xx1/xxx1/xxxx1 GET /user-x/x1/xx1/xxx1/xxxx1 */ +export async function userXx1Xx1Xxx1Xxxx1UsingGet({ + options, +}: { + options?: { [key: string]: unknown }; +}) { + return request('/user-x/x1/xx1/xxx1/xxxx1', { + method: 'GET', + ...(options || {}), + }); +} +/* eslint-disable */ +// @ts-ignore +import request from '../request'; + +import * as API from './types'; + +/** y1 GET /user-y/y1 */ +export async function userYy1UsingGet({ + options, +}: { + options?: { [key: string]: unknown }; +}) { + return request('/user-y/y1', { + method: 'GET', + ...(options || {}), + }); +} + +/** y1/yy1 GET /user-y/y1/yy1 */ +export async function userYy1Yy1UsingGet({ + options, +}: { + options?: { [key: string]: unknown }; +}) { + return request('/user-y/y1/yy1', { + method: 'GET', + ...(options || {}), + }); +} + +/** y1/yy1/yyy1 GET /user-y/y1/yy1/yyy1 */ +export async function userYy1Yy1Yyy1UsingGet({ + options, +}: { + options?: { [key: string]: unknown }; +}) { + return request('/user-y/y1/yy1/yyy1', { + method: 'GET', + ...(options || {}), + }); +} + +/** y1/yy1/yyy1/yyyy1 GET /user-y/y1/yy1/yyy1/yyyy1 */ +export async function userYy1Yy1Yyy1Yyyy1UsingGet({ + options, +}: { + options?: { [key: string]: unknown }; +}) { + return request('/user-y/y1/yy1/yyy1/yyyy1', { + method: 'GET', + ...(options || {}), + }); +} + +/** y1/yy1/yyy1/yyyy1/yyyyy1 GET /user-y/y1/yy1/yyy1/yyyy1/yyyyy1 */ +export async function userYy1Yy1Yyy1Yyyy1Yyyyy1UsingGet({ + options, +}: { + options?: { [key: string]: unknown }; +}) { + return request('/user-y/y1/yy1/yyy1/yyyy1/yyyyy1', { + method: 'GET', + ...(options || {}), + }); +} +/* eslint-disable */ +// @ts-ignore +import request from '../request'; + +import * as API from './types'; + +/** f1 ffff GET /user-z/z1 */ +export async function userZz1UsingGet({ + options, +}: { + options?: { [key: string]: unknown }; +}) { + return request('/user-z/z1', { + method: 'GET', + ...(options || {}), + }); +} + +/** z1/zz1 GET /user-z/z1/zz1 */ +export async function userZz1Zz1UsingGet({ + options, +}: { + options?: { [key: string]: unknown }; +}) { + return request('/user-z/z1/zz1', { + method: 'GET', + ...(options || {}), + }); +} + +/** z1/zz1/zzz1 GET /user-z/z1/zz1/zzz1 */ +export async function userZz1Zz1Zzz1UsingGet({ + options, +}: { + options?: { [key: string]: unknown }; +}) { + return request('/user-z/z1/zz1/zzz1', { + method: 'GET', + ...(options || {}), + }); +} + +/** z1/zz1/zzz1/zzzz1 GET /user-z/z1/zz1/zzz1/zzzz1 */ +export async function userZz1Zz1Zzz1Zzzz1UsingGet({ + options, +}: { + options?: { [key: string]: unknown }; +}) { + return request('/user-z/z1/zz1/zzz1/zzzz1', { + method: 'GET', + ...(options || {}), + }); +} + +/** z1/zz1/zzz1/zzzz1/zzzzz1 GET /user-z/z1/zz1/zzz1/zzzz1/zzzzz1 */ +export async function userZz1Zz1Zzz1Zzzz1Zzzzz1UsingGet({ + options, +}: { + options?: { [key: string]: unknown }; +}) { + return request('/user-z/z1/zz1/zzz1/zzzz1/zzzzz1', { + method: 'GET', + ...(options || {}), + }); +} diff --git "a/test/__snapshots__/common/\345\260\217\351\251\274\345\263\260\345\221\275\345\220\215\346\226\207\344\273\266\345\222\214\350\257\267\346\261\202\345\207\275\346\225\260.snap" "b/test/__snapshots__/common/\345\260\217\351\251\274\345\263\260\345\221\275\345\220\215\346\226\207\344\273\266\345\222\214\350\257\267\346\261\202\345\207\275\346\225\260.snap" new file mode 100644 index 0000000..6d50459 --- /dev/null +++ "b/test/__snapshots__/common/\345\260\217\351\251\274\345\263\260\345\221\275\345\220\215\346\226\207\344\273\266\345\222\214\350\257\267\346\261\202\345\207\275\346\225\260.snap" @@ -0,0 +1,522 @@ +/* eslint-disable */ +// @ts-ignore +import * as API from './types'; + +export function displayStatusEnum(field: API.StatusEnum) { + return { placed: 'placed', approved: 'approved', delivered: 'delivered' }[ + field + ]; +} + +export function displayStatusEnum2(field: API.StatusEnum2) { + return { available: 'available', pending: 'pending', sold: 'sold' }[field]; +} +/* eslint-disable */ +// @ts-ignore +export * from './types'; +export * from './displayEnumLabel'; + +export * from './pet'; +export * from './store'; +export * from './user'; +/* eslint-disable */ +// @ts-ignore +import { request } from 'axios'; + +import * as API from './types'; + +/** Update an existing pet Update an existing pet by Id PUT /pet */ +export async function petUsingPut({ + body, + options, +}: { + body: API.Pet; + options?: { [key: string]: unknown }; +}) { + return request('/pet', { + method: 'PUT', + headers: { + 'Content-Type': 'application/json', + }, + data: body, + ...(options || {}), + }); +} + +/** Add a new pet to the store Add a new pet to the store POST /pet */ +export async function petUsingPost({ + body, + options, +}: { + body: API.Pet; + options?: { [key: string]: unknown }; +}) { + return request('/pet', { + method: 'POST', + headers: { + 'Content-Type': 'application/json', + }, + data: body, + ...(options || {}), + }); +} + +/** Find pet by ID Returns a single pet GET /pet/${param0} */ +export async function petPetIdUsingGet({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.petPetIdUsingGetParams; + options?: { [key: string]: unknown }; +}) { + const { petId: param0, ...queryParams } = params; + + return request(`/pet/${param0}`, { + method: 'GET', + params: { ...queryParams }, + ...(options || {}), + }); +} + +/** Updates a pet in the store with form data POST /pet/${param0} */ +export async function petPetIdUsingPost({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.petPetIdUsingPostParams; + options?: { [key: string]: unknown }; +}) { + const { petId: param0, ...queryParams } = params; + + return request(`/pet/${param0}`, { + method: 'POST', + params: { + ...queryParams, + }, + ...(options || {}), + }); +} + +/** Deletes a pet DELETE /pet/${param0} */ +export async function petPetIdUsingDelete({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.petPetIdUsingDeleteParams; + options?: { [key: string]: unknown }; +}) { + const { petId: param0, ...queryParams } = params; + + return request(`/pet/${param0}`, { + method: 'DELETE', + params: { ...queryParams }, + ...(options || {}), + }); +} + +/** uploads an image POST /pet/${param0}/uploadImage */ +export async function petPetIdUploadImageUsingPost({ + params, + body, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.petPetIdUploadImageUsingPostParams; + body: API.PetPetIdUploadImageUsingPostBody; + options?: { [key: string]: unknown }; +}) { + const { petId: param0, ...queryParams } = params; + + return request(`/pet/${param0}/uploadImage`, { + method: 'POST', + headers: { + 'Content-Type': 'application/octet-stream', + }, + params: { + ...queryParams, + }, + data: body, + ...(options || {}), + }); +} + +/** Finds Pets by status Multiple status values can be provided with comma separated strings GET /pet/findByStatus */ +export async function petFindByStatusUsingGet({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.petFindByStatusUsingGetParams; + options?: { [key: string]: unknown }; +}) { + return request('/pet/findByStatus', { + method: 'GET', + params: { + // status has a default value: available + status: 'available', + ...params, + }, + ...(options || {}), + }); +} + +/** Finds Pets by tags Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. GET /pet/findByTags */ +export async function petFindByTagsUsingGet({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.petFindByTagsUsingGetParams; + options?: { [key: string]: unknown }; +}) { + return request('/pet/findByTags', { + method: 'GET', + params: { + ...params, + }, + ...(options || {}), + }); +} +/* eslint-disable */ +// @ts-ignore +import { request } from 'axios'; + +import * as API from './types'; + +/** Returns pet inventories by status Returns a map of status codes to quantities GET /store/inventory */ +export async function storeInventoryUsingGet({ + options, +}: { + options?: { [key: string]: unknown }; +}) { + return request>('/store/inventory', { + method: 'GET', + ...(options || {}), + }); +} + +/** Place an order for a pet Place a new order in the store POST /store/order */ +export async function storeOrderUsingPost({ + body, + options, +}: { + body: API.Order; + options?: { [key: string]: unknown }; +}) { + return request('/store/order', { + method: 'POST', + headers: { + 'Content-Type': 'application/json', + }, + data: body, + ...(options || {}), + }); +} + +/** Find purchase order by ID For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions. GET /store/order/${param0} */ +export async function storeOrderOrderIdUsingGet({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.storeOrderOrderIdUsingGetParams; + options?: { [key: string]: unknown }; +}) { + const { orderId: param0, ...queryParams } = params; + + return request(`/store/order/${param0}`, { + method: 'GET', + params: { ...queryParams }, + ...(options || {}), + }); +} + +/** Delete purchase order by ID For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors DELETE /store/order/${param0} */ +export async function storeOrderOrderIdUsingDelete({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.storeOrderOrderIdUsingDeleteParams; + options?: { [key: string]: unknown }; +}) { + const { orderId: param0, ...queryParams } = params; + + return request(`/store/order/${param0}`, { + method: 'DELETE', + params: { ...queryParams }, + ...(options || {}), + }); +} +/* eslint-disable */ +// @ts-ignore + +export type ApiResponse = { + code?: number; + type?: string; + message?: string; +}; + +export type Category = { + id?: number; + name?: string; +}; + +export type Order = { + id?: number; + petId?: number; + quantity?: number; + shipDate?: string; + /** Order Status */ + status?: 'placed' | 'approved' | 'delivered'; + complete?: boolean; +}; + +export type Pet = { + id?: number; + name: string; + category?: Category; + photoUrls: string[]; + tags?: Tag[]; + /** pet status in the store */ + status?: 'available' | 'pending' | 'sold'; +}; + +export type petFindByStatusUsingGetParams = { + /** Status values that need to be considered for filter */ + status?: 'available' | 'pending' | 'sold'; +}; + +export type petFindByTagsUsingGetParams = { + /** Tags to filter by */ + tags?: string[]; +}; + +export type PetPetIdUploadImageUsingPostBody = string; + +export type petPetIdUploadImageUsingPostParams = { + /** ID of pet to update */ + petId: number; + /** Additional Metadata */ + additionalMetadata?: string; +}; + +export type petPetIdUsingDeleteParams = { + /** Pet id to delete */ + petId: number; +}; + +export type petPetIdUsingGetParams = { + /** ID of pet to return */ + petId: number; +}; + +export type petPetIdUsingPostParams = { + /** ID of pet that needs to be updated */ + petId: number; + /** Name of pet that needs to be updated */ + name?: string; + /** Status of pet that needs to be updated */ + status?: string; +}; + +export enum StatusEnum { + 'placed' = 'placed', + 'approved' = 'approved', + 'delivered' = 'delivered', +} + +export type IStatusEnum = keyof typeof StatusEnum; + +export enum StatusEnum2 { + 'available' = 'available', + 'pending' = 'pending', + 'sold' = 'sold', +} + +export type IStatusEnum2 = keyof typeof StatusEnum2; + +export type storeOrderOrderIdUsingDeleteParams = { + /** ID of the order that needs to be deleted */ + orderId: number; +}; + +export type storeOrderOrderIdUsingGetParams = { + /** ID of order that needs to be fetched */ + orderId: number; +}; + +export type Tag = { + id?: number; + name?: string; +}; + +export type User = { + id?: number; + username?: string; + firstName?: string; + lastName?: string; + email?: string; + password?: string; + phone?: string; + /** User Status */ + userStatus?: number; +}; + +export type UserCreateWithListUsingPostBody = API.User[]; + +export type userLoginUsingGetParams = { + /** The user name for login */ + username?: string; + /** The password for login in clear text */ + password?: string; +}; + +export type userUsernameUsingDeleteParams = { + /** The name that needs to be deleted */ + username: string; +}; + +export type userUsernameUsingGetParams = { + /** The name that needs to be fetched. Use user1 for testing. */ + username: string; +}; + +export type userUsernameUsingPutParams = { + /** name that needs to be updated */ + username: string; +}; +/* eslint-disable */ +// @ts-ignore +import { request } from 'axios'; + +import * as API from './types'; + +/** Create user This can only be done by the logged in user. 返回值: successful operation POST /user */ +export async function userUsingPost({ + body, + options, +}: { + body: API.User; + options?: { [key: string]: unknown }; +}) { + return request('/user', { + method: 'POST', + headers: { + 'Content-Type': 'application/json', + }, + data: body, + ...(options || {}), + }); +} + +/** Get user by user name GET /user/${param0} */ +export async function userUsernameUsingGet({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.userUsernameUsingGetParams; + options?: { [key: string]: unknown }; +}) { + const { username: param0, ...queryParams } = params; + + return request(`/user/${param0}`, { + method: 'GET', + params: { ...queryParams }, + ...(options || {}), + }); +} + +/** Update user This can only be done by the logged in user. 返回值: successful operation PUT /user/${param0} */ +export async function userUsernameUsingPut({ + params, + body, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.userUsernameUsingPutParams; + body: API.User; + options?: { [key: string]: unknown }; +}) { + const { username: param0, ...queryParams } = params; + + return request(`/user/${param0}`, { + method: 'PUT', + headers: { + 'Content-Type': 'application/json', + }, + params: { ...queryParams }, + data: body, + ...(options || {}), + }); +} + +/** Delete user This can only be done by the logged in user. DELETE /user/${param0} */ +export async function userUsernameUsingDelete({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.userUsernameUsingDeleteParams; + options?: { [key: string]: unknown }; +}) { + const { username: param0, ...queryParams } = params; + + return request(`/user/${param0}`, { + method: 'DELETE', + params: { ...queryParams }, + ...(options || {}), + }); +} + +/** Creates list of users with given input array Creates list of users with given input array 返回值: successful operation POST /user/createWithList */ +export async function userCreateWithListUsingPost({ + body, + options, +}: { + body: API.UserCreateWithListUsingPostBody; + options?: { [key: string]: unknown }; +}) { + return request('/user/createWithList', { + method: 'POST', + headers: { + 'Content-Type': 'application/json', + }, + data: body, + ...(options || {}), + }); +} + +/** Logs user into the system GET /user/login */ +export async function userLoginUsingGet({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.userLoginUsingGetParams; + options?: { [key: string]: unknown }; +}) { + return request('/user/login', { + method: 'GET', + params: { + ...params, + }, + ...(options || {}), + }); +} + +/** Logs out current logged in user session 返回值: successful operation GET /user/logout */ +export async function userLogoutUsingGet({ + options, +}: { + options?: { [key: string]: unknown }; +}) { + return request('/user/logout', { + method: 'GET', + ...(options || {}), + }); +} diff --git "a/test/__snapshots__/common/\346\224\257\346\214\201 null \347\261\273\345\236\213\344\275\234\344\270\272\351\273\230\350\256\244\345\200\274.snap" "b/test/__snapshots__/common/\346\224\257\346\214\201 null \347\261\273\345\236\213\344\275\234\344\270\272\351\273\230\350\256\244\345\200\274.snap" new file mode 100644 index 0000000..28ae1f9 --- /dev/null +++ "b/test/__snapshots__/common/\346\224\257\346\214\201 null \347\261\273\345\236\213\344\275\234\344\270\272\351\273\230\350\256\244\345\200\274.snap" @@ -0,0 +1,522 @@ +/* eslint-disable */ +// @ts-ignore +import * as API from './types'; + +export function displayStatusEnum(field: API.StatusEnum) { + return { placed: 'placed', approved: 'approved', delivered: 'delivered' }[ + field + ]; +} + +export function displayStatusEnum2(field: API.StatusEnum2) { + return { available: 'available', pending: 'pending', sold: 'sold' }[field]; +} +/* eslint-disable */ +// @ts-ignore +export * from './types'; +export * from './displayEnumLabel'; + +export * from './pet'; +export * from './store'; +export * from './user'; +/* eslint-disable */ +// @ts-ignore +import { request } from 'axios'; + +import * as API from './types'; + +/** Update an existing pet Update an existing pet by Id PUT /pet */ +export async function petUsingPut({ + body, + options, +}: { + body: API.Pet; + options?: { [key: string]: unknown }; +}) { + return request('/pet', { + method: 'PUT', + headers: { + 'Content-Type': 'application/json', + }, + data: body, + ...(options || {}), + }); +} + +/** Add a new pet to the store Add a new pet to the store POST /pet */ +export async function petUsingPost({ + body, + options, +}: { + body: API.Pet; + options?: { [key: string]: unknown }; +}) { + return request('/pet', { + method: 'POST', + headers: { + 'Content-Type': 'application/json', + }, + data: body, + ...(options || {}), + }); +} + +/** Find pet by ID Returns a single pet GET /pet/${param0} */ +export async function petPetIdUsingGet({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.petPetIdUsingGetParams; + options?: { [key: string]: unknown }; +}) { + const { petId: param0, ...queryParams } = params; + + return request(`/pet/${param0}`, { + method: 'GET', + params: { ...queryParams }, + ...(options || {}), + }); +} + +/** Updates a pet in the store with form data POST /pet/${param0} */ +export async function petPetIdUsingPost({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.petPetIdUsingPostParams; + options?: { [key: string]: unknown }; +}) { + const { petId: param0, ...queryParams } = params; + + return request(`/pet/${param0}`, { + method: 'POST', + params: { + ...queryParams, + }, + ...(options || {}), + }); +} + +/** Deletes a pet DELETE /pet/${param0} */ +export async function petPetIdUsingDelete({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.petPetIdUsingDeleteParams; + options?: { [key: string]: unknown }; +}) { + const { petId: param0, ...queryParams } = params; + + return request(`/pet/${param0}`, { + method: 'DELETE', + params: { ...queryParams }, + ...(options || {}), + }); +} + +/** uploads an image POST /pet/${param0}/uploadImage */ +export async function petPetIdUploadImageUsingPost({ + params, + body, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.petPetIdUploadImageUsingPostParams; + body: API.PetPetIdUploadImageUsingPostBody; + options?: { [key: string]: unknown }; +}) { + const { petId: param0, ...queryParams } = params; + + return request(`/pet/${param0}/uploadImage`, { + method: 'POST', + headers: { + 'Content-Type': 'application/octet-stream', + }, + params: { + ...queryParams, + }, + data: body, + ...(options || {}), + }); +} + +/** Finds Pets by status Multiple status values can be provided with comma separated strings GET /pet/findByStatus */ +export async function petFindByStatusUsingGet({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.petFindByStatusUsingGetParams; + options?: { [key: string]: unknown }; +}) { + return request('/pet/findByStatus', { + method: 'GET', + params: { + // status has a default value: available + status: 'available', + ...params, + }, + ...(options || {}), + }); +} + +/** Finds Pets by tags Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. GET /pet/findByTags */ +export async function petFindByTagsUsingGet({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.petFindByTagsUsingGetParams; + options?: { [key: string]: unknown }; +}) { + return request('/pet/findByTags', { + method: 'GET', + params: { + ...params, + }, + ...(options || {}), + }); +} +/* eslint-disable */ +// @ts-ignore +import { request } from 'axios'; + +import * as API from './types'; + +/** Returns pet inventories by status Returns a map of status codes to quantities GET /store/inventory */ +export async function storeInventoryUsingGet({ + options, +}: { + options?: { [key: string]: unknown }; +}) { + return request>('/store/inventory', { + method: 'GET', + ...(options || {}), + }); +} + +/** Place an order for a pet Place a new order in the store POST /store/order */ +export async function storeOrderUsingPost({ + body, + options, +}: { + body: API.Order; + options?: { [key: string]: unknown }; +}) { + return request('/store/order', { + method: 'POST', + headers: { + 'Content-Type': 'application/json', + }, + data: body, + ...(options || {}), + }); +} + +/** Find purchase order by ID For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions. GET /store/order/${param0} */ +export async function storeOrderOrderIdUsingGet({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.storeOrderOrderIdUsingGetParams; + options?: { [key: string]: unknown }; +}) { + const { orderId: param0, ...queryParams } = params; + + return request(`/store/order/${param0}`, { + method: 'GET', + params: { ...queryParams }, + ...(options || {}), + }); +} + +/** Delete purchase order by ID For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors DELETE /store/order/${param0} */ +export async function storeOrderOrderIdUsingDelete({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.storeOrderOrderIdUsingDeleteParams; + options?: { [key: string]: unknown }; +}) { + const { orderId: param0, ...queryParams } = params; + + return request(`/store/order/${param0}`, { + method: 'DELETE', + params: { ...queryParams }, + ...(options || {}), + }); +} +/* eslint-disable */ +// @ts-ignore + +export type ApiResponse = { + code: number | null; + type: string | null; + message: string | null; +}; + +export type Category = { + id: number | null; + name: string | null; +}; + +export type Order = { + id: number | null; + petId: number | null; + quantity: number | null; + shipDate: string | null; + /** Order Status */ + status: 'placed' | 'approved' | 'delivered' | null; + complete: boolean | null; +}; + +export type Pet = { + id: number | null; + name: string; + category: Category | null; + photoUrls: string[]; + tags: Tag[] | null; + /** pet status in the store */ + status: 'available' | 'pending' | 'sold' | null; +}; + +export type petFindByStatusUsingGetParams = { + /** Status values that need to be considered for filter */ + status: 'available' | 'pending' | 'sold' | null; +}; + +export type petFindByTagsUsingGetParams = { + /** Tags to filter by */ + tags: string[] | null; +}; + +export type PetPetIdUploadImageUsingPostBody = string; + +export type petPetIdUploadImageUsingPostParams = { + /** ID of pet to update */ + petId: number; + /** Additional Metadata */ + additionalMetadata: string | null; +}; + +export type petPetIdUsingDeleteParams = { + /** Pet id to delete */ + petId: number; +}; + +export type petPetIdUsingGetParams = { + /** ID of pet to return */ + petId: number; +}; + +export type petPetIdUsingPostParams = { + /** ID of pet that needs to be updated */ + petId: number; + /** Name of pet that needs to be updated */ + name: string | null; + /** Status of pet that needs to be updated */ + status: string | null; +}; + +export enum StatusEnum { + 'placed' = 'placed', + 'approved' = 'approved', + 'delivered' = 'delivered', +} + +export type IStatusEnum = keyof typeof StatusEnum; + +export enum StatusEnum2 { + 'available' = 'available', + 'pending' = 'pending', + 'sold' = 'sold', +} + +export type IStatusEnum2 = keyof typeof StatusEnum2; + +export type storeOrderOrderIdUsingDeleteParams = { + /** ID of the order that needs to be deleted */ + orderId: number; +}; + +export type storeOrderOrderIdUsingGetParams = { + /** ID of order that needs to be fetched */ + orderId: number; +}; + +export type Tag = { + id: number | null; + name: string | null; +}; + +export type User = { + id: number | null; + username: string | null; + firstName: string | null; + lastName: string | null; + email: string | null; + password: string | null; + phone: string | null; + /** User Status */ + userStatus: number | null; +}; + +export type UserCreateWithListUsingPostBody = API.User[]; + +export type userLoginUsingGetParams = { + /** The user name for login */ + username: string | null; + /** The password for login in clear text */ + password: string | null; +}; + +export type userUsernameUsingDeleteParams = { + /** The name that needs to be deleted */ + username: string; +}; + +export type userUsernameUsingGetParams = { + /** The name that needs to be fetched. Use user1 for testing. */ + username: string; +}; + +export type userUsernameUsingPutParams = { + /** name that needs to be updated */ + username: string; +}; +/* eslint-disable */ +// @ts-ignore +import { request } from 'axios'; + +import * as API from './types'; + +/** Create user This can only be done by the logged in user. 返回值: successful operation POST /user */ +export async function userUsingPost({ + body, + options, +}: { + body: API.User; + options?: { [key: string]: unknown }; +}) { + return request('/user', { + method: 'POST', + headers: { + 'Content-Type': 'application/json', + }, + data: body, + ...(options || {}), + }); +} + +/** Get user by user name GET /user/${param0} */ +export async function userUsernameUsingGet({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.userUsernameUsingGetParams; + options?: { [key: string]: unknown }; +}) { + const { username: param0, ...queryParams } = params; + + return request(`/user/${param0}`, { + method: 'GET', + params: { ...queryParams }, + ...(options || {}), + }); +} + +/** Update user This can only be done by the logged in user. 返回值: successful operation PUT /user/${param0} */ +export async function userUsernameUsingPut({ + params, + body, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.userUsernameUsingPutParams; + body: API.User; + options?: { [key: string]: unknown }; +}) { + const { username: param0, ...queryParams } = params; + + return request(`/user/${param0}`, { + method: 'PUT', + headers: { + 'Content-Type': 'application/json', + }, + params: { ...queryParams }, + data: body, + ...(options || {}), + }); +} + +/** Delete user This can only be done by the logged in user. DELETE /user/${param0} */ +export async function userUsernameUsingDelete({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.userUsernameUsingDeleteParams; + options?: { [key: string]: unknown }; +}) { + const { username: param0, ...queryParams } = params; + + return request(`/user/${param0}`, { + method: 'DELETE', + params: { ...queryParams }, + ...(options || {}), + }); +} + +/** Creates list of users with given input array Creates list of users with given input array 返回值: successful operation POST /user/createWithList */ +export async function userCreateWithListUsingPost({ + body, + options, +}: { + body: API.UserCreateWithListUsingPostBody; + options?: { [key: string]: unknown }; +}) { + return request('/user/createWithList', { + method: 'POST', + headers: { + 'Content-Type': 'application/json', + }, + data: body, + ...(options || {}), + }); +} + +/** Logs user into the system GET /user/login */ +export async function userLoginUsingGet({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.userLoginUsingGetParams; + options?: { [key: string]: unknown }; +}) { + return request('/user/login', { + method: 'GET', + params: { + ...params, + }, + ...(options || {}), + }); +} + +/** Logs out current logged in user session 返回值: successful operation GET /user/logout */ +export async function userLogoutUsingGet({ + options, +}: { + options?: { [key: string]: unknown }; +}) { + return request('/user/logout', { + method: 'GET', + ...(options || {}), + }); +} diff --git "a/test/__snapshots__/common/\346\226\207\344\273\266\344\270\212\344\274\240.snap" "b/test/__snapshots__/common/\346\226\207\344\273\266\344\270\212\344\274\240.snap" new file mode 100644 index 0000000..bd4f5d1 --- /dev/null +++ "b/test/__snapshots__/common/\346\226\207\344\273\266\344\270\212\344\274\240.snap" @@ -0,0 +1,95 @@ +/* eslint-disable */ +// @ts-ignore +import { queryOptions, useMutation } from '@tanstack/react-query'; +import type { DefaultError } from '@tanstack/react-query'; +import { request } from 'axios'; + +import * as apis from './fileController'; +import * as API from './types'; + +/** 导入文件 导入文件 POST /webapi/clear/importNavReCheckFile */ +export function useWebapiClearImportNavReCheckFileUsingPostMutation(options?: { + onSuccess?: (value?: API.ResponseString_) => void; + onError?: (error?: DefaultError) => void; +}) { + const { onSuccess, onError } = options || {}; + + const response = useMutation({ + mutationFn: apis.webapiClearImportNavReCheckFileUsingPost, + onSuccess(data: API.ResponseString_) { + onSuccess?.(data); + }, + onError(error) { + onError?.(error); + }, + }); + + return response; +} +/* eslint-disable */ +// @ts-ignore +import { request } from 'axios'; + +import * as API from './types'; + +/** 导入文件 导入文件 POST /webapi/clear/importNavReCheckFile */ +export async function webapiClearImportNavReCheckFileUsingPost({ + body, + file, + options, +}: { + body: API.WebapiClearImportNavReCheckFileUsingPostBody; + file?: File; + options?: { [key: string]: unknown }; +}) { + const formData = new FormData(); + + if (file) { + formData.append('file', file); + } + + Object.keys(body).forEach((ele) => { + const item = (body as { [key: string]: any })[ele]; + + if (item !== undefined && item !== null) { + if (typeof item === 'object' && !(item instanceof File)) { + if (item instanceof Array) { + item.forEach((f) => formData.append(ele, f || '')); + } else { + formData.append(ele, JSON.stringify(item)); + } + } else { + formData.append(ele, item); + } + } + }); + + return request('/webapi/clear/importNavReCheckFile', { + method: 'POST', + headers: { + 'Content-Type': 'multipart/form-data', + }, + data: formData, + ...(options || {}), + }); +} +/* eslint-disable */ +// @ts-ignore +export * from './types'; + +export * from './fileController'; +export * from './fileController.reactquery'; +/* eslint-disable */ +// @ts-ignore + +export type ResponseString_ = { + msg?: string; + result?: string; + resultCode?: string; + success?: boolean; +}; + +export type WebapiClearImportNavReCheckFileUsingPostBody = { + /** file */ + file: string; +}; diff --git "a/test/__snapshots__/common/\346\255\243\345\270\270\345\221\275\345\220\215\346\226\207\344\273\266\345\222\214\350\257\267\346\261\202\345\207\275\346\225\260.snap" "b/test/__snapshots__/common/\346\255\243\345\270\270\345\221\275\345\220\215\346\226\207\344\273\266\345\222\214\350\257\267\346\261\202\345\207\275\346\225\260.snap" new file mode 100644 index 0000000..a906e18 --- /dev/null +++ "b/test/__snapshots__/common/\346\255\243\345\270\270\345\221\275\345\220\215\346\226\207\344\273\266\345\222\214\350\257\267\346\261\202\345\207\275\346\225\260.snap" @@ -0,0 +1,522 @@ +/* eslint-disable */ +// @ts-ignore +import { request } from 'axios'; + +import * as API from './types'; + +/** Update an existing pet Update an existing pet by Id PUT /pet */ +export async function petUsingPut({ + body, + options, +}: { + body: API.Pet; + options?: { [key: string]: unknown }; +}) { + return request('/pet', { + method: 'PUT', + headers: { + 'Content-Type': 'application/json', + }, + data: body, + ...(options || {}), + }); +} + +/** Add a new pet to the store Add a new pet to the store POST /pet */ +export async function petUsingPost({ + body, + options, +}: { + body: API.Pet; + options?: { [key: string]: unknown }; +}) { + return request('/pet', { + method: 'POST', + headers: { + 'Content-Type': 'application/json', + }, + data: body, + ...(options || {}), + }); +} + +/** Find pet by ID Returns a single pet GET /pet/${param0} */ +export async function petPetIdUsingGet({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.petPetIdUsingGetParams; + options?: { [key: string]: unknown }; +}) { + const { petId: param0, ...queryParams } = params; + + return request(`/pet/${param0}`, { + method: 'GET', + params: { ...queryParams }, + ...(options || {}), + }); +} + +/** Updates a pet in the store with form data POST /pet/${param0} */ +export async function petPetIdUsingPost({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.petPetIdUsingPostParams; + options?: { [key: string]: unknown }; +}) { + const { petId: param0, ...queryParams } = params; + + return request(`/pet/${param0}`, { + method: 'POST', + params: { + ...queryParams, + }, + ...(options || {}), + }); +} + +/** Deletes a pet DELETE /pet/${param0} */ +export async function petPetIdUsingDelete({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.petPetIdUsingDeleteParams; + options?: { [key: string]: unknown }; +}) { + const { petId: param0, ...queryParams } = params; + + return request(`/pet/${param0}`, { + method: 'DELETE', + params: { ...queryParams }, + ...(options || {}), + }); +} + +/** uploads an image POST /pet/${param0}/uploadImage */ +export async function petPetIdUploadImageUsingPost({ + params, + body, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.petPetIdUploadImageUsingPostParams; + body: API.PetPetIdUploadImageUsingPostBody; + options?: { [key: string]: unknown }; +}) { + const { petId: param0, ...queryParams } = params; + + return request(`/pet/${param0}/uploadImage`, { + method: 'POST', + headers: { + 'Content-Type': 'application/octet-stream', + }, + params: { + ...queryParams, + }, + data: body, + ...(options || {}), + }); +} + +/** Finds Pets by status Multiple status values can be provided with comma separated strings GET /pet/findByStatus */ +export async function petFindByStatusUsingGet({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.petFindByStatusUsingGetParams; + options?: { [key: string]: unknown }; +}) { + return request('/pet/findByStatus', { + method: 'GET', + params: { + // status has a default value: available + status: 'available', + ...params, + }, + ...(options || {}), + }); +} + +/** Finds Pets by tags Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. GET /pet/findByTags */ +export async function petFindByTagsUsingGet({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.petFindByTagsUsingGetParams; + options?: { [key: string]: unknown }; +}) { + return request('/pet/findByTags', { + method: 'GET', + params: { + ...params, + }, + ...(options || {}), + }); +} +/* eslint-disable */ +// @ts-ignore +import { request } from 'axios'; + +import * as API from './types'; + +/** Returns pet inventories by status Returns a map of status codes to quantities GET /store/inventory */ +export async function storeInventoryUsingGet({ + options, +}: { + options?: { [key: string]: unknown }; +}) { + return request>('/store/inventory', { + method: 'GET', + ...(options || {}), + }); +} + +/** Place an order for a pet Place a new order in the store POST /store/order */ +export async function storeOrderUsingPost({ + body, + options, +}: { + body: API.Order; + options?: { [key: string]: unknown }; +}) { + return request('/store/order', { + method: 'POST', + headers: { + 'Content-Type': 'application/json', + }, + data: body, + ...(options || {}), + }); +} + +/** Find purchase order by ID For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions. GET /store/order/${param0} */ +export async function storeOrderOrderIdUsingGet({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.storeOrderOrderIdUsingGetParams; + options?: { [key: string]: unknown }; +}) { + const { orderId: param0, ...queryParams } = params; + + return request(`/store/order/${param0}`, { + method: 'GET', + params: { ...queryParams }, + ...(options || {}), + }); +} + +/** Delete purchase order by ID For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors DELETE /store/order/${param0} */ +export async function storeOrderOrderIdUsingDelete({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.storeOrderOrderIdUsingDeleteParams; + options?: { [key: string]: unknown }; +}) { + const { orderId: param0, ...queryParams } = params; + + return request(`/store/order/${param0}`, { + method: 'DELETE', + params: { ...queryParams }, + ...(options || {}), + }); +} +/* eslint-disable */ +// @ts-ignore +import { request } from 'axios'; + +import * as API from './types'; + +/** Create user This can only be done by the logged in user. 返回值: successful operation POST /user */ +export async function userUsingPost({ + body, + options, +}: { + body: API.User; + options?: { [key: string]: unknown }; +}) { + return request('/user', { + method: 'POST', + headers: { + 'Content-Type': 'application/json', + }, + data: body, + ...(options || {}), + }); +} + +/** Get user by user name GET /user/${param0} */ +export async function userUsernameUsingGet({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.userUsernameUsingGetParams; + options?: { [key: string]: unknown }; +}) { + const { username: param0, ...queryParams } = params; + + return request(`/user/${param0}`, { + method: 'GET', + params: { ...queryParams }, + ...(options || {}), + }); +} + +/** Update user This can only be done by the logged in user. 返回值: successful operation PUT /user/${param0} */ +export async function userUsernameUsingPut({ + params, + body, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.userUsernameUsingPutParams; + body: API.User; + options?: { [key: string]: unknown }; +}) { + const { username: param0, ...queryParams } = params; + + return request(`/user/${param0}`, { + method: 'PUT', + headers: { + 'Content-Type': 'application/json', + }, + params: { ...queryParams }, + data: body, + ...(options || {}), + }); +} + +/** Delete user This can only be done by the logged in user. DELETE /user/${param0} */ +export async function userUsernameUsingDelete({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.userUsernameUsingDeleteParams; + options?: { [key: string]: unknown }; +}) { + const { username: param0, ...queryParams } = params; + + return request(`/user/${param0}`, { + method: 'DELETE', + params: { ...queryParams }, + ...(options || {}), + }); +} + +/** Creates list of users with given input array Creates list of users with given input array 返回值: successful operation POST /user/createWithList */ +export async function userCreateWithListUsingPost({ + body, + options, +}: { + body: API.UserCreateWithListUsingPostBody; + options?: { [key: string]: unknown }; +}) { + return request('/user/createWithList', { + method: 'POST', + headers: { + 'Content-Type': 'application/json', + }, + data: body, + ...(options || {}), + }); +} + +/** Logs user into the system GET /user/login */ +export async function userLoginUsingGet({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.userLoginUsingGetParams; + options?: { [key: string]: unknown }; +}) { + return request('/user/login', { + method: 'GET', + params: { + ...params, + }, + ...(options || {}), + }); +} + +/** Logs out current logged in user session 返回值: successful operation GET /user/logout */ +export async function userLogoutUsingGet({ + options, +}: { + options?: { [key: string]: unknown }; +}) { + return request('/user/logout', { + method: 'GET', + ...(options || {}), + }); +} +/* eslint-disable */ +// @ts-ignore +import * as API from './types'; + +export function displayStatusEnum(field: API.StatusEnum) { + return { placed: 'placed', approved: 'approved', delivered: 'delivered' }[ + field + ]; +} + +export function displayStatusEnum2(field: API.StatusEnum2) { + return { available: 'available', pending: 'pending', sold: 'sold' }[field]; +} +/* eslint-disable */ +// @ts-ignore +export * from './types'; +export * from './displayEnumLabel'; + +export * from './Pet'; +export * from './Store'; +export * from './User'; +/* eslint-disable */ +// @ts-ignore + +export type ApiResponse = { + code?: number; + type?: string; + message?: string; +}; + +export type Category = { + id?: number; + name?: string; +}; + +export type Order = { + id?: number; + petId?: number; + quantity?: number; + shipDate?: string; + /** Order Status */ + status?: 'placed' | 'approved' | 'delivered'; + complete?: boolean; +}; + +export type Pet = { + id?: number; + name: string; + category?: Category; + photoUrls: string[]; + tags?: Tag[]; + /** pet status in the store */ + status?: 'available' | 'pending' | 'sold'; +}; + +export type petFindByStatusUsingGetParams = { + /** Status values that need to be considered for filter */ + status?: 'available' | 'pending' | 'sold'; +}; + +export type petFindByTagsUsingGetParams = { + /** Tags to filter by */ + tags?: string[]; +}; + +export type PetPetIdUploadImageUsingPostBody = string; + +export type petPetIdUploadImageUsingPostParams = { + /** ID of pet to update */ + petId: number; + /** Additional Metadata */ + additionalMetadata?: string; +}; + +export type petPetIdUsingDeleteParams = { + /** Pet id to delete */ + petId: number; +}; + +export type petPetIdUsingGetParams = { + /** ID of pet to return */ + petId: number; +}; + +export type petPetIdUsingPostParams = { + /** ID of pet that needs to be updated */ + petId: number; + /** Name of pet that needs to be updated */ + name?: string; + /** Status of pet that needs to be updated */ + status?: string; +}; + +export enum StatusEnum { + 'placed' = 'placed', + 'approved' = 'approved', + 'delivered' = 'delivered', +} + +export type IStatusEnum = keyof typeof StatusEnum; + +export enum StatusEnum2 { + 'available' = 'available', + 'pending' = 'pending', + 'sold' = 'sold', +} + +export type IStatusEnum2 = keyof typeof StatusEnum2; + +export type storeOrderOrderIdUsingDeleteParams = { + /** ID of the order that needs to be deleted */ + orderId: number; +}; + +export type storeOrderOrderIdUsingGetParams = { + /** ID of order that needs to be fetched */ + orderId: number; +}; + +export type Tag = { + id?: number; + name?: string; +}; + +export type User = { + id?: number; + username?: string; + firstName?: string; + lastName?: string; + email?: string; + password?: string; + phone?: string; + /** User Status */ + userStatus?: number; +}; + +export type UserCreateWithListUsingPostBody = API.User[]; + +export type userLoginUsingGetParams = { + /** The user name for login */ + username?: string; + /** The password for login in clear text */ + password?: string; +}; + +export type userUsernameUsingDeleteParams = { + /** The name that needs to be deleted */ + username: string; +}; + +export type userUsernameUsingGetParams = { + /** The name that needs to be fetched. Use user1 for testing. */ + username: string; +}; + +export type userUsernameUsingPutParams = { + /** name that needs to be updated */ + username: string; +}; diff --git "a/test/__snapshots__/common/\346\265\213\350\257\225 $ref \345\274\225\347\224\250\344\270\255\345\214\205\345\220\253 encode \347\274\226\347\240\201\345\255\227\347\254\246.snap" "b/test/__snapshots__/common/\346\265\213\350\257\225 $ref \345\274\225\347\224\250\344\270\255\345\214\205\345\220\253 encode \347\274\226\347\240\201\345\255\227\347\254\246.snap" new file mode 100644 index 0000000..434c2ea --- /dev/null +++ "b/test/__snapshots__/common/\346\265\213\350\257\225 $ref \345\274\225\347\224\250\344\270\255\345\214\205\345\220\253 encode \347\274\226\347\240\201\345\255\227\347\254\246.snap" @@ -0,0 +1,822 @@ +/* eslint-disable */ +// @ts-ignore +export * from './types'; + +export * from './shangpinjichuguanli'; +/* eslint-disable */ +// @ts-ignore +import { request } from 'axios'; + +import * as API from './types'; + +/** 添加商品 POST /mall/goods/addGoods https://apifox.com/web/project/5327758/apis/api-229419585-run */ +export async function goodsAddGoodsUsingPost({ + body, + options, +}: { + body: API.AddGoodsReq1; + options?: { [key: string]: unknown }; +}) { + return request('/mall/goods/addGoods', { + method: 'POST', + headers: { + 'Content-Type': 'application/json', + }, + data: body, + ...(options || {}), + }); +} + +/** 批量删除商品 POST /mall/goods/batchDeleteGoods https://apifox.com/web/project/5327758/apis/api-229419591-run */ +export async function goodsBatchDeleteGoodsUsingPost({ + body, + options, +}: { + body: API.BatchDeleteGoodsReq; + options?: { [key: string]: unknown }; +}) { + return request('/mall/goods/batchDeleteGoods', { + method: 'POST', + headers: { + 'Content-Type': 'application/json', + }, + data: body, + ...(options || {}), + }); +} + +/** 批量启禁用商品 POST /mall/goods/batchUpdateStatus https://apifox.com/web/project/5327758/apis/api-229419593-run */ +export async function goodsBatchUpdateStatusUsingPost({ + body, + options, +}: { + body: API.BatchUpdateStatusReq; + options?: { [key: string]: unknown }; +}) { + return request('/mall/goods/batchUpdateStatus', { + method: 'POST', + headers: { + 'Content-Type': 'application/json', + }, + data: body, + ...(options || {}), + }); +} + +/** 删除商品 GET /mall/goods/deleteGoods https://apifox.com/web/project/5327758/apis/api-229419590-run */ +export async function goodsDeleteGoodsUsingGet({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.goodsDeleteGoodsUsingGetParams; + options?: { [key: string]: unknown }; +}) { + return request('/mall/goods/deleteGoods', { + method: 'GET', + params: { + ...params, + }, + ...(options || {}), + }); +} + +/** 查询商品详情 POST /mall/goods/getGoodsDetail https://apifox.com/web/project/5327758/apis/api-229419594-run */ +export async function goodsGetGoodsDetailUsingPost({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.goodsGetGoodsDetailUsingPostParams; + options?: { [key: string]: unknown }; +}) { + return request( + '/mall/goods/getGoodsDetail', + { + method: 'POST', + params: { + ...params, + }, + ...(options || {}), + } + ); +} + +/** 查询商品数量 GET /mall/goods/getGoodsNum https://apifox.com/web/project/5327758/apis/api-229419589-run */ +export async function goodsGetGoodsNumUsingGet({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.goodsGetGoodsNumUsingGetParams; + options?: { [key: string]: unknown }; +}) { + return request('/mall/goods/getGoodsNum', { + method: 'GET', + params: { + ...params, + }, + ...(options || {}), + }); +} + +/** 查询医院药房商品列表 POST /mall/goods/hospitalGoodsPage https://apifox.com/web/project/5327758/apis/api-229419588-run */ +export async function goodsHospitalGoodsPageUsingPost({ + body, + options, +}: { + body: API.QueryGoodsReq; + options?: { [key: string]: unknown }; +}) { + return request( + '/mall/goods/hospitalGoodsPage', + { + method: 'POST', + headers: { + 'Content-Type': 'application/json', + }, + data: body, + ...(options || {}), + } + ); +} + +/** 查询我的药房商品列表 POST /mall/goods/pharmacyGoodsPage https://apifox.com/web/project/5327758/apis/api-229419587-run */ +export async function goodsPharmacyGoodsPageUsingPost({ + body, + options, +}: { + body: API.QueryGoodsReq; + options?: { [key: string]: unknown }; +}) { + return request( + '/mall/goods/pharmacyGoodsPage', + { + method: 'POST', + headers: { + 'Content-Type': 'application/json', + }, + data: body, + ...(options || {}), + } + ); +} + +/** 编辑商品 POST /mall/goods/updateGoods https://apifox.com/web/project/5327758/apis/api-229419586-run */ +export async function goodsUpdateGoodsUsingPost({ + body, + options, +}: { + body: API.UpdateGoodsReq; + options?: { [key: string]: unknown }; +}) { + return request('/mall/goods/updateGoods', { + method: 'POST', + headers: { + 'Content-Type': 'application/json', + }, + data: body, + ...(options || {}), + }); +} + +/** 启禁用商品 POST /mall/goods/updateGoodsStatus https://apifox.com/web/project/5327758/apis/api-229419592-run */ +export async function goodsUpdateGoodsStatusUsingPost({ + body, + options, +}: { + body: API.DisableGoodsReq; + options?: { [key: string]: unknown }; +}) { + return request('/mall/goods/updateGoodsStatus', { + method: 'POST', + headers: { + 'Content-Type': 'application/json', + }, + data: body, + ...(options || {}), + }); +} +/* eslint-disable */ +// @ts-ignore + +export type AddGoodsReq1 = { + /** 机构id */ + orgId: string; + /** 机构编码 */ + orgCode: string; + /** 商品类型((western_medicine:西药 / western_chinese:中药 / food:中药 / health_product:保健品 / medical_equipment:医疗器械 / inspection:检验检查)' */ + goodsType: string; + /** 商品名 */ + goodsName?: string; + /** 通用名 */ + commonName: string; + /** 通用名拼音 */ + commonNamePy?: string; + /** 商品主图 */ + goodsMainImg: string; + /** 厂商名称 */ + drugManufacturerName?: string; + /** 药品类型:(western_medicine:西药 / chinese_patent_medicine:中成药) */ + medicineType?: string; + /** 药剂型 */ + formType?: string; + /** 药品规格 */ + spec?: string; + /** 包装材料 */ + packagingMaterials?: string; + /** 最小包装单位 */ + minPackageUnit?: string; + /** 最小包装数量 */ + minPackageValue?: number; + /** 最小制剂单位 */ + minPreparationUnit?: string; + /** 所属科室 */ + belongSection?: string; + /** 适应症 */ + indication?: string; + /** 禁忌症 */ + contraindication?: string; + /** 不良反应 */ + adverseReaction?: string; + /** 是否处方药(1:处方药 / 0:非处方药) */ + prescriptionDrug?: number; + /** 批准文号 */ + approveNo?: string; + /** 上市许可持有人(企业) */ + enterpriseName?: string; + /** 中药剂型(chinese_herbal_pieces:中药饮片 / chinese_medicinal_granule:中药颗粒 / homemade_medicine:自制药品) */ + chineseFormType?: string; + /** 生产地区 */ + productArea?: string; + /** 贮藏方法 */ + storageMethod?: string; + /** 当量 */ + equivalent?: number; + /** 配料表 */ + ingredientList?: string; + /** 营养成分 */ + nutrients?: string; + /** 营养成分表(图片) */ + nutrientsImg?: string; + /** 食品生产许可证编号 */ + productLicenseNumber?: string; + /** 保健品保健功能描述 */ + healthFunc?: string; + /** 保健品功效成分 */ + funcComponents?: string; + /** 保健食品批准证号 */ + healthApprovalNumber?: string; + /** 医疗器械注册证号 */ + registNumber?: string; + /** 服务项目名称 */ + serviceItemName?: string; + /** 医疗项目编码 */ + medicalItemCode?: string; + /** 服务医疗机构名称 */ + serviceMedicalName?: string; + /** 服务区域范围 */ + serviceAreaScope?: string; + /** 服务医疗机构-省 */ + serviceMedicalProvince?: string; + /** 服务医疗机构-市 */ + serviceMedicalCity?: string; + /** 服务医疗机构-区 */ + serviceMedicalDistrict?: string; + /** 服务医疗机构-详细地址 */ + serviceMedicalAddress?: string; + /** 服务适用人群 */ + applicablePopulation?: string; + /** 服务检查前准备 */ + preparationInspection?: string; + /** 检查注意事项 */ + inspectionPrecautions?: string; + /** 服务报告有效期 */ + reportExpiration?: string; + /** 服务报告出具时间 */ + reportIssueTime?: string; + /** 是否集采(0:否 / 1:是) */ + purchased?: number; + /** 是否基药(0:否 / 1:是) */ + basicDrug?: number; + /** 医保类型(Non_medical:目录外(自费) / Category_A:甲类 / Category_B:乙类) */ + nhsaType?: string; + /** 国家医保药品编码 */ + nhsaCode?: string; + /** 省医保药品编码 */ + provinceMedicalCode?: string; + /** 市医保药品编码 */ + cityMedicalCode?: string; + /** 药品本位码 */ + standardCode?: string; + /** 条码 */ + barCode?: string; + /** 我的药房库存 */ + myStock: number; + /** 锁库数量 */ + lockCount?: number; + /** 库存计量单位 */ + stockUnit: string; + /** 我的零售价 */ + salePrice: number; + /** 生产批号(销售信息) */ + productBatchNumber?: string; + /** 商品重量 */ + goodsWeight?: number; + /** 生产日期 */ + productionDate?: string; + /** 有效期 */ + expirationDate?: string; +}; + +export type BatchDeleteGoodsReq = { + /** 商品id集合 */ + goodsIds: string[]; + /** 机构id */ + orgId: string; +}; + +export type BatchUpdateStatusReq = { + /** 商品id */ + goodsIds: string[]; + /** 机构id */ + orgId: string; + /** 是否可用 */ + status: number; +}; + +export type DisableGoodsReq = { + /** 商品id */ + goodsId: string; + /** 机构id */ + orgId: string; + /** 是否可用 */ + status: number; +}; + +export type goodsDeleteGoodsUsingGetParams = { + goodsId: string; + orgId: string; +}; + +export type GoodsDetailRes = { + id?: string; + /** 机构id */ + orgId?: string; + /** 机构编码 */ + orgCode?: string; + /** 商品类型((western_medicine:西药 / western_chinese:中药 / food:中药 / health_product:保健品 / medical_equipment:医疗器械 / inspection:检验检查)' */ + goodsType?: string; + /** 商品名 */ + goodsName?: string; + /** 通用名 */ + commonName?: string; + /** 通用名拼音 */ + commonNamePy?: string; + /** 商品主图 */ + goodsMainImg?: string; + /** 厂商名称 */ + drugManufacturerName?: string; + /** 药品类型:(western_medicine:西药 / chinese_patent_medicine:中成药) */ + medicineType?: string; + /** 药剂型 */ + formType?: string; + /** 药品规格 */ + spec?: string; + /** 包装材料 */ + packagingMaterials?: string; + /** 最小包装单位 */ + minPackageUnit?: string; + /** 最小包装数量 */ + minPackageValue?: number; + /** 最小制剂单位 */ + minPreparationUnit?: string; + /** 所属科室 */ + belongSection?: string; + /** 适应症 */ + indication?: string; + /** 禁忌症 */ + contraindication?: string; + /** 不良反应 */ + adverseReaction?: string; + /** 是否处方药(1:处方药 / 0:非处方药) */ + prescriptionDrug?: number; + /** 批准文号 */ + approveNo?: string; + /** 上市许可持有人(企业) */ + enterpriseName?: string; + /** 中药剂型(chinese_herbal_pieces:中药饮片 / chinese_medicinal_granule:中药颗粒 / homemade_medicine:自制药品) */ + chineseFormType?: string; + /** 生产地区 */ + productArea?: string; + /** 贮藏方法 */ + storageMethod?: string; + /** 当量 */ + equivalent?: number; + /** 配料表 */ + ingredientList?: string; + /** 营养成分 */ + nutrients?: string; + /** 营养成分表(图片) */ + nutrientsImg?: string; + /** 食品生产许可证编号 */ + productLicenseNumber?: string; + /** 保健品保健功能描述 */ + healthFunc?: string; + /** 保健品功效成分 */ + funcComponents?: string; + /** 保健食品批准证号 */ + healthApprovalNumber?: string; + /** 医疗器械注册证号 */ + registNumber?: string; + /** 服务项目名称 */ + serviceItemName?: string; + /** 医疗项目编码 */ + medicalItemCode?: string; + /** 服务医疗机构名称 */ + serviceMedicalName?: string; + /** 服务区域范围 */ + serviceAreaScope?: string; + /** 服务医疗机构-省 */ + serviceMedicalProvince?: string; + /** 服务医疗机构-市 */ + serviceMedicalCity?: string; + /** 服务医疗机构-区 */ + serviceMedicalDistrict?: string; + /** 服务医疗机构-详细地址 */ + serviceMedicalAddress?: string; + /** 服务适用人群 */ + applicablePopulation?: string; + /** 服务检查前准备 */ + preparationInspection?: string; + /** 检查注意事项 */ + inspectionPrecautions?: string; + /** 服务报告有效期 */ + reportExpiration?: string; + /** 服务报告出具时间 */ + reportIssueTime?: string; + /** 是否集采(0:否 / 1:是) */ + purchased?: number; + /** 是否基药(0:否 / 1:是) */ + basicDrug?: number; + /** 医保类型(Non_medical:目录外(自费) / Category_A:甲类 / Category_B:乙类) */ + nhsaType?: string; + /** 国家医保药品编码 */ + nhsaCode?: string; + /** 省医保药品编码 */ + provinceMedicalCode?: string; + /** 市医保药品编码 */ + cityMedicalCode?: string; + /** 药品本位码 */ + standardCode?: string; + /** 条码 */ + barCode?: string; + /** 我的药房库存 */ + myStock?: number; + /** 锁库数量 */ + lockCount?: number; + /** 库存计量单位 */ + stockUnit?: string; + /** 我的零售价 */ + salePrice?: number; + /** 生产批号(销售信息) */ + productBatchNumber?: string; + /** 商品重量 */ + goodsWeight?: number; + /** 生产日期 */ + productionDate?: string; + /** 有效期 */ + expirationDate?: string; +}; + +export type goodsGetGoodsDetailUsingPostParams = { + goodsId: string; + orgId: string; +}; + +export type goodsGetGoodsNumUsingGetParams = { + orgId: string; +}; + +export type GoodsNumDTO = { + /** 审核通过数量 */ + numberOfAuditPass?: number; + /** 审核拒绝数量 */ + numberOfAuditRefuse?: number; + /** 等待审核数量 */ + numberOfAuditWait?: number; +}; + +export type GoodsPageQueryDTO = { + /** 商品id */ + id?: string; + /** 机构id */ + orgId?: string; + /** 机构编码 */ + orgCode?: string; + /** 商品名 */ + goodsName?: string; + /** 商品类型(western_medicine:西药/中成药 / chinese_medicine:中药 / food:食品 / health_product:保健品 / medical_equipment:医疗器械 / inspection:检验检查)' */ + goodsType?: string; + /** 商品展示名:[商品名]商品通用名+规格+最小包装数量+最小剂型单位+最小包装单位 */ + goodsNameDisplay?: string; + /** 通用名 */ + commonName?: string; + /** 通用名拼音 */ + commonNamePy?: string; + /** 商品主图 */ + goodsMainImg?: string; + /** 厂商名称 */ + drugManufacturerName?: string; + /** 是否集采(0:否 / 1:是) */ + purchased?: number; + /** 是否基药(0:否 / 1:是) */ + basicDrug?: number; + /** 医保类型(Non_medical:目录外(自费) / Category_A:甲类 / Category_B:乙类) */ + nhsaType?: string; + /** 国家医保药品编码 */ + nhsaCode?: string; + /** 省医保药品编码 */ + provinceMedicalCode?: string; + /** 市医保药品编码 */ + cityMedicalCode?: string; + /** 药品本位码 */ + standardCode?: string; + /** 条码 */ + barCode?: string; + /** 我的药房库存 */ + myStock?: number; + /** 锁库数量 */ + lockCount?: number; + /** 库存单位 */ + stockUnit?: string; + /** 我的零售价 */ + salePrice?: number; + /** 生产批号(销售信息) */ + productBatchNumber?: string; + /** 规格 */ + spec?: string; + /** 商品重量 */ + goodsWeight?: number; + /** 生产日期 */ + productionDate?: string; + /** 有效期 */ + expirationDate?: string; + /** 添加方式(HIS:HIS同步/ SELF:自行添加 / ERP:ERP同步) */ + addWay?: string; + /** 状态(0:禁用 / 1:启用) */ + status?: number; + /** 是否处方药(1:是处方药 / 0:非处方药) */ + prescriptionDrug?: number; + /** 药品类型:(western_medicine:西药 / chinese_patent_medicine:中成药) */ + medicineType?: string; + /** 最小制剂单位 */ + minPreparationUnit?: string; + /** 最小包装单位 */ + minPackageUnit?: string; + /** 最小包装数量 */ + minPackageValue?: number; + /** 组合商品名称 */ + combinedGoodsName?: string; + /** 运费 */ + freight?: string; + /** 服务区域范围 */ + serviceAreaScope?: string; + /** 实际销量 */ + realSalesVolume?: number; + /** 供应商名称 */ + supplierName?: string; + /** 服务机构名称 */ + serviceMedicalName?: string; + /** 服务项目名称 */ + serviceItemName?: string; + /** 商品状态(我的药房:网院共享商品、自有商品;网院药房:云门诊-已共享) */ + goodsStatus?: string; + /** 是否共享低级别医院(0:否 / 1:是) */ + shareLowLevelStatus?: number; + /** 创建时间 */ + addTime?: string; + /** 审核状态:(wait:待审核 / pass:审核通过 / refuse:审核拒绝) */ + auditStatus?: string; + /** 自动检测结果(0:自动检测失败 / 1:自动检测成功) */ + autoDetectRes?: number; + /** 自动检测失败原因 */ + autoDetectFailReason?: string; +}; + +export type IPageGoodsPageQueryDTO = { + records?: GoodsPageQueryDTO[]; + total?: number; + size?: number; + current?: number; + orders?: OrderItem[]; + optimizeCountSql?: boolean; + isSearchCount?: boolean; + hitCount?: boolean; + countId?: string; + maxLimit?: number; + searchCount?: boolean; + /** 当前分页总页数 */ + pages?: number; + ascs?: string[]; + asc?: string[]; + descs?: string[]; + desc?: string[]; +}; + +export type OrderItem = { + column?: string; + asc?: boolean; +}; + +export type QueryGoodsReq = { + /** 当前页码 */ + pageIndex?: number; + /** 每页显示的记录数 */ + pageSize?: number; + /** 机构id */ + orgId: string; + /** 机构的顶级医院id */ + hospitalOrgId?: string; + /** 机构类型 */ + orgType?: string; + /** 供应商机构id */ + supplyOrgId?: string; + /** 我的零售价-最低价格 */ + salePriceLow?: number; + /** 我的零售价-最高价格 */ + salePriceHigh?: number; + /** 商品类型 */ + goodsType?: string; + /** 服务区域范围 */ + serviceAreaScope?: string; + /** 医保类型 */ + nhsaType?: number; + /** 适应症 */ + indication?: string[]; + /** 所属科室 */ + belongSection?: string; + /** 审核状态 */ + auditStatus?: string; + /** 商品名称关键字 */ + goodsKeyWord?: string; + /** 创建时间-左区间 */ + createTimeLeft?: string; + /** 创建时间-右区间 */ + createTimeRight?: string; +}; + +export type ResponseResultBoolean = { + code?: string; + msg?: string; + data?: boolean; +}; + +export type ResponseResultGoodsDetailRes = { + code?: string; + msg?: string; + data?: GoodsDetailRes; +}; + +export type ResponseResultGoodsNumDTO = { + code?: string; + msg?: string; + data?: GoodsNumDTO; +}; + +export type ResponseResultIPageGoodsPageQueryDTO = { + code?: string; + msg?: string; + data?: IPageGoodsPageQueryDTO; +}; + +export type UpdateGoodsReq = { + /** 机构id */ + orgId: string; + /** 机构编码 */ + orgCode: string; + /** 商品类型((western_medicine:西药 / western_chinese:中药 / food:食品 / health_product:保健品 / medical_equipment:医疗器械 / inspection:检验检查)' */ + goodsType: string; + /** 商品名 */ + goodsName?: string; + /** 通用名 */ + commonName: string; + /** 通用名拼音 */ + commonNamePy?: string; + /** 商品主图 */ + goodsMainImg: string; + /** 厂商名称 */ + drugManufacturerName?: string; + /** 药品类型:(western_medicine:西药 / chinese_patent_medicine:中成药) */ + medicineType?: string; + /** 药剂型 */ + formType?: string; + /** 药品规格 */ + spec?: string; + /** 包装材料 */ + packagingMaterials?: string; + /** 最小包装单位 */ + minPackageUnit?: string; + /** 最小包装数量 */ + minPackageValue?: number; + /** 最小制剂单位 */ + minPreparationUnit?: string; + /** 所属科室 */ + belongSection?: string; + /** 适应症 */ + indication?: string; + /** 禁忌症 */ + contraindication?: string; + /** 不良反应 */ + adverseReaction?: string; + /** 是否处方药(1:处方药 / 0:非处方药) */ + prescriptionDrug?: number; + /** 批准文号 */ + approveNo?: string; + /** 上市许可持有人(企业) */ + enterpriseName?: string; + /** 中药剂型(chinese_herbal_pieces:中药饮片 / chinese_medicinal_granule:中药颗粒 / homemade_medicine:自制药品) */ + chineseFormType?: string; + /** 生产地区 */ + productArea?: string; + /** 贮藏方法 */ + storageMethod?: string; + /** 当量 */ + equivalent?: number; + /** 配料表 */ + ingredientList?: string; + /** 营养成分 */ + nutrients?: string; + /** 营养成分表(图片) */ + nutrientsImg?: string; + /** 食品生产许可证编号 */ + productLicenseNumber?: string; + /** 保健品保健功能描述 */ + healthFunc?: string; + /** 保健品功效成分 */ + funcComponents?: string; + /** 保健食品批准证号 */ + healthApprovalNumber?: string; + /** 医疗器械注册证号 */ + registNumber?: string; + /** 服务项目名称 */ + serviceItemName?: string; + /** 医疗项目编码 */ + medicalItemCode?: string; + /** 服务医疗机构名称 */ + serviceMedicalName?: string; + /** 服务区域范围 */ + serviceAreaScope?: string; + /** 服务医疗机构-省 */ + serviceMedicalProvince?: string; + /** 服务医疗机构-市 */ + serviceMedicalCity?: string; + /** 服务医疗机构-区 */ + serviceMedicalDistrict?: string; + /** 服务医疗机构-详细地址 */ + serviceMedicalAddress?: string; + /** 服务适用人群 */ + applicablePopulation?: string; + /** 服务检查前准备 */ + preparationInspection?: string; + /** 检查注意事项 */ + inspectionPrecautions?: string; + /** 服务报告有效期 */ + reportExpiration?: string; + /** 服务报告出具时间 */ + reportIssueTime?: string; + /** 是否集采(0:否 / 1:是) */ + purchased?: number; + /** 是否基药(0:否 / 1:是) */ + basicDrug?: number; + /** 医保类型(Non_medical:目录外(自费) / Category_A:甲类 / Category_B:乙类) */ + nhsaType?: string; + /** 国家医保药品编码 */ + nhsaCode?: string; + /** 省医保药品编码 */ + provinceMedicalCode?: string; + /** 市医保药品编码 */ + cityMedicalCode?: string; + /** 药品本位码 */ + standardCode?: string; + /** 条码 */ + barCode?: string; + /** 我的药房库存 */ + myStock: number; + /** 锁库数量 */ + lockCount?: number; + /** 库存计量单位 */ + stockUnit: string; + /** 我的零售价 */ + salePrice: number; + /** 生产批号(销售信息) */ + productBatchNumber?: string; + /** 商品重量 */ + goodsWeight?: number; + /** 生产日期 */ + productionDate?: string; + /** 有效期 */ + expirationDate?: string; + /** 商品id */ + id: string; +}; diff --git "a/test/__snapshots__/common/\346\265\213\350\257\225 _COMPUTER SCIENCE_ \350\277\231\344\270\200\347\261\273\347\232\204\346\236\232\344\270\276\345\200\274\345\234\250\347\224\237\346\210\220\347\232\204\347\261\273\345\236\213\344\270\255\344\270\215\346\212\245\351\224\231.snap" "b/test/__snapshots__/common/\346\265\213\350\257\225 _COMPUTER SCIENCE_ \350\277\231\344\270\200\347\261\273\347\232\204\346\236\232\344\270\276\345\200\274\345\234\250\347\224\237\346\210\220\347\232\204\347\261\273\345\236\213\344\270\255\344\270\215\346\212\245\351\224\231.snap" new file mode 100644 index 0000000..8923ca0 --- /dev/null +++ "b/test/__snapshots__/common/\346\265\213\350\257\225 _COMPUTER SCIENCE_ \350\277\231\344\270\200\347\261\273\347\232\204\346\236\232\344\270\276\345\200\274\345\234\250\347\224\237\346\210\220\347\232\204\347\261\273\345\236\213\344\270\255\344\270\215\346\212\245\351\224\231.snap" @@ -0,0 +1,65 @@ +/* eslint-disable */ +// @ts-ignore +import * as API from './types'; + +export function displayGenderEnum(field: API.GenderEnum) { + return { MALE: 'MALE', FEMALE: 'FEMALE', OTHER: 'OTHER' }[field]; +} + +export function displayMajorEnum(field: API.Major) { + return { + 'COMPUTER SCIENCE': 'COMPUTER SCIENCE', + MATHEMATICS: 'MATHEMATICS', + PHYSICS: 'PHYSICS', + LITERATURE: 'LITERATURE', + }[field]; +} +/* eslint-disable */ +// @ts-ignore +export * from './types'; +export * from './displayEnumLabel'; + +export * from './student'; +/* eslint-disable */ +// @ts-ignore +import { request } from 'axios'; + +import * as API from './types'; + +/** Returns a student object GET /hello */ +export async function helloUsingGet({ + options, +}: { + options?: { [key: string]: unknown }; +}) { + return request('/hello', { + method: 'GET', + ...(options || {}), + }); +} +/* eslint-disable */ +// @ts-ignore + +export enum GenderEnum { + 'MALE' = 'MALE', + 'FEMALE' = 'FEMALE', + 'OTHER' = 'OTHER', +} + +export type IGenderEnum = keyof typeof GenderEnum; + +export enum Major { + 'COMPUTER SCIENCE' = 'COMPUTER SCIENCE', + 'MATHEMATICS' = 'MATHEMATICS', + 'PHYSICS' = 'PHYSICS', + 'LITERATURE' = 'LITERATURE', +} + +export type IMajor = keyof typeof Major; + +export type Student = { + name: string; + age: number; + gender: 'MALE' | 'FEMALE' | 'OTHER'; + major: Major; +}; diff --git "a/test/__snapshots__/common/\346\265\213\350\257\225 number\347\261\273\345\236\213 \346\236\232\344\270\276.snap" "b/test/__snapshots__/common/\346\265\213\350\257\225 number\347\261\273\345\236\213 \346\236\232\344\270\276.snap" new file mode 100644 index 0000000..a5a6a5a --- /dev/null +++ "b/test/__snapshots__/common/\346\265\213\350\257\225 number\347\261\273\345\236\213 \346\236\232\344\270\276.snap" @@ -0,0 +1,188 @@ +/* eslint-disable */ +// @ts-ignore +import { request } from 'axios'; + +import * as API from './types'; + +/** Getcity GET /city/${param0} */ +export async function cityCityUsingGet({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.cityCityUsingGetParams; + options?: { [key: string]: unknown }; +}) { + const { city: param0, ...queryParams } = params; + + return request(`/city/${param0}`, { + method: 'GET', + params: { + ...queryParams, + }, + ...(options || {}), + }); +} +/* eslint-disable */ +// @ts-ignore +import * as API from './types'; + +export function displayPoi2CategoryEnumEnum(field: API.Poi2CategoryEnum) { + return { + '-1': 'STRING_NUMBER_-1', + '-1000': 'STRING_NUMBER_-1000', + '010700': 'STRING_NUMBER_010700', + '010800': 'STRING_NUMBER_010800', + '010900': 'STRING_NUMBER_010900', + '010901': 'STRING_NUMBER_010901', + '011000': 'STRING_NUMBER_011000', + '011100': 'STRING_NUMBER_011100', + '011101': 'STRING_NUMBER_011101', + '011102': 'STRING_NUMBER_011102', + '011103': 'STRING_NUMBER_011103', + '130500': 'STRING_NUMBER_130500', + '130501': 'STRING_NUMBER_130501', + '130502': 'STRING_NUMBER_130502', + '130503': 'STRING_NUMBER_130503', + '150210': 'STRING_NUMBER_150210', + '150300': 'STRING_NUMBER_150300', + '150301': 'STRING_NUMBER_150301', + '150302': 'STRING_NUMBER_150302', + '150304': 'STRING_NUMBER_150304', + '150305': 'STRING_NUMBER_150305', + '150306': 'STRING_NUMBER_150306', + '151000': 'STRING_NUMBER_151000', + '151001': 'STRING_NUMBER_151001', + '151002': 'STRING_NUMBER_151002', + '151003': 'STRING_NUMBER_151003', + '180200': 'STRING_NUMBER_180200', + '180201': 'STRING_NUMBER_180201', + '180202': 'STRING_NUMBER_180202', + '180203': 'STRING_NUMBER_180203', + '180300': 'STRING_NUMBER_180300', + '180301': 'STRING_NUMBER_180301', + '180302': 'STRING_NUMBER_180302', + }[field]; +} +/* eslint-disable */ +// @ts-ignore +import { request } from 'axios'; + +import * as API from './types'; + +/** Hello World GET / */ +export async function usingGet({ + options, +}: { + options?: { [key: string]: unknown }; +}) { + return request('/', { + method: 'GET', + ...(options || {}), + }); +} +/* eslint-disable */ +// @ts-ignore +export * from './types'; +export * from './displayEnumLabel'; + +export * from './home'; +export * from './cityList'; +export * from './putCity'; +/* eslint-disable */ +// @ts-ignore +import { request } from 'axios'; + +import * as API from './types'; + +/** Putcity PUT /city/${param0} */ +export async function cityCityUsingPut({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.cityCityUsingPutParams; + options?: { [key: string]: unknown }; +}) { + const { city: param0, ...queryParams } = params; + + return request(`/city/${param0}`, { + method: 'PUT', + params: { ...queryParams }, + ...(options || {}), + }); +} +/* eslint-disable */ +// @ts-ignore + +export type cityCityUsingGetParams = { + city: string; + query_string?: string; +}; + +export type cityCityUsingPutParams = { + city: Poi2CategoryEnum; +}; + +export type CityGetRes = { + /** City */ + city: string; + /** Query String */ + query_string?: string; +}; + +export type CityPutRes = { + city: Poi2CategoryEnum; +}; + +export type HTTPValidationError = { + /** Detail */ + detail?: ValidationError[]; +}; + +export enum Poi2CategoryEnum { + 'STRING_NUMBER_-1' = '-1', + 'STRING_NUMBER_-1000' = '-1000', + 'STRING_NUMBER_010700' = '010700', + 'STRING_NUMBER_010800' = '010800', + 'STRING_NUMBER_010900' = '010900', + 'STRING_NUMBER_010901' = '010901', + 'STRING_NUMBER_011000' = '011000', + 'STRING_NUMBER_011100' = '011100', + 'STRING_NUMBER_011101' = '011101', + 'STRING_NUMBER_011102' = '011102', + 'STRING_NUMBER_011103' = '011103', + 'STRING_NUMBER_130500' = '130500', + 'STRING_NUMBER_130501' = '130501', + 'STRING_NUMBER_130502' = '130502', + 'STRING_NUMBER_130503' = '130503', + 'STRING_NUMBER_150210' = '150210', + 'STRING_NUMBER_150300' = '150300', + 'STRING_NUMBER_150301' = '150301', + 'STRING_NUMBER_150302' = '150302', + 'STRING_NUMBER_150304' = '150304', + 'STRING_NUMBER_150305' = '150305', + 'STRING_NUMBER_150306' = '150306', + 'STRING_NUMBER_151000' = '151000', + 'STRING_NUMBER_151001' = '151001', + 'STRING_NUMBER_151002' = '151002', + 'STRING_NUMBER_151003' = '151003', + 'STRING_NUMBER_180200' = '180200', + 'STRING_NUMBER_180201' = '180201', + 'STRING_NUMBER_180202' = '180202', + 'STRING_NUMBER_180203' = '180203', + 'STRING_NUMBER_180300' = '180300', + 'STRING_NUMBER_180301' = '180301', + 'STRING_NUMBER_180302' = '180302', +} + +export type IPoi2CategoryEnum = keyof typeof Poi2CategoryEnum; + +export type ValidationError = { + /** Location */ + loc: (string | number)[]; + /** Message */ + msg: string; + /** Error Type */ + type: string; +}; diff --git "a/test/__snapshots__/common/\346\265\213\350\257\225 number\347\261\273\345\236\213 \346\236\232\344\270\276\357\274\214\344\275\277\347\224\250 desc \350\247\243\346\236\220\346\236\232\344\270\276.snap" "b/test/__snapshots__/common/\346\265\213\350\257\225 number\347\261\273\345\236\213 \346\236\232\344\270\276\357\274\214\344\275\277\347\224\250 desc \350\247\243\346\236\220\346\236\232\344\270\276.snap" new file mode 100644 index 0000000..66ba828 --- /dev/null +++ "b/test/__snapshots__/common/\346\265\213\350\257\225 number\347\261\273\345\236\213 \346\236\232\344\270\276\357\274\214\344\275\277\347\224\250 desc \350\247\243\346\236\220\346\236\232\344\270\276.snap" @@ -0,0 +1,73 @@ +/* eslint-disable */ +// @ts-ignore +import * as API from './types'; + +export function displaySysUserRoleEnum(field: API.SysUserRole) { + return { 0: 'User', 1: 'Agent', 2: 'Admin' }[field]; +} +/* eslint-disable */ +// @ts-ignore +export * from './types'; +export * from './displayEnumLabel'; + +export * from './user'; +/* eslint-disable */ +// @ts-ignore + +export type apiSysUserGetUserInfoUsingGetParams = { + userId?: number; +}; + +export type ResultOutputUserInfoOutput = { + /** 是否成功标记 */ + success?: boolean; + /** 编码 */ + code?: string; + /** 消息 */ + msg?: string; + data?: UserInfoOutput; +}; + +export enum SysUserRole { + User = 0, + Agent = 1, + Admin = 2, +} + +export type ISysUserRole = keyof typeof SysUserRole; + +export type UserInfoOutput = { + /** 昵称 */ + nickName?: string; + /** 头像 */ + avatar?: string; + /** 手机号 */ + phone?: string; + role?: SysUserRole; +}; +/* eslint-disable */ +// @ts-ignore +import { request } from 'axios'; + +import * as API from './types'; + +/** 获取用户信息 GET /api/sys/user/get-user-info */ +export async function apiSysUserGetUserInfoUsingGet({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.apiSysUserGetUserInfoUsingGetParams; + options?: { [key: string]: unknown }; +}) { + return request( + '/api/sys/user/get-user-info', + { + method: 'GET', + params: { + ...params, + }, + ...(options || {}), + } + ); +} diff --git "a/test/__snapshots__/common/\346\265\213\350\257\225 schemas \345\214\205\345\220\253\346\236\232\344\270\276\346\225\260\347\273\204.snap" "b/test/__snapshots__/common/\346\265\213\350\257\225 schemas \345\214\205\345\220\253\346\236\232\344\270\276\346\225\260\347\273\204.snap" new file mode 100644 index 0000000..4c26827 --- /dev/null +++ "b/test/__snapshots__/common/\346\265\213\350\257\225 schemas \345\214\205\345\220\253\346\236\232\344\270\276\346\225\260\347\273\204.snap" @@ -0,0 +1,41 @@ +/* eslint-disable */ +// @ts-ignore +export * from './types'; + +export * from './user'; +/* eslint-disable */ +// @ts-ignore + +export type StatusEnumArray = ('value1' | 'value2' | 'value3')[]; + +export type userUsernameUsingDeleteParams = { + /** The name that needs to be deleted */ + username: string; + /** The status that needs to be deleted */ + status: StatusEnumArray; +}; +/* eslint-disable */ +// @ts-ignore +import { request } from 'axios'; + +import * as API from './types'; + +/** Delete user This can only be done by the logged in user. DELETE /user/${param0} */ +export async function userUsernameUsingDelete({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.userUsernameUsingDeleteParams; + options?: { [key: string]: unknown }; +}) { + const { username: param0, ...queryParams } = params; + + return request(`/user/${param0}`, { + method: 'DELETE', + params: { + ...queryParams, + }, + ...(options || {}), + }); +} diff --git "a/test/__snapshots__/common/\346\265\213\350\257\225 swagger =_ openapi, schema \345\276\252\347\216\257\345\274\225\347\224\250.snap" "b/test/__snapshots__/common/\346\265\213\350\257\225 swagger =_ openapi, schema \345\276\252\347\216\257\345\274\225\347\224\250.snap" new file mode 100644 index 0000000..86fa185 --- /dev/null +++ "b/test/__snapshots__/common/\346\265\213\350\257\225 swagger =_ openapi, schema \345\276\252\347\216\257\345\274\225\347\224\250.snap" @@ -0,0 +1,2213 @@ +/* eslint-disable */ +// @ts-ignore +export * from './types'; + +export * from './psp'; +/* eslint-disable */ +// @ts-ignore +import { request } from 'axios'; + +import * as API from './types'; + +/** 成员分页列表 GET /admin/admins */ +export async function adminAdminsUsingGet({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.adminAdminsUsingGetParams; + options?: { [key: string]: unknown }; +}) { + return request< + API.Response & { + data?: API.AdminListRet; + } + >('/admin/admins', { + method: 'GET', + params: { + ...params, + }, + ...(options || {}), + }); +} + +/** 成员创建 POST /admin/admins */ +export async function adminAdminsUsingPost({ + body, + options, +}: { + body: API.AdminCreateArg; + options?: { [key: string]: unknown }; +}) { + return request< + API.Response & { + data?: API.AdminCreateRet; + } + >('/admin/admins', { + method: 'POST', + headers: { + 'Content-Type': 'application/json', + }, + data: body, + ...(options || {}), + }); +} + +/** 成员信息 GET /admin/admins/${param0} */ +export async function adminAdminsIdUsingGet({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.adminAdminsIdUsingGetParams; + options?: { [key: string]: unknown }; +}) { + const { id: param0, ...queryParams } = params; + + return request< + API.Response & { + data?: API.AdminInfo; + } + >(`/admin/admins/${param0}`, { + method: 'GET', + params: { ...queryParams }, + ...(options || {}), + }); +} + +/** 成员编辑 PUT /admin/admins/${param0} */ +export async function adminAdminsIdUsingPut({ + params, + body, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.adminAdminsIdUsingPutParams; + body: API.AdminUpdateArg; + options?: { [key: string]: unknown }; +}) { + const { id: param0, ...queryParams } = params; + + return request(`/admin/admins/${param0}`, { + method: 'PUT', + headers: { + 'Content-Type': 'application/json', + }, + params: { ...queryParams }, + data: body, + ...(options || {}), + }); +} + +/** 成员权限设置 PATCH /admin/admins/${param0}/permissions */ +export async function adminAdminsIdPermissionsUsingPatch({ + params, + body, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.adminAdminsIdPermissionsUsingPatchParams; + body: API.AdminSetPermissionsArg; + options?: { [key: string]: unknown }; +}) { + const { id: param0, ...queryParams } = params; + + return request(`/admin/admins/${param0}/permissions`, { + method: 'PATCH', + headers: { + 'Content-Type': 'application/json', + }, + params: { ...queryParams }, + data: body, + ...(options || {}), + }); +} + +/** 成员重置密码 PATCH /admin/admins/${param0}/reset */ +export async function adminAdminsIdResetUsingPatch({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.adminAdminsIdResetUsingPatchParams; + options?: { [key: string]: unknown }; +}) { + const { id: param0, ...queryParams } = params; + + return request< + API.Response & { + data?: API.AdminResetRet; + } + >(`/admin/admins/${param0}/reset`, { + method: 'PATCH', + params: { ...queryParams }, + ...(options || {}), + }); +} + +/** 启用/禁用成员 PATCH /admin/admins/${param0}/toggle */ +export async function adminAdminsIdToggleUsingPatch({ + params, + body, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.adminAdminsIdToggleUsingPatchParams; + body: API.AdminToggleArg; + options?: { [key: string]: unknown }; +}) { + const { id: param0, ...queryParams } = params; + + return request(`/admin/admins/${param0}/toggle`, { + method: 'PATCH', + headers: { + 'Content-Type': 'application/json', + }, + params: { ...queryParams }, + data: body, + ...(options || {}), + }); +} + +/** 成员全部数据 GET /admin/admins/all */ +export async function adminAdminsAllUsingGet({ + options, +}: { + options?: { [key: string]: unknown }; +}) { + return request< + API.Response & { + data?: API.Dict[]; + } + >('/admin/admins/all', { + method: 'GET', + ...(options || {}), + }); +} + +/** 测评分页列表 GET /admin/evaluations */ +export async function adminEvaluationsUsingGet({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.adminEvaluationsUsingGetParams; + options?: { [key: string]: unknown }; +}) { + return request< + API.Response & { + data?: API.EvaluationListRet; + } + >('/admin/evaluations', { + method: 'GET', + params: { + ...params, + }, + ...(options || {}), + }); +} + +/** 测评创建 POST /admin/evaluations */ +export async function adminEvaluationsUsingPost({ + body, + options, +}: { + body: API.EvaluationCreateArg; + options?: { [key: string]: unknown }; +}) { + return request< + API.Response & { + data?: API.EvaluationCreateRet; + } + >('/admin/evaluations', { + method: 'POST', + headers: { + 'Content-Type': 'application/json', + }, + data: body, + ...(options || {}), + }); +} + +/** 测评更新 PUT /admin/evaluations/${param0} */ +export async function adminEvaluationsIdUsingPut({ + params, + body, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.adminEvaluationsIdUsingPutParams; + body: API.EvaluationUpdateArg; + options?: { [key: string]: unknown }; +}) { + const { id: param0, ...queryParams } = params; + + return request(`/admin/evaluations/${param0}`, { + method: 'PUT', + headers: { + 'Content-Type': 'application/json', + }, + params: { ...queryParams }, + data: body, + ...(options || {}), + }); +} + +/** 团测分析 GET /admin/evaluations/${param0}/data */ +export async function adminEvaluationsIdDataUsingGet({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.adminEvaluationsIdDataUsingGetParams; + options?: { [key: string]: unknown }; +}) { + const { id: param0, ...queryParams } = params; + + return request< + API.Response & { + data?: API.EvaluationData; + } + >(`/admin/evaluations/${param0}/data`, { + method: 'GET', + params: { ...queryParams }, + ...(options || {}), + }); +} + +/** 测评全部数据 GET /admin/evaluations/all */ +export async function adminEvaluationsAllUsingGet({ + options, +}: { + options?: { [key: string]: unknown }; +}) { + return request< + API.Response & { + data?: API.Dict[]; + } + >('/admin/evaluations/all', { + method: 'GET', + ...(options || {}), + }); +} + +/** 测评报告分页列表 GET /admin/evaluations/reports */ +export async function adminEvaluationsReportsUsingGet({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.adminEvaluationsReportsUsingGetParams; + options?: { [key: string]: unknown }; +}) { + return request< + API.Response & { + data?: API.EvaluationReportListRet; + } + >('/admin/evaluations/reports', { + method: 'GET', + params: { + ...params, + }, + ...(options || {}), + }); +} + +/** 查看测评报告数据 GET /admin/evaluations/reports/${param0}/data */ +export async function adminEvaluationsReportsIdDataUsingGet({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.adminEvaluationsReportsIdDataUsingGetParams; + options?: { [key: string]: unknown }; +}) { + const { id: param0, ...queryParams } = params; + + return request< + API.Response & { + data?: API.EvaluationReportData; + } + >(`/admin/evaluations/reports/${param0}/data`, { + method: 'GET', + params: { ...queryParams }, + ...(options || {}), + }); +} + +/** 测评报告审核 PATCH /admin/evaluations/reports/${param0}/examine */ +export async function adminEvaluationsReportsIdExamineUsingPatch({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.adminEvaluationsReportsIdExamineUsingPatchParams; + options?: { [key: string]: unknown }; +}) { + const { id: param0, ...queryParams } = params; + + return request(`/admin/evaluations/reports/${param0}/examine`, { + method: 'PATCH', + params: { ...queryParams }, + ...(options || {}), + }); +} + +/** 测评报告发送 PATCH /admin/evaluations/reports/${param0}/send */ +export async function adminEvaluationsReportsIdSendUsingPatch({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.adminEvaluationsReportsIdSendUsingPatchParams; + options?: { [key: string]: unknown }; +}) { + const { id: param0, ...queryParams } = params; + + return request(`/admin/evaluations/reports/${param0}/send`, { + method: 'PATCH', + params: { ...queryParams }, + ...(options || {}), + }); +} + +/** 测评报告导出 GET /admin/evaluations/reports/export */ +export async function adminEvaluationsReportsOpenApiExportUsingGet({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.adminEvaluationsReportsOpenApiExportUsingGetParams; + options?: { [key: string]: unknown }; +}) { + return request< + API.Response & { + data?: API.EvaluationReportExportRet; + } + >('/admin/evaluations/reports/export', { + method: 'GET', + params: { + ...params, + }, + ...(options || {}), + }); +} + +/** 获取当前登录账号信息 GET /admin/login */ +export async function adminLoginUsingGet({ + options, +}: { + options?: { [key: string]: unknown }; +}) { + return request< + API.Response & { + data?: API.AdminInfo; + } + >('/admin/login', { + method: 'GET', + ...(options || {}), + }); +} + +/** 账号登入 POST /admin/login */ +export async function adminLoginUsingPost({ + body, + options, +}: { + body: API.AdminLoginArg; + options?: { [key: string]: unknown }; +}) { + return request('/admin/login', { + method: 'POST', + headers: { + 'Content-Type': 'application/json', + }, + data: body, + ...(options || {}), + }); +} + +/** 账号登出 DELETE /admin/login */ +export async function adminLoginUsingDelete({ + options, +}: { + options?: { [key: string]: unknown }; +}) { + return request('/admin/login', { + method: 'DELETE', + ...(options || {}), + }); +} + +/** 机构创建 POST /admin/organizations */ +export async function adminOrganizationsUsingPost({ + body, + options, +}: { + body: API.OrganizationCreateArg; + options?: { [key: string]: unknown }; +}) { + return request< + API.Response & { + data?: API.OrganizationCreateRet; + } + >('/admin/organizations', { + method: 'POST', + headers: { + 'Content-Type': 'application/json', + }, + data: body, + ...(options || {}), + }); +} + +/** 机构详情 GET /admin/organizations/${param0} */ +export async function adminOrganizationsIdUsingGet({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.adminOrganizationsIdUsingGetParams; + options?: { [key: string]: unknown }; +}) { + const { id: param0, ...queryParams } = params; + + return request< + API.Response & { + data?: API.OrganizationInfo; + } + >(`/admin/organizations/${param0}`, { + method: 'GET', + params: { ...queryParams }, + ...(options || {}), + }); +} + +/** 机构编辑 PUT /admin/organizations/${param0} */ +export async function adminOrganizationsIdUsingPut({ + params, + body, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.adminOrganizationsIdUsingPutParams; + body: API.OrganizationUpdateArg; + options?: { [key: string]: unknown }; +}) { + const { id: param0, ...queryParams } = params; + + return request(`/admin/organizations/${param0}`, { + method: 'PUT', + headers: { + 'Content-Type': 'application/json', + }, + params: { ...queryParams }, + data: body, + ...(options || {}), + }); +} + +/** 机构移动 PATCH /admin/organizations/${param0}/move */ +export async function adminOrganizationsIdMoveUsingPatch({ + params, + body, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.adminOrganizationsIdMoveUsingPatchParams; + body: API.OrganizationMoveArg; + options?: { [key: string]: unknown }; +}) { + const { id: param0, ...queryParams } = params; + + return request(`/admin/organizations/${param0}/move`, { + method: 'PATCH', + headers: { + 'Content-Type': 'application/json', + }, + params: { ...queryParams }, + data: body, + ...(options || {}), + }); +} + +/** 获取机构成员权限表 GET /admin/organizations/${param0}/permissions */ +export async function adminOrganizationsIdPermissionsUsingGet({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.adminOrganizationsIdPermissionsUsingGetParams; + options?: { [key: string]: unknown }; +}) { + const { id: param0, ...queryParams } = params; + + return request< + API.Response & { + data?: API.AdminPermission[]; + } + >(`/admin/organizations/${param0}/permissions`, { + method: 'GET', + params: { ...queryParams }, + ...(options || {}), + }); +} + +/** 启用/禁用机构 PATCH /admin/organizations/${param0}/toggle */ +export async function adminOrganizationsIdToggleUsingPatch({ + params, + body, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.adminOrganizationsIdToggleUsingPatchParams; + body: API.OrganizationToggleArg; + options?: { [key: string]: unknown }; +}) { + const { id: param0, ...queryParams } = params; + + return request(`/admin/organizations/${param0}/toggle`, { + method: 'PATCH', + headers: { + 'Content-Type': 'application/json', + }, + params: { ...queryParams }, + data: body, + ...(options || {}), + }); +} + +/** 机构树形列表 GET /admin/organizations/all */ +export async function adminOrganizationsAllUsingGet({ + options, +}: { + options?: { [key: string]: unknown }; +}) { + return request< + API.Response & { + data?: API.OrganizationAllInfo[]; + } + >('/admin/organizations/all', { + method: 'GET', + ...(options || {}), + }); +} + +/** 量表分页列表 GET /admin/scales */ +export async function adminScalesUsingGet({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.adminScalesUsingGetParams; + options?: { [key: string]: unknown }; +}) { + return request< + API.Response & { + data?: API.ScaleListRet; + } + >('/admin/scales', { + method: 'GET', + params: { + ...params, + }, + ...(options || {}), + }); +} + +/** 量表详情 GET /admin/scales/${param0} */ +export async function adminScalesIdUsingGet({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.adminScalesIdUsingGetParams; + options?: { [key: string]: unknown }; +}) { + const { id: param0, ...queryParams } = params; + + return request< + API.Response & { + data?: API.ScaleInst; + } + >(`/admin/scales/${param0}`, { + method: 'GET', + params: { ...queryParams }, + ...(options || {}), + }); +} + +/** 启用/禁用量表 PATCH /admin/scales/${param0}/toggle */ +export async function adminScalesIdToggleUsingPatch({ + params, + body, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.adminScalesIdToggleUsingPatchParams; + body: API.ScaleToggleArg; + options?: { [key: string]: unknown }; +}) { + const { id: param0, ...queryParams } = params; + + return request(`/admin/scales/${param0}/toggle`, { + method: 'PATCH', + headers: { + 'Content-Type': 'application/json', + }, + params: { ...queryParams }, + data: body, + ...(options || {}), + }); +} + +/** 量表全部数据 GET /admin/scales/all */ +export async function adminScalesAllUsingGet({ + options, +}: { + options?: { [key: string]: unknown }; +}) { + return request< + API.Response & { + data?: API.Dict[]; + } + >('/admin/scales/all', { + method: 'GET', + ...(options || {}), + }); +} + +/** 通过excel导入量表 POST /admin/scales/import */ +export async function adminScalesOpenApiImportUsingPost({ + body, + options, +}: { + body: API.ScaleImportArg; + options?: { [key: string]: unknown }; +}) { + return request< + API.Response & { + data?: API.ScaleImportRet; + } + >('/admin/scales/import', { + method: 'POST', + headers: { + 'Content-Type': 'application/json', + }, + data: body, + ...(options || {}), + }); +} + +/** 量表预览 GET /admin/scales/preview */ +export async function adminScalesPreviewUsingGet({ + body, + options, +}: { + body: API.ScaleImportArg; + options?: { [key: string]: unknown }; +}) { + return request< + API.Response & { + data?: API.ScaleInst; + } + >('/admin/scales/preview', { + method: 'GET', + headers: { + 'Content-Type': 'application/json', + }, + data: body, + ...(options || {}), + }); +} + +/** 操作日志 GET /admin/systems/logs */ +export async function adminSystemsLogsUsingGet({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.adminSystemsLogsUsingGetParams; + options?: { [key: string]: unknown }; +}) { + return request< + API.Response & { + data?: API.AdminLogListRet; + } + >('/admin/systems/logs', { + method: 'GET', + params: { + ...params, + }, + ...(options || {}), + }); +} + +/** 操作日志导出 GET /admin/systems/logs/export */ +export async function adminSystemsLogsOpenApiExportUsingGet({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.adminSystemsLogsOpenApiExportUsingGetParams; + options?: { [key: string]: unknown }; +}) { + return request< + API.Response & { + data?: API.AdminLogExportRet; + } + >('/admin/systems/logs/export', { + method: 'GET', + params: { + ...params, + }, + ...(options || {}), + }); +} + +/** 数据大屏 GET /admin/systems/screen/data */ +export async function adminSystemsScreenDataUsingGet({ + options, +}: { + options?: { [key: string]: unknown }; +}) { + return request< + API.Response & { + data?: API.SystemScreenData; + } + >('/admin/systems/screen/data', { + method: 'GET', + ...(options || {}), + }); +} + +/** 用户分页列表 GET /admin/users */ +export async function adminUsersUsingGet({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.adminUsersUsingGetParams; + options?: { [key: string]: unknown }; +}) { + return request< + API.Response & { + data?: API.UserListRet; + } + >('/admin/users', { + method: 'GET', + params: { + ...params, + }, + ...(options || {}), + }); +} + +/** 启用/禁用用户 PATCH /admin/users/${param0}/toggle */ +export async function adminUsersIdToggleUsingPatch({ + params, + body, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.adminUsersIdToggleUsingPatchParams; + body: API.UserToggleArg; + options?: { [key: string]: unknown }; +}) { + const { id: param0, ...queryParams } = params; + + return request(`/admin/users/${param0}/toggle`, { + method: 'PATCH', + headers: { + 'Content-Type': 'application/json', + }, + params: { ...queryParams }, + data: body, + ...(options || {}), + }); +} + +/** 信息表分页列表 GET /admin/users/sheets */ +export async function adminUsersSheetsUsingGet({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.adminUsersSheetsUsingGetParams; + options?: { [key: string]: unknown }; +}) { + return request< + API.Response & { + data?: API.UserSheetListRet; + } + >('/admin/users/sheets', { + method: 'GET', + params: { + ...params, + }, + ...(options || {}), + }); +} + +/** 信息表创建 POST /admin/users/sheets */ +export async function adminUsersSheetsUsingPost({ + body, + options, +}: { + body: API.UserSheetCreateArg; + options?: { [key: string]: unknown }; +}) { + return request< + API.Response & { + data?: API.UserSheetCreateRet; + } + >('/admin/users/sheets', { + method: 'POST', + headers: { + 'Content-Type': 'application/json', + }, + data: body, + ...(options || {}), + }); +} + +/** 信息表更新 PUT /admin/users/sheets/${param0} */ +export async function adminUsersSheetsIdUsingPut({ + params, + body, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.adminUsersSheetsIdUsingPutParams; + body: API.UserSheetUpdateArg; + options?: { [key: string]: unknown }; +}) { + const { id: param0, ...queryParams } = params; + + return request(`/admin/users/sheets/${param0}`, { + method: 'PUT', + headers: { + 'Content-Type': 'application/json', + }, + params: { ...queryParams }, + data: body, + ...(options || {}), + }); +} + +/** 启用/禁用信息表 PATCH /admin/users/sheets/${param0}/toggle */ +export async function adminUsersSheetsIdToggleUsingPatch({ + params, + body, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.adminUsersSheetsIdToggleUsingPatchParams; + body: API.UserSheetToggleArg; + options?: { [key: string]: unknown }; +}) { + const { id: param0, ...queryParams } = params; + + return request(`/admin/users/sheets/${param0}/toggle`, { + method: 'PATCH', + headers: { + 'Content-Type': 'application/json', + }, + params: { ...queryParams }, + data: body, + ...(options || {}), + }); +} + +/** 信息表全部数据 GET /admin/users/sheets/all */ +export async function adminUsersSheetsAllUsingGet({ + options, +}: { + options?: { [key: string]: unknown }; +}) { + return request< + API.Response & { + data?: API.Dict[]; + } + >('/admin/users/sheets/all', { + method: 'GET', + ...(options || {}), + }); +} + +/** 获取地区数据 GET /admin/utils/areas */ +export async function adminUtilsAreasUsingGet({ + options, +}: { + options?: { [key: string]: unknown }; +}) { + return request< + API.Response & { + data?: API.Area[]; + } + >('/admin/utils/areas', { + method: 'GET', + ...(options || {}), + }); +} + +/** 获取字典数据 GET /admin/utils/data */ +export async function adminUtilsDataUsingGet({ + options, +}: { + options?: { [key: string]: unknown }; +}) { + return request< + API.Response & { + data?: API.UtilDataAdminRet; + } + >('/admin/utils/data', { + method: 'GET', + ...(options || {}), + }); +} + +/** 上传文件 POST /admin/utils/uploads */ +export async function adminUtilsUploadsUsingPost({ + body, + file, + options, +}: { + body: API.AdminUtilsUploadsUsingPostBody; + file?: File; + options?: { [key: string]: unknown }; +}) { + const formData = new FormData(); + + if (file) { + formData.append('file', file); + } + + Object.keys(body).forEach((ele) => { + const item = (body as { [key: string]: any })[ele]; + + if (item !== undefined && item !== null) { + if (typeof item === 'object' && !(item instanceof File)) { + if (item instanceof Array) { + item.forEach((f) => formData.append(ele, f || '')); + } else { + formData.append(ele, JSON.stringify(item)); + } + } else { + formData.append(ele, item); + } + } + }); + + return request< + API.Response & { + data?: API.UploadRet; + } + >('/admin/utils/uploads', { + method: 'POST', + headers: { + 'Content-Type': 'multipart/form-data', + }, + data: formData, + ...(options || {}), + }); +} + +/** 获取测评数据 GET /user/evaluations/${param0} */ +export async function userEvaluationsIdUsingGet({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.userEvaluationsIdUsingGetParams; + options?: { [key: string]: unknown }; +}) { + const { id: param0, ...queryParams } = params; + + return request< + API.Response & { + data?: API.EvaluationInfo; + } + >(`/user/evaluations/${param0}`, { + method: 'GET', + params: { ...queryParams }, + ...(options || {}), + }); +} + +/** 提交测评报告 POST /user/evaluations/${param0}/reports */ +export async function userEvaluationsIdReportsUsingPost({ + params, + body, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.userEvaluationsIdReportsUsingPostParams; + body: API.EvaluationReportCreateArg; + options?: { [key: string]: unknown }; +}) { + const { id: param0, ...queryParams } = params; + + return request< + API.Response & { + data?: API.EvaluationReportCreateRet; + } + >(`/user/evaluations/${param0}/reports`, { + method: 'POST', + headers: { + 'Content-Type': 'application/json', + }, + params: { ...queryParams }, + data: body, + ...(options || {}), + }); +} + +/** 测评报告分页列表 GET /user/evaluations/reports */ +export async function userEvaluationsReportsUsingGet({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.userEvaluationsReportsUsingGetParams; + options?: { [key: string]: unknown }; +}) { + return request< + API.Response & { + data?: API.EvaluationReportUserListRet; + } + >('/user/evaluations/reports', { + method: 'GET', + params: { + ...params, + }, + ...(options || {}), + }); +} + +/** 查看测评报告数据 GET /user/evaluations/reports/${param0} */ +export async function userEvaluationsReportsIdUsingGet({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.userEvaluationsReportsIdUsingGetParams; + options?: { [key: string]: unknown }; +}) { + const { id: param0, ...queryParams } = params; + + return request< + API.Response & { + data?: API.EvaluationReportData; + } + >(`/user/evaluations/reports/${param0}`, { + method: 'GET', + params: { ...queryParams }, + ...(options || {}), + }); +} + +/** 账号登入 POST /user/login */ +export async function userLoginUsingPost({ + body, + options, +}: { + body: API.UserLoginArg; + options?: { [key: string]: unknown }; +}) { + return request< + API.Response & { + data?: API.UserLoginRet; + } + >('/user/login', { + method: 'POST', + headers: { + 'Content-Type': 'application/json', + }, + data: body, + ...(options || {}), + }); +} + +/** 发送验证短信 POST /user/login/verify */ +export async function userLoginVerifyUsingPost({ + body, + options, +}: { + body: API.UserVerifyArg; + options?: { [key: string]: unknown }; +}) { + return request< + API.Response & { + data?: API.UserVerifyRet; + } + >('/user/login/verify', { + method: 'POST', + headers: { + 'Content-Type': 'application/json', + }, + data: body, + ...(options || {}), + }); +} + +/** 获取资料 GET /user/profile */ +export async function userProfileUsingGet({ + options, +}: { + options?: { [key: string]: unknown }; +}) { + return request< + API.Response & { + data?: API.UserInfo; + } + >('/user/profile', { + method: 'GET', + ...(options || {}), + }); +} + +/** 更新资料 PUT /user/profile */ +export async function userProfileUsingPut({ + body, + options, +}: { + body: API.UserUpdateArg; + options?: { [key: string]: unknown }; +}) { + return request('/user/profile', { + method: 'PUT', + headers: { + 'Content-Type': 'application/json', + }, + data: body, + ...(options || {}), + }); +} + +/** 获取字典数据 GET /user/utils/data */ +export async function userUtilsDataUsingGet({ + options, +}: { + options?: { [key: string]: unknown }; +}) { + return request< + API.Response & { + data?: API.UtilDataUserRet; + } + >('/user/utils/data', { + method: 'GET', + ...(options || {}), + }); +} +/* eslint-disable */ +// @ts-ignore + +export type adminAdminsIdPermissionsUsingPatchParams = { + /** 成员id */ + id: string; +}; + +export type adminAdminsIdResetUsingPatchParams = { + /** 成员id */ + id: string; +}; + +export type adminAdminsIdToggleUsingPatchParams = { + /** 成员id */ + id: string; +}; + +export type adminAdminsIdUsingGetParams = { + /** 成员id */ + id: string; +}; + +export type adminAdminsIdUsingPutParams = { + /** 成员id */ + id: string; +}; + +export type adminAdminsUsingGetParams = { + /** 创建时间范围 */ + created_at?: string; + /** 机构id */ + organization_id?: string; + /** 页码 */ + page?: number; + /** 分页大小 */ + page_size?: number; + /** 成员角色 */ + role?: string; + /** 手机号、姓名 */ + search?: string; +}; + +export type AdminCreateArg = { + /** 成员姓名 */ + name?: string; + /** 成员手机号 */ + number?: string; + /** 成员所属机构 */ + organization_id?: string; + /** 成员角色 */ + role?: string; +}; + +export type AdminCreateRet = { + id?: string; + password?: string; +}; + +export type adminEvaluationsIdDataUsingGetParams = { + /** 测评id */ + id: string; +}; + +export type adminEvaluationsIdUsingPutParams = { + /** 测评id */ + id: string; +}; + +export type adminEvaluationsReportsIdDataUsingGetParams = { + /** 报告id */ + id: string; +}; + +export type adminEvaluationsReportsIdExamineUsingPatchParams = { + /** 报告id */ + id: string; +}; + +export type adminEvaluationsReportsIdSendUsingPatchParams = { + /** 报告id */ + id: string; +}; + +export type adminEvaluationsReportsOpenApiExportUsingGetParams = { + /** 测评时间范围 */ + created_at?: string; + /** 测评id */ + evaluation_id?: string; + /** 健康等级 */ + health_level?: string; + /** 机构id */ + organization_id?: string; + /** 量表id */ + scale_id?: string; + /** 姓名、手机号 */ + search?: string; + /** 预警等级 */ + warning_level?: string; +}; + +export type adminEvaluationsReportsUsingGetParams = { + /** 测评时间范围 */ + created_at?: string; + /** 测评id */ + evaluation_id?: string; + /** 健康等级 */ + health_level?: string; + /** 机构id */ + organization_id?: string; + /** 页码 */ + page?: number; + /** 分页大小 */ + page_size?: number; + /** 量表id */ + scale_id?: string; + /** 姓名、手机号 */ + search?: string; + /** 预警等级 */ + warning_level?: string; +}; + +export type adminEvaluationsUsingGetParams = { + /** 创建时间范围 */ + created_at?: string; + /** 测评名称 */ + name?: string; + /** 机构id */ + organization_id?: string; + /** 页码 */ + page?: number; + /** 分页大小 */ + page_size?: number; + /** 类别 */ + user_type?: string; +}; + +export type AdminInfo = { + created_at?: string; + enabled?: boolean; + id?: string; + name?: string; + number?: string; + organization?: OrganizationInfo; + organization_id?: string; + permissions?: string[]; + role?: string; + role_value?: string; + updated_at?: string; + visited_at?: string; +}; + +export type AdminListRet = { + list?: AdminListRow[]; + page?: Page; +}; + +export type AdminListRow = { + created_at?: string; + enabled?: boolean; + id?: string; + name?: string; + number?: string; + organization_id?: string; + organization_name?: string; + role?: string; + role_value?: string; + updated_at?: string; + visited_at?: string; +}; + +export type AdminLogExportRet = { + excel_url?: string; +}; + +export type AdminLoginArg = { + /** 手机号 */ + number?: string; + /** 密码 */ + password?: string; +}; + +export type AdminLogListRet = { + list?: AdminLogListRow[]; + page?: Page; +}; + +export type AdminLogListRow = { + action?: string; + action_value?: string; + created_at?: string; + detail?: string; + id?: string; + module?: string; + module_value?: string; + name?: string; + organization_name?: string; + role?: string; + role_value?: string; + updated_at?: string; +}; + +export type AdminLogModuleDict = { + actions?: Dict[]; + hidden?: boolean; + key?: string; + value?: string; +}; + +export type adminOrganizationsIdMoveUsingPatchParams = { + /** 机构id */ + id: string; +}; + +export type adminOrganizationsIdPermissionsUsingGetParams = { + /** 机构id */ + id: string; +}; + +export type adminOrganizationsIdToggleUsingPatchParams = { + /** 机构id */ + id: string; +}; + +export type adminOrganizationsIdUsingGetParams = { + /** 机构id */ + id: string; +}; + +export type adminOrganizationsIdUsingPutParams = { + /** 机构id */ + id: string; +}; + +export type AdminPermission = { + cate?: string; + permissions?: Dict[]; +}; + +export type AdminResetRet = { + id?: string; + password?: string; +}; + +export type adminScalesIdToggleUsingPatchParams = { + /** 量表id */ + id: string; +}; + +export type adminScalesIdUsingGetParams = { + /** 量表id */ + id: string; +}; + +export type adminScalesUsingGetParams = { + /** 创建时间范围 */ + created_at?: string; + /** 量表名称 */ + name?: string; + /** 页码 */ + page?: number; + /** 分页大小 */ + page_size?: number; + /** 量表分类 */ + type?: string; +}; + +export type AdminSetPermissionsArg = { + /** 成员权限 */ + permissions?: string[]; + /** 成员角色 */ + role?: string; +}; + +export type adminSystemsLogsOpenApiExportUsingGetParams = { + /** 操作行为 */ + action?: string; + /** 操作时间范围 */ + created_at?: string; + /** 操作类型 */ + module?: string; + /** 管理员姓名 */ + name?: string; + /** 机构id */ + organization_id?: string; +}; + +export type adminSystemsLogsUsingGetParams = { + /** 操作行为 */ + action?: string; + /** 操作时间范围 */ + created_at?: string; + /** 操作类型 */ + module?: string; + /** 管理员姓名 */ + name?: string; + /** 机构id */ + organization_id?: string; + /** 页码 */ + page?: number; + /** 分页大小 */ + page_size?: number; +}; + +export type AdminToggleArg = { + /** 成员状态 */ + enabled?: boolean; +}; + +export type AdminUpdateArg = { + /** 成员姓名 */ + name?: string; + /** 成员手机号 */ + number?: string; +}; + +export type adminUsersIdToggleUsingPatchParams = { + /** 用户id */ + id: string; +}; + +export type adminUsersSheetsIdToggleUsingPatchParams = { + /** 信息表id */ + id: string; +}; + +export type adminUsersSheetsIdUsingPutParams = { + /** 信息表id */ + id: string; +}; + +export type adminUsersSheetsUsingGetParams = { + /** 上传时间范围 */ + created_at?: string; + /** 信息表名称 */ + name?: string; + /** 机构id */ + organization_id?: string; + /** 页码 */ + page?: number; + /** 分页大小 */ + page_size?: number; + /** 类别 */ + type?: string; +}; + +export type adminUsersUsingGetParams = { + /** 年龄范围 */ + age?: string; + /** 性别 */ + gender?: string; + /** 机构id */ + organization_id?: string; + /** 页码 */ + page?: number; + /** 分页大小 */ + page_size?: number; + /** 手机号、姓名 */ + search?: string; +}; + +export type AdminUtilsUploadsUsingPostBody = { + /** 文件类型 */ + type: 'excel'; + /** 文件内容 */ + file: string; +}; + +export type Area = { + children?: Areas; + id?: string; + name?: string; + pid?: string; + type?: string; +}; + +export type Areas = Area[]; + +export type Dict = { + hidden?: boolean; + key?: string; + value?: string; +}; + +export type EvaluationCreateArg = { + /** 自动发送报告 */ + auto_send?: boolean; + /** 结束时间 */ + ended_at?: string; + /** 计划答题次数 */ + limit?: number; + /** 单用户答题次数 */ + limit_each?: number; + /** 测评名称 */ + name?: string; + /** 量表id */ + scale_id?: string; + /** 开始时间 */ + started_at?: string; + /** 用户信息表id */ + user_sheet_id?: string; + /** 报告查看权限 */ + visible_admins?: string[]; +}; + +export type EvaluationCreateRet = { + id?: string; +}; + +export type EvaluationData = { + age?: EvaluationDataRow[]; + department?: EvaluationDataRow[]; + education?: EvaluationDataRow[]; + enterprise?: EvaluationDataRow[]; + gender?: EvaluationDataRow[]; + marriage?: EvaluationDataRow[]; +}; + +export type EvaluationDataRow = { + high?: number; + low?: number; + medium?: number; + name?: string; + total?: number; +}; + +export type EvaluationInfo = { + auto_send?: boolean; + created_at?: string; + ended_at?: string; + id?: string; + limit?: number; + limit_each?: number; + name?: string; + organization_id?: string; + report_disabled_reason?: string; + report_enabled?: boolean; + scale?: ScaleInst; + scale_id?: string; + started_at?: string; + updated_at?: string; + user_sheet_id?: string; + visible_admins?: string[]; +}; + +export type EvaluationListRet = { + list?: EvaluationListRow[]; + page?: Page; +}; + +export type EvaluationListRow = { + auto_send?: boolean; + created_at?: string; + ended_at?: string; + id?: string; + limit?: number; + limit_each?: number; + name?: string; + organization_id?: string; + organization_name?: string; + scale_id?: string; + scale_name?: string; + started_at?: string; + updated_at?: string; + user_sheet_id?: string; + user_sheet_name?: string; + visible_admins?: string[]; +}; + +export type EvaluationReportCreateArg = { + /** 用户选择结果 */ + choices?: Record; + /** 操作时长(s) */ + duration?: number; +}; + +export type EvaluationReportCreateRet = { + report_id?: string; +}; + +export type EvaluationReportData = { + choices?: ScaleUserResultChoice[]; + created_at?: string; + evaluation_id?: string; + evaluation_name?: string; + examined_at?: string; + examiner_id?: string; + examiner_name?: string; + id?: string; + result?: ScaleUserResult; + sent_at?: string; + updated_at?: string; + user?: UserInfo; +}; + +export type EvaluationReportExportRet = { + excel_url?: string; +}; + +export type EvaluationReportListRet = { + list?: EvaluationReportListRow[]; + page?: Page; +}; + +export type EvaluationReportListRow = { + created_at?: string; + duration?: number; + duration_format?: string; + evaluation_id?: string; + evaluation_name?: string; + examined_at?: string; + examiner_id?: string; + examiner_name?: string; + health_level?: string; + health_level_value?: string; + id?: string; + organization_id?: string; + organization_name?: string; + results?: string[]; + scale_id?: string; + scale_name?: string; + sent_at?: string; + updated_at?: string; + user_enterprise?: string; + user_gender?: string; + user_id?: string; + user_name?: string; + user_number?: string; + user_sheet_id?: string; + user_sheet_name?: string; + warning_level?: string; + warning_level_value?: string; +}; + +export type EvaluationReportUserListRet = { + list?: EvaluationReportUserListRow[]; + page?: Page; +}; + +export type EvaluationReportUserListRow = { + created_at?: string; + evaluation_id?: string; + evaluation_name?: string; + examined_at?: string; + id?: string; + results?: string[]; + scale_id?: string; + scale_name?: string; + updated_at?: string; +}; + +export type EvaluationUpdateArg = { + /** 自动发送报告 */ + auto_send?: boolean; + /** 结束时间 */ + ended_at?: string; + /** 计划答题次数 */ + limit?: number; + /** 开始时间 */ + started_at?: string; + /** 报告查看权限 */ + visible_admins?: string[]; +}; + +export type OrganizationAllInfo = { + children?: OrganizationAllRet; + enabled?: boolean; + id?: string; + level?: number; + name?: string; + pid?: string; + type?: string; +}; + +export type OrganizationAllRet = OrganizationAllInfo[]; + +export type OrganizationCreateArg = { + /** 机构地址 */ + address?: string; + /** 负责人姓名 */ + admin_name?: string; + /** 负责人手机号 */ + admin_number?: string; + /** 机构地区 */ + area?: string[]; + /** 开通模块 */ + modules?: string[]; + /** 机构名称 */ + name?: string; + /** 上级机构id */ + pid?: string; + /** 机构类别 */ + type?: string; +}; + +export type OrganizationCreateRet = { + admin?: AdminCreateRet; + id?: string; +}; + +export type OrganizationInfo = { + address?: string; + area?: string[]; + created_at?: string; + enabled?: boolean; + id?: string; + level?: number; + modules?: string[]; + name?: string; + pid?: string; + super_admin?: AdminInfo; + type?: string; + type_value?: string; + updated_at?: string; +}; + +export type OrganizationMoveArg = { + /** 上级机构id */ + pid?: string; +}; + +export type OrganizationToggleArg = { + /** 机构状态 */ + enabled?: boolean; +}; + +export type OrganizationUpdateArg = { + /** 机构地址 */ + address?: string; + /** 机构地区 */ + area?: string[]; + /** 开通模块 */ + modules?: string[]; + /** 机构名称 */ + name?: string; + /** 机构类别 */ + type?: string; +}; + +export type Page = { + current?: number; + max?: number; + rows?: number; + size?: number; +}; + +export type Response = { + code?: number; + data?: Record; + msg?: string; +}; + +export type ScaleImportArg = { + /** excel文件id */ + excel?: string; +}; + +export type ScaleImportRet = { + id?: string; +}; + +export type ScaleInst = { + age?: string; + created_at?: string; + deleted_at?: string; + dimensions?: ScaleInstDimension[]; + gender?: string; + guide?: string; + healths?: ScaleInstWarning[]; + id?: string; + introduce?: string; + maps?: ScaleInstMap[]; + name?: string; + norms?: ScaleInstNorm[]; + questions?: ScaleInstQuestion[]; + source?: string; + title?: string; + type?: string; + type_value?: string; + version?: number; + warnings?: ScaleInstWarning[]; +}; + +export type ScaleInstDimension = { + display?: boolean; + formula?: string; + id?: string; + method?: string; + name?: string; + results?: ScaleInstResult[]; +}; + +export type ScaleInstMap = { + age?: string; + dimension_name?: string; + gender?: string; + standard?: number[]; +}; + +export type ScaleInstNorm = { + age?: string; + average?: number; + dimension_name?: string; + gender?: string; + standard?: number; +}; + +export type ScaleInstOption = { + number?: number; + option?: string; + score?: number; +}; + +export type ScaleInstQuestion = { + number?: number; + options?: ScaleInstOption[]; + question?: string; +}; + +export type ScaleInstResult = { + age?: string; + explain?: string; + gender?: string; + id?: string; + name?: string; + score?: string; + suggest?: string; +}; + +export type ScaleInstWarning = { + dimension_name?: string; + level?: string; + result_name?: string; +}; + +export type ScaleListRet = { + list?: ScaleListRow[]; + page?: Page; +}; + +export type ScaleListRow = { + created_at?: string; + enabled?: boolean; + id?: string; + name?: string; + questions?: number; + title?: string; + type?: string; + type_value?: string; + updated_at?: string; +}; + +export type ScaleToggleArg = { + /** 量表状态 */ + enabled?: boolean; +}; + +export type ScaleUserDimension = { + display?: boolean; + explain?: string; + id?: string; + name?: string; + result?: string; + result_id?: string; + score?: number; + suggest?: string; +}; + +export type ScaleUserResult = { + dimensions?: ScaleUserDimension[]; + health_level?: string; + health_level_value?: string; + warning_level?: string; + warning_level_value?: string; +}; + +export type ScaleUserResultChoice = { + option?: string; + option_number?: number; + option_score?: number; + question?: string; + question_number?: number; +}; + +export type SystemScreenData = { + area_count?: Record; + group_count?: number; + health_high_count?: number; + health_low_count?: number; + health_medium_count?: number; + organization_count?: SystemScreenDataCountRow[]; + personal_count?: number; + scale_count?: SystemScreenDataCountRow[]; + total_count?: number; + user_age_count?: SystemScreenDataRow[]; + user_education_count?: SystemScreenDataRow[]; + user_gender_count?: SystemScreenDataRow[]; + user_type_count?: SystemScreenDataRow[]; + warning_high_count?: number; + warning_list?: SystemScreenDataWarningListRow[]; + warning_low_count?: number; + warning_medium_count?: number; +}; + +export type SystemScreenDataCountRow = { + count?: number; + name?: string; +}; + +export type SystemScreenDataRow = { + high?: number; + low?: number; + medium?: number; + name?: string; +}; + +export type SystemScreenDataWarningListRow = { + created_at?: string; + user_name?: string; + warning?: string; +}; + +export type UploadRet = { + id?: string; + size?: number; + url?: string; +}; + +export type userEvaluationsIdReportsUsingPostParams = { + /** 测评任务id */ + id: string; +}; + +export type userEvaluationsIdUsingGetParams = { + /** 测评任务id */ + id: string; +}; + +export type userEvaluationsReportsIdUsingGetParams = { + /** 测评报告id */ + id: string; +}; + +export type userEvaluationsReportsUsingGetParams = { + /** 页码 */ + page?: number; + /** 分页大小 */ + page_size?: number; +}; + +export type UserInfo = { + address?: string; + age?: number; + birthday?: string; + created_at?: string; + department?: string; + disease?: string; + education?: string; + education_value?: string; + enter_year?: string; + enterprise?: string; + gender?: string; + gender_value?: string; + id?: string; + marriage?: string; + marriage_value?: string; + name?: string; + number?: string; + type?: string; + type_value?: string; + updated_at?: string; +}; + +export type UserListRet = { + list?: UserListRow[]; + page?: Page; +}; + +export type UserListRow = { + age?: number; + birthday?: string; + created_at?: string; + enabled?: boolean; + gender?: string; + gender_value?: string; + id?: string; + name?: string; + number?: string; + organization_id?: string; + organization_name?: string; + type?: string; + type_value?: string; + updated_at?: string; +}; + +export type UserLoginArg = { + /** 验证码 */ + code?: string; + /** 测评任务id */ + evaluation_id?: string; + /** 手机号或学号 */ + number?: string; +}; + +export type UserLoginRet = { + id?: string; + new?: boolean; +}; + +export type UserSheetCreateArg = { + /** 文件 */ + excel?: string; + /** 信息表名称 */ + name?: string; + /** 类别 */ + type?: string; +}; + +export type UserSheetCreateRet = { + id?: string; + size?: number; +}; + +export type UserSheetListRet = { + list?: UserSheetListRow[]; + page?: Page; +}; + +export type UserSheetListRow = { + created_at?: string; + enabled?: boolean; + excel?: string; + excel_url?: string; + id?: string; + name?: string; + organization_id?: string; + organization_name?: string; + size?: number; + type?: string; + type_value?: string; + updated_at?: string; +}; + +export type UserSheetToggleArg = { + enabled?: boolean; +}; + +export type UserSheetUpdateArg = { + /** 文件 */ + excel?: string; + /** 信息表名称 */ + name?: string; + /** 类别 */ + type?: string; +}; + +export type UserToggleArg = { + /** 用户状态 */ + enabled?: boolean; +}; + +export type UserUpdateArg = { + /** 出生日期 */ + birthday?: string; + /** 部门 */ + department?: string; + /** 学历 */ + education?: string; + /** 企业名称 */ + enterprise?: string; + /** 性别 */ + gender?: string; + /** 姓名 */ + name?: string; + /** 用户类别 */ + type?: string; +}; + +export type UserVerifyArg = { + /** 手机号 */ + number?: string; +}; + +export type UserVerifyRet = { + duration?: number; +}; + +export type UtilDataAdminRet = { + admin_log_modules?: AdminLogModuleDict[]; + admin_permissions?: AdminPermission[]; + admin_role_permissions?: Record; + admin_roles?: Dict[]; + organization_modules?: Dict[]; + organization_types?: Dict[]; + scale_health_levels?: Dict[]; + scale_methods?: Dict[]; + scale_types?: Dict[]; + scale_warning_levels?: Dict[]; + user_educations?: Dict[]; + user_genders?: Dict[]; + user_marriages?: Dict[]; + user_sheet_tpl?: Dict[]; + user_types?: Dict[]; +}; + +export type UtilDataUserRet = { + user_educations?: Dict[]; + user_genders?: Dict[]; + user_marriages?: Dict[]; + user_types?: Dict[]; +}; diff --git "a/test/__snapshots__/common/\346\265\213\350\257\225 tags \344\270\272 undefined.snap" "b/test/__snapshots__/common/\346\265\213\350\257\225 tags \344\270\272 undefined.snap" new file mode 100644 index 0000000..03db326 --- /dev/null +++ "b/test/__snapshots__/common/\346\265\213\350\257\225 tags \344\270\272 undefined.snap" @@ -0,0 +1,73 @@ +/* eslint-disable */ +// @ts-ignore +import * as API from './types'; + +export function displayStatusEnum(field: API.StatusEnum) { + return { available: 'available', pending: 'pending', sold: 'sold' }[field]; +} +/* eslint-disable */ +// @ts-ignore +import { request } from 'axios'; + +import * as API from './types'; + +/** Finds Pets by status Multiple status values can be provided with comma separated strings GET /pet/findByStatus */ +export async function petFindByStatusUsingGet({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.petFindByStatusUsingGetParams; + options?: { [key: string]: unknown }; +}) { + return request('/pet/findByStatus', { + method: 'GET', + params: { + // status has a default value: available + status: 'available', + ...params, + }, + ...(options || {}), + }); +} +/* eslint-disable */ +// @ts-ignore +export * from './types'; +export * from './displayEnumLabel'; + +export * from './findPetsByStatus'; +/* eslint-disable */ +// @ts-ignore + +export type Category = { + id?: number; + name?: string; +}; + +export type Pet = { + id?: number; + name: string; + category?: Category; + photoUrls: string[]; + tags?: Tag[]; + /** pet status in the store */ + status?: 'available' | 'pending' | 'sold'; +}; + +export type petFindByStatusUsingGetParams = { + /** Status values that need to be considered for filter */ + status?: 'available' | 'pending' | 'sold'; +}; + +export enum StatusEnum { + 'available' = 'available', + 'pending' = 'pending', + 'sold' = 'sold', +} + +export type IStatusEnum = keyof typeof StatusEnum; + +export type Tag = { + id?: number; + name?: string; +}; diff --git "a/test/__snapshots__/common/\346\265\213\350\257\225 tags \344\270\272[].snap" "b/test/__snapshots__/common/\346\265\213\350\257\225 tags \344\270\272[].snap" new file mode 100644 index 0000000..03db326 --- /dev/null +++ "b/test/__snapshots__/common/\346\265\213\350\257\225 tags \344\270\272[].snap" @@ -0,0 +1,73 @@ +/* eslint-disable */ +// @ts-ignore +import * as API from './types'; + +export function displayStatusEnum(field: API.StatusEnum) { + return { available: 'available', pending: 'pending', sold: 'sold' }[field]; +} +/* eslint-disable */ +// @ts-ignore +import { request } from 'axios'; + +import * as API from './types'; + +/** Finds Pets by status Multiple status values can be provided with comma separated strings GET /pet/findByStatus */ +export async function petFindByStatusUsingGet({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.petFindByStatusUsingGetParams; + options?: { [key: string]: unknown }; +}) { + return request('/pet/findByStatus', { + method: 'GET', + params: { + // status has a default value: available + status: 'available', + ...params, + }, + ...(options || {}), + }); +} +/* eslint-disable */ +// @ts-ignore +export * from './types'; +export * from './displayEnumLabel'; + +export * from './findPetsByStatus'; +/* eslint-disable */ +// @ts-ignore + +export type Category = { + id?: number; + name?: string; +}; + +export type Pet = { + id?: number; + name: string; + category?: Category; + photoUrls: string[]; + tags?: Tag[]; + /** pet status in the store */ + status?: 'available' | 'pending' | 'sold'; +}; + +export type petFindByStatusUsingGetParams = { + /** Status values that need to be considered for filter */ + status?: 'available' | 'pending' | 'sold'; +}; + +export enum StatusEnum { + 'available' = 'available', + 'pending' = 'pending', + 'sold' = 'sold', +} + +export type IStatusEnum = keyof typeof StatusEnum; + +export type Tag = { + id?: number; + name?: string; +}; diff --git "a/test/__snapshots__/common/\346\265\213\350\257\225\345\217\252\347\224\237\346\210\220 typescript \347\261\273\345\236\213\357\274\214\344\270\215\347\224\237\346\210\220\350\257\267\346\261\202\345\207\275\346\225\260.snap" "b/test/__snapshots__/common/\346\265\213\350\257\225\345\217\252\347\224\237\346\210\220 typescript \347\261\273\345\236\213\357\274\214\344\270\215\347\224\237\346\210\220\350\257\267\346\261\202\345\207\275\346\225\260.snap" new file mode 100644 index 0000000..5c0fffd --- /dev/null +++ "b/test/__snapshots__/common/\346\265\213\350\257\225\345\217\252\347\224\237\346\210\220 typescript \347\261\273\345\236\213\357\274\214\344\270\215\347\224\237\346\210\220\350\257\267\346\261\202\345\207\275\346\225\260.snap" @@ -0,0 +1,137 @@ +/* eslint-disable */ +// @ts-ignore +export * from './types'; +/* eslint-disable */ +// @ts-ignore + +export type ApiResponse = { + code?: number; + type?: string; + message?: string; +}; + +export type Category = { + id?: number; + name?: string; +}; + +export type Order = { + id?: number; + petId?: number; + quantity?: number; + shipDate?: string; + /** Order Status */ + status?: 'placed' | 'approved' | 'delivered'; + complete?: boolean; +}; + +export type Pet = { + id?: number; + name: string; + category?: Category; + photoUrls: string[]; + tags?: Tag[]; + /** pet status in the store */ + status?: 'available' | 'pending' | 'sold'; +}; + +export type petFindByStatusUsingGetParams = { + /** Status values that need to be considered for filter */ + status?: 'available' | 'pending' | 'sold'; +}; + +export type petFindByTagsUsingGetParams = { + /** Tags to filter by */ + tags?: string[]; +}; + +export type petPetIdUploadImageUsingPostParams = { + /** ID of pet to update */ + petId: number; + /** Additional Metadata */ + additionalMetadata?: string; +}; + +export type petPetIdUsingDeleteParams = { + /** Pet id to delete */ + petId: number; +}; + +export type petPetIdUsingGetParams = { + /** ID of pet to return */ + petId: number; +}; + +export type petPetIdUsingPostParams = { + /** ID of pet that needs to be updated */ + petId: number; + /** Name of pet that needs to be updated */ + name?: string; + /** Status of pet that needs to be updated */ + status?: string; +}; + +export enum StatusEnum { + 'placed' = 'placed', + 'approved' = 'approved', + 'delivered' = 'delivered', +} + +export type IStatusEnum = keyof typeof StatusEnum; + +export enum StatusEnum2 { + 'available' = 'available', + 'pending' = 'pending', + 'sold' = 'sold', +} + +export type IStatusEnum2 = keyof typeof StatusEnum2; + +export type storeOrderOrderIdUsingDeleteParams = { + /** ID of the order that needs to be deleted */ + orderId: number; +}; + +export type storeOrderOrderIdUsingGetParams = { + /** ID of order that needs to be fetched */ + orderId: number; +}; + +export type Tag = { + id?: number; + name?: string; +}; + +export type User = { + id?: number; + username?: string; + firstName?: string; + lastName?: string; + email?: string; + password?: string; + phone?: string; + /** User Status */ + userStatus?: number; +}; + +export type userLoginUsingGetParams = { + /** The user name for login */ + username?: string; + /** The password for login in clear text */ + password?: string; +}; + +export type userUsernameUsingDeleteParams = { + /** The name that needs to be deleted */ + username: string; +}; + +export type userUsernameUsingGetParams = { + /** The name that needs to be fetched. Use user1 for testing. */ + username: string; +}; + +export type userUsernameUsingPutParams = { + /** name that needs to be updated */ + username: string; +}; diff --git "a/test/__snapshots__/common/\346\265\213\350\257\225\345\244\204\347\220\206 allof \347\273\223\346\236\204, \347\224\237\346\210\220\345\244\215\346\235\202 type \347\277\273\350\257\221.snap" "b/test/__snapshots__/common/\346\265\213\350\257\225\345\244\204\347\220\206 allof \347\273\223\346\236\204, \347\224\237\346\210\220\345\244\215\346\235\202 type \347\277\273\350\257\221.snap" new file mode 100644 index 0000000..30e731b --- /dev/null +++ "b/test/__snapshots__/common/\346\265\213\350\257\225\345\244\204\347\220\206 allof \347\273\223\346\236\204, \347\224\237\346\210\220\345\244\215\346\235\202 type \347\277\273\350\257\221.snap" @@ -0,0 +1,102 @@ +/* eslint-disable */ +// @ts-ignore +import * as API from './types'; + +export function displayBatch(field: keyof API.Batch) { + return ( + displayResponse(field as keyof API.Response) || + displayBatchAllOf(field as keyof API.BatchAllOf) + ); +} + +export function displayBatchAllOf(field: keyof API.BatchAllOf) { + return { + data: 'data', + }[field]; +} + +export function displayBatchList(field: keyof API.BatchList) { + return ( + displayResponse(field as keyof API.Response) || + { + data: 'data', + }[field] + ); +} + +export function displaybatchUsingGetParams( + field: keyof API.batchUsingGetParams +) { + return { + errorMessage: 'log to filter by errorMessage', + }[field]; +} + +export function displayResponse(field: keyof API.Response) { + return { + errorCode: '业务约定的错误码', + errorMessage: '业务上的错误信息', + success: '业务上的请求是否成功', + }[field]; +} +/* eslint-disable */ +// @ts-ignore +export * from './types'; +export * from './displayTypeLabel'; + +export * from './log'; +/* eslint-disable */ +// @ts-ignore +import { request } from 'axios'; + +import * as API from './types'; + +/** Finds log by errorMessage Finds log by errorMessage GET /batch */ +export async function batchUsingGet({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.batchUsingGetParams; + options?: { [key: string]: unknown }; +}) { + return request('/batch', { + method: 'GET', + params: { + ...params, + }, + ...(options || {}), + }); +} +/* eslint-disable */ +// @ts-ignore + +export type Batch = + // #/components/schemas/Response + Response & + // #/components/schemas/Batch_allOf + BatchAllOf; + +export type BatchAllOf = { + data?: Record; +}; + +export type BatchList = + // #/components/schemas/Response + Response & { + data?: Batch[]; + }; + +export type batchUsingGetParams = { + /** log to filter by errorMessage */ + errorMessage?: unknown; +}; + +export type Response = { + /** 业务约定的错误码 */ + errorCode?: string; + /** 业务上的错误信息 */ + errorMessage?: string; + /** 业务上的请求是否成功 */ + success: boolean; +}; diff --git "a/test/__snapshots__/common/\346\265\213\350\257\225\345\260\206\344\270\255\346\226\207 tag \345\220\215\347\247\260\347\277\273\350\257\221\346\210\220\350\213\261\346\226\207 tag \345\220\215\347\247\260.snap" "b/test/__snapshots__/common/\346\265\213\350\257\225\345\260\206\344\270\255\346\226\207 tag \345\220\215\347\247\260\347\277\273\350\257\221\346\210\220\350\213\261\346\226\207 tag \345\220\215\347\247\260.snap" new file mode 100644 index 0000000..710fb45 --- /dev/null +++ "b/test/__snapshots__/common/\346\265\213\350\257\225\345\260\206\344\270\255\346\226\207 tag \345\220\215\347\247\260\347\277\273\350\257\221\346\210\220\350\213\261\346\226\207 tag \345\220\215\347\247\260.snap" @@ -0,0 +1,594 @@ +/* eslint-disable */ +// @ts-ignore +import * as API from './types'; + +export function displayStatusEnum(field: API.StatusEnum) { + return { placed: 'placed', approved: 'approved', delivered: 'delivered' }[ + field + ]; +} + +export function displayStatusEnum2(field: API.StatusEnum2) { + return { available: 'available', pending: 'pending', sold: 'sold' }[field]; +} +/* eslint-disable */ +// @ts-ignore +import { request } from 'axios'; + +import * as API from './types'; + +/** Update an existing pet Update an existing pet by Id PUT /pet */ +export async function petUsingPut({ + body, + options, +}: { + body: API.Pet; + options?: { [key: string]: unknown }; +}) { + return request('/pet', { + method: 'PUT', + headers: { + 'Content-Type': 'application/json', + }, + data: body, + ...(options || {}), + }); +} +/* eslint-disable */ +// @ts-ignore +import { request } from 'axios'; + +import * as API from './types'; + +/** Update an existing pet Update an existing pet by Id PUT /pet */ +export async function petUsingPut({ + body, + options, +}: { + body: API.Pet; + options?: { [key: string]: unknown }; +}) { + return request('/pet', { + method: 'PUT', + headers: { + 'Content-Type': 'application/json', + }, + data: body, + ...(options || {}), + }); +} +/* eslint-disable */ +// @ts-ignore +export * from './types'; +export * from './displayEnumLabel'; + +export * from './pets'; +export * from './hello'; +export * from './world'; +export * from './happy'; +export * from './warehouse'; +export * from './user'; +/* eslint-disable */ +// @ts-ignore +import { request } from 'axios'; + +import * as API from './types'; + +/** Update an existing pet Update an existing pet by Id PUT /pet */ +export async function petUsingPut({ + body, + options, +}: { + body: API.Pet; + options?: { [key: string]: unknown }; +}) { + return request('/pet', { + method: 'PUT', + headers: { + 'Content-Type': 'application/json', + }, + data: body, + ...(options || {}), + }); +} + +/** Add a new pet to the store Add a new pet to the store POST /pet */ +export async function petUsingPost({ + body, + options, +}: { + body: API.Pet; + options?: { [key: string]: unknown }; +}) { + return request('/pet', { + method: 'POST', + headers: { + 'Content-Type': 'application/json', + }, + data: body, + ...(options || {}), + }); +} + +/** Find pet by ID Returns a single pet GET /pet/${param0} */ +export async function petPetIdUsingGet({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.petPetIdUsingGetParams; + options?: { [key: string]: unknown }; +}) { + const { petId: param0, ...queryParams } = params; + + return request(`/pet/${param0}`, { + method: 'GET', + params: { ...queryParams }, + ...(options || {}), + }); +} + +/** Updates a pet in the store with form data POST /pet/${param0} */ +export async function petPetIdUsingPost({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.petPetIdUsingPostParams; + options?: { [key: string]: unknown }; +}) { + const { petId: param0, ...queryParams } = params; + + return request(`/pet/${param0}`, { + method: 'POST', + params: { + ...queryParams, + }, + ...(options || {}), + }); +} + +/** Deletes a pet DELETE /pet/${param0} */ +export async function petPetIdUsingDelete({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.petPetIdUsingDeleteParams; + options?: { [key: string]: unknown }; +}) { + const { petId: param0, ...queryParams } = params; + + return request(`/pet/${param0}`, { + method: 'DELETE', + params: { ...queryParams }, + ...(options || {}), + }); +} + +/** uploads an image POST /pet/${param0}/uploadImage */ +export async function petPetIdUploadImageUsingPost({ + params, + body, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.petPetIdUploadImageUsingPostParams; + body: API.PetPetIdUploadImageUsingPostBody; + options?: { [key: string]: unknown }; +}) { + const { petId: param0, ...queryParams } = params; + + return request(`/pet/${param0}/uploadImage`, { + method: 'POST', + headers: { + 'Content-Type': 'application/octet-stream', + }, + params: { + ...queryParams, + }, + data: body, + ...(options || {}), + }); +} + +/** Finds Pets by status Multiple status values can be provided with comma separated strings GET /pet/findByStatus */ +export async function petFindByStatusUsingGet({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.petFindByStatusUsingGetParams; + options?: { [key: string]: unknown }; +}) { + return request('/pet/findByStatus', { + method: 'GET', + params: { + // status has a default value: available + status: 'available', + ...params, + }, + ...(options || {}), + }); +} + +/** Finds Pets by tags Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. GET /pet/findByTags */ +export async function petFindByTagsUsingGet({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.petFindByTagsUsingGetParams; + options?: { [key: string]: unknown }; +}) { + return request('/pet/findByTags', { + method: 'GET', + params: { + ...params, + }, + ...(options || {}), + }); +} +/* eslint-disable */ +// @ts-ignore + +export type ApiResponse = { + code?: number; + type?: string; + message?: string; +}; + +export type Category = { + id?: number; + name?: string; +}; + +export type Order = { + id?: number; + petId?: number; + quantity?: number; + shipDate?: string; + /** Order Status */ + status?: 'placed' | 'approved' | 'delivered'; + complete?: boolean; +}; + +export type Pet = { + id?: number; + name: string; + category?: Category; + photoUrls: string[]; + tags?: Tag[]; + /** pet status in the store */ + status?: 'available' | 'pending' | 'sold'; +}; + +export type petFindByStatusUsingGetParams = { + /** Status values that need to be considered for filter */ + status?: 'available' | 'pending' | 'sold'; +}; + +export type petFindByTagsUsingGetParams = { + /** Tags to filter by */ + tags?: string[]; +}; + +export type PetPetIdUploadImageUsingPostBody = string; + +export type petPetIdUploadImageUsingPostParams = { + /** ID of pet to update */ + petId: number; + /** Additional Metadata */ + additionalMetadata?: string; +}; + +export type petPetIdUsingDeleteParams = { + /** Pet id to delete */ + petId: number; +}; + +export type petPetIdUsingGetParams = { + /** ID of pet to return */ + petId: number; +}; + +export type petPetIdUsingPostParams = { + /** ID of pet that needs to be updated */ + petId: number; + /** Name of pet that needs to be updated */ + name?: string; + /** Status of pet that needs to be updated */ + status?: string; +}; + +export enum StatusEnum { + 'placed' = 'placed', + 'approved' = 'approved', + 'delivered' = 'delivered', +} + +export type IStatusEnum = keyof typeof StatusEnum; + +export enum StatusEnum2 { + 'available' = 'available', + 'pending' = 'pending', + 'sold' = 'sold', +} + +export type IStatusEnum2 = keyof typeof StatusEnum2; + +export type storeOrderOrderIdUsingDeleteParams = { + /** ID of the order that needs to be deleted */ + orderId: number; +}; + +export type storeOrderOrderIdUsingGetParams = { + /** ID of order that needs to be fetched */ + orderId: number; +}; + +export type Tag = { + id?: number; + name?: string; +}; + +export type User = { + id?: number; + username?: string; + firstName?: string; + lastName?: string; + email?: string; + password?: string; + phone?: string; + /** User Status */ + userStatus?: number; +}; + +export type UserCreateWithListUsingPostBody = API.User[]; + +export type userLoginUsingGetParams = { + /** The user name for login */ + username?: string; + /** The password for login in clear text */ + password?: string; +}; + +export type userUsernameUsingDeleteParams = { + /** The name that needs to be deleted */ + username: string; +}; + +export type userUsernameUsingGetParams = { + /** The name that needs to be fetched. Use user1 for testing. */ + username: string; +}; + +export type userUsernameUsingPutParams = { + /** name that needs to be updated */ + username: string; +}; +/* eslint-disable */ +// @ts-ignore +import { request } from 'axios'; + +import * as API from './types'; + +/** Create user This can only be done by the logged in user. 返回值: successful operation POST /user */ +export async function userUsingPost({ + body, + options, +}: { + body: API.User; + options?: { [key: string]: unknown }; +}) { + return request('/user', { + method: 'POST', + headers: { + 'Content-Type': 'application/json', + }, + data: body, + ...(options || {}), + }); +} + +/** Get user by user name GET /user/${param0} */ +export async function userUsernameUsingGet({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.userUsernameUsingGetParams; + options?: { [key: string]: unknown }; +}) { + const { username: param0, ...queryParams } = params; + + return request(`/user/${param0}`, { + method: 'GET', + params: { ...queryParams }, + ...(options || {}), + }); +} + +/** Update user This can only be done by the logged in user. 返回值: successful operation PUT /user/${param0} */ +export async function userUsernameUsingPut({ + params, + body, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.userUsernameUsingPutParams; + body: API.User; + options?: { [key: string]: unknown }; +}) { + const { username: param0, ...queryParams } = params; + + return request(`/user/${param0}`, { + method: 'PUT', + headers: { + 'Content-Type': 'application/json', + }, + params: { ...queryParams }, + data: body, + ...(options || {}), + }); +} + +/** Delete user This can only be done by the logged in user. DELETE /user/${param0} */ +export async function userUsernameUsingDelete({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.userUsernameUsingDeleteParams; + options?: { [key: string]: unknown }; +}) { + const { username: param0, ...queryParams } = params; + + return request(`/user/${param0}`, { + method: 'DELETE', + params: { ...queryParams }, + ...(options || {}), + }); +} + +/** Creates list of users with given input array Creates list of users with given input array 返回值: successful operation POST /user/createWithList */ +export async function userCreateWithListUsingPost({ + body, + options, +}: { + body: API.UserCreateWithListUsingPostBody; + options?: { [key: string]: unknown }; +}) { + return request('/user/createWithList', { + method: 'POST', + headers: { + 'Content-Type': 'application/json', + }, + data: body, + ...(options || {}), + }); +} + +/** Logs user into the system GET /user/login */ +export async function userLoginUsingGet({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.userLoginUsingGetParams; + options?: { [key: string]: unknown }; +}) { + return request('/user/login', { + method: 'GET', + params: { + ...params, + }, + ...(options || {}), + }); +} + +/** Logs out current logged in user session 返回值: successful operation GET /user/logout */ +export async function userLogoutUsingGet({ + options, +}: { + options?: { [key: string]: unknown }; +}) { + return request('/user/logout', { + method: 'GET', + ...(options || {}), + }); +} +/* eslint-disable */ +// @ts-ignore +import { request } from 'axios'; + +import * as API from './types'; + +/** Returns pet inventories by status Returns a map of status codes to quantities GET /store/inventory */ +export async function storeInventoryUsingGet({ + options, +}: { + options?: { [key: string]: unknown }; +}) { + return request>('/store/inventory', { + method: 'GET', + ...(options || {}), + }); +} + +/** Place an order for a pet Place a new order in the store POST /store/order */ +export async function storeOrderUsingPost({ + body, + options, +}: { + body: API.Order; + options?: { [key: string]: unknown }; +}) { + return request('/store/order', { + method: 'POST', + headers: { + 'Content-Type': 'application/json', + }, + data: body, + ...(options || {}), + }); +} + +/** Find purchase order by ID For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions. GET /store/order/${param0} */ +export async function storeOrderOrderIdUsingGet({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.storeOrderOrderIdUsingGetParams; + options?: { [key: string]: unknown }; +}) { + const { orderId: param0, ...queryParams } = params; + + return request(`/store/order/${param0}`, { + method: 'GET', + params: { ...queryParams }, + ...(options || {}), + }); +} + +/** Delete purchase order by ID For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors DELETE /store/order/${param0} */ +export async function storeOrderOrderIdUsingDelete({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.storeOrderOrderIdUsingDeleteParams; + options?: { [key: string]: unknown }; +}) { + const { orderId: param0, ...queryParams } = params; + + return request(`/store/order/${param0}`, { + method: 'DELETE', + params: { ...queryParams }, + ...(options || {}), + }); +} +/* eslint-disable */ +// @ts-ignore +import { request } from 'axios'; + +import * as API from './types'; + +/** Update an existing pet Update an existing pet by Id PUT /pet */ +export async function petUsingPut({ + body, + options, +}: { + body: API.Pet; + options?: { [key: string]: unknown }; +}) { + return request('/pet', { + method: 'PUT', + headers: { + 'Content-Type': 'application/json', + }, + data: body, + ...(options || {}), + }); +} diff --git "a/test/__snapshots__/common/\346\265\213\350\257\225\346\224\257\346\214\201 apifox x-apifox-enum.snap" "b/test/__snapshots__/common/\346\265\213\350\257\225\346\224\257\346\214\201 apifox x-apifox-enum.snap" new file mode 100644 index 0000000..db4092a --- /dev/null +++ "b/test/__snapshots__/common/\346\265\213\350\257\225\346\224\257\346\214\201 apifox x-apifox-enum.snap" @@ -0,0 +1,307 @@ +/* eslint-disable */ +// @ts-ignore +import { request } from 'axios'; + +import * as API from './types'; + +/** 问诊订单详情 GET /org/inquiryOrder/detail https://apifox.com/web/project/5327748/apis/api-230226778-run */ +export async function detailUsingGet({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.detailUsingGetParams; + options?: { [key: string]: unknown }; +}) { + return request( + '/org/inquiryOrder/detail', + { + method: 'GET', + params: { + ...params, + }, + ...(options || {}), + } + ); +} + +/** 问诊订单列表 POST /org/inquiryOrder/page https://apifox.com/web/project/5327748/apis/api-229742579-run */ +export async function pageUsingPost({ + body, + options, +}: { + body: API.InquiryPageReq; + options?: { [key: string]: unknown }; +}) { + return request( + '/org/inquiryOrder/page', + { + method: 'POST', + headers: { + 'Content-Type': 'application/json', + }, + data: body, + ...(options || {}), + } + ); +} +/* eslint-disable */ +// @ts-ignore +import * as API from './types'; + +export function displayBusinessServiceEnum(field: API.BusinessServiceEnum) { + return { + EXPERT_CONSULTATION_TEXT: '专家问诊-图文', + EXPERT_CONSULTATION_VIDEO: '专家问诊-视频', + HEALTH_CONSULTATION_TEXT: '健康咨询-图文', + HEALTH_CONSULTATION_VIDEO: '健康咨询-视频', + SPECIALIZED_CONSULTATION_TEXT: '专科问诊-图文', + SPECIALIZED_CONSULTATION_VIDEO: '专科问诊-视频', + }[field]; +} +/* eslint-disable */ +// @ts-ignore +export * from './types'; +export * from './displayEnumLabel'; + +export * from './dingdanguanli'; +/* eslint-disable */ +// @ts-ignore + +export enum BusinessServiceEnum { + 'EXPERT_CONSULTATION_TEXT' = 'EXPERT_CONSULTATION_TEXT', + 'EXPERT_CONSULTATION_VIDEO' = 'EXPERT_CONSULTATION_VIDEO', + 'HEALTH_CONSULTATION_TEXT' = 'HEALTH_CONSULTATION_TEXT', + 'HEALTH_CONSULTATION_VIDEO' = 'HEALTH_CONSULTATION_VIDEO', + 'SPECIALIZED_CONSULTATION_TEXT' = 'SPECIALIZED_CONSULTATION_TEXT', + 'SPECIALIZED_CONSULTATION_VIDEO' = 'SPECIALIZED_CONSULTATION_VIDEO', +} + +export type IBusinessServiceEnum = keyof typeof BusinessServiceEnum; + +export type detailUsingGetParams = { + inquiryOrderId: string; +}; + +export type ImVideoRecordDTO = { + /** 主键 */ + id?: string; + /** 业务id */ + bizId?: string; + /** 房间号 */ + roomId?: string; + /** 用户ID */ + userId?: string; + /** 时长 */ + duration?: string; + /** 录像地址 */ + videoUrl?: string; + /** 回调参数 */ + callBackParams?: string; + /** 开始时间 */ + startTime?: string; + /** 结束时间 */ + endTime?: string; + /** 添加时间 */ + addTime?: string; + /** 更新时间 */ + modifyTime?: string; +}; + +export type InquiryChatMessageDTO = { + /** 问诊id */ + inquiryOrderId?: string; + /** im消息 */ + rspMsgItems?: RspMsgItem[]; +}; + +export type InquiryOrderDetailRes = { + id?: string; + /** 订单编号 */ + orderNo?: string; + /** 患者名称 */ + patientName?: string; + /** 性别1 男 2女 0未知 */ + patientSex?: number; + /** 年龄 */ + patientAge?: number; + /** 患者手机号 */ + patientPhone?: string; + /** 患者身份证号 */ + patientIdCard?: string; + /** 机构id */ + orgId?: string; + /** 机构名 */ + orgName?: string; + /** 网院id */ + internetHospitalId?: string; + /** 网院名称 */ + internetHospitalName?: string; + /** 订单类型 */ + inquiryType?: string; + /** 订单类型名称 */ + inquiryTypeName?: string; + /** 问诊方式名称 */ + inquiryWayName?: string; + /** 订单类型显示 */ + inquiryTypeDisplay?: string; + /** 订单状态名称 */ + inquiryStatusName?: string; + /** 支付金额 */ + payAmount?: number; + /** 支付状态名称 */ + payStatusName?: string; + /** 创建时间 */ + addTime?: string; + /** 医生id */ + doctorId?: string; + /** 用户id */ + userId?: string; + /** 群聊id */ + groupImId?: string; + /** 医生姓名 */ + doctorName?: string; + /** 医生登录账号 */ + doctorPhone?: string; + /** 科室code */ + doctorSectionCode?: string; + /** 科室名称 */ + doctorSectionName?: string; + /** 问诊记录 */ + inquiryChatMessageDTO?: InquiryChatMessageDTO; + /** 视频记录 */ + imVideoRecordDTOs?: ImVideoRecordDTO[]; +}; + +export type InquiryPageReq = { + /** 当前页码 */ + pageIndex?: number; + /** 每页显示的记录数 */ + pageSize?: number; + /** 网院id */ + internetHospitalId?: string; + /** 机构id */ + channelId: string; + /** 订单编号 */ + orderNo?: string; + /** 患者名称 */ + patientName?: string; + /** 医生姓名 */ + doctorName?: string; + /** 订单来源 */ + channelName?: string; + /** 订单类型 */ + orderType?: string; + /** 问诊状态(INIT:未开始/ WAIT_DISPATCH:待派单/WAIT_DIAGNOSIS:待接诊/DOCTOR_CANCELED:医生取消/PATIENT_CANCELED:患者取消/TIME_OUT_CANCELED:超时取消/TIME_OUT_WITHDRAWAL:超时未接诊/DEALING_DIAGNOSIS:问诊中/WITHDRAWAL:已退诊/ENDED:已结束) */ + inquiryStatus?: string; + /** 支付状态(NO_PAID/无需支付/UNPAID/待支付/PAID/已支付/CANCEL_PAYMENT/已取消/TIME_OUT_CANCEL/超时未支付取消/REFUNDED/已退款 */ + payStatus?: string; + /** 创建时间起始 */ + createTimeStart?: string; + /** 创建时间结束 */ + createTimeEnd?: string; + /** 业务服务 */ + businessService?: + | 'EXPERT_CONSULTATION_TEXT' + | 'EXPERT_CONSULTATION_VIDEO' + | 'HEALTH_CONSULTATION_TEXT' + | 'HEALTH_CONSULTATION_VIDEO' + | 'SPECIALIZED_CONSULTATION_TEXT' + | 'SPECIALIZED_CONSULTATION_VIDEO'; +}; + +export type InquiryPageRes = { + id?: string; + /** 订单编号 */ + orderNo?: string; + /** 机构id */ + orgId?: string; + /** 机构名 */ + orgName?: string; + /** 网院id */ + internetHospitalId?: string; + /** 网院名称 */ + internetHospitalName?: string; + /** 创建时间 */ + addTime?: string; + /** 患者名称 */ + patientName?: string; + /** 患者联系方式 */ + patientPhone?: string; + /** 订单类型名称 */ + inquiryTypeName?: string; + /** 问诊方式名称 */ + inquiryWayName?: string; + /** 订单类型显示名称:订单类型-问诊方式 */ + inquiryTypeDisplay?: string; + /** 订单状态名称 */ + inquiryStatusName?: string; + /** 支付金额 */ + payAmount?: number; + /** 支付状态名称 */ + payStatusName?: string; + /** 医生id */ + doctorId?: string; + /** 医生姓名 */ + doctorName?: string; +}; + +export type IPageInquiryPageRes = { + records?: InquiryPageRes[]; + total?: number; + size?: number; + current?: number; + orders?: OrderItem[]; + optimizeCountSql?: boolean; + isSearchCount?: boolean; + hitCount?: boolean; + countId?: string; + maxLimit?: number; + searchCount?: boolean; + /** 当前分页总页数 */ + pages?: number; + ascs?: string[]; + asc?: string[]; + descs?: string[]; + desc?: string[]; +}; + +export type Object = {}; + +export type OrderItem = { + column?: string; + asc?: boolean; +}; + +export type ResponseResultInquiryOrderDetailRes = { + code?: string; + msg?: string; + data?: InquiryOrderDetailRes; +}; + +export type ResponseResultIPageInquiryPageRes = { + code?: string; + msg?: string; + data?: IPageInquiryPageRes; +}; + +export type RspMsgItem = { + /** 消息的发送者 */ + From_Account?: string; + /** 是否是空洞消息,当消息被删除或者消息过期后,MsgBody 为空,该字段为1,撤回的消息,该字段为2 */ + IsPlaceMsg?: number; + /** 消息内容,详情请参见 消息内容 MsgBody 说明isSystemMsg == 1 消息类型 ObjectisSystemMsg == 0 消息类型 Array */ + MsgBody?: Object; + /** 字段为 1 时表示系统消息 */ + IsSystemMsg?: number; + /** 消息的优先级,用于消息去重,有客户端发消息时填写,如果没有填,服务端会自动生成,1表示 High 优先级消息,2表示 Normal 优先级消息,3表示 Low 优先级消息,4表示 Lowest 优先级消息 */ + MsgPriority?: number; + /** 消息随机数,用于标记该条消息,数据范围 [0,4294967295] */ + MsgRandom?: number; + /** 标识该条消息,可用于 撤回公众号消息 */ + MsgKey?: string; + /** 消息序列号,用于标记该条消息,值越小发送的越早,数据范围 [0,4294967295] */ + MsgSeq?: number; + /** 消息被发送的时间戳,server 的时间 */ + MsgTimeStamp?: number; +}; diff --git "a/test/__snapshots__/common/\346\265\213\350\257\225\346\224\257\346\214\201 apifox x-run-in-apifox.snap" "b/test/__snapshots__/common/\346\265\213\350\257\225\346\224\257\346\214\201 apifox x-run-in-apifox.snap" new file mode 100644 index 0000000..ce251e9 --- /dev/null +++ "b/test/__snapshots__/common/\346\265\213\350\257\225\346\224\257\346\214\201 apifox x-run-in-apifox.snap" @@ -0,0 +1,1440 @@ +/* eslint-disable */ +// @ts-ignore +import { request } from 'axios'; + +import * as API from './types'; + +/** getGoodsByIds POST /mall/feign/goods/getGoodsByIds https://apifox.com/web/project/5327758/apis/api-229418941-run */ +export async function feignGoodsGetGoodsByIdsUsingPost({ + body, + options, +}: { + body: API.FeignGoodsGetGoodsByIdsUsingPostBody; + options?: { [key: string]: unknown }; +}) { + return request('/mall/feign/goods/getGoodsByIds', { + method: 'POST', + headers: { + 'Content-Type': 'application/json', + }, + data: body, + ...(options || {}), + }); +} + +/** getGoodsList POST /mall/feign/goods/getGoodsByName https://apifox.com/web/project/5327758/apis/api-229418940-run */ +export async function feignGoodsGetGoodsByNameUsingPost({ + body, + options, +}: { + body: API.GoodsQueryDTO; + options?: { [key: string]: unknown }; +}) { + return request('/mall/feign/goods/getGoodsByName', { + method: 'POST', + headers: { + 'Content-Type': 'application/json', + }, + data: body, + ...(options || {}), + }); +} +/* eslint-disable */ +// @ts-ignore +export * from './types'; + +export * from './shangpinshenheguanli'; +export * from './feign'; +export * from './shangpinjichuguanli'; +export * from './shangpinkuozhanfuwu'; +/* eslint-disable */ +// @ts-ignore +import { request } from 'axios'; + +import * as API from './types'; + +/** 添加商品 POST /mall/goods/addGoods https://apifox.com/web/project/5327758/apis/api-229419585-run */ +export async function goodsAddGoodsUsingPost({ + body, + options, +}: { + body: API.AddGoodsReq1; + options?: { [key: string]: unknown }; +}) { + return request('/mall/goods/addGoods', { + method: 'POST', + headers: { + 'Content-Type': 'application/json', + }, + data: body, + ...(options || {}), + }); +} + +/** 批量删除商品 POST /mall/goods/batchDeleteGoods https://apifox.com/web/project/5327758/apis/api-229419591-run */ +export async function goodsBatchDeleteGoodsUsingPost({ + body, + options, +}: { + body: API.BatchDeleteGoodsReq; + options?: { [key: string]: unknown }; +}) { + return request('/mall/goods/batchDeleteGoods', { + method: 'POST', + headers: { + 'Content-Type': 'application/json', + }, + data: body, + ...(options || {}), + }); +} + +/** 批量启禁用商品 POST /mall/goods/batchUpdateStatus https://apifox.com/web/project/5327758/apis/api-229419593-run */ +export async function goodsBatchUpdateStatusUsingPost({ + body, + options, +}: { + body: API.BatchUpdateStatusReq; + options?: { [key: string]: unknown }; +}) { + return request('/mall/goods/batchUpdateStatus', { + method: 'POST', + headers: { + 'Content-Type': 'application/json', + }, + data: body, + ...(options || {}), + }); +} + +/** 删除商品 GET /mall/goods/deleteGoods https://apifox.com/web/project/5327758/apis/api-229419590-run */ +export async function goodsDeleteGoodsUsingGet({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.goodsDeleteGoodsUsingGetParams; + options?: { [key: string]: unknown }; +}) { + return request('/mall/goods/deleteGoods', { + method: 'GET', + params: { + ...params, + }, + ...(options || {}), + }); +} + +/** 查询商品详情 POST /mall/goods/getGoodsDetail https://apifox.com/web/project/5327758/apis/api-229419594-run */ +export async function goodsGetGoodsDetailUsingPost({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.goodsGetGoodsDetailUsingPostParams; + options?: { [key: string]: unknown }; +}) { + return request( + '/mall/goods/getGoodsDetail', + { + method: 'POST', + params: { + ...params, + }, + ...(options || {}), + } + ); +} + +/** 查询商品数量 GET /mall/goods/getGoodsNum https://apifox.com/web/project/5327758/apis/api-229419589-run */ +export async function goodsGetGoodsNumUsingGet({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.goodsGetGoodsNumUsingGetParams; + options?: { [key: string]: unknown }; +}) { + return request('/mall/goods/getGoodsNum', { + method: 'GET', + params: { + ...params, + }, + ...(options || {}), + }); +} + +/** 查询医院药房商品列表 POST /mall/goods/hospitalGoodsPage https://apifox.com/web/project/5327758/apis/api-229419588-run */ +export async function goodsHospitalGoodsPageUsingPost({ + body, + options, +}: { + body: API.QueryGoodsReq; + options?: { [key: string]: unknown }; +}) { + return request( + '/mall/goods/hospitalGoodsPage', + { + method: 'POST', + headers: { + 'Content-Type': 'application/json', + }, + data: body, + ...(options || {}), + } + ); +} + +/** 查询我的药房商品列表 POST /mall/goods/pharmacyGoodsPage https://apifox.com/web/project/5327758/apis/api-229419587-run */ +export async function goodsPharmacyGoodsPageUsingPost({ + body, + options, +}: { + body: API.QueryGoodsReq; + options?: { [key: string]: unknown }; +}) { + return request( + '/mall/goods/pharmacyGoodsPage', + { + method: 'POST', + headers: { + 'Content-Type': 'application/json', + }, + data: body, + ...(options || {}), + } + ); +} + +/** 编辑商品 POST /mall/goods/updateGoods https://apifox.com/web/project/5327758/apis/api-229419586-run */ +export async function goodsUpdateGoodsUsingPost({ + body, + options, +}: { + body: API.UpdateGoodsReq; + options?: { [key: string]: unknown }; +}) { + return request('/mall/goods/updateGoods', { + method: 'POST', + headers: { + 'Content-Type': 'application/json', + }, + data: body, + ...(options || {}), + }); +} + +/** 启禁用商品 POST /mall/goods/updateGoodsStatus https://apifox.com/web/project/5327758/apis/api-229419592-run */ +export async function goodsUpdateGoodsStatusUsingPost({ + body, + options, +}: { + body: API.DisableGoodsReq; + options?: { [key: string]: unknown }; +}) { + return request('/mall/goods/updateGoodsStatus', { + method: 'POST', + headers: { + 'Content-Type': 'application/json', + }, + data: body, + ...(options || {}), + }); +} +/* eslint-disable */ +// @ts-ignore +import { request } from 'axios'; + +import * as API from './types'; + +/** 新增商品属性字典 POST /mall/goods/addGoodsAttributeDict https://apifox.com/web/project/5327758/apis/api-231097233-run */ +export async function goodsAddGoodsAttributeDictUsingPost({ + body, + options, +}: { + body: API.GoodsAttributeDictAddReq; + options?: { [key: string]: unknown }; +}) { + return request( + '/mall/goods/addGoodsAttributeDict', + { + method: 'POST', + headers: { + 'Content-Type': 'application/json', + }, + data: body, + ...(options || {}), + } + ); +} + +/** 获取诊断字典值 GET /mall/goods/getDiagnoseByDictName https://apifox.com/web/project/5327758/apis/api-229956960-run */ +export async function goodsGetDiagnoseByDictNameUsingGet({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.goodsGetDiagnoseByDictNameUsingGetParams; + options?: { [key: string]: unknown }; +}) { + return request( + '/mall/goods/getDiagnoseByDictName', + { + method: 'GET', + params: { + ...params, + }, + ...(options || {}), + } + ); +} + +/** 获取商品属性字典 POST /mall/goods/getGoodsAttributeDict https://apifox.com/web/project/5327758/apis/api-230881259-run */ +export async function goodsGetGoodsAttributeDictUsingPost({ + body, + options, +}: { + body: API.GoodsAttributeDictPageReq; + options?: { [key: string]: unknown }; +}) { + return request( + '/mall/goods/getGoodsAttributeDict', + { + method: 'POST', + headers: { + 'Content-Type': 'application/json', + }, + data: body, + ...(options || {}), + } + ); +} + +/** 获取药房供应商 GET /mall/goods/getPharmacySuppliers https://apifox.com/web/project/5327758/apis/api-230751273-run */ +export async function goodsGetPharmacySuppliersUsingGet({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.goodsGetPharmacySuppliersUsingGetParams; + options?: { [key: string]: unknown }; +}) { + return request( + '/mall/goods/getPharmacySuppliers', + { + method: 'GET', + params: { + ...params, + }, + ...(options || {}), + } + ); +} + +/** 获取科室字典值 GET /mall/goods/getSectionDict https://apifox.com/web/project/5327758/apis/api-229904215-run */ +export async function goodsGetSectionDictUsingGet({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.goodsGetSectionDictUsingGetParams; + options?: { [key: string]: unknown }; +}) { + return request( + '/mall/goods/getSectionDict', + { + method: 'GET', + params: { + ...params, + }, + ...(options || {}), + } + ); +} + +/** 获取供应商资质信息 GET /mall/goods/getSupplierCertificate https://apifox.com/web/project/5327758/apis/api-231170942-run */ +export async function goodsGetSupplierCertificateUsingGet({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.goodsGetSupplierCertificateUsingGetParams; + options?: { [key: string]: unknown }; +}) { + return request( + '/mall/goods/getSupplierCertificate', + { + method: 'GET', + params: { + ...params, + }, + ...(options || {}), + } + ); +} + +/** 共享商品 POST /mall/goods/shareGoods https://apifox.com/web/project/5327758/apis/api-230292228-run */ +export async function goodsShareGoodsUsingPost({ + body, + options, +}: { + body: API.ShareGoodsReq; + options?: { [key: string]: unknown }; +}) { + return request('/mall/goods/shareGoods', { + method: 'POST', + headers: { + 'Content-Type': 'application/json', + }, + data: body, + ...(options || {}), + }); +} +/* eslint-disable */ +// @ts-ignore +import { request } from 'axios'; + +import * as API from './types'; + +/** 商品审核 POST /mall/goods/auditGoods https://apifox.com/web/project/5327758/apis/api-226991471-run */ +export async function goodsAuditGoodsUsingPost({ + body, + options, +}: { + body: API.AuditGoodsReq; + options?: { [key: string]: unknown }; +}) { + return request('/mall/goods/auditGoods', { + method: 'POST', + headers: { + 'Content-Type': 'application/json', + }, + data: body, + ...(options || {}), + }); +} + +/** 批量审核商品 POST /mall/goods/batchAuditGoods https://apifox.com/web/project/5327758/apis/api-231575710-run */ +export async function goodsBatchAuditGoodsUsingPost({ + body, + options, +}: { + body: API.BatchAuditGoodsReq; + options?: { [key: string]: unknown }; +}) { + return request('/mall/goods/batchAuditGoods', { + method: 'POST', + headers: { + 'Content-Type': 'application/json', + }, + data: body, + ...(options || {}), + }); +} + +/** 审核商品信息 GET /mall/goods/getGoodsInfo https://apifox.com/web/project/5327758/apis/api-227394999-run */ +export async function goodsGetGoodsInfoUsingGet({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.goodsGetGoodsInfoUsingGetParams; + options?: { [key: string]: unknown }; +}) { + return request('/mall/goods/getGoodsInfo', { + method: 'GET', + params: { + ...params, + }, + ...(options || {}), + }); +} + +/** 商品审核列表 POST /mall/goods/goodsAuditPage https://apifox.com/web/project/5327758/apis/api-226950154-run */ +export async function goodsGoodsAuditPageUsingPost({ + body, + options, +}: { + body: API.QueryGoodsReq; + options?: { [key: string]: unknown }; +}) { + return request( + '/mall/goods/goodsAuditPage', + { + method: 'POST', + headers: { + 'Content-Type': 'application/json', + }, + data: body, + ...(options || {}), + } + ); +} +/* eslint-disable */ +// @ts-ignore + +export type AddGoodsReq1 = { + /** 机构id */ + orgId: string; + /** 机构编码 */ + orgCode: string; + /** 商品类型((western_medicine:西药 / western_chinese:中药 / food:中药 / health_product:保健品 / medical_equipment:医疗器械 / inspection:检验检查)' */ + goodsType: string; + /** 商品名 */ + goodsName?: string; + /** 通用名 */ + commonName: string; + /** 通用名拼音 */ + commonNamePy?: string; + /** 商品主图 */ + goodsMainImg: string; + /** 厂商名称 */ + drugManufacturerName?: string; + /** 药品类型:(western_medicine:西药 / chinese_patent_medicine:中成药) */ + medicineType?: string; + /** 药剂型 */ + formType?: string; + /** 药品规格 */ + spec?: string; + /** 包装材料 */ + packagingMaterials?: string; + /** 最小包装单位 */ + minPackageUnit?: string; + /** 最小包装数量 */ + minPackageValue?: number; + /** 最小制剂单位 */ + minPreparationUnit?: string; + /** 所属科室 */ + belongSection?: string; + /** 适应症 */ + indication?: string; + /** 禁忌症 */ + contraindication?: string; + /** 不良反应 */ + adverseReaction?: string; + /** 是否处方药(1:处方药 / 0:非处方药) */ + prescriptionDrug?: number; + /** 批准文号 */ + approveNo?: string; + /** 上市许可持有人(企业) */ + enterpriseName?: string; + /** 中药剂型(chinese_herbal_pieces:中药饮片 / chinese_medicinal_granule:中药颗粒 / homemade_medicine:自制药品) */ + chineseFormType?: string; + /** 生产地区 */ + productArea?: string; + /** 贮藏方法 */ + storageMethod?: string; + /** 当量 */ + equivalent?: number; + /** 配料表 */ + ingredientList?: string; + /** 营养成分 */ + nutrients?: string; + /** 营养成分表(图片) */ + nutrientsImg?: string; + /** 食品生产许可证编号 */ + productLicenseNumber?: string; + /** 保健品保健功能描述 */ + healthFunc?: string; + /** 保健品功效成分 */ + funcComponents?: string; + /** 保健食品批准证号 */ + healthApprovalNumber?: string; + /** 医疗器械注册证号 */ + registNumber?: string; + /** 服务项目名称 */ + serviceItemName?: string; + /** 医疗项目编码 */ + medicalItemCode?: string; + /** 服务医疗机构名称 */ + serviceMedicalName?: string; + /** 服务区域范围 */ + serviceAreaScope?: string; + /** 服务医疗机构-省 */ + serviceMedicalProvince?: string; + /** 服务医疗机构-市 */ + serviceMedicalCity?: string; + /** 服务医疗机构-区 */ + serviceMedicalDistrict?: string; + /** 服务医疗机构-详细地址 */ + serviceMedicalAddress?: string; + /** 服务适用人群 */ + applicablePopulation?: string; + /** 服务检查前准备 */ + preparationInspection?: string; + /** 检查注意事项 */ + inspectionPrecautions?: string; + /** 服务报告有效期 */ + reportExpiration?: string; + /** 服务报告出具时间 */ + reportIssueTime?: string; + /** 是否集采(0:否 / 1:是) */ + purchased?: number; + /** 是否基药(0:否 / 1:是) */ + basicDrug?: number; + /** 医保类型(Non_medical:目录外(自费) / Category_A:甲类 / Category_B:乙类) */ + nhsaType?: string; + /** 国家医保药品编码 */ + nhsaCode?: string; + /** 省医保药品编码 */ + provinceMedicalCode?: string; + /** 市医保药品编码 */ + cityMedicalCode?: string; + /** 药品本位码 */ + standardCode?: string; + /** 条码 */ + barCode?: string; + /** 我的药房库存 */ + myStock: number; + /** 锁库数量 */ + lockCount?: number; + /** 库存计量单位 */ + stockUnit: string; + /** 我的零售价 */ + salePrice: number; + /** 生产批号(销售信息) */ + productBatchNumber?: string; + /** 商品重量 */ + goodsWeight?: number; + /** 生产日期 */ + productionDate?: string; + /** 有效期 */ + expirationDate?: string; +}; + +export type AuditGoodsReq = { + goodsId: string; + /** 审核状态(wait:待审核 / pass:审核通过 / refuse:审核拒绝) */ + auditStatus: string; + refuseReason?: string; +}; + +export type BaseGoodDTO = { + /** 商品id */ + id?: string; + /** 机构id */ + orgId?: string; + /** 机构编码 */ + orgCode?: string; + /** 商品类型(western_medicine:西药/中成药 / chinese_medicine:中药 / food:食品 / health_product:保健品 / medical_equipment:医疗器械 / inspection:检验检查) */ + goodsType?: string; + /** 商品名 */ + goodsName?: string; + /** 通用名 */ + commonName?: string; + /** 通用名拼音 */ + commonNamePy?: string; + /** 商品主图 */ + goodsMainImg?: string; + /** 厂商名称 */ + drugManufacturerName?: string; + /** 我的药房库存 */ + myStock?: number; + /** 锁库数量 */ + lockCount?: number; + /** 库存单位 */ + stockUnit?: string; + /** 我的零售价 */ + salePrice?: number; + /** 规格 */ + spec?: string; + /** 是否集采(0:否 / 1:是) */ + purchased?: number; + /** 是否基药(0:否 / 1:是) */ + basicDrug?: number; + /** 医保类型(Non_medical:目录外(自费) / Category_A:甲类 / Category_B:乙类) */ + nhsaType?: number; + /** 国家医保药品编码 */ + nhsaCode?: string; + /** 省医保药品编码 */ + provinceMedicalCode?: string; + /** 市医保药品编码 */ + cityMedicalCode?: string; + /** 药品本位码 */ + standardCode?: string; + /** 条码 */ + barCode?: string; + /** 审核状态:(wait:待审核 / pass:审核通过 / refuse:审核拒绝) */ + auditStatus?: string; +}; + +export type BatchAuditGoodsReq = { + /** 商品ID集合 */ + goodsIdList: string[]; + /** 审核状态(wait:待审核 / pass:审核通过 / refuse:审核拒绝) */ + auditStatus: string; + /** 审核拒绝原因 */ + refuseReason?: string; +}; + +export type BatchDeleteGoodsReq = { + /** 商品id集合 */ + goodsIds: string[]; + /** 机构id */ + orgId: string; +}; + +export type BatchUpdateStatusReq = { + /** 商品id */ + goodsIds: string[]; + /** 机构id */ + orgId: string; + /** 是否可用 */ + status: number; +}; + +export type DiagnoseDictValueRes = { + id?: string; + diagnoseCode?: string; + diagnoseName?: string; +}; + +export type DisableGoodsReq = { + /** 商品id */ + goodsId: string; + /** 机构id */ + orgId: string; + /** 是否可用 */ + status: number; +}; + +export type FeignGoodsGetGoodsByIdsUsingPostBody = string[]; + +export type GoodsAttributeDictAddReq = { + /** 字典名称 */ + name: string; + /** 字典类型(1:剂型 / 2:包装单位 / 3:库存计量 / 4:制剂单位 / 5:包装材质) */ + type: number; +}; + +export type GoodsAttributeDictPageReq = { + /** 当前页码 */ + pageIndex?: number; + /** 每页显示的记录数 */ + pageSize?: number; + /** 字典名称 */ + name?: string; + /** 字典类型(1:剂型 / 2:包装单位 / 3:库存计量 / 4:制剂单位 / 5:包装材质) */ + type: number; +}; + +export type GoodsAttributeDictPageRes = { + /** id */ + id?: string; + /** 字典值名称 */ + name?: string; + /** 来源类型(1:剂型 / 2:包装单位 / 3:库存计量 / 4:制剂单位 / 5:包装材质) */ + type?: number; +}; + +export type goodsDeleteGoodsUsingGetParams = { + goodsId: string; + orgId: string; +}; + +export type GoodsDetailRes = { + id?: string; + /** 机构id */ + orgId?: string; + /** 机构编码 */ + orgCode?: string; + /** 商品类型((western_medicine:西药 / western_chinese:中药 / food:中药 / health_product:保健品 / medical_equipment:医疗器械 / inspection:检验检查)' */ + goodsType?: string; + /** 商品名 */ + goodsName?: string; + /** 通用名 */ + commonName?: string; + /** 通用名拼音 */ + commonNamePy?: string; + /** 商品主图 */ + goodsMainImg?: string; + /** 厂商名称 */ + drugManufacturerName?: string; + /** 药品类型:(western_medicine:西药 / chinese_patent_medicine:中成药) */ + medicineType?: string; + /** 药剂型 */ + formType?: string; + /** 药品规格 */ + spec?: string; + /** 包装材料 */ + packagingMaterials?: string; + /** 最小包装单位 */ + minPackageUnit?: string; + /** 最小包装数量 */ + minPackageValue?: number; + /** 最小制剂单位 */ + minPreparationUnit?: string; + /** 所属科室 */ + belongSection?: string; + /** 适应症 */ + indication?: string; + /** 禁忌症 */ + contraindication?: string; + /** 不良反应 */ + adverseReaction?: string; + /** 是否处方药(1:处方药 / 0:非处方药) */ + prescriptionDrug?: number; + /** 批准文号 */ + approveNo?: string; + /** 上市许可持有人(企业) */ + enterpriseName?: string; + /** 中药剂型(chinese_herbal_pieces:中药饮片 / chinese_medicinal_granule:中药颗粒 / homemade_medicine:自制药品) */ + chineseFormType?: string; + /** 生产地区 */ + productArea?: string; + /** 贮藏方法 */ + storageMethod?: string; + /** 当量 */ + equivalent?: number; + /** 配料表 */ + ingredientList?: string; + /** 营养成分 */ + nutrients?: string; + /** 营养成分表(图片) */ + nutrientsImg?: string; + /** 食品生产许可证编号 */ + productLicenseNumber?: string; + /** 保健品保健功能描述 */ + healthFunc?: string; + /** 保健品功效成分 */ + funcComponents?: string; + /** 保健食品批准证号 */ + healthApprovalNumber?: string; + /** 医疗器械注册证号 */ + registNumber?: string; + /** 服务项目名称 */ + serviceItemName?: string; + /** 医疗项目编码 */ + medicalItemCode?: string; + /** 服务医疗机构名称 */ + serviceMedicalName?: string; + /** 服务区域范围 */ + serviceAreaScope?: string; + /** 服务医疗机构-省 */ + serviceMedicalProvince?: string; + /** 服务医疗机构-市 */ + serviceMedicalCity?: string; + /** 服务医疗机构-区 */ + serviceMedicalDistrict?: string; + /** 服务医疗机构-详细地址 */ + serviceMedicalAddress?: string; + /** 服务适用人群 */ + applicablePopulation?: string; + /** 服务检查前准备 */ + preparationInspection?: string; + /** 检查注意事项 */ + inspectionPrecautions?: string; + /** 服务报告有效期 */ + reportExpiration?: string; + /** 服务报告出具时间 */ + reportIssueTime?: string; + /** 是否集采(0:否 / 1:是) */ + purchased?: number; + /** 是否基药(0:否 / 1:是) */ + basicDrug?: number; + /** 医保类型(Non_medical:目录外(自费) / Category_A:甲类 / Category_B:乙类) */ + nhsaType?: string; + /** 国家医保药品编码 */ + nhsaCode?: string; + /** 省医保药品编码 */ + provinceMedicalCode?: string; + /** 市医保药品编码 */ + cityMedicalCode?: string; + /** 药品本位码 */ + standardCode?: string; + /** 条码 */ + barCode?: string; + /** 我的药房库存 */ + myStock?: number; + /** 锁库数量 */ + lockCount?: number; + /** 库存计量单位 */ + stockUnit?: string; + /** 我的零售价 */ + salePrice?: number; + /** 生产批号(销售信息) */ + productBatchNumber?: string; + /** 商品重量 */ + goodsWeight?: number; + /** 生产日期 */ + productionDate?: string; + /** 有效期 */ + expirationDate?: string; +}; + +export type GoodsDTO = { + id?: string; + /** 机构id */ + orgId?: string; + /** 机构编码 */ + orgCode?: string; + /** 商品类型((western_medicine:西药 / western_chinese:中药 / food:中药 / health_product:保健品 / medical_equipment:医疗器械 / inspection:检验检查)' */ + goodsType?: string; + /** 商品名 */ + goodsName?: string; + /** 通用名 */ + commonName?: string; + /** 通用名拼音 */ + commonNamePy?: string; + /** 商品主图 */ + goodsMainImg?: string; + /** 厂商名称 */ + drugManufacturerName?: string; + /** 药品类型:(western_medicine:西药 / chinese_patent_medicine:中成药) */ + medicineType?: string; + /** 药剂型 */ + formType?: string; + /** 药品规格 */ + spec?: string; + /** 包装材料 */ + packagingMaterials?: string; + /** 最小包装单位 */ + minPackageUnit?: string; + /** 最小包装数量 */ + minPackageValue?: number; + /** 最小制剂单位 */ + minPreparationUnit?: string; + /** 所属科室 */ + belongSection?: string; + /** 适应症 */ + indication?: string; + /** 禁忌症 */ + contraindication?: string; + /** 不良反应 */ + adverseReaction?: string; + /** 是否处方药(1:处方药 / 0:非处方药) */ + prescriptionDrug?: number; + /** 批准文号 */ + approveNo?: string; + /** 上市许可持有人(企业) */ + enterpriseName?: string; + /** 中药剂型(chinese_herbal_pieces:中药饮片 / chinese_medicinal_granule:中药颗粒 / homemade_medicine:自制药品) */ + chineseFormType?: string; + /** 生产地区 */ + productArea?: string; + /** 贮藏方法 */ + storageMethod?: string; + /** 当量 */ + equivalent?: number; + /** 配料表 */ + ingredientList?: string; + /** 营养成分 */ + nutrients?: string; + /** 营养成分表(图片) */ + nutrientsImg?: string; + /** 食品生产许可证编号 */ + productLicenseNumber?: string; + /** 保健品保健功能描述 */ + healthFunc?: string; + /** 保健品功效成分 */ + funcComponents?: string; + /** 保健食品批准证号 */ + healthApprovalNumber?: string; + /** 医疗器械注册证号 */ + registNumber?: string; + /** 服务项目名称 */ + serviceItemName?: string; + /** 医疗项目编码 */ + medicalItemCode?: string; + /** 服务医疗机构名称 */ + serviceMedicalName?: string; + /** 服务区域范围 */ + serviceAreaScope?: string; + /** 服务医疗机构-省 */ + serviceMedicalProvince?: string; + /** 服务医疗机构-市 */ + serviceMedicalCity?: string; + /** 服务医疗机构-区 */ + serviceMedicalDistrict?: string; + /** 服务医疗机构-详细地址 */ + serviceMedicalAddress?: string; + /** 服务适用人群 */ + applicablePopulation?: string; + /** 服务检查前准备 */ + preparationInspection?: string; + /** 检查注意事项 */ + inspectionPrecautions?: string; + /** 服务报告有效期 */ + reportExpiration?: string; + /** 服务报告出具时间 */ + reportIssueTime?: string; + /** 是否集采(0:否 / 1:是) */ + purchased?: number; + /** 是否基药(0:否 / 1:是) */ + basicDrug?: number; + /** 医保类型(Non_medical:目录外(自费) / Category_A:甲类 / Category_B:乙类) */ + nhsaType?: string; + /** 国家医保药品编码 */ + nhsaCode?: string; + /** 省医保药品编码 */ + provinceMedicalCode?: string; + /** 市医保药品编码 */ + cityMedicalCode?: string; + /** 药品本位码 */ + standardCode?: string; + /** 条码 */ + barCode?: string; + /** 我的药房库存 */ + myStock?: number; + /** 锁库数量 */ + lockCount?: number; + /** 库存计量单位 */ + stockUnit?: string; + /** 我的零售价 */ + salePrice?: number; + /** 生产批号(销售信息) */ + productBatchNumber?: string; + /** 商品重量 */ + goodsWeight?: number; + /** 生产日期 */ + productionDate?: string; + /** 有效期 */ + expirationDate?: string; +}; + +export type goodsGetDiagnoseByDictNameUsingGetParams = { + dictName: string; +}; + +export type goodsGetGoodsDetailUsingPostParams = { + goodsId: string; + orgId: string; +}; + +export type goodsGetGoodsInfoUsingGetParams = { + goodsId?: string; +}; + +export type goodsGetGoodsNumUsingGetParams = { + orgId: string; +}; + +export type goodsGetPharmacySuppliersUsingGetParams = { + orgId: string; +}; + +export type goodsGetSectionDictUsingGetParams = { + orgId: string; +}; + +export type goodsGetSupplierCertificateUsingGetParams = { + orgId: string; +}; + +export type GoodsNumDTO = { + /** 审核通过数量 */ + numberOfAuditPass?: number; + /** 审核拒绝数量 */ + numberOfAuditRefuse?: number; + /** 等待审核数量 */ + numberOfAuditWait?: number; +}; + +export type GoodsPageQueryDTO = { + /** 商品id */ + id?: string; + /** 机构id */ + orgId?: string; + /** 机构编码 */ + orgCode?: string; + /** 商品名 */ + goodsName?: string; + /** 商品类型(western_medicine:西药/中成药 / chinese_medicine:中药 / food:食品 / health_product:保健品 / medical_equipment:医疗器械 / inspection:检验检查)' */ + goodsType?: string; + /** 商品展示名:[商品名]商品通用名+规格+最小包装数量+最小剂型单位+最小包装单位 */ + goodsNameDisplay?: string; + /** 通用名 */ + commonName?: string; + /** 通用名拼音 */ + commonNamePy?: string; + /** 商品主图 */ + goodsMainImg?: string; + /** 厂商名称 */ + drugManufacturerName?: string; + /** 是否集采(0:否 / 1:是) */ + purchased?: number; + /** 是否基药(0:否 / 1:是) */ + basicDrug?: number; + /** 医保类型(Non_medical:目录外(自费) / Category_A:甲类 / Category_B:乙类) */ + nhsaType?: string; + /** 国家医保药品编码 */ + nhsaCode?: string; + /** 省医保药品编码 */ + provinceMedicalCode?: string; + /** 市医保药品编码 */ + cityMedicalCode?: string; + /** 药品本位码 */ + standardCode?: string; + /** 条码 */ + barCode?: string; + /** 我的药房库存 */ + myStock?: number; + /** 锁库数量 */ + lockCount?: number; + /** 库存单位 */ + stockUnit?: string; + /** 我的零售价 */ + salePrice?: number; + /** 生产批号(销售信息) */ + productBatchNumber?: string; + /** 规格 */ + spec?: string; + /** 商品重量 */ + goodsWeight?: number; + /** 生产日期 */ + productionDate?: string; + /** 有效期 */ + expirationDate?: string; + /** 添加方式(HIS:HIS同步/ SELF:自行添加 / ERP:ERP同步) */ + addWay?: string; + /** 状态(0:禁用 / 1:启用) */ + status?: number; + /** 是否处方药(1:是处方药 / 0:非处方药) */ + prescriptionDrug?: number; + /** 药品类型:(western_medicine:西药 / chinese_patent_medicine:中成药) */ + medicineType?: string; + /** 最小制剂单位 */ + minPreparationUnit?: string; + /** 最小包装单位 */ + minPackageUnit?: string; + /** 最小包装数量 */ + minPackageValue?: number; + /** 组合商品名称 */ + combinedGoodsName?: string; + /** 运费 */ + freight?: string; + /** 服务区域范围 */ + serviceAreaScope?: string; + /** 实际销量 */ + realSalesVolume?: number; + /** 供应商名称 */ + supplierName?: string; + /** 服务机构名称 */ + serviceMedicalName?: string; + /** 服务项目名称 */ + serviceItemName?: string; + /** 商品状态(我的药房:网院共享商品、自有商品;网院药房:云门诊-已共享) */ + goodsStatus?: string; + /** 是否共享低级别医院(0:否 / 1:是) */ + shareLowLevelStatus?: number; + /** 创建时间 */ + addTime?: string; + /** 审核状态:(wait:待审核 / pass:审核通过 / refuse:审核拒绝) */ + auditStatus?: string; + /** 自动检测结果(0:自动检测失败 / 1:自动检测成功) */ + autoDetectRes?: number; + /** 自动检测失败原因 */ + autoDetectFailReason?: string; +}; + +export type GoodsQueryDTO = { + /** 机构id */ + orgId: string; + /** 商品名称关键字 */ + goodsKeyWord: string; + /** 商品来源(pharmacy:我的药房,cloud:云药房,his:医院药房,当前版本只有我的药房,此参数可不传) */ + goodsOrigin?: string; + /** 机构的顶级医院id */ + hospitalOrgId?: string; +}; + +export type IPageGoodsAttributeDictPageRes = { + records?: GoodsAttributeDictPageRes[]; + total?: number; + size?: number; + current?: number; + orders?: OrderItem[]; + optimizeCountSql?: boolean; + isSearchCount?: boolean; + hitCount?: boolean; + countId?: string; + maxLimit?: number; + searchCount?: boolean; + pages?: number; + ascs?: string[]; + asc?: string[]; + descs?: string[]; + desc?: string[]; +}; + +export type IPageGoodsPageQueryDTO = { + records?: GoodsPageQueryDTO[]; + total?: number; + size?: number; + current?: number; + orders?: OrderItem[]; + optimizeCountSql?: boolean; + isSearchCount?: boolean; + hitCount?: boolean; + countId?: string; + maxLimit?: number; + searchCount?: boolean; + /** 当前分页总页数 */ + pages?: number; + ascs?: string[]; + asc?: string[]; + descs?: string[]; + desc?: string[]; +}; + +export type OrderItem = { + column?: string; + asc?: boolean; +}; + +export type QueryGoodsReq = { + /** 当前页码 */ + pageIndex?: number; + /** 每页显示的记录数 */ + pageSize?: number; + /** 机构id */ + orgId: string; + /** 机构的顶级医院id */ + hospitalOrgId?: string; + /** 机构类型 */ + orgType?: string; + /** 供应商机构id */ + supplyOrgId?: string; + /** 我的零售价-最低价格 */ + salePriceLow?: number; + /** 我的零售价-最高价格 */ + salePriceHigh?: number; + /** 商品类型 */ + goodsType?: string; + /** 服务区域范围 */ + serviceAreaScope?: string; + /** 医保类型 */ + nhsaType?: number; + /** 适应症 */ + indication?: string[]; + /** 所属科室 */ + belongSection?: string; + /** 审核状态 */ + auditStatus?: string; + /** 商品名称关键字 */ + goodsKeyWord?: string; + /** 创建时间-左区间 */ + createTimeLeft?: string; + /** 创建时间-右区间 */ + createTimeRight?: string; +}; + +export type ResponseResultBaseGoodDTO = { + code?: string; + msg?: string; + data?: BaseGoodDTO; +}; + +export type ResponseResultBoolean = { + code?: string; + msg?: string; + data?: boolean; +}; + +export type ResponseResultGoodsDetailRes = { + code?: string; + msg?: string; + data?: GoodsDetailRes; +}; + +export type ResponseResultGoodsNumDTO = { + code?: string; + msg?: string; + data?: GoodsNumDTO; +}; + +export type ResponseResultIPageGoodsAttributeDictPageRes = { + code?: string; + msg?: string; + data?: IPageGoodsAttributeDictPageRes; +}; + +export type ResponseResultIPageGoodsPageQueryDTO = { + code?: string; + msg?: string; + data?: IPageGoodsPageQueryDTO; +}; + +export type ResponseResultListDiagnoseDictValueRes = { + code?: string; + msg?: string; + data?: DiagnoseDictValueRes[]; +}; + +export type ResponseResultListSectionDictValueRes = { + code?: string; + msg?: string; + data?: SectionDictValueRes[]; +}; + +export type ResponseResultListsupplierRes = { + code?: string; + msg?: string; + data?: supplierRes[]; +}; + +export type ResponseResultSupplierCertificateRes = { + code?: string; + msg?: string; + data?: SupplierCertificateRes; +}; + +export type SectionDictValueRes = { + id?: string; + sectionCode?: string; + sectionName?: string; +}; + +export type ShareGoodsReq = { + orgId: string; + goodsIdList: string[]; +}; + +export type SupplierCertificateRes = { + /** 机构名称 */ + orgName?: string; + /** 机构资质 */ + certificates?: string[]; + /** 营业执照 */ + licensePhotoUrls?: string[]; +}; + +export type supplierRes = { + /** 供应商ID */ + supplierId?: string; + /** 供应商code */ + supplierCode?: string; + /** 供应商名称 */ + supplierName?: string; +}; + +export type UpdateGoodsReq = { + /** 机构id */ + orgId: string; + /** 机构编码 */ + orgCode: string; + /** 商品类型((western_medicine:西药 / western_chinese:中药 / food:食品 / health_product:保健品 / medical_equipment:医疗器械 / inspection:检验检查)' */ + goodsType: string; + /** 商品名 */ + goodsName?: string; + /** 通用名 */ + commonName: string; + /** 通用名拼音 */ + commonNamePy?: string; + /** 商品主图 */ + goodsMainImg: string; + /** 厂商名称 */ + drugManufacturerName?: string; + /** 药品类型:(western_medicine:西药 / chinese_patent_medicine:中成药) */ + medicineType?: string; + /** 药剂型 */ + formType?: string; + /** 药品规格 */ + spec?: string; + /** 包装材料 */ + packagingMaterials?: string; + /** 最小包装单位 */ + minPackageUnit?: string; + /** 最小包装数量 */ + minPackageValue?: number; + /** 最小制剂单位 */ + minPreparationUnit?: string; + /** 所属科室 */ + belongSection?: string; + /** 适应症 */ + indication?: string; + /** 禁忌症 */ + contraindication?: string; + /** 不良反应 */ + adverseReaction?: string; + /** 是否处方药(1:处方药 / 0:非处方药) */ + prescriptionDrug?: number; + /** 批准文号 */ + approveNo?: string; + /** 上市许可持有人(企业) */ + enterpriseName?: string; + /** 中药剂型(chinese_herbal_pieces:中药饮片 / chinese_medicinal_granule:中药颗粒 / homemade_medicine:自制药品) */ + chineseFormType?: string; + /** 生产地区 */ + productArea?: string; + /** 贮藏方法 */ + storageMethod?: string; + /** 当量 */ + equivalent?: number; + /** 配料表 */ + ingredientList?: string; + /** 营养成分 */ + nutrients?: string; + /** 营养成分表(图片) */ + nutrientsImg?: string; + /** 食品生产许可证编号 */ + productLicenseNumber?: string; + /** 保健品保健功能描述 */ + healthFunc?: string; + /** 保健品功效成分 */ + funcComponents?: string; + /** 保健食品批准证号 */ + healthApprovalNumber?: string; + /** 医疗器械注册证号 */ + registNumber?: string; + /** 服务项目名称 */ + serviceItemName?: string; + /** 医疗项目编码 */ + medicalItemCode?: string; + /** 服务医疗机构名称 */ + serviceMedicalName?: string; + /** 服务区域范围 */ + serviceAreaScope?: string; + /** 服务医疗机构-省 */ + serviceMedicalProvince?: string; + /** 服务医疗机构-市 */ + serviceMedicalCity?: string; + /** 服务医疗机构-区 */ + serviceMedicalDistrict?: string; + /** 服务医疗机构-详细地址 */ + serviceMedicalAddress?: string; + /** 服务适用人群 */ + applicablePopulation?: string; + /** 服务检查前准备 */ + preparationInspection?: string; + /** 检查注意事项 */ + inspectionPrecautions?: string; + /** 服务报告有效期 */ + reportExpiration?: string; + /** 服务报告出具时间 */ + reportIssueTime?: string; + /** 是否集采(0:否 / 1:是) */ + purchased?: number; + /** 是否基药(0:否 / 1:是) */ + basicDrug?: number; + /** 医保类型(Non_medical:目录外(自费) / Category_A:甲类 / Category_B:乙类) */ + nhsaType?: string; + /** 国家医保药品编码 */ + nhsaCode?: string; + /** 省医保药品编码 */ + provinceMedicalCode?: string; + /** 市医保药品编码 */ + cityMedicalCode?: string; + /** 药品本位码 */ + standardCode?: string; + /** 条码 */ + barCode?: string; + /** 我的药房库存 */ + myStock: number; + /** 锁库数量 */ + lockCount?: number; + /** 库存计量单位 */ + stockUnit: string; + /** 我的零售价 */ + salePrice: number; + /** 生产批号(销售信息) */ + productBatchNumber?: string; + /** 商品重量 */ + goodsWeight?: number; + /** 生产日期 */ + productionDate?: string; + /** 有效期 */ + expirationDate?: string; + /** 商品id */ + id: string; +}; diff --git "a/test/__snapshots__/common/\346\265\213\350\257\225\346\224\257\346\214\201 components \351\235\236 schemas \347\232\204\345\255\227\346\256\265.snap" "b/test/__snapshots__/common/\346\265\213\350\257\225\346\224\257\346\214\201 components \351\235\236 schemas \347\232\204\345\255\227\346\256\265.snap" new file mode 100644 index 0000000..9c4ccac --- /dev/null +++ "b/test/__snapshots__/common/\346\265\213\350\257\225\346\224\257\346\214\201 components \351\235\236 schemas \347\232\204\345\255\227\346\256\265.snap" @@ -0,0 +1,40 @@ +/* eslint-disable */ +// @ts-ignore +import { request } from 'axios'; + +import * as API from './types'; + +/** 获取活动详情 GET /activity/${param0} */ +export async function activityIdUsingGet({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.activityIdUsingGetParams; + options?: { [key: string]: unknown }; +}) { + const { id: param0, ...queryParams } = params; + + return request(`/activity/${param0}`, { + method: 'GET', + params: { ...queryParams }, + ...(options || {}), + }); +} +/* eslint-disable */ +// @ts-ignore +export * from './types'; + +export * from './activity'; +/* eslint-disable */ +// @ts-ignore + +export type activityIdUsingGetParams = { + /** 活动id */ + id: number; +}; + +export type ActivityList = { + id?: number; + name?: string; +}; diff --git "a/test/__snapshots__/common/\346\265\213\350\257\225\347\224\237\346\210\220 JSON Schemas.snap" "b/test/__snapshots__/common/\346\265\213\350\257\225\347\224\237\346\210\220 JSON Schemas.snap" new file mode 100644 index 0000000..ee42cbe --- /dev/null +++ "b/test/__snapshots__/common/\346\265\213\350\257\225\347\224\237\346\210\220 JSON Schemas.snap" @@ -0,0 +1,6374 @@ +/* eslint-disable */ +// @ts-ignore +import { request } from 'axios'; + +import * as API from './types'; + +/** AddAppKey 为应用添加各种类型机器人appkey POST /llmops/v1/api/robot/${param0}/appkey */ +export async function v1ApiRobotWorkspaceIdAppkeyUsingPost({ + params, + body, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v1ApiRobotWorkspaceIdAppkeyUsingPostParams; + body: API.AddAppkeyReq; + options?: { [key: string]: unknown }; +}) { + const { workspaceID: param0, ...queryParams } = params; + + return request(`/llmops/v1/api/robot/${param0}/appkey`, { + method: 'POST', + params: { ...queryParams }, + data: body, + ...(options || {}), + }); +} +/* eslint-disable */ +// @ts-ignore +import { request } from 'axios'; + +import * as API from './types'; + +/** ListApiToken 获取app 的 token 列表 GET /llmops/v1/api/app/${param0}/api-token */ +export async function v1ApiAppAppIdApiTokenUsingGet({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v1ApiAppAppIdApiTokenUsingGetParams; + options?: { [key: string]: unknown }; +}) { + const { appID: param0, ...queryParams } = params; + + return request( + `/llmops/v1/api/app/${param0}/api-token`, + { + method: 'GET', + params: { + ...queryParams, + }, + ...(options || {}), + } + ); +} + +/** CreateApiToken 创建 app 的token POST /llmops/v1/api/app/${param0}/api-token */ +export async function v1ApiAppAppIdApiTokenUsingPost({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v1ApiAppAppIdApiTokenUsingPostParams; + options?: { [key: string]: unknown }; +}) { + const { appID: param0, ...queryParams } = params; + + return request( + `/llmops/v1/api/app/${param0}/api-token`, + { + method: 'POST', + params: { ...queryParams }, + ...(options || {}), + } + ); +} +/* eslint-disable */ +// @ts-ignore +import { request } from 'axios'; + +import * as API from './types'; + +/** GetAppCostTokens 查询 app token消耗 POST /llmops/v1/api/${param0}/cost */ +export async function v1ApiAppIdCostUsingPost({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v1ApiAppIdCostUsingPostParams; + options?: { [key: string]: unknown }; +}) { + const { appID: param0, ...queryParams } = params; + + return request(`/llmops/v1/api/${param0}/cost`, { + method: 'POST', + params: { + ...queryParams, + }, + ...(options || {}), + }); +} + +/** CreateApp 创建 app POST /llmops/v1/api/app */ +export async function v1ApiAppUsingPost({ + body, + options, +}: { + body: API.CreateAppReq; + options?: { [key: string]: unknown }; +}) { + return request('/llmops/v1/api/app', { + method: 'POST', + data: body, + ...(options || {}), + }); +} + +/** DeleteApp 删除 app DELETE /llmops/v1/api/app/${param0}/delete */ +export async function v1ApiAppAppIdOpenApiDeleteUsingDelete({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v1ApiAppAppIdOpenApiDeleteUsingDeleteParams; + options?: { [key: string]: unknown }; +}) { + const { appID: param0, ...queryParams } = params; + + return request(`/llmops/v1/api/app/${param0}/delete`, { + method: 'DELETE', + params: { ...queryParams }, + ...(options || {}), + }); +} + +/** GetAppDetails 查询 app 详情 GET /llmops/v1/api/app/${param0}/details */ +export async function v1ApiAppAppIdDetailsUsingGet({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v1ApiAppAppIdDetailsUsingGetParams; + options?: { [key: string]: unknown }; +}) { + const { appID: param0, ...queryParams } = params; + + return request(`/llmops/v1/api/app/${param0}/details`, { + method: 'GET', + params: { ...queryParams }, + ...(options || {}), + }); +} + +/** GetSumHourlyMessagesCount 每小时messages数 GET /llmops/v1/api/app/${param0}/hourly-messages */ +export async function v1ApiAppAppIdHourlyMessagesUsingGet({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v1ApiAppAppIdHourlyMessagesUsingGetParams; + options?: { [key: string]: unknown }; +}) { + const { appID: param0, ...queryParams } = params; + + return request( + `/llmops/v1/api/app/${param0}/hourly-messages`, + { + method: 'GET', + params: { + ...queryParams, + }, + ...(options || {}), + } + ); +} + +/** GetSumHourlyToken 每小时token数 GET /llmops/v1/api/app/${param0}/hourly-token */ +export async function v1ApiAppAppIdHourlyTokenUsingGet({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v1ApiAppAppIdHourlyTokenUsingGetParams; + options?: { [key: string]: unknown }; +}) { + const { appID: param0, ...queryParams } = params; + + return request( + `/llmops/v1/api/app/${param0}/hourly-token`, + { + method: 'GET', + params: { + ...queryParams, + }, + ...(options || {}), + } + ); +} + +/** GetAppLogs 查询 app 日志与标注 GET /llmops/v1/api/app/${param0}/logs */ +export async function v1ApiAppAppIdLogsUsingGet({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v1ApiAppAppIdLogsUsingGetParams; + options?: { [key: string]: unknown }; +}) { + const { appID: param0, ...queryParams } = params; + + return request( + `/llmops/v1/api/app/${param0}/logs`, + { + method: 'GET', + params: { + ...queryParams, + }, + ...(options || {}), + } + ); +} + +/** GetLogsMessages 查询 app 日志与标注消息详情 GET /llmops/v1/api/app/${param0}/logs/${param1}/messages */ +export async function v1ApiAppAppIdLogsConversationIdMessagesUsingGet({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v1ApiAppAppIdLogsConversationIdMessagesUsingGetParams; + options?: { [key: string]: unknown }; +}) { + const { appID: param0, conversationID: param1, ...queryParams } = params; + + return request( + `/llmops/v1/api/app/${param0}/logs/${param1}/messages`, + { + method: 'GET', + params: { ...queryParams }, + ...(options || {}), + } + ); +} + +/** GetSumDailyMessagesCount 每日messages数 GET /llmops/v1/api/app/${param0}/messages */ +export async function v1ApiAppAppIdMessagesUsingGet({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v1ApiAppAppIdMessagesUsingGetParams; + options?: { [key: string]: unknown }; +}) { + const { appID: param0, ...queryParams } = params; + + return request( + `/llmops/v1/api/app/${param0}/messages`, + { + method: 'GET', + params: { + ...queryParams, + }, + ...(options || {}), + } + ); +} + +/** ShareChat 创建分享path PUT /llmops/v1/api/app/${param0}/share */ +export async function v1ApiAppAppIdShareUsingPut({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v1ApiAppAppIdShareUsingPutParams; + options?: { [key: string]: unknown }; +}) { + const { appID: param0, ...queryParams } = params; + + return request( + `/llmops/v1/api/app/${param0}/share`, + { + method: 'PUT', + params: { + ...queryParams, + }, + ...(options || {}), + } + ); +} + +/** GetSumDailyToken 每日token GET /llmops/v1/api/app/${param0}/token */ +export async function v1ApiAppAppIdTokenUsingGet({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v1ApiAppAppIdTokenUsingGetParams; + options?: { [key: string]: unknown }; +}) { + const { appID: param0, ...queryParams } = params; + + return request( + `/llmops/v1/api/app/${param0}/token`, + { + method: 'GET', + params: { + ...queryParams, + }, + ...(options || {}), + } + ); +} + +/** UpdateApp 更新 app PUT /llmops/v1/api/app/${param0}/update */ +export async function v1ApiAppAppIdUpdateUsingPut({ + params, + body, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v1ApiAppAppIdUpdateUsingPutParams; + body: API.UpdateAppReq; + options?: { [key: string]: unknown }; +}) { + const { appID: param0, ...queryParams } = params; + + return request(`/llmops/v1/api/app/${param0}/update`, { + method: 'PUT', + params: { ...queryParams }, + data: body, + ...(options || {}), + }); +} + +/** ReleaseDiscover 发布到发现 PUT /llmops/v1/api/app/${param0}/update_status */ +export async function v1ApiAppAppIdUpdateStatusUsingPut({ + params, + body, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v1ApiAppAppIdUpdateStatusUsingPutParams; + body: API.ReleaseDiscoverReq; + options?: { [key: string]: unknown }; +}) { + const { appID: param0, ...queryParams } = params; + + return request(`/llmops/v1/api/app/${param0}/update_status`, { + method: 'PUT', + params: { ...queryParams }, + data: body, + ...(options || {}), + }); +} + +/** GetImagePreSignedUrl 获取上传预签名地址 GET /llmops/v1/api/app/image */ +export async function v1ApiAppImageUsingGet({ + options, +}: { + options?: { [key: string]: unknown }; +}) { + return request('/llmops/v1/api/app/image', { + method: 'GET', + ...(options || {}), + }); +} + +/** ListApp 查询 app 列表 GET /llmops/v1/api/app/list */ +export async function v1ApiAppListUsingGet({ + options, +}: { + options?: { [key: string]: unknown }; +}) { + return request('/llmops/v1/api/app/list', { + method: 'GET', + ...(options || {}), + }); +} + +/** ListAppPick 查询精选 app 列表 GET /llmops/v1/api/app/list-pick */ +export async function v1ApiAppListPickUsingGet({ + options, +}: { + options?: { [key: string]: unknown }; +}) { + return request('/llmops/v1/api/app/list-pick', { + method: 'GET', + ...(options || {}), + }); +} + +/** ListAppByUser 查询用户关联的 app 列表 GET /llmops/v1/api/app/list-private */ +export async function v1ApiAppListPrivateUsingGet({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v1ApiAppListPrivateUsingGetParams; + options?: { [key: string]: unknown }; +}) { + return request('/llmops/v1/api/app/list-private', { + method: 'GET', + params: { + ...params, + }, + ...(options || {}), + }); +} + +/** ListAppPublic 查询公共 app 列表 GET /llmops/v1/api/app/list-public */ +export async function v1ApiAppListPublicUsingGet({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v1ApiAppListPublicUsingGetParams; + options?: { [key: string]: unknown }; +}) { + return request('/llmops/v1/api/app/list-public', { + method: 'GET', + params: { + ...params, + }, + ...(options || {}), + }); +} +/* eslint-disable */ +// @ts-ignore +import { request } from 'axios'; + +import * as API from './types'; + +/** GetAppDatasetConfigsList 查询应用知识库查询配置 GET /llmops/v1/api/app/${param0}/dataset-configs */ +export async function v1ApiAppAppIdDatasetConfigsUsingGet({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v1ApiAppAppIdDatasetConfigsUsingGetParams; + options?: { [key: string]: unknown }; +}) { + const { appID: param0, ...queryParams } = params; + + return request( + `/llmops/v1/api/app/${param0}/dataset-configs`, + { + method: 'GET', + params: { ...queryParams }, + ...(options || {}), + } + ); +} + +/** UpdateAppDatasetConfigs 更新应用知识库查询配置 PUT /llmops/v1/api/app/${param0}/dataset-configs */ +export async function v1ApiAppAppIdDatasetConfigsUsingPut({ + params, + body, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v1ApiAppAppIdDatasetConfigsUsingPutParams; + body: API.AppDatasetConfigs; + options?: { [key: string]: unknown }; +}) { + const { appID: param0, ...queryParams } = params; + + return request(`/llmops/v1/api/app/${param0}/dataset-configs`, { + method: 'PUT', + params: { ...queryParams }, + data: body, + ...(options || {}), + }); +} + +/** CreateAppDatasetConfigs 创建应用知识库查询配置 POST /llmops/v1/api/app/${param0}/dataset-configs */ +export async function v1ApiAppAppIdDatasetConfigsUsingPost({ + params, + body, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v1ApiAppAppIdDatasetConfigsUsingPostParams; + body: API.AppDatasetConfigs; + options?: { [key: string]: unknown }; +}) { + const { appID: param0, ...queryParams } = params; + + return request(`/llmops/v1/api/app/${param0}/dataset-configs`, { + method: 'POST', + params: { ...queryParams }, + data: body, + ...(options || {}), + }); +} + +/** DeleteAppDatasetConfigs 删除应用知识库查询配置 DELETE /llmops/v1/api/app/${param0}/dataset-configs */ +export async function v1ApiAppAppIdDatasetConfigsUsingDelete({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v1ApiAppAppIdDatasetConfigsUsingDeleteParams; + options?: { [key: string]: unknown }; +}) { + const { appID: param0, ...queryParams } = params; + + return request(`/llmops/v1/api/app/${param0}/dataset-configs`, { + method: 'DELETE', + params: { + ...queryParams, + }, + ...(options || {}), + }); +} +/* eslint-disable */ +// @ts-ignore +import { request } from 'axios'; + +import * as API from './types'; + +/** ListMember app下的用户列表 GET /llmops/v1/api/app/${param0}/member */ +export async function v1ApiAppAppIdMemberUsingGet({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v1ApiAppAppIdMemberUsingGetParams; + options?: { [key: string]: unknown }; +}) { + const { appID: param0, ...queryParams } = params; + + return request(`/llmops/v1/api/app/${param0}/member`, { + method: 'GET', + params: { + ...queryParams, + }, + ...(options || {}), + }); +} + +/** AddMember 增加app用户 POST /llmops/v1/api/app/${param0}/member */ +export async function v1ApiAppAppIdMemberUsingPost({ + params, + body, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v1ApiAppAppIdMemberUsingPostParams; + body: API.MemberBody; + options?: { [key: string]: unknown }; +}) { + const { appID: param0, ...queryParams } = params; + + return request(`/llmops/v1/api/app/${param0}/member`, { + method: 'POST', + params: { ...queryParams }, + data: body, + ...(options || {}), + }); +} + +/** DeleteMember 删除app用户 DELETE /llmops/v1/api/app/${param0}/member */ +export async function v1ApiAppAppIdMemberUsingDelete({ + params, + body, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v1ApiAppAppIdMemberUsingDeleteParams; + body: API.DeleteMemberBody; + options?: { [key: string]: unknown }; +}) { + const { appID: param0, ...queryParams } = params; + + return request(`/llmops/v1/api/app/${param0}/member`, { + method: 'DELETE', + params: { ...queryParams }, + data: body, + ...(options || {}), + }); +} + +/** UpdateMemberRole 更新app用户角色 PUT /llmops/v1/api/app/${param0}/member-role */ +export async function v1ApiAppAppIdMemberRoleUsingPut({ + params, + body, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v1ApiAppAppIdMemberRoleUsingPutParams; + body: API.MemberBody; + options?: { [key: string]: unknown }; +}) { + const { appID: param0, ...queryParams } = params; + + return request(`/llmops/v1/api/app/${param0}/member-role`, { + method: 'PUT', + params: { ...queryParams }, + data: body, + ...(options || {}), + }); +} +/* eslint-disable */ +// @ts-ignore +import { request } from 'axios'; + +import * as API from './types'; + +/** UpdateModelConfigs 更新 app model configs PUT /llmops/v1/api/app/${param0}/model-configs */ +export async function v1ApiAppAppIdModelConfigsUsingPut({ + params, + body, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v1ApiAppAppIdModelConfigsUsingPutParams; + body: API.AppModelConfigs; + options?: { [key: string]: unknown }; +}) { + const { appID: param0, ...queryParams } = params; + + return request(`/llmops/v1/api/app/${param0}/model-configs`, { + method: 'PUT', + params: { ...queryParams }, + data: body, + ...(options || {}), + }); +} + +/** CreateOrUpdateModelConfigs 创建 app model configs POST /llmops/v1/api/app/${param0}/model-configs */ +export async function v1ApiAppAppIdModelConfigsUsingPost({ + params, + body, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v1ApiAppAppIdModelConfigsUsingPostParams; + body: API.AppModelConfigs; + options?: { [key: string]: unknown }; +}) { + const { appID: param0, ...queryParams } = params; + + return request(`/llmops/v1/api/app/${param0}/model-configs`, { + method: 'POST', + params: { ...queryParams }, + data: body, + ...(options || {}), + }); +} + +/** CreateOrUpdateModelConfigPromptPrefix 创建或修改角色和背景以及推荐问题开关 POST /llmops/v1/api/app/${param0}/model-prompt */ +export async function v1ApiAppAppIdModelPromptUsingPost({ + params, + body, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v1ApiAppAppIdModelPromptUsingPostParams; + body: API.AppModelConfigPromptPrefix; + options?: { [key: string]: unknown }; +}) { + const { appID: param0, ...queryParams } = params; + + return request(`/llmops/v1/api/app/${param0}/model-prompt`, { + method: 'POST', + params: { ...queryParams }, + data: body, + ...(options || {}), + }); +} + +/** GetPluginList 获取插件列表 PUT /llmops/v1/api/app/${param0}/plugin */ +export async function v1ApiAppAppIdPluginUsingPut({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v1ApiAppAppIdPluginUsingPutParams; + options?: { [key: string]: unknown }; +}) { + const { appID: param0, ...queryParams } = params; + + return request(`/llmops/v1/api/app/${param0}/plugin`, { + method: 'PUT', + params: { ...queryParams }, + ...(options || {}), + }); +} +/* eslint-disable */ +// @ts-ignore +import { request } from 'axios'; + +import * as API from './types'; + +/** CreateAppV2 创建 app POST /llmops/v2/api/app */ +export async function v2ApiAppUsingPost({ + body, + options, +}: { + body: API.CreateAppReqV2; + options?: { [key: string]: unknown }; +}) { + return request('/llmops/v2/api/app', { + method: 'POST', + data: body, + ...(options || {}), + }); +} + +/** GetAppDetailsV2 查询 app 详情 GET /llmops/v2/api/app/${param0}/details */ +export async function v2ApiAppAppIdDetailsUsingGet({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v2ApiAppAppIdDetailsUsingGetParams; + options?: { [key: string]: unknown }; +}) { + const { appID: param0, ...queryParams } = params; + + return request(`/llmops/v2/api/app/${param0}/details`, { + method: 'GET', + params: { ...queryParams }, + ...(options || {}), + }); +} + +/** UpdateAppV2 更新 app 信息 POST /llmops/v2/api/app/${param0}/update */ +export async function v2ApiAppAppIdUpdateUsingPost({ + params, + body, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v2ApiAppAppIdUpdateUsingPostParams; + body: API.UpdateAppReqV2; + options?: { [key: string]: unknown }; +}) { + const { appID: param0, ...queryParams } = params; + + return request(`/llmops/v2/api/app/${param0}/update`, { + method: 'POST', + params: { ...queryParams }, + data: body, + ...(options || {}), + }); +} + +/** ListAppV2 查询用户关联的 app 列表 GET /llmops/v2/api/app/list */ +export async function v2ApiAppListUsingGet({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v2ApiAppListUsingGetParams; + options?: { [key: string]: unknown }; +}) { + return request('/llmops/v2/api/app/list', { + method: 'GET', + params: { + ...params, + }, + ...(options || {}), + }); +} + +/** GetApiTokenV2 获取一个 app token GET /llmops/v2/api/app/share/api-token */ +export async function v2ApiAppShareApiTokenUsingGet({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v2ApiAppShareApiTokenUsingGetParams; + options?: { [key: string]: unknown }; +}) { + return request( + '/llmops/v2/api/app/share/api-token', + { + method: 'GET', + params: { + ...params, + }, + ...(options || {}), + } + ); +} +/* eslint-disable */ +// @ts-ignore +import { request } from 'axios'; + +import * as API from './types'; + +/** ListAttentionApp 应用列表 GET /llmops/v1/api/attention/app/list */ +export async function v1ApiAttentionAppListUsingGet({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v1ApiAttentionAppListUsingGetParams; + options?: { [key: string]: unknown }; +}) { + return request('/llmops/v1/api/attention/app/list', { + method: 'GET', + params: { + ...params, + }, + ...(options || {}), + }); +} + +/** ListAttentionConversations 查询会话列表 POST /llmops/v1/api/attention/conversations */ +export async function v1ApiAttentionConversationsUsingPost({ + body, + options, +}: { + body: API.ListAttentionConversationReq; + options?: { [key: string]: unknown }; +}) { + return request( + '/llmops/v1/api/attention/conversations', + { + method: 'POST', + data: body, + ...(options || {}), + } + ); +} + +/** GetAttentionConversationCount 获取对话数 POST /llmops/v1/api/attention/conversations/count */ +export async function v1ApiAttentionConversationsCountUsingPost({ + body, + options, +}: { + body: API.GetAttentionDataCountReq; + options?: { [key: string]: unknown }; +}) { + return request( + '/llmops/v1/api/attention/conversations/count', + { + method: 'POST', + data: body, + ...(options || {}), + } + ); +} + +/** GetAttentionMessagesCount 获取消息数 POST /llmops/v1/api/attention/messages/count */ +export async function v1ApiAttentionMessagesCountUsingPost({ + body, + options, +}: { + body: API.GetAttentionDataCountReq; + options?: { [key: string]: unknown }; +}) { + return request( + '/llmops/v1/api/attention/messages/count', + { + method: 'POST', + data: body, + ...(options || {}), + } + ); +} + +/** GetAttentionMessagesHistory 获取聊天历史 GET /llmops/v1/api/attention/messages/history */ +export async function v1ApiAttentionMessagesHistoryUsingGet({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v1ApiAttentionMessagesHistoryUsingGetParams; + options?: { [key: string]: unknown }; +}) { + return request( + '/llmops/v1/api/attention/messages/history', + { + method: 'GET', + params: { + ...params, + }, + ...(options || {}), + } + ); +} + +/** CreateAttentionUser 添加特别关注 POST /llmops/v1/api/attention/user */ +export async function v1ApiAttentionUserUsingPost({ + body, + options, +}: { + body: API.CreateAttentionReq; + options?: { [key: string]: unknown }; +}) { + return request('/llmops/v1/api/attention/user', { + method: 'POST', + data: body, + ...(options || {}), + }); +} + +/** ListAllUser 系统全局用户列表 GET /llmops/v1/api/attention/user/all */ +export async function v1ApiAttentionUserAllUsingGet({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v1ApiAttentionUserAllUsingGetParams; + options?: { [key: string]: unknown }; +}) { + return request( + '/llmops/v1/api/attention/user/all', + { + method: 'GET', + params: { + // size has a default value: 10 + size: '10', + + ...params, + }, + ...(options || {}), + } + ); +} + +/** DeleteAttentionUser 取消特别关注 POST /llmops/v1/api/attention/user/cancel */ +export async function v1ApiAttentionUserCancelUsingPost({ + body, + options, +}: { + body: API.DeleteAttentionReq; + options?: { [key: string]: unknown }; +}) { + return request('/llmops/v1/api/attention/user/cancel', { + method: 'POST', + data: body, + ...(options || {}), + }); +} + +/** GetAttentionUserList 查询特别关注列表 POST /llmops/v1/api/attention/user/list */ +export async function v1ApiAttentionUserListUsingPost({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v1ApiAttentionUserListUsingPostParams; + options?: { [key: string]: unknown }; +}) { + return request( + '/llmops/v1/api/attention/user/list', + { + method: 'POST', + params: { + ...params, + }, + ...(options || {}), + } + ); +} +/* eslint-disable */ +// @ts-ignore +import { request } from 'axios'; + +import * as API from './types'; + +/** Authorize 获取code的跳转 GET /llmops/auth/authorize */ +export async function authAuthorizeUsingGet({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.authAuthorizeUsingGetParams; + options?: { [key: string]: unknown }; +}) { + return request('/llmops/auth/authorize', { + method: 'GET', + params: { + ...params, + }, + ...(options || {}), + }); +} +/* eslint-disable */ +// @ts-ignore +import { request } from 'axios'; + +import * as API from './types'; + +/** Messages Messages POST /llmops/v1/api/chat-messages */ +export async function v1ApiChatMessagesUsingPost({ + body, + options, +}: { + body: API.Chat; + options?: { [key: string]: unknown }; +}) { + return request('/llmops/v1/api/chat-messages', { + method: 'POST', + headers: { + 'Content-Type': 'application/json', + }, + data: body, + ...(options || {}), + }); +} + +/** WebMessages 分享页的聊天 POST /llmops/v1/api/chat-messages-web */ +export async function v1ApiChatMessagesWebUsingPost({ + body, + options, +}: { + body: API.Chat; + options?: { [key: string]: unknown }; +}) { + return request('/llmops/v1/api/chat-messages-web', { + method: 'POST', + headers: { + 'Content-Type': 'application/json', + }, + data: body, + ...(options || {}), + }); +} + +/** ChatMessage ChatMessage POST /llmops/v1/api/chat-messages/gpt */ +export async function v1ApiChatMessagesGptUsingPost({ + body, + options, +}: { + body: API.ChatMessageReq; + options?: { [key: string]: unknown }; +}) { + return request( + '/llmops/v1/api/chat-messages/gpt', + { + method: 'POST', + headers: { + 'Content-Type': 'application/json', + }, + data: body, + ...(options || {}), + } + ); +} + +/** QuestionRecommend QuestionRecommend POST /llmops/v1/api/chat-messages/question-recommend */ +export async function v1ApiChatMessagesQuestionRecommendUsingPost({ + body, + options, +}: { + body: API.QuestionRecommendReq; + options?: { [key: string]: unknown }; +}) { + return request( + '/llmops/v1/api/chat-messages/question-recommend', + { + method: 'POST', + headers: { + 'Content-Type': 'application/json', + }, + data: body, + ...(options || {}), + } + ); +} + +/** V2Messages 用于微精灵聊天的v2版本 POST /llmops/v2/api/chat-messages */ +export async function v2ApiChatMessagesUsingPost({ + body, + options, +}: { + body: API.Chat; + options?: { [key: string]: unknown }; +}) { + return request('/llmops/v2/api/chat-messages', { + method: 'POST', + headers: { + 'Content-Type': 'application/json', + }, + data: body, + ...(options || {}), + }); +} +/* eslint-disable */ +// @ts-ignore +import { request } from 'axios'; + +import * as API from './types'; + +/** ConversationList 会话历史 GET /llmops/v1/api/conversations */ +export async function v1ApiConversationsUsingGet({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v1ApiConversationsUsingGetParams; + options?: { [key: string]: unknown }; +}) { + return request('/llmops/v1/api/conversations', { + method: 'GET', + params: { + ...params, + }, + ...(options || {}), + }); +} + +/** DeleteConversation 删除会话 DELETE /llmops/v1/api/conversations */ +export async function v1ApiConversationsUsingDelete({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v1ApiConversationsUsingDeleteParams; + options?: { [key: string]: unknown }; +}) { + return request('/llmops/v1/api/conversations', { + method: 'DELETE', + params: { + ...params, + }, + ...(options || {}), + }); +} +/* eslint-disable */ +// @ts-ignore +import { request } from 'axios'; + +import * as API from './types'; + +/** CreateFeedbacks CreateFeedbacks POST /llmops/v1/api/feedbacks/${param0} */ +export async function v1ApiFeedbacksMessageIdUsingPost({ + params, + body, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v1ApiFeedbacksMessageIdUsingPostParams; + body: API.FeedbacksReqBody; + options?: { [key: string]: unknown }; +}) { + const { message_id: param0, ...queryParams } = params; + + return request( + `/llmops/v1/api/feedbacks/${param0}`, + { + method: 'POST', + headers: { + 'Content-Type': 'application/json', + }, + params: { ...queryParams }, + data: body, + ...(options || {}), + } + ); +} +/* eslint-disable */ +// @ts-ignore +import { request } from 'axios'; + +import * as API from './types'; + +/** CreateDatasetsJoin 创建 app 数据集关联 POST /llmops/v1/api/app/${param0}/datasets */ +export async function v1ApiAppAppIdDatasetsUsingPost({ + params, + body, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v1ApiAppAppIdDatasetsUsingPostParams; + body: API.V1ApiAppAppIdDatasetsUsingPostBody; + options?: { [key: string]: unknown }; +}) { + const { appID: param0, ...queryParams } = params; + + return request(`/llmops/v1/api/app/${param0}/datasets`, { + method: 'POST', + params: { ...queryParams }, + data: body, + ...(options || {}), + }); +} + +/** DeleteDatasetsJoin 删除 app 数据集关联 DELETE /llmops/v1/api/app/${param0}/datasets */ +export async function v1ApiAppAppIdDatasetsUsingDelete({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v1ApiAppAppIdDatasetsUsingDeleteParams; + options?: { [key: string]: unknown }; +}) { + const { appID: param0, ...queryParams } = params; + + return request(`/llmops/v1/api/app/${param0}/datasets`, { + method: 'DELETE', + params: { + ...queryParams, + }, + ...(options || {}), + }); +} +/* eslint-disable */ +// @ts-ignore +import { request } from 'axios'; + +import * as API from './types'; + +/** GetDatasetsList 数据集列表 GET /llmops/v1/api/app/${param0}/datasets-list */ +export async function v1ApiAppAppIdDatasetsListUsingGet({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v1ApiAppAppIdDatasetsListUsingGetParams; + options?: { [key: string]: unknown }; +}) { + const { appID: param0, ...queryParams } = params; + + return request( + `/llmops/v1/api/app/${param0}/datasets-list`, + { + method: 'GET', + params: { + ...queryParams, + }, + ...(options || {}), + } + ); +} +/* eslint-disable */ +// @ts-ignore +import { request } from 'axios'; + +import * as API from './types'; + +/** DeleteFeedbacks DeleteFeedbacks DELETE /llmops/v1/api/feedbacks/${param0} */ +export async function v1ApiFeedbacksMessageIdUsingDelete({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v1ApiFeedbacksMessageIdUsingDeleteParams; + options?: { [key: string]: unknown }; +}) { + const { message_id: param0, ...queryParams } = params; + + return request( + `/llmops/v1/api/feedbacks/${param0}`, + { + method: 'DELETE', + params: { + ...queryParams, + }, + ...(options || {}), + } + ); +} +/* eslint-disable */ +// @ts-ignore +import { request } from 'axios'; + +import * as API from './types'; + +/** DeleteKey 为应用添加各种类型机器人appkey DELETE /llmops/v1/api/robot/${param0}/appkey */ +export async function v1ApiRobotWorkspaceIdAppkeyUsingDelete({ + params, + body, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v1ApiRobotWorkspaceIdAppkeyUsingDeleteParams; + body: API.GetAppKeyReq; + options?: { [key: string]: unknown }; +}) { + const { workspaceID: param0, ...queryParams } = params; + + return request(`/llmops/v1/api/robot/${param0}/appkey`, { + method: 'DELETE', + params: { ...queryParams }, + data: body, + ...(options || {}), + }); +} +/* eslint-disable */ +// @ts-ignore +import * as API from './types'; + +export function displayPermissionEnum(field: API.Permission) { + return { + read_only: '只读权限', + operation: '操作权限', + no_permission: '无权限', + }[field]; +} + +export function displayProviderTypeEnum(field: API.ProviderType) { + return { + openai: 'openai', + spark: 'spark', + wenxin: 'wenxin', + rockai: 'rockai', + }[field]; +} + +export function displayRbacRoleEnum(field: API.RbacRole) { + return { + system_admin: '系统管理员', + system_user: '系统普通用户', + app_admin: 'app超管用户', + app_user: 'app普通用户', + }[field]; +} + +export function displayWorkspaceRoleEnum(field: API.WorkspaceRole) { + return { workspace_admin: '空间超管用户', workspace_user: '空间普通用户' }[ + field + ]; +} +/* eslint-disable */ +// @ts-ignore +import { request } from 'axios'; + +import * as API from './types'; + +/** Exchange 换取token GET /llmops/auth/exchange */ +export async function authExchangeUsingGet({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.authExchangeUsingGetParams; + options?: { [key: string]: unknown }; +}) { + return request('/llmops/auth/exchange', { + method: 'GET', + params: { + ...params, + }, + ...(options || {}), + }); +} +/* eslint-disable */ +// @ts-ignore +import { request } from 'axios'; + +import * as API from './types'; + +/** Filestream 上传文件 POST /llmops/v1/api/file */ +export async function v1ApiFileUsingPost({ + params, + body, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v1ApiFileUsingPostParams; + body: API.V1ApiFileUsingPostBody; + options?: { [key: string]: unknown }; +}) { + return request('/llmops/v1/api/file', { + method: 'POST', + headers: { + 'Content-Type': 'application/json', + }, + params: { + ...params, + }, + data: body, + ...(options || {}), + }); +} + +/** SpeechToText 语音转文字 POST /llmops/v1/api/speech_to_text */ +export async function v1ApiSpeechToTextUsingPost({ + body, + options, +}: { + body: API.V1ApiSpeechToTextUsingPostBody; + options?: { [key: string]: unknown }; +}) { + return request('/llmops/v1/api/speech_to_text', { + method: 'POST', + headers: { + 'Content-Type': 'application/json', + }, + data: body, + ...(options || {}), + }); +} + +/** TextToSpeech 文字转语音 POST /llmops/v1/api/text_to_speech */ +export async function v1ApiTextToSpeechUsingPost({ + body, + options, +}: { + body: API.TextToSpeechReq; + options?: { [key: string]: unknown }; +}) { + return request('/llmops/v1/api/text_to_speech', { + method: 'POST', + headers: { + 'Content-Type': 'application/json', + }, + data: body, + ...(options || {}), + }); +} + +/** 上传文件V2接口 上传文件V2接口用于向服务器提交文件。 POST /llmops/v2/api/file */ +export async function v2ApiFileUsingPost({ + params, + body, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v2ApiFileUsingPostParams; + body: API.V2ApiFileUsingPostBody; + options?: { [key: string]: unknown }; +}) { + const formData = new FormData(); + + Object.keys(body).forEach((ele) => { + const item = (body as { [key: string]: any })[ele]; + + if (item !== undefined && item !== null) { + if (typeof item === 'object' && !(item instanceof File)) { + if (item instanceof Array) { + item.forEach((f) => formData.append(ele, f || '')); + } else { + formData.append(ele, JSON.stringify(item)); + } + } else { + formData.append(ele, item); + } + } + }); + + return request('/llmops/v2/api/file', { + method: 'POST', + headers: { + 'Content-Type': 'multipart/form-data', + }, + params: { + ...params, + }, + data: formData, + ...(options || {}), + }); +} +/* eslint-disable */ +// @ts-ignore +import { request } from 'axios'; + +import * as API from './types'; + +/** GetAppKey 为应用获取各种类型机器人appkey GET /llmops/v1/api/robot/${param0}/appkey */ +export async function v1ApiRobotWorkspaceIdAppkeyUsingGet({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v1ApiRobotWorkspaceIdAppkeyUsingGetParams; + options?: { [key: string]: unknown }; +}) { + const { workspaceID: param0, ...queryParams } = params; + + return request(`/llmops/v1/api/robot/${param0}/appkey`, { + method: 'GET', + params: { + ...queryParams, + }, + ...(options || {}), + }); +} +/* eslint-disable */ +// @ts-ignore +import { request } from 'axios'; + +import * as API from './types'; + +/** History 会话历史 GET /llmops/v1/api/conversations/${param0}/history */ +export async function v1ApiConversationsConversationIdHistoryUsingGet({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v1ApiConversationsConversationIdHistoryUsingGetParams; + options?: { [key: string]: unknown }; +}) { + const { conversation_id: param0, ...queryParams } = params; + + return request( + `/llmops/v1/api/conversations/${param0}/history`, + { + method: 'GET', + params: { ...queryParams }, + ...(options || {}), + } + ); +} + +/** DeleteHistory 会话历史 DELETE /llmops/v1/api/conversations/${param0}/history */ +export async function v1ApiConversationsConversationIdHistoryUsingDelete({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v1ApiConversationsConversationIdHistoryUsingDeleteParams; + options?: { [key: string]: unknown }; +}) { + const { conversation_id: param0, ...queryParams } = params; + + return request( + `/llmops/v1/api/conversations/${param0}/history`, + { + method: 'DELETE', + params: { + ...queryParams, + }, + ...(options || {}), + } + ); +} + +/** GetMessageCount 用于微精灵获取消息数的v2版本 GET /llmops/v2/api/chat-messages/messagesCount */ +export async function v2ApiChatMessagesMessagesCountUsingGet({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v2ApiChatMessagesMessagesCountUsingGetParams; + options?: { [key: string]: unknown }; +}) { + return request( + '/llmops/v2/api/chat-messages/messagesCount', + { + method: 'GET', + params: { + ...params, + }, + ...(options || {}), + } + ); +} +/* eslint-disable */ +// @ts-ignore +import { request } from 'axios'; + +import * as API from './types'; + +/** GetIamUserId 查询 IAM 用户信息 GET /llmops/v1/api/iamAccount */ +export async function v1ApiIamAccountUsingGet({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v1ApiIamAccountUsingGetParams; + options?: { [key: string]: unknown }; +}) { + return request('/llmops/v1/api/iamAccount', { + method: 'GET', + params: { + ...params, + }, + ...(options || {}), + }); +} +/* eslint-disable */ +// @ts-ignore +export * from './types'; +export * from './displayEnumLabel'; + +export * from './schema'; + +export * from './authorize'; +export * from './exchange'; +export * from './refreshToken'; +export * from './app'; +export * from './share'; +export * from './apiToken'; +export * from './appDatasetConfigs'; +export * from './datasetsJoin'; +export * from './datasetsList'; +export * from './appMember'; +export * from './appModelConfigs'; +export * from './recommended'; +export * from './attention'; +export * from './chat'; +export * from './conversation'; +export * from './history'; +export * from './listFeedbacks'; +export * from './createFeedbacks'; +export * from './deleteFeedbacks'; +export * from './files'; +export * from './iam'; +export * from './provider'; +export * from './getAppKey'; +export * from './addAppKey'; +export * from './deleteKey'; +export * from './updateAppKeyState'; +export * from './user'; +export * from './appV2'; +export * from './workspaceAppV2'; +export * from './workspace'; +export * from './workspaceGroup'; +/* eslint-disable */ +// @ts-ignore +import { request } from 'axios'; + +import * as API from './types'; + +/** ListFeedbacks ListFeedbacks GET /llmops/v1/api/feedbacks/ */ +export async function v1ApiFeedbacksUsingGet({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v1ApiFeedbacksUsingGetParams; + options?: { [key: string]: unknown }; +}) { + return request('/llmops/v1/api/feedbacks/', { + method: 'GET', + params: { + ...params, + }, + ...(options || {}), + }); +} +/* eslint-disable */ +// @ts-ignore +import { request } from 'axios'; + +import * as API from './types'; + +/** ListProviders 查询 Provider 列表 GET /llmops/v1/api/provider/list */ +export async function v1ApiProviderListUsingGet({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v1ApiProviderListUsingGetParams; + options?: { [key: string]: unknown }; +}) { + return request('/llmops/v1/api/provider/list', { + method: 'GET', + params: { + ...params, + }, + ...(options || {}), + }); +} +/* eslint-disable */ +// @ts-ignore +import { request } from 'axios'; + +import * as API from './types'; + +/** ListRecommendedContext 查询推荐内容列表 GET /llmops/v1/api/app/${param0}/recommended/context */ +export async function v1ApiAppAppIdRecommendedContextUsingGet({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v1ApiAppAppIdRecommendedContextUsingGetParams; + options?: { [key: string]: unknown }; +}) { + const { appID: param0, ...queryParams } = params; + + return request( + `/llmops/v1/api/app/${param0}/recommended/context`, + { + method: 'GET', + params: { ...queryParams }, + ...(options || {}), + } + ); +} + +/** CreateOrUpdateRecommendedContext 创建或更新推荐内容列表 POST /llmops/v1/api/app/${param0}/recommended/context */ +export async function v1ApiAppAppIdRecommendedContextUsingPost({ + params, + body, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v1ApiAppAppIdRecommendedContextUsingPostParams; + body: API.AppRecommendedContext; + options?: { [key: string]: unknown }; +}) { + const { appID: param0, ...queryParams } = params; + + return request(`/llmops/v1/api/app/${param0}/recommended/context`, { + method: 'POST', + params: { ...queryParams }, + data: body, + ...(options || {}), + }); +} +/* eslint-disable */ +// @ts-ignore +import { request } from 'axios'; + +import * as API from './types'; + +/** RefreshToken 刷新token POST /llmops/auth/refresh-token */ +export async function authRefreshTokenUsingPost({ + body, + options, +}: { + body: API.RefreshTokenBody; + options?: { [key: string]: unknown }; +}) { + return request('/llmops/auth/refresh-token', { + method: 'POST', + data: body, + ...(options || {}), + }); +} +export const $GetImagePreSignedUrlResp = { + properties: { + appImage: { type: 'string' }, + preSignedPutUrl: { type: 'string' }, + }, + type: 'object', + isAllowed: true, +}; + +export const $ConversationMsg = { + properties: { + conversationId: { type: 'string' }, + createAt: { type: 'string' }, + name: { type: 'string' }, + userId: { type: 'string' }, + }, + type: 'object', + isAllowed: true, +}; + +export const $CreateFeedbacksResp = { type: 'object', isAllowed: true }; + +export const $DeleteFeedbacksResp = { type: 'object', isAllowed: true }; + +export const $HistoryInfo = { + properties: { + Rating: { description: 'like/unlike', type: 'string' }, + answer: { type: 'string' }, + answerToken: { type: 'integer' }, + comment: { description: '评论', type: 'string' }, + createAt: { type: 'string' }, + format: { items: { type: 'string' }, type: 'array' }, + messageId: { type: 'string' }, + query: { type: 'string' }, + queryToken: { type: 'integer' }, + score: { description: '打分', type: 'integer' }, + totalToken: { type: 'integer' }, + }, + type: 'object', + isAllowed: true, +}; + +export const $ApiToken = { + properties: { + apiTokenID: { type: 'string' }, + appID: { type: 'string' }, + createdAt: { type: 'string' }, + token: { type: 'string' }, + updatedAt: { type: 'string' }, + }, + type: 'object', + isAllowed: true, +}; + +export const $ApiTokenDataList = { + properties: { + data: { + items: { + properties: { + apiTokenID: { type: 'string' }, + appID: { type: 'string' }, + createdAt: { type: 'string' }, + token: { type: 'string' }, + updatedAt: { type: 'string' }, + }, + type: 'object', + isAllowed: true, + 'x-id': 'database.ApiToken', + }, + type: 'array', + }, + total: { type: 'integer' }, + }, + type: 'object', + isAllowed: true, +}; + +export const $App = { + properties: { + appID: { type: 'string' }, + appImage: { type: 'integer' }, + appStatus: { type: 'string' }, + appType: { description: '应用类型', type: 'integer' }, + createdAt: { type: 'string' }, + description: { type: 'string' }, + groupID: { type: 'string' }, + guidance: { + description: '开场提问引导', + type: 'object', + additionalProperties: true, + isAllowed: true, + 'x-id': 'git_querycap_com_devops_srv-llmops_internal_database.Map', + }, + name: { type: 'string' }, + operator: { type: 'string' }, + priority: { description: '应用优先级', type: 'integer' }, + prologue: { type: 'string' }, + recommendSwitch: { + type: 'string', + 'x-enum-comments': { BOOL_FALSE: 'false', BOOL_TRUE: 'true' }, + 'x-enum-varnames': ['BOOL_UNKNOWN', 'BOOL_TRUE', 'BOOL_FALSE'], + isAllowed: true, + 'x-id': 'github_com_go-courier_sqlx_v2_datatypes.Bool', + }, + templateStatus: { description: '是否模版', type: 'string' }, + updatedAt: { type: 'string' }, + workspaceID: { type: 'string' }, + }, + type: 'object', + isAllowed: true, +}; + +export const $AppDatasetConfig = { + properties: { + appDatasetConfigID: { type: 'string' }, + appID: { type: 'string' }, + createdAt: { type: 'string' }, + minScore: { type: 'number' }, + searchSource: { type: 'string' }, + timeoutSecond: { type: 'integer' }, + topK: { type: 'integer' }, + updatedAt: { type: 'string' }, + }, + type: 'object', + isAllowed: true, +}; + +export const $AppRecommendedContext = { + properties: { + appID: { type: 'string' }, + appRecommendedContextID: { type: 'string' }, + context: { type: 'string' }, + createdAt: { type: 'string' }, + description: { type: 'string' }, + name: { type: 'string' }, + updatedAt: { type: 'string' }, + }, + type: 'object', + isAllowed: true, +}; + +export const $Guidances = { + properties: { items: { items: { type: 'string' }, type: 'array' } }, + type: 'object', + isAllowed: true, +}; + +export const $ListWorkspaceGroup = { + properties: { + data: { + items: { + properties: { + createdAt: { type: 'string' }, + name: { description: '分组名', type: 'string' }, + updatedAt: { type: 'string' }, + workspaceGroupID: { type: 'string' }, + workspaceID: { type: 'string' }, + }, + type: 'object', + isAllowed: true, + 'x-id': 'database.WorkspaceGroup', + }, + type: 'array', + }, + }, + type: 'object', + isAllowed: true, +}; + +export const $User = { + properties: { + createdAt: { type: 'string' }, + email: { type: 'string' }, + idpID: { type: 'string' }, + operator: { type: 'string' }, + phone: { type: 'string' }, + role: { + description: '角色(系统管理员、系统普通用户)', + type: 'string', + enum: ['system_admin', 'system_user', 'app_admin', 'app_user'], + 'x-enum-comments': { + AppAdmin: 'app超管用户', + AppUser: 'app普通用户', + SystemAdmin: '系统管理员', + SystemUser: '系统普通用户', + }, + 'x-enum-varnames': ['SystemAdmin', 'SystemUser', 'AppAdmin', 'AppUser'], + isAllowed: true, + 'x-id': 'enum.RbacRole', + }, + updatedAt: { type: 'string' }, + userID: { description: 'iam 用户id', type: 'string' }, + userName: { type: 'string' }, + }, + type: 'object', + isAllowed: true, +}; + +export const $WorkspaceGroup = { + properties: { + createdAt: { type: 'string' }, + name: { description: '分组名', type: 'string' }, + updatedAt: { type: 'string' }, + workspaceGroupID: { type: 'string' }, + workspaceID: { type: 'string' }, + }, + type: 'object', + isAllowed: true, +}; + +export const $DatasetData = { + properties: { + author: { type: 'string' }, + description: { type: 'string' }, + docCount: { type: 'integer' }, + document_count: { type: 'integer' }, + id: { type: 'string' }, + name: { type: 'string' }, + permission: { type: 'string' }, + state: { type: 'string' }, + uuid: { type: 'string' }, + word_count: { type: 'integer' }, + }, + type: 'object', + isAllowed: true, +}; + +export const $ListDatasetsResp = { + properties: { + data: { + items: { + properties: { + author: { type: 'string' }, + description: { type: 'string' }, + docCount: { type: 'integer' }, + document_count: { type: 'integer' }, + id: { type: 'string' }, + name: { type: 'string' }, + permission: { type: 'string' }, + state: { type: 'string' }, + uuid: { type: 'string' }, + word_count: { type: 'integer' }, + }, + type: 'object', + isAllowed: true, + 'x-id': 'datasets.DatasetData', + }, + type: 'array', + }, + has_more: { type: 'boolean' }, + offset: { type: 'integer' }, + size: { type: 'integer' }, + total: { type: 'integer' }, + }, + type: 'object', + isAllowed: true, +}; + +export const $Permission = { + enum: ['read_only', 'operation', 'no_permission'], + type: 'string', + 'x-enum-comments': { + NoPermission: '无权限', + Operation: '操作权限', + ReadOnly: '只读权限', + }, + 'x-enum-varnames': ['ReadOnly', 'Operation', 'NoPermission'], + isAllowed: true, +}; + +export const $ProviderType = { + enum: ['openai', 'spark', 'wenxin', 'rockai'], + type: 'string', + 'x-enum-varnames': ['OpenAI', 'Spark', 'WenXin', 'RockAI'], + isAllowed: true, +}; + +export const $RbacRole = { + enum: ['system_admin', 'system_user', 'app_admin', 'app_user'], + type: 'string', + 'x-enum-comments': { + AppAdmin: 'app超管用户', + AppUser: 'app普通用户', + SystemAdmin: '系统管理员', + SystemUser: '系统普通用户', + }, + 'x-enum-varnames': ['SystemAdmin', 'SystemUser', 'AppAdmin', 'AppUser'], + isAllowed: true, +}; + +export const $WorkspaceRole = { + enum: ['workspace_admin', 'workspace_user'], + type: 'string', + 'x-enum-comments': { + WorkspaceAdmin: '空间超管用户', + WorkspaceUser: '空间普通用户', + }, + 'x-enum-varnames': ['WorkspaceAdmin', 'WorkspaceUser'], + isAllowed: true, +}; + +export const $FilestreamResp = { + properties: { conversation_id: { type: 'string' } }, + type: 'object', + isAllowed: true, +}; + +export const $SpeechToTextResp = { + properties: { text: { description: '转化的结果', type: 'string' } }, + type: 'object', + isAllowed: true, +}; + +export const $TextToSpeechReq = { + properties: { text: { description: '需要转的文字', type: 'string' } }, + type: 'object', + isAllowed: true, +}; + +export const $Feedback = { + properties: { + comment: { description: '评论', type: 'string' }, + conversation_id: { type: 'string' }, + createdAt: { type: 'string' }, + message_id: { type: 'string' }, + rating: { description: 'like/unlike', type: 'string' }, + score: { description: '打分', type: 'integer' }, + updatedAt: { type: 'string' }, + }, + type: 'object', + isAllowed: true, +}; + +export const $Map = { + additionalProperties: true, + type: 'object', + isAllowed: true, +}; + +export const $Bool = { + type: 'string', + 'x-enum-comments': { BOOL_FALSE: 'false', BOOL_TRUE: 'true' }, + 'x-enum-varnames': ['BOOL_UNKNOWN', 'BOOL_TRUE', 'BOOL_FALSE'], + isAllowed: true, +}; + +export const $Chat = { + properties: { + conversation_id: { type: 'string' }, + inputs: { type: 'object' }, + isIgnore: { type: 'boolean' }, + query: { type: 'string' }, + response_mode: { type: 'string' }, + user: { type: 'string' }, + }, + type: 'object', + isAllowed: true, +}; + +export const $ChatMessageReq = { + properties: { prompt: { type: 'string' }, query: { type: 'string' } }, + type: 'object', + isAllowed: true, +}; + +export const $FeedbacksReqBody = { + properties: { + comment: { description: '评论', type: 'string' }, + conversation_id: { type: 'string' }, + rating: { description: 'like/unlike', type: 'string' }, + score: { description: '分数1-10', type: 'integer' }, + }, + type: 'object', + isAllowed: true, +}; + +export const $ListFeedbacksResp = { + properties: { + data: { + items: { + properties: { + comment: { description: '评论', type: 'string' }, + conversation_id: { type: 'string' }, + createdAt: { type: 'string' }, + message_id: { type: 'string' }, + rating: { description: 'like/unlike', type: 'string' }, + score: { description: '打分', type: 'integer' }, + updatedAt: { type: 'string' }, + }, + type: 'object', + isAllowed: true, + 'x-id': 'git_querycap_com_devops_srv-llmops_internal_database.Feedback', + }, + type: 'array', + }, + total: { type: 'integer' }, + }, + type: 'object', + isAllowed: true, +}; + +export const $QuestionRecommendReq = { + properties: { + conversation_id: { type: 'string' }, + user: { + description: + 'Query string `json:"query"`\nAnswer string `json:"answer"`', + type: 'string', + }, + }, + type: 'object', + isAllowed: true, +}; + +export const $ResponseData = { + properties: { + answer: { type: 'string' }, + conversation_id: { type: 'string' }, + created_at: { type: 'integer' }, + event: { type: 'string' }, + id: { type: 'string' }, + trace_id: { type: 'string' }, + }, + type: 'object', + isAllowed: true, +}; + +export const $ResponseRecommendData = { + properties: { + answer: { type: 'string' }, + conversation_id: { type: 'string' }, + created_at: { type: 'integer' }, + event: { type: 'string' }, + id: { type: 'string' }, + trace_id: { type: 'string' }, + }, + type: 'object', + isAllowed: true, +}; + +export const $AppDataset = { + properties: { + description: { description: '描述', type: 'string' }, + llmDesc: { description: 'llm描述', type: 'string' }, + name: { description: '知识库名', type: 'string' }, + }, + type: 'object', + isAllowed: true, +}; + +export const $AppDatasetConfigs = { + properties: { + minScore: { description: '最低分数', type: 'number' }, + searchSource: { description: '知识库源,默认 warehouse', type: 'string' }, + timeoutSecond: { description: '知识库查询超时时间', type: 'integer' }, + topK: { description: '知识库条数', type: 'integer' }, + }, + type: 'object', + isAllowed: true, +}; + +export const $AppModelConfigPromptPrefix = { + properties: { + background: { type: 'string' }, + role: { type: 'string' }, + switchRecommendedQuestion: { type: 'boolean' }, + }, + type: 'object', + isAllowed: true, +}; + +export const $AppModelConfigs = { + properties: { + configs: { + properties: { + model_type: { + description: + '模型(ERNIE-Bot-4;ERNIE-Bot;ERNIE-Bot-turbo;gpt-3.5-turbo-16k;gpt-4-1106-preview)', + type: 'string', + }, + penalty_score: { + description: + '通过对已生成的token增加惩罚,减少重复生成的现象。取值范围:[1.0, 2.0]', + type: 'number', + }, + temperature: { + description: + '较高的数值会使输出更加随机,而较低的数值会使其更加集中和确定。默认0.95,范围 (0, 1.0]', + type: 'number', + }, + tools_call: { description: 'tools call', type: 'boolean' }, + top_p: { + description: + '影响输出文本的多样性,取值越大,生成文本的多样性越强。取值范围 [0, 1.0]', + type: 'number', + }, + }, + type: 'object', + isAllowed: true, + 'x-id': 'request.ModelConfigsMap', + }, + prePrompt: { type: 'string' }, + providerId: { type: 'string' }, + }, + type: 'object', + isAllowed: true, +}; + +export const $AppRecommendedContext2 = { + properties: { + context: { type: 'string' }, + description: { type: 'string' }, + id: { type: 'string' }, + name: { type: 'string' }, + }, + type: 'object', + isAllowed: true, +}; + +export const $CopyAppReq = { + properties: { appID: { type: 'string' }, workspaceID: { type: 'string' } }, + type: 'object', + isAllowed: true, +}; + +export const $CreateAppReq = { + properties: { + description: { type: 'string' }, + guidance: { + properties: { items: { items: { type: 'string' }, type: 'array' } }, + type: 'object', + isAllowed: true, + 'x-id': 'database.Guidances', + }, + name: { type: 'string' }, + prologue: { type: 'string' }, + }, + type: 'object', + isAllowed: true, +}; + +export const $CreateAppReqV2 = { + properties: { + appDescription: { type: 'string' }, + appGroupID: { type: 'string' }, + appGuidance: { + description: '提示查询', + type: 'object', + properties: { items: { items: { type: 'string' }, type: 'array' } }, + isAllowed: true, + 'x-id': 'database.Guidances', + }, + appImage: { type: 'string' }, + appName: { type: 'string' }, + appPrologue: { description: '开场白', type: 'string' }, + historyLimit: { type: 'integer' }, + modelConfigs: { + properties: { + model_type: { + description: + '模型(ERNIE-Bot-4;ERNIE-Bot;ERNIE-Bot-turbo;gpt-3.5-turbo-16k;gpt-4-1106-preview)', + type: 'string', + }, + penalty_score: { + description: + '通过对已生成的token增加惩罚,减少重复生成的现象。取值范围:[1.0, 2.0]', + type: 'number', + }, + temperature: { + description: + '较高的数值会使输出更加随机,而较低的数值会使其更加集中和确定。默认0.95,范围 (0, 1.0]', + type: 'number', + }, + tools_call: { description: 'tools call', type: 'boolean' }, + top_p: { + description: + '影响输出文本的多样性,取值越大,生成文本的多样性越强。取值范围 [0, 1.0]', + type: 'number', + }, + }, + type: 'object', + isAllowed: true, + 'x-id': 'request.ModelConfigsMap', + }, + prePrompt: { type: 'string' }, + providerId: { type: 'string' }, + }, + type: 'object', + isAllowed: true, +}; + +export const $CreateAttentionReq = { + properties: { + followeeUserIDList: { items: { type: 'string' }, type: 'array' }, + iamID: { type: 'string' }, + }, + type: 'object', + isAllowed: true, +}; + +export const $DeleteAttentionReq = { + properties: { + followeeUserIDList: { items: { type: 'string' }, type: 'array' }, + iamID: { type: 'string' }, + }, + type: 'object', + isAllowed: true, +}; + +export const $DeleteMemberBody = { + properties: { userID: { description: '用户id', type: 'string' } }, + type: 'object', + isAllowed: true, +}; + +export const $GetAttentionDataCountReq = { + properties: { + appIDList: { items: { type: 'string' }, type: 'array' }, + iamID: { type: 'string' }, + userID: { type: 'string' }, + }, + type: 'object', + isAllowed: true, +}; + +export const $ListAttentionConversationReq = { + properties: { + appIDList: { items: { type: 'string' }, type: 'array' }, + iamID: { type: 'string' }, + offset: { type: 'integer' }, + size: { type: 'integer' }, + userID: { type: 'string' }, + }, + type: 'object', + isAllowed: true, +}; + +export const $MemberBody = { + properties: { + role: { + description: + '角色(system_admin-系统管理员;system_user-系统管普通用户;app_admin-应用管理员;app_user-应用普通用户)', + type: 'string', + enum: ['system_admin', 'system_user', 'app_admin', 'app_user'], + 'x-enum-comments': { + AppAdmin: 'app超管用户', + AppUser: 'app普通用户', + SystemAdmin: '系统管理员', + SystemUser: '系统普通用户', + }, + 'x-enum-varnames': ['SystemAdmin', 'SystemUser', 'AppAdmin', 'AppUser'], + isAllowed: true, + 'x-id': 'enum.RbacRole', + }, + userID: { description: '用户id', type: 'string' }, + }, + type: 'object', + isAllowed: true, +}; + +export const $ModelConfigsMap = { + properties: { + model_type: { + description: + '模型(ERNIE-Bot-4;ERNIE-Bot;ERNIE-Bot-turbo;gpt-3.5-turbo-16k;gpt-4-1106-preview)', + type: 'string', + }, + penalty_score: { + description: + '通过对已生成的token增加惩罚,减少重复生成的现象。取值范围:[1.0, 2.0]', + type: 'number', + }, + temperature: { + description: + '较高的数值会使输出更加随机,而较低的数值会使其更加集中和确定。默认0.95,范围 (0, 1.0]', + type: 'number', + }, + tools_call: { description: 'tools call', type: 'boolean' }, + top_p: { + description: + '影响输出文本的多样性,取值越大,生成文本的多样性越强。取值范围 [0, 1.0]', + type: 'number', + }, + }, + type: 'object', + isAllowed: true, +}; + +export const $RefreshTokenBody = { + properties: { refreshToken: { type: 'string' } }, + type: 'object', + isAllowed: true, +}; + +export const $ReleaseDiscoverReq = { + properties: { + alterAppID: { type: 'string' }, + appType: { description: '应用类型', type: 'integer' }, + templateStatus: { + description: '是否作为模版 TRUE:作为模版;FALSE:不作为', + type: 'string', + }, + }, + type: 'object', + isAllowed: true, +}; + +export const $UpdateAppGroup = { + properties: { appGroupID: { type: 'string' } }, + type: 'object', + isAllowed: true, +}; + +export const $UpdateAppReq = { + properties: { + appDescription: { type: 'string' }, + appGroupID: { type: 'string' }, + appImage: { type: 'string' }, + appName: { type: 'string' }, + }, + type: 'object', + isAllowed: true, +}; + +export const $UpdateAppReqV2 = { + properties: { + appGroupID: { type: 'string' }, + appGuidance: { + description: '提示查询', + type: 'object', + properties: { items: { items: { type: 'string' }, type: 'array' } }, + isAllowed: true, + 'x-id': 'database.Guidances', + }, + appPrologue: { description: '开场白', type: 'string' }, + appRecommendedContexts: { + description: '推荐内容', + items: { + properties: { + context: { type: 'string' }, + description: { type: 'string' }, + id: { type: 'string' }, + name: { type: 'string' }, + }, + type: 'object', + isAllowed: true, + 'x-id': 'request.AppRecommendedContext', + }, + type: 'array', + }, + historyLimit: { type: 'integer' }, + modelConfigs: { + properties: { + model_type: { + description: + '模型(ERNIE-Bot-4;ERNIE-Bot;ERNIE-Bot-turbo;gpt-3.5-turbo-16k;gpt-4-1106-preview)', + type: 'string', + }, + penalty_score: { + description: + '通过对已生成的token增加惩罚,减少重复生成的现象。取值范围:[1.0, 2.0]', + type: 'number', + }, + temperature: { + description: + '较高的数值会使输出更加随机,而较低的数值会使其更加集中和确定。默认0.95,范围 (0, 1.0]', + type: 'number', + }, + tools_call: { description: 'tools call', type: 'boolean' }, + top_p: { + description: + '影响输出文本的多样性,取值越大,生成文本的多样性越强。取值范围 [0, 1.0]', + type: 'number', + }, + }, + type: 'object', + isAllowed: true, + 'x-id': 'request.ModelConfigsMap', + }, + prePrompt: { type: 'string' }, + providerId: { type: 'string' }, + recommendSwitch: { type: 'boolean' }, + }, + type: 'object', + isAllowed: true, +}; + +export const $UpdateAppStatusReq = { + properties: { + appStatus: { description: 'PUBLIC:公开;PRIVATE:私有', type: 'string' }, + }, + type: 'object', + isAllowed: true, +}; + +export const $UpdateUserRoleBody = { + properties: { + role: { + description: + '角色(system_admin-系统管理员;system_user-系统管普通用户;app_admin-应用管理员;app_user-应用普通用户)', + type: 'string', + enum: ['system_admin', 'system_user', 'app_admin', 'app_user'], + 'x-enum-comments': { + AppAdmin: 'app超管用户', + AppUser: 'app普通用户', + SystemAdmin: '系统管理员', + SystemUser: '系统普通用户', + }, + 'x-enum-varnames': ['SystemAdmin', 'SystemUser', 'AppAdmin', 'AppUser'], + isAllowed: true, + 'x-id': 'enum.RbacRole', + }, + userID: { description: '用户id', type: 'string' }, + }, + type: 'object', + isAllowed: true, +}; + +export const $WorkspaceGroupReq = { + properties: { name: { type: 'string' } }, + type: 'object', + isAllowed: true, +}; + +export const $WorkspaceReq = { + properties: { + description: { description: '描述', type: 'string' }, + name: { description: '空间名', type: 'string' }, + }, + type: 'object', + isAllowed: true, +}; + +export const $WorkspaceUser = { + properties: { + role: { + description: 'workspace_admin空间超管用户;workspace_user空间普通用户', + type: 'string', + enum: ['workspace_admin', 'workspace_user'], + 'x-enum-comments': { + WorkspaceAdmin: '空间超管用户', + WorkspaceUser: '空间普通用户', + }, + 'x-enum-varnames': ['WorkspaceAdmin', 'WorkspaceUser'], + isAllowed: true, + 'x-id': 'enum.WorkspaceRole', + }, + userID: { description: '用户id', type: 'string' }, + }, + type: 'object', + isAllowed: true, +}; + +export const $AppDatasets = { + properties: { + appCount: { type: 'integer' }, + author: { type: 'string' }, + datasetID: { type: 'string' }, + datasetName: { type: 'string' }, + docCount: { type: 'integer' }, + state: { type: 'string' }, + }, + type: 'object', + isAllowed: true, +}; + +export const $AppDetail = { + properties: { + AnswerTokensCount: { description: '消耗输出token', type: 'integer' }, + appDatasetConfig: { + properties: { + appDatasetConfigID: { type: 'string' }, + appID: { type: 'string' }, + createdAt: { type: 'string' }, + minScore: { type: 'number' }, + searchSource: { type: 'string' }, + timeoutSecond: { type: 'integer' }, + topK: { type: 'integer' }, + updatedAt: { type: 'string' }, + }, + type: 'object', + isAllowed: true, + 'x-id': 'database.AppDatasetConfig', + }, + appDatasets: { + description: '数据集Id列表', + items: { + properties: { + appCount: { type: 'integer' }, + author: { type: 'string' }, + datasetID: { type: 'string' }, + datasetName: { type: 'string' }, + docCount: { type: 'integer' }, + state: { type: 'string' }, + }, + type: 'object', + isAllowed: true, + 'x-id': 'response.AppDatasets', + }, + type: 'array', + }, + appGroupID: { type: 'string' }, + appID: { type: 'string' }, + appImage: { description: '应用头像', type: 'string' }, + appName: { description: '应用名', type: 'string' }, + appPrePrompt: { description: 'PrePrompt', type: 'string' }, + appPromptPrefix: { + properties: { + background: { type: 'string' }, + role: { type: 'string' }, + switchRecommendedQuestion: { type: 'boolean' }, + }, + type: 'object', + isAllowed: true, + 'x-id': 'request.AppModelConfigPromptPrefix', + }, + appProvider: { description: '模型', type: 'string' }, + appProviderID: { + description: + 'AppDatasetSource database2.AppDatasetSourceInfo `json:"appDatasetSource"`', + type: 'string', + }, + appProviderName: { description: '模型名', type: 'string' }, + appRecommendedContext: { + description: '推荐内容', + items: { + properties: { + appID: { type: 'string' }, + appRecommendedContextID: { type: 'string' }, + context: { type: 'string' }, + createdAt: { type: 'string' }, + description: { type: 'string' }, + name: { type: 'string' }, + updatedAt: { type: 'string' }, + }, + type: 'object', + isAllowed: true, + 'x-id': 'database.AppRecommendedContext', + }, + type: 'array', + }, + appStatus: { type: 'string' }, + appToken: { + description: '应用token列表', + items: { type: 'string' }, + type: 'array', + }, + configs: { + properties: { + model_type: { + description: + '模型(ERNIE-Bot-4;ERNIE-Bot;ERNIE-Bot-turbo;gpt-3.5-turbo-16k;gpt-4-1106-preview)', + type: 'string', + }, + penalty_score: { + description: + '通过对已生成的token增加惩罚,减少重复生成的现象。取值范围:[1.0, 2.0]', + type: 'number', + }, + temperature: { + description: + '较高的数值会使输出更加随机,而较低的数值会使其更加集中和确定。默认0.95,范围 (0, 1.0]', + type: 'number', + }, + tools_call: { type: 'boolean' }, + top_p: { + description: + '影响输出文本的多样性,取值越大,生成文本的多样性越强。取值范围 [0, 1.0]', + type: 'number', + }, + }, + type: 'object', + isAllowed: true, + 'x-id': 'response.ModelConfigsMap', + }, + conversationCount: { description: '会话总数', type: 'integer' }, + createAt: { type: 'string' }, + description: { description: '应用描述', type: 'string' }, + guidance: { + description: '开场提问引导', + type: 'object', + properties: { items: { items: { type: 'string' }, type: 'array' } }, + isAllowed: true, + 'x-id': 'database.Guidances', + }, + h5RandomPath: { description: 'H5随机分享路径', type: 'string' }, + historyLimit: { type: 'integer' }, + messagesCount: { description: '消息总数', type: 'integer' }, + pcRandomPath: { description: 'PC随机分享路径', type: 'string' }, + prologue: { description: '开场白', type: 'string' }, + queryTokensCount: { description: '消耗输入token', type: 'integer' }, + switchRecommendedQuestion: { type: 'boolean' }, + templateStatus: { type: 'string' }, + totalTokens: { description: '消耗总token', type: 'integer' }, + workspaceID: { type: 'string' }, + }, + type: 'object', + isAllowed: true, +}; + +export const $AppMessagesCount = { + properties: { total: { type: 'integer' } }, + type: 'object', + isAllowed: true, +}; + +export const $AppRecommendedContext3 = { + properties: { + context: { type: 'string' }, + description: { type: 'string' }, + id: { type: 'string' }, + name: { type: 'string' }, + }, + type: 'object', + isAllowed: true, +}; + +export const $AppRecommendedContextResp = { + properties: { + questions: { type: 'string' }, + recommendSwitch: { type: 'boolean' }, + }, + type: 'object', + isAllowed: true, +}; + +export const $AppResp = { + properties: { + appGroupID: { type: 'string' }, + appGroupName: { type: 'string' }, + appImage: { type: 'string' }, + appStatus: { type: 'string' }, + createAt: { type: 'string' }, + datasetCount: { type: 'integer' }, + description: { type: 'string' }, + h5: { type: 'string' }, + id: { type: 'string' }, + name: { type: 'string' }, + pc: { type: 'string' }, + workspaceID: { type: 'string' }, + }, + type: 'object', + isAllowed: true, +}; + +export const $AppWithPermission = { + properties: { + appID: { type: 'string' }, + appImage: { type: 'integer' }, + appStatus: { type: 'string' }, + appType: { description: '应用类型', type: 'integer' }, + createdAt: { type: 'string' }, + description: { type: 'string' }, + groupID: { type: 'string' }, + guidance: { + description: '开场提问引导', + type: 'object', + additionalProperties: true, + isAllowed: true, + 'x-id': 'git_querycap_com_devops_srv-llmops_internal_database.Map', + }, + isAppAdmin: { type: 'boolean' }, + name: { type: 'string' }, + operator: { type: 'string' }, + priority: { description: '应用优先级', type: 'integer' }, + prologue: { type: 'string' }, + recommendSwitch: { + type: 'string', + 'x-enum-comments': { BOOL_FALSE: 'false', BOOL_TRUE: 'true' }, + 'x-enum-varnames': ['BOOL_UNKNOWN', 'BOOL_TRUE', 'BOOL_FALSE'], + isAllowed: true, + 'x-id': 'github_com_go-courier_sqlx_v2_datatypes.Bool', + }, + templateStatus: { description: '是否模版', type: 'string' }, + updatedAt: { type: 'string' }, + workspaceID: { type: 'string' }, + }, + type: 'object', + isAllowed: true, +}; + +export const $AttentionDataCountResp = { + properties: { total: { type: 'integer' } }, + type: 'object', + isAllowed: true, +}; + +export const $AttentionUser = { + properties: { + email: { type: 'string' }, + isAttentionUser: { type: 'boolean' }, + phone: { type: 'string' }, + userID: { type: 'string' }, + userName: { type: 'string' }, + }, + type: 'object', + isAllowed: true, +}; + +export const $AttentionUserResp = { + properties: { + email: { type: 'string' }, + lastMessageTime: { type: 'string' }, + phone: { type: 'string' }, + userID: { type: 'string' }, + userName: { type: 'string' }, + }, + type: 'object', + isAllowed: true, +}; + +export const $ConversationLogsResp = { + properties: { + AnswerTokensCount: { description: '消耗输出token', type: 'integer' }, + appID: { type: 'string' }, + conversationID: { type: 'string' }, + conversationName: { type: 'string' }, + createdAt: { type: 'string' }, + messagesCount: { type: 'integer' }, + queryTokensCount: { description: '消耗输入token', type: 'integer' }, + totalTokens: { description: '消耗总token', type: 'integer' }, + userID: { type: 'string' }, + userInfo: { + properties: { + createdAt: { type: 'string' }, + email: { type: 'string' }, + idpID: { type: 'string' }, + operator: { type: 'string' }, + phone: { type: 'string' }, + role: { + description: '角色(系统管理员、系统普通用户)', + type: 'string', + enum: ['system_admin', 'system_user', 'app_admin', 'app_user'], + 'x-enum-comments': { + AppAdmin: 'app超管用户', + AppUser: 'app普通用户', + SystemAdmin: '系统管理员', + SystemUser: '系统普通用户', + }, + 'x-enum-varnames': [ + 'SystemAdmin', + 'SystemUser', + 'AppAdmin', + 'AppUser', + ], + isAllowed: true, + 'x-id': 'enum.RbacRole', + }, + updatedAt: { type: 'string' }, + userID: { description: 'iam 用户id', type: 'string' }, + userName: { type: 'string' }, + }, + type: 'object', + isAllowed: true, + 'x-id': 'database.User', + }, + }, + type: 'object', + isAllowed: true, +}; + +export const $ConversationResp = { + properties: { + AnswerTokensCount: { description: '消耗输出token', type: 'integer' }, + appID: { type: 'string' }, + appName: { type: 'string' }, + conversationID: { type: 'string' }, + conversationName: { type: 'string' }, + createdAt: { type: 'string' }, + lastMessagesTime: { type: 'string' }, + messagesCount: { type: 'integer' }, + queryTokensCount: { description: '消耗输入token', type: 'integer' }, + totalTokens: { description: '消耗总token', type: 'integer' }, + userID: { type: 'string' }, + userInfo: { + properties: { + createdAt: { type: 'string' }, + email: { type: 'string' }, + idpID: { type: 'string' }, + operator: { type: 'string' }, + phone: { type: 'string' }, + role: { + description: '角色(系统管理员、系统普通用户)', + type: 'string', + enum: ['system_admin', 'system_user', 'app_admin', 'app_user'], + 'x-enum-comments': { + AppAdmin: 'app超管用户', + AppUser: 'app普通用户', + SystemAdmin: '系统管理员', + SystemUser: '系统普通用户', + }, + 'x-enum-varnames': [ + 'SystemAdmin', + 'SystemUser', + 'AppAdmin', + 'AppUser', + ], + isAllowed: true, + 'x-id': 'enum.RbacRole', + }, + updatedAt: { type: 'string' }, + userID: { description: 'iam 用户id', type: 'string' }, + userName: { type: 'string' }, + }, + type: 'object', + isAllowed: true, + 'x-id': 'database.User', + }, + }, + type: 'object', + isAllowed: true, +}; + +export const $CreateApiTokenRESP = { + properties: { token: { type: 'string' } }, + type: 'object', + isAllowed: true, +}; + +export const $CreateSharePathRESP = { + properties: { path: { type: 'string' } }, + type: 'object', + isAllowed: true, +}; + +export const $DeleteResp = { + properties: { msg: { type: 'string' } }, + type: 'object', + isAllowed: true, +}; + +export const $ExchangeTokenRESP = { + properties: { + access_token: { description: '访问令牌', type: 'string' }, + expires_in: { description: '访问令牌过期时间', type: 'string' }, + refresh_expires_in: { description: '刷新令牌过期时间', type: 'string' }, + refresh_token: { description: '刷新令牌', type: 'string' }, + token_type: { description: '令牌类型', type: 'string' }, + }, + type: 'object', + isAllowed: true, +}; + +export const $GetApiTokenByRandomPathRESP = { + properties: { + apiTokenID: { type: 'string' }, + appID: { type: 'string' }, + appName: { type: 'string' }, + createdAt: { type: 'string' }, + recommendedContext: { + items: { + properties: { + appID: { type: 'string' }, + appRecommendedContextID: { type: 'string' }, + context: { type: 'string' }, + createdAt: { type: 'string' }, + description: { type: 'string' }, + name: { type: 'string' }, + updatedAt: { type: 'string' }, + }, + type: 'object', + isAllowed: true, + 'x-id': 'database.AppRecommendedContext', + }, + type: 'array', + }, + switchRecommendedContext: { type: 'boolean' }, + switchRecommendedQuestion: { type: 'boolean' }, + token: { type: 'string' }, + updatedAt: { type: 'string' }, + }, + type: 'object', + isAllowed: true, +}; + +export const $IAMUserInfo = { + properties: { + createdTime: { description: '创建时间', type: 'string' }, + email: { description: 'Cid string `json:"cid"`', type: 'string' }, + id: { description: '用户id', type: 'string' }, + idpId: { type: 'string' }, + isAdmin: { description: '是否iam管理员', type: 'boolean' }, + isAppAdmin: { type: 'boolean' }, + isRkUser: { description: '是否罗克佳华人员', type: 'boolean' }, + isSuperUser: { description: '是否超级管理员', type: 'boolean' }, + isSystemAdmin: { type: 'boolean' }, + lastTime: { + description: 'Deleted int32 `json:"deleted"` // 逻辑删除', + type: 'string', + }, + loginName: { description: '登录名', type: 'string' }, + msgType: { description: '消息类型', type: 'integer' }, + phone: { description: '电话', type: 'string' }, + rkUserCard: { description: '罗克佳华用户账号', type: 'string' }, + sign: { description: '个性签名', type: 'string' }, + status: { description: '状态:1可用;0未激活;-1禁用', type: 'integer' }, + updatedTime: { description: '修改时间', type: 'string' }, + useType: { description: '用户类型', type: 'string' }, + userName: { description: '用户名', type: 'string' }, + wechatAppId: { type: 'string' }, + wechatSwitch: { type: 'boolean' }, + wechatgzhSwitch: { type: 'boolean' }, + }, + type: 'object', + isAllowed: true, +}; + +export const $ListAllAttentionUser = { + properties: { + data: { + items: { + properties: { + email: { type: 'string' }, + isAttentionUser: { type: 'boolean' }, + phone: { type: 'string' }, + userID: { type: 'string' }, + userName: { type: 'string' }, + }, + type: 'object', + isAllowed: true, + 'x-id': 'response.AttentionUser', + }, + type: 'array', + }, + total: { type: 'integer' }, + }, + type: 'object', + isAllowed: true, +}; + +export const $ListAppDatasetConfigResp = { + properties: { + data: { + items: { + properties: { + appDatasetConfigID: { type: 'string' }, + appID: { type: 'string' }, + createdAt: { type: 'string' }, + minScore: { type: 'number' }, + searchSource: { type: 'string' }, + timeoutSecond: { type: 'integer' }, + topK: { type: 'integer' }, + updatedAt: { type: 'string' }, + }, + type: 'object', + isAllowed: true, + 'x-id': 'database.AppDatasetConfig', + }, + type: 'array', + }, + total: { type: 'integer' }, + }, + type: 'object', + isAllowed: true, +}; + +export const $ListAppDatasets = { + properties: { + Data: { + items: { + properties: { + appCount: { type: 'integer' }, + author: { type: 'string' }, + datasetID: { type: 'string' }, + datasetName: { type: 'string' }, + docCount: { type: 'integer' }, + state: { type: 'string' }, + }, + type: 'object', + isAllowed: true, + 'x-id': 'response.AppDatasets', + }, + type: 'array', + }, + total: { type: 'integer' }, + }, + type: 'object', + isAllowed: true, +}; + +export const $ListAppResp = { + properties: { + data: { + items: { + properties: { + appGroupID: { type: 'string' }, + appGroupName: { type: 'string' }, + appImage: { type: 'string' }, + appStatus: { type: 'string' }, + createAt: { type: 'string' }, + datasetCount: { type: 'integer' }, + description: { type: 'string' }, + h5: { type: 'string' }, + id: { type: 'string' }, + name: { type: 'string' }, + pc: { type: 'string' }, + workspaceID: { type: 'string' }, + }, + type: 'object', + isAllowed: true, + 'x-id': 'response.AppResp', + }, + type: 'array', + }, + total: { type: 'integer' }, + }, + type: 'object', + isAllowed: true, +}; + +export const $ListAttentionUserResp = { + properties: { + data: { + items: { + properties: { + email: { type: 'string' }, + lastMessageTime: { type: 'string' }, + phone: { type: 'string' }, + userID: { type: 'string' }, + userName: { type: 'string' }, + }, + type: 'object', + isAllowed: true, + 'x-id': 'response.AttentionUserResp', + }, + type: 'array', + }, + total: { type: 'integer' }, + }, + type: 'object', + isAllowed: true, +}; + +export const $ListConversationLogsResp = { + properties: { + data: { + items: { + properties: { + AnswerTokensCount: { description: '消耗输出token', type: 'integer' }, + appID: { type: 'string' }, + conversationID: { type: 'string' }, + conversationName: { type: 'string' }, + createdAt: { type: 'string' }, + messagesCount: { type: 'integer' }, + queryTokensCount: { description: '消耗输入token', type: 'integer' }, + totalTokens: { description: '消耗总token', type: 'integer' }, + userID: { type: 'string' }, + userInfo: { + properties: { + createdAt: { type: 'string' }, + email: { type: 'string' }, + idpID: { type: 'string' }, + operator: { type: 'string' }, + phone: { type: 'string' }, + role: { + description: '角色(系统管理员、系统普通用户)', + type: 'string', + enum: ['system_admin', 'system_user', 'app_admin', 'app_user'], + 'x-enum-comments': { + AppAdmin: 'app超管用户', + AppUser: 'app普通用户', + SystemAdmin: '系统管理员', + SystemUser: '系统普通用户', + }, + 'x-enum-varnames': [ + 'SystemAdmin', + 'SystemUser', + 'AppAdmin', + 'AppUser', + ], + isAllowed: true, + 'x-id': 'enum.RbacRole', + }, + updatedAt: { type: 'string' }, + userID: { description: 'iam 用户id', type: 'string' }, + userName: { type: 'string' }, + }, + type: 'object', + isAllowed: true, + 'x-id': 'database.User', + }, + }, + type: 'object', + isAllowed: true, + 'x-id': 'response.ConversationLogsResp', + }, + type: 'array', + }, + total: { type: 'integer' }, + }, + type: 'object', + isAllowed: true, +}; + +export const $ListConversationResp = { + properties: { + data: { + items: { + properties: { + AnswerTokensCount: { description: '消耗输出token', type: 'integer' }, + appID: { type: 'string' }, + appName: { type: 'string' }, + conversationID: { type: 'string' }, + conversationName: { type: 'string' }, + createdAt: { type: 'string' }, + lastMessagesTime: { type: 'string' }, + messagesCount: { type: 'integer' }, + queryTokensCount: { description: '消耗输入token', type: 'integer' }, + totalTokens: { description: '消耗总token', type: 'integer' }, + userID: { type: 'string' }, + userInfo: { + properties: { + createdAt: { type: 'string' }, + email: { type: 'string' }, + idpID: { type: 'string' }, + operator: { type: 'string' }, + phone: { type: 'string' }, + role: { + description: '角色(系统管理员、系统普通用户)', + type: 'string', + enum: ['system_admin', 'system_user', 'app_admin', 'app_user'], + 'x-enum-comments': { + AppAdmin: 'app超管用户', + AppUser: 'app普通用户', + SystemAdmin: '系统管理员', + SystemUser: '系统普通用户', + }, + 'x-enum-varnames': [ + 'SystemAdmin', + 'SystemUser', + 'AppAdmin', + 'AppUser', + ], + isAllowed: true, + 'x-id': 'enum.RbacRole', + }, + updatedAt: { type: 'string' }, + userID: { description: 'iam 用户id', type: 'string' }, + userName: { type: 'string' }, + }, + type: 'object', + isAllowed: true, + 'x-id': 'database.User', + }, + }, + type: 'object', + isAllowed: true, + 'x-id': 'response.ConversationResp', + }, + type: 'array', + }, + total: { type: 'integer' }, + }, + type: 'object', + isAllowed: true, +}; + +export const $ListMemberRESP = { + properties: { + data: { + items: { + properties: { + appRole: { + description: '应用角色', + type: 'string', + enum: ['system_admin', 'system_user', 'app_admin', 'app_user'], + 'x-enum-comments': { + AppAdmin: 'app超管用户', + AppUser: 'app普通用户', + SystemAdmin: '系统管理员', + SystemUser: '系统普通用户', + }, + 'x-enum-varnames': [ + 'SystemAdmin', + 'SystemUser', + 'AppAdmin', + 'AppUser', + ], + isAllowed: true, + 'x-id': 'enum.RbacRole', + }, + createdAt: { type: 'string' }, + email: { type: 'string' }, + idpID: { type: 'string' }, + isAppAdmin: { description: '是否是app管理员', type: 'boolean' }, + isSystemAdmin: { description: '是否是系统管理员', type: 'boolean' }, + operator: { type: 'string' }, + phone: { type: 'string' }, + role: { + description: '角色(系统管理员、系统普通用户)', + type: 'string', + enum: ['system_admin', 'system_user', 'app_admin', 'app_user'], + 'x-enum-comments': { + AppAdmin: 'app超管用户', + AppUser: 'app普通用户', + SystemAdmin: '系统管理员', + SystemUser: '系统普通用户', + }, + 'x-enum-varnames': [ + 'SystemAdmin', + 'SystemUser', + 'AppAdmin', + 'AppUser', + ], + isAllowed: true, + 'x-id': 'enum.RbacRole', + }, + updatedAt: { type: 'string' }, + userID: { description: 'iam 用户id', type: 'string' }, + userName: { type: 'string' }, + }, + type: 'object', + isAllowed: true, + 'x-id': 'response.MemberWithRoleData', + }, + type: 'array', + }, + total: { type: 'integer' }, + }, + type: 'object', + isAllowed: true, +}; + +export const $ListProviderResp = { + properties: { + data: { + items: { + properties: { + name: { description: '名字', type: 'string' }, + providerID: { type: 'string' }, + subType: { items: { type: 'string' }, type: 'array' }, + type: { + description: '类型', + type: 'string', + enum: ['openai', 'spark', 'wenxin', 'rockai'], + 'x-enum-varnames': ['OpenAI', 'Spark', 'WenXin', 'RockAI'], + isAllowed: true, + 'x-id': 'enum.ProviderType', + }, + }, + type: 'object', + isAllowed: true, + 'x-id': 'response.ProviderResp', + }, + type: 'array', + }, + total: { type: 'integer' }, + }, + type: 'object', + isAllowed: true, +}; + +export const $ListUserWithAppRESP = { + properties: { + data: { + items: { + properties: { + appWithPermissionList: { + items: { + properties: { + appID: { type: 'string' }, + appImage: { type: 'integer' }, + appStatus: { type: 'string' }, + appType: { description: '应用类型', type: 'integer' }, + createdAt: { type: 'string' }, + description: { type: 'string' }, + groupID: { type: 'string' }, + guidance: { + description: '开场提问引导', + type: 'object', + additionalProperties: true, + isAllowed: true, + 'x-id': + 'git_querycap_com_devops_srv-llmops_internal_database.Map', + }, + isAppAdmin: { type: 'boolean' }, + name: { type: 'string' }, + operator: { type: 'string' }, + priority: { description: '应用优先级', type: 'integer' }, + prologue: { type: 'string' }, + recommendSwitch: { + type: 'string', + 'x-enum-comments': { BOOL_FALSE: 'false', BOOL_TRUE: 'true' }, + 'x-enum-varnames': [ + 'BOOL_UNKNOWN', + 'BOOL_TRUE', + 'BOOL_FALSE', + ], + isAllowed: true, + 'x-id': 'github_com_go-courier_sqlx_v2_datatypes.Bool', + }, + templateStatus: { description: '是否模版', type: 'string' }, + updatedAt: { type: 'string' }, + workspaceID: { type: 'string' }, + }, + type: 'object', + isAllowed: true, + 'x-id': 'response.AppWithPermission', + }, + type: 'array', + }, + createdAt: { type: 'string' }, + email: { type: 'string' }, + idpID: { type: 'string' }, + isSystemAdmin: { type: 'boolean' }, + operator: { type: 'string' }, + phone: { type: 'string' }, + role: { + description: '角色(系统管理员、系统普通用户)', + type: 'string', + enum: ['system_admin', 'system_user', 'app_admin', 'app_user'], + 'x-enum-comments': { + AppAdmin: 'app超管用户', + AppUser: 'app普通用户', + SystemAdmin: '系统管理员', + SystemUser: '系统普通用户', + }, + 'x-enum-varnames': [ + 'SystemAdmin', + 'SystemUser', + 'AppAdmin', + 'AppUser', + ], + isAllowed: true, + 'x-id': 'enum.RbacRole', + }, + updatedAt: { type: 'string' }, + userID: { description: 'iam 用户id', type: 'string' }, + userName: { type: 'string' }, + }, + type: 'object', + isAllowed: true, + 'x-id': 'response.UserWithAppData', + }, + type: 'array', + }, + total: { type: 'integer' }, + }, + type: 'object', + isAllowed: true, +}; + +export const $ListWorkspacePermissions = { + properties: { + data: { + items: { + properties: { + createdAt: { type: 'string' }, + email: { type: 'string' }, + idpID: { type: 'string' }, + operator: { type: 'string' }, + permission: { + description: '枚举read_only(只读)、operation(操作)', + type: 'string', + enum: ['read_only', 'operation', 'no_permission'], + 'x-enum-comments': { + NoPermission: '无权限', + Operation: '操作权限', + ReadOnly: '只读权限', + }, + 'x-enum-varnames': ['ReadOnly', 'Operation', 'NoPermission'], + isAllowed: true, + 'x-id': 'enum.Permission', + }, + phone: { type: 'string' }, + role: { + description: '角色(系统管理员、系统普通用户)', + type: 'string', + enum: ['system_admin', 'system_user', 'app_admin', 'app_user'], + 'x-enum-comments': { + AppAdmin: 'app超管用户', + AppUser: 'app普通用户', + SystemAdmin: '系统管理员', + SystemUser: '系统普通用户', + }, + 'x-enum-varnames': [ + 'SystemAdmin', + 'SystemUser', + 'AppAdmin', + 'AppUser', + ], + isAllowed: true, + 'x-id': 'enum.RbacRole', + }, + updatedAt: { type: 'string' }, + userID: { description: 'iam 用户id', type: 'string' }, + userName: { type: 'string' }, + }, + type: 'object', + isAllowed: true, + 'x-id': 'response.WorkspacePermissions', + }, + type: 'array', + }, + total: { type: 'integer' }, + }, + type: 'object', + isAllowed: true, +}; + +export const $MemberWithRoleData = { + properties: { + appRole: { + description: '应用角色', + type: 'string', + enum: ['system_admin', 'system_user', 'app_admin', 'app_user'], + 'x-enum-comments': { + AppAdmin: 'app超管用户', + AppUser: 'app普通用户', + SystemAdmin: '系统管理员', + SystemUser: '系统普通用户', + }, + 'x-enum-varnames': ['SystemAdmin', 'SystemUser', 'AppAdmin', 'AppUser'], + isAllowed: true, + 'x-id': 'enum.RbacRole', + }, + createdAt: { type: 'string' }, + email: { type: 'string' }, + idpID: { type: 'string' }, + isAppAdmin: { description: '是否是app管理员', type: 'boolean' }, + isSystemAdmin: { description: '是否是系统管理员', type: 'boolean' }, + operator: { type: 'string' }, + phone: { type: 'string' }, + role: { + description: '角色(系统管理员、系统普通用户)', + type: 'string', + enum: ['system_admin', 'system_user', 'app_admin', 'app_user'], + 'x-enum-comments': { + AppAdmin: 'app超管用户', + AppUser: 'app普通用户', + SystemAdmin: '系统管理员', + SystemUser: '系统普通用户', + }, + 'x-enum-varnames': ['SystemAdmin', 'SystemUser', 'AppAdmin', 'AppUser'], + isAllowed: true, + 'x-id': 'enum.RbacRole', + }, + updatedAt: { type: 'string' }, + userID: { description: 'iam 用户id', type: 'string' }, + userName: { type: 'string' }, + }, + type: 'object', + isAllowed: true, +}; + +export const $MessagesCountResp = { + properties: { + messagesCount: { description: '请求消耗token', type: 'integer' }, + time: { type: 'string' }, + }, + type: 'object', + isAllowed: true, +}; + +export const $MessagesTokenResp = { + properties: { + answerToken: { description: '回答消耗token', type: 'integer' }, + queryToken: { description: '请求消耗token', type: 'integer' }, + time: { type: 'string' }, + totalToken: { type: 'integer' }, + }, + type: 'object', + isAllowed: true, +}; + +export const $ModelConfigsMap2 = { + properties: { + model_type: { + description: + '模型(ERNIE-Bot-4;ERNIE-Bot;ERNIE-Bot-turbo;gpt-3.5-turbo-16k;gpt-4-1106-preview)', + type: 'string', + }, + penalty_score: { + description: + '通过对已生成的token增加惩罚,减少重复生成的现象。取值范围:[1.0, 2.0]', + type: 'number', + }, + temperature: { + description: + '较高的数值会使输出更加随机,而较低的数值会使其更加集中和确定。默认0.95,范围 (0, 1.0]', + type: 'number', + }, + tools_call: { type: 'boolean' }, + top_p: { + description: + '影响输出文本的多样性,取值越大,生成文本的多样性越强。取值范围 [0, 1.0]', + type: 'number', + }, + }, + type: 'object', + isAllowed: true, +}; + +export const $ProviderResp = { + properties: { + name: { description: '名字', type: 'string' }, + providerID: { type: 'string' }, + subType: { items: { type: 'string' }, type: 'array' }, + type: { + description: '类型', + type: 'string', + enum: ['openai', 'spark', 'wenxin', 'rockai'], + 'x-enum-varnames': ['OpenAI', 'Spark', 'WenXin', 'RockAI'], + isAllowed: true, + 'x-id': 'enum.ProviderType', + }, + }, + type: 'object', + isAllowed: true, +}; + +export const $QueryTokenResp = { + properties: { + AnswerTokensCount: { description: '消耗输出token', type: 'integer' }, + queryTokensCount: { description: '消耗输入token', type: 'integer' }, + totalTokens: { description: '消耗总token', type: 'integer' }, + }, + type: 'object', + isAllowed: true, +}; + +export const $RecommendQuestionAndContext = { + properties: { + contexts: { + items: { + properties: { + context: { type: 'string' }, + description: { type: 'string' }, + id: { type: 'string' }, + name: { type: 'string' }, + }, + type: 'object', + isAllowed: true, + 'x-id': 'response.AppRecommendedContext', + }, + type: 'array', + }, + questions: { items: { type: 'string' }, type: 'array' }, + }, + type: 'object', + isAllowed: true, +}; + +export const $UserWithAppData = { + properties: { + appWithPermissionList: { + items: { + properties: { + appID: { type: 'string' }, + appImage: { type: 'integer' }, + appStatus: { type: 'string' }, + appType: { description: '应用类型', type: 'integer' }, + createdAt: { type: 'string' }, + description: { type: 'string' }, + groupID: { type: 'string' }, + guidance: { + description: '开场提问引导', + type: 'object', + additionalProperties: true, + isAllowed: true, + 'x-id': 'git_querycap_com_devops_srv-llmops_internal_database.Map', + }, + isAppAdmin: { type: 'boolean' }, + name: { type: 'string' }, + operator: { type: 'string' }, + priority: { description: '应用优先级', type: 'integer' }, + prologue: { type: 'string' }, + recommendSwitch: { + type: 'string', + 'x-enum-comments': { BOOL_FALSE: 'false', BOOL_TRUE: 'true' }, + 'x-enum-varnames': ['BOOL_UNKNOWN', 'BOOL_TRUE', 'BOOL_FALSE'], + isAllowed: true, + 'x-id': 'github_com_go-courier_sqlx_v2_datatypes.Bool', + }, + templateStatus: { description: '是否模版', type: 'string' }, + updatedAt: { type: 'string' }, + workspaceID: { type: 'string' }, + }, + type: 'object', + isAllowed: true, + 'x-id': 'response.AppWithPermission', + }, + type: 'array', + }, + createdAt: { type: 'string' }, + email: { type: 'string' }, + idpID: { type: 'string' }, + isSystemAdmin: { type: 'boolean' }, + operator: { type: 'string' }, + phone: { type: 'string' }, + role: { + description: '角色(系统管理员、系统普通用户)', + type: 'string', + enum: ['system_admin', 'system_user', 'app_admin', 'app_user'], + 'x-enum-comments': { + AppAdmin: 'app超管用户', + AppUser: 'app普通用户', + SystemAdmin: '系统管理员', + SystemUser: '系统普通用户', + }, + 'x-enum-varnames': ['SystemAdmin', 'SystemUser', 'AppAdmin', 'AppUser'], + isAllowed: true, + 'x-id': 'enum.RbacRole', + }, + updatedAt: { type: 'string' }, + userID: { description: 'iam 用户id', type: 'string' }, + userName: { type: 'string' }, + }, + type: 'object', + isAllowed: true, +}; + +export const $WJLAccount = { + properties: { + code: { type: 'integer' }, + data: { + properties: { + avatar: { type: 'string' }, + iamUserId: { type: 'string' }, + nameInTeam: { type: 'string' }, + nickName: { type: 'string' }, + phone: { type: 'string' }, + realNameFlag: { type: 'integer' }, + }, + type: 'object', + }, + msg: { type: 'string' }, + success: { type: 'boolean' }, + }, + type: 'object', + isAllowed: true, +}; + +export const $WorkspaceListResp = { + properties: { + data: { + items: { + properties: { + description: { description: '空间描述', type: 'string' }, + name: { description: '空间名', type: 'string' }, + workspaceID: { description: '空间ID', type: 'string' }, + }, + type: 'object', + isAllowed: true, + 'x-id': 'response.WorkspaceResp', + }, + type: 'array', + }, + total: { type: 'integer' }, + }, + type: 'object', + isAllowed: true, +}; + +export const $WorkspacePermissions = { + properties: { + createdAt: { type: 'string' }, + email: { type: 'string' }, + idpID: { type: 'string' }, + operator: { type: 'string' }, + permission: { + description: '枚举read_only(只读)、operation(操作)', + type: 'string', + enum: ['read_only', 'operation', 'no_permission'], + 'x-enum-comments': { + NoPermission: '无权限', + Operation: '操作权限', + ReadOnly: '只读权限', + }, + 'x-enum-varnames': ['ReadOnly', 'Operation', 'NoPermission'], + isAllowed: true, + 'x-id': 'enum.Permission', + }, + phone: { type: 'string' }, + role: { + description: '角色(系统管理员、系统普通用户)', + type: 'string', + enum: ['system_admin', 'system_user', 'app_admin', 'app_user'], + 'x-enum-comments': { + AppAdmin: 'app超管用户', + AppUser: 'app普通用户', + SystemAdmin: '系统管理员', + SystemUser: '系统普通用户', + }, + 'x-enum-varnames': ['SystemAdmin', 'SystemUser', 'AppAdmin', 'AppUser'], + isAllowed: true, + 'x-id': 'enum.RbacRole', + }, + updatedAt: { type: 'string' }, + userID: { description: 'iam 用户id', type: 'string' }, + userName: { type: 'string' }, + }, + type: 'object', + isAllowed: true, +}; + +export const $WorkspaceResp = { + properties: { + description: { description: '空间描述', type: 'string' }, + name: { description: '空间名', type: 'string' }, + workspaceID: { description: '空间ID', type: 'string' }, + }, + type: 'object', + isAllowed: true, +}; + +export const $AddAppkeyReq = { + properties: { + appid: { type: 'string' }, + appkey: { type: 'string' }, + appsecret: { type: 'string' }, + encodingAESKey: { type: 'string' }, + token: { type: 'string' }, + type: { description: 'wjl,dingding,feishu,wxa,wx', type: 'string' }, + }, + required: ['appid', 'appkey', 'type'], + type: 'object', + isAllowed: true, +}; + +export const $Data = { + properties: { + appkey: { type: 'string' }, + appsecret: { type: 'string' }, + state: { description: '0-未开启,1-开启', type: 'integer' }, + url: { type: 'string' }, + wxExtra: { + properties: { + encodingAESKey: { type: 'string' }, + token: { type: 'string' }, + }, + type: 'object', + isAllowed: true, + 'x-id': 'robot.WxExtra', + }, + }, + type: 'object', + isAllowed: true, +}; + +export const $GetAppKeyReq = { + properties: { + appid: { type: 'string' }, + type: { description: 'wjl,dingding,feishu,wxa,wx', type: 'string' }, + }, + required: ['appid', 'type'], + type: 'object', + isAllowed: true, +}; + +export const $UpdateAppKeyStateReq = { + properties: { + appid: { type: 'string' }, + state: { description: '0-关闭,1-启动', type: 'integer' }, + type: { description: 'wjl,dingding,feishu', type: 'string' }, + }, + required: ['appid', 'type'], + type: 'object', + isAllowed: true, +}; + +export const $WxExtra = { + properties: { encodingAESKey: { type: 'string' }, token: { type: 'string' } }, + type: 'object', + isAllowed: true, +}; + +export const $EmptyObject = { type: 'object', isAllowed: true }; + +export const $ErrorResp = { + properties: { msg: { type: 'string' }, type: { type: 'object' } }, + type: 'object', + isAllowed: true, +}; +/* eslint-disable */ +// @ts-ignore +import { request } from 'axios'; + +import * as API from './types'; + +/** H5GetApiToken 获取一个 app token h5版 GET /llmops/v1/api/app/h5/share/api-token */ +export async function v1ApiAppH5ShareApiTokenUsingGet({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v1ApiAppH5ShareApiTokenUsingGetParams; + options?: { [key: string]: unknown }; +}) { + return request( + '/llmops/v1/api/app/h5/share/api-token', + { + method: 'GET', + params: { + ...params, + }, + ...(options || {}), + } + ); +} + +/** GetApiToken 获取一个 app token GET /llmops/v1/api/app/share/api-token */ +export async function v1ApiAppShareApiTokenUsingGet({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v1ApiAppShareApiTokenUsingGetParams; + options?: { [key: string]: unknown }; +}) { + return request( + '/llmops/v1/api/app/share/api-token', + { + method: 'GET', + params: { + ...params, + }, + ...(options || {}), + } + ); +} +/* eslint-disable */ +// @ts-ignore + +export type AddAppkeyReq = { + appid: string; + appkey: string; + appsecret?: string; + encodingAESKey?: string; + token?: string; + /** wjl,dingding,feishu,wxa,wx */ + type: string; +}; + +export type ApiToken = { + apiTokenID?: string; + appID?: string; + createdAt?: string; + token?: string; + updatedAt?: string; +}; + +export type ApiTokenDataList = { + data?: ApiToken[]; + total?: number; +}; + +export type App = { + appID?: string; + appImage?: number; + appStatus?: string; + /** 应用类型 */ + appType?: number; + createdAt?: string; + description?: string; + groupID?: string; + /** 开场提问引导 */ + guidance?: Map; + name?: string; + operator?: string; + /** 应用优先级 */ + priority?: number; + prologue?: string; + recommendSwitch?: Bool; + /** 是否模版 */ + templateStatus?: string; + updatedAt?: string; + workspaceID?: string; +}; + +export type AppDataset = { + /** 描述 */ + description?: string; + /** llm描述 */ + llmDesc?: string; + /** 知识库名 */ + name?: string; +}; + +export type AppDatasetConfig = { + appDatasetConfigID?: string; + appID?: string; + createdAt?: string; + minScore?: number; + searchSource?: string; + timeoutSecond?: number; + topK?: number; + updatedAt?: string; +}; + +export type AppDatasetConfigs = { + /** 最低分数 */ + minScore?: number; + /** 知识库源,默认 warehouse */ + searchSource?: string; + /** 知识库查询超时时间 */ + timeoutSecond?: number; + /** 知识库条数 */ + topK?: number; +}; + +export type AppDatasets = { + appCount?: number; + author?: string; + datasetID?: string; + datasetName?: string; + docCount?: number; + state?: string; +}; + +export type AppDetail = { + /** 消耗输出token */ + AnswerTokensCount?: number; + appDatasetConfig?: AppDatasetConfig; + /** 数据集Id列表 */ + appDatasets?: AppDatasets[]; + appGroupID?: string; + appID?: string; + /** 应用头像 */ + appImage?: string; + /** 应用名 */ + appName?: string; + /** PrePrompt */ + appPrePrompt?: string; + appPromptPrefix?: AppModelConfigPromptPrefix; + /** 模型 */ + appProvider?: string; + /** AppDatasetSource database2.AppDatasetSourceInfo `json:"appDatasetSource"` */ + appProviderID?: string; + /** 模型名 */ + appProviderName?: string; + /** 推荐内容 */ + appRecommendedContext?: AppRecommendedContext[]; + appStatus?: string; + /** 应用token列表 */ + appToken?: string[]; + configs?: ModelConfigsMap; + /** 会话总数 */ + conversationCount?: number; + createAt?: string; + /** 应用描述 */ + description?: string; + /** 开场提问引导 */ + guidance?: Guidances; + /** H5随机分享路径 */ + h5RandomPath?: string; + historyLimit?: number; + /** 消息总数 */ + messagesCount?: number; + /** PC随机分享路径 */ + pcRandomPath?: string; + /** 开场白 */ + prologue?: string; + /** 消耗输入token */ + queryTokensCount?: number; + switchRecommendedQuestion?: boolean; + templateStatus?: string; + /** 消耗总token */ + totalTokens?: number; + workspaceID?: string; +}; + +export type AppMessagesCount = { + total?: number; +}; + +export type AppModelConfigPromptPrefix = { + background?: string; + role?: string; + switchRecommendedQuestion?: boolean; +}; + +export type AppModelConfigs = { + configs?: ModelConfigsMap; + prePrompt?: string; + providerId?: string; +}; + +export type AppRecommendedContext = { + appID?: string; + appRecommendedContextID?: string; + context?: string; + createdAt?: string; + description?: string; + name?: string; + updatedAt?: string; +}; + +export type AppRecommendedContext2 = { + context?: string; + description?: string; + id?: string; + name?: string; +}; + +export type AppRecommendedContext3 = { + context?: string; + description?: string; + id?: string; + name?: string; +}; + +export type AppRecommendedContextResp = { + questions?: string; + recommendSwitch?: boolean; +}; + +export type AppResp = { + appGroupID?: string; + appGroupName?: string; + appImage?: string; + appStatus?: string; + createAt?: string; + datasetCount?: number; + description?: string; + h5?: string; + id?: string; + name?: string; + pc?: string; + workspaceID?: string; +}; + +export type AppWithPermission = { + appID?: string; + appImage?: number; + appStatus?: string; + /** 应用类型 */ + appType?: number; + createdAt?: string; + description?: string; + groupID?: string; + /** 开场提问引导 */ + guidance?: Map; + isAppAdmin?: boolean; + name?: string; + operator?: string; + /** 应用优先级 */ + priority?: number; + prologue?: string; + recommendSwitch?: Bool; + /** 是否模版 */ + templateStatus?: string; + updatedAt?: string; + workspaceID?: string; +}; + +export type AttentionDataCountResp = { + total?: number; +}; + +export type AttentionUser = { + email?: string; + isAttentionUser?: boolean; + phone?: string; + userID?: string; + userName?: string; +}; + +export type AttentionUserResp = { + email?: string; + lastMessageTime?: string; + phone?: string; + userID?: string; + userName?: string; +}; + +export type authAuthorizeUsingGetParams = { + /** 业务回调地址 */ + redirect_uri: string; + /** 保持请求和回调的状态,授权成功后会回传该参数 */ + state?: string; +}; + +export type authExchangeUsingGetParams = { + /** code */ + code: string; + /** 业务回调地址 */ + redirect_uri: string; +}; + +export type Bool = string; + +export type Chat = { + conversation_id?: string; + inputs?: Record; + isIgnore?: boolean; + query?: string; + response_mode?: string; + user?: string; +}; + +export type ChatMessageReq = { + prompt?: string; + query?: string; +}; + +export type ConversationLogsResp = { + /** 消耗输出token */ + AnswerTokensCount?: number; + appID?: string; + conversationID?: string; + conversationName?: string; + createdAt?: string; + messagesCount?: number; + /** 消耗输入token */ + queryTokensCount?: number; + /** 消耗总token */ + totalTokens?: number; + userID?: string; + userInfo?: User; +}; + +export type ConversationMsg = { + conversationId?: string; + createAt?: string; + name?: string; + userId?: string; +}; + +export type ConversationResp = { + /** 消耗输出token */ + AnswerTokensCount?: number; + appID?: string; + appName?: string; + conversationID?: string; + conversationName?: string; + createdAt?: string; + lastMessagesTime?: string; + messagesCount?: number; + /** 消耗输入token */ + queryTokensCount?: number; + /** 消耗总token */ + totalTokens?: number; + userID?: string; + userInfo?: User; +}; + +export type CopyAppReq = { + appID?: string; + workspaceID?: string; +}; + +export type CreateApiTokenRESP = { + token?: string; +}; + +export type CreateAppReq = { + description?: string; + guidance?: Guidances; + name?: string; + prologue?: string; +}; + +export type CreateAppReqV2 = { + appDescription?: string; + appGroupID?: string; + /** 提示查询 */ + appGuidance?: Guidances; + appImage?: string; + appName?: string; + /** 开场白 */ + appPrologue?: string; + historyLimit?: number; + modelConfigs?: ModelConfigsMap; + prePrompt?: string; + providerId?: string; +}; + +export type CreateAttentionReq = { + followeeUserIDList?: string[]; + iamID?: string; +}; + +export type CreateFeedbacksResp = object; + +export type CreateSharePathRESP = { + path?: string; +}; + +export type Data = { + appkey?: string; + appsecret?: string; + /** 0-未开启,1-开启 */ + state?: number; + url?: string; + wxExtra?: WxExtra; +}; + +export type DatasetData = { + author?: string; + description?: string; + docCount?: number; + document_count?: number; + id?: string; + name?: string; + permission?: string; + state?: string; + uuid?: string; + word_count?: number; +}; + +export type DeleteAttentionReq = { + followeeUserIDList?: string[]; + iamID?: string; +}; + +export type DeleteFeedbacksResp = object; + +export type DeleteMemberBody = { + /** 用户id */ + userID?: string; +}; + +export type DeleteResp = { + msg?: string; +}; + +export type EmptyObject = object; + +export type ErrorResp = { + msg?: string; + type?: Record; +}; + +export type ExchangeTokenRESP = { + /** 访问令牌 */ + access_token?: string; + /** 访问令牌过期时间 */ + expires_in?: string; + /** 刷新令牌过期时间 */ + refresh_expires_in?: string; + /** 刷新令牌 */ + refresh_token?: string; + /** 令牌类型 */ + token_type?: string; +}; + +export type Feedback = { + /** 评论 */ + comment?: string; + conversation_id?: string; + createdAt?: string; + message_id?: string; + /** like/unlike */ + rating?: string; + /** 打分 */ + score?: number; + updatedAt?: string; +}; + +export type FeedbacksReqBody = { + /** 评论 */ + comment?: string; + conversation_id?: string; + /** like/unlike */ + rating?: string; + /** 分数1-10 */ + score?: number; +}; + +export type FilestreamResp = { + conversation_id?: string; +}; + +export type GetApiTokenByRandomPathRESP = { + apiTokenID?: string; + appID?: string; + appName?: string; + createdAt?: string; + recommendedContext?: AppRecommendedContext[]; + switchRecommendedContext?: boolean; + switchRecommendedQuestion?: boolean; + token?: string; + updatedAt?: string; +}; + +export type GetAppKeyReq = { + appid: string; + /** wjl,dingding,feishu,wxa,wx */ + type: string; +}; + +export type GetAttentionDataCountReq = { + appIDList?: string[]; + iamID?: string; + userID?: string; +}; + +export type GetImagePreSignedUrlResp = { + appImage?: string; + preSignedPutUrl?: string; +}; + +export type Guidances = { + items?: string[]; +}; + +export type HistoryInfo = { + /** like/unlike */ + Rating?: string; + answer?: string; + answerToken?: number; + /** 评论 */ + comment?: string; + createAt?: string; + format?: string[]; + messageId?: string; + query?: string; + queryToken?: number; + /** 打分 */ + score?: number; + totalToken?: number; +}; + +export type IAMUserInfo = { + /** 创建时间 */ + createdTime?: string; + /** Cid string `json:"cid"` */ + email?: string; + /** 用户id */ + id?: string; + idpId?: string; + /** 是否iam管理员 */ + isAdmin?: boolean; + isAppAdmin?: boolean; + /** 是否罗克佳华人员 */ + isRkUser?: boolean; + /** 是否超级管理员 */ + isSuperUser?: boolean; + isSystemAdmin?: boolean; + /** Deleted int32 `json:"deleted"` // 逻辑删除 */ + lastTime?: string; + /** 登录名 */ + loginName?: string; + /** 消息类型 */ + msgType?: number; + /** 电话 */ + phone?: string; + /** 罗克佳华用户账号 */ + rkUserCard?: string; + /** 个性签名 */ + sign?: string; + /** 状态:1可用;0未激活;-1禁用 */ + status?: number; + /** 修改时间 */ + updatedTime?: string; + /** 用户类型 */ + useType?: string; + /** 用户名 */ + userName?: string; + wechatAppId?: string; + wechatSwitch?: boolean; + wechatgzhSwitch?: boolean; +}; + +export type ListAllAttentionUser = { + data?: AttentionUser[]; + total?: number; +}; + +export type ListAppDatasetConfigResp = { + data?: AppDatasetConfig[]; + total?: number; +}; + +export type ListAppDatasets = { + Data?: AppDatasets[]; + total?: number; +}; + +export type ListAppResp = { + data?: AppResp[]; + total?: number; +}; + +export type ListAttentionConversationReq = { + appIDList?: string[]; + iamID?: string; + offset?: number; + size?: number; + userID?: string; +}; + +export type ListAttentionUserResp = { + data?: AttentionUserResp[]; + total?: number; +}; + +export type ListConversationLogsResp = { + data?: ConversationLogsResp[]; + total?: number; +}; + +export type ListConversationResp = { + data?: ConversationResp[]; + total?: number; +}; + +export type ListDatasetsResp = { + data?: DatasetData[]; + has_more?: boolean; + offset?: number; + size?: number; + total?: number; +}; + +export type ListFeedbacksResp = { + data?: Feedback[]; + total?: number; +}; + +export type ListMemberRESP = { + data?: MemberWithRoleData[]; + total?: number; +}; + +export type ListProviderResp = { + data?: ProviderResp[]; + total?: number; +}; + +export type ListUserWithAppRESP = { + data?: UserWithAppData[]; + total?: number; +}; + +export type ListWorkspaceGroup = { + data?: WorkspaceGroup[]; +}; + +export type ListWorkspacePermissions = { + data?: WorkspacePermissions[]; + total?: number; +}; + +export type Map = object; + +export type MemberBody = { + /** 角色(system_admin-系统管理员;system_user-系统管普通用户;app_admin-应用管理员;app_user-应用普通用户) */ + role?: RbacRole; + /** 用户id */ + userID?: string; +}; + +export type MemberWithRoleData = { + /** 应用角色 */ + appRole?: RbacRole; + createdAt?: string; + email?: string; + idpID?: string; + /** 是否是app管理员 */ + isAppAdmin?: boolean; + /** 是否是系统管理员 */ + isSystemAdmin?: boolean; + operator?: string; + phone?: string; + /** 角色(系统管理员、系统普通用户) */ + role?: RbacRole; + updatedAt?: string; + /** iam 用户id */ + userID?: string; + userName?: string; +}; + +export type MessagesCountResp = { + /** 请求消耗token */ + messagesCount?: number; + time?: string; +}; + +export type MessagesTokenResp = { + /** 回答消耗token */ + answerToken?: number; + /** 请求消耗token */ + queryToken?: number; + time?: string; + totalToken?: number; +}; + +export type ModelConfigsMap = { + /** 模型(ERNIE-Bot-4;ERNIE-Bot;ERNIE-Bot-turbo;gpt-3.5-turbo-16k;gpt-4-1106-preview) */ + model_type?: string; + /** 通过对已生成的token增加惩罚,减少重复生成的现象。取值范围:[1.0, 2.0] */ + penalty_score?: number; + /** 较高的数值会使输出更加随机,而较低的数值会使其更加集中和确定。默认0.95,范围 (0, 1.0] */ + temperature?: number; + /** tools call */ + tools_call?: boolean; + /** 影响输出文本的多样性,取值越大,生成文本的多样性越强。取值范围 [0, 1.0] */ + top_p?: number; +}; + +export type ModelConfigsMap2 = { + /** 模型(ERNIE-Bot-4;ERNIE-Bot;ERNIE-Bot-turbo;gpt-3.5-turbo-16k;gpt-4-1106-preview) */ + model_type?: string; + /** 通过对已生成的token增加惩罚,减少重复生成的现象。取值范围:[1.0, 2.0] */ + penalty_score?: number; + /** 较高的数值会使输出更加随机,而较低的数值会使其更加集中和确定。默认0.95,范围 (0, 1.0] */ + temperature?: number; + tools_call?: boolean; + /** 影响输出文本的多样性,取值越大,生成文本的多样性越强。取值范围 [0, 1.0] */ + top_p?: number; +}; + +export enum Permission { + 'read_only' = 'read_only', + 'operation' = 'operation', + 'no_permission' = 'no_permission', +} + +export type IPermission = keyof typeof Permission; + +export type ProviderResp = { + /** 名字 */ + name?: string; + providerID?: string; + subType?: string[]; + /** 类型 */ + type?: ProviderType; +}; + +export enum ProviderType { + 'openai' = 'openai', + 'spark' = 'spark', + 'wenxin' = 'wenxin', + 'rockai' = 'rockai', +} + +export type IProviderType = keyof typeof ProviderType; + +export type QueryTokenResp = { + /** 消耗输出token */ + AnswerTokensCount?: number; + /** 消耗输入token */ + queryTokensCount?: number; + /** 消耗总token */ + totalTokens?: number; +}; + +export type QuestionRecommendReq = { + conversation_id?: string; + /** Query string `json:"query"`Answer string `json:"answer"` */ + user?: string; +}; + +export enum RbacRole { + 'system_admin' = 'system_admin', + 'system_user' = 'system_user', + 'app_admin' = 'app_admin', + 'app_user' = 'app_user', +} + +export type IRbacRole = keyof typeof RbacRole; + +export type RecommendQuestionAndContext = { + contexts?: AppRecommendedContext[]; + questions?: string[]; +}; + +export type RefreshTokenBody = { + refreshToken?: string; +}; + +export type ReleaseDiscoverReq = { + alterAppID?: string; + /** 应用类型 */ + appType?: number; + /** 是否作为模版 TRUE:作为模版;FALSE:不作为 */ + templateStatus?: string; +}; + +export type ResponseData = { + answer?: string; + conversation_id?: string; + created_at?: number; + event?: string; + id?: string; + trace_id?: string; +}; + +export type ResponseRecommendData = { + answer?: string; + conversation_id?: string; + created_at?: number; + event?: string; + id?: string; + trace_id?: string; +}; + +export type SpeechToTextResp = { + /** 转化的结果 */ + text?: string; +}; + +export type TextToSpeechReq = { + /** 需要转的文字 */ + text?: string; +}; + +export type UpdateAppGroup = { + appGroupID?: string; +}; + +export type UpdateAppKeyStateReq = { + appid: string; + /** 0-关闭,1-启动 */ + state?: number; + /** wjl,dingding,feishu */ + type: string; +}; + +export type UpdateAppReq = { + appDescription?: string; + appGroupID?: string; + appImage?: string; + appName?: string; +}; + +export type UpdateAppReqV2 = { + appGroupID?: string; + /** 提示查询 */ + appGuidance?: Guidances; + /** 开场白 */ + appPrologue?: string; + /** 推荐内容 */ + appRecommendedContexts?: AppRecommendedContext[]; + historyLimit?: number; + modelConfigs?: ModelConfigsMap; + prePrompt?: string; + providerId?: string; + recommendSwitch?: boolean; +}; + +export type UpdateAppStatusReq = { + /** PUBLIC:公开;PRIVATE:私有 */ + appStatus?: string; +}; + +export type UpdateUserRoleBody = { + /** 角色(system_admin-系统管理员;system_user-系统管普通用户;app_admin-应用管理员;app_user-应用普通用户) */ + role?: RbacRole; + /** 用户id */ + userID?: string; +}; + +export type User = { + createdAt?: string; + email?: string; + idpID?: string; + operator?: string; + phone?: string; + /** 角色(系统管理员、系统普通用户) */ + role?: RbacRole; + updatedAt?: string; + /** iam 用户id */ + userID?: string; + userName?: string; +}; + +export type UserWithAppData = { + appWithPermissionList?: AppWithPermission[]; + createdAt?: string; + email?: string; + idpID?: string; + isSystemAdmin?: boolean; + operator?: string; + phone?: string; + /** 角色(系统管理员、系统普通用户) */ + role?: RbacRole; + updatedAt?: string; + /** iam 用户id */ + userID?: string; + userName?: string; +}; + +export type v1ApiAppAppIdApiTokenUsingGetParams = { + /** 应用id */ + appID: string; + /** 每页大小 */ + size: number; + /** 分页 */ + offset: number; +}; + +export type v1ApiAppAppIdApiTokenUsingPostParams = { + /** 应用id */ + appID: string; +}; + +export type v1ApiAppAppIdDatasetConfigsUsingDeleteParams = { + /** 应用id */ + appID: string; + /** 应用知识库配置id */ + appDatasetConfigID: string; +}; + +export type v1ApiAppAppIdDatasetConfigsUsingGetParams = { + /** 应用id */ + appID: string; +}; + +export type v1ApiAppAppIdDatasetConfigsUsingPostParams = { + /** 应用id */ + appID: string; +}; + +export type v1ApiAppAppIdDatasetConfigsUsingPutParams = { + /** 应用id */ + appID: string; +}; + +export type v1ApiAppAppIdDatasetsListUsingGetParams = { + /** 应用id */ + appID: string; + /** size */ + size?: number; + /** offset */ + offset?: number; +}; + +export type v1ApiAppAppIdDatasetsUsingDeleteParams = { + /** 应用id */ + appID: string; + /** 数据集id */ + datasetID: string; +}; + +export type V1ApiAppAppIdDatasetsUsingPostBody = API.AppDatasets[]; + +export type v1ApiAppAppIdDatasetsUsingPostParams = { + /** 应用id */ + appID: string; +}; + +export type v1ApiAppAppIdDetailsUsingGetParams = { + /** 应用id */ + appID: string; +}; + +export type v1ApiAppAppIdHourlyMessagesUsingGetParams = { + /** 应用id */ + appID: string; + /** 开始时间,秒级时间戳 */ + starTimestamp?: number; + /** 结束时间,秒级时间戳 */ + endTimestamp?: number; +}; + +export type v1ApiAppAppIdHourlyTokenUsingGetParams = { + /** 应用id */ + appID: string; + /** 开始时间,秒级时间戳 */ + starTimestamp?: number; + /** 结束时间,秒级时间戳 */ + endTimestamp?: number; +}; + +export type v1ApiAppAppIdLogsConversationIdMessagesUsingGetParams = { + /** 应用id */ + appID: string; + /** 会话id */ + conversationID: string; +}; + +export type v1ApiAppAppIdLogsUsingGetParams = { + /** 应用id */ + appID: string; + /** 会话id */ + conversationID?: string; + /** 结束时间 */ + endTimestamp?: number; + /** 页数1开始 */ + pageOffset?: number; + /** 每页数量 */ + pageSize?: number; + /** 模型id */ + providerID?: string; + /** 开始时间 */ + starTimestamp?: number; + /** 用户id */ + userID?: string; +}; + +export type v1ApiAppAppIdMemberRoleUsingPutParams = { + /** 应用id */ + appID: string; +}; + +export type v1ApiAppAppIdMemberUsingDeleteParams = { + /** 应用id */ + appID: string; +}; + +export type v1ApiAppAppIdMemberUsingGetParams = { + /** 应用id */ + appID: string; + /** 每页大小 */ + size: number; + /** 分页 */ + offset: number; +}; + +export type v1ApiAppAppIdMemberUsingPostParams = { + /** 应用id */ + appID: string; +}; + +export type v1ApiAppAppIdMessagesUsingGetParams = { + /** 应用id */ + appID: string; + /** 开始时间,秒级时间戳 */ + starTimestamp?: number; + /** 结束时间,秒级时间戳 */ + endTimestamp?: number; +}; + +export type v1ApiAppAppIdModelConfigsUsingPostParams = { + /** 应用id */ + appID: string; +}; + +export type v1ApiAppAppIdModelConfigsUsingPutParams = { + /** 应用id */ + appID: string; +}; + +export type v1ApiAppAppIdModelPromptUsingPostParams = { + /** 应用id */ + appID: string; +}; + +export type v1ApiAppAppIdOpenApiDeleteUsingDeleteParams = { + /** 应用id */ + appID: string; +}; + +export type v1ApiAppAppIdPluginUsingPutParams = { + /** 应用id */ + appID: string; +}; + +export type v1ApiAppAppIdRecommendedContextUsingGetParams = { + /** 应用id */ + appID: string; +}; + +export type v1ApiAppAppIdRecommendedContextUsingPostParams = { + /** 应用id */ + appID: string; +}; + +export type v1ApiAppAppIdShareUsingPutParams = { + /** 应用id */ + appID: string; + /** 是否h5 */ + isH5?: boolean; +}; + +export type v1ApiAppAppIdTokenUsingGetParams = { + /** 应用id */ + appID: string; + /** 开始时间,秒级时间戳 */ + starTimestamp?: number; + /** 结束时间,秒级时间戳 */ + endTimestamp?: number; +}; + +export type v1ApiAppAppIdUpdateStatusUsingPutParams = { + /** 应用id */ + appID: string; +}; + +export type v1ApiAppAppIdUpdateUsingPutParams = { + /** 应用id */ + appID: string; +}; + +export type v1ApiAppH5ShareApiTokenUsingGetParams = { + /** 分享的随机path */ + randomPath: string; +}; + +export type v1ApiAppIdCostUsingPostParams = { + /** 应用id */ + appID: string; + /** 会话id */ + conversationID?: string; + /** 结束时间 */ + endTimestamp?: number; + /** 页数1开始 */ + pageOffset?: number; + /** 每页数量 */ + pageSize?: number; + /** 模型id */ + providerID?: string; + /** 开始时间 */ + starTimestamp?: number; + /** 用户id */ + userID?: string; +}; + +export type v1ApiAppListPrivateUsingGetParams = { + /** 是否只查看会话过的应用 */ + onlyConversations?: boolean; +}; + +export type v1ApiAppListPublicUsingGetParams = { + /** 是否只查看会话过的应用 */ + onlyConversations?: boolean; +}; + +export type v1ApiAppShareApiTokenUsingGetParams = { + /** 分享的随机path */ + randomPath: string; +}; + +export type v1ApiAttentionAppListUsingGetParams = { + /** IAM用户id */ + iamID: string; +}; + +export type v1ApiAttentionMessagesHistoryUsingGetParams = { + /** IAM ID */ + iamID: string; + /** 应用id */ + appID: string; + /** 会话id */ + conversationID: string; +}; + +export type v1ApiAttentionUserAllUsingGetParams = { + /** 登陆用户IAMID */ + iamID?: string; + /** 用户id */ + isAttention?: boolean; + /** 名字或电话,模糊匹配 */ + nameOrPhone?: string; + offset?: number; + /** 电话号码 */ + phone?: string; + size?: number; + /** 用户id */ + userID?: string; + /** 用户名字用于搜索 */ + userName?: string; +}; + +export type v1ApiAttentionUserListUsingPostParams = { + /** IAM ID */ + iamID: string; + /** 默认10 */ + size?: number; + /** 默认0 */ + offset?: number; +}; + +export type v1ApiConversationsConversationIdHistoryUsingDeleteParams = { + /** 会话id */ + conversation_id: string; + /** 聊天信息id */ + message_id: string; +}; + +export type v1ApiConversationsConversationIdHistoryUsingGetParams = { + /** 会话id */ + conversation_id: string; +}; + +export type v1ApiConversationsUsingDeleteParams = { + /** 会话id */ + conversation_id: string; +}; + +export type v1ApiConversationsUsingGetParams = { + /** 用户id,空值不返回 */ + user_id?: string; +}; + +export type v1ApiFeedbacksMessageIdUsingDeleteParams = { + /** 消息id */ + message_id: string; + /** 会话id */ + conversation_id: string; +}; + +export type v1ApiFeedbacksMessageIdUsingPostParams = { + /** 消息id */ + message_id: string; +}; + +export type v1ApiFeedbacksUsingGetParams = { + conversation_ID?: string; + message_ID?: string; + /** 页数1开始 */ + pageOffset?: number; + /** 每页数量 */ + pageSize?: number; +}; + +export type V1ApiFileUsingPostBody = { + /** 文件 */ + file: string; +}; + +export type v1ApiFileUsingPostParams = { + /** 会话id */ + conversation_id?: string; + /** user id */ + user_id?: string; +}; + +export type v1ApiIamAccountUsingGetParams = { + /** openId */ + openId: string; +}; + +export type v1ApiProviderListUsingGetParams = { + /** size */ + size?: number; + /** offset */ + offset?: number; +}; + +export type v1ApiRobotWorkspaceIdAppkeyStateUsingPostParams = { + /** 空间ID */ + workspaceID: string; +}; + +export type v1ApiRobotWorkspaceIdAppkeyUsingDeleteParams = { + /** 空间ID */ + workspaceID: string; +}; + +export type v1ApiRobotWorkspaceIdAppkeyUsingGetParams = { + /** 空间ID */ + workspaceID: string; + appid: string; + /** wjl,dingding,feishu,wxa,wx */ + type: string; +}; + +export type v1ApiRobotWorkspaceIdAppkeyUsingPostParams = { + /** 空间ID */ + workspaceID: string; +}; + +export type V1ApiSpeechToTextUsingPostBody = { + /** 文件 */ + file: string; +}; + +export type v1ApiUserInfoUsingGetParams = { + /** 应用id */ + appID?: string; +}; + +export type v1ApiUserUsingGetParams = { + offset?: number; + /** 电话号码 */ + phone?: string; + size?: number; + /** 用户id */ + userID?: string; + /** 用户名字用于搜索 */ + userName?: string; +}; + +export type v2ApiAppAppIdDetailsUsingGetParams = { + /** 应用id */ + appID: string; +}; + +export type v2ApiAppAppIdUpdateUsingPostParams = { + /** 应用id */ + appID: string; +}; + +export type v2ApiAppListUsingGetParams = { + /** 是否只查看会话过的应用 */ + onlyConversations?: boolean; +}; + +export type v2ApiAppShareApiTokenUsingGetParams = { + /** 分享的随机path */ + randomPath: string; +}; + +export type v2ApiChatMessagesMessagesCountUsingGetParams = { + /** 是否查询人均,默认false */ + isPerPerson?: boolean; + /** 开始时间,秒级时间戳 */ + starTimestamp?: number; + /** 结束时间,秒级时间戳 */ + endTimestamp?: number; +}; + +export type V2ApiFileUsingPostBody = { + /** 要上传的文件 */ + files: unknown[]; +}; + +export type v2ApiFileUsingPostParams = { + /** 会话id */ + conversation_id?: string; + /** user id */ + user_id?: string; +}; + +export type v2ApiWorkspacesDefaultUsingPostParams = { + /** 空间ID */ + workspaceID: string; +}; + +export type v2ApiWorkspacesRecommendedMessageIdDetailsUsingGetParams = { + /** 消息id */ + messageId: string; +}; + +export type V2ApiWorkspacesWorkspaceIdAppAppIdDatasetsJoinUsingPostBody = + API.AppDatasets[]; + +export type v2ApiWorkspacesWorkspaceIdAppAppIdDatasetsJoinUsingPostParams = { + /** 空间ID */ + workspaceID: string; + /** 应用id */ + appID: string; +}; + +export type v2ApiWorkspacesWorkspaceIdAppAppIdDatasetsUsingDeleteParams = { + /** 应用id */ + appID: string; + /** 空间ID */ + workspaceID: string; + /** 数据集id */ + datasetID: string; +}; + +export type v2ApiWorkspacesWorkspaceIdAppAppIdDetailsUsingGetParams = { + /** 空间ID */ + workspaceID: string; + /** 应用id */ + appID: string; +}; + +export type v2ApiWorkspacesWorkspaceIdAppAppIdHourlyMessagesUsingGetParams = { + /** 空间ID */ + workspaceID: string; + /** 应用id */ + appID: string; + /** 开始时间,秒级时间戳 */ + starTimestamp?: number; + /** 结束时间,秒级时间戳 */ + endTimestamp?: number; +}; + +export type v2ApiWorkspacesWorkspaceIdAppAppIdHourlyTokenUsingGetParams = { + /** 空间ID */ + workspaceID: string; + /** 应用id */ + appID: string; + /** 开始时间,秒级时间戳 */ + starTimestamp?: number; + /** 结束时间,秒级时间戳 */ + endTimestamp?: number; +}; + +export type v2ApiWorkspacesWorkspaceIdAppAppIdLogsUsingGetParams = { + /** 应用id */ + appID: string; + /** 空间ID */ + workspaceID: string; + /** 会话id */ + conversationID?: string; + /** 结束时间 */ + endTimestamp?: number; + /** 页数1开始 */ + pageOffset?: number; + /** 每页数量 */ + pageSize?: number; + /** 模型id */ + providerID?: string; + /** 开始时间 */ + starTimestamp?: number; + /** 用户id */ + userID?: string; +}; + +export type v2ApiWorkspacesWorkspaceIdAppAppIdMessagesUsingGetParams = { + /** 空间ID */ + workspaceID: string; + /** 应用id */ + appID: string; + /** 开始时间,秒级时间戳 */ + starTimestamp?: number; + /** 结束时间,秒级时间戳 */ + endTimestamp?: number; +}; + +export type v2ApiWorkspacesWorkspaceIdAppAppIdModelConfigsUsingPutParams = { + /** 应用id */ + appID: string; + /** 空间ID */ + workspaceID: string; +}; + +export type v2ApiWorkspacesWorkspaceIdAppAppIdPluginUsingGetParams = { + /** 应用id */ + appID: string; + /** 空间ID */ + workspaceID: string; +}; + +export type v2ApiWorkspacesWorkspaceIdAppAppIdTokenUsingGetParams = { + /** 应用id */ + appID: string; + /** 开始时间,秒级时间戳 */ + starTimestamp?: number; + /** 结束时间,秒级时间戳 */ + endTimestamp?: number; +}; + +export type v2ApiWorkspacesWorkspaceIdAppAppIdUpdateStatusUsingPutParams = { + /** 空间ID */ + workspaceID: string; + /** 应用id */ + appID: string; +}; + +export type v2ApiWorkspacesWorkspaceIdAppAppIdUsingPostParams = { + /** 空间ID */ + workspaceID: string; + /** 应用id */ + appID: string; +}; + +export type v2ApiWorkspacesWorkspaceIdAppsAppIdBaseUsingPostParams = { + /** 应用id */ + appID: string; + /** 空间ID */ + workspaceID: string; +}; + +export type v2ApiWorkspacesWorkspaceIdAppsAppIdGroupUsingPostParams = { + /** 应用id */ + appID: string; + /** 空间ID */ + workspaceID: string; +}; + +export type v2ApiWorkspacesWorkspaceIdAppsAppIdUsingDeleteParams = { + /** 应用id */ + appID: string; + /** 空间ID */ + workspaceID: string; +}; + +export type v2ApiWorkspacesWorkspaceIdAppsUsingGetParams = { + /** 空间ID */ + workspaceID: string; + /** 是否只查看会话过的应用 */ + onlyConversations?: boolean; + /** 应用名,模糊查询 */ + appName?: string; +}; + +export type v2ApiWorkspacesWorkspaceIdAppsUsingPostParams = { + /** 空间ID */ + workspaceID: string; +}; + +export type v2ApiWorkspacesWorkspaceIdDatasetsUsingGetParams = { + /** 空间ID */ + workspaceID: string; +}; + +export type v2ApiWorkspacesWorkspaceIdDatasetsUsingPostParams = { + /** 空间ID */ + workspaceID: string; +}; + +export type v2ApiWorkspacesWorkspaceIdGroupsUsingGetParams = { + /** 空间ID */ + workspaceID: string; +}; + +export type v2ApiWorkspacesWorkspaceIdGroupsUsingPostParams = { + /** 空间ID */ + workspaceID: string; +}; + +export type v2ApiWorkspacesWorkspaceIdGroupsWorkspaceGroupIdUsingDeleteParams = + { + /** 空间ID */ + workspaceID: string; + /** 分组ID */ + workspaceGroupID: string; + }; + +export type v2ApiWorkspacesWorkspaceIdGroupsWorkspaceGroupIdUsingPostParams = { + /** 空间ID */ + workspaceID: string; + /** 分组ID */ + workspaceGroupID: string; +}; + +export type v2ApiWorkspacesWorkspaceIdPermissionsUsingGetParams = { + /** 空间ID */ + workspaceID: string; +}; + +export type v2ApiWorkspacesWorkspaceIdUsersUsingGetParams = { + /** 空间ID */ + workspaceID: string; +}; + +export type v2ApiWorkspacesWorkspaceIdUsersUsingPostParams = { + /** 空间ID */ + workspaceID: string; +}; + +export type v2ApiWorkspacesWorkspaceIdUserUserIdUsingDeleteParams = { + /** 空间ID */ + workspaceID: string; + /** userID */ + userID: string; +}; + +export type v2ApiWorkspacesWorkspaceIdUsingDeleteParams = { + /** 空间ID */ + workspaceID: string; +}; + +export type v2ApiWorkspacesWorkspaceIdUsingPostParams = { + /** 空间ID */ + workspaceID: string; +}; + +export type WJLAccount = { + code?: number; + data?: { + avatar?: string; + iamUserId?: string; + nameInTeam?: string; + nickName?: string; + phone?: string; + realNameFlag?: number; + }; + msg?: string; + success?: boolean; +}; + +export type WorkspaceGroup = { + createdAt?: string; + /** 分组名 */ + name?: string; + updatedAt?: string; + workspaceGroupID?: string; + workspaceID?: string; +}; + +export type WorkspaceGroupReq = { + name?: string; +}; + +export type WorkspaceListResp = { + data?: WorkspaceResp[]; + total?: number; +}; + +export type WorkspacePermissions = { + createdAt?: string; + email?: string; + idpID?: string; + operator?: string; + /** 枚举read_only(只读)、operation(操作) */ + permission?: Permission; + phone?: string; + /** 角色(系统管理员、系统普通用户) */ + role?: RbacRole; + updatedAt?: string; + /** iam 用户id */ + userID?: string; + userName?: string; +}; + +export type WorkspaceReq = { + /** 描述 */ + description?: string; + /** 空间名 */ + name?: string; +}; + +export type WorkspaceResp = { + /** 空间描述 */ + description?: string; + /** 空间名 */ + name?: string; + /** 空间ID */ + workspaceID?: string; +}; + +export enum WorkspaceRole { + 'workspace_admin' = 'workspace_admin', + 'workspace_user' = 'workspace_user', +} + +export type IWorkspaceRole = keyof typeof WorkspaceRole; + +export type WorkspaceUser = { + /** workspace_admin空间超管用户;workspace_user空间普通用户 */ + role?: WorkspaceRole; + /** 用户id */ + userID?: string; +}; + +export type WxExtra = { + encodingAESKey?: string; + token?: string; +}; +/* eslint-disable */ +// @ts-ignore +import { request } from 'axios'; + +import * as API from './types'; + +/** UpdateAppKeyState 为应用获取各种类型机器人状态 POST /llmops/v1/api/robot/${param0}/appkey/state */ +export async function v1ApiRobotWorkspaceIdAppkeyStateUsingPost({ + params, + body, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v1ApiRobotWorkspaceIdAppkeyStateUsingPostParams; + body: API.UpdateAppKeyStateReq; + options?: { [key: string]: unknown }; +}) { + const { workspaceID: param0, ...queryParams } = params; + + return request(`/llmops/v1/api/robot/${param0}/appkey/state`, { + method: 'POST', + params: { ...queryParams }, + data: body, + ...(options || {}), + }); +} +/* eslint-disable */ +// @ts-ignore +import { request } from 'axios'; + +import * as API from './types'; + +/** ListUser 系统全局用户列表 GET /llmops/v1/api/user */ +export async function v1ApiUserUsingGet({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v1ApiUserUsingGetParams; + options?: { [key: string]: unknown }; +}) { + return request('/llmops/v1/api/user', { + method: 'GET', + params: { + // size has a default value: 10 + size: '10', + + ...params, + }, + ...(options || {}), + }); +} + +/** GetUserInfoByToken 获取iam用户数据 GET /llmops/v1/api/user/info */ +export async function v1ApiUserInfoUsingGet({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v1ApiUserInfoUsingGetParams; + options?: { [key: string]: unknown }; +}) { + return request('/llmops/v1/api/user/info', { + method: 'GET', + params: { + ...params, + }, + ...(options || {}), + }); +} + +/** UpdateUserRole 更新用户角色 PUT /llmops/v1/api/user/role */ +export async function v1ApiUserRoleUsingPut({ + body, + options, +}: { + body: API.UpdateUserRoleBody; + options?: { [key: string]: unknown }; +}) { + return request('/llmops/v1/api/user/role', { + method: 'PUT', + data: body, + ...(options || {}), + }); +} +/* eslint-disable */ +// @ts-ignore +import { request } from 'axios'; + +import * as API from './types'; + +/** GetWorkspaceList 空间列表 GET /llmops/v2/api/workspaces */ +export async function v2ApiWorkspacesUsingGet({ + options, +}: { + options?: { [key: string]: unknown }; +}) { + return request('/llmops/v2/api/workspaces', { + method: 'GET', + ...(options || {}), + }); +} + +/** CreateWorkspace 创建空间 POST /llmops/v2/api/workspaces */ +export async function v2ApiWorkspacesUsingPost({ + body, + options, +}: { + body: API.WorkspaceReq; + options?: { [key: string]: unknown }; +}) { + return request('/llmops/v2/api/workspaces', { + method: 'POST', + data: body, + ...(options || {}), + }); +} + +/** GetDefaultWorkspace 获取用户默认空间 GET /llmops/v2/api/workspaces-default */ +export async function v2ApiWorkspacesDefaultUsingGet({ + options, +}: { + options?: { [key: string]: unknown }; +}) { + return request('/llmops/v2/api/workspaces-default', { + method: 'GET', + ...(options || {}), + }); +} + +/** 切换默认空间 POST /llmops/v2/api/workspaces-default */ +export async function v2ApiWorkspacesDefaultUsingPost({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v2ApiWorkspacesDefaultUsingPostParams; + options?: { [key: string]: unknown }; +}) { + return request('/llmops/v2/api/workspaces-default', { + method: 'POST', + params: { + ...params, + }, + ...(options || {}), + }); +} + +/** UpdateWorkspace 更新空间 POST /llmops/v2/api/workspaces/${param0} */ +export async function v2ApiWorkspacesWorkspaceIdUsingPost({ + params, + body, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v2ApiWorkspacesWorkspaceIdUsingPostParams; + body: API.WorkspaceReq; + options?: { [key: string]: unknown }; +}) { + const { workspaceID: param0, ...queryParams } = params; + + return request(`/llmops/v2/api/workspaces/${param0}`, { + method: 'POST', + params: { ...queryParams }, + data: body, + ...(options || {}), + }); +} + +/** DeleteWorkspace 删除空间 DELETE /llmops/v2/api/workspaces/${param0} */ +export async function v2ApiWorkspacesWorkspaceIdUsingDelete({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v2ApiWorkspacesWorkspaceIdUsingDeleteParams; + options?: { [key: string]: unknown }; +}) { + const { workspaceID: param0, ...queryParams } = params; + + return request(`/llmops/v2/api/workspaces/${param0}`, { + method: 'DELETE', + params: { ...queryParams }, + ...(options || {}), + }); +} + +/** CreateDatasetsJoinV2 创建 app 数据集关联 POST /llmops/v2/api/workspaces/${param0}/app/${param1}/datasets/join */ +export async function v2ApiWorkspacesWorkspaceIdAppAppIdDatasetsJoinUsingPost({ + params, + body, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v2ApiWorkspacesWorkspaceIdAppAppIdDatasetsJoinUsingPostParams; + body: API.V2ApiWorkspacesWorkspaceIdAppAppIdDatasetsJoinUsingPostBody; + options?: { [key: string]: unknown }; +}) { + const { workspaceID: param0, appID: param1, ...queryParams } = params; + + return request( + `/llmops/v2/api/workspaces/${param0}/app/${param1}/datasets/join`, + { + method: 'POST', + params: { ...queryParams }, + data: body, + ...(options || {}), + } + ); +} + +/** GetWorkspaceDatasetsList 空间下数据集列表 GET /llmops/v2/api/workspaces/${param0}/datasets */ +export async function v2ApiWorkspacesWorkspaceIdDatasetsUsingGet({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v2ApiWorkspacesWorkspaceIdDatasetsUsingGetParams; + options?: { [key: string]: unknown }; +}) { + const { workspaceID: param0, ...queryParams } = params; + + return request( + `/llmops/v2/api/workspaces/${param0}/datasets`, + { + method: 'GET', + params: { ...queryParams }, + ...(options || {}), + } + ); +} + +/** CreateWorkspaceDatasets 创建空间下数据集 POST /llmops/v2/api/workspaces/${param0}/datasets */ +export async function v2ApiWorkspacesWorkspaceIdDatasetsUsingPost({ + params, + body, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v2ApiWorkspacesWorkspaceIdDatasetsUsingPostParams; + body: API.AppDataset; + options?: { [key: string]: unknown }; +}) { + const { workspaceID: param0, ...queryParams } = params; + + return request(`/llmops/v2/api/workspaces/${param0}/datasets`, { + method: 'POST', + params: { ...queryParams }, + data: body, + ...(options || {}), + }); +} + +/** GetWorkspaceUserRole 查询空间用户权限 GET /llmops/v2/api/workspaces/${param0}/permissions */ +export async function v2ApiWorkspacesWorkspaceIdPermissionsUsingGet({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v2ApiWorkspacesWorkspaceIdPermissionsUsingGetParams; + options?: { [key: string]: unknown }; +}) { + const { workspaceID: param0, ...queryParams } = params; + + return request( + `/llmops/v2/api/workspaces/${param0}/permissions`, + { + method: 'GET', + params: { ...queryParams }, + ...(options || {}), + } + ); +} + +/** DeleteWorkspaceUsers 删除空间下用户 DELETE /llmops/v2/api/workspaces/${param0}/user/${param1} */ +export async function v2ApiWorkspacesWorkspaceIdUserUserIdUsingDelete({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v2ApiWorkspacesWorkspaceIdUserUserIdUsingDeleteParams; + options?: { [key: string]: unknown }; +}) { + const { workspaceID: param0, userID: param1, ...queryParams } = params; + + return request( + `/llmops/v2/api/workspaces/${param0}/user/${param1}`, + { + method: 'DELETE', + params: { ...queryParams }, + ...(options || {}), + } + ); +} + +/** GetWorkspaceUsers 查询空间下用户列表 GET /llmops/v2/api/workspaces/${param0}/users */ +export async function v2ApiWorkspacesWorkspaceIdUsersUsingGet({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v2ApiWorkspacesWorkspaceIdUsersUsingGetParams; + options?: { [key: string]: unknown }; +}) { + const { workspaceID: param0, ...queryParams } = params; + + return request( + `/llmops/v2/api/workspaces/${param0}/users`, + { + method: 'GET', + params: { ...queryParams }, + ...(options || {}), + } + ); +} + +/** CreateOrUpdateWorkspaceUsers 添加或更新空间下用户角色 POST /llmops/v2/api/workspaces/${param0}/users */ +export async function v2ApiWorkspacesWorkspaceIdUsersUsingPost({ + params, + body, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v2ApiWorkspacesWorkspaceIdUsersUsingPostParams; + body: API.WorkspaceUser; + options?: { [key: string]: unknown }; +}) { + const { workspaceID: param0, ...queryParams } = params; + + return request(`/llmops/v2/api/workspaces/${param0}/users`, { + method: 'POST', + params: { ...queryParams }, + data: body, + ...(options || {}), + }); +} +/* eslint-disable */ +// @ts-ignore +import { request } from 'axios'; + +import * as API from './types'; + +/** CopyApp 复制 app POST /llmops/v2/api/copy_apps */ +export async function v2ApiCopyAppsUsingPost({ + body, + options, +}: { + body: API.CopyAppReq; + options?: { [key: string]: unknown }; +}) { + return request('/llmops/v2/api/copy_apps', { + method: 'POST', + data: body, + ...(options || {}), + }); +} + +/** UpdateAppV2.1 更新 app 信息 POST /llmops/v2/api/workspaces/${param0}/app/${param1} */ +export async function v2ApiWorkspacesWorkspaceIdAppAppIdUsingPost({ + params, + body, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v2ApiWorkspacesWorkspaceIdAppAppIdUsingPostParams; + body: API.UpdateAppReqV2; + options?: { [key: string]: unknown }; +}) { + const { workspaceID: param0, appID: param1, ...queryParams } = params; + + return request(`/llmops/v2/api/workspaces/${param0}/app/${param1}`, { + method: 'POST', + params: { ...queryParams }, + data: body, + ...(options || {}), + }); +} + +/** GetAppDetailsV2.1 查询 app 详情 GET /llmops/v2/api/workspaces/${param0}/app/${param1}/details */ +export async function v2ApiWorkspacesWorkspaceIdAppAppIdDetailsUsingGet({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v2ApiWorkspacesWorkspaceIdAppAppIdDetailsUsingGetParams; + options?: { [key: string]: unknown }; +}) { + const { workspaceID: param0, appID: param1, ...queryParams } = params; + + return request( + `/llmops/v2/api/workspaces/${param0}/app/${param1}/details`, + { + method: 'GET', + params: { ...queryParams }, + ...(options || {}), + } + ); +} + +/** GetSumHourlyMessagesCountV2.1 每小时messages数 GET /llmops/v2/api/workspaces/${param0}/app/${param1}/hourly-messages */ +export async function v2ApiWorkspacesWorkspaceIdAppAppIdHourlyMessagesUsingGet({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v2ApiWorkspacesWorkspaceIdAppAppIdHourlyMessagesUsingGetParams; + options?: { [key: string]: unknown }; +}) { + const { workspaceID: param0, appID: param1, ...queryParams } = params; + + return request( + `/llmops/v2/api/workspaces/${param0}/app/${param1}/hourly-messages`, + { + method: 'GET', + params: { + ...queryParams, + }, + ...(options || {}), + } + ); +} + +/** GetSumHourlyTokenV2.1 每小时token数 GET /llmops/v2/api/workspaces/${param0}/app/${param1}/hourly-token */ +export async function v2ApiWorkspacesWorkspaceIdAppAppIdHourlyTokenUsingGet({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v2ApiWorkspacesWorkspaceIdAppAppIdHourlyTokenUsingGetParams; + options?: { [key: string]: unknown }; +}) { + const { workspaceID: param0, appID: param1, ...queryParams } = params; + + return request( + `/llmops/v2/api/workspaces/${param0}/app/${param1}/hourly-token`, + { + method: 'GET', + params: { + ...queryParams, + }, + ...(options || {}), + } + ); +} + +/** GetSumDailyMessagesCountV2.1 每日messages数 GET /llmops/v2/api/workspaces/${param0}/app/${param1}/messages */ +export async function v2ApiWorkspacesWorkspaceIdAppAppIdMessagesUsingGet({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v2ApiWorkspacesWorkspaceIdAppAppIdMessagesUsingGetParams; + options?: { [key: string]: unknown }; +}) { + const { workspaceID: param0, appID: param1, ...queryParams } = params; + + return request( + `/llmops/v2/api/workspaces/${param0}/app/${param1}/messages`, + { + method: 'GET', + params: { + ...queryParams, + }, + ...(options || {}), + } + ); +} + +/** UpdateAppStatusV2.1 更新 app 状态 PUT /llmops/v2/api/workspaces/${param0}/app/${param1}/update_status */ +export async function v2ApiWorkspacesWorkspaceIdAppAppIdUpdateStatusUsingPut({ + params, + body, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v2ApiWorkspacesWorkspaceIdAppAppIdUpdateStatusUsingPutParams; + body: API.UpdateAppStatusReq; + options?: { [key: string]: unknown }; +}) { + const { workspaceID: param0, appID: param1, ...queryParams } = params; + + return request( + `/llmops/v2/api/workspaces/${param0}/app/${param1}/update_status`, + { + method: 'PUT', + params: { ...queryParams }, + data: body, + ...(options || {}), + } + ); +} + +/** ListAppV2.1 查询用户关联的 app 列表 GET /llmops/v2/api/workspaces/${param0}/apps */ +export async function v2ApiWorkspacesWorkspaceIdAppsUsingGet({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v2ApiWorkspacesWorkspaceIdAppsUsingGetParams; + options?: { [key: string]: unknown }; +}) { + const { workspaceID: param0, ...queryParams } = params; + + return request(`/llmops/v2/api/workspaces/${param0}/apps`, { + method: 'GET', + params: { + ...queryParams, + }, + ...(options || {}), + }); +} + +/** CreateAppV2.1 创建 app POST /llmops/v2/api/workspaces/${param0}/apps */ +export async function v2ApiWorkspacesWorkspaceIdAppsUsingPost({ + params, + body, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v2ApiWorkspacesWorkspaceIdAppsUsingPostParams; + body: API.CreateAppReqV2; + options?: { [key: string]: unknown }; +}) { + const { workspaceID: param0, ...queryParams } = params; + + return request(`/llmops/v2/api/workspaces/${param0}/apps`, { + method: 'POST', + params: { ...queryParams }, + data: body, + ...(options || {}), + }); +} + +/** DeleteDatasetsJoinV2.1 删除 app 数据集关联 DELETE /llmops/v2/api/workspaces/${param1}/app/${param0}/datasets */ +export async function v2ApiWorkspacesWorkspaceIdAppAppIdDatasetsUsingDelete({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v2ApiWorkspacesWorkspaceIdAppAppIdDatasetsUsingDeleteParams; + options?: { [key: string]: unknown }; +}) { + const { appID: param0, workspaceID: param1, ...queryParams } = params; + + return request( + `/llmops/v2/api/workspaces/${param1}/app/${param0}/datasets`, + { + method: 'DELETE', + params: { + ...queryParams, + }, + ...(options || {}), + } + ); +} + +/** GetAppLogsV2.1 查询 app 日志与标注 GET /llmops/v2/api/workspaces/${param1}/app/${param0}/logs */ +export async function v2ApiWorkspacesWorkspaceIdAppAppIdLogsUsingGet({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v2ApiWorkspacesWorkspaceIdAppAppIdLogsUsingGetParams; + options?: { [key: string]: unknown }; +}) { + const { appID: param0, workspaceID: param1, ...queryParams } = params; + + return request( + `/llmops/v2/api/workspaces/${param1}/app/${param0}/logs`, + { + method: 'GET', + params: { + ...queryParams, + }, + ...(options || {}), + } + ); +} + +/** UpdateModelConfigsV2.1 更新 app model configs PUT /llmops/v2/api/workspaces/${param1}/app/${param0}/model-configs */ +export async function v2ApiWorkspacesWorkspaceIdAppAppIdModelConfigsUsingPut({ + params, + body, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v2ApiWorkspacesWorkspaceIdAppAppIdModelConfigsUsingPutParams; + body: API.AppModelConfigs; + options?: { [key: string]: unknown }; +}) { + const { appID: param0, workspaceID: param1, ...queryParams } = params; + + return request( + `/llmops/v2/api/workspaces/${param1}/app/${param0}/model-configs`, + { + method: 'PUT', + params: { ...queryParams }, + data: body, + ...(options || {}), + } + ); +} + +/** GetPluginListV2.1 获取插件列表 GET /llmops/v2/api/workspaces/${param1}/app/${param0}/plugin */ +export async function v2ApiWorkspacesWorkspaceIdAppAppIdPluginUsingGet({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v2ApiWorkspacesWorkspaceIdAppAppIdPluginUsingGetParams; + options?: { [key: string]: unknown }; +}) { + const { appID: param0, workspaceID: param1, ...queryParams } = params; + + return request( + `/llmops/v2/api/workspaces/${param1}/app/${param0}/plugin`, + { + method: 'GET', + params: { ...queryParams }, + ...(options || {}), + } + ); +} + +/** GetSumDailyTokenV2.1 每日token GET /llmops/v2/api/workspaces/${param1}/app/${param0}/token */ +export async function v2ApiWorkspacesWorkspaceIdAppAppIdTokenUsingGet({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v2ApiWorkspacesWorkspaceIdAppAppIdTokenUsingGetParams; + options?: { [key: string]: unknown }; +}) { + const { appID: param0, workspaceID: param1, ...queryParams } = params; + + return request( + `/llmops/v2/api/workspaces/${param1}/app/${param0}/token`, + { + method: 'GET', + params: { + ...queryParams, + }, + ...(options || {}), + } + ); +} + +/** DeleteAppV2.1 删除 app DELETE /llmops/v2/api/workspaces/${param1}/apps/${param0} */ +export async function v2ApiWorkspacesWorkspaceIdAppsAppIdUsingDelete({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v2ApiWorkspacesWorkspaceIdAppsAppIdUsingDeleteParams; + options?: { [key: string]: unknown }; +}) { + const { appID: param0, workspaceID: param1, ...queryParams } = params; + + return request( + `/llmops/v2/api/workspaces/${param1}/apps/${param0}`, + { + method: 'DELETE', + params: { ...queryParams }, + ...(options || {}), + } + ); +} + +/** UpdateAppImage 更新 app名称头像 POST /llmops/v2/api/workspaces/${param1}/apps/${param0}/base */ +export async function v2ApiWorkspacesWorkspaceIdAppsAppIdBaseUsingPost({ + params, + body, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v2ApiWorkspacesWorkspaceIdAppsAppIdBaseUsingPostParams; + body: API.UpdateAppReq; + options?: { [key: string]: unknown }; +}) { + const { appID: param0, workspaceID: param1, ...queryParams } = params; + + return request( + `/llmops/v2/api/workspaces/${param1}/apps/${param0}/base`, + { + method: 'POST', + params: { ...queryParams }, + data: body, + ...(options || {}), + } + ); +} + +/** UpdateAppGroup 更新 app 分组 POST /llmops/v2/api/workspaces/${param1}/apps/${param0}/group */ +export async function v2ApiWorkspacesWorkspaceIdAppsAppIdGroupUsingPost({ + params, + body, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v2ApiWorkspacesWorkspaceIdAppsAppIdGroupUsingPostParams; + body: API.UpdateAppGroup; + options?: { [key: string]: unknown }; +}) { + const { appID: param0, workspaceID: param1, ...queryParams } = params; + + return request( + `/llmops/v2/api/workspaces/${param1}/apps/${param0}/group`, + { + method: 'POST', + params: { ...queryParams }, + data: body, + ...(options || {}), + } + ); +} + +/** GetAppRecommendedContext 获取自定义推荐问题 & 推荐开关 GET /llmops/v2/api/workspaces/recommended/${param0}/details */ +export async function v2ApiWorkspacesRecommendedMessageIdDetailsUsingGet({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v2ApiWorkspacesRecommendedMessageIdDetailsUsingGetParams; + options?: { [key: string]: unknown }; +}) { + const { messageId: param0, ...queryParams } = params; + + return request( + `/llmops/v2/api/workspaces/recommended/${param0}/details`, + { + method: 'GET', + params: { ...queryParams }, + ...(options || {}), + } + ); +} +/* eslint-disable */ +// @ts-ignore +import { request } from 'axios'; + +import * as API from './types'; + +/** GetWorkspaceGroupList 空间分组列表 GET /llmops/v2/api/workspaces/${param0}/groups */ +export async function v2ApiWorkspacesWorkspaceIdGroupsUsingGet({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v2ApiWorkspacesWorkspaceIdGroupsUsingGetParams; + options?: { [key: string]: unknown }; +}) { + const { workspaceID: param0, ...queryParams } = params; + + return request( + `/llmops/v2/api/workspaces/${param0}/groups`, + { + method: 'GET', + params: { ...queryParams }, + ...(options || {}), + } + ); +} + +/** CreateWorkspaceGroup 创建空间分组 POST /llmops/v2/api/workspaces/${param0}/groups */ +export async function v2ApiWorkspacesWorkspaceIdGroupsUsingPost({ + params, + body, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v2ApiWorkspacesWorkspaceIdGroupsUsingPostParams; + body: API.WorkspaceGroupReq; + options?: { [key: string]: unknown }; +}) { + const { workspaceID: param0, ...queryParams } = params; + + return request( + `/llmops/v2/api/workspaces/${param0}/groups`, + { + method: 'POST', + params: { ...queryParams }, + data: body, + ...(options || {}), + } + ); +} + +/** UpdateWorkspaceGroup 更新分组 POST /llmops/v2/api/workspaces/${param0}/groups/${param1} */ +export async function v2ApiWorkspacesWorkspaceIdGroupsWorkspaceGroupIdUsingPost({ + params, + body, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v2ApiWorkspacesWorkspaceIdGroupsWorkspaceGroupIdUsingPostParams; + body: API.WorkspaceGroupReq; + options?: { [key: string]: unknown }; +}) { + const { + workspaceID: param0, + workspaceGroupID: param1, + ...queryParams + } = params; + + return request( + `/llmops/v2/api/workspaces/${param0}/groups/${param1}`, + { + method: 'POST', + params: { ...queryParams }, + data: body, + ...(options || {}), + } + ); +} + +/** DeleteWorkspaceGroup 删除分组 DELETE /llmops/v2/api/workspaces/${param0}/groups/${param1} */ +export async function v2ApiWorkspacesWorkspaceIdGroupsWorkspaceGroupIdUsingDelete({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v2ApiWorkspacesWorkspaceIdGroupsWorkspaceGroupIdUsingDeleteParams; + options?: { [key: string]: unknown }; +}) { + const { + workspaceID: param0, + workspaceGroupID: param1, + ...queryParams + } = params; + + return request( + `/llmops/v2/api/workspaces/${param0}/groups/${param1}`, + { + method: 'DELETE', + params: { ...queryParams }, + ...(options || {}), + } + ); +} diff --git "a/test/__snapshots__/common/\346\265\213\350\257\225\347\224\237\346\210\220 JavaScript.snap" "b/test/__snapshots__/common/\346\265\213\350\257\225\347\224\237\346\210\220 JavaScript.snap" new file mode 100644 index 0000000..40d1b15 --- /dev/null +++ "b/test/__snapshots__/common/\346\265\213\350\257\225\347\224\237\346\210\220 JavaScript.snap" @@ -0,0 +1,3489 @@ +import { request } from 'axios'; + +/** AddAppKey 为应用添加各种类型机器人appkey POST /llmops/v1/api/robot/${param0}/appkey */ +export async function v1ApiRobotWorkspaceIdAppkeyUsingPost({ + params, + body, + options, +}) { + const { workspaceID: param0, ...queryParams } = params; + + return request(`/llmops/v1/api/robot/${param0}/appkey`, { + method: 'POST', + params: { ...queryParams }, + data: body, + ...(options || {}), + }); +} +import { queryOptions, useMutation } from '@tanstack/react-query'; +import { request } from 'axios'; + +import * as apis from './addAppKey'; + +/** AddAppKey 为应用添加各种类型机器人appkey POST /llmops/v1/api/robot/${param0}/appkey */ +export function useV1ApiRobotWorkspaceIdAppkeyUsingPostMutation(options) { + const { onSuccess, onError } = options || {}; + + const response = useMutation({ + mutationFn: apis.v1ApiRobotWorkspaceIdAppkeyUsingPost, + onSuccess(data) { + onSuccess && onSuccess(data); + }, + onError(error) { + onError && onError(error); + }, + }); + + return response; +} +import { request } from 'axios'; + +/** ListApiToken 获取app 的 token 列表 GET /llmops/v1/api/app/${param0}/api-token */ +export async function v1ApiAppAppIdApiTokenUsingGet({ params, options }) { + const { appID: param0, ...queryParams } = params; + + return request(`/llmops/v1/api/app/${param0}/api-token`, { + method: 'GET', + params: { + ...queryParams, + }, + ...(options || {}), + }); +} + +/** CreateApiToken 创建 app 的token POST /llmops/v1/api/app/${param0}/api-token */ +export async function v1ApiAppAppIdApiTokenUsingPost({ params, options }) { + const { appID: param0, ...queryParams } = params; + + return request(`/llmops/v1/api/app/${param0}/api-token`, { + method: 'POST', + params: { ...queryParams }, + ...(options || {}), + }); +} +import { queryOptions, useMutation } from '@tanstack/react-query'; +import { request } from 'axios'; + +import * as apis from './apiToken'; + +/** ListApiToken 获取app 的 token 列表 GET /llmops/v1/api/app/${param0}/api-token */ +export function v1ApiAppAppIdApiTokenUsingGetQueryOptions(options) { + return queryOptions({ + queryFn: async ({ queryKey }) => { + return apis.v1ApiAppAppIdApiTokenUsingGet(queryKey[1]); + }, + queryKey: ['v1ApiAppAppIdApiTokenUsingGet', options], + }); +} + +/** CreateApiToken 创建 app 的token POST /llmops/v1/api/app/${param0}/api-token */ +export function useV1ApiAppAppIdApiTokenUsingPostMutation(options) { + const { onSuccess, onError } = options || {}; + + const response = useMutation({ + mutationFn: apis.v1ApiAppAppIdApiTokenUsingPost, + onSuccess(data) { + onSuccess && onSuccess(data); + }, + onError(error) { + onError && onError(error); + }, + }); + + return response; +} +import { request } from 'axios'; + +/** GetAppCostTokens 查询 app token消耗 POST /llmops/v1/api/${param0}/cost */ +export async function v1ApiAppIdCostUsingPost({ params, options }) { + const { appID: param0, ...queryParams } = params; + + return request(`/llmops/v1/api/${param0}/cost`, { + method: 'POST', + params: { + ...queryParams, + }, + ...(options || {}), + }); +} + +/** CreateApp 创建 app POST /llmops/v1/api/app */ +export async function v1ApiAppUsingPost({ body, options }) { + return request('/llmops/v1/api/app', { + method: 'POST', + data: body, + ...(options || {}), + }); +} + +/** DeleteApp 删除 app DELETE /llmops/v1/api/app/${param0}/delete */ +export async function v1ApiAppAppIdOpenApiDeleteUsingDelete({ + params, + options, +}) { + const { appID: param0, ...queryParams } = params; + + return request(`/llmops/v1/api/app/${param0}/delete`, { + method: 'DELETE', + params: { ...queryParams }, + ...(options || {}), + }); +} + +/** GetAppDetails 查询 app 详情 GET /llmops/v1/api/app/${param0}/details */ +export async function v1ApiAppAppIdDetailsUsingGet({ params, options }) { + const { appID: param0, ...queryParams } = params; + + return request(`/llmops/v1/api/app/${param0}/details`, { + method: 'GET', + params: { ...queryParams }, + ...(options || {}), + }); +} + +/** GetSumHourlyMessagesCount 每小时messages数 GET /llmops/v1/api/app/${param0}/hourly-messages */ +export async function v1ApiAppAppIdHourlyMessagesUsingGet({ params, options }) { + const { appID: param0, ...queryParams } = params; + + return request(`/llmops/v1/api/app/${param0}/hourly-messages`, { + method: 'GET', + params: { + ...queryParams, + }, + ...(options || {}), + }); +} + +/** GetSumHourlyToken 每小时token数 GET /llmops/v1/api/app/${param0}/hourly-token */ +export async function v1ApiAppAppIdHourlyTokenUsingGet({ params, options }) { + const { appID: param0, ...queryParams } = params; + + return request(`/llmops/v1/api/app/${param0}/hourly-token`, { + method: 'GET', + params: { + ...queryParams, + }, + ...(options || {}), + }); +} + +/** GetAppLogs 查询 app 日志与标注 GET /llmops/v1/api/app/${param0}/logs */ +export async function v1ApiAppAppIdLogsUsingGet({ params, options }) { + const { appID: param0, ...queryParams } = params; + + return request(`/llmops/v1/api/app/${param0}/logs`, { + method: 'GET', + params: { + ...queryParams, + }, + ...(options || {}), + }); +} + +/** GetLogsMessages 查询 app 日志与标注消息详情 GET /llmops/v1/api/app/${param0}/logs/${param1}/messages */ +export async function v1ApiAppAppIdLogsConversationIdMessagesUsingGet({ + params, + options, +}) { + const { appID: param0, conversationID: param1, ...queryParams } = params; + + return request(`/llmops/v1/api/app/${param0}/logs/${param1}/messages`, { + method: 'GET', + params: { ...queryParams }, + ...(options || {}), + }); +} + +/** GetSumDailyMessagesCount 每日messages数 GET /llmops/v1/api/app/${param0}/messages */ +export async function v1ApiAppAppIdMessagesUsingGet({ params, options }) { + const { appID: param0, ...queryParams } = params; + + return request(`/llmops/v1/api/app/${param0}/messages`, { + method: 'GET', + params: { + ...queryParams, + }, + ...(options || {}), + }); +} + +/** ShareChat 创建分享path PUT /llmops/v1/api/app/${param0}/share */ +export async function v1ApiAppAppIdShareUsingPut({ params, options }) { + const { appID: param0, ...queryParams } = params; + + return request(`/llmops/v1/api/app/${param0}/share`, { + method: 'PUT', + params: { + ...queryParams, + }, + ...(options || {}), + }); +} + +/** GetSumDailyToken 每日token GET /llmops/v1/api/app/${param0}/token */ +export async function v1ApiAppAppIdTokenUsingGet({ params, options }) { + const { appID: param0, ...queryParams } = params; + + return request(`/llmops/v1/api/app/${param0}/token`, { + method: 'GET', + params: { + ...queryParams, + }, + ...(options || {}), + }); +} + +/** UpdateApp 更新 app PUT /llmops/v1/api/app/${param0}/update */ +export async function v1ApiAppAppIdUpdateUsingPut({ params, body, options }) { + const { appID: param0, ...queryParams } = params; + + return request(`/llmops/v1/api/app/${param0}/update`, { + method: 'PUT', + params: { ...queryParams }, + data: body, + ...(options || {}), + }); +} + +/** ReleaseDiscover 发布到发现 PUT /llmops/v1/api/app/${param0}/update_status */ +export async function v1ApiAppAppIdUpdateStatusUsingPut({ + params, + body, + options, +}) { + const { appID: param0, ...queryParams } = params; + + return request(`/llmops/v1/api/app/${param0}/update_status`, { + method: 'PUT', + params: { ...queryParams }, + data: body, + ...(options || {}), + }); +} + +/** GetImagePreSignedUrl 获取上传预签名地址 GET /llmops/v1/api/app/image */ +export async function v1ApiAppImageUsingGet({ options }) { + return request('/llmops/v1/api/app/image', { + method: 'GET', + ...(options || {}), + }); +} + +/** ListApp 查询 app 列表 GET /llmops/v1/api/app/list */ +export async function v1ApiAppListUsingGet({ options }) { + return request('/llmops/v1/api/app/list', { + method: 'GET', + ...(options || {}), + }); +} + +/** ListAppPick 查询精选 app 列表 GET /llmops/v1/api/app/list-pick */ +export async function v1ApiAppListPickUsingGet({ options }) { + return request('/llmops/v1/api/app/list-pick', { + method: 'GET', + ...(options || {}), + }); +} + +/** ListAppByUser 查询用户关联的 app 列表 GET /llmops/v1/api/app/list-private */ +export async function v1ApiAppListPrivateUsingGet({ params, options }) { + return request('/llmops/v1/api/app/list-private', { + method: 'GET', + params: { + ...params, + }, + ...(options || {}), + }); +} + +/** ListAppPublic 查询公共 app 列表 GET /llmops/v1/api/app/list-public */ +export async function v1ApiAppListPublicUsingGet({ params, options }) { + return request('/llmops/v1/api/app/list-public', { + method: 'GET', + params: { + ...params, + }, + ...(options || {}), + }); +} +import { queryOptions, useMutation } from '@tanstack/react-query'; +import { request } from 'axios'; + +import * as apis from './app'; + +/** GetAppCostTokens 查询 app token消耗 POST /llmops/v1/api/${param0}/cost */ +export function useV1ApiAppIdCostUsingPostMutation(options) { + const { onSuccess, onError } = options || {}; + + const response = useMutation({ + mutationFn: apis.v1ApiAppIdCostUsingPost, + onSuccess(data) { + onSuccess && onSuccess(data); + }, + onError(error) { + onError && onError(error); + }, + }); + + return response; +} + +/** CreateApp 创建 app POST /llmops/v1/api/app */ +export function useV1ApiAppUsingPostMutation(options) { + const { onSuccess, onError } = options || {}; + + const response = useMutation({ + mutationFn: apis.v1ApiAppUsingPost, + onSuccess(data) { + onSuccess && onSuccess(data); + }, + onError(error) { + onError && onError(error); + }, + }); + + return response; +} + +/** DeleteApp 删除 app DELETE /llmops/v1/api/app/${param0}/delete */ +export function useV1ApiAppAppIdOpenApiDeleteUsingDeleteMutation(options) { + const { onSuccess, onError } = options || {}; + + const response = useMutation({ + mutationFn: apis.v1ApiAppAppIdOpenApiDeleteUsingDelete, + onSuccess(data) { + onSuccess && onSuccess(data); + }, + onError(error) { + onError && onError(error); + }, + }); + + return response; +} + +/** GetAppDetails 查询 app 详情 GET /llmops/v1/api/app/${param0}/details */ +export function v1ApiAppAppIdDetailsUsingGetQueryOptions(options) { + return queryOptions({ + queryFn: async ({ queryKey }) => { + return apis.v1ApiAppAppIdDetailsUsingGet(queryKey[1]); + }, + queryKey: ['v1ApiAppAppIdDetailsUsingGet', options], + }); +} + +/** GetSumHourlyMessagesCount 每小时messages数 GET /llmops/v1/api/app/${param0}/hourly-messages */ +export function v1ApiAppAppIdHourlyMessagesUsingGetQueryOptions(options) { + return queryOptions({ + queryFn: async ({ queryKey }) => { + return apis.v1ApiAppAppIdHourlyMessagesUsingGet(queryKey[1]); + }, + queryKey: ['v1ApiAppAppIdHourlyMessagesUsingGet', options], + }); +} + +/** GetSumHourlyToken 每小时token数 GET /llmops/v1/api/app/${param0}/hourly-token */ +export function v1ApiAppAppIdHourlyTokenUsingGetQueryOptions(options) { + return queryOptions({ + queryFn: async ({ queryKey }) => { + return apis.v1ApiAppAppIdHourlyTokenUsingGet(queryKey[1]); + }, + queryKey: ['v1ApiAppAppIdHourlyTokenUsingGet', options], + }); +} + +/** GetAppLogs 查询 app 日志与标注 GET /llmops/v1/api/app/${param0}/logs */ +export function v1ApiAppAppIdLogsUsingGetQueryOptions(options) { + return queryOptions({ + queryFn: async ({ queryKey }) => { + return apis.v1ApiAppAppIdLogsUsingGet(queryKey[1]); + }, + queryKey: ['v1ApiAppAppIdLogsUsingGet', options], + }); +} + +/** GetLogsMessages 查询 app 日志与标注消息详情 GET /llmops/v1/api/app/${param0}/logs/${param1}/messages */ +export function v1ApiAppAppIdLogsConversationIdMessagesUsingGetQueryOptions( + options +) { + return queryOptions({ + queryFn: async ({ queryKey }) => { + return apis.v1ApiAppAppIdLogsConversationIdMessagesUsingGet(queryKey[1]); + }, + queryKey: ['v1ApiAppAppIdLogsConversationIdMessagesUsingGet', options], + }); +} + +/** GetSumDailyMessagesCount 每日messages数 GET /llmops/v1/api/app/${param0}/messages */ +export function v1ApiAppAppIdMessagesUsingGetQueryOptions(options) { + return queryOptions({ + queryFn: async ({ queryKey }) => { + return apis.v1ApiAppAppIdMessagesUsingGet(queryKey[1]); + }, + queryKey: ['v1ApiAppAppIdMessagesUsingGet', options], + }); +} + +/** ShareChat 创建分享path PUT /llmops/v1/api/app/${param0}/share */ +export function useV1ApiAppAppIdShareUsingPutMutation(options) { + const { onSuccess, onError } = options || {}; + + const response = useMutation({ + mutationFn: apis.v1ApiAppAppIdShareUsingPut, + onSuccess(data) { + onSuccess && onSuccess(data); + }, + onError(error) { + onError && onError(error); + }, + }); + + return response; +} + +/** GetSumDailyToken 每日token GET /llmops/v1/api/app/${param0}/token */ +export function v1ApiAppAppIdTokenUsingGetQueryOptions(options) { + return queryOptions({ + queryFn: async ({ queryKey }) => { + return apis.v1ApiAppAppIdTokenUsingGet(queryKey[1]); + }, + queryKey: ['v1ApiAppAppIdTokenUsingGet', options], + }); +} + +/** UpdateApp 更新 app PUT /llmops/v1/api/app/${param0}/update */ +export function useV1ApiAppAppIdUpdateUsingPutMutation(options) { + const { onSuccess, onError } = options || {}; + + const response = useMutation({ + mutationFn: apis.v1ApiAppAppIdUpdateUsingPut, + onSuccess(data) { + onSuccess && onSuccess(data); + }, + onError(error) { + onError && onError(error); + }, + }); + + return response; +} + +/** ReleaseDiscover 发布到发现 PUT /llmops/v1/api/app/${param0}/update_status */ +export function useV1ApiAppAppIdUpdateStatusUsingPutMutation(options) { + const { onSuccess, onError } = options || {}; + + const response = useMutation({ + mutationFn: apis.v1ApiAppAppIdUpdateStatusUsingPut, + onSuccess(data) { + onSuccess && onSuccess(data); + }, + onError(error) { + onError && onError(error); + }, + }); + + return response; +} + +/** GetImagePreSignedUrl 获取上传预签名地址 GET /llmops/v1/api/app/image */ +export function v1ApiAppImageUsingGetQueryOptions(options) { + return queryOptions({ + queryFn: async ({ queryKey }) => { + return apis.v1ApiAppImageUsingGet(queryKey[1]); + }, + queryKey: ['v1ApiAppImageUsingGet', options], + }); +} + +/** ListApp 查询 app 列表 GET /llmops/v1/api/app/list */ +export function v1ApiAppListUsingGetQueryOptions(options) { + return queryOptions({ + queryFn: async ({ queryKey }) => { + return apis.v1ApiAppListUsingGet(queryKey[1]); + }, + queryKey: ['v1ApiAppListUsingGet', options], + }); +} + +/** ListAppPick 查询精选 app 列表 GET /llmops/v1/api/app/list-pick */ +export function v1ApiAppListPickUsingGetQueryOptions(options) { + return queryOptions({ + queryFn: async ({ queryKey }) => { + return apis.v1ApiAppListPickUsingGet(queryKey[1]); + }, + queryKey: ['v1ApiAppListPickUsingGet', options], + }); +} + +/** ListAppByUser 查询用户关联的 app 列表 GET /llmops/v1/api/app/list-private */ +export function v1ApiAppListPrivateUsingGetQueryOptions(options) { + return queryOptions({ + queryFn: async ({ queryKey }) => { + return apis.v1ApiAppListPrivateUsingGet(queryKey[1]); + }, + queryKey: ['v1ApiAppListPrivateUsingGet', options], + }); +} + +/** ListAppPublic 查询公共 app 列表 GET /llmops/v1/api/app/list-public */ +export function v1ApiAppListPublicUsingGetQueryOptions(options) { + return queryOptions({ + queryFn: async ({ queryKey }) => { + return apis.v1ApiAppListPublicUsingGet(queryKey[1]); + }, + queryKey: ['v1ApiAppListPublicUsingGet', options], + }); +} +import { request } from 'axios'; + +/** GetAppDatasetConfigsList 查询应用知识库查询配置 GET /llmops/v1/api/app/${param0}/dataset-configs */ +export async function v1ApiAppAppIdDatasetConfigsUsingGet({ params, options }) { + const { appID: param0, ...queryParams } = params; + + return request(`/llmops/v1/api/app/${param0}/dataset-configs`, { + method: 'GET', + params: { ...queryParams }, + ...(options || {}), + }); +} + +/** UpdateAppDatasetConfigs 更新应用知识库查询配置 PUT /llmops/v1/api/app/${param0}/dataset-configs */ +export async function v1ApiAppAppIdDatasetConfigsUsingPut({ + params, + body, + options, +}) { + const { appID: param0, ...queryParams } = params; + + return request(`/llmops/v1/api/app/${param0}/dataset-configs`, { + method: 'PUT', + params: { ...queryParams }, + data: body, + ...(options || {}), + }); +} + +/** CreateAppDatasetConfigs 创建应用知识库查询配置 POST /llmops/v1/api/app/${param0}/dataset-configs */ +export async function v1ApiAppAppIdDatasetConfigsUsingPost({ + params, + body, + options, +}) { + const { appID: param0, ...queryParams } = params; + + return request(`/llmops/v1/api/app/${param0}/dataset-configs`, { + method: 'POST', + params: { ...queryParams }, + data: body, + ...(options || {}), + }); +} + +/** DeleteAppDatasetConfigs 删除应用知识库查询配置 DELETE /llmops/v1/api/app/${param0}/dataset-configs */ +export async function v1ApiAppAppIdDatasetConfigsUsingDelete({ + params, + options, +}) { + const { appID: param0, ...queryParams } = params; + + return request(`/llmops/v1/api/app/${param0}/dataset-configs`, { + method: 'DELETE', + params: { + ...queryParams, + }, + ...(options || {}), + }); +} +import { queryOptions, useMutation } from '@tanstack/react-query'; +import { request } from 'axios'; + +import * as apis from './appDatasetConfigs'; + +/** GetAppDatasetConfigsList 查询应用知识库查询配置 GET /llmops/v1/api/app/${param0}/dataset-configs */ +export function v1ApiAppAppIdDatasetConfigsUsingGetQueryOptions(options) { + return queryOptions({ + queryFn: async ({ queryKey }) => { + return apis.v1ApiAppAppIdDatasetConfigsUsingGet(queryKey[1]); + }, + queryKey: ['v1ApiAppAppIdDatasetConfigsUsingGet', options], + }); +} + +/** UpdateAppDatasetConfigs 更新应用知识库查询配置 PUT /llmops/v1/api/app/${param0}/dataset-configs */ +export function useV1ApiAppAppIdDatasetConfigsUsingPutMutation(options) { + const { onSuccess, onError } = options || {}; + + const response = useMutation({ + mutationFn: apis.v1ApiAppAppIdDatasetConfigsUsingPut, + onSuccess(data) { + onSuccess && onSuccess(data); + }, + onError(error) { + onError && onError(error); + }, + }); + + return response; +} + +/** CreateAppDatasetConfigs 创建应用知识库查询配置 POST /llmops/v1/api/app/${param0}/dataset-configs */ +export function useV1ApiAppAppIdDatasetConfigsUsingPostMutation(options) { + const { onSuccess, onError } = options || {}; + + const response = useMutation({ + mutationFn: apis.v1ApiAppAppIdDatasetConfigsUsingPost, + onSuccess(data) { + onSuccess && onSuccess(data); + }, + onError(error) { + onError && onError(error); + }, + }); + + return response; +} + +/** DeleteAppDatasetConfigs 删除应用知识库查询配置 DELETE /llmops/v1/api/app/${param0}/dataset-configs */ +export function useV1ApiAppAppIdDatasetConfigsUsingDeleteMutation(options) { + const { onSuccess, onError } = options || {}; + + const response = useMutation({ + mutationFn: apis.v1ApiAppAppIdDatasetConfigsUsingDelete, + onSuccess(data) { + onSuccess && onSuccess(data); + }, + onError(error) { + onError && onError(error); + }, + }); + + return response; +} +import { request } from 'axios'; + +/** ListMember app下的用户列表 GET /llmops/v1/api/app/${param0}/member */ +export async function v1ApiAppAppIdMemberUsingGet({ params, options }) { + const { appID: param0, ...queryParams } = params; + + return request(`/llmops/v1/api/app/${param0}/member`, { + method: 'GET', + params: { + ...queryParams, + }, + ...(options || {}), + }); +} + +/** AddMember 增加app用户 POST /llmops/v1/api/app/${param0}/member */ +export async function v1ApiAppAppIdMemberUsingPost({ params, body, options }) { + const { appID: param0, ...queryParams } = params; + + return request(`/llmops/v1/api/app/${param0}/member`, { + method: 'POST', + params: { ...queryParams }, + data: body, + ...(options || {}), + }); +} + +/** DeleteMember 删除app用户 DELETE /llmops/v1/api/app/${param0}/member */ +export async function v1ApiAppAppIdMemberUsingDelete({ + params, + body, + options, +}) { + const { appID: param0, ...queryParams } = params; + + return request(`/llmops/v1/api/app/${param0}/member`, { + method: 'DELETE', + params: { ...queryParams }, + data: body, + ...(options || {}), + }); +} + +/** UpdateMemberRole 更新app用户角色 PUT /llmops/v1/api/app/${param0}/member-role */ +export async function v1ApiAppAppIdMemberRoleUsingPut({ + params, + body, + options, +}) { + const { appID: param0, ...queryParams } = params; + + return request(`/llmops/v1/api/app/${param0}/member-role`, { + method: 'PUT', + params: { ...queryParams }, + data: body, + ...(options || {}), + }); +} +import { queryOptions, useMutation } from '@tanstack/react-query'; +import { request } from 'axios'; + +import * as apis from './appMember'; + +/** ListMember app下的用户列表 GET /llmops/v1/api/app/${param0}/member */ +export function v1ApiAppAppIdMemberUsingGetQueryOptions(options) { + return queryOptions({ + queryFn: async ({ queryKey }) => { + return apis.v1ApiAppAppIdMemberUsingGet(queryKey[1]); + }, + queryKey: ['v1ApiAppAppIdMemberUsingGet', options], + }); +} + +/** AddMember 增加app用户 POST /llmops/v1/api/app/${param0}/member */ +export function useV1ApiAppAppIdMemberUsingPostMutation(options) { + const { onSuccess, onError } = options || {}; + + const response = useMutation({ + mutationFn: apis.v1ApiAppAppIdMemberUsingPost, + onSuccess(data) { + onSuccess && onSuccess(data); + }, + onError(error) { + onError && onError(error); + }, + }); + + return response; +} + +/** DeleteMember 删除app用户 DELETE /llmops/v1/api/app/${param0}/member */ +export function useV1ApiAppAppIdMemberUsingDeleteMutation(options) { + const { onSuccess, onError } = options || {}; + + const response = useMutation({ + mutationFn: apis.v1ApiAppAppIdMemberUsingDelete, + onSuccess(data) { + onSuccess && onSuccess(data); + }, + onError(error) { + onError && onError(error); + }, + }); + + return response; +} + +/** UpdateMemberRole 更新app用户角色 PUT /llmops/v1/api/app/${param0}/member-role */ +export function useV1ApiAppAppIdMemberRoleUsingPutMutation(options) { + const { onSuccess, onError } = options || {}; + + const response = useMutation({ + mutationFn: apis.v1ApiAppAppIdMemberRoleUsingPut, + onSuccess(data) { + onSuccess && onSuccess(data); + }, + onError(error) { + onError && onError(error); + }, + }); + + return response; +} +import { request } from 'axios'; + +/** UpdateModelConfigs 更新 app model configs PUT /llmops/v1/api/app/${param0}/model-configs */ +export async function v1ApiAppAppIdModelConfigsUsingPut({ + params, + body, + options, +}) { + const { appID: param0, ...queryParams } = params; + + return request(`/llmops/v1/api/app/${param0}/model-configs`, { + method: 'PUT', + params: { ...queryParams }, + data: body, + ...(options || {}), + }); +} + +/** CreateOrUpdateModelConfigs 创建 app model configs POST /llmops/v1/api/app/${param0}/model-configs */ +export async function v1ApiAppAppIdModelConfigsUsingPost({ + params, + body, + options, +}) { + const { appID: param0, ...queryParams } = params; + + return request(`/llmops/v1/api/app/${param0}/model-configs`, { + method: 'POST', + params: { ...queryParams }, + data: body, + ...(options || {}), + }); +} + +/** CreateOrUpdateModelConfigPromptPrefix 创建或修改角色和背景以及推荐问题开关 POST /llmops/v1/api/app/${param0}/model-prompt */ +export async function v1ApiAppAppIdModelPromptUsingPost({ + params, + body, + options, +}) { + const { appID: param0, ...queryParams } = params; + + return request(`/llmops/v1/api/app/${param0}/model-prompt`, { + method: 'POST', + params: { ...queryParams }, + data: body, + ...(options || {}), + }); +} + +/** GetPluginList 获取插件列表 PUT /llmops/v1/api/app/${param0}/plugin */ +export async function v1ApiAppAppIdPluginUsingPut({ params, options }) { + const { appID: param0, ...queryParams } = params; + + return request(`/llmops/v1/api/app/${param0}/plugin`, { + method: 'PUT', + params: { ...queryParams }, + ...(options || {}), + }); +} +import { queryOptions, useMutation } from '@tanstack/react-query'; +import { request } from 'axios'; + +import * as apis from './appModelConfigs'; + +/** UpdateModelConfigs 更新 app model configs PUT /llmops/v1/api/app/${param0}/model-configs */ +export function useV1ApiAppAppIdModelConfigsUsingPutMutation(options) { + const { onSuccess, onError } = options || {}; + + const response = useMutation({ + mutationFn: apis.v1ApiAppAppIdModelConfigsUsingPut, + onSuccess(data) { + onSuccess && onSuccess(data); + }, + onError(error) { + onError && onError(error); + }, + }); + + return response; +} + +/** CreateOrUpdateModelConfigs 创建 app model configs POST /llmops/v1/api/app/${param0}/model-configs */ +export function useV1ApiAppAppIdModelConfigsUsingPostMutation(options) { + const { onSuccess, onError } = options || {}; + + const response = useMutation({ + mutationFn: apis.v1ApiAppAppIdModelConfigsUsingPost, + onSuccess(data) { + onSuccess && onSuccess(data); + }, + onError(error) { + onError && onError(error); + }, + }); + + return response; +} + +/** CreateOrUpdateModelConfigPromptPrefix 创建或修改角色和背景以及推荐问题开关 POST /llmops/v1/api/app/${param0}/model-prompt */ +export function useV1ApiAppAppIdModelPromptUsingPostMutation(options) { + const { onSuccess, onError } = options || {}; + + const response = useMutation({ + mutationFn: apis.v1ApiAppAppIdModelPromptUsingPost, + onSuccess(data) { + onSuccess && onSuccess(data); + }, + onError(error) { + onError && onError(error); + }, + }); + + return response; +} + +/** GetPluginList 获取插件列表 PUT /llmops/v1/api/app/${param0}/plugin */ +export function useV1ApiAppAppIdPluginUsingPutMutation(options) { + const { onSuccess, onError } = options || {}; + + const response = useMutation({ + mutationFn: apis.v1ApiAppAppIdPluginUsingPut, + onSuccess(data) { + onSuccess && onSuccess(data); + }, + onError(error) { + onError && onError(error); + }, + }); + + return response; +} +import { request } from 'axios'; + +/** CreateAppV2 创建 app POST /llmops/v2/api/app */ +export async function v2ApiAppUsingPost({ body, options }) { + return request('/llmops/v2/api/app', { + method: 'POST', + data: body, + ...(options || {}), + }); +} + +/** GetAppDetailsV2 查询 app 详情 GET /llmops/v2/api/app/${param0}/details */ +export async function v2ApiAppAppIdDetailsUsingGet({ params, options }) { + const { appID: param0, ...queryParams } = params; + + return request(`/llmops/v2/api/app/${param0}/details`, { + method: 'GET', + params: { ...queryParams }, + ...(options || {}), + }); +} + +/** UpdateAppV2 更新 app 信息 POST /llmops/v2/api/app/${param0}/update */ +export async function v2ApiAppAppIdUpdateUsingPost({ params, body, options }) { + const { appID: param0, ...queryParams } = params; + + return request(`/llmops/v2/api/app/${param0}/update`, { + method: 'POST', + params: { ...queryParams }, + data: body, + ...(options || {}), + }); +} + +/** ListAppV2 查询用户关联的 app 列表 GET /llmops/v2/api/app/list */ +export async function v2ApiAppListUsingGet({ params, options }) { + return request('/llmops/v2/api/app/list', { + method: 'GET', + params: { + ...params, + }, + ...(options || {}), + }); +} + +/** GetApiTokenV2 获取一个 app token GET /llmops/v2/api/app/share/api-token */ +export async function v2ApiAppShareApiTokenUsingGet({ params, options }) { + return request('/llmops/v2/api/app/share/api-token', { + method: 'GET', + params: { + ...params, + }, + ...(options || {}), + }); +} +import { queryOptions, useMutation } from '@tanstack/react-query'; +import { request } from 'axios'; + +import * as apis from './appV2'; + +/** CreateAppV2 创建 app POST /llmops/v2/api/app */ +export function useV2ApiAppUsingPostMutation(options) { + const { onSuccess, onError } = options || {}; + + const response = useMutation({ + mutationFn: apis.v2ApiAppUsingPost, + onSuccess(data) { + onSuccess && onSuccess(data); + }, + onError(error) { + onError && onError(error); + }, + }); + + return response; +} + +/** GetAppDetailsV2 查询 app 详情 GET /llmops/v2/api/app/${param0}/details */ +export function v2ApiAppAppIdDetailsUsingGetQueryOptions(options) { + return queryOptions({ + queryFn: async ({ queryKey }) => { + return apis.v2ApiAppAppIdDetailsUsingGet(queryKey[1]); + }, + queryKey: ['v2ApiAppAppIdDetailsUsingGet', options], + }); +} + +/** UpdateAppV2 更新 app 信息 POST /llmops/v2/api/app/${param0}/update */ +export function useV2ApiAppAppIdUpdateUsingPostMutation(options) { + const { onSuccess, onError } = options || {}; + + const response = useMutation({ + mutationFn: apis.v2ApiAppAppIdUpdateUsingPost, + onSuccess(data) { + onSuccess && onSuccess(data); + }, + onError(error) { + onError && onError(error); + }, + }); + + return response; +} + +/** ListAppV2 查询用户关联的 app 列表 GET /llmops/v2/api/app/list */ +export function v2ApiAppListUsingGetQueryOptions(options) { + return queryOptions({ + queryFn: async ({ queryKey }) => { + return apis.v2ApiAppListUsingGet(queryKey[1]); + }, + queryKey: ['v2ApiAppListUsingGet', options], + }); +} + +/** GetApiTokenV2 获取一个 app token GET /llmops/v2/api/app/share/api-token */ +export function v2ApiAppShareApiTokenUsingGetQueryOptions(options) { + return queryOptions({ + queryFn: async ({ queryKey }) => { + return apis.v2ApiAppShareApiTokenUsingGet(queryKey[1]); + }, + queryKey: ['v2ApiAppShareApiTokenUsingGet', options], + }); +} +import { request } from 'axios'; + +/** ListAttentionApp 应用列表 GET /llmops/v1/api/attention/app/list */ +export async function v1ApiAttentionAppListUsingGet({ params, options }) { + return request('/llmops/v1/api/attention/app/list', { + method: 'GET', + params: { + ...params, + }, + ...(options || {}), + }); +} + +/** ListAttentionConversations 查询会话列表 POST /llmops/v1/api/attention/conversations */ +export async function v1ApiAttentionConversationsUsingPost({ body, options }) { + return request('/llmops/v1/api/attention/conversations', { + method: 'POST', + data: body, + ...(options || {}), + }); +} + +/** GetAttentionConversationCount 获取对话数 POST /llmops/v1/api/attention/conversations/count */ +export async function v1ApiAttentionConversationsCountUsingPost({ + body, + options, +}) { + return request('/llmops/v1/api/attention/conversations/count', { + method: 'POST', + data: body, + ...(options || {}), + }); +} + +/** GetAttentionMessagesCount 获取消息数 POST /llmops/v1/api/attention/messages/count */ +export async function v1ApiAttentionMessagesCountUsingPost({ body, options }) { + return request('/llmops/v1/api/attention/messages/count', { + method: 'POST', + data: body, + ...(options || {}), + }); +} + +/** GetAttentionMessagesHistory 获取聊天历史 GET /llmops/v1/api/attention/messages/history */ +export async function v1ApiAttentionMessagesHistoryUsingGet({ + params, + options, +}) { + return request('/llmops/v1/api/attention/messages/history', { + method: 'GET', + params: { + ...params, + }, + ...(options || {}), + }); +} + +/** CreateAttentionUser 添加特别关注 POST /llmops/v1/api/attention/user */ +export async function v1ApiAttentionUserUsingPost({ body, options }) { + return request('/llmops/v1/api/attention/user', { + method: 'POST', + data: body, + ...(options || {}), + }); +} + +/** ListAllUser 系统全局用户列表 GET /llmops/v1/api/attention/user/all */ +export async function v1ApiAttentionUserAllUsingGet({ params, options }) { + return request('/llmops/v1/api/attention/user/all', { + method: 'GET', + params: { + // size has a default value: 10 + size: '10', + + ...params, + }, + ...(options || {}), + }); +} + +/** DeleteAttentionUser 取消特别关注 POST /llmops/v1/api/attention/user/cancel */ +export async function v1ApiAttentionUserCancelUsingPost({ body, options }) { + return request('/llmops/v1/api/attention/user/cancel', { + method: 'POST', + data: body, + ...(options || {}), + }); +} + +/** GetAttentionUserList 查询特别关注列表 POST /llmops/v1/api/attention/user/list */ +export async function v1ApiAttentionUserListUsingPost({ params, options }) { + return request('/llmops/v1/api/attention/user/list', { + method: 'POST', + params: { + ...params, + }, + ...(options || {}), + }); +} +import { queryOptions, useMutation } from '@tanstack/react-query'; +import { request } from 'axios'; + +import * as apis from './attention'; + +/** ListAttentionApp 应用列表 GET /llmops/v1/api/attention/app/list */ +export function v1ApiAttentionAppListUsingGetQueryOptions(options) { + return queryOptions({ + queryFn: async ({ queryKey }) => { + return apis.v1ApiAttentionAppListUsingGet(queryKey[1]); + }, + queryKey: ['v1ApiAttentionAppListUsingGet', options], + }); +} + +/** ListAttentionConversations 查询会话列表 POST /llmops/v1/api/attention/conversations */ +export function useV1ApiAttentionConversationsUsingPostMutation(options) { + const { onSuccess, onError } = options || {}; + + const response = useMutation({ + mutationFn: apis.v1ApiAttentionConversationsUsingPost, + onSuccess(data) { + onSuccess && onSuccess(data); + }, + onError(error) { + onError && onError(error); + }, + }); + + return response; +} + +/** GetAttentionConversationCount 获取对话数 POST /llmops/v1/api/attention/conversations/count */ +export function useV1ApiAttentionConversationsCountUsingPostMutation(options) { + const { onSuccess, onError } = options || {}; + + const response = useMutation({ + mutationFn: apis.v1ApiAttentionConversationsCountUsingPost, + onSuccess(data) { + onSuccess && onSuccess(data); + }, + onError(error) { + onError && onError(error); + }, + }); + + return response; +} + +/** GetAttentionMessagesCount 获取消息数 POST /llmops/v1/api/attention/messages/count */ +export function useV1ApiAttentionMessagesCountUsingPostMutation(options) { + const { onSuccess, onError } = options || {}; + + const response = useMutation({ + mutationFn: apis.v1ApiAttentionMessagesCountUsingPost, + onSuccess(data) { + onSuccess && onSuccess(data); + }, + onError(error) { + onError && onError(error); + }, + }); + + return response; +} + +/** GetAttentionMessagesHistory 获取聊天历史 GET /llmops/v1/api/attention/messages/history */ +export function v1ApiAttentionMessagesHistoryUsingGetQueryOptions(options) { + return queryOptions({ + queryFn: async ({ queryKey }) => { + return apis.v1ApiAttentionMessagesHistoryUsingGet(queryKey[1]); + }, + queryKey: ['v1ApiAttentionMessagesHistoryUsingGet', options], + }); +} + +/** CreateAttentionUser 添加特别关注 POST /llmops/v1/api/attention/user */ +export function useV1ApiAttentionUserUsingPostMutation(options) { + const { onSuccess, onError } = options || {}; + + const response = useMutation({ + mutationFn: apis.v1ApiAttentionUserUsingPost, + onSuccess(data) { + onSuccess && onSuccess(data); + }, + onError(error) { + onError && onError(error); + }, + }); + + return response; +} + +/** ListAllUser 系统全局用户列表 GET /llmops/v1/api/attention/user/all */ +export function v1ApiAttentionUserAllUsingGetQueryOptions(options) { + return queryOptions({ + queryFn: async ({ queryKey }) => { + return apis.v1ApiAttentionUserAllUsingGet(queryKey[1]); + }, + queryKey: ['v1ApiAttentionUserAllUsingGet', options], + }); +} + +/** DeleteAttentionUser 取消特别关注 POST /llmops/v1/api/attention/user/cancel */ +export function useV1ApiAttentionUserCancelUsingPostMutation(options) { + const { onSuccess, onError } = options || {}; + + const response = useMutation({ + mutationFn: apis.v1ApiAttentionUserCancelUsingPost, + onSuccess(data) { + onSuccess && onSuccess(data); + }, + onError(error) { + onError && onError(error); + }, + }); + + return response; +} + +/** GetAttentionUserList 查询特别关注列表 POST /llmops/v1/api/attention/user/list */ +export function useV1ApiAttentionUserListUsingPostMutation(options) { + const { onSuccess, onError } = options || {}; + + const response = useMutation({ + mutationFn: apis.v1ApiAttentionUserListUsingPost, + onSuccess(data) { + onSuccess && onSuccess(data); + }, + onError(error) { + onError && onError(error); + }, + }); + + return response; +} +import { request } from 'axios'; + +/** Authorize 获取code的跳转 GET /llmops/auth/authorize */ +export async function authAuthorizeUsingGet({ params, options }) { + return request('/llmops/auth/authorize', { + method: 'GET', + params: { + ...params, + }, + ...(options || {}), + }); +} +import { queryOptions, useMutation } from '@tanstack/react-query'; +import { request } from 'axios'; + +import * as apis from './authorize'; + +/** Authorize 获取code的跳转 GET /llmops/auth/authorize */ +export function authAuthorizeUsingGetQueryOptions(options) { + return queryOptions({ + queryFn: async ({ queryKey }) => { + return apis.authAuthorizeUsingGet(queryKey[1]); + }, + queryKey: ['authAuthorizeUsingGet', options], + }); +} +import { request } from 'axios'; + +/** Messages Messages POST /llmops/v1/api/chat-messages */ +export async function v1ApiChatMessagesUsingPost({ body, options }) { + return request('/llmops/v1/api/chat-messages', { + method: 'POST', + headers: { + 'Content-Type': 'application/json', + }, + data: body, + ...(options || {}), + }); +} + +/** WebMessages 分享页的聊天 POST /llmops/v1/api/chat-messages-web */ +export async function v1ApiChatMessagesWebUsingPost({ body, options }) { + return request('/llmops/v1/api/chat-messages-web', { + method: 'POST', + headers: { + 'Content-Type': 'application/json', + }, + data: body, + ...(options || {}), + }); +} + +/** ChatMessage ChatMessage POST /llmops/v1/api/chat-messages/gpt */ +export async function v1ApiChatMessagesGptUsingPost({ body, options }) { + return request('/llmops/v1/api/chat-messages/gpt', { + method: 'POST', + headers: { + 'Content-Type': 'application/json', + }, + data: body, + ...(options || {}), + }); +} + +/** QuestionRecommend QuestionRecommend POST /llmops/v1/api/chat-messages/question-recommend */ +export async function v1ApiChatMessagesQuestionRecommendUsingPost({ + body, + options, +}) { + return request('/llmops/v1/api/chat-messages/question-recommend', { + method: 'POST', + headers: { + 'Content-Type': 'application/json', + }, + data: body, + ...(options || {}), + }); +} + +/** V2Messages 用于微精灵聊天的v2版本 POST /llmops/v2/api/chat-messages */ +export async function v2ApiChatMessagesUsingPost({ body, options }) { + return request('/llmops/v2/api/chat-messages', { + method: 'POST', + headers: { + 'Content-Type': 'application/json', + }, + data: body, + ...(options || {}), + }); +} +import { queryOptions, useMutation } from '@tanstack/react-query'; +import { request } from 'axios'; + +import * as apis from './chat'; + +/** Messages Messages POST /llmops/v1/api/chat-messages */ +export function useV1ApiChatMessagesUsingPostMutation(options) { + const { onSuccess, onError } = options || {}; + + const response = useMutation({ + mutationFn: apis.v1ApiChatMessagesUsingPost, + onSuccess(data) { + onSuccess && onSuccess(data); + }, + onError(error) { + onError && onError(error); + }, + }); + + return response; +} + +/** WebMessages 分享页的聊天 POST /llmops/v1/api/chat-messages-web */ +export function useV1ApiChatMessagesWebUsingPostMutation(options) { + const { onSuccess, onError } = options || {}; + + const response = useMutation({ + mutationFn: apis.v1ApiChatMessagesWebUsingPost, + onSuccess(data) { + onSuccess && onSuccess(data); + }, + onError(error) { + onError && onError(error); + }, + }); + + return response; +} + +/** ChatMessage ChatMessage POST /llmops/v1/api/chat-messages/gpt */ +export function useV1ApiChatMessagesGptUsingPostMutation(options) { + const { onSuccess, onError } = options || {}; + + const response = useMutation({ + mutationFn: apis.v1ApiChatMessagesGptUsingPost, + onSuccess(data) { + onSuccess && onSuccess(data); + }, + onError(error) { + onError && onError(error); + }, + }); + + return response; +} + +/** QuestionRecommend QuestionRecommend POST /llmops/v1/api/chat-messages/question-recommend */ +export function useV1ApiChatMessagesQuestionRecommendUsingPostMutation( + options +) { + const { onSuccess, onError } = options || {}; + + const response = useMutation({ + mutationFn: apis.v1ApiChatMessagesQuestionRecommendUsingPost, + onSuccess(data) { + onSuccess && onSuccess(data); + }, + onError(error) { + onError && onError(error); + }, + }); + + return response; +} + +/** V2Messages 用于微精灵聊天的v2版本 POST /llmops/v2/api/chat-messages */ +export function useV2ApiChatMessagesUsingPostMutation(options) { + const { onSuccess, onError } = options || {}; + + const response = useMutation({ + mutationFn: apis.v2ApiChatMessagesUsingPost, + onSuccess(data) { + onSuccess && onSuccess(data); + }, + onError(error) { + onError && onError(error); + }, + }); + + return response; +} +import { request } from 'axios'; + +/** ConversationList 会话历史 GET /llmops/v1/api/conversations */ +export async function v1ApiConversationsUsingGet({ params, options }) { + return request('/llmops/v1/api/conversations', { + method: 'GET', + params: { + ...params, + }, + ...(options || {}), + }); +} + +/** DeleteConversation 删除会话 DELETE /llmops/v1/api/conversations */ +export async function v1ApiConversationsUsingDelete({ params, options }) { + return request('/llmops/v1/api/conversations', { + method: 'DELETE', + params: { + ...params, + }, + ...(options || {}), + }); +} +import { queryOptions, useMutation } from '@tanstack/react-query'; +import { request } from 'axios'; + +import * as apis from './conversation'; + +/** ConversationList 会话历史 GET /llmops/v1/api/conversations */ +export function v1ApiConversationsUsingGetQueryOptions(options) { + return queryOptions({ + queryFn: async ({ queryKey }) => { + return apis.v1ApiConversationsUsingGet(queryKey[1]); + }, + queryKey: ['v1ApiConversationsUsingGet', options], + }); +} + +/** DeleteConversation 删除会话 DELETE /llmops/v1/api/conversations */ +export function useV1ApiConversationsUsingDeleteMutation(options) { + const { onSuccess, onError } = options || {}; + + const response = useMutation({ + mutationFn: apis.v1ApiConversationsUsingDelete, + onSuccess(data) { + onSuccess && onSuccess(data); + }, + onError(error) { + onError && onError(error); + }, + }); + + return response; +} +import { request } from 'axios'; + +/** CreateFeedbacks CreateFeedbacks POST /llmops/v1/api/feedbacks/${param0} */ +export async function v1ApiFeedbacksMessageIdUsingPost({ + params, + body, + options, +}) { + const { message_id: param0, ...queryParams } = params; + + return request(`/llmops/v1/api/feedbacks/${param0}`, { + method: 'POST', + headers: { + 'Content-Type': 'application/json', + }, + params: { ...queryParams }, + data: body, + ...(options || {}), + }); +} +import { queryOptions, useMutation } from '@tanstack/react-query'; +import { request } from 'axios'; + +import * as apis from './createFeedbacks'; + +/** CreateFeedbacks CreateFeedbacks POST /llmops/v1/api/feedbacks/${param0} */ +export function useV1ApiFeedbacksMessageIdUsingPostMutation(options) { + const { onSuccess, onError } = options || {}; + + const response = useMutation({ + mutationFn: apis.v1ApiFeedbacksMessageIdUsingPost, + onSuccess(data) { + onSuccess && onSuccess(data); + }, + onError(error) { + onError && onError(error); + }, + }); + + return response; +} +import { request } from 'axios'; + +/** CreateDatasetsJoin 创建 app 数据集关联 POST /llmops/v1/api/app/${param0}/datasets */ +export async function v1ApiAppAppIdDatasetsUsingPost({ + params, + body, + options, +}) { + const { appID: param0, ...queryParams } = params; + + return request(`/llmops/v1/api/app/${param0}/datasets`, { + method: 'POST', + params: { ...queryParams }, + data: body, + ...(options || {}), + }); +} + +/** DeleteDatasetsJoin 删除 app 数据集关联 DELETE /llmops/v1/api/app/${param0}/datasets */ +export async function v1ApiAppAppIdDatasetsUsingDelete({ params, options }) { + const { appID: param0, ...queryParams } = params; + + return request(`/llmops/v1/api/app/${param0}/datasets`, { + method: 'DELETE', + params: { + ...queryParams, + }, + ...(options || {}), + }); +} +import { queryOptions, useMutation } from '@tanstack/react-query'; +import { request } from 'axios'; + +import * as apis from './datasetsJoin'; + +/** CreateDatasetsJoin 创建 app 数据集关联 POST /llmops/v1/api/app/${param0}/datasets */ +export function useV1ApiAppAppIdDatasetsUsingPostMutation(options) { + const { onSuccess, onError } = options || {}; + + const response = useMutation({ + mutationFn: apis.v1ApiAppAppIdDatasetsUsingPost, + onSuccess(data) { + onSuccess && onSuccess(data); + }, + onError(error) { + onError && onError(error); + }, + }); + + return response; +} + +/** DeleteDatasetsJoin 删除 app 数据集关联 DELETE /llmops/v1/api/app/${param0}/datasets */ +export function useV1ApiAppAppIdDatasetsUsingDeleteMutation(options) { + const { onSuccess, onError } = options || {}; + + const response = useMutation({ + mutationFn: apis.v1ApiAppAppIdDatasetsUsingDelete, + onSuccess(data) { + onSuccess && onSuccess(data); + }, + onError(error) { + onError && onError(error); + }, + }); + + return response; +} +import { request } from 'axios'; + +/** GetDatasetsList 数据集列表 GET /llmops/v1/api/app/${param0}/datasets-list */ +export async function v1ApiAppAppIdDatasetsListUsingGet({ params, options }) { + const { appID: param0, ...queryParams } = params; + + return request(`/llmops/v1/api/app/${param0}/datasets-list`, { + method: 'GET', + params: { + ...queryParams, + }, + ...(options || {}), + }); +} +import { queryOptions, useMutation } from '@tanstack/react-query'; +import { request } from 'axios'; + +import * as apis from './datasetsList'; + +/** GetDatasetsList 数据集列表 GET /llmops/v1/api/app/${param0}/datasets-list */ +export function v1ApiAppAppIdDatasetsListUsingGetQueryOptions(options) { + return queryOptions({ + queryFn: async ({ queryKey }) => { + return apis.v1ApiAppAppIdDatasetsListUsingGet(queryKey[1]); + }, + queryKey: ['v1ApiAppAppIdDatasetsListUsingGet', options], + }); +} +import { request } from 'axios'; + +/** DeleteFeedbacks DeleteFeedbacks DELETE /llmops/v1/api/feedbacks/${param0} */ +export async function v1ApiFeedbacksMessageIdUsingDelete({ params, options }) { + const { message_id: param0, ...queryParams } = params; + + return request(`/llmops/v1/api/feedbacks/${param0}`, { + method: 'DELETE', + params: { + ...queryParams, + }, + ...(options || {}), + }); +} +import { queryOptions, useMutation } from '@tanstack/react-query'; +import { request } from 'axios'; + +import * as apis from './deleteFeedbacks'; + +/** DeleteFeedbacks DeleteFeedbacks DELETE /llmops/v1/api/feedbacks/${param0} */ +export function useV1ApiFeedbacksMessageIdUsingDeleteMutation(options) { + const { onSuccess, onError } = options || {}; + + const response = useMutation({ + mutationFn: apis.v1ApiFeedbacksMessageIdUsingDelete, + onSuccess(data) { + onSuccess && onSuccess(data); + }, + onError(error) { + onError && onError(error); + }, + }); + + return response; +} +import { request } from 'axios'; + +/** DeleteKey 为应用添加各种类型机器人appkey DELETE /llmops/v1/api/robot/${param0}/appkey */ +export async function v1ApiRobotWorkspaceIdAppkeyUsingDelete({ + params, + body, + options, +}) { + const { workspaceID: param0, ...queryParams } = params; + + return request(`/llmops/v1/api/robot/${param0}/appkey`, { + method: 'DELETE', + params: { ...queryParams }, + data: body, + ...(options || {}), + }); +} +import { queryOptions, useMutation } from '@tanstack/react-query'; +import { request } from 'axios'; + +import * as apis from './deleteKey'; + +/** DeleteKey 为应用添加各种类型机器人appkey DELETE /llmops/v1/api/robot/${param0}/appkey */ +export function useV1ApiRobotWorkspaceIdAppkeyUsingDeleteMutation(options) { + const { onSuccess, onError } = options || {}; + + const response = useMutation({ + mutationFn: apis.v1ApiRobotWorkspaceIdAppkeyUsingDelete, + onSuccess(data) { + onSuccess && onSuccess(data); + }, + onError(error) { + onError && onError(error); + }, + }); + + return response; +} +import { request } from 'axios'; + +/** Exchange 换取token GET /llmops/auth/exchange */ +export async function authExchangeUsingGet({ params, options }) { + return request('/llmops/auth/exchange', { + method: 'GET', + params: { + ...params, + }, + ...(options || {}), + }); +} +import { queryOptions, useMutation } from '@tanstack/react-query'; +import { request } from 'axios'; + +import * as apis from './exchange'; + +/** Exchange 换取token GET /llmops/auth/exchange */ +export function authExchangeUsingGetQueryOptions(options) { + return queryOptions({ + queryFn: async ({ queryKey }) => { + return apis.authExchangeUsingGet(queryKey[1]); + }, + queryKey: ['authExchangeUsingGet', options], + }); +} +import { request } from 'axios'; + +/** Filestream 上传文件 POST /llmops/v1/api/file */ +export async function v1ApiFileUsingPost({ params, body, options }) { + return request('/llmops/v1/api/file', { + method: 'POST', + headers: { + 'Content-Type': 'application/json', + }, + params: { + ...params, + }, + data: body, + ...(options || {}), + }); +} + +/** SpeechToText 语音转文字 POST /llmops/v1/api/speech_to_text */ +export async function v1ApiSpeechToTextUsingPost({ body, options }) { + return request('/llmops/v1/api/speech_to_text', { + method: 'POST', + headers: { + 'Content-Type': 'application/json', + }, + data: body, + ...(options || {}), + }); +} + +/** TextToSpeech 文字转语音 POST /llmops/v1/api/text_to_speech */ +export async function v1ApiTextToSpeechUsingPost({ body, options }) { + return request('/llmops/v1/api/text_to_speech', { + method: 'POST', + headers: { + 'Content-Type': 'application/json', + }, + data: body, + ...(options || {}), + }); +} + +/** 上传文件V2接口 上传文件V2接口用于向服务器提交文件。 POST /llmops/v2/api/file */ +export async function v2ApiFileUsingPost({ params, body, options }) { + const formData = new FormData(); + + Object.keys(body).forEach((ele) => { + const item = body[ele]; + + if (item !== undefined && item !== null) { + formData.append( + ele, + typeof item === 'object' ? JSON.stringify(item) : item + ); + } + }); + + return request('/llmops/v2/api/file', { + method: 'POST', + headers: { + 'Content-Type': 'multipart/form-data', + }, + params: { + ...params, + }, + data: formData, + ...(options || {}), + }); +} +import { queryOptions, useMutation } from '@tanstack/react-query'; +import { request } from 'axios'; + +import * as apis from './files'; + +/** Filestream 上传文件 POST /llmops/v1/api/file */ +export function useV1ApiFileUsingPostMutation(options) { + const { onSuccess, onError } = options || {}; + + const response = useMutation({ + mutationFn: apis.v1ApiFileUsingPost, + onSuccess(data) { + onSuccess && onSuccess(data); + }, + onError(error) { + onError && onError(error); + }, + }); + + return response; +} + +/** SpeechToText 语音转文字 POST /llmops/v1/api/speech_to_text */ +export function useV1ApiSpeechToTextUsingPostMutation(options) { + const { onSuccess, onError } = options || {}; + + const response = useMutation({ + mutationFn: apis.v1ApiSpeechToTextUsingPost, + onSuccess(data) { + onSuccess && onSuccess(data); + }, + onError(error) { + onError && onError(error); + }, + }); + + return response; +} + +/** TextToSpeech 文字转语音 POST /llmops/v1/api/text_to_speech */ +export function useV1ApiTextToSpeechUsingPostMutation(options) { + const { onSuccess, onError } = options || {}; + + const response = useMutation({ + mutationFn: apis.v1ApiTextToSpeechUsingPost, + onSuccess(data) { + onSuccess && onSuccess(data); + }, + onError(error) { + onError && onError(error); + }, + }); + + return response; +} + +/** 上传文件V2接口 上传文件V2接口用于向服务器提交文件。 POST /llmops/v2/api/file */ +export function useV2ApiFileUsingPostMutation(options) { + const { onSuccess, onError } = options || {}; + + const response = useMutation({ + mutationFn: apis.v2ApiFileUsingPost, + onSuccess(data) { + onSuccess && onSuccess(data); + }, + onError(error) { + onError && onError(error); + }, + }); + + return response; +} +import { request } from 'axios'; + +/** GetAppKey 为应用获取各种类型机器人appkey GET /llmops/v1/api/robot/${param0}/appkey */ +export async function v1ApiRobotWorkspaceIdAppkeyUsingGet({ params, options }) { + const { workspaceID: param0, ...queryParams } = params; + + return request(`/llmops/v1/api/robot/${param0}/appkey`, { + method: 'GET', + params: { + ...queryParams, + }, + ...(options || {}), + }); +} +import { queryOptions, useMutation } from '@tanstack/react-query'; +import { request } from 'axios'; + +import * as apis from './getAppKey'; + +/** GetAppKey 为应用获取各种类型机器人appkey GET /llmops/v1/api/robot/${param0}/appkey */ +export function v1ApiRobotWorkspaceIdAppkeyUsingGetQueryOptions(options) { + return queryOptions({ + queryFn: async ({ queryKey }) => { + return apis.v1ApiRobotWorkspaceIdAppkeyUsingGet(queryKey[1]); + }, + queryKey: ['v1ApiRobotWorkspaceIdAppkeyUsingGet', options], + }); +} +import { request } from 'axios'; + +/** History 会话历史 GET /llmops/v1/api/conversations/${param0}/history */ +export async function v1ApiConversationsConversationIdHistoryUsingGet({ + params, + options, +}) { + const { conversation_id: param0, ...queryParams } = params; + + return request(`/llmops/v1/api/conversations/${param0}/history`, { + method: 'GET', + params: { ...queryParams }, + ...(options || {}), + }); +} + +/** DeleteHistory 会话历史 DELETE /llmops/v1/api/conversations/${param0}/history */ +export async function v1ApiConversationsConversationIdHistoryUsingDelete({ + params, + options, +}) { + const { conversation_id: param0, ...queryParams } = params; + + return request(`/llmops/v1/api/conversations/${param0}/history`, { + method: 'DELETE', + params: { + ...queryParams, + }, + ...(options || {}), + }); +} + +/** GetMessageCount 用于微精灵获取消息数的v2版本 GET /llmops/v2/api/chat-messages/messagesCount */ +export async function v2ApiChatMessagesMessagesCountUsingGet({ + params, + options, +}) { + return request('/llmops/v2/api/chat-messages/messagesCount', { + method: 'GET', + params: { + ...params, + }, + ...(options || {}), + }); +} +import { queryOptions, useMutation } from '@tanstack/react-query'; +import { request } from 'axios'; + +import * as apis from './history'; + +/** History 会话历史 GET /llmops/v1/api/conversations/${param0}/history */ +export function v1ApiConversationsConversationIdHistoryUsingGetQueryOptions( + options +) { + return queryOptions({ + queryFn: async ({ queryKey }) => { + return apis.v1ApiConversationsConversationIdHistoryUsingGet(queryKey[1]); + }, + queryKey: ['v1ApiConversationsConversationIdHistoryUsingGet', options], + }); +} + +/** DeleteHistory 会话历史 DELETE /llmops/v1/api/conversations/${param0}/history */ +export function useV1ApiConversationsConversationIdHistoryUsingDeleteMutation( + options +) { + const { onSuccess, onError } = options || {}; + + const response = useMutation({ + mutationFn: apis.v1ApiConversationsConversationIdHistoryUsingDelete, + onSuccess(data) { + onSuccess && onSuccess(data); + }, + onError(error) { + onError && onError(error); + }, + }); + + return response; +} + +/** GetMessageCount 用于微精灵获取消息数的v2版本 GET /llmops/v2/api/chat-messages/messagesCount */ +export function v2ApiChatMessagesMessagesCountUsingGetQueryOptions(options) { + return queryOptions({ + queryFn: async ({ queryKey }) => { + return apis.v2ApiChatMessagesMessagesCountUsingGet(queryKey[1]); + }, + queryKey: ['v2ApiChatMessagesMessagesCountUsingGet', options], + }); +} +import { request } from 'axios'; + +/** GetIamUserId 查询 IAM 用户信息 GET /llmops/v1/api/iamAccount */ +export async function v1ApiIamAccountUsingGet({ params, options }) { + return request('/llmops/v1/api/iamAccount', { + method: 'GET', + params: { + ...params, + }, + ...(options || {}), + }); +} +import { queryOptions, useMutation } from '@tanstack/react-query'; +import { request } from 'axios'; + +import * as apis from './iam'; + +/** GetIamUserId 查询 IAM 用户信息 GET /llmops/v1/api/iamAccount */ +export function v1ApiIamAccountUsingGetQueryOptions(options) { + return queryOptions({ + queryFn: async ({ queryKey }) => { + return apis.v1ApiIamAccountUsingGet(queryKey[1]); + }, + queryKey: ['v1ApiIamAccountUsingGet', options], + }); +} +export * from './authorize'; +export * from './authorize.reactquery'; +export * from './exchange'; +export * from './exchange.reactquery'; +export * from './refreshToken'; +export * from './refreshToken.reactquery'; +export * from './app'; +export * from './app.reactquery'; +export * from './share'; +export * from './share.reactquery'; +export * from './apiToken'; +export * from './apiToken.reactquery'; +export * from './appDatasetConfigs'; +export * from './appDatasetConfigs.reactquery'; +export * from './datasetsJoin'; +export * from './datasetsJoin.reactquery'; +export * from './datasetsList'; +export * from './datasetsList.reactquery'; +export * from './appMember'; +export * from './appMember.reactquery'; +export * from './appModelConfigs'; +export * from './appModelConfigs.reactquery'; +export * from './recommended'; +export * from './recommended.reactquery'; +export * from './attention'; +export * from './attention.reactquery'; +export * from './chat'; +export * from './chat.reactquery'; +export * from './conversation'; +export * from './conversation.reactquery'; +export * from './history'; +export * from './history.reactquery'; +export * from './listFeedbacks'; +export * from './listFeedbacks.reactquery'; +export * from './createFeedbacks'; +export * from './createFeedbacks.reactquery'; +export * from './deleteFeedbacks'; +export * from './deleteFeedbacks.reactquery'; +export * from './files'; +export * from './files.reactquery'; +export * from './iam'; +export * from './iam.reactquery'; +export * from './provider'; +export * from './provider.reactquery'; +export * from './getAppKey'; +export * from './getAppKey.reactquery'; +export * from './addAppKey'; +export * from './addAppKey.reactquery'; +export * from './deleteKey'; +export * from './deleteKey.reactquery'; +export * from './updateAppKeyState'; +export * from './updateAppKeyState.reactquery'; +export * from './user'; +export * from './user.reactquery'; +export * from './appV2'; +export * from './appV2.reactquery'; +export * from './workspaceAppV2'; +export * from './workspaceAppV2.reactquery'; +export * from './workspace'; +export * from './workspace.reactquery'; +export * from './workspaceGroup'; +export * from './workspaceGroup.reactquery'; +import { request } from 'axios'; + +/** ListFeedbacks ListFeedbacks GET /llmops/v1/api/feedbacks/ */ +export async function v1ApiFeedbacksUsingGet({ params, options }) { + return request('/llmops/v1/api/feedbacks/', { + method: 'GET', + params: { + ...params, + }, + ...(options || {}), + }); +} +import { queryOptions, useMutation } from '@tanstack/react-query'; +import { request } from 'axios'; + +import * as apis from './listFeedbacks'; + +/** ListFeedbacks ListFeedbacks GET /llmops/v1/api/feedbacks/ */ +export function v1ApiFeedbacksUsingGetQueryOptions(options) { + return queryOptions({ + queryFn: async ({ queryKey }) => { + return apis.v1ApiFeedbacksUsingGet(queryKey[1]); + }, + queryKey: ['v1ApiFeedbacksUsingGet', options], + }); +} +import { request } from 'axios'; + +/** ListProviders 查询 Provider 列表 GET /llmops/v1/api/provider/list */ +export async function v1ApiProviderListUsingGet({ params, options }) { + return request('/llmops/v1/api/provider/list', { + method: 'GET', + params: { + ...params, + }, + ...(options || {}), + }); +} +import { queryOptions, useMutation } from '@tanstack/react-query'; +import { request } from 'axios'; + +import * as apis from './provider'; + +/** ListProviders 查询 Provider 列表 GET /llmops/v1/api/provider/list */ +export function v1ApiProviderListUsingGetQueryOptions(options) { + return queryOptions({ + queryFn: async ({ queryKey }) => { + return apis.v1ApiProviderListUsingGet(queryKey[1]); + }, + queryKey: ['v1ApiProviderListUsingGet', options], + }); +} +import { request } from 'axios'; + +/** ListRecommendedContext 查询推荐内容列表 GET /llmops/v1/api/app/${param0}/recommended/context */ +export async function v1ApiAppAppIdRecommendedContextUsingGet({ + params, + options, +}) { + const { appID: param0, ...queryParams } = params; + + return request(`/llmops/v1/api/app/${param0}/recommended/context`, { + method: 'GET', + params: { ...queryParams }, + ...(options || {}), + }); +} + +/** CreateOrUpdateRecommendedContext 创建或更新推荐内容列表 POST /llmops/v1/api/app/${param0}/recommended/context */ +export async function v1ApiAppAppIdRecommendedContextUsingPost({ + params, + body, + options, +}) { + const { appID: param0, ...queryParams } = params; + + return request(`/llmops/v1/api/app/${param0}/recommended/context`, { + method: 'POST', + params: { ...queryParams }, + data: body, + ...(options || {}), + }); +} +import { queryOptions, useMutation } from '@tanstack/react-query'; +import { request } from 'axios'; + +import * as apis from './recommended'; + +/** ListRecommendedContext 查询推荐内容列表 GET /llmops/v1/api/app/${param0}/recommended/context */ +export function v1ApiAppAppIdRecommendedContextUsingGetQueryOptions(options) { + return queryOptions({ + queryFn: async ({ queryKey }) => { + return apis.v1ApiAppAppIdRecommendedContextUsingGet(queryKey[1]); + }, + queryKey: ['v1ApiAppAppIdRecommendedContextUsingGet', options], + }); +} + +/** CreateOrUpdateRecommendedContext 创建或更新推荐内容列表 POST /llmops/v1/api/app/${param0}/recommended/context */ +export function useV1ApiAppAppIdRecommendedContextUsingPostMutation(options) { + const { onSuccess, onError } = options || {}; + + const response = useMutation({ + mutationFn: apis.v1ApiAppAppIdRecommendedContextUsingPost, + onSuccess(data) { + onSuccess && onSuccess(data); + }, + onError(error) { + onError && onError(error); + }, + }); + + return response; +} +import { request } from 'axios'; + +/** RefreshToken 刷新token POST /llmops/auth/refresh-token */ +export async function authRefreshTokenUsingPost({ body, options }) { + return request('/llmops/auth/refresh-token', { + method: 'POST', + data: body, + ...(options || {}), + }); +} +import { queryOptions, useMutation } from '@tanstack/react-query'; +import { request } from 'axios'; + +import * as apis from './refreshToken'; + +/** RefreshToken 刷新token POST /llmops/auth/refresh-token */ +export function useAuthRefreshTokenUsingPostMutation(options) { + const { onSuccess, onError } = options || {}; + + const response = useMutation({ + mutationFn: apis.authRefreshTokenUsingPost, + onSuccess(data) { + onSuccess && onSuccess(data); + }, + onError(error) { + onError && onError(error); + }, + }); + + return response; +} +import { request } from 'axios'; + +/** H5GetApiToken 获取一个 app token h5版 GET /llmops/v1/api/app/h5/share/api-token */ +export async function v1ApiAppH5ShareApiTokenUsingGet({ params, options }) { + return request('/llmops/v1/api/app/h5/share/api-token', { + method: 'GET', + params: { + ...params, + }, + ...(options || {}), + }); +} + +/** GetApiToken 获取一个 app token GET /llmops/v1/api/app/share/api-token */ +export async function v1ApiAppShareApiTokenUsingGet({ params, options }) { + return request('/llmops/v1/api/app/share/api-token', { + method: 'GET', + params: { + ...params, + }, + ...(options || {}), + }); +} +import { queryOptions, useMutation } from '@tanstack/react-query'; +import { request } from 'axios'; + +import * as apis from './share'; + +/** H5GetApiToken 获取一个 app token h5版 GET /llmops/v1/api/app/h5/share/api-token */ +export function v1ApiAppH5ShareApiTokenUsingGetQueryOptions(options) { + return queryOptions({ + queryFn: async ({ queryKey }) => { + return apis.v1ApiAppH5ShareApiTokenUsingGet(queryKey[1]); + }, + queryKey: ['v1ApiAppH5ShareApiTokenUsingGet', options], + }); +} + +/** GetApiToken 获取一个 app token GET /llmops/v1/api/app/share/api-token */ +export function v1ApiAppShareApiTokenUsingGetQueryOptions(options) { + return queryOptions({ + queryFn: async ({ queryKey }) => { + return apis.v1ApiAppShareApiTokenUsingGet(queryKey[1]); + }, + queryKey: ['v1ApiAppShareApiTokenUsingGet', options], + }); +} +import { request } from 'axios'; + +/** UpdateAppKeyState 为应用获取各种类型机器人状态 POST /llmops/v1/api/robot/${param0}/appkey/state */ +export async function v1ApiRobotWorkspaceIdAppkeyStateUsingPost({ + params, + body, + options, +}) { + const { workspaceID: param0, ...queryParams } = params; + + return request(`/llmops/v1/api/robot/${param0}/appkey/state`, { + method: 'POST', + params: { ...queryParams }, + data: body, + ...(options || {}), + }); +} +import { queryOptions, useMutation } from '@tanstack/react-query'; +import { request } from 'axios'; + +import * as apis from './updateAppKeyState'; + +/** UpdateAppKeyState 为应用获取各种类型机器人状态 POST /llmops/v1/api/robot/${param0}/appkey/state */ +export function useV1ApiRobotWorkspaceIdAppkeyStateUsingPostMutation(options) { + const { onSuccess, onError } = options || {}; + + const response = useMutation({ + mutationFn: apis.v1ApiRobotWorkspaceIdAppkeyStateUsingPost, + onSuccess(data) { + onSuccess && onSuccess(data); + }, + onError(error) { + onError && onError(error); + }, + }); + + return response; +} +import { request } from 'axios'; + +/** ListUser 系统全局用户列表 GET /llmops/v1/api/user */ +export async function v1ApiUserUsingGet({ params, options }) { + return request('/llmops/v1/api/user', { + method: 'GET', + params: { + // size has a default value: 10 + size: '10', + + ...params, + }, + ...(options || {}), + }); +} + +/** GetUserInfoByToken 获取iam用户数据 GET /llmops/v1/api/user/info */ +export async function v1ApiUserInfoUsingGet({ params, options }) { + return request('/llmops/v1/api/user/info', { + method: 'GET', + params: { + ...params, + }, + ...(options || {}), + }); +} + +/** UpdateUserRole 更新用户角色 PUT /llmops/v1/api/user/role */ +export async function v1ApiUserRoleUsingPut({ body, options }) { + return request('/llmops/v1/api/user/role', { + method: 'PUT', + data: body, + ...(options || {}), + }); +} +import { queryOptions, useMutation } from '@tanstack/react-query'; +import { request } from 'axios'; + +import * as apis from './user'; + +/** ListUser 系统全局用户列表 GET /llmops/v1/api/user */ +export function v1ApiUserUsingGetQueryOptions(options) { + return queryOptions({ + queryFn: async ({ queryKey }) => { + return apis.v1ApiUserUsingGet(queryKey[1]); + }, + queryKey: ['v1ApiUserUsingGet', options], + }); +} + +/** GetUserInfoByToken 获取iam用户数据 GET /llmops/v1/api/user/info */ +export function v1ApiUserInfoUsingGetQueryOptions(options) { + return queryOptions({ + queryFn: async ({ queryKey }) => { + return apis.v1ApiUserInfoUsingGet(queryKey[1]); + }, + queryKey: ['v1ApiUserInfoUsingGet', options], + }); +} + +/** UpdateUserRole 更新用户角色 PUT /llmops/v1/api/user/role */ +export function useV1ApiUserRoleUsingPutMutation(options) { + const { onSuccess, onError } = options || {}; + + const response = useMutation({ + mutationFn: apis.v1ApiUserRoleUsingPut, + onSuccess(data) { + onSuccess && onSuccess(data); + }, + onError(error) { + onError && onError(error); + }, + }); + + return response; +} +import { request } from 'axios'; + +/** GetWorkspaceList 空间列表 GET /llmops/v2/api/workspaces */ +export async function v2ApiWorkspacesUsingGet({ options }) { + return request('/llmops/v2/api/workspaces', { + method: 'GET', + ...(options || {}), + }); +} + +/** CreateWorkspace 创建空间 POST /llmops/v2/api/workspaces */ +export async function v2ApiWorkspacesUsingPost({ body, options }) { + return request('/llmops/v2/api/workspaces', { + method: 'POST', + data: body, + ...(options || {}), + }); +} + +/** GetDefaultWorkspace 获取用户默认空间 GET /llmops/v2/api/workspaces-default */ +export async function v2ApiWorkspacesDefaultUsingGet({ options }) { + return request('/llmops/v2/api/workspaces-default', { + method: 'GET', + ...(options || {}), + }); +} + +/** 切换默认空间 POST /llmops/v2/api/workspaces-default */ +export async function v2ApiWorkspacesDefaultUsingPost({ params, options }) { + return request('/llmops/v2/api/workspaces-default', { + method: 'POST', + params: { + ...params, + }, + ...(options || {}), + }); +} + +/** UpdateWorkspace 更新空间 POST /llmops/v2/api/workspaces/${param0} */ +export async function v2ApiWorkspacesWorkspaceIdUsingPost({ + params, + body, + options, +}) { + const { workspaceID: param0, ...queryParams } = params; + + return request(`/llmops/v2/api/workspaces/${param0}`, { + method: 'POST', + params: { ...queryParams }, + data: body, + ...(options || {}), + }); +} + +/** DeleteWorkspace 删除空间 DELETE /llmops/v2/api/workspaces/${param0} */ +export async function v2ApiWorkspacesWorkspaceIdUsingDelete({ + params, + options, +}) { + const { workspaceID: param0, ...queryParams } = params; + + return request(`/llmops/v2/api/workspaces/${param0}`, { + method: 'DELETE', + params: { ...queryParams }, + ...(options || {}), + }); +} + +/** CreateDatasetsJoinV2 创建 app 数据集关联 POST /llmops/v2/api/workspaces/${param0}/app/${param1}/datasets/join */ +export async function v2ApiWorkspacesWorkspaceIdAppAppIdDatasetsJoinUsingPost({ + params, + body, + options, +}) { + const { workspaceID: param0, appID: param1, ...queryParams } = params; + + return request( + `/llmops/v2/api/workspaces/${param0}/app/${param1}/datasets/join`, + { + method: 'POST', + params: { ...queryParams }, + data: body, + ...(options || {}), + } + ); +} + +/** GetWorkspaceDatasetsList 空间下数据集列表 GET /llmops/v2/api/workspaces/${param0}/datasets */ +export async function v2ApiWorkspacesWorkspaceIdDatasetsUsingGet({ + params, + options, +}) { + const { workspaceID: param0, ...queryParams } = params; + + return request(`/llmops/v2/api/workspaces/${param0}/datasets`, { + method: 'GET', + params: { ...queryParams }, + ...(options || {}), + }); +} + +/** CreateWorkspaceDatasets 创建空间下数据集 POST /llmops/v2/api/workspaces/${param0}/datasets */ +export async function v2ApiWorkspacesWorkspaceIdDatasetsUsingPost({ + params, + body, + options, +}) { + const { workspaceID: param0, ...queryParams } = params; + + return request(`/llmops/v2/api/workspaces/${param0}/datasets`, { + method: 'POST', + params: { ...queryParams }, + data: body, + ...(options || {}), + }); +} + +/** GetWorkspaceUserRole 查询空间用户权限 GET /llmops/v2/api/workspaces/${param0}/permissions */ +export async function v2ApiWorkspacesWorkspaceIdPermissionsUsingGet({ + params, + options, +}) { + const { workspaceID: param0, ...queryParams } = params; + + return request(`/llmops/v2/api/workspaces/${param0}/permissions`, { + method: 'GET', + params: { ...queryParams }, + ...(options || {}), + }); +} + +/** DeleteWorkspaceUsers 删除空间下用户 DELETE /llmops/v2/api/workspaces/${param0}/user/${param1} */ +export async function v2ApiWorkspacesWorkspaceIdUserUserIdUsingDelete({ + params, + options, +}) { + const { workspaceID: param0, userID: param1, ...queryParams } = params; + + return request(`/llmops/v2/api/workspaces/${param0}/user/${param1}`, { + method: 'DELETE', + params: { ...queryParams }, + ...(options || {}), + }); +} + +/** GetWorkspaceUsers 查询空间下用户列表 GET /llmops/v2/api/workspaces/${param0}/users */ +export async function v2ApiWorkspacesWorkspaceIdUsersUsingGet({ + params, + options, +}) { + const { workspaceID: param0, ...queryParams } = params; + + return request(`/llmops/v2/api/workspaces/${param0}/users`, { + method: 'GET', + params: { ...queryParams }, + ...(options || {}), + }); +} + +/** CreateOrUpdateWorkspaceUsers 添加或更新空间下用户角色 POST /llmops/v2/api/workspaces/${param0}/users */ +export async function v2ApiWorkspacesWorkspaceIdUsersUsingPost({ + params, + body, + options, +}) { + const { workspaceID: param0, ...queryParams } = params; + + return request(`/llmops/v2/api/workspaces/${param0}/users`, { + method: 'POST', + params: { ...queryParams }, + data: body, + ...(options || {}), + }); +} +import { queryOptions, useMutation } from '@tanstack/react-query'; +import { request } from 'axios'; + +import * as apis from './workspace'; + +/** GetWorkspaceList 空间列表 GET /llmops/v2/api/workspaces */ +export function v2ApiWorkspacesUsingGetQueryOptions(options) { + return queryOptions({ + queryFn: async ({ queryKey }) => { + return apis.v2ApiWorkspacesUsingGet(queryKey[1]); + }, + queryKey: ['v2ApiWorkspacesUsingGet', options], + }); +} + +/** CreateWorkspace 创建空间 POST /llmops/v2/api/workspaces */ +export function useV2ApiWorkspacesUsingPostMutation(options) { + const { onSuccess, onError } = options || {}; + + const response = useMutation({ + mutationFn: apis.v2ApiWorkspacesUsingPost, + onSuccess(data) { + onSuccess && onSuccess(data); + }, + onError(error) { + onError && onError(error); + }, + }); + + return response; +} + +/** GetDefaultWorkspace 获取用户默认空间 GET /llmops/v2/api/workspaces-default */ +export function v2ApiWorkspacesDefaultUsingGetQueryOptions(options) { + return queryOptions({ + queryFn: async ({ queryKey }) => { + return apis.v2ApiWorkspacesDefaultUsingGet(queryKey[1]); + }, + queryKey: ['v2ApiWorkspacesDefaultUsingGet', options], + }); +} + +/** 切换默认空间 POST /llmops/v2/api/workspaces-default */ +export function useV2ApiWorkspacesDefaultUsingPostMutation(options) { + const { onSuccess, onError } = options || {}; + + const response = useMutation({ + mutationFn: apis.v2ApiWorkspacesDefaultUsingPost, + onSuccess(data) { + onSuccess && onSuccess(data); + }, + onError(error) { + onError && onError(error); + }, + }); + + return response; +} + +/** UpdateWorkspace 更新空间 POST /llmops/v2/api/workspaces/${param0} */ +export function useV2ApiWorkspacesWorkspaceIdUsingPostMutation(options) { + const { onSuccess, onError } = options || {}; + + const response = useMutation({ + mutationFn: apis.v2ApiWorkspacesWorkspaceIdUsingPost, + onSuccess(data) { + onSuccess && onSuccess(data); + }, + onError(error) { + onError && onError(error); + }, + }); + + return response; +} + +/** DeleteWorkspace 删除空间 DELETE /llmops/v2/api/workspaces/${param0} */ +export function useV2ApiWorkspacesWorkspaceIdUsingDeleteMutation(options) { + const { onSuccess, onError } = options || {}; + + const response = useMutation({ + mutationFn: apis.v2ApiWorkspacesWorkspaceIdUsingDelete, + onSuccess(data) { + onSuccess && onSuccess(data); + }, + onError(error) { + onError && onError(error); + }, + }); + + return response; +} + +/** CreateDatasetsJoinV2 创建 app 数据集关联 POST /llmops/v2/api/workspaces/${param0}/app/${param1}/datasets/join */ +export function useV2ApiWorkspacesWorkspaceIdAppAppIdDatasetsJoinUsingPostMutation( + options +) { + const { onSuccess, onError } = options || {}; + + const response = useMutation({ + mutationFn: apis.v2ApiWorkspacesWorkspaceIdAppAppIdDatasetsJoinUsingPost, + onSuccess(data) { + onSuccess && onSuccess(data); + }, + onError(error) { + onError && onError(error); + }, + }); + + return response; +} + +/** GetWorkspaceDatasetsList 空间下数据集列表 GET /llmops/v2/api/workspaces/${param0}/datasets */ +export function v2ApiWorkspacesWorkspaceIdDatasetsUsingGetQueryOptions( + options +) { + return queryOptions({ + queryFn: async ({ queryKey }) => { + return apis.v2ApiWorkspacesWorkspaceIdDatasetsUsingGet(queryKey[1]); + }, + queryKey: ['v2ApiWorkspacesWorkspaceIdDatasetsUsingGet', options], + }); +} + +/** CreateWorkspaceDatasets 创建空间下数据集 POST /llmops/v2/api/workspaces/${param0}/datasets */ +export function useV2ApiWorkspacesWorkspaceIdDatasetsUsingPostMutation( + options +) { + const { onSuccess, onError } = options || {}; + + const response = useMutation({ + mutationFn: apis.v2ApiWorkspacesWorkspaceIdDatasetsUsingPost, + onSuccess(data) { + onSuccess && onSuccess(data); + }, + onError(error) { + onError && onError(error); + }, + }); + + return response; +} + +/** GetWorkspaceUserRole 查询空间用户权限 GET /llmops/v2/api/workspaces/${param0}/permissions */ +export function v2ApiWorkspacesWorkspaceIdPermissionsUsingGetQueryOptions( + options +) { + return queryOptions({ + queryFn: async ({ queryKey }) => { + return apis.v2ApiWorkspacesWorkspaceIdPermissionsUsingGet(queryKey[1]); + }, + queryKey: ['v2ApiWorkspacesWorkspaceIdPermissionsUsingGet', options], + }); +} + +/** DeleteWorkspaceUsers 删除空间下用户 DELETE /llmops/v2/api/workspaces/${param0}/user/${param1} */ +export function useV2ApiWorkspacesWorkspaceIdUserUserIdUsingDeleteMutation( + options +) { + const { onSuccess, onError } = options || {}; + + const response = useMutation({ + mutationFn: apis.v2ApiWorkspacesWorkspaceIdUserUserIdUsingDelete, + onSuccess(data) { + onSuccess && onSuccess(data); + }, + onError(error) { + onError && onError(error); + }, + }); + + return response; +} + +/** GetWorkspaceUsers 查询空间下用户列表 GET /llmops/v2/api/workspaces/${param0}/users */ +export function v2ApiWorkspacesWorkspaceIdUsersUsingGetQueryOptions(options) { + return queryOptions({ + queryFn: async ({ queryKey }) => { + return apis.v2ApiWorkspacesWorkspaceIdUsersUsingGet(queryKey[1]); + }, + queryKey: ['v2ApiWorkspacesWorkspaceIdUsersUsingGet', options], + }); +} + +/** CreateOrUpdateWorkspaceUsers 添加或更新空间下用户角色 POST /llmops/v2/api/workspaces/${param0}/users */ +export function useV2ApiWorkspacesWorkspaceIdUsersUsingPostMutation(options) { + const { onSuccess, onError } = options || {}; + + const response = useMutation({ + mutationFn: apis.v2ApiWorkspacesWorkspaceIdUsersUsingPost, + onSuccess(data) { + onSuccess && onSuccess(data); + }, + onError(error) { + onError && onError(error); + }, + }); + + return response; +} +import { request } from 'axios'; + +/** CopyApp 复制 app POST /llmops/v2/api/copy_apps */ +export async function v2ApiCopyAppsUsingPost({ body, options }) { + return request('/llmops/v2/api/copy_apps', { + method: 'POST', + data: body, + ...(options || {}), + }); +} + +/** UpdateAppV2.1 更新 app 信息 POST /llmops/v2/api/workspaces/${param0}/app/${param1} */ +export async function v2ApiWorkspacesWorkspaceIdAppAppIdUsingPost({ + params, + body, + options, +}) { + const { workspaceID: param0, appID: param1, ...queryParams } = params; + + return request(`/llmops/v2/api/workspaces/${param0}/app/${param1}`, { + method: 'POST', + params: { ...queryParams }, + data: body, + ...(options || {}), + }); +} + +/** GetAppDetailsV2.1 查询 app 详情 GET /llmops/v2/api/workspaces/${param0}/app/${param1}/details */ +export async function v2ApiWorkspacesWorkspaceIdAppAppIdDetailsUsingGet({ + params, + options, +}) { + const { workspaceID: param0, appID: param1, ...queryParams } = params; + + return request(`/llmops/v2/api/workspaces/${param0}/app/${param1}/details`, { + method: 'GET', + params: { ...queryParams }, + ...(options || {}), + }); +} + +/** GetSumHourlyMessagesCountV2.1 每小时messages数 GET /llmops/v2/api/workspaces/${param0}/app/${param1}/hourly-messages */ +export async function v2ApiWorkspacesWorkspaceIdAppAppIdHourlyMessagesUsingGet({ + params, + options, +}) { + const { workspaceID: param0, appID: param1, ...queryParams } = params; + + return request( + `/llmops/v2/api/workspaces/${param0}/app/${param1}/hourly-messages`, + { + method: 'GET', + params: { + ...queryParams, + }, + ...(options || {}), + } + ); +} + +/** GetSumHourlyTokenV2.1 每小时token数 GET /llmops/v2/api/workspaces/${param0}/app/${param1}/hourly-token */ +export async function v2ApiWorkspacesWorkspaceIdAppAppIdHourlyTokenUsingGet({ + params, + options, +}) { + const { workspaceID: param0, appID: param1, ...queryParams } = params; + + return request( + `/llmops/v2/api/workspaces/${param0}/app/${param1}/hourly-token`, + { + method: 'GET', + params: { + ...queryParams, + }, + ...(options || {}), + } + ); +} + +/** GetSumDailyMessagesCountV2.1 每日messages数 GET /llmops/v2/api/workspaces/${param0}/app/${param1}/messages */ +export async function v2ApiWorkspacesWorkspaceIdAppAppIdMessagesUsingGet({ + params, + options, +}) { + const { workspaceID: param0, appID: param1, ...queryParams } = params; + + return request(`/llmops/v2/api/workspaces/${param0}/app/${param1}/messages`, { + method: 'GET', + params: { + ...queryParams, + }, + ...(options || {}), + }); +} + +/** UpdateAppStatusV2.1 更新 app 状态 PUT /llmops/v2/api/workspaces/${param0}/app/${param1}/update_status */ +export async function v2ApiWorkspacesWorkspaceIdAppAppIdUpdateStatusUsingPut({ + params, + body, + options, +}) { + const { workspaceID: param0, appID: param1, ...queryParams } = params; + + return request( + `/llmops/v2/api/workspaces/${param0}/app/${param1}/update_status`, + { + method: 'PUT', + params: { ...queryParams }, + data: body, + ...(options || {}), + } + ); +} + +/** ListAppV2.1 查询用户关联的 app 列表 GET /llmops/v2/api/workspaces/${param0}/apps */ +export async function v2ApiWorkspacesWorkspaceIdAppsUsingGet({ + params, + options, +}) { + const { workspaceID: param0, ...queryParams } = params; + + return request(`/llmops/v2/api/workspaces/${param0}/apps`, { + method: 'GET', + params: { + ...queryParams, + }, + ...(options || {}), + }); +} + +/** CreateAppV2.1 创建 app POST /llmops/v2/api/workspaces/${param0}/apps */ +export async function v2ApiWorkspacesWorkspaceIdAppsUsingPost({ + params, + body, + options, +}) { + const { workspaceID: param0, ...queryParams } = params; + + return request(`/llmops/v2/api/workspaces/${param0}/apps`, { + method: 'POST', + params: { ...queryParams }, + data: body, + ...(options || {}), + }); +} + +/** DeleteDatasetsJoinV2.1 删除 app 数据集关联 DELETE /llmops/v2/api/workspaces/${param1}/app/${param0}/datasets */ +export async function v2ApiWorkspacesWorkspaceIdAppAppIdDatasetsUsingDelete({ + params, + options, +}) { + const { appID: param0, workspaceID: param1, ...queryParams } = params; + + return request(`/llmops/v2/api/workspaces/${param1}/app/${param0}/datasets`, { + method: 'DELETE', + params: { + ...queryParams, + }, + ...(options || {}), + }); +} + +/** GetAppLogsV2.1 查询 app 日志与标注 GET /llmops/v2/api/workspaces/${param1}/app/${param0}/logs */ +export async function v2ApiWorkspacesWorkspaceIdAppAppIdLogsUsingGet({ + params, + options, +}) { + const { appID: param0, workspaceID: param1, ...queryParams } = params; + + return request(`/llmops/v2/api/workspaces/${param1}/app/${param0}/logs`, { + method: 'GET', + params: { + ...queryParams, + }, + ...(options || {}), + }); +} + +/** UpdateModelConfigsV2.1 更新 app model configs PUT /llmops/v2/api/workspaces/${param1}/app/${param0}/model-configs */ +export async function v2ApiWorkspacesWorkspaceIdAppAppIdModelConfigsUsingPut({ + params, + body, + options, +}) { + const { appID: param0, workspaceID: param1, ...queryParams } = params; + + return request( + `/llmops/v2/api/workspaces/${param1}/app/${param0}/model-configs`, + { + method: 'PUT', + params: { ...queryParams }, + data: body, + ...(options || {}), + } + ); +} + +/** GetPluginListV2.1 获取插件列表 GET /llmops/v2/api/workspaces/${param1}/app/${param0}/plugin */ +export async function v2ApiWorkspacesWorkspaceIdAppAppIdPluginUsingGet({ + params, + options, +}) { + const { appID: param0, workspaceID: param1, ...queryParams } = params; + + return request(`/llmops/v2/api/workspaces/${param1}/app/${param0}/plugin`, { + method: 'GET', + params: { ...queryParams }, + ...(options || {}), + }); +} + +/** GetSumDailyTokenV2.1 每日token GET /llmops/v2/api/workspaces/${param1}/app/${param0}/token */ +export async function v2ApiWorkspacesWorkspaceIdAppAppIdTokenUsingGet({ + params, + options, +}) { + const { appID: param0, workspaceID: param1, ...queryParams } = params; + + return request(`/llmops/v2/api/workspaces/${param1}/app/${param0}/token`, { + method: 'GET', + params: { + ...queryParams, + }, + ...(options || {}), + }); +} + +/** DeleteAppV2.1 删除 app DELETE /llmops/v2/api/workspaces/${param1}/apps/${param0} */ +export async function v2ApiWorkspacesWorkspaceIdAppsAppIdUsingDelete({ + params, + options, +}) { + const { appID: param0, workspaceID: param1, ...queryParams } = params; + + return request(`/llmops/v2/api/workspaces/${param1}/apps/${param0}`, { + method: 'DELETE', + params: { ...queryParams }, + ...(options || {}), + }); +} + +/** UpdateAppImage 更新 app名称头像 POST /llmops/v2/api/workspaces/${param1}/apps/${param0}/base */ +export async function v2ApiWorkspacesWorkspaceIdAppsAppIdBaseUsingPost({ + params, + body, + options, +}) { + const { appID: param0, workspaceID: param1, ...queryParams } = params; + + return request(`/llmops/v2/api/workspaces/${param1}/apps/${param0}/base`, { + method: 'POST', + params: { ...queryParams }, + data: body, + ...(options || {}), + }); +} + +/** UpdateAppGroup 更新 app 分组 POST /llmops/v2/api/workspaces/${param1}/apps/${param0}/group */ +export async function v2ApiWorkspacesWorkspaceIdAppsAppIdGroupUsingPost({ + params, + body, + options, +}) { + const { appID: param0, workspaceID: param1, ...queryParams } = params; + + return request(`/llmops/v2/api/workspaces/${param1}/apps/${param0}/group`, { + method: 'POST', + params: { ...queryParams }, + data: body, + ...(options || {}), + }); +} + +/** GetAppRecommendedContext 获取自定义推荐问题 & 推荐开关 GET /llmops/v2/api/workspaces/recommended/${param0}/details */ +export async function v2ApiWorkspacesRecommendedMessageIdDetailsUsingGet({ + params, + options, +}) { + const { messageId: param0, ...queryParams } = params; + + return request(`/llmops/v2/api/workspaces/recommended/${param0}/details`, { + method: 'GET', + params: { ...queryParams }, + ...(options || {}), + }); +} +import { queryOptions, useMutation } from '@tanstack/react-query'; +import { request } from 'axios'; + +import * as apis from './workspaceAppV2'; + +/** CopyApp 复制 app POST /llmops/v2/api/copy_apps */ +export function useV2ApiCopyAppsUsingPostMutation(options) { + const { onSuccess, onError } = options || {}; + + const response = useMutation({ + mutationFn: apis.v2ApiCopyAppsUsingPost, + onSuccess(data) { + onSuccess && onSuccess(data); + }, + onError(error) { + onError && onError(error); + }, + }); + + return response; +} + +/** UpdateAppV2.1 更新 app 信息 POST /llmops/v2/api/workspaces/${param0}/app/${param1} */ +export function useV2ApiWorkspacesWorkspaceIdAppAppIdUsingPostMutation( + options +) { + const { onSuccess, onError } = options || {}; + + const response = useMutation({ + mutationFn: apis.v2ApiWorkspacesWorkspaceIdAppAppIdUsingPost, + onSuccess(data) { + onSuccess && onSuccess(data); + }, + onError(error) { + onError && onError(error); + }, + }); + + return response; +} + +/** GetAppDetailsV2.1 查询 app 详情 GET /llmops/v2/api/workspaces/${param0}/app/${param1}/details */ +export function v2ApiWorkspacesWorkspaceIdAppAppIdDetailsUsingGetQueryOptions( + options +) { + return queryOptions({ + queryFn: async ({ queryKey }) => { + return apis.v2ApiWorkspacesWorkspaceIdAppAppIdDetailsUsingGet( + queryKey[1] + ); + }, + queryKey: ['v2ApiWorkspacesWorkspaceIdAppAppIdDetailsUsingGet', options], + }); +} + +/** GetSumHourlyMessagesCountV2.1 每小时messages数 GET /llmops/v2/api/workspaces/${param0}/app/${param1}/hourly-messages */ +export function v2ApiWorkspacesWorkspaceIdAppAppIdHourlyMessagesUsingGetQueryOptions( + options +) { + return queryOptions({ + queryFn: async ({ queryKey }) => { + return apis.v2ApiWorkspacesWorkspaceIdAppAppIdHourlyMessagesUsingGet( + queryKey[1] + ); + }, + queryKey: [ + 'v2ApiWorkspacesWorkspaceIdAppAppIdHourlyMessagesUsingGet', + options, + ], + }); +} + +/** GetSumHourlyTokenV2.1 每小时token数 GET /llmops/v2/api/workspaces/${param0}/app/${param1}/hourly-token */ +export function v2ApiWorkspacesWorkspaceIdAppAppIdHourlyTokenUsingGetQueryOptions( + options +) { + return queryOptions({ + queryFn: async ({ queryKey }) => { + return apis.v2ApiWorkspacesWorkspaceIdAppAppIdHourlyTokenUsingGet( + queryKey[1] + ); + }, + queryKey: [ + 'v2ApiWorkspacesWorkspaceIdAppAppIdHourlyTokenUsingGet', + options, + ], + }); +} + +/** GetSumDailyMessagesCountV2.1 每日messages数 GET /llmops/v2/api/workspaces/${param0}/app/${param1}/messages */ +export function v2ApiWorkspacesWorkspaceIdAppAppIdMessagesUsingGetQueryOptions( + options +) { + return queryOptions({ + queryFn: async ({ queryKey }) => { + return apis.v2ApiWorkspacesWorkspaceIdAppAppIdMessagesUsingGet( + queryKey[1] + ); + }, + queryKey: ['v2ApiWorkspacesWorkspaceIdAppAppIdMessagesUsingGet', options], + }); +} + +/** UpdateAppStatusV2.1 更新 app 状态 PUT /llmops/v2/api/workspaces/${param0}/app/${param1}/update_status */ +export function useV2ApiWorkspacesWorkspaceIdAppAppIdUpdateStatusUsingPutMutation( + options +) { + const { onSuccess, onError } = options || {}; + + const response = useMutation({ + mutationFn: apis.v2ApiWorkspacesWorkspaceIdAppAppIdUpdateStatusUsingPut, + onSuccess(data) { + onSuccess && onSuccess(data); + }, + onError(error) { + onError && onError(error); + }, + }); + + return response; +} + +/** ListAppV2.1 查询用户关联的 app 列表 GET /llmops/v2/api/workspaces/${param0}/apps */ +export function v2ApiWorkspacesWorkspaceIdAppsUsingGetQueryOptions(options) { + return queryOptions({ + queryFn: async ({ queryKey }) => { + return apis.v2ApiWorkspacesWorkspaceIdAppsUsingGet(queryKey[1]); + }, + queryKey: ['v2ApiWorkspacesWorkspaceIdAppsUsingGet', options], + }); +} + +/** CreateAppV2.1 创建 app POST /llmops/v2/api/workspaces/${param0}/apps */ +export function useV2ApiWorkspacesWorkspaceIdAppsUsingPostMutation(options) { + const { onSuccess, onError } = options || {}; + + const response = useMutation({ + mutationFn: apis.v2ApiWorkspacesWorkspaceIdAppsUsingPost, + onSuccess(data) { + onSuccess && onSuccess(data); + }, + onError(error) { + onError && onError(error); + }, + }); + + return response; +} + +/** DeleteDatasetsJoinV2.1 删除 app 数据集关联 DELETE /llmops/v2/api/workspaces/${param1}/app/${param0}/datasets */ +export function useV2ApiWorkspacesWorkspaceIdAppAppIdDatasetsUsingDeleteMutation( + options +) { + const { onSuccess, onError } = options || {}; + + const response = useMutation({ + mutationFn: apis.v2ApiWorkspacesWorkspaceIdAppAppIdDatasetsUsingDelete, + onSuccess(data) { + onSuccess && onSuccess(data); + }, + onError(error) { + onError && onError(error); + }, + }); + + return response; +} + +/** GetAppLogsV2.1 查询 app 日志与标注 GET /llmops/v2/api/workspaces/${param1}/app/${param0}/logs */ +export function v2ApiWorkspacesWorkspaceIdAppAppIdLogsUsingGetQueryOptions( + options +) { + return queryOptions({ + queryFn: async ({ queryKey }) => { + return apis.v2ApiWorkspacesWorkspaceIdAppAppIdLogsUsingGet(queryKey[1]); + }, + queryKey: ['v2ApiWorkspacesWorkspaceIdAppAppIdLogsUsingGet', options], + }); +} + +/** UpdateModelConfigsV2.1 更新 app model configs PUT /llmops/v2/api/workspaces/${param1}/app/${param0}/model-configs */ +export function useV2ApiWorkspacesWorkspaceIdAppAppIdModelConfigsUsingPutMutation( + options +) { + const { onSuccess, onError } = options || {}; + + const response = useMutation({ + mutationFn: apis.v2ApiWorkspacesWorkspaceIdAppAppIdModelConfigsUsingPut, + onSuccess(data) { + onSuccess && onSuccess(data); + }, + onError(error) { + onError && onError(error); + }, + }); + + return response; +} + +/** GetPluginListV2.1 获取插件列表 GET /llmops/v2/api/workspaces/${param1}/app/${param0}/plugin */ +export function v2ApiWorkspacesWorkspaceIdAppAppIdPluginUsingGetQueryOptions( + options +) { + return queryOptions({ + queryFn: async ({ queryKey }) => { + return apis.v2ApiWorkspacesWorkspaceIdAppAppIdPluginUsingGet(queryKey[1]); + }, + queryKey: ['v2ApiWorkspacesWorkspaceIdAppAppIdPluginUsingGet', options], + }); +} + +/** GetSumDailyTokenV2.1 每日token GET /llmops/v2/api/workspaces/${param1}/app/${param0}/token */ +export function v2ApiWorkspacesWorkspaceIdAppAppIdTokenUsingGetQueryOptions( + options +) { + return queryOptions({ + queryFn: async ({ queryKey }) => { + return apis.v2ApiWorkspacesWorkspaceIdAppAppIdTokenUsingGet(queryKey[1]); + }, + queryKey: ['v2ApiWorkspacesWorkspaceIdAppAppIdTokenUsingGet', options], + }); +} + +/** DeleteAppV2.1 删除 app DELETE /llmops/v2/api/workspaces/${param1}/apps/${param0} */ +export function useV2ApiWorkspacesWorkspaceIdAppsAppIdUsingDeleteMutation( + options +) { + const { onSuccess, onError } = options || {}; + + const response = useMutation({ + mutationFn: apis.v2ApiWorkspacesWorkspaceIdAppsAppIdUsingDelete, + onSuccess(data) { + onSuccess && onSuccess(data); + }, + onError(error) { + onError && onError(error); + }, + }); + + return response; +} + +/** UpdateAppImage 更新 app名称头像 POST /llmops/v2/api/workspaces/${param1}/apps/${param0}/base */ +export function useV2ApiWorkspacesWorkspaceIdAppsAppIdBaseUsingPostMutation( + options +) { + const { onSuccess, onError } = options || {}; + + const response = useMutation({ + mutationFn: apis.v2ApiWorkspacesWorkspaceIdAppsAppIdBaseUsingPost, + onSuccess(data) { + onSuccess && onSuccess(data); + }, + onError(error) { + onError && onError(error); + }, + }); + + return response; +} + +/** UpdateAppGroup 更新 app 分组 POST /llmops/v2/api/workspaces/${param1}/apps/${param0}/group */ +export function useV2ApiWorkspacesWorkspaceIdAppsAppIdGroupUsingPostMutation( + options +) { + const { onSuccess, onError } = options || {}; + + const response = useMutation({ + mutationFn: apis.v2ApiWorkspacesWorkspaceIdAppsAppIdGroupUsingPost, + onSuccess(data) { + onSuccess && onSuccess(data); + }, + onError(error) { + onError && onError(error); + }, + }); + + return response; +} + +/** GetAppRecommendedContext 获取自定义推荐问题 & 推荐开关 GET /llmops/v2/api/workspaces/recommended/${param0}/details */ +export function v2ApiWorkspacesRecommendedMessageIdDetailsUsingGetQueryOptions( + options +) { + return queryOptions({ + queryFn: async ({ queryKey }) => { + return apis.v2ApiWorkspacesRecommendedMessageIdDetailsUsingGet( + queryKey[1] + ); + }, + queryKey: ['v2ApiWorkspacesRecommendedMessageIdDetailsUsingGet', options], + }); +} +import { request } from 'axios'; + +/** GetWorkspaceGroupList 空间分组列表 GET /llmops/v2/api/workspaces/${param0}/groups */ +export async function v2ApiWorkspacesWorkspaceIdGroupsUsingGet({ + params, + options, +}) { + const { workspaceID: param0, ...queryParams } = params; + + return request(`/llmops/v2/api/workspaces/${param0}/groups`, { + method: 'GET', + params: { ...queryParams }, + ...(options || {}), + }); +} + +/** CreateWorkspaceGroup 创建空间分组 POST /llmops/v2/api/workspaces/${param0}/groups */ +export async function v2ApiWorkspacesWorkspaceIdGroupsUsingPost({ + params, + body, + options, +}) { + const { workspaceID: param0, ...queryParams } = params; + + return request(`/llmops/v2/api/workspaces/${param0}/groups`, { + method: 'POST', + params: { ...queryParams }, + data: body, + ...(options || {}), + }); +} + +/** UpdateWorkspaceGroup 更新分组 POST /llmops/v2/api/workspaces/${param0}/groups/${param1} */ +export async function v2ApiWorkspacesWorkspaceIdGroupsWorkspaceGroupIdUsingPost({ + params, + body, + options, +}) { + const { + workspaceID: param0, + workspaceGroupID: param1, + ...queryParams + } = params; + + return request(`/llmops/v2/api/workspaces/${param0}/groups/${param1}`, { + method: 'POST', + params: { ...queryParams }, + data: body, + ...(options || {}), + }); +} + +/** DeleteWorkspaceGroup 删除分组 DELETE /llmops/v2/api/workspaces/${param0}/groups/${param1} */ +export async function v2ApiWorkspacesWorkspaceIdGroupsWorkspaceGroupIdUsingDelete({ + params, + options, +}) { + const { + workspaceID: param0, + workspaceGroupID: param1, + ...queryParams + } = params; + + return request(`/llmops/v2/api/workspaces/${param0}/groups/${param1}`, { + method: 'DELETE', + params: { ...queryParams }, + ...(options || {}), + }); +} +import { queryOptions, useMutation } from '@tanstack/react-query'; +import { request } from 'axios'; + +import * as apis from './workspaceGroup'; + +/** GetWorkspaceGroupList 空间分组列表 GET /llmops/v2/api/workspaces/${param0}/groups */ +export function v2ApiWorkspacesWorkspaceIdGroupsUsingGetQueryOptions(options) { + return queryOptions({ + queryFn: async ({ queryKey }) => { + return apis.v2ApiWorkspacesWorkspaceIdGroupsUsingGet(queryKey[1]); + }, + queryKey: ['v2ApiWorkspacesWorkspaceIdGroupsUsingGet', options], + }); +} + +/** CreateWorkspaceGroup 创建空间分组 POST /llmops/v2/api/workspaces/${param0}/groups */ +export function useV2ApiWorkspacesWorkspaceIdGroupsUsingPostMutation(options) { + const { onSuccess, onError } = options || {}; + + const response = useMutation({ + mutationFn: apis.v2ApiWorkspacesWorkspaceIdGroupsUsingPost, + onSuccess(data) { + onSuccess && onSuccess(data); + }, + onError(error) { + onError && onError(error); + }, + }); + + return response; +} + +/** UpdateWorkspaceGroup 更新分组 POST /llmops/v2/api/workspaces/${param0}/groups/${param1} */ +export function useV2ApiWorkspacesWorkspaceIdGroupsWorkspaceGroupIdUsingPostMutation( + options +) { + const { onSuccess, onError } = options || {}; + + const response = useMutation({ + mutationFn: apis.v2ApiWorkspacesWorkspaceIdGroupsWorkspaceGroupIdUsingPost, + onSuccess(data) { + onSuccess && onSuccess(data); + }, + onError(error) { + onError && onError(error); + }, + }); + + return response; +} + +/** DeleteWorkspaceGroup 删除分组 DELETE /llmops/v2/api/workspaces/${param0}/groups/${param1} */ +export function useV2ApiWorkspacesWorkspaceIdGroupsWorkspaceGroupIdUsingDeleteMutation( + options +) { + const { onSuccess, onError } = options || {}; + + const response = useMutation({ + mutationFn: + apis.v2ApiWorkspacesWorkspaceIdGroupsWorkspaceGroupIdUsingDelete, + onSuccess(data) { + onSuccess && onSuccess(data); + }, + onError(error) { + onError && onError(error); + }, + }); + + return response; +} diff --git "a/test/__snapshots__/common/\346\265\213\350\257\225\347\224\237\346\210\220 isSupportParseEnumDesc \350\256\276\347\275\256\344\270\272true.snap" "b/test/__snapshots__/common/\346\265\213\350\257\225\347\224\237\346\210\220 isSupportParseEnumDesc \350\256\276\347\275\256\344\270\272true.snap" new file mode 100644 index 0000000..74f45f4 --- /dev/null +++ "b/test/__snapshots__/common/\346\265\213\350\257\225\347\224\237\346\210\220 isSupportParseEnumDesc \350\256\276\347\275\256\344\270\272true.snap" @@ -0,0 +1,60 @@ +/* eslint-disable */ +// @ts-ignore +import { request } from 'axios'; + +import * as API from './types'; + +/** 获取access_token > **为了安全考虑,开发者请勿将access_token返回给前端,需要开发者保存在后台,所有访问企业微信api的请求由后台发起**获取access_token是调用企业微信API接口的第一步,相当于创建了一个登录凭证,其它的业务API接口,都需要依赖于access_token来鉴权调用者身份。因此开发者,在使用业务接口前,要明确access_token的颁发来源,使用正确的access_token。**权限说明:**每个应用有独立的secret,获取到的access_token只能本应用使用,所以每个应用的access_token应该分开来获取。**注意事项:**开发者需要缓存access_token,用于后续接口的调用(注意:不能频繁调用gettoken接口,否则会受到频率拦截)。当access_token失效或过期时,需要重新获取。access_token的有效期通过返回的expires_in来传达,正常情况下为7200秒(2小时),有效期内重复获取返回相同结果,过期后获取会返回新的access_token。由于企业微信每个应用的access_token是彼此独立的,所以进行缓存时需要区分应用来进行存储。access_token至少保留512字节的存储空间。企业微信可能会出于运营需要,提前使access_token失效,开发者应实现access_token失效时重新获取的逻辑。 GET /cgi-bin/gettoken https://app.apifox.com/web/project/6276513/apis/api-288122020-run */ +export async function cgiBinGettokenUsingGet({ + params, + body, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.cgiBinGettokenUsingGetParams; + body: API.CgiBinGettokenUsingGetBody; + options?: { [key: string]: unknown }; +}) { + return request('/cgi-bin/gettoken', { + method: 'GET', + headers: { + 'Content-Type': 'application/json', + }, + params: { + ...params, + }, + data: body, + ...(options || {}), + }); +} +/* eslint-disable */ +// @ts-ignore +export * from './types'; + +export * from './gettoken'; +/* eslint-disable */ +// @ts-ignore + +export type CgiBinGettokenUsingGetBody = { + name: string; + email: string; + age?: number; +}; + +export type cgiBinGettokenUsingGetParams = { + /** 企业ID,获取方式参考:[术语说明-corpid](https://developer.work.weixin.qq.com/document/path/91039#14953/corpid) */ + corpid: string; + /** 应用的凭证密钥,获取方式参考:[术语说明-secret](https://developer.work.weixin.qq.com/document/path/91039#14953/secret) */ + corpsecret: string; +}; + +export type CgiBinGettokenUsingGetResponse = { + /** 出错返回码,为0表示成功,非0表示调用失败 */ + errcode: number; + /** 返回码提示语 */ + errmsg: string; + /** 获取到的凭证,最长为512字节 */ + access_token: string; + /** 凭证的有效时间(秒) */ + expires_in: number; +}; diff --git "a/test/__snapshots__/common/\346\265\213\350\257\225\347\224\237\346\210\220 react-query \347\232\204 vue \346\250\241\345\274\217.snap" "b/test/__snapshots__/common/\346\265\213\350\257\225\347\224\237\346\210\220 react-query \347\232\204 vue \346\250\241\345\274\217.snap" new file mode 100644 index 0000000..d9f464a --- /dev/null +++ "b/test/__snapshots__/common/\346\265\213\350\257\225\347\224\237\346\210\220 react-query \347\232\204 vue \346\250\241\345\274\217.snap" @@ -0,0 +1,6556 @@ +/* eslint-disable */ +// @ts-ignore +import { request } from 'axios'; + +import * as API from './types'; + +/** AddAppKey 为应用添加各种类型机器人appkey POST /llmops/v1/api/robot/${param0}/appkey */ +export async function v1ApiRobotWorkspaceIdAppkeyUsingPost({ + params, + body, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v1ApiRobotWorkspaceIdAppkeyUsingPostParams; + body: API.AddAppkeyReq; + options?: { [key: string]: unknown }; +}) { + const { workspaceID: param0, ...queryParams } = params; + + return request(`/llmops/v1/api/robot/${param0}/appkey`, { + method: 'POST', + params: { ...queryParams }, + data: body, + ...(options || {}), + }); +} +/* eslint-disable */ +// @ts-ignore +import { queryOptions, useMutation } from '@tanstack/vue-query'; +import type { DefaultError } from '@tanstack/vue-query'; +import { request } from 'axios'; + +import * as apis from './addAppKey'; +import * as API from './types'; + +/** AddAppKey 为应用添加各种类型机器人appkey POST /llmops/v1/api/robot/${param0}/appkey */ +export function useV1ApiRobotWorkspaceIdAppkeyUsingPostMutation(options?: { + onSuccess?: (value?: unknown) => void; + onError?: (error?: DefaultError) => void; +}) { + const { onSuccess, onError } = options || {}; + + const response = useMutation({ + mutationFn: apis.v1ApiRobotWorkspaceIdAppkeyUsingPost, + onSuccess(data: unknown) { + onSuccess?.(data); + }, + onError(error) { + onError?.(error); + }, + }); + + return response; +} +/* eslint-disable */ +// @ts-ignore +import { request } from 'axios'; + +import * as API from './types'; + +/** ListApiToken 获取app 的 token 列表 GET /llmops/v1/api/app/${param0}/api-token */ +export async function v1ApiAppAppIdApiTokenUsingGet({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v1ApiAppAppIdApiTokenUsingGetParams; + options?: { [key: string]: unknown }; +}) { + const { appID: param0, ...queryParams } = params; + + return request( + `/llmops/v1/api/app/${param0}/api-token`, + { + method: 'GET', + params: { + ...queryParams, + }, + ...(options || {}), + } + ); +} + +/** CreateApiToken 创建 app 的token POST /llmops/v1/api/app/${param0}/api-token */ +export async function v1ApiAppAppIdApiTokenUsingPost({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v1ApiAppAppIdApiTokenUsingPostParams; + options?: { [key: string]: unknown }; +}) { + const { appID: param0, ...queryParams } = params; + + return request( + `/llmops/v1/api/app/${param0}/api-token`, + { + method: 'POST', + params: { ...queryParams }, + ...(options || {}), + } + ); +} +/* eslint-disable */ +// @ts-ignore +import { queryOptions, useMutation } from '@tanstack/vue-query'; +import type { DefaultError } from '@tanstack/vue-query'; +import { request } from 'axios'; + +import * as apis from './apiToken'; +import * as API from './types'; + +/** ListApiToken 获取app 的 token 列表 GET /llmops/v1/api/app/${param0}/api-token */ +export function v1ApiAppAppIdApiTokenUsingGetQueryOptions(options: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v1ApiAppAppIdApiTokenUsingGetParams; + options?: { [key: string]: unknown }; +}) { + return queryOptions({ + queryFn: async ({ queryKey }) => { + return apis.v1ApiAppAppIdApiTokenUsingGet(queryKey[1] as typeof options); + }, + queryKey: ['v1ApiAppAppIdApiTokenUsingGet', options], + }); +} + +/** CreateApiToken 创建 app 的token POST /llmops/v1/api/app/${param0}/api-token */ +export function useV1ApiAppAppIdApiTokenUsingPostMutation(options?: { + onSuccess?: (value?: API.CreateApiTokenRESP) => void; + onError?: (error?: DefaultError) => void; +}) { + const { onSuccess, onError } = options || {}; + + const response = useMutation({ + mutationFn: apis.v1ApiAppAppIdApiTokenUsingPost, + onSuccess(data: API.CreateApiTokenRESP) { + onSuccess?.(data); + }, + onError(error) { + onError?.(error); + }, + }); + + return response; +} +/* eslint-disable */ +// @ts-ignore +import { request } from 'axios'; + +import * as API from './types'; + +/** GetAppCostTokens 查询 app token消耗 POST /llmops/v1/api/${param0}/cost */ +export async function v1ApiAppIdCostUsingPost({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v1ApiAppIdCostUsingPostParams; + options?: { [key: string]: unknown }; +}) { + const { appID: param0, ...queryParams } = params; + + return request(`/llmops/v1/api/${param0}/cost`, { + method: 'POST', + params: { + ...queryParams, + }, + ...(options || {}), + }); +} + +/** CreateApp 创建 app POST /llmops/v1/api/app */ +export async function v1ApiAppUsingPost({ + body, + options, +}: { + body: API.CreateAppReq; + options?: { [key: string]: unknown }; +}) { + return request('/llmops/v1/api/app', { + method: 'POST', + data: body, + ...(options || {}), + }); +} + +/** DeleteApp 删除 app DELETE /llmops/v1/api/app/${param0}/delete */ +export async function v1ApiAppAppIdOpenApiDeleteUsingDelete({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v1ApiAppAppIdOpenApiDeleteUsingDeleteParams; + options?: { [key: string]: unknown }; +}) { + const { appID: param0, ...queryParams } = params; + + return request(`/llmops/v1/api/app/${param0}/delete`, { + method: 'DELETE', + params: { ...queryParams }, + ...(options || {}), + }); +} + +/** GetAppDetails 查询 app 详情 GET /llmops/v1/api/app/${param0}/details */ +export async function v1ApiAppAppIdDetailsUsingGet({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v1ApiAppAppIdDetailsUsingGetParams; + options?: { [key: string]: unknown }; +}) { + const { appID: param0, ...queryParams } = params; + + return request(`/llmops/v1/api/app/${param0}/details`, { + method: 'GET', + params: { ...queryParams }, + ...(options || {}), + }); +} + +/** GetSumHourlyMessagesCount 每小时messages数 GET /llmops/v1/api/app/${param0}/hourly-messages */ +export async function v1ApiAppAppIdHourlyMessagesUsingGet({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v1ApiAppAppIdHourlyMessagesUsingGetParams; + options?: { [key: string]: unknown }; +}) { + const { appID: param0, ...queryParams } = params; + + return request( + `/llmops/v1/api/app/${param0}/hourly-messages`, + { + method: 'GET', + params: { + ...queryParams, + }, + ...(options || {}), + } + ); +} + +/** GetSumHourlyToken 每小时token数 GET /llmops/v1/api/app/${param0}/hourly-token */ +export async function v1ApiAppAppIdHourlyTokenUsingGet({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v1ApiAppAppIdHourlyTokenUsingGetParams; + options?: { [key: string]: unknown }; +}) { + const { appID: param0, ...queryParams } = params; + + return request( + `/llmops/v1/api/app/${param0}/hourly-token`, + { + method: 'GET', + params: { + ...queryParams, + }, + ...(options || {}), + } + ); +} + +/** GetAppLogs 查询 app 日志与标注 GET /llmops/v1/api/app/${param0}/logs */ +export async function v1ApiAppAppIdLogsUsingGet({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v1ApiAppAppIdLogsUsingGetParams; + options?: { [key: string]: unknown }; +}) { + const { appID: param0, ...queryParams } = params; + + return request( + `/llmops/v1/api/app/${param0}/logs`, + { + method: 'GET', + params: { + ...queryParams, + }, + ...(options || {}), + } + ); +} + +/** GetLogsMessages 查询 app 日志与标注消息详情 GET /llmops/v1/api/app/${param0}/logs/${param1}/messages */ +export async function v1ApiAppAppIdLogsConversationIdMessagesUsingGet({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v1ApiAppAppIdLogsConversationIdMessagesUsingGetParams; + options?: { [key: string]: unknown }; +}) { + const { appID: param0, conversationID: param1, ...queryParams } = params; + + return request( + `/llmops/v1/api/app/${param0}/logs/${param1}/messages`, + { + method: 'GET', + params: { ...queryParams }, + ...(options || {}), + } + ); +} + +/** GetSumDailyMessagesCount 每日messages数 GET /llmops/v1/api/app/${param0}/messages */ +export async function v1ApiAppAppIdMessagesUsingGet({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v1ApiAppAppIdMessagesUsingGetParams; + options?: { [key: string]: unknown }; +}) { + const { appID: param0, ...queryParams } = params; + + return request( + `/llmops/v1/api/app/${param0}/messages`, + { + method: 'GET', + params: { + ...queryParams, + }, + ...(options || {}), + } + ); +} + +/** ShareChat 创建分享path PUT /llmops/v1/api/app/${param0}/share */ +export async function v1ApiAppAppIdShareUsingPut({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v1ApiAppAppIdShareUsingPutParams; + options?: { [key: string]: unknown }; +}) { + const { appID: param0, ...queryParams } = params; + + return request( + `/llmops/v1/api/app/${param0}/share`, + { + method: 'PUT', + params: { + ...queryParams, + }, + ...(options || {}), + } + ); +} + +/** GetSumDailyToken 每日token GET /llmops/v1/api/app/${param0}/token */ +export async function v1ApiAppAppIdTokenUsingGet({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v1ApiAppAppIdTokenUsingGetParams; + options?: { [key: string]: unknown }; +}) { + const { appID: param0, ...queryParams } = params; + + return request( + `/llmops/v1/api/app/${param0}/token`, + { + method: 'GET', + params: { + ...queryParams, + }, + ...(options || {}), + } + ); +} + +/** UpdateApp 更新 app PUT /llmops/v1/api/app/${param0}/update */ +export async function v1ApiAppAppIdUpdateUsingPut({ + params, + body, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v1ApiAppAppIdUpdateUsingPutParams; + body: API.UpdateAppReq; + options?: { [key: string]: unknown }; +}) { + const { appID: param0, ...queryParams } = params; + + return request(`/llmops/v1/api/app/${param0}/update`, { + method: 'PUT', + params: { ...queryParams }, + data: body, + ...(options || {}), + }); +} + +/** ReleaseDiscover 发布到发现 PUT /llmops/v1/api/app/${param0}/update_status */ +export async function v1ApiAppAppIdUpdateStatusUsingPut({ + params, + body, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v1ApiAppAppIdUpdateStatusUsingPutParams; + body: API.ReleaseDiscoverReq; + options?: { [key: string]: unknown }; +}) { + const { appID: param0, ...queryParams } = params; + + return request(`/llmops/v1/api/app/${param0}/update_status`, { + method: 'PUT', + params: { ...queryParams }, + data: body, + ...(options || {}), + }); +} + +/** GetImagePreSignedUrl 获取上传预签名地址 GET /llmops/v1/api/app/image */ +export async function v1ApiAppImageUsingGet({ + options, +}: { + options?: { [key: string]: unknown }; +}) { + return request('/llmops/v1/api/app/image', { + method: 'GET', + ...(options || {}), + }); +} + +/** ListApp 查询 app 列表 GET /llmops/v1/api/app/list */ +export async function v1ApiAppListUsingGet({ + options, +}: { + options?: { [key: string]: unknown }; +}) { + return request('/llmops/v1/api/app/list', { + method: 'GET', + ...(options || {}), + }); +} + +/** ListAppPick 查询精选 app 列表 GET /llmops/v1/api/app/list-pick */ +export async function v1ApiAppListPickUsingGet({ + options, +}: { + options?: { [key: string]: unknown }; +}) { + return request('/llmops/v1/api/app/list-pick', { + method: 'GET', + ...(options || {}), + }); +} + +/** ListAppByUser 查询用户关联的 app 列表 GET /llmops/v1/api/app/list-private */ +export async function v1ApiAppListPrivateUsingGet({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v1ApiAppListPrivateUsingGetParams; + options?: { [key: string]: unknown }; +}) { + return request('/llmops/v1/api/app/list-private', { + method: 'GET', + params: { + ...params, + }, + ...(options || {}), + }); +} + +/** ListAppPublic 查询公共 app 列表 GET /llmops/v1/api/app/list-public */ +export async function v1ApiAppListPublicUsingGet({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v1ApiAppListPublicUsingGetParams; + options?: { [key: string]: unknown }; +}) { + return request('/llmops/v1/api/app/list-public', { + method: 'GET', + params: { + ...params, + }, + ...(options || {}), + }); +} +/* eslint-disable */ +// @ts-ignore +import { queryOptions, useMutation } from '@tanstack/vue-query'; +import type { DefaultError } from '@tanstack/vue-query'; +import { request } from 'axios'; + +import * as apis from './app'; +import * as API from './types'; + +/** GetAppCostTokens 查询 app token消耗 POST /llmops/v1/api/${param0}/cost */ +export function useV1ApiAppIdCostUsingPostMutation(options?: { + onSuccess?: (value?: API.QueryTokenResp) => void; + onError?: (error?: DefaultError) => void; +}) { + const { onSuccess, onError } = options || {}; + + const response = useMutation({ + mutationFn: apis.v1ApiAppIdCostUsingPost, + onSuccess(data: API.QueryTokenResp) { + onSuccess?.(data); + }, + onError(error) { + onError?.(error); + }, + }); + + return response; +} + +/** CreateApp 创建 app POST /llmops/v1/api/app */ +export function useV1ApiAppUsingPostMutation(options?: { + onSuccess?: (value?: unknown) => void; + onError?: (error?: DefaultError) => void; +}) { + const { onSuccess, onError } = options || {}; + + const response = useMutation({ + mutationFn: apis.v1ApiAppUsingPost, + onSuccess(data: unknown) { + onSuccess?.(data); + }, + onError(error) { + onError?.(error); + }, + }); + + return response; +} + +/** DeleteApp 删除 app DELETE /llmops/v1/api/app/${param0}/delete */ +export function useV1ApiAppAppIdOpenApiDeleteUsingDeleteMutation(options?: { + onSuccess?: (value?: API.DeleteResp) => void; + onError?: (error?: DefaultError) => void; +}) { + const { onSuccess, onError } = options || {}; + + const response = useMutation({ + mutationFn: apis.v1ApiAppAppIdOpenApiDeleteUsingDelete, + onSuccess(data: API.DeleteResp) { + onSuccess?.(data); + }, + onError(error) { + onError?.(error); + }, + }); + + return response; +} + +/** GetAppDetails 查询 app 详情 GET /llmops/v1/api/app/${param0}/details */ +export function v1ApiAppAppIdDetailsUsingGetQueryOptions(options: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v1ApiAppAppIdDetailsUsingGetParams; + options?: { [key: string]: unknown }; +}) { + return queryOptions({ + queryFn: async ({ queryKey }) => { + return apis.v1ApiAppAppIdDetailsUsingGet(queryKey[1] as typeof options); + }, + queryKey: ['v1ApiAppAppIdDetailsUsingGet', options], + }); +} + +/** GetSumHourlyMessagesCount 每小时messages数 GET /llmops/v1/api/app/${param0}/hourly-messages */ +export function v1ApiAppAppIdHourlyMessagesUsingGetQueryOptions(options: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v1ApiAppAppIdHourlyMessagesUsingGetParams; + options?: { [key: string]: unknown }; +}) { + return queryOptions({ + queryFn: async ({ queryKey }) => { + return apis.v1ApiAppAppIdHourlyMessagesUsingGet( + queryKey[1] as typeof options + ); + }, + queryKey: ['v1ApiAppAppIdHourlyMessagesUsingGet', options], + }); +} + +/** GetSumHourlyToken 每小时token数 GET /llmops/v1/api/app/${param0}/hourly-token */ +export function v1ApiAppAppIdHourlyTokenUsingGetQueryOptions(options: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v1ApiAppAppIdHourlyTokenUsingGetParams; + options?: { [key: string]: unknown }; +}) { + return queryOptions({ + queryFn: async ({ queryKey }) => { + return apis.v1ApiAppAppIdHourlyTokenUsingGet( + queryKey[1] as typeof options + ); + }, + queryKey: ['v1ApiAppAppIdHourlyTokenUsingGet', options], + }); +} + +/** GetAppLogs 查询 app 日志与标注 GET /llmops/v1/api/app/${param0}/logs */ +export function v1ApiAppAppIdLogsUsingGetQueryOptions(options: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v1ApiAppAppIdLogsUsingGetParams; + options?: { [key: string]: unknown }; +}) { + return queryOptions({ + queryFn: async ({ queryKey }) => { + return apis.v1ApiAppAppIdLogsUsingGet(queryKey[1] as typeof options); + }, + queryKey: ['v1ApiAppAppIdLogsUsingGet', options], + }); +} + +/** GetLogsMessages 查询 app 日志与标注消息详情 GET /llmops/v1/api/app/${param0}/logs/${param1}/messages */ +export function v1ApiAppAppIdLogsConversationIdMessagesUsingGetQueryOptions(options: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v1ApiAppAppIdLogsConversationIdMessagesUsingGetParams; + options?: { [key: string]: unknown }; +}) { + return queryOptions({ + queryFn: async ({ queryKey }) => { + return apis.v1ApiAppAppIdLogsConversationIdMessagesUsingGet( + queryKey[1] as typeof options + ); + }, + queryKey: ['v1ApiAppAppIdLogsConversationIdMessagesUsingGet', options], + }); +} + +/** GetSumDailyMessagesCount 每日messages数 GET /llmops/v1/api/app/${param0}/messages */ +export function v1ApiAppAppIdMessagesUsingGetQueryOptions(options: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v1ApiAppAppIdMessagesUsingGetParams; + options?: { [key: string]: unknown }; +}) { + return queryOptions({ + queryFn: async ({ queryKey }) => { + return apis.v1ApiAppAppIdMessagesUsingGet(queryKey[1] as typeof options); + }, + queryKey: ['v1ApiAppAppIdMessagesUsingGet', options], + }); +} + +/** ShareChat 创建分享path PUT /llmops/v1/api/app/${param0}/share */ +export function useV1ApiAppAppIdShareUsingPutMutation(options?: { + onSuccess?: (value?: API.CreateSharePathRESP) => void; + onError?: (error?: DefaultError) => void; +}) { + const { onSuccess, onError } = options || {}; + + const response = useMutation({ + mutationFn: apis.v1ApiAppAppIdShareUsingPut, + onSuccess(data: API.CreateSharePathRESP) { + onSuccess?.(data); + }, + onError(error) { + onError?.(error); + }, + }); + + return response; +} + +/** GetSumDailyToken 每日token GET /llmops/v1/api/app/${param0}/token */ +export function v1ApiAppAppIdTokenUsingGetQueryOptions(options: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v1ApiAppAppIdTokenUsingGetParams; + options?: { [key: string]: unknown }; +}) { + return queryOptions({ + queryFn: async ({ queryKey }) => { + return apis.v1ApiAppAppIdTokenUsingGet(queryKey[1] as typeof options); + }, + queryKey: ['v1ApiAppAppIdTokenUsingGet', options], + }); +} + +/** UpdateApp 更新 app PUT /llmops/v1/api/app/${param0}/update */ +export function useV1ApiAppAppIdUpdateUsingPutMutation(options?: { + onSuccess?: (value?: unknown) => void; + onError?: (error?: DefaultError) => void; +}) { + const { onSuccess, onError } = options || {}; + + const response = useMutation({ + mutationFn: apis.v1ApiAppAppIdUpdateUsingPut, + onSuccess(data: unknown) { + onSuccess?.(data); + }, + onError(error) { + onError?.(error); + }, + }); + + return response; +} + +/** ReleaseDiscover 发布到发现 PUT /llmops/v1/api/app/${param0}/update_status */ +export function useV1ApiAppAppIdUpdateStatusUsingPutMutation(options?: { + onSuccess?: (value?: unknown) => void; + onError?: (error?: DefaultError) => void; +}) { + const { onSuccess, onError } = options || {}; + + const response = useMutation({ + mutationFn: apis.v1ApiAppAppIdUpdateStatusUsingPut, + onSuccess(data: unknown) { + onSuccess?.(data); + }, + onError(error) { + onError?.(error); + }, + }); + + return response; +} + +/** GetImagePreSignedUrl 获取上传预签名地址 GET /llmops/v1/api/app/image */ +export function v1ApiAppImageUsingGetQueryOptions(options: { + options?: { [key: string]: unknown }; +}) { + return queryOptions({ + queryFn: async ({ queryKey }) => { + return apis.v1ApiAppImageUsingGet(queryKey[1] as typeof options); + }, + queryKey: ['v1ApiAppImageUsingGet', options], + }); +} + +/** ListApp 查询 app 列表 GET /llmops/v1/api/app/list */ +export function v1ApiAppListUsingGetQueryOptions(options: { + options?: { [key: string]: unknown }; +}) { + return queryOptions({ + queryFn: async ({ queryKey }) => { + return apis.v1ApiAppListUsingGet(queryKey[1] as typeof options); + }, + queryKey: ['v1ApiAppListUsingGet', options], + }); +} + +/** ListAppPick 查询精选 app 列表 GET /llmops/v1/api/app/list-pick */ +export function v1ApiAppListPickUsingGetQueryOptions(options: { + options?: { [key: string]: unknown }; +}) { + return queryOptions({ + queryFn: async ({ queryKey }) => { + return apis.v1ApiAppListPickUsingGet(queryKey[1] as typeof options); + }, + queryKey: ['v1ApiAppListPickUsingGet', options], + }); +} + +/** ListAppByUser 查询用户关联的 app 列表 GET /llmops/v1/api/app/list-private */ +export function v1ApiAppListPrivateUsingGetQueryOptions(options: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v1ApiAppListPrivateUsingGetParams; + options?: { [key: string]: unknown }; +}) { + return queryOptions({ + queryFn: async ({ queryKey }) => { + return apis.v1ApiAppListPrivateUsingGet(queryKey[1] as typeof options); + }, + queryKey: ['v1ApiAppListPrivateUsingGet', options], + }); +} + +/** ListAppPublic 查询公共 app 列表 GET /llmops/v1/api/app/list-public */ +export function v1ApiAppListPublicUsingGetQueryOptions(options: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v1ApiAppListPublicUsingGetParams; + options?: { [key: string]: unknown }; +}) { + return queryOptions({ + queryFn: async ({ queryKey }) => { + return apis.v1ApiAppListPublicUsingGet(queryKey[1] as typeof options); + }, + queryKey: ['v1ApiAppListPublicUsingGet', options], + }); +} +/* eslint-disable */ +// @ts-ignore +import { request } from 'axios'; + +import * as API from './types'; + +/** GetAppDatasetConfigsList 查询应用知识库查询配置 GET /llmops/v1/api/app/${param0}/dataset-configs */ +export async function v1ApiAppAppIdDatasetConfigsUsingGet({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v1ApiAppAppIdDatasetConfigsUsingGetParams; + options?: { [key: string]: unknown }; +}) { + const { appID: param0, ...queryParams } = params; + + return request( + `/llmops/v1/api/app/${param0}/dataset-configs`, + { + method: 'GET', + params: { ...queryParams }, + ...(options || {}), + } + ); +} + +/** UpdateAppDatasetConfigs 更新应用知识库查询配置 PUT /llmops/v1/api/app/${param0}/dataset-configs */ +export async function v1ApiAppAppIdDatasetConfigsUsingPut({ + params, + body, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v1ApiAppAppIdDatasetConfigsUsingPutParams; + body: API.AppDatasetConfigs; + options?: { [key: string]: unknown }; +}) { + const { appID: param0, ...queryParams } = params; + + return request(`/llmops/v1/api/app/${param0}/dataset-configs`, { + method: 'PUT', + params: { ...queryParams }, + data: body, + ...(options || {}), + }); +} + +/** CreateAppDatasetConfigs 创建应用知识库查询配置 POST /llmops/v1/api/app/${param0}/dataset-configs */ +export async function v1ApiAppAppIdDatasetConfigsUsingPost({ + params, + body, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v1ApiAppAppIdDatasetConfigsUsingPostParams; + body: API.AppDatasetConfigs; + options?: { [key: string]: unknown }; +}) { + const { appID: param0, ...queryParams } = params; + + return request(`/llmops/v1/api/app/${param0}/dataset-configs`, { + method: 'POST', + params: { ...queryParams }, + data: body, + ...(options || {}), + }); +} + +/** DeleteAppDatasetConfigs 删除应用知识库查询配置 DELETE /llmops/v1/api/app/${param0}/dataset-configs */ +export async function v1ApiAppAppIdDatasetConfigsUsingDelete({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v1ApiAppAppIdDatasetConfigsUsingDeleteParams; + options?: { [key: string]: unknown }; +}) { + const { appID: param0, ...queryParams } = params; + + return request(`/llmops/v1/api/app/${param0}/dataset-configs`, { + method: 'DELETE', + params: { + ...queryParams, + }, + ...(options || {}), + }); +} +/* eslint-disable */ +// @ts-ignore +import { queryOptions, useMutation } from '@tanstack/vue-query'; +import type { DefaultError } from '@tanstack/vue-query'; +import { request } from 'axios'; + +import * as apis from './appDatasetConfigs'; +import * as API from './types'; + +/** GetAppDatasetConfigsList 查询应用知识库查询配置 GET /llmops/v1/api/app/${param0}/dataset-configs */ +export function v1ApiAppAppIdDatasetConfigsUsingGetQueryOptions(options: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v1ApiAppAppIdDatasetConfigsUsingGetParams; + options?: { [key: string]: unknown }; +}) { + return queryOptions({ + queryFn: async ({ queryKey }) => { + return apis.v1ApiAppAppIdDatasetConfigsUsingGet( + queryKey[1] as typeof options + ); + }, + queryKey: ['v1ApiAppAppIdDatasetConfigsUsingGet', options], + }); +} + +/** UpdateAppDatasetConfigs 更新应用知识库查询配置 PUT /llmops/v1/api/app/${param0}/dataset-configs */ +export function useV1ApiAppAppIdDatasetConfigsUsingPutMutation(options?: { + onSuccess?: (value?: unknown) => void; + onError?: (error?: DefaultError) => void; +}) { + const { onSuccess, onError } = options || {}; + + const response = useMutation({ + mutationFn: apis.v1ApiAppAppIdDatasetConfigsUsingPut, + onSuccess(data: unknown) { + onSuccess?.(data); + }, + onError(error) { + onError?.(error); + }, + }); + + return response; +} + +/** CreateAppDatasetConfigs 创建应用知识库查询配置 POST /llmops/v1/api/app/${param0}/dataset-configs */ +export function useV1ApiAppAppIdDatasetConfigsUsingPostMutation(options?: { + onSuccess?: (value?: unknown) => void; + onError?: (error?: DefaultError) => void; +}) { + const { onSuccess, onError } = options || {}; + + const response = useMutation({ + mutationFn: apis.v1ApiAppAppIdDatasetConfigsUsingPost, + onSuccess(data: unknown) { + onSuccess?.(data); + }, + onError(error) { + onError?.(error); + }, + }); + + return response; +} + +/** DeleteAppDatasetConfigs 删除应用知识库查询配置 DELETE /llmops/v1/api/app/${param0}/dataset-configs */ +export function useV1ApiAppAppIdDatasetConfigsUsingDeleteMutation(options?: { + onSuccess?: (value?: unknown) => void; + onError?: (error?: DefaultError) => void; +}) { + const { onSuccess, onError } = options || {}; + + const response = useMutation({ + mutationFn: apis.v1ApiAppAppIdDatasetConfigsUsingDelete, + onSuccess(data: unknown) { + onSuccess?.(data); + }, + onError(error) { + onError?.(error); + }, + }); + + return response; +} +/* eslint-disable */ +// @ts-ignore +import { request } from 'axios'; + +import * as API from './types'; + +/** ListMember app下的用户列表 GET /llmops/v1/api/app/${param0}/member */ +export async function v1ApiAppAppIdMemberUsingGet({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v1ApiAppAppIdMemberUsingGetParams; + options?: { [key: string]: unknown }; +}) { + const { appID: param0, ...queryParams } = params; + + return request(`/llmops/v1/api/app/${param0}/member`, { + method: 'GET', + params: { + ...queryParams, + }, + ...(options || {}), + }); +} + +/** AddMember 增加app用户 POST /llmops/v1/api/app/${param0}/member */ +export async function v1ApiAppAppIdMemberUsingPost({ + params, + body, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v1ApiAppAppIdMemberUsingPostParams; + body: API.MemberBody; + options?: { [key: string]: unknown }; +}) { + const { appID: param0, ...queryParams } = params; + + return request(`/llmops/v1/api/app/${param0}/member`, { + method: 'POST', + params: { ...queryParams }, + data: body, + ...(options || {}), + }); +} + +/** DeleteMember 删除app用户 DELETE /llmops/v1/api/app/${param0}/member */ +export async function v1ApiAppAppIdMemberUsingDelete({ + params, + body, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v1ApiAppAppIdMemberUsingDeleteParams; + body: API.DeleteMemberBody; + options?: { [key: string]: unknown }; +}) { + const { appID: param0, ...queryParams } = params; + + return request(`/llmops/v1/api/app/${param0}/member`, { + method: 'DELETE', + params: { ...queryParams }, + data: body, + ...(options || {}), + }); +} + +/** UpdateMemberRole 更新app用户角色 PUT /llmops/v1/api/app/${param0}/member-role */ +export async function v1ApiAppAppIdMemberRoleUsingPut({ + params, + body, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v1ApiAppAppIdMemberRoleUsingPutParams; + body: API.MemberBody; + options?: { [key: string]: unknown }; +}) { + const { appID: param0, ...queryParams } = params; + + return request(`/llmops/v1/api/app/${param0}/member-role`, { + method: 'PUT', + params: { ...queryParams }, + data: body, + ...(options || {}), + }); +} +/* eslint-disable */ +// @ts-ignore +import { queryOptions, useMutation } from '@tanstack/vue-query'; +import type { DefaultError } from '@tanstack/vue-query'; +import { request } from 'axios'; + +import * as apis from './appMember'; +import * as API from './types'; + +/** ListMember app下的用户列表 GET /llmops/v1/api/app/${param0}/member */ +export function v1ApiAppAppIdMemberUsingGetQueryOptions(options: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v1ApiAppAppIdMemberUsingGetParams; + options?: { [key: string]: unknown }; +}) { + return queryOptions({ + queryFn: async ({ queryKey }) => { + return apis.v1ApiAppAppIdMemberUsingGet(queryKey[1] as typeof options); + }, + queryKey: ['v1ApiAppAppIdMemberUsingGet', options], + }); +} + +/** AddMember 增加app用户 POST /llmops/v1/api/app/${param0}/member */ +export function useV1ApiAppAppIdMemberUsingPostMutation(options?: { + onSuccess?: (value?: API.EmptyObject) => void; + onError?: (error?: DefaultError) => void; +}) { + const { onSuccess, onError } = options || {}; + + const response = useMutation({ + mutationFn: apis.v1ApiAppAppIdMemberUsingPost, + onSuccess(data: API.EmptyObject) { + onSuccess?.(data); + }, + onError(error) { + onError?.(error); + }, + }); + + return response; +} + +/** DeleteMember 删除app用户 DELETE /llmops/v1/api/app/${param0}/member */ +export function useV1ApiAppAppIdMemberUsingDeleteMutation(options?: { + onSuccess?: (value?: API.EmptyObject) => void; + onError?: (error?: DefaultError) => void; +}) { + const { onSuccess, onError } = options || {}; + + const response = useMutation({ + mutationFn: apis.v1ApiAppAppIdMemberUsingDelete, + onSuccess(data: API.EmptyObject) { + onSuccess?.(data); + }, + onError(error) { + onError?.(error); + }, + }); + + return response; +} + +/** UpdateMemberRole 更新app用户角色 PUT /llmops/v1/api/app/${param0}/member-role */ +export function useV1ApiAppAppIdMemberRoleUsingPutMutation(options?: { + onSuccess?: (value?: API.EmptyObject) => void; + onError?: (error?: DefaultError) => void; +}) { + const { onSuccess, onError } = options || {}; + + const response = useMutation({ + mutationFn: apis.v1ApiAppAppIdMemberRoleUsingPut, + onSuccess(data: API.EmptyObject) { + onSuccess?.(data); + }, + onError(error) { + onError?.(error); + }, + }); + + return response; +} +/* eslint-disable */ +// @ts-ignore +import { request } from 'axios'; + +import * as API from './types'; + +/** UpdateModelConfigs 更新 app model configs PUT /llmops/v1/api/app/${param0}/model-configs */ +export async function v1ApiAppAppIdModelConfigsUsingPut({ + params, + body, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v1ApiAppAppIdModelConfigsUsingPutParams; + body: API.AppModelConfigs; + options?: { [key: string]: unknown }; +}) { + const { appID: param0, ...queryParams } = params; + + return request(`/llmops/v1/api/app/${param0}/model-configs`, { + method: 'PUT', + params: { ...queryParams }, + data: body, + ...(options || {}), + }); +} + +/** CreateOrUpdateModelConfigs 创建 app model configs POST /llmops/v1/api/app/${param0}/model-configs */ +export async function v1ApiAppAppIdModelConfigsUsingPost({ + params, + body, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v1ApiAppAppIdModelConfigsUsingPostParams; + body: API.AppModelConfigs; + options?: { [key: string]: unknown }; +}) { + const { appID: param0, ...queryParams } = params; + + return request(`/llmops/v1/api/app/${param0}/model-configs`, { + method: 'POST', + params: { ...queryParams }, + data: body, + ...(options || {}), + }); +} + +/** CreateOrUpdateModelConfigPromptPrefix 创建或修改角色和背景以及推荐问题开关 POST /llmops/v1/api/app/${param0}/model-prompt */ +export async function v1ApiAppAppIdModelPromptUsingPost({ + params, + body, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v1ApiAppAppIdModelPromptUsingPostParams; + body: API.AppModelConfigPromptPrefix; + options?: { [key: string]: unknown }; +}) { + const { appID: param0, ...queryParams } = params; + + return request(`/llmops/v1/api/app/${param0}/model-prompt`, { + method: 'POST', + params: { ...queryParams }, + data: body, + ...(options || {}), + }); +} + +/** GetPluginList 获取插件列表 PUT /llmops/v1/api/app/${param0}/plugin */ +export async function v1ApiAppAppIdPluginUsingPut({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v1ApiAppAppIdPluginUsingPutParams; + options?: { [key: string]: unknown }; +}) { + const { appID: param0, ...queryParams } = params; + + return request(`/llmops/v1/api/app/${param0}/plugin`, { + method: 'PUT', + params: { ...queryParams }, + ...(options || {}), + }); +} +/* eslint-disable */ +// @ts-ignore +import { queryOptions, useMutation } from '@tanstack/vue-query'; +import type { DefaultError } from '@tanstack/vue-query'; +import { request } from 'axios'; + +import * as apis from './appModelConfigs'; +import * as API from './types'; + +/** UpdateModelConfigs 更新 app model configs PUT /llmops/v1/api/app/${param0}/model-configs */ +export function useV1ApiAppAppIdModelConfigsUsingPutMutation(options?: { + onSuccess?: (value?: unknown) => void; + onError?: (error?: DefaultError) => void; +}) { + const { onSuccess, onError } = options || {}; + + const response = useMutation({ + mutationFn: apis.v1ApiAppAppIdModelConfigsUsingPut, + onSuccess(data: unknown) { + onSuccess?.(data); + }, + onError(error) { + onError?.(error); + }, + }); + + return response; +} + +/** CreateOrUpdateModelConfigs 创建 app model configs POST /llmops/v1/api/app/${param0}/model-configs */ +export function useV1ApiAppAppIdModelConfigsUsingPostMutation(options?: { + onSuccess?: (value?: unknown) => void; + onError?: (error?: DefaultError) => void; +}) { + const { onSuccess, onError } = options || {}; + + const response = useMutation({ + mutationFn: apis.v1ApiAppAppIdModelConfigsUsingPost, + onSuccess(data: unknown) { + onSuccess?.(data); + }, + onError(error) { + onError?.(error); + }, + }); + + return response; +} + +/** CreateOrUpdateModelConfigPromptPrefix 创建或修改角色和背景以及推荐问题开关 POST /llmops/v1/api/app/${param0}/model-prompt */ +export function useV1ApiAppAppIdModelPromptUsingPostMutation(options?: { + onSuccess?: (value?: unknown) => void; + onError?: (error?: DefaultError) => void; +}) { + const { onSuccess, onError } = options || {}; + + const response = useMutation({ + mutationFn: apis.v1ApiAppAppIdModelPromptUsingPost, + onSuccess(data: unknown) { + onSuccess?.(data); + }, + onError(error) { + onError?.(error); + }, + }); + + return response; +} + +/** GetPluginList 获取插件列表 PUT /llmops/v1/api/app/${param0}/plugin */ +export function useV1ApiAppAppIdPluginUsingPutMutation(options?: { + onSuccess?: (value?: unknown) => void; + onError?: (error?: DefaultError) => void; +}) { + const { onSuccess, onError } = options || {}; + + const response = useMutation({ + mutationFn: apis.v1ApiAppAppIdPluginUsingPut, + onSuccess(data: unknown) { + onSuccess?.(data); + }, + onError(error) { + onError?.(error); + }, + }); + + return response; +} +/* eslint-disable */ +// @ts-ignore +import { request } from 'axios'; + +import * as API from './types'; + +/** CreateAppV2 创建 app POST /llmops/v2/api/app */ +export async function v2ApiAppUsingPost({ + body, + options, +}: { + body: API.CreateAppReqV2; + options?: { [key: string]: unknown }; +}) { + return request('/llmops/v2/api/app', { + method: 'POST', + data: body, + ...(options || {}), + }); +} + +/** GetAppDetailsV2 查询 app 详情 GET /llmops/v2/api/app/${param0}/details */ +export async function v2ApiAppAppIdDetailsUsingGet({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v2ApiAppAppIdDetailsUsingGetParams; + options?: { [key: string]: unknown }; +}) { + const { appID: param0, ...queryParams } = params; + + return request(`/llmops/v2/api/app/${param0}/details`, { + method: 'GET', + params: { ...queryParams }, + ...(options || {}), + }); +} + +/** UpdateAppV2 更新 app 信息 POST /llmops/v2/api/app/${param0}/update */ +export async function v2ApiAppAppIdUpdateUsingPost({ + params, + body, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v2ApiAppAppIdUpdateUsingPostParams; + body: API.UpdateAppReqV2; + options?: { [key: string]: unknown }; +}) { + const { appID: param0, ...queryParams } = params; + + return request(`/llmops/v2/api/app/${param0}/update`, { + method: 'POST', + params: { ...queryParams }, + data: body, + ...(options || {}), + }); +} + +/** ListAppV2 查询用户关联的 app 列表 GET /llmops/v2/api/app/list */ +export async function v2ApiAppListUsingGet({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v2ApiAppListUsingGetParams; + options?: { [key: string]: unknown }; +}) { + return request('/llmops/v2/api/app/list', { + method: 'GET', + params: { + ...params, + }, + ...(options || {}), + }); +} + +/** GetApiTokenV2 获取一个 app token GET /llmops/v2/api/app/share/api-token */ +export async function v2ApiAppShareApiTokenUsingGet({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v2ApiAppShareApiTokenUsingGetParams; + options?: { [key: string]: unknown }; +}) { + return request( + '/llmops/v2/api/app/share/api-token', + { + method: 'GET', + params: { + ...params, + }, + ...(options || {}), + } + ); +} +/* eslint-disable */ +// @ts-ignore +import { queryOptions, useMutation } from '@tanstack/vue-query'; +import type { DefaultError } from '@tanstack/vue-query'; +import { request } from 'axios'; + +import * as apis from './appV2'; +import * as API from './types'; + +/** CreateAppV2 创建 app POST /llmops/v2/api/app */ +export function useV2ApiAppUsingPostMutation(options?: { + onSuccess?: (value?: unknown) => void; + onError?: (error?: DefaultError) => void; +}) { + const { onSuccess, onError } = options || {}; + + const response = useMutation({ + mutationFn: apis.v2ApiAppUsingPost, + onSuccess(data: unknown) { + onSuccess?.(data); + }, + onError(error) { + onError?.(error); + }, + }); + + return response; +} + +/** GetAppDetailsV2 查询 app 详情 GET /llmops/v2/api/app/${param0}/details */ +export function v2ApiAppAppIdDetailsUsingGetQueryOptions(options: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v2ApiAppAppIdDetailsUsingGetParams; + options?: { [key: string]: unknown }; +}) { + return queryOptions({ + queryFn: async ({ queryKey }) => { + return apis.v2ApiAppAppIdDetailsUsingGet(queryKey[1] as typeof options); + }, + queryKey: ['v2ApiAppAppIdDetailsUsingGet', options], + }); +} + +/** UpdateAppV2 更新 app 信息 POST /llmops/v2/api/app/${param0}/update */ +export function useV2ApiAppAppIdUpdateUsingPostMutation(options?: { + onSuccess?: (value?: unknown) => void; + onError?: (error?: DefaultError) => void; +}) { + const { onSuccess, onError } = options || {}; + + const response = useMutation({ + mutationFn: apis.v2ApiAppAppIdUpdateUsingPost, + onSuccess(data: unknown) { + onSuccess?.(data); + }, + onError(error) { + onError?.(error); + }, + }); + + return response; +} + +/** ListAppV2 查询用户关联的 app 列表 GET /llmops/v2/api/app/list */ +export function v2ApiAppListUsingGetQueryOptions(options: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v2ApiAppListUsingGetParams; + options?: { [key: string]: unknown }; +}) { + return queryOptions({ + queryFn: async ({ queryKey }) => { + return apis.v2ApiAppListUsingGet(queryKey[1] as typeof options); + }, + queryKey: ['v2ApiAppListUsingGet', options], + }); +} + +/** GetApiTokenV2 获取一个 app token GET /llmops/v2/api/app/share/api-token */ +export function v2ApiAppShareApiTokenUsingGetQueryOptions(options: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v2ApiAppShareApiTokenUsingGetParams; + options?: { [key: string]: unknown }; +}) { + return queryOptions({ + queryFn: async ({ queryKey }) => { + return apis.v2ApiAppShareApiTokenUsingGet(queryKey[1] as typeof options); + }, + queryKey: ['v2ApiAppShareApiTokenUsingGet', options], + }); +} +/* eslint-disable */ +// @ts-ignore +import { request } from 'axios'; + +import * as API from './types'; + +/** ListAttentionApp 应用列表 GET /llmops/v1/api/attention/app/list */ +export async function v1ApiAttentionAppListUsingGet({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v1ApiAttentionAppListUsingGetParams; + options?: { [key: string]: unknown }; +}) { + return request('/llmops/v1/api/attention/app/list', { + method: 'GET', + params: { + ...params, + }, + ...(options || {}), + }); +} + +/** ListAttentionConversations 查询会话列表 POST /llmops/v1/api/attention/conversations */ +export async function v1ApiAttentionConversationsUsingPost({ + body, + options, +}: { + body: API.ListAttentionConversationReq; + options?: { [key: string]: unknown }; +}) { + return request( + '/llmops/v1/api/attention/conversations', + { + method: 'POST', + data: body, + ...(options || {}), + } + ); +} + +/** GetAttentionConversationCount 获取对话数 POST /llmops/v1/api/attention/conversations/count */ +export async function v1ApiAttentionConversationsCountUsingPost({ + body, + options, +}: { + body: API.GetAttentionDataCountReq; + options?: { [key: string]: unknown }; +}) { + return request( + '/llmops/v1/api/attention/conversations/count', + { + method: 'POST', + data: body, + ...(options || {}), + } + ); +} + +/** GetAttentionMessagesCount 获取消息数 POST /llmops/v1/api/attention/messages/count */ +export async function v1ApiAttentionMessagesCountUsingPost({ + body, + options, +}: { + body: API.GetAttentionDataCountReq; + options?: { [key: string]: unknown }; +}) { + return request( + '/llmops/v1/api/attention/messages/count', + { + method: 'POST', + data: body, + ...(options || {}), + } + ); +} + +/** GetAttentionMessagesHistory 获取聊天历史 GET /llmops/v1/api/attention/messages/history */ +export async function v1ApiAttentionMessagesHistoryUsingGet({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v1ApiAttentionMessagesHistoryUsingGetParams; + options?: { [key: string]: unknown }; +}) { + return request( + '/llmops/v1/api/attention/messages/history', + { + method: 'GET', + params: { + ...params, + }, + ...(options || {}), + } + ); +} + +/** CreateAttentionUser 添加特别关注 POST /llmops/v1/api/attention/user */ +export async function v1ApiAttentionUserUsingPost({ + body, + options, +}: { + body: API.CreateAttentionReq; + options?: { [key: string]: unknown }; +}) { + return request('/llmops/v1/api/attention/user', { + method: 'POST', + data: body, + ...(options || {}), + }); +} + +/** ListAllUser 系统全局用户列表 GET /llmops/v1/api/attention/user/all */ +export async function v1ApiAttentionUserAllUsingGet({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v1ApiAttentionUserAllUsingGetParams; + options?: { [key: string]: unknown }; +}) { + return request( + '/llmops/v1/api/attention/user/all', + { + method: 'GET', + params: { + // size has a default value: 10 + size: '10', + + ...params, + }, + ...(options || {}), + } + ); +} + +/** DeleteAttentionUser 取消特别关注 POST /llmops/v1/api/attention/user/cancel */ +export async function v1ApiAttentionUserCancelUsingPost({ + body, + options, +}: { + body: API.DeleteAttentionReq; + options?: { [key: string]: unknown }; +}) { + return request('/llmops/v1/api/attention/user/cancel', { + method: 'POST', + data: body, + ...(options || {}), + }); +} + +/** GetAttentionUserList 查询特别关注列表 POST /llmops/v1/api/attention/user/list */ +export async function v1ApiAttentionUserListUsingPost({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v1ApiAttentionUserListUsingPostParams; + options?: { [key: string]: unknown }; +}) { + return request( + '/llmops/v1/api/attention/user/list', + { + method: 'POST', + params: { + ...params, + }, + ...(options || {}), + } + ); +} +/* eslint-disable */ +// @ts-ignore +import { queryOptions, useMutation } from '@tanstack/vue-query'; +import type { DefaultError } from '@tanstack/vue-query'; +import { request } from 'axios'; + +import * as apis from './attention'; +import * as API from './types'; + +/** ListAttentionApp 应用列表 GET /llmops/v1/api/attention/app/list */ +export function v1ApiAttentionAppListUsingGetQueryOptions(options: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v1ApiAttentionAppListUsingGetParams; + options?: { [key: string]: unknown }; +}) { + return queryOptions({ + queryFn: async ({ queryKey }) => { + return apis.v1ApiAttentionAppListUsingGet(queryKey[1] as typeof options); + }, + queryKey: ['v1ApiAttentionAppListUsingGet', options], + }); +} + +/** ListAttentionConversations 查询会话列表 POST /llmops/v1/api/attention/conversations */ +export function useV1ApiAttentionConversationsUsingPostMutation(options?: { + onSuccess?: (value?: API.ListConversationResp) => void; + onError?: (error?: DefaultError) => void; +}) { + const { onSuccess, onError } = options || {}; + + const response = useMutation({ + mutationFn: apis.v1ApiAttentionConversationsUsingPost, + onSuccess(data: API.ListConversationResp) { + onSuccess?.(data); + }, + onError(error) { + onError?.(error); + }, + }); + + return response; +} + +/** GetAttentionConversationCount 获取对话数 POST /llmops/v1/api/attention/conversations/count */ +export function useV1ApiAttentionConversationsCountUsingPostMutation(options?: { + onSuccess?: (value?: API.AttentionDataCountResp) => void; + onError?: (error?: DefaultError) => void; +}) { + const { onSuccess, onError } = options || {}; + + const response = useMutation({ + mutationFn: apis.v1ApiAttentionConversationsCountUsingPost, + onSuccess(data: API.AttentionDataCountResp) { + onSuccess?.(data); + }, + onError(error) { + onError?.(error); + }, + }); + + return response; +} + +/** GetAttentionMessagesCount 获取消息数 POST /llmops/v1/api/attention/messages/count */ +export function useV1ApiAttentionMessagesCountUsingPostMutation(options?: { + onSuccess?: (value?: API.AttentionDataCountResp[]) => void; + onError?: (error?: DefaultError) => void; +}) { + const { onSuccess, onError } = options || {}; + + const response = useMutation({ + mutationFn: apis.v1ApiAttentionMessagesCountUsingPost, + onSuccess(data: API.AttentionDataCountResp[]) { + onSuccess?.(data); + }, + onError(error) { + onError?.(error); + }, + }); + + return response; +} + +/** GetAttentionMessagesHistory 获取聊天历史 GET /llmops/v1/api/attention/messages/history */ +export function v1ApiAttentionMessagesHistoryUsingGetQueryOptions(options: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v1ApiAttentionMessagesHistoryUsingGetParams; + options?: { [key: string]: unknown }; +}) { + return queryOptions({ + queryFn: async ({ queryKey }) => { + return apis.v1ApiAttentionMessagesHistoryUsingGet( + queryKey[1] as typeof options + ); + }, + queryKey: ['v1ApiAttentionMessagesHistoryUsingGet', options], + }); +} + +/** CreateAttentionUser 添加特别关注 POST /llmops/v1/api/attention/user */ +export function useV1ApiAttentionUserUsingPostMutation(options?: { + onSuccess?: (value?: unknown) => void; + onError?: (error?: DefaultError) => void; +}) { + const { onSuccess, onError } = options || {}; + + const response = useMutation({ + mutationFn: apis.v1ApiAttentionUserUsingPost, + onSuccess(data: unknown) { + onSuccess?.(data); + }, + onError(error) { + onError?.(error); + }, + }); + + return response; +} + +/** ListAllUser 系统全局用户列表 GET /llmops/v1/api/attention/user/all */ +export function v1ApiAttentionUserAllUsingGetQueryOptions(options: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v1ApiAttentionUserAllUsingGetParams; + options?: { [key: string]: unknown }; +}) { + return queryOptions({ + queryFn: async ({ queryKey }) => { + return apis.v1ApiAttentionUserAllUsingGet(queryKey[1] as typeof options); + }, + queryKey: ['v1ApiAttentionUserAllUsingGet', options], + }); +} + +/** DeleteAttentionUser 取消特别关注 POST /llmops/v1/api/attention/user/cancel */ +export function useV1ApiAttentionUserCancelUsingPostMutation(options?: { + onSuccess?: (value?: unknown) => void; + onError?: (error?: DefaultError) => void; +}) { + const { onSuccess, onError } = options || {}; + + const response = useMutation({ + mutationFn: apis.v1ApiAttentionUserCancelUsingPost, + onSuccess(data: unknown) { + onSuccess?.(data); + }, + onError(error) { + onError?.(error); + }, + }); + + return response; +} + +/** GetAttentionUserList 查询特别关注列表 POST /llmops/v1/api/attention/user/list */ +export function useV1ApiAttentionUserListUsingPostMutation(options?: { + onSuccess?: (value?: API.ListAttentionUserResp) => void; + onError?: (error?: DefaultError) => void; +}) { + const { onSuccess, onError } = options || {}; + + const response = useMutation({ + mutationFn: apis.v1ApiAttentionUserListUsingPost, + onSuccess(data: API.ListAttentionUserResp) { + onSuccess?.(data); + }, + onError(error) { + onError?.(error); + }, + }); + + return response; +} +/* eslint-disable */ +// @ts-ignore +import { request } from 'axios'; + +import * as API from './types'; + +/** Authorize 获取code的跳转 GET /llmops/auth/authorize */ +export async function authAuthorizeUsingGet({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.authAuthorizeUsingGetParams; + options?: { [key: string]: unknown }; +}) { + return request('/llmops/auth/authorize', { + method: 'GET', + params: { + ...params, + }, + ...(options || {}), + }); +} +/* eslint-disable */ +// @ts-ignore +import { queryOptions, useMutation } from '@tanstack/vue-query'; +import type { DefaultError } from '@tanstack/vue-query'; +import { request } from 'axios'; + +import * as apis from './authorize'; +import * as API from './types'; + +/** Authorize 获取code的跳转 GET /llmops/auth/authorize */ +export function authAuthorizeUsingGetQueryOptions(options: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.authAuthorizeUsingGetParams; + options?: { [key: string]: unknown }; +}) { + return queryOptions({ + queryFn: async ({ queryKey }) => { + return apis.authAuthorizeUsingGet(queryKey[1] as typeof options); + }, + queryKey: ['authAuthorizeUsingGet', options], + }); +} +/* eslint-disable */ +// @ts-ignore +import { request } from 'axios'; + +import * as API from './types'; + +/** Messages Messages POST /llmops/v1/api/chat-messages */ +export async function v1ApiChatMessagesUsingPost({ + body, + options, +}: { + body: API.Chat; + options?: { [key: string]: unknown }; +}) { + return request('/llmops/v1/api/chat-messages', { + method: 'POST', + headers: { + 'Content-Type': 'application/json', + }, + data: body, + ...(options || {}), + }); +} + +/** WebMessages 分享页的聊天 POST /llmops/v1/api/chat-messages-web */ +export async function v1ApiChatMessagesWebUsingPost({ + body, + options, +}: { + body: API.Chat; + options?: { [key: string]: unknown }; +}) { + return request('/llmops/v1/api/chat-messages-web', { + method: 'POST', + headers: { + 'Content-Type': 'application/json', + }, + data: body, + ...(options || {}), + }); +} + +/** ChatMessage ChatMessage POST /llmops/v1/api/chat-messages/gpt */ +export async function v1ApiChatMessagesGptUsingPost({ + body, + options, +}: { + body: API.ChatMessageReq; + options?: { [key: string]: unknown }; +}) { + return request( + '/llmops/v1/api/chat-messages/gpt', + { + method: 'POST', + headers: { + 'Content-Type': 'application/json', + }, + data: body, + ...(options || {}), + } + ); +} + +/** QuestionRecommend QuestionRecommend POST /llmops/v1/api/chat-messages/question-recommend */ +export async function v1ApiChatMessagesQuestionRecommendUsingPost({ + body, + options, +}: { + body: API.QuestionRecommendReq; + options?: { [key: string]: unknown }; +}) { + return request( + '/llmops/v1/api/chat-messages/question-recommend', + { + method: 'POST', + headers: { + 'Content-Type': 'application/json', + }, + data: body, + ...(options || {}), + } + ); +} + +/** V2Messages 用于微精灵聊天的v2版本 POST /llmops/v2/api/chat-messages */ +export async function v2ApiChatMessagesUsingPost({ + body, + options, +}: { + body: API.Chat; + options?: { [key: string]: unknown }; +}) { + return request('/llmops/v2/api/chat-messages', { + method: 'POST', + headers: { + 'Content-Type': 'application/json', + }, + data: body, + ...(options || {}), + }); +} +/* eslint-disable */ +// @ts-ignore +import { queryOptions, useMutation } from '@tanstack/vue-query'; +import type { DefaultError } from '@tanstack/vue-query'; +import { request } from 'axios'; + +import * as apis from './chat'; +import * as API from './types'; + +/** Messages Messages POST /llmops/v1/api/chat-messages */ +export function useV1ApiChatMessagesUsingPostMutation(options?: { + onSuccess?: (value?: API.ResponseData) => void; + onError?: (error?: DefaultError) => void; +}) { + const { onSuccess, onError } = options || {}; + + const response = useMutation({ + mutationFn: apis.v1ApiChatMessagesUsingPost, + onSuccess(data: API.ResponseData) { + onSuccess?.(data); + }, + onError(error) { + onError?.(error); + }, + }); + + return response; +} + +/** WebMessages 分享页的聊天 POST /llmops/v1/api/chat-messages-web */ +export function useV1ApiChatMessagesWebUsingPostMutation(options?: { + onSuccess?: (value?: API.ResponseData) => void; + onError?: (error?: DefaultError) => void; +}) { + const { onSuccess, onError } = options || {}; + + const response = useMutation({ + mutationFn: apis.v1ApiChatMessagesWebUsingPost, + onSuccess(data: API.ResponseData) { + onSuccess?.(data); + }, + onError(error) { + onError?.(error); + }, + }); + + return response; +} + +/** ChatMessage ChatMessage POST /llmops/v1/api/chat-messages/gpt */ +export function useV1ApiChatMessagesGptUsingPostMutation(options?: { + onSuccess?: (value?: API.ResponseRecommendData) => void; + onError?: (error?: DefaultError) => void; +}) { + const { onSuccess, onError } = options || {}; + + const response = useMutation({ + mutationFn: apis.v1ApiChatMessagesGptUsingPost, + onSuccess(data: API.ResponseRecommendData) { + onSuccess?.(data); + }, + onError(error) { + onError?.(error); + }, + }); + + return response; +} + +/** QuestionRecommend QuestionRecommend POST /llmops/v1/api/chat-messages/question-recommend */ +export function useV1ApiChatMessagesQuestionRecommendUsingPostMutation(options?: { + onSuccess?: (value?: API.RecommendQuestionAndContext) => void; + onError?: (error?: DefaultError) => void; +}) { + const { onSuccess, onError } = options || {}; + + const response = useMutation({ + mutationFn: apis.v1ApiChatMessagesQuestionRecommendUsingPost, + onSuccess(data: API.RecommendQuestionAndContext) { + onSuccess?.(data); + }, + onError(error) { + onError?.(error); + }, + }); + + return response; +} + +/** V2Messages 用于微精灵聊天的v2版本 POST /llmops/v2/api/chat-messages */ +export function useV2ApiChatMessagesUsingPostMutation(options?: { + onSuccess?: (value?: API.ResponseData) => void; + onError?: (error?: DefaultError) => void; +}) { + const { onSuccess, onError } = options || {}; + + const response = useMutation({ + mutationFn: apis.v2ApiChatMessagesUsingPost, + onSuccess(data: API.ResponseData) { + onSuccess?.(data); + }, + onError(error) { + onError?.(error); + }, + }); + + return response; +} +/* eslint-disable */ +// @ts-ignore +import { request } from 'axios'; + +import * as API from './types'; + +/** ConversationList 会话历史 GET /llmops/v1/api/conversations */ +export async function v1ApiConversationsUsingGet({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v1ApiConversationsUsingGetParams; + options?: { [key: string]: unknown }; +}) { + return request('/llmops/v1/api/conversations', { + method: 'GET', + params: { + ...params, + }, + ...(options || {}), + }); +} + +/** DeleteConversation 删除会话 DELETE /llmops/v1/api/conversations */ +export async function v1ApiConversationsUsingDelete({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v1ApiConversationsUsingDeleteParams; + options?: { [key: string]: unknown }; +}) { + return request('/llmops/v1/api/conversations', { + method: 'DELETE', + params: { + ...params, + }, + ...(options || {}), + }); +} +/* eslint-disable */ +// @ts-ignore +import { queryOptions, useMutation } from '@tanstack/vue-query'; +import type { DefaultError } from '@tanstack/vue-query'; +import { request } from 'axios'; + +import * as apis from './conversation'; +import * as API from './types'; + +/** ConversationList 会话历史 GET /llmops/v1/api/conversations */ +export function v1ApiConversationsUsingGetQueryOptions(options: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v1ApiConversationsUsingGetParams; + options?: { [key: string]: unknown }; +}) { + return queryOptions({ + queryFn: async ({ queryKey }) => { + return apis.v1ApiConversationsUsingGet(queryKey[1] as typeof options); + }, + queryKey: ['v1ApiConversationsUsingGet', options], + }); +} + +/** DeleteConversation 删除会话 DELETE /llmops/v1/api/conversations */ +export function useV1ApiConversationsUsingDeleteMutation(options?: { + onSuccess?: (value?: API.DeleteResp) => void; + onError?: (error?: DefaultError) => void; +}) { + const { onSuccess, onError } = options || {}; + + const response = useMutation({ + mutationFn: apis.v1ApiConversationsUsingDelete, + onSuccess(data: API.DeleteResp) { + onSuccess?.(data); + }, + onError(error) { + onError?.(error); + }, + }); + + return response; +} +/* eslint-disable */ +// @ts-ignore +import { request } from 'axios'; + +import * as API from './types'; + +/** CreateFeedbacks CreateFeedbacks POST /llmops/v1/api/feedbacks/${param0} */ +export async function v1ApiFeedbacksMessageIdUsingPost({ + params, + body, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v1ApiFeedbacksMessageIdUsingPostParams; + body: API.FeedbacksReqBody; + options?: { [key: string]: unknown }; +}) { + const { message_id: param0, ...queryParams } = params; + + return request( + `/llmops/v1/api/feedbacks/${param0}`, + { + method: 'POST', + headers: { + 'Content-Type': 'application/json', + }, + params: { ...queryParams }, + data: body, + ...(options || {}), + } + ); +} +/* eslint-disable */ +// @ts-ignore +import { queryOptions, useMutation } from '@tanstack/vue-query'; +import type { DefaultError } from '@tanstack/vue-query'; +import { request } from 'axios'; + +import * as apis from './createFeedbacks'; +import * as API from './types'; + +/** CreateFeedbacks CreateFeedbacks POST /llmops/v1/api/feedbacks/${param0} */ +export function useV1ApiFeedbacksMessageIdUsingPostMutation(options?: { + onSuccess?: (value?: API.CreateFeedbacksResp) => void; + onError?: (error?: DefaultError) => void; +}) { + const { onSuccess, onError } = options || {}; + + const response = useMutation({ + mutationFn: apis.v1ApiFeedbacksMessageIdUsingPost, + onSuccess(data: API.CreateFeedbacksResp) { + onSuccess?.(data); + }, + onError(error) { + onError?.(error); + }, + }); + + return response; +} +/* eslint-disable */ +// @ts-ignore +import { request } from 'axios'; + +import * as API from './types'; + +/** CreateDatasetsJoin 创建 app 数据集关联 POST /llmops/v1/api/app/${param0}/datasets */ +export async function v1ApiAppAppIdDatasetsUsingPost({ + params, + body, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v1ApiAppAppIdDatasetsUsingPostParams; + body: API.V1ApiAppAppIdDatasetsUsingPostBody; + options?: { [key: string]: unknown }; +}) { + const { appID: param0, ...queryParams } = params; + + return request(`/llmops/v1/api/app/${param0}/datasets`, { + method: 'POST', + params: { ...queryParams }, + data: body, + ...(options || {}), + }); +} + +/** DeleteDatasetsJoin 删除 app 数据集关联 DELETE /llmops/v1/api/app/${param0}/datasets */ +export async function v1ApiAppAppIdDatasetsUsingDelete({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v1ApiAppAppIdDatasetsUsingDeleteParams; + options?: { [key: string]: unknown }; +}) { + const { appID: param0, ...queryParams } = params; + + return request(`/llmops/v1/api/app/${param0}/datasets`, { + method: 'DELETE', + params: { + ...queryParams, + }, + ...(options || {}), + }); +} +/* eslint-disable */ +// @ts-ignore +import { queryOptions, useMutation } from '@tanstack/vue-query'; +import type { DefaultError } from '@tanstack/vue-query'; +import { request } from 'axios'; + +import * as apis from './datasetsJoin'; +import * as API from './types'; + +/** CreateDatasetsJoin 创建 app 数据集关联 POST /llmops/v1/api/app/${param0}/datasets */ +export function useV1ApiAppAppIdDatasetsUsingPostMutation(options?: { + onSuccess?: (value?: unknown) => void; + onError?: (error?: DefaultError) => void; +}) { + const { onSuccess, onError } = options || {}; + + const response = useMutation({ + mutationFn: apis.v1ApiAppAppIdDatasetsUsingPost, + onSuccess(data: unknown) { + onSuccess?.(data); + }, + onError(error) { + onError?.(error); + }, + }); + + return response; +} + +/** DeleteDatasetsJoin 删除 app 数据集关联 DELETE /llmops/v1/api/app/${param0}/datasets */ +export function useV1ApiAppAppIdDatasetsUsingDeleteMutation(options?: { + onSuccess?: (value?: API.DeleteResp) => void; + onError?: (error?: DefaultError) => void; +}) { + const { onSuccess, onError } = options || {}; + + const response = useMutation({ + mutationFn: apis.v1ApiAppAppIdDatasetsUsingDelete, + onSuccess(data: API.DeleteResp) { + onSuccess?.(data); + }, + onError(error) { + onError?.(error); + }, + }); + + return response; +} +/* eslint-disable */ +// @ts-ignore +import { request } from 'axios'; + +import * as API from './types'; + +/** GetDatasetsList 数据集列表 GET /llmops/v1/api/app/${param0}/datasets-list */ +export async function v1ApiAppAppIdDatasetsListUsingGet({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v1ApiAppAppIdDatasetsListUsingGetParams; + options?: { [key: string]: unknown }; +}) { + const { appID: param0, ...queryParams } = params; + + return request( + `/llmops/v1/api/app/${param0}/datasets-list`, + { + method: 'GET', + params: { + ...queryParams, + }, + ...(options || {}), + } + ); +} +/* eslint-disable */ +// @ts-ignore +import { queryOptions, useMutation } from '@tanstack/vue-query'; +import type { DefaultError } from '@tanstack/vue-query'; +import { request } from 'axios'; + +import * as apis from './datasetsList'; +import * as API from './types'; + +/** GetDatasetsList 数据集列表 GET /llmops/v1/api/app/${param0}/datasets-list */ +export function v1ApiAppAppIdDatasetsListUsingGetQueryOptions(options: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v1ApiAppAppIdDatasetsListUsingGetParams; + options?: { [key: string]: unknown }; +}) { + return queryOptions({ + queryFn: async ({ queryKey }) => { + return apis.v1ApiAppAppIdDatasetsListUsingGet( + queryKey[1] as typeof options + ); + }, + queryKey: ['v1ApiAppAppIdDatasetsListUsingGet', options], + }); +} +/* eslint-disable */ +// @ts-ignore +import { request } from 'axios'; + +import * as API from './types'; + +/** DeleteFeedbacks DeleteFeedbacks DELETE /llmops/v1/api/feedbacks/${param0} */ +export async function v1ApiFeedbacksMessageIdUsingDelete({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v1ApiFeedbacksMessageIdUsingDeleteParams; + options?: { [key: string]: unknown }; +}) { + const { message_id: param0, ...queryParams } = params; + + return request( + `/llmops/v1/api/feedbacks/${param0}`, + { + method: 'DELETE', + params: { + ...queryParams, + }, + ...(options || {}), + } + ); +} +/* eslint-disable */ +// @ts-ignore +import { queryOptions, useMutation } from '@tanstack/vue-query'; +import type { DefaultError } from '@tanstack/vue-query'; +import { request } from 'axios'; + +import * as apis from './deleteFeedbacks'; +import * as API from './types'; + +/** DeleteFeedbacks DeleteFeedbacks DELETE /llmops/v1/api/feedbacks/${param0} */ +export function useV1ApiFeedbacksMessageIdUsingDeleteMutation(options?: { + onSuccess?: (value?: API.DeleteFeedbacksResp) => void; + onError?: (error?: DefaultError) => void; +}) { + const { onSuccess, onError } = options || {}; + + const response = useMutation({ + mutationFn: apis.v1ApiFeedbacksMessageIdUsingDelete, + onSuccess(data: API.DeleteFeedbacksResp) { + onSuccess?.(data); + }, + onError(error) { + onError?.(error); + }, + }); + + return response; +} +/* eslint-disable */ +// @ts-ignore +import { request } from 'axios'; + +import * as API from './types'; + +/** DeleteKey 为应用添加各种类型机器人appkey DELETE /llmops/v1/api/robot/${param0}/appkey */ +export async function v1ApiRobotWorkspaceIdAppkeyUsingDelete({ + params, + body, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v1ApiRobotWorkspaceIdAppkeyUsingDeleteParams; + body: API.GetAppKeyReq; + options?: { [key: string]: unknown }; +}) { + const { workspaceID: param0, ...queryParams } = params; + + return request(`/llmops/v1/api/robot/${param0}/appkey`, { + method: 'DELETE', + params: { ...queryParams }, + data: body, + ...(options || {}), + }); +} +/* eslint-disable */ +// @ts-ignore +import { queryOptions, useMutation } from '@tanstack/vue-query'; +import type { DefaultError } from '@tanstack/vue-query'; +import { request } from 'axios'; + +import * as apis from './deleteKey'; +import * as API from './types'; + +/** DeleteKey 为应用添加各种类型机器人appkey DELETE /llmops/v1/api/robot/${param0}/appkey */ +export function useV1ApiRobotWorkspaceIdAppkeyUsingDeleteMutation(options?: { + onSuccess?: (value?: unknown) => void; + onError?: (error?: DefaultError) => void; +}) { + const { onSuccess, onError } = options || {}; + + const response = useMutation({ + mutationFn: apis.v1ApiRobotWorkspaceIdAppkeyUsingDelete, + onSuccess(data: unknown) { + onSuccess?.(data); + }, + onError(error) { + onError?.(error); + }, + }); + + return response; +} +/* eslint-disable */ +// @ts-ignore +import * as API from './types'; + +export function displayPermissionEnum(field: API.Permission) { + return { + read_only: '只读权限', + operation: '操作权限', + no_permission: '无权限', + }[field]; +} + +export function displayProviderTypeEnum(field: API.ProviderType) { + return { + openai: 'openai', + spark: 'spark', + wenxin: 'wenxin', + rockai: 'rockai', + }[field]; +} + +export function displayRbacRoleEnum(field: API.RbacRole) { + return { + system_admin: '系统管理员', + system_user: '系统普通用户', + app_admin: 'app超管用户', + app_user: 'app普通用户', + }[field]; +} + +export function displayWorkspaceRoleEnum(field: API.WorkspaceRole) { + return { workspace_admin: '空间超管用户', workspace_user: '空间普通用户' }[ + field + ]; +} +/* eslint-disable */ +// @ts-ignore +import { request } from 'axios'; + +import * as API from './types'; + +/** Exchange 换取token GET /llmops/auth/exchange */ +export async function authExchangeUsingGet({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.authExchangeUsingGetParams; + options?: { [key: string]: unknown }; +}) { + return request('/llmops/auth/exchange', { + method: 'GET', + params: { + ...params, + }, + ...(options || {}), + }); +} +/* eslint-disable */ +// @ts-ignore +import { queryOptions, useMutation } from '@tanstack/vue-query'; +import type { DefaultError } from '@tanstack/vue-query'; +import { request } from 'axios'; + +import * as apis from './exchange'; +import * as API from './types'; + +/** Exchange 换取token GET /llmops/auth/exchange */ +export function authExchangeUsingGetQueryOptions(options: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.authExchangeUsingGetParams; + options?: { [key: string]: unknown }; +}) { + return queryOptions({ + queryFn: async ({ queryKey }) => { + return apis.authExchangeUsingGet(queryKey[1] as typeof options); + }, + queryKey: ['authExchangeUsingGet', options], + }); +} +/* eslint-disable */ +// @ts-ignore +import { request } from 'axios'; + +import * as API from './types'; + +/** Filestream 上传文件 POST /llmops/v1/api/file */ +export async function v1ApiFileUsingPost({ + params, + body, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v1ApiFileUsingPostParams; + body: API.V1ApiFileUsingPostBody; + options?: { [key: string]: unknown }; +}) { + return request('/llmops/v1/api/file', { + method: 'POST', + headers: { + 'Content-Type': 'application/json', + }, + params: { + ...params, + }, + data: body, + ...(options || {}), + }); +} + +/** SpeechToText 语音转文字 POST /llmops/v1/api/speech_to_text */ +export async function v1ApiSpeechToTextUsingPost({ + body, + options, +}: { + body: API.V1ApiSpeechToTextUsingPostBody; + options?: { [key: string]: unknown }; +}) { + return request('/llmops/v1/api/speech_to_text', { + method: 'POST', + headers: { + 'Content-Type': 'application/json', + }, + data: body, + ...(options || {}), + }); +} + +/** TextToSpeech 文字转语音 POST /llmops/v1/api/text_to_speech */ +export async function v1ApiTextToSpeechUsingPost({ + body, + options, +}: { + body: API.TextToSpeechReq; + options?: { [key: string]: unknown }; +}) { + return request('/llmops/v1/api/text_to_speech', { + method: 'POST', + headers: { + 'Content-Type': 'application/json', + }, + data: body, + ...(options || {}), + }); +} + +/** 上传文件V2接口 上传文件V2接口用于向服务器提交文件。 POST /llmops/v2/api/file */ +export async function v2ApiFileUsingPost({ + params, + body, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v2ApiFileUsingPostParams; + body: API.V2ApiFileUsingPostBody; + options?: { [key: string]: unknown }; +}) { + const formData = new FormData(); + + Object.keys(body).forEach((ele) => { + const item = (body as { [key: string]: any })[ele]; + + if (item !== undefined && item !== null) { + if (typeof item === 'object' && !(item instanceof File)) { + if (item instanceof Array) { + item.forEach((f) => formData.append(ele, f || '')); + } else { + formData.append(ele, JSON.stringify(item)); + } + } else { + formData.append(ele, item); + } + } + }); + + return request('/llmops/v2/api/file', { + method: 'POST', + headers: { + 'Content-Type': 'multipart/form-data', + }, + params: { + ...params, + }, + data: formData, + ...(options || {}), + }); +} +/* eslint-disable */ +// @ts-ignore +import { queryOptions, useMutation } from '@tanstack/vue-query'; +import type { DefaultError } from '@tanstack/vue-query'; +import { request } from 'axios'; + +import * as apis from './files'; +import * as API from './types'; + +/** Filestream 上传文件 POST /llmops/v1/api/file */ +export function useV1ApiFileUsingPostMutation(options?: { + onSuccess?: (value?: API.FilestreamResp) => void; + onError?: (error?: DefaultError) => void; +}) { + const { onSuccess, onError } = options || {}; + + const response = useMutation({ + mutationFn: apis.v1ApiFileUsingPost, + onSuccess(data: API.FilestreamResp) { + onSuccess?.(data); + }, + onError(error) { + onError?.(error); + }, + }); + + return response; +} + +/** SpeechToText 语音转文字 POST /llmops/v1/api/speech_to_text */ +export function useV1ApiSpeechToTextUsingPostMutation(options?: { + onSuccess?: (value?: API.SpeechToTextResp) => void; + onError?: (error?: DefaultError) => void; +}) { + const { onSuccess, onError } = options || {}; + + const response = useMutation({ + mutationFn: apis.v1ApiSpeechToTextUsingPost, + onSuccess(data: API.SpeechToTextResp) { + onSuccess?.(data); + }, + onError(error) { + onError?.(error); + }, + }); + + return response; +} + +/** TextToSpeech 文字转语音 POST /llmops/v1/api/text_to_speech */ +export function useV1ApiTextToSpeechUsingPostMutation(options?: { + onSuccess?: (value?: unknown) => void; + onError?: (error?: DefaultError) => void; +}) { + const { onSuccess, onError } = options || {}; + + const response = useMutation({ + mutationFn: apis.v1ApiTextToSpeechUsingPost, + onSuccess(data: unknown) { + onSuccess?.(data); + }, + onError(error) { + onError?.(error); + }, + }); + + return response; +} + +/** 上传文件V2接口 上传文件V2接口用于向服务器提交文件。 POST /llmops/v2/api/file */ +export function useV2ApiFileUsingPostMutation(options?: { + onSuccess?: (value?: API.FilestreamResp) => void; + onError?: (error?: DefaultError) => void; +}) { + const { onSuccess, onError } = options || {}; + + const response = useMutation({ + mutationFn: apis.v2ApiFileUsingPost, + onSuccess(data: API.FilestreamResp) { + onSuccess?.(data); + }, + onError(error) { + onError?.(error); + }, + }); + + return response; +} +/* eslint-disable */ +// @ts-ignore +import { request } from 'axios'; + +import * as API from './types'; + +/** GetAppKey 为应用获取各种类型机器人appkey GET /llmops/v1/api/robot/${param0}/appkey */ +export async function v1ApiRobotWorkspaceIdAppkeyUsingGet({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v1ApiRobotWorkspaceIdAppkeyUsingGetParams; + options?: { [key: string]: unknown }; +}) { + const { workspaceID: param0, ...queryParams } = params; + + return request(`/llmops/v1/api/robot/${param0}/appkey`, { + method: 'GET', + params: { + ...queryParams, + }, + ...(options || {}), + }); +} +/* eslint-disable */ +// @ts-ignore +import { queryOptions, useMutation } from '@tanstack/vue-query'; +import type { DefaultError } from '@tanstack/vue-query'; +import { request } from 'axios'; + +import * as apis from './getAppKey'; +import * as API from './types'; + +/** GetAppKey 为应用获取各种类型机器人appkey GET /llmops/v1/api/robot/${param0}/appkey */ +export function v1ApiRobotWorkspaceIdAppkeyUsingGetQueryOptions(options: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v1ApiRobotWorkspaceIdAppkeyUsingGetParams; + options?: { [key: string]: unknown }; +}) { + return queryOptions({ + queryFn: async ({ queryKey }) => { + return apis.v1ApiRobotWorkspaceIdAppkeyUsingGet( + queryKey[1] as typeof options + ); + }, + queryKey: ['v1ApiRobotWorkspaceIdAppkeyUsingGet', options], + }); +} +/* eslint-disable */ +// @ts-ignore +import { request } from 'axios'; + +import * as API from './types'; + +/** History 会话历史 GET /llmops/v1/api/conversations/${param0}/history */ +export async function v1ApiConversationsConversationIdHistoryUsingGet({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v1ApiConversationsConversationIdHistoryUsingGetParams; + options?: { [key: string]: unknown }; +}) { + const { conversation_id: param0, ...queryParams } = params; + + return request( + `/llmops/v1/api/conversations/${param0}/history`, + { + method: 'GET', + params: { ...queryParams }, + ...(options || {}), + } + ); +} + +/** DeleteHistory 会话历史 DELETE /llmops/v1/api/conversations/${param0}/history */ +export async function v1ApiConversationsConversationIdHistoryUsingDelete({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v1ApiConversationsConversationIdHistoryUsingDeleteParams; + options?: { [key: string]: unknown }; +}) { + const { conversation_id: param0, ...queryParams } = params; + + return request( + `/llmops/v1/api/conversations/${param0}/history`, + { + method: 'DELETE', + params: { + ...queryParams, + }, + ...(options || {}), + } + ); +} + +/** GetMessageCount 用于微精灵获取消息数的v2版本 GET /llmops/v2/api/chat-messages/messagesCount */ +export async function v2ApiChatMessagesMessagesCountUsingGet({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v2ApiChatMessagesMessagesCountUsingGetParams; + options?: { [key: string]: unknown }; +}) { + return request( + '/llmops/v2/api/chat-messages/messagesCount', + { + method: 'GET', + params: { + ...params, + }, + ...(options || {}), + } + ); +} +/* eslint-disable */ +// @ts-ignore +import { queryOptions, useMutation } from '@tanstack/vue-query'; +import type { DefaultError } from '@tanstack/vue-query'; +import { request } from 'axios'; + +import * as apis from './history'; +import * as API from './types'; + +/** History 会话历史 GET /llmops/v1/api/conversations/${param0}/history */ +export function v1ApiConversationsConversationIdHistoryUsingGetQueryOptions(options: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v1ApiConversationsConversationIdHistoryUsingGetParams; + options?: { [key: string]: unknown }; +}) { + return queryOptions({ + queryFn: async ({ queryKey }) => { + return apis.v1ApiConversationsConversationIdHistoryUsingGet( + queryKey[1] as typeof options + ); + }, + queryKey: ['v1ApiConversationsConversationIdHistoryUsingGet', options], + }); +} + +/** DeleteHistory 会话历史 DELETE /llmops/v1/api/conversations/${param0}/history */ +export function useV1ApiConversationsConversationIdHistoryUsingDeleteMutation(options?: { + onSuccess?: (value?: API.DeleteResp) => void; + onError?: (error?: DefaultError) => void; +}) { + const { onSuccess, onError } = options || {}; + + const response = useMutation({ + mutationFn: apis.v1ApiConversationsConversationIdHistoryUsingDelete, + onSuccess(data: API.DeleteResp) { + onSuccess?.(data); + }, + onError(error) { + onError?.(error); + }, + }); + + return response; +} + +/** GetMessageCount 用于微精灵获取消息数的v2版本 GET /llmops/v2/api/chat-messages/messagesCount */ +export function v2ApiChatMessagesMessagesCountUsingGetQueryOptions(options: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v2ApiChatMessagesMessagesCountUsingGetParams; + options?: { [key: string]: unknown }; +}) { + return queryOptions({ + queryFn: async ({ queryKey }) => { + return apis.v2ApiChatMessagesMessagesCountUsingGet( + queryKey[1] as typeof options + ); + }, + queryKey: ['v2ApiChatMessagesMessagesCountUsingGet', options], + }); +} +/* eslint-disable */ +// @ts-ignore +import { request } from 'axios'; + +import * as API from './types'; + +/** GetIamUserId 查询 IAM 用户信息 GET /llmops/v1/api/iamAccount */ +export async function v1ApiIamAccountUsingGet({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v1ApiIamAccountUsingGetParams; + options?: { [key: string]: unknown }; +}) { + return request('/llmops/v1/api/iamAccount', { + method: 'GET', + params: { + ...params, + }, + ...(options || {}), + }); +} +/* eslint-disable */ +// @ts-ignore +import { queryOptions, useMutation } from '@tanstack/vue-query'; +import type { DefaultError } from '@tanstack/vue-query'; +import { request } from 'axios'; + +import * as apis from './iam'; +import * as API from './types'; + +/** GetIamUserId 查询 IAM 用户信息 GET /llmops/v1/api/iamAccount */ +export function v1ApiIamAccountUsingGetQueryOptions(options: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v1ApiIamAccountUsingGetParams; + options?: { [key: string]: unknown }; +}) { + return queryOptions({ + queryFn: async ({ queryKey }) => { + return apis.v1ApiIamAccountUsingGet(queryKey[1] as typeof options); + }, + queryKey: ['v1ApiIamAccountUsingGet', options], + }); +} +/* eslint-disable */ +// @ts-ignore +export * from './types'; +export * from './displayEnumLabel'; + +export * from './authorize'; +export * from './authorize.vuequery'; +export * from './exchange'; +export * from './exchange.vuequery'; +export * from './refreshToken'; +export * from './refreshToken.vuequery'; +export * from './app'; +export * from './app.vuequery'; +export * from './share'; +export * from './share.vuequery'; +export * from './apiToken'; +export * from './apiToken.vuequery'; +export * from './appDatasetConfigs'; +export * from './appDatasetConfigs.vuequery'; +export * from './datasetsJoin'; +export * from './datasetsJoin.vuequery'; +export * from './datasetsList'; +export * from './datasetsList.vuequery'; +export * from './appMember'; +export * from './appMember.vuequery'; +export * from './appModelConfigs'; +export * from './appModelConfigs.vuequery'; +export * from './recommended'; +export * from './recommended.vuequery'; +export * from './attention'; +export * from './attention.vuequery'; +export * from './chat'; +export * from './chat.vuequery'; +export * from './conversation'; +export * from './conversation.vuequery'; +export * from './history'; +export * from './history.vuequery'; +export * from './listFeedbacks'; +export * from './listFeedbacks.vuequery'; +export * from './createFeedbacks'; +export * from './createFeedbacks.vuequery'; +export * from './deleteFeedbacks'; +export * from './deleteFeedbacks.vuequery'; +export * from './files'; +export * from './files.vuequery'; +export * from './iam'; +export * from './iam.vuequery'; +export * from './provider'; +export * from './provider.vuequery'; +export * from './getAppKey'; +export * from './getAppKey.vuequery'; +export * from './addAppKey'; +export * from './addAppKey.vuequery'; +export * from './deleteKey'; +export * from './deleteKey.vuequery'; +export * from './updateAppKeyState'; +export * from './updateAppKeyState.vuequery'; +export * from './user'; +export * from './user.vuequery'; +export * from './appV2'; +export * from './appV2.vuequery'; +export * from './workspaceAppV2'; +export * from './workspaceAppV2.vuequery'; +export * from './workspace'; +export * from './workspace.vuequery'; +export * from './workspaceGroup'; +export * from './workspaceGroup.vuequery'; +/* eslint-disable */ +// @ts-ignore +import { request } from 'axios'; + +import * as API from './types'; + +/** ListFeedbacks ListFeedbacks GET /llmops/v1/api/feedbacks/ */ +export async function v1ApiFeedbacksUsingGet({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v1ApiFeedbacksUsingGetParams; + options?: { [key: string]: unknown }; +}) { + return request('/llmops/v1/api/feedbacks/', { + method: 'GET', + params: { + ...params, + }, + ...(options || {}), + }); +} +/* eslint-disable */ +// @ts-ignore +import { queryOptions, useMutation } from '@tanstack/vue-query'; +import type { DefaultError } from '@tanstack/vue-query'; +import { request } from 'axios'; + +import * as apis from './listFeedbacks'; +import * as API from './types'; + +/** ListFeedbacks ListFeedbacks GET /llmops/v1/api/feedbacks/ */ +export function v1ApiFeedbacksUsingGetQueryOptions(options: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v1ApiFeedbacksUsingGetParams; + options?: { [key: string]: unknown }; +}) { + return queryOptions({ + queryFn: async ({ queryKey }) => { + return apis.v1ApiFeedbacksUsingGet(queryKey[1] as typeof options); + }, + queryKey: ['v1ApiFeedbacksUsingGet', options], + }); +} +/* eslint-disable */ +// @ts-ignore +import { request } from 'axios'; + +import * as API from './types'; + +/** ListProviders 查询 Provider 列表 GET /llmops/v1/api/provider/list */ +export async function v1ApiProviderListUsingGet({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v1ApiProviderListUsingGetParams; + options?: { [key: string]: unknown }; +}) { + return request('/llmops/v1/api/provider/list', { + method: 'GET', + params: { + ...params, + }, + ...(options || {}), + }); +} +/* eslint-disable */ +// @ts-ignore +import { queryOptions, useMutation } from '@tanstack/vue-query'; +import type { DefaultError } from '@tanstack/vue-query'; +import { request } from 'axios'; + +import * as apis from './provider'; +import * as API from './types'; + +/** ListProviders 查询 Provider 列表 GET /llmops/v1/api/provider/list */ +export function v1ApiProviderListUsingGetQueryOptions(options: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v1ApiProviderListUsingGetParams; + options?: { [key: string]: unknown }; +}) { + return queryOptions({ + queryFn: async ({ queryKey }) => { + return apis.v1ApiProviderListUsingGet(queryKey[1] as typeof options); + }, + queryKey: ['v1ApiProviderListUsingGet', options], + }); +} +/* eslint-disable */ +// @ts-ignore +import { request } from 'axios'; + +import * as API from './types'; + +/** ListRecommendedContext 查询推荐内容列表 GET /llmops/v1/api/app/${param0}/recommended/context */ +export async function v1ApiAppAppIdRecommendedContextUsingGet({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v1ApiAppAppIdRecommendedContextUsingGetParams; + options?: { [key: string]: unknown }; +}) { + const { appID: param0, ...queryParams } = params; + + return request( + `/llmops/v1/api/app/${param0}/recommended/context`, + { + method: 'GET', + params: { ...queryParams }, + ...(options || {}), + } + ); +} + +/** CreateOrUpdateRecommendedContext 创建或更新推荐内容列表 POST /llmops/v1/api/app/${param0}/recommended/context */ +export async function v1ApiAppAppIdRecommendedContextUsingPost({ + params, + body, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v1ApiAppAppIdRecommendedContextUsingPostParams; + body: API.AppRecommendedContext; + options?: { [key: string]: unknown }; +}) { + const { appID: param0, ...queryParams } = params; + + return request(`/llmops/v1/api/app/${param0}/recommended/context`, { + method: 'POST', + params: { ...queryParams }, + data: body, + ...(options || {}), + }); +} +/* eslint-disable */ +// @ts-ignore +import { queryOptions, useMutation } from '@tanstack/vue-query'; +import type { DefaultError } from '@tanstack/vue-query'; +import { request } from 'axios'; + +import * as apis from './recommended'; +import * as API from './types'; + +/** ListRecommendedContext 查询推荐内容列表 GET /llmops/v1/api/app/${param0}/recommended/context */ +export function v1ApiAppAppIdRecommendedContextUsingGetQueryOptions(options: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v1ApiAppAppIdRecommendedContextUsingGetParams; + options?: { [key: string]: unknown }; +}) { + return queryOptions({ + queryFn: async ({ queryKey }) => { + return apis.v1ApiAppAppIdRecommendedContextUsingGet( + queryKey[1] as typeof options + ); + }, + queryKey: ['v1ApiAppAppIdRecommendedContextUsingGet', options], + }); +} + +/** CreateOrUpdateRecommendedContext 创建或更新推荐内容列表 POST /llmops/v1/api/app/${param0}/recommended/context */ +export function useV1ApiAppAppIdRecommendedContextUsingPostMutation(options?: { + onSuccess?: (value?: unknown) => void; + onError?: (error?: DefaultError) => void; +}) { + const { onSuccess, onError } = options || {}; + + const response = useMutation({ + mutationFn: apis.v1ApiAppAppIdRecommendedContextUsingPost, + onSuccess(data: unknown) { + onSuccess?.(data); + }, + onError(error) { + onError?.(error); + }, + }); + + return response; +} +/* eslint-disable */ +// @ts-ignore +import { request } from 'axios'; + +import * as API from './types'; + +/** RefreshToken 刷新token POST /llmops/auth/refresh-token */ +export async function authRefreshTokenUsingPost({ + body, + options, +}: { + body: API.RefreshTokenBody; + options?: { [key: string]: unknown }; +}) { + return request('/llmops/auth/refresh-token', { + method: 'POST', + data: body, + ...(options || {}), + }); +} +/* eslint-disable */ +// @ts-ignore +import { queryOptions, useMutation } from '@tanstack/vue-query'; +import type { DefaultError } from '@tanstack/vue-query'; +import { request } from 'axios'; + +import * as apis from './refreshToken'; +import * as API from './types'; + +/** RefreshToken 刷新token POST /llmops/auth/refresh-token */ +export function useAuthRefreshTokenUsingPostMutation(options?: { + onSuccess?: (value?: API.ExchangeTokenRESP) => void; + onError?: (error?: DefaultError) => void; +}) { + const { onSuccess, onError } = options || {}; + + const response = useMutation({ + mutationFn: apis.authRefreshTokenUsingPost, + onSuccess(data: API.ExchangeTokenRESP) { + onSuccess?.(data); + }, + onError(error) { + onError?.(error); + }, + }); + + return response; +} +/* eslint-disable */ +// @ts-ignore +import { request } from 'axios'; + +import * as API from './types'; + +/** H5GetApiToken 获取一个 app token h5版 GET /llmops/v1/api/app/h5/share/api-token */ +export async function v1ApiAppH5ShareApiTokenUsingGet({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v1ApiAppH5ShareApiTokenUsingGetParams; + options?: { [key: string]: unknown }; +}) { + return request( + '/llmops/v1/api/app/h5/share/api-token', + { + method: 'GET', + params: { + ...params, + }, + ...(options || {}), + } + ); +} + +/** GetApiToken 获取一个 app token GET /llmops/v1/api/app/share/api-token */ +export async function v1ApiAppShareApiTokenUsingGet({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v1ApiAppShareApiTokenUsingGetParams; + options?: { [key: string]: unknown }; +}) { + return request( + '/llmops/v1/api/app/share/api-token', + { + method: 'GET', + params: { + ...params, + }, + ...(options || {}), + } + ); +} +/* eslint-disable */ +// @ts-ignore +import { queryOptions, useMutation } from '@tanstack/vue-query'; +import type { DefaultError } from '@tanstack/vue-query'; +import { request } from 'axios'; + +import * as apis from './share'; +import * as API from './types'; + +/** H5GetApiToken 获取一个 app token h5版 GET /llmops/v1/api/app/h5/share/api-token */ +export function v1ApiAppH5ShareApiTokenUsingGetQueryOptions(options: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v1ApiAppH5ShareApiTokenUsingGetParams; + options?: { [key: string]: unknown }; +}) { + return queryOptions({ + queryFn: async ({ queryKey }) => { + return apis.v1ApiAppH5ShareApiTokenUsingGet( + queryKey[1] as typeof options + ); + }, + queryKey: ['v1ApiAppH5ShareApiTokenUsingGet', options], + }); +} + +/** GetApiToken 获取一个 app token GET /llmops/v1/api/app/share/api-token */ +export function v1ApiAppShareApiTokenUsingGetQueryOptions(options: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v1ApiAppShareApiTokenUsingGetParams; + options?: { [key: string]: unknown }; +}) { + return queryOptions({ + queryFn: async ({ queryKey }) => { + return apis.v1ApiAppShareApiTokenUsingGet(queryKey[1] as typeof options); + }, + queryKey: ['v1ApiAppShareApiTokenUsingGet', options], + }); +} +/* eslint-disable */ +// @ts-ignore + +export type AddAppkeyReq = { + appid: string; + appkey: string; + appsecret?: string; + encodingAESKey?: string; + token?: string; + /** wjl,dingding,feishu,wxa,wx */ + type: string; +}; + +export type ApiToken = { + apiTokenID?: string; + appID?: string; + createdAt?: string; + token?: string; + updatedAt?: string; +}; + +export type ApiTokenDataList = { + data?: ApiToken[]; + total?: number; +}; + +export type App = { + appID?: string; + appImage?: number; + appStatus?: string; + /** 应用类型 */ + appType?: number; + createdAt?: string; + description?: string; + groupID?: string; + /** 开场提问引导 */ + guidance?: Map; + name?: string; + operator?: string; + /** 应用优先级 */ + priority?: number; + prologue?: string; + recommendSwitch?: Bool; + /** 是否模版 */ + templateStatus?: string; + updatedAt?: string; + workspaceID?: string; +}; + +export type AppDataset = { + /** 描述 */ + description?: string; + /** llm描述 */ + llmDesc?: string; + /** 知识库名 */ + name?: string; +}; + +export type AppDatasetConfig = { + appDatasetConfigID?: string; + appID?: string; + createdAt?: string; + minScore?: number; + searchSource?: string; + timeoutSecond?: number; + topK?: number; + updatedAt?: string; +}; + +export type AppDatasetConfigs = { + /** 最低分数 */ + minScore?: number; + /** 知识库源,默认 warehouse */ + searchSource?: string; + /** 知识库查询超时时间 */ + timeoutSecond?: number; + /** 知识库条数 */ + topK?: number; +}; + +export type AppDatasets = { + appCount?: number; + author?: string; + datasetID?: string; + datasetName?: string; + docCount?: number; + state?: string; +}; + +export type AppDetail = { + /** 消耗输出token */ + AnswerTokensCount?: number; + appDatasetConfig?: AppDatasetConfig; + /** 数据集Id列表 */ + appDatasets?: AppDatasets[]; + appGroupID?: string; + appID?: string; + /** 应用头像 */ + appImage?: string; + /** 应用名 */ + appName?: string; + /** PrePrompt */ + appPrePrompt?: string; + appPromptPrefix?: AppModelConfigPromptPrefix; + /** 模型 */ + appProvider?: string; + /** AppDatasetSource database2.AppDatasetSourceInfo `json:"appDatasetSource"` */ + appProviderID?: string; + /** 模型名 */ + appProviderName?: string; + /** 推荐内容 */ + appRecommendedContext?: AppRecommendedContext[]; + appStatus?: string; + /** 应用token列表 */ + appToken?: string[]; + configs?: ModelConfigsMap; + /** 会话总数 */ + conversationCount?: number; + createAt?: string; + /** 应用描述 */ + description?: string; + /** 开场提问引导 */ + guidance?: Guidances; + /** H5随机分享路径 */ + h5RandomPath?: string; + historyLimit?: number; + /** 消息总数 */ + messagesCount?: number; + /** PC随机分享路径 */ + pcRandomPath?: string; + /** 开场白 */ + prologue?: string; + /** 消耗输入token */ + queryTokensCount?: number; + switchRecommendedQuestion?: boolean; + templateStatus?: string; + /** 消耗总token */ + totalTokens?: number; + workspaceID?: string; +}; + +export type AppMessagesCount = { + total?: number; +}; + +export type AppModelConfigPromptPrefix = { + background?: string; + role?: string; + switchRecommendedQuestion?: boolean; +}; + +export type AppModelConfigs = { + configs?: ModelConfigsMap; + prePrompt?: string; + providerId?: string; +}; + +export type AppRecommendedContext = { + appID?: string; + appRecommendedContextID?: string; + context?: string; + createdAt?: string; + description?: string; + name?: string; + updatedAt?: string; +}; + +export type AppRecommendedContext2 = { + context?: string; + description?: string; + id?: string; + name?: string; +}; + +export type AppRecommendedContext3 = { + context?: string; + description?: string; + id?: string; + name?: string; +}; + +export type AppRecommendedContextResp = { + questions?: string; + recommendSwitch?: boolean; +}; + +export type AppResp = { + appGroupID?: string; + appGroupName?: string; + appImage?: string; + appStatus?: string; + createAt?: string; + datasetCount?: number; + description?: string; + h5?: string; + id?: string; + name?: string; + pc?: string; + workspaceID?: string; +}; + +export type AppWithPermission = { + appID?: string; + appImage?: number; + appStatus?: string; + /** 应用类型 */ + appType?: number; + createdAt?: string; + description?: string; + groupID?: string; + /** 开场提问引导 */ + guidance?: Map; + isAppAdmin?: boolean; + name?: string; + operator?: string; + /** 应用优先级 */ + priority?: number; + prologue?: string; + recommendSwitch?: Bool; + /** 是否模版 */ + templateStatus?: string; + updatedAt?: string; + workspaceID?: string; +}; + +export type AttentionDataCountResp = { + total?: number; +}; + +export type AttentionUser = { + email?: string; + isAttentionUser?: boolean; + phone?: string; + userID?: string; + userName?: string; +}; + +export type AttentionUserResp = { + email?: string; + lastMessageTime?: string; + phone?: string; + userID?: string; + userName?: string; +}; + +export type authAuthorizeUsingGetParams = { + /** 业务回调地址 */ + redirect_uri: string; + /** 保持请求和回调的状态,授权成功后会回传该参数 */ + state?: string; +}; + +export type authExchangeUsingGetParams = { + /** code */ + code: string; + /** 业务回调地址 */ + redirect_uri: string; +}; + +export type Bool = string; + +export type Chat = { + conversation_id?: string; + inputs?: Record; + isIgnore?: boolean; + query?: string; + response_mode?: string; + user?: string; +}; + +export type ChatMessageReq = { + prompt?: string; + query?: string; +}; + +export type ConversationLogsResp = { + /** 消耗输出token */ + AnswerTokensCount?: number; + appID?: string; + conversationID?: string; + conversationName?: string; + createdAt?: string; + messagesCount?: number; + /** 消耗输入token */ + queryTokensCount?: number; + /** 消耗总token */ + totalTokens?: number; + userID?: string; + userInfo?: User; +}; + +export type ConversationMsg = { + conversationId?: string; + createAt?: string; + name?: string; + userId?: string; +}; + +export type ConversationResp = { + /** 消耗输出token */ + AnswerTokensCount?: number; + appID?: string; + appName?: string; + conversationID?: string; + conversationName?: string; + createdAt?: string; + lastMessagesTime?: string; + messagesCount?: number; + /** 消耗输入token */ + queryTokensCount?: number; + /** 消耗总token */ + totalTokens?: number; + userID?: string; + userInfo?: User; +}; + +export type CopyAppReq = { + appID?: string; + workspaceID?: string; +}; + +export type CreateApiTokenRESP = { + token?: string; +}; + +export type CreateAppReq = { + description?: string; + guidance?: Guidances; + name?: string; + prologue?: string; +}; + +export type CreateAppReqV2 = { + appDescription?: string; + appGroupID?: string; + /** 提示查询 */ + appGuidance?: Guidances; + appImage?: string; + appName?: string; + /** 开场白 */ + appPrologue?: string; + historyLimit?: number; + modelConfigs?: ModelConfigsMap; + prePrompt?: string; + providerId?: string; +}; + +export type CreateAttentionReq = { + followeeUserIDList?: string[]; + iamID?: string; +}; + +export type CreateFeedbacksResp = object; + +export type CreateSharePathRESP = { + path?: string; +}; + +export type Data = { + appkey?: string; + appsecret?: string; + /** 0-未开启,1-开启 */ + state?: number; + url?: string; + wxExtra?: WxExtra; +}; + +export type DatasetData = { + author?: string; + description?: string; + docCount?: number; + document_count?: number; + id?: string; + name?: string; + permission?: string; + state?: string; + uuid?: string; + word_count?: number; +}; + +export type DeleteAttentionReq = { + followeeUserIDList?: string[]; + iamID?: string; +}; + +export type DeleteFeedbacksResp = object; + +export type DeleteMemberBody = { + /** 用户id */ + userID?: string; +}; + +export type DeleteResp = { + msg?: string; +}; + +export type EmptyObject = object; + +export type ErrorResp = { + msg?: string; + type?: Record; +}; + +export type ExchangeTokenRESP = { + /** 访问令牌 */ + access_token?: string; + /** 访问令牌过期时间 */ + expires_in?: string; + /** 刷新令牌过期时间 */ + refresh_expires_in?: string; + /** 刷新令牌 */ + refresh_token?: string; + /** 令牌类型 */ + token_type?: string; +}; + +export type Feedback = { + /** 评论 */ + comment?: string; + conversation_id?: string; + createdAt?: string; + message_id?: string; + /** like/unlike */ + rating?: string; + /** 打分 */ + score?: number; + updatedAt?: string; +}; + +export type FeedbacksReqBody = { + /** 评论 */ + comment?: string; + conversation_id?: string; + /** like/unlike */ + rating?: string; + /** 分数1-10 */ + score?: number; +}; + +export type FilestreamResp = { + conversation_id?: string; +}; + +export type GetApiTokenByRandomPathRESP = { + apiTokenID?: string; + appID?: string; + appName?: string; + createdAt?: string; + recommendedContext?: AppRecommendedContext[]; + switchRecommendedContext?: boolean; + switchRecommendedQuestion?: boolean; + token?: string; + updatedAt?: string; +}; + +export type GetAppKeyReq = { + appid: string; + /** wjl,dingding,feishu,wxa,wx */ + type: string; +}; + +export type GetAttentionDataCountReq = { + appIDList?: string[]; + iamID?: string; + userID?: string; +}; + +export type GetImagePreSignedUrlResp = { + appImage?: string; + preSignedPutUrl?: string; +}; + +export type Guidances = { + items?: string[]; +}; + +export type HistoryInfo = { + /** like/unlike */ + Rating?: string; + answer?: string; + answerToken?: number; + /** 评论 */ + comment?: string; + createAt?: string; + format?: string[]; + messageId?: string; + query?: string; + queryToken?: number; + /** 打分 */ + score?: number; + totalToken?: number; +}; + +export type IAMUserInfo = { + /** 创建时间 */ + createdTime?: string; + /** Cid string `json:"cid"` */ + email?: string; + /** 用户id */ + id?: string; + idpId?: string; + /** 是否iam管理员 */ + isAdmin?: boolean; + isAppAdmin?: boolean; + /** 是否罗克佳华人员 */ + isRkUser?: boolean; + /** 是否超级管理员 */ + isSuperUser?: boolean; + isSystemAdmin?: boolean; + /** Deleted int32 `json:"deleted"` // 逻辑删除 */ + lastTime?: string; + /** 登录名 */ + loginName?: string; + /** 消息类型 */ + msgType?: number; + /** 电话 */ + phone?: string; + /** 罗克佳华用户账号 */ + rkUserCard?: string; + /** 个性签名 */ + sign?: string; + /** 状态:1可用;0未激活;-1禁用 */ + status?: number; + /** 修改时间 */ + updatedTime?: string; + /** 用户类型 */ + useType?: string; + /** 用户名 */ + userName?: string; + wechatAppId?: string; + wechatSwitch?: boolean; + wechatgzhSwitch?: boolean; +}; + +export type ListAllAttentionUser = { + data?: AttentionUser[]; + total?: number; +}; + +export type ListAppDatasetConfigResp = { + data?: AppDatasetConfig[]; + total?: number; +}; + +export type ListAppDatasets = { + Data?: AppDatasets[]; + total?: number; +}; + +export type ListAppResp = { + data?: AppResp[]; + total?: number; +}; + +export type ListAttentionConversationReq = { + appIDList?: string[]; + iamID?: string; + offset?: number; + size?: number; + userID?: string; +}; + +export type ListAttentionUserResp = { + data?: AttentionUserResp[]; + total?: number; +}; + +export type ListConversationLogsResp = { + data?: ConversationLogsResp[]; + total?: number; +}; + +export type ListConversationResp = { + data?: ConversationResp[]; + total?: number; +}; + +export type ListDatasetsResp = { + data?: DatasetData[]; + has_more?: boolean; + offset?: number; + size?: number; + total?: number; +}; + +export type ListFeedbacksResp = { + data?: Feedback[]; + total?: number; +}; + +export type ListMemberRESP = { + data?: MemberWithRoleData[]; + total?: number; +}; + +export type ListProviderResp = { + data?: ProviderResp[]; + total?: number; +}; + +export type ListUserWithAppRESP = { + data?: UserWithAppData[]; + total?: number; +}; + +export type ListWorkspaceGroup = { + data?: WorkspaceGroup[]; +}; + +export type ListWorkspacePermissions = { + data?: WorkspacePermissions[]; + total?: number; +}; + +export type Map = object; + +export type MemberBody = { + /** 角色(system_admin-系统管理员;system_user-系统管普通用户;app_admin-应用管理员;app_user-应用普通用户) */ + role?: RbacRole; + /** 用户id */ + userID?: string; +}; + +export type MemberWithRoleData = { + /** 应用角色 */ + appRole?: RbacRole; + createdAt?: string; + email?: string; + idpID?: string; + /** 是否是app管理员 */ + isAppAdmin?: boolean; + /** 是否是系统管理员 */ + isSystemAdmin?: boolean; + operator?: string; + phone?: string; + /** 角色(系统管理员、系统普通用户) */ + role?: RbacRole; + updatedAt?: string; + /** iam 用户id */ + userID?: string; + userName?: string; +}; + +export type MessagesCountResp = { + /** 请求消耗token */ + messagesCount?: number; + time?: string; +}; + +export type MessagesTokenResp = { + /** 回答消耗token */ + answerToken?: number; + /** 请求消耗token */ + queryToken?: number; + time?: string; + totalToken?: number; +}; + +export type ModelConfigsMap = { + /** 模型(ERNIE-Bot-4;ERNIE-Bot;ERNIE-Bot-turbo;gpt-3.5-turbo-16k;gpt-4-1106-preview) */ + model_type?: string; + /** 通过对已生成的token增加惩罚,减少重复生成的现象。取值范围:[1.0, 2.0] */ + penalty_score?: number; + /** 较高的数值会使输出更加随机,而较低的数值会使其更加集中和确定。默认0.95,范围 (0, 1.0] */ + temperature?: number; + /** tools call */ + tools_call?: boolean; + /** 影响输出文本的多样性,取值越大,生成文本的多样性越强。取值范围 [0, 1.0] */ + top_p?: number; +}; + +export type ModelConfigsMap2 = { + /** 模型(ERNIE-Bot-4;ERNIE-Bot;ERNIE-Bot-turbo;gpt-3.5-turbo-16k;gpt-4-1106-preview) */ + model_type?: string; + /** 通过对已生成的token增加惩罚,减少重复生成的现象。取值范围:[1.0, 2.0] */ + penalty_score?: number; + /** 较高的数值会使输出更加随机,而较低的数值会使其更加集中和确定。默认0.95,范围 (0, 1.0] */ + temperature?: number; + tools_call?: boolean; + /** 影响输出文本的多样性,取值越大,生成文本的多样性越强。取值范围 [0, 1.0] */ + top_p?: number; +}; + +export enum Permission { + 'read_only' = 'read_only', + 'operation' = 'operation', + 'no_permission' = 'no_permission', +} + +export type IPermission = keyof typeof Permission; + +export type ProviderResp = { + /** 名字 */ + name?: string; + providerID?: string; + subType?: string[]; + /** 类型 */ + type?: ProviderType; +}; + +export enum ProviderType { + 'openai' = 'openai', + 'spark' = 'spark', + 'wenxin' = 'wenxin', + 'rockai' = 'rockai', +} + +export type IProviderType = keyof typeof ProviderType; + +export type QueryTokenResp = { + /** 消耗输出token */ + AnswerTokensCount?: number; + /** 消耗输入token */ + queryTokensCount?: number; + /** 消耗总token */ + totalTokens?: number; +}; + +export type QuestionRecommendReq = { + conversation_id?: string; + /** Query string `json:"query"`Answer string `json:"answer"` */ + user?: string; +}; + +export enum RbacRole { + 'system_admin' = 'system_admin', + 'system_user' = 'system_user', + 'app_admin' = 'app_admin', + 'app_user' = 'app_user', +} + +export type IRbacRole = keyof typeof RbacRole; + +export type RecommendQuestionAndContext = { + contexts?: AppRecommendedContext[]; + questions?: string[]; +}; + +export type RefreshTokenBody = { + refreshToken?: string; +}; + +export type ReleaseDiscoverReq = { + alterAppID?: string; + /** 应用类型 */ + appType?: number; + /** 是否作为模版 TRUE:作为模版;FALSE:不作为 */ + templateStatus?: string; +}; + +export type ResponseData = { + answer?: string; + conversation_id?: string; + created_at?: number; + event?: string; + id?: string; + trace_id?: string; +}; + +export type ResponseRecommendData = { + answer?: string; + conversation_id?: string; + created_at?: number; + event?: string; + id?: string; + trace_id?: string; +}; + +export type SpeechToTextResp = { + /** 转化的结果 */ + text?: string; +}; + +export type TextToSpeechReq = { + /** 需要转的文字 */ + text?: string; +}; + +export type UpdateAppGroup = { + appGroupID?: string; +}; + +export type UpdateAppKeyStateReq = { + appid: string; + /** 0-关闭,1-启动 */ + state?: number; + /** wjl,dingding,feishu */ + type: string; +}; + +export type UpdateAppReq = { + appDescription?: string; + appGroupID?: string; + appImage?: string; + appName?: string; +}; + +export type UpdateAppReqV2 = { + appGroupID?: string; + /** 提示查询 */ + appGuidance?: Guidances; + /** 开场白 */ + appPrologue?: string; + /** 推荐内容 */ + appRecommendedContexts?: AppRecommendedContext[]; + historyLimit?: number; + modelConfigs?: ModelConfigsMap; + prePrompt?: string; + providerId?: string; + recommendSwitch?: boolean; +}; + +export type UpdateAppStatusReq = { + /** PUBLIC:公开;PRIVATE:私有 */ + appStatus?: string; +}; + +export type UpdateUserRoleBody = { + /** 角色(system_admin-系统管理员;system_user-系统管普通用户;app_admin-应用管理员;app_user-应用普通用户) */ + role?: RbacRole; + /** 用户id */ + userID?: string; +}; + +export type User = { + createdAt?: string; + email?: string; + idpID?: string; + operator?: string; + phone?: string; + /** 角色(系统管理员、系统普通用户) */ + role?: RbacRole; + updatedAt?: string; + /** iam 用户id */ + userID?: string; + userName?: string; +}; + +export type UserWithAppData = { + appWithPermissionList?: AppWithPermission[]; + createdAt?: string; + email?: string; + idpID?: string; + isSystemAdmin?: boolean; + operator?: string; + phone?: string; + /** 角色(系统管理员、系统普通用户) */ + role?: RbacRole; + updatedAt?: string; + /** iam 用户id */ + userID?: string; + userName?: string; +}; + +export type v1ApiAppAppIdApiTokenUsingGetParams = { + /** 应用id */ + appID: string; + /** 每页大小 */ + size: number; + /** 分页 */ + offset: number; +}; + +export type v1ApiAppAppIdApiTokenUsingPostParams = { + /** 应用id */ + appID: string; +}; + +export type v1ApiAppAppIdDatasetConfigsUsingDeleteParams = { + /** 应用id */ + appID: string; + /** 应用知识库配置id */ + appDatasetConfigID: string; +}; + +export type v1ApiAppAppIdDatasetConfigsUsingGetParams = { + /** 应用id */ + appID: string; +}; + +export type v1ApiAppAppIdDatasetConfigsUsingPostParams = { + /** 应用id */ + appID: string; +}; + +export type v1ApiAppAppIdDatasetConfigsUsingPutParams = { + /** 应用id */ + appID: string; +}; + +export type v1ApiAppAppIdDatasetsListUsingGetParams = { + /** 应用id */ + appID: string; + /** size */ + size?: number; + /** offset */ + offset?: number; +}; + +export type v1ApiAppAppIdDatasetsUsingDeleteParams = { + /** 应用id */ + appID: string; + /** 数据集id */ + datasetID: string; +}; + +export type V1ApiAppAppIdDatasetsUsingPostBody = API.AppDatasets[]; + +export type v1ApiAppAppIdDatasetsUsingPostParams = { + /** 应用id */ + appID: string; +}; + +export type v1ApiAppAppIdDetailsUsingGetParams = { + /** 应用id */ + appID: string; +}; + +export type v1ApiAppAppIdHourlyMessagesUsingGetParams = { + /** 应用id */ + appID: string; + /** 开始时间,秒级时间戳 */ + starTimestamp?: number; + /** 结束时间,秒级时间戳 */ + endTimestamp?: number; +}; + +export type v1ApiAppAppIdHourlyTokenUsingGetParams = { + /** 应用id */ + appID: string; + /** 开始时间,秒级时间戳 */ + starTimestamp?: number; + /** 结束时间,秒级时间戳 */ + endTimestamp?: number; +}; + +export type v1ApiAppAppIdLogsConversationIdMessagesUsingGetParams = { + /** 应用id */ + appID: string; + /** 会话id */ + conversationID: string; +}; + +export type v1ApiAppAppIdLogsUsingGetParams = { + /** 应用id */ + appID: string; + /** 会话id */ + conversationID?: string; + /** 结束时间 */ + endTimestamp?: number; + /** 页数1开始 */ + pageOffset?: number; + /** 每页数量 */ + pageSize?: number; + /** 模型id */ + providerID?: string; + /** 开始时间 */ + starTimestamp?: number; + /** 用户id */ + userID?: string; +}; + +export type v1ApiAppAppIdMemberRoleUsingPutParams = { + /** 应用id */ + appID: string; +}; + +export type v1ApiAppAppIdMemberUsingDeleteParams = { + /** 应用id */ + appID: string; +}; + +export type v1ApiAppAppIdMemberUsingGetParams = { + /** 应用id */ + appID: string; + /** 每页大小 */ + size: number; + /** 分页 */ + offset: number; +}; + +export type v1ApiAppAppIdMemberUsingPostParams = { + /** 应用id */ + appID: string; +}; + +export type v1ApiAppAppIdMessagesUsingGetParams = { + /** 应用id */ + appID: string; + /** 开始时间,秒级时间戳 */ + starTimestamp?: number; + /** 结束时间,秒级时间戳 */ + endTimestamp?: number; +}; + +export type v1ApiAppAppIdModelConfigsUsingPostParams = { + /** 应用id */ + appID: string; +}; + +export type v1ApiAppAppIdModelConfigsUsingPutParams = { + /** 应用id */ + appID: string; +}; + +export type v1ApiAppAppIdModelPromptUsingPostParams = { + /** 应用id */ + appID: string; +}; + +export type v1ApiAppAppIdOpenApiDeleteUsingDeleteParams = { + /** 应用id */ + appID: string; +}; + +export type v1ApiAppAppIdPluginUsingPutParams = { + /** 应用id */ + appID: string; +}; + +export type v1ApiAppAppIdRecommendedContextUsingGetParams = { + /** 应用id */ + appID: string; +}; + +export type v1ApiAppAppIdRecommendedContextUsingPostParams = { + /** 应用id */ + appID: string; +}; + +export type v1ApiAppAppIdShareUsingPutParams = { + /** 应用id */ + appID: string; + /** 是否h5 */ + isH5?: boolean; +}; + +export type v1ApiAppAppIdTokenUsingGetParams = { + /** 应用id */ + appID: string; + /** 开始时间,秒级时间戳 */ + starTimestamp?: number; + /** 结束时间,秒级时间戳 */ + endTimestamp?: number; +}; + +export type v1ApiAppAppIdUpdateStatusUsingPutParams = { + /** 应用id */ + appID: string; +}; + +export type v1ApiAppAppIdUpdateUsingPutParams = { + /** 应用id */ + appID: string; +}; + +export type v1ApiAppH5ShareApiTokenUsingGetParams = { + /** 分享的随机path */ + randomPath: string; +}; + +export type v1ApiAppIdCostUsingPostParams = { + /** 应用id */ + appID: string; + /** 会话id */ + conversationID?: string; + /** 结束时间 */ + endTimestamp?: number; + /** 页数1开始 */ + pageOffset?: number; + /** 每页数量 */ + pageSize?: number; + /** 模型id */ + providerID?: string; + /** 开始时间 */ + starTimestamp?: number; + /** 用户id */ + userID?: string; +}; + +export type v1ApiAppListPrivateUsingGetParams = { + /** 是否只查看会话过的应用 */ + onlyConversations?: boolean; +}; + +export type v1ApiAppListPublicUsingGetParams = { + /** 是否只查看会话过的应用 */ + onlyConversations?: boolean; +}; + +export type v1ApiAppShareApiTokenUsingGetParams = { + /** 分享的随机path */ + randomPath: string; +}; + +export type v1ApiAttentionAppListUsingGetParams = { + /** IAM用户id */ + iamID: string; +}; + +export type v1ApiAttentionMessagesHistoryUsingGetParams = { + /** IAM ID */ + iamID: string; + /** 应用id */ + appID: string; + /** 会话id */ + conversationID: string; +}; + +export type v1ApiAttentionUserAllUsingGetParams = { + /** 登陆用户IAMID */ + iamID?: string; + /** 用户id */ + isAttention?: boolean; + /** 名字或电话,模糊匹配 */ + nameOrPhone?: string; + offset?: number; + /** 电话号码 */ + phone?: string; + size?: number; + /** 用户id */ + userID?: string; + /** 用户名字用于搜索 */ + userName?: string; +}; + +export type v1ApiAttentionUserListUsingPostParams = { + /** IAM ID */ + iamID: string; + /** 默认10 */ + size?: number; + /** 默认0 */ + offset?: number; +}; + +export type v1ApiConversationsConversationIdHistoryUsingDeleteParams = { + /** 会话id */ + conversation_id: string; + /** 聊天信息id */ + message_id: string; +}; + +export type v1ApiConversationsConversationIdHistoryUsingGetParams = { + /** 会话id */ + conversation_id: string; +}; + +export type v1ApiConversationsUsingDeleteParams = { + /** 会话id */ + conversation_id: string; +}; + +export type v1ApiConversationsUsingGetParams = { + /** 用户id,空值不返回 */ + user_id?: string; +}; + +export type v1ApiFeedbacksMessageIdUsingDeleteParams = { + /** 消息id */ + message_id: string; + /** 会话id */ + conversation_id: string; +}; + +export type v1ApiFeedbacksMessageIdUsingPostParams = { + /** 消息id */ + message_id: string; +}; + +export type v1ApiFeedbacksUsingGetParams = { + conversation_ID?: string; + message_ID?: string; + /** 页数1开始 */ + pageOffset?: number; + /** 每页数量 */ + pageSize?: number; +}; + +export type V1ApiFileUsingPostBody = { + /** 文件 */ + file: string; +}; + +export type v1ApiFileUsingPostParams = { + /** 会话id */ + conversation_id?: string; + /** user id */ + user_id?: string; +}; + +export type v1ApiIamAccountUsingGetParams = { + /** openId */ + openId: string; +}; + +export type v1ApiProviderListUsingGetParams = { + /** size */ + size?: number; + /** offset */ + offset?: number; +}; + +export type v1ApiRobotWorkspaceIdAppkeyStateUsingPostParams = { + /** 空间ID */ + workspaceID: string; +}; + +export type v1ApiRobotWorkspaceIdAppkeyUsingDeleteParams = { + /** 空间ID */ + workspaceID: string; +}; + +export type v1ApiRobotWorkspaceIdAppkeyUsingGetParams = { + /** 空间ID */ + workspaceID: string; + appid: string; + /** wjl,dingding,feishu,wxa,wx */ + type: string; +}; + +export type v1ApiRobotWorkspaceIdAppkeyUsingPostParams = { + /** 空间ID */ + workspaceID: string; +}; + +export type V1ApiSpeechToTextUsingPostBody = { + /** 文件 */ + file: string; +}; + +export type v1ApiUserInfoUsingGetParams = { + /** 应用id */ + appID?: string; +}; + +export type v1ApiUserUsingGetParams = { + offset?: number; + /** 电话号码 */ + phone?: string; + size?: number; + /** 用户id */ + userID?: string; + /** 用户名字用于搜索 */ + userName?: string; +}; + +export type v2ApiAppAppIdDetailsUsingGetParams = { + /** 应用id */ + appID: string; +}; + +export type v2ApiAppAppIdUpdateUsingPostParams = { + /** 应用id */ + appID: string; +}; + +export type v2ApiAppListUsingGetParams = { + /** 是否只查看会话过的应用 */ + onlyConversations?: boolean; +}; + +export type v2ApiAppShareApiTokenUsingGetParams = { + /** 分享的随机path */ + randomPath: string; +}; + +export type v2ApiChatMessagesMessagesCountUsingGetParams = { + /** 是否查询人均,默认false */ + isPerPerson?: boolean; + /** 开始时间,秒级时间戳 */ + starTimestamp?: number; + /** 结束时间,秒级时间戳 */ + endTimestamp?: number; +}; + +export type V2ApiFileUsingPostBody = { + /** 要上传的文件 */ + files: unknown[]; +}; + +export type v2ApiFileUsingPostParams = { + /** 会话id */ + conversation_id?: string; + /** user id */ + user_id?: string; +}; + +export type v2ApiWorkspacesDefaultUsingPostParams = { + /** 空间ID */ + workspaceID: string; +}; + +export type v2ApiWorkspacesRecommendedMessageIdDetailsUsingGetParams = { + /** 消息id */ + messageId: string; +}; + +export type V2ApiWorkspacesWorkspaceIdAppAppIdDatasetsJoinUsingPostBody = + API.AppDatasets[]; + +export type v2ApiWorkspacesWorkspaceIdAppAppIdDatasetsJoinUsingPostParams = { + /** 空间ID */ + workspaceID: string; + /** 应用id */ + appID: string; +}; + +export type v2ApiWorkspacesWorkspaceIdAppAppIdDatasetsUsingDeleteParams = { + /** 应用id */ + appID: string; + /** 空间ID */ + workspaceID: string; + /** 数据集id */ + datasetID: string; +}; + +export type v2ApiWorkspacesWorkspaceIdAppAppIdDetailsUsingGetParams = { + /** 空间ID */ + workspaceID: string; + /** 应用id */ + appID: string; +}; + +export type v2ApiWorkspacesWorkspaceIdAppAppIdHourlyMessagesUsingGetParams = { + /** 空间ID */ + workspaceID: string; + /** 应用id */ + appID: string; + /** 开始时间,秒级时间戳 */ + starTimestamp?: number; + /** 结束时间,秒级时间戳 */ + endTimestamp?: number; +}; + +export type v2ApiWorkspacesWorkspaceIdAppAppIdHourlyTokenUsingGetParams = { + /** 空间ID */ + workspaceID: string; + /** 应用id */ + appID: string; + /** 开始时间,秒级时间戳 */ + starTimestamp?: number; + /** 结束时间,秒级时间戳 */ + endTimestamp?: number; +}; + +export type v2ApiWorkspacesWorkspaceIdAppAppIdLogsUsingGetParams = { + /** 应用id */ + appID: string; + /** 空间ID */ + workspaceID: string; + /** 会话id */ + conversationID?: string; + /** 结束时间 */ + endTimestamp?: number; + /** 页数1开始 */ + pageOffset?: number; + /** 每页数量 */ + pageSize?: number; + /** 模型id */ + providerID?: string; + /** 开始时间 */ + starTimestamp?: number; + /** 用户id */ + userID?: string; +}; + +export type v2ApiWorkspacesWorkspaceIdAppAppIdMessagesUsingGetParams = { + /** 空间ID */ + workspaceID: string; + /** 应用id */ + appID: string; + /** 开始时间,秒级时间戳 */ + starTimestamp?: number; + /** 结束时间,秒级时间戳 */ + endTimestamp?: number; +}; + +export type v2ApiWorkspacesWorkspaceIdAppAppIdModelConfigsUsingPutParams = { + /** 应用id */ + appID: string; + /** 空间ID */ + workspaceID: string; +}; + +export type v2ApiWorkspacesWorkspaceIdAppAppIdPluginUsingGetParams = { + /** 应用id */ + appID: string; + /** 空间ID */ + workspaceID: string; +}; + +export type v2ApiWorkspacesWorkspaceIdAppAppIdTokenUsingGetParams = { + /** 应用id */ + appID: string; + /** 开始时间,秒级时间戳 */ + starTimestamp?: number; + /** 结束时间,秒级时间戳 */ + endTimestamp?: number; +}; + +export type v2ApiWorkspacesWorkspaceIdAppAppIdUpdateStatusUsingPutParams = { + /** 空间ID */ + workspaceID: string; + /** 应用id */ + appID: string; +}; + +export type v2ApiWorkspacesWorkspaceIdAppAppIdUsingPostParams = { + /** 空间ID */ + workspaceID: string; + /** 应用id */ + appID: string; +}; + +export type v2ApiWorkspacesWorkspaceIdAppsAppIdBaseUsingPostParams = { + /** 应用id */ + appID: string; + /** 空间ID */ + workspaceID: string; +}; + +export type v2ApiWorkspacesWorkspaceIdAppsAppIdGroupUsingPostParams = { + /** 应用id */ + appID: string; + /** 空间ID */ + workspaceID: string; +}; + +export type v2ApiWorkspacesWorkspaceIdAppsAppIdUsingDeleteParams = { + /** 应用id */ + appID: string; + /** 空间ID */ + workspaceID: string; +}; + +export type v2ApiWorkspacesWorkspaceIdAppsUsingGetParams = { + /** 空间ID */ + workspaceID: string; + /** 是否只查看会话过的应用 */ + onlyConversations?: boolean; + /** 应用名,模糊查询 */ + appName?: string; +}; + +export type v2ApiWorkspacesWorkspaceIdAppsUsingPostParams = { + /** 空间ID */ + workspaceID: string; +}; + +export type v2ApiWorkspacesWorkspaceIdDatasetsUsingGetParams = { + /** 空间ID */ + workspaceID: string; +}; + +export type v2ApiWorkspacesWorkspaceIdDatasetsUsingPostParams = { + /** 空间ID */ + workspaceID: string; +}; + +export type v2ApiWorkspacesWorkspaceIdGroupsUsingGetParams = { + /** 空间ID */ + workspaceID: string; +}; + +export type v2ApiWorkspacesWorkspaceIdGroupsUsingPostParams = { + /** 空间ID */ + workspaceID: string; +}; + +export type v2ApiWorkspacesWorkspaceIdGroupsWorkspaceGroupIdUsingDeleteParams = + { + /** 空间ID */ + workspaceID: string; + /** 分组ID */ + workspaceGroupID: string; + }; + +export type v2ApiWorkspacesWorkspaceIdGroupsWorkspaceGroupIdUsingPostParams = { + /** 空间ID */ + workspaceID: string; + /** 分组ID */ + workspaceGroupID: string; +}; + +export type v2ApiWorkspacesWorkspaceIdPermissionsUsingGetParams = { + /** 空间ID */ + workspaceID: string; +}; + +export type v2ApiWorkspacesWorkspaceIdUsersUsingGetParams = { + /** 空间ID */ + workspaceID: string; +}; + +export type v2ApiWorkspacesWorkspaceIdUsersUsingPostParams = { + /** 空间ID */ + workspaceID: string; +}; + +export type v2ApiWorkspacesWorkspaceIdUserUserIdUsingDeleteParams = { + /** 空间ID */ + workspaceID: string; + /** userID */ + userID: string; +}; + +export type v2ApiWorkspacesWorkspaceIdUsingDeleteParams = { + /** 空间ID */ + workspaceID: string; +}; + +export type v2ApiWorkspacesWorkspaceIdUsingPostParams = { + /** 空间ID */ + workspaceID: string; +}; + +export type WJLAccount = { + code?: number; + data?: { + avatar?: string; + iamUserId?: string; + nameInTeam?: string; + nickName?: string; + phone?: string; + realNameFlag?: number; + }; + msg?: string; + success?: boolean; +}; + +export type WorkspaceGroup = { + createdAt?: string; + /** 分组名 */ + name?: string; + updatedAt?: string; + workspaceGroupID?: string; + workspaceID?: string; +}; + +export type WorkspaceGroupReq = { + name?: string; +}; + +export type WorkspaceListResp = { + data?: WorkspaceResp[]; + total?: number; +}; + +export type WorkspacePermissions = { + createdAt?: string; + email?: string; + idpID?: string; + operator?: string; + /** 枚举read_only(只读)、operation(操作) */ + permission?: Permission; + phone?: string; + /** 角色(系统管理员、系统普通用户) */ + role?: RbacRole; + updatedAt?: string; + /** iam 用户id */ + userID?: string; + userName?: string; +}; + +export type WorkspaceReq = { + /** 描述 */ + description?: string; + /** 空间名 */ + name?: string; +}; + +export type WorkspaceResp = { + /** 空间描述 */ + description?: string; + /** 空间名 */ + name?: string; + /** 空间ID */ + workspaceID?: string; +}; + +export enum WorkspaceRole { + 'workspace_admin' = 'workspace_admin', + 'workspace_user' = 'workspace_user', +} + +export type IWorkspaceRole = keyof typeof WorkspaceRole; + +export type WorkspaceUser = { + /** workspace_admin空间超管用户;workspace_user空间普通用户 */ + role?: WorkspaceRole; + /** 用户id */ + userID?: string; +}; + +export type WxExtra = { + encodingAESKey?: string; + token?: string; +}; +/* eslint-disable */ +// @ts-ignore +import { request } from 'axios'; + +import * as API from './types'; + +/** UpdateAppKeyState 为应用获取各种类型机器人状态 POST /llmops/v1/api/robot/${param0}/appkey/state */ +export async function v1ApiRobotWorkspaceIdAppkeyStateUsingPost({ + params, + body, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v1ApiRobotWorkspaceIdAppkeyStateUsingPostParams; + body: API.UpdateAppKeyStateReq; + options?: { [key: string]: unknown }; +}) { + const { workspaceID: param0, ...queryParams } = params; + + return request(`/llmops/v1/api/robot/${param0}/appkey/state`, { + method: 'POST', + params: { ...queryParams }, + data: body, + ...(options || {}), + }); +} +/* eslint-disable */ +// @ts-ignore +import { queryOptions, useMutation } from '@tanstack/vue-query'; +import type { DefaultError } from '@tanstack/vue-query'; +import { request } from 'axios'; + +import * as apis from './updateAppKeyState'; +import * as API from './types'; + +/** UpdateAppKeyState 为应用获取各种类型机器人状态 POST /llmops/v1/api/robot/${param0}/appkey/state */ +export function useV1ApiRobotWorkspaceIdAppkeyStateUsingPostMutation(options?: { + onSuccess?: (value?: unknown) => void; + onError?: (error?: DefaultError) => void; +}) { + const { onSuccess, onError } = options || {}; + + const response = useMutation({ + mutationFn: apis.v1ApiRobotWorkspaceIdAppkeyStateUsingPost, + onSuccess(data: unknown) { + onSuccess?.(data); + }, + onError(error) { + onError?.(error); + }, + }); + + return response; +} +/* eslint-disable */ +// @ts-ignore +import { request } from 'axios'; + +import * as API from './types'; + +/** ListUser 系统全局用户列表 GET /llmops/v1/api/user */ +export async function v1ApiUserUsingGet({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v1ApiUserUsingGetParams; + options?: { [key: string]: unknown }; +}) { + return request('/llmops/v1/api/user', { + method: 'GET', + params: { + // size has a default value: 10 + size: '10', + + ...params, + }, + ...(options || {}), + }); +} + +/** GetUserInfoByToken 获取iam用户数据 GET /llmops/v1/api/user/info */ +export async function v1ApiUserInfoUsingGet({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v1ApiUserInfoUsingGetParams; + options?: { [key: string]: unknown }; +}) { + return request('/llmops/v1/api/user/info', { + method: 'GET', + params: { + ...params, + }, + ...(options || {}), + }); +} + +/** UpdateUserRole 更新用户角色 PUT /llmops/v1/api/user/role */ +export async function v1ApiUserRoleUsingPut({ + body, + options, +}: { + body: API.UpdateUserRoleBody; + options?: { [key: string]: unknown }; +}) { + return request('/llmops/v1/api/user/role', { + method: 'PUT', + data: body, + ...(options || {}), + }); +} +/* eslint-disable */ +// @ts-ignore +import { queryOptions, useMutation } from '@tanstack/vue-query'; +import type { DefaultError } from '@tanstack/vue-query'; +import { request } from 'axios'; + +import * as apis from './user'; +import * as API from './types'; + +/** ListUser 系统全局用户列表 GET /llmops/v1/api/user */ +export function v1ApiUserUsingGetQueryOptions(options: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v1ApiUserUsingGetParams; + options?: { [key: string]: unknown }; +}) { + return queryOptions({ + queryFn: async ({ queryKey }) => { + return apis.v1ApiUserUsingGet(queryKey[1] as typeof options); + }, + queryKey: ['v1ApiUserUsingGet', options], + }); +} + +/** GetUserInfoByToken 获取iam用户数据 GET /llmops/v1/api/user/info */ +export function v1ApiUserInfoUsingGetQueryOptions(options: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v1ApiUserInfoUsingGetParams; + options?: { [key: string]: unknown }; +}) { + return queryOptions({ + queryFn: async ({ queryKey }) => { + return apis.v1ApiUserInfoUsingGet(queryKey[1] as typeof options); + }, + queryKey: ['v1ApiUserInfoUsingGet', options], + }); +} + +/** UpdateUserRole 更新用户角色 PUT /llmops/v1/api/user/role */ +export function useV1ApiUserRoleUsingPutMutation(options?: { + onSuccess?: (value?: API.EmptyObject) => void; + onError?: (error?: DefaultError) => void; +}) { + const { onSuccess, onError } = options || {}; + + const response = useMutation({ + mutationFn: apis.v1ApiUserRoleUsingPut, + onSuccess(data: API.EmptyObject) { + onSuccess?.(data); + }, + onError(error) { + onError?.(error); + }, + }); + + return response; +} +/* eslint-disable */ +// @ts-ignore +import { request } from 'axios'; + +import * as API from './types'; + +/** GetWorkspaceList 空间列表 GET /llmops/v2/api/workspaces */ +export async function v2ApiWorkspacesUsingGet({ + options, +}: { + options?: { [key: string]: unknown }; +}) { + return request('/llmops/v2/api/workspaces', { + method: 'GET', + ...(options || {}), + }); +} + +/** CreateWorkspace 创建空间 POST /llmops/v2/api/workspaces */ +export async function v2ApiWorkspacesUsingPost({ + body, + options, +}: { + body: API.WorkspaceReq; + options?: { [key: string]: unknown }; +}) { + return request('/llmops/v2/api/workspaces', { + method: 'POST', + data: body, + ...(options || {}), + }); +} + +/** GetDefaultWorkspace 获取用户默认空间 GET /llmops/v2/api/workspaces-default */ +export async function v2ApiWorkspacesDefaultUsingGet({ + options, +}: { + options?: { [key: string]: unknown }; +}) { + return request('/llmops/v2/api/workspaces-default', { + method: 'GET', + ...(options || {}), + }); +} + +/** 切换默认空间 POST /llmops/v2/api/workspaces-default */ +export async function v2ApiWorkspacesDefaultUsingPost({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v2ApiWorkspacesDefaultUsingPostParams; + options?: { [key: string]: unknown }; +}) { + return request('/llmops/v2/api/workspaces-default', { + method: 'POST', + params: { + ...params, + }, + ...(options || {}), + }); +} + +/** UpdateWorkspace 更新空间 POST /llmops/v2/api/workspaces/${param0} */ +export async function v2ApiWorkspacesWorkspaceIdUsingPost({ + params, + body, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v2ApiWorkspacesWorkspaceIdUsingPostParams; + body: API.WorkspaceReq; + options?: { [key: string]: unknown }; +}) { + const { workspaceID: param0, ...queryParams } = params; + + return request(`/llmops/v2/api/workspaces/${param0}`, { + method: 'POST', + params: { ...queryParams }, + data: body, + ...(options || {}), + }); +} + +/** DeleteWorkspace 删除空间 DELETE /llmops/v2/api/workspaces/${param0} */ +export async function v2ApiWorkspacesWorkspaceIdUsingDelete({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v2ApiWorkspacesWorkspaceIdUsingDeleteParams; + options?: { [key: string]: unknown }; +}) { + const { workspaceID: param0, ...queryParams } = params; + + return request(`/llmops/v2/api/workspaces/${param0}`, { + method: 'DELETE', + params: { ...queryParams }, + ...(options || {}), + }); +} + +/** CreateDatasetsJoinV2 创建 app 数据集关联 POST /llmops/v2/api/workspaces/${param0}/app/${param1}/datasets/join */ +export async function v2ApiWorkspacesWorkspaceIdAppAppIdDatasetsJoinUsingPost({ + params, + body, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v2ApiWorkspacesWorkspaceIdAppAppIdDatasetsJoinUsingPostParams; + body: API.V2ApiWorkspacesWorkspaceIdAppAppIdDatasetsJoinUsingPostBody; + options?: { [key: string]: unknown }; +}) { + const { workspaceID: param0, appID: param1, ...queryParams } = params; + + return request( + `/llmops/v2/api/workspaces/${param0}/app/${param1}/datasets/join`, + { + method: 'POST', + params: { ...queryParams }, + data: body, + ...(options || {}), + } + ); +} + +/** GetWorkspaceDatasetsList 空间下数据集列表 GET /llmops/v2/api/workspaces/${param0}/datasets */ +export async function v2ApiWorkspacesWorkspaceIdDatasetsUsingGet({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v2ApiWorkspacesWorkspaceIdDatasetsUsingGetParams; + options?: { [key: string]: unknown }; +}) { + const { workspaceID: param0, ...queryParams } = params; + + return request( + `/llmops/v2/api/workspaces/${param0}/datasets`, + { + method: 'GET', + params: { ...queryParams }, + ...(options || {}), + } + ); +} + +/** CreateWorkspaceDatasets 创建空间下数据集 POST /llmops/v2/api/workspaces/${param0}/datasets */ +export async function v2ApiWorkspacesWorkspaceIdDatasetsUsingPost({ + params, + body, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v2ApiWorkspacesWorkspaceIdDatasetsUsingPostParams; + body: API.AppDataset; + options?: { [key: string]: unknown }; +}) { + const { workspaceID: param0, ...queryParams } = params; + + return request(`/llmops/v2/api/workspaces/${param0}/datasets`, { + method: 'POST', + params: { ...queryParams }, + data: body, + ...(options || {}), + }); +} + +/** GetWorkspaceUserRole 查询空间用户权限 GET /llmops/v2/api/workspaces/${param0}/permissions */ +export async function v2ApiWorkspacesWorkspaceIdPermissionsUsingGet({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v2ApiWorkspacesWorkspaceIdPermissionsUsingGetParams; + options?: { [key: string]: unknown }; +}) { + const { workspaceID: param0, ...queryParams } = params; + + return request( + `/llmops/v2/api/workspaces/${param0}/permissions`, + { + method: 'GET', + params: { ...queryParams }, + ...(options || {}), + } + ); +} + +/** DeleteWorkspaceUsers 删除空间下用户 DELETE /llmops/v2/api/workspaces/${param0}/user/${param1} */ +export async function v2ApiWorkspacesWorkspaceIdUserUserIdUsingDelete({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v2ApiWorkspacesWorkspaceIdUserUserIdUsingDeleteParams; + options?: { [key: string]: unknown }; +}) { + const { workspaceID: param0, userID: param1, ...queryParams } = params; + + return request( + `/llmops/v2/api/workspaces/${param0}/user/${param1}`, + { + method: 'DELETE', + params: { ...queryParams }, + ...(options || {}), + } + ); +} + +/** GetWorkspaceUsers 查询空间下用户列表 GET /llmops/v2/api/workspaces/${param0}/users */ +export async function v2ApiWorkspacesWorkspaceIdUsersUsingGet({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v2ApiWorkspacesWorkspaceIdUsersUsingGetParams; + options?: { [key: string]: unknown }; +}) { + const { workspaceID: param0, ...queryParams } = params; + + return request( + `/llmops/v2/api/workspaces/${param0}/users`, + { + method: 'GET', + params: { ...queryParams }, + ...(options || {}), + } + ); +} + +/** CreateOrUpdateWorkspaceUsers 添加或更新空间下用户角色 POST /llmops/v2/api/workspaces/${param0}/users */ +export async function v2ApiWorkspacesWorkspaceIdUsersUsingPost({ + params, + body, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v2ApiWorkspacesWorkspaceIdUsersUsingPostParams; + body: API.WorkspaceUser; + options?: { [key: string]: unknown }; +}) { + const { workspaceID: param0, ...queryParams } = params; + + return request(`/llmops/v2/api/workspaces/${param0}/users`, { + method: 'POST', + params: { ...queryParams }, + data: body, + ...(options || {}), + }); +} +/* eslint-disable */ +// @ts-ignore +import { queryOptions, useMutation } from '@tanstack/vue-query'; +import type { DefaultError } from '@tanstack/vue-query'; +import { request } from 'axios'; + +import * as apis from './workspace'; +import * as API from './types'; + +/** GetWorkspaceList 空间列表 GET /llmops/v2/api/workspaces */ +export function v2ApiWorkspacesUsingGetQueryOptions(options: { + options?: { [key: string]: unknown }; +}) { + return queryOptions({ + queryFn: async ({ queryKey }) => { + return apis.v2ApiWorkspacesUsingGet(queryKey[1] as typeof options); + }, + queryKey: ['v2ApiWorkspacesUsingGet', options], + }); +} + +/** CreateWorkspace 创建空间 POST /llmops/v2/api/workspaces */ +export function useV2ApiWorkspacesUsingPostMutation(options?: { + onSuccess?: (value?: unknown) => void; + onError?: (error?: DefaultError) => void; +}) { + const { onSuccess, onError } = options || {}; + + const response = useMutation({ + mutationFn: apis.v2ApiWorkspacesUsingPost, + onSuccess(data: unknown) { + onSuccess?.(data); + }, + onError(error) { + onError?.(error); + }, + }); + + return response; +} + +/** GetDefaultWorkspace 获取用户默认空间 GET /llmops/v2/api/workspaces-default */ +export function v2ApiWorkspacesDefaultUsingGetQueryOptions(options: { + options?: { [key: string]: unknown }; +}) { + return queryOptions({ + queryFn: async ({ queryKey }) => { + return apis.v2ApiWorkspacesDefaultUsingGet(queryKey[1] as typeof options); + }, + queryKey: ['v2ApiWorkspacesDefaultUsingGet', options], + }); +} + +/** 切换默认空间 POST /llmops/v2/api/workspaces-default */ +export function useV2ApiWorkspacesDefaultUsingPostMutation(options?: { + onSuccess?: (value?: unknown) => void; + onError?: (error?: DefaultError) => void; +}) { + const { onSuccess, onError } = options || {}; + + const response = useMutation({ + mutationFn: apis.v2ApiWorkspacesDefaultUsingPost, + onSuccess(data: unknown) { + onSuccess?.(data); + }, + onError(error) { + onError?.(error); + }, + }); + + return response; +} + +/** UpdateWorkspace 更新空间 POST /llmops/v2/api/workspaces/${param0} */ +export function useV2ApiWorkspacesWorkspaceIdUsingPostMutation(options?: { + onSuccess?: (value?: unknown) => void; + onError?: (error?: DefaultError) => void; +}) { + const { onSuccess, onError } = options || {}; + + const response = useMutation({ + mutationFn: apis.v2ApiWorkspacesWorkspaceIdUsingPost, + onSuccess(data: unknown) { + onSuccess?.(data); + }, + onError(error) { + onError?.(error); + }, + }); + + return response; +} + +/** DeleteWorkspace 删除空间 DELETE /llmops/v2/api/workspaces/${param0} */ +export function useV2ApiWorkspacesWorkspaceIdUsingDeleteMutation(options?: { + onSuccess?: (value?: unknown) => void; + onError?: (error?: DefaultError) => void; +}) { + const { onSuccess, onError } = options || {}; + + const response = useMutation({ + mutationFn: apis.v2ApiWorkspacesWorkspaceIdUsingDelete, + onSuccess(data: unknown) { + onSuccess?.(data); + }, + onError(error) { + onError?.(error); + }, + }); + + return response; +} + +/** CreateDatasetsJoinV2 创建 app 数据集关联 POST /llmops/v2/api/workspaces/${param0}/app/${param1}/datasets/join */ +export function useV2ApiWorkspacesWorkspaceIdAppAppIdDatasetsJoinUsingPostMutation(options?: { + onSuccess?: (value?: unknown) => void; + onError?: (error?: DefaultError) => void; +}) { + const { onSuccess, onError } = options || {}; + + const response = useMutation({ + mutationFn: apis.v2ApiWorkspacesWorkspaceIdAppAppIdDatasetsJoinUsingPost, + onSuccess(data: unknown) { + onSuccess?.(data); + }, + onError(error) { + onError?.(error); + }, + }); + + return response; +} + +/** GetWorkspaceDatasetsList 空间下数据集列表 GET /llmops/v2/api/workspaces/${param0}/datasets */ +export function v2ApiWorkspacesWorkspaceIdDatasetsUsingGetQueryOptions(options: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v2ApiWorkspacesWorkspaceIdDatasetsUsingGetParams; + options?: { [key: string]: unknown }; +}) { + return queryOptions({ + queryFn: async ({ queryKey }) => { + return apis.v2ApiWorkspacesWorkspaceIdDatasetsUsingGet( + queryKey[1] as typeof options + ); + }, + queryKey: ['v2ApiWorkspacesWorkspaceIdDatasetsUsingGet', options], + }); +} + +/** CreateWorkspaceDatasets 创建空间下数据集 POST /llmops/v2/api/workspaces/${param0}/datasets */ +export function useV2ApiWorkspacesWorkspaceIdDatasetsUsingPostMutation(options?: { + onSuccess?: (value?: unknown) => void; + onError?: (error?: DefaultError) => void; +}) { + const { onSuccess, onError } = options || {}; + + const response = useMutation({ + mutationFn: apis.v2ApiWorkspacesWorkspaceIdDatasetsUsingPost, + onSuccess(data: unknown) { + onSuccess?.(data); + }, + onError(error) { + onError?.(error); + }, + }); + + return response; +} + +/** GetWorkspaceUserRole 查询空间用户权限 GET /llmops/v2/api/workspaces/${param0}/permissions */ +export function v2ApiWorkspacesWorkspaceIdPermissionsUsingGetQueryOptions(options: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v2ApiWorkspacesWorkspaceIdPermissionsUsingGetParams; + options?: { [key: string]: unknown }; +}) { + return queryOptions({ + queryFn: async ({ queryKey }) => { + return apis.v2ApiWorkspacesWorkspaceIdPermissionsUsingGet( + queryKey[1] as typeof options + ); + }, + queryKey: ['v2ApiWorkspacesWorkspaceIdPermissionsUsingGet', options], + }); +} + +/** DeleteWorkspaceUsers 删除空间下用户 DELETE /llmops/v2/api/workspaces/${param0}/user/${param1} */ +export function useV2ApiWorkspacesWorkspaceIdUserUserIdUsingDeleteMutation(options?: { + onSuccess?: (value?: unknown) => void; + onError?: (error?: DefaultError) => void; +}) { + const { onSuccess, onError } = options || {}; + + const response = useMutation({ + mutationFn: apis.v2ApiWorkspacesWorkspaceIdUserUserIdUsingDelete, + onSuccess(data: unknown) { + onSuccess?.(data); + }, + onError(error) { + onError?.(error); + }, + }); + + return response; +} + +/** GetWorkspaceUsers 查询空间下用户列表 GET /llmops/v2/api/workspaces/${param0}/users */ +export function v2ApiWorkspacesWorkspaceIdUsersUsingGetQueryOptions(options: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v2ApiWorkspacesWorkspaceIdUsersUsingGetParams; + options?: { [key: string]: unknown }; +}) { + return queryOptions({ + queryFn: async ({ queryKey }) => { + return apis.v2ApiWorkspacesWorkspaceIdUsersUsingGet( + queryKey[1] as typeof options + ); + }, + queryKey: ['v2ApiWorkspacesWorkspaceIdUsersUsingGet', options], + }); +} + +/** CreateOrUpdateWorkspaceUsers 添加或更新空间下用户角色 POST /llmops/v2/api/workspaces/${param0}/users */ +export function useV2ApiWorkspacesWorkspaceIdUsersUsingPostMutation(options?: { + onSuccess?: (value?: unknown) => void; + onError?: (error?: DefaultError) => void; +}) { + const { onSuccess, onError } = options || {}; + + const response = useMutation({ + mutationFn: apis.v2ApiWorkspacesWorkspaceIdUsersUsingPost, + onSuccess(data: unknown) { + onSuccess?.(data); + }, + onError(error) { + onError?.(error); + }, + }); + + return response; +} +/* eslint-disable */ +// @ts-ignore +import { request } from 'axios'; + +import * as API from './types'; + +/** CopyApp 复制 app POST /llmops/v2/api/copy_apps */ +export async function v2ApiCopyAppsUsingPost({ + body, + options, +}: { + body: API.CopyAppReq; + options?: { [key: string]: unknown }; +}) { + return request('/llmops/v2/api/copy_apps', { + method: 'POST', + data: body, + ...(options || {}), + }); +} + +/** UpdateAppV2.1 更新 app 信息 POST /llmops/v2/api/workspaces/${param0}/app/${param1} */ +export async function v2ApiWorkspacesWorkspaceIdAppAppIdUsingPost({ + params, + body, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v2ApiWorkspacesWorkspaceIdAppAppIdUsingPostParams; + body: API.UpdateAppReqV2; + options?: { [key: string]: unknown }; +}) { + const { workspaceID: param0, appID: param1, ...queryParams } = params; + + return request(`/llmops/v2/api/workspaces/${param0}/app/${param1}`, { + method: 'POST', + params: { ...queryParams }, + data: body, + ...(options || {}), + }); +} + +/** GetAppDetailsV2.1 查询 app 详情 GET /llmops/v2/api/workspaces/${param0}/app/${param1}/details */ +export async function v2ApiWorkspacesWorkspaceIdAppAppIdDetailsUsingGet({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v2ApiWorkspacesWorkspaceIdAppAppIdDetailsUsingGetParams; + options?: { [key: string]: unknown }; +}) { + const { workspaceID: param0, appID: param1, ...queryParams } = params; + + return request( + `/llmops/v2/api/workspaces/${param0}/app/${param1}/details`, + { + method: 'GET', + params: { ...queryParams }, + ...(options || {}), + } + ); +} + +/** GetSumHourlyMessagesCountV2.1 每小时messages数 GET /llmops/v2/api/workspaces/${param0}/app/${param1}/hourly-messages */ +export async function v2ApiWorkspacesWorkspaceIdAppAppIdHourlyMessagesUsingGet({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v2ApiWorkspacesWorkspaceIdAppAppIdHourlyMessagesUsingGetParams; + options?: { [key: string]: unknown }; +}) { + const { workspaceID: param0, appID: param1, ...queryParams } = params; + + return request( + `/llmops/v2/api/workspaces/${param0}/app/${param1}/hourly-messages`, + { + method: 'GET', + params: { + ...queryParams, + }, + ...(options || {}), + } + ); +} + +/** GetSumHourlyTokenV2.1 每小时token数 GET /llmops/v2/api/workspaces/${param0}/app/${param1}/hourly-token */ +export async function v2ApiWorkspacesWorkspaceIdAppAppIdHourlyTokenUsingGet({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v2ApiWorkspacesWorkspaceIdAppAppIdHourlyTokenUsingGetParams; + options?: { [key: string]: unknown }; +}) { + const { workspaceID: param0, appID: param1, ...queryParams } = params; + + return request( + `/llmops/v2/api/workspaces/${param0}/app/${param1}/hourly-token`, + { + method: 'GET', + params: { + ...queryParams, + }, + ...(options || {}), + } + ); +} + +/** GetSumDailyMessagesCountV2.1 每日messages数 GET /llmops/v2/api/workspaces/${param0}/app/${param1}/messages */ +export async function v2ApiWorkspacesWorkspaceIdAppAppIdMessagesUsingGet({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v2ApiWorkspacesWorkspaceIdAppAppIdMessagesUsingGetParams; + options?: { [key: string]: unknown }; +}) { + const { workspaceID: param0, appID: param1, ...queryParams } = params; + + return request( + `/llmops/v2/api/workspaces/${param0}/app/${param1}/messages`, + { + method: 'GET', + params: { + ...queryParams, + }, + ...(options || {}), + } + ); +} + +/** UpdateAppStatusV2.1 更新 app 状态 PUT /llmops/v2/api/workspaces/${param0}/app/${param1}/update_status */ +export async function v2ApiWorkspacesWorkspaceIdAppAppIdUpdateStatusUsingPut({ + params, + body, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v2ApiWorkspacesWorkspaceIdAppAppIdUpdateStatusUsingPutParams; + body: API.UpdateAppStatusReq; + options?: { [key: string]: unknown }; +}) { + const { workspaceID: param0, appID: param1, ...queryParams } = params; + + return request( + `/llmops/v2/api/workspaces/${param0}/app/${param1}/update_status`, + { + method: 'PUT', + params: { ...queryParams }, + data: body, + ...(options || {}), + } + ); +} + +/** ListAppV2.1 查询用户关联的 app 列表 GET /llmops/v2/api/workspaces/${param0}/apps */ +export async function v2ApiWorkspacesWorkspaceIdAppsUsingGet({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v2ApiWorkspacesWorkspaceIdAppsUsingGetParams; + options?: { [key: string]: unknown }; +}) { + const { workspaceID: param0, ...queryParams } = params; + + return request(`/llmops/v2/api/workspaces/${param0}/apps`, { + method: 'GET', + params: { + ...queryParams, + }, + ...(options || {}), + }); +} + +/** CreateAppV2.1 创建 app POST /llmops/v2/api/workspaces/${param0}/apps */ +export async function v2ApiWorkspacesWorkspaceIdAppsUsingPost({ + params, + body, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v2ApiWorkspacesWorkspaceIdAppsUsingPostParams; + body: API.CreateAppReqV2; + options?: { [key: string]: unknown }; +}) { + const { workspaceID: param0, ...queryParams } = params; + + return request(`/llmops/v2/api/workspaces/${param0}/apps`, { + method: 'POST', + params: { ...queryParams }, + data: body, + ...(options || {}), + }); +} + +/** DeleteDatasetsJoinV2.1 删除 app 数据集关联 DELETE /llmops/v2/api/workspaces/${param1}/app/${param0}/datasets */ +export async function v2ApiWorkspacesWorkspaceIdAppAppIdDatasetsUsingDelete({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v2ApiWorkspacesWorkspaceIdAppAppIdDatasetsUsingDeleteParams; + options?: { [key: string]: unknown }; +}) { + const { appID: param0, workspaceID: param1, ...queryParams } = params; + + return request( + `/llmops/v2/api/workspaces/${param1}/app/${param0}/datasets`, + { + method: 'DELETE', + params: { + ...queryParams, + }, + ...(options || {}), + } + ); +} + +/** GetAppLogsV2.1 查询 app 日志与标注 GET /llmops/v2/api/workspaces/${param1}/app/${param0}/logs */ +export async function v2ApiWorkspacesWorkspaceIdAppAppIdLogsUsingGet({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v2ApiWorkspacesWorkspaceIdAppAppIdLogsUsingGetParams; + options?: { [key: string]: unknown }; +}) { + const { appID: param0, workspaceID: param1, ...queryParams } = params; + + return request( + `/llmops/v2/api/workspaces/${param1}/app/${param0}/logs`, + { + method: 'GET', + params: { + ...queryParams, + }, + ...(options || {}), + } + ); +} + +/** UpdateModelConfigsV2.1 更新 app model configs PUT /llmops/v2/api/workspaces/${param1}/app/${param0}/model-configs */ +export async function v2ApiWorkspacesWorkspaceIdAppAppIdModelConfigsUsingPut({ + params, + body, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v2ApiWorkspacesWorkspaceIdAppAppIdModelConfigsUsingPutParams; + body: API.AppModelConfigs; + options?: { [key: string]: unknown }; +}) { + const { appID: param0, workspaceID: param1, ...queryParams } = params; + + return request( + `/llmops/v2/api/workspaces/${param1}/app/${param0}/model-configs`, + { + method: 'PUT', + params: { ...queryParams }, + data: body, + ...(options || {}), + } + ); +} + +/** GetPluginListV2.1 获取插件列表 GET /llmops/v2/api/workspaces/${param1}/app/${param0}/plugin */ +export async function v2ApiWorkspacesWorkspaceIdAppAppIdPluginUsingGet({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v2ApiWorkspacesWorkspaceIdAppAppIdPluginUsingGetParams; + options?: { [key: string]: unknown }; +}) { + const { appID: param0, workspaceID: param1, ...queryParams } = params; + + return request( + `/llmops/v2/api/workspaces/${param1}/app/${param0}/plugin`, + { + method: 'GET', + params: { ...queryParams }, + ...(options || {}), + } + ); +} + +/** GetSumDailyTokenV2.1 每日token GET /llmops/v2/api/workspaces/${param1}/app/${param0}/token */ +export async function v2ApiWorkspacesWorkspaceIdAppAppIdTokenUsingGet({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v2ApiWorkspacesWorkspaceIdAppAppIdTokenUsingGetParams; + options?: { [key: string]: unknown }; +}) { + const { appID: param0, workspaceID: param1, ...queryParams } = params; + + return request( + `/llmops/v2/api/workspaces/${param1}/app/${param0}/token`, + { + method: 'GET', + params: { + ...queryParams, + }, + ...(options || {}), + } + ); +} + +/** DeleteAppV2.1 删除 app DELETE /llmops/v2/api/workspaces/${param1}/apps/${param0} */ +export async function v2ApiWorkspacesWorkspaceIdAppsAppIdUsingDelete({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v2ApiWorkspacesWorkspaceIdAppsAppIdUsingDeleteParams; + options?: { [key: string]: unknown }; +}) { + const { appID: param0, workspaceID: param1, ...queryParams } = params; + + return request( + `/llmops/v2/api/workspaces/${param1}/apps/${param0}`, + { + method: 'DELETE', + params: { ...queryParams }, + ...(options || {}), + } + ); +} + +/** UpdateAppImage 更新 app名称头像 POST /llmops/v2/api/workspaces/${param1}/apps/${param0}/base */ +export async function v2ApiWorkspacesWorkspaceIdAppsAppIdBaseUsingPost({ + params, + body, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v2ApiWorkspacesWorkspaceIdAppsAppIdBaseUsingPostParams; + body: API.UpdateAppReq; + options?: { [key: string]: unknown }; +}) { + const { appID: param0, workspaceID: param1, ...queryParams } = params; + + return request( + `/llmops/v2/api/workspaces/${param1}/apps/${param0}/base`, + { + method: 'POST', + params: { ...queryParams }, + data: body, + ...(options || {}), + } + ); +} + +/** UpdateAppGroup 更新 app 分组 POST /llmops/v2/api/workspaces/${param1}/apps/${param0}/group */ +export async function v2ApiWorkspacesWorkspaceIdAppsAppIdGroupUsingPost({ + params, + body, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v2ApiWorkspacesWorkspaceIdAppsAppIdGroupUsingPostParams; + body: API.UpdateAppGroup; + options?: { [key: string]: unknown }; +}) { + const { appID: param0, workspaceID: param1, ...queryParams } = params; + + return request( + `/llmops/v2/api/workspaces/${param1}/apps/${param0}/group`, + { + method: 'POST', + params: { ...queryParams }, + data: body, + ...(options || {}), + } + ); +} + +/** GetAppRecommendedContext 获取自定义推荐问题 & 推荐开关 GET /llmops/v2/api/workspaces/recommended/${param0}/details */ +export async function v2ApiWorkspacesRecommendedMessageIdDetailsUsingGet({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v2ApiWorkspacesRecommendedMessageIdDetailsUsingGetParams; + options?: { [key: string]: unknown }; +}) { + const { messageId: param0, ...queryParams } = params; + + return request( + `/llmops/v2/api/workspaces/recommended/${param0}/details`, + { + method: 'GET', + params: { ...queryParams }, + ...(options || {}), + } + ); +} +/* eslint-disable */ +// @ts-ignore +import { queryOptions, useMutation } from '@tanstack/vue-query'; +import type { DefaultError } from '@tanstack/vue-query'; +import { request } from 'axios'; + +import * as apis from './workspaceAppV2'; +import * as API from './types'; + +/** CopyApp 复制 app POST /llmops/v2/api/copy_apps */ +export function useV2ApiCopyAppsUsingPostMutation(options?: { + onSuccess?: (value?: unknown) => void; + onError?: (error?: DefaultError) => void; +}) { + const { onSuccess, onError } = options || {}; + + const response = useMutation({ + mutationFn: apis.v2ApiCopyAppsUsingPost, + onSuccess(data: unknown) { + onSuccess?.(data); + }, + onError(error) { + onError?.(error); + }, + }); + + return response; +} + +/** UpdateAppV2.1 更新 app 信息 POST /llmops/v2/api/workspaces/${param0}/app/${param1} */ +export function useV2ApiWorkspacesWorkspaceIdAppAppIdUsingPostMutation(options?: { + onSuccess?: (value?: unknown) => void; + onError?: (error?: DefaultError) => void; +}) { + const { onSuccess, onError } = options || {}; + + const response = useMutation({ + mutationFn: apis.v2ApiWorkspacesWorkspaceIdAppAppIdUsingPost, + onSuccess(data: unknown) { + onSuccess?.(data); + }, + onError(error) { + onError?.(error); + }, + }); + + return response; +} + +/** GetAppDetailsV2.1 查询 app 详情 GET /llmops/v2/api/workspaces/${param0}/app/${param1}/details */ +export function v2ApiWorkspacesWorkspaceIdAppAppIdDetailsUsingGetQueryOptions(options: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v2ApiWorkspacesWorkspaceIdAppAppIdDetailsUsingGetParams; + options?: { [key: string]: unknown }; +}) { + return queryOptions({ + queryFn: async ({ queryKey }) => { + return apis.v2ApiWorkspacesWorkspaceIdAppAppIdDetailsUsingGet( + queryKey[1] as typeof options + ); + }, + queryKey: ['v2ApiWorkspacesWorkspaceIdAppAppIdDetailsUsingGet', options], + }); +} + +/** GetSumHourlyMessagesCountV2.1 每小时messages数 GET /llmops/v2/api/workspaces/${param0}/app/${param1}/hourly-messages */ +export function v2ApiWorkspacesWorkspaceIdAppAppIdHourlyMessagesUsingGetQueryOptions(options: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v2ApiWorkspacesWorkspaceIdAppAppIdHourlyMessagesUsingGetParams; + options?: { [key: string]: unknown }; +}) { + return queryOptions({ + queryFn: async ({ queryKey }) => { + return apis.v2ApiWorkspacesWorkspaceIdAppAppIdHourlyMessagesUsingGet( + queryKey[1] as typeof options + ); + }, + queryKey: [ + 'v2ApiWorkspacesWorkspaceIdAppAppIdHourlyMessagesUsingGet', + options, + ], + }); +} + +/** GetSumHourlyTokenV2.1 每小时token数 GET /llmops/v2/api/workspaces/${param0}/app/${param1}/hourly-token */ +export function v2ApiWorkspacesWorkspaceIdAppAppIdHourlyTokenUsingGetQueryOptions(options: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v2ApiWorkspacesWorkspaceIdAppAppIdHourlyTokenUsingGetParams; + options?: { [key: string]: unknown }; +}) { + return queryOptions({ + queryFn: async ({ queryKey }) => { + return apis.v2ApiWorkspacesWorkspaceIdAppAppIdHourlyTokenUsingGet( + queryKey[1] as typeof options + ); + }, + queryKey: [ + 'v2ApiWorkspacesWorkspaceIdAppAppIdHourlyTokenUsingGet', + options, + ], + }); +} + +/** GetSumDailyMessagesCountV2.1 每日messages数 GET /llmops/v2/api/workspaces/${param0}/app/${param1}/messages */ +export function v2ApiWorkspacesWorkspaceIdAppAppIdMessagesUsingGetQueryOptions(options: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v2ApiWorkspacesWorkspaceIdAppAppIdMessagesUsingGetParams; + options?: { [key: string]: unknown }; +}) { + return queryOptions({ + queryFn: async ({ queryKey }) => { + return apis.v2ApiWorkspacesWorkspaceIdAppAppIdMessagesUsingGet( + queryKey[1] as typeof options + ); + }, + queryKey: ['v2ApiWorkspacesWorkspaceIdAppAppIdMessagesUsingGet', options], + }); +} + +/** UpdateAppStatusV2.1 更新 app 状态 PUT /llmops/v2/api/workspaces/${param0}/app/${param1}/update_status */ +export function useV2ApiWorkspacesWorkspaceIdAppAppIdUpdateStatusUsingPutMutation(options?: { + onSuccess?: (value?: unknown) => void; + onError?: (error?: DefaultError) => void; +}) { + const { onSuccess, onError } = options || {}; + + const response = useMutation({ + mutationFn: apis.v2ApiWorkspacesWorkspaceIdAppAppIdUpdateStatusUsingPut, + onSuccess(data: unknown) { + onSuccess?.(data); + }, + onError(error) { + onError?.(error); + }, + }); + + return response; +} + +/** ListAppV2.1 查询用户关联的 app 列表 GET /llmops/v2/api/workspaces/${param0}/apps */ +export function v2ApiWorkspacesWorkspaceIdAppsUsingGetQueryOptions(options: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v2ApiWorkspacesWorkspaceIdAppsUsingGetParams; + options?: { [key: string]: unknown }; +}) { + return queryOptions({ + queryFn: async ({ queryKey }) => { + return apis.v2ApiWorkspacesWorkspaceIdAppsUsingGet( + queryKey[1] as typeof options + ); + }, + queryKey: ['v2ApiWorkspacesWorkspaceIdAppsUsingGet', options], + }); +} + +/** CreateAppV2.1 创建 app POST /llmops/v2/api/workspaces/${param0}/apps */ +export function useV2ApiWorkspacesWorkspaceIdAppsUsingPostMutation(options?: { + onSuccess?: (value?: unknown) => void; + onError?: (error?: DefaultError) => void; +}) { + const { onSuccess, onError } = options || {}; + + const response = useMutation({ + mutationFn: apis.v2ApiWorkspacesWorkspaceIdAppsUsingPost, + onSuccess(data: unknown) { + onSuccess?.(data); + }, + onError(error) { + onError?.(error); + }, + }); + + return response; +} + +/** DeleteDatasetsJoinV2.1 删除 app 数据集关联 DELETE /llmops/v2/api/workspaces/${param1}/app/${param0}/datasets */ +export function useV2ApiWorkspacesWorkspaceIdAppAppIdDatasetsUsingDeleteMutation(options?: { + onSuccess?: (value?: API.DeleteResp) => void; + onError?: (error?: DefaultError) => void; +}) { + const { onSuccess, onError } = options || {}; + + const response = useMutation({ + mutationFn: apis.v2ApiWorkspacesWorkspaceIdAppAppIdDatasetsUsingDelete, + onSuccess(data: API.DeleteResp) { + onSuccess?.(data); + }, + onError(error) { + onError?.(error); + }, + }); + + return response; +} + +/** GetAppLogsV2.1 查询 app 日志与标注 GET /llmops/v2/api/workspaces/${param1}/app/${param0}/logs */ +export function v2ApiWorkspacesWorkspaceIdAppAppIdLogsUsingGetQueryOptions(options: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v2ApiWorkspacesWorkspaceIdAppAppIdLogsUsingGetParams; + options?: { [key: string]: unknown }; +}) { + return queryOptions({ + queryFn: async ({ queryKey }) => { + return apis.v2ApiWorkspacesWorkspaceIdAppAppIdLogsUsingGet( + queryKey[1] as typeof options + ); + }, + queryKey: ['v2ApiWorkspacesWorkspaceIdAppAppIdLogsUsingGet', options], + }); +} + +/** UpdateModelConfigsV2.1 更新 app model configs PUT /llmops/v2/api/workspaces/${param1}/app/${param0}/model-configs */ +export function useV2ApiWorkspacesWorkspaceIdAppAppIdModelConfigsUsingPutMutation(options?: { + onSuccess?: (value?: unknown) => void; + onError?: (error?: DefaultError) => void; +}) { + const { onSuccess, onError } = options || {}; + + const response = useMutation({ + mutationFn: apis.v2ApiWorkspacesWorkspaceIdAppAppIdModelConfigsUsingPut, + onSuccess(data: unknown) { + onSuccess?.(data); + }, + onError(error) { + onError?.(error); + }, + }); + + return response; +} + +/** GetPluginListV2.1 获取插件列表 GET /llmops/v2/api/workspaces/${param1}/app/${param0}/plugin */ +export function v2ApiWorkspacesWorkspaceIdAppAppIdPluginUsingGetQueryOptions(options: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v2ApiWorkspacesWorkspaceIdAppAppIdPluginUsingGetParams; + options?: { [key: string]: unknown }; +}) { + return queryOptions({ + queryFn: async ({ queryKey }) => { + return apis.v2ApiWorkspacesWorkspaceIdAppAppIdPluginUsingGet( + queryKey[1] as typeof options + ); + }, + queryKey: ['v2ApiWorkspacesWorkspaceIdAppAppIdPluginUsingGet', options], + }); +} + +/** GetSumDailyTokenV2.1 每日token GET /llmops/v2/api/workspaces/${param1}/app/${param0}/token */ +export function v2ApiWorkspacesWorkspaceIdAppAppIdTokenUsingGetQueryOptions(options: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v2ApiWorkspacesWorkspaceIdAppAppIdTokenUsingGetParams; + options?: { [key: string]: unknown }; +}) { + return queryOptions({ + queryFn: async ({ queryKey }) => { + return apis.v2ApiWorkspacesWorkspaceIdAppAppIdTokenUsingGet( + queryKey[1] as typeof options + ); + }, + queryKey: ['v2ApiWorkspacesWorkspaceIdAppAppIdTokenUsingGet', options], + }); +} + +/** DeleteAppV2.1 删除 app DELETE /llmops/v2/api/workspaces/${param1}/apps/${param0} */ +export function useV2ApiWorkspacesWorkspaceIdAppsAppIdUsingDeleteMutation(options?: { + onSuccess?: (value?: API.DeleteResp) => void; + onError?: (error?: DefaultError) => void; +}) { + const { onSuccess, onError } = options || {}; + + const response = useMutation({ + mutationFn: apis.v2ApiWorkspacesWorkspaceIdAppsAppIdUsingDelete, + onSuccess(data: API.DeleteResp) { + onSuccess?.(data); + }, + onError(error) { + onError?.(error); + }, + }); + + return response; +} + +/** UpdateAppImage 更新 app名称头像 POST /llmops/v2/api/workspaces/${param1}/apps/${param0}/base */ +export function useV2ApiWorkspacesWorkspaceIdAppsAppIdBaseUsingPostMutation(options?: { + onSuccess?: (value?: unknown) => void; + onError?: (error?: DefaultError) => void; +}) { + const { onSuccess, onError } = options || {}; + + const response = useMutation({ + mutationFn: apis.v2ApiWorkspacesWorkspaceIdAppsAppIdBaseUsingPost, + onSuccess(data: unknown) { + onSuccess?.(data); + }, + onError(error) { + onError?.(error); + }, + }); + + return response; +} + +/** UpdateAppGroup 更新 app 分组 POST /llmops/v2/api/workspaces/${param1}/apps/${param0}/group */ +export function useV2ApiWorkspacesWorkspaceIdAppsAppIdGroupUsingPostMutation(options?: { + onSuccess?: (value?: unknown) => void; + onError?: (error?: DefaultError) => void; +}) { + const { onSuccess, onError } = options || {}; + + const response = useMutation({ + mutationFn: apis.v2ApiWorkspacesWorkspaceIdAppsAppIdGroupUsingPost, + onSuccess(data: unknown) { + onSuccess?.(data); + }, + onError(error) { + onError?.(error); + }, + }); + + return response; +} + +/** GetAppRecommendedContext 获取自定义推荐问题 & 推荐开关 GET /llmops/v2/api/workspaces/recommended/${param0}/details */ +export function v2ApiWorkspacesRecommendedMessageIdDetailsUsingGetQueryOptions(options: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v2ApiWorkspacesRecommendedMessageIdDetailsUsingGetParams; + options?: { [key: string]: unknown }; +}) { + return queryOptions({ + queryFn: async ({ queryKey }) => { + return apis.v2ApiWorkspacesRecommendedMessageIdDetailsUsingGet( + queryKey[1] as typeof options + ); + }, + queryKey: ['v2ApiWorkspacesRecommendedMessageIdDetailsUsingGet', options], + }); +} +/* eslint-disable */ +// @ts-ignore +import { request } from 'axios'; + +import * as API from './types'; + +/** GetWorkspaceGroupList 空间分组列表 GET /llmops/v2/api/workspaces/${param0}/groups */ +export async function v2ApiWorkspacesWorkspaceIdGroupsUsingGet({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v2ApiWorkspacesWorkspaceIdGroupsUsingGetParams; + options?: { [key: string]: unknown }; +}) { + const { workspaceID: param0, ...queryParams } = params; + + return request( + `/llmops/v2/api/workspaces/${param0}/groups`, + { + method: 'GET', + params: { ...queryParams }, + ...(options || {}), + } + ); +} + +/** CreateWorkspaceGroup 创建空间分组 POST /llmops/v2/api/workspaces/${param0}/groups */ +export async function v2ApiWorkspacesWorkspaceIdGroupsUsingPost({ + params, + body, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v2ApiWorkspacesWorkspaceIdGroupsUsingPostParams; + body: API.WorkspaceGroupReq; + options?: { [key: string]: unknown }; +}) { + const { workspaceID: param0, ...queryParams } = params; + + return request( + `/llmops/v2/api/workspaces/${param0}/groups`, + { + method: 'POST', + params: { ...queryParams }, + data: body, + ...(options || {}), + } + ); +} + +/** UpdateWorkspaceGroup 更新分组 POST /llmops/v2/api/workspaces/${param0}/groups/${param1} */ +export async function v2ApiWorkspacesWorkspaceIdGroupsWorkspaceGroupIdUsingPost({ + params, + body, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v2ApiWorkspacesWorkspaceIdGroupsWorkspaceGroupIdUsingPostParams; + body: API.WorkspaceGroupReq; + options?: { [key: string]: unknown }; +}) { + const { + workspaceID: param0, + workspaceGroupID: param1, + ...queryParams + } = params; + + return request( + `/llmops/v2/api/workspaces/${param0}/groups/${param1}`, + { + method: 'POST', + params: { ...queryParams }, + data: body, + ...(options || {}), + } + ); +} + +/** DeleteWorkspaceGroup 删除分组 DELETE /llmops/v2/api/workspaces/${param0}/groups/${param1} */ +export async function v2ApiWorkspacesWorkspaceIdGroupsWorkspaceGroupIdUsingDelete({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v2ApiWorkspacesWorkspaceIdGroupsWorkspaceGroupIdUsingDeleteParams; + options?: { [key: string]: unknown }; +}) { + const { + workspaceID: param0, + workspaceGroupID: param1, + ...queryParams + } = params; + + return request( + `/llmops/v2/api/workspaces/${param0}/groups/${param1}`, + { + method: 'DELETE', + params: { ...queryParams }, + ...(options || {}), + } + ); +} +/* eslint-disable */ +// @ts-ignore +import { queryOptions, useMutation } from '@tanstack/vue-query'; +import type { DefaultError } from '@tanstack/vue-query'; +import { request } from 'axios'; + +import * as apis from './workspaceGroup'; +import * as API from './types'; + +/** GetWorkspaceGroupList 空间分组列表 GET /llmops/v2/api/workspaces/${param0}/groups */ +export function v2ApiWorkspacesWorkspaceIdGroupsUsingGetQueryOptions(options: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v2ApiWorkspacesWorkspaceIdGroupsUsingGetParams; + options?: { [key: string]: unknown }; +}) { + return queryOptions({ + queryFn: async ({ queryKey }) => { + return apis.v2ApiWorkspacesWorkspaceIdGroupsUsingGet( + queryKey[1] as typeof options + ); + }, + queryKey: ['v2ApiWorkspacesWorkspaceIdGroupsUsingGet', options], + }); +} + +/** CreateWorkspaceGroup 创建空间分组 POST /llmops/v2/api/workspaces/${param0}/groups */ +export function useV2ApiWorkspacesWorkspaceIdGroupsUsingPostMutation(options?: { + onSuccess?: (value?: API.ListWorkspaceGroup) => void; + onError?: (error?: DefaultError) => void; +}) { + const { onSuccess, onError } = options || {}; + + const response = useMutation({ + mutationFn: apis.v2ApiWorkspacesWorkspaceIdGroupsUsingPost, + onSuccess(data: API.ListWorkspaceGroup) { + onSuccess?.(data); + }, + onError(error) { + onError?.(error); + }, + }); + + return response; +} + +/** UpdateWorkspaceGroup 更新分组 POST /llmops/v2/api/workspaces/${param0}/groups/${param1} */ +export function useV2ApiWorkspacesWorkspaceIdGroupsWorkspaceGroupIdUsingPostMutation(options?: { + onSuccess?: (value?: unknown) => void; + onError?: (error?: DefaultError) => void; +}) { + const { onSuccess, onError } = options || {}; + + const response = useMutation({ + mutationFn: apis.v2ApiWorkspacesWorkspaceIdGroupsWorkspaceGroupIdUsingPost, + onSuccess(data: unknown) { + onSuccess?.(data); + }, + onError(error) { + onError?.(error); + }, + }); + + return response; +} + +/** DeleteWorkspaceGroup 删除分组 DELETE /llmops/v2/api/workspaces/${param0}/groups/${param1} */ +export function useV2ApiWorkspacesWorkspaceIdGroupsWorkspaceGroupIdUsingDeleteMutation(options?: { + onSuccess?: (value?: unknown) => void; + onError?: (error?: DefaultError) => void; +}) { + const { onSuccess, onError } = options || {}; + + const response = useMutation({ + mutationFn: + apis.v2ApiWorkspacesWorkspaceIdGroupsWorkspaceGroupIdUsingDelete, + onSuccess(data: unknown) { + onSuccess?.(data); + }, + onError(error) { + onError?.(error); + }, + }); + + return response; +} diff --git "a/test/__snapshots__/common/\346\265\213\350\257\225\347\224\237\346\210\220 react-query.snap" "b/test/__snapshots__/common/\346\265\213\350\257\225\347\224\237\346\210\220 react-query.snap" new file mode 100644 index 0000000..c600898 --- /dev/null +++ "b/test/__snapshots__/common/\346\265\213\350\257\225\347\224\237\346\210\220 react-query.snap" @@ -0,0 +1,6556 @@ +/* eslint-disable */ +// @ts-ignore +import { queryOptions, useMutation } from '@tanstack/react-query'; +import type { DefaultError } from '@tanstack/react-query'; +import { request } from 'axios'; + +import * as apis from './addAppKey'; +import * as API from './types'; + +/** AddAppKey 为应用添加各种类型机器人appkey POST /llmops/v1/api/robot/${param0}/appkey */ +export function useV1ApiRobotWorkspaceIdAppkeyUsingPostMutation(options?: { + onSuccess?: (value?: unknown) => void; + onError?: (error?: DefaultError) => void; +}) { + const { onSuccess, onError } = options || {}; + + const response = useMutation({ + mutationFn: apis.v1ApiRobotWorkspaceIdAppkeyUsingPost, + onSuccess(data: unknown) { + onSuccess?.(data); + }, + onError(error) { + onError?.(error); + }, + }); + + return response; +} +/* eslint-disable */ +// @ts-ignore +import { request } from 'axios'; + +import * as API from './types'; + +/** AddAppKey 为应用添加各种类型机器人appkey POST /llmops/v1/api/robot/${param0}/appkey */ +export async function v1ApiRobotWorkspaceIdAppkeyUsingPost({ + params, + body, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v1ApiRobotWorkspaceIdAppkeyUsingPostParams; + body: API.AddAppkeyReq; + options?: { [key: string]: unknown }; +}) { + const { workspaceID: param0, ...queryParams } = params; + + return request(`/llmops/v1/api/robot/${param0}/appkey`, { + method: 'POST', + params: { ...queryParams }, + data: body, + ...(options || {}), + }); +} +/* eslint-disable */ +// @ts-ignore +import { queryOptions, useMutation } from '@tanstack/react-query'; +import type { DefaultError } from '@tanstack/react-query'; +import { request } from 'axios'; + +import * as apis from './apiToken'; +import * as API from './types'; + +/** ListApiToken 获取app 的 token 列表 GET /llmops/v1/api/app/${param0}/api-token */ +export function v1ApiAppAppIdApiTokenUsingGetQueryOptions(options: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v1ApiAppAppIdApiTokenUsingGetParams; + options?: { [key: string]: unknown }; +}) { + return queryOptions({ + queryFn: async ({ queryKey }) => { + return apis.v1ApiAppAppIdApiTokenUsingGet(queryKey[1] as typeof options); + }, + queryKey: ['v1ApiAppAppIdApiTokenUsingGet', options], + }); +} + +/** CreateApiToken 创建 app 的token POST /llmops/v1/api/app/${param0}/api-token */ +export function useV1ApiAppAppIdApiTokenUsingPostMutation(options?: { + onSuccess?: (value?: API.CreateApiTokenRESP) => void; + onError?: (error?: DefaultError) => void; +}) { + const { onSuccess, onError } = options || {}; + + const response = useMutation({ + mutationFn: apis.v1ApiAppAppIdApiTokenUsingPost, + onSuccess(data: API.CreateApiTokenRESP) { + onSuccess?.(data); + }, + onError(error) { + onError?.(error); + }, + }); + + return response; +} +/* eslint-disable */ +// @ts-ignore +import { request } from 'axios'; + +import * as API from './types'; + +/** ListApiToken 获取app 的 token 列表 GET /llmops/v1/api/app/${param0}/api-token */ +export async function v1ApiAppAppIdApiTokenUsingGet({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v1ApiAppAppIdApiTokenUsingGetParams; + options?: { [key: string]: unknown }; +}) { + const { appID: param0, ...queryParams } = params; + + return request( + `/llmops/v1/api/app/${param0}/api-token`, + { + method: 'GET', + params: { + ...queryParams, + }, + ...(options || {}), + } + ); +} + +/** CreateApiToken 创建 app 的token POST /llmops/v1/api/app/${param0}/api-token */ +export async function v1ApiAppAppIdApiTokenUsingPost({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v1ApiAppAppIdApiTokenUsingPostParams; + options?: { [key: string]: unknown }; +}) { + const { appID: param0, ...queryParams } = params; + + return request( + `/llmops/v1/api/app/${param0}/api-token`, + { + method: 'POST', + params: { ...queryParams }, + ...(options || {}), + } + ); +} +/* eslint-disable */ +// @ts-ignore +import { queryOptions, useMutation } from '@tanstack/react-query'; +import type { DefaultError } from '@tanstack/react-query'; +import { request } from 'axios'; + +import * as apis from './app'; +import * as API from './types'; + +/** GetAppCostTokens 查询 app token消耗 POST /llmops/v1/api/${param0}/cost */ +export function useV1ApiAppIdCostUsingPostMutation(options?: { + onSuccess?: (value?: API.QueryTokenResp) => void; + onError?: (error?: DefaultError) => void; +}) { + const { onSuccess, onError } = options || {}; + + const response = useMutation({ + mutationFn: apis.v1ApiAppIdCostUsingPost, + onSuccess(data: API.QueryTokenResp) { + onSuccess?.(data); + }, + onError(error) { + onError?.(error); + }, + }); + + return response; +} + +/** CreateApp 创建 app POST /llmops/v1/api/app */ +export function useV1ApiAppUsingPostMutation(options?: { + onSuccess?: (value?: unknown) => void; + onError?: (error?: DefaultError) => void; +}) { + const { onSuccess, onError } = options || {}; + + const response = useMutation({ + mutationFn: apis.v1ApiAppUsingPost, + onSuccess(data: unknown) { + onSuccess?.(data); + }, + onError(error) { + onError?.(error); + }, + }); + + return response; +} + +/** DeleteApp 删除 app DELETE /llmops/v1/api/app/${param0}/delete */ +export function useV1ApiAppAppIdOpenApiDeleteUsingDeleteMutation(options?: { + onSuccess?: (value?: API.DeleteResp) => void; + onError?: (error?: DefaultError) => void; +}) { + const { onSuccess, onError } = options || {}; + + const response = useMutation({ + mutationFn: apis.v1ApiAppAppIdOpenApiDeleteUsingDelete, + onSuccess(data: API.DeleteResp) { + onSuccess?.(data); + }, + onError(error) { + onError?.(error); + }, + }); + + return response; +} + +/** GetAppDetails 查询 app 详情 GET /llmops/v1/api/app/${param0}/details */ +export function v1ApiAppAppIdDetailsUsingGetQueryOptions(options: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v1ApiAppAppIdDetailsUsingGetParams; + options?: { [key: string]: unknown }; +}) { + return queryOptions({ + queryFn: async ({ queryKey }) => { + return apis.v1ApiAppAppIdDetailsUsingGet(queryKey[1] as typeof options); + }, + queryKey: ['v1ApiAppAppIdDetailsUsingGet', options], + }); +} + +/** GetSumHourlyMessagesCount 每小时messages数 GET /llmops/v1/api/app/${param0}/hourly-messages */ +export function v1ApiAppAppIdHourlyMessagesUsingGetQueryOptions(options: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v1ApiAppAppIdHourlyMessagesUsingGetParams; + options?: { [key: string]: unknown }; +}) { + return queryOptions({ + queryFn: async ({ queryKey }) => { + return apis.v1ApiAppAppIdHourlyMessagesUsingGet( + queryKey[1] as typeof options + ); + }, + queryKey: ['v1ApiAppAppIdHourlyMessagesUsingGet', options], + }); +} + +/** GetSumHourlyToken 每小时token数 GET /llmops/v1/api/app/${param0}/hourly-token */ +export function v1ApiAppAppIdHourlyTokenUsingGetQueryOptions(options: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v1ApiAppAppIdHourlyTokenUsingGetParams; + options?: { [key: string]: unknown }; +}) { + return queryOptions({ + queryFn: async ({ queryKey }) => { + return apis.v1ApiAppAppIdHourlyTokenUsingGet( + queryKey[1] as typeof options + ); + }, + queryKey: ['v1ApiAppAppIdHourlyTokenUsingGet', options], + }); +} + +/** GetAppLogs 查询 app 日志与标注 GET /llmops/v1/api/app/${param0}/logs */ +export function v1ApiAppAppIdLogsUsingGetQueryOptions(options: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v1ApiAppAppIdLogsUsingGetParams; + options?: { [key: string]: unknown }; +}) { + return queryOptions({ + queryFn: async ({ queryKey }) => { + return apis.v1ApiAppAppIdLogsUsingGet(queryKey[1] as typeof options); + }, + queryKey: ['v1ApiAppAppIdLogsUsingGet', options], + }); +} + +/** GetLogsMessages 查询 app 日志与标注消息详情 GET /llmops/v1/api/app/${param0}/logs/${param1}/messages */ +export function v1ApiAppAppIdLogsConversationIdMessagesUsingGetQueryOptions(options: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v1ApiAppAppIdLogsConversationIdMessagesUsingGetParams; + options?: { [key: string]: unknown }; +}) { + return queryOptions({ + queryFn: async ({ queryKey }) => { + return apis.v1ApiAppAppIdLogsConversationIdMessagesUsingGet( + queryKey[1] as typeof options + ); + }, + queryKey: ['v1ApiAppAppIdLogsConversationIdMessagesUsingGet', options], + }); +} + +/** GetSumDailyMessagesCount 每日messages数 GET /llmops/v1/api/app/${param0}/messages */ +export function v1ApiAppAppIdMessagesUsingGetQueryOptions(options: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v1ApiAppAppIdMessagesUsingGetParams; + options?: { [key: string]: unknown }; +}) { + return queryOptions({ + queryFn: async ({ queryKey }) => { + return apis.v1ApiAppAppIdMessagesUsingGet(queryKey[1] as typeof options); + }, + queryKey: ['v1ApiAppAppIdMessagesUsingGet', options], + }); +} + +/** ShareChat 创建分享path PUT /llmops/v1/api/app/${param0}/share */ +export function useV1ApiAppAppIdShareUsingPutMutation(options?: { + onSuccess?: (value?: API.CreateSharePathRESP) => void; + onError?: (error?: DefaultError) => void; +}) { + const { onSuccess, onError } = options || {}; + + const response = useMutation({ + mutationFn: apis.v1ApiAppAppIdShareUsingPut, + onSuccess(data: API.CreateSharePathRESP) { + onSuccess?.(data); + }, + onError(error) { + onError?.(error); + }, + }); + + return response; +} + +/** GetSumDailyToken 每日token GET /llmops/v1/api/app/${param0}/token */ +export function v1ApiAppAppIdTokenUsingGetQueryOptions(options: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v1ApiAppAppIdTokenUsingGetParams; + options?: { [key: string]: unknown }; +}) { + return queryOptions({ + queryFn: async ({ queryKey }) => { + return apis.v1ApiAppAppIdTokenUsingGet(queryKey[1] as typeof options); + }, + queryKey: ['v1ApiAppAppIdTokenUsingGet', options], + }); +} + +/** UpdateApp 更新 app PUT /llmops/v1/api/app/${param0}/update */ +export function useV1ApiAppAppIdUpdateUsingPutMutation(options?: { + onSuccess?: (value?: unknown) => void; + onError?: (error?: DefaultError) => void; +}) { + const { onSuccess, onError } = options || {}; + + const response = useMutation({ + mutationFn: apis.v1ApiAppAppIdUpdateUsingPut, + onSuccess(data: unknown) { + onSuccess?.(data); + }, + onError(error) { + onError?.(error); + }, + }); + + return response; +} + +/** ReleaseDiscover 发布到发现 PUT /llmops/v1/api/app/${param0}/update_status */ +export function useV1ApiAppAppIdUpdateStatusUsingPutMutation(options?: { + onSuccess?: (value?: unknown) => void; + onError?: (error?: DefaultError) => void; +}) { + const { onSuccess, onError } = options || {}; + + const response = useMutation({ + mutationFn: apis.v1ApiAppAppIdUpdateStatusUsingPut, + onSuccess(data: unknown) { + onSuccess?.(data); + }, + onError(error) { + onError?.(error); + }, + }); + + return response; +} + +/** GetImagePreSignedUrl 获取上传预签名地址 GET /llmops/v1/api/app/image */ +export function v1ApiAppImageUsingGetQueryOptions(options: { + options?: { [key: string]: unknown }; +}) { + return queryOptions({ + queryFn: async ({ queryKey }) => { + return apis.v1ApiAppImageUsingGet(queryKey[1] as typeof options); + }, + queryKey: ['v1ApiAppImageUsingGet', options], + }); +} + +/** ListApp 查询 app 列表 GET /llmops/v1/api/app/list */ +export function v1ApiAppListUsingGetQueryOptions(options: { + options?: { [key: string]: unknown }; +}) { + return queryOptions({ + queryFn: async ({ queryKey }) => { + return apis.v1ApiAppListUsingGet(queryKey[1] as typeof options); + }, + queryKey: ['v1ApiAppListUsingGet', options], + }); +} + +/** ListAppPick 查询精选 app 列表 GET /llmops/v1/api/app/list-pick */ +export function v1ApiAppListPickUsingGetQueryOptions(options: { + options?: { [key: string]: unknown }; +}) { + return queryOptions({ + queryFn: async ({ queryKey }) => { + return apis.v1ApiAppListPickUsingGet(queryKey[1] as typeof options); + }, + queryKey: ['v1ApiAppListPickUsingGet', options], + }); +} + +/** ListAppByUser 查询用户关联的 app 列表 GET /llmops/v1/api/app/list-private */ +export function v1ApiAppListPrivateUsingGetQueryOptions(options: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v1ApiAppListPrivateUsingGetParams; + options?: { [key: string]: unknown }; +}) { + return queryOptions({ + queryFn: async ({ queryKey }) => { + return apis.v1ApiAppListPrivateUsingGet(queryKey[1] as typeof options); + }, + queryKey: ['v1ApiAppListPrivateUsingGet', options], + }); +} + +/** ListAppPublic 查询公共 app 列表 GET /llmops/v1/api/app/list-public */ +export function v1ApiAppListPublicUsingGetQueryOptions(options: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v1ApiAppListPublicUsingGetParams; + options?: { [key: string]: unknown }; +}) { + return queryOptions({ + queryFn: async ({ queryKey }) => { + return apis.v1ApiAppListPublicUsingGet(queryKey[1] as typeof options); + }, + queryKey: ['v1ApiAppListPublicUsingGet', options], + }); +} +/* eslint-disable */ +// @ts-ignore +import { request } from 'axios'; + +import * as API from './types'; + +/** GetAppCostTokens 查询 app token消耗 POST /llmops/v1/api/${param0}/cost */ +export async function v1ApiAppIdCostUsingPost({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v1ApiAppIdCostUsingPostParams; + options?: { [key: string]: unknown }; +}) { + const { appID: param0, ...queryParams } = params; + + return request(`/llmops/v1/api/${param0}/cost`, { + method: 'POST', + params: { + ...queryParams, + }, + ...(options || {}), + }); +} + +/** CreateApp 创建 app POST /llmops/v1/api/app */ +export async function v1ApiAppUsingPost({ + body, + options, +}: { + body: API.CreateAppReq; + options?: { [key: string]: unknown }; +}) { + return request('/llmops/v1/api/app', { + method: 'POST', + data: body, + ...(options || {}), + }); +} + +/** DeleteApp 删除 app DELETE /llmops/v1/api/app/${param0}/delete */ +export async function v1ApiAppAppIdOpenApiDeleteUsingDelete({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v1ApiAppAppIdOpenApiDeleteUsingDeleteParams; + options?: { [key: string]: unknown }; +}) { + const { appID: param0, ...queryParams } = params; + + return request(`/llmops/v1/api/app/${param0}/delete`, { + method: 'DELETE', + params: { ...queryParams }, + ...(options || {}), + }); +} + +/** GetAppDetails 查询 app 详情 GET /llmops/v1/api/app/${param0}/details */ +export async function v1ApiAppAppIdDetailsUsingGet({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v1ApiAppAppIdDetailsUsingGetParams; + options?: { [key: string]: unknown }; +}) { + const { appID: param0, ...queryParams } = params; + + return request(`/llmops/v1/api/app/${param0}/details`, { + method: 'GET', + params: { ...queryParams }, + ...(options || {}), + }); +} + +/** GetSumHourlyMessagesCount 每小时messages数 GET /llmops/v1/api/app/${param0}/hourly-messages */ +export async function v1ApiAppAppIdHourlyMessagesUsingGet({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v1ApiAppAppIdHourlyMessagesUsingGetParams; + options?: { [key: string]: unknown }; +}) { + const { appID: param0, ...queryParams } = params; + + return request( + `/llmops/v1/api/app/${param0}/hourly-messages`, + { + method: 'GET', + params: { + ...queryParams, + }, + ...(options || {}), + } + ); +} + +/** GetSumHourlyToken 每小时token数 GET /llmops/v1/api/app/${param0}/hourly-token */ +export async function v1ApiAppAppIdHourlyTokenUsingGet({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v1ApiAppAppIdHourlyTokenUsingGetParams; + options?: { [key: string]: unknown }; +}) { + const { appID: param0, ...queryParams } = params; + + return request( + `/llmops/v1/api/app/${param0}/hourly-token`, + { + method: 'GET', + params: { + ...queryParams, + }, + ...(options || {}), + } + ); +} + +/** GetAppLogs 查询 app 日志与标注 GET /llmops/v1/api/app/${param0}/logs */ +export async function v1ApiAppAppIdLogsUsingGet({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v1ApiAppAppIdLogsUsingGetParams; + options?: { [key: string]: unknown }; +}) { + const { appID: param0, ...queryParams } = params; + + return request( + `/llmops/v1/api/app/${param0}/logs`, + { + method: 'GET', + params: { + ...queryParams, + }, + ...(options || {}), + } + ); +} + +/** GetLogsMessages 查询 app 日志与标注消息详情 GET /llmops/v1/api/app/${param0}/logs/${param1}/messages */ +export async function v1ApiAppAppIdLogsConversationIdMessagesUsingGet({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v1ApiAppAppIdLogsConversationIdMessagesUsingGetParams; + options?: { [key: string]: unknown }; +}) { + const { appID: param0, conversationID: param1, ...queryParams } = params; + + return request( + `/llmops/v1/api/app/${param0}/logs/${param1}/messages`, + { + method: 'GET', + params: { ...queryParams }, + ...(options || {}), + } + ); +} + +/** GetSumDailyMessagesCount 每日messages数 GET /llmops/v1/api/app/${param0}/messages */ +export async function v1ApiAppAppIdMessagesUsingGet({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v1ApiAppAppIdMessagesUsingGetParams; + options?: { [key: string]: unknown }; +}) { + const { appID: param0, ...queryParams } = params; + + return request( + `/llmops/v1/api/app/${param0}/messages`, + { + method: 'GET', + params: { + ...queryParams, + }, + ...(options || {}), + } + ); +} + +/** ShareChat 创建分享path PUT /llmops/v1/api/app/${param0}/share */ +export async function v1ApiAppAppIdShareUsingPut({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v1ApiAppAppIdShareUsingPutParams; + options?: { [key: string]: unknown }; +}) { + const { appID: param0, ...queryParams } = params; + + return request( + `/llmops/v1/api/app/${param0}/share`, + { + method: 'PUT', + params: { + ...queryParams, + }, + ...(options || {}), + } + ); +} + +/** GetSumDailyToken 每日token GET /llmops/v1/api/app/${param0}/token */ +export async function v1ApiAppAppIdTokenUsingGet({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v1ApiAppAppIdTokenUsingGetParams; + options?: { [key: string]: unknown }; +}) { + const { appID: param0, ...queryParams } = params; + + return request( + `/llmops/v1/api/app/${param0}/token`, + { + method: 'GET', + params: { + ...queryParams, + }, + ...(options || {}), + } + ); +} + +/** UpdateApp 更新 app PUT /llmops/v1/api/app/${param0}/update */ +export async function v1ApiAppAppIdUpdateUsingPut({ + params, + body, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v1ApiAppAppIdUpdateUsingPutParams; + body: API.UpdateAppReq; + options?: { [key: string]: unknown }; +}) { + const { appID: param0, ...queryParams } = params; + + return request(`/llmops/v1/api/app/${param0}/update`, { + method: 'PUT', + params: { ...queryParams }, + data: body, + ...(options || {}), + }); +} + +/** ReleaseDiscover 发布到发现 PUT /llmops/v1/api/app/${param0}/update_status */ +export async function v1ApiAppAppIdUpdateStatusUsingPut({ + params, + body, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v1ApiAppAppIdUpdateStatusUsingPutParams; + body: API.ReleaseDiscoverReq; + options?: { [key: string]: unknown }; +}) { + const { appID: param0, ...queryParams } = params; + + return request(`/llmops/v1/api/app/${param0}/update_status`, { + method: 'PUT', + params: { ...queryParams }, + data: body, + ...(options || {}), + }); +} + +/** GetImagePreSignedUrl 获取上传预签名地址 GET /llmops/v1/api/app/image */ +export async function v1ApiAppImageUsingGet({ + options, +}: { + options?: { [key: string]: unknown }; +}) { + return request('/llmops/v1/api/app/image', { + method: 'GET', + ...(options || {}), + }); +} + +/** ListApp 查询 app 列表 GET /llmops/v1/api/app/list */ +export async function v1ApiAppListUsingGet({ + options, +}: { + options?: { [key: string]: unknown }; +}) { + return request('/llmops/v1/api/app/list', { + method: 'GET', + ...(options || {}), + }); +} + +/** ListAppPick 查询精选 app 列表 GET /llmops/v1/api/app/list-pick */ +export async function v1ApiAppListPickUsingGet({ + options, +}: { + options?: { [key: string]: unknown }; +}) { + return request('/llmops/v1/api/app/list-pick', { + method: 'GET', + ...(options || {}), + }); +} + +/** ListAppByUser 查询用户关联的 app 列表 GET /llmops/v1/api/app/list-private */ +export async function v1ApiAppListPrivateUsingGet({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v1ApiAppListPrivateUsingGetParams; + options?: { [key: string]: unknown }; +}) { + return request('/llmops/v1/api/app/list-private', { + method: 'GET', + params: { + ...params, + }, + ...(options || {}), + }); +} + +/** ListAppPublic 查询公共 app 列表 GET /llmops/v1/api/app/list-public */ +export async function v1ApiAppListPublicUsingGet({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v1ApiAppListPublicUsingGetParams; + options?: { [key: string]: unknown }; +}) { + return request('/llmops/v1/api/app/list-public', { + method: 'GET', + params: { + ...params, + }, + ...(options || {}), + }); +} +/* eslint-disable */ +// @ts-ignore +import { queryOptions, useMutation } from '@tanstack/react-query'; +import type { DefaultError } from '@tanstack/react-query'; +import { request } from 'axios'; + +import * as apis from './appDatasetConfigs'; +import * as API from './types'; + +/** GetAppDatasetConfigsList 查询应用知识库查询配置 GET /llmops/v1/api/app/${param0}/dataset-configs */ +export function v1ApiAppAppIdDatasetConfigsUsingGetQueryOptions(options: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v1ApiAppAppIdDatasetConfigsUsingGetParams; + options?: { [key: string]: unknown }; +}) { + return queryOptions({ + queryFn: async ({ queryKey }) => { + return apis.v1ApiAppAppIdDatasetConfigsUsingGet( + queryKey[1] as typeof options + ); + }, + queryKey: ['v1ApiAppAppIdDatasetConfigsUsingGet', options], + }); +} + +/** UpdateAppDatasetConfigs 更新应用知识库查询配置 PUT /llmops/v1/api/app/${param0}/dataset-configs */ +export function useV1ApiAppAppIdDatasetConfigsUsingPutMutation(options?: { + onSuccess?: (value?: unknown) => void; + onError?: (error?: DefaultError) => void; +}) { + const { onSuccess, onError } = options || {}; + + const response = useMutation({ + mutationFn: apis.v1ApiAppAppIdDatasetConfigsUsingPut, + onSuccess(data: unknown) { + onSuccess?.(data); + }, + onError(error) { + onError?.(error); + }, + }); + + return response; +} + +/** CreateAppDatasetConfigs 创建应用知识库查询配置 POST /llmops/v1/api/app/${param0}/dataset-configs */ +export function useV1ApiAppAppIdDatasetConfigsUsingPostMutation(options?: { + onSuccess?: (value?: unknown) => void; + onError?: (error?: DefaultError) => void; +}) { + const { onSuccess, onError } = options || {}; + + const response = useMutation({ + mutationFn: apis.v1ApiAppAppIdDatasetConfigsUsingPost, + onSuccess(data: unknown) { + onSuccess?.(data); + }, + onError(error) { + onError?.(error); + }, + }); + + return response; +} + +/** DeleteAppDatasetConfigs 删除应用知识库查询配置 DELETE /llmops/v1/api/app/${param0}/dataset-configs */ +export function useV1ApiAppAppIdDatasetConfigsUsingDeleteMutation(options?: { + onSuccess?: (value?: unknown) => void; + onError?: (error?: DefaultError) => void; +}) { + const { onSuccess, onError } = options || {}; + + const response = useMutation({ + mutationFn: apis.v1ApiAppAppIdDatasetConfigsUsingDelete, + onSuccess(data: unknown) { + onSuccess?.(data); + }, + onError(error) { + onError?.(error); + }, + }); + + return response; +} +/* eslint-disable */ +// @ts-ignore +import { request } from 'axios'; + +import * as API from './types'; + +/** GetAppDatasetConfigsList 查询应用知识库查询配置 GET /llmops/v1/api/app/${param0}/dataset-configs */ +export async function v1ApiAppAppIdDatasetConfigsUsingGet({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v1ApiAppAppIdDatasetConfigsUsingGetParams; + options?: { [key: string]: unknown }; +}) { + const { appID: param0, ...queryParams } = params; + + return request( + `/llmops/v1/api/app/${param0}/dataset-configs`, + { + method: 'GET', + params: { ...queryParams }, + ...(options || {}), + } + ); +} + +/** UpdateAppDatasetConfigs 更新应用知识库查询配置 PUT /llmops/v1/api/app/${param0}/dataset-configs */ +export async function v1ApiAppAppIdDatasetConfigsUsingPut({ + params, + body, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v1ApiAppAppIdDatasetConfigsUsingPutParams; + body: API.AppDatasetConfigs; + options?: { [key: string]: unknown }; +}) { + const { appID: param0, ...queryParams } = params; + + return request(`/llmops/v1/api/app/${param0}/dataset-configs`, { + method: 'PUT', + params: { ...queryParams }, + data: body, + ...(options || {}), + }); +} + +/** CreateAppDatasetConfigs 创建应用知识库查询配置 POST /llmops/v1/api/app/${param0}/dataset-configs */ +export async function v1ApiAppAppIdDatasetConfigsUsingPost({ + params, + body, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v1ApiAppAppIdDatasetConfigsUsingPostParams; + body: API.AppDatasetConfigs; + options?: { [key: string]: unknown }; +}) { + const { appID: param0, ...queryParams } = params; + + return request(`/llmops/v1/api/app/${param0}/dataset-configs`, { + method: 'POST', + params: { ...queryParams }, + data: body, + ...(options || {}), + }); +} + +/** DeleteAppDatasetConfigs 删除应用知识库查询配置 DELETE /llmops/v1/api/app/${param0}/dataset-configs */ +export async function v1ApiAppAppIdDatasetConfigsUsingDelete({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v1ApiAppAppIdDatasetConfigsUsingDeleteParams; + options?: { [key: string]: unknown }; +}) { + const { appID: param0, ...queryParams } = params; + + return request(`/llmops/v1/api/app/${param0}/dataset-configs`, { + method: 'DELETE', + params: { + ...queryParams, + }, + ...(options || {}), + }); +} +/* eslint-disable */ +// @ts-ignore +import { queryOptions, useMutation } from '@tanstack/react-query'; +import type { DefaultError } from '@tanstack/react-query'; +import { request } from 'axios'; + +import * as apis from './appMember'; +import * as API from './types'; + +/** ListMember app下的用户列表 GET /llmops/v1/api/app/${param0}/member */ +export function v1ApiAppAppIdMemberUsingGetQueryOptions(options: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v1ApiAppAppIdMemberUsingGetParams; + options?: { [key: string]: unknown }; +}) { + return queryOptions({ + queryFn: async ({ queryKey }) => { + return apis.v1ApiAppAppIdMemberUsingGet(queryKey[1] as typeof options); + }, + queryKey: ['v1ApiAppAppIdMemberUsingGet', options], + }); +} + +/** AddMember 增加app用户 POST /llmops/v1/api/app/${param0}/member */ +export function useV1ApiAppAppIdMemberUsingPostMutation(options?: { + onSuccess?: (value?: API.EmptyObject) => void; + onError?: (error?: DefaultError) => void; +}) { + const { onSuccess, onError } = options || {}; + + const response = useMutation({ + mutationFn: apis.v1ApiAppAppIdMemberUsingPost, + onSuccess(data: API.EmptyObject) { + onSuccess?.(data); + }, + onError(error) { + onError?.(error); + }, + }); + + return response; +} + +/** DeleteMember 删除app用户 DELETE /llmops/v1/api/app/${param0}/member */ +export function useV1ApiAppAppIdMemberUsingDeleteMutation(options?: { + onSuccess?: (value?: API.EmptyObject) => void; + onError?: (error?: DefaultError) => void; +}) { + const { onSuccess, onError } = options || {}; + + const response = useMutation({ + mutationFn: apis.v1ApiAppAppIdMemberUsingDelete, + onSuccess(data: API.EmptyObject) { + onSuccess?.(data); + }, + onError(error) { + onError?.(error); + }, + }); + + return response; +} + +/** UpdateMemberRole 更新app用户角色 PUT /llmops/v1/api/app/${param0}/member-role */ +export function useV1ApiAppAppIdMemberRoleUsingPutMutation(options?: { + onSuccess?: (value?: API.EmptyObject) => void; + onError?: (error?: DefaultError) => void; +}) { + const { onSuccess, onError } = options || {}; + + const response = useMutation({ + mutationFn: apis.v1ApiAppAppIdMemberRoleUsingPut, + onSuccess(data: API.EmptyObject) { + onSuccess?.(data); + }, + onError(error) { + onError?.(error); + }, + }); + + return response; +} +/* eslint-disable */ +// @ts-ignore +import { request } from 'axios'; + +import * as API from './types'; + +/** ListMember app下的用户列表 GET /llmops/v1/api/app/${param0}/member */ +export async function v1ApiAppAppIdMemberUsingGet({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v1ApiAppAppIdMemberUsingGetParams; + options?: { [key: string]: unknown }; +}) { + const { appID: param0, ...queryParams } = params; + + return request(`/llmops/v1/api/app/${param0}/member`, { + method: 'GET', + params: { + ...queryParams, + }, + ...(options || {}), + }); +} + +/** AddMember 增加app用户 POST /llmops/v1/api/app/${param0}/member */ +export async function v1ApiAppAppIdMemberUsingPost({ + params, + body, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v1ApiAppAppIdMemberUsingPostParams; + body: API.MemberBody; + options?: { [key: string]: unknown }; +}) { + const { appID: param0, ...queryParams } = params; + + return request(`/llmops/v1/api/app/${param0}/member`, { + method: 'POST', + params: { ...queryParams }, + data: body, + ...(options || {}), + }); +} + +/** DeleteMember 删除app用户 DELETE /llmops/v1/api/app/${param0}/member */ +export async function v1ApiAppAppIdMemberUsingDelete({ + params, + body, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v1ApiAppAppIdMemberUsingDeleteParams; + body: API.DeleteMemberBody; + options?: { [key: string]: unknown }; +}) { + const { appID: param0, ...queryParams } = params; + + return request(`/llmops/v1/api/app/${param0}/member`, { + method: 'DELETE', + params: { ...queryParams }, + data: body, + ...(options || {}), + }); +} + +/** UpdateMemberRole 更新app用户角色 PUT /llmops/v1/api/app/${param0}/member-role */ +export async function v1ApiAppAppIdMemberRoleUsingPut({ + params, + body, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v1ApiAppAppIdMemberRoleUsingPutParams; + body: API.MemberBody; + options?: { [key: string]: unknown }; +}) { + const { appID: param0, ...queryParams } = params; + + return request(`/llmops/v1/api/app/${param0}/member-role`, { + method: 'PUT', + params: { ...queryParams }, + data: body, + ...(options || {}), + }); +} +/* eslint-disable */ +// @ts-ignore +import { queryOptions, useMutation } from '@tanstack/react-query'; +import type { DefaultError } from '@tanstack/react-query'; +import { request } from 'axios'; + +import * as apis from './appModelConfigs'; +import * as API from './types'; + +/** UpdateModelConfigs 更新 app model configs PUT /llmops/v1/api/app/${param0}/model-configs */ +export function useV1ApiAppAppIdModelConfigsUsingPutMutation(options?: { + onSuccess?: (value?: unknown) => void; + onError?: (error?: DefaultError) => void; +}) { + const { onSuccess, onError } = options || {}; + + const response = useMutation({ + mutationFn: apis.v1ApiAppAppIdModelConfigsUsingPut, + onSuccess(data: unknown) { + onSuccess?.(data); + }, + onError(error) { + onError?.(error); + }, + }); + + return response; +} + +/** CreateOrUpdateModelConfigs 创建 app model configs POST /llmops/v1/api/app/${param0}/model-configs */ +export function useV1ApiAppAppIdModelConfigsUsingPostMutation(options?: { + onSuccess?: (value?: unknown) => void; + onError?: (error?: DefaultError) => void; +}) { + const { onSuccess, onError } = options || {}; + + const response = useMutation({ + mutationFn: apis.v1ApiAppAppIdModelConfigsUsingPost, + onSuccess(data: unknown) { + onSuccess?.(data); + }, + onError(error) { + onError?.(error); + }, + }); + + return response; +} + +/** CreateOrUpdateModelConfigPromptPrefix 创建或修改角色和背景以及推荐问题开关 POST /llmops/v1/api/app/${param0}/model-prompt */ +export function useV1ApiAppAppIdModelPromptUsingPostMutation(options?: { + onSuccess?: (value?: unknown) => void; + onError?: (error?: DefaultError) => void; +}) { + const { onSuccess, onError } = options || {}; + + const response = useMutation({ + mutationFn: apis.v1ApiAppAppIdModelPromptUsingPost, + onSuccess(data: unknown) { + onSuccess?.(data); + }, + onError(error) { + onError?.(error); + }, + }); + + return response; +} + +/** GetPluginList 获取插件列表 PUT /llmops/v1/api/app/${param0}/plugin */ +export function useV1ApiAppAppIdPluginUsingPutMutation(options?: { + onSuccess?: (value?: unknown) => void; + onError?: (error?: DefaultError) => void; +}) { + const { onSuccess, onError } = options || {}; + + const response = useMutation({ + mutationFn: apis.v1ApiAppAppIdPluginUsingPut, + onSuccess(data: unknown) { + onSuccess?.(data); + }, + onError(error) { + onError?.(error); + }, + }); + + return response; +} +/* eslint-disable */ +// @ts-ignore +import { request } from 'axios'; + +import * as API from './types'; + +/** UpdateModelConfigs 更新 app model configs PUT /llmops/v1/api/app/${param0}/model-configs */ +export async function v1ApiAppAppIdModelConfigsUsingPut({ + params, + body, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v1ApiAppAppIdModelConfigsUsingPutParams; + body: API.AppModelConfigs; + options?: { [key: string]: unknown }; +}) { + const { appID: param0, ...queryParams } = params; + + return request(`/llmops/v1/api/app/${param0}/model-configs`, { + method: 'PUT', + params: { ...queryParams }, + data: body, + ...(options || {}), + }); +} + +/** CreateOrUpdateModelConfigs 创建 app model configs POST /llmops/v1/api/app/${param0}/model-configs */ +export async function v1ApiAppAppIdModelConfigsUsingPost({ + params, + body, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v1ApiAppAppIdModelConfigsUsingPostParams; + body: API.AppModelConfigs; + options?: { [key: string]: unknown }; +}) { + const { appID: param0, ...queryParams } = params; + + return request(`/llmops/v1/api/app/${param0}/model-configs`, { + method: 'POST', + params: { ...queryParams }, + data: body, + ...(options || {}), + }); +} + +/** CreateOrUpdateModelConfigPromptPrefix 创建或修改角色和背景以及推荐问题开关 POST /llmops/v1/api/app/${param0}/model-prompt */ +export async function v1ApiAppAppIdModelPromptUsingPost({ + params, + body, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v1ApiAppAppIdModelPromptUsingPostParams; + body: API.AppModelConfigPromptPrefix; + options?: { [key: string]: unknown }; +}) { + const { appID: param0, ...queryParams } = params; + + return request(`/llmops/v1/api/app/${param0}/model-prompt`, { + method: 'POST', + params: { ...queryParams }, + data: body, + ...(options || {}), + }); +} + +/** GetPluginList 获取插件列表 PUT /llmops/v1/api/app/${param0}/plugin */ +export async function v1ApiAppAppIdPluginUsingPut({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v1ApiAppAppIdPluginUsingPutParams; + options?: { [key: string]: unknown }; +}) { + const { appID: param0, ...queryParams } = params; + + return request(`/llmops/v1/api/app/${param0}/plugin`, { + method: 'PUT', + params: { ...queryParams }, + ...(options || {}), + }); +} +/* eslint-disable */ +// @ts-ignore +import { queryOptions, useMutation } from '@tanstack/react-query'; +import type { DefaultError } from '@tanstack/react-query'; +import { request } from 'axios'; + +import * as apis from './appV2'; +import * as API from './types'; + +/** CreateAppV2 创建 app POST /llmops/v2/api/app */ +export function useV2ApiAppUsingPostMutation(options?: { + onSuccess?: (value?: unknown) => void; + onError?: (error?: DefaultError) => void; +}) { + const { onSuccess, onError } = options || {}; + + const response = useMutation({ + mutationFn: apis.v2ApiAppUsingPost, + onSuccess(data: unknown) { + onSuccess?.(data); + }, + onError(error) { + onError?.(error); + }, + }); + + return response; +} + +/** GetAppDetailsV2 查询 app 详情 GET /llmops/v2/api/app/${param0}/details */ +export function v2ApiAppAppIdDetailsUsingGetQueryOptions(options: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v2ApiAppAppIdDetailsUsingGetParams; + options?: { [key: string]: unknown }; +}) { + return queryOptions({ + queryFn: async ({ queryKey }) => { + return apis.v2ApiAppAppIdDetailsUsingGet(queryKey[1] as typeof options); + }, + queryKey: ['v2ApiAppAppIdDetailsUsingGet', options], + }); +} + +/** UpdateAppV2 更新 app 信息 POST /llmops/v2/api/app/${param0}/update */ +export function useV2ApiAppAppIdUpdateUsingPostMutation(options?: { + onSuccess?: (value?: unknown) => void; + onError?: (error?: DefaultError) => void; +}) { + const { onSuccess, onError } = options || {}; + + const response = useMutation({ + mutationFn: apis.v2ApiAppAppIdUpdateUsingPost, + onSuccess(data: unknown) { + onSuccess?.(data); + }, + onError(error) { + onError?.(error); + }, + }); + + return response; +} + +/** ListAppV2 查询用户关联的 app 列表 GET /llmops/v2/api/app/list */ +export function v2ApiAppListUsingGetQueryOptions(options: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v2ApiAppListUsingGetParams; + options?: { [key: string]: unknown }; +}) { + return queryOptions({ + queryFn: async ({ queryKey }) => { + return apis.v2ApiAppListUsingGet(queryKey[1] as typeof options); + }, + queryKey: ['v2ApiAppListUsingGet', options], + }); +} + +/** GetApiTokenV2 获取一个 app token GET /llmops/v2/api/app/share/api-token */ +export function v2ApiAppShareApiTokenUsingGetQueryOptions(options: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v2ApiAppShareApiTokenUsingGetParams; + options?: { [key: string]: unknown }; +}) { + return queryOptions({ + queryFn: async ({ queryKey }) => { + return apis.v2ApiAppShareApiTokenUsingGet(queryKey[1] as typeof options); + }, + queryKey: ['v2ApiAppShareApiTokenUsingGet', options], + }); +} +/* eslint-disable */ +// @ts-ignore +import { request } from 'axios'; + +import * as API from './types'; + +/** CreateAppV2 创建 app POST /llmops/v2/api/app */ +export async function v2ApiAppUsingPost({ + body, + options, +}: { + body: API.CreateAppReqV2; + options?: { [key: string]: unknown }; +}) { + return request('/llmops/v2/api/app', { + method: 'POST', + data: body, + ...(options || {}), + }); +} + +/** GetAppDetailsV2 查询 app 详情 GET /llmops/v2/api/app/${param0}/details */ +export async function v2ApiAppAppIdDetailsUsingGet({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v2ApiAppAppIdDetailsUsingGetParams; + options?: { [key: string]: unknown }; +}) { + const { appID: param0, ...queryParams } = params; + + return request(`/llmops/v2/api/app/${param0}/details`, { + method: 'GET', + params: { ...queryParams }, + ...(options || {}), + }); +} + +/** UpdateAppV2 更新 app 信息 POST /llmops/v2/api/app/${param0}/update */ +export async function v2ApiAppAppIdUpdateUsingPost({ + params, + body, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v2ApiAppAppIdUpdateUsingPostParams; + body: API.UpdateAppReqV2; + options?: { [key: string]: unknown }; +}) { + const { appID: param0, ...queryParams } = params; + + return request(`/llmops/v2/api/app/${param0}/update`, { + method: 'POST', + params: { ...queryParams }, + data: body, + ...(options || {}), + }); +} + +/** ListAppV2 查询用户关联的 app 列表 GET /llmops/v2/api/app/list */ +export async function v2ApiAppListUsingGet({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v2ApiAppListUsingGetParams; + options?: { [key: string]: unknown }; +}) { + return request('/llmops/v2/api/app/list', { + method: 'GET', + params: { + ...params, + }, + ...(options || {}), + }); +} + +/** GetApiTokenV2 获取一个 app token GET /llmops/v2/api/app/share/api-token */ +export async function v2ApiAppShareApiTokenUsingGet({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v2ApiAppShareApiTokenUsingGetParams; + options?: { [key: string]: unknown }; +}) { + return request( + '/llmops/v2/api/app/share/api-token', + { + method: 'GET', + params: { + ...params, + }, + ...(options || {}), + } + ); +} +/* eslint-disable */ +// @ts-ignore +import { queryOptions, useMutation } from '@tanstack/react-query'; +import type { DefaultError } from '@tanstack/react-query'; +import { request } from 'axios'; + +import * as apis from './attention'; +import * as API from './types'; + +/** ListAttentionApp 应用列表 GET /llmops/v1/api/attention/app/list */ +export function v1ApiAttentionAppListUsingGetQueryOptions(options: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v1ApiAttentionAppListUsingGetParams; + options?: { [key: string]: unknown }; +}) { + return queryOptions({ + queryFn: async ({ queryKey }) => { + return apis.v1ApiAttentionAppListUsingGet(queryKey[1] as typeof options); + }, + queryKey: ['v1ApiAttentionAppListUsingGet', options], + }); +} + +/** ListAttentionConversations 查询会话列表 POST /llmops/v1/api/attention/conversations */ +export function useV1ApiAttentionConversationsUsingPostMutation(options?: { + onSuccess?: (value?: API.ListConversationResp) => void; + onError?: (error?: DefaultError) => void; +}) { + const { onSuccess, onError } = options || {}; + + const response = useMutation({ + mutationFn: apis.v1ApiAttentionConversationsUsingPost, + onSuccess(data: API.ListConversationResp) { + onSuccess?.(data); + }, + onError(error) { + onError?.(error); + }, + }); + + return response; +} + +/** GetAttentionConversationCount 获取对话数 POST /llmops/v1/api/attention/conversations/count */ +export function useV1ApiAttentionConversationsCountUsingPostMutation(options?: { + onSuccess?: (value?: API.AttentionDataCountResp) => void; + onError?: (error?: DefaultError) => void; +}) { + const { onSuccess, onError } = options || {}; + + const response = useMutation({ + mutationFn: apis.v1ApiAttentionConversationsCountUsingPost, + onSuccess(data: API.AttentionDataCountResp) { + onSuccess?.(data); + }, + onError(error) { + onError?.(error); + }, + }); + + return response; +} + +/** GetAttentionMessagesCount 获取消息数 POST /llmops/v1/api/attention/messages/count */ +export function useV1ApiAttentionMessagesCountUsingPostMutation(options?: { + onSuccess?: (value?: API.AttentionDataCountResp[]) => void; + onError?: (error?: DefaultError) => void; +}) { + const { onSuccess, onError } = options || {}; + + const response = useMutation({ + mutationFn: apis.v1ApiAttentionMessagesCountUsingPost, + onSuccess(data: API.AttentionDataCountResp[]) { + onSuccess?.(data); + }, + onError(error) { + onError?.(error); + }, + }); + + return response; +} + +/** GetAttentionMessagesHistory 获取聊天历史 GET /llmops/v1/api/attention/messages/history */ +export function v1ApiAttentionMessagesHistoryUsingGetQueryOptions(options: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v1ApiAttentionMessagesHistoryUsingGetParams; + options?: { [key: string]: unknown }; +}) { + return queryOptions({ + queryFn: async ({ queryKey }) => { + return apis.v1ApiAttentionMessagesHistoryUsingGet( + queryKey[1] as typeof options + ); + }, + queryKey: ['v1ApiAttentionMessagesHistoryUsingGet', options], + }); +} + +/** CreateAttentionUser 添加特别关注 POST /llmops/v1/api/attention/user */ +export function useV1ApiAttentionUserUsingPostMutation(options?: { + onSuccess?: (value?: unknown) => void; + onError?: (error?: DefaultError) => void; +}) { + const { onSuccess, onError } = options || {}; + + const response = useMutation({ + mutationFn: apis.v1ApiAttentionUserUsingPost, + onSuccess(data: unknown) { + onSuccess?.(data); + }, + onError(error) { + onError?.(error); + }, + }); + + return response; +} + +/** ListAllUser 系统全局用户列表 GET /llmops/v1/api/attention/user/all */ +export function v1ApiAttentionUserAllUsingGetQueryOptions(options: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v1ApiAttentionUserAllUsingGetParams; + options?: { [key: string]: unknown }; +}) { + return queryOptions({ + queryFn: async ({ queryKey }) => { + return apis.v1ApiAttentionUserAllUsingGet(queryKey[1] as typeof options); + }, + queryKey: ['v1ApiAttentionUserAllUsingGet', options], + }); +} + +/** DeleteAttentionUser 取消特别关注 POST /llmops/v1/api/attention/user/cancel */ +export function useV1ApiAttentionUserCancelUsingPostMutation(options?: { + onSuccess?: (value?: unknown) => void; + onError?: (error?: DefaultError) => void; +}) { + const { onSuccess, onError } = options || {}; + + const response = useMutation({ + mutationFn: apis.v1ApiAttentionUserCancelUsingPost, + onSuccess(data: unknown) { + onSuccess?.(data); + }, + onError(error) { + onError?.(error); + }, + }); + + return response; +} + +/** GetAttentionUserList 查询特别关注列表 POST /llmops/v1/api/attention/user/list */ +export function useV1ApiAttentionUserListUsingPostMutation(options?: { + onSuccess?: (value?: API.ListAttentionUserResp) => void; + onError?: (error?: DefaultError) => void; +}) { + const { onSuccess, onError } = options || {}; + + const response = useMutation({ + mutationFn: apis.v1ApiAttentionUserListUsingPost, + onSuccess(data: API.ListAttentionUserResp) { + onSuccess?.(data); + }, + onError(error) { + onError?.(error); + }, + }); + + return response; +} +/* eslint-disable */ +// @ts-ignore +import { request } from 'axios'; + +import * as API from './types'; + +/** ListAttentionApp 应用列表 GET /llmops/v1/api/attention/app/list */ +export async function v1ApiAttentionAppListUsingGet({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v1ApiAttentionAppListUsingGetParams; + options?: { [key: string]: unknown }; +}) { + return request('/llmops/v1/api/attention/app/list', { + method: 'GET', + params: { + ...params, + }, + ...(options || {}), + }); +} + +/** ListAttentionConversations 查询会话列表 POST /llmops/v1/api/attention/conversations */ +export async function v1ApiAttentionConversationsUsingPost({ + body, + options, +}: { + body: API.ListAttentionConversationReq; + options?: { [key: string]: unknown }; +}) { + return request( + '/llmops/v1/api/attention/conversations', + { + method: 'POST', + data: body, + ...(options || {}), + } + ); +} + +/** GetAttentionConversationCount 获取对话数 POST /llmops/v1/api/attention/conversations/count */ +export async function v1ApiAttentionConversationsCountUsingPost({ + body, + options, +}: { + body: API.GetAttentionDataCountReq; + options?: { [key: string]: unknown }; +}) { + return request( + '/llmops/v1/api/attention/conversations/count', + { + method: 'POST', + data: body, + ...(options || {}), + } + ); +} + +/** GetAttentionMessagesCount 获取消息数 POST /llmops/v1/api/attention/messages/count */ +export async function v1ApiAttentionMessagesCountUsingPost({ + body, + options, +}: { + body: API.GetAttentionDataCountReq; + options?: { [key: string]: unknown }; +}) { + return request( + '/llmops/v1/api/attention/messages/count', + { + method: 'POST', + data: body, + ...(options || {}), + } + ); +} + +/** GetAttentionMessagesHistory 获取聊天历史 GET /llmops/v1/api/attention/messages/history */ +export async function v1ApiAttentionMessagesHistoryUsingGet({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v1ApiAttentionMessagesHistoryUsingGetParams; + options?: { [key: string]: unknown }; +}) { + return request( + '/llmops/v1/api/attention/messages/history', + { + method: 'GET', + params: { + ...params, + }, + ...(options || {}), + } + ); +} + +/** CreateAttentionUser 添加特别关注 POST /llmops/v1/api/attention/user */ +export async function v1ApiAttentionUserUsingPost({ + body, + options, +}: { + body: API.CreateAttentionReq; + options?: { [key: string]: unknown }; +}) { + return request('/llmops/v1/api/attention/user', { + method: 'POST', + data: body, + ...(options || {}), + }); +} + +/** ListAllUser 系统全局用户列表 GET /llmops/v1/api/attention/user/all */ +export async function v1ApiAttentionUserAllUsingGet({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v1ApiAttentionUserAllUsingGetParams; + options?: { [key: string]: unknown }; +}) { + return request( + '/llmops/v1/api/attention/user/all', + { + method: 'GET', + params: { + // size has a default value: 10 + size: '10', + + ...params, + }, + ...(options || {}), + } + ); +} + +/** DeleteAttentionUser 取消特别关注 POST /llmops/v1/api/attention/user/cancel */ +export async function v1ApiAttentionUserCancelUsingPost({ + body, + options, +}: { + body: API.DeleteAttentionReq; + options?: { [key: string]: unknown }; +}) { + return request('/llmops/v1/api/attention/user/cancel', { + method: 'POST', + data: body, + ...(options || {}), + }); +} + +/** GetAttentionUserList 查询特别关注列表 POST /llmops/v1/api/attention/user/list */ +export async function v1ApiAttentionUserListUsingPost({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v1ApiAttentionUserListUsingPostParams; + options?: { [key: string]: unknown }; +}) { + return request( + '/llmops/v1/api/attention/user/list', + { + method: 'POST', + params: { + ...params, + }, + ...(options || {}), + } + ); +} +/* eslint-disable */ +// @ts-ignore +import { queryOptions, useMutation } from '@tanstack/react-query'; +import type { DefaultError } from '@tanstack/react-query'; +import { request } from 'axios'; + +import * as apis from './authorize'; +import * as API from './types'; + +/** Authorize 获取code的跳转 GET /llmops/auth/authorize */ +export function authAuthorizeUsingGetQueryOptions(options: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.authAuthorizeUsingGetParams; + options?: { [key: string]: unknown }; +}) { + return queryOptions({ + queryFn: async ({ queryKey }) => { + return apis.authAuthorizeUsingGet(queryKey[1] as typeof options); + }, + queryKey: ['authAuthorizeUsingGet', options], + }); +} +/* eslint-disable */ +// @ts-ignore +import { request } from 'axios'; + +import * as API from './types'; + +/** Authorize 获取code的跳转 GET /llmops/auth/authorize */ +export async function authAuthorizeUsingGet({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.authAuthorizeUsingGetParams; + options?: { [key: string]: unknown }; +}) { + return request('/llmops/auth/authorize', { + method: 'GET', + params: { + ...params, + }, + ...(options || {}), + }); +} +/* eslint-disable */ +// @ts-ignore +import { queryOptions, useMutation } from '@tanstack/react-query'; +import type { DefaultError } from '@tanstack/react-query'; +import { request } from 'axios'; + +import * as apis from './chat'; +import * as API from './types'; + +/** Messages Messages POST /llmops/v1/api/chat-messages */ +export function useV1ApiChatMessagesUsingPostMutation(options?: { + onSuccess?: (value?: API.ResponseData) => void; + onError?: (error?: DefaultError) => void; +}) { + const { onSuccess, onError } = options || {}; + + const response = useMutation({ + mutationFn: apis.v1ApiChatMessagesUsingPost, + onSuccess(data: API.ResponseData) { + onSuccess?.(data); + }, + onError(error) { + onError?.(error); + }, + }); + + return response; +} + +/** WebMessages 分享页的聊天 POST /llmops/v1/api/chat-messages-web */ +export function useV1ApiChatMessagesWebUsingPostMutation(options?: { + onSuccess?: (value?: API.ResponseData) => void; + onError?: (error?: DefaultError) => void; +}) { + const { onSuccess, onError } = options || {}; + + const response = useMutation({ + mutationFn: apis.v1ApiChatMessagesWebUsingPost, + onSuccess(data: API.ResponseData) { + onSuccess?.(data); + }, + onError(error) { + onError?.(error); + }, + }); + + return response; +} + +/** ChatMessage ChatMessage POST /llmops/v1/api/chat-messages/gpt */ +export function useV1ApiChatMessagesGptUsingPostMutation(options?: { + onSuccess?: (value?: API.ResponseRecommendData) => void; + onError?: (error?: DefaultError) => void; +}) { + const { onSuccess, onError } = options || {}; + + const response = useMutation({ + mutationFn: apis.v1ApiChatMessagesGptUsingPost, + onSuccess(data: API.ResponseRecommendData) { + onSuccess?.(data); + }, + onError(error) { + onError?.(error); + }, + }); + + return response; +} + +/** QuestionRecommend QuestionRecommend POST /llmops/v1/api/chat-messages/question-recommend */ +export function useV1ApiChatMessagesQuestionRecommendUsingPostMutation(options?: { + onSuccess?: (value?: API.RecommendQuestionAndContext) => void; + onError?: (error?: DefaultError) => void; +}) { + const { onSuccess, onError } = options || {}; + + const response = useMutation({ + mutationFn: apis.v1ApiChatMessagesQuestionRecommendUsingPost, + onSuccess(data: API.RecommendQuestionAndContext) { + onSuccess?.(data); + }, + onError(error) { + onError?.(error); + }, + }); + + return response; +} + +/** V2Messages 用于微精灵聊天的v2版本 POST /llmops/v2/api/chat-messages */ +export function useV2ApiChatMessagesUsingPostMutation(options?: { + onSuccess?: (value?: API.ResponseData) => void; + onError?: (error?: DefaultError) => void; +}) { + const { onSuccess, onError } = options || {}; + + const response = useMutation({ + mutationFn: apis.v2ApiChatMessagesUsingPost, + onSuccess(data: API.ResponseData) { + onSuccess?.(data); + }, + onError(error) { + onError?.(error); + }, + }); + + return response; +} +/* eslint-disable */ +// @ts-ignore +import { request } from 'axios'; + +import * as API from './types'; + +/** Messages Messages POST /llmops/v1/api/chat-messages */ +export async function v1ApiChatMessagesUsingPost({ + body, + options, +}: { + body: API.Chat; + options?: { [key: string]: unknown }; +}) { + return request('/llmops/v1/api/chat-messages', { + method: 'POST', + headers: { + 'Content-Type': 'application/json', + }, + data: body, + ...(options || {}), + }); +} + +/** WebMessages 分享页的聊天 POST /llmops/v1/api/chat-messages-web */ +export async function v1ApiChatMessagesWebUsingPost({ + body, + options, +}: { + body: API.Chat; + options?: { [key: string]: unknown }; +}) { + return request('/llmops/v1/api/chat-messages-web', { + method: 'POST', + headers: { + 'Content-Type': 'application/json', + }, + data: body, + ...(options || {}), + }); +} + +/** ChatMessage ChatMessage POST /llmops/v1/api/chat-messages/gpt */ +export async function v1ApiChatMessagesGptUsingPost({ + body, + options, +}: { + body: API.ChatMessageReq; + options?: { [key: string]: unknown }; +}) { + return request( + '/llmops/v1/api/chat-messages/gpt', + { + method: 'POST', + headers: { + 'Content-Type': 'application/json', + }, + data: body, + ...(options || {}), + } + ); +} + +/** QuestionRecommend QuestionRecommend POST /llmops/v1/api/chat-messages/question-recommend */ +export async function v1ApiChatMessagesQuestionRecommendUsingPost({ + body, + options, +}: { + body: API.QuestionRecommendReq; + options?: { [key: string]: unknown }; +}) { + return request( + '/llmops/v1/api/chat-messages/question-recommend', + { + method: 'POST', + headers: { + 'Content-Type': 'application/json', + }, + data: body, + ...(options || {}), + } + ); +} + +/** V2Messages 用于微精灵聊天的v2版本 POST /llmops/v2/api/chat-messages */ +export async function v2ApiChatMessagesUsingPost({ + body, + options, +}: { + body: API.Chat; + options?: { [key: string]: unknown }; +}) { + return request('/llmops/v2/api/chat-messages', { + method: 'POST', + headers: { + 'Content-Type': 'application/json', + }, + data: body, + ...(options || {}), + }); +} +/* eslint-disable */ +// @ts-ignore +import { queryOptions, useMutation } from '@tanstack/react-query'; +import type { DefaultError } from '@tanstack/react-query'; +import { request } from 'axios'; + +import * as apis from './conversation'; +import * as API from './types'; + +/** ConversationList 会话历史 GET /llmops/v1/api/conversations */ +export function v1ApiConversationsUsingGetQueryOptions(options: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v1ApiConversationsUsingGetParams; + options?: { [key: string]: unknown }; +}) { + return queryOptions({ + queryFn: async ({ queryKey }) => { + return apis.v1ApiConversationsUsingGet(queryKey[1] as typeof options); + }, + queryKey: ['v1ApiConversationsUsingGet', options], + }); +} + +/** DeleteConversation 删除会话 DELETE /llmops/v1/api/conversations */ +export function useV1ApiConversationsUsingDeleteMutation(options?: { + onSuccess?: (value?: API.DeleteResp) => void; + onError?: (error?: DefaultError) => void; +}) { + const { onSuccess, onError } = options || {}; + + const response = useMutation({ + mutationFn: apis.v1ApiConversationsUsingDelete, + onSuccess(data: API.DeleteResp) { + onSuccess?.(data); + }, + onError(error) { + onError?.(error); + }, + }); + + return response; +} +/* eslint-disable */ +// @ts-ignore +import { request } from 'axios'; + +import * as API from './types'; + +/** ConversationList 会话历史 GET /llmops/v1/api/conversations */ +export async function v1ApiConversationsUsingGet({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v1ApiConversationsUsingGetParams; + options?: { [key: string]: unknown }; +}) { + return request('/llmops/v1/api/conversations', { + method: 'GET', + params: { + ...params, + }, + ...(options || {}), + }); +} + +/** DeleteConversation 删除会话 DELETE /llmops/v1/api/conversations */ +export async function v1ApiConversationsUsingDelete({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v1ApiConversationsUsingDeleteParams; + options?: { [key: string]: unknown }; +}) { + return request('/llmops/v1/api/conversations', { + method: 'DELETE', + params: { + ...params, + }, + ...(options || {}), + }); +} +/* eslint-disable */ +// @ts-ignore +import { queryOptions, useMutation } from '@tanstack/react-query'; +import type { DefaultError } from '@tanstack/react-query'; +import { request } from 'axios'; + +import * as apis from './createFeedbacks'; +import * as API from './types'; + +/** CreateFeedbacks CreateFeedbacks POST /llmops/v1/api/feedbacks/${param0} */ +export function useV1ApiFeedbacksMessageIdUsingPostMutation(options?: { + onSuccess?: (value?: API.CreateFeedbacksResp) => void; + onError?: (error?: DefaultError) => void; +}) { + const { onSuccess, onError } = options || {}; + + const response = useMutation({ + mutationFn: apis.v1ApiFeedbacksMessageIdUsingPost, + onSuccess(data: API.CreateFeedbacksResp) { + onSuccess?.(data); + }, + onError(error) { + onError?.(error); + }, + }); + + return response; +} +/* eslint-disable */ +// @ts-ignore +import { request } from 'axios'; + +import * as API from './types'; + +/** CreateFeedbacks CreateFeedbacks POST /llmops/v1/api/feedbacks/${param0} */ +export async function v1ApiFeedbacksMessageIdUsingPost({ + params, + body, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v1ApiFeedbacksMessageIdUsingPostParams; + body: API.FeedbacksReqBody; + options?: { [key: string]: unknown }; +}) { + const { message_id: param0, ...queryParams } = params; + + return request( + `/llmops/v1/api/feedbacks/${param0}`, + { + method: 'POST', + headers: { + 'Content-Type': 'application/json', + }, + params: { ...queryParams }, + data: body, + ...(options || {}), + } + ); +} +/* eslint-disable */ +// @ts-ignore +import { queryOptions, useMutation } from '@tanstack/react-query'; +import type { DefaultError } from '@tanstack/react-query'; +import { request } from 'axios'; + +import * as apis from './datasetsJoin'; +import * as API from './types'; + +/** CreateDatasetsJoin 创建 app 数据集关联 POST /llmops/v1/api/app/${param0}/datasets */ +export function useV1ApiAppAppIdDatasetsUsingPostMutation(options?: { + onSuccess?: (value?: unknown) => void; + onError?: (error?: DefaultError) => void; +}) { + const { onSuccess, onError } = options || {}; + + const response = useMutation({ + mutationFn: apis.v1ApiAppAppIdDatasetsUsingPost, + onSuccess(data: unknown) { + onSuccess?.(data); + }, + onError(error) { + onError?.(error); + }, + }); + + return response; +} + +/** DeleteDatasetsJoin 删除 app 数据集关联 DELETE /llmops/v1/api/app/${param0}/datasets */ +export function useV1ApiAppAppIdDatasetsUsingDeleteMutation(options?: { + onSuccess?: (value?: API.DeleteResp) => void; + onError?: (error?: DefaultError) => void; +}) { + const { onSuccess, onError } = options || {}; + + const response = useMutation({ + mutationFn: apis.v1ApiAppAppIdDatasetsUsingDelete, + onSuccess(data: API.DeleteResp) { + onSuccess?.(data); + }, + onError(error) { + onError?.(error); + }, + }); + + return response; +} +/* eslint-disable */ +// @ts-ignore +import { request } from 'axios'; + +import * as API from './types'; + +/** CreateDatasetsJoin 创建 app 数据集关联 POST /llmops/v1/api/app/${param0}/datasets */ +export async function v1ApiAppAppIdDatasetsUsingPost({ + params, + body, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v1ApiAppAppIdDatasetsUsingPostParams; + body: API.V1ApiAppAppIdDatasetsUsingPostBody; + options?: { [key: string]: unknown }; +}) { + const { appID: param0, ...queryParams } = params; + + return request(`/llmops/v1/api/app/${param0}/datasets`, { + method: 'POST', + params: { ...queryParams }, + data: body, + ...(options || {}), + }); +} + +/** DeleteDatasetsJoin 删除 app 数据集关联 DELETE /llmops/v1/api/app/${param0}/datasets */ +export async function v1ApiAppAppIdDatasetsUsingDelete({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v1ApiAppAppIdDatasetsUsingDeleteParams; + options?: { [key: string]: unknown }; +}) { + const { appID: param0, ...queryParams } = params; + + return request(`/llmops/v1/api/app/${param0}/datasets`, { + method: 'DELETE', + params: { + ...queryParams, + }, + ...(options || {}), + }); +} +/* eslint-disable */ +// @ts-ignore +import { queryOptions, useMutation } from '@tanstack/react-query'; +import type { DefaultError } from '@tanstack/react-query'; +import { request } from 'axios'; + +import * as apis from './datasetsList'; +import * as API from './types'; + +/** GetDatasetsList 数据集列表 GET /llmops/v1/api/app/${param0}/datasets-list */ +export function v1ApiAppAppIdDatasetsListUsingGetQueryOptions(options: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v1ApiAppAppIdDatasetsListUsingGetParams; + options?: { [key: string]: unknown }; +}) { + return queryOptions({ + queryFn: async ({ queryKey }) => { + return apis.v1ApiAppAppIdDatasetsListUsingGet( + queryKey[1] as typeof options + ); + }, + queryKey: ['v1ApiAppAppIdDatasetsListUsingGet', options], + }); +} +/* eslint-disable */ +// @ts-ignore +import { request } from 'axios'; + +import * as API from './types'; + +/** GetDatasetsList 数据集列表 GET /llmops/v1/api/app/${param0}/datasets-list */ +export async function v1ApiAppAppIdDatasetsListUsingGet({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v1ApiAppAppIdDatasetsListUsingGetParams; + options?: { [key: string]: unknown }; +}) { + const { appID: param0, ...queryParams } = params; + + return request( + `/llmops/v1/api/app/${param0}/datasets-list`, + { + method: 'GET', + params: { + ...queryParams, + }, + ...(options || {}), + } + ); +} +/* eslint-disable */ +// @ts-ignore +import { queryOptions, useMutation } from '@tanstack/react-query'; +import type { DefaultError } from '@tanstack/react-query'; +import { request } from 'axios'; + +import * as apis from './deleteFeedbacks'; +import * as API from './types'; + +/** DeleteFeedbacks DeleteFeedbacks DELETE /llmops/v1/api/feedbacks/${param0} */ +export function useV1ApiFeedbacksMessageIdUsingDeleteMutation(options?: { + onSuccess?: (value?: API.DeleteFeedbacksResp) => void; + onError?: (error?: DefaultError) => void; +}) { + const { onSuccess, onError } = options || {}; + + const response = useMutation({ + mutationFn: apis.v1ApiFeedbacksMessageIdUsingDelete, + onSuccess(data: API.DeleteFeedbacksResp) { + onSuccess?.(data); + }, + onError(error) { + onError?.(error); + }, + }); + + return response; +} +/* eslint-disable */ +// @ts-ignore +import { request } from 'axios'; + +import * as API from './types'; + +/** DeleteFeedbacks DeleteFeedbacks DELETE /llmops/v1/api/feedbacks/${param0} */ +export async function v1ApiFeedbacksMessageIdUsingDelete({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v1ApiFeedbacksMessageIdUsingDeleteParams; + options?: { [key: string]: unknown }; +}) { + const { message_id: param0, ...queryParams } = params; + + return request( + `/llmops/v1/api/feedbacks/${param0}`, + { + method: 'DELETE', + params: { + ...queryParams, + }, + ...(options || {}), + } + ); +} +/* eslint-disable */ +// @ts-ignore +import { queryOptions, useMutation } from '@tanstack/react-query'; +import type { DefaultError } from '@tanstack/react-query'; +import { request } from 'axios'; + +import * as apis from './deleteKey'; +import * as API from './types'; + +/** DeleteKey 为应用添加各种类型机器人appkey DELETE /llmops/v1/api/robot/${param0}/appkey */ +export function useV1ApiRobotWorkspaceIdAppkeyUsingDeleteMutation(options?: { + onSuccess?: (value?: unknown) => void; + onError?: (error?: DefaultError) => void; +}) { + const { onSuccess, onError } = options || {}; + + const response = useMutation({ + mutationFn: apis.v1ApiRobotWorkspaceIdAppkeyUsingDelete, + onSuccess(data: unknown) { + onSuccess?.(data); + }, + onError(error) { + onError?.(error); + }, + }); + + return response; +} +/* eslint-disable */ +// @ts-ignore +import { request } from 'axios'; + +import * as API from './types'; + +/** DeleteKey 为应用添加各种类型机器人appkey DELETE /llmops/v1/api/robot/${param0}/appkey */ +export async function v1ApiRobotWorkspaceIdAppkeyUsingDelete({ + params, + body, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v1ApiRobotWorkspaceIdAppkeyUsingDeleteParams; + body: API.GetAppKeyReq; + options?: { [key: string]: unknown }; +}) { + const { workspaceID: param0, ...queryParams } = params; + + return request(`/llmops/v1/api/robot/${param0}/appkey`, { + method: 'DELETE', + params: { ...queryParams }, + data: body, + ...(options || {}), + }); +} +/* eslint-disable */ +// @ts-ignore +import * as API from './types'; + +export function displayPermissionEnum(field: API.Permission) { + return { + read_only: '只读权限', + operation: '操作权限', + no_permission: '无权限', + }[field]; +} + +export function displayProviderTypeEnum(field: API.ProviderType) { + return { + openai: 'openai', + spark: 'spark', + wenxin: 'wenxin', + rockai: 'rockai', + }[field]; +} + +export function displayRbacRoleEnum(field: API.RbacRole) { + return { + system_admin: '系统管理员', + system_user: '系统普通用户', + app_admin: 'app超管用户', + app_user: 'app普通用户', + }[field]; +} + +export function displayWorkspaceRoleEnum(field: API.WorkspaceRole) { + return { workspace_admin: '空间超管用户', workspace_user: '空间普通用户' }[ + field + ]; +} +/* eslint-disable */ +// @ts-ignore +import { queryOptions, useMutation } from '@tanstack/react-query'; +import type { DefaultError } from '@tanstack/react-query'; +import { request } from 'axios'; + +import * as apis from './exchange'; +import * as API from './types'; + +/** Exchange 换取token GET /llmops/auth/exchange */ +export function authExchangeUsingGetQueryOptions(options: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.authExchangeUsingGetParams; + options?: { [key: string]: unknown }; +}) { + return queryOptions({ + queryFn: async ({ queryKey }) => { + return apis.authExchangeUsingGet(queryKey[1] as typeof options); + }, + queryKey: ['authExchangeUsingGet', options], + }); +} +/* eslint-disable */ +// @ts-ignore +import { request } from 'axios'; + +import * as API from './types'; + +/** Exchange 换取token GET /llmops/auth/exchange */ +export async function authExchangeUsingGet({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.authExchangeUsingGetParams; + options?: { [key: string]: unknown }; +}) { + return request('/llmops/auth/exchange', { + method: 'GET', + params: { + ...params, + }, + ...(options || {}), + }); +} +/* eslint-disable */ +// @ts-ignore +import { queryOptions, useMutation } from '@tanstack/react-query'; +import type { DefaultError } from '@tanstack/react-query'; +import { request } from 'axios'; + +import * as apis from './files'; +import * as API from './types'; + +/** Filestream 上传文件 POST /llmops/v1/api/file */ +export function useV1ApiFileUsingPostMutation(options?: { + onSuccess?: (value?: API.FilestreamResp) => void; + onError?: (error?: DefaultError) => void; +}) { + const { onSuccess, onError } = options || {}; + + const response = useMutation({ + mutationFn: apis.v1ApiFileUsingPost, + onSuccess(data: API.FilestreamResp) { + onSuccess?.(data); + }, + onError(error) { + onError?.(error); + }, + }); + + return response; +} + +/** SpeechToText 语音转文字 POST /llmops/v1/api/speech_to_text */ +export function useV1ApiSpeechToTextUsingPostMutation(options?: { + onSuccess?: (value?: API.SpeechToTextResp) => void; + onError?: (error?: DefaultError) => void; +}) { + const { onSuccess, onError } = options || {}; + + const response = useMutation({ + mutationFn: apis.v1ApiSpeechToTextUsingPost, + onSuccess(data: API.SpeechToTextResp) { + onSuccess?.(data); + }, + onError(error) { + onError?.(error); + }, + }); + + return response; +} + +/** TextToSpeech 文字转语音 POST /llmops/v1/api/text_to_speech */ +export function useV1ApiTextToSpeechUsingPostMutation(options?: { + onSuccess?: (value?: unknown) => void; + onError?: (error?: DefaultError) => void; +}) { + const { onSuccess, onError } = options || {}; + + const response = useMutation({ + mutationFn: apis.v1ApiTextToSpeechUsingPost, + onSuccess(data: unknown) { + onSuccess?.(data); + }, + onError(error) { + onError?.(error); + }, + }); + + return response; +} + +/** 上传文件V2接口 上传文件V2接口用于向服务器提交文件。 POST /llmops/v2/api/file */ +export function useV2ApiFileUsingPostMutation(options?: { + onSuccess?: (value?: API.FilestreamResp) => void; + onError?: (error?: DefaultError) => void; +}) { + const { onSuccess, onError } = options || {}; + + const response = useMutation({ + mutationFn: apis.v2ApiFileUsingPost, + onSuccess(data: API.FilestreamResp) { + onSuccess?.(data); + }, + onError(error) { + onError?.(error); + }, + }); + + return response; +} +/* eslint-disable */ +// @ts-ignore +import { request } from 'axios'; + +import * as API from './types'; + +/** Filestream 上传文件 POST /llmops/v1/api/file */ +export async function v1ApiFileUsingPost({ + params, + body, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v1ApiFileUsingPostParams; + body: API.V1ApiFileUsingPostBody; + options?: { [key: string]: unknown }; +}) { + return request('/llmops/v1/api/file', { + method: 'POST', + headers: { + 'Content-Type': 'application/json', + }, + params: { + ...params, + }, + data: body, + ...(options || {}), + }); +} + +/** SpeechToText 语音转文字 POST /llmops/v1/api/speech_to_text */ +export async function v1ApiSpeechToTextUsingPost({ + body, + options, +}: { + body: API.V1ApiSpeechToTextUsingPostBody; + options?: { [key: string]: unknown }; +}) { + return request('/llmops/v1/api/speech_to_text', { + method: 'POST', + headers: { + 'Content-Type': 'application/json', + }, + data: body, + ...(options || {}), + }); +} + +/** TextToSpeech 文字转语音 POST /llmops/v1/api/text_to_speech */ +export async function v1ApiTextToSpeechUsingPost({ + body, + options, +}: { + body: API.TextToSpeechReq; + options?: { [key: string]: unknown }; +}) { + return request('/llmops/v1/api/text_to_speech', { + method: 'POST', + headers: { + 'Content-Type': 'application/json', + }, + data: body, + ...(options || {}), + }); +} + +/** 上传文件V2接口 上传文件V2接口用于向服务器提交文件。 POST /llmops/v2/api/file */ +export async function v2ApiFileUsingPost({ + params, + body, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v2ApiFileUsingPostParams; + body: API.V2ApiFileUsingPostBody; + options?: { [key: string]: unknown }; +}) { + const formData = new FormData(); + + Object.keys(body).forEach((ele) => { + const item = (body as { [key: string]: any })[ele]; + + if (item !== undefined && item !== null) { + if (typeof item === 'object' && !(item instanceof File)) { + if (item instanceof Array) { + item.forEach((f) => formData.append(ele, f || '')); + } else { + formData.append(ele, JSON.stringify(item)); + } + } else { + formData.append(ele, item); + } + } + }); + + return request('/llmops/v2/api/file', { + method: 'POST', + headers: { + 'Content-Type': 'multipart/form-data', + }, + params: { + ...params, + }, + data: formData, + ...(options || {}), + }); +} +/* eslint-disable */ +// @ts-ignore +import { queryOptions, useMutation } from '@tanstack/react-query'; +import type { DefaultError } from '@tanstack/react-query'; +import { request } from 'axios'; + +import * as apis from './getAppKey'; +import * as API from './types'; + +/** GetAppKey 为应用获取各种类型机器人appkey GET /llmops/v1/api/robot/${param0}/appkey */ +export function v1ApiRobotWorkspaceIdAppkeyUsingGetQueryOptions(options: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v1ApiRobotWorkspaceIdAppkeyUsingGetParams; + options?: { [key: string]: unknown }; +}) { + return queryOptions({ + queryFn: async ({ queryKey }) => { + return apis.v1ApiRobotWorkspaceIdAppkeyUsingGet( + queryKey[1] as typeof options + ); + }, + queryKey: ['v1ApiRobotWorkspaceIdAppkeyUsingGet', options], + }); +} +/* eslint-disable */ +// @ts-ignore +import { request } from 'axios'; + +import * as API from './types'; + +/** GetAppKey 为应用获取各种类型机器人appkey GET /llmops/v1/api/robot/${param0}/appkey */ +export async function v1ApiRobotWorkspaceIdAppkeyUsingGet({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v1ApiRobotWorkspaceIdAppkeyUsingGetParams; + options?: { [key: string]: unknown }; +}) { + const { workspaceID: param0, ...queryParams } = params; + + return request(`/llmops/v1/api/robot/${param0}/appkey`, { + method: 'GET', + params: { + ...queryParams, + }, + ...(options || {}), + }); +} +/* eslint-disable */ +// @ts-ignore +import { queryOptions, useMutation } from '@tanstack/react-query'; +import type { DefaultError } from '@tanstack/react-query'; +import { request } from 'axios'; + +import * as apis from './history'; +import * as API from './types'; + +/** History 会话历史 GET /llmops/v1/api/conversations/${param0}/history */ +export function v1ApiConversationsConversationIdHistoryUsingGetQueryOptions(options: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v1ApiConversationsConversationIdHistoryUsingGetParams; + options?: { [key: string]: unknown }; +}) { + return queryOptions({ + queryFn: async ({ queryKey }) => { + return apis.v1ApiConversationsConversationIdHistoryUsingGet( + queryKey[1] as typeof options + ); + }, + queryKey: ['v1ApiConversationsConversationIdHistoryUsingGet', options], + }); +} + +/** DeleteHistory 会话历史 DELETE /llmops/v1/api/conversations/${param0}/history */ +export function useV1ApiConversationsConversationIdHistoryUsingDeleteMutation(options?: { + onSuccess?: (value?: API.DeleteResp) => void; + onError?: (error?: DefaultError) => void; +}) { + const { onSuccess, onError } = options || {}; + + const response = useMutation({ + mutationFn: apis.v1ApiConversationsConversationIdHistoryUsingDelete, + onSuccess(data: API.DeleteResp) { + onSuccess?.(data); + }, + onError(error) { + onError?.(error); + }, + }); + + return response; +} + +/** GetMessageCount 用于微精灵获取消息数的v2版本 GET /llmops/v2/api/chat-messages/messagesCount */ +export function v2ApiChatMessagesMessagesCountUsingGetQueryOptions(options: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v2ApiChatMessagesMessagesCountUsingGetParams; + options?: { [key: string]: unknown }; +}) { + return queryOptions({ + queryFn: async ({ queryKey }) => { + return apis.v2ApiChatMessagesMessagesCountUsingGet( + queryKey[1] as typeof options + ); + }, + queryKey: ['v2ApiChatMessagesMessagesCountUsingGet', options], + }); +} +/* eslint-disable */ +// @ts-ignore +import { request } from 'axios'; + +import * as API from './types'; + +/** History 会话历史 GET /llmops/v1/api/conversations/${param0}/history */ +export async function v1ApiConversationsConversationIdHistoryUsingGet({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v1ApiConversationsConversationIdHistoryUsingGetParams; + options?: { [key: string]: unknown }; +}) { + const { conversation_id: param0, ...queryParams } = params; + + return request( + `/llmops/v1/api/conversations/${param0}/history`, + { + method: 'GET', + params: { ...queryParams }, + ...(options || {}), + } + ); +} + +/** DeleteHistory 会话历史 DELETE /llmops/v1/api/conversations/${param0}/history */ +export async function v1ApiConversationsConversationIdHistoryUsingDelete({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v1ApiConversationsConversationIdHistoryUsingDeleteParams; + options?: { [key: string]: unknown }; +}) { + const { conversation_id: param0, ...queryParams } = params; + + return request( + `/llmops/v1/api/conversations/${param0}/history`, + { + method: 'DELETE', + params: { + ...queryParams, + }, + ...(options || {}), + } + ); +} + +/** GetMessageCount 用于微精灵获取消息数的v2版本 GET /llmops/v2/api/chat-messages/messagesCount */ +export async function v2ApiChatMessagesMessagesCountUsingGet({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v2ApiChatMessagesMessagesCountUsingGetParams; + options?: { [key: string]: unknown }; +}) { + return request( + '/llmops/v2/api/chat-messages/messagesCount', + { + method: 'GET', + params: { + ...params, + }, + ...(options || {}), + } + ); +} +/* eslint-disable */ +// @ts-ignore +import { queryOptions, useMutation } from '@tanstack/react-query'; +import type { DefaultError } from '@tanstack/react-query'; +import { request } from 'axios'; + +import * as apis from './iam'; +import * as API from './types'; + +/** GetIamUserId 查询 IAM 用户信息 GET /llmops/v1/api/iamAccount */ +export function v1ApiIamAccountUsingGetQueryOptions(options: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v1ApiIamAccountUsingGetParams; + options?: { [key: string]: unknown }; +}) { + return queryOptions({ + queryFn: async ({ queryKey }) => { + return apis.v1ApiIamAccountUsingGet(queryKey[1] as typeof options); + }, + queryKey: ['v1ApiIamAccountUsingGet', options], + }); +} +/* eslint-disable */ +// @ts-ignore +import { request } from 'axios'; + +import * as API from './types'; + +/** GetIamUserId 查询 IAM 用户信息 GET /llmops/v1/api/iamAccount */ +export async function v1ApiIamAccountUsingGet({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v1ApiIamAccountUsingGetParams; + options?: { [key: string]: unknown }; +}) { + return request('/llmops/v1/api/iamAccount', { + method: 'GET', + params: { + ...params, + }, + ...(options || {}), + }); +} +/* eslint-disable */ +// @ts-ignore +export * from './types'; +export * from './displayEnumLabel'; + +export * from './authorize'; +export * from './authorize.reactquery'; +export * from './exchange'; +export * from './exchange.reactquery'; +export * from './refreshToken'; +export * from './refreshToken.reactquery'; +export * from './app'; +export * from './app.reactquery'; +export * from './share'; +export * from './share.reactquery'; +export * from './apiToken'; +export * from './apiToken.reactquery'; +export * from './appDatasetConfigs'; +export * from './appDatasetConfigs.reactquery'; +export * from './datasetsJoin'; +export * from './datasetsJoin.reactquery'; +export * from './datasetsList'; +export * from './datasetsList.reactquery'; +export * from './appMember'; +export * from './appMember.reactquery'; +export * from './appModelConfigs'; +export * from './appModelConfigs.reactquery'; +export * from './recommended'; +export * from './recommended.reactquery'; +export * from './attention'; +export * from './attention.reactquery'; +export * from './chat'; +export * from './chat.reactquery'; +export * from './conversation'; +export * from './conversation.reactquery'; +export * from './history'; +export * from './history.reactquery'; +export * from './listFeedbacks'; +export * from './listFeedbacks.reactquery'; +export * from './createFeedbacks'; +export * from './createFeedbacks.reactquery'; +export * from './deleteFeedbacks'; +export * from './deleteFeedbacks.reactquery'; +export * from './files'; +export * from './files.reactquery'; +export * from './iam'; +export * from './iam.reactquery'; +export * from './provider'; +export * from './provider.reactquery'; +export * from './getAppKey'; +export * from './getAppKey.reactquery'; +export * from './addAppKey'; +export * from './addAppKey.reactquery'; +export * from './deleteKey'; +export * from './deleteKey.reactquery'; +export * from './updateAppKeyState'; +export * from './updateAppKeyState.reactquery'; +export * from './user'; +export * from './user.reactquery'; +export * from './appV2'; +export * from './appV2.reactquery'; +export * from './workspaceAppV2'; +export * from './workspaceAppV2.reactquery'; +export * from './workspace'; +export * from './workspace.reactquery'; +export * from './workspaceGroup'; +export * from './workspaceGroup.reactquery'; +/* eslint-disable */ +// @ts-ignore +import { queryOptions, useMutation } from '@tanstack/react-query'; +import type { DefaultError } from '@tanstack/react-query'; +import { request } from 'axios'; + +import * as apis from './listFeedbacks'; +import * as API from './types'; + +/** ListFeedbacks ListFeedbacks GET /llmops/v1/api/feedbacks/ */ +export function v1ApiFeedbacksUsingGetQueryOptions(options: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v1ApiFeedbacksUsingGetParams; + options?: { [key: string]: unknown }; +}) { + return queryOptions({ + queryFn: async ({ queryKey }) => { + return apis.v1ApiFeedbacksUsingGet(queryKey[1] as typeof options); + }, + queryKey: ['v1ApiFeedbacksUsingGet', options], + }); +} +/* eslint-disable */ +// @ts-ignore +import { request } from 'axios'; + +import * as API from './types'; + +/** ListFeedbacks ListFeedbacks GET /llmops/v1/api/feedbacks/ */ +export async function v1ApiFeedbacksUsingGet({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v1ApiFeedbacksUsingGetParams; + options?: { [key: string]: unknown }; +}) { + return request('/llmops/v1/api/feedbacks/', { + method: 'GET', + params: { + ...params, + }, + ...(options || {}), + }); +} +/* eslint-disable */ +// @ts-ignore +import { queryOptions, useMutation } from '@tanstack/react-query'; +import type { DefaultError } from '@tanstack/react-query'; +import { request } from 'axios'; + +import * as apis from './provider'; +import * as API from './types'; + +/** ListProviders 查询 Provider 列表 GET /llmops/v1/api/provider/list */ +export function v1ApiProviderListUsingGetQueryOptions(options: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v1ApiProviderListUsingGetParams; + options?: { [key: string]: unknown }; +}) { + return queryOptions({ + queryFn: async ({ queryKey }) => { + return apis.v1ApiProviderListUsingGet(queryKey[1] as typeof options); + }, + queryKey: ['v1ApiProviderListUsingGet', options], + }); +} +/* eslint-disable */ +// @ts-ignore +import { request } from 'axios'; + +import * as API from './types'; + +/** ListProviders 查询 Provider 列表 GET /llmops/v1/api/provider/list */ +export async function v1ApiProviderListUsingGet({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v1ApiProviderListUsingGetParams; + options?: { [key: string]: unknown }; +}) { + return request('/llmops/v1/api/provider/list', { + method: 'GET', + params: { + ...params, + }, + ...(options || {}), + }); +} +/* eslint-disable */ +// @ts-ignore +import { queryOptions, useMutation } from '@tanstack/react-query'; +import type { DefaultError } from '@tanstack/react-query'; +import { request } from 'axios'; + +import * as apis from './recommended'; +import * as API from './types'; + +/** ListRecommendedContext 查询推荐内容列表 GET /llmops/v1/api/app/${param0}/recommended/context */ +export function v1ApiAppAppIdRecommendedContextUsingGetQueryOptions(options: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v1ApiAppAppIdRecommendedContextUsingGetParams; + options?: { [key: string]: unknown }; +}) { + return queryOptions({ + queryFn: async ({ queryKey }) => { + return apis.v1ApiAppAppIdRecommendedContextUsingGet( + queryKey[1] as typeof options + ); + }, + queryKey: ['v1ApiAppAppIdRecommendedContextUsingGet', options], + }); +} + +/** CreateOrUpdateRecommendedContext 创建或更新推荐内容列表 POST /llmops/v1/api/app/${param0}/recommended/context */ +export function useV1ApiAppAppIdRecommendedContextUsingPostMutation(options?: { + onSuccess?: (value?: unknown) => void; + onError?: (error?: DefaultError) => void; +}) { + const { onSuccess, onError } = options || {}; + + const response = useMutation({ + mutationFn: apis.v1ApiAppAppIdRecommendedContextUsingPost, + onSuccess(data: unknown) { + onSuccess?.(data); + }, + onError(error) { + onError?.(error); + }, + }); + + return response; +} +/* eslint-disable */ +// @ts-ignore +import { request } from 'axios'; + +import * as API from './types'; + +/** ListRecommendedContext 查询推荐内容列表 GET /llmops/v1/api/app/${param0}/recommended/context */ +export async function v1ApiAppAppIdRecommendedContextUsingGet({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v1ApiAppAppIdRecommendedContextUsingGetParams; + options?: { [key: string]: unknown }; +}) { + const { appID: param0, ...queryParams } = params; + + return request( + `/llmops/v1/api/app/${param0}/recommended/context`, + { + method: 'GET', + params: { ...queryParams }, + ...(options || {}), + } + ); +} + +/** CreateOrUpdateRecommendedContext 创建或更新推荐内容列表 POST /llmops/v1/api/app/${param0}/recommended/context */ +export async function v1ApiAppAppIdRecommendedContextUsingPost({ + params, + body, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v1ApiAppAppIdRecommendedContextUsingPostParams; + body: API.AppRecommendedContext; + options?: { [key: string]: unknown }; +}) { + const { appID: param0, ...queryParams } = params; + + return request(`/llmops/v1/api/app/${param0}/recommended/context`, { + method: 'POST', + params: { ...queryParams }, + data: body, + ...(options || {}), + }); +} +/* eslint-disable */ +// @ts-ignore +import { queryOptions, useMutation } from '@tanstack/react-query'; +import type { DefaultError } from '@tanstack/react-query'; +import { request } from 'axios'; + +import * as apis from './refreshToken'; +import * as API from './types'; + +/** RefreshToken 刷新token POST /llmops/auth/refresh-token */ +export function useAuthRefreshTokenUsingPostMutation(options?: { + onSuccess?: (value?: API.ExchangeTokenRESP) => void; + onError?: (error?: DefaultError) => void; +}) { + const { onSuccess, onError } = options || {}; + + const response = useMutation({ + mutationFn: apis.authRefreshTokenUsingPost, + onSuccess(data: API.ExchangeTokenRESP) { + onSuccess?.(data); + }, + onError(error) { + onError?.(error); + }, + }); + + return response; +} +/* eslint-disable */ +// @ts-ignore +import { request } from 'axios'; + +import * as API from './types'; + +/** RefreshToken 刷新token POST /llmops/auth/refresh-token */ +export async function authRefreshTokenUsingPost({ + body, + options, +}: { + body: API.RefreshTokenBody; + options?: { [key: string]: unknown }; +}) { + return request('/llmops/auth/refresh-token', { + method: 'POST', + data: body, + ...(options || {}), + }); +} +/* eslint-disable */ +// @ts-ignore +import { queryOptions, useMutation } from '@tanstack/react-query'; +import type { DefaultError } from '@tanstack/react-query'; +import { request } from 'axios'; + +import * as apis from './share'; +import * as API from './types'; + +/** H5GetApiToken 获取一个 app token h5版 GET /llmops/v1/api/app/h5/share/api-token */ +export function v1ApiAppH5ShareApiTokenUsingGetQueryOptions(options: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v1ApiAppH5ShareApiTokenUsingGetParams; + options?: { [key: string]: unknown }; +}) { + return queryOptions({ + queryFn: async ({ queryKey }) => { + return apis.v1ApiAppH5ShareApiTokenUsingGet( + queryKey[1] as typeof options + ); + }, + queryKey: ['v1ApiAppH5ShareApiTokenUsingGet', options], + }); +} + +/** GetApiToken 获取一个 app token GET /llmops/v1/api/app/share/api-token */ +export function v1ApiAppShareApiTokenUsingGetQueryOptions(options: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v1ApiAppShareApiTokenUsingGetParams; + options?: { [key: string]: unknown }; +}) { + return queryOptions({ + queryFn: async ({ queryKey }) => { + return apis.v1ApiAppShareApiTokenUsingGet(queryKey[1] as typeof options); + }, + queryKey: ['v1ApiAppShareApiTokenUsingGet', options], + }); +} +/* eslint-disable */ +// @ts-ignore +import { request } from 'axios'; + +import * as API from './types'; + +/** H5GetApiToken 获取一个 app token h5版 GET /llmops/v1/api/app/h5/share/api-token */ +export async function v1ApiAppH5ShareApiTokenUsingGet({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v1ApiAppH5ShareApiTokenUsingGetParams; + options?: { [key: string]: unknown }; +}) { + return request( + '/llmops/v1/api/app/h5/share/api-token', + { + method: 'GET', + params: { + ...params, + }, + ...(options || {}), + } + ); +} + +/** GetApiToken 获取一个 app token GET /llmops/v1/api/app/share/api-token */ +export async function v1ApiAppShareApiTokenUsingGet({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v1ApiAppShareApiTokenUsingGetParams; + options?: { [key: string]: unknown }; +}) { + return request( + '/llmops/v1/api/app/share/api-token', + { + method: 'GET', + params: { + ...params, + }, + ...(options || {}), + } + ); +} +/* eslint-disable */ +// @ts-ignore + +export type AddAppkeyReq = { + appid: string; + appkey: string; + appsecret?: string; + encodingAESKey?: string; + token?: string; + /** wjl,dingding,feishu,wxa,wx */ + type: string; +}; + +export type ApiToken = { + apiTokenID?: string; + appID?: string; + createdAt?: string; + token?: string; + updatedAt?: string; +}; + +export type ApiTokenDataList = { + data?: ApiToken[]; + total?: number; +}; + +export type App = { + appID?: string; + appImage?: number; + appStatus?: string; + /** 应用类型 */ + appType?: number; + createdAt?: string; + description?: string; + groupID?: string; + /** 开场提问引导 */ + guidance?: Map; + name?: string; + operator?: string; + /** 应用优先级 */ + priority?: number; + prologue?: string; + recommendSwitch?: Bool; + /** 是否模版 */ + templateStatus?: string; + updatedAt?: string; + workspaceID?: string; +}; + +export type AppDataset = { + /** 描述 */ + description?: string; + /** llm描述 */ + llmDesc?: string; + /** 知识库名 */ + name?: string; +}; + +export type AppDatasetConfig = { + appDatasetConfigID?: string; + appID?: string; + createdAt?: string; + minScore?: number; + searchSource?: string; + timeoutSecond?: number; + topK?: number; + updatedAt?: string; +}; + +export type AppDatasetConfigs = { + /** 最低分数 */ + minScore?: number; + /** 知识库源,默认 warehouse */ + searchSource?: string; + /** 知识库查询超时时间 */ + timeoutSecond?: number; + /** 知识库条数 */ + topK?: number; +}; + +export type AppDatasets = { + appCount?: number; + author?: string; + datasetID?: string; + datasetName?: string; + docCount?: number; + state?: string; +}; + +export type AppDetail = { + /** 消耗输出token */ + AnswerTokensCount?: number; + appDatasetConfig?: AppDatasetConfig; + /** 数据集Id列表 */ + appDatasets?: AppDatasets[]; + appGroupID?: string; + appID?: string; + /** 应用头像 */ + appImage?: string; + /** 应用名 */ + appName?: string; + /** PrePrompt */ + appPrePrompt?: string; + appPromptPrefix?: AppModelConfigPromptPrefix; + /** 模型 */ + appProvider?: string; + /** AppDatasetSource database2.AppDatasetSourceInfo `json:"appDatasetSource"` */ + appProviderID?: string; + /** 模型名 */ + appProviderName?: string; + /** 推荐内容 */ + appRecommendedContext?: AppRecommendedContext[]; + appStatus?: string; + /** 应用token列表 */ + appToken?: string[]; + configs?: ModelConfigsMap; + /** 会话总数 */ + conversationCount?: number; + createAt?: string; + /** 应用描述 */ + description?: string; + /** 开场提问引导 */ + guidance?: Guidances; + /** H5随机分享路径 */ + h5RandomPath?: string; + historyLimit?: number; + /** 消息总数 */ + messagesCount?: number; + /** PC随机分享路径 */ + pcRandomPath?: string; + /** 开场白 */ + prologue?: string; + /** 消耗输入token */ + queryTokensCount?: number; + switchRecommendedQuestion?: boolean; + templateStatus?: string; + /** 消耗总token */ + totalTokens?: number; + workspaceID?: string; +}; + +export type AppMessagesCount = { + total?: number; +}; + +export type AppModelConfigPromptPrefix = { + background?: string; + role?: string; + switchRecommendedQuestion?: boolean; +}; + +export type AppModelConfigs = { + configs?: ModelConfigsMap; + prePrompt?: string; + providerId?: string; +}; + +export type AppRecommendedContext = { + appID?: string; + appRecommendedContextID?: string; + context?: string; + createdAt?: string; + description?: string; + name?: string; + updatedAt?: string; +}; + +export type AppRecommendedContext2 = { + context?: string; + description?: string; + id?: string; + name?: string; +}; + +export type AppRecommendedContext3 = { + context?: string; + description?: string; + id?: string; + name?: string; +}; + +export type AppRecommendedContextResp = { + questions?: string; + recommendSwitch?: boolean; +}; + +export type AppResp = { + appGroupID?: string; + appGroupName?: string; + appImage?: string; + appStatus?: string; + createAt?: string; + datasetCount?: number; + description?: string; + h5?: string; + id?: string; + name?: string; + pc?: string; + workspaceID?: string; +}; + +export type AppWithPermission = { + appID?: string; + appImage?: number; + appStatus?: string; + /** 应用类型 */ + appType?: number; + createdAt?: string; + description?: string; + groupID?: string; + /** 开场提问引导 */ + guidance?: Map; + isAppAdmin?: boolean; + name?: string; + operator?: string; + /** 应用优先级 */ + priority?: number; + prologue?: string; + recommendSwitch?: Bool; + /** 是否模版 */ + templateStatus?: string; + updatedAt?: string; + workspaceID?: string; +}; + +export type AttentionDataCountResp = { + total?: number; +}; + +export type AttentionUser = { + email?: string; + isAttentionUser?: boolean; + phone?: string; + userID?: string; + userName?: string; +}; + +export type AttentionUserResp = { + email?: string; + lastMessageTime?: string; + phone?: string; + userID?: string; + userName?: string; +}; + +export type authAuthorizeUsingGetParams = { + /** 业务回调地址 */ + redirect_uri: string; + /** 保持请求和回调的状态,授权成功后会回传该参数 */ + state?: string; +}; + +export type authExchangeUsingGetParams = { + /** code */ + code: string; + /** 业务回调地址 */ + redirect_uri: string; +}; + +export type Bool = string; + +export type Chat = { + conversation_id?: string; + inputs?: Record; + isIgnore?: boolean; + query?: string; + response_mode?: string; + user?: string; +}; + +export type ChatMessageReq = { + prompt?: string; + query?: string; +}; + +export type ConversationLogsResp = { + /** 消耗输出token */ + AnswerTokensCount?: number; + appID?: string; + conversationID?: string; + conversationName?: string; + createdAt?: string; + messagesCount?: number; + /** 消耗输入token */ + queryTokensCount?: number; + /** 消耗总token */ + totalTokens?: number; + userID?: string; + userInfo?: User; +}; + +export type ConversationMsg = { + conversationId?: string; + createAt?: string; + name?: string; + userId?: string; +}; + +export type ConversationResp = { + /** 消耗输出token */ + AnswerTokensCount?: number; + appID?: string; + appName?: string; + conversationID?: string; + conversationName?: string; + createdAt?: string; + lastMessagesTime?: string; + messagesCount?: number; + /** 消耗输入token */ + queryTokensCount?: number; + /** 消耗总token */ + totalTokens?: number; + userID?: string; + userInfo?: User; +}; + +export type CopyAppReq = { + appID?: string; + workspaceID?: string; +}; + +export type CreateApiTokenRESP = { + token?: string; +}; + +export type CreateAppReq = { + description?: string; + guidance?: Guidances; + name?: string; + prologue?: string; +}; + +export type CreateAppReqV2 = { + appDescription?: string; + appGroupID?: string; + /** 提示查询 */ + appGuidance?: Guidances; + appImage?: string; + appName?: string; + /** 开场白 */ + appPrologue?: string; + historyLimit?: number; + modelConfigs?: ModelConfigsMap; + prePrompt?: string; + providerId?: string; +}; + +export type CreateAttentionReq = { + followeeUserIDList?: string[]; + iamID?: string; +}; + +export type CreateFeedbacksResp = object; + +export type CreateSharePathRESP = { + path?: string; +}; + +export type Data = { + appkey?: string; + appsecret?: string; + /** 0-未开启,1-开启 */ + state?: number; + url?: string; + wxExtra?: WxExtra; +}; + +export type DatasetData = { + author?: string; + description?: string; + docCount?: number; + document_count?: number; + id?: string; + name?: string; + permission?: string; + state?: string; + uuid?: string; + word_count?: number; +}; + +export type DeleteAttentionReq = { + followeeUserIDList?: string[]; + iamID?: string; +}; + +export type DeleteFeedbacksResp = object; + +export type DeleteMemberBody = { + /** 用户id */ + userID?: string; +}; + +export type DeleteResp = { + msg?: string; +}; + +export type EmptyObject = object; + +export type ErrorResp = { + msg?: string; + type?: Record; +}; + +export type ExchangeTokenRESP = { + /** 访问令牌 */ + access_token?: string; + /** 访问令牌过期时间 */ + expires_in?: string; + /** 刷新令牌过期时间 */ + refresh_expires_in?: string; + /** 刷新令牌 */ + refresh_token?: string; + /** 令牌类型 */ + token_type?: string; +}; + +export type Feedback = { + /** 评论 */ + comment?: string; + conversation_id?: string; + createdAt?: string; + message_id?: string; + /** like/unlike */ + rating?: string; + /** 打分 */ + score?: number; + updatedAt?: string; +}; + +export type FeedbacksReqBody = { + /** 评论 */ + comment?: string; + conversation_id?: string; + /** like/unlike */ + rating?: string; + /** 分数1-10 */ + score?: number; +}; + +export type FilestreamResp = { + conversation_id?: string; +}; + +export type GetApiTokenByRandomPathRESP = { + apiTokenID?: string; + appID?: string; + appName?: string; + createdAt?: string; + recommendedContext?: AppRecommendedContext[]; + switchRecommendedContext?: boolean; + switchRecommendedQuestion?: boolean; + token?: string; + updatedAt?: string; +}; + +export type GetAppKeyReq = { + appid: string; + /** wjl,dingding,feishu,wxa,wx */ + type: string; +}; + +export type GetAttentionDataCountReq = { + appIDList?: string[]; + iamID?: string; + userID?: string; +}; + +export type GetImagePreSignedUrlResp = { + appImage?: string; + preSignedPutUrl?: string; +}; + +export type Guidances = { + items?: string[]; +}; + +export type HistoryInfo = { + /** like/unlike */ + Rating?: string; + answer?: string; + answerToken?: number; + /** 评论 */ + comment?: string; + createAt?: string; + format?: string[]; + messageId?: string; + query?: string; + queryToken?: number; + /** 打分 */ + score?: number; + totalToken?: number; +}; + +export type IAMUserInfo = { + /** 创建时间 */ + createdTime?: string; + /** Cid string `json:"cid"` */ + email?: string; + /** 用户id */ + id?: string; + idpId?: string; + /** 是否iam管理员 */ + isAdmin?: boolean; + isAppAdmin?: boolean; + /** 是否罗克佳华人员 */ + isRkUser?: boolean; + /** 是否超级管理员 */ + isSuperUser?: boolean; + isSystemAdmin?: boolean; + /** Deleted int32 `json:"deleted"` // 逻辑删除 */ + lastTime?: string; + /** 登录名 */ + loginName?: string; + /** 消息类型 */ + msgType?: number; + /** 电话 */ + phone?: string; + /** 罗克佳华用户账号 */ + rkUserCard?: string; + /** 个性签名 */ + sign?: string; + /** 状态:1可用;0未激活;-1禁用 */ + status?: number; + /** 修改时间 */ + updatedTime?: string; + /** 用户类型 */ + useType?: string; + /** 用户名 */ + userName?: string; + wechatAppId?: string; + wechatSwitch?: boolean; + wechatgzhSwitch?: boolean; +}; + +export type ListAllAttentionUser = { + data?: AttentionUser[]; + total?: number; +}; + +export type ListAppDatasetConfigResp = { + data?: AppDatasetConfig[]; + total?: number; +}; + +export type ListAppDatasets = { + Data?: AppDatasets[]; + total?: number; +}; + +export type ListAppResp = { + data?: AppResp[]; + total?: number; +}; + +export type ListAttentionConversationReq = { + appIDList?: string[]; + iamID?: string; + offset?: number; + size?: number; + userID?: string; +}; + +export type ListAttentionUserResp = { + data?: AttentionUserResp[]; + total?: number; +}; + +export type ListConversationLogsResp = { + data?: ConversationLogsResp[]; + total?: number; +}; + +export type ListConversationResp = { + data?: ConversationResp[]; + total?: number; +}; + +export type ListDatasetsResp = { + data?: DatasetData[]; + has_more?: boolean; + offset?: number; + size?: number; + total?: number; +}; + +export type ListFeedbacksResp = { + data?: Feedback[]; + total?: number; +}; + +export type ListMemberRESP = { + data?: MemberWithRoleData[]; + total?: number; +}; + +export type ListProviderResp = { + data?: ProviderResp[]; + total?: number; +}; + +export type ListUserWithAppRESP = { + data?: UserWithAppData[]; + total?: number; +}; + +export type ListWorkspaceGroup = { + data?: WorkspaceGroup[]; +}; + +export type ListWorkspacePermissions = { + data?: WorkspacePermissions[]; + total?: number; +}; + +export type Map = object; + +export type MemberBody = { + /** 角色(system_admin-系统管理员;system_user-系统管普通用户;app_admin-应用管理员;app_user-应用普通用户) */ + role?: RbacRole; + /** 用户id */ + userID?: string; +}; + +export type MemberWithRoleData = { + /** 应用角色 */ + appRole?: RbacRole; + createdAt?: string; + email?: string; + idpID?: string; + /** 是否是app管理员 */ + isAppAdmin?: boolean; + /** 是否是系统管理员 */ + isSystemAdmin?: boolean; + operator?: string; + phone?: string; + /** 角色(系统管理员、系统普通用户) */ + role?: RbacRole; + updatedAt?: string; + /** iam 用户id */ + userID?: string; + userName?: string; +}; + +export type MessagesCountResp = { + /** 请求消耗token */ + messagesCount?: number; + time?: string; +}; + +export type MessagesTokenResp = { + /** 回答消耗token */ + answerToken?: number; + /** 请求消耗token */ + queryToken?: number; + time?: string; + totalToken?: number; +}; + +export type ModelConfigsMap = { + /** 模型(ERNIE-Bot-4;ERNIE-Bot;ERNIE-Bot-turbo;gpt-3.5-turbo-16k;gpt-4-1106-preview) */ + model_type?: string; + /** 通过对已生成的token增加惩罚,减少重复生成的现象。取值范围:[1.0, 2.0] */ + penalty_score?: number; + /** 较高的数值会使输出更加随机,而较低的数值会使其更加集中和确定。默认0.95,范围 (0, 1.0] */ + temperature?: number; + /** tools call */ + tools_call?: boolean; + /** 影响输出文本的多样性,取值越大,生成文本的多样性越强。取值范围 [0, 1.0] */ + top_p?: number; +}; + +export type ModelConfigsMap2 = { + /** 模型(ERNIE-Bot-4;ERNIE-Bot;ERNIE-Bot-turbo;gpt-3.5-turbo-16k;gpt-4-1106-preview) */ + model_type?: string; + /** 通过对已生成的token增加惩罚,减少重复生成的现象。取值范围:[1.0, 2.0] */ + penalty_score?: number; + /** 较高的数值会使输出更加随机,而较低的数值会使其更加集中和确定。默认0.95,范围 (0, 1.0] */ + temperature?: number; + tools_call?: boolean; + /** 影响输出文本的多样性,取值越大,生成文本的多样性越强。取值范围 [0, 1.0] */ + top_p?: number; +}; + +export enum Permission { + 'read_only' = 'read_only', + 'operation' = 'operation', + 'no_permission' = 'no_permission', +} + +export type IPermission = keyof typeof Permission; + +export type ProviderResp = { + /** 名字 */ + name?: string; + providerID?: string; + subType?: string[]; + /** 类型 */ + type?: ProviderType; +}; + +export enum ProviderType { + 'openai' = 'openai', + 'spark' = 'spark', + 'wenxin' = 'wenxin', + 'rockai' = 'rockai', +} + +export type IProviderType = keyof typeof ProviderType; + +export type QueryTokenResp = { + /** 消耗输出token */ + AnswerTokensCount?: number; + /** 消耗输入token */ + queryTokensCount?: number; + /** 消耗总token */ + totalTokens?: number; +}; + +export type QuestionRecommendReq = { + conversation_id?: string; + /** Query string `json:"query"`Answer string `json:"answer"` */ + user?: string; +}; + +export enum RbacRole { + 'system_admin' = 'system_admin', + 'system_user' = 'system_user', + 'app_admin' = 'app_admin', + 'app_user' = 'app_user', +} + +export type IRbacRole = keyof typeof RbacRole; + +export type RecommendQuestionAndContext = { + contexts?: AppRecommendedContext[]; + questions?: string[]; +}; + +export type RefreshTokenBody = { + refreshToken?: string; +}; + +export type ReleaseDiscoverReq = { + alterAppID?: string; + /** 应用类型 */ + appType?: number; + /** 是否作为模版 TRUE:作为模版;FALSE:不作为 */ + templateStatus?: string; +}; + +export type ResponseData = { + answer?: string; + conversation_id?: string; + created_at?: number; + event?: string; + id?: string; + trace_id?: string; +}; + +export type ResponseRecommendData = { + answer?: string; + conversation_id?: string; + created_at?: number; + event?: string; + id?: string; + trace_id?: string; +}; + +export type SpeechToTextResp = { + /** 转化的结果 */ + text?: string; +}; + +export type TextToSpeechReq = { + /** 需要转的文字 */ + text?: string; +}; + +export type UpdateAppGroup = { + appGroupID?: string; +}; + +export type UpdateAppKeyStateReq = { + appid: string; + /** 0-关闭,1-启动 */ + state?: number; + /** wjl,dingding,feishu */ + type: string; +}; + +export type UpdateAppReq = { + appDescription?: string; + appGroupID?: string; + appImage?: string; + appName?: string; +}; + +export type UpdateAppReqV2 = { + appGroupID?: string; + /** 提示查询 */ + appGuidance?: Guidances; + /** 开场白 */ + appPrologue?: string; + /** 推荐内容 */ + appRecommendedContexts?: AppRecommendedContext[]; + historyLimit?: number; + modelConfigs?: ModelConfigsMap; + prePrompt?: string; + providerId?: string; + recommendSwitch?: boolean; +}; + +export type UpdateAppStatusReq = { + /** PUBLIC:公开;PRIVATE:私有 */ + appStatus?: string; +}; + +export type UpdateUserRoleBody = { + /** 角色(system_admin-系统管理员;system_user-系统管普通用户;app_admin-应用管理员;app_user-应用普通用户) */ + role?: RbacRole; + /** 用户id */ + userID?: string; +}; + +export type User = { + createdAt?: string; + email?: string; + idpID?: string; + operator?: string; + phone?: string; + /** 角色(系统管理员、系统普通用户) */ + role?: RbacRole; + updatedAt?: string; + /** iam 用户id */ + userID?: string; + userName?: string; +}; + +export type UserWithAppData = { + appWithPermissionList?: AppWithPermission[]; + createdAt?: string; + email?: string; + idpID?: string; + isSystemAdmin?: boolean; + operator?: string; + phone?: string; + /** 角色(系统管理员、系统普通用户) */ + role?: RbacRole; + updatedAt?: string; + /** iam 用户id */ + userID?: string; + userName?: string; +}; + +export type v1ApiAppAppIdApiTokenUsingGetParams = { + /** 应用id */ + appID: string; + /** 每页大小 */ + size: number; + /** 分页 */ + offset: number; +}; + +export type v1ApiAppAppIdApiTokenUsingPostParams = { + /** 应用id */ + appID: string; +}; + +export type v1ApiAppAppIdDatasetConfigsUsingDeleteParams = { + /** 应用id */ + appID: string; + /** 应用知识库配置id */ + appDatasetConfigID: string; +}; + +export type v1ApiAppAppIdDatasetConfigsUsingGetParams = { + /** 应用id */ + appID: string; +}; + +export type v1ApiAppAppIdDatasetConfigsUsingPostParams = { + /** 应用id */ + appID: string; +}; + +export type v1ApiAppAppIdDatasetConfigsUsingPutParams = { + /** 应用id */ + appID: string; +}; + +export type v1ApiAppAppIdDatasetsListUsingGetParams = { + /** 应用id */ + appID: string; + /** size */ + size?: number; + /** offset */ + offset?: number; +}; + +export type v1ApiAppAppIdDatasetsUsingDeleteParams = { + /** 应用id */ + appID: string; + /** 数据集id */ + datasetID: string; +}; + +export type V1ApiAppAppIdDatasetsUsingPostBody = API.AppDatasets[]; + +export type v1ApiAppAppIdDatasetsUsingPostParams = { + /** 应用id */ + appID: string; +}; + +export type v1ApiAppAppIdDetailsUsingGetParams = { + /** 应用id */ + appID: string; +}; + +export type v1ApiAppAppIdHourlyMessagesUsingGetParams = { + /** 应用id */ + appID: string; + /** 开始时间,秒级时间戳 */ + starTimestamp?: number; + /** 结束时间,秒级时间戳 */ + endTimestamp?: number; +}; + +export type v1ApiAppAppIdHourlyTokenUsingGetParams = { + /** 应用id */ + appID: string; + /** 开始时间,秒级时间戳 */ + starTimestamp?: number; + /** 结束时间,秒级时间戳 */ + endTimestamp?: number; +}; + +export type v1ApiAppAppIdLogsConversationIdMessagesUsingGetParams = { + /** 应用id */ + appID: string; + /** 会话id */ + conversationID: string; +}; + +export type v1ApiAppAppIdLogsUsingGetParams = { + /** 应用id */ + appID: string; + /** 会话id */ + conversationID?: string; + /** 结束时间 */ + endTimestamp?: number; + /** 页数1开始 */ + pageOffset?: number; + /** 每页数量 */ + pageSize?: number; + /** 模型id */ + providerID?: string; + /** 开始时间 */ + starTimestamp?: number; + /** 用户id */ + userID?: string; +}; + +export type v1ApiAppAppIdMemberRoleUsingPutParams = { + /** 应用id */ + appID: string; +}; + +export type v1ApiAppAppIdMemberUsingDeleteParams = { + /** 应用id */ + appID: string; +}; + +export type v1ApiAppAppIdMemberUsingGetParams = { + /** 应用id */ + appID: string; + /** 每页大小 */ + size: number; + /** 分页 */ + offset: number; +}; + +export type v1ApiAppAppIdMemberUsingPostParams = { + /** 应用id */ + appID: string; +}; + +export type v1ApiAppAppIdMessagesUsingGetParams = { + /** 应用id */ + appID: string; + /** 开始时间,秒级时间戳 */ + starTimestamp?: number; + /** 结束时间,秒级时间戳 */ + endTimestamp?: number; +}; + +export type v1ApiAppAppIdModelConfigsUsingPostParams = { + /** 应用id */ + appID: string; +}; + +export type v1ApiAppAppIdModelConfigsUsingPutParams = { + /** 应用id */ + appID: string; +}; + +export type v1ApiAppAppIdModelPromptUsingPostParams = { + /** 应用id */ + appID: string; +}; + +export type v1ApiAppAppIdOpenApiDeleteUsingDeleteParams = { + /** 应用id */ + appID: string; +}; + +export type v1ApiAppAppIdPluginUsingPutParams = { + /** 应用id */ + appID: string; +}; + +export type v1ApiAppAppIdRecommendedContextUsingGetParams = { + /** 应用id */ + appID: string; +}; + +export type v1ApiAppAppIdRecommendedContextUsingPostParams = { + /** 应用id */ + appID: string; +}; + +export type v1ApiAppAppIdShareUsingPutParams = { + /** 应用id */ + appID: string; + /** 是否h5 */ + isH5?: boolean; +}; + +export type v1ApiAppAppIdTokenUsingGetParams = { + /** 应用id */ + appID: string; + /** 开始时间,秒级时间戳 */ + starTimestamp?: number; + /** 结束时间,秒级时间戳 */ + endTimestamp?: number; +}; + +export type v1ApiAppAppIdUpdateStatusUsingPutParams = { + /** 应用id */ + appID: string; +}; + +export type v1ApiAppAppIdUpdateUsingPutParams = { + /** 应用id */ + appID: string; +}; + +export type v1ApiAppH5ShareApiTokenUsingGetParams = { + /** 分享的随机path */ + randomPath: string; +}; + +export type v1ApiAppIdCostUsingPostParams = { + /** 应用id */ + appID: string; + /** 会话id */ + conversationID?: string; + /** 结束时间 */ + endTimestamp?: number; + /** 页数1开始 */ + pageOffset?: number; + /** 每页数量 */ + pageSize?: number; + /** 模型id */ + providerID?: string; + /** 开始时间 */ + starTimestamp?: number; + /** 用户id */ + userID?: string; +}; + +export type v1ApiAppListPrivateUsingGetParams = { + /** 是否只查看会话过的应用 */ + onlyConversations?: boolean; +}; + +export type v1ApiAppListPublicUsingGetParams = { + /** 是否只查看会话过的应用 */ + onlyConversations?: boolean; +}; + +export type v1ApiAppShareApiTokenUsingGetParams = { + /** 分享的随机path */ + randomPath: string; +}; + +export type v1ApiAttentionAppListUsingGetParams = { + /** IAM用户id */ + iamID: string; +}; + +export type v1ApiAttentionMessagesHistoryUsingGetParams = { + /** IAM ID */ + iamID: string; + /** 应用id */ + appID: string; + /** 会话id */ + conversationID: string; +}; + +export type v1ApiAttentionUserAllUsingGetParams = { + /** 登陆用户IAMID */ + iamID?: string; + /** 用户id */ + isAttention?: boolean; + /** 名字或电话,模糊匹配 */ + nameOrPhone?: string; + offset?: number; + /** 电话号码 */ + phone?: string; + size?: number; + /** 用户id */ + userID?: string; + /** 用户名字用于搜索 */ + userName?: string; +}; + +export type v1ApiAttentionUserListUsingPostParams = { + /** IAM ID */ + iamID: string; + /** 默认10 */ + size?: number; + /** 默认0 */ + offset?: number; +}; + +export type v1ApiConversationsConversationIdHistoryUsingDeleteParams = { + /** 会话id */ + conversation_id: string; + /** 聊天信息id */ + message_id: string; +}; + +export type v1ApiConversationsConversationIdHistoryUsingGetParams = { + /** 会话id */ + conversation_id: string; +}; + +export type v1ApiConversationsUsingDeleteParams = { + /** 会话id */ + conversation_id: string; +}; + +export type v1ApiConversationsUsingGetParams = { + /** 用户id,空值不返回 */ + user_id?: string; +}; + +export type v1ApiFeedbacksMessageIdUsingDeleteParams = { + /** 消息id */ + message_id: string; + /** 会话id */ + conversation_id: string; +}; + +export type v1ApiFeedbacksMessageIdUsingPostParams = { + /** 消息id */ + message_id: string; +}; + +export type v1ApiFeedbacksUsingGetParams = { + conversation_ID?: string; + message_ID?: string; + /** 页数1开始 */ + pageOffset?: number; + /** 每页数量 */ + pageSize?: number; +}; + +export type V1ApiFileUsingPostBody = { + /** 文件 */ + file: string; +}; + +export type v1ApiFileUsingPostParams = { + /** 会话id */ + conversation_id?: string; + /** user id */ + user_id?: string; +}; + +export type v1ApiIamAccountUsingGetParams = { + /** openId */ + openId: string; +}; + +export type v1ApiProviderListUsingGetParams = { + /** size */ + size?: number; + /** offset */ + offset?: number; +}; + +export type v1ApiRobotWorkspaceIdAppkeyStateUsingPostParams = { + /** 空间ID */ + workspaceID: string; +}; + +export type v1ApiRobotWorkspaceIdAppkeyUsingDeleteParams = { + /** 空间ID */ + workspaceID: string; +}; + +export type v1ApiRobotWorkspaceIdAppkeyUsingGetParams = { + /** 空间ID */ + workspaceID: string; + appid: string; + /** wjl,dingding,feishu,wxa,wx */ + type: string; +}; + +export type v1ApiRobotWorkspaceIdAppkeyUsingPostParams = { + /** 空间ID */ + workspaceID: string; +}; + +export type V1ApiSpeechToTextUsingPostBody = { + /** 文件 */ + file: string; +}; + +export type v1ApiUserInfoUsingGetParams = { + /** 应用id */ + appID?: string; +}; + +export type v1ApiUserUsingGetParams = { + offset?: number; + /** 电话号码 */ + phone?: string; + size?: number; + /** 用户id */ + userID?: string; + /** 用户名字用于搜索 */ + userName?: string; +}; + +export type v2ApiAppAppIdDetailsUsingGetParams = { + /** 应用id */ + appID: string; +}; + +export type v2ApiAppAppIdUpdateUsingPostParams = { + /** 应用id */ + appID: string; +}; + +export type v2ApiAppListUsingGetParams = { + /** 是否只查看会话过的应用 */ + onlyConversations?: boolean; +}; + +export type v2ApiAppShareApiTokenUsingGetParams = { + /** 分享的随机path */ + randomPath: string; +}; + +export type v2ApiChatMessagesMessagesCountUsingGetParams = { + /** 是否查询人均,默认false */ + isPerPerson?: boolean; + /** 开始时间,秒级时间戳 */ + starTimestamp?: number; + /** 结束时间,秒级时间戳 */ + endTimestamp?: number; +}; + +export type V2ApiFileUsingPostBody = { + /** 要上传的文件 */ + files: unknown[]; +}; + +export type v2ApiFileUsingPostParams = { + /** 会话id */ + conversation_id?: string; + /** user id */ + user_id?: string; +}; + +export type v2ApiWorkspacesDefaultUsingPostParams = { + /** 空间ID */ + workspaceID: string; +}; + +export type v2ApiWorkspacesRecommendedMessageIdDetailsUsingGetParams = { + /** 消息id */ + messageId: string; +}; + +export type V2ApiWorkspacesWorkspaceIdAppAppIdDatasetsJoinUsingPostBody = + API.AppDatasets[]; + +export type v2ApiWorkspacesWorkspaceIdAppAppIdDatasetsJoinUsingPostParams = { + /** 空间ID */ + workspaceID: string; + /** 应用id */ + appID: string; +}; + +export type v2ApiWorkspacesWorkspaceIdAppAppIdDatasetsUsingDeleteParams = { + /** 应用id */ + appID: string; + /** 空间ID */ + workspaceID: string; + /** 数据集id */ + datasetID: string; +}; + +export type v2ApiWorkspacesWorkspaceIdAppAppIdDetailsUsingGetParams = { + /** 空间ID */ + workspaceID: string; + /** 应用id */ + appID: string; +}; + +export type v2ApiWorkspacesWorkspaceIdAppAppIdHourlyMessagesUsingGetParams = { + /** 空间ID */ + workspaceID: string; + /** 应用id */ + appID: string; + /** 开始时间,秒级时间戳 */ + starTimestamp?: number; + /** 结束时间,秒级时间戳 */ + endTimestamp?: number; +}; + +export type v2ApiWorkspacesWorkspaceIdAppAppIdHourlyTokenUsingGetParams = { + /** 空间ID */ + workspaceID: string; + /** 应用id */ + appID: string; + /** 开始时间,秒级时间戳 */ + starTimestamp?: number; + /** 结束时间,秒级时间戳 */ + endTimestamp?: number; +}; + +export type v2ApiWorkspacesWorkspaceIdAppAppIdLogsUsingGetParams = { + /** 应用id */ + appID: string; + /** 空间ID */ + workspaceID: string; + /** 会话id */ + conversationID?: string; + /** 结束时间 */ + endTimestamp?: number; + /** 页数1开始 */ + pageOffset?: number; + /** 每页数量 */ + pageSize?: number; + /** 模型id */ + providerID?: string; + /** 开始时间 */ + starTimestamp?: number; + /** 用户id */ + userID?: string; +}; + +export type v2ApiWorkspacesWorkspaceIdAppAppIdMessagesUsingGetParams = { + /** 空间ID */ + workspaceID: string; + /** 应用id */ + appID: string; + /** 开始时间,秒级时间戳 */ + starTimestamp?: number; + /** 结束时间,秒级时间戳 */ + endTimestamp?: number; +}; + +export type v2ApiWorkspacesWorkspaceIdAppAppIdModelConfigsUsingPutParams = { + /** 应用id */ + appID: string; + /** 空间ID */ + workspaceID: string; +}; + +export type v2ApiWorkspacesWorkspaceIdAppAppIdPluginUsingGetParams = { + /** 应用id */ + appID: string; + /** 空间ID */ + workspaceID: string; +}; + +export type v2ApiWorkspacesWorkspaceIdAppAppIdTokenUsingGetParams = { + /** 应用id */ + appID: string; + /** 开始时间,秒级时间戳 */ + starTimestamp?: number; + /** 结束时间,秒级时间戳 */ + endTimestamp?: number; +}; + +export type v2ApiWorkspacesWorkspaceIdAppAppIdUpdateStatusUsingPutParams = { + /** 空间ID */ + workspaceID: string; + /** 应用id */ + appID: string; +}; + +export type v2ApiWorkspacesWorkspaceIdAppAppIdUsingPostParams = { + /** 空间ID */ + workspaceID: string; + /** 应用id */ + appID: string; +}; + +export type v2ApiWorkspacesWorkspaceIdAppsAppIdBaseUsingPostParams = { + /** 应用id */ + appID: string; + /** 空间ID */ + workspaceID: string; +}; + +export type v2ApiWorkspacesWorkspaceIdAppsAppIdGroupUsingPostParams = { + /** 应用id */ + appID: string; + /** 空间ID */ + workspaceID: string; +}; + +export type v2ApiWorkspacesWorkspaceIdAppsAppIdUsingDeleteParams = { + /** 应用id */ + appID: string; + /** 空间ID */ + workspaceID: string; +}; + +export type v2ApiWorkspacesWorkspaceIdAppsUsingGetParams = { + /** 空间ID */ + workspaceID: string; + /** 是否只查看会话过的应用 */ + onlyConversations?: boolean; + /** 应用名,模糊查询 */ + appName?: string; +}; + +export type v2ApiWorkspacesWorkspaceIdAppsUsingPostParams = { + /** 空间ID */ + workspaceID: string; +}; + +export type v2ApiWorkspacesWorkspaceIdDatasetsUsingGetParams = { + /** 空间ID */ + workspaceID: string; +}; + +export type v2ApiWorkspacesWorkspaceIdDatasetsUsingPostParams = { + /** 空间ID */ + workspaceID: string; +}; + +export type v2ApiWorkspacesWorkspaceIdGroupsUsingGetParams = { + /** 空间ID */ + workspaceID: string; +}; + +export type v2ApiWorkspacesWorkspaceIdGroupsUsingPostParams = { + /** 空间ID */ + workspaceID: string; +}; + +export type v2ApiWorkspacesWorkspaceIdGroupsWorkspaceGroupIdUsingDeleteParams = + { + /** 空间ID */ + workspaceID: string; + /** 分组ID */ + workspaceGroupID: string; + }; + +export type v2ApiWorkspacesWorkspaceIdGroupsWorkspaceGroupIdUsingPostParams = { + /** 空间ID */ + workspaceID: string; + /** 分组ID */ + workspaceGroupID: string; +}; + +export type v2ApiWorkspacesWorkspaceIdPermissionsUsingGetParams = { + /** 空间ID */ + workspaceID: string; +}; + +export type v2ApiWorkspacesWorkspaceIdUsersUsingGetParams = { + /** 空间ID */ + workspaceID: string; +}; + +export type v2ApiWorkspacesWorkspaceIdUsersUsingPostParams = { + /** 空间ID */ + workspaceID: string; +}; + +export type v2ApiWorkspacesWorkspaceIdUserUserIdUsingDeleteParams = { + /** 空间ID */ + workspaceID: string; + /** userID */ + userID: string; +}; + +export type v2ApiWorkspacesWorkspaceIdUsingDeleteParams = { + /** 空间ID */ + workspaceID: string; +}; + +export type v2ApiWorkspacesWorkspaceIdUsingPostParams = { + /** 空间ID */ + workspaceID: string; +}; + +export type WJLAccount = { + code?: number; + data?: { + avatar?: string; + iamUserId?: string; + nameInTeam?: string; + nickName?: string; + phone?: string; + realNameFlag?: number; + }; + msg?: string; + success?: boolean; +}; + +export type WorkspaceGroup = { + createdAt?: string; + /** 分组名 */ + name?: string; + updatedAt?: string; + workspaceGroupID?: string; + workspaceID?: string; +}; + +export type WorkspaceGroupReq = { + name?: string; +}; + +export type WorkspaceListResp = { + data?: WorkspaceResp[]; + total?: number; +}; + +export type WorkspacePermissions = { + createdAt?: string; + email?: string; + idpID?: string; + operator?: string; + /** 枚举read_only(只读)、operation(操作) */ + permission?: Permission; + phone?: string; + /** 角色(系统管理员、系统普通用户) */ + role?: RbacRole; + updatedAt?: string; + /** iam 用户id */ + userID?: string; + userName?: string; +}; + +export type WorkspaceReq = { + /** 描述 */ + description?: string; + /** 空间名 */ + name?: string; +}; + +export type WorkspaceResp = { + /** 空间描述 */ + description?: string; + /** 空间名 */ + name?: string; + /** 空间ID */ + workspaceID?: string; +}; + +export enum WorkspaceRole { + 'workspace_admin' = 'workspace_admin', + 'workspace_user' = 'workspace_user', +} + +export type IWorkspaceRole = keyof typeof WorkspaceRole; + +export type WorkspaceUser = { + /** workspace_admin空间超管用户;workspace_user空间普通用户 */ + role?: WorkspaceRole; + /** 用户id */ + userID?: string; +}; + +export type WxExtra = { + encodingAESKey?: string; + token?: string; +}; +/* eslint-disable */ +// @ts-ignore +import { queryOptions, useMutation } from '@tanstack/react-query'; +import type { DefaultError } from '@tanstack/react-query'; +import { request } from 'axios'; + +import * as apis from './updateAppKeyState'; +import * as API from './types'; + +/** UpdateAppKeyState 为应用获取各种类型机器人状态 POST /llmops/v1/api/robot/${param0}/appkey/state */ +export function useV1ApiRobotWorkspaceIdAppkeyStateUsingPostMutation(options?: { + onSuccess?: (value?: unknown) => void; + onError?: (error?: DefaultError) => void; +}) { + const { onSuccess, onError } = options || {}; + + const response = useMutation({ + mutationFn: apis.v1ApiRobotWorkspaceIdAppkeyStateUsingPost, + onSuccess(data: unknown) { + onSuccess?.(data); + }, + onError(error) { + onError?.(error); + }, + }); + + return response; +} +/* eslint-disable */ +// @ts-ignore +import { request } from 'axios'; + +import * as API from './types'; + +/** UpdateAppKeyState 为应用获取各种类型机器人状态 POST /llmops/v1/api/robot/${param0}/appkey/state */ +export async function v1ApiRobotWorkspaceIdAppkeyStateUsingPost({ + params, + body, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v1ApiRobotWorkspaceIdAppkeyStateUsingPostParams; + body: API.UpdateAppKeyStateReq; + options?: { [key: string]: unknown }; +}) { + const { workspaceID: param0, ...queryParams } = params; + + return request(`/llmops/v1/api/robot/${param0}/appkey/state`, { + method: 'POST', + params: { ...queryParams }, + data: body, + ...(options || {}), + }); +} +/* eslint-disable */ +// @ts-ignore +import { queryOptions, useMutation } from '@tanstack/react-query'; +import type { DefaultError } from '@tanstack/react-query'; +import { request } from 'axios'; + +import * as apis from './user'; +import * as API from './types'; + +/** ListUser 系统全局用户列表 GET /llmops/v1/api/user */ +export function v1ApiUserUsingGetQueryOptions(options: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v1ApiUserUsingGetParams; + options?: { [key: string]: unknown }; +}) { + return queryOptions({ + queryFn: async ({ queryKey }) => { + return apis.v1ApiUserUsingGet(queryKey[1] as typeof options); + }, + queryKey: ['v1ApiUserUsingGet', options], + }); +} + +/** GetUserInfoByToken 获取iam用户数据 GET /llmops/v1/api/user/info */ +export function v1ApiUserInfoUsingGetQueryOptions(options: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v1ApiUserInfoUsingGetParams; + options?: { [key: string]: unknown }; +}) { + return queryOptions({ + queryFn: async ({ queryKey }) => { + return apis.v1ApiUserInfoUsingGet(queryKey[1] as typeof options); + }, + queryKey: ['v1ApiUserInfoUsingGet', options], + }); +} + +/** UpdateUserRole 更新用户角色 PUT /llmops/v1/api/user/role */ +export function useV1ApiUserRoleUsingPutMutation(options?: { + onSuccess?: (value?: API.EmptyObject) => void; + onError?: (error?: DefaultError) => void; +}) { + const { onSuccess, onError } = options || {}; + + const response = useMutation({ + mutationFn: apis.v1ApiUserRoleUsingPut, + onSuccess(data: API.EmptyObject) { + onSuccess?.(data); + }, + onError(error) { + onError?.(error); + }, + }); + + return response; +} +/* eslint-disable */ +// @ts-ignore +import { request } from 'axios'; + +import * as API from './types'; + +/** ListUser 系统全局用户列表 GET /llmops/v1/api/user */ +export async function v1ApiUserUsingGet({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v1ApiUserUsingGetParams; + options?: { [key: string]: unknown }; +}) { + return request('/llmops/v1/api/user', { + method: 'GET', + params: { + // size has a default value: 10 + size: '10', + + ...params, + }, + ...(options || {}), + }); +} + +/** GetUserInfoByToken 获取iam用户数据 GET /llmops/v1/api/user/info */ +export async function v1ApiUserInfoUsingGet({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v1ApiUserInfoUsingGetParams; + options?: { [key: string]: unknown }; +}) { + return request('/llmops/v1/api/user/info', { + method: 'GET', + params: { + ...params, + }, + ...(options || {}), + }); +} + +/** UpdateUserRole 更新用户角色 PUT /llmops/v1/api/user/role */ +export async function v1ApiUserRoleUsingPut({ + body, + options, +}: { + body: API.UpdateUserRoleBody; + options?: { [key: string]: unknown }; +}) { + return request('/llmops/v1/api/user/role', { + method: 'PUT', + data: body, + ...(options || {}), + }); +} +/* eslint-disable */ +// @ts-ignore +import { queryOptions, useMutation } from '@tanstack/react-query'; +import type { DefaultError } from '@tanstack/react-query'; +import { request } from 'axios'; + +import * as apis from './workspace'; +import * as API from './types'; + +/** GetWorkspaceList 空间列表 GET /llmops/v2/api/workspaces */ +export function v2ApiWorkspacesUsingGetQueryOptions(options: { + options?: { [key: string]: unknown }; +}) { + return queryOptions({ + queryFn: async ({ queryKey }) => { + return apis.v2ApiWorkspacesUsingGet(queryKey[1] as typeof options); + }, + queryKey: ['v2ApiWorkspacesUsingGet', options], + }); +} + +/** CreateWorkspace 创建空间 POST /llmops/v2/api/workspaces */ +export function useV2ApiWorkspacesUsingPostMutation(options?: { + onSuccess?: (value?: unknown) => void; + onError?: (error?: DefaultError) => void; +}) { + const { onSuccess, onError } = options || {}; + + const response = useMutation({ + mutationFn: apis.v2ApiWorkspacesUsingPost, + onSuccess(data: unknown) { + onSuccess?.(data); + }, + onError(error) { + onError?.(error); + }, + }); + + return response; +} + +/** GetDefaultWorkspace 获取用户默认空间 GET /llmops/v2/api/workspaces-default */ +export function v2ApiWorkspacesDefaultUsingGetQueryOptions(options: { + options?: { [key: string]: unknown }; +}) { + return queryOptions({ + queryFn: async ({ queryKey }) => { + return apis.v2ApiWorkspacesDefaultUsingGet(queryKey[1] as typeof options); + }, + queryKey: ['v2ApiWorkspacesDefaultUsingGet', options], + }); +} + +/** 切换默认空间 POST /llmops/v2/api/workspaces-default */ +export function useV2ApiWorkspacesDefaultUsingPostMutation(options?: { + onSuccess?: (value?: unknown) => void; + onError?: (error?: DefaultError) => void; +}) { + const { onSuccess, onError } = options || {}; + + const response = useMutation({ + mutationFn: apis.v2ApiWorkspacesDefaultUsingPost, + onSuccess(data: unknown) { + onSuccess?.(data); + }, + onError(error) { + onError?.(error); + }, + }); + + return response; +} + +/** UpdateWorkspace 更新空间 POST /llmops/v2/api/workspaces/${param0} */ +export function useV2ApiWorkspacesWorkspaceIdUsingPostMutation(options?: { + onSuccess?: (value?: unknown) => void; + onError?: (error?: DefaultError) => void; +}) { + const { onSuccess, onError } = options || {}; + + const response = useMutation({ + mutationFn: apis.v2ApiWorkspacesWorkspaceIdUsingPost, + onSuccess(data: unknown) { + onSuccess?.(data); + }, + onError(error) { + onError?.(error); + }, + }); + + return response; +} + +/** DeleteWorkspace 删除空间 DELETE /llmops/v2/api/workspaces/${param0} */ +export function useV2ApiWorkspacesWorkspaceIdUsingDeleteMutation(options?: { + onSuccess?: (value?: unknown) => void; + onError?: (error?: DefaultError) => void; +}) { + const { onSuccess, onError } = options || {}; + + const response = useMutation({ + mutationFn: apis.v2ApiWorkspacesWorkspaceIdUsingDelete, + onSuccess(data: unknown) { + onSuccess?.(data); + }, + onError(error) { + onError?.(error); + }, + }); + + return response; +} + +/** CreateDatasetsJoinV2 创建 app 数据集关联 POST /llmops/v2/api/workspaces/${param0}/app/${param1}/datasets/join */ +export function useV2ApiWorkspacesWorkspaceIdAppAppIdDatasetsJoinUsingPostMutation(options?: { + onSuccess?: (value?: unknown) => void; + onError?: (error?: DefaultError) => void; +}) { + const { onSuccess, onError } = options || {}; + + const response = useMutation({ + mutationFn: apis.v2ApiWorkspacesWorkspaceIdAppAppIdDatasetsJoinUsingPost, + onSuccess(data: unknown) { + onSuccess?.(data); + }, + onError(error) { + onError?.(error); + }, + }); + + return response; +} + +/** GetWorkspaceDatasetsList 空间下数据集列表 GET /llmops/v2/api/workspaces/${param0}/datasets */ +export function v2ApiWorkspacesWorkspaceIdDatasetsUsingGetQueryOptions(options: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v2ApiWorkspacesWorkspaceIdDatasetsUsingGetParams; + options?: { [key: string]: unknown }; +}) { + return queryOptions({ + queryFn: async ({ queryKey }) => { + return apis.v2ApiWorkspacesWorkspaceIdDatasetsUsingGet( + queryKey[1] as typeof options + ); + }, + queryKey: ['v2ApiWorkspacesWorkspaceIdDatasetsUsingGet', options], + }); +} + +/** CreateWorkspaceDatasets 创建空间下数据集 POST /llmops/v2/api/workspaces/${param0}/datasets */ +export function useV2ApiWorkspacesWorkspaceIdDatasetsUsingPostMutation(options?: { + onSuccess?: (value?: unknown) => void; + onError?: (error?: DefaultError) => void; +}) { + const { onSuccess, onError } = options || {}; + + const response = useMutation({ + mutationFn: apis.v2ApiWorkspacesWorkspaceIdDatasetsUsingPost, + onSuccess(data: unknown) { + onSuccess?.(data); + }, + onError(error) { + onError?.(error); + }, + }); + + return response; +} + +/** GetWorkspaceUserRole 查询空间用户权限 GET /llmops/v2/api/workspaces/${param0}/permissions */ +export function v2ApiWorkspacesWorkspaceIdPermissionsUsingGetQueryOptions(options: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v2ApiWorkspacesWorkspaceIdPermissionsUsingGetParams; + options?: { [key: string]: unknown }; +}) { + return queryOptions({ + queryFn: async ({ queryKey }) => { + return apis.v2ApiWorkspacesWorkspaceIdPermissionsUsingGet( + queryKey[1] as typeof options + ); + }, + queryKey: ['v2ApiWorkspacesWorkspaceIdPermissionsUsingGet', options], + }); +} + +/** DeleteWorkspaceUsers 删除空间下用户 DELETE /llmops/v2/api/workspaces/${param0}/user/${param1} */ +export function useV2ApiWorkspacesWorkspaceIdUserUserIdUsingDeleteMutation(options?: { + onSuccess?: (value?: unknown) => void; + onError?: (error?: DefaultError) => void; +}) { + const { onSuccess, onError } = options || {}; + + const response = useMutation({ + mutationFn: apis.v2ApiWorkspacesWorkspaceIdUserUserIdUsingDelete, + onSuccess(data: unknown) { + onSuccess?.(data); + }, + onError(error) { + onError?.(error); + }, + }); + + return response; +} + +/** GetWorkspaceUsers 查询空间下用户列表 GET /llmops/v2/api/workspaces/${param0}/users */ +export function v2ApiWorkspacesWorkspaceIdUsersUsingGetQueryOptions(options: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v2ApiWorkspacesWorkspaceIdUsersUsingGetParams; + options?: { [key: string]: unknown }; +}) { + return queryOptions({ + queryFn: async ({ queryKey }) => { + return apis.v2ApiWorkspacesWorkspaceIdUsersUsingGet( + queryKey[1] as typeof options + ); + }, + queryKey: ['v2ApiWorkspacesWorkspaceIdUsersUsingGet', options], + }); +} + +/** CreateOrUpdateWorkspaceUsers 添加或更新空间下用户角色 POST /llmops/v2/api/workspaces/${param0}/users */ +export function useV2ApiWorkspacesWorkspaceIdUsersUsingPostMutation(options?: { + onSuccess?: (value?: unknown) => void; + onError?: (error?: DefaultError) => void; +}) { + const { onSuccess, onError } = options || {}; + + const response = useMutation({ + mutationFn: apis.v2ApiWorkspacesWorkspaceIdUsersUsingPost, + onSuccess(data: unknown) { + onSuccess?.(data); + }, + onError(error) { + onError?.(error); + }, + }); + + return response; +} +/* eslint-disable */ +// @ts-ignore +import { request } from 'axios'; + +import * as API from './types'; + +/** GetWorkspaceList 空间列表 GET /llmops/v2/api/workspaces */ +export async function v2ApiWorkspacesUsingGet({ + options, +}: { + options?: { [key: string]: unknown }; +}) { + return request('/llmops/v2/api/workspaces', { + method: 'GET', + ...(options || {}), + }); +} + +/** CreateWorkspace 创建空间 POST /llmops/v2/api/workspaces */ +export async function v2ApiWorkspacesUsingPost({ + body, + options, +}: { + body: API.WorkspaceReq; + options?: { [key: string]: unknown }; +}) { + return request('/llmops/v2/api/workspaces', { + method: 'POST', + data: body, + ...(options || {}), + }); +} + +/** GetDefaultWorkspace 获取用户默认空间 GET /llmops/v2/api/workspaces-default */ +export async function v2ApiWorkspacesDefaultUsingGet({ + options, +}: { + options?: { [key: string]: unknown }; +}) { + return request('/llmops/v2/api/workspaces-default', { + method: 'GET', + ...(options || {}), + }); +} + +/** 切换默认空间 POST /llmops/v2/api/workspaces-default */ +export async function v2ApiWorkspacesDefaultUsingPost({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v2ApiWorkspacesDefaultUsingPostParams; + options?: { [key: string]: unknown }; +}) { + return request('/llmops/v2/api/workspaces-default', { + method: 'POST', + params: { + ...params, + }, + ...(options || {}), + }); +} + +/** UpdateWorkspace 更新空间 POST /llmops/v2/api/workspaces/${param0} */ +export async function v2ApiWorkspacesWorkspaceIdUsingPost({ + params, + body, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v2ApiWorkspacesWorkspaceIdUsingPostParams; + body: API.WorkspaceReq; + options?: { [key: string]: unknown }; +}) { + const { workspaceID: param0, ...queryParams } = params; + + return request(`/llmops/v2/api/workspaces/${param0}`, { + method: 'POST', + params: { ...queryParams }, + data: body, + ...(options || {}), + }); +} + +/** DeleteWorkspace 删除空间 DELETE /llmops/v2/api/workspaces/${param0} */ +export async function v2ApiWorkspacesWorkspaceIdUsingDelete({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v2ApiWorkspacesWorkspaceIdUsingDeleteParams; + options?: { [key: string]: unknown }; +}) { + const { workspaceID: param0, ...queryParams } = params; + + return request(`/llmops/v2/api/workspaces/${param0}`, { + method: 'DELETE', + params: { ...queryParams }, + ...(options || {}), + }); +} + +/** CreateDatasetsJoinV2 创建 app 数据集关联 POST /llmops/v2/api/workspaces/${param0}/app/${param1}/datasets/join */ +export async function v2ApiWorkspacesWorkspaceIdAppAppIdDatasetsJoinUsingPost({ + params, + body, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v2ApiWorkspacesWorkspaceIdAppAppIdDatasetsJoinUsingPostParams; + body: API.V2ApiWorkspacesWorkspaceIdAppAppIdDatasetsJoinUsingPostBody; + options?: { [key: string]: unknown }; +}) { + const { workspaceID: param0, appID: param1, ...queryParams } = params; + + return request( + `/llmops/v2/api/workspaces/${param0}/app/${param1}/datasets/join`, + { + method: 'POST', + params: { ...queryParams }, + data: body, + ...(options || {}), + } + ); +} + +/** GetWorkspaceDatasetsList 空间下数据集列表 GET /llmops/v2/api/workspaces/${param0}/datasets */ +export async function v2ApiWorkspacesWorkspaceIdDatasetsUsingGet({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v2ApiWorkspacesWorkspaceIdDatasetsUsingGetParams; + options?: { [key: string]: unknown }; +}) { + const { workspaceID: param0, ...queryParams } = params; + + return request( + `/llmops/v2/api/workspaces/${param0}/datasets`, + { + method: 'GET', + params: { ...queryParams }, + ...(options || {}), + } + ); +} + +/** CreateWorkspaceDatasets 创建空间下数据集 POST /llmops/v2/api/workspaces/${param0}/datasets */ +export async function v2ApiWorkspacesWorkspaceIdDatasetsUsingPost({ + params, + body, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v2ApiWorkspacesWorkspaceIdDatasetsUsingPostParams; + body: API.AppDataset; + options?: { [key: string]: unknown }; +}) { + const { workspaceID: param0, ...queryParams } = params; + + return request(`/llmops/v2/api/workspaces/${param0}/datasets`, { + method: 'POST', + params: { ...queryParams }, + data: body, + ...(options || {}), + }); +} + +/** GetWorkspaceUserRole 查询空间用户权限 GET /llmops/v2/api/workspaces/${param0}/permissions */ +export async function v2ApiWorkspacesWorkspaceIdPermissionsUsingGet({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v2ApiWorkspacesWorkspaceIdPermissionsUsingGetParams; + options?: { [key: string]: unknown }; +}) { + const { workspaceID: param0, ...queryParams } = params; + + return request( + `/llmops/v2/api/workspaces/${param0}/permissions`, + { + method: 'GET', + params: { ...queryParams }, + ...(options || {}), + } + ); +} + +/** DeleteWorkspaceUsers 删除空间下用户 DELETE /llmops/v2/api/workspaces/${param0}/user/${param1} */ +export async function v2ApiWorkspacesWorkspaceIdUserUserIdUsingDelete({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v2ApiWorkspacesWorkspaceIdUserUserIdUsingDeleteParams; + options?: { [key: string]: unknown }; +}) { + const { workspaceID: param0, userID: param1, ...queryParams } = params; + + return request( + `/llmops/v2/api/workspaces/${param0}/user/${param1}`, + { + method: 'DELETE', + params: { ...queryParams }, + ...(options || {}), + } + ); +} + +/** GetWorkspaceUsers 查询空间下用户列表 GET /llmops/v2/api/workspaces/${param0}/users */ +export async function v2ApiWorkspacesWorkspaceIdUsersUsingGet({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v2ApiWorkspacesWorkspaceIdUsersUsingGetParams; + options?: { [key: string]: unknown }; +}) { + const { workspaceID: param0, ...queryParams } = params; + + return request( + `/llmops/v2/api/workspaces/${param0}/users`, + { + method: 'GET', + params: { ...queryParams }, + ...(options || {}), + } + ); +} + +/** CreateOrUpdateWorkspaceUsers 添加或更新空间下用户角色 POST /llmops/v2/api/workspaces/${param0}/users */ +export async function v2ApiWorkspacesWorkspaceIdUsersUsingPost({ + params, + body, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v2ApiWorkspacesWorkspaceIdUsersUsingPostParams; + body: API.WorkspaceUser; + options?: { [key: string]: unknown }; +}) { + const { workspaceID: param0, ...queryParams } = params; + + return request(`/llmops/v2/api/workspaces/${param0}/users`, { + method: 'POST', + params: { ...queryParams }, + data: body, + ...(options || {}), + }); +} +/* eslint-disable */ +// @ts-ignore +import { queryOptions, useMutation } from '@tanstack/react-query'; +import type { DefaultError } from '@tanstack/react-query'; +import { request } from 'axios'; + +import * as apis from './workspaceAppV2'; +import * as API from './types'; + +/** CopyApp 复制 app POST /llmops/v2/api/copy_apps */ +export function useV2ApiCopyAppsUsingPostMutation(options?: { + onSuccess?: (value?: unknown) => void; + onError?: (error?: DefaultError) => void; +}) { + const { onSuccess, onError } = options || {}; + + const response = useMutation({ + mutationFn: apis.v2ApiCopyAppsUsingPost, + onSuccess(data: unknown) { + onSuccess?.(data); + }, + onError(error) { + onError?.(error); + }, + }); + + return response; +} + +/** UpdateAppV2.1 更新 app 信息 POST /llmops/v2/api/workspaces/${param0}/app/${param1} */ +export function useV2ApiWorkspacesWorkspaceIdAppAppIdUsingPostMutation(options?: { + onSuccess?: (value?: unknown) => void; + onError?: (error?: DefaultError) => void; +}) { + const { onSuccess, onError } = options || {}; + + const response = useMutation({ + mutationFn: apis.v2ApiWorkspacesWorkspaceIdAppAppIdUsingPost, + onSuccess(data: unknown) { + onSuccess?.(data); + }, + onError(error) { + onError?.(error); + }, + }); + + return response; +} + +/** GetAppDetailsV2.1 查询 app 详情 GET /llmops/v2/api/workspaces/${param0}/app/${param1}/details */ +export function v2ApiWorkspacesWorkspaceIdAppAppIdDetailsUsingGetQueryOptions(options: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v2ApiWorkspacesWorkspaceIdAppAppIdDetailsUsingGetParams; + options?: { [key: string]: unknown }; +}) { + return queryOptions({ + queryFn: async ({ queryKey }) => { + return apis.v2ApiWorkspacesWorkspaceIdAppAppIdDetailsUsingGet( + queryKey[1] as typeof options + ); + }, + queryKey: ['v2ApiWorkspacesWorkspaceIdAppAppIdDetailsUsingGet', options], + }); +} + +/** GetSumHourlyMessagesCountV2.1 每小时messages数 GET /llmops/v2/api/workspaces/${param0}/app/${param1}/hourly-messages */ +export function v2ApiWorkspacesWorkspaceIdAppAppIdHourlyMessagesUsingGetQueryOptions(options: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v2ApiWorkspacesWorkspaceIdAppAppIdHourlyMessagesUsingGetParams; + options?: { [key: string]: unknown }; +}) { + return queryOptions({ + queryFn: async ({ queryKey }) => { + return apis.v2ApiWorkspacesWorkspaceIdAppAppIdHourlyMessagesUsingGet( + queryKey[1] as typeof options + ); + }, + queryKey: [ + 'v2ApiWorkspacesWorkspaceIdAppAppIdHourlyMessagesUsingGet', + options, + ], + }); +} + +/** GetSumHourlyTokenV2.1 每小时token数 GET /llmops/v2/api/workspaces/${param0}/app/${param1}/hourly-token */ +export function v2ApiWorkspacesWorkspaceIdAppAppIdHourlyTokenUsingGetQueryOptions(options: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v2ApiWorkspacesWorkspaceIdAppAppIdHourlyTokenUsingGetParams; + options?: { [key: string]: unknown }; +}) { + return queryOptions({ + queryFn: async ({ queryKey }) => { + return apis.v2ApiWorkspacesWorkspaceIdAppAppIdHourlyTokenUsingGet( + queryKey[1] as typeof options + ); + }, + queryKey: [ + 'v2ApiWorkspacesWorkspaceIdAppAppIdHourlyTokenUsingGet', + options, + ], + }); +} + +/** GetSumDailyMessagesCountV2.1 每日messages数 GET /llmops/v2/api/workspaces/${param0}/app/${param1}/messages */ +export function v2ApiWorkspacesWorkspaceIdAppAppIdMessagesUsingGetQueryOptions(options: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v2ApiWorkspacesWorkspaceIdAppAppIdMessagesUsingGetParams; + options?: { [key: string]: unknown }; +}) { + return queryOptions({ + queryFn: async ({ queryKey }) => { + return apis.v2ApiWorkspacesWorkspaceIdAppAppIdMessagesUsingGet( + queryKey[1] as typeof options + ); + }, + queryKey: ['v2ApiWorkspacesWorkspaceIdAppAppIdMessagesUsingGet', options], + }); +} + +/** UpdateAppStatusV2.1 更新 app 状态 PUT /llmops/v2/api/workspaces/${param0}/app/${param1}/update_status */ +export function useV2ApiWorkspacesWorkspaceIdAppAppIdUpdateStatusUsingPutMutation(options?: { + onSuccess?: (value?: unknown) => void; + onError?: (error?: DefaultError) => void; +}) { + const { onSuccess, onError } = options || {}; + + const response = useMutation({ + mutationFn: apis.v2ApiWorkspacesWorkspaceIdAppAppIdUpdateStatusUsingPut, + onSuccess(data: unknown) { + onSuccess?.(data); + }, + onError(error) { + onError?.(error); + }, + }); + + return response; +} + +/** ListAppV2.1 查询用户关联的 app 列表 GET /llmops/v2/api/workspaces/${param0}/apps */ +export function v2ApiWorkspacesWorkspaceIdAppsUsingGetQueryOptions(options: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v2ApiWorkspacesWorkspaceIdAppsUsingGetParams; + options?: { [key: string]: unknown }; +}) { + return queryOptions({ + queryFn: async ({ queryKey }) => { + return apis.v2ApiWorkspacesWorkspaceIdAppsUsingGet( + queryKey[1] as typeof options + ); + }, + queryKey: ['v2ApiWorkspacesWorkspaceIdAppsUsingGet', options], + }); +} + +/** CreateAppV2.1 创建 app POST /llmops/v2/api/workspaces/${param0}/apps */ +export function useV2ApiWorkspacesWorkspaceIdAppsUsingPostMutation(options?: { + onSuccess?: (value?: unknown) => void; + onError?: (error?: DefaultError) => void; +}) { + const { onSuccess, onError } = options || {}; + + const response = useMutation({ + mutationFn: apis.v2ApiWorkspacesWorkspaceIdAppsUsingPost, + onSuccess(data: unknown) { + onSuccess?.(data); + }, + onError(error) { + onError?.(error); + }, + }); + + return response; +} + +/** DeleteDatasetsJoinV2.1 删除 app 数据集关联 DELETE /llmops/v2/api/workspaces/${param1}/app/${param0}/datasets */ +export function useV2ApiWorkspacesWorkspaceIdAppAppIdDatasetsUsingDeleteMutation(options?: { + onSuccess?: (value?: API.DeleteResp) => void; + onError?: (error?: DefaultError) => void; +}) { + const { onSuccess, onError } = options || {}; + + const response = useMutation({ + mutationFn: apis.v2ApiWorkspacesWorkspaceIdAppAppIdDatasetsUsingDelete, + onSuccess(data: API.DeleteResp) { + onSuccess?.(data); + }, + onError(error) { + onError?.(error); + }, + }); + + return response; +} + +/** GetAppLogsV2.1 查询 app 日志与标注 GET /llmops/v2/api/workspaces/${param1}/app/${param0}/logs */ +export function v2ApiWorkspacesWorkspaceIdAppAppIdLogsUsingGetQueryOptions(options: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v2ApiWorkspacesWorkspaceIdAppAppIdLogsUsingGetParams; + options?: { [key: string]: unknown }; +}) { + return queryOptions({ + queryFn: async ({ queryKey }) => { + return apis.v2ApiWorkspacesWorkspaceIdAppAppIdLogsUsingGet( + queryKey[1] as typeof options + ); + }, + queryKey: ['v2ApiWorkspacesWorkspaceIdAppAppIdLogsUsingGet', options], + }); +} + +/** UpdateModelConfigsV2.1 更新 app model configs PUT /llmops/v2/api/workspaces/${param1}/app/${param0}/model-configs */ +export function useV2ApiWorkspacesWorkspaceIdAppAppIdModelConfigsUsingPutMutation(options?: { + onSuccess?: (value?: unknown) => void; + onError?: (error?: DefaultError) => void; +}) { + const { onSuccess, onError } = options || {}; + + const response = useMutation({ + mutationFn: apis.v2ApiWorkspacesWorkspaceIdAppAppIdModelConfigsUsingPut, + onSuccess(data: unknown) { + onSuccess?.(data); + }, + onError(error) { + onError?.(error); + }, + }); + + return response; +} + +/** GetPluginListV2.1 获取插件列表 GET /llmops/v2/api/workspaces/${param1}/app/${param0}/plugin */ +export function v2ApiWorkspacesWorkspaceIdAppAppIdPluginUsingGetQueryOptions(options: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v2ApiWorkspacesWorkspaceIdAppAppIdPluginUsingGetParams; + options?: { [key: string]: unknown }; +}) { + return queryOptions({ + queryFn: async ({ queryKey }) => { + return apis.v2ApiWorkspacesWorkspaceIdAppAppIdPluginUsingGet( + queryKey[1] as typeof options + ); + }, + queryKey: ['v2ApiWorkspacesWorkspaceIdAppAppIdPluginUsingGet', options], + }); +} + +/** GetSumDailyTokenV2.1 每日token GET /llmops/v2/api/workspaces/${param1}/app/${param0}/token */ +export function v2ApiWorkspacesWorkspaceIdAppAppIdTokenUsingGetQueryOptions(options: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v2ApiWorkspacesWorkspaceIdAppAppIdTokenUsingGetParams; + options?: { [key: string]: unknown }; +}) { + return queryOptions({ + queryFn: async ({ queryKey }) => { + return apis.v2ApiWorkspacesWorkspaceIdAppAppIdTokenUsingGet( + queryKey[1] as typeof options + ); + }, + queryKey: ['v2ApiWorkspacesWorkspaceIdAppAppIdTokenUsingGet', options], + }); +} + +/** DeleteAppV2.1 删除 app DELETE /llmops/v2/api/workspaces/${param1}/apps/${param0} */ +export function useV2ApiWorkspacesWorkspaceIdAppsAppIdUsingDeleteMutation(options?: { + onSuccess?: (value?: API.DeleteResp) => void; + onError?: (error?: DefaultError) => void; +}) { + const { onSuccess, onError } = options || {}; + + const response = useMutation({ + mutationFn: apis.v2ApiWorkspacesWorkspaceIdAppsAppIdUsingDelete, + onSuccess(data: API.DeleteResp) { + onSuccess?.(data); + }, + onError(error) { + onError?.(error); + }, + }); + + return response; +} + +/** UpdateAppImage 更新 app名称头像 POST /llmops/v2/api/workspaces/${param1}/apps/${param0}/base */ +export function useV2ApiWorkspacesWorkspaceIdAppsAppIdBaseUsingPostMutation(options?: { + onSuccess?: (value?: unknown) => void; + onError?: (error?: DefaultError) => void; +}) { + const { onSuccess, onError } = options || {}; + + const response = useMutation({ + mutationFn: apis.v2ApiWorkspacesWorkspaceIdAppsAppIdBaseUsingPost, + onSuccess(data: unknown) { + onSuccess?.(data); + }, + onError(error) { + onError?.(error); + }, + }); + + return response; +} + +/** UpdateAppGroup 更新 app 分组 POST /llmops/v2/api/workspaces/${param1}/apps/${param0}/group */ +export function useV2ApiWorkspacesWorkspaceIdAppsAppIdGroupUsingPostMutation(options?: { + onSuccess?: (value?: unknown) => void; + onError?: (error?: DefaultError) => void; +}) { + const { onSuccess, onError } = options || {}; + + const response = useMutation({ + mutationFn: apis.v2ApiWorkspacesWorkspaceIdAppsAppIdGroupUsingPost, + onSuccess(data: unknown) { + onSuccess?.(data); + }, + onError(error) { + onError?.(error); + }, + }); + + return response; +} + +/** GetAppRecommendedContext 获取自定义推荐问题 & 推荐开关 GET /llmops/v2/api/workspaces/recommended/${param0}/details */ +export function v2ApiWorkspacesRecommendedMessageIdDetailsUsingGetQueryOptions(options: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v2ApiWorkspacesRecommendedMessageIdDetailsUsingGetParams; + options?: { [key: string]: unknown }; +}) { + return queryOptions({ + queryFn: async ({ queryKey }) => { + return apis.v2ApiWorkspacesRecommendedMessageIdDetailsUsingGet( + queryKey[1] as typeof options + ); + }, + queryKey: ['v2ApiWorkspacesRecommendedMessageIdDetailsUsingGet', options], + }); +} +/* eslint-disable */ +// @ts-ignore +import { request } from 'axios'; + +import * as API from './types'; + +/** CopyApp 复制 app POST /llmops/v2/api/copy_apps */ +export async function v2ApiCopyAppsUsingPost({ + body, + options, +}: { + body: API.CopyAppReq; + options?: { [key: string]: unknown }; +}) { + return request('/llmops/v2/api/copy_apps', { + method: 'POST', + data: body, + ...(options || {}), + }); +} + +/** UpdateAppV2.1 更新 app 信息 POST /llmops/v2/api/workspaces/${param0}/app/${param1} */ +export async function v2ApiWorkspacesWorkspaceIdAppAppIdUsingPost({ + params, + body, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v2ApiWorkspacesWorkspaceIdAppAppIdUsingPostParams; + body: API.UpdateAppReqV2; + options?: { [key: string]: unknown }; +}) { + const { workspaceID: param0, appID: param1, ...queryParams } = params; + + return request(`/llmops/v2/api/workspaces/${param0}/app/${param1}`, { + method: 'POST', + params: { ...queryParams }, + data: body, + ...(options || {}), + }); +} + +/** GetAppDetailsV2.1 查询 app 详情 GET /llmops/v2/api/workspaces/${param0}/app/${param1}/details */ +export async function v2ApiWorkspacesWorkspaceIdAppAppIdDetailsUsingGet({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v2ApiWorkspacesWorkspaceIdAppAppIdDetailsUsingGetParams; + options?: { [key: string]: unknown }; +}) { + const { workspaceID: param0, appID: param1, ...queryParams } = params; + + return request( + `/llmops/v2/api/workspaces/${param0}/app/${param1}/details`, + { + method: 'GET', + params: { ...queryParams }, + ...(options || {}), + } + ); +} + +/** GetSumHourlyMessagesCountV2.1 每小时messages数 GET /llmops/v2/api/workspaces/${param0}/app/${param1}/hourly-messages */ +export async function v2ApiWorkspacesWorkspaceIdAppAppIdHourlyMessagesUsingGet({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v2ApiWorkspacesWorkspaceIdAppAppIdHourlyMessagesUsingGetParams; + options?: { [key: string]: unknown }; +}) { + const { workspaceID: param0, appID: param1, ...queryParams } = params; + + return request( + `/llmops/v2/api/workspaces/${param0}/app/${param1}/hourly-messages`, + { + method: 'GET', + params: { + ...queryParams, + }, + ...(options || {}), + } + ); +} + +/** GetSumHourlyTokenV2.1 每小时token数 GET /llmops/v2/api/workspaces/${param0}/app/${param1}/hourly-token */ +export async function v2ApiWorkspacesWorkspaceIdAppAppIdHourlyTokenUsingGet({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v2ApiWorkspacesWorkspaceIdAppAppIdHourlyTokenUsingGetParams; + options?: { [key: string]: unknown }; +}) { + const { workspaceID: param0, appID: param1, ...queryParams } = params; + + return request( + `/llmops/v2/api/workspaces/${param0}/app/${param1}/hourly-token`, + { + method: 'GET', + params: { + ...queryParams, + }, + ...(options || {}), + } + ); +} + +/** GetSumDailyMessagesCountV2.1 每日messages数 GET /llmops/v2/api/workspaces/${param0}/app/${param1}/messages */ +export async function v2ApiWorkspacesWorkspaceIdAppAppIdMessagesUsingGet({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v2ApiWorkspacesWorkspaceIdAppAppIdMessagesUsingGetParams; + options?: { [key: string]: unknown }; +}) { + const { workspaceID: param0, appID: param1, ...queryParams } = params; + + return request( + `/llmops/v2/api/workspaces/${param0}/app/${param1}/messages`, + { + method: 'GET', + params: { + ...queryParams, + }, + ...(options || {}), + } + ); +} + +/** UpdateAppStatusV2.1 更新 app 状态 PUT /llmops/v2/api/workspaces/${param0}/app/${param1}/update_status */ +export async function v2ApiWorkspacesWorkspaceIdAppAppIdUpdateStatusUsingPut({ + params, + body, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v2ApiWorkspacesWorkspaceIdAppAppIdUpdateStatusUsingPutParams; + body: API.UpdateAppStatusReq; + options?: { [key: string]: unknown }; +}) { + const { workspaceID: param0, appID: param1, ...queryParams } = params; + + return request( + `/llmops/v2/api/workspaces/${param0}/app/${param1}/update_status`, + { + method: 'PUT', + params: { ...queryParams }, + data: body, + ...(options || {}), + } + ); +} + +/** ListAppV2.1 查询用户关联的 app 列表 GET /llmops/v2/api/workspaces/${param0}/apps */ +export async function v2ApiWorkspacesWorkspaceIdAppsUsingGet({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v2ApiWorkspacesWorkspaceIdAppsUsingGetParams; + options?: { [key: string]: unknown }; +}) { + const { workspaceID: param0, ...queryParams } = params; + + return request(`/llmops/v2/api/workspaces/${param0}/apps`, { + method: 'GET', + params: { + ...queryParams, + }, + ...(options || {}), + }); +} + +/** CreateAppV2.1 创建 app POST /llmops/v2/api/workspaces/${param0}/apps */ +export async function v2ApiWorkspacesWorkspaceIdAppsUsingPost({ + params, + body, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v2ApiWorkspacesWorkspaceIdAppsUsingPostParams; + body: API.CreateAppReqV2; + options?: { [key: string]: unknown }; +}) { + const { workspaceID: param0, ...queryParams } = params; + + return request(`/llmops/v2/api/workspaces/${param0}/apps`, { + method: 'POST', + params: { ...queryParams }, + data: body, + ...(options || {}), + }); +} + +/** DeleteDatasetsJoinV2.1 删除 app 数据集关联 DELETE /llmops/v2/api/workspaces/${param1}/app/${param0}/datasets */ +export async function v2ApiWorkspacesWorkspaceIdAppAppIdDatasetsUsingDelete({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v2ApiWorkspacesWorkspaceIdAppAppIdDatasetsUsingDeleteParams; + options?: { [key: string]: unknown }; +}) { + const { appID: param0, workspaceID: param1, ...queryParams } = params; + + return request( + `/llmops/v2/api/workspaces/${param1}/app/${param0}/datasets`, + { + method: 'DELETE', + params: { + ...queryParams, + }, + ...(options || {}), + } + ); +} + +/** GetAppLogsV2.1 查询 app 日志与标注 GET /llmops/v2/api/workspaces/${param1}/app/${param0}/logs */ +export async function v2ApiWorkspacesWorkspaceIdAppAppIdLogsUsingGet({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v2ApiWorkspacesWorkspaceIdAppAppIdLogsUsingGetParams; + options?: { [key: string]: unknown }; +}) { + const { appID: param0, workspaceID: param1, ...queryParams } = params; + + return request( + `/llmops/v2/api/workspaces/${param1}/app/${param0}/logs`, + { + method: 'GET', + params: { + ...queryParams, + }, + ...(options || {}), + } + ); +} + +/** UpdateModelConfigsV2.1 更新 app model configs PUT /llmops/v2/api/workspaces/${param1}/app/${param0}/model-configs */ +export async function v2ApiWorkspacesWorkspaceIdAppAppIdModelConfigsUsingPut({ + params, + body, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v2ApiWorkspacesWorkspaceIdAppAppIdModelConfigsUsingPutParams; + body: API.AppModelConfigs; + options?: { [key: string]: unknown }; +}) { + const { appID: param0, workspaceID: param1, ...queryParams } = params; + + return request( + `/llmops/v2/api/workspaces/${param1}/app/${param0}/model-configs`, + { + method: 'PUT', + params: { ...queryParams }, + data: body, + ...(options || {}), + } + ); +} + +/** GetPluginListV2.1 获取插件列表 GET /llmops/v2/api/workspaces/${param1}/app/${param0}/plugin */ +export async function v2ApiWorkspacesWorkspaceIdAppAppIdPluginUsingGet({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v2ApiWorkspacesWorkspaceIdAppAppIdPluginUsingGetParams; + options?: { [key: string]: unknown }; +}) { + const { appID: param0, workspaceID: param1, ...queryParams } = params; + + return request( + `/llmops/v2/api/workspaces/${param1}/app/${param0}/plugin`, + { + method: 'GET', + params: { ...queryParams }, + ...(options || {}), + } + ); +} + +/** GetSumDailyTokenV2.1 每日token GET /llmops/v2/api/workspaces/${param1}/app/${param0}/token */ +export async function v2ApiWorkspacesWorkspaceIdAppAppIdTokenUsingGet({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v2ApiWorkspacesWorkspaceIdAppAppIdTokenUsingGetParams; + options?: { [key: string]: unknown }; +}) { + const { appID: param0, workspaceID: param1, ...queryParams } = params; + + return request( + `/llmops/v2/api/workspaces/${param1}/app/${param0}/token`, + { + method: 'GET', + params: { + ...queryParams, + }, + ...(options || {}), + } + ); +} + +/** DeleteAppV2.1 删除 app DELETE /llmops/v2/api/workspaces/${param1}/apps/${param0} */ +export async function v2ApiWorkspacesWorkspaceIdAppsAppIdUsingDelete({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v2ApiWorkspacesWorkspaceIdAppsAppIdUsingDeleteParams; + options?: { [key: string]: unknown }; +}) { + const { appID: param0, workspaceID: param1, ...queryParams } = params; + + return request( + `/llmops/v2/api/workspaces/${param1}/apps/${param0}`, + { + method: 'DELETE', + params: { ...queryParams }, + ...(options || {}), + } + ); +} + +/** UpdateAppImage 更新 app名称头像 POST /llmops/v2/api/workspaces/${param1}/apps/${param0}/base */ +export async function v2ApiWorkspacesWorkspaceIdAppsAppIdBaseUsingPost({ + params, + body, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v2ApiWorkspacesWorkspaceIdAppsAppIdBaseUsingPostParams; + body: API.UpdateAppReq; + options?: { [key: string]: unknown }; +}) { + const { appID: param0, workspaceID: param1, ...queryParams } = params; + + return request( + `/llmops/v2/api/workspaces/${param1}/apps/${param0}/base`, + { + method: 'POST', + params: { ...queryParams }, + data: body, + ...(options || {}), + } + ); +} + +/** UpdateAppGroup 更新 app 分组 POST /llmops/v2/api/workspaces/${param1}/apps/${param0}/group */ +export async function v2ApiWorkspacesWorkspaceIdAppsAppIdGroupUsingPost({ + params, + body, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v2ApiWorkspacesWorkspaceIdAppsAppIdGroupUsingPostParams; + body: API.UpdateAppGroup; + options?: { [key: string]: unknown }; +}) { + const { appID: param0, workspaceID: param1, ...queryParams } = params; + + return request( + `/llmops/v2/api/workspaces/${param1}/apps/${param0}/group`, + { + method: 'POST', + params: { ...queryParams }, + data: body, + ...(options || {}), + } + ); +} + +/** GetAppRecommendedContext 获取自定义推荐问题 & 推荐开关 GET /llmops/v2/api/workspaces/recommended/${param0}/details */ +export async function v2ApiWorkspacesRecommendedMessageIdDetailsUsingGet({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v2ApiWorkspacesRecommendedMessageIdDetailsUsingGetParams; + options?: { [key: string]: unknown }; +}) { + const { messageId: param0, ...queryParams } = params; + + return request( + `/llmops/v2/api/workspaces/recommended/${param0}/details`, + { + method: 'GET', + params: { ...queryParams }, + ...(options || {}), + } + ); +} +/* eslint-disable */ +// @ts-ignore +import { queryOptions, useMutation } from '@tanstack/react-query'; +import type { DefaultError } from '@tanstack/react-query'; +import { request } from 'axios'; + +import * as apis from './workspaceGroup'; +import * as API from './types'; + +/** GetWorkspaceGroupList 空间分组列表 GET /llmops/v2/api/workspaces/${param0}/groups */ +export function v2ApiWorkspacesWorkspaceIdGroupsUsingGetQueryOptions(options: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v2ApiWorkspacesWorkspaceIdGroupsUsingGetParams; + options?: { [key: string]: unknown }; +}) { + return queryOptions({ + queryFn: async ({ queryKey }) => { + return apis.v2ApiWorkspacesWorkspaceIdGroupsUsingGet( + queryKey[1] as typeof options + ); + }, + queryKey: ['v2ApiWorkspacesWorkspaceIdGroupsUsingGet', options], + }); +} + +/** CreateWorkspaceGroup 创建空间分组 POST /llmops/v2/api/workspaces/${param0}/groups */ +export function useV2ApiWorkspacesWorkspaceIdGroupsUsingPostMutation(options?: { + onSuccess?: (value?: API.ListWorkspaceGroup) => void; + onError?: (error?: DefaultError) => void; +}) { + const { onSuccess, onError } = options || {}; + + const response = useMutation({ + mutationFn: apis.v2ApiWorkspacesWorkspaceIdGroupsUsingPost, + onSuccess(data: API.ListWorkspaceGroup) { + onSuccess?.(data); + }, + onError(error) { + onError?.(error); + }, + }); + + return response; +} + +/** UpdateWorkspaceGroup 更新分组 POST /llmops/v2/api/workspaces/${param0}/groups/${param1} */ +export function useV2ApiWorkspacesWorkspaceIdGroupsWorkspaceGroupIdUsingPostMutation(options?: { + onSuccess?: (value?: unknown) => void; + onError?: (error?: DefaultError) => void; +}) { + const { onSuccess, onError } = options || {}; + + const response = useMutation({ + mutationFn: apis.v2ApiWorkspacesWorkspaceIdGroupsWorkspaceGroupIdUsingPost, + onSuccess(data: unknown) { + onSuccess?.(data); + }, + onError(error) { + onError?.(error); + }, + }); + + return response; +} + +/** DeleteWorkspaceGroup 删除分组 DELETE /llmops/v2/api/workspaces/${param0}/groups/${param1} */ +export function useV2ApiWorkspacesWorkspaceIdGroupsWorkspaceGroupIdUsingDeleteMutation(options?: { + onSuccess?: (value?: unknown) => void; + onError?: (error?: DefaultError) => void; +}) { + const { onSuccess, onError } = options || {}; + + const response = useMutation({ + mutationFn: + apis.v2ApiWorkspacesWorkspaceIdGroupsWorkspaceGroupIdUsingDelete, + onSuccess(data: unknown) { + onSuccess?.(data); + }, + onError(error) { + onError?.(error); + }, + }); + + return response; +} +/* eslint-disable */ +// @ts-ignore +import { request } from 'axios'; + +import * as API from './types'; + +/** GetWorkspaceGroupList 空间分组列表 GET /llmops/v2/api/workspaces/${param0}/groups */ +export async function v2ApiWorkspacesWorkspaceIdGroupsUsingGet({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v2ApiWorkspacesWorkspaceIdGroupsUsingGetParams; + options?: { [key: string]: unknown }; +}) { + const { workspaceID: param0, ...queryParams } = params; + + return request( + `/llmops/v2/api/workspaces/${param0}/groups`, + { + method: 'GET', + params: { ...queryParams }, + ...(options || {}), + } + ); +} + +/** CreateWorkspaceGroup 创建空间分组 POST /llmops/v2/api/workspaces/${param0}/groups */ +export async function v2ApiWorkspacesWorkspaceIdGroupsUsingPost({ + params, + body, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v2ApiWorkspacesWorkspaceIdGroupsUsingPostParams; + body: API.WorkspaceGroupReq; + options?: { [key: string]: unknown }; +}) { + const { workspaceID: param0, ...queryParams } = params; + + return request( + `/llmops/v2/api/workspaces/${param0}/groups`, + { + method: 'POST', + params: { ...queryParams }, + data: body, + ...(options || {}), + } + ); +} + +/** UpdateWorkspaceGroup 更新分组 POST /llmops/v2/api/workspaces/${param0}/groups/${param1} */ +export async function v2ApiWorkspacesWorkspaceIdGroupsWorkspaceGroupIdUsingPost({ + params, + body, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v2ApiWorkspacesWorkspaceIdGroupsWorkspaceGroupIdUsingPostParams; + body: API.WorkspaceGroupReq; + options?: { [key: string]: unknown }; +}) { + const { + workspaceID: param0, + workspaceGroupID: param1, + ...queryParams + } = params; + + return request( + `/llmops/v2/api/workspaces/${param0}/groups/${param1}`, + { + method: 'POST', + params: { ...queryParams }, + data: body, + ...(options || {}), + } + ); +} + +/** DeleteWorkspaceGroup 删除分组 DELETE /llmops/v2/api/workspaces/${param0}/groups/${param1} */ +export async function v2ApiWorkspacesWorkspaceIdGroupsWorkspaceGroupIdUsingDelete({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v2ApiWorkspacesWorkspaceIdGroupsWorkspaceGroupIdUsingDeleteParams; + options?: { [key: string]: unknown }; +}) { + const { + workspaceID: param0, + workspaceGroupID: param1, + ...queryParams + } = params; + + return request( + `/llmops/v2/api/workspaces/${param0}/groups/${param1}`, + { + method: 'DELETE', + params: { ...queryParams }, + ...(options || {}), + } + ); +} diff --git "a/test/__snapshots__/common/\346\265\213\350\257\225\347\224\237\346\210\220 response type comments.snap" "b/test/__snapshots__/common/\346\265\213\350\257\225\347\224\237\346\210\220 response type comments.snap" new file mode 100644 index 0000000..74f45f4 --- /dev/null +++ "b/test/__snapshots__/common/\346\265\213\350\257\225\347\224\237\346\210\220 response type comments.snap" @@ -0,0 +1,60 @@ +/* eslint-disable */ +// @ts-ignore +import { request } from 'axios'; + +import * as API from './types'; + +/** 获取access_token > **为了安全考虑,开发者请勿将access_token返回给前端,需要开发者保存在后台,所有访问企业微信api的请求由后台发起**获取access_token是调用企业微信API接口的第一步,相当于创建了一个登录凭证,其它的业务API接口,都需要依赖于access_token来鉴权调用者身份。因此开发者,在使用业务接口前,要明确access_token的颁发来源,使用正确的access_token。**权限说明:**每个应用有独立的secret,获取到的access_token只能本应用使用,所以每个应用的access_token应该分开来获取。**注意事项:**开发者需要缓存access_token,用于后续接口的调用(注意:不能频繁调用gettoken接口,否则会受到频率拦截)。当access_token失效或过期时,需要重新获取。access_token的有效期通过返回的expires_in来传达,正常情况下为7200秒(2小时),有效期内重复获取返回相同结果,过期后获取会返回新的access_token。由于企业微信每个应用的access_token是彼此独立的,所以进行缓存时需要区分应用来进行存储。access_token至少保留512字节的存储空间。企业微信可能会出于运营需要,提前使access_token失效,开发者应实现access_token失效时重新获取的逻辑。 GET /cgi-bin/gettoken https://app.apifox.com/web/project/6276513/apis/api-288122020-run */ +export async function cgiBinGettokenUsingGet({ + params, + body, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.cgiBinGettokenUsingGetParams; + body: API.CgiBinGettokenUsingGetBody; + options?: { [key: string]: unknown }; +}) { + return request('/cgi-bin/gettoken', { + method: 'GET', + headers: { + 'Content-Type': 'application/json', + }, + params: { + ...params, + }, + data: body, + ...(options || {}), + }); +} +/* eslint-disable */ +// @ts-ignore +export * from './types'; + +export * from './gettoken'; +/* eslint-disable */ +// @ts-ignore + +export type CgiBinGettokenUsingGetBody = { + name: string; + email: string; + age?: number; +}; + +export type cgiBinGettokenUsingGetParams = { + /** 企业ID,获取方式参考:[术语说明-corpid](https://developer.work.weixin.qq.com/document/path/91039#14953/corpid) */ + corpid: string; + /** 应用的凭证密钥,获取方式参考:[术语说明-secret](https://developer.work.weixin.qq.com/document/path/91039#14953/secret) */ + corpsecret: string; +}; + +export type CgiBinGettokenUsingGetResponse = { + /** 出错返回码,为0表示成功,非0表示调用失败 */ + errcode: number; + /** 返回码提示语 */ + errmsg: string; + /** 获取到的凭证,最长为512字节 */ + access_token: string; + /** 凭证的有效时间(秒) */ + expires_in: number; +}; diff --git "a/test/__snapshots__/common/\346\265\213\350\257\225\347\224\237\346\210\220\345\214\277\345\220\215response =_ \345\205\267\345\220\215response.snap" "b/test/__snapshots__/common/\346\265\213\350\257\225\347\224\237\346\210\220\345\214\277\345\220\215response =_ \345\205\267\345\220\215response.snap" new file mode 100644 index 0000000..74f45f4 --- /dev/null +++ "b/test/__snapshots__/common/\346\265\213\350\257\225\347\224\237\346\210\220\345\214\277\345\220\215response =_ \345\205\267\345\220\215response.snap" @@ -0,0 +1,60 @@ +/* eslint-disable */ +// @ts-ignore +import { request } from 'axios'; + +import * as API from './types'; + +/** 获取access_token > **为了安全考虑,开发者请勿将access_token返回给前端,需要开发者保存在后台,所有访问企业微信api的请求由后台发起**获取access_token是调用企业微信API接口的第一步,相当于创建了一个登录凭证,其它的业务API接口,都需要依赖于access_token来鉴权调用者身份。因此开发者,在使用业务接口前,要明确access_token的颁发来源,使用正确的access_token。**权限说明:**每个应用有独立的secret,获取到的access_token只能本应用使用,所以每个应用的access_token应该分开来获取。**注意事项:**开发者需要缓存access_token,用于后续接口的调用(注意:不能频繁调用gettoken接口,否则会受到频率拦截)。当access_token失效或过期时,需要重新获取。access_token的有效期通过返回的expires_in来传达,正常情况下为7200秒(2小时),有效期内重复获取返回相同结果,过期后获取会返回新的access_token。由于企业微信每个应用的access_token是彼此独立的,所以进行缓存时需要区分应用来进行存储。access_token至少保留512字节的存储空间。企业微信可能会出于运营需要,提前使access_token失效,开发者应实现access_token失效时重新获取的逻辑。 GET /cgi-bin/gettoken https://app.apifox.com/web/project/6276513/apis/api-288122020-run */ +export async function cgiBinGettokenUsingGet({ + params, + body, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.cgiBinGettokenUsingGetParams; + body: API.CgiBinGettokenUsingGetBody; + options?: { [key: string]: unknown }; +}) { + return request('/cgi-bin/gettoken', { + method: 'GET', + headers: { + 'Content-Type': 'application/json', + }, + params: { + ...params, + }, + data: body, + ...(options || {}), + }); +} +/* eslint-disable */ +// @ts-ignore +export * from './types'; + +export * from './gettoken'; +/* eslint-disable */ +// @ts-ignore + +export type CgiBinGettokenUsingGetBody = { + name: string; + email: string; + age?: number; +}; + +export type cgiBinGettokenUsingGetParams = { + /** 企业ID,获取方式参考:[术语说明-corpid](https://developer.work.weixin.qq.com/document/path/91039#14953/corpid) */ + corpid: string; + /** 应用的凭证密钥,获取方式参考:[术语说明-secret](https://developer.work.weixin.qq.com/document/path/91039#14953/secret) */ + corpsecret: string; +}; + +export type CgiBinGettokenUsingGetResponse = { + /** 出错返回码,为0表示成功,非0表示调用失败 */ + errcode: number; + /** 返回码提示语 */ + errmsg: string; + /** 获取到的凭证,最长为512字节 */ + access_token: string; + /** 凭证的有效时间(秒) */ + expires_in: number; +}; diff --git "a/test/__snapshots__/common/\346\265\213\350\257\225\347\251\272\347\232\204 openapi \345\256\232\344\271\211.snap" "b/test/__snapshots__/common/\346\265\213\350\257\225\347\251\272\347\232\204 openapi \345\256\232\344\271\211.snap" new file mode 100644 index 0000000..1924b51 --- /dev/null +++ "b/test/__snapshots__/common/\346\265\213\350\257\225\347\251\272\347\232\204 openapi \345\256\232\344\271\211.snap" @@ -0,0 +1,6 @@ +/* eslint-disable */ +// @ts-ignore +export * from './types'; +/* eslint-disable */ +// @ts-ignore +export {}; diff --git "a/test/__snapshots__/common/\346\265\213\350\257\225\347\251\272\347\232\204 schema \345\274\225\347\224\250.snap" "b/test/__snapshots__/common/\346\265\213\350\257\225\347\251\272\347\232\204 schema \345\274\225\347\224\250.snap" new file mode 100644 index 0000000..887532a --- /dev/null +++ "b/test/__snapshots__/common/\346\265\213\350\257\225\347\251\272\347\232\204 schema \345\274\225\347\224\250.snap" @@ -0,0 +1,132 @@ +/* eslint-disable */ +// @ts-ignore +import * as API from './types'; + +export function displayBusinessTypeEnum(field: API.BusinessTypeEnum) { + return { + CLASSIFICATION: 'CLASSIFICATION', + DEVICE: 'DEVICE', + INSTRUMENT: 'INSTRUMENT', + }[field]; +} + +export function displayTimeIntervalEnum(field: API.TimeIntervalEnum) { + return { + DAY: 'DAY', + HALFHOUR: 'HALFHOUR', + HOUR: 'HOUR', + MINUTE: 'MINUTE', + MONTH: 'MONTH', + QUARTERHOUR: 'QUARTERHOUR', + YEAR: 'YEAR', + }[field]; +} + +export function displayTimeQueryTypeEnum(field: API.TimeQueryTypeEnum) { + return { NATURAL: 'NATURAL', SHIFT: 'SHIFT' }[field]; +} + +export function displayVsTypeEnum(field: API.VsTypeEnum) { + return { CLASSIFICATION: 'CLASSIFICATION', DEVICE: 'DEVICE', TIME: 'TIME' }[ + field + ]; +} +/* eslint-disable */ +// @ts-ignore +import { request } from 'axios'; + +import * as API from './types'; + +/** 分时电量查询 POST /electricity/classification/time-sharing-electricity */ +export async function electricityClassificationTimeSharingElectricityUsingPost({ + body, + options, +}: { + body: API.fenxiangshebaoziranshijiantongjichaxunDto; + options?: { [key: string]: unknown }; +}) { + return request( + '/electricity/classification/time-sharing-electricity', + { + method: 'POST', + headers: { + 'Content-Type': 'application/json', + }, + data: body, + ...(options || {}), + } + ); +} +/* eslint-disable */ +// @ts-ignore +export * from './types'; +export * from './displayEnumLabel'; + +export * from './fenxiangyongdimokuai6C76B49E435F7713E0531F0B10Ac7013'; +/* eslint-disable */ +// @ts-ignore + +export enum BusinessTypeEnum { + 'CLASSIFICATION' = 'CLASSIFICATION', + 'DEVICE' = 'DEVICE', + 'INSTRUMENT' = 'INSTRUMENT', +} + +export type IBusinessTypeEnum = keyof typeof BusinessTypeEnum; + +export type fenxiangshebaoziranshijiantongjichaxunDto = { + /** 业务类型 */ + businessType?: 'CLASSIFICATION' | 'DEVICE' | 'INSTRUMENT'; + /** 结束时间 */ + endTime?: string; + /** 能源类型 */ + energyType?: string; + /** 根据业务类型传勾选id */ + ids?: string[]; + /** 开始时间 */ + startTime?: string; + /** 时间粒度 */ + timeInterval?: + | 'DAY' + | 'HALFHOUR' + | 'HOUR' + | 'MINUTE' + | 'MONTH' + | 'QUARTERHOUR' + | 'YEAR'; + /** 查询类型 自然时间-NATURAL,班制时间-SHIFT */ + timeQueryType?: 'NATURAL' | 'SHIFT'; + /** 对比结束时间 */ + vsEndTime?: string; + /** 对比开始时间 */ + vsStartTime?: string; + /** 比较类型 */ + vsType?: 'CLASSIFICATION' | 'DEVICE' | 'TIME'; +}; + +export enum TimeIntervalEnum { + 'DAY' = 'DAY', + 'HALFHOUR' = 'HALFHOUR', + 'HOUR' = 'HOUR', + 'MINUTE' = 'MINUTE', + 'MONTH' = 'MONTH', + 'QUARTERHOUR' = 'QUARTERHOUR', + 'YEAR' = 'YEAR', +} + +export type ITimeIntervalEnum = keyof typeof TimeIntervalEnum; + +export enum TimeQueryTypeEnum { + 'NATURAL' = 'NATURAL', + 'SHIFT' = 'SHIFT', +} + +export type ITimeQueryTypeEnum = keyof typeof TimeQueryTypeEnum; + +export enum VsTypeEnum { + 'CLASSIFICATION' = 'CLASSIFICATION', + 'DEVICE' = 'DEVICE', + 'TIME' = 'TIME', +} + +export type IVsTypeEnum = keyof typeof VsTypeEnum; diff --git "a/test/__snapshots__/common/\346\265\213\350\257\225\347\255\233\351\200\211\345\207\272\346\214\207\345\256\232 tags \345\257\271\345\272\224\347\232\204api.snap" "b/test/__snapshots__/common/\346\265\213\350\257\225\347\255\233\351\200\211\345\207\272\346\214\207\345\256\232 tags \345\257\271\345\272\224\347\232\204api.snap" new file mode 100644 index 0000000..aa1aa51 --- /dev/null +++ "b/test/__snapshots__/common/\346\265\213\350\257\225\347\255\233\351\200\211\345\207\272\346\214\207\345\256\232 tags \345\257\271\345\272\224\347\232\204api.snap" @@ -0,0 +1,248 @@ +/* eslint-disable */ +// @ts-ignore +import * as API from './types'; + +export function displayStatusEnum(field: API.StatusEnum) { + return { available: 'available', pending: 'pending', sold: 'sold' }[field]; +} +/* eslint-disable */ +// @ts-ignore +export * from './types'; +export * from './displayEnumLabel'; + +export * from './pet'; +/* eslint-disable */ +// @ts-ignore +import { request } from 'axios'; + +import * as API from './types'; + +/** Update an existing pet Update an existing pet by Id PUT /pet */ +export async function petUsingPut({ + body, + options, +}: { + body: API.Pet; + options?: { [key: string]: unknown }; +}) { + return request('/pet', { + method: 'PUT', + headers: { + 'Content-Type': 'application/json', + }, + data: body, + ...(options || {}), + }); +} + +/** Add a new pet to the store Add a new pet to the store POST /pet */ +export async function petUsingPost({ + body, + options, +}: { + body: API.Pet; + options?: { [key: string]: unknown }; +}) { + return request('/pet', { + method: 'POST', + headers: { + 'Content-Type': 'application/json', + }, + data: body, + ...(options || {}), + }); +} + +/** Find pet by ID Returns a single pet GET /pet/${param0} */ +export async function petPetIdUsingGet({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.petPetIdUsingGetParams; + options?: { [key: string]: unknown }; +}) { + const { petId: param0, ...queryParams } = params; + + return request(`/pet/${param0}`, { + method: 'GET', + params: { ...queryParams }, + ...(options || {}), + }); +} + +/** Updates a pet in the store with form data POST /pet/${param0} */ +export async function petPetIdUsingPost({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.petPetIdUsingPostParams; + options?: { [key: string]: unknown }; +}) { + const { petId: param0, ...queryParams } = params; + + return request(`/pet/${param0}`, { + method: 'POST', + params: { + ...queryParams, + }, + ...(options || {}), + }); +} + +/** Deletes a pet DELETE /pet/${param0} */ +export async function petPetIdUsingDelete({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.petPetIdUsingDeleteParams; + options?: { [key: string]: unknown }; +}) { + const { petId: param0, ...queryParams } = params; + + return request(`/pet/${param0}`, { + method: 'DELETE', + params: { ...queryParams }, + ...(options || {}), + }); +} + +/** uploads an image POST /pet/${param0}/uploadImage */ +export async function petPetIdUploadImageUsingPost({ + params, + body, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.petPetIdUploadImageUsingPostParams; + body: API.PetPetIdUploadImageUsingPostBody; + options?: { [key: string]: unknown }; +}) { + const { petId: param0, ...queryParams } = params; + + return request(`/pet/${param0}/uploadImage`, { + method: 'POST', + headers: { + 'Content-Type': 'application/octet-stream', + }, + params: { + ...queryParams, + }, + data: body, + ...(options || {}), + }); +} + +/** Finds Pets by status Multiple status values can be provided with comma separated strings GET /pet/findByStatus */ +export async function petFindByStatusUsingGet({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.petFindByStatusUsingGetParams; + options?: { [key: string]: unknown }; +}) { + return request('/pet/findByStatus', { + method: 'GET', + params: { + // status has a default value: available + status: 'available', + ...params, + }, + ...(options || {}), + }); +} + +/** Finds Pets by tags Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. GET /pet/findByTags */ +export async function petFindByTagsUsingGet({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.petFindByTagsUsingGetParams; + options?: { [key: string]: unknown }; +}) { + return request('/pet/findByTags', { + method: 'GET', + params: { + ...params, + }, + ...(options || {}), + }); +} +/* eslint-disable */ +// @ts-ignore + +export type ApiResponse = { + code?: number; + type?: string; + message?: string; +}; + +export type Category = { + id?: number; + name?: string; +}; + +export type Pet = { + id?: number; + name: string; + category?: Category; + photoUrls: string[]; + tags?: Tag[]; + /** pet status in the store */ + status?: 'available' | 'pending' | 'sold'; +}; + +export type petFindByStatusUsingGetParams = { + /** Status values that need to be considered for filter */ + status?: 'available' | 'pending' | 'sold'; +}; + +export type petFindByTagsUsingGetParams = { + /** Tags to filter by */ + tags?: string[]; +}; + +export type PetPetIdUploadImageUsingPostBody = string; + +export type petPetIdUploadImageUsingPostParams = { + /** ID of pet to update */ + petId: number; + /** Additional Metadata */ + additionalMetadata?: string; +}; + +export type petPetIdUsingDeleteParams = { + /** Pet id to delete */ + petId: number; +}; + +export type petPetIdUsingGetParams = { + /** ID of pet to return */ + petId: number; +}; + +export type petPetIdUsingPostParams = { + /** ID of pet that needs to be updated */ + petId: number; + /** Name of pet that needs to be updated */ + name?: string; + /** Status of pet that needs to be updated */ + status?: string; +}; + +export enum StatusEnum { + 'available' = 'available', + 'pending' = 'pending', + 'sold' = 'sold', +} + +export type IStatusEnum = keyof typeof StatusEnum; + +export type Tag = { + id?: number; + name?: string; +}; diff --git "a/test/__snapshots__/common/\346\265\213\350\257\225\350\247\243\346\236\220 swagger.yaml_openapi.yaml.snap" "b/test/__snapshots__/common/\346\265\213\350\257\225\350\247\243\346\236\220 swagger.yaml_openapi.yaml.snap" new file mode 100644 index 0000000..312ae6a --- /dev/null +++ "b/test/__snapshots__/common/\346\265\213\350\257\225\350\247\243\346\236\220 swagger.yaml_openapi.yaml.snap" @@ -0,0 +1,571 @@ +/* eslint-disable */ +// @ts-ignore +import * as API from './types'; + +export function displayStatusEnum(field: API.StatusEnum) { + return { available: 'available', pending: 'pending', sold: 'sold' }[field]; +} + +export function displayStatusEnum2(field: API.StatusEnum2) { + return { placed: 'placed', approved: 'approved', delivered: 'delivered' }[ + field + ]; +} +/* eslint-disable */ +// @ts-ignore +export * from './types'; +export * from './displayEnumLabel'; + +export * from './pet'; +export * from './store'; +export * from './user'; +/* eslint-disable */ +// @ts-ignore +import { request } from 'axios'; + +import * as API from './types'; + +/** Update an existing pet PUT /pet */ +export async function petUsingPut({ + body, + options, +}: { + body: API.Pet; + options?: { [key: string]: unknown }; +}) { + return request('/pet', { + method: 'PUT', + headers: { + 'Content-Type': 'application/json', + }, + data: body, + ...(options || {}), + }); +} + +/** Add a new pet to the store POST /pet */ +export async function petUsingPost({ + body, + options, +}: { + body: API.Pet; + options?: { [key: string]: unknown }; +}) { + return request('/pet', { + method: 'POST', + headers: { + 'Content-Type': 'application/json', + }, + data: body, + ...(options || {}), + }); +} + +/** Find pet by ID Returns a single pet GET /pet/${param0} */ +export async function petPetIdUsingGet({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.petPetIdUsingGetParams; + options?: { [key: string]: unknown }; +}) { + const { petId: param0, ...queryParams } = params; + + return request(`/pet/${param0}`, { + method: 'GET', + params: { ...queryParams }, + ...(options || {}), + }); +} + +/** Updates a pet in the store with form data POST /pet/${param0} */ +export async function petPetIdUsingPost({ + params, + body, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.petPetIdUsingPostParams; + body: API.PetPetIdUsingPostBody; + options?: { [key: string]: unknown }; +}) { + const { petId: param0, ...queryParams } = params; + + return request(`/pet/${param0}`, { + method: 'POST', + headers: { + 'Content-Type': 'application/x-www-form-urlencoded', + }, + params: { ...queryParams }, + data: body, + ...(options || {}), + }); +} + +/** Deletes a pet DELETE /pet/${param0} */ +export async function petPetIdUsingDelete({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.petPetIdUsingDeleteParams; + options?: { [key: string]: unknown }; +}) { + const { petId: param0, ...queryParams } = params; + + return request(`/pet/${param0}`, { + method: 'DELETE', + params: { ...queryParams }, + ...(options || {}), + }); +} + +/** uploads an image POST /pet/${param0}/uploadImage */ +export async function petPetIdUploadImageUsingPost({ + params, + body, + file, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.petPetIdUploadImageUsingPostParams; + body: API.PetPetIdUploadImageUsingPostBody; + file?: File; + options?: { [key: string]: unknown }; +}) { + const { petId: param0, ...queryParams } = params; + const formData = new FormData(); + + if (file) { + formData.append('file', file); + } + + Object.keys(body).forEach((ele) => { + const item = (body as { [key: string]: any })[ele]; + + if (item !== undefined && item !== null) { + if (typeof item === 'object' && !(item instanceof File)) { + if (item instanceof Array) { + item.forEach((f) => formData.append(ele, f || '')); + } else { + formData.append(ele, JSON.stringify(item)); + } + } else { + formData.append(ele, item); + } + } + }); + + return request(`/pet/${param0}/uploadImage`, { + method: 'POST', + headers: { + 'Content-Type': 'multipart/form-data', + }, + params: { ...queryParams }, + data: formData, + ...(options || {}), + }); +} + +/** Finds Pets by status Multiple status values can be provided with comma separated strings GET /pet/findByStatus */ +export async function petFindByStatusUsingGet({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.petFindByStatusUsingGetParams; + options?: { [key: string]: unknown }; +}) { + return request('/pet/findByStatus', { + method: 'GET', + params: { + ...params, + }, + ...(options || {}), + }); +} + +/** Finds Pets by tags Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. GET /pet/findByTags */ +export async function petFindByTagsUsingGet({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.petFindByTagsUsingGetParams; + options?: { [key: string]: unknown }; +}) { + return request('/pet/findByTags', { + method: 'GET', + params: { + ...params, + }, + ...(options || {}), + }); +} +/* eslint-disable */ +// @ts-ignore +import { request } from 'axios'; + +import * as API from './types'; + +/** Returns pet inventories by status Returns a map of status codes to quantities GET /store/inventory */ +export async function storeInventoryUsingGet({ + options, +}: { + options?: { [key: string]: unknown }; +}) { + return request>('/store/inventory', { + method: 'GET', + ...(options || {}), + }); +} + +/** Place an order for a pet POST /store/order */ +export async function storeOrderUsingPost({ + body, + options, +}: { + body: API.Order; + options?: { [key: string]: unknown }; +}) { + return request('/store/order', { + method: 'POST', + headers: { + 'Content-Type': 'application/json', + }, + data: body, + ...(options || {}), + }); +} + +/** Find purchase order by ID For valid response try integer IDs with value >= 1 and <= 10. Other values will generated exceptions GET /store/order/${param0} */ +export async function storeOrderOrderIdUsingGet({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.storeOrderOrderIdUsingGetParams; + options?: { [key: string]: unknown }; +}) { + const { orderId: param0, ...queryParams } = params; + + return request(`/store/order/${param0}`, { + method: 'GET', + params: { ...queryParams }, + ...(options || {}), + }); +} + +/** Delete purchase order by ID For valid response try integer IDs with positive integer value. Negative or non-integer values will generate API errors DELETE /store/order/${param0} */ +export async function storeOrderOrderIdUsingDelete({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.storeOrderOrderIdUsingDeleteParams; + options?: { [key: string]: unknown }; +}) { + const { orderId: param0, ...queryParams } = params; + + return request(`/store/order/${param0}`, { + method: 'DELETE', + params: { ...queryParams }, + ...(options || {}), + }); +} +/* eslint-disable */ +// @ts-ignore + +export type ApiResponse = { + code?: number; + type?: string; + message?: string; +}; + +export type Category = { + id?: number; + name?: string; +}; + +export type Order = { + id?: number; + petId?: number; + quantity?: number; + shipDate?: string; + /** Order Status */ + status?: 'placed' | 'approved' | 'delivered'; + complete?: boolean; +}; + +export type Pet = { + id?: number; + category?: Category; + name: string; + photoUrls: string[]; + tags?: Tag[]; + /** pet status in the store */ + status?: 'available' | 'pending' | 'sold'; +}; + +export type petFindByStatusUsingGetParams = { + /** Status values that need to be considered for filter */ + status: ('available' | 'pending' | 'sold')[]; +}; + +export type petFindByTagsUsingGetParams = { + /** Tags to filter by */ + tags: string[]; +}; + +export type PetPetIdUploadImageUsingPostBody = { + /** Additional data to pass to server */ + additionalMetadata?: string; + /** file to upload */ + file?: string; +}; + +export type petPetIdUploadImageUsingPostParams = { + /** ID of pet to update */ + petId: number; +}; + +export type petPetIdUsingDeleteParams = { + /** Pet id to delete */ + petId: number; +}; + +export type petPetIdUsingGetParams = { + /** ID of pet to return */ + petId: number; +}; + +export type PetPetIdUsingPostBody = { + /** Updated name of the pet */ + name?: string; + /** Updated status of the pet */ + status?: string; +}; + +export type petPetIdUsingPostParams = { + /** ID of pet that needs to be updated */ + petId: number; +}; + +export enum StatusEnum { + 'available' = 'available', + 'pending' = 'pending', + 'sold' = 'sold', +} + +export type IStatusEnum = keyof typeof StatusEnum; + +export enum StatusEnum2 { + 'placed' = 'placed', + 'approved' = 'approved', + 'delivered' = 'delivered', +} + +export type IStatusEnum2 = keyof typeof StatusEnum2; + +export type storeOrderOrderIdUsingDeleteParams = { + /** ID of the order that needs to be deleted */ + orderId: number; +}; + +export type storeOrderOrderIdUsingGetParams = { + /** ID of pet that needs to be fetched */ + orderId: number; +}; + +export type Tag = { + id?: number; + name?: string; +}; + +export type User = { + id?: number; + username?: string; + firstName?: string; + lastName?: string; + email?: string; + password?: string; + phone?: string; + /** User Status */ + userStatus?: number; +}; + +export type UserCreateWithArrayUsingPostBody = API.User[]; + +export type UserCreateWithListUsingPostBody = API.User[]; + +export type userLoginUsingGetParams = { + /** The user name for login */ + username: string; + /** The password for login in clear text */ + password: string; +}; + +export type userUsernameUsingDeleteParams = { + /** The name that needs to be deleted */ + username: string; +}; + +export type userUsernameUsingGetParams = { + /** The name that needs to be fetched. Use user1 for testing. */ + username: string; +}; + +export type userUsernameUsingPutParams = { + /** name that need to be updated */ + username: string; +}; +/* eslint-disable */ +// @ts-ignore +import { request } from 'axios'; + +import * as API from './types'; + +/** Create user This can only be done by the logged in user. 返回值: successful operation POST /user */ +export async function userUsingPost({ + body, + options, +}: { + body: API.User; + options?: { [key: string]: unknown }; +}) { + return request('/user', { + method: 'POST', + headers: { + 'Content-Type': 'application/json', + }, + data: body, + ...(options || {}), + }); +} + +/** Get user by user name GET /user/${param0} */ +export async function userUsernameUsingGet({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.userUsernameUsingGetParams; + options?: { [key: string]: unknown }; +}) { + const { username: param0, ...queryParams } = params; + + return request(`/user/${param0}`, { + method: 'GET', + params: { ...queryParams }, + ...(options || {}), + }); +} + +/** Updated user This can only be done by the logged in user. PUT /user/${param0} */ +export async function userUsernameUsingPut({ + params, + body, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.userUsernameUsingPutParams; + body: API.User; + options?: { [key: string]: unknown }; +}) { + const { username: param0, ...queryParams } = params; + + return request(`/user/${param0}`, { + method: 'PUT', + headers: { + 'Content-Type': 'application/json', + }, + params: { ...queryParams }, + data: body, + ...(options || {}), + }); +} + +/** Delete user This can only be done by the logged in user. DELETE /user/${param0} */ +export async function userUsernameUsingDelete({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.userUsernameUsingDeleteParams; + options?: { [key: string]: unknown }; +}) { + const { username: param0, ...queryParams } = params; + + return request(`/user/${param0}`, { + method: 'DELETE', + params: { ...queryParams }, + ...(options || {}), + }); +} + +/** Creates list of users with given input array 返回值: successful operation POST /user/createWithArray */ +export async function userCreateWithArrayUsingPost({ + body, + options, +}: { + body: API.UserCreateWithArrayUsingPostBody; + options?: { [key: string]: unknown }; +}) { + return request('/user/createWithArray', { + method: 'POST', + headers: { + 'Content-Type': 'application/json', + }, + data: body, + ...(options || {}), + }); +} + +/** Creates list of users with given input array 返回值: successful operation POST /user/createWithList */ +export async function userCreateWithListUsingPost({ + body, + options, +}: { + body: API.UserCreateWithListUsingPostBody; + options?: { [key: string]: unknown }; +}) { + return request('/user/createWithList', { + method: 'POST', + headers: { + 'Content-Type': 'application/json', + }, + data: body, + ...(options || {}), + }); +} + +/** Logs user into the system GET /user/login */ +export async function userLoginUsingGet({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.userLoginUsingGetParams; + options?: { [key: string]: unknown }; +}) { + return request('/user/login', { + method: 'GET', + params: { + ...params, + }, + ...(options || {}), + }); +} + +/** Logs out current logged in user session 返回值: successful operation GET /user/logout */ +export async function userLogoutUsingGet({ + options, +}: { + options?: { [key: string]: unknown }; +}) { + return request('/user/logout', { + method: 'GET', + ...(options || {}), + }); +} diff --git "a/test/__snapshots__/common/\346\265\213\350\257\225\350\256\276\347\275\256 path \345\211\215\347\274\200.snap" "b/test/__snapshots__/common/\346\265\213\350\257\225\350\256\276\347\275\256 path \345\211\215\347\274\200.snap" new file mode 100644 index 0000000..1140c50 --- /dev/null +++ "b/test/__snapshots__/common/\346\265\213\350\257\225\350\256\276\347\275\256 path \345\211\215\347\274\200.snap" @@ -0,0 +1,571 @@ +/* eslint-disable */ +// @ts-ignore +import * as API from './types'; + +export function displayStatusEnum(field: API.StatusEnum) { + return { available: 'available', pending: 'pending', sold: 'sold' }[field]; +} + +export function displayStatusEnum2(field: API.StatusEnum2) { + return { placed: 'placed', approved: 'approved', delivered: 'delivered' }[ + field + ]; +} +/* eslint-disable */ +// @ts-ignore +export * from './types'; +export * from './displayEnumLabel'; + +export * from './pet'; +export * from './store'; +export * from './user'; +/* eslint-disable */ +// @ts-ignore +import { request } from 'axios'; + +import * as API from './types'; + +/** Update an existing pet PUT /pet */ +export async function petUsingPut({ + body, + options, +}: { + body: API.Pet; + options?: { [key: string]: unknown }; +}) { + return request(`/pet`, { + method: 'PUT', + headers: { + 'Content-Type': 'application/json', + }, + data: body, + ...(options || {}), + }); +} + +/** Add a new pet to the store POST /pet */ +export async function petUsingPost({ + body, + options, +}: { + body: API.Pet; + options?: { [key: string]: unknown }; +}) { + return request(`/pet`, { + method: 'POST', + headers: { + 'Content-Type': 'application/json', + }, + data: body, + ...(options || {}), + }); +} + +/** Find pet by ID Returns a single pet GET /pet/${param0} */ +export async function petPetIdUsingGet({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.petPetIdUsingGetParams; + options?: { [key: string]: unknown }; +}) { + const { petId: param0, ...queryParams } = params; + + return request(`/pet/${param0}`, { + method: 'GET', + params: { ...queryParams }, + ...(options || {}), + }); +} + +/** Updates a pet in the store with form data POST /pet/${param0} */ +export async function petPetIdUsingPost({ + params, + body, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.petPetIdUsingPostParams; + body: API.PetPetIdUsingPostBody; + options?: { [key: string]: unknown }; +}) { + const { petId: param0, ...queryParams } = params; + + return request(`/pet/${param0}`, { + method: 'POST', + headers: { + 'Content-Type': 'application/x-www-form-urlencoded', + }, + params: { ...queryParams }, + data: body, + ...(options || {}), + }); +} + +/** Deletes a pet DELETE /pet/${param0} */ +export async function petPetIdUsingDelete({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.petPetIdUsingDeleteParams; + options?: { [key: string]: unknown }; +}) { + const { petId: param0, ...queryParams } = params; + + return request(`/pet/${param0}`, { + method: 'DELETE', + params: { ...queryParams }, + ...(options || {}), + }); +} + +/** uploads an image POST /pet/${param0}/uploadImage */ +export async function petPetIdUploadImageUsingPost({ + params, + body, + file, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.petPetIdUploadImageUsingPostParams; + body: API.PetPetIdUploadImageUsingPostBody; + file?: File; + options?: { [key: string]: unknown }; +}) { + const { petId: param0, ...queryParams } = params; + const formData = new FormData(); + + if (file) { + formData.append('file', file); + } + + Object.keys(body).forEach((ele) => { + const item = (body as { [key: string]: any })[ele]; + + if (item !== undefined && item !== null) { + if (typeof item === 'object' && !(item instanceof File)) { + if (item instanceof Array) { + item.forEach((f) => formData.append(ele, f || '')); + } else { + formData.append(ele, JSON.stringify(item)); + } + } else { + formData.append(ele, item); + } + } + }); + + return request(`/pet/${param0}/uploadImage`, { + method: 'POST', + headers: { + 'Content-Type': 'multipart/form-data', + }, + params: { ...queryParams }, + data: formData, + ...(options || {}), + }); +} + +/** Finds Pets by status Multiple status values can be provided with comma separated strings GET /pet/findByStatus */ +export async function petFindByStatusUsingGet({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.petFindByStatusUsingGetParams; + options?: { [key: string]: unknown }; +}) { + return request(`/pet/findByStatus`, { + method: 'GET', + params: { + ...params, + }, + ...(options || {}), + }); +} + +/** Finds Pets by tags Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. GET /pet/findByTags */ +export async function petFindByTagsUsingGet({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.petFindByTagsUsingGetParams; + options?: { [key: string]: unknown }; +}) { + return request(`/pet/findByTags`, { + method: 'GET', + params: { + ...params, + }, + ...(options || {}), + }); +} +/* eslint-disable */ +// @ts-ignore +import { request } from 'axios'; + +import * as API from './types'; + +/** Returns pet inventories by status Returns a map of status codes to quantities GET /store/inventory */ +export async function storeInventoryUsingGet({ + options, +}: { + options?: { [key: string]: unknown }; +}) { + return request>(`/pet/store/inventory`, { + method: 'GET', + ...(options || {}), + }); +} + +/** Place an order for a pet POST /store/order */ +export async function storeOrderUsingPost({ + body, + options, +}: { + body: API.Order; + options?: { [key: string]: unknown }; +}) { + return request(`/pet/store/order`, { + method: 'POST', + headers: { + 'Content-Type': 'application/json', + }, + data: body, + ...(options || {}), + }); +} + +/** Find purchase order by ID For valid response try integer IDs with value >= 1 and <= 10. Other values will generated exceptions GET /store/order/${param0} */ +export async function storeOrderOrderIdUsingGet({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.storeOrderOrderIdUsingGetParams; + options?: { [key: string]: unknown }; +}) { + const { orderId: param0, ...queryParams } = params; + + return request(`/pet/store/order/${param0}`, { + method: 'GET', + params: { ...queryParams }, + ...(options || {}), + }); +} + +/** Delete purchase order by ID For valid response try integer IDs with positive integer value. Negative or non-integer values will generate API errors DELETE /store/order/${param0} */ +export async function storeOrderOrderIdUsingDelete({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.storeOrderOrderIdUsingDeleteParams; + options?: { [key: string]: unknown }; +}) { + const { orderId: param0, ...queryParams } = params; + + return request(`/pet/store/order/${param0}`, { + method: 'DELETE', + params: { ...queryParams }, + ...(options || {}), + }); +} +/* eslint-disable */ +// @ts-ignore + +export type ApiResponse = { + code?: number; + type?: string; + message?: string; +}; + +export type Category = { + id?: number; + name?: string; +}; + +export type Order = { + id?: number; + petId?: number; + quantity?: number; + shipDate?: string; + /** Order Status */ + status?: 'placed' | 'approved' | 'delivered'; + complete?: boolean; +}; + +export type Pet = { + id?: number; + category?: Category; + name: string; + photoUrls: string[]; + tags?: Tag[]; + /** pet status in the store */ + status?: 'available' | 'pending' | 'sold'; +}; + +export type petFindByStatusUsingGetParams = { + /** Status values that need to be considered for filter */ + status: ('available' | 'pending' | 'sold')[]; +}; + +export type petFindByTagsUsingGetParams = { + /** Tags to filter by */ + tags: string[]; +}; + +export type PetPetIdUploadImageUsingPostBody = { + /** Additional data to pass to server */ + additionalMetadata?: string; + /** file to upload */ + file?: string; +}; + +export type petPetIdUploadImageUsingPostParams = { + /** ID of pet to update */ + petId: number; +}; + +export type petPetIdUsingDeleteParams = { + /** Pet id to delete */ + petId: number; +}; + +export type petPetIdUsingGetParams = { + /** ID of pet to return */ + petId: number; +}; + +export type PetPetIdUsingPostBody = { + /** Updated name of the pet */ + name?: string; + /** Updated status of the pet */ + status?: string; +}; + +export type petPetIdUsingPostParams = { + /** ID of pet that needs to be updated */ + petId: number; +}; + +export enum StatusEnum { + 'available' = 'available', + 'pending' = 'pending', + 'sold' = 'sold', +} + +export type IStatusEnum = keyof typeof StatusEnum; + +export enum StatusEnum2 { + 'placed' = 'placed', + 'approved' = 'approved', + 'delivered' = 'delivered', +} + +export type IStatusEnum2 = keyof typeof StatusEnum2; + +export type storeOrderOrderIdUsingDeleteParams = { + /** ID of the order that needs to be deleted */ + orderId: number; +}; + +export type storeOrderOrderIdUsingGetParams = { + /** ID of pet that needs to be fetched */ + orderId: number; +}; + +export type Tag = { + id?: number; + name?: string; +}; + +export type User = { + id?: number; + username?: string; + firstName?: string; + lastName?: string; + email?: string; + password?: string; + phone?: string; + /** User Status */ + userStatus?: number; +}; + +export type UserCreateWithArrayUsingPostBody = API.User[]; + +export type UserCreateWithListUsingPostBody = API.User[]; + +export type userLoginUsingGetParams = { + /** The user name for login */ + username: string; + /** The password for login in clear text */ + password: string; +}; + +export type userUsernameUsingDeleteParams = { + /** The name that needs to be deleted */ + username: string; +}; + +export type userUsernameUsingGetParams = { + /** The name that needs to be fetched. Use user1 for testing. */ + username: string; +}; + +export type userUsernameUsingPutParams = { + /** name that need to be updated */ + username: string; +}; +/* eslint-disable */ +// @ts-ignore +import { request } from 'axios'; + +import * as API from './types'; + +/** Create user This can only be done by the logged in user. 返回值: successful operation POST /user */ +export async function userUsingPost({ + body, + options, +}: { + body: API.User; + options?: { [key: string]: unknown }; +}) { + return request(`/pet/user`, { + method: 'POST', + headers: { + 'Content-Type': 'application/json', + }, + data: body, + ...(options || {}), + }); +} + +/** Get user by user name GET /user/${param0} */ +export async function userUsernameUsingGet({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.userUsernameUsingGetParams; + options?: { [key: string]: unknown }; +}) { + const { username: param0, ...queryParams } = params; + + return request(`/pet/user/${param0}`, { + method: 'GET', + params: { ...queryParams }, + ...(options || {}), + }); +} + +/** Updated user This can only be done by the logged in user. PUT /user/${param0} */ +export async function userUsernameUsingPut({ + params, + body, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.userUsernameUsingPutParams; + body: API.User; + options?: { [key: string]: unknown }; +}) { + const { username: param0, ...queryParams } = params; + + return request(`/pet/user/${param0}`, { + method: 'PUT', + headers: { + 'Content-Type': 'application/json', + }, + params: { ...queryParams }, + data: body, + ...(options || {}), + }); +} + +/** Delete user This can only be done by the logged in user. DELETE /user/${param0} */ +export async function userUsernameUsingDelete({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.userUsernameUsingDeleteParams; + options?: { [key: string]: unknown }; +}) { + const { username: param0, ...queryParams } = params; + + return request(`/pet/user/${param0}`, { + method: 'DELETE', + params: { ...queryParams }, + ...(options || {}), + }); +} + +/** Creates list of users with given input array 返回值: successful operation POST /user/createWithArray */ +export async function userCreateWithArrayUsingPost({ + body, + options, +}: { + body: API.UserCreateWithArrayUsingPostBody; + options?: { [key: string]: unknown }; +}) { + return request(`/pet/user/createWithArray`, { + method: 'POST', + headers: { + 'Content-Type': 'application/json', + }, + data: body, + ...(options || {}), + }); +} + +/** Creates list of users with given input array 返回值: successful operation POST /user/createWithList */ +export async function userCreateWithListUsingPost({ + body, + options, +}: { + body: API.UserCreateWithListUsingPostBody; + options?: { [key: string]: unknown }; +}) { + return request(`/pet/user/createWithList`, { + method: 'POST', + headers: { + 'Content-Type': 'application/json', + }, + data: body, + ...(options || {}), + }); +} + +/** Logs user into the system GET /user/login */ +export async function userLoginUsingGet({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.userLoginUsingGetParams; + options?: { [key: string]: unknown }; +}) { + return request(`/pet/user/login`, { + method: 'GET', + params: { + ...params, + }, + ...(options || {}), + }); +} + +/** Logs out current logged in user session 返回值: successful operation GET /user/logout */ +export async function userLogoutUsingGet({ + options, +}: { + options?: { [key: string]: unknown }; +}) { + return request(`/pet/user/logout`, { + method: 'GET', + ...(options || {}), + }); +} diff --git "a/test/__snapshots__/common/\347\224\237\346\210\220\346\236\232\344\270\276\347\277\273\350\257\221, \347\224\237\346\210\220 type \347\277\273\350\257\221.snap" "b/test/__snapshots__/common/\347\224\237\346\210\220\346\236\232\344\270\276\347\277\273\350\257\221, \347\224\237\346\210\220 type \347\277\273\350\257\221.snap" new file mode 100644 index 0000000..7f9a6eb --- /dev/null +++ "b/test/__snapshots__/common/\347\224\237\346\210\220\346\236\232\344\270\276\347\277\273\350\257\221, \347\224\237\346\210\220 type \347\277\273\350\257\221.snap" @@ -0,0 +1,6044 @@ +/* eslint-disable */ +// @ts-ignore +import { request } from 'axios'; + +import * as API from './types'; + +/** AddAppKey 为应用添加各种类型机器人appkey POST /llmops/v1/api/robot/${param0}/appkey */ +export async function v1ApiRobotWorkspaceIdAppkeyUsingPost({ + params, + body, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v1ApiRobotWorkspaceIdAppkeyUsingPostParams; + body: API.AddAppkeyReq; + options?: { [key: string]: unknown }; +}) { + const { workspaceID: param0, ...queryParams } = params; + + return request(`/llmops/v1/api/robot/${param0}/appkey`, { + method: 'POST', + params: { ...queryParams }, + data: body, + ...(options || {}), + }); +} +/* eslint-disable */ +// @ts-ignore +import { request } from 'axios'; + +import * as API from './types'; + +/** ListApiToken 获取app 的 token 列表 GET /llmops/v1/api/app/${param0}/api-token */ +export async function v1ApiAppAppIdApiTokenUsingGet({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v1ApiAppAppIdApiTokenUsingGetParams; + options?: { [key: string]: unknown }; +}) { + const { appID: param0, ...queryParams } = params; + + return request( + `/llmops/v1/api/app/${param0}/api-token`, + { + method: 'GET', + params: { + ...queryParams, + }, + ...(options || {}), + } + ); +} + +/** CreateApiToken 创建 app 的token POST /llmops/v1/api/app/${param0}/api-token */ +export async function v1ApiAppAppIdApiTokenUsingPost({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v1ApiAppAppIdApiTokenUsingPostParams; + options?: { [key: string]: unknown }; +}) { + const { appID: param0, ...queryParams } = params; + + return request( + `/llmops/v1/api/app/${param0}/api-token`, + { + method: 'POST', + params: { ...queryParams }, + ...(options || {}), + } + ); +} +/* eslint-disable */ +// @ts-ignore +import { request } from 'axios'; + +import * as API from './types'; + +/** GetAppCostTokens 查询 app token消耗 POST /llmops/v1/api/${param0}/cost */ +export async function v1ApiAppIdCostUsingPost({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v1ApiAppIdCostUsingPostParams; + options?: { [key: string]: unknown }; +}) { + const { appID: param0, ...queryParams } = params; + + return request(`/llmops/v1/api/${param0}/cost`, { + method: 'POST', + params: { + ...queryParams, + }, + ...(options || {}), + }); +} + +/** CreateApp 创建 app POST /llmops/v1/api/app */ +export async function v1ApiAppUsingPost({ + body, + options, +}: { + body: API.CreateAppReq; + options?: { [key: string]: unknown }; +}) { + return request('/llmops/v1/api/app', { + method: 'POST', + data: body, + ...(options || {}), + }); +} + +/** DeleteApp 删除 app DELETE /llmops/v1/api/app/${param0}/delete */ +export async function v1ApiAppAppIdOpenApiDeleteUsingDelete({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v1ApiAppAppIdOpenApiDeleteUsingDeleteParams; + options?: { [key: string]: unknown }; +}) { + const { appID: param0, ...queryParams } = params; + + return request(`/llmops/v1/api/app/${param0}/delete`, { + method: 'DELETE', + params: { ...queryParams }, + ...(options || {}), + }); +} + +/** GetAppDetails 查询 app 详情 GET /llmops/v1/api/app/${param0}/details */ +export async function v1ApiAppAppIdDetailsUsingGet({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v1ApiAppAppIdDetailsUsingGetParams; + options?: { [key: string]: unknown }; +}) { + const { appID: param0, ...queryParams } = params; + + return request(`/llmops/v1/api/app/${param0}/details`, { + method: 'GET', + params: { ...queryParams }, + ...(options || {}), + }); +} + +/** GetSumHourlyMessagesCount 每小时messages数 GET /llmops/v1/api/app/${param0}/hourly-messages */ +export async function v1ApiAppAppIdHourlyMessagesUsingGet({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v1ApiAppAppIdHourlyMessagesUsingGetParams; + options?: { [key: string]: unknown }; +}) { + const { appID: param0, ...queryParams } = params; + + return request( + `/llmops/v1/api/app/${param0}/hourly-messages`, + { + method: 'GET', + params: { + ...queryParams, + }, + ...(options || {}), + } + ); +} + +/** GetSumHourlyToken 每小时token数 GET /llmops/v1/api/app/${param0}/hourly-token */ +export async function v1ApiAppAppIdHourlyTokenUsingGet({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v1ApiAppAppIdHourlyTokenUsingGetParams; + options?: { [key: string]: unknown }; +}) { + const { appID: param0, ...queryParams } = params; + + return request( + `/llmops/v1/api/app/${param0}/hourly-token`, + { + method: 'GET', + params: { + ...queryParams, + }, + ...(options || {}), + } + ); +} + +/** GetAppLogs 查询 app 日志与标注 GET /llmops/v1/api/app/${param0}/logs */ +export async function v1ApiAppAppIdLogsUsingGet({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v1ApiAppAppIdLogsUsingGetParams; + options?: { [key: string]: unknown }; +}) { + const { appID: param0, ...queryParams } = params; + + return request( + `/llmops/v1/api/app/${param0}/logs`, + { + method: 'GET', + params: { + ...queryParams, + }, + ...(options || {}), + } + ); +} + +/** GetLogsMessages 查询 app 日志与标注消息详情 GET /llmops/v1/api/app/${param0}/logs/${param1}/messages */ +export async function v1ApiAppAppIdLogsConversationIdMessagesUsingGet({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v1ApiAppAppIdLogsConversationIdMessagesUsingGetParams; + options?: { [key: string]: unknown }; +}) { + const { appID: param0, conversationID: param1, ...queryParams } = params; + + return request( + `/llmops/v1/api/app/${param0}/logs/${param1}/messages`, + { + method: 'GET', + params: { ...queryParams }, + ...(options || {}), + } + ); +} + +/** GetSumDailyMessagesCount 每日messages数 GET /llmops/v1/api/app/${param0}/messages */ +export async function v1ApiAppAppIdMessagesUsingGet({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v1ApiAppAppIdMessagesUsingGetParams; + options?: { [key: string]: unknown }; +}) { + const { appID: param0, ...queryParams } = params; + + return request( + `/llmops/v1/api/app/${param0}/messages`, + { + method: 'GET', + params: { + ...queryParams, + }, + ...(options || {}), + } + ); +} + +/** ShareChat 创建分享path PUT /llmops/v1/api/app/${param0}/share */ +export async function v1ApiAppAppIdShareUsingPut({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v1ApiAppAppIdShareUsingPutParams; + options?: { [key: string]: unknown }; +}) { + const { appID: param0, ...queryParams } = params; + + return request( + `/llmops/v1/api/app/${param0}/share`, + { + method: 'PUT', + params: { + ...queryParams, + }, + ...(options || {}), + } + ); +} + +/** GetSumDailyToken 每日token GET /llmops/v1/api/app/${param0}/token */ +export async function v1ApiAppAppIdTokenUsingGet({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v1ApiAppAppIdTokenUsingGetParams; + options?: { [key: string]: unknown }; +}) { + const { appID: param0, ...queryParams } = params; + + return request( + `/llmops/v1/api/app/${param0}/token`, + { + method: 'GET', + params: { + ...queryParams, + }, + ...(options || {}), + } + ); +} + +/** UpdateApp 更新 app PUT /llmops/v1/api/app/${param0}/update */ +export async function v1ApiAppAppIdUpdateUsingPut({ + params, + body, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v1ApiAppAppIdUpdateUsingPutParams; + body: API.UpdateAppReq; + options?: { [key: string]: unknown }; +}) { + const { appID: param0, ...queryParams } = params; + + return request(`/llmops/v1/api/app/${param0}/update`, { + method: 'PUT', + params: { ...queryParams }, + data: body, + ...(options || {}), + }); +} + +/** ReleaseDiscover 发布到发现 PUT /llmops/v1/api/app/${param0}/update_status */ +export async function v1ApiAppAppIdUpdateStatusUsingPut({ + params, + body, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v1ApiAppAppIdUpdateStatusUsingPutParams; + body: API.ReleaseDiscoverReq; + options?: { [key: string]: unknown }; +}) { + const { appID: param0, ...queryParams } = params; + + return request(`/llmops/v1/api/app/${param0}/update_status`, { + method: 'PUT', + params: { ...queryParams }, + data: body, + ...(options || {}), + }); +} + +/** GetImagePreSignedUrl 获取上传预签名地址 GET /llmops/v1/api/app/image */ +export async function v1ApiAppImageUsingGet({ + options, +}: { + options?: { [key: string]: unknown }; +}) { + return request('/llmops/v1/api/app/image', { + method: 'GET', + ...(options || {}), + }); +} + +/** ListApp 查询 app 列表 GET /llmops/v1/api/app/list */ +export async function v1ApiAppListUsingGet({ + options, +}: { + options?: { [key: string]: unknown }; +}) { + return request('/llmops/v1/api/app/list', { + method: 'GET', + ...(options || {}), + }); +} + +/** ListAppPick 查询精选 app 列表 GET /llmops/v1/api/app/list-pick */ +export async function v1ApiAppListPickUsingGet({ + options, +}: { + options?: { [key: string]: unknown }; +}) { + return request('/llmops/v1/api/app/list-pick', { + method: 'GET', + ...(options || {}), + }); +} + +/** ListAppByUser 查询用户关联的 app 列表 GET /llmops/v1/api/app/list-private */ +export async function v1ApiAppListPrivateUsingGet({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v1ApiAppListPrivateUsingGetParams; + options?: { [key: string]: unknown }; +}) { + return request('/llmops/v1/api/app/list-private', { + method: 'GET', + params: { + ...params, + }, + ...(options || {}), + }); +} + +/** ListAppPublic 查询公共 app 列表 GET /llmops/v1/api/app/list-public */ +export async function v1ApiAppListPublicUsingGet({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v1ApiAppListPublicUsingGetParams; + options?: { [key: string]: unknown }; +}) { + return request('/llmops/v1/api/app/list-public', { + method: 'GET', + params: { + ...params, + }, + ...(options || {}), + }); +} +/* eslint-disable */ +// @ts-ignore +import { request } from 'axios'; + +import * as API from './types'; + +/** GetAppDatasetConfigsList 查询应用知识库查询配置 GET /llmops/v1/api/app/${param0}/dataset-configs */ +export async function v1ApiAppAppIdDatasetConfigsUsingGet({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v1ApiAppAppIdDatasetConfigsUsingGetParams; + options?: { [key: string]: unknown }; +}) { + const { appID: param0, ...queryParams } = params; + + return request( + `/llmops/v1/api/app/${param0}/dataset-configs`, + { + method: 'GET', + params: { ...queryParams }, + ...(options || {}), + } + ); +} + +/** UpdateAppDatasetConfigs 更新应用知识库查询配置 PUT /llmops/v1/api/app/${param0}/dataset-configs */ +export async function v1ApiAppAppIdDatasetConfigsUsingPut({ + params, + body, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v1ApiAppAppIdDatasetConfigsUsingPutParams; + body: API.AppDatasetConfigs; + options?: { [key: string]: unknown }; +}) { + const { appID: param0, ...queryParams } = params; + + return request(`/llmops/v1/api/app/${param0}/dataset-configs`, { + method: 'PUT', + params: { ...queryParams }, + data: body, + ...(options || {}), + }); +} + +/** CreateAppDatasetConfigs 创建应用知识库查询配置 POST /llmops/v1/api/app/${param0}/dataset-configs */ +export async function v1ApiAppAppIdDatasetConfigsUsingPost({ + params, + body, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v1ApiAppAppIdDatasetConfigsUsingPostParams; + body: API.AppDatasetConfigs; + options?: { [key: string]: unknown }; +}) { + const { appID: param0, ...queryParams } = params; + + return request(`/llmops/v1/api/app/${param0}/dataset-configs`, { + method: 'POST', + params: { ...queryParams }, + data: body, + ...(options || {}), + }); +} + +/** DeleteAppDatasetConfigs 删除应用知识库查询配置 DELETE /llmops/v1/api/app/${param0}/dataset-configs */ +export async function v1ApiAppAppIdDatasetConfigsUsingDelete({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v1ApiAppAppIdDatasetConfigsUsingDeleteParams; + options?: { [key: string]: unknown }; +}) { + const { appID: param0, ...queryParams } = params; + + return request(`/llmops/v1/api/app/${param0}/dataset-configs`, { + method: 'DELETE', + params: { + ...queryParams, + }, + ...(options || {}), + }); +} +/* eslint-disable */ +// @ts-ignore +import { request } from 'axios'; + +import * as API from './types'; + +/** ListMember app下的用户列表 GET /llmops/v1/api/app/${param0}/member */ +export async function v1ApiAppAppIdMemberUsingGet({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v1ApiAppAppIdMemberUsingGetParams; + options?: { [key: string]: unknown }; +}) { + const { appID: param0, ...queryParams } = params; + + return request(`/llmops/v1/api/app/${param0}/member`, { + method: 'GET', + params: { + ...queryParams, + }, + ...(options || {}), + }); +} + +/** AddMember 增加app用户 POST /llmops/v1/api/app/${param0}/member */ +export async function v1ApiAppAppIdMemberUsingPost({ + params, + body, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v1ApiAppAppIdMemberUsingPostParams; + body: API.MemberBody; + options?: { [key: string]: unknown }; +}) { + const { appID: param0, ...queryParams } = params; + + return request(`/llmops/v1/api/app/${param0}/member`, { + method: 'POST', + params: { ...queryParams }, + data: body, + ...(options || {}), + }); +} + +/** DeleteMember 删除app用户 DELETE /llmops/v1/api/app/${param0}/member */ +export async function v1ApiAppAppIdMemberUsingDelete({ + params, + body, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v1ApiAppAppIdMemberUsingDeleteParams; + body: API.DeleteMemberBody; + options?: { [key: string]: unknown }; +}) { + const { appID: param0, ...queryParams } = params; + + return request(`/llmops/v1/api/app/${param0}/member`, { + method: 'DELETE', + params: { ...queryParams }, + data: body, + ...(options || {}), + }); +} + +/** UpdateMemberRole 更新app用户角色 PUT /llmops/v1/api/app/${param0}/member-role */ +export async function v1ApiAppAppIdMemberRoleUsingPut({ + params, + body, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v1ApiAppAppIdMemberRoleUsingPutParams; + body: API.MemberBody; + options?: { [key: string]: unknown }; +}) { + const { appID: param0, ...queryParams } = params; + + return request(`/llmops/v1/api/app/${param0}/member-role`, { + method: 'PUT', + params: { ...queryParams }, + data: body, + ...(options || {}), + }); +} +/* eslint-disable */ +// @ts-ignore +import { request } from 'axios'; + +import * as API from './types'; + +/** UpdateModelConfigs 更新 app model configs PUT /llmops/v1/api/app/${param0}/model-configs */ +export async function v1ApiAppAppIdModelConfigsUsingPut({ + params, + body, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v1ApiAppAppIdModelConfigsUsingPutParams; + body: API.AppModelConfigs; + options?: { [key: string]: unknown }; +}) { + const { appID: param0, ...queryParams } = params; + + return request(`/llmops/v1/api/app/${param0}/model-configs`, { + method: 'PUT', + params: { ...queryParams }, + data: body, + ...(options || {}), + }); +} + +/** CreateOrUpdateModelConfigs 创建 app model configs POST /llmops/v1/api/app/${param0}/model-configs */ +export async function v1ApiAppAppIdModelConfigsUsingPost({ + params, + body, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v1ApiAppAppIdModelConfigsUsingPostParams; + body: API.AppModelConfigs; + options?: { [key: string]: unknown }; +}) { + const { appID: param0, ...queryParams } = params; + + return request(`/llmops/v1/api/app/${param0}/model-configs`, { + method: 'POST', + params: { ...queryParams }, + data: body, + ...(options || {}), + }); +} + +/** CreateOrUpdateModelConfigPromptPrefix 创建或修改角色和背景以及推荐问题开关 POST /llmops/v1/api/app/${param0}/model-prompt */ +export async function v1ApiAppAppIdModelPromptUsingPost({ + params, + body, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v1ApiAppAppIdModelPromptUsingPostParams; + body: API.AppModelConfigPromptPrefix; + options?: { [key: string]: unknown }; +}) { + const { appID: param0, ...queryParams } = params; + + return request(`/llmops/v1/api/app/${param0}/model-prompt`, { + method: 'POST', + params: { ...queryParams }, + data: body, + ...(options || {}), + }); +} + +/** GetPluginList 获取插件列表 PUT /llmops/v1/api/app/${param0}/plugin */ +export async function v1ApiAppAppIdPluginUsingPut({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v1ApiAppAppIdPluginUsingPutParams; + options?: { [key: string]: unknown }; +}) { + const { appID: param0, ...queryParams } = params; + + return request(`/llmops/v1/api/app/${param0}/plugin`, { + method: 'PUT', + params: { ...queryParams }, + ...(options || {}), + }); +} +/* eslint-disable */ +// @ts-ignore +import { request } from 'axios'; + +import * as API from './types'; + +/** CreateAppV2 创建 app POST /llmops/v2/api/app */ +export async function v2ApiAppUsingPost({ + body, + options, +}: { + body: API.CreateAppReqV2; + options?: { [key: string]: unknown }; +}) { + return request('/llmops/v2/api/app', { + method: 'POST', + data: body, + ...(options || {}), + }); +} + +/** GetAppDetailsV2 查询 app 详情 GET /llmops/v2/api/app/${param0}/details */ +export async function v2ApiAppAppIdDetailsUsingGet({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v2ApiAppAppIdDetailsUsingGetParams; + options?: { [key: string]: unknown }; +}) { + const { appID: param0, ...queryParams } = params; + + return request(`/llmops/v2/api/app/${param0}/details`, { + method: 'GET', + params: { ...queryParams }, + ...(options || {}), + }); +} + +/** UpdateAppV2 更新 app 信息 POST /llmops/v2/api/app/${param0}/update */ +export async function v2ApiAppAppIdUpdateUsingPost({ + params, + body, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v2ApiAppAppIdUpdateUsingPostParams; + body: API.UpdateAppReqV2; + options?: { [key: string]: unknown }; +}) { + const { appID: param0, ...queryParams } = params; + + return request(`/llmops/v2/api/app/${param0}/update`, { + method: 'POST', + params: { ...queryParams }, + data: body, + ...(options || {}), + }); +} + +/** ListAppV2 查询用户关联的 app 列表 GET /llmops/v2/api/app/list */ +export async function v2ApiAppListUsingGet({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v2ApiAppListUsingGetParams; + options?: { [key: string]: unknown }; +}) { + return request('/llmops/v2/api/app/list', { + method: 'GET', + params: { + ...params, + }, + ...(options || {}), + }); +} + +/** GetApiTokenV2 获取一个 app token GET /llmops/v2/api/app/share/api-token */ +export async function v2ApiAppShareApiTokenUsingGet({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v2ApiAppShareApiTokenUsingGetParams; + options?: { [key: string]: unknown }; +}) { + return request( + '/llmops/v2/api/app/share/api-token', + { + method: 'GET', + params: { + ...params, + }, + ...(options || {}), + } + ); +} +/* eslint-disable */ +// @ts-ignore +import { request } from 'axios'; + +import * as API from './types'; + +/** ListAttentionApp 应用列表 GET /llmops/v1/api/attention/app/list */ +export async function v1ApiAttentionAppListUsingGet({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v1ApiAttentionAppListUsingGetParams; + options?: { [key: string]: unknown }; +}) { + return request('/llmops/v1/api/attention/app/list', { + method: 'GET', + params: { + ...params, + }, + ...(options || {}), + }); +} + +/** ListAttentionConversations 查询会话列表 POST /llmops/v1/api/attention/conversations */ +export async function v1ApiAttentionConversationsUsingPost({ + body, + options, +}: { + body: API.ListAttentionConversationReq; + options?: { [key: string]: unknown }; +}) { + return request( + '/llmops/v1/api/attention/conversations', + { + method: 'POST', + data: body, + ...(options || {}), + } + ); +} + +/** GetAttentionConversationCount 获取对话数 POST /llmops/v1/api/attention/conversations/count */ +export async function v1ApiAttentionConversationsCountUsingPost({ + body, + options, +}: { + body: API.GetAttentionDataCountReq; + options?: { [key: string]: unknown }; +}) { + return request( + '/llmops/v1/api/attention/conversations/count', + { + method: 'POST', + data: body, + ...(options || {}), + } + ); +} + +/** GetAttentionMessagesCount 获取消息数 POST /llmops/v1/api/attention/messages/count */ +export async function v1ApiAttentionMessagesCountUsingPost({ + body, + options, +}: { + body: API.GetAttentionDataCountReq; + options?: { [key: string]: unknown }; +}) { + return request( + '/llmops/v1/api/attention/messages/count', + { + method: 'POST', + data: body, + ...(options || {}), + } + ); +} + +/** GetAttentionMessagesHistory 获取聊天历史 GET /llmops/v1/api/attention/messages/history */ +export async function v1ApiAttentionMessagesHistoryUsingGet({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v1ApiAttentionMessagesHistoryUsingGetParams; + options?: { [key: string]: unknown }; +}) { + return request( + '/llmops/v1/api/attention/messages/history', + { + method: 'GET', + params: { + ...params, + }, + ...(options || {}), + } + ); +} + +/** CreateAttentionUser 添加特别关注 POST /llmops/v1/api/attention/user */ +export async function v1ApiAttentionUserUsingPost({ + body, + options, +}: { + body: API.CreateAttentionReq; + options?: { [key: string]: unknown }; +}) { + return request('/llmops/v1/api/attention/user', { + method: 'POST', + data: body, + ...(options || {}), + }); +} + +/** ListAllUser 系统全局用户列表 GET /llmops/v1/api/attention/user/all */ +export async function v1ApiAttentionUserAllUsingGet({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v1ApiAttentionUserAllUsingGetParams; + options?: { [key: string]: unknown }; +}) { + return request( + '/llmops/v1/api/attention/user/all', + { + method: 'GET', + params: { + // size has a default value: 10 + size: '10', + + ...params, + }, + ...(options || {}), + } + ); +} + +/** DeleteAttentionUser 取消特别关注 POST /llmops/v1/api/attention/user/cancel */ +export async function v1ApiAttentionUserCancelUsingPost({ + body, + options, +}: { + body: API.DeleteAttentionReq; + options?: { [key: string]: unknown }; +}) { + return request('/llmops/v1/api/attention/user/cancel', { + method: 'POST', + data: body, + ...(options || {}), + }); +} + +/** GetAttentionUserList 查询特别关注列表 POST /llmops/v1/api/attention/user/list */ +export async function v1ApiAttentionUserListUsingPost({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v1ApiAttentionUserListUsingPostParams; + options?: { [key: string]: unknown }; +}) { + return request( + '/llmops/v1/api/attention/user/list', + { + method: 'POST', + params: { + ...params, + }, + ...(options || {}), + } + ); +} +/* eslint-disable */ +// @ts-ignore +import { request } from 'axios'; + +import * as API from './types'; + +/** Authorize 获取code的跳转 GET /llmops/auth/authorize */ +export async function authAuthorizeUsingGet({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.authAuthorizeUsingGetParams; + options?: { [key: string]: unknown }; +}) { + return request('/llmops/auth/authorize', { + method: 'GET', + params: { + ...params, + }, + ...(options || {}), + }); +} +/* eslint-disable */ +// @ts-ignore +import { request } from 'axios'; + +import * as API from './types'; + +/** Messages Messages POST /llmops/v1/api/chat-messages */ +export async function v1ApiChatMessagesUsingPost({ + body, + options, +}: { + body: API.Chat; + options?: { [key: string]: unknown }; +}) { + return request('/llmops/v1/api/chat-messages', { + method: 'POST', + headers: { + 'Content-Type': 'application/json', + }, + data: body, + ...(options || {}), + }); +} + +/** WebMessages 分享页的聊天 POST /llmops/v1/api/chat-messages-web */ +export async function v1ApiChatMessagesWebUsingPost({ + body, + options, +}: { + body: API.Chat; + options?: { [key: string]: unknown }; +}) { + return request('/llmops/v1/api/chat-messages-web', { + method: 'POST', + headers: { + 'Content-Type': 'application/json', + }, + data: body, + ...(options || {}), + }); +} + +/** ChatMessage ChatMessage POST /llmops/v1/api/chat-messages/gpt */ +export async function v1ApiChatMessagesGptUsingPost({ + body, + options, +}: { + body: API.ChatMessageReq; + options?: { [key: string]: unknown }; +}) { + return request( + '/llmops/v1/api/chat-messages/gpt', + { + method: 'POST', + headers: { + 'Content-Type': 'application/json', + }, + data: body, + ...(options || {}), + } + ); +} + +/** QuestionRecommend QuestionRecommend POST /llmops/v1/api/chat-messages/question-recommend */ +export async function v1ApiChatMessagesQuestionRecommendUsingPost({ + body, + options, +}: { + body: API.QuestionRecommendReq; + options?: { [key: string]: unknown }; +}) { + return request( + '/llmops/v1/api/chat-messages/question-recommend', + { + method: 'POST', + headers: { + 'Content-Type': 'application/json', + }, + data: body, + ...(options || {}), + } + ); +} + +/** V2Messages 用于微精灵聊天的v2版本 POST /llmops/v2/api/chat-messages */ +export async function v2ApiChatMessagesUsingPost({ + body, + options, +}: { + body: API.Chat; + options?: { [key: string]: unknown }; +}) { + return request('/llmops/v2/api/chat-messages', { + method: 'POST', + headers: { + 'Content-Type': 'application/json', + }, + data: body, + ...(options || {}), + }); +} +/* eslint-disable */ +// @ts-ignore +import { request } from 'axios'; + +import * as API from './types'; + +/** ConversationList 会话历史 GET /llmops/v1/api/conversations */ +export async function v1ApiConversationsUsingGet({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v1ApiConversationsUsingGetParams; + options?: { [key: string]: unknown }; +}) { + return request('/llmops/v1/api/conversations', { + method: 'GET', + params: { + ...params, + }, + ...(options || {}), + }); +} + +/** DeleteConversation 删除会话 DELETE /llmops/v1/api/conversations */ +export async function v1ApiConversationsUsingDelete({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v1ApiConversationsUsingDeleteParams; + options?: { [key: string]: unknown }; +}) { + return request('/llmops/v1/api/conversations', { + method: 'DELETE', + params: { + ...params, + }, + ...(options || {}), + }); +} +/* eslint-disable */ +// @ts-ignore +import { request } from 'axios'; + +import * as API from './types'; + +/** CreateFeedbacks CreateFeedbacks POST /llmops/v1/api/feedbacks/${param0} */ +export async function v1ApiFeedbacksMessageIdUsingPost({ + params, + body, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v1ApiFeedbacksMessageIdUsingPostParams; + body: API.FeedbacksReqBody; + options?: { [key: string]: unknown }; +}) { + const { message_id: param0, ...queryParams } = params; + + return request( + `/llmops/v1/api/feedbacks/${param0}`, + { + method: 'POST', + headers: { + 'Content-Type': 'application/json', + }, + params: { ...queryParams }, + data: body, + ...(options || {}), + } + ); +} +/* eslint-disable */ +// @ts-ignore +import { request } from 'axios'; + +import * as API from './types'; + +/** CreateDatasetsJoin 创建 app 数据集关联 POST /llmops/v1/api/app/${param0}/datasets */ +export async function v1ApiAppAppIdDatasetsUsingPost({ + params, + body, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v1ApiAppAppIdDatasetsUsingPostParams; + body: API.V1ApiAppAppIdDatasetsUsingPostBody; + options?: { [key: string]: unknown }; +}) { + const { appID: param0, ...queryParams } = params; + + return request(`/llmops/v1/api/app/${param0}/datasets`, { + method: 'POST', + params: { ...queryParams }, + data: body, + ...(options || {}), + }); +} + +/** DeleteDatasetsJoin 删除 app 数据集关联 DELETE /llmops/v1/api/app/${param0}/datasets */ +export async function v1ApiAppAppIdDatasetsUsingDelete({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v1ApiAppAppIdDatasetsUsingDeleteParams; + options?: { [key: string]: unknown }; +}) { + const { appID: param0, ...queryParams } = params; + + return request(`/llmops/v1/api/app/${param0}/datasets`, { + method: 'DELETE', + params: { + ...queryParams, + }, + ...(options || {}), + }); +} +/* eslint-disable */ +// @ts-ignore +import { request } from 'axios'; + +import * as API from './types'; + +/** GetDatasetsList 数据集列表 GET /llmops/v1/api/app/${param0}/datasets-list */ +export async function v1ApiAppAppIdDatasetsListUsingGet({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v1ApiAppAppIdDatasetsListUsingGetParams; + options?: { [key: string]: unknown }; +}) { + const { appID: param0, ...queryParams } = params; + + return request( + `/llmops/v1/api/app/${param0}/datasets-list`, + { + method: 'GET', + params: { + ...queryParams, + }, + ...(options || {}), + } + ); +} +/* eslint-disable */ +// @ts-ignore +import { request } from 'axios'; + +import * as API from './types'; + +/** DeleteFeedbacks DeleteFeedbacks DELETE /llmops/v1/api/feedbacks/${param0} */ +export async function v1ApiFeedbacksMessageIdUsingDelete({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v1ApiFeedbacksMessageIdUsingDeleteParams; + options?: { [key: string]: unknown }; +}) { + const { message_id: param0, ...queryParams } = params; + + return request( + `/llmops/v1/api/feedbacks/${param0}`, + { + method: 'DELETE', + params: { + ...queryParams, + }, + ...(options || {}), + } + ); +} +/* eslint-disable */ +// @ts-ignore +import { request } from 'axios'; + +import * as API from './types'; + +/** DeleteKey 为应用添加各种类型机器人appkey DELETE /llmops/v1/api/robot/${param0}/appkey */ +export async function v1ApiRobotWorkspaceIdAppkeyUsingDelete({ + params, + body, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v1ApiRobotWorkspaceIdAppkeyUsingDeleteParams; + body: API.GetAppKeyReq; + options?: { [key: string]: unknown }; +}) { + const { workspaceID: param0, ...queryParams } = params; + + return request(`/llmops/v1/api/robot/${param0}/appkey`, { + method: 'DELETE', + params: { ...queryParams }, + data: body, + ...(options || {}), + }); +} +/* eslint-disable */ +// @ts-ignore +import * as API from './types'; + +export function displayPermissionEnum(field: API.Permission) { + return { + read_only: '只读权限', + operation: '操作权限', + no_permission: '无权限', + }[field]; +} + +export function displayProviderTypeEnum(field: API.ProviderType) { + return { + openai: 'openai', + spark: 'spark', + wenxin: 'wenxin', + rockai: 'rockai', + }[field]; +} + +export function displayRbacRoleEnum(field: API.RbacRole) { + return { + system_admin: '系统管理员', + system_user: '系统普通用户', + app_admin: 'app超管用户', + app_user: 'app普通用户', + }[field]; +} + +export function displayWorkspaceRoleEnum(field: API.WorkspaceRole) { + return { workspace_admin: '空间超管用户', workspace_user: '空间普通用户' }[ + field + ]; +} +/* eslint-disable */ +// @ts-ignore +import * as API from './types'; + +export function displayAddAppkeyReq(field: keyof API.AddAppkeyReq) { + return { + appid: 'appid', + appkey: 'appkey', + appsecret: 'appsecret', + encodingAESKey: 'encodingAESKey', + token: 'token', + type: 'wjl,dingding,feishu,wxa,wx', + }[field]; +} + +export function displayApiToken(field: keyof API.ApiToken) { + return { + apiTokenID: 'apiTokenID', + appID: 'appID', + createdAt: 'createdAt', + token: 'token', + updatedAt: 'updatedAt', + }[field]; +} + +export function displayApiTokenDataList(field: keyof API.ApiTokenDataList) { + return { + data: 'data', + total: 'total', + }[field]; +} + +export function displayApp(field: keyof API.App) { + return { + appID: 'appID', + appImage: 'appImage', + appStatus: 'appStatus', + appType: '应用类型', + createdAt: 'createdAt', + description: 'description', + groupID: 'groupID', + guidance: '开场提问引导', + name: 'name', + operator: 'operator', + priority: '应用优先级', + prologue: 'prologue', + recommendSwitch: 'recommendSwitch', + templateStatus: '是否模版', + updatedAt: 'updatedAt', + workspaceID: 'workspaceID', + }[field]; +} + +export function displayAppDataset(field: keyof API.AppDataset) { + return { + description: '描述', + llmDesc: 'llm描述', + name: '知识库名', + }[field]; +} + +export function displayAppDatasetConfig(field: keyof API.AppDatasetConfig) { + return { + appDatasetConfigID: 'appDatasetConfigID', + appID: 'appID', + createdAt: 'createdAt', + minScore: 'minScore', + searchSource: 'searchSource', + timeoutSecond: 'timeoutSecond', + topK: 'topK', + updatedAt: 'updatedAt', + }[field]; +} + +export function displayAppDatasetConfigs(field: keyof API.AppDatasetConfigs) { + return { + minScore: '最低分数', + searchSource: '知识库源,默认 warehouse', + timeoutSecond: '知识库查询超时时间', + topK: '知识库条数', + }[field]; +} + +export function displayAppDatasets(field: keyof API.AppDatasets) { + return { + appCount: 'appCount', + author: 'author', + datasetID: 'datasetID', + datasetName: 'datasetName', + docCount: 'docCount', + state: 'state', + }[field]; +} + +export function displayAppDetail(field: keyof API.AppDetail) { + return { + AnswerTokensCount: '消耗输出token', + appDatasetConfig: 'appDatasetConfig', + appDatasets: '数据集Id列表', + appGroupID: 'appGroupID', + appID: 'appID', + appImage: '应用头像', + appName: '应用名', + appPrePrompt: 'PrePrompt', + appPromptPrefix: 'appPromptPrefix', + appProvider: '模型', + appProviderID: + 'AppDatasetSource database2.AppDatasetSourceInfo `json:"appDatasetSource"`', + appProviderName: '模型名', + appRecommendedContext: '推荐内容', + appStatus: 'appStatus', + appToken: '应用token列表', + configs: 'configs', + conversationCount: '会话总数', + createAt: 'createAt', + description: '应用描述', + guidance: '开场提问引导', + h5RandomPath: 'H5随机分享路径', + historyLimit: 'historyLimit', + messagesCount: '消息总数', + pcRandomPath: 'PC随机分享路径', + prologue: '开场白', + queryTokensCount: '消耗输入token', + switchRecommendedQuestion: 'switchRecommendedQuestion', + templateStatus: 'templateStatus', + totalTokens: '消耗总token', + workspaceID: 'workspaceID', + }[field]; +} + +export function displayAppMessagesCount(field: keyof API.AppMessagesCount) { + return { + total: 'total', + }[field]; +} + +export function displayAppModelConfigPromptPrefix( + field: keyof API.AppModelConfigPromptPrefix +) { + return { + background: 'background', + role: 'role', + switchRecommendedQuestion: 'switchRecommendedQuestion', + }[field]; +} + +export function displayAppModelConfigs(field: keyof API.AppModelConfigs) { + return { + configs: 'configs', + prePrompt: 'prePrompt', + providerId: 'providerId', + }[field]; +} + +export function displayAppRecommendedContext( + field: keyof API.AppRecommendedContext +) { + return { + appID: 'appID', + appRecommendedContextID: 'appRecommendedContextID', + context: 'context', + createdAt: 'createdAt', + description: 'description', + name: 'name', + updatedAt: 'updatedAt', + }[field]; +} + +export function displayAppRecommendedContext2( + field: keyof API.AppRecommendedContext2 +) { + return { + context: 'context', + description: 'description', + id: 'id', + name: 'name', + }[field]; +} + +export function displayAppRecommendedContext3( + field: keyof API.AppRecommendedContext3 +) { + return { + context: 'context', + description: 'description', + id: 'id', + name: 'name', + }[field]; +} + +export function displayAppRecommendedContextResp( + field: keyof API.AppRecommendedContextResp +) { + return { + questions: 'questions', + recommendSwitch: 'recommendSwitch', + }[field]; +} + +export function displayAppResp(field: keyof API.AppResp) { + return { + appGroupID: 'appGroupID', + appGroupName: 'appGroupName', + appImage: 'appImage', + appStatus: 'appStatus', + createAt: 'createAt', + datasetCount: 'datasetCount', + description: 'description', + h5: 'h5', + id: 'id', + name: 'name', + pc: 'pc', + workspaceID: 'workspaceID', + }[field]; +} + +export function displayAppWithPermission(field: keyof API.AppWithPermission) { + return { + appID: 'appID', + appImage: 'appImage', + appStatus: 'appStatus', + appType: '应用类型', + createdAt: 'createdAt', + description: 'description', + groupID: 'groupID', + guidance: '开场提问引导', + isAppAdmin: 'isAppAdmin', + name: 'name', + operator: 'operator', + priority: '应用优先级', + prologue: 'prologue', + recommendSwitch: 'recommendSwitch', + templateStatus: '是否模版', + updatedAt: 'updatedAt', + workspaceID: 'workspaceID', + }[field]; +} + +export function displayAttentionDataCountResp( + field: keyof API.AttentionDataCountResp +) { + return { + total: 'total', + }[field]; +} + +export function displayAttentionUser(field: keyof API.AttentionUser) { + return { + email: 'email', + isAttentionUser: 'isAttentionUser', + phone: 'phone', + userID: 'userID', + userName: 'userName', + }[field]; +} + +export function displayAttentionUserResp(field: keyof API.AttentionUserResp) { + return { + email: 'email', + lastMessageTime: 'lastMessageTime', + phone: 'phone', + userID: 'userID', + userName: 'userName', + }[field]; +} + +export function displayauthAuthorizeUsingGetParams( + field: keyof API.authAuthorizeUsingGetParams +) { + return { + redirect_uri: '业务回调地址', + state: '保持请求和回调的状态,授权成功后会回传该参数', + }[field]; +} + +export function displayauthExchangeUsingGetParams( + field: keyof API.authExchangeUsingGetParams +) { + return { + code: 'code', + redirect_uri: '业务回调地址', + }[field]; +} + +export function displayChat(field: keyof API.Chat) { + return { + conversation_id: 'conversation_id', + inputs: 'inputs', + isIgnore: 'isIgnore', + query: 'query', + response_mode: 'response_mode', + user: 'user', + }[field]; +} + +export function displayChatMessageReq(field: keyof API.ChatMessageReq) { + return { + prompt: 'prompt', + query: 'query', + }[field]; +} + +export function displayConversationLogsResp( + field: keyof API.ConversationLogsResp +) { + return { + AnswerTokensCount: '消耗输出token', + appID: 'appID', + conversationID: 'conversationID', + conversationName: 'conversationName', + createdAt: 'createdAt', + messagesCount: 'messagesCount', + queryTokensCount: '消耗输入token', + totalTokens: '消耗总token', + userID: 'userID', + userInfo: 'userInfo', + }[field]; +} + +export function displayConversationMsg(field: keyof API.ConversationMsg) { + return { + conversationId: 'conversationId', + createAt: 'createAt', + name: 'name', + userId: 'userId', + }[field]; +} + +export function displayConversationResp(field: keyof API.ConversationResp) { + return { + AnswerTokensCount: '消耗输出token', + appID: 'appID', + appName: 'appName', + conversationID: 'conversationID', + conversationName: 'conversationName', + createdAt: 'createdAt', + lastMessagesTime: 'lastMessagesTime', + messagesCount: 'messagesCount', + queryTokensCount: '消耗输入token', + totalTokens: '消耗总token', + userID: 'userID', + userInfo: 'userInfo', + }[field]; +} + +export function displayCopyAppReq(field: keyof API.CopyAppReq) { + return { + appID: 'appID', + workspaceID: 'workspaceID', + }[field]; +} + +export function displayCreateApiTokenRESP(field: keyof API.CreateApiTokenRESP) { + return { + token: 'token', + }[field]; +} + +export function displayCreateAppReq(field: keyof API.CreateAppReq) { + return { + description: 'description', + guidance: 'guidance', + name: 'name', + prologue: 'prologue', + }[field]; +} + +export function displayCreateAppReqV2(field: keyof API.CreateAppReqV2) { + return { + appDescription: 'appDescription', + appGroupID: 'appGroupID', + appGuidance: '提示查询', + appImage: 'appImage', + appName: 'appName', + appPrologue: '开场白', + historyLimit: 'historyLimit', + modelConfigs: 'modelConfigs', + prePrompt: 'prePrompt', + providerId: 'providerId', + }[field]; +} + +export function displayCreateAttentionReq(field: keyof API.CreateAttentionReq) { + return { + followeeUserIDList: 'followeeUserIDList', + iamID: 'iamID', + }[field]; +} + +export function displayCreateSharePathRESP( + field: keyof API.CreateSharePathRESP +) { + return { + path: 'path', + }[field]; +} + +export function displayData(field: keyof API.Data) { + return { + appkey: 'appkey', + appsecret: 'appsecret', + state: '0-未开启,1-开启', + url: 'url', + wxExtra: 'wxExtra', + }[field]; +} + +export function displayDatasetData(field: keyof API.DatasetData) { + return { + author: 'author', + description: 'description', + docCount: 'docCount', + document_count: 'document_count', + id: 'id', + name: 'name', + permission: 'permission', + state: 'state', + uuid: 'uuid', + word_count: 'word_count', + }[field]; +} + +export function displayDeleteAttentionReq(field: keyof API.DeleteAttentionReq) { + return { + followeeUserIDList: 'followeeUserIDList', + iamID: 'iamID', + }[field]; +} + +export function displayDeleteMemberBody(field: keyof API.DeleteMemberBody) { + return { + userID: '用户id', + }[field]; +} + +export function displayDeleteResp(field: keyof API.DeleteResp) { + return { + msg: 'msg', + }[field]; +} + +export function displayErrorResp(field: keyof API.ErrorResp) { + return { + msg: 'msg', + type: 'type', + }[field]; +} + +export function displayExchangeTokenRESP(field: keyof API.ExchangeTokenRESP) { + return { + access_token: '访问令牌', + expires_in: '访问令牌过期时间', + refresh_expires_in: '刷新令牌过期时间', + refresh_token: '刷新令牌', + token_type: '令牌类型', + }[field]; +} + +export function displayFeedback(field: keyof API.Feedback) { + return { + comment: '评论', + conversation_id: 'conversation_id', + createdAt: 'createdAt', + message_id: 'message_id', + rating: 'like/unlike', + score: '打分', + updatedAt: 'updatedAt', + }[field]; +} + +export function displayFeedbacksReqBody(field: keyof API.FeedbacksReqBody) { + return { + comment: '评论', + conversation_id: 'conversation_id', + rating: 'like/unlike', + score: '分数1-10', + }[field]; +} + +export function displayFilestreamResp(field: keyof API.FilestreamResp) { + return { + conversation_id: 'conversation_id', + }[field]; +} + +export function displayGetApiTokenByRandomPathRESP( + field: keyof API.GetApiTokenByRandomPathRESP +) { + return { + apiTokenID: 'apiTokenID', + appID: 'appID', + appName: 'appName', + createdAt: 'createdAt', + recommendedContext: 'recommendedContext', + switchRecommendedContext: 'switchRecommendedContext', + switchRecommendedQuestion: 'switchRecommendedQuestion', + token: 'token', + updatedAt: 'updatedAt', + }[field]; +} + +export function displayGetAppKeyReq(field: keyof API.GetAppKeyReq) { + return { + appid: 'appid', + type: 'wjl,dingding,feishu,wxa,wx', + }[field]; +} + +export function displayGetAttentionDataCountReq( + field: keyof API.GetAttentionDataCountReq +) { + return { + appIDList: 'appIDList', + iamID: 'iamID', + userID: 'userID', + }[field]; +} + +export function displayGetImagePreSignedUrlResp( + field: keyof API.GetImagePreSignedUrlResp +) { + return { + appImage: 'appImage', + preSignedPutUrl: 'preSignedPutUrl', + }[field]; +} + +export function displayGuidances(field: keyof API.Guidances) { + return { + items: 'items', + }[field]; +} + +export function displayHistoryInfo(field: keyof API.HistoryInfo) { + return { + Rating: 'like/unlike', + answer: 'answer', + answerToken: 'answerToken', + comment: '评论', + createAt: 'createAt', + format: 'format', + messageId: 'messageId', + query: 'query', + queryToken: 'queryToken', + score: '打分', + totalToken: 'totalToken', + }[field]; +} + +export function displayIAMUserInfo(field: keyof API.IAMUserInfo) { + return { + createdTime: '创建时间', + email: 'Cid string `json:"cid"`', + id: '用户id', + idpId: 'idpId', + isAdmin: '是否iam管理员', + isAppAdmin: 'isAppAdmin', + isRkUser: '是否罗克佳华人员', + isSuperUser: '是否超级管理员', + isSystemAdmin: 'isSystemAdmin', + lastTime: 'Deleted int32 `json:"deleted"` // 逻辑删除', + loginName: '登录名', + msgType: '消息类型', + phone: '电话', + rkUserCard: '罗克佳华用户账号', + sign: '个性签名', + status: '状态:1可用;0未激活;-1禁用', + updatedTime: '修改时间', + useType: '用户类型', + userName: '用户名', + wechatAppId: 'wechatAppId', + wechatSwitch: 'wechatSwitch', + wechatgzhSwitch: 'wechatgzhSwitch', + }[field]; +} + +export function displayListAllAttentionUser( + field: keyof API.ListAllAttentionUser +) { + return { + data: 'data', + total: 'total', + }[field]; +} + +export function displayListAppDatasetConfigResp( + field: keyof API.ListAppDatasetConfigResp +) { + return { + data: 'data', + total: 'total', + }[field]; +} + +export function displayListAppDatasets(field: keyof API.ListAppDatasets) { + return { + Data: 'Data', + total: 'total', + }[field]; +} + +export function displayListAppResp(field: keyof API.ListAppResp) { + return { + data: 'data', + total: 'total', + }[field]; +} + +export function displayListAttentionConversationReq( + field: keyof API.ListAttentionConversationReq +) { + return { + appIDList: 'appIDList', + iamID: 'iamID', + offset: 'offset', + size: 'size', + userID: 'userID', + }[field]; +} + +export function displayListAttentionUserResp( + field: keyof API.ListAttentionUserResp +) { + return { + data: 'data', + total: 'total', + }[field]; +} + +export function displayListConversationLogsResp( + field: keyof API.ListConversationLogsResp +) { + return { + data: 'data', + total: 'total', + }[field]; +} + +export function displayListConversationResp( + field: keyof API.ListConversationResp +) { + return { + data: 'data', + total: 'total', + }[field]; +} + +export function displayListDatasetsResp(field: keyof API.ListDatasetsResp) { + return { + data: 'data', + has_more: 'has_more', + offset: 'offset', + size: 'size', + total: 'total', + }[field]; +} + +export function displayListFeedbacksResp(field: keyof API.ListFeedbacksResp) { + return { + data: 'data', + total: 'total', + }[field]; +} + +export function displayListMemberRESP(field: keyof API.ListMemberRESP) { + return { + data: 'data', + total: 'total', + }[field]; +} + +export function displayListProviderResp(field: keyof API.ListProviderResp) { + return { + data: 'data', + total: 'total', + }[field]; +} + +export function displayListUserWithAppRESP( + field: keyof API.ListUserWithAppRESP +) { + return { + data: 'data', + total: 'total', + }[field]; +} + +export function displayListWorkspaceGroup(field: keyof API.ListWorkspaceGroup) { + return { + data: 'data', + }[field]; +} + +export function displayListWorkspacePermissions( + field: keyof API.ListWorkspacePermissions +) { + return { + data: 'data', + total: 'total', + }[field]; +} + +export function displayMemberBody(field: keyof API.MemberBody) { + return { + role: '角色(system_admin-系统管理员;system_user-系统管普通用户;app_admin-应用管理员;app_user-应用普通用户)', + userID: '用户id', + }[field]; +} + +export function displayMemberWithRoleData(field: keyof API.MemberWithRoleData) { + return { + appRole: '应用角色', + createdAt: 'createdAt', + email: 'email', + idpID: 'idpID', + isAppAdmin: '是否是app管理员', + isSystemAdmin: '是否是系统管理员', + operator: 'operator', + phone: 'phone', + role: '角色(系统管理员、系统普通用户)', + updatedAt: 'updatedAt', + userID: 'iam 用户id', + userName: 'userName', + }[field]; +} + +export function displayMessagesCountResp(field: keyof API.MessagesCountResp) { + return { + messagesCount: '请求消耗token', + time: 'time', + }[field]; +} + +export function displayMessagesTokenResp(field: keyof API.MessagesTokenResp) { + return { + answerToken: '回答消耗token', + queryToken: '请求消耗token', + time: 'time', + totalToken: 'totalToken', + }[field]; +} + +export function displayModelConfigsMap(field: keyof API.ModelConfigsMap) { + return { + model_type: + '模型(ERNIE-Bot-4;ERNIE-Bot;ERNIE-Bot-turbo;gpt-3.5-turbo-16k;gpt-4-1106-preview)', + penalty_score: + '通过对已生成的token增加惩罚,减少重复生成的现象。取值范围:[1.0, 2.0]', + temperature: + '较高的数值会使输出更加随机,而较低的数值会使其更加集中和确定。默认0.95,范围 (0, 1.0]', + tools_call: 'tools call', + top_p: + '影响输出文本的多样性,取值越大,生成文本的多样性越强。取值范围 [0, 1.0]', + }[field]; +} + +export function displayModelConfigsMap2(field: keyof API.ModelConfigsMap2) { + return { + model_type: + '模型(ERNIE-Bot-4;ERNIE-Bot;ERNIE-Bot-turbo;gpt-3.5-turbo-16k;gpt-4-1106-preview)', + penalty_score: + '通过对已生成的token增加惩罚,减少重复生成的现象。取值范围:[1.0, 2.0]', + temperature: + '较高的数值会使输出更加随机,而较低的数值会使其更加集中和确定。默认0.95,范围 (0, 1.0]', + tools_call: 'tools_call', + top_p: + '影响输出文本的多样性,取值越大,生成文本的多样性越强。取值范围 [0, 1.0]', + }[field]; +} + +export function displayProviderResp(field: keyof API.ProviderResp) { + return { + name: '名字', + providerID: 'providerID', + subType: 'subType', + type: '类型', + }[field]; +} + +export function displayQueryTokenResp(field: keyof API.QueryTokenResp) { + return { + AnswerTokensCount: '消耗输出token', + queryTokensCount: '消耗输入token', + totalTokens: '消耗总token', + }[field]; +} + +export function displayQuestionRecommendReq( + field: keyof API.QuestionRecommendReq +) { + return { + conversation_id: 'conversation_id', + user: 'Query string `json:"query"`Answer string `json:"answer"`', + }[field]; +} + +export function displayRecommendQuestionAndContext( + field: keyof API.RecommendQuestionAndContext +) { + return { + contexts: 'contexts', + questions: 'questions', + }[field]; +} + +export function displayRefreshTokenBody(field: keyof API.RefreshTokenBody) { + return { + refreshToken: 'refreshToken', + }[field]; +} + +export function displayReleaseDiscoverReq(field: keyof API.ReleaseDiscoverReq) { + return { + alterAppID: 'alterAppID', + appType: '应用类型', + templateStatus: '是否作为模版 TRUE:作为模版;FALSE:不作为', + }[field]; +} + +export function displayResponseData(field: keyof API.ResponseData) { + return { + answer: 'answer', + conversation_id: 'conversation_id', + created_at: 'created_at', + event: 'event', + id: 'id', + trace_id: 'trace_id', + }[field]; +} + +export function displayResponseRecommendData( + field: keyof API.ResponseRecommendData +) { + return { + answer: 'answer', + conversation_id: 'conversation_id', + created_at: 'created_at', + event: 'event', + id: 'id', + trace_id: 'trace_id', + }[field]; +} + +export function displaySpeechToTextResp(field: keyof API.SpeechToTextResp) { + return { + text: '转化的结果', + }[field]; +} + +export function displayTextToSpeechReq(field: keyof API.TextToSpeechReq) { + return { + text: '需要转的文字', + }[field]; +} + +export function displayUpdateAppGroup(field: keyof API.UpdateAppGroup) { + return { + appGroupID: 'appGroupID', + }[field]; +} + +export function displayUpdateAppKeyStateReq( + field: keyof API.UpdateAppKeyStateReq +) { + return { + appid: 'appid', + state: '0-关闭,1-启动', + type: 'wjl,dingding,feishu', + }[field]; +} + +export function displayUpdateAppReq(field: keyof API.UpdateAppReq) { + return { + appDescription: 'appDescription', + appGroupID: 'appGroupID', + appImage: 'appImage', + appName: 'appName', + }[field]; +} + +export function displayUpdateAppReqV2(field: keyof API.UpdateAppReqV2) { + return { + appGroupID: 'appGroupID', + appGuidance: '提示查询', + appPrologue: '开场白', + appRecommendedContexts: '推荐内容', + historyLimit: 'historyLimit', + modelConfigs: 'modelConfigs', + prePrompt: 'prePrompt', + providerId: 'providerId', + recommendSwitch: 'recommendSwitch', + }[field]; +} + +export function displayUpdateAppStatusReq(field: keyof API.UpdateAppStatusReq) { + return { + appStatus: 'PUBLIC:公开;PRIVATE:私有', + }[field]; +} + +export function displayUpdateUserRoleBody(field: keyof API.UpdateUserRoleBody) { + return { + role: '角色(system_admin-系统管理员;system_user-系统管普通用户;app_admin-应用管理员;app_user-应用普通用户)', + userID: '用户id', + }[field]; +} + +export function displayUser(field: keyof API.User) { + return { + createdAt: 'createdAt', + email: 'email', + idpID: 'idpID', + operator: 'operator', + phone: 'phone', + role: '角色(系统管理员、系统普通用户)', + updatedAt: 'updatedAt', + userID: 'iam 用户id', + userName: 'userName', + }[field]; +} + +export function displayUserWithAppData(field: keyof API.UserWithAppData) { + return { + appWithPermissionList: 'appWithPermissionList', + createdAt: 'createdAt', + email: 'email', + idpID: 'idpID', + isSystemAdmin: 'isSystemAdmin', + operator: 'operator', + phone: 'phone', + role: '角色(系统管理员、系统普通用户)', + updatedAt: 'updatedAt', + userID: 'iam 用户id', + userName: 'userName', + }[field]; +} + +export function displayv1ApiAppAppIdApiTokenUsingGetParams( + field: keyof API.v1ApiAppAppIdApiTokenUsingGetParams +) { + return { + appID: '应用id', + size: '每页大小', + offset: '分页', + }[field]; +} + +export function displayv1ApiAppAppIdApiTokenUsingPostParams( + field: keyof API.v1ApiAppAppIdApiTokenUsingPostParams +) { + return { + appID: '应用id', + }[field]; +} + +export function displayv1ApiAppAppIdDatasetConfigsUsingDeleteParams( + field: keyof API.v1ApiAppAppIdDatasetConfigsUsingDeleteParams +) { + return { + appID: '应用id', + appDatasetConfigID: '应用知识库配置id', + }[field]; +} + +export function displayv1ApiAppAppIdDatasetConfigsUsingGetParams( + field: keyof API.v1ApiAppAppIdDatasetConfigsUsingGetParams +) { + return { + appID: '应用id', + }[field]; +} + +export function displayv1ApiAppAppIdDatasetConfigsUsingPostParams( + field: keyof API.v1ApiAppAppIdDatasetConfigsUsingPostParams +) { + return { + appID: '应用id', + }[field]; +} + +export function displayv1ApiAppAppIdDatasetConfigsUsingPutParams( + field: keyof API.v1ApiAppAppIdDatasetConfigsUsingPutParams +) { + return { + appID: '应用id', + }[field]; +} + +export function displayv1ApiAppAppIdDatasetsListUsingGetParams( + field: keyof API.v1ApiAppAppIdDatasetsListUsingGetParams +) { + return { + appID: '应用id', + size: 'size', + offset: 'offset', + }[field]; +} + +export function displayv1ApiAppAppIdDatasetsUsingDeleteParams( + field: keyof API.v1ApiAppAppIdDatasetsUsingDeleteParams +) { + return { + appID: '应用id', + datasetID: '数据集id', + }[field]; +} + +export function displayv1ApiAppAppIdDatasetsUsingPostParams( + field: keyof API.v1ApiAppAppIdDatasetsUsingPostParams +) { + return { + appID: '应用id', + }[field]; +} + +export function displayv1ApiAppAppIdDetailsUsingGetParams( + field: keyof API.v1ApiAppAppIdDetailsUsingGetParams +) { + return { + appID: '应用id', + }[field]; +} + +export function displayv1ApiAppAppIdHourlyMessagesUsingGetParams( + field: keyof API.v1ApiAppAppIdHourlyMessagesUsingGetParams +) { + return { + appID: '应用id', + starTimestamp: '开始时间,秒级时间戳', + endTimestamp: '结束时间,秒级时间戳', + }[field]; +} + +export function displayv1ApiAppAppIdHourlyTokenUsingGetParams( + field: keyof API.v1ApiAppAppIdHourlyTokenUsingGetParams +) { + return { + appID: '应用id', + starTimestamp: '开始时间,秒级时间戳', + endTimestamp: '结束时间,秒级时间戳', + }[field]; +} + +export function displayv1ApiAppAppIdLogsConversationIdMessagesUsingGetParams( + field: keyof API.v1ApiAppAppIdLogsConversationIdMessagesUsingGetParams +) { + return { + appID: '应用id', + conversationID: '会话id', + }[field]; +} + +export function displayv1ApiAppAppIdLogsUsingGetParams( + field: keyof API.v1ApiAppAppIdLogsUsingGetParams +) { + return { + appID: '应用id', + conversationID: '会话id', + endTimestamp: '结束时间', + pageOffset: '页数1开始', + pageSize: '每页数量', + providerID: '模型id', + starTimestamp: '开始时间', + userID: '用户id', + }[field]; +} + +export function displayv1ApiAppAppIdMemberRoleUsingPutParams( + field: keyof API.v1ApiAppAppIdMemberRoleUsingPutParams +) { + return { + appID: '应用id', + }[field]; +} + +export function displayv1ApiAppAppIdMemberUsingDeleteParams( + field: keyof API.v1ApiAppAppIdMemberUsingDeleteParams +) { + return { + appID: '应用id', + }[field]; +} + +export function displayv1ApiAppAppIdMemberUsingGetParams( + field: keyof API.v1ApiAppAppIdMemberUsingGetParams +) { + return { + appID: '应用id', + size: '每页大小', + offset: '分页', + }[field]; +} + +export function displayv1ApiAppAppIdMemberUsingPostParams( + field: keyof API.v1ApiAppAppIdMemberUsingPostParams +) { + return { + appID: '应用id', + }[field]; +} + +export function displayv1ApiAppAppIdMessagesUsingGetParams( + field: keyof API.v1ApiAppAppIdMessagesUsingGetParams +) { + return { + appID: '应用id', + starTimestamp: '开始时间,秒级时间戳', + endTimestamp: '结束时间,秒级时间戳', + }[field]; +} + +export function displayv1ApiAppAppIdModelConfigsUsingPostParams( + field: keyof API.v1ApiAppAppIdModelConfigsUsingPostParams +) { + return { + appID: '应用id', + }[field]; +} + +export function displayv1ApiAppAppIdModelConfigsUsingPutParams( + field: keyof API.v1ApiAppAppIdModelConfigsUsingPutParams +) { + return { + appID: '应用id', + }[field]; +} + +export function displayv1ApiAppAppIdModelPromptUsingPostParams( + field: keyof API.v1ApiAppAppIdModelPromptUsingPostParams +) { + return { + appID: '应用id', + }[field]; +} + +export function displayv1ApiAppAppIdOpenApiDeleteUsingDeleteParams( + field: keyof API.v1ApiAppAppIdOpenApiDeleteUsingDeleteParams +) { + return { + appID: '应用id', + }[field]; +} + +export function displayv1ApiAppAppIdPluginUsingPutParams( + field: keyof API.v1ApiAppAppIdPluginUsingPutParams +) { + return { + appID: '应用id', + }[field]; +} + +export function displayv1ApiAppAppIdRecommendedContextUsingGetParams( + field: keyof API.v1ApiAppAppIdRecommendedContextUsingGetParams +) { + return { + appID: '应用id', + }[field]; +} + +export function displayv1ApiAppAppIdRecommendedContextUsingPostParams( + field: keyof API.v1ApiAppAppIdRecommendedContextUsingPostParams +) { + return { + appID: '应用id', + }[field]; +} + +export function displayv1ApiAppAppIdShareUsingPutParams( + field: keyof API.v1ApiAppAppIdShareUsingPutParams +) { + return { + appID: '应用id', + isH5: '是否h5', + }[field]; +} + +export function displayv1ApiAppAppIdTokenUsingGetParams( + field: keyof API.v1ApiAppAppIdTokenUsingGetParams +) { + return { + appID: '应用id', + starTimestamp: '开始时间,秒级时间戳', + endTimestamp: '结束时间,秒级时间戳', + }[field]; +} + +export function displayv1ApiAppAppIdUpdateStatusUsingPutParams( + field: keyof API.v1ApiAppAppIdUpdateStatusUsingPutParams +) { + return { + appID: '应用id', + }[field]; +} + +export function displayv1ApiAppAppIdUpdateUsingPutParams( + field: keyof API.v1ApiAppAppIdUpdateUsingPutParams +) { + return { + appID: '应用id', + }[field]; +} + +export function displayv1ApiAppH5ShareApiTokenUsingGetParams( + field: keyof API.v1ApiAppH5ShareApiTokenUsingGetParams +) { + return { + randomPath: '分享的随机path', + }[field]; +} + +export function displayv1ApiAppIdCostUsingPostParams( + field: keyof API.v1ApiAppIdCostUsingPostParams +) { + return { + appID: '应用id', + conversationID: '会话id', + endTimestamp: '结束时间', + pageOffset: '页数1开始', + pageSize: '每页数量', + providerID: '模型id', + starTimestamp: '开始时间', + userID: '用户id', + }[field]; +} + +export function displayv1ApiAppListPrivateUsingGetParams( + field: keyof API.v1ApiAppListPrivateUsingGetParams +) { + return { + onlyConversations: '是否只查看会话过的应用', + }[field]; +} + +export function displayv1ApiAppListPublicUsingGetParams( + field: keyof API.v1ApiAppListPublicUsingGetParams +) { + return { + onlyConversations: '是否只查看会话过的应用', + }[field]; +} + +export function displayv1ApiAppShareApiTokenUsingGetParams( + field: keyof API.v1ApiAppShareApiTokenUsingGetParams +) { + return { + randomPath: '分享的随机path', + }[field]; +} + +export function displayv1ApiAttentionAppListUsingGetParams( + field: keyof API.v1ApiAttentionAppListUsingGetParams +) { + return { + iamID: 'IAM用户id', + }[field]; +} + +export function displayv1ApiAttentionMessagesHistoryUsingGetParams( + field: keyof API.v1ApiAttentionMessagesHistoryUsingGetParams +) { + return { + iamID: 'IAM ID', + appID: '应用id', + conversationID: '会话id', + }[field]; +} + +export function displayv1ApiAttentionUserAllUsingGetParams( + field: keyof API.v1ApiAttentionUserAllUsingGetParams +) { + return { + iamID: '登陆用户IAMID', + isAttention: '用户id', + nameOrPhone: '名字或电话,模糊匹配', + offset: 'offset', + phone: '电话号码', + size: 'size', + userID: '用户id', + userName: '用户名字用于搜索', + }[field]; +} + +export function displayv1ApiAttentionUserListUsingPostParams( + field: keyof API.v1ApiAttentionUserListUsingPostParams +) { + return { + iamID: 'IAM ID', + size: '默认10', + offset: '默认0', + }[field]; +} + +export function displayv1ApiConversationsConversationIdHistoryUsingDeleteParams( + field: keyof API.v1ApiConversationsConversationIdHistoryUsingDeleteParams +) { + return { + conversation_id: '会话id', + message_id: '聊天信息id', + }[field]; +} + +export function displayv1ApiConversationsConversationIdHistoryUsingGetParams( + field: keyof API.v1ApiConversationsConversationIdHistoryUsingGetParams +) { + return { + conversation_id: '会话id', + }[field]; +} + +export function displayv1ApiConversationsUsingDeleteParams( + field: keyof API.v1ApiConversationsUsingDeleteParams +) { + return { + conversation_id: '会话id', + }[field]; +} + +export function displayv1ApiConversationsUsingGetParams( + field: keyof API.v1ApiConversationsUsingGetParams +) { + return { + user_id: '用户id,空值不返回', + }[field]; +} + +export function displayv1ApiFeedbacksMessageIdUsingDeleteParams( + field: keyof API.v1ApiFeedbacksMessageIdUsingDeleteParams +) { + return { + message_id: '消息id', + conversation_id: '会话id', + }[field]; +} + +export function displayv1ApiFeedbacksMessageIdUsingPostParams( + field: keyof API.v1ApiFeedbacksMessageIdUsingPostParams +) { + return { + message_id: '消息id', + }[field]; +} + +export function displayv1ApiFeedbacksUsingGetParams( + field: keyof API.v1ApiFeedbacksUsingGetParams +) { + return { + conversation_ID: 'conversation_ID', + message_ID: 'message_ID', + pageOffset: '页数1开始', + pageSize: '每页数量', + }[field]; +} + +export function displayv1ApiFileUsingPostParams( + field: keyof API.v1ApiFileUsingPostParams +) { + return { + conversation_id: '会话id', + user_id: 'user id', + }[field]; +} + +export function displayv1ApiIamAccountUsingGetParams( + field: keyof API.v1ApiIamAccountUsingGetParams +) { + return { + openId: 'openId', + }[field]; +} + +export function displayv1ApiProviderListUsingGetParams( + field: keyof API.v1ApiProviderListUsingGetParams +) { + return { + size: 'size', + offset: 'offset', + }[field]; +} + +export function displayv1ApiRobotWorkspaceIdAppkeyStateUsingPostParams( + field: keyof API.v1ApiRobotWorkspaceIdAppkeyStateUsingPostParams +) { + return { + workspaceID: '空间ID', + }[field]; +} + +export function displayv1ApiRobotWorkspaceIdAppkeyUsingDeleteParams( + field: keyof API.v1ApiRobotWorkspaceIdAppkeyUsingDeleteParams +) { + return { + workspaceID: '空间ID', + }[field]; +} + +export function displayv1ApiRobotWorkspaceIdAppkeyUsingGetParams( + field: keyof API.v1ApiRobotWorkspaceIdAppkeyUsingGetParams +) { + return { + workspaceID: '空间ID', + appid: 'appid', + type: 'wjl,dingding,feishu,wxa,wx', + }[field]; +} + +export function displayv1ApiRobotWorkspaceIdAppkeyUsingPostParams( + field: keyof API.v1ApiRobotWorkspaceIdAppkeyUsingPostParams +) { + return { + workspaceID: '空间ID', + }[field]; +} + +export function displayv1ApiUserInfoUsingGetParams( + field: keyof API.v1ApiUserInfoUsingGetParams +) { + return { + appID: '应用id', + }[field]; +} + +export function displayv1ApiUserUsingGetParams( + field: keyof API.v1ApiUserUsingGetParams +) { + return { + offset: 'offset', + phone: '电话号码', + size: 'size', + userID: '用户id', + userName: '用户名字用于搜索', + }[field]; +} + +export function displayv2ApiAppAppIdDetailsUsingGetParams( + field: keyof API.v2ApiAppAppIdDetailsUsingGetParams +) { + return { + appID: '应用id', + }[field]; +} + +export function displayv2ApiAppAppIdUpdateUsingPostParams( + field: keyof API.v2ApiAppAppIdUpdateUsingPostParams +) { + return { + appID: '应用id', + }[field]; +} + +export function displayv2ApiAppListUsingGetParams( + field: keyof API.v2ApiAppListUsingGetParams +) { + return { + onlyConversations: '是否只查看会话过的应用', + }[field]; +} + +export function displayv2ApiAppShareApiTokenUsingGetParams( + field: keyof API.v2ApiAppShareApiTokenUsingGetParams +) { + return { + randomPath: '分享的随机path', + }[field]; +} + +export function displayv2ApiChatMessagesMessagesCountUsingGetParams( + field: keyof API.v2ApiChatMessagesMessagesCountUsingGetParams +) { + return { + isPerPerson: '是否查询人均,默认false', + starTimestamp: '开始时间,秒级时间戳', + endTimestamp: '结束时间,秒级时间戳', + }[field]; +} + +export function displayv2ApiFileUsingPostParams( + field: keyof API.v2ApiFileUsingPostParams +) { + return { + conversation_id: '会话id', + user_id: 'user id', + }[field]; +} + +export function displayv2ApiWorkspacesDefaultUsingPostParams( + field: keyof API.v2ApiWorkspacesDefaultUsingPostParams +) { + return { + workspaceID: '空间ID', + }[field]; +} + +export function displayv2ApiWorkspacesRecommendedMessageIdDetailsUsingGetParams( + field: keyof API.v2ApiWorkspacesRecommendedMessageIdDetailsUsingGetParams +) { + return { + messageId: '消息id', + }[field]; +} + +export function displayv2ApiWorkspacesWorkspaceIdAppAppIdDatasetsJoinUsingPostParams( + field: keyof API.v2ApiWorkspacesWorkspaceIdAppAppIdDatasetsJoinUsingPostParams +) { + return { + workspaceID: '空间ID', + appID: '应用id', + }[field]; +} + +export function displayv2ApiWorkspacesWorkspaceIdAppAppIdDatasetsUsingDeleteParams( + field: keyof API.v2ApiWorkspacesWorkspaceIdAppAppIdDatasetsUsingDeleteParams +) { + return { + appID: '应用id', + workspaceID: '空间ID', + datasetID: '数据集id', + }[field]; +} + +export function displayv2ApiWorkspacesWorkspaceIdAppAppIdDetailsUsingGetParams( + field: keyof API.v2ApiWorkspacesWorkspaceIdAppAppIdDetailsUsingGetParams +) { + return { + workspaceID: '空间ID', + appID: '应用id', + }[field]; +} + +export function displayv2ApiWorkspacesWorkspaceIdAppAppIdHourlyMessagesUsingGetParams( + field: keyof API.v2ApiWorkspacesWorkspaceIdAppAppIdHourlyMessagesUsingGetParams +) { + return { + workspaceID: '空间ID', + appID: '应用id', + starTimestamp: '开始时间,秒级时间戳', + endTimestamp: '结束时间,秒级时间戳', + }[field]; +} + +export function displayv2ApiWorkspacesWorkspaceIdAppAppIdHourlyTokenUsingGetParams( + field: keyof API.v2ApiWorkspacesWorkspaceIdAppAppIdHourlyTokenUsingGetParams +) { + return { + workspaceID: '空间ID', + appID: '应用id', + starTimestamp: '开始时间,秒级时间戳', + endTimestamp: '结束时间,秒级时间戳', + }[field]; +} + +export function displayv2ApiWorkspacesWorkspaceIdAppAppIdLogsUsingGetParams( + field: keyof API.v2ApiWorkspacesWorkspaceIdAppAppIdLogsUsingGetParams +) { + return { + appID: '应用id', + workspaceID: '空间ID', + conversationID: '会话id', + endTimestamp: '结束时间', + pageOffset: '页数1开始', + pageSize: '每页数量', + providerID: '模型id', + starTimestamp: '开始时间', + userID: '用户id', + }[field]; +} + +export function displayv2ApiWorkspacesWorkspaceIdAppAppIdMessagesUsingGetParams( + field: keyof API.v2ApiWorkspacesWorkspaceIdAppAppIdMessagesUsingGetParams +) { + return { + workspaceID: '空间ID', + appID: '应用id', + starTimestamp: '开始时间,秒级时间戳', + endTimestamp: '结束时间,秒级时间戳', + }[field]; +} + +export function displayv2ApiWorkspacesWorkspaceIdAppAppIdModelConfigsUsingPutParams( + field: keyof API.v2ApiWorkspacesWorkspaceIdAppAppIdModelConfigsUsingPutParams +) { + return { + appID: '应用id', + workspaceID: '空间ID', + }[field]; +} + +export function displayv2ApiWorkspacesWorkspaceIdAppAppIdPluginUsingGetParams( + field: keyof API.v2ApiWorkspacesWorkspaceIdAppAppIdPluginUsingGetParams +) { + return { + appID: '应用id', + workspaceID: '空间ID', + }[field]; +} + +export function displayv2ApiWorkspacesWorkspaceIdAppAppIdTokenUsingGetParams( + field: keyof API.v2ApiWorkspacesWorkspaceIdAppAppIdTokenUsingGetParams +) { + return { + appID: '应用id', + starTimestamp: '开始时间,秒级时间戳', + endTimestamp: '结束时间,秒级时间戳', + }[field]; +} + +export function displayv2ApiWorkspacesWorkspaceIdAppAppIdUpdateStatusUsingPutParams( + field: keyof API.v2ApiWorkspacesWorkspaceIdAppAppIdUpdateStatusUsingPutParams +) { + return { + workspaceID: '空间ID', + appID: '应用id', + }[field]; +} + +export function displayv2ApiWorkspacesWorkspaceIdAppAppIdUsingPostParams( + field: keyof API.v2ApiWorkspacesWorkspaceIdAppAppIdUsingPostParams +) { + return { + workspaceID: '空间ID', + appID: '应用id', + }[field]; +} + +export function displayv2ApiWorkspacesWorkspaceIdAppsAppIdBaseUsingPostParams( + field: keyof API.v2ApiWorkspacesWorkspaceIdAppsAppIdBaseUsingPostParams +) { + return { + appID: '应用id', + workspaceID: '空间ID', + }[field]; +} + +export function displayv2ApiWorkspacesWorkspaceIdAppsAppIdGroupUsingPostParams( + field: keyof API.v2ApiWorkspacesWorkspaceIdAppsAppIdGroupUsingPostParams +) { + return { + appID: '应用id', + workspaceID: '空间ID', + }[field]; +} + +export function displayv2ApiWorkspacesWorkspaceIdAppsAppIdUsingDeleteParams( + field: keyof API.v2ApiWorkspacesWorkspaceIdAppsAppIdUsingDeleteParams +) { + return { + appID: '应用id', + workspaceID: '空间ID', + }[field]; +} + +export function displayv2ApiWorkspacesWorkspaceIdAppsUsingGetParams( + field: keyof API.v2ApiWorkspacesWorkspaceIdAppsUsingGetParams +) { + return { + workspaceID: '空间ID', + onlyConversations: '是否只查看会话过的应用', + appName: '应用名,模糊查询', + }[field]; +} + +export function displayv2ApiWorkspacesWorkspaceIdAppsUsingPostParams( + field: keyof API.v2ApiWorkspacesWorkspaceIdAppsUsingPostParams +) { + return { + workspaceID: '空间ID', + }[field]; +} + +export function displayv2ApiWorkspacesWorkspaceIdDatasetsUsingGetParams( + field: keyof API.v2ApiWorkspacesWorkspaceIdDatasetsUsingGetParams +) { + return { + workspaceID: '空间ID', + }[field]; +} + +export function displayv2ApiWorkspacesWorkspaceIdDatasetsUsingPostParams( + field: keyof API.v2ApiWorkspacesWorkspaceIdDatasetsUsingPostParams +) { + return { + workspaceID: '空间ID', + }[field]; +} + +export function displayv2ApiWorkspacesWorkspaceIdGroupsUsingGetParams( + field: keyof API.v2ApiWorkspacesWorkspaceIdGroupsUsingGetParams +) { + return { + workspaceID: '空间ID', + }[field]; +} + +export function displayv2ApiWorkspacesWorkspaceIdGroupsUsingPostParams( + field: keyof API.v2ApiWorkspacesWorkspaceIdGroupsUsingPostParams +) { + return { + workspaceID: '空间ID', + }[field]; +} + +export function displayv2ApiWorkspacesWorkspaceIdGroupsWorkspaceGroupIdUsingDeleteParams( + field: keyof API.v2ApiWorkspacesWorkspaceIdGroupsWorkspaceGroupIdUsingDeleteParams +) { + return { + workspaceID: '空间ID', + workspaceGroupID: '分组ID', + }[field]; +} + +export function displayv2ApiWorkspacesWorkspaceIdGroupsWorkspaceGroupIdUsingPostParams( + field: keyof API.v2ApiWorkspacesWorkspaceIdGroupsWorkspaceGroupIdUsingPostParams +) { + return { + workspaceID: '空间ID', + workspaceGroupID: '分组ID', + }[field]; +} + +export function displayv2ApiWorkspacesWorkspaceIdPermissionsUsingGetParams( + field: keyof API.v2ApiWorkspacesWorkspaceIdPermissionsUsingGetParams +) { + return { + workspaceID: '空间ID', + }[field]; +} + +export function displayv2ApiWorkspacesWorkspaceIdUsersUsingGetParams( + field: keyof API.v2ApiWorkspacesWorkspaceIdUsersUsingGetParams +) { + return { + workspaceID: '空间ID', + }[field]; +} + +export function displayv2ApiWorkspacesWorkspaceIdUsersUsingPostParams( + field: keyof API.v2ApiWorkspacesWorkspaceIdUsersUsingPostParams +) { + return { + workspaceID: '空间ID', + }[field]; +} + +export function displayv2ApiWorkspacesWorkspaceIdUserUserIdUsingDeleteParams( + field: keyof API.v2ApiWorkspacesWorkspaceIdUserUserIdUsingDeleteParams +) { + return { + workspaceID: '空间ID', + userID: 'userID', + }[field]; +} + +export function displayv2ApiWorkspacesWorkspaceIdUsingDeleteParams( + field: keyof API.v2ApiWorkspacesWorkspaceIdUsingDeleteParams +) { + return { + workspaceID: '空间ID', + }[field]; +} + +export function displayv2ApiWorkspacesWorkspaceIdUsingPostParams( + field: keyof API.v2ApiWorkspacesWorkspaceIdUsingPostParams +) { + return { + workspaceID: '空间ID', + }[field]; +} + +export function displayWJLAccount(field: keyof API.WJLAccount) { + return { + code: 'code', + data: 'data', + msg: 'msg', + success: 'success', + }[field]; +} + +export function displayWorkspaceGroup(field: keyof API.WorkspaceGroup) { + return { + createdAt: 'createdAt', + name: '分组名', + updatedAt: 'updatedAt', + workspaceGroupID: 'workspaceGroupID', + workspaceID: 'workspaceID', + }[field]; +} + +export function displayWorkspaceGroupReq(field: keyof API.WorkspaceGroupReq) { + return { + name: 'name', + }[field]; +} + +export function displayWorkspaceListResp(field: keyof API.WorkspaceListResp) { + return { + data: 'data', + total: 'total', + }[field]; +} + +export function displayWorkspacePermissions( + field: keyof API.WorkspacePermissions +) { + return { + createdAt: 'createdAt', + email: 'email', + idpID: 'idpID', + operator: 'operator', + permission: '枚举read_only(只读)、operation(操作)', + phone: 'phone', + role: '角色(系统管理员、系统普通用户)', + updatedAt: 'updatedAt', + userID: 'iam 用户id', + userName: 'userName', + }[field]; +} + +export function displayWorkspaceReq(field: keyof API.WorkspaceReq) { + return { + description: '描述', + name: '空间名', + }[field]; +} + +export function displayWorkspaceResp(field: keyof API.WorkspaceResp) { + return { + description: '空间描述', + name: '空间名', + workspaceID: '空间ID', + }[field]; +} + +export function displayWorkspaceUser(field: keyof API.WorkspaceUser) { + return { + role: 'workspace_admin空间超管用户;workspace_user空间普通用户', + userID: '用户id', + }[field]; +} + +export function displayWxExtra(field: keyof API.WxExtra) { + return { + encodingAESKey: 'encodingAESKey', + token: 'token', + }[field]; +} +/* eslint-disable */ +// @ts-ignore +import { request } from 'axios'; + +import * as API from './types'; + +/** Exchange 换取token GET /llmops/auth/exchange */ +export async function authExchangeUsingGet({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.authExchangeUsingGetParams; + options?: { [key: string]: unknown }; +}) { + return request('/llmops/auth/exchange', { + method: 'GET', + params: { + ...params, + }, + ...(options || {}), + }); +} +/* eslint-disable */ +// @ts-ignore +import { request } from 'axios'; + +import * as API from './types'; + +/** Filestream 上传文件 POST /llmops/v1/api/file */ +export async function v1ApiFileUsingPost({ + params, + body, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v1ApiFileUsingPostParams; + body: API.V1ApiFileUsingPostBody; + options?: { [key: string]: unknown }; +}) { + return request('/llmops/v1/api/file', { + method: 'POST', + headers: { + 'Content-Type': 'application/json', + }, + params: { + ...params, + }, + data: body, + ...(options || {}), + }); +} + +/** SpeechToText 语音转文字 POST /llmops/v1/api/speech_to_text */ +export async function v1ApiSpeechToTextUsingPost({ + body, + options, +}: { + body: API.V1ApiSpeechToTextUsingPostBody; + options?: { [key: string]: unknown }; +}) { + return request('/llmops/v1/api/speech_to_text', { + method: 'POST', + headers: { + 'Content-Type': 'application/json', + }, + data: body, + ...(options || {}), + }); +} + +/** TextToSpeech 文字转语音 POST /llmops/v1/api/text_to_speech */ +export async function v1ApiTextToSpeechUsingPost({ + body, + options, +}: { + body: API.TextToSpeechReq; + options?: { [key: string]: unknown }; +}) { + return request('/llmops/v1/api/text_to_speech', { + method: 'POST', + headers: { + 'Content-Type': 'application/json', + }, + data: body, + ...(options || {}), + }); +} + +/** 上传文件V2接口 上传文件V2接口用于向服务器提交文件。 POST /llmops/v2/api/file */ +export async function v2ApiFileUsingPost({ + params, + body, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v2ApiFileUsingPostParams; + body: API.V2ApiFileUsingPostBody; + options?: { [key: string]: unknown }; +}) { + const formData = new FormData(); + + Object.keys(body).forEach((ele) => { + const item = (body as { [key: string]: any })[ele]; + + if (item !== undefined && item !== null) { + if (typeof item === 'object' && !(item instanceof File)) { + if (item instanceof Array) { + item.forEach((f) => formData.append(ele, f || '')); + } else { + formData.append(ele, JSON.stringify(item)); + } + } else { + formData.append(ele, item); + } + } + }); + + return request('/llmops/v2/api/file', { + method: 'POST', + headers: { + 'Content-Type': 'multipart/form-data', + }, + params: { + ...params, + }, + data: formData, + ...(options || {}), + }); +} +/* eslint-disable */ +// @ts-ignore +import { request } from 'axios'; + +import * as API from './types'; + +/** GetAppKey 为应用获取各种类型机器人appkey GET /llmops/v1/api/robot/${param0}/appkey */ +export async function v1ApiRobotWorkspaceIdAppkeyUsingGet({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v1ApiRobotWorkspaceIdAppkeyUsingGetParams; + options?: { [key: string]: unknown }; +}) { + const { workspaceID: param0, ...queryParams } = params; + + return request(`/llmops/v1/api/robot/${param0}/appkey`, { + method: 'GET', + params: { + ...queryParams, + }, + ...(options || {}), + }); +} +/* eslint-disable */ +// @ts-ignore +import { request } from 'axios'; + +import * as API from './types'; + +/** History 会话历史 GET /llmops/v1/api/conversations/${param0}/history */ +export async function v1ApiConversationsConversationIdHistoryUsingGet({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v1ApiConversationsConversationIdHistoryUsingGetParams; + options?: { [key: string]: unknown }; +}) { + const { conversation_id: param0, ...queryParams } = params; + + return request( + `/llmops/v1/api/conversations/${param0}/history`, + { + method: 'GET', + params: { ...queryParams }, + ...(options || {}), + } + ); +} + +/** DeleteHistory 会话历史 DELETE /llmops/v1/api/conversations/${param0}/history */ +export async function v1ApiConversationsConversationIdHistoryUsingDelete({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v1ApiConversationsConversationIdHistoryUsingDeleteParams; + options?: { [key: string]: unknown }; +}) { + const { conversation_id: param0, ...queryParams } = params; + + return request( + `/llmops/v1/api/conversations/${param0}/history`, + { + method: 'DELETE', + params: { + ...queryParams, + }, + ...(options || {}), + } + ); +} + +/** GetMessageCount 用于微精灵获取消息数的v2版本 GET /llmops/v2/api/chat-messages/messagesCount */ +export async function v2ApiChatMessagesMessagesCountUsingGet({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v2ApiChatMessagesMessagesCountUsingGetParams; + options?: { [key: string]: unknown }; +}) { + return request( + '/llmops/v2/api/chat-messages/messagesCount', + { + method: 'GET', + params: { + ...params, + }, + ...(options || {}), + } + ); +} +/* eslint-disable */ +// @ts-ignore +import { request } from 'axios'; + +import * as API from './types'; + +/** GetIamUserId 查询 IAM 用户信息 GET /llmops/v1/api/iamAccount */ +export async function v1ApiIamAccountUsingGet({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v1ApiIamAccountUsingGetParams; + options?: { [key: string]: unknown }; +}) { + return request('/llmops/v1/api/iamAccount', { + method: 'GET', + params: { + ...params, + }, + ...(options || {}), + }); +} +/* eslint-disable */ +// @ts-ignore +export * from './types'; +export * from './displayEnumLabel'; + +export * from './displayTypeLabel'; + +export * from './authorize'; +export * from './exchange'; +export * from './refreshToken'; +export * from './app'; +export * from './share'; +export * from './apiToken'; +export * from './appDatasetConfigs'; +export * from './datasetsJoin'; +export * from './datasetsList'; +export * from './appMember'; +export * from './appModelConfigs'; +export * from './recommended'; +export * from './attention'; +export * from './chat'; +export * from './conversation'; +export * from './history'; +export * from './listFeedbacks'; +export * from './createFeedbacks'; +export * from './deleteFeedbacks'; +export * from './files'; +export * from './iam'; +export * from './provider'; +export * from './getAppKey'; +export * from './addAppKey'; +export * from './deleteKey'; +export * from './updateAppKeyState'; +export * from './user'; +export * from './appV2'; +export * from './workspaceAppV2'; +export * from './workspace'; +export * from './workspaceGroup'; +/* eslint-disable */ +// @ts-ignore +import { request } from 'axios'; + +import * as API from './types'; + +/** ListFeedbacks ListFeedbacks GET /llmops/v1/api/feedbacks/ */ +export async function v1ApiFeedbacksUsingGet({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v1ApiFeedbacksUsingGetParams; + options?: { [key: string]: unknown }; +}) { + return request('/llmops/v1/api/feedbacks/', { + method: 'GET', + params: { + ...params, + }, + ...(options || {}), + }); +} +/* eslint-disable */ +// @ts-ignore +import { request } from 'axios'; + +import * as API from './types'; + +/** ListProviders 查询 Provider 列表 GET /llmops/v1/api/provider/list */ +export async function v1ApiProviderListUsingGet({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v1ApiProviderListUsingGetParams; + options?: { [key: string]: unknown }; +}) { + return request('/llmops/v1/api/provider/list', { + method: 'GET', + params: { + ...params, + }, + ...(options || {}), + }); +} +/* eslint-disable */ +// @ts-ignore +import { request } from 'axios'; + +import * as API from './types'; + +/** ListRecommendedContext 查询推荐内容列表 GET /llmops/v1/api/app/${param0}/recommended/context */ +export async function v1ApiAppAppIdRecommendedContextUsingGet({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v1ApiAppAppIdRecommendedContextUsingGetParams; + options?: { [key: string]: unknown }; +}) { + const { appID: param0, ...queryParams } = params; + + return request( + `/llmops/v1/api/app/${param0}/recommended/context`, + { + method: 'GET', + params: { ...queryParams }, + ...(options || {}), + } + ); +} + +/** CreateOrUpdateRecommendedContext 创建或更新推荐内容列表 POST /llmops/v1/api/app/${param0}/recommended/context */ +export async function v1ApiAppAppIdRecommendedContextUsingPost({ + params, + body, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v1ApiAppAppIdRecommendedContextUsingPostParams; + body: API.AppRecommendedContext; + options?: { [key: string]: unknown }; +}) { + const { appID: param0, ...queryParams } = params; + + return request(`/llmops/v1/api/app/${param0}/recommended/context`, { + method: 'POST', + params: { ...queryParams }, + data: body, + ...(options || {}), + }); +} +/* eslint-disable */ +// @ts-ignore +import { request } from 'axios'; + +import * as API from './types'; + +/** RefreshToken 刷新token POST /llmops/auth/refresh-token */ +export async function authRefreshTokenUsingPost({ + body, + options, +}: { + body: API.RefreshTokenBody; + options?: { [key: string]: unknown }; +}) { + return request('/llmops/auth/refresh-token', { + method: 'POST', + data: body, + ...(options || {}), + }); +} +/* eslint-disable */ +// @ts-ignore +import { request } from 'axios'; + +import * as API from './types'; + +/** H5GetApiToken 获取一个 app token h5版 GET /llmops/v1/api/app/h5/share/api-token */ +export async function v1ApiAppH5ShareApiTokenUsingGet({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v1ApiAppH5ShareApiTokenUsingGetParams; + options?: { [key: string]: unknown }; +}) { + return request( + '/llmops/v1/api/app/h5/share/api-token', + { + method: 'GET', + params: { + ...params, + }, + ...(options || {}), + } + ); +} + +/** GetApiToken 获取一个 app token GET /llmops/v1/api/app/share/api-token */ +export async function v1ApiAppShareApiTokenUsingGet({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v1ApiAppShareApiTokenUsingGetParams; + options?: { [key: string]: unknown }; +}) { + return request( + '/llmops/v1/api/app/share/api-token', + { + method: 'GET', + params: { + ...params, + }, + ...(options || {}), + } + ); +} +/* eslint-disable */ +// @ts-ignore + +export type AddAppkeyReq = { + appid: string; + appkey: string; + appsecret?: string; + encodingAESKey?: string; + token?: string; + /** wjl,dingding,feishu,wxa,wx */ + type: string; +}; + +export type ApiToken = { + apiTokenID?: string; + appID?: string; + createdAt?: string; + token?: string; + updatedAt?: string; +}; + +export type ApiTokenDataList = { + data?: ApiToken[]; + total?: number; +}; + +export type App = { + appID?: string; + appImage?: number; + appStatus?: string; + /** 应用类型 */ + appType?: number; + createdAt?: string; + description?: string; + groupID?: string; + /** 开场提问引导 */ + guidance?: Map; + name?: string; + operator?: string; + /** 应用优先级 */ + priority?: number; + prologue?: string; + recommendSwitch?: Bool; + /** 是否模版 */ + templateStatus?: string; + updatedAt?: string; + workspaceID?: string; +}; + +export type AppDataset = { + /** 描述 */ + description?: string; + /** llm描述 */ + llmDesc?: string; + /** 知识库名 */ + name?: string; +}; + +export type AppDatasetConfig = { + appDatasetConfigID?: string; + appID?: string; + createdAt?: string; + minScore?: number; + searchSource?: string; + timeoutSecond?: number; + topK?: number; + updatedAt?: string; +}; + +export type AppDatasetConfigs = { + /** 最低分数 */ + minScore?: number; + /** 知识库源,默认 warehouse */ + searchSource?: string; + /** 知识库查询超时时间 */ + timeoutSecond?: number; + /** 知识库条数 */ + topK?: number; +}; + +export type AppDatasets = { + appCount?: number; + author?: string; + datasetID?: string; + datasetName?: string; + docCount?: number; + state?: string; +}; + +export type AppDetail = { + /** 消耗输出token */ + AnswerTokensCount?: number; + appDatasetConfig?: AppDatasetConfig; + /** 数据集Id列表 */ + appDatasets?: AppDatasets[]; + appGroupID?: string; + appID?: string; + /** 应用头像 */ + appImage?: string; + /** 应用名 */ + appName?: string; + /** PrePrompt */ + appPrePrompt?: string; + appPromptPrefix?: AppModelConfigPromptPrefix; + /** 模型 */ + appProvider?: string; + /** AppDatasetSource database2.AppDatasetSourceInfo `json:"appDatasetSource"` */ + appProviderID?: string; + /** 模型名 */ + appProviderName?: string; + /** 推荐内容 */ + appRecommendedContext?: AppRecommendedContext[]; + appStatus?: string; + /** 应用token列表 */ + appToken?: string[]; + configs?: ModelConfigsMap; + /** 会话总数 */ + conversationCount?: number; + createAt?: string; + /** 应用描述 */ + description?: string; + /** 开场提问引导 */ + guidance?: Guidances; + /** H5随机分享路径 */ + h5RandomPath?: string; + historyLimit?: number; + /** 消息总数 */ + messagesCount?: number; + /** PC随机分享路径 */ + pcRandomPath?: string; + /** 开场白 */ + prologue?: string; + /** 消耗输入token */ + queryTokensCount?: number; + switchRecommendedQuestion?: boolean; + templateStatus?: string; + /** 消耗总token */ + totalTokens?: number; + workspaceID?: string; +}; + +export type AppMessagesCount = { + total?: number; +}; + +export type AppModelConfigPromptPrefix = { + background?: string; + role?: string; + switchRecommendedQuestion?: boolean; +}; + +export type AppModelConfigs = { + configs?: ModelConfigsMap; + prePrompt?: string; + providerId?: string; +}; + +export type AppRecommendedContext = { + appID?: string; + appRecommendedContextID?: string; + context?: string; + createdAt?: string; + description?: string; + name?: string; + updatedAt?: string; +}; + +export type AppRecommendedContext2 = { + context?: string; + description?: string; + id?: string; + name?: string; +}; + +export type AppRecommendedContext3 = { + context?: string; + description?: string; + id?: string; + name?: string; +}; + +export type AppRecommendedContextResp = { + questions?: string; + recommendSwitch?: boolean; +}; + +export type AppResp = { + appGroupID?: string; + appGroupName?: string; + appImage?: string; + appStatus?: string; + createAt?: string; + datasetCount?: number; + description?: string; + h5?: string; + id?: string; + name?: string; + pc?: string; + workspaceID?: string; +}; + +export type AppWithPermission = { + appID?: string; + appImage?: number; + appStatus?: string; + /** 应用类型 */ + appType?: number; + createdAt?: string; + description?: string; + groupID?: string; + /** 开场提问引导 */ + guidance?: Map; + isAppAdmin?: boolean; + name?: string; + operator?: string; + /** 应用优先级 */ + priority?: number; + prologue?: string; + recommendSwitch?: Bool; + /** 是否模版 */ + templateStatus?: string; + updatedAt?: string; + workspaceID?: string; +}; + +export type AttentionDataCountResp = { + total?: number; +}; + +export type AttentionUser = { + email?: string; + isAttentionUser?: boolean; + phone?: string; + userID?: string; + userName?: string; +}; + +export type AttentionUserResp = { + email?: string; + lastMessageTime?: string; + phone?: string; + userID?: string; + userName?: string; +}; + +export type authAuthorizeUsingGetParams = { + /** 业务回调地址 */ + redirect_uri: string; + /** 保持请求和回调的状态,授权成功后会回传该参数 */ + state?: string; +}; + +export type authExchangeUsingGetParams = { + /** code */ + code: string; + /** 业务回调地址 */ + redirect_uri: string; +}; + +export type Bool = string; + +export type Chat = { + conversation_id?: string; + inputs?: Record; + isIgnore?: boolean; + query?: string; + response_mode?: string; + user?: string; +}; + +export type ChatMessageReq = { + prompt?: string; + query?: string; +}; + +export type ConversationLogsResp = { + /** 消耗输出token */ + AnswerTokensCount?: number; + appID?: string; + conversationID?: string; + conversationName?: string; + createdAt?: string; + messagesCount?: number; + /** 消耗输入token */ + queryTokensCount?: number; + /** 消耗总token */ + totalTokens?: number; + userID?: string; + userInfo?: User; +}; + +export type ConversationMsg = { + conversationId?: string; + createAt?: string; + name?: string; + userId?: string; +}; + +export type ConversationResp = { + /** 消耗输出token */ + AnswerTokensCount?: number; + appID?: string; + appName?: string; + conversationID?: string; + conversationName?: string; + createdAt?: string; + lastMessagesTime?: string; + messagesCount?: number; + /** 消耗输入token */ + queryTokensCount?: number; + /** 消耗总token */ + totalTokens?: number; + userID?: string; + userInfo?: User; +}; + +export type CopyAppReq = { + appID?: string; + workspaceID?: string; +}; + +export type CreateApiTokenRESP = { + token?: string; +}; + +export type CreateAppReq = { + description?: string; + guidance?: Guidances; + name?: string; + prologue?: string; +}; + +export type CreateAppReqV2 = { + appDescription?: string; + appGroupID?: string; + /** 提示查询 */ + appGuidance?: Guidances; + appImage?: string; + appName?: string; + /** 开场白 */ + appPrologue?: string; + historyLimit?: number; + modelConfigs?: ModelConfigsMap; + prePrompt?: string; + providerId?: string; +}; + +export type CreateAttentionReq = { + followeeUserIDList?: string[]; + iamID?: string; +}; + +export type CreateFeedbacksResp = object; + +export type CreateSharePathRESP = { + path?: string; +}; + +export type Data = { + appkey?: string; + appsecret?: string; + /** 0-未开启,1-开启 */ + state?: number; + url?: string; + wxExtra?: WxExtra; +}; + +export type DatasetData = { + author?: string; + description?: string; + docCount?: number; + document_count?: number; + id?: string; + name?: string; + permission?: string; + state?: string; + uuid?: string; + word_count?: number; +}; + +export type DeleteAttentionReq = { + followeeUserIDList?: string[]; + iamID?: string; +}; + +export type DeleteFeedbacksResp = object; + +export type DeleteMemberBody = { + /** 用户id */ + userID?: string; +}; + +export type DeleteResp = { + msg?: string; +}; + +export type EmptyObject = object; + +export type ErrorResp = { + msg?: string; + type?: Record; +}; + +export type ExchangeTokenRESP = { + /** 访问令牌 */ + access_token?: string; + /** 访问令牌过期时间 */ + expires_in?: string; + /** 刷新令牌过期时间 */ + refresh_expires_in?: string; + /** 刷新令牌 */ + refresh_token?: string; + /** 令牌类型 */ + token_type?: string; +}; + +export type Feedback = { + /** 评论 */ + comment?: string; + conversation_id?: string; + createdAt?: string; + message_id?: string; + /** like/unlike */ + rating?: string; + /** 打分 */ + score?: number; + updatedAt?: string; +}; + +export type FeedbacksReqBody = { + /** 评论 */ + comment?: string; + conversation_id?: string; + /** like/unlike */ + rating?: string; + /** 分数1-10 */ + score?: number; +}; + +export type FilestreamResp = { + conversation_id?: string; +}; + +export type GetApiTokenByRandomPathRESP = { + apiTokenID?: string; + appID?: string; + appName?: string; + createdAt?: string; + recommendedContext?: AppRecommendedContext[]; + switchRecommendedContext?: boolean; + switchRecommendedQuestion?: boolean; + token?: string; + updatedAt?: string; +}; + +export type GetAppKeyReq = { + appid: string; + /** wjl,dingding,feishu,wxa,wx */ + type: string; +}; + +export type GetAttentionDataCountReq = { + appIDList?: string[]; + iamID?: string; + userID?: string; +}; + +export type GetImagePreSignedUrlResp = { + appImage?: string; + preSignedPutUrl?: string; +}; + +export type Guidances = { + items?: string[]; +}; + +export type HistoryInfo = { + /** like/unlike */ + Rating?: string; + answer?: string; + answerToken?: number; + /** 评论 */ + comment?: string; + createAt?: string; + format?: string[]; + messageId?: string; + query?: string; + queryToken?: number; + /** 打分 */ + score?: number; + totalToken?: number; +}; + +export type IAMUserInfo = { + /** 创建时间 */ + createdTime?: string; + /** Cid string `json:"cid"` */ + email?: string; + /** 用户id */ + id?: string; + idpId?: string; + /** 是否iam管理员 */ + isAdmin?: boolean; + isAppAdmin?: boolean; + /** 是否罗克佳华人员 */ + isRkUser?: boolean; + /** 是否超级管理员 */ + isSuperUser?: boolean; + isSystemAdmin?: boolean; + /** Deleted int32 `json:"deleted"` // 逻辑删除 */ + lastTime?: string; + /** 登录名 */ + loginName?: string; + /** 消息类型 */ + msgType?: number; + /** 电话 */ + phone?: string; + /** 罗克佳华用户账号 */ + rkUserCard?: string; + /** 个性签名 */ + sign?: string; + /** 状态:1可用;0未激活;-1禁用 */ + status?: number; + /** 修改时间 */ + updatedTime?: string; + /** 用户类型 */ + useType?: string; + /** 用户名 */ + userName?: string; + wechatAppId?: string; + wechatSwitch?: boolean; + wechatgzhSwitch?: boolean; +}; + +export type ListAllAttentionUser = { + data?: AttentionUser[]; + total?: number; +}; + +export type ListAppDatasetConfigResp = { + data?: AppDatasetConfig[]; + total?: number; +}; + +export type ListAppDatasets = { + Data?: AppDatasets[]; + total?: number; +}; + +export type ListAppResp = { + data?: AppResp[]; + total?: number; +}; + +export type ListAttentionConversationReq = { + appIDList?: string[]; + iamID?: string; + offset?: number; + size?: number; + userID?: string; +}; + +export type ListAttentionUserResp = { + data?: AttentionUserResp[]; + total?: number; +}; + +export type ListConversationLogsResp = { + data?: ConversationLogsResp[]; + total?: number; +}; + +export type ListConversationResp = { + data?: ConversationResp[]; + total?: number; +}; + +export type ListDatasetsResp = { + data?: DatasetData[]; + has_more?: boolean; + offset?: number; + size?: number; + total?: number; +}; + +export type ListFeedbacksResp = { + data?: Feedback[]; + total?: number; +}; + +export type ListMemberRESP = { + data?: MemberWithRoleData[]; + total?: number; +}; + +export type ListProviderResp = { + data?: ProviderResp[]; + total?: number; +}; + +export type ListUserWithAppRESP = { + data?: UserWithAppData[]; + total?: number; +}; + +export type ListWorkspaceGroup = { + data?: WorkspaceGroup[]; +}; + +export type ListWorkspacePermissions = { + data?: WorkspacePermissions[]; + total?: number; +}; + +export type Map = object; + +export type MemberBody = { + /** 角色(system_admin-系统管理员;system_user-系统管普通用户;app_admin-应用管理员;app_user-应用普通用户) */ + role?: RbacRole; + /** 用户id */ + userID?: string; +}; + +export type MemberWithRoleData = { + /** 应用角色 */ + appRole?: RbacRole; + createdAt?: string; + email?: string; + idpID?: string; + /** 是否是app管理员 */ + isAppAdmin?: boolean; + /** 是否是系统管理员 */ + isSystemAdmin?: boolean; + operator?: string; + phone?: string; + /** 角色(系统管理员、系统普通用户) */ + role?: RbacRole; + updatedAt?: string; + /** iam 用户id */ + userID?: string; + userName?: string; +}; + +export type MessagesCountResp = { + /** 请求消耗token */ + messagesCount?: number; + time?: string; +}; + +export type MessagesTokenResp = { + /** 回答消耗token */ + answerToken?: number; + /** 请求消耗token */ + queryToken?: number; + time?: string; + totalToken?: number; +}; + +export type ModelConfigsMap = { + /** 模型(ERNIE-Bot-4;ERNIE-Bot;ERNIE-Bot-turbo;gpt-3.5-turbo-16k;gpt-4-1106-preview) */ + model_type?: string; + /** 通过对已生成的token增加惩罚,减少重复生成的现象。取值范围:[1.0, 2.0] */ + penalty_score?: number; + /** 较高的数值会使输出更加随机,而较低的数值会使其更加集中和确定。默认0.95,范围 (0, 1.0] */ + temperature?: number; + /** tools call */ + tools_call?: boolean; + /** 影响输出文本的多样性,取值越大,生成文本的多样性越强。取值范围 [0, 1.0] */ + top_p?: number; +}; + +export type ModelConfigsMap2 = { + /** 模型(ERNIE-Bot-4;ERNIE-Bot;ERNIE-Bot-turbo;gpt-3.5-turbo-16k;gpt-4-1106-preview) */ + model_type?: string; + /** 通过对已生成的token增加惩罚,减少重复生成的现象。取值范围:[1.0, 2.0] */ + penalty_score?: number; + /** 较高的数值会使输出更加随机,而较低的数值会使其更加集中和确定。默认0.95,范围 (0, 1.0] */ + temperature?: number; + tools_call?: boolean; + /** 影响输出文本的多样性,取值越大,生成文本的多样性越强。取值范围 [0, 1.0] */ + top_p?: number; +}; + +export enum Permission { + 'read_only' = 'read_only', + 'operation' = 'operation', + 'no_permission' = 'no_permission', +} + +export type IPermission = keyof typeof Permission; + +export type ProviderResp = { + /** 名字 */ + name?: string; + providerID?: string; + subType?: string[]; + /** 类型 */ + type?: ProviderType; +}; + +export enum ProviderType { + 'openai' = 'openai', + 'spark' = 'spark', + 'wenxin' = 'wenxin', + 'rockai' = 'rockai', +} + +export type IProviderType = keyof typeof ProviderType; + +export type QueryTokenResp = { + /** 消耗输出token */ + AnswerTokensCount?: number; + /** 消耗输入token */ + queryTokensCount?: number; + /** 消耗总token */ + totalTokens?: number; +}; + +export type QuestionRecommendReq = { + conversation_id?: string; + /** Query string `json:"query"`Answer string `json:"answer"` */ + user?: string; +}; + +export enum RbacRole { + 'system_admin' = 'system_admin', + 'system_user' = 'system_user', + 'app_admin' = 'app_admin', + 'app_user' = 'app_user', +} + +export type IRbacRole = keyof typeof RbacRole; + +export type RecommendQuestionAndContext = { + contexts?: AppRecommendedContext[]; + questions?: string[]; +}; + +export type RefreshTokenBody = { + refreshToken?: string; +}; + +export type ReleaseDiscoverReq = { + alterAppID?: string; + /** 应用类型 */ + appType?: number; + /** 是否作为模版 TRUE:作为模版;FALSE:不作为 */ + templateStatus?: string; +}; + +export type ResponseData = { + answer?: string; + conversation_id?: string; + created_at?: number; + event?: string; + id?: string; + trace_id?: string; +}; + +export type ResponseRecommendData = { + answer?: string; + conversation_id?: string; + created_at?: number; + event?: string; + id?: string; + trace_id?: string; +}; + +export type SpeechToTextResp = { + /** 转化的结果 */ + text?: string; +}; + +export type TextToSpeechReq = { + /** 需要转的文字 */ + text?: string; +}; + +export type UpdateAppGroup = { + appGroupID?: string; +}; + +export type UpdateAppKeyStateReq = { + appid: string; + /** 0-关闭,1-启动 */ + state?: number; + /** wjl,dingding,feishu */ + type: string; +}; + +export type UpdateAppReq = { + appDescription?: string; + appGroupID?: string; + appImage?: string; + appName?: string; +}; + +export type UpdateAppReqV2 = { + appGroupID?: string; + /** 提示查询 */ + appGuidance?: Guidances; + /** 开场白 */ + appPrologue?: string; + /** 推荐内容 */ + appRecommendedContexts?: AppRecommendedContext[]; + historyLimit?: number; + modelConfigs?: ModelConfigsMap; + prePrompt?: string; + providerId?: string; + recommendSwitch?: boolean; +}; + +export type UpdateAppStatusReq = { + /** PUBLIC:公开;PRIVATE:私有 */ + appStatus?: string; +}; + +export type UpdateUserRoleBody = { + /** 角色(system_admin-系统管理员;system_user-系统管普通用户;app_admin-应用管理员;app_user-应用普通用户) */ + role?: RbacRole; + /** 用户id */ + userID?: string; +}; + +export type User = { + createdAt?: string; + email?: string; + idpID?: string; + operator?: string; + phone?: string; + /** 角色(系统管理员、系统普通用户) */ + role?: RbacRole; + updatedAt?: string; + /** iam 用户id */ + userID?: string; + userName?: string; +}; + +export type UserWithAppData = { + appWithPermissionList?: AppWithPermission[]; + createdAt?: string; + email?: string; + idpID?: string; + isSystemAdmin?: boolean; + operator?: string; + phone?: string; + /** 角色(系统管理员、系统普通用户) */ + role?: RbacRole; + updatedAt?: string; + /** iam 用户id */ + userID?: string; + userName?: string; +}; + +export type v1ApiAppAppIdApiTokenUsingGetParams = { + /** 应用id */ + appID: string; + /** 每页大小 */ + size: number; + /** 分页 */ + offset: number; +}; + +export type v1ApiAppAppIdApiTokenUsingPostParams = { + /** 应用id */ + appID: string; +}; + +export type v1ApiAppAppIdDatasetConfigsUsingDeleteParams = { + /** 应用id */ + appID: string; + /** 应用知识库配置id */ + appDatasetConfigID: string; +}; + +export type v1ApiAppAppIdDatasetConfigsUsingGetParams = { + /** 应用id */ + appID: string; +}; + +export type v1ApiAppAppIdDatasetConfigsUsingPostParams = { + /** 应用id */ + appID: string; +}; + +export type v1ApiAppAppIdDatasetConfigsUsingPutParams = { + /** 应用id */ + appID: string; +}; + +export type v1ApiAppAppIdDatasetsListUsingGetParams = { + /** 应用id */ + appID: string; + /** size */ + size?: number; + /** offset */ + offset?: number; +}; + +export type v1ApiAppAppIdDatasetsUsingDeleteParams = { + /** 应用id */ + appID: string; + /** 数据集id */ + datasetID: string; +}; + +export type V1ApiAppAppIdDatasetsUsingPostBody = API.AppDatasets[]; + +export type v1ApiAppAppIdDatasetsUsingPostParams = { + /** 应用id */ + appID: string; +}; + +export type v1ApiAppAppIdDetailsUsingGetParams = { + /** 应用id */ + appID: string; +}; + +export type v1ApiAppAppIdHourlyMessagesUsingGetParams = { + /** 应用id */ + appID: string; + /** 开始时间,秒级时间戳 */ + starTimestamp?: number; + /** 结束时间,秒级时间戳 */ + endTimestamp?: number; +}; + +export type v1ApiAppAppIdHourlyTokenUsingGetParams = { + /** 应用id */ + appID: string; + /** 开始时间,秒级时间戳 */ + starTimestamp?: number; + /** 结束时间,秒级时间戳 */ + endTimestamp?: number; +}; + +export type v1ApiAppAppIdLogsConversationIdMessagesUsingGetParams = { + /** 应用id */ + appID: string; + /** 会话id */ + conversationID: string; +}; + +export type v1ApiAppAppIdLogsUsingGetParams = { + /** 应用id */ + appID: string; + /** 会话id */ + conversationID?: string; + /** 结束时间 */ + endTimestamp?: number; + /** 页数1开始 */ + pageOffset?: number; + /** 每页数量 */ + pageSize?: number; + /** 模型id */ + providerID?: string; + /** 开始时间 */ + starTimestamp?: number; + /** 用户id */ + userID?: string; +}; + +export type v1ApiAppAppIdMemberRoleUsingPutParams = { + /** 应用id */ + appID: string; +}; + +export type v1ApiAppAppIdMemberUsingDeleteParams = { + /** 应用id */ + appID: string; +}; + +export type v1ApiAppAppIdMemberUsingGetParams = { + /** 应用id */ + appID: string; + /** 每页大小 */ + size: number; + /** 分页 */ + offset: number; +}; + +export type v1ApiAppAppIdMemberUsingPostParams = { + /** 应用id */ + appID: string; +}; + +export type v1ApiAppAppIdMessagesUsingGetParams = { + /** 应用id */ + appID: string; + /** 开始时间,秒级时间戳 */ + starTimestamp?: number; + /** 结束时间,秒级时间戳 */ + endTimestamp?: number; +}; + +export type v1ApiAppAppIdModelConfigsUsingPostParams = { + /** 应用id */ + appID: string; +}; + +export type v1ApiAppAppIdModelConfigsUsingPutParams = { + /** 应用id */ + appID: string; +}; + +export type v1ApiAppAppIdModelPromptUsingPostParams = { + /** 应用id */ + appID: string; +}; + +export type v1ApiAppAppIdOpenApiDeleteUsingDeleteParams = { + /** 应用id */ + appID: string; +}; + +export type v1ApiAppAppIdPluginUsingPutParams = { + /** 应用id */ + appID: string; +}; + +export type v1ApiAppAppIdRecommendedContextUsingGetParams = { + /** 应用id */ + appID: string; +}; + +export type v1ApiAppAppIdRecommendedContextUsingPostParams = { + /** 应用id */ + appID: string; +}; + +export type v1ApiAppAppIdShareUsingPutParams = { + /** 应用id */ + appID: string; + /** 是否h5 */ + isH5?: boolean; +}; + +export type v1ApiAppAppIdTokenUsingGetParams = { + /** 应用id */ + appID: string; + /** 开始时间,秒级时间戳 */ + starTimestamp?: number; + /** 结束时间,秒级时间戳 */ + endTimestamp?: number; +}; + +export type v1ApiAppAppIdUpdateStatusUsingPutParams = { + /** 应用id */ + appID: string; +}; + +export type v1ApiAppAppIdUpdateUsingPutParams = { + /** 应用id */ + appID: string; +}; + +export type v1ApiAppH5ShareApiTokenUsingGetParams = { + /** 分享的随机path */ + randomPath: string; +}; + +export type v1ApiAppIdCostUsingPostParams = { + /** 应用id */ + appID: string; + /** 会话id */ + conversationID?: string; + /** 结束时间 */ + endTimestamp?: number; + /** 页数1开始 */ + pageOffset?: number; + /** 每页数量 */ + pageSize?: number; + /** 模型id */ + providerID?: string; + /** 开始时间 */ + starTimestamp?: number; + /** 用户id */ + userID?: string; +}; + +export type v1ApiAppListPrivateUsingGetParams = { + /** 是否只查看会话过的应用 */ + onlyConversations?: boolean; +}; + +export type v1ApiAppListPublicUsingGetParams = { + /** 是否只查看会话过的应用 */ + onlyConversations?: boolean; +}; + +export type v1ApiAppShareApiTokenUsingGetParams = { + /** 分享的随机path */ + randomPath: string; +}; + +export type v1ApiAttentionAppListUsingGetParams = { + /** IAM用户id */ + iamID: string; +}; + +export type v1ApiAttentionMessagesHistoryUsingGetParams = { + /** IAM ID */ + iamID: string; + /** 应用id */ + appID: string; + /** 会话id */ + conversationID: string; +}; + +export type v1ApiAttentionUserAllUsingGetParams = { + /** 登陆用户IAMID */ + iamID?: string; + /** 用户id */ + isAttention?: boolean; + /** 名字或电话,模糊匹配 */ + nameOrPhone?: string; + offset?: number; + /** 电话号码 */ + phone?: string; + size?: number; + /** 用户id */ + userID?: string; + /** 用户名字用于搜索 */ + userName?: string; +}; + +export type v1ApiAttentionUserListUsingPostParams = { + /** IAM ID */ + iamID: string; + /** 默认10 */ + size?: number; + /** 默认0 */ + offset?: number; +}; + +export type v1ApiConversationsConversationIdHistoryUsingDeleteParams = { + /** 会话id */ + conversation_id: string; + /** 聊天信息id */ + message_id: string; +}; + +export type v1ApiConversationsConversationIdHistoryUsingGetParams = { + /** 会话id */ + conversation_id: string; +}; + +export type v1ApiConversationsUsingDeleteParams = { + /** 会话id */ + conversation_id: string; +}; + +export type v1ApiConversationsUsingGetParams = { + /** 用户id,空值不返回 */ + user_id?: string; +}; + +export type v1ApiFeedbacksMessageIdUsingDeleteParams = { + /** 消息id */ + message_id: string; + /** 会话id */ + conversation_id: string; +}; + +export type v1ApiFeedbacksMessageIdUsingPostParams = { + /** 消息id */ + message_id: string; +}; + +export type v1ApiFeedbacksUsingGetParams = { + conversation_ID?: string; + message_ID?: string; + /** 页数1开始 */ + pageOffset?: number; + /** 每页数量 */ + pageSize?: number; +}; + +export type V1ApiFileUsingPostBody = { + /** 文件 */ + file: string; +}; + +export type v1ApiFileUsingPostParams = { + /** 会话id */ + conversation_id?: string; + /** user id */ + user_id?: string; +}; + +export type v1ApiIamAccountUsingGetParams = { + /** openId */ + openId: string; +}; + +export type v1ApiProviderListUsingGetParams = { + /** size */ + size?: number; + /** offset */ + offset?: number; +}; + +export type v1ApiRobotWorkspaceIdAppkeyStateUsingPostParams = { + /** 空间ID */ + workspaceID: string; +}; + +export type v1ApiRobotWorkspaceIdAppkeyUsingDeleteParams = { + /** 空间ID */ + workspaceID: string; +}; + +export type v1ApiRobotWorkspaceIdAppkeyUsingGetParams = { + /** 空间ID */ + workspaceID: string; + appid: string; + /** wjl,dingding,feishu,wxa,wx */ + type: string; +}; + +export type v1ApiRobotWorkspaceIdAppkeyUsingPostParams = { + /** 空间ID */ + workspaceID: string; +}; + +export type V1ApiSpeechToTextUsingPostBody = { + /** 文件 */ + file: string; +}; + +export type v1ApiUserInfoUsingGetParams = { + /** 应用id */ + appID?: string; +}; + +export type v1ApiUserUsingGetParams = { + offset?: number; + /** 电话号码 */ + phone?: string; + size?: number; + /** 用户id */ + userID?: string; + /** 用户名字用于搜索 */ + userName?: string; +}; + +export type v2ApiAppAppIdDetailsUsingGetParams = { + /** 应用id */ + appID: string; +}; + +export type v2ApiAppAppIdUpdateUsingPostParams = { + /** 应用id */ + appID: string; +}; + +export type v2ApiAppListUsingGetParams = { + /** 是否只查看会话过的应用 */ + onlyConversations?: boolean; +}; + +export type v2ApiAppShareApiTokenUsingGetParams = { + /** 分享的随机path */ + randomPath: string; +}; + +export type v2ApiChatMessagesMessagesCountUsingGetParams = { + /** 是否查询人均,默认false */ + isPerPerson?: boolean; + /** 开始时间,秒级时间戳 */ + starTimestamp?: number; + /** 结束时间,秒级时间戳 */ + endTimestamp?: number; +}; + +export type V2ApiFileUsingPostBody = { + /** 要上传的文件 */ + files: unknown[]; +}; + +export type v2ApiFileUsingPostParams = { + /** 会话id */ + conversation_id?: string; + /** user id */ + user_id?: string; +}; + +export type v2ApiWorkspacesDefaultUsingPostParams = { + /** 空间ID */ + workspaceID: string; +}; + +export type v2ApiWorkspacesRecommendedMessageIdDetailsUsingGetParams = { + /** 消息id */ + messageId: string; +}; + +export type V2ApiWorkspacesWorkspaceIdAppAppIdDatasetsJoinUsingPostBody = + API.AppDatasets[]; + +export type v2ApiWorkspacesWorkspaceIdAppAppIdDatasetsJoinUsingPostParams = { + /** 空间ID */ + workspaceID: string; + /** 应用id */ + appID: string; +}; + +export type v2ApiWorkspacesWorkspaceIdAppAppIdDatasetsUsingDeleteParams = { + /** 应用id */ + appID: string; + /** 空间ID */ + workspaceID: string; + /** 数据集id */ + datasetID: string; +}; + +export type v2ApiWorkspacesWorkspaceIdAppAppIdDetailsUsingGetParams = { + /** 空间ID */ + workspaceID: string; + /** 应用id */ + appID: string; +}; + +export type v2ApiWorkspacesWorkspaceIdAppAppIdHourlyMessagesUsingGetParams = { + /** 空间ID */ + workspaceID: string; + /** 应用id */ + appID: string; + /** 开始时间,秒级时间戳 */ + starTimestamp?: number; + /** 结束时间,秒级时间戳 */ + endTimestamp?: number; +}; + +export type v2ApiWorkspacesWorkspaceIdAppAppIdHourlyTokenUsingGetParams = { + /** 空间ID */ + workspaceID: string; + /** 应用id */ + appID: string; + /** 开始时间,秒级时间戳 */ + starTimestamp?: number; + /** 结束时间,秒级时间戳 */ + endTimestamp?: number; +}; + +export type v2ApiWorkspacesWorkspaceIdAppAppIdLogsUsingGetParams = { + /** 应用id */ + appID: string; + /** 空间ID */ + workspaceID: string; + /** 会话id */ + conversationID?: string; + /** 结束时间 */ + endTimestamp?: number; + /** 页数1开始 */ + pageOffset?: number; + /** 每页数量 */ + pageSize?: number; + /** 模型id */ + providerID?: string; + /** 开始时间 */ + starTimestamp?: number; + /** 用户id */ + userID?: string; +}; + +export type v2ApiWorkspacesWorkspaceIdAppAppIdMessagesUsingGetParams = { + /** 空间ID */ + workspaceID: string; + /** 应用id */ + appID: string; + /** 开始时间,秒级时间戳 */ + starTimestamp?: number; + /** 结束时间,秒级时间戳 */ + endTimestamp?: number; +}; + +export type v2ApiWorkspacesWorkspaceIdAppAppIdModelConfigsUsingPutParams = { + /** 应用id */ + appID: string; + /** 空间ID */ + workspaceID: string; +}; + +export type v2ApiWorkspacesWorkspaceIdAppAppIdPluginUsingGetParams = { + /** 应用id */ + appID: string; + /** 空间ID */ + workspaceID: string; +}; + +export type v2ApiWorkspacesWorkspaceIdAppAppIdTokenUsingGetParams = { + /** 应用id */ + appID: string; + /** 开始时间,秒级时间戳 */ + starTimestamp?: number; + /** 结束时间,秒级时间戳 */ + endTimestamp?: number; +}; + +export type v2ApiWorkspacesWorkspaceIdAppAppIdUpdateStatusUsingPutParams = { + /** 空间ID */ + workspaceID: string; + /** 应用id */ + appID: string; +}; + +export type v2ApiWorkspacesWorkspaceIdAppAppIdUsingPostParams = { + /** 空间ID */ + workspaceID: string; + /** 应用id */ + appID: string; +}; + +export type v2ApiWorkspacesWorkspaceIdAppsAppIdBaseUsingPostParams = { + /** 应用id */ + appID: string; + /** 空间ID */ + workspaceID: string; +}; + +export type v2ApiWorkspacesWorkspaceIdAppsAppIdGroupUsingPostParams = { + /** 应用id */ + appID: string; + /** 空间ID */ + workspaceID: string; +}; + +export type v2ApiWorkspacesWorkspaceIdAppsAppIdUsingDeleteParams = { + /** 应用id */ + appID: string; + /** 空间ID */ + workspaceID: string; +}; + +export type v2ApiWorkspacesWorkspaceIdAppsUsingGetParams = { + /** 空间ID */ + workspaceID: string; + /** 是否只查看会话过的应用 */ + onlyConversations?: boolean; + /** 应用名,模糊查询 */ + appName?: string; +}; + +export type v2ApiWorkspacesWorkspaceIdAppsUsingPostParams = { + /** 空间ID */ + workspaceID: string; +}; + +export type v2ApiWorkspacesWorkspaceIdDatasetsUsingGetParams = { + /** 空间ID */ + workspaceID: string; +}; + +export type v2ApiWorkspacesWorkspaceIdDatasetsUsingPostParams = { + /** 空间ID */ + workspaceID: string; +}; + +export type v2ApiWorkspacesWorkspaceIdGroupsUsingGetParams = { + /** 空间ID */ + workspaceID: string; +}; + +export type v2ApiWorkspacesWorkspaceIdGroupsUsingPostParams = { + /** 空间ID */ + workspaceID: string; +}; + +export type v2ApiWorkspacesWorkspaceIdGroupsWorkspaceGroupIdUsingDeleteParams = + { + /** 空间ID */ + workspaceID: string; + /** 分组ID */ + workspaceGroupID: string; + }; + +export type v2ApiWorkspacesWorkspaceIdGroupsWorkspaceGroupIdUsingPostParams = { + /** 空间ID */ + workspaceID: string; + /** 分组ID */ + workspaceGroupID: string; +}; + +export type v2ApiWorkspacesWorkspaceIdPermissionsUsingGetParams = { + /** 空间ID */ + workspaceID: string; +}; + +export type v2ApiWorkspacesWorkspaceIdUsersUsingGetParams = { + /** 空间ID */ + workspaceID: string; +}; + +export type v2ApiWorkspacesWorkspaceIdUsersUsingPostParams = { + /** 空间ID */ + workspaceID: string; +}; + +export type v2ApiWorkspacesWorkspaceIdUserUserIdUsingDeleteParams = { + /** 空间ID */ + workspaceID: string; + /** userID */ + userID: string; +}; + +export type v2ApiWorkspacesWorkspaceIdUsingDeleteParams = { + /** 空间ID */ + workspaceID: string; +}; + +export type v2ApiWorkspacesWorkspaceIdUsingPostParams = { + /** 空间ID */ + workspaceID: string; +}; + +export type WJLAccount = { + code?: number; + data?: { + avatar?: string; + iamUserId?: string; + nameInTeam?: string; + nickName?: string; + phone?: string; + realNameFlag?: number; + }; + msg?: string; + success?: boolean; +}; + +export type WorkspaceGroup = { + createdAt?: string; + /** 分组名 */ + name?: string; + updatedAt?: string; + workspaceGroupID?: string; + workspaceID?: string; +}; + +export type WorkspaceGroupReq = { + name?: string; +}; + +export type WorkspaceListResp = { + data?: WorkspaceResp[]; + total?: number; +}; + +export type WorkspacePermissions = { + createdAt?: string; + email?: string; + idpID?: string; + operator?: string; + /** 枚举read_only(只读)、operation(操作) */ + permission?: Permission; + phone?: string; + /** 角色(系统管理员、系统普通用户) */ + role?: RbacRole; + updatedAt?: string; + /** iam 用户id */ + userID?: string; + userName?: string; +}; + +export type WorkspaceReq = { + /** 描述 */ + description?: string; + /** 空间名 */ + name?: string; +}; + +export type WorkspaceResp = { + /** 空间描述 */ + description?: string; + /** 空间名 */ + name?: string; + /** 空间ID */ + workspaceID?: string; +}; + +export enum WorkspaceRole { + 'workspace_admin' = 'workspace_admin', + 'workspace_user' = 'workspace_user', +} + +export type IWorkspaceRole = keyof typeof WorkspaceRole; + +export type WorkspaceUser = { + /** workspace_admin空间超管用户;workspace_user空间普通用户 */ + role?: WorkspaceRole; + /** 用户id */ + userID?: string; +}; + +export type WxExtra = { + encodingAESKey?: string; + token?: string; +}; +/* eslint-disable */ +// @ts-ignore +import { request } from 'axios'; + +import * as API from './types'; + +/** UpdateAppKeyState 为应用获取各种类型机器人状态 POST /llmops/v1/api/robot/${param0}/appkey/state */ +export async function v1ApiRobotWorkspaceIdAppkeyStateUsingPost({ + params, + body, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v1ApiRobotWorkspaceIdAppkeyStateUsingPostParams; + body: API.UpdateAppKeyStateReq; + options?: { [key: string]: unknown }; +}) { + const { workspaceID: param0, ...queryParams } = params; + + return request(`/llmops/v1/api/robot/${param0}/appkey/state`, { + method: 'POST', + params: { ...queryParams }, + data: body, + ...(options || {}), + }); +} +/* eslint-disable */ +// @ts-ignore +import { request } from 'axios'; + +import * as API from './types'; + +/** ListUser 系统全局用户列表 GET /llmops/v1/api/user */ +export async function v1ApiUserUsingGet({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v1ApiUserUsingGetParams; + options?: { [key: string]: unknown }; +}) { + return request('/llmops/v1/api/user', { + method: 'GET', + params: { + // size has a default value: 10 + size: '10', + + ...params, + }, + ...(options || {}), + }); +} + +/** GetUserInfoByToken 获取iam用户数据 GET /llmops/v1/api/user/info */ +export async function v1ApiUserInfoUsingGet({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v1ApiUserInfoUsingGetParams; + options?: { [key: string]: unknown }; +}) { + return request('/llmops/v1/api/user/info', { + method: 'GET', + params: { + ...params, + }, + ...(options || {}), + }); +} + +/** UpdateUserRole 更新用户角色 PUT /llmops/v1/api/user/role */ +export async function v1ApiUserRoleUsingPut({ + body, + options, +}: { + body: API.UpdateUserRoleBody; + options?: { [key: string]: unknown }; +}) { + return request('/llmops/v1/api/user/role', { + method: 'PUT', + data: body, + ...(options || {}), + }); +} +/* eslint-disable */ +// @ts-ignore +import { request } from 'axios'; + +import * as API from './types'; + +/** GetWorkspaceList 空间列表 GET /llmops/v2/api/workspaces */ +export async function v2ApiWorkspacesUsingGet({ + options, +}: { + options?: { [key: string]: unknown }; +}) { + return request('/llmops/v2/api/workspaces', { + method: 'GET', + ...(options || {}), + }); +} + +/** CreateWorkspace 创建空间 POST /llmops/v2/api/workspaces */ +export async function v2ApiWorkspacesUsingPost({ + body, + options, +}: { + body: API.WorkspaceReq; + options?: { [key: string]: unknown }; +}) { + return request('/llmops/v2/api/workspaces', { + method: 'POST', + data: body, + ...(options || {}), + }); +} + +/** GetDefaultWorkspace 获取用户默认空间 GET /llmops/v2/api/workspaces-default */ +export async function v2ApiWorkspacesDefaultUsingGet({ + options, +}: { + options?: { [key: string]: unknown }; +}) { + return request('/llmops/v2/api/workspaces-default', { + method: 'GET', + ...(options || {}), + }); +} + +/** 切换默认空间 POST /llmops/v2/api/workspaces-default */ +export async function v2ApiWorkspacesDefaultUsingPost({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v2ApiWorkspacesDefaultUsingPostParams; + options?: { [key: string]: unknown }; +}) { + return request('/llmops/v2/api/workspaces-default', { + method: 'POST', + params: { + ...params, + }, + ...(options || {}), + }); +} + +/** UpdateWorkspace 更新空间 POST /llmops/v2/api/workspaces/${param0} */ +export async function v2ApiWorkspacesWorkspaceIdUsingPost({ + params, + body, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v2ApiWorkspacesWorkspaceIdUsingPostParams; + body: API.WorkspaceReq; + options?: { [key: string]: unknown }; +}) { + const { workspaceID: param0, ...queryParams } = params; + + return request(`/llmops/v2/api/workspaces/${param0}`, { + method: 'POST', + params: { ...queryParams }, + data: body, + ...(options || {}), + }); +} + +/** DeleteWorkspace 删除空间 DELETE /llmops/v2/api/workspaces/${param0} */ +export async function v2ApiWorkspacesWorkspaceIdUsingDelete({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v2ApiWorkspacesWorkspaceIdUsingDeleteParams; + options?: { [key: string]: unknown }; +}) { + const { workspaceID: param0, ...queryParams } = params; + + return request(`/llmops/v2/api/workspaces/${param0}`, { + method: 'DELETE', + params: { ...queryParams }, + ...(options || {}), + }); +} + +/** CreateDatasetsJoinV2 创建 app 数据集关联 POST /llmops/v2/api/workspaces/${param0}/app/${param1}/datasets/join */ +export async function v2ApiWorkspacesWorkspaceIdAppAppIdDatasetsJoinUsingPost({ + params, + body, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v2ApiWorkspacesWorkspaceIdAppAppIdDatasetsJoinUsingPostParams; + body: API.V2ApiWorkspacesWorkspaceIdAppAppIdDatasetsJoinUsingPostBody; + options?: { [key: string]: unknown }; +}) { + const { workspaceID: param0, appID: param1, ...queryParams } = params; + + return request( + `/llmops/v2/api/workspaces/${param0}/app/${param1}/datasets/join`, + { + method: 'POST', + params: { ...queryParams }, + data: body, + ...(options || {}), + } + ); +} + +/** GetWorkspaceDatasetsList 空间下数据集列表 GET /llmops/v2/api/workspaces/${param0}/datasets */ +export async function v2ApiWorkspacesWorkspaceIdDatasetsUsingGet({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v2ApiWorkspacesWorkspaceIdDatasetsUsingGetParams; + options?: { [key: string]: unknown }; +}) { + const { workspaceID: param0, ...queryParams } = params; + + return request( + `/llmops/v2/api/workspaces/${param0}/datasets`, + { + method: 'GET', + params: { ...queryParams }, + ...(options || {}), + } + ); +} + +/** CreateWorkspaceDatasets 创建空间下数据集 POST /llmops/v2/api/workspaces/${param0}/datasets */ +export async function v2ApiWorkspacesWorkspaceIdDatasetsUsingPost({ + params, + body, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v2ApiWorkspacesWorkspaceIdDatasetsUsingPostParams; + body: API.AppDataset; + options?: { [key: string]: unknown }; +}) { + const { workspaceID: param0, ...queryParams } = params; + + return request(`/llmops/v2/api/workspaces/${param0}/datasets`, { + method: 'POST', + params: { ...queryParams }, + data: body, + ...(options || {}), + }); +} + +/** GetWorkspaceUserRole 查询空间用户权限 GET /llmops/v2/api/workspaces/${param0}/permissions */ +export async function v2ApiWorkspacesWorkspaceIdPermissionsUsingGet({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v2ApiWorkspacesWorkspaceIdPermissionsUsingGetParams; + options?: { [key: string]: unknown }; +}) { + const { workspaceID: param0, ...queryParams } = params; + + return request( + `/llmops/v2/api/workspaces/${param0}/permissions`, + { + method: 'GET', + params: { ...queryParams }, + ...(options || {}), + } + ); +} + +/** DeleteWorkspaceUsers 删除空间下用户 DELETE /llmops/v2/api/workspaces/${param0}/user/${param1} */ +export async function v2ApiWorkspacesWorkspaceIdUserUserIdUsingDelete({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v2ApiWorkspacesWorkspaceIdUserUserIdUsingDeleteParams; + options?: { [key: string]: unknown }; +}) { + const { workspaceID: param0, userID: param1, ...queryParams } = params; + + return request( + `/llmops/v2/api/workspaces/${param0}/user/${param1}`, + { + method: 'DELETE', + params: { ...queryParams }, + ...(options || {}), + } + ); +} + +/** GetWorkspaceUsers 查询空间下用户列表 GET /llmops/v2/api/workspaces/${param0}/users */ +export async function v2ApiWorkspacesWorkspaceIdUsersUsingGet({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v2ApiWorkspacesWorkspaceIdUsersUsingGetParams; + options?: { [key: string]: unknown }; +}) { + const { workspaceID: param0, ...queryParams } = params; + + return request( + `/llmops/v2/api/workspaces/${param0}/users`, + { + method: 'GET', + params: { ...queryParams }, + ...(options || {}), + } + ); +} + +/** CreateOrUpdateWorkspaceUsers 添加或更新空间下用户角色 POST /llmops/v2/api/workspaces/${param0}/users */ +export async function v2ApiWorkspacesWorkspaceIdUsersUsingPost({ + params, + body, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v2ApiWorkspacesWorkspaceIdUsersUsingPostParams; + body: API.WorkspaceUser; + options?: { [key: string]: unknown }; +}) { + const { workspaceID: param0, ...queryParams } = params; + + return request(`/llmops/v2/api/workspaces/${param0}/users`, { + method: 'POST', + params: { ...queryParams }, + data: body, + ...(options || {}), + }); +} +/* eslint-disable */ +// @ts-ignore +import { request } from 'axios'; + +import * as API from './types'; + +/** CopyApp 复制 app POST /llmops/v2/api/copy_apps */ +export async function v2ApiCopyAppsUsingPost({ + body, + options, +}: { + body: API.CopyAppReq; + options?: { [key: string]: unknown }; +}) { + return request('/llmops/v2/api/copy_apps', { + method: 'POST', + data: body, + ...(options || {}), + }); +} + +/** UpdateAppV2.1 更新 app 信息 POST /llmops/v2/api/workspaces/${param0}/app/${param1} */ +export async function v2ApiWorkspacesWorkspaceIdAppAppIdUsingPost({ + params, + body, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v2ApiWorkspacesWorkspaceIdAppAppIdUsingPostParams; + body: API.UpdateAppReqV2; + options?: { [key: string]: unknown }; +}) { + const { workspaceID: param0, appID: param1, ...queryParams } = params; + + return request(`/llmops/v2/api/workspaces/${param0}/app/${param1}`, { + method: 'POST', + params: { ...queryParams }, + data: body, + ...(options || {}), + }); +} + +/** GetAppDetailsV2.1 查询 app 详情 GET /llmops/v2/api/workspaces/${param0}/app/${param1}/details */ +export async function v2ApiWorkspacesWorkspaceIdAppAppIdDetailsUsingGet({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v2ApiWorkspacesWorkspaceIdAppAppIdDetailsUsingGetParams; + options?: { [key: string]: unknown }; +}) { + const { workspaceID: param0, appID: param1, ...queryParams } = params; + + return request( + `/llmops/v2/api/workspaces/${param0}/app/${param1}/details`, + { + method: 'GET', + params: { ...queryParams }, + ...(options || {}), + } + ); +} + +/** GetSumHourlyMessagesCountV2.1 每小时messages数 GET /llmops/v2/api/workspaces/${param0}/app/${param1}/hourly-messages */ +export async function v2ApiWorkspacesWorkspaceIdAppAppIdHourlyMessagesUsingGet({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v2ApiWorkspacesWorkspaceIdAppAppIdHourlyMessagesUsingGetParams; + options?: { [key: string]: unknown }; +}) { + const { workspaceID: param0, appID: param1, ...queryParams } = params; + + return request( + `/llmops/v2/api/workspaces/${param0}/app/${param1}/hourly-messages`, + { + method: 'GET', + params: { + ...queryParams, + }, + ...(options || {}), + } + ); +} + +/** GetSumHourlyTokenV2.1 每小时token数 GET /llmops/v2/api/workspaces/${param0}/app/${param1}/hourly-token */ +export async function v2ApiWorkspacesWorkspaceIdAppAppIdHourlyTokenUsingGet({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v2ApiWorkspacesWorkspaceIdAppAppIdHourlyTokenUsingGetParams; + options?: { [key: string]: unknown }; +}) { + const { workspaceID: param0, appID: param1, ...queryParams } = params; + + return request( + `/llmops/v2/api/workspaces/${param0}/app/${param1}/hourly-token`, + { + method: 'GET', + params: { + ...queryParams, + }, + ...(options || {}), + } + ); +} + +/** GetSumDailyMessagesCountV2.1 每日messages数 GET /llmops/v2/api/workspaces/${param0}/app/${param1}/messages */ +export async function v2ApiWorkspacesWorkspaceIdAppAppIdMessagesUsingGet({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v2ApiWorkspacesWorkspaceIdAppAppIdMessagesUsingGetParams; + options?: { [key: string]: unknown }; +}) { + const { workspaceID: param0, appID: param1, ...queryParams } = params; + + return request( + `/llmops/v2/api/workspaces/${param0}/app/${param1}/messages`, + { + method: 'GET', + params: { + ...queryParams, + }, + ...(options || {}), + } + ); +} + +/** UpdateAppStatusV2.1 更新 app 状态 PUT /llmops/v2/api/workspaces/${param0}/app/${param1}/update_status */ +export async function v2ApiWorkspacesWorkspaceIdAppAppIdUpdateStatusUsingPut({ + params, + body, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v2ApiWorkspacesWorkspaceIdAppAppIdUpdateStatusUsingPutParams; + body: API.UpdateAppStatusReq; + options?: { [key: string]: unknown }; +}) { + const { workspaceID: param0, appID: param1, ...queryParams } = params; + + return request( + `/llmops/v2/api/workspaces/${param0}/app/${param1}/update_status`, + { + method: 'PUT', + params: { ...queryParams }, + data: body, + ...(options || {}), + } + ); +} + +/** ListAppV2.1 查询用户关联的 app 列表 GET /llmops/v2/api/workspaces/${param0}/apps */ +export async function v2ApiWorkspacesWorkspaceIdAppsUsingGet({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v2ApiWorkspacesWorkspaceIdAppsUsingGetParams; + options?: { [key: string]: unknown }; +}) { + const { workspaceID: param0, ...queryParams } = params; + + return request(`/llmops/v2/api/workspaces/${param0}/apps`, { + method: 'GET', + params: { + ...queryParams, + }, + ...(options || {}), + }); +} + +/** CreateAppV2.1 创建 app POST /llmops/v2/api/workspaces/${param0}/apps */ +export async function v2ApiWorkspacesWorkspaceIdAppsUsingPost({ + params, + body, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v2ApiWorkspacesWorkspaceIdAppsUsingPostParams; + body: API.CreateAppReqV2; + options?: { [key: string]: unknown }; +}) { + const { workspaceID: param0, ...queryParams } = params; + + return request(`/llmops/v2/api/workspaces/${param0}/apps`, { + method: 'POST', + params: { ...queryParams }, + data: body, + ...(options || {}), + }); +} + +/** DeleteDatasetsJoinV2.1 删除 app 数据集关联 DELETE /llmops/v2/api/workspaces/${param1}/app/${param0}/datasets */ +export async function v2ApiWorkspacesWorkspaceIdAppAppIdDatasetsUsingDelete({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v2ApiWorkspacesWorkspaceIdAppAppIdDatasetsUsingDeleteParams; + options?: { [key: string]: unknown }; +}) { + const { appID: param0, workspaceID: param1, ...queryParams } = params; + + return request( + `/llmops/v2/api/workspaces/${param1}/app/${param0}/datasets`, + { + method: 'DELETE', + params: { + ...queryParams, + }, + ...(options || {}), + } + ); +} + +/** GetAppLogsV2.1 查询 app 日志与标注 GET /llmops/v2/api/workspaces/${param1}/app/${param0}/logs */ +export async function v2ApiWorkspacesWorkspaceIdAppAppIdLogsUsingGet({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v2ApiWorkspacesWorkspaceIdAppAppIdLogsUsingGetParams; + options?: { [key: string]: unknown }; +}) { + const { appID: param0, workspaceID: param1, ...queryParams } = params; + + return request( + `/llmops/v2/api/workspaces/${param1}/app/${param0}/logs`, + { + method: 'GET', + params: { + ...queryParams, + }, + ...(options || {}), + } + ); +} + +/** UpdateModelConfigsV2.1 更新 app model configs PUT /llmops/v2/api/workspaces/${param1}/app/${param0}/model-configs */ +export async function v2ApiWorkspacesWorkspaceIdAppAppIdModelConfigsUsingPut({ + params, + body, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v2ApiWorkspacesWorkspaceIdAppAppIdModelConfigsUsingPutParams; + body: API.AppModelConfigs; + options?: { [key: string]: unknown }; +}) { + const { appID: param0, workspaceID: param1, ...queryParams } = params; + + return request( + `/llmops/v2/api/workspaces/${param1}/app/${param0}/model-configs`, + { + method: 'PUT', + params: { ...queryParams }, + data: body, + ...(options || {}), + } + ); +} + +/** GetPluginListV2.1 获取插件列表 GET /llmops/v2/api/workspaces/${param1}/app/${param0}/plugin */ +export async function v2ApiWorkspacesWorkspaceIdAppAppIdPluginUsingGet({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v2ApiWorkspacesWorkspaceIdAppAppIdPluginUsingGetParams; + options?: { [key: string]: unknown }; +}) { + const { appID: param0, workspaceID: param1, ...queryParams } = params; + + return request( + `/llmops/v2/api/workspaces/${param1}/app/${param0}/plugin`, + { + method: 'GET', + params: { ...queryParams }, + ...(options || {}), + } + ); +} + +/** GetSumDailyTokenV2.1 每日token GET /llmops/v2/api/workspaces/${param1}/app/${param0}/token */ +export async function v2ApiWorkspacesWorkspaceIdAppAppIdTokenUsingGet({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v2ApiWorkspacesWorkspaceIdAppAppIdTokenUsingGetParams; + options?: { [key: string]: unknown }; +}) { + const { appID: param0, workspaceID: param1, ...queryParams } = params; + + return request( + `/llmops/v2/api/workspaces/${param1}/app/${param0}/token`, + { + method: 'GET', + params: { + ...queryParams, + }, + ...(options || {}), + } + ); +} + +/** DeleteAppV2.1 删除 app DELETE /llmops/v2/api/workspaces/${param1}/apps/${param0} */ +export async function v2ApiWorkspacesWorkspaceIdAppsAppIdUsingDelete({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v2ApiWorkspacesWorkspaceIdAppsAppIdUsingDeleteParams; + options?: { [key: string]: unknown }; +}) { + const { appID: param0, workspaceID: param1, ...queryParams } = params; + + return request( + `/llmops/v2/api/workspaces/${param1}/apps/${param0}`, + { + method: 'DELETE', + params: { ...queryParams }, + ...(options || {}), + } + ); +} + +/** UpdateAppImage 更新 app名称头像 POST /llmops/v2/api/workspaces/${param1}/apps/${param0}/base */ +export async function v2ApiWorkspacesWorkspaceIdAppsAppIdBaseUsingPost({ + params, + body, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v2ApiWorkspacesWorkspaceIdAppsAppIdBaseUsingPostParams; + body: API.UpdateAppReq; + options?: { [key: string]: unknown }; +}) { + const { appID: param0, workspaceID: param1, ...queryParams } = params; + + return request( + `/llmops/v2/api/workspaces/${param1}/apps/${param0}/base`, + { + method: 'POST', + params: { ...queryParams }, + data: body, + ...(options || {}), + } + ); +} + +/** UpdateAppGroup 更新 app 分组 POST /llmops/v2/api/workspaces/${param1}/apps/${param0}/group */ +export async function v2ApiWorkspacesWorkspaceIdAppsAppIdGroupUsingPost({ + params, + body, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v2ApiWorkspacesWorkspaceIdAppsAppIdGroupUsingPostParams; + body: API.UpdateAppGroup; + options?: { [key: string]: unknown }; +}) { + const { appID: param0, workspaceID: param1, ...queryParams } = params; + + return request( + `/llmops/v2/api/workspaces/${param1}/apps/${param0}/group`, + { + method: 'POST', + params: { ...queryParams }, + data: body, + ...(options || {}), + } + ); +} + +/** GetAppRecommendedContext 获取自定义推荐问题 & 推荐开关 GET /llmops/v2/api/workspaces/recommended/${param0}/details */ +export async function v2ApiWorkspacesRecommendedMessageIdDetailsUsingGet({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v2ApiWorkspacesRecommendedMessageIdDetailsUsingGetParams; + options?: { [key: string]: unknown }; +}) { + const { messageId: param0, ...queryParams } = params; + + return request( + `/llmops/v2/api/workspaces/recommended/${param0}/details`, + { + method: 'GET', + params: { ...queryParams }, + ...(options || {}), + } + ); +} +/* eslint-disable */ +// @ts-ignore +import { request } from 'axios'; + +import * as API from './types'; + +/** GetWorkspaceGroupList 空间分组列表 GET /llmops/v2/api/workspaces/${param0}/groups */ +export async function v2ApiWorkspacesWorkspaceIdGroupsUsingGet({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v2ApiWorkspacesWorkspaceIdGroupsUsingGetParams; + options?: { [key: string]: unknown }; +}) { + const { workspaceID: param0, ...queryParams } = params; + + return request( + `/llmops/v2/api/workspaces/${param0}/groups`, + { + method: 'GET', + params: { ...queryParams }, + ...(options || {}), + } + ); +} + +/** CreateWorkspaceGroup 创建空间分组 POST /llmops/v2/api/workspaces/${param0}/groups */ +export async function v2ApiWorkspacesWorkspaceIdGroupsUsingPost({ + params, + body, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v2ApiWorkspacesWorkspaceIdGroupsUsingPostParams; + body: API.WorkspaceGroupReq; + options?: { [key: string]: unknown }; +}) { + const { workspaceID: param0, ...queryParams } = params; + + return request( + `/llmops/v2/api/workspaces/${param0}/groups`, + { + method: 'POST', + params: { ...queryParams }, + data: body, + ...(options || {}), + } + ); +} + +/** UpdateWorkspaceGroup 更新分组 POST /llmops/v2/api/workspaces/${param0}/groups/${param1} */ +export async function v2ApiWorkspacesWorkspaceIdGroupsWorkspaceGroupIdUsingPost({ + params, + body, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v2ApiWorkspacesWorkspaceIdGroupsWorkspaceGroupIdUsingPostParams; + body: API.WorkspaceGroupReq; + options?: { [key: string]: unknown }; +}) { + const { + workspaceID: param0, + workspaceGroupID: param1, + ...queryParams + } = params; + + return request( + `/llmops/v2/api/workspaces/${param0}/groups/${param1}`, + { + method: 'POST', + params: { ...queryParams }, + data: body, + ...(options || {}), + } + ); +} + +/** DeleteWorkspaceGroup 删除分组 DELETE /llmops/v2/api/workspaces/${param0}/groups/${param1} */ +export async function v2ApiWorkspacesWorkspaceIdGroupsWorkspaceGroupIdUsingDelete({ + params, + options, +}: { + // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) + params: API.v2ApiWorkspacesWorkspaceIdGroupsWorkspaceGroupIdUsingDeleteParams; + options?: { [key: string]: unknown }; +}) { + const { + workspaceID: param0, + workspaceGroupID: param1, + ...queryParams + } = params; + + return request( + `/llmops/v2/api/workspaces/${param0}/groups/${param1}`, + { + method: 'DELETE', + params: { ...queryParams }, + ...(options || {}), + } + ); +} diff --git "a/test/__snapshots__/common/\350\207\252\345\256\232\344\271\211 hook.snap" "b/test/__snapshots__/common/\350\207\252\345\256\232\344\271\211 hook.snap" new file mode 100644 index 0000000..3ec1549 --- /dev/null +++ "b/test/__snapshots__/common/\350\207\252\345\256\232\344\271\211 hook.snap" @@ -0,0 +1,369 @@ +/* eslint-disable */ +// @ts-ignore +import request from '@/request'; + +import * as API from './types'; + +export async function checkImgCaptcha(data: API.CheckImgCaptchaReq) { + return request.post('/api/v1/captcha/img/check.json', data); +} + +export async function getImageCaptcha(data: API.ImgCaptchaReq) { + return request.post('/api/v1/captcha/img/get.json', data); +} +/* eslint-disable */ +// @ts-ignore +import request from '@/request'; + +import * as API from './types'; + +export async function accountLogin(data: API.AccountLoginReq) { + return request.post('/api/v1/user/account/login.json', data); +} + +export async function loginIsNeedCaptcha(data: API.LoginIsNeedCaptchaReq) { + return request.post('/api/v1/user/account/loginIsNeedCaptcha.json', data); +} + +export async function accountRegister(data: API.AccountRegisterReq) { + return request.post('/api/v1/user/account/register.json', data); +} + +export async function editPassword(data: API.EditPasswordReq) { + return request.post('/api/v1/user/edit/pwd.json', data); +} + +export async function forgotPassword(data: API.ApiReq) { + return request.post('/api/v1/user/forgot/pwd/sms.json', data); +} +/* eslint-disable */ +// @ts-ignore +import * as API from './types'; + +export function displayShowTypeEnum(field: API.ShowTypeEnum) { + return { + DIALOG: 'DIALOG', + ERROR: 'ERROR', + NOTIFICATION: 'NOTIFICATION', + PAGE: 'PAGE', + SLIENT: 'SLIENT', + SUCCESS: 'SUCCESS', + UNUSED_6: 'UNUSED_6', + UNUSED_7: 'UNUSED_7', + UNUSED_8: 'UNUSED_8', + WARN: 'WARN', + }[field]; +} + +export function displayShowTypeEnum2(field: API.ShowTypeEnum2) { + return { + DIALOG: 'DIALOG', + ERROR: 'ERROR', + NOTIFICATION: 'NOTIFICATION', + PAGE: 'PAGE', + SLIENT: 'SLIENT', + SUCCESS: 'SUCCESS', + UNUSED_6: 'UNUSED_6', + UNUSED_7: 'UNUSED_7', + UNUSED_8: 'UNUSED_8', + WARN: 'WARN', + }[field]; +} + +export function displayShowTypeEnum3(field: API.ShowTypeEnum3) { + return { + DIALOG: 'DIALOG', + ERROR: 'ERROR', + NOTIFICATION: 'NOTIFICATION', + PAGE: 'PAGE', + SLIENT: 'SLIENT', + SUCCESS: 'SUCCESS', + UNUSED_6: 'UNUSED_6', + UNUSED_7: 'UNUSED_7', + UNUSED_8: 'UNUSED_8', + WARN: 'WARN', + }[field]; +} + +export function displayShowTypeEnum4(field: API.ShowTypeEnum4) { + return { + DIALOG: 'DIALOG', + ERROR: 'ERROR', + NOTIFICATION: 'NOTIFICATION', + PAGE: 'PAGE', + SLIENT: 'SLIENT', + SUCCESS: 'SUCCESS', + UNUSED_6: 'UNUSED_6', + UNUSED_7: 'UNUSED_7', + UNUSED_8: 'UNUSED_8', + WARN: 'WARN', + }[field]; +} + +export function displayTypeEnum(field: API.TypeEnum) { + return { + EDIT_PASSWORD: 'EDIT_PASSWORD', + FORGOT_PASSWORD: 'FORGOT_PASSWORD', + LOGIN: 'LOGIN', + REGISTER: 'REGISTER', + }[field]; +} + +export function displayTypeEnum2(field: API.TypeEnum2) { + return { + EDIT_PASSWORD: 'EDIT_PASSWORD', + FORGOT_PASSWORD: 'FORGOT_PASSWORD', + LOGIN: 'LOGIN', + REGISTER: 'REGISTER', + }[field]; +} +/* eslint-disable */ +// @ts-ignore +export * from './types'; +export * from './displayEnumLabel'; + +export * from './Captcha'; +export * from './UserAccount'; +/* eslint-disable */ +// @ts-ignore + +export type AccountLoginReq = { + /** 验证码 */ + captcha?: string; + /** 验证码ID */ + captchaId?: number; + /** 验证令牌 */ + captchaToken?: string; + /** 密码(客户端使用 “墙]・▽・)ノ 嗨,美女+密码” 的MD5值提交,32位小写) */ + password: string; + /** 用户名 */ + username: string; +}; + +export type AccountRegisterReq = { + /** 验证码 */ + captcha?: string; + /** 验证码ID */ + captchaId: number; + /** 验证令牌 */ + captchaToken?: string; + /** 密码(输入的密码,需要检测密码是否合法) */ + password: string; + /** 用户名 */ + username: string; +}; + +export type ApiReq = object; + +export type ApiResboolean = { + /** 状态码;大于零为处理成功的不同状态,小于零的状态则视为失败的情况 */ + code: number; + /** 相应数据 */ + data?: boolean; + /** 提示消息 */ + msg: string; + /** 消息提示方式 */ + showType: + | 'DIALOG' + | 'ERROR' + | 'NOTIFICATION' + | 'PAGE' + | 'SLIENT' + | 'SUCCESS' + | 'UNUSED_6' + | 'UNUSED_7' + | 'UNUSED_8' + | 'WARN'; +}; + +export type ApiResCaptchaTokenVO = { + /** 状态码;大于零为处理成功的不同状态,小于零的状态则视为失败的情况 */ + code: number; + /** 相应数据 */ + data?: CaptchaTokenVO; + /** 提示消息 */ + msg: string; + /** 消息提示方式 */ + showType: + | 'DIALOG' + | 'ERROR' + | 'NOTIFICATION' + | 'PAGE' + | 'SLIENT' + | 'SUCCESS' + | 'UNUSED_6' + | 'UNUSED_7' + | 'UNUSED_8' + | 'WARN'; +}; + +export type ApiResImgCaptchaDTO = { + /** 状态码;大于零为处理成功的不同状态,小于零的状态则视为失败的情况 */ + code: number; + /** 相应数据 */ + data?: ImgCaptchaDTO; + /** 提示消息 */ + msg: string; + /** 消息提示方式 */ + showType: + | 'DIALOG' + | 'ERROR' + | 'NOTIFICATION' + | 'PAGE' + | 'SLIENT' + | 'SUCCESS' + | 'UNUSED_6' + | 'UNUSED_7' + | 'UNUSED_8' + | 'WARN'; +}; + +export type ApiResTokenDTO = { + /** 状态码;大于零为处理成功的不同状态,小于零的状态则视为失败的情况 */ + code: number; + /** 相应数据 */ + data?: TokenDTO; + /** 提示消息 */ + msg: string; + /** 消息提示方式 */ + showType: + | 'DIALOG' + | 'ERROR' + | 'NOTIFICATION' + | 'PAGE' + | 'SLIENT' + | 'SUCCESS' + | 'UNUSED_6' + | 'UNUSED_7' + | 'UNUSED_8' + | 'WARN'; +}; + +export type CaptchaTokenVO = { + /** 验证令牌 */ + token: string; +}; + +export type CheckImgCaptchaReq = { + /** 验证码 */ + captcha: string; + /** 验证码ID */ + id: number; + /** 验证码类型,1->注册,2->登录,3->忘记密码,4->修改密码 */ + type: 'EDIT_PASSWORD' | 'FORGOT_PASSWORD' | 'LOGIN' | 'REGISTER'; +}; + +export type EditPasswordReq = { + /** 新密码 */ + newPassword: string; + /** 当前的密码 */ + password: string; + /** 用户通行令牌 */ + token: string; + /** 用户ID */ + uid: number; +}; + +export type ImgCaptchaDTO = { + /** 验证码ID */ + id: number; + /** 图片验证码URL */ + url: string; +}; + +export type ImgCaptchaReq = { + /** 验证码类型 */ + type: 'EDIT_PASSWORD' | 'FORGOT_PASSWORD' | 'LOGIN' | 'REGISTER'; +}; + +export type LoginIsNeedCaptchaReq = { + /** 用户名 */ + username: string; +}; + +export enum ShowTypeEnum { + 'DIALOG' = 'DIALOG', + 'ERROR' = 'ERROR', + 'NOTIFICATION' = 'NOTIFICATION', + 'PAGE' = 'PAGE', + 'SLIENT' = 'SLIENT', + 'SUCCESS' = 'SUCCESS', + 'UNUSED_6' = 'UNUSED_6', + 'UNUSED_7' = 'UNUSED_7', + 'UNUSED_8' = 'UNUSED_8', + 'WARN' = 'WARN', +} + +export type IShowTypeEnum = keyof typeof ShowTypeEnum; + +export enum ShowTypeEnum2 { + 'DIALOG' = 'DIALOG', + 'ERROR' = 'ERROR', + 'NOTIFICATION' = 'NOTIFICATION', + 'PAGE' = 'PAGE', + 'SLIENT' = 'SLIENT', + 'SUCCESS' = 'SUCCESS', + 'UNUSED_6' = 'UNUSED_6', + 'UNUSED_7' = 'UNUSED_7', + 'UNUSED_8' = 'UNUSED_8', + 'WARN' = 'WARN', +} + +export type IShowTypeEnum2 = keyof typeof ShowTypeEnum2; + +export enum ShowTypeEnum3 { + 'DIALOG' = 'DIALOG', + 'ERROR' = 'ERROR', + 'NOTIFICATION' = 'NOTIFICATION', + 'PAGE' = 'PAGE', + 'SLIENT' = 'SLIENT', + 'SUCCESS' = 'SUCCESS', + 'UNUSED_6' = 'UNUSED_6', + 'UNUSED_7' = 'UNUSED_7', + 'UNUSED_8' = 'UNUSED_8', + 'WARN' = 'WARN', +} + +export type IShowTypeEnum3 = keyof typeof ShowTypeEnum3; + +export enum ShowTypeEnum4 { + 'DIALOG' = 'DIALOG', + 'ERROR' = 'ERROR', + 'NOTIFICATION' = 'NOTIFICATION', + 'PAGE' = 'PAGE', + 'SLIENT' = 'SLIENT', + 'SUCCESS' = 'SUCCESS', + 'UNUSED_6' = 'UNUSED_6', + 'UNUSED_7' = 'UNUSED_7', + 'UNUSED_8' = 'UNUSED_8', + 'WARN' = 'WARN', +} + +export type IShowTypeEnum4 = keyof typeof ShowTypeEnum4; + +export type TokenDTO = { + /** 通行令牌 */ + accessToken: string; + /** 刷新令牌 */ + refreshToken: string; + /** 用户ID */ + userId: number; +}; + +export enum TypeEnum { + 'EDIT_PASSWORD' = 'EDIT_PASSWORD', + 'FORGOT_PASSWORD' = 'FORGOT_PASSWORD', + 'LOGIN' = 'LOGIN', + 'REGISTER' = 'REGISTER', +} + +export type ITypeEnum = keyof typeof TypeEnum; + +export enum TypeEnum2 { + 'EDIT_PASSWORD' = 'EDIT_PASSWORD', + 'FORGOT_PASSWORD' = 'FORGOT_PASSWORD', + 'LOGIN' = 'LOGIN', + 'REGISTER' = 'REGISTER', +} + +export type ITypeEnum2 = keyof typeof TypeEnum2; diff --git a/test/__snapshots__/exclude/should empty excludeTags and excludePaths return all.snap b/test/__snapshots__/exclude/should empty excludeTags and excludePaths return all.snap new file mode 100644 index 0000000..c42915f --- /dev/null +++ b/test/__snapshots__/exclude/should empty excludeTags and excludePaths return all.snap @@ -0,0 +1,355 @@ +/* eslint-disable */ +// @ts-ignore +export * from './types'; + +export * from './userZ'; +export * from './userY'; +export * from './userX'; +export * from './sysC'; +export * from './sysB'; +export * from './sysA'; +/* eslint-disable */ +// @ts-ignore +import request from '../request'; + +import * as API from './types'; + +/** a1 GET /sys-a/a1 */ +export async function sysAa1UsingGet({ + options, +}: { + options?: { [key: string]: unknown }; +}) { + return request('/sys-a/a1', { + method: 'GET', + ...(options || {}), + }); +} + +/** a1/aa1 GET /sys-a/a1/aa1 */ +export async function sysAa1Aa1UsingGet({ + options, +}: { + options?: { [key: string]: unknown }; +}) { + return request('/sys-a/a1/aa1', { + method: 'GET', + ...(options || {}), + }); +} + +/** a1/a1/aa1 GET /sys-a/a1/aa1/aaa1 */ +export async function sysAa1Aa1Aaa1UsingGet({ + options, +}: { + options?: { [key: string]: unknown }; +}) { + return request('/sys-a/a1/aa1/aaa1', { + method: 'GET', + ...(options || {}), + }); +} + +/** a1/a1/aa1/aaa1 GET /sys-a/a1/aa1/aaa1/aaaa1 */ +export async function sysAa1Aa1Aaa1Aaaa1UsingGet({ + options, +}: { + options?: { [key: string]: unknown }; +}) { + return request('/sys-a/a1/aa1/aaa1/aaaa1', { + method: 'GET', + ...(options || {}), + }); +} +/* eslint-disable */ +// @ts-ignore +import request from '../request'; + +import * as API from './types'; + +/** b1 GET /sys-b/b1 */ +export async function sysBb1UsingGet({ + options, +}: { + options?: { [key: string]: unknown }; +}) { + return request('/sys-b/b1', { + method: 'GET', + ...(options || {}), + }); +} + +/** b1/bb1 GET /sys-b/b1/bb1 */ +export async function sysBb1Bb1UsingGet({ + options, +}: { + options?: { [key: string]: unknown }; +}) { + return request('/sys-b/b1/bb1', { + method: 'GET', + ...(options || {}), + }); +} + +/** b1/bb1/bbb1 GET /sys-b/b1/bb1/bbb1 */ +export async function sysBb1Bb1Bbb1UsingGet({ + options, +}: { + options?: { [key: string]: unknown }; +}) { + return request('/sys-b/b1/bb1/bbb1', { + method: 'GET', + ...(options || {}), + }); +} + +/** b1/bb1/bbb1/bbbb1 GET /sys-b/b1/bb1/bbb1/bbbb1 */ +export async function sysBb1Bb1Bbb1Bbbb1UsingGet({ + options, +}: { + options?: { [key: string]: unknown }; +}) { + return request('/sys-b/b1/bb1/bbb1/bbbb1', { + method: 'GET', + ...(options || {}), + }); +} +/* eslint-disable */ +// @ts-ignore +import request from '../request'; + +import * as API from './types'; + +/** c1 GET /sys-c/c1 */ +export async function sysCc1UsingGet({ + options, +}: { + options?: { [key: string]: unknown }; +}) { + return request('/sys-c/c1', { + method: 'GET', + ...(options || {}), + }); +} + +/** c1/cc1 GET /sys-c/c1/cc1 */ +export async function sysCc1Cc1UsingGet({ + options, +}: { + options?: { [key: string]: unknown }; +}) { + return request('/sys-c/c1/cc1', { + method: 'GET', + ...(options || {}), + }); +} + +/** c1/cc1/ccc1 GET /sys-c/c1/cc1/ccc1 */ +export async function sysCc1Cc1Ccc1UsingGet({ + options, +}: { + options?: { [key: string]: unknown }; +}) { + return request('/sys-c/c1/cc1/ccc1', { + method: 'GET', + ...(options || {}), + }); +} + +/** c1/cc1/ccc1/cccc1 GET /sys-c/c1/cc1/ccc1/cccc1 */ +export async function sysCc1Cc1Ccc1Cccc1UsingGet({ + options, +}: { + options?: { [key: string]: unknown }; +}) { + return request('/sys-c/c1/cc1/ccc1/cccc1', { + method: 'GET', + ...(options || {}), + }); +} +/* eslint-disable */ +// @ts-ignore +export {}; +/* eslint-disable */ +// @ts-ignore +import request from '../request'; + +import * as API from './types'; + +/** x1 GET /user-x/x1 */ +export async function userXx1UsingGet({ + options, +}: { + options?: { [key: string]: unknown }; +}) { + return request('/user-x/x1', { + method: 'GET', + ...(options || {}), + }); +} + +/** x1/xx1 GET /user-x/x1/xx1 */ +export async function userXx1Xx1UsingGet({ + options, +}: { + options?: { [key: string]: unknown }; +}) { + return request('/user-x/x1/xx1', { + method: 'GET', + ...(options || {}), + }); +} + +/** x1/xx1/xxx1 GET /user-x/x1/xx1/xxx1 */ +export async function userXx1Xx1Xxx1UsingGet({ + options, +}: { + options?: { [key: string]: unknown }; +}) { + return request('/user-x/x1/xx1/xxx1', { + method: 'GET', + ...(options || {}), + }); +} + +/** x1/xx1/xxx1/xxxx1 GET /user-x/x1/xx1/xxx1/xxxx1 */ +export async function userXx1Xx1Xxx1Xxxx1UsingGet({ + options, +}: { + options?: { [key: string]: unknown }; +}) { + return request('/user-x/x1/xx1/xxx1/xxxx1', { + method: 'GET', + ...(options || {}), + }); +} +/* eslint-disable */ +// @ts-ignore +import request from '../request'; + +import * as API from './types'; + +/** y1 GET /user-y/y1 */ +export async function userYy1UsingGet({ + options, +}: { + options?: { [key: string]: unknown }; +}) { + return request('/user-y/y1', { + method: 'GET', + ...(options || {}), + }); +} + +/** y1/yy1 GET /user-y/y1/yy1 */ +export async function userYy1Yy1UsingGet({ + options, +}: { + options?: { [key: string]: unknown }; +}) { + return request('/user-y/y1/yy1', { + method: 'GET', + ...(options || {}), + }); +} + +/** y1/yy1/yyy1 GET /user-y/y1/yy1/yyy1 */ +export async function userYy1Yy1Yyy1UsingGet({ + options, +}: { + options?: { [key: string]: unknown }; +}) { + return request('/user-y/y1/yy1/yyy1', { + method: 'GET', + ...(options || {}), + }); +} + +/** y1/yy1/yyy1/yyyy1 GET /user-y/y1/yy1/yyy1/yyyy1 */ +export async function userYy1Yy1Yyy1Yyyy1UsingGet({ + options, +}: { + options?: { [key: string]: unknown }; +}) { + return request('/user-y/y1/yy1/yyy1/yyyy1', { + method: 'GET', + ...(options || {}), + }); +} + +/** y1/yy1/yyy1/yyyy1/yyyyy1 GET /user-y/y1/yy1/yyy1/yyyy1/yyyyy1 */ +export async function userYy1Yy1Yyy1Yyyy1Yyyyy1UsingGet({ + options, +}: { + options?: { [key: string]: unknown }; +}) { + return request('/user-y/y1/yy1/yyy1/yyyy1/yyyyy1', { + method: 'GET', + ...(options || {}), + }); +} +/* eslint-disable */ +// @ts-ignore +import request from '../request'; + +import * as API from './types'; + +/** f1 ffff GET /user-z/z1 */ +export async function userZz1UsingGet({ + options, +}: { + options?: { [key: string]: unknown }; +}) { + return request('/user-z/z1', { + method: 'GET', + ...(options || {}), + }); +} + +/** z1/zz1 GET /user-z/z1/zz1 */ +export async function userZz1Zz1UsingGet({ + options, +}: { + options?: { [key: string]: unknown }; +}) { + return request('/user-z/z1/zz1', { + method: 'GET', + ...(options || {}), + }); +} + +/** z1/zz1/zzz1 GET /user-z/z1/zz1/zzz1 */ +export async function userZz1Zz1Zzz1UsingGet({ + options, +}: { + options?: { [key: string]: unknown }; +}) { + return request('/user-z/z1/zz1/zzz1', { + method: 'GET', + ...(options || {}), + }); +} + +/** z1/zz1/zzz1/zzzz1 GET /user-z/z1/zz1/zzz1/zzzz1 */ +export async function userZz1Zz1Zzz1Zzzz1UsingGet({ + options, +}: { + options?: { [key: string]: unknown }; +}) { + return request('/user-z/z1/zz1/zzz1/zzzz1', { + method: 'GET', + ...(options || {}), + }); +} + +/** z1/zz1/zzz1/zzzz1/zzzzz1 GET /user-z/z1/zz1/zzz1/zzzz1/zzzzz1 */ +export async function userZz1Zz1Zzz1Zzzz1Zzzzz1UsingGet({ + options, +}: { + options?: { [key: string]: unknown }; +}) { + return request('/user-z/z1/zz1/zzz1/zzzz1/zzzzz1', { + method: 'GET', + ...(options || {}), + }); +} diff --git a/test/__snapshots__/exclude/should excludeTags and excludePaths both set works.snap b/test/__snapshots__/exclude/should excludeTags and excludePaths both set works.snap new file mode 100644 index 0000000..4657639 --- /dev/null +++ b/test/__snapshots__/exclude/should excludeTags and excludePaths both set works.snap @@ -0,0 +1,115 @@ +/* eslint-disable */ +// @ts-ignore +export * from './types'; + +export * from './userX'; +export * from './sysC'; +/* eslint-disable */ +// @ts-ignore +import request from '../request'; + +import * as API from './types'; + +/** c1 GET /sys-c/c1 */ +export async function sysCc1UsingGet({ + options, +}: { + options?: { [key: string]: unknown }; +}) { + return request('/sys-c/c1', { + method: 'GET', + ...(options || {}), + }); +} + +/** c1/cc1 GET /sys-c/c1/cc1 */ +export async function sysCc1Cc1UsingGet({ + options, +}: { + options?: { [key: string]: unknown }; +}) { + return request('/sys-c/c1/cc1', { + method: 'GET', + ...(options || {}), + }); +} + +/** c1/cc1/ccc1 GET /sys-c/c1/cc1/ccc1 */ +export async function sysCc1Cc1Ccc1UsingGet({ + options, +}: { + options?: { [key: string]: unknown }; +}) { + return request('/sys-c/c1/cc1/ccc1', { + method: 'GET', + ...(options || {}), + }); +} + +/** c1/cc1/ccc1/cccc1 GET /sys-c/c1/cc1/ccc1/cccc1 */ +export async function sysCc1Cc1Ccc1Cccc1UsingGet({ + options, +}: { + options?: { [key: string]: unknown }; +}) { + return request('/sys-c/c1/cc1/ccc1/cccc1', { + method: 'GET', + ...(options || {}), + }); +} +/* eslint-disable */ +// @ts-ignore +export {}; +/* eslint-disable */ +// @ts-ignore +import request from '../request'; + +import * as API from './types'; + +/** x1 GET /user-x/x1 */ +export async function userXx1UsingGet({ + options, +}: { + options?: { [key: string]: unknown }; +}) { + return request('/user-x/x1', { + method: 'GET', + ...(options || {}), + }); +} + +/** x1/xx1 GET /user-x/x1/xx1 */ +export async function userXx1Xx1UsingGet({ + options, +}: { + options?: { [key: string]: unknown }; +}) { + return request('/user-x/x1/xx1', { + method: 'GET', + ...(options || {}), + }); +} + +/** x1/xx1/xxx1 GET /user-x/x1/xx1/xxx1 */ +export async function userXx1Xx1Xxx1UsingGet({ + options, +}: { + options?: { [key: string]: unknown }; +}) { + return request('/user-x/x1/xx1/xxx1', { + method: 'GET', + ...(options || {}), + }); +} + +/** x1/xx1/xxx1/xxxx1 GET /user-x/x1/xx1/xxx1/xxxx1 */ +export async function userXx1Xx1Xxx1Xxxx1UsingGet({ + options, +}: { + options?: { [key: string]: unknown }; +}) { + return request('/user-x/x1/xx1/xxx1/xxxx1', { + method: 'GET', + ...(options || {}), + }); +} diff --git a/test/__snapshots__/exclude/should excludeTags set works to exclude all.snap b/test/__snapshots__/exclude/should excludeTags set works to exclude all.snap new file mode 100644 index 0000000..1924b51 --- /dev/null +++ b/test/__snapshots__/exclude/should excludeTags set works to exclude all.snap @@ -0,0 +1,6 @@ +/* eslint-disable */ +// @ts-ignore +export * from './types'; +/* eslint-disable */ +// @ts-ignore +export {}; diff --git a/test/__snapshots__/exclude/should only excludePaths set works.snap b/test/__snapshots__/exclude/should only excludePaths set works.snap new file mode 100644 index 0000000..32cd9f3 --- /dev/null +++ b/test/__snapshots__/exclude/should only excludePaths set works.snap @@ -0,0 +1,235 @@ +/* eslint-disable */ +// @ts-ignore +export * from './types'; + +export * from './userY'; +export * from './userX'; +export * from './sysC'; +export * from './sysB'; +/* eslint-disable */ +// @ts-ignore +import request from '../request'; + +import * as API from './types'; + +/** b1 GET /sys-b/b1 */ +export async function sysBb1UsingGet({ + options, +}: { + options?: { [key: string]: unknown }; +}) { + return request('/sys-b/b1', { + method: 'GET', + ...(options || {}), + }); +} + +/** b1/bb1 GET /sys-b/b1/bb1 */ +export async function sysBb1Bb1UsingGet({ + options, +}: { + options?: { [key: string]: unknown }; +}) { + return request('/sys-b/b1/bb1', { + method: 'GET', + ...(options || {}), + }); +} + +/** b1/bb1/bbb1 GET /sys-b/b1/bb1/bbb1 */ +export async function sysBb1Bb1Bbb1UsingGet({ + options, +}: { + options?: { [key: string]: unknown }; +}) { + return request('/sys-b/b1/bb1/bbb1', { + method: 'GET', + ...(options || {}), + }); +} + +/** b1/bb1/bbb1/bbbb1 GET /sys-b/b1/bb1/bbb1/bbbb1 */ +export async function sysBb1Bb1Bbb1Bbbb1UsingGet({ + options, +}: { + options?: { [key: string]: unknown }; +}) { + return request('/sys-b/b1/bb1/bbb1/bbbb1', { + method: 'GET', + ...(options || {}), + }); +} +/* eslint-disable */ +// @ts-ignore +import request from '../request'; + +import * as API from './types'; + +/** c1 GET /sys-c/c1 */ +export async function sysCc1UsingGet({ + options, +}: { + options?: { [key: string]: unknown }; +}) { + return request('/sys-c/c1', { + method: 'GET', + ...(options || {}), + }); +} + +/** c1/cc1 GET /sys-c/c1/cc1 */ +export async function sysCc1Cc1UsingGet({ + options, +}: { + options?: { [key: string]: unknown }; +}) { + return request('/sys-c/c1/cc1', { + method: 'GET', + ...(options || {}), + }); +} + +/** c1/cc1/ccc1 GET /sys-c/c1/cc1/ccc1 */ +export async function sysCc1Cc1Ccc1UsingGet({ + options, +}: { + options?: { [key: string]: unknown }; +}) { + return request('/sys-c/c1/cc1/ccc1', { + method: 'GET', + ...(options || {}), + }); +} + +/** c1/cc1/ccc1/cccc1 GET /sys-c/c1/cc1/ccc1/cccc1 */ +export async function sysCc1Cc1Ccc1Cccc1UsingGet({ + options, +}: { + options?: { [key: string]: unknown }; +}) { + return request('/sys-c/c1/cc1/ccc1/cccc1', { + method: 'GET', + ...(options || {}), + }); +} +/* eslint-disable */ +// @ts-ignore +export {}; +/* eslint-disable */ +// @ts-ignore +import request from '../request'; + +import * as API from './types'; + +/** x1 GET /user-x/x1 */ +export async function userXx1UsingGet({ + options, +}: { + options?: { [key: string]: unknown }; +}) { + return request('/user-x/x1', { + method: 'GET', + ...(options || {}), + }); +} + +/** x1/xx1 GET /user-x/x1/xx1 */ +export async function userXx1Xx1UsingGet({ + options, +}: { + options?: { [key: string]: unknown }; +}) { + return request('/user-x/x1/xx1', { + method: 'GET', + ...(options || {}), + }); +} + +/** x1/xx1/xxx1 GET /user-x/x1/xx1/xxx1 */ +export async function userXx1Xx1Xxx1UsingGet({ + options, +}: { + options?: { [key: string]: unknown }; +}) { + return request('/user-x/x1/xx1/xxx1', { + method: 'GET', + ...(options || {}), + }); +} + +/** x1/xx1/xxx1/xxxx1 GET /user-x/x1/xx1/xxx1/xxxx1 */ +export async function userXx1Xx1Xxx1Xxxx1UsingGet({ + options, +}: { + options?: { [key: string]: unknown }; +}) { + return request('/user-x/x1/xx1/xxx1/xxxx1', { + method: 'GET', + ...(options || {}), + }); +} +/* eslint-disable */ +// @ts-ignore +import request from '../request'; + +import * as API from './types'; + +/** y1 GET /user-y/y1 */ +export async function userYy1UsingGet({ + options, +}: { + options?: { [key: string]: unknown }; +}) { + return request('/user-y/y1', { + method: 'GET', + ...(options || {}), + }); +} + +/** y1/yy1 GET /user-y/y1/yy1 */ +export async function userYy1Yy1UsingGet({ + options, +}: { + options?: { [key: string]: unknown }; +}) { + return request('/user-y/y1/yy1', { + method: 'GET', + ...(options || {}), + }); +} + +/** y1/yy1/yyy1 GET /user-y/y1/yy1/yyy1 */ +export async function userYy1Yy1Yyy1UsingGet({ + options, +}: { + options?: { [key: string]: unknown }; +}) { + return request('/user-y/y1/yy1/yyy1', { + method: 'GET', + ...(options || {}), + }); +} + +/** y1/yy1/yyy1/yyyy1 GET /user-y/y1/yy1/yyy1/yyyy1 */ +export async function userYy1Yy1Yyy1Yyyy1UsingGet({ + options, +}: { + options?: { [key: string]: unknown }; +}) { + return request('/user-y/y1/yy1/yyy1/yyyy1', { + method: 'GET', + ...(options || {}), + }); +} + +/** y1/yy1/yyy1/yyyy1/yyyyy1 GET /user-y/y1/yy1/yyy1/yyyy1/yyyyy1 */ +export async function userYy1Yy1Yyy1Yyyy1Yyyyy1UsingGet({ + options, +}: { + options?: { [key: string]: unknown }; +}) { + return request('/user-y/y1/yy1/yyy1/yyyy1/yyyyy1', { + method: 'GET', + ...(options || {}), + }); +} diff --git a/test/__snapshots__/exclude/should only excludeTags set works.snap b/test/__snapshots__/exclude/should only excludeTags set works.snap new file mode 100644 index 0000000..32cd9f3 --- /dev/null +++ b/test/__snapshots__/exclude/should only excludeTags set works.snap @@ -0,0 +1,235 @@ +/* eslint-disable */ +// @ts-ignore +export * from './types'; + +export * from './userY'; +export * from './userX'; +export * from './sysC'; +export * from './sysB'; +/* eslint-disable */ +// @ts-ignore +import request from '../request'; + +import * as API from './types'; + +/** b1 GET /sys-b/b1 */ +export async function sysBb1UsingGet({ + options, +}: { + options?: { [key: string]: unknown }; +}) { + return request('/sys-b/b1', { + method: 'GET', + ...(options || {}), + }); +} + +/** b1/bb1 GET /sys-b/b1/bb1 */ +export async function sysBb1Bb1UsingGet({ + options, +}: { + options?: { [key: string]: unknown }; +}) { + return request('/sys-b/b1/bb1', { + method: 'GET', + ...(options || {}), + }); +} + +/** b1/bb1/bbb1 GET /sys-b/b1/bb1/bbb1 */ +export async function sysBb1Bb1Bbb1UsingGet({ + options, +}: { + options?: { [key: string]: unknown }; +}) { + return request('/sys-b/b1/bb1/bbb1', { + method: 'GET', + ...(options || {}), + }); +} + +/** b1/bb1/bbb1/bbbb1 GET /sys-b/b1/bb1/bbb1/bbbb1 */ +export async function sysBb1Bb1Bbb1Bbbb1UsingGet({ + options, +}: { + options?: { [key: string]: unknown }; +}) { + return request('/sys-b/b1/bb1/bbb1/bbbb1', { + method: 'GET', + ...(options || {}), + }); +} +/* eslint-disable */ +// @ts-ignore +import request from '../request'; + +import * as API from './types'; + +/** c1 GET /sys-c/c1 */ +export async function sysCc1UsingGet({ + options, +}: { + options?: { [key: string]: unknown }; +}) { + return request('/sys-c/c1', { + method: 'GET', + ...(options || {}), + }); +} + +/** c1/cc1 GET /sys-c/c1/cc1 */ +export async function sysCc1Cc1UsingGet({ + options, +}: { + options?: { [key: string]: unknown }; +}) { + return request('/sys-c/c1/cc1', { + method: 'GET', + ...(options || {}), + }); +} + +/** c1/cc1/ccc1 GET /sys-c/c1/cc1/ccc1 */ +export async function sysCc1Cc1Ccc1UsingGet({ + options, +}: { + options?: { [key: string]: unknown }; +}) { + return request('/sys-c/c1/cc1/ccc1', { + method: 'GET', + ...(options || {}), + }); +} + +/** c1/cc1/ccc1/cccc1 GET /sys-c/c1/cc1/ccc1/cccc1 */ +export async function sysCc1Cc1Ccc1Cccc1UsingGet({ + options, +}: { + options?: { [key: string]: unknown }; +}) { + return request('/sys-c/c1/cc1/ccc1/cccc1', { + method: 'GET', + ...(options || {}), + }); +} +/* eslint-disable */ +// @ts-ignore +export {}; +/* eslint-disable */ +// @ts-ignore +import request from '../request'; + +import * as API from './types'; + +/** x1 GET /user-x/x1 */ +export async function userXx1UsingGet({ + options, +}: { + options?: { [key: string]: unknown }; +}) { + return request('/user-x/x1', { + method: 'GET', + ...(options || {}), + }); +} + +/** x1/xx1 GET /user-x/x1/xx1 */ +export async function userXx1Xx1UsingGet({ + options, +}: { + options?: { [key: string]: unknown }; +}) { + return request('/user-x/x1/xx1', { + method: 'GET', + ...(options || {}), + }); +} + +/** x1/xx1/xxx1 GET /user-x/x1/xx1/xxx1 */ +export async function userXx1Xx1Xxx1UsingGet({ + options, +}: { + options?: { [key: string]: unknown }; +}) { + return request('/user-x/x1/xx1/xxx1', { + method: 'GET', + ...(options || {}), + }); +} + +/** x1/xx1/xxx1/xxxx1 GET /user-x/x1/xx1/xxx1/xxxx1 */ +export async function userXx1Xx1Xxx1Xxxx1UsingGet({ + options, +}: { + options?: { [key: string]: unknown }; +}) { + return request('/user-x/x1/xx1/xxx1/xxxx1', { + method: 'GET', + ...(options || {}), + }); +} +/* eslint-disable */ +// @ts-ignore +import request from '../request'; + +import * as API from './types'; + +/** y1 GET /user-y/y1 */ +export async function userYy1UsingGet({ + options, +}: { + options?: { [key: string]: unknown }; +}) { + return request('/user-y/y1', { + method: 'GET', + ...(options || {}), + }); +} + +/** y1/yy1 GET /user-y/y1/yy1 */ +export async function userYy1Yy1UsingGet({ + options, +}: { + options?: { [key: string]: unknown }; +}) { + return request('/user-y/y1/yy1', { + method: 'GET', + ...(options || {}), + }); +} + +/** y1/yy1/yyy1 GET /user-y/y1/yy1/yyy1 */ +export async function userYy1Yy1Yyy1UsingGet({ + options, +}: { + options?: { [key: string]: unknown }; +}) { + return request('/user-y/y1/yy1/yyy1', { + method: 'GET', + ...(options || {}), + }); +} + +/** y1/yy1/yyy1/yyyy1 GET /user-y/y1/yy1/yyy1/yyyy1 */ +export async function userYy1Yy1Yyy1Yyyy1UsingGet({ + options, +}: { + options?: { [key: string]: unknown }; +}) { + return request('/user-y/y1/yy1/yyy1/yyyy1', { + method: 'GET', + ...(options || {}), + }); +} + +/** y1/yy1/yyy1/yyyy1/yyyyy1 GET /user-y/y1/yy1/yyy1/yyyy1/yyyyy1 */ +export async function userYy1Yy1Yyy1Yyyy1Yyyyy1UsingGet({ + options, +}: { + options?: { [key: string]: unknown }; +}) { + return request('/user-y/y1/yy1/yyy1/yyyy1/yyyyy1', { + method: 'GET', + ...(options || {}), + }); +} diff --git a/test/__snapshots__/include/should excludePaths and excludePaths both specified.snap b/test/__snapshots__/include/should excludePaths and excludePaths both specified.snap new file mode 100644 index 0000000..3a1532a --- /dev/null +++ b/test/__snapshots__/include/should excludePaths and excludePaths both specified.snap @@ -0,0 +1,37 @@ +/* eslint-disable */ +// @ts-ignore +export * from './types'; + +export * from './sysA'; +/* eslint-disable */ +// @ts-ignore +import request from '../request'; + +import * as API from './types'; + +/** a1/a1/aa1 GET /sys-a/a1/aa1/aaa1 */ +export async function sysAa1Aa1Aaa1UsingGet({ + options, +}: { + options?: { [key: string]: unknown }; +}) { + return request('/sys-a/a1/aa1/aaa1', { + method: 'GET', + ...(options || {}), + }); +} + +/** a1/a1/aa1/aaa1 GET /sys-a/a1/aa1/aaa1/aaaa1 */ +export async function sysAa1Aa1Aaa1Aaaa1UsingGet({ + options, +}: { + options?: { [key: string]: unknown }; +}) { + return request('/sys-a/a1/aa1/aaa1/aaaa1', { + method: 'GET', + ...(options || {}), + }); +} +/* eslint-disable */ +// @ts-ignore +export {}; diff --git a/test/__snapshots__/include/should include all tags.snap b/test/__snapshots__/include/should include all tags.snap new file mode 100644 index 0000000..c42915f --- /dev/null +++ b/test/__snapshots__/include/should include all tags.snap @@ -0,0 +1,355 @@ +/* eslint-disable */ +// @ts-ignore +export * from './types'; + +export * from './userZ'; +export * from './userY'; +export * from './userX'; +export * from './sysC'; +export * from './sysB'; +export * from './sysA'; +/* eslint-disable */ +// @ts-ignore +import request from '../request'; + +import * as API from './types'; + +/** a1 GET /sys-a/a1 */ +export async function sysAa1UsingGet({ + options, +}: { + options?: { [key: string]: unknown }; +}) { + return request('/sys-a/a1', { + method: 'GET', + ...(options || {}), + }); +} + +/** a1/aa1 GET /sys-a/a1/aa1 */ +export async function sysAa1Aa1UsingGet({ + options, +}: { + options?: { [key: string]: unknown }; +}) { + return request('/sys-a/a1/aa1', { + method: 'GET', + ...(options || {}), + }); +} + +/** a1/a1/aa1 GET /sys-a/a1/aa1/aaa1 */ +export async function sysAa1Aa1Aaa1UsingGet({ + options, +}: { + options?: { [key: string]: unknown }; +}) { + return request('/sys-a/a1/aa1/aaa1', { + method: 'GET', + ...(options || {}), + }); +} + +/** a1/a1/aa1/aaa1 GET /sys-a/a1/aa1/aaa1/aaaa1 */ +export async function sysAa1Aa1Aaa1Aaaa1UsingGet({ + options, +}: { + options?: { [key: string]: unknown }; +}) { + return request('/sys-a/a1/aa1/aaa1/aaaa1', { + method: 'GET', + ...(options || {}), + }); +} +/* eslint-disable */ +// @ts-ignore +import request from '../request'; + +import * as API from './types'; + +/** b1 GET /sys-b/b1 */ +export async function sysBb1UsingGet({ + options, +}: { + options?: { [key: string]: unknown }; +}) { + return request('/sys-b/b1', { + method: 'GET', + ...(options || {}), + }); +} + +/** b1/bb1 GET /sys-b/b1/bb1 */ +export async function sysBb1Bb1UsingGet({ + options, +}: { + options?: { [key: string]: unknown }; +}) { + return request('/sys-b/b1/bb1', { + method: 'GET', + ...(options || {}), + }); +} + +/** b1/bb1/bbb1 GET /sys-b/b1/bb1/bbb1 */ +export async function sysBb1Bb1Bbb1UsingGet({ + options, +}: { + options?: { [key: string]: unknown }; +}) { + return request('/sys-b/b1/bb1/bbb1', { + method: 'GET', + ...(options || {}), + }); +} + +/** b1/bb1/bbb1/bbbb1 GET /sys-b/b1/bb1/bbb1/bbbb1 */ +export async function sysBb1Bb1Bbb1Bbbb1UsingGet({ + options, +}: { + options?: { [key: string]: unknown }; +}) { + return request('/sys-b/b1/bb1/bbb1/bbbb1', { + method: 'GET', + ...(options || {}), + }); +} +/* eslint-disable */ +// @ts-ignore +import request from '../request'; + +import * as API from './types'; + +/** c1 GET /sys-c/c1 */ +export async function sysCc1UsingGet({ + options, +}: { + options?: { [key: string]: unknown }; +}) { + return request('/sys-c/c1', { + method: 'GET', + ...(options || {}), + }); +} + +/** c1/cc1 GET /sys-c/c1/cc1 */ +export async function sysCc1Cc1UsingGet({ + options, +}: { + options?: { [key: string]: unknown }; +}) { + return request('/sys-c/c1/cc1', { + method: 'GET', + ...(options || {}), + }); +} + +/** c1/cc1/ccc1 GET /sys-c/c1/cc1/ccc1 */ +export async function sysCc1Cc1Ccc1UsingGet({ + options, +}: { + options?: { [key: string]: unknown }; +}) { + return request('/sys-c/c1/cc1/ccc1', { + method: 'GET', + ...(options || {}), + }); +} + +/** c1/cc1/ccc1/cccc1 GET /sys-c/c1/cc1/ccc1/cccc1 */ +export async function sysCc1Cc1Ccc1Cccc1UsingGet({ + options, +}: { + options?: { [key: string]: unknown }; +}) { + return request('/sys-c/c1/cc1/ccc1/cccc1', { + method: 'GET', + ...(options || {}), + }); +} +/* eslint-disable */ +// @ts-ignore +export {}; +/* eslint-disable */ +// @ts-ignore +import request from '../request'; + +import * as API from './types'; + +/** x1 GET /user-x/x1 */ +export async function userXx1UsingGet({ + options, +}: { + options?: { [key: string]: unknown }; +}) { + return request('/user-x/x1', { + method: 'GET', + ...(options || {}), + }); +} + +/** x1/xx1 GET /user-x/x1/xx1 */ +export async function userXx1Xx1UsingGet({ + options, +}: { + options?: { [key: string]: unknown }; +}) { + return request('/user-x/x1/xx1', { + method: 'GET', + ...(options || {}), + }); +} + +/** x1/xx1/xxx1 GET /user-x/x1/xx1/xxx1 */ +export async function userXx1Xx1Xxx1UsingGet({ + options, +}: { + options?: { [key: string]: unknown }; +}) { + return request('/user-x/x1/xx1/xxx1', { + method: 'GET', + ...(options || {}), + }); +} + +/** x1/xx1/xxx1/xxxx1 GET /user-x/x1/xx1/xxx1/xxxx1 */ +export async function userXx1Xx1Xxx1Xxxx1UsingGet({ + options, +}: { + options?: { [key: string]: unknown }; +}) { + return request('/user-x/x1/xx1/xxx1/xxxx1', { + method: 'GET', + ...(options || {}), + }); +} +/* eslint-disable */ +// @ts-ignore +import request from '../request'; + +import * as API from './types'; + +/** y1 GET /user-y/y1 */ +export async function userYy1UsingGet({ + options, +}: { + options?: { [key: string]: unknown }; +}) { + return request('/user-y/y1', { + method: 'GET', + ...(options || {}), + }); +} + +/** y1/yy1 GET /user-y/y1/yy1 */ +export async function userYy1Yy1UsingGet({ + options, +}: { + options?: { [key: string]: unknown }; +}) { + return request('/user-y/y1/yy1', { + method: 'GET', + ...(options || {}), + }); +} + +/** y1/yy1/yyy1 GET /user-y/y1/yy1/yyy1 */ +export async function userYy1Yy1Yyy1UsingGet({ + options, +}: { + options?: { [key: string]: unknown }; +}) { + return request('/user-y/y1/yy1/yyy1', { + method: 'GET', + ...(options || {}), + }); +} + +/** y1/yy1/yyy1/yyyy1 GET /user-y/y1/yy1/yyy1/yyyy1 */ +export async function userYy1Yy1Yyy1Yyyy1UsingGet({ + options, +}: { + options?: { [key: string]: unknown }; +}) { + return request('/user-y/y1/yy1/yyy1/yyyy1', { + method: 'GET', + ...(options || {}), + }); +} + +/** y1/yy1/yyy1/yyyy1/yyyyy1 GET /user-y/y1/yy1/yyy1/yyyy1/yyyyy1 */ +export async function userYy1Yy1Yyy1Yyyy1Yyyyy1UsingGet({ + options, +}: { + options?: { [key: string]: unknown }; +}) { + return request('/user-y/y1/yy1/yyy1/yyyy1/yyyyy1', { + method: 'GET', + ...(options || {}), + }); +} +/* eslint-disable */ +// @ts-ignore +import request from '../request'; + +import * as API from './types'; + +/** f1 ffff GET /user-z/z1 */ +export async function userZz1UsingGet({ + options, +}: { + options?: { [key: string]: unknown }; +}) { + return request('/user-z/z1', { + method: 'GET', + ...(options || {}), + }); +} + +/** z1/zz1 GET /user-z/z1/zz1 */ +export async function userZz1Zz1UsingGet({ + options, +}: { + options?: { [key: string]: unknown }; +}) { + return request('/user-z/z1/zz1', { + method: 'GET', + ...(options || {}), + }); +} + +/** z1/zz1/zzz1 GET /user-z/z1/zz1/zzz1 */ +export async function userZz1Zz1Zzz1UsingGet({ + options, +}: { + options?: { [key: string]: unknown }; +}) { + return request('/user-z/z1/zz1/zzz1', { + method: 'GET', + ...(options || {}), + }); +} + +/** z1/zz1/zzz1/zzzz1 GET /user-z/z1/zz1/zzz1/zzzz1 */ +export async function userZz1Zz1Zzz1Zzzz1UsingGet({ + options, +}: { + options?: { [key: string]: unknown }; +}) { + return request('/user-z/z1/zz1/zzz1/zzzz1', { + method: 'GET', + ...(options || {}), + }); +} + +/** z1/zz1/zzz1/zzzz1/zzzzz1 GET /user-z/z1/zz1/zzz1/zzzz1/zzzzz1 */ +export async function userZz1Zz1Zzz1Zzzz1Zzzzz1UsingGet({ + options, +}: { + options?: { [key: string]: unknown }; +}) { + return request('/user-z/z1/zz1/zzz1/zzzz1/zzzzz1', { + method: 'GET', + ...(options || {}), + }); +} diff --git a/test/__snapshots__/include/should include all while no include and exclude set.snap b/test/__snapshots__/include/should include all while no include and exclude set.snap new file mode 100644 index 0000000..c42915f --- /dev/null +++ b/test/__snapshots__/include/should include all while no include and exclude set.snap @@ -0,0 +1,355 @@ +/* eslint-disable */ +// @ts-ignore +export * from './types'; + +export * from './userZ'; +export * from './userY'; +export * from './userX'; +export * from './sysC'; +export * from './sysB'; +export * from './sysA'; +/* eslint-disable */ +// @ts-ignore +import request from '../request'; + +import * as API from './types'; + +/** a1 GET /sys-a/a1 */ +export async function sysAa1UsingGet({ + options, +}: { + options?: { [key: string]: unknown }; +}) { + return request('/sys-a/a1', { + method: 'GET', + ...(options || {}), + }); +} + +/** a1/aa1 GET /sys-a/a1/aa1 */ +export async function sysAa1Aa1UsingGet({ + options, +}: { + options?: { [key: string]: unknown }; +}) { + return request('/sys-a/a1/aa1', { + method: 'GET', + ...(options || {}), + }); +} + +/** a1/a1/aa1 GET /sys-a/a1/aa1/aaa1 */ +export async function sysAa1Aa1Aaa1UsingGet({ + options, +}: { + options?: { [key: string]: unknown }; +}) { + return request('/sys-a/a1/aa1/aaa1', { + method: 'GET', + ...(options || {}), + }); +} + +/** a1/a1/aa1/aaa1 GET /sys-a/a1/aa1/aaa1/aaaa1 */ +export async function sysAa1Aa1Aaa1Aaaa1UsingGet({ + options, +}: { + options?: { [key: string]: unknown }; +}) { + return request('/sys-a/a1/aa1/aaa1/aaaa1', { + method: 'GET', + ...(options || {}), + }); +} +/* eslint-disable */ +// @ts-ignore +import request from '../request'; + +import * as API from './types'; + +/** b1 GET /sys-b/b1 */ +export async function sysBb1UsingGet({ + options, +}: { + options?: { [key: string]: unknown }; +}) { + return request('/sys-b/b1', { + method: 'GET', + ...(options || {}), + }); +} + +/** b1/bb1 GET /sys-b/b1/bb1 */ +export async function sysBb1Bb1UsingGet({ + options, +}: { + options?: { [key: string]: unknown }; +}) { + return request('/sys-b/b1/bb1', { + method: 'GET', + ...(options || {}), + }); +} + +/** b1/bb1/bbb1 GET /sys-b/b1/bb1/bbb1 */ +export async function sysBb1Bb1Bbb1UsingGet({ + options, +}: { + options?: { [key: string]: unknown }; +}) { + return request('/sys-b/b1/bb1/bbb1', { + method: 'GET', + ...(options || {}), + }); +} + +/** b1/bb1/bbb1/bbbb1 GET /sys-b/b1/bb1/bbb1/bbbb1 */ +export async function sysBb1Bb1Bbb1Bbbb1UsingGet({ + options, +}: { + options?: { [key: string]: unknown }; +}) { + return request('/sys-b/b1/bb1/bbb1/bbbb1', { + method: 'GET', + ...(options || {}), + }); +} +/* eslint-disable */ +// @ts-ignore +import request from '../request'; + +import * as API from './types'; + +/** c1 GET /sys-c/c1 */ +export async function sysCc1UsingGet({ + options, +}: { + options?: { [key: string]: unknown }; +}) { + return request('/sys-c/c1', { + method: 'GET', + ...(options || {}), + }); +} + +/** c1/cc1 GET /sys-c/c1/cc1 */ +export async function sysCc1Cc1UsingGet({ + options, +}: { + options?: { [key: string]: unknown }; +}) { + return request('/sys-c/c1/cc1', { + method: 'GET', + ...(options || {}), + }); +} + +/** c1/cc1/ccc1 GET /sys-c/c1/cc1/ccc1 */ +export async function sysCc1Cc1Ccc1UsingGet({ + options, +}: { + options?: { [key: string]: unknown }; +}) { + return request('/sys-c/c1/cc1/ccc1', { + method: 'GET', + ...(options || {}), + }); +} + +/** c1/cc1/ccc1/cccc1 GET /sys-c/c1/cc1/ccc1/cccc1 */ +export async function sysCc1Cc1Ccc1Cccc1UsingGet({ + options, +}: { + options?: { [key: string]: unknown }; +}) { + return request('/sys-c/c1/cc1/ccc1/cccc1', { + method: 'GET', + ...(options || {}), + }); +} +/* eslint-disable */ +// @ts-ignore +export {}; +/* eslint-disable */ +// @ts-ignore +import request from '../request'; + +import * as API from './types'; + +/** x1 GET /user-x/x1 */ +export async function userXx1UsingGet({ + options, +}: { + options?: { [key: string]: unknown }; +}) { + return request('/user-x/x1', { + method: 'GET', + ...(options || {}), + }); +} + +/** x1/xx1 GET /user-x/x1/xx1 */ +export async function userXx1Xx1UsingGet({ + options, +}: { + options?: { [key: string]: unknown }; +}) { + return request('/user-x/x1/xx1', { + method: 'GET', + ...(options || {}), + }); +} + +/** x1/xx1/xxx1 GET /user-x/x1/xx1/xxx1 */ +export async function userXx1Xx1Xxx1UsingGet({ + options, +}: { + options?: { [key: string]: unknown }; +}) { + return request('/user-x/x1/xx1/xxx1', { + method: 'GET', + ...(options || {}), + }); +} + +/** x1/xx1/xxx1/xxxx1 GET /user-x/x1/xx1/xxx1/xxxx1 */ +export async function userXx1Xx1Xxx1Xxxx1UsingGet({ + options, +}: { + options?: { [key: string]: unknown }; +}) { + return request('/user-x/x1/xx1/xxx1/xxxx1', { + method: 'GET', + ...(options || {}), + }); +} +/* eslint-disable */ +// @ts-ignore +import request from '../request'; + +import * as API from './types'; + +/** y1 GET /user-y/y1 */ +export async function userYy1UsingGet({ + options, +}: { + options?: { [key: string]: unknown }; +}) { + return request('/user-y/y1', { + method: 'GET', + ...(options || {}), + }); +} + +/** y1/yy1 GET /user-y/y1/yy1 */ +export async function userYy1Yy1UsingGet({ + options, +}: { + options?: { [key: string]: unknown }; +}) { + return request('/user-y/y1/yy1', { + method: 'GET', + ...(options || {}), + }); +} + +/** y1/yy1/yyy1 GET /user-y/y1/yy1/yyy1 */ +export async function userYy1Yy1Yyy1UsingGet({ + options, +}: { + options?: { [key: string]: unknown }; +}) { + return request('/user-y/y1/yy1/yyy1', { + method: 'GET', + ...(options || {}), + }); +} + +/** y1/yy1/yyy1/yyyy1 GET /user-y/y1/yy1/yyy1/yyyy1 */ +export async function userYy1Yy1Yyy1Yyyy1UsingGet({ + options, +}: { + options?: { [key: string]: unknown }; +}) { + return request('/user-y/y1/yy1/yyy1/yyyy1', { + method: 'GET', + ...(options || {}), + }); +} + +/** y1/yy1/yyy1/yyyy1/yyyyy1 GET /user-y/y1/yy1/yyy1/yyyy1/yyyyy1 */ +export async function userYy1Yy1Yyy1Yyyy1Yyyyy1UsingGet({ + options, +}: { + options?: { [key: string]: unknown }; +}) { + return request('/user-y/y1/yy1/yyy1/yyyy1/yyyyy1', { + method: 'GET', + ...(options || {}), + }); +} +/* eslint-disable */ +// @ts-ignore +import request from '../request'; + +import * as API from './types'; + +/** f1 ffff GET /user-z/z1 */ +export async function userZz1UsingGet({ + options, +}: { + options?: { [key: string]: unknown }; +}) { + return request('/user-z/z1', { + method: 'GET', + ...(options || {}), + }); +} + +/** z1/zz1 GET /user-z/z1/zz1 */ +export async function userZz1Zz1UsingGet({ + options, +}: { + options?: { [key: string]: unknown }; +}) { + return request('/user-z/z1/zz1', { + method: 'GET', + ...(options || {}), + }); +} + +/** z1/zz1/zzz1 GET /user-z/z1/zz1/zzz1 */ +export async function userZz1Zz1Zzz1UsingGet({ + options, +}: { + options?: { [key: string]: unknown }; +}) { + return request('/user-z/z1/zz1/zzz1', { + method: 'GET', + ...(options || {}), + }); +} + +/** z1/zz1/zzz1/zzzz1 GET /user-z/z1/zz1/zzz1/zzzz1 */ +export async function userZz1Zz1Zzz1Zzzz1UsingGet({ + options, +}: { + options?: { [key: string]: unknown }; +}) { + return request('/user-z/z1/zz1/zzz1/zzzz1', { + method: 'GET', + ...(options || {}), + }); +} + +/** z1/zz1/zzz1/zzzz1/zzzzz1 GET /user-z/z1/zz1/zzz1/zzzz1/zzzzz1 */ +export async function userZz1Zz1Zzz1Zzzz1Zzzzz1UsingGet({ + options, +}: { + options?: { [key: string]: unknown }; +}) { + return request('/user-z/z1/zz1/zzz1/zzzz1/zzzzz1', { + method: 'GET', + ...(options || {}), + }); +} diff --git a/test/__snapshots__/include/should includeTags specified and includePaths are wildcard.snap b/test/__snapshots__/include/should includeTags specified and includePaths are wildcard.snap new file mode 100644 index 0000000..ce45d51 --- /dev/null +++ b/test/__snapshots__/include/should includeTags specified and includePaths are wildcard.snap @@ -0,0 +1,127 @@ +/* eslint-disable */ +// @ts-ignore +export * from './types'; + +export * from './userZ'; +export * from './sysA'; +/* eslint-disable */ +// @ts-ignore +import request from '../request'; + +import * as API from './types'; + +/** a1 GET /sys-a/a1 */ +export async function sysAa1UsingGet({ + options, +}: { + options?: { [key: string]: unknown }; +}) { + return request('/sys-a/a1', { + method: 'GET', + ...(options || {}), + }); +} + +/** a1/aa1 GET /sys-a/a1/aa1 */ +export async function sysAa1Aa1UsingGet({ + options, +}: { + options?: { [key: string]: unknown }; +}) { + return request('/sys-a/a1/aa1', { + method: 'GET', + ...(options || {}), + }); +} + +/** a1/a1/aa1 GET /sys-a/a1/aa1/aaa1 */ +export async function sysAa1Aa1Aaa1UsingGet({ + options, +}: { + options?: { [key: string]: unknown }; +}) { + return request('/sys-a/a1/aa1/aaa1', { + method: 'GET', + ...(options || {}), + }); +} + +/** a1/a1/aa1/aaa1 GET /sys-a/a1/aa1/aaa1/aaaa1 */ +export async function sysAa1Aa1Aaa1Aaaa1UsingGet({ + options, +}: { + options?: { [key: string]: unknown }; +}) { + return request('/sys-a/a1/aa1/aaa1/aaaa1', { + method: 'GET', + ...(options || {}), + }); +} +/* eslint-disable */ +// @ts-ignore +export {}; +/* eslint-disable */ +// @ts-ignore +import request from '../request'; + +import * as API from './types'; + +/** f1 ffff GET /user-z/z1 */ +export async function userZz1UsingGet({ + options, +}: { + options?: { [key: string]: unknown }; +}) { + return request('/user-z/z1', { + method: 'GET', + ...(options || {}), + }); +} + +/** z1/zz1 GET /user-z/z1/zz1 */ +export async function userZz1Zz1UsingGet({ + options, +}: { + options?: { [key: string]: unknown }; +}) { + return request('/user-z/z1/zz1', { + method: 'GET', + ...(options || {}), + }); +} + +/** z1/zz1/zzz1 GET /user-z/z1/zz1/zzz1 */ +export async function userZz1Zz1Zzz1UsingGet({ + options, +}: { + options?: { [key: string]: unknown }; +}) { + return request('/user-z/z1/zz1/zzz1', { + method: 'GET', + ...(options || {}), + }); +} + +/** z1/zz1/zzz1/zzzz1 GET /user-z/z1/zz1/zzz1/zzzz1 */ +export async function userZz1Zz1Zzz1Zzzz1UsingGet({ + options, +}: { + options?: { [key: string]: unknown }; +}) { + return request('/user-z/z1/zz1/zzz1/zzzz1', { + method: 'GET', + ...(options || {}), + }); +} + +/** z1/zz1/zzz1/zzzz1/zzzzz1 GET /user-z/z1/zz1/zzz1/zzzz1/zzzzz1 */ +export async function userZz1Zz1Zzz1Zzzz1Zzzzz1UsingGet({ + options, +}: { + options?: { [key: string]: unknown }; +}) { + return request('/user-z/z1/zz1/zzz1/zzzz1/zzzzz1', { + method: 'GET', + ...(options || {}), + }); +} diff --git a/test/__snapshots__/include/should only include the specified paths and includeTags.snap b/test/__snapshots__/include/should only include the specified paths and includeTags.snap new file mode 100644 index 0000000..01301ec --- /dev/null +++ b/test/__snapshots__/include/should only include the specified paths and includeTags.snap @@ -0,0 +1,169 @@ +/* eslint-disable */ +// @ts-ignore +export * from './types'; + +export * from './sysC'; +export * from './sysB'; +export * from './sysA'; +/* eslint-disable */ +// @ts-ignore +import request from '../request'; + +import * as API from './types'; + +/** a1 GET /sys-a/a1 */ +export async function sysAa1UsingGet({ + options, +}: { + options?: { [key: string]: unknown }; +}) { + return request('/sys-a/a1', { + method: 'GET', + ...(options || {}), + }); +} + +/** a1/aa1 GET /sys-a/a1/aa1 */ +export async function sysAa1Aa1UsingGet({ + options, +}: { + options?: { [key: string]: unknown }; +}) { + return request('/sys-a/a1/aa1', { + method: 'GET', + ...(options || {}), + }); +} + +/** a1/a1/aa1 GET /sys-a/a1/aa1/aaa1 */ +export async function sysAa1Aa1Aaa1UsingGet({ + options, +}: { + options?: { [key: string]: unknown }; +}) { + return request('/sys-a/a1/aa1/aaa1', { + method: 'GET', + ...(options || {}), + }); +} + +/** a1/a1/aa1/aaa1 GET /sys-a/a1/aa1/aaa1/aaaa1 */ +export async function sysAa1Aa1Aaa1Aaaa1UsingGet({ + options, +}: { + options?: { [key: string]: unknown }; +}) { + return request('/sys-a/a1/aa1/aaa1/aaaa1', { + method: 'GET', + ...(options || {}), + }); +} +/* eslint-disable */ +// @ts-ignore +import request from '../request'; + +import * as API from './types'; + +/** b1 GET /sys-b/b1 */ +export async function sysBb1UsingGet({ + options, +}: { + options?: { [key: string]: unknown }; +}) { + return request('/sys-b/b1', { + method: 'GET', + ...(options || {}), + }); +} + +/** b1/bb1 GET /sys-b/b1/bb1 */ +export async function sysBb1Bb1UsingGet({ + options, +}: { + options?: { [key: string]: unknown }; +}) { + return request('/sys-b/b1/bb1', { + method: 'GET', + ...(options || {}), + }); +} + +/** b1/bb1/bbb1 GET /sys-b/b1/bb1/bbb1 */ +export async function sysBb1Bb1Bbb1UsingGet({ + options, +}: { + options?: { [key: string]: unknown }; +}) { + return request('/sys-b/b1/bb1/bbb1', { + method: 'GET', + ...(options || {}), + }); +} + +/** b1/bb1/bbb1/bbbb1 GET /sys-b/b1/bb1/bbb1/bbbb1 */ +export async function sysBb1Bb1Bbb1Bbbb1UsingGet({ + options, +}: { + options?: { [key: string]: unknown }; +}) { + return request('/sys-b/b1/bb1/bbb1/bbbb1', { + method: 'GET', + ...(options || {}), + }); +} +/* eslint-disable */ +// @ts-ignore +import request from '../request'; + +import * as API from './types'; + +/** c1 GET /sys-c/c1 */ +export async function sysCc1UsingGet({ + options, +}: { + options?: { [key: string]: unknown }; +}) { + return request('/sys-c/c1', { + method: 'GET', + ...(options || {}), + }); +} + +/** c1/cc1 GET /sys-c/c1/cc1 */ +export async function sysCc1Cc1UsingGet({ + options, +}: { + options?: { [key: string]: unknown }; +}) { + return request('/sys-c/c1/cc1', { + method: 'GET', + ...(options || {}), + }); +} + +/** c1/cc1/ccc1 GET /sys-c/c1/cc1/ccc1 */ +export async function sysCc1Cc1Ccc1UsingGet({ + options, +}: { + options?: { [key: string]: unknown }; +}) { + return request('/sys-c/c1/cc1/ccc1', { + method: 'GET', + ...(options || {}), + }); +} + +/** c1/cc1/ccc1/cccc1 GET /sys-c/c1/cc1/ccc1/cccc1 */ +export async function sysCc1Cc1Ccc1Cccc1UsingGet({ + options, +}: { + options?: { [key: string]: unknown }; +}) { + return request('/sys-c/c1/cc1/ccc1/cccc1', { + method: 'GET', + ...(options || {}), + }); +} +/* eslint-disable */ +// @ts-ignore +export {}; diff --git a/test/__snapshots__/include/should return empty while include tags is empty.snap b/test/__snapshots__/include/should return empty while include tags is empty.snap new file mode 100644 index 0000000..1924b51 --- /dev/null +++ b/test/__snapshots__/include/should return empty while include tags is empty.snap @@ -0,0 +1,6 @@ +/* eslint-disable */ +// @ts-ignore +export * from './types'; +/* eslint-disable */ +// @ts-ignore +export {}; diff --git a/test/both.spec.ts b/test/both.spec.ts new file mode 100644 index 0000000..ff5a4f9 --- /dev/null +++ b/test/both.spec.ts @@ -0,0 +1,106 @@ +import { describe, expect, it } from 'vitest'; + +import { generateService } from '../src/index'; +import { getSnapshotDir, readGeneratedFiles } from './testUtils'; + +describe('openAPI.generateService priorityRule=both', () => { + /** + * 结果 [] + */ + it('should empty excludeTags and excludePaths return none', async (ctx) => { + await generateService({ + schemaPath: `${__dirname}/example-files/openapi-priority-rule.json`, + serversPath: './apis/both/test1', + requestLibPath: '../request', + enableLogging: true, // 开启日志 + priorityRule: 'both', + includeTags: [], + includePaths: [], + excludeTags: [], + excludePaths: [], + }); + await expect( + readGeneratedFiles('./apis/both/test1') + ).resolves.toMatchFileSnapshot(getSnapshotDir(ctx)); + }); + + /** + * 结果 [*] + */ + it('should return all while includeTags match all', async (ctx) => { + await generateService({ + schemaPath: `${__dirname}/example-files/openapi-priority-rule.json`, + serversPath: './apis/both/test2', + requestLibPath: '../request', + enableLogging: true, // 开启日志 + priorityRule: 'both', + includeTags: [/.*/g], + includePaths: [], + excludeTags: [], + excludePaths: [], + }); + await expect( + readGeneratedFiles('./apis/both/test2') + ).resolves.toMatchFileSnapshot(getSnapshotDir(ctx)); + }); + + /** + * 结果 ['/sys-a/a1'] + */ + it('should exclude items from includePaths and includeTags', async (ctx) => { + await generateService({ + schemaPath: `${__dirname}/example-files/openapi-priority-rule.json`, + serversPath: './apis/both/test3', + requestLibPath: '../request', + enableLogging: true, // 开启日志 + priorityRule: 'both', + includeTags: [/.*/g], + includePaths: ['/sys-a/**'], + excludeTags: [], + excludePaths: ['/sys-a/a1/**'], + }); + await expect( + readGeneratedFiles('./apis/both/test3') + ).resolves.toMatchFileSnapshot(getSnapshotDir(ctx)); + }); + + /** + * 结果 ['/user-z/z1'] + */ + it('should both excludeTags and excludePaths works with includeTags', async (ctx) => { + await generateService({ + schemaPath: `${__dirname}/example-files/openapi-priority-rule.json`, + serversPath: './apis/both/test4', + requestLibPath: '../request', + enableLogging: true, // 开启日志 + priorityRule: 'both', + includeTags: [/.*/g], + includePaths: ['/sys-a/**', '/user-z/**'], + excludeTags: ['sys-a'], + excludePaths: ['/user-z/z1/**'], + }); + await expect( + readGeneratedFiles('./apis/both/test4') + ).resolves.toMatchFileSnapshot(getSnapshotDir(ctx)); + }); + + /** + * 结果 ['/user-z/z1', '/user-z/z1/zz1'] + */ + it('should both excludeTags and excludePaths works while excludePaths has wildcard', async (ctx) => { + await generateService({ + schemaPath: `${__dirname}/example-files/openapi-priority-rule.json`, + serversPath: './apis/both/test5', + requestLibPath: '../request', + enableLogging: true, // 开启日志 + priorityRule: 'both', + includeTags: [/.*/g], + includePaths: [], + excludeTags: ['sys-b', 'sys-c', 'user-x', 'user-y'], + excludePaths: ['/sys-a/**', '/user-z/z1/zz1/**'], + }); + await expect( + readGeneratedFiles('./apis/both/test5') + ).resolves.toMatchFileSnapshot(getSnapshotDir(ctx)); + }); +}); diff --git a/test/bothTest.ts b/test/bothTest.ts deleted file mode 100644 index a3c1ec6..0000000 --- a/test/bothTest.ts +++ /dev/null @@ -1,87 +0,0 @@ -import { generateService } from '../src/index'; - -/** - * 结果 [] - */ -const bothTest1 = async () => - await generateService({ - schemaPath: `${__dirname}/example-files/openapi-priority-rule.json`, - serversPath: './apis/both/test1', - requestLibPath: '../request', - enableLogging: true, // 开启日志 - priorityRule: 'both', - includeTags: [], - includePaths: [], - excludeTags: [], - excludePaths: [], - }); - -/** - * 结果 [*] - */ -const bothTest2 = async () => - await generateService({ - schemaPath: `${__dirname}/example-files/openapi-priority-rule.json`, - serversPath: './apis/both/test2', - requestLibPath: '../request', - enableLogging: true, // 开启日志 - priorityRule: 'both', - includeTags: [/.*/g], - includePaths: [], - excludeTags: [], - excludePaths: [], - }); - -/** - * 结果 ['/sys-a/a1'] - */ -const bothTest3 = async () => - await generateService({ - schemaPath: `${__dirname}/example-files/openapi-priority-rule.json`, - serversPath: './apis/both/test3', - requestLibPath: '../request', - enableLogging: true, // 开启日志 - priorityRule: 'both', - includeTags: [/.*/g], - includePaths: ['/sys-a/**'], - excludeTags: [], - excludePaths: ['/sys-a/a1/**'], - }); - -/** - * 结果 ['/user-z/z1'] - */ -const bothTest4 = async () => - await generateService({ - schemaPath: `${__dirname}/example-files/openapi-priority-rule.json`, - serversPath: './apis/both/test4', - requestLibPath: '../request', - enableLogging: true, // 开启日志 - priorityRule: 'both', - includeTags: [/.*/g], - includePaths: ['/sys-a/**', '/user-z/**'], - excludeTags: ['sys-a'], - excludePaths: ['/user-z/z1/**'], - }); - -/** - * 结果 ['/user-z/z1', '/user-z/z1/zz1'] - */ -const bothTest5 = async () => - await generateService({ - schemaPath: `${__dirname}/example-files/openapi-priority-rule.json`, - serversPath: './apis/both/test5', - requestLibPath: '../request', - enableLogging: true, // 开启日志 - priorityRule: 'both', - includeTags: [/.*/g], - includePaths: [], - excludeTags: ['sys-b', 'sys-c', 'user-x', 'user-y'], - excludePaths: ['/sys-a/**', '/user-z/z1/zz1/**'], - }); - -bothTest1(); -bothTest2(); -bothTest3(); -bothTest4(); -bothTest5(); diff --git a/test/common.spec.ts b/test/common.spec.ts new file mode 100644 index 0000000..ac37850 --- /dev/null +++ b/test/common.spec.ts @@ -0,0 +1,487 @@ +import { join } from 'path'; +import { describe, expect, it, vi } from 'vitest'; + +import * as openAPI from '../src/index'; +import { getSnapshotDir, readGeneratedFiles } from './testUtils'; + +vi.setConfig({ + testTimeout: 10_000, +}); + +describe('openAPI.generateService', () => { + it('测试空的 openapi 定义', async (ctx) => { + await openAPI.generateService({ + schemaPath: join( + import.meta.dirname, + './example-files/openapi-empty.json' + ), + serversPath: './apis/empty', + isDisplayTypeLabel: true, + isGenJsonSchemas: true, + }); + + await expect( + readGeneratedFiles('./apis/empty') + ).resolves.toMatchFileSnapshot(getSnapshotDir(ctx)); + }); + + it('测试 tags 为 undefined', async (ctx) => { + await openAPI.generateService({ + schemaPath: join( + import.meta.dirname, + './example-files/openapi-tags-undefined.json' + ), + serversPath: './apis/tags-undefined', + }); + await expect( + readGeneratedFiles('./apis/tags-undefined') + ).resolves.toMatchFileSnapshot(getSnapshotDir(ctx)); + }); + + it('测试 tags 为[]', async (ctx) => { + await openAPI.generateService({ + schemaPath: join( + import.meta.dirname, + './example-files/openapi-tags-empty.json' + ), + serversPath: './apis/tags-empty', + }); + await expect( + readGeneratedFiles('./apis/tags-empty') + ).resolves.toMatchFileSnapshot(getSnapshotDir(ctx)); + }); + + it('测试 swagger => openapi, schema 循环引用', async (ctx) => { + await openAPI.generateService({ + schemaPath: join( + import.meta.dirname, + './example-files/swagger-get-method-params-convert-obj.json' + ), + serversPath: './apis/convert-obj', + }); + await expect( + readGeneratedFiles('./apis/convert-obj') + ).resolves.toMatchFileSnapshot(getSnapshotDir(ctx)); + }); + + it('测试空的 schema 引用', async (ctx) => { + await openAPI.generateService({ + schemaPath: join( + import.meta.dirname, + './example-files/openapi-schema-contain-blank-symbol.json' + ), + serversPath: './apis/blank-symbol', + }); + await expect( + readGeneratedFiles('./apis/blank-symbol') + ).resolves.toMatchFileSnapshot(getSnapshotDir(ctx)); + }); + + it('自定义 hook', async (ctx) => { + await openAPI.generateService({ + requestLibPath: "import request from '@/request';", + schemaPath: join( + import.meta.dirname, + './example-files/openapi-custom-hook.json' + ), + serversPath: './apis/custom', + hook: { + // 自定义类名 + customClassName: (tagName) => { + return /[A-Z].+/.exec(tagName)?.toString() || ''; + }, + // 自定义函数名 + customFunctionName: (data) => { + let funName = data.operationId ? data.operationId : ''; + const suffix = 'Using'; + + if (funName.indexOf(suffix) != -1) { + funName = funName.substring(0, funName.lastIndexOf(suffix)); + } + + return funName; + }, + // 自定义类型名 + customTypeName: (data) => { + const { operationId } = data; + const funName = operationId + ? operationId[0].toUpperCase() + operationId.substring(1) + : ''; + const tag = data?.tags?.[0]; + + return `${tag ? tag : ''}${funName}`; + }, + // 自定义模板 + customTemplates: { + serviceController: (api: any, ctx: any) => { + if (api.method.toUpperCase() === 'GET') { + return ` +export async function ${api.functionName}(${api.params && api.hasParams ? `params: ${ctx.namespace}.${api.typeName}` : ''}) { + return request.get('${api.path}', { params }) +}`; + } else { + return ` +export async function ${api.functionName}(${api.body ? `data: ${api.body.type}` : ''}) { + return request.post('${api.path}', data) +}`; + } + }, + }, + }, + }); + await expect( + readGeneratedFiles('./apis/custom') + ).resolves.toMatchFileSnapshot(getSnapshotDir(ctx)); + }); + + it('支持 null 类型作为默认值', async (ctx) => { + await openAPI.generateService({ + schemaPath: join(import.meta.dirname, './example-files/openapi.json'), + serversPath: './apis/support-null', + nullable: true, + mockFolder: './mocks', + }); + await expect( + readGeneratedFiles('./apis/support-null') + ).resolves.toMatchFileSnapshot(getSnapshotDir(ctx)); + }); + + it('正常命名文件和请求函数', async (ctx) => { + await openAPI.generateService({ + schemaPath: join( + import.meta.dirname, + './example-files/openapi-camelcase.json' + ), + serversPath: './apis/name/normal', + isCamelCase: false, + }); + await expect( + readGeneratedFiles('./apis/name/normal') + ).resolves.toMatchFileSnapshot(getSnapshotDir(ctx)); + }); + + it('小驼峰命名文件和请求函数', async (ctx) => { + await openAPI.generateService({ + schemaPath: join( + import.meta.dirname, + './example-files/openapi-camelcase.json' + ), + serversPath: './apis/name/camelcase', + isCamelCase: true, + }); + await expect( + readGeneratedFiles('./apis/name/camelcase') + ).resolves.toMatchFileSnapshot(getSnapshotDir(ctx)); + }); + + it('测试处理 allof 结构, 生成复杂 type 翻译', async (ctx) => { + await openAPI.generateService({ + schemaPath: join( + import.meta.dirname, + './example-files/openapi-test-allof-api.json' + ), + serversPath: './apis/allof', + isDisplayTypeLabel: true, + }); + await expect( + readGeneratedFiles('./apis/allof') + ).resolves.toMatchFileSnapshot(getSnapshotDir(ctx)); + }); + + it('文件上传', async (ctx) => { + await openAPI.generateService({ + schemaPath: join( + import.meta.dirname, + './example-files/swagger-file-convert.json' + ), + serversPath: './apis/file', + isGenReactQuery: true, + }); + await expect( + readGeneratedFiles('./apis/file') + ).resolves.toMatchFileSnapshot(getSnapshotDir(ctx)); + }); + + it('生成枚举翻译, 生成 type 翻译', async (ctx) => { + await openAPI.generateService({ + schemaPath: join( + import.meta.dirname, + './example-files/openapi-display-enum-label.json' + ), + serversPath: './apis/display-enum-label', + isDisplayTypeLabel: true, + }); + await expect( + readGeneratedFiles('./apis/display-enum-label') + ).resolves.toMatchFileSnapshot(getSnapshotDir(ctx)); + }); + + it('测试筛选出指定 tags 对应的api', async (ctx) => { + await openAPI.generateService({ + schemaPath: join(import.meta.dirname, './example-files/openapi.json'), + serversPath: './apis/filter-tags', + includeTags: ['pet'], + }); + await expect( + readGeneratedFiles('./apis/filter-tags') + ).resolves.toMatchFileSnapshot(getSnapshotDir(ctx)); + }); + + it('测试 "COMPUTER SCIENCE" 这一类的枚举值在生成的类型中不报错', async (ctx) => { + await openAPI.generateService({ + schemaPath: join( + import.meta.dirname, + './example-files/openapi-complex-enum-convert.json' + ), + serversPath: './apis/complex-enum-convert', + includePaths: [/.*/g], + includeTags: [/.*/g], + }); + await expect( + readGeneratedFiles('./apis/complex-enum-convert') + ).resolves.toMatchFileSnapshot(getSnapshotDir(ctx)); + }); + + it('测试生成 JSON Schemas', async (ctx) => { + await openAPI.generateService({ + schemaPath: join( + import.meta.dirname, + './example-files/openapi-display-enum-label.json' + ), + serversPath: './apis/schemas', + isGenJsonSchemas: true, + }); + await expect( + readGeneratedFiles('./apis/schemas') + ).resolves.toMatchFileSnapshot(getSnapshotDir(ctx)); + }); + + it('测试设置 path 前缀', async (ctx) => { + await openAPI.generateService({ + schemaPath: join(import.meta.dirname, './example-files/swagger.json'), + serversPath: './apis/api-prefix', + apiPrefix: '"/pet"', + }); + await expect( + readGeneratedFiles('./apis/api-prefix') + ).resolves.toMatchFileSnapshot(getSnapshotDir(ctx)); + }); + + it('测试解析 swagger.yaml/openapi.yaml', async (ctx) => { + await openAPI.generateService({ + schemaPath: join(import.meta.dirname, './example-files/swagger.yaml'), + serversPath: './apis/yaml', + }); + await expect( + readGeneratedFiles('./apis/yaml') + ).resolves.toMatchFileSnapshot(getSnapshotDir(ctx)); + }); + + it( + '测试将中文 tag 名称翻译成英文 tag 名称', + { + timeout: 40_000, + }, + async (ctx) => { + await openAPI.generateService({ + schemaPath: join( + import.meta.dirname, + './example-files/openapi-chinese-tag.json' + ), + serversPath: './apis/chinese-tag', + isTranslateToEnglishTag: true, + }); + await expect( + readGeneratedFiles('./apis/chinese-tag') + ).resolves.toMatchFileSnapshot(getSnapshotDir(ctx)); + } + ); + + it('测试支持 components 非 schemas 的字段', async (ctx) => { + await openAPI.generateService({ + schemaPath: join( + import.meta.dirname, + './example-files/swagger-components-response.json' + ), + serversPath: './apis/components-response', + }); + await expect( + readGeneratedFiles('./apis/components-response') + ).resolves.toMatchFileSnapshot(getSnapshotDir(ctx)); + }); + + it('测试 $ref 引用中包含 encode 编码字符', async (ctx) => { + await openAPI.generateService({ + schemaPath: join( + import.meta.dirname, + './example-files/openapi-ref-encode-character.json' + ), + serversPath: './apis/ref-encode-character', + includeTags: ['商品基础管理'], + }); + await expect( + readGeneratedFiles('./apis/ref-encode-character') + ).resolves.toMatchFileSnapshot(getSnapshotDir(ctx)); + }); + + it('测试支持 apifox x-run-in-apifox', async (ctx) => { + await openAPI.generateService({ + schemaPath: join( + import.meta.dirname, + './example-files/openapi-ref-encode-character.json' + ), + serversPath: './apis/x-run-in-apifox', + }); + await expect( + readGeneratedFiles('./apis/x-run-in-apifox') + ).resolves.toMatchFileSnapshot(getSnapshotDir(ctx)); + }); + + it('测试 schemas 包含枚举数组', async (ctx) => { + await openAPI.generateService({ + schemaPath: join( + import.meta.dirname, + './example-files/openapi-schemas-enum-array.json' + ), + serversPath: './apis/schemas-enum-array', + }); + await expect( + readGeneratedFiles('./apis/schemas-enum-array') + ).resolves.toMatchFileSnapshot(getSnapshotDir(ctx)); + }); + + it('测试只生成 typescript 类型,不生成请求函数', async (ctx) => { + await openAPI.generateService({ + schemaPath: join(import.meta.dirname, './example-files/openapi.json'), + serversPath: './apis/only-generate-typescript-type', + isOnlyGenTypeScriptType: true, + isDisplayTypeLabel: true, + isGenJsonSchemas: true, + }); + await expect( + readGeneratedFiles('./apis/only-generate-typescript-type') + ).resolves.toMatchFileSnapshot(getSnapshotDir(ctx)); + }); + + it('测试 number类型 枚举', async (ctx) => { + await openAPI.generateService({ + schemaPath: join( + import.meta.dirname, + './example-files/openapi-number-enum.json' + ), + serversPath: './apis/number-enum', + }); + await expect( + readGeneratedFiles('./apis/number-enum') + ).resolves.toMatchFileSnapshot(getSnapshotDir(ctx)); + }); + + it('测试 number类型 枚举,使用 desc 解析枚举', async (ctx) => { + await openAPI.generateService({ + schemaPath: join( + import.meta.dirname, + './example-files/openapi-desc-enum.json' + ), + serversPath: './apis/openapi-desc-enum', + isSupportParseEnumDesc: true, + }); + await expect( + readGeneratedFiles('./apis/openapi-desc-enum') + ).resolves.toMatchFileSnapshot(getSnapshotDir(ctx)); + }); + + it('测试支持 apifox x-apifox-enum', async (ctx) => { + await openAPI.generateService({ + schemaPath: join( + import.meta.dirname, + './example-files/openapi-apifox-enum-label.json' + ), + serversPath: './apis/apifox-enum-label', + }); + await expect( + readGeneratedFiles('./apis/apifox-enum-label') + ).resolves.toMatchFileSnapshot(getSnapshotDir(ctx)); + }); + + it('测试生成 react-query', async (ctx) => { + await openAPI.generateService({ + schemaPath: join( + import.meta.dirname, + './example-files/openapi-display-enum-label.json' + ), + serversPath: './apis/react-query', + isGenReactQuery: true, + }); + await expect( + readGeneratedFiles('./apis/react-query') + ).resolves.toMatchFileSnapshot(getSnapshotDir(ctx)); + }); + + it('测试生成 react-query 的 vue 模式', async (ctx) => { + await openAPI.generateService({ + schemaPath: join( + import.meta.dirname, + './example-files/openapi-display-enum-label.json' + ), + serversPath: './apis/react-query-vue', + isGenReactQuery: true, + reactQueryMode: 'vue', + }); + await expect( + readGeneratedFiles('./apis/react-query-vue') + ).resolves.toMatchFileSnapshot(getSnapshotDir(ctx)); + }); + + it('测试生成 JavaScript', async (ctx) => { + await openAPI.generateService({ + schemaPath: join( + import.meta.dirname, + './example-files/openapi-display-enum-label.json' + ), + serversPath: './apis/javascript', + isGenReactQuery: true, + isGenJavaScript: true, + }); + await expect( + readGeneratedFiles('./apis/javascript') + ).resolves.toMatchFileSnapshot(getSnapshotDir(ctx)); + }); + + it('测试生成 response type comments', async (ctx) => { + await openAPI.generateService({ + schemaPath: join( + import.meta.dirname, + './example-files/openapi-response-desc.json' + ), + serversPath: './apis/openapi-response-desc', + }); + await expect( + readGeneratedFiles('./apis/openapi-response-desc') + ).resolves.toMatchFileSnapshot(getSnapshotDir(ctx)); + }); + + it('测试生成 isSupportParseEnumDesc 设置为true', async (ctx) => { + await openAPI.generateService({ + schemaPath: `${import.meta.dirname}/example-files/openapi-response-desc.json`, + serversPath: './apis/openapi-response-desc-parse-enum', + isSupportParseEnumDesc: true, + }); + + await expect( + readGeneratedFiles('./apis/openapi-response-desc-parse-enum') + ).resolves.toMatchFileSnapshot(getSnapshotDir(ctx)); + }); + + it('测试生成匿名response => 具名response', async (ctx) => { + await openAPI.generateService({ + schemaPath: join( + import.meta.dirname, + './example-files/openapi-response-desc.json' + ), + serversPath: './apis/openapi-anonymous-response', + }); + await expect( + readGeneratedFiles('./apis/openapi-anonymous-response') + ).resolves.toMatchFileSnapshot(getSnapshotDir(ctx)); + }); +}); diff --git a/test/example-files/openapi-chinese-tag.json b/test/example-files/openapi-chinese-tag.json index 4c884e6..a4fb3a6 100644 --- a/test/example-files/openapi-chinese-tag.json +++ b/test/example-files/openapi-chinese-tag.json @@ -24,7 +24,7 @@ ], "tags": [ { - "name": "宠物", + "name": "宠物们", "description": "Everything about your Pets", "externalDocs": { "description": "Find out more", @@ -47,7 +47,7 @@ "paths": { "/pet": { "put": { - "tags": ["宠物", "你好", "世界", "happy"], + "tags": ["宠物们", "你好", "世界", "happy"], "summary": "Update an existing pet", "description": "Update an existing pet by Id", "operationId": "updatePet", @@ -105,7 +105,7 @@ ] }, "post": { - "tags": ["宠物"], + "tags": ["宠物们"], "summary": "Add a new pet to the store", "description": "Add a new pet to the store", "operationId": "addPet", @@ -159,7 +159,7 @@ }, "/pet/findByStatus": { "get": { - "tags": ["宠物"], + "tags": ["宠物们"], "summary": "Finds Pets by status", "description": "Multiple status values can be provided with comma separated strings", "operationId": "findPetsByStatus", @@ -212,7 +212,7 @@ }, "/pet/findByTags": { "get": { - "tags": ["宠物"], + "tags": ["宠物们"], "summary": "Finds Pets by tags", "description": "Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.", "operationId": "findPetsByTags", @@ -266,7 +266,7 @@ }, "/pet/{petId}": { "get": { - "tags": ["宠物"], + "tags": ["宠物们"], "summary": "Find pet by ID", "description": "Returns a single pet", "operationId": "getPetById", @@ -315,7 +315,7 @@ ] }, "post": { - "tags": ["宠物"], + "tags": ["宠物们"], "summary": "Updates a pet in the store with form data", "description": "", "operationId": "updatePetWithForm", @@ -359,7 +359,7 @@ ] }, "delete": { - "tags": ["宠物"], + "tags": ["宠物们"], "summary": "Deletes a pet", "description": "", "operationId": "deletePet", @@ -398,7 +398,7 @@ }, "/pet/{petId}/uploadImage": { "post": { - "tags": ["宠物"], + "tags": ["宠物们"], "summary": "uploads an image", "description": "", "operationId": "uploadFile", diff --git a/test/exclude.spec.ts b/test/exclude.spec.ts new file mode 100644 index 0000000..cce64f3 --- /dev/null +++ b/test/exclude.spec.ts @@ -0,0 +1,106 @@ +import { describe, expect, it } from 'vitest'; + +import { generateService } from '../src/index'; +import { getSnapshotDir, readGeneratedFiles } from './testUtils'; + +describe('openAPI.generateService priorityRule=exclude', () => { + /** + * 结果 [*] + */ + it('should empty excludeTags and excludePaths return all', async (ctx) => { + await generateService({ + schemaPath: `${__dirname}/example-files/openapi-priority-rule.json`, + serversPath: './apis/exclude/test1', + requestLibPath: '../request', + enableLogging: true, // 开启日志 + priorityRule: 'exclude', + includeTags: [], + includePaths: [], + excludeTags: [], + excludePaths: [], + }); + await expect( + readGeneratedFiles('./apis/exclude/test1') + ).resolves.toMatchFileSnapshot(getSnapshotDir(ctx)); + }); + + /** + * 结果 ['/sys-b/**', '/sys-c/**', '/user-x/**', '/user-y/**'] + */ + it('should only excludeTags set works', async (ctx) => { + await generateService({ + schemaPath: `${__dirname}/example-files/openapi-priority-rule.json`, + serversPath: './apis/exclude/test2', + requestLibPath: '../request', + enableLogging: true, // 开启日志 + priorityRule: 'exclude', + includeTags: [], + includePaths: [], + excludeTags: ['sys-a', 'user-z'], + excludePaths: [], + }); + await expect( + readGeneratedFiles('./apis/exclude/test2') + ).resolves.toMatchFileSnapshot(getSnapshotDir(ctx)); + }); + + /** + * 结果 ['/sys-b/**', '/sys-c/**', '/user-x/**', '/user-y/**'] + */ + it('should only excludePaths set works', async (ctx) => { + await generateService({ + schemaPath: `${__dirname}/example-files/openapi-priority-rule.json`, + serversPath: './apis/exclude/test3', + requestLibPath: '../request', + enableLogging: true, // 开启日志 + priorityRule: 'exclude', + includeTags: [], + includePaths: [], + excludeTags: [], + excludePaths: ['/sys-a/**', '/user-z/**'], + }); + await expect( + readGeneratedFiles('./apis/exclude/test3') + ).resolves.toMatchFileSnapshot(getSnapshotDir(ctx)); + }); + + /** + * 结果 [] + */ + it('should excludeTags set works to exclude all', async (ctx) => { + await generateService({ + schemaPath: `${__dirname}/example-files/openapi-priority-rule.json`, + serversPath: './apis/exclude/test4', + requestLibPath: '../request', + enableLogging: true, // 开启日志 + priorityRule: 'exclude', + includeTags: [], + includePaths: [], + excludeTags: [/.*/g], + excludePaths: [], + }); + await expect( + readGeneratedFiles('./apis/exclude/test4') + ).resolves.toMatchFileSnapshot(getSnapshotDir(ctx)); + }); + + /** + * 结果 ['/sys-c/**', '/user-x/**'] + */ + it('should excludeTags and excludePaths both set works', async (ctx) => { + await generateService({ + schemaPath: `${__dirname}/example-files/openapi-priority-rule.json`, + serversPath: './apis/exclude/test5', + requestLibPath: '../request', + enableLogging: true, // 开启日志 + priorityRule: 'exclude', + includeTags: [], + includePaths: [], + excludeTags: ['sys-a', 'user-z'], + excludePaths: ['/sys-b/**', '/user-y/**'], + }); + await expect( + readGeneratedFiles('./apis/exclude/test5') + ).resolves.toMatchFileSnapshot(getSnapshotDir(ctx)); + }); +}); diff --git a/test/excludeTest.ts b/test/excludeTest.ts deleted file mode 100644 index 6572a66..0000000 --- a/test/excludeTest.ts +++ /dev/null @@ -1,87 +0,0 @@ -import { generateService } from '../src/index'; - -/** - * 结果 [*] - */ -const excludeTest1 = async () => - await generateService({ - schemaPath: `${__dirname}/example-files/openapi-priority-rule.json`, - serversPath: './apis/exclude/test1', - requestLibPath: '../request', - enableLogging: true, // 开启日志 - priorityRule: 'exclude', - includeTags: [], - includePaths: [], - excludeTags: [], - excludePaths: [], - }); - -/** - * 结果 ['/sys-b/**', '/sys-c/**', '/user-x/**', '/user-y/**'] - */ -const excludeTest2 = async () => - await generateService({ - schemaPath: `${__dirname}/example-files/openapi-priority-rule.json`, - serversPath: './apis/exclude/test2', - requestLibPath: '../request', - enableLogging: true, // 开启日志 - priorityRule: 'exclude', - includeTags: [], - includePaths: [], - excludeTags: ['sys-a', 'user-z'], - excludePaths: [], - }); - -/** - * 结果 ['/sys-a/**', '/sys-c/**', '/user-x/**', '/user-z/**'] - */ -const excludeTest3 = async () => - await generateService({ - schemaPath: `${__dirname}/example-files/openapi-priority-rule.json`, - serversPath: './apis/exclude/test3', - requestLibPath: '../request', - enableLogging: true, // 开启日志 - priorityRule: 'exclude', - includeTags: [], - includePaths: [], - excludeTags: [], - excludePaths: ['/sys-a/**', '/user-z/**'], - }); - -/** - * 结果 [] - */ -const excludeTest4 = async () => - await generateService({ - schemaPath: `${__dirname}/example-files/openapi-priority-rule.json`, - serversPath: './apis/exclude/test4', - requestLibPath: '../request', - enableLogging: true, // 开启日志 - priorityRule: 'exclude', - includeTags: [], - includePaths: [], - excludeTags: [/.*/g], - excludePaths: [], - }); - -/** - * 结果 ['/sys-c/**', '/user-x/**'] - */ -const excludeTest5 = async () => - await generateService({ - schemaPath: `${__dirname}/example-files/openapi-priority-rule.json`, - serversPath: './apis/exclude/test5', - requestLibPath: '../request', - enableLogging: true, // 开启日志 - priorityRule: 'exclude', - includeTags: [], - includePaths: [], - excludeTags: ['sys-a', 'user-z'], - excludePaths: ['/sys-b/**', '/user-y/**'], - }); - -excludeTest1(); -excludeTest2(); -excludeTest3(); -excludeTest4(); -excludeTest5(); diff --git a/test/genOpenapi.js b/test/genOpenapi.js deleted file mode 100644 index f7cfd02..0000000 --- a/test/genOpenapi.js +++ /dev/null @@ -1,7 +0,0 @@ -const { generateService } = require('../dist/index'); - -generateService({ - schemaPath: `${__dirname}/example-files/openapi-response-desc.json`, - serversPath: './apis/openapi-response-desc', - isSupportParseEnumDesc: true, -}); diff --git a/test/include.spec.ts b/test/include.spec.ts new file mode 100644 index 0000000..6f2e0bb --- /dev/null +++ b/test/include.spec.ts @@ -0,0 +1,116 @@ +import { describe, expect, it } from 'vitest'; + +import { generateService } from '../src/index'; +import { getSnapshotDir, readGeneratedFiles } from './testUtils'; + +describe('openAPI.generateService priorityRule=include', () => { + /** + * 结果 [*] + */ + it('should include all while no include and exclude set', async (ctx) => { + await generateService({ + schemaPath: `${__dirname}/example-files/openapi-priority-rule.json`, + serversPath: './apis/include/test1', + requestLibPath: '../request', + enableLogging: true, // 开启日志 + }); + await expect( + readGeneratedFiles('./apis/include/test1') + ).resolves.toMatchFileSnapshot(getSnapshotDir(ctx)); + }); + + /** + * 结果 [] + */ + it('should return empty while include tags is empty', async (ctx) => { + await generateService({ + schemaPath: `${__dirname}/example-files/openapi-priority-rule.json`, + serversPath: './apis/include/test2', + requestLibPath: '../request', + enableLogging: true, // 开启日志 + priorityRule: 'include', + includeTags: [], + includePaths: ['/sys-a/**', '/sys-b/**', '/sys-c/**'], + }); + await expect( + readGeneratedFiles('./apis/include/test2') + ).resolves.toMatchFileSnapshot(getSnapshotDir(ctx)); + }); + + /** + * 结果 [*] + */ + it('should include all tags', async (ctx) => { + await generateService({ + schemaPath: `${__dirname}/example-files/openapi-priority-rule.json`, + serversPath: './apis/include/test3', + requestLibPath: '../request', + enableLogging: true, // 开启日志 + priorityRule: 'include', + includeTags: [/.*/g], + includePaths: [], + }); + await expect( + readGeneratedFiles('./apis/include/test3') + ).resolves.toMatchFileSnapshot(getSnapshotDir(ctx)); + }); + + /** + * 结果 ['/sys-a/**','/sys-b/**','/sys-c/**'] + */ + it('should only include the specified paths and includeTags', async (ctx) => { + await generateService({ + schemaPath: `${__dirname}/example-files/openapi-priority-rule.json`, + serversPath: './apis/include/test4', + requestLibPath: '../request', + enableLogging: true, // 开启日志 + priorityRule: 'include', + includeTags: [/.*/g], + includePaths: ['/sys-a/**', '/sys-b/**', '/sys-c/**'], + }); + await expect( + readGeneratedFiles('./apis/include/test4') + ).resolves.toMatchFileSnapshot(getSnapshotDir(ctx)); + }); + + /** + * 结果 ['/sys-a/a1/aa1/aaa1','/sys-a/a1/aa1/aaa1/aaaa1'] + */ + it('should excludePaths and excludePaths both specified', async (ctx) => { + await generateService({ + schemaPath: `${__dirname}/example-files/openapi-priority-rule.json`, + serversPath: './apis/include/test5', + requestLibPath: '../request', + enableLogging: true, // 开启日志 + priorityRule: 'include', + includeTags: ['sys-a'], + includePaths: ['/sys-a/a1/aa1/**'], + excludeTags: [], + excludePaths: [], + }); + await expect( + readGeneratedFiles('./apis/include/test5') + ).resolves.toMatchFileSnapshot(getSnapshotDir(ctx)); + }); + + /** + * 结果 ['/sys-a/**','/user-z/**'] + */ + it('should includeTags specified and includePaths are wildcard', async (ctx) => { + await generateService({ + schemaPath: `${__dirname}/example-files/openapi-priority-rule.json`, + serversPath: './apis/include/test6', + requestLibPath: '../request', + enableLogging: true, // 开启日志 + priorityRule: 'include', + includeTags: ['sys-a', 'user-z'], + includePaths: ['/**'], + excludeTags: [], + excludePaths: [], + }); + + await expect( + readGeneratedFiles('./apis/include/test6') + ).resolves.toMatchFileSnapshot(getSnapshotDir(ctx)); + }); +}); diff --git a/test/includeTest.ts b/test/includeTest.ts deleted file mode 100644 index 3d402bc..0000000 --- a/test/includeTest.ts +++ /dev/null @@ -1,93 +0,0 @@ -import { generateService } from '../src/index'; - -/** - * 结果 [*] - */ -const includeTest1 = async () => - await generateService({ - schemaPath: `${__dirname}/example-files/openapi-priority-rule.json`, - serversPath: './apis/include/test1', - requestLibPath: '../request', - enableLogging: true, // 开启日志 - }); - -/** - * 结果 [] - */ -const includeTest2 = async () => - await generateService({ - schemaPath: `${__dirname}/example-files/openapi-priority-rule.json`, - serversPath: './apis/include/test2', - requestLibPath: '../request', - enableLogging: true, // 开启日志 - priorityRule: 'include', - includeTags: [], - includePaths: ['/sys-a/**', '/sys-b/**', '/sys-c/**'], - }); - -/** - * 结果 ['/sys-a/**','/sys-b/**','/sys-c/**'] - */ -const includeTest3 = async () => - await generateService({ - schemaPath: `${__dirname}/example-files/openapi-priority-rule.json`, - serversPath: './apis/include/test3', - requestLibPath: '../request', - enableLogging: true, // 开启日志 - priorityRule: 'include', - includeTags: [/.*/g], - includePaths: [], - }); - -/** - * 结果 ['/sys-a/**','/sys-b/**','/sys-c/**'] - */ -const includeTest4 = async () => - await generateService({ - schemaPath: `${__dirname}/example-files/openapi-priority-rule.json`, - serversPath: './apis/include/test4', - requestLibPath: '../request', - enableLogging: true, // 开启日志 - priorityRule: 'include', - includeTags: [/.*/g], - includePaths: ['/sys-a/**', '/sys-b/**', '/sys-c/**'], - }); - -/** - * 结果 ['/sys-a/a1/aa1/aaa1','/sys-a/a1/aa1/aaa1/aaaa1'] - */ -const includeTest5 = async () => - await generateService({ - schemaPath: `${__dirname}/example-files/openapi-priority-rule.json`, - serversPath: './apis/include/test5', - requestLibPath: '../request', - enableLogging: true, // 开启日志 - priorityRule: 'include', - includeTags: ['sys-a'], - includePaths: ['/sys-a/a1/aa1/**'], - excludeTags: [], - excludePaths: [], - }); - -/** - * 结果 ['/sys-a/**','/user-z/**'] - */ -const includeTest6 = async () => - await generateService({ - schemaPath: `${__dirname}/example-files/openapi-priority-rule.json`, - serversPath: './apis/include/test6', - requestLibPath: '../request', - enableLogging: true, // 开启日志 - priorityRule: 'include', - includeTags: ['sys-a', 'user-z'], - includePaths: ['/**'], - excludeTags: [], - excludePaths: [], - }); - -includeTest1(); -includeTest2(); -includeTest3(); -includeTest4(); -includeTest5(); -includeTest6(); diff --git a/test/test.js b/test/test.js deleted file mode 100644 index d1b0838..0000000 --- a/test/test.js +++ /dev/null @@ -1,273 +0,0 @@ -const assert = require('assert'); -const path = require('path'); -const fs = require('fs'); - -const openAPI = require('../dist/index'); - -const gen = async () => { - // 测试空的 openapi 定义 - await openAPI.generateService({ - schemaPath: `${__dirname}/example-files/openapi-empty.json`, - serversPath: './apis/empty', - isDisplayTypeLabel: true, - isGenJsonSchemas: true, - }); - - // 测试 tags 为 undefined - await openAPI.generateService({ - schemaPath: `${__dirname}/example-files/openapi-tags-undefined.json`, - serversPath: './apis/tags-undefined', - }); - - // 测试 tags 为[] - await openAPI.generateService({ - schemaPath: `${__dirname}/example-files/openapi-tags-empty.json`, - serversPath: './apis/tags-empty', - }); - - // 测试 swagger => openapi, schema 循环引用 - await openAPI.generateService({ - schemaPath: `${__dirname}/example-files/swagger-get-method-params-convert-obj.json`, - serversPath: './apis/convert-obj', - }); - - // 测试空的 schema 引用 - await openAPI.generateService({ - schemaPath: `${__dirname}/example-files/openapi-schema-contain-blank-symbol.json`, - serversPath: './apis/blank-symbol', - }); - - // 自定义 hook - await openAPI.generateService({ - requestLibPath: "import request from '@/request';", - schemaPath: `${__dirname}/example-files/openapi-custom-hook.json`, - serversPath: './apis/custom', - hook: { - // 自定义类名 - customClassName: (tagName) => { - return /[A-Z].+/.exec(tagName); - }, - // 自定义函数名 - customFunctionName: (data) => { - let funName = data.operationId ? data.operationId : ''; - const suffix = 'Using'; - - if (funName.indexOf(suffix) != -1) { - funName = funName.substring(0, funName.lastIndexOf(suffix)); - } - - return funName; - }, - // 自定义类型名 - customTypeName: (data) => { - const { operationId } = data; - const funName = operationId - ? operationId[0].toUpperCase() + operationId.substring(1) - : ''; - const tag = data?.tags?.[0]; - - return `${tag ? tag : ''}${funName}`; - }, - // 自定义模板 - customTemplates: { - serviceController: (api, ctx) => { - if (api.method.toUpperCase() === 'GET') { - return ` -export async function ${api.functionName}(${api.params && api.hasParams ? `params: ${ctx.namespace}.${api.typeName}` : ''}) { - return request.get('${api.path}', { params }) -}`; - } else { - return ` -export async function ${api.functionName}(${api.body ? `data: ${api.body.type}` : ''}) { - return request.post('${api.path}', data) -}`; - } - }, - }, - }, - }); - - // 支持 null 类型作为默认值 - await openAPI.generateService({ - schemaPath: `${__dirname}/example-files/openapi.json`, - serversPath: './apis/support-null', - nullable: true, - mockFolder: './mocks', - }); - - // 正常命名文件和请求函数 - await openAPI.generateService({ - schemaPath: `${__dirname}/example-files/openapi-camelcase.json`, - serversPath: './apis/name/normal', - isCamelCase: false, - }); - - // 小驼峰命名文件和请求函数 - await openAPI.generateService({ - schemaPath: `${__dirname}/example-files/openapi-camelcase.json`, - serversPath: './apis/name/camelcase', - isCamelCase: true, - }); - - // 测试处理 allof 结构, 生成复杂 type 翻译 - await openAPI.generateService({ - schemaPath: `${__dirname}/example-files/openapi-test-allof-api.json`, - serversPath: './apis/allof', - isDisplayTypeLabel: true, - }); - - // 文件上传 - await openAPI.generateService({ - schemaPath: `${__dirname}/example-files/swagger-file-convert.json`, - serversPath: './apis/file', - isGenReactQuery: true, - }); - - // 生成枚举翻译, 生成 type 翻译 - await openAPI.generateService({ - schemaPath: `${__dirname}/example-files/openapi-display-enum-label.json`, - serversPath: './apis/display-enum-label', - isDisplayTypeLabel: true, - }); - - // 测试筛选出指定 tags 对应的api - await openAPI.generateService({ - schemaPath: `${__dirname}/example-files/openapi.json`, - serversPath: './apis/filter-tags', - includeTags: ['pet'], - }); - - // 测试 "COMPUTER SCIENCE" 这一类的枚举值在生成的类型中不报错 - await openAPI.generateService({ - schemaPath: `${__dirname}/example-files/openapi-complex-enum-convert.json`, - serversPath: './apis/complex-enum-convert', - includePaths: [/.*/g], - includeTags: [/.*/g], - }); - - // 测试生成 JSON Schemas - await openAPI.generateService({ - schemaPath: `${__dirname}/example-files/openapi-display-enum-label.json`, - serversPath: './apis/schemas', - isGenJsonSchemas: true, - }); - - // 测试设置 path 前缀 - await openAPI.generateService({ - schemaPath: `${__dirname}/example-files/swagger.json`, - serversPath: './apis/api-prefix', - apiPrefix: '"/pet"', - }); - - // 测试解析 swagger.yaml/openapi.yaml - await openAPI.generateService({ - schemaPath: `${__dirname}/example-files/swagger.yaml`, - serversPath: './apis/yaml', - }); - - // 测试将中文 tag 名称翻译成英文 tag 名称 - await openAPI.generateService({ - schemaPath: `${__dirname}/example-files/openapi-chinese-tag.json`, - serversPath: './apis/chinese-tag', - isTranslateToEnglishTag: true, - }); - - // 测试支持 components 非 schemas 的字段 - await openAPI.generateService({ - schemaPath: `${__dirname}/example-files/swagger-components-response.json`, - serversPath: './apis/components-response', - }); - - // 测试 $ref 引用中包含 encode 编码字符 - await openAPI.generateService({ - schemaPath: `${__dirname}/example-files/openapi-ref-encode-character.json`, - serversPath: './apis/ref-encode-character', - includeTags: ['商品基础管理'], - }); - - // 测试支持 apifox x-run-in-apifox - await openAPI.generateService({ - schemaPath: `${__dirname}/example-files/openapi-ref-encode-character.json`, - serversPath: './apis/x-run-in-apifox', - }); - - // 测试 schemas 包含枚举数组 - await openAPI.generateService({ - schemaPath: `${__dirname}/example-files/openapi-schemas-enum-array.json`, - serversPath: './apis/schemas-enum-array', - }); - - // 测试 只生成 typescript 类型,不生成请求函数 - await openAPI.generateService({ - schemaPath: `${__dirname}/example-files/openapi.json`, - serversPath: './apis/only-generate-typescript-type', - isOnlyGenTypeScriptType: true, - isDisplayTypeLabel: true, - isGenJsonSchemas: true, - }); - - // 测试 number类型 枚举 - await openAPI.generateService({ - schemaPath: `${__dirname}/example-files/openapi-number-enum.json`, - serversPath: './apis/number-enum', - }); - - // 测试 number类型 枚举,使用 desc 解析枚举 - await openAPI.generateService({ - schemaPath: `${__dirname}/example-files/openapi-desc-enum.json`, - serversPath: './apis/openapi-desc-enum', - isSupportParseEnumDesc: true, - }); - - // 测试支持 apifox x-apifox-enum - await openAPI.generateService({ - schemaPath: `${__dirname}/example-files/openapi-apifox-enum-label.json`, - serversPath: './apis/apifox-enum-label', - }); - - // 测试生成 react-query - await openAPI.generateService({ - schemaPath: `${__dirname}/example-files/openapi-display-enum-label.json`, - serversPath: './apis/react-query', - isGenReactQuery: true, - }); - - // 测试生成 react-query 的 vue 模式 - await openAPI.generateService({ - schemaPath: `${__dirname}/example-files/openapi-display-enum-label.json`, - serversPath: './apis/react-query-vue', - isGenReactQuery: true, - reactQueryMode: 'vue', - }); - - // 测试生成 JavaScript - await openAPI.generateService({ - schemaPath: `${__dirname}/example-files/openapi-display-enum-label.json`, - serversPath: './apis/javascript', - isGenReactQuery: true, - isGenJavaScript: true, - }); - - // 测试生成 response type comments - await openAPI.generateService({ - schemaPath: `${__dirname}/example-files/openapi-response-desc.json`, - serversPath: './apis/openapi-response-desc', - }); - - // 测试生成 匿名response => 具名response - await openAPI.generateService({ - schemaPath: `${__dirname}/example-files/openapi-response-desc.json`, - serversPath: './apis/openapi-anonymous-response', - }); - - // check 文件生成 - const fileControllerStr = fs.readFileSync( - path.join(__dirname, 'apis/file/fileController.ts'), - 'utf8' - ); - assert(fileControllerStr.indexOf('!(item instanceof File)') > 0); - assert(fileControllerStr.indexOf(`'multipart/form-data'`) > 0); - assert(fileControllerStr.indexOf('Content-Type') > 0); -}; - -gen(); diff --git a/test/testUtils.ts b/test/testUtils.ts new file mode 100644 index 0000000..d959cd1 --- /dev/null +++ b/test/testUtils.ts @@ -0,0 +1,33 @@ +import { sortBy } from 'lodash'; +import fs, { readFile } from 'node:fs/promises'; +import path from 'node:path'; +import sanitizeFilename from 'sanitize-filename'; +import { TestContext } from 'vitest'; + +export async function readGeneratedFiles(dir: string) { + const direntArray = await fs.readdir(dir, { + recursive: true, + withFileTypes: true, + }); + + const orderedFiles = sortBy( + direntArray + .filter((f) => f.isFile()) + .map((a) => path.join(a.parentPath, a.name)) + ); + + let finalContent = ''; + for (const file of orderedFiles) { + const singleFileContent = await readFile(file, 'utf-8'); + finalContent += singleFileContent; + } + + return finalContent; +} + +export function getSnapshotDir(ctx: TestContext) { + const snapFileName = sanitizeFilename(`${ctx.task.name}.snap`, { + replacement: '_', + }); + return `./__snapshots__/${path.basename(ctx.task.file.name).replace('.spec.ts', '')}/${snapFileName}`; +} diff --git a/vitest.config.ts b/vitest.config.ts new file mode 100644 index 0000000..baac3db --- /dev/null +++ b/vitest.config.ts @@ -0,0 +1,7 @@ +import { defineConfig } from 'vitest/config'; + +export default defineConfig({ + test: { + // ... + }, +});